@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.
Files changed (85) hide show
  1. package/README.md +193 -193
  2. package/dist/{AnnotationTool-BIQYccLV.mjs → AnnotationTool-ClUqfSZp.mjs} +35 -35
  3. package/dist/BIMX_Viewer_Lib.es.js +3 -3
  4. package/dist/BIMX_Viewer_Lib.umd.js +130 -138
  5. package/dist/{CommentTool-CTH0u76a.mjs → CommentTool-DcAcusOm.mjs} +168 -168
  6. package/dist/{HiddenTool-B1o4e4Mi.mjs → HiddenTool-D0kbPBtX.mjs} +13 -13
  7. package/dist/{InspectorTool-BnKwoEV6.mjs → InspectorTool-BMXg86Ow.mjs} +64 -64
  8. package/dist/{MeasureTool-DD0MQlVK.mjs → MeasureTool-CN4zNj6w.mjs} +22 -22
  9. package/dist/{MouseTool-B99s92wL.mjs → MouseTool-Dcp3UTRv.mjs} +15 -15
  10. package/dist/{NavigateTool-Bzni_edr.mjs → NavigateTool-TVHCkKRU.mjs} +13 -13
  11. package/dist/{RoamTool-BnF-1cl2.mjs → RoamTool-CkYHH7aP.mjs} +17 -17
  12. package/dist/ScreenShotTool-DC4RyElm.mjs +500 -0
  13. package/dist/{SectionTool-DJjxjkhi.mjs → SectionTool-Vn7purnG.mjs} +43 -43
  14. package/dist/SettingTool-DWoeF-dC.mjs +815 -0
  15. package/dist/StructureTree-DZ0gUacM.mjs +1846 -0
  16. package/dist/{alert-BMV9n7SQ.mjs → alert-BkyuKyki.mjs} +9 -9
  17. package/dist/el-input-number-CUWk0tiM.mjs +1169 -0
  18. package/dist/{index-BaDPCrAt.mjs → index-CBXvm6RA.mjs} +51711 -47848
  19. package/dist/index.html +17 -17
  20. 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
  21. package/dist/style.css +1 -1
  22. package/dist/{tallPanel-DojXnxix.mjs → tallPanel-HBoW6JCm.mjs} +15 -15
  23. package/package.json +2 -2
  24. package/types/components/BCFComponents/BCFAddPanel.vue.d.ts +38 -10
  25. package/types/components/BCFComponents/BCFDetailPanel.vue.d.ts +37 -9
  26. package/types/components/BCFComponents/BCFDisplayList.vue.d.ts +5 -7
  27. package/types/components/BCFComponents/BCFFilter.vue.d.ts +5 -7
  28. package/types/components/BCFComponents/BCFTool.vue.d.ts +4 -7
  29. package/types/components/BCFComponents/addObjectOrAnno.vue.d.ts +5 -7
  30. package/types/components/BCFComponents/checkObjectPanel.vue.d.ts +5 -6
  31. package/types/components/BCFComponents/commentInput.vue.d.ts +36 -10
  32. package/types/components/BCFComponents/commentsView.vue.d.ts +36 -7
  33. package/types/components/BCFComponents/dialogPanel.vue.d.ts +5 -8
  34. package/types/components/BCFComponents/imageView.vue.d.ts +5 -7
  35. package/types/components/BCFComponents/imageZoomIn.vue.d.ts +5 -6
  36. package/types/components/BimViewerComponents/AnnotationTool.vue.d.ts +1 -1
  37. package/types/components/BimViewerComponents/AppToolbar.vue.d.ts +18 -1
  38. package/types/components/BimViewerComponents/ClickEvent.vue.d.ts +1 -1
  39. package/types/components/BimViewerComponents/CommentTool.vue.d.ts +32 -1
  40. package/types/components/BimViewerComponents/HiddenTool.vue.d.ts +1 -1
  41. package/types/components/BimViewerComponents/MobileCommentsTool/add.vue.d.ts +6 -8
  42. package/types/components/BimViewerComponents/MobileCommentsTool/detail.vue.d.ts +4 -5
  43. package/types/components/BimViewerComponents/MobileCommentsTool/draw.vue.d.ts +2 -2
  44. package/types/components/BimViewerComponents/MobileCommentsTool/filter.vue.d.ts +478 -1
  45. package/types/components/BimViewerComponents/MobileCommentsTool/list.vue.d.ts +499 -7
  46. package/types/components/BimViewerComponents/MobileCommentsTool/zoomIn.vue.d.ts +5 -6
  47. package/types/components/BimViewerComponents/MouseTool.vue.d.ts +1 -1
  48. package/types/components/BimViewerComponents/NavigateTool.vue.d.ts +1 -1
  49. package/types/components/BimViewerComponents/PCCommentTool/pcdraw.vue.d.ts +1 -1
  50. package/types/components/BimViewerComponents/RoamTool.vue.d.ts +1 -1
  51. package/types/components/BimViewerComponents/SettingTool.vue.d.ts +4 -6
  52. package/types/components/BimViewerComponents/StructureTree.vue.d.ts +4026 -1
  53. package/types/components/BimViewerComponents/Toolbar.vue.d.ts +1 -1
  54. package/types/components/BimViewerComponents/mobileToolbar.vue.d.ts +18 -1
  55. package/types/components/BimxViewerComp.vue.d.ts +7 -14
  56. package/types/components/MobileBCFComponents/MobileBCFAdd.vue.d.ts +37 -10
  57. package/types/components/MobileBCFComponents/MobileBCFDetail.vue.d.ts +37 -9
  58. package/types/components/MobileBCFComponents/MobileBCFDisplayList.vue.d.ts +499 -7
  59. package/types/components/MobileBCFComponents/MobileBCFFilter.vue.d.ts +478 -1
  60. package/types/components/MobileBCFComponents/MobileBCFTool.vue.d.ts +5 -8
  61. package/types/components/MobileBCFComponents/MobileCommentInput.vue.d.ts +38 -12
  62. package/types/components/MobileBCFComponents/MobileCommentsView.vue.d.ts +7 -9
  63. package/types/components/MobileBCFComponents/selectPanel.vue.d.ts +5 -7
  64. package/types/components/bimxViewer.vue.d.ts +7 -14
  65. package/types/components/utilsComponents/alert.vue.d.ts +1 -1
  66. package/types/components/utilsComponents/closeButton.vue.d.ts +1 -1
  67. package/types/components/utilsComponents/closeButton_dark.vue.d.ts +1 -1
  68. package/types/components/utilsComponents/emptyPage.vue.d.ts +1 -1
  69. package/types/components/utilsComponents/loading.vue.d.ts +1 -1
  70. package/types/components/utilsComponents/panel.vue.d.ts +8 -2
  71. package/types/components/utilsComponents/prompt.vue.d.ts +1 -1
  72. package/types/components/utilsComponents/rectangleButton.vue.d.ts +3 -1
  73. package/types/components/utilsComponents/tallPanel.vue.d.ts +13 -3
  74. package/types/components/utilsComponents/tallPanel_noPos.vue.d.ts +13 -3
  75. package/types/pages/BimxViewerEntry.vue.d.ts +5 -57
  76. package/types/pages/viewerEntry.vue.d.ts +7 -57
  77. package/types/store/initConfigs.d.ts +1 -1
  78. package/types/store/toolbars.d.ts +46 -46
  79. package/dist/ScreenShotTool-CSBJzyDd.mjs +0 -357
  80. package/dist/SettingTool-D2qksFZK.mjs +0 -657
  81. package/dist/StructureTree-DrLo9Bch.mjs +0 -1583
  82. package/dist/el-input-number-BOQOKzK0.mjs +0 -818
  83. package/types/components/BCFComponents/BCFCommentNew.vue.d.ts +0 -22
  84. package/types/components/BimViewerComponents/emptyPage.vue.d.ts +0 -8
  85. package/types/tests/cmt.d.ts +0 -1
