bkui-vue 0.0.1-beta.14 → 0.0.1-beta.15

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 (101) hide show
  1. package/README.md +25 -17
  2. package/README_EN.md +89 -0
  3. package/dist/bkui-vue.cjs.js +1473 -425
  4. package/dist/bkui-vue.esm.js +1472 -427
  5. package/dist/bkui-vue.umd.js +1473 -425
  6. package/dist/style.css +315 -177
  7. package/lib/alert/index.js +1 -1
  8. package/lib/badge/index.js +1 -1
  9. package/lib/breadcrumb/breadcrumb.css +10 -1
  10. package/lib/breadcrumb/breadcrumb.d.ts +20 -0
  11. package/lib/breadcrumb/breadcrumb.less +13 -2
  12. package/lib/breadcrumb/breadcrumb.variable.css +10 -1
  13. package/lib/breadcrumb/index.d.ts +37 -1
  14. package/lib/breadcrumb/index.js +1 -1
  15. package/lib/button/index.js +1 -1
  16. package/lib/card/index.js +1 -1
  17. package/lib/checkbox/index.js +1 -1
  18. package/lib/components.d.ts +2 -0
  19. package/lib/date-picker/index.js +1 -1
  20. package/lib/directives/index.js +1 -1
  21. package/lib/form/index.js +1 -1
  22. package/lib/icon/angle-down-fill.d.ts +4 -0
  23. package/lib/icon/angle-up-fill.d.ts +4 -0
  24. package/lib/icon/arrows-left.d.ts +4 -0
  25. package/lib/icon/index.d.ts +7 -3
  26. package/lib/icon/index.js +1 -1
  27. package/lib/icon/spinner.d.ts +4 -0
  28. package/lib/input/index.d.ts +11 -3
  29. package/lib/input/index.js +2 -2
  30. package/lib/input/input.css +1 -0
  31. package/lib/input/input.d.ts +3 -1
  32. package/lib/input/input.less +4 -3
  33. package/lib/input/input.variable.css +1 -0
  34. package/lib/loading/index.js +1 -1
  35. package/lib/menu/index.js +1 -1
  36. package/lib/modal/index.js +1 -1
  37. package/lib/notify/index.js +1 -1
  38. package/lib/notify/notifyConstructor.d.ts +2 -2
  39. package/lib/popover/index.d.ts +103 -48
  40. package/lib/popover/index.js +1 -1
  41. package/lib/popover/popover.css +22 -13
  42. package/lib/popover/popover.d.ts +30 -23
  43. package/lib/popover/popover.less +55 -45
  44. package/lib/popover/popover.variable.css +22 -13
  45. package/lib/popover/props.d.ts +77 -0
  46. package/lib/process/index.js +1 -1
  47. package/lib/progress/index.d.ts +23 -1
  48. package/lib/progress/index.js +1 -1
  49. package/lib/progress/progress.css +0 -3
  50. package/lib/progress/progress.d.ts +17 -1
  51. package/lib/progress/progress.less +0 -4
  52. package/lib/progress/progress.variable.css +0 -3
  53. package/lib/radio/index.js +1 -1
  54. package/lib/select/common.d.ts +10 -1
  55. package/lib/select/index.d.ts +131 -188
  56. package/lib/select/index.js +2 -2
  57. package/lib/select/option.d.ts +1 -7
  58. package/lib/select/optionGroup.d.ts +22 -15
  59. package/lib/select/select.css +71 -14
  60. package/lib/select/select.d.ts +40 -55
  61. package/lib/select/select.less +73 -14
  62. package/lib/select/select.variable.css +71 -14
  63. package/lib/shared/bk-helper-core.d.ts +6 -0
  64. package/lib/shared/bk-popover.d.ts +45 -4
  65. package/lib/shared/index.d.ts +10 -0
  66. package/lib/shared/index.js +1 -1
  67. package/lib/shared/utils.d.ts +6 -0
  68. package/lib/steps/index.js +1 -1
  69. package/lib/styles/index.d.ts +1 -0
  70. package/lib/styles/index.js +1 -1
  71. package/lib/switcher/index.js +1 -1
  72. package/lib/switcher/switcher.css +149 -135
  73. package/lib/switcher/switcher.less +210 -154
  74. package/lib/switcher/switcher.variable.css +149 -135
  75. package/lib/tab/index.js +1 -1
  76. package/lib/table/index.d.ts +76 -1
  77. package/lib/table/index.js +1 -1
  78. package/lib/table/props.d.ts +38 -0
  79. package/lib/table/render.d.ts +1 -1
  80. package/lib/table/table.css +6 -4
  81. package/lib/table/table.d.ts +34 -0
  82. package/lib/table/table.less +4 -4
  83. package/lib/table/table.variable.css +6 -4
  84. package/lib/table/utils.d.ts +7 -0
  85. package/lib/tree/index.d.ts +22 -8
  86. package/lib/tree/index.js +1 -1
  87. package/lib/tree/props.d.ts +52 -0
  88. package/lib/tree/tree.css +16 -7
  89. package/lib/tree/tree.d.ts +13 -7
  90. package/lib/tree/tree.less +24 -24
  91. package/lib/tree/tree.variable.css +16 -7
  92. package/lib/tree/util.d.ts +3 -44
  93. package/lib/virtual-render/index.d.ts +395 -0
  94. package/lib/virtual-render/index.js +1 -0
  95. package/lib/virtual-render/props.d.ts +147 -0
  96. package/lib/virtual-render/v-virtual-render.d.ts +7 -0
  97. package/lib/virtual-render/virtual-render.css +40 -0
  98. package/lib/virtual-render/virtual-render.d.ts +175 -0
  99. package/lib/virtual-render/virtual-render.less +51 -0
  100. package/lib/virtual-render/virtual-render.variable.css +40 -0
  101. package/package.json +8 -6
