bkui-vue 0.0.1-beta.13 → 0.0.1-beta.16

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 (180) hide show
  1. package/README.md +25 -17
  2. package/README_EN.md +89 -0
  3. package/dist/bkui-vue.cjs.js +1897 -495
  4. package/dist/bkui-vue.esm.js +1893 -497
  5. package/dist/bkui-vue.umd.js +1897 -495
  6. package/dist/style.css +454 -177
  7. package/lib/alert/index.js +1 -1
  8. package/lib/animate-number/index.js +1 -1
  9. package/lib/backtop/index.js +1 -1
  10. package/lib/badge/index.js +1 -1
  11. package/lib/breadcrumb/breadcrumb.css +10 -1
  12. package/lib/breadcrumb/breadcrumb.d.ts +20 -0
  13. package/lib/breadcrumb/breadcrumb.less +13 -2
  14. package/lib/breadcrumb/breadcrumb.variable.css +10 -1
  15. package/lib/breadcrumb/index.d.ts +38 -2
  16. package/lib/breadcrumb/index.js +1 -1
  17. package/lib/button/index.js +1 -1
  18. package/lib/card/index.js +1 -1
  19. package/lib/checkbox/index.d.ts +1 -1
  20. package/lib/checkbox/index.js +1 -1
  21. package/lib/checkbox/type.d.ts +1 -1
  22. package/lib/collapse/index.js +1 -1
  23. package/lib/components.d.ts +2 -0
  24. package/lib/date-picker/index.js +1 -1
  25. package/lib/dialog/dialog.d.ts +3 -3
  26. package/lib/dialog/index.d.ts +7 -7
  27. package/lib/dialog/index.js +1 -1
  28. package/lib/directives/index.js +1 -1
  29. package/lib/divider/index.js +1 -1
  30. package/lib/exception/index.js +1 -1
  31. package/lib/fixed-navbar/index.js +1 -1
  32. package/lib/form/index.js +1 -1
  33. package/lib/icon/angle-double-left.js +15 -0
  34. package/lib/icon/angle-double-right.js +15 -0
  35. package/lib/icon/angle-down-fill.d.ts +4 -0
  36. package/lib/icon/angle-down-fill.js +15 -0
  37. package/lib/icon/angle-down-line.js +15 -0
  38. package/lib/icon/angle-down.js +15 -0
  39. package/lib/icon/angle-left.js +15 -0
  40. package/lib/icon/angle-right.js +15 -0
  41. package/lib/icon/angle-up-fill.d.ts +4 -0
  42. package/lib/icon/angle-up-fill.js +15 -0
  43. package/lib/icon/angle-up.js +15 -0
  44. package/lib/icon/arrows-left.d.ts +4 -0
  45. package/lib/icon/arrows-left.js +15 -0
  46. package/lib/icon/circle.js +15 -0
  47. package/lib/icon/close.js +15 -0
  48. package/lib/icon/code.js +15 -0
  49. package/lib/icon/cog-shape.js +15 -0
  50. package/lib/icon/collapse-left.js +15 -0
  51. package/lib/icon/copy.js +15 -0
  52. package/lib/icon/done.js +15 -0
  53. package/lib/icon/down-shape.js +15 -0
  54. package/lib/icon/down-small.js +15 -0
  55. package/lib/icon/error.js +15 -0
  56. package/lib/icon/eye.js +15 -0
  57. package/lib/icon/folder-open.js +15 -0
  58. package/lib/icon/folder-shape-open.js +15 -0
  59. package/lib/icon/folder-shape.js +15 -0
  60. package/lib/icon/folder.js +15 -0
  61. package/lib/icon/help-document-fill.js +15 -0
  62. package/lib/icon/help-fill.js +15 -0
  63. package/lib/icon/help.js +15 -0
  64. package/lib/icon/icon.js +15 -0
  65. package/lib/icon/index.d.ts +7 -3
  66. package/lib/icon/index.js +1 -1
  67. package/lib/icon/info-line.js +15 -0
  68. package/lib/icon/info.js +15 -0
  69. package/lib/icon/play-shape.js +15 -0
  70. package/lib/icon/plus.js +15 -0
  71. package/lib/icon/right-shape.js +15 -0
  72. package/lib/icon/search.js +15 -0
  73. package/lib/icon/share.js +15 -0
  74. package/lib/icon/spinner.d.ts +4 -0
  75. package/lib/icon/spinner.js +15 -0
  76. package/lib/icon/success.js +15 -0
  77. package/lib/icon/switcher-loading.js +15 -0
  78. package/lib/icon/text-file.js +15 -0
  79. package/lib/icon/tree-application-shape.js +15 -0
  80. package/lib/icon/unvisible.js +15 -0
  81. package/lib/icon/warn.js +15 -0
  82. package/lib/index.d.ts +1 -0
  83. package/lib/input/index.d.ts +19 -11
  84. package/lib/input/index.js +2 -2
  85. package/lib/input/input.css +1 -0
  86. package/lib/input/input.d.ts +5 -3
  87. package/lib/input/input.less +4 -3
  88. package/lib/input/input.variable.css +1 -0
  89. package/lib/link/index.js +1 -1
  90. package/lib/loading/index.js +1 -1
  91. package/lib/menu/index.js +1 -1
  92. package/lib/menu/submenu.css +3 -0
  93. package/lib/menu/submenu.less +1 -1
  94. package/lib/menu/submenu.variable.css +3 -0
  95. package/lib/message/index.js +1 -1
  96. package/lib/modal/index.d.ts +8 -8
  97. package/lib/modal/index.js +1 -1
  98. package/lib/modal/modal.d.ts +3 -3
  99. package/lib/modal/props.mixin.d.ts +1 -1
  100. package/lib/navigation/index.js +1 -1
  101. package/lib/notify/index.js +1 -1
  102. package/lib/notify/notifyConstructor.d.ts +2 -2
  103. package/lib/popover/index.d.ts +103 -48
  104. package/lib/popover/index.js +1 -1
  105. package/lib/popover/popover.css +22 -13
  106. package/lib/popover/popover.d.ts +30 -23
  107. package/lib/popover/popover.less +55 -45
  108. package/lib/popover/popover.variable.css +22 -13
  109. package/lib/popover/props.d.ts +77 -0
  110. package/lib/preset.d.ts +2 -3
  111. package/lib/process/index.d.ts +145 -0
  112. package/lib/process/index.js +15 -0
  113. package/lib/process/process.css +139 -0
  114. package/lib/process/process.d.ts +116 -0
  115. package/lib/process/process.less +179 -0
  116. package/lib/process/process.variable.css +225 -0
  117. package/lib/progress/index.d.ts +23 -1
  118. package/lib/progress/index.js +1 -1
  119. package/lib/progress/progress.css +0 -3
  120. package/lib/progress/progress.d.ts +17 -1
  121. package/lib/progress/progress.less +0 -4
  122. package/lib/progress/progress.variable.css +0 -3
  123. package/lib/radio/index.d.ts +2 -2
  124. package/lib/radio/index.js +1 -1
  125. package/lib/rate/index.js +1 -1
  126. package/lib/select/common.d.ts +10 -1
  127. package/lib/select/index.d.ts +132 -189
  128. package/lib/select/index.js +2 -2
  129. package/lib/select/option.d.ts +1 -7
  130. package/lib/select/optionGroup.d.ts +22 -15
  131. package/lib/select/select.css +71 -14
  132. package/lib/select/select.d.ts +40 -55
  133. package/lib/select/select.less +73 -14
  134. package/lib/select/select.variable.css +71 -14
  135. package/lib/shared/bk-helper-core.d.ts +6 -0
  136. package/lib/shared/bk-popover.d.ts +45 -4
  137. package/lib/shared/index.d.ts +10 -0
  138. package/lib/shared/index.js +1 -1
  139. package/lib/shared/utils.d.ts +6 -0
  140. package/lib/sideslider/index.d.ts +7 -7
  141. package/lib/sideslider/index.js +1 -1
  142. package/lib/sideslider/sideslider.d.ts +3 -3
  143. package/lib/slider/index.js +2 -2
  144. package/lib/steps/index.d.ts +8 -8
  145. package/lib/steps/index.js +2 -2
  146. package/lib/steps/steps.d.ts +2 -2
  147. package/lib/styles/index.d.ts +2 -0
  148. package/lib/styles/index.js +1 -1
  149. package/lib/switcher/index.js +1 -1
  150. package/lib/switcher/switcher.css +149 -135
  151. package/lib/switcher/switcher.less +210 -154
  152. package/lib/switcher/switcher.variable.css +149 -135
  153. package/lib/tab/index.js +1 -1
  154. package/lib/table/index.d.ts +76 -1
  155. package/lib/table/index.js +1 -1
  156. package/lib/table/props.d.ts +38 -0
  157. package/lib/table/render.d.ts +1 -1
  158. package/lib/table/table.css +6 -4
  159. package/lib/table/table.d.ts +34 -0
  160. package/lib/table/table.less +4 -4
  161. package/lib/table/table.variable.css +6 -4
  162. package/lib/table/utils.d.ts +8 -0
  163. package/lib/tag/index.js +1 -1
  164. package/lib/tree/index.d.ts +22 -8
  165. package/lib/tree/index.js +1 -1
  166. package/lib/tree/props.d.ts +52 -0
  167. package/lib/tree/tree.css +16 -7
  168. package/lib/tree/tree.d.ts +13 -7
  169. package/lib/tree/tree.less +24 -24
  170. package/lib/tree/tree.variable.css +16 -7
  171. package/lib/tree/util.d.ts +3 -44
  172. package/lib/virtual-render/index.d.ts +410 -0
  173. package/lib/virtual-render/index.js +1 -0
  174. package/lib/virtual-render/props.d.ts +156 -0
  175. package/lib/virtual-render/v-virtual-render.d.ts +7 -0
  176. package/lib/virtual-render/virtual-render.css +40 -0
  177. package/lib/virtual-render/virtual-render.d.ts +183 -0
  178. package/lib/virtual-render/virtual-render.less +51 -0
  179. package/lib/virtual-render/virtual-render.variable.css +40 -0
  180. package/package.json +11 -7
