@vunk/graph 0.0.2 → 0.0.3

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.
@@ -22,29 +22,29 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
22
22
  }>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
23
23
  readonly VkPopupProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
24
24
  modelValue: {
25
- type: BooleanConstructor;
26
- default: boolean;
25
+ type: StringConstructor;
26
+ default: undefined;
27
27
  };
28
- closeable: {
29
- type: BooleanConstructor;
30
- default: boolean;
28
+ trigger: {
29
+ type: import("vue").PropType<"hover" | "click" | "none">;
30
+ default: string;
31
31
  };
32
32
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
33
33
  'update:modelValue': null;
34
34
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
35
35
  modelValue: {
36
- type: BooleanConstructor;
37
- default: boolean;
36
+ type: StringConstructor;
37
+ default: undefined;
38
38
  };
39
- closeable: {
40
- type: BooleanConstructor;
41
- default: boolean;
39
+ trigger: {
40
+ type: import("vue").PropType<"hover" | "click" | "none">;
41
+ default: string;
42
42
  };
43
43
  }>> & Readonly<{
44
44
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
45
45
  }>, {
46
- modelValue: boolean;
47
- closeable: boolean;
46
+ modelValue: string;
47
+ trigger: "none" | "click" | "hover";
48
48
  }, {}, {
49
49
  VkGraphViewUi: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
50
50
  coordinates: {
@@ -37,6 +37,13 @@ const props = {
37
37
  activeColor: {
38
38
  type: String,
39
39
  default: "#409EFF"
40
+ },
41
+ /**
42
+ * before leave 当返回 false 时阻止隐藏
43
+ */
44
+ beforeLeave: {
45
+ type: Function,
46
+ default: void 0
40
47
  }
41
48
  };
42
49
  const emits = {
@@ -104,6 +111,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
104
111
  leaveTimer = setTimeout(() => {
105
112
  if (props.contextMenu && contextmenuState.show)
106
113
  return;
114
+ if (props.beforeLeave) {
115
+ const v = props.beforeLeave();
116
+ if (v === false)
117
+ return;
118
+ }
107
119
  emit("update:modelValue", "");
108
120
  }, props.leaveDelay);
109
121
  }
@@ -1,3 +1,5 @@
1
+ import type { AnyFunc } from '@vunk/shared';
2
+ import type { PropType } from 'vue';
1
3
  import type { RightClickEvent } from './types';
2
4
  export declare const props: {
3
5
  /**
@@ -35,6 +37,13 @@ export declare const props: {
35
37
  type: StringConstructor;
36
38
  default: string;
37
39
  };
40
+ /**
41
+ * before leave 当返回 false 时阻止隐藏
42
+ */
43
+ beforeLeave: {
44
+ type: PropType<AnyFunc>;
45
+ default: undefined;
46
+ };
38
47
  };
39
48
  export declare const emits: {
40
49
  'update:modelValue': null;
@@ -19,6 +19,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
19
19
  type: StringConstructor;
20
20
  default: string;
21
21
  };
22
+ beforeLeave: {
23
+ type: import("vue").PropType<import("@vunk/shared").AnyFunc>;
24
+ default: undefined;
25
+ };
22
26
  }>, {
23
27
  props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
24
28
  contextMenu: {
@@ -41,6 +45,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
41
45
  type: StringConstructor;
42
46
  default: string;
43
47
  };
48
+ beforeLeave: {
49
+ type: import("vue").PropType<import("@vunk/shared").AnyFunc>;
50
+ default: undefined;
51
+ };
44
52
  }>> & Readonly<{
45
53
  onRightClick?: ((e: import("./types").RightClickEvent) => any) | undefined;
46
54
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
@@ -181,6 +189,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
181
189
  type: StringConstructor;
182
190
  default: string;
183
191
  };
192
+ beforeLeave: {
193
+ type: import("vue").PropType<import("@vunk/shared").AnyFunc>;
194
+ default: undefined;
195
+ };
184
196
  }>> & Readonly<{
185
197
  onRightClick?: ((e: import("./types").RightClickEvent) => any) | undefined;
186
198
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
@@ -190,5 +202,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
190
202
  leaveDelay: number;
191
203
  enterDelay: number;
192
204
  activeColor: string;
205
+ beforeLeave: import("@vunk/shared").AnyFunc;
193
206
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
194
207
  export default _default;
@@ -4,6 +4,20 @@ import { defineComponent, reactive, onMounted, onBeforeUnmount, resolveComponent
4
4
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
5
5
 
6
6
  const props = {
7
+ /**
8
+ * 是否启用popup功能
9
+ */
10
+ popup: {
11
+ type: Boolean,
12
+ default: false
13
+ },
14
+ /**
15
+ * 触发方式,可选值有 click 和 hover
16
+ */
17
+ popupTrigger: {
18
+ type: String,
19
+ default: "hover"
20
+ },
7
21
  /**
8
22
  * 是否启用右键菜单功能
9
23
  */
@@ -31,6 +45,13 @@ const props = {
31
45
  enterDelay: {
32
46
  type: Number,
33
47
  default: 0
48
+ },
49
+ /**
50
+ * before leave 当返回 false 时阻止隐藏
51
+ */
52
+ beforeLeave: {
53
+ type: Function,
54
+ default: void 0
34
55
  }
35
56
  };
36
57
  const emits = {
@@ -68,6 +89,11 @@ var _sfc_main = defineComponent({
68
89
  leaveTimer = setTimeout(() => {
69
90
  if (props2.contextMenu && contextmenuState.show)
70
91
  return;
92
+ if (props2.beforeLeave) {
93
+ const v = props2.beforeLeave();
94
+ if (v === false)
95
+ return;
96
+ }
71
97
  emit("update:modelValue", "");
72
98
  }, props2.leaveDelay);
73
99
  };
@@ -1,5 +1,21 @@
1
+ import type { AnyFunc } from '@vunk/shared';
2
+ import type { PropType } from 'vue';
1
3
  import type { RightClickEvent } from './types';
2
4
  export declare const props: {
5
+ /**
6
+ * 是否启用popup功能
7
+ */
8
+ popup: {
9
+ type: BooleanConstructor;
10
+ default: boolean;
11
+ };
12
+ /**
13
+ * 触发方式,可选值有 click 和 hover
14
+ */
15
+ popupTrigger: {
16
+ type: PropType<"click" | "hover">;
17
+ default: string;
18
+ };
3
19
  /**
4
20
  * 是否启用右键菜单功能
5
21
  */
@@ -28,6 +44,13 @@ export declare const props: {
28
44
  type: NumberConstructor;
29
45
  default: number;
30
46
  };
47
+ /**
48
+ * before leave 当返回 false 时阻止隐藏
49
+ */
50
+ beforeLeave: {
51
+ type: PropType<AnyFunc>;
52
+ default: undefined;
53
+ };
31
54
  };
32
55
  export declare const emits: {
33
56
  'update:modelValue': null;
@@ -1,4 +1,12 @@
1
1
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ popup: {
3
+ type: BooleanConstructor;
4
+ default: boolean;
5
+ };
6
+ popupTrigger: {
7
+ type: import("vue").PropType<"click" | "hover">;
8
+ default: string;
9
+ };
2
10
  contextMenu: {
3
11
  type: BooleanConstructor;
4
12
  default: boolean;
@@ -15,6 +23,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
15
23
  type: NumberConstructor;
16
24
  default: number;
17
25
  };
26
+ beforeLeave: {
27
+ type: import("vue").PropType<import("@vunk/shared").AnyFunc>;
28
+ default: undefined;
29
+ };
18
30
  }>, {
19
31
  changeContextmenuShow: (show: boolean) => void;
20
32
  contextmenuState: {
@@ -29,6 +41,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
29
41
  'update:modelValue': null;
30
42
  rightClick: (e: import("./types").RightClickEvent) => import("./types").RightClickEvent;
31
43
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
44
+ popup: {
45
+ type: BooleanConstructor;
46
+ default: boolean;
47
+ };
48
+ popupTrigger: {
49
+ type: import("vue").PropType<"click" | "hover">;
50
+ default: string;
51
+ };
32
52
  contextMenu: {
33
53
  type: BooleanConstructor;
34
54
  default: boolean;
@@ -45,6 +65,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
45
65
  type: NumberConstructor;
46
66
  default: number;
47
67
  };
68
+ beforeLeave: {
69
+ type: import("vue").PropType<import("@vunk/shared").AnyFunc>;
70
+ default: undefined;
71
+ };
48
72
  }>> & Readonly<{
49
73
  onRightClick?: ((e: import("./types").RightClickEvent) => any) | undefined;
50
74
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
@@ -53,6 +77,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
53
77
  modelValue: string;
54
78
  leaveDelay: number;
55
79
  enterDelay: number;
80
+ beforeLeave: import("@vunk/shared").AnyFunc;
81
+ popup: boolean;
82
+ popupTrigger: "click" | "hover";
56
83
  }, {}, {
57
84
  ContextMenu: {
58
85
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
@@ -1,5 +1,6 @@
1
+ import VkPopupEdge from './src/edge.vue';
1
2
  import VkPopup from './src/index.vue';
2
3
  import VkPopupProvider from './src/provider.vue';
3
4
  export * as __VkPopup from './src/types';
4
- export { VkPopup, VkPopupProvider, };
5
+ export { VkPopup, VkPopupEdge, VkPopupProvider, };
5
6
  export default VkPopup;
@@ -1,5 +1,6 @@
1
- import { defineComponent, shallowRef, ref, computed, onMounted, onBeforeUnmount, createBlock, openBlock, unref, withCtx, createElementVNode, mergeProps, renderSlot, resolveComponent, withDirectives, createVNode, resolveDynamicComponent, vShow } from 'vue';
1
+ import { defineComponent, shallowRef, ref, computed, watch, onBeforeUnmount, createBlock, openBlock, unref, withCtx, createElementVNode, mergeProps, renderSlot, resolveComponent, withDirectives, createVNode, resolveDynamicComponent, vShow } from 'vue';
2
2
  import { useSigma, useGraph } from '@vunk/graph/composables';
3
+ import { useModelComputed } from '@vunk/core/composables';
3
4
  import { createGlobalRenderer } from '@vunk/core/components/global-renderer';
4
5
  import { VkGraphViewUi } from '@vunk/graph/components/graph-view-ui';
5
6
  import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
@@ -10,22 +11,129 @@ const {
10
11
  } = createGlobalRenderer("vunk-graph-popup");
11
12
 
12
13
  const props = {
14
+ /**
15
+ * 当前激活的node或edge
16
+ */
13
17
  modelValue: {
14
- type: Boolean,
15
- default: false
18
+ type: String,
19
+ default: void 0
16
20
  },
17
21
  /**
18
- * @description 是否显示关闭按钮
22
+ * 触发方式
19
23
  */
20
- closeable: {
21
- type: Boolean,
22
- default: false
24
+ trigger: {
25
+ type: String,
26
+ default: "click"
23
27
  }
24
28
  };
25
29
  const emits = {
26
30
  "update:modelValue": null
27
31
  };
28
32
 
33
+ var _sfc_main$2 = /* @__PURE__ */ defineComponent({
34
+ ...{
35
+ name: "VkPopupEdge",
36
+ inheritAttrs: false
37
+ },
38
+ __name: "edge",
39
+ props: props,
40
+ emits,
41
+ setup(__props, { emit: __emit }) {
42
+ const props = __props;
43
+ const emit = __emit;
44
+ const model = useModelComputed({
45
+ default: "",
46
+ key: "modelValue"
47
+ }, props, emit);
48
+ const sigma = useSigma();
49
+ const graph = useGraph();
50
+ const coordinates = shallowRef([0, 0]);
51
+ const currentEdge = ref("");
52
+ const attributes = ref({});
53
+ const state = computed(() => ({
54
+ edge: currentEdge.value,
55
+ attributes: attributes.value,
56
+ visible: !!model.value,
57
+ coordinates: coordinates.value
58
+ }));
59
+ watch(() => props.modelValue, (edge) => {
60
+ if (edge) {
61
+ const source = graph.source(edge);
62
+ const target = graph.target(edge);
63
+ const sourceAttrs = graph.getNodeAttributes(source);
64
+ const targetAttrs = graph.getNodeAttributes(target);
65
+ if (typeof sourceAttrs.x === "number" && typeof sourceAttrs.y === "number" && typeof targetAttrs.x === "number" && typeof targetAttrs.y === "number") {
66
+ const x = (sourceAttrs.x + targetAttrs.x) / 2;
67
+ const y = (sourceAttrs.y + targetAttrs.y) / 2;
68
+ currentEdge.value = edge;
69
+ attributes.value = graph.getEdgeAttributes(edge);
70
+ coordinates.value = [x, y];
71
+ }
72
+ } else {
73
+ currentEdge.value = "";
74
+ attributes.value = {};
75
+ }
76
+ }, { immediate: true });
77
+ function onClickEdge(e) {
78
+ model.value = e.edge;
79
+ }
80
+ function onEnterEdge(e) {
81
+ model.value = e.edge;
82
+ }
83
+ function onLeaveEdge() {
84
+ model.value = "";
85
+ }
86
+ function onClickStage() {
87
+ model.value = "";
88
+ }
89
+ watch(() => props.trigger, (val) => {
90
+ sigma.off("clickEdge", onClickEdge);
91
+ sigma.off("enterEdge", onEnterEdge);
92
+ sigma.off("leaveEdge", onLeaveEdge);
93
+ sigma.off("clickStage", onClickStage);
94
+ if (val === "click") {
95
+ sigma.on("clickEdge", onClickEdge);
96
+ sigma.on("clickStage", onClickStage);
97
+ } else if (val === "hover") {
98
+ sigma.on("enterEdge", onEnterEdge);
99
+ sigma.on("leaveEdge", onLeaveEdge);
100
+ sigma.on("clickStage", onClickStage);
101
+ }
102
+ }, { immediate: true });
103
+ onBeforeUnmount(() => {
104
+ sigma.off("clickEdge", onClickEdge);
105
+ sigma.off("enterEdge", onEnterEdge);
106
+ sigma.off("leaveEdge", onLeaveEdge);
107
+ sigma.off("clickStage", onClickStage);
108
+ });
109
+ return (_ctx, _cache) => {
110
+ return openBlock(), createBlock(unref(GlobalRendererTemplate), {
111
+ active: state.value.visible,
112
+ data: state.value
113
+ }, {
114
+ default: withCtx(() => [
115
+ createElementVNode(
116
+ "div",
117
+ mergeProps({ class: "vkg-popup" }, _ctx.$attrs),
118
+ [
119
+ renderSlot(_ctx.$slots, "default", {
120
+ edge: state.value.edge,
121
+ attributes: state.value.attributes,
122
+ coordinates: state.value.coordinates,
123
+ visible: state.value.visible
124
+ })
125
+ ],
126
+ 16
127
+ /* FULL_PROPS */
128
+ )
129
+ ]),
130
+ _: 3
131
+ /* FORWARDED */
132
+ }, 8, ["active", "data"]);
133
+ };
134
+ }
135
+ });
136
+
29
137
  var _sfc_main$1 = /* @__PURE__ */ defineComponent({
30
138
  ...{
31
139
  name: "VkPopup",
@@ -39,39 +147,67 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
39
147
  const emit = __emit;
40
148
  const sigma = useSigma();
41
149
  const graph = useGraph();
150
+ const model = useModelComputed({
151
+ default: "",
152
+ key: "modelValue"
153
+ }, props, emit);
42
154
  const coordinates = shallowRef([0, 0]);
43
155
  const currentNode = ref("");
44
156
  const attributes = ref({});
45
157
  const state = computed(() => ({
46
158
  node: currentNode.value,
47
159
  attributes: attributes.value,
48
- visible: props.modelValue,
160
+ visible: !!model.value,
49
161
  coordinates: coordinates.value
50
162
  }));
163
+ watch(model, (node) => {
164
+ if (node) {
165
+ const attrs = graph.getNodeAttributes(node);
166
+ if (typeof attrs.x === "number" && typeof attrs.y === "number") {
167
+ currentNode.value = node;
168
+ attributes.value = attrs;
169
+ coordinates.value = [attrs.x, attrs.y];
170
+ }
171
+ } else {
172
+ currentNode.value = "";
173
+ attributes.value = {};
174
+ }
175
+ }, { immediate: true });
51
176
  function onClickNode(e) {
52
- const { node } = e;
53
- const attrs = graph.getNodeAttributes(node);
54
- if (typeof attrs.x !== "number" || typeof attrs.y !== "number")
55
- return;
56
- currentNode.value = node;
57
- attributes.value = attrs;
58
- coordinates.value = [attrs.x, attrs.y];
59
- emit("update:modelValue", true);
177
+ model.value = e.node;
178
+ }
179
+ function onEnterNode(e) {
180
+ model.value = e.node;
181
+ }
182
+ function onLeaveNode() {
183
+ model.value = "";
60
184
  }
61
185
  function onClickStage() {
62
- emit("update:modelValue", false);
186
+ model.value = "";
63
187
  }
64
- onMounted(() => {
65
- sigma.on("clickNode", onClickNode);
66
- sigma.on("clickStage", onClickStage);
67
- });
188
+ watch(() => props.trigger, (val) => {
189
+ sigma.off("clickNode", onClickNode);
190
+ sigma.off("enterNode", onEnterNode);
191
+ sigma.off("leaveNode", onLeaveNode);
192
+ sigma.off("clickStage", onClickStage);
193
+ if (val === "click") {
194
+ sigma.on("clickNode", onClickNode);
195
+ sigma.on("clickStage", onClickStage);
196
+ } else if (val === "hover") {
197
+ sigma.on("enterNode", onEnterNode);
198
+ sigma.on("leaveNode", onLeaveNode);
199
+ sigma.on("clickStage", onClickStage);
200
+ }
201
+ }, { immediate: true });
68
202
  onBeforeUnmount(() => {
69
203
  sigma.off("clickNode", onClickNode);
204
+ sigma.off("enterNode", onEnterNode);
205
+ sigma.off("leaveNode", onLeaveNode);
70
206
  sigma.off("clickStage", onClickStage);
71
207
  });
72
208
  return (_ctx, _cache) => {
73
209
  return openBlock(), createBlock(unref(GlobalRendererTemplate), {
74
- active: _ctx.modelValue,
210
+ active: state.value.visible,
75
211
  data: state.value
76
212
  }, {
77
213
  default: withCtx(() => [
@@ -150,8 +286,4 @@ var types = /*#__PURE__*/Object.freeze({
150
286
  __proto__: null
151
287
  });
152
288
 
153
- _sfc_main$1.install = (app) => {
154
- app.component(_sfc_main$1.name || "VkPopup", _sfc_main$1);
155
- };
156
-
157
- export { _sfc_main$1 as VkPopup, provider as VkPopupProvider, types as __VkPopup, _sfc_main$1 as default };
289
+ export { _sfc_main$1 as VkPopup, _sfc_main$2 as VkPopupEdge, provider as VkPopupProvider, types as __VkPopup, _sfc_main$1 as default };
@@ -1,14 +1,18 @@
1
+ import type { PropType } from 'vue';
1
2
  export declare const props: {
3
+ /**
4
+ * 当前激活的node或edge
5
+ */
2
6
  modelValue: {
3
- type: BooleanConstructor;
4
- default: boolean;
7
+ type: StringConstructor;
8
+ default: undefined;
5
9
  };
6
10
  /**
7
- * @description 是否显示关闭按钮
11
+ * 触发方式
8
12
  */
9
- closeable: {
10
- type: BooleanConstructor;
11
- default: boolean;
13
+ trigger: {
14
+ type: PropType<"hover" | "click" | "none">;
15
+ default: string;
12
16
  };
13
17
  };
14
18
  export declare const emits: {
@@ -0,0 +1,84 @@
1
+ import type { NormalObject } from '@vunk/shared';
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ modelValue: {
4
+ type: StringConstructor;
5
+ default: undefined;
6
+ };
7
+ trigger: {
8
+ type: import("vue").PropType<"hover" | "click" | "none">;
9
+ default: string;
10
+ };
11
+ }>, {
12
+ props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
13
+ modelValue: {
14
+ type: StringConstructor;
15
+ default: undefined;
16
+ };
17
+ trigger: {
18
+ type: import("vue").PropType<"hover" | "click" | "none">;
19
+ default: string;
20
+ };
21
+ }>> & Readonly<{
22
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
23
+ }> & {}>;
24
+ emit: (event: "update:modelValue", ...args: any[]) => void;
25
+ model: import("vue").WritableComputedRef<string, string>;
26
+ sigma: import("sigma").default<import("graphology-types").Attributes, import("graphology-types").Attributes, import("graphology-types").Attributes>;
27
+ graph: import("graphology").default<import("graphology-types").Attributes, import("graphology-types").Attributes, import("graphology-types").Attributes>;
28
+ coordinates: import("vue").ShallowRef<number[], number[]>;
29
+ currentEdge: import("vue").Ref<string, string>;
30
+ attributes: import("vue").Ref<NormalObject, NormalObject>;
31
+ state: import("vue").ComputedRef<{
32
+ edge: string;
33
+ attributes: NormalObject;
34
+ visible: boolean;
35
+ coordinates: number[];
36
+ }>;
37
+ onClickEdge: (e: {
38
+ edge: string;
39
+ }) => void;
40
+ onEnterEdge: (e: {
41
+ edge: string;
42
+ }) => void;
43
+ onLeaveEdge: () => void;
44
+ onClickStage: () => void;
45
+ readonly GlobalRendererTemplate: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
46
+ active: {
47
+ type: BooleanConstructor;
48
+ default: boolean;
49
+ };
50
+ data: {
51
+ type: import("vue").PropType<import("@vunk/graph/entry").NormalObject>;
52
+ default: () => {};
53
+ };
54
+ }>, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
55
+ active: {
56
+ type: BooleanConstructor;
57
+ default: boolean;
58
+ };
59
+ data: {
60
+ type: import("vue").PropType<import("@vunk/graph/entry").NormalObject>;
61
+ default: () => {};
62
+ };
63
+ }>> & Readonly<{}>, {
64
+ data: import("@vunk/graph/entry").NormalObject;
65
+ active: boolean;
66
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
67
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
68
+ 'update:modelValue': null;
69
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
70
+ modelValue: {
71
+ type: StringConstructor;
72
+ default: undefined;
73
+ };
74
+ trigger: {
75
+ type: import("vue").PropType<"hover" | "click" | "none">;
76
+ default: string;
77
+ };
78
+ }>> & Readonly<{
79
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
80
+ }>, {
81
+ modelValue: string;
82
+ trigger: "none" | "click" | "hover";
83
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
84
+ export default _default;
@@ -1,21 +1,21 @@
1
1
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
2
  modelValue: {
3
- type: BooleanConstructor;
4
- default: boolean;
3
+ type: StringConstructor;
4
+ default: undefined;
5
5
  };
6
- closeable: {
7
- type: BooleanConstructor;
8
- default: boolean;
6
+ trigger: {
7
+ type: import("vue").PropType<"hover" | "click" | "none">;
8
+ default: string;
9
9
  };
10
10
  }>, {
11
11
  props: import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
12
12
  modelValue: {
13
- type: BooleanConstructor;
14
- default: boolean;
13
+ type: StringConstructor;
14
+ default: undefined;
15
15
  };
16
- closeable: {
17
- type: BooleanConstructor;
18
- default: boolean;
16
+ trigger: {
17
+ type: import("vue").PropType<"hover" | "click" | "none">;
18
+ default: string;
19
19
  };
20
20
  }>> & Readonly<{
21
21
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
@@ -23,6 +23,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
23
23
  emit: (event: "update:modelValue", ...args: any[]) => void;
24
24
  sigma: import("sigma").default<import("graphology-types").Attributes, import("graphology-types").Attributes, import("graphology-types").Attributes>;
25
25
  graph: import("graphology").default<import("graphology-types").Attributes, import("graphology-types").Attributes, import("graphology-types").Attributes>;
26
+ model: import("vue").WritableComputedRef<string, string>;
26
27
  coordinates: import("vue").ShallowRef<number[], number[]>;
27
28
  currentNode: import("vue").Ref<string, string>;
28
29
  attributes: import("vue").Ref<{}, {}>;
@@ -35,6 +36,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
35
36
  onClickNode: (e: {
36
37
  node: string;
37
38
  }) => void;
39
+ onEnterNode: (e: {
40
+ node: string;
41
+ }) => void;
42
+ onLeaveNode: () => void;
38
43
  onClickStage: () => void;
39
44
  readonly GlobalRendererTemplate: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
40
45
  active: {
@@ -62,17 +67,17 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
62
67
  'update:modelValue': null;
63
68
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
64
69
  modelValue: {
65
- type: BooleanConstructor;
66
- default: boolean;
70
+ type: StringConstructor;
71
+ default: undefined;
67
72
  };
68
- closeable: {
69
- type: BooleanConstructor;
70
- default: boolean;
73
+ trigger: {
74
+ type: import("vue").PropType<"hover" | "click" | "none">;
75
+ default: string;
71
76
  };
72
77
  }>> & Readonly<{
73
78
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
74
79
  }>, {
75
- modelValue: boolean;
76
- closeable: boolean;
80
+ modelValue: string;
81
+ trigger: "none" | "click" | "hover";
77
82
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
78
83
  export default _default;
@@ -1,28 +1,28 @@
1
1
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
2
  modelValue: {
3
- type: BooleanConstructor;
4
- default: boolean;
3
+ type: StringConstructor;
4
+ default: undefined;
5
5
  };
6
- closeable: {
7
- type: BooleanConstructor;
8
- default: boolean;
6
+ trigger: {
7
+ type: import("vue").PropType<"hover" | "click" | "none">;
8
+ default: string;
9
9
  };
10
10
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
11
  'update:modelValue': null;
12
12
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
13
13
  modelValue: {
14
- type: BooleanConstructor;
15
- default: boolean;
14
+ type: StringConstructor;
15
+ default: undefined;
16
16
  };
17
- closeable: {
18
- type: BooleanConstructor;
19
- default: boolean;
17
+ trigger: {
18
+ type: import("vue").PropType<"hover" | "click" | "none">;
19
+ default: string;
20
20
  };
21
21
  }>> & Readonly<{
22
22
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
23
23
  }>, {
24
- modelValue: boolean;
25
- closeable: boolean;
24
+ modelValue: string;
25
+ trigger: "none" | "click" | "hover";
26
26
  }, {}, {
27
27
  VkGraphViewUi: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
28
28
  coordinates: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/graph",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC",