@xtctwins/tctwins-bimx-engine 0.2.21 → 0.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +5 -5
  2. package/dist/{AnnotationTool-wlMzfke3.mjs → AnnotationTool-BAqnoElU.mjs} +32 -32
  3. package/dist/BIMX_Viewer_Lib.es.js +2 -2
  4. package/dist/BIMX_Viewer_Lib.umd.js +151 -153
  5. package/dist/{CommentTool-BFWKjEwL.mjs → CommentTool-QAQnEThT.mjs} +44 -44
  6. package/dist/{HiddenTool-B39qHPG4.mjs → HiddenTool-YmKJlgqE.mjs} +12 -12
  7. package/dist/{InspectorTool-DuZMt6ck.mjs → InspectorTool-BrLjImHZ.mjs} +25 -25
  8. package/dist/{MeasureTool-CAtJhHvn.mjs → MeasureTool-CUZy5ML9.mjs} +36 -36
  9. package/dist/{NavigateTool-DUJbcOu8.mjs → NavigateTool-DviiOK_a.mjs} +1 -1
  10. package/dist/{RoamTool-VJukLQbx.mjs → RoamTool-CIkux4Y-.mjs} +19 -19
  11. package/dist/ScreenShotTool-Bu0M6ur_.mjs +357 -0
  12. package/dist/{SectionTool-wG-g4bYz.mjs → SectionTool-BJ19Wgfm.mjs} +55 -55
  13. package/dist/{SettingTool-BJIcCCIF.mjs → SettingTool-CUaDVp_g.mjs} +136 -136
  14. package/dist/{StructureTree-ArZXIpjJ.mjs → StructureTree-DIW023ER.mjs} +232 -241
  15. package/dist/{alert-BKbDGve8.mjs → alert-Dv1dFs7z.mjs} +3 -3
  16. package/dist/el-input-number-C1xkBmQ4.mjs +818 -0
  17. package/dist/{index-DLOOTr_z.mjs → index-Db6oz6CK.mjs} +44717 -46965
  18. package/dist/index.html +17 -17
  19. package/dist/{panel.vue_vue_type_style_index_0_lang-BHeUPt0m.mjs → panel.vue_vue_type_style_index_0_lang-DF0tLFJ-.mjs} +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/{tallPanel-C7-DJpng.mjs → tallPanel-CqAU492j.mjs} +16 -16
  22. package/package.json +65 -66
  23. package/types/components/BCFComponents/BCFAddPanel.vue.d.ts +10 -38
  24. package/types/components/BCFComponents/BCFCommentNew.vue.d.ts +22 -0
  25. package/types/components/BCFComponents/BCFDetailPanel.vue.d.ts +9 -37
  26. package/types/components/BCFComponents/BCFDisplayList.vue.d.ts +7 -5
  27. package/types/components/BCFComponents/BCFFilter.vue.d.ts +7 -5
  28. package/types/components/BCFComponents/BCFTool.vue.d.ts +7 -4
  29. package/types/components/BCFComponents/addObjectOrAnno.vue.d.ts +7 -5
  30. package/types/components/BCFComponents/checkObjectPanel.vue.d.ts +6 -5
  31. package/types/components/BCFComponents/commentInput.vue.d.ts +9 -38
  32. package/types/components/BCFComponents/commentsView.vue.d.ts +7 -38
  33. package/types/components/BCFComponents/dialogPanel.vue.d.ts +8 -5
  34. package/types/components/BCFComponents/imageView.vue.d.ts +7 -5
  35. package/types/components/BCFComponents/imageZoomIn.vue.d.ts +6 -5
  36. package/types/components/BimViewerComponents/AnnotationTool.vue.d.ts +1 -1
  37. package/types/components/BimViewerComponents/CommentTool.vue.d.ts +1 -1
  38. package/types/components/BimViewerComponents/HiddenTool.vue.d.ts +1 -1
  39. package/types/components/BimViewerComponents/NavigateTool.vue.d.ts +1 -1
  40. package/types/components/BimViewerComponents/RoamTool.vue.d.ts +1 -1
  41. package/types/components/BimViewerComponents/SettingTool.vue.d.ts +6 -4
  42. package/types/components/BimViewerComponents/StructureTree.vue.d.ts +1 -3042
  43. package/types/components/BimViewerComponents/Toolbar.vue.d.ts +1 -1
  44. package/types/components/BimViewerComponents/emptyPage.vue.d.ts +8 -0
  45. package/types/components/bimxViewer.vue.d.ts +12 -7
  46. package/types/components/utilsComponents/alert.vue.d.ts +1 -1
  47. package/types/components/utilsComponents/closeButton.vue.d.ts +1 -1
  48. package/types/components/utilsComponents/emptyPage.vue.d.ts +1 -1
  49. package/types/components/utilsComponents/loading.vue.d.ts +1 -1
  50. package/types/components/utilsComponents/panel.vue.d.ts +2 -8
  51. package/types/components/utilsComponents/rectangleButton.vue.d.ts +1 -3
  52. package/types/components/utilsComponents/tallPanel.vue.d.ts +3 -13
  53. package/types/components/utilsComponents/tallPanel_noPos.vue.d.ts +3 -13
  54. package/types/pages/viewerEntry.vue.d.ts +54 -4
  55. package/types/store/bcfReflect.d.ts +0 -2
  56. package/types/store/initConfigs.d.ts +1 -1
  57. package/dist/ScreenShotTool-DoeDZA0a.mjs +0 -357
  58. package/dist/el-input-number-BXp6cJeD.mjs +0 -858
  59. package/types/components/MobileBCFComponents/MobileBCFAdd.vue.d.ts +0 -56
  60. package/types/components/MobileBCFComponents/MobileBCFDetail.vue.d.ts +0 -55
  61. package/types/components/MobileBCFComponents/MobileBCFDisplayList.vue.d.ts +0 -278
  62. package/types/components/MobileBCFComponents/MobileBCFFilter.vue.d.ts +0 -255
  63. package/types/components/MobileBCFComponents/MobileBCFTool.vue.d.ts +0 -17
  64. package/types/components/MobileBCFComponents/MobileCommentInput.vue.d.ts +0 -54
  65. package/types/components/MobileBCFComponents/MobileCommentsView.vue.d.ts +0 -17
  66. package/types/components/MobileBCFComponents/selectPanel.vue.d.ts +0 -12
  67. package/types/components/utilsComponents/closeButton_dark.vue.d.ts +0 -32
  68. package/types/services/request/api.d.ts +0 -3
  69. package/types/services/request/index.d.ts +0 -14
  70. package/types/services/request/types.d.ts +0 -12
  71. package/types/tests/bcf.d.ts +0 -8
