evui 3.3.36 → 3.3.39
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 +21 -21
- package/README.md +40 -40
- package/dist/evui.common.js +1907 -1832
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +1907 -1832
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/dist/img/{EVUI.7f3588fb.svg → EVUI.b82ee81a.svg} +292 -292
- package/dist/img/{icon_mysql.7ea26d5d.svg → icon_mysql.1085fdc9.svg} +78 -78
- package/dist/img/{icon_oracle.9009b108.svg → icon_oracle.0572d3ee.svg} +13 -13
- package/dist/img/{icon_postgresql.f8fffba9.svg → icon_postgresql.ee12bde8.svg} +58 -58
- package/package.json +61 -61
- package/src/common/emitter.js +20 -20
- package/src/common/utils.debounce.js +223 -223
- package/src/common/utils.js +134 -134
- package/src/common/utils.table.js +78 -78
- package/src/common/utils.throttle.js +83 -83
- package/src/common/utils.tree.js +18 -18
- package/src/components/button/Button.vue +198 -198
- package/src/components/button/index.js +7 -7
- package/src/components/buttonGroup/ButtonGroup.vue +11 -11
- package/src/components/buttonGroup/index.js +7 -7
- package/src/components/calendar/Calendar.vue +661 -661
- package/src/components/calendar/index.js +7 -7
- package/src/components/calendar/uses.js +1272 -1272
- package/src/components/chart/Chart.vue +189 -192
- package/src/components/chart/chart.core.js +870 -870
- package/src/components/chart/element/element.bar.js +524 -524
- package/src/components/chart/element/element.bar.time.js +156 -156
- package/src/components/chart/element/element.heatmap.js +533 -533
- package/src/components/chart/element/element.line.js +339 -339
- package/src/components/chart/element/element.pie.js +197 -197
- package/src/components/chart/element/element.scatter.js +184 -184
- package/src/components/chart/element/element.tip.js +550 -542
- package/src/components/chart/helpers/helpers.canvas.js +265 -265
- package/src/components/chart/helpers/helpers.constant.js +206 -206
- package/src/components/chart/helpers/helpers.util.js +346 -338
- package/src/components/chart/index.js +9 -9
- package/src/components/chart/model/index.js +4 -4
- package/src/components/chart/model/model.series.js +93 -93
- package/src/components/chart/model/model.store.js +977 -967
- package/src/components/chart/plugins/plugins.interaction.js +769 -769
- package/src/components/chart/plugins/plugins.legend.gradient.js +602 -602
- package/src/components/chart/plugins/plugins.legend.js +1155 -1151
- package/src/components/chart/plugins/plugins.pie.js +254 -254
- package/src/components/chart/plugins/plugins.title.js +56 -56
- package/src/components/chart/plugins/plugins.tooltip.js +692 -692
- package/src/components/chart/scale/scale.js +848 -848
- package/src/components/chart/scale/scale.linear.js +38 -38
- package/src/components/chart/scale/scale.logarithmic.js +128 -128
- package/src/components/chart/scale/scale.step.js +336 -336
- package/src/components/chart/scale/scale.time.category.js +277 -277
- package/src/components/chart/scale/scale.time.js +48 -48
- package/src/components/chart/style/chart.scss +312 -312
- package/src/components/chart/uses.js +264 -252
- package/src/components/checkbox/Checkbox.vue +200 -200
- package/src/components/checkbox/index.js +7 -7
- package/src/components/checkboxGroup/CheckboxGroup.vue +44 -44
- package/src/components/checkboxGroup/index.js +7 -7
- package/src/components/contextMenu/ContextMenu.vue +80 -80
- package/src/components/contextMenu/MenuList.vue +149 -149
- package/src/components/contextMenu/index.js +7 -7
- package/src/components/contextMenu/uses.js +203 -203
- package/src/components/datePicker/DatePicker.vue +437 -437
- package/src/components/datePicker/index.js +7 -7
- package/src/components/datePicker/uses.js +419 -419
- package/src/components/grid/Grid.vue +827 -827
- package/src/components/grid/grid.filter.window.vue +493 -493
- package/src/components/grid/grid.pagination.vue +75 -75
- package/src/components/grid/grid.summary.vue +265 -265
- package/src/components/grid/grid.toolbar.vue +26 -26
- package/src/components/grid/index.js +11 -11
- package/src/components/grid/style/grid.scss +263 -263
- package/src/components/grid/uses.js +1002 -1007
- package/src/components/icon/Icon.vue +49 -49
- package/src/components/icon/index.js +8 -8
- package/src/components/inputNumber/InputNumber.vue +212 -212
- package/src/components/inputNumber/index.js +7 -7
- package/src/components/inputNumber/uses.js +217 -217
- package/src/components/loading/Loading.vue +125 -125
- package/src/components/loading/index.js +7 -7
- package/src/components/menu/Menu.vue +68 -68
- package/src/components/menu/MenuItem.vue +187 -187
- package/src/components/menu/index.js +7 -7
- package/src/components/message/Message.vue +223 -223
- package/src/components/message/index.js +31 -31
- package/src/components/messageBox/MessageBox.vue +358 -358
- package/src/components/messageBox/index.js +22 -22
- package/src/components/notification/Notification.vue +316 -316
- package/src/components/notification/index.js +49 -49
- package/src/components/pagination/Pagination.vue +271 -271
- package/src/components/pagination/index.js +7 -7
- package/src/components/pagination/pageButton.vue +30 -30
- package/src/components/progress/Progress.vue +139 -139
- package/src/components/progress/index.js +7 -7
- package/src/components/radio/Radio.vue +159 -159
- package/src/components/radio/index.js +7 -7
- package/src/components/radioGroup/RadioGroup.vue +41 -41
- package/src/components/radioGroup/index.js +7 -7
- package/src/components/scheduler/Scheduler.vue +149 -149
- package/src/components/scheduler/index.js +7 -7
- package/src/components/scheduler/uses.js +183 -183
- package/src/components/select/Select.vue +440 -440
- package/src/components/select/index.js +7 -7
- package/src/components/select/uses.js +270 -270
- package/src/components/slider/Slider.vue +505 -505
- package/src/components/slider/index.js +7 -7
- package/src/components/slider/uses.js +390 -390
- package/src/components/tabPanel/TabPanel.vue +74 -74
- package/src/components/tabPanel/index.js +7 -7
- package/src/components/tabs/Tabs.vue +517 -517
- package/src/components/tabs/index.js +7 -7
- package/src/components/textField/TextField.vue +375 -375
- package/src/components/textField/index.js +7 -7
- package/src/components/timePicker/TimePicker.vue +352 -352
- package/src/components/timePicker/index.js +7 -7
- package/src/components/toggle/Toggle.vue +115 -115
- package/src/components/toggle/index.js +7 -7
- package/src/components/tree/Tree.vue +313 -313
- package/src/components/tree/TreeNode.vue +293 -293
- package/src/components/tree/index.js +7 -7
- package/src/components/treeGrid/TreeGrid.vue +758 -758
- package/src/components/treeGrid/TreeGridNode.vue +275 -275
- package/src/components/treeGrid/index.js +9 -9
- package/src/components/treeGrid/style/treeGrid.scss +261 -261
- package/src/components/treeGrid/treeGrid.toolbar.vue +26 -26
- package/src/components/treeGrid/uses.js +867 -867
- package/src/components/window/Window.vue +329 -329
- package/src/components/window/index.js +7 -7
- package/src/components/window/uses.js +899 -899
- package/src/directives/clickoutside.js +90 -90
- package/src/main.js +116 -116
- package/src/style/components/input.scss +108 -108
- package/src/style/functions.scss +3 -3
- package/src/style/index.scss +6 -6
- package/src/style/lib/fonts/EVUI.svg +292 -292
- package/src/style/lib/icon.css +888 -888
- package/src/style/mixins.scss +94 -94
- package/src/style/themes.scss +67 -67
- package/src/style/variables.scss +22 -22
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<i
|
|
3
|
-
:class="[
|
|
4
|
-
icon,
|
|
5
|
-
{ [`ev-icon-${size}`]: !!size },
|
|
6
|
-
]"
|
|
7
|
-
@click="onClick"
|
|
8
|
-
@dblClick="onDblClick"
|
|
9
|
-
@contextmenu="onContextMenu"
|
|
10
|
-
/>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<script>
|
|
14
|
-
export default {
|
|
15
|
-
name: 'EvIcon',
|
|
16
|
-
props: {
|
|
17
|
-
icon: {
|
|
18
|
-
type: String,
|
|
19
|
-
default: '',
|
|
20
|
-
},
|
|
21
|
-
size: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: '',
|
|
24
|
-
validator: val => ['', 'small', 'medium', 'large'].includes(val),
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
emits: {
|
|
28
|
-
click: null,
|
|
29
|
-
'dbl-click': null,
|
|
30
|
-
'context-menu': null,
|
|
31
|
-
},
|
|
32
|
-
setup(props, { emit }) {
|
|
33
|
-
const onClick = (e) => {
|
|
34
|
-
emit('click', e);
|
|
35
|
-
};
|
|
36
|
-
const onDblClick = (e) => {
|
|
37
|
-
emit('dbl-click', e);
|
|
38
|
-
};
|
|
39
|
-
const onContextMenu = (e) => {
|
|
40
|
-
emit('context-menu', e);
|
|
41
|
-
};
|
|
42
|
-
return {
|
|
43
|
-
onClick,
|
|
44
|
-
onDblClick,
|
|
45
|
-
onContextMenu,
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<i
|
|
3
|
+
:class="[
|
|
4
|
+
icon,
|
|
5
|
+
{ [`ev-icon-${size}`]: !!size },
|
|
6
|
+
]"
|
|
7
|
+
@click="onClick"
|
|
8
|
+
@dblClick="onDblClick"
|
|
9
|
+
@contextmenu="onContextMenu"
|
|
10
|
+
/>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
export default {
|
|
15
|
+
name: 'EvIcon',
|
|
16
|
+
props: {
|
|
17
|
+
icon: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '',
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: '',
|
|
24
|
+
validator: val => ['', 'small', 'medium', 'large'].includes(val),
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
emits: {
|
|
28
|
+
click: null,
|
|
29
|
+
'dbl-click': null,
|
|
30
|
+
'context-menu': null,
|
|
31
|
+
},
|
|
32
|
+
setup(props, { emit }) {
|
|
33
|
+
const onClick = (e) => {
|
|
34
|
+
emit('click', e);
|
|
35
|
+
};
|
|
36
|
+
const onDblClick = (e) => {
|
|
37
|
+
emit('dbl-click', e);
|
|
38
|
+
};
|
|
39
|
+
const onContextMenu = (e) => {
|
|
40
|
+
emit('context-menu', e);
|
|
41
|
+
};
|
|
42
|
+
return {
|
|
43
|
+
onClick,
|
|
44
|
+
onDblClick,
|
|
45
|
+
onContextMenu,
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
</script>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import '@/style/lib/icon.css';
|
|
2
|
-
import EvIcon from './Icon';
|
|
3
|
-
|
|
4
|
-
EvIcon.install = (app) => {
|
|
5
|
-
app.component(EvIcon.name, EvIcon);
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export default EvIcon;
|
|
1
|
+
import '@/style/lib/icon.css';
|
|
2
|
+
import EvIcon from './Icon';
|
|
3
|
+
|
|
4
|
+
EvIcon.install = (app) => {
|
|
5
|
+
app.component(EvIcon.name, EvIcon);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default EvIcon;
|
|
@@ -1,212 +1,212 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
class="ev-input-number"
|
|
4
|
-
:class="{
|
|
5
|
-
disabled,
|
|
6
|
-
readonly,
|
|
7
|
-
}"
|
|
8
|
-
>
|
|
9
|
-
<div class="ev-input-number__wrapper">
|
|
10
|
-
<span
|
|
11
|
-
v-for="type in ['up', 'down']"
|
|
12
|
-
:key="`step-arrow-${type}`"
|
|
13
|
-
:class="['ev-input-number-icon', `step-${type}`]"
|
|
14
|
-
@click="stepValue(type)"
|
|
15
|
-
>
|
|
16
|
-
<i :class="`ev-icon-s-arrow-${type}`" />
|
|
17
|
-
</span>
|
|
18
|
-
<input
|
|
19
|
-
v-model.trim="currentValue"
|
|
20
|
-
class="ev-input"
|
|
21
|
-
type="text"
|
|
22
|
-
:placeholder="placeholder"
|
|
23
|
-
:disabled="disabled"
|
|
24
|
-
:readonly="readonly"
|
|
25
|
-
@focus="focusInput"
|
|
26
|
-
@blur="blurInput"
|
|
27
|
-
@change="changeMv"
|
|
28
|
-
@keydown.up.prevent="stepValue('up')"
|
|
29
|
-
@keydown.down.prevent="stepValue('down')"
|
|
30
|
-
@keydown.enter.prevent="validateValue(currentValue)"
|
|
31
|
-
/>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|
|
35
|
-
|
|
36
|
-
<script>
|
|
37
|
-
import { useModel, useStep, useInit } from './uses';
|
|
38
|
-
|
|
39
|
-
export default {
|
|
40
|
-
name: 'EvInputNumber',
|
|
41
|
-
props: {
|
|
42
|
-
modelValue: {
|
|
43
|
-
type: [String, Number],
|
|
44
|
-
default: null,
|
|
45
|
-
},
|
|
46
|
-
placeholder: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: '',
|
|
49
|
-
},
|
|
50
|
-
disabled: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
default: false,
|
|
53
|
-
},
|
|
54
|
-
readonly: {
|
|
55
|
-
type: Boolean,
|
|
56
|
-
default: false,
|
|
57
|
-
},
|
|
58
|
-
max: {
|
|
59
|
-
type: Number,
|
|
60
|
-
default: Infinity,
|
|
61
|
-
},
|
|
62
|
-
min: {
|
|
63
|
-
type: Number,
|
|
64
|
-
default: -Infinity,
|
|
65
|
-
},
|
|
66
|
-
step: {
|
|
67
|
-
type: Number,
|
|
68
|
-
default: 1,
|
|
69
|
-
validator: val => val > 0,
|
|
70
|
-
},
|
|
71
|
-
stepStrictly: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
default: false,
|
|
74
|
-
},
|
|
75
|
-
precision: {
|
|
76
|
-
type: Number,
|
|
77
|
-
default: 0,
|
|
78
|
-
validator: val => (val >= 0 && val <= 100 && val === parseInt(val, 10)),
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
emits: [
|
|
82
|
-
'update:modelValue',
|
|
83
|
-
'focus',
|
|
84
|
-
'blur',
|
|
85
|
-
'input',
|
|
86
|
-
'change',
|
|
87
|
-
],
|
|
88
|
-
setup() {
|
|
89
|
-
const {
|
|
90
|
-
currentValue,
|
|
91
|
-
validateValue,
|
|
92
|
-
focusInput,
|
|
93
|
-
blurInput,
|
|
94
|
-
changeMv,
|
|
95
|
-
} = useModel();
|
|
96
|
-
|
|
97
|
-
const {
|
|
98
|
-
stepValue,
|
|
99
|
-
} = useStep({
|
|
100
|
-
currentValue,
|
|
101
|
-
validateValue,
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
useInit({
|
|
105
|
-
currentValue,
|
|
106
|
-
validateValue,
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
return {
|
|
110
|
-
currentValue,
|
|
111
|
-
validateValue,
|
|
112
|
-
|
|
113
|
-
focusInput,
|
|
114
|
-
blurInput,
|
|
115
|
-
changeMv,
|
|
116
|
-
|
|
117
|
-
stepValue,
|
|
118
|
-
};
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
</script>
|
|
122
|
-
|
|
123
|
-
<style lang="scss">
|
|
124
|
-
@import '../../style/index.scss';
|
|
125
|
-
|
|
126
|
-
.ev-input-number {
|
|
127
|
-
position: relative;
|
|
128
|
-
box-sizing: border-box;
|
|
129
|
-
|
|
130
|
-
@include clearfix();
|
|
131
|
-
|
|
132
|
-
@import '../../style/components/input.scss';
|
|
133
|
-
&:hover {
|
|
134
|
-
.ev-input,
|
|
135
|
-
.ev-textarea {
|
|
136
|
-
@include evThemify() {
|
|
137
|
-
border: 1px solid evThemed('primary');
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
&__wrapper {
|
|
142
|
-
position: relative;
|
|
143
|
-
}
|
|
144
|
-
.ev-input {
|
|
145
|
-
$number-arrow-btn-width: 30px;
|
|
146
|
-
padding: 0 #{$number-arrow-btn-width + $input-default-padding} 0 $input-default-padding;
|
|
147
|
-
text-align: center;
|
|
148
|
-
}
|
|
149
|
-
.ev-input-number-icon {
|
|
150
|
-
display: flex;
|
|
151
|
-
position: absolute;
|
|
152
|
-
right: 0;
|
|
153
|
-
width: 30px;
|
|
154
|
-
height: $input-default-height / 2;
|
|
155
|
-
justify-content: center;
|
|
156
|
-
align-items: center;
|
|
157
|
-
font-size: 12px;
|
|
158
|
-
cursor: pointer;
|
|
159
|
-
|
|
160
|
-
@include evThemify() {
|
|
161
|
-
border-left: 1px solid evThemed('border-base');
|
|
162
|
-
background-color: evThemed('background-lighten');
|
|
163
|
-
}
|
|
164
|
-
&.step-up {
|
|
165
|
-
top: 0;
|
|
166
|
-
border-radius: 0 $default-radius 0 0;
|
|
167
|
-
|
|
168
|
-
@include evThemify() {
|
|
169
|
-
border-bottom: 1px solid evThemed('border-base');
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
&.step-down {
|
|
173
|
-
bottom: 0;
|
|
174
|
-
border-radius: 0 0 $default-radius 0;
|
|
175
|
-
}
|
|
176
|
-
&:hover {
|
|
177
|
-
@include evThemify() {
|
|
178
|
-
color: evThemed('primary');
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
@include state('disabled') {
|
|
185
|
-
.ev-input-number-icon {
|
|
186
|
-
@include evThemify() {
|
|
187
|
-
color: evThemed('disabled');
|
|
188
|
-
border-left: 1px solid evThemed('disabled');
|
|
189
|
-
}
|
|
190
|
-
&.step-up {
|
|
191
|
-
@include evThemify() {
|
|
192
|
-
border-bottom: 1px solid evThemed('disabled');
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
&:hover {
|
|
196
|
-
@include evThemify() {
|
|
197
|
-
color: evThemed('disabled');
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
@include state('readonly') {
|
|
203
|
-
.ev-input-number-icon {
|
|
204
|
-
cursor: not-allowed;
|
|
205
|
-
&:hover {
|
|
206
|
-
@include evThemify() {
|
|
207
|
-
color: inherit;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="ev-input-number"
|
|
4
|
+
:class="{
|
|
5
|
+
disabled,
|
|
6
|
+
readonly,
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<div class="ev-input-number__wrapper">
|
|
10
|
+
<span
|
|
11
|
+
v-for="type in ['up', 'down']"
|
|
12
|
+
:key="`step-arrow-${type}`"
|
|
13
|
+
:class="['ev-input-number-icon', `step-${type}`]"
|
|
14
|
+
@click="stepValue(type)"
|
|
15
|
+
>
|
|
16
|
+
<i :class="`ev-icon-s-arrow-${type}`" />
|
|
17
|
+
</span>
|
|
18
|
+
<input
|
|
19
|
+
v-model.trim="currentValue"
|
|
20
|
+
class="ev-input"
|
|
21
|
+
type="text"
|
|
22
|
+
:placeholder="placeholder"
|
|
23
|
+
:disabled="disabled"
|
|
24
|
+
:readonly="readonly"
|
|
25
|
+
@focus="focusInput"
|
|
26
|
+
@blur="blurInput"
|
|
27
|
+
@change="changeMv"
|
|
28
|
+
@keydown.up.prevent="stepValue('up')"
|
|
29
|
+
@keydown.down.prevent="stepValue('down')"
|
|
30
|
+
@keydown.enter.prevent="validateValue(currentValue)"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import { useModel, useStep, useInit } from './uses';
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
name: 'EvInputNumber',
|
|
41
|
+
props: {
|
|
42
|
+
modelValue: {
|
|
43
|
+
type: [String, Number],
|
|
44
|
+
default: null,
|
|
45
|
+
},
|
|
46
|
+
placeholder: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: '',
|
|
49
|
+
},
|
|
50
|
+
disabled: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false,
|
|
53
|
+
},
|
|
54
|
+
readonly: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false,
|
|
57
|
+
},
|
|
58
|
+
max: {
|
|
59
|
+
type: Number,
|
|
60
|
+
default: Infinity,
|
|
61
|
+
},
|
|
62
|
+
min: {
|
|
63
|
+
type: Number,
|
|
64
|
+
default: -Infinity,
|
|
65
|
+
},
|
|
66
|
+
step: {
|
|
67
|
+
type: Number,
|
|
68
|
+
default: 1,
|
|
69
|
+
validator: val => val > 0,
|
|
70
|
+
},
|
|
71
|
+
stepStrictly: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false,
|
|
74
|
+
},
|
|
75
|
+
precision: {
|
|
76
|
+
type: Number,
|
|
77
|
+
default: 0,
|
|
78
|
+
validator: val => (val >= 0 && val <= 100 && val === parseInt(val, 10)),
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
emits: [
|
|
82
|
+
'update:modelValue',
|
|
83
|
+
'focus',
|
|
84
|
+
'blur',
|
|
85
|
+
'input',
|
|
86
|
+
'change',
|
|
87
|
+
],
|
|
88
|
+
setup() {
|
|
89
|
+
const {
|
|
90
|
+
currentValue,
|
|
91
|
+
validateValue,
|
|
92
|
+
focusInput,
|
|
93
|
+
blurInput,
|
|
94
|
+
changeMv,
|
|
95
|
+
} = useModel();
|
|
96
|
+
|
|
97
|
+
const {
|
|
98
|
+
stepValue,
|
|
99
|
+
} = useStep({
|
|
100
|
+
currentValue,
|
|
101
|
+
validateValue,
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
useInit({
|
|
105
|
+
currentValue,
|
|
106
|
+
validateValue,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
currentValue,
|
|
111
|
+
validateValue,
|
|
112
|
+
|
|
113
|
+
focusInput,
|
|
114
|
+
blurInput,
|
|
115
|
+
changeMv,
|
|
116
|
+
|
|
117
|
+
stepValue,
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<style lang="scss">
|
|
124
|
+
@import '../../style/index.scss';
|
|
125
|
+
|
|
126
|
+
.ev-input-number {
|
|
127
|
+
position: relative;
|
|
128
|
+
box-sizing: border-box;
|
|
129
|
+
|
|
130
|
+
@include clearfix();
|
|
131
|
+
|
|
132
|
+
@import '../../style/components/input.scss';
|
|
133
|
+
&:hover {
|
|
134
|
+
.ev-input,
|
|
135
|
+
.ev-textarea {
|
|
136
|
+
@include evThemify() {
|
|
137
|
+
border: 1px solid evThemed('primary');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
&__wrapper {
|
|
142
|
+
position: relative;
|
|
143
|
+
}
|
|
144
|
+
.ev-input {
|
|
145
|
+
$number-arrow-btn-width: 30px;
|
|
146
|
+
padding: 0 #{$number-arrow-btn-width + $input-default-padding} 0 $input-default-padding;
|
|
147
|
+
text-align: center;
|
|
148
|
+
}
|
|
149
|
+
.ev-input-number-icon {
|
|
150
|
+
display: flex;
|
|
151
|
+
position: absolute;
|
|
152
|
+
right: 0;
|
|
153
|
+
width: 30px;
|
|
154
|
+
height: $input-default-height / 2;
|
|
155
|
+
justify-content: center;
|
|
156
|
+
align-items: center;
|
|
157
|
+
font-size: 12px;
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
|
|
160
|
+
@include evThemify() {
|
|
161
|
+
border-left: 1px solid evThemed('border-base');
|
|
162
|
+
background-color: evThemed('background-lighten');
|
|
163
|
+
}
|
|
164
|
+
&.step-up {
|
|
165
|
+
top: 0;
|
|
166
|
+
border-radius: 0 $default-radius 0 0;
|
|
167
|
+
|
|
168
|
+
@include evThemify() {
|
|
169
|
+
border-bottom: 1px solid evThemed('border-base');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
&.step-down {
|
|
173
|
+
bottom: 0;
|
|
174
|
+
border-radius: 0 0 $default-radius 0;
|
|
175
|
+
}
|
|
176
|
+
&:hover {
|
|
177
|
+
@include evThemify() {
|
|
178
|
+
color: evThemed('primary');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@include state('disabled') {
|
|
185
|
+
.ev-input-number-icon {
|
|
186
|
+
@include evThemify() {
|
|
187
|
+
color: evThemed('disabled');
|
|
188
|
+
border-left: 1px solid evThemed('disabled');
|
|
189
|
+
}
|
|
190
|
+
&.step-up {
|
|
191
|
+
@include evThemify() {
|
|
192
|
+
border-bottom: 1px solid evThemed('disabled');
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
&:hover {
|
|
196
|
+
@include evThemify() {
|
|
197
|
+
color: evThemed('disabled');
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
@include state('readonly') {
|
|
203
|
+
.ev-input-number-icon {
|
|
204
|
+
cursor: not-allowed;
|
|
205
|
+
&:hover {
|
|
206
|
+
@include evThemify() {
|
|
207
|
+
color: inherit;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import EvInputNumber from './InputNumber';
|
|
2
|
-
|
|
3
|
-
EvInputNumber.install = (app) => {
|
|
4
|
-
app.component(EvInputNumber.name, EvInputNumber);
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export default EvInputNumber;
|
|
1
|
+
import EvInputNumber from './InputNumber';
|
|
2
|
+
|
|
3
|
+
EvInputNumber.install = (app) => {
|
|
4
|
+
app.component(EvInputNumber.name, EvInputNumber);
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export default EvInputNumber;
|