evui 2.0.8 → 2.0.10
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/README.md +27 -27
- package/{src/webfonts/fa-regular-400.svg → dist/82f60bd0b94a1ed68b1e6e309ce2e8c3.svg} +366 -366
- package/{src/webfonts/EVUI.svg → dist/91c6092c0a9164541a69045d746b9e78.svg} +183 -183
- package/dist/{448f2aaa315fa9dce7b2cf6ce31caed6.svg → 962a1bf31c081691065fe333d9fa8105.svg} +1518 -1518
- package/dist/{65363c4d55617bbeb57d8ce6dcd46099.svg → a1a749e89f578a49306ec2b055c073da.svg} +1008 -1008
- package/dist/evui.min.js +178 -59366
- package/dist/evui.min.js.gz +0 -0
- package/dist/evui.min.js.map +1 -1
- package/dist/main.css +5161 -0
- package/dist/main.css.gz +0 -0
- package/dist/main.css.map +1 -0
- package/package.json +125 -136
- package/dist/8634884f932627fc43782e6963b64ccd.svg +0 -183
- package/dist/b551b554a67e86a840bc80cbb8066c30.svg +0 -366
- package/src/code/checkbox.js +0 -12
- package/src/common/utils.js +0 -95
- package/src/common/utils.table.js +0 -78
- package/src/components/button/button.vue +0 -318
- package/src/components/button/index.js +0 -3
- package/src/components/chart/chart.vue +0 -354
- 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 -91
- 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/chart/index.js +0 -4
- package/src/components/checkbox/checkbox-group.vue +0 -57
- package/src/components/checkbox/checkbox.vue +0 -98
- package/src/components/checkbox/index.js +0 -3
- package/src/components/checkbox-group/index.js +0 -3
- package/src/components/codeview/code.vue +0 -242
- package/src/components/datepicker/calendar.core.js +0 -1829
- package/src/components/datepicker/calendar.vue +0 -86
- package/src/components/datepicker/datepicker.vue +0 -599
- package/src/components/datepicker/index.js +0 -3
- package/src/components/icon/icon.vue +0 -31
- package/src/components/icon/index.js +0 -3
- package/src/components/input/index.js +0 -3
- package/src/components/input/input.number.vue +0 -440
- package/src/components/label/index.js +0 -3
- package/src/components/label/label.vue +0 -86
- package/src/components/loadingmask/index.js +0 -3
- package/src/components/loadingmask/loadingmask.vue +0 -142
- package/src/components/menu/index.js +0 -5
- package/src/components/menu/menu.context.children.vue +0 -201
- package/src/components/menu/menu.context.vue +0 -144
- package/src/components/menu/menu.nav.vue +0 -123
- package/src/components/radio/index.js +0 -3
- package/src/components/radio/radio-group.vue +0 -48
- package/src/components/radio/radio.vue +0 -95
- package/src/components/radio-group/index.js +0 -3
- package/src/components/selectbox/dropdown.vue +0 -174
- package/src/components/selectbox/index.js +0 -3
- package/src/components/selectbox/listbox.vue +0 -106
- package/src/components/selectbox/option.vue +0 -11
- package/src/components/selectbox/selectbox.vue +0 -465
- package/src/components/slider/index.js +0 -3
- package/src/components/slider/slider-tooltip.vue +0 -119
- package/src/components/slider/slider.vue +0 -483
- package/src/components/summary/index.js +0 -3
- package/src/components/summary/summary.vue +0 -138
- package/src/components/table/data.json +0 -1000
- package/src/components/table/data2.json +0 -1000
- package/src/components/table/index.js +0 -3
- package/src/components/table/table.black.css +0 -547
- package/src/components/table/table.filter.lite.vue +0 -170
- package/src/components/table/table.filter.vue +0 -112
- package/src/components/table/table.grey.css +0 -539
- package/src/components/table/table.navy.css +0 -536
- package/src/components/table/table.vue +0 -1382
- package/src/components/tabs/index.js +0 -14
- package/src/components/tabs/jun/tab.vue +0 -123
- package/src/components/tabs/jun/tabs.vue +0 -484
- package/src/components/tabs/tab-panel.vue +0 -39
- package/src/components/tabs/tabs.vue +0 -446
- package/src/components/textfield/index.js +0 -3
- package/src/components/textfield/textfield.vue +0 -381
- package/src/components/timepicker/index.js +0 -3
- package/src/components/timepicker/spinner.vue +0 -205
- package/src/components/timepicker/timepicker.vue +0 -492
- package/src/components/toggle/index.js +0 -3
- package/src/components/toggle/toggle.vue +0 -355
- package/src/components/tree/index.js +0 -7
- package/src/components/tree/tree.table.black.css +0 -680
- package/src/components/tree/tree.table.grey.css +0 -675
- package/src/components/tree/tree.table.vue +0 -734
- package/src/components/tree/tree.util.js +0 -39
- package/src/components/window/index.js +0 -3
- package/src/components/window/window.vue +0 -606
- package/src/images/evui_icon.png +0 -0
- package/src/index.js +0 -78
- package/src/styles/all.css +0 -5
- package/src/styles/codemirror.css +0 -346
- package/src/styles/evui.css +0 -386
- package/src/styles/icon.css +0 -557
- package/src/webfonts/EVUI.eot +0 -0
- package/src/webfonts/EVUI.ttf +0 -0
- package/src/webfonts/EVUI.woff +0 -0
- package/src/webfonts/NanumGothic.ttf +0 -0
- package/src/webfonts/NanumGothicBold.ttf +0 -0
- package/src/webfonts/fa-brands-400.eot +0 -0
- package/src/webfonts/fa-brands-400.svg +0 -1008
- package/src/webfonts/fa-brands-400.ttf +0 -0
- package/src/webfonts/fa-brands-400.woff +0 -0
- package/src/webfonts/fa-brands-400.woff2 +0 -0
- package/src/webfonts/fa-regular-400.eot +0 -0
- package/src/webfonts/fa-regular-400.ttf +0 -0
- package/src/webfonts/fa-regular-400.woff +0 -0
- package/src/webfonts/fa-regular-400.woff2 +0 -0
- package/src/webfonts/fa-solid-900.eot +0 -0
- package/src/webfonts/fa-solid-900.svg +0 -1518
- package/src/webfonts/fa-solid-900.ttf +0 -0
- package/src/webfonts/fa-solid-900.woff +0 -0
- package/src/webfonts/fa-solid-900.woff2 +0 -0
|
@@ -1,381 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<div
|
|
4
|
-
:style="wrapStyle"
|
|
5
|
-
:class="wrapClasses"
|
|
6
|
-
>
|
|
7
|
-
<input
|
|
8
|
-
v-if="type === 'input'"
|
|
9
|
-
:value="currentValue"
|
|
10
|
-
:class="inputClasses"
|
|
11
|
-
:placeholder="placeholder"
|
|
12
|
-
:disabled="disabled"
|
|
13
|
-
:readonly="readonly"
|
|
14
|
-
:maxlength="maxLength"
|
|
15
|
-
spellcheck="false"
|
|
16
|
-
@keyup.enter="handleEnter"
|
|
17
|
-
@keyup="handleKeyUp"
|
|
18
|
-
@keydown="handleKeyDown"
|
|
19
|
-
@focus="handleFocus"
|
|
20
|
-
@blur="handleBlur"
|
|
21
|
-
@input="handleInput"
|
|
22
|
-
@change="handleChange"
|
|
23
|
-
>
|
|
24
|
-
<textarea
|
|
25
|
-
v-else
|
|
26
|
-
:style="wrapStyle"
|
|
27
|
-
:value="currentValue"
|
|
28
|
-
:class="inputClasses"
|
|
29
|
-
:placeholder="placeholder"
|
|
30
|
-
:disabled="disabled"
|
|
31
|
-
:readonly="readonly"
|
|
32
|
-
:maxlength="maxLength"
|
|
33
|
-
spellcheck="false"
|
|
34
|
-
@keyup.enter="handleEnter"
|
|
35
|
-
@keyup="handleKeyUp"
|
|
36
|
-
@keydown="handleKeyDown"
|
|
37
|
-
@focus="handleFocus"
|
|
38
|
-
@blur="handleBlur"
|
|
39
|
-
@input="handleInput"
|
|
40
|
-
@change="handleChange"
|
|
41
|
-
/>
|
|
42
|
-
</div>
|
|
43
|
-
<div :class="wrapTextClass">
|
|
44
|
-
<div
|
|
45
|
-
v-show="useRegExp && textError"
|
|
46
|
-
:class="errorTextClass"
|
|
47
|
-
>
|
|
48
|
-
<p>{{ errorMsgWrapper }}</p>
|
|
49
|
-
</div>
|
|
50
|
-
<div
|
|
51
|
-
v-show="useMaxLength"
|
|
52
|
-
:class="maxLengthClass"
|
|
53
|
-
>
|
|
54
|
-
<p>{{ currentLength }} / {{ totalLength }}</p>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
</template>
|
|
59
|
-
|
|
60
|
-
<script>
|
|
61
|
-
import { getQuantity, getSize } from '@/common/utils';
|
|
62
|
-
|
|
63
|
-
const prefixCls = 'ev-input-text';
|
|
64
|
-
|
|
65
|
-
export default {
|
|
66
|
-
name: 'TextField',
|
|
67
|
-
props: {
|
|
68
|
-
width: {
|
|
69
|
-
type: [String, Number],
|
|
70
|
-
default: '100%',
|
|
71
|
-
},
|
|
72
|
-
height: {
|
|
73
|
-
type: [String, Number],
|
|
74
|
-
default: '100%',
|
|
75
|
-
},
|
|
76
|
-
value: {
|
|
77
|
-
type: String,
|
|
78
|
-
default: '',
|
|
79
|
-
},
|
|
80
|
-
disabled: {
|
|
81
|
-
type: Boolean,
|
|
82
|
-
default: false,
|
|
83
|
-
},
|
|
84
|
-
readonly: {
|
|
85
|
-
type: Boolean,
|
|
86
|
-
default: false,
|
|
87
|
-
},
|
|
88
|
-
type: {
|
|
89
|
-
type: String,
|
|
90
|
-
default: 'input',
|
|
91
|
-
},
|
|
92
|
-
placeholder: {
|
|
93
|
-
type: String,
|
|
94
|
-
default: '',
|
|
95
|
-
},
|
|
96
|
-
maxLength: {
|
|
97
|
-
type: Number,
|
|
98
|
-
default: Infinity,
|
|
99
|
-
},
|
|
100
|
-
useRegExp: {
|
|
101
|
-
type: Boolean,
|
|
102
|
-
default: false,
|
|
103
|
-
},
|
|
104
|
-
useMaxLength: {
|
|
105
|
-
type: Boolean,
|
|
106
|
-
default: false,
|
|
107
|
-
},
|
|
108
|
-
regExp: {
|
|
109
|
-
type: RegExp,
|
|
110
|
-
default: null,
|
|
111
|
-
},
|
|
112
|
-
errorMsg: {
|
|
113
|
-
type: String,
|
|
114
|
-
default: 'Wrong Message',
|
|
115
|
-
},
|
|
116
|
-
borderColor: {
|
|
117
|
-
type: String,
|
|
118
|
-
default: '#dddee1',
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
data() {
|
|
122
|
-
return {
|
|
123
|
-
currentValue: this.value,
|
|
124
|
-
currentLength: this.value.length,
|
|
125
|
-
totalLength: this.maxLength,
|
|
126
|
-
focus: false,
|
|
127
|
-
cssError: false,
|
|
128
|
-
maxError: false,
|
|
129
|
-
textError: false,
|
|
130
|
-
errorMsgWrapper: this.errorMsg,
|
|
131
|
-
};
|
|
132
|
-
},
|
|
133
|
-
computed: {
|
|
134
|
-
wrapClasses() {
|
|
135
|
-
return [
|
|
136
|
-
`${prefixCls}`,
|
|
137
|
-
{ [`${prefixCls}-disabled`]: this.disabled },
|
|
138
|
-
{ focus: this.focus },
|
|
139
|
-
{ error: this.cssError },
|
|
140
|
-
];
|
|
141
|
-
},
|
|
142
|
-
wrapStyle() {
|
|
143
|
-
return {
|
|
144
|
-
width: getSize(getQuantity(this.width)),
|
|
145
|
-
height: getSize(getQuantity(this.height)),
|
|
146
|
-
background: '#fff',
|
|
147
|
-
};
|
|
148
|
-
},
|
|
149
|
-
wrapTextClass() {
|
|
150
|
-
return `${prefixCls}-valid-check`;
|
|
151
|
-
},
|
|
152
|
-
errorTextClass() {
|
|
153
|
-
return `${prefixCls}-valid-error`;
|
|
154
|
-
},
|
|
155
|
-
maxLengthClass() {
|
|
156
|
-
return [
|
|
157
|
-
`${prefixCls}-valid-max-length`,
|
|
158
|
-
{ error: this.maxError },
|
|
159
|
-
];
|
|
160
|
-
},
|
|
161
|
-
inputClasses() {
|
|
162
|
-
return `${prefixCls}-${this.type}`;
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
watch: {
|
|
166
|
-
value(val) {
|
|
167
|
-
this.setCurrentValue(val);
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
created() {
|
|
171
|
-
this.validateError(this.currentValue);
|
|
172
|
-
},
|
|
173
|
-
methods: {
|
|
174
|
-
handleEnter(e) {
|
|
175
|
-
this.$emit('on-enter', e);
|
|
176
|
-
},
|
|
177
|
-
handleKeyDown(e) {
|
|
178
|
-
this.$emit('on-keydown', e);
|
|
179
|
-
},
|
|
180
|
-
handleKeyUp(e) {
|
|
181
|
-
this.$emit('on-keyup', e);
|
|
182
|
-
},
|
|
183
|
-
handleFocus(e) {
|
|
184
|
-
this.focus = true;
|
|
185
|
-
this.$emit('on-focus', e);
|
|
186
|
-
},
|
|
187
|
-
handleBlur(e) {
|
|
188
|
-
this.focus = false;
|
|
189
|
-
this.$emit('on-blur', e);
|
|
190
|
-
},
|
|
191
|
-
handleInput(e) {
|
|
192
|
-
const value = e.target.value;
|
|
193
|
-
|
|
194
|
-
this.$emit('input', value);
|
|
195
|
-
this.setCurrentValue(value);
|
|
196
|
-
this.$emit('on-input-change', e);
|
|
197
|
-
},
|
|
198
|
-
handleChange(e) {
|
|
199
|
-
this.$emit('on-change', e);
|
|
200
|
-
},
|
|
201
|
-
setCurrentValue(value) {
|
|
202
|
-
if (value === this.currentValue) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
this.validateError(value);
|
|
207
|
-
},
|
|
208
|
-
validateError(value) {
|
|
209
|
-
this.textError = false;
|
|
210
|
-
this.cssError = false;
|
|
211
|
-
this.maxError = false;
|
|
212
|
-
|
|
213
|
-
if (this.useRegExp) {
|
|
214
|
-
this.validateRegExp(value);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
if (this.useMaxLength) {
|
|
218
|
-
this.validateTextLength(value);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
this.currentValue = value;
|
|
222
|
-
this.currentLength = value.length;
|
|
223
|
-
},
|
|
224
|
-
validateTextLength(value) {
|
|
225
|
-
if (value.length >= this.maxLength) {
|
|
226
|
-
this.maxError = true;
|
|
227
|
-
this.cssError = true;
|
|
228
|
-
return true;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
return false;
|
|
232
|
-
},
|
|
233
|
-
validateRegExp(value) {
|
|
234
|
-
const validValue = value;
|
|
235
|
-
if (this.regExp === null) {
|
|
236
|
-
return false;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
const checked = this.regExp.exec(validValue);
|
|
240
|
-
if (checked === null) {
|
|
241
|
-
this.textError = false;
|
|
242
|
-
this.cssError = false;
|
|
243
|
-
return false;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
const filteredValue = checked[0];
|
|
247
|
-
if (filteredValue.length !== 0) {
|
|
248
|
-
this.textError = true;
|
|
249
|
-
this.cssError = true;
|
|
250
|
-
return true;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
this.textError = false;
|
|
254
|
-
this.cssError = false;
|
|
255
|
-
return false;
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
};
|
|
259
|
-
</script>
|
|
260
|
-
<style>
|
|
261
|
-
.ev-input-text {
|
|
262
|
-
display: inline-block;
|
|
263
|
-
position: relative;
|
|
264
|
-
overflow: hidden;
|
|
265
|
-
vertical-align: middle;
|
|
266
|
-
margin: 0;
|
|
267
|
-
padding: 0;
|
|
268
|
-
width: 100%;
|
|
269
|
-
height: 100%;
|
|
270
|
-
border-radius: 4px;
|
|
271
|
-
border: 2px solid #dddee1;
|
|
272
|
-
color: #495060;
|
|
273
|
-
font-size: 12px;
|
|
274
|
-
line-height: 2;
|
|
275
|
-
cursor: text;
|
|
276
|
-
background-image: none;
|
|
277
|
-
transition: border 0.2s ease-in-out, background 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
.ev-input-text:hover {
|
|
281
|
-
border-color : #adaeb1;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.ev-input-text.focus, .ev-input-text.focus:hover {
|
|
285
|
-
border-color : #2d8cf0;
|
|
286
|
-
opacity: 1;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
.ev-input-text-input {
|
|
290
|
-
width: 100%;
|
|
291
|
-
padding: 0 7px;
|
|
292
|
-
text-align: left;
|
|
293
|
-
outline: 0;
|
|
294
|
-
-moz-appearance: textfield;
|
|
295
|
-
color: #666;
|
|
296
|
-
border: 0;
|
|
297
|
-
border-radius: 4px;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.ev-input-text-input[disabled] {
|
|
301
|
-
background-color: #f3f3f3;
|
|
302
|
-
opacity: 1;
|
|
303
|
-
cursor: not-allowed;
|
|
304
|
-
color: #495060;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.ev-input-text-disabled .ev-input-text-input {
|
|
308
|
-
background-color: #f3f3f3;
|
|
309
|
-
cursor: not-allowed;
|
|
310
|
-
color: #5f5d5d;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.ev-input-text-disabled .ev-input-text-input.evui-input-text-textarea {
|
|
314
|
-
background-color: #f3f3f3;
|
|
315
|
-
opacity: 1;
|
|
316
|
-
cursor: not-allowed;
|
|
317
|
-
color: #5f5d5d;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.ev-input-text-disabled:hover, .ev-input-text:hover.error,
|
|
321
|
-
.ev-input-text.focus.error, .ev-input-text.error {
|
|
322
|
-
border-color : #d77f7f;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
.ev-input-text-disabled .ev-input-text {
|
|
326
|
-
opacity: .72;
|
|
327
|
-
cursor: not-allowed;
|
|
328
|
-
background-color: #f3f3f3;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.ev-input-text.ev-input-text-disabled {
|
|
332
|
-
background-color: #f3f3f3;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
.ev-input-text-disabled {
|
|
336
|
-
opacity: .72;
|
|
337
|
-
color: #5f5d5d !important;
|
|
338
|
-
cursor: not-allowed;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
.ev-input-text-textarea {
|
|
342
|
-
display: block;
|
|
343
|
-
text-align: left;
|
|
344
|
-
line-height: 1.5;
|
|
345
|
-
padding: 4px 7px;
|
|
346
|
-
outline: 0;
|
|
347
|
-
color: #666;
|
|
348
|
-
border: 0;
|
|
349
|
-
overflow: hidden;
|
|
350
|
-
border-radius: 4px;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.ev-input-text-textarea[disabled] {
|
|
354
|
-
background-color: #f3f3f3;
|
|
355
|
-
opacity: 1;
|
|
356
|
-
cursor: not-allowed;
|
|
357
|
-
color: #5f5d5d;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.ev-input-text-valid-check {
|
|
361
|
-
font-size: 12px;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
.ev-input-text-valid-error {
|
|
365
|
-
padding-left: 3px;
|
|
366
|
-
padding-right: 5px;
|
|
367
|
-
color: #ed1313;
|
|
368
|
-
float:left
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
.ev-input-text-valid-max-length {
|
|
372
|
-
padding-left: 5px;
|
|
373
|
-
padding-right: 3px;
|
|
374
|
-
float:right
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
.ev-input-text-valid-max-length.error {
|
|
378
|
-
color: #ed1313;
|
|
379
|
-
}
|
|
380
|
-
</style>
|
|
381
|
-
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
:class="mid ? 'evui-timepicker-spinner-between' : 'evui-timepicker-spinner-first-last'"
|
|
4
|
-
>
|
|
5
|
-
<div
|
|
6
|
-
ref="spinnerContent"
|
|
7
|
-
class="evui-timepicker-spinner-content"
|
|
8
|
-
>
|
|
9
|
-
<ul
|
|
10
|
-
:from="from"
|
|
11
|
-
:to="to"
|
|
12
|
-
class="evui-timepicker-spinner-list"
|
|
13
|
-
@mouseover="mouseOver"
|
|
14
|
-
@mouseleave="mouseLeave"
|
|
15
|
-
>
|
|
16
|
-
<li
|
|
17
|
-
v-for="(item, index) in liNumberArr"
|
|
18
|
-
ref="spinnerLi"
|
|
19
|
-
:key="item"
|
|
20
|
-
:class="index === 0 ? 'active' : ''"
|
|
21
|
-
class="evui-timepicker-spinner-item"
|
|
22
|
-
@click.stop.prevent="liClick(true, item)"
|
|
23
|
-
>
|
|
24
|
-
{{ item }}
|
|
25
|
-
</li>
|
|
26
|
-
</ul>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<script>
|
|
32
|
-
export default {
|
|
33
|
-
props: {
|
|
34
|
-
from: {
|
|
35
|
-
type: Number,
|
|
36
|
-
default: 0,
|
|
37
|
-
},
|
|
38
|
-
to: {
|
|
39
|
-
type: Number,
|
|
40
|
-
default: 1,
|
|
41
|
-
},
|
|
42
|
-
selectedNumber: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: '',
|
|
45
|
-
},
|
|
46
|
-
mid: {
|
|
47
|
-
type: Boolean,
|
|
48
|
-
default: false,
|
|
49
|
-
},
|
|
50
|
-
selectionStartIndex: {
|
|
51
|
-
type: Number,
|
|
52
|
-
default: 0,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
data() {
|
|
56
|
-
return {
|
|
57
|
-
liNumberArr: [],
|
|
58
|
-
};
|
|
59
|
-
},
|
|
60
|
-
watch: {
|
|
61
|
-
selectedNumber(liNumber) {
|
|
62
|
-
this.liClick(false, liNumber);
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
created() {
|
|
66
|
-
this.makeNumber();
|
|
67
|
-
},
|
|
68
|
-
mounted() {
|
|
69
|
-
this.liClick(true);
|
|
70
|
-
},
|
|
71
|
-
methods: {
|
|
72
|
-
makeNumber() {
|
|
73
|
-
for (let ix = this.from, ixLen = this.to; ix <= ixLen; ix++) {
|
|
74
|
-
this.liNumberArr.push(this.lpad10(ix));
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
lpad10(v) {
|
|
78
|
-
let value = v;
|
|
79
|
-
if (value < 10) {
|
|
80
|
-
if (value.length) {
|
|
81
|
-
value = `0${Number(value)}`;
|
|
82
|
-
} else {
|
|
83
|
-
value = `0${value}`;
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
value = `${value}`;
|
|
87
|
-
}
|
|
88
|
-
return value;
|
|
89
|
-
},
|
|
90
|
-
mouseOver() {
|
|
91
|
-
this.$emit('setRange', this.selectionStartIndex);
|
|
92
|
-
},
|
|
93
|
-
mouseLeave() {
|
|
94
|
-
this.$emit('setFocus', this.selectionStartIndex);
|
|
95
|
-
},
|
|
96
|
-
liClick(isClick, liNumber) {
|
|
97
|
-
const clickedNumber = liNumber || this.selectedNumber;
|
|
98
|
-
const clickFlag = isClick;
|
|
99
|
-
if (typeof clickedNumber === 'string' && clickedNumber.length === 2) {
|
|
100
|
-
const idx = this.findIndexToValue(clickedNumber);
|
|
101
|
-
if (idx !== null) {
|
|
102
|
-
// move scroll
|
|
103
|
-
this.$refs.spinnerContent.scrollTop
|
|
104
|
-
= this.$refs.spinnerLi[idx].offsetTop - 76;
|
|
105
|
-
this.initAllClass();
|
|
106
|
-
this.activeClass(clickedNumber);
|
|
107
|
-
if (clickFlag) {
|
|
108
|
-
// change number to clicked li number
|
|
109
|
-
this.$emit('setInput', this.selectionStartIndex, clickedNumber);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
findIndexToValue(clickedNumber) {
|
|
115
|
-
let findIndex = null;
|
|
116
|
-
for (let ix = 0, ixLen = this.liNumberArr.length; ix < ixLen; ix++) {
|
|
117
|
-
if (this.liNumberArr[ix] === clickedNumber) {
|
|
118
|
-
findIndex = ix;
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return findIndex;
|
|
123
|
-
},
|
|
124
|
-
initAllClass() {
|
|
125
|
-
for (let ix = 0, ixLen = this.liNumberArr.length; ix < ixLen; ix++) {
|
|
126
|
-
this.$refs.spinnerLi[ix].className = 'evui-timepicker-spinner-item';
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
activeClass(clickedNumber) {
|
|
130
|
-
for (let ix = 0, ixLen = this.liNumberArr.length; ix < ixLen; ix++) {
|
|
131
|
-
if (this.$refs.spinnerLi[ix].innerText === clickedNumber) {
|
|
132
|
-
this.$refs.spinnerLi[ix].classList.add('active');
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
</script>
|
|
139
|
-
|
|
140
|
-
<style scoped>
|
|
141
|
-
.evui-timepicker-spinner-between {
|
|
142
|
-
display: inline-block;
|
|
143
|
-
width: 33.2%;
|
|
144
|
-
max-height: 185px;
|
|
145
|
-
}
|
|
146
|
-
.evui-timepicker-spinner-first-last {
|
|
147
|
-
display: inline-block;
|
|
148
|
-
width: 33.3%;
|
|
149
|
-
max-height: 185px;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.evui-timepicker-spinner-content{
|
|
153
|
-
overflow: scroll;
|
|
154
|
-
height: 100%;
|
|
155
|
-
max-height: inherit;
|
|
156
|
-
font-size: 0px; /*width 33.3% inline-block 시 필요*/
|
|
157
|
-
}
|
|
158
|
-
.evui-timepicker-spinner-content::-webkit-scrollbar
|
|
159
|
-
{
|
|
160
|
-
width: 5px;
|
|
161
|
-
height: 0px;
|
|
162
|
-
background-color: rgba(0,0,0,0);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.evui-timepicker-spinner-content:hover
|
|
166
|
-
{
|
|
167
|
-
overflow: scroll;
|
|
168
|
-
}
|
|
169
|
-
.evui-timepicker-spinner-content:hover::-webkit-scrollbar
|
|
170
|
-
{
|
|
171
|
-
width: 5px;
|
|
172
|
-
height: 0px;
|
|
173
|
-
background-color: #ffffff;
|
|
174
|
-
}
|
|
175
|
-
.evui-timepicker-spinner-content:hover::-webkit-scrollbar-thumb
|
|
176
|
-
{
|
|
177
|
-
border-radius: 4px;
|
|
178
|
-
background-color: rgba(0,0,0,.1);
|
|
179
|
-
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,.1);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.evui-timepicker-spinner-list {
|
|
183
|
-
list-style: none;
|
|
184
|
-
margin: 0;
|
|
185
|
-
padding: 76px 0 78px 0;
|
|
186
|
-
text-align: center;
|
|
187
|
-
cursor: pointer;
|
|
188
|
-
}
|
|
189
|
-
.evui-timepicker-spinner-list .evui-timepicker-spinner-item {
|
|
190
|
-
display: list-item;
|
|
191
|
-
height: 32px;
|
|
192
|
-
line-height: 32px;
|
|
193
|
-
font-size: 12px;
|
|
194
|
-
user-select: none; /* prevent text drag */
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.evui-timepicker-spinner-list .evui-timepicker-spinner-item:hover {
|
|
198
|
-
background-color: #f5f7fa;
|
|
199
|
-
}
|
|
200
|
-
.evui-timepicker-spinner-list .evui-timepicker-spinner-item.active,
|
|
201
|
-
.evui-timepicker-spinner-list .evui-timepicker-spinner-item.active:hover {
|
|
202
|
-
background-color: #41B883;
|
|
203
|
-
color: #ffffff;
|
|
204
|
-
}
|
|
205
|
-
</style>
|