@@ -1,818 +0,0 @@
1
- import { defineComponent as ee, ref as D, reactive as Be, computed as V, watch as ie, onMounted as ze, onUpdated as je, openBlock as B, createElementBlock as $, normalizeClass as Y, unref as t, withModifiers as fe, withDirectives as Ce, withKeys as ce, renderSlot as Me, createVNode as se, withCtx as be, createBlock as J, createCommentVNode as le, nextTick as ge, shallowRef as He, inject as Ge, toRefs as Ne, normalizeStyle as te, createElementVNode as ne, toDisplayString as Ze, h as qe, provide as Je, Fragment as me, renderList as pe } from "vue";
2
- import { X as he, a1 as ke, Z as R, a5 as Ae, a0 as Ve, ac as Q, ah as de, Y as U, l as Ke, u as we, a7 as $e, ai as ve, d as ae, a2 as Ye, a3 as Qe, c as Le, aj as Te, t as De, _ as Ie, af as Re, f as Ee, w as Xe, ab as ue, ak as Oe, al as et, g as ye, am as _e, j as tt, an as lt, a8 as nt } from "./index-BaDPCrAt.mjs";
3
- import { ArrowDown as at, Minus as rt, ArrowUp as ot, Plus as ut } from "@element-plus/icons-vue";
4
- const it = 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
- }), st = {
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
- [U]: (e) => R(e) || de(e)
57
- }, dt = ee({
58
- name: "ElInputNumber"
59
- }), ct = /* @__PURE__ */ ee({
60
- ...dt,
61
- props: it,
62
- emits: st,
63
- setup(e, { expose: l, emit: o }) {
64
- const a = e, { t: v } = Ke(), m = we("input-number"), d = D(), i = 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), s = 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(), M = Qe(), A = V(() => {
71
- if (i.userInput !== null)
72
- return i.userInput;
73
- let n = i.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 = s.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
- }, x = (n, r = 1) => R(n) ? T(n + a.step * r) : i.currentValue, L = () => {
98
- if (a.readonly || M.value || p.value)
99
- return;
100
- const n = Number(A.value) || 0, r = x(n);
101
- K(r), o(Q, i.currentValue), k();
102
- }, P = () => {
103
- if (a.readonly || M.value || g.value)
104
- return;
105
- const n = Number(A.value) || 0, r = x(n, -1);
106
- K(r), o(Q, i.currentValue), k();
107
- }, O = (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(U, b)), b;
119
- }, K = (n, r = !0) => {
120
- var c;
121
- const S = i.currentValue, h = O(n);
122
- if (!r) {
123
- o(U, h);
124
- return;
125
- }
126
- S === h && n || (i.userInput = null, o(U, 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))), i.currentValue = h);
127
- }, j = (n) => {
128
- i.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(), i.userInput = null;
134
- }, X = () => {
135
- var n, r;
136
- (r = (n = d.value) == null ? void 0 : n.focus) == null || r.call(n);
137
- }, Z = () => {
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
- i.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
- i.currentValue !== a.modelValue && (i.currentValue = a.modelValue);
147
- }, C = (n) => {
148
- document.activeElement === n.target && n.preventDefault();
149
- };
150
- return ie(() => a.modelValue, (n, r) => {
151
- const c = O(n, !0);
152
- i.userInput === null && c !== r && (i.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", i.currentValue || i.currentValue === 0 ? String(i.currentValue) : ""), h.setAttribute("aria-disabled", String(M.value)), !R(S) && S != null) {
157
- let N = Number(S);
158
- Number.isNaN(N) && (N = null), o(U, N);
159
- }
160
- h.addEventListener("wheel", C, { 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 = i.currentValue) != null ? r : ""}`);
165
- }), l({
166
- focus: X,
167
- blur: Z
168
- }), (n, r) => (B(), $("div", {
169
- class: Y([
170
- t(m).b(),
171
- t(m).m(t(F)),
172
- t(m).is("disabled", t(M)),
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 ? Ce((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(P, ["enter"])
185
- }, [
186
- Me(n.$slots, "decrease-icon", {}, () => [
187
- se(t(Le), null, {
188
- default: be(() => [
189
- t(E) ? (B(), J(t(at), { key: 0 })) : (B(), J(t(rt), { key: 1 }))
190
- ]),
191
- _: 1
192
- })
193
- ])
194
- ], 42, ["aria-label", "onKeydown"])), [
195
- [t(Te), P]
196
- ]) : le("v-if", !0),
197
- n.controls ? Ce((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
- Me(n.$slots, "increase-icon", {}, () => [
205
- se(t(Le), null, {
206
- default: be(() => [
207
- t(E) ? (B(), J(t(ot), { key: 0 })) : (B(), J(t(ut), { key: 1 }))
208
- ]),
209
- _: 1
210
- })
211
- ])
212
- ], 42, ["aria-label", "onKeydown"])), [
213
- [t(Te), L]
214
- ]) : le("v-if", !0),
215
- se(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(M),
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(P, ["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), Ue = 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: Oe,
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
- [U]: 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(), i = D(), w = {
335
- firstButton: d,
336
- secondButton: i
337
- }, g = V(() => e.disabled || (a == null ? void 0 : a.disabled) || !1), p = V(() => Math.min(l.firstValue, l.secondValue)), s = V(() => Math.max(l.firstValue, l.secondValue)), E = V(() => e.range ? `${100 * (s.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%"), M = 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 C;
350
- return Math.abs(p.value - k) < Math.abs(s.value - k) ? C = l.firstValue < l.secondValue ? "firstButton" : "secondButton" : C = l.firstValue > l.secondValue ? "firstButton" : "secondButton", w[C];
351
- }, x = (f) => {
352
- const k = z(f);
353
- return k.value.setPosition(f), k;
354
- }, L = (f) => {
355
- l.firstValue = f ?? e.min, O(e.range ? [p.value, s.value] : f ?? e.min);
356
- }, P = (f) => {
357
- l.secondValue = f, e.range && O([p.value, s.value]);
358
- }, O = (f) => {
359
- o(U, f), o(Q, f);
360
- }, K = async () => {
361
- await ge(), o(Ve, e.range ? [p.value, s.value] : e.modelValue);
362
- }, j = (f) => {
363
- var k, C, 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 = (C = (k = f.touches) == null ? void 0 : k.item(0)) == null ? void 0 : C.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 x(h);
377
- };
378
- return {
379
- elFormItem: v,
380
- slider: m,
381
- firstButton: d,
382
- secondButton: i,
383
- sliderDisabled: g,
384
- minValue: p,
385
- maxValue: s,
386
- runwayStyle: M,
387
- barStyle: A,
388
- resetSize: T,
389
- setPosition: x,
390
- emitChange: K,
391
- onSliderWrapperPrevent: (f) => {
392
- var k, C;
393
- ((k = w.firstButton.value) != null && k.dragging || (C = w.secondButton.value) != null && C.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 || x(f);
404
- },
405
- setFirstValue: L,
406
- setSecondValue: P
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), i = _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: i,
419
- hideTooltip: w
420
- };
421
- }, xt = (e, l, o) => {
422
- const {
423
- disabled: a,
424
- min: v,
425
- max: m,
426
- step: d,
427
- showTooltip: i,
428
- precision: w,
429
- sliderSize: g,
430
- formatTooltip: p,
431
- emitChange: s,
432
- resetSize: E,
433
- updateDragging: F
434
- } = Ge(Ue), { tooltip: M, tooltipVisible: A, formatValue: T, displayTooltip: z, hideTooltip: x } = It(e, p, i), L = D(), P = V(() => `${(e.modelValue - v.value) / (m.value - v.value) * 100}%`), O = V(() => e.vertical ? { bottom: P.value } : { left: P.value }), K = () => {
435
- l.hovering = !0, z();
436
- }, j = () => {
437
- l.hovering = !1, l.dragging || x();
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(P.value) + u / (m.value - v.value) * 100, I(l.newPosition), s());
442
- }, Z = () => {
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
- }, C = () => {
451
- a.value || (I(0), s());
452
- }, n = () => {
453
- a.value || (I(100), s());
454
- }, r = (u) => {
455
- let b = !0;
456
- [Vt, wt].includes(u.key) ? Z() : [pt, St].includes(u.key) ? W() : u.key === Nt ? C() : 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(P.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 || x(), l.isClick || I(l.newPosition), s();
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(U, H), !l.dragging && e.modelValue !== l.oldValue && (l.oldValue = e.modelValue), await ge(), l.dragging && z(), M.value.updatePopper();
485
- };
486
- return ie(() => l.dragging, (u) => {
487
- F(u);
488
- }), ye(L, "touchstart", G, { passive: !1 }), {
489
- disabled: a,
490
- button: L,
491
- tooltip: M,
492
- tooltipVisible: A,
493
- showTooltip: i,
494
- wrapperStyle: O,
495
- formatValue: T,
496
- handleMouseEnter: K,
497
- handleMouseLeave: j,
498
- onButtonDown: G,
499
- onKeyDown: r,
500
- setPosition: I
501
- };
502
- }, Pt = (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, i = 100 * e.step / (e.max - e.min), w = Array.from({ length: d - 1 }).map((g, p) => (p + 1) * i);
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
- }), Ct = (e, l, o, a, v, m) => {
513
- const d = (g) => {
514
- v(U, g), v(Q, g);
515
- }, i = () => 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 s = e.modelValue;
519
- e.range && Array.isArray(s) ? s[1] < e.min ? d([e.min, e.min]) : s[0] > e.max ? d([e.max, e.max]) : s[0] < e.min ? d([e.min, s[1]]) : s[1] > e.max ? d([s[0], e.max]) : (l.firstValue = s[0], l.secondValue = s[1], i() && (e.validateEvent && ((g = m == null ? void 0 : m.validate) == null || g.call(m, "change").catch((E) => ae(E))), l.oldValue = s.slice())) : !e.range && typeof s == "number" && !Number.isNaN(s) && (s < e.min ? d(e.min) : s > e.max ? d(e.max) : (l.firstValue = s, i() && (e.validateEvent && ((p = m == null ? void 0 : m.validate) == null || p.call(m, "change").catch((E) => ae(E))), l.oldValue = s)));
520
- };
521
- w(), ie(() => l.dragging, (g) => {
522
- g || w();
523
- }), ie(() => e.modelValue, (g, p) => {
524
- l.dragging || Array.isArray(g) && Array.isArray(p) && g.every((s, E) => s === p[E]) && l.firstValue === g[0] && l.secondValue === g[1] || w();
525
- }, {
526
- deep: !0
527
- }), ie(() => [e.min, e.max], () => {
528
- w();
529
- });
530
- }, Mt = he({
531
- modelValue: {
532
- type: Number,
533
- default: 0
534
- },
535
- vertical: Boolean,
536
- tooltipClass: String,
537
- placement: {
538
- type: String,
539
- values: Oe,
540
- default: "top"
541
- }
542
- }), Lt = {
543
- [U]: (e) => R(e)
544
- }, Tt = ee({
545
- name: "ElSliderButton"
546
- }), _t = /* @__PURE__ */ ee({
547
- ...Tt,
548
- props: Mt,
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: i,
565
- tooltip: w,
566
- showTooltip: g,
567
- tooltipVisible: p,
568
- wrapperStyle: s,
569
- formatValue: E,
570
- handleMouseEnter: F,
571
- handleMouseLeave: M,
572
- onButtonDown: A,
573
- onKeyDown: T,
574
- setPosition: z
575
- } = xt(a, m, o), { hovering: x, dragging: L } = Ne(m);
576
- return l({
577
- onButtonDown: A,
578
- onKeyDown: T,
579
- setPosition: z,
580
- hovering: x,
581
- dragging: L
582
- }), (P, O) => (B(), $("div", {
583
- ref_key: "button",
584
- ref: i,
585
- class: Y([t(v).e("button-wrapper"), { hover: t(x), dragging: t(L) }]),
586
- style: te(t(s)),
587
- tabindex: t(d) ? -1 : 0,
588
- onMouseenter: t(F),
589
- onMouseleave: t(M),
590
- onMousedown: t(A),
591
- onFocus: t(F),
592
- onBlur: t(M),
593
- onKeydown: t(T)
594
- }, [
595
- se(t(lt), {
596
- ref_key: "tooltip",
597
- ref: w,
598
- visible: t(p),
599
- placement: P.placement,
600
- "fallback-placements": ["top", "bottom", "right", "left"],
601
- "stop-popper-mouse-event": !1,
602
- "popper-class": P.tooltipClass,
603
- disabled: !t(g),
604
- persistent: ""
605
- }, {
606
- content: be(() => [
607
- ne("span", null, Ze(t(E)), 1)
608
- ]),
609
- default: be(() => [
610
- ne("div", {
611
- class: Y([t(v).e("button"), { hover: t(x), 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 () => qe("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: i,
652
- slider: w,
653
- firstButton: g,
654
- secondButton: p,
655
- sliderDisabled: s,
656
- minValue: E,
657
- maxValue: F,
658
- runwayStyle: M,
659
- barStyle: A,
660
- resetSize: T,
661
- emitChange: z,
662
- onSliderWrapperPrevent: x,
663
- onSliderClick: L,
664
- onSliderDown: P,
665
- onSliderMarkerDown: O,
666
- setFirstValue: K,
667
- setSecondValue: j
668
- } = ht(a, d, o), { stops: G, getStopStyle: X } = Pt(a, d, E, F), { inputId: Z, isLabeledByFormItem: W } = nt(a, {
669
- formItemContext: i
670
- }), f = Ye(), k = V(() => a.inputSize || f.value), C = 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") : C.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
- Ct(a, d, E, F, o, i);
680
- const I = V(() => {
681
- const y = [a.min, a.max, a.step].map((xe) => {
682
- const re = `${xe}`.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", x, {
690
- passive: !1
691
- }), ye(u, "touchmove", x, {
692
- passive: !1
693
- }), Je(Ue, {
694
- ...Ne(a),
695
- sliderSize: H,
696
- disabled: s,
697
- precision: I,
698
- emitChange: z,
699
- resetSize: T,
700
- updateDragging: We
701
- }), l({
702
- onSliderClick: L
703
- }), (y, xe) => {
704
- var re, Pe;
705
- return B(), $("div", {
706
- id: y.range ? t(Z) : 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(C) : void 0,
712
- "aria-labelledby": y.range && t(W) ? (re = t(i)) == 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(s))
721
- ]),
722
- style: te(t(M)),
723
- onMousedown: t(P),
724
- onTouchstartPassive: t(P)
725
- }, [
726
- ne("div", {
727
- class: Y(t(v).e("bar")),
728
- style: te(t(A))
729
- }, null, 6),
730
- se(Fe, {
731
- id: y.range ? void 0 : t(Z),
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) ? (Pe = t(i)) == null ? void 0 : Pe.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(s),
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(), J(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(s),
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), (q, oe) => (B(), $("div", {
769
- key: oe,
770
- class: Y(t(v).e("stop")),
771
- style: te(t(X)(q))
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), (q, oe) => (B(), $("div", {
777
- key: oe,
778
- style: te(t(X)(q.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), (q, oe) => (B(), J(t(zt), {
786
- key: oe,
787
- mark: q.mark,
788
- style: te(t(X)(q.position)),
789
- onMousedown: fe((Yt) => t(O)(q.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(), J(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(s),
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 Ut = Xe($t);
816
- export {
817
- Ut as E
818
- };