@zkwq/business 0.0.4 → 0.0.6
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/package.json +2 -2
- package/src/components/base/ui/alert/Alert.vue +0 -94
- package/src/components/base/ui/autocomplete/autocomplete-suggestions.vue +0 -77
- package/src/components/base/ui/autocomplete/autocomplete.vue +0 -305
- package/src/components/base/ui/backtop/main.vue +0 -112
- package/src/components/base/ui/button/Button.vue +0 -84
- package/src/components/base/ui/button/ButtonGroup.vue +0 -10
- package/src/components/base/ui/carousel/Carousel.vue +0 -304
- package/src/components/base/ui/carousel/CarouselItem.vue +0 -137
- package/src/components/base/ui/cascader/cascader.vue +0 -650
- package/src/components/base/ui/cascader-panel/cascader-menu.vue +0 -138
- package/src/components/base/ui/cascader-panel/cascader-node.vue +0 -246
- package/src/components/base/ui/cascader-panel/cascader-panel.vue +0 -382
- package/src/components/base/ui/cascader-panel/node.js +0 -166
- package/src/components/base/ui/cascader-panel/store.js +0 -62
- package/src/components/base/ui/checkbox/checkbox-button.vue +0 -199
- package/src/components/base/ui/checkbox/checkbox-group.vue +0 -48
- package/src/components/base/ui/checkbox/checkbox.vue +0 -222
- package/src/components/base/ui/col/col.js +0 -71
- package/src/components/base/ui/collapse/collapse-item.vue +0 -180
- package/src/components/base/ui/collapse/collapse.vue +0 -73
- package/src/components/base/ui/color-picker/color.js +0 -317
- package/src/components/base/ui/color-picker/components/alpha-slider.vue +0 -132
- package/src/components/base/ui/color-picker/components/hue-slider.vue +0 -123
- package/src/components/base/ui/color-picker/components/picker-dropdown.vue +0 -119
- package/src/components/base/ui/color-picker/components/predefine.vue +0 -61
- package/src/components/base/ui/color-picker/components/sv-panel.vue +0 -100
- package/src/components/base/ui/color-picker/draggable.js +0 -36
- package/src/components/base/ui/color-picker/index.js +0 -2
- package/src/components/base/ui/color-picker/main.vue +0 -188
- package/src/components/base/ui/date-picker/basic/date-table.vue +0 -441
- package/src/components/base/ui/date-picker/basic/month-table.vue +0 -254
- package/src/components/base/ui/date-picker/basic/time-spinner.vue +0 -304
- package/src/components/base/ui/date-picker/basic/year-table.vue +0 -101
- package/src/components/base/ui/date-picker/panel/date-range.vue +0 -680
- package/src/components/base/ui/date-picker/panel/date.vue +0 -597
- package/src/components/base/ui/date-picker/panel/month-range.vue +0 -289
- package/src/components/base/ui/date-picker/panel/time-range.vue +0 -248
- package/src/components/base/ui/date-picker/panel/time-select.vue +0 -178
- package/src/components/base/ui/date-picker/panel/time.vue +0 -186
- package/src/components/base/ui/date-picker/picker/date-picker.js +0 -43
- package/src/components/base/ui/date-picker/picker/time-picker.js +0 -39
- package/src/components/base/ui/date-picker/picker/time-select.js +0 -21
- package/src/components/base/ui/date-picker/picker.vue +0 -942
- package/src/components/base/ui/dialog/Index.vue +0 -212
- package/src/components/base/ui/directive/repeat-click.js +0 -24
- package/src/components/base/ui/directive/ripple.js +0 -303
- package/src/components/base/ui/divider/Divider.vue +0 -37
- package/src/components/base/ui/drawer/Drawer.vue +0 -202
- package/src/components/base/ui/dropdown/dropdown-item.vue +0 -39
- package/src/components/base/ui/dropdown/dropdown-menu.vue +0 -63
- package/src/components/base/ui/dropdown/dropdown.vue +0 -308
- package/src/components/base/ui/form/Form.vue +0 -167
- package/src/components/base/ui/form/FormItem.vue +0 -334
- package/src/components/base/ui/form/LabelWrap.vue +0 -69
- package/src/components/base/ui/icon/icon.vue +0 -13
- package/src/components/base/ui/image/image-viewer.vue +0 -302
- package/src/components/base/ui/image/main.vue +0 -248
- package/src/components/base/ui/index.js +0 -189
- package/src/components/base/ui/input/Input.vue +0 -438
- package/src/components/base/ui/input/calcTextareaHeight.js +0 -104
- package/src/components/base/ui/input-number/input-number.vue +0 -285
- package/src/components/base/ui/locale/format.js +0 -32
- package/src/components/base/ui/locale/index.js +0 -48
- package/src/components/base/ui/locale/lang/zh-CN.js +0 -120
- package/src/components/base/ui/menu/menu-item-group.vue +0 -45
- package/src/components/base/ui/menu/menu-item.vue +0 -112
- package/src/components/base/ui/menu/menu-mixin.js +0 -44
- package/src/components/base/ui/menu/menu.vue +0 -312
- package/src/components/base/ui/menu/submenu.vue +0 -408
- package/src/components/base/ui/message/index.js +0 -2
- package/src/components/base/ui/message/main.js +0 -87
- package/src/components/base/ui/message/main.vue +0 -110
- package/src/components/base/ui/message-box/main.js +0 -216
- package/src/components/base/ui/message-box/main.vue +0 -323
- package/src/components/base/ui/mixin/emitter.js +0 -31
- package/src/components/base/ui/mixin/focus.js +0 -9
- package/src/components/base/ui/mixin/locale.js +0 -9
- package/src/components/base/ui/mixin/migrating.js +0 -33
- package/src/components/base/ui/pagination/pager.vue +0 -163
- package/src/components/base/ui/pagination/pagination.jsx +0 -391
- package/src/components/base/ui/popover/directive.js +0 -20
- package/src/components/base/ui/popover/index.js +0 -14
- package/src/components/base/ui/popover/main.vue +0 -236
- package/src/components/base/ui/progress/Progress.vue +0 -227
- package/src/components/base/ui/radio/radio-button.vue +0 -114
- package/src/components/base/ui/radio/radio-group.vue +0 -111
- package/src/components/base/ui/radio/radio.vue +0 -134
- package/src/components/base/ui/row/row.js +0 -47
- package/src/components/base/ui/scrollbar/bar.jsx +0 -91
- package/src/components/base/ui/scrollbar/index.jsx +0 -203
- package/src/components/base/ui/scrollbar/util.js +0 -32
- package/src/components/base/ui/select/Option.vue +0 -168
- package/src/components/base/ui/select/OptionGroup.vue +0 -60
- package/src/components/base/ui/select/Select.vue +0 -920
- package/src/components/base/ui/select/SelectDropdown.vue +0 -74
- package/src/components/base/ui/select/navigation-mixin.js +0 -54
- package/src/components/base/ui/skeleton/index.js +0 -8
- package/src/components/base/ui/skeleton/src/img-placeholder.vue +0 -16
- package/src/components/base/ui/skeleton/src/index.vue +0 -80
- package/src/components/base/ui/skeleton/src/item.vue +0 -22
- package/src/components/base/ui/skeleton-item/index.js +0 -8
- package/src/components/base/ui/slider/button.vue +0 -238
- package/src/components/base/ui/slider/main.vue +0 -427
- package/src/components/base/ui/slider/marker.js +0 -18
- package/src/components/base/ui/style/alert.scss +0 -147
- package/src/components/base/ui/style/animations.scss +0 -65
- package/src/components/base/ui/style/autocomplete.scss +0 -81
- package/src/components/base/ui/style/backtop.scss +0 -20
- package/src/components/base/ui/style/button-group.scss +0 -0
- package/src/components/base/ui/style/button.scss +0 -380
- package/src/components/base/ui/style/carousel-item.scss +0 -50
- package/src/components/base/ui/style/carousel.scss +0 -161
- package/src/components/base/ui/style/cascader-panel.scss +0 -120
- package/src/components/base/ui/style/cascader.scss +0 -185
- package/src/components/base/ui/style/checkbox-button.scss +0 -0
- package/src/components/base/ui/style/checkbox-group.scss +0 -0
- package/src/components/base/ui/style/checkbox.scss +0 -360
- package/src/components/base/ui/style/col.scss +0 -156
- package/src/components/base/ui/style/collapse-item.scss +0 -0
- package/src/components/base/ui/style/collapse.scss +0 -114
- package/src/components/base/ui/style/color-picker.scss +0 -387
- package/src/components/base/ui/style/config.scss +0 -4
- package/src/components/base/ui/style/date-picker/date-picker.scss +0 -97
- package/src/components/base/ui/style/date-picker/date-range-picker.scss +0 -101
- package/src/components/base/ui/style/date-picker/date-table.scss +0 -151
- package/src/components/base/ui/style/date-picker/month-table.scss +0 -82
- package/src/components/base/ui/style/date-picker/picker-panel.scss +0 -117
- package/src/components/base/ui/style/date-picker/picker.scss +0 -197
- package/src/components/base/ui/style/date-picker/time-picker.scss +0 -85
- package/src/components/base/ui/style/date-picker/time-range-picker.scss +0 -31
- package/src/components/base/ui/style/date-picker/time-spinner.scss +0 -110
- package/src/components/base/ui/style/date-picker/year-table.scss +0 -51
- package/src/components/base/ui/style/date-picker.scss +0 -12
- package/src/components/base/ui/style/dialog.scss +0 -123
- package/src/components/base/ui/style/divider.scss +0 -47
- package/src/components/base/ui/style/drawer.scss +0 -218
- package/src/components/base/ui/style/dropdown-item.scss +0 -0
- package/src/components/base/ui/style/dropdown-menu.scss +0 -0
- package/src/components/base/ui/style/dropdown.scss +0 -185
- package/src/components/base/ui/style/form-item.scss +0 -0
- package/src/components/base/ui/style/form.scss +0 -203
- package/src/components/base/ui/style/function.scss +0 -43
- package/src/components/base/ui/style/icon.scss +0 -1167
- package/src/components/base/ui/style/image.scss +0 -184
- package/src/components/base/ui/style/index.scss +0 -57
- package/src/components/base/ui/style/input-number.scss +0 -187
- package/src/components/base/ui/style/input.scss +0 -477
- package/src/components/base/ui/style/menu-item-group.scss +0 -0
- package/src/components/base/ui/style/menu-item.scss +0 -0
- package/src/components/base/ui/style/menu.scss +0 -294
- package/src/components/base/ui/style/message-box.scss +0 -231
- package/src/components/base/ui/style/message.scss +0 -120
- package/src/components/base/ui/style/mixins.scss +0 -196
- package/src/components/base/ui/style/option-group.scss +0 -42
- package/src/components/base/ui/style/option.scss +0 -36
- package/src/components/base/ui/style/pagination.scss +0 -295
- package/src/components/base/ui/style/popover.scss +0 -40
- package/src/components/base/ui/style/popper.scss +0 -102
- package/src/components/base/ui/style/popup.scss +0 -42
- package/src/components/base/ui/style/progress.scss +0 -141
- package/src/components/base/ui/style/radio-button.scss +0 -113
- package/src/components/base/ui/style/radio-group.scss +0 -9
- package/src/components/base/ui/style/radio.scss +0 -203
- package/src/components/base/ui/style/ripple.scss +0 -35
- package/src/components/base/ui/style/row.scss +0 -39
- package/src/components/base/ui/style/scrollbar.scss +0 -75
- package/src/components/base/ui/style/select-dropdown.scss +0 -59
- package/src/components/base/ui/style/select.scss +0 -154
- package/src/components/base/ui/style/skeleton-item.scss +0 -84
- package/src/components/base/ui/style/skeleton.scss +0 -40
- package/src/components/base/ui/style/slider.scss +0 -250
- package/src/components/base/ui/style/switch.scss +0 -116
- package/src/components/base/ui/style/tabs.scss +0 -602
- package/src/components/base/ui/style/tag.scss +0 -174
- package/src/components/base/ui/style/tooltip.scss +0 -146
- package/src/components/base/ui/style/transition.scss +0 -138
- package/src/components/base/ui/style/upload.scss +0 -603
- package/src/components/base/ui/style/utils.scss +0 -39
- package/src/components/base/ui/style/var.scss +0 -1011
- package/src/components/base/ui/switch/index.vue +0 -174
- package/src/components/base/ui/tabs/tab-bar.vue +0 -57
- package/src/components/base/ui/tabs/tab-nav.vue +0 -294
- package/src/components/base/ui/tabs/tab-pane.vue +0 -56
- package/src/components/base/ui/tabs/tabs.vue +0 -191
- package/src/components/base/ui/tag/Tag.vue +0 -60
- package/src/components/base/ui/tooltip/tooltip.jsx +0 -234
- package/src/components/base/ui/upload/Index.vue +0 -340
- package/src/components/base/ui/upload/Upload.vue +0 -216
- package/src/components/base/ui/upload/UploadDragger.vue +0 -70
- package/src/components/base/ui/upload/UploadList.vue +0 -100
- package/src/components/base/ui/upload/ajax.js +0 -85
- package/src/components/base/ui/util/aria-dialog.js +0 -90
- package/src/components/base/ui/util/aria-utils.js +0 -122
- package/src/components/base/ui/util/clickoutside.js +0 -76
- package/src/components/base/ui/util/date-util.js +0 -292
- package/src/components/base/ui/util/date.js +0 -355
- package/src/components/base/ui/util/debounce.js +0 -21
- package/src/components/base/ui/util/deepmerge.js +0 -100
- package/src/components/base/ui/util/dom.js +0 -215
- package/src/components/base/ui/util/index.js +0 -262
- package/src/components/base/ui/util/menu/aria-menubar.js +0 -14
- package/src/components/base/ui/util/menu/aria-menuitem.js +0 -49
- package/src/components/base/ui/util/menu/aria-submenu.js +0 -59
- package/src/components/base/ui/util/merge.js +0 -14
- package/src/components/base/ui/util/popper.js +0 -1235
- package/src/components/base/ui/util/popup/index.js +0 -218
- package/src/components/base/ui/util/popup/popup-manager.js +0 -194
- package/src/components/base/ui/util/resize-events.js +0 -32
- package/src/components/base/ui/util/scroll-into-view.js +0 -27
- package/src/components/base/ui/util/scrollbar-width.js +0 -29
- package/src/components/base/ui/util/shared.js +0 -7
- package/src/components/base/ui/util/throttle.js +0 -91
- package/src/components/base/ui/util/types.js +0 -24
- package/src/components/base/ui/util/vdom.js +0 -5
- package/src/components/base/ui/util/vue-popper.js +0 -188
- package/src/components/normal/AggsItemH.vue +0 -145
- package/src/index.js +0 -10
- package/src/static/base-icons.ttf +0 -0
- package/src/static/base-icons.woff +0 -0
- package/src/static/label_bg.png +0 -0
- package/src/static/term-label-bg.png +0 -0
- package/src/style/app-article.scss +0 -698
- package/src/style/app-comment.scss +0 -259
- package/src/style/app-recommend.scss +0 -48
- package/src/style/app-richtext.scss +0 -176
- package/src/style/index.scss +0 -523
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="base-slider"
|
|
4
|
-
:class="{ 'is-vertical': vertical, 'base-slider--with-input': showInput }"
|
|
5
|
-
role="slider"
|
|
6
|
-
:aria-valuemin="min"
|
|
7
|
-
:aria-valuemax="max"
|
|
8
|
-
:aria-orientation="vertical ? 'vertical': 'horizontal'"
|
|
9
|
-
:aria-disabled="sliderDisabled"
|
|
10
|
-
>
|
|
11
|
-
<base-input-number
|
|
12
|
-
v-model="firstValue"
|
|
13
|
-
v-if="showInput && !range"
|
|
14
|
-
class="base-slider__input"
|
|
15
|
-
ref="input"
|
|
16
|
-
@change="emitChange"
|
|
17
|
-
:step="step"
|
|
18
|
-
:disabled="sliderDisabled"
|
|
19
|
-
:controls="showInputControls"
|
|
20
|
-
:min="min"
|
|
21
|
-
:max="max"
|
|
22
|
-
:debounce="debounce"
|
|
23
|
-
:size="inputSize">
|
|
24
|
-
</base-input-number>
|
|
25
|
-
<div
|
|
26
|
-
class="base-slider__runway"
|
|
27
|
-
:class="{ 'show-input': showInput, 'disabled': sliderDisabled }"
|
|
28
|
-
:style="runwayStyle"
|
|
29
|
-
@click="onSliderClick"
|
|
30
|
-
ref="slider">
|
|
31
|
-
<div
|
|
32
|
-
class="base-slider__bar"
|
|
33
|
-
:style="barStyle">
|
|
34
|
-
</div>
|
|
35
|
-
<slider-button
|
|
36
|
-
:vertical="vertical"
|
|
37
|
-
v-model="firstValue"
|
|
38
|
-
:tooltip-class="tooltipClass"
|
|
39
|
-
ref="button1">
|
|
40
|
-
</slider-button>
|
|
41
|
-
<slider-button
|
|
42
|
-
:vertical="vertical"
|
|
43
|
-
v-model="secondValue"
|
|
44
|
-
:tooltip-class="tooltipClass"
|
|
45
|
-
ref="button2"
|
|
46
|
-
v-if="range">
|
|
47
|
-
</slider-button>
|
|
48
|
-
<div
|
|
49
|
-
class="base-slider__stop"
|
|
50
|
-
v-for="(item, key) in stops"
|
|
51
|
-
:key="key"
|
|
52
|
-
:style="getStopStyle(item)"
|
|
53
|
-
v-if="showStops">
|
|
54
|
-
</div>
|
|
55
|
-
<template v-if="markList.length > 0">
|
|
56
|
-
<div>
|
|
57
|
-
<div
|
|
58
|
-
v-for="(item, key) in markList"
|
|
59
|
-
:style="getStopStyle(item.position)"
|
|
60
|
-
class="base-slider__stop base-slider__marks-stop"
|
|
61
|
-
:key="key">
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
<div class="base-slider__marks">
|
|
65
|
-
<slider-marker
|
|
66
|
-
:mark="item.mark" v-for="(item, key) in markList"
|
|
67
|
-
:key="key"
|
|
68
|
-
:style="getStopStyle(item.position)">
|
|
69
|
-
</slider-marker>
|
|
70
|
-
</div>
|
|
71
|
-
</template>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
</template>
|
|
75
|
-
|
|
76
|
-
<script type="text/babel">
|
|
77
|
-
import BaseInputNumber from '../input-number/input-number';
|
|
78
|
-
import SliderButton from './button.vue';
|
|
79
|
-
import SliderMarker from './marker';
|
|
80
|
-
import Emitter from '../mixin/emitter';
|
|
81
|
-
|
|
82
|
-
export default {
|
|
83
|
-
name: 'BaseSlider',
|
|
84
|
-
|
|
85
|
-
mixins: [Emitter],
|
|
86
|
-
|
|
87
|
-
inject: {
|
|
88
|
-
baseForm: {
|
|
89
|
-
default: ''
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
props: {
|
|
94
|
-
min: {
|
|
95
|
-
type: Number,
|
|
96
|
-
default: 0
|
|
97
|
-
},
|
|
98
|
-
max: {
|
|
99
|
-
type: Number,
|
|
100
|
-
default: 100
|
|
101
|
-
},
|
|
102
|
-
step: {
|
|
103
|
-
type: Number,
|
|
104
|
-
default: 1
|
|
105
|
-
},
|
|
106
|
-
value: {
|
|
107
|
-
type: [Number, Array],
|
|
108
|
-
default: 0
|
|
109
|
-
},
|
|
110
|
-
showInput: {
|
|
111
|
-
type: Boolean,
|
|
112
|
-
default: false
|
|
113
|
-
},
|
|
114
|
-
showInputControls: {
|
|
115
|
-
type: Boolean,
|
|
116
|
-
default: true
|
|
117
|
-
},
|
|
118
|
-
inputSize: {
|
|
119
|
-
type: String,
|
|
120
|
-
default: 'small'
|
|
121
|
-
},
|
|
122
|
-
showStops: {
|
|
123
|
-
type: Boolean,
|
|
124
|
-
default: false
|
|
125
|
-
},
|
|
126
|
-
showTooltip: {
|
|
127
|
-
type: Boolean,
|
|
128
|
-
default: true
|
|
129
|
-
},
|
|
130
|
-
formatTooltip: Function,
|
|
131
|
-
disabled: {
|
|
132
|
-
type: Boolean,
|
|
133
|
-
default: false
|
|
134
|
-
},
|
|
135
|
-
range: {
|
|
136
|
-
type: Boolean,
|
|
137
|
-
default: false
|
|
138
|
-
},
|
|
139
|
-
vertical: {
|
|
140
|
-
type: Boolean,
|
|
141
|
-
default: false
|
|
142
|
-
},
|
|
143
|
-
height: {
|
|
144
|
-
type: String
|
|
145
|
-
},
|
|
146
|
-
debounce: {
|
|
147
|
-
type: Number,
|
|
148
|
-
default: 300
|
|
149
|
-
},
|
|
150
|
-
label: {
|
|
151
|
-
type: String
|
|
152
|
-
},
|
|
153
|
-
tooltipClass: String,
|
|
154
|
-
marks: Object
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
components: {
|
|
158
|
-
BaseInputNumber,
|
|
159
|
-
SliderButton,
|
|
160
|
-
SliderMarker
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
data() {
|
|
164
|
-
return {
|
|
165
|
-
firstValue: null,
|
|
166
|
-
secondValue: null,
|
|
167
|
-
oldValue: null,
|
|
168
|
-
dragging: false,
|
|
169
|
-
sliderSize: 1
|
|
170
|
-
};
|
|
171
|
-
},
|
|
172
|
-
|
|
173
|
-
watch: {
|
|
174
|
-
value(val, oldVal) {
|
|
175
|
-
if (this.dragging ||
|
|
176
|
-
Array.isArray(val) &&
|
|
177
|
-
Array.isArray(oldVal) &&
|
|
178
|
-
val.every((item, index) => item === oldVal[index])) {
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
this.setValues();
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
dragging(val) {
|
|
185
|
-
if (!val) {
|
|
186
|
-
this.setValues();
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
firstValue(val) {
|
|
191
|
-
if (this.range) {
|
|
192
|
-
this.$emit('input', [this.minValue, this.maxValue]);
|
|
193
|
-
} else {
|
|
194
|
-
this.$emit('input', val);
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
secondValue() {
|
|
199
|
-
if (this.range) {
|
|
200
|
-
this.$emit('input', [this.minValue, this.maxValue]);
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
|
|
204
|
-
min() {
|
|
205
|
-
this.setValues();
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
max() {
|
|
209
|
-
this.setValues();
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
methods: {
|
|
214
|
-
valueChanged() {
|
|
215
|
-
if (this.range) {
|
|
216
|
-
return ![this.minValue, this.maxValue]
|
|
217
|
-
.every((item, index) => item === this.oldValue[index]);
|
|
218
|
-
} else {
|
|
219
|
-
return this.value !== this.oldValue;
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
setValues() {
|
|
223
|
-
if (this.min > this.max) {
|
|
224
|
-
console.error('[Element Error][Slider]min should not be greater than max.');
|
|
225
|
-
return;
|
|
226
|
-
}
|
|
227
|
-
const val = this.value;
|
|
228
|
-
if (this.range && Array.isArray(val)) {
|
|
229
|
-
if (val[1] < this.min) {
|
|
230
|
-
this.$emit('input', [this.min, this.min]);
|
|
231
|
-
} else if (val[0] > this.max) {
|
|
232
|
-
this.$emit('input', [this.max, this.max]);
|
|
233
|
-
} else if (val[0] < this.min) {
|
|
234
|
-
this.$emit('input', [this.min, val[1]]);
|
|
235
|
-
} else if (val[1] > this.max) {
|
|
236
|
-
this.$emit('input', [val[0], this.max]);
|
|
237
|
-
} else {
|
|
238
|
-
this.firstValue = val[0];
|
|
239
|
-
this.secondValue = val[1];
|
|
240
|
-
if (this.valueChanged()) {
|
|
241
|
-
this.dispatch('BaseFormItem', 'base.form.change', [this.minValue, this.maxValue]);
|
|
242
|
-
this.oldValue = val.slice();
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
} else if (!this.range && typeof val === 'number' && !isNaN(val)) {
|
|
246
|
-
if (val < this.min) {
|
|
247
|
-
this.$emit('input', this.min);
|
|
248
|
-
} else if (val > this.max) {
|
|
249
|
-
this.$emit('input', this.max);
|
|
250
|
-
} else {
|
|
251
|
-
this.firstValue = val;
|
|
252
|
-
if (this.valueChanged()) {
|
|
253
|
-
this.dispatch('BaseFormItem', 'base.form.change', val);
|
|
254
|
-
this.oldValue = val;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
|
|
260
|
-
setPosition(percent) {
|
|
261
|
-
const targetValue = this.min + percent * (this.max - this.min) / 100;
|
|
262
|
-
if (!this.range) {
|
|
263
|
-
this.$refs.button1.setPosition(percent);
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
let button;
|
|
267
|
-
if (Math.abs(this.minValue - targetValue) < Math.abs(this.maxValue - targetValue)) {
|
|
268
|
-
button = this.firstValue < this.secondValue ? 'button1' : 'button2';
|
|
269
|
-
} else {
|
|
270
|
-
button = this.firstValue > this.secondValue ? 'button1' : 'button2';
|
|
271
|
-
}
|
|
272
|
-
this.$refs[button].setPosition(percent);
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
onSliderClick(event) {
|
|
276
|
-
if (this.sliderDisabled || this.dragging) return;
|
|
277
|
-
this.resetSize();
|
|
278
|
-
if (this.vertical) {
|
|
279
|
-
const sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
|
|
280
|
-
this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
|
|
281
|
-
} else {
|
|
282
|
-
const sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
|
|
283
|
-
this.setPosition((event.clientX - sliderOffsetLeft) / this.sliderSize * 100);
|
|
284
|
-
}
|
|
285
|
-
this.emitChange();
|
|
286
|
-
},
|
|
287
|
-
|
|
288
|
-
resetSize() {
|
|
289
|
-
if (this.$refs.slider) {
|
|
290
|
-
this.sliderSize = this.$refs.slider[`client${ this.vertical ? 'Height' : 'Width' }`];
|
|
291
|
-
}
|
|
292
|
-
},
|
|
293
|
-
|
|
294
|
-
emitChange() {
|
|
295
|
-
this.$nextTick(() => {
|
|
296
|
-
this.$emit('change', this.range ? [this.minValue, this.maxValue] : this.value);
|
|
297
|
-
});
|
|
298
|
-
},
|
|
299
|
-
|
|
300
|
-
getStopStyle(position) {
|
|
301
|
-
return this.vertical ? { 'bottom': position + '%' } : { 'left': position + '%' };
|
|
302
|
-
}
|
|
303
|
-
},
|
|
304
|
-
|
|
305
|
-
computed: {
|
|
306
|
-
stops() {
|
|
307
|
-
if (!this.showStops || this.min > this.max) return [];
|
|
308
|
-
if (this.step === 0) {
|
|
309
|
-
process.env.NODE_ENV !== 'production' &&
|
|
310
|
-
console.warn('[Element Warn][Slider]step should not be 0.');
|
|
311
|
-
return [];
|
|
312
|
-
}
|
|
313
|
-
const stopCount = (this.max - this.min) / this.step;
|
|
314
|
-
const stepWidth = 100 * this.step / (this.max - this.min);
|
|
315
|
-
const result = [];
|
|
316
|
-
for (let i = 1; i < stopCount; i++) {
|
|
317
|
-
result.push(i * stepWidth);
|
|
318
|
-
}
|
|
319
|
-
if (this.range) {
|
|
320
|
-
return result.filter(step => {
|
|
321
|
-
return step < 100 * (this.minValue - this.min) / (this.max - this.min) ||
|
|
322
|
-
step > 100 * (this.maxValue - this.min) / (this.max - this.min);
|
|
323
|
-
});
|
|
324
|
-
} else {
|
|
325
|
-
return result.filter(step => step > 100 * (this.firstValue - this.min) / (this.max - this.min));
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
|
|
329
|
-
markList() {
|
|
330
|
-
if (!this.marks) {
|
|
331
|
-
return [];
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
const marksKeys = Object.keys(this.marks);
|
|
335
|
-
return marksKeys.map(parseFloat)
|
|
336
|
-
.sort((a, b) => a - b)
|
|
337
|
-
.filter(point => point <= this.max && point >= this.min)
|
|
338
|
-
.map(point => ({
|
|
339
|
-
point,
|
|
340
|
-
position: (point - this.min) * 100 / (this.max - this.min),
|
|
341
|
-
mark: this.marks[point]
|
|
342
|
-
}));
|
|
343
|
-
},
|
|
344
|
-
|
|
345
|
-
minValue() {
|
|
346
|
-
return Math.min(this.firstValue, this.secondValue);
|
|
347
|
-
},
|
|
348
|
-
|
|
349
|
-
maxValue() {
|
|
350
|
-
return Math.max(this.firstValue, this.secondValue);
|
|
351
|
-
},
|
|
352
|
-
|
|
353
|
-
barSize() {
|
|
354
|
-
return this.range
|
|
355
|
-
? `${ 100 * (this.maxValue - this.minValue) / (this.max - this.min) }%`
|
|
356
|
-
: `${ 100 * (this.firstValue - this.min) / (this.max - this.min) }%`;
|
|
357
|
-
},
|
|
358
|
-
|
|
359
|
-
barStart() {
|
|
360
|
-
return this.range
|
|
361
|
-
? `${ 100 * (this.minValue - this.min) / (this.max - this.min) }%`
|
|
362
|
-
: '0%';
|
|
363
|
-
},
|
|
364
|
-
|
|
365
|
-
precision() {
|
|
366
|
-
let precisions = [this.min, this.max, this.step].map(item => {
|
|
367
|
-
let decimal = ('' + item).split('.')[1];
|
|
368
|
-
return decimal ? decimal.length : 0;
|
|
369
|
-
});
|
|
370
|
-
return Math.max.apply(null, precisions);
|
|
371
|
-
},
|
|
372
|
-
|
|
373
|
-
runwayStyle() {
|
|
374
|
-
return this.vertical ? { height: this.height } : {};
|
|
375
|
-
},
|
|
376
|
-
|
|
377
|
-
barStyle() {
|
|
378
|
-
return this.vertical
|
|
379
|
-
? {
|
|
380
|
-
height: this.barSize,
|
|
381
|
-
bottom: this.barStart
|
|
382
|
-
} : {
|
|
383
|
-
width: this.barSize,
|
|
384
|
-
left: this.barStart
|
|
385
|
-
};
|
|
386
|
-
},
|
|
387
|
-
|
|
388
|
-
sliderDisabled() {
|
|
389
|
-
return this.disabled || (this.baseForm || {}).disabled;
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
|
|
393
|
-
mounted() {
|
|
394
|
-
let valuetext;
|
|
395
|
-
if (this.range) {
|
|
396
|
-
if (Array.isArray(this.value)) {
|
|
397
|
-
this.firstValue = Math.max(this.min, this.value[0]);
|
|
398
|
-
this.secondValue = Math.min(this.max, this.value[1]);
|
|
399
|
-
} else {
|
|
400
|
-
this.firstValue = this.min;
|
|
401
|
-
this.secondValue = this.max;
|
|
402
|
-
}
|
|
403
|
-
this.oldValue = [this.firstValue, this.secondValue];
|
|
404
|
-
valuetext = `${this.firstValue}-${this.secondValue}`;
|
|
405
|
-
} else {
|
|
406
|
-
if (typeof this.value !== 'number' || isNaN(this.value)) {
|
|
407
|
-
this.firstValue = this.min;
|
|
408
|
-
} else {
|
|
409
|
-
this.firstValue = Math.min(this.max, Math.max(this.min, this.value));
|
|
410
|
-
}
|
|
411
|
-
this.oldValue = this.firstValue;
|
|
412
|
-
valuetext = this.firstValue;
|
|
413
|
-
}
|
|
414
|
-
this.$el.setAttribute('aria-valuetext', valuetext);
|
|
415
|
-
|
|
416
|
-
// label screen reader
|
|
417
|
-
this.$el.setAttribute('aria-label', this.label ? this.label : `slider between ${this.min} and ${this.max}`);
|
|
418
|
-
|
|
419
|
-
this.resetSize();
|
|
420
|
-
window.addEventListener('resize', this.resetSize);
|
|
421
|
-
},
|
|
422
|
-
|
|
423
|
-
beforeDestroy() {
|
|
424
|
-
window.removeEventListener('resize', this.resetSize);
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
|
-
</script>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
name: 'BaseMarker',
|
|
3
|
-
|
|
4
|
-
props: {
|
|
5
|
-
mark: {
|
|
6
|
-
type: [String, Object]
|
|
7
|
-
}
|
|
8
|
-
},
|
|
9
|
-
render() {
|
|
10
|
-
let label = typeof this.mark === 'string' ? this.mark : this.mark.label;
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<div class="base-slider__marks-text" style={ this.mark.style || {} }>
|
|
14
|
-
{ label }
|
|
15
|
-
</div>
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
@import "mixins";
|
|
2
|
-
@import "var";
|
|
3
|
-
|
|
4
|
-
@include b(alert) {
|
|
5
|
-
width: 100%;
|
|
6
|
-
padding: $--alert-padding;
|
|
7
|
-
margin: 0;
|
|
8
|
-
box-sizing: border-box;
|
|
9
|
-
border-radius: $--alert-border-radius;
|
|
10
|
-
position: relative;
|
|
11
|
-
background-color: $--color-white;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
opacity: 1;
|
|
14
|
-
display: flex;
|
|
15
|
-
align-items: center;
|
|
16
|
-
transition: opacity .2s;
|
|
17
|
-
|
|
18
|
-
@include when(light) {
|
|
19
|
-
.base-alert__closebtn {
|
|
20
|
-
color: $--color-text-placeholder;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@include when(dark) {
|
|
25
|
-
.base-alert__closebtn {
|
|
26
|
-
color: $--color-white;
|
|
27
|
-
}
|
|
28
|
-
.base-alert__description {
|
|
29
|
-
color: $--color-white;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@include when(center) {
|
|
34
|
-
justify-content: center;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@include m(success) {
|
|
38
|
-
&.is-light {
|
|
39
|
-
background-color: $--alert-success-color;
|
|
40
|
-
color: $--color-success;
|
|
41
|
-
|
|
42
|
-
.base-alert__description {
|
|
43
|
-
color: $--color-success;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&.is-dark {
|
|
48
|
-
background-color: $--color-success;
|
|
49
|
-
color: $--color-white;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@include m(info) {
|
|
54
|
-
&.is-light {
|
|
55
|
-
background-color: $--alert-info-color;
|
|
56
|
-
color: $--color-info;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&.is-dark {
|
|
60
|
-
background-color: $--color-info;
|
|
61
|
-
color: $--color-white;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.base-alert__description {
|
|
65
|
-
color: $--color-info;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
@include m(warning) {
|
|
70
|
-
&.is-light {
|
|
71
|
-
background-color: $--alert-warning-color;
|
|
72
|
-
color: $--color-warning;
|
|
73
|
-
|
|
74
|
-
.base-alert__description {
|
|
75
|
-
color: $--color-warning;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
&.is-dark {
|
|
80
|
-
background-color: $--color-warning;
|
|
81
|
-
color: $--color-white;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@include m(error) {
|
|
86
|
-
&.is-light {
|
|
87
|
-
background-color: $--alert-danger-color;
|
|
88
|
-
color: $--color-danger;
|
|
89
|
-
|
|
90
|
-
.base-alert__description {
|
|
91
|
-
color: $--color-danger;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
&.is-dark {
|
|
96
|
-
background-color: $--color-danger;
|
|
97
|
-
color: $--color-white;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@include e(content) {
|
|
102
|
-
display: table-cell;
|
|
103
|
-
padding: 0 8px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@include e(icon) {
|
|
107
|
-
font-size: $--alert-icon-size;
|
|
108
|
-
width: $--alert-icon-size;
|
|
109
|
-
@include when(big) {
|
|
110
|
-
font-size: $--alert-icon-large-size;
|
|
111
|
-
width: $--alert-icon-large-size;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
@include e(title) {
|
|
116
|
-
font-size: $--alert-title-font-size;
|
|
117
|
-
line-height: 18px;
|
|
118
|
-
@include when(bold) {
|
|
119
|
-
font-weight: bold;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
& .base-alert__description {
|
|
124
|
-
font-size: $--alert-description-font-size;
|
|
125
|
-
margin: 5px 0 0 0;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
@include e(closebtn) {
|
|
129
|
-
font-size: $--alert-close-font-size;
|
|
130
|
-
opacity: 1;
|
|
131
|
-
position: absolute;
|
|
132
|
-
top: 12px;
|
|
133
|
-
right: 15px;
|
|
134
|
-
cursor: pointer;
|
|
135
|
-
|
|
136
|
-
@include when(customed) {
|
|
137
|
-
font-style: normal;
|
|
138
|
-
font-size: $--alert-close-customed-font-size;
|
|
139
|
-
top: 9px;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.base-alert-fade-enter,
|
|
145
|
-
.base-alert-fade-leave-active {
|
|
146
|
-
opacity: 0;
|
|
147
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
@keyframes linear-double {
|
|
2
|
-
0% {
|
|
3
|
-
-webkit-transform: translateX(-56%);
|
|
4
|
-
transform: translateX(-56%)
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
to {
|
|
8
|
-
-webkit-transform: translateX(56%);
|
|
9
|
-
transform: translateX(56%)
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
@keyframes Bounce {
|
|
13
|
-
0%,to {
|
|
14
|
-
-webkit-transform: translateY(-100%);
|
|
15
|
-
transform: translateY(-100%)
|
|
16
|
-
}
|
|
17
|
-
50% {
|
|
18
|
-
-webkit-transform: translateY(100%);
|
|
19
|
-
transform: translateY(100%)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
@keyframes BounceUp {
|
|
23
|
-
25% {
|
|
24
|
-
transform: translateY(-3px)
|
|
25
|
-
}
|
|
26
|
-
50% {
|
|
27
|
-
transform: translateY(0)
|
|
28
|
-
}
|
|
29
|
-
75% {
|
|
30
|
-
transform: translateY(3px)
|
|
31
|
-
}
|
|
32
|
-
100% {
|
|
33
|
-
transform: translateY(0)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
.fade-enter-active, .fade-leave-active {
|
|
37
|
-
transition: opacity .5s;
|
|
38
|
-
}
|
|
39
|
-
.fade-enter, .fade-leave-to {
|
|
40
|
-
opacity: 0;
|
|
41
|
-
}
|
|
42
|
-
.fade-fast-enter-active, .fade-fast-leave-active {
|
|
43
|
-
transition: opacity .2s linear;
|
|
44
|
-
}
|
|
45
|
-
.fade-fast-enter, .fade-fast-leave-to {
|
|
46
|
-
opacity: 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
@keyframes fadeInOut {
|
|
50
|
-
0%{opacity:0}
|
|
51
|
-
25%{opacity:.25}
|
|
52
|
-
to{opacity:1}
|
|
53
|
-
}
|
|
54
|
-
.fade-enter-active, .fade-leave-active {
|
|
55
|
-
transition: opacity .5s;
|
|
56
|
-
}
|
|
57
|
-
.fade-enter, .fade-leave-to {
|
|
58
|
-
opacity: 0;
|
|
59
|
-
}
|
|
60
|
-
.fade-fast-enter-active, .fade-fast-leave-active {
|
|
61
|
-
transition: opacity .2s linear;
|
|
62
|
-
}
|
|
63
|
-
.fade-fast-enter, .fade-fast-leave-to {
|
|
64
|
-
opacity: 0;
|
|
65
|
-
}
|