evui 2.0.9 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/0b8d1200e71cae8d747dce4e69c4efb6.png +0 -0
- package/dist/1.css +4 -0
- package/dist/1.css.map +1 -0
- package/dist/1.evui.min.js +2 -0
- package/dist/1.evui.min.js.map +1 -0
- package/dist/1ba679c05036b34bf359aa2e6c450faa.ttf +0 -0
- package/dist/2.css +4 -0
- package/dist/2.css.map +1 -0
- package/dist/2.evui.min.js +2 -0
- package/dist/2.evui.min.js.map +1 -0
- package/dist/278156e41e0ad908cf7f841b17130502.woff2 +0 -0
- package/dist/3.evui.min.js +2 -0
- package/dist/3.evui.min.js.map +1 -0
- package/dist/32be89b11725274cd3e801192ba88361.ttf +0 -0
- package/dist/38c6d8bab26db77d8c806813e1497763.woff2 +0 -0
- package/dist/4.evui.min.js +2 -0
- package/dist/4.evui.min.js.map +1 -0
- package/dist/425399f81e4ce7cbd967685402ba0260.woff +0 -0
- package/dist/4730076470a665bbc7b783c56d29a72e.svg +261 -0
- package/dist/52e9a7f6ff3af5ad261e5292d07ebdca.eot +0 -0
- package/dist/5367103510b27b78482794590e1ce3b0.ttf +0 -0
- package/dist/57e963e3d6dd0a9cf05150b40eebf69b.svg +1008 -0
- package/dist/65a2fb6d9aaa164b41a039302093995b.ttf +0 -0
- package/dist/687a4990ea22bb1a49d469a5d9319790.woff2 +0 -0
- package/dist/6c1d906bf5ba48676f65b2d65e935e1a.ttf +0 -0
- package/dist/6dafca5a4f1e31f2bdf11939b24ff422.ttf +0 -0
- package/dist/752905fa5edf21fc52a10a0c1ca9c7a4.eot +0 -0
- package/dist/76c05d80dda67cdc5d03f345b7bd063f.ttf +0 -0
- package/dist/7d62eb50e7bb05eedb2a4656f7fe8f3b.svg +366 -0
- package/dist/a01e3f2d6c83dc3aee175e2482b3f777.eot +0 -0
- package/dist/b30fd8419d7e6d5918856c7531d33482.svg +1518 -0
- package/dist/c57dd55fa982e8940f69ca1d69a8a999.woff +0 -0
- package/dist/c656b8caa454ed19b9a2ef7f4f5b8fea.ttf +0 -0
- package/dist/cac87dc00c87a5d74711d0276713808a.woff +0 -0
- package/dist/d68fa3e67dbb653a13cec44b1bcabcfe.eot +0 -0
- package/dist/ddae9b1ba9b0b42f58809904b0b21349.woff +0 -0
- package/dist/evui.min.js +19 -0
- package/dist/evui.min.js.gz +0 -0
- package/dist/evui.min.js.map +1 -0
- package/dist/main.css +85 -0
- package/dist/main.css.gz +0 -0
- package/dist/main.css.map +1 -0
- package/package.json +56 -76
- package/src/common/emitter.js +20 -0
- package/src/common/utils.debounce.js +223 -0
- package/src/common/utils.js +51 -17
- package/src/common/utils.throttle.js +83 -0
- package/src/common/utils.tree.js +18 -0
- package/src/components/button/button.vue +317 -241
- package/src/components/chart/chart.core.js +378 -85
- package/src/components/chart/chart.vue +133 -115
- package/src/components/chart/element/element.bar.js +219 -25
- package/src/components/chart/element/element.bar.time.js +115 -0
- package/src/components/chart/element/element.line.js +172 -21
- package/src/components/chart/element/element.pie.js +86 -0
- package/src/components/chart/element/element.scatter.js +9 -2
- package/src/components/chart/element/element.tip.js +356 -0
- package/src/components/chart/helpers/helpers.canvas.js +94 -0
- package/src/components/chart/helpers/helpers.constant.js +25 -6
- package/src/components/chart/helpers/helpers.util.js +83 -38
- package/src/components/chart/index.js +0 -1
- package/src/components/chart/model/model.series.js +43 -14
- package/src/components/chart/model/model.store.js +440 -46
- package/src/components/chart/plugins/plugins.interaction.js +324 -0
- package/src/components/chart/plugins/plugins.legend.js +233 -91
- package/src/components/chart/plugins/plugins.pie.js +179 -0
- package/src/components/chart/plugins/plugins.title.js +25 -2
- package/src/components/chart/plugins/plugins.tooltip.js +384 -0
- package/src/components/chart/scale/scale.js +91 -29
- package/src/components/chart/scale/scale.linear.js +12 -0
- package/src/components/chart/scale/scale.logarithmic.js +25 -0
- package/src/components/chart/scale/scale.step.js +89 -52
- package/src/components/chart/scale/scale.time.category.js +204 -0
- package/src/components/chart/scale/scale.time.js +19 -1
- package/src/components/checkbox/checkbox-group.vue +15 -11
- package/src/components/checkbox/checkbox.vue +210 -138
- package/src/components/codeview/code.vue +42 -29
- package/src/components/contextmenu/contextmenu.child.vue +79 -0
- package/src/components/contextmenu/contextmenu.vue +276 -0
- package/src/components/contextmenu/contextmenu.wrap.vue +189 -0
- package/src/components/contextmenu/index.js +3 -0
- package/src/components/datepicker/calendar.core.js +588 -492
- package/src/components/datepicker/calendar.vue +0 -3
- package/src/components/datepicker/datepicker.vue +43 -15
- package/src/components/datepicker/index.js +5 -1
- package/src/components/grid/grid.filter.vue +290 -0
- package/src/components/grid/grid.filter.window.vue +411 -0
- package/src/components/grid/grid.render.vue +45 -0
- package/src/components/grid/grid.vue +1338 -0
- package/src/components/icon/icon.vue +23 -7
- package/src/components/input/input.number.vue +309 -277
- package/src/components/label/label.vue +2 -2
- package/src/components/loadingmask/loadingmask.vue +6 -13
- package/src/components/loginfield/loginfield.vue +46 -37
- package/src/components/markdown/index.js +3 -0
- package/src/components/markdown/markdown.vue +1001 -0
- package/src/components/menu/index.js +1 -3
- package/src/components/menu/menu.nav.item.vue +115 -0
- package/src/components/menu/menu.nav.sub.vue +42 -0
- package/src/components/menu/menu.nav.vue +71 -98
- package/src/components/message/index.js +3 -0
- package/src/components/message/message.js +63 -0
- package/src/components/message/message.vue +191 -0
- package/src/components/message-box/index.js +3 -0
- package/src/components/message-box/message-box.js +31 -0
- package/src/components/message-box/message-box.vue +299 -0
- package/src/components/notification/index.js +3 -0
- package/src/components/notification/notification.js +75 -0
- package/src/components/notification/notification.vue +242 -0
- package/src/components/radio/radio-group.vue +6 -2
- package/src/components/radio/radio.vue +156 -76
- package/src/components/selectbox/dropdown.vue +86 -40
- package/src/components/selectbox/listbox.vue +47 -18
- package/src/components/selectbox/option.vue +1 -1
- package/src/components/selectbox/selectbox.vue +304 -316
- package/src/components/slider/slider-tooltip.vue +7 -7
- package/src/components/slider/slider.vue +20 -25
- package/src/components/splitter/splitter.vue +104 -94
- package/src/components/table/table.black.css +1 -1
- package/src/components/table/table.filter.lite.vue +7 -7
- package/src/components/table/table.filter.vue +1 -1
- package/src/components/table/table.grey.css +5 -6
- package/src/components/table/table.navy.css +1 -1
- package/src/components/table/table.vue +55 -48
- package/src/components/tabs/tab-panel.vue +19 -5
- package/src/components/tabs/tabs.vue +182 -87
- package/src/components/textfield/textfield.vue +110 -87
- package/src/components/timepicker/index.js +2 -2
- package/src/components/timepicker/spinner.vue +15 -17
- package/src/components/timepicker/timepicker.vue +98 -53
- package/src/components/toggle/toggle.vue +148 -109
- package/src/components/tree/index.js +2 -6
- package/src/components/tree/render.js +17 -0
- package/src/components/tree/tree-node.vue +214 -0
- package/src/components/tree/tree.vue +296 -0
- package/src/components/tree-table/index.js +7 -0
- package/src/components/{tree → tree-table}/tree.table.black.css +0 -0
- package/src/components/{tree → tree-table}/tree.table.grey.css +0 -0
- package/src/components/{tree → tree-table}/tree.table.vue +36 -41
- package/src/components/{tree → tree-table}/tree.util.js +0 -0
- package/src/components/window/window.vue +238 -191
- package/src/index.js +25 -12
- package/src/styles/base/base.scss +50 -0
- package/src/styles/base/index.scss +1 -0
- package/src/styles/default.scss +5 -0
- package/src/styles/{codemirror.css → lib/codemirror.css} +0 -0
- package/src/styles/{all.css → lib/fontawesome.css} +1 -1
- package/src/styles/lib/icon.css +792 -0
- package/src/styles/themes/index.scss +2 -0
- package/src/styles/themes/mixin.scss +33 -0
- package/src/styles/themes/variables.scss +206 -0
- package/src/styles/utils/colors.scss +222 -0
- package/src/styles/utils/index.scss +2 -0
- package/src/styles/utils/mixins.scss +34 -0
- package/src/styles/utils/variables.scss +27 -0
- package/src/webfonts/EVUI.eot +0 -0
- package/src/webfonts/EVUI.svg +251 -173
- package/src/webfonts/EVUI.ttf +0 -0
- package/src/webfonts/EVUI.woff +0 -0
- package/src/webfonts/Roboto-Bold.ttf +0 -0
- package/src/webfonts/Roboto-Medium.ttf +0 -0
- package/src/webfonts/Roboto-Regular.ttf +0 -0
- package/src/components/chart/charts/chart.bar.js +0 -334
- package/src/components/chart/charts/chart.base.js +0 -1075
- package/src/components/chart/charts/chart.line.js +0 -262
- package/src/components/chart/charts/chart.pie.js +0 -383
- package/src/components/chart/charts/chart.scatter.js +0 -349
- package/src/components/chart/charts/chart.sunburst.js +0 -193
- package/src/components/chart/core/axis/axis.js +0 -217
- package/src/components/chart/core/axis/axis.scale.auto.js +0 -69
- package/src/components/chart/core/axis/axis.scale.fixed.js +0 -65
- package/src/components/chart/core/axis/axis.scale.steps.js +0 -149
- package/src/components/chart/core/core.constant.js +0 -116
- package/src/components/chart/core/core.legend.js +0 -473
- package/src/components/chart/core/core.util.js +0 -66
- package/src/components/chart/core/data/data.js +0 -412
- package/src/components/chart/core/data/data.pie.js +0 -70
- package/src/components/chart/core/data/data.stack.js +0 -222
- package/src/components/chart/core/data/data.sunburst.js +0 -172
- package/src/components/menu/menu.context.children.vue +0 -201
- package/src/components/menu/menu.context.vue +0 -144
- package/src/components/tabs/jun/tab.vue +0 -123
- package/src/components/tabs/jun/tabs.vue +0 -484
- package/src/styles/evui.css +0 -386
- package/src/styles/icon.css +0 -557
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
@click="preventDefault"
|
|
15
15
|
/>
|
|
16
16
|
<icon
|
|
17
|
-
class="
|
|
17
|
+
class="ei-arrow-up"
|
|
18
18
|
/>
|
|
19
19
|
</a>
|
|
20
20
|
<a
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
:class="innerDownClasses"
|
|
27
27
|
@click="preventDefault"
|
|
28
28
|
/>
|
|
29
|
-
<icon class="
|
|
29
|
+
<icon class="ei-arrow-down" />
|
|
30
30
|
</a>
|
|
31
31
|
</div>
|
|
32
32
|
<div
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<script>
|
|
56
56
|
import icon from '@/components/icon/icon';
|
|
57
57
|
|
|
58
|
-
const prefixCls = '
|
|
58
|
+
const prefixCls = 'ev-input-number';
|
|
59
59
|
|
|
60
60
|
function parsedStyle(value) {
|
|
61
61
|
const mark = value.toString();
|
|
@@ -82,295 +82,312 @@
|
|
|
82
82
|
return (Math.round(num1 * sf) + Math.round(num2 * sf)) / sf;
|
|
83
83
|
}
|
|
84
84
|
export default {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
components: {
|
|
86
|
+
icon,
|
|
87
|
+
},
|
|
88
|
+
props: {
|
|
89
|
+
max: {
|
|
90
|
+
type: Number,
|
|
91
|
+
default: Infinity,
|
|
87
92
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
precision: {
|
|
118
|
-
type: Number,
|
|
119
|
-
default: 1,
|
|
120
|
-
validator(value) {
|
|
121
|
-
return !isNaN(Number(value)) && value >= 0 && value <= 100;
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
formatter: {
|
|
125
|
-
type: Function,
|
|
126
|
-
default: null,
|
|
127
|
-
},
|
|
128
|
-
readonly: {
|
|
129
|
-
type: Boolean,
|
|
130
|
-
default: false,
|
|
93
|
+
min: {
|
|
94
|
+
type: Number,
|
|
95
|
+
default: -Infinity,
|
|
96
|
+
},
|
|
97
|
+
step: {
|
|
98
|
+
type: Number,
|
|
99
|
+
default: 0.1,
|
|
100
|
+
},
|
|
101
|
+
width: {
|
|
102
|
+
type: [String, Number],
|
|
103
|
+
default: '100%',
|
|
104
|
+
},
|
|
105
|
+
height: {
|
|
106
|
+
type: [String, Number],
|
|
107
|
+
default: '100%',
|
|
108
|
+
},
|
|
109
|
+
value: {
|
|
110
|
+
type: Number,
|
|
111
|
+
default: null,
|
|
112
|
+
},
|
|
113
|
+
disabled: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: false,
|
|
116
|
+
},
|
|
117
|
+
precision: {
|
|
118
|
+
type: Number,
|
|
119
|
+
default: 1,
|
|
120
|
+
validator(value) {
|
|
121
|
+
return typeof value === 'number' && !Number.isNaN(value) && value >= 0 && value <= 100;
|
|
131
122
|
},
|
|
132
123
|
},
|
|
133
|
-
|
|
124
|
+
formatter: {
|
|
125
|
+
type: Function,
|
|
126
|
+
default: null,
|
|
127
|
+
},
|
|
128
|
+
readonly: {
|
|
129
|
+
type: Boolean,
|
|
130
|
+
default: false,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
data() {
|
|
134
|
+
return {
|
|
135
|
+
focused: false,
|
|
136
|
+
upDisabled: false,
|
|
137
|
+
downDisabled: false,
|
|
138
|
+
currentValue: this.setValue(this.value),
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
computed: {
|
|
142
|
+
styleObject() {
|
|
134
143
|
return {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
downDisabled: false,
|
|
138
|
-
currentValue: this.setValue(this.value),
|
|
144
|
+
width: parsedStyle(this.width),
|
|
145
|
+
height: parsedStyle(this.height),
|
|
139
146
|
};
|
|
140
147
|
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
formatterValue: function formatterValue() {
|
|
149
|
-
if (this.formatter) {
|
|
150
|
-
return this.formatter(this.currentValue);
|
|
151
|
-
}
|
|
152
|
-
return this.currentValue;
|
|
153
|
-
},
|
|
154
|
-
wrapClasses: function wrapClasses() {
|
|
155
|
-
return [
|
|
156
|
-
`${prefixCls}`,
|
|
157
|
-
{
|
|
158
|
-
[`${prefixCls}-disabled`]: this.disabled,
|
|
159
|
-
},
|
|
160
|
-
];
|
|
161
|
-
},
|
|
162
|
-
handlerClasses: function handlerClasses() {
|
|
163
|
-
return `${prefixCls}-handler-wrap`;
|
|
164
|
-
},
|
|
165
|
-
upClasses: function upClasses() {
|
|
166
|
-
return [
|
|
167
|
-
`${prefixCls}-handler`,
|
|
168
|
-
`${prefixCls}-handler-up`,
|
|
169
|
-
];
|
|
170
|
-
},
|
|
171
|
-
innerUpClasses: function innerUpClasses() {
|
|
172
|
-
return `${prefixCls}-handler-up-inner icon`;
|
|
173
|
-
},
|
|
174
|
-
downClasses: function downClasses() {
|
|
175
|
-
return [
|
|
176
|
-
`${prefixCls}-handler`,
|
|
177
|
-
`${prefixCls}-handler-down`,
|
|
178
|
-
];
|
|
179
|
-
},
|
|
180
|
-
innerDownClasses: function innerDownClasses() {
|
|
181
|
-
return `${prefixCls}-handler-down-inner icon`;
|
|
182
|
-
},
|
|
183
|
-
inputWrapClasses: function inputWrapClasses() {
|
|
184
|
-
return `${prefixCls}-input-wrap`;
|
|
185
|
-
},
|
|
186
|
-
inputClasses: function inputClasses() {
|
|
187
|
-
return `${prefixCls}-input`;
|
|
188
|
-
},
|
|
148
|
+
formatterValue() {
|
|
149
|
+
if (this.formatter) {
|
|
150
|
+
this.$emit('input', this.formatter(this.currentValue));
|
|
151
|
+
return this.formatter(this.currentValue);
|
|
152
|
+
}
|
|
153
|
+
this.$emit('input', this.currentValue);
|
|
154
|
+
return this.currentValue;
|
|
189
155
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
156
|
+
wrapClasses() {
|
|
157
|
+
return [
|
|
158
|
+
`${prefixCls}`,
|
|
159
|
+
{
|
|
160
|
+
[`${prefixCls}-disabled`]: this.disabled,
|
|
161
|
+
},
|
|
162
|
+
];
|
|
194
163
|
},
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
164
|
+
handlerClasses() {
|
|
165
|
+
return `${prefixCls}-handler-wrap`;
|
|
166
|
+
},
|
|
167
|
+
upClasses() {
|
|
168
|
+
return [
|
|
169
|
+
`${prefixCls}-handler`,
|
|
170
|
+
`${prefixCls}-handler-up`,
|
|
171
|
+
];
|
|
172
|
+
},
|
|
173
|
+
innerUpClasses() {
|
|
174
|
+
return `${prefixCls}-handler-up-inner icon`;
|
|
175
|
+
},
|
|
176
|
+
downClasses() {
|
|
177
|
+
return [
|
|
178
|
+
`${prefixCls}-handler`,
|
|
179
|
+
`${prefixCls}-handler-down`,
|
|
180
|
+
];
|
|
181
|
+
},
|
|
182
|
+
innerDownClasses() {
|
|
183
|
+
return `${prefixCls}-handler-down-inner icon`;
|
|
184
|
+
},
|
|
185
|
+
inputWrapClasses() {
|
|
186
|
+
return `${prefixCls}-input-wrap`;
|
|
187
|
+
},
|
|
188
|
+
inputClasses() {
|
|
189
|
+
return `${prefixCls}-input`;
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
watch: {
|
|
193
|
+
value(updatedValue) {
|
|
194
|
+
this.currentValue = updatedValue;
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
methods: {
|
|
198
|
+
preventDefault(e) {
|
|
199
|
+
e.preventDefault();
|
|
200
|
+
},
|
|
201
|
+
up(e) {
|
|
202
|
+
const targetValue = Number(e.target.value);
|
|
203
|
+
if (this.upDisabled && isNaN(targetValue)) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
this.changeStep('up', e);
|
|
207
|
+
return true;
|
|
208
|
+
},
|
|
209
|
+
down(e) {
|
|
210
|
+
const targetValue = Number(e.target.value);
|
|
211
|
+
if (this.downDisabled && isNaN(targetValue)) {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
this.changeStep('down', e);
|
|
215
|
+
return true;
|
|
216
|
+
},
|
|
217
|
+
changeStep(type, e) {
|
|
218
|
+
if (this.disabled || this.readonly) {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
const step = Number(this.step);
|
|
222
|
+
const targetValue = Number(e.target.value);
|
|
223
|
+
let updatedValue = Number(this.currentValue);
|
|
222
224
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
if (type === 'up') {
|
|
235
|
-
updatedValue = addNum(updatedValue, step);
|
|
236
|
-
} else if (type === 'down') {
|
|
237
|
-
updatedValue = addNum(updatedValue, -step);
|
|
238
|
-
}
|
|
239
|
-
this.setValue(updatedValue);
|
|
240
|
-
return true;
|
|
241
|
-
},
|
|
242
|
-
setValue(value) {
|
|
243
|
-
const updatedValue = Number(Number(value).toFixed(this.precision));
|
|
244
|
-
this.$nextTick(() => {
|
|
245
|
-
this.currentValue = updatedValue;
|
|
246
|
-
});
|
|
247
|
-
return updatedValue;
|
|
248
|
-
},
|
|
249
|
-
change(e) {
|
|
250
|
-
let updatedValue;
|
|
251
|
-
const max = this.max;
|
|
252
|
-
const min = this.min;
|
|
253
|
-
const value = e.target.value.trim();
|
|
254
|
-
const isEmptyString = value.length === 0;
|
|
255
|
-
if (isEmptyString) {
|
|
256
|
-
this.setValue(null);
|
|
257
|
-
return false;
|
|
258
|
-
}
|
|
259
|
-
if (this.validateValue(e.type, value)) {
|
|
225
|
+
if (isNaN(updatedValue)) {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
if (!isNaN(targetValue) && type !== null) {
|
|
229
|
+
if (e.wheelDeltaY === 120 && addNum(targetValue, step) <= this.max) {
|
|
230
|
+
updatedValue = targetValue;
|
|
231
|
+
} else if (e.wheelDeltaY === -120 && addNum(targetValue, -step) >= this.min) {
|
|
232
|
+
updatedValue = targetValue;
|
|
233
|
+
} else {
|
|
260
234
|
return false;
|
|
261
235
|
}
|
|
262
|
-
|
|
263
|
-
|
|
236
|
+
}
|
|
237
|
+
if (type === 'up' && addNum(updatedValue, step) <= this.max) {
|
|
238
|
+
updatedValue = addNum(updatedValue, step);
|
|
239
|
+
} else if (type === 'down' && addNum(updatedValue, -step) >= this.min) {
|
|
240
|
+
updatedValue = addNum(updatedValue, -step);
|
|
241
|
+
} else {
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
this.setValue(updatedValue);
|
|
245
|
+
return true;
|
|
246
|
+
},
|
|
247
|
+
setValue(value) {
|
|
248
|
+
const updatedValue = Number(Number(value).toFixed(this.precision));
|
|
249
|
+
this.$nextTick(() => {
|
|
250
|
+
this.currentValue = updatedValue;
|
|
251
|
+
});
|
|
252
|
+
return updatedValue;
|
|
253
|
+
},
|
|
254
|
+
change(e) {
|
|
255
|
+
let updatedValue;
|
|
256
|
+
const max = this.max;
|
|
257
|
+
const min = this.min;
|
|
258
|
+
const value = e.target.value.trim();
|
|
259
|
+
const isEmptyString = value.length === 0;
|
|
260
|
+
if (isEmptyString) {
|
|
261
|
+
this.setValue(null);
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
if (this.validateValue(e.type, value)) {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
if (isNaN(value)) {
|
|
268
|
+
e.target.value = this.setValue(this.currentValue);
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
if (!isNaN(value)) {
|
|
272
|
+
updatedValue = Number(value);
|
|
273
|
+
if (e.type === 'input' && value < min) {
|
|
264
274
|
return false;
|
|
265
275
|
}
|
|
266
|
-
if (
|
|
267
|
-
updatedValue =
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
if (value > max || value < min) {
|
|
272
|
-
updatedValue = value > max ? max : min;
|
|
273
|
-
} else {
|
|
274
|
-
updatedValue = value;
|
|
275
|
-
}
|
|
276
|
-
this.setValue(updatedValue);
|
|
276
|
+
if (value > max || value < min) {
|
|
277
|
+
updatedValue = value > max ? max : min;
|
|
278
|
+
} else {
|
|
279
|
+
updatedValue = value;
|
|
277
280
|
}
|
|
278
281
|
this.setValue(updatedValue);
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
this.down(e);
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
wheelEvent(e) {
|
|
282
|
+
}
|
|
283
|
+
this.setValue(updatedValue);
|
|
284
|
+
this.currentValue = value;
|
|
285
|
+
return true;
|
|
286
|
+
},
|
|
287
|
+
validateValue(type, value) {
|
|
288
|
+
let result = false;
|
|
289
|
+
if (type === 'input'
|
|
290
|
+
&& value.match(/^-?\.?$|\.$/)) {
|
|
291
|
+
result = true;
|
|
292
|
+
}
|
|
293
|
+
if (type === 'change'
|
|
294
|
+
&& value === this.currentValue) {
|
|
295
|
+
result = true;
|
|
296
|
+
}
|
|
297
|
+
return result;
|
|
298
|
+
},
|
|
299
|
+
focus(e) {
|
|
300
|
+
this.focused = true;
|
|
301
|
+
this.$emit('focus', e);
|
|
302
|
+
},
|
|
303
|
+
blur(e) {
|
|
304
|
+
this.focused = false;
|
|
305
|
+
this.$emit('blur', e);
|
|
306
|
+
},
|
|
307
|
+
keyDownEvent(e) {
|
|
308
|
+
if (e.keyCode === 38) {
|
|
310
309
|
e.preventDefault();
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
},
|
|
310
|
+
this.up(e);
|
|
311
|
+
} else if (e.keyCode === 40) {
|
|
312
|
+
e.preventDefault();
|
|
313
|
+
this.down(e);
|
|
314
|
+
}
|
|
317
315
|
},
|
|
318
|
-
|
|
316
|
+
wheelEvent(e) {
|
|
317
|
+
e.preventDefault();
|
|
318
|
+
if (e.wheelDeltaY === 120) {
|
|
319
|
+
this.up(e);
|
|
320
|
+
} else if (e.wheelDeltaY === -120) {
|
|
321
|
+
this.down(e);
|
|
322
|
+
}
|
|
319
323
|
},
|
|
320
|
-
}
|
|
324
|
+
},
|
|
325
|
+
init() {
|
|
326
|
+
},
|
|
327
|
+
};
|
|
321
328
|
</script>
|
|
322
|
-
<style
|
|
323
|
-
|
|
324
|
-
|
|
329
|
+
<style lang="scss">
|
|
330
|
+
@import '~@/styles/default';
|
|
331
|
+
|
|
332
|
+
.ev-input-number {
|
|
325
333
|
display: inline-block;
|
|
326
334
|
width: 100%;
|
|
327
335
|
line-height: 1.5;
|
|
328
|
-
padding:
|
|
336
|
+
padding: 0;
|
|
329
337
|
font-size: 12px;
|
|
330
338
|
color: #495060;
|
|
331
|
-
background-color: #
|
|
339
|
+
background-color: #FFFFFF;
|
|
332
340
|
background-image: none;
|
|
333
341
|
position: relative;
|
|
334
342
|
cursor: text;
|
|
335
343
|
margin: 0;
|
|
336
344
|
height: 32px;
|
|
337
345
|
vertical-align: middle;
|
|
338
|
-
border: 1px solid #
|
|
346
|
+
border: 1px solid #DDDEE1;
|
|
339
347
|
border-radius: 4px;
|
|
340
348
|
overflow: hidden;
|
|
341
349
|
transition: border 0.2s ease-in-out, background 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
|
|
350
|
+
|
|
351
|
+
@include evThemify() {
|
|
352
|
+
color: evThemed('font-color-base');
|
|
353
|
+
border: $border-solid evThemed('number-input-border');
|
|
354
|
+
background-color: evThemed('number-input-background');
|
|
355
|
+
}
|
|
342
356
|
}
|
|
343
|
-
|
|
357
|
+
|
|
358
|
+
.ev-input-number-handler-wrap {
|
|
344
359
|
width: 22px;
|
|
345
360
|
height: 100%;
|
|
346
|
-
border-left: 1px solid #
|
|
361
|
+
border-left: 1px solid #DDDEE1;
|
|
347
362
|
border-radius: 0 4px 4px 0;
|
|
348
|
-
background: #
|
|
363
|
+
background: #FFFFFF;
|
|
349
364
|
position: absolute;
|
|
350
365
|
top: 0;
|
|
351
366
|
right: 0;
|
|
352
367
|
opacity: 0;
|
|
353
368
|
transition: opacity 0.2s ease-in-out;
|
|
354
369
|
}
|
|
355
|
-
/*border color when mouse hover*/
|
|
356
|
-
.
|
|
357
|
-
border-color
|
|
370
|
+
/* border color when mouse hover */
|
|
371
|
+
.ev-input-number:hover {
|
|
372
|
+
border-color: #2D8CF0;
|
|
358
373
|
}
|
|
359
|
-
|
|
360
|
-
|
|
374
|
+
|
|
375
|
+
.ev-input-number:hover .ev-input-number-handler-wrap {
|
|
376
|
+
border-color: #2D8CF0;
|
|
361
377
|
opacity: 1;
|
|
362
378
|
}
|
|
363
379
|
|
|
364
|
-
.
|
|
365
|
-
color
|
|
380
|
+
.ev-input-number:hover i {
|
|
381
|
+
color: #2D8CF0;
|
|
366
382
|
}
|
|
367
383
|
|
|
368
|
-
/*inner input div class*/
|
|
369
|
-
.
|
|
384
|
+
/* inner input div class */
|
|
385
|
+
.ev-input-number-input-wrap {
|
|
370
386
|
overflow: hidden;
|
|
371
387
|
height: 32px;
|
|
372
388
|
}
|
|
373
|
-
|
|
389
|
+
|
|
390
|
+
.ev-input-number-input {
|
|
374
391
|
width: 100%;
|
|
375
392
|
height: 32px;
|
|
376
393
|
line-height: 32px;
|
|
@@ -378,63 +395,78 @@
|
|
|
378
395
|
text-align: left;
|
|
379
396
|
outline: 0;
|
|
380
397
|
-moz-appearance: textfield;
|
|
381
|
-
color: #666;
|
|
382
398
|
border: 0;
|
|
383
399
|
border-radius: 4px;
|
|
400
|
+
background-color: transparent;
|
|
401
|
+
|
|
402
|
+
@include evThemify() {
|
|
403
|
+
color: evThemed('font-color-base');
|
|
404
|
+
}
|
|
384
405
|
}
|
|
385
|
-
|
|
386
|
-
|
|
406
|
+
|
|
407
|
+
/* handler line class */
|
|
408
|
+
.ev-input-number-handler {
|
|
387
409
|
display: block;
|
|
388
410
|
width: 100%;
|
|
389
411
|
height: 16px;
|
|
390
412
|
line-height: 0;
|
|
391
413
|
text-align: center;
|
|
392
414
|
overflow: hidden;
|
|
393
|
-
color: #
|
|
415
|
+
color: #999999;
|
|
394
416
|
position: relative;
|
|
417
|
+
padding-top: 1px;
|
|
418
|
+
padding-left: 1px;
|
|
419
|
+
|
|
420
|
+
@include evThemify() {
|
|
421
|
+
color: evThemed('font-color-base');
|
|
422
|
+
border: $border-solid evThemed('number-input-border');
|
|
423
|
+
background-color: evThemed('number-input-background');
|
|
424
|
+
}
|
|
395
425
|
}
|
|
396
|
-
|
|
426
|
+
|
|
427
|
+
.ev-input-number-handler-up {
|
|
397
428
|
cursor: pointer;
|
|
398
429
|
}
|
|
399
|
-
|
|
400
|
-
|
|
430
|
+
|
|
431
|
+
.ev-input-number-handler-down {
|
|
432
|
+
border-top: 1px solid #DDDEE1;
|
|
401
433
|
top: -1px;
|
|
402
434
|
cursor: pointer;
|
|
403
435
|
}
|
|
404
|
-
/*disable base class*/
|
|
405
|
-
.
|
|
406
|
-
background-color: #f3f3f3;
|
|
407
|
-
opacity: 1;
|
|
408
|
-
cursor: not-allowed;
|
|
409
|
-
color: #ccc;
|
|
410
|
-
}
|
|
411
|
-
/*use border color when mouse hover*/
|
|
412
|
-
.evui-input-number-disabled:hover {
|
|
413
|
-
border-color : #D77F7F;
|
|
414
|
-
}
|
|
415
|
-
/*inner input div class*/
|
|
416
|
-
.evui-input-number-disabled .evui-input-number {
|
|
417
|
-
opacity: .72;
|
|
436
|
+
/* disable base class */
|
|
437
|
+
.ev-input-number-disabled {
|
|
418
438
|
cursor: not-allowed;
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
439
|
+
|
|
440
|
+
@include evThemify() {
|
|
441
|
+
color: evThemed('number-input-disabled');
|
|
442
|
+
background-color: evThemed('number-input-disabled-background');
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.ev-input-number-handler-wrap {
|
|
446
|
+
display: none;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.ev-input-number-handler {
|
|
450
|
+
opacity: .72;
|
|
451
|
+
cursor: not-allowed;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.ev-input-number-input {
|
|
455
|
+
opacity: 1;
|
|
456
|
+
cursor: not-allowed;
|
|
457
|
+
|
|
458
|
+
@include evThemify() {
|
|
459
|
+
color: evThemed('textfield-input-disabled');
|
|
460
|
+
}
|
|
461
|
+
}
|
|
424
462
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
color:
|
|
428
|
-
cursor: not-allowed;
|
|
463
|
+
/* use border color when mouse hover */
|
|
464
|
+
.ev-input-number-disabled:hover {
|
|
465
|
+
border-color: $color-not-allow;
|
|
429
466
|
}
|
|
430
|
-
|
|
431
|
-
|
|
467
|
+
|
|
468
|
+
.ev-input-number-input[disabled] {
|
|
432
469
|
opacity: 1;
|
|
433
470
|
cursor: not-allowed;
|
|
434
|
-
color: #ccc;
|
|
435
|
-
}
|
|
436
|
-
/*TODO SET ICON CLASS*/
|
|
437
|
-
.fa-sort-up {
|
|
438
|
-
margin-top: 4px;
|
|
439
471
|
}
|
|
440
472
|
</style>
|