@gopowerteam/form-render 0.0.94 → 1.0.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.
Files changed (46) hide show
  1. package/dist/cjs/config/provide.config.d.ts +0 -1
  2. package/dist/cjs/defines/define-form.d.ts +0 -1
  3. package/dist/cjs/form-items/cascader/index.d.ts +0 -1
  4. package/dist/cjs/form-items/currency/index.d.ts +0 -1
  5. package/dist/cjs/form-items/date/index.d.ts +0 -1
  6. package/dist/cjs/form-items/date-range/index.d.ts +0 -1
  7. package/dist/cjs/form-items/input/index.d.ts +0 -1
  8. package/dist/cjs/form-items/radio/index.d.ts +0 -1
  9. package/dist/cjs/form-items/render/index.d.ts +0 -1
  10. package/dist/cjs/form-items/select/index.d.ts +0 -1
  11. package/dist/cjs/form-items/switch/index.d.ts +0 -1
  12. package/dist/cjs/form-items/textarea/index.d.ts +0 -1
  13. package/dist/cjs/form-items/tree-select/index.d.ts +1 -2
  14. package/dist/cjs/form-render/form-collapsed-dialog.d.ts +6 -7
  15. package/dist/cjs/form-render/form-item-render.d.ts +3 -3
  16. package/dist/cjs/form-render/index.d.ts +126 -17
  17. package/dist/cjs/hooks/use-form.d.ts +2 -3
  18. package/dist/cjs/index.cjs +5 -1
  19. package/dist/cjs/index.d.ts +2 -3
  20. package/dist/cjs/install.d.ts +0 -1
  21. package/dist/cjs/interfaces/form-item-options.d.ts +0 -1
  22. package/dist/cjs/utils/create-form-source.d.ts +0 -1
  23. package/dist/es/config/provide.config.d.ts +0 -1
  24. package/dist/es/defines/define-form.d.ts +0 -1
  25. package/dist/es/form-items/cascader/index.d.ts +0 -1
  26. package/dist/es/form-items/currency/index.d.ts +0 -1
  27. package/dist/es/form-items/date/index.d.ts +0 -1
  28. package/dist/es/form-items/date-range/index.d.ts +0 -1
  29. package/dist/es/form-items/input/index.d.ts +0 -1
  30. package/dist/es/form-items/radio/index.d.ts +0 -1
  31. package/dist/es/form-items/render/index.d.ts +0 -1
  32. package/dist/es/form-items/select/index.d.ts +0 -1
  33. package/dist/es/form-items/switch/index.d.ts +0 -1
  34. package/dist/es/form-items/textarea/index.d.ts +0 -1
  35. package/dist/es/form-items/tree-select/index.d.ts +1 -2
  36. package/dist/es/form-render/form-collapsed-dialog.d.ts +6 -7
  37. package/dist/es/form-render/form-item-render.d.ts +3 -3
  38. package/dist/es/form-render/index.d.ts +126 -17
  39. package/dist/es/hooks/use-form.d.ts +2 -3
  40. package/dist/es/index.d.ts +2 -3
  41. package/dist/es/index.mjs +1603 -1600
  42. package/dist/es/install.d.ts +0 -1
  43. package/dist/es/interfaces/form-item-options.d.ts +0 -1
  44. package/dist/es/utils/create-form-source.d.ts +0 -1
  45. package/dist/style.css +1 -1
  46. package/package.json +31 -29
