Commit Graph
248 Commits
Author SHA1 Message Date
Braks 37382881af chore: remove unused var 2022-04-04 21:42:48 +02:00
Braks 271d793327 fix: edges not selected on user selection 2022-04-04 21:42:48 +02:00
Braks 024a434918 update: move mounted hooks up
* remove mounted hook from selection pane
2022-04-04 21:42:48 +02:00
Braks 70a349f7e1 fix(zoom): prevent scroll when zoom on scroll is false 2022-04-04 21:42:48 +02:00
Braks 2b2aad8cdc fix: default prop value for zoomActivationKeyCode 2022-04-04 21:42:48 +02:00
Braks 0bb54d6d36 refactor(zoom): Rename paneMovable to panOnDrag 2022-04-04 21:42:48 +02:00
Braks c544a02344 feat(zoom): Add noPanClassName, noWheelClassName & noDragClassName
* For more flexible zoom behavior
2022-04-04 21:42:48 +02:00
Braks 728046505c refactor(store): use null instead of undefined for optional state properties
* remove setConnectionNodeId action
2022-04-04 21:42:48 +02:00
Braks 188156dd0b fix(store): setting store state after init 2022-04-04 21:42:48 +02:00
Braks c818a5863c fix(nodes): pass all required props to node components 2022-04-04 21:42:48 +02:00
Braks 0093df43a9 feat(nodes, edges, store): Add updateNodeDimensions actions
* Returns new changes for updating node dimensions
* Add expandParent prop to nodes when parents should be expanded to fit the new child in them
*
2022-04-04 21:42:48 +02:00
Braks 5cc0da29c0 refactor: shorten watcher 2022-03-24 16:56:31 +01:00
Braks 6a2c1b00d7 feat: Enable passing components as node/edge-types
* Instead of using slots (re)-enable passing components for node/edge-types
2022-03-23 15:49:00 +01:00
Braks 05929299d3 refactor(zoom): Move paneReady event to transformation pane mounted hook
* await dimensions in fitView function
2022-03-16 16:02:26 +01:00
Braks c21ac7dca4 feat(docs): Add comments to types 2022-03-14 18:20:58 +01:00
Braks d948f5eef4 feat(zoom): Allow zoomOnScroll & panOnScroll to be used without an activation key
* activation key is undefined by default, if undefined key is always "pressed"
2022-03-14 14:10:38 +01:00
Braks afaa038584 fix(zoom): prevent zoom when zoomOnScroll is disabled 2022-03-12 18:28:35 +01:00
bcakmakoglu fd951e8bb8 fix(zoom): fitViewOnInit not passed to zoomPane
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 17:29:29 +01:00
bcakmakoglu 994b403089 feat(edges): allow markers to have unique id
* fix overwriting by spreading marker def

Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 17:11:54 +01:00
bcakmakoglu c31deb897d update(edges): filter edges of hidden nodes
* we don't want to show edges that go seemingly nowhere

Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 16:34:50 +01:00
bcakmakoglu 6746d6bb46 fix(flow): fix typo in paneMovable prop
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 12:07:57 +01:00
bcakmakoglu 36ac64f054 refactor: add default theme to style.css
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 08:49:45 +01:00
bcakmakoglu 1def3a9fb3 fix(edges): Markers not displayed
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-03-08 08:47:14 +01:00
bcakmakoglu b7abb31c24 chore: couple minor fixes
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu c5b39d4588 feat: try to dispose states on unmount
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu a3b2348ea7 update: use prop for fitViewOnInit
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu 2731d0bf5e fix: typings for UseVueFlow
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
bcakmakoglu f44784b1d0 chore: fix examples
Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
Braks 16997494ab update(zoom): set store instance before emitting pane-ready event
* add missing generics on getters
* replace ? notation with undefined (does not mean the exact same, i.e.
`instance?: FlowInstance` will become `Ref<FlowInstance | undefined> | undefined`
using `instance: FlowInstance | undefined` results in `Ref<FlowInstance | undefined>`

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2022-02-21 20:25:17 +01:00
Braks dcbe9865e9 refactor(flow): remove defaults for props
* defaults are set by store
* use watcher immediate trigger only if prop exists

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks f2fe93f1db update(edges): use computed getters to group edges by z-level
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 8fbfca1e7a refactor(edges)!: Replace getMarkerEnd utility with getMarkerId
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks a9e7eb31ea feat(flow): Narrow options type for useNodesState/useEdgesState/useElementsState
* remove storageKey
* make modelValue optional

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks ee6bf3252e refactor(flow): Watch models
* replace model value after re-setting elements/nodes/edges

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks df17da71fa update: remove v-if on edge-renderer
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 7367345d8d update: v-if on node/edgerenderer
* add applyDefault to state

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 947baefa02 update(nodes): Add draggable,selectable and connectable as props to nodes
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks e91188de5c feat(edges): add selectable option to edges
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks e2e094b987 feat(flow): Add option to disable default change handlers globally
* overwrites applyDefault setting for useEdgeState/useNodeState/useElementsState
* export apply change handlers

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 423f6aa78d refactor(flow): remove separate apply changes function and add them to useNodesState useEdgesState
* immedatiely execute props watcher

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 535f7e60f2 fix(flow): re-set elements if elements are empty and modelValue contains els
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 1b206c942c feat(edges): Add source-target-pos to graph-edge
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 600e3866c4 fix: replace store id with flow id
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks f8a23c59ec refactor(flow)!: Use watcher to change every prop as a single item
* instead of replacing the whole state on each watch trigger, split into multiple watchers that set a single state
* improve reacitivty and two-way binding for v-models
* remove elements option -> only modelValue (old api) or nodes/edges

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 91009e1dca feat(store): add store as refs to useVueFlow
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks be725c6d2d feat(flow): use vModel for elements, nodes and edges
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 758f4f23ff refactor(store): Rename isReady to paneReady
Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
2021-12-20 19:29:52 +01:00
Braks 65b2e0d148 feat(flow): Add setNodes and OnNodesChange / setEdges OnEdgesChange utils to useNode/Edge-state
* add option to apply default change handler
2021-12-20 19:29:52 +01:00
Braks 17a1b08ee0 refactor(store)!: replace store injection with VueFlow injection 2021-12-20 19:29:52 +01:00
Braks c80ab8fe50 feat(store, flow)!: Add useNode/useEdge-state helpers
* for two way binding use the helpers
2021-12-20 19:29:52 +01:00