bkui-vue 0.0.1-beta.1 → 0.0.1-beta.13
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/LICENSE.txt +22 -0
- package/README.md +55 -0
- package/dist/bkui-vue.cjs.js +9957 -257
- package/dist/bkui-vue.esm.js +9919 -257
- package/dist/bkui-vue.umd.js +9967 -267
- package/dist/style.css +4010 -428
- package/lib/alert/alert.css +75 -0
- package/lib/alert/alert.d.ts +53 -0
- package/lib/alert/alert.less +110 -0
- package/lib/alert/alert.variable.css +161 -0
- package/lib/alert/index.d.ts +144 -0
- package/lib/alert/index.js +1 -0
- package/lib/animate-number/animate-number.d.ts +22 -0
- package/lib/animate-number/index.d.ts +77 -0
- package/lib/animate-number/index.js +1 -0
- package/lib/backtop/backtop.css +42 -0
- package/lib/backtop/backtop.d.ts +46 -0
- package/lib/backtop/backtop.less +18 -0
- package/lib/backtop/backtop.variable.css +128 -0
- package/lib/backtop/index.d.ts +110 -0
- package/lib/backtop/index.js +1 -0
- package/lib/badge/badge.css +121 -0
- package/lib/badge/badge.d.ts +70 -0
- package/lib/badge/badge.less +137 -0
- package/lib/badge/badge.variable.css +207 -0
- package/lib/badge/index.d.ts +149 -0
- package/lib/badge/index.js +1 -0
- package/lib/breadcrumb/breadcrumb-item.d.ts +32 -0
- package/lib/breadcrumb/breadcrumb.css +59 -0
- package/lib/breadcrumb/breadcrumb.d.ts +26 -0
- package/lib/breadcrumb/breadcrumb.less +54 -0
- package/lib/breadcrumb/breadcrumb.variable.css +145 -0
- package/lib/breadcrumb/index.d.ts +122 -0
- package/lib/breadcrumb/index.js +1 -0
- package/lib/breadcrumb/props.d.ts +4 -0
- package/lib/button/button-group.d.ts +8 -0
- package/lib/button/button.css +242 -22
- package/lib/button/button.d.ts +114 -0
- package/lib/button/button.less +180 -36
- package/lib/button/button.variable.css +339 -0
- package/lib/button/index.d.ts +170 -0
- package/lib/button/index.js +1 -206
- package/lib/card/card.css +63 -0
- package/lib/card/card.d.ts +54 -0
- package/lib/card/card.less +44 -0
- package/lib/card/card.variable.css +149 -0
- package/lib/card/index.d.ts +127 -0
- package/lib/card/index.js +1 -0
- package/lib/checkbox/checkbox-group.d.ts +44 -0
- package/lib/checkbox/checkbox.css +54 -125
- package/lib/checkbox/checkbox.d.ts +105 -0
- package/lib/checkbox/checkbox.less +66 -6
- package/lib/checkbox/checkbox.variable.css +150 -0
- package/lib/checkbox/common.d.ts +13 -0
- package/lib/checkbox/index.d.ts +221 -0
- package/lib/checkbox/index.js +1 -64
- package/lib/checkbox/type.d.ts +19 -0
- package/lib/collapse/collapse.css +30 -0
- package/lib/collapse/collapse.d.ts +74 -0
- package/lib/collapse/collapse.less +37 -0
- package/lib/collapse/collapse.variable.css +30 -0
- package/lib/collapse/index.d.ts +130 -0
- package/lib/collapse/index.js +1 -0
- package/lib/components.d.ts +31 -0
- package/lib/date-picker/date-picker.css +407 -0
- package/lib/date-picker/date-picker.d.ts +357 -0
- package/lib/date-picker/date-picker.less +526 -0
- package/lib/date-picker/date-picker.variable.css +493 -0
- package/lib/date-picker/fecha.d.ts +6 -0
- package/lib/date-picker/index.d.ts +525 -0
- package/lib/date-picker/index.js +1 -0
- package/lib/date-picker/interface.d.ts +22 -0
- package/lib/date-picker/utils.d.ts +97 -0
- package/lib/dialog/dialog.css +68 -0
- package/lib/dialog/dialog.d.ts +83 -0
- package/lib/dialog/dialog.less +80 -0
- package/lib/dialog/dialog.variable.css +68 -0
- package/lib/dialog/index.d.ts +183 -0
- package/lib/dialog/index.js +1 -0
- package/lib/directives/clickoutside.d.ts +23 -0
- package/lib/directives/index.d.ts +3 -0
- package/lib/directives/index.js +15 -0
- package/lib/directives/mousewheel.d.ts +3 -0
- package/lib/directives/tooltips.d.ts +17 -0
- package/lib/divider/divider.css +38 -0
- package/lib/divider/divider.d.ts +40 -0
- package/lib/divider/divider.less +53 -0
- package/lib/divider/divider.variable.css +124 -0
- package/lib/divider/index.d.ts +110 -0
- package/lib/divider/index.js +1 -0
- package/lib/dropdown/dropdown-item.d.ts +18 -0
- package/lib/dropdown/dropdown-menu.d.ts +15 -0
- package/lib/dropdown/dropdown.css +43 -0
- package/lib/dropdown/dropdown.d.ts +49 -0
- package/lib/dropdown/dropdown.less +54 -0
- package/lib/dropdown/dropdown.variable.css +129 -0
- package/lib/dropdown/index.d.ts +160 -0
- package/lib/dropdown/index.js +1 -0
- package/lib/exception/exception.css +32 -0
- package/lib/exception/exception.d.ts +24 -0
- package/lib/exception/exception.less +39 -0
- package/lib/exception/exception.variable.css +118 -0
- package/lib/exception/index.d.ts +88 -0
- package/lib/exception/index.js +1 -0
- package/lib/fixed-navbar/fixed-navbar.css +42 -0
- package/lib/fixed-navbar/fixed-navbar.d.ts +28 -0
- package/lib/fixed-navbar/fixed-navbar.less +53 -0
- package/lib/fixed-navbar/fixed-navbar.variable.css +128 -0
- package/lib/fixed-navbar/index.d.ts +88 -0
- package/lib/fixed-navbar/index.js +1 -0
- package/lib/form/common.d.ts +3 -0
- package/lib/form/form-item.d.ts +140 -0
- package/lib/form/form.css +39 -0
- package/lib/form/form.d.ts +76 -0
- package/lib/form/form.less +50 -0
- package/lib/form/form.variable.css +39 -0
- package/lib/form/index.d.ts +4 -0
- package/lib/form/index.js +1 -0
- package/lib/form/type.d.ts +21 -0
- package/lib/form/validator.d.ts +8 -0
- package/lib/icon/angle-double-left.d.ts +4 -0
- package/lib/icon/angle-double-right.d.ts +4 -0
- package/lib/icon/angle-down-line.d.ts +4 -0
- package/lib/icon/angle-down.d.ts +4 -0
- package/lib/icon/angle-left.d.ts +4 -0
- package/lib/icon/angle-right.d.ts +4 -0
- package/lib/icon/angle-up.d.ts +4 -0
- package/lib/icon/circle.d.ts +4 -0
- package/lib/icon/close.d.ts +4 -0
- package/lib/icon/code.d.ts +4 -0
- package/lib/icon/cog-shape.d.ts +4 -0
- package/lib/icon/collapse-left.d.ts +4 -0
- package/lib/icon/copy.d.ts +4 -0
- package/lib/icon/done.d.ts +4 -0
- package/lib/icon/down-shape.d.ts +4 -0
- package/lib/icon/down-small.d.ts +4 -0
- package/lib/icon/error.d.ts +4 -0
- package/lib/icon/eye.d.ts +4 -0
- package/lib/icon/folder-open.d.ts +4 -0
- package/lib/icon/folder-shape-open.d.ts +4 -0
- package/lib/icon/folder-shape.d.ts +4 -0
- package/lib/icon/folder.d.ts +4 -0
- package/lib/icon/help-document-fill.d.ts +4 -0
- package/lib/icon/help-fill.d.ts +4 -0
- package/lib/icon/help.d.ts +4 -0
- package/lib/icon/icon.d.ts +12 -0
- package/lib/icon/index.d.ts +38 -0
- package/lib/icon/index.js +15 -0
- package/lib/icon/info-line.d.ts +4 -0
- package/lib/icon/info.d.ts +4 -0
- package/lib/icon/play-shape.d.ts +4 -0
- package/lib/icon/plus.d.ts +4 -0
- package/lib/icon/right-shape.d.ts +4 -0
- package/lib/icon/search.d.ts +4 -0
- package/lib/icon/share.d.ts +4 -0
- package/lib/icon/success.d.ts +4 -0
- package/lib/icon/switcher-loading.d.ts +4 -0
- package/lib/icon/text-file.d.ts +4 -0
- package/lib/icon/tree-application-shape.d.ts +4 -0
- package/lib/icon/unvisible.d.ts +4 -0
- package/lib/icon/warn.d.ts +4 -0
- package/lib/index.d.ts +3 -0
- package/lib/input/index.d.ts +275 -0
- package/lib/input/index.js +15 -60
- package/lib/input/input.css +114 -148
- package/lib/input/input.d.ts +185 -0
- package/lib/input/input.less +107 -40
- package/lib/input/input.variable.css +218 -0
- package/lib/link/index.d.ts +116 -0
- package/lib/link/index.js +1 -0
- package/lib/link/link.css +55 -0
- package/lib/link/link.d.ts +46 -0
- package/lib/link/link.less +74 -0
- package/lib/link/link.variable.css +141 -0
- package/lib/loading/index.d.ts +125 -0
- package/lib/loading/index.js +1 -0
- package/lib/loading/loading.css +225 -0
- package/lib/loading/loading.d.ts +64 -0
- package/lib/loading/loading.less +181 -0
- package/lib/loading/loading.variable.css +311 -0
- package/lib/menu/index.d.ts +169 -0
- package/lib/menu/index.js +1 -0
- package/lib/menu/menu-group.d.ts +13 -0
- package/lib/menu/menu-item.d.ts +15 -0
- package/lib/menu/menu.css +182 -0
- package/lib/menu/menu.d.ts +60 -0
- package/lib/menu/menu.less +180 -0
- package/lib/menu/menu.variable.css +268 -0
- package/lib/menu/submenu.d.ts +21 -0
- package/lib/menu/submenu.less +5 -0
- package/lib/menu/submenu.variable.css +86 -0
- package/lib/menu/utils.d.ts +41 -0
- package/lib/message/index.d.ts +2 -0
- package/lib/message/index.js +1 -0
- package/lib/message/message.css +53 -0
- package/lib/message/message.less +61 -0
- package/lib/message/message.variable.css +139 -0
- package/lib/message/messageConstructor.d.ts +61 -0
- package/lib/modal/index.d.ts +155 -0
- package/lib/modal/index.js +1 -0
- package/lib/modal/modal.css +11 -0
- package/lib/modal/modal.d.ts +47 -0
- package/lib/modal/modal.less +12 -0
- package/lib/modal/modal.variable.css +11 -0
- package/lib/modal/props.mixin.d.ts +22 -0
- package/lib/navigation/index.d.ts +2 -0
- package/lib/navigation/index.js +1 -0
- package/lib/navigation/navigation-title.d.ts +22 -0
- package/lib/navigation/navigation.css +184 -0
- package/lib/navigation/navigation.d.ts +94 -0
- package/lib/navigation/navigation.less +210 -0
- package/lib/navigation/navigation.variable.css +270 -0
- package/lib/notify/index.d.ts +2 -0
- package/lib/notify/index.js +1 -0
- package/lib/notify/notify.css +49 -0
- package/lib/notify/notify.less +58 -0
- package/lib/notify/notify.variable.css +135 -0
- package/lib/notify/notifyConstructor.d.ts +75 -0
- package/lib/popover/index.d.ts +202 -0
- package/lib/popover/index.js +1 -0
- package/lib/popover/popover.css +55 -0
- package/lib/popover/popover.d.ts +88 -0
- package/lib/popover/popover.less +70 -0
- package/lib/popover/popover.variable.css +141 -0
- package/lib/preset.d.ts +8 -0
- package/lib/progress/circle.d.ts +6 -0
- package/lib/progress/index.d.ts +228 -0
- package/lib/progress/index.js +1 -0
- package/lib/progress/line.d.ts +6 -0
- package/lib/progress/progress.css +97 -0
- package/lib/progress/progress.d.ts +118 -0
- package/lib/progress/progress.less +94 -0
- package/lib/progress/progress.variable.css +183 -0
- package/lib/radio/common.d.ts +13 -0
- package/lib/radio/index.d.ts +228 -0
- package/lib/radio/index.js +1 -61
- package/lib/radio/radio-button.d.ts +83 -0
- package/lib/radio/radio-group.d.ts +40 -0
- package/lib/radio/radio.css +128 -125
- package/lib/radio/radio.d.ts +77 -0
- package/lib/radio/radio.less +173 -20
- package/lib/radio/radio.variable.css +224 -0
- package/lib/radio/type.d.ts +9 -0
- package/lib/rate/index.d.ts +101 -0
- package/lib/rate/index.js +1 -0
- package/lib/rate/rate.css +10 -0
- package/lib/rate/rate.d.ts +29 -0
- package/lib/rate/rate.less +11 -0
- package/lib/rate/rate.variable.css +10 -0
- package/lib/rate/star.css +24 -0
- package/lib/rate/star.d.ts +57 -0
- package/lib/rate/star.less +29 -0
- package/lib/rate/star.variable.css +24 -0
- package/lib/select/common.d.ts +28 -0
- package/lib/select/index.d.ts +950 -0
- package/lib/select/index.js +15 -0
- package/lib/select/option.d.ts +32 -0
- package/lib/select/optionGroup.d.ts +115 -0
- package/lib/select/select.css +157 -0
- package/lib/select/select.d.ts +285 -0
- package/lib/select/select.less +203 -0
- package/lib/select/select.variable.css +243 -0
- package/lib/shared/bk-helper-core.d.ts +87 -0
- package/lib/shared/bk-mask-manager.d.ts +47 -0
- package/lib/shared/bk-pop-manager.d.ts +19 -0
- package/lib/shared/bk-popover.d.ts +86 -0
- package/lib/shared/index.d.ts +51 -0
- package/lib/shared/index.js +1 -13
- package/lib/shared/scrollbar-width.d.ts +1 -0
- package/lib/shared/vue-types.d.ts +115 -0
- package/lib/shared/z-index-manager.d.ts +93 -0
- package/lib/sideslider/index.d.ts +139 -0
- package/lib/sideslider/index.js +1 -0
- package/lib/sideslider/sideslider.css +69 -0
- package/lib/sideslider/sideslider.d.ts +54 -0
- package/lib/sideslider/sideslider.less +86 -0
- package/lib/sideslider/sideslider.variable.css +155 -0
- package/lib/slider/index.d.ts +27 -0
- package/lib/slider/index.js +15 -0
- package/lib/slider/slider-button.d.ts +72 -0
- package/lib/slider/slider.css +149 -0
- package/lib/slider/slider.d.ts +159 -0
- package/lib/slider/slider.less +179 -0
- package/lib/slider/slider.variable.css +235 -0
- package/lib/steps/index.d.ts +198 -0
- package/lib/steps/index.js +15 -0
- package/lib/steps/steps.css +285 -0
- package/lib/steps/steps.d.ts +148 -0
- package/lib/steps/steps.less +320 -0
- package/lib/steps/steps.variable.css +371 -0
- package/lib/styles/index.d.ts +38 -0
- package/lib/styles/index.js +1 -0
- package/lib/styles/mixins/animate.css +21 -0
- package/lib/styles/mixins/animate.less +27 -0
- package/lib/styles/mixins/animate.variable.css +21 -0
- package/lib/styles/mixins/ellipsis.less +8 -0
- package/lib/styles/mixins/mixins.css +21 -0
- package/lib/styles/mixins/mixins.less +2 -0
- package/lib/styles/mixins/mixins.variable.css +21 -0
- package/lib/styles/mixins/popper.css +43 -0
- package/lib/styles/mixins/popper.less +52 -0
- package/lib/styles/mixins/popper.variable.css +43 -0
- package/lib/styles/mixins/size.less +10 -1
- package/lib/styles/reset.css +273 -0
- package/lib/styles/reset.less +313 -0
- package/lib/styles/reset.variable.css +273 -0
- package/lib/styles/themes/themes.less +84 -284
- package/lib/switcher/index.d.ts +222 -0
- package/lib/switcher/index.js +1 -0
- package/lib/switcher/switcher.css +258 -0
- package/lib/switcher/switcher.d.ts +97 -0
- package/lib/switcher/switcher.less +302 -0
- package/lib/switcher/switcher.variable.css +344 -0
- package/lib/tab/index.d.ts +416 -0
- package/lib/tab/index.js +1 -0
- package/lib/tab/tab-nav.d.ts +154 -0
- package/lib/tab/tab-panel.d.ts +46 -0
- package/lib/tab/tab.css +147 -0
- package/lib/tab/tab.d.ts +131 -0
- package/lib/tab/tab.less +221 -0
- package/lib/tab/tab.variable.css +233 -0
- package/lib/table/index.d.ts +119 -0
- package/lib/table/index.js +1 -0
- package/lib/table/props.d.ts +41 -0
- package/lib/table/render.d.ts +47 -0
- package/lib/table/table.css +44 -0
- package/lib/table/table.d.ts +26 -0
- package/lib/table/table.less +67 -0
- package/lib/table/table.variable.css +130 -0
- package/lib/table/utils.d.ts +22 -0
- package/lib/tag/index.d.ts +338 -0
- package/lib/tag/index.js +1 -0
- package/lib/tag/tag.d.ts +54 -0
- package/lib/tag/tag.less +5 -0
- package/lib/tag/tag.variable.css +86 -0
- package/lib/tree/index.d.ts +149 -0
- package/lib/tree/index.js +1 -0
- package/lib/tree/tree.css +35 -0
- package/lib/tree/tree.d.ts +58 -0
- package/lib/tree/tree.less +55 -0
- package/lib/tree/tree.variable.css +35 -0
- package/lib/tree/util.d.ts +89 -0
- package/lib/use-message.d.ts +2 -0
- package/package.json +92 -40
- package/lib/styles/mixins/size.css +0 -0
- package/lib/styles/themes/themes.css +0 -119
- package/lib/styles/themes/variables.css +0 -27
- package/lib/styles/themes/variables.less +0 -36
@@ -0,0 +1,54 @@
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
2
|
+
direction: {
|
3
|
+
type: StringConstructor;
|
4
|
+
default: string;
|
5
|
+
validator: (value: string) => boolean;
|
6
|
+
};
|
7
|
+
isShow: {
|
8
|
+
type: BooleanConstructor;
|
9
|
+
default: boolean;
|
10
|
+
};
|
11
|
+
width: {
|
12
|
+
type: (NumberConstructor | StringConstructor)[];
|
13
|
+
default: string;
|
14
|
+
};
|
15
|
+
height: {
|
16
|
+
type: (NumberConstructor | StringConstructor)[];
|
17
|
+
default: string;
|
18
|
+
};
|
19
|
+
customClass: {
|
20
|
+
type: (ObjectConstructor | StringConstructor)[];
|
21
|
+
default: string;
|
22
|
+
};
|
23
|
+
scrollable: {
|
24
|
+
type: BooleanConstructor;
|
25
|
+
default: boolean;
|
26
|
+
};
|
27
|
+
}, unknown, unknown, {}, {
|
28
|
+
handleClose(): void;
|
29
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("closed" | "update:isShow")[], "closed" | "update:isShow", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
30
|
+
direction?: unknown;
|
31
|
+
isShow?: unknown;
|
32
|
+
width?: unknown;
|
33
|
+
height?: unknown;
|
34
|
+
customClass?: unknown;
|
35
|
+
scrollable?: unknown;
|
36
|
+
} & {
|
37
|
+
width: string | number;
|
38
|
+
height: string | number;
|
39
|
+
isShow: boolean;
|
40
|
+
customClass: string;
|
41
|
+
scrollable: boolean;
|
42
|
+
direction: string;
|
43
|
+
} & {}> & {
|
44
|
+
onClosed?: (...args: any[]) => any;
|
45
|
+
"onUpdate:isShow"?: (...args: any[]) => any;
|
46
|
+
}, {
|
47
|
+
width: string | number;
|
48
|
+
height: string | number;
|
49
|
+
isShow: boolean;
|
50
|
+
customClass: string;
|
51
|
+
scrollable: boolean;
|
52
|
+
direction: string;
|
53
|
+
}>;
|
54
|
+
export default _default;
|
@@ -0,0 +1,86 @@
|
|
1
|
+
@import '../styles/themes/themes.less';
|
2
|
+
|
3
|
+
.bk-modal-wrapper {
|
4
|
+
&.bk-sideslider-wrapper {
|
5
|
+
position: fixed;
|
6
|
+
top: 0;
|
7
|
+
bottom: 0;
|
8
|
+
left: auto;
|
9
|
+
background: #fff;
|
10
|
+
transform: initial;
|
11
|
+
box-shadow: -5px 0 8px -5px rgb(0 0 0 / 20%);
|
12
|
+
|
13
|
+
&.scroll-able {
|
14
|
+
.bk-modal-content {
|
15
|
+
overflow: auto;
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
.bk-sideslider-header {
|
20
|
+
width: 100%;
|
21
|
+
height: 60px;
|
22
|
+
background: #fff;
|
23
|
+
border-bottom: 1px solid #dcdee5;
|
24
|
+
|
25
|
+
.bk-sideslider-close {
|
26
|
+
position: absolute;
|
27
|
+
top: 0;
|
28
|
+
width: 30px;
|
29
|
+
height: 60px;
|
30
|
+
font-size: 24px;
|
31
|
+
line-height: 60px;
|
32
|
+
color: #fff;
|
33
|
+
text-align: center;
|
34
|
+
cursor: pointer;
|
35
|
+
background-color: @primary-color;
|
36
|
+
|
37
|
+
&.right {
|
38
|
+
left: 0;
|
39
|
+
|
40
|
+
&::before {
|
41
|
+
top: 50%;
|
42
|
+
left: 50%;
|
43
|
+
display: inline-block;
|
44
|
+
width: 8px;
|
45
|
+
height: 8px;
|
46
|
+
border-top: solid 2px #fff;
|
47
|
+
border-right: solid 2px #fff;
|
48
|
+
content: '';
|
49
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
&.left {
|
54
|
+
right: 0;
|
55
|
+
|
56
|
+
&::before {
|
57
|
+
top: 50%;
|
58
|
+
left: 50%;
|
59
|
+
display: inline-block;
|
60
|
+
width: 8px;
|
61
|
+
height: 8px;
|
62
|
+
border-top: solid 2px #fff;
|
63
|
+
border-left: solid 2px #fff;
|
64
|
+
content: '';
|
65
|
+
transform: translate(50%, -50%) rotate(-45deg);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
|
70
|
+
}
|
71
|
+
|
72
|
+
.bk-sideslider-title {
|
73
|
+
height: 60px;
|
74
|
+
padding-left: 30px;
|
75
|
+
font-size: 16px;
|
76
|
+
font-weight: 700;
|
77
|
+
line-height: 60px;
|
78
|
+
color: #666;
|
79
|
+
|
80
|
+
&.right {
|
81
|
+
padding: 0px 0px 0px 50px;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
@@ -0,0 +1,155 @@
|
|
1
|
+
:root {
|
2
|
+
--bk-prefix: bk;
|
3
|
+
--primary-color: #3a84ff;
|
4
|
+
--success-color: #2dcb56;
|
5
|
+
--warning-color: #ff9c01;
|
6
|
+
--danger-color: #ea3636;
|
7
|
+
--default-color: #63656e;
|
8
|
+
--gray-color: #979ba5;
|
9
|
+
--light-gray: #c4c6cc;
|
10
|
+
--white-color: white;
|
11
|
+
--disable-color: #dcdee5;
|
12
|
+
--font-size-base: 12px;
|
13
|
+
--font-size-medium: 14px;
|
14
|
+
--font-size-large: 16px;
|
15
|
+
--line-height-base: 16px;
|
16
|
+
--line-height-medium: 16px;
|
17
|
+
--line-height-large: 18px;
|
18
|
+
--component-size-small: 26px;
|
19
|
+
--component-size-base: 32px;
|
20
|
+
--component-size-large: 38px;
|
21
|
+
--border-width-base: 1px;
|
22
|
+
--border-style-base: solid;
|
23
|
+
--border-radius-base: 2px;
|
24
|
+
--input-disabled-bg: #fafbfd;
|
25
|
+
--input-disabled-border: var(--disable-color);
|
26
|
+
--input-height-base: var(--component-size-base);
|
27
|
+
--input-color: var(--default-color);
|
28
|
+
--input-bg: white;
|
29
|
+
--input-border-color: var(--light-gray);
|
30
|
+
--input-broder-radius: 3px;
|
31
|
+
--input-shadow-color: #a3c5fd;
|
32
|
+
--input-horizontal-padding: 10px;
|
33
|
+
--input-block-color: #f4f6fa;
|
34
|
+
--input-icon-size: var(--font-size-large);
|
35
|
+
--input-maxlength-color: #979ba5;
|
36
|
+
--button-primary-hover-color: #5594fa;
|
37
|
+
--button-danger-hover-color: #ff5656;
|
38
|
+
--button-success-hover-color: #45e35f;
|
39
|
+
--button-warning-hover-color: #ffb848;
|
40
|
+
--button-default-hover-border-color: #979ba5;
|
41
|
+
--button-primary-active-color: #2c77f4;
|
42
|
+
--button-danger-active-color: #db2626;
|
43
|
+
--button-success-active-color: #1ab943;
|
44
|
+
--button-warning-active-color: #eb9000;
|
45
|
+
--fixed-navbar-background: #fff;
|
46
|
+
--fixed-navbar-boxshadow-color: rgba(0, 0, 0, 0.1);
|
47
|
+
--switch-default-color: #fff;
|
48
|
+
--switch-grey-color: #c4c6cc;
|
49
|
+
--breadcrumb-black-color: #979ba5;
|
50
|
+
--breadcrumb-primary-hover-color: #0082ff;
|
51
|
+
--breadcrumb-fn-main-color: #63656e;
|
52
|
+
--link-default-hover-color: #979ba5;
|
53
|
+
--link-primary-hover-color: #699df4;
|
54
|
+
--link-success-hover-color: #45e35f;
|
55
|
+
--link-warning-hover-color: #ffb848;
|
56
|
+
--link-danger-hover-color: #ff5656;
|
57
|
+
--link-default-disabled-color: #dcdee5;
|
58
|
+
--link-primary-disabled-color: #a3c5fd;
|
59
|
+
--link-success-disabled-color: #94f5a4;
|
60
|
+
--link-warning-disabled-color: #ffd695;
|
61
|
+
--link-danger-disabled-color: #fd9c9c;
|
62
|
+
--message-color: var(--default-color);
|
63
|
+
--message-primary-bg-color: #f0f8ff;
|
64
|
+
--message-primary-border-color: #e1ecff;
|
65
|
+
--message-warning-bg-color: #fff4e2;
|
66
|
+
--message-warning-border-color: #ffe8c3;
|
67
|
+
--message-success-bg-color: #f2fff4;
|
68
|
+
--message-success-border-color: #dcffe2;
|
69
|
+
--message-danger-bg-color: #ffeded;
|
70
|
+
--message-danger-border-color: #ffdddd;
|
71
|
+
--slider-default-bg: #dcdee5;
|
72
|
+
--slider-disable-bar-bg: #979ba5;
|
73
|
+
--menu-bg-color: #182132;
|
74
|
+
--submenu-bg-color: #151d2c;
|
75
|
+
--menu-active-bg-color: linear-gradient(90deg, #3f87ff 0%, #3a84ff 100%);
|
76
|
+
--menu-color: #96a2b9;
|
77
|
+
--menu-group-color: var(--default-color);
|
78
|
+
--menu-width: 260px;
|
79
|
+
--menu-collapse-width: 60px;
|
80
|
+
--menu-active-color: white;
|
81
|
+
--nav-header-bg-color: #182132;
|
82
|
+
--nav-bg-color: #182132;
|
83
|
+
--date-picker-disabled-bg: #fafbfd;
|
84
|
+
--date-picker-dropdown-mb: 4px;
|
85
|
+
--date-picker-dropdown-bg: #fff;
|
86
|
+
}
|
87
|
+
.bk-modal-wrapper.bk-sideslider-wrapper {
|
88
|
+
position: fixed;
|
89
|
+
top: 0;
|
90
|
+
bottom: 0;
|
91
|
+
left: auto;
|
92
|
+
background: #fff;
|
93
|
+
transform: initial;
|
94
|
+
box-shadow: -5px 0 8px -5px rgba(0, 0, 0, 0.2);
|
95
|
+
}
|
96
|
+
.bk-modal-wrapper.bk-sideslider-wrapper.scroll-able .bk-modal-content {
|
97
|
+
overflow: auto;
|
98
|
+
}
|
99
|
+
.bk-modal-wrapper.bk-sideslider-wrapper .bk-sideslider-header {
|
100
|
+
width: 100%;
|
101
|
+
height: 60px;
|
102
|
+
background: #fff;
|
103
|
+
border-bottom: 1px solid #dcdee5;
|
104
|
+
}
|
105
|
+
.bk-modal-wrapper.bk-sideslider-wrapper .bk-sideslider-header .bk-sideslider-close {
|
106
|
+
position: absolute;
|
107
|
+
top: 0;
|
108
|
+
width: 30px;
|
109
|
+
height: 60px;
|
110
|
+
font-size: 24px;
|
111
|
+
line-height: 60px;
|
112
|
+
color: #fff;
|
113
|
+
text-align: center;
|
114
|
+
cursor: pointer;
|
115
|
+
background-color: var(--primary-color);
|
116
|
+
}
|
117
|
+
.bk-modal-wrapper.bk-sideslider-wrapper .bk-sideslider-header .bk-sideslider-close.right {
|
118
|
+
left: 0;
|
119
|
+
}
|
120
|
+
.bk-modal-wrapper.bk-sideslider-wrapper .bk-sideslider-header .bk-sideslider-close.right::before {
|
121
|
+
top: 50%;
|
122
|
+
left: 50%;
|
123
|
+
display: inline-block;
|
124
|
+
width: 8px;
|
125
|
+
height: 8px;
|
126
|
+
border-top: solid 2px #fff;
|
127
|
+
border-right: solid 2px #fff;
|
128
|
+
content: '';
|
129
|
+
transform: translate(-50%, -50%) rotate(45deg);
|
130
|
+
}
|
131
|
+
.bk-modal-wrapper.bk-sideslider-wrapper .bk-sideslider-header .bk-sideslider-close.left {
|
132
|
+
right: 0;
|
133
|
+
}
|
134
|
+
.bk-modal-wrapper.bk-sideslider-wrapper .bk-sideslider-header .bk-sideslider-close.left::before {
|
135
|
+
top: 50%;
|
136
|
+
left: 50%;
|
137
|
+
display: inline-block;
|
138
|
+
width: 8px;
|
139
|
+
height: 8px;
|
140
|
+
border-top: solid 2px #fff;
|
141
|
+
border-left: solid 2px #fff;
|
142
|
+
content: '';
|
143
|
+
transform: translate(50%, -50%) rotate(-45deg);
|
144
|
+
}
|
145
|
+
.bk-modal-wrapper.bk-sideslider-wrapper .bk-sideslider-header .bk-sideslider-title {
|
146
|
+
height: 60px;
|
147
|
+
padding-left: 30px;
|
148
|
+
font-size: 16px;
|
149
|
+
font-weight: 700;
|
150
|
+
line-height: 60px;
|
151
|
+
color: #666;
|
152
|
+
}
|
153
|
+
.bk-modal-wrapper.bk-sideslider-wrapper .bk-sideslider-header .bk-sideslider-title.right {
|
154
|
+
padding: 0px 0px 0px 50px;
|
155
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
/**
|
2
|
+
* Tencent is pleased to support the open source community by making
|
3
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
4
|
+
*
|
5
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
6
|
+
*
|
7
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
8
|
+
*
|
9
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
10
|
+
*
|
11
|
+
* ---------------------------------------------------
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
13
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
14
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
15
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
16
|
+
*
|
17
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
18
|
+
* the Software.
|
19
|
+
*
|
20
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
21
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
23
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
24
|
+
* IN THE SOFTWARE.
|
25
|
+
*/
|
26
|
+
import Slider from './slider';
|
27
|
+
export default Slider;
|
@@ -0,0 +1,15 @@
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("../shared"),require("../input")):"function"==typeof define&&define.amd?define(["exports","vue","../shared","../input"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bkuiVue={},e.Vue,e.Shared,e.Input)}(this,(function(e,t,a,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=r(n),l={exports:{}};!function(e){var t=function(e){var t,a=Object.prototype,n=a.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},u=r.iterator||"@@iterator",l=r.asyncIterator||"@@asyncIterator",o=r.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,n){var r=t&&t.prototype instanceof h?t:h,u=Object.create(r.prototype),l=new C(n||[]);return u._invoke=function(e,t,a){var n=m;return function(r,u){if(n===f)throw new Error("Generator is already running");if(n===d){if("throw"===r)throw u;return j()}for(a.method=r,a.arg=u;;){var l=a.delegate;if(l){var o=k(l,a);if(o){if(o===p)continue;return o}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(n===m)throw n=d,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);n=f;var i=s(e,t,a);if("normal"===i.type){if(n=a.done?d:v,i.arg===p)continue;return{value:i.arg,done:a.done}}"throw"===i.type&&(n=d,a.method="throw",a.arg=i.arg)}}}(e,a,l),u}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 m="suspendedStart",v="suspendedYield",f="executing",d="completed",p={};function h(){}function V(){}function y(){}var b={};i(b,u,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(T([])));w&&w!==a&&n.call(w,u)&&(b=w);var x=y.prototype=h.prototype=Object.create(b);function N(e){["next","throw","return"].forEach((function(t){i(e,t,(function(e){return this._invoke(t,e)}))}))}function L(e,t){function a(r,u,l,o){var i=s(e[r],e,u);if("throw"!==i.type){var c=i.arg,m=c.value;return m&&"object"==typeof m&&n.call(m,"__await")?t.resolve(m.__await).then((function(e){a("next",e,l,o)}),(function(e){a("throw",e,l,o)})):t.resolve(m).then((function(e){c.value=e,l(c)}),(function(e){return a("throw",e,l,o)}))}o(i.arg)}var r;this._invoke=function(e,n){function u(){return new t((function(t,r){a(e,n,t,r)}))}return r=r?r.then(u,u):u()}}function k(e,a){var n=e.iterator[a.method];if(n===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 r=s(n,e.iterator,a.arg);if("throw"===r.type)return a.method="throw",a.arg=r.arg,a.delegate=null,p;var u=r.arg;return u?u.done?(a[e.resultName]=u.value,a.next=e.nextLoc,"return"!==a.method&&(a.method="next",a.arg=t),a.delegate=null,p):u:(a.method="throw",a.arg=new TypeError("iterator result is not an object"),a.delegate=null,p)}function B(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 C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(B,this),this.reset(!0)}function T(e){if(e){var a=e[u];if(a)return a.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,l=function a(){for(;++r<e.length;)if(n.call(e,r))return a.value=e[r],a.done=!1,a;return a.value=t,a.done=!0,a};return l.next=l}}return{next:j}}function j(){return{value:t,done:!0}}return V.prototype=y,i(x,"constructor",y),i(y,"constructor",V),V.displayName=i(y,o,"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,o,"GeneratorFunction")),e.prototype=Object.create(x),e},e.awrap=function(e){return{__await:e}},N(L.prototype),i(L.prototype,l,(function(){return this})),e.AsyncIterator=L,e.async=function(t,a,n,r,u){void 0===u&&(u=Promise);var l=new L(c(t,a,n,r),u);return e.isGeneratorFunction(a)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},N(x),i(x,o,"Generator"),i(x,u,(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 n=t.pop();if(n in e)return a.value=n,a.done=!1,a}return a.done=!0,a}},e.values=T,C.prototype={constructor:C,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)&&n.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 r(n,r){return o.type="throw",o.arg=e,a.next=n,r&&(a.method="next",a.arg=t),!!r}for(var u=this.tryEntries.length-1;u>=0;--u){var l=this.tryEntries[u],o=l.completion;if("root"===l.tryLoc)return r("end");if(l.tryLoc<=this.prev){var i=n.call(l,"catchLoc"),c=n.call(l,"finallyLoc");if(i&&c){if(this.prev<l.catchLoc)return r(l.catchLoc,!0);if(this.prev<l.finallyLoc)return r(l.finallyLoc)}else if(i){if(this.prev<l.catchLoc)return r(l.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return r(l.finallyLoc)}}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var r=this.tryEntries[a];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var u=r;break}}u&&("break"===e||"continue"===e)&&u.tryLoc<=t&&t<=u.finallyLoc&&(u=null);var l=u?u.completion:{};return l.type=e,l.arg=t,u?(this.method="next",this.next=u.finallyLoc,p):this.complete(l)},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 n=a.completion;if("throw"===n.type){var r=n.arg;E(a)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,a,n){return this.delegate={iterator:T(e),resultName:a,nextLoc:n},"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)}}(l);var o=l.exports;
|
2
|
+
/*! *****************************************************************************
|
3
|
+
Copyright (c) Microsoft Corporation.
|
4
|
+
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
6
|
+
purpose with or without fee is hereby granted.
|
7
|
+
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
15
|
+
***************************************************************************** */function i(e,t,a,n){return new(a||(a=Promise))((function(r,u){function l(e){try{i(n.next(e))}catch(e){u(e)}}function o(e){try{i(n.throw(e))}catch(e){u(e)}}function i(e){var t;e.done?r(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(l,o)}i((n=n.apply(e,t||[])).next())}))}var c=t.defineComponent({name:"BkSliderButton",props:{modelValue:{type:Number,default:0},params:{type:Object,default:function(){return{}}}},emits:["emitChange","resetSize","update:modelValue"],setup:function(e,a){var n=a.emit,r=t.ref(!1),u=t.ref(!1),l=t.ref(0),o=t.ref(0),i=t.ref(0),c=t.ref(null),v=t.ref(e.modelValue),f=t.ref(0),d=t.ref(0),p=t.ref(!1),h=t.ref(null),V=t.computed((function(){return"".concat((e.modelValue-e.params.minValue)/(e.params.maxValue-e.params.minValue)*100,"%")})),y=t.computed((function(){return e.params.vertical?{bottom:V.value}:{left:V.value}})),b=t.computed((function(){return e.params.formatterButtonLabel(e.modelValue)})),g=function(t){e.params.disable||(t.preventDefault(),w(t),s(window,"mousemove",x),s(window,"touchmove",x),s(window,"mouseup",N),s(window,"touchend",N))},w=function(t){r.value=!0,u.value=!0,e.params.vertical?l.value=t.clientY:o.value=t.clientX,i.value=parseFloat(V.value),c.value=i.value},x=function(t){if(r.value){u.value=!1,n("resetSize");var a=0;e.params.vertical?(f.value=t.clientY,a=(l.value-f.value)/e.params.sliderSize*100):(d.value=t.clientX,a=(d.value-o.value)/e.params.sliderSize*100),c.value=i.value+a,L(c.value)}},N=function e(){p.value=!1,r.value&&(setTimeout((function(){r.value=!1,u.value||(L(c.value),n("emitChange"))}),0),m(window,"mousemove",x),m(window,"touchmove",x),m(window,"mouseup",e),m(window,"touchend",e))},L=function(t){if(null!==t&&!isNaN(t)){t<0?c.value=0:t>100&&(c.value=100);var a=100/((e.params.maxValue-e.params.minValue)/e.params.step),u=Math.round(t/a)*a*(e.params.maxValue-e.params.minValue)*.01+e.params.minValue;u=parseFloat(u.toFixed(e.params.precision)),n("update:modelValue",u),r.value||e.modelValue===v.value||(v.value=e.modelValue)}};return{renderDom:function(){return t.createVNode("div",{class:["bk-slider-button",e.params.vertical?"vertical":"horizontal",{grabbing:r.value}],ref:h,tabindex:"0",style:y.value,onClick:function(e){return e.stopPropagation()},onMousedown:g},[t.createVNode("div",{class:["slider-button",{"slider-button-disable":e.params.disable}]},null),e.params.showButtonLabel&&!e.params.showIntervalLabel?t.createVNode("div",{class:["slider-button-label",e.params.vertical?"vertical":"horizontal"]},[b.value]):void 0])},setPosition:L}},render:function(){return this.renderDom()}}),s=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)},v=t.defineComponent({name:"BkSlider",props:{modelValue:a.PropTypes.oneOfType([a.PropTypes.array,a.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},formatterLabel:{type:Function,default:function(e){return e}},formatterButtonLabel:{type:Function,default:function(e){return e}}},emits:["update:modelValue","change"],setup:function(e,a){var n=this,r=a.slots,l=a.emit,m=t.ref(1),v=t.ref(null),f=t.ref(null),d=t.ref(null),p=t.ref(0),h=t.ref(0),V=t.ref(0),y=t.ref(null),b=t.ref(null),g=t.ref(null),w=t.ref(null),x=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)})),N=t.computed((function(){return Math.min(v.value,f.value)})),L=t.computed((function(){return Math.max(v.value,f.value)})),k=t.computed((function(){return e.range?"".concat(100*(L.value-N.value)/(e.maxValue-e.minValue),"%"):"".concat(100*(v.value-e.minValue)/(e.maxValue-e.minValue),"%")})),B=t.computed((function(){return e.range?"".concat(100*(N.value-e.minValue)/(e.maxValue-e.minValue),"%"):"0%"})),E=t.computed((function(){return e.vertical?{height:k.value,bottom:B.value}:{width:k.value,left:B.value}})),C=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),n=[],r=1;r<t;r++)n.push(r*a);return e.range?n.filter((function(t){return t<100*(N.value-e.minValue)/(e.maxValue-e.minValue)||t>100*(L.value-e.minValue)/(e.maxValue-e.minValue)})):n.filter((function(t){return t>100*(v.value-e.minValue)/(e.maxValue-e.minValue)}))})),T=t.computed((function(){return e.vertical?{height:e.height,width:"4px"}:{}})),j=t.computed((function(){if(!e.showIntervalLabel)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),n=[],r=0;r<=t;r++){var u={stepWidth:r*a,stepLabel:e.formatterLabel(r*e.step)};n.push(u)}return n})),I=t.computed((function(){return Array.isArray(e.modelValue)})),S=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,n=e.customContent[t].label;return{tip:a||n||"",label:n||"",percent:(Number(t)-e.minValue)/(e.maxValue-e.minValue)*100}})):[]})),O=t.computed((function(){return{vertical:e.vertical,showTip:e.showTip,disable:e.disable,maxValue:e.maxValue,minValue:e.minValue,step:e.step,precision:x.value,showButtonLabel:e.showButtonLabel,formatterButtonLabel:e.formatterButtonLabel,showIntervalLabel:e.showIntervalLabel,customContent:e.customContent,sliderSize:m.value}}));t.watch((function(){return e.modelValue}),(function(){z()})),t.watch((function(){return v.value}),(function(t){e.range?l("update:modelValue",[N.value,L.value]):l("update:modelValue",t),h.value=t})),t.watch((function(){return f.value}),(function(e){l("update:modelValue",[N.value,L.value]),V.value=e})),t.onMounted((function(){e.range?(Array.isArray(e.modelValue)?(v.value=Math.max(e.minValue,Number(e.modelValue[0])),f.value=Math.min(e.maxValue,Number(e.modelValue[1]))):(v.value=e.minValue,f.value=e.maxValue),d.value=[v.value,f.value]):("number"!=typeof e.modelValue||isNaN(e.modelValue)?v.value=e.minValue:v.value=Math.min(e.maxValue,Math.max(e.minValue,e.modelValue)),d.value=v.value),p.value=100*e.step/(e.maxValue-e.minValue),_(),s(window,"resize",_())}));var _=function(){y.value&&(m.value=y.value["client".concat(e.vertical?"Height":"Width")])},P=function(t){var a,n;if(t.stopPropagation(),!e.disable){if(_(),e.vertical){var r=null===(a=y.value)||void 0===a?void 0:a.getBoundingClientRect().bottom;G((r-t.clientY)/m.value*100)}else{var u=null===(n=y.value)||void 0===n?void 0:n.getBoundingClientRect().left;G((t.clientX-u)/m.value*100)}M()}},F=function(){return e.range?![N.value,L.value].every((function(e,t){return e===d.value[t]})):e.modelValue!==d.value},z=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]):(v.value=Number(t[0]),f.value=Number(t[1]),F()&&(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):(v.value=t,F()&&(d.value=t)))}},M=function(){return i(n,void 0,void 0,o.mark((function a(){return o.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,t.nextTick();case 2:l("change",e.range?[N.value,L.value]:e.modelValue);case 3:case"end":return a.stop()}}),a)})))},A=function(t){return e.vertical?{bottom:"".concat(t,"%")}:{left:"".concat(t,"%")}},G=function(t){if(e.range){var a=e.minValue+t*(e.maxValue-e.minValue)/100;Math.abs(N.value-a)<Math.abs(L.value-a)?w.value=v.value<f.value?b.value:g.value:w.value=v.value>f.value?b.value:g.value,w.setPosition(t)}else b.value.setPosition(t)},R=function(t){if(""!==t){var a=parseFloat(t);a<e.minValue?(h.value=e.minValue,v.value=e.minValue):a>e.maxValue?(h.value=e.maxValue,v.value=e.maxValue):v.value=a}},D=function(t){if(""!==t){var a=parseFloat(t);a<e.minValue?(V.value=e.minValue,f.value=e.minValue):a>e.maxValue?(V.value=e.maxValue,f.value=e.maxValue):f.value=a}},W=function(t){var a=0;return a="start"===t?e.vertical?e.maxValue:e.minValue:e.vertical?e.minValue:e.maxValue,e.showButtonLabel&&[v.value,f.value].includes(a)?"0":"1"};return{renderDom:function(){var a,n;return t.createVNode(t.Fragment,null,[t.createVNode("div",{class:["bk-slider",e.extCls]},[null===(a=r.start)||void 0===a?void 0:a.call(r),t.createVNode("div",{class:"bk-slider-runway",ref:y,style:T.value,onClick:P},[t.createVNode("div",{class:["bk-slider-bar",e.vertical?"vertical":"horizontal",{disable:e.disable}],style:E.value},null),e.showInterval?C.value.map((function(a,n){return t.createVNode("div",{key:n,class:["bk-slider-interval",{vertical:e.vertical}],style:A(a)},null)})):void 0,e.customContent?S.value.map((function(a,n){return t.createVNode("div",{key:n,class:["bk-slider-interval",{vertical:e.vertical}],style:A(a.percent)},null)})):void 0,e.showBetweenLabel||e.showIntervalLabel||e.customContent?t.createVNode("div",{class:["bk-slider-labels",e.vertical?"vertical":"horizontal"]},[e.showBetweenLabel?[t.createVNode("div",{class:"label-start",style:[{opacity:W("start")}]},[e.formatterLabel(e.minValue)]),t.createVNode("div",{class:"label-end",style:[{opacity:W("end")}]},[e.formatterLabel(e.maxValue)])]:e.showIntervalLabel?j.value.map((function(a,n){return t.createVNode("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:n,style:A(a.stepWidth)},[a.stepLabel])})):e.customContent?S.value.map((function(a,n){return t.createVNode("div",{class:["bk-slider-label",e.vertical?"vertical":"horizontal"],key:n,style:A(a.percent)},[a.label])})):void 0]):void 0,t.createVNode(c,{modelValue:v.value,"onUpdate:modelValue":function(e){return v.value=e},ref:b,params:O.value,onEmitChange:M,onResetSize:_},null),e.range?t.createVNode(c,{modelValue:f.value,"onUpdate:modelValue":function(e){return f.value=e},ref:g,params:O.value,onEmitChange:M,onResetSize:_},null):void 0]),e.showInput&&!e.vertical?t.createVNode("div",{class:"bk-slider-input"},[t.createVNode("div",{class:"input-item"},[t.createVNode(u.default,{type:"number",modelValue:h.value,"onUpdate:modelValue":function(e){return h.value=e},max:e.maxValue,min:e.minValue,onChange:R},null)]),I.value&&f.value?t.createVNode(t.Fragment,null,[t.createVNode("div",{class:"input-center"},[t.createTextVNode("~")]),t.createVNode("div",{class:"input-item"},[t.createVNode(u.default,{type:"number",modelValue:V.value,"onUpdate:modelValue":function(e){return V.value=e},max:e.maxValue,min:e.minValue,onChange:D},null)])]):void 0]):void 0,null===(n=r.end)||void 0===n?void 0:n.call(r)])])}}},render:function(){return this.renderDom()}});v.install=function(e){e.component(v.name,v)},e.default=v,Object.defineProperty(e,"__esModule",{value:!0})}));
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/**
|
2
|
+
* Tencent is pleased to support the open source community by making
|
3
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
4
|
+
*
|
5
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
6
|
+
*
|
7
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
8
|
+
*
|
9
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
10
|
+
*
|
11
|
+
* ---------------------------------------------------
|
12
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
13
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
14
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
15
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
16
|
+
*
|
17
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
18
|
+
* the Software.
|
19
|
+
*
|
20
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
21
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
23
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
24
|
+
* IN THE SOFTWARE.
|
25
|
+
*/
|
26
|
+
import { PropType } from 'vue';
|
27
|
+
interface Params {
|
28
|
+
vertical: boolean;
|
29
|
+
showTip: boolean;
|
30
|
+
disable: boolean;
|
31
|
+
maxValue: number;
|
32
|
+
minValue: number;
|
33
|
+
step: number;
|
34
|
+
precision: number;
|
35
|
+
showButtonLabel: boolean;
|
36
|
+
formatterButtonLabel: Function;
|
37
|
+
showIntervalLabel: boolean;
|
38
|
+
customContent: {
|
39
|
+
[propName: string]: {
|
40
|
+
label?: string;
|
41
|
+
tip?: string;
|
42
|
+
};
|
43
|
+
};
|
44
|
+
sliderSize: number;
|
45
|
+
}
|
46
|
+
declare const _default: import("vue").DefineComponent<{
|
47
|
+
modelValue: {
|
48
|
+
type: NumberConstructor;
|
49
|
+
default: number;
|
50
|
+
};
|
51
|
+
params: {
|
52
|
+
type: PropType<Params>;
|
53
|
+
default: () => {};
|
54
|
+
};
|
55
|
+
}, {
|
56
|
+
renderDom: () => JSX.Element;
|
57
|
+
setPosition: (position: number) => void;
|
58
|
+
}, 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<{
|
59
|
+
modelValue?: unknown;
|
60
|
+
params?: unknown;
|
61
|
+
} & {
|
62
|
+
modelValue: number;
|
63
|
+
params: Params;
|
64
|
+
} & {}> & {
|
65
|
+
"onUpdate:modelValue"?: (...args: any[]) => any;
|
66
|
+
onEmitChange?: (...args: any[]) => any;
|
67
|
+
onResetSize?: (...args: any[]) => any;
|
68
|
+
}, {
|
69
|
+
modelValue: number;
|
70
|
+
params: Params;
|
71
|
+
}>;
|
72
|
+
export default _default;
|
@@ -0,0 +1,149 @@
|
|
1
|
+
.bk-slider {
|
2
|
+
display: flex;
|
3
|
+
flex-direction: row;
|
4
|
+
align-items: center;
|
5
|
+
}
|
6
|
+
.bk-slider .bk-slider-runway {
|
7
|
+
position: relative;
|
8
|
+
width: 100%;
|
9
|
+
height: 4px;
|
10
|
+
vertical-align: middle;
|
11
|
+
cursor: pointer;
|
12
|
+
background: #dcdee5;
|
13
|
+
border-radius: 2px;
|
14
|
+
opacity: 1;
|
15
|
+
}
|
16
|
+
.bk-slider .bk-slider-runway .bk-slider-bar {
|
17
|
+
position: absolute;
|
18
|
+
height: 4px;
|
19
|
+
background: #3a84ff;
|
20
|
+
border-bottom-left-radius: 3px;
|
21
|
+
border-top-left-radius: 3px;
|
22
|
+
}
|
23
|
+
.bk-slider .bk-slider-runway .bk-slider-bar.vertical {
|
24
|
+
width: 4px;
|
25
|
+
}
|
26
|
+
.bk-slider .bk-slider-runway .bk-slider-bar.horizontal {
|
27
|
+
height: 4px;
|
28
|
+
}
|
29
|
+
.bk-slider .bk-slider-runway .disable {
|
30
|
+
background: #979ba5;
|
31
|
+
}
|
32
|
+
.bk-slider .bk-slider-runway .bk-slider-labels {
|
33
|
+
position: relative;
|
34
|
+
}
|
35
|
+
.bk-slider .bk-slider-runway .bk-slider-labels.vertical {
|
36
|
+
left: 18px;
|
37
|
+
display: flex;
|
38
|
+
width: 10px;
|
39
|
+
height: 100%;
|
40
|
+
flex-direction: column;
|
41
|
+
justify-content: space-between;
|
42
|
+
}
|
43
|
+
.bk-slider .bk-slider-runway .bk-slider-labels.horizontal {
|
44
|
+
top: 10px;
|
45
|
+
display: flex;
|
46
|
+
width: 100%;
|
47
|
+
height: 10px;
|
48
|
+
flex-direction: row;
|
49
|
+
justify-content: space-between;
|
50
|
+
}
|
51
|
+
.bk-slider .bk-slider-runway .bk-slider-labels .bk-slider-label {
|
52
|
+
position: absolute;
|
53
|
+
display: flex;
|
54
|
+
width: 10px;
|
55
|
+
height: 10px;
|
56
|
+
text-align: center;
|
57
|
+
white-space: nowrap;
|
58
|
+
align-items: center;
|
59
|
+
justify-content: center;
|
60
|
+
}
|
61
|
+
.bk-slider .bk-slider-runway .bk-slider-labels .bk-slider-label.vertical {
|
62
|
+
left: 10px;
|
63
|
+
transform: translateY(50%);
|
64
|
+
}
|
65
|
+
.bk-slider .bk-slider-runway .bk-slider-labels .bk-slider-label.horizontal {
|
66
|
+
top: 10px;
|
67
|
+
transform: translateX(-50%);
|
68
|
+
}
|
69
|
+
.bk-slider .bk-slider-interval {
|
70
|
+
position: absolute;
|
71
|
+
width: 4px;
|
72
|
+
height: 4px;
|
73
|
+
background-color: #fff;
|
74
|
+
border-radius: 100%;
|
75
|
+
transform: translateX(-50%);
|
76
|
+
}
|
77
|
+
.bk-slider .bk-slider-interval.vertical {
|
78
|
+
left: 2px;
|
79
|
+
}
|
80
|
+
.bk-slider-input {
|
81
|
+
display: flex;
|
82
|
+
margin: 0 0 0 28px;
|
83
|
+
flex-direction: row;
|
84
|
+
align-items: center;
|
85
|
+
}
|
86
|
+
.bk-slider-input .input-item {
|
87
|
+
width: 92px;
|
88
|
+
}
|
89
|
+
.bk-slider-input .input-center {
|
90
|
+
margin: 0 7px;
|
91
|
+
}
|
92
|
+
.bk-slider-button {
|
93
|
+
position: absolute;
|
94
|
+
z-index: 1001;
|
95
|
+
display: flex;
|
96
|
+
width: 24px;
|
97
|
+
height: 24px;
|
98
|
+
line-height: normal;
|
99
|
+
text-align: center;
|
100
|
+
background-color: transparent;
|
101
|
+
user-select: none;
|
102
|
+
justify-content: center;
|
103
|
+
align-items: center;
|
104
|
+
}
|
105
|
+
.bk-slider-button:hover {
|
106
|
+
cursor: grab;
|
107
|
+
}
|
108
|
+
.bk-slider-button.grabbing {
|
109
|
+
cursor: grabbing;
|
110
|
+
}
|
111
|
+
.bk-slider-button.vertical {
|
112
|
+
left: -10px;
|
113
|
+
transform: translateY(50%);
|
114
|
+
}
|
115
|
+
.bk-slider-button.horizontal {
|
116
|
+
top: -10px;
|
117
|
+
transform: translateX(-50%);
|
118
|
+
}
|
119
|
+
.bk-slider-button .slider-button {
|
120
|
+
width: 12px;
|
121
|
+
height: 12px;
|
122
|
+
background-color: #fff;
|
123
|
+
border: 2px solid #3a84ff;
|
124
|
+
border-radius: 50%;
|
125
|
+
transition: 0.2s;
|
126
|
+
user-select: none;
|
127
|
+
}
|
128
|
+
.bk-slider-button .slider-button-disable {
|
129
|
+
border: 2px solid #979ba5;
|
130
|
+
}
|
131
|
+
.bk-slider-button .slider-button:hover {
|
132
|
+
box-shadow: 0px 0px 0px 4px rgba(58, 132, 255, 0.3);
|
133
|
+
}
|
134
|
+
.bk-slider-button .slider-button:focus {
|
135
|
+
box-shadow: 0px 0px 10px 0px rgba(58, 132, 255, 0.9);
|
136
|
+
}
|
137
|
+
.bk-slider-button .slider-button-label {
|
138
|
+
position: absolute;
|
139
|
+
display: flex;
|
140
|
+
text-align: center;
|
141
|
+
align-items: center;
|
142
|
+
justify-content: center;
|
143
|
+
}
|
144
|
+
.bk-slider-button .slider-button-label.vertical {
|
145
|
+
left: 28px;
|
146
|
+
}
|
147
|
+
.bk-slider-button .slider-button-label.horizontal {
|
148
|
+
top: 20px;
|
149
|
+
}
|