@v-c/tree 1.0.5 → 1.0.6
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/DropIndicator.js +7 -11
- package/dist/Indent.js +6 -6
- package/dist/MotionTreeNode.js +8 -7
- package/dist/NodeList.js +18 -26
- package/dist/Tree.js +10 -11
- package/dist/TreeNode.js +8 -7
- package/dist/contextTypes.js +5 -2
- package/dist/index.js +7 -6
- package/dist/inter.js +2 -0
- package/dist/util.js +2 -0
- package/dist/utils/conductUtil.js +2 -0
- package/dist/utils/diffUtil.js +2 -0
- package/dist/utils/keyUtil.js +2 -0
- package/dist/utils/treeUtil.js +2 -0
- package/package.json +3 -3
package/dist/DropIndicator.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createVNode, defineComponent } from "vue";
|
|
2
|
-
|
|
2
|
+
//#region src/DropIndicator.tsx
|
|
3
|
+
var DropIndicator = /* @__PURE__ */ defineComponent((props) => {
|
|
3
4
|
return () => {
|
|
4
5
|
const style = {
|
|
5
6
|
pointerEvents: "none",
|
|
@@ -17,7 +18,6 @@ var DropIndicator_default = /* @__PURE__ */ defineComponent((props) => {
|
|
|
17
18
|
style.bottom = 0;
|
|
18
19
|
style.left = `${-props.dropLevelOffset * props.indent}px`;
|
|
19
20
|
break;
|
|
20
|
-
case 0:
|
|
21
21
|
default:
|
|
22
22
|
style.bottom = 0;
|
|
23
23
|
style.left = `${props.indent}px`;
|
|
@@ -27,22 +27,18 @@ var DropIndicator_default = /* @__PURE__ */ defineComponent((props) => {
|
|
|
27
27
|
};
|
|
28
28
|
}, {
|
|
29
29
|
props: {
|
|
30
|
-
dropPosition: {
|
|
31
|
-
required: true,
|
|
32
|
-
default: void 0
|
|
33
|
-
},
|
|
30
|
+
dropPosition: { required: true },
|
|
34
31
|
dropLevelOffset: {
|
|
35
32
|
type: Number,
|
|
36
|
-
required: true
|
|
37
|
-
default: void 0
|
|
33
|
+
required: true
|
|
38
34
|
},
|
|
39
35
|
indent: {
|
|
40
36
|
type: Number,
|
|
41
|
-
required: true
|
|
42
|
-
default: void 0
|
|
37
|
+
required: true
|
|
43
38
|
}
|
|
44
39
|
},
|
|
45
40
|
name: "DropIndicator",
|
|
46
41
|
inheritAttrs: false
|
|
47
42
|
});
|
|
48
|
-
|
|
43
|
+
//#endregion
|
|
44
|
+
export { DropIndicator as default };
|
package/dist/Indent.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createVNode, defineComponent } from "vue";
|
|
2
2
|
import { clsx } from "@v-c/util";
|
|
3
|
-
|
|
3
|
+
//#region src/Indent.tsx
|
|
4
|
+
var Indent = /* @__PURE__ */ defineComponent((props) => {
|
|
4
5
|
return () => {
|
|
5
6
|
const { prefixCls, level, isStart, isEnd } = props;
|
|
6
7
|
const baseClassName = `${prefixCls}-indent-unit`;
|
|
@@ -21,13 +22,11 @@ var Indent_default = /* @__PURE__ */ defineComponent((props) => {
|
|
|
21
22
|
props: {
|
|
22
23
|
prefixCls: {
|
|
23
24
|
type: String,
|
|
24
|
-
required: true
|
|
25
|
-
default: void 0
|
|
25
|
+
required: true
|
|
26
26
|
},
|
|
27
27
|
level: {
|
|
28
28
|
type: Number,
|
|
29
|
-
required: true
|
|
30
|
-
default: void 0
|
|
29
|
+
required: true
|
|
31
30
|
},
|
|
32
31
|
isStart: {
|
|
33
32
|
type: Array,
|
|
@@ -43,4 +42,5 @@ var Indent_default = /* @__PURE__ */ defineComponent((props) => {
|
|
|
43
42
|
name: "Indent",
|
|
44
43
|
inheritAttrs: false
|
|
45
44
|
});
|
|
46
|
-
|
|
45
|
+
//#endregion
|
|
46
|
+
export { Indent as default };
|
package/dist/MotionTreeNode.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { TreeContextKey } from "./contextTypes.js";
|
|
2
2
|
import { getTreeNodeProps } from "./utils/treeUtil.js";
|
|
3
|
-
import
|
|
3
|
+
import TreeNode from "./TreeNode.js";
|
|
4
4
|
import { Transition, computed, createVNode, defineComponent, inject, mergeProps, onBeforeUnmount, ref, watch } from "vue";
|
|
5
5
|
import { clsx } from "@v-c/util";
|
|
6
6
|
import omit from "@v-c/util/dist/omit";
|
|
7
7
|
import { getTransitionProps } from "@v-c/util/dist/utils/transition";
|
|
8
|
-
|
|
8
|
+
//#region src/MotionTreeNode.tsx
|
|
9
|
+
var MotionTreeNode = /* @__PURE__ */ defineComponent((props) => {
|
|
9
10
|
const context = inject(TreeContextKey, null);
|
|
10
11
|
const prefixCls = computed(() => context?.prefixCls);
|
|
11
12
|
let hideTimer = null;
|
|
@@ -83,7 +84,7 @@ var MotionTreeNode_default = /* @__PURE__ */ defineComponent((props) => {
|
|
|
83
84
|
const restProps = { ...nodeData || {} };
|
|
84
85
|
delete restProps.children;
|
|
85
86
|
delete restProps.key;
|
|
86
|
-
return createVNode(
|
|
87
|
+
return createVNode(TreeNode, mergeProps(restProps, getTreeNodeProps(key, requiredProps), {
|
|
87
88
|
"title": title,
|
|
88
89
|
"active": active,
|
|
89
90
|
"data": nodeData,
|
|
@@ -94,7 +95,7 @@ var MotionTreeNode_default = /* @__PURE__ */ defineComponent((props) => {
|
|
|
94
95
|
}), null);
|
|
95
96
|
})])] });
|
|
96
97
|
}
|
|
97
|
-
return createVNode(
|
|
98
|
+
return createVNode(TreeNode, mergeProps(omit(props, [
|
|
98
99
|
"motion",
|
|
99
100
|
"motionNodes",
|
|
100
101
|
"motionType",
|
|
@@ -137,8 +138,7 @@ var MotionTreeNode_default = /* @__PURE__ */ defineComponent((props) => {
|
|
|
137
138
|
},
|
|
138
139
|
treeNodeRequiredProps: {
|
|
139
140
|
type: Object,
|
|
140
|
-
required: true
|
|
141
|
-
default: void 0
|
|
141
|
+
required: true
|
|
142
142
|
},
|
|
143
143
|
treeId: {
|
|
144
144
|
type: String,
|
|
@@ -320,4 +320,5 @@ var MotionTreeNode_default = /* @__PURE__ */ defineComponent((props) => {
|
|
|
320
320
|
name: "MotionTreeNode",
|
|
321
321
|
inheritAttrs: false
|
|
322
322
|
});
|
|
323
|
-
|
|
323
|
+
//#endregion
|
|
324
|
+
export { MotionTreeNode as default };
|
package/dist/NodeList.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { getKey, getTreeNodeProps } from "./utils/treeUtil.js";
|
|
2
|
-
import
|
|
2
|
+
import MotionTreeNode from "./MotionTreeNode.js";
|
|
3
3
|
import { findExpandedKeys, getExpandRange } from "./utils/diffUtil.js";
|
|
4
4
|
import { Fragment, computed, createVNode, defineComponent, mergeProps, ref, shallowRef, watch } from "vue";
|
|
5
5
|
import useId, { getId } from "@v-c/util/dist/hooks/useId";
|
|
6
6
|
import { toPropsRefs } from "@v-c/util/dist/props-util";
|
|
7
7
|
import VirtualList from "@v-c/virtual-list";
|
|
8
|
+
//#region src/NodeList.tsx
|
|
8
9
|
function itemKey(item) {
|
|
9
10
|
const { key, pos } = item;
|
|
10
11
|
return String(getKey(key, pos));
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
+
var MOTION_KEY = `VC_TREE_MOTION_${Math.random()}`;
|
|
13
14
|
var MotionNode = { key: MOTION_KEY };
|
|
14
|
-
|
|
15
|
+
var MotionEntity = {
|
|
15
16
|
key: MOTION_KEY,
|
|
16
17
|
level: 0,
|
|
17
18
|
index: 0,
|
|
@@ -33,7 +34,7 @@ function getMinimumRangeTransitionRange(list, virtual, height, itemHeight) {
|
|
|
33
34
|
if (virtual === false || !height || !itemHeight) return list;
|
|
34
35
|
return list.slice(0, Math.ceil(height / itemHeight) + 1);
|
|
35
36
|
}
|
|
36
|
-
var
|
|
37
|
+
var NodeList = /* @__PURE__ */ defineComponent((props, { attrs, expose }) => {
|
|
37
38
|
const treeId = useId();
|
|
38
39
|
const listRef = ref();
|
|
39
40
|
const indentMeasurerRef = ref();
|
|
@@ -154,7 +155,7 @@ var NodeList_default = /* @__PURE__ */ defineComponent((props, { attrs, expose }
|
|
|
154
155
|
const restProps = { ...nodeData || {} };
|
|
155
156
|
delete restProps.key;
|
|
156
157
|
delete restProps.children;
|
|
157
|
-
return createVNode(
|
|
158
|
+
return createVNode(MotionTreeNode, mergeProps(restProps, treeNodeProps, {
|
|
158
159
|
"title": title,
|
|
159
160
|
"active": active,
|
|
160
161
|
"pos": pos,
|
|
@@ -176,8 +177,7 @@ var NodeList_default = /* @__PURE__ */ defineComponent((props, { attrs, expose }
|
|
|
176
177
|
props: {
|
|
177
178
|
prefixCls: {
|
|
178
179
|
type: String,
|
|
179
|
-
required: true
|
|
180
|
-
default: void 0
|
|
180
|
+
required: true
|
|
181
181
|
},
|
|
182
182
|
style: {
|
|
183
183
|
required: false,
|
|
@@ -215,38 +215,31 @@ var NodeList_default = /* @__PURE__ */ defineComponent((props, { attrs, expose }
|
|
|
215
215
|
},
|
|
216
216
|
expandedKeys: {
|
|
217
217
|
type: Array,
|
|
218
|
-
required: true
|
|
219
|
-
default: void 0
|
|
218
|
+
required: true
|
|
220
219
|
},
|
|
221
220
|
selectedKeys: {
|
|
222
221
|
type: Array,
|
|
223
|
-
required: true
|
|
224
|
-
default: void 0
|
|
222
|
+
required: true
|
|
225
223
|
},
|
|
226
224
|
checkedKeys: {
|
|
227
225
|
type: Array,
|
|
228
|
-
required: true
|
|
229
|
-
default: void 0
|
|
226
|
+
required: true
|
|
230
227
|
},
|
|
231
228
|
loadedKeys: {
|
|
232
229
|
type: Array,
|
|
233
|
-
required: true
|
|
234
|
-
default: void 0
|
|
230
|
+
required: true
|
|
235
231
|
},
|
|
236
232
|
loadingKeys: {
|
|
237
233
|
type: Array,
|
|
238
|
-
required: true
|
|
239
|
-
default: void 0
|
|
234
|
+
required: true
|
|
240
235
|
},
|
|
241
236
|
halfCheckedKeys: {
|
|
242
237
|
type: Array,
|
|
243
|
-
required: true
|
|
244
|
-
default: void 0
|
|
238
|
+
required: true
|
|
245
239
|
},
|
|
246
240
|
keyEntities: {
|
|
247
241
|
type: Object,
|
|
248
|
-
required: true
|
|
249
|
-
default: void 0
|
|
242
|
+
required: true
|
|
250
243
|
},
|
|
251
244
|
dragging: {
|
|
252
245
|
type: Boolean,
|
|
@@ -259,13 +252,11 @@ var NodeList_default = /* @__PURE__ */ defineComponent((props, { attrs, expose }
|
|
|
259
252
|
Number,
|
|
260
253
|
null
|
|
261
254
|
],
|
|
262
|
-
required: true
|
|
263
|
-
default: void 0
|
|
255
|
+
required: true
|
|
264
256
|
},
|
|
265
257
|
dropPosition: {
|
|
266
258
|
type: [Number, null],
|
|
267
|
-
required: true
|
|
268
|
-
default: void 0
|
|
259
|
+
required: true
|
|
269
260
|
},
|
|
270
261
|
motion: {
|
|
271
262
|
type: Object,
|
|
@@ -351,4 +342,5 @@ var NodeList_default = /* @__PURE__ */ defineComponent((props, { attrs, expose }
|
|
|
351
342
|
name: "NodeList",
|
|
352
343
|
inheritAttrs: false
|
|
353
344
|
});
|
|
354
|
-
|
|
345
|
+
//#endregion
|
|
346
|
+
export { MOTION_KEY, MotionEntity, NodeList as default };
|
package/dist/Tree.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import DropIndicator from "./DropIndicator.js";
|
|
2
2
|
import { TreeContextKey } from "./contextTypes.js";
|
|
3
3
|
import getEntity from "./utils/keyUtil.js";
|
|
4
4
|
import { convertDataToEntities, convertNodePropsToEventData, convertTreeToData, fillFieldNames, flattenTreeData, getTreeNodeProps, isLeafNode, warningWithoutKey } from "./utils/treeUtil.js";
|
|
5
|
-
import
|
|
5
|
+
import NodeList, { MOTION_KEY, MotionEntity } from "./NodeList.js";
|
|
6
6
|
import { arrAdd, arrDel, calcDropPosition, calcSelectedKeys, conductExpandParent, getDragChildrenKeys, parseCheckedKeys, posToArr } from "./util.js";
|
|
7
7
|
import { conductCheck } from "./utils/conductUtil.js";
|
|
8
8
|
import { computed, createVNode, defineComponent, mergeDefaults, mergeProps, onBeforeUnmount, provide, reactive, ref, shallowRef, watch, watchEffect } from "vue";
|
|
@@ -11,6 +11,7 @@ import pickAttrs from "@v-c/util/dist/pickAttrs";
|
|
|
11
11
|
import warning from "@v-c/util/dist/warning";
|
|
12
12
|
import useMergedState from "@v-c/util/dist/hooks/useMergedState";
|
|
13
13
|
import KeyCode from "@v-c/util/dist/KeyCode";
|
|
14
|
+
//#region src/Tree.tsx
|
|
14
15
|
var MAX_RETRY_TIMES = 10;
|
|
15
16
|
var defaultProps = {
|
|
16
17
|
prefixCls: "vc-tree",
|
|
@@ -34,7 +35,7 @@ var defaultProps = {
|
|
|
34
35
|
tabIndex: 0,
|
|
35
36
|
virtual: true
|
|
36
37
|
};
|
|
37
|
-
var
|
|
38
|
+
var Tree = /* @__PURE__ */ defineComponent((props, { slots, attrs, expose }) => {
|
|
38
39
|
const mergedPrefixCls = computed(() => props.prefixCls);
|
|
39
40
|
const mergedShowLine = computed(() => props.showLine);
|
|
40
41
|
const mergedShowIcon = computed(() => props.showIcon);
|
|
@@ -291,17 +292,14 @@ var Tree_default = /* @__PURE__ */ defineComponent((props, { slots, attrs, expos
|
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
294
|
function triggerExpandActionExpand(e, treeNode) {
|
|
294
|
-
const expanded = treeNode.expanded;
|
|
295
295
|
const key = treeNode.key;
|
|
296
296
|
if (treeNode.isLeaf || e.shiftKey || e.metaKey || e.ctrlKey) return;
|
|
297
297
|
const node = flattenNodes.value.find((nodeItem) => nodeItem.key === key);
|
|
298
298
|
if (!node) return;
|
|
299
|
-
|
|
299
|
+
onNodeExpand(e, convertNodePropsToEventData({
|
|
300
300
|
...getTreeNodeProps(key, getTreeNodeRequiredProps.value),
|
|
301
301
|
data: node.data
|
|
302
|
-
});
|
|
303
|
-
setExpandedKeys(expanded ? arrDel(expandedKeys.value, key) : arrAdd(expandedKeys.value, key));
|
|
304
|
-
onNodeExpand(e, eventNode);
|
|
302
|
+
}));
|
|
305
303
|
}
|
|
306
304
|
const onNodeClick = (e, treeNode) => {
|
|
307
305
|
if (props.expandAction === "click") triggerExpandActionExpand(e, treeNode);
|
|
@@ -650,7 +648,7 @@ var Tree_default = /* @__PURE__ */ defineComponent((props, { slots, attrs, expos
|
|
|
650
648
|
indent: indent.value,
|
|
651
649
|
dropIndicatorRender: (diProps) => {
|
|
652
650
|
if (props.dropIndicatorRender) return props.dropIndicatorRender(diProps);
|
|
653
|
-
return createVNode(
|
|
651
|
+
return createVNode(DropIndicator, {
|
|
654
652
|
"dropPosition": diProps.dropPosition,
|
|
655
653
|
"dropLevelOffset": diProps.dropLevelOffset,
|
|
656
654
|
"indent": diProps.indent
|
|
@@ -724,7 +722,7 @@ var Tree_default = /* @__PURE__ */ defineComponent((props, { slots, attrs, expos
|
|
|
724
722
|
return createVNode("div", {
|
|
725
723
|
"class": clsx(mergedPrefixCls.value, props.className, props.rootClassName, { [`${mergedPrefixCls.value}-show-line`]: mergedShowLine.value }),
|
|
726
724
|
"style": props.rootStyle
|
|
727
|
-
}, [createVNode(
|
|
725
|
+
}, [createVNode(NodeList, mergeProps({
|
|
728
726
|
"ref": listRef,
|
|
729
727
|
"prefixCls": mergedPrefixCls.value,
|
|
730
728
|
"style": props.style,
|
|
@@ -1131,4 +1129,5 @@ var Tree_default = /* @__PURE__ */ defineComponent((props, { slots, attrs, expos
|
|
|
1131
1129
|
name: "Tree",
|
|
1132
1130
|
inheritAttrs: false
|
|
1133
1131
|
});
|
|
1134
|
-
|
|
1132
|
+
//#endregion
|
|
1133
|
+
export { Tree as default };
|
package/dist/TreeNode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Indent from "./Indent.js";
|
|
2
2
|
import { TreeContextKey, UnstableContextKey } from "./contextTypes.js";
|
|
3
3
|
import getEntity from "./utils/keyUtil.js";
|
|
4
4
|
import { convertNodePropsToEventData, isLeafNode } from "./utils/treeUtil.js";
|
|
@@ -7,6 +7,7 @@ import { clsx } from "@v-c/util";
|
|
|
7
7
|
import { getId } from "@v-c/util/dist/hooks/useId";
|
|
8
8
|
import pickAttrs from "@v-c/util/dist/pickAttrs";
|
|
9
9
|
import { filterEmpty } from "@v-c/util/dist/props-util";
|
|
10
|
+
//#region src/TreeNode.tsx
|
|
10
11
|
var ICON_OPEN = "open";
|
|
11
12
|
var ICON_CLOSE = "close";
|
|
12
13
|
var defaultTitle = "---";
|
|
@@ -117,11 +118,11 @@ var TreeNode = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
117
118
|
};
|
|
118
119
|
const renderSwitcher = () => {
|
|
119
120
|
if (memoizedIsLeaf.value) {
|
|
120
|
-
const switcherIconDom
|
|
121
|
-
return switcherIconDom
|
|
121
|
+
const switcherIconDom = renderSwitcherIconDom(true);
|
|
122
|
+
return switcherIconDom !== false ? createVNode("span", {
|
|
122
123
|
"class": clsx(`${context.prefixCls}-switcher`, `${context.prefixCls}-switcher-noop`, context.classNames?.itemSwitcher),
|
|
123
124
|
"style": context.styles?.itemSwitcher
|
|
124
|
-
}, [switcherIconDom
|
|
125
|
+
}, [switcherIconDom]) : null;
|
|
125
126
|
}
|
|
126
127
|
const switcherIconDom = renderSwitcherIconDom(false);
|
|
127
128
|
return switcherIconDom !== false ? createVNode("span", {
|
|
@@ -254,7 +255,7 @@ var TreeNode = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
254
255
|
"onDragend": isDraggable.value ? onDragEnd : void 0,
|
|
255
256
|
"onMousemove": props.onMouseMove
|
|
256
257
|
}, dataOrAriaAttributeProps.value), [
|
|
257
|
-
createVNode(
|
|
258
|
+
createVNode(Indent, {
|
|
258
259
|
"prefixCls": context.prefixCls,
|
|
259
260
|
"level": level.value,
|
|
260
261
|
"isStart": props.isStart || [],
|
|
@@ -458,5 +459,5 @@ var TreeNode = /* @__PURE__ */ defineComponent((props, { attrs }) => {
|
|
|
458
459
|
inheritAttrs: false
|
|
459
460
|
});
|
|
460
461
|
TreeNode.isTreeNode = true;
|
|
461
|
-
|
|
462
|
-
export {
|
|
462
|
+
//#endregion
|
|
463
|
+
export { TreeNode as default };
|
package/dist/contextTypes.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/contextTypes.ts
|
|
2
|
+
var TreeContextKey = Symbol("TreeContext");
|
|
3
|
+
/** Internal usage, safe to remove. Do not use in prod */
|
|
4
|
+
var UnstableContextKey = Symbol("UnstableTreeContext");
|
|
5
|
+
//#endregion
|
|
3
6
|
export { TreeContextKey, UnstableContextKey };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { UnstableContextKey } from "./contextTypes.js";
|
|
2
2
|
import { convertDataToEntities, convertTreeToData, fillFieldNames, flattenTreeData } from "./utils/treeUtil.js";
|
|
3
|
-
import
|
|
3
|
+
import TreeNode from "./TreeNode.js";
|
|
4
4
|
import { arrAdd, arrDel, calcDropPosition, calcSelectedKeys, conductExpandParent, getDragChildrenKeys, isFirstChild, isLastChild, parseCheckedKeys, posToArr } from "./util.js";
|
|
5
5
|
import { conductCheck } from "./utils/conductUtil.js";
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
ExportTree
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import Tree from "./Tree.js";
|
|
7
|
+
//#region src/index.ts
|
|
8
|
+
var ExportTree = Tree;
|
|
9
|
+
ExportTree.TreeNode = TreeNode;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { TreeNode, UnstableContextKey, arrAdd, arrDel, calcDropPosition, calcSelectedKeys, conductCheck, conductExpandParent, convertDataToEntities, convertTreeToData, ExportTree as default, fillFieldNames, flattenTreeData, getDragChildrenKeys, isFirstChild, isLastChild, parseCheckedKeys, posToArr };
|
package/dist/inter.js
CHANGED
package/dist/util.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import getEntity from "./utils/keyUtil.js";
|
|
2
2
|
import warning from "@v-c/util/dist/warning";
|
|
3
|
+
//#region src/util.ts
|
|
3
4
|
function arrDel(list, value) {
|
|
4
5
|
if (!list) return [];
|
|
5
6
|
const clone = list.slice();
|
|
@@ -144,4 +145,5 @@ function conductExpandParent(keyList, keyEntities) {
|
|
|
144
145
|
});
|
|
145
146
|
return [...expandedKeys];
|
|
146
147
|
}
|
|
148
|
+
//#endregion
|
|
147
149
|
export { arrAdd, arrDel, calcDropPosition, calcSelectedKeys, conductExpandParent, getDragChildrenKeys, isFirstChild, isLastChild, parseCheckedKeys, posToArr };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import getEntity from "./keyUtil.js";
|
|
2
2
|
import warning from "@v-c/util/dist/warning";
|
|
3
|
+
//#region src/utils/conductUtil.ts
|
|
3
4
|
function removeFromCheckedKeys(halfCheckedKeys, checkedKeys) {
|
|
4
5
|
const filteredKeys = /* @__PURE__ */ new Set();
|
|
5
6
|
halfCheckedKeys.forEach((key) => {
|
|
@@ -103,4 +104,5 @@ function conductCheck(keyList, checked, keyEntities, getCheckDisabled) {
|
|
|
103
104
|
if (checked === true) return fillConductCheck(keys, levelEntities, maxLevel, syntheticGetCheckDisabled);
|
|
104
105
|
return cleanConductCheck(keys, checked.halfCheckedKeys, levelEntities, maxLevel, syntheticGetCheckDisabled);
|
|
105
106
|
}
|
|
107
|
+
//#endregion
|
|
106
108
|
export { conductCheck, isCheckDisabled };
|
package/dist/utils/diffUtil.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/utils/diffUtil.ts
|
|
1
2
|
function findExpandedKeys(prev = [], next = []) {
|
|
2
3
|
const prevLen = prev.length;
|
|
3
4
|
const nextLen = next.length;
|
|
@@ -31,4 +32,5 @@ function getExpandRange(shorter, longer, key) {
|
|
|
31
32
|
}
|
|
32
33
|
return longer.slice(longerStartIndex + 1);
|
|
33
34
|
}
|
|
35
|
+
//#endregion
|
|
34
36
|
export { findExpandedKeys, getExpandRange };
|
package/dist/utils/keyUtil.js
CHANGED
package/dist/utils/treeUtil.js
CHANGED
|
@@ -2,6 +2,7 @@ import getEntity from "./keyUtil.js";
|
|
|
2
2
|
import { toArray } from "@v-c/util/dist/Children/toArray";
|
|
3
3
|
import { omit } from "@v-c/util/dist/utils/omit";
|
|
4
4
|
import warning from "@v-c/util/dist/warning";
|
|
5
|
+
//#region src/utils/treeUtil.ts
|
|
5
6
|
function getPosition(level, index) {
|
|
6
7
|
return `${level}-${index}`;
|
|
7
8
|
}
|
|
@@ -215,4 +216,5 @@ function isLeafNode(isLeaf, loadData, hasChildren, loaded) {
|
|
|
215
216
|
if (isLeaf === false) return false;
|
|
216
217
|
return !!isLeaf || !loadData && !hasChildren || !!(loadData && loaded && !hasChildren);
|
|
217
218
|
}
|
|
219
|
+
//#endregion
|
|
218
220
|
export { convertDataToEntities, convertNodePropsToEventData, convertTreeToData, fillFieldNames, flattenTreeData, getKey, getPosition, getTreeNodeProps, isLeafNode, isTreeNode, traverseDataNodes, warningWithoutKey };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/tree",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.6",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"vue": "^3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@v-c/util": "^1.0.
|
|
33
|
-
"@v-c/virtual-list": "^1.0.
|
|
32
|
+
"@v-c/util": "^1.0.19",
|
|
33
|
+
"@v-c/virtual-list": "^1.0.7"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "vite build",
|