evui 3.4.214 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/common/utils.bignumber.js +23 -0
- package/dist/common/utils.debounce.js +66 -0
- package/dist/common/utils.js +64 -0
- package/dist/common/utils.throttle.js +15 -0
- package/dist/components/button/Button.vue.js +65 -0
- package/dist/components/button/index.js +7 -0
- package/dist/components/buttonGroup/ButtonGroup.vue.js +14 -0
- package/dist/components/buttonGroup/index.js +7 -0
- package/dist/components/calendar/Calendar.vue.js +299 -0
- package/dist/components/calendar/index.js +7 -0
- package/dist/components/calendar/uses.js +579 -0
- package/dist/components/chart/Chart.vue.js +261 -0
- package/dist/components/chart/ChartToolbar.vue.js +32 -0
- package/dist/components/chart/chart.core.js +738 -0
- package/dist/components/chart/chartZoom.core.js +221 -0
- package/dist/components/chart/element/element.bar.js +358 -0
- package/dist/components/chart/element/element.bar.time.js +55 -0
- package/dist/components/chart/element/element.heatmap.js +403 -0
- package/dist/components/chart/element/element.line.js +292 -0
- package/dist/components/chart/element/element.pie.js +73 -0
- package/dist/components/chart/element/element.scatter.js +209 -0
- package/dist/components/chart/element/element.tip.js +312 -0
- package/dist/components/chart/helpers/helpers.canvas.js +141 -0
- package/dist/components/chart/helpers/helpers.constant.js +253 -0
- package/dist/components/chart/helpers/helpers.util.js +265 -0
- package/dist/components/chart/index.js +7 -0
- package/dist/components/chart/model/index.js +6 -0
- package/dist/components/chart/model/model.series.js +82 -0
- package/dist/components/chart/model/model.store.js +650 -0
- package/dist/components/chart/plugins/plugins.interaction.js +823 -0
- package/dist/components/chart/plugins/plugins.legend.gradient.js +281 -0
- package/dist/components/chart/plugins/plugins.legend.js +665 -0
- package/dist/components/chart/plugins/plugins.pie.js +86 -0
- package/dist/components/chart/plugins/plugins.scrollbar.js +345 -0
- package/dist/components/chart/plugins/plugins.title.js +43 -0
- package/dist/components/chart/plugins/plugins.tooltip.js +508 -0
- package/dist/components/chart/scale/scale.js +492 -0
- package/dist/components/chart/scale/scale.linear.js +248 -0
- package/dist/components/chart/scale/scale.logarithmic.js +82 -0
- package/dist/components/chart/scale/scale.step.js +227 -0
- package/dist/components/chart/scale/scale.time.category.js +148 -0
- package/dist/components/chart/scale/scale.time.js +95 -0
- package/dist/components/chart/uses.js +479 -0
- package/dist/components/chartBrush/ChartBrush.vue.js +198 -0
- package/dist/components/chartBrush/chartBrush.core.js +265 -0
- package/dist/components/chartBrush/index.js +7 -0
- package/dist/components/chartBrush/uses.js +18 -0
- package/dist/components/chartGroup/ChartGroup.vue.js +128 -0
- package/dist/components/chartGroup/index.js +7 -0
- package/dist/components/chartGroup/uses.js +47 -0
- package/dist/components/checkbox/Checkbox.vue.js +99 -0
- package/dist/components/checkbox/index.js +7 -0
- package/dist/components/checkboxGroup/CheckboxGroup.vue.js +40 -0
- package/dist/components/checkboxGroup/index.js +7 -0
- package/dist/components/contextMenu/ContextMenu.vue.js +70 -0
- package/dist/components/contextMenu/MenuList.vue.js +105 -0
- package/dist/components/contextMenu/index.js +7 -0
- package/dist/components/contextMenu/uses.js +79 -0
- package/dist/components/datePicker/DatePicker.vue.js +310 -0
- package/dist/components/datePicker/index.js +7 -0
- package/dist/components/datePicker/uses.js +190 -0
- package/dist/components/grid/Grid.vue.js +1261 -0
- package/dist/components/grid/GridColumnSetting.vue.js +212 -0
- package/dist/components/grid/GridFilterSetting.vue.js +222 -0
- package/dist/components/grid/GridPagination.vue.js +69 -0
- package/dist/components/grid/GridSummary.vue.js +186 -0
- package/dist/components/grid/GridToolbar.vue.js +15 -0
- package/dist/components/grid/icon/icon-option-button.vue.js +39 -0
- package/dist/components/grid/icon/icon-sort-button.vue.js +56 -0
- package/dist/components/grid/index.js +7 -0
- package/dist/components/grid/uses.js +697 -0
- package/dist/components/icon/Icon.vue.js +50 -0
- package/dist/components/icon/index.js +8 -0
- package/dist/components/inputNumber/InputNumber.vue.js +112 -0
- package/dist/components/inputNumber/index.js +7 -0
- package/dist/components/inputNumber/uses.js +76 -0
- package/dist/components/loading/Loading.vue.js +78 -0
- package/dist/components/loading/index.js +7 -0
- package/dist/components/menu/Menu.vue.js +66 -0
- package/dist/components/menu/MenuItem.vue.js +125 -0
- package/dist/components/menu/index.js +7 -0
- package/dist/components/message/Message.vue.js +122 -0
- package/dist/components/message/index.js +16 -0
- package/dist/components/messageBox/MessageBox.vue.js +216 -0
- package/dist/components/messageBox/index.js +13 -0
- package/dist/components/notification/Notification.vue.js +140 -0
- package/dist/components/notification/index.js +23 -0
- package/dist/components/pagination/Pagination.vue.js +215 -0
- package/dist/components/pagination/index.js +7 -0
- package/dist/components/pagination/pageButton.vue.js +35 -0
- package/dist/components/progress/Progress.vue.js +88 -0
- package/dist/components/progress/index.js +7 -0
- package/dist/components/radio/Radio.vue.js +75 -0
- package/dist/components/radio/index.js +7 -0
- package/dist/components/radioGroup/RadioGroup.vue.js +37 -0
- package/dist/components/radioGroup/index.js +7 -0
- package/dist/components/scheduler/Scheduler.vue.js +128 -0
- package/dist/components/scheduler/index.js +7 -0
- package/dist/components/scheduler/uses.js +73 -0
- package/dist/components/select/Select.vue.js +381 -0
- package/dist/components/select/index.js +7 -0
- package/dist/components/select/uses.js +147 -0
- package/dist/components/slider/Slider.vue.js +243 -0
- package/dist/components/slider/index.js +7 -0
- package/dist/components/slider/uses.js +188 -0
- package/dist/components/tabPanel/TabPanel.vue.js +39 -0
- package/dist/components/tabPanel/index.js +7 -0
- package/dist/components/tabs/Tabs.vue.js +220 -0
- package/dist/components/tabs/index.js +7 -0
- package/dist/components/textField/TextField.vue.js +209 -0
- package/dist/components/textField/index.js +7 -0
- package/dist/components/timePicker/TimePicker.vue.js +227 -0
- package/dist/components/timePicker/index.js +7 -0
- package/dist/components/toggle/Toggle.vue.js +66 -0
- package/dist/components/toggle/index.js +7 -0
- package/dist/components/tree/Tree.vue.js +220 -0
- package/dist/components/tree/TreeNode.vue.js +146 -0
- package/dist/components/tree/index.js +7 -0
- package/dist/components/treeGrid/TreeGrid.vue.js +898 -0
- package/dist/components/treeGrid/TreeGridNode.vue.js +274 -0
- package/dist/components/treeGrid/TreeGridToolbar.vue.js +15 -0
- package/dist/components/treeGrid/index.js +7 -0
- package/dist/components/treeGrid/uses.js +497 -0
- package/dist/components/window/Window.vue.js +211 -0
- package/dist/components/window/index.js +7 -0
- package/dist/components/window/uses.js +345 -0
- package/dist/directives/clickoutside.js +47 -0
- package/dist/main.js +142 -0
- package/dist/package.json.js +4 -0
- package/dist/resolver.js +17 -0
- package/package.json +11 -5
- package/dist/index.js +0 -22966
- package/dist/index.umd.cjs +0 -28
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { resolveComponent as H, openBlock as r, createElementBlock as i, normalizeClass as f, createElementVNode as s, Fragment as y, renderList as v, normalizeStyle as d, createCommentVNode as u, toDisplayString as I, withModifiers as c, createBlock as M, createVNode as V, toRefs as S } from "vue";
|
|
2
|
+
import { useModel as A, useStyle as N, useEvent as E, useInit as x } from "./uses.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import D from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const F = {
|
|
6
|
+
name: "EvSlider",
|
|
7
|
+
components: {},
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: [Number, Array],
|
|
11
|
+
default: null
|
|
12
|
+
},
|
|
13
|
+
readonly: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
disabled: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
20
|
+
},
|
|
21
|
+
range: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
24
|
+
},
|
|
25
|
+
max: {
|
|
26
|
+
type: Number,
|
|
27
|
+
default: 100
|
|
28
|
+
},
|
|
29
|
+
min: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 0
|
|
32
|
+
},
|
|
33
|
+
step: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 1,
|
|
36
|
+
validator: (a) => a > 0
|
|
37
|
+
},
|
|
38
|
+
mark: {
|
|
39
|
+
type: Object,
|
|
40
|
+
default: () => {
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
showStep: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !1
|
|
46
|
+
},
|
|
47
|
+
showTooltip: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: !0
|
|
50
|
+
},
|
|
51
|
+
showInput: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: !1
|
|
54
|
+
},
|
|
55
|
+
color: {
|
|
56
|
+
type: [String, Array],
|
|
57
|
+
default: null
|
|
58
|
+
},
|
|
59
|
+
tooltipFormat: {
|
|
60
|
+
type: Function,
|
|
61
|
+
default: null
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
emits: ["update:modelValue", "change"],
|
|
65
|
+
setup() {
|
|
66
|
+
const {
|
|
67
|
+
currentValue: a,
|
|
68
|
+
state: t,
|
|
69
|
+
slider: l,
|
|
70
|
+
formatValue: e,
|
|
71
|
+
sliderLine: h,
|
|
72
|
+
updateSliderInfo: g,
|
|
73
|
+
setSliderValue: o
|
|
74
|
+
} = A(), {
|
|
75
|
+
isColorArray: n,
|
|
76
|
+
leftHandleStyle: m,
|
|
77
|
+
rightHandleStyle: p,
|
|
78
|
+
handleBtnStyle: b,
|
|
79
|
+
rangeThumbStyle: k,
|
|
80
|
+
leftThumbStyle: w,
|
|
81
|
+
rightThumbStyle: T
|
|
82
|
+
} = N({
|
|
83
|
+
state: t,
|
|
84
|
+
slider: l
|
|
85
|
+
}), { startDrag: B, clickSlider: C, changeInput: L } = E({
|
|
86
|
+
currentValue: a,
|
|
87
|
+
state: t,
|
|
88
|
+
slider: l,
|
|
89
|
+
updateSliderInfo: g,
|
|
90
|
+
setSliderValue: o
|
|
91
|
+
});
|
|
92
|
+
return x({
|
|
93
|
+
currentValue: a,
|
|
94
|
+
state: t,
|
|
95
|
+
slider: l,
|
|
96
|
+
updateSliderInfo: g,
|
|
97
|
+
setSliderValue: o
|
|
98
|
+
}), {
|
|
99
|
+
currentValue: a,
|
|
100
|
+
isColorArray: n,
|
|
101
|
+
leftHandleStyle: m,
|
|
102
|
+
rightHandleStyle: p,
|
|
103
|
+
handleBtnStyle: b,
|
|
104
|
+
rangeThumbStyle: k,
|
|
105
|
+
leftThumbStyle: w,
|
|
106
|
+
rightThumbStyle: T,
|
|
107
|
+
sliderLine: h,
|
|
108
|
+
...S(t),
|
|
109
|
+
...S(l),
|
|
110
|
+
formatValue: e,
|
|
111
|
+
startDrag: B,
|
|
112
|
+
clickSlider: C,
|
|
113
|
+
changeInput: L
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}, U = { class: "ev-slider-wrapper" }, z = {
|
|
117
|
+
ref: "sliderLine",
|
|
118
|
+
class: "ev-slider-line"
|
|
119
|
+
}, _ = {
|
|
120
|
+
key: 0,
|
|
121
|
+
class: "ev-slider-step-wrapper"
|
|
122
|
+
}, j = {
|
|
123
|
+
key: 2,
|
|
124
|
+
class: "ev-slider-mark-wrapper"
|
|
125
|
+
}, O = { class: "ev-slider-mark-label" }, R = ["innerHTML"], X = ["innerHTML"];
|
|
126
|
+
function q(a, t, l, e, h, g) {
|
|
127
|
+
const o = H("ev-input-number");
|
|
128
|
+
return r(), i("div", {
|
|
129
|
+
class: f(["ev-slider", {
|
|
130
|
+
readonly: l.readonly,
|
|
131
|
+
disabled: l.disabled,
|
|
132
|
+
"hide-tooltip": !l.showTooltip,
|
|
133
|
+
"show-input": l.showInput,
|
|
134
|
+
"color-range": e.isColorArray,
|
|
135
|
+
"show-mark": a.markList.length
|
|
136
|
+
}])
|
|
137
|
+
}, [
|
|
138
|
+
s("div", U, [
|
|
139
|
+
s("div", z, [
|
|
140
|
+
l.showStep && l.step ? (r(), i("div", _, [
|
|
141
|
+
(r(!0), i(y, null, v(a.stepList, (n, m) => (r(), i("span", {
|
|
142
|
+
key: `slider-step-${m}`,
|
|
143
|
+
style: d({ left: `${n}%` }),
|
|
144
|
+
class: "ev-slider-step"
|
|
145
|
+
}, null, 4))), 128))
|
|
146
|
+
])) : u("", !0),
|
|
147
|
+
e.isColorArray && l.color.length > 1 ? (r(), i(y, { key: 1 }, [
|
|
148
|
+
l.range ? (r(), i("div", {
|
|
149
|
+
key: 0,
|
|
150
|
+
style: d(e.leftThumbStyle),
|
|
151
|
+
class: "ev-slider-thumb left"
|
|
152
|
+
}, null, 4)) : u("", !0),
|
|
153
|
+
s("div", {
|
|
154
|
+
style: d(e.rightThumbStyle),
|
|
155
|
+
class: "ev-slider-thumb right"
|
|
156
|
+
}, null, 4)
|
|
157
|
+
], 64)) : u("", !0),
|
|
158
|
+
s("div", {
|
|
159
|
+
class: "ev-slider-thumb",
|
|
160
|
+
style: d(e.rangeThumbStyle)
|
|
161
|
+
}, null, 4),
|
|
162
|
+
a.markList.length > 0 ? (r(), i("div", j, [
|
|
163
|
+
(r(!0), i(y, null, v(a.markList, (n, m) => (r(), i("div", {
|
|
164
|
+
key: `slider-step-${m}`,
|
|
165
|
+
style: d({
|
|
166
|
+
...n.style,
|
|
167
|
+
left: `${n.posX}%`
|
|
168
|
+
}),
|
|
169
|
+
class: "ev-slider-mark"
|
|
170
|
+
}, [
|
|
171
|
+
s("span", O, I(n.label), 1)
|
|
172
|
+
], 4))), 128))
|
|
173
|
+
])) : u("", !0),
|
|
174
|
+
s("span", {
|
|
175
|
+
class: "ev-slider-line-layer",
|
|
176
|
+
onClick: t[0] || (t[0] = (...n) => e.clickSlider && e.clickSlider(...n))
|
|
177
|
+
})
|
|
178
|
+
], 512),
|
|
179
|
+
l.range ? (r(), i("div", {
|
|
180
|
+
key: 0,
|
|
181
|
+
class: f(["ev-slider-handle", { dragging: a.dragging && a.handleType === "left" }]),
|
|
182
|
+
style: d(e.leftHandleStyle),
|
|
183
|
+
onMousedown: t[1] || (t[1] = c((n) => e.startDrag("left"), ["stop", "prevent"]))
|
|
184
|
+
}, [
|
|
185
|
+
s("span", {
|
|
186
|
+
style: d(e.handleBtnStyle),
|
|
187
|
+
class: "ev-slider-handle-btn"
|
|
188
|
+
}, null, 4),
|
|
189
|
+
s("div", {
|
|
190
|
+
class: "ev-slider-tooltip",
|
|
191
|
+
innerHTML: e.formatValue.left
|
|
192
|
+
}, null, 8, R)
|
|
193
|
+
], 38)) : u("", !0),
|
|
194
|
+
s("div", {
|
|
195
|
+
class: f(["ev-slider-handle", { dragging: a.dragging && a.handleType === "right" }]),
|
|
196
|
+
style: d(e.rightHandleStyle),
|
|
197
|
+
onMousedown: t[2] || (t[2] = c((n) => e.startDrag("right"), ["stop", "prevent"]))
|
|
198
|
+
}, [
|
|
199
|
+
s("span", {
|
|
200
|
+
style: d(e.handleBtnStyle),
|
|
201
|
+
class: "ev-slider-handle-btn"
|
|
202
|
+
}, null, 4),
|
|
203
|
+
s("div", {
|
|
204
|
+
class: "ev-slider-tooltip",
|
|
205
|
+
innerHTML: e.formatValue.right
|
|
206
|
+
}, null, 8, X)
|
|
207
|
+
], 38)
|
|
208
|
+
]),
|
|
209
|
+
l.showInput && !l.range ? (r(), M(o, {
|
|
210
|
+
key: 0,
|
|
211
|
+
modelValue: e.currentValue,
|
|
212
|
+
"onUpdate:modelValue": t[3] || (t[3] = (n) => e.currentValue = n),
|
|
213
|
+
step: l.step,
|
|
214
|
+
min: l.min,
|
|
215
|
+
max: l.max,
|
|
216
|
+
"step-strictly": "",
|
|
217
|
+
onChange: e.changeInput
|
|
218
|
+
}, null, 8, ["modelValue", "step", "min", "max", "onChange"])) : l.showInput && l.range && Array.isArray(l.modelValue) ? (r(), i(y, { key: 1 }, [
|
|
219
|
+
V(o, {
|
|
220
|
+
modelValue: e.currentValue[0],
|
|
221
|
+
"onUpdate:modelValue": t[4] || (t[4] = (n) => e.currentValue[0] = n),
|
|
222
|
+
step: l.step,
|
|
223
|
+
min: l.min,
|
|
224
|
+
max: e.currentValue[1],
|
|
225
|
+
"step-strictly": "",
|
|
226
|
+
onChange: t[5] || (t[5] = (n) => e.changeInput(n, "left"))
|
|
227
|
+
}, null, 8, ["modelValue", "step", "min", "max"]),
|
|
228
|
+
V(o, {
|
|
229
|
+
modelValue: e.currentValue[1],
|
|
230
|
+
"onUpdate:modelValue": t[6] || (t[6] = (n) => e.currentValue[1] = n),
|
|
231
|
+
step: l.step,
|
|
232
|
+
min: e.currentValue[0],
|
|
233
|
+
max: l.max,
|
|
234
|
+
"step-strictly": "",
|
|
235
|
+
onChange: t[7] || (t[7] = (n) => e.changeInput(n, "right"))
|
|
236
|
+
}, null, 8, ["modelValue", "step", "min", "max"])
|
|
237
|
+
], 64)) : u("", !0)
|
|
238
|
+
], 2);
|
|
239
|
+
}
|
|
240
|
+
const Q = /* @__PURE__ */ D(F, [["render", q]]);
|
|
241
|
+
export {
|
|
242
|
+
Q as default
|
|
243
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { getCurrentInstance as k, ref as S, reactive as L, computed as h, watch as A, onMounted as M } from "vue";
|
|
2
|
+
import { isNumber as I, isEqual as T } from "lodash-es";
|
|
3
|
+
import { convertToPercent as y } from "../../common/utils.js";
|
|
4
|
+
import { getValueCloseToStep as w } from "../inputNumber/uses.js";
|
|
5
|
+
const D = () => {
|
|
6
|
+
const { props: l, emit: e } = k(), s = S(l.modelValue), n = () => {
|
|
7
|
+
if (!l.showStep)
|
|
8
|
+
return [];
|
|
9
|
+
const t = l.max - l.min, r = t / l.step, a = y(l.step, t), o = [];
|
|
10
|
+
for (let f = 1; f < r; f++)
|
|
11
|
+
o.push(f * a);
|
|
12
|
+
return o;
|
|
13
|
+
}, m = () => {
|
|
14
|
+
if (!l.mark || !Object.keys(l.mark).length)
|
|
15
|
+
return [];
|
|
16
|
+
const t = (a, o = "value") => {
|
|
17
|
+
if (!a)
|
|
18
|
+
return [];
|
|
19
|
+
const f = l.mark.style && typeof l.mark.style == "object" ? l.mark.style : {}, c = Object.keys(a), b = [];
|
|
20
|
+
let x;
|
|
21
|
+
for (let R = 0; R < c.length; R++)
|
|
22
|
+
x = +c[R], isNaN(x) || b.push({
|
|
23
|
+
posX: o === "value" ? y(x, l.max - l.min) : x,
|
|
24
|
+
label: a[x],
|
|
25
|
+
style: f
|
|
26
|
+
});
|
|
27
|
+
return b;
|
|
28
|
+
};
|
|
29
|
+
return l.mark.value || l.mark.percent ? [...t(l.mark.value), ...t(l.mark.percent, "percent")] : [...t(l.mark)];
|
|
30
|
+
}, i = L({
|
|
31
|
+
isInit: !1,
|
|
32
|
+
dragging: !1,
|
|
33
|
+
handleType: null,
|
|
34
|
+
// 'left', 'right', null
|
|
35
|
+
leftValue: null,
|
|
36
|
+
rightValue: null
|
|
37
|
+
}), u = L({
|
|
38
|
+
valueRange: 0,
|
|
39
|
+
stepList: h(n),
|
|
40
|
+
markList: h(m),
|
|
41
|
+
offset: {
|
|
42
|
+
left: 0,
|
|
43
|
+
width: 0
|
|
44
|
+
}
|
|
45
|
+
}), V = S(), p = h(() => {
|
|
46
|
+
const t = l.tooltipFormat, r = t instanceof Function;
|
|
47
|
+
return {
|
|
48
|
+
left: r ? t(i.leftValue) : i.leftValue,
|
|
49
|
+
right: r ? t(i.rightValue) : i.rightValue
|
|
50
|
+
};
|
|
51
|
+
}), g = (t) => {
|
|
52
|
+
const r = {
|
|
53
|
+
min: l.min,
|
|
54
|
+
max: l.max,
|
|
55
|
+
step: l.step
|
|
56
|
+
};
|
|
57
|
+
let a, o;
|
|
58
|
+
l.range && Array.isArray(t) ? (a = typeof t[0] == "number" && !isNaN(t[0]) ? t[0] : l.min, o = typeof t[1] == "number" && !isNaN(t[1]) ? t[1] : l.min, i.leftValue = w(a, r), i.rightValue = w(o, r)) : (a = l.min, o = typeof t == "number" && !isNaN(t) ? t : l.min, i.leftValue = w(a, r), i.rightValue = w(o, r));
|
|
59
|
+
}, d = (t) => {
|
|
60
|
+
if (u.valueRange <= 0)
|
|
61
|
+
return;
|
|
62
|
+
g(t);
|
|
63
|
+
let r;
|
|
64
|
+
if (l.range && Array.isArray(t)) {
|
|
65
|
+
const a = Math.min(i.leftValue, i.rightValue), o = Math.max(i.leftValue, i.rightValue);
|
|
66
|
+
r = [a, o];
|
|
67
|
+
} else
|
|
68
|
+
r = i.rightValue;
|
|
69
|
+
s.value = r, e("update:modelValue", r), e("change", r);
|
|
70
|
+
}, v = () => {
|
|
71
|
+
const t = V.value.getBoundingClientRect();
|
|
72
|
+
u.offset.left = t.left, u.offset.width = t.width, u.valueRange = l.max - l.min;
|
|
73
|
+
};
|
|
74
|
+
return A(
|
|
75
|
+
() => l.modelValue,
|
|
76
|
+
(t, r) => {
|
|
77
|
+
I(t) && t >= 0 && !T(t, r) && !i.dragging && (g(t), s.value = t);
|
|
78
|
+
}
|
|
79
|
+
), A(
|
|
80
|
+
() => l.step,
|
|
81
|
+
() => {
|
|
82
|
+
d(s.value);
|
|
83
|
+
}
|
|
84
|
+
), {
|
|
85
|
+
currentValue: s,
|
|
86
|
+
state: i,
|
|
87
|
+
slider: u,
|
|
88
|
+
formatValue: p,
|
|
89
|
+
sliderLine: V,
|
|
90
|
+
updateSliderInfo: v,
|
|
91
|
+
setSliderValue: d
|
|
92
|
+
};
|
|
93
|
+
}, O = (l) => {
|
|
94
|
+
const { props: e } = k(), { state: s, slider: n } = l, m = "transparent", i = h(() => ({
|
|
95
|
+
left: n.valueRange > 0 ? `${y(s.leftValue - e.min, n.valueRange)}%` : 0
|
|
96
|
+
})), u = h(() => ({
|
|
97
|
+
left: n.valueRange > 0 ? `${y(s.rightValue - e.min, n.valueRange)}%` : 0
|
|
98
|
+
})), V = h(() => !e.color || Array.isArray(e.color) && e.color.length !== 1 ? {} : {
|
|
99
|
+
borderColor: (typeof e.color == "string" ? e.color : e.color[0]) || m
|
|
100
|
+
}), p = h(() => e.color && Array.isArray(e.color)), g = h(() => {
|
|
101
|
+
const t = Math.min(s.leftValue, s.rightValue), a = +(Math.max(s.leftValue, s.rightValue) - t).toFixed(2), o = n.valueRange > 0 && e.range ? y(+(t - e.min).toFixed(2), n.valueRange) : 0, f = a > 0 ? y(a, n.valueRange) : 0, c = {};
|
|
102
|
+
return e.color && (typeof e.color == "string" || Array.isArray(e.color) && e.color.length === 1 ? c.backgroundColor = (typeof e.color == "string" ? e.color : e.color[0]) || m : Array.isArray(e.color) && e.color.length > 1 && (c.backgroundColor = (e.range ? e.color[1] : e.color[0]) || m)), {
|
|
103
|
+
left: `${o}%`,
|
|
104
|
+
width: `${f}%`,
|
|
105
|
+
...c
|
|
106
|
+
};
|
|
107
|
+
}), d = h(() => {
|
|
108
|
+
if (!p.value || e.color.length < 2 || !e.range)
|
|
109
|
+
return {};
|
|
110
|
+
const t = Math.min(s.leftValue, s.rightValue);
|
|
111
|
+
return {
|
|
112
|
+
width: `${y(Math.abs(t - e.min), n.valueRange)}%`,
|
|
113
|
+
backgroundColor: e.color[0] || m
|
|
114
|
+
};
|
|
115
|
+
}), v = h(() => {
|
|
116
|
+
if (!p.value || e.color.length < 2)
|
|
117
|
+
return {};
|
|
118
|
+
const t = Math.max(s.leftValue, s.rightValue), r = y(+(t - e.min).toFixed(2), n.valueRange), a = y(+(e.max - t).toFixed(2), n.valueRange), o = e.range ? 2 : e.color.length - 1;
|
|
119
|
+
return {
|
|
120
|
+
left: `${r}%`,
|
|
121
|
+
width: `${a}%`,
|
|
122
|
+
backgroundColor: e.color[o] || m
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
return {
|
|
126
|
+
isColorArray: p,
|
|
127
|
+
leftHandleStyle: i,
|
|
128
|
+
rightHandleStyle: u,
|
|
129
|
+
handleBtnStyle: V,
|
|
130
|
+
rangeThumbStyle: g,
|
|
131
|
+
leftThumbStyle: d,
|
|
132
|
+
rightThumbStyle: v
|
|
133
|
+
};
|
|
134
|
+
}, $ = (l) => {
|
|
135
|
+
const { props: e } = k(), { currentValue: s, state: n, slider: m, updateSliderInfo: i, setSliderValue: u } = l, V = (r) => {
|
|
136
|
+
n.dragging || i();
|
|
137
|
+
const a = r.type.indexOf("touch") !== -1 ? r.touches[0].clientX : r.clientX, { valueRange: o, offset: f } = m;
|
|
138
|
+
let c = e.min + (a - f.left) * o / f.width;
|
|
139
|
+
return c < e.min ? c = e.min : c > e.max && (c = e.max), c;
|
|
140
|
+
}, p = (r) => {
|
|
141
|
+
if (e.readonly || e.disabled || n.dragging)
|
|
142
|
+
return;
|
|
143
|
+
const a = V(r);
|
|
144
|
+
let o;
|
|
145
|
+
if (e.range) {
|
|
146
|
+
const c = Math.min(n.leftValue, n.rightValue) + Math.abs((n.rightValue - n.leftValue) / 2), b = n.leftValue > n.rightValue;
|
|
147
|
+
a < c ? n.handleType = b ? "right" : "left" : n.handleType = b ? "left" : "right", o = n.handleType === "left" ? [a, n.rightValue] : [n.leftValue, a];
|
|
148
|
+
} else
|
|
149
|
+
n.handleType = "right", o = a;
|
|
150
|
+
u(o);
|
|
151
|
+
}, g = (r) => {
|
|
152
|
+
const a = V(r);
|
|
153
|
+
n.dragging = !0;
|
|
154
|
+
let o;
|
|
155
|
+
e.range ? o = n.handleType === "left" ? [a, n.rightValue] : [n.leftValue, a] : o = a, u(o);
|
|
156
|
+
}, d = () => {
|
|
157
|
+
n.handleType = null, n.dragging = !1, document.body.style.cursor = "", window.removeEventListener("mousemove", g), window.removeEventListener("touchmove", g), window.removeEventListener("mouseup", d), window.removeEventListener("touchend", d);
|
|
158
|
+
};
|
|
159
|
+
return {
|
|
160
|
+
startDrag: (r) => {
|
|
161
|
+
e.readonly || e.disabled || (n.handleType = r, document.body.style.cursor = "grabbing", window.addEventListener("mousemove", g), window.addEventListener("touchmove", g), window.addEventListener("mouseup", d), window.addEventListener("touchend", d));
|
|
162
|
+
},
|
|
163
|
+
clickSlider: p,
|
|
164
|
+
changeInput: (r, a) => {
|
|
165
|
+
if (e.showInput && !n.dragging && n.isInit)
|
|
166
|
+
if (e.range && Array.isArray(s.value)) {
|
|
167
|
+
const o = a === "left" ? [r, s.value[1]] : [s.value[0], r];
|
|
168
|
+
u(o);
|
|
169
|
+
} else e.range || u(r);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
}, P = (l) => {
|
|
173
|
+
const { props: e, emit: s } = k(), { currentValue: n, state: m, slider: i, updateSliderInfo: u, setSliderValue: V } = l, p = () => {
|
|
174
|
+
const d = e.max || e.max === 0, v = e.min || e.min === 0;
|
|
175
|
+
d && v && e.max <= e.min && console.warn("[EVUI][Slider] Max value must be greater than min value.");
|
|
176
|
+
}, g = () => {
|
|
177
|
+
u(), i.valueRange <= 0 && (n.value = e.range ? [e.min, e.min] : e.min, s("update:modelValue", n.value)), V(n.value), m.isInit = !0;
|
|
178
|
+
};
|
|
179
|
+
M(() => {
|
|
180
|
+
p(), g();
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
export {
|
|
184
|
+
$ as useEvent,
|
|
185
|
+
P as useInit,
|
|
186
|
+
D as useModel,
|
|
187
|
+
O as useStyle
|
|
188
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { withDirectives as a, openBlock as n, createElementBlock as o, renderSlot as s, vShow as c, inject as i, computed as u } from "vue";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import d from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = {
|
|
5
|
+
name: "EvTabPanel",
|
|
6
|
+
props: {
|
|
7
|
+
text: {
|
|
8
|
+
type: [String, Number],
|
|
9
|
+
default: null
|
|
10
|
+
},
|
|
11
|
+
value: {
|
|
12
|
+
type: [String, Number],
|
|
13
|
+
default: null,
|
|
14
|
+
required: !0
|
|
15
|
+
},
|
|
16
|
+
disabled: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !1
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
emits: {},
|
|
22
|
+
setup(e) {
|
|
23
|
+
const t = i("evTabs", null);
|
|
24
|
+
return {
|
|
25
|
+
isSelected: u(() => e.value === t.value)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}, f = { class: "ev-tab-panel" };
|
|
29
|
+
function m(e, t, l, r, v, _) {
|
|
30
|
+
return a((n(), o("article", f, [
|
|
31
|
+
s(e.$slots, "default")
|
|
32
|
+
], 512)), [
|
|
33
|
+
[c, r.isSelected]
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
const T = /* @__PURE__ */ d(p, [["render", m]]);
|
|
37
|
+
export {
|
|
38
|
+
T as default
|
|
39
|
+
};
|