@xto/form 1.1.7 → 1.1.9

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 (3) hide show
  1. package/es/index.mjs +1269 -1252
  2. package/lib/index.cjs +1 -1
  3. package/package.json +1 -1
package/es/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as J, ref as E, useSlots as He, computed as y, openBlock as r, createElementBlock as d, normalizeClass as u, unref as s, renderSlot as ae, createElementVNode as i, toDisplayString as z, createCommentVNode as O, withDirectives as ue, vModelDynamic as Ne, watch as ce, normalizeStyle as ne, vModelText as be, inject as De, withModifiers as oe, createTextVNode as me, provide as $e, toRef as Ue, onMounted as xe, onUnmounted as we, Fragment as G, renderList as Q, createBlock as ge, Teleport as Ie, createVNode as Ce, Transition as Le, withCtx as Pe, vModelSelect as ke, vShow as Ae, nextTick as Se } from "vue";
1
+ import { defineComponent as J, ref as E, useSlots as He, computed as b, watch as ie, openBlock as r, createElementBlock as d, normalizeClass as u, unref as s, renderSlot as ae, createElementVNode as i, toDisplayString as z, createCommentVNode as U, withDirectives as ue, vModelDynamic as Ne, normalizeStyle as ne, vModelText as be, inject as De, withModifiers as oe, createTextVNode as me, provide as $e, toRef as Ue, onMounted as xe, onUnmounted as we, Fragment as j, renderList as Q, createBlock as ge, Teleport as Ie, createVNode as Ce, Transition as Le, withCtx as Pe, vModelSelect as ke, vShow as Ae, nextTick as Se } from "vue";
2
2
  import { useNamespace as _, useZIndex as Ye } from "@xto/core";
3
3
  const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minlength"], Sl = /* @__PURE__ */ J({
4
4
  name: "XInput",
@@ -20,94 +20,103 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
20
20
  suffixIcon: {}
21
21
  },
22
22
  emits: ["update:modelValue", "update:value", "input", "change", "focus", "blur", "clear"],
