feat(core): allow string array or object as class to node/edge objects (#1502)
* feat(core): allow string array as class * chore(changeset): add * feat(core): allow record as class * chore(changeset): add
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@vue-flow/core": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Allow passing a Record<string, any> as class to node/edge objects
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@vue-flow/core": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Allow passing an array of strings as class to node/edge objects
|
||||||
@@ -92,7 +92,7 @@ export interface DefaultEdge<
|
|||||||
/** Disable/enable deleting edge */
|
/** Disable/enable deleting edge */
|
||||||
deletable?: boolean
|
deletable?: boolean
|
||||||
/** Additional class names, can be a string or a callback returning a string (receives current flow element) */
|
/** Additional class names, can be a string or a callback returning a string (receives current flow element) */
|
||||||
class?: string | ClassFunc<GraphEdge<Data, CustomEvents>>
|
class?: string | string[] | Record<string, any> | ClassFunc<GraphEdge<Data, CustomEvents>>
|
||||||
/** Additional styles, can be an object or a callback returning an object (receives current flow element) */
|
/** Additional styles, can be an object or a callback returning an object (receives current flow element) */
|
||||||
style?: Styles | StyleFunc<GraphEdge<Data, CustomEvents>>
|
style?: Styles | StyleFunc<GraphEdge<Data, CustomEvents>>
|
||||||
/** Is edge hidden */
|
/** Is edge hidden */
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export interface Node<Data = ElementData, CustomEvents extends Record<string, Cu
|
|||||||
height?: number | string | HeightFunc
|
height?: number | string | HeightFunc
|
||||||
|
|
||||||
/** Additional class names, can be a string or a callback returning a string (receives current flow element) */
|
/** Additional class names, can be a string or a callback returning a string (receives current flow element) */
|
||||||
class?: string | ClassFunc<GraphNode<Data, CustomEvents>>
|
class?: string | string[] | Record<string, any> | ClassFunc<GraphNode<Data, CustomEvents>>
|
||||||
/** Additional styles, can be an object or a callback returning an object (receives current flow element) */
|
/** Additional styles, can be an object or a callback returning an object (receives current flow element) */
|
||||||
style?: Styles | StyleFunc<GraphNode<Data, CustomEvents>>
|
style?: Styles | StyleFunc<GraphNode<Data, CustomEvents>>
|
||||||
/** Is node hidden */
|
/** Is node hidden */
|
||||||
|
|||||||
Reference in New Issue
Block a user