bkui-vue 0.0.1-beta.16 → 0.0.1-beta.17
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/bkui-vue.cjs.js +796 -139
- package/dist/bkui-vue.esm.js +841 -186
- package/dist/bkui-vue.umd.js +796 -139
- package/dist/style.css +287 -13
- package/lib/alert/alert.d.ts +24 -15
- package/lib/alert/alert.variable.css +6 -0
- package/lib/alert/index.d.ts +96 -60
- package/lib/animate-number/animate-number.d.ts +12 -7
- package/lib/animate-number/index.d.ts +48 -28
- package/lib/backtop/backtop.d.ts +27 -13
- package/lib/backtop/backtop.variable.css +6 -0
- package/lib/backtop/index.d.ts +108 -52
- package/lib/badge/badge.d.ts +40 -19
- package/lib/badge/badge.variable.css +6 -0
- package/lib/badge/index.d.ts +144 -76
- package/lib/breadcrumb/breadcrumb-item.d.ts +13 -9
- package/lib/breadcrumb/breadcrumb.d.ts +21 -13
- package/lib/breadcrumb/breadcrumb.variable.css +6 -0
- package/lib/breadcrumb/index.d.ts +97 -61
- package/lib/button/button-group.d.ts +3 -5
- package/lib/button/button.d.ts +27 -22
- package/lib/button/button.variable.css +6 -0
- package/lib/button/index.d.ts +111 -93
- package/lib/card/card.d.ts +30 -15
- package/lib/card/card.variable.css +6 -0
- package/lib/card/index.d.ts +120 -60
- package/lib/checkbox/checkbox-group.d.ts +13 -9
- package/lib/checkbox/checkbox.d.ts +31 -22
- package/lib/checkbox/checkbox.variable.css +6 -0
- package/lib/checkbox/index.d.ts +137 -97
- package/lib/collapse/collapse.d.ts +50 -18
- package/lib/collapse/index.d.ts +108 -72
- package/lib/components.d.ts +2 -0
- package/lib/date-picker/date-picker.d.ts +110 -63
- package/lib/date-picker/date-picker.variable.css +6 -0
- package/lib/date-picker/index.d.ts +437 -249
- package/lib/dialog/dialog.d.ts +44 -23
- package/lib/dialog/index.d.ts +176 -92
- package/lib/divider/divider.d.ts +21 -13
- package/lib/divider/divider.variable.css +6 -0
- package/lib/divider/index.d.ts +84 -52
- package/lib/dropdown/dropdown-item.d.ts +6 -5
- package/lib/dropdown/dropdown-menu.d.ts +6 -5
- package/lib/dropdown/dropdown.d.ts +25 -13
- package/lib/dropdown/dropdown.variable.css +6 -0
- package/lib/dropdown/index.d.ts +94 -62
- package/lib/exception/exception.d.ts +11 -9
- package/lib/exception/exception.variable.css +6 -0
- package/lib/exception/index.d.ts +44 -36
- package/lib/fixed-navbar/fixed-navbar.d.ts +15 -9
- package/lib/fixed-navbar/fixed-navbar.variable.css +6 -0
- package/lib/fixed-navbar/index.d.ts +60 -36
- package/lib/form/form-item.d.ts +46 -27
- package/lib/form/form.d.ts +21 -13
- package/lib/input/index.d.ts +240 -160
- package/lib/input/input.d.ts +60 -40
- package/lib/input/input.variable.css +6 -0
- package/lib/link/index.d.ts +100 -52
- package/lib/link/link.d.ts +25 -13
- package/lib/link/link.variable.css +6 -0
- package/lib/loading/index.d.ts +64 -64
- package/lib/loading/loading.d.ts +16 -16
- package/lib/loading/loading.variable.css +6 -0
- package/lib/menu/index.d.ts +90 -71
- package/lib/menu/menu-group.d.ts +6 -5
- package/lib/menu/menu-item.d.ts +6 -5
- package/lib/menu/menu.d.ts +18 -14
- package/lib/menu/menu.variable.css +6 -0
- package/lib/menu/submenu.d.ts +6 -5
- package/lib/menu/submenu.variable.css +6 -0
- package/lib/message/message.variable.css +6 -0
- package/lib/message/messageConstructor.d.ts +28 -16
- package/lib/modal/index.d.ts +88 -52
- package/lib/modal/modal.d.ts +22 -13
- package/lib/navigation/navigation-title.d.ts +10 -7
- package/lib/navigation/navigation.d.ts +40 -23
- package/lib/navigation/navigation.variable.css +6 -0
- package/lib/notify/notify.variable.css +6 -0
- package/lib/notify/notifyConstructor.d.ts +36 -20
- package/lib/popover/index.d.ts +207 -177
- package/lib/popover/popover.d.ts +52 -30
- package/lib/popover/popover.variable.css +6 -0
- package/lib/process/index.d.ts +120 -60
- package/lib/process/process.css +2 -3
- package/lib/process/process.d.ts +30 -15
- package/lib/process/process.less +2 -3
- package/lib/process/process.variable.css +8 -3
- package/lib/progress/index.d.ts +284 -136
- package/lib/progress/progress.d.ts +71 -34
- package/lib/progress/progress.variable.css +6 -0
- package/lib/radio/index.d.ts +127 -78
- package/lib/radio/radio-button.d.ts +24 -16
- package/lib/radio/radio-group.d.ts +11 -10
- package/lib/radio/radio.d.ts +23 -13
- package/lib/radio/radio.variable.css +6 -0
- package/lib/rate/index.d.ts +52 -40
- package/lib/rate/rate.d.ts +13 -10
- package/lib/rate/star.d.ts +32 -15
- package/lib/select/index.d.ts +396 -327
- package/lib/select/option.d.ts +9 -10
- package/lib/select/optionGroup.d.ts +49 -41
- package/lib/select/select.d.ts +98 -84
- package/lib/select/select.variable.css +6 -0
- package/lib/sideslider/index.d.ts +108 -60
- package/lib/sideslider/sideslider.d.ts +27 -15
- package/lib/sideslider/sideslider.variable.css +6 -0
- package/lib/slider/slider-button.d.ts +10 -7
- package/lib/slider/slider.d.ts +70 -40
- package/lib/slider/slider.variable.css +6 -0
- package/lib/steps/index.d.ts +156 -104
- package/lib/steps/steps.css +3 -0
- package/lib/steps/steps.d.ts +39 -26
- package/lib/steps/steps.less +4 -0
- package/lib/steps/steps.variable.css +9 -0
- package/lib/styles/index.d.ts +1 -0
- package/lib/styles/index.js +1 -1
- package/lib/styles/themes/themes.less +10 -0
- package/lib/switcher/index.d.ts +192 -128
- package/lib/switcher/switcher.d.ts +48 -32
- package/lib/switcher/switcher.variable.css +6 -0
- package/lib/tab/index.d.ts +344 -208
- package/lib/tab/tab-nav.d.ts +74 -38
- package/lib/tab/tab-panel.d.ts +22 -20
- package/lib/tab/tab.d.ts +64 -32
- package/lib/tab/tab.variable.css +6 -0
- package/lib/table/const.d.ts +4 -0
- package/lib/table/index.d.ts +154 -130
- package/lib/table/index.js +1 -1
- package/lib/table/props.d.ts +18 -0
- package/lib/table/render.d.ts +18 -2
- package/lib/table/table.css +47 -10
- package/lib/table/table.d.ts +47 -22
- package/lib/table/table.less +61 -17
- package/lib/table/table.variable.css +55 -12
- package/lib/table/utils.d.ts +26 -1
- package/lib/tag/index.d.ts +10 -286
- package/lib/tag/tag.d.ts +2 -48
- package/lib/tag/tag.variable.css +6 -0
- package/lib/timeline/index.d.ts +129 -0
- package/lib/timeline/index.js +1 -0
- package/lib/timeline/timeline.css +235 -0
- package/lib/timeline/timeline.d.ts +81 -0
- package/lib/timeline/timeline.less +239 -0
- package/lib/timeline/timeline.variable.css +327 -0
- package/lib/tree/index.d.ts +140 -75
- package/lib/tree/index.js +1 -1
- package/lib/tree/props.d.ts +19 -1
- package/lib/tree/tree.d.ts +42 -20
- package/lib/virtual-render/index.d.ts +406 -260
- package/lib/virtual-render/index.js +1 -1
- package/lib/virtual-render/props.d.ts +1 -0
- package/lib/virtual-render/virtual-render.d.ts +104 -43
- package/package.json +1 -1
@@ -0,0 +1,327 @@
|
|
1
|
+
:root {
|
2
|
+
--bk-prefix: bk;
|
3
|
+
--primary-color: #3a84ff;
|
4
|
+
--success-color: #2dcb56;
|
5
|
+
--warning-color: #ff9c01;
|
6
|
+
--danger-color: #ea3636;
|
7
|
+
--default-color: #63656e;
|
8
|
+
--gray-color: #979ba5;
|
9
|
+
--light-gray: #c4c6cc;
|
10
|
+
--white-color: white;
|
11
|
+
--disable-color: #dcdee5;
|
12
|
+
--font-size-base: 12px;
|
13
|
+
--font-size-medium: 14px;
|
14
|
+
--font-size-large: 16px;
|
15
|
+
--line-height-base: 16px;
|
16
|
+
--line-height-medium: 16px;
|
17
|
+
--line-height-large: 18px;
|
18
|
+
--component-size-small: 26px;
|
19
|
+
--component-size-base: 32px;
|
20
|
+
--component-size-large: 38px;
|
21
|
+
--border-width-base: 1px;
|
22
|
+
--border-style-base: solid;
|
23
|
+
--border-radius-base: 2px;
|
24
|
+
--input-disabled-bg: #fafbfd;
|
25
|
+
--input-disabled-border: var(--disable-color);
|
26
|
+
--input-height-base: var(--component-size-base);
|
27
|
+
--input-color: var(--default-color);
|
28
|
+
--input-bg: white;
|
29
|
+
--input-border-color: var(--light-gray);
|
30
|
+
--input-broder-radius: 3px;
|
31
|
+
--input-shadow-color: #a3c5fd;
|
32
|
+
--input-horizontal-padding: 10px;
|
33
|
+
--input-block-color: #f4f6fa;
|
34
|
+
--input-icon-size: var(--font-size-large);
|
35
|
+
--input-maxlength-color: #979ba5;
|
36
|
+
--button-primary-hover-color: #5594fa;
|
37
|
+
--button-danger-hover-color: #ff5656;
|
38
|
+
--button-success-hover-color: #45e35f;
|
39
|
+
--button-warning-hover-color: #ffb848;
|
40
|
+
--button-default-hover-border-color: #979ba5;
|
41
|
+
--button-primary-active-color: #2c77f4;
|
42
|
+
--button-danger-active-color: #db2626;
|
43
|
+
--button-success-active-color: #1ab943;
|
44
|
+
--button-warning-active-color: #eb9000;
|
45
|
+
--fixed-navbar-background: #fff;
|
46
|
+
--fixed-navbar-boxshadow-color: rgba(0, 0, 0, 0.1);
|
47
|
+
--switch-default-color: #fff;
|
48
|
+
--switch-grey-color: #c4c6cc;
|
49
|
+
--breadcrumb-black-color: #979ba5;
|
50
|
+
--breadcrumb-primary-hover-color: #0082ff;
|
51
|
+
--breadcrumb-fn-main-color: #63656e;
|
52
|
+
--link-default-hover-color: #979ba5;
|
53
|
+
--link-primary-hover-color: #699df4;
|
54
|
+
--link-success-hover-color: #45e35f;
|
55
|
+
--link-warning-hover-color: #ffb848;
|
56
|
+
--link-danger-hover-color: #ff5656;
|
57
|
+
--link-default-disabled-color: #dcdee5;
|
58
|
+
--link-primary-disabled-color: #a3c5fd;
|
59
|
+
--link-success-disabled-color: #94f5a4;
|
60
|
+
--link-warning-disabled-color: #ffd695;
|
61
|
+
--link-danger-disabled-color: #fd9c9c;
|
62
|
+
--message-color: var(--default-color);
|
63
|
+
--message-primary-bg-color: #f0f8ff;
|
64
|
+
--message-primary-border-color: #e1ecff;
|
65
|
+
--message-warning-bg-color: #fff4e2;
|
66
|
+
--message-warning-border-color: #ffe8c3;
|
67
|
+
--message-success-bg-color: #f2fff4;
|
68
|
+
--message-success-border-color: #dcffe2;
|
69
|
+
--message-danger-bg-color: #ffeded;
|
70
|
+
--message-danger-border-color: #ffdddd;
|
71
|
+
--slider-default-bg: #dcdee5;
|
72
|
+
--slider-disable-bar-bg: #979ba5;
|
73
|
+
--menu-bg-color: #182132;
|
74
|
+
--submenu-bg-color: #151d2c;
|
75
|
+
--menu-active-bg-color: linear-gradient(90deg, #3f87ff 0%, #3a84ff 100%);
|
76
|
+
--menu-color: #96a2b9;
|
77
|
+
--menu-group-color: var(--default-color);
|
78
|
+
--menu-width: 260px;
|
79
|
+
--menu-collapse-width: 60px;
|
80
|
+
--menu-active-color: white;
|
81
|
+
--nav-header-bg-color: #182132;
|
82
|
+
--nav-bg-color: #182132;
|
83
|
+
--date-picker-disabled-bg: #fafbfd;
|
84
|
+
--date-picker-dropdown-mb: 4px;
|
85
|
+
--date-picker-dropdown-bg: #fff;
|
86
|
+
--table-bg-color: var(--white-color);
|
87
|
+
--table-border-color: #dcdee5;
|
88
|
+
--table-head-bg-color: #fafbfd;
|
89
|
+
--table-head-font-color: #313238;
|
90
|
+
--table-body-font-color: #575961;
|
91
|
+
--table-row-hover-bg-color: #f5f7fa;
|
92
|
+
}
|
93
|
+
* {
|
94
|
+
box-sizing: border-box;
|
95
|
+
}
|
96
|
+
.bk-timeline {
|
97
|
+
padding: 0;
|
98
|
+
margin: 16px 0 0;
|
99
|
+
font-style: normal;
|
100
|
+
font-weight: 400;
|
101
|
+
line-height: normal;
|
102
|
+
text-align: left;
|
103
|
+
list-style: none;
|
104
|
+
}
|
105
|
+
.bk-timeline .bk-timeline-dot {
|
106
|
+
position: relative;
|
107
|
+
padding-bottom: 24px;
|
108
|
+
padding-left: 16px;
|
109
|
+
/* spacing 1px */
|
110
|
+
margin-top: 13px;
|
111
|
+
font-size: 0;
|
112
|
+
border-left: 1px solid #d8d8d8;
|
113
|
+
}
|
114
|
+
.bk-timeline .bk-timeline-dot::before {
|
115
|
+
position: absolute;
|
116
|
+
top: calc((11px + 1px) * -1);
|
117
|
+
left: -6px;
|
118
|
+
display: inline-block;
|
119
|
+
width: 11px;
|
120
|
+
height: 11px;
|
121
|
+
background: #fff;
|
122
|
+
border: 2px solid #d8d8d8;
|
123
|
+
border-radius: 50%;
|
124
|
+
content: '';
|
125
|
+
box-sizing: border-box;
|
126
|
+
}
|
127
|
+
.bk-timeline .bk-timeline-dot:last-child {
|
128
|
+
padding-bottom: 0;
|
129
|
+
/* 保留border使用间距保持一致 */
|
130
|
+
border-left: 1px solid transparent;
|
131
|
+
}
|
132
|
+
.bk-timeline .bk-timeline-dot .bk-timeline-title {
|
133
|
+
display: inline-block;
|
134
|
+
padding-bottom: 10px;
|
135
|
+
margin-top: -3px;
|
136
|
+
font-size: 14px;
|
137
|
+
color: #63656e;
|
138
|
+
cursor: pointer;
|
139
|
+
}
|
140
|
+
.bk-timeline .bk-timeline-dot .bk-timeline-content {
|
141
|
+
max-width: 300px;
|
142
|
+
font-size: 14px;
|
143
|
+
color: #666;
|
144
|
+
word-break: break-all;
|
145
|
+
}
|
146
|
+
.bk-timeline .bk-timeline-dot .bk-timeline-icon {
|
147
|
+
position: absolute;
|
148
|
+
top: calc((15px + 1px) * -1);
|
149
|
+
left: -8px;
|
150
|
+
display: inline-block;
|
151
|
+
width: 15px;
|
152
|
+
height: 15px;
|
153
|
+
background: #fff;
|
154
|
+
border: 2px solid #d8d8d8;
|
155
|
+
border-radius: 50%;
|
156
|
+
box-sizing: border-box;
|
157
|
+
}
|
158
|
+
.bk-timeline .bk-timeline-dot .bk-timeline-icon .bk-timeline-icon-inner {
|
159
|
+
display: inline-block;
|
160
|
+
transform: scale(1) translate(-0.5px, -4px);
|
161
|
+
}
|
162
|
+
.bk-timeline .bk-timeline-dot .bk-timeline-icon .bk-timeline-icon-inner > :first-child {
|
163
|
+
font-size: 12px;
|
164
|
+
}
|
165
|
+
.bk-timeline .bk-timeline-dot .bk-timeline-section {
|
166
|
+
position: relative;
|
167
|
+
top: calc((11px + 2px) * -1);
|
168
|
+
}
|
169
|
+
.bk-timeline .bk-timeline-dot.bk-timeline-large {
|
170
|
+
margin-top: calc(15px + 2px);
|
171
|
+
}
|
172
|
+
.bk-timeline .bk-timeline-dot.bk-timeline-large::before {
|
173
|
+
top: calc((15px + 1px) * -1);
|
174
|
+
left: -8px;
|
175
|
+
width: 15px;
|
176
|
+
height: 15px;
|
177
|
+
}
|
178
|
+
.bk-timeline .bk-timeline-dot.bk-timeline-large > .bk-timeline-section {
|
179
|
+
top: calc((15px + 1px) * -1);
|
180
|
+
}
|
181
|
+
.bk-timeline .bk-timeline-dot.bk-timeline-item-custom-icon {
|
182
|
+
margin-top: calc(15px + 2px);
|
183
|
+
}
|
184
|
+
.bk-timeline .bk-timeline-dot.bk-timeline-item-custom-icon::before {
|
185
|
+
display: none;
|
186
|
+
}
|
187
|
+
.bk-timeline .bk-timeline-dot.bk-timeline-item-custom-icon > .bk-timeline-section {
|
188
|
+
top: calc((15px + 1px) * -1);
|
189
|
+
}
|
190
|
+
.bk-timeline .bk-timeline-dot:first-child {
|
191
|
+
margin-top: 0;
|
192
|
+
}
|
193
|
+
.bk-timeline .bk-timeline-primary {
|
194
|
+
border-left: 1px solid var(--primary-color);
|
195
|
+
}
|
196
|
+
.bk-timeline .bk-timeline-primary::before,
|
197
|
+
.bk-timeline .bk-timeline-primary .bk-timeline-icon {
|
198
|
+
color: var(--primary-color);
|
199
|
+
border: 2px solid var(--primary-color);
|
200
|
+
}
|
201
|
+
.bk-timeline .bk-timeline-primary.bk-timeline-filled::before,
|
202
|
+
.bk-timeline .bk-timeline-primary.bk-timeline-filled .bk-timeline-icon {
|
203
|
+
background: var(--primary-color);
|
204
|
+
}
|
205
|
+
.bk-timeline .bk-timeline-warning {
|
206
|
+
border-left: 1px solid var(--warning-color);
|
207
|
+
}
|
208
|
+
.bk-timeline .bk-timeline-warning::before,
|
209
|
+
.bk-timeline .bk-timeline-warning .bk-timeline-icon {
|
210
|
+
color: var(--warning-color);
|
211
|
+
border: 2px solid var(--warning-color);
|
212
|
+
}
|
213
|
+
.bk-timeline .bk-timeline-warning.bk-timeline-filled::before,
|
214
|
+
.bk-timeline .bk-timeline-warning.bk-timeline-filled .bk-timeline-icon {
|
215
|
+
background: var(--warning-color);
|
216
|
+
}
|
217
|
+
.bk-timeline .bk-timeline-success {
|
218
|
+
border-left: 1px solid var(--success-color);
|
219
|
+
}
|
220
|
+
.bk-timeline .bk-timeline-success::before,
|
221
|
+
.bk-timeline .bk-timeline-success .bk-timeline-icon {
|
222
|
+
color: var(--success-color);
|
223
|
+
border: 2px solid var(--success-color);
|
224
|
+
}
|
225
|
+
.bk-timeline .bk-timeline-success.bk-timeline-filled::before,
|
226
|
+
.bk-timeline .bk-timeline-success.bk-timeline-filled .bk-timeline-icon {
|
227
|
+
background: var(--success-color);
|
228
|
+
}
|
229
|
+
.bk-timeline .bk-timeline-danger {
|
230
|
+
border-left: 1px solid var(--danger-color);
|
231
|
+
}
|
232
|
+
.bk-timeline .bk-timeline-danger::before,
|
233
|
+
.bk-timeline .bk-timeline-danger .bk-timeline-icon {
|
234
|
+
color: var(--danger-color);
|
235
|
+
border: 2px solid var(--danger-color);
|
236
|
+
}
|
237
|
+
.bk-timeline .bk-timeline-danger.bk-timeline-filled::before,
|
238
|
+
.bk-timeline .bk-timeline-danger.bk-timeline-filled .bk-timeline-icon {
|
239
|
+
background: var(--danger-color);
|
240
|
+
}
|
241
|
+
.bk-timeline .bk-timeline-blue::before,
|
242
|
+
.bk-timeline .bk-timeline-blue .bk-timeline-icon {
|
243
|
+
color: #3a84ff;
|
244
|
+
border: 2px solid #3a84ff;
|
245
|
+
}
|
246
|
+
.bk-timeline .bk-timeline-blue.bk-timeline-filled::before,
|
247
|
+
.bk-timeline .bk-timeline-blue.bk-timeline-filled .bk-timeline-icon {
|
248
|
+
background: #3a84ff;
|
249
|
+
}
|
250
|
+
.bk-timeline .bk-timeline-red::before,
|
251
|
+
.bk-timeline .bk-timeline-red .bk-timeline-icon {
|
252
|
+
color: #ea3636;
|
253
|
+
border: 2px solid #ea3636;
|
254
|
+
}
|
255
|
+
.bk-timeline .bk-timeline-red.bk-timeline-filled::before,
|
256
|
+
.bk-timeline .bk-timeline-red.bk-timeline-filled .bk-timeline-icon {
|
257
|
+
background: #ea3636;
|
258
|
+
}
|
259
|
+
.bk-timeline .bk-timeline-green::before,
|
260
|
+
.bk-timeline .bk-timeline-green .bk-timeline-icon {
|
261
|
+
color: #2dcb56;
|
262
|
+
border: 2px solid #2dcb56;
|
263
|
+
}
|
264
|
+
.bk-timeline .bk-timeline-green.bk-timeline-filled::before,
|
265
|
+
.bk-timeline .bk-timeline-green.bk-timeline-filled .bk-timeline-icon {
|
266
|
+
background: #2dcb56;
|
267
|
+
}
|
268
|
+
.bk-timeline .bk-timeline-yellow::before,
|
269
|
+
.bk-timeline .bk-timeline-yellow .bk-timeline-icon {
|
270
|
+
color: #ff9c01;
|
271
|
+
border: 2px solid #ff9c01;
|
272
|
+
}
|
273
|
+
.bk-timeline .bk-timeline-yellow.bk-timeline-filled::before,
|
274
|
+
.bk-timeline .bk-timeline-yellow.bk-timeline-filled .bk-timeline-icon {
|
275
|
+
background: #ff9c01;
|
276
|
+
}
|
277
|
+
.bk-timeline .bk-timeline-gray::before,
|
278
|
+
.bk-timeline .bk-timeline-gray .bk-timeline-icon {
|
279
|
+
color: #63656e;
|
280
|
+
border: 2px solid #63656e;
|
281
|
+
}
|
282
|
+
.bk-timeline .bk-timeline-gray.bk-timeline-filled::before,
|
283
|
+
.bk-timeline .bk-timeline-gray.bk-timeline-filled .bk-timeline-icon {
|
284
|
+
background: #63656e;
|
285
|
+
}
|
286
|
+
.bk-timeline-dashed .bk-step .bk-step-title::after,
|
287
|
+
.bk-timeline-dashed .bk-step .bk-step-indicator::after {
|
288
|
+
background-image: linear-gradient(to right, var(--light-gray) 50%, transparent 0%);
|
289
|
+
background-position: bottom;
|
290
|
+
background-repeat: repeat-x;
|
291
|
+
background-size: 6px 1px;
|
292
|
+
}
|
293
|
+
.bk-timeline-solid .bk-step .bk-step-title::after,
|
294
|
+
.bk-timeline-solid .bk-step .bk-step-indicator::after {
|
295
|
+
background-color: var(--light-gray);
|
296
|
+
}
|
297
|
+
.bk-timeline-vertical {
|
298
|
+
height: 100%;
|
299
|
+
flex-direction: column;
|
300
|
+
}
|
301
|
+
.bk-timeline-vertical .bk-step {
|
302
|
+
margin-right: 0;
|
303
|
+
margin-bottom: 8px;
|
304
|
+
}
|
305
|
+
.bk-timeline-vertical .bk-step .bk-step-title::after,
|
306
|
+
.bk-timeline-vertical .bk-step .bk-step-indicator::after {
|
307
|
+
display: none;
|
308
|
+
}
|
309
|
+
.bk-timeline-vertical .bk-step::after {
|
310
|
+
position: absolute;
|
311
|
+
top: 32px;
|
312
|
+
left: 12px;
|
313
|
+
width: 1px;
|
314
|
+
height: 100%;
|
315
|
+
background-image: linear-gradient(var(--light-gray) 50%, transparent 0%);
|
316
|
+
background-position: right;
|
317
|
+
background-repeat: repeat-y;
|
318
|
+
background-size: 1px 6px;
|
319
|
+
content: '';
|
320
|
+
}
|
321
|
+
.bk-timeline-vertical .bk-step .bk-step-title {
|
322
|
+
display: flex;
|
323
|
+
height: 100%;
|
324
|
+
margin-top: 0;
|
325
|
+
text-align: left;
|
326
|
+
align-items: center;
|
327
|
+
}
|
package/lib/tree/index.d.ts
CHANGED
@@ -4,28 +4,44 @@ declare const BkTree: {
|
|
4
4
|
$data: {};
|
5
5
|
$props: Partial<{
|
6
6
|
data: any[];
|
7
|
+
prefixIcon: any;
|
7
8
|
children: string;
|
8
9
|
lineHeight: number;
|
9
10
|
indent: number;
|
11
|
+
levelLine: any;
|
10
12
|
virtualRender: boolean;
|
11
|
-
}> & Omit<Readonly<{
|
12
|
-
data
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
13
|
+
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
14
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
15
|
+
default: () => any[];
|
16
|
+
};
|
17
|
+
label: import("vue-types").VueTypeDef<any>;
|
18
|
+
children: import("vue-types").VueTypeValidableDef<string> & {
|
19
|
+
default: string;
|
20
|
+
} & {
|
21
|
+
default: string;
|
22
|
+
};
|
23
|
+
indent: import("vue-types").VueTypeValidableDef<number> & {
|
24
|
+
default: number;
|
25
|
+
} & {
|
26
|
+
default: number;
|
27
|
+
};
|
28
|
+
lineHeight: import("vue-types").VueTypeValidableDef<number> & {
|
29
|
+
default: number;
|
30
|
+
} & {
|
31
|
+
default: number;
|
32
|
+
};
|
33
|
+
levelLine: import("vue-types").VueTypeDef<any> & {
|
34
|
+
default: any;
|
35
|
+
};
|
36
|
+
virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
|
37
|
+
default: boolean;
|
38
|
+
} & {
|
39
|
+
default: boolean;
|
40
|
+
};
|
41
|
+
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
42
|
+
default: any;
|
43
|
+
};
|
44
|
+
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "data" | "prefixIcon" | "children" | "lineHeight" | "indent" | "levelLine" | "virtualRender">;
|
29
45
|
$attrs: {
|
30
46
|
[x: string]: unknown;
|
31
47
|
};
|
@@ -39,24 +55,38 @@ declare const BkTree: {
|
|
39
55
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
40
56
|
$emit: (event: string, ...args: any[]) => void;
|
41
57
|
$el: any;
|
42
|
-
$options: import("vue").ComponentOptionsBase<Readonly<{
|
43
|
-
data
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
58
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
59
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
60
|
+
default: () => any[];
|
61
|
+
};
|
62
|
+
label: import("vue-types").VueTypeDef<any>;
|
63
|
+
children: import("vue-types").VueTypeValidableDef<string> & {
|
64
|
+
default: string;
|
65
|
+
} & {
|
66
|
+
default: string;
|
67
|
+
};
|
68
|
+
indent: import("vue-types").VueTypeValidableDef<number> & {
|
69
|
+
default: number;
|
70
|
+
} & {
|
71
|
+
default: number;
|
72
|
+
};
|
73
|
+
lineHeight: import("vue-types").VueTypeValidableDef<number> & {
|
74
|
+
default: number;
|
75
|
+
} & {
|
76
|
+
default: number;
|
77
|
+
};
|
78
|
+
levelLine: import("vue-types").VueTypeDef<any> & {
|
79
|
+
default: any;
|
80
|
+
};
|
81
|
+
virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
|
82
|
+
default: boolean;
|
83
|
+
} & {
|
84
|
+
default: boolean;
|
85
|
+
};
|
86
|
+
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
87
|
+
default: any;
|
88
|
+
};
|
89
|
+
}>>, {
|
60
90
|
renderData: import("vue").ComputedRef<any[]>;
|
61
91
|
flatData: {
|
62
92
|
data: any[];
|
@@ -64,14 +94,17 @@ declare const BkTree: {
|
|
64
94
|
levelLineSchema: {};
|
65
95
|
};
|
66
96
|
hanldeTreeNodeClick: (item: any) => void;
|
67
|
-
getActionIcon: (item: any) => JSX.Element;
|
97
|
+
getActionIcon: (item: any) => string | JSX.Element;
|
68
98
|
getRootIcon: (item: any) => JSX.Element;
|
69
99
|
getVirtualLines: (node: any) => JSX.Element[];
|
100
|
+
getNodePrefixIcon: (item: any) => string | JSX.Element;
|
70
101
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
71
102
|
data: any[];
|
103
|
+
prefixIcon: any;
|
72
104
|
children: string;
|
73
105
|
lineHeight: number;
|
74
106
|
indent: number;
|
107
|
+
levelLine: any;
|
75
108
|
virtualRender: boolean;
|
76
109
|
}> & {
|
77
110
|
beforeCreate?: (() => void) | (() => void)[];
|
@@ -93,24 +126,38 @@ declare const BkTree: {
|
|
93
126
|
$forceUpdate: () => void;
|
94
127
|
$nextTick: typeof import("vue").nextTick;
|
95
128
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
|
96
|
-
} & Readonly<{
|
97
|
-
data
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
129
|
+
} & Readonly<import("vue").ExtractPropTypes<{
|
130
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
131
|
+
default: () => any[];
|
132
|
+
};
|
133
|
+
label: import("vue-types").VueTypeDef<any>;
|
134
|
+
children: import("vue-types").VueTypeValidableDef<string> & {
|
135
|
+
default: string;
|
136
|
+
} & {
|
137
|
+
default: string;
|
138
|
+
};
|
139
|
+
indent: import("vue-types").VueTypeValidableDef<number> & {
|
140
|
+
default: number;
|
141
|
+
} & {
|
142
|
+
default: number;
|
143
|
+
};
|
144
|
+
lineHeight: import("vue-types").VueTypeValidableDef<number> & {
|
145
|
+
default: number;
|
146
|
+
} & {
|
147
|
+
default: number;
|
148
|
+
};
|
149
|
+
levelLine: import("vue-types").VueTypeDef<any> & {
|
150
|
+
default: any;
|
151
|
+
};
|
152
|
+
virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
|
153
|
+
default: boolean;
|
154
|
+
} & {
|
155
|
+
default: boolean;
|
156
|
+
};
|
157
|
+
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
158
|
+
default: any;
|
159
|
+
};
|
160
|
+
}>> & import("vue").ShallowUnwrapRef<{
|
114
161
|
renderData: import("vue").ComputedRef<any[]>;
|
115
162
|
flatData: {
|
116
163
|
data: any[];
|
@@ -118,31 +165,46 @@ declare const BkTree: {
|
|
118
165
|
levelLineSchema: {};
|
119
166
|
};
|
120
167
|
hanldeTreeNodeClick: (item: any) => void;
|
121
|
-
getActionIcon: (item: any) => JSX.Element;
|
168
|
+
getActionIcon: (item: any) => string | JSX.Element;
|
122
169
|
getRootIcon: (item: any) => JSX.Element;
|
123
170
|
getVirtualLines: (node: any) => JSX.Element[];
|
171
|
+
getNodePrefixIcon: (item: any) => string | JSX.Element;
|
124
172
|
}> & {} & {} & import("vue").ComponentCustomProperties;
|
125
173
|
__isFragment?: never;
|
126
174
|
__isTeleport?: never;
|
127
175
|
__isSuspense?: never;
|
128
|
-
} & import("vue").ComponentOptionsBase<Readonly<{
|
129
|
-
data
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
}
|
143
|
-
|
144
|
-
|
145
|
-
}
|
176
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
177
|
+
data: import("vue-types").VueTypeDef<any[]> & {
|
178
|
+
default: () => any[];
|
179
|
+
};
|
180
|
+
label: import("vue-types").VueTypeDef<any>;
|
181
|
+
children: import("vue-types").VueTypeValidableDef<string> & {
|
182
|
+
default: string;
|
183
|
+
} & {
|
184
|
+
default: string;
|
185
|
+
};
|
186
|
+
indent: import("vue-types").VueTypeValidableDef<number> & {
|
187
|
+
default: number;
|
188
|
+
} & {
|
189
|
+
default: number;
|
190
|
+
};
|
191
|
+
lineHeight: import("vue-types").VueTypeValidableDef<number> & {
|
192
|
+
default: number;
|
193
|
+
} & {
|
194
|
+
default: number;
|
195
|
+
};
|
196
|
+
levelLine: import("vue-types").VueTypeDef<any> & {
|
197
|
+
default: any;
|
198
|
+
};
|
199
|
+
virtualRender: import("vue-types").VueTypeValidableDef<boolean> & {
|
200
|
+
default: boolean;
|
201
|
+
} & {
|
202
|
+
default: boolean;
|
203
|
+
};
|
204
|
+
prefixIcon: import("vue-types").VueTypeDef<any> & {
|
205
|
+
default: any;
|
206
|
+
};
|
207
|
+
}>>, {
|
146
208
|
renderData: import("vue").ComputedRef<any[]>;
|
147
209
|
flatData: {
|
148
210
|
data: any[];
|
@@ -150,14 +212,17 @@ declare const BkTree: {
|
|
150
212
|
levelLineSchema: {};
|
151
213
|
};
|
152
214
|
hanldeTreeNodeClick: (item: any) => void;
|
153
|
-
getActionIcon: (item: any) => JSX.Element;
|
215
|
+
getActionIcon: (item: any) => string | JSX.Element;
|
154
216
|
getRootIcon: (item: any) => JSX.Element;
|
155
217
|
getVirtualLines: (node: any) => JSX.Element[];
|
218
|
+
getNodePrefixIcon: (item: any) => string | JSX.Element;
|
156
219
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
157
220
|
data: any[];
|
221
|
+
prefixIcon: any;
|
158
222
|
children: string;
|
159
223
|
lineHeight: number;
|
160
224
|
indent: number;
|
225
|
+
levelLine: any;
|
161
226
|
virtualRender: boolean;
|
162
227
|
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin;
|
163
228
|
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("crypto"),require("../icon/"),require("../shared"),require("../virtual-render")):"function"==typeof define&&define.amd?define(["exports","vue","crypto","../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 g={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}(g);var x={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}(x),function(e){var t=h.exports,n=y.exports,r=g.exports,o=x.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 b=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,C=0,k=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:k+1,c=u-C+(s-k)/1e4;if(c<0&&void 0===e.clockseq&&(l=l+1&16383),(c<0||u>C)&&void 0===e.nsecs&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");C=u,k=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(b(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})}));
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("crypto"),require("../icon/"),require("../shared"),require("../virtual-render")):"function"==typeof define&&define.amd?define(["exports","vue","crypto","../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 x={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}(x);var b={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}(b),function(e){var t=h.exports,n=y.exports,r=x.exports,o=b.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 g=s(v.exports),m=a.default,O=function(){return m.randomBytes(16)},j=[],T=0;T<256;++T)j[T]=(T+256).toString(16).substr(1);var N,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,I=w,C=0,L=0;var k=function(e,t,n){var r=t&&n||0,o=t||[],i=(e=e||{}).node||N,l=void 0!==e.clockseq?e.clockseq:P;if(null==i||null==l){var a=S();null==i&&(i=N=[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:L+1,c=u-C+(s-L)/1e4;if(c<0&&void 0===e.clockseq&&(l=l+1&16383),(c<0||u>C)&&void 0===e.nsecs&&(s=0),s>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");C=u,L=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||I(o)},R=O,A=w;var M=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||R)();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||A(o)},V=k,q=M,D=q;D.v1=V,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(g(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")]).def(!1),virtualRender:o.PropTypes.bool.def(!1),prefixIcon:o.PropTypes.oneOfType([o.PropTypes.func.def((function(){})),o.PropTypes.bool.def(!1)]).def(!0)},Q=t.defineComponent({name:"BkTree",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],c()}),{deep:!0}),t.watch((function(){return[e.levelLine]}),(function(){c()}));var i=t.computed((function(){return o.data.filter((function(e){return v(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){return a(e)?t.createVNode(r.FolderShapeOpen,{class:"bk-tree-icon"},null):t.createVNode(r.Folder,{class:"bk-tree-icon"},null)},s=function(e){if("string"==typeof e)return e;if("object"===f(e)&&null!==e){var n=e.node,r=e.className,o=e.text,i=e.style;return t.h(n,{class:r,style:i},o)}return null},c=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=d(r),u=!l.value.includes("".concat(r.__path,"-0"));n(r.__path,null,u),n(a,r.__path);var s=t[a],c=t[r.__path],f=c.childNodeCount,v=void 0===f?0:f;c.childNodeCount=v+1,c.isLastNode=s.lastNode===r.__path,s.childNodeCount+=c.childNodeCount}o.levelLineSchema=t})):o.levelLineSchema={}},d=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)},v=function(e){return e.__isRoot||a(e)||a(d(e))};return c(),{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})})),c()}},getActionIcon:function(n){var o=null;return"function"==typeof e.prefixIcon&&"default"!==(o=e.prefixIcon(n.__isRoot,n.__hasChild,a(n),"action",n))?s(o):("default"===o||"boolean"==typeof e.prefixIcon&&e.prefixIcon)&&n.__hasChild?a(n)?t.createVNode(r.DownShape,null,null):t.createVNode(r.RightShape,null,null):null},getRootIcon:u,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("-");return Object.prototype.hasOwnProperty.call(o.schema,l)}(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}))},getNodePrefixIcon:function(n){var o=null;return"function"==typeof e.prefixIcon&&"default"!==(o=e.prefixIcon(n.__isRoot,n.__hasChild,a(n),"node_type",n))?s(o):"default"===o||"boolean"==typeof e.prefixIcon&&e.prefixIcon?n.__isRoot?u(n):t.createVNode(r.TextFile,{class:"bk-tree-icon"},null):null}}},render:function(){var e=this,n=this.$props,r=function(r){return t.createVNode("div",{class:J(r,e.flatData.schema,n),style:G(r,n,e.flatData.levelLineSchema),onClick:function(){return e.hanldeTreeNodeClick(r)}},[[e.getActionIcon(r),e.getNodePrefixIcon(r)],t.createVNode("span",null,[W(r,n)]),e.getVirtualLines(r)])};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(r)}})}}),X=o.withInstall(Q);e.default=X,Object.defineProperty(e,"__esModule",{value:!0})}));
|