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