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.
Files changed (162) hide show
  1. package/README.md +18 -33
  2. package/dist/404.html +44 -0
  3. package/dist/favicon.ico +0 -0
  4. package/dist/index.js +22645 -0
  5. package/dist/index.umd.cjs +28 -0
  6. package/dist/style.css +1 -0
  7. package/package.json +46 -43
  8. package/dist/evui.common.js +0 -63678
  9. package/dist/evui.common.js.map +0 -1
  10. package/dist/evui.umd.js +0 -63688
  11. package/dist/evui.umd.js.map +0 -1
  12. package/dist/evui.umd.min.js +0 -2
  13. package/dist/evui.umd.min.js.map +0 -1
  14. package/dist/img/EVUI.b82ee81a.svg +0 -293
  15. package/src/assets/logo.png +0 -0
  16. package/src/common/emitter.js +0 -20
  17. package/src/common/utils.bignumber.js +0 -67
  18. package/src/common/utils.debounce.js +0 -223
  19. package/src/common/utils.js +0 -151
  20. package/src/common/utils.table.js +0 -78
  21. package/src/common/utils.throttle.js +0 -83
  22. package/src/common/utils.tree.js +0 -18
  23. package/src/components/button/Button.vue +0 -195
  24. package/src/components/button/index.js +0 -7
  25. package/src/components/buttonGroup/ButtonGroup.vue +0 -11
  26. package/src/components/buttonGroup/index.js +0 -7
  27. package/src/components/calendar/Calendar.vue +0 -725
  28. package/src/components/calendar/index.js +0 -7
  29. package/src/components/calendar/uses.js +0 -1410
  30. package/src/components/chart/Chart.vue +0 -363
  31. package/src/components/chart/ChartToolbar.vue +0 -52
  32. package/src/components/chart/chart.core.js +0 -1170
  33. package/src/components/chart/chartZoom.core.js +0 -540
  34. package/src/components/chart/element/element.bar.js +0 -672
  35. package/src/components/chart/element/element.bar.time.js +0 -166
  36. package/src/components/chart/element/element.heatmap.js +0 -743
  37. package/src/components/chart/element/element.line.js +0 -611
  38. package/src/components/chart/element/element.pie.js +0 -197
  39. package/src/components/chart/element/element.scatter.js +0 -320
  40. package/src/components/chart/element/element.tip.js +0 -717
  41. package/src/components/chart/helpers/helpers.canvas.js +0 -265
  42. package/src/components/chart/helpers/helpers.constant.js +0 -235
  43. package/src/components/chart/helpers/helpers.util.js +0 -400
  44. package/src/components/chart/index.js +0 -9
  45. package/src/components/chart/model/index.js +0 -50
  46. package/src/components/chart/model/model.series.js +0 -125
  47. package/src/components/chart/model/model.store.js +0 -1427
  48. package/src/components/chart/plugins/plugins.interaction.js +0 -1655
  49. package/src/components/chart/plugins/plugins.legend.gradient.js +0 -606
  50. package/src/components/chart/plugins/plugins.legend.js +0 -1543
  51. package/src/components/chart/plugins/plugins.pie.js +0 -254
  52. package/src/components/chart/plugins/plugins.scrollbar.js +0 -732
  53. package/src/components/chart/plugins/plugins.title.js +0 -61
  54. package/src/components/chart/plugins/plugins.tooltip.js +0 -1041
  55. package/src/components/chart/scale/scale.js +0 -951
  56. package/src/components/chart/scale/scale.linear.js +0 -268
  57. package/src/components/chart/scale/scale.logarithmic.js +0 -135
  58. package/src/components/chart/scale/scale.step.js +0 -430
  59. package/src/components/chart/scale/scale.time.category.js +0 -338
  60. package/src/components/chart/scale/scale.time.js +0 -49
  61. package/src/components/chart/style/chart.scss +0 -405
  62. package/src/components/chart/uses.js +0 -721
  63. package/src/components/chartBrush/ChartBrush.vue +0 -323
  64. package/src/components/chartBrush/chartBrush.core.js +0 -691
  65. package/src/components/chartBrush/index.js +0 -9
  66. package/src/components/chartBrush/uses.js +0 -23
  67. package/src/components/chartGroup/ChartGroup.vue +0 -144
  68. package/src/components/chartGroup/index.js +0 -9
  69. package/src/components/chartGroup/style/chartGroup.scss +0 -5
  70. package/src/components/chartGroup/uses.js +0 -53
  71. package/src/components/checkbox/Checkbox.vue +0 -229
  72. package/src/components/checkbox/index.js +0 -7
  73. package/src/components/checkboxGroup/CheckboxGroup.vue +0 -44
  74. package/src/components/checkboxGroup/index.js +0 -7
  75. package/src/components/contextMenu/ContextMenu.vue +0 -95
  76. package/src/components/contextMenu/MenuList.vue +0 -182
  77. package/src/components/contextMenu/index.js +0 -7
  78. package/src/components/contextMenu/uses.js +0 -223
  79. package/src/components/datePicker/DatePicker.vue +0 -504
  80. package/src/components/datePicker/index.js +0 -7
  81. package/src/components/datePicker/uses.js +0 -460
  82. package/src/components/grid/Grid.vue +0 -1535
  83. package/src/components/grid/GridColumnSetting.vue +0 -358
  84. package/src/components/grid/GridFilterSetting.vue +0 -323
  85. package/src/components/grid/GridPagination.vue +0 -75
  86. package/src/components/grid/GridSummary.vue +0 -314
  87. package/src/components/grid/GridToolbar.vue +0 -35
  88. package/src/components/grid/icon/icon-option-button.vue +0 -17
  89. package/src/components/grid/icon/icon-sort-button.vue +0 -67
  90. package/src/components/grid/index.js +0 -11
  91. package/src/components/grid/style/grid.scss +0 -417
  92. package/src/components/grid/uses.js +0 -1629
  93. package/src/components/icon/Icon.vue +0 -53
  94. package/src/components/icon/index.js +0 -8
  95. package/src/components/inputNumber/InputNumber.vue +0 -212
  96. package/src/components/inputNumber/index.js +0 -7
  97. package/src/components/inputNumber/uses.js +0 -217
  98. package/src/components/loading/Loading.vue +0 -125
  99. package/src/components/loading/index.js +0 -7
  100. package/src/components/menu/Menu.vue +0 -79
  101. package/src/components/menu/MenuItem.vue +0 -201
  102. package/src/components/menu/index.js +0 -7
  103. package/src/components/message/Message.vue +0 -229
  104. package/src/components/message/index.js +0 -34
  105. package/src/components/messageBox/MessageBox.vue +0 -358
  106. package/src/components/messageBox/index.js +0 -22
  107. package/src/components/notification/Notification.vue +0 -316
  108. package/src/components/notification/index.js +0 -49
  109. package/src/components/pagination/Pagination.vue +0 -317
  110. package/src/components/pagination/index.js +0 -7
  111. package/src/components/pagination/pageButton.vue +0 -31
  112. package/src/components/progress/Progress.vue +0 -139
  113. package/src/components/progress/index.js +0 -7
  114. package/src/components/radio/Radio.vue +0 -159
  115. package/src/components/radio/index.js +0 -7
  116. package/src/components/radioGroup/RadioGroup.vue +0 -41
  117. package/src/components/radioGroup/index.js +0 -7
  118. package/src/components/scheduler/Scheduler.vue +0 -149
  119. package/src/components/scheduler/index.js +0 -7
  120. package/src/components/scheduler/uses.js +0 -183
  121. package/src/components/select/Select.vue +0 -556
  122. package/src/components/select/index.js +0 -7
  123. package/src/components/select/uses.js +0 -379
  124. package/src/components/slider/Slider.vue +0 -505
  125. package/src/components/slider/index.js +0 -7
  126. package/src/components/slider/uses.js +0 -391
  127. package/src/components/tabPanel/TabPanel.vue +0 -74
  128. package/src/components/tabPanel/index.js +0 -7
  129. package/src/components/tabs/Tabs.vue +0 -517
  130. package/src/components/tabs/index.js +0 -7
  131. package/src/components/textField/TextField.vue +0 -399
  132. package/src/components/textField/index.js +0 -7
  133. package/src/components/timePicker/TimePicker.vue +0 -364
  134. package/src/components/timePicker/index.js +0 -7
  135. package/src/components/toggle/Toggle.vue +0 -115
  136. package/src/components/toggle/index.js +0 -7
  137. package/src/components/tree/Tree.vue +0 -338
  138. package/src/components/tree/TreeNode.vue +0 -293
  139. package/src/components/tree/index.js +0 -7
  140. package/src/components/treeGrid/TreeGrid.vue +0 -1074
  141. package/src/components/treeGrid/TreeGridNode.vue +0 -349
  142. package/src/components/treeGrid/TreeGridToolbar.vue +0 -35
  143. package/src/components/treeGrid/icon/icon-tree.png +0 -0
  144. package/src/components/treeGrid/index.js +0 -9
  145. package/src/components/treeGrid/style/treeGrid.scss +0 -277
  146. package/src/components/treeGrid/uses.js +0 -1178
  147. package/src/components/window/Window.vue +0 -329
  148. package/src/components/window/index.js +0 -7
  149. package/src/components/window/uses.js +0 -908
  150. package/src/directives/clickoutside.js +0 -90
  151. package/src/main.js +0 -120
  152. package/src/style/components/input.scss +0 -108
  153. package/src/style/functions.scss +0 -3
  154. package/src/style/index.scss +0 -6
  155. package/src/style/lib/fonts/EVUI.eot +0 -0
  156. package/src/style/lib/fonts/EVUI.svg +0 -293
  157. package/src/style/lib/fonts/EVUI.ttf +0 -0
  158. package/src/style/lib/fonts/EVUI.woff +0 -0
  159. package/src/style/lib/icon.css +0 -888
  160. package/src/style/mixins.scss +0 -94
  161. package/src/style/themes.scss +0 -69
  162. 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,8 +0,0 @@
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 +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,7 +0,0 @@
1
- import EvInputNumber from './InputNumber';
2
-
3
- EvInputNumber.install = (app) => {
4
- app.component(EvInputNumber.name, EvInputNumber);
5
- };
6
-
7
- export default EvInputNumber;
@@ -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,7 +0,0 @@
1
- import EvLoading from './Loading';
2
-
3
- EvLoading.install = (app) => {
4
- app.component(EvLoading.name, EvLoading);
5
- };
6
-
7
- export default EvLoading;
@@ -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>