package/dist/es/index.mjs CHANGED
@@ -1,21 +1,24 @@
1
- import { getCurrentInstance as W, inject as we, defineComponent as I, computed as F, openBlock as _, createElementBlock as L, normalizeClass as ce, normalizeStyle as z, createElementVNode as S, shallowRef as V, ref as $, provide as ge, onMounted as H, Fragment as ae, renderSlot as nt, createBlock as ue, Teleport as lt, createVNode as m, TransitionGroup as at, withCtx as ut, renderList as ct, mergeProps as B, createCommentVNode as q, defineAsyncComponent as ot, triggerRef as ee, useCssVars as st, onUnmounted as it, withModifiers as dt, toDisplayString as N, resolveDynamicComponent as ze, normalizeProps as ft, guardReactiveProps as mt, watch as te, unref as Ne, isRef as re, toRefs as ht, customRef as vt, nextTick as Ae, getCurrentScope as yt, onScopeDispose as pt, pushScopeId as Ve, popScopeId as Be, isVNode as xe, createTextVNode as R, h as Ye, onUpdated as gt } from "vue";
2
- import { DatePicker as bt, YearPicker as kt, QuarterPicker as wt, MonthPicker as xt, WeekPicker as Ct, Input as St, InputNumber as Ue, Select as Ot, Option as $t, Switch as _t, RangePicker as Ft, Textarea as Mt, TreeSelect as Yt, Cascader as Dt, RadioGroup as Tt, FormItem as be, Divider as De, Button as j, Tabs as Lt, TabPane as Pt, Form as Rt, Grid as jt, GridItem as fe, Space as Te, Tag as It } from "@arco-design/web-vue";
3
- import b from "dayjs";
4
- import { FormRenderResolver as Yn } from "./resolver.mjs";
5
- const Et = Symbol("ArcoConfigProvider"), zt = "arco", Nt = "$arco", Ce = (e) => {
6
- var n, r, t;
7
- const a = W(), u = we(Et, void 0);
8
- return `${(t = (r = u == null ? void 0 : u.prefixCls) != null ? r : (n = a == null ? void 0 : a.appContext.config.globalProperties[Nt]) == null ? void 0 : n.classPrefix) != null ? t : zt}-${e}`;
9
- }, At = Object.prototype.toString;
10
- function Se(e) {
11
- return At.call(e) === "[object Number]" && e === e;
1
+ import { getCurrentInstance as ee, inject as Ve, defineComponent as U, computed as L, openBlock as T, createElementBlock as z, normalizeStyle as Q, normalizeClass as Oe, createElementVNode as O, shallowRef as A, ref as D, provide as ze, onMounted as te, Fragment as Ce, renderSlot as yt, createBlock as Se, Teleport as gt, createVNode as p, TransitionGroup as bt, withCtx as kt, renderList as wt, mergeProps as Z, createCommentVNode as J, triggerRef as se, defineAsyncComponent as xt, useCssVars as Ct, onUnmounted as St, withModifiers as Ot, toDisplayString as X, resolveDynamicComponent as dt, normalizeProps as $t, guardReactiveProps as _t, watch as ne, toValue as C, nextTick as Ft, isRef as ie, toRefs as Mt, customRef as Yt, getCurrentScope as Lt, onScopeDispose as Tt, unref as Dt, createTextVNode as q, isVNode as qe, h as Je, onUpdated as Rt } from "vue";
2
+ import { Divider as et, Button as W, Tabs as It, TabPane as Pt, Cascader as jt, InputNumber as ft, DatePicker as Et, YearPicker as zt, QuarterPicker as Nt, MonthPicker as Bt, WeekPicker as Vt, RangePicker as qt, Input as At, RadioGroup as Wt, Select as Ht, Option as Ut, Switch as Gt, Textarea as Qt, TreeSelect as Xt, FormItem as Ne, Form as Zt, Grid as Kt, GridItem as De, Space as tt, Tag as Jt } from "@arco-design/web-vue";
3
+ import k from "dayjs";
4
+ import { FormRenderResolver as Xr } from "./resolver.mjs";
5
+ function Wr(e) {
6
+ return e;
7
+ }
8
+ const en = /* @__PURE__ */ Symbol("ArcoConfigProvider"), tn = "arco", nn = "$arco", Ae = (e) => {
9
+ var r, n, t;
10
+ const o = ee(), a = Ve(en, void 0);
11
+ return `${(t = (n = a?.prefixCls) != null ? n : (r = o?.appContext.config.globalProperties[nn]) == null ? void 0 : r.classPrefix) != null ? t : tn}-${e}`;
12
+ }, rn = Object.prototype.toString;
13
+ function We(e) {
14
+ return rn.call(e) === "[object Number]" && e === e;
12
15
  }
13
- var Oe = (e, n) => {
14
- for (const [r, t] of n)
15
- e[r] = t;
16
+ var He = (e, r) => {
17
+ for (const [n, t] of r)
18
+ e[n] = t;
16
19
  return e;
17
20
  };
18
- const Vt = I({
21
+ const on = U({
19
22
  name: "IconDown",
20
23
  props: {
21
24
  size: {
@@ -42,47 +45,47 @@ const Vt = I({
42
45
  click: (e) => !0
43
46
  },
44
47
  setup(e, {
45
- emit: n
48
+ emit: r
46
49
  }) {
47
- const r = Ce("icon"), t = F(() => [r, `${r}-down`, {
48
- [`${r}-spin`]: e.spin
49
- }]), a = F(() => {
50
+ const n = Ae("icon"), t = L(() => [n, `${n}-down`, {
51
+ [`${n}-spin`]: e.spin
52
+ }]), o = L(() => {
50
53
  const l = {};
51
- return e.size && (l.fontSize = Se(e.size) ? `${e.size}px` : e.size), e.rotate && (l.transform = `rotate(${e.rotate}deg)`), l;
54
+ return e.size && (l.fontSize = We(e.size) ? `${e.size}px` : e.size), e.rotate && (l.transform = `rotate(${e.rotate}deg)`), l;
52
55
  });
53
56
  return {
54
57
  cls: t,
55
- innerStyle: a,
58
+ innerStyle: o,
56
59
  onClick: (l) => {
57
- n("click", l);
60
+ r("click", l);
58
61
  }
59
62
  };
60
63
  }
61
- }), Bt = ["stroke-width", "stroke-linecap", "stroke-linejoin"], Ut = /* @__PURE__ */ S("path", {
64
+ }), ln = ["stroke-width", "stroke-linecap", "stroke-linejoin"], an = /* @__PURE__ */ O("path", {
62
65
  d: "M39.6 17.443 24.043 33 8.487 17.443"
63
- }, null, -1), qt = [Ut];
64
- function Wt(e, n, r, t, a, u) {
65
- return _(), L("svg", {
66
+ }, null, -1), un = [an];
67
+ function sn(e, r, n, t, o, a) {
68
+ return T(), z("svg", {
66
69
  viewBox: "0 0 48 48",
67
70
  fill: "none",
68
71
  xmlns: "http://www.w3.org/2000/svg",
69
72
  stroke: "currentColor",
70
- class: ce(e.cls),
71
- style: z(e.innerStyle),
73
+ class: Oe(e.cls),
74
+ style: Q(e.innerStyle),
72
75
  "stroke-width": e.strokeWidth,
73
76
  "stroke-linecap": e.strokeLinecap,
74
77
  "stroke-linejoin": e.strokeLinejoin,
75
- onClick: n[0] || (n[0] = (...l) => e.onClick && e.onClick(...l))
76
- }, qt, 14, Bt);
78
+ onClick: r[0] || (r[0] = (...l) => e.onClick && e.onClick(...l))
79
+ }, un, 14, ln);
77
80
  }
78
- var me = /* @__PURE__ */ Oe(Vt, [["render", Wt]]);
79
- const Ht = Object.assign(me, {
80
- install: (e, n) => {
81
- var r;
82
- const t = (r = n == null ? void 0 : n.iconPrefix) != null ? r : "";
83
- e.component(t + me.name, me);
81
+ var Re = /* @__PURE__ */ He(on, [["render", sn]]);
82
+ const cn = Object.assign(Re, {
83
+ install: (e, r) => {
84
+ var n;
85
+ const t = (n = r?.iconPrefix) != null ? n : "";
86
+ e.component(t + Re.name, Re);
84
87
  }
85
- }), Gt = I({
88
+ }), dn = U({
86
89
  name: "IconUp",
87
90
  props: {
88
91
  size: {
@@ -109,47 +112,47 @@ const Ht = Object.assign(me, {
109
112
  click: (e) => !0
110
113
  },
111
114
  setup(e, {
112
- emit: n
115
+ emit: r
113
116
  }) {
114
- const r = Ce("icon"), t = F(() => [r, `${r}-up`, {
115
- [`${r}-spin`]: e.spin
116
- }]), a = F(() => {
117
+ const n = Ae("icon"), t = L(() => [n, `${n}-up`, {
118
+ [`${n}-spin`]: e.spin
119
+ }]), o = L(() => {
117
120
  const l = {};
118
- return e.size && (l.fontSize = Se(e.size) ? `${e.size}px` : e.size), e.rotate && (l.transform = `rotate(${e.rotate}deg)`), l;
121
+ return e.size && (l.fontSize = We(e.size) ? `${e.size}px` : e.size), e.rotate && (l.transform = `rotate(${e.rotate}deg)`), l;
119
122
  });
120
123
  return {
121
124
  cls: t,
122
- innerStyle: a,
125
+ innerStyle: o,
123
126
  onClick: (l) => {
124
- n("click", l);
127
+ r("click", l);
125
128
  }
126
129
  };
127
130
  }
128
- }), Kt = ["stroke-width", "stroke-linecap", "stroke-linejoin"], Xt = /* @__PURE__ */ S("path", {
131
+ }), fn = ["stroke-width", "stroke-linecap", "stroke-linejoin"], pn = /* @__PURE__ */ O("path", {
129
132
  d: "M39.6 30.557 24.043 15 8.487 30.557"
130
- }, null, -1), Jt = [Xt];
131
- function Qt(e, n, r, t, a, u) {
132
- return _(), L("svg", {
133
+ }, null, -1), mn = [pn];
134
+ function hn(e, r, n, t, o, a) {
135
+ return T(), z("svg", {
133
136
  viewBox: "0 0 48 48",
134
137
  fill: "none",
135
138
  xmlns: "http://www.w3.org/2000/svg",
136
139
  stroke: "currentColor",
137
- class: ce(e.cls),
138
- style: z(e.innerStyle),
140
+ class: Oe(e.cls),
141
+ style: Q(e.innerStyle),
139
142
  "stroke-width": e.strokeWidth,
140
143
  "stroke-linecap": e.strokeLinecap,
141
144
  "stroke-linejoin": e.strokeLinejoin,
142
- onClick: n[0] || (n[0] = (...l) => e.onClick && e.onClick(...l))
143
- }, Jt, 14, Kt);
145
+ onClick: r[0] || (r[0] = (...l) => e.onClick && e.onClick(...l))
146
+ }, mn, 14, fn);
144
147
  }
145
- var he = /* @__PURE__ */ Oe(Gt, [["render", Qt]]);
146
- const Zt = Object.assign(he, {
147
- install: (e, n) => {
148
- var r;
149
- const t = (r = n == null ? void 0 : n.iconPrefix) != null ? r : "";
150
- e.component(t + he.name, he);
148
+ var Ie = /* @__PURE__ */ He(dn, [["render", hn]]);
149
+ const vn = Object.assign(Ie, {
150
+ install: (e, r) => {
151
+ var n;
152
+ const t = (n = r?.iconPrefix) != null ? n : "";
153
+ e.component(t + Ie.name, Ie);
151
154
  }
152
- }), er = I({
155
+ }), yn = U({
153
156
  name: "IconSearch",
154
157
  props: {
155
158
  size: {
@@ -176,259 +179,309 @@ const Zt = Object.assign(he, {
176
179
  click: (e) => !0
177
180
  },
178
181
  setup(e, {
179
- emit: n
182
+ emit: r
180
183
  }) {
181
- const r = Ce("icon"), t = F(() => [r, `${r}-search`, {
182
- [`${r}-spin`]: e.spin
183
- }]), a = F(() => {
184
+ const n = Ae("icon"), t = L(() => [n, `${n}-search`, {
185
+ [`${n}-spin`]: e.spin
186
+ }]), o = L(() => {
184
187
  const l = {};
185
- return e.size && (l.fontSize = Se(e.size) ? `${e.size}px` : e.size), e.rotate && (l.transform = `rotate(${e.rotate}deg)`), l;
188
+ return e.size && (l.fontSize = We(e.size) ? `${e.size}px` : e.size), e.rotate && (l.transform = `rotate(${e.rotate}deg)`), l;
186
189
  });
187
190
  return {
188
191
  cls: t,
189
- innerStyle: a,
192
+ innerStyle: o,
190
193
  onClick: (l) => {
191
- n("click", l);
194
+ r("click", l);
192
195
  }
193
196
  };
194
197
  }
195
- }), tr = ["stroke-width", "stroke-linecap", "stroke-linejoin"], rr = /* @__PURE__ */ S("path", {
198
+ }), gn = ["stroke-width", "stroke-linecap", "stroke-linejoin"], bn = /* @__PURE__ */ O("path", {
196
199
  d: "M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485"
197
- }, null, -1), nr = [rr];
198
- function lr(e, n, r, t, a, u) {
199
- return _(), L("svg", {
200
+ }, null, -1), kn = [bn];
201
+ function wn(e, r, n, t, o, a) {
202
+ return T(), z("svg", {
200
203
  viewBox: "0 0 48 48",
201
204
  fill: "none",
202
205
  xmlns: "http://www.w3.org/2000/svg",
203
206
  stroke: "currentColor",
204
- class: ce(e.cls),
205
- style: z(e.innerStyle),
207
+ class: Oe(e.cls),
208
+ style: Q(e.innerStyle),
206
209
  "stroke-width": e.strokeWidth,
207
210
  "stroke-linecap": e.strokeLinecap,
208
211
  "stroke-linejoin": e.strokeLinejoin,
209
- onClick: n[0] || (n[0] = (...l) => e.onClick && e.onClick(...l))
210
- }, nr, 14, tr);
212
+ onClick: r[0] || (r[0] = (...l) => e.onClick && e.onClick(...l))
213
+ }, kn, 14, gn);
211
214
  }
212
- var ve = /* @__PURE__ */ Oe(er, [["render", lr]]);
213
- const ar = Object.assign(ve, {
214
- install: (e, n) => {
215
- var r;
216
- const t = (r = n == null ? void 0 : n.iconPrefix) != null ? r : "";
217
- e.component(t + ve.name, ve);
215
+ var Pe = /* @__PURE__ */ He(yn, [["render", wn]]);
216
+ const xn = Object.assign(Pe, {
217
+ install: (e, r) => {
218
+ var n;
219
+ const t = (n = r?.iconPrefix) != null ? n : "";
220
+ e.component(t + Pe.name, Pe);
218
221
  }
219
- }), $e = Symbol("__MODAL__");
220
- function qe(e) {
221
- return yt() ? (pt(e), !0) : !1;
222
- }
223
- function T(e) {
224
- return typeof e == "function" ? e() : Ne(e);
222
+ });
223
+ function Cn(e, r) {
224
+ return Lt() ? (Tt(e, r), !0) : !1;
225
225
  }
226
- const We = typeof window < "u" && typeof document < "u";
226
+ const pt = typeof window < "u" && typeof document < "u";
227
227
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
228
- const ur = Object.prototype.toString, cr = (e) => ur.call(e) === "[object Object]", or = () => {
229
- };
230
- function sr(e) {
231
- return W();
228
+ const Sn = Object.prototype.toString, On = (e) => Sn.call(e) === "[object Object]";
229
+ function ge(e) {
230
+ return Array.isArray(e) ? e : [e];
232
231
  }
233
- function ir(e, n = {}) {
234
- if (!re(e))
235
- return ht(e);
236
- const r = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
237
- for (const t in e.value)
238
- r[t] = vt(() => ({
239
- get() {
240
- return e.value[t];
241
- },
242
- set(a) {
243
- var u;
244
- if ((u = T(n.replaceRef)) == null || u)
245
- if (Array.isArray(e.value)) {
246
- const l = [...e.value];
247
- l[t] = a, e.value = l;
248
- } else {
249
- const l = { ...e.value, [t]: a };
250
- Object.setPrototypeOf(l, Object.getPrototypeOf(e.value)), e.value = l;
251
- }
252
- else
253
- e.value[t] = a;
232
+ function $n(e) {
233
+ return ee();
234
+ }
235
+ function _n(e, r = {}) {
236
+ if (!ie(e)) return Mt(e);
237
+ const n = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
238
+ for (const t in e.value) n[t] = Yt(() => ({
239
+ get() {
240
+ return e.value[t];
241
+ },
242
+ set(o) {
243
+ var a;
244
+ if (!((a = C(r.replaceRef)) !== null && a !== void 0) || a) if (Array.isArray(e.value)) {
245
+ const l = [...e.value];
246
+ l[t] = o, e.value = l;
247
+ } else {
248
+ const l = {
249
+ ...e.value,
250
+ [t]: o
251
+ };
252
+ Object.setPrototypeOf(l, Object.getPrototypeOf(e.value)), e.value = l;
254
253
  }
255
- }));
256
- return r;
254
+ else e.value[t] = o;
255
+ }
256
+ }));
257
+ return n;
257
258
  }
258
- function dr(e, n = !0, r) {
259
- sr() ? H(e, r) : n ? e() : Ae(e);
259
+ function Fn(e, r = !0, n) {
260
+ $n() ? te(e, n) : r ? e() : Ft(e);
260
261
  }
261
- function U(e) {
262
- var n;
263
- const r = T(e);
264
- return (n = r == null ? void 0 : r.$el) != null ? n : r;
262
+ function Mn(e, r, n) {
263
+ return ne(e, r, {
264
+ ...n,
265
+ immediate: !0
266
+ });
265
267
  }
266
- const oe = We ? window : void 0;
267
- function ye(...e) {
268
- let n, r, t, a;
269
- if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([r, t, a] = e, n = oe) : [n, r, t, a] = e, !n)
270
- return or;
271
- Array.isArray(r) || (r = [r]), Array.isArray(t) || (t = [t]);
272
- const u = [], l = () => {
273
- u.forEach((c) => c()), u.length = 0;
274
- }, i = (c, d, h, v) => (c.addEventListener(d, h, v), () => c.removeEventListener(d, h, v)), s = te(
275
- () => [U(n), T(a)],
276
- ([c, d]) => {
277
- if (l(), !c)
278
- return;
279
- const h = cr(d) ? { ...d } : d;
280
- u.push(
281
- ...r.flatMap((v) => t.map((f) => i(c, v, f, h)))
282
- );
283
- },
284
- { immediate: !0, flush: "post" }
285
- ), o = () => {
286
- s(), l();
287
- };
288
- return qe(o), o;
268
+ const $e = pt ? window : void 0;
269
+ function K(e) {
270
+ var r;
271
+ const n = C(e);
272
+ return (r = n?.$el) !== null && r !== void 0 ? r : n;
273
+ }
274
+ function je(...e) {
275
+ const r = (t, o, a, l) => (t.addEventListener(o, a, l), () => t.removeEventListener(o, a, l)), n = L(() => {
276
+ const t = ge(C(e[0])).filter((o) => o != null);
277
+ return t.every((o) => typeof o != "string") ? t : void 0;
278
+ });
279
+ return Mn(() => {
280
+ var t, o;
281
+ return [
282
+ (t = (o = n.value) === null || o === void 0 ? void 0 : o.map((a) => K(a))) !== null && t !== void 0 ? t : [$e].filter((a) => a != null),
283
+ ge(C(n.value ? e[1] : e[0])),
284
+ ge(Dt(n.value ? e[2] : e[1])),
285
+ C(n.value ? e[3] : e[2])
286
+ ];
287
+ }, ([t, o, a, l], d, s) => {
288
+ if (!t?.length || !o?.length || !a?.length) return;
289
+ const i = On(l) ? { ...l } : l, u = t.flatMap((c) => o.flatMap((h) => a.map((m) => r(c, h, m, i))));
290
+ s(() => {
291
+ u.forEach((c) => c());
292
+ });
293
+ }, { flush: "post" });
289
294
  }
290
- function fr() {
291
- const e = $(!1), n = W();
292
- return n && H(() => {
295
+ // @__NO_SIDE_EFFECTS__
296
+ function Yn() {
297
+ const e = A(!1), r = ee();
298
+ return r && te(() => {
293
299
  e.value = !0;
294
- }, n), e;
300
+ }, r), e;
295
301
  }
296
- function mr(e) {
297
- const n = fr();
298
- return F(() => (n.value, !!e()));
302
+ // @__NO_SIDE_EFFECTS__
303
+ function Ln(e) {
304
+ const r = /* @__PURE__ */ Yn();
305
+ return L(() => (r.value, !!e()));
299
306
  }
300
- function hr(e, n = {}) {
301
- var r, t;
302
- const {
303
- pointerTypes: a,
304
- preventDefault: u,
305
- stopPropagation: l,
306
- exact: i,
307
- onMove: s,
308
- onEnd: o,
309
- onStart: c,
310
- initialValue: d,
311
- axis: h = "both",
312
- draggingElement: v = oe,
313
- containerElement: f,
314
- handle: k = e
315
- } = n, p = $(
316
- (r = T(d)) != null ? r : { x: 0, y: 0 }
317
- ), C = $(), O = (w) => a ? a.includes(w.pointerType) : !0, M = (w) => {
318
- T(u) && w.preventDefault(), T(l) && w.stopPropagation();
319
- }, E = (w) => {
320
- var g;
321
- if (w.button !== 0 || T(n.disabled) || !O(w) || T(i) && w.target !== T(e))
322
- return;
323
- const x = T(f), Y = (g = x == null ? void 0 : x.getBoundingClientRect) == null ? void 0 : g.call(x), D = T(e).getBoundingClientRect(), ne = {
324
- x: w.clientX - (x ? D.left - Y.left + x.scrollLeft : D.left),
325
- y: w.clientY - (x ? D.top - Y.top + x.scrollTop : D.top)
307
+ const ve = {
308
+ speed: 2,
309
+ margin: 30,
310
+ direction: "both"
311
+ };
312
+ function Tn(e) {
313
+ e.scrollLeft > e.scrollWidth - e.clientWidth && (e.scrollLeft = Math.max(0, e.scrollWidth - e.clientWidth)), e.scrollTop > e.scrollHeight - e.clientHeight && (e.scrollTop = Math.max(0, e.scrollHeight - e.clientHeight));
314
+ }
315
+ function Dn(e, r = {}) {
316
+ var n, t, o, a;
317
+ const { pointerTypes: l, preventDefault: d, stopPropagation: s, exact: i, onMove: u, onEnd: c, onStart: h, initialValue: m, axis: f = "both", draggingElement: x = $e, containerElement: v, handle: F = e, buttons: Y = [0], restrictInView: I, autoScroll: P = !1 } = r, R = D((n = C(m)) !== null && n !== void 0 ? n : {
318
+ x: 0,
319
+ y: 0
320
+ }), N = D(), V = (y) => l ? l.includes(y.pointerType) : !0, b = (y) => {
321
+ C(d) && y.preventDefault(), C(s) && y.stopPropagation();
322
+ }, _ = C(P), j = typeof _ == "object" ? {
323
+ speed: (t = C(_.speed)) !== null && t !== void 0 ? t : ve.speed,
324
+ margin: (o = C(_.margin)) !== null && o !== void 0 ? o : ve.margin,
325
+ direction: (a = _.direction) !== null && a !== void 0 ? a : ve.direction
326
+ } : ve, H = (y) => typeof y == "number" ? [y, y] : [y.x, y.y], ce = (y, w, S) => {
327
+ const { clientWidth: M, clientHeight: $, scrollLeft: B, scrollTop: pe, scrollWidth: Te, scrollHeight: vt } = y, [Qe, Xe] = H(j.margin), [Ze, Ke] = H(j.speed);
328
+ let me = 0, he = 0;
329
+ (j.direction === "x" || j.direction === "both") && (S.x < Qe && B > 0 ? me = -Ze : S.x + w.width > M - Qe && B < Te - M && (me = Ze)), (j.direction === "y" || j.direction === "both") && (S.y < Xe && pe > 0 ? he = -Ke : S.y + w.height > $ - Xe && pe < vt - $ && (he = Ke)), (me || he) && y.scrollBy({
330
+ left: me,
331
+ top: he,
332
+ behavior: "auto"
333
+ });
334
+ };
335
+ let G = null;
336
+ const Me = () => {
337
+ const y = C(v);
338
+ y && !G && (G = setInterval(() => {
339
+ const w = C(e).getBoundingClientRect(), { x: S, y: M } = R.value, $ = {
340
+ x: S - y.scrollLeft,
341
+ y: M - y.scrollTop
342
+ };
343
+ $.x >= 0 && $.y >= 0 && (ce(y, w, $), $.x += y.scrollLeft, $.y += y.scrollTop, R.value = $);
344
+ }, 1e3 / 60));
345
+ }, de = () => {
346
+ G && (clearInterval(G), G = null);
347
+ }, Ye = (y, w, S, M) => {
348
+ const [$, B] = typeof S == "number" ? [S, S] : [S.x, S.y], { clientWidth: pe, clientHeight: Te } = w;
349
+ return y.x < $ || y.x + M.width > pe - $ || y.y < B || y.y + M.height > Te - B;
350
+ }, Le = () => {
351
+ if (C(r.disabled) || !N.value) return;
352
+ const y = C(v);
353
+ if (!y) return;
354
+ const w = C(e).getBoundingClientRect(), { x: S, y: M } = R.value;
355
+ Ye({
356
+ x: S - y.scrollLeft,
357
+ y: M - y.scrollTop
358
+ }, y, j.margin, w) ? Me() : de();
359
+ };
360
+ C(P) && ne(R, Le);
361
+ const fe = (y) => {
362
+ var w;
363
+ if (!C(Y).includes(y.button) || C(r.disabled) || !V(y) || C(i) && y.target !== C(e)) return;
364
+ const S = C(v), M = S == null || (w = S.getBoundingClientRect) === null || w === void 0 ? void 0 : w.call(S), $ = C(e).getBoundingClientRect(), B = {
365
+ x: y.clientX - (S ? $.left - M.left + (P ? 0 : S.scrollLeft) : $.left),
366
+ y: y.clientY - (S ? $.top - M.top + (P ? 0 : S.scrollTop) : $.top)
326
367
  };
327
- (c == null ? void 0 : c(ne, w)) !== !1 && (C.value = ne, M(w));
328
- }, G = (w) => {
329
- if (T(n.disabled) || !O(w) || !C.value)
330
- return;
331
- const g = T(f), x = T(e).getBoundingClientRect();
332
- let { x: Y, y: D } = p.value;
333
- (h === "x" || h === "both") && (Y = w.clientX - C.value.x, g && (Y = Math.min(Math.max(0, Y), g.scrollWidth - x.width))), (h === "y" || h === "both") && (D = w.clientY - C.value.y, g && (D = Math.min(Math.max(0, D), g.scrollHeight - x.height))), p.value = {
334
- x: Y,
335
- y: D
336
- }, s == null || s(p.value, w), M(w);
337
- }, A = (w) => {
338
- T(n.disabled) || !O(w) || C.value && (C.value = void 0, o == null || o(p.value, w), M(w));
368
+ h?.(B, y) !== !1 && (N.value = B, b(y));
369
+ }, g = (y) => {
370
+ if (C(r.disabled) || !V(y) || !N.value) return;
371
+ const w = C(v);
372
+ w instanceof HTMLElement && Tn(w);
373
+ const S = C(e).getBoundingClientRect();
374
+ let { x: M, y: $ } = R.value;
375
+ if ((f === "x" || f === "both") && (M = y.clientX - N.value.x, w && (M = Math.min(Math.max(0, M), w.scrollWidth - S.width))), (f === "y" || f === "both") && ($ = y.clientY - N.value.y, w && ($ = Math.min(Math.max(0, $), w.scrollHeight - S.height))), C(P) && w && (G === null && ce(w, S, {
376
+ x: M,
377
+ y: $
378
+ }), M += w.scrollLeft, $ += w.scrollTop), w && (I || P)) {
379
+ if (f !== "y") {
380
+ const B = M - w.scrollLeft;
381
+ B < 0 ? M = w.scrollLeft : B > w.clientWidth - S.width && (M = w.clientWidth - S.width + w.scrollLeft);
382
+ }
383
+ if (f !== "x") {
384
+ const B = $ - w.scrollTop;
385
+ B < 0 ? $ = w.scrollTop : B > w.clientHeight - S.height && ($ = w.clientHeight - S.height + w.scrollTop);
386
+ }
387
+ }
388
+ R.value = {
389
+ x: M,
390
+ y: $
391
+ }, u?.(R.value, y), b(y);
392
+ }, E = (y) => {
393
+ C(r.disabled) || !V(y) || N.value && (N.value = void 0, P && de(), c?.(R.value, y), b(y));
339
394
  };
340
- if (We) {
341
- const w = { capture: (t = n.capture) != null ? t : !0 };
342
- ye(k, "pointerdown", E, w), ye(v, "pointermove", G, w), ye(v, "pointerup", A, w);
395
+ if (pt) {
396
+ const y = () => {
397
+ var w;
398
+ return {
399
+ capture: (w = r.capture) !== null && w !== void 0 ? w : !0,
400
+ passive: !C(d)
401
+ };
402
+ };
403
+ je(F, "pointerdown", fe, y), je(x, "pointermove", g, y), je(x, "pointerup", E, y);
343
404
  }
344
405
  return {
345
- ...ir(p),
346
- position: p,
347
- isDragging: F(() => !!C.value),
348
- style: F(
349
- () => `left:${p.value.x}px;top:${p.value.y}px;`
350
- )
406
+ ..._n(R),
407
+ position: R,
408
+ isDragging: L(() => !!N.value),
409
+ style: L(() => `
410
+ left: ${R.value.x}px;
411
+ top: ${R.value.y}px;
412
+ ${P ? "text-wrap: nowrap;" : ""}
413
+ `)
351
414
  };
352
415
  }
353
- function vr(e, n, r = {}) {
354
- const { window: t = oe, ...a } = r;
355
- let u;
356
- const l = mr(() => t && "ResizeObserver" in t), i = () => {
357
- u && (u.disconnect(), u = void 0);
358
- }, s = F(() => Array.isArray(e) ? e.map((d) => U(d)) : [U(e)]), o = te(
359
- s,
360
- (d) => {
361
- if (i(), l.value && t) {
362
- u = new ResizeObserver(n);
363
- for (const h of d)
364
- h && u.observe(h, a);
365
- }
366
- },
367
- { immediate: !0, flush: "post" }
368
- ), c = () => {
369
- i(), o();
416
+ function Rn(e, r, n = {}) {
417
+ const { window: t = $e, ...o } = n;
418
+ let a;
419
+ const l = /* @__PURE__ */ Ln(() => t && "ResizeObserver" in t), d = () => {
420
+ a && (a.disconnect(), a = void 0);
421
+ }, s = ne(L(() => {
422
+ const u = C(e);
423
+ return Array.isArray(u) ? u.map((c) => K(c)) : [K(u)];
424
+ }), (u) => {
425
+ if (d(), l.value && t) {
426
+ a = new ResizeObserver(r);
427
+ for (const c of u) c && a.observe(c, o);
428
+ }
429
+ }, {
430
+ immediate: !0,
431
+ flush: "post"
432
+ }), i = () => {
433
+ d(), s();
370
434
  };
371
- return qe(c), {
435
+ return Cn(i), {
372
436
  isSupported: l,
373
- stop: c
437
+ stop: i
374
438
  };
375
439
  }
376
- function K(e, n = { width: 0, height: 0 }, r = {}) {
377
- const { window: t = oe, box: a = "content-box" } = r, u = F(() => {
378
- var d, h;
379
- return (h = (d = U(e)) == null ? void 0 : d.namespaceURI) == null ? void 0 : h.includes("svg");
380
- }), l = $(n.width), i = $(n.height), { stop: s } = vr(
381
- e,
382
- ([d]) => {
383
- const h = a === "border-box" ? d.borderBoxSize : a === "content-box" ? d.contentBoxSize : d.devicePixelContentBoxSize;
384
- if (t && u.value) {
385
- const v = U(e);
386
- if (v) {
387
- const f = v.getBoundingClientRect();
388
- l.value = f.width, i.value = f.height;
389
- }
390
- } else if (h) {
391
- const v = Array.isArray(h) ? h : [h];
392
- l.value = v.reduce((f, { inlineSize: k }) => f + k, 0), i.value = v.reduce((f, { blockSize: k }) => f + k, 0);
393
- } else
394
- l.value = d.contentRect.width, i.value = d.contentRect.height;
395
- },
396
- r
397
- );
398
- dr(() => {
399
- const d = U(e);
400
- d && (l.value = "offsetWidth" in d ? d.offsetWidth : n.width, i.value = "offsetHeight" in d ? d.offsetHeight : n.height);
440
+ function re(e, r = {
441
+ width: 0,
442
+ height: 0
443
+ }, n = {}) {
444
+ const { window: t = $e, box: o = "content-box" } = n, a = L(() => {
445
+ var c;
446
+ return (c = K(e)) === null || c === void 0 || (c = c.namespaceURI) === null || c === void 0 ? void 0 : c.includes("svg");
447
+ }), l = A(r.width), d = A(r.height), { stop: s } = Rn(e, ([c]) => {
448
+ const h = o === "border-box" ? c.borderBoxSize : o === "content-box" ? c.contentBoxSize : c.devicePixelContentBoxSize;
449
+ if (t && a.value) {
450
+ const m = K(e);
451
+ if (m) {
452
+ const f = m.getBoundingClientRect();
453
+ l.value = f.width, d.value = f.height;
454
+ }
455
+ } else if (h) {
456
+ const m = ge(h);
457
+ l.value = m.reduce((f, { inlineSize: x }) => f + x, 0), d.value = m.reduce((f, { blockSize: x }) => f + x, 0);
458
+ } else
459
+ l.value = c.contentRect.width, d.value = c.contentRect.height;
460
+ }, n);
461
+ Fn(() => {
462
+ const c = K(e);
463
+ c && (l.value = "offsetWidth" in c ? c.offsetWidth : r.width, d.value = "offsetHeight" in c ? c.offsetHeight : r.height);
464
+ });
465
+ const i = ne(() => K(e), (c) => {
466
+ l.value = c ? r.width : 0, d.value = c ? r.height : 0;
401
467
  });
402
- const o = te(
403
- () => U(e),
404
- (d) => {
405
- l.value = d ? n.width : 0, i.value = d ? n.height : 0;
406
- }
407
- );
408
- function c() {
409
- s(), o();
468
+ function u() {
469
+ s(), i();
410
470
  }
411
471
  return {
412
472
  width: l,
413
- height: i,
414
- stop: c
473
+ height: d,
474
+ stop: u
415
475
  };
416
476
  }
417
- const yr = (e) => (Ve("data-v-37f80068"), e = e(), Be(), e), pr = { class: "title text-16px font-bold" }, gr = { class: "action" }, br = ["form"], kr = {
477
+ const Ue = /* @__PURE__ */ Symbol("__MODAL__"), In = { class: "title text-16px font-bold" }, Pn = { class: "action" }, jn = ["form"], En = {
418
478
  key: 2,
419
479
  class: "modal-loading"
420
- }, wr = /* @__PURE__ */ yr(() => /* @__PURE__ */ S("div", { class: "lds-ring" }, [
421
- /* @__PURE__ */ S("div"),
422
- /* @__PURE__ */ S("div"),
423
- /* @__PURE__ */ S("div"),
424
- /* @__PURE__ */ S("div")
425
- ], -1)), xr = [
426
- wr
427
- ], Cr = {
480
+ }, zn = {
428
481
  name: "ModalContainer",
429
482
  inheritAttrs: !1
430
- }, Sr = /* @__PURE__ */ I({
431
- ...Cr,
483
+ }, Nn = /* @__PURE__ */ U({
484
+ ...zn,
432
485
  props: {
433
486
  id: {},
434
487
  form: {},
@@ -461,160 +514,185 @@ const yr = (e) => (Ve("data-v-37f80068"), e = e(), Be(), e), pr = { class: "titl
461
514
  onCancel: {}
462
515
  },
463
516
  emits: ["submit"],
464
- setup(e, { expose: n, emit: r }) {
465
- st((y) => ({
466
- b09c48b4: y.zIndex
517
+ setup(e, { expose: r, emit: n }) {
518
+ Ct((g) => ({
519
+ v4586ed24: g.zIndex
467
520
  }));
468
- const t = e, a = r, u = we($e), l = $(!1);
469
- let i = 0, s = 0;
470
- const o = V(), c = V(), d = V(), h = V(), v = V(), f = V(), { height: k } = K(o), { height: p } = K(d, void 0, { box: "border-box" }), { height: C } = K(h, void 0, { box: "border-box" }), { height: O } = K(v), { height: M } = K(f), { x: E, y: G } = hr(d, {
521
+ const t = e, o = n, a = Ve(Ue), l = D(!1);
522
+ let d = 0, s = 0;
523
+ const i = A(), u = A(), c = A(), h = A(), m = A(), f = A(), { height: x } = re(
524
+ i
525
+ ), { height: v } = re(
526
+ c,
527
+ void 0,
528
+ { box: "border-box" }
529
+ ), { height: F } = re(
530
+ h,
531
+ void 0,
532
+ { box: "border-box" }
533
+ ), { height: Y } = re(
534
+ m
535
+ ), { height: I } = re(
536
+ f
537
+ ), { x: P, y: R } = Dn(c, {
471
538
  initialValue: { x: 0, y: 0 }
472
539
  });
473
- function A() {
474
- u == null || u.close(t.id);
540
+ function N() {
541
+ a?.close(t.id);
475
542
  }
476
- function w(y) {
477
- return typeof y == "number" ? `${y}px` : y;
543
+ function V(g) {
544
+ return typeof g == "number" ? `${g}px` : g;
478
545
  }
479
- const g = F(() => {
480
- const y = {};
481
- return t.mode === "dialog" && (y.justifyContent = "center"), t.mode === "drawer" && (y.justifyContent = {
546
+ const b = L(() => {
547
+ const g = {};
548
+ return t.mode === "dialog" && (g.justifyContent = "center"), t.mode === "drawer" && (g.justifyContent = {
482
549
  left: "flex-start",
483
550
  right: "flex-end",
484
551
  top: "flex-start",
485
552
  bottom: "flex-end"
486
- }[t.position], y.flexDirection = {
553
+ }[t.position], g.flexDirection = {
487
554
  left: "row",
488
555
  right: "row",
489
556
  top: "column",
490
557
  bottom: "column"
491
- }[t.position]), y;
492
- }), x = F(() => {
493
- const y = {};
494
- return t.mode === "drawer" && ["top", "bottom"].includes(t.position) ? y.maxHeight = w(t.maxHeight) : (y.width = w(t.sizes[t.size]), y.maxWidth = w(t.maxWidth)), t.width && (y.width = w(t.width)), t.height && (y.height = w(t.height)), t.fullscreen && (y.maxWidth = "unset", y.width = "100%", y.position = "fixed", y.top = 0, y.left = 0, y.bottom = 0, y.right = 0, y.borderRadius = 0), t.draggable && !t.fullscreen && t.mode === "dialog" && (y.transform = `translate3d(${E.value - i}px, ${G.value - s}px, 0px)`), t.mode === "drawer" && (y.borderRadius = 0, ["left", "right"].includes(t.position) ? y.height = "100%" : y.width = "100%"), t.offset && t.mode === "dialog" && (y.marginLeft = `${t.offset.x || 0}px`, y.marginTop = `${t.offset.y || 0}px`), t.backgroundColor && (y.backgroundColor = t.backgroundColor), y;
495
- }), Y = F(() => {
496
- const y = {};
497
- return t.draggable && !t.fullscreen && t.mode === "dialog" && (y.cursor = "move"), y;
498
- }), D = F(() => {
499
- const y = {}, P = O.value + M.value + p.value + C.value, Me = Math.floor(k.value * (Number(w(t.maxHeight).replace("%", "")) / 100));
500
- return t.maxHeight && (y.maxHeight = `${Me - P}px`), t.mode === "drawer" && (y.maxHeight = "unset", ["left", "right"].includes(t.position) && (y.height = `${k.value - P}px`)), t.fullscreen && (y.maxHeight = "unset", y.height = `calc(100% - ${P}px)`), t.type !== "component" && (y.padding = "0"), t.bodyStyle && Object.assign(y, t.bodyStyle), y;
558
+ }[t.position]), g;
559
+ }), _ = L(() => {
560
+ const g = {};
561
+ return t.mode === "drawer" && ["top", "bottom"].includes(t.position) ? g.maxHeight = V(t.maxHeight) : (g.width = V(t.sizes[t.size]), g.maxWidth = V(t.maxWidth)), t.width && (g.width = V(t.width)), t.height && (g.height = V(t.height)), t.fullscreen && (g.maxWidth = "unset", g.width = "100%", g.position = "fixed", g.top = 0, g.left = 0, g.bottom = 0, g.right = 0, g.borderRadius = 0), t.draggable && !t.fullscreen && t.mode === "dialog" && (g.transform = `translate3d(${P.value - d}px, ${R.value - s}px, 0px)`), t.mode === "drawer" && (g.borderRadius = 0, ["left", "right"].includes(t.position) ? g.height = "100%" : g.width = "100%"), t.offset && t.mode === "dialog" && (g.marginLeft = `${t.offset.x || 0}px`, g.marginTop = `${t.offset.y || 0}px`), t.backgroundColor && (g.backgroundColor = t.backgroundColor), g;
562
+ }), j = L(() => {
563
+ const g = {};
564
+ return t.draggable && !t.fullscreen && t.mode === "dialog" && (g.cursor = "move"), g;
565
+ }), H = L(() => {
566
+ const g = {}, E = Y.value + I.value + v.value + F.value, y = Math.floor(
567
+ x.value * (Number(V(t.maxHeight).replace("%", "")) / 100)
568
+ );
569
+ return t.maxHeight && (g.maxHeight = `${y - E}px`), t.mode === "drawer" && (g.maxHeight = "unset", ["left", "right"].includes(t.position) && (g.height = `${x.value - E}px`)), t.fullscreen && (g.maxHeight = "unset", g.height = `calc(100% - ${E}px)`), t.type !== "component" && (g.padding = "0"), t.bodyStyle && Object.assign(g, t.bodyStyle), g;
501
570
  });
502
- function ne() {
503
- const y = c.value;
504
- if (t.form && y) {
505
- const P = y.querySelector(`form[name="${t.form}"]`);
506
- P && P.dispatchEvent(new Event("submit"));
571
+ function ce() {
572
+ const g = u.value;
573
+ if (t.form && g) {
574
+ const E = g.querySelector(
575
+ `form[name="${t.form}"]`
576
+ );
577
+ E && E.dispatchEvent(new Event("submit"));
507
578
  }
508
579
  t.onOk && t.onOk({
509
- close: () => u == null ? void 0 : u.close(t.id)
510
- }), a("submit");
580
+ close: () => a?.close(t.id)
581
+ }), o("submit");
511
582
  }
512
- function Qe() {
513
- u == null || u.close(t.id), t != null && t.onCancel && t.onCancel();
583
+ function G() {
584
+ a?.close(t.id), t?.onCancel && t.onCancel();
514
585
  }
515
- function Ze() {
586
+ function Me() {
516
587
  window && window.addEventListener("resize", () => {
517
- ee(o), ee(c), c.value && (i = c.value.offsetLeft, s = c.value.offsetTop);
588
+ se(i), se(u), u.value && (d = u.value.offsetLeft, s = u.value.offsetTop);
518
589
  });
519
590
  }
520
- function et() {
591
+ function de() {
521
592
  if (t.closeable && t.esc) {
522
- const y = ({ key: P }) => {
523
- P === "Escape" && (u == null || u.close(t.id), window.removeEventListener("keydown", y));
593
+ const g = ({ key: E }) => {
594
+ E === "Escape" && (a?.close(t.id), window.removeEventListener("keydown", g));
524
595
  };
525
- window.addEventListener("keydown", y);
596
+ window.addEventListener("keydown", g);
526
597
  }
527
598
  }
528
- function tt() {
529
- i = c.value.offsetLeft, s = c.value.offsetTop;
599
+ function Ye() {
600
+ d = u.value.offsetLeft, s = u.value.offsetTop;
530
601
  }
531
- H(() => {
532
- et(), Ze();
533
- }), it(() => {
602
+ te(() => {
603
+ de(), Me();
604
+ }), St(() => {
534
605
  });
535
- function rt() {
536
- return l.value = !0, () => Fe();
606
+ function Le() {
607
+ return l.value = !0, () => fe();
537
608
  }
538
- function Fe() {
609
+ function fe() {
539
610
  l.value = !1;
540
611
  }
541
- return n({
542
- showLoading: rt,
543
- hideLoading: Fe
544
- }), (y, P) => (_(), L("div", {
612
+ return r({
613
+ showLoading: Le,
614
+ hideLoading: fe
615
+ }), (g, E) => (T(), z("div", {
545
616
  ref_key: "wrapperRef",
546
- ref: o,
617
+ ref: i,
547
618
  class: "modal-wrapper",
548
- style: z(g.value),
549
- onClick: P[0] || (P[0] = dt((Me) => y.maskClosable && A(), ["self"]))
619
+ style: Q(b.value),
620
+ onClick: E[0] || (E[0] = Ot((y) => e.maskClosable && N(), ["self"]))
550
621
  }, [
551
- S("div", {
622
+ O("div", {
552
623
  ref_key: "contentRef",
553
- ref: c,
554
- class: ce(["modal-content", { [`${y.mode}-mode`]: !0, [`${y.position}-position`]: !0 }]),
555
- style: z(x.value)
624
+ ref: u,
625
+ class: Oe(["modal-content", { [`${e.mode}-mode`]: !0, [`${e.position}-position`]: !0 }]),
626
+ style: Q(_.value)
556
627
  }, [
557
- y.header ? (_(), L("div", {
628
+ e.header ? (T(), z("div", {
558
629
  key: 0,
559
630
  ref_key: "headerRef",
560
- ref: d,
631
+ ref: c,
561
632
  class: "modal-header",
562
- style: z(Y.value),
563
- onMousedown: tt
633
+ style: Q(j.value),
634
+ onMousedown: Ye
564
635
  }, [
565
- S("div", pr, N(y.title), 1),
566
- S("div", gr, [
567
- y.closeable ? (_(), L("div", {
636
+ O("div", In, X(e.title), 1),
637
+ O("div", Pn, [
638
+ e.closeable ? (T(), z("div", {
568
639
  key: 0,
569
640
  class: "i-icon-park-outline:close block cursor-pointer",
570
- onClick: A
571
- })) : q("", !0)
641
+ onClick: N
642
+ })) : J("", !0)
572
643
  ])
573
- ], 36)) : q("", !0),
574
- S("div", {
644
+ ], 36)) : J("", !0),
645
+ O("div", {
575
646
  id: "modal-header-slot",
576
647
  ref_key: "headerSlotRef",
577
- ref: v
648
+ ref: m
578
649
  }, null, 512),
579
- S("div", {
650
+ O("div", {
580
651
  class: "modal-body",
581
- style: z(D.value)
652
+ style: Q(H.value)
582
653
  }, [
583
- (_(), ue(ze(y.component), ft(mt(y.componentProps)), null, 16))
654
+ (T(), Se(dt(e.component), $t(_t(e.componentProps)), null, 16))
584
655
  ], 4),
585
- S("div", {
656
+ O("div", {
586
657
  id: "modal-footer-slot",
587
658
  ref_key: "footerSlotRef",
588
659
  ref: f
589
660
  }, null, 512),
590
- y.footer ? (_(), L("div", {
661
+ e.footer ? (T(), z("div", {
591
662
  key: 1,
592
663
  ref_key: "footerRef",
593
664
  ref: h,
594
665
  class: "modal-footer space-x-2"
595
666
  }, [
596
- S("button", {
667
+ O("button", {
597
668
  class: "cancel-button",
598
669
  type: "button",
599
- onClick: Qe
600
- }, N(y.cancelText), 1),
601
- S("button", {
670
+ onClick: G
671
+ }, X(e.cancelText), 1),
672
+ O("button", {
602
673
  class: "submit-button",
603
- form: y.form,
674
+ form: e.form,
604
675
  type: "submit",
605
- onClick: ne
606
- }, N(y.submitText), 9, br)
607
- ], 512)) : q("", !0),
608
- l.value ? (_(), L("div", kr, xr)) : q("", !0)
676
+ onClick: ce
677
+ }, X(e.submitText), 9, jn)
678
+ ], 512)) : J("", !0),
679
+ l.value ? (T(), z("div", En, [...E[1] || (E[1] = [
680
+ O("div", { class: "lds-ring" }, [
681
+ O("div"),
682
+ O("div"),
683
+ O("div"),
684
+ O("div")
685
+ ], -1)
686
+ ])])) : J("", !0)
609
687
  ], 6)
610
688
  ], 4));
611
689
  }
612
- }), se = (e, n) => {
613
- const r = e.__vccOpts || e;
614
- for (const [t, a] of n)
615
- r[t] = a;
616
- return r;
617
- }, Or = /* @__PURE__ */ se(Sr, [["__scopeId", "data-v-37f80068"]]), $r = { class: "modal-dialog" }, _r = { class: "dialog-body" }, Fr = { class: "dialog-title" }, Mr = { class: "dialog-content" }, Yr = /* @__PURE__ */ I({
690
+ }), _e = (e, r) => {
691
+ const n = e.__vccOpts || e;
692
+ for (const [t, o] of r)
693
+ n[t] = o;
694
+ return n;
695
+ }, Bn = /* @__PURE__ */ _e(Nn, [["__scopeId", "data-v-1d490f4f"]]), Vn = { class: "modal-dialog" }, qn = { class: "dialog-body" }, An = { class: "dialog-title" }, Wn = { class: "dialog-content" }, Hn = /* @__PURE__ */ U({
618
696
  __name: "modal-dialog",
619
697
  props: {
620
698
  type: {},
@@ -627,70 +705,70 @@ const yr = (e) => (Ve("data-v-37f80068"), e = e(), Be(), e), pr = { class: "titl
627
705
  footer: {}
628
706
  },
629
707
  setup(e) {
630
- const n = e, r = He(), t = F(() => n.title ? n.title : {
708
+ const r = e, n = mt(), t = L(() => r.title ? r.title : {
631
709
  confirm: "提示",
632
710
  info: "提示",
633
711
  warning: "警告",
634
712
  error: "错误",
635
713
  success: "成功"
636
- }[n.type]);
637
- async function a() {
638
- n.onOk && await n.onOk(), r.close();
714
+ }[r.type]);
715
+ async function o() {
716
+ r.onOk && await r.onOk(), n.close();
639
717
  }
640
- async function u() {
641
- n.onCancel && await n.onCancel(), r.close();
718
+ async function a() {
719
+ r.onCancel && await r.onCancel(), n.close();
642
720
  }
643
- return (l, i) => (_(), L("section", $r, [
644
- S("div", _r, [
645
- S("div", Fr, N(t.value), 1),
646
- S("div", Mr, N(l.content), 1)
721
+ return (l, d) => (T(), z("section", Vn, [
722
+ O("div", qn, [
723
+ O("div", An, X(t.value), 1),
724
+ O("div", Wn, X(e.content), 1)
647
725
  ]),
648
- S("div", {
726
+ O("div", {
649
727
  class: "dialog-footer space-x-2",
650
- style: z(l.type === "confirm" ? { "justify-content": "end" } : { "border-top": "none" })
728
+ style: Q(e.type === "confirm" ? { "justify-content": "end" } : { "border-top": "none" })
651
729
  }, [
652
- l.footer ? (_(), ue(ze(l.footer), { key: 0 })) : (_(), L(ae, { key: 1 }, [
653
- S("button", {
730
+ e.footer ? (T(), Se(dt(e.footer), { key: 0 })) : (T(), z(Ce, { key: 1 }, [
731
+ O("button", {
654
732
  class: "submit-button",
655
733
  type: "button",
656
- onClick: a
657
- }, N(l.okText), 1),
658
- l.type === "confirm" ? (_(), L("button", {
734
+ onClick: o
735
+ }, X(e.okText), 1),
736
+ e.type === "confirm" ? (T(), z("button", {
659
737
  key: 0,
660
738
  class: "cancel-button",
661
739
  type: "button",
662
- onClick: u
663
- }, N(l.cancelText), 1)) : q("", !0)
740
+ onClick: a
741
+ }, X(e.cancelText), 1)) : J("", !0)
664
742
  ], 64))
665
743
  ], 4)
666
744
  ]));
667
745
  }
668
- }), Dr = /* @__PURE__ */ se(Yr, [["__scopeId", "data-v-3efc8aed"]]), Tr = (e) => (Ve("data-v-559bdf2e"), e = e(), Be(), e), Lr = { class: "flex-center" }, Pr = /* @__PURE__ */ Tr(() => /* @__PURE__ */ S("div", { class: "modal-loading" }, [
669
- /* @__PURE__ */ S("div", { class: "lds-ring" }, [
670
- /* @__PURE__ */ S("div"),
671
- /* @__PURE__ */ S("div"),
672
- /* @__PURE__ */ S("div"),
673
- /* @__PURE__ */ S("div")
674
- ])
675
- ], -1)), Rr = { class: "modal-loading-text" }, jr = /* @__PURE__ */ I({
746
+ }), Un = /* @__PURE__ */ _e(Hn, [["__scopeId", "data-v-f5ece095"]]), Gn = { class: "flex-center" }, Qn = { class: "modal-loading-text" }, Xn = /* @__PURE__ */ U({
676
747
  __name: "modal-loading",
677
748
  props: {
678
749
  text: { default: "加载中" }
679
750
  },
680
751
  setup(e) {
681
- return (n, r) => (_(), L("section", Lr, [
682
- Pr,
683
- S("div", Rr, N(n.text), 1)
752
+ return (r, n) => (T(), z("section", Gn, [
753
+ n[0] || (n[0] = O("div", { class: "modal-loading" }, [
754
+ O("div", { class: "lds-ring" }, [
755
+ O("div"),
756
+ O("div"),
757
+ O("div"),
758
+ O("div")
759
+ ])
760
+ ], -1)),
761
+ O("div", Qn, X(e.text), 1)
684
762
  ]));
685
763
  }
686
- }), Ir = /* @__PURE__ */ se(jr, [["__scopeId", "data-v-559bdf2e"]]), Er = {
764
+ }), Zn = /* @__PURE__ */ _e(Xn, [["__scopeId", "data-v-27aee8fa"]]), Kn = {
687
765
  key: 0,
688
766
  class: "modal-teleport"
689
- }, zr = {
767
+ }, Jn = {
690
768
  name: "ModalProvider",
691
769
  inheritAttrs: !1
692
- }, Nr = /* @__PURE__ */ I({
693
- ...zr,
770
+ }, er = /* @__PURE__ */ U({
771
+ ...Jn,
694
772
  props: {
695
773
  appendToBody: { type: [Boolean, String], default: !1 },
696
774
  sizes: { default: () => ({
@@ -702,170 +780,172 @@ const yr = (e) => (Ve("data-v-37f80068"), e = e(), Be(), e), pr = { class: "titl
702
780
  maxHeight: { default: "90%" },
703
781
  offset: { default: () => ({ x: 0, y: 0 }) }
704
782
  },
705
- setup(e, { expose: n }) {
706
- const r = V([]), t = $(!1), a = W();
707
- function u(h, v = {}, f = {}) {
708
- const k = ot(
709
- () => Promise.resolve(typeof h == "string" ? Dr : h)
783
+ setup(e, { expose: r }) {
784
+ const n = A([]), t = D(!1), o = ee();
785
+ function a(h, m = {}, f = {}) {
786
+ const x = xt(
787
+ () => Promise.resolve(typeof h == "string" ? Un : h)
710
788
  );
711
- typeof h == "string" && (v.type = h, f.size = "small", f.fullscreen = !1, f.mode = "dialog", f.footer = !1, f.header = !1);
712
- const p = Math.random().toString(32).slice(2), C = Object.assign({
713
- zIndex: typeof h == "string" ? 1100 : 1e3
714
- }, f), O = new Promise((M, E) => {
715
- r.value.push({
716
- id: p,
717
- component: k,
718
- props: v || {},
789
+ typeof h == "string" && (m.type = h, f.size = "small", f.fullscreen = !1, f.mode = "dialog", f.footer = !1, f.header = !1);
790
+ const v = Math.random().toString(32).slice(2), F = Object.assign(
791
+ {
792
+ zIndex: typeof h == "string" ? 1100 : 1e3
793
+ },
794
+ f
795
+ ), Y = new Promise((I, P) => {
796
+ n.value.push({
797
+ id: v,
798
+ component: x,
799
+ props: m || {},
719
800
  options: {
720
- ...C,
801
+ ...F,
721
802
  type: typeof h == "string" ? h : "component"
722
803
  },
723
- resolve: M,
724
- reject: E,
804
+ resolve: I,
805
+ reject: P,
725
806
  listeners: []
726
- }), ee(r);
727
- }).catch((M) => M === "CANCEL" ? new Promise(() => {
728
- }) : Promise.reject(M));
729
- return Object.assign(O, {
730
- close: () => l(p)
807
+ }), se(n);
808
+ }).catch((I) => I === "CANCEL" ? new Promise(() => {
809
+ }) : Promise.reject(I));
810
+ return Object.assign(Y, {
811
+ close: () => l(v)
731
812
  });
732
813
  }
733
- function l(h, v) {
734
- const f = r.value.findIndex((p) => p.id === h);
814
+ function l(h, m) {
815
+ const f = n.value.findIndex((v) => v.id === h);
735
816
  if (f < 0)
736
817
  return;
737
- const k = r.value[f];
738
- v === void 0 ? k == null || k.reject("CANCEL") : k == null || k.resolve(v), r.value.splice(f, 1), ee(r);
818
+ const x = n.value[f];
819
+ m === void 0 ? x?.reject("CANCEL") : x?.resolve(m), n.value.splice(f, 1), se(n);
739
820
  }
740
- function i() {
741
- !r.value || r.value.length === 0 || (r.value.forEach((h) => {
742
- h == null || h.reject("CANCEL");
743
- }), r.value = [], ee(r));
821
+ function d() {
822
+ !n.value || n.value.length === 0 || (n.value.forEach((h) => {
823
+ h?.reject("CANCEL");
824
+ }), n.value = [], se(n));
744
825
  }
745
- function s(h, v) {
746
- const f = r.value.find((p) => p.id === h);
826
+ function s(h, m) {
827
+ const f = n.value.find((v) => v.id === h);
747
828
  if (!f)
748
829
  return;
749
- const k = f.listeners.find((p) => p.event === v);
750
- k && k.callback({
751
- open: u,
752
- close: (p) => l(f.id, p),
753
- closeAll: i,
754
- showLoading: () => o(f.id),
755
- hideLoading: () => c(f.id),
756
- confirm: (p) => u("confirm", p),
757
- success: (p) => u("success", p),
758
- error: (p) => u("error", p),
759
- warning: (p) => u("warning", p),
760
- info: (p) => u("info", p)
830
+ const x = f.listeners.find((v) => v.event === m);
831
+ x && x.callback({
832
+ open: a,
833
+ close: (v) => l(f.id, v),
834
+ closeAll: d,
835
+ showLoading: () => i(f.id),
836
+ hideLoading: () => u(f.id),
837
+ confirm: (v) => a("confirm", v),
838
+ success: (v) => a("success", v),
839
+ error: (v) => a("error", v),
840
+ warning: (v) => a("warning", v),
841
+ info: (v) => a("info", v)
761
842
  });
762
843
  }
763
- function o(h, v) {
764
- if (!a)
844
+ function i(h, m) {
845
+ if (!o)
765
846
  return;
766
- const [f] = a.refs[`modal-container_${h}`] || [];
847
+ const [f] = o.refs[`modal-container_${h}`] || [];
767
848
  if (f)
768
849
  return f.showLoading();
769
850
  {
770
- const { close: k } = u(Ir, {
771
- text: v == null ? void 0 : v.text
772
- }, {
773
- footer: !1,
774
- header: !1,
775
- closeable: !1,
776
- backgroundColor: "transparent"
777
- });
778
- return v != null && v.duration && setTimeout(
779
- () => {
780
- k();
851
+ const { close: x } = a(
852
+ Zn,
853
+ {
854
+ text: m?.text
781
855
  },
782
- v == null ? void 0 : v.duration
783
- ), k;
856
+ {
857
+ footer: !1,
858
+ header: !1,
859
+ closeable: !1,
860
+ backgroundColor: "transparent"
861
+ }
862
+ );
863
+ return m?.duration && setTimeout(() => {
864
+ x();
865
+ }, m?.duration), x;
784
866
  }
785
867
  }
786
- function c(h) {
787
- if (!a)
868
+ function u(h) {
869
+ if (!o)
788
870
  return;
789
- const [v] = a.refs[`modal-container_${h}`];
790
- if (v)
791
- return v.hideLoading();
792
- }
793
- function d(h, v, f) {
794
- const k = r.value.find((p) => p.id === h);
795
- k && k.listeners.push({
796
- event: v,
871
+ const [m] = o.refs[`modal-container_${h}`];
872
+ if (m)
873
+ return m.hideLoading();
874
+ }
875
+ function c(h, m, f) {
876
+ const x = n.value.find((v) => v.id === h);
877
+ x && x.listeners.push({
878
+ event: m,
797
879
  callback: f
798
880
  });
799
881
  }
800
- return ge($e, {
801
- open: u,
882
+ return ze(Ue, {
883
+ open: a,
802
884
  close: l,
803
- closeAll: i,
804
- addEventListener: d,
805
- showLoading: o,
806
- hideLoading: c
807
- }), n({
808
- elements: r,
809
- open: u,
885
+ closeAll: d,
886
+ addEventListener: c,
887
+ showLoading: i,
888
+ hideLoading: u
889
+ }), r({
890
+ elements: n,
891
+ open: a,
810
892
  close: l,
811
- closeAll: i
812
- }), H(() => {
893
+ closeAll: d
894
+ }), te(() => {
813
895
  t.value = !0;
814
- }), (h, v) => (_(), L(ae, null, [
815
- nt(h.$slots, "default", {}, void 0, !0),
816
- t.value ? (_(), L("div", Er, [
817
- (_(), ue(lt, {
818
- disabled: !h.appendToBody,
819
- to: typeof h.appendToBody == "string" ? h.appendToBody : "body"
896
+ }), (h, m) => (T(), z(Ce, null, [
897
+ yt(h.$slots, "default", {}, void 0, !0),
898
+ t.value ? (T(), z("div", Kn, [
899
+ (T(), Se(gt, {
900
+ disabled: !e.appendToBody,
901
+ to: typeof e.appendToBody == "string" ? e.appendToBody : "body"
820
902
  }, [
821
- m(at, { name: "modal-fade" }, {
822
- default: ut(() => [
823
- (_(!0), L(ae, null, ct(r.value, (f) => (_(), ue(Or, B({
903
+ p(bt, { name: "modal-fade" }, {
904
+ default: kt(() => [
905
+ (T(!0), z(Ce, null, wt(n.value, (f) => (T(), Se(Bn, Z({
824
906
  id: f.id,
825
907
  key: f.id,
826
908
  ref_for: !0,
827
909
  ref: `modal-container_${f.id}`,
828
910
  component: f.component,
829
911
  "component-props": f.props,
830
- "max-height": h.maxHeight,
831
- "max-width": h.maxWidth,
832
- offset: h.offset,
833
- sizes: h.sizes
834
- }, f.options, {
912
+ "max-height": e.maxHeight,
913
+ "max-width": e.maxWidth,
914
+ offset: e.offset,
915
+ sizes: e.sizes
916
+ }, { ref_for: !0 }, f.options, {
835
917
  onSubmit: () => s(f.id, "submit")
836
918
  }), null, 16, ["id", "component", "component-props", "max-height", "max-width", "offset", "sizes", "onSubmit"]))), 128))
837
919
  ]),
838
920
  _: 1
839
921
  })
840
922
  ], 8, ["disabled", "to"]))
841
- ])) : q("", !0)
923
+ ])) : J("", !0)
842
924
  ], 64));
843
925
  }
844
- }), Ar = /* @__PURE__ */ se(Nr, [["__scopeId", "data-v-448d3772"]]);
845
- function pe(e, n) {
846
- var r, t;
847
- let a = e == null ? void 0 : e.parent;
848
- for (; a && ((r = a == null ? void 0 : a.type) == null ? void 0 : r.name) !== n; )
849
- a = a.parent;
850
- return ((t = a == null ? void 0 : a.type) == null ? void 0 : t.name) === n ? a : null;
926
+ }), tr = /* @__PURE__ */ _e(er, [["__scopeId", "data-v-d74e77f1"]]);
927
+ function Ee(e, r) {
928
+ let n = e?.parent;
929
+ for (; n && n?.type?.name !== r; )
930
+ n = n.parent;
931
+ return n?.type?.name === r ? n : null;
851
932
  }
852
- function He() {
853
- const e = we($e), n = W();
854
- function r(t, a, u) {
933
+ function mt() {
934
+ const e = Ve(Ue), r = ee();
935
+ function n(t, o, a) {
855
936
  if (!e)
856
937
  throw new Error("Not Found Modal Provider Component");
857
- return e.open(t, a, u);
938
+ return e.open(t, o, a);
858
939
  }
859
940
  return {
860
- open: r,
941
+ open: n,
861
942
  close(t) {
862
- var a;
863
943
  if (!e)
864
944
  throw new Error("Not Found Modal Provider Component");
865
- const u = pe(n, "ModalContainer"), l = (a = u == null ? void 0 : u.props) == null ? void 0 : a.id;
866
- if (!l)
945
+ const o = Ee(r, "ModalContainer")?.props?.id;
946
+ if (!o)
867
947
  throw new Error("Not Found Current Modal Container");
868
- e.close(l, t);
948
+ e.close(o, t);
869
949
  },
870
950
  closeAll() {
871
951
  if (!e)
@@ -873,18 +953,16 @@ function He() {
873
953
  e.closeAll();
874
954
  },
875
955
  showLoading(t) {
876
- var a;
877
956
  if (!e)
878
957
  throw new Error("Not Found Modal Provider Component");
879
- const u = pe(n, "ModalContainer"), l = (a = u == null ? void 0 : u.props) == null ? void 0 : a.id;
880
- return e.showLoading(l, t);
958
+ const o = Ee(r, "ModalContainer")?.props?.id;
959
+ return e.showLoading(o, t);
881
960
  },
882
961
  hideLoading() {
883
- var t;
884
962
  if (!e)
885
963
  throw new Error("Not Found Modal Provider Component");
886
- const a = pe(n, "ModalContainer"), u = (t = a == null ? void 0 : a.props) == null ? void 0 : t.id;
887
- return e.hideLoading(u);
964
+ const t = Ee(r, "ModalContainer")?.props?.id;
965
+ return e.hideLoading(t);
888
966
  },
889
967
  confirm(t) {
890
968
  return this.open("confirm", t);
@@ -903,389 +981,236 @@ function He() {
903
981
  }
904
982
  };
905
983
  }
906
- const Le = {
907
- id: Symbol("ID"),
908
- source: Symbol("Source")
984
+ const nt = {
985
+ id: /* @__PURE__ */ Symbol("ID"),
986
+ source: /* @__PURE__ */ Symbol("Source")
909
987
  };
910
- function Vr(e, n) {
911
- const r = $({});
912
- return e == null || e.forEach((a) => {
913
- let u = null;
914
- a.default && (u = (typeof a.default == "function" ? a.default() : a.default) || null), n && n[a.key] !== void 0 && (u = n[a.key]), r.value[a.key] = u;
915
- }), [r, (a) => {
916
- r.value = a;
988
+ function nr(e, r) {
989
+ const n = D({});
990
+ return e?.forEach((o) => {
991
+ let a = null;
992
+ o.default && (a = (typeof o.default == "function" ? o.default() : o.default) || null), r && r[o.key] !== void 0 && (a = r[o.key]), n.value[o.key] = a;
993
+ }), [n, (o) => {
994
+ n.value = o;
917
995
  }];
918
996
  }
919
- var ie = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
920
- function _e(e) {
921
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
997
+ function rr(e) {
998
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !qe(e);
922
999
  }
923
- var Br = { exports: {} };
924
- (function(e, n) {
925
- (function(r, t) {
926
- e.exports = t(b);
927
- })(ie, function(r) {
928
- function t(l) {
929
- return l && typeof l == "object" && "default" in l ? l : {
930
- default: l
931
- };
1000
+ const or = /* @__PURE__ */ U({
1001
+ props: {
1002
+ form: {
1003
+ type: Object,
1004
+ required: !0
1005
+ },
1006
+ value: {
1007
+ type: Object
1008
+ },
1009
+ columns: {
1010
+ type: Number,
1011
+ default: 2
932
1012
  }
933
- var a = t(r), u = {
934
- name: "zh-cn",
935
- weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
936
- weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"),
937
- weekdaysMin: "日_一_二_三_四_五_六".split("_"),
938
- months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
939
- monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
940
- ordinal: function(l, i) {
941
- return i === "W" ? l + "周" : l + "日";
942
- },
943
- weekStart: 1,
944
- yearStart: 4,
945
- formats: {
946
- LT: "HH:mm",
947
- LTS: "HH:mm:ss",
948
- L: "YYYY/MM/DD",
949
- LL: "YYYY年M月D日",
950
- LLL: "YYYY年M月D日Ah点mm分",
951
- LLLL: "YYYY年M月D日ddddAh点mm分",
952
- l: "YYYY/M/D",
953
- ll: "YYYY年M月D日",
954
- lll: "YYYY年M月D日 HH:mm",
955
- llll: "YYYY年M月D日dddd HH:mm"
956
- },
957
- relativeTime: {
958
- future: "%s内",
959
- past: "%s前",
960
- s: "几秒",
961
- m: "1 分钟",
962
- mm: "%d 分钟",
963
- h: "1 小时",
964
- hh: "%d 小时",
965
- d: "1 天",
966
- dd: "%d 天",
967
- M: "1 个月",
968
- MM: "%d 个月",
969
- y: "1 年",
970
- yy: "%d 年"
1013
+ },
1014
+ setup(e) {
1015
+ const r = mt(), n = e.form.map((s) => ({
1016
+ ...s,
1017
+ collapsed: !1
1018
+ })), t = Array.from(new Set(n.map((s) => s.group).flat().filter(Boolean))), o = n.reduce((s, i) => ((i.group ? [i.group].flat() : ["默认"]).forEach((u) => {
1019
+ let c = s.find((h) => h.group === u);
1020
+ c || (c = {
1021
+ group: u,
1022
+ instance: void 0,
1023
+ form: []
1024
+ }, s.push(c)), c.form.push(i);
1025
+ }), s), []).sort((s, i) => s.group === "默认" ? -1 : i.group === "默认" ? 1 : s.group > i.group ? -1 : 1), a = D("默认");
1026
+ return {
1027
+ formItems: n,
1028
+ groups: t,
1029
+ groupForms: o,
1030
+ activeTab: a,
1031
+ onSubmit: () => {
1032
+ const s = o.find((i) => i.group === a.value);
1033
+ if (s && s.instance) {
1034
+ const i = s.instance.formSource;
1035
+ s.instance.validate().then((u) => {
1036
+ u || r.close(i);
1037
+ });
1038
+ }
971
1039
  },
972
- meridiem: function(l, i) {
973
- var s = 100 * l + i;
974
- return s < 600 ? "凌晨" : s < 900 ? "早上" : s < 1100 ? "上午" : s < 1300 ? "中午" : s < 1800 ? "下午" : "晚上";
1040
+ onReset: () => {
1041
+ const s = o.find((i) => i.group === a.value);
1042
+ s && s.instance && s.instance.reset();
975
1043
  }
976
1044
  };
977
- return a.default.locale(u, null, !0), u;
978
- });
979
- })(Br);
980
- var Ge = { exports: {} };
981
- (function(e, n) {
982
- (function(r, t) {
983
- e.exports = t();
984
- })(ie, function() {
985
- var r = "week", t = "year";
986
- return function(a, u, l) {
987
- var i = u.prototype;
988
- i.week = function(s) {
989
- if (s === void 0 && (s = null), s !== null)
990
- return this.add(7 * (s - this.week()), "day");
991
- var o = this.$locale().yearStart || 1;
992
- if (this.month() === 11 && this.date() > 25) {
993
- var c = l(this).startOf(t).add(1, t).date(o), d = l(this).endOf(r);
994
- if (c.isBefore(d))
995
- return 1;
996
- }
997
- var h = l(this).startOf(t).date(o).startOf(r).subtract(1, "millisecond"), v = this.diff(h, r, !0);
998
- return v < 0 ? l(this).startOf("week").week() : Math.ceil(v);
999
- }, i.weeks = function(s) {
1000
- return s === void 0 && (s = null), this.week(s);
1001
- };
1002
- };
1003
- });
1004
- })(Ge);
1005
- var Ur = Ge.exports;
1006
- const qr = /* @__PURE__ */ _e(Ur);
1007
- var Ke = { exports: {} };
1008
- (function(e, n) {
1009
- (function(r, t) {
1010
- e.exports = t();
1011
- })(ie, function() {
1012
- var r = "month", t = "quarter";
1013
- return function(a, u) {
1014
- var l = u.prototype;
1015
- l.quarter = function(o) {
1016
- return this.$utils().u(o) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (o - 1));
1017
- };
1018
- var i = l.add;
1019
- l.add = function(o, c) {
1020
- return o = Number(o), this.$utils().p(c) === t ? this.add(3 * o, r) : i.bind(this)(o, c);
1021
- };
1022
- var s = l.startOf;
1023
- l.startOf = function(o, c) {
1024
- var d = this.$utils(), h = !!d.u(c) || c;
1025
- if (d.p(o) === t) {
1026
- var v = this.quarter() - 1;
1027
- return h ? this.month(3 * v).startOf(r).startOf("day") : this.month(3 * v + 2).endOf(r).endOf("day");
1028
- }
1029
- return s.bind(this)(o, c);
1030
- };
1031
- };
1032
- });
1033
- })(Ke);
1034
- var Wr = Ke.exports;
1035
- const Hr = /* @__PURE__ */ _e(Wr);
1036
- b.extend(qr);
1037
- b.extend(Hr);
1038
- b.locale("zh-cn", {
1039
- weekStart: 1
1040
- });
1041
- function Gr(e) {
1042
- let n;
1043
- function r(a, u) {
1044
- return e != null && e.disabledDate ? e.disabledDate(a, u) : !1;
1045
- }
1046
- function t(a) {
1047
- if (e != null && e.onChange && (e == null || e.onChange(a)), !(e != null && e.autoSubmit) || !n)
1048
- return;
1049
- let u = n;
1050
- for (; u && u.$el.tagName !== "FORM"; )
1051
- u = u.$parent;
1052
- u && u.$el && u.$el.dispatchEvent(new Event("submit"));
1045
+ },
1046
+ render() {
1047
+ const e = this.groupForms.find((r) => r.group === this.activeTab);
1048
+ if (this.groups.length) {
1049
+ let r;
1050
+ return p(It, {
1051
+ "active-key": this.activeTab,
1052
+ "onUpdate:active-key": (n) => this.activeTab = n
1053
+ }, rr(r = this.groupForms.map((n) => p(Pt, {
1054
+ title: n.group,
1055
+ key: n.group
1056
+ }, {
1057
+ default: () => [p(Be, {
1058
+ columns: this.columns,
1059
+ form: n.form,
1060
+ value: this.value,
1061
+ ref: (t) => n.instance = t
1062
+ }, null), p(et, null, null), p("div", {
1063
+ class: "flex items-center justify-between space-x-2"
1064
+ }, [p(W, {
1065
+ type: "secondary",
1066
+ size: "large",
1067
+ onClick: this.onReset
1068
+ }, {
1069
+ default: () => [q("重置")]
1070
+ }), p(W, {
1071
+ class: "w-100px",
1072
+ type: "primary",
1073
+ size: "large",
1074
+ onClick: this.onSubmit
1075
+ }, {
1076
+ default: () => [q("搜索")]
1077
+ })])]
1078
+ }))) ? r : {
1079
+ default: () => [r]
1080
+ });
1081
+ } else
1082
+ return p(Ce, null, [p(Be, {
1083
+ columns: this.columns,
1084
+ form: this.formItems,
1085
+ value: this.value,
1086
+ ref: (r) => e.instance = r
1087
+ }, null), p(et, null, null), p("div", {
1088
+ class: "flex items-center justify-between space-x-2"
1089
+ }, [p(W, {
1090
+ type: "secondary",
1091
+ size: "large",
1092
+ onClick: this.onReset
1093
+ }, {
1094
+ default: () => [q("重置")]
1095
+ }), p(W, {
1096
+ class: "w-100px",
1097
+ type: "primary",
1098
+ size: "large",
1099
+ onClick: this.onSubmit
1100
+ }, {
1101
+ default: () => [q("搜索")]
1102
+ })])]);
1053
1103
  }
1054
- return (a, u) => {
1055
- function l() {
1056
- const s = a[u.key];
1057
- switch (e == null ? void 0 : e.type) {
1058
- case "week":
1059
- return m("span", null, [`${b(s).format("YYYY年")}${b(s).week()}周`]);
1060
- case "month":
1061
- return m("span", null, [b(s).format("YYYY年MM月")]);
1062
- case "quarter":
1063
- return m("span", null, [`${b(s).format("YYYY年")}${b(s).quarter()}季度`]);
1064
- case "year":
1065
- return m("span", null, [b(s).format("YYYY年")]);
1066
- case "date":
1067
- default:
1068
- return m("span", null, [b(s).format(e != null && e.showTime ? "YYYY年MM月DD日 HH:mm:ss" : "YYYY年MM月DD日")]);
1069
- }
1070
- }
1071
- function i() {
1072
- switch (e == null ? void 0 : e.type) {
1073
- case "week":
1074
- return m(Ct, B({
1075
- ref: (s) => n = s,
1076
- "day-start-of-week": 1,
1077
- modelValue: a[u.key],
1078
- "onUpdate:modelValue": (s) => a[u.key] = s,
1079
- "disabled-date": r,
1080
- format: e == null ? void 0 : e.labelFormat,
1081
- "value-format": e == null ? void 0 : e.valueFormat
1082
- }, {
1083
- onChange: t
1084
- }), null);
1085
- case "month":
1086
- return m(xt, B({
1087
- ref: (s) => n = s,
1088
- modelValue: a[u.key],
1089
- "onUpdate:modelValue": (s) => a[u.key] = s,
1090
- "disabled-date": r,
1091
- format: e == null ? void 0 : e.labelFormat,
1092
- "value-format": e == null ? void 0 : e.valueFormat
1093
- }, {
1094
- onChange: t
1095
- }), null);
1096
- case "quarter":
1097
- return m(wt, B({
1098
- ref: (s) => n = s,
1099
- modelValue: a[u.key],
1100
- "onUpdate:modelValue": (s) => a[u.key] = s,
1101
- "disabled-date": r,
1102
- format: e == null ? void 0 : e.labelFormat,
1103
- "value-format": e == null ? void 0 : e.valueFormat
1104
- }, {
1105
- onChange: t
1106
- }), null);
1107
- case "year":
1108
- return m(kt, B({
1109
- ref: (s) => n = s,
1110
- modelValue: a[u.key],
1111
- "onUpdate:modelValue": (s) => a[u.key] = s,
1112
- "disabled-date": r,
1113
- format: e == null ? void 0 : e.labelFormat,
1114
- "value-format": e == null ? void 0 : e.valueFormat
1115
- }, {
1116
- onChange: t
1117
- }), null);
1118
- case "date":
1119
- default:
1120
- return m(bt, B({
1121
- ref: (s) => n = s,
1122
- "disabled-input": !0,
1123
- modelValue: a[u.key],
1124
- "onUpdate:modelValue": (s) => a[u.key] = s,
1125
- "disabled-date": r,
1126
- format: e == null ? void 0 : e.labelFormat,
1127
- "value-format": e == null ? void 0 : e.valueFormat,
1128
- "show-time": e == null ? void 0 : e.showTime
1129
- }, {
1130
- onChange: t
1131
- }, {
1132
- shortcuts: e == null ? void 0 : e.shortcuts
1133
- }), null);
1134
- }
1135
- }
1136
- switch (u.mode) {
1137
- case "text":
1138
- return l();
1139
- case "component":
1140
- default:
1141
- return i();
1142
- }
1143
- };
1144
- }
1145
- function Pe(e) {
1146
- return typeof e == "function" ? e() : Ne(e);
1147
- }
1104
+ });
1148
1105
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
1149
- const Re = () => {
1106
+ const rt = () => {
1150
1107
  };
1151
- function Kr(e, n) {
1152
- function r(...t) {
1153
- return new Promise((a, u) => {
1154
- Promise.resolve(e(() => n.apply(this, t), { fn: n, thisArg: this, args: t })).then(a).catch(u);
1108
+ function lr(e, r) {
1109
+ function n(...t) {
1110
+ return new Promise((o, a) => {
1111
+ Promise.resolve(e(() => r.apply(this, t), {
1112
+ fn: r,
1113
+ thisArg: this,
1114
+ args: t
1115
+ })).then(o).catch(a);
1155
1116
  });
1156
1117
  }
1157
- return r;
1118
+ return n;
1158
1119
  }
1159
- function Xr(e, n = {}) {
1160
- let r, t, a = Re;
1161
- const u = (i) => {
1162
- clearTimeout(i), a(), a = Re;
1120
+ function ar(e, r = {}) {
1121
+ let n, t, o = rt;
1122
+ const a = (s) => {
1123
+ clearTimeout(s), o(), o = rt;
1163
1124
  };
1164
- return (i) => {
1165
- const s = Pe(e), o = Pe(n.maxWait);
1166
- return r && u(r), s <= 0 || o !== void 0 && o <= 0 ? (t && (u(t), t = null), Promise.resolve(i())) : new Promise((c, d) => {
1167
- a = n.rejectOnCancel ? d : c, o && !t && (t = setTimeout(() => {
1168
- r && u(r), t = null, c(i());
1169
- }, o)), r = setTimeout(() => {
1170
- t && u(t), t = null, c(i());
1171
- }, s);
1125
+ let l;
1126
+ return (s) => {
1127
+ const i = C(e), u = C(r.maxWait);
1128
+ return n && a(n), i <= 0 || u !== void 0 && u <= 0 ? (t && (a(t), t = void 0), Promise.resolve(s())) : new Promise((c, h) => {
1129
+ o = r.rejectOnCancel ? h : c, l = s, u && !t && (t = setTimeout(() => {
1130
+ n && a(n), t = void 0, c(l());
1131
+ }, u)), n = setTimeout(() => {
1132
+ t && a(t), t = void 0, c(s());
1133
+ }, i);
1172
1134
  });
1173
1135
  };
1174
1136
  }
1175
- function Jr(e, n = 200, r = {}) {
1176
- return Kr(
1177
- Xr(n, r),
1178
- e
1179
- );
1137
+ // @__NO_SIDE_EFFECTS__
1138
+ function ur(e, r = 200, n = {}) {
1139
+ return lr(ar(r, n), e);
1180
1140
  }
1181
- function de(e, n, r) {
1182
- const t = te(e, (...a) => (Ae(() => t()), n(...a)), r);
1183
- return t;
1141
+ function Fe(e, r, n) {
1142
+ return ne(e, r, {
1143
+ ...n,
1144
+ once: !0
1145
+ });
1184
1146
  }
1185
- const Qr = Jr((e) => {
1186
- e && e.dispatchEvent(new Event("submit"));
1187
- }, 1e3);
1188
- function Zr(e) {
1189
- let n;
1190
- return (r, t) => {
1191
- function a() {
1192
- return m("span", null, [r[t.key]]);
1193
- }
1194
- function u() {
1195
- if (!(e != null && e.autoSubmit))
1147
+ function ht(e) {
1148
+ let r = !1;
1149
+ const n = [], t = (o) => {
1150
+ if (!r) {
1151
+ if (n.push(o), o[e.valueProp] === e.key) {
1152
+ r = !0;
1196
1153
  return;
1197
- let i = n;
1198
- for (; i && i.$el.tagName !== "FORM"; )
1199
- i = i.$parent;
1200
- if (i && i.$el) {
1201
- const s = i.$el;
1202
- Qr(s);
1203
- }
1204
- }
1205
- function l() {
1206
- switch (e == null ? void 0 : e.type) {
1207
- case "number":
1208
- return m(Ue, {
1209
- ref: (i) => n = i,
1210
- modelValue: r[t.key],
1211
- "onUpdate:modelValue": (i) => r[t.key] = i,
1212
- hideButton: !0,
1213
- "read-only": e == null ? void 0 : e.readonly,
1214
- placeholder: e == null ? void 0 : e.placeholder,
1215
- onInput: u,
1216
- onClear: () => u(),
1217
- allowClear: e == null ? void 0 : e.clearable
1218
- }, null);
1219
- case "string":
1220
- default:
1221
- return m(St, {
1222
- ref: (i) => n = i,
1223
- modelValue: r[t.key],
1224
- "onUpdate:modelValue": (i) => r[t.key] = i,
1225
- placeholder: e == null ? void 0 : e.placeholder,
1226
- readonly: e == null ? void 0 : e.readonly,
1227
- onInput: u,
1228
- onClear: () => u(),
1229
- allowClear: e == null ? void 0 : e.clearable
1230
- }, null);
1231
1154
  }
1232
- }
1233
- switch (t.mode) {
1234
- case "text":
1235
- return a();
1236
- case "component":
1237
- default:
1238
- return l();
1155
+ o.children?.length && o.children.forEach(t), r || n.pop();
1239
1156
  }
1240
1157
  };
1158
+ return e.data.forEach(t), n;
1241
1159
  }
1242
- function en(e) {
1243
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !xe(e);
1160
+ function sr(e) {
1161
+ let r = e.data;
1162
+ const n = [];
1163
+ return e.path.forEach((t) => {
1164
+ const o = r.find((a) => a[e.valueProp] === t);
1165
+ o && n.push(o), o && o.children?.length && (r = o.children);
1166
+ }), n;
1244
1167
  }
1245
- const X = /* @__PURE__ */ new WeakMap();
1246
- function tn() {
1247
- const e = $(/* @__PURE__ */ new Map());
1248
- return [e, (r) => e.value = r];
1168
+ const oe = /* @__PURE__ */ new WeakMap();
1169
+ function ir() {
1170
+ const e = D([]);
1171
+ return [e, (n) => e.value = n];
1249
1172
  }
1250
- function rn(e) {
1251
- let n, r = !1;
1252
- const [t, a] = tn(), u = (o) => {
1253
- if (e.onChange && e.onChange(o), !e.autoSubmit || !n)
1173
+ function cr(e) {
1174
+ let r, n = !1;
1175
+ const [t, o] = ir(), a = () => {
1176
+ if (!e.autoSubmit || !r)
1254
1177
  return;
1255
- let c = n;
1256
- for (; c && c.$el.tagName !== "FORM"; )
1257
- c = c.$parent;
1258
- c && c.$el && c.$el.dispatchEvent(new Event("submit"));
1259
- }, l = (o, c) => {
1260
- const d = o();
1261
- d instanceof Promise ? d.then(c) : c(d);
1262
- }, i = async () => {
1263
- const o = X.get(e.options);
1264
- switch (typeof o) {
1178
+ let i = r;
1179
+ for (; i && i.$el.tagName !== "FORM"; )
1180
+ i = i.$parent;
1181
+ i && i.$el && i.$el.dispatchEvent(new Event("submit"));
1182
+ }, l = (i, u) => {
1183
+ const c = i();
1184
+ c instanceof Promise ? c.then(u) : u(c);
1185
+ }, d = async () => {
1186
+ const i = oe.get(e.options);
1187
+ switch (typeof i) {
1188
+ // 已经执行未返回
1265
1189
  case "function":
1266
- X.set(e.options, a);
1190
+ oe.set(e.options, o);
1267
1191
  return;
1192
+ // 已经执行已返回
1268
1193
  case "object":
1269
- a(o);
1194
+ o(i);
1270
1195
  return;
1271
1196
  }
1272
- X.set(e.options, a), l(e.options, (c) => {
1273
- const d = X.get(e.options);
1274
- X.set(e.options, c), d(c);
1197
+ oe.set(e.options, o), l(e.options, (u) => {
1198
+ const c = oe.get(e.options);
1199
+ oe.set(e.options, u), c(u);
1275
1200
  });
1276
1201
  }, s = () => {
1277
- l(e.options, (o) => {
1278
- a(o);
1202
+ l(e.options, (i) => {
1203
+ o(i);
1279
1204
  });
1280
1205
  };
1281
1206
  switch (!0) {
1282
- case e.options instanceof Function: {
1283
- e.cache !== !1 ? i() : s();
1207
+ case typeof e.options == "function": {
1208
+ e.cache !== !1 ? d() : s();
1284
1209
  break;
1285
1210
  }
1286
- case re(e.options): {
1287
- de(() => e.options, () => {
1288
- a(e.options.value);
1211
+ case ie(e.options): {
1212
+ Fe(() => e.options, () => {
1213
+ o(e.options.value);
1289
1214
  }, {
1290
1215
  immediate: !0
1291
1216
  });
@@ -1294,329 +1219,589 @@ function rn(e) {
1294
1219
  default:
1295
1220
  t.value = e.options;
1296
1221
  }
1297
- return (o, c) => {
1298
- e.default && !r && (o[c.key] = e.default, r = !0);
1299
- function d() {
1300
- const v = o[c.key];
1301
- return e.multiple ? m("span", null, [v.map((f) => t.value.get(f)).join(" ,")]) : m("span", null, [t.value.get(v)]);
1222
+ return (i, u) => {
1223
+ e.default && !n && (i[u.key] = e.default, n = !0);
1224
+ function c() {
1225
+ const m = i[u.key], f = (v) => ht({
1226
+ data: t.value,
1227
+ valueProp: "value",
1228
+ key: v
1229
+ }).map((Y) => Y.label).join("/"), x = (v) => sr({
1230
+ data: t.value,
1231
+ valueProp: "value",
1232
+ path: v
1233
+ }).map((Y) => Y.label).join("/");
1234
+ switch (!0) {
1235
+ case (!e.pathMode && !e.multiple): {
1236
+ const v = f(m);
1237
+ return p("span", null, [v]);
1238
+ }
1239
+ case (!e.pathMode && e.multiple): {
1240
+ const v = m.map((F) => f(F));
1241
+ return p("span", null, [v.join(", ")]);
1242
+ }
1243
+ case (e.pathMode && !e.multiple): {
1244
+ const v = x(m);
1245
+ return p("span", null, [v]);
1246
+ }
1247
+ case (e.pathMode && e.multiple): {
1248
+ const v = m.map((F) => x(F));
1249
+ return p("span", null, [v.join(", ")]);
1250
+ }
1251
+ default:
1252
+ return p("span", null, null);
1253
+ }
1302
1254
  }
1303
1255
  function h() {
1304
- let v;
1305
- return m(Ot, {
1306
- ref: (f) => n = f,
1256
+ return p(jt, {
1257
+ pathMode: e.pathMode,
1258
+ ref: (m) => r = m,
1307
1259
  multiple: e.multiple,
1308
- modelValue: o[c.key],
1309
- "onUpdate:modelValue": (f) => o[c.key] = f,
1260
+ modelValue: i[u.key],
1261
+ "onUpdate:modelValue": (m) => i[u.key] = m,
1310
1262
  placeholder: e.placeholder,
1311
1263
  allowClear: e.clearable,
1312
1264
  allowSearch: e.searchable,
1313
- "allow-create": e.createable,
1314
1265
  maxTagCount: e.maxTagCount ?? 2,
1315
- onChange: u
1316
- }, en(v = Array.from(t.value.entries()).map(([f, k], p) => m($t, {
1317
- key: p,
1318
- value: f,
1319
- label: k
1320
- }, null))) ? v : {
1321
- default: () => [v]
1322
- });
1323
- }
1324
- switch (c.mode) {
1325
- case "text":
1326
- return d();
1327
- case "component":
1328
- default:
1329
- return h();
1266
+ onChange: a,
1267
+ checkStrictly: e.checkStrictly,
1268
+ triggerProps: e.triggerProps,
1269
+ options: t.value
1270
+ }, null);
1330
1271
  }
1272
+ return u.mode === "text" ? c() : h();
1331
1273
  };
1332
1274
  }
1333
- function nn(e) {
1334
- let n;
1335
- function r() {
1336
- if (!(e != null && e.autoSubmit) || !n)
1275
+ const dr = {
1276
+ thousands: !0,
1277
+ inputUnit: "元",
1278
+ outputUnit: "元"
1279
+ }, ye = {
1280
+ 分: 10 ** 0,
1281
+ 元: 10 ** 2,
1282
+ 万: 10 ** 4
1283
+ };
1284
+ function fr(e) {
1285
+ e = {
1286
+ ...dr,
1287
+ ...e || {}
1288
+ };
1289
+ const r = (l) => {
1290
+ if (l == null)
1337
1291
  return;
1338
- let t = n;
1339
- for (; t && t.$el.tagName !== "FORM"; )
1340
- t = t.$parent;
1341
- t && t.$el && t.$el.dispatchEvent(new Event("submit"));
1342
- }
1343
- return (t, a) => {
1344
- e != null && e.default && (t[a.key] = e.default);
1345
- function u() {
1346
- const i = t[a.key];
1347
- return m("span", null, [i ? (e == null ? void 0 : e.openLabel) ?? "是" : (e == null ? void 0 : e.closeLabel) ?? "否"]);
1348
- }
1349
- function l() {
1350
- return m(_t, {
1351
- ref: (i) => n = i,
1352
- modelValue: t[a.key],
1353
- "onUpdate:modelValue": (i) => t[a.key] = i,
1354
- checkedText: (e == null ? void 0 : e.openLabel) ?? "是",
1355
- uncheckedText: (e == null ? void 0 : e.closeLabel) ?? "",
1356
- checkedValue: (e == null ? void 0 : e.openValue) ?? !0,
1357
- uncheckedValue: (e == null ? void 0 : e.closeValue) ?? !1,
1358
- onChange: r
1359
- }, null);
1292
+ if (e?.inputUnit === e?.outputUnit)
1293
+ return l;
1294
+ const d = ye[e.outputUnit] / ye[e.inputUnit];
1295
+ return Number.parseFloat((l * d).toFixed(10));
1296
+ }, n = (l) => {
1297
+ if (l == null)
1298
+ return;
1299
+ if (e?.inputUnit === e?.outputUnit)
1300
+ return l;
1301
+ const d = ye[e.inputUnit] / ye[e.outputUnit];
1302
+ return Number.parseFloat((l * d).toFixed(10));
1303
+ }, t = (l) => {
1304
+ const d = l.split(".");
1305
+ return d[0] = d[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), d.join(".");
1306
+ }, o = (l) => {
1307
+ const d = l;
1308
+ return e?.thousands ? t(d) : d;
1309
+ }, a = (l) => l.replace(/,/g, "");
1310
+ return (l, d) => {
1311
+ const s = D(r(l[d.key]));
1312
+ ne(s, (m) => {
1313
+ l[d.key] = n(m);
1314
+ });
1315
+ const i = e?.prefix && (() => typeof e?.prefix == "string" ? p("span", null, [e.prefix]) : e.prefix()), u = () => typeof e?.suffix == "string" ? p("span", null, [e.suffix]) : typeof e?.suffix == "function" ? e.suffix() : e?.inputUnit;
1316
+ function c() {
1317
+ return p("span", null, [o(s.value.toString()), u()]);
1360
1318
  }
1361
- switch (a.mode) {
1362
- case "text":
1363
- return u();
1364
- case "component":
1365
- default:
1366
- return l();
1319
+ function h() {
1320
+ return p(ft, {
1321
+ modelValue: s.value,
1322
+ "onUpdate:modelValue": (m) => s.value = m,
1323
+ formatter: o,
1324
+ parser: a,
1325
+ precision: e?.precision,
1326
+ hideButton: !0,
1327
+ "read-only": e?.readonly,
1328
+ placeholder: e?.placeholder,
1329
+ allowClear: e?.clearable
1330
+ }, {
1331
+ prefix: i,
1332
+ suffix: u
1333
+ });
1367
1334
  }
1335
+ return d.mode === "text" ? c() : h();
1368
1336
  };
1369
1337
  }
1370
- var Xe = { exports: {} };
1371
- (function(e, n) {
1372
- (function(r, t) {
1373
- e.exports = t();
1374
- })(ie, function() {
1375
- return function(r, t, a) {
1376
- a.updateLocale = function(u, l) {
1377
- var i = a.Ls[u];
1378
- if (i)
1379
- return (l ? Object.keys(l) : []).forEach(function(s) {
1380
- i[s] = l[s];
1381
- }), i;
1338
+ function Ge(e) {
1339
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1340
+ }
1341
+ var be = { exports: {} }, pr = be.exports, ot;
1342
+ function mr() {
1343
+ return ot || (ot = 1, (function(e, r) {
1344
+ (function(n, t) {
1345
+ e.exports = t();
1346
+ })(pr, function() {
1347
+ var n = "month", t = "quarter";
1348
+ return function(o, a) {
1349
+ var l = a.prototype;
1350
+ l.quarter = function(i) {
1351
+ return this.$utils().u(i) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (i - 1));
1352
+ };
1353
+ var d = l.add;
1354
+ l.add = function(i, u) {
1355
+ return i = Number(i), this.$utils().p(u) === t ? this.add(3 * i, n) : d.bind(this)(i, u);
1356
+ };
1357
+ var s = l.startOf;
1358
+ l.startOf = function(i, u) {
1359
+ var c = this.$utils(), h = !!c.u(u) || u;
1360
+ if (c.p(i) === t) {
1361
+ var m = this.quarter() - 1;
1362
+ return h ? this.month(3 * m).startOf(n).startOf("day") : this.month(3 * m + 2).endOf(n).endOf("day");
1363
+ }
1364
+ return s.bind(this)(i, u);
1365
+ };
1382
1366
  };
1383
- };
1384
- });
1385
- })(Xe);
1386
- var ln = Xe.exports;
1387
- const an = /* @__PURE__ */ _e(ln);
1388
- function un(e) {
1389
- b.extend(an);
1390
- let n;
1391
- const r = "YYYY-MM-DD HH:mm:ss", t = [{
1392
- label: "默认",
1393
- value: () => {
1394
- const u = b().startOf("month").toDate(), l = b().endOf("date").toDate();
1395
- return [u, l];
1396
- }
1397
- }, {
1398
- label: "今天",
1367
+ });
1368
+ })(be)), be.exports;
1369
+ }
1370
+ var hr = mr();
1371
+ const vr = /* @__PURE__ */ Ge(hr);
1372
+ var ke = { exports: {} }, yr = ke.exports, lt;
1373
+ function gr() {
1374
+ return lt || (lt = 1, (function(e, r) {
1375
+ (function(n, t) {
1376
+ e.exports = t();
1377
+ })(yr, function() {
1378
+ var n = "week", t = "year";
1379
+ return function(o, a, l) {
1380
+ var d = a.prototype;
1381
+ d.week = function(s) {
1382
+ if (s === void 0 && (s = null), s !== null) return this.add(7 * (s - this.week()), "day");
1383
+ var i = this.$locale().yearStart || 1;
1384
+ if (this.month() === 11 && this.date() > 25) {
1385
+ var u = l(this).startOf(t).add(1, t).date(i), c = l(this).endOf(n);
1386
+ if (u.isBefore(c)) return 1;
1387
+ }
1388
+ var h = l(this).startOf(t).date(i).startOf(n).subtract(1, "millisecond"), m = this.diff(h, n, !0);
1389
+ return m < 0 ? l(this).startOf("week").week() : Math.ceil(m);
1390
+ }, d.weeks = function(s) {
1391
+ return s === void 0 && (s = null), this.week(s);
1392
+ };
1393
+ };
1394
+ });
1395
+ })(ke)), ke.exports;
1396
+ }
1397
+ var br = gr();
1398
+ const kr = /* @__PURE__ */ Ge(br);
1399
+ var we = { exports: {} }, wr = we.exports, at;
1400
+ function xr() {
1401
+ return at || (at = 1, (function(e, r) {
1402
+ (function(n, t) {
1403
+ e.exports = t(k);
1404
+ })(wr, function(n) {
1405
+ function t(l) {
1406
+ return l && typeof l == "object" && "default" in l ? l : {
1407
+ default: l
1408
+ };
1409
+ }
1410
+ var o = t(n), a = {
1411
+ name: "zh-cn",
1412
+ weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),
1413
+ weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"),
1414
+ weekdaysMin: "日_一_二_三_四_五_六".split("_"),
1415
+ months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),
1416
+ monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),
1417
+ ordinal: function(l, d) {
1418
+ return d === "W" ? l + "周" : l + "日";
1419
+ },
1420
+ weekStart: 1,
1421
+ yearStart: 4,
1422
+ formats: {
1423
+ LT: "HH:mm",
1424
+ LTS: "HH:mm:ss",
1425
+ L: "YYYY/MM/DD",
1426
+ LL: "YYYY年M月D日",
1427
+ LLL: "YYYY年M月D日Ah点mm分",
1428
+ LLLL: "YYYY年M月D日ddddAh点mm分",
1429
+ l: "YYYY/M/D",
1430
+ ll: "YYYY年M月D日",
1431
+ lll: "YYYY年M月D日 HH:mm",
1432
+ llll: "YYYY年M月D日dddd HH:mm"
1433
+ },
1434
+ relativeTime: {
1435
+ future: "%s内",
1436
+ past: "%s前",
1437
+ s: "几秒",
1438
+ m: "1 分钟",
1439
+ mm: "%d 分钟",
1440
+ h: "1 小时",
1441
+ hh: "%d 小时",
1442
+ d: "1 天",
1443
+ dd: "%d 天",
1444
+ M: "1 个月",
1445
+ MM: "%d 个月",
1446
+ y: "1 年",
1447
+ yy: "%d 年"
1448
+ },
1449
+ meridiem: function(l, d) {
1450
+ var s = 100 * l + d;
1451
+ return s < 600 ? "凌晨" : s < 900 ? "早上" : s < 1100 ? "上午" : s < 1300 ? "中午" : s < 1800 ? "下午" : "晚上";
1452
+ }
1453
+ };
1454
+ return o.default.locale(a, null, !0), a;
1455
+ });
1456
+ })(we)), we.exports;
1457
+ }
1458
+ xr();
1459
+ k.extend(kr);
1460
+ k.extend(vr);
1461
+ k.locale("zh-cn", {
1462
+ weekStart: 1
1463
+ });
1464
+ function Cr(e) {
1465
+ let r;
1466
+ function n(o, a) {
1467
+ return e?.disabledDate ? e.disabledDate(o, a) : !1;
1468
+ }
1469
+ function t(o) {
1470
+ if (e?.onChange && e?.onChange(o), !e?.autoSubmit || !r)
1471
+ return;
1472
+ let a = r;
1473
+ for (; a && a.$el.tagName !== "FORM"; )
1474
+ a = a.$parent;
1475
+ a && a.$el && a.$el.dispatchEvent(new Event("submit"));
1476
+ }
1477
+ return (o, a) => {
1478
+ function l() {
1479
+ const s = o[a.key];
1480
+ switch (e?.type) {
1481
+ case "week":
1482
+ return p("span", null, [`${k(s).format("YYYY年")}${k(s).week()}周`]);
1483
+ case "month":
1484
+ return p("span", null, [k(s).format("YYYY年MM月")]);
1485
+ case "quarter":
1486
+ return p("span", null, [`${k(s).format("YYYY年")}${k(s).quarter()}季度`]);
1487
+ case "year":
1488
+ return p("span", null, [k(s).format("YYYY年")]);
1489
+ default:
1490
+ return p("span", null, [k(s).format(e?.showTime ? "YYYY年MM月DD日 HH:mm:ss" : "YYYY年MM月DD日")]);
1491
+ }
1492
+ }
1493
+ function d() {
1494
+ switch (e?.type) {
1495
+ case "week":
1496
+ return p(Vt, Z({
1497
+ ref: (s) => r = s,
1498
+ "day-start-of-week": 1,
1499
+ modelValue: o[a.key],
1500
+ "onUpdate:modelValue": (s) => o[a.key] = s,
1501
+ "disabled-date": n,
1502
+ format: e?.labelFormat,
1503
+ "value-format": e?.valueFormat
1504
+ }, {
1505
+ onChange: t
1506
+ }), null);
1507
+ case "month":
1508
+ return p(Bt, Z({
1509
+ ref: (s) => r = s,
1510
+ modelValue: o[a.key],
1511
+ "onUpdate:modelValue": (s) => o[a.key] = s,
1512
+ "disabled-date": n,
1513
+ format: e?.labelFormat,
1514
+ "value-format": e?.valueFormat
1515
+ }, {
1516
+ onChange: t
1517
+ }), null);
1518
+ case "quarter":
1519
+ return p(Nt, Z({
1520
+ ref: (s) => r = s,
1521
+ modelValue: o[a.key],
1522
+ "onUpdate:modelValue": (s) => o[a.key] = s,
1523
+ "disabled-date": n,
1524
+ format: e?.labelFormat,
1525
+ "value-format": e?.valueFormat
1526
+ }, {
1527
+ onChange: t
1528
+ }), null);
1529
+ case "year":
1530
+ return p(zt, Z({
1531
+ ref: (s) => r = s,
1532
+ modelValue: o[a.key],
1533
+ "onUpdate:modelValue": (s) => o[a.key] = s,
1534
+ "disabled-date": n,
1535
+ format: e?.labelFormat,
1536
+ "value-format": e?.valueFormat
1537
+ }, {
1538
+ onChange: t
1539
+ }), null);
1540
+ default:
1541
+ return p(Et, Z({
1542
+ ref: (s) => r = s,
1543
+ "disabled-input": !0,
1544
+ modelValue: o[a.key],
1545
+ "onUpdate:modelValue": (s) => o[a.key] = s,
1546
+ "disabled-date": n,
1547
+ format: e?.labelFormat,
1548
+ "value-format": e?.valueFormat,
1549
+ "show-time": e?.showTime
1550
+ }, {
1551
+ onChange: t
1552
+ }, {
1553
+ shortcuts: e?.shortcuts
1554
+ }), null);
1555
+ }
1556
+ }
1557
+ return a.mode === "text" ? l() : d();
1558
+ };
1559
+ }
1560
+ var xe = { exports: {} }, Sr = xe.exports, ut;
1561
+ function Or() {
1562
+ return ut || (ut = 1, (function(e, r) {
1563
+ (function(n, t) {
1564
+ e.exports = t();
1565
+ })(Sr, function() {
1566
+ return function(n, t, o) {
1567
+ o.updateLocale = function(a, l) {
1568
+ var d = o.Ls[a];
1569
+ if (d) return (l ? Object.keys(l) : []).forEach(function(s) {
1570
+ d[s] = l[s];
1571
+ }), d;
1572
+ };
1573
+ };
1574
+ });
1575
+ })(xe)), xe.exports;
1576
+ }
1577
+ var $r = Or();
1578
+ const _r = /* @__PURE__ */ Ge($r);
1579
+ function Fr(e) {
1580
+ k.extend(_r);
1581
+ let r;
1582
+ const n = "YYYY-MM-DD HH:mm:ss", t = [{
1583
+ label: "默认",
1399
1584
  value: () => {
1400
- const u = b().startOf("date").toDate(), l = b().endOf("date").toDate();
1401
- return [u, l];
1585
+ const a = k().startOf("month").toDate(), l = k().endOf("date").toDate();
1586
+ return [a, l];
1587
+ }
1588
+ }, {
1589
+ label: "今天",
1590
+ value: () => {
1591
+ const a = k().startOf("date").toDate(), l = k().endOf("date").toDate();
1592
+ return [a, l];
1402
1593
  }
1403
1594
  }, {
1404
1595
  label: "昨天",
1405
1596
  value: () => {
1406
- const u = b().subtract(1, "day").startOf("date").toDate(), l = b().subtract(1, "day").endOf("date").toDate();
1407
- return [u, l];
1597
+ const a = k().subtract(1, "day").startOf("date").toDate(), l = k().subtract(1, "day").endOf("date").toDate();
1598
+ return [a, l];
1408
1599
  }
1409
1600
  }, {
1410
1601
  label: "本周",
1411
1602
  value: () => {
1412
- b.updateLocale("zh-cn", {
1603
+ k.updateLocale("zh-cn", {
1413
1604
  weekStart: 1
1414
1605
  });
1415
- const u = b().startOf("week").toDate(), l = b().endOf("week").toDate();
1416
- return [u, l];
1606
+ const a = k().startOf("week").toDate(), l = k().endOf("week").toDate();
1607
+ return [a, l];
1417
1608
  }
1418
1609
  }, {
1419
1610
  label: "上周",
1420
1611
  value: () => {
1421
- b.updateLocale("zh-cn", {
1612
+ k.updateLocale("zh-cn", {
1422
1613
  weekStart: 1
1423
1614
  });
1424
- const u = b().subtract(1, "week").startOf("week").toDate(), l = b().subtract(1, "week").endOf("week").toDate();
1425
- return [u, l];
1615
+ const a = k().subtract(1, "week").startOf("week").toDate(), l = k().subtract(1, "week").endOf("week").toDate();
1616
+ return [a, l];
1426
1617
  }
1427
1618
  }, {
1428
1619
  label: "本月",
1429
1620
  value: () => {
1430
- const u = b().startOf("month").toDate(), l = b().endOf("month").toDate();
1431
- return [u, l];
1621
+ const a = k().startOf("month").toDate(), l = k().endOf("month").toDate();
1622
+ return [a, l];
1432
1623
  }
1433
1624
  }, {
1434
1625
  label: "上月",
1435
1626
  value: () => {
1436
- const u = b().subtract(1, "month").startOf("month").toDate(), l = b().subtract(1, "month").endOf("month").toDate();
1437
- return [u, l];
1627
+ const a = k().subtract(1, "month").startOf("month").toDate(), l = k().subtract(1, "month").endOf("month").toDate();
1628
+ return [a, l];
1438
1629
  }
1439
1630
  }, {
1440
1631
  label: "本年",
1441
1632
  value: () => {
1442
- const u = b().startOf("year").toDate(), l = b().endOf("year").toDate();
1443
- return [u, l];
1633
+ const a = k().startOf("year").toDate(), l = k().endOf("year").toDate();
1634
+ return [a, l];
1444
1635
  }
1445
1636
  }, {
1446
1637
  label: "去年",
1447
1638
  value: () => {
1448
- const u = b().subtract(1, "year").startOf("year").toDate(), l = b().subtract(1, "year").endOf("year").toDate();
1449
- return [u, l];
1639
+ const a = k().subtract(1, "year").startOf("year").toDate(), l = k().subtract(1, "year").endOf("year").toDate();
1640
+ return [a, l];
1450
1641
  }
1451
- }], a = (u) => {
1452
- if (e != null && e.onChange && (e == null || e.onChange(u)), !(e != null && e.autoSubmit) || !n)
1642
+ }], o = (a) => {
1643
+ if (e?.onChange && e?.onChange(a), !e?.autoSubmit || !r)
1453
1644
  return;
1454
- let l = n;
1645
+ let l = r;
1455
1646
  for (; l && l.$el.tagName !== "FORM"; )
1456
1647
  l = l.$parent;
1457
1648
  l && l.$el && l.$el.dispatchEvent(new Event("submit"));
1458
1649
  };
1459
- return (u, l) => {
1460
- let i = [];
1650
+ return (a, l) => {
1651
+ let d = [];
1461
1652
  function s(f) {
1462
- i = f;
1653
+ d = f;
1463
1654
  }
1464
- function o(f) {
1655
+ function i(f) {
1465
1656
  if (f && f.length === 2) {
1466
- const [k, p] = f.sort(), C = b(k).startOf("days"), O = b(p).endOf("days"), M = [C.format((e == null ? void 0 : e.valueFormat) || r), O.format((e == null ? void 0 : e.valueFormat) || r)];
1467
- u[l.key] = M, a(M);
1657
+ const [x, v] = f.sort(), F = k(x).startOf("days"), Y = k(v).endOf("days"), I = [F.format(e?.valueFormat || n), Y.format(e?.valueFormat || n)];
1658
+ a[l.key] = I, o(I);
1468
1659
  }
1469
- f === void 0 && a();
1660
+ f === void 0 && o();
1470
1661
  }
1471
- function c(f) {
1472
- return e != null && e.disabledDate ? e.disabledDate(i.filter(Boolean), f) : !1;
1662
+ function u(f) {
1663
+ return e?.disabledDate ? e.disabledDate(d.filter(Boolean), f) : !1;
1473
1664
  }
1474
- function d() {
1475
- const f = u[l.key], [k, p] = f, C = (O) => {
1476
- switch (e == null ? void 0 : e.type) {
1665
+ function c() {
1666
+ const f = a[l.key], [x, v] = f, F = (Y) => {
1667
+ switch (e?.type) {
1477
1668
  case "week":
1478
- return m("span", null, [`${b(O).format("YYYY年")}${b(O).week()}周`]);
1669
+ return p("span", null, [`${k(Y).format("YYYY年")}${k(Y).week()}周`]);
1479
1670
  case "month":
1480
- return m("span", null, [b(O).format("YYYY年MM月")]);
1671
+ return p("span", null, [k(Y).format("YYYY年MM月")]);
1481
1672
  case "quarter":
1482
- return m("span", null, [`${b(O).format("YYYY年")}${b(O).quarter()}季度`]);
1673
+ return p("span", null, [`${k(Y).format("YYYY年")}${k(Y).quarter()}季度`]);
1483
1674
  case "year":
1484
- return m("span", null, [b(O).format("YYYY年")]);
1485
- case "date":
1675
+ return p("span", null, [k(Y).format("YYYY年")]);
1486
1676
  default:
1487
- return m("span", null, [b(O).format("YYYY年MM月DD日")]);
1677
+ return p("span", null, [k(Y).format("YYYY年MM月DD日")]);
1488
1678
  }
1489
1679
  };
1490
- return m("span", null, [C(k), R(" - "), C(p)]);
1680
+ return p("span", null, [F(x), " ", q("-"), " ", F(v)]);
1491
1681
  }
1492
1682
  function h() {
1493
1683
  switch (!0) {
1494
- case !!(e != null && e.shortcuts):
1495
- return e == null ? void 0 : e.shortcuts;
1496
- case (e == null ? void 0 : e.type) === "date":
1497
- case (e == null ? void 0 : e.type) === void 0:
1684
+ case !!e?.shortcuts:
1685
+ return e?.shortcuts;
1686
+ case e?.type === "date":
1687
+ case e?.type === void 0:
1498
1688
  return t;
1499
1689
  }
1500
1690
  }
1501
- function v() {
1502
- return m("div", null, [m(Ft, {
1503
- ref: (f) => n = f,
1691
+ function m() {
1692
+ return p("div", null, [p(qt, {
1693
+ ref: (f) => r = f,
1504
1694
  "disabled-input": !0,
1505
1695
  style: {
1506
1696
  width: "300px"
1507
1697
  },
1508
- modelValue: u[l.key],
1509
- "onUpdate:modelValue": (f) => u[l.key] = f,
1698
+ modelValue: a[l.key],
1699
+ "onUpdate:modelValue": (f) => a[l.key] = f,
1510
1700
  onSelect: s,
1511
- onChange: o,
1512
- mode: e == null ? void 0 : e.type,
1513
- placeholder: e == null ? void 0 : e.placeholder,
1701
+ onChange: i,
1702
+ mode: e?.type,
1703
+ placeholder: e?.placeholder,
1514
1704
  shortcuts: h(),
1515
- allowClear: e == null ? void 0 : e.clearable,
1516
- "disabled-date": c,
1517
- format: e == null ? void 0 : e.labelFormat,
1518
- "value-format": (e == null ? void 0 : e.valueFormat) ?? r
1705
+ allowClear: e?.clearable,
1706
+ "disabled-date": u,
1707
+ format: e?.labelFormat,
1708
+ "value-format": e?.valueFormat ?? n
1519
1709
  }, null)]);
1520
1710
  }
1521
- switch (l.mode) {
1522
- case "text":
1523
- return d();
1524
- case "component":
1525
- default:
1526
- return v();
1527
- }
1711
+ return l.mode === "text" ? c() : m();
1528
1712
  };
1529
1713
  }
1530
- function cn(e) {
1531
- return (n, r) => {
1532
- function t() {
1533
- return m("span", null, [n[r.key]]);
1714
+ const Mr = /* @__PURE__ */ ur((e) => {
1715
+ e && e.dispatchEvent(new Event("submit"));
1716
+ }, 1e3);
1717
+ function Yr(e) {
1718
+ let r;
1719
+ return (n, t) => {
1720
+ function o() {
1721
+ return p("span", null, [n[t.key]]);
1534
1722
  }
1535
1723
  function a() {
1536
- return m(Mt, {
1537
- modelValue: n[r.key],
1538
- "onUpdate:modelValue": (u) => n[r.key] = u,
1539
- placeholder: e == null ? void 0 : e.placeholder,
1540
- autoSize: e == null ? void 0 : e.autosize,
1541
- maxLength: e == null ? void 0 : e.maxLength
1542
- }, null);
1543
- }
1544
- switch (r.mode) {
1545
- case "text":
1546
- return t();
1547
- case "component":
1548
- default:
1549
- return a();
1550
- }
1551
- };
1552
- }
1553
- function Je(e) {
1554
- let n = !1;
1555
- const r = [], t = (a) => {
1556
- var u;
1557
- if (!n) {
1558
- if (r.push(a), a[e.valueProp] === e.key) {
1559
- n = !0;
1724
+ if (!e?.autoSubmit)
1560
1725
  return;
1726
+ let d = r;
1727
+ for (; d && d.$el.tagName !== "FORM"; )
1728
+ d = d.$parent;
1729
+ if (d && d.$el) {
1730
+ const s = d.$el;
1731
+ Mr(s);
1561
1732
  }
1562
- (u = a.children) != null && u.length && a.children.forEach(t), n || r.pop();
1563
1733
  }
1734
+ function l() {
1735
+ return e?.type === "number" ? p(ft, {
1736
+ ref: (d) => r = d,
1737
+ modelValue: n[t.key],
1738
+ "onUpdate:modelValue": (d) => n[t.key] = d,
1739
+ hideButton: !0,
1740
+ "read-only": e?.readonly,
1741
+ placeholder: e?.placeholder,
1742
+ onInput: a,
1743
+ onClear: () => a(),
1744
+ allowClear: e?.clearable
1745
+ }, null) : p(At, {
1746
+ ref: (d) => r = d,
1747
+ modelValue: n[t.key],
1748
+ "onUpdate:modelValue": (d) => n[t.key] = d,
1749
+ placeholder: e?.placeholder,
1750
+ readonly: e?.readonly,
1751
+ onInput: a,
1752
+ onClear: () => a(),
1753
+ allowClear: e?.clearable
1754
+ }, null);
1755
+ }
1756
+ return t.mode === "text" ? o() : l();
1564
1757
  };
1565
- return e.data.forEach(t), r;
1566
- }
1567
- function on(e) {
1568
- let n = e.data;
1569
- const r = [];
1570
- return e.path.forEach((t) => {
1571
- var u;
1572
- const a = n.find((l) => l[e.valueProp] === t);
1573
- a && r.push(a), a && ((u = a.children) != null && u.length) && (n = a.children);
1574
- }), r;
1575
1758
  }
1576
- const J = /* @__PURE__ */ new WeakMap();
1577
- function sn() {
1578
- const e = $([]);
1579
- return [e, (r) => e.value = r];
1759
+ const le = /* @__PURE__ */ new WeakMap();
1760
+ function Lr() {
1761
+ const e = D(/* @__PURE__ */ new Map());
1762
+ return [e, (n) => e.value = n];
1580
1763
  }
1581
- function dn(e) {
1582
- let n, r = !1;
1583
- const [t, a] = sn(), u = () => {
1584
- if (!e.autoSubmit || !n)
1764
+ function Tr(e) {
1765
+ let r, n = !1;
1766
+ const [t, o] = Lr(), a = (i) => {
1767
+ if (e.onChange && e.onChange(i), !e.autoSubmit || !r)
1585
1768
  return;
1586
- let c = n;
1587
- for (; c && c.$el.tagName !== "FORM"; )
1588
- c = c.$parent;
1589
- c && c.$el && c.$el.dispatchEvent(new Event("submit"));
1590
- }, l = (c, d) => {
1591
- const h = c();
1592
- h instanceof Promise ? h.then(d) : d(h);
1593
- }, i = async () => {
1594
- const c = J.get(e.options);
1595
- switch (typeof c) {
1769
+ let u = r;
1770
+ for (; u && u.$el.tagName !== "FORM"; )
1771
+ u = u.$parent;
1772
+ u && u.$el && u.$el.dispatchEvent(new Event("submit"));
1773
+ }, l = (i, u) => {
1774
+ const c = i();
1775
+ c instanceof Promise ? c.then(u) : u(c);
1776
+ }, d = async () => {
1777
+ const i = le.get(e.options);
1778
+ switch (typeof i) {
1779
+ // 已经执行未返回
1596
1780
  case "function":
1597
- J.set(e.options, a);
1781
+ le.set(e.options, o);
1598
1782
  return;
1783
+ // 已经执行已返回
1599
1784
  case "object":
1600
- a(c);
1785
+ o(i);
1601
1786
  return;
1602
1787
  }
1603
- J.set(e.options, a), l(e.options, (d) => {
1604
- const h = J.get(e.options);
1605
- J.set(e.options, d), h(d);
1788
+ le.set(e.options, o), l(e.options, (u) => {
1789
+ const c = le.get(e.options);
1790
+ le.set(e.options, u), c(u);
1606
1791
  });
1607
1792
  }, s = () => {
1608
- l(e.options, (c) => {
1609
- a(c);
1793
+ l(e.options, (i) => {
1794
+ o(i);
1610
1795
  });
1611
1796
  };
1612
1797
  switch (!0) {
1613
- case e.options instanceof Function: {
1614
- e.cache !== !1 ? i() : s();
1798
+ case typeof e.options == "function": {
1799
+ e.cache !== !1 ? d() : s();
1615
1800
  break;
1616
1801
  }
1617
- case re(e.options): {
1618
- de(() => e.options, () => {
1619
- a(e.options.value);
1802
+ case ie(e.options): {
1803
+ Fe(() => e.options, () => {
1804
+ o(e.options.value);
1620
1805
  }, {
1621
1806
  immediate: !0
1622
1807
  });
@@ -1625,105 +1810,81 @@ function dn(e) {
1625
1810
  default:
1626
1811
  t.value = e.options;
1627
1812
  }
1628
- function o(c, d) {
1629
- var f;
1630
- const h = ((f = e.fieldNames) == null ? void 0 : f.title) || "title", v = d[h];
1631
- return v ? v.toLowerCase().includes(c.toLowerCase()) : !1;
1632
- }
1633
- return (c, d) => {
1634
- e.default && !r && (c[d.key] = e.default, r = !0);
1635
- function h() {
1636
- const f = c[d.key], k = (p) => {
1637
- const [C] = Je({
1638
- data: t.value,
1639
- labelProp: "title",
1640
- valueProp: "key",
1641
- key: p
1642
- }).reverse() || [];
1643
- return C == null ? void 0 : C.title;
1644
- };
1645
- if (e.multiple) {
1646
- const p = f.map((C) => k(C));
1647
- return m("span", null, [p.join(", ")]);
1648
- } else {
1649
- const p = k(f);
1650
- return m("span", null, [p]);
1651
- }
1813
+ return (i, u) => {
1814
+ e.default && !n && (i[u.key] = e.default, n = !0);
1815
+ function c() {
1816
+ const m = i[u.key];
1817
+ return p("span", null, [t.value?.get(m)]);
1652
1818
  }
1653
- function v() {
1654
- return m(Yt, {
1655
- ref: (f) => n = f,
1656
- multiple: e.multiple,
1657
- modelValue: c[d.key],
1658
- "onUpdate:modelValue": (f) => c[d.key] = f,
1659
- placeholder: e.placeholder,
1660
- allowClear: e.clearable,
1661
- allowSearch: e.searchable,
1662
- maxTagCount: e.maxTagCount ?? 2,
1663
- onChange: u,
1664
- filterTreeNode: o,
1665
- data: t.value,
1666
- fieldNames: e.fieldNames,
1667
- treeProps: e.treeProps,
1668
- treeCheckStrictly: e.treeCheckStrictly,
1669
- treeCheckedStrategy: e.treeCheckedStrategy
1670
- }, {
1671
- ...e.slots
1672
- });
1673
- }
1674
- switch (d.mode) {
1675
- case "text":
1676
- return h();
1677
- case "component":
1678
- default:
1679
- return v();
1819
+ function h() {
1820
+ return p(Wt, {
1821
+ type: e.type || "radio",
1822
+ size: e.size,
1823
+ ref: (m) => r = m,
1824
+ modelValue: i[u.key],
1825
+ "onUpdate:modelValue": (m) => i[u.key] = m,
1826
+ onChange: a,
1827
+ options: Array.from(t.value.entries()).map(([m, f]) => ({
1828
+ label: f,
1829
+ value: m
1830
+ }))
1831
+ }, null);
1680
1832
  }
1833
+ return u.mode === "text" ? c() : h();
1681
1834
  };
1682
1835
  }
1683
- const Q = /* @__PURE__ */ new WeakMap();
1684
- function fn() {
1685
- const e = $([]);
1686
- return [e, (r) => e.value = r];
1836
+ function Dr(e) {
1837
+ return (r, n) => e(r, n);
1687
1838
  }
1688
- function mn(e) {
1689
- let n, r = !1;
1690
- const [t, a] = fn(), u = () => {
1691
- if (!e.autoSubmit || !n)
1839
+ function Rr(e) {
1840
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !qe(e);
1841
+ }
1842
+ const ae = /* @__PURE__ */ new WeakMap();
1843
+ function Ir() {
1844
+ const e = D(/* @__PURE__ */ new Map());
1845
+ return [e, (n) => e.value = n];
1846
+ }
1847
+ function Pr(e) {
1848
+ let r, n = !1;
1849
+ const [t, o] = Ir(), a = (i) => {
1850
+ if (e.onChange && e.onChange(i), !e.autoSubmit || !r)
1692
1851
  return;
1693
- let o = n;
1694
- for (; o && o.$el.tagName !== "FORM"; )
1695
- o = o.$parent;
1696
- o && o.$el && o.$el.dispatchEvent(new Event("submit"));
1697
- }, l = (o, c) => {
1698
- const d = o();
1699
- d instanceof Promise ? d.then(c) : c(d);
1700
- }, i = async () => {
1701
- const o = Q.get(e.options);
1702
- switch (typeof o) {
1852
+ let u = r;
1853
+ for (; u && u.$el.tagName !== "FORM"; )
1854
+ u = u.$parent;
1855
+ u && u.$el && u.$el.dispatchEvent(new Event("submit"));
1856
+ }, l = (i, u) => {
1857
+ const c = i();
1858
+ c instanceof Promise ? c.then(u) : u(c);
1859
+ }, d = async () => {
1860
+ const i = ae.get(e.options);
1861
+ switch (typeof i) {
1862
+ // 已经执行未返回
1703
1863
  case "function":
1704
- Q.set(e.options, a);
1864
+ ae.set(e.options, o);
1705
1865
  return;
1866
+ // 已经执行已返回
1706
1867
  case "object":
1707
- a(o);
1868
+ o(i);
1708
1869
  return;
1709
1870
  }
1710
- Q.set(e.options, a), l(e.options, (c) => {
1711
- const d = Q.get(e.options);
1712
- Q.set(e.options, c), d(c);
1871
+ ae.set(e.options, o), l(e.options, (u) => {
1872
+ const c = ae.get(e.options);
1873
+ ae.set(e.options, u), c(u);
1713
1874
  });
1714
1875
  }, s = () => {
1715
- l(e.options, (o) => {
1716
- a(o);
1876
+ l(e.options, (i) => {
1877
+ o(i);
1717
1878
  });
1718
1879
  };
1719
1880
  switch (!0) {
1720
- case e.options instanceof Function: {
1721
- e.cache !== !1 ? i() : s();
1881
+ case typeof e.options == "function": {
1882
+ e.cache !== !1 ? d() : s();
1722
1883
  break;
1723
1884
  }
1724
- case re(e.options): {
1725
- de(() => e.options, () => {
1726
- a(e.options.value);
1885
+ case ie(e.options): {
1886
+ Fe(() => e.options, () => {
1887
+ o(e.options.value);
1727
1888
  }, {
1728
1889
  immediate: !0
1729
1890
  });
@@ -1732,183 +1893,130 @@ function mn(e) {
1732
1893
  default:
1733
1894
  t.value = e.options;
1734
1895
  }
1735
- return (o, c) => {
1736
- e.default && !r && (o[c.key] = e.default, r = !0);
1737
- function d() {
1738
- const v = o[c.key], f = (p) => Je({
1739
- data: t.value,
1740
- labelProp: "label",
1741
- valueProp: "value",
1742
- key: p
1743
- }).map((O) => O.label).join("/"), k = (p) => on({
1744
- data: t.value,
1745
- labelProp: "label",
1746
- valueProp: "value",
1747
- path: p
1748
- }).map((O) => O.label).join("/");
1749
- switch (!0) {
1750
- case (!e.pathMode && !e.multiple): {
1751
- const p = f(v);
1752
- return m("span", null, [p]);
1753
- }
1754
- case (!e.pathMode && e.multiple): {
1755
- const p = v.map((C) => f(C));
1756
- return m("span", null, [p.join(", ")]);
1757
- }
1758
- case (e.pathMode && !e.multiple): {
1759
- const p = k(v);
1760
- return m("span", null, [p]);
1761
- }
1762
- case (e.pathMode && e.multiple): {
1763
- const p = v.map((C) => k(C));
1764
- return m("span", null, [p.join(", ")]);
1765
- }
1766
- default:
1767
- return m("span", null, null);
1768
- }
1896
+ return (i, u) => {
1897
+ e.default && !n && (i[u.key] = e.default, n = !0);
1898
+ function c() {
1899
+ const m = i[u.key];
1900
+ return e.multiple ? p("span", null, [m.map((f) => t.value.get(f)).join(" ,")]) : p("span", null, [t.value.get(m)]);
1769
1901
  }
1770
1902
  function h() {
1771
- return m(Dt, {
1772
- pathMode: e.pathMode,
1773
- ref: (v) => n = v,
1903
+ let m;
1904
+ return p(Ht, {
1905
+ ref: (f) => r = f,
1774
1906
  multiple: e.multiple,
1775
- modelValue: o[c.key],
1776
- "onUpdate:modelValue": (v) => o[c.key] = v,
1907
+ modelValue: i[u.key],
1908
+ "onUpdate:modelValue": (f) => i[u.key] = f,
1777
1909
  placeholder: e.placeholder,
1778
1910
  allowClear: e.clearable,
1779
1911
  allowSearch: e.searchable,
1912
+ "allow-create": e.createable,
1780
1913
  maxTagCount: e.maxTagCount ?? 2,
1781
- onChange: u,
1782
- checkStrictly: e.checkStrictly,
1783
- triggerProps: e.triggerProps,
1784
- options: t.value
1785
- }, null);
1786
- }
1787
- switch (c.mode) {
1788
- case "text":
1789
- return d();
1790
- case "component":
1791
- default:
1792
- return h();
1914
+ onChange: a
1915
+ }, Rr(m = Array.from(t.value.entries()).map(([f, x], v) => p(Ut, {
1916
+ key: v,
1917
+ value: f,
1918
+ label: x
1919
+ }, null))) ? m : {
1920
+ default: () => [m]
1921
+ });
1793
1922
  }
1923
+ return u.mode === "text" ? c() : h();
1794
1924
  };
1795
1925
  }
1796
- function hn(e) {
1797
- return (n, r) => e(n, r);
1798
- }
1799
- const vn = {
1800
- thousands: !0,
1801
- inputUnit: "元",
1802
- outputUnit: "元"
1803
- }, le = {
1804
- 分: 10 ** 0,
1805
- 元: 10 ** 2,
1806
- 万: 10 ** 4
1807
- };
1808
- function yn(e) {
1809
- e = {
1810
- ...vn,
1811
- ...e || {}
1812
- };
1813
- const n = (l) => {
1814
- if (l == null)
1815
- return;
1816
- if ((e == null ? void 0 : e.inputUnit) === (e == null ? void 0 : e.outputUnit))
1817
- return l;
1818
- const i = le[e.outputUnit] / le[e.inputUnit];
1819
- return parseFloat((l * i).toFixed(10));
1820
- }, r = (l) => {
1821
- if (l == null)
1926
+ function jr(e) {
1927
+ let r;
1928
+ function n() {
1929
+ if (!e?.autoSubmit || !r)
1822
1930
  return;
1823
- if ((e == null ? void 0 : e.inputUnit) === (e == null ? void 0 : e.outputUnit))
1824
- return l;
1825
- const i = le[e.inputUnit] / le[e.outputUnit];
1826
- return parseFloat((l * i).toFixed(10));
1827
- }, t = (l) => {
1828
- const i = l.split(".");
1829
- return i[0] = i[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), i.join(".");
1830
- }, a = (l) => {
1831
- const i = l;
1832
- return e != null && e.thousands ? t(i) : i;
1833
- }, u = (l) => l.replace(/,/g, "");
1834
- return (l, i) => {
1835
- const s = $(n(l[i.key]));
1836
- te(s, (v) => {
1837
- l[i.key] = r(v);
1838
- });
1839
- const o = (e == null ? void 0 : e.prefix) && (() => typeof (e == null ? void 0 : e.prefix) == "string" ? m("span", null, [e.prefix]) : e.prefix()), c = () => typeof (e == null ? void 0 : e.suffix) == "string" ? m("span", null, [e.suffix]) : typeof (e == null ? void 0 : e.suffix) == "function" ? e.suffix() : e == null ? void 0 : e.inputUnit;
1840
- function d() {
1841
- return m("span", null, [a(s.value.toString()), c()]);
1931
+ let t = r;
1932
+ for (; t && t.$el.tagName !== "FORM"; )
1933
+ t = t.$parent;
1934
+ t && t.$el && t.$el.dispatchEvent(new Event("submit"));
1935
+ }
1936
+ return (t, o) => {
1937
+ e?.default && (t[o.key] = e.default);
1938
+ function a() {
1939
+ const d = t[o.key];
1940
+ return p("span", null, [d ? e?.openLabel ?? "是" : e?.closeLabel ?? "否"]);
1842
1941
  }
1843
- function h() {
1844
- return m(Ue, {
1845
- modelValue: s.value,
1846
- "onUpdate:modelValue": (v) => s.value = v,
1847
- formatter: a,
1848
- parser: u,
1849
- precision: e == null ? void 0 : e.precision,
1850
- hideButton: !0,
1851
- "read-only": e == null ? void 0 : e.readonly,
1852
- placeholder: e == null ? void 0 : e.placeholder,
1853
- allowClear: e == null ? void 0 : e.clearable
1854
- }, {
1855
- prefix: o,
1856
- suffix: c
1857
- });
1942
+ function l() {
1943
+ return p(Gt, {
1944
+ ref: (d) => r = d,
1945
+ modelValue: t[o.key],
1946
+ "onUpdate:modelValue": (d) => t[o.key] = d,
1947
+ checkedText: e?.openLabel ?? "是",
1948
+ uncheckedText: e?.closeLabel ?? "否",
1949
+ checkedValue: e?.openValue ?? !0,
1950
+ uncheckedValue: e?.closeValue ?? !1,
1951
+ onChange: n
1952
+ }, null);
1858
1953
  }
1859
- switch (i.mode) {
1860
- case "text":
1861
- return d();
1862
- case "component":
1863
- default:
1864
- return h();
1954
+ return o.mode === "text" ? a() : l();
1955
+ };
1956
+ }
1957
+ function Er(e) {
1958
+ return (r, n) => {
1959
+ function t() {
1960
+ return p("span", null, [r[n.key]]);
1961
+ }
1962
+ function o() {
1963
+ return p(Qt, {
1964
+ modelValue: r[n.key],
1965
+ "onUpdate:modelValue": (a) => r[n.key] = a,
1966
+ placeholder: e?.placeholder,
1967
+ autoSize: e?.autosize,
1968
+ maxLength: e?.maxLength
1969
+ }, null);
1865
1970
  }
1971
+ return n.mode === "text" ? t() : o();
1866
1972
  };
1867
1973
  }
1868
- const Z = /* @__PURE__ */ new WeakMap();
1869
- function pn() {
1870
- const e = $(/* @__PURE__ */ new Map());
1871
- return [e, (r) => e.value = r];
1974
+ const ue = /* @__PURE__ */ new WeakMap();
1975
+ function zr() {
1976
+ const e = D([]);
1977
+ return [e, (n) => e.value = n];
1872
1978
  }
1873
- function gn(e) {
1874
- let n, r = !1;
1875
- const [t, a] = pn(), u = (o) => {
1876
- if (e.onChange && e.onChange(o), !e.autoSubmit || !n)
1979
+ function Nr(e) {
1980
+ let r, n = !1;
1981
+ const [t, o] = zr(), a = () => {
1982
+ if (!e.autoSubmit || !r)
1877
1983
  return;
1878
- let c = n;
1879
- for (; c && c.$el.tagName !== "FORM"; )
1880
- c = c.$parent;
1881
- c && c.$el && c.$el.dispatchEvent(new Event("submit"));
1882
- }, l = (o, c) => {
1883
- const d = o();
1884
- d instanceof Promise ? d.then(c) : c(d);
1885
- }, i = async () => {
1886
- const o = Z.get(e.options);
1887
- switch (typeof o) {
1984
+ let u = r;
1985
+ for (; u && u.$el.tagName !== "FORM"; )
1986
+ u = u.$parent;
1987
+ u && u.$el && u.$el.dispatchEvent(new Event("submit"));
1988
+ }, l = (u, c) => {
1989
+ const h = u();
1990
+ h instanceof Promise ? h.then(c) : c(h);
1991
+ }, d = async () => {
1992
+ const u = ue.get(e.options);
1993
+ switch (typeof u) {
1994
+ // 已经执行未返回
1888
1995
  case "function":
1889
- Z.set(e.options, a);
1996
+ ue.set(e.options, o);
1890
1997
  return;
1998
+ // 已经执行已返回
1891
1999
  case "object":
1892
- a(o);
2000
+ o(u);
1893
2001
  return;
1894
2002
  }
1895
- Z.set(e.options, a), l(e.options, (c) => {
1896
- const d = Z.get(e.options);
1897
- Z.set(e.options, c), d(c);
2003
+ ue.set(e.options, o), l(e.options, (c) => {
2004
+ const h = ue.get(e.options);
2005
+ ue.set(e.options, c), h(c);
1898
2006
  });
1899
2007
  }, s = () => {
1900
- l(e.options, (o) => {
1901
- a(o);
2008
+ l(e.options, (u) => {
2009
+ o(u);
1902
2010
  });
1903
2011
  };
1904
2012
  switch (!0) {
1905
- case e.options instanceof Function: {
1906
- e.cache !== !1 ? i() : s();
2013
+ case typeof e.options == "function": {
2014
+ e.cache !== !1 ? d() : s();
1907
2015
  break;
1908
2016
  }
1909
- case re(e.options): {
1910
- de(() => e.options, () => {
1911
- a(e.options.value);
2017
+ case ie(e.options): {
2018
+ Fe(() => e.options, () => {
2019
+ o(e.options.value);
1912
2020
  }, {
1913
2021
  immediate: !0
1914
2022
  });
@@ -1917,188 +2025,91 @@ function gn(e) {
1917
2025
  default:
1918
2026
  t.value = e.options;
1919
2027
  }
1920
- return (o, c) => {
1921
- e.default && !r && (o[c.key] = e.default, r = !0);
1922
- function d() {
1923
- var f;
1924
- const v = o[c.key];
1925
- return m("span", null, [(f = t.value) == null ? void 0 : f.get(v)]);
1926
- }
2028
+ function i(u, c) {
2029
+ const h = e.fieldNames?.title || "title", m = c[h];
2030
+ return m ? m.toLowerCase().includes(u.toLowerCase()) : !1;
2031
+ }
2032
+ return (u, c) => {
2033
+ e.default && !n && (u[c.key] = e.default, n = !0);
1927
2034
  function h() {
1928
- return m(Tt, {
1929
- type: e.type || "radio",
1930
- size: e.size,
1931
- ref: (v) => n = v,
1932
- modelValue: o[c.key],
1933
- "onUpdate:modelValue": (v) => o[c.key] = v,
1934
- onChange: u,
1935
- options: Array.from(t.value.entries()).map(([v, f]) => ({
1936
- label: f,
1937
- value: v
1938
- }))
1939
- }, null);
2035
+ const f = u[c.key], x = (v) => {
2036
+ const [F] = ht({
2037
+ data: t.value,
2038
+ valueProp: "key",
2039
+ key: v
2040
+ }).reverse() || [];
2041
+ return F?.title;
2042
+ };
2043
+ if (e.multiple) {
2044
+ const v = f.map((F) => x(F));
2045
+ return p("span", null, [v.join(", ")]);
2046
+ } else {
2047
+ const v = x(f);
2048
+ return p("span", null, [v]);
2049
+ }
1940
2050
  }
1941
- switch (c.mode) {
1942
- case "text":
1943
- return d();
1944
- case "component":
1945
- default:
1946
- return h();
2051
+ function m() {
2052
+ return p(Xt, {
2053
+ ref: (f) => r = f,
2054
+ multiple: e.multiple,
2055
+ modelValue: u[c.key],
2056
+ "onUpdate:modelValue": (f) => u[c.key] = f,
2057
+ placeholder: e.placeholder,
2058
+ allowClear: e.clearable,
2059
+ allowSearch: e.searchable,
2060
+ maxTagCount: e.maxTagCount ?? 2,
2061
+ onChange: a,
2062
+ filterTreeNode: i,
2063
+ data: t.value,
2064
+ fieldNames: e.fieldNames,
2065
+ treeProps: e.treeProps,
2066
+ treeCheckStrictly: e.treeCheckStrictly,
2067
+ treeCheckedStrategy: e.treeCheckedStrategy
2068
+ }, {
2069
+ ...e.slots
2070
+ });
1947
2071
  }
2072
+ return c.mode === "text" ? h() : m();
1948
2073
  };
1949
2074
  }
1950
- function bn() {
2075
+ function Br() {
1951
2076
  return {
1952
- input: Zr,
1953
- textarea: cn,
1954
- select: rn,
1955
- treeSelect: dn,
1956
- date: Gr,
1957
- switch: nn,
1958
- dateRange: un,
1959
- render: hn,
1960
- cascader: mn,
1961
- currency: yn,
1962
- radio: gn
2077
+ input: Yr,
2078
+ textarea: Er,
2079
+ select: Pr,
2080
+ treeSelect: Nr,
2081
+ date: Cr,
2082
+ switch: jr,
2083
+ dateRange: Fr,
2084
+ render: Dr,
2085
+ cascader: cr,
2086
+ currency: fr,
2087
+ radio: Tr
1963
2088
  };
1964
2089
  }
1965
- function je(e, n) {
1966
- n.render || (n.render = (t) => t.input());
1967
- const r = n.render({
1968
- ...bn()
2090
+ function st(e, r) {
2091
+ r.render || (r.render = (t) => t.input());
2092
+ const n = r.render({
2093
+ ...Br()
1969
2094
  });
1970
2095
  return {
1971
- default: () => r(e, n)
2096
+ default: () => n(e, r)
1972
2097
  };
1973
2098
  }
1974
- function Ie(e, n) {
1975
- switch (n.mode) {
1976
- case "text":
1977
- return Ye(je(e, n).default);
1978
- case "component":
1979
- default:
1980
- return Ye(be, {
1981
- key: n.key,
1982
- field: n.key,
1983
- label: n.title,
1984
- hideLabel: n.hideLabel,
1985
- labelColStyle: n.labelStyle,
1986
- wrapperColStyle: n.contentStyle
1987
- }, je(e, n));
1988
- }
1989
- }
1990
- function kn(e) {
1991
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !xe(e);
2099
+ function it(e, r) {
2100
+ return r.mode === "text" ? Je(st(e, r).default) : Je(Ne, {
2101
+ key: r.key,
2102
+ field: r.key,
2103
+ label: r.title,
2104
+ hideLabel: r.hideLabel,
2105
+ labelColStyle: r.labelStyle,
2106
+ wrapperColStyle: r.contentStyle
2107
+ }, st(e, r));
1992
2108
  }
1993
- const wn = /* @__PURE__ */ I({
1994
- props: {
1995
- form: {
1996
- type: Object,
1997
- required: !0
1998
- },
1999
- value: {
2000
- type: Object
2001
- },
2002
- columns: {
2003
- type: Number,
2004
- default: 2
2005
- }
2006
- },
2007
- setup(e) {
2008
- const n = He(), r = e.form.map((s) => ({
2009
- ...s,
2010
- collapsed: !1
2011
- })), t = Array.from(new Set(r.map((s) => s.group).flat().filter(Boolean))), a = r.reduce((s, o) => ((o.group ? [o.group].flat() : ["默认"]).forEach((c) => {
2012
- let d = s.find((h) => h.group === c);
2013
- d || (d = {
2014
- group: c,
2015
- instance: void 0,
2016
- form: []
2017
- }, s.push(d)), d.form.push(o);
2018
- }), s), []).sort((s, o) => s.group === "默认" ? -1 : o.group === "默认" ? 1 : s.group > o.group ? -1 : 1), u = $("默认");
2019
- return {
2020
- formItems: r,
2021
- groups: t,
2022
- groupForms: a,
2023
- activeTab: u,
2024
- onSubmit: () => {
2025
- const s = a.find((o) => o.group === u.value);
2026
- if (s && s.instance) {
2027
- const o = s.instance.formSource;
2028
- s.instance.validate().then((c) => {
2029
- c || n.close(o);
2030
- });
2031
- }
2032
- },
2033
- onReset: () => {
2034
- const s = a.find((o) => o.group === u.value);
2035
- s && s.instance && s.instance.reset();
2036
- }
2037
- };
2038
- },
2039
- render() {
2040
- const e = this.groupForms.find((n) => n.group === this.activeTab);
2041
- if (this.groups.length) {
2042
- let n;
2043
- return m(Lt, {
2044
- "active-key": this.activeTab,
2045
- "onUpdate:active-key": (r) => this.activeTab = r
2046
- }, kn(n = this.groupForms.map((r) => m(Pt, {
2047
- title: r.group,
2048
- key: r.group
2049
- }, {
2050
- default: () => [m(ke, {
2051
- columns: this.columns,
2052
- form: r.form,
2053
- value: this.value,
2054
- ref: (t) => r.instance = t
2055
- }, null), m(De, null, null), m("div", {
2056
- class: "flex items-center justify-between space-x-2"
2057
- }, [m(j, {
2058
- type: "secondary",
2059
- size: "large",
2060
- onClick: this.onReset
2061
- }, {
2062
- default: () => [R("重置")]
2063
- }), m(j, {
2064
- class: "w-100px",
2065
- type: "primary",
2066
- size: "large",
2067
- onClick: this.onSubmit
2068
- }, {
2069
- default: () => [R("搜索")]
2070
- })])]
2071
- }))) ? n : {
2072
- default: () => [n]
2073
- });
2074
- } else
2075
- return m(ae, null, [m(ke, {
2076
- columns: this.columns,
2077
- form: this.formItems,
2078
- value: this.value,
2079
- ref: (n) => e.instance = n
2080
- }, null), m(De, null, null), m("div", {
2081
- class: "flex items-center justify-between space-x-2"
2082
- }, [m(j, {
2083
- type: "secondary",
2084
- size: "large",
2085
- onClick: this.onReset
2086
- }, {
2087
- default: () => [R("重置")]
2088
- }), m(j, {
2089
- class: "w-100px",
2090
- type: "primary",
2091
- size: "large",
2092
- onClick: this.onSubmit
2093
- }, {
2094
- default: () => [R("搜索")]
2095
- })])]);
2096
- }
2097
- });
2098
- function Ee(e) {
2099
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !xe(e);
2109
+ function ct(e) {
2110
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !qe(e);
2100
2111
  }
2101
- const ke = /* @__PURE__ */ I({
2112
+ const Be = /* @__PURE__ */ U({
2102
2113
  props: {
2103
2114
  form: {
2104
2115
  type: Object,
@@ -2183,48 +2194,46 @@ const ke = /* @__PURE__ */ I({
2183
2194
  emits: ["submit", "cancel", "update:model-value"],
2184
2195
  expose: ["formSource", "updateFormField", "updateFormSource", "reset", "validate"],
2185
2196
  setup(e, {
2186
- emit: n
2197
+ emit: r
2187
2198
  }) {
2188
- const r = $(), [t, a] = Vr(e.form, e.modelValue || e.value), u = $(e.columns || 0), l = $(!0), i = $(), s = () => l.value = !l.value, o = $(""), c = $("");
2189
- ge(Le.id, o), ge(Le.source, t);
2190
- const d = () => {
2191
- n("submit", t.value), n("update:model-value", t.value);
2192
- }, h = F(() => e.form.filter((g) => l.value ? !g.collapsed : !0).filter((g) => {
2199
+ const n = D(), [t, o] = nr(e.form, e.modelValue || e.value), a = D(e.columns || 0), l = D(!0), d = D(), s = () => l.value = !l.value, i = D(""), u = D("");
2200
+ ze(nt.id, i), ze(nt.source, t);
2201
+ const c = () => {
2202
+ r("submit", t.value), r("update:model-value", t.value);
2203
+ }, h = L(() => e.form.filter((b) => l.value ? !b.collapsed : !0).filter((b) => {
2193
2204
  switch (!0) {
2194
- case typeof g.visiable == "boolean":
2195
- return g.visiable;
2196
- case typeof g.visiable == "function":
2197
- return g.visiable(t.value);
2205
+ case typeof b.visiable == "boolean":
2206
+ return b.visiable;
2207
+ case typeof b.visiable == "function":
2208
+ return b.visiable(t.value);
2198
2209
  default:
2199
2210
  return !0;
2200
2211
  }
2201
- })), v = F(() => {
2202
- if (!u.value)
2212
+ })), m = L(() => {
2213
+ if (!a.value)
2203
2214
  return 1;
2204
- const g = h.value.reduce((x, Y) => x + ((Y == null ? void 0 : Y.span) || 1), 0);
2205
- return u.value - g % u.value;
2206
- }), f = (g) => g != null && g.validator ? {
2207
- ...g,
2208
- validator: (x, Y) => {
2209
- const D = g.validator(x, Y);
2210
- if (typeof D == "function")
2211
- return D(t.value);
2215
+ const b = h.value.reduce((_, j) => _ + (j?.span || 1), 0);
2216
+ return a.value - b % a.value;
2217
+ }), f = (b) => b?.validator ? {
2218
+ ...b,
2219
+ validator: (_, j) => {
2220
+ const H = b.validator(_, j);
2221
+ if (typeof H == "function")
2222
+ return H(t.value);
2212
2223
  }
2213
- } : g, k = F(() => e.form.reduce((g, x) => (x.rule && (Array.isArray(x.rule) ? g[x.key] = x.rule.map(f) : g[x.key] = f(x.rule)), g), {}));
2214
- function p() {
2215
- var x;
2224
+ } : b, x = L(() => e.form.reduce((b, _) => (_.rule && (Array.isArray(_.rule) ? b[_.key] = _.rule.map(f) : b[_.key] = f(_.rule)), b), {}));
2225
+ function v() {
2216
2226
  if (e.columns)
2217
2227
  return;
2218
- const g = (x = r.value) == null ? void 0 : x.$el;
2219
- g && (u.value = Math.max(Math.floor(g.offsetWidth / e.minWidth), 1));
2228
+ const b = n.value?.$el;
2229
+ b && (a.value = Math.max(Math.floor(b.offsetWidth / e.minWidth), 1));
2220
2230
  }
2221
- function C() {
2222
- var x;
2223
- const g = (x = r.value) == null ? void 0 : x.$el;
2224
- g && (g.id = o.value);
2231
+ function F() {
2232
+ const b = n.value?.$el;
2233
+ b && (b.id = i.value);
2225
2234
  }
2226
- function O() {
2227
- i.value.open(wn, {
2235
+ function Y() {
2236
+ d.value.open(or, {
2228
2237
  form: e.form,
2229
2238
  value: t.value,
2230
2239
  columns: e.collapsedDialogColumns
@@ -2232,169 +2241,167 @@ const ke = /* @__PURE__ */ I({
2232
2241
  title: "高级搜索",
2233
2242
  footer: !1,
2234
2243
  submitText: "搜索"
2235
- }).then((g) => {
2236
- g && (M(g), d());
2244
+ }).then((b) => {
2245
+ b && (I(b), c());
2237
2246
  });
2238
2247
  }
2239
- H(() => {
2240
- const g = Math.random().toString(32).slice(2);
2241
- o.value = e.id ?? g, c.value = e.name ?? g, p(), C(), window && window.addEventListener("resize", p);
2248
+ te(() => {
2249
+ const b = Math.random().toString(32).slice(2);
2250
+ i.value = e.id ?? b, u.value = e.name ?? b, v(), F(), window && window.addEventListener("resize", v);
2242
2251
  });
2243
- function M(g) {
2244
- a({
2252
+ function I(b) {
2253
+ o({
2245
2254
  ...t.value,
2246
- ...g || {}
2255
+ ...b || {}
2247
2256
  });
2248
2257
  }
2249
- function E(g, x) {
2250
- t.value[g] = x, M({
2258
+ function P(b, _) {
2259
+ t.value[b] = _, I({
2251
2260
  ...t.value
2252
2261
  });
2253
2262
  }
2254
- function G(g) {
2255
- const x = e.form.find((D) => D.key === g), Y = (typeof x.default == "function" ? x.default() : x.default) || null;
2256
- E(g, Y);
2263
+ function R(b) {
2264
+ const _ = e.form.find((H) => H.key === b), j = (typeof _.default == "function" ? _.default() : _.default) || null;
2265
+ P(b, j);
2257
2266
  }
2258
- function A() {
2259
- r.value && r.value.resetFields();
2267
+ function N() {
2268
+ n.value && n.value.resetFields();
2260
2269
  }
2261
- function w() {
2262
- var g;
2263
- return (g = r.value) == null ? void 0 : g.validate();
2270
+ function V() {
2271
+ return n.value?.validate();
2264
2272
  }
2265
2273
  return {
2266
- formId: o,
2267
- formName: c,
2274
+ formId: i,
2275
+ formName: u,
2268
2276
  formSource: t,
2269
- formInstance: r,
2270
- formColumns: u,
2271
- formRules: k,
2277
+ formInstance: n,
2278
+ formColumns: a,
2279
+ formRules: x,
2272
2280
  formCollspased: l,
2273
- formActiosSpan: v,
2281
+ formActiosSpan: m,
2274
2282
  formItems: h,
2275
2283
  toggleFormCollapsed: s,
2276
- updateFormField: E,
2277
- resetFormField: G,
2278
- resetFormFields: A,
2279
- updateFormSource: M,
2280
- reset: A,
2281
- validate: w,
2282
- onSubmitSuccess: d,
2283
- openCollapsedDialog: O,
2284
- modalInstance: i
2284
+ updateFormField: P,
2285
+ resetFormField: R,
2286
+ resetFormFields: N,
2287
+ updateFormSource: I,
2288
+ reset: N,
2289
+ validate: V,
2290
+ onSubmitSuccess: c,
2291
+ openCollapsedDialog: Y,
2292
+ modalInstance: d
2285
2293
  };
2286
2294
  },
2287
2295
  render() {
2288
2296
  const e = () => {
2289
2297
  if (!this.showFormResult)
2290
2298
  return;
2291
- const r = this.form.filter((a) => {
2292
- const u = this.formSource[a.key];
2299
+ const n = this.form.filter((o) => {
2300
+ const a = this.formSource[o.key];
2293
2301
  switch (!0) {
2294
- case typeof u == "string":
2295
- return u !== "";
2296
- case Array.isArray(u):
2297
- return u.length !== 0;
2302
+ case typeof a == "string":
2303
+ return a !== "";
2304
+ case Array.isArray(a):
2305
+ return a.length !== 0;
2298
2306
  default:
2299
- return u != null;
2307
+ return a != null;
2300
2308
  }
2301
- }), t = (a) => {
2302
- var l;
2303
- const u = this.formItems.find((i) => i.key === a);
2304
- u && !(u != null && u.collapsed) ? (l = this.formInstance) == null || l.resetFields(a) : this.resetFormField(a);
2309
+ }), t = (o) => {
2310
+ const a = this.formItems.find((l) => l.key === o);
2311
+ a && !a?.collapsed ? this.formInstance?.resetFields(o) : this.resetFormField(o);
2305
2312
  };
2306
- return m(fe, {
2313
+ return p(De, {
2307
2314
  span: this.formColumns
2308
2315
  }, {
2309
- default: () => [m(be, {
2316
+ default: () => [p(Ne, {
2310
2317
  label: "搜索条件",
2311
2318
  class: "mb-0!"
2312
2319
  }, {
2313
- default: () => [m("div", {
2314
- class: "w-full mt-5px text-left"
2315
- }, [m(Te, {
2320
+ default: () => [p("div", {
2321
+ class: "mt-5px w-full text-left"
2322
+ }, [p(tt, {
2316
2323
  wrap: !0,
2317
2324
  align: "center"
2318
2325
  }, {
2319
- default: () => [r.length > 0 ? r.map((a) => m(It, {
2320
- key: a.key,
2326
+ default: () => [n.length > 0 ? n.map((o) => p(Jt, {
2327
+ key: o.key,
2321
2328
  closable: !0,
2322
- onClose: () => t(a.key)
2329
+ onClose: () => t(o.key)
2323
2330
  }, {
2324
- default: () => [m("div", {
2331
+ default: () => [p("div", {
2325
2332
  class: "flex space-x-2"
2326
- }, [m("div", {
2333
+ }, [p("div", {
2327
2334
  class: "text-#999"
2328
- }, [a.title, R(":")]), m("div", {
2335
+ }, [o.title, q(":")]), p("div", {
2329
2336
  class: "text-#333"
2330
- }, [Ie(this.formSource, {
2331
- ...a,
2332
- key: a.key,
2337
+ }, [it(this.formSource, {
2338
+ ...o,
2339
+ key: o.key,
2333
2340
  mode: "text"
2334
2341
  })])])]
2335
- })) : m("div", {
2342
+ })) : p("div", {
2336
2343
  class: "text-#999"
2337
- }, [R("暂无搜索条件")])]
2344
+ }, [q("暂无搜索条件")])]
2338
2345
  })])]
2339
2346
  })]
2340
2347
  });
2341
- }, n = () => {
2342
- const r = [], t = this.footer ? {
2348
+ }, r = () => {
2349
+ const n = [], t = this.footer ? {
2343
2350
  span: this.formColumns
2344
2351
  } : {
2345
2352
  span: this.formActiosSpan
2346
2353
  };
2347
- if (this.searchable && (r.push(m(j, {
2354
+ if (this.searchable && (n.push(p(W, {
2348
2355
  type: "primary",
2349
2356
  htmlType: "submit"
2350
2357
  }, {
2351
- default: () => [R("搜索")]
2352
- })), this.resetable && r.push(m(j, {
2358
+ default: () => [q("搜索")]
2359
+ })), this.resetable && n.push(p(W, {
2353
2360
  type: "secondary",
2354
2361
  onClick: () => this.resetFormFields()
2355
2362
  }, {
2356
- default: () => [R("重置")]
2357
- }))), this.submitable && (r.push(m(j, {
2363
+ default: () => [q("重置")]
2364
+ }))), this.submitable && (n.push(p(W, {
2358
2365
  type: "primary",
2359
2366
  htmlType: "submit"
2360
2367
  }, {
2361
- default: () => [R("提交")]
2362
- })), r.push(m(j, {
2368
+ default: () => [q("提交")]
2369
+ })), n.push(p(W, {
2363
2370
  type: "secondary",
2364
2371
  onClick: () => this.$emit("cancel")
2365
2372
  }, {
2366
- default: () => [R("取消")]
2367
- }))), this.form.some((a) => !!a.collapsed) && (this.collapsedMode === "append" && r.push(m(j, {
2373
+ default: () => [q("取消")]
2374
+ }))), this.form.some((o) => !!o.collapsed) && (this.collapsedMode === "append" && n.push(p(W, {
2368
2375
  onClick: this.toggleFormCollapsed
2369
2376
  }, {
2370
2377
  default: () => this.formCollspased ? "展开" : "收起",
2371
- icon: () => this.formCollspased ? m(Ht, null, null) : m(Zt, null, null)
2372
- })), this.collapsedMode === "dialog" && r.push(m(j, {
2378
+ icon: () => this.formCollspased ? p(cn, null, null) : p(vn, null, null)
2379
+ })), this.collapsedMode === "dialog" && n.push(p(W, {
2373
2380
  onClick: this.openCollapsedDialog
2374
2381
  }, {
2375
2382
  default: () => "高级搜索",
2376
- icon: () => m(ar, null, null)
2377
- }))), this.$slots.actions && r.push(...this.$slots.actions()), r.length)
2378
- return m(fe, t, {
2379
- default: () => [m(be, {
2380
- hideLabel: this.formItems.every((a) => !!a.hideLabel),
2383
+ icon: () => p(xn, null, null)
2384
+ }))), this.$slots.actions && n.push(...this.$slots.actions()), n.length)
2385
+ return p(De, t, {
2386
+ default: () => [p(Ne, {
2387
+ hideLabel: this.formItems.every((o) => !!o.hideLabel),
2381
2388
  contentClass: this.footer ? "form-footer" : ""
2382
2389
  }, {
2383
- default: () => [m(Te, null, Ee(r) ? r : {
2384
- default: () => [r]
2390
+ default: () => [p(tt, null, ct(n) ? n : {
2391
+ default: () => [n]
2385
2392
  })]
2386
2393
  })]
2387
2394
  });
2388
2395
  };
2389
- return m("div", {
2396
+ return p("div", {
2390
2397
  class: {
2391
2398
  "form-render": !0,
2392
2399
  "no-rules": Object.keys(this.formRules).length === 0
2393
2400
  }
2394
- }, [m(Ar, {
2395
- ref: (r) => this.modalInstance = r
2401
+ }, [p(tr, {
2402
+ ref: (n) => this.modalInstance = n
2396
2403
  }, {
2397
- default: () => [m(Rt, B({
2404
+ default: () => [p(Zt, Z({
2398
2405
  name: this.formName
2399
2406
  }, {
2400
2407
  labelAlign: "right",
@@ -2402,49 +2409,45 @@ const ke = /* @__PURE__ */ I({
2402
2409
  rules: this.formRules,
2403
2410
  onSubmitSuccess: this.onSubmitSuccess,
2404
2411
  "auto-label-width": !0,
2405
- ref: (r) => this.formInstance = r,
2412
+ ref: (n) => this.formInstance = n,
2406
2413
  model: this.formSource
2407
2414
  }), {
2408
- default: () => [m(jt, {
2415
+ default: () => [p(Kt, {
2409
2416
  cols: this.formColumns,
2410
2417
  "col-gap": this.$props.colGap,
2411
2418
  "row-gap": this.$props.rowGap
2412
2419
  }, {
2413
- default: () => [this.formItems.filter(() => this.formColumns !== 0).map((r) => {
2420
+ default: () => [this.formItems.filter(() => this.formColumns !== 0).map((n) => {
2414
2421
  let t;
2415
- return m(fe, {
2416
- span: r.span,
2417
- key: r.key
2418
- }, Ee(t = Ie(this.formSource, r)) ? t : {
2422
+ return p(De, {
2423
+ span: n.span,
2424
+ key: n.key
2425
+ }, ct(t = it(this.formSource, n)) ? t : {
2419
2426
  default: () => [t]
2420
2427
  });
2421
- }), n(), e()]
2428
+ }), r(), e()]
2422
2429
  })]
2423
2430
  })]
2424
2431
  })]);
2425
2432
  }
2426
2433
  });
2427
- function On(e) {
2428
- return e;
2429
- }
2430
- function $n(e) {
2431
- const n = W(), r = $();
2434
+ function Hr(e) {
2435
+ const r = ee(), n = D();
2432
2436
  function t() {
2433
- var u, l;
2434
- const a = (l = (u = n == null ? void 0 : n.proxy) == null ? void 0 : u.$refs) == null ? void 0 : l[e];
2435
- a && (r.value = a);
2437
+ const o = r?.proxy?.$refs?.[e];
2438
+ o && (n.value = o);
2436
2439
  }
2437
- return H(t), gt(t), r;
2440
+ return te(t), Rt(t), n;
2438
2441
  }
2439
- const _n = {
2440
- install(e, n) {
2441
- e.component("FormRender", ke);
2442
+ const Ur = {
2443
+ install(e, r) {
2444
+ e.component("FormRender", Be);
2442
2445
  }
2443
2446
  };
2444
2447
  export {
2445
- ke as FormRender,
2446
- Yn as FormRenderResolver,
2447
- _n as default,
2448
- On as defineForm,
2449
- $n as useForm
2448
+ Be as FormRender,
2449
+ Xr as FormRenderResolver,
2450
+ Ur as default,
2451
+ Wr as defineForm,
2452
+ Hr as useForm
2450
2453
  };