vxe-pc-ui 4.21.0 → 4.21.2

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.
Files changed (75) hide show
  1. package/dist/all.esm.js +442 -94
  2. package/dist/all.esm.min.js +3 -3
  3. package/dist/style.css +149 -29
  4. package/dist/style.mini.css +1 -1
  5. package/es/esm.index.d.ts +7 -0
  6. package/es/esm.index.js +8 -0
  7. package/es/icon/style.css +43 -4
  8. package/es/icon/style.mini.css +1 -1
  9. package/es/style.css +149 -29
  10. package/es/style.mini.css +1 -1
  11. package/es/tree/index.d.ts +14 -6
  12. package/es/tree/src/tree.d.ts +3 -1
  13. package/es/tree/src/tree.js +111 -48
  14. package/es/tree/src/util.d.ts +5 -0
  15. package/es/tree/src/util.js +97 -2
  16. package/es/tree/style.css +99 -23
  17. package/es/tree/style.mini.css +1 -1
  18. package/es/ui/index.js +15 -12
  19. package/es/ui/src/log.js +1 -1
  20. package/es/vxe-icon/style.css +43 -4
  21. package/es/vxe-icon/style.mini.css +1 -1
  22. package/es/vxe-tree/style.css +99 -23
  23. package/es/vxe-tree/style.mini.css +1 -1
  24. package/lib/esm.index.d.ts +7 -0
  25. package/lib/esm.index.js +39 -0
  26. package/lib/icon/style/style.css +43 -4
  27. package/lib/icon/style/style.mini.css +1 -1
  28. package/lib/index.umd.js +221 -93
  29. package/lib/index.umd.min.js +3 -3
  30. package/lib/style.css +149 -29
  31. package/lib/style.mini.css +1 -1
  32. package/lib/tree/index.d.ts +14 -6
  33. package/lib/tree/src/tree.d.ts +3 -1
  34. package/lib/tree/src/tree.js +110 -47
  35. package/lib/tree/src/util.d.ts +5 -0
  36. package/lib/tree/src/util.js +97 -2
  37. package/lib/tree/style/style.css +99 -23
  38. package/lib/tree/style/style.mini.css +1 -1
  39. package/lib/ui/index.js +15 -12
  40. package/lib/ui/src/log.js +1 -1
  41. package/lib/vxe-icon/style/style.css +43 -4
  42. package/lib/vxe-icon/style/style.mini.css +1 -1
  43. package/lib/vxe-tree/style/style.css +99 -23
  44. package/lib/vxe-tree/style/style.mini.css +1 -1
  45. package/package.json +2 -2
  46. package/packages/esm.index.ts +10 -0
  47. package/packages/tree/src/tree.ts +129 -48
  48. package/packages/tree/src/util.ts +113 -1
  49. package/packages/ui/index.ts +14 -11
  50. package/styles/components/icon.scss +11 -3
  51. package/styles/components/tree.scss +145 -14
  52. package/styles/theme/base.scss +7 -2
  53. package/types/components/table.d.ts +1 -0
  54. package/types/components/tree.d.ts +34 -0
  55. /package/dist/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
  56. /package/dist/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
  57. /package/dist/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
  58. /package/es/icon/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
  59. /package/es/icon/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
  60. /package/es/icon/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
  61. /package/es/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
  62. /package/es/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
  63. /package/es/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
  64. /package/es/vxe-icon/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
  65. /package/es/vxe-icon/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
  66. /package/es/vxe-icon/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
  67. /package/lib/icon/style/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
  68. /package/lib/icon/style/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
  69. /package/lib/icon/style/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
  70. /package/lib/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
  71. /package/lib/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
  72. /package/lib/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
  73. /package/lib/vxe-icon/style/{iconfont.1794558186564.ttf → iconfont.1794797289947.ttf} +0 -0
  74. /package/lib/vxe-icon/style/{iconfont.1794558186564.woff → iconfont.1794797289947.woff} +0 -0
  75. /package/lib/vxe-icon/style/{iconfont.1794558186564.woff2 → iconfont.1794797289947.woff2} +0 -0
@@ -62,6 +62,7 @@ export declare const VxeTree: {
62
62
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.ShowLine>;
63
63
  default: () => boolean | undefined;
64
64
  };
65
+ lineConfig: import("vue").PropType<import("../../types").VxeTreePropTypes.LineConfig>;
65
66
  trigger: import("vue").PropType<import("../../types").VxeTreePropTypes.Trigger>;
