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>
This commit is contained in:
@@ -205,9 +205,9 @@ onMounted(async () => {
|
|||||||
getEdges: onLoadGetEdges(store),
|
getEdges: onLoadGetEdges(store),
|
||||||
toObject: onLoadToObject(store),
|
toObject: onLoadToObject(store),
|
||||||
}
|
}
|
||||||
store.hooks.paneReady.trigger(instance)
|
|
||||||
store.instance = instance
|
store.instance = instance
|
||||||
store.fitViewOnInit && instance.fitView()
|
store.fitViewOnInit && instance.fitView()
|
||||||
|
store.hooks.paneReady.trigger(instance)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|||||||
+1
-1
@@ -179,5 +179,5 @@ export type UseVueFlow<N = any, E = N> = {
|
|||||||
store: FlowStore<N, E>
|
store: FlowStore<N, E>
|
||||||
} & FlowHooksOn<N, E> &
|
} & FlowHooksOn<N, E> &
|
||||||
ToRefs<State<N, E>> &
|
ToRefs<State<N, E>> &
|
||||||
Getters &
|
Getters<N, E> &
|
||||||
Actions<N, E>
|
Actions<N, E>
|
||||||
|
|||||||
+7
-7
@@ -10,14 +10,14 @@ import { FlowHooks, FlowHooksOn } from './hooks'
|
|||||||
|
|
||||||
export interface State<N = any, E = N> extends Omit<FlowOptions<N, E>, 'id' | 'modelValue'> {
|
export interface State<N = any, E = N> extends Omit<FlowOptions<N, E>, 'id' | 'modelValue'> {
|
||||||
hooks: FlowHooks
|
hooks: FlowHooks
|
||||||
instance?: FlowInstance
|
instance: FlowInstance | undefined
|
||||||
|
|
||||||
nodes: GraphNode<N>[]
|
nodes: GraphNode<N>[]
|
||||||
edges: GraphEdge<E>[]
|
edges: GraphEdge<E>[]
|
||||||
|
|
||||||
d3Zoom?: D3Zoom
|
d3Zoom: D3Zoom | undefined
|
||||||
d3Selection?: D3Selection
|
d3Selection: D3Selection | undefined
|
||||||
d3ZoomHandler?: D3ZoomHandler
|
d3ZoomHandler: D3ZoomHandler | undefined
|
||||||
minZoom: number
|
minZoom: number
|
||||||
maxZoom: number
|
maxZoom: number
|
||||||
defaultZoom: number
|
defaultZoom: number
|
||||||
@@ -37,9 +37,9 @@ export interface State<N = any, E = N> extends Omit<FlowOptions<N, E>, 'id' | 'm
|
|||||||
multiSelectionKeyCode: KeyCode
|
multiSelectionKeyCode: KeyCode
|
||||||
zoomActivationKeyCode: KeyCode
|
zoomActivationKeyCode: KeyCode
|
||||||
|
|
||||||
connectionNodeId?: string
|
connectionNodeId: string | undefined
|
||||||
connectionHandleId?: string
|
connectionHandleId: string | undefined
|
||||||
connectionHandleType?: HandleType
|
connectionHandleType: HandleType | undefined
|
||||||
connectionPosition: XYPosition
|
connectionPosition: XYPosition
|
||||||
connectionMode: ConnectionMode
|
connectionMode: ConnectionMode
|
||||||
connectionLineType: ConnectionLineType
|
connectionLineType: ConnectionLineType
|
||||||
|
|||||||
Reference in New Issue
Block a user