@xto/form 1.0.3 → 1.1.0

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