v-nuxt-ui 0.2.9 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
|
@@ -27,13 +27,13 @@ type __VLS_Props = {
|
|
|
27
27
|
fitViewPadding?: number;
|
|
28
28
|
noFlowNodeBorder?: boolean;
|
|
29
29
|
};
|
|
30
|
-
declare var
|
|
30
|
+
declare var __VLS_22: {
|
|
31
31
|
data: any;
|
|
32
|
-
},
|
|
32
|
+
}, __VLS_63: {};
|
|
33
33
|
type __VLS_Slots = {} & {
|
|
34
|
-
node?: (props: typeof
|
|
34
|
+
node?: (props: typeof __VLS_22) => any;
|
|
35
35
|
} & {
|
|
36
|
-
default?: (props: typeof
|
|
36
|
+
default?: (props: typeof __VLS_63) => any;
|
|
37
37
|
};
|
|
38
38
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
39
|
"update:modelValue": (value: Flow) => any;
|
|
@@ -220,11 +220,35 @@ const defaultEdgeOptions = computed(() => {
|
|
|
220
220
|
animated: false
|
|
221
221
|
};
|
|
222
222
|
});
|
|
223
|
+
const flowContainer = ref(null);
|
|
224
|
+
let resizeObserver = null;
|
|
225
|
+
let prevWidth = 0;
|
|
226
|
+
onMounted(() => {
|
|
227
|
+
setTimeout(() => {
|
|
228
|
+
const el = flowContainer.value?.$el ?? flowContainer.value;
|
|
229
|
+
if (!el) return;
|
|
230
|
+
prevWidth = el.clientWidth;
|
|
231
|
+
resizeObserver = new ResizeObserver((entries) => {
|
|
232
|
+
const entry = entries[0];
|
|
233
|
+
if (!entry) return;
|
|
234
|
+
const newWidth = entry.contentRect.width;
|
|
235
|
+
if (newWidth !== prevWidth) {
|
|
236
|
+
prevWidth = newWidth;
|
|
237
|
+
nextTick(() => vueFlowFitView({ padding: props.fitViewPadding }));
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
resizeObserver.observe(el);
|
|
241
|
+
}, 200);
|
|
242
|
+
});
|
|
243
|
+
onBeforeUnmount(() => {
|
|
244
|
+
resizeObserver?.disconnect();
|
|
245
|
+
});
|
|
223
246
|
const isValidConnection = () => true;
|
|
224
247
|
</script>
|
|
225
248
|
|
|
226
249
|
<template>
|
|
227
250
|
<VueFlow
|
|
251
|
+
ref="flowContainer"
|
|
228
252
|
v-model:nodes="nodes"
|
|
229
253
|
v-model:edges="edges"
|
|
230
254
|
:default-zoom="defaultZoom"
|
|
@@ -27,13 +27,13 @@ type __VLS_Props = {
|
|
|
27
27
|
fitViewPadding?: number;
|
|
28
28
|
noFlowNodeBorder?: boolean;
|
|
29
29
|
};
|
|
30
|
-
declare var
|
|
30
|
+
declare var __VLS_22: {
|
|
31
31
|
data: any;
|
|
32
|
-
},
|
|
32
|
+
}, __VLS_63: {};
|
|
33
33
|
type __VLS_Slots = {} & {
|
|
34
|
-
node?: (props: typeof
|
|
34
|
+
node?: (props: typeof __VLS_22) => any;
|
|
35
35
|
} & {
|
|
36
|
-
default?: (props: typeof
|
|
36
|
+
default?: (props: typeof __VLS_63) => any;
|
|
37
37
|
};
|
|
38
38
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
39
|
"update:modelValue": (value: Flow) => any;
|
package/package.json
CHANGED