Commit Graph
160 Commits
Author SHA1 Message Date
Braks f28e10b05a refactor(types): Remove internal __vf field
* fields are merged into the GraphNode / Node interface
* Remove passing props from VueFlow container, use injected state

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 3f0b0dbd70 feat(nodes): nested boundaries
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks f00f34d84b refactor(types)!: Remove ElementId type
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 4ef58e9e99 refactor(nodes)!: change xPos yPos props to position
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 9c1f04426e feat(nodes): add store id as class to handles
* for better identification, add a class to handle according to the current store id

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 601b65a75f update: use tryOnMounted
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-04 16:40:07 +01:00
Braks 58a8f9d4df refactor(store)!: remove pinia
* replace pinia with a reactive state object and inject/provide

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>

update(store)!: inject store if possible, otherwise create a new one by id

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-04 15:42:18 +01:00
Braks 27e39796a0 fix(nodes): nodeExtent not set on position update
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-26 15:33:56 +01:00
Braks b88f2105fb update(edges): add updatable as prop to edges
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-26 11:30:23 +01:00
Braks 4630f3efc1 refactor(edges): Make edge updating optional
* add an option to enable edge updating globally
* pass an option to an edge to enable updating for a single edge

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-26 11:08:12 +01:00
Braks 98b6fdb717 update: watch node height too for updating dimensions
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 20:38:52 +01:00
Braks 0b2764028f update(nodes): watch nodes width for dimension update
* add force param to setElements, if set we clear the elements arr (default true)
* wait for store watcher until store is ready (i.e. a state has been set)
* move renderer css class to Renderer.vue

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 19:29:13 +01:00
Braks f2e38ca7ac update(nodes): add __vf to node props
* move edge/node component-types to components file

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks 9e941966a4 feat(nodes): add option to pass a valid target pos / valid source pos func to nodes
* edge updater cannot discern a valid connection by itself so we allow an option to pass a valid connection func to nodes which will then be used to determine if updating connection is valid
* it is optional, by default all connections are valid

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks 929a6e637b update(edges): Add edge as param to edgeupdateend event
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks 7916b20a99 fix(types): edge-text typing
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks 8b0ddc9be9 refactor(types): Remove SourceTargetNode-type
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks e6a54d482a update: import path in node wrapper
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks ac2e2d5f0a refactor: remove updateNodePosDiff from node selection
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks 8f65918760 refactor(nodes): use v-model to reactively change node props
* instead of re-parsing we proxy the node values and change them with a v-model

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks 84bad861ea refactor(nodes): remove __vf.position
* duplicate position values as __vf.position and position save the same values

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks 89849f4eac update(connection): pass source node to ConnectionLine as prop
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-25 15:21:36 +01:00
Braks 5011bf035e fix(nodes): missing element click event
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-24 00:20:58 +01:00
Braks da4fd4f7ce feat(nodes): Allow nodes to pass all draggable options
* omits scale, grid, enableuserselecthack and enabletransformfix as valid options for draggable
* remove event interface and emits from nodewrapper

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-24 00:02:30 +01:00
Braks d22e21041d fix(edges): edges not reacting to hidden nodes
* Change getEdges to parse edges with source & target nodes and filter if one of them is missing
* add new type for Edges w sourceTargetNode called GraphEdge which is the return type of getEdges
*

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 18:25:08 +01:00
Braks c0f7e5c9e9 update: add scale prop to draggable
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 16:56:16 +01:00
Braks 54d5780feb fix: missing props on Draggable
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 16:17:02 +01:00
Braks 67634fd72e feat(connection): Extend connection line props for more advanced usage
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 14:38:49 +01:00
Braks 0e803839d6 feat(BezierEdge): use quadratic bezier curve for top-left and bottom-right edges
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 13:58:20 +01:00
Braks d87388fbe6 fix: connection line position incorrectly calculated
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-23 13:00:29 +01:00
Braks 0dd5ed7836 fix(types): edge text type
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 21:38:31 +01:00
Braks c7dca2cbd0 refactor: change prop types for NodeWrapper
* don't split node prop into smaller ones

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 17:33:12 +01:00
Braks f86033c1e8 refactor: change prop types for EdgeWrapper
* don't split edge prop into smaller ones

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 17:25:25 +01:00
Braks b9bb3cfb1a update(types): remove null types and use undefined
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 17:14:57 +01:00
Braks fec38a129a fix!: prop typings
* remove wrapper exports from library

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 15:49:27 +01:00
Braks 4932c64d52 update: define emittable events for EdgeWrapper
* add onEdgeUpdateEnd callback to useHandle

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 15:13:46 +01:00
Braks 1ea6e4f8da update: pass selected elements as prop to nodesselection
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 14:22:35 +01:00
Braks 5c3a1fba13 update: remove useStore from handle
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 14:22:11 +01:00
Braks 049b701580 update: use controlledComputed for edges/nodes
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 14:10:49 +01:00
Braks 2b065b4e56 update: pass store state as props to edge-renderer and edge
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 13:40:25 +01:00
Braks 6059b02e44 update: Pass down values as props instead of relying on store
* store values are passed down by main vue flow component
* store is only used to emit events or if really necessary in the component
* add keys with store id to elements
*

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 12:25:32 +01:00
Braks c35673c622 refactor: pass props to edge/nodewrapper separately
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-22 01:22:27 +01:00
Braks a55e33f91f feat: add draghandle prop to node
* specify a drag handle on the node

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 21:50:49 +01:00
Braks c48a0a9e2a fix: add missing click and doubleclick events to nodes/edges
* ssr bug

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 18:19:06 +01:00
Braks fd71e1e16e update: Add names to components
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 16:54:59 +01:00
Braks 062aee45b2 update!: graphnode and node typing
* graphnode is a node containing internal Vue Flow data
* move util files to util directory
* move flow actions type into store file
* rename panel type file to zoom
* rename types file to flow
* Rename Node to NodeWrapper
* Rename Edge to EdgeWrapper

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 16:25:27 +01:00
Braks ba24f3ca62 update(edges): useAttrs on edges to use style
* remove class and style props, pass them as attrs

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 13:33:59 +01:00
Braks e4ead738c9 update(types): Correct __vf typing
* fix all uses of __vf so the actual type works properly
* correct the class and style props

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 13:33:12 +01:00
Braks 0e9f8c5fc2 refactor: rename internal data field to __vf
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 12:54:04 +01:00
Braks da29a613f0 feat(slots): Add node and edge renderer slots
* more flexibility by having the ability to use the node/edge-renderer and wrapper
* export renderer and wrapper from lib entry

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-11-21 12:34:28 +01:00