bkui-vue 0.0.1-beta.12 → 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.
- package/README.md +25 -17
- package/README_EN.md +89 -0
- package/dist/bkui-vue.cjs.js +1847 -467
- package/dist/bkui-vue.esm.js +1842 -468
- package/dist/bkui-vue.umd.js +1847 -467
- package/dist/style.css +454 -177
- package/lib/alert/index.js +1 -1
- package/lib/animate-number/index.js +1 -1
- package/lib/backtop/index.js +1 -1
- package/lib/badge/index.js +1 -1
- package/lib/breadcrumb/breadcrumb.css +10 -1
- package/lib/breadcrumb/breadcrumb.d.ts +20 -0
- package/lib/breadcrumb/breadcrumb.less +13 -2
- package/lib/breadcrumb/breadcrumb.variable.css +10 -1
- package/lib/breadcrumb/index.d.ts +38 -2
- package/lib/breadcrumb/index.js +1 -1
- package/lib/button/button.d.ts +2 -2
- package/lib/button/index.d.ts +8 -8
- package/lib/button/index.js +1 -1
- package/lib/card/index.js +1 -1
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox/index.js +1 -1
- package/lib/checkbox/type.d.ts +1 -1
- package/lib/collapse/index.js +1 -1
- package/lib/components.d.ts +3 -1
- package/lib/date-picker/index.js +1 -1
- package/lib/dialog/index.js +1 -1
- package/lib/directives/index.js +1 -1
- package/lib/divider/index.js +1 -1
- package/lib/exception/index.js +1 -1
- package/lib/fixed-navbar/index.js +1 -1
- package/lib/form/index.js +1 -1
- package/lib/icon/angle-down-fill.d.ts +4 -0
- package/lib/icon/angle-up-fill.d.ts +4 -0
- package/lib/icon/arrows-left.d.ts +4 -0
- package/lib/icon/index.d.ts +4 -0
- package/lib/icon/index.js +1 -1
- package/lib/icon/spinner.d.ts +4 -0
- package/lib/index.d.ts +1 -0
- package/lib/input/index.d.ts +19 -11
- package/lib/input/index.js +2 -2
- package/lib/input/input.css +1 -0
- package/lib/input/input.d.ts +5 -3
- package/lib/input/input.less +4 -3
- package/lib/input/input.variable.css +1 -0
- package/lib/link/index.js +1 -1
- package/lib/loading/index.d.ts +21 -4
- package/lib/loading/index.js +1 -1
- package/lib/loading/loading.d.ts +13 -2
- package/lib/menu/index.js +1 -1
- package/lib/message/index.js +1 -1
- package/lib/modal/index.js +1 -1
- package/lib/navigation/index.js +1 -1
- package/lib/notify/index.js +1 -1
- package/lib/notify/notifyConstructor.d.ts +2 -2
- package/lib/popover/index.d.ts +103 -48
- package/lib/popover/index.js +1 -1
- package/lib/popover/popover.css +22 -13
- package/lib/popover/popover.d.ts +30 -23
- package/lib/popover/popover.less +55 -45
- package/lib/popover/popover.variable.css +22 -13
- package/lib/popover/props.d.ts +77 -0
- package/lib/preset.d.ts +2 -3
- package/lib/process/index.d.ts +145 -0
- package/lib/process/index.js +15 -0
- package/lib/process/process.css +139 -0
- package/lib/process/process.d.ts +116 -0
- package/lib/process/process.less +179 -0
- package/lib/process/process.variable.css +225 -0
- package/lib/progress/index.d.ts +23 -1
- package/lib/progress/index.js +1 -1
- package/lib/progress/progress.css +0 -3
- package/lib/progress/progress.d.ts +17 -1
- package/lib/progress/progress.less +0 -4
- package/lib/progress/progress.variable.css +0 -3
- package/lib/radio/index.d.ts +2 -2
- package/lib/radio/index.js +1 -1
- package/lib/rate/index.js +1 -1
- package/lib/select/common.d.ts +10 -1
- package/lib/select/index.d.ts +133 -190
- package/lib/select/index.js +2 -2
- package/lib/select/option.d.ts +1 -7
- package/lib/select/optionGroup.d.ts +22 -15
- package/lib/select/select.css +71 -14
- package/lib/select/select.d.ts +40 -55
- package/lib/select/select.less +73 -14
- package/lib/select/select.variable.css +71 -14
- package/lib/shared/bk-helper-core.d.ts +6 -0
- package/lib/shared/bk-popover.d.ts +45 -4
- package/lib/shared/index.d.ts +10 -0
- package/lib/shared/index.js +1 -1
- package/lib/shared/utils.d.ts +6 -0
- package/lib/sideslider/index.js +1 -1
- package/lib/slider/index.js +2 -2
- package/lib/steps/index.d.ts +8 -8
- package/lib/steps/index.js +2 -2
- package/lib/steps/steps.d.ts +2 -2
- package/lib/styles/index.d.ts +2 -0
- package/lib/styles/index.js +1 -1
- package/lib/switcher/index.js +1 -1
- package/lib/switcher/switcher.css +149 -135
- package/lib/switcher/switcher.less +210 -154
- package/lib/switcher/switcher.variable.css +149 -135
- package/lib/tab/index.js +1 -1
- package/lib/table/index.d.ts +76 -1
- package/lib/table/index.js +1 -1
- package/lib/table/props.d.ts +38 -0
- package/lib/table/render.d.ts +1 -1
- package/lib/table/table.css +6 -4
- package/lib/table/table.d.ts +34 -0
- package/lib/table/table.less +4 -4
- package/lib/table/table.variable.css +6 -4
- package/lib/table/utils.d.ts +7 -0
- package/lib/tag/index.js +1 -1
- package/lib/tree/index.d.ts +22 -8
- package/lib/tree/index.js +1 -1
- package/lib/tree/props.d.ts +52 -0
- package/lib/tree/tree.css +16 -7
- package/lib/tree/tree.d.ts +13 -7
- package/lib/tree/tree.less +24 -24
- package/lib/tree/tree.variable.css +16 -7
- package/lib/tree/util.d.ts +3 -44
- package/lib/virtual-render/index.d.ts +395 -0
- package/lib/virtual-render/index.js +1 -0
- package/lib/virtual-render/props.d.ts +147 -0
- package/lib/virtual-render/v-virtual-render.d.ts +7 -0
- package/lib/virtual-render/virtual-render.css +40 -0
- package/lib/virtual-render/virtual-render.d.ts +175 -0
- package/lib/virtual-render/virtual-render.less +51 -0
- package/lib/virtual-render/virtual-render.variable.css +40 -0
- package/package.json +10 -6
package/lib/tree/util.d.ts
CHANGED
@@ -1,46 +1,4 @@
|
|
1
|
-
import {
|
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,395 @@
|
|
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
|
+
}> & Omit<({} & (Readonly<{
|
31
|
+
list?: unknown;
|
32
|
+
enabled?: unknown;
|
33
|
+
lineHeight?: unknown;
|
34
|
+
minHeight?: unknown;
|
35
|
+
height?: unknown;
|
36
|
+
width?: unknown;
|
37
|
+
className?: unknown;
|
38
|
+
contentClassName?: unknown;
|
39
|
+
contentStyle?: unknown;
|
40
|
+
scrollXName?: unknown;
|
41
|
+
scrollYName?: unknown;
|
42
|
+
groupItemCount?: unknown;
|
43
|
+
preloadItemCount?: unknown;
|
44
|
+
renderAs?: unknown;
|
45
|
+
contentAs?: unknown;
|
46
|
+
scrollOffsetTop?: unknown;
|
47
|
+
scrollPosition?: unknown;
|
48
|
+
abosuteHeight?: unknown;
|
49
|
+
} & {
|
50
|
+
enabled: boolean;
|
51
|
+
width: string | number;
|
52
|
+
height: string | number;
|
53
|
+
list: unknown[];
|
54
|
+
className: string | {
|
55
|
+
[key: string]: any;
|
56
|
+
};
|
57
|
+
minHeight: number;
|
58
|
+
contentClassName: string | {
|
59
|
+
[key: string]: any;
|
60
|
+
};
|
61
|
+
contentStyle: {
|
62
|
+
[key: string]: any;
|
63
|
+
};
|
64
|
+
scrollXName: string;
|
65
|
+
scrollYName: string;
|
66
|
+
groupItemCount: number;
|
67
|
+
preloadItemCount: number;
|
68
|
+
renderAs: string;
|
69
|
+
contentAs: string;
|
70
|
+
scrollOffsetTop: number;
|
71
|
+
scrollPosition: string;
|
72
|
+
abosuteHeight: string | number;
|
73
|
+
} & {
|
74
|
+
lineHeight?: any;
|
75
|
+
}> & ({} | {}))) & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<{
|
76
|
+
list?: unknown;
|
77
|
+
enabled?: unknown;
|
78
|
+
lineHeight?: unknown;
|
79
|
+
minHeight?: unknown;
|
80
|
+
height?: unknown;
|
81
|
+
width?: unknown;
|
82
|
+
className?: unknown;
|
83
|
+
contentClassName?: unknown;
|
84
|
+
contentStyle?: unknown;
|
85
|
+
scrollXName?: unknown;
|
86
|
+
scrollYName?: unknown;
|
87
|
+
groupItemCount?: unknown;
|
88
|
+
preloadItemCount?: unknown;
|
89
|
+
renderAs?: unknown;
|
90
|
+
contentAs?: unknown;
|
91
|
+
scrollOffsetTop?: unknown;
|
92
|
+
scrollPosition?: unknown;
|
93
|
+
abosuteHeight?: unknown;
|
94
|
+
} & {
|
95
|
+
enabled: boolean;
|
96
|
+
width: string | number;
|
97
|
+
height: string | number;
|
98
|
+
list: unknown[];
|
99
|
+
className: string | {
|
100
|
+
[key: string]: any;
|
101
|
+
};
|
102
|
+
minHeight: number;
|
103
|
+
contentClassName: string | {
|
104
|
+
[key: string]: any;
|
105
|
+
};
|
106
|
+
contentStyle: {
|
107
|
+
[key: string]: any;
|
108
|
+
};
|
109
|
+
scrollXName: string;
|
110
|
+
scrollYName: string;
|
111
|
+
groupItemCount: number;
|
112
|
+
preloadItemCount: number;
|
113
|
+
renderAs: string;
|
114
|
+
contentAs: string;
|
115
|
+
scrollOffsetTop: number;
|
116
|
+
scrollPosition: string;
|
117
|
+
abosuteHeight: string | number;
|
118
|
+
} & {
|
119
|
+
lineHeight?: any;
|
120
|
+
}> & ({} | {})), "enabled" | "width" | "height" | "list" | "className" | "minHeight" | "lineHeight" | "contentClassName" | "contentStyle" | "scrollXName" | "scrollYName" | "groupItemCount" | "preloadItemCount" | "renderAs" | "contentAs" | "scrollOffsetTop" | "scrollPosition" | "abosuteHeight">;
|
121
|
+
$attrs: {
|
122
|
+
[x: string]: unknown;
|
123
|
+
};
|
124
|
+
$refs: {
|
125
|
+
[x: string]: unknown;
|
126
|
+
};
|
127
|
+
$slots: Readonly<{
|
128
|
+
[name: string]: import("vue").Slot;
|
129
|
+
}>;
|
130
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
131
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
132
|
+
$emit: ((event: string, ...args: any[]) => void) | ((event: string, ...args: any[]) => void);
|
133
|
+
$el: any;
|
134
|
+
$options: import("vue").ComponentOptionsBase<Readonly<{
|
135
|
+
list?: unknown;
|
136
|
+
enabled?: unknown;
|
137
|
+
lineHeight?: unknown;
|
138
|
+
minHeight?: unknown;
|
139
|
+
height?: unknown;
|
140
|
+
width?: unknown;
|
141
|
+
className?: unknown;
|
142
|
+
contentClassName?: unknown;
|
143
|
+
contentStyle?: unknown;
|
144
|
+
scrollXName?: unknown;
|
145
|
+
scrollYName?: unknown;
|
146
|
+
groupItemCount?: unknown;
|
147
|
+
preloadItemCount?: unknown;
|
148
|
+
renderAs?: unknown;
|
149
|
+
contentAs?: unknown;
|
150
|
+
scrollOffsetTop?: unknown;
|
151
|
+
scrollPosition?: unknown;
|
152
|
+
abosuteHeight?: unknown;
|
153
|
+
} & {
|
154
|
+
enabled: boolean;
|
155
|
+
width: string | number;
|
156
|
+
height: string | number;
|
157
|
+
list: unknown[];
|
158
|
+
className: string | {
|
159
|
+
[key: string]: any;
|
160
|
+
};
|
161
|
+
minHeight: number;
|
162
|
+
contentClassName: string | {
|
163
|
+
[key: string]: any;
|
164
|
+
};
|
165
|
+
contentStyle: {
|
166
|
+
[key: string]: any;
|
167
|
+
};
|
168
|
+
scrollXName: string;
|
169
|
+
scrollYName: string;
|
170
|
+
groupItemCount: number;
|
171
|
+
preloadItemCount: number;
|
172
|
+
renderAs: string;
|
173
|
+
contentAs: string;
|
174
|
+
scrollOffsetTop: number;
|
175
|
+
scrollPosition: string;
|
176
|
+
abosuteHeight: string | number;
|
177
|
+
} & {
|
178
|
+
lineHeight?: any;
|
179
|
+
}> & ({} | {}), () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
180
|
+
[key: string]: any;
|
181
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {
|
182
|
+
enabled: boolean;
|
183
|
+
width: string | number;
|
184
|
+
height: string | number;
|
185
|
+
list: unknown[];
|
186
|
+
className: string | {
|
187
|
+
[key: string]: any;
|
188
|
+
};
|
189
|
+
minHeight: number;
|
190
|
+
lineHeight: any;
|
191
|
+
contentClassName: string | {
|
192
|
+
[key: string]: any;
|
193
|
+
};
|
194
|
+
contentStyle: {
|
195
|
+
[key: string]: any;
|
196
|
+
};
|
197
|
+
scrollXName: string;
|
198
|
+
scrollYName: string;
|
199
|
+
groupItemCount: number;
|
200
|
+
preloadItemCount: number;
|
201
|
+
renderAs: string;
|
202
|
+
contentAs: string;
|
203
|
+
scrollOffsetTop: number;
|
204
|
+
scrollPosition: string;
|
205
|
+
abosuteHeight: string | number;
|
206
|
+
}> & {
|
207
|
+
beforeCreate?: (() => void) | (() => void)[];
|
208
|
+
created?: (() => void) | (() => void)[];
|
209
|
+
beforeMount?: (() => void) | (() => void)[];
|
210
|
+
mounted?: (() => void) | (() => void)[];
|
211
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
212
|
+
updated?: (() => void) | (() => void)[];
|
213
|
+
activated?: (() => void) | (() => void)[];
|
214
|
+
deactivated?: (() => void) | (() => void)[];
|
215
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
216
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
217
|
+
destroyed?: (() => void) | (() => void)[];
|
218
|
+
unmounted?: (() => void) | (() => void)[];
|
219
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
220
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
221
|
+
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)[];
|
222
|
+
};
|
223
|
+
$forceUpdate: () => void;
|
224
|
+
$nextTick: typeof import("vue").nextTick;
|
225
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
|
226
|
+
} & (Readonly<{
|
227
|
+
list?: unknown;
|
228
|
+
enabled?: unknown;
|
229
|
+
lineHeight?: unknown;
|
230
|
+
minHeight?: unknown;
|
231
|
+
height?: unknown;
|
232
|
+
width?: unknown;
|
233
|
+
className?: unknown;
|
234
|
+
contentClassName?: unknown;
|
235
|
+
contentStyle?: unknown;
|
236
|
+
scrollXName?: unknown;
|
237
|
+
scrollYName?: unknown;
|
238
|
+
groupItemCount?: unknown;
|
239
|
+
preloadItemCount?: unknown;
|
240
|
+
renderAs?: unknown;
|
241
|
+
contentAs?: unknown;
|
242
|
+
scrollOffsetTop?: unknown;
|
243
|
+
scrollPosition?: unknown;
|
244
|
+
abosuteHeight?: unknown;
|
245
|
+
} & {
|
246
|
+
enabled: boolean;
|
247
|
+
width: string | number;
|
248
|
+
height: string | number;
|
249
|
+
list: unknown[];
|
250
|
+
className: string | {
|
251
|
+
[key: string]: any;
|
252
|
+
};
|
253
|
+
minHeight: number;
|
254
|
+
contentClassName: string | {
|
255
|
+
[key: string]: any;
|
256
|
+
};
|
257
|
+
contentStyle: {
|
258
|
+
[key: string]: any;
|
259
|
+
};
|
260
|
+
scrollXName: string;
|
261
|
+
scrollYName: string;
|
262
|
+
groupItemCount: number;
|
263
|
+
preloadItemCount: number;
|
264
|
+
renderAs: string;
|
265
|
+
contentAs: string;
|
266
|
+
scrollOffsetTop: number;
|
267
|
+
scrollPosition: string;
|
268
|
+
abosuteHeight: string | number;
|
269
|
+
} & {
|
270
|
+
lineHeight?: any;
|
271
|
+
}> & ({} | {})) & import("vue").ShallowUnwrapRef<() => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
272
|
+
[key: string]: any;
|
273
|
+
}>> & {} & {} & import("vue").ComponentCustomProperties & Readonly<{
|
274
|
+
list?: unknown;
|
275
|
+
enabled?: unknown;
|
276
|
+
lineHeight?: unknown;
|
277
|
+
minHeight?: unknown;
|
278
|
+
height?: unknown;
|
279
|
+
width?: unknown;
|
280
|
+
className?: unknown;
|
281
|
+
contentClassName?: unknown;
|
282
|
+
contentStyle?: unknown;
|
283
|
+
scrollXName?: unknown;
|
284
|
+
scrollYName?: unknown;
|
285
|
+
groupItemCount?: unknown;
|
286
|
+
preloadItemCount?: unknown;
|
287
|
+
renderAs?: unknown;
|
288
|
+
contentAs?: unknown;
|
289
|
+
scrollOffsetTop?: unknown;
|
290
|
+
scrollPosition?: unknown;
|
291
|
+
abosuteHeight?: unknown;
|
292
|
+
} & {
|
293
|
+
enabled: boolean;
|
294
|
+
width: string | number;
|
295
|
+
height: string | number;
|
296
|
+
list: unknown[];
|
297
|
+
className: string | {
|
298
|
+
[key: string]: any;
|
299
|
+
};
|
300
|
+
minHeight: number;
|
301
|
+
contentClassName: string | {
|
302
|
+
[key: string]: any;
|
303
|
+
};
|
304
|
+
contentStyle: {
|
305
|
+
[key: string]: any;
|
306
|
+
};
|
307
|
+
scrollXName: string;
|
308
|
+
scrollYName: string;
|
309
|
+
groupItemCount: number;
|
310
|
+
preloadItemCount: number;
|
311
|
+
renderAs: string;
|
312
|
+
contentAs: string;
|
313
|
+
scrollOffsetTop: number;
|
314
|
+
scrollPosition: string;
|
315
|
+
abosuteHeight: string | number;
|
316
|
+
} & {
|
317
|
+
lineHeight?: any;
|
318
|
+
}> & ({} | {});
|
319
|
+
__isFragment?: never;
|
320
|
+
__isTeleport?: never;
|
321
|
+
__isSuspense?: never;
|
322
|
+
} & import("vue").ComponentOptionsBase<Readonly<{
|
323
|
+
list?: unknown;
|
324
|
+
enabled?: unknown;
|
325
|
+
lineHeight?: unknown;
|
326
|
+
minHeight?: unknown;
|
327
|
+
height?: unknown;
|
328
|
+
width?: unknown;
|
329
|
+
className?: unknown;
|
330
|
+
contentClassName?: unknown;
|
331
|
+
contentStyle?: unknown;
|
332
|
+
scrollXName?: unknown;
|
333
|
+
scrollYName?: unknown;
|
334
|
+
groupItemCount?: unknown;
|
335
|
+
preloadItemCount?: unknown;
|
336
|
+
renderAs?: unknown;
|
337
|
+
contentAs?: unknown;
|
338
|
+
scrollOffsetTop?: unknown;
|
339
|
+
scrollPosition?: unknown;
|
340
|
+
abosuteHeight?: unknown;
|
341
|
+
} & {
|
342
|
+
enabled: boolean;
|
343
|
+
width: string | number;
|
344
|
+
height: string | number;
|
345
|
+
list: unknown[];
|
346
|
+
className: string | {
|
347
|
+
[key: string]: any;
|
348
|
+
};
|
349
|
+
minHeight: number;
|
350
|
+
contentClassName: string | {
|
351
|
+
[key: string]: any;
|
352
|
+
};
|
353
|
+
contentStyle: {
|
354
|
+
[key: string]: any;
|
355
|
+
};
|
356
|
+
scrollXName: string;
|
357
|
+
scrollYName: string;
|
358
|
+
groupItemCount: number;
|
359
|
+
preloadItemCount: number;
|
360
|
+
renderAs: string;
|
361
|
+
contentAs: string;
|
362
|
+
scrollOffsetTop: number;
|
363
|
+
scrollPosition: string;
|
364
|
+
abosuteHeight: string | number;
|
365
|
+
} & {
|
366
|
+
lineHeight?: any;
|
367
|
+
}> & ({} | {}), () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
368
|
+
[key: string]: any;
|
369
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, {
|
370
|
+
enabled: boolean;
|
371
|
+
width: string | number;
|
372
|
+
height: string | number;
|
373
|
+
list: unknown[];
|
374
|
+
className: string | {
|
375
|
+
[key: string]: any;
|
376
|
+
};
|
377
|
+
minHeight: number;
|
378
|
+
lineHeight: any;
|
379
|
+
contentClassName: string | {
|
380
|
+
[key: string]: any;
|
381
|
+
};
|
382
|
+
contentStyle: {
|
383
|
+
[key: string]: any;
|
384
|
+
};
|
385
|
+
scrollXName: string;
|
386
|
+
scrollYName: string;
|
387
|
+
groupItemCount: number;
|
388
|
+
preloadItemCount: number;
|
389
|
+
renderAs: string;
|
390
|
+
contentAs: string;
|
391
|
+
scrollOffsetTop: number;
|
392
|
+
scrollPosition: string;
|
393
|
+
abosuteHeight: string | number;
|
394
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin;
|
395
|
+
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:{}},s={exports:{}},l={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}(l),function(e){var t=l.exports;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(s);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=l.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=s.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")};function y(e,t,o,n){for(var r=0,s=0,l=0,i=0;r<e;r++){if(s+(i=n(r,[r*o,(r+1)*o]))>t){l=t-s;break}s+=i}return{startIndex:r,height:s,diffHeight:l}}function v(e,t,o,n,r){if(n){var s=n.scrollTop,l=o.scrollTop,i=o.count,u=o.groupItemCount,a=o.startIndex,p=o.endIndex,c=n.offsetHeight,f=0,d=0,v=0;if("number"==typeof e&&(f=Math.floor(s/e),d=Math.ceil(c/e)+f,v=s%e),"function"==typeof e){var x=y(i,s,u,e);f=x.startIndex>0?x.startIndex:0,v=x.diffHeight,d=y(i,c,u,e).startIndex+f+1}s===l&&f===a&&d===p||"function"==typeof t&&t(r,f,d,s,v)}}var x=o.throttle((function(e,t,o){return function(e,t,o){var n=o.value,r=n.lineHeight,s=void 0===r?30:r,l=n.handleScrollCallback,i=n.pagination,u=void 0===i?{}:i,a=u.startIndex,p=u.endIndex,c=u.groupItemCount,f=u.count;v(s,l,{scrollTop:u.scrollTop,startIndex:a,endIndex:p,groupItemCount:c,count:f},t,e)}(e,t,o)}),60),m={mounted:function(e,t){var o=e.parentNode;o.addEventListener("scroll",(function(e){x(e,o,t)}))},updated:function(e,t){var o=e.parentNode;x(null,o,t)},unbind:function(e){if(e){var t=e.parentNode;if(!t)return;t.removeEventListener("scroll",x)}}},b=t.defineComponent({name:"bk-virtual-render",directives:{bkVirtualRender:m},props:d,setup:function(e,o){var n=this,r=e.renderAs,s=e.contentAs,l=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:l(e.className)},[null!==(u=null===(i=(n=o.slots).beforeContent)||void 0===i?void 0:i.call(n))&&void 0!==u?u:"",t.h(s,{class:l(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,s){u.startIndex=t,u.endIndex=n,u.scrollTop=r,u.translateY=s,o.emit("content-scroll",[e,u])};t.onMounted((function(){t.nextTick((function(){x(e.list),m()}))})),t.watch((function(){return e.list}),(function(){c(),m()}),{deep:!0}),t.watch((function(){return e.lineHeight}),(function(){c(),m()}));var c=function(){x(e.list)},d=t.reactive(t.ref(0)),y=t.reactive(t.ref(0)),x=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 s=e.lineHeight.call(n,r,t.slice(r*e.groupItemCount,e.groupItemCount));o+="number"==typeof s?s:0}y.value=o}else y.value=e.lineHeight*d.value;else y.value=e.abosuteHeight},m=function(){var t=(i.value||{}).parentNode;v(e.lineHeight,a,u,t,null)},b=t.computed((function(){return(e.list||[]).map((function(e,t){return Object.assign(e,{$index:t})}))})),h=t.computed((function(){return b.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(l(e.className)),["container"===e.scrollPosition?"bk-virtual-content":""])})),C=t.computed((function(){return["content"===e.scrollPosition?"bk-virtual-content":""].concat(p(l(e.contentClassName)))})),H=t.resolveDirective("bkVirtualRender"),O={lineHeight:e.lineHeight,handleScrollCallback:a,pagination:u};return function(){var n,l,u,a,p,c,f,d,y;return t.h(r||"div",{ref:i,class:I.value,style:T.value},[null!==(u=null===(l=(n=o.slots).beforeContent)||void 0===l?void 0:l.call(n))&&void 0!==u?u:"",t.withDirectives(t.h(s||"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:h.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})])}}}),h=o.withInstall(b);e.default=h,Object.defineProperty(e,"__esModule",{value:!0})}));
|
@@ -0,0 +1,147 @@
|
|
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
|
+
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
|
+
}
|