@@ -1,46 +1,4 @@
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
- export declare type TreePropTypes = Readonly<ExtractPropTypes<typeof treeProps>>;
1
+ import { TreePropTypes } from './props';
44
2
  /**
45
3
  * 扁平化当前数据
46
4
  * @param arrData
@@ -82,8 +40,9 @@ export declare const getNodeItemStyle: (item: any, props: TreePropTypes, schema?
82
40
  * @param item
83
41
  * @returns
84
42
  */
85
- export declare const getNodeItemClass: (item: any, schema: any) => {
43
+ export declare const getNodeItemClass: (item: any, schema: any, props: TreePropTypes) => {
86
44
  'is-root': any;
87
45
  'bk-tree-node': boolean;
88
46
  'is-open': any;
47
+ 'is-virtual-render': boolean;
89
48
  };
@@ -0,0 +1,410 @@
1
+ declare const BkTree: {
2
+ new (...args: any[]): {
3
+ $: import("vue").ComponentInternalInstance;
4
+ $data: {};
5
+ $props: Partial<{
6
+ enabled: boolean;
7
+ width: string | number;
8
+ height: string | number;
9
+ list: unknown[];
10
+ className: string | {
11
+ [key: string]: any;
12
+ };
13
+ minHeight: number;
14
+ lineHeight: any;
15
+ contentClassName: string | {
16
+ [key: string]: any;
17
+ };
18
+ contentStyle: {
19
+ [key: string]: any;
20
+ };
21
+ scrollXName: string;
22
+ scrollYName: string;
23
+ groupItemCount: number;
24
+ preloadItemCount: number;
25
+ renderAs: string;
26
+ contentAs: string;
27
+ scrollOffsetTop: number;
28
+ scrollPosition: string;
29
+ abosuteHeight: string | number;
30
+ throttleDelay: number;
31
+ }> & Omit<({} & (Readonly<{
32
+ list?: unknown;
33
+ enabled?: unknown;
34
+ lineHeight?: unknown;
35
+ minHeight?: unknown;
36
+ height?: unknown;
37
+ width?: unknown;
38
+ className?: unknown;
39
+ contentClassName?: unknown;
40
+ contentStyle?: unknown;
41
+ scrollXName?: unknown;
42
+ scrollYName?: unknown;
43
+ groupItemCount?: unknown;
44
+ preloadItemCount?: unknown;
45
+ renderAs?: unknown;
46
+ contentAs?: unknown;
47
+ scrollOffsetTop?: unknown;
48
+ scrollPosition?: unknown;
49
+ abosuteHeight?: unknown;
50
+ throttleDelay?: unknown;
51
+ } & {
52
+ enabled: boolean;
53
+ width: string | number;
54
+ height: string | number;
55
+ list: unknown[];
56
+ className: string | {
57
+ [key: string]: any;
58
+ };
59
+ minHeight: number;
60
+ contentClassName: string | {
61
+ [key: string]: any;
62
+ };
63
+ contentStyle: {
64
+ [key: string]: any;
65
+ };
66
+ scrollXName: string;
67
+ scrollYName: string;
68
+ groupItemCount: number;
69
+ preloadItemCount: number;
70
+ renderAs: string;
71
+ contentAs: string;
72
+ scrollOffsetTop: number;
73
+ scrollPosition: string;
74
+ abosuteHeight: string | number;
75
+ throttleDelay: number;
76
+ } & {
77
+ lineHeight?: any;
78
+ }> & ({} | {}))) & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<{
79
+ list?: unknown;
80
+ enabled?: unknown;
81
+ lineHeight?: unknown;
82
+ minHeight?: unknown;
83
+ height?: unknown;
84
+ width?: unknown;
85
+ className?: unknown;
86
+ contentClassName?: unknown;
87
+ contentStyle?: unknown;
88
+ scrollXName?: unknown;
89
+ scrollYName?: unknown;
90
+ groupItemCount?: unknown;
91
+ preloadItemCount?: unknown;
92
+ renderAs?: unknown;
93
+ contentAs?: unknown;
94
+ scrollOffsetTop?: unknown;
95
+ scrollPosition?: unknown;
96
+ abosuteHeight?: unknown;
97
+ throttleDelay?: unknown;
98
+ } & {
99
+ enabled: boolean;
100
+ width: string | number;
101
+ height: string | number;
102
+ list: unknown[];
103
+ className: string | {
104
+ [key: string]: any;
105
+ };
106
+ minHeight: number;
107
+ contentClassName: string | {
108
+ [key: string]: any;
109
+ };
110
+ contentStyle: {
111
+ [key: string]: any;
112
+ };
113
+ scrollXName: string;
114
+ scrollYName: string;
115
+ groupItemCount: number;
116
+ preloadItemCount: number;
117
+ renderAs: string;
118
+ contentAs: string;
119
+ scrollOffsetTop: number;
120
+ scrollPosition: string;
121
+ abosuteHeight: string | number;
122
+ throttleDelay: number;
123
+ } & {
124
+ lineHeight?: any;
125
+ }> & ({} | {})), "enabled" | "width" | "height" | "list" | "className" | "minHeight" | "lineHeight" | "contentClassName" | "contentStyle" | "scrollXName" | "scrollYName" | "groupItemCount" | "preloadItemCount" | "renderAs" | "contentAs" | "scrollOffsetTop" | "scrollPosition" | "abosuteHeight" | "throttleDelay">;
126
+ $attrs: {
127
+ [x: string]: unknown;
128
+ };
129
+ $refs: {
130
+ [x: string]: unknown;
131
+ };
132
+ $slots: Readonly<{
133
+ [name: string]: import("vue").Slot;
134
+ }>;
135
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
136
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
137
+ $emit: ((event: string, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
138
+ $el: any;
139
+ $options: import("vue").ComponentOptionsBase<Readonly<{
140
+ list?: unknown;
141
+ enabled?: unknown;
142
+ lineHeight?: unknown;
143
+ minHeight?: unknown;
144
+ height?: unknown;
145
+ width?: unknown;
146
+ className?: unknown;
147
+ contentClassName?: unknown;
148
+ contentStyle?: unknown;
149
+ scrollXName?: unknown;
150
+ scrollYName?: unknown;
151
+ groupItemCount?: unknown;
152
+ preloadItemCount?: unknown;
153
+ renderAs?: unknown;
154
+ contentAs?: unknown;
155
+ scrollOffsetTop?: unknown;
156
+ scrollPosition?: unknown;
157
+ abosuteHeight?: unknown;
158
+ throttleDelay?: unknown;
159
+ } & {
160
+ enabled: boolean;
161
+ width: string | number;
162
+ height: string | number;
163
+ list: unknown[];
164
+ className: string | {
165
+ [key: string]: any;
166
+ };
167
+ minHeight: number;
168
+ contentClassName: string | {
169
+ [key: string]: any;
170
+ };
171
+ contentStyle: {
172
+ [key: string]: any;
173
+ };
174
+ scrollXName: string;
175
+ scrollYName: string;
176
+ groupItemCount: number;
177
+ preloadItemCount: number;
178
+ renderAs: string;
179
+ contentAs: string;
180
+ scrollOffsetTop: number;
181
+ scrollPosition: string;
182
+ abosuteHeight: string | number;
183
+ throttleDelay: number;
184
+ } & {
185
+ lineHeight?: any;
186
+ }> & ({} | {}), () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
187
+ [key: string]: any;
188
+ }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {
189
+ enabled: boolean;
190
+ width: string | number;
191
+ height: string | number;
192
+ list: unknown[];
193
+ className: string | {
194
+ [key: string]: any;
195
+ };
196
+ minHeight: number;
197
+ lineHeight: any;
198
+ contentClassName: string | {
199
+ [key: string]: any;
200
+ };
201
+ contentStyle: {
202
+ [key: string]: any;
203
+ };
204
+ scrollXName: string;
205
+ scrollYName: string;
206
+ groupItemCount: number;
207
+ preloadItemCount: number;
208
+ renderAs: string;
209
+ contentAs: string;
210
+ scrollOffsetTop: number;
211
+ scrollPosition: string;
212
+ abosuteHeight: string | number;
213
+ throttleDelay: number;
214
+ }> & {
215
+ beforeCreate?: (() => void) | (() => void)[];
216
+ created?: (() => void) | (() => void)[];
217
+ beforeMount?: (() => void) | (() => void)[];
218
+ mounted?: (() => void) | (() => void)[];
219
+ beforeUpdate?: (() => void) | (() => void)[];
220
+ updated?: (() => void) | (() => void)[];
221
+ activated?: (() => void) | (() => void)[];
222
+ deactivated?: (() => void) | (() => void)[];
223
+ beforeDestroy?: (() => void) | (() => void)[];
224
+ beforeUnmount?: (() => void) | (() => void)[];
225
+ destroyed?: (() => void) | (() => void)[];
226
+ unmounted?: (() => void) | (() => void)[];
227
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
228
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
229
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>, info: string) => boolean | void)[];
230
+ };
231
+ $forceUpdate: () => void;
232
+ $nextTick: typeof import("vue").nextTick;
233
+ $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
234
+ } & (Readonly<{
235
+ list?: unknown;
236
+ enabled?: unknown;
237
+ lineHeight?: unknown;
238
+ minHeight?: unknown;
239
+ height?: unknown;
240
+ width?: unknown;
241
+ className?: unknown;
242
+ contentClassName?: unknown;
243
+ contentStyle?: unknown;
244
+ scrollXName?: unknown;
245
+ scrollYName?: unknown;
246
+ groupItemCount?: unknown;
247
+ preloadItemCount?: unknown;
248
+ renderAs?: unknown;
249
+ contentAs?: unknown;
250
+ scrollOffsetTop?: unknown;
251
+ scrollPosition?: unknown;
252
+ abosuteHeight?: unknown;
253
+ throttleDelay?: unknown;
254
+ } & {
255
+ enabled: boolean;
256
+ width: string | number;
257
+ height: string | number;
258
+ list: unknown[];
259
+ className: string | {
260
+ [key: string]: any;
261
+ };
262
+ minHeight: number;
263
+ contentClassName: string | {
264
+ [key: string]: any;
265
+ };
266
+ contentStyle: {
267
+ [key: string]: any;
268
+ };
269
+ scrollXName: string;
270
+ scrollYName: string;
271
+ groupItemCount: number;
272
+ preloadItemCount: number;
273
+ renderAs: string;
274
+ contentAs: string;
275
+ scrollOffsetTop: number;
276
+ scrollPosition: string;
277
+ abosuteHeight: string | number;
278
+ throttleDelay: number;
279
+ } & {
280
+ lineHeight?: any;
281
+ }> & ({} | {})) & import("vue").ShallowUnwrapRef<() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
282
+ [key: string]: any;
283
+ }>> & {} & {} & import("vue").ComponentCustomProperties & Readonly<{
284
+ list?: unknown;
285
+ enabled?: unknown;
286
+ lineHeight?: unknown;
287
+ minHeight?: unknown;
288
+ height?: unknown;
289
+ width?: unknown;
290
+ className?: unknown;
291
+ contentClassName?: unknown;
292
+ contentStyle?: unknown;
293
+ scrollXName?: unknown;
294
+ scrollYName?: unknown;
295
+ groupItemCount?: unknown;
296
+ preloadItemCount?: unknown;
297
+ renderAs?: unknown;
298
+ contentAs?: unknown;
299
+ scrollOffsetTop?: unknown;
300
+ scrollPosition?: unknown;
301
+ abosuteHeight?: unknown;
302
+ throttleDelay?: unknown;
303
+ } & {
304
+ enabled: boolean;
305
+ width: string | number;
306
+ height: string | number;
307
+ list: unknown[];
308
+ className: string | {
309
+ [key: string]: any;
310
+ };
311
+ minHeight: number;
312
+ contentClassName: string | {
313
+ [key: string]: any;
314
+ };
315
+ contentStyle: {
316
+ [key: string]: any;
317
+ };
318
+ scrollXName: string;
319
+ scrollYName: string;
320
+ groupItemCount: number;
321
+ preloadItemCount: number;
322
+ renderAs: string;
323
+ contentAs: string;
324
+ scrollOffsetTop: number;
325
+ scrollPosition: string;
326
+ abosuteHeight: string | number;
327
+ throttleDelay: number;
328
+ } & {
329
+ lineHeight?: any;
330
+ }> & ({} | {});
331
+ __isFragment?: never;
332
+ __isTeleport?: never;
333
+ __isSuspense?: never;
334
+ } & import("vue").ComponentOptionsBase<Readonly<{
335
+ list?: unknown;
336
+ enabled?: unknown;
337
+ lineHeight?: unknown;
338
+ minHeight?: unknown;
339
+ height?: unknown;
340
+ width?: unknown;
341
+ className?: unknown;
342
+ contentClassName?: unknown;
343
+ contentStyle?: unknown;
344
+ scrollXName?: unknown;
345
+ scrollYName?: unknown;
346
+ groupItemCount?: unknown;
347
+ preloadItemCount?: unknown;
348
+ renderAs?: unknown;
349
+ contentAs?: unknown;
350
+ scrollOffsetTop?: unknown;
351
+ scrollPosition?: unknown;
352
+ abosuteHeight?: unknown;
353
+ throttleDelay?: unknown;
354
+ } & {
355
+ enabled: boolean;
356
+ width: string | number;
357
+ height: string | number;
358
+ list: unknown[];
359
+ className: string | {
360
+ [key: string]: any;
361
+ };
362
+ minHeight: number;
363
+ contentClassName: string | {
364
+ [key: string]: any;
365
+ };
366
+ contentStyle: {
367
+ [key: string]: any;
368
+ };
369
+ scrollXName: string;
370
+ scrollYName: string;
371
+ groupItemCount: number;
372
+ preloadItemCount: number;
373
+ renderAs: string;
374
+ contentAs: string;
375
+ scrollOffsetTop: number;
376
+ scrollPosition: string;
377
+ abosuteHeight: string | number;
378
+ throttleDelay: number;
379
+ } & {
380
+ lineHeight?: any;
381
+ }> & ({} | {}), () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
382
+ [key: string]: any;
383
+ }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, "content-scroll", {
384
+ enabled: boolean;
385
+ width: string | number;
386
+ height: string | number;
387
+ list: unknown[];
388
+ className: string | {
389
+ [key: string]: any;
390
+ };
391
+ minHeight: number;
392
+ lineHeight: any;
393
+ contentClassName: string | {
394
+ [key: string]: any;
395
+ };
396
+ contentStyle: {
397
+ [key: string]: any;
398
+ };
399
+ scrollXName: string;
400
+ scrollYName: string;
401
+ groupItemCount: number;
402
+ preloadItemCount: number;
403
+ renderAs: string;
404
+ contentAs: string;
405
+ scrollOffsetTop: number;
406
+ scrollPosition: string;
407
+ abosuteHeight: string | number;
408
+ throttleDelay: number;
409
+ }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin;
410
+ export default BkTree;
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("../shared")):"function"==typeof define&&define.amd?define(["exports","vue","../shared"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Vue,e.Shared)}(this,(function(e,t,o){"use strict";function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r={exports:{}},l={exports:{}},s={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n},e.exports.__esModule=!0,e.exports.default=e.exports}(s),function(e){var t=s.exports;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(l);var i={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}(i);var u={exports:{}};!function(e){var t=s.exports;e.exports=function(e,o){if(e){if("string"==typeof e)return t(e,o);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(e,o):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(u);var a={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}(a),function(e){var t=l.exports,o=i.exports,n=u.exports,r=a.exports;e.exports=function(e){return t(e)||o(e)||n(e)||r()},e.exports.__esModule=!0,e.exports.default=e.exports}(r);var p=n(r.exports),c={exports:{}};!function(e){function t(o){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(o)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(c);var f=n(c.exports),d={list:o.PropTypes.array.def([]),enabled:o.PropTypes.bool.def(!0),lineHeight:o.PropTypes.oneOfType([o.PropTypes.number,o.PropTypes.func]).def(30),minHeight:o.PropTypes.number.def(30),height:o.PropTypes.oneOfType([o.PropTypes.string.def("100%"),o.PropTypes.number]).def("100%"),width:o.PropTypes.oneOfType([o.PropTypes.string.def("100%"),o.PropTypes.number]).def("100%"),className:o.PropTypes.oneOfType([o.PropTypes.arrayOf(o.PropTypes.string),o.PropTypes.object,o.PropTypes.arrayOf(o.PropTypes.object),o.PropTypes.string]).def(""),contentClassName:o.PropTypes.oneOfType([o.PropTypes.arrayOf(o.PropTypes.string),o.PropTypes.object,o.PropTypes.arrayOf(o.PropTypes.object),o.PropTypes.string]).def(""),contentStyle:o.PropTypes.object.def({}),scrollXName:o.PropTypes.string.def("bk-scroll-x"),scrollYName:o.PropTypes.string.def("bk-scroll-y"),groupItemCount:o.PropTypes.number.def(1),preloadItemCount:o.PropTypes.number.def(1),renderAs:o.PropTypes.string.def("div"),contentAs:o.PropTypes.string.def("div"),scrollOffsetTop:o.PropTypes.number.def(0),scrollPosition:o.PropTypes.string.def("content"),abosuteHeight:o.PropTypes.oneOfType([o.PropTypes.string.def("auto"),o.PropTypes.number]).def("auto"),throttleDelay:o.PropTypes.number.def(60)},y=void 0;function v(e,t,o,n){for(var r=0,l=0,s=0,i=0;r<e;r++){if(l+(i=n(r,[r*o,(r+1)*o]))>t){s=t-l;break}l+=i}return{startIndex:r,height:l,diffHeight:s}}function h(e,t,o,n,r){if(n){var l=n.scrollTop,s=o.scrollTop,i=o.count,u=o.groupItemCount,a=o.startIndex,p=o.endIndex,c=n.offsetHeight,f=0,d=0,y=0;if("number"==typeof e&&(f=Math.floor(l/e),d=Math.ceil(c/e)+f,y=l%e),"function"==typeof e){var h=v(i,l,u,e);f=h.startIndex>0?h.startIndex:0,y=h.diffHeight,d=v(i,c,u,e).startIndex+f+1}l===s&&f===a&&d===p||"function"==typeof t&&t(r,f,d,l,y)}}function x(e,t,o){var n=o.value,r=n.lineHeight,l=void 0===r?30:r,s=n.handleScrollCallback,i=n.pagination,u=void 0===i?{}:i,a=u.startIndex,p=u.endIndex,c=u.groupItemCount,f=u.count;h(l,s,{scrollTop:u.scrollTop,startIndex:a,endIndex:p,groupItemCount:c,count:f},t,e)}var m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60;return o.throttle((function(e,t,o){return x(e,t,o)}),e)},b=null,g=function(e,t,o){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:60;b||(b=m(n)),"function"==typeof b&&b.call(y,e,t,o)},T={mounted:function(e,t){var o=e.parentNode,n=t.value.throttleDelay;o.addEventListener("scroll",(function(e){g(e,o,t,n)}))},updated:function(e,t){var o=e.parentNode,n=t.value.throttleDelay;g(null,o,t,n)},unbind:function(e){if(e){var t=e.parentNode;if(!t)return;t.removeEventListener("scroll",m)}}},P=t.defineComponent({name:"VirtualRender",directives:{bkVirtualRender:T},props:d,emits:["content-scroll"],setup:function(e,o){var n=this,r=e.renderAs,l=e.contentAs,s=function(e){return"string"==typeof e?[e]:"object"!==f(e)||Array.isArray(e)?e:[e]};if(!e.enabled)return function(){var n,i,u,a,p,c,f,d,y;return t.h(r,{class:s(e.className)},[null!==(u=null===(i=(n=o.slots).beforeContent)||void 0===i?void 0:i.call(n))&&void 0!==u?u:"",t.h(l,{class:s(e.contentClassName),style:e.contentStyle},[null!==(c=null===(p=(a=o.slots).default)||void 0===p?void 0:p.call(a,{data:e.list}))&&void 0!==c?c:""]),null!==(y=null===(d=(f=o.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:""])};var i=t.ref(null),u=t.reactive({startIndex:0,endIndex:0,scrollTop:1,translateY:0,count:0,groupItemCount:e.groupItemCount}),a=function(e,t,n,r,l){u.startIndex=t,u.endIndex=n,u.scrollTop=r,u.translateY=l,o.emit("content-scroll",[e,u])};t.onMounted((function(){t.nextTick((function(){v(e.list),x()}))})),t.watch((function(){return e.list}),(function(){c(),x()}),{deep:!0}),t.watch((function(){return e.lineHeight}),(function(){c(),x()}));var c=function(){v(e.list)},d=t.reactive(t.ref(0)),y=t.reactive(t.ref(0)),v=function(t){if(d.value=Math.ceil((t||[]).length/e.groupItemCount),u.count=d.value,u.startIndex=0,u.endIndex=0,u.translateY=0,u.scrollTop=0,"string"==typeof e.abosuteHeight&&"auto"===e.abosuteHeight)if("function"==typeof e.lineHeight){y.value=0;for(var o=0,r=0;r<d.value;r++){var l=e.lineHeight.call(n,r,t.slice(r*e.groupItemCount,e.groupItemCount));o+="number"==typeof l?l:0}y.value=o}else y.value=e.lineHeight*d.value;else y.value=e.abosuteHeight},x=function(){var t=(i.value||{}).parentNode;h(e.lineHeight,a,u,t,null)},m=t.computed((function(){return(e.list||[]).map((function(e,t){return Object.assign(e,{$index:t})}))})),b=t.computed((function(){return m.value.slice(u.startIndex*e.groupItemCount,(u.endIndex+e.preloadItemCount)*e.groupItemCount)})),g=t.computed((function(){return"content"===e.scrollPosition?{top:"".concat(u.scrollTop+e.scrollOffsetTop,"px"),transform:"translateY(-".concat(u.translateY,"px)")}:{}})),T=t.computed((function(){return Object.assign({height:"number"==typeof e.height?"".concat(e.height,"px"):e.height,width:"number"==typeof e.width?"".concat(e.width,"px"):e.width,display:"inline-block"},"container"===e.scrollPosition?g.value:{})})),P=t.computed((function(){var t="number"==typeof e.abosuteHeight&&0===e.abosuteHeight;return{height:"".concat(y.value<e.minHeight?e.minHeight:y.value,"px"),display:t?"none":"block"}})),I=t.computed((function(){return["bk-virtual-render",e.scrollXName,e.scrollYName].concat(p(s(e.className)),["container"===e.scrollPosition?"bk-virtual-content":""])})),C=t.computed((function(){return["content"===e.scrollPosition?"bk-virtual-content":""].concat(p(s(e.contentClassName)))})),H=t.resolveDirective("bkVirtualRender"),O={lineHeight:e.lineHeight,handleScrollCallback:a,pagination:u,throttleDelay:e.throttleDelay};return function(){var n,s,u,a,p,c,f,d,y;return t.h(r||"div",{ref:i,class:I.value,style:T.value},[null!==(u=null===(s=(n=o.slots).beforeContent)||void 0===s?void 0:s.call(n))&&void 0!==u?u:"",t.withDirectives(t.h(l||"div",{class:C.value,style:Object.assign(Object.assign({},g.value),e.contentStyle)},[null!==(c=null===(p=(a=o.slots).default)||void 0===p?void 0:p.call(a,{data:b.value}))&&void 0!==c?c:""]),[[H,O]]),null!==(y=null===(d=(f=o.slots).afterContent)||void 0===d?void 0:d.call(f))&&void 0!==y?y:"",t.h("div",{class:["bk-virtual-section"],style:P.value})])}}}),I=o.withInstall(P);e.default=I,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -0,0 +1,156 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+ export declare const virtualRenderProps: {
3
+ /** 传入原始数据源 */
4
+ list: import("vue-types").VueTypeValidableDef<unknown[]> & {
5
+ default: () => unknown[];
6
+ } & {
7
+ default: () => unknown[];
8
+ };
9
+ /**
10
+ * 是否启用此功能
11
+ * 如果设置为false,则此组件只会渲染两层指定的 容器,默认渲染两层 div
12
+ * 设置为true才会启用所有的虚拟渲染 & 滚动相关计算
13
+ * 此属性设置为了兼容需要按需开启\关闭虚拟渲染场景,避免外层设计两套样式架构
14
+ * Note: 目前此属性不支持动态修改
15
+ */
16
+ enabled: import("vue-types").VueTypeValidableDef<boolean> & {
17
+ default: boolean;
18
+ } & {
19
+ default: boolean;
20
+ };
21
+ /**
22
+ * 每行数据高度
23
+ * 默认为数值类型,默认高度 30px
24
+ * 如果每行高度不一致,可为回调函数:(index: number, row: any[]): number => {}
25
+ * 函数参数为当前行index & 当前行数据 row,row为数组,当不分组时,为当前行item
26
+ * 如果有分组展示, index 为当前分组 index, row为数组,当前行分组所有 item 数据
27
+ */
28
+ lineHeight: import("vue-types").VueTypeDef<any> & {
29
+ default: any;
30
+ };
31
+ /** 整体最小高度 */
32
+ minHeight: import("vue-types").VueTypeValidableDef<number> & {
33
+ default: number;
34
+ } & {
35
+ default: number;
36
+ };
37
+ /**
38
+ * 整体高度
39
+ * 可设置具体值,如果设置为 100%,则组件会自动计算外层DOM元素offsetHeight,用于计算可渲染行数
40
+ */
41
+ height: import("vue-types").VueTypeDef<string | number> & {
42
+ default: string | number;
43
+ };
44
+ /**
45
+ * 渲染区域宽度
46
+ * 如果设置 100% 则自适应外层元素宽度
47
+ */
48
+ width: import("vue-types").VueTypeDef<string | number> & {
49
+ default: string | number;
50
+ };
51
+ /** 最外层元素ClassName */
52
+ className: import("vue-types").VueTypeDef<string | string[] | {
53
+ [key: string]: any;
54
+ } | {
55
+ [key: string]: any;
56
+ }[]> & {
57
+ default: string | (() => {
58
+ [key: string]: any;
59
+ }) | (() => string[]) | (() => {
60
+ [key: string]: any;
61
+ }[]);
62
+ };
63
+ /** 内层层元素ClassName */
64
+ contentClassName: import("vue-types").VueTypeDef<string | string[] | {
65
+ [key: string]: any;
66
+ } | {
67
+ [key: string]: any;
68
+ }[]> & {
69
+ default: string | (() => {
70
+ [key: string]: any;
71
+ }) | (() => string[]) | (() => {
72
+ [key: string]: any;
73
+ }[]);
74
+ };
75
+ /** 内层元素样式 */
76
+ contentStyle: import("vue-types").VueTypeValidableDef<{
77
+ [key: string]: any;
78
+ }> & {
79
+ default: () => {
80
+ [key: string]: any;
81
+ };
82
+ } & {
83
+ default: () => {
84
+ [key: string]: any;
85
+ };
86
+ };
87
+ /** 用于自定义X轴滚动条样式 */
88
+ scrollXName: import("vue-types").VueTypeValidableDef<string> & {
89
+ default: string;
90
+ } & {
91
+ default: string;
92
+ };
93
+ /** 用于自定义Y轴滚动条样式 */
94
+ scrollYName: import("vue-types").VueTypeValidableDef<string> & {
95
+ default: string;
96
+ } & {
97
+ default: string;
98
+ };
99
+ /** 分组展示,一行数据可能有多条数据 */
100
+ groupItemCount: import("vue-types").VueTypeValidableDef<number> & {
101
+ default: number;
102
+ } & {
103
+ default: number;
104
+ };
105
+ /** 预加载行数,避免空白渲染 */
106
+ preloadItemCount: import("vue-types").VueTypeValidableDef<number> & {
107
+ default: number;
108
+ } & {
109
+ default: number;
110
+ };
111
+ /** 外层Dom元素需要渲染成的目标元素 */
112
+ renderAs: import("vue-types").VueTypeValidableDef<string> & {
113
+ default: string;
114
+ } & {
115
+ default: string;
116
+ };
117
+ /** 内容层渲染成目标元素 */
118
+ contentAs: import("vue-types").VueTypeValidableDef<string> & {
119
+ default: string;
120
+ } & {
121
+ default: string;
122
+ };
123
+ /** top 滚动填充 */
124
+ scrollOffsetTop: import("vue-types").VueTypeValidableDef<number> & {
125
+ default: number;
126
+ } & {
127
+ default: number;
128
+ };
129
+ /**
130
+ * 内置滚动位置
131
+ * 可选:container (最外层容器),content(内容层容器)
132
+ * Note: container 慎选,需要自己处理样式 & 位置
133
+ */
134
+ scrollPosition: import("vue-types").VueTypeValidableDef<string> & {
135
+ default: string;
136
+ } & {
137
+ default: string;
138
+ };
139
+ /**
140
+ * 绝对高度 | 实际高估
141
+ * 可选值: auto(根据行高和行数计算, LineHeight * List.length) number(外层给定高度,若为0,则不显示)
142
+ */
143
+ abosuteHeight: import("vue-types").VueTypeDef<string | number> & {
144
+ default: string | number;
145
+ };
146
+ /**
147
+ * 滚动刷新计算间隔时间
148
+ * 默认60 ms
149
+ */
150
+ throttleDelay: import("vue-types").VueTypeValidableDef<number> & {
151
+ default: number;
152
+ } & {
153
+ default: number;
154
+ };
155
+ };
156
+ export declare type VirtualRenderProps = Readonly<ExtractPropTypes<typeof virtualRenderProps>>;
@@ -0,0 +1,7 @@
1
+ export declare function computedVirtualIndex(lineHeight: any, callback: any, pagination: any, el: any, event: any): void;
2
+ declare const _default: {
3
+ mounted(el: any, binding: any): void;
4
+ updated(el: any, binding: any): void;
5
+ unbind(el: any): void;
6
+ };
7
+ export default _default;
@@ -0,0 +1,40 @@
1
+ .bk-virtual-render {
2
+ position: relative;
3
+ }
4
+ .bk-virtual-render .bk-virtual-content,
5
+ .bk-virtual-render.bk-virtual-content {
6
+ position: absolute;
7
+ top: 0;
8
+ bottom: 0;
9
+ left: 0;
10
+ width: 100%;
11
+ height: 100%;
12
+ }
13
+ .bk-virtual-render .bk-virtual-section {
14
+ width: 1px;
15
+ background: transparent;
16
+ }
17
+ .bk-virtual-render.bk-scroll-x {
18
+ overflow-x: auto;
19
+ scrollbar-color: #a0a0a0 transparent;
20
+ scrollbar-width: thin;
21
+ }
22
+ .bk-virtual-render.bk-scroll-x::-webkit-scrollbar {
23
+ height: 8px;
24
+ background-color: transparent;
25
+ }
26
+ .bk-virtual-render.bk-scroll-x::-webkit-scrollbar-thumb {
27
+ background-color: #a0a0a0;
28
+ border-radius: 8px;
29
+ }
30
+ .bk-virtual-render.bk-scroll-y {
31
+ overflow-y: auto;
32
+ }
33
+ .bk-virtual-render.bk-scroll-y::-webkit-scrollbar {
34
+ width: 6px;
35
+ background-color: transparent;
36
+ }
37
+ .bk-virtual-render.bk-scroll-y::-webkit-scrollbar-thumb {
38
+ background-color: #dcdee5;
39
+ border-radius: 6px;
40
+ }