23
- setup(n, { expose: b, emit: t }) {
24
- const e = n, a = t, l = _("input"), m = E(), p = E(!1), C = E(!1), x = He(), Y = y(
23
+ setup(n, { expose: y, emit: t }) {
24
+ const e = n, a = t, l = _("input"), m = E(), h = E(!1), w = E(!1), V = He(), F = b(
25
25
  () => e.type === "password" && e.showPassword && !e.disabled
26
- ), S = y(() => Y.value ? C.value ? "text" : "password" : e.type), V = y({
27
- get: () => e.modelValue !== void 0 ? e.modelValue : e.value !== void 0 ? e.value : "",
28
- set: (k) => {
29
- e.modelValue !== void 0 && a("update:modelValue", k), e.value !== void 0 && a("update:value", k), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", k), a("input", k);
30
- }
31
- }), $ = y(() => String(V.value).length), L = y(() => [
26
+ ), $ = b(() => F.value ? w.value ? "text" : "password" : e.type);
27
+ b(() => e.modelValue !== void 0), b(() => e.value !== void 0);
28
+ const k = E("");
29
+ ie(
30
+ [() => e.modelValue, () => e.value],
31
+ ([O, N]) => {
32
+ const q = O ?? N ?? "";
33
+ q !== k.value && (k.value = q);
34
+ },
35
+ { immediate: !0 }
36
+ );
37
+ const D = (O) => {
38
+ k.value = O, a("update:modelValue", O), a("update:value", O), a("input", O);
39
+ }, A = b(() => String(k.value).length), f = b(() => [
32
40
  l.b(),
33
41
  e.size !== "default" ? l.m(e.size) : "",
34
42
  l.is("disabled", e.disabled),
35
- l.is("focus", p.value),
36
- l.is("has-prefix", e.prefixIcon || x.prefix),
37
- l.is("has-suffix", e.suffixIcon || x.suffix || e.clearable || Y.value || e.showWordLimit)
38
- ]), v = (k) => {
39
- const W = k.target.value;
40
- a("change", W);
41
- }, D = (k) => {
42
- p.value = !0, a("focus", k);
43
- }, R = (k) => {
44
- p.value = !1, a("blur", k);
43
+ l.is("focus", h.value),
44
+ l.is("has-prefix", e.prefixIcon || V.prefix),
45
+ l.is("has-suffix", e.suffixIcon || V.suffix || e.clearable || F.value || e.showWordLimit)
46
+ ]), C = (O) => {
47
+ const N = O.target.value;
48
+ a("change", N);
49
+ }, R = (O) => {
50
+ h.value = !0, a("focus", O);
51
+ }, L = (O) => {
52
+ h.value = !1, a("blur", O);
45
53
  }, M = () => {
46
- e.modelValue !== void 0 && a("update:modelValue", ""), e.value !== void 0 && a("update:value", ""), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", ""), a("clear");
47
- }, P = () => {
48
- C.value = !C.value;
54
+ k.value = "", a("update:modelValue", ""), a("update:value", ""), a("clear");
55
+ }, p = () => {
56
+ w.value = !w.value;
49
57
  };
50
- return b({
58
+ return y({
51
59
  focus: () => {
52
- var k;
53
- (k = m.value) == null || k.focus();
60
+ var O;
61
+ (O = m.value) == null || O.focus();
54
62
  },
55
63
  blur: () => {
56
- var k;
57
- (k = m.value) == null || k.blur();
64
+ var O;
65
+ (O = m.value) == null || O.blur();
58
66
  },
59
67
  inputRef: m
60
- }), (k, W) => (r(), d("div", {
61
- class: u(L.value)
68
+ }), (O, N) => (r(), d("div", {
69
+ class: u(f.value)
62
70
  }, [
63
- k.$slots.prefix || n.prefixIcon ? (r(), d("span", {
71
+ O.$slots.prefix || n.prefixIcon ? (r(), d("span", {
64
72
  key: 0,
65
73
  class: u(s(l).e("prefix"))
66
74
  }, [
67
- ae(k.$slots, "prefix", {}, () => [
75
+ ae(O.$slots, "prefix", {}, () => [
68
76
  i("span", {
69
77
  class: u(s(l).e("icon"))
70
78
  }, z(n.prefixIcon), 3)
71
79
  ])
72
- ], 2)) : O("", !0),
80
+ ], 2)) : U("", !0),
73
81
  ue(i("input", {
74
82
  ref_key: "inputRef",
75
83
  ref: m,
76
- "onUpdate:modelValue": W[0] || (W[0] = (X) => V.value = X),
77
- type: S.value,
84
+ "onUpdate:modelValue": N[0] || (N[0] = (q) => k.value = q),
85
+ type: $.value,
78
86
  placeholder: n.placeholder,
79
87
  disabled: n.disabled,
80
88
  readonly: n.readonly,
81
89
  maxlength: n.maxlength,
82
90
  minlength: n.minlength,
83
91
  class: u(s(l).e("inner")),
84
- onChange: v,
85
- onFocus: D,
86
- onBlur: R
92
+ onInput: N[1] || (N[1] = (q) => D(q.target.value)),
93
+ onChange: C,
94
+ onFocus: R,
95
+ onBlur: L
87
96
  }, null, 42, Xe), [
88
- [Ne, V.value]
97
+ [Ne, k.value]
89
98
  ]),
90
- k.$slots.suffix || n.suffixIcon || n.clearable || Y.value || n.showWordLimit ? (r(), d("span", {
99
+ O.$slots.suffix || n.suffixIcon || n.clearable || F.value || n.showWordLimit ? (r(), d("span", {
91
100
  key: 1,
92
101
  class: u(s(l).e("suffix"))
93
102
  }, [
94
- ae(k.$slots, "suffix", {}, () => [
95
- n.clearable && V.value && !n.disabled ? (r(), d("span", {
103
+ ae(O.$slots, "suffix", {}, () => [
104
+ n.clearable && n.value && !n.disabled ? (r(), d("span", {
96
105
  key: 0,
97
106
  class: u([s(l).e("icon"), s(l).e("clear")]),
98
107
  onClick: M
99
- }, " ✕ ", 2)) : O("", !0),
100
- Y.value ? (r(), d("span", {
108
+ }, " ✕ ", 2)) : U("", !0),
109
+ F.value ? (r(), d("span", {
101
110
  key: 1,
102
111
  class: u([s(l).e("icon"), s(l).e("password")]),
103
- onClick: P
104
- }, z(C.value ? "🙈" : "👁️"), 3)) : O("", !0),
112
+ onClick: p
113
+ }, z(w.value ? "🙈" : "👁️"), 3)) : U("", !0),
105
114
  n.showWordLimit && n.maxlength ? (r(), d("span", {
106
115
  key: 2,
107
116
  class: u(s(l).e("count"))
108
- }, z($.value) + "/" + z(n.maxlength), 3)) : O("", !0)
117
+ }, z(A.value) + "/" + z(n.maxlength), 3)) : U("", !0)
109
118
  ])
110
- ], 2)) : O("", !0)
119
+ ], 2)) : U("", !0)
111
120
  ], 2));
112
121
  }
113
122
  }), Ke = ["disabled"], We = ["value", "placeholder", "disabled"], qe = ["disabled"], Ml = /* @__PURE__ */ J({
@@ -129,90 +138,90 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
129
138
  valueOnClear: { default: null }
130
139
  },
131
140
  emits: ["update:modelValue", "update:value", "change", "focus", "blur"],
132
- setup(n, { expose: b, emit: t }) {
133
- const e = n, a = t, l = _("input-number"), m = E(), p = E(!1), C = E(null), x = E(e.modelValue), Y = y(() => {
141
+ setup(n, { expose: y, emit: t }) {
142
+ const e = n, a = t, l = _("input-number"), m = E(), h = E(!1), w = E(null), V = E(e.modelValue), F = b(() => {
134
143
  if (e.precision !== void 0)
135
144
  return e.precision;
136
- const o = S(e.step), c = e.modelValue !== void 0 && e.modelValue !== null ? S(e.modelValue) : 0;
145
+ const o = $(e.step), c = e.modelValue !== void 0 && e.modelValue !== null ? $(e.modelValue) : 0;
137
146
  return Math.max(o, c);
138
147
  });
139
- function S(o) {
148
+ function $(o) {
140
149
  if (o == null) return 0;
141
150
  const c = o.toString(), g = c.indexOf(".");
142
151
  return g === -1 ? 0 : c.length - g - 1;
143
152
  }
144
- function V(o, c = Y.value) {
153
+ function k(o, c = F.value) {
145
154
  if (c === 0) return Math.round(o);
146
155
  let g = o.toFixed(c);
147
156
  return Number(g);
148
157
  }
149
- function $(o) {
158
+ function D(o) {
150
159
  return o > e.max ? e.max : o < e.min ? e.min : o;
151
160
  }
152
- const L = y(() => e.modelValue ?? e.value ?? void 0), v = y(() => C.value !== null ? C.value : L.value === void 0 || L.value === null ? "" : V(L.value)), D = y(() => e.disabled ? !0 : L.value === void 0 ? e.min !== -1 / 0 : L.value <= e.min), R = y(() => e.disabled ? !0 : L.value === void 0 ? e.max !== 1 / 0 : L.value >= e.max), M = y(() => [
161
+ const A = b(() => e.modelValue ?? e.value ?? void 0), f = b(() => w.value !== null ? w.value : A.value === void 0 || A.value === null ? "" : k(A.value)), C = b(() => e.disabled ? !0 : A.value === void 0 ? e.min !== -1 / 0 : A.value <= e.min), R = b(() => e.disabled ? !0 : A.value === void 0 ? e.max !== 1 / 0 : A.value >= e.max), L = b(() => [
153
162
  l.b(),
154
163
  e.size !== "default" ? l.m(e.size) : "",
155
164
  l.is("disabled", e.disabled),
156
- l.is("focus", p.value),
165
+ l.is("focus", h.value),
157
166
  e.controlsPosition ? l.m(e.controlsPosition) : ""
158
167
  ]);
159
- function P() {
168
+ function M() {
160
169
  if (e.disabled || R.value) return;
161
- const o = L.value ?? (e.min === -1 / 0 ? 0 : e.min), c = V(o + e.step), g = $(c);
162
- f(g);
170
+ const o = A.value ?? (e.min === -1 / 0 ? 0 : e.min), c = k(o + e.step), g = D(c);
171
+ v(g);
163
172
  }
164
- function h() {
165
- if (e.disabled || D.value) return;
166
- const o = L.value ?? (e.min === -1 / 0 ? 0 : e.min), c = V(o - e.step), g = $(c);
167
- f(g);
173
+ function p() {
174
+ if (e.disabled || C.value) return;
175
+ const o = A.value ?? (e.min === -1 / 0 ? 0 : e.min), c = k(o - e.step), g = D(c);
176
+ v(g);
168
177
  }
169
- function f(o) {
170
- const c = x.value;
178
+ function v(o) {
179
+ const c = V.value;
171
180
  if (o === void 0)
172
181
  e.modelValue !== void 0 && a("update:modelValue", void 0), e.value !== void 0 && a("update:value", void 0), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", void 0), a("change", void 0, c);
173
182
  else {
174
- const g = V(o), K = $(g);
183
+ const g = k(o), W = D(g);
175
184
  if (e.stepStrictly) {
176
- const le = Math.round((K - e.min) / e.step), H = V(e.min + le * e.step);
185
+ const le = Math.round((W - e.min) / e.step), H = k(e.min + le * e.step);
177
186
  e.modelValue !== void 0 && a("update:modelValue", H), e.value !== void 0 && a("update:value", H), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", H), a("change", H, c);
178
187
  } else
179
- e.modelValue !== void 0 && a("update:modelValue", K), e.value !== void 0 && a("update:value", K), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", K), a("change", K, c);
188
+ e.modelValue !== void 0 && a("update:modelValue", W), e.value !== void 0 && a("update:value", W), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", W), a("change", W, c);
180
189
  }
181
- x.value = e.modelValue ?? e.value, C.value = null;
190
+ V.value = e.modelValue ?? e.value, w.value = null;
182
191
  }
183
- function k(o) {
192
+ function S(o) {
184
193
  if (o === "" || o === "-")
185
194
  return;
186
195
  let c = o.replace(/[^\d.-]/g, "");
187
196
  const g = c.split(".");
188
197
  g.length > 2 && (c = g[0] + "." + g.slice(1).join("")), c.indexOf("-") > 0 && (c = c.replace(/-/g, "")), c.lastIndexOf("-") > 0 && (c = "-" + c.replace(/-/g, ""));
189
- const K = Number(c);
190
- if (!isNaN(K))
191
- return K;
198
+ const W = Number(c);
199
+ if (!isNaN(W))
200
+ return W;
192
201
  }
193
- function W(o) {
202
+ function O(o) {
194
203
  const c = o.target.value;
195
- C.value = c;
204
+ w.value = c;
196
205
  }
197
- function X(o) {
198
- if (p.value = !1, C.value !== null) {
199
- const c = k(C.value);
200
- c === void 0 ? e.valueOnClear !== null ? f(e.valueOnClear) : C.value = null : f(c);
206
+ function N(o) {
207
+ if (h.value = !1, w.value !== null) {
208
+ const c = S(w.value);
209
+ c === void 0 ? e.valueOnClear !== null ? v(e.valueOnClear) : w.value = null : v(c);
201
210
  }
202
211
  a("blur", o);
203
212
  }
204
- function Z(o) {
205
- p.value = !0, x.value = e.modelValue, a("focus", o);
213
+ function q(o) {
214
+ h.value = !0, V.value = e.modelValue, a("focus", o);
206
215
  }
207
216
  function ee(o) {
208
217
  var c;
209
218
  if (!e.disabled)
210
219
  switch (o.key) {
211
220
  case "ArrowUp":
212
- o.preventDefault(), P();
221
+ o.preventDefault(), M();
213
222
  break;
214
223
  case "ArrowDown":
215
- o.preventDefault(), h();
224
+ o.preventDefault(), p();
216
225
  break;
217
226
  case "Enter":
218
227
  (c = m.value) == null || c.blur();
@@ -220,49 +229,49 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
220
229
  }
221
230
  }
222
231
  function T() {
223
- C.value = null, e.valueOnClear !== null && e.valueOnClear !== void 0 ? f(e.valueOnClear) : (e.modelValue !== void 0 && a("update:modelValue", void 0), e.value !== void 0 && a("update:value", void 0), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", void 0), a("change", void 0, x.value), x.value = void 0);
232
+ w.value = null, e.valueOnClear !== null && e.valueOnClear !== void 0 ? v(e.valueOnClear) : (e.modelValue !== void 0 && a("update:modelValue", void 0), e.value !== void 0 && a("update:value", void 0), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", void 0), a("change", void 0, V.value), V.value = void 0);
224
233
  }
225
234
  function B() {
226
235
  var o;
227
236
  (o = m.value) == null || o.focus();
228
237
  }
229
- function w() {
238
+ function x() {
230
239
  var o;
231
240
  (o = m.value) == null || o.blur();
232
241
  }
233
- return ce([() => e.modelValue, () => e.value], ([o, c]) => {
234
- x.value = o ?? c, C.value = null;
235
- }, { immediate: !0 }), b({
242
+ return ie([() => e.modelValue, () => e.value], ([o, c]) => {
243
+ V.value = o ?? c, w.value = null;
244
+ }, { immediate: !0 }), y({
236
245
  focus: B,
237
- blur: w,
246
+ blur: x,
238
247
  clear: T,
239
- increase: P,
240
- decrease: h
248
+ increase: M,
249
+ decrease: p
241
250
  }), (o, c) => (r(), d("div", {
242
- class: u(M.value)
251
+ class: u(L.value)
243
252
  }, [
244
253
  n.controls ? (r(), d("button", {
245
254
  key: 0,
246
255
  type: "button",
247
- class: u([s(l).e("decrease"), s(l).is("disabled", D.value)]),
248
- disabled: D.value,
249
- onClick: h
250
- }, " − ", 10, Ke)) : O("", !0),
256
+ class: u([s(l).e("decrease"), s(l).is("disabled", C.value)]),
257
+ disabled: C.value,
258
+ onClick: p
259
+ }, " − ", 10, Ke)) : U("", !0),
251
260
  i("div", {
252
261
  class: u(s(l).e("wrapper"))
253
262
  }, [
254
263
  i("input", {
255
264
  ref_key: "inputRef",
256
265
  ref: m,
257
- value: v.value,
266
+ value: f.value,
258
267
  placeholder: n.placeholder,
259
268
  disabled: n.disabled,
260
269
  class: u(s(l).e("inner")),
261
270
  type: "text",
262
271
  autocomplete: "off",
263
- onInput: W,
264
- onFocus: Z,
265
- onBlur: X,
272
+ onInput: O,
273
+ onFocus: q,
274
+ onBlur: N,
266
275
  onKeydown: ee
267
276
  }, null, 42, We)
268
277
  ], 2),
@@ -271,8 +280,8 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
271
280
  type: "button",
272
281
  class: u([s(l).e("increase"), s(l).is("disabled", R.value)]),
273
282
  disabled: R.value,
274
- onClick: P
275
- }, " + ", 10, qe)) : O("", !0)
283
+ onClick: M
284
+ }, " + ", 10, qe)) : U("", !0)
276
285
  ], 2));
277
286
  }
278
287
  }), Ge = ["placeholder", "disabled", "readonly", "maxlength", "minlength", "rows"], Tl = /* @__PURE__ */ J({
@@ -292,35 +301,42 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
292
301
  resize: { default: "vertical" }
293
302
  },
294
303
  emits: ["update:modelValue", "update:value", "input", "change", "focus", "blur"],
295
- setup(n, { expose: b, emit: t }) {
296
- const e = n, a = t, l = _("textarea"), m = E(), p = E(!1), C = y({
297
- get: () => e.modelValue !== void 0 ? e.modelValue : e.value !== void 0 ? e.value : "",
298
- set: (M) => {
299
- e.modelValue !== void 0 && a("update:modelValue", M), e.value !== void 0 && a("update:value", M), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", M), a("input", M);
300
- }
301
- }), x = y(() => String(C.value).length), Y = y(() => {
304
+ setup(n, { expose: y, emit: t }) {
305
+ const e = n, a = t, l = _("textarea"), m = E(), h = E(!1), w = E("");
306
+ ie(
307
+ [() => e.modelValue, () => e.value],
308
+ ([M, p]) => {
309
+ const v = M ?? p ?? "";
310
+ v !== w.value && (w.value = v);
311
+ },
312
+ { immediate: !0 }
313
+ );
314
+ const V = (M) => {
315
+ w.value = M, a("update:modelValue", M), a("update:value", M), a("input", M);
316
+ }, F = b(() => String(w.value).length), $ = b(() => {
302
317
  const M = {};
303
318
  if (e.resize && (M.resize = e.resize), e.autosize && (M.minHeight = "auto", typeof e.autosize == "object")) {
304
- const P = e.autosize.minRows || 1, h = e.autosize.maxRows;
305
- M.minHeight = `${P * 22 + 12}px`, h && (M.maxHeight = `${h * 22 + 12}px`);
319
+ const p = e.autosize.minRows || 1, v = e.autosize.maxRows;
320
+ M.minHeight = `${p * 22 + 12}px`, v && (M.maxHeight = `${v * 22 + 12}px`);
306
321
  }
307
322
  return M;
308
- }), S = y(() => [
323
+ }), k = b(() => [
309
324
  l.b(),
310
325
  l.is("disabled", e.disabled),
311
- l.is("focus", p.value),
312
- l.is("exceed", e.maxlength && x.value > e.maxlength)
313
- ]), V = () => {
314
- e.autosize && m.value && (m.value.style.height = "auto", m.value.style.height = `${m.value.scrollHeight}px`);
315
- }, $ = (M) => {
316
- const P = M.target.value;
317
- a("change", P);
318
- }, L = (M) => {
319
- p.value = !0, a("focus", M);
320
- }, v = (M) => {
321
- p.value = !1, a("blur", M);
326
+ l.is("focus", h.value),
327
+ l.is("exceed", e.maxlength && F.value > e.maxlength)
328
+ ]), D = (M) => {
329
+ const p = M.target.value;
330
+ V(p), e.autosize && m.value && (m.value.style.height = "auto", m.value.style.height = `${m.value.scrollHeight}px`);
331
+ }, A = (M) => {
332
+ const p = M.target.value;
333
+ a("change", p);
334
+ }, f = (M) => {
335
+ h.value = !0, a("focus", M);
336
+ }, C = (M) => {
337
+ h.value = !1, a("blur", M);
322
338
  };
323
- return b({
339
+ return y({
324
340
  focus: () => {
325
341
  var M;
326
342
  (M = m.value) == null || M.focus();
@@ -330,40 +346,41 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
330
346
  (M = m.value) == null || M.blur();
331
347
  },
332
348
  textareaRef: m
333
- }), (M, P) => (r(), d("div", {
334
- class: u(S.value),
349
+ }), (M, p) => (r(), d("div", {
350
+ class: u(k.value),
335
351
  style: ne(n.disabled ? void 0 : { cursor: "text" })
336
352
  }, [
337
353
  ue(i("textarea", {
338
354
  ref_key: "textareaRef",
339
355
  ref: m,
340
- "onUpdate:modelValue": P[0] || (P[0] = (h) => C.value = h),
356
+ "onUpdate:modelValue": p[0] || (p[0] = (v) => w.value = v),
341
357
  placeholder: n.placeholder,
342
358
  disabled: n.disabled,
343
359
  readonly: n.readonly,
344
360
  maxlength: n.maxlength,
345
361
  minlength: n.minlength,
346
362
  rows: n.rows,
347
- style: ne(Y.value),
363
+ style: ne($.value),
348
364
  class: u(s(l).e("inner")),
349
- onInput: V,
350
- onChange: $,
351
- onFocus: L,
352
- onBlur: v
365
+ onInput: D,
366
+ onChange: A,
367
+ onFocus: f,
368
+ onBlur: C
353
369
  }, null, 46, Ge), [
354
- [be, C.value]
370
+ [be, w.value]
355
371
  ]),
356
372
  n.showWordLimit && n.maxlength ? (r(), d("span", {
357
373
  key: 0,
358
374
  class: u(s(l).e("count"))
359
- }, z(x.value) + "/" + z(n.maxlength), 3)) : O("", !0)
375
+ }, z(F.value) + "/" + z(n.maxlength), 3)) : U("", !0)
360
376
  ], 6));
361
377
  }
362
378
  }), Rl = /* @__PURE__ */ J({
363
379
  name: "XSwitch",
364
380
  __name: "index",
365
381
  props: {
366
- modelValue: { type: [Boolean, Number, String], default: !1 },
382
+ modelValue: { type: [Boolean, Number, String], default: void 0 },
383
+ checked: { type: [Boolean, Number, String], default: void 0 },
367
384
  disabled: { type: Boolean, default: !1 },
368
385
  width: { default: 40 },
369
386
  activeColor: { default: "#409eff" },
@@ -371,35 +388,35 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
371
388
  activeValue: { type: [Boolean, Number, String], default: !0 },
372
389
  inactiveValue: { type: [Boolean, Number, String], default: !1 }
373
390
  },
374
- emits: ["update:modelValue", "change"],
375
- setup(n, { emit: b }) {
376
- const t = n, e = b, a = _("switch"), l = y(() => t.modelValue === t.activeValue), m = y(() => [
391
+ emits: ["update:modelValue", "update:checked", "change"],
392
+ setup(n, { emit: y }) {
393
+ const t = n, e = y, a = _("switch"), l = b(() => t.modelValue !== void 0 ? t.modelValue : t.checked !== void 0 ? t.checked : !1), m = b(() => l.value === t.activeValue), h = b(() => [
377
394
  a.b(),
378
395
  a.is("disabled", t.disabled),
379
- a.is("checked", l.value)
380
- ]), p = y(() => ({
396
+ a.is("checked", m.value)
397
+ ]), w = b(() => ({
381
398
  width: typeof t.width == "number" ? `${t.width}px` : t.width,
382
399
  height: "20px",
383
- backgroundColor: l.value ? t.activeColor : t.inactiveColor
384
- })), C = () => {
400
+ backgroundColor: m.value ? t.activeColor : t.inactiveColor
401
+ })), V = () => {
385
402
  if (t.disabled) return;
386
- const x = l.value ? t.inactiveValue : t.activeValue;
387
- e("update:modelValue", x), e("change", x);
403
+ const F = m.value ? t.inactiveValue : t.activeValue;
404
+ t.modelValue !== void 0 && e("update:modelValue", F), t.checked !== void 0 && e("update:checked", F), t.modelValue === void 0 && t.checked === void 0 && e("update:modelValue", F), e("change", F);
388
405
  };
389
- return (x, Y) => (r(), d("span", {
390
- class: u(m.value),
391
- onClick: C
406
+ return (F, $) => (r(), d("span", {
407
+ class: u(h.value),
408
+ onClick: V
392
409
  }, [
393
410
  i("span", {
394
411
  class: u(s(a).e("core")),
395
- style: ne(p.value)
412
+ style: ne(w.value)
396
413
  }, null, 6),
397
- x.$slots.default ? (r(), d("span", {
414
+ F.$slots.default ? (r(), d("span", {
398
415
  key: 0,
399
416
  class: u(s(a).e("text"))
400
417
  }, [
401
- ae(x.$slots, "default")
402
- ], 2)) : O("", !0)
418
+ ae(F.$slots, "default")
419
+ ], 2)) : U("", !0)
403
420
  ], 2));
404
421
  }
405
422
  }), je = ["checked", "disabled", "name", "value"], Bl = /* @__PURE__ */ J({
@@ -413,37 +430,37 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
413
430
  name: {}
414
431
  },
415
432
  emits: ["update:modelValue", "change"],
416
- setup(n, { emit: b }) {
417
- const t = n, e = b, a = _("radio"), l = De("radioGroup", null), m = y(() => !!l), p = y(() => m.value ? l.modelValue.value : t.modelValue), C = y(() => t.value ?? t.label), x = y(() => p.value === C.value), Y = y(() => t.disabled || m.value && l.disabled), S = y(() => t.name || (m.value ? l.name : void 0)), V = y(() => [
433
+ setup(n, { emit: y }) {
434
+ const t = n, e = y, a = _("radio"), l = De("radioGroup", null), m = b(() => !!l), h = b(() => m.value ? l.modelValue.value : t.modelValue), w = b(() => t.value ?? t.label), V = b(() => h.value === w.value), F = b(() => t.disabled || m.value && l.disabled), $ = b(() => t.name || (m.value ? l.name : void 0)), k = b(() => [
418
435
  a.b(),
419
- a.is("checked", x.value),
420
- a.is("disabled", Y.value)
421
- ]), $ = () => {
422
- Y.value || (m.value ? l.changeValue(C.value) : (e("update:modelValue", C.value), e("change", C.value)));
436
+ a.is("checked", V.value),
437
+ a.is("disabled", F.value)
438
+ ]), D = () => {
439
+ F.value || (m.value ? l.changeValue(w.value) : (e("update:modelValue", w.value), e("change", w.value)));
423
440
  };
424
- return (L, v) => (r(), d("label", {
425
- class: u(V.value),
426
- onClick: oe($, ["prevent"])
441
+ return (A, f) => (r(), d("label", {
442
+ class: u(k.value),
443
+ onClick: oe(D, ["prevent"])
427
444
  }, [
428
445
  i("span", {
429
446
  class: u(s(a).e("input"))
430
447
  }, [
431
448
  i("input", {
432
449
  type: "radio",
433
- checked: x.value,
434
- disabled: Y.value,
435
- name: S.value,
436
- value: C.value
450
+ checked: V.value,
451
+ disabled: F.value,
452
+ name: $.value,
453
+ value: w.value
437
454
  }, null, 8, je)
438
455
  ], 2),
439
- L.$slots.default || n.label ? (r(), d("span", {
456
+ A.$slots.default || n.label ? (r(), d("span", {
440
457
  key: 0,
441
458
  class: u(s(a).e("label"))
442
459
  }, [
443
- ae(L.$slots, "default", {}, () => [
460
+ ae(A.$slots, "default", {}, () => [
444
461
  me(z(n.label), 1)
445
462
  ])
446
- ], 2)) : O("", !0)
463
+ ], 2)) : U("", !0)
447
464
  ], 2));
448
465
  }
449
466
  }), Fl = /* @__PURE__ */ J({
@@ -456,16 +473,16 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
456
473
  name: {}
457
474
  },
458
475
  emits: ["update:modelValue", "update:value", "change"],
459
- setup(n, { emit: b }) {
460
- const t = n, e = b, a = _("radio-group"), l = (m) => {
476
+ setup(n, { emit: y }) {
477
+ const t = n, e = y, a = _("radio-group"), l = (m) => {
461
478
  t.modelValue !== void 0 && e("update:modelValue", m), t.value !== void 0 && e("update:value", m), t.modelValue === void 0 && t.value === void 0 && e("update:modelValue", m), e("change", m);
462
479
  };
463
480
  return $e("radioGroup", {
464
- modelValue: y(() => t.modelValue ?? t.value),
481
+ modelValue: b(() => t.modelValue ?? t.value),
465
482
  name: t.name || `radio-group-${Date.now()}`,
466
483
  disabled: t.disabled,
467
484
  changeValue: l
468
- }), (m, p) => (r(), d("div", {
485
+ }), (m, h) => (r(), d("div", {
469
486
  class: u(s(a).b()),
470
487
  role: "radiogroup"
471
488
  }, [
@@ -482,29 +499,29 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
482
499
  name: {}
483
500
  },
484
501
  emits: ["update:modelValue", "change"],
485
- setup(n, { emit: b }) {
486
- const t = n, e = _("radio-button"), a = De("radioGroup", null), l = y(() => !!a), m = y(() => l.value ? a.modelValue.value : null), p = y(() => t.value ?? t.label), C = y(() => m.value === p.value), x = y(() => t.disabled || l.value && a.disabled), Y = y(() => [
502
+ setup(n, { emit: y }) {
503
+ const t = n, e = _("radio-button"), a = De("radioGroup", null), l = b(() => !!a), m = b(() => l.value ? a.modelValue.value : null), h = b(() => t.value ?? t.label), w = b(() => m.value === h.value), V = b(() => t.disabled || l.value && a.disabled), F = b(() => [
487
504
  e.b(),
488
- e.is("active", C.value),
489
- e.is("disabled", x.value)
490
- ]), S = () => {
491
- x.value || l.value && a.changeValue(p.value);
505
+ e.is("active", w.value),
506
+ e.is("disabled", V.value)
507
+ ]), $ = () => {
508
+ V.value || l.value && a.changeValue(h.value);
492
509
  };
493
- return (V, $) => (r(), d("label", {
494
- class: u(Y.value),
495
- onClick: oe(S, ["prevent"])
510
+ return (k, D) => (r(), d("label", {
511
+ class: u(F.value),
512
+ onClick: oe($, ["prevent"])
496
513
  }, [
497
514
  i("input", {
498
515
  type: "radio",
499
- checked: C.value,
500
- disabled: x.value,
501
- value: p.value,
516
+ checked: w.value,
517
+ disabled: V.value,
518
+ value: h.value,
502
519
  class: u(s(e).e("input"))
503
520
  }, null, 10, Ze),
504
521
  i("span", {
505
522
  class: u(s(e).e("inner"))
506
523
  }, [
507
- ae(V.$slots, "default", {}, () => [
524
+ ae(k.$slots, "default", {}, () => [
508
525
  me(z(n.label), 1)
509
526
  ])
510
527
  ], 2)
@@ -522,56 +539,56 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
522
539
  indeterminate: { type: Boolean }
523
540
  },
524
541
  emits: ["update:modelValue", "change"],
525
- setup(n, { emit: b }) {
526
- const t = n, e = b, a = _("checkbox"), l = De("checkboxGroup", null), m = y(() => !!l), p = y(() => t.value ?? t.label), C = y(() => m.value ? l.modelValue.value.includes(p.value) : Array.isArray(t.modelValue) ? t.modelValue.includes(p.value) : !!t.modelValue), x = y(() => {
542
+ setup(n, { emit: y }) {
543
+ const t = n, e = y, a = _("checkbox"), l = De("checkboxGroup", null), m = b(() => !!l), h = b(() => t.value ?? t.label), w = b(() => m.value ? l.modelValue.value.includes(h.value) : Array.isArray(t.modelValue) ? t.modelValue.includes(h.value) : !!t.modelValue), V = b(() => {
527
544
  if (t.disabled) return !0;
528
545
  if (m.value) {
529
- const V = l.disabled, $ = l.min > 0 && l.modelValue.value.length <= l.min, L = l.max > 0 && l.modelValue.value.length >= l.max;
530
- return C.value && $ || !C.value && L ? !0 : V;
546
+ const k = l.disabled, D = l.min > 0 && l.modelValue.value.length <= l.min, A = l.max > 0 && l.modelValue.value.length >= l.max;
547
+ return w.value && D || !w.value && A ? !0 : k;
531
548
  }
532
549
  return !1;
533
- }), Y = y(() => [
550
+ }), F = b(() => [
534
551
  a.b(),
535
- a.is("checked", C.value),
536
- a.is("disabled", x.value),
537
- a.is("indeterminate", t.indeterminate && !C.value)
538
- ]), S = () => {
539
- if (!x.value)
552
+ a.is("checked", w.value),
553
+ a.is("disabled", V.value),
554
+ a.is("indeterminate", t.indeterminate && !w.value)
555
+ ]), $ = () => {
556
+ if (!V.value)
540
557
  if (m.value)
541
- l.changeValue(p.value);
558
+ l.changeValue(h.value);
542
559
  else {
543
- let V;
560
+ let k;
544
561
  if (Array.isArray(t.modelValue)) {
545
- const $ = t.modelValue.indexOf(p.value);
546
- $ > -1 ? V = [...t.modelValue.slice(0, $), ...t.modelValue.slice($ + 1)] : V = [...t.modelValue, p.value];
562
+ const D = t.modelValue.indexOf(h.value);
563
+ D > -1 ? k = [...t.modelValue.slice(0, D), ...t.modelValue.slice(D + 1)] : k = [...t.modelValue, h.value];
547
564
  } else
548
- V = !t.modelValue;
549
- e("update:modelValue", V), e("change", V);
565
+ k = !t.modelValue;
566
+ e("update:modelValue", k), e("change", k);
550
567
  }
551
568
  };
552
- return (V, $) => (r(), d("label", {
553
- class: u(Y.value),
554
- onClick: oe(S, ["prevent"])
569
+ return (k, D) => (r(), d("label", {
570
+ class: u(F.value),
571
+ onClick: oe($, ["prevent"])
555
572
  }, [
556
573
  i("span", {
557
574
  class: u(s(a).e("input"))
558
575
  }, [
559
576
  i("input", {
560
577
  type: "checkbox",
561
- checked: C.value,
562
- disabled: x.value,
578
+ checked: w.value,
579
+ disabled: V.value,
563
580
  name: n.name,
564
- value: p.value
581
+ value: h.value
565
582
  }, null, 8, Qe)
566
583
  ], 2),
567
- V.$slots.default || n.label !== void 0 ? (r(), d("span", {
584
+ k.$slots.default || n.label !== void 0 ? (r(), d("span", {
568
585
  key: 0,
569
586
  class: u(s(a).e("label"))
570
587
  }, [
571
- ae(V.$slots, "default", {}, () => [
588
+ ae(k.$slots, "default", {}, () => [
572
589
  me(z(n.label), 1)
573
590
  ])
574
- ], 2)) : O("", !0)
591
+ ], 2)) : U("", !0)
575
592
  ], 2));
576
593
  }
577
594
  }), Pl = /* @__PURE__ */ J({
@@ -584,18 +601,18 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
584
601
  max: { default: 0 }
585
602
  },
586
603
  emits: ["update:modelValue", "change"],
587
- setup(n, { emit: b }) {
588
- const t = n, e = b, a = _("checkbox-group"), l = (m) => {
589
- const p = [...t.modelValue], C = p.indexOf(m);
590
- C > -1 ? p.splice(C, 1) : p.push(m), e("update:modelValue", p), e("change", p);
604
+ setup(n, { emit: y }) {
605
+ const t = n, e = y, a = _("checkbox-group"), l = (m) => {
606
+ const h = [...t.modelValue], w = h.indexOf(m);
607
+ w > -1 ? h.splice(w, 1) : h.push(m), e("update:modelValue", h), e("change", h);
591
608
  };
592
609
  return $e("checkboxGroup", {
593
- modelValue: y(() => t.modelValue),
610
+ modelValue: b(() => t.modelValue),
594
611
  disabled: t.disabled,
595
612
  min: t.min,
596
613
  max: t.max,
597
614
  changeValue: l
598
- }), (m, p) => (r(), d("div", {
615
+ }), (m, h) => (r(), d("div", {
599
616
  class: u(s(a).b()),
600
617
  role: "group"
601
618
  }, [
@@ -616,69 +633,69 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
616
633
  size: { default: "default" }
617
634
  },
618
635
  emits: ["validate", "submit", "reset"],
619
- setup(n, { expose: b, emit: t }) {
620
- const e = n, a = t, l = _("form"), m = E([]), p = y(() => e.layout === "inline" || e.inline), C = y(() => e.layout === "vertical" || e.labelPosition === "top"), x = y(() => [
636
+ setup(n, { expose: y, emit: t }) {
637
+ const e = n, a = t, l = _("form"), m = E([]), h = b(() => e.layout === "inline" || e.inline), w = b(() => e.layout === "vertical" || e.labelPosition === "top"), V = b(() => [
621
638
  l.b(),
622
- l.m(`label-${C.value ? "top" : e.labelPosition}`),
623
- l.is("inline", p.value),
624
- l.is("vertical", C.value)
625
- ]), Y = y(() => ({ width: typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth })), S = (h) => {
626
- m.value.push(h);
627
- }, V = (h) => {
628
- const f = m.value.indexOf(h);
629
- f > -1 && m.value.splice(f, 1);
630
- }, $ = async () => {
631
- let h = !0;
632
- for (const f of m.value)
633
- await f.validate() || (h = !1);
634
- return h;
635
- }, L = async (h) => {
636
- const f = Array.isArray(h) ? h : [h];
637
- let k = !0;
638
- for (const W of m.value)
639
- f.includes(W.prop) && (await W.validate() || (k = !1));
640
- return k;
641
- }, v = () => {
642
- m.value.forEach((h) => {
643
- h.resetField();
639
+ l.m(`label-${w.value ? "top" : e.labelPosition}`),
640
+ l.is("inline", h.value),
641
+ l.is("vertical", w.value)
642
+ ]), F = b(() => ({ width: typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth })), $ = (p) => {
643
+ m.value.push(p);
644
+ }, k = (p) => {
645
+ const v = m.value.indexOf(p);
646
+ v > -1 && m.value.splice(v, 1);
647
+ }, D = async () => {
648
+ let p = !0;
649
+ for (const v of m.value)
650
+ await v.validate() || (p = !1);
651
+ return p;
652
+ }, A = async (p) => {
653
+ const v = Array.isArray(p) ? p : [p];
654
+ let S = !0;
655
+ for (const O of m.value)
656
+ v.includes(O.prop) && (await O.validate() || (S = !1));
657
+ return S;
658
+ }, f = () => {
659
+ m.value.forEach((p) => {
660
+ p.resetField();
644
661
  });
645
- }, D = (h) => {
646
- if (h) {
647
- const f = Array.isArray(h) ? h : [h];
648
- m.value.forEach((k) => {
649
- f.includes(k.prop) && k.clearValidate();
662
+ }, C = (p) => {
663
+ if (p) {
664
+ const v = Array.isArray(p) ? p : [p];
665
+ m.value.forEach((S) => {
666
+ v.includes(S.prop) && S.clearValidate();
650
667
  });
651
668
  } else
652
- m.value.forEach((f) => {
653
- f.clearValidate();
669
+ m.value.forEach((v) => {
670
+ v.clearValidate();
654
671
  });
655
- }, R = (h) => {
656
- console.log("[XForm] handleSubmit triggered", h), h.preventDefault(), a("submit");
657
- }, M = (h) => {
658
- console.log("[XForm] handleReset triggered", h), h.preventDefault(), v(), a("reset");
659
- }, P = Ue(e, "model");
672
+ }, R = (p) => {
673
+ console.log("[XForm] handleSubmit triggered", p), p.preventDefault(), a("submit");
674
+ }, L = (p) => {
675
+ console.log("[XForm] handleReset triggered", p), p.preventDefault(), f(), a("reset");
676
+ }, M = Ue(e, "model");
660
677
  return $e("form", {
661
- model: P,
678
+ model: M,
662
679
  rules: e.rules,
663
680
  labelWidth: e.labelWidth,
664
- labelPosition: C.value ? "top" : e.labelPosition,
681
+ labelPosition: w.value ? "top" : e.labelPosition,
665
682
  disabled: e.disabled,
666
683
  size: e.size,
667
- labelStyle: Y,
668
- addField: S,
669
- removeField: V,
684
+ labelStyle: F,
685
+ addField: $,
686
+ removeField: k,
670
687
  emit: a
671
- }), b({
672
- validate: $,
673
- validateField: L,
674
- resetFields: v,
675
- clearValidate: D
676
- }), (h, f) => (r(), d("form", {
677
- class: u(x.value),
688
+ }), y({
689
+ validate: D,
690
+ validateField: A,
691
+ resetFields: f,
692
+ clearValidate: C
693
+ }), (p, v) => (r(), d("form", {
694
+ class: u(V.value),
678
695
  onSubmit: R,
679
- onReset: M
696
+ onReset: L
680
697
  }, [
681
- ae(h.$slots, "default")
698
+ ae(p.$slots, "default")
682
699
  ], 34));
683
700
  }
684
701
  }), Yl = /* @__PURE__ */ J({
@@ -692,181 +709,181 @@ const Xe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
692
709
  rules: {},
693
710
  showMessage: { type: Boolean }
694
711
  },
695
- setup(n, { expose: b }) {
696
- const t = n, e = _("form-item"), a = De("form", null), l = E(""), m = E(""), p = y(() => t.required ? !0 : C().some((R) => R.required)), C = () => {
697
- const D = [];
698
- return t.rules && D.push(...t.rules), a && t.prop && a.rules[t.prop] && D.push(...a.rules[t.prop]), D;
699
- }, x = () => {
700
- var D;
712
+ setup(n, { expose: y }) {
713
+ const t = n, e = _("form-item"), a = De("form", null), l = E(""), m = E(""), h = b(() => t.required ? !0 : w().some((R) => R.required)), w = () => {
714
+ const C = [];
715
+ return t.rules && C.push(...t.rules), a && t.prop && a.rules[t.prop] && C.push(...a.rules[t.prop]), C;
716
+ }, V = () => {
717
+ var C;
701
718
  if (!(!a || !t.prop))
702
- return (D = a.model.value) == null ? void 0 : D[t.prop];
703
- }, Y = (D) => {
704
- !a || !t.prop || a.model.value && (a.model.value[t.prop] = D);
705
- }, S = async (D) => {
706
- const R = C();
719
+ return (C = a.model.value) == null ? void 0 : C[t.prop];
720
+ }, F = (C) => {
721
+ !a || !t.prop || a.model.value && (a.model.value[t.prop] = C);
722
+ }, $ = async (C) => {
723
+ const R = w();
707
724
  if (R.length === 0)
708
725
  return l.value = "valid", !0;
709
- const M = x();
710
- let P = !0, h = "";
711
- for (const f of R)
712
- if (!(D && f.trigger && f.trigger !== D)) {
713
- if (f.required && (M == null || M === "" || Array.isArray(M) && M.length === 0)) {
714
- P = !1, h = f.message || "该字段为必填项";
726
+ const L = V();
727
+ let M = !0, p = "";
728
+ for (const v of R)
729
+ if (!(C && v.trigger && v.trigger !== C)) {
730
+ if (v.required && (L == null || L === "" || Array.isArray(L) && L.length === 0)) {
731
+ M = !1, p = v.message || "该字段为必填项";
715
732
  break;
716
733
  }
717
- if (f.min !== void 0 || f.max !== void 0) {
718
- const k = typeof M == "string" ? M.length : 0;
719
- if (f.min !== void 0 && k < f.min) {
720
- P = !1, h = f.message || `长度不能小于 ${f.min} 个字符`;
734
+ if (v.min !== void 0 || v.max !== void 0) {
735
+ const S = typeof L == "string" ? L.length : 0;
736
+ if (v.min !== void 0 && S < v.min) {
737
+ M = !1, p = v.message || `长度不能小于 ${v.min} 个字符`;
721
738
  break;
722
739
  }
723
- if (f.max !== void 0 && k > f.max) {
724
- P = !1, h = f.message || `长度不能大于 ${f.max} 个字符`;
740
+ if (v.max !== void 0 && S > v.max) {
741
+ M = !1, p = v.message || `长度不能大于 ${v.max} 个字符`;
725
742
  break;
726
743
  }
727
744
  }
728
- if (f.pattern && M && !f.pattern.test(M)) {
729
- P = !1, h = f.message || "格式不正确";
745
+ if (v.pattern && L && !v.pattern.test(L)) {
746
+ M = !1, p = v.message || "格式不正确";
730
747
  break;
731
748
  }
732
- if (f.validator)
749
+ if (v.validator)
733
750
  try {
734
- await new Promise((k, W) => {
735
- f.validator(f, M, (X) => {
736
- X ? W(X) : k();
751
+ await new Promise((S, O) => {
752
+ v.validator(v, L, (N) => {
753
+ N ? O(N) : S();
737
754
  });
738
755
  });
739
- } catch (k) {
740
- P = !1, h = k.message || f.message || "验证失败";
756
+ } catch (S) {
757
+ M = !1, p = S.message || v.message || "验证失败";
741
758
  break;
742
759
  }
743
760
  }
744
- return l.value = P ? "valid" : "invalid", m.value = h, a && t.prop && a.emit("validate", t.prop, P, h), P;
745
- }, V = () => {
746
- Y(void 0), $();
747
- }, $ = () => {
761
+ return l.value = M ? "valid" : "invalid", m.value = p, a && t.prop && a.emit("validate", t.prop, M, p), M;
762
+ }, k = () => {
763
+ F(void 0), D();
764
+ }, D = () => {
748
765
  l.value = "", m.value = "";
749
- }, L = y(() => [
766
+ }, A = b(() => [
750
767
  e.b(),
751
- e.is("required", p.value),
768
+ e.is("required", h.value),
752
769
  e.is("error", l.value === "invalid"),
753
770
  e.is("success", l.value === "valid")
754
- ]), v = y(() => {
755
- const D = t.labelWidth ?? (a == null ? void 0 : a.labelWidth) ?? "100px";
756
- return { width: typeof D == "number" ? `${D}px` : D };
771
+ ]), f = b(() => {
772
+ const C = t.labelWidth ?? (a == null ? void 0 : a.labelWidth) ?? "100px";
773
+ return { width: typeof C == "number" ? `${C}px` : C };
757
774
  });
758
- return ce(() => x(), () => {
759
- l.value === "invalid" && S("change");
775
+ return ie(() => V(), () => {
776
+ l.value === "invalid" && $("change");
760
777
  }), xe(() => {
761
778
  a && t.prop && a.addField({
762
779
  prop: t.prop,
763
- validate: S,
764
- resetField: V,
765
- clearValidate: $
780
+ validate: $,
781
+ resetField: k,
782
+ clearValidate: D
766
783
  });
767
784
  }), we(() => {
768
785
  a && t.prop && a.removeField({
769
786
  prop: t.prop,
770
- validate: S,
771
- resetField: V,
772
- clearValidate: $
787
+ validate: $,
788
+ resetField: k,
789
+ clearValidate: D
773
790
  });
774
- }), b({
775
- validate: S,
776
- resetField: V,
777
- clearValidate: $
778
- }), (D, R) => (r(), d("div", {
779
- class: u(L.value)
791
+ }), y({
792
+ validate: $,
793
+ resetField: k,
794
+ clearValidate: D
795
+ }), (C, R) => (r(), d("div", {
796
+ class: u(A.value)
780
797
  }, [
781
798
  n.label ? (r(), d("label", {
782
799
  key: 0,
783
800
  class: u(s(e).e("label")),
784
- style: ne(v.value)
785
- }, z(n.label), 7)) : O("", !0),
801
+ style: ne(f.value)
802
+ }, z(n.label), 7)) : U("", !0),
786
803
  i("div", {
787
804
  class: u(s(e).e("content"))
788
805
  }, [
789
- ae(D.$slots, "default"),
806
+ ae(C.$slots, "default"),
790
807
  n.showMessage !== !1 && l.value === "invalid" ? (r(), d("div", {
791
808
  key: 0,
792
809
  class: u(s(e).e("error"))
793
- }, z(m.value), 3)) : O("", !0)
810
+ }, z(m.value), 3)) : U("", !0)
794
811
  ], 2)
795
812
  ], 2));
796
813
  }
797
814
  });
798
- function Je(n, b) {
799
- return new Date(n, b + 1, 0).getDate();
815
+ function Je(n, y) {
816
+ return new Date(n, y + 1, 0).getDate();
800
817
  }
801
- function _e(n, b) {
802
- return new Date(n, b, 1).getDay();
818
+ function _e(n, y) {
819
+ return new Date(n, y, 1).getDay();
803
820
  }
804
- function fe(n, b) {
805
- return !n || !b ? !1 : n.getFullYear() === b.getFullYear() && n.getMonth() === b.getMonth() && n.getDate() === b.getDate();
821
+ function fe(n, y) {
822
+ return !n || !y ? !1 : n.getFullYear() === y.getFullYear() && n.getMonth() === y.getMonth() && n.getDate() === y.getDate();
806
823
  }
807
- function et(n, b) {
808
- return !n || !b ? !1 : n.getFullYear() === b.getFullYear() && n.getMonth() === b.getMonth();
824
+ function et(n, y) {
825
+ return !n || !y ? !1 : n.getFullYear() === y.getFullYear() && n.getMonth() === y.getMonth();
809
826
  }
810
- function Ee(n, b, t) {
811
- if (!b || !t) return !1;
827
+ function Ee(n, y, t) {
828
+ if (!y || !t) return !1;
812
829
  const e = n.getTime();
813
- return e >= b.getTime() && e <= t.getTime();
830
+ return e >= y.getTime() && e <= t.getTime();
814
831
  }
815
- function tt(n, b, t = 0) {
816
- const e = [], a = Je(n, b), l = _e(n, b);
817
- let m = new Date(n, b, 1);
818
- const p = (l - t + 7) % 7;
819
- m.setDate(1 - p);
820
- let C = [], x = new Date(m);
821
- for (; (x.getMonth() <= b || x.getMonth() === b && x.getDate() <= a) && (C.push(new Date(x)), !(C.length === 7 && (e.push(C), C = [], x.getMonth() > b) || (x.setDate(x.getDate() + 1), e.length > 7))); )
832
+ function tt(n, y, t = 0) {
833
+ const e = [], a = Je(n, y), l = _e(n, y);
834
+ let m = new Date(n, y, 1);
835
+ const h = (l - t + 7) % 7;
836
+ m.setDate(1 - h);
837
+ let w = [], V = new Date(m);
838
+ for (; (V.getMonth() <= y || V.getMonth() === y && V.getDate() <= a) && (w.push(new Date(V)), !(w.length === 7 && (e.push(w), w = [], V.getMonth() > y) || (V.setDate(V.getDate() + 1), e.length > 7))); )
822
839
  ;
823
- return C.length > 0 && e.push(C), e;
840
+ return w.length > 0 && e.push(w), e;
824
841
  }
825
- function re(n, b = "YYYY-MM-DD") {
842
+ function de(n, y = "YYYY-MM-DD") {
826
843
  if (!n) return "";
827
- const t = n.getFullYear(), e = n.getMonth() + 1, a = n.getDate(), l = n.getHours(), m = n.getMinutes(), p = n.getSeconds();
828
- return b.replace(/YYYY/g, String(t)).replace(/YY/g, String(t).slice(-2)).replace(/MM/g, String(e).padStart(2, "0")).replace(/M/g, String(e)).replace(/DD/g, String(a).padStart(2, "0")).replace(/D/g, String(a)).replace(/HH/g, String(l).padStart(2, "0")).replace(/H/g, String(l)).replace(/mm/g, String(m).padStart(2, "0")).replace(/m/g, String(m)).replace(/ss/g, String(p).padStart(2, "0")).replace(/s/g, String(p));
844
+ const t = n.getFullYear(), e = n.getMonth() + 1, a = n.getDate(), l = n.getHours(), m = n.getMinutes(), h = n.getSeconds();
845
+ return y.replace(/YYYY/g, String(t)).replace(/YY/g, String(t).slice(-2)).replace(/MM/g, String(e).padStart(2, "0")).replace(/M/g, String(e)).replace(/DD/g, String(a).padStart(2, "0")).replace(/D/g, String(a)).replace(/HH/g, String(l).padStart(2, "0")).replace(/H/g, String(l)).replace(/mm/g, String(m).padStart(2, "0")).replace(/m/g, String(m)).replace(/ss/g, String(h).padStart(2, "0")).replace(/s/g, String(h));
829
846
  }
830
- function de(n) {
847
+ function ce(n) {
831
848
  if (!n || Array.isArray(n)) return null;
832
849
  if (n instanceof Date)
833
850
  return isNaN(n.getTime()) ? null : n;
834
851
  if (typeof n == "number")
835
852
  return new Date(n);
836
853
  if (typeof n != "string") return null;
837
- const b = new Date(n);
838
- if (isNaN(b.getTime())) {
854
+ const y = new Date(n);
855
+ if (isNaN(y.getTime())) {
839
856
  const t = n.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);
840
857
  return t ? new Date(parseInt(t[1]), parseInt(t[2]) - 1, parseInt(t[3])) : null;
841
858
  }
842
- return b;
859
+ return y;
843
860
  }
844
861
  function lt(n) {
845
- const b = new Date(n);
846
- return b.setMonth(b.getMonth() - 1), b;
862
+ const y = new Date(n);
863
+ return y.setMonth(y.getMonth() - 1), y;
847
864
  }
848
865
  function at(n) {
849
- const b = new Date(n);
850
- return b.setMonth(b.getMonth() + 1), b;
866
+ const y = new Date(n);
867
+ return y.setMonth(y.getMonth() + 1), y;
851
868
  }
852
869
  function nt(n) {
853
- const b = new Date(n);
854
- return b.setFullYear(b.getFullYear() - 1), b;
870
+ const y = new Date(n);
871
+ return y.setFullYear(y.getFullYear() - 1), y;
855
872
  }
856
873
  function st(n) {
857
- const b = new Date(n);
858
- return b.setFullYear(b.getFullYear() + 1), b;
874
+ const y = new Date(n);
875
+ return y.setFullYear(y.getFullYear() + 1), y;
859
876
  }
860
877
  function ze(n) {
861
- const b = Math.floor(n / 10) * 10;
862
- return [b, b + 9];
878
+ const y = Math.floor(n / 10) * 10;
879
+ return [y, y + 9];
863
880
  }
864
881
  function Re(n) {
865
- const b = new Date(n);
866
- return b.setHours(0, 0, 0, 0), b;
882
+ const y = new Date(n);
883
+ return y.setHours(0, 0, 0, 0), y;
867
884
  }
868
- function ut(n, b, t, e) {
869
- if (b && b(n))
885
+ function ut(n, y, t, e) {
886
+ if (y && y(n))
870
887
  return !0;
871
888
  const a = Re(n).getTime();
872
889
  return !!(t && a < Re(t).getTime() || e && a > Re(e).getTime());
@@ -901,73 +918,73 @@ const ot = [
901
918
  selectionMode: { default: "single" }
902
919
  },
903
920
  emits: ["pick", "range-select", "range-move", "update:viewedMonth"],
904
- setup(n, { emit: b }) {
905
- const t = n, e = b, a = _("date-table"), l = E(null), m = y(() => t.viewedMonth.getFullYear()), p = y(() => t.viewedMonth.getMonth()), C = y(() => tt(m.value, p.value, 0)), x = (h) => t.modelValue ? fe(h, t.modelValue) : !1, Y = (h) => fe(h, /* @__PURE__ */ new Date()), S = (h) => et(h, t.viewedMonth), V = (h) => {
921
+ setup(n, { emit: y }) {
922
+ const t = n, e = y, a = _("date-table"), l = E(null), m = b(() => t.viewedMonth.getFullYear()), h = b(() => t.viewedMonth.getMonth()), w = b(() => tt(m.value, h.value, 0)), V = (p) => t.modelValue ? fe(p, t.modelValue) : !1, F = (p) => fe(p, /* @__PURE__ */ new Date()), $ = (p) => et(p, t.viewedMonth), k = (p) => {
906
923
  if (t.selectionMode !== "range") return !1;
907
- const { startDate: f, endDate: k, selecting: W } = t.rangeState || {};
908
- if (W && f) {
909
- const X = l.value;
910
- if (X) {
911
- const Z = f < X ? f : X, ee = f < X ? X : f;
912
- return Ee(h, Z, ee);
924
+ const { startDate: v, endDate: S, selecting: O } = t.rangeState || {};
925
+ if (O && v) {
926
+ const N = l.value;
927
+ if (N) {
928
+ const q = v < N ? v : N, ee = v < N ? N : v;
929
+ return Ee(p, q, ee);
913
930
  }
914
- return fe(h, f);
931
+ return fe(p, v);
915
932
  }
916
- return f && k ? Ee(h, f, k) : !1;
917
- }, $ = (h) => {
933
+ return v && S ? Ee(p, v, S) : !1;
934
+ }, D = (p) => {
918
935
  if (t.selectionMode !== "range") return !1;
919
- const { startDate: f, selecting: k } = t.rangeState || {};
920
- return k && f && l.value ? fe(h, f < l.value ? f : l.value) : f ? fe(h, f) : !1;
921
- }, L = (h) => {
936
+ const { startDate: v, selecting: S } = t.rangeState || {};
937
+ return S && v && l.value ? fe(p, v < l.value ? v : l.value) : v ? fe(p, v) : !1;
938
+ }, A = (p) => {
922
939
  if (t.selectionMode !== "range") return !1;
923
- const { endDate: f, selecting: k } = t.rangeState || {};
924
- if (k && l.value) {
925
- const { startDate: W } = t.rangeState || {};
926
- return fe(h, W < l.value ? l.value : W);
940
+ const { endDate: v, selecting: S } = t.rangeState || {};
941
+ if (S && l.value) {
942
+ const { startDate: O } = t.rangeState || {};
943
+ return fe(p, O < l.value ? l.value : O);
927
944
  }
928
- return f ? fe(h, f) : !1;
929
- }, v = (h) => ut(h, t.disabledDate, t.minDate, t.maxDate), D = (h) => [
945
+ return v ? fe(p, v) : !1;
946
+ }, f = (p) => ut(p, t.disabledDate, t.minDate, t.maxDate), C = (p) => [
930
947
  a.e("cell"),
931
- a.is("selected", x(h)),
932
- a.is("today", Y(h)),
933
- a.is("disabled", v(h)),
934
- a.is("in-range", V(h)),
935
- a.is("range-start", $(h)),
936
- a.is("range-end", L(h)),
937
- a.is("prev-month", !S(h) && h.getMonth() < p.value),
938
- a.is("next-month", !S(h) && h.getMonth() > p.value)
939
- ], R = (h) => {
940
- v(h) || (t.selectionMode === "range" ? e("range-select", h) : e("pick", h));
941
- }, M = (h) => {
942
- l.value = h;
943
- }, P = () => {
948
+ a.is("selected", V(p)),
949
+ a.is("today", F(p)),
950
+ a.is("disabled", f(p)),
951
+ a.is("in-range", k(p)),
952
+ a.is("range-start", D(p)),
953
+ a.is("range-end", A(p)),
954
+ a.is("prev-month", !$(p) && p.getMonth() < h.value),
955
+ a.is("next-month", !$(p) && p.getMonth() > h.value)
956
+ ], R = (p) => {
957
+ f(p) || (t.selectionMode === "range" ? e("range-select", p) : e("pick", p));
958
+ }, L = (p) => {
959
+ l.value = p;
960
+ }, M = () => {
944
961
  l.value = null;
945
962
  };
946
- return (h, f) => (r(), d("table", {
963
+ return (p, v) => (r(), d("table", {
947
964
  class: u(s(a).b()),
948
965
  cellspacing: "0",
949
966
  cellpadding: "0"
950
967
  }, [
951
968
  i("thead", null, [
952
969
  i("tr", null, [
953
- (r(!0), d(G, null, Q(s(it), (k) => (r(), d("th", {
954
- key: k,
970
+ (r(!0), d(j, null, Q(s(it), (S) => (r(), d("th", {
971
+ key: S,
955
972
  class: u(s(a).e("header-cell"))
956
- }, z(k), 3))), 128))
973
+ }, z(S), 3))), 128))
957
974
  ])
958
975
  ]),
959
976
  i("tbody", null, [
960
- (r(!0), d(G, null, Q(C.value, (k, W) => (r(), d("tr", { key: W }, [
961
- (r(!0), d(G, null, Q(k, (X, Z) => (r(), d("td", {
962
- key: Z,
963
- class: u(D(X)),
964
- onClick: (ee) => R(X),
965
- onMouseenter: (ee) => M(X),
966
- onMouseleave: P
977
+ (r(!0), d(j, null, Q(w.value, (S, O) => (r(), d("tr", { key: O }, [
978
+ (r(!0), d(j, null, Q(S, (N, q) => (r(), d("td", {
979
+ key: q,
980
+ class: u(C(N)),
981
+ onClick: (ee) => R(N),
982
+ onMouseenter: (ee) => L(N),
983
+ onMouseleave: M
967
984
  }, [
968
985
  i("span", {
969
986
  class: u(s(a).e("cell-text"))
970
- }, z(X.getDate()), 3)
987
+ }, z(N.getDate()), 3)
971
988
  ], 42, rt))), 128))
972
989
  ]))), 128))
973
990
  ])
@@ -982,44 +999,44 @@ const ot = [
982
999
  disabledDate: {}
983
1000
  },
984
1001
  emits: ["pick"],
985
- setup(n, { emit: b }) {
986
- const t = n, e = b, a = _("month-table");
987
- y(() => t.modelValue ? t.modelValue.getMonth() : -1);
988
- const l = (S) => t.modelValue ? t.modelValue.getFullYear() === t.viewedYear && t.modelValue.getMonth() === S : !1, m = (S) => {
989
- const V = /* @__PURE__ */ new Date();
990
- return V.getFullYear() === t.viewedYear && V.getMonth() === S;
991
- }, p = (S) => {
1002
+ setup(n, { emit: y }) {
1003
+ const t = n, e = y, a = _("month-table");
1004
+ b(() => t.modelValue ? t.modelValue.getMonth() : -1);
1005
+ const l = ($) => t.modelValue ? t.modelValue.getFullYear() === t.viewedYear && t.modelValue.getMonth() === $ : !1, m = ($) => {
1006
+ const k = /* @__PURE__ */ new Date();
1007
+ return k.getFullYear() === t.viewedYear && k.getMonth() === $;
1008
+ }, h = ($) => {
992
1009
  if (!t.disabledDate) return !1;
993
- const V = new Date(t.viewedYear, S, 1), $ = new Date(t.viewedYear, S + 1, 0);
994
- return t.disabledDate(V) && t.disabledDate($);
995
- }, C = (S) => [
1010
+ const k = new Date(t.viewedYear, $, 1), D = new Date(t.viewedYear, $ + 1, 0);
1011
+ return t.disabledDate(k) && t.disabledDate(D);
1012
+ }, w = ($) => [
996
1013
  a.e("cell"),
997
- a.is("selected", l(S)),
998
- a.is("current", m(S)),
999
- a.is("disabled", p(S))
1000
- ], x = (S) => {
1001
- p(S) || e("pick", S);
1002
- }, Y = y(() => {
1003
- const S = [];
1004
- for (let V = 0; V < 12; V += 3)
1005
- S.push([V, V + 1, V + 2]);
1006
- return S;
1014
+ a.is("selected", l($)),
1015
+ a.is("current", m($)),
1016
+ a.is("disabled", h($))
1017
+ ], V = ($) => {
1018
+ h($) || e("pick", $);
1019
+ }, F = b(() => {
1020
+ const $ = [];
1021
+ for (let k = 0; k < 12; k += 3)
1022
+ $.push([k, k + 1, k + 2]);
1023
+ return $;
1007
1024
  });
1008
- return (S, V) => (r(), d("table", {
1025
+ return ($, k) => (r(), d("table", {
1009
1026
  class: u(s(a).b()),
1010
1027
  cellspacing: "0",
1011
1028
  cellpadding: "0"
1012
1029
  }, [
1013
1030
  i("tbody", null, [
1014
- (r(!0), d(G, null, Q(Y.value, ($, L) => (r(), d("tr", { key: L }, [
1015
- (r(!0), d(G, null, Q($, (v) => (r(), d("td", {
1016
- key: v,
1017
- class: u(C(v)),
1018
- onClick: (D) => x(v)
1031
+ (r(!0), d(j, null, Q(F.value, (D, A) => (r(), d("tr", { key: A }, [
1032
+ (r(!0), d(j, null, Q(D, (f) => (r(), d("td", {
1033
+ key: f,
1034
+ class: u(w(f)),
1035
+ onClick: (C) => V(f)
1019
1036
  }, [
1020
1037
  i("span", {
1021
1038
  class: u(s(a).e("cell-text"))
1022
- }, z(s(ot)[v]), 3)
1039
+ }, z(s(ot)[f]), 3)
1023
1040
  ], 10, ct))), 128))
1024
1041
  ]))), 128))
1025
1042
  ])
@@ -1034,49 +1051,49 @@ const ot = [
1034
1051
  disabledDate: {}
1035
1052
  },
1036
1053
  emits: ["pick"],
1037
- setup(n, { emit: b }) {
1038
- const t = n, e = b, a = _("year-table"), l = y(() => (/* @__PURE__ */ new Date()).getFullYear()), m = y(() => ze(t.viewedYear)), p = y(() => {
1039
- const [v] = m.value, D = [];
1040
- D.push(v - 1);
1054
+ setup(n, { emit: y }) {
1055
+ const t = n, e = y, a = _("year-table"), l = b(() => (/* @__PURE__ */ new Date()).getFullYear()), m = b(() => ze(t.viewedYear)), h = b(() => {
1056
+ const [f] = m.value, C = [];
1057
+ C.push(f - 1);
1041
1058
  for (let R = 0; R < 10; R++)
1042
- D.push(v + R);
1043
- return D.push(v + 10), D;
1044
- }), C = y(() => {
1045
- const v = [];
1046
- for (let D = 0; D < p.value.length; D += 3)
1047
- v.push(p.value.slice(D, D + 3));
1048
- return v;
1049
- }), x = (v) => t.modelValue ? t.modelValue.getFullYear() === v : !1, Y = (v) => v === l.value, S = (v) => {
1050
- const [D, R] = m.value;
1051
- return v >= D && v <= R;
1052
- }, V = (v) => {
1059
+ C.push(f + R);
1060
+ return C.push(f + 10), C;
1061
+ }), w = b(() => {
1062
+ const f = [];
1063
+ for (let C = 0; C < h.value.length; C += 3)
1064
+ f.push(h.value.slice(C, C + 3));
1065
+ return f;
1066
+ }), V = (f) => t.modelValue ? t.modelValue.getFullYear() === f : !1, F = (f) => f === l.value, $ = (f) => {
1067
+ const [C, R] = m.value;
1068
+ return f >= C && f <= R;
1069
+ }, k = (f) => {
1053
1070
  if (!t.disabledDate) return !1;
1054
- const D = new Date(v, 0, 1), R = new Date(v, 11, 31);
1055
- return t.disabledDate(D) && t.disabledDate(R);
1056
- }, $ = (v) => [
1071
+ const C = new Date(f, 0, 1), R = new Date(f, 11, 31);
1072
+ return t.disabledDate(C) && t.disabledDate(R);
1073
+ }, D = (f) => [
1057
1074
  a.e("cell"),
1058
- a.is("selected", x(v)),
1059
- a.is("current", Y(v)),
1060
- a.is("disabled", V(v)),
1061
- a.is("in-decade", S(v))
1062
- ], L = (v) => {
1063
- V(v) || e("pick", v);
1075
+ a.is("selected", V(f)),
1076
+ a.is("current", F(f)),
1077
+ a.is("disabled", k(f)),
1078
+ a.is("in-decade", $(f))
1079
+ ], A = (f) => {
1080
+ k(f) || e("pick", f);
1064
1081
  };
1065
- return (v, D) => (r(), d("table", {
1082
+ return (f, C) => (r(), d("table", {
1066
1083
  class: u(s(a).b()),
1067
1084
  cellspacing: "0",
1068
1085
  cellpadding: "0"
1069
1086
  }, [
1070
1087
  i("tbody", null, [
1071
- (r(!0), d(G, null, Q(C.value, (R, M) => (r(), d("tr", { key: M }, [
1072
- (r(!0), d(G, null, Q(R, (P) => (r(), d("td", {
1073
- key: P,
1074
- class: u($(P)),
1075
- onClick: (h) => L(P)
1088
+ (r(!0), d(j, null, Q(w.value, (R, L) => (r(), d("tr", { key: L }, [
1089
+ (r(!0), d(j, null, Q(R, (M) => (r(), d("td", {
1090
+ key: M,
1091
+ class: u(D(M)),
1092
+ onClick: (p) => A(M)
1076
1093
  }, [
1077
1094
  i("span", {
1078
1095
  class: u(s(a).e("cell-text"))
1079
- }, z(P), 3)
1096
+ }, z(M), 3)
1080
1097
  ], 10, ft))), 128))
1081
1098
  ]))), 128))
1082
1099
  ])
@@ -1104,206 +1121,206 @@ const ot = [
1104
1121
  showTime: { type: Boolean, default: !1 }
1105
1122
  },
1106
1123
  emits: ["update:modelValue", "update:value", "change", "focus", "blur", "clear"],
1107
- setup(n, { expose: b, emit: t }) {
1108
- const e = n, a = t, l = _("date-picker"), m = E(!1), p = E(2e3), C = E(), x = () => e.modelValue !== void 0 && e.modelValue !== null ? e.modelValue : e.value !== void 0 && e.value !== null ? e.value : null, Y = (F) => {
1109
- e.modelValue !== void 0 && a("update:modelValue", F), e.value !== void 0 && a("update:value", F), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", F), a("change", F);
1110
- }, S = E(), V = E(), $ = E({
1124
+ setup(n, { expose: y, emit: t }) {
1125
+ const e = n, a = t, l = _("date-picker"), m = E(!1), h = E(2e3), w = E(), V = () => e.modelValue !== void 0 && e.modelValue !== null ? e.modelValue : e.value !== void 0 && e.value !== null ? e.value : null, F = (I) => {
1126
+ e.modelValue !== void 0 && a("update:modelValue", I), e.value !== void 0 && a("update:value", I), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", I), a("change", I);
1127
+ }, $ = E(), k = E(), D = E({
1111
1128
  top: "0px",
1112
1129
  left: "0px"
1113
- }), L = () => Ye().next(), v = E("date"), D = E(/* @__PURE__ */ new Date()), R = E({
1130
+ }), A = () => Ye().next(), f = E("date"), C = E(/* @__PURE__ */ new Date()), R = E({
1114
1131
  hours: (/* @__PURE__ */ new Date()).getHours(),
1115
1132
  minutes: (/* @__PURE__ */ new Date()).getMinutes(),
1116
1133
  seconds: (/* @__PURE__ */ new Date()).getSeconds()
1117
- }), M = E({
1134
+ }), L = E({
1118
1135
  selecting: !1,
1119
1136
  startDate: null,
1120
1137
  endDate: null
1121
- }), P = y(() => {
1122
- const F = x();
1123
- if (!F) return null;
1138
+ }), M = b(() => {
1139
+ const I = V();
1140
+ if (!I) return null;
1124
1141
  if (e.type === "daterange") {
1125
- if (!Array.isArray(F)) return null;
1126
- const [I, U] = F;
1142
+ if (!Array.isArray(I)) return null;
1143
+ const [P, K] = I;
1127
1144
  return [
1128
- I instanceof Date ? I : de(I),
1129
- U instanceof Date ? U : de(U)
1145
+ P instanceof Date ? P : ce(P),
1146
+ K instanceof Date ? K : ce(K)
1130
1147
  ];
1131
1148
  }
1132
- return F instanceof Date ? F : de(F);
1133
- }), h = y(() => {
1149
+ return I instanceof Date ? I : ce(I);
1150
+ }), p = b(() => {
1134
1151
  if (e.type === "daterange") return "";
1135
- const F = x();
1136
- if (!F) return "";
1137
- const I = F instanceof Date ? F : de(F);
1138
- if (!I) return "";
1139
- const U = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.format;
1140
- return re(I, U);
1141
- }), f = y(() => {
1142
- const F = x();
1143
- if (!F || !Array.isArray(F)) return "";
1144
- const [I] = F;
1152
+ const I = V();
1145
1153
  if (!I) return "";
1146
- const U = I instanceof Date ? I : de(I);
1147
- return U ? re(U, e.format) : "";
1148
- }), k = y(() => {
1149
- const F = x();
1150
- if (!F || !Array.isArray(F)) return "";
1151
- const [, I] = F;
1152
- if (!I) return "";
1153
- const U = I instanceof Date ? I : de(I);
1154
- return U ? re(U, e.format) : "";
1155
- }), W = y(() => {
1156
- const F = x();
1157
- return !F || Array.isArray(F) ? null : F instanceof Date ? F : de(F);
1158
- }), X = y(() => D.value.getFullYear()), Z = y(() => D.value.getMonth()), ee = y(() => ze(X.value)), T = y(() => v.value === "year" ? `${ee.value[0]} 年 - ${ee.value[1]} 年` : v.value === "month" ? `${X.value} 年` : `${X.value} 年 ${Z.value + 1} 月`), B = y(() => [
1154
+ const P = I instanceof Date ? I : ce(I);
1155
+ if (!P) return "";
1156
+ const K = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.format;
1157
+ return de(P, K);
1158
+ }), v = b(() => {
1159
+ const I = V();
1160
+ if (!I || !Array.isArray(I)) return "";
1161
+ const [P] = I;
1162
+ if (!P) return "";
1163
+ const K = P instanceof Date ? P : ce(P);
1164
+ return K ? de(K, e.format) : "";
1165
+ }), S = b(() => {
1166
+ const I = V();
1167
+ if (!I || !Array.isArray(I)) return "";
1168
+ const [, P] = I;
1169
+ if (!P) return "";
1170
+ const K = P instanceof Date ? P : ce(P);
1171
+ return K ? de(K, e.format) : "";
1172
+ }), O = b(() => {
1173
+ const I = V();
1174
+ return !I || Array.isArray(I) ? null : I instanceof Date ? I : ce(I);
1175
+ }), N = b(() => C.value.getFullYear()), q = b(() => C.value.getMonth()), ee = b(() => ze(N.value)), T = b(() => f.value === "year" ? `${ee.value[0]} 年 - ${ee.value[1]} 年` : f.value === "month" ? `${N.value} 年` : `${N.value} 年 ${q.value + 1} 月`), B = b(() => [
1159
1176
  l.b(),
1160
1177
  l.m(e.size),
1161
1178
  l.is("disabled", e.disabled),
1162
1179
  l.is("range", e.type === "daterange")
1163
- ]), w = y(() => [
1180
+ ]), x = b(() => [
1164
1181
  l.e("input"),
1165
1182
  l.is("focus", m.value),
1166
- l.is("has-value", !!h.value || !!(f.value || k.value))
1183
+ l.is("has-value", !!p.value || !!(v.value || S.value))
1167
1184
  ]), o = () => {
1168
1185
  e.disabled || e.readonly || (m.value ? g() : c());
1169
1186
  }, c = () => {
1170
- m.value = !0, p.value = L(), Se(() => {
1171
- if (C.value && S.value) {
1172
- const F = C.value.getBoundingClientRect(), I = S.value.getBoundingClientRect();
1173
- let U = F.bottom + 8, Te = F.left;
1174
- Te + I.width > window.innerWidth && (Te = window.innerWidth - I.width - 8), U + I.height > window.innerHeight && (U = F.top - I.height - 8), $.value = {
1175
- top: `${U}px`,
1187
+ m.value = !0, h.value = A(), Se(() => {
1188
+ if (w.value && $.value) {
1189
+ const I = w.value.getBoundingClientRect(), P = $.value.getBoundingClientRect();
1190
+ let K = I.bottom + 8, Te = I.left;
1191
+ Te + P.width > window.innerWidth && (Te = window.innerWidth - P.width - 8), K + P.height > window.innerHeight && (K = I.top - P.height - 8), D.value = {
1192
+ top: `${K}px`,
1176
1193
  left: `${Te}px`
1177
1194
  };
1178
1195
  }
1179
1196
  }), a("focus", {});
1180
1197
  }, g = () => {
1181
- m.value = !1, v.value = "date", a("blur", {});
1182
- }, K = (F) => {
1198
+ m.value = !1, f.value = "date", a("blur", {});
1199
+ }, W = (I) => {
1183
1200
  if (e.type === "date") {
1184
- e.showTime && (F.setHours(R.value.hours), F.setMinutes(R.value.minutes), F.setSeconds(R.value.seconds));
1185
- const I = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.valueFormat, U = I ? re(F, I) : F;
1186
- Y(U), e.showTime || g();
1201
+ e.showTime && (I.setHours(R.value.hours), I.setMinutes(R.value.minutes), I.setSeconds(R.value.seconds));
1202
+ const P = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.valueFormat, K = P ? de(I, P) : I;
1203
+ F(K), e.showTime || g();
1187
1204
  }
1188
1205
  }, le = () => {
1189
- const F = x();
1190
- if (F) {
1191
- const I = F instanceof Date ? F : de(F);
1192
- if (I) {
1193
- I.setHours(R.value.hours), I.setMinutes(R.value.minutes), I.setSeconds(R.value.seconds);
1194
- const U = e.valueFormat ? re(I, e.valueFormat) : I;
1195
- Y(U);
1206
+ const I = V();
1207
+ if (I) {
1208
+ const P = I instanceof Date ? I : ce(I);
1209
+ if (P) {
1210
+ P.setHours(R.value.hours), P.setMinutes(R.value.minutes), P.setSeconds(R.value.seconds);
1211
+ const K = e.valueFormat ? de(P, e.valueFormat) : P;
1212
+ F(K);
1196
1213
  }
1197
1214
  } else {
1198
- const I = /* @__PURE__ */ new Date();
1199
- I.setHours(R.value.hours), I.setMinutes(R.value.minutes), I.setSeconds(R.value.seconds);
1200
- const U = e.valueFormat ? re(I, e.valueFormat) : I;
1201
- Y(U);
1215
+ const P = /* @__PURE__ */ new Date();
1216
+ P.setHours(R.value.hours), P.setMinutes(R.value.minutes), P.setSeconds(R.value.seconds);
1217
+ const K = e.valueFormat ? de(P, e.valueFormat) : P;
1218
+ F(K);
1202
1219
  }
1203
1220
  g();
1204
- }, H = (F) => {
1205
- if (!M.value.selecting)
1206
- M.value.selecting = !0, M.value.startDate = F, M.value.endDate = null;
1221
+ }, H = (I) => {
1222
+ if (!L.value.selecting)
1223
+ L.value.selecting = !0, L.value.startDate = I, L.value.endDate = null;
1207
1224
  else {
1208
- M.value.selecting = !1, M.value.startDate && F < M.value.startDate ? [M.value.startDate, M.value.endDate] = [F, M.value.startDate] : M.value.endDate = F;
1209
- const I = e.valueFormat ? re(M.value.startDate, e.valueFormat) : M.value.startDate, U = e.valueFormat ? re(M.value.endDate, e.valueFormat) : M.value.endDate;
1210
- Y([I, U]), g();
1225
+ L.value.selecting = !1, L.value.startDate && I < L.value.startDate ? [L.value.startDate, L.value.endDate] = [I, L.value.startDate] : L.value.endDate = I;
1226
+ const P = e.valueFormat ? de(L.value.startDate, e.valueFormat) : L.value.startDate, K = e.valueFormat ? de(L.value.endDate, e.valueFormat) : L.value.endDate;
1227
+ F([P, K]), g();
1211
1228
  }
1212
- }, te = (F) => {
1213
- if (D.value = new Date(X.value, F, 1), e.type === "month") {
1214
- const I = new Date(X.value, F, 1), U = e.valueFormat ? re(I, e.valueFormat) : I;
1215
- Y(U), g();
1229
+ }, te = (I) => {
1230
+ if (C.value = new Date(N.value, I, 1), e.type === "month") {
1231
+ const P = new Date(N.value, I, 1), K = e.valueFormat ? de(P, e.valueFormat) : P;
1232
+ F(K), g();
1216
1233
  } else
1217
- v.value = "date";
1218
- }, N = (F) => {
1219
- if (D.value = new Date(F, Z.value, 1), e.type === "year") {
1220
- const I = new Date(F, 0, 1), U = e.valueFormat ? re(I, e.valueFormat) : I;
1221
- Y(U), g();
1234
+ f.value = "date";
1235
+ }, X = (I) => {
1236
+ if (C.value = new Date(I, q.value, 1), e.type === "year") {
1237
+ const P = new Date(I, 0, 1), K = e.valueFormat ? de(P, e.valueFormat) : P;
1238
+ F(K), g();
1222
1239
  } else
1223
- v.value = "month";
1240
+ f.value = "month";
1224
1241
  }, ve = () => {
1225
- D.value = lt(D.value);
1242
+ C.value = lt(C.value);
1226
1243
  }, ye = () => {
1227
- D.value = at(D.value);
1228
- }, A = () => {
1229
- v.value === "year" ? D.value = new Date(X.value - 10, Z.value, 1) : D.value = nt(D.value);
1230
- }, q = () => {
1231
- v.value === "year" ? D.value = new Date(X.value + 10, Z.value, 1) : D.value = st(D.value);
1232
- }, j = () => {
1233
- v.value = "month";
1244
+ C.value = at(C.value);
1245
+ }, Y = () => {
1246
+ f.value === "year" ? C.value = new Date(N.value - 10, q.value, 1) : C.value = nt(C.value);
1247
+ }, G = () => {
1248
+ f.value === "year" ? C.value = new Date(N.value + 10, q.value, 1) : C.value = st(C.value);
1249
+ }, Z = () => {
1250
+ f.value = "month";
1234
1251
  }, se = () => {
1235
- v.value = "year";
1236
- }, ie = () => {
1237
- Y(null), a("clear"), M.value = {
1252
+ f.value = "year";
1253
+ }, re = () => {
1254
+ F(null), a("clear"), L.value = {
1238
1255
  selecting: !1,
1239
1256
  startDate: null,
1240
1257
  endDate: null
1241
1258
  };
1242
- }, Ve = (F) => {
1243
- if (!C.value) return;
1244
- const I = F.target;
1245
- C.value.contains(I) || S.value && S.value.contains(I) || g();
1259
+ }, Ve = (I) => {
1260
+ if (!w.value) return;
1261
+ const P = I.target;
1262
+ w.value.contains(P) || $.value && $.value.contains(P) || g();
1246
1263
  };
1247
- ce(
1248
- x,
1249
- (F) => {
1250
- if (F)
1251
- if (Array.isArray(P.value)) {
1252
- const [I] = P.value;
1253
- I && (D.value = new Date(I));
1254
- } else P.value && (D.value = new Date(P.value));
1264
+ ie(
1265
+ V,
1266
+ (I) => {
1267
+ if (I)
1268
+ if (Array.isArray(M.value)) {
1269
+ const [P] = M.value;
1270
+ P && (C.value = new Date(P));
1271
+ } else M.value && (C.value = new Date(M.value));
1255
1272
  },
1256
1273
  { immediate: !0 }
1257
- ), ce(m, (F) => {
1258
- F && (v.value = "date", e.type === "daterange" && (M.value = {
1274
+ ), ie(m, (I) => {
1275
+ I && (f.value = "date", e.type === "daterange" && (L.value = {
1259
1276
  selecting: !1,
1260
- startDate: Array.isArray(P.value) ? P.value[0] : null,
1261
- endDate: Array.isArray(P.value) ? P.value[1] : null
1277
+ startDate: Array.isArray(M.value) ? M.value[0] : null,
1278
+ endDate: Array.isArray(M.value) ? M.value[1] : null
1262
1279
  }));
1263
1280
  });
1264
- const Me = (F) => {
1265
- F.key === "Escape" && g();
1281
+ const Me = (I) => {
1282
+ I.key === "Escape" && g();
1266
1283
  };
1267
1284
  return xe(() => {
1268
1285
  document.addEventListener("click", Ve), document.addEventListener("keydown", Me);
1269
1286
  }), we(() => {
1270
1287
  document.removeEventListener("click", Ve), document.removeEventListener("keydown", Me);
1271
- }), b({
1288
+ }), y({
1272
1289
  focus: () => {
1273
- var F;
1274
- return (F = V.value) == null ? void 0 : F.focus();
1290
+ var I;
1291
+ return (I = k.value) == null ? void 0 : I.focus();
1275
1292
  },
1276
1293
  blur: () => {
1277
- var F;
1278
- return (F = V.value) == null ? void 0 : F.blur();
1294
+ var I;
1295
+ return (I = k.value) == null ? void 0 : I.blur();
1279
1296
  }
1280
- }), (F, I) => (r(), d("div", {
1297
+ }), (I, P) => (r(), d("div", {
1281
1298
  ref_key: "pickerRef",
1282
- ref: C,
1299
+ ref: w,
1283
1300
  class: u(B.value)
1284
1301
  }, [
1285
1302
  n.type !== "daterange" ? (r(), d("div", {
1286
1303
  key: 0,
1287
- class: u(w.value),
1304
+ class: u(x.value),
1288
1305
  onClick: o
1289
1306
  }, [
1290
1307
  i("input", {
1291
1308
  ref_key: "inputRef",
1292
- ref: V,
1309
+ ref: k,
1293
1310
  type: "text",
1294
1311
  placeholder: n.placeholder,
1295
1312
  disabled: n.disabled,
1296
1313
  readonly: !0,
1297
- value: h.value,
1314
+ value: p.value,
1298
1315
  class: u(s(l).e("input-inner"))
1299
1316
  }, null, 10, pt),
1300
1317
  i("span", {
1301
1318
  class: u(s(l).e("suffix"))
1302
1319
  }, [
1303
- n.clearable && h.value && !n.disabled ? (r(), d("span", {
1320
+ n.clearable && p.value && !n.disabled ? (r(), d("span", {
1304
1321
  key: 0,
1305
1322
  class: u(s(l).e("clear")),
1306
- onClick: oe(ie, ["stop"])
1323
+ onClick: oe(re, ["stop"])
1307
1324
  }, " ✕ ", 2)) : (r(), d("span", {
1308
1325
  key: 1,
1309
1326
  class: u(s(l).e("icon"))
@@ -1311,7 +1328,7 @@ const ot = [
1311
1328
  ], 2)
1312
1329
  ], 2)) : (r(), d("div", {
1313
1330
  key: 1,
1314
- class: u(w.value),
1331
+ class: u(x.value),
1315
1332
  onClick: o
1316
1333
  }, [
1317
1334
  i("input", {
@@ -1319,7 +1336,7 @@ const ot = [
1319
1336
  placeholder: n.startPlaceholder,
1320
1337
  disabled: n.disabled,
1321
1338
  readonly: !0,
1322
- value: f.value,
1339
+ value: v.value,
1323
1340
  class: u(s(l).e("input-inner"))
1324
1341
  }, null, 10, ht),
1325
1342
  i("span", {
@@ -1330,16 +1347,16 @@ const ot = [
1330
1347
  placeholder: n.endPlaceholder,
1331
1348
  disabled: n.disabled,
1332
1349
  readonly: !0,
1333
- value: k.value,
1350
+ value: S.value,
1334
1351
  class: u(s(l).e("input-inner"))
1335
1352
  }, null, 10, gt),
1336
1353
  i("span", {
1337
1354
  class: u(s(l).e("suffix"))
1338
1355
  }, [
1339
- n.clearable && (f.value || k.value) && !n.disabled ? (r(), d("span", {
1356
+ n.clearable && (v.value || S.value) && !n.disabled ? (r(), d("span", {
1340
1357
  key: 0,
1341
1358
  class: u(s(l).e("clear")),
1342
- onClick: oe(ie, ["stop"])
1359
+ onClick: oe(re, ["stop"])
1343
1360
  }, " ✕ ", 2)) : (r(), d("span", {
1344
1361
  key: 1,
1345
1362
  class: u(s(l).e("icon"))
@@ -1351,9 +1368,9 @@ const ot = [
1351
1368
  default: Pe(() => [
1352
1369
  ue(i("div", {
1353
1370
  ref_key: "popperRef",
1354
- ref: S,
1371
+ ref: $,
1355
1372
  class: u(s(l).e("popper")),
1356
- style: ne({ zIndex: p.value, ...$.value })
1373
+ style: ne({ zIndex: h.value, ...D.value })
1357
1374
  }, [
1358
1375
  i("div", {
1359
1376
  class: u(s(l).e("header"))
@@ -1361,55 +1378,55 @@ const ot = [
1361
1378
  i("button", {
1362
1379
  type: "button",
1363
1380
  class: u(s(l).e("prev-btn")),
1364
- onClick: I[0] || (I[0] = (U) => v.value === "date" ? ve() : A())
1381
+ onClick: P[0] || (P[0] = (K) => f.value === "date" ? ve() : Y())
1365
1382
  }, " ‹ ", 2),
1366
1383
  i("div", {
1367
1384
  class: u(s(l).e("header-title"))
1368
1385
  }, [
1369
- v.value === "year" ? (r(), d("span", {
1386
+ f.value === "year" ? (r(), d("span", {
1370
1387
  key: 0,
1371
- onClick: I[1] || (I[1] = (U) => v.value = "month")
1372
- }, z(T.value), 1)) : (r(), d(G, { key: 1 }, [
1373
- i("span", { onClick: se }, z(X.value) + " 年", 1),
1374
- v.value === "date" ? (r(), d("span", {
1388
+ onClick: P[1] || (P[1] = (K) => f.value = "month")
1389
+ }, z(T.value), 1)) : (r(), d(j, { key: 1 }, [
1390
+ i("span", { onClick: se }, z(N.value) + " 年", 1),
1391
+ f.value === "date" ? (r(), d("span", {
1375
1392
  key: 0,
1376
- onClick: j
1377
- }, z(Z.value + 1) + " 月", 1)) : O("", !0)
1393
+ onClick: Z
1394
+ }, z(q.value + 1) + " 月", 1)) : U("", !0)
1378
1395
  ], 64))
1379
1396
  ], 2),
1380
1397
  i("button", {
1381
1398
  type: "button",
1382
1399
  class: u(s(l).e("next-btn")),
1383
- onClick: I[2] || (I[2] = (U) => v.value === "date" ? ye() : q())
1400
+ onClick: P[2] || (P[2] = (K) => f.value === "date" ? ye() : G())
1384
1401
  }, " › ", 2)
1385
1402
  ], 2),
1386
1403
  i("div", {
1387
1404
  class: u(s(l).e("content"))
1388
1405
  }, [
1389
- v.value === "date" ? (r(), ge(dt, {
1406
+ f.value === "date" ? (r(), ge(dt, {
1390
1407
  key: 0,
1391
- "model-value": W.value,
1392
- "viewed-month": D.value,
1408
+ "model-value": O.value,
1409
+ "viewed-month": C.value,
1393
1410
  "disabled-date": n.disabledDate,
1394
- "min-date": n.minDate ? s(de)(n.minDate) : null,
1395
- "max-date": n.maxDate ? s(de)(n.maxDate) : null,
1411
+ "min-date": n.minDate ? s(ce)(n.minDate) : null,
1412
+ "max-date": n.maxDate ? s(ce)(n.maxDate) : null,
1396
1413
  "selection-mode": n.type === "daterange" ? "range" : "single",
1397
- "range-state": M.value,
1398
- onPick: K,
1414
+ "range-state": L.value,
1415
+ onPick: W,
1399
1416
  onRangeSelect: H
1400
- }, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) : v.value === "month" ? (r(), ge(vt, {
1417
+ }, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) : f.value === "month" ? (r(), ge(vt, {
1401
1418
  key: 1,
1402
- "model-value": W.value,
1403
- "viewed-year": X.value,
1419
+ "model-value": O.value,
1420
+ "viewed-year": N.value,
1404
1421
  "disabled-date": n.disabledDate,
1405
1422
  onPick: te
1406
- }, null, 8, ["model-value", "viewed-year", "disabled-date"])) : v.value === "year" ? (r(), ge(mt, {
1423
+ }, null, 8, ["model-value", "viewed-year", "disabled-date"])) : f.value === "year" ? (r(), ge(mt, {
1407
1424
  key: 2,
1408
- "model-value": W.value,
1409
- "viewed-year": X.value,
1425
+ "model-value": O.value,
1426
+ "viewed-year": N.value,
1410
1427
  "disabled-date": n.disabledDate,
1411
- onPick: N
1412
- }, null, 8, ["model-value", "viewed-year", "disabled-date"])) : O("", !0)
1428
+ onPick: X
1429
+ }, null, 8, ["model-value", "viewed-year", "disabled-date"])) : U("", !0)
1413
1430
  ], 2),
1414
1431
  n.showTime && n.type !== "daterange" ? (r(), d("div", {
1415
1432
  key: 0,
@@ -1419,13 +1436,13 @@ const ot = [
1419
1436
  class: u(s(l).e("time-item"))
1420
1437
  }, [
1421
1438
  ue(i("select", {
1422
- "onUpdate:modelValue": I[3] || (I[3] = (U) => R.value.hours = U),
1439
+ "onUpdate:modelValue": P[3] || (P[3] = (K) => R.value.hours = K),
1423
1440
  class: u(s(l).e("time-select"))
1424
1441
  }, [
1425
- (r(), d(G, null, Q(24, (U) => i("option", {
1426
- key: U,
1427
- value: U - 1
1428
- }, z(String(U - 1).padStart(2, "0")), 9, bt)), 64))
1442
+ (r(), d(j, null, Q(24, (K) => i("option", {
1443
+ key: K,
1444
+ value: K - 1
1445
+ }, z(String(K - 1).padStart(2, "0")), 9, bt)), 64))
1429
1446
  ], 2), [
1430
1447
  [
1431
1448
  ke,
@@ -1434,19 +1451,19 @@ const ot = [
1434
1451
  { number: !0 }
1435
1452
  ]
1436
1453
  ]),
1437
- I[6] || (I[6] = i("span", null, "时", -1))
1454
+ P[6] || (P[6] = i("span", null, "时", -1))
1438
1455
  ], 2),
1439
1456
  i("div", {
1440
1457
  class: u(s(l).e("time-item"))
1441
1458
  }, [
1442
1459
  ue(i("select", {
1443
- "onUpdate:modelValue": I[4] || (I[4] = (U) => R.value.minutes = U),
1460
+ "onUpdate:modelValue": P[4] || (P[4] = (K) => R.value.minutes = K),
1444
1461
  class: u(s(l).e("time-select"))
1445
1462
  }, [
1446
- (r(), d(G, null, Q(60, (U) => i("option", {
1447
- key: U,
1448
- value: U - 1
1449
- }, z(String(U - 1).padStart(2, "0")), 9, yt)), 64))
1463
+ (r(), d(j, null, Q(60, (K) => i("option", {
1464
+ key: K,
1465
+ value: K - 1
1466
+ }, z(String(K - 1).padStart(2, "0")), 9, yt)), 64))
1450
1467
  ], 2), [
1451
1468
  [
1452
1469
  ke,
@@ -1455,19 +1472,19 @@ const ot = [
1455
1472
  { number: !0 }
1456
1473
  ]
1457
1474
  ]),
1458
- I[7] || (I[7] = i("span", null, "分", -1))
1475
+ P[7] || (P[7] = i("span", null, "分", -1))
1459
1476
  ], 2),
1460
1477
  i("div", {
1461
1478
  class: u(s(l).e("time-item"))
1462
1479
  }, [
1463
1480
  ue(i("select", {
1464
- "onUpdate:modelValue": I[5] || (I[5] = (U) => R.value.seconds = U),
1481
+ "onUpdate:modelValue": P[5] || (P[5] = (K) => R.value.seconds = K),
1465
1482
  class: u(s(l).e("time-select"))
1466
1483
  }, [
1467
- (r(), d(G, null, Q(60, (U) => i("option", {
1468
- key: U,
1469
- value: U - 1
1470
- }, z(String(U - 1).padStart(2, "0")), 9, kt)), 64))
1484
+ (r(), d(j, null, Q(60, (K) => i("option", {
1485
+ key: K,
1486
+ value: K - 1
1487
+ }, z(String(K - 1).padStart(2, "0")), 9, kt)), 64))
1471
1488
  ], 2), [
1472
1489
  [
1473
1490
  ke,
@@ -1476,9 +1493,9 @@ const ot = [
1476
1493
  { number: !0 }
1477
1494
  ]
1478
1495
  ]),
1479
- I[8] || (I[8] = i("span", null, "秒", -1))
1496
+ P[8] || (P[8] = i("span", null, "秒", -1))
1480
1497
  ], 2)
1481
- ], 2)) : O("", !0),
1498
+ ], 2)) : U("", !0),
1482
1499
  n.showTime && n.type !== "daterange" ? (r(), d("div", {
1483
1500
  key: 1,
1484
1501
  class: u(s(l).e("footer"))
@@ -1488,7 +1505,7 @@ const ot = [
1488
1505
  class: u(s(l).e("confirm-btn")),
1489
1506
  onClick: le
1490
1507
  }, "确定", 2)
1491
- ], 2)) : O("", !0)
1508
+ ], 2)) : U("", !0)
1492
1509
  ], 6), [
1493
1510
  [Ae, m.value]
1494
1511
  ])
@@ -1499,10 +1516,10 @@ const ot = [
1499
1516
  ], 2));
1500
1517
  }
1501
1518
  });
1502
- function pe(n, b = "HH:mm:ss") {
1519
+ function pe(n, y = "HH:mm:ss") {
1503
1520
  if (!n) return "";
1504
1521
  const t = n.getHours(), e = n.getMinutes(), a = n.getSeconds();
1505
- return b.replace(/HH/g, String(t).padStart(2, "0")).replace(/H/g, String(t)).replace(/mm/g, String(e).padStart(2, "0")).replace(/m/g, String(e)).replace(/ss/g, String(a).padStart(2, "0")).replace(/s/g, String(a));
1522
+ return y.replace(/HH/g, String(t).padStart(2, "0")).replace(/H/g, String(t)).replace(/mm/g, String(e).padStart(2, "0")).replace(/m/g, String(e)).replace(/ss/g, String(a).padStart(2, "0")).replace(/s/g, String(a));
1506
1523
  }
1507
1524
  function Be(n) {
1508
1525
  if (!n) return null;
@@ -1512,10 +1529,10 @@ function Be(n) {
1512
1529
  const e = /* @__PURE__ */ new Date();
1513
1530
  return e.setTime(n), e;
1514
1531
  }
1515
- const b = n.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?/);
1516
- if (b) {
1532
+ const y = n.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?/);
1533
+ if (y) {
1517
1534
  const e = /* @__PURE__ */ new Date();
1518
- return e.setHours(parseInt(b[1]), parseInt(b[2]), b[3] ? parseInt(b[3]) : 0, 0), e;
1535
+ return e.setHours(parseInt(y[1]), parseInt(y[2]), y[3] ? parseInt(y[3]) : 0, 0), e;
1519
1536
  }
1520
1537
  const t = new Date(n);
1521
1538
  return isNaN(t.getTime()) ? null : t;
@@ -1537,61 +1554,61 @@ const xt = ["onClick"], wt = ["onClick"], Vt = ["onClick"], Ct = /* @__PURE__ */
1537
1554
  secondStep: { default: 1 }
1538
1555
  },
1539
1556
  emits: ["confirm", "cancel"],
1540
- setup(n, { emit: b }) {
1541
- const t = n, e = b, a = _("time-panel"), l = E(0), m = E(0), p = E(0), C = E(), x = E(), Y = E(), S = y(() => t.format.includes("ss") || t.format.includes("s")), V = y(() => {
1557
+ setup(n, { emit: y }) {
1558
+ const t = n, e = y, a = _("time-panel"), l = E(0), m = E(0), h = E(0), w = E(), V = E(), F = E(), $ = b(() => t.format.includes("ss") || t.format.includes("s")), k = b(() => {
1542
1559
  const H = [], te = Math.max(1, t.hourStep);
1543
- for (let N = 0; N < 24; N += te)
1544
- H.push(N);
1560
+ for (let X = 0; X < 24; X += te)
1561
+ H.push(X);
1545
1562
  return H;
1546
- }), $ = y(() => {
1563
+ }), D = b(() => {
1547
1564
  const H = [], te = Math.max(1, t.minuteStep);
1548
- for (let N = 0; N < 60; N += te)
1549
- H.push(N);
1565
+ for (let X = 0; X < 60; X += te)
1566
+ H.push(X);
1550
1567
  return H;
1551
- }), L = y(() => {
1568
+ }), A = b(() => {
1552
1569
  const H = [], te = Math.max(1, t.secondStep);
1553
- for (let N = 0; N < 60; N += te)
1554
- H.push(N);
1570
+ for (let X = 0; X < 60; X += te)
1571
+ H.push(X);
1555
1572
  return H;
1556
- }), v = y(() => t.disabledHours ? new Set(t.disabledHours()) : /* @__PURE__ */ new Set()), D = y(() => t.disabledMinutes ? new Set(t.disabledMinutes(l.value)) : /* @__PURE__ */ new Set()), R = y(() => t.disabledSeconds ? new Set(t.disabledSeconds(l.value, m.value)) : /* @__PURE__ */ new Set()), M = y(() => `${he(l.value)}:${he(m.value)}${S.value ? ":" + he(p.value) : ""}`), P = (H) => v.value.has(H), h = (H) => D.value.has(H), f = (H) => R.value.has(H), k = (H) => {
1557
- P(H) || (l.value = H, B(C.value, Z(H)));
1558
- }, W = (H) => {
1559
- h(H) || (m.value = H, B(x.value, ee(H)));
1560
- }, X = (H) => {
1561
- f(H) || (p.value = H, B(Y.value, T(H)));
1562
- }, Z = (H) => V.value.indexOf(H), ee = (H) => $.value.indexOf(H), T = (H) => L.value.indexOf(H), B = (H, te) => {
1573
+ }), f = b(() => t.disabledHours ? new Set(t.disabledHours()) : /* @__PURE__ */ new Set()), C = b(() => t.disabledMinutes ? new Set(t.disabledMinutes(l.value)) : /* @__PURE__ */ new Set()), R = b(() => t.disabledSeconds ? new Set(t.disabledSeconds(l.value, m.value)) : /* @__PURE__ */ new Set()), L = b(() => `${he(l.value)}:${he(m.value)}${$.value ? ":" + he(h.value) : ""}`), M = (H) => f.value.has(H), p = (H) => C.value.has(H), v = (H) => R.value.has(H), S = (H) => {
1574
+ M(H) || (l.value = H, B(w.value, q(H)));
1575
+ }, O = (H) => {
1576
+ p(H) || (m.value = H, B(V.value, ee(H)));
1577
+ }, N = (H) => {
1578
+ v(H) || (h.value = H, B(F.value, T(H)));
1579
+ }, q = (H) => k.value.indexOf(H), ee = (H) => D.value.indexOf(H), T = (H) => A.value.indexOf(H), B = (H, te) => {
1563
1580
  if (!H) return;
1564
- const N = 32, ye = te * N + 84 - 200 / 2 + N / 2;
1581
+ const X = 32, ye = te * X + 84 - 200 / 2 + X / 2;
1565
1582
  H.scrollTop = Math.max(0, ye);
1566
- }, w = () => {
1567
- if (!C.value) return;
1568
- const H = C.value.scrollTop, te = Math.round((H - 84 + 100) / 32), N = V.value[Math.max(0, Math.min(te, V.value.length - 1))];
1569
- N !== void 0 && !P(N) && (l.value = N);
1583
+ }, x = () => {
1584
+ if (!w.value) return;
1585
+ const H = w.value.scrollTop, te = Math.round((H - 84 + 100) / 32), X = k.value[Math.max(0, Math.min(te, k.value.length - 1))];
1586
+ X !== void 0 && !M(X) && (l.value = X);
1570
1587
  }, o = () => {
1571
- if (!x.value) return;
1572
- const H = x.value.scrollTop, te = Math.round((H - 84 + 100) / 32), N = $.value[Math.max(0, Math.min(te, $.value.length - 1))];
1573
- N !== void 0 && !h(N) && (m.value = N);
1588
+ if (!V.value) return;
1589
+ const H = V.value.scrollTop, te = Math.round((H - 84 + 100) / 32), X = D.value[Math.max(0, Math.min(te, D.value.length - 1))];
1590
+ X !== void 0 && !p(X) && (m.value = X);
1574
1591
  }, c = () => {
1575
- if (!Y.value) return;
1576
- const H = Y.value.scrollTop, te = Math.round((H - 84 + 100) / 32), N = L.value[Math.max(0, Math.min(te, L.value.length - 1))];
1577
- N !== void 0 && !f(N) && (p.value = N);
1592
+ if (!F.value) return;
1593
+ const H = F.value.scrollTop, te = Math.round((H - 84 + 100) / 32), X = A.value[Math.max(0, Math.min(te, A.value.length - 1))];
1594
+ X !== void 0 && !v(X) && (h.value = X);
1578
1595
  }, g = () => {
1579
1596
  const H = t.modelValue ? new Date(t.modelValue) : /* @__PURE__ */ new Date();
1580
- H.setHours(l.value, m.value, p.value, 0), e("confirm", H);
1581
- }, K = () => {
1597
+ H.setHours(l.value, m.value, h.value, 0), e("confirm", H);
1598
+ }, W = () => {
1582
1599
  e("cancel");
1583
1600
  }, le = () => {
1584
1601
  if (t.modelValue)
1585
- l.value = t.modelValue.getHours(), m.value = t.modelValue.getMinutes(), p.value = t.modelValue.getSeconds();
1602
+ l.value = t.modelValue.getHours(), m.value = t.modelValue.getMinutes(), h.value = t.modelValue.getSeconds();
1586
1603
  else {
1587
1604
  const H = /* @__PURE__ */ new Date();
1588
- l.value = H.getHours(), m.value = H.getMinutes(), p.value = H.getSeconds();
1605
+ l.value = H.getHours(), m.value = H.getMinutes(), h.value = H.getSeconds();
1589
1606
  }
1590
1607
  Se(() => {
1591
- B(C.value, Z(l.value)), B(x.value, ee(m.value)), S.value && B(Y.value, T(p.value));
1608
+ B(w.value, q(l.value)), B(V.value, ee(m.value)), $.value && B(F.value, T(h.value));
1592
1609
  });
1593
1610
  };
1594
- return ce(
1611
+ return ie(
1595
1612
  () => t.modelValue,
1596
1613
  () => {
1597
1614
  le();
@@ -1610,72 +1627,72 @@ const xt = ["onClick"], wt = ["onClick"], Vt = ["onClick"], Ct = /* @__PURE__ */
1610
1627
  }, null, 2),
1611
1628
  i("div", {
1612
1629
  ref_key: "hourListRef",
1613
- ref: C,
1630
+ ref: w,
1614
1631
  class: u(s(a).e("list")),
1615
- onScroll: w
1632
+ onScroll: x
1616
1633
  }, [
1617
1634
  i("div", {
1618
1635
  class: u(s(a).e("padding"))
1619
1636
  }, null, 2),
1620
- (r(!0), d(G, null, Q(V.value, (N) => (r(), d("div", {
1621
- key: N,
1622
- class: u([s(a).e("item"), s(a).is("selected", l.value === N), s(a).is("disabled", P(N))]),
1623
- onClick: (ve) => k(N)
1624
- }, z(s(he)(N)), 11, xt))), 128)),
1637
+ (r(!0), d(j, null, Q(k.value, (X) => (r(), d("div", {
1638
+ key: X,
1639
+ class: u([s(a).e("item"), s(a).is("selected", l.value === X), s(a).is("disabled", M(X))]),
1640
+ onClick: (ve) => S(X)
1641
+ }, z(s(he)(X)), 11, xt))), 128)),
1625
1642
  i("div", {
1626
1643
  class: u(s(a).e("padding"))
1627
1644
  }, null, 2)
1628
1645
  ], 34),
1629
1646
  i("div", {
1630
1647
  ref_key: "minuteListRef",
1631
- ref: x,
1648
+ ref: V,
1632
1649
  class: u(s(a).e("list")),
1633
1650
  onScroll: o
1634
1651
  }, [
1635
1652
  i("div", {
1636
1653
  class: u(s(a).e("padding"))
1637
1654
  }, null, 2),
1638
- (r(!0), d(G, null, Q($.value, (N) => (r(), d("div", {
1639
- key: N,
1640
- class: u([s(a).e("item"), s(a).is("selected", m.value === N), s(a).is("disabled", h(N))]),
1641
- onClick: (ve) => W(N)
1642
- }, z(s(he)(N)), 11, wt))), 128)),
1655
+ (r(!0), d(j, null, Q(D.value, (X) => (r(), d("div", {
1656
+ key: X,
1657
+ class: u([s(a).e("item"), s(a).is("selected", m.value === X), s(a).is("disabled", p(X))]),
1658
+ onClick: (ve) => O(X)
1659
+ }, z(s(he)(X)), 11, wt))), 128)),
1643
1660
  i("div", {
1644
1661
  class: u(s(a).e("padding"))
1645
1662
  }, null, 2)
1646
1663
  ], 34),
1647
- S.value ? (r(), d("div", {
1664
+ $.value ? (r(), d("div", {
1648
1665
  key: 0,
1649
1666
  ref_key: "secondListRef",
1650
- ref: Y,
1667
+ ref: F,
1651
1668
  class: u(s(a).e("list")),
1652
1669
  onScroll: c
1653
1670
  }, [
1654
1671
  i("div", {
1655
1672
  class: u(s(a).e("padding"))
1656
1673
  }, null, 2),
1657
- (r(!0), d(G, null, Q(L.value, (N) => (r(), d("div", {
1658
- key: N,
1659
- class: u([s(a).e("item"), s(a).is("selected", p.value === N), s(a).is("disabled", f(N))]),
1660
- onClick: (ve) => X(N)
1661
- }, z(s(he)(N)), 11, Vt))), 128)),
1674
+ (r(!0), d(j, null, Q(A.value, (X) => (r(), d("div", {
1675
+ key: X,
1676
+ class: u([s(a).e("item"), s(a).is("selected", h.value === X), s(a).is("disabled", v(X))]),
1677
+ onClick: (ve) => N(X)
1678
+ }, z(s(he)(X)), 11, Vt))), 128)),
1662
1679
  i("div", {
1663
1680
  class: u(s(a).e("padding"))
1664
1681
  }, null, 2)
1665
- ], 34)) : O("", !0)
1682
+ ], 34)) : U("", !0)
1666
1683
  ], 2),
1667
1684
  i("div", {
1668
1685
  class: u(s(a).e("footer"))
1669
1686
  }, [
1670
1687
  i("span", {
1671
1688
  class: u(s(a).e("current-time"))
1672
- }, z(M.value), 3),
1689
+ }, z(L.value), 3),
1673
1690
  i("div", {
1674
1691
  class: u(s(a).e("actions"))
1675
1692
  }, [
1676
1693
  i("button", {
1677
1694
  class: u(s(a).e("btn-cancel")),
1678
- onClick: K
1695
+ onClick: W
1679
1696
  }, "取消", 2),
1680
1697
  i("button", {
1681
1698
  class: u(s(a).e("btn-confirm")),
@@ -1708,136 +1725,136 @@ const xt = ["onClick"], wt = ["onClick"], Vt = ["onClick"], Ct = /* @__PURE__ */
1708
1725
  secondStep: { default: 1 }
1709
1726
  },
1710
1727
  emits: ["update:modelValue", "change", "focus", "blur", "clear"],
1711
- setup(n, { expose: b, emit: t }) {
1712
- const e = n, a = t, l = _("time-picker"), m = () => Ye().next(), p = E(!1), C = E(2e3), x = E(), Y = E(), S = E(), V = E({
1728
+ setup(n, { expose: y, emit: t }) {
1729
+ const e = n, a = t, l = _("time-picker"), m = () => Ye().next(), h = E(!1), w = E(2e3), V = E(), F = E(), $ = E(), k = E({
1713
1730
  top: "0px",
1714
1731
  left: "0px"
1715
- }), $ = E({
1732
+ }), D = E({
1716
1733
  startTime: null,
1717
1734
  endTime: null
1718
- }), L = E("start"), v = y(() => {
1735
+ }), A = E("start"), f = b(() => {
1719
1736
  if (!e.modelValue) return null;
1720
1737
  if (e.type === "timerange") {
1721
1738
  const [c, g] = e.modelValue;
1722
1739
  return [Be(c), Be(g)];
1723
1740
  }
1724
1741
  return Be(e.modelValue);
1725
- }), D = y(() => !v.value || Array.isArray(v.value) ? "" : pe(v.value, e.format)), R = y(() => {
1726
- if (!Array.isArray(v.value)) return "";
1727
- const [c] = v.value;
1742
+ }), C = b(() => !f.value || Array.isArray(f.value) ? "" : pe(f.value, e.format)), R = b(() => {
1743
+ if (!Array.isArray(f.value)) return "";
1744
+ const [c] = f.value;
1728
1745
  return c ? pe(c, e.format) : "";
1729
- }), M = y(() => {
1730
- if (!Array.isArray(v.value)) return "";
1731
- const [, c] = v.value;
1746
+ }), L = b(() => {
1747
+ if (!Array.isArray(f.value)) return "";
1748
+ const [, c] = f.value;
1732
1749
  return c ? pe(c, e.format) : "";
1733
- }), P = y(() => e.type === "timerange" ? L.value === "start" ? $.value.startTime : $.value.endTime || $.value.startTime : v.value), h = y(() => [
1750
+ }), M = b(() => e.type === "timerange" ? A.value === "start" ? D.value.startTime : D.value.endTime || D.value.startTime : f.value), p = b(() => [
1734
1751
  l.b(),
1735
1752
  l.m(e.size),
1736
1753
  l.is("disabled", e.disabled),
1737
1754
  l.is("range", e.type === "timerange")
1738
- ]), f = y(() => [
1755
+ ]), v = b(() => [
1739
1756
  l.e("input"),
1740
- l.is("focus", p.value)
1741
- ]), k = () => {
1742
- e.disabled || e.readonly || (p.value ? Z() : X());
1743
- }, W = (c) => {
1744
- e.disabled || e.readonly || (L.value = c, p.value || X());
1745
- }, X = () => {
1746
- p.value = !0, C.value = m(), Se(() => {
1747
- if (x.value && Y.value) {
1748
- const c = x.value.getBoundingClientRect(), g = Y.value.getBoundingClientRect();
1749
- let K = c.bottom + 8, le = c.left;
1750
- le + g.width > window.innerWidth && (le = window.innerWidth - g.width - 8), K + g.height > window.innerHeight && (K = c.top - g.height - 8), V.value = {
1751
- top: `${K}px`,
1757
+ l.is("focus", h.value)
1758
+ ]), S = () => {
1759
+ e.disabled || e.readonly || (h.value ? q() : N());
1760
+ }, O = (c) => {
1761
+ e.disabled || e.readonly || (A.value = c, h.value || N());
1762
+ }, N = () => {
1763
+ h.value = !0, w.value = m(), Se(() => {
1764
+ if (V.value && F.value) {
1765
+ const c = V.value.getBoundingClientRect(), g = F.value.getBoundingClientRect();
1766
+ let W = c.bottom + 8, le = c.left;
1767
+ le + g.width > window.innerWidth && (le = window.innerWidth - g.width - 8), W + g.height > window.innerHeight && (W = c.top - g.height - 8), k.value = {
1768
+ top: `${W}px`,
1752
1769
  left: `${le}px`
1753
1770
  };
1754
1771
  }
1755
1772
  }), a("focus", {});
1756
- }, Z = () => {
1757
- p.value = !1, a("blur", {});
1773
+ }, q = () => {
1774
+ h.value = !1, a("blur", {});
1758
1775
  }, ee = (c) => {
1759
1776
  if (e.type === "timerange")
1760
- if (L.value === "start")
1761
- $.value.startTime = c, L.value = "end", $.value.endTime && $.value.endTime < c && ($.value.endTime = null);
1777
+ if (A.value === "start")
1778
+ D.value.startTime = c, A.value = "end", D.value.endTime && D.value.endTime < c && (D.value.endTime = null);
1762
1779
  else {
1763
- $.value.startTime && c < $.value.startTime ? ($.value.endTime = $.value.startTime, $.value.startTime = c) : $.value.endTime = c;
1764
- const g = e.valueFormat ? pe($.value.startTime, e.valueFormat) : $.value.startTime, K = e.valueFormat ? pe($.value.endTime, e.valueFormat) : $.value.endTime;
1765
- a("update:modelValue", [g, K]), a("change", [g, K]), Z();
1780
+ D.value.startTime && c < D.value.startTime ? (D.value.endTime = D.value.startTime, D.value.startTime = c) : D.value.endTime = c;
1781
+ const g = e.valueFormat ? pe(D.value.startTime, e.valueFormat) : D.value.startTime, W = e.valueFormat ? pe(D.value.endTime, e.valueFormat) : D.value.endTime;
1782
+ a("update:modelValue", [g, W]), a("change", [g, W]), q();
1766
1783
  }
1767
1784
  else {
1768
1785
  const g = e.valueFormat ? pe(c, e.valueFormat) : c;
1769
- a("update:modelValue", g), a("change", g), Z();
1786
+ a("update:modelValue", g), a("change", g), q();
1770
1787
  }
1771
1788
  }, T = () => {
1772
- Z();
1789
+ q();
1773
1790
  }, B = () => {
1774
- a("update:modelValue", null), a("change", null), a("clear"), $.value = {
1791
+ a("update:modelValue", null), a("change", null), a("clear"), D.value = {
1775
1792
  startTime: null,
1776
1793
  endTime: null
1777
1794
  };
1778
- }, w = (c) => {
1779
- if (!x.value) return;
1795
+ }, x = (c) => {
1796
+ if (!V.value) return;
1780
1797
  const g = c.target;
1781
- x.value.contains(g) || Y.value && Y.value.contains(g) || Z();
1798
+ V.value.contains(g) || F.value && F.value.contains(g) || q();
1782
1799
  };
1783
- ce(
1800
+ ie(
1784
1801
  () => e.modelValue,
1785
1802
  (c) => {
1786
1803
  if (c && e.type === "timerange") {
1787
- const [g, K] = v.value;
1788
- $.value = {
1804
+ const [g, W] = f.value;
1805
+ D.value = {
1789
1806
  startTime: g,
1790
- endTime: K
1807
+ endTime: W
1791
1808
  };
1792
1809
  }
1793
1810
  },
1794
1811
  { immediate: !0 }
1795
- ), ce(p, (c) => {
1796
- c && e.type === "timerange" && ($.value = {
1797
- startTime: Array.isArray(v.value) ? v.value[0] : null,
1798
- endTime: Array.isArray(v.value) ? v.value[1] : null
1799
- }, L.value = "start");
1812
+ ), ie(h, (c) => {
1813
+ c && e.type === "timerange" && (D.value = {
1814
+ startTime: Array.isArray(f.value) ? f.value[0] : null,
1815
+ endTime: Array.isArray(f.value) ? f.value[1] : null
1816
+ }, A.value = "start");
1800
1817
  });
1801
1818
  const o = (c) => {
1802
- c.key === "Escape" && Z();
1819
+ c.key === "Escape" && q();
1803
1820
  };
1804
1821
  return xe(() => {
1805
- document.addEventListener("click", w), document.addEventListener("keydown", o);
1822
+ document.addEventListener("click", x), document.addEventListener("keydown", o);
1806
1823
  }), we(() => {
1807
- document.removeEventListener("click", w), document.removeEventListener("keydown", o);
1808
- }), b({
1824
+ document.removeEventListener("click", x), document.removeEventListener("keydown", o);
1825
+ }), y({
1809
1826
  focus: () => {
1810
1827
  var c;
1811
- return (c = S.value) == null ? void 0 : c.focus();
1828
+ return (c = $.value) == null ? void 0 : c.focus();
1812
1829
  },
1813
1830
  blur: () => {
1814
1831
  var c;
1815
- return (c = S.value) == null ? void 0 : c.blur();
1832
+ return (c = $.value) == null ? void 0 : c.blur();
1816
1833
  }
1817
1834
  }), (c, g) => (r(), d("div", {
1818
1835
  ref_key: "pickerRef",
1819
- ref: x,
1820
- class: u(h.value)
1836
+ ref: V,
1837
+ class: u(p.value)
1821
1838
  }, [
1822
1839
  n.type !== "timerange" ? (r(), d("div", {
1823
1840
  key: 0,
1824
- class: u(f.value),
1825
- onClick: k
1841
+ class: u(v.value),
1842
+ onClick: S
1826
1843
  }, [
1827
1844
  i("input", {
1828
1845
  ref_key: "inputRef",
1829
- ref: S,
1846
+ ref: $,
1830
1847
  type: "text",
1831
1848
  placeholder: n.placeholder,
1832
1849
  disabled: n.disabled,
1833
1850
  readonly: !0,
1834
- value: D.value,
1851
+ value: C.value,
1835
1852
  class: u(s(l).e("input-inner"))
1836
1853
  }, null, 10, Dt),
1837
1854
  i("span", {
1838
1855
  class: u(s(l).e("suffix"))
1839
1856
  }, [
1840
- n.clearable && D.value && !n.disabled ? (r(), d("span", {
1857
+ n.clearable && C.value && !n.disabled ? (r(), d("span", {
1841
1858
  key: 0,
1842
1859
  class: u(s(l).e("clear")),
1843
1860
  onClick: oe(B, ["stop"])
@@ -1848,8 +1865,8 @@ const xt = ["onClick"], wt = ["onClick"], Vt = ["onClick"], Ct = /* @__PURE__ */
1848
1865
  ], 2)
1849
1866
  ], 2)) : (r(), d("div", {
1850
1867
  key: 1,
1851
- class: u(f.value),
1852
- onClick: k
1868
+ class: u(v.value),
1869
+ onClick: S
1853
1870
  }, [
1854
1871
  i("input", {
1855
1872
  type: "text",
@@ -1857,8 +1874,8 @@ const xt = ["onClick"], wt = ["onClick"], Vt = ["onClick"], Ct = /* @__PURE__ */
1857
1874
  disabled: n.disabled,
1858
1875
  readonly: !0,
1859
1876
  value: R.value,
1860
- class: u([s(l).e("input-inner"), s(l).is("active", L.value === "start")]),
1861
- onClick: g[0] || (g[0] = oe((K) => W("start"), ["stop"]))
1877
+ class: u([s(l).e("input-inner"), s(l).is("active", A.value === "start")]),
1878
+ onClick: g[0] || (g[0] = oe((W) => O("start"), ["stop"]))
1862
1879
  }, null, 10, $t),
1863
1880
  i("span", {
1864
1881
  class: u(s(l).e("separator"))
@@ -1868,14 +1885,14 @@ const xt = ["onClick"], wt = ["onClick"], Vt = ["onClick"], Ct = /* @__PURE__ */
1868
1885
  placeholder: n.endPlaceholder,
1869
1886
  disabled: n.disabled,
1870
1887
  readonly: !0,
1871
- value: M.value,
1872
- class: u([s(l).e("input-inner"), s(l).is("active", L.value === "end")]),
1873
- onClick: g[1] || (g[1] = oe((K) => W("end"), ["stop"]))
1888
+ value: L.value,
1889
+ class: u([s(l).e("input-inner"), s(l).is("active", A.value === "end")]),
1890
+ onClick: g[1] || (g[1] = oe((W) => O("end"), ["stop"]))
1874
1891
  }, null, 10, St),
1875
1892
  i("span", {
1876
1893
  class: u(s(l).e("suffix"))
1877
1894
  }, [
1878
- n.clearable && (R.value || M.value) && !n.disabled ? (r(), d("span", {
1895
+ n.clearable && (R.value || L.value) && !n.disabled ? (r(), d("span", {
1879
1896
  key: 0,
1880
1897
  class: u(s(l).e("clear")),
1881
1898
  onClick: oe(B, ["stop"])
@@ -1890,16 +1907,16 @@ const xt = ["onClick"], wt = ["onClick"], Vt = ["onClick"], Ct = /* @__PURE__ */
1890
1907
  default: Pe(() => [
1891
1908
  ue(i("div", {
1892
1909
  ref_key: "popperRef",
1893
- ref: Y,
1910
+ ref: F,
1894
1911
  class: u(s(l).e("popper")),
1895
- style: ne({ zIndex: C.value, ...V.value })
1912
+ style: ne({ zIndex: w.value, ...k.value })
1896
1913
  }, [
1897
1914
  n.type === "timerange" ? (r(), d("div", {
1898
1915
  key: 0,
1899
1916
  class: u(s(l).e("popper-header"))
1900
- }, z(L.value === "start" ? "请选择开始时间" : "请选择结束时间"), 3)) : O("", !0),
1917
+ }, z(A.value === "start" ? "请选择开始时间" : "请选择结束时间"), 3)) : U("", !0),
1901
1918
  Ce(Ct, {
1902
- "model-value": P.value,
1919
+ "model-value": M.value,
1903
1920
  format: n.format,
1904
1921
  "disabled-hours": n.disabledHours,
1905
1922
  "disabled-minutes": n.disabledMinutes,
@@ -1911,7 +1928,7 @@ const xt = ["onClick"], wt = ["onClick"], Vt = ["onClick"], Ct = /* @__PURE__ */
1911
1928
  onCancel: T
1912
1929
  }, null, 8, ["model-value", "format", "disabled-hours", "disabled-minutes", "disabled-seconds", "hour-step", "minute-step", "second-step"])
1913
1930
  ], 6), [
1914
- [Ae, p.value]
1931
+ [Ae, h.value]
1915
1932
  ])
1916
1933
  ]),
1917
1934
  _: 1
@@ -1920,28 +1937,28 @@ const xt = ["onClick"], wt = ["onClick"], Vt = ["onClick"], Ct = /* @__PURE__ */
1920
1937
  ], 2));
1921
1938
  }
1922
1939
  });
1923
- function Mt(n, b, t) {
1924
- return t ? t(b, n) : n.toLowerCase().includes(b.toLowerCase());
1940
+ function Mt(n, y, t) {
1941
+ return t ? t(y, n) : n.toLowerCase().includes(y.toLowerCase());
1925
1942
  }
1926
- function Oe(n, b, t = "value", e = "children") {
1943
+ function Oe(n, y, t = "value", e = "children") {
1927
1944
  for (const a of n) {
1928
- if (a[t] === b)
1945
+ if (a[t] === y)
1929
1946
  return a;
1930
1947
  if (a[e] && a[e].length > 0) {
1931
- const l = Oe(a[e], b, t, e);
1948
+ const l = Oe(a[e], y, t, e);
1932
1949
  if (l) return l;
1933
1950
  }
1934
1951
  }
1935
1952
  return null;
1936
1953
  }
1937
- function Fe(n, b, t = "value", e = "children") {
1954
+ function Fe(n, y, t = "value", e = "children") {
1938
1955
  const a = [];
1939
1956
  function l(m) {
1940
- for (const p of m) {
1941
- if (p[t] === b)
1942
- return a.push(p), !0;
1943
- if (p[e] && p[e].length > 0) {
1944
- if (a.push(p), l(p[e]))
1957
+ for (const h of m) {
1958
+ if (h[t] === y)
1959
+ return a.push(h), !0;
1960
+ if (h[e] && h[e].length > 0) {
1961
+ if (a.push(h), l(h[e]))
1945
1962
  return !0;
1946
1963
  a.pop();
1947
1964
  }
@@ -1950,11 +1967,11 @@ function Fe(n, b, t = "value", e = "children") {
1950
1967
  }
1951
1968
  return l(n), a;
1952
1969
  }
1953
- function Tt(n, b = "children") {
1970
+ function Tt(n, y = "children") {
1954
1971
  const t = [];
1955
1972
  function e(a, l = 0, m = null) {
1956
- for (const p of a)
1957
- t.push({ ...p, level: l, parent: m }), p[b] && p[b].length > 0 && e(p[b], l + 1, p);
1973
+ for (const h of a)
1974
+ t.push({ ...h, level: l, parent: m }), h[y] && h[y].length > 0 && e(h[y], l + 1, h);
1958
1975
  }
1959
1976
  return e(n), t;
1960
1977
  }
@@ -1983,165 +2000,165 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
1983
2000
  noMatchText: { default: "无匹配数据" }
1984
2001
  },
1985
2002
  emits: ["update:modelValue", "update:value", "change", "clear", "focus", "blur", "visible-change", "remove-tag"],
1986
- setup(n, { emit: b }) {
1987
- const t = n, e = b, a = _("select"), l = () => Ye().next(), m = E(), p = E(), C = E(), x = E(!1), Y = E(2e3), S = E(""), V = E(-1), $ = E({ top: "0px", left: "0px" }), L = y(() => t.type === "multiple"), v = y(() => t.type === "cascader"), D = E([]), R = () => t.modelValue !== void 0 ? t.modelValue : t.value !== void 0 ? t.value : "", M = (A) => {
1988
- t.modelValue !== void 0 && e("update:modelValue", A), t.value !== void 0 && e("update:value", A), t.modelValue === void 0 && t.value === void 0 && e("update:modelValue", A), e("change", A);
1989
- }, P = y(() => {
1990
- const A = R();
1991
- return L.value ? Array.isArray(A) ? A : [] : v.value ? Array.isArray(A) ? A : A ? [A] : [] : A !== "" && A !== null && A !== void 0 ? [A] : [];
1992
- }), h = y(() => v.value ? Tt(t.options, t.childrenKey) : t.options.map((A) => ({ ...A, level: 0 }))), f = y(() => !t.filterable || !S.value ? h.value : h.value.filter((A) => {
1993
- const q = A[t.labelKey] || "";
1994
- return Mt(q, S.value, t.filterMethod);
1995
- })), k = y(() => {
1996
- const A = [];
1997
- for (const q of P.value) {
1998
- const j = Oe(t.options, q, t.valueKey, t.childrenKey);
1999
- j && A.push(j);
2003
+ setup(n, { emit: y }) {
2004
+ const t = n, e = y, a = _("select"), l = () => Ye().next(), m = E(), h = E(), w = E(), V = E(!1), F = E(2e3), $ = E(""), k = E(-1), D = E({ top: "0px", left: "0px" }), A = b(() => t.type === "multiple"), f = b(() => t.type === "cascader"), C = E([]), R = () => t.modelValue !== void 0 ? t.modelValue : t.value !== void 0 ? t.value : "", L = (Y) => {
2005
+ t.modelValue !== void 0 && e("update:modelValue", Y), t.value !== void 0 && e("update:value", Y), t.modelValue === void 0 && t.value === void 0 && e("update:modelValue", Y), e("change", Y);
2006
+ }, M = b(() => {
2007
+ const Y = R();
2008
+ return A.value ? Array.isArray(Y) ? Y : [] : f.value ? Array.isArray(Y) ? Y : Y ? [Y] : [] : Y !== "" && Y !== null && Y !== void 0 ? [Y] : [];
2009
+ }), p = b(() => f.value ? Tt(t.options, t.childrenKey) : t.options.map((Y) => ({ ...Y, level: 0 }))), v = b(() => !t.filterable || !$.value ? p.value : p.value.filter((Y) => {
2010
+ const G = Y[t.labelKey] || "";
2011
+ return Mt(G, $.value, t.filterMethod);
2012
+ })), S = b(() => {
2013
+ const Y = [];
2014
+ for (const G of M.value) {
2015
+ const Z = Oe(t.options, G, t.valueKey, t.childrenKey);
2016
+ Z && Y.push(Z);
2000
2017
  }
2001
- return A;
2002
- }), W = y(() => {
2003
- if (L.value)
2018
+ return Y;
2019
+ }), O = b(() => {
2020
+ if (A.value)
2004
2021
  return "";
2005
- if (v.value)
2006
- return Fe(t.options, P.value[P.value.length - 1], t.valueKey, t.childrenKey).map((j) => j[t.labelKey]).join(t.separator);
2007
- const A = k.value[0];
2008
- return A ? A[t.labelKey] : "";
2009
- }), X = y(() => L.value ? k.value : []), Z = y(() => t.collapseTags ? X.value.slice(0, t.maxCollapseTags) : X.value), ee = y(() => t.collapseTags ? Math.max(0, X.value.length - t.maxCollapseTags) : 0), T = y(() => [
2022
+ if (f.value)
2023
+ return Fe(t.options, M.value[M.value.length - 1], t.valueKey, t.childrenKey).map((Z) => Z[t.labelKey]).join(t.separator);
2024
+ const Y = S.value[0];
2025
+ return Y ? Y[t.labelKey] : "";
2026
+ }), N = b(() => A.value ? S.value : []), q = b(() => t.collapseTags ? N.value.slice(0, t.maxCollapseTags) : N.value), ee = b(() => t.collapseTags ? Math.max(0, N.value.length - t.maxCollapseTags) : 0), T = b(() => [
2010
2027
  a.b(),
2011
2028
  a.m(t.size),
2012
2029
  a.is("disabled", t.disabled),
2013
- a.is("multiple", L.value),
2014
- a.is("cascader", v.value),
2030
+ a.is("multiple", A.value),
2031
+ a.is("cascader", f.value),
2015
2032
  a.is("filterable", t.filterable),
2016
- a.is("focus", x.value)
2033
+ a.is("focus", V.value)
2017
2034
  ]), B = () => {
2018
- if (!m.value || !C.value || !x.value) return;
2019
- const A = m.value.getBoundingClientRect(), q = C.value.getBoundingClientRect();
2020
- let j = A.bottom + 4, se = A.left;
2021
- se + q.width > window.innerWidth && (se = window.innerWidth - q.width - 8), j + q.height > window.innerHeight && (j = A.top - q.height - 4), $.value = {
2022
- top: `${j}px`,
2035
+ if (!m.value || !w.value || !V.value) return;
2036
+ const Y = m.value.getBoundingClientRect(), G = w.value.getBoundingClientRect();
2037
+ let Z = Y.bottom + 4, se = Y.left;
2038
+ se + G.width > window.innerWidth && (se = window.innerWidth - G.width - 8), Z + G.height > window.innerHeight && (Z = Y.top - G.height - 4), D.value = {
2039
+ top: `${Z}px`,
2023
2040
  left: `${se}px`
2024
2041
  };
2025
- }, w = () => {
2026
- t.disabled || (x.value = !0, Y.value = l(), S.value = "", Se(() => {
2042
+ }, x = () => {
2043
+ t.disabled || (V.value = !0, F.value = l(), $.value = "", Se(() => {
2027
2044
  B();
2028
2045
  }), e("visible-change", !0), e("focus", {}));
2029
2046
  }, o = () => {
2030
- x.value = !1, S.value = "", D.value = [], e("visible-change", !1), e("blur", {});
2031
- }, c = (A) => {
2032
- if (!A.disabled)
2033
- if (L.value) {
2034
- const q = [...P.value], j = A[t.valueKey], se = q.indexOf(j);
2047
+ V.value = !1, $.value = "", C.value = [], e("visible-change", !1), e("blur", {});
2048
+ }, c = (Y) => {
2049
+ if (!Y.disabled)
2050
+ if (A.value) {
2051
+ const G = [...M.value], Z = Y[t.valueKey], se = G.indexOf(Z);
2035
2052
  if (se > -1)
2036
- q.splice(se, 1), e("remove-tag", j);
2053
+ G.splice(se, 1), e("remove-tag", Z);
2037
2054
  else {
2038
- if (t.multipleLimit > 0 && q.length >= t.multipleLimit)
2055
+ if (t.multipleLimit > 0 && G.length >= t.multipleLimit)
2039
2056
  return;
2040
- q.push(j);
2057
+ G.push(Z);
2041
2058
  }
2042
- M(q);
2043
- } else if (v.value)
2044
- if (A.children && A.children.length > 0) {
2045
- const q = Fe(t.options, A[t.valueKey], t.valueKey, t.childrenKey);
2046
- D.value = q;
2059
+ L(G);
2060
+ } else if (f.value)
2061
+ if (Y.children && Y.children.length > 0) {
2062
+ const G = Fe(t.options, Y[t.valueKey], t.valueKey, t.childrenKey);
2063
+ C.value = G;
2047
2064
  } else {
2048
- const j = Fe(t.options, A[t.valueKey], t.valueKey, t.childrenKey).map((se) => se[t.valueKey]);
2049
- M(j), o();
2065
+ const Z = Fe(t.options, Y[t.valueKey], t.valueKey, t.childrenKey).map((se) => se[t.valueKey]);
2066
+ L(Z), o();
2050
2067
  }
2051
2068
  else
2052
- M(A[t.valueKey]), o();
2053
- }, g = (A) => {
2054
- const q = P.value.filter((j) => j !== A[t.valueKey]);
2055
- M(q), e("remove-tag", A[t.valueKey]);
2056
- }, K = () => {
2057
- const A = L.value ? [] : "";
2058
- M(A), e("clear");
2059
- }, le = (A) => {
2060
- S.value = A.target.value;
2061
- }, H = (A) => {
2069
+ L(Y[t.valueKey]), o();
2070
+ }, g = (Y) => {
2071
+ const G = M.value.filter((Z) => Z !== Y[t.valueKey]);
2072
+ L(G), e("remove-tag", Y[t.valueKey]);
2073
+ }, W = () => {
2074
+ const Y = A.value ? [] : "";
2075
+ L(Y), e("clear");
2076
+ }, le = (Y) => {
2077
+ $.value = Y.target.value;
2078
+ }, H = (Y) => {
2062
2079
  if (!m.value) return;
2063
- const q = A.target;
2064
- m.value.contains(q) || C.value && C.value.contains(q) || o();
2065
- }, te = (A) => {
2066
- if (A.key === "Escape")
2080
+ const G = Y.target;
2081
+ m.value.contains(G) || w.value && w.value.contains(G) || o();
2082
+ }, te = (Y) => {
2083
+ if (Y.key === "Escape")
2067
2084
  o();
2068
- else if (A.key === "Enter" && x.value) {
2069
- const q = f.value[V.value];
2070
- q && c(q);
2071
- } else A.key === "ArrowDown" && x.value ? (A.preventDefault(), V.value = Math.min(V.value + 1, f.value.length - 1)) : A.key === "ArrowUp" && x.value && (A.preventDefault(), V.value = Math.max(V.value - 1, 0));
2072
- }, N = (A) => P.value.includes(A[t.valueKey]), ve = (A, q) => [
2085
+ else if (Y.key === "Enter" && V.value) {
2086
+ const G = v.value[k.value];
2087
+ G && c(G);
2088
+ } else Y.key === "ArrowDown" && V.value ? (Y.preventDefault(), k.value = Math.min(k.value + 1, v.value.length - 1)) : Y.key === "ArrowUp" && V.value && (Y.preventDefault(), k.value = Math.max(k.value - 1, 0));
2089
+ }, X = (Y) => M.value.includes(Y[t.valueKey]), ve = (Y, G) => [
2073
2090
  a.e("option"),
2074
- a.is("selected", N(A)),
2075
- a.is("disabled", A.disabled === !0),
2076
- a.is("hover", V.value === q),
2077
- a.is("group", !!(A.children && A.children.length > 0))
2078
- ], ye = y(() => {
2079
- if (!v.value) return [];
2080
- const A = [t.options];
2081
- for (const q of D.value)
2082
- q.children && q.children.length > 0 && A.push(q.children);
2083
- return A;
2091
+ a.is("selected", X(Y)),
2092
+ a.is("disabled", Y.disabled === !0),
2093
+ a.is("hover", k.value === G),
2094
+ a.is("group", !!(Y.children && Y.children.length > 0))
2095
+ ], ye = b(() => {
2096
+ if (!f.value) return [];
2097
+ const Y = [t.options];
2098
+ for (const G of C.value)
2099
+ G.children && G.children.length > 0 && Y.push(G.children);
2100
+ return Y;
2084
2101
  });
2085
2102
  return xe(() => {
2086
2103
  document.addEventListener("click", H), document.addEventListener("keydown", te);
2087
2104
  }), we(() => {
2088
2105
  document.removeEventListener("click", H), document.removeEventListener("keydown", te), document.removeEventListener("scroll", B, !0);
2089
- }), ce(x, (A) => {
2090
- A ? document.addEventListener("scroll", B, !0) : document.removeEventListener("scroll", B, !0);
2106
+ }), ie(V, (Y) => {
2107
+ Y ? document.addEventListener("scroll", B, !0) : document.removeEventListener("scroll", B, !0);
2091
2108
  }), $e("select", {
2092
- selectedValues: P,
2109
+ selectedValues: M,
2093
2110
  handleSelect: c,
2094
- isSelected: N
2095
- }), (A, q) => (r(), d("div", {
2111
+ isSelected: X
2112
+ }), (Y, G) => (r(), d("div", {
2096
2113
  ref_key: "selectRef",
2097
2114
  ref: m,
2098
2115
  class: u(T.value)
2099
2116
  }, [
2100
2117
  i("div", {
2101
2118
  class: u(s(a).e("wrapper")),
2102
- onClick: q[0] || (q[0] = (j) => x.value ? o() : w())
2119
+ onClick: G[0] || (G[0] = (Z) => V.value ? o() : x())
2103
2120
  }, [
2104
- L.value && X.value.length > 0 ? (r(), d("div", {
2121
+ A.value && N.value.length > 0 ? (r(), d("div", {
2105
2122
  key: 0,
2106
2123
  class: u(s(a).e("tags"))
2107
2124
  }, [
2108
- (r(!0), d(G, null, Q(Z.value, (j) => (r(), d("span", {
2109
- key: j[n.valueKey],
2125
+ (r(!0), d(j, null, Q(q.value, (Z) => (r(), d("span", {
2126
+ key: Z[n.valueKey],
2110
2127
  class: u(s(a).e("tag"))
2111
2128
  }, [
2112
2129
  i("span", {
2113
2130
  class: u(s(a).e("tag-text"))
2114
- }, z(j[n.labelKey]), 3),
2131
+ }, z(Z[n.labelKey]), 3),
2115
2132
  i("span", {
2116
2133
  class: u(s(a).e("tag-close")),
2117
- onClick: oe((se) => g(j), ["stop"])
2134
+ onClick: oe((se) => g(Z), ["stop"])
2118
2135
  }, "×", 10, Rt)
2119
2136
  ], 2))), 128)),
2120
2137
  ee.value > 0 ? (r(), d("span", {
2121
2138
  key: 0,
2122
2139
  class: u(s(a).e("tag-count"))
2123
- }, " +" + z(ee.value), 3)) : O("", !0)
2124
- ], 2)) : O("", !0),
2140
+ }, " +" + z(ee.value), 3)) : U("", !0)
2141
+ ], 2)) : U("", !0),
2125
2142
  i("input", {
2126
2143
  ref_key: "inputRef",
2127
- ref: p,
2144
+ ref: h,
2128
2145
  class: u(s(a).e("input")),
2129
- placeholder: L.value && X.value.length > 0 ? "" : n.placeholder,
2146
+ placeholder: A.value && N.value.length > 0 ? "" : n.placeholder,
2130
2147
  disabled: n.disabled,
2131
- readonly: !n.filterable || !x.value,
2132
- value: n.filterable && x.value ? S.value : W.value,
2148
+ readonly: !n.filterable || !V.value,
2149
+ value: n.filterable && V.value ? $.value : O.value,
2133
2150
  onInput: le
2134
2151
  }, null, 42, Bt),
2135
2152
  i("span", {
2136
2153
  class: u(s(a).e("suffix"))
2137
2154
  }, [
2138
- n.clearable && P.value.length > 0 && !n.disabled ? (r(), d("span", {
2155
+ n.clearable && M.value.length > 0 && !n.disabled ? (r(), d("span", {
2139
2156
  key: 0,
2140
2157
  class: u(s(a).e("clear")),
2141
- onClick: oe(K, ["stop"])
2158
+ onClick: oe(W, ["stop"])
2142
2159
  }, "×", 2)) : (r(), d("span", {
2143
2160
  key: 1,
2144
- class: u([s(a).e("arrow"), s(a).is("reverse", x.value)])
2161
+ class: u([s(a).e("arrow"), s(a).is("reverse", V.value)])
2145
2162
  }, "▼", 2))
2146
2163
  ], 2)
2147
2164
  ], 2),
@@ -2150,57 +2167,57 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2150
2167
  default: Pe(() => [
2151
2168
  ue(i("div", {
2152
2169
  ref_key: "popperRef",
2153
- ref: C,
2154
- class: u([s(a).e("popper"), s(a).is("cascader", v.value)]),
2155
- style: ne({ zIndex: Y.value, ...$.value })
2170
+ ref: w,
2171
+ class: u([s(a).e("popper"), s(a).is("cascader", f.value)]),
2172
+ style: ne({ zIndex: F.value, ...D.value })
2156
2173
  }, [
2157
- v.value ? (r(), d("div", {
2174
+ f.value ? (r(), d("div", {
2158
2175
  key: 0,
2159
2176
  class: u(s(a).e("cascader-panels"))
2160
2177
  }, [
2161
- (r(!0), d(G, null, Q(ye.value, (j, se) => (r(), d("div", {
2178
+ (r(!0), d(j, null, Q(ye.value, (Z, se) => (r(), d("div", {
2162
2179
  key: se,
2163
2180
  class: u(s(a).e("cascader-panel"))
2164
2181
  }, [
2165
- (r(!0), d(G, null, Q(j, (ie, Ve) => (r(), d("div", {
2166
- key: ie[n.valueKey],
2167
- class: u(ve(ie, Ve)),
2168
- onClick: (Me) => c(ie)
2182
+ (r(!0), d(j, null, Q(Z, (re, Ve) => (r(), d("div", {
2183
+ key: re[n.valueKey],
2184
+ class: u(ve(re, Ve)),
2185
+ onClick: (Me) => c(re)
2169
2186
  }, [
2170
2187
  i("span", {
2171
2188
  class: u(s(a).e("option-label"))
2172
- }, z(ie[n.labelKey]), 3),
2173
- ie.children && ie.children.length > 0 ? (r(), d("span", {
2189
+ }, z(re[n.labelKey]), 3),
2190
+ re.children && re.children.length > 0 ? (r(), d("span", {
2174
2191
  key: 0,
2175
2192
  class: u(s(a).e("option-arrow"))
2176
- }, "›", 2)) : O("", !0)
2193
+ }, "›", 2)) : U("", !0)
2177
2194
  ], 10, Ft))), 128))
2178
2195
  ], 2))), 128))
2179
- ], 2)) : (r(), d(G, { key: 1 }, [
2180
- f.value.length === 0 ? (r(), d("div", {
2196
+ ], 2)) : (r(), d(j, { key: 1 }, [
2197
+ v.value.length === 0 ? (r(), d("div", {
2181
2198
  key: 0,
2182
2199
  class: u(s(a).e("empty"))
2183
- }, z(S.value ? n.noMatchText : n.noDataText), 3)) : (r(), d("div", {
2200
+ }, z($.value ? n.noMatchText : n.noDataText), 3)) : (r(), d("div", {
2184
2201
  key: 1,
2185
2202
  class: u(s(a).e("options"))
2186
2203
  }, [
2187
- (r(!0), d(G, null, Q(f.value, (j, se) => (r(), d("div", {
2188
- key: j[n.valueKey],
2189
- class: u(ve(j, se)),
2190
- onClick: (ie) => c(j)
2204
+ (r(!0), d(j, null, Q(v.value, (Z, se) => (r(), d("div", {
2205
+ key: Z[n.valueKey],
2206
+ class: u(ve(Z, se)),
2207
+ onClick: (re) => c(Z)
2191
2208
  }, [
2192
2209
  i("span", {
2193
2210
  class: u(s(a).e("option-label"))
2194
- }, z(j[n.labelKey]), 3),
2195
- N(j) ? (r(), d("span", {
2211
+ }, z(Z[n.labelKey]), 3),
2212
+ X(Z) ? (r(), d("span", {
2196
2213
  key: 0,
2197
2214
  class: u(s(a).e("option-check"))
2198
- }, "✓", 2)) : O("", !0)
2215
+ }, "✓", 2)) : U("", !0)
2199
2216
  ], 10, It))), 128))
2200
2217
  ], 2))
2201
2218
  ], 64))
2202
2219
  ], 6), [
2203
- [Ae, x.value]
2220
+ [Ae, V.value]
2204
2221
  ])
2205
2222
  ]),
2206
2223
  _: 1
@@ -2225,56 +2242,56 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2225
2242
  rightDefaultChecked: { default: () => [] }
2226
2243
  },
2227
2244
  emits: ["update:modelValue", "change", "left-check-change", "right-check-change"],
2228
- setup(n, { expose: b, emit: t }) {
2229
- const e = n, a = t, l = _("transfer"), m = y(() => {
2245
+ setup(n, { expose: y, emit: t }) {
2246
+ const e = n, a = t, l = _("transfer"), m = b(() => {
2230
2247
  var o;
2231
2248
  return ((o = e.props) == null ? void 0 : o.key) || "key";
2232
- }), p = y(() => {
2249
+ }), h = b(() => {
2233
2250
  var o;
2234
2251
  return ((o = e.props) == null ? void 0 : o.label) || "label";
2235
- }), C = y(() => {
2252
+ }), w = b(() => {
2236
2253
  var o;
2237
2254
  return ((o = e.props) == null ? void 0 : o.disabled) || "disabled";
2238
- }), x = E(""), Y = E(""), S = E([]), V = E([]), $ = (o) => o[m.value], L = (o) => o[p.value], v = (o) => o[C.value] || !1, D = y(() => e.data.filter((o) => {
2239
- const c = $(o);
2240
- return e.modelValue.includes(c) ? !1 : e.filterable && x.value ? e.filterMethod ? e.filterMethod(x.value, o) : L(o).toLowerCase().includes(x.value.toLowerCase()) : !0;
2241
- })), R = y(() => {
2255
+ }), V = E(""), F = E(""), $ = E([]), k = E([]), D = (o) => o[m.value], A = (o) => o[h.value], f = (o) => o[w.value] || !1, C = b(() => e.data.filter((o) => {
2256
+ const c = D(o);
2257
+ return e.modelValue.includes(c) ? !1 : e.filterable && V.value ? e.filterMethod ? e.filterMethod(V.value, o) : A(o).toLowerCase().includes(V.value.toLowerCase()) : !0;
2258
+ })), R = b(() => {
2242
2259
  const o = e.modelValue;
2243
2260
  let c = e.data.filter((g) => {
2244
- const K = $(g);
2245
- return o.includes(K);
2261
+ const W = D(g);
2262
+ return o.includes(W);
2246
2263
  });
2247
- return e.filterable && Y.value && (c = c.filter((g) => e.filterMethod ? e.filterMethod(Y.value, g) : L(g).toLowerCase().includes(Y.value.toLowerCase()))), e.targetOrder === "push" ? c.sort((g, K) => o.indexOf($(g)) - o.indexOf($(K))) : e.targetOrder === "unshift" ? c.sort((g, K) => o.indexOf($(K)) - o.indexOf($(g))) : c;
2248
- }), M = y(() => D.value.filter((o) => S.value.includes($(o))).every((o) => v(o))), P = y(() => R.value.filter((o) => V.value.includes($(o))).every((o) => v(o))), h = y(() => S.value.length === 0 || M.value), f = y(() => V.value.length === 0 || P.value), k = () => {
2249
- const o = S.value.filter((g) => {
2250
- const K = e.data.find((le) => $(le) === g);
2251
- return K && !v(K);
2264
+ return e.filterable && F.value && (c = c.filter((g) => e.filterMethod ? e.filterMethod(F.value, g) : A(g).toLowerCase().includes(F.value.toLowerCase()))), e.targetOrder === "push" ? c.sort((g, W) => o.indexOf(D(g)) - o.indexOf(D(W))) : e.targetOrder === "unshift" ? c.sort((g, W) => o.indexOf(D(W)) - o.indexOf(D(g))) : c;
2265
+ }), L = b(() => C.value.filter((o) => $.value.includes(D(o))).every((o) => f(o))), M = b(() => R.value.filter((o) => k.value.includes(D(o))).every((o) => f(o))), p = b(() => $.value.length === 0 || L.value), v = b(() => k.value.length === 0 || M.value), S = () => {
2266
+ const o = $.value.filter((g) => {
2267
+ const W = e.data.find((le) => D(le) === g);
2268
+ return W && !f(W);
2252
2269
  });
2253
2270
  let c;
2254
- e.targetOrder === "unshift" ? c = [...o, ...e.modelValue] : c = [...e.modelValue, ...o], a("update:modelValue", c), a("change", c, "right", o), S.value = [];
2255
- }, W = () => {
2256
- const o = V.value.filter((g) => {
2257
- const K = e.data.find((le) => $(le) === g);
2258
- return K && !v(K);
2271
+ e.targetOrder === "unshift" ? c = [...o, ...e.modelValue] : c = [...e.modelValue, ...o], a("update:modelValue", c), a("change", c, "right", o), $.value = [];
2272
+ }, O = () => {
2273
+ const o = k.value.filter((g) => {
2274
+ const W = e.data.find((le) => D(le) === g);
2275
+ return W && !f(W);
2259
2276
  }), c = e.modelValue.filter((g) => !o.includes(g));
2260
- a("update:modelValue", c), a("change", c, "left", o), V.value = [];
2261
- }, X = (o) => {
2262
- const c = S.value.indexOf(o);
2263
- c > -1 ? S.value.splice(c, 1) : S.value.push(o), a("left-check-change", [...S.value]);
2264
- }, Z = (o) => {
2265
- const c = V.value.indexOf(o);
2266
- c > -1 ? V.value.splice(c, 1) : V.value.push(o), a("right-check-change", [...V.value]);
2277
+ a("update:modelValue", c), a("change", c, "left", o), k.value = [];
2278
+ }, N = (o) => {
2279
+ const c = $.value.indexOf(o);
2280
+ c > -1 ? $.value.splice(c, 1) : $.value.push(o), a("left-check-change", [...$.value]);
2281
+ }, q = (o) => {
2282
+ const c = k.value.indexOf(o);
2283
+ c > -1 ? k.value.splice(c, 1) : k.value.push(o), a("right-check-change", [...k.value]);
2267
2284
  }, ee = () => {
2268
- S.value.length === D.value.filter((o) => !v(o)).length ? S.value = [] : S.value = D.value.filter((o) => !v(o)).map((o) => $(o)), a("left-check-change", [...S.value]);
2285
+ $.value.length === C.value.filter((o) => !f(o)).length ? $.value = [] : $.value = C.value.filter((o) => !f(o)).map((o) => D(o)), a("left-check-change", [...$.value]);
2269
2286
  }, T = () => {
2270
- V.value.length === R.value.filter((o) => !v(o)).length ? V.value = [] : V.value = R.value.filter((o) => !v(o)).map((o) => $(o)), a("right-check-change", [...V.value]);
2287
+ k.value.length === R.value.filter((o) => !f(o)).length ? k.value = [] : k.value = R.value.filter((o) => !f(o)).map((o) => D(o)), a("right-check-change", [...k.value]);
2271
2288
  }, B = (o) => {
2272
- o === "left" ? x.value = "" : Y.value = "";
2273
- }, w = y(() => [l.b()]);
2274
- return b({
2289
+ o === "left" ? V.value = "" : F.value = "";
2290
+ }, x = b(() => [l.b()]);
2291
+ return y({
2275
2292
  clearQuery: B
2276
2293
  }), (o, c) => (r(), d("div", {
2277
- class: u(w.value)
2294
+ class: u(x.value)
2278
2295
  }, [
2279
2296
  i("div", {
2280
2297
  class: u(s(l).e("panel"))
@@ -2287,81 +2304,81 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2287
2304
  }, [
2288
2305
  i("input", {
2289
2306
  type: "checkbox",
2290
- checked: S.value.length > 0 && S.value.length === D.value.filter((g) => !v(g)).length,
2291
- indeterminate: S.value.length > 0 && S.value.length < D.value.filter((g) => !v(g)).length,
2307
+ checked: $.value.length > 0 && $.value.length === C.value.filter((g) => !f(g)).length,
2308
+ indeterminate: $.value.length > 0 && $.value.length < C.value.filter((g) => !f(g)).length,
2292
2309
  onChange: ee
2293
2310
  }, null, 40, Lt),
2294
2311
  i("span", null, z(n.titles[0]), 1)
2295
2312
  ], 2),
2296
2313
  i("span", {
2297
2314
  class: u(s(l).e("count"))
2298
- }, z(S.value.length) + " / " + z(D.value.length), 3)
2315
+ }, z($.value.length) + " / " + z(C.value.length), 3)
2299
2316
  ], 2),
2300
2317
  n.filterable ? (r(), d("div", {
2301
2318
  key: 0,
2302
2319
  class: u(s(l).e("filter"))
2303
2320
  }, [
2304
2321
  ue(i("input", {
2305
- "onUpdate:modelValue": c[0] || (c[0] = (g) => x.value = g),
2322
+ "onUpdate:modelValue": c[0] || (c[0] = (g) => V.value = g),
2306
2323
  placeholder: n.filterPlaceholder,
2307
2324
  class: u(s(l).e("filter-input"))
2308
2325
  }, null, 10, Pt), [
2309
- [be, x.value]
2326
+ [be, V.value]
2310
2327
  ]),
2311
- x.value ? (r(), d("span", {
2328
+ V.value ? (r(), d("span", {
2312
2329
  key: 0,
2313
2330
  class: u(s(l).e("filter-clear")),
2314
2331
  onClick: c[1] || (c[1] = (g) => B("left"))
2315
- }, "×", 2)) : O("", !0)
2316
- ], 2)) : O("", !0),
2332
+ }, "×", 2)) : U("", !0)
2333
+ ], 2)) : U("", !0),
2317
2334
  i("div", {
2318
2335
  class: u(s(l).e("body"))
2319
2336
  }, [
2320
- (r(!0), d(G, null, Q(D.value, (g) => (r(), d("div", {
2321
- key: $(g),
2337
+ (r(!0), d(j, null, Q(C.value, (g) => (r(), d("div", {
2338
+ key: D(g),
2322
2339
  class: u([
2323
2340
  s(l).e("item"),
2324
- s(l).is("disabled", v(g)),
2325
- s(l).is("checked", S.value.includes($(g)))
2341
+ s(l).is("disabled", f(g)),
2342
+ s(l).is("checked", $.value.includes(D(g)))
2326
2343
  ]),
2327
- onClick: (K) => !v(g) && X($(g))
2344
+ onClick: (W) => !f(g) && N(D(g))
2328
2345
  }, [
2329
2346
  i("label", {
2330
2347
  class: u(s(l).e("checkbox"))
2331
2348
  }, [
2332
2349
  i("input", {
2333
2350
  type: "checkbox",
2334
- checked: S.value.includes($(g)),
2335
- disabled: v(g),
2351
+ checked: $.value.includes(D(g)),
2352
+ disabled: f(g),
2336
2353
  onClick: c[2] || (c[2] = oe(() => {
2337
2354
  }, ["stop"])),
2338
- onChange: (K) => X($(g))
2355
+ onChange: (W) => N(D(g))
2339
2356
  }, null, 40, Yt),
2340
- i("span", null, z(L(g)), 1)
2357
+ i("span", null, z(A(g)), 1)
2341
2358
  ], 2)
2342
2359
  ], 10, At))), 128)),
2343
- D.value.length === 0 ? (r(), d("div", {
2360
+ C.value.length === 0 ? (r(), d("div", {
2344
2361
  key: 0,
2345
2362
  class: u(s(l).e("empty"))
2346
2363
  }, [
2347
2364
  ae(o.$slots, "left-empty", {}, () => [
2348
2365
  c[6] || (c[6] = me("暂无数据", -1))
2349
2366
  ])
2350
- ], 2)) : O("", !0)
2367
+ ], 2)) : U("", !0)
2351
2368
  ], 2)
2352
2369
  ], 2),
2353
2370
  i("div", {
2354
2371
  class: u(s(l).e("buttons"))
2355
2372
  }, [
2356
2373
  i("button", {
2357
- class: u([s(l).e("button"), s(l).is("disabled", h.value)]),
2358
- disabled: h.value,
2359
- onClick: k
2374
+ class: u([s(l).e("button"), s(l).is("disabled", p.value)]),
2375
+ disabled: p.value,
2376
+ onClick: S
2360
2377
  }, z(n.buttonTexts[0] || ">"), 11, Et),
2361
2378
  i("button", {
2362
- class: u([s(l).e("button"), s(l).is("disabled", f.value)]),
2363
- disabled: f.value,
2364
- onClick: W
2379
+ class: u([s(l).e("button"), s(l).is("disabled", v.value)]),
2380
+ disabled: v.value,
2381
+ onClick: O
2365
2382
  }, z(n.buttonTexts[1] || "<"), 11, Ht)
2366
2383
  ], 2),
2367
2384
  i("div", {
@@ -2375,57 +2392,57 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2375
2392
  }, [
2376
2393
  i("input", {
2377
2394
  type: "checkbox",
2378
- checked: V.value.length > 0 && V.value.length === R.value.filter((g) => !v(g)).length,
2379
- indeterminate: V.value.length > 0 && V.value.length < R.value.filter((g) => !v(g)).length,
2395
+ checked: k.value.length > 0 && k.value.length === R.value.filter((g) => !f(g)).length,
2396
+ indeterminate: k.value.length > 0 && k.value.length < R.value.filter((g) => !f(g)).length,
2380
2397
  onChange: T
2381
2398
  }, null, 40, zt),
2382
2399
  i("span", null, z(n.titles[1]), 1)
2383
2400
  ], 2),
2384
2401
  i("span", {
2385
2402
  class: u(s(l).e("count"))
2386
- }, z(V.value.length) + " / " + z(R.value.length), 3)
2403
+ }, z(k.value.length) + " / " + z(R.value.length), 3)
2387
2404
  ], 2),
2388
2405
  n.filterable ? (r(), d("div", {
2389
2406
  key: 0,
2390
2407
  class: u(s(l).e("filter"))
2391
2408
  }, [
2392
2409
  ue(i("input", {
2393
- "onUpdate:modelValue": c[3] || (c[3] = (g) => Y.value = g),
2410
+ "onUpdate:modelValue": c[3] || (c[3] = (g) => F.value = g),
2394
2411
  placeholder: n.filterPlaceholder,
2395
2412
  class: u(s(l).e("filter-input"))
2396
2413
  }, null, 10, Ot), [
2397
- [be, Y.value]
2414
+ [be, F.value]
2398
2415
  ]),
2399
- Y.value ? (r(), d("span", {
2416
+ F.value ? (r(), d("span", {
2400
2417
  key: 0,
2401
2418
  class: u(s(l).e("filter-clear")),
2402
2419
  onClick: c[4] || (c[4] = (g) => B("right"))
2403
- }, "×", 2)) : O("", !0)
2404
- ], 2)) : O("", !0),
2420
+ }, "×", 2)) : U("", !0)
2421
+ ], 2)) : U("", !0),
2405
2422
  i("div", {
2406
2423
  class: u(s(l).e("body"))
2407
2424
  }, [
2408
- (r(!0), d(G, null, Q(R.value, (g) => (r(), d("div", {
2409
- key: $(g),
2425
+ (r(!0), d(j, null, Q(R.value, (g) => (r(), d("div", {
2426
+ key: D(g),
2410
2427
  class: u([
2411
2428
  s(l).e("item"),
2412
- s(l).is("disabled", v(g)),
2413
- s(l).is("checked", V.value.includes($(g)))
2429
+ s(l).is("disabled", f(g)),
2430
+ s(l).is("checked", k.value.includes(D(g)))
2414
2431
  ]),
2415
- onClick: (K) => !v(g) && Z($(g))
2432
+ onClick: (W) => !f(g) && q(D(g))
2416
2433
  }, [
2417
2434
  i("label", {
2418
2435
  class: u(s(l).e("checkbox"))
2419
2436
  }, [
2420
2437
  i("input", {
2421
2438
  type: "checkbox",
2422
- checked: V.value.includes($(g)),
2423
- disabled: v(g),
2439
+ checked: k.value.includes(D(g)),
2440
+ disabled: f(g),
2424
2441
  onClick: c[5] || (c[5] = oe(() => {
2425
2442
  }, ["stop"])),
2426
- onChange: (K) => Z($(g))
2443
+ onChange: (W) => q(D(g))
2427
2444
  }, null, 40, Ut),
2428
- i("span", null, z(L(g)), 1)
2445
+ i("span", null, z(A(g)), 1)
2429
2446
  ], 2)
2430
2447
  ], 10, Nt))), 128)),
2431
2448
  R.value.length === 0 ? (r(), d("div", {
@@ -2435,7 +2452,7 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2435
2452
  ae(o.$slots, "right-empty", {}, () => [
2436
2453
  c[7] || (c[7] = me("暂无数据", -1))
2437
2454
  ])
2438
- ], 2)) : O("", !0)
2455
+ ], 2)) : U("", !0)
2439
2456
  ], 2)
2440
2457
  ], 2)
2441
2458
  ], 2));
@@ -2457,92 +2474,92 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2457
2474
  marks: {}
2458
2475
  },
2459
2476
  emits: ["update:modelValue", "change", "input"],
2460
- setup(n, { emit: b }) {
2461
- const t = n, e = b, a = _("slider"), l = E(), m = E(), p = E(!1), C = E(!1), x = y(() => {
2477
+ setup(n, { emit: y }) {
2478
+ const t = n, e = y, a = _("slider"), l = E(), m = E(), h = E(!1), w = E(!1), V = b(() => {
2462
2479
  const B = t.max - t.min;
2463
2480
  return (t.modelValue - t.min) / B * 100;
2464
- }), Y = y(() => t.formatTooltip ? t.formatTooltip(t.modelValue) : t.modelValue), S = y(() => {
2481
+ }), F = b(() => t.formatTooltip ? t.formatTooltip(t.modelValue) : t.modelValue), $ = b(() => {
2465
2482
  if (!t.showStops || t.min >= t.max) return [];
2466
- const B = [], w = (t.max - t.min) / t.step;
2467
- for (let o = 0; o <= w; o++) {
2483
+ const B = [], x = (t.max - t.min) / t.step;
2484
+ for (let o = 0; o <= x; o++) {
2468
2485
  const c = t.min + o * t.step;
2469
2486
  c > t.min && c < t.max && B.push((c - t.min) / (t.max - t.min) * 100);
2470
2487
  }
2471
2488
  return B;
2472
- }), V = y(() => t.marks ? Object.keys(t.marks).map((B) => {
2473
- const w = Number(B), o = t.marks[w], c = (w - t.min) / (t.max - t.min) * 100;
2474
- let g, K = {};
2475
- return typeof o == "string" ? g = o : (g = o.label || String(w), K = o.style || {}), { value: w, pos: c, label: g, style: K };
2476
- }) : []), $ = () => l.value ? t.vertical ? l.value.offsetHeight : l.value.offsetWidth : 0, L = (B, w) => {
2489
+ }), k = b(() => t.marks ? Object.keys(t.marks).map((B) => {
2490
+ const x = Number(B), o = t.marks[x], c = (x - t.min) / (t.max - t.min) * 100;
2491
+ let g, W = {};
2492
+ return typeof o == "string" ? g = o : (g = o.label || String(x), W = o.style || {}), { value: x, pos: c, label: g, style: W };
2493
+ }) : []), D = () => l.value ? t.vertical ? l.value.offsetHeight : l.value.offsetWidth : 0, A = (B, x) => {
2477
2494
  if (!l.value) return t.modelValue;
2478
- const o = l.value.getBoundingClientRect(), c = $();
2495
+ const o = l.value.getBoundingClientRect(), c = D();
2479
2496
  let g;
2480
- t.vertical ? g = (o.bottom - w) / c * 100 : g = (B - o.left) / c * 100, g = Math.max(0, Math.min(100, g));
2481
- const K = t.min + g / 100 * (t.max - t.min), le = Math.round(K / t.step) * t.step;
2497
+ t.vertical ? g = (o.bottom - x) / c * 100 : g = (B - o.left) / c * 100, g = Math.max(0, Math.min(100, g));
2498
+ const W = t.min + g / 100 * (t.max - t.min), le = Math.round(W / t.step) * t.step;
2482
2499
  return Math.max(t.min, Math.min(t.max, le));
2483
- }, v = (B) => {
2500
+ }, f = (B) => {
2484
2501
  if (t.disabled) return;
2485
- const w = Math.max(t.min, Math.min(t.max, B));
2486
- w !== t.modelValue && (e("update:modelValue", w), e("input", w));
2487
- }, D = (B) => {
2502
+ const x = Math.max(t.min, Math.min(t.max, B));
2503
+ x !== t.modelValue && (e("update:modelValue", x), e("input", x));
2504
+ }, C = (B) => {
2488
2505
  if (t.disabled) return;
2489
- B.preventDefault(), C.value = !0, p.value = !0;
2490
- const w = L(B.clientX, B.clientY);
2491
- v(w), document.addEventListener("mousemove", R), document.addEventListener("mouseup", M);
2506
+ B.preventDefault(), w.value = !0, h.value = !0;
2507
+ const x = A(B.clientX, B.clientY);
2508
+ f(x), document.addEventListener("mousemove", R), document.addEventListener("mouseup", L);
2492
2509
  }, R = (B) => {
2493
- if (!C.value) return;
2494
- const w = L(B.clientX, B.clientY);
2495
- v(w);
2496
- }, M = () => {
2497
- C.value = !1, e("change", t.modelValue), document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", M);
2498
- }, P = (B) => {
2510
+ if (!w.value) return;
2511
+ const x = A(B.clientX, B.clientY);
2512
+ f(x);
2513
+ }, L = () => {
2514
+ w.value = !1, e("change", t.modelValue), document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", L);
2515
+ }, M = (B) => {
2499
2516
  if (t.disabled) return;
2500
- B.preventDefault(), C.value = !0, p.value = !0;
2501
- const w = B.touches[0], o = L(w.clientX, w.clientY);
2502
- v(o);
2503
- }, h = (B) => {
2504
- if (!C.value) return;
2505
- const w = B.touches[0], o = L(w.clientX, w.clientY);
2506
- v(o);
2507
- }, f = () => {
2508
- C.value = !1, e("change", t.modelValue);
2509
- }, k = () => {
2510
- t.showTooltip && (p.value = !0);
2511
- }, W = () => {
2512
- C.value || (p.value = !1);
2517
+ B.preventDefault(), w.value = !0, h.value = !0;
2518
+ const x = B.touches[0], o = A(x.clientX, x.clientY);
2519
+ f(o);
2520
+ }, p = (B) => {
2521
+ if (!w.value) return;
2522
+ const x = B.touches[0], o = A(x.clientX, x.clientY);
2523
+ f(o);
2524
+ }, v = () => {
2525
+ w.value = !1, e("change", t.modelValue);
2526
+ }, S = () => {
2527
+ t.showTooltip && (h.value = !0);
2528
+ }, O = () => {
2529
+ w.value || (h.value = !1);
2513
2530
  };
2514
2531
  we(() => {
2515
- document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", M);
2532
+ document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", L);
2516
2533
  });
2517
- const X = y(() => [
2534
+ const N = b(() => [
2518
2535
  a.b(),
2519
2536
  a.is("disabled", t.disabled),
2520
2537
  a.is("vertical", t.vertical)
2521
- ]), Z = y(() => t.vertical && t.height ? { height: typeof t.height == "number" ? `${t.height}px` : t.height } : {}), ee = y(() => t.vertical ? { height: `${x.value}%` } : { width: `${x.value}%` }), T = y(() => t.vertical ? { bottom: `${x.value}%` } : { left: `${x.value}%` });
2522
- return (B, w) => (r(), d("div", {
2523
- class: u(X.value),
2524
- style: ne(Z.value)
2538
+ ]), q = b(() => t.vertical && t.height ? { height: typeof t.height == "number" ? `${t.height}px` : t.height } : {}), ee = b(() => t.vertical ? { height: `${V.value}%` } : { width: `${V.value}%` }), T = b(() => t.vertical ? { bottom: `${V.value}%` } : { left: `${V.value}%` });
2539
+ return (B, x) => (r(), d("div", {
2540
+ class: u(N.value),
2541
+ style: ne(q.value)
2525
2542
  }, [
2526
2543
  i("div", {
2527
2544
  ref_key: "sliderRef",
2528
2545
  ref: l,
2529
2546
  class: u(s(a).e("runway")),
2530
- onMousedown: D,
2531
- onTouchstart: P
2547
+ onMousedown: C,
2548
+ onTouchstart: M
2532
2549
  }, [
2533
2550
  i("div", {
2534
2551
  class: u(s(a).e("bar")),
2535
2552
  style: ne(ee.value)
2536
2553
  }, null, 6),
2537
2554
  n.showStops ? (r(), d("div", Xt, [
2538
- (r(!0), d(G, null, Q(S.value, (o, c) => (r(), d("div", {
2555
+ (r(!0), d(j, null, Q($.value, (o, c) => (r(), d("div", {
2539
2556
  key: c,
2540
2557
  class: u(s(a).e("stop")),
2541
2558
  style: ne(n.vertical ? { bottom: `${o}%` } : { left: `${o}%` })
2542
2559
  }, null, 6))), 128))
2543
- ])) : O("", !0),
2544
- V.value.length > 0 ? (r(), d("div", Kt, [
2545
- (r(!0), d(G, null, Q(V.value, (o) => (r(), d("div", {
2560
+ ])) : U("", !0),
2561
+ k.value.length > 0 ? (r(), d("div", Kt, [
2562
+ (r(!0), d(j, null, Q(k.value, (o) => (r(), d("div", {
2546
2563
  key: o.value,
2547
2564
  class: u(s(a).e("mark")),
2548
2565
  style: ne(n.vertical ? { bottom: `${o.pos}%` } : { left: `${o.pos}%`, ...o.style })
@@ -2551,21 +2568,21 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2551
2568
  class: u(s(a).e("mark-text"))
2552
2569
  }, z(o.label), 3)
2553
2570
  ], 6))), 128))
2554
- ])) : O("", !0),
2571
+ ])) : U("", !0),
2555
2572
  i("div", {
2556
2573
  ref_key: "buttonRef",
2557
2574
  ref: m,
2558
2575
  class: u(s(a).e("button-wrapper")),
2559
2576
  style: ne(T.value),
2560
- onMouseenter: k,
2561
- onMouseleave: W,
2562
- onTouchmove: h,
2563
- onTouchend: f
2577
+ onMouseenter: S,
2578
+ onMouseleave: O,
2579
+ onTouchmove: p,
2580
+ onTouchend: v
2564
2581
  }, [
2565
- n.showTooltip && p.value ? (r(), d("div", {
2582
+ n.showTooltip && h.value ? (r(), d("div", {
2566
2583
  key: 0,
2567
2584
  class: u(s(a).e("tooltip"))
2568
- }, z(Y.value), 3)) : O("", !0),
2585
+ }, z(F.value), 3)) : U("", !0),
2569
2586
  i("div", {
2570
2587
  class: u(s(a).e("button"))
2571
2588
  }, null, 2)
@@ -2617,14 +2634,14 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2617
2634
  onExceed: {}
2618
2635
  },
2619
2636
  emits: ["update:fileList", "success", "error", "progress", "change", "remove", "exceed"],
2620
- setup(n, { expose: b, emit: t }) {
2637
+ setup(n, { expose: y, emit: t }) {
2621
2638
  const e = n, a = t, l = _("upload");
2622
2639
  He();
2623
- const m = E(), p = E([...e.fileList]), C = E(!1);
2624
- let x = 1;
2625
- const Y = () => Date.now() + x++, S = (T) => {
2640
+ const m = E(), h = E([...e.fileList]), w = E(!1);
2641
+ let V = 1;
2642
+ const F = () => Date.now() + V++, $ = (T) => {
2626
2643
  var o;
2627
- const B = (o = T.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), w = {
2644
+ const B = (o = T.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), x = {
2628
2645
  pdf: "📄",
2629
2646
  doc: "📝",
2630
2647
  docx: "📝",
@@ -2638,19 +2655,19 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2638
2655
  mp4: "🎬",
2639
2656
  default: "📁"
2640
2657
  };
2641
- return w[B || ""] || w.default;
2642
- }, V = y(() => e.limit ? p.value.length < e.limit : !0), $ = y(() => [
2658
+ return x[B || ""] || x.default;
2659
+ }, k = b(() => e.limit ? h.value.length < e.limit : !0), D = b(() => [
2643
2660
  l.b(),
2644
2661
  l.is("disabled", e.disabled),
2645
2662
  l.is("drag", e.drag),
2646
2663
  l.m(e.listType)
2647
- ]), L = (T) => {
2664
+ ]), A = (T) => {
2648
2665
  const B = T.target.files;
2649
- !B || B.length === 0 || (v(Array.from(B)), m.value && (m.value.value = ""));
2650
- }, v = async (T) => {
2651
- var B, w;
2652
- if (e.limit && p.value.length + T.length > e.limit) {
2653
- a("exceed", T, p.value), (B = e.onExceed) == null || B.call(e, T, p.value);
2666
+ !B || B.length === 0 || (f(Array.from(B)), m.value && (m.value.value = ""));
2667
+ }, f = async (T) => {
2668
+ var B, x;
2669
+ if (e.limit && h.value.length + T.length > e.limit) {
2670
+ a("exceed", T, h.value), (B = e.onExceed) == null || B.call(e, T, h.value);
2654
2671
  return;
2655
2672
  }
2656
2673
  for (const o of T) {
@@ -2661,46 +2678,46 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2661
2678
  size: o.size,
2662
2679
  status: "ready",
2663
2680
  percentage: 0,
2664
- uid: Y(),
2681
+ uid: F(),
2665
2682
  raw: o
2666
2683
  };
2667
- o.type.startsWith("image/") && (c.thumbUrl = await D(o), c.url = c.thumbUrl), p.value.push(c), a("update:fileList", p.value), a("change", c, p.value), (w = e.onChange) == null || w.call(e, c, p.value), e.autoUpload && R(c);
2684
+ o.type.startsWith("image/") && (c.thumbUrl = await C(o), c.url = c.thumbUrl), h.value.push(c), a("update:fileList", h.value), a("change", c, h.value), (x = e.onChange) == null || x.call(e, c, h.value), e.autoUpload && R(c);
2668
2685
  }
2669
- }, D = (T) => new Promise((B) => {
2670
- const w = new FileReader();
2671
- w.onload = (o) => {
2686
+ }, C = (T) => new Promise((B) => {
2687
+ const x = new FileReader();
2688
+ x.onload = (o) => {
2672
2689
  var c;
2673
2690
  B((c = o.target) == null ? void 0 : c.result);
2674
- }, w.readAsDataURL(T);
2691
+ }, x.readAsDataURL(T);
2675
2692
  }), R = (T) => {
2676
2693
  if (!T.raw) return;
2677
- T.status = "uploading", (e.httpRequest || M)({
2694
+ T.status = "uploading", (e.httpRequest || L)({
2678
2695
  action: e.action,
2679
2696
  headers: e.headers,
2680
2697
  data: e.data,
2681
2698
  file: T.raw,
2682
2699
  name: e.name,
2683
2700
  withCredentials: e.withCredentials,
2684
- onProgress: (w) => {
2701
+ onProgress: (x) => {
2685
2702
  var o;
2686
- T.percentage = w.percent, a("progress", w, T, p.value), (o = e.onProgress) == null || o.call(e, w, T, p.value);
2703
+ T.percentage = x.percent, a("progress", x, T, h.value), (o = e.onProgress) == null || o.call(e, x, T, h.value);
2687
2704
  },
2688
- onSuccess: (w) => {
2705
+ onSuccess: (x) => {
2689
2706
  var o;
2690
- T.status = "success", T.response = w, a("success", w, T, p.value), (o = e.onSuccess) == null || o.call(e, w, T, p.value);
2707
+ T.status = "success", T.response = x, a("success", x, T, h.value), (o = e.onSuccess) == null || o.call(e, x, T, h.value);
2691
2708
  },
2692
- onError: (w) => {
2709
+ onError: (x) => {
2693
2710
  var o;
2694
- T.status = "error", a("error", w, T, p.value), (o = e.onError) == null || o.call(e, w, T, p.value);
2711
+ T.status = "error", a("error", x, T, h.value), (o = e.onError) == null || o.call(e, x, T, h.value);
2695
2712
  }
2696
2713
  });
2697
- }, M = (T) => new Promise((B, w) => {
2714
+ }, L = (T) => new Promise((B, x) => {
2698
2715
  const o = new XMLHttpRequest();
2699
2716
  o.upload.addEventListener("progress", (g) => {
2700
2717
  g.lengthComputable && T.onProgress({ percent: g.loaded / g.total * 100 });
2701
2718
  }), o.addEventListener("load", () => {
2702
2719
  if (o.status < 200 || o.status >= 300) {
2703
- T.onError(new Error("Upload failed")), w(new Error("Upload failed"));
2720
+ T.onError(new Error("Upload failed")), x(new Error("Upload failed"));
2704
2721
  return;
2705
2722
  }
2706
2723
  try {
@@ -2710,7 +2727,7 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2710
2727
  T.onSuccess(o.responseText), B(o.responseText);
2711
2728
  }
2712
2729
  }), o.addEventListener("error", () => {
2713
- T.onError(new Error("Upload error")), w(new Error("Upload error"));
2730
+ T.onError(new Error("Upload error")), x(new Error("Upload error"));
2714
2731
  });
2715
2732
  const c = new FormData();
2716
2733
  c.append(T.name, T.file), T.data && Object.keys(T.data).forEach((g) => {
@@ -2718,50 +2735,50 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2718
2735
  }), o.open("POST", T.action, !0), T.withCredentials && (o.withCredentials = !0), T.headers && Object.keys(T.headers).forEach((g) => {
2719
2736
  o.setRequestHeader(g, T.headers[g]);
2720
2737
  }), o.send(c);
2721
- }), P = async (T) => {
2722
- var w;
2723
- if (e.beforeRemove && await e.beforeRemove(T, p.value) === !1)
2738
+ }), M = async (T) => {
2739
+ var x;
2740
+ if (e.beforeRemove && await e.beforeRemove(T, h.value) === !1)
2724
2741
  return;
2725
- const B = p.value.findIndex((o) => o.uid === T.uid);
2726
- B > -1 && (p.value.splice(B, 1), a("update:fileList", p.value), a("remove", T, p.value), (w = e.onRemove) == null || w.call(e, T, p.value));
2727
- }, h = () => {
2728
- p.value.filter((T) => T.status === "ready" && T.raw).forEach((T) => R(T));
2729
- }, f = () => {
2730
- p.value = [], a("update:fileList", p.value);
2731
- }, k = () => {
2742
+ const B = h.value.findIndex((o) => o.uid === T.uid);
2743
+ B > -1 && (h.value.splice(B, 1), a("update:fileList", h.value), a("remove", T, h.value), (x = e.onRemove) == null || x.call(e, T, h.value));
2744
+ }, p = () => {
2745
+ h.value.filter((T) => T.status === "ready" && T.raw).forEach((T) => R(T));
2746
+ }, v = () => {
2747
+ h.value = [], a("update:fileList", h.value);
2748
+ }, S = () => {
2732
2749
  var T;
2733
2750
  e.disabled || (T = m.value) == null || T.click();
2734
- }, W = (T) => {
2735
- T.preventDefault(), !e.disabled && e.drag && (C.value = !0);
2736
- }, X = () => {
2737
- C.value = !1;
2738
- }, Z = (T) => {
2739
- var w;
2740
- if (T.preventDefault(), C.value = !1, e.disabled) return;
2741
- const B = (w = T.dataTransfer) == null ? void 0 : w.files;
2742
- B && B.length > 0 && v(Array.from(B));
2751
+ }, O = (T) => {
2752
+ T.preventDefault(), !e.disabled && e.drag && (w.value = !0);
2753
+ }, N = () => {
2754
+ w.value = !1;
2755
+ }, q = (T) => {
2756
+ var x;
2757
+ if (T.preventDefault(), w.value = !1, e.disabled) return;
2758
+ const B = (x = T.dataTransfer) == null ? void 0 : x.files;
2759
+ B && B.length > 0 && f(Array.from(B));
2743
2760
  }, ee = (T) => {
2744
2761
  if (!T) return "0 B";
2745
2762
  const B = ["B", "KB", "MB", "GB"];
2746
- let w = 0, o = T;
2747
- for (; o >= 1024 && w < B.length - 1; )
2748
- o /= 1024, w++;
2749
- return `${o.toFixed(2)} ${B[w]}`;
2763
+ let x = 0, o = T;
2764
+ for (; o >= 1024 && x < B.length - 1; )
2765
+ o /= 1024, x++;
2766
+ return `${o.toFixed(2)} ${B[x]}`;
2750
2767
  };
2751
- return b({
2752
- submit: h,
2753
- clearFiles: f,
2754
- uploadFiles: p
2768
+ return y({
2769
+ submit: p,
2770
+ clearFiles: v,
2771
+ uploadFiles: h
2755
2772
  }), (T, B) => (r(), d("div", {
2756
- class: u($.value)
2773
+ class: u(D.value)
2757
2774
  }, [
2758
2775
  n.drag ? (r(), d("div", {
2759
2776
  key: 0,
2760
- class: u([s(l).e("drag"), s(l).is("dragover", C.value)]),
2761
- onClick: k,
2762
- onDragover: W,
2763
- onDragleave: X,
2764
- onDrop: Z
2777
+ class: u([s(l).e("drag"), s(l).is("dragover", w.value)]),
2778
+ onClick: S,
2779
+ onDragover: O,
2780
+ onDragleave: N,
2781
+ onDrop: q
2765
2782
  }, [
2766
2783
  ae(T.$slots, "drag", {}, () => [
2767
2784
  i("span", {
@@ -2778,50 +2795,50 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2778
2795
  key: 1,
2779
2796
  class: u([s(l).e("files"), s(l).e("upload-list")])
2780
2797
  }, [
2781
- (r(!0), d(G, null, Q(p.value, (w) => (r(), d("li", {
2782
- key: w.uid,
2783
- class: u([s(l).e("file"), s(l).is(`status-${w.status}`)])
2798
+ (r(!0), d(j, null, Q(h.value, (x) => (r(), d("li", {
2799
+ key: x.uid,
2800
+ class: u([s(l).e("file"), s(l).is(`status-${x.status}`)])
2784
2801
  }, [
2785
- w.thumbUrl && w.status !== "uploading" ? (r(), d("img", {
2802
+ x.thumbUrl && x.status !== "uploading" ? (r(), d("img", {
2786
2803
  key: 0,
2787
- src: w.thumbUrl,
2804
+ src: x.thumbUrl,
2788
2805
  class: u(s(l).e("file-image"))
2789
2806
  }, null, 10, Wt)) : (r(), d("div", {
2790
2807
  key: 1,
2791
2808
  class: u(s(l).e("file-status"))
2792
2809
  }, [
2793
- w.status === "uploading" ? (r(), d("span", qt, [
2810
+ x.status === "uploading" ? (r(), d("span", qt, [
2794
2811
  i("span", Gt, [
2795
- i("span", jt, z(Math.round(w.percentage || 0)) + "%", 1)
2812
+ i("span", jt, z(Math.round(x.percentage || 0)) + "%", 1)
2796
2813
  ])
2797
- ])) : w.status === "error" ? (r(), d("span", Zt, "✕")) : w.status === "success" ? (r(), d("span", Qt, "✓")) : O("", !0)
2814
+ ])) : x.status === "error" ? (r(), d("span", Zt, "✕")) : x.status === "success" ? (r(), d("span", Qt, "✓")) : U("", !0)
2798
2815
  ], 2)),
2799
2816
  i("span", {
2800
2817
  class: u(s(l).e("file-actions"))
2801
2818
  }, [
2802
- w.url ? (r(), d("span", Jt, "👁️")) : O("", !0),
2819
+ x.url ? (r(), d("span", Jt, "👁️")) : U("", !0),
2803
2820
  i("span", {
2804
2821
  class: "action-remove",
2805
- onClick: (o) => P(w)
2822
+ onClick: (o) => M(x)
2806
2823
  }, "🗑️", 8, _t)
2807
2824
  ], 2)
2808
2825
  ], 2))), 128)),
2809
- V.value ? (r(), d("li", {
2826
+ k.value ? (r(), d("li", {
2810
2827
  key: 0,
2811
2828
  class: u(s(l).e("upload-card")),
2812
- onClick: k
2829
+ onClick: S
2813
2830
  }, [
2814
2831
  ae(T.$slots, "trigger", {}, () => [
2815
2832
  B[1] || (B[1] = i("span", { class: "upload-icon" }, "+", -1))
2816
2833
  ])
2817
- ], 2)) : O("", !0)
2818
- ], 2)) : (r(), d(G, { key: 2 }, [
2834
+ ], 2)) : U("", !0)
2835
+ ], 2)) : (r(), d(j, { key: 2 }, [
2819
2836
  i("div", {
2820
2837
  class: u(s(l).e("trigger-wrapper")),
2821
- onClick: k
2838
+ onClick: S
2822
2839
  }, [
2823
2840
  ae(T.$slots, "trigger", {}, () => [
2824
- V.value ? (r(), d("button", {
2841
+ k.value ? (r(), d("button", {
2825
2842
  key: 0,
2826
2843
  type: "button",
2827
2844
  class: u(s(l).e("trigger")),
@@ -2830,90 +2847,90 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2830
2847
  ae(T.$slots, "default", {}, () => [
2831
2848
  B[2] || (B[2] = me("点击上传", -1))
2832
2849
  ])
2833
- ], 10, el)) : O("", !0)
2850
+ ], 10, el)) : U("", !0)
2834
2851
  ])
2835
2852
  ], 2),
2836
- n.showFileList && p.value.length > 0 ? (r(), d("ul", {
2853
+ n.showFileList && h.value.length > 0 ? (r(), d("ul", {
2837
2854
  key: 0,
2838
2855
  class: u(s(l).e("files"))
2839
2856
  }, [
2840
- (r(!0), d(G, null, Q(p.value, (w) => (r(), d("li", {
2841
- key: w.uid,
2842
- class: u([s(l).e("file"), s(l).is(`status-${w.status}`)])
2857
+ (r(!0), d(j, null, Q(h.value, (x) => (r(), d("li", {
2858
+ key: x.uid,
2859
+ class: u([s(l).e("file"), s(l).is(`status-${x.status}`)])
2843
2860
  }, [
2844
- n.listType === "text" ? (r(), d(G, { key: 0 }, [
2861
+ n.listType === "text" ? (r(), d(j, { key: 0 }, [
2845
2862
  i("span", {
2846
2863
  class: u(s(l).e("file-icon"))
2847
- }, z(S(w)), 3),
2864
+ }, z($(x)), 3),
2848
2865
  i("span", {
2849
2866
  class: u(s(l).e("file-name"))
2850
- }, z(w.name), 3),
2867
+ }, z(x.name), 3),
2851
2868
  i("span", {
2852
2869
  class: u(s(l).e("file-size"))
2853
- }, z(ee(w.size)), 3),
2854
- w.status === "uploading" ? (r(), d("span", {
2870
+ }, z(ee(x.size)), 3),
2871
+ x.status === "uploading" ? (r(), d("span", {
2855
2872
  key: 0,
2856
2873
  class: u(s(l).e("file-progress"))
2857
2874
  }, [
2858
2875
  i("span", {
2859
2876
  class: "progress-bar",
2860
- style: ne({ width: w.percentage + "%" })
2877
+ style: ne({ width: x.percentage + "%" })
2861
2878
  }, null, 4),
2862
- i("span", tl, z(Math.round(w.percentage || 0)) + "%", 1)
2863
- ], 2)) : O("", !0),
2864
- w.status === "success" ? (r(), d("span", {
2879
+ i("span", tl, z(Math.round(x.percentage || 0)) + "%", 1)
2880
+ ], 2)) : U("", !0),
2881
+ x.status === "success" ? (r(), d("span", {
2865
2882
  key: 1,
2866
2883
  class: u(s(l).e("file-success"))
2867
- }, "✓", 2)) : O("", !0),
2868
- w.status === "error" ? (r(), d("span", {
2884
+ }, "✓", 2)) : U("", !0),
2885
+ x.status === "error" ? (r(), d("span", {
2869
2886
  key: 2,
2870
2887
  class: u(s(l).e("file-error"))
2871
- }, "✕", 2)) : O("", !0),
2888
+ }, "✕", 2)) : U("", !0),
2872
2889
  i("span", {
2873
2890
  class: u(s(l).e("file-actions"))
2874
2891
  }, [
2875
2892
  i("span", {
2876
2893
  class: "action-remove",
2877
- onClick: (o) => P(w)
2894
+ onClick: (o) => M(x)
2878
2895
  }, "✕", 8, ll)
2879
2896
  ], 2)
2880
- ], 64)) : n.listType === "picture" ? (r(), d(G, { key: 1 }, [
2881
- w.thumbUrl ? (r(), d("img", {
2897
+ ], 64)) : n.listType === "picture" ? (r(), d(j, { key: 1 }, [
2898
+ x.thumbUrl ? (r(), d("img", {
2882
2899
  key: 0,
2883
- src: w.thumbUrl,
2900
+ src: x.thumbUrl,
2884
2901
  class: u(s(l).e("file-thumb"))
2885
2902
  }, null, 10, al)) : (r(), d("span", {
2886
2903
  key: 1,
2887
2904
  class: u(s(l).e("file-icon"))
2888
- }, z(S(w)), 3)),
2905
+ }, z($(x)), 3)),
2889
2906
  i("div", {
2890
2907
  class: u(s(l).e("file-info"))
2891
2908
  }, [
2892
2909
  i("span", {
2893
2910
  class: u(s(l).e("file-name"))
2894
- }, z(w.name), 3),
2895
- w.status === "uploading" ? (r(), d("span", {
2911
+ }, z(x.name), 3),
2912
+ x.status === "uploading" ? (r(), d("span", {
2896
2913
  key: 0,
2897
2914
  class: u(s(l).e("file-progress"))
2898
2915
  }, [
2899
2916
  i("span", {
2900
2917
  class: "progress-bar",
2901
- style: ne({ width: w.percentage + "%" })
2918
+ style: ne({ width: x.percentage + "%" })
2902
2919
  }, null, 4)
2903
- ], 2)) : O("", !0)
2920
+ ], 2)) : U("", !0)
2904
2921
  ], 2),
2905
2922
  i("span", {
2906
2923
  class: u(s(l).e("file-actions"))
2907
2924
  }, [
2908
- w.status === "success" ? (r(), d("span", nl, "✓")) : O("", !0),
2925
+ x.status === "success" ? (r(), d("span", nl, "✓")) : U("", !0),
2909
2926
  i("span", {
2910
2927
  class: "action-remove",
2911
- onClick: (o) => P(w)
2928
+ onClick: (o) => M(x)
2912
2929
  }, "✕", 8, sl)
2913
2930
  ], 2)
2914
- ], 64)) : O("", !0)
2931
+ ], 64)) : U("", !0)
2915
2932
  ], 2))), 128))
2916
- ], 2)) : O("", !0)
2933
+ ], 2)) : U("", !0)
2917
2934
  ], 64)),
2918
2935
  i("input", {
2919
2936
  ref_key: "inputRef",
@@ -2923,14 +2940,14 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2923
2940
  multiple: n.multiple,
2924
2941
  accept: n.accept,
2925
2942
  disabled: n.disabled,
2926
- onChange: L
2943
+ onChange: A
2927
2944
  }, null, 42, ul),
2928
2945
  T.$slots.tip ? (r(), d("div", {
2929
2946
  key: 3,
2930
2947
  class: u(s(l).e("tip"))
2931
2948
  }, [
2932
2949
  ae(T.$slots, "tip")
2933
- ], 2)) : O("", !0)
2950
+ ], 2)) : U("", !0)
2934
2951
  ], 2));
2935
2952
  }
2936
2953
  }), ol = ["onMousemove", "onClick"], Xl = /* @__PURE__ */ J({
@@ -2958,64 +2975,64 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
2958
2975
  size: { default: "default" }
2959
2976
  },
2960
2977
  emits: ["update:modelValue", "change"],
2961
- setup(n, { emit: b }) {
2962
- const t = n, e = b, a = _("rate"), l = E(-1), m = y(() => l.value > -1 ? l.value : t.modelValue), p = y(() => [
2978
+ setup(n, { emit: y }) {
2979
+ const t = n, e = y, a = _("rate"), l = E(-1), m = b(() => l.value > -1 ? l.value : t.modelValue), h = b(() => [
2963
2980
  a.b(),
2964
2981
  a.m(t.size),
2965
2982
  a.is("disabled", t.disabled),
2966
2983
  a.is("readonly", t.readonly)
2967
- ]), C = (v) => t.disabled ? t.disabledVoidColor : v <= t.lowThreshold ? t.colors[0] : v <= t.highThreshold ? t.colors[1] || t.colors[0] : t.colors[2] || t.colors[1] || t.colors[0], x = (v) => {
2968
- const D = m.value;
2969
- return D >= v ? 100 : t.allowHalf && D >= v - 0.5 ? 50 : 0;
2970
- }, Y = (v) => x(v) > 0 ? C(m.value) : t.disabled ? t.disabledVoidColor : t.voidColor, S = y(() => {
2984
+ ]), w = (f) => t.disabled ? t.disabledVoidColor : f <= t.lowThreshold ? t.colors[0] : f <= t.highThreshold ? t.colors[1] || t.colors[0] : t.colors[2] || t.colors[1] || t.colors[0], V = (f) => {
2985
+ const C = m.value;
2986
+ return C >= f ? 100 : t.allowHalf && C >= f - 0.5 ? 50 : 0;
2987
+ }, F = (f) => V(f) > 0 ? w(m.value) : t.disabled ? t.disabledVoidColor : t.voidColor, $ = b(() => {
2971
2988
  if (t.showScore)
2972
2989
  return t.scoreTemplate.replace("{value}", String(t.modelValue));
2973
2990
  if (t.showText) {
2974
- const v = Math.min(Math.ceil(t.modelValue || 0), t.max) - 1;
2975
- return t.texts[Math.max(0, v)] || "";
2991
+ const f = Math.min(Math.ceil(t.modelValue || 0), t.max) - 1;
2992
+ return t.texts[Math.max(0, f)] || "";
2976
2993
  }
2977
2994
  return "";
2978
- }), V = (v, D) => {
2995
+ }), k = (f, C) => {
2979
2996
  if (!(t.disabled || t.readonly))
2980
2997
  if (t.allowHalf) {
2981
- const M = D.currentTarget.getBoundingClientRect(), P = D.clientX - M.left < M.width / 2;
2982
- l.value = P ? v - 0.5 : v;
2998
+ const L = C.currentTarget.getBoundingClientRect(), M = C.clientX - L.left < L.width / 2;
2999
+ l.value = M ? f - 0.5 : f;
2983
3000
  } else
2984
- l.value = v;
2985
- }, $ = () => {
3001
+ l.value = f;
3002
+ }, D = () => {
2986
3003
  t.disabled || t.readonly || (l.value = -1);
2987
- }, L = (v, D) => {
3004
+ }, A = (f, C) => {
2988
3005
  if (t.disabled || t.readonly) return;
2989
3006
  let R;
2990
3007
  if (t.allowHalf) {
2991
- const P = D.currentTarget.getBoundingClientRect();
2992
- R = D.clientX - P.left < P.width / 2 ? v - 0.5 : v;
3008
+ const M = C.currentTarget.getBoundingClientRect();
3009
+ R = C.clientX - M.left < M.width / 2 ? f - 0.5 : f;
2993
3010
  } else
2994
- R = v;
3011
+ R = f;
2995
3012
  e("update:modelValue", R), e("change", R);
2996
3013
  };
2997
- return (v, D) => (r(), d("div", {
2998
- class: u(p.value),
2999
- onMouseleave: $
3014
+ return (f, C) => (r(), d("div", {
3015
+ class: u(h.value),
3016
+ onMouseleave: D
3000
3017
  }, [
3001
3018
  i("div", {
3002
3019
  class: u(s(a).e("items"))
3003
3020
  }, [
3004
- (r(!0), d(G, null, Q(n.max, (R) => (r(), d("span", {
3021
+ (r(!0), d(j, null, Q(n.max, (R) => (r(), d("span", {
3005
3022
  key: R,
3006
3023
  class: u(s(a).e("item")),
3007
- onMousemove: (M) => V(R, M),
3008
- onClick: (M) => L(R, M)
3024
+ onMousemove: (L) => k(R, L),
3025
+ onClick: (L) => A(R, L)
3009
3026
  }, [
3010
3027
  i("span", {
3011
3028
  class: u(s(a).e("void")),
3012
3029
  style: ne({ color: n.disabled ? n.disabledVoidColor : n.voidColor })
3013
3030
  }, z(n.disabled ? n.disabledVoidIcon : n.voidIcon), 7),
3014
3031
  i("span", {
3015
- class: u([s(a).e("fill"), x(R) > 0 ? "is-active" : ""]),
3032
+ class: u([s(a).e("fill"), V(R) > 0 ? "is-active" : ""]),
3016
3033
  style: ne({
3017
- color: Y(R),
3018
- clipPath: `inset(0 ${100 - x(R)}% 0 0)`
3034
+ color: F(R),
3035
+ clipPath: `inset(0 ${100 - V(R)}% 0 0)`
3019
3036
  })
3020
3037
  }, z(n.icon), 7)
3021
3038
  ], 42, ol))), 128))
@@ -3024,7 +3041,7 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
3024
3041
  key: 0,
3025
3042
  class: u(s(a).e("text")),
3026
3043
  style: ne({ color: n.textColor })
3027
- }, z(S.value), 7)) : O("", !0)
3044
+ }, z($.value), 7)) : U("", !0)
3028
3045
  ], 34));
3029
3046
  }
3030
3047
  }), il = ["value"], rl = { class: "field-type" }, dl = { class: "field-name" }, cl = { class: "field-label" }, vl = {
@@ -3049,94 +3066,94 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
3049
3066
  ] }
3050
3067
  },
3051
3068
  emits: ["update:fields", "add", "remove", "sort", "update"],
3052
- setup(n, { emit: b }) {
3053
- const t = n, e = b, a = _("dynamic-fields"), l = E([]), m = E(null), p = E("input"), C = y(() => [
3069
+ setup(n, { emit: y }) {
3070
+ const t = n, e = y, a = _("dynamic-fields"), l = E([]), m = E(null), h = E("input"), w = b(() => [
3054
3071
  a.b(),
3055
3072
  a.is("editable", t.editable)
3056
- ]), x = y(() => l.value.length < t.maxFields);
3057
- ce(() => t.fields, (h) => {
3058
- l.value = [...h].sort((f, k) => (f.order || 0) - (k.order || 0));
3073
+ ]), V = b(() => l.value.length < t.maxFields);
3074
+ ie(() => t.fields, (p) => {
3075
+ l.value = [...p].sort((v, S) => (v.order || 0) - (S.order || 0));
3059
3076
  }, { immediate: !0, deep: !0 });
3060
- const Y = () => `field_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`, S = () => {
3061
- if (!x.value) return;
3062
- const h = {
3063
- id: Y(),
3077
+ const F = () => `field_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`, $ = () => {
3078
+ if (!V.value) return;
3079
+ const p = {
3080
+ id: F(),
3064
3081
  name: `field_${l.value.length + 1}`,
3065
3082
  label: "新字段",
3066
- type: p.value,
3083
+ type: h.value,
3067
3084
  required: !1,
3068
3085
  order: l.value.length
3069
3086
  };
3070
- l.value.push(h), e("add", h), e("update:fields", l.value);
3071
- }, V = (h) => {
3072
- const f = l.value.findIndex((k) => k.id === h);
3073
- f !== -1 && (l.value[f], l.value.splice(f, 1), e("remove", h), e("update:fields", l.value));
3074
- }, $ = (h) => {
3075
- const f = l.value.findIndex((k) => k.id === h);
3076
- if (f > 0) {
3077
- const k = l.value[f];
3078
- l.value[f] = l.value[f - 1], l.value[f - 1] = k, v(), e("sort", l.value), e("update:fields", l.value);
3087
+ l.value.push(p), e("add", p), e("update:fields", l.value);
3088
+ }, k = (p) => {
3089
+ const v = l.value.findIndex((S) => S.id === p);
3090
+ v !== -1 && (l.value[v], l.value.splice(v, 1), e("remove", p), e("update:fields", l.value));
3091
+ }, D = (p) => {
3092
+ const v = l.value.findIndex((S) => S.id === p);
3093
+ if (v > 0) {
3094
+ const S = l.value[v];
3095
+ l.value[v] = l.value[v - 1], l.value[v - 1] = S, f(), e("sort", l.value), e("update:fields", l.value);
3079
3096
  }
3080
- }, L = (h) => {
3081
- const f = l.value.findIndex((k) => k.id === h);
3082
- if (f < l.value.length - 1) {
3083
- const k = l.value[f];
3084
- l.value[f] = l.value[f + 1], l.value[f + 1] = k, v(), e("sort", l.value), e("update:fields", l.value);
3097
+ }, A = (p) => {
3098
+ const v = l.value.findIndex((S) => S.id === p);
3099
+ if (v < l.value.length - 1) {
3100
+ const S = l.value[v];
3101
+ l.value[v] = l.value[v + 1], l.value[v + 1] = S, f(), e("sort", l.value), e("update:fields", l.value);
3085
3102
  }
3086
- }, v = () => {
3087
- l.value.forEach((h, f) => {
3088
- h.order = f;
3103
+ }, f = () => {
3104
+ l.value.forEach((p, v) => {
3105
+ p.order = v;
3089
3106
  });
3090
- }, D = (h) => {
3091
- m.value = { ...h };
3107
+ }, C = (p) => {
3108
+ m.value = { ...p };
3092
3109
  }, R = () => {
3093
3110
  if (m.value) {
3094
- const h = l.value.findIndex((f) => f.id === m.value.id);
3095
- h !== -1 && (l.value[h] = m.value, e("update", m.value.id, m.value), e("update:fields", l.value)), m.value = null;
3111
+ const p = l.value.findIndex((v) => v.id === m.value.id);
3112
+ p !== -1 && (l.value[p] = m.value, e("update", m.value.id, m.value), e("update:fields", l.value)), m.value = null;
3096
3113
  }
3097
- }, M = () => {
3114
+ }, L = () => {
3098
3115
  m.value = null;
3099
- }, P = (h) => {
3100
- const f = t.availableTypes.find((k) => k.value === h);
3101
- return (f == null ? void 0 : f.label) || h;
3116
+ }, M = (p) => {
3117
+ const v = t.availableTypes.find((S) => S.value === p);
3118
+ return (v == null ? void 0 : v.label) || p;
3102
3119
  };
3103
- return (h, f) => (r(), d("div", {
3104
- class: u(C.value)
3120
+ return (p, v) => (r(), d("div", {
3121
+ class: u(w.value)
3105
3122
  }, [
3106
- n.editable && x.value ? (r(), d("div", {
3123
+ n.editable && V.value ? (r(), d("div", {
3107
3124
  key: 0,
3108
3125
  class: u(s(a).e("add"))
3109
3126
  }, [
3110
3127
  ue(i("select", {
3111
- "onUpdate:modelValue": f[0] || (f[0] = (k) => p.value = k),
3128
+ "onUpdate:modelValue": v[0] || (v[0] = (S) => h.value = S),
3112
3129
  class: u(s(a).e("type-select"))
3113
3130
  }, [
3114
- (r(!0), d(G, null, Q(n.availableTypes, (k) => (r(), d("option", {
3115
- key: k.value,
3116
- value: k.value
3117
- }, z(k.label), 9, il))), 128))
3131
+ (r(!0), d(j, null, Q(n.availableTypes, (S) => (r(), d("option", {
3132
+ key: S.value,
3133
+ value: S.value
3134
+ }, z(S.label), 9, il))), 128))
3118
3135
  ], 2), [
3119
- [ke, p.value]
3136
+ [ke, h.value]
3120
3137
  ]),
3121
3138
  i("button", {
3122
3139
  class: u(s(a).e("add-btn")),
3123
- onClick: S
3140
+ onClick: $
3124
3141
  }, " + 添加字段 ", 2)
3125
- ], 2)) : O("", !0),
3142
+ ], 2)) : U("", !0),
3126
3143
  i("div", {
3127
3144
  class: u(s(a).e("list"))
3128
3145
  }, [
3129
- (r(!0), d(G, null, Q(l.value, (k) => (r(), d("div", {
3130
- key: k.id,
3146
+ (r(!0), d(j, null, Q(l.value, (S) => (r(), d("div", {
3147
+ key: S.id,
3131
3148
  class: u(s(a).e("item"))
3132
3149
  }, [
3133
3150
  i("div", {
3134
3151
  class: u(s(a).e("info"))
3135
3152
  }, [
3136
- i("span", rl, z(P(k.type)), 1),
3137
- i("span", dl, z(k.name), 1),
3138
- i("span", cl, z(k.label), 1),
3139
- k.required ? (r(), d("span", vl, "必填")) : O("", !0)
3153
+ i("span", rl, z(M(S.type)), 1),
3154
+ i("span", dl, z(S.name), 1),
3155
+ i("span", cl, z(S.label), 1),
3156
+ S.required ? (r(), d("span", vl, "必填")) : U("", !0)
3140
3157
  ], 2),
3141
3158
  n.editable ? (r(), d("div", {
3142
3159
  key: 0,
@@ -3146,50 +3163,50 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
3146
3163
  key: 0,
3147
3164
  class: "action-btn",
3148
3165
  title: "上移",
3149
- onClick: (W) => $(k.id)
3150
- }, " ↑ ", 8, fl)) : O("", !0),
3166
+ onClick: (O) => D(S.id)
3167
+ }, " ↑ ", 8, fl)) : U("", !0),
3151
3168
  n.showSort ? (r(), d("button", {
3152
3169
  key: 1,
3153
3170
  class: "action-btn",
3154
3171
  title: "下移",
3155
- onClick: (W) => L(k.id)
3156
- }, " ↓ ", 8, ml)) : O("", !0),
3172
+ onClick: (O) => A(S.id)
3173
+ }, " ↓ ", 8, ml)) : U("", !0),
3157
3174
  i("button", {
3158
3175
  class: "action-btn",
3159
3176
  title: "编辑",
3160
- onClick: (W) => D(k)
3177
+ onClick: (O) => C(S)
3161
3178
  }, " ✏️ ", 8, pl),
3162
3179
  i("button", {
3163
3180
  class: "action-btn action-btn--danger",
3164
3181
  title: "删除",
3165
- onClick: (W) => V(k.id)
3182
+ onClick: (O) => k(S.id)
3166
3183
  }, " ✕ ", 8, hl)
3167
- ], 2)) : O("", !0)
3184
+ ], 2)) : U("", !0)
3168
3185
  ], 2))), 128))
3169
3186
  ], 2),
3170
3187
  l.value.length === 0 ? (r(), d("div", {
3171
3188
  key: 1,
3172
3189
  class: u(s(a).e("empty"))
3173
- }, [...f[6] || (f[6] = [
3190
+ }, [...v[6] || (v[6] = [
3174
3191
  i("span", null, "暂无字段配置", -1)
3175
- ])], 2)) : O("", !0),
3192
+ ])], 2)) : U("", !0),
3176
3193
  m.value ? (r(), d("div", {
3177
3194
  key: 2,
3178
3195
  class: u(s(a).e("edit-modal"))
3179
3196
  }, [
3180
3197
  i("div", gl, [
3181
3198
  i("div", { class: "modal-header" }, [
3182
- f[7] || (f[7] = i("span", null, "编辑字段", -1)),
3199
+ v[7] || (v[7] = i("span", null, "编辑字段", -1)),
3183
3200
  i("button", {
3184
3201
  class: "close-btn",
3185
- onClick: M
3202
+ onClick: L
3186
3203
  }, "✕")
3187
3204
  ]),
3188
3205
  i("div", bl, [
3189
3206
  i("div", yl, [
3190
- f[8] || (f[8] = i("label", null, "字段名称", -1)),
3207
+ v[8] || (v[8] = i("label", null, "字段名称", -1)),
3191
3208
  ue(i("input", {
3192
- "onUpdate:modelValue": f[1] || (f[1] = (k) => m.value.name = k),
3209
+ "onUpdate:modelValue": v[1] || (v[1] = (S) => m.value.name = S),
3193
3210
  type: "text",
3194
3211
  placeholder: "变量名称"
3195
3212
  }, null, 512), [
@@ -3197,9 +3214,9 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
3197
3214
  ])
3198
3215
  ]),
3199
3216
  i("div", kl, [
3200
- f[9] || (f[9] = i("label", null, "字段标签", -1)),
3217
+ v[9] || (v[9] = i("label", null, "字段标签", -1)),
3201
3218
  ue(i("input", {
3202
- "onUpdate:modelValue": f[2] || (f[2] = (k) => m.value.label = k),
3219
+ "onUpdate:modelValue": v[2] || (v[2] = (S) => m.value.label = S),
3203
3220
  type: "text",
3204
3221
  placeholder: "显示标签"
3205
3222
  }, null, 512), [
@@ -3207,29 +3224,29 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
3207
3224
  ])
3208
3225
  ]),
3209
3226
  i("div", xl, [
3210
- f[10] || (f[10] = i("label", null, "字段类型", -1)),
3227
+ v[10] || (v[10] = i("label", null, "字段类型", -1)),
3211
3228
  ue(i("select", {
3212
- "onUpdate:modelValue": f[3] || (f[3] = (k) => m.value.type = k)
3229
+ "onUpdate:modelValue": v[3] || (v[3] = (S) => m.value.type = S)
3213
3230
  }, [
3214
- (r(!0), d(G, null, Q(n.availableTypes, (k) => (r(), d("option", {
3215
- key: k.value,
3216
- value: k.value
3217
- }, z(k.label), 9, wl))), 128))
3231
+ (r(!0), d(j, null, Q(n.availableTypes, (S) => (r(), d("option", {
3232
+ key: S.value,
3233
+ value: S.value
3234
+ }, z(S.label), 9, wl))), 128))
3218
3235
  ], 512), [
3219
3236
  [ke, m.value.type]
3220
3237
  ])
3221
3238
  ]),
3222
3239
  i("div", Vl, [
3223
- f[11] || (f[11] = i("label", null, "是否必填", -1)),
3240
+ v[11] || (v[11] = i("label", null, "是否必填", -1)),
3224
3241
  i("button", {
3225
3242
  class: u(["switch-btn", { "is-on": m.value.required }]),
3226
- onClick: f[4] || (f[4] = (k) => m.value.required = !m.value.required)
3243
+ onClick: v[4] || (v[4] = (S) => m.value.required = !m.value.required)
3227
3244
  }, z(m.value.required ? "必填" : "可选"), 3)
3228
3245
  ]),
3229
3246
  i("div", Cl, [
3230
- f[12] || (f[12] = i("label", null, "占位文本", -1)),
3247
+ v[12] || (v[12] = i("label", null, "占位文本", -1)),
3231
3248
  ue(i("input", {
3232
- "onUpdate:modelValue": f[5] || (f[5] = (k) => m.value.placeholder = k),
3249
+ "onUpdate:modelValue": v[5] || (v[5] = (S) => m.value.placeholder = S),
3233
3250
  type: "text",
3234
3251
  placeholder: "输入提示"
3235
3252
  }, null, 512), [
@@ -3240,7 +3257,7 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
3240
3257
  i("div", { class: "modal-footer" }, [
3241
3258
  i("button", {
3242
3259
  class: "cancel-btn",
3243
- onClick: M
3260
+ onClick: L
3244
3261
  }, "取消"),
3245
3262
  i("button", {
3246
3263
  class: "save-btn",
@@ -3248,7 +3265,7 @@ const Rt = ["onClick"], Bt = ["placeholder", "disabled", "readonly", "value"], F
3248
3265
  }, "保存")
3249
3266
  ])
3250
3267
  ])
3251
- ], 2)) : O("", !0)
3268
+ ], 2)) : U("", !0)
3252
3269
  ], 2));
3253
3270
  }
3254
3271
  });