66
67
  indent: {
67
68
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.Indent>;
@@ -214,6 +215,7 @@ export declare const VxeTree: {
214
215
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.ShowLine>;
215
216
  default: () => boolean | undefined;
216
217
  };
218
+ lineConfig: import("vue").PropType<import("../../types").VxeTreePropTypes.LineConfig>;
217
219
  trigger: import("vue").PropType<import("../../types").VxeTreePropTypes.Trigger>;
218
220
  indent: {
219
221
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.Indent>;
@@ -314,7 +316,6 @@ export declare const VxeTree: {
314
316
  autoResize: boolean;
315
317
  showOverflow: boolean;
316
318
  emptyText: import("../../types").VxeTreePropTypes.EmptyText;
317
- indent: number;
318
319
  showRadio: boolean;
319
320
  showCheckbox: boolean;
320
321
  accordion: boolean;
@@ -328,6 +329,7 @@ export declare const VxeTree: {
328
329
  rootParentValue: import("../../types").VxeTreePropTypes.RootParentValue;
329
330
  rootValues: import("../../types").VxeTreePropTypes.RootValues;
330
331
  showLine: boolean;
332
+ indent: number;
331
333
  iconOpen: string;
332
334
  iconClose: string;
333
335
  iconLoaded: string;
@@ -400,6 +402,7 @@ export declare const VxeTree: {
400
402
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.ShowLine>;
401
403
  default: () => boolean | undefined;
402
404
  };
405
+ lineConfig: import("vue").PropType<import("../../types").VxeTreePropTypes.LineConfig>;
403
406
  trigger: import("vue").PropType<import("../../types").VxeTreePropTypes.Trigger>;
404
407
  indent: {
405
408
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.Indent>;
@@ -500,7 +503,6 @@ export declare const VxeTree: {
500
503
  autoResize: boolean;
501
504
  showOverflow: boolean;
502
505
  emptyText: import("../../types").VxeTreePropTypes.EmptyText;
503
- indent: number;
504
506
  showRadio: boolean;
505
507
  showCheckbox: boolean;
506
508
  accordion: boolean;
@@ -514,6 +516,7 @@ export declare const VxeTree: {
514
516
  rootParentValue: import("../../types").VxeTreePropTypes.RootParentValue;
515
517
  rootValues: import("../../types").VxeTreePropTypes.RootValues;
516
518
  showLine: boolean;
519
+ indent: number;
517
520
  iconOpen: string;
518
521
  iconClose: string;
519
522
  iconLoaded: string;
@@ -583,6 +586,7 @@ export declare const VxeTree: {
583
586
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.ShowLine>;
584
587
  default: () => boolean | undefined;
585
588
  };
589
+ lineConfig: import("vue").PropType<import("../../types").VxeTreePropTypes.LineConfig>;
586
590
  trigger: import("vue").PropType<import("../../types").VxeTreePropTypes.Trigger>;
587
591
  indent: {
588
592
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.Indent>;
@@ -683,7 +687,6 @@ export declare const VxeTree: {
683
687
  autoResize: boolean;
684
688
  showOverflow: boolean;
685
689
  emptyText: import("../../types").VxeTreePropTypes.EmptyText;
686
- indent: number;
687
690
  showRadio: boolean;
688
691
  showCheckbox: boolean;
689
692
  accordion: boolean;
@@ -697,6 +700,7 @@ export declare const VxeTree: {
697
700
  rootParentValue: import("../../types").VxeTreePropTypes.RootParentValue;
698
701
  rootValues: import("../../types").VxeTreePropTypes.RootValues;
699
702
  showLine: boolean;
703
+ indent: number;
700
704
  iconOpen: string;
701
705
  iconClose: string;
702
706
  iconLoaded: string;
@@ -766,6 +770,7 @@ export declare const Tree: {
766
770
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.ShowLine>;
767
771
  default: () => boolean | undefined;
768
772
  };
773
+ lineConfig: import("vue").PropType<import("../../types").VxeTreePropTypes.LineConfig>;
769
774
  trigger: import("vue").PropType<import("../../types").VxeTreePropTypes.Trigger>;
770
775
  indent: {
771
776
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.Indent>;
@@ -918,6 +923,7 @@ export declare const Tree: {
918
923
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.ShowLine>;
919
924
  default: () => boolean | undefined;
920
925
  };
926
+ lineConfig: import("vue").PropType<import("../../types").VxeTreePropTypes.LineConfig>;
921
927
  trigger: import("vue").PropType<import("../../types").VxeTreePropTypes.Trigger>;
922
928
  indent: {
923
929
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.Indent>;
@@ -1018,7 +1024,6 @@ export declare const Tree: {
1018
1024
  autoResize: boolean;
1019
1025
  showOverflow: boolean;
1020
1026
  emptyText: import("../../types").VxeTreePropTypes.EmptyText;
1021
- indent: number;
1022
1027
  showRadio: boolean;
1023
1028
  showCheckbox: boolean;
1024
1029
  accordion: boolean;
@@ -1032,6 +1037,7 @@ export declare const Tree: {
1032
1037
  rootParentValue: import("../../types").VxeTreePropTypes.RootParentValue;
1033
1038
  rootValues: import("../../types").VxeTreePropTypes.RootValues;
1034
1039
  showLine: boolean;
1040
+ indent: number;
1035
1041
  iconOpen: string;
1036
1042
  iconClose: string;
1037
1043
  iconLoaded: string;
@@ -1104,6 +1110,7 @@ export declare const Tree: {
1104
1110
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.ShowLine>;
1105
1111
  default: () => boolean | undefined;
1106
1112
  };
1113
+ lineConfig: import("vue").PropType<import("../../types").VxeTreePropTypes.LineConfig>;
1107
1114
  trigger: import("vue").PropType<import("../../types").VxeTreePropTypes.Trigger>;
1108
1115
  indent: {
1109
1116
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.Indent>;
@@ -1204,7 +1211,6 @@ export declare const Tree: {
1204
1211
  autoResize: boolean;
1205
1212
  showOverflow: boolean;
1206
1213
  emptyText: import("../../types").VxeTreePropTypes.EmptyText;
1207
- indent: number;
1208
1214
  showRadio: boolean;
1209
1215
  showCheckbox: boolean;
1210
1216
  accordion: boolean;
@@ -1218,6 +1224,7 @@ export declare const Tree: {
1218
1224
  rootParentValue: import("../../types").VxeTreePropTypes.RootParentValue;
1219
1225
  rootValues: import("../../types").VxeTreePropTypes.RootValues;
1220
1226
  showLine: boolean;
1227
+ indent: number;
1221
1228
  iconOpen: string;
1222
1229
  iconClose: string;
1223
1230
  iconLoaded: string;
@@ -1287,6 +1294,7 @@ export declare const Tree: {
1287
1294
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.ShowLine>;
1288
1295
  default: () => boolean | undefined;
1289
1296
  };
1297
+ lineConfig: import("vue").PropType<import("../../types").VxeTreePropTypes.LineConfig>;
1290
1298
  trigger: import("vue").PropType<import("../../types").VxeTreePropTypes.Trigger>;
1291
1299
  indent: {
1292
1300
  type: import("vue").PropType<import("../../types").VxeTreePropTypes.Indent>;
@@ -1387,7 +1395,6 @@ export declare const Tree: {
1387
1395
  autoResize: boolean;
1388
1396
  showOverflow: boolean;
1389
1397
  emptyText: import("../../types").VxeTreePropTypes.EmptyText;
1390
- indent: number;
1391
1398
  showRadio: boolean;
1392
1399
  showCheckbox: boolean;
1393
1400
  accordion: boolean;
@@ -1401,6 +1408,7 @@ export declare const Tree: {
1401
1408
  rootParentValue: import("../../types").VxeTreePropTypes.RootParentValue;
1402
1409
  rootValues: import("../../types").VxeTreePropTypes.RootValues;
1403
1410
  showLine: boolean;
1411
+ indent: number;
1404
1412
  iconOpen: string;
1405
1413
  iconClose: string;
1406
1414
  iconLoaded: string;
@@ -70,6 +70,7 @@ declare const _default: import("vue").DefineComponent<{
70
70
  type: PropType<VxeTreePropTypes.ShowLine>;
71
71
  default: () => boolean | undefined;
72
72
  };
73
+ lineConfig: PropType<VxeTreePropTypes.LineConfig>;
73
74
  trigger: PropType<VxeTreePropTypes.Trigger>;
74
75
  indent: {
75
76
  type: PropType<VxeTreePropTypes.Indent>;
@@ -210,6 +211,7 @@ declare const _default: import("vue").DefineComponent<{
210
211
  type: PropType<VxeTreePropTypes.ShowLine>;
211
212
  default: () => boolean | undefined;
212
213
  };
214
+ lineConfig: PropType<VxeTreePropTypes.LineConfig>;
213
215
  trigger: PropType<VxeTreePropTypes.Trigger>;
214
216
  indent: {
215
217
  type: PropType<VxeTreePropTypes.Indent>;
@@ -310,7 +312,6 @@ declare const _default: import("vue").DefineComponent<{
310
312
  autoResize: boolean;
311
313
  showOverflow: boolean;
312
314
  emptyText: VxeTreePropTypes.EmptyText;
313
- indent: number;
314
315
  showRadio: boolean;
315
316
  showCheckbox: boolean;
316
317
  accordion: boolean;
@@ -324,6 +325,7 @@ declare const _default: import("vue").DefineComponent<{
324
325
  rootParentValue: VxeTreePropTypes.RootParentValue;
325
326
  rootValues: VxeTreePropTypes.RootValues;
326
327
  showLine: boolean;
328
+ indent: number;
327
329
  iconOpen: string;
328
330
  iconClose: string;
329
331
  iconLoaded: string;
@@ -190,6 +190,7 @@ var tree_default = (
190
190
  type: Boolean,
191
191
  default: () => getConfig().tree.showLine
192
192
  },
193
+ lineConfig: Object,
193
194
  trigger: String,
194
195
  indent: {
195
196
  type: Number,
@@ -343,6 +344,13 @@ var tree_default = (
343
344
  }
344
345
  return props.isHover;
345
346
  });
347
+ const computeLineOpts = (0, import_vue.computed)(() => {
348
+ return Object.assign({}, getConfig().tree.lineConfig, props.lineConfig);
349
+ });
350
+ const computeShowTreeRootLine = (0, import_vue.computed)(() => {
351
+ const lineOpts = computeLineOpts.value;
352
+ return lineOpts.showRootLine;
353
+ });
346
354
  const computeRadioOpts = (0, import_vue.computed)(() => {
347
355
  return Object.assign({ showIcon: true }, getConfig().tree.radioConfig, props.radioConfig);
348
356
  });
@@ -384,6 +392,8 @@ var tree_default = (
384
392
  const computeTreeStyle = (0, import_vue.computed)(() => {
385
393
  const { indent } = props;
386
394
  const { customHeight, customMinHeight, customMaxHeight } = reactData;
395
+ const lineOpts = computeLineOpts.value;
396
+ const { lineWidth, lineColor } = lineOpts;
387
397
  const checkboxOpts = computeCheckboxOpts.value;
388
398
  const { nodeStyle } = checkboxOpts;
389
399
  const stys = {};
@@ -399,6 +409,12 @@ var tree_default = (
399
409
  if (indent) {
400
410
  stys["--vxe-ui-tree-node-indent"] = (0, import_dom.toCssUnit)(indent);
401
411
  }
412
+ if (lineWidth) {
413
+ stys["--vxe-ui-tree-node-line-width"] = (0, import_dom.toCssUnit)(lineWidth);
414
+ }
415
+ if (lineColor) {
416
+ stys["--vxe-ui-tree-node-line-color"] = (0, import_dom.toCssUnit)(lineColor);
417
+ }
402
418
  if (nodeStyle) {
403
419
  const { indeterminateColor, checkedColor } = nodeStyle;
404
420
  if (indeterminateColor) {
@@ -680,7 +696,8 @@ var tree_default = (
680
696
  level: nodes.length - 1,
681
697
  treeIndex: index,
682
698
  lineCount: 0,
683
- treeLoaded: false
699
+ treeLoaded: false,
700
+ linesMask: 0
684
701
  };
685
702
  },
686
703
  { children: childrenField }
@@ -688,40 +705,69 @@ var tree_default = (
688
705
  internalData.nodeMaps = keyMaps;
689
706
  };
690
707
  const updateAfterDataIndex = () => {
691
- const { transform } = props;
708
+ const { lazy, showLine, transform } = props;
692
709
  const { afterTreeList, nodeMaps } = internalData;
693
710
  const childrenField = computeChildrenField.value;
694
711
  const mapChildrenField = computeMapChildrenField.value;
712
+ const hasChildField = computeHasChildField.value;
713
+ const showTreeRootLine = computeShowTreeRootLine.value;
714
+ const treeFullSize = afterTreeList.length;
695
715
  let vtIndex = 0;
696
- import_xe_utils.default.eachTree(
697
- afterTreeList,
698
- (item, index, items, path, parenItem, nodes) => {
699
- const nodeid = getNodeId(item);
700
- const nodeItem = nodeMaps[nodeid];
701
- if (nodeItem) {
702
- nodeItem.items = items;
703
- nodeItem.treeIndex = index;
704
- nodeItem._index = vtIndex;
705
- } else {
706
- const rest = {
707
- item,
708
- index,
709
- $index: -1,
710
- _index: vtIndex,
711
- items,
712
- parent: parenItem,
713
- nodes,
714
- level: nodes.length - 1,
715
- treeIndex: index,
716
- lineCount: 0,
717
- treeLoaded: false
718
- };
719
- nodeMaps[nodeid] = rest;
716
+ function handleTreeDFS(item, index, items, parenItem, depth, isFirstRow, isLastRow, isLastChild, stackMask, seq) {
717
+ const nodeid = getNodeId(item);
718
+ let nodeItem = nodeMaps[nodeid];
719
+ const nodeChilds = item[transform ? mapChildrenField : childrenField];
720
+ const childList = import_xe_utils.default.get(item, childrenField);
721
+ const isExistChild = childList && childList.length > 0;
722
+ if (nodeItem) {
723
+ nodeItem.items = items;
724
+ nodeItem.treeIndex = index;
725
+ nodeItem._index = vtIndex;
726
+ } else {
727
+ nodeItem = {
728
+ item,
729
+ index,
730
+ $index: -1,
731
+ _index: vtIndex,
732
+ items,
733
+ parent: parenItem,
734
+ nodes: [],
735
+ level: 0,
736
+ treeIndex: index,
737
+ lineCount: 0,
738
+ treeLoaded: false,
739
+ linesMask: 0
740
+ };
741
+ nodeMaps[nodeid] = nodeItem;
742
+ }
743
+ let linesMask = stackMask >> 1;
744
+ if (!isLastChild) {
745
+ linesMask |= 1 << depth - 1;
746
+ }
747
+ nodeItem.level = depth - 1;
748
+ nodeItem.linesMask = linesMask;
749
+ let hasLazyChilds = false;
750
+ let isLazyLoaded = false;
751
+ if (lazy) {
752
+ hasLazyChilds = item[hasChildField];
753
+ isLazyLoaded = !!nodeItem.treeLoaded;
754
+ }
755
+ const isExpandable = lazy ? isLazyLoaded ? isExistChild : hasLazyChilds : isExistChild;
756
+ nodeItem.treeLines = showLine && treeFullSize > 1 ? (0, import_util.getTreeNodeLines)(isExpandable, depth, linesMask, isFirstRow, isLastRow, showTreeRootLine) : [];
757
+ let nextStackMask = stackMask;
758
+ if (!isLastChild) {
759
+ nextStackMask |= 1 << depth;
760
+ }
761
+ vtIndex++;
762
+ if (nodeChilds) {
763
+ for (let i = 0; i < nodeChilds.length; i++) {
764
+ handleTreeDFS(nodeChilds[i], i, nodeChilds, item, depth + 1, false, false, i === nodeChilds.length - 1, nextStackMask, `${seq}.${i + 1}`);
720
765
  }
721
- vtIndex++;
722
- },
723
- { children: transform ? mapChildrenField : childrenField }
724
- );
766
+ }
767
+ }
768
+ for (let i = 0; i < treeFullSize; i++) {
769
+ handleTreeDFS(afterTreeList[i], i, afterTreeList, null, 1, !i, i === treeFullSize - 1, i === treeFullSize - 1, 0, "" + i);
770
+ }
725
771
  };
726
772
  const updateAfterFullData = () => {
727
773
  const { transform, filterValue } = props;
@@ -2111,7 +2157,8 @@ var tree_default = (
2111
2157
  level: parentLevel + nodes.length,
2112
2158
  treeIndex: -1,
2113
2159
  lineCount: 0,
2114
- treeLoaded: false
2160
+ treeLoaded: false,
2161
+ linesMask: 0
2115
2162
  };
2116
2163
  },
2117
2164
  { children: childrenField }
@@ -3145,10 +3192,28 @@ var tree_default = (
3145
3192
  }
3146
3193
  return renderEmptyElement($xeTree);
3147
3194
  };
3195
+ const renderLine = (nodeItem) => {
3196
+ const treeLines = nodeItem.treeLines;
3197
+ const lineVNs = [];
3198
+ if (treeLines) {
3199
+ const lineOpts = computeLineOpts.value;
3200
+ const { lineType } = lineOpts;
3201
+ treeLines.forEach((item, i) => {
3202
+ lineVNs.push(
3203
+ (0, import_vue.h)("span", {
3204
+ key: "le" + i,
3205
+ class: ["vxe-tree--node-line", `type--${lineType || "solid"}`, item.type],
3206
+ style: item.style
3207
+ })
3208
+ );
3209
+ });
3210
+ }
3211
+ return lineVNs;
3212
+ };
3148
3213
  const renderNode = (node, nodeid) => {
3149
3214
  const { lazy, drag, transform, showRadio, showCheckbox, showLine, visibleMethod, iconOpen, iconClose, iconLoaded, showIcon } = props;
3150
3215
  const { currentNode, selectRadioKey, updateExpandedFlag } = reactData;
3151
- const { afterTreeList, nodeMaps, treeExpandedMaps, treeExpandLazyLoadedMaps } = internalData;
3216
+ const { nodeMaps, treeExpandedMaps, treeExpandLazyLoadedMaps } = internalData;
3152
3217
  const tooltipOpts = computeTooltipOpts.value;
3153
3218
  const { mode: tipMode } = tooltipOpts;
3154
3219
  const radioOpts = computeRadioOpts.value;
@@ -3187,7 +3252,6 @@ var tree_default = (
3187
3252
  hasLazyChilds = node[hasChildField];
3188
3253
  isLazyLoaded = !!nodeItem.treeLoaded;
3189
3254
  }
3190
- const prevNode = nodeItem.items[nodeItem.treeIndex - 1];
3191
3255
  const nParams = { node, isExpand, $tree: $xeTree };
3192
3256
  const itemOns = {
3193
3257
  onMousedown(evnt) {
@@ -3241,20 +3305,9 @@ var tree_default = (
3241
3305
  ]
3242
3306
  },
3243
3307
  [
3244
- showLine ? (0, import_vue.h)(
3245
- "div",
3246
- {
3247
- class: "vxe-tree--node-line-wrapper"
3248
- },
3249
- [
3250
- (0, import_vue.h)("div", {
3251
- class: "vxe-tree--node-line",
3252
- style: {
3253
- height: `${getNodeId(afterTreeList[0]) === nodeid ? 1 : (0, import_util.calcTreeLine)($xeTree, node, prevNode)}px`
3254
- }
3255
- })
3256
- ]
3257
- ) : renderEmptyElement($xeTree),
3308
+ showLine ? (0, import_vue.h)("div", {
3309
+ class: "vxe-tree--node-line-wrapper"
3310
+ }, renderLine(nodeItem)) : renderEmptyElement($xeTree),
3258
3311
  (0, import_vue.h)(
3259
3312
  "div",
3260
3313
  {
@@ -3726,6 +3779,16 @@ var tree_default = (
3726
3779
  recalculate();
3727
3780
  });
3728
3781
  });
3782
+ const lineFlag = (0, import_vue.ref)(0);
3783
+ (0, import_vue.watch)(() => props.showLine, () => {
3784
+ lineFlag.value++;
3785
+ });
3786
+ (0, import_vue.watch)(computeShowTreeRootLine, () => {
3787
+ lineFlag.value++;
3788
+ });
3789
+ (0, import_vue.watch)(lineFlag, () => {
3790
+ updateAfterDataIndex();
3791
+ });
3729
3792
  (0, import_vue.watch)(reScrollFlag, () => {
3730
3793
  updateScrollbar().then(() => {
3731
3794
  updateScrollbar();
@@ -1,3 +1,8 @@
1
1
  import type { VxeTreeConstructor, VxeTreeDefines } from '../../../types';
2
2
  export declare function calcTreeLine($xeTree: VxeTreeConstructor, node: any, prevNode: any): number;
3
3
  export declare function getItemCacheObj(item: any): VxeTreeDefines.NodeCacheItem;
4
+ /**
5
+ * 分配树节点的连接线
6
+ * 类名(cut-full / cut-top / cut-bottom)
7
+ */
8
+ export declare function getTreeNodeLines(isExpandable: boolean, depth: number, linesMask: number, isFirstRow: boolean, isLastRow: boolean, showRootLine: boolean | undefined): VxeTreeDefines.NodeCacheTreeLineData[];
@@ -19,7 +19,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var util_exports = {};
20
20
  __export(util_exports, {
21
21
  calcTreeLine: () => calcTreeLine,
22
- getItemCacheObj: () => getItemCacheObj
22
+ getItemCacheObj: () => getItemCacheObj,
23
+ getTreeNodeLines: () => getTreeNodeLines
23
24
  });
24
25
  module.exports = __toCommonJS(util_exports);
25
26
  function countTreeExpand($xeTree, prevNode) {
@@ -66,6 +67,100 @@ function getItemCacheObj(item) {
66
67
  level: 0,
67
68
  treeIndex: -1,
68
69
  lineCount: 0,
69
- treeLoaded: false
70
+ treeLoaded: false,
71
+ linesMask: 0
70
72
  };
71
73
  }
74
+ function getTreeNodeLines(isExpandable, depth, linesMask, isFirstRow, isLastRow, showRootLine) {
75
+ const lines = [];
76
+ for (let col = 1; col <= depth; col++) {
77
+ const leftVal = `var(--vxe-ui-tree-node-padding) + var(--vxe-ui-tree-node-btn-width) / 2 + var(--vxe-ui-tree-node-indent) * ${col - 1}`;
78
+ const through = (linesMask & 1 << col - 1) !== 0;
79
+ if (col === 1 && !showRootLine) {
80
+ continue;
81
+ }
82
+ if (col < depth) {
83
+ if (through) {
84
+ let top = "0";
85
+ let height = "100%";
86
+ if (isFirstRow) {
87
+ top = "50%";
88
+ height = "50%";
89
+ } else if (isLastRow) {
90
+ top = "0";
91
+ height = "50%";
92
+ }
93
+ lines.push({
94
+ type: "v",
95
+ style: {
96
+ left: `calc(${leftVal})`,
97
+ top,
98
+ height
99
+ }
100
+ });
101
+ }
102
+ } else {
103
+ let vTop = "0";
104
+ let vHeight = through ? "100%" : "50%";
105
+ if (isFirstRow && isLastRow) {
106
+ vTop = "50%";
107
+ vHeight = "0px";
108
+ } else if (isFirstRow) {
109
+ vTop = "50%";
110
+ vHeight = "50%";
111
+ } else if (isLastRow) {
112
+ vTop = "0";
113
+ vHeight = "50%";
114
+ }
115
+ if (isExpandable && vHeight !== "0px") {
116
+ let cutType = "v cut";
117
+ if (vTop === "0" && vHeight === "50%") {
118
+ cutType = "v cut-top";
119
+ } else if (vTop === "50%" && vHeight === "50%") {
120
+ cutType = "v cut-bottom";
121
+ } else if (vHeight === "100%") {
122
+ cutType = "v cut-full";
123
+ }
124
+ lines.push({
125
+ type: cutType,
126
+ style: {
127
+ left: `calc(${leftVal})`,
128
+ top: vTop,
129
+ height: vHeight
130
+ }
131
+ });
132
+ } else {
133
+ if (vHeight !== "0px") {
134
+ lines.push({
135
+ type: "v",
136
+ style: {
137
+ left: `calc(${leftVal})`,
138
+ top: vTop,
139
+ height: vHeight
140
+ }
141
+ });
142
+ }
143
+ }
144
+ if (isExpandable) {
145
+ lines.push({
146
+ type: "h",
147
+ style: {
148
+ left: `calc(${leftVal} + var(--vxe-ui-tree-node-btn-width) / 2)`,
149
+ top: "50%",
150
+ width: "calc(var(--vxe-ui-tree-node-indent) - var(--vxe-ui-tree-node-btn-width) - 0.2em)"
151
+ }
152
+ });
153
+ } else {
154
+ lines.push({
155
+ type: "h",
156
+ style: {
157
+ left: `calc(${leftVal})`,
158
+ top: "50%",
159
+ width: "calc(var(--vxe-ui-tree-node-indent) - var(--vxe-ui-tree-node-btn-width) / 2 - 0.1em)"
160
+ }
161
+ });
162
+ }
163
+ }
164
+ }
165
+ return lines;
166
+ }