@xtctwins/tctwins-bimx-engine 0.2.49 → 0.2.50
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 +193 -193
- package/dist/{AnnotationTool-BIQYccLV.mjs → AnnotationTool-ClUqfSZp.mjs} +35 -35
- package/dist/BIMX_Viewer_Lib.es.js +3 -3
- package/dist/BIMX_Viewer_Lib.umd.js +130 -138
- package/dist/{CommentTool-CTH0u76a.mjs → CommentTool-DcAcusOm.mjs} +168 -168
- package/dist/{HiddenTool-B1o4e4Mi.mjs → HiddenTool-D0kbPBtX.mjs} +13 -13
- package/dist/{InspectorTool-BnKwoEV6.mjs → InspectorTool-BMXg86Ow.mjs} +64 -64
- package/dist/{MeasureTool-DD0MQlVK.mjs → MeasureTool-CN4zNj6w.mjs} +22 -22
- package/dist/{MouseTool-B99s92wL.mjs → MouseTool-Dcp3UTRv.mjs} +15 -15
- package/dist/{NavigateTool-Bzni_edr.mjs → NavigateTool-TVHCkKRU.mjs} +13 -13
- package/dist/{RoamTool-BnF-1cl2.mjs → RoamTool-CkYHH7aP.mjs} +17 -17
- package/dist/ScreenShotTool-DC4RyElm.mjs +500 -0
- package/dist/{SectionTool-DJjxjkhi.mjs → SectionTool-Vn7purnG.mjs} +43 -43
- package/dist/SettingTool-DWoeF-dC.mjs +815 -0
- package/dist/StructureTree-DZ0gUacM.mjs +1846 -0
- package/dist/{alert-BMV9n7SQ.mjs → alert-BkyuKyki.mjs} +9 -9
- package/dist/el-input-number-CUWk0tiM.mjs +1169 -0
- package/dist/{index-BaDPCrAt.mjs → index-CBXvm6RA.mjs} +51711 -47848
- package/dist/index.html +17 -17
- package/dist/{panel.vue_vue_type_style_index_0_lang-oT_Sff-F.mjs → panel.vue_vue_type_style_index_0_lang-IOvVcvu7.mjs} +3 -3
- package/dist/style.css +1 -1
- package/dist/{tallPanel-DojXnxix.mjs → tallPanel-HBoW6JCm.mjs} +15 -15
- package/package.json +2 -2
- package/types/components/BCFComponents/BCFAddPanel.vue.d.ts +38 -10
- package/types/components/BCFComponents/BCFDetailPanel.vue.d.ts +37 -9
- package/types/components/BCFComponents/BCFDisplayList.vue.d.ts +5 -7
- package/types/components/BCFComponents/BCFFilter.vue.d.ts +5 -7
- package/types/components/BCFComponents/BCFTool.vue.d.ts +4 -7
- package/types/components/BCFComponents/addObjectOrAnno.vue.d.ts +5 -7
- package/types/components/BCFComponents/checkObjectPanel.vue.d.ts +5 -6
- package/types/components/BCFComponents/commentInput.vue.d.ts +36 -10
- package/types/components/BCFComponents/commentsView.vue.d.ts +36 -7
- package/types/components/BCFComponents/dialogPanel.vue.d.ts +5 -8
- package/types/components/BCFComponents/imageView.vue.d.ts +5 -7
- package/types/components/BCFComponents/imageZoomIn.vue.d.ts +5 -6
- package/types/components/BimViewerComponents/AnnotationTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/AppToolbar.vue.d.ts +18 -1
- package/types/components/BimViewerComponents/ClickEvent.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/CommentTool.vue.d.ts +32 -1
- package/types/components/BimViewerComponents/HiddenTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/MobileCommentsTool/add.vue.d.ts +6 -8
- package/types/components/BimViewerComponents/MobileCommentsTool/detail.vue.d.ts +4 -5
- package/types/components/BimViewerComponents/MobileCommentsTool/draw.vue.d.ts +2 -2
- package/types/components/BimViewerComponents/MobileCommentsTool/filter.vue.d.ts +478 -1
- package/types/components/BimViewerComponents/MobileCommentsTool/list.vue.d.ts +499 -7
- package/types/components/BimViewerComponents/MobileCommentsTool/zoomIn.vue.d.ts +5 -6
- package/types/components/BimViewerComponents/MouseTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/NavigateTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/PCCommentTool/pcdraw.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/RoamTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/SettingTool.vue.d.ts +4 -6
- package/types/components/BimViewerComponents/StructureTree.vue.d.ts +4026 -1
- package/types/components/BimViewerComponents/Toolbar.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/mobileToolbar.vue.d.ts +18 -1
- package/types/components/BimxViewerComp.vue.d.ts +7 -14
- package/types/components/MobileBCFComponents/MobileBCFAdd.vue.d.ts +37 -10
- package/types/components/MobileBCFComponents/MobileBCFDetail.vue.d.ts +37 -9
- package/types/components/MobileBCFComponents/MobileBCFDisplayList.vue.d.ts +499 -7
- package/types/components/MobileBCFComponents/MobileBCFFilter.vue.d.ts +478 -1
- package/types/components/MobileBCFComponents/MobileBCFTool.vue.d.ts +5 -8
- package/types/components/MobileBCFComponents/MobileCommentInput.vue.d.ts +38 -12
- package/types/components/MobileBCFComponents/MobileCommentsView.vue.d.ts +7 -9
- package/types/components/MobileBCFComponents/selectPanel.vue.d.ts +5 -7
- package/types/components/bimxViewer.vue.d.ts +7 -14
- package/types/components/utilsComponents/alert.vue.d.ts +1 -1
- package/types/components/utilsComponents/closeButton.vue.d.ts +1 -1
- package/types/components/utilsComponents/closeButton_dark.vue.d.ts +1 -1
- package/types/components/utilsComponents/emptyPage.vue.d.ts +1 -1
- package/types/components/utilsComponents/loading.vue.d.ts +1 -1
- package/types/components/utilsComponents/panel.vue.d.ts +8 -2
- package/types/components/utilsComponents/prompt.vue.d.ts +1 -1
- package/types/components/utilsComponents/rectangleButton.vue.d.ts +3 -1
- package/types/components/utilsComponents/tallPanel.vue.d.ts +13 -3
- package/types/components/utilsComponents/tallPanel_noPos.vue.d.ts +13 -3
- package/types/pages/BimxViewerEntry.vue.d.ts +5 -57
- package/types/pages/viewerEntry.vue.d.ts +7 -57
- package/types/store/initConfigs.d.ts +1 -1
- package/types/store/toolbars.d.ts +46 -46
- package/dist/ScreenShotTool-CSBJzyDd.mjs +0 -357
- package/dist/SettingTool-D2qksFZK.mjs +0 -657
- package/dist/StructureTree-DrLo9Bch.mjs +0 -1583
- package/dist/el-input-number-BOQOKzK0.mjs +0 -818
- package/types/components/BCFComponents/BCFCommentNew.vue.d.ts +0 -22
- package/types/components/BimViewerComponents/emptyPage.vue.d.ts +0 -8
- package/types/tests/cmt.d.ts +0 -1
|
@@ -0,0 +1,1169 @@
|
|
|
1
|
+
import { defineComponent as Se, ref as ae, reactive as Ce, computed as S, watch as se, onMounted as $e, onUpdated as Qe, createElementBlock as U, openBlock as C, withModifiers as Ke, normalizeClass as O, unref as t, withDirectives as Le, createCommentVNode as oe, createVNode as ve, withKeys as Te, renderSlot as ge, withCtx as ue, createBlock as le, createSlots as Ze, inject as _e, nextTick as ye, toRefs as Be, normalizeStyle as re, createElementVNode as ie, toDisplayString as De, h as et, shallowRef as tt, provide as lt, Fragment as he, renderList as ke } from "vue";
|
|
2
|
+
import { a6 as $, f as fe, b as pe, a8 as H, ai as ne, a7 as Ne, v as te, ac as Xe, a9 as Ie, x as Ye, u as Ee, ae as Ue, i as Ve, o as ee, a as Oe, aa as We, E as Fe, an as ze, F as nt, al as je, j as Pe, q as Ge, ao as at, s as J, w as qe, e as be, ap as He, p as we, aq as Ae, ar as rt, as as ot, af as ut } from "./index-CBXvm6RA.mjs";
|
|
3
|
+
import { ArrowDown as it, Minus as st, ArrowUp as dt, Plus as ct } from "@element-plus/icons-vue";
|
|
4
|
+
const mt = pe({
|
|
5
|
+
/**
|
|
6
|
+
* @description same as `id` in native input
|
|
7
|
+
*/
|
|
8
|
+
id: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: void 0
|
|
11
|
+
},
|
|
12
|
+
/**
|
|
13
|
+
* @description incremental step
|
|
14
|
+
*/
|
|
15
|
+
step: {
|
|
16
|
+
type: Number,
|
|
17
|
+
default: 1
|
|
18
|
+
},
|
|
19
|
+
/**
|
|
20
|
+
* @description whether input value can only be multiple of step
|
|
21
|
+
*/
|
|
22
|
+
stepStrictly: Boolean,
|
|
23
|
+
/**
|
|
24
|
+
* @description the maximum allowed value
|
|
25
|
+
*/
|
|
26
|
+
max: {
|
|
27
|
+
type: Number,
|
|
28
|
+
default: Number.MAX_SAFE_INTEGER
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* @description the minimum allowed value
|
|
32
|
+
*/
|
|
33
|
+
min: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: Number.MIN_SAFE_INTEGER
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* @description binding value
|
|
39
|
+
*/
|
|
40
|
+
modelValue: {
|
|
41
|
+
type: [Number, null]
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* @description same as `readonly` in native input
|
|
45
|
+
*/
|
|
46
|
+
readonly: Boolean,
|
|
47
|
+
/**
|
|
48
|
+
* @description whether the component is disabled
|
|
49
|
+
*/
|
|
50
|
+
disabled: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: void 0
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* @description size of the component
|
|
56
|
+
*/
|
|
57
|
+
size: Ie,
|
|
58
|
+
/**
|
|
59
|
+
* @description whether to enable the control buttons
|
|
60
|
+
*/
|
|
61
|
+
controls: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !0
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* @description position of the control buttons
|
|
67
|
+
*/
|
|
68
|
+
controlsPosition: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: "",
|
|
71
|
+
values: ["", "right"]
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* @description value should be set when input box is cleared
|
|
75
|
+
*/
|
|
76
|
+
valueOnClear: {
|
|
77
|
+
type: te([String, Number, null]),
|
|
78
|
+
validator: (e) => e === null || $(e) || ["min", "max"].includes(e),
|
|
79
|
+
default: null
|
|
80
|
+
},
|
|
81
|
+
/**
|
|
82
|
+
* @description same as `name` in native input
|
|
83
|
+
*/
|
|
84
|
+
name: String,
|
|
85
|
+
/**
|
|
86
|
+
* @description same as `placeholder` in native input
|
|
87
|
+
*/
|
|
88
|
+
placeholder: String,
|
|
89
|
+
/**
|
|
90
|
+
* @description precision of input value
|
|
91
|
+
*/
|
|
92
|
+
precision: {
|
|
93
|
+
type: Number,
|
|
94
|
+
validator: (e) => e >= 0 && e === Number.parseInt(`${e}`, 10)
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* @description whether to trigger form validation
|
|
98
|
+
*/
|
|
99
|
+
validateEvent: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: !0
|
|
102
|
+
},
|
|
103
|
+
...Xe(["ariaLabel"]),
|
|
104
|
+
/**
|
|
105
|
+
* @description native input mode for virtual keyboards
|
|
106
|
+
*/
|
|
107
|
+
inputmode: {
|
|
108
|
+
type: te(String),
|
|
109
|
+
default: void 0
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* @description alignment for the inner input text
|
|
113
|
+
*/
|
|
114
|
+
align: {
|
|
115
|
+
type: te(String),
|
|
116
|
+
default: "center"
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
* @description whether to disable scientific notation input (e.g. 'e', 'E')
|
|
120
|
+
*/
|
|
121
|
+
disabledScientific: Boolean
|
|
122
|
+
}), vt = {
|
|
123
|
+
[Ne]: (e, l) => l !== e,
|
|
124
|
+
blur: (e) => e instanceof FocusEvent,
|
|
125
|
+
focus: (e) => e instanceof FocusEvent,
|
|
126
|
+
[ne]: (e) => $(e) || fe(e),
|
|
127
|
+
[H]: (e) => $(e) || fe(e)
|
|
128
|
+
}, ft = ["aria-label"], bt = ["aria-label"];
|
|
129
|
+
var gt = /* @__PURE__ */ Se({
|
|
130
|
+
name: "ElInputNumber",
|
|
131
|
+
__name: "input-number",
|
|
132
|
+
props: mt,
|
|
133
|
+
emits: vt,
|
|
134
|
+
setup(e, { expose: l, emit: g }) {
|
|
135
|
+
const a = e, d = g, { t: c } = Ye(), u = Ee("input-number"), V = ae(), o = Ce({
|
|
136
|
+
currentValue: a.modelValue,
|
|
137
|
+
userInput: null
|
|
138
|
+
}), { formItem: i } = Ue(), N = S(
|
|
139
|
+
() => $(a.modelValue) && a.modelValue <= a.min
|
|
140
|
+
), h = S(
|
|
141
|
+
() => $(a.modelValue) && a.modelValue >= a.max
|
|
142
|
+
), k = S(() => {
|
|
143
|
+
const n = F(a.step);
|
|
144
|
+
return Ve(a.precision) ? Math.max(F(a.modelValue), n) : (n > a.precision && ee(
|
|
145
|
+
"InputNumber",
|
|
146
|
+
"precision should not be less than the decimal places of step"
|
|
147
|
+
), a.precision);
|
|
148
|
+
}), K = S(() => a.controls && a.controlsPosition === "right"), W = Oe(), T = We(), z = S(() => {
|
|
149
|
+
if (o.userInput !== null)
|
|
150
|
+
return o.userInput;
|
|
151
|
+
let n = o.currentValue;
|
|
152
|
+
if (fe(n)) return "";
|
|
153
|
+
if ($(n)) {
|
|
154
|
+
if (Number.isNaN(n)) return "";
|
|
155
|
+
Ve(a.precision) || (n = n.toFixed(a.precision));
|
|
156
|
+
}
|
|
157
|
+
return n;
|
|
158
|
+
}), M = (n, r) => {
|
|
159
|
+
if (Ve(r) && (r = k.value), r === 0) return Math.round(n);
|
|
160
|
+
let s = String(n);
|
|
161
|
+
const y = s.indexOf(".");
|
|
162
|
+
if (y === -1 || !s.replace(".", "").split("")[y + r]) return n;
|
|
163
|
+
const v = s.length;
|
|
164
|
+
return s.charAt(v - 1) === "5" && (s = `${s.slice(0, Math.max(0, v - 1))}6`), Number.parseFloat(Number(s).toFixed(r));
|
|
165
|
+
}, F = (n) => {
|
|
166
|
+
if (fe(n)) return 0;
|
|
167
|
+
const r = n.toString(), s = r.indexOf(".");
|
|
168
|
+
let y = 0;
|
|
169
|
+
return s !== -1 && (y = r.length - s - 1), y;
|
|
170
|
+
}, A = (n, r = 1) => $(n) ? n >= Number.MAX_SAFE_INTEGER && r === 1 ? (ee(
|
|
171
|
+
"InputNumber",
|
|
172
|
+
"The value has reached the maximum safe integer limit."
|
|
173
|
+
), n) : n <= Number.MIN_SAFE_INTEGER && r === -1 ? (ee(
|
|
174
|
+
"InputNumber",
|
|
175
|
+
"The value has reached the minimum safe integer limit."
|
|
176
|
+
), n) : M(n + a.step * r) : o.currentValue, X = (n) => {
|
|
177
|
+
const r = Ge(n), s = at(n);
|
|
178
|
+
if (a.disabledScientific && ["e", "E"].includes(s)) {
|
|
179
|
+
n.preventDefault();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
switch (r) {
|
|
183
|
+
case J.up: {
|
|
184
|
+
n.preventDefault(), B();
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
case J.down: {
|
|
188
|
+
n.preventDefault(), R();
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}, B = () => {
|
|
193
|
+
if (a.readonly || T.value || h.value) return;
|
|
194
|
+
const n = Number(z.value) || 0, r = A(n);
|
|
195
|
+
x(r), d(ne, o.currentValue), G();
|
|
196
|
+
}, R = () => {
|
|
197
|
+
if (a.readonly || T.value || N.value) return;
|
|
198
|
+
const n = Number(z.value) || 0, r = A(n, -1);
|
|
199
|
+
x(r), d(ne, o.currentValue), G();
|
|
200
|
+
}, Y = (n, r) => {
|
|
201
|
+
const { max: s, min: y, step: w, precision: I, stepStrictly: v, valueOnClear: p } = a;
|
|
202
|
+
s < y && je("InputNumber", "min should not be greater than max.");
|
|
203
|
+
let f = Number(n);
|
|
204
|
+
if (fe(n) || Number.isNaN(f))
|
|
205
|
+
return null;
|
|
206
|
+
if (n === "") {
|
|
207
|
+
if (p === null)
|
|
208
|
+
return null;
|
|
209
|
+
f = Pe(p) ? { min: y, max: s }[p] : p;
|
|
210
|
+
}
|
|
211
|
+
return v && (f = M(
|
|
212
|
+
Math.round(M(f / w)) * w,
|
|
213
|
+
I
|
|
214
|
+
), f !== n && r && d(H, f)), Ve(I) || (f = M(f, I)), (f > s || f < y) && (f = f > s ? s : y, r && d(H, f)), f;
|
|
215
|
+
}, x = (n, r = !0) => {
|
|
216
|
+
var s;
|
|
217
|
+
const y = o.currentValue, w = Y(n);
|
|
218
|
+
if (!r) {
|
|
219
|
+
d(H, w);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
o.userInput = null, !(y === w && n) && (d(H, w), y !== w && d(Ne, w, y), a.validateEvent && ((s = i == null ? void 0 : i.validate) == null || s.call(i, "change").catch((I) => ee(I))), o.currentValue = w);
|
|
223
|
+
}, P = (n) => {
|
|
224
|
+
o.userInput = n;
|
|
225
|
+
const r = n === "" ? null : Number(n);
|
|
226
|
+
d(ne, r), x(r, !1);
|
|
227
|
+
}, j = (n) => {
|
|
228
|
+
const r = n !== "" ? Number(n) : "";
|
|
229
|
+
($(r) && !Number.isNaN(r) || n === "") && x(r), G(), o.userInput = null;
|
|
230
|
+
}, m = () => {
|
|
231
|
+
var n, r;
|
|
232
|
+
(r = (n = V.value) == null ? void 0 : n.focus) == null || r.call(n);
|
|
233
|
+
}, E = () => {
|
|
234
|
+
var n, r;
|
|
235
|
+
(r = (n = V.value) == null ? void 0 : n.blur) == null || r.call(n);
|
|
236
|
+
}, L = (n) => {
|
|
237
|
+
d("focus", n);
|
|
238
|
+
}, Z = (n) => {
|
|
239
|
+
var r, s;
|
|
240
|
+
o.userInput = null, o.currentValue === null && ((r = V.value) != null && r.input) && (V.value.input.value = ""), d("blur", n), a.validateEvent && ((s = i == null ? void 0 : i.validate) == null || s.call(i, "blur").catch((y) => ee(y)));
|
|
241
|
+
}, G = () => {
|
|
242
|
+
o.currentValue !== a.modelValue && (o.currentValue = a.modelValue);
|
|
243
|
+
}, _ = (n) => {
|
|
244
|
+
document.activeElement === n.target && n.preventDefault();
|
|
245
|
+
};
|
|
246
|
+
return se(
|
|
247
|
+
() => a.modelValue,
|
|
248
|
+
(n, r) => {
|
|
249
|
+
const s = Y(n, !0);
|
|
250
|
+
o.userInput === null && s !== r && (o.currentValue = s);
|
|
251
|
+
},
|
|
252
|
+
{ immediate: !0 }
|
|
253
|
+
), se(
|
|
254
|
+
() => a.precision,
|
|
255
|
+
() => {
|
|
256
|
+
o.currentValue = Y(a.modelValue);
|
|
257
|
+
}
|
|
258
|
+
), $e(() => {
|
|
259
|
+
var n;
|
|
260
|
+
const { min: r, max: s, modelValue: y } = a, w = (n = V.value) == null ? void 0 : n.input;
|
|
261
|
+
if (w.setAttribute("role", "spinbutton"), Number.isFinite(s) ? w.setAttribute("aria-valuemax", String(s)) : w.removeAttribute("aria-valuemax"), Number.isFinite(r) ? w.setAttribute("aria-valuemin", String(r)) : w.removeAttribute("aria-valuemin"), w.setAttribute(
|
|
262
|
+
"aria-valuenow",
|
|
263
|
+
o.currentValue || o.currentValue === 0 ? String(o.currentValue) : ""
|
|
264
|
+
), w.setAttribute("aria-disabled", String(T.value)), !$(y) && y != null) {
|
|
265
|
+
let I = Number(y);
|
|
266
|
+
Number.isNaN(I) && (I = null), d(H, I);
|
|
267
|
+
}
|
|
268
|
+
w.addEventListener("wheel", _, { passive: !1 });
|
|
269
|
+
}), Qe(() => {
|
|
270
|
+
var n, r;
|
|
271
|
+
const s = (n = V.value) == null ? void 0 : n.input;
|
|
272
|
+
s == null || s.setAttribute("aria-valuenow", `${(r = o.currentValue) != null ? r : ""}`);
|
|
273
|
+
}), l({
|
|
274
|
+
/** @description get focus the input component */
|
|
275
|
+
focus: m,
|
|
276
|
+
/** @description remove focus the input component */
|
|
277
|
+
blur: E
|
|
278
|
+
}), (n, r) => (C(), U(
|
|
279
|
+
"div",
|
|
280
|
+
{
|
|
281
|
+
class: O([
|
|
282
|
+
t(u).b(),
|
|
283
|
+
t(u).m(t(W)),
|
|
284
|
+
t(u).is("disabled", t(T)),
|
|
285
|
+
t(u).is("without-controls", !e.controls),
|
|
286
|
+
t(u).is("controls-right", K.value),
|
|
287
|
+
t(u).is(e.align, !!e.align)
|
|
288
|
+
]),
|
|
289
|
+
onDragstart: r[0] || (r[0] = Ke(() => {
|
|
290
|
+
}, ["prevent"]))
|
|
291
|
+
},
|
|
292
|
+
[
|
|
293
|
+
e.controls ? Le((C(), U("span", {
|
|
294
|
+
key: 0,
|
|
295
|
+
role: "button",
|
|
296
|
+
"aria-label": t(c)("el.inputNumber.decrease"),
|
|
297
|
+
class: O([t(u).e("decrease"), t(u).is("disabled", N.value)]),
|
|
298
|
+
onKeydown: Te(R, ["enter"])
|
|
299
|
+
}, [
|
|
300
|
+
ge(n.$slots, "decrease-icon", {}, () => [
|
|
301
|
+
ve(t(Fe), null, {
|
|
302
|
+
default: ue(() => [
|
|
303
|
+
K.value ? (C(), le(t(it), { key: 0 })) : (C(), le(t(st), { key: 1 }))
|
|
304
|
+
]),
|
|
305
|
+
_: 1
|
|
306
|
+
/* STABLE */
|
|
307
|
+
})
|
|
308
|
+
])
|
|
309
|
+
], 42, ft)), [
|
|
310
|
+
[t(ze), R]
|
|
311
|
+
]) : oe("v-if", !0),
|
|
312
|
+
e.controls ? Le((C(), U("span", {
|
|
313
|
+
key: 1,
|
|
314
|
+
role: "button",
|
|
315
|
+
"aria-label": t(c)("el.inputNumber.increase"),
|
|
316
|
+
class: O([t(u).e("increase"), t(u).is("disabled", h.value)]),
|
|
317
|
+
onKeydown: Te(B, ["enter"])
|
|
318
|
+
}, [
|
|
319
|
+
ge(n.$slots, "increase-icon", {}, () => [
|
|
320
|
+
ve(t(Fe), null, {
|
|
321
|
+
default: ue(() => [
|
|
322
|
+
K.value ? (C(), le(t(dt), { key: 0 })) : (C(), le(t(ct), { key: 1 }))
|
|
323
|
+
]),
|
|
324
|
+
_: 1
|
|
325
|
+
/* STABLE */
|
|
326
|
+
})
|
|
327
|
+
])
|
|
328
|
+
], 42, bt)), [
|
|
329
|
+
[t(ze), B]
|
|
330
|
+
]) : oe("v-if", !0),
|
|
331
|
+
ve(t(nt), {
|
|
332
|
+
id: e.id,
|
|
333
|
+
ref_key: "input",
|
|
334
|
+
ref: V,
|
|
335
|
+
type: "number",
|
|
336
|
+
step: e.step,
|
|
337
|
+
"model-value": z.value,
|
|
338
|
+
placeholder: e.placeholder,
|
|
339
|
+
readonly: e.readonly,
|
|
340
|
+
disabled: t(T),
|
|
341
|
+
size: t(W),
|
|
342
|
+
max: e.max,
|
|
343
|
+
min: e.min,
|
|
344
|
+
name: e.name,
|
|
345
|
+
"aria-label": e.ariaLabel,
|
|
346
|
+
"validate-event": !1,
|
|
347
|
+
inputmode: e.inputmode,
|
|
348
|
+
onKeydown: X,
|
|
349
|
+
onBlur: Z,
|
|
350
|
+
onFocus: L,
|
|
351
|
+
onInput: P,
|
|
352
|
+
onChange: j
|
|
353
|
+
}, Ze({
|
|
354
|
+
_: 2
|
|
355
|
+
/* DYNAMIC */
|
|
356
|
+
}, [
|
|
357
|
+
n.$slots.prefix ? {
|
|
358
|
+
name: "prefix",
|
|
359
|
+
fn: ue(() => [
|
|
360
|
+
ge(n.$slots, "prefix")
|
|
361
|
+
]),
|
|
362
|
+
key: "0"
|
|
363
|
+
} : void 0,
|
|
364
|
+
n.$slots.suffix ? {
|
|
365
|
+
name: "suffix",
|
|
366
|
+
fn: ue(() => [
|
|
367
|
+
ge(n.$slots, "suffix")
|
|
368
|
+
]),
|
|
369
|
+
key: "1"
|
|
370
|
+
} : void 0
|
|
371
|
+
]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "inputmode"])
|
|
372
|
+
],
|
|
373
|
+
34
|
|
374
|
+
/* CLASS, NEED_HYDRATION */
|
|
375
|
+
));
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
const ht = qe(gt), Je = /* @__PURE__ */ Symbol("sliderContextKey"), Vt = pe({
|
|
379
|
+
/**
|
|
380
|
+
* @description binding value
|
|
381
|
+
*/
|
|
382
|
+
modelValue: {
|
|
383
|
+
type: te([Number, Array]),
|
|
384
|
+
default: 0
|
|
385
|
+
},
|
|
386
|
+
id: {
|
|
387
|
+
type: String,
|
|
388
|
+
default: void 0
|
|
389
|
+
},
|
|
390
|
+
/**
|
|
391
|
+
* @description minimum value
|
|
392
|
+
*/
|
|
393
|
+
min: {
|
|
394
|
+
type: Number,
|
|
395
|
+
default: 0
|
|
396
|
+
},
|
|
397
|
+
/**
|
|
398
|
+
* @description maximum value
|
|
399
|
+
*/
|
|
400
|
+
max: {
|
|
401
|
+
type: Number,
|
|
402
|
+
default: 100
|
|
403
|
+
},
|
|
404
|
+
/**
|
|
405
|
+
* @description step size
|
|
406
|
+
*/
|
|
407
|
+
step: {
|
|
408
|
+
type: Number,
|
|
409
|
+
default: 1
|
|
410
|
+
},
|
|
411
|
+
/**
|
|
412
|
+
* @description whether to display an input box, works when `range` is false
|
|
413
|
+
*/
|
|
414
|
+
showInput: Boolean,
|
|
415
|
+
/**
|
|
416
|
+
* @description whether to display control buttons when `show-input` is true
|
|
417
|
+
*/
|
|
418
|
+
showInputControls: {
|
|
419
|
+
type: Boolean,
|
|
420
|
+
default: !0
|
|
421
|
+
},
|
|
422
|
+
/**
|
|
423
|
+
* @description size of the slider wrapper, will not work in vertical mode
|
|
424
|
+
*/
|
|
425
|
+
size: Ie,
|
|
426
|
+
/**
|
|
427
|
+
* @description size of the input box, when set `size`, the default is the value of `size`
|
|
428
|
+
*/
|
|
429
|
+
inputSize: Ie,
|
|
430
|
+
/**
|
|
431
|
+
* @description whether to display breakpoints
|
|
432
|
+
*/
|
|
433
|
+
showStops: Boolean,
|
|
434
|
+
/**
|
|
435
|
+
* @description whether to display tooltip value
|
|
436
|
+
*/
|
|
437
|
+
showTooltip: {
|
|
438
|
+
type: Boolean,
|
|
439
|
+
default: !0
|
|
440
|
+
},
|
|
441
|
+
/**
|
|
442
|
+
* @description format to display tooltip value
|
|
443
|
+
*/
|
|
444
|
+
formatTooltip: {
|
|
445
|
+
type: te(Function),
|
|
446
|
+
default: void 0
|
|
447
|
+
},
|
|
448
|
+
/**
|
|
449
|
+
* @description whether Slider is disabled
|
|
450
|
+
*/
|
|
451
|
+
disabled: {
|
|
452
|
+
type: Boolean,
|
|
453
|
+
default: void 0
|
|
454
|
+
},
|
|
455
|
+
/**
|
|
456
|
+
* @description whether to select a range
|
|
457
|
+
*/
|
|
458
|
+
range: Boolean,
|
|
459
|
+
/**
|
|
460
|
+
* @description vertical mode
|
|
461
|
+
*/
|
|
462
|
+
vertical: Boolean,
|
|
463
|
+
/**
|
|
464
|
+
* @description slider height, required in vertical mode
|
|
465
|
+
*/
|
|
466
|
+
height: String,
|
|
467
|
+
/**
|
|
468
|
+
* @description when `range` is true, screen reader label for the start of the range
|
|
469
|
+
*/
|
|
470
|
+
rangeStartLabel: {
|
|
471
|
+
type: String,
|
|
472
|
+
default: void 0
|
|
473
|
+
},
|
|
474
|
+
/**
|
|
475
|
+
* @description when `range` is true, screen reader label for the end of the range
|
|
476
|
+
*/
|
|
477
|
+
rangeEndLabel: {
|
|
478
|
+
type: String,
|
|
479
|
+
default: void 0
|
|
480
|
+
},
|
|
481
|
+
/**
|
|
482
|
+
* @description format to display the `aria-valuenow` attribute for screen readers
|
|
483
|
+
*/
|
|
484
|
+
formatValueText: {
|
|
485
|
+
type: te(Function),
|
|
486
|
+
default: void 0
|
|
487
|
+
},
|
|
488
|
+
/**
|
|
489
|
+
* @description custom class name for the tooltip
|
|
490
|
+
*/
|
|
491
|
+
tooltipClass: {
|
|
492
|
+
type: String,
|
|
493
|
+
default: void 0
|
|
494
|
+
},
|
|
495
|
+
/**
|
|
496
|
+
* @description position of Tooltip
|
|
497
|
+
*/
|
|
498
|
+
placement: {
|
|
499
|
+
type: String,
|
|
500
|
+
values: He,
|
|
501
|
+
default: "top"
|
|
502
|
+
},
|
|
503
|
+
/**
|
|
504
|
+
* @description marks, type of key must be `number` and must in closed interval `[min, max]`, each mark can custom style
|
|
505
|
+
*/
|
|
506
|
+
marks: {
|
|
507
|
+
type: te(Object)
|
|
508
|
+
},
|
|
509
|
+
/**
|
|
510
|
+
* @description whether to trigger form validation
|
|
511
|
+
*/
|
|
512
|
+
validateEvent: {
|
|
513
|
+
type: Boolean,
|
|
514
|
+
default: !0
|
|
515
|
+
},
|
|
516
|
+
/**
|
|
517
|
+
* @description when slider tooltip inactive and `persistent` is `false` , popconfirm will be destroyed. `persistent` always be `false` when `show-tooltip ` is `false`
|
|
518
|
+
*/
|
|
519
|
+
persistent: {
|
|
520
|
+
type: Boolean,
|
|
521
|
+
default: !0
|
|
522
|
+
},
|
|
523
|
+
...Xe(["ariaLabel"])
|
|
524
|
+
}), xe = (e) => $(e) || be(e) && e.every($), yt = {
|
|
525
|
+
[H]: xe,
|
|
526
|
+
[ne]: xe,
|
|
527
|
+
[Ne]: xe
|
|
528
|
+
}, wt = pe({
|
|
529
|
+
modelValue: {
|
|
530
|
+
type: Number,
|
|
531
|
+
default: 0
|
|
532
|
+
},
|
|
533
|
+
vertical: Boolean,
|
|
534
|
+
tooltipClass: String,
|
|
535
|
+
placement: {
|
|
536
|
+
type: String,
|
|
537
|
+
values: He,
|
|
538
|
+
default: "top"
|
|
539
|
+
}
|
|
540
|
+
}), St = {
|
|
541
|
+
[H]: (e) => $(e)
|
|
542
|
+
}, pt = (e, l, g) => {
|
|
543
|
+
const a = ae(), d = ae(!1), c = S(() => l.value instanceof Function), u = S(() => c.value && l.value(e.modelValue) || e.modelValue), V = Ae(() => {
|
|
544
|
+
g.value && (d.value = !0);
|
|
545
|
+
}, 50), o = Ae(() => {
|
|
546
|
+
g.value && (d.value = !1);
|
|
547
|
+
}, 50);
|
|
548
|
+
return {
|
|
549
|
+
tooltip: a,
|
|
550
|
+
tooltipVisible: d,
|
|
551
|
+
formatValue: u,
|
|
552
|
+
displayTooltip: V,
|
|
553
|
+
hideTooltip: o
|
|
554
|
+
};
|
|
555
|
+
}, Nt = (e, l, g) => {
|
|
556
|
+
const {
|
|
557
|
+
disabled: a,
|
|
558
|
+
min: d,
|
|
559
|
+
max: c,
|
|
560
|
+
step: u,
|
|
561
|
+
showTooltip: V,
|
|
562
|
+
persistent: o,
|
|
563
|
+
precision: i,
|
|
564
|
+
sliderSize: N,
|
|
565
|
+
formatTooltip: h,
|
|
566
|
+
emitChange: k,
|
|
567
|
+
resetSize: K,
|
|
568
|
+
updateDragging: W
|
|
569
|
+
} = _e(Je), { tooltip: T, tooltipVisible: z, formatValue: M, displayTooltip: F, hideTooltip: A } = pt(e, h, V), X = ae(), B = S(() => `${(e.modelValue - d.value) / (c.value - d.value) * 100}%`), R = S(() => e.vertical ? { bottom: B.value } : { left: B.value }), Y = () => {
|
|
570
|
+
l.hovering = !0, F();
|
|
571
|
+
}, x = () => {
|
|
572
|
+
l.hovering = !1, l.dragging || A();
|
|
573
|
+
}, P = (v) => {
|
|
574
|
+
a.value || (v.preventDefault(), s(v), window.addEventListener("mousemove", y), window.addEventListener("touchmove", y), window.addEventListener("mouseup", w), window.addEventListener("touchend", w), window.addEventListener("contextmenu", w), X.value.focus());
|
|
575
|
+
}, j = (v) => {
|
|
576
|
+
a.value || (l.newPosition = Number.parseFloat(B.value) + v / (c.value - d.value) * 100, I(l.newPosition), k());
|
|
577
|
+
}, m = () => {
|
|
578
|
+
j(-u.value);
|
|
579
|
+
}, E = () => {
|
|
580
|
+
j(u.value);
|
|
581
|
+
}, L = () => {
|
|
582
|
+
j(-u.value * 4);
|
|
583
|
+
}, Z = () => {
|
|
584
|
+
j(u.value * 4);
|
|
585
|
+
}, G = () => {
|
|
586
|
+
a.value || (I(0), k());
|
|
587
|
+
}, _ = () => {
|
|
588
|
+
a.value || (I(100), k());
|
|
589
|
+
}, n = (v) => {
|
|
590
|
+
const p = Ge(v);
|
|
591
|
+
let f = !0;
|
|
592
|
+
switch (p) {
|
|
593
|
+
case J.left:
|
|
594
|
+
case J.down:
|
|
595
|
+
m();
|
|
596
|
+
break;
|
|
597
|
+
case J.right:
|
|
598
|
+
case J.up:
|
|
599
|
+
E();
|
|
600
|
+
break;
|
|
601
|
+
case J.home:
|
|
602
|
+
G();
|
|
603
|
+
break;
|
|
604
|
+
case J.end:
|
|
605
|
+
_();
|
|
606
|
+
break;
|
|
607
|
+
case J.pageDown:
|
|
608
|
+
L();
|
|
609
|
+
break;
|
|
610
|
+
case J.pageUp:
|
|
611
|
+
Z();
|
|
612
|
+
break;
|
|
613
|
+
default:
|
|
614
|
+
f = !1;
|
|
615
|
+
break;
|
|
616
|
+
}
|
|
617
|
+
f && v.preventDefault();
|
|
618
|
+
}, r = (v) => {
|
|
619
|
+
let p, f;
|
|
620
|
+
return v.type.startsWith("touch") ? (f = v.touches[0].clientY, p = v.touches[0].clientX) : (f = v.clientY, p = v.clientX), {
|
|
621
|
+
clientX: p,
|
|
622
|
+
clientY: f
|
|
623
|
+
};
|
|
624
|
+
}, s = (v) => {
|
|
625
|
+
l.dragging = !0, l.isClick = !0;
|
|
626
|
+
const { clientX: p, clientY: f } = r(v);
|
|
627
|
+
e.vertical ? l.startY = f : l.startX = p, l.startPosition = Number.parseFloat(B.value), l.newPosition = l.startPosition;
|
|
628
|
+
}, y = (v) => {
|
|
629
|
+
if (l.dragging) {
|
|
630
|
+
l.isClick = !1, F(), K();
|
|
631
|
+
let p;
|
|
632
|
+
const { clientX: f, clientY: de } = r(v);
|
|
633
|
+
e.vertical ? (l.currentY = de, p = (l.startY - l.currentY) / N.value * 100) : (l.currentX = f, p = (l.currentX - l.startX) / N.value * 100), l.newPosition = l.startPosition + p, I(l.newPosition);
|
|
634
|
+
}
|
|
635
|
+
}, w = () => {
|
|
636
|
+
l.dragging && (setTimeout(() => {
|
|
637
|
+
l.dragging = !1, l.hovering || A(), l.isClick || I(l.newPosition), k();
|
|
638
|
+
}, 0), window.removeEventListener("mousemove", y), window.removeEventListener("touchmove", y), window.removeEventListener("mouseup", w), window.removeEventListener("touchend", w), window.removeEventListener("contextmenu", w));
|
|
639
|
+
}, I = async (v) => {
|
|
640
|
+
if (v === null || Number.isNaN(+v)) return;
|
|
641
|
+
v = rt(v, 0, 100);
|
|
642
|
+
const p = Math.floor((c.value - d.value) / u.value), f = p * u.value / (c.value - d.value) * 100, de = f + (100 - f) / 2;
|
|
643
|
+
let Q;
|
|
644
|
+
if (v < f) {
|
|
645
|
+
const b = f / p, D = Math.round(v / b);
|
|
646
|
+
Q = d.value + D * u.value;
|
|
647
|
+
} else v < de ? Q = d.value + p * u.value : Q = c.value;
|
|
648
|
+
Q = Number.parseFloat(Q.toFixed(i.value)), Q !== e.modelValue && g(H, Q), !l.dragging && e.modelValue !== l.oldValue && (l.oldValue = e.modelValue), await ye(), l.dragging && F(), T.value.updatePopper();
|
|
649
|
+
};
|
|
650
|
+
return se(
|
|
651
|
+
() => l.dragging,
|
|
652
|
+
(v) => {
|
|
653
|
+
W(v);
|
|
654
|
+
}
|
|
655
|
+
), we(X, "touchstart", P, { passive: !1 }), {
|
|
656
|
+
disabled: a,
|
|
657
|
+
button: X,
|
|
658
|
+
tooltip: T,
|
|
659
|
+
tooltipVisible: z,
|
|
660
|
+
showTooltip: V,
|
|
661
|
+
persistent: o,
|
|
662
|
+
wrapperStyle: R,
|
|
663
|
+
formatValue: M,
|
|
664
|
+
handleMouseEnter: Y,
|
|
665
|
+
handleMouseLeave: x,
|
|
666
|
+
onButtonDown: P,
|
|
667
|
+
onKeyDown: n,
|
|
668
|
+
setPosition: I
|
|
669
|
+
};
|
|
670
|
+
}, Et = ["tabindex"];
|
|
671
|
+
var Re = /* @__PURE__ */ Se({
|
|
672
|
+
name: "ElSliderButton",
|
|
673
|
+
__name: "button",
|
|
674
|
+
props: wt,
|
|
675
|
+
emits: St,
|
|
676
|
+
setup(e, { expose: l, emit: g }) {
|
|
677
|
+
const a = e, d = g, c = Ee("slider"), u = Ce({
|
|
678
|
+
hovering: !1,
|
|
679
|
+
dragging: !1,
|
|
680
|
+
isClick: !1,
|
|
681
|
+
startX: 0,
|
|
682
|
+
currentX: 0,
|
|
683
|
+
startY: 0,
|
|
684
|
+
currentY: 0,
|
|
685
|
+
startPosition: 0,
|
|
686
|
+
newPosition: 0,
|
|
687
|
+
oldValue: a.modelValue
|
|
688
|
+
}), V = S(
|
|
689
|
+
() => h.value ? k.value : !1
|
|
690
|
+
), {
|
|
691
|
+
disabled: o,
|
|
692
|
+
button: i,
|
|
693
|
+
tooltip: N,
|
|
694
|
+
showTooltip: h,
|
|
695
|
+
persistent: k,
|
|
696
|
+
tooltipVisible: K,
|
|
697
|
+
wrapperStyle: W,
|
|
698
|
+
formatValue: T,
|
|
699
|
+
handleMouseEnter: z,
|
|
700
|
+
handleMouseLeave: M,
|
|
701
|
+
onButtonDown: F,
|
|
702
|
+
onKeyDown: A,
|
|
703
|
+
setPosition: X
|
|
704
|
+
} = Nt(a, u, d), { hovering: B, dragging: R } = Be(u);
|
|
705
|
+
return l({
|
|
706
|
+
onButtonDown: F,
|
|
707
|
+
onKeyDown: A,
|
|
708
|
+
setPosition: X,
|
|
709
|
+
hovering: B,
|
|
710
|
+
dragging: R
|
|
711
|
+
}), (Y, x) => (C(), U("div", {
|
|
712
|
+
ref_key: "button",
|
|
713
|
+
ref: i,
|
|
714
|
+
class: O([t(c).e("button-wrapper"), { hover: t(B), dragging: t(R) }]),
|
|
715
|
+
style: re(t(W)),
|
|
716
|
+
tabindex: t(o) ? void 0 : 0,
|
|
717
|
+
onMouseenter: x[0] || (x[0] = //@ts-ignore
|
|
718
|
+
(...P) => t(z) && t(z)(...P)),
|
|
719
|
+
onMouseleave: x[1] || (x[1] = //@ts-ignore
|
|
720
|
+
(...P) => t(M) && t(M)(...P)),
|
|
721
|
+
onMousedown: x[2] || (x[2] = //@ts-ignore
|
|
722
|
+
(...P) => t(F) && t(F)(...P)),
|
|
723
|
+
onFocus: x[3] || (x[3] = //@ts-ignore
|
|
724
|
+
(...P) => t(z) && t(z)(...P)),
|
|
725
|
+
onBlur: x[4] || (x[4] = //@ts-ignore
|
|
726
|
+
(...P) => t(M) && t(M)(...P)),
|
|
727
|
+
onKeydown: x[5] || (x[5] = //@ts-ignore
|
|
728
|
+
(...P) => t(A) && t(A)(...P))
|
|
729
|
+
}, [
|
|
730
|
+
ve(t(ot), {
|
|
731
|
+
ref_key: "tooltip",
|
|
732
|
+
ref: N,
|
|
733
|
+
visible: t(K),
|
|
734
|
+
placement: Y.placement,
|
|
735
|
+
"fallback-placements": ["top", "bottom", "right", "left"],
|
|
736
|
+
"stop-popper-mouse-event": !1,
|
|
737
|
+
"popper-class": Y.tooltipClass,
|
|
738
|
+
disabled: !t(h),
|
|
739
|
+
persistent: V.value
|
|
740
|
+
}, {
|
|
741
|
+
content: ue(() => [
|
|
742
|
+
ie(
|
|
743
|
+
"span",
|
|
744
|
+
null,
|
|
745
|
+
De(t(T)),
|
|
746
|
+
1
|
|
747
|
+
/* TEXT */
|
|
748
|
+
)
|
|
749
|
+
]),
|
|
750
|
+
default: ue(() => [
|
|
751
|
+
ie(
|
|
752
|
+
"div",
|
|
753
|
+
{
|
|
754
|
+
class: O([t(c).e("button"), { hover: t(B), dragging: t(R) }])
|
|
755
|
+
},
|
|
756
|
+
null,
|
|
757
|
+
2
|
|
758
|
+
/* CLASS */
|
|
759
|
+
)
|
|
760
|
+
]),
|
|
761
|
+
_: 1
|
|
762
|
+
/* STABLE */
|
|
763
|
+
}, 8, ["visible", "placement", "popper-class", "disabled", "persistent"])
|
|
764
|
+
], 46, Et));
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
const kt = pe({
|
|
768
|
+
mark: {
|
|
769
|
+
type: te([String, Object]),
|
|
770
|
+
default: void 0
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
var xt = Se({
|
|
774
|
+
name: "ElSliderMarker",
|
|
775
|
+
props: kt,
|
|
776
|
+
setup(e) {
|
|
777
|
+
const l = Ee("slider"), g = S(() => Pe(e.mark) ? e.mark : e.mark.label), a = S(
|
|
778
|
+
() => Pe(e.mark) ? void 0 : e.mark.style
|
|
779
|
+
);
|
|
780
|
+
return () => et(
|
|
781
|
+
"div",
|
|
782
|
+
{
|
|
783
|
+
class: l.e("marks-text"),
|
|
784
|
+
style: a.value
|
|
785
|
+
},
|
|
786
|
+
g.value
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
});
|
|
790
|
+
const Bt = (e, l, g) => {
|
|
791
|
+
const { formItem: a } = Ue(), d = tt(), c = ae(), u = ae(), V = {
|
|
792
|
+
firstButton: c,
|
|
793
|
+
secondButton: u
|
|
794
|
+
}, o = We(), i = S(() => Math.min(l.firstValue, l.secondValue)), N = S(() => Math.max(l.firstValue, l.secondValue)), h = S(() => e.range ? `${100 * (N.value - i.value) / (e.max - e.min)}%` : `${100 * (l.firstValue - e.min) / (e.max - e.min)}%`), k = S(() => e.range ? `${100 * (i.value - e.min) / (e.max - e.min)}%` : "0%"), K = S(() => e.vertical ? { height: e.height } : {}), W = S(() => e.vertical ? {
|
|
795
|
+
height: h.value,
|
|
796
|
+
bottom: k.value
|
|
797
|
+
} : {
|
|
798
|
+
width: h.value,
|
|
799
|
+
left: k.value
|
|
800
|
+
}), T = () => {
|
|
801
|
+
if (d.value) {
|
|
802
|
+
const m = d.value.getBoundingClientRect();
|
|
803
|
+
l.sliderSize = m[e.vertical ? "height" : "width"];
|
|
804
|
+
}
|
|
805
|
+
}, z = (m) => {
|
|
806
|
+
const E = e.min + m * (e.max - e.min) / 100;
|
|
807
|
+
if (!e.range)
|
|
808
|
+
return c;
|
|
809
|
+
let L;
|
|
810
|
+
return Math.abs(i.value - E) < Math.abs(N.value - E) ? L = l.firstValue < l.secondValue ? "firstButton" : "secondButton" : L = l.firstValue > l.secondValue ? "firstButton" : "secondButton", V[L];
|
|
811
|
+
}, M = (m) => {
|
|
812
|
+
const E = z(m);
|
|
813
|
+
return E.value.setPosition(m), E;
|
|
814
|
+
}, F = (m) => {
|
|
815
|
+
l.firstValue = m ?? e.min, X(
|
|
816
|
+
e.range ? [i.value, N.value] : m ?? e.min
|
|
817
|
+
);
|
|
818
|
+
}, A = (m) => {
|
|
819
|
+
l.secondValue = m, e.range && X([i.value, N.value]);
|
|
820
|
+
}, X = (m) => {
|
|
821
|
+
g(H, m), g(ne, m);
|
|
822
|
+
}, B = async () => {
|
|
823
|
+
await ye(), g(
|
|
824
|
+
Ne,
|
|
825
|
+
e.range ? [i.value, N.value] : e.modelValue
|
|
826
|
+
);
|
|
827
|
+
}, R = (m) => {
|
|
828
|
+
var E, L, Z, G, _, n;
|
|
829
|
+
if (o.value || l.dragging) return;
|
|
830
|
+
T();
|
|
831
|
+
let r = 0;
|
|
832
|
+
if (e.vertical) {
|
|
833
|
+
const s = (Z = (L = (E = m.touches) == null ? void 0 : E.item(0)) == null ? void 0 : L.clientY) != null ? Z : m.clientY;
|
|
834
|
+
r = (d.value.getBoundingClientRect().bottom - s) / l.sliderSize * 100;
|
|
835
|
+
} else {
|
|
836
|
+
const s = (n = (_ = (G = m.touches) == null ? void 0 : G.item(0)) == null ? void 0 : _.clientX) != null ? n : m.clientX, y = d.value.getBoundingClientRect().left;
|
|
837
|
+
r = (s - y) / l.sliderSize * 100;
|
|
838
|
+
}
|
|
839
|
+
if (!(r < 0 || r > 100))
|
|
840
|
+
return M(r);
|
|
841
|
+
};
|
|
842
|
+
return {
|
|
843
|
+
elFormItem: a,
|
|
844
|
+
slider: d,
|
|
845
|
+
firstButton: c,
|
|
846
|
+
secondButton: u,
|
|
847
|
+
sliderDisabled: o,
|
|
848
|
+
minValue: i,
|
|
849
|
+
maxValue: N,
|
|
850
|
+
runwayStyle: K,
|
|
851
|
+
barStyle: W,
|
|
852
|
+
resetSize: T,
|
|
853
|
+
setPosition: M,
|
|
854
|
+
emitChange: B,
|
|
855
|
+
onSliderWrapperPrevent: (m) => {
|
|
856
|
+
var E, L;
|
|
857
|
+
((E = V.firstButton.value) != null && E.dragging || (L = V.secondButton.value) != null && L.dragging) && m.preventDefault();
|
|
858
|
+
},
|
|
859
|
+
onSliderClick: (m) => {
|
|
860
|
+
R(m) && B();
|
|
861
|
+
},
|
|
862
|
+
onSliderDown: async (m) => {
|
|
863
|
+
const E = R(m);
|
|
864
|
+
E && (await ye(), E.value.onButtonDown(m));
|
|
865
|
+
},
|
|
866
|
+
onSliderMarkerDown: (m) => {
|
|
867
|
+
if (o.value || l.dragging) return;
|
|
868
|
+
M(m) && B();
|
|
869
|
+
},
|
|
870
|
+
setFirstValue: F,
|
|
871
|
+
setSecondValue: A
|
|
872
|
+
};
|
|
873
|
+
}, It = (e, l, g, a) => ({
|
|
874
|
+
stops: S(() => {
|
|
875
|
+
if (!e.showStops || e.min > e.max) return [];
|
|
876
|
+
if (e.step === 0)
|
|
877
|
+
return ee("ElSlider", "step should not be 0."), [];
|
|
878
|
+
const u = Math.ceil((e.max - e.min) / e.step), V = 100 * e.step / (e.max - e.min), o = Array.from({ length: u - 1 }).map(
|
|
879
|
+
(i, N) => (N + 1) * V
|
|
880
|
+
);
|
|
881
|
+
return e.range ? o.filter((i) => i < 100 * (g.value - e.min) / (e.max - e.min) || i > 100 * (a.value - e.min) / (e.max - e.min)) : o.filter(
|
|
882
|
+
(i) => i > 100 * (l.firstValue - e.min) / (e.max - e.min)
|
|
883
|
+
);
|
|
884
|
+
}),
|
|
885
|
+
getStopStyle: (u) => e.vertical ? { bottom: `${u}%` } : { left: `${u}%` }
|
|
886
|
+
}), Pt = (e) => S(() => e.marks ? Object.keys(e.marks).map(Number.parseFloat).sort((g, a) => g - a).filter((g) => g <= e.max && g >= e.min).map(
|
|
887
|
+
(g) => ({
|
|
888
|
+
point: g,
|
|
889
|
+
position: (g - e.min) * 100 / (e.max - e.min),
|
|
890
|
+
mark: e.marks[g]
|
|
891
|
+
})
|
|
892
|
+
) : []), Ct = (e, l, g, a, d, c) => {
|
|
893
|
+
const u = (i) => {
|
|
894
|
+
d(H, i), d(ne, i);
|
|
895
|
+
}, V = () => e.range ? ![g.value, a.value].every(
|
|
896
|
+
(i, N) => i === l.oldValue[N]
|
|
897
|
+
) : e.modelValue !== l.oldValue, o = () => {
|
|
898
|
+
var i, N;
|
|
899
|
+
e.min > e.max && je("Slider", "min should not be greater than max.");
|
|
900
|
+
const h = e.modelValue;
|
|
901
|
+
e.range && be(h) ? h[1] < e.min ? u([e.min, e.min]) : h[0] > e.max ? u([e.max, e.max]) : h[0] < e.min ? u([e.min, h[1]]) : h[1] > e.max ? u([h[0], e.max]) : (l.firstValue = h[0], l.secondValue = h[1], V() && (e.validateEvent && ((i = c == null ? void 0 : c.validate) == null || i.call(c, "change").catch((k) => ee(k))), l.oldValue = h.slice())) : !e.range && $(h) && !Number.isNaN(h) && (h < e.min ? u(e.min) : h > e.max ? u(e.max) : (l.firstValue = h, V() && (e.validateEvent && ((N = c == null ? void 0 : c.validate) == null || N.call(c, "change").catch((k) => ee(k))), l.oldValue = h)));
|
|
902
|
+
};
|
|
903
|
+
o(), se(
|
|
904
|
+
() => l.dragging,
|
|
905
|
+
(i) => {
|
|
906
|
+
i || o();
|
|
907
|
+
}
|
|
908
|
+
), se(
|
|
909
|
+
() => e.modelValue,
|
|
910
|
+
(i, N) => {
|
|
911
|
+
l.dragging || be(i) && be(N) && i.every((h, k) => h === N[k]) && l.firstValue === i[0] && l.secondValue === i[1] || o();
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
deep: !0
|
|
915
|
+
}
|
|
916
|
+
), se(
|
|
917
|
+
() => [e.min, e.max],
|
|
918
|
+
() => {
|
|
919
|
+
o();
|
|
920
|
+
}
|
|
921
|
+
);
|
|
922
|
+
}, Mt = (e, l, g) => {
|
|
923
|
+
const a = ae();
|
|
924
|
+
return $e(async () => {
|
|
925
|
+
e.range ? (be(e.modelValue) ? (l.firstValue = Math.max(e.min, e.modelValue[0]), l.secondValue = Math.min(e.max, e.modelValue[1])) : (l.firstValue = e.min, l.secondValue = e.max), l.oldValue = [l.firstValue, l.secondValue]) : (!$(e.modelValue) || Number.isNaN(e.modelValue) ? l.firstValue = e.min : l.firstValue = Math.min(
|
|
926
|
+
e.max,
|
|
927
|
+
Math.max(e.min, e.modelValue)
|
|
928
|
+
), l.oldValue = l.firstValue), we(window, "resize", g), await ye(), g();
|
|
929
|
+
}), {
|
|
930
|
+
sliderWrapper: a
|
|
931
|
+
};
|
|
932
|
+
}, Lt = ["id", "role", "aria-label", "aria-labelledby"], Tt = { key: 1 };
|
|
933
|
+
var Ft = /* @__PURE__ */ Se({
|
|
934
|
+
name: "ElSlider",
|
|
935
|
+
__name: "slider",
|
|
936
|
+
props: Vt,
|
|
937
|
+
emits: yt,
|
|
938
|
+
setup(e, { expose: l, emit: g }) {
|
|
939
|
+
const a = e, d = g, c = Ee("slider"), { t: u } = Ye(), V = Ce({
|
|
940
|
+
firstValue: 0,
|
|
941
|
+
secondValue: 0,
|
|
942
|
+
oldValue: 0,
|
|
943
|
+
dragging: !1,
|
|
944
|
+
sliderSize: 1
|
|
945
|
+
}), {
|
|
946
|
+
elFormItem: o,
|
|
947
|
+
slider: i,
|
|
948
|
+
firstButton: N,
|
|
949
|
+
secondButton: h,
|
|
950
|
+
sliderDisabled: k,
|
|
951
|
+
minValue: K,
|
|
952
|
+
maxValue: W,
|
|
953
|
+
runwayStyle: T,
|
|
954
|
+
barStyle: z,
|
|
955
|
+
resetSize: M,
|
|
956
|
+
emitChange: F,
|
|
957
|
+
onSliderWrapperPrevent: A,
|
|
958
|
+
onSliderClick: X,
|
|
959
|
+
onSliderDown: B,
|
|
960
|
+
onSliderMarkerDown: R,
|
|
961
|
+
setFirstValue: Y,
|
|
962
|
+
setSecondValue: x
|
|
963
|
+
} = Bt(a, V, d), { stops: P, getStopStyle: j } = It(a, V, K, W), { inputId: m, isLabeledByFormItem: E } = ut(a, {
|
|
964
|
+
formItemContext: o
|
|
965
|
+
}), L = Oe(), Z = S(
|
|
966
|
+
() => a.inputSize || L.value
|
|
967
|
+
), G = S(() => a.ariaLabel || u("el.slider.defaultLabel", {
|
|
968
|
+
min: a.min,
|
|
969
|
+
max: a.max
|
|
970
|
+
})), _ = S(() => a.range ? a.rangeStartLabel || u("el.slider.defaultRangeStartLabel") : G.value), n = S(() => a.formatValueText ? a.formatValueText(p.value) : `${p.value}`), r = S(() => a.rangeEndLabel || u("el.slider.defaultRangeEndLabel")), s = S(() => a.formatValueText ? a.formatValueText(f.value) : `${f.value}`), y = S(() => [
|
|
971
|
+
c.b(),
|
|
972
|
+
c.m(L.value),
|
|
973
|
+
c.is("vertical", a.vertical),
|
|
974
|
+
{ [c.m("with-input")]: a.showInput }
|
|
975
|
+
]), w = Pt(a);
|
|
976
|
+
Ct(a, V, K, W, d, o);
|
|
977
|
+
const I = S(() => {
|
|
978
|
+
const b = [a.min, a.max, a.step].map((D) => {
|
|
979
|
+
const ce = `${D}`.split(".")[1];
|
|
980
|
+
return ce ? ce.length : 0;
|
|
981
|
+
});
|
|
982
|
+
return Math.max.apply(null, b);
|
|
983
|
+
}), { sliderWrapper: v } = Mt(a, V, M), { firstValue: p, secondValue: f, sliderSize: de } = Be(V), Q = (b) => {
|
|
984
|
+
V.dragging = b;
|
|
985
|
+
};
|
|
986
|
+
return we(v, "touchstart", A, {
|
|
987
|
+
passive: !1
|
|
988
|
+
}), we(v, "touchmove", A, {
|
|
989
|
+
passive: !1
|
|
990
|
+
}), lt(Je, {
|
|
991
|
+
...Be(a),
|
|
992
|
+
sliderSize: de,
|
|
993
|
+
disabled: k,
|
|
994
|
+
precision: I,
|
|
995
|
+
emitChange: F,
|
|
996
|
+
resetSize: M,
|
|
997
|
+
updateDragging: Q
|
|
998
|
+
}), l({
|
|
999
|
+
onSliderClick: X
|
|
1000
|
+
}), (b, D) => {
|
|
1001
|
+
var ce, Me;
|
|
1002
|
+
return C(), U("div", {
|
|
1003
|
+
id: b.range ? t(m) : void 0,
|
|
1004
|
+
ref_key: "sliderWrapper",
|
|
1005
|
+
ref: v,
|
|
1006
|
+
class: O(y.value),
|
|
1007
|
+
role: b.range ? "group" : void 0,
|
|
1008
|
+
"aria-label": b.range && !t(E) ? G.value : void 0,
|
|
1009
|
+
"aria-labelledby": b.range && t(E) ? (ce = t(o)) == null ? void 0 : ce.labelId : void 0
|
|
1010
|
+
}, [
|
|
1011
|
+
ie(
|
|
1012
|
+
"div",
|
|
1013
|
+
{
|
|
1014
|
+
ref_key: "slider",
|
|
1015
|
+
ref: i,
|
|
1016
|
+
class: O([
|
|
1017
|
+
t(c).e("runway"),
|
|
1018
|
+
{ "show-input": b.showInput && !b.range },
|
|
1019
|
+
t(c).is("disabled", t(k))
|
|
1020
|
+
]),
|
|
1021
|
+
style: re(t(T)),
|
|
1022
|
+
onMousedown: D[0] || (D[0] = //@ts-ignore
|
|
1023
|
+
(...q) => t(B) && t(B)(...q)),
|
|
1024
|
+
onTouchstartPassive: D[1] || (D[1] = //@ts-ignore
|
|
1025
|
+
(...q) => t(B) && t(B)(...q))
|
|
1026
|
+
},
|
|
1027
|
+
[
|
|
1028
|
+
ie(
|
|
1029
|
+
"div",
|
|
1030
|
+
{
|
|
1031
|
+
class: O(t(c).e("bar")),
|
|
1032
|
+
style: re(t(z))
|
|
1033
|
+
},
|
|
1034
|
+
null,
|
|
1035
|
+
6
|
|
1036
|
+
/* CLASS, STYLE */
|
|
1037
|
+
),
|
|
1038
|
+
ve(Re, {
|
|
1039
|
+
id: b.range ? void 0 : t(m),
|
|
1040
|
+
ref_key: "firstButton",
|
|
1041
|
+
ref: N,
|
|
1042
|
+
"model-value": t(p),
|
|
1043
|
+
vertical: b.vertical,
|
|
1044
|
+
"tooltip-class": b.tooltipClass,
|
|
1045
|
+
placement: b.placement,
|
|
1046
|
+
role: "slider",
|
|
1047
|
+
"aria-label": b.range || !t(E) ? _.value : void 0,
|
|
1048
|
+
"aria-labelledby": !b.range && t(E) ? (Me = t(o)) == null ? void 0 : Me.labelId : void 0,
|
|
1049
|
+
"aria-valuemin": b.min,
|
|
1050
|
+
"aria-valuemax": b.range ? t(f) : b.max,
|
|
1051
|
+
"aria-valuenow": t(p),
|
|
1052
|
+
"aria-valuetext": n.value,
|
|
1053
|
+
"aria-orientation": b.vertical ? "vertical" : "horizontal",
|
|
1054
|
+
"aria-disabled": t(k),
|
|
1055
|
+
"onUpdate:modelValue": t(Y)
|
|
1056
|
+
}, null, 8, ["id", "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"]),
|
|
1057
|
+
b.range ? (C(), le(Re, {
|
|
1058
|
+
key: 0,
|
|
1059
|
+
ref_key: "secondButton",
|
|
1060
|
+
ref: h,
|
|
1061
|
+
"model-value": t(f),
|
|
1062
|
+
vertical: b.vertical,
|
|
1063
|
+
"tooltip-class": b.tooltipClass,
|
|
1064
|
+
placement: b.placement,
|
|
1065
|
+
role: "slider",
|
|
1066
|
+
"aria-label": r.value,
|
|
1067
|
+
"aria-valuemin": t(p),
|
|
1068
|
+
"aria-valuemax": b.max,
|
|
1069
|
+
"aria-valuenow": t(f),
|
|
1070
|
+
"aria-valuetext": s.value,
|
|
1071
|
+
"aria-orientation": b.vertical ? "vertical" : "horizontal",
|
|
1072
|
+
"aria-disabled": t(k),
|
|
1073
|
+
"onUpdate:modelValue": t(x)
|
|
1074
|
+
}, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : oe("v-if", !0),
|
|
1075
|
+
b.showStops ? (C(), U("div", Tt, [
|
|
1076
|
+
(C(!0), U(
|
|
1077
|
+
he,
|
|
1078
|
+
null,
|
|
1079
|
+
ke(t(P), (q, me) => (C(), U(
|
|
1080
|
+
"div",
|
|
1081
|
+
{
|
|
1082
|
+
key: me,
|
|
1083
|
+
class: O(t(c).e("stop")),
|
|
1084
|
+
style: re(t(j)(q))
|
|
1085
|
+
},
|
|
1086
|
+
null,
|
|
1087
|
+
6
|
|
1088
|
+
/* CLASS, STYLE */
|
|
1089
|
+
))),
|
|
1090
|
+
128
|
|
1091
|
+
/* KEYED_FRAGMENT */
|
|
1092
|
+
))
|
|
1093
|
+
])) : oe("v-if", !0),
|
|
1094
|
+
t(w).length > 0 ? (C(), U(
|
|
1095
|
+
he,
|
|
1096
|
+
{ key: 2 },
|
|
1097
|
+
[
|
|
1098
|
+
ie("div", null, [
|
|
1099
|
+
(C(!0), U(
|
|
1100
|
+
he,
|
|
1101
|
+
null,
|
|
1102
|
+
ke(t(w), (q, me) => (C(), U(
|
|
1103
|
+
"div",
|
|
1104
|
+
{
|
|
1105
|
+
key: me,
|
|
1106
|
+
style: re(t(j)(q.position)),
|
|
1107
|
+
class: O([t(c).e("stop"), t(c).e("marks-stop")])
|
|
1108
|
+
},
|
|
1109
|
+
null,
|
|
1110
|
+
6
|
|
1111
|
+
/* CLASS, STYLE */
|
|
1112
|
+
))),
|
|
1113
|
+
128
|
|
1114
|
+
/* KEYED_FRAGMENT */
|
|
1115
|
+
))
|
|
1116
|
+
]),
|
|
1117
|
+
ie(
|
|
1118
|
+
"div",
|
|
1119
|
+
{
|
|
1120
|
+
class: O(t(c).e("marks"))
|
|
1121
|
+
},
|
|
1122
|
+
[
|
|
1123
|
+
(C(!0), U(
|
|
1124
|
+
he,
|
|
1125
|
+
null,
|
|
1126
|
+
ke(t(w), (q, me) => (C(), le(t(xt), {
|
|
1127
|
+
key: me,
|
|
1128
|
+
mark: q.mark,
|
|
1129
|
+
style: re(t(j)(q.position)),
|
|
1130
|
+
onMousedown: Ke((zt) => t(R)(q.position), ["stop"])
|
|
1131
|
+
}, null, 8, ["mark", "style", "onMousedown"]))),
|
|
1132
|
+
128
|
|
1133
|
+
/* KEYED_FRAGMENT */
|
|
1134
|
+
))
|
|
1135
|
+
],
|
|
1136
|
+
2
|
|
1137
|
+
/* CLASS */
|
|
1138
|
+
)
|
|
1139
|
+
],
|
|
1140
|
+
64
|
|
1141
|
+
/* STABLE_FRAGMENT */
|
|
1142
|
+
)) : oe("v-if", !0)
|
|
1143
|
+
],
|
|
1144
|
+
38
|
|
1145
|
+
/* CLASS, STYLE, NEED_HYDRATION */
|
|
1146
|
+
),
|
|
1147
|
+
b.showInput && !b.range ? (C(), le(t(ht), {
|
|
1148
|
+
key: 0,
|
|
1149
|
+
ref: "input",
|
|
1150
|
+
"model-value": t(p),
|
|
1151
|
+
class: O(t(c).e("input")),
|
|
1152
|
+
step: b.step,
|
|
1153
|
+
disabled: t(k),
|
|
1154
|
+
controls: b.showInputControls,
|
|
1155
|
+
min: b.min,
|
|
1156
|
+
max: b.max,
|
|
1157
|
+
precision: I.value,
|
|
1158
|
+
size: Z.value,
|
|
1159
|
+
"onUpdate:modelValue": t(Y),
|
|
1160
|
+
onChange: t(F)
|
|
1161
|
+
}, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "size", "onUpdate:modelValue", "onChange"])) : oe("v-if", !0)
|
|
1162
|
+
], 10, Lt);
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1165
|
+
});
|
|
1166
|
+
const Kt = qe(Ft);
|
|
1167
|
+
export {
|
|
1168
|
+
Kt as E
|
|
1169
|
+
};
|