@@ -23,6 +23,44 @@ export declare const tableProps: {
23
23
  columnPick: import("vue-types").VueTypeDef<string> & {
24
24
  default: string;
25
25
  };
26
+ /**
27
+ * 设置表格高度
28
+ * 默认:auto,依赖外层高度
29
+ */
30
+ height: import("vue-types").VueTypeDef<string | number> & {
31
+ default: string | number;
32
+ };
33
+ /**
34
+ * 设置表格最小高度
35
+ * 默认:auto,依赖外层高度
36
+ */
37
+ minHeight: import("vue-types").VueTypeDef<string | number> & {
38
+ default: string | number;
39
+ };
40
+ /**
41
+ * 行高,可以为固定数值类型
42
+ * 可以是函数,返回当前行的高度,返回值为数值类型
43
+ */
44
+ rowHeight: import("vue-types").VueTypeDef<any> & {
45
+ default: any;
46
+ };
47
+ /**
48
+ * Thead行高,可以为固定数值类型
49
+ */
50
+ headHeight: import("vue-types").VueTypeValidableDef<number> & {
51
+ default: number;
52
+ } & {
53
+ default: number;
54
+ };
55
+ /**
56
+ * 是否启用虚拟渲染 & 滚动
57
+ * 当数据量很大时,启用虚拟渲染可以解决压面卡顿问题
58
+ */
59
+ virtualEnabled: import("vue-types").VueTypeValidableDef<boolean> & {
60
+ default: boolean;
61
+ } & {
62
+ default: boolean;
63
+ };
26
64
  };
