evui 3.4.206 → 3.4.208
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 +18 -33
- package/dist/404.html +44 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.js +22645 -0
- package/dist/index.umd.cjs +28 -0
- package/dist/style.css +1 -0
- package/package.json +46 -43
- package/dist/evui.common.js +0 -63678
- package/dist/evui.common.js.map +0 -1
- package/dist/evui.umd.js +0 -63688
- package/dist/evui.umd.js.map +0 -1
- package/dist/evui.umd.min.js +0 -2
- package/dist/evui.umd.min.js.map +0 -1
- package/dist/img/EVUI.b82ee81a.svg +0 -293
- package/src/assets/logo.png +0 -0
- package/src/common/emitter.js +0 -20
- package/src/common/utils.bignumber.js +0 -67
- package/src/common/utils.debounce.js +0 -223
- package/src/common/utils.js +0 -151
- package/src/common/utils.table.js +0 -78
- package/src/common/utils.throttle.js +0 -83
- package/src/common/utils.tree.js +0 -18
- package/src/components/button/Button.vue +0 -195
- package/src/components/button/index.js +0 -7
- package/src/components/buttonGroup/ButtonGroup.vue +0 -11
- package/src/components/buttonGroup/index.js +0 -7
- package/src/components/calendar/Calendar.vue +0 -725
- package/src/components/calendar/index.js +0 -7
- package/src/components/calendar/uses.js +0 -1410
- package/src/components/chart/Chart.vue +0 -363
- package/src/components/chart/ChartToolbar.vue +0 -52
- package/src/components/chart/chart.core.js +0 -1170
- package/src/components/chart/chartZoom.core.js +0 -540
- package/src/components/chart/element/element.bar.js +0 -672
- package/src/components/chart/element/element.bar.time.js +0 -166
- package/src/components/chart/element/element.heatmap.js +0 -743
- package/src/components/chart/element/element.line.js +0 -611
- package/src/components/chart/element/element.pie.js +0 -197
- package/src/components/chart/element/element.scatter.js +0 -320
- package/src/components/chart/element/element.tip.js +0 -717
- package/src/components/chart/helpers/helpers.canvas.js +0 -265
- package/src/components/chart/helpers/helpers.constant.js +0 -235
- package/src/components/chart/helpers/helpers.util.js +0 -400
- package/src/components/chart/index.js +0 -9
- package/src/components/chart/model/index.js +0 -50
- package/src/components/chart/model/model.series.js +0 -125
- package/src/components/chart/model/model.store.js +0 -1427
- package/src/components/chart/plugins/plugins.interaction.js +0 -1655
- package/src/components/chart/plugins/plugins.legend.gradient.js +0 -606
- package/src/components/chart/plugins/plugins.legend.js +0 -1543
- package/src/components/chart/plugins/plugins.pie.js +0 -254
- package/src/components/chart/plugins/plugins.scrollbar.js +0 -732
- package/src/components/chart/plugins/plugins.title.js +0 -61
- package/src/components/chart/plugins/plugins.tooltip.js +0 -1041
- package/src/components/chart/scale/scale.js +0 -951
- package/src/components/chart/scale/scale.linear.js +0 -268
- package/src/components/chart/scale/scale.logarithmic.js +0 -135
- package/src/components/chart/scale/scale.step.js +0 -430
- package/src/components/chart/scale/scale.time.category.js +0 -338
- package/src/components/chart/scale/scale.time.js +0 -49
- package/src/components/chart/style/chart.scss +0 -405
- package/src/components/chart/uses.js +0 -721
- package/src/components/chartBrush/ChartBrush.vue +0 -323
- package/src/components/chartBrush/chartBrush.core.js +0 -691
- package/src/components/chartBrush/index.js +0 -9
- package/src/components/chartBrush/uses.js +0 -23
- package/src/components/chartGroup/ChartGroup.vue +0 -144
- package/src/components/chartGroup/index.js +0 -9
- package/src/components/chartGroup/style/chartGroup.scss +0 -5
- package/src/components/chartGroup/uses.js +0 -53
- package/src/components/checkbox/Checkbox.vue +0 -229
- package/src/components/checkbox/index.js +0 -7
- package/src/components/checkboxGroup/CheckboxGroup.vue +0 -44
- package/src/components/checkboxGroup/index.js +0 -7
- package/src/components/contextMenu/ContextMenu.vue +0 -95
- package/src/components/contextMenu/MenuList.vue +0 -182
- package/src/components/contextMenu/index.js +0 -7
- package/src/components/contextMenu/uses.js +0 -223
- package/src/components/datePicker/DatePicker.vue +0 -504
- package/src/components/datePicker/index.js +0 -7
- package/src/components/datePicker/uses.js +0 -460
- package/src/components/grid/Grid.vue +0 -1535
- package/src/components/grid/GridColumnSetting.vue +0 -358
- package/src/components/grid/GridFilterSetting.vue +0 -323
- package/src/components/grid/GridPagination.vue +0 -75
- package/src/components/grid/GridSummary.vue +0 -314
- package/src/components/grid/GridToolbar.vue +0 -35
- package/src/components/grid/icon/icon-option-button.vue +0 -17
- package/src/components/grid/icon/icon-sort-button.vue +0 -67
- package/src/components/grid/index.js +0 -11
- package/src/components/grid/style/grid.scss +0 -417
- package/src/components/grid/uses.js +0 -1629
- package/src/components/icon/Icon.vue +0 -53
- package/src/components/icon/index.js +0 -8
- package/src/components/inputNumber/InputNumber.vue +0 -212
- package/src/components/inputNumber/index.js +0 -7
- package/src/components/inputNumber/uses.js +0 -217
- package/src/components/loading/Loading.vue +0 -125
- package/src/components/loading/index.js +0 -7
- package/src/components/menu/Menu.vue +0 -79
- package/src/components/menu/MenuItem.vue +0 -201
- package/src/components/menu/index.js +0 -7
- package/src/components/message/Message.vue +0 -229
- package/src/components/message/index.js +0 -34
- package/src/components/messageBox/MessageBox.vue +0 -358
- package/src/components/messageBox/index.js +0 -22
- package/src/components/notification/Notification.vue +0 -316
- package/src/components/notification/index.js +0 -49
- package/src/components/pagination/Pagination.vue +0 -317
- package/src/components/pagination/index.js +0 -7
- package/src/components/pagination/pageButton.vue +0 -31
- package/src/components/progress/Progress.vue +0 -139
- package/src/components/progress/index.js +0 -7
- package/src/components/radio/Radio.vue +0 -159
- package/src/components/radio/index.js +0 -7
- package/src/components/radioGroup/RadioGroup.vue +0 -41
- package/src/components/radioGroup/index.js +0 -7
- package/src/components/scheduler/Scheduler.vue +0 -149
- package/src/components/scheduler/index.js +0 -7
- package/src/components/scheduler/uses.js +0 -183
- package/src/components/select/Select.vue +0 -556
- package/src/components/select/index.js +0 -7
- package/src/components/select/uses.js +0 -379
- package/src/components/slider/Slider.vue +0 -505
- package/src/components/slider/index.js +0 -7
- package/src/components/slider/uses.js +0 -391
- package/src/components/tabPanel/TabPanel.vue +0 -74
- package/src/components/tabPanel/index.js +0 -7
- package/src/components/tabs/Tabs.vue +0 -517
- package/src/components/tabs/index.js +0 -7
- package/src/components/textField/TextField.vue +0 -399
- package/src/components/textField/index.js +0 -7
- package/src/components/timePicker/TimePicker.vue +0 -364
- package/src/components/timePicker/index.js +0 -7
- package/src/components/toggle/Toggle.vue +0 -115
- package/src/components/toggle/index.js +0 -7
- package/src/components/tree/Tree.vue +0 -338
- package/src/components/tree/TreeNode.vue +0 -293
- package/src/components/tree/index.js +0 -7
- package/src/components/treeGrid/TreeGrid.vue +0 -1074
- package/src/components/treeGrid/TreeGridNode.vue +0 -349
- package/src/components/treeGrid/TreeGridToolbar.vue +0 -35
- package/src/components/treeGrid/icon/icon-tree.png +0 -0
- package/src/components/treeGrid/index.js +0 -9
- package/src/components/treeGrid/style/treeGrid.scss +0 -277
- package/src/components/treeGrid/uses.js +0 -1178
- package/src/components/window/Window.vue +0 -329
- package/src/components/window/index.js +0 -7
- package/src/components/window/uses.js +0 -908
- package/src/directives/clickoutside.js +0 -90
- package/src/main.js +0 -120
- package/src/style/components/input.scss +0 -108
- package/src/style/functions.scss +0 -3
- package/src/style/index.scss +0 -6
- package/src/style/lib/fonts/EVUI.eot +0 -0
- package/src/style/lib/fonts/EVUI.svg +0 -293
- package/src/style/lib/fonts/EVUI.ttf +0 -0
- package/src/style/lib/fonts/EVUI.woff +0 -0
- package/src/style/lib/icon.css +0 -888
- package/src/style/mixins.scss +0 -94
- package/src/style/themes.scss +0 -69
- package/src/style/variables.scss +0 -22
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<i
|
|
3
|
-
:class="[
|
|
4
|
-
icon,
|
|
5
|
-
{ [`ev-icon-${size}`]: !!size },
|
|
6
|
-
]"
|
|
7
|
-
:style="{ color }"
|
|
8
|
-
@click="onClick"
|
|
9
|
-
@dblClick="onDblClick"
|
|
10
|
-
@contextmenu="onContextMenu"
|
|
11
|
-
/>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
export default {
|
|
16
|
-
name: 'EvIcon',
|
|
17
|
-
props: {
|
|
18
|
-
icon: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: '',
|
|
21
|
-
},
|
|
22
|
-
size: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: '',
|
|
25
|
-
},
|
|
26
|
-
color: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: '',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
emits: {
|
|
32
|
-
click: null,
|
|
33
|
-
'dbl-click': null,
|
|
34
|
-
'context-menu': null,
|
|
35
|
-
},
|
|
36
|
-
setup(props, { emit }) {
|
|
37
|
-
const onClick = (e) => {
|
|
38
|
-
emit('click', e);
|
|
39
|
-
};
|
|
40
|
-
const onDblClick = (e) => {
|
|
41
|
-
emit('dbl-click', e);
|
|
42
|
-
};
|
|
43
|
-
const onContextMenu = (e) => {
|
|
44
|
-
emit('context-menu', e);
|
|
45
|
-
};
|
|
46
|
-
return {
|
|
47
|
-
onClick,
|
|
48
|
-
onDblClick,
|
|
49
|
-
onContextMenu,
|
|
50
|
-
};
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
</script>
|
|
@@ -1,212 +0,0 @@
|
|
|
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,217 +0,0 @@
|
|
|
1
|
-
import { ref, watch, onBeforeMount, getCurrentInstance } from 'vue';
|
|
2
|
-
import { getPrecision } from '@/common/utils';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* step 사용 시, up-down 및 값 입력할 때 step에 해당하는 값 반환
|
|
6
|
-
* @param val - 현재값
|
|
7
|
-
* @param { min, max, step } - 현재 컴포넌트의 최소값, 최대값, step 값
|
|
8
|
-
* - inputNumber, slider 컴포넌트 공통 사용
|
|
9
|
-
* @return number - 입력된 val에 가까운 step 값 반환
|
|
10
|
-
* */
|
|
11
|
-
export function getValueCloseToStep(val, { min, max, step }) {
|
|
12
|
-
const quotient = Math.floor((val - min) / step); // 몫
|
|
13
|
-
const remainder = (val - min) % step; // 나머지
|
|
14
|
-
const maxQuotient = Math.floor((max - min) / step);
|
|
15
|
-
const maxPrecision = Math.max(getPrecision(step), getPrecision(min));
|
|
16
|
-
let preventStep = false;
|
|
17
|
-
/**
|
|
18
|
-
* 클릭 & 드래그 & 입력한 값이 step 범위의 절반 보다 클 경우 한 스텝 위의 값
|
|
19
|
-
* 작을 경우 한 스텝 아래의 값으로 설정
|
|
20
|
-
* maxPrecision: 소수 자리수 확인
|
|
21
|
-
*/
|
|
22
|
-
let result;
|
|
23
|
-
if (maxPrecision) {
|
|
24
|
-
// 소수점 값일 경우
|
|
25
|
-
let multipleValue = +parseFloat(step * quotient).toFixed(maxPrecision);
|
|
26
|
-
result = +(multipleValue + min).toFixed(maxPrecision);
|
|
27
|
-
preventStep = quotient === maxQuotient
|
|
28
|
-
&& +(max - result).toFixed(maxPrecision) !== step;
|
|
29
|
-
|
|
30
|
-
if (remainder > (step / 2) && !preventStep) {
|
|
31
|
-
result = +(result + step).toFixed(maxPrecision);
|
|
32
|
-
}
|
|
33
|
-
if (result > max) {
|
|
34
|
-
multipleValue = +parseFloat(step * maxQuotient).toFixed(maxPrecision);
|
|
35
|
-
result = +(multipleValue + min).toFixed(maxPrecision);
|
|
36
|
-
} else if (result < min) {
|
|
37
|
-
result = min;
|
|
38
|
-
}
|
|
39
|
-
} else {
|
|
40
|
-
// 소수점 아닐 경우
|
|
41
|
-
result = (step * quotient) + min;
|
|
42
|
-
preventStep = quotient === maxQuotient && (max - result) !== step;
|
|
43
|
-
if (remainder > (step / 2) && !preventStep) {
|
|
44
|
-
result += step;
|
|
45
|
-
}
|
|
46
|
-
if (result > max) {
|
|
47
|
-
result = (step * maxQuotient) + min;
|
|
48
|
-
} else if (result < min) {
|
|
49
|
-
result = min;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return result;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function useModel() {
|
|
57
|
-
const { props, emit } = getCurrentInstance();
|
|
58
|
-
const currentValue = ref(props.modelValue);
|
|
59
|
-
const previousValue = ref(props.modelValue);
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* 고정 소수점 사용 시, 해당하는 소수점 값 반환
|
|
63
|
-
* */
|
|
64
|
-
const getPrecisionValue = val => (
|
|
65
|
-
props.precision && (val || val === 0) ? Number(val).toFixed(props.precision) : val
|
|
66
|
-
);
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* input 값 validate
|
|
70
|
-
* @param val - input 현재 값
|
|
71
|
-
* */
|
|
72
|
-
const validateValue = (val) => {
|
|
73
|
-
let result = val;
|
|
74
|
-
|
|
75
|
-
if (!val && val !== 0) {
|
|
76
|
-
// 값이 없을 경우
|
|
77
|
-
result = props.stepStrictly ? previousValue.value : null;
|
|
78
|
-
} else if (isNaN(val)) {
|
|
79
|
-
// 숫자 아닐 경우 - 문자열 들어 왔을 경우
|
|
80
|
-
result = previousValue.value;
|
|
81
|
-
} else if (props.stepStrictly) {
|
|
82
|
-
// step 유지
|
|
83
|
-
if (props.min === -Infinity) {
|
|
84
|
-
props.min = 0;
|
|
85
|
-
}
|
|
86
|
-
result = getValueCloseToStep(val, {
|
|
87
|
-
min: props.min,
|
|
88
|
-
max: props.max,
|
|
89
|
-
step: props.step,
|
|
90
|
-
});
|
|
91
|
-
} else if ((props.min || props.min === 0)
|
|
92
|
-
&& result < props.min
|
|
93
|
-
) {
|
|
94
|
-
// 최소값보다 작을 경우
|
|
95
|
-
result = props.min;
|
|
96
|
-
} else if ((props.max || props.max === 0)
|
|
97
|
-
&& result > props.max
|
|
98
|
-
) {
|
|
99
|
-
// 최대값보다 클 경우
|
|
100
|
-
result = props.max;
|
|
101
|
-
} else {
|
|
102
|
-
result = +result;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
currentValue.value = getPrecisionValue(result);
|
|
106
|
-
previousValue.value = getPrecisionValue(result);
|
|
107
|
-
emit('update:modelValue', result);
|
|
108
|
-
emit('change', result);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
// input 이벤트 발생 시
|
|
112
|
-
const focusInput = (e) => {
|
|
113
|
-
emit('focus', e);
|
|
114
|
-
};
|
|
115
|
-
const blurInput = (e) => {
|
|
116
|
-
emit('blur', e);
|
|
117
|
-
};
|
|
118
|
-
const changeMv = (e) => {
|
|
119
|
-
validateValue(e.target.value);
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
watch(() => props.modelValue, (curr, prev) => {
|
|
123
|
-
if (curr !== prev) {
|
|
124
|
-
currentValue.value = getPrecisionValue(curr);
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
return {
|
|
129
|
-
currentValue,
|
|
130
|
-
validateValue,
|
|
131
|
-
focusInput,
|
|
132
|
-
blurInput,
|
|
133
|
-
changeMv,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
export function useStep(params) {
|
|
137
|
-
const { props } = getCurrentInstance();
|
|
138
|
-
const { currentValue, validateValue } = params;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* 화살표 및 키보드 방향키 통해 값 up-down할 경우
|
|
142
|
-
* @param type - 'up', 'down'
|
|
143
|
-
* */
|
|
144
|
-
const stepValue = (type) => {
|
|
145
|
-
if (props.readonly || props.disabled) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
let result;
|
|
150
|
-
if (!currentValue.value && currentValue.value !== 0) {
|
|
151
|
-
result = props.min === -Infinity ? 0 : props.min;
|
|
152
|
-
} else {
|
|
153
|
-
const newValue = +currentValue.value;
|
|
154
|
-
const convertedStep = type === 'up' ? props.step : props.step * -1;
|
|
155
|
-
const maxPrecision = Math.max(getPrecision(newValue), getPrecision(props.step));
|
|
156
|
-
const squaredValue = 10 ** maxPrecision;
|
|
157
|
-
result = (Math.round(newValue * squaredValue)
|
|
158
|
-
+ Math.round(convertedStep * squaredValue)) / squaredValue;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (result >= props.min && result <= props.max) {
|
|
162
|
-
validateValue(result);
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
return {
|
|
167
|
-
stepValue,
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
export function useInit(params) {
|
|
171
|
-
const { props } = getCurrentInstance();
|
|
172
|
-
const { currentValue, validateValue } = params;
|
|
173
|
-
const hasMaxProps = props.max || props.max === 0;
|
|
174
|
-
const hasMinProps = props.min || props.min === 0;
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* props validate
|
|
178
|
-
* */
|
|
179
|
-
const validateProps = () => {
|
|
180
|
-
if (hasMaxProps && hasMinProps) {
|
|
181
|
-
if (props.max <= props.min) {
|
|
182
|
-
console.warn('[EVUI][InputNumber] Max value must be greater than min value.');
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
if (props.step && (props.precision || props.precision === 0)) {
|
|
187
|
-
if (getPrecision(props.step) > props.precision) {
|
|
188
|
-
console.warn('[EVUI][InputNumber] It cannot be calculated because the step is smaller than the precision setting.');
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* 초기 modelValue 값 사용자 입력 시 validate
|
|
195
|
-
* */
|
|
196
|
-
const initValue = () => {
|
|
197
|
-
let modelValue = currentValue.value;
|
|
198
|
-
|
|
199
|
-
if (isNaN(currentValue.value)) {
|
|
200
|
-
modelValue = 0;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
if (modelValue || modelValue === 0) {
|
|
204
|
-
if (hasMaxProps && modelValue > props.max) {
|
|
205
|
-
modelValue = props.max;
|
|
206
|
-
} else if (hasMinProps && modelValue < props.min) {
|
|
207
|
-
modelValue = props.min;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
validateValue(modelValue);
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
onBeforeMount(() => {
|
|
214
|
-
validateProps();
|
|
215
|
-
initValue();
|
|
216
|
-
});
|
|
217
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<template v-if="fullscreen">
|
|
3
|
-
<teleport to="body">
|
|
4
|
-
<div
|
|
5
|
-
v-if="modelValue"
|
|
6
|
-
class="ev-loading full-screen"
|
|
7
|
-
@[`${clickEventName}`]="closeLoading"
|
|
8
|
-
>
|
|
9
|
-
<div class="ev-loading-spinner">
|
|
10
|
-
<template v-if="$slots.default">
|
|
11
|
-
<slot />
|
|
12
|
-
</template>
|
|
13
|
-
<template v-else>
|
|
14
|
-
<i
|
|
15
|
-
:class="iconClass || 'ev-icon-refresh2'"
|
|
16
|
-
class="ev-loading-icon"
|
|
17
|
-
:style="iconStyle"
|
|
18
|
-
/>
|
|
19
|
-
</template>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</teleport>
|
|
23
|
-
</template>
|
|
24
|
-
<template v-else>
|
|
25
|
-
<div
|
|
26
|
-
v-if="modelValue"
|
|
27
|
-
class="ev-loading"
|
|
28
|
-
@[`${clickEventName}`]="closeLoading"
|
|
29
|
-
>
|
|
30
|
-
<div class="ev-loading-spinner">
|
|
31
|
-
<template v-if="$slots.default">
|
|
32
|
-
<slot />
|
|
33
|
-
</template>
|
|
34
|
-
<template v-else>
|
|
35
|
-
<i
|
|
36
|
-
:class="iconClass || 'ev-icon-refresh2'"
|
|
37
|
-
class="ev-loading-icon"
|
|
38
|
-
:style="iconStyle"
|
|
39
|
-
/>
|
|
40
|
-
</template>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
</template>
|
|
44
|
-
</template>
|
|
45
|
-
|
|
46
|
-
<script>
|
|
47
|
-
import { computed } from 'vue';
|
|
48
|
-
|
|
49
|
-
export default {
|
|
50
|
-
name: 'EvLoading',
|
|
51
|
-
props: {
|
|
52
|
-
modelValue: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: false,
|
|
55
|
-
},
|
|
56
|
-
fullscreen: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false,
|
|
59
|
-
},
|
|
60
|
-
clickOutside: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: false,
|
|
63
|
-
},
|
|
64
|
-
iconClass: {
|
|
65
|
-
type: String,
|
|
66
|
-
default: null,
|
|
67
|
-
},
|
|
68
|
-
iconStyle: {
|
|
69
|
-
type: Object,
|
|
70
|
-
default: () => {},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
emits: {
|
|
74
|
-
'update:modelValue': [Boolean],
|
|
75
|
-
},
|
|
76
|
-
setup(props, { emit }) {
|
|
77
|
-
const clickEventName = computed(() => (props.clickOutside ? 'click' : null));
|
|
78
|
-
|
|
79
|
-
const closeLoading = () => emit('update:modelValue', false);
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
clickEventName,
|
|
83
|
-
closeLoading,
|
|
84
|
-
};
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
</script>
|
|
88
|
-
|
|
89
|
-
<style lang="scss">
|
|
90
|
-
@import '../../style/index.scss';
|
|
91
|
-
|
|
92
|
-
.ev-loading {
|
|
93
|
-
position: absolute;
|
|
94
|
-
top: 0;
|
|
95
|
-
left: 0;
|
|
96
|
-
width: 100%;
|
|
97
|
-
height: 100%;
|
|
98
|
-
background-color: #000000;
|
|
99
|
-
opacity: 0.5;
|
|
100
|
-
&.full-screen {
|
|
101
|
-
position: fixed;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
.ev-loading-spinner {
|
|
105
|
-
position: absolute;
|
|
106
|
-
top: 50%;
|
|
107
|
-
width: 100%;
|
|
108
|
-
color: #409EFF;
|
|
109
|
-
text-align: center;
|
|
110
|
-
}
|
|
111
|
-
.ev-loading-icon {
|
|
112
|
-
display: inline-block;
|
|
113
|
-
font-size: 25px;
|
|
114
|
-
animation: rotating 2s linear infinite;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
@keyframes rotating {
|
|
118
|
-
from {
|
|
119
|
-
transform: rotate(360deg);
|
|
120
|
-
}
|
|
121
|
-
to {
|
|
122
|
-
transform: rotate(0);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
</style>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ul class="ev-menu">
|
|
3
|
-
<menu-item
|
|
4
|
-
v-for="(menu, index) in items"
|
|
5
|
-
:key="`${menu.text}_${index}_0`"
|
|
6
|
-
:item="menu"
|
|
7
|
-
:selected-item="modelValue"
|
|
8
|
-
:expandable="expandable"
|
|
9
|
-
:disabled="disabled"
|
|
10
|
-
:comp="component"
|
|
11
|
-
@click="clickMenu"
|
|
12
|
-
>
|
|
13
|
-
<template
|
|
14
|
-
v-for="(_, slotName) in $slots"
|
|
15
|
-
:key="slotName"
|
|
16
|
-
#[slotName]="slotProps"
|
|
17
|
-
>
|
|
18
|
-
<slot
|
|
19
|
-
:name="slotName"
|
|
20
|
-
v-bind="slotProps"
|
|
21
|
-
/>
|
|
22
|
-
</template>
|
|
23
|
-
</menu-item>
|
|
24
|
-
</ul>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<script>
|
|
28
|
-
import { ref } from 'vue';
|
|
29
|
-
import MenuItem from './MenuItem';
|
|
30
|
-
|
|
31
|
-
export default {
|
|
32
|
-
name: 'EvMenu',
|
|
33
|
-
components: {
|
|
34
|
-
MenuItem,
|
|
35
|
-
},
|
|
36
|
-
props: {
|
|
37
|
-
modelValue: {
|
|
38
|
-
type: [String, Number],
|
|
39
|
-
default: '',
|
|
40
|
-
},
|
|
41
|
-
items: {
|
|
42
|
-
type: Array,
|
|
43
|
-
default: () => [],
|
|
44
|
-
},
|
|
45
|
-
expandable: {
|
|
46
|
-
type: Boolean,
|
|
47
|
-
default: true,
|
|
48
|
-
},
|
|
49
|
-
disabled: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: false,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
emits: ['update:modelValue', 'change'],
|
|
55
|
-
setup(props, { emit }) {
|
|
56
|
-
const prevMenuItem = ref(props.items.filter(item => props.modelValue === item.value));
|
|
57
|
-
const clickMenu = (params) => {
|
|
58
|
-
if (!params.disabled) {
|
|
59
|
-
const newMenuItem = params.item;
|
|
60
|
-
emit('update:modelValue', newMenuItem.value);
|
|
61
|
-
emit('change', newMenuItem, prevMenuItem.value);
|
|
62
|
-
prevMenuItem.value = newMenuItem;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
const component = MenuItem;
|
|
66
|
-
return {
|
|
67
|
-
clickMenu,
|
|
68
|
-
component,
|
|
69
|
-
};
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
</script>
|
|
73
|
-
<style lang="scss">
|
|
74
|
-
.ev-menu {
|
|
75
|
-
ul, ol, li {
|
|
76
|
-
list-style: none;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
</style>
|