vft 0.0.496 → 0.0.498
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/index.css +1 -1
- package/es/component.js +18 -16
- package/es/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/es/components/autocomplete/index.d.ts +6 -6
- package/es/components/button/index.d.ts +9 -9
- package/es/components/index.d.ts +1 -0
- package/es/components/index.js +257 -255
- package/es/components/modal/index.d.ts +6 -0
- package/es/components/modal/modal.vue.d.ts +3 -0
- package/es/components/modal/modal.vue2.js +12 -12
- package/es/components/popconfirm/index.d.ts +15 -15
- package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/es/components/select/defaults.d.ts +4 -0
- package/es/components/select/defaults.js +7 -3
- package/es/components/select/index.d.ts +13 -4
- package/es/components/select/select.vue.d.ts +13 -4
- package/es/components/select/select.vue.js +9 -8
- package/es/components/select/select.vue2.js +40 -29
- package/es/components/select/token.d.ts +4 -1
- package/es/components/select/useSelect.d.ts +4 -4
- package/es/components/super-form/index.d.ts +9 -0
- package/es/components/super-form/style/css.d.ts +1 -0
- package/es/components/super-form/style/css.js +2 -0
- package/es/components/super-form/style/index.d.ts +1 -0
- package/es/components/super-form/style/index.js +2 -0
- package/es/components/super-form/super-form-item.vue2.js +355 -255
- package/es/components/super-form/super-form.vue2.js +1 -1
- package/es/components/super-form/types.d.ts +26 -1
- package/es/components/super-form/use/helper.js +37 -36
- package/es/components/super-form/use/use-form-events.js +126 -125
- package/es/components/table/index.d.ts +9 -6
- package/es/components/table/style/css.js +2 -0
- package/es/components/table/style/index.js +2 -0
- package/es/components/table/table.vue.d.ts +2 -1
- package/es/components/table/table.vue2.js +99 -94
- package/es/components/table/types.d.ts +5 -3
- package/es/components/table/use/use-data-source.d.ts +6 -4
- package/es/components/table/use/use-data-source.js +150 -148
- package/es/components/table/use/use-table.js +8 -8
- package/es/components/tree/index.d.ts +71 -71
- package/es/components/tree/tree-node.vue.d.ts +1 -1
- package/es/components/tree/tree.type.d.ts +2 -0
- package/es/components/tree/tree.vue.d.ts +14 -14
- package/es/components/tree-select/cache-options.d.ts +20 -0
- package/es/components/tree-select/cache-options.js +30 -0
- package/es/components/tree-select/index.d.ts +8 -0
- package/es/components/tree-select/index.js +10 -0
- package/es/components/tree-select/instance.d.ts +5 -0
- package/es/components/tree-select/instance.js +1 -0
- package/es/components/tree-select/select.d.ts +10 -0
- package/es/components/tree-select/select.js +129 -0
- package/es/components/tree-select/style/css.d.ts +4 -0
- package/es/components/tree-select/style/css.js +11 -0
- package/es/components/tree-select/style/index.d.ts +4 -0
- package/es/components/tree-select/style/index.js +11 -0
- package/es/components/tree-select/tree-select-option.d.ts +42 -0
- package/es/components/tree-select/tree-select-option.js +35 -0
- package/es/components/tree-select/tree-select.vue.d.ts +4 -0
- package/es/components/tree-select/tree-select.vue.js +5 -0
- package/es/components/tree-select/tree-select.vue2.js +155 -0
- package/es/components/tree-select/tree.d.ts +11 -0
- package/es/components/tree-select/tree.js +201 -0
- package/es/components/tree-select/utils.d.ts +10 -0
- package/es/components/tree-select/utils.js +45 -0
- package/es/index.js +1 -0
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/script.css +1 -1
- package/es/utils/form-register.d.ts +1 -0
- package/es/utils/form-register.js +11 -10
- package/lib/component.cjs +1 -1
- package/lib/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/lib/components/autocomplete/index.d.ts +6 -6
- package/lib/components/button/index.d.ts +9 -9
- package/lib/components/index.cjs +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/modal/index.d.ts +6 -0
- package/lib/components/modal/modal.vue.d.ts +3 -0
- package/lib/components/modal/modal.vue2.cjs +1 -1
- package/lib/components/popconfirm/index.d.ts +15 -15
- package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/lib/components/select/defaults.cjs +1 -1
- package/lib/components/select/defaults.d.ts +4 -0
- package/lib/components/select/index.d.ts +13 -4
- package/lib/components/select/select.vue.cjs +1 -1
- package/lib/components/select/select.vue.d.ts +13 -4
- package/lib/components/select/select.vue2.cjs +1 -1
- package/lib/components/select/token.d.ts +4 -1
- package/lib/components/select/useSelect.d.ts +4 -4
- package/lib/components/super-form/index.d.ts +9 -0
- package/lib/components/super-form/style/css.cjs +1 -1
- package/lib/components/super-form/style/css.d.ts +1 -0
- package/lib/components/super-form/style/index.cjs +1 -1
- package/lib/components/super-form/style/index.d.ts +1 -0
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/super-form.vue2.cjs +1 -1
- package/lib/components/super-form/types.d.ts +26 -1
- package/lib/components/super-form/use/helper.cjs +1 -1
- package/lib/components/super-form/use/use-form-events.cjs +1 -1
- package/lib/components/table/index.d.ts +9 -6
- package/lib/components/table/style/css.cjs +1 -1
- package/lib/components/table/style/index.cjs +1 -1
- package/lib/components/table/table.vue.d.ts +2 -1
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/table/types.d.ts +5 -3
- package/lib/components/table/use/use-data-source.cjs +1 -1
- package/lib/components/table/use/use-data-source.d.ts +6 -4
- package/lib/components/table/use/use-table.cjs +1 -1
- package/lib/components/tree/index.d.ts +71 -71
- package/lib/components/tree/tree-node.vue.d.ts +1 -1
- package/lib/components/tree/tree.type.d.ts +2 -0
- package/lib/components/tree/tree.vue.d.ts +14 -14
- package/lib/components/tree-select/cache-options.cjs +1 -0
- package/lib/components/tree-select/cache-options.d.ts +20 -0
- package/lib/components/tree-select/index.cjs +1 -0
- package/lib/components/tree-select/index.d.ts +8 -0
- package/lib/components/tree-select/instance.cjs +1 -0
- package/lib/components/tree-select/instance.d.ts +5 -0
- package/lib/components/tree-select/select.cjs +1 -0
- package/lib/components/tree-select/select.d.ts +10 -0
- package/lib/components/tree-select/style/css.cjs +1 -0
- package/lib/components/tree-select/style/css.d.ts +4 -0
- package/lib/components/tree-select/style/index.cjs +1 -0
- package/lib/components/tree-select/style/index.d.ts +4 -0
- package/lib/components/tree-select/tree-select-option.cjs +1 -0
- package/lib/components/tree-select/tree-select-option.d.ts +42 -0
- package/lib/components/tree-select/tree-select.vue.cjs +1 -0
- package/lib/components/tree-select/tree-select.vue.d.ts +4 -0
- package/lib/components/tree-select/tree-select.vue2.cjs +1 -0
- package/lib/components/tree-select/tree.cjs +1 -0
- package/lib/components/tree-select/tree.d.ts +11 -0
- package/lib/components/tree-select/utils.cjs +1 -0
- package/lib/components/tree-select/utils.d.ts +10 -0
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/lib/script.css +1 -1
- package/lib/utils/form-register.cjs +1 -1
- package/lib/utils/form-register.d.ts +1 -0
- package/package.json +5 -5
- package/theme-style/index.css +1 -1
- package/theme-style/src/cascader.scss +1 -12
- package/theme-style/src/tree-select.scss +10 -1
- package/theme-style/vft-cascader.css +1 -1
- package/theme-style/vft-tree-select.css +1 -1
- package/web-types.json +1 -1
|
@@ -62,22 +62,10 @@ export declare const VftTree: SFCWithInstall<{
|
|
|
62
62
|
filterNodeMethod: {
|
|
63
63
|
type: import("vue").PropType<import("./tree.type").FilterNodeMethodFunction>;
|
|
64
64
|
};
|
|
65
|
-
allowDrop: {
|
|
66
|
-
type: import("vue").PropType<any>;
|
|
67
|
-
};
|
|
68
|
-
renderContent: {
|
|
69
|
-
type: import("vue").PropType<any>;
|
|
70
|
-
};
|
|
71
|
-
accordion: {
|
|
72
|
-
type: import("vue").PropType<boolean>;
|
|
73
|
-
};
|
|
74
65
|
renderAfterExpand: {
|
|
75
66
|
type: import("vue").PropType<boolean>;
|
|
76
67
|
default: boolean;
|
|
77
68
|
};
|
|
78
|
-
showCheckbox: {
|
|
79
|
-
type: import("vue").PropType<boolean>;
|
|
80
|
-
};
|
|
81
69
|
nodeKey: {
|
|
82
70
|
type: import("vue").PropType<string>;
|
|
83
71
|
};
|
|
@@ -85,12 +73,24 @@ export declare const VftTree: SFCWithInstall<{
|
|
|
85
73
|
type: import("vue").PropType<boolean>;
|
|
86
74
|
default: boolean;
|
|
87
75
|
};
|
|
76
|
+
renderContent: {
|
|
77
|
+
type: import("vue").PropType<any>;
|
|
78
|
+
};
|
|
79
|
+
showCheckbox: {
|
|
80
|
+
type: import("vue").PropType<boolean>;
|
|
81
|
+
};
|
|
88
82
|
allowDrag: {
|
|
89
83
|
type: import("vue").PropType<any>;
|
|
90
84
|
};
|
|
85
|
+
allowDrop: {
|
|
86
|
+
type: import("vue").PropType<any>;
|
|
87
|
+
};
|
|
91
88
|
highlightCurrent: {
|
|
92
89
|
type: import("vue").PropType<boolean>;
|
|
93
90
|
};
|
|
91
|
+
accordion: {
|
|
92
|
+
type: import("vue").PropType<boolean>;
|
|
93
|
+
};
|
|
94
94
|
indent: {
|
|
95
95
|
type: import("vue").PropType<number>;
|
|
96
96
|
default: number;
|
|
@@ -98,17 +98,17 @@ export declare const VftTree: SFCWithInstall<{
|
|
|
98
98
|
}>> & Readonly<{
|
|
99
99
|
"onCurrent-change"?: (() => any) | undefined;
|
|
100
100
|
onCheck?: (() => any) | undefined;
|
|
101
|
-
"onNode-drag-start"?: (() => any) | undefined;
|
|
102
|
-
"onNode-drag-leave"?: (() => any) | undefined;
|
|
103
|
-
"onNode-drag-enter"?: (() => any) | undefined;
|
|
104
|
-
"onNode-drag-over"?: (() => any) | undefined;
|
|
105
|
-
"onNode-drag-end"?: (() => any) | undefined;
|
|
106
|
-
"onNode-drop"?: (() => any) | undefined;
|
|
107
|
-
"onNode-expand"?: (() => any) | undefined;
|
|
108
101
|
"onCheck-change"?: (() => any) | undefined;
|
|
109
102
|
"onNode-click"?: (() => any) | undefined;
|
|
110
103
|
"onNode-contextmenu"?: (() => any) | undefined;
|
|
111
104
|
"onNode-collapse"?: (() => any) | undefined;
|
|
105
|
+
"onNode-expand"?: (() => any) | undefined;
|
|
106
|
+
"onNode-drag-start"?: (() => any) | undefined;
|
|
107
|
+
"onNode-drag-end"?: (() => any) | undefined;
|
|
108
|
+
"onNode-drop"?: (() => any) | undefined;
|
|
109
|
+
"onNode-drag-leave"?: (() => any) | undefined;
|
|
110
|
+
"onNode-drag-enter"?: (() => any) | undefined;
|
|
111
|
+
"onNode-drag-over"?: (() => any) | undefined;
|
|
112
112
|
}>, {
|
|
113
113
|
filter: (value: any) => void;
|
|
114
114
|
getNodeKey: (node: import("./model/node").default) => any;
|
|
@@ -135,17 +135,17 @@ export declare const VftTree: SFCWithInstall<{
|
|
|
135
135
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
136
136
|
"current-change": () => void;
|
|
137
137
|
check: () => void;
|
|
138
|
-
"node-drag-start": () => void;
|
|
139
|
-
"node-drag-leave": () => void;
|
|
140
|
-
"node-drag-enter": () => void;
|
|
141
|
-
"node-drag-over": () => void;
|
|
142
|
-
"node-drag-end": () => void;
|
|
143
|
-
"node-drop": () => void;
|
|
144
|
-
"node-expand": () => void;
|
|
145
138
|
"check-change": () => void;
|
|
146
139
|
"node-click": () => void;
|
|
147
140
|
"node-contextmenu": () => void;
|
|
148
141
|
"node-collapse": () => void;
|
|
142
|
+
"node-expand": () => void;
|
|
143
|
+
"node-drag-start": () => void;
|
|
144
|
+
"node-drag-end": () => void;
|
|
145
|
+
"node-drop": () => void;
|
|
146
|
+
"node-drag-leave": () => void;
|
|
147
|
+
"node-drag-enter": () => void;
|
|
148
|
+
"node-drag-over": () => void;
|
|
149
149
|
}, import("vue").PublicProps, {
|
|
150
150
|
data: Array<any>;
|
|
151
151
|
props: import("./tree.type").TreeComponentProps["props"];
|
|
@@ -216,22 +216,10 @@ export declare const VftTree: SFCWithInstall<{
|
|
|
216
216
|
filterNodeMethod: {
|
|
217
217
|
type: import("vue").PropType<import("./tree.type").FilterNodeMethodFunction>;
|
|
218
218
|
};
|
|
219
|
-
allowDrop: {
|
|
220
|
-
type: import("vue").PropType<any>;
|
|
221
|
-
};
|
|
222
|
-
renderContent: {
|
|
223
|
-
type: import("vue").PropType<any>;
|
|
224
|
-
};
|
|
225
|
-
accordion: {
|
|
226
|
-
type: import("vue").PropType<boolean>;
|
|
227
|
-
};
|
|
228
219
|
renderAfterExpand: {
|
|
229
220
|
type: import("vue").PropType<boolean>;
|
|
230
221
|
default: boolean;
|
|
231
222
|
};
|
|
232
|
-
showCheckbox: {
|
|
233
|
-
type: import("vue").PropType<boolean>;
|
|
234
|
-
};
|
|
235
223
|
nodeKey: {
|
|
236
224
|
type: import("vue").PropType<string>;
|
|
237
225
|
};
|
|
@@ -239,12 +227,24 @@ export declare const VftTree: SFCWithInstall<{
|
|
|
239
227
|
type: import("vue").PropType<boolean>;
|
|
240
228
|
default: boolean;
|
|
241
229
|
};
|
|
230
|
+
renderContent: {
|
|
231
|
+
type: import("vue").PropType<any>;
|
|
232
|
+
};
|
|
233
|
+
showCheckbox: {
|
|
234
|
+
type: import("vue").PropType<boolean>;
|
|
235
|
+
};
|
|
242
236
|
allowDrag: {
|
|
243
237
|
type: import("vue").PropType<any>;
|
|
244
238
|
};
|
|
239
|
+
allowDrop: {
|
|
240
|
+
type: import("vue").PropType<any>;
|
|
241
|
+
};
|
|
245
242
|
highlightCurrent: {
|
|
246
243
|
type: import("vue").PropType<boolean>;
|
|
247
244
|
};
|
|
245
|
+
accordion: {
|
|
246
|
+
type: import("vue").PropType<boolean>;
|
|
247
|
+
};
|
|
248
248
|
indent: {
|
|
249
249
|
type: import("vue").PropType<number>;
|
|
250
250
|
default: number;
|
|
@@ -252,17 +252,17 @@ export declare const VftTree: SFCWithInstall<{
|
|
|
252
252
|
}>> & Readonly<{
|
|
253
253
|
"onCurrent-change"?: (() => any) | undefined;
|
|
254
254
|
onCheck?: (() => any) | undefined;
|
|
255
|
-
"onNode-drag-start"?: (() => any) | undefined;
|
|
256
|
-
"onNode-drag-leave"?: (() => any) | undefined;
|
|
257
|
-
"onNode-drag-enter"?: (() => any) | undefined;
|
|
258
|
-
"onNode-drag-over"?: (() => any) | undefined;
|
|
259
|
-
"onNode-drag-end"?: (() => any) | undefined;
|
|
260
|
-
"onNode-drop"?: (() => any) | undefined;
|
|
261
|
-
"onNode-expand"?: (() => any) | undefined;
|
|
262
255
|
"onCheck-change"?: (() => any) | undefined;
|
|
263
256
|
"onNode-click"?: (() => any) | undefined;
|
|
264
257
|
"onNode-contextmenu"?: (() => any) | undefined;
|
|
265
258
|
"onNode-collapse"?: (() => any) | undefined;
|
|
259
|
+
"onNode-expand"?: (() => any) | undefined;
|
|
260
|
+
"onNode-drag-start"?: (() => any) | undefined;
|
|
261
|
+
"onNode-drag-end"?: (() => any) | undefined;
|
|
262
|
+
"onNode-drop"?: (() => any) | undefined;
|
|
263
|
+
"onNode-drag-leave"?: (() => any) | undefined;
|
|
264
|
+
"onNode-drag-enter"?: (() => any) | undefined;
|
|
265
|
+
"onNode-drag-over"?: (() => any) | undefined;
|
|
266
266
|
}>, {
|
|
267
267
|
filter: (value: any) => void;
|
|
268
268
|
getNodeKey: (node: import("./model/node").default) => any;
|
|
@@ -353,22 +353,10 @@ export declare const VftTree: SFCWithInstall<{
|
|
|
353
353
|
filterNodeMethod: {
|
|
354
354
|
type: import("vue").PropType<import("./tree.type").FilterNodeMethodFunction>;
|
|
355
355
|
};
|
|
356
|
-
allowDrop: {
|
|
357
|
-
type: import("vue").PropType<any>;
|
|
358
|
-
};
|
|
359
|
-
renderContent: {
|
|
360
|
-
type: import("vue").PropType<any>;
|
|
361
|
-
};
|
|
362
|
-
accordion: {
|
|
363
|
-
type: import("vue").PropType<boolean>;
|
|
364
|
-
};
|
|
365
356
|
renderAfterExpand: {
|
|
366
357
|
type: import("vue").PropType<boolean>;
|
|
367
358
|
default: boolean;
|
|
368
359
|
};
|
|
369
|
-
showCheckbox: {
|
|
370
|
-
type: import("vue").PropType<boolean>;
|
|
371
|
-
};
|
|
372
360
|
nodeKey: {
|
|
373
361
|
type: import("vue").PropType<string>;
|
|
374
362
|
};
|
|
@@ -376,12 +364,24 @@ export declare const VftTree: SFCWithInstall<{
|
|
|
376
364
|
type: import("vue").PropType<boolean>;
|
|
377
365
|
default: boolean;
|
|
378
366
|
};
|
|
367
|
+
renderContent: {
|
|
368
|
+
type: import("vue").PropType<any>;
|
|
369
|
+
};
|
|
370
|
+
showCheckbox: {
|
|
371
|
+
type: import("vue").PropType<boolean>;
|
|
372
|
+
};
|
|
379
373
|
allowDrag: {
|
|
380
374
|
type: import("vue").PropType<any>;
|
|
381
375
|
};
|
|
376
|
+
allowDrop: {
|
|
377
|
+
type: import("vue").PropType<any>;
|
|
378
|
+
};
|
|
382
379
|
highlightCurrent: {
|
|
383
380
|
type: import("vue").PropType<boolean>;
|
|
384
381
|
};
|
|
382
|
+
accordion: {
|
|
383
|
+
type: import("vue").PropType<boolean>;
|
|
384
|
+
};
|
|
385
385
|
indent: {
|
|
386
386
|
type: import("vue").PropType<number>;
|
|
387
387
|
default: number;
|
|
@@ -389,17 +389,17 @@ export declare const VftTree: SFCWithInstall<{
|
|
|
389
389
|
}>> & Readonly<{
|
|
390
390
|
"onCurrent-change"?: (() => any) | undefined;
|
|
391
391
|
onCheck?: (() => any) | undefined;
|
|
392
|
-
"onNode-drag-start"?: (() => any) | undefined;
|
|
393
|
-
"onNode-drag-leave"?: (() => any) | undefined;
|
|
394
|
-
"onNode-drag-enter"?: (() => any) | undefined;
|
|
395
|
-
"onNode-drag-over"?: (() => any) | undefined;
|
|
396
|
-
"onNode-drag-end"?: (() => any) | undefined;
|
|
397
|
-
"onNode-drop"?: (() => any) | undefined;
|
|
398
|
-
"onNode-expand"?: (() => any) | undefined;
|
|
399
392
|
"onCheck-change"?: (() => any) | undefined;
|
|
400
393
|
"onNode-click"?: (() => any) | undefined;
|
|
401
394
|
"onNode-contextmenu"?: (() => any) | undefined;
|
|
402
395
|
"onNode-collapse"?: (() => any) | undefined;
|
|
396
|
+
"onNode-expand"?: (() => any) | undefined;
|
|
397
|
+
"onNode-drag-start"?: (() => any) | undefined;
|
|
398
|
+
"onNode-drag-end"?: (() => any) | undefined;
|
|
399
|
+
"onNode-drop"?: (() => any) | undefined;
|
|
400
|
+
"onNode-drag-leave"?: (() => any) | undefined;
|
|
401
|
+
"onNode-drag-enter"?: (() => any) | undefined;
|
|
402
|
+
"onNode-drag-over"?: (() => any) | undefined;
|
|
403
403
|
}>, {
|
|
404
404
|
filter: (value: any) => void;
|
|
405
405
|
getNodeKey: (node: import("./model/node").default) => any;
|
|
@@ -426,17 +426,17 @@ export declare const VftTree: SFCWithInstall<{
|
|
|
426
426
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
427
427
|
"current-change": () => void;
|
|
428
428
|
check: () => void;
|
|
429
|
-
"node-drag-start": () => void;
|
|
430
|
-
"node-drag-leave": () => void;
|
|
431
|
-
"node-drag-enter": () => void;
|
|
432
|
-
"node-drag-over": () => void;
|
|
433
|
-
"node-drag-end": () => void;
|
|
434
|
-
"node-drop": () => void;
|
|
435
|
-
"node-expand": () => void;
|
|
436
429
|
"check-change": () => void;
|
|
437
430
|
"node-click": () => void;
|
|
438
431
|
"node-contextmenu": () => void;
|
|
439
432
|
"node-collapse": () => void;
|
|
433
|
+
"node-expand": () => void;
|
|
434
|
+
"node-drag-start": () => void;
|
|
435
|
+
"node-drag-end": () => void;
|
|
436
|
+
"node-drop": () => void;
|
|
437
|
+
"node-drag-leave": () => void;
|
|
438
|
+
"node-drag-enter": () => void;
|
|
439
|
+
"node-drag-over": () => void;
|
|
440
440
|
}, string, {
|
|
441
441
|
data: Array<any>;
|
|
442
442
|
props: import("./tree.type").TreeComponentProps["props"];
|
|
@@ -76,9 +76,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
76
76
|
}>, {
|
|
77
77
|
props: Record<string, any>;
|
|
78
78
|
node: Node;
|
|
79
|
-
accordion: boolean;
|
|
80
79
|
renderAfterExpand: boolean;
|
|
81
80
|
showCheckbox: boolean;
|
|
81
|
+
accordion: boolean;
|
|
82
82
|
}, {}, {
|
|
83
83
|
CollapseTransition: import("vft/es/utils").SFCWithInstall<{
|
|
84
84
|
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Component, ComponentInternalInstance, h, Ref, SetupContext, VNode } from 'vue';
|
|
2
2
|
import type Node from './model/node';
|
|
3
3
|
import type TreeStore from './model/tree-store';
|
|
4
|
+
import type Tree from './tree.vue';
|
|
4
5
|
export interface RootTreeType {
|
|
5
6
|
ctx: SetupContext<any>;
|
|
6
7
|
props: TreeComponentProps;
|
|
@@ -101,3 +102,4 @@ export declare interface TreeComponentProps {
|
|
|
101
102
|
icon: string | Component;
|
|
102
103
|
}
|
|
103
104
|
export declare type NodeDropType = 'before' | 'after' | 'inner' | 'none';
|
|
105
|
+
export type TreeInstance = InstanceType<typeof Tree> & unknown;
|
|
@@ -70,17 +70,17 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
70
70
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
71
71
|
"current-change": () => void;
|
|
72
72
|
check: () => void;
|
|
73
|
-
"node-drag-start": () => void;
|
|
74
|
-
"node-drag-leave": () => void;
|
|
75
|
-
"node-drag-enter": () => void;
|
|
76
|
-
"node-drag-over": () => void;
|
|
77
|
-
"node-drag-end": () => void;
|
|
78
|
-
"node-drop": () => void;
|
|
79
|
-
"node-expand": () => void;
|
|
80
73
|
"check-change": () => void;
|
|
81
74
|
"node-click": () => void;
|
|
82
75
|
"node-contextmenu": () => void;
|
|
83
76
|
"node-collapse": () => void;
|
|
77
|
+
"node-expand": () => void;
|
|
78
|
+
"node-drag-start": () => void;
|
|
79
|
+
"node-drag-end": () => void;
|
|
80
|
+
"node-drop": () => void;
|
|
81
|
+
"node-drag-leave": () => void;
|
|
82
|
+
"node-drag-enter": () => void;
|
|
83
|
+
"node-drag-over": () => void;
|
|
84
84
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TreeProps>, {
|
|
85
85
|
renderAfterExpand: boolean;
|
|
86
86
|
expandOnClickNode: boolean;
|
|
@@ -95,17 +95,17 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
95
95
|
}>>> & Readonly<{
|
|
96
96
|
"onCurrent-change"?: (() => any) | undefined;
|
|
97
97
|
onCheck?: (() => any) | undefined;
|
|
98
|
-
"onNode-drag-start"?: (() => any) | undefined;
|
|
99
|
-
"onNode-drag-leave"?: (() => any) | undefined;
|
|
100
|
-
"onNode-drag-enter"?: (() => any) | undefined;
|
|
101
|
-
"onNode-drag-over"?: (() => any) | undefined;
|
|
102
|
-
"onNode-drag-end"?: (() => any) | undefined;
|
|
103
|
-
"onNode-drop"?: (() => any) | undefined;
|
|
104
|
-
"onNode-expand"?: (() => any) | undefined;
|
|
105
98
|
"onCheck-change"?: (() => any) | undefined;
|
|
106
99
|
"onNode-click"?: (() => any) | undefined;
|
|
107
100
|
"onNode-contextmenu"?: (() => any) | undefined;
|
|
108
101
|
"onNode-collapse"?: (() => any) | undefined;
|
|
102
|
+
"onNode-expand"?: (() => any) | undefined;
|
|
103
|
+
"onNode-drag-start"?: (() => any) | undefined;
|
|
104
|
+
"onNode-drag-end"?: (() => any) | undefined;
|
|
105
|
+
"onNode-drop"?: (() => any) | undefined;
|
|
106
|
+
"onNode-drag-leave"?: (() => any) | undefined;
|
|
107
|
+
"onNode-drag-enter"?: (() => any) | undefined;
|
|
108
|
+
"onNode-drag-over"?: (() => any) | undefined;
|
|
109
109
|
}>, {
|
|
110
110
|
data: Array<any>;
|
|
111
111
|
props: TreeComponentProps["props"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../select/token.cjs");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const u=e.defineComponent({props:{data:{type:Array,default:()=>[]}},setup(t){return e.inject(r.selectV2InjectionKey,null),e.watch(()=>t.data,()=>{},{flush:"post",immediate:!0}),()=>{}}});exports.default=u;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
export type CacheOption = {
|
|
3
|
+
value: string | number | boolean | object;
|
|
4
|
+
currentLabel: string | number;
|
|
5
|
+
isDisabled: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
data: {
|
|
9
|
+
type: PropType<CacheOption[]>;
|
|
10
|
+
default: () => never[];
|
|
11
|
+
};
|
|
12
|
+
}>, () => undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
data: {
|
|
14
|
+
type: PropType<CacheOption[]>;
|
|
15
|
+
default: () => never[];
|
|
16
|
+
};
|
|
17
|
+
}>> & Readonly<{}>, {
|
|
18
|
+
data: CacheOption[];
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./tree-select.vue2.cjs");;/* empty css */e.default.install=l=>{l.component(e.default.name,e.default)};const t=e.default,u=t;exports.VftTreeSelect=u;exports.default=t;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SFCWithInstall } from 'vft/es/utils';
|
|
2
|
+
import TreeSelect from './tree-select.vue';
|
|
3
|
+
declare const _TreeSelect: SFCWithInstall<typeof TreeSelect>;
|
|
4
|
+
export default _TreeSelect;
|
|
5
|
+
export declare const VftTreeSelect: SFCWithInstall<import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
8
|
+
export type { TreeSelectInstance } from './instance';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),T=require("@vueuse/core"),c=require("lodash-es");require("../select/index.cjs");const M=require("../select/defaults.cjs");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");const p=require("../../constants/aria.cjs"),N=require("../../constants/event.cjs");require("../form/index.cjs");const V=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const O=require("./utils.cjs"),k=e=>e.code||e.key||"";function A(e,a,f,n){if(!Array.isArray(e)||e.length===0)return[];const s=[];return O.treeEach(e,o=>{s.push({[a]:c.get(o,a),[f]:c.get(o,f)})},o=>c.get(o,n)||[]),s}const C=(e,{attrs:a,emit:f},{select:n,tree:s,key:o})=>{const g=V.useNamespace("tree-select");l.watch(()=>e.data,()=>{e.filterable&&l.nextTick(()=>{const t=n.value?.states?.inputValue||"";s.value?.filter(t)})},{flush:"post"});const y=t=>{const r=t.at(-1);if(r.expanded&&r.childNodes.at(-1))y([r.childNodes.at(-1)]);else{s.value?.el$?.querySelector(`[data-key="${t.at(-1).key}"]`)?.focus({preventScroll:!0});return}},v=l.computed(()=>({value:o.value,label:"label",children:"children",...e.props})),m=()=>{l.nextTick(()=>{const t=n.value;if(!t?.states)return;const r=e.data||[],i=v.value.value,h=v.value.label,d=v.value.children,q=A(r,i,h,d),u=e.modelValue;if(u==null||Array.isArray(u)&&u.length===0){t.states.selectedLabel="";return}const x=(Array.isArray(u)?u:[u]).map(b=>{const E=q.find(S=>c.get(S,i)===b);return E?c.get(E,h):""});t.states.selectedLabel=x.filter(Boolean).join(", ")})};return l.onMounted(()=>{m(),T.useEventListener(()=>n.value?.selectRef,"keydown",async t=>{const r=k(t),i=n.value?.expanded;[p.EVENT_CODE.down,p.EVENT_CODE.up].includes(r)&&i&&(await l.nextTick(),setTimeout(()=>{if(p.EVENT_CODE.up===r){const d=s.value?.store?.root?.childNodes;d&&y(d);return}(n.value?.states?.hoveringIndex??-1)>=0&&n.value?.filteredOptions&&s.value?.el$?.querySelector("[data-key]")?.focus({preventScroll:!0})}))},{capture:!0})}),l.watch(()=>[e.data,e.modelValue],m,{immediate:!0,deep:!0}),{...c.pick(l.toRefs(e),Object.keys(M.selectV2Props)),...a,class:l.computed(()=>a.class),style:l.computed(()=>a.style),"onUpdate:modelValue":t=>f(N.UPDATE_MODEL_EVENT,t),valueKey:o,popperClass:l.computed(()=>{const t=[g.e("popper")];return e.popperClass&&t.push(e.popperClass),t.join(" ")}),popperStyle:l.computed(()=>{const t=e.dropdownMaxHeight,r=typeof t=="number"?`${t}px`:String(t||"274px");return{...e.popperStyle||{},"--vft-tree-select-dropdown-max-height":r}}),filterMethod:(t="")=>{e.filterMethod?e.filterMethod(t):e.remoteMethod?e.remoteMethod(t):s.value?.filter(t)}}};exports.useSelect=C;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { SelectV2Instance } from 'vft/es/components/select/token';
|
|
3
|
+
export declare const useSelect: (props: any, { attrs, emit }: {
|
|
4
|
+
attrs: any;
|
|
5
|
+
emit: any;
|
|
6
|
+
}, { select, tree, key, }: {
|
|
7
|
+
select: Ref<SelectV2Instance | undefined>;
|
|
8
|
+
tree: Ref<any>;
|
|
9
|
+
key: Ref<string>;
|
|
10
|
+
}) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("vft/theme-style/base.css");require("vft/theme-style/vft-input.css");require("vft/theme-style/vft-tag.css");require("vft/theme-style/vft-scrollbar.css");require("vft/theme-style/vft-popper.css");require("vft/theme-style/vft-virtual-list.css");require("vft/theme-style/vft-select.css");require("vft/theme-style/vft-checkbox.css");require("vft/theme-style/vft-tree.css");require("vft/theme-style/vft-icon.css");require("vft/theme-style/vft-tree-select.css");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require("vft/theme-style/src/base.scss");require("vft/theme-style/src/input.scss");require("vft/theme-style/src/tag.scss");require("vft/theme-style/src/scrollbar.scss");require("vft/theme-style/src/popper.scss");require("vft/theme-style/src/virtual-list.scss");require("vft/theme-style/src/select.scss");require("vft/theme-style/src/checkbox.scss");require("vft/theme-style/src/tree.scss");require("vft/theme-style/src/icon.scss");require("vft/theme-style/src/tree-select.scss");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),u=l.defineComponent({name:"TreeSelectOption",props:{value:{type:[String,Number,Boolean,Object],required:!0},label:{type:[String,Number],default:""},disabled:{type:Boolean,default:!1},visible:{type:Boolean,default:!0}},setup(e,{slots:t}){return()=>e.visible?l.h("span",{class:"vft-tree-select-option","data-value":e.value},t.default?t.default():e.label):null}});exports.default=u;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
declare const component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
value: {
|
|
3
|
+
type: (ObjectConstructor | StringConstructor | NumberConstructor | BooleanConstructor)[];
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
label: {
|
|
7
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
disabled: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
visible: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
|
+
value: {
|
|
22
|
+
type: (ObjectConstructor | StringConstructor | NumberConstructor | BooleanConstructor)[];
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
label: {
|
|
26
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
disabled: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
33
|
+
visible: {
|
|
34
|
+
type: BooleanConstructor;
|
|
35
|
+
default: boolean;
|
|
36
|
+
};
|
|
37
|
+
}>> & Readonly<{}>, {
|
|
38
|
+
label: string | number;
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
visible: boolean;
|
|
41
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
42
|
+
export default component;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./tree-select.vue2.cjs");;/* empty css */exports.default=e.default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("lodash-es"),p=require("../select/index.cjs"),y=require("../select/defaults.cjs"),h=require("../tree/index.cjs"),g=require("./select.cjs"),C=require("./tree.cjs"),b={data:Array,emptyText:String,renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:Boolean,autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:Boolean,draggable:Boolean,allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:Boolean,highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:[String,Object]},k=e.defineComponent({name:"VftTreeSelect",inheritAttrs:!1,props:{...y.selectV2Props,...b,cacheData:{type:Array,default:()=>[]},options:{type:Array,default:()=>[]},dropdownMaxHeight:{type:[Number,String],default:274}},setup(o,n){const{expose:s}=n,t=e.ref(),r=e.ref(),a=e.computed(()=>o.nodeKey||o.valueKey||"value"),u=g.useSelect(o,n,{select:t,tree:r,key:a}),i=C.useTree(o,n,{select:t,tree:r,key:a}),{cacheOptions:v,...f}=i,c=e.reactive({});return s(c),e.onMounted(()=>{Object.assign(c,{...d.pick(r.value,["filter","updateKeyChildren","getCheckedNodes","setCheckedNodes","getCheckedKeys","setCheckedKeys","setChecked","getHalfCheckedNodes","getHalfCheckedKeys","getCurrentKey","getCurrentNode","setCurrentKey","setCurrentNode","getNode","remove","append","insertBefore","insertAfter"]),...d.pick(t.value,["focus","blur"]),selectedLabel:t.value?.selectedLabel??"",treeRef:r.value,selectRef:t.value})}),()=>e.h(p.VftSelect,e.reactive({...u,ref:l=>t.value=l}),{default:()=>null,empty:()=>e.h("div",{style:{display:"none"}}),footer:()=>e.h(h.VftTree,e.reactive({...f,ref:l=>r.value=l}))})}});exports.default=k;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),x=require("lodash-es"),C=require("../../constants/event.cjs");require("@vueuse/core");const g=require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");const D=require("../../utils/vue/data-helper.cjs");require("../form/index.cjs");require("../tree/index.cjs");const M=require("./tree-select-option.cjs"),n=require("./utils.cjs"),q=(e,{attrs:f,slots:V,emit:k},{select:y,tree:i,key:E})=>{r.watch([()=>e.modelValue,i],()=>{e.showCheckbox&&r.nextTick(()=>{const l=i.value;l&&!x.isEqual(l.getCheckedKeys(),n.toValidArray(e.modelValue))&&l.setCheckedKeys(n.toValidArray(e.modelValue))})},{immediate:!0,deep:!0});const m=r.computed(()=>({value:E.value,label:"label",children:"children",disabled:"disabled",isLeaf:"isLeaf",...e.props})),d=(l,c)=>{const t=m.value[l];return g.isFunction(t)?t(c,i.value?.getNode(d("value",c))):c[t]},K=n.toValidArray(e.modelValue).map(l=>n.treeFind(e.data||[],c=>d("value",c)===l,c=>d("children",c),(c,t,o,u)=>u&&d("value",u))).filter(l=>n.isValidValue(l)),O=r.computed(()=>{if(!e.renderAfterExpand&&!e.lazy)return[];const l=[];return n.treeEach(e.data.concat(e.cacheData||[]),c=>{const t=d("value",c);l.push({value:t,currentLabel:d("label",c),isDisabled:d("disabled",c)})},c=>d("children",c)),l}),N=()=>i.value?.getCheckedKeys().filter(l=>{const c=i.value?.getNode(l);return!x.isNil(c)&&g.isEmpty(c.childNodes)}),T=["data","emptyText","renderAfterExpand","nodeKey","checkStrictly","defaultExpandAll","expandOnClickNode","checkOnClickNode","checkDescendants","autoExpandParent","defaultCheckedKeys","defaultExpandedKeys","currentNodeKey","renderContent","showCheckbox","draggable","allowDrag","allowDrop","props","lazy","highlightCurrent","load","filterNodeMethod","accordion","indent","icon"];return{...x.pick(r.toRefs(e),T),...f,nodeKey:E,expandOnClickNode:r.computed(()=>!e.checkStrictly&&e.expandOnClickNode),defaultExpandedKeys:r.computed(()=>e.defaultExpandedKeys?e.defaultExpandedKeys.concat(K):K),renderContent:(l,{node:c,data:t,store:o})=>l(M.default,{value:d("value",t),label:d("label",t),disabled:d("disabled",t),visible:c.visible},e.renderContent?()=>e.renderContent(l,{node:c,data:t,store:o}):V.default?()=>V.default({node:c,data:t,store:o}):void 0),filterNodeMethod:(l,c,t)=>e.filterNodeMethod?e.filterNodeMethod(l,c,t):l?new RegExp(D.escapeStringRegexp(l),"i").test(d("label",c)||""):!0,onNodeClick:(l,c,t)=>{if(f.onNodeClick?.(l,c,t),!(e.showCheckbox&&e.checkOnClickNode))if(!e.showCheckbox&&(e.checkStrictly||c.isLeaf)){if(!d("disabled",l)){const o=d("value",l),u={[E.value]:o,label:d("label",l),disabled:d("disabled",l)};if(y.value?.allOptionsValueMap){const h=y.value.allOptionsValueMap.get(o);h?y.value?.onSelect(h.option):y.value?.onSelect(u)}else y.value?.onSelect(u)}}else e.expandOnClickNode&&t.proxy.handleExpandIconClick()},onCheck:(l,c)=>{if(!e.showCheckbox)return;const t=d("value",l),o={};n.treeEach([i.value.store.root],a=>o[a.key]=a,a=>a.childNodes);const u=c.checkedKeys,h=e.multiple?n.toValidArray(e.modelValue).filter(a=>!(a in o)&&!u.includes(a)):[],v=h.concat(u);if(e.checkStrictly)k(C.UPDATE_MODEL_EVENT,e.multiple?v:v.includes(t)?t:void 0);else if(e.multiple){const a=N();k(C.UPDATE_MODEL_EVENT,h.concat(a))}else{const a=n.treeFind([l],s=>!n.isValidArray(d("children",s))&&!d("disabled",s),s=>d("children",s)),b=a?d("value",a):void 0,A=n.isValidValue(e.modelValue)&&!!n.treeFind([l],s=>d("value",s)===e.modelValue,s=>d("children",s));k(C.UPDATE_MODEL_EVENT,b===e.modelValue||A?void 0:b)}r.nextTick(()=>{const a=n.toValidArray(e.modelValue);i.value.setCheckedKeys(a),f.onCheck?.(l,{checkedKeys:i.value.getCheckedKeys(),checkedNodes:i.value.getCheckedNodes(),halfCheckedKeys:i.value.getHalfCheckedKeys(),halfCheckedNodes:i.value.getHalfCheckedNodes()})}),y.value?.focus()},onNodeExpand:(l,c,t)=>{f.onNodeExpand?.(l,c,t),r.nextTick(()=>{if(!e.checkStrictly&&e.lazy&&e.multiple&&c.checked){const o={},u=i.value.getCheckedKeys();n.treeEach([i.value.store.root],a=>o[a.key]=a,a=>a.childNodes);const h=n.toValidArray(e.modelValue).filter(a=>!(a in o)&&!u.includes(a)),v=N();k(C.UPDATE_MODEL_EVENT,h.concat(v))}})},cacheOptions:O}};exports.useTree=q;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { SelectV2Instance } from 'vft/es/components/select/token';
|
|
3
|
+
export declare const useTree: (props: any, { attrs, slots, emit }: {
|
|
4
|
+
attrs: any;
|
|
5
|
+
slots: any;
|
|
6
|
+
emit: any;
|
|
7
|
+
}, { select, tree, key, }: {
|
|
8
|
+
select: Ref<SelectV2Instance | undefined>;
|
|
9
|
+
tree: Ref<any>;
|
|
10
|
+
key: Ref<string>;
|
|
11
|
+
}) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@vft/utils");function y(i){return i||i===0}function s(i){return f.isArray(i)&&i.length}function h(i){return f.isArray(i)?i:y(i)?[i]:[]}function V(i,o,e,u,t){for(let n=0;n<i.length;n++){const r=i[n];if(o(r,n,i,t))return u?u(r,n,i,t):r;{const c=e(r);if(s(c)){const d=V(c,o,e,u,r);if(d)return d}}}}function A(i,o,e,u){for(let t=0;t<i.length;t++){const n=i[t];o(n,t,i,u);const r=e(n);s(r)&&A(r,o,e,n)}}exports.isValidArray=s;exports.isValidValue=y;exports.toValidArray=h;exports.treeEach=A;exports.treeFind=V;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TreeNodeData } from 'vft/es/components/tree/tree.type';
|
|
2
|
+
export declare function isValidValue(val: any): any;
|
|
3
|
+
export declare function isValidArray(val: any): number | false;
|
|
4
|
+
export declare function toValidArray(val: any): any[];
|
|
5
|
+
type TreeCallback<T extends TreeNodeData, R> = (data: T, index: number, array: T[], parent?: T) => R;
|
|
6
|
+
type TreeFindCallback<T extends TreeNodeData> = TreeCallback<T, boolean>;
|
|
7
|
+
export declare function treeFind<T extends TreeNodeData>(treeData: T[], findCallback: TreeFindCallback<T>, getChildren: (data: T) => T[]): T | undefined;
|
|
8
|
+
export declare function treeFind<T extends TreeNodeData, R>(treeData: T[], findCallback: TreeFindCallback<T>, getChildren: (data: T) => T[], resultCallback?: TreeCallback<T, R>, parent?: T): R | undefined;
|
|
9
|
+
export declare function treeEach<T extends TreeNodeData>(treeData: T[], callback: TreeCallback<T, void>, getChildren: (data: T) => T[], parent?: T): void;
|
|
10
|
+
export {};
|