bkui-vue 0.0.1-beta.340 → 0.0.1-beta.341
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/index.cjs.js +50 -50
- package/dist/index.esm.js +280 -116
- package/dist/index.umd.js +49 -49
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/affix.d.ts +1 -1
- package/lib/affix/index.d.ts +4 -4
- package/lib/alert/alert.d.ts +5 -5
- package/lib/alert/index.d.ts +11 -11
- package/lib/alert/index.js +1 -1
- package/lib/animate-number/animate-number.d.ts +1 -1
- package/lib/animate-number/index.d.ts +4 -4
- package/lib/backtop/backtop.d.ts +1 -1
- package/lib/backtop/index.d.ts +4 -4
- package/lib/button/button-group.d.ts +2 -2
- package/lib/button/button.d.ts +29 -30
- package/lib/button/index.d.ts +45 -48
- package/lib/button/index.js +1 -1
- package/lib/cascader/cascader.d.ts +1 -1
- package/lib/cascader/index.d.ts +4 -4
- package/lib/checkbox/checkbox.d.ts +8 -8
- package/lib/checkbox/index.d.ts +14 -14
- package/lib/checkbox/index.js +1 -1
- package/lib/code-diff/code-diff.css +27 -7
- package/lib/code-diff/code-diff.less +42 -7
- package/lib/code-diff/code-diff.variable.css +27 -7
- package/lib/collapse/collapse-panel.d.ts +2 -7
- package/lib/collapse/index.d.ts +2 -7
- package/lib/collapse/index.js +1 -1
- package/lib/collapse/props.d.ts +1 -43
- package/lib/color-picker/color-picker.d.ts +7 -7
- package/lib/color-picker/index.d.ts +12 -12
- package/lib/color-picker/index.js +1 -1
- package/lib/date-picker/date-picker.d.ts +7 -7
- package/lib/date-picker/index.d.ts +18 -18
- package/lib/date-picker/panel/date-range.d.ts +1 -1
- package/lib/date-picker/panel/date.d.ts +1 -1
- package/lib/date-picker/panel/time-range.d.ts +7 -7
- package/lib/date-picker/panel/time.d.ts +8 -8
- package/lib/date-picker/props.d.ts +2 -2
- package/lib/date-picker/time-picker.d.ts +7 -7
- package/lib/dialog/dialog.d.ts +21 -46
- package/lib/dialog/index.d.ts +46 -101
- package/lib/dialog/index.js +1 -1
- package/lib/dialog/props.d.ts +9 -19
- package/lib/divider/divider.d.ts +15 -15
- package/lib/divider/index.d.ts +34 -34
- package/lib/divider/index.js +1 -1
- package/lib/divider/props.d.ts +6 -6
- package/lib/dropdown/dropdown.d.ts +17 -17
- package/lib/dropdown/index.d.ts +24 -24
- package/lib/dropdown/index.js +1 -1
- package/lib/exception/exception.d.ts +10 -10
- package/lib/exception/index.d.ts +22 -22
- package/lib/exception/index.js +1 -1
- package/lib/icon/angle-double-down-line.js +1 -1
- package/lib/icon/angle-double-left-line.js +1 -1
- package/lib/icon/angle-double-left.js +1 -1
- package/lib/icon/angle-double-right-line.js +1 -1
- package/lib/icon/angle-double-right.js +1 -1
- package/lib/icon/angle-double-up-line.js +1 -1
- package/lib/icon/angle-down-fill.js +1 -1
- package/lib/icon/angle-down-line.js +1 -1
- package/lib/icon/angle-down.js +1 -1
- package/lib/icon/angle-left.js +1 -1
- package/lib/icon/angle-right.js +1 -1
- package/lib/icon/angle-up-fill.js +1 -1
- package/lib/icon/angle-up.js +1 -1
- package/lib/icon/archive-fill.js +1 -1
- package/lib/icon/arrows-left.js +1 -1
- package/lib/icon/arrows-right.js +1 -1
- package/lib/icon/audio-fill.js +1 -1
- package/lib/icon/bk.js +1 -1
- package/lib/icon/circle.js +1 -1
- package/lib/icon/close-line.js +1 -1
- package/lib/icon/close.js +1 -1
- package/lib/icon/code.js +1 -1
- package/lib/icon/cog-shape.js +1 -1
- package/lib/icon/collapse-left.js +1 -1
- package/lib/icon/copy.js +1 -1
- package/lib/icon/data-shape.js +1 -1
- package/lib/icon/del.js +1 -1
- package/lib/icon/doc-fill.js +1 -1
- package/lib/icon/done.js +1 -1
- package/lib/icon/down-shape.js +1 -1
- package/lib/icon/down-small.js +1 -1
- package/lib/icon/edit-line.js +1 -1
- package/lib/icon/ellipsis.js +1 -1
- package/lib/icon/enlarge-line.js +1 -1
- package/lib/icon/error.js +1 -1
- package/lib/icon/excel-fill.js +1 -1
- package/lib/icon/exclamation-circle-shape.js +1 -1
- package/lib/icon/eye.js +1 -1
- package/lib/icon/filliscreen-line.js +1 -1
- package/lib/icon/folder-open.js +1 -1
- package/lib/icon/folder-shape-open.js +1 -1
- package/lib/icon/folder-shape.js +1 -1
- package/lib/icon/folder.js +1 -1
- package/lib/icon/funnel.js +1 -1
- package/lib/icon/help-document-fill.js +1 -1
- package/lib/icon/help-fill.js +1 -1
- package/lib/icon/help.js +1 -1
- package/lib/icon/img-error.js +1 -1
- package/lib/icon/img-placehoulder.js +1 -1
- package/lib/icon/index.d.ts +1 -1
- package/lib/icon/index.js +1 -1
- package/lib/icon/info-line.js +1 -1
- package/lib/icon/info.js +1 -1
- package/lib/icon/left-shape.js +1 -1
- package/lib/icon/left-turn-line.js +1 -1
- package/lib/icon/narrow-line.js +1 -1
- package/lib/icon/{original .d.ts → original.d.ts} +0 -0
- package/lib/icon/original.js +1 -0
- package/lib/icon/pdf-fill.js +1 -1
- package/lib/icon/play-shape.js +1 -1
- package/lib/icon/plus.js +1 -1
- package/lib/icon/ppt-fill.js +1 -1
- package/lib/icon/qq.js +1 -1
- package/lib/icon/right-shape.js +1 -1
- package/lib/icon/right-turn-line.js +1 -1
- package/lib/icon/search.js +1 -1
- package/lib/icon/share.js +1 -1
- package/lib/icon/spinner.js +1 -1
- package/lib/icon/success.js +1 -1
- package/lib/icon/switcher-loading.js +1 -1
- package/lib/icon/text-file.js +1 -1
- package/lib/icon/text-fill.js +1 -1
- package/lib/icon/transfer.js +1 -1
- package/lib/icon/tree-application-shape.js +1 -1
- package/lib/icon/unfull-screen.js +1 -1
- package/lib/icon/unvisible.js +1 -1
- package/lib/icon/up-shape.js +1 -1
- package/lib/icon/upload.js +1 -1
- package/lib/icon/video-fill.js +1 -1
- package/lib/icon/warn.js +1 -1
- package/lib/icon/weixin.js +1 -1
- package/lib/image/image.d.ts +5 -5
- package/lib/image/index.d.ts +11 -11
- package/lib/image/index.js +1 -1
- package/lib/image/props.d.ts +2 -2
- package/lib/info-box/index.js +1 -1
- package/lib/input/index.d.ts +16 -16
- package/lib/input/index.js +1 -1
- package/lib/input/input.d.ts +10 -10
- package/lib/link/index.d.ts +15 -15
- package/lib/link/index.js +1 -1
- package/lib/link/link.d.ts +6 -6
- package/lib/loading/index.d.ts +38 -22
- package/lib/loading/index.js +1 -1
- package/lib/loading/loading.d.ts +27 -15
- package/lib/message/index.js +1 -1
- package/lib/message/messageConstructor.d.ts +5 -5
- package/lib/modal/index.d.ts +24 -76
- package/lib/modal/index.js +1 -1
- package/lib/modal/modal.d.ts +9 -29
- package/lib/modal/props.mixin.d.ts +4 -12
- package/lib/notify/index.js +1 -1
- package/lib/notify/notifyConstructor.d.ts +5 -5
- package/lib/pagination/index.d.ts +8 -8
- package/lib/pagination/pagination.d.ts +4 -4
- package/lib/plugin-popover/index.js +1 -1
- package/lib/popover/index.d.ts +23 -31
- package/lib/popover/index.js +1 -1
- package/lib/popover/popover.d.ts +10 -14
- package/lib/popover/props.d.ts +4 -6
- package/lib/popover/use-floating.d.ts +4 -1
- package/lib/progress/index.d.ts +15 -15
- package/lib/progress/index.js +1 -1
- package/lib/progress/progress.d.ts +7 -7
- package/lib/radio/index.d.ts +2 -2
- package/lib/radio/radio-button.d.ts +3 -3
- package/lib/rate/index.d.ts +4 -4
- package/lib/rate/rate.d.ts +2 -2
- package/lib/resize-layout/index.d.ts +15 -15
- package/lib/resize-layout/resize-layout.d.ts +6 -6
- package/lib/select/index.d.ts +51 -92
- package/lib/select/index.js +1 -1
- package/lib/select/select.d.ts +20 -35
- package/lib/select/selectTagInput.d.ts +2 -7
- package/lib/shared/index.js +1 -1
- package/lib/shared/pop-manager.d.ts +9 -1
- package/lib/shared/vue-types.d.ts +85 -7
- package/lib/sideslider/index.d.ts +20 -64
- package/lib/sideslider/sideslider.d.ts +9 -29
- package/lib/slider/index.d.ts +4 -4
- package/lib/slider/index.js +1 -1
- package/lib/slider/slider-button.d.ts +2 -1
- package/lib/slider/slider.d.ts +1 -1
- package/lib/steps/index.d.ts +49 -49
- package/lib/steps/index.js +1 -1
- package/lib/steps/steps.d.ts +31 -31
- package/lib/switcher/index.d.ts +9 -20
- package/lib/switcher/index.js +1 -1
- package/lib/switcher/switcher.d.ts +4 -9
- package/lib/tab/index.d.ts +39 -44
- package/lib/tab/index.js +1 -1
- package/lib/tab/props.d.ts +11 -13
- package/lib/tab/tab-nav.d.ts +11 -11
- package/lib/tab/tab-panel.d.ts +2 -7
- package/lib/tab/tab.d.ts +16 -16
- package/lib/table/components/table-column.d.ts +22 -27
- package/lib/table/index.d.ts +160 -94
- package/lib/table/index.js +1 -1
- package/lib/table/props.d.ts +42 -18
- package/lib/table/table.d.ts +50 -15
- package/lib/table/use-common.d.ts +6 -6
- package/lib/table-column/index.d.ts +49 -60
- package/lib/table-column/index.js +1 -1
- package/lib/tag/index.d.ts +16 -27
- package/lib/tag/index.js +1 -1
- package/lib/tag/tag.d.ts +7 -12
- package/lib/tag-input/index.d.ts +28 -36
- package/lib/tag-input/index.js +1 -1
- package/lib/tag-input/tag-input.d.ts +13 -17
- package/lib/tag-input/tag-props.d.ts +6 -8
- package/lib/time-picker/index.d.ts +18 -18
- package/lib/tree/constant.d.ts +6 -1
- package/lib/tree/index.js +1 -1
- package/lib/tree/use-empty.d.ts +1 -1
- package/package.json +1 -1
- package/lib/dropdown/const.d.ts +0 -4
- package/lib/icon/original .js +0 -1
@@ -7,18 +7,14 @@ declare const BkSideslider: {
|
|
7
7
|
multiInstance: boolean;
|
8
8
|
zIndex: string | number;
|
9
9
|
showMask: boolean;
|
10
|
+
direction: string;
|
10
11
|
extCls: string | unknown[];
|
11
12
|
width: string | number;
|
12
13
|
height: string | number;
|
13
14
|
isShow: boolean;
|
14
15
|
draggable: boolean;
|
15
16
|
transfer: boolean;
|
16
|
-
size: string;
|
17
|
-
direction: string;
|
18
17
|
maxHeight: string;
|
19
|
-
renderDirective: string;
|
20
|
-
dialogType: string;
|
21
|
-
infoType: string;
|
22
18
|
quickClose: boolean;
|
23
19
|
scrollable: boolean;
|
24
20
|
closeIcon: boolean;
|
@@ -72,9 +68,7 @@ declare const BkSideslider: {
|
|
72
68
|
} & {
|
73
69
|
default: boolean;
|
74
70
|
};
|
75
|
-
size: import("vue-types").VueTypeDef<
|
76
|
-
default: string;
|
77
|
-
};
|
71
|
+
size: import("vue-types").VueTypeDef<"small" | "normal" | "large" | "medium">;
|
78
72
|
draggable: import("vue-types").VueTypeValidableDef<boolean> & {
|
79
73
|
default: boolean;
|
80
74
|
} & {
|
@@ -106,28 +100,22 @@ declare const BkSideslider: {
|
|
106
100
|
} & {
|
107
101
|
default: string;
|
108
102
|
};
|
109
|
-
renderDirective: import("vue-types").VueTypeDef<
|
110
|
-
default: string;
|
111
|
-
};
|
103
|
+
renderDirective: import("vue-types").VueTypeDef<"if" | "show">;
|
112
104
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
113
|
-
dialogType: import("vue-types").VueTypeDef<
|
114
|
-
default: string;
|
115
|
-
};
|
105
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "operation" | "confirm" | "process">;
|
116
106
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
117
107
|
default: boolean;
|
118
108
|
} & {
|
119
109
|
default: boolean;
|
120
110
|
};
|
121
|
-
infoType: import("vue-types").VueTypeDef<
|
122
|
-
default: string;
|
123
|
-
};
|
111
|
+
infoType: import("vue-types").VueTypeDef<"success" | "warning" | "danger" | "primary">;
|
124
112
|
}>> & {
|
125
113
|
onHidden?: (...args: any[]) => any;
|
126
114
|
onShown?: (...args: any[]) => any;
|
127
115
|
onClosed?: (...args: any[]) => any;
|
128
116
|
"onUpdate:isShow"?: (...args: any[]) => any;
|
129
117
|
"onAnimation-end"?: (...args: any[]) => any;
|
130
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "title" | "multiInstance" | "zIndex" | "showMask" | "extCls" | "width" | "height" | "isShow" | "draggable" | "transfer" | "
|
118
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "title" | "multiInstance" | "zIndex" | "showMask" | "direction" | "extCls" | "width" | "height" | "isShow" | "draggable" | "transfer" | "maxHeight" | "quickClose" | "scrollable" | "closeIcon" | "escClose" | "fullscreen" | "animateType">;
|
131
119
|
$attrs: {
|
132
120
|
[x: string]: unknown;
|
133
121
|
};
|
@@ -188,9 +176,7 @@ declare const BkSideslider: {
|
|
188
176
|
} & {
|
189
177
|
default: boolean;
|
190
178
|
};
|
191
|
-
size: import("vue-types").VueTypeDef<
|
192
|
-
default: string;
|
193
|
-
};
|
179
|
+
size: import("vue-types").VueTypeDef<"small" | "normal" | "large" | "medium">;
|
194
180
|
draggable: import("vue-types").VueTypeValidableDef<boolean> & {
|
195
181
|
default: boolean;
|
196
182
|
} & {
|
@@ -222,21 +208,15 @@ declare const BkSideslider: {
|
|
222
208
|
} & {
|
223
209
|
default: string;
|
224
210
|
};
|
225
|
-
renderDirective: import("vue-types").VueTypeDef<
|
226
|
-
default: string;
|
227
|
-
};
|
211
|
+
renderDirective: import("vue-types").VueTypeDef<"if" | "show">;
|
228
212
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
229
|
-
dialogType: import("vue-types").VueTypeDef<
|
230
|
-
default: string;
|
231
|
-
};
|
213
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "operation" | "confirm" | "process">;
|
232
214
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
233
215
|
default: boolean;
|
234
216
|
} & {
|
235
217
|
default: boolean;
|
236
218
|
};
|
237
|
-
infoType: import("vue-types").VueTypeDef<
|
238
|
-
default: string;
|
239
|
-
};
|
219
|
+
infoType: import("vue-types").VueTypeDef<"success" | "warning" | "danger" | "primary">;
|
240
220
|
}>> & {
|
241
221
|
onHidden?: (...args: any[]) => any;
|
242
222
|
onShown?: (...args: any[]) => any;
|
@@ -248,18 +228,14 @@ declare const BkSideslider: {
|
|
248
228
|
multiInstance: boolean;
|
249
229
|
zIndex: string | number;
|
250
230
|
showMask: boolean;
|
231
|
+
direction: string;
|
251
232
|
extCls: string | unknown[];
|
252
233
|
width: string | number;
|
253
234
|
height: string | number;
|
254
235
|
isShow: boolean;
|
255
236
|
draggable: boolean;
|
256
237
|
transfer: boolean;
|
257
|
-
size: string;
|
258
|
-
direction: string;
|
259
238
|
maxHeight: string;
|
260
|
-
renderDirective: string;
|
261
|
-
dialogType: string;
|
262
|
-
infoType: string;
|
263
239
|
quickClose: boolean;
|
264
240
|
scrollable: boolean;
|
265
241
|
closeIcon: boolean;
|
@@ -333,9 +309,7 @@ declare const BkSideslider: {
|
|
333
309
|
} & {
|
334
310
|
default: boolean;
|
335
311
|
};
|
336
|
-
size: import("vue-types").VueTypeDef<
|
337
|
-
default: string;
|
338
|
-
};
|
312
|
+
size: import("vue-types").VueTypeDef<"small" | "normal" | "large" | "medium">;
|
339
313
|
draggable: import("vue-types").VueTypeValidableDef<boolean> & {
|
340
314
|
default: boolean;
|
341
315
|
} & {
|
@@ -367,21 +341,15 @@ declare const BkSideslider: {
|
|
367
341
|
} & {
|
368
342
|
default: string;
|
369
343
|
};
|
370
|
-
renderDirective: import("vue-types").VueTypeDef<
|
371
|
-
default: string;
|
372
|
-
};
|
344
|
+
renderDirective: import("vue-types").VueTypeDef<"if" | "show">;
|
373
345
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
374
|
-
dialogType: import("vue-types").VueTypeDef<
|
375
|
-
default: string;
|
376
|
-
};
|
346
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "operation" | "confirm" | "process">;
|
377
347
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
378
348
|
default: boolean;
|
379
349
|
} & {
|
380
350
|
default: boolean;
|
381
351
|
};
|
382
|
-
infoType: import("vue-types").VueTypeDef<
|
383
|
-
default: string;
|
384
|
-
};
|
352
|
+
infoType: import("vue-types").VueTypeDef<"success" | "warning" | "danger" | "primary">;
|
385
353
|
}>> & {
|
386
354
|
onHidden?: (...args: any[]) => any;
|
387
355
|
onShown?: (...args: any[]) => any;
|
@@ -439,9 +407,7 @@ declare const BkSideslider: {
|
|
439
407
|
} & {
|
440
408
|
default: boolean;
|
441
409
|
};
|
442
|
-
size: import("vue-types").VueTypeDef<
|
443
|
-
default: string;
|
444
|
-
};
|
410
|
+
size: import("vue-types").VueTypeDef<"small" | "normal" | "large" | "medium">;
|
445
411
|
draggable: import("vue-types").VueTypeValidableDef<boolean> & {
|
446
412
|
default: boolean;
|
447
413
|
} & {
|
@@ -473,21 +439,15 @@ declare const BkSideslider: {
|
|
473
439
|
} & {
|
474
440
|
default: string;
|
475
441
|
};
|
476
|
-
renderDirective: import("vue-types").VueTypeDef<
|
477
|
-
default: string;
|
478
|
-
};
|
442
|
+
renderDirective: import("vue-types").VueTypeDef<"if" | "show">;
|
479
443
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
480
|
-
dialogType: import("vue-types").VueTypeDef<
|
481
|
-
default: string;
|
482
|
-
};
|
444
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "operation" | "confirm" | "process">;
|
483
445
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
484
446
|
default: boolean;
|
485
447
|
} & {
|
486
448
|
default: boolean;
|
487
449
|
};
|
488
|
-
infoType: import("vue-types").VueTypeDef<
|
489
|
-
default: string;
|
490
|
-
};
|
450
|
+
infoType: import("vue-types").VueTypeDef<"success" | "warning" | "danger" | "primary">;
|
491
451
|
}>> & {
|
492
452
|
onHidden?: (...args: any[]) => any;
|
493
453
|
onShown?: (...args: any[]) => any;
|
@@ -499,18 +459,14 @@ declare const BkSideslider: {
|
|
499
459
|
multiInstance: boolean;
|
500
460
|
zIndex: string | number;
|
501
461
|
showMask: boolean;
|
462
|
+
direction: string;
|
502
463
|
extCls: string | unknown[];
|
503
464
|
width: string | number;
|
504
465
|
height: string | number;
|
505
466
|
isShow: boolean;
|
506
467
|
draggable: boolean;
|
507
468
|
transfer: boolean;
|
508
|
-
size: string;
|
509
|
-
direction: string;
|
510
469
|
maxHeight: string;
|
511
|
-
renderDirective: string;
|
512
|
-
dialogType: string;
|
513
|
-
infoType: string;
|
514
470
|
quickClose: boolean;
|
515
471
|
scrollable: boolean;
|
516
472
|
closeIcon: boolean;
|
@@ -45,9 +45,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
45
45
|
} & {
|
46
46
|
default: boolean;
|
47
47
|
};
|
48
|
-
size: import("vue-types").VueTypeDef<
|
49
|
-
default: string;
|
50
|
-
};
|
48
|
+
size: import("vue-types").VueTypeDef<"small" | "normal" | "large" | "medium">;
|
51
49
|
draggable: import("vue-types").VueTypeValidableDef<boolean> & {
|
52
50
|
default: boolean;
|
53
51
|
} & {
|
@@ -79,21 +77,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
79
77
|
} & {
|
80
78
|
default: string;
|
81
79
|
};
|
82
|
-
renderDirective: import("vue-types").VueTypeDef<
|
83
|
-
default: string;
|
84
|
-
};
|
80
|
+
renderDirective: import("vue-types").VueTypeDef<"if" | "show">;
|
85
81
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
86
|
-
dialogType: import("vue-types").VueTypeDef<
|
87
|
-
default: string;
|
88
|
-
};
|
82
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "operation" | "confirm" | "process">;
|
89
83
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
90
84
|
default: boolean;
|
91
85
|
} & {
|
92
86
|
default: boolean;
|
93
87
|
};
|
94
|
-
infoType: import("vue-types").VueTypeDef<
|
95
|
-
default: string;
|
96
|
-
};
|
88
|
+
infoType: import("vue-types").VueTypeDef<"success" | "warning" | "danger" | "primary">;
|
97
89
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("hidden" | "shown" | "closed" | "update:isShow" | "animation-end")[], "hidden" | "shown" | "closed" | "update:isShow" | "animation-end", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
98
90
|
direction: {
|
99
91
|
type: StringConstructor;
|
@@ -141,9 +133,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
141
133
|
} & {
|
142
134
|
default: boolean;
|
143
135
|
};
|
144
|
-
size: import("vue-types").VueTypeDef<
|
145
|
-
default: string;
|
146
|
-
};
|
136
|
+
size: import("vue-types").VueTypeDef<"small" | "normal" | "large" | "medium">;
|
147
137
|
draggable: import("vue-types").VueTypeValidableDef<boolean> & {
|
148
138
|
default: boolean;
|
149
139
|
} & {
|
@@ -175,21 +165,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
175
165
|
} & {
|
176
166
|
default: string;
|
177
167
|
};
|
178
|
-
renderDirective: import("vue-types").VueTypeDef<
|
179
|
-
default: string;
|
180
|
-
};
|
168
|
+
renderDirective: import("vue-types").VueTypeDef<"if" | "show">;
|
181
169
|
beforeClose: import("vue-types").VueTypeDef<unknown>;
|
182
|
-
dialogType: import("vue-types").VueTypeDef<
|
183
|
-
default: string;
|
184
|
-
};
|
170
|
+
dialogType: import("vue-types").VueTypeDef<"show" | "operation" | "confirm" | "process">;
|
185
171
|
multiInstance: import("vue-types").VueTypeValidableDef<boolean> & {
|
186
172
|
default: boolean;
|
187
173
|
} & {
|
188
174
|
default: boolean;
|
189
175
|
};
|
190
|
-
infoType: import("vue-types").VueTypeDef<
|
191
|
-
default: string;
|
192
|
-
};
|
176
|
+
infoType: import("vue-types").VueTypeDef<"success" | "warning" | "danger" | "primary">;
|
193
177
|
}>> & {
|
194
178
|
onHidden?: (...args: any[]) => any;
|
195
179
|
onShown?: (...args: any[]) => any;
|
@@ -201,18 +185,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
201
185
|
multiInstance: boolean;
|
202
186
|
zIndex: string | number;
|
203
187
|
showMask: boolean;
|
188
|
+
direction: string;
|
204
189
|
extCls: string | unknown[];
|
205
190
|
width: string | number;
|
206
191
|
height: string | number;
|
207
192
|
isShow: boolean;
|
208
193
|
draggable: boolean;
|
209
194
|
transfer: boolean;
|
210
|
-
size: string;
|
211
|
-
direction: string;
|
212
195
|
maxHeight: string;
|
213
|
-
renderDirective: string;
|
214
|
-
dialogType: string;
|
215
|
-
infoType: string;
|
216
196
|
quickClose: boolean;
|
217
197
|
scrollable: boolean;
|
218
198
|
closeIcon: boolean;
|
package/lib/slider/index.d.ts
CHANGED
@@ -28,10 +28,10 @@ declare const Slider: {
|
|
28
28
|
$: import("vue").ComponentInternalInstance;
|
29
29
|
$data: {};
|
30
30
|
$props: Partial<{
|
31
|
+
vertical: boolean;
|
31
32
|
extCls: string;
|
32
33
|
height: string;
|
33
34
|
step: number;
|
34
|
-
vertical: boolean;
|
35
35
|
range: boolean;
|
36
36
|
showInput: boolean;
|
37
37
|
customContent: Record<string, any>;
|
@@ -123,7 +123,7 @@ declare const Slider: {
|
|
123
123
|
}>> & {
|
124
124
|
onChange?: (...args: any[]) => any;
|
125
125
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
126
|
-
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "
|
126
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "vertical" | "extCls" | "height" | "step" | "range" | "showInput" | "customContent" | "disable" | "showTip" | "maxValue" | "minValue" | "showInterval" | "showIntervalLabel" | "showButtonLabel" | "showBetweenLabel" | "formatterLabel" | "formatterButtonLabel" | "formatterTipLabel">;
|
127
127
|
$attrs: {
|
128
128
|
[x: string]: unknown;
|
129
129
|
};
|
@@ -217,10 +217,10 @@ declare const Slider: {
|
|
217
217
|
}, {
|
218
218
|
renderDom: () => JSX.Element;
|
219
219
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], string, {
|
220
|
+
vertical: boolean;
|
220
221
|
extCls: string;
|
221
222
|
height: string;
|
222
223
|
step: number;
|
223
|
-
vertical: boolean;
|
224
224
|
range: boolean;
|
225
225
|
showInput: boolean;
|
226
226
|
customContent: Record<string, any>;
|
@@ -418,10 +418,10 @@ declare const Slider: {
|
|
418
418
|
}, {
|
419
419
|
renderDom: () => JSX.Element;
|
420
420
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", {
|
421
|
+
vertical: boolean;
|
421
422
|
extCls: string;
|
422
423
|
height: string;
|
423
424
|
step: number;
|
424
|
-
vertical: boolean;
|
425
425
|
range: boolean;
|
426
426
|
showInput: boolean;
|
427
427
|
customContent: Record<string, any>;
|
package/lib/slider/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../input"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../input","../popover"],t);else{var a="object"==typeof exports?t(require("../shared"),require("vue"),require("../input"),require("../popover")):t(e["../shared"],e.vue,e["../input"],e["../popover"]);for(var r in a)("object"==typeof exports?exports:e)[r]=a[r]}}(self,((e,t,a,r)=>(()=>{var n={7162:(e,t,a)=>{e.exports=a(5047)},5047:e=>{var t=function(e){"use strict";var t,a=Object.prototype,r=a.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",u=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function i(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(e){i=function(e,t,a){return e[t]=a}}function c(e,t,a,r){var n=t&&t.prototype instanceof h?t:h,o=Object.create(n.prototype),u=new j(r||[]);return o._invoke=function(e,t,a){var r=v;return function(n,o){if(r===d)throw new Error("Generator is already running");if(r===f){if("throw"===n)throw o;return T()}for(a.method=n,a.arg=o;;){var u=a.delegate;if(u){var l=k(u,a);if(l){if(l===p)continue;return l}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(r===v)throw r=f,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);r=d;var i=s(e,t,a);if("normal"===i.type){if(r=a.done?f:m,i.arg===p)continue;return{value:i.arg,done:a.done}}"throw"===i.type&&(r=f,a.method="throw",a.arg=i.arg)}}}(e,a,u),o}function s(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var v="suspendedStart",m="suspendedYield",d="executing",f="completed",p={};function h(){}function V(){}function y(){}var b={};i(b,o,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(B([])));w&&w!==a&&r.call(w,o)&&(b=w);var x=y.prototype=h.prototype=Object.create(b);function L(e){["next","throw","return"].forEach((function(t){i(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function a(n,o,u,l){var i=s(e[n],e,o);if("throw"!==i.type){var c=i.arg,v=c.value;return v&&"object"==typeof v&&r.call(v,"__await")?t.resolve(v.__await).then((function(e){a("next",e,u,l)}),(function(e){a("throw",e,u,l)})):t.resolve(v).then((function(e){c.value=e,u(c)}),(function(e){return a("throw",e,u,l)}))}l(i.arg)}var n;this._invoke=function(e,r){function o(){return new t((function(t,n){a(e,r,t,n)}))}return n=n?n.then(o,o):o()}}function k(e,a){var r=e.iterator[a.method];if(r===t){if(a.delegate=null,"throw"===a.method){if(e.iterator.return&&(a.method="return",a.arg=t,k(e,a),"throw"===a.method))return p;a.method="throw",a.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=s(r,e.iterator,a.arg);if("throw"===n.type)return a.method="throw",a.arg=n.arg,a.delegate=null,p;var o=n.arg;return o?o.done?(a[e.resultName]=o.value,a.next=e.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,p):o:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,p)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function B(e){if(e){var a=e[o];if(a)return a.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,u=function a(){for(;++n<e.length;)if(r.call(e,n))return a.value=e[n],a.done=!1,a;return a.value=t,a.done=!0,a};return u.next=u}}return{next:T}}function T(){return{value:t,done:!0}}return V.prototype=y,i(x,"constructor",y),i(y,"constructor",V),V.displayName=i(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===V||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,i(e,l,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},L(N.prototype),i(N.prototype,u,(function(){return this})),e.AsyncIterator=N,e.async=function(t,a,r,n,o){void 0===o&&(o=Promise);var u=new N(c(t,a,r,n),o);return e.isGeneratorFunction(a)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},L(x),i(x,l,"Generator"),i(x,o,(function(){return this})),i(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var a in e)t.push(a);return t.reverse(),function a(){for(;t.length;){var r=t.pop();if(r in e)return a.value=r,a.done=!1,a}return a.done=!0,a}},e.values=B,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(E),!e)for(var a in this)"t"===a.charAt(0)&&r.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var a=this;function n(r,n){return l.type="throw",l.arg=e,a.next=r,n&&(a.method="next",a.arg=t),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],l=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var i=r.call(u,"catchLoc"),c=r.call(u,"finallyLoc");if(i&&c){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(i){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.finallyLoc)}}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),E(a),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var r=a.completion;if("throw"===r.type){var n=r.arg;E(a)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,r){return this.delegate={iterator:B(e),resultName:a,nextLoc:r},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},8133:e=>{"use strict";e.exports=a},5537:e=>{"use strict";e.exports=r},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t}},o={};function u(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return n[e](a,a.exports,u),a.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var a in t)u.o(t,a)&&!u.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{"use strict";u.r(l),u.d(l,{default:()=>f});var e=u(4212),t=u(748),a=u(7162),r=u.n(a);Object.create,Object.create;var n=u(8133),o=u.n(n),i=u(5537),c=u.n(i);const s=(0,t.defineComponent)({name:"SliderButton",props:{modelValue:{type:Number,default:0},params:{type:Object,default:function(){return{}}}},emits:["emitChange","resetSize","update:modelValue"],setup:function(e,a){var r=a.emit,n=(0,t.ref)(!1),o=(0,t.ref)(!1),u=(0,t.ref)(0),l=(0,t.ref)(0),i=(0,t.ref)(0),s=(0,t.ref)(null),d=(0,t.ref)(e.modelValue),f=(0,t.ref)(0),p=(0,t.ref)(0),h=(0,t.ref)(!1),V=(0,t.ref)(null),y=(0,t.computed)((function(){var t,a,r="";if(null===(t=e.params.customContent)||void 0===t?void 0:t[e.modelValue]){var n=e.params.customContent[e.modelValue];r=n.tip||n.label||""}var o=e.params.vertical?"right":"top";return(null===(a=e.params)||void 0===a?void 0:a.showTip)?{content:e.params.formatterTipLabel("".concat(r||(null==e?void 0:e.modelValue)||"0")),placement:o}:{content:"",placement:o}})),b=(0,t.computed)((function(){return"".concat((e.modelValue-e.params.minValue)/(e.params.maxValue-e.params.minValue)*100,"%")})),g=(0,t.computed)((function(){return e.params.vertical?{bottom:b.value}:{left:b.value}})),w=(0,t.computed)((function(){return e.params.formatterButtonLabel(e.modelValue)})),x=function(t){e.params.disable||(t.preventDefault(),L(t),v(window,"mousemove",N),v(window,"touchmove",N),v(window,"mouseup",k),v(window,"touchend",k))},L=function(t){n.value=!0,o.value=!0,e.params.vertical?u.value=t.clientY:l.value=t.clientX,i.value=parseFloat(b.value),s.value=i.value},N=function(t){if(n.value){o.value=!1,r("resetSize");var a=0;e.params.vertical?(f.value=t.clientY,a=(u.value-f.value)/e.params.sliderSize*100):(p.value=t.clientX,a=(p.value-l.value)/e.params.sliderSize*100),s.value=i.value+a,C(s.value)}},k=function e(){h.value=!1,n.value&&(setTimeout((function(){n.value=!1,o.value||(C(s.value),r("emitChange"))}),0),m(window,"mousemove",N),m(window,"touchmove",N),m(window,"mouseup",e),m(window,"touchend",e))},C=function(t){if(null!==t&&!isNaN(t)){t<0?s.value=0:t>100&&(s.value=100);var a=100/((e.params.maxValue-e.params.minValue)/e.params.step),o=Math.round(t/a)*a*(e.params.maxValue-e.params.minValue)*.01+e.params.minValue;o=parseFloat(o.toFixed(e.params.precision)),r("update:modelValue",o),n.value||e.modelValue===d.value||(d.value=e.modelValue)}};return{renderDom:function(){return(0,t.createVNode)("div",{class:["bk-slider-button",e.params.vertical?"vertical":"horizontal",{grabbing:n.value}],ref:V,tabindex:"0",style:g.value,onClick:function(e){return e.stopPropagation()},onMousedown:x},[Boolean(y.value.content)?(0,t.createVNode)(c(),{content:y.value.content,theme:"dark",placement:y.value.placement,boundary:document.body},{default:function(){return[(0,t.createVNode)("div",{class:["slider-button",{"slider-button-disable":e.params.disable}]},null)]}}):(0,t.createVNode)("div",{class:["slider-button",{"slider-button-disable":e.params.disable}]},null),e.params.showButtonLabel&&!e.params.showIntervalLabel?(0,t.createVNode)("div",{class:["slider-button-label",e.params.vertical?"vertical":"horizontal"]},[w.value]):void 0])},setPosition:C,tip:y}},render:function(){return this.renderDom()}});var v=function(e,t,a){e&&t&&a&&e.addEventListener(t,a,!1)},m=function(e,t,a){e&&t&&a&&e.removeEventListener(t,a,!1)};const d=(0,t.defineComponent)({name:"Slider",props:{modelValue:e.PropTypes.oneOfType([e.PropTypes.array,e.PropTypes.number]),extCls:{type:String,default:""},vertical:{type:Boolean,default:!1},height:{type:String,default:"200px"},disable:{type:Boolean,default:!1},showTip:{type:Boolean,default:!1},maxValue:{type:[Number],default:100},minValue:{type:[Number],default:0},step:{type:[Number],default:1},range:{type:Boolean,default:!1},showInterval:{type:Boolean,default:!1},showIntervalLabel:{type:Boolean,default:!1},showButtonLabel:{type:Boolean,default:!1},showBetweenLabel:{type:Boolean,default:!1},showInput:{type:Boolean,default:!1},customContent:{type:Object,default:null},formatterLabel:{type:Function,default:function(e){return e}},formatterButtonLabel:{type:Function,default:function(e){return e}},formatterTipLabel:{type:Function,default:function(e){return e}}},emits:["update:modelValue","change"],setup:function(e,a){var n=this,u=a.slots,l=a.emit,i=(0,t.ref)(1),c=(0,t.ref)(null),m=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.ref)(0),p=(0,t.ref)(0),h=(0,t.ref)(null),V=(0,t.ref)(null),y=(0,t.ref)(null),b=(0,t.ref)(null),g=(0,t.computed)((function(){var t=[e.minValue,e.maxValue,e.step].map((function(e){var t="".concat(e).split(".")[1];return t?t.length:0}));return Math.max.apply(null,t)})),w=(0,t.computed)((function(){return Math.min(c.value,m.value)})),x=(0,t.computed)((function(){return Math.max(c.value,m.value)})),L=(0,t.computed)((function(){return e.range?"".concat(100*(x.value-w.value)/(e.maxValue-e.minValue),"%"):"".concat(100*(c.value-e.minValue)/(e.maxValue-e.minValue),"%")})),N=(0,t.computed)((function(){return e.range?"".concat(100*(w.value-e.minValue)/(e.maxValue-e.minValue),"%"):"0%"})),k=(0,t.computed)((function(){return e.vertical?{height:L.value,bottom:N.value}:{width:L.value,left:N.value}})),C=(0,t.computed)((function(){if(!e.showInterval||e.minValue>e.maxValue)return[];if(0===e.step)return console.warn("WARNNING:step should not be 0"),[];for(var t=(e.maxValue-e.minValue)/e.step,a=100*e.step/(e.maxValue-e.minValue),r=[],n=1;n<t;n++)r.push(n*a);return e.range?r.filter((function(t){return t<100*(w.value-e.minValue)/(e.maxValue-e.minValue)||t>100*(x.value-e.minValue)/(e.maxValue-e.minValue)})):r.filter((function(t){return t>100*(c.value-e.minValue)/(e.maxValue-e.minValue)}))})),E=(0,t.computed)((function(){return e.vertical?{height:e.height,width:"4px"}:{}})),j=(0,t.computed)((function(){if(!e.showIntervalLabel)return[];if(0===e.step)return console.warn("WARNNING:step should not be 0"),[];for(var t=100*e.step/(e.maxValue-e.minValue),a=[],r=e.minValue,n=0;r<=e.maxValue;r+=e.step,n++){var o={stepWidth:n*t,stepLabel:e.formatterLabel(r)};a.push(o)}return a})),B=(0,t.computed)((function(){return Array.isArray(e.modelValue)})),T=(0,t.computed)((function(){return e.customContent?Object.keys(e.customContent).sort((function(e,t){return Number(e)-Number(t)})).filter((function(t){return Number(t)>=e.minValue&&Number(t)<=e.maxValue})).map((function(t){var a=e.customContent[t].tip,r=e.customContent[t].label;return{tip:a||r||"",label:r||"",percent:(Number(t)-e.minValue)/(e.maxValue-e.minValue)*100}})):[]})),O=(0,t.computed)((function(){return{vertical:e.vertical,showTip:e.showTip,disable:e.disable,maxValue:e.maxValue,minValue:e.minValue,step:e.step,precision:g.value,showButtonLabel:e.showButtonLabel,formatterButtonLabel:e.formatterButtonLabel,showIntervalLabel:e.showIntervalLabel,customContent:e.customContent,sliderSize:i.value,formatterTipLabel:e.formatterTipLabel}}));(0,t.watch)((function(){return e.modelValue}),(function(){I()})),(0,t.watch)((function(){return c.value}),(function(t){e.range?l("update:modelValue",[w.value,x.value]):l("update:modelValue",t),f.value=t})),(0,t.watch)((function(){return m.value}),(function(e){l("update:modelValue",[w.value,x.value]),p.value=e})),(0,t.onMounted)((function(){e.range?(Array.isArray(e.modelValue)?(c.value=Math.max(e.minValue,Number(e.modelValue[0])),m.value=Math.min(e.maxValue,Number(e.modelValue[1]))):(c.value=e.minValue,m.value=e.maxValue),d.value=[c.value,m.value]):("number"!=typeof e.modelValue||isNaN(e.modelValue)?c.value=e.minValue:c.value=Math.min(e.maxValue,Math.max(e.minValue,e.modelValue)),d.value=c.value),S(),v(window,"resize",S())}));var S=function(){h.value&&(i.value=h.value["client".concat(e.vertical?"Height":"Width")])},P=function(t){var a,r;if(t.stopPropagation(),!e.disable){if(S(),e.vertical){var n=null===(a=h.value)||void 0===a?void 0:a.getBoundingClientRect().bottom;F((n-t.clientY)/i.value*100)}else{var o=null===(r=h.value)||void 0===r?void 0:r.getBoundingClientRect().left;F((t.clientX-o)/i.value*100)}M()}},_=function(){return e.range?![w.value,x.value].every((function(e,t){return e===d.value[t]})):e.modelValue!==d.value},I=function(){if(e.minValue>e.maxValue)console.error("min should not be greater than max.");else{var t=e.modelValue;e.range&&Array.isArray(t)?t[1]<e.minValue?l("update:modelValue",[e.minValue,e.minValue]):t[0]>e.maxValue?l("update:modelValue",[e.maxValue,e.maxValue]):t[0]<e.minValue?l("update:modelValue",[e.minValue,t[1]]):t[1]>e.maxValue?l("update:modelValue",[t[0],e.maxValue]):(c.value=Number(t[0]),m.value=Number(t[1]),_()&&(d.value=t.slice())):e.range||"number"!=typeof t||isNaN(t)||(t<e.minValue?l("update:modelValue",e.minValue):t>e.maxValue?l("update:modelValue",e.maxValue):(c.value=t,_()&&(d.value=t)))}},M=function(){return a=n,o=void 0,u=void 0,i=r().mark((function a(){return r().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,t.nextTick)();case 2:l("change",e.range?[w.value,x.value]:e.modelValue);case 3:case"end":return a.stop()}}),a)})),new(u||(u=Promise))((function(e,t){function r(e){try{l(i.next(e))}catch(e){t(e)}}function n(e){try{l(i.throw(e))}catch(e){t(e)}}function l(t){var a;t.done?e(t.value):(a=t.value,a instanceof u?a:new u((function(e){e(a)}))).then(r,n)}l((i=i.apply(a,o||[])).next())}));var a,o,u,i},z=function(t){return e.vertical?{bottom:"".concat(t,"%")}:{left:"".concat(t,"%")}},F=function(t){if(e.range){var a=e.minValue+t*(e.maxValue-e.minValue)/100;Math.abs(w.value-a)<Math.abs(x.value-a)?b.value=c.value<m.value?V.value:y.value:b.value=c.value>m.value?V.value:y.value,b.value.setPosition(t)}else V.value.setPosition(t)},A=function(t){if(""!==t){var a=parseFloat(t);a<e.minValue?(f.value=e.minValue,c.value=e.minValue):a>e.maxValue?(f.value=e.maxValue,c.value=e.maxValue):c.value=a}},G=function(t){if(""!==t&&"number"!=typeof t){var a=parseFloat(t);a<e.minValue?(p.value=e.minValue,m.value=e.minValue):a>e.maxValue?(p.value=e.maxValue,m.value=e.maxValue):m.value=a}},R=function(t){var a;return a="start"===t?e.vertical?e.maxValue:e.minValue:e.vertical?e.minValue:e.maxValue,e.showButtonLabel&&[c.value,m.value].includes(a)?"0":"1"};return{renderDom:function(){var a,r;return(0,t.createVNode)("div",{class:["bk-slider",e.extCls]},[null===(a=u.start)||void 0===a?void 0:a.call(u),(0,t.createVNode)("div",{class:"bk-slider-runway",ref:h,style:E.value,onClick:P},[(0,t.createVNode)("div",{class:["bk-slider-bar",e.vertical?"vertical":"horizontal",{disable:e.disable}],style:k.value},null),e.showInterval?C.value.map((function(a,r){return(0,t.createVNode)("div",{key:r,class:["bk-slider-interval",{vertical:e.vertical}],style:z(a)},null)})):void 0,e.customContent?T.value.map((function(a,r){return(0,t.createVNode)("div",{key:r,class:["bk-slider-interval",{vertical:e.vertical}],style:z(a.percent)},null)})):void 0,e.showBetweenLabel||e.showIntervalLabel||e.customContent?(0,t.createVNode)("div",{class:["bk-slider-labels",e.vertical?"vertical":"horizontal"]},[e.showBetweenLabel?[(0,t.createVNode)("div",{class:"label-start",style:[{opacity:R("start")}]},[e.formatterLabel(e.minValue)]),(0,t.createVNode)("div",{class:"label-end",style:[{opacity:R("end")}]},[e.formatterLabel(e.maxValue)])]:e.showIntervalLabel?j.value.map((function(a,r){return(0,t.createVNode)("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:r,style:z(a.stepWidth)},[a.stepLabel])})):e.customContent?T.value.map((function(a,r){return(0,t.createVNode)("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:r,style:z(a.percent)},[a.label])})):void 0]):void 0,(0,t.createVNode)(s,{modelValue:c.value,"onUpdate:modelValue":function(e){return c.value=e},ref:V,params:O.value,onEmitChange:M,onResetSize:S},null),e.range?(0,t.createVNode)(s,{modelValue:m.value,"onUpdate:modelValue":function(e){return m.value=e},ref:y,params:O.value,onEmitChange:M,onResetSize:S},null):void 0]),e.showInput&&!e.vertical?(0,t.createVNode)("div",{class:"bk-slider-input"},[(0,t.createVNode)("div",{class:"input-item"},[(0,t.createVNode)(o(),{type:"number",modelValue:f.value,max:e.maxValue,min:e.minValue,onChange:A},null)]),B.value&&m.value?[(0,t.createVNode)("div",{class:"input-center"},[(0,t.createTextVNode)("~")]),(0,t.createVNode)("div",{class:"input-item"},[(0,t.createVNode)(o(),{type:"number",modelValue:p.value,max:e.maxValue,min:e.minValue,onChange:G},null)])]:void 0]):void 0,null===(r=u.end)||void 0===r?void 0:r.call(u)])}}},render:function(){return this.renderDom()}}),f=(0,e.withInstall)(d)})(),l})()));
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../input"),require("../popover"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../input","../popover"],t);else{var a="object"==typeof exports?t(require("../shared"),require("vue"),require("../input"),require("../popover")):t(e["../shared"],e.vue,e["../input"],e["../popover"]);for(var r in a)("object"==typeof exports?exports:e)[r]=a[r]}}(self,((e,t,a,r)=>(()=>{var n={7162:(e,t,a)=>{e.exports=a(5047)},5047:e=>{var t=function(e){"use strict";var t,a=Object.prototype,r=a.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",u=n.asyncIterator||"@@asyncIterator",l=n.toStringTag||"@@toStringTag";function i(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(e){i=function(e,t,a){return e[t]=a}}function c(e,t,a,r){var n=t&&t.prototype instanceof h?t:h,o=Object.create(n.prototype),u=new T(r||[]);return o._invoke=function(e,t,a){var r=v;return function(n,o){if(r===d)throw new Error("Generator is already running");if(r===f){if("throw"===n)throw o;return B()}for(a.method=n,a.arg=o;;){var u=a.delegate;if(u){var l=k(u,a);if(l){if(l===p)continue;return l}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(r===v)throw r=f,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);r=d;var i=s(e,t,a);if("normal"===i.type){if(r=a.done?f:m,i.arg===p)continue;return{value:i.arg,done:a.done}}"throw"===i.type&&(r=f,a.method="throw",a.arg=i.arg)}}}(e,a,u),o}function s(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var v="suspendedStart",m="suspendedYield",d="executing",f="completed",p={};function h(){}function V(){}function y(){}var b={};i(b,o,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(j([])));w&&w!==a&&r.call(w,o)&&(b=w);var x=y.prototype=h.prototype=Object.create(b);function L(e){["next","throw","return"].forEach((function(t){i(e,t,(function(e){return this._invoke(t,e)}))}))}function N(e,t){function a(n,o,u,l){var i=s(e[n],e,o);if("throw"!==i.type){var c=i.arg,v=c.value;return v&&"object"==typeof v&&r.call(v,"__await")?t.resolve(v.__await).then((function(e){a("next",e,u,l)}),(function(e){a("throw",e,u,l)})):t.resolve(v).then((function(e){c.value=e,u(c)}),(function(e){return a("throw",e,u,l)}))}l(i.arg)}var n;this._invoke=function(e,r){function o(){return new t((function(t,n){a(e,r,t,n)}))}return n=n?n.then(o,o):o()}}function k(e,a){var r=e.iterator[a.method];if(r===t){if(a.delegate=null,"throw"===a.method){if(e.iterator.return&&(a.method="return",a.arg=t,k(e,a),"throw"===a.method))return p;a.method="throw",a.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var n=s(r,e.iterator,a.arg);if("throw"===n.type)return a.method="throw",a.arg=n.arg,a.delegate=null,p;var o=n.arg;return o?o.done?(a[e.resultName]=o.value,a.next=e.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,p):o:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,p)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function j(e){if(e){var a=e[o];if(a)return a.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,u=function a(){for(;++n<e.length;)if(r.call(e,n))return a.value=e[n],a.done=!1,a;return a.value=t,a.done=!0,a};return u.next=u}}return{next:B}}function B(){return{value:t,done:!0}}return V.prototype=y,i(x,"constructor",y),i(y,"constructor",V),V.displayName=i(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===V||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,i(e,l,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},L(N.prototype),i(N.prototype,u,(function(){return this})),e.AsyncIterator=N,e.async=function(t,a,r,n,o){void 0===o&&(o=Promise);var u=new N(c(t,a,r,n),o);return e.isGeneratorFunction(a)?u:u.next().then((function(e){return e.done?e.value:u.next()}))},L(x),i(x,l,"Generator"),i(x,o,(function(){return this})),i(x,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var a in e)t.push(a);return t.reverse(),function a(){for(;t.length;){var r=t.pop();if(r in e)return a.value=r,a.done=!1,a}return a.done=!0,a}},e.values=j,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var a in this)"t"===a.charAt(0)&&r.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var a=this;function n(r,n){return l.type="throw",l.arg=e,a.next=r,n&&(a.method="next",a.arg=t),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],l=u.completion;if("root"===u.tryLoc)return n("end");if(u.tryLoc<=this.prev){var i=r.call(u,"catchLoc"),c=r.call(u,"finallyLoc");if(i&&c){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(i){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return n(u.finallyLoc)}}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=e,u.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(u)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),C(a),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var r=a.completion;if("throw"===r.type){var n=r.arg;C(a)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,r){return this.delegate={iterator:j(e),resultName:a,nextLoc:r},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},8133:e=>{"use strict";e.exports=a},5537:e=>{"use strict";e.exports=r},4212:t=>{"use strict";t.exports=e},748:e=>{"use strict";e.exports=t}},o={};function u(e){var t=o[e];if(void 0!==t)return t.exports;var a=o[e]={exports:{}};return n[e](a,a.exports,u),a.exports}u.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return u.d(t,{a:t}),t},u.d=(e,t)=>{for(var a in t)u.o(t,a)&&!u.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},u.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var l={};return(()=>{"use strict";u.r(l),u.d(l,{default:()=>f});var e=u(4212),t=u(748),a=u(7162),r=u.n(a);Object.create,Object.create;var n=u(8133),o=u.n(n),i=u(5537),c=u.n(i);const s=(0,t.defineComponent)({name:"SliderButton",props:{modelValue:{type:Number,default:0},params:{type:Object,default:function(){return{}}}},emits:["emitChange","resetSize","update:modelValue"],setup:function(a,r){var n=r.emit,o=(0,t.ref)(!1),u=(0,t.ref)(!1),l=(0,t.ref)(0),i=(0,t.ref)(0),s=(0,t.ref)(0),d=(0,t.ref)(null),f=(0,t.ref)(a.modelValue),p=(0,t.ref)(0),h=(0,t.ref)(0),V=(0,t.ref)(!1),y=(0,t.ref)(null),b=(0,t.computed)((function(){var t,r,n="";if(null===(t=a.params.customContent)||void 0===t?void 0:t[a.modelValue]){var o=a.params.customContent[a.modelValue];n=o.tip||o.label||""}var u=a.params.vertical?e.PlacementEnum.RIGHT:e.PlacementEnum.TOP;return(null===(r=a.params)||void 0===r?void 0:r.showTip)?{content:a.params.formatterTipLabel("".concat(n||(null==a?void 0:a.modelValue)||"0")),placement:u}:{content:"",placement:u}})),g=(0,t.computed)((function(){return"".concat((a.modelValue-a.params.minValue)/(a.params.maxValue-a.params.minValue)*100,"%")})),w=(0,t.computed)((function(){return a.params.vertical?{bottom:g.value}:{left:g.value}})),x=(0,t.computed)((function(){return a.params.formatterButtonLabel(a.modelValue)})),L=function(e){a.params.disable||(e.preventDefault(),N(e),v(window,"mousemove",k),v(window,"touchmove",k),v(window,"mouseup",E),v(window,"touchend",E))},N=function(e){o.value=!0,u.value=!0,a.params.vertical?l.value=e.clientY:i.value=e.clientX,s.value=parseFloat(g.value),d.value=s.value},k=function(e){if(o.value){u.value=!1,n("resetSize");var t=0;a.params.vertical?(p.value=e.clientY,t=(l.value-p.value)/a.params.sliderSize*100):(h.value=e.clientX,t=(h.value-i.value)/a.params.sliderSize*100),d.value=s.value+t,C(d.value)}},E=function e(){V.value=!1,o.value&&(setTimeout((function(){o.value=!1,u.value||(C(d.value),n("emitChange"))}),0),m(window,"mousemove",k),m(window,"touchmove",k),m(window,"mouseup",e),m(window,"touchend",e))},C=function(e){if(null!==e&&!isNaN(e)){e<0?d.value=0:e>100&&(d.value=100);var t=100/((a.params.maxValue-a.params.minValue)/a.params.step),r=Math.round(e/t)*t*(a.params.maxValue-a.params.minValue)*.01+a.params.minValue;r=parseFloat(r.toFixed(a.params.precision)),n("update:modelValue",r),o.value||a.modelValue===f.value||(f.value=a.modelValue)}};return{renderDom:function(){return(0,t.createVNode)("div",{class:["bk-slider-button",a.params.vertical?"vertical":"horizontal",{grabbing:o.value}],ref:y,tabindex:"0",style:w.value,onClick:function(e){return e.stopPropagation()},onMousedown:L},[Boolean(b.value.content)?(0,t.createVNode)(c(),{content:b.value.content,theme:"dark",placement:b.value.placement,boundary:document.body},{default:function(){return[(0,t.createVNode)("div",{class:["slider-button",{"slider-button-disable":a.params.disable}]},null)]}}):(0,t.createVNode)("div",{class:["slider-button",{"slider-button-disable":a.params.disable}]},null),a.params.showButtonLabel&&!a.params.showIntervalLabel?(0,t.createVNode)("div",{class:["slider-button-label",a.params.vertical?"vertical":"horizontal"]},[x.value]):void 0])},setPosition:C,tip:b}},render:function(){return this.renderDom()}});var v=function(e,t,a){e&&t&&a&&e.addEventListener(t,a,!1)},m=function(e,t,a){e&&t&&a&&e.removeEventListener(t,a,!1)};const d=(0,t.defineComponent)({name:"Slider",props:{modelValue:e.PropTypes.oneOfType([e.PropTypes.array,e.PropTypes.number]),extCls:{type:String,default:""},vertical:{type:Boolean,default:!1},height:{type:String,default:"200px"},disable:{type:Boolean,default:!1},showTip:{type:Boolean,default:!1},maxValue:{type:[Number],default:100},minValue:{type:[Number],default:0},step:{type:[Number],default:1},range:{type:Boolean,default:!1},showInterval:{type:Boolean,default:!1},showIntervalLabel:{type:Boolean,default:!1},showButtonLabel:{type:Boolean,default:!1},showBetweenLabel:{type:Boolean,default:!1},showInput:{type:Boolean,default:!1},customContent:{type:Object,default:null},formatterLabel:{type:Function,default:function(e){return e}},formatterButtonLabel:{type:Function,default:function(e){return e}},formatterTipLabel:{type:Function,default:function(e){return e}}},emits:["update:modelValue","change"],setup:function(e,a){var n=this,u=a.slots,l=a.emit,i=(0,t.ref)(1),c=(0,t.ref)(null),m=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.ref)(0),p=(0,t.ref)(0),h=(0,t.ref)(null),V=(0,t.ref)(null),y=(0,t.ref)(null),b=(0,t.ref)(null),g=(0,t.computed)((function(){var t=[e.minValue,e.maxValue,e.step].map((function(e){var t="".concat(e).split(".")[1];return t?t.length:0}));return Math.max.apply(null,t)})),w=(0,t.computed)((function(){return Math.min(c.value,m.value)})),x=(0,t.computed)((function(){return Math.max(c.value,m.value)})),L=(0,t.computed)((function(){return e.range?"".concat(100*(x.value-w.value)/(e.maxValue-e.minValue),"%"):"".concat(100*(c.value-e.minValue)/(e.maxValue-e.minValue),"%")})),N=(0,t.computed)((function(){return e.range?"".concat(100*(w.value-e.minValue)/(e.maxValue-e.minValue),"%"):"0%"})),k=(0,t.computed)((function(){return e.vertical?{height:L.value,bottom:N.value}:{width:L.value,left:N.value}})),E=(0,t.computed)((function(){if(!e.showInterval||e.minValue>e.maxValue)return[];if(0===e.step)return console.warn("WARNNING:step should not be 0"),[];for(var t=(e.maxValue-e.minValue)/e.step,a=100*e.step/(e.maxValue-e.minValue),r=[],n=1;n<t;n++)r.push(n*a);return e.range?r.filter((function(t){return t<100*(w.value-e.minValue)/(e.maxValue-e.minValue)||t>100*(x.value-e.minValue)/(e.maxValue-e.minValue)})):r.filter((function(t){return t>100*(c.value-e.minValue)/(e.maxValue-e.minValue)}))})),C=(0,t.computed)((function(){return e.vertical?{height:e.height,width:"4px"}:{}})),T=(0,t.computed)((function(){if(!e.showIntervalLabel)return[];if(0===e.step)return console.warn("WARNNING:step should not be 0"),[];for(var t=100*e.step/(e.maxValue-e.minValue),a=[],r=e.minValue,n=0;r<=e.maxValue;r+=e.step,n++){var o={stepWidth:n*t,stepLabel:e.formatterLabel(r)};a.push(o)}return a})),j=(0,t.computed)((function(){return Array.isArray(e.modelValue)})),B=(0,t.computed)((function(){return e.customContent?Object.keys(e.customContent).sort((function(e,t){return Number(e)-Number(t)})).filter((function(t){return Number(t)>=e.minValue&&Number(t)<=e.maxValue})).map((function(t){var a=e.customContent[t].tip,r=e.customContent[t].label;return{tip:a||r||"",label:r||"",percent:(Number(t)-e.minValue)/(e.maxValue-e.minValue)*100}})):[]})),O=(0,t.computed)((function(){return{vertical:e.vertical,showTip:e.showTip,disable:e.disable,maxValue:e.maxValue,minValue:e.minValue,step:e.step,precision:g.value,showButtonLabel:e.showButtonLabel,formatterButtonLabel:e.formatterButtonLabel,showIntervalLabel:e.showIntervalLabel,customContent:e.customContent,sliderSize:i.value,formatterTipLabel:e.formatterTipLabel}}));(0,t.watch)((function(){return e.modelValue}),(function(){_()})),(0,t.watch)((function(){return c.value}),(function(t){e.range?l("update:modelValue",[w.value,x.value]):l("update:modelValue",t),f.value=t})),(0,t.watch)((function(){return m.value}),(function(e){l("update:modelValue",[w.value,x.value]),p.value=e})),(0,t.onMounted)((function(){e.range?(Array.isArray(e.modelValue)?(c.value=Math.max(e.minValue,Number(e.modelValue[0])),m.value=Math.min(e.maxValue,Number(e.modelValue[1]))):(c.value=e.minValue,m.value=e.maxValue),d.value=[c.value,m.value]):("number"!=typeof e.modelValue||isNaN(e.modelValue)?c.value=e.minValue:c.value=Math.min(e.maxValue,Math.max(e.minValue,e.modelValue)),d.value=c.value),P(),v(window,"resize",P())}));var P=function(){h.value&&(i.value=h.value["client".concat(e.vertical?"Height":"Width")])},S=function(t){var a,r;if(t.stopPropagation(),!e.disable){if(P(),e.vertical){var n=null===(a=h.value)||void 0===a?void 0:a.getBoundingClientRect().bottom;F((n-t.clientY)/i.value*100)}else{var o=null===(r=h.value)||void 0===r?void 0:r.getBoundingClientRect().left;F((t.clientX-o)/i.value*100)}M()}},I=function(){return e.range?![w.value,x.value].every((function(e,t){return e===d.value[t]})):e.modelValue!==d.value},_=function(){if(e.minValue>e.maxValue)console.error("min should not be greater than max.");else{var t=e.modelValue;e.range&&Array.isArray(t)?t[1]<e.minValue?l("update:modelValue",[e.minValue,e.minValue]):t[0]>e.maxValue?l("update:modelValue",[e.maxValue,e.maxValue]):t[0]<e.minValue?l("update:modelValue",[e.minValue,t[1]]):t[1]>e.maxValue?l("update:modelValue",[t[0],e.maxValue]):(c.value=Number(t[0]),m.value=Number(t[1]),I()&&(d.value=t.slice())):e.range||"number"!=typeof t||isNaN(t)||(t<e.minValue?l("update:modelValue",e.minValue):t>e.maxValue?l("update:modelValue",e.maxValue):(c.value=t,I()&&(d.value=t)))}},M=function(){return a=n,o=void 0,u=void 0,i=r().mark((function a(){return r().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,(0,t.nextTick)();case 2:l("change",e.range?[w.value,x.value]:e.modelValue);case 3:case"end":return a.stop()}}),a)})),new(u||(u=Promise))((function(e,t){function r(e){try{l(i.next(e))}catch(e){t(e)}}function n(e){try{l(i.throw(e))}catch(e){t(e)}}function l(t){var a;t.done?e(t.value):(a=t.value,a instanceof u?a:new u((function(e){e(a)}))).then(r,n)}l((i=i.apply(a,o||[])).next())}));var a,o,u,i},z=function(t){return e.vertical?{bottom:"".concat(t,"%")}:{left:"".concat(t,"%")}},F=function(t){if(e.range){var a=e.minValue+t*(e.maxValue-e.minValue)/100;Math.abs(w.value-a)<Math.abs(x.value-a)?b.value=c.value<m.value?V.value:y.value:b.value=c.value>m.value?V.value:y.value,b.value.setPosition(t)}else V.value.setPosition(t)},G=function(t){if(""!==t){var a=parseFloat(t);a<e.minValue?(f.value=e.minValue,c.value=e.minValue):a>e.maxValue?(f.value=e.maxValue,c.value=e.maxValue):c.value=a}},A=function(t){if(""!==t&&"number"!=typeof t){var a=parseFloat(t);a<e.minValue?(p.value=e.minValue,m.value=e.minValue):a>e.maxValue?(p.value=e.maxValue,m.value=e.maxValue):m.value=a}},R=function(t){var a;return a="start"===t?e.vertical?e.maxValue:e.minValue:e.vertical?e.minValue:e.maxValue,e.showButtonLabel&&[c.value,m.value].includes(a)?"0":"1"};return{renderDom:function(){var a,r;return(0,t.createVNode)("div",{class:["bk-slider",e.extCls]},[null===(a=u.start)||void 0===a?void 0:a.call(u),(0,t.createVNode)("div",{class:"bk-slider-runway",ref:h,style:C.value,onClick:S},[(0,t.createVNode)("div",{class:["bk-slider-bar",e.vertical?"vertical":"horizontal",{disable:e.disable}],style:k.value},null),e.showInterval?E.value.map((function(a,r){return(0,t.createVNode)("div",{key:r,class:["bk-slider-interval",{vertical:e.vertical}],style:z(a)},null)})):void 0,e.customContent?B.value.map((function(a,r){return(0,t.createVNode)("div",{key:r,class:["bk-slider-interval",{vertical:e.vertical}],style:z(a.percent)},null)})):void 0,e.showBetweenLabel||e.showIntervalLabel||e.customContent?(0,t.createVNode)("div",{class:["bk-slider-labels",e.vertical?"vertical":"horizontal"]},[e.showBetweenLabel?[(0,t.createVNode)("div",{class:"label-start",style:[{opacity:R("start")}]},[e.formatterLabel(e.minValue)]),(0,t.createVNode)("div",{class:"label-end",style:[{opacity:R("end")}]},[e.formatterLabel(e.maxValue)])]:e.showIntervalLabel?T.value.map((function(a,r){return(0,t.createVNode)("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:r,style:z(a.stepWidth)},[a.stepLabel])})):e.customContent?B.value.map((function(a,r){return(0,t.createVNode)("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:r,style:z(a.percent)},[a.label])})):void 0]):void 0,(0,t.createVNode)(s,{modelValue:c.value,"onUpdate:modelValue":function(e){return c.value=e},ref:V,params:O.value,onEmitChange:M,onResetSize:P},null),e.range?(0,t.createVNode)(s,{modelValue:m.value,"onUpdate:modelValue":function(e){return m.value=e},ref:y,params:O.value,onEmitChange:M,onResetSize:P},null):void 0]),e.showInput&&!e.vertical?(0,t.createVNode)("div",{class:"bk-slider-input"},[(0,t.createVNode)("div",{class:"input-item"},[(0,t.createVNode)(o(),{type:"number",modelValue:f.value,max:e.maxValue,min:e.minValue,onChange:G},null)]),j.value&&m.value?[(0,t.createVNode)("div",{class:"input-center"},[(0,t.createTextVNode)("~")]),(0,t.createVNode)("div",{class:"input-item"},[(0,t.createVNode)(o(),{type:"number",modelValue:p.value,max:e.maxValue,min:e.minValue,onChange:A},null)])]:void 0]):void 0,null===(r=u.end)||void 0===r?void 0:r.call(u)])}}},render:function(){return this.renderDom()}}),f=(0,e.withInstall)(d)})(),l})()));
|
@@ -24,6 +24,7 @@
|
|
24
24
|
* IN THE SOFTWARE.
|
25
25
|
*/
|
26
26
|
import { PropType } from 'vue';
|
27
|
+
import { PlacementEnum } from '../shared';
|
27
28
|
interface Params {
|
28
29
|
vertical: boolean;
|
29
30
|
showTip: boolean;
|
@@ -58,7 +59,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
58
59
|
setPosition: (position: number) => void;
|
59
60
|
tip: import("vue").ComputedRef<{
|
60
61
|
content: any;
|
61
|
-
placement:
|
62
|
+
placement: PlacementEnum;
|
62
63
|
}>;
|
63
64
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "emitChange" | "resetSize")[], "update:modelValue" | "emitChange" | "resetSize", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
64
65
|
modelValue: {
|
package/lib/slider/slider.d.ts
CHANGED
@@ -179,10 +179,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
179
179
|
onChange?: (...args: any[]) => any;
|
180
180
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
181
181
|
}, {
|
182
|
+
vertical: boolean;
|
182
183
|
extCls: string;
|
183
184
|
height: string;
|
184
185
|
step: number;
|
185
|
-
vertical: boolean;
|
186
186
|
range: boolean;
|
187
187
|
showInput: boolean;
|
188
188
|
customContent: Record<string, any>;
|