@xtctwins/tctwins-bimx-engine 0.3.21 → 0.3.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.
- package/README.md +196 -196
- package/dist/{AnnotationTool-DCHJcLix.mjs → AnnotationTool-CtRhDcPK.mjs} +35 -35
- package/dist/BIMX_Viewer_Lib.es.js +6 -6
- package/dist/BIMX_Viewer_Lib.umd.js +214 -167
- package/dist/{CameraViewTool-CJfs6vWu.mjs → CameraViewTool-CtLUEw0Q.mjs} +38 -38
- package/dist/{CommentTool-mcXTV3bv.mjs → CommentTool-B8fvijhz.mjs} +192 -192
- package/dist/{HiddenTool-BXTqbPUK.mjs → HiddenTool-511eglcE.mjs} +13 -13
- package/dist/{InspectorTool-D6DtUWoh.mjs → InspectorTool-D9Yjs6eH.mjs} +13 -13
- package/dist/{MeasureTool-BZxE7H7U.mjs → MeasureTool-C5Ce0Nef.mjs} +125 -125
- package/dist/{MouseTool-Clt4JeIj.mjs → MouseTool-BJX4hgly.mjs} +8 -8
- package/dist/{NavigateTool-cQshheaw.mjs → NavigateTool-BxOX-2P9.mjs} +8 -8
- package/dist/{OperateTool-C86C-l1z.mjs → OperateTool-DdkSl849.mjs} +61 -58
- package/dist/{RoamTool-DueJxPwv.mjs → RoamTool-CzNcha7A.mjs} +27 -27
- package/dist/ScreenShotTool-_TQ3T0xw.mjs +429 -0
- package/dist/{SectionTool-CKrvJEQ9.mjs → SectionTool-DlUhDw_i.mjs} +70 -70
- package/dist/SettingTool-yhgi_CY0.mjs +1787 -0
- package/dist/StructureTree-CNKrxyeJ.mjs +1685 -0
- package/dist/{alert-D-agI6w6.mjs → alert-B0WoSDD3.mjs} +14 -14
- package/dist/{index-jngVSTsO.mjs → index-D7FcGpin.mjs} +56419 -53825
- package/dist/index.html +17 -17
- package/dist/{panel.vue_vue_type_style_index_0_lang-DfDOwKP2.mjs → panel.vue_vue_type_style_index_0_lang-BG2LZoNF.mjs} +1 -1
- package/dist/style.css +3 -3
- package/dist/{tallPanel-CNORaYkU.mjs → tallPanel-DpEzw_w-.mjs} +12 -12
- package/package.json +85 -85
- package/types/components/BCFComponents/BCFAddPanel.vue.d.ts +38 -10
- package/types/components/BCFComponents/BCFDetailPanel.vue.d.ts +37 -9
- package/types/components/BCFComponents/BCFDisplayList.vue.d.ts +5 -7
- package/types/components/BCFComponents/BCFFilter.vue.d.ts +5 -7
- package/types/components/BCFComponents/BCFTool.vue.d.ts +4 -7
- package/types/components/BCFComponents/addObjectOrAnno.vue.d.ts +5 -7
- package/types/components/BCFComponents/checkObjectPanel.vue.d.ts +5 -6
- package/types/components/BCFComponents/commentInput.vue.d.ts +36 -10
- package/types/components/BCFComponents/commentsView.vue.d.ts +36 -7
- package/types/components/BCFComponents/dialogPanel.vue.d.ts +5 -8
- package/types/components/BCFComponents/imageView.vue.d.ts +5 -7
- package/types/components/BCFComponents/imageZoomIn.vue.d.ts +5 -6
- package/types/components/BimViewerComponents/AnnotationTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/AppToolbar.vue.d.ts +18 -1
- package/types/components/BimViewerComponents/CameraViewTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/ClickEvent.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/CommentTool.vue.d.ts +32 -1
- package/types/components/BimViewerComponents/HiddenTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/MobileCommentsTool/add.vue.d.ts +6 -8
- package/types/components/BimViewerComponents/MobileCommentsTool/detail.vue.d.ts +4 -5
- package/types/components/BimViewerComponents/MobileCommentsTool/draw.vue.d.ts +2 -2
- package/types/components/BimViewerComponents/MobileCommentsTool/filter.vue.d.ts +270 -1
- package/types/components/BimViewerComponents/MobileCommentsTool/list.vue.d.ts +291 -7
- package/types/components/BimViewerComponents/MobileCommentsTool/zoomIn.vue.d.ts +5 -6
- package/types/components/BimViewerComponents/MouseTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/NavigateTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/PCCommentTool/pcdraw.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/RoamTool.vue.d.ts +1 -1
- package/types/components/BimViewerComponents/SettingTool.vue.d.ts +4 -6
- package/types/components/BimViewerComponents/StructureTree.vue.d.ts +11642 -1
- package/types/components/BimViewerComponents/Toolbar.vue.d.ts +1 -1
- package/types/components/BimxViewerComp.vue.d.ts +7 -21
- package/types/components/MobileBCFComponents/MobileBCFAdd.vue.d.ts +37 -10
- package/types/components/MobileBCFComponents/MobileBCFDetail.vue.d.ts +37 -9
- package/types/components/MobileBCFComponents/MobileBCFDisplayList.vue.d.ts +291 -7
- package/types/components/MobileBCFComponents/MobileBCFFilter.vue.d.ts +270 -1
- package/types/components/MobileBCFComponents/MobileBCFTool.vue.d.ts +5 -8
- package/types/components/MobileBCFComponents/MobileCommentInput.vue.d.ts +38 -12
- package/types/components/MobileBCFComponents/MobileCommentsView.vue.d.ts +7 -9
- package/types/components/MobileBCFComponents/selectPanel.vue.d.ts +5 -7
- package/types/components/utilsComponents/alert.vue.d.ts +1 -1
- package/types/components/utilsComponents/closeButton.vue.d.ts +1 -1
- package/types/components/utilsComponents/closeButton_dark.vue.d.ts +1 -1
- package/types/components/utilsComponents/emptyPage.vue.d.ts +1 -1
- package/types/components/utilsComponents/loading.vue.d.ts +1 -1
- package/types/components/utilsComponents/panel.vue.d.ts +8 -2
- package/types/components/utilsComponents/prompt.vue.d.ts +1 -1
- package/types/components/utilsComponents/rectangleButton.vue.d.ts +3 -1
- package/types/components/utilsComponents/tallPanel.vue.d.ts +13 -3
- package/types/components/utilsComponents/tallPanel_noPos.vue.d.ts +13 -3
- package/types/pages/BimxViewerEntry.vue.d.ts +4 -66
- package/types/store/toolbars.d.ts +50 -50
- package/types/viewerManager/sectionManager.d.ts +25 -25
- package/dist/01.xtc +0 -0
- package/dist/02.xtc +0 -0
- package/dist/03.xtc +0 -0
- package/dist/ScreenShotTool-DDtQfqF5.mjs +0 -356
- package/dist/SettingTool-CWAOl-yl.mjs +0 -1508
- package/dist/StructureTree-BTqIDob7.mjs +0 -1582
- package/types/components/BCFComponents/BCFCommentNew.vue.d.ts +0 -22
- package/types/components/BimViewerComponents/emptyPage.vue.d.ts +0 -8
- package/types/components/BimViewerComponents/mobileToolbar.vue.d.ts +0 -10
- package/types/components/bimxViewer.vue.d.ts +0 -27
- package/types/pages/viewerEntry.vue.d.ts +0 -116
- package/types/tests/cmt.d.ts +0 -1
|
@@ -0,0 +1,1787 @@
|
|
|
1
|
+
import { ao as ve, an as J, m as $e, az as Ve, am as Ee, b as Le, ap as Ge, j as ce, aq as Je, B as ct, u as Ue, au as Ze, i as Fe, x as xe, a as qe, ar as _e, E as pe, aA as at, J as kt, aB as Qe, o as Me, N as Ae, z as vt, aC as xt, A as he, w as et, l as Pe, aD as mt, y as We, aE as it, aF as Et, W as ft, av as gt, c as Nt, g as Oe, h as Re, aG as Ct, aH as ot, F as It, O as Mt, G as Bt, T as st, H as Se, aI as Ne, I as Ce, K as Tt, aJ as $t, v as Pt, L as At, a0 as zt, M as Lt } from "./index-D7FcGpin.mjs";
|
|
2
|
+
import { _ as Ut } from "./panel.vue_vue_type_style_index_0_lang-BG2LZoNF.mjs";
|
|
3
|
+
import { ArrowDown as Ft, Minus as Rt, ArrowUp as Kt, Plus as Ot, Loading as Wt } from "@element-plus/icons-vue";
|
|
4
|
+
import { defineComponent as Te, ref as O, reactive as tt, computed as k, watch as we, onMounted as Ye, onUpdated as Yt, openBlock as b, createElementBlock as P, withModifiers as lt, normalizeClass as j, unref as t, withDirectives as ut, withKeys as He, renderSlot as ye, createVNode as z, withCtx as ae, createBlock as q, createCommentVNode as Y, createSlots as Xt, nextTick as ze, watchEffect as jt, shallowRef as bt, inject as Gt, toRefs as De, normalizeStyle as me, createElementVNode as r, toDisplayString as B, h as Ht, provide as Dt, Fragment as ke, renderList as Be, resolveDynamicComponent as Ie, onBeforeUnmount as Jt, createTextVNode as be } from "vue";
|
|
5
|
+
import { T as Zt } from "./timer-DoTiGoWP.mjs";
|
|
6
|
+
const qt = Le({
|
|
7
|
+
/**
|
|
8
|
+
* @description same as `id` in native input
|
|
9
|
+
*/
|
|
10
|
+
id: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: void 0
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* @description incremental step
|
|
16
|
+
*/
|
|
17
|
+
step: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 1
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* @description whether input value can only be multiple of step
|
|
23
|
+
*/
|
|
24
|
+
stepStrictly: Boolean,
|
|
25
|
+
/**
|
|
26
|
+
* @description the maximum allowed value
|
|
27
|
+
*/
|
|
28
|
+
max: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: Number.MAX_SAFE_INTEGER
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* @description the minimum allowed value
|
|
34
|
+
*/
|
|
35
|
+
min: {
|
|
36
|
+
type: Number,
|
|
37
|
+
default: Number.MIN_SAFE_INTEGER
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* @description binding value
|
|
41
|
+
*/
|
|
42
|
+
modelValue: { type: [Number, null] },
|
|
43
|
+
/**
|
|
44
|
+
* @description same as `readonly` in native input
|
|
45
|
+
*/
|
|
46
|
+
readonly: Boolean,
|
|
47
|
+
/**
|
|
48
|
+
* @description whether the component is disabled
|
|
49
|
+
*/
|
|
50
|
+
disabled: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: void 0
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* @description size of the component
|
|
56
|
+
*/
|
|
57
|
+
size: Ge,
|
|
58
|
+
/**
|
|
59
|
+
* @description whether to enable the control buttons
|
|
60
|
+
*/
|
|
61
|
+
controls: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !0
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* @description position of the control buttons
|
|
67
|
+
*/
|
|
68
|
+
controlsPosition: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: "",
|
|
71
|
+
values: ["", "right"]
|
|
72
|
+
},
|
|
73
|
+
/**
|
|
74
|
+
* @description value should be set when input box is cleared
|
|
75
|
+
*/
|
|
76
|
+
valueOnClear: {
|
|
77
|
+
type: ce([
|
|
78
|
+
String,
|
|
79
|
+
Number,
|
|
80
|
+
null
|
|
81
|
+
]),
|
|
82
|
+
validator: (e) => e === null || J(e) || ["min", "max"].includes(e),
|
|
83
|
+
default: null
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* @description same as `name` in native input
|
|
87
|
+
*/
|
|
88
|
+
name: String,
|
|
89
|
+
/**
|
|
90
|
+
* @description same as `placeholder` in native input
|
|
91
|
+
*/
|
|
92
|
+
placeholder: String,
|
|
93
|
+
/**
|
|
94
|
+
* @description precision of input value
|
|
95
|
+
*/
|
|
96
|
+
precision: {
|
|
97
|
+
type: Number,
|
|
98
|
+
validator: (e) => e >= 0 && e === Number.parseInt(`${e}`, 10)
|
|
99
|
+
},
|
|
100
|
+
/**
|
|
101
|
+
* @description whether to trigger form validation
|
|
102
|
+
*/
|
|
103
|
+
validateEvent: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: !0
|
|
106
|
+
},
|
|
107
|
+
...Je(["ariaLabel"]),
|
|
108
|
+
/**
|
|
109
|
+
* @description native input mode for virtual keyboards
|
|
110
|
+
*/
|
|
111
|
+
inputmode: {
|
|
112
|
+
type: ce(String),
|
|
113
|
+
default: void 0
|
|
114
|
+
},
|
|
115
|
+
/**
|
|
116
|
+
* @description alignment for the inner input text
|
|
117
|
+
*/
|
|
118
|
+
align: {
|
|
119
|
+
type: ce(String),
|
|
120
|
+
default: "center"
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
* @description whether to disable scientific notation input (e.g. 'e', 'E')
|
|
124
|
+
*/
|
|
125
|
+
disabledScientific: Boolean,
|
|
126
|
+
/**
|
|
127
|
+
* @description specifies the format of the value presented in the input
|
|
128
|
+
*/
|
|
129
|
+
formatter: { type: Function },
|
|
130
|
+
/**
|
|
131
|
+
* @description specifies the value extracted from the formatted input
|
|
132
|
+
*/
|
|
133
|
+
parser: { type: Function },
|
|
134
|
+
/**
|
|
135
|
+
* @description same as `tabindex` in native input
|
|
136
|
+
*/
|
|
137
|
+
tabindex: {
|
|
138
|
+
type: [String, Number],
|
|
139
|
+
default: 0
|
|
140
|
+
}
|
|
141
|
+
}), _t = {
|
|
142
|
+
[Ee]: (e, a) => a !== e,
|
|
143
|
+
blur: (e) => e instanceof FocusEvent,
|
|
144
|
+
focus: (e) => e instanceof FocusEvent,
|
|
145
|
+
[Ve]: (e) => J(e) || $e(e),
|
|
146
|
+
[ve]: (e) => J(e) || $e(e)
|
|
147
|
+
}, Qt = ["aria-label"], el = ["aria-label"];
|
|
148
|
+
var tl = /* @__PURE__ */ Te({
|
|
149
|
+
name: "ElInputNumber",
|
|
150
|
+
__name: "input-number",
|
|
151
|
+
props: qt,
|
|
152
|
+
emits: _t,
|
|
153
|
+
setup(e, { expose: a, emit: u }) {
|
|
154
|
+
const n = e, g = u, { t: c } = ct(), f = Ue("input-number"), v = O(), m = tt({
|
|
155
|
+
currentValue: n.modelValue,
|
|
156
|
+
userInput: null
|
|
157
|
+
}), { formItem: s } = Ze(), x = k(() => J(n.modelValue) && n.modelValue <= n.min), A = k(() => J(n.modelValue) && n.modelValue >= n.max), M = k(() => {
|
|
158
|
+
const i = D(n.step);
|
|
159
|
+
return Fe(n.precision) ? Math.max(D(n.modelValue), i) : (i > n.precision && xe("InputNumber", "precision should not be less than the decimal places of step"), n.precision);
|
|
160
|
+
}), G = k(() => n.controls && n.controlsPosition === "right"), H = qe(), L = _e(), R = k(() => {
|
|
161
|
+
if (m.userInput !== null) return m.userInput;
|
|
162
|
+
let i = m.currentValue;
|
|
163
|
+
if ($e(i)) return "";
|
|
164
|
+
if (J(i)) {
|
|
165
|
+
if (Number.isNaN(i)) return "";
|
|
166
|
+
Fe(n.precision) || (i = i.toFixed(n.precision));
|
|
167
|
+
}
|
|
168
|
+
return i;
|
|
169
|
+
}), V = (i, d) => {
|
|
170
|
+
if (Fe(d) && (d = M.value), d === 0) return Math.round(i);
|
|
171
|
+
let S = String(i);
|
|
172
|
+
const N = S.indexOf(".");
|
|
173
|
+
if (N === -1 || !S.replace(".", "").split("")[N + d]) return i;
|
|
174
|
+
const te = S.length;
|
|
175
|
+
return S.charAt(te - 1) === "5" && (S = `${S.slice(0, Math.max(0, te - 1))}6`), Number.parseFloat(Number(S).toFixed(d));
|
|
176
|
+
}, D = (i) => {
|
|
177
|
+
if ($e(i)) return 0;
|
|
178
|
+
const d = i.toString(), S = d.indexOf(".");
|
|
179
|
+
let N = 0;
|
|
180
|
+
return S !== -1 && (N = d.length - S - 1), N;
|
|
181
|
+
}, W = (i, d = 1) => J(i) ? i >= Number.MAX_SAFE_INTEGER && d === 1 ? (xe("InputNumber", "The value has reached the maximum safe integer limit."), i) : i <= Number.MIN_SAFE_INTEGER && d === -1 ? (xe("InputNumber", "The value has reached the minimum safe integer limit."), i) : V(i + n.step * d) : m.currentValue, ee = (i) => {
|
|
182
|
+
const d = vt(i), S = xt(i);
|
|
183
|
+
if (n.disabledScientific && ["e", "E"].includes(S)) {
|
|
184
|
+
i.preventDefault();
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
switch (d) {
|
|
188
|
+
case he.up:
|
|
189
|
+
i.preventDefault(), y();
|
|
190
|
+
break;
|
|
191
|
+
case he.down:
|
|
192
|
+
i.preventDefault(), I();
|
|
193
|
+
}
|
|
194
|
+
}, y = () => {
|
|
195
|
+
if (n.readonly || L.value || A.value) return;
|
|
196
|
+
const i = Number(R.value) || 0, d = W(i);
|
|
197
|
+
T(d), g(Ve, m.currentValue), ue();
|
|
198
|
+
}, I = () => {
|
|
199
|
+
if (n.readonly || L.value || x.value) return;
|
|
200
|
+
const i = Number(R.value) || 0, d = W(i, -1);
|
|
201
|
+
T(d), g(Ve, m.currentValue), ue();
|
|
202
|
+
}, X = (i, d) => {
|
|
203
|
+
const { max: S, min: N, step: te, precision: ie, stepStrictly: de, valueOnClear: oe } = n;
|
|
204
|
+
S < N && Qe("InputNumber", "min should not be greater than max.");
|
|
205
|
+
let U = i ? Number.parseFloat(String(i)) : Number(i);
|
|
206
|
+
if ($e(i) || Number.isNaN(U)) return null;
|
|
207
|
+
if (i === "") {
|
|
208
|
+
if (oe === null) return null;
|
|
209
|
+
U = Me(oe) ? {
|
|
210
|
+
min: N,
|
|
211
|
+
max: S
|
|
212
|
+
}[oe] : oe;
|
|
213
|
+
}
|
|
214
|
+
return de && (U = V(Math.round(V(U / te)) * te, ie), U !== i && d && g("update:modelValue", U)), Fe(ie) || (U = V(U, ie)), (U > S || U < N) && (U = U > S ? S : N, d && g("update:modelValue", U)), U;
|
|
215
|
+
}, T = (i, d = !0) => {
|
|
216
|
+
var te;
|
|
217
|
+
const S = m.currentValue, N = X(i);
|
|
218
|
+
if (!d) {
|
|
219
|
+
g(ve, N);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
m.userInput = null, !(S === N && i) && (g(ve, N), S !== N && g(Ee, N, S), n.validateEvent && ((te = s == null ? void 0 : s.validate) == null || te.call(s, "change").catch(Ae)), m.currentValue = N);
|
|
223
|
+
}, _ = (i) => {
|
|
224
|
+
m.userInput = i;
|
|
225
|
+
let d = i === "" ? null : Number.parseFloat(i);
|
|
226
|
+
Number.isNaN(d) && (d = null), g(Ve, d), T(d, !1);
|
|
227
|
+
}, fe = (i) => {
|
|
228
|
+
const d = i !== "" ? Number.parseFloat(i) : "";
|
|
229
|
+
(J(d) && !Number.isNaN(d) || n.formatter && Number.isNaN(d) || d === "") && T(d), ue(), m.userInput = null;
|
|
230
|
+
}, E = () => {
|
|
231
|
+
var i, d;
|
|
232
|
+
(d = (i = v.value) == null ? void 0 : i.focus) == null || d.call(i);
|
|
233
|
+
}, $ = () => {
|
|
234
|
+
var i, d;
|
|
235
|
+
(d = (i = v.value) == null ? void 0 : i.blur) == null || d.call(i);
|
|
236
|
+
}, Z = (i) => {
|
|
237
|
+
g("focus", i);
|
|
238
|
+
}, Q = (i) => {
|
|
239
|
+
var d, S, N;
|
|
240
|
+
m.userInput = null, m.currentValue === null && ((d = v.value) != null && d.input) && (v.value.input.value = ((S = n.formatter) == null ? void 0 : S.call(n, "")) ?? ""), g("blur", i), n.validateEvent && ((N = s == null ? void 0 : s.validate) == null || N.call(s, "blur").catch(Ae));
|
|
241
|
+
}, ue = () => {
|
|
242
|
+
m.currentValue !== n.modelValue && (m.currentValue = n.modelValue);
|
|
243
|
+
}, re = (i) => {
|
|
244
|
+
document.activeElement === i.target && i.preventDefault();
|
|
245
|
+
};
|
|
246
|
+
return we(() => n.modelValue, (i, d) => {
|
|
247
|
+
const S = X(i, !0);
|
|
248
|
+
m.userInput === null && S !== d && (m.currentValue = S);
|
|
249
|
+
}, { immediate: !0 }), we(() => n.precision, () => {
|
|
250
|
+
m.currentValue = X(n.modelValue);
|
|
251
|
+
}), Ye(() => {
|
|
252
|
+
var te;
|
|
253
|
+
const { min: i, max: d, modelValue: S } = n, N = (te = v.value) == null ? void 0 : te.input;
|
|
254
|
+
if (N.setAttribute("role", "spinbutton"), Number.isFinite(d) ? N.setAttribute("aria-valuemax", String(d)) : N.removeAttribute("aria-valuemax"), Number.isFinite(i) ? N.setAttribute("aria-valuemin", String(i)) : N.removeAttribute("aria-valuemin"), N.setAttribute("aria-valuenow", m.currentValue || m.currentValue === 0 ? String(m.currentValue) : ""), N.setAttribute("aria-disabled", String(L.value)), !J(S) && S != null) {
|
|
255
|
+
let ie = Number(S);
|
|
256
|
+
Number.isNaN(ie) && (ie = null), g(ve, ie);
|
|
257
|
+
}
|
|
258
|
+
N.addEventListener("wheel", re, { passive: !1 });
|
|
259
|
+
}), Yt(() => {
|
|
260
|
+
var i, d;
|
|
261
|
+
(d = (i = v.value) == null ? void 0 : i.input) == null || d.setAttribute("aria-valuenow", `${m.currentValue ?? ""}`);
|
|
262
|
+
}), a({
|
|
263
|
+
/** @description get focus the input component */
|
|
264
|
+
focus: E,
|
|
265
|
+
/** @description remove focus the input component */
|
|
266
|
+
blur: $
|
|
267
|
+
}), (i, d) => (b(), P("div", {
|
|
268
|
+
class: j([
|
|
269
|
+
t(f).b(),
|
|
270
|
+
t(f).m(t(H)),
|
|
271
|
+
t(f).is("disabled", t(L)),
|
|
272
|
+
t(f).is("without-controls", !e.controls),
|
|
273
|
+
t(f).is("controls-right", G.value),
|
|
274
|
+
t(f).is(e.align, !!e.align)
|
|
275
|
+
]),
|
|
276
|
+
onDragstart: d[0] || (d[0] = lt(() => {
|
|
277
|
+
}, ["prevent"]))
|
|
278
|
+
}, [
|
|
279
|
+
e.controls ? ut((b(), P("span", {
|
|
280
|
+
key: 0,
|
|
281
|
+
role: "button",
|
|
282
|
+
"aria-label": t(c)("el.inputNumber.decrease"),
|
|
283
|
+
class: j([t(f).e("decrease"), t(f).is("disabled", x.value)]),
|
|
284
|
+
onKeydown: He(I, ["enter"])
|
|
285
|
+
}, [ye(i.$slots, "decrease-icon", {}, () => [z(t(pe), null, {
|
|
286
|
+
default: ae(() => [G.value ? (b(), q(t(Ft), { key: 0 })) : (b(), q(t(Rt), { key: 1 }))]),
|
|
287
|
+
_: 1
|
|
288
|
+
})])], 42, Qt)), [[t(at), I]]) : Y("v-if", !0),
|
|
289
|
+
e.controls ? ut((b(), P("span", {
|
|
290
|
+
key: 1,
|
|
291
|
+
role: "button",
|
|
292
|
+
"aria-label": t(c)("el.inputNumber.increase"),
|
|
293
|
+
class: j([t(f).e("increase"), t(f).is("disabled", A.value)]),
|
|
294
|
+
onKeydown: He(y, ["enter"])
|
|
295
|
+
}, [ye(i.$slots, "increase-icon", {}, () => [z(t(pe), null, {
|
|
296
|
+
default: ae(() => [G.value ? (b(), q(t(Kt), { key: 0 })) : (b(), q(t(Ot), { key: 1 }))]),
|
|
297
|
+
_: 1
|
|
298
|
+
})])], 42, el)), [[t(at), y]]) : Y("v-if", !0),
|
|
299
|
+
z(t(kt), {
|
|
300
|
+
id: e.id,
|
|
301
|
+
ref_key: "input",
|
|
302
|
+
ref: v,
|
|
303
|
+
type: e.formatter ? "text" : "number",
|
|
304
|
+
step: e.step,
|
|
305
|
+
"model-value": R.value,
|
|
306
|
+
placeholder: e.placeholder,
|
|
307
|
+
readonly: e.readonly,
|
|
308
|
+
disabled: t(L),
|
|
309
|
+
size: t(H),
|
|
310
|
+
max: e.max,
|
|
311
|
+
min: e.min,
|
|
312
|
+
name: e.name,
|
|
313
|
+
"aria-label": e.ariaLabel,
|
|
314
|
+
"validate-event": !1,
|
|
315
|
+
inputmode: e.inputmode,
|
|
316
|
+
formatter: e.formatter,
|
|
317
|
+
parser: e.parser,
|
|
318
|
+
tabindex: e.tabindex,
|
|
319
|
+
onKeydown: ee,
|
|
320
|
+
onBlur: Q,
|
|
321
|
+
onFocus: Z,
|
|
322
|
+
onInput: _,
|
|
323
|
+
onChange: fe
|
|
324
|
+
}, Xt({ _: 2 }, [i.$slots.prefix ? {
|
|
325
|
+
name: "prefix",
|
|
326
|
+
fn: ae(() => [ye(i.$slots, "prefix")]),
|
|
327
|
+
key: "0"
|
|
328
|
+
} : void 0, i.$slots.suffix ? {
|
|
329
|
+
name: "suffix",
|
|
330
|
+
fn: ae(() => [ye(i.$slots, "suffix")]),
|
|
331
|
+
key: "1"
|
|
332
|
+
} : void 0]), 1032, [
|
|
333
|
+
"id",
|
|
334
|
+
"type",
|
|
335
|
+
"step",
|
|
336
|
+
"model-value",
|
|
337
|
+
"placeholder",
|
|
338
|
+
"readonly",
|
|
339
|
+
"disabled",
|
|
340
|
+
"size",
|
|
341
|
+
"max",
|
|
342
|
+
"min",
|
|
343
|
+
"name",
|
|
344
|
+
"aria-label",
|
|
345
|
+
"inputmode",
|
|
346
|
+
"formatter",
|
|
347
|
+
"parser",
|
|
348
|
+
"tabindex"
|
|
349
|
+
])
|
|
350
|
+
], 34));
|
|
351
|
+
}
|
|
352
|
+
}), ll = tl;
|
|
353
|
+
const nl = et(ll), ht = Symbol("sliderContextKey"), al = Le({
|
|
354
|
+
/**
|
|
355
|
+
* @description binding value
|
|
356
|
+
*/
|
|
357
|
+
modelValue: {
|
|
358
|
+
type: ce([Number, Array]),
|
|
359
|
+
default: 0
|
|
360
|
+
},
|
|
361
|
+
id: {
|
|
362
|
+
type: String,
|
|
363
|
+
default: void 0
|
|
364
|
+
},
|
|
365
|
+
/**
|
|
366
|
+
* @description minimum value
|
|
367
|
+
*/
|
|
368
|
+
min: {
|
|
369
|
+
type: Number,
|
|
370
|
+
default: 0
|
|
371
|
+
},
|
|
372
|
+
/**
|
|
373
|
+
* @description maximum value
|
|
374
|
+
*/
|
|
375
|
+
max: {
|
|
376
|
+
type: Number,
|
|
377
|
+
default: 100
|
|
378
|
+
},
|
|
379
|
+
/**
|
|
380
|
+
* @description step size, can be a number or `'mark'` to restrict values to marks. When set to `'mark'`, the `marks` attribute must be set
|
|
381
|
+
*/
|
|
382
|
+
step: {
|
|
383
|
+
type: ce([Number, String]),
|
|
384
|
+
default: 1
|
|
385
|
+
},
|
|
386
|
+
/**
|
|
387
|
+
* @description whether to display an input box, works when `range` is false and `step` is not `'mark'`
|
|
388
|
+
*/
|
|
389
|
+
showInput: Boolean,
|
|
390
|
+
/**
|
|
391
|
+
* @description whether to display control buttons when `show-input` is true
|
|
392
|
+
*/
|
|
393
|
+
showInputControls: {
|
|
394
|
+
type: Boolean,
|
|
395
|
+
default: !0
|
|
396
|
+
},
|
|
397
|
+
/**
|
|
398
|
+
* @description size of the slider wrapper, will not work in vertical mode
|
|
399
|
+
*/
|
|
400
|
+
size: Ge,
|
|
401
|
+
/**
|
|
402
|
+
* @description size of the input box, when set `size`, the default is the value of `size`
|
|
403
|
+
*/
|
|
404
|
+
inputSize: Ge,
|
|
405
|
+
/**
|
|
406
|
+
* @description whether to display breakpoints
|
|
407
|
+
*/
|
|
408
|
+
showStops: Boolean,
|
|
409
|
+
/**
|
|
410
|
+
* @description whether to display tooltip value
|
|
411
|
+
*/
|
|
412
|
+
showTooltip: {
|
|
413
|
+
type: Boolean,
|
|
414
|
+
default: !0
|
|
415
|
+
},
|
|
416
|
+
/**
|
|
417
|
+
* @description format to display tooltip value
|
|
418
|
+
*/
|
|
419
|
+
formatTooltip: {
|
|
420
|
+
type: ce(Function),
|
|
421
|
+
default: void 0
|
|
422
|
+
},
|
|
423
|
+
/**
|
|
424
|
+
* @description whether Slider is disabled
|
|
425
|
+
*/
|
|
426
|
+
disabled: {
|
|
427
|
+
type: Boolean,
|
|
428
|
+
default: void 0
|
|
429
|
+
},
|
|
430
|
+
/**
|
|
431
|
+
* @description whether to select a range
|
|
432
|
+
*/
|
|
433
|
+
range: Boolean,
|
|
434
|
+
/**
|
|
435
|
+
* @description vertical mode
|
|
436
|
+
*/
|
|
437
|
+
vertical: Boolean,
|
|
438
|
+
/**
|
|
439
|
+
* @description slider height, required in vertical mode
|
|
440
|
+
*/
|
|
441
|
+
height: String,
|
|
442
|
+
/**
|
|
443
|
+
* @description when `range` is true, screen reader label for the start of the range
|
|
444
|
+
*/
|
|
445
|
+
rangeStartLabel: {
|
|
446
|
+
type: String,
|
|
447
|
+
default: void 0
|
|
448
|
+
},
|
|
449
|
+
/**
|
|
450
|
+
* @description when `range` is true, screen reader label for the end of the range
|
|
451
|
+
*/
|
|
452
|
+
rangeEndLabel: {
|
|
453
|
+
type: String,
|
|
454
|
+
default: void 0
|
|
455
|
+
},
|
|
456
|
+
/**
|
|
457
|
+
* @description format to display the `aria-valuenow` attribute for screen readers
|
|
458
|
+
*/
|
|
459
|
+
formatValueText: {
|
|
460
|
+
type: ce(Function),
|
|
461
|
+
default: void 0
|
|
462
|
+
},
|
|
463
|
+
/**
|
|
464
|
+
* @description custom class name for the tooltip
|
|
465
|
+
*/
|
|
466
|
+
tooltipClass: {
|
|
467
|
+
type: ce([
|
|
468
|
+
String,
|
|
469
|
+
Array,
|
|
470
|
+
Object,
|
|
471
|
+
Boolean
|
|
472
|
+
]),
|
|
473
|
+
default: void 0
|
|
474
|
+
},
|
|
475
|
+
/**
|
|
476
|
+
* @description position of Tooltip
|
|
477
|
+
*/
|
|
478
|
+
placement: {
|
|
479
|
+
type: String,
|
|
480
|
+
values: mt,
|
|
481
|
+
default: "top"
|
|
482
|
+
},
|
|
483
|
+
/**
|
|
484
|
+
* @description marks, type of key must be `number` and must in closed interval `[min, max]`, each mark can custom style
|
|
485
|
+
*/
|
|
486
|
+
marks: { type: ce(Object) },
|
|
487
|
+
/**
|
|
488
|
+
* @description whether to trigger form validation
|
|
489
|
+
*/
|
|
490
|
+
validateEvent: {
|
|
491
|
+
type: Boolean,
|
|
492
|
+
default: !0
|
|
493
|
+
},
|
|
494
|
+
/**
|
|
495
|
+
* @description when slider tooltip inactive and `persistent` is `false` , popconfirm will be destroyed. `persistent` always be `false` when `show-tooltip ` is `false`
|
|
496
|
+
*/
|
|
497
|
+
persistent: {
|
|
498
|
+
type: Boolean,
|
|
499
|
+
default: !0
|
|
500
|
+
},
|
|
501
|
+
...Je(["ariaLabel"])
|
|
502
|
+
}), je = (e) => J(e) || Pe(e) && e.every(J), il = {
|
|
503
|
+
[ve]: je,
|
|
504
|
+
[Ve]: je,
|
|
505
|
+
[Ee]: je
|
|
506
|
+
}, ol = (e, a, u) => {
|
|
507
|
+
const n = O();
|
|
508
|
+
return Ye(async () => {
|
|
509
|
+
e.range ? (Pe(e.modelValue) ? (a.firstValue = Math.max(e.min, e.modelValue[0]), a.secondValue = Math.min(e.max, e.modelValue[1])) : (a.firstValue = e.min, a.secondValue = e.max), a.oldValue = [a.firstValue, a.secondValue]) : (!J(e.modelValue) || Number.isNaN(e.modelValue) ? a.firstValue = e.min : a.firstValue = Math.min(e.max, Math.max(e.min, e.modelValue)), a.oldValue = a.firstValue), We(window, "resize", u), await ze(), u();
|
|
510
|
+
}), { sliderWrapper: n };
|
|
511
|
+
}, sl = (e) => {
|
|
512
|
+
const a = k(() => e.marks ? Object.keys(e.marks).map(Number.parseFloat).sort((u, n) => u - n).filter((u) => u <= e.max && u >= e.min).map((u) => ({
|
|
513
|
+
point: u,
|
|
514
|
+
position: (u - e.min) * 100 / (e.max - e.min),
|
|
515
|
+
mark: e.marks[u]
|
|
516
|
+
})) : []);
|
|
517
|
+
return jt(() => {
|
|
518
|
+
if (e.step === "mark" && !e.marks && xe("ElSlider", "marks prop must be provided when step is mark"), e.marks) {
|
|
519
|
+
const u = Object.keys(e.marks), n = a.value.map((c) => c.point), g = u.filter((c) => {
|
|
520
|
+
const f = Number.parseFloat(c);
|
|
521
|
+
return Number.isNaN(f) || !n.includes(f);
|
|
522
|
+
});
|
|
523
|
+
g.length > 0 && xe("ElSlider", `Some marks keys are invalid (not a number or out of [min, max]): [${g.map((c) => `'${c}'`).join(", ")}] and will be ignored.`);
|
|
524
|
+
}
|
|
525
|
+
}), a;
|
|
526
|
+
}, ul = (e, a, u) => {
|
|
527
|
+
const { formItem: n } = Ze(), g = bt(), c = O(), f = O(), v = {
|
|
528
|
+
firstButton: c,
|
|
529
|
+
secondButton: f
|
|
530
|
+
}, m = _e(), s = k(() => Math.min(a.firstValue, a.secondValue)), x = k(() => Math.max(a.firstValue, a.secondValue)), A = k(() => e.range ? `${100 * (x.value - s.value) / (e.max - e.min)}%` : `${100 * (a.firstValue - e.min) / (e.max - e.min)}%`), M = k(() => e.range ? `${100 * (s.value - e.min) / (e.max - e.min)}%` : "0%"), G = k(() => e.vertical ? { height: e.height } : {}), H = k(() => e.vertical ? {
|
|
531
|
+
height: A.value,
|
|
532
|
+
bottom: M.value
|
|
533
|
+
} : {
|
|
534
|
+
width: A.value,
|
|
535
|
+
left: M.value
|
|
536
|
+
}), L = () => {
|
|
537
|
+
g.value && (a.sliderSize = g.value.getBoundingClientRect()[e.vertical ? "height" : "width"]);
|
|
538
|
+
}, R = (E) => {
|
|
539
|
+
const $ = e.min + E * (e.max - e.min) / 100;
|
|
540
|
+
if (!e.range) return c;
|
|
541
|
+
let Z;
|
|
542
|
+
return Math.abs(s.value - $) < Math.abs(x.value - $) ? Z = a.firstValue < a.secondValue ? "firstButton" : "secondButton" : Z = a.firstValue > a.secondValue ? "firstButton" : "secondButton", v[Z];
|
|
543
|
+
}, V = (E) => {
|
|
544
|
+
const $ = R(E);
|
|
545
|
+
return $.value.setPosition(E), $;
|
|
546
|
+
}, D = (E) => {
|
|
547
|
+
a.firstValue = E ?? e.min, ee(e.range ? [s.value, x.value] : E ?? e.min);
|
|
548
|
+
}, W = (E) => {
|
|
549
|
+
a.secondValue = E, e.range && ee([s.value, x.value]);
|
|
550
|
+
}, ee = (E) => {
|
|
551
|
+
u(ve, E), u(Ve, E);
|
|
552
|
+
}, y = async () => {
|
|
553
|
+
await ze(), u(Ee, e.range ? [s.value, x.value] : e.modelValue);
|
|
554
|
+
}, I = (E) => {
|
|
555
|
+
var Z, Q, ue, re;
|
|
556
|
+
if (m.value || a.dragging) return;
|
|
557
|
+
L();
|
|
558
|
+
let $ = 0;
|
|
559
|
+
if (e.vertical) {
|
|
560
|
+
const i = ((Q = (Z = E.touches) == null ? void 0 : Z.item(0)) == null ? void 0 : Q.clientY) ?? E.clientY;
|
|
561
|
+
$ = (g.value.getBoundingClientRect().bottom - i) / a.sliderSize * 100;
|
|
562
|
+
} else $ = ((((re = (ue = E.touches) == null ? void 0 : ue.item(0)) == null ? void 0 : re.clientX) ?? E.clientX) - g.value.getBoundingClientRect().left) / a.sliderSize * 100;
|
|
563
|
+
if (!($ < 0 || $ > 100))
|
|
564
|
+
return V($);
|
|
565
|
+
};
|
|
566
|
+
return {
|
|
567
|
+
elFormItem: n,
|
|
568
|
+
slider: g,
|
|
569
|
+
firstButton: c,
|
|
570
|
+
secondButton: f,
|
|
571
|
+
sliderDisabled: m,
|
|
572
|
+
minValue: s,
|
|
573
|
+
maxValue: x,
|
|
574
|
+
runwayStyle: G,
|
|
575
|
+
barStyle: H,
|
|
576
|
+
resetSize: L,
|
|
577
|
+
setPosition: V,
|
|
578
|
+
emitChange: y,
|
|
579
|
+
onSliderWrapperPrevent: (E) => {
|
|
580
|
+
var $, Z;
|
|
581
|
+
(($ = v.firstButton.value) != null && $.dragging || (Z = v.secondButton.value) != null && Z.dragging) && E.preventDefault();
|
|
582
|
+
},
|
|
583
|
+
onSliderClick: (E) => {
|
|
584
|
+
I(E) && y();
|
|
585
|
+
},
|
|
586
|
+
onSliderDown: async (E) => {
|
|
587
|
+
const $ = I(E);
|
|
588
|
+
$ && (await ze(), $.value.onButtonDown(E));
|
|
589
|
+
},
|
|
590
|
+
onSliderMarkerDown: (E) => {
|
|
591
|
+
m.value || a.dragging || V(E) && y();
|
|
592
|
+
},
|
|
593
|
+
setFirstValue: D,
|
|
594
|
+
setSecondValue: W
|
|
595
|
+
};
|
|
596
|
+
}, rl = (e, a, u, n) => ({
|
|
597
|
+
stops: k(() => {
|
|
598
|
+
if (!e.showStops || e.min > e.max) return [];
|
|
599
|
+
if (e.step === "mark" || e.step === 0)
|
|
600
|
+
return e.step === 0 && xe("ElSlider", "step should not be 0."), [];
|
|
601
|
+
const f = Math.ceil((e.max - e.min) / e.step), v = 100 * e.step / (e.max - e.min), m = Array.from({ length: f - 1 }).map((s, x) => (x + 1) * v);
|
|
602
|
+
return e.range ? m.filter((s) => s < 100 * (u.value - e.min) / (e.max - e.min) || s > 100 * (n.value - e.min) / (e.max - e.min)) : m.filter((s) => s > 100 * (a.firstValue - e.min) / (e.max - e.min));
|
|
603
|
+
}),
|
|
604
|
+
getStopStyle: (f) => e.vertical ? { bottom: `${f}%` } : { left: `${f}%` }
|
|
605
|
+
}), dl = (e, a, u, n, g, c) => {
|
|
606
|
+
const f = (s) => {
|
|
607
|
+
g(ve, s), g(Ve, s);
|
|
608
|
+
}, v = () => e.range ? ![u.value, n.value].every((s, x) => s === a.oldValue[x]) : e.modelValue !== a.oldValue, m = () => {
|
|
609
|
+
var x, A;
|
|
610
|
+
e.min > e.max && Qe("Slider", "min should not be greater than max.");
|
|
611
|
+
const s = e.modelValue;
|
|
612
|
+
e.range && Pe(s) ? s[1] < e.min ? f([e.min, e.min]) : s[0] > e.max ? f([e.max, e.max]) : s[0] < e.min ? f([e.min, s[1]]) : s[1] > e.max ? f([s[0], e.max]) : (a.firstValue = s[0], a.secondValue = s[1], v() && (e.validateEvent && ((x = c == null ? void 0 : c.validate) == null || x.call(c, "change").catch(Ae)), a.oldValue = s.slice())) : !e.range && J(s) && !Number.isNaN(s) && (s < e.min ? f(e.min) : s > e.max ? f(e.max) : (a.firstValue = s, v() && (e.validateEvent && ((A = c == null ? void 0 : c.validate) == null || A.call(c, "change").catch(Ae)), a.oldValue = s)));
|
|
613
|
+
};
|
|
614
|
+
m(), we(() => a.dragging, (s) => {
|
|
615
|
+
s || m();
|
|
616
|
+
}), we(() => e.modelValue, (s, x) => {
|
|
617
|
+
a.dragging || Pe(s) && Pe(x) && s.every((A, M) => A === x[M]) && a.firstValue === s[0] && a.secondValue === s[1] || m();
|
|
618
|
+
}, { deep: !0 }), we(() => [e.min, e.max], () => {
|
|
619
|
+
m();
|
|
620
|
+
});
|
|
621
|
+
}, cl = (e, a, u) => {
|
|
622
|
+
const n = O(), g = O(!1), c = k(() => a.value instanceof Function);
|
|
623
|
+
return {
|
|
624
|
+
tooltip: n,
|
|
625
|
+
tooltipVisible: g,
|
|
626
|
+
formatValue: k(() => c.value && a.value(e.modelValue) || e.modelValue),
|
|
627
|
+
displayTooltip: it(() => {
|
|
628
|
+
u.value && (g.value = !0);
|
|
629
|
+
}, 50),
|
|
630
|
+
hideTooltip: it(() => {
|
|
631
|
+
u.value && (g.value = !1);
|
|
632
|
+
}, 50)
|
|
633
|
+
};
|
|
634
|
+
}, vl = (e, a, u) => {
|
|
635
|
+
const { disabled: n, min: g, max: c, step: f, showTooltip: v, persistent: m, precision: s, sliderSize: x, formatTooltip: A, emitChange: M, resetSize: G, updateDragging: H, markList: L } = Gt(ht), { tooltip: R, tooltipVisible: V, formatValue: D, displayTooltip: W, hideTooltip: ee } = cl(e, A, v), y = O(), I = k(() => `${(e.modelValue - g.value) / (c.value - g.value) * 100}%`), X = k(() => e.vertical ? { bottom: I.value } : { left: I.value }), T = k(() => f.value === "mark" && L.value.length > 0), _ = () => {
|
|
636
|
+
a.hovering = !0, W();
|
|
637
|
+
}, fe = () => {
|
|
638
|
+
a.hovering = !1, a.dragging || ee();
|
|
639
|
+
}, E = (p) => {
|
|
640
|
+
n.value || (p.preventDefault(), ie(p), window.addEventListener("mousemove", de), window.addEventListener("touchmove", de), window.addEventListener("mouseup", oe), window.addEventListener("touchend", oe), window.addEventListener("contextmenu", oe), y.value.focus());
|
|
641
|
+
}, $ = (p) => {
|
|
642
|
+
n.value || (a.newPosition = Number.parseFloat(I.value) + p / (c.value - g.value) * 100, U(a.newPosition), M());
|
|
643
|
+
}, Z = (p) => {
|
|
644
|
+
if (n.value || !L.value.length) return;
|
|
645
|
+
const C = e.modelValue, K = Number.EPSILON, se = Math.abs(p);
|
|
646
|
+
let w;
|
|
647
|
+
if (p > 0) {
|
|
648
|
+
const le = L.value.findIndex((ne) => ne.point > C + K);
|
|
649
|
+
if (le !== -1) {
|
|
650
|
+
const ne = Math.min(le + se - 1, L.value.length - 1);
|
|
651
|
+
w = L.value[ne].point;
|
|
652
|
+
}
|
|
653
|
+
} else {
|
|
654
|
+
let le = -1;
|
|
655
|
+
for (let ne = L.value.length - 1; ne >= 0; ne--) if (L.value[ne].point < C - K) {
|
|
656
|
+
le = ne;
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
if (le !== -1) {
|
|
660
|
+
const ne = Math.max(le - (se - 1), 0);
|
|
661
|
+
w = L.value[ne].point;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
if (w !== void 0 && w !== C) {
|
|
665
|
+
const le = (w - g.value) / (c.value - g.value) * 100;
|
|
666
|
+
U(le), M();
|
|
667
|
+
}
|
|
668
|
+
}, Q = () => {
|
|
669
|
+
T.value ? Z(-1) : J(f.value) && $(-f.value);
|
|
670
|
+
}, ue = () => {
|
|
671
|
+
T.value ? Z(1) : J(f.value) && $(f.value);
|
|
672
|
+
}, re = () => {
|
|
673
|
+
T.value ? Z(-4) : J(f.value) && $(-f.value * 4);
|
|
674
|
+
}, i = () => {
|
|
675
|
+
T.value ? Z(4) : J(f.value) && $(f.value * 4);
|
|
676
|
+
}, d = () => {
|
|
677
|
+
n.value || (U(0), M());
|
|
678
|
+
}, S = () => {
|
|
679
|
+
n.value || (U(100), M());
|
|
680
|
+
}, N = (p) => {
|
|
681
|
+
const C = vt(p);
|
|
682
|
+
let K = !0;
|
|
683
|
+
switch (C) {
|
|
684
|
+
case he.left:
|
|
685
|
+
case he.down:
|
|
686
|
+
Q();
|
|
687
|
+
break;
|
|
688
|
+
case he.right:
|
|
689
|
+
case he.up:
|
|
690
|
+
ue();
|
|
691
|
+
break;
|
|
692
|
+
case he.home:
|
|
693
|
+
d();
|
|
694
|
+
break;
|
|
695
|
+
case he.end:
|
|
696
|
+
S();
|
|
697
|
+
break;
|
|
698
|
+
case he.pageDown:
|
|
699
|
+
re();
|
|
700
|
+
break;
|
|
701
|
+
case he.pageUp:
|
|
702
|
+
i();
|
|
703
|
+
break;
|
|
704
|
+
default:
|
|
705
|
+
K = !1;
|
|
706
|
+
}
|
|
707
|
+
K && p.preventDefault();
|
|
708
|
+
}, te = (p) => {
|
|
709
|
+
let C, K;
|
|
710
|
+
return p.type.startsWith("touch") ? (K = p.touches[0].clientY, C = p.touches[0].clientX) : (K = p.clientY, C = p.clientX), {
|
|
711
|
+
clientX: C,
|
|
712
|
+
clientY: K
|
|
713
|
+
};
|
|
714
|
+
}, ie = (p) => {
|
|
715
|
+
a.dragging = !0, a.isClick = !0;
|
|
716
|
+
const { clientX: C, clientY: K } = te(p);
|
|
717
|
+
e.vertical ? a.startY = K : a.startX = C, a.startPosition = Number.parseFloat(I.value), a.newPosition = a.startPosition;
|
|
718
|
+
}, de = (p) => {
|
|
719
|
+
if (a.dragging) {
|
|
720
|
+
a.isClick = !1, W(), G();
|
|
721
|
+
let C;
|
|
722
|
+
const { clientX: K, clientY: se } = te(p);
|
|
723
|
+
e.vertical ? (a.currentY = se, C = (a.startY - a.currentY) / x.value * 100) : (a.currentX = K, C = (a.currentX - a.startX) / x.value * 100), a.newPosition = a.startPosition + C, U(a.newPosition);
|
|
724
|
+
}
|
|
725
|
+
}, oe = () => {
|
|
726
|
+
a.dragging && (setTimeout(() => {
|
|
727
|
+
a.dragging = !1, a.hovering || ee(), a.isClick || U(a.newPosition), M();
|
|
728
|
+
}, 0), window.removeEventListener("mousemove", de), window.removeEventListener("touchmove", de), window.removeEventListener("mouseup", oe), window.removeEventListener("touchend", oe), window.removeEventListener("contextmenu", oe));
|
|
729
|
+
}, U = async (p) => {
|
|
730
|
+
if (p === null || Number.isNaN(+p)) return;
|
|
731
|
+
p = Et(p, 0, 100);
|
|
732
|
+
let C;
|
|
733
|
+
if (f.value === "mark")
|
|
734
|
+
L.value.length === 0 ? C = p <= 50 ? g.value : c.value : C = L.value.reduce((K, se) => Math.abs(se.position - p) < Math.abs(K.position - p) ? se : K).point;
|
|
735
|
+
else {
|
|
736
|
+
const K = Math.floor((c.value - g.value) / f.value), se = K * f.value / (c.value - g.value) * 100, w = se + (100 - se) / 2;
|
|
737
|
+
if (p < se) {
|
|
738
|
+
const le = se / K, ne = Math.round(p / le);
|
|
739
|
+
C = g.value + ne * f.value;
|
|
740
|
+
} else p < w ? C = g.value + K * f.value : C = c.value;
|
|
741
|
+
C = Number.parseFloat(C.toFixed(s.value));
|
|
742
|
+
}
|
|
743
|
+
C !== e.modelValue && u(ve, C), !a.dragging && e.modelValue !== a.oldValue && (a.oldValue = e.modelValue), await ze(), a.dragging && W(), R.value.updatePopper();
|
|
744
|
+
};
|
|
745
|
+
return we(() => a.dragging, (p) => {
|
|
746
|
+
H(p);
|
|
747
|
+
}), We(y, "touchstart", E, { passive: !1 }), {
|
|
748
|
+
disabled: n,
|
|
749
|
+
button: y,
|
|
750
|
+
tooltip: R,
|
|
751
|
+
tooltipVisible: V,
|
|
752
|
+
showTooltip: v,
|
|
753
|
+
persistent: m,
|
|
754
|
+
wrapperStyle: X,
|
|
755
|
+
formatValue: D,
|
|
756
|
+
handleMouseEnter: _,
|
|
757
|
+
handleMouseLeave: fe,
|
|
758
|
+
onButtonDown: E,
|
|
759
|
+
onKeyDown: N,
|
|
760
|
+
setPosition: U
|
|
761
|
+
};
|
|
762
|
+
}, ml = Le({
|
|
763
|
+
modelValue: {
|
|
764
|
+
type: Number,
|
|
765
|
+
default: 0
|
|
766
|
+
},
|
|
767
|
+
vertical: Boolean,
|
|
768
|
+
tooltipClass: {
|
|
769
|
+
type: ce([
|
|
770
|
+
String,
|
|
771
|
+
Array,
|
|
772
|
+
Object,
|
|
773
|
+
Boolean
|
|
774
|
+
]),
|
|
775
|
+
default: void 0
|
|
776
|
+
},
|
|
777
|
+
placement: {
|
|
778
|
+
type: String,
|
|
779
|
+
values: mt,
|
|
780
|
+
default: "top"
|
|
781
|
+
}
|
|
782
|
+
}), fl = { [ve]: (e) => J(e) }, gl = ["tabindex"];
|
|
783
|
+
var bl = /* @__PURE__ */ Te({
|
|
784
|
+
name: "ElSliderButton",
|
|
785
|
+
__name: "button",
|
|
786
|
+
props: ml,
|
|
787
|
+
emits: fl,
|
|
788
|
+
setup(e, { expose: a, emit: u }) {
|
|
789
|
+
const n = e, g = u, c = Ue("slider"), f = tt({
|
|
790
|
+
hovering: !1,
|
|
791
|
+
dragging: !1,
|
|
792
|
+
isClick: !1,
|
|
793
|
+
startX: 0,
|
|
794
|
+
currentX: 0,
|
|
795
|
+
startY: 0,
|
|
796
|
+
currentY: 0,
|
|
797
|
+
startPosition: 0,
|
|
798
|
+
newPosition: 0,
|
|
799
|
+
oldValue: n.modelValue
|
|
800
|
+
}), v = k(() => A.value ? M.value : !1), { disabled: m, button: s, tooltip: x, showTooltip: A, persistent: M, tooltipVisible: G, wrapperStyle: H, formatValue: L, handleMouseEnter: R, handleMouseLeave: V, onButtonDown: D, onKeyDown: W, setPosition: ee } = vl(n, f, g), { hovering: y, dragging: I } = De(f);
|
|
801
|
+
return a({
|
|
802
|
+
onButtonDown: D,
|
|
803
|
+
onKeyDown: W,
|
|
804
|
+
setPosition: ee,
|
|
805
|
+
hovering: y,
|
|
806
|
+
dragging: I
|
|
807
|
+
}), (X, T) => (b(), P("div", {
|
|
808
|
+
ref_key: "button",
|
|
809
|
+
ref: s,
|
|
810
|
+
class: j([t(c).e("button-wrapper"), {
|
|
811
|
+
hover: t(y),
|
|
812
|
+
dragging: t(I)
|
|
813
|
+
}]),
|
|
814
|
+
style: me(t(H)),
|
|
815
|
+
tabindex: t(m) ? void 0 : 0,
|
|
816
|
+
onMouseenter: T[0] || (T[0] = (..._) => t(R) && t(R)(..._)),
|
|
817
|
+
onMouseleave: T[1] || (T[1] = (..._) => t(V) && t(V)(..._)),
|
|
818
|
+
onMousedown: T[2] || (T[2] = (..._) => t(D) && t(D)(..._)),
|
|
819
|
+
onFocus: T[3] || (T[3] = (..._) => t(R) && t(R)(..._)),
|
|
820
|
+
onBlur: T[4] || (T[4] = (..._) => t(V) && t(V)(..._)),
|
|
821
|
+
onKeydown: T[5] || (T[5] = (..._) => t(W) && t(W)(..._))
|
|
822
|
+
}, [z(t(ft), {
|
|
823
|
+
ref_key: "tooltip",
|
|
824
|
+
ref: x,
|
|
825
|
+
visible: t(G),
|
|
826
|
+
placement: X.placement,
|
|
827
|
+
"fallback-placements": [
|
|
828
|
+
"top",
|
|
829
|
+
"bottom",
|
|
830
|
+
"right",
|
|
831
|
+
"left"
|
|
832
|
+
],
|
|
833
|
+
"stop-popper-mouse-event": !1,
|
|
834
|
+
"popper-class": X.tooltipClass,
|
|
835
|
+
disabled: !t(A),
|
|
836
|
+
persistent: v.value
|
|
837
|
+
}, {
|
|
838
|
+
content: ae(() => [r("span", null, B(t(L)), 1)]),
|
|
839
|
+
default: ae(() => [r("div", { class: j([t(c).e("button"), {
|
|
840
|
+
hover: t(y),
|
|
841
|
+
dragging: t(I)
|
|
842
|
+
}]) }, null, 2)]),
|
|
843
|
+
_: 1
|
|
844
|
+
}, 8, [
|
|
845
|
+
"visible",
|
|
846
|
+
"placement",
|
|
847
|
+
"popper-class",
|
|
848
|
+
"disabled",
|
|
849
|
+
"persistent"
|
|
850
|
+
])], 46, gl));
|
|
851
|
+
}
|
|
852
|
+
}), rt = bl;
|
|
853
|
+
const hl = Le({ mark: {
|
|
854
|
+
type: ce([String, Object]),
|
|
855
|
+
default: void 0
|
|
856
|
+
} });
|
|
857
|
+
var yl = Te({
|
|
858
|
+
name: "ElSliderMarker",
|
|
859
|
+
props: hl,
|
|
860
|
+
setup(e) {
|
|
861
|
+
const a = Ue("slider"), u = k(() => Me(e.mark) ? e.mark : e.mark.label), n = k(() => Me(e.mark) ? void 0 : e.mark.style);
|
|
862
|
+
return () => Ht("div", {
|
|
863
|
+
class: a.e("marks-text"),
|
|
864
|
+
style: n.value
|
|
865
|
+
}, u.value);
|
|
866
|
+
}
|
|
867
|
+
});
|
|
868
|
+
const Vl = [
|
|
869
|
+
"id",
|
|
870
|
+
"role",
|
|
871
|
+
"aria-label",
|
|
872
|
+
"aria-labelledby"
|
|
873
|
+
], pl = { key: 1 };
|
|
874
|
+
var wl = /* @__PURE__ */ Te({
|
|
875
|
+
name: "ElSlider",
|
|
876
|
+
__name: "slider",
|
|
877
|
+
props: al,
|
|
878
|
+
emits: il,
|
|
879
|
+
setup(e, { expose: a, emit: u }) {
|
|
880
|
+
const n = e, g = u, c = Ue("slider"), { t: f } = ct(), v = tt({
|
|
881
|
+
firstValue: 0,
|
|
882
|
+
secondValue: 0,
|
|
883
|
+
oldValue: 0,
|
|
884
|
+
dragging: !1,
|
|
885
|
+
sliderSize: 1
|
|
886
|
+
}), { elFormItem: m, slider: s, firstButton: x, secondButton: A, sliderDisabled: M, minValue: G, maxValue: H, runwayStyle: L, barStyle: R, resetSize: V, emitChange: D, onSliderWrapperPrevent: W, onSliderClick: ee, onSliderDown: y, onSliderMarkerDown: I, setFirstValue: X, setSecondValue: T } = ul(n, v, g), { stops: _, getStopStyle: fe } = rl(n, v, G, H), { inputId: E, isLabeledByFormItem: $ } = gt(n, { formItemContext: m }), Z = qe(), Q = k(() => n.inputSize || Z.value), ue = k(() => n.showInput && !n.range && n.step !== "mark"), re = k(() => n.ariaLabel || f("el.slider.defaultLabel", {
|
|
887
|
+
min: n.min,
|
|
888
|
+
max: n.max
|
|
889
|
+
})), i = k(() => n.range ? n.rangeStartLabel || f("el.slider.defaultRangeStartLabel") : re.value), d = k(() => n.formatValueText ? n.formatValueText(p.value) : `${p.value}`), S = k(() => n.rangeEndLabel || f("el.slider.defaultRangeEndLabel")), N = k(() => n.formatValueText ? n.formatValueText(C.value) : `${C.value}`), te = k(() => [
|
|
890
|
+
c.b(),
|
|
891
|
+
c.m(Z.value),
|
|
892
|
+
c.is("vertical", n.vertical),
|
|
893
|
+
{ [c.m("with-input")]: ue.value }
|
|
894
|
+
]), ie = sl(n);
|
|
895
|
+
dl(n, v, G, H, g, m);
|
|
896
|
+
const de = k(() => J(n.step) ? n.step : 1), oe = k(() => {
|
|
897
|
+
const w = J(n.step) ? n.step : 1, le = [
|
|
898
|
+
n.min,
|
|
899
|
+
n.max,
|
|
900
|
+
w
|
|
901
|
+
].map((ne) => {
|
|
902
|
+
const h = `${ne}`.split(".")[1];
|
|
903
|
+
return h ? h.length : 0;
|
|
904
|
+
});
|
|
905
|
+
return Math.max.apply(null, le);
|
|
906
|
+
}), { sliderWrapper: U } = ol(n, v, V), { firstValue: p, secondValue: C, sliderSize: K } = De(v), se = (w) => {
|
|
907
|
+
v.dragging = w;
|
|
908
|
+
};
|
|
909
|
+
return We(U, "touchstart", W, { passive: !1 }), We(U, "touchmove", W, { passive: !1 }), Dt(ht, {
|
|
910
|
+
...De(n),
|
|
911
|
+
sliderSize: K,
|
|
912
|
+
disabled: M,
|
|
913
|
+
precision: oe,
|
|
914
|
+
markList: ie,
|
|
915
|
+
emitChange: D,
|
|
916
|
+
resetSize: V,
|
|
917
|
+
updateDragging: se
|
|
918
|
+
}), a({ onSliderClick: ee }), (w, le) => {
|
|
919
|
+
var ne, h;
|
|
920
|
+
return b(), P("div", {
|
|
921
|
+
id: w.range ? t(E) : void 0,
|
|
922
|
+
ref_key: "sliderWrapper",
|
|
923
|
+
ref: U,
|
|
924
|
+
class: j(te.value),
|
|
925
|
+
role: w.range ? "group" : void 0,
|
|
926
|
+
"aria-label": w.range && !t($) ? re.value : void 0,
|
|
927
|
+
"aria-labelledby": w.range && t($) ? (ne = t(m)) == null ? void 0 : ne.labelId : void 0
|
|
928
|
+
}, [r("div", {
|
|
929
|
+
ref_key: "slider",
|
|
930
|
+
ref: s,
|
|
931
|
+
class: j([
|
|
932
|
+
t(c).e("runway"),
|
|
933
|
+
{ "show-input": ue.value },
|
|
934
|
+
t(c).is("disabled", t(M))
|
|
935
|
+
]),
|
|
936
|
+
style: me(t(L)),
|
|
937
|
+
onMousedown: le[0] || (le[0] = (...l) => t(y) && t(y)(...l)),
|
|
938
|
+
onTouchstartPassive: le[1] || (le[1] = (...l) => t(y) && t(y)(...l))
|
|
939
|
+
}, [
|
|
940
|
+
r("div", {
|
|
941
|
+
class: j(t(c).e("bar")),
|
|
942
|
+
style: me(t(R))
|
|
943
|
+
}, null, 6),
|
|
944
|
+
z(rt, {
|
|
945
|
+
id: w.range ? void 0 : t(E),
|
|
946
|
+
ref_key: "firstButton",
|
|
947
|
+
ref: x,
|
|
948
|
+
"model-value": t(p),
|
|
949
|
+
vertical: w.vertical,
|
|
950
|
+
"tooltip-class": w.tooltipClass,
|
|
951
|
+
placement: w.placement,
|
|
952
|
+
role: "slider",
|
|
953
|
+
"aria-label": w.range || !t($) ? i.value : void 0,
|
|
954
|
+
"aria-labelledby": !w.range && t($) ? (h = t(m)) == null ? void 0 : h.labelId : void 0,
|
|
955
|
+
"aria-valuemin": w.min,
|
|
956
|
+
"aria-valuemax": w.range ? t(C) : w.max,
|
|
957
|
+
"aria-valuenow": t(p),
|
|
958
|
+
"aria-valuetext": d.value,
|
|
959
|
+
"aria-orientation": w.vertical ? "vertical" : "horizontal",
|
|
960
|
+
"aria-disabled": t(M),
|
|
961
|
+
"onUpdate:modelValue": t(X)
|
|
962
|
+
}, null, 8, [
|
|
963
|
+
"id",
|
|
964
|
+
"model-value",
|
|
965
|
+
"vertical",
|
|
966
|
+
"tooltip-class",
|
|
967
|
+
"placement",
|
|
968
|
+
"aria-label",
|
|
969
|
+
"aria-labelledby",
|
|
970
|
+
"aria-valuemin",
|
|
971
|
+
"aria-valuemax",
|
|
972
|
+
"aria-valuenow",
|
|
973
|
+
"aria-valuetext",
|
|
974
|
+
"aria-orientation",
|
|
975
|
+
"aria-disabled",
|
|
976
|
+
"onUpdate:modelValue"
|
|
977
|
+
]),
|
|
978
|
+
w.range ? (b(), q(rt, {
|
|
979
|
+
key: 0,
|
|
980
|
+
ref_key: "secondButton",
|
|
981
|
+
ref: A,
|
|
982
|
+
"model-value": t(C),
|
|
983
|
+
vertical: w.vertical,
|
|
984
|
+
"tooltip-class": w.tooltipClass,
|
|
985
|
+
placement: w.placement,
|
|
986
|
+
role: "slider",
|
|
987
|
+
"aria-label": S.value,
|
|
988
|
+
"aria-valuemin": t(p),
|
|
989
|
+
"aria-valuemax": w.max,
|
|
990
|
+
"aria-valuenow": t(C),
|
|
991
|
+
"aria-valuetext": N.value,
|
|
992
|
+
"aria-orientation": w.vertical ? "vertical" : "horizontal",
|
|
993
|
+
"aria-disabled": t(M),
|
|
994
|
+
"onUpdate:modelValue": t(T)
|
|
995
|
+
}, null, 8, [
|
|
996
|
+
"model-value",
|
|
997
|
+
"vertical",
|
|
998
|
+
"tooltip-class",
|
|
999
|
+
"placement",
|
|
1000
|
+
"aria-label",
|
|
1001
|
+
"aria-valuemin",
|
|
1002
|
+
"aria-valuemax",
|
|
1003
|
+
"aria-valuenow",
|
|
1004
|
+
"aria-valuetext",
|
|
1005
|
+
"aria-orientation",
|
|
1006
|
+
"aria-disabled",
|
|
1007
|
+
"onUpdate:modelValue"
|
|
1008
|
+
])) : Y("v-if", !0),
|
|
1009
|
+
w.showStops ? (b(), P("div", pl, [(b(!0), P(ke, null, Be(t(_), (l, F) => (b(), P("div", {
|
|
1010
|
+
key: F,
|
|
1011
|
+
class: j(t(c).e("stop")),
|
|
1012
|
+
style: me(t(fe)(l))
|
|
1013
|
+
}, null, 6))), 128))])) : Y("v-if", !0),
|
|
1014
|
+
t(ie).length > 0 ? (b(), P(ke, { key: 2 }, [r("div", null, [(b(!0), P(ke, null, Be(t(ie), (l, F) => (b(), P("div", {
|
|
1015
|
+
key: F,
|
|
1016
|
+
style: me(t(fe)(l.position)),
|
|
1017
|
+
class: j([t(c).e("stop"), t(c).e("marks-stop")])
|
|
1018
|
+
}, null, 6))), 128))]), r("div", { class: j(t(c).e("marks")) }, [(b(!0), P(ke, null, Be(t(ie), (l, F) => (b(), q(t(yl), {
|
|
1019
|
+
key: F,
|
|
1020
|
+
mark: l.mark,
|
|
1021
|
+
style: me(t(fe)(l.position)),
|
|
1022
|
+
onMousedown: lt((ge) => t(I)(l.position), ["stop"])
|
|
1023
|
+
}, null, 8, [
|
|
1024
|
+
"mark",
|
|
1025
|
+
"style",
|
|
1026
|
+
"onMousedown"
|
|
1027
|
+
]))), 128))], 2)], 64)) : Y("v-if", !0)
|
|
1028
|
+
], 38), ue.value ? (b(), q(t(nl), {
|
|
1029
|
+
key: 0,
|
|
1030
|
+
ref: "input",
|
|
1031
|
+
"model-value": t(p),
|
|
1032
|
+
class: j(t(c).e("input")),
|
|
1033
|
+
step: de.value,
|
|
1034
|
+
disabled: t(M),
|
|
1035
|
+
controls: w.showInputControls,
|
|
1036
|
+
min: w.min,
|
|
1037
|
+
max: w.max,
|
|
1038
|
+
precision: oe.value,
|
|
1039
|
+
size: Q.value,
|
|
1040
|
+
"onUpdate:modelValue": t(X),
|
|
1041
|
+
onChange: t(D)
|
|
1042
|
+
}, null, 8, [
|
|
1043
|
+
"model-value",
|
|
1044
|
+
"class",
|
|
1045
|
+
"step",
|
|
1046
|
+
"disabled",
|
|
1047
|
+
"controls",
|
|
1048
|
+
"min",
|
|
1049
|
+
"max",
|
|
1050
|
+
"precision",
|
|
1051
|
+
"size",
|
|
1052
|
+
"onUpdate:modelValue",
|
|
1053
|
+
"onChange"
|
|
1054
|
+
])) : Y("v-if", !0)], 10, Vl);
|
|
1055
|
+
};
|
|
1056
|
+
}
|
|
1057
|
+
}), Sl = wl;
|
|
1058
|
+
const kl = et(Sl), xl = (e) => ["", ...Nt].includes(e), El = Le({
|
|
1059
|
+
/**
|
|
1060
|
+
* @description binding value, it should be equivalent to either `active-value` or `inactive-value`, by default it's `boolean` type
|
|
1061
|
+
*/
|
|
1062
|
+
modelValue: {
|
|
1063
|
+
type: [
|
|
1064
|
+
Boolean,
|
|
1065
|
+
String,
|
|
1066
|
+
Number
|
|
1067
|
+
],
|
|
1068
|
+
default: !1
|
|
1069
|
+
},
|
|
1070
|
+
/**
|
|
1071
|
+
* @description whether Switch is disabled
|
|
1072
|
+
*/
|
|
1073
|
+
disabled: {
|
|
1074
|
+
type: Boolean,
|
|
1075
|
+
default: void 0
|
|
1076
|
+
},
|
|
1077
|
+
/**
|
|
1078
|
+
* @description whether Switch is in loading state
|
|
1079
|
+
*/
|
|
1080
|
+
loading: Boolean,
|
|
1081
|
+
/**
|
|
1082
|
+
* @description size of Switch
|
|
1083
|
+
*/
|
|
1084
|
+
size: {
|
|
1085
|
+
type: String,
|
|
1086
|
+
validator: xl
|
|
1087
|
+
},
|
|
1088
|
+
/**
|
|
1089
|
+
* @description width of Switch
|
|
1090
|
+
*/
|
|
1091
|
+
width: {
|
|
1092
|
+
type: [String, Number],
|
|
1093
|
+
default: ""
|
|
1094
|
+
},
|
|
1095
|
+
/**
|
|
1096
|
+
* @description whether icon or text is displayed inside dot, only the first character will be rendered for text
|
|
1097
|
+
*/
|
|
1098
|
+
inlinePrompt: Boolean,
|
|
1099
|
+
/**
|
|
1100
|
+
* @description component of the icon displayed in action when in `off` state
|
|
1101
|
+
*/
|
|
1102
|
+
inactiveActionIcon: { type: Re },
|
|
1103
|
+
/**
|
|
1104
|
+
* @description component of the icon displayed in action when in `on` state
|
|
1105
|
+
*/
|
|
1106
|
+
activeActionIcon: { type: Re },
|
|
1107
|
+
/**
|
|
1108
|
+
* @description component of the icon displayed when in `on` state, overrides `active-text`
|
|
1109
|
+
*/
|
|
1110
|
+
activeIcon: { type: Re },
|
|
1111
|
+
/**
|
|
1112
|
+
* @description component of the icon displayed when in `off` state, overrides `inactive-text`
|
|
1113
|
+
*/
|
|
1114
|
+
inactiveIcon: { type: Re },
|
|
1115
|
+
/**
|
|
1116
|
+
* @description text displayed when in `on` state
|
|
1117
|
+
*/
|
|
1118
|
+
activeText: {
|
|
1119
|
+
type: String,
|
|
1120
|
+
default: ""
|
|
1121
|
+
},
|
|
1122
|
+
/**
|
|
1123
|
+
* @description text displayed when in `off` state
|
|
1124
|
+
*/
|
|
1125
|
+
inactiveText: {
|
|
1126
|
+
type: String,
|
|
1127
|
+
default: ""
|
|
1128
|
+
},
|
|
1129
|
+
/**
|
|
1130
|
+
* @description switch value when in `on` state
|
|
1131
|
+
*/
|
|
1132
|
+
activeValue: {
|
|
1133
|
+
type: [
|
|
1134
|
+
Boolean,
|
|
1135
|
+
String,
|
|
1136
|
+
Number
|
|
1137
|
+
],
|
|
1138
|
+
default: !0
|
|
1139
|
+
},
|
|
1140
|
+
/**
|
|
1141
|
+
* @description switch value when in `off` state
|
|
1142
|
+
*/
|
|
1143
|
+
inactiveValue: {
|
|
1144
|
+
type: [
|
|
1145
|
+
Boolean,
|
|
1146
|
+
String,
|
|
1147
|
+
Number
|
|
1148
|
+
],
|
|
1149
|
+
default: !1
|
|
1150
|
+
},
|
|
1151
|
+
/**
|
|
1152
|
+
* @description input name of Switch
|
|
1153
|
+
*/
|
|
1154
|
+
name: {
|
|
1155
|
+
type: String,
|
|
1156
|
+
default: ""
|
|
1157
|
+
},
|
|
1158
|
+
/**
|
|
1159
|
+
* @description whether to trigger form validation
|
|
1160
|
+
*/
|
|
1161
|
+
validateEvent: {
|
|
1162
|
+
type: Boolean,
|
|
1163
|
+
default: !0
|
|
1164
|
+
},
|
|
1165
|
+
/**
|
|
1166
|
+
* @description before-change hook before the switch state changes. If `false` is returned or a `Promise` is returned and then is rejected, will stop switching
|
|
1167
|
+
*/
|
|
1168
|
+
beforeChange: { type: ce(Function) },
|
|
1169
|
+
/**
|
|
1170
|
+
* @description id for input
|
|
1171
|
+
*/
|
|
1172
|
+
id: String,
|
|
1173
|
+
/**
|
|
1174
|
+
* @description tabindex for input
|
|
1175
|
+
*/
|
|
1176
|
+
tabindex: { type: [String, Number] },
|
|
1177
|
+
...Je(["ariaLabel"])
|
|
1178
|
+
}), Nl = {
|
|
1179
|
+
[ve]: (e) => Oe(e) || Me(e) || J(e),
|
|
1180
|
+
[Ee]: (e) => Oe(e) || Me(e) || J(e),
|
|
1181
|
+
[Ve]: (e) => Oe(e) || Me(e) || J(e)
|
|
1182
|
+
}, Cl = [
|
|
1183
|
+
"id",
|
|
1184
|
+
"aria-checked",
|
|
1185
|
+
"aria-disabled",
|
|
1186
|
+
"aria-label",
|
|
1187
|
+
"name",
|
|
1188
|
+
"true-value",
|
|
1189
|
+
"false-value",
|
|
1190
|
+
"disabled",
|
|
1191
|
+
"tabindex"
|
|
1192
|
+
], Il = ["aria-hidden"], Ml = { key: 1 }, Bl = { key: 1 }, Tl = ["aria-hidden"], Ke = "ElSwitch";
|
|
1193
|
+
var $l = /* @__PURE__ */ Te({
|
|
1194
|
+
name: Ke,
|
|
1195
|
+
__name: "switch",
|
|
1196
|
+
props: El,
|
|
1197
|
+
emits: Nl,
|
|
1198
|
+
setup(e, { expose: a, emit: u }) {
|
|
1199
|
+
const n = e, g = u, { formItem: c } = Ze(), f = qe(), v = Ue("switch"), { inputId: m } = gt(n, { formItemContext: c }), s = _e(k(() => {
|
|
1200
|
+
if (n.loading) return !0;
|
|
1201
|
+
})), x = O(n.modelValue !== !1), A = bt(), M = k(() => [
|
|
1202
|
+
v.b(),
|
|
1203
|
+
v.m(f.value),
|
|
1204
|
+
v.is("disabled", s.value),
|
|
1205
|
+
v.is("checked", V.value)
|
|
1206
|
+
]), G = k(() => [
|
|
1207
|
+
v.e("label"),
|
|
1208
|
+
v.em("label", "left"),
|
|
1209
|
+
v.is("active", !V.value)
|
|
1210
|
+
]), H = k(() => [
|
|
1211
|
+
v.e("label"),
|
|
1212
|
+
v.em("label", "right"),
|
|
1213
|
+
v.is("active", V.value)
|
|
1214
|
+
]), L = k(() => ({ width: Ct(n.width) }));
|
|
1215
|
+
we(() => n.modelValue, () => {
|
|
1216
|
+
x.value = !0;
|
|
1217
|
+
});
|
|
1218
|
+
const R = k(() => x.value ? n.modelValue : !1), V = k(() => R.value === n.activeValue);
|
|
1219
|
+
[n.activeValue, n.inactiveValue].includes(R.value) || (xe(Ke, "model-value must be active-value or inactive-value"), g(ve, n.inactiveValue), g(Ee, n.inactiveValue), g(Ve, n.inactiveValue)), we(V, (y) => {
|
|
1220
|
+
var I;
|
|
1221
|
+
A.value.checked = y, n.validateEvent && ((I = c == null ? void 0 : c.validate) == null || I.call(c, "change").catch(Ae));
|
|
1222
|
+
});
|
|
1223
|
+
const D = () => {
|
|
1224
|
+
const y = V.value ? n.inactiveValue : n.activeValue;
|
|
1225
|
+
g(ve, y), g(Ee, y), g(Ve, y), ze(() => {
|
|
1226
|
+
A.value.checked = V.value;
|
|
1227
|
+
});
|
|
1228
|
+
}, W = () => {
|
|
1229
|
+
if (s.value) return;
|
|
1230
|
+
const { beforeChange: y } = n;
|
|
1231
|
+
if (!y) {
|
|
1232
|
+
D();
|
|
1233
|
+
return;
|
|
1234
|
+
}
|
|
1235
|
+
const I = y();
|
|
1236
|
+
[ot(I), Oe(I)].includes(!0) || Qe(Ke, "beforeChange must return type `Promise<boolean>` or `boolean`"), ot(I) ? I.then((X) => {
|
|
1237
|
+
X && D();
|
|
1238
|
+
}).catch((X) => {
|
|
1239
|
+
xe(Ke, `some error occurred: ${X}`);
|
|
1240
|
+
}) : I && D();
|
|
1241
|
+
}, ee = () => {
|
|
1242
|
+
var y, I;
|
|
1243
|
+
(I = (y = A.value) == null ? void 0 : y.focus) == null || I.call(y);
|
|
1244
|
+
};
|
|
1245
|
+
return Ye(() => {
|
|
1246
|
+
A.value.checked = V.value;
|
|
1247
|
+
}), a({
|
|
1248
|
+
/**
|
|
1249
|
+
* @description manual focus to the switch component
|
|
1250
|
+
**/
|
|
1251
|
+
focus: ee,
|
|
1252
|
+
/**
|
|
1253
|
+
* @description whether Switch is checked
|
|
1254
|
+
*/
|
|
1255
|
+
checked: V
|
|
1256
|
+
}), (y, I) => (b(), P("div", {
|
|
1257
|
+
class: j(M.value),
|
|
1258
|
+
onClick: lt(W, ["prevent"])
|
|
1259
|
+
}, [
|
|
1260
|
+
r("input", {
|
|
1261
|
+
id: t(m),
|
|
1262
|
+
ref_key: "input",
|
|
1263
|
+
ref: A,
|
|
1264
|
+
class: j(t(v).e("input")),
|
|
1265
|
+
type: "checkbox",
|
|
1266
|
+
role: "switch",
|
|
1267
|
+
"aria-checked": V.value,
|
|
1268
|
+
"aria-disabled": t(s),
|
|
1269
|
+
"aria-label": e.ariaLabel,
|
|
1270
|
+
name: e.name,
|
|
1271
|
+
"true-value": e.activeValue,
|
|
1272
|
+
"false-value": e.inactiveValue,
|
|
1273
|
+
disabled: t(s),
|
|
1274
|
+
tabindex: e.tabindex,
|
|
1275
|
+
onChange: D,
|
|
1276
|
+
onKeydown: He(W, ["enter"])
|
|
1277
|
+
}, null, 42, Cl),
|
|
1278
|
+
!e.inlinePrompt && (e.inactiveIcon || e.inactiveText || y.$slots.inactive) ? (b(), P("span", {
|
|
1279
|
+
key: 0,
|
|
1280
|
+
class: j(G.value)
|
|
1281
|
+
}, [ye(y.$slots, "inactive", {}, () => [e.inactiveIcon ? (b(), q(t(pe), { key: 0 }, {
|
|
1282
|
+
default: ae(() => [(b(), q(Ie(e.inactiveIcon)))]),
|
|
1283
|
+
_: 1
|
|
1284
|
+
})) : Y("v-if", !0), !e.inactiveIcon && e.inactiveText ? (b(), P("span", {
|
|
1285
|
+
key: 1,
|
|
1286
|
+
"aria-hidden": V.value
|
|
1287
|
+
}, B(e.inactiveText), 9, Il)) : Y("v-if", !0)])], 2)) : Y("v-if", !0),
|
|
1288
|
+
r("span", {
|
|
1289
|
+
class: j(t(v).e("core")),
|
|
1290
|
+
style: me(L.value)
|
|
1291
|
+
}, [e.inlinePrompt ? (b(), P("div", {
|
|
1292
|
+
key: 0,
|
|
1293
|
+
class: j(t(v).e("inner"))
|
|
1294
|
+
}, [V.value ? (b(), P("div", {
|
|
1295
|
+
key: 1,
|
|
1296
|
+
class: j(t(v).e("inner-wrapper"))
|
|
1297
|
+
}, [ye(y.$slots, "active", {}, () => [e.activeIcon ? (b(), q(t(pe), { key: 0 }, {
|
|
1298
|
+
default: ae(() => [(b(), q(Ie(e.activeIcon)))]),
|
|
1299
|
+
_: 1
|
|
1300
|
+
})) : Y("v-if", !0), !e.activeIcon && e.activeText ? (b(), P("span", Bl, B(e.activeText), 1)) : Y("v-if", !0)])], 2)) : (b(), P("div", {
|
|
1301
|
+
key: 0,
|
|
1302
|
+
class: j(t(v).e("inner-wrapper"))
|
|
1303
|
+
}, [ye(y.$slots, "inactive", {}, () => [e.inactiveIcon ? (b(), q(t(pe), { key: 0 }, {
|
|
1304
|
+
default: ae(() => [(b(), q(Ie(e.inactiveIcon)))]),
|
|
1305
|
+
_: 1
|
|
1306
|
+
})) : Y("v-if", !0), !e.inactiveIcon && e.inactiveText ? (b(), P("span", Ml, B(e.inactiveText), 1)) : Y("v-if", !0)])], 2))], 2)) : Y("v-if", !0), r("div", { class: j(t(v).e("action")) }, [e.loading ? (b(), q(t(pe), {
|
|
1307
|
+
key: 0,
|
|
1308
|
+
class: j(t(v).is("loading"))
|
|
1309
|
+
}, {
|
|
1310
|
+
default: ae(() => [z(t(Wt))]),
|
|
1311
|
+
_: 1
|
|
1312
|
+
}, 8, ["class"])) : V.value ? ye(y.$slots, "active-action", { key: 1 }, () => [e.activeActionIcon ? (b(), q(t(pe), { key: 0 }, {
|
|
1313
|
+
default: ae(() => [(b(), q(Ie(e.activeActionIcon)))]),
|
|
1314
|
+
_: 1
|
|
1315
|
+
})) : Y("v-if", !0)]) : V.value ? Y("v-if", !0) : ye(y.$slots, "inactive-action", { key: 2 }, () => [e.inactiveActionIcon ? (b(), q(t(pe), { key: 0 }, {
|
|
1316
|
+
default: ae(() => [(b(), q(Ie(e.inactiveActionIcon)))]),
|
|
1317
|
+
_: 1
|
|
1318
|
+
})) : Y("v-if", !0)])], 2)], 6),
|
|
1319
|
+
!e.inlinePrompt && (e.activeIcon || e.activeText || y.$slots.active) ? (b(), P("span", {
|
|
1320
|
+
key: 1,
|
|
1321
|
+
class: j(H.value)
|
|
1322
|
+
}, [ye(y.$slots, "active", {}, () => [e.activeIcon ? (b(), q(t(pe), { key: 0 }, {
|
|
1323
|
+
default: ae(() => [(b(), q(Ie(e.activeIcon)))]),
|
|
1324
|
+
_: 1
|
|
1325
|
+
})) : Y("v-if", !0), !e.activeIcon && e.activeText ? (b(), P("span", {
|
|
1326
|
+
key: 1,
|
|
1327
|
+
"aria-hidden": !V.value
|
|
1328
|
+
}, B(e.activeText), 9, Tl)) : Y("v-if", !0)])], 2)) : Y("v-if", !0)
|
|
1329
|
+
], 2));
|
|
1330
|
+
}
|
|
1331
|
+
}), Pl = $l;
|
|
1332
|
+
const Al = et(Pl), zl = { style: { height: "var(--setting-content-height)" } }, Ll = { class: "setting-title" }, Ul = {
|
|
1333
|
+
key: 0,
|
|
1334
|
+
class: "color-list"
|
|
1335
|
+
}, Fl = ["onClick"], Rl = { class: "setting-effect" }, Kl = { class: "setting-effect" }, Ol = { class: "light-slider" }, Wl = {
|
|
1336
|
+
key: 1,
|
|
1337
|
+
class: "setting-title"
|
|
1338
|
+
}, Yl = {
|
|
1339
|
+
key: 2,
|
|
1340
|
+
class: "setting-effect"
|
|
1341
|
+
}, Xl = { class: "setting-effect" }, jl = { style: { cursor: "help" } }, Gl = { class: "setting-title" }, Hl = { class: "setting-effect" }, Dl = { class: "setting-effect" }, Jl = { class: "setting-effect" }, Zl = { class: "setting-effect" }, ql = { class: "setting-effect" }, _l = { class: "setting-effect" }, Ql = {
|
|
1342
|
+
key: 1,
|
|
1343
|
+
class: "setting_panel"
|
|
1344
|
+
}, en = { class: "setting-title-box" }, tn = { class: "setting-title" }, ln = { class: "setting-title-icon" }, nn = { class: "setting-color-box" }, an = { class: "setting-color-list" }, on = ["onClick"], sn = { class: "setting-config-box" }, un = { class: "setting-switch-item" }, rn = { class: "setting-switch-item" }, dn = { class: "setting-switch-item" }, cn = { class: "setting-switch-item" }, vn = { class: "setting-switch-item" }, mn = { class: "setting-switch-item" }, fn = { class: "setting-switch-item" }, gn = { class: "setting-switch-item" }, bn = { class: "light-slider" }, hn = { class: "setting-switch-item" }, yn = { class: "speed-slider" }, Vn = { class: "setting-switch-item" }, pn = ["title"], dt = "BIMX_PERF", wn = /* @__PURE__ */ Te({
|
|
1345
|
+
__name: "SettingTool",
|
|
1346
|
+
props: {
|
|
1347
|
+
instruction: {},
|
|
1348
|
+
componentId: {}
|
|
1349
|
+
},
|
|
1350
|
+
emits: ["closePanel", "emitHandler"],
|
|
1351
|
+
setup(e, { emit: a }) {
|
|
1352
|
+
const u = It(), n = Mt(), g = Bt(), c = e, f = O(0);
|
|
1353
|
+
Ye(() => {
|
|
1354
|
+
g.setReadyById(c.componentId), st.currentTheme == "blue" ? f.value = 240 : st.currentTheme == "light-gray" && (f.value = 202);
|
|
1355
|
+
});
|
|
1356
|
+
let v;
|
|
1357
|
+
const m = O(!1), s = O(!1), x = O(!1), A = O(!1), M = O(!1), G = O(!0), H = O(!1), L = O(!1), R = O(1), V = O(50), D = O(!1), W = O(!1), ee = O(!1);
|
|
1358
|
+
try {
|
|
1359
|
+
ee.value = localStorage.getItem(dt) === "1";
|
|
1360
|
+
} catch {
|
|
1361
|
+
}
|
|
1362
|
+
const y = new Zt(5), I = O(!1);
|
|
1363
|
+
we(
|
|
1364
|
+
() => g.isToolActive(c.componentId),
|
|
1365
|
+
(h) => {
|
|
1366
|
+
h === !1 ? (y.stop(), D.value && ue()) : I.value || (I.value = !0);
|
|
1367
|
+
}
|
|
1368
|
+
);
|
|
1369
|
+
const X = O(50), T = O(["亮"]), _ = O(["亮", "暗"]), fe = {
|
|
1370
|
+
亮: "setting.spaceEffects.bright",
|
|
1371
|
+
暗: "setting.spaceEffects.dark"
|
|
1372
|
+
}, E = O("linear-gradient(180deg, #fffefb 0%, #daebff 100%)"), $ = a;
|
|
1373
|
+
k({
|
|
1374
|
+
get: () => n.locale,
|
|
1375
|
+
set: (h) => n.setLocale(h)
|
|
1376
|
+
});
|
|
1377
|
+
const Z = () => {
|
|
1378
|
+
v = window.bimViewer, v.viewer.scene.on("aabb", () => {
|
|
1379
|
+
K(H.value), w(!0);
|
|
1380
|
+
});
|
|
1381
|
+
}, Q = () => {
|
|
1382
|
+
I.value && (D.value = !0, y.start(() => {
|
|
1383
|
+
ue();
|
|
1384
|
+
}));
|
|
1385
|
+
}, ue = () => {
|
|
1386
|
+
var l, F;
|
|
1387
|
+
let h;
|
|
1388
|
+
Se("isMobile") ? h = {
|
|
1389
|
+
backgroundColor: ((l = Ne.find((ge) => ge.id == R.value)) == null ? void 0 : l.name) ?? "渐变蓝",
|
|
1390
|
+
showEdges: x.value,
|
|
1391
|
+
lightIntensity: V.value,
|
|
1392
|
+
skyBox: A.value,
|
|
1393
|
+
orthoMode: M.value,
|
|
1394
|
+
modelType2D: G.value,
|
|
1395
|
+
yAxisDown: m.value,
|
|
1396
|
+
zAxisUp: s.value,
|
|
1397
|
+
showSpace: H.value,
|
|
1398
|
+
spaceEffect: W.value,
|
|
1399
|
+
touchDollySpeed: X.value
|
|
1400
|
+
} : h = {
|
|
1401
|
+
backgroundColor: ((F = Ne.find((ge) => ge.id == R.value)) == null ? void 0 : F.name) ?? "渐变蓝",
|
|
1402
|
+
showEdges: x.value,
|
|
1403
|
+
lightIntensity: V.value,
|
|
1404
|
+
skyBox: A.value,
|
|
1405
|
+
orthoMode: M.value,
|
|
1406
|
+
modelType2D: G.value,
|
|
1407
|
+
yAxisDown: m.value,
|
|
1408
|
+
zAxisUp: s.value,
|
|
1409
|
+
showSpace: H.value,
|
|
1410
|
+
spaceEffect: T.value[0],
|
|
1411
|
+
touchDollySpeed: X.value
|
|
1412
|
+
}, i({
|
|
1413
|
+
isTool: !0,
|
|
1414
|
+
event_target: "SettingTool",
|
|
1415
|
+
event_name: "saveSetting",
|
|
1416
|
+
content: {
|
|
1417
|
+
newSets: h
|
|
1418
|
+
}
|
|
1419
|
+
}), D.value = !1;
|
|
1420
|
+
}, re = (h) => {
|
|
1421
|
+
const l = h.lastSet, F = Ne.find((ge) => ge.name == l.backgroundColor);
|
|
1422
|
+
R.value = F ? F.id : 1, ie(F ?? Ne[0]), x.value = l.showEdges, oe(x.value), V.value = l.lightIntensity, de(V.value), M.value = l.orthoMode, C(M.value), G.value = l.modelType2D, p(G.value), H.value = l.showSpace, K(H.value), Se("isMobile") ? (W.value = typeof l.spaceEffect == "string" ? l.spaceEffect == "亮" : typeof l.spaceEffect == "boolean" ? l.spaceEffect : !0, w(W.value)) : (T.value = [l.spaceEffect], se(T.value[0])), m.value = l.yAxisDown, m.value && te(), s.value = l.zAxisUp, s.value && N(), X.value = l.touchDollySpeed ?? 50, Se("isMobile") ? ne(X.value) : (A.value = l.skyBox, le(A.value)), D.value = !1;
|
|
1423
|
+
};
|
|
1424
|
+
Ce.on("BimViewer", Z), Ce.on("lastSetsContent", re), Jt(() => {
|
|
1425
|
+
Ce.off("BimViewer", Z), Ce.off("lastSetsContent", re);
|
|
1426
|
+
});
|
|
1427
|
+
const i = (h) => {
|
|
1428
|
+
$("emitHandler", h);
|
|
1429
|
+
}, d = (h) => {
|
|
1430
|
+
h && h.target.id != "setting_back" || (Ce.emit("hideToolbar", !1), $("closePanel"), S(!1));
|
|
1431
|
+
}, S = (h = !L.value) => {
|
|
1432
|
+
L.value = h;
|
|
1433
|
+
}, N = () => {
|
|
1434
|
+
Q(), s.value && (m.value = !1), window.bimViewer.setWorldAxisZUp(s.value), C(M.value);
|
|
1435
|
+
}, te = () => {
|
|
1436
|
+
Q(), m.value && (s.value = !1), window.bimViewer.setWorldAxisYDown(m.value), C(M.value);
|
|
1437
|
+
}, ie = (h) => {
|
|
1438
|
+
Q(), R.value = h.id, E.value = h.color, Ce.emit("changeBackgroundColor", h.color);
|
|
1439
|
+
}, de = (h) => {
|
|
1440
|
+
Q(), v.setLightIntensity(h);
|
|
1441
|
+
}, oe = (h) => {
|
|
1442
|
+
Q(), v.setAllObjectsEdges(h), h || v.setObjectsEdges(zt.entityState.edgesObjectIds, !0);
|
|
1443
|
+
}, U = () => {
|
|
1444
|
+
try {
|
|
1445
|
+
localStorage.setItem(dt, ee.value ? "1" : "0");
|
|
1446
|
+
} catch {
|
|
1447
|
+
}
|
|
1448
|
+
location.reload();
|
|
1449
|
+
}, p = (h) => {
|
|
1450
|
+
Q(), v.SetThreeDModeActive(h), Se("isMobile") && (window.bimViewer.navCubeMode.visible = !1);
|
|
1451
|
+
}, C = (h) => {
|
|
1452
|
+
Q(), v.SetOrthoModeActive(h);
|
|
1453
|
+
}, K = (h) => {
|
|
1454
|
+
Q(), v.SetShowSpaceModeActive(h), se(W.value ? 1 : 2);
|
|
1455
|
+
}, se = (h) => {
|
|
1456
|
+
Q(), h == "亮" ? window.bimViewer.setSpaceMaterialColor(1) : window.bimViewer.setSpaceMaterialColor(2), T.value = _.value.includes(h) ? [h] : [];
|
|
1457
|
+
}, w = (h = !W.value) => {
|
|
1458
|
+
Q(), window.bimViewer.setSpaceMaterialColor(h ? 2 : 1);
|
|
1459
|
+
}, le = (h) => {
|
|
1460
|
+
Q(), v.SetSkyBoxToolActive(h);
|
|
1461
|
+
}, ne = (h) => {
|
|
1462
|
+
Q(), h == 0 ? v.viewer.cameraControl.customTouchDollyRate = 0.05 / 50 : v.viewer.cameraControl.customTouchDollyRate = h / 50;
|
|
1463
|
+
};
|
|
1464
|
+
return (h, l) => {
|
|
1465
|
+
const F = Al, ge = kl, yt = ft, Vt = Pt, pt = $t, nt = Tt, wt = Ut, St = At;
|
|
1466
|
+
return b(), P(ke, null, [
|
|
1467
|
+
t(Se)("isMobile") ? Y("", !0) : (b(), q(wt, {
|
|
1468
|
+
key: 0,
|
|
1469
|
+
class: "setting_contaier",
|
|
1470
|
+
width: f.value,
|
|
1471
|
+
panelTitle: t(u)("setting.title"),
|
|
1472
|
+
"click-handle": d,
|
|
1473
|
+
style: { height: "var(--setting-panel-height)" }
|
|
1474
|
+
}, {
|
|
1475
|
+
default: ae(() => [
|
|
1476
|
+
r("div", zl, [
|
|
1477
|
+
z(nt, null, {
|
|
1478
|
+
default: ae(() => [
|
|
1479
|
+
r("div", Ll, B(t(u)("setting.effect")), 1),
|
|
1480
|
+
r("div", {
|
|
1481
|
+
class: "setting-effect",
|
|
1482
|
+
onClick: l[0] || (l[0] = (o) => S())
|
|
1483
|
+
}, [
|
|
1484
|
+
be(B(t(u)("setting.bgColor")) + " ", 1),
|
|
1485
|
+
r("div", {
|
|
1486
|
+
class: "choose-color",
|
|
1487
|
+
style: me({ background: E.value })
|
|
1488
|
+
}, null, 4)
|
|
1489
|
+
]),
|
|
1490
|
+
L.value ? (b(), P("div", Ul, [
|
|
1491
|
+
(b(!0), P(ke, null, Be(t(Ne), (o) => (b(), P("div", {
|
|
1492
|
+
key: o.id,
|
|
1493
|
+
class: j(["color-item", { "color-item-active": R.value === o.id }]),
|
|
1494
|
+
onClick: (Xe) => ie(o)
|
|
1495
|
+
}, [
|
|
1496
|
+
r("div", {
|
|
1497
|
+
class: "bg",
|
|
1498
|
+
style: me({ background: o.color, border: o.id === 4 ? "1px solid #F1F1F1" : "none" })
|
|
1499
|
+
}, null, 4),
|
|
1500
|
+
be(" " + B(t(u)(o.label || o.name)), 1)
|
|
1501
|
+
], 10, Fl))), 128))
|
|
1502
|
+
])) : Y("", !0),
|
|
1503
|
+
r("div", Rl, [
|
|
1504
|
+
be(B(t(u)("setting.showEdges")) + " ", 1),
|
|
1505
|
+
z(F, {
|
|
1506
|
+
modelValue: x.value,
|
|
1507
|
+
"onUpdate:modelValue": l[1] || (l[1] = (o) => x.value = o),
|
|
1508
|
+
style: { "--el-switch-on-color": "#0065fc" },
|
|
1509
|
+
onChange: l[2] || (l[2] = (o) => oe())
|
|
1510
|
+
}, null, 8, ["modelValue"])
|
|
1511
|
+
]),
|
|
1512
|
+
r("div", Kl, [
|
|
1513
|
+
be(B(t(u)("setting.lightIntensity")) + " ", 1),
|
|
1514
|
+
r("div", Ol, [
|
|
1515
|
+
z(ge, {
|
|
1516
|
+
modelValue: V.value,
|
|
1517
|
+
"onUpdate:modelValue": l[3] || (l[3] = (o) => V.value = o),
|
|
1518
|
+
onInput: l[4] || (l[4] = (o) => de(V.value))
|
|
1519
|
+
}, null, 8, ["modelValue"])
|
|
1520
|
+
])
|
|
1521
|
+
]),
|
|
1522
|
+
t(Se)("skyboxImg") ? (b(), P("div", Wl, B(t(u)("setting.appearance")), 1)) : Y("", !0),
|
|
1523
|
+
t(Se)("skyboxImg") ? (b(), P("div", Yl, [
|
|
1524
|
+
be(B(t(u)("setting.skybox")) + " ", 1),
|
|
1525
|
+
z(F, {
|
|
1526
|
+
modelValue: A.value,
|
|
1527
|
+
"onUpdate:modelValue": l[5] || (l[5] = (o) => A.value = o),
|
|
1528
|
+
style: { "--el-switch-on-color": "#0065fc" },
|
|
1529
|
+
onChange: l[6] || (l[6] = (o) => le())
|
|
1530
|
+
}, null, 8, ["modelValue"])
|
|
1531
|
+
])) : Y("", !0),
|
|
1532
|
+
r("div", Xl, [
|
|
1533
|
+
z(yt, {
|
|
1534
|
+
content: t(u)("setting.perfModeTip"),
|
|
1535
|
+
placement: "top",
|
|
1536
|
+
effect: "light"
|
|
1537
|
+
}, {
|
|
1538
|
+
default: ae(() => [
|
|
1539
|
+
r("span", jl, B(t(u)("setting.perfMode")), 1)
|
|
1540
|
+
]),
|
|
1541
|
+
_: 1
|
|
1542
|
+
}, 8, ["content"]),
|
|
1543
|
+
z(F, {
|
|
1544
|
+
modelValue: ee.value,
|
|
1545
|
+
"onUpdate:modelValue": l[7] || (l[7] = (o) => ee.value = o),
|
|
1546
|
+
style: { "--el-switch-on-color": "#0065fc" },
|
|
1547
|
+
onChange: l[8] || (l[8] = (o) => U())
|
|
1548
|
+
}, null, 8, ["modelValue"])
|
|
1549
|
+
]),
|
|
1550
|
+
r("div", Gl, B(t(u)("setting.modelViewSwitch")), 1),
|
|
1551
|
+
r("div", Hl, [
|
|
1552
|
+
be(B(t(u)("setting.perspective")) + " ", 1),
|
|
1553
|
+
z(F, {
|
|
1554
|
+
modelValue: M.value,
|
|
1555
|
+
"onUpdate:modelValue": l[9] || (l[9] = (o) => M.value = o),
|
|
1556
|
+
style: { "--el-switch-on-color": "#0065fc" },
|
|
1557
|
+
onChange: l[10] || (l[10] = (o) => C())
|
|
1558
|
+
}, null, 8, ["modelValue"])
|
|
1559
|
+
]),
|
|
1560
|
+
r("div", Dl, [
|
|
1561
|
+
be(B(t(u)("setting.mode2d3d")) + " ", 1),
|
|
1562
|
+
z(F, {
|
|
1563
|
+
modelValue: G.value,
|
|
1564
|
+
"onUpdate:modelValue": l[11] || (l[11] = (o) => G.value = o),
|
|
1565
|
+
style: { "--el-switch-on-color": "#0065fc" },
|
|
1566
|
+
onChange: l[12] || (l[12] = (o) => p())
|
|
1567
|
+
}, null, 8, ["modelValue"])
|
|
1568
|
+
]),
|
|
1569
|
+
r("div", Jl, [
|
|
1570
|
+
r("div", null, B(t(u)("setting.modelInvert")), 1),
|
|
1571
|
+
r("div", null, [
|
|
1572
|
+
z(F, {
|
|
1573
|
+
modelValue: m.value,
|
|
1574
|
+
"onUpdate:modelValue": l[13] || (l[13] = (o) => m.value = o),
|
|
1575
|
+
style: { "--el-switch-on-color": "#0065fc" },
|
|
1576
|
+
onChange: l[14] || (l[14] = (o) => te())
|
|
1577
|
+
}, null, 8, ["modelValue"])
|
|
1578
|
+
])
|
|
1579
|
+
]),
|
|
1580
|
+
r("div", Zl, [
|
|
1581
|
+
r("div", null, B(t(u)("setting.zAxisUp")), 1),
|
|
1582
|
+
r("div", null, [
|
|
1583
|
+
z(F, {
|
|
1584
|
+
modelValue: s.value,
|
|
1585
|
+
"onUpdate:modelValue": l[15] || (l[15] = (o) => s.value = o),
|
|
1586
|
+
style: { "--el-switch-on-color": "#0065fc" },
|
|
1587
|
+
onChange: l[16] || (l[16] = (o) => N())
|
|
1588
|
+
}, null, 8, ["modelValue"])
|
|
1589
|
+
])
|
|
1590
|
+
]),
|
|
1591
|
+
r("div", ql, [
|
|
1592
|
+
be(B(t(u)("setting.modelSpace")) + " ", 1),
|
|
1593
|
+
z(F, {
|
|
1594
|
+
modelValue: H.value,
|
|
1595
|
+
"onUpdate:modelValue": l[17] || (l[17] = (o) => H.value = o),
|
|
1596
|
+
style: { "--el-switch-on-color": "#0065fc" },
|
|
1597
|
+
onChange: l[18] || (l[18] = (o) => K())
|
|
1598
|
+
}, null, 8, ["modelValue"])
|
|
1599
|
+
]),
|
|
1600
|
+
r("div", _l, [
|
|
1601
|
+
be(B(t(u)("setting.spaceEffect")) + " ", 1),
|
|
1602
|
+
z(pt, {
|
|
1603
|
+
modelValue: T.value,
|
|
1604
|
+
"onUpdate:modelValue": l[19] || (l[19] = (o) => T.value = o),
|
|
1605
|
+
size: "small"
|
|
1606
|
+
}, {
|
|
1607
|
+
default: ae(() => [
|
|
1608
|
+
(b(!0), P(ke, null, Be(_.value, (o) => (b(), q(Vt, {
|
|
1609
|
+
key: o,
|
|
1610
|
+
value: o,
|
|
1611
|
+
onChange: (Xe) => se(o)
|
|
1612
|
+
}, {
|
|
1613
|
+
default: ae(() => [
|
|
1614
|
+
be(B(t(u)(fe[o])), 1)
|
|
1615
|
+
]),
|
|
1616
|
+
_: 2
|
|
1617
|
+
}, 1032, ["value", "onChange"]))), 128))
|
|
1618
|
+
]),
|
|
1619
|
+
_: 1
|
|
1620
|
+
}, 8, ["modelValue"])
|
|
1621
|
+
])
|
|
1622
|
+
]),
|
|
1623
|
+
_: 1
|
|
1624
|
+
})
|
|
1625
|
+
])
|
|
1626
|
+
]),
|
|
1627
|
+
_: 1
|
|
1628
|
+
}, 8, ["width", "panelTitle"])),
|
|
1629
|
+
t(Se)("isMobile") ? (b(), P("div", Ql, [
|
|
1630
|
+
r("div", en, [
|
|
1631
|
+
r("div", tn, B(t(u)("setting.title")), 1),
|
|
1632
|
+
r("div", ln, [
|
|
1633
|
+
z(St, {
|
|
1634
|
+
width: 0.4,
|
|
1635
|
+
"size-type": "rem",
|
|
1636
|
+
"click-handle": d
|
|
1637
|
+
})
|
|
1638
|
+
])
|
|
1639
|
+
]),
|
|
1640
|
+
r("div", nn, [
|
|
1641
|
+
r("div", an, [
|
|
1642
|
+
(b(!0), P(ke, null, Be(t(Ne), (o, Xe) => (b(), P("div", {
|
|
1643
|
+
key: Xe,
|
|
1644
|
+
class: j(["setting-color-item", {
|
|
1645
|
+
"setting-color-item-active": R.value === o.id
|
|
1646
|
+
}]),
|
|
1647
|
+
onClick: (Sn) => ie(o)
|
|
1648
|
+
}, [
|
|
1649
|
+
r("div", {
|
|
1650
|
+
class: "setting-color-icon",
|
|
1651
|
+
style: me({
|
|
1652
|
+
background: o.color,
|
|
1653
|
+
border: o.id === R.value ? "0.02rem solid #0065FC" : ""
|
|
1654
|
+
})
|
|
1655
|
+
}, null, 4),
|
|
1656
|
+
r("div", {
|
|
1657
|
+
class: "setting-color-name",
|
|
1658
|
+
style: me({ color: o.id === R.value ? "#0065FC" : "" })
|
|
1659
|
+
}, B(t(u)(o.label || o.name)), 5)
|
|
1660
|
+
], 10, on))), 128))
|
|
1661
|
+
])
|
|
1662
|
+
]),
|
|
1663
|
+
r("div", sn, [
|
|
1664
|
+
z(nt, { height: "230" }, {
|
|
1665
|
+
default: ae(() => [
|
|
1666
|
+
r("div", un, [
|
|
1667
|
+
r("div", null, B(t(u)("setting.showEdges")), 1),
|
|
1668
|
+
r("div", null, [
|
|
1669
|
+
z(F, {
|
|
1670
|
+
modelValue: x.value,
|
|
1671
|
+
"onUpdate:modelValue": l[20] || (l[20] = (o) => x.value = o),
|
|
1672
|
+
size: "small",
|
|
1673
|
+
onChange: l[21] || (l[21] = (o) => oe())
|
|
1674
|
+
}, null, 8, ["modelValue"])
|
|
1675
|
+
])
|
|
1676
|
+
]),
|
|
1677
|
+
r("div", rn, [
|
|
1678
|
+
r("div", null, B(t(u)("setting.perspective")), 1),
|
|
1679
|
+
r("div", null, [
|
|
1680
|
+
z(F, {
|
|
1681
|
+
modelValue: M.value,
|
|
1682
|
+
"onUpdate:modelValue": l[22] || (l[22] = (o) => M.value = o),
|
|
1683
|
+
size: "small",
|
|
1684
|
+
onChange: l[23] || (l[23] = (o) => C())
|
|
1685
|
+
}, null, 8, ["modelValue"])
|
|
1686
|
+
])
|
|
1687
|
+
]),
|
|
1688
|
+
r("div", dn, [
|
|
1689
|
+
r("div", null, B(t(u)("setting.mode2d3d")), 1),
|
|
1690
|
+
r("div", null, [
|
|
1691
|
+
z(F, {
|
|
1692
|
+
modelValue: G.value,
|
|
1693
|
+
"onUpdate:modelValue": l[24] || (l[24] = (o) => G.value = o),
|
|
1694
|
+
size: "small",
|
|
1695
|
+
onChange: l[25] || (l[25] = (o) => p())
|
|
1696
|
+
}, null, 8, ["modelValue"])
|
|
1697
|
+
])
|
|
1698
|
+
]),
|
|
1699
|
+
r("div", cn, [
|
|
1700
|
+
r("div", null, B(t(u)("setting.modelInvert")), 1),
|
|
1701
|
+
r("div", null, [
|
|
1702
|
+
z(F, {
|
|
1703
|
+
modelValue: m.value,
|
|
1704
|
+
"onUpdate:modelValue": l[26] || (l[26] = (o) => m.value = o),
|
|
1705
|
+
size: "small",
|
|
1706
|
+
onChange: l[27] || (l[27] = (o) => te())
|
|
1707
|
+
}, null, 8, ["modelValue"])
|
|
1708
|
+
])
|
|
1709
|
+
]),
|
|
1710
|
+
r("div", vn, [
|
|
1711
|
+
r("div", null, B(t(u)("setting.zAxisUp")), 1),
|
|
1712
|
+
r("div", null, [
|
|
1713
|
+
z(F, {
|
|
1714
|
+
modelValue: s.value,
|
|
1715
|
+
"onUpdate:modelValue": l[28] || (l[28] = (o) => s.value = o),
|
|
1716
|
+
size: "small",
|
|
1717
|
+
onChange: l[29] || (l[29] = (o) => N())
|
|
1718
|
+
}, null, 8, ["modelValue"])
|
|
1719
|
+
])
|
|
1720
|
+
]),
|
|
1721
|
+
r("div", mn, [
|
|
1722
|
+
r("div", null, B(t(u)("setting.modelSpace")), 1),
|
|
1723
|
+
r("div", null, [
|
|
1724
|
+
z(F, {
|
|
1725
|
+
modelValue: H.value,
|
|
1726
|
+
"onUpdate:modelValue": l[30] || (l[30] = (o) => H.value = o),
|
|
1727
|
+
size: "small",
|
|
1728
|
+
onChange: l[31] || (l[31] = (o) => K())
|
|
1729
|
+
}, null, 8, ["modelValue"])
|
|
1730
|
+
])
|
|
1731
|
+
]),
|
|
1732
|
+
r("div", fn, [
|
|
1733
|
+
r("div", null, B(t(u)("setting.spaceEffect")), 1),
|
|
1734
|
+
r("div", null, [
|
|
1735
|
+
z(F, {
|
|
1736
|
+
modelValue: W.value,
|
|
1737
|
+
"onUpdate:modelValue": l[32] || (l[32] = (o) => W.value = o),
|
|
1738
|
+
size: "small",
|
|
1739
|
+
onChange: l[33] || (l[33] = (o) => w())
|
|
1740
|
+
}, null, 8, ["modelValue"])
|
|
1741
|
+
])
|
|
1742
|
+
]),
|
|
1743
|
+
r("div", gn, [
|
|
1744
|
+
r("div", null, B(t(u)("setting.lightIntensity")), 1),
|
|
1745
|
+
r("div", bn, [
|
|
1746
|
+
z(ge, {
|
|
1747
|
+
modelValue: V.value,
|
|
1748
|
+
"onUpdate:modelValue": l[34] || (l[34] = (o) => V.value = o),
|
|
1749
|
+
onInput: l[35] || (l[35] = (o) => de(V.value))
|
|
1750
|
+
}, null, 8, ["modelValue"])
|
|
1751
|
+
])
|
|
1752
|
+
]),
|
|
1753
|
+
r("div", hn, [
|
|
1754
|
+
r("div", null, B(t(u)("setting.zoomSpeed")), 1),
|
|
1755
|
+
r("div", yn, [
|
|
1756
|
+
z(ge, {
|
|
1757
|
+
modelValue: X.value,
|
|
1758
|
+
"onUpdate:modelValue": l[36] || (l[36] = (o) => X.value = o),
|
|
1759
|
+
onInput: l[37] || (l[37] = (o) => ne(X.value))
|
|
1760
|
+
}, null, 8, ["modelValue"])
|
|
1761
|
+
])
|
|
1762
|
+
]),
|
|
1763
|
+
r("div", Vn, [
|
|
1764
|
+
r("div", {
|
|
1765
|
+
title: t(u)("setting.perfModeTip")
|
|
1766
|
+
}, B(t(u)("setting.perfMode")), 9, pn),
|
|
1767
|
+
r("div", null, [
|
|
1768
|
+
z(F, {
|
|
1769
|
+
modelValue: ee.value,
|
|
1770
|
+
"onUpdate:modelValue": l[38] || (l[38] = (o) => ee.value = o),
|
|
1771
|
+
size: "small",
|
|
1772
|
+
onChange: l[39] || (l[39] = (o) => U())
|
|
1773
|
+
}, null, 8, ["modelValue"])
|
|
1774
|
+
])
|
|
1775
|
+
])
|
|
1776
|
+
]),
|
|
1777
|
+
_: 1
|
|
1778
|
+
})
|
|
1779
|
+
])
|
|
1780
|
+
])) : Y("", !0)
|
|
1781
|
+
], 64);
|
|
1782
|
+
};
|
|
1783
|
+
}
|
|
1784
|
+
}), In = /* @__PURE__ */ Lt(wn, [["__scopeId", "data-v-4eeff572"]]);
|
|
1785
|
+
export {
|
|
1786
|
+
In as default
|
|
1787
|
+
};
|