From f8cf71cfb8cf92f3f3ced1774b6fe5f5912ed607 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Sat, 4 Dec 2021 14:52:26 +0100 Subject: [PATCH] refactor(store): rename param of setState * newState -> opts Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com> --- src/container/VueFlow/VueFlow.vue | 31 ++----------- src/store/actions.ts | 73 +++++++++++++++---------------- 2 files changed, 39 insertions(+), 65 deletions(-) diff --git a/src/container/VueFlow/VueFlow.vue b/src/container/VueFlow/VueFlow.vue index 50a72094..07b92a9e 100644 --- a/src/container/VueFlow/VueFlow.vue +++ b/src/container/VueFlow/VueFlow.vue @@ -63,44 +63,19 @@ interface FlowProps extends FlowOptions { const props = withDefaults(defineProps(), { modelValue: () => [], - edgeTypes: () => [], - nodeTypes: () => [], - connectionMode: ConnectionMode.Loose, - connectionLineType: ConnectionLineType.Bezier, - selectionKeyCode: 'Shift', - multiSelectionKeyCode: 'Meta', - zoomActivationKeyCode: 'Meta', - deleteKeyCode: 'Backspace', snapToGrid: false, - snapGrid: () => [15, 15], onlyRenderVisibleElements: false, edgesUpdatable: false, nodesConnectable: true, nodesDraggable: true, elementsSelectable: true, selectNodesOnDrag: true, - minZoom: 0.5, - maxZoom: 2, - defaultZoom: 1, - defaultPosition: () => [0, 0], - translateExtent: () => [ - [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY], - [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY], - ], - nodeExtent: () => [ - [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY], - [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY], - ], - arrowHeadColor: '#b1b1b7', preventScrolling: true, zoomOnScroll: true, zoomOnPinch: true, zoomOnDoubleClick: true, panOnScroll: false, - panOnScrollSpeed: 0.5, - panOnScrollMode: PanOnScrollMode.Free, paneMoveable: true, - edgeUpdaterRadius: 10, }) const emit = defineEmits([...Object.keys(createHooks()), 'update:modelValue']) const store = initFlow(emit, props.id) @@ -231,9 +206,9 @@ export default { -