@@ -0,0 +1,818 @@
1
+ import { defineComponent as ee, ref as D, reactive as Be, computed as V, watch as se, onMounted as ze, onUpdated as je, openBlock as B, createElementBlock as $, normalizeClass as Y, unref as t, withModifiers as fe, withDirectives as Me, withKeys as ce, renderSlot as Ce, createVNode as ie, withCtx as be, createBlock as Z, createCommentVNode as le, nextTick as ge, shallowRef as He, inject as Ge, toRefs as Ne, normalizeStyle as te, createElementVNode as ne, toDisplayString as qe, h as Je, provide as Ze, Fragment as me, renderList as pe } from "vue";
2
+ import { G as he, K as ke, H as R, P as Ae, J as Ve, Z as Q, a3 as de, U as O, l as Ke, u as we, R as $e, a4 as ve, d as ae, L as Ye, M as Qe, c as Le, a5 as Te, q as De, _ as Ie, a1 as Re, f as Ee, w as Xe, Y as ue, a6 as Ue, a7 as et, g as ye, a8 as _e, j as tt, a9 as lt, S as nt } from "./index-Db6oz6CK.mjs";
3
+ import { ArrowDown as at, Minus as rt, ArrowUp as ot, Plus as ut } from "@element-plus/icons-vue";
4
+ const st = he({
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.POSITIVE_INFINITY
17
+ },
18
+ min: {
19
+ type: Number,
20
+ default: Number.NEGATIVE_INFINITY
21
+ },
22
+ modelValue: Number,
23
+ readonly: Boolean,
24
+ disabled: Boolean,
25
+ size: ke,
26
+ controls: {
27
+ type: Boolean,
28
+ default: !0
29
+ },
30
+ controlsPosition: {
31
+ type: String,
32
+ default: "",
33
+ values: ["", "right"]
34
+ },
35
+ valueOnClear: {
36
+ type: [String, Number, null],
37
+ validator: (e) => e === null || R(e) || ["min", "max"].includes(e),
38
+ default: null
39
+ },
40
+ name: String,
41
+ placeholder: String,
42
+ precision: {
43
+ type: Number,
44
+ validator: (e) => e >= 0 && e === Number.parseInt(`${e}`, 10)
45
+ },
46
+ validateEvent: {
47
+ type: Boolean,
48
+ default: !0
49
+ },
50
+ ...Ae(["ariaLabel"])
51
+ }), it = {
52
+ [Ve]: (e, l) => l !== e,
53
+ blur: (e) => e instanceof FocusEvent,
54
+ focus: (e) => e instanceof FocusEvent,
55
+ [Q]: (e) => R(e) || de(e),
56
+ [O]: (e) => R(e) || de(e)
57
+ }, dt = ee({
58
+ name: "ElInputNumber"
59
+ }), ct = /* @__PURE__ */ ee({
60
+ ...dt,
61
+ props: st,
62
+ emits: it,
63
+ setup(e, { expose: l, emit: o }) {
64
+ const a = e, { t: v } = Ke(), m = we("input-number"), d = D(), s = Be({
65
+ currentValue: a.modelValue,
66
+ userInput: null
67
+ }), { formItem: w } = $e(), g = V(() => R(a.modelValue) && a.modelValue <= a.min), p = V(() => R(a.modelValue) && a.modelValue >= a.max), i = V(() => {
68
+ const n = z(a.step);
69
+ return ve(a.precision) ? Math.max(z(a.modelValue), n) : (n > a.precision && ae("InputNumber", "precision should not be less than the decimal places of step"), a.precision);
70
+ }), E = V(() => a.controls && a.controlsPosition === "right"), F = Ye(), C = Qe(), A = V(() => {
71
+ if (s.userInput !== null)
72
+ return s.userInput;
73
+ let n = s.currentValue;
74
+ if (de(n))
75
+ return "";
76
+ if (R(n)) {
77
+ if (Number.isNaN(n))
78
+ return "";
79
+ ve(a.precision) || (n = n.toFixed(a.precision));
80
+ }
81
+ return n;
82
+ }), T = (n, r) => {
83
+ if (ve(r) && (r = i.value), r === 0)
84
+ return Math.round(n);
85
+ let c = String(n);
86
+ const S = c.indexOf(".");
87
+ if (S === -1 || !c.replace(".", "").split("")[S + r])
88
+ return n;
89
+ const I = c.length;
90
+ return c.charAt(I - 1) === "5" && (c = `${c.slice(0, Math.max(0, I - 1))}6`), Number.parseFloat(Number(c).toFixed(r));
91
+ }, z = (n) => {
92
+ if (de(n))
93
+ return 0;
94
+ const r = n.toString(), c = r.indexOf(".");
95
+ let S = 0;
96
+ return c !== -1 && (S = r.length - c - 1), S;
97
+ }, P = (n, r = 1) => R(n) ? T(n + a.step * r) : s.currentValue, L = () => {
98
+ if (a.readonly || C.value || p.value)
99
+ return;
100
+ const n = Number(A.value) || 0, r = P(n);
101
+ K(r), o(Q, s.currentValue), k();
102
+ }, x = () => {
103
+ if (a.readonly || C.value || g.value)
104
+ return;
105
+ const n = Number(A.value) || 0, r = P(n, -1);
106
+ K(r), o(Q, s.currentValue), k();
107
+ }, U = (n, r) => {
108
+ const { max: c, min: S, step: h, precision: N, stepStrictly: I, valueOnClear: u } = a;
109
+ c < S && Re("InputNumber", "min should not be greater than max.");
110
+ let b = Number(n);
111
+ if (de(n) || Number.isNaN(b))
112
+ return null;
113
+ if (n === "") {
114
+ if (u === null)
115
+ return null;
116
+ b = Ee(u) ? { min: S, max: c }[u] : u;
117
+ }
118
+ return I && (b = T(Math.round(b / h) * h, N)), ve(N) || (b = T(b, N)), (b > c || b < S) && (b = b > c ? c : S, r && o(O, b)), b;
119
+ }, K = (n, r = !0) => {
120
+ var c;
121
+ const S = s.currentValue, h = U(n);
122
+ if (!r) {
123
+ o(O, h);
124
+ return;
125
+ }
126
+ S === h && n || (s.userInput = null, o(O, h), S !== h && o(Ve, h, S), a.validateEvent && ((c = w == null ? void 0 : w.validate) == null || c.call(w, "change").catch((N) => ae(N))), s.currentValue = h);
127
+ }, j = (n) => {
128
+ s.userInput = n;
129
+ const r = n === "" ? null : Number(n);
130
+ o(Q, r), K(r, !1);
131
+ }, G = (n) => {
132
+ const r = n !== "" ? Number(n) : "";
133
+ (R(r) && !Number.isNaN(r) || n === "") && K(r), k(), s.userInput = null;
134
+ }, X = () => {
135
+ var n, r;
136
+ (r = (n = d.value) == null ? void 0 : n.focus) == null || r.call(n);
137
+ }, q = () => {
138
+ var n, r;
139
+ (r = (n = d.value) == null ? void 0 : n.blur) == null || r.call(n);
140
+ }, W = (n) => {
141
+ o("focus", n);
142
+ }, f = (n) => {
143
+ var r;
144
+ s.userInput = null, o("blur", n), a.validateEvent && ((r = w == null ? void 0 : w.validate) == null || r.call(w, "blur").catch((c) => ae(c)));
145
+ }, k = () => {
146
+ s.currentValue !== a.modelValue && (s.currentValue = a.modelValue);
147
+ }, M = (n) => {
148
+ document.activeElement === n.target && n.preventDefault();
149
+ };
150
+ return se(() => a.modelValue, (n, r) => {
151
+ const c = U(n, !0);
152
+ s.userInput === null && c !== r && (s.currentValue = c);
153
+ }, { immediate: !0 }), ze(() => {
154
+ var n;
155
+ const { min: r, max: c, modelValue: S } = a, h = (n = d.value) == null ? void 0 : n.input;
156
+ if (h.setAttribute("role", "spinbutton"), Number.isFinite(c) ? h.setAttribute("aria-valuemax", String(c)) : h.removeAttribute("aria-valuemax"), Number.isFinite(r) ? h.setAttribute("aria-valuemin", String(r)) : h.removeAttribute("aria-valuemin"), h.setAttribute("aria-valuenow", s.currentValue || s.currentValue === 0 ? String(s.currentValue) : ""), h.setAttribute("aria-disabled", String(C.value)), !R(S) && S != null) {
157
+ let N = Number(S);
158
+ Number.isNaN(N) && (N = null), o(O, N);
159
+ }
160
+ h.addEventListener("wheel", M, { passive: !1 });
161
+ }), je(() => {
162
+ var n, r;
163
+ const c = (n = d.value) == null ? void 0 : n.input;
164
+ c == null || c.setAttribute("aria-valuenow", `${(r = s.currentValue) != null ? r : ""}`);
165
+ }), l({
166
+ focus: X,
167
+ blur: q
168
+ }), (n, r) => (B(), $("div", {
169
+ class: Y([
170
+ t(m).b(),
171
+ t(m).m(t(F)),
172
+ t(m).is("disabled", t(C)),
173
+ t(m).is("without-controls", !n.controls),
174
+ t(m).is("controls-right", t(E))
175
+ ]),
176
+ onDragstart: fe(() => {
177
+ }, ["prevent"])
178
+ }, [
179
+ n.controls ? Me((B(), $("span", {
180
+ key: 0,
181
+ role: "button",
182
+ "aria-label": t(v)("el.inputNumber.decrease"),
183
+ class: Y([t(m).e("decrease"), t(m).is("disabled", t(g))]),
184
+ onKeydown: ce(x, ["enter"])
185
+ }, [
186
+ Ce(n.$slots, "decrease-icon", {}, () => [
187
+ ie(t(Le), null, {
188
+ default: be(() => [
189
+ t(E) ? (B(), Z(t(at), { key: 0 })) : (B(), Z(t(rt), { key: 1 }))
190
+ ]),
191
+ _: 1
192
+ })
193
+ ])
194
+ ], 42, ["aria-label", "onKeydown"])), [
195
+ [t(Te), x]
196
+ ]) : le("v-if", !0),
197
+ n.controls ? Me((B(), $("span", {
198
+ key: 1,
199
+ role: "button",
200
+ "aria-label": t(v)("el.inputNumber.increase"),
201
+ class: Y([t(m).e("increase"), t(m).is("disabled", t(p))]),
202
+ onKeydown: ce(L, ["enter"])
203
+ }, [
204
+ Ce(n.$slots, "increase-icon", {}, () => [
205
+ ie(t(Le), null, {
206
+ default: be(() => [
207
+ t(E) ? (B(), Z(t(ot), { key: 0 })) : (B(), Z(t(ut), { key: 1 }))
208
+ ]),
209
+ _: 1
210
+ })
211
+ ])
212
+ ], 42, ["aria-label", "onKeydown"])), [
213
+ [t(Te), L]
214
+ ]) : le("v-if", !0),
215
+ ie(t(De), {
216
+ id: n.id,
217
+ ref_key: "input",
218
+ ref: d,
219
+ type: "number",
220
+ step: n.step,
221
+ "model-value": t(A),
222
+ placeholder: n.placeholder,
223
+ readonly: n.readonly,
224
+ disabled: t(C),
225
+ size: t(F),
226
+ max: n.max,
227
+ min: n.min,
228
+ name: n.name,
229
+ "aria-label": n.ariaLabel,
230
+ "validate-event": !1,
231
+ onKeydown: [
232
+ ce(fe(L, ["prevent"]), ["up"]),
233
+ ce(fe(x, ["prevent"]), ["down"])
234
+ ],
235
+ onBlur: f,
236
+ onFocus: W,
237
+ onInput: j,
238
+ onChange: G
239
+ }, null, 8, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"])
240
+ ], 42, ["onDragstart"]));
241
+ }
242
+ });
243
+ var mt = /* @__PURE__ */ Ie(ct, [["__file", "input-number.vue"]]);
244
+ const vt = Xe(mt), Oe = Symbol("sliderContextKey"), ft = he({
245
+ modelValue: {
246
+ type: ue([Number, Array]),
247
+ default: 0
248
+ },
249
+ id: {
250
+ type: String,
251
+ default: void 0
252
+ },
253
+ min: {
254
+ type: Number,
255
+ default: 0
256
+ },
257
+ max: {
258
+ type: Number,
259
+ default: 100
260
+ },
261
+ step: {
262
+ type: Number,
263
+ default: 1
264
+ },
265
+ showInput: Boolean,
266
+ showInputControls: {
267
+ type: Boolean,
268
+ default: !0
269
+ },
270
+ size: ke,
271
+ inputSize: ke,
272
+ showStops: Boolean,
273
+ showTooltip: {
274
+ type: Boolean,
275
+ default: !0
276
+ },
277
+ formatTooltip: {
278
+ type: ue(Function),
279
+ default: void 0
280
+ },
281
+ disabled: Boolean,
282
+ range: Boolean,
283
+ vertical: Boolean,
284
+ height: String,
285
+ debounce: {
286
+ type: Number,
287
+ default: 300
288
+ },
289
+ rangeStartLabel: {
290
+ type: String,
291
+ default: void 0
292
+ },
293
+ rangeEndLabel: {
294
+ type: String,
295
+ default: void 0
296
+ },
297
+ formatValueText: {
298
+ type: ue(Function),
299
+ default: void 0
300
+ },
301
+ tooltipClass: {
302
+ type: String,
303
+ default: void 0
304
+ },
305
+ placement: {
306
+ type: String,
307
+ values: Ue,
308
+ default: "top"
309
+ },
310
+ marks: {
311
+ type: ue(Object)
312
+ },
313
+ validateEvent: {
314
+ type: Boolean,
315
+ default: !0
316
+ },
317
+ ...Ae(["ariaLabel"])
318
+ }), Se = (e) => R(e) || et(e) && e.every(R), bt = {
319
+ [O]: Se,
320
+ [Q]: Se,
321
+ [Ve]: Se
322
+ }, gt = (e, l, o) => {
323
+ const a = D();
324
+ return ze(async () => {
325
+ e.range ? (Array.isArray(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]) : (typeof e.modelValue != "number" || Number.isNaN(e.modelValue) ? l.firstValue = e.min : l.firstValue = Math.min(e.max, Math.max(e.min, e.modelValue)), l.oldValue = l.firstValue), ye(window, "resize", o), await ge(), o();
326
+ }), {
327
+ sliderWrapper: a
328
+ };
329
+ }, yt = (e) => V(() => e.marks ? Object.keys(e.marks).map(Number.parseFloat).sort((o, a) => o - a).filter((o) => o <= e.max && o >= e.min).map((o) => ({
330
+ point: o,
331
+ position: (o - e.min) * 100 / (e.max - e.min),
332
+ mark: e.marks[o]
333
+ })) : []), ht = (e, l, o) => {
334
+ const { form: a, formItem: v } = $e(), m = He(), d = D(), s = D(), w = {
335
+ firstButton: d,
336
+ secondButton: s
337
+ }, g = V(() => e.disabled || (a == null ? void 0 : a.disabled) || !1), p = V(() => Math.min(l.firstValue, l.secondValue)), i = V(() => Math.max(l.firstValue, l.secondValue)), E = V(() => e.range ? `${100 * (i.value - p.value) / (e.max - e.min)}%` : `${100 * (l.firstValue - e.min) / (e.max - e.min)}%`), F = V(() => e.range ? `${100 * (p.value - e.min) / (e.max - e.min)}%` : "0%"), C = V(() => e.vertical ? { height: e.height } : {}), A = V(() => e.vertical ? {
338
+ height: E.value,
339
+ bottom: F.value
340
+ } : {
341
+ width: E.value,
342
+ left: F.value
343
+ }), T = () => {
344
+ m.value && (l.sliderSize = m.value[`client${e.vertical ? "Height" : "Width"}`]);
345
+ }, z = (f) => {
346
+ const k = e.min + f * (e.max - e.min) / 100;
347
+ if (!e.range)
348
+ return d;
349
+ let M;
350
+ return Math.abs(p.value - k) < Math.abs(i.value - k) ? M = l.firstValue < l.secondValue ? "firstButton" : "secondButton" : M = l.firstValue > l.secondValue ? "firstButton" : "secondButton", w[M];
351
+ }, P = (f) => {
352
+ const k = z(f);
353
+ return k.value.setPosition(f), k;
354
+ }, L = (f) => {
355
+ l.firstValue = f ?? e.min, U(e.range ? [p.value, i.value] : f ?? e.min);
356
+ }, x = (f) => {
357
+ l.secondValue = f, e.range && U([p.value, i.value]);
358
+ }, U = (f) => {
359
+ o(O, f), o(Q, f);
360
+ }, K = async () => {
361
+ await ge(), o(Ve, e.range ? [p.value, i.value] : e.modelValue);
362
+ }, j = (f) => {
363
+ var k, M, n, r, c, S;
364
+ if (g.value || l.dragging)
365
+ return;
366
+ T();
367
+ let h = 0;
368
+ if (e.vertical) {
369
+ const N = (n = (M = (k = f.touches) == null ? void 0 : k.item(0)) == null ? void 0 : M.clientY) != null ? n : f.clientY;
370
+ h = (m.value.getBoundingClientRect().bottom - N) / l.sliderSize * 100;
371
+ } else {
372
+ const N = (S = (c = (r = f.touches) == null ? void 0 : r.item(0)) == null ? void 0 : c.clientX) != null ? S : f.clientX, I = m.value.getBoundingClientRect().left;
373
+ h = (N - I) / l.sliderSize * 100;
374
+ }
375
+ if (!(h < 0 || h > 100))
376
+ return P(h);
377
+ };
378
+ return {
379
+ elFormItem: v,
380
+ slider: m,
381
+ firstButton: d,
382
+ secondButton: s,
383
+ sliderDisabled: g,
384
+ minValue: p,
385
+ maxValue: i,
386
+ runwayStyle: C,
387
+ barStyle: A,
388
+ resetSize: T,
389
+ setPosition: P,
390
+ emitChange: K,
391
+ onSliderWrapperPrevent: (f) => {
392
+ var k, M;
393
+ ((k = w.firstButton.value) != null && k.dragging || (M = w.secondButton.value) != null && M.dragging) && f.preventDefault();
394
+ },
395
+ onSliderClick: (f) => {
396
+ j(f) && K();
397
+ },
398
+ onSliderDown: async (f) => {
399
+ const k = j(f);
400
+ k && (await ge(), k.value.onButtonDown(f));
401
+ },
402
+ onSliderMarkerDown: (f) => {
403
+ g.value || l.dragging || P(f);
404
+ },
405
+ setFirstValue: L,
406
+ setSecondValue: x
407
+ };
408
+ }, { left: Vt, down: wt, right: pt, up: St, home: Nt, end: kt, pageUp: Et, pageDown: Bt } = tt, It = (e, l, o) => {
409
+ const a = D(), v = D(!1), m = V(() => l.value instanceof Function), d = V(() => m.value && l.value(e.modelValue) || e.modelValue), s = _e(() => {
410
+ o.value && (v.value = !0);
411
+ }, 50), w = _e(() => {
412
+ o.value && (v.value = !1);
413
+ }, 50);
414
+ return {
415
+ tooltip: a,
416
+ tooltipVisible: v,
417
+ formatValue: d,
418
+ displayTooltip: s,
419
+ hideTooltip: w
420
+ };
421
+ }, Pt = (e, l, o) => {
422
+ const {
423
+ disabled: a,
424
+ min: v,
425
+ max: m,
426
+ step: d,
427
+ showTooltip: s,
428
+ precision: w,
429
+ sliderSize: g,
430
+ formatTooltip: p,
431
+ emitChange: i,
432
+ resetSize: E,
433
+ updateDragging: F
434
+ } = Ge(Oe), { tooltip: C, tooltipVisible: A, formatValue: T, displayTooltip: z, hideTooltip: P } = It(e, p, s), L = D(), x = V(() => `${(e.modelValue - v.value) / (m.value - v.value) * 100}%`), U = V(() => e.vertical ? { bottom: x.value } : { left: x.value }), K = () => {
435
+ l.hovering = !0, z();
436
+ }, j = () => {
437
+ l.hovering = !1, l.dragging || P();
438
+ }, G = (u) => {
439
+ a.value || (u.preventDefault(), S(u), window.addEventListener("mousemove", h), window.addEventListener("touchmove", h), window.addEventListener("mouseup", N), window.addEventListener("touchend", N), window.addEventListener("contextmenu", N), L.value.focus());
440
+ }, X = (u) => {
441
+ a.value || (l.newPosition = Number.parseFloat(x.value) + u / (m.value - v.value) * 100, I(l.newPosition), i());
442
+ }, q = () => {
443
+ X(-d.value);
444
+ }, W = () => {
445
+ X(d.value);
446
+ }, f = () => {
447
+ X(-d.value * 4);
448
+ }, k = () => {
449
+ X(d.value * 4);
450
+ }, M = () => {
451
+ a.value || (I(0), i());
452
+ }, n = () => {
453
+ a.value || (I(100), i());
454
+ }, r = (u) => {
455
+ let b = !0;
456
+ [Vt, wt].includes(u.key) ? q() : [pt, St].includes(u.key) ? W() : u.key === Nt ? M() : u.key === kt ? n() : u.key === Bt ? f() : u.key === Et ? k() : b = !1, b && u.preventDefault();
457
+ }, c = (u) => {
458
+ let b, _;
459
+ return u.type.startsWith("touch") ? (_ = u.touches[0].clientY, b = u.touches[0].clientX) : (_ = u.clientY, b = u.clientX), {
460
+ clientX: b,
461
+ clientY: _
462
+ };
463
+ }, S = (u) => {
464
+ l.dragging = !0, l.isClick = !0;
465
+ const { clientX: b, clientY: _ } = c(u);
466
+ e.vertical ? l.startY = _ : l.startX = b, l.startPosition = Number.parseFloat(x.value), l.newPosition = l.startPosition;
467
+ }, h = (u) => {
468
+ if (l.dragging) {
469
+ l.isClick = !1, z(), E();
470
+ let b;
471
+ const { clientX: _, clientY: H } = c(u);
472
+ e.vertical ? (l.currentY = H, b = (l.startY - l.currentY) / g.value * 100) : (l.currentX = _, b = (l.currentX - l.startX) / g.value * 100), l.newPosition = l.startPosition + b, I(l.newPosition);
473
+ }
474
+ }, N = () => {
475
+ l.dragging && (setTimeout(() => {
476
+ l.dragging = !1, l.hovering || P(), l.isClick || I(l.newPosition), i();
477
+ }, 0), window.removeEventListener("mousemove", h), window.removeEventListener("touchmove", h), window.removeEventListener("mouseup", N), window.removeEventListener("touchend", N), window.removeEventListener("contextmenu", N));
478
+ }, I = async (u) => {
479
+ if (u === null || Number.isNaN(+u))
480
+ return;
481
+ u < 0 ? u = 0 : u > 100 && (u = 100);
482
+ const b = 100 / ((m.value - v.value) / d.value);
483
+ let H = Math.round(u / b) * b * (m.value - v.value) * 0.01 + v.value;
484
+ H = Number.parseFloat(H.toFixed(w.value)), H !== e.modelValue && o(O, H), !l.dragging && e.modelValue !== l.oldValue && (l.oldValue = e.modelValue), await ge(), l.dragging && z(), C.value.updatePopper();
485
+ };
486
+ return se(() => l.dragging, (u) => {
487
+ F(u);
488
+ }), ye(L, "touchstart", G, { passive: !1 }), {
489
+ disabled: a,
490
+ button: L,
491
+ tooltip: C,
492
+ tooltipVisible: A,
493
+ showTooltip: s,
494
+ wrapperStyle: U,
495
+ formatValue: T,
496
+ handleMouseEnter: K,
497
+ handleMouseLeave: j,
498
+ onButtonDown: G,
499
+ onKeyDown: r,
500
+ setPosition: I
501
+ };
502
+ }, xt = (e, l, o, a) => ({
503
+ stops: V(() => {
504
+ if (!e.showStops || e.min > e.max)
505
+ return [];
506
+ if (e.step === 0)
507
+ return ae("ElSlider", "step should not be 0."), [];
508
+ const d = (e.max - e.min) / e.step, s = 100 * e.step / (e.max - e.min), w = Array.from({ length: d - 1 }).map((g, p) => (p + 1) * s);
509
+ return e.range ? w.filter((g) => g < 100 * (o.value - e.min) / (e.max - e.min) || g > 100 * (a.value - e.min) / (e.max - e.min)) : w.filter((g) => g > 100 * (l.firstValue - e.min) / (e.max - e.min));
510
+ }),
511
+ getStopStyle: (d) => e.vertical ? { bottom: `${d}%` } : { left: `${d}%` }
512
+ }), Mt = (e, l, o, a, v, m) => {
513
+ const d = (g) => {
514
+ v(O, g), v(Q, g);
515
+ }, s = () => e.range ? ![o.value, a.value].every((g, p) => g === l.oldValue[p]) : e.modelValue !== l.oldValue, w = () => {
516
+ var g, p;
517
+ e.min > e.max && Re("Slider", "min should not be greater than max.");
518
+ const i = e.modelValue;
519
+ e.range && Array.isArray(i) ? i[1] < e.min ? d([e.min, e.min]) : i[0] > e.max ? d([e.max, e.max]) : i[0] < e.min ? d([e.min, i[1]]) : i[1] > e.max ? d([i[0], e.max]) : (l.firstValue = i[0], l.secondValue = i[1], s() && (e.validateEvent && ((g = m == null ? void 0 : m.validate) == null || g.call(m, "change").catch((E) => ae(E))), l.oldValue = i.slice())) : !e.range && typeof i == "number" && !Number.isNaN(i) && (i < e.min ? d(e.min) : i > e.max ? d(e.max) : (l.firstValue = i, s() && (e.validateEvent && ((p = m == null ? void 0 : m.validate) == null || p.call(m, "change").catch((E) => ae(E))), l.oldValue = i)));
520
+ };
521
+ w(), se(() => l.dragging, (g) => {
522
+ g || w();
523
+ }), se(() => e.modelValue, (g, p) => {
524
+ l.dragging || Array.isArray(g) && Array.isArray(p) && g.every((i, E) => i === p[E]) && l.firstValue === g[0] && l.secondValue === g[1] || w();
525
+ }, {
526
+ deep: !0
527
+ }), se(() => [e.min, e.max], () => {
528
+ w();
529
+ });
530
+ }, Ct = he({
531
+ modelValue: {
532
+ type: Number,
533
+ default: 0
534
+ },
535
+ vertical: Boolean,
536
+ tooltipClass: String,
537
+ placement: {
538
+ type: String,
539
+ values: Ue,
540
+ default: "top"
541
+ }
542
+ }), Lt = {
543
+ [O]: (e) => R(e)
544
+ }, Tt = ee({
545
+ name: "ElSliderButton"
546
+ }), _t = /* @__PURE__ */ ee({
547
+ ...Tt,
548
+ props: Ct,
549
+ emits: Lt,
550
+ setup(e, { expose: l, emit: o }) {
551
+ const a = e, v = we("slider"), m = Be({
552
+ hovering: !1,
553
+ dragging: !1,
554
+ isClick: !1,
555
+ startX: 0,
556
+ currentX: 0,
557
+ startY: 0,
558
+ currentY: 0,
559
+ startPosition: 0,
560
+ newPosition: 0,
561
+ oldValue: a.modelValue
562
+ }), {
563
+ disabled: d,
564
+ button: s,
565
+ tooltip: w,
566
+ showTooltip: g,
567
+ tooltipVisible: p,
568
+ wrapperStyle: i,
569
+ formatValue: E,
570
+ handleMouseEnter: F,
571
+ handleMouseLeave: C,
572
+ onButtonDown: A,
573
+ onKeyDown: T,
574
+ setPosition: z
575
+ } = Pt(a, m, o), { hovering: P, dragging: L } = Ne(m);
576
+ return l({
577
+ onButtonDown: A,
578
+ onKeyDown: T,
579
+ setPosition: z,
580
+ hovering: P,
581
+ dragging: L
582
+ }), (x, U) => (B(), $("div", {
583
+ ref_key: "button",
584
+ ref: s,
585
+ class: Y([t(v).e("button-wrapper"), { hover: t(P), dragging: t(L) }]),
586
+ style: te(t(i)),
587
+ tabindex: t(d) ? -1 : 0,
588
+ onMouseenter: t(F),
589
+ onMouseleave: t(C),
590
+ onMousedown: t(A),
591
+ onFocus: t(F),
592
+ onBlur: t(C),
593
+ onKeydown: t(T)
594
+ }, [
595
+ ie(t(lt), {
596
+ ref_key: "tooltip",
597
+ ref: w,
598
+ visible: t(p),
599
+ placement: x.placement,
600
+ "fallback-placements": ["top", "bottom", "right", "left"],
601
+ "stop-popper-mouse-event": !1,
602
+ "popper-class": x.tooltipClass,
603
+ disabled: !t(g),
604
+ persistent: ""
605
+ }, {
606
+ content: be(() => [
607
+ ne("span", null, qe(t(E)), 1)
608
+ ]),
609
+ default: be(() => [
610
+ ne("div", {
611
+ class: Y([t(v).e("button"), { hover: t(P), dragging: t(L) }])
612
+ }, null, 2)
613
+ ]),
614
+ _: 1
615
+ }, 8, ["visible", "placement", "popper-class", "disabled"])
616
+ ], 46, ["tabindex", "onMouseenter", "onMouseleave", "onMousedown", "onFocus", "onBlur", "onKeydown"]));
617
+ }
618
+ });
619
+ var Fe = /* @__PURE__ */ Ie(_t, [["__file", "button.vue"]]);
620
+ const Ft = he({
621
+ mark: {
622
+ type: ue([String, Object]),
623
+ default: void 0
624
+ }
625
+ });
626
+ var zt = ee({
627
+ name: "ElSliderMarker",
628
+ props: Ft,
629
+ setup(e) {
630
+ const l = we("slider"), o = V(() => Ee(e.mark) ? e.mark : e.mark.label), a = V(() => Ee(e.mark) ? void 0 : e.mark.style);
631
+ return () => Je("div", {
632
+ class: l.e("marks-text"),
633
+ style: a.value
634
+ }, o.value);
635
+ }
636
+ });
637
+ const At = ee({
638
+ name: "ElSlider"
639
+ }), Kt = /* @__PURE__ */ ee({
640
+ ...At,
641
+ props: ft,
642
+ emits: bt,
643
+ setup(e, { expose: l, emit: o }) {
644
+ const a = e, v = we("slider"), { t: m } = Ke(), d = Be({
645
+ firstValue: 0,
646
+ secondValue: 0,
647
+ oldValue: 0,
648
+ dragging: !1,
649
+ sliderSize: 1
650
+ }), {
651
+ elFormItem: s,
652
+ slider: w,
653
+ firstButton: g,
654
+ secondButton: p,
655
+ sliderDisabled: i,
656
+ minValue: E,
657
+ maxValue: F,
658
+ runwayStyle: C,
659
+ barStyle: A,
660
+ resetSize: T,
661
+ emitChange: z,
662
+ onSliderWrapperPrevent: P,
663
+ onSliderClick: L,
664
+ onSliderDown: x,
665
+ onSliderMarkerDown: U,
666
+ setFirstValue: K,
667
+ setSecondValue: j
668
+ } = ht(a, d, o), { stops: G, getStopStyle: X } = xt(a, d, E, F), { inputId: q, isLabeledByFormItem: W } = nt(a, {
669
+ formItemContext: s
670
+ }), f = Ye(), k = V(() => a.inputSize || f.value), M = V(() => a.ariaLabel || m("el.slider.defaultLabel", {
671
+ min: a.min,
672
+ max: a.max
673
+ })), n = V(() => a.range ? a.rangeStartLabel || m("el.slider.defaultRangeStartLabel") : M.value), r = V(() => a.formatValueText ? a.formatValueText(b.value) : `${b.value}`), c = V(() => a.rangeEndLabel || m("el.slider.defaultRangeEndLabel")), S = V(() => a.formatValueText ? a.formatValueText(_.value) : `${_.value}`), h = V(() => [
674
+ v.b(),
675
+ v.m(f.value),
676
+ v.is("vertical", a.vertical),
677
+ { [v.m("with-input")]: a.showInput }
678
+ ]), N = yt(a);
679
+ Mt(a, d, E, F, o, s);
680
+ const I = V(() => {
681
+ const y = [a.min, a.max, a.step].map((Pe) => {
682
+ const re = `${Pe}`.split(".")[1];
683
+ return re ? re.length : 0;
684
+ });
685
+ return Math.max.apply(null, y);
686
+ }), { sliderWrapper: u } = gt(a, d, T), { firstValue: b, secondValue: _, sliderSize: H } = Ne(d), We = (y) => {
687
+ d.dragging = y;
688
+ };
689
+ return ye(u, "touchstart", P, {
690
+ passive: !1
691
+ }), ye(u, "touchmove", P, {
692
+ passive: !1
693
+ }), Ze(Oe, {
694
+ ...Ne(a),
695
+ sliderSize: H,
696
+ disabled: i,
697
+ precision: I,
698
+ emitChange: z,
699
+ resetSize: T,
700
+ updateDragging: We
701
+ }), l({
702
+ onSliderClick: L
703
+ }), (y, Pe) => {
704
+ var re, xe;
705
+ return B(), $("div", {
706
+ id: y.range ? t(q) : void 0,
707
+ ref_key: "sliderWrapper",
708
+ ref: u,
709
+ class: Y(t(h)),
710
+ role: y.range ? "group" : void 0,
711
+ "aria-label": y.range && !t(W) ? t(M) : void 0,
712
+ "aria-labelledby": y.range && t(W) ? (re = t(s)) == null ? void 0 : re.labelId : void 0
713
+ }, [
714
+ ne("div", {
715
+ ref_key: "slider",
716
+ ref: w,
717
+ class: Y([
718
+ t(v).e("runway"),
719
+ { "show-input": y.showInput && !y.range },
720
+ t(v).is("disabled", t(i))
721
+ ]),
722
+ style: te(t(C)),
723
+ onMousedown: t(x),
724
+ onTouchstartPassive: t(x)
725
+ }, [
726
+ ne("div", {
727
+ class: Y(t(v).e("bar")),
728
+ style: te(t(A))
729
+ }, null, 6),
730
+ ie(Fe, {
731
+ id: y.range ? void 0 : t(q),
732
+ ref_key: "firstButton",
733
+ ref: g,
734
+ "model-value": t(b),
735
+ vertical: y.vertical,
736
+ "tooltip-class": y.tooltipClass,
737
+ placement: y.placement,
738
+ role: "slider",
739
+ "aria-label": y.range || !t(W) ? t(n) : void 0,
740
+ "aria-labelledby": !y.range && t(W) ? (xe = t(s)) == null ? void 0 : xe.labelId : void 0,
741
+ "aria-valuemin": y.min,
742
+ "aria-valuemax": y.range ? t(_) : y.max,
743
+ "aria-valuenow": t(b),
744
+ "aria-valuetext": t(r),
745
+ "aria-orientation": y.vertical ? "vertical" : "horizontal",
746
+ "aria-disabled": t(i),
747
+ "onUpdate:modelValue": t(K)
748
+ }, 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"]),
749
+ y.range ? (B(), Z(Fe, {
750
+ key: 0,
751
+ ref_key: "secondButton",
752
+ ref: p,
753
+ "model-value": t(_),
754
+ vertical: y.vertical,
755
+ "tooltip-class": y.tooltipClass,
756
+ placement: y.placement,
757
+ role: "slider",
758
+ "aria-label": t(c),
759
+ "aria-valuemin": t(b),
760
+ "aria-valuemax": y.max,
761
+ "aria-valuenow": t(_),
762
+ "aria-valuetext": t(S),
763
+ "aria-orientation": y.vertical ? "vertical" : "horizontal",
764
+ "aria-disabled": t(i),
765
+ "onUpdate:modelValue": t(j)
766
+ }, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : le("v-if", !0),
767
+ y.showStops ? (B(), $("div", { key: 1 }, [
768
+ (B(!0), $(me, null, pe(t(G), (J, oe) => (B(), $("div", {
769
+ key: oe,
770
+ class: Y(t(v).e("stop")),
771
+ style: te(t(X)(J))
772
+ }, null, 6))), 128))
773
+ ])) : le("v-if", !0),
774
+ t(N).length > 0 ? (B(), $(me, { key: 2 }, [
775
+ ne("div", null, [
776
+ (B(!0), $(me, null, pe(t(N), (J, oe) => (B(), $("div", {
777
+ key: oe,
778
+ style: te(t(X)(J.position)),
779
+ class: Y([t(v).e("stop"), t(v).e("marks-stop")])
780
+ }, null, 6))), 128))
781
+ ]),
782
+ ne("div", {
783
+ class: Y(t(v).e("marks"))
784
+ }, [
785
+ (B(!0), $(me, null, pe(t(N), (J, oe) => (B(), Z(t(zt), {
786
+ key: oe,
787
+ mark: J.mark,
788
+ style: te(t(X)(J.position)),
789
+ onMousedown: fe((Yt) => t(U)(J.position), ["stop"])
790
+ }, null, 8, ["mark", "style", "onMousedown"]))), 128))
791
+ ], 2)
792
+ ], 64)) : le("v-if", !0)
793
+ ], 46, ["onMousedown", "onTouchstartPassive"]),
794
+ y.showInput && !y.range ? (B(), Z(t(vt), {
795
+ key: 0,
796
+ ref: "input",
797
+ "model-value": t(b),
798
+ class: Y(t(v).e("input")),
799
+ step: y.step,
800
+ disabled: t(i),
801
+ controls: y.showInputControls,
802
+ min: y.min,
803
+ max: y.max,
804
+ precision: t(I),
805
+ debounce: y.debounce,
806
+ size: t(k),
807
+ "onUpdate:modelValue": t(K),
808
+ onChange: t(z)
809
+ }, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "debounce", "size", "onUpdate:modelValue", "onChange"])) : le("v-if", !0)
810
+ ], 10, ["id", "role", "aria-label", "aria-labelledby"]);
811
+ };
812
+ }
813
+ });
814
+ var $t = /* @__PURE__ */ Ie(Kt, [["__file", "slider.vue"]]);
815
+ const Ot = Xe($t);
816
+ export {
817
+ Ot as E
818
+ };