27
65
  export declare type Column = {
28
66
  label: Function | string;
@@ -11,7 +11,7 @@ export default class TableRender {
11
11
  * @param activeColumns 当前选中的列
12
12
  * @returns
13
13
  */
14
- renderTableBodySchema(): JSX.Element;
14
+ renderTableBodySchema(rows: any[]): JSX.Element;
15
15
  /**
16
16
  * 指定列选中状态
17
17
  * @param index 指定选中的列Index
@@ -1,6 +1,7 @@
1
- .bk-table .bk-table-body {
2
- height: 500px;
1
+ .bk-table {
3
2
  overflow: auto;
3
+ }
4
+ .bk-table .bk-table-body {
4
5
  background: white;
5
6
  }
6
7
  .bk-table .bk-table-body table {
@@ -8,10 +9,10 @@
8
9
  border-collapse: collapse;
9
10
  }
10
11
  .bk-table .bk-table-body table .cell {
11
- height: 40px;
12
+ height: var(--row-height);
12
13
  padding: 0 15px;
13
14
  overflow: hidden;
14
- line-height: 40px;
15
+ line-height: var(--row-height);
15
16
  text-overflow: ellipsis;
16
17
  white-space: nowrap;
17
18
  }
@@ -25,6 +26,7 @@
25
26
  top: 0;
26
27
  z-index: 1;
27
28
  background-color: #fff;
29
+ transform: translateY(var(--translate-y));
28
30
  }
29
31
  .bk-table .bk-table-body table thead th.active {
30
32
  background: #f0f1f5;
@@ -8,19 +8,53 @@ declare const _default: import("vue").DefineComponent<{
8
8
  columnPick: import("vue-types").VueTypeDef<string> & {
9
9
  default: string;
10
10
  };
11
+ height: import("vue-types").VueTypeDef<string | number> & {
12
+ default: string | number;
13
+ };
14
+ minHeight: import("vue-types").VueTypeDef<string | number> & {
15
+ default: string | number;
16
+ };
17
+ rowHeight: import("vue-types").VueTypeDef<any> & {
18
+ default: any;
19
+ };
20
+ headHeight: import("vue-types").VueTypeValidableDef<number> & {
21
+ default: number;
22
+ } & {
23
+ default: number;
24
+ };
25
+ virtualEnabled: import("vue-types").VueTypeValidableDef<boolean> & {
26
+ default: boolean;
27
+ } & {
28
+ default: boolean;
29
+ };
11
30
  }, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
12
31
  data?: unknown;
13
32
  columns?: unknown;
14
33
  activeColumn?: unknown;
15
34
  columnPick?: unknown;
35
+ height?: unknown;
36
+ minHeight?: unknown;
37
+ rowHeight?: unknown;
38
+ headHeight?: unknown;
39
+ virtualEnabled?: unknown;
16
40
  } & {
17
41
  data: any[];
42
+ height: string | number;
43
+ headHeight: number;
18
44
  columnPick: string;
45
+ minHeight: string | number;
46
+ virtualEnabled: boolean;
19
47
  } & {
20
48
  columns?: Column[];
21
49
  activeColumn?: number | number[];
50
+ rowHeight?: any;
22
51
  }> & ({} | {}), {
23
52
  data: any[];
53
+ height: string | number;
54
+ headHeight: number;
24
55
  columnPick: string;
56
+ minHeight: string | number;
57
+ rowHeight: any;
58
+ virtualEnabled: boolean;
25
59
  }>;
26
60
  export default _default;
@@ -1,9 +1,8 @@
1
1
  @import '../styles/themes/themes.less';
2
2
 
3
3
  .@{bk-prefix}-table {
4
+ overflow: auto;
4
5
  .@{bk-prefix}-table-body {
5
- height: 500px;
6
- overflow: auto;
7
6
  background: @white-color;
8
7
 
9
8
  table {
@@ -11,10 +10,10 @@
11
10
  border-collapse: collapse;
12
11
 
13
12
  .cell {
14
- height: 40px;
13
+ height: var(--row-height);
15
14
  padding: 0 15px;
16
15
  overflow: hidden;
17
- line-height: 40px;
16
+ line-height: var(--row-height);
18
17
  text-overflow: ellipsis;
19
18
  white-space: nowrap;
20
19
  }
@@ -31,6 +30,7 @@
31
30
  top: 0;
32
31
  z-index: 1;
33
32
  background-color: #fff;
33
+ transform: translateY(var(--translate-y));
34
34
 
35
35
  &.active {
36
36
  background: #f0f1f5;
@@ -84,9 +84,10 @@
84
84
  --date-picker-dropdown-mb: 4px;
85
85
  --date-picker-dropdown-bg: #fff;
86
86
  }
87
- .bk-table .bk-table-body {
88
- height: 500px;
87
+ .bk-table {
89
88
  overflow: auto;
89
+ }
90
+ .bk-table .bk-table-body {
90
91
  background: var(--white-color);
91
92
  }
92
93
  .bk-table .bk-table-body table {
@@ -94,10 +95,10 @@
94
95
  border-collapse: collapse;
95
96
  }
96
97
  .bk-table .bk-table-body table .cell {
97
- height: 40px;
98
+ height: var(--row-height);
98
99
  padding: 0 15px;
99
100
  overflow: hidden;
100
- line-height: 40px;
101
+ line-height: var(--row-height);
101
102
  text-overflow: ellipsis;
102
103
  white-space: nowrap;
103
104
  }
@@ -111,6 +112,7 @@
111
112
  top: 0;
112
113
  z-index: 1;
113
114
  background-color: #fff;
115
+ transform: translateY(var(--translate-y));
114
116
  }
115
117
  .bk-table .bk-table-body table thead th.active {
116
118
  background: #f0f1f5;
@@ -20,3 +20,10 @@ export declare const resolveActiveColumns: (props: TablePropTypes) => number[];
20
20
  */
21
21
  export declare const resolveNumberToNumArray: (prop: number) => number[];
22
22
  export declare const resolveWidth: (propWidth: string | number) => string | number;
23
+ /**
24
+ * 解析可为数字或者字符串设置的样式配置
25
+ * @param val 配置值
26
+ * @param defaultValue 默认值
27
+ * @returns 标准化px string
28
+ */
29
+ export declare const resolveNumberOrStringToPix: (val: string | number, defaultValue?: string | number) => string | number;
@@ -5,8 +5,9 @@ declare const BkTree: {
5
5
  $props: Partial<{
6
6
  data: any[];
7
7
  children: string;
8
- indent: number;
9
8
  lineHeight: number;
9
+ indent: number;
10
+ virtualRender: boolean;
10
11
  }> & Omit<Readonly<{
11
12
  data?: unknown;
12
13
  label?: unknown;
@@ -14,15 +15,17 @@ declare const BkTree: {
14
15
  indent?: unknown;
15
16
  lineHeight?: unknown;
16
17
  levelLine?: unknown;
18
+ virtualRender?: unknown;
17
19
  } & {
18
20
  data: any[];
19
21
  children: string;
20
- indent: number;
21
22
  lineHeight: number;
23
+ indent: number;
24
+ virtualRender: boolean;
22
25
  } & {
23
26
  label?: any;
24
27
  levelLine?: any;
25
- }> & {} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "data" | "children" | "indent" | "lineHeight">;
28
+ }> & {} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "data" | "children" | "lineHeight" | "indent" | "virtualRender">;
26
29
  $attrs: {
27
30
  [x: string]: unknown;
28
31
  };
@@ -43,11 +46,13 @@ declare const BkTree: {
43
46
  indent?: unknown;
44
47
  lineHeight?: unknown;
45
48
  levelLine?: unknown;
49
+ virtualRender?: unknown;
46
50
  } & {
47
51
  data: any[];
48
52
  children: string;
49
- indent: number;
50
53
  lineHeight: number;
54
+ indent: number;
55
+ virtualRender: boolean;
51
56
  } & {
52
57
  label?: any;
53
58
  levelLine?: any;
@@ -61,11 +66,13 @@ declare const BkTree: {
61
66
  hanldeTreeNodeClick: (item: any) => void;
62
67
  getActionIcon: (item: any) => JSX.Element;
63
68
  getRootIcon: (item: any) => JSX.Element;
69
+ getVirtualLines: (node: any) => JSX.Element[];
64
70
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
65
71
  data: any[];
66
72
  children: string;
67
- indent: number;
68
73
  lineHeight: number;
74
+ indent: number;
75
+ virtualRender: boolean;
69
76
  }> & {
70
77
  beforeCreate?: (() => void) | (() => void)[];
71
78
  created?: (() => void) | (() => void)[];
@@ -93,11 +100,13 @@ declare const BkTree: {
93
100
  indent?: unknown;
94
101
  lineHeight?: unknown;
95
102
  levelLine?: unknown;
103
+ virtualRender?: unknown;
96
104
  } & {
97
105
  data: any[];
98
106
  children: string;
99
- indent: number;
100
107
  lineHeight: number;
108
+ indent: number;
109
+ virtualRender: boolean;
101
110
  } & {
102
111
  label?: any;
103
112
  levelLine?: any;
@@ -111,6 +120,7 @@ declare const BkTree: {
111
120
  hanldeTreeNodeClick: (item: any) => void;
112
121
  getActionIcon: (item: any) => JSX.Element;
113
122
  getRootIcon: (item: any) => JSX.Element;
123
+ getVirtualLines: (node: any) => JSX.Element[];
114
124
  }> & {} & {} & import("vue").ComponentCustomProperties;
115
125
  __isFragment?: never;
116
126
  __isTeleport?: never;
@@ -122,11 +132,13 @@ declare const BkTree: {
122
132
  indent?: unknown;
123
133
  lineHeight?: unknown;
124
134
  levelLine?: unknown;
135
+ virtualRender?: unknown;
125
136
  } & {
126
137
  data: any[];
127
138
  children: string;
128
- indent: number;
129
139
  lineHeight: number;
140
+ indent: number;
141
+ virtualRender: boolean;
130
142
  } & {
131
143
  label?: any;
132
144
  levelLine?: any;
@@ -140,10 +152,12 @@ declare const BkTree: {
140
152
  hanldeTreeNodeClick: (item: any) => void;
141
153
  getActionIcon: (item: any) => JSX.Element;
142
154
  getRootIcon: (item: any) => JSX.Element;
155
+ getVirtualLines: (node: any) => JSX.Element[];
143
156
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
144
157
  data: any[];
145
158
  children: string;
146
- indent: number;
147
159
  lineHeight: number;
160
+ indent: number;
161
+ virtualRender: boolean;
148
162
  }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin;
149
163
  export default BkTree;
package/lib/tree/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("../shared"),require("crypto"),require("@bkui-vue/icon/")):"function"==typeof define&&define.amd?define(["exports","vue","../shared","crypto","@bkui-vue/icon/"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Vue,e.Shared,e.require$$0,e._)}(this,(function(e,t,n,o,r){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=i(o);function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u={exports:{}};!function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0}(u);var s=a(u.exports),c={exports:{}};!function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}(c);var p=a(c.exports),d={exports:{}},f={exports:{}},v={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o},e.exports.default=e.exports,e.exports.__esModule=!0}(v),function(e){var t=v.exports;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.default=e.exports,e.exports.__esModule=!0}(f);var h={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0}(h);var _={exports:{}};!function(e){var t=v.exports;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(e,n):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0}(_);var y={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0}(y),function(e){var t=f.exports,n=h.exports,o=_.exports,r=y.exports;e.exports=function(e){return t(e)||n(e)||o(e)||r()},e.exports.default=e.exports,e.exports.__esModule=!0}(d);for(var x=a(d.exports),b=l.default,g=function(){return b.randomBytes(16)},m=[],O=0;O<256;++O)m[O]=(O+256).toString(16).substr(1);var j,N,T=function(e,t){var n=t||0,o=m;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")},S=g,w=T,P=0,C=0;var k=function(e,t,n){var o=t&&n||0,r=t||[],i=(e=e||{}).node||j,l=void 0!==e.clockseq?e.clockseq:N;if(null==i||null==l){var a=S();null==i&&(i=j=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==l&&(l=N=16383&(a[6]<<8|a[7]))}var u=void 0!==e.msecs?e.msecs:(new Date).getTime(),s=void 0!==e.nsecs?e.nsecs:C+1,c=u-P+(s-C)/1e4;if(c<0&&void 0===e.clockseq&&(l=l+1&16383),(c<0||u>P)&&void 0===e.nsecs&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");P=u,C=s,N=l;var p=(1e4*(268435455&(u+=122192928e5))+s)%4294967296;r[o++]=p>>>24&255,r[o++]=p>>>16&255,r[o++]=p>>>8&255,r[o++]=255&p;var d=u/4294967296*1e4&268435455;r[o++]=d>>>8&255,r[o++]=255&d,r[o++]=d>>>24&15|16,r[o++]=d>>>16&255,r[o++]=l>>>8|128,r[o++]=255&l;for(var f=0;f<6;++f)r[o+f]=i[f];return t||w(r)},L=g,M=T;var A=function(e,t,n){var o=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var r=(e=e||{}).random||(e.rng||L)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t)for(var i=0;i<16;++i)t[o+i]=r[i];return t||M(r)},V=k,I=A,q=I;q.v1=V,q.v4=I;var R=q,D=void 0,$="1px dashed #c3cdd7",E={data:n.PropTypes.arrayOf(n.PropTypes.any).def([]),label:n.PropTypes.oneOfType([n.PropTypes.func.def(void 0),n.PropTypes.string.def("label")]),children:n.PropTypes.string.def("children"),indent:n.PropTypes.number.def(18),lineHeight:n.PropTypes.number.def(32),levelLine:n.PropTypes.oneOfType([n.PropTypes.bool.def(!1),n.PropTypes.func.def(void 0),n.PropTypes.string.def("1px dashed #c3cdd7")])},F=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=e.data,o=e.children,r=[],i=0,l={};function a(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",c=0;c<e.length;c++){var d=e[c];if(Array.isArray(d))a(d,t,n,u);else{var f=Object.assign({},d);if("object"===p(f)&&null!==f){var v=R.v4(),h=""!==u?"".concat(u,"-").concat(c):"".concat(c),_=s({__depth:t,__index:c,__uuid:v,__parentId:n,__hasChild:!!(d[o]||[]).length,__path:h,__isRoot:null===n,__order:i},o,null);Object.assign(f,_),Object.assign(l,s({},h,{__isOpen:!1,__showLines:0})),i+=1,r.push(f),Object.prototype.hasOwnProperty.call(d,o)&&a(d[o],t+1,v,h)}}}}return a(t||n),[r,l]},H=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],l=e[t];return"boolean"==typeof l?l?o:r:B(n,e,t,i)},B=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=t[n];if("string"==typeof r)return"object"===p(e)&&null!==e?(Object.prototype.hasOwnProperty.call(e,r)||console.error("cannot find node label with key ".concat(r)),e[r]):r;if("function"==typeof r){var i=r.apply(D,[e].concat(x(o)));return"string"==typeof i?i:void console.error("props label with function return value is not string, please check and return string")}},U=function(e,t){return B(e,t,"label")},W=function(e,t){return{"--level-line":H(t,"levelLine",e,$,null,["tree"]),"--lineHeight":"".concat(t.lineHeight,"px"),"--indent":"".concat(t.indent,"px"),padding:0}},z=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n[e.__path]||{},r=o.childNodeCount,i=void 0===r?0:r,l=o.isLeaf,a=void 0!==l&&l,u=o.lastNode,s=void 0===u?null:u,c=a?0:(n[s]||{childNodeCount:0}).childNodeCount;return Object.assign({"--depth":e.__depth,paddingLeft:0,"--lines":i-c},"function"==typeof t.levelLine?{"--level-line":H(t,"levelLine",e,$,null,["node"])}:{})},G=function(e,t){return{"is-root":e.__isRoot,"bk-tree-node":!0,"is-open":t[e.__path].__isOpen}},J=t.defineComponent({name:"Tree",props:E,setup:function(e){var n=F(e),o=t.reactive({data:n[0],schema:n[1],levelLineSchema:{}});t.watch((function(){return[e.data]}),(function(t){var n=F(e,t);o.data=n[0],o.schema=n[1],u()}),{deep:!0}),t.watch((function(){return[e.levelLine]}),(function(){u()}));var i=t.computed((function(){return o.data.filter((function(e){return d(e)}))})),l=t.computed((function(){return i.value.map((function(e){return e.__path}))})),a=function(e){return"object"===p(e)?(o.schema[e.__path]||{}).__isOpen:"string"==typeof e&&(o.schema[e]||{}).__isOpen},u=function(){e.levelLine?setTimeout((function(){for(var e=i.value.length,t={},n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object.prototype.hasOwnProperty.call(t,e)||Object.assign(t,s({},e,Object.assign(Object.assign({childNodeCount:0,isLastNode:!1},null!==n?{lastNode:n}:{}),null!==o?{isLeaf:o}:{})))};e>0;e--){var r=i.value[e-1],a=c(r),u=!l.value.includes("".concat(r.__path,"-0"));n(r.__path,null,u),n(a,r.__path);var p=t[a],d=t[r.__path],f=d.childNodeCount,v=void 0===f?0:f;d.childNodeCount=v+1,d.isLastNode=p.lastNode===r.__path,p.childNodeCount+=d.childNodeCount}o.levelLineSchema=t})):o.levelLineSchema={}},c=function(e){if(e.__isRoot)return null;var t="-".concat(e.__index).length;return String.prototype.substring.call(e.__path,0,e.__path.length-t)},d=function(e){return e.__isRoot||a(e)||a(c(e))};return u(),{renderData:i,flatData:o,hanldeTreeNodeClick:function(e){if(e.__hasChild){var t=!a(e);Object.assign(e,{__isOpen:t}),i.value.filter((function(t){return String.prototype.startsWith.call(t.__path,e.__path)})).forEach((function(e){return Object.assign(o.schema[e.__path],{__isOpen:t})})),u()}},getActionIcon:function(e){return e.__hasChild?a(e)?t.createVNode(r.DownShape,null,null):t.createVNode(r.RightShape,null,null):null},getRootIcon:function(e){return a(e)?t.createVNode(r.FolderShapeOpen,{class:"bk-tree-icon"},null):t.createVNode(r.Folder,{class:"bk-tree-icon"},null)}}},render:function(){var e=this,n=this.$props;return t.createVNode("div",{class:"bk-tree",style:W(null,n)},[this.renderData.map((function(o){return t.createVNode("div",{class:G(o,e.flatData.schema),style:z(o,n,e.flatData.levelLineSchema),onClick:function(){return e.hanldeTreeNodeClick(o)}},[[e.getActionIcon(o),o.__isRoot?e.getRootIcon(o):t.createVNode(r.TextFile,{class:"bk-tree-icon"},null)],t.createVNode("span",null,[U(o,n)])])}))])}}),K=n.withInstall(J);e.default=K,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("crypto"),require("@bkui-vue/icon/"),require("../shared"),require("../virtual-render")):"function"==typeof define&&define.amd?define(["exports","vue","crypto","@bkui-vue/icon/","../shared","../virtual-render"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Vue,e.require$$0,e._,e.Shared,e["@bkui-vue/virtual-render"])}(this,(function(e,t,n,r,o,i){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=l(n),u=l(i);function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c={exports:{}};!function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports}(c);var p=s(c.exports),d={exports:{}};!function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(d);var f=s(d.exports),v={exports:{}},h={exports:{}},_={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(_),function(e){var t=_.exports;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(h);var y={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(y);var b={exports:{}};!function(e){var t=_.exports;e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(b);var g={exports:{}};!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(g),function(e){var t=h.exports,n=y.exports,r=b.exports,o=g.exports;e.exports=function(e){return t(e)||n(e)||r(e)||o()},e.exports.__esModule=!0,e.exports.default=e.exports}(v);for(var x=s(v.exports),m=a.default,O=function(){return m.randomBytes(16)},j=[],N=0;N<256;++N)j[N]=(N+256).toString(16).substr(1);var T,P,w=function(e,t){var n=t||0,r=j;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")},S=O,L=w,k=0,C=0;var R=function(e,t,n){var r=t&&n||0,o=t||[],i=(e=e||{}).node||T,l=void 0!==e.clockseq?e.clockseq:P;if(null==i||null==l){var a=S();null==i&&(i=T=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==l&&(l=P=16383&(a[6]<<8|a[7]))}var u=void 0!==e.msecs?e.msecs:(new Date).getTime(),s=void 0!==e.nsecs?e.nsecs:C+1,c=u-k+(s-C)/1e4;if(c<0&&void 0===e.clockseq&&(l=l+1&16383),(c<0||u>k)&&void 0===e.nsecs&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");k=u,C=s,P=l;var p=(1e4*(268435455&(u+=122192928e5))+s)%4294967296;o[r++]=p>>>24&255,o[r++]=p>>>16&255,o[r++]=p>>>8&255,o[r++]=255&p;var d=u/4294967296*1e4&268435455;o[r++]=d>>>8&255,o[r++]=255&d,o[r++]=d>>>24&15|16,o[r++]=d>>>16&255,o[r++]=l>>>8|128,o[r++]=255&l;for(var f=0;f<6;++f)o[r+f]=i[f];return t||L(o)},A=O,M=w;var V=function(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||A)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var i=0;i<16;++i)t[r+i]=o[i];return t||M(o)},I=R,q=V,D=q;D.v1=I,D.v4=q;var H=D,$=void 0,E="1px dashed #c3cdd7",F=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=e.data,r=e.children,o=[],i=0,l={};function a(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=0;s<e.length;s++){var c=e[s];if(Array.isArray(c))a(c,t,n,u);else{var d=Object.assign({},c);if("object"===f(d)&&null!==d){var v=H.v4(),h=null!==u?"".concat(u,"-").concat(s):"".concat(s),_=p({__depth:t,__index:s,__uuid:v,__parentId:n,__parentPath:u,__hasChild:!!(c[r]||[]).length,__path:h,__isRoot:null===n,__order:i},r,null);Object.assign(d,_),Object.assign(l,p({},h,{__isOpen:!1,__showLines:0,__isRoot:null===n})),i+=1,o.push(d),Object.prototype.hasOwnProperty.call(c,r)&&a(c[r],t+1,v,h)}}}}return a(t||n),[o,l]},B=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],l=e[t];return"boolean"==typeof l?l?r:o:U(n,e,t,i)},U=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=t[n];if("string"==typeof o)return"object"===f(e)&&null!==e?(Object.prototype.hasOwnProperty.call(e,o)||console.error("cannot find node label with key ".concat(o)),e[o]):o;if("function"==typeof o){var i=o.apply($,[e].concat(x(r)));return"string"==typeof i?i:void console.error("props label with function return value is not string, please check and return string")}},W=function(e,t){return U(e,t,"label")},z=function(e,t){return{"--level-line":B(t,"levelLine",e,E,null,["tree"]),"--lineHeight":"".concat(t.lineHeight,"px"),"--indent":"".concat(t.indent,"px"),padding:0}},G=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n[e.__path]||{},o=r.childNodeCount,i=void 0===o?0:o,l=r.isLeaf,a=void 0!==l&&l,u=r.lastNode,s=void 0===u?null:u,c=a?0:(n[s]||{childNodeCount:0}).childNodeCount;return Object.assign({"--depth":e.__depth,paddingLeft:0,"--lines":i-c},"function"==typeof t.levelLine?{"--level-line":B(t,"levelLine",e,E,null,["node"])}:{})},J=function(e,t,n){return{"is-root":e.__isRoot,"bk-tree-node":!0,"is-open":t[e.__path].__isOpen,"is-virtual-render":n.virtualRender}},K={data:o.PropTypes.arrayOf(o.PropTypes.any).def([]),label:o.PropTypes.oneOfType([o.PropTypes.func.def(void 0),o.PropTypes.string.def("label")]),children:o.PropTypes.string.def("children"),indent:o.PropTypes.number.def(18),lineHeight:o.PropTypes.number.def(32),levelLine:o.PropTypes.oneOfType([o.PropTypes.bool.def(!1),o.PropTypes.func.def(void 0),o.PropTypes.string.def("1px dashed #c3cdd7")]),virtualRender:o.PropTypes.bool.def(!1)},Q=t.defineComponent({name:"Tree",props:K,setup:function(e){var n=F(e),o=t.reactive({data:n[0],schema:n[1],levelLineSchema:{}});t.watch((function(){return[e.data]}),(function(t){var n=F(e,t);o.data=n[0],o.schema=n[1],u()}),{deep:!0}),t.watch((function(){return[e.levelLine]}),(function(){u()}));var i=t.computed((function(){return o.data.filter((function(e){return c(e)}))})),l=t.computed((function(){return i.value.map((function(e){return e.__path}))})),a=function(e){return"object"===f(e)?(o.schema[e.__path]||{}).__isOpen:"string"==typeof e&&(o.schema[e]||{}).__isOpen},u=function(){e.levelLine?setTimeout((function(){for(var e=i.value.length,t={},n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Object.prototype.hasOwnProperty.call(t,e)||Object.assign(t,p({},e,Object.assign(Object.assign({childNodeCount:0,isLastNode:!1},null!==n?{lastNode:n}:{}),null!==r?{isLeaf:r}:{})))};e>0;e--){var r=i.value[e-1],a=s(r),u=!l.value.includes("".concat(r.__path,"-0"));n(r.__path,null,u),n(a,r.__path);var c=t[a],d=t[r.__path],f=d.childNodeCount,v=void 0===f?0:f;d.childNodeCount=v+1,d.isLastNode=c.lastNode===r.__path,c.childNodeCount+=d.childNodeCount}o.levelLineSchema=t})):o.levelLineSchema={}},s=function(e){if(e.__isRoot)return null;var t="-".concat(e.__index).length;return String.prototype.substring.call(e.__path,0,e.__path.length-t)},c=function(e){return e.__isRoot||a(e)||a(s(e))};return u(),{renderData:i,flatData:o,hanldeTreeNodeClick:function(e){if(e.__hasChild){var t=!a(e);Object.assign(e,{__isOpen:t}),i.value.filter((function(t){return String.prototype.startsWith.call(t.__path,e.__path)})).forEach((function(e){return Object.assign(o.schema[e.__path],{__isOpen:t})})),u()}},getActionIcon:function(e){return e.__hasChild?a(e)?t.createVNode(r.DownShape,null,null):t.createVNode(r.RightShape,null,null):null},getRootIcon:function(e){return a(e)?t.createVNode(r.FolderShapeOpen,{class:"bk-tree-icon"},null):t.createVNode(r.Folder,{class:"bk-tree-icon"},null)},getVirtualLines:function(n){if(!e.virtualRender)return null;var r=n.__depth+1;return new Array(r).fill("").map((function(e,t){return t})).filter((function(e){return function(e,t){if(t.__isRoot)return!1;var n="".concat(t.__path).split("-").slice(0,e+1);if(n.join("-")===t.__path)return!0;var r=n.pop(),i=parseInt(r,10);n.push("".concat(i+1));var l=n.join("-"),a=Object.prototype.hasOwnProperty.call(o.schema,l);return console.log("nextNodePath",l,t.__path,a),a}(e,n)})).filter((function(e){return e>0})).map((function(e){return t.createVNode("span",{class:"node-virtual-line",style:(n=r-e,{"--depth":n})},null);var n}))}}},render:function(){var e=this,n=this.$props,o=function(o){return t.createVNode("div",{class:J(o,e.flatData.schema,n),style:G(o,n,e.flatData.levelLineSchema),onClick:function(){return e.hanldeTreeNodeClick(o)}},[[e.getActionIcon(o),o.__isRoot?e.getRootIcon(o):t.createVNode(r.TextFile,{class:"bk-tree-icon"},null)],t.createVNode("span",null,[W(o,n)]),e.getVirtualLines(o)])};return t.createVNode(u.default,{class:"bk-tree",style:z(null,n),list:this.renderData,lineHeight:n.lineHeight,enabled:n.virtualRender},{default:function(e){return(e.data||[]).map(o)}})}}),X=o.withInstall(Q);e.default=X,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -0,0 +1,52 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+ export declare const treeProps: {
3
+ /**
4
+ * 渲染列表
5
+ */
6
+ data: import("vue-types").VueTypeDef<any[]> & {
7
+ default: () => any[];
8
+ };
9
+ /**
10
+ * 指定节点标签为节点对象的某个属性值
11
+ */
12
+ label: import("vue-types").VueTypeDef<any>;
13
+ /**
14
+ * 子节点 Key, 用于读取子节点
15
+ * 默认 children
16
+ */
17
+ children: import("vue-types").VueTypeValidableDef<string> & {
18
+ default: string;
19
+ } & {
20
+ default: string;
21
+ };
22
+ /**
23
+ * 相邻级节点间的水平缩进,单位为像素
24
+ */
25
+ indent: import("vue-types").VueTypeValidableDef<number> & {
26
+ default: number;
27
+ } & {
28
+ default: number;
29
+ };
30
+ /**
31
+ * 设置行高
32
+ */
33
+ lineHeight: import("vue-types").VueTypeValidableDef<number> & {
34
+ default: number;
35
+ } & {
36
+ default: number;
37
+ };
38
+ /**
39
+ * 设置层级连线
40
+ */
41
+ levelLine: import("vue-types").VueTypeDef<any>;
42
+ /**
43
+ * 是否开启虚拟滚动
44
+ * 默认虚拟滚动是开启的,数据量大的情况下有利于性能优化,可以通过设置 virtualRender = false 关闭虚拟滚动
45
+ */
46
+ virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
47
+ default: boolean;
48
+ } & {
49
+ default: boolean;
50
+ };
51
+ };
52
+ export declare type TreePropTypes = Readonly<ExtractPropTypes<typeof treeProps>>;
package/lib/tree/tree.css CHANGED
@@ -5,13 +5,13 @@
5
5
  line-height: var(--lineHeight);
6
6
  cursor: pointer;
7
7
  }
8
- .bk-tree .bk-tree-node.is-open::after {
8
+ .bk-tree .bk-tree-node.is-open:not(.is-virtual-render)::after {
9
9
  position: absolute;
10
- top: calc(var(--lineHeight) / 2);
11
- left: 0;
10
+ top: calc(var(--lineHeight) / 2 + 6px);
11
+ left: 6px;
12
12
  z-index: 1;
13
13
  width: 0;
14
- height: calc(var(--lines) * var(--lineHeight));
14
+ height: calc(var(--lines) * var(--lineHeight) - 6px);
15
15
  pointer-events: none;
16
16
  border-left: var(--level-line);
17
17
  content: '';
@@ -21,15 +21,24 @@
21
21
  }
22
22
  .bk-tree .bk-tree-node:not(.is-root)::before {
23
23
  position: absolute;
24
- top: 50%;
25
- left: calc(0px - var(--indent));
24
+ top: calc(50% + 1px);
25
+ left: calc(0px - var(--indent) + 6px);
26
26
  z-index: 1;
27
- width: var(--indent);
27
+ width: calc(var(--indent) - 6px);
28
28
  height: 0;
29
29
  pointer-events: none;
30
30
  border-bottom: var(--level-line);
31
31
  content: '';
32
32
  }
33
+ .bk-tree .bk-tree-node .node-virtual-line {
34
+ display: inline-block;
35
+ position: absolute;
36
+ left: calc(var(--depth) * var(--indent) * -1 + 6px);
37
+ top: -12px;
38
+ bottom: 50%;
39
+ width: 0;
40
+ border-left: var(--level-line);
41
+ }
33
42
  .bk-tree .bk-tree-node .bk-tree-icon {
34
43
  margin: 0 6px 0 4px;
35
44
  }
@@ -1,4 +1,4 @@
1
- import { TreePropTypes as defineTypes } from './util';
1
+ import { TreePropTypes as defineTypes } from './props';
2
2
  export declare type TreePropTypes = defineTypes;
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  data: import("vue-types").VueTypeDef<any[]> & {
@@ -9,10 +9,7 @@ declare const _default: import("vue").DefineComponent<{
9
9
  default: string;
10
10
  } & {
11
11
  default: string;
12
- }; /**
13
- * 扁平化数据
14
- * schema: 需要展示连线时,用于计算连线高度
15
- */
12
+ };
16
13
  indent: import("vue-types").VueTypeValidableDef<number> & {
17
14
  default: number;
18
15
  } & {
@@ -24,6 +21,11 @@ declare const _default: import("vue").DefineComponent<{
24
21
  default: number;
25
22
  };
26
23
  levelLine: import("vue-types").VueTypeDef<any>;
24
+ virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
25
+ default: boolean;
26
+ } & {
27
+ default: boolean;
28
+ };
27
29
  }, {
28
30
  renderData: import("vue").ComputedRef<any[]>;
29
31
  flatData: {
@@ -34,6 +36,7 @@ declare const _default: import("vue").DefineComponent<{
34
36
  hanldeTreeNodeClick: (item: any) => void;
35
37
  getActionIcon: (item: any) => JSX.Element;
36
38
  getRootIcon: (item: any) => JSX.Element;
39
+ getVirtualLines: (node: any) => JSX.Element[];
37
40
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
38
41
  data?: unknown;
39
42
  label?: unknown;
@@ -41,18 +44,21 @@ declare const _default: import("vue").DefineComponent<{
41
44
  indent?: unknown;
42
45
  lineHeight?: unknown;
43
46
  levelLine?: unknown;
47
+ virtualRender?: unknown;
44
48
  } & {
45
49
  data: any[];
46
50
  children: string;
47
- indent: number;
48
51
  lineHeight: number;
52
+ indent: number;
53
+ virtualRender: boolean;
49
54
  } & {
50
55
  label?: any;
51
56
  levelLine?: any;
52
57
  }> & {}, {
53
58
  data: any[];
54
59
  children: string;
55
- indent: number;
56
60
  lineHeight: number;
61
+ indent: number;
62
+ virtualRender: boolean;
57
63
  }>;
58
64
  export default _default;
@@ -7,16 +7,18 @@
7
7
  cursor: pointer;
8
8
 
9
9
  &.is-open {
10
- &::after {
11
- position: absolute;
12
- top: calc(var(--lineHeight) / 2);
13
- left: 0;
14
- z-index: 1;
15
- width: 0;
16
- height: calc(var(--lines) * var(--lineHeight));
17
- pointer-events: none;
18
- border-left: var(--level-line);
19
- content: '';
10
+ &:not(.is-virtual-render) {
11
+ &::after {
12
+ position: absolute;
13
+ top: calc(var(--lineHeight) / 2 + 6px);
14
+ left: 6px;
15
+ z-index: 1;
16
+ width: 0;
17
+ height: calc(var(--lines) * var(--lineHeight) - 6px);
18
+ pointer-events: none;
19
+ border-left: var(--level-line);
20
+ content: '';
21
+ }
20
22
  }
21
23
  }
22
24
 
@@ -25,27 +27,25 @@
25
27
 
26
28
  &::before {
27
29
  position: absolute;
28
- top: 50%;
29
- left: calc(0px - var(--indent));
30
+ top: calc(50% + 1px);
31
+ left: calc(0px - var(--indent) + 6px);
30
32
  z-index: 1;
31
- width: var(--indent);
33
+ width: calc(var(--indent) - 6px);
32
34
  height: 0;
33
35
  pointer-events: none;
34
36
  border-bottom: var(--level-line);
35
37
  content: '';
36
38
  }
39
+ }
37
40
 
38
- // &::after {
39
- // position: absolute;
40
- // top: -50%;
41
- // bottom: 50%;
42
- // left: calc(0px - var(--indent) * var(--depth));
43
- // z-index: 1;
44
- // width: 0;
45
- // pointer-events: none;
46
- // border-left: var(--level-line);
47
- // content: '';
48
- // }
41
+ .node-virtual-line {
42
+ display: inline-block;
43
+ position: absolute;
44
+ left: calc(var(--depth) * var(--indent) * -1 + 6px);
45
+ top: -12px;
46
+ bottom: 50%;
47
+ width: 0;
48
+ border-left: var(--level-line);
49
49
  }
50
50
 
51
51
  .bk-tree-icon {
@@ -5,13 +5,13 @@
5
5
  line-height: var(--lineHeight);
6
6
  cursor: pointer;
7
7
  }
8
- .bk-tree .bk-tree-node.is-open::after {
8
+ .bk-tree .bk-tree-node.is-open:not(.is-virtual-render)::after {
9
9
  position: absolute;
10
- top: calc(var(--lineHeight) / 2);
11
- left: 0;
10
+ top: calc(var(--lineHeight) / 2 + 6px);
11
+ left: 6px;
12
12
  z-index: 1;
13
13
  width: 0;
14
- height: calc(var(--lines) * var(--lineHeight));
14
+ height: calc(var(--lines) * var(--lineHeight) - 6px);
15
15
  pointer-events: none;
16
16
  border-left: var(--level-line);
17
17
  content: '';
@@ -21,15 +21,24 @@
21
21
  }
22
22
  .bk-tree .bk-tree-node:not(.is-root)::before {
23
23
  position: absolute;
24
- top: 50%;
25
- left: calc(0px - var(--indent));
24
+ top: calc(50% + 1px);
25
+ left: calc(0px - var(--indent) + 6px);
26
26
  z-index: 1;
27
- width: var(--indent);
27
+ width: calc(var(--indent) - 6px);
28
28
  height: 0;
29
29
  pointer-events: none;
30
30
  border-bottom: var(--level-line);
31
31
  content: '';
32
32
  }
33
+ .bk-tree .bk-tree-node .node-virtual-line {
34
+ display: inline-block;
35
+ position: absolute;
36
+ left: calc(var(--depth) * var(--indent) * -1 + 6px);
37
+ top: -12px;
38
+ bottom: 50%;
39
+ width: 0;
40
+ border-left: var(--level-line);
41
+ }
33
42
  .bk-tree .bk-tree-node .bk-tree-icon {
34
43
  margin: 0 6px 0 4px;
35
44
  }