bkui-vue 0.0.1-beta.30 → 0.0.1-beta.33
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 +141 -139
- package/dist/bkui-vue.esm.js +141 -139
- package/dist/bkui-vue.umd.js +141 -139
- package/dist/style.css +154 -3
- package/lib/code-diff/code-diff.css +72 -1
- package/lib/code-diff/code-diff.d.ts +9 -0
- package/lib/code-diff/code-diff.less +94 -1
- package/lib/code-diff/code-diff.variable.css +72 -1
- package/lib/code-diff/index.d.ts +151 -3
- package/lib/code-diff/index.js +1 -0
- package/lib/components.d.ts +1 -1
- package/lib/divider/index.js +1 -1
- package/lib/divider/props.d.ts +21 -0
- package/lib/loading/index.d.ts +27 -10
- package/lib/loading/index.js +1 -1
- package/lib/loading/loading.css +8 -2
- package/lib/loading/loading.d.ts +18 -4
- package/lib/loading/loading.less +10 -10
- package/lib/loading/loading.variable.css +8 -2
- package/lib/pagination/index.d.ts +7 -7
- package/lib/pagination/index.js +1 -1
- package/lib/pagination/pagination.d.ts +2 -2
- package/lib/slider/index.js +2 -2
- package/lib/slider/slider-button.d.ts +5 -0
- package/lib/slider/slider.d.ts +12 -0
- package/lib/styles/index.d.ts +1 -0
- package/lib/styles/index.js +1 -1
- package/lib/tab/index.d.ts +96 -205
- package/lib/tab/index.js +1 -1
- package/lib/tab/props.d.ts +191 -0
- package/lib/tab/tab-nav.d.ts +59 -84
- package/lib/tab/tab-panel.d.ts +39 -14
- package/lib/tab/tab.css +2 -1
- package/lib/tab/tab.d.ts +14 -37
- package/lib/tab/tab.less +2 -1
- package/lib/tab/tab.variable.css +2 -1
- package/lib/table/index.d.ts +29 -9
- package/lib/table/index.js +2 -2
- package/lib/table/props.d.ts +0 -1
- package/lib/table/render.d.ts +10 -3
- package/lib/table/table.d.ts +8 -4
- package/lib/tree/index.d.ts +15 -7
- package/lib/tree/tree.d.ts +6 -16
- package/package.json +1 -1
package/lib/tab/index.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
import TabPanel from './tab-panel';
|
2
|
+
declare const BkTab: {
|
2
3
|
new (...args: any[]): {
|
3
4
|
$: import("vue").ComponentInternalInstance;
|
4
5
|
$data: {};
|
@@ -6,6 +7,7 @@ export declare const BKTab: {
|
|
6
7
|
type: string;
|
7
8
|
closable: boolean;
|
8
9
|
extCls: string;
|
10
|
+
active: string | number;
|
9
11
|
showHeader: boolean;
|
10
12
|
sortType: string;
|
11
13
|
addable: boolean;
|
@@ -17,8 +19,8 @@ export declare const BKTab: {
|
|
17
19
|
changeOnHoverDelay: number;
|
18
20
|
tabPosition: string;
|
19
21
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
20
|
-
active: {
|
21
|
-
|
22
|
+
active: import("vue-types").VueTypeDef<string | number> & {
|
23
|
+
default: string | number;
|
22
24
|
};
|
23
25
|
type: import("vue-types").VueTypeDef<string> & {
|
24
26
|
default: string;
|
@@ -26,21 +28,9 @@ export declare const BKTab: {
|
|
26
28
|
tabPosition: import("vue-types").VueTypeDef<string> & {
|
27
29
|
default: string;
|
28
30
|
};
|
29
|
-
closable:
|
30
|
-
|
31
|
-
|
32
|
-
default: boolean;
|
33
|
-
};
|
34
|
-
addable: import("vue-types").VueTypeValidableDef<boolean> & {
|
35
|
-
default: boolean;
|
36
|
-
} & {
|
37
|
-
default: boolean;
|
38
|
-
};
|
39
|
-
sortable: import("vue-types").VueTypeValidableDef<boolean> & {
|
40
|
-
default: boolean;
|
41
|
-
} & {
|
42
|
-
default: boolean;
|
43
|
-
};
|
31
|
+
closable: BooleanConstructor;
|
32
|
+
addable: BooleanConstructor;
|
33
|
+
sortable: BooleanConstructor;
|
44
34
|
sortType: import("vue-types").VueTypeDef<string> & {
|
45
35
|
default: string;
|
46
36
|
};
|
@@ -85,13 +75,13 @@ export declare const BKTab: {
|
|
85
75
|
onAdd?: (...args: any[]) => any;
|
86
76
|
"onAdd-panel"?: (...args: any[]) => any;
|
87
77
|
"onTab-change"?: (...args: any[]) => any;
|
88
|
-
"
|
78
|
+
"onRemove-panel"?: (...args: any[]) => any;
|
89
79
|
"onSort-change"?: (...args: any[]) => any;
|
90
80
|
"onOn-drag-tab"?: (...args: any[]) => any;
|
91
81
|
onRemove?: (...args: any[]) => any;
|
92
82
|
"onUpdate:active"?: (...args: any[]) => any;
|
93
83
|
onSort?: (...args: any[]) => any;
|
94
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "type" | "closable" | "extCls" | "showHeader" | "sortType" | "addable" | "sortable" | "labelHeight" | "scrollStep" | "validateActive" | "changeOnHover" | "changeOnHoverDelay" | "tabPosition">;
|
84
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "type" | "closable" | "extCls" | "active" | "showHeader" | "sortType" | "addable" | "sortable" | "labelHeight" | "scrollStep" | "validateActive" | "changeOnHover" | "changeOnHoverDelay" | "tabPosition">;
|
95
85
|
$attrs: {
|
96
86
|
[x: string]: unknown;
|
97
87
|
};
|
@@ -103,11 +93,11 @@ export declare const BKTab: {
|
|
103
93
|
}>;
|
104
94
|
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
105
95
|
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
106
|
-
$emit: (event: "change" | "drag" | "add" | "add-panel" | "tab-change" | "
|
96
|
+
$emit: (event: "change" | "drag" | "add" | "add-panel" | "tab-change" | "remove-panel" | "sort-change" | "on-drag-tab" | "remove" | "update:active" | "sort", ...args: any[]) => void;
|
107
97
|
$el: any;
|
108
98
|
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
109
|
-
active: {
|
110
|
-
|
99
|
+
active: import("vue-types").VueTypeDef<string | number> & {
|
100
|
+
default: string | number;
|
111
101
|
};
|
112
102
|
type: import("vue-types").VueTypeDef<string> & {
|
113
103
|
default: string;
|
@@ -115,21 +105,9 @@ export declare const BKTab: {
|
|
115
105
|
tabPosition: import("vue-types").VueTypeDef<string> & {
|
116
106
|
default: string;
|
117
107
|
};
|
118
|
-
closable:
|
119
|
-
|
120
|
-
|
121
|
-
default: boolean;
|
122
|
-
};
|
123
|
-
addable: import("vue-types").VueTypeValidableDef<boolean> & {
|
124
|
-
default: boolean;
|
125
|
-
} & {
|
126
|
-
default: boolean;
|
127
|
-
};
|
128
|
-
sortable: import("vue-types").VueTypeValidableDef<boolean> & {
|
129
|
-
default: boolean;
|
130
|
-
} & {
|
131
|
-
default: boolean;
|
132
|
-
};
|
108
|
+
closable: BooleanConstructor;
|
109
|
+
addable: BooleanConstructor;
|
110
|
+
sortable: BooleanConstructor;
|
133
111
|
sortType: import("vue-types").VueTypeDef<string> & {
|
134
112
|
default: string;
|
135
113
|
};
|
@@ -174,7 +152,7 @@ export declare const BKTab: {
|
|
174
152
|
onAdd?: (...args: any[]) => any;
|
175
153
|
"onAdd-panel"?: (...args: any[]) => any;
|
176
154
|
"onTab-change"?: (...args: any[]) => any;
|
177
|
-
"
|
155
|
+
"onRemove-panel"?: (...args: any[]) => any;
|
178
156
|
"onSort-change"?: (...args: any[]) => any;
|
179
157
|
"onOn-drag-tab"?: (...args: any[]) => any;
|
180
158
|
onRemove?: (...args: any[]) => any;
|
@@ -187,12 +165,13 @@ export declare const BKTab: {
|
|
187
165
|
tabAdd(e: MouseEvent): void;
|
188
166
|
tabChange(name: string): void;
|
189
167
|
tabRemove(index: number, panel: any): void;
|
190
|
-
tabSort(dragTabIndex: number, dropTabIndex: number):
|
168
|
+
tabSort(dragTabIndex: number, dropTabIndex: number, sortType: string): false;
|
191
169
|
tabDrag(dragTabIndex: number, dragEvent: DragEvent): void;
|
192
|
-
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "drag" | "add" | "add-panel" | "tab-change" | "
|
170
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "drag" | "add" | "add-panel" | "tab-change" | "remove-panel" | "sort-change" | "on-drag-tab" | "remove" | "update:active" | "sort")[], string, {
|
193
171
|
type: string;
|
194
172
|
closable: boolean;
|
195
173
|
extCls: string;
|
174
|
+
active: string | number;
|
196
175
|
showHeader: boolean;
|
197
176
|
sortType: string;
|
198
177
|
addable: boolean;
|
@@ -224,8 +203,8 @@ export declare const BKTab: {
|
|
224
203
|
$nextTick: typeof import("vue").nextTick;
|
225
204
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean>): import("vue").WatchStopHandle;
|
226
205
|
} & Readonly<import("vue").ExtractPropTypes<{
|
227
|
-
active: {
|
228
|
-
|
206
|
+
active: import("vue-types").VueTypeDef<string | number> & {
|
207
|
+
default: string | number;
|
229
208
|
};
|
230
209
|
type: import("vue-types").VueTypeDef<string> & {
|
231
210
|
default: string;
|
@@ -233,21 +212,9 @@ export declare const BKTab: {
|
|
233
212
|
tabPosition: import("vue-types").VueTypeDef<string> & {
|
234
213
|
default: string;
|
235
214
|
};
|
236
|
-
closable:
|
237
|
-
|
238
|
-
|
239
|
-
default: boolean;
|
240
|
-
};
|
241
|
-
addable: import("vue-types").VueTypeValidableDef<boolean> & {
|
242
|
-
default: boolean;
|
243
|
-
} & {
|
244
|
-
default: boolean;
|
245
|
-
};
|
246
|
-
sortable: import("vue-types").VueTypeValidableDef<boolean> & {
|
247
|
-
default: boolean;
|
248
|
-
} & {
|
249
|
-
default: boolean;
|
250
|
-
};
|
215
|
+
closable: BooleanConstructor;
|
216
|
+
addable: BooleanConstructor;
|
217
|
+
sortable: BooleanConstructor;
|
251
218
|
sortType: import("vue-types").VueTypeDef<string> & {
|
252
219
|
default: string;
|
253
220
|
};
|
@@ -292,7 +259,7 @@ export declare const BKTab: {
|
|
292
259
|
onAdd?: (...args: any[]) => any;
|
293
260
|
"onAdd-panel"?: (...args: any[]) => any;
|
294
261
|
"onTab-change"?: (...args: any[]) => any;
|
295
|
-
"
|
262
|
+
"onRemove-panel"?: (...args: any[]) => any;
|
296
263
|
"onSort-change"?: (...args: any[]) => any;
|
297
264
|
"onOn-drag-tab"?: (...args: any[]) => any;
|
298
265
|
onRemove?: (...args: any[]) => any;
|
@@ -305,15 +272,15 @@ export declare const BKTab: {
|
|
305
272
|
tabAdd(e: MouseEvent): void;
|
306
273
|
tabChange(name: string): void;
|
307
274
|
tabRemove(index: number, panel: any): void;
|
308
|
-
tabSort(dragTabIndex: number, dropTabIndex: number):
|
275
|
+
tabSort(dragTabIndex: number, dropTabIndex: number, sortType: string): false;
|
309
276
|
tabDrag(dragTabIndex: number, dragEvent: DragEvent): void;
|
310
277
|
} & import("vue").ComponentCustomProperties;
|
311
278
|
__isFragment?: never;
|
312
279
|
__isTeleport?: never;
|
313
280
|
__isSuspense?: never;
|
314
281
|
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
315
|
-
active: {
|
316
|
-
|
282
|
+
active: import("vue-types").VueTypeDef<string | number> & {
|
283
|
+
default: string | number;
|
317
284
|
};
|
318
285
|
type: import("vue-types").VueTypeDef<string> & {
|
319
286
|
default: string;
|
@@ -321,21 +288,9 @@ export declare const BKTab: {
|
|
321
288
|
tabPosition: import("vue-types").VueTypeDef<string> & {
|
322
289
|
default: string;
|
323
290
|
};
|
324
|
-
closable:
|
325
|
-
|
326
|
-
|
327
|
-
default: boolean;
|
328
|
-
};
|
329
|
-
addable: import("vue-types").VueTypeValidableDef<boolean> & {
|
330
|
-
default: boolean;
|
331
|
-
} & {
|
332
|
-
default: boolean;
|
333
|
-
};
|
334
|
-
sortable: import("vue-types").VueTypeValidableDef<boolean> & {
|
335
|
-
default: boolean;
|
336
|
-
} & {
|
337
|
-
default: boolean;
|
338
|
-
};
|
291
|
+
closable: BooleanConstructor;
|
292
|
+
addable: BooleanConstructor;
|
293
|
+
sortable: BooleanConstructor;
|
339
294
|
sortType: import("vue-types").VueTypeDef<string> & {
|
340
295
|
default: string;
|
341
296
|
};
|
@@ -380,7 +335,7 @@ export declare const BKTab: {
|
|
380
335
|
onAdd?: (...args: any[]) => any;
|
381
336
|
"onAdd-panel"?: (...args: any[]) => any;
|
382
337
|
"onTab-change"?: (...args: any[]) => any;
|
383
|
-
"
|
338
|
+
"onRemove-panel"?: (...args: any[]) => any;
|
384
339
|
"onSort-change"?: (...args: any[]) => any;
|
385
340
|
"onOn-drag-tab"?: (...args: any[]) => any;
|
386
341
|
onRemove?: (...args: any[]) => any;
|
@@ -393,12 +348,13 @@ export declare const BKTab: {
|
|
393
348
|
tabAdd(e: MouseEvent): void;
|
394
349
|
tabChange(name: string): void;
|
395
350
|
tabRemove(index: number, panel: any): void;
|
396
|
-
tabSort(dragTabIndex: number, dropTabIndex: number):
|
351
|
+
tabSort(dragTabIndex: number, dropTabIndex: number, sortType: string): false;
|
397
352
|
tabDrag(dragTabIndex: number, dragEvent: DragEvent): void;
|
398
|
-
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "drag" | "add" | "add-panel" | "tab-change" | "
|
353
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "drag" | "add" | "add-panel" | "tab-change" | "remove-panel" | "sort-change" | "on-drag-tab" | "remove" | "update:active" | "sort")[], "change" | "drag" | "sort" | "add" | "add-panel" | "tab-change" | "remove-panel" | "sort-change" | "on-drag-tab" | "remove" | "update:active", {
|
399
354
|
type: string;
|
400
355
|
closable: boolean;
|
401
356
|
extCls: string;
|
357
|
+
active: string | number;
|
402
358
|
showHeader: boolean;
|
403
359
|
sortType: string;
|
404
360
|
addable: boolean;
|
@@ -409,101 +365,50 @@ export declare const BKTab: {
|
|
409
365
|
changeOnHover: boolean;
|
410
366
|
changeOnHoverDelay: number;
|
411
367
|
tabPosition: string;
|
412
|
-
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
$data: {};
|
417
|
-
$props: Partial<{
|
418
|
-
visible: boolean;
|
419
|
-
disabled: boolean;
|
420
|
-
renderDirective: string;
|
421
|
-
}> & Omit<Readonly<import("vue").ExtractPropTypes<{
|
422
|
-
name: {
|
423
|
-
type: NumberConstructor | StringConstructor;
|
424
|
-
};
|
425
|
-
label: StringConstructor | FunctionConstructor;
|
426
|
-
closable: BooleanConstructor | FunctionConstructor;
|
427
|
-
visible: import("vue-types").VueTypeValidableDef<boolean> & {
|
428
|
-
default: boolean;
|
429
|
-
} & {
|
430
|
-
default: boolean;
|
431
|
-
};
|
432
|
-
disabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
433
|
-
default: boolean;
|
434
|
-
} & {
|
435
|
-
default: boolean;
|
436
|
-
};
|
437
|
-
sortable: BooleanConstructor | FunctionConstructor;
|
438
|
-
renderDirective: import("vue-types").VueTypeDef<string> & {
|
439
|
-
default: string;
|
440
|
-
};
|
441
|
-
panel: StringConstructor | FunctionConstructor;
|
442
|
-
}>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "visible" | "disabled" | "renderDirective">;
|
443
|
-
$attrs: {
|
444
|
-
[x: string]: unknown;
|
368
|
+
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin & Readonly<{
|
369
|
+
TabPanel: import("vue").DefineComponent<{
|
370
|
+
name: import("vue-types").VueTypeDef<string | number> & {
|
371
|
+
default: string | number;
|
445
372
|
};
|
446
|
-
|
447
|
-
|
373
|
+
label: (import("vue-types").VueTypeValidableDef<string> & {
|
374
|
+
default: string;
|
375
|
+
}) | (import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
376
|
+
default: (...args: any[]) => any;
|
377
|
+
});
|
378
|
+
closable: import("vue-types").VueTypeValidableDef<boolean> & {
|
379
|
+
default: boolean;
|
448
380
|
};
|
449
|
-
|
450
|
-
|
451
|
-
}
|
452
|
-
|
453
|
-
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>>;
|
454
|
-
$emit: (event: string, ...args: any[]) => void;
|
455
|
-
$el: any;
|
456
|
-
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
|
457
|
-
name: {
|
458
|
-
type: NumberConstructor | StringConstructor;
|
459
|
-
};
|
460
|
-
label: StringConstructor | FunctionConstructor;
|
461
|
-
closable: BooleanConstructor | FunctionConstructor;
|
462
|
-
visible: import("vue-types").VueTypeValidableDef<boolean> & {
|
463
|
-
default: boolean;
|
464
|
-
} & {
|
465
|
-
default: boolean;
|
466
|
-
};
|
467
|
-
disabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
468
|
-
default: boolean;
|
469
|
-
} & {
|
470
|
-
default: boolean;
|
471
|
-
};
|
472
|
-
sortable: BooleanConstructor | FunctionConstructor;
|
473
|
-
renderDirective: import("vue-types").VueTypeDef<string> & {
|
474
|
-
default: string;
|
475
|
-
};
|
476
|
-
panel: StringConstructor | FunctionConstructor;
|
477
|
-
}>>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
478
|
-
visible: boolean;
|
479
|
-
disabled: boolean;
|
480
|
-
renderDirective: string;
|
481
|
-
}> & {
|
482
|
-
beforeCreate?: (() => void) | (() => void)[];
|
483
|
-
created?: (() => void) | (() => void)[];
|
484
|
-
beforeMount?: (() => void) | (() => void)[];
|
485
|
-
mounted?: (() => void) | (() => void)[];
|
486
|
-
beforeUpdate?: (() => void) | (() => void)[];
|
487
|
-
updated?: (() => void) | (() => void)[];
|
488
|
-
activated?: (() => void) | (() => void)[];
|
489
|
-
deactivated?: (() => void) | (() => void)[];
|
490
|
-
beforeDestroy?: (() => void) | (() => void)[];
|
491
|
-
beforeUnmount?: (() => void) | (() => void)[];
|
492
|
-
destroyed?: (() => void) | (() => void)[];
|
493
|
-
unmounted?: (() => void) | (() => void)[];
|
494
|
-
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
495
|
-
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
496
|
-
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)[];
|
381
|
+
visible: import("vue-types").VueTypeValidableDef<boolean> & {
|
382
|
+
default: boolean;
|
383
|
+
} & {
|
384
|
+
default: boolean;
|
497
385
|
};
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
386
|
+
disabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
387
|
+
default: boolean;
|
388
|
+
};
|
389
|
+
sortable: import("vue-types").VueTypeValidableDef<boolean> & {
|
390
|
+
default: boolean;
|
391
|
+
};
|
392
|
+
renderDirective: import("vue-types").VueTypeDef<string> & {
|
393
|
+
default: string;
|
394
|
+
};
|
395
|
+
panel: (import("vue-types").VueTypeValidableDef<string> & {
|
396
|
+
default: string;
|
397
|
+
}) | (import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
398
|
+
default: (...args: any[]) => any;
|
399
|
+
});
|
400
|
+
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
401
|
+
name: import("vue-types").VueTypeDef<string | number> & {
|
402
|
+
default: string | number;
|
403
|
+
};
|
404
|
+
label: (import("vue-types").VueTypeValidableDef<string> & {
|
405
|
+
default: string;
|
406
|
+
}) | (import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
407
|
+
default: (...args: any[]) => any;
|
408
|
+
});
|
409
|
+
closable: import("vue-types").VueTypeValidableDef<boolean> & {
|
410
|
+
default: boolean;
|
504
411
|
};
|
505
|
-
label: StringConstructor | FunctionConstructor;
|
506
|
-
closable: BooleanConstructor | FunctionConstructor;
|
507
412
|
visible: import("vue-types").VueTypeValidableDef<boolean> & {
|
508
413
|
default: boolean;
|
509
414
|
} & {
|
@@ -511,42 +416,28 @@ export declare const BKTabPanel: {
|
|
511
416
|
};
|
512
417
|
disabled: import("vue-types").VueTypeValidableDef<boolean> & {
|
513
418
|
default: boolean;
|
514
|
-
}
|
419
|
+
};
|
420
|
+
sortable: import("vue-types").VueTypeValidableDef<boolean> & {
|
515
421
|
default: boolean;
|
516
422
|
};
|
517
|
-
sortable: BooleanConstructor | FunctionConstructor;
|
518
423
|
renderDirective: import("vue-types").VueTypeDef<string> & {
|
519
424
|
default: string;
|
520
425
|
};
|
521
|
-
panel:
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
}
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
} & {
|
540
|
-
default: boolean;
|
541
|
-
};
|
542
|
-
sortable: BooleanConstructor | FunctionConstructor;
|
543
|
-
renderDirective: import("vue-types").VueTypeDef<string> & {
|
544
|
-
default: string;
|
545
|
-
};
|
546
|
-
panel: StringConstructor | FunctionConstructor;
|
547
|
-
}>>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
|
548
|
-
visible: boolean;
|
549
|
-
disabled: boolean;
|
550
|
-
renderDirective: string;
|
551
|
-
}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("@vue/runtime-core").Plugin;
|
552
|
-
export default BKTab;
|
426
|
+
panel: (import("vue-types").VueTypeValidableDef<string> & {
|
427
|
+
default: string;
|
428
|
+
}) | (import("vue-types").VueTypeValidableDef<(...args: any[]) => any> & {
|
429
|
+
default: (...args: any[]) => any;
|
430
|
+
});
|
431
|
+
}>>, {
|
432
|
+
name: string | number;
|
433
|
+
label: string | ((...args: any[]) => any);
|
434
|
+
closable: boolean;
|
435
|
+
visible: boolean;
|
436
|
+
disabled: boolean;
|
437
|
+
panel: string | ((...args: any[]) => any);
|
438
|
+
sortable: boolean;
|
439
|
+
renderDirective: string;
|
440
|
+
}>;
|
441
|
+
}>;
|
442
|
+
export { BkTab, TabPanel as BkTabPanel, };
|
443
|
+
export default BkTab;
|
package/lib/tab/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue"),require("../icon/")):"function"==typeof define&&define.amd?define(["exports","../shared","vue","../icon/"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue,e._)}(this,(function(e,t,n,a){"use strict";var
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("../shared"),require("vue"),require("../icon/")):"function"==typeof define&&define.amd?define(["exports","../shared","vue","../icon/"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Shared,e.Vue,e._)}(this,(function(e,t,n,a){"use strict";var o={tabAdd:{type:Function,default:function(){return{}}},tabChange:{type:Function,default:function(e){return e}},tabRemove:{type:Function,default:function(e){return e}},tabSort:{type:Function,default:function(){return{}}},tabDrag:{type:Function,default:function(){return{}}}},r={active:t.PropTypes.oneOfType([t.PropTypes.number,t.PropTypes.string]).def(""),type:t.PropTypes.commonType(["card","border-card","unborder-card"],"type").def("border-card"),tabPosition:t.PropTypes.commonType(["left","right","top"],"position").def("top"),closable:Boolean,addable:Boolean,sortable:Boolean,sortType:t.PropTypes.commonType(["replace","insert","top"],"sortType").def("replace"),labelHeight:t.PropTypes.number.def(50),scrollStep:t.PropTypes.number.def(200),extCls:t.PropTypes.string.def(""),validateActive:t.PropTypes.bool.def(!0),showHeader:t.PropTypes.bool.def(!0),changeOnHover:t.PropTypes.bool.def(!1),changeOnHoverDelay:t.PropTypes.number.def(1e3)},i=Object.assign({active:t.PropTypes.oneOfType([t.PropTypes.number,t.PropTypes.string]).def(""),panels:{type:Array,default:function(){return[]}},closable:Boolean,addable:Boolean,sortable:Boolean,sortType:t.PropTypes.commonType(["replace","insert","top"],"sortType").def("replace"),labelHeight:t.PropTypes.number.def(50),scrollStep:t.PropTypes.number.def(200),validateActive:t.PropTypes.bool.def(!0),changeOnHover:t.PropTypes.bool.def(!1),changeOnHoverDelay:t.PropTypes.number.def(1e3)},o),s={name:t.PropTypes.oneOfType([t.PropTypes.number,t.PropTypes.string]).def(""),label:t.PropTypes.string||t.PropTypes.func,closable:t.PropTypes.bool,visible:t.PropTypes.bool.def(!0),disabled:t.PropTypes.bool,sortable:t.PropTypes.bool,renderDirective:t.PropTypes.commonType(["if","show"],"render").def("show"),panel:t.PropTypes.string||t.PropTypes.func},l=n.defineComponent({name:"TabNav",props:i,setup:function(e){return{navs:n.computed((function(){if(!Array.isArray(e.panels)||!e.panels.length)return[];var t=[],a=!1;return e.panels.filter((function(o,r){if(!o.props)return null;var i=o.props,s=i.name,l=i.label,d=i.closable,p=i.visible,c=i.disabled,u=i.sortable;if(!p)return!1;e.active===s&&(a=!0);return t.push({name:s,closable:d,visible:p,disabled:c,sortable:u,tabLabel:function(e){return o.slots.label?n.h(o.slots.label):[void 0,""].includes(e)?"选项卡".concat(r+1):"string"==typeof e?e:"function"==typeof e?n.h(e):e}(l)}),!0})),!a&&e.validateActive&&e.panels[0].props&&e.tabChange(e.panels[0].props.name),t})),dragenterIndex:n.ref(-1),dragStartIndex:n.ref(-1),draggingEle:n.ref(""),guid:Math.random().toString(16).substr(4)+Math.random().toString(16).substr(4)}},methods:{distinctRoots:function(e,t){return e===t},handleTabAdd:function(e){this.tabAdd(e)},dragstart:function(e,t){this.dragStartIndex=e,this.draggingEle=this.guid,Object.assign(t.dataTransfer,{effectAllowed:"move"}),this.tabDrag(e,t)},dragenter:function(e){this.distinctRoots(this.draggingEle,this.guid)&&(this.dragenterIndex=e)},dragend:function(){this.dragenterIndex=-1,this.dragStartIndex=-1,this.draggingEle=null},drop:function(e,t){if(!this.distinctRoots(this.draggingEle,this.guid))return!1;this.tabSort(this.dragStartIndex,e,t)},handleTabChange:function(e){this.tabChange(e)},handleTabRemove:function(e,t){this.tabRemove(e,t)}},render:function(){var e,t,o,r,i,s=this,l=this.active,d=this.closable,p=this.addable,c=this.sortable,u=this.sortType,b=this.labelHeight,f=this.dragstart,h=this.dragenter,v=this.dragend,g=this.drop;return n.createVNode("div",{style:{lineHeight:"".concat(b,"px")},class:"bk-tab-header"},[n.createVNode("div",{class:"bk-tab-header-nav"},[s.navs.map((function(e,t){if(!e)return null;var o,r=e.name,i=e.disabled,p=e.tabLabel,b=function(e,t){return e||t};return n.createVNode("div",{key:r,onClick:function(){return s.handleTabChange(r)},draggable:b(e.sortable,c),onDragstart:function(e){return f(t,e)},onDragenter:function(e){e.preventDefault(),h(t)},onDragleave:function(e){e.preventDefault()},onDragover:function(e){e.preventDefault()},onDragend:function(e){e.preventDefault(),v()},onDrop:function(e){e.preventDefault(),g(t,u)},class:(o=["bk-tab-header-item"],i&&o.push("bk-tab-header--disabled"),l===r&&o.push("bk-tab-header--active"),o.join(" "))},[n.createVNode("div",null,[p]),b(e.closable,d)&&n.createVNode(a.Close,{class:"bk-tab-header-item-close",onClick:function(){return s.handleTabRemove(t,e)}},null)])}))]),(i=[],"function"==typeof s.$slots.add?i.push(null===(t=(e=s.$slots).add)||void 0===t?void 0:t.call(e,n.h)):p&&i.push(n.createVNode("div",{onClick:s.handleTabAdd},[n.createVNode(a.Plus,{width:26,height:26},null)])),"function"==typeof s.$slots.setting&&i.push(null===(r=(o=s.$slots).setting)||void 0===r?void 0:r.call(o,n.h)),i.length?n.createVNode("div",{class:"bk-tab-header-operation"},[i.map((function(e,t){return n.createVNode("div",{class:"bk-tab-header-item",key:t},[e])}))]):null)])}}),d=n.defineComponent({name:"Tab",components:{TabNav:l},props:r,emits:["add-panel","tab-change","remove-panel","sort-change","on-drag-tab","add","change","remove","update:active","sort","drag"],setup:function(e,t){var a=t.slots,o=n.ref(!1),r=n.ref([]),i=n.getCurrentInstance();"function"==typeof a.panel&&(r.value=a.panel()),"function"==typeof a.default&&(r.value=a.default());var s=function e(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=t.children;return(o||[]).forEach((function(t){var o=t.type;"TabPanel"===(o=o.name||o)&&t.component?a.push(t.component):o!==n.Fragment&&"template"!==o||e(t,a)})),a},l=function(){if(a.default){var e=i.subTree.children[1].children;if(!e)return;var t=e[0],n=s(t);!(n.length===r.value.length&&n.every((function(e,t){return e.uid===r.value[t].uid})))&&(r.value=n)}};return n.onMounted((function(){l(),o.value=!0})),n.onUpdated((function(){l()})),{isMounted:o,panels:r}},methods:{tabAdd:function(e){this.$emit("add",{e:e}),this.$emit("add-panel",{e:e})},tabChange:function(e){this.$emit("change",e),this.$emit("tab-change",e),this.$emit("update:active",e)},tabRemove:function(e,t){this.$emit("remove",e,t),this.$emit("remove-panel",e,t)},tabSort:function(e,t,n){if("insert"===n)if(e<t)this.panels.splice(t+1,0,this.panels[e]),this.panels.splice(e,1);else{if(!(e>t))return!1;this.panels.splice(t,0,this.panels[e]),this.panels.splice(e+1,1)}else{var a=this.panels[t];this.panels[t]=this.panels[e],this.panels[e]=a}this.$emit("sort",e,t,n),this.$emit("sort-change",e,t,n)},tabDrag:function(e,t){this.$emit("drag",e,t),this.$emit("on-drag-tab",e,t)}},render:function(){var e,t,a,o,r=this;return n.createVNode("div",{class:"top"===r.tabPosition?"bk-tab bk-tab--".concat(r.tabPosition," bk-tab--").concat(r.type," ").concat(r.extCls):"bk-tab bk-tab--".concat(r.tabPosition," ").concat(r.extCls)},[(a=r.panels,o={panels:a,active:r.active,type:r.type,closable:r.closable,addable:r.addable,sortable:r.sortable,sortType:r.sortType,labelHeight:r.labelHeight,scrollStep:r.scrollStep,validateActive:r.validateActive,changeOnHover:r.changeOnHover,changeOnHoverDelay:r.changeOnHoverDelay,tabAdd:r.tabAdd,tabChange:r.tabChange,tabRemove:r.tabRemove,tabSort:r.tabSort,tabDrag:r.tabDrag},a&&Array.isArray(a)?n.createVNode(l,o,r.$slots):null),n.createVNode("div",{class:"bk-tab-content"},[null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e)])])}}),p=n.defineComponent({name:"TabPanel",props:s,render:function(){var e=this,t=this.name===this.$parent.active;return n.withDirectives(n.createVNode("div",{ref:"content",class:"bk-tab-panel"},[!e.visible||"if"===e.renderDirective&&!t?null:"function"==typeof e.panel?e.panel(n.h):"function"==typeof e.$slots.default?e.$slots.default(null):"function"==typeof e.$slots.panel?e.$slots.panel(null):null]),[[n.vShow,t]])}}),c=t.withInstallProps(d,{TabPanel:p});e.BkTab=c,e.BkTabPanel=p,e.default=c,Object.defineProperty(e,"__esModule",{value:!0})}));
|