evui 3.3.36 → 3.3.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +40 -40
- package/dist/evui.common.js +1907 -1832
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +1907 -1832
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/dist/img/{EVUI.7f3588fb.svg → EVUI.b82ee81a.svg} +292 -292
- package/dist/img/{icon_mysql.7ea26d5d.svg → icon_mysql.1085fdc9.svg} +78 -78
- package/dist/img/{icon_oracle.9009b108.svg → icon_oracle.0572d3ee.svg} +13 -13
- package/dist/img/{icon_postgresql.f8fffba9.svg → icon_postgresql.ee12bde8.svg} +58 -58
- package/package.json +61 -61
- package/src/common/emitter.js +20 -20
- package/src/common/utils.debounce.js +223 -223
- package/src/common/utils.js +134 -134
- package/src/common/utils.table.js +78 -78
- package/src/common/utils.throttle.js +83 -83
- package/src/common/utils.tree.js +18 -18
- package/src/components/button/Button.vue +198 -198
- package/src/components/button/index.js +7 -7
- package/src/components/buttonGroup/ButtonGroup.vue +11 -11
- package/src/components/buttonGroup/index.js +7 -7
- package/src/components/calendar/Calendar.vue +661 -661
- package/src/components/calendar/index.js +7 -7
- package/src/components/calendar/uses.js +1272 -1272
- package/src/components/chart/Chart.vue +189 -192
- package/src/components/chart/chart.core.js +870 -870
- package/src/components/chart/element/element.bar.js +524 -524
- package/src/components/chart/element/element.bar.time.js +156 -156
- package/src/components/chart/element/element.heatmap.js +533 -533
- package/src/components/chart/element/element.line.js +339 -339
- package/src/components/chart/element/element.pie.js +197 -197
- package/src/components/chart/element/element.scatter.js +184 -184
- package/src/components/chart/element/element.tip.js +550 -542
- package/src/components/chart/helpers/helpers.canvas.js +265 -265
- package/src/components/chart/helpers/helpers.constant.js +206 -206
- package/src/components/chart/helpers/helpers.util.js +346 -338
- package/src/components/chart/index.js +9 -9
- package/src/components/chart/model/index.js +4 -4
- package/src/components/chart/model/model.series.js +93 -93
- package/src/components/chart/model/model.store.js +977 -967
- package/src/components/chart/plugins/plugins.interaction.js +769 -769
- package/src/components/chart/plugins/plugins.legend.gradient.js +602 -602
- package/src/components/chart/plugins/plugins.legend.js +1155 -1151
- package/src/components/chart/plugins/plugins.pie.js +254 -254
- package/src/components/chart/plugins/plugins.title.js +56 -56
- package/src/components/chart/plugins/plugins.tooltip.js +692 -692
- package/src/components/chart/scale/scale.js +848 -848
- package/src/components/chart/scale/scale.linear.js +38 -38
- package/src/components/chart/scale/scale.logarithmic.js +128 -128
- package/src/components/chart/scale/scale.step.js +336 -336
- package/src/components/chart/scale/scale.time.category.js +277 -277
- package/src/components/chart/scale/scale.time.js +48 -48
- package/src/components/chart/style/chart.scss +312 -312
- package/src/components/chart/uses.js +264 -252
- package/src/components/checkbox/Checkbox.vue +200 -200
- package/src/components/checkbox/index.js +7 -7
- package/src/components/checkboxGroup/CheckboxGroup.vue +44 -44
- package/src/components/checkboxGroup/index.js +7 -7
- package/src/components/contextMenu/ContextMenu.vue +80 -80
- package/src/components/contextMenu/MenuList.vue +149 -149
- package/src/components/contextMenu/index.js +7 -7
- package/src/components/contextMenu/uses.js +203 -203
- package/src/components/datePicker/DatePicker.vue +437 -437
- package/src/components/datePicker/index.js +7 -7
- package/src/components/datePicker/uses.js +419 -419
- package/src/components/grid/Grid.vue +827 -827
- package/src/components/grid/grid.filter.window.vue +493 -493
- package/src/components/grid/grid.pagination.vue +75 -75
- package/src/components/grid/grid.summary.vue +265 -265
- package/src/components/grid/grid.toolbar.vue +26 -26
- package/src/components/grid/index.js +11 -11
- package/src/components/grid/style/grid.scss +263 -263
- package/src/components/grid/uses.js +1002 -1007
- package/src/components/icon/Icon.vue +49 -49
- package/src/components/icon/index.js +8 -8
- package/src/components/inputNumber/InputNumber.vue +212 -212
- package/src/components/inputNumber/index.js +7 -7
- package/src/components/inputNumber/uses.js +217 -217
- package/src/components/loading/Loading.vue +125 -125
- package/src/components/loading/index.js +7 -7
- package/src/components/menu/Menu.vue +68 -68
- package/src/components/menu/MenuItem.vue +187 -187
- package/src/components/menu/index.js +7 -7
- package/src/components/message/Message.vue +223 -223
- package/src/components/message/index.js +31 -31
- package/src/components/messageBox/MessageBox.vue +358 -358
- package/src/components/messageBox/index.js +22 -22
- package/src/components/notification/Notification.vue +316 -316
- package/src/components/notification/index.js +49 -49
- package/src/components/pagination/Pagination.vue +271 -271
- package/src/components/pagination/index.js +7 -7
- package/src/components/pagination/pageButton.vue +30 -30
- package/src/components/progress/Progress.vue +139 -139
- package/src/components/progress/index.js +7 -7
- package/src/components/radio/Radio.vue +159 -159
- package/src/components/radio/index.js +7 -7
- package/src/components/radioGroup/RadioGroup.vue +41 -41
- package/src/components/radioGroup/index.js +7 -7
- package/src/components/scheduler/Scheduler.vue +149 -149
- package/src/components/scheduler/index.js +7 -7
- package/src/components/scheduler/uses.js +183 -183
- package/src/components/select/Select.vue +440 -440
- package/src/components/select/index.js +7 -7
- package/src/components/select/uses.js +270 -270
- package/src/components/slider/Slider.vue +505 -505
- package/src/components/slider/index.js +7 -7
- package/src/components/slider/uses.js +390 -390
- package/src/components/tabPanel/TabPanel.vue +74 -74
- package/src/components/tabPanel/index.js +7 -7
- package/src/components/tabs/Tabs.vue +517 -517
- package/src/components/tabs/index.js +7 -7
- package/src/components/textField/TextField.vue +375 -375
- package/src/components/textField/index.js +7 -7
- package/src/components/timePicker/TimePicker.vue +352 -352
- package/src/components/timePicker/index.js +7 -7
- package/src/components/toggle/Toggle.vue +115 -115
- package/src/components/toggle/index.js +7 -7
- package/src/components/tree/Tree.vue +313 -313
- package/src/components/tree/TreeNode.vue +293 -293
- package/src/components/tree/index.js +7 -7
- package/src/components/treeGrid/TreeGrid.vue +758 -758
- package/src/components/treeGrid/TreeGridNode.vue +275 -275
- package/src/components/treeGrid/index.js +9 -9
- package/src/components/treeGrid/style/treeGrid.scss +261 -261
- package/src/components/treeGrid/treeGrid.toolbar.vue +26 -26
- package/src/components/treeGrid/uses.js +867 -867
- package/src/components/window/Window.vue +329 -329
- package/src/components/window/index.js +7 -7
- package/src/components/window/uses.js +899 -899
- package/src/directives/clickoutside.js +90 -90
- package/src/main.js +116 -116
- package/src/style/components/input.scss +108 -108
- package/src/style/functions.scss +3 -3
- package/src/style/index.scss +6 -6
- package/src/style/lib/fonts/EVUI.svg +292 -292
- package/src/style/lib/icon.css +888 -888
- package/src/style/mixins.scss +94 -94
- package/src/style/themes.scss +67 -67
- package/src/style/variables.scss +22 -22
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<span
|
|
3
|
-
:class="{
|
|
4
|
-
'is-current': page.isCurrent,
|
|
5
|
-
'is-disabled': disabled || page.disabled,
|
|
6
|
-
[page.class]: true
|
|
7
|
-
}"
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
:aria-current="page.isCurrent"
|
|
10
|
-
>
|
|
11
|
-
<slot>{{ page.number }}</slot>
|
|
12
|
-
</span>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
|
|
17
|
-
export default {
|
|
18
|
-
name: 'PageButton',
|
|
19
|
-
props: {
|
|
20
|
-
page: {
|
|
21
|
-
type: Object,
|
|
22
|
-
required: true,
|
|
23
|
-
},
|
|
24
|
-
disabled: {
|
|
25
|
-
type: Boolean,
|
|
26
|
-
default: false,
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<span
|
|
3
|
+
:class="{
|
|
4
|
+
'is-current': page.isCurrent,
|
|
5
|
+
'is-disabled': disabled || page.disabled,
|
|
6
|
+
[page.class]: true
|
|
7
|
+
}"
|
|
8
|
+
v-bind="$attrs"
|
|
9
|
+
:aria-current="page.isCurrent"
|
|
10
|
+
>
|
|
11
|
+
<slot>{{ page.number }}</slot>
|
|
12
|
+
</span>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
name: 'PageButton',
|
|
19
|
+
props: {
|
|
20
|
+
page: {
|
|
21
|
+
type: Object,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
disabled: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
</script>
|
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ev-progress">
|
|
3
|
-
<div
|
|
4
|
-
class="ev-progress-wrapper"
|
|
5
|
-
:style="wrapperStyle"
|
|
6
|
-
>
|
|
7
|
-
<div
|
|
8
|
-
class="ev-progress-inner"
|
|
9
|
-
:style="innerStyle"
|
|
10
|
-
>
|
|
11
|
-
<div
|
|
12
|
-
v-if="innerText"
|
|
13
|
-
class="ev-progress-inner-text"
|
|
14
|
-
>
|
|
15
|
-
{{ innerText }}
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
<div
|
|
20
|
-
v-if="$slots.default"
|
|
21
|
-
class="ev-progress-label"
|
|
22
|
-
>
|
|
23
|
-
<slot />
|
|
24
|
-
</div>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
27
|
-
|
|
28
|
-
<script>
|
|
29
|
-
import { computed } from 'vue';
|
|
30
|
-
|
|
31
|
-
export default {
|
|
32
|
-
name: 'EvProgress',
|
|
33
|
-
props: {
|
|
34
|
-
modelValue: {
|
|
35
|
-
type: Number,
|
|
36
|
-
default: 0,
|
|
37
|
-
validator: val => (val >= 0 && val <= 100),
|
|
38
|
-
},
|
|
39
|
-
color: {
|
|
40
|
-
type: [String, Array],
|
|
41
|
-
default: '#409EFF',
|
|
42
|
-
},
|
|
43
|
-
strokeWidth: {
|
|
44
|
-
type: Number,
|
|
45
|
-
default: 6,
|
|
46
|
-
},
|
|
47
|
-
innerText: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: '',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
emits: {
|
|
53
|
-
},
|
|
54
|
-
setup(props) {
|
|
55
|
-
const wrapperStyle = computed(() => ({
|
|
56
|
-
height: `${props.strokeWidth}px`,
|
|
57
|
-
}));
|
|
58
|
-
const innerStyle = computed(() => {
|
|
59
|
-
if (Array.isArray(props.color)) {
|
|
60
|
-
const sortedColorList = [...props.color].sort((curr, next) => curr.value - next.value);
|
|
61
|
-
let color = sortedColorList[0].color;
|
|
62
|
-
if (!props.modelValue) {
|
|
63
|
-
return {
|
|
64
|
-
width: `${props.modelValue}%`,
|
|
65
|
-
'background-color': color,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
for (let i = 0; i < sortedColorList.length; i++) {
|
|
69
|
-
const prevValue = i === 0 ? 0 : sortedColorList[i - 1].value;
|
|
70
|
-
const currValue = sortedColorList[i].value;
|
|
71
|
-
if (props.modelValue > prevValue && props.modelValue <= currValue) {
|
|
72
|
-
color = sortedColorList[i].color;
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return {
|
|
77
|
-
width: `${props.modelValue}%`,
|
|
78
|
-
'background-color': color,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
return {
|
|
82
|
-
width: `${props.modelValue}%`,
|
|
83
|
-
'background-color': props.color,
|
|
84
|
-
};
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
return {
|
|
88
|
-
wrapperStyle,
|
|
89
|
-
innerStyle,
|
|
90
|
-
};
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
</script>
|
|
94
|
-
|
|
95
|
-
<style lang="scss">
|
|
96
|
-
@import '../../style/index.scss';
|
|
97
|
-
|
|
98
|
-
.ev-progress {
|
|
99
|
-
display: flex;
|
|
100
|
-
position: relative;
|
|
101
|
-
width: 100%;
|
|
102
|
-
box-sizing: border-box;
|
|
103
|
-
user-select: none;
|
|
104
|
-
|
|
105
|
-
&-wrapper {
|
|
106
|
-
position: relative;
|
|
107
|
-
height: 6px;
|
|
108
|
-
border-radius: 100px;
|
|
109
|
-
background-color: #EBEEF5;
|
|
110
|
-
overflow: hidden;
|
|
111
|
-
flex: 1;
|
|
112
|
-
align-self: center;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&-inner {
|
|
116
|
-
position: absolute;
|
|
117
|
-
top: 0;
|
|
118
|
-
left: 0;
|
|
119
|
-
height: 100%;
|
|
120
|
-
border-radius: 100px;
|
|
121
|
-
text-align: right;
|
|
122
|
-
white-space: nowrap;
|
|
123
|
-
transition: width .6s ease;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
&-inner-text {
|
|
127
|
-
display: inline-block;
|
|
128
|
-
margin: 0 5px;
|
|
129
|
-
color: #FFFFFF;
|
|
130
|
-
font-size: 12px;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
&-label {
|
|
134
|
-
min-width: 55px;
|
|
135
|
-
text-align: right;
|
|
136
|
-
margin-left: 10px;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ev-progress">
|
|
3
|
+
<div
|
|
4
|
+
class="ev-progress-wrapper"
|
|
5
|
+
:style="wrapperStyle"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
class="ev-progress-inner"
|
|
9
|
+
:style="innerStyle"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
v-if="innerText"
|
|
13
|
+
class="ev-progress-inner-text"
|
|
14
|
+
>
|
|
15
|
+
{{ innerText }}
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div
|
|
20
|
+
v-if="$slots.default"
|
|
21
|
+
class="ev-progress-label"
|
|
22
|
+
>
|
|
23
|
+
<slot />
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import { computed } from 'vue';
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
name: 'EvProgress',
|
|
33
|
+
props: {
|
|
34
|
+
modelValue: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: 0,
|
|
37
|
+
validator: val => (val >= 0 && val <= 100),
|
|
38
|
+
},
|
|
39
|
+
color: {
|
|
40
|
+
type: [String, Array],
|
|
41
|
+
default: '#409EFF',
|
|
42
|
+
},
|
|
43
|
+
strokeWidth: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: 6,
|
|
46
|
+
},
|
|
47
|
+
innerText: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
emits: {
|
|
53
|
+
},
|
|
54
|
+
setup(props) {
|
|
55
|
+
const wrapperStyle = computed(() => ({
|
|
56
|
+
height: `${props.strokeWidth}px`,
|
|
57
|
+
}));
|
|
58
|
+
const innerStyle = computed(() => {
|
|
59
|
+
if (Array.isArray(props.color)) {
|
|
60
|
+
const sortedColorList = [...props.color].sort((curr, next) => curr.value - next.value);
|
|
61
|
+
let color = sortedColorList[0].color;
|
|
62
|
+
if (!props.modelValue) {
|
|
63
|
+
return {
|
|
64
|
+
width: `${props.modelValue}%`,
|
|
65
|
+
'background-color': color,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
for (let i = 0; i < sortedColorList.length; i++) {
|
|
69
|
+
const prevValue = i === 0 ? 0 : sortedColorList[i - 1].value;
|
|
70
|
+
const currValue = sortedColorList[i].value;
|
|
71
|
+
if (props.modelValue > prevValue && props.modelValue <= currValue) {
|
|
72
|
+
color = sortedColorList[i].color;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
width: `${props.modelValue}%`,
|
|
78
|
+
'background-color': color,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
width: `${props.modelValue}%`,
|
|
83
|
+
'background-color': props.color,
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
return {
|
|
88
|
+
wrapperStyle,
|
|
89
|
+
innerStyle,
|
|
90
|
+
};
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<style lang="scss">
|
|
96
|
+
@import '../../style/index.scss';
|
|
97
|
+
|
|
98
|
+
.ev-progress {
|
|
99
|
+
display: flex;
|
|
100
|
+
position: relative;
|
|
101
|
+
width: 100%;
|
|
102
|
+
box-sizing: border-box;
|
|
103
|
+
user-select: none;
|
|
104
|
+
|
|
105
|
+
&-wrapper {
|
|
106
|
+
position: relative;
|
|
107
|
+
height: 6px;
|
|
108
|
+
border-radius: 100px;
|
|
109
|
+
background-color: #EBEEF5;
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
flex: 1;
|
|
112
|
+
align-self: center;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&-inner {
|
|
116
|
+
position: absolute;
|
|
117
|
+
top: 0;
|
|
118
|
+
left: 0;
|
|
119
|
+
height: 100%;
|
|
120
|
+
border-radius: 100px;
|
|
121
|
+
text-align: right;
|
|
122
|
+
white-space: nowrap;
|
|
123
|
+
transition: width .6s ease;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&-inner-text {
|
|
127
|
+
display: inline-block;
|
|
128
|
+
margin: 0 5px;
|
|
129
|
+
color: #FFFFFF;
|
|
130
|
+
font-size: 12px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&-label {
|
|
134
|
+
min-width: 55px;
|
|
135
|
+
text-align: right;
|
|
136
|
+
margin-left: 10px;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import EvProgress from './Progress';
|
|
2
|
-
|
|
3
|
-
EvProgress.install = (app) => {
|
|
4
|
-
app.component(EvProgress.name, EvProgress);
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export default EvProgress;
|
|
1
|
+
import EvProgress from './Progress';
|
|
2
|
+
|
|
3
|
+
EvProgress.install = (app) => {
|
|
4
|
+
app.component(EvProgress.name, EvProgress);
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export default EvProgress;
|
|
@@ -1,159 +1,159 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<label
|
|
3
|
-
class="ev-radio"
|
|
4
|
-
:class="[
|
|
5
|
-
{
|
|
6
|
-
disabled,
|
|
7
|
-
checked,
|
|
8
|
-
},
|
|
9
|
-
size,
|
|
10
|
-
]"
|
|
11
|
-
>
|
|
12
|
-
<input
|
|
13
|
-
v-model="mv"
|
|
14
|
-
type="radio"
|
|
15
|
-
class="ev-radio-input"
|
|
16
|
-
:value="label"
|
|
17
|
-
:disabled="disabled"
|
|
18
|
-
@change.stop="changeMv"
|
|
19
|
-
>
|
|
20
|
-
<span class="ev-radio-label">
|
|
21
|
-
<template v-if="$slots.default">
|
|
22
|
-
<slot />
|
|
23
|
-
</template>
|
|
24
|
-
<template v-else>
|
|
25
|
-
{{ label }}
|
|
26
|
-
</template>
|
|
27
|
-
</span>
|
|
28
|
-
</label>
|
|
29
|
-
</template>
|
|
30
|
-
|
|
31
|
-
<script>
|
|
32
|
-
import { computed, inject, nextTick } from 'vue';
|
|
33
|
-
|
|
34
|
-
export default {
|
|
35
|
-
name: 'EvRadio',
|
|
36
|
-
props: {
|
|
37
|
-
modelValue: {
|
|
38
|
-
type: [String, Number, Symbol, Boolean],
|
|
39
|
-
default: null,
|
|
40
|
-
},
|
|
41
|
-
label: {
|
|
42
|
-
type: [String, Number, Symbol, Boolean],
|
|
43
|
-
default: null,
|
|
44
|
-
},
|
|
45
|
-
disabled: {
|
|
46
|
-
type: Boolean,
|
|
47
|
-
default: false,
|
|
48
|
-
},
|
|
49
|
-
size: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: '',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
emits: {
|
|
55
|
-
'update:modelValue': null,
|
|
56
|
-
change: null,
|
|
57
|
-
},
|
|
58
|
-
setup(props, { emit }) {
|
|
59
|
-
const mv = inject(
|
|
60
|
-
'EvRadioGroupMv',
|
|
61
|
-
computed({
|
|
62
|
-
get: () => props.modelValue,
|
|
63
|
-
set: val => emit('update:modelValue', val),
|
|
64
|
-
}),
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
const changeMv = inject(
|
|
68
|
-
'EvRadioGroupChange',
|
|
69
|
-
async (e) => {
|
|
70
|
-
await nextTick();
|
|
71
|
-
emit('change', mv.value, e);
|
|
72
|
-
},
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
const checked = computed(() => mv.value === props.label);
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
mv,
|
|
79
|
-
checked,
|
|
80
|
-
changeMv,
|
|
81
|
-
};
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
</script>
|
|
85
|
-
|
|
86
|
-
<style lang="scss">
|
|
87
|
-
@import '../../style/index.scss';
|
|
88
|
-
|
|
89
|
-
.ev-radio {
|
|
90
|
-
$button-size-default: 18px;
|
|
91
|
-
display: inline-block;
|
|
92
|
-
position: relative;
|
|
93
|
-
padding: 0 5px;
|
|
94
|
-
margin-right: 30px;
|
|
95
|
-
user-select: none;
|
|
96
|
-
line-height: $button-size-default;
|
|
97
|
-
cursor: pointer;
|
|
98
|
-
&-label {
|
|
99
|
-
padding-left: 5px;
|
|
100
|
-
}
|
|
101
|
-
&-input {
|
|
102
|
-
cursor: pointer;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
@include state('disabled') {
|
|
107
|
-
.ev-radio-label {
|
|
108
|
-
@include evThemify() {
|
|
109
|
-
color: evThemed('disabled');
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
.ev-radio-input,
|
|
113
|
-
.ev-radio-label {
|
|
114
|
-
cursor: not-allowed !important;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
@include state('type-button') {
|
|
118
|
-
.ev-radio {
|
|
119
|
-
display: inline-block;
|
|
120
|
-
padding: 0;
|
|
121
|
-
margin: 0;
|
|
122
|
-
text-align: center;
|
|
123
|
-
|
|
124
|
-
@include evThemify() {
|
|
125
|
-
border: 1px solid evThemed('border-base');
|
|
126
|
-
border-left: 0;
|
|
127
|
-
}
|
|
128
|
-
&:first-child {
|
|
129
|
-
border-radius: $default-radius 0 0 $default-radius;
|
|
130
|
-
|
|
131
|
-
@include evThemify() {
|
|
132
|
-
border-left: 1px solid evThemed('border-base');
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
&:last-child {
|
|
136
|
-
border-radius: 0 $default-radius $default-radius 0;
|
|
137
|
-
}
|
|
138
|
-
&.checked {
|
|
139
|
-
color: $color-white;
|
|
140
|
-
|
|
141
|
-
@include evThemify() {
|
|
142
|
-
background-color: evThemed('primary');
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
&.disabled.checked {
|
|
146
|
-
@include evThemify() {
|
|
147
|
-
background-color: rgba(evThemed('border-base'), 0.5);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
.ev-radio-input {
|
|
152
|
-
@include visible-hide();
|
|
153
|
-
}
|
|
154
|
-
.ev-radio-label {
|
|
155
|
-
display: inline-block;
|
|
156
|
-
padding: 7px 12px;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<label
|
|
3
|
+
class="ev-radio"
|
|
4
|
+
:class="[
|
|
5
|
+
{
|
|
6
|
+
disabled,
|
|
7
|
+
checked,
|
|
8
|
+
},
|
|
9
|
+
size,
|
|
10
|
+
]"
|
|
11
|
+
>
|
|
12
|
+
<input
|
|
13
|
+
v-model="mv"
|
|
14
|
+
type="radio"
|
|
15
|
+
class="ev-radio-input"
|
|
16
|
+
:value="label"
|
|
17
|
+
:disabled="disabled"
|
|
18
|
+
@change.stop="changeMv"
|
|
19
|
+
>
|
|
20
|
+
<span class="ev-radio-label">
|
|
21
|
+
<template v-if="$slots.default">
|
|
22
|
+
<slot />
|
|
23
|
+
</template>
|
|
24
|
+
<template v-else>
|
|
25
|
+
{{ label }}
|
|
26
|
+
</template>
|
|
27
|
+
</span>
|
|
28
|
+
</label>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
import { computed, inject, nextTick } from 'vue';
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
name: 'EvRadio',
|
|
36
|
+
props: {
|
|
37
|
+
modelValue: {
|
|
38
|
+
type: [String, Number, Symbol, Boolean],
|
|
39
|
+
default: null,
|
|
40
|
+
},
|
|
41
|
+
label: {
|
|
42
|
+
type: [String, Number, Symbol, Boolean],
|
|
43
|
+
default: null,
|
|
44
|
+
},
|
|
45
|
+
disabled: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false,
|
|
48
|
+
},
|
|
49
|
+
size: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: '',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
emits: {
|
|
55
|
+
'update:modelValue': null,
|
|
56
|
+
change: null,
|
|
57
|
+
},
|
|
58
|
+
setup(props, { emit }) {
|
|
59
|
+
const mv = inject(
|
|
60
|
+
'EvRadioGroupMv',
|
|
61
|
+
computed({
|
|
62
|
+
get: () => props.modelValue,
|
|
63
|
+
set: val => emit('update:modelValue', val),
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const changeMv = inject(
|
|
68
|
+
'EvRadioGroupChange',
|
|
69
|
+
async (e) => {
|
|
70
|
+
await nextTick();
|
|
71
|
+
emit('change', mv.value, e);
|
|
72
|
+
},
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
const checked = computed(() => mv.value === props.label);
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
mv,
|
|
79
|
+
checked,
|
|
80
|
+
changeMv,
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<style lang="scss">
|
|
87
|
+
@import '../../style/index.scss';
|
|
88
|
+
|
|
89
|
+
.ev-radio {
|
|
90
|
+
$button-size-default: 18px;
|
|
91
|
+
display: inline-block;
|
|
92
|
+
position: relative;
|
|
93
|
+
padding: 0 5px;
|
|
94
|
+
margin-right: 30px;
|
|
95
|
+
user-select: none;
|
|
96
|
+
line-height: $button-size-default;
|
|
97
|
+
cursor: pointer;
|
|
98
|
+
&-label {
|
|
99
|
+
padding-left: 5px;
|
|
100
|
+
}
|
|
101
|
+
&-input {
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@include state('disabled') {
|
|
107
|
+
.ev-radio-label {
|
|
108
|
+
@include evThemify() {
|
|
109
|
+
color: evThemed('disabled');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
.ev-radio-input,
|
|
113
|
+
.ev-radio-label {
|
|
114
|
+
cursor: not-allowed !important;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
@include state('type-button') {
|
|
118
|
+
.ev-radio {
|
|
119
|
+
display: inline-block;
|
|
120
|
+
padding: 0;
|
|
121
|
+
margin: 0;
|
|
122
|
+
text-align: center;
|
|
123
|
+
|
|
124
|
+
@include evThemify() {
|
|
125
|
+
border: 1px solid evThemed('border-base');
|
|
126
|
+
border-left: 0;
|
|
127
|
+
}
|
|
128
|
+
&:first-child {
|
|
129
|
+
border-radius: $default-radius 0 0 $default-radius;
|
|
130
|
+
|
|
131
|
+
@include evThemify() {
|
|
132
|
+
border-left: 1px solid evThemed('border-base');
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
&:last-child {
|
|
136
|
+
border-radius: 0 $default-radius $default-radius 0;
|
|
137
|
+
}
|
|
138
|
+
&.checked {
|
|
139
|
+
color: $color-white;
|
|
140
|
+
|
|
141
|
+
@include evThemify() {
|
|
142
|
+
background-color: evThemed('primary');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
&.disabled.checked {
|
|
146
|
+
@include evThemify() {
|
|
147
|
+
background-color: rgba(evThemed('border-base'), 0.5);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
.ev-radio-input {
|
|
152
|
+
@include visible-hide();
|
|
153
|
+
}
|
|
154
|
+
.ev-radio-label {
|
|
155
|
+
display: inline-block;
|
|
156
|
+
padding: 7px 12px;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import EvRadio from './Radio';
|
|
2
|
-
|
|
3
|
-
EvRadio.install = (app) => {
|
|
4
|
-
app.component(EvRadio.name, EvRadio);
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
export default EvRadio;
|
|
1
|
+
import EvRadio from './Radio';
|
|
2
|
+
|
|
3
|
+
EvRadio.install = (app) => {
|
|
4
|
+
app.component(EvRadio.name, EvRadio);
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export default EvRadio;
|