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