@maxtan/ez-ui 0.24.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,36 +1,44 @@
1
- import { useAttrs as $e, computed as C, defineComponent as V, mergeModels as O, useModel as M, createBlock as m, openBlock as n, unref as t, mergeProps as v, withCtx as b, createElementBlock as E, Fragment as I, renderList as j, resolveDynamicComponent as ie, createTextVNode as Z, toDisplayString as Y, resolveDirective as ke, renderSlot as A, createCommentVNode as S, withDirectives as ze, createElementVNode as P, ref as B, createVNode as x, withModifiers as fe, normalizeStyle as Ce, createSlots as te, shallowRef as Oe, watch as Ne, onMounted as ue, onUnmounted as qe, normalizeProps as me, guardReactiveProps as Fe, normalizeClass as He, nextTick as Ge } from "vue";
2
- import { useLocale as We, ElCheckbox as Se, ElCheckboxButton as je, ElCheckboxGroup as Ke, ElLoading as de, ElDialog as Ye, ElButton as J, ElSelect as Xe, ElOptionGroup as Ze, ElOption as ve, ElRadio as Je, ElRadioButton as Qe, ElRadioGroup as _e, ElUpload as pe, ElImage as ge, ElImageViewer as el, ElMessage as ee, ElFormItem as ll, ElInput as se, ElInputNumber as tl, ElDatePicker as ne, ElTimePicker as be, ElSwitch as al, ElTreeSelect as ol, ElCascader as nl, ElTree as sl, ElSlider as rl, ElRate as il, ElForm as ul, ElRow as dl, ElCol as cl, ElTable as fl, ElTableColumn as ye, ElPagination as ml, ElDrawer as vl, ElInfiniteScroll as pl, ElMessageBox as gl, ElNotification as bl, ElPopoverDirective as yl } from "element-plus";
3
- const N = (e, d) => (e.install = (l) => {
4
- for (const o of [e, ...Object.values({})])
5
- o.name ? l.component(o.name, o) : process.env.NODE_ENV !== "production" && console.warn("[withInstall] Component is missing name property:", o);
6
- }, e);
7
- function Q(e = []) {
8
- const d = $e(), l = C(() => {
9
- const f = {};
10
- for (const a in d)
11
- e.includes(a) || (f[a] = d[a]);
12
- return f;
13
- }), o = C(() => {
14
- const f = {};
15
- for (const a in l.value)
16
- a.startsWith("on") || (f[a] = l.value[a]);
17
- return f;
18
- }), s = C(() => {
19
- const f = {};
20
- for (const a in l.value)
21
- a.startsWith("on") && (f[a] = l.value[a]);
22
- return f;
1
+ import { useAttrs as Ze, computed as U, defineComponent as x, mergeModels as _, useModel as ee, createBlock as g, openBlock as r, unref as l, mergeProps as S, withCtx as k, createElementBlock as C, Fragment as X, renderList as ie, resolveDynamicComponent as De, createTextVNode as he, toDisplayString as de, resolveDirective as Je, renderSlot as R, createCommentVNode as O, withDirectives as _e, createElementVNode as Y, ref as G, createVNode as W, withModifiers as Be, normalizeStyle as we, createSlots as Se, useSlots as ct, shallowRef as Ue, watch as ye, onMounted as Me, normalizeClass as Ae, nextTick as Pe, onUnmounted as ft, normalizeProps as ze, guardReactiveProps as Fe } from "vue";
2
+ import { useLocale as mt, ElCheckbox as et, ElCheckboxButton as pt, ElCheckboxGroup as vt, ElLoading as Re, ElDialog as gt, ElButton as be, ElSelect as yt, ElOptionGroup as bt, ElOption as Ne, ElRadio as ht, ElRadioButton as Et, ElRadioGroup as Vt, ElUpload as Le, ElImage as qe, ElImageViewer as $t, ElMessage as ge, ElFormItem as wt, ElInput as xe, ElInputNumber as St, ElDatePicker as Ce, ElTimePicker as He, ElSwitch as kt, ElTreeSelect as zt, ElCascader as Ct, ElSlider as At, ElRate as Dt, ElForm as xt, ElRow as Ut, ElCol as Pt, ElTable as Tt, ElTableColumn as Ge, ElPagination as Mt, ElDrawer as Rt, ElInfiniteScroll as It, ElMessageBox as Ot, ElNotification as Bt, ElPopoverDirective as Ft } from "element-plus";
3
+ const te = (e, s) => (e.install = (t) => {
4
+ for (const a of [e, ...Object.values({})])
5
+ a.name ? t.component(a.name, a) : process.env.NODE_ENV !== "production" && console.warn("[withInstall] Component is missing name property:", a);
6
+ }, e), Ke = (e) => e.replace(/\B([A-Z])/g, "-$1").toLowerCase(), je = (e) => e.replace(/-([a-z])/g, (s, t) => t.toUpperCase()), Nt = (e) => {
7
+ const s = e.startsWith("onUpdate:") ? e.slice(9) : e, t = /* @__PURE__ */ new Set([e, s, Ke(s), je(s)]);
8
+ return e.startsWith("onUpdate:") || (t.add(`onUpdate:${s}`), t.add(`onUpdate:${Ke(s)}`), t.add(`onUpdate:${je(s)}`)), t;
9
+ }, Lt = (e, s) => {
10
+ for (const t of e)
11
+ if (Nt(t).has(s))
12
+ return !0;
13
+ return !1;
14
+ };
15
+ function Ee(e = []) {
16
+ const s = Ze(), t = U(() => {
17
+ const o = {};
18
+ for (const c in s)
19
+ Lt(e, c) || (o[c] = s[c]);
20
+ return o;
21
+ }), a = U(() => {
22
+ const o = {};
23
+ for (const c in t.value)
24
+ c.startsWith("on") || (o[c] = t.value[c]);
25
+ return o;
26
+ }), i = U(() => {
27
+ const o = {};
28
+ for (const c in t.value)
29
+ c.startsWith("on") && (o[c] = t.value[c]);
30
+ return o;
23
31
  });
24
32
  return {
25
33
  /** 所有过滤后的属性(包括事件) */
26
- attrs: l,
34
+ attrs: t,
27
35
  /** 只包含普通属性 */
28
- props: o,
36
+ props: a,
29
37
  /** 只包含事件监听器 */
30
- listeners: s
38
+ listeners: i
31
39
  };
32
40
  }
33
- var hl = {
41
+ var qt = {
34
42
  s: {
35
43
  label: {
36
44
  name: "姓名",
@@ -110,39 +118,51 @@ var hl = {
110
118
  }
111
119
  }
112
120
  };
113
- const { s: Vl } = hl;
114
- function El(e, d) {
115
- return d.split(".").reduce((l, o) => l && typeof l == "object" ? l[o] : void 0, e);
121
+ const { s: Ht } = qt;
122
+ function Gt(e, s) {
123
+ return s.split(".").reduce((t, a) => t && typeof t == "object" ? t[a] : void 0, e);
116
124
  }
117
- function wl(e, d = {}) {
118
- return e.replace(/\{\s*(\w+)\s*\}/g, (l, o) => {
119
- const s = d[o];
120
- return s !== void 0 ? String(s) : `{${o}}`;
125
+ function Kt(e, s = {}) {
126
+ return e.replace(/\{\s*(\w+)\s*\}/g, (t, a) => {
127
+ const i = s[a];
128
+ return i !== void 0 ? String(i) : `{${a}}`;
121
129
  });
122
130
  }
123
- function ae() {
124
- const { t: e, lang: d } = We();
131
+ function ke() {
132
+ const { t: e, lang: s } = mt();
125
133
  return {
126
- t: (o, s = {}) => {
127
- const f = e(o, s);
128
- if (f !== o) return f;
129
- const a = El({ s: Vl }, o);
130
- return typeof a == "string" ? wl(a, s) : o;
134
+ t: (a, i = {}) => {
135
+ const o = e(a, i);
136
+ if (o !== a) return o;
137
+ const c = Gt({ s: Ht }, a);
138
+ return typeof c == "string" ? Kt(c, i) : a;
131
139
  },
132
- lang: d
140
+ lang: s
133
141
  };
134
142
  }
135
- function $l(e, d = 200) {
136
- let l = null;
137
- return function(...o) {
138
- l || (l = setTimeout(() => {
139
- e.apply(this, o), l = null;
140
- }, d));
143
+ function j(e) {
144
+ if (e === null || typeof e != "object") return e;
145
+ if (e instanceof Date) return new Date(e.getTime());
146
+ if (e instanceof Array) return e.map((t) => j(t));
147
+ if (e instanceof Set) return new Set(Array.from(e).map((t) => j(t)));
148
+ if (e instanceof Map)
149
+ return new Map(Array.from(e.entries()).map(([t, a]) => [j(t), j(a)]));
150
+ const s = Object.create(Object.getPrototypeOf(e));
151
+ for (const t in e)
152
+ e.hasOwnProperty(t) && (s[t] = j(e[t]));
153
+ return s;
154
+ }
155
+ function jt(e, s = 200) {
156
+ let t = null;
157
+ return function(...a) {
158
+ t || (t = setTimeout(() => {
159
+ e.apply(this, a), t = null;
160
+ }, s));
141
161
  };
142
162
  }
143
- const kl = V({ name: "EzCheckbox", inheritAttrs: !1 }), zl = /* @__PURE__ */ V({
144
- ...kl,
145
- props: /* @__PURE__ */ O({
163
+ const Wt = x({ name: "EzCheckbox", inheritAttrs: !1 }), Yt = /* @__PURE__ */ x({
164
+ ...Wt,
165
+ props: /* @__PURE__ */ _({
146
166
  type: { default: "default" },
147
167
  options: { default: () => [] }
148
168
  }, {
@@ -151,22 +171,22 @@ const kl = V({ name: "EzCheckbox", inheritAttrs: !1 }), zl = /* @__PURE__ */ V({
151
171
  }),
152
172
  emits: ["update:modelValue"],
153
173
  setup(e) {
154
- const d = e, l = M(e, "modelValue"), { attrs: o } = Q(["options", "type", "modelValue"]), s = C(
155
- () => ["default", "border"].includes(d.type) ? Se : je
174
+ const s = e, t = ee(e, "modelValue"), { attrs: a } = Ee(["options", "type", "modelValue"]), i = U(
175
+ () => ["default", "border"].includes(s.type) ? et : pt
156
176
  );
157
- return (f, a) => (n(), m(t(Ke), v({
158
- modelValue: l.value,
159
- "onUpdate:modelValue": a[0] || (a[0] = (c) => l.value = c)
160
- }, t(o)), {
161
- default: b(() => [
162
- (n(!0), E(I, null, j(e.options, (c) => (n(), m(ie(s.value), v({
163
- key: String(c.value),
177
+ return (o, c) => (r(), g(l(vt), S({
178
+ modelValue: t.value,
179
+ "onUpdate:modelValue": c[0] || (c[0] = (h) => t.value = h)
180
+ }, l(a)), {
181
+ default: k(() => [
182
+ (r(!0), C(X, null, ie(e.options, (h) => (r(), g(De(i.value), S({
183
+ key: String(h.value),
164
184
  ref_for: !0
165
- }, c, {
185
+ }, h, {
166
186
  border: e.type === "border"
167
187
  }), {
168
- default: b(() => [
169
- Z(Y(c.label), 1)
188
+ default: k(() => [
189
+ he(de(h.label), 1)
170
190
  ]),
171
191
  _: 2
172
192
  }, 1040, ["border"]))), 128))
@@ -174,122 +194,121 @@ const kl = V({ name: "EzCheckbox", inheritAttrs: !1 }), zl = /* @__PURE__ */ V({
174
194
  _: 1
175
195
  }, 16, ["modelValue"]));
176
196
  }
177
- }), Ae = N(zl);
178
- var le = /* @__PURE__ */ ((e) => (e.CANCEL = "取消", e.CONFIRM = "确定", e))(le || {});
179
- const Cl = { key: 1 }, Sl = {
197
+ }), tt = te(Yt);
198
+ var $e = /* @__PURE__ */ ((e) => (e.CANCEL = "取消", e.CONFIRM = "确定", e))($e || {});
199
+ const Qt = { key: 1 }, Xt = {
180
200
  key: 0,
181
201
  class: "ez-dialog__body"
182
- }, Al = { key: 1 }, Tl = V({ name: "EzDialog", inheritAttrs: !1, directives: { loading: de.directive } }), xl = /* @__PURE__ */ V({
183
- ...Tl,
184
- props: /* @__PURE__ */ O({
202
+ }, Zt = { key: 1 }, Jt = x({ name: "EzDialog", inheritAttrs: !1, directives: { loading: Re.directive } }), _t = /* @__PURE__ */ x({
203
+ ...Jt,
204
+ props: /* @__PURE__ */ _({
185
205
  title: { default: "" },
186
206
  loading: { type: Boolean, default: !1 },
187
- cancelText: { default: le.CANCEL },
188
- confirmText: { default: le.CONFIRM }
207
+ cancelText: { default: $e.CANCEL },
208
+ confirmText: { default: $e.CONFIRM }
189
209
  }, {
190
- modelValue: { type: Boolean },
210
+ modelValue: { type: Boolean, default: !1 },
191
211
  modelModifiers: {}
192
212
  }),
193
- emits: /* @__PURE__ */ O(["cancel", "confirm"], ["update:modelValue"]),
194
- setup(e, { emit: d }) {
195
- const { t: l } = ae(), o = e, s = d, f = M(e, "modelValue"), { attrs: a } = Q(["title", "loading", "cancelText", "confirmText", "modelValue"]), c = () => {
196
- f.value = !1, s("cancel");
197
- }, u = () => {
198
- s("confirm");
213
+ emits: /* @__PURE__ */ _(["cancel", "confirm"], ["update:modelValue"]),
214
+ setup(e, { emit: s }) {
215
+ const { t } = ke(), a = e, i = s, o = ee(e, "modelValue"), { attrs: c } = Ee(["title", "loading", "cancelText", "confirmText", "modelValue"]), h = () => {
216
+ o.value = !1, i("cancel");
217
+ }, V = () => {
218
+ i("confirm");
199
219
  };
200
- return (r, i) => {
201
- const U = ke("loading");
202
- return n(), m(t(Ye), v({
203
- modelValue: f.value,
204
- "onUpdate:modelValue": i[0] || (i[0] = (G) => f.value = G),
220
+ return (y, E) => {
221
+ const D = Je("loading");
222
+ return r(), g(l(gt), S({
223
+ modelValue: o.value,
224
+ "onUpdate:modelValue": E[0] || (E[0] = (H) => o.value = H),
205
225
  class: "ez-dialog",
206
226
  width: 800,
207
227
  "append-to-body": !1,
208
228
  "close-on-click-modal": !1,
209
229
  "destroy-on-close": !0,
210
230
  "close-on-press-escape": !1
211
- }, t(a)), {
212
- header: b(() => [
213
- r.$slots.header ? A(r.$slots, "header", { key: 0 }) : (n(), E("p", Cl, Y(o.title), 1))
231
+ }, l(c)), {
232
+ header: k(() => [
233
+ y.$slots.header ? R(y.$slots, "header", { key: 0 }) : (r(), C("p", Qt, de(a.title), 1))
214
234
  ]),
215
- default: b(() => [
216
- r.$slots.default ? ze((n(), E("div", Sl, [
217
- A(r.$slots, "default")
235
+ default: k(() => [
236
+ y.$slots.default ? _e((r(), C("div", Xt, [
237
+ R(y.$slots, "default")
218
238
  ])), [
219
- [U, o.loading]
220
- ]) : S("", !0)
239
+ [D, a.loading]
240
+ ]) : O("", !0)
221
241
  ]),
222
- footer: b(() => [
223
- r.$slots.footer ? A(r.$slots, "footer", { key: 0 }) : (n(), E("div", Al, [
224
- o.cancelText ? (n(), m(t(J), {
242
+ footer: k(() => [
243
+ y.$slots.footer ? R(y.$slots, "footer", { key: 0 }) : (r(), C("div", Zt, [
244
+ a.cancelText ? (r(), g(l(be), {
225
245
  key: 0,
226
246
  type: "default",
227
- onClick: c
247
+ onClick: h
228
248
  }, {
229
- default: b(() => [
230
- Z(Y(o.cancelText === t(le).CANCEL ? t(l)("s.button.cancel") : o.cancelText), 1)
249
+ default: k(() => [
250
+ he(de(a.cancelText === l($e).CANCEL ? l(t)("s.button.cancel") : a.cancelText), 1)
231
251
  ]),
232
252
  _: 1
233
- })) : S("", !0),
234
- o.confirmText ? (n(), m(t(J), {
253
+ })) : O("", !0),
254
+ a.confirmText ? (r(), g(l(be), {
235
255
  key: 1,
236
256
  type: "primary",
237
- loading: o.loading,
238
- onClick: u
257
+ loading: a.loading,
258
+ onClick: V
239
259
  }, {
240
- default: b(() => [
241
- Z(Y(o.confirmText === t(le).CONFIRM ? t(l)("s.button.confirm") : o.confirmText), 1)
260
+ default: k(() => [
261
+ he(de(a.confirmText === l($e).CONFIRM ? l(t)("s.button.confirm") : a.confirmText), 1)
242
262
  ]),
243
263
  _: 1
244
- }, 8, ["loading"])) : S("", !0)
264
+ }, 8, ["loading"])) : O("", !0)
245
265
  ]))
246
266
  ]),
247
267
  _: 3
248
268
  }, 16, ["modelValue"]);
249
269
  };
250
270
  }
251
- }), Rl = N(xl), Ul = V({ name: "EzSelect", inheritAttrs: !1 }), Dl = /* @__PURE__ */ V({
252
- ...Ul,
253
- props: /* @__PURE__ */ O({
271
+ }), ea = te(_t), ta = x({ name: "EzSelect", inheritAttrs: !1 }), aa = /* @__PURE__ */ x({
272
+ ...ta,
273
+ props: /* @__PURE__ */ _({
254
274
  options: { default: () => [] }
255
275
  }, {
256
- modelValue: {},
276
+ modelValue: { type: [String, Number, Boolean, Object, Array] },
257
277
  modelModifiers: {}
258
278
  }),
259
279
  emits: ["update:modelValue"],
260
280
  setup(e) {
261
- const d = M(e, "modelValue"), { attrs: l } = Q(["options", "modelValue"]), o = (a) => typeof a > "u", s = (a) => !o(a.options), f = (a, c) => a.value != null && typeof a.value != "object" ? String(a.value) : c;
262
- return (a, c) => (n(), m(t(Xe), v({
263
- modelValue: d.value,
264
- "onUpdate:modelValue": c[0] || (c[0] = (u) => d.value = u),
265
- clearable: ""
266
- }, t(l)), {
267
- default: b(() => [
268
- (n(!0), E(I, null, j(e.options, (u, r) => (n(), E(I, {
269
- key: f(u, r)
281
+ const s = ee(e, "modelValue"), { attrs: t } = Ee(["options", "modelValue"]), a = (c) => typeof c > "u", i = (c) => !a(c.options), o = (c, h) => i(c) ? `group-${c.label}-${h}` : c.value != null && typeof c.value != "object" ? String(c.value) : `option-${h}`;
282
+ return (c, h) => (r(), g(l(yt), S({
283
+ modelValue: s.value,
284
+ "onUpdate:modelValue": h[0] || (h[0] = (V) => s.value = V)
285
+ }, l(t)), {
286
+ default: k(() => [
287
+ (r(!0), C(X, null, ie(e.options, (V, y) => (r(), C(X, {
288
+ key: o(V, y)
270
289
  }, [
271
- s(u) ? (n(), m(t(Ze), v({
290
+ i(V) ? (r(), g(l(bt), S({
272
291
  key: 0,
273
292
  ref_for: !0
274
- }, u), {
275
- default: b(() => [
276
- (n(!0), E(I, null, j(u.options, (i) => (n(), m(t(ve), v({
277
- key: f(i, i.value)
278
- }, { ref_for: !0 }, i), null, 16))), 128))
293
+ }, V), {
294
+ default: k(() => [
295
+ (r(!0), C(X, null, ie(V.options, (E, D) => (r(), g(l(Ne), S({
296
+ key: o(E, D)
297
+ }, { ref_for: !0 }, E), null, 16))), 128))
279
298
  ]),
280
299
  _: 2
281
- }, 1040)) : (n(), m(t(ve), v({
300
+ }, 1040)) : (r(), g(l(Ne), S({
282
301
  key: 1,
283
302
  ref_for: !0
284
- }, u), null, 16))
303
+ }, V), null, 16))
285
304
  ], 64))), 128))
286
305
  ]),
287
306
  _: 1
288
307
  }, 16, ["modelValue"]));
289
308
  }
290
- }), Te = N(Dl), Ml = V({ name: "EzRadio", inheritAttrs: !1 }), Pl = /* @__PURE__ */ V({
291
- ...Ml,
292
- props: /* @__PURE__ */ O({
309
+ }), at = te(aa), la = x({ name: "EzRadio", inheritAttrs: !1 }), oa = /* @__PURE__ */ x({
310
+ ...la,
311
+ props: /* @__PURE__ */ _({
293
312
  type: { default: "default" },
294
313
  options: { default: () => [] }
295
314
  }, {
@@ -298,20 +317,20 @@ const Cl = { key: 1 }, Sl = {
298
317
  }),
299
318
  emits: ["update:modelValue"],
300
319
  setup(e) {
301
- const d = e, l = M(e, "modelValue"), { attrs: o } = Q(["options", "type", "modelValue"]), s = C(() => ["default", "border"].includes(d.type) ? Je : Qe);
302
- return (f, a) => (n(), m(t(_e), v({
303
- modelValue: l.value,
304
- "onUpdate:modelValue": a[0] || (a[0] = (c) => l.value = c)
305
- }, t(o)), {
306
- default: b(() => [
307
- (n(!0), E(I, null, j(e.options, (c) => (n(), m(ie(s.value), v({
308
- key: String(c.value),
320
+ const s = e, t = ee(e, "modelValue"), { attrs: a } = Ee(["options", "type", "modelValue"]), i = U(() => ["default", "border"].includes(s.type) ? ht : Et);
321
+ return (o, c) => (r(), g(l(Vt), S({
322
+ modelValue: t.value,
323
+ "onUpdate:modelValue": c[0] || (c[0] = (h) => t.value = h)
324
+ }, l(a)), {
325
+ default: k(() => [
326
+ (r(!0), C(X, null, ie(e.options, (h) => (r(), g(De(i.value), S({
327
+ key: String(h.value),
309
328
  ref_for: !0
310
- }, c, {
329
+ }, h, {
311
330
  border: e.type === "border"
312
331
  }), {
313
- default: b(() => [
314
- Z(Y(c.label), 1)
332
+ default: k(() => [
333
+ he(de(h.label), 1)
315
334
  ]),
316
335
  _: 2
317
336
  }, 1040, ["border"]))), 128))
@@ -319,136 +338,139 @@ const Cl = { key: 1 }, Sl = {
319
338
  _: 1
320
339
  }, 16, ["modelValue"]));
321
340
  }
322
- }), xe = N(Pl), Bl = V({ name: "EzIcon", inheritAttrs: !1 }), Ll = /* @__PURE__ */ V({
323
- ...Bl,
341
+ }), lt = te(oa), na = x({ name: "EzIcon", inheritAttrs: !1 }), ra = /* @__PURE__ */ x({
342
+ ...na,
324
343
  props: {
325
344
  size: { default: 20 },
326
345
  color: { default: "inherit" }
327
346
  },
328
347
  setup(e) {
329
- const d = e, l = C(() => {
330
- const { size: o, color: s } = d;
331
- return !o && !s ? {} : {
332
- fontSize: o ? `${o}px` : void 0,
333
- color: s
348
+ const s = e, t = (i) => {
349
+ if (!(i == null || i === ""))
350
+ return typeof i == "number" ? `${i}px` : i;
351
+ }, a = U(() => {
352
+ const { size: i, color: o } = s;
353
+ return !i && !o ? {} : {
354
+ fontSize: t(i),
355
+ color: o
334
356
  };
335
357
  });
336
- return (o, s) => (n(), E("i", v({
358
+ return (i, o) => (r(), C("i", S({
337
359
  class: "ez-icon",
338
- style: l.value
339
- }, o.$attrs), [
340
- A(o.$slots, "default", { class: "w-[1em] h-[1em]" })
360
+ style: a.value
361
+ }, i.$attrs), [
362
+ R(i.$slots, "default", { class: "w-[1em] h-[1em]" })
341
363
  ], 16));
342
364
  }
343
- }), X = N(Ll), Il = {
365
+ }), me = te(ra), sa = {
344
366
  xmlns: "http://www.w3.org/2000/svg",
345
367
  width: "200",
346
368
  height: "200",
347
369
  viewBox: "0 0 1024 1024"
348
- }, Ol = /* @__PURE__ */ V({
370
+ }, ia = /* @__PURE__ */ x({
349
371
  name: "ArrowDown",
350
372
  __name: "ArrowDown",
351
373
  setup(e) {
352
- return (d, l) => (n(), E("svg", Il, [...l[0] || (l[0] = [
353
- P("path", {
374
+ return (s, t) => (r(), C("svg", sa, [...t[0] || (t[0] = [
375
+ Y("path", {
354
376
  fill: "currentColor",
355
377
  d: "m832 340.992-320 312-320-312a28.8 28.8 0 0 0-20.992-8.96 28.8 28.8 0 0 0-20.992 8.96 28.8 28.8 0 0 0-8.96 20.992c0 8 2.624 14.72 8 19.968l340.992 332.032c5.952 6.016 13.312 8.96 22.016 8.96 8.64 0 16-2.944 22.016-8.96l340.992-331.008a31.23 31.23 0 0 0 8-21.504c0-8.32-3.008-15.36-8.96-20.992a29.76 29.76 0 0 0-42.048.448v.064z"
356
378
  }, null, -1)
357
379
  ])]));
358
380
  }
359
- }), Nl = {
381
+ }), ua = {
360
382
  xmlns: "http://www.w3.org/2000/svg",
361
383
  width: "200",
362
384
  height: "200",
363
385
  viewBox: "0 0 1024 1024"
364
- }, ql = /* @__PURE__ */ V({
386
+ }, da = /* @__PURE__ */ x({
365
387
  name: "ArrowUp",
366
388
  __name: "ArrowUp",
367
389
  setup(e) {
368
- return (d, l) => (n(), E("svg", Nl, [...l[0] || (l[0] = [
369
- P("path", {
390
+ return (s, t) => (r(), C("svg", ua, [...t[0] || (t[0] = [
391
+ Y("path", {
370
392
  fill: "currentColor",
371
393
  d: "M488.96 344 148.992 700.992a32.26 32.26 0 0 0-8.96 22.016c0 8 2.944 15.36 8.96 22.016v1.024c6.016 5.952 13.184 8.96 21.504 8.96S185.984 752 192 746.048l320-336 320 336c6.016 5.952 13.184 8.96 21.504 8.96s15.488-3.008 21.504-8.96v-1.024a32.26 32.26 0 0 0 8.96-22.016 32.26 32.26 0 0 0-8.96-22.016L534.976 344A31.17 31.17 0 0 0 512 335.04a31.17 31.17 0 0 0-23.04 8.96"
372
394
  }, null, -1)
373
395
  ])]));
374
396
  }
375
- }), Fl = {
397
+ }), ca = {
376
398
  xmlns: "http://www.w3.org/2000/svg",
377
399
  width: "200",
378
400
  height: "200",
379
401
  viewBox: "0 0 1024 1024"
380
- }, he = /* @__PURE__ */ V({
402
+ }, We = /* @__PURE__ */ x({
381
403
  name: "Delete",
382
404
  __name: "delete",
383
405
  setup(e) {
384
- return (d, l) => (n(), E("svg", Fl, [...l[0] || (l[0] = [
385
- P("path", {
406
+ return (s, t) => (r(), C("svg", ca, [...t[0] || (t[0] = [
407
+ Y("path", {
386
408
  fill: "currentColor",
387
409
  d: "M218.88 118.592C208 139.968 208 168 208 245.376V272H96a32 32 0 1 0 0 64h832a32 32 0 0 0 0-64H816v-26.624c0-77.44 0-105.408-10.88-126.72a100.03 100.03 0 0 0-43.712-43.776C740.032 64 712 64 634.624 64H389.376c-77.44 0-105.408 0-126.72 10.88-18.88 9.6-34.176 24.96-43.776 43.712M752 272H272v-64c0-28.032 0-42.304 5.568-52.992a50.24 50.24 0 0 1 21.44-21.44C309.76 128.064 323.968 128 352 128h320c28.032 0 42.304 0 52.992 5.568 9.152 4.736 16.64 12.288 21.44 21.44C751.936 165.696 752 179.968 752 208zM192 416a32 32 0 0 0-32 32v358.4c0 53.76.128 81.28 10.688 101.76a96.54 96.54 0 0 0 41.216 41.152C232.384 959.872 259.84 960 313.6 960h396.8c53.76 0 81.28-.128 101.76-10.688a96.54 96.54 0 0 0 41.152-41.216C863.872 887.616 864 860.16 864 806.4V448a32 32 0 0 0-64 0v371.2c0 26.88 0 40.64-5.376 50.88a48.2 48.2 0 0 1-20.544 20.544c-10.24 5.312-24 5.376-50.88 5.376H300.8c-26.88 0-40.64 0-50.88-5.376a48.2 48.2 0 0 1-20.544-20.544c-5.312-10.24-5.376-24-5.376-50.88V448a32 32 0 0 0-32-32m216 0a32 32 0 0 0-32 32v320a32 32 0 0 0 64 0V448a32 32 0 0 0-32-32m208 0a32 32 0 0 0-32 32v320a32 32 0 0 0 64 0V448a32 32 0 0 0-32-32"
388
410
  }, null, -1)
389
411
  ])]));
390
412
  }
391
- }), Hl = {
413
+ }), fa = {
392
414
  xmlns: "http://www.w3.org/2000/svg",
393
415
  width: "200",
394
416
  height: "200",
395
417
  viewBox: "0 0 1024 1024"
396
- }, Ve = /* @__PURE__ */ V({
418
+ }, Ye = /* @__PURE__ */ x({
397
419
  name: "Plus",
398
420
  __name: "plus",
399
421
  setup(e) {
400
- return (d, l) => (n(), E("svg", Hl, [...l[0] || (l[0] = [
401
- P("path", {
422
+ return (s, t) => (r(), C("svg", fa, [...t[0] || (t[0] = [
423
+ Y("path", {
402
424
  fill: "currentColor",
403
425
  d: "M512 96a32 32 0 0 0-32 32v352H128a32 32 0 1 0 0 64h352v352a32 32 0 0 0 64 0V544h352a32 32 0 0 0 0-64H544V128a32 32 0 0 0-32-32"
404
426
  }, null, -1)
405
427
  ])]));
406
428
  }
407
- }), Gl = {
429
+ }), ma = {
408
430
  xmlns: "http://www.w3.org/2000/svg",
409
431
  width: "200",
410
432
  height: "200",
411
433
  viewBox: "0 0 1024 1024"
412
- }, Wl = /* @__PURE__ */ V({
434
+ }, pa = /* @__PURE__ */ x({
413
435
  name: "Setting",
414
436
  __name: "setting",
415
437
  setup(e) {
416
- return (d, l) => (n(), E("svg", Gl, [...l[0] || (l[0] = [
417
- P("path", {
438
+ return (s, t) => (r(), C("svg", ma, [...t[0] || (t[0] = [
439
+ Y("path", {
418
440
  fill: "currentColor",
419
441
  d: "M218.688 848q27.712 48 83.2 48h374.08q55.424 0 83.136-48l187.008-323.968q27.776-48 0-96L759.104 104.064q-27.712-48-83.2-48H301.952q-55.488 0-83.2 48L31.68 428.032q-27.712 48 0 96zm55.424-32L87.104 492.032q-9.216-16 0-32l187.008-323.968q9.28-16 27.776-16h374.08q18.432 0 27.712 16l187.008 323.968q9.28 16 0 32L703.68 816q-9.28 16-27.712 16h-374.08q-18.56 0-27.776-16m54.784-339.968a160 160 0 1 0 320 0 160 160 0 0 0-320 0m64 0a96 96 0 1 1 192 0 96 96 0 0 1-192 0"
420
442
  }, null, -1)
421
443
  ])]));
422
444
  }
423
- }), jl = {
445
+ }), va = {
424
446
  xmlns: "http://www.w3.org/2000/svg",
425
447
  width: "200",
426
448
  height: "200",
427
449
  viewBox: "0 0 1024 1024"
428
- }, Ee = /* @__PURE__ */ V({
450
+ }, Qe = /* @__PURE__ */ x({
429
451
  name: "ZoomIn",
430
452
  __name: "ZoomIn",
431
453
  setup(e) {
432
- return (d, l) => (n(), E("svg", jl, [...l[0] || (l[0] = [
433
- P("path", {
454
+ return (s, t) => (r(), C("svg", va, [...t[0] || (t[0] = [
455
+ Y("path", {
434
456
  fill: "currentColor",
435
457
  d: "M764.352 809.6a424 424 0 1 1 45.184-45.184l139.456 139.392a31.936 31.936 0 1 1-45.184 45.184L764.352 809.536zM848 488a360 360 0 1 0-720 0 360 360 0 0 0 720 0"
436
458
  }, null, -1),
437
- P("path", {
459
+ Y("path", {
438
460
  fill: "currentColor",
439
461
  d: "M294.4 486.4a32 32 0 0 0 32 32h128v128a32 32 0 0 0 64 0v-128h128a32 32 0 0 0 0-64h-128v-128a32 32 0 0 0-64 0v128h-128a32 32 0 0 0-32 32"
440
462
  }, null, -1)
441
463
  ])]));
442
464
  }
443
- }), Kl = { class: "ez-image-upload" }, Yl = {
465
+ }), ga = { class: "ez-image-upload" }, ya = {
444
466
  key: 0,
445
467
  class: "ez-image-upload__image"
446
- }, Xl = {
468
+ }, ba = {
447
469
  key: 1,
448
470
  class: "ez-image-upload__list"
449
- }, Zl = { class: "flex items-center justify-center h-full" }, Jl = V({ name: "EzImageUpload", inheritAttrs: !1 }), Ql = /* @__PURE__ */ V({
450
- ...Jl,
451
- props: /* @__PURE__ */ O({
471
+ }, ha = { class: "flex items-center justify-center h-full" }, Ea = x({ name: "EzImageUpload", inheritAttrs: !1 }), Va = /* @__PURE__ */ x({
472
+ ...Ea,
473
+ props: /* @__PURE__ */ _({
452
474
  api: { type: Function, default: () => Promise.resolve({ url: "" }) },
453
475
  imageTypes: { default: () => ["image/webp", "image/png", "image/jpg", "image/gif", "image/bmp", "image/jpeg"] },
454
476
  limitSize: { default: 10 },
@@ -461,9 +483,9 @@ const Cl = { key: 1 }, Sl = {
461
483
  modelValue: {},
462
484
  modelModifiers: {}
463
485
  }),
464
- emits: ["update:modelValue"],
465
- setup(e, { expose: d }) {
466
- const l = e, { attrs: o } = Q([
486
+ emits: /* @__PURE__ */ _(["update:modelValue", "success", "error", "delete"], ["update:modelValue"]),
487
+ setup(e, { expose: s, emit: t }) {
488
+ const a = e, { attrs: i } = Ee([
467
489
  "api",
468
490
  "imageTypes",
469
491
  "limitSize",
@@ -473,172 +495,185 @@ const Cl = { key: 1 }, Sl = {
473
495
  "limit",
474
496
  "disabled",
475
497
  "modelValue"
476
- ]), { t: s } = ae(), f = B(!1), a = B(0), c = M(e, "modelValue"), u = C(() => l.multiple), r = /^(https?:\/\/|data:|blob:)/i, i = C(() => c.value ? U(c.value) : []);
477
- function U(y) {
478
- if (!y) return [];
479
- const g = /^(https?:\/\/|data:|blob:)/i;
480
- let $ = [], D = "", L = !1;
481
- y = y.trim().replace(/,$/, "");
482
- const _ = y.split(",");
483
- for (let K = 0; K < _.length; K++) {
484
- const q = _[K].trim();
485
- q && (g.test(q) ? (L && D && $.push(D.trim()), D = q, L = !0) : L ? D += "," + q : g.test(q.trim()) && $.push(q.trim()));
498
+ ]), o = t, { t: c } = ke(), h = G(!1), V = G(0), y = ee(e, "modelValue"), E = U(() => a.multiple), D = U(() => a.imageTypes.join(",")), H = /^(https?:\/\/|data:|blob:)/i, f = U(() => y.value ? A(y.value) : []);
499
+ function A(P) {
500
+ if (!P) return [];
501
+ const $ = P.trim().replace(/^[,\s]+|[,\s]+$/g, "");
502
+ if (!$) return [];
503
+ const I = /(blob:https?:\/\/|https?:\/\/|data:)/gi, J = Array.from($.matchAll(I));
504
+ if (J.length === 0) return [];
505
+ const ae = [];
506
+ for (let le = 0; le < J.length; le++) {
507
+ const oe = J[le].index ?? -1;
508
+ if (oe < 0) continue;
509
+ const ne = J[le + 1]?.index, se = $.slice(oe, ne).trim().replace(/^[,\s]+|[,\s]+$/g, "");
510
+ se && H.test(se) && ae.push(se);
486
511
  }
487
- return L && D && $.push(D.trim()), $.filter((K) => K && g.test(K));
512
+ return ae;
488
513
  }
489
- function G(y) {
490
- return !y || y.length === 0 ? "" : y.filter((g) => g.trim()).map((g) => g.trim()).join(",");
514
+ function v(P) {
515
+ return !P || P.length === 0 ? "" : P.filter(($) => $.trim()).map(($) => $.trim()).join(",");
491
516
  }
492
- const F = (y) => l.disabled ? (ee.warning(s("s.message.disabled")), !1) : l.imageTypes.includes(y.type.toLocaleLowerCase()) ? y.size > l.limitSize * 1024 * 1024 ? (ee.error(s("s.validate.upload.limit", { max: l.limitSize })), !1) : !0 : (ee.error(s("s.validate.upload.image")), !1), W = async ({ file: y }) => {
493
- if (!l.disabled)
517
+ const d = (P) => a.disabled ? (ge.warning(c("s.message.disabled")), !1) : E.value && f.value.length >= a.limit ? (ge.warning(c("s.validate.upload.limit", { max: a.limit })), !1) : a.imageTypes.includes(P.type.toLocaleLowerCase()) ? P.size > a.limitSize * 1024 * 1024 ? (ge.error(c("s.validate.upload.limit", { max: a.limitSize })), !1) : !0 : (ge.error(c("s.validate.upload.image")), !1), m = async ({ file: P }) => {
518
+ if (!a.disabled)
494
519
  try {
495
- const { url: g } = await l.api(y);
496
- if (!g) throw new Error(s("s.message.uploadFail"));
497
- if (u.value) {
498
- const $ = c.value ? U(c.value) : [];
499
- g && r.test(g) && ($.push(g), c.value = G($));
520
+ const { url: $ } = await a.api(P);
521
+ if (!$) throw new Error(c("s.message.uploadFail"));
522
+ if (E.value) {
523
+ const I = y.value ? A(y.value) : [];
524
+ $ && H.test($) && (I.push($), y.value = v(I));
500
525
  } else
501
- c.value = g;
502
- } catch (g) {
503
- ee.error(g.message);
526
+ y.value = $;
527
+ o("success", P, $);
528
+ } catch ($) {
529
+ const I = $ instanceof Error ? $ : new Error(String($));
530
+ ge.error(I.message), o("error", P, I);
504
531
  }
505
- }, p = (y, g = 0) => {
506
- y && (a.value = g, f.value = !0);
507
- }, R = (y) => {
508
- if (!l.disabled && !(!y || !c.value))
509
- if (u.value) {
510
- const g = U(c.value), $ = g.findIndex((D) => D === y);
511
- $ !== -1 && (g.splice($, 1), c.value = g.join(","));
532
+ }, Z = (P, $ = 0) => {
533
+ P && (V.value = $, h.value = !0);
534
+ }, F = (P) => {
535
+ if (!a.disabled && !(!P || !y.value))
536
+ if (E.value) {
537
+ const $ = A(y.value), I = $.findIndex((J) => J === P);
538
+ I !== -1 && ($.splice(I, 1), y.value = v($), o("delete", P));
512
539
  } else
513
- c.value = null;
514
- }, z = B();
515
- return d({
516
- getUploadRef: () => z.value,
517
- getUrlList: () => i.value
518
- }), (y, g) => (n(), E("div", Kl, [
519
- u.value ? (n(), E("div", Xl, [
520
- (n(!0), E(I, null, j(i.value, ($, D) => (n(), E("div", {
521
- key: D,
540
+ y.value = "", o("delete", P);
541
+ }, q = G();
542
+ return s({
543
+ clearFiles: () => {
544
+ q.value?.clearFiles?.(), y.value = "";
545
+ },
546
+ submit: () => {
547
+ q.value?.submit?.();
548
+ },
549
+ getUploadRef: () => q.value,
550
+ getUrlList: () => f.value
551
+ }), (P, $) => (r(), C("div", ga, [
552
+ E.value ? (r(), C("div", ba, [
553
+ (r(!0), C(X, null, ie(f.value, (I, J) => (r(), C("div", {
554
+ key: J,
522
555
  class: "ez-image-upload__item",
523
- style: Ce(l.style)
556
+ style: we(a.style)
524
557
  }, [
525
- x(t(ge), {
526
- src: $,
527
- fit: l.fit
558
+ W(l(qe), {
559
+ src: I,
560
+ fit: a.fit
528
561
  }, null, 8, ["src", "fit"]),
529
- P("div", {
562
+ Y("div", {
530
563
  class: "ez-image-upload__handler",
531
- onClick: g[3] || (g[3] = fe(() => {
564
+ onClick: $[3] || ($[3] = Be(() => {
532
565
  }, ["stop"]))
533
566
  }, [
534
- x(t(X), {
567
+ W(l(me), {
535
568
  size: 18,
536
- onClick: (L) => p($, D)
569
+ onClick: (ae) => Z(I, J)
537
570
  }, {
538
- default: b(() => [
539
- x(t(Ee))
571
+ default: k(() => [
572
+ W(l(Qe))
540
573
  ]),
541
574
  _: 1
542
575
  }, 8, ["onClick"]),
543
- l.disabled ? S("", !0) : (n(), m(t(X), {
576
+ a.disabled ? O("", !0) : (r(), g(l(me), {
544
577
  key: 0,
545
578
  size: 18,
546
- onClick: (L) => R($)
579
+ onClick: (ae) => F(I)
547
580
  }, {
548
- default: b(() => [
549
- x(t(he))
581
+ default: k(() => [
582
+ W(l(We))
550
583
  ]),
551
584
  _: 1
552
585
  }, 8, ["onClick"]))
553
586
  ])
554
587
  ], 4))), 128)),
555
- i.value.length < l.limit && !l.disabled || i.value.length === 0 ? (n(), m(t(pe), v({ key: 0 }, t(o), {
588
+ (f.value.length < a.limit || f.value.length === 0) && !a.disabled ? (r(), g(l(Le), S({ key: 0 }, l(i), {
556
589
  ref_key: "uploadRef",
557
- ref: z,
590
+ ref: q,
558
591
  action: "",
559
- accept: "image/*",
592
+ accept: D.value,
593
+ multiple: a.multiple,
560
594
  "show-file-list": !1,
561
- "before-upload": F,
562
- "http-request": W,
563
- style: l.style,
564
- disabled: l.disabled,
565
- class: [{ "is-disabled": l.disabled }, "ez-image-upload__item ez-image-upload__button"]
595
+ "before-upload": d,
596
+ "http-request": m,
597
+ style: a.style,
598
+ disabled: a.disabled,
599
+ class: [{ "is-disabled": a.disabled }, "ez-image-upload__item ez-image-upload__button"]
566
600
  }), {
567
- default: b(() => [
568
- P("div", Zl, [
569
- x(t(X), null, {
570
- default: b(() => [
571
- x(t(Ve))
601
+ default: k(() => [
602
+ Y("div", ha, [
603
+ W(l(me), null, {
604
+ default: k(() => [
605
+ W(l(Ye))
572
606
  ]),
573
607
  _: 1
574
608
  })
575
609
  ])
576
610
  ]),
577
611
  _: 1
578
- }, 16, ["style", "disabled", "class"])) : S("", !0)
579
- ])) : (n(), m(t(pe), v({ key: 0 }, t(o), {
612
+ }, 16, ["accept", "multiple", "style", "disabled", "class"])) : O("", !0)
613
+ ])) : (r(), g(l(Le), S({ key: 0 }, l(i), {
580
614
  ref_key: "uploadRef",
581
- ref: z,
615
+ ref: q,
582
616
  action: "",
583
- accept: "image/*",
617
+ accept: D.value,
618
+ multiple: a.multiple,
584
619
  "show-file-list": !1,
585
- "before-upload": F,
586
- "http-request": W,
587
- style: l.style,
588
- disabled: l.disabled,
589
- class: ["ez-image-upload__wrapper", { "is-disabled": l.disabled }]
620
+ "before-upload": d,
621
+ "http-request": m,
622
+ style: a.style,
623
+ disabled: a.disabled,
624
+ class: ["ez-image-upload__wrapper", { "is-disabled": a.disabled }]
590
625
  }), {
591
- default: b(() => [
592
- c.value ? (n(), E("div", Yl, [
593
- x(t(ge), {
594
- src: c.value,
595
- fit: l.fit
626
+ default: k(() => [
627
+ y.value ? (r(), C("div", ya, [
628
+ W(l(qe), {
629
+ src: y.value,
630
+ fit: a.fit
596
631
  }, null, 8, ["src", "fit"]),
597
- P("div", {
632
+ Y("div", {
598
633
  class: "ez-image-upload__handler",
599
- onClick: g[2] || (g[2] = fe(() => {
634
+ onClick: $[2] || ($[2] = Be(() => {
600
635
  }, ["stop"]))
601
636
  }, [
602
- x(t(X), {
637
+ W(l(me), {
603
638
  size: 18,
604
- onClick: g[0] || (g[0] = ($) => p(c.value, 0))
639
+ onClick: $[0] || ($[0] = (I) => Z(y.value, 0))
605
640
  }, {
606
- default: b(() => [
607
- x(t(Ee))
641
+ default: k(() => [
642
+ W(l(Qe))
608
643
  ]),
609
644
  _: 1
610
645
  }),
611
- l.disabled ? S("", !0) : (n(), m(t(X), {
646
+ a.disabled ? O("", !0) : (r(), g(l(me), {
612
647
  key: 0,
613
648
  size: 18,
614
- onClick: g[1] || (g[1] = ($) => R(c.value))
649
+ onClick: $[1] || ($[1] = (I) => F(y.value))
615
650
  }, {
616
- default: b(() => [
617
- x(t(he))
651
+ default: k(() => [
652
+ W(l(We))
618
653
  ]),
619
654
  _: 1
620
655
  }))
621
656
  ])
622
- ])) : (n(), m(t(X), { key: 1 }, {
623
- default: b(() => [
624
- x(t(Ve))
657
+ ])) : (r(), g(l(me), { key: 1 }, {
658
+ default: k(() => [
659
+ W(l(Ye))
625
660
  ]),
626
661
  _: 1
627
662
  }))
628
663
  ]),
629
664
  _: 1
630
- }, 16, ["style", "disabled", "class"])),
631
- f.value ? (n(), m(t(el), {
665
+ }, 16, ["accept", "multiple", "style", "disabled", "class"])),
666
+ h.value ? (r(), g(l($t), {
632
667
  key: 2,
633
- "url-list": u.value ? i.value : [c.value],
634
- "initial-index": a.value,
635
- onClose: g[4] || (g[4] = ($) => f.value = !1)
636
- }, null, 8, ["url-list", "initial-index"])) : S("", !0)
668
+ "url-list": E.value ? f.value : [y.value],
669
+ "initial-index": V.value,
670
+ onClose: $[4] || ($[4] = (I) => h.value = !1)
671
+ }, null, 8, ["url-list", "initial-index"])) : O("", !0)
637
672
  ]));
638
673
  }
639
- }), Re = N(Ql);
640
- var k = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.TEXTAREA = "textarea", e.NUMBER = "number", e.PASSWORD = "password", e.SELECT = "select", e.RADIO = "radio", e.CHECKBOX = "checkbox", e.DATE = "date", e.DATETIME = "datetime", e.DATERANGE = "daterange", e.DATETIMERANGE = "datetimerange", e.TIME = "time", e.TIMERANGE = "timerange", e.UPLOAD_IMAGES = "upload-images", e.SWITCH = "switch", e.TREE_SELECT = "tree-select", e.CASCADER = "cascader", e.TREE = "tree", e.SLIDER = "slider", e.RATE = "rate", e))(k || {});
641
- const _l = /* @__PURE__ */ new Set([
674
+ }), ot = te(Va);
675
+ var B = /* @__PURE__ */ ((e) => (e.INPUT = "input", e.TEXTAREA = "textarea", e.NUMBER = "number", e.PASSWORD = "password", e.SELECT = "select", e.RADIO = "radio", e.CHECKBOX = "checkbox", e.DATE = "date", e.DATETIME = "datetime", e.DATERANGE = "daterange", e.DATETIMERANGE = "datetimerange", e.TIME = "time", e.TIMERANGE = "timerange", e.UPLOAD_IMAGES = "upload-images", e.SWITCH = "switch", e.TREE_SELECT = "tree-select", e.CASCADER = "cascader", e.SLIDER = "slider", e.RATE = "rate", e))(B || {});
676
+ const $a = /* @__PURE__ */ new Set([
642
677
  "select",
643
678
  "radio",
644
679
  "checkbox",
@@ -650,10 +685,9 @@ const _l = /* @__PURE__ */ new Set([
650
685
  "timerange",
651
686
  "switch",
652
687
  "cascader",
653
- "tree",
654
688
  "tree-select"
655
689
  /* TREE_SELECT */
656
- ]), et = /* @__PURE__ */ new Set([
690
+ ]), wa = /* @__PURE__ */ new Set([
657
691
  "select",
658
692
  "radio",
659
693
  "checkbox",
@@ -665,21 +699,20 @@ const _l = /* @__PURE__ */ new Set([
665
699
  "timerange",
666
700
  "switch",
667
701
  "cascader",
668
- "tree",
669
702
  "tree-select",
670
703
  "slider",
671
704
  "rate"
672
705
  /* RATE */
673
706
  ]);
674
- function lt(e) {
675
- return e && _l.has(e) ? "选择" : "输入";
707
+ function Sa(e) {
708
+ return e && $a.has(e) ? "选择" : "输入";
676
709
  }
677
- function tt(e) {
678
- return e && et.has(e) ? "change" : "blur";
710
+ function ka(e) {
711
+ return e && wa.has(e) ? "change" : "blur";
679
712
  }
680
- const at = V({ name: "EzFormItem" }), Ue = /* @__PURE__ */ V({
681
- ...at,
682
- props: /* @__PURE__ */ O({
713
+ const za = x({ name: "EzFormItem" }), nt = /* @__PURE__ */ x({
714
+ ...za,
715
+ props: /* @__PURE__ */ _({
683
716
  config: {},
684
717
  formData: { default: () => ({}) }
685
718
  }, {
@@ -688,188 +721,208 @@ const at = V({ name: "EzFormItem" }), Ue = /* @__PURE__ */ V({
688
721
  }),
689
722
  emits: ["update:modelValue"],
690
723
  setup(e) {
691
- const d = e, l = M(e, "modelValue"), o = C(() => d.config?.itemAttrs && typeof d.config.itemAttrs == "object" ? d.config.itemAttrs : {}), s = C(() => d.config?.attrs && typeof d.config.attrs == "object" ? d.config.attrs : {}), f = C(() => d.config?.options && Array.isArray(d.config.options) ? d.config.options : []), a = /* @__PURE__ */ new WeakMap(), c = () => {
692
- const { config: u } = d;
693
- if (!u || typeof u != "object") return;
694
- if (a.has(u))
695
- return a.get(u);
696
- let r;
697
- return u.rules ? r = u.rules : u.required && (r = [{ required: !0, message: u.requiredMessage || `请${lt(u.type)}${u.label || ""}`, trigger: tt(u.type) }]), r !== void 0 && a.set(u, r), r;
724
+ const s = e, t = ee(e, "modelValue"), a = U(() => s.config?.itemAttrs && typeof s.config.itemAttrs == "object" ? s.config.itemAttrs : {}), i = U(() => s.config?.attrs && typeof s.config.attrs == "object" ? s.config.attrs : {}), o = U(() => {
725
+ const v = i.value, {
726
+ disabled: d,
727
+ modelValue: m,
728
+ "onUpdate:modelValue": Z,
729
+ ...F
730
+ } = v;
731
+ return F;
732
+ }), c = U(() => {
733
+ const v = i.value, {
734
+ api: d,
735
+ disabled: m,
736
+ modelValue: Z,
737
+ "onUpdate:modelValue": F,
738
+ ...q
739
+ } = v;
740
+ return q;
741
+ }), h = U(() => {
742
+ if (s.config?.type === B.UPLOAD_IMAGES)
743
+ return typeof i.value.api == "function" ? i.value.api : (() => {
744
+ throw new Error('[EzFormItem] "upload-images" requires attrs.api to be a function: (file: File) => Promise<{ url: string }>.');
745
+ })();
746
+ }), V = U(() => s.config?.options && Array.isArray(s.config.options) ? s.config.options : []), y = () => V.value, E = () => V.value, D = () => V.value, H = () => V.value, f = () => V.value, A = () => {
747
+ const { config: v } = s;
748
+ if (!v || typeof v != "object") return;
749
+ let d;
750
+ return v.rules ? d = v.rules : v.required && (d = [{ required: !0, message: v.requiredMessage || `请${Sa(v.type)}${v.label || ""}`, trigger: ka(v.type) }]), d;
698
751
  };
699
- return (u, r) => e.config && e.config.prop ? (n(), m(t(ll), v({
752
+ return (v, d) => e.config && e.config.prop ? (r(), g(l(wt), S({
700
753
  key: 0,
701
754
  prop: e.config.prop,
702
755
  label: e.config.label,
703
- rules: c()
704
- }, o.value), te({
705
- default: b(() => [
706
- u.$slots.default ? A(u.$slots, "default", {
756
+ rules: A()
757
+ }, a.value), Se({
758
+ default: k(() => [
759
+ v.$slots.default ? R(v.$slots, "default", {
707
760
  key: 0,
708
761
  config: e.config,
709
- value: l.value,
762
+ value: t.value,
710
763
  formData: e.formData
711
- }) : e.config.component ? (n(), m(ie(e.config.component), v({
764
+ }) : e.config.component ? (r(), g(De(e.config.component), S({
712
765
  key: 1,
713
- modelValue: l.value,
714
- "onUpdate:modelValue": r[0] || (r[0] = (i) => l.value = i),
766
+ modelValue: t.value,
767
+ "onUpdate:modelValue": d[0] || (d[0] = (m) => t.value = m),
715
768
  disabled: e.config.disabled
716
- }, s.value), null, 16, ["modelValue", "disabled"])) : (n(), E(I, { key: 2 }, [
717
- e.config.type === t(k).INPUT || !e.config.type ? (n(), m(t(se), v({
769
+ }, o.value), null, 16, ["modelValue", "disabled"])) : (r(), C(X, { key: 2 }, [
770
+ e.config.type === l(B).INPUT || !e.config.type ? (r(), g(l(xe), S({
718
771
  key: 0,
719
- modelValue: l.value,
720
- "onUpdate:modelValue": r[1] || (r[1] = (i) => l.value = i),
772
+ modelValue: t.value,
773
+ "onUpdate:modelValue": d[1] || (d[1] = (m) => t.value = m),
721
774
  placeholder: e.config.placeholder || `请输入${e.config.label || ""}`,
722
775
  disabled: e.config.disabled,
723
776
  clearable: ""
724
- }, s.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(k).TEXTAREA ? (n(), m(t(se), v({
777
+ }, o.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === l(B).TEXTAREA ? (r(), g(l(xe), S({
725
778
  key: 1,
726
- modelValue: l.value,
727
- "onUpdate:modelValue": r[2] || (r[2] = (i) => l.value = i),
779
+ modelValue: t.value,
780
+ "onUpdate:modelValue": d[2] || (d[2] = (m) => t.value = m),
728
781
  type: "textarea",
729
782
  placeholder: e.config.placeholder || `请输入${e.config.label || ""}`,
730
783
  disabled: e.config.disabled
731
- }, s.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(k).NUMBER ? (n(), m(t(tl), v({
784
+ }, o.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === l(B).NUMBER ? (r(), g(l(St), S({
732
785
  key: 2,
733
- modelValue: l.value,
734
- "onUpdate:modelValue": r[3] || (r[3] = (i) => l.value = i),
786
+ modelValue: t.value,
787
+ "onUpdate:modelValue": d[3] || (d[3] = (m) => t.value = m),
735
788
  placeholder: e.config.placeholder,
736
789
  disabled: e.config.disabled
737
- }, s.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(k).PASSWORD ? (n(), m(t(se), v({
790
+ }, o.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === l(B).PASSWORD ? (r(), g(l(xe), S({
738
791
  key: 3,
739
- modelValue: l.value,
740
- "onUpdate:modelValue": r[4] || (r[4] = (i) => l.value = i),
792
+ modelValue: t.value,
793
+ "onUpdate:modelValue": d[4] || (d[4] = (m) => t.value = m),
741
794
  type: "password",
742
795
  placeholder: e.config.placeholder || `请输入${e.config.label || ""}`,
743
796
  disabled: e.config.disabled,
744
797
  "show-password": "",
745
798
  clearable: ""
746
- }, s.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(k).SELECT ? (n(), m(t(Te), v({
799
+ }, o.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === l(B).SELECT ? (r(), g(l(at), S({
747
800
  key: 4,
748
- modelValue: l.value,
749
- "onUpdate:modelValue": r[5] || (r[5] = (i) => l.value = i),
750
- options: f.value,
801
+ modelValue: t.value,
802
+ "onUpdate:modelValue": d[5] || (d[5] = (m) => t.value = m),
803
+ options: y(),
751
804
  placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
752
805
  disabled: e.config.disabled
753
- }, s.value), null, 16, ["modelValue", "options", "placeholder", "disabled"])) : e.config.type === t(k).RADIO ? (n(), m(t(xe), v({
806
+ }, o.value), null, 16, ["modelValue", "options", "placeholder", "disabled"])) : e.config.type === l(B).RADIO ? (r(), g(l(lt), S({
754
807
  key: 5,
755
- modelValue: l.value,
756
- "onUpdate:modelValue": r[6] || (r[6] = (i) => l.value = i),
757
- options: f.value,
808
+ modelValue: t.value,
809
+ "onUpdate:modelValue": d[6] || (d[6] = (m) => t.value = m),
810
+ options: E(),
758
811
  disabled: e.config.disabled
759
- }, s.value), null, 16, ["modelValue", "options", "disabled"])) : e.config.type === t(k).CHECKBOX ? (n(), m(t(Ae), v({
812
+ }, o.value), null, 16, ["modelValue", "options", "disabled"])) : e.config.type === l(B).CHECKBOX ? (r(), g(l(tt), S({
760
813
  key: 6,
761
- modelValue: l.value,
762
- "onUpdate:modelValue": r[7] || (r[7] = (i) => l.value = i),
763
- options: f.value,
814
+ modelValue: t.value,
815
+ "onUpdate:modelValue": d[7] || (d[7] = (m) => t.value = m),
816
+ options: D(),
764
817
  disabled: e.config.disabled
765
- }, s.value), null, 16, ["modelValue", "options", "disabled"])) : e.config.type === t(k).DATE ? (n(), m(t(ne), v({
818
+ }, o.value), null, 16, ["modelValue", "options", "disabled"])) : e.config.type === l(B).DATE ? (r(), g(l(Ce), S({
766
819
  key: 7,
767
- modelValue: l.value,
768
- "onUpdate:modelValue": r[8] || (r[8] = (i) => l.value = i),
820
+ modelValue: t.value,
821
+ "onUpdate:modelValue": d[8] || (d[8] = (m) => t.value = m),
769
822
  type: "date",
770
823
  placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
771
824
  disabled: e.config.disabled
772
- }, s.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(k).DATETIME ? (n(), m(t(ne), v({
825
+ }, o.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === l(B).DATETIME ? (r(), g(l(Ce), S({
773
826
  key: 8,
774
- modelValue: l.value,
775
- "onUpdate:modelValue": r[9] || (r[9] = (i) => l.value = i),
827
+ modelValue: t.value,
828
+ "onUpdate:modelValue": d[9] || (d[9] = (m) => t.value = m),
776
829
  type: "datetime",
777
830
  placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
778
831
  disabled: e.config.disabled
779
- }, s.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(k).DATERANGE ? (n(), m(t(ne), v({
832
+ }, o.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === l(B).DATERANGE ? (r(), g(l(Ce), S({
780
833
  key: 9,
781
- modelValue: l.value,
782
- "onUpdate:modelValue": r[10] || (r[10] = (i) => l.value = i),
834
+ modelValue: t.value,
835
+ "onUpdate:modelValue": d[10] || (d[10] = (m) => t.value = m),
783
836
  type: "daterange",
784
837
  "range-separator": "至",
785
838
  "start-placeholder": "开始日期",
786
839
  "end-placeholder": "结束日期",
787
840
  disabled: e.config.disabled
788
- }, s.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(k).DATETIMERANGE ? (n(), m(t(ne), v({
841
+ }, o.value), null, 16, ["modelValue", "disabled"])) : e.config.type === l(B).DATETIMERANGE ? (r(), g(l(Ce), S({
789
842
  key: 10,
790
- modelValue: l.value,
791
- "onUpdate:modelValue": r[11] || (r[11] = (i) => l.value = i),
843
+ modelValue: t.value,
844
+ "onUpdate:modelValue": d[11] || (d[11] = (m) => t.value = m),
792
845
  type: "datetimerange",
793
846
  "range-separator": "至",
794
847
  "start-placeholder": "开始时间",
795
848
  "end-placeholder": "结束时间",
796
849
  disabled: e.config.disabled
797
- }, s.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(k).TIME ? (n(), m(t(be), v({
850
+ }, o.value), null, 16, ["modelValue", "disabled"])) : e.config.type === l(B).TIME ? (r(), g(l(He), S({
798
851
  key: 11,
799
- modelValue: l.value,
800
- "onUpdate:modelValue": r[12] || (r[12] = (i) => l.value = i),
852
+ modelValue: t.value,
853
+ "onUpdate:modelValue": d[12] || (d[12] = (m) => t.value = m),
801
854
  placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
802
855
  disabled: e.config.disabled
803
- }, s.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(k).TIMERANGE ? (n(), m(t(be), v({
856
+ }, o.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === l(B).TIMERANGE ? (r(), g(l(He), S({
804
857
  key: 12,
805
- modelValue: l.value,
806
- "onUpdate:modelValue": r[13] || (r[13] = (i) => l.value = i),
858
+ modelValue: t.value,
859
+ "onUpdate:modelValue": d[13] || (d[13] = (m) => t.value = m),
807
860
  "is-range": "",
808
861
  "range-separator": "至",
809
862
  "start-placeholder": "开始时间",
810
863
  "end-placeholder": "结束时间",
811
864
  disabled: e.config.disabled
812
- }, s.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(k).SWITCH ? (n(), m(t(al), v({
865
+ }, o.value), null, 16, ["modelValue", "disabled"])) : e.config.type === l(B).SWITCH ? (r(), g(l(kt), S({
813
866
  key: 13,
814
- modelValue: l.value,
815
- "onUpdate:modelValue": r[14] || (r[14] = (i) => l.value = i),
867
+ modelValue: t.value,
868
+ "onUpdate:modelValue": d[14] || (d[14] = (m) => t.value = m),
816
869
  disabled: e.config.disabled
817
- }, s.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(k).TREE_SELECT ? (n(), m(t(ol), v({
870
+ }, o.value), null, 16, ["modelValue", "disabled"])) : e.config.type === l(B).TREE_SELECT ? (r(), g(l(zt), S({
818
871
  key: 14,
819
- modelValue: l.value,
820
- "onUpdate:modelValue": r[15] || (r[15] = (i) => l.value = i),
821
- data: f.value,
872
+ modelValue: t.value,
873
+ "onUpdate:modelValue": d[15] || (d[15] = (m) => t.value = m),
874
+ data: H(),
822
875
  placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
823
876
  disabled: e.config.disabled
824
- }, s.value), null, 16, ["modelValue", "data", "placeholder", "disabled"])) : e.config.type === t(k).CASCADER ? (n(), m(t(nl), v({
877
+ }, o.value), null, 16, ["modelValue", "data", "placeholder", "disabled"])) : e.config.type === l(B).CASCADER ? (r(), g(l(Ct), S({
825
878
  key: 15,
826
- modelValue: l.value,
827
- "onUpdate:modelValue": r[16] || (r[16] = (i) => l.value = i),
828
- options: f.value,
879
+ modelValue: t.value,
880
+ "onUpdate:modelValue": d[16] || (d[16] = (m) => t.value = m),
881
+ options: f(),
829
882
  placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
830
883
  disabled: e.config.disabled,
831
884
  clearable: ""
832
- }, s.value), null, 16, ["modelValue", "options", "placeholder", "disabled"])) : e.config.type === t(k).TREE ? (n(), m(t(sl), v({
885
+ }, o.value), null, 16, ["modelValue", "options", "placeholder", "disabled"])) : e.config.type === l(B).SLIDER ? (r(), g(l(At), S({
833
886
  key: 16,
834
- modelValue: l.value,
835
- "onUpdate:modelValue": r[17] || (r[17] = (i) => l.value = i),
836
- data: f.value,
837
- "show-checkbox": "",
838
- "node-key": "id"
839
- }, s.value), null, 16, ["modelValue", "data"])) : e.config.type === t(k).SLIDER ? (n(), m(t(rl), v({
887
+ modelValue: t.value,
888
+ "onUpdate:modelValue": d[17] || (d[17] = (m) => t.value = m),
889
+ disabled: e.config.disabled
890
+ }, o.value), null, 16, ["modelValue", "disabled"])) : e.config.type === l(B).RATE ? (r(), g(l(Dt), S({
840
891
  key: 17,
841
- modelValue: l.value,
842
- "onUpdate:modelValue": r[18] || (r[18] = (i) => l.value = i),
892
+ modelValue: t.value,
893
+ "onUpdate:modelValue": d[18] || (d[18] = (m) => t.value = m),
843
894
  disabled: e.config.disabled
844
- }, s.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(k).RATE ? (n(), m(t(il), v({
895
+ }, o.value), null, 16, ["modelValue", "disabled"])) : e.config.type === l(B).UPLOAD_IMAGES ? (r(), g(l(ot), S({
845
896
  key: 18,
846
- modelValue: l.value,
847
- "onUpdate:modelValue": r[19] || (r[19] = (i) => l.value = i),
897
+ modelValue: t.value,
898
+ "onUpdate:modelValue": d[19] || (d[19] = (m) => t.value = m),
899
+ api: h.value,
848
900
  disabled: e.config.disabled
849
- }, s.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(k).UPLOAD_IMAGES && s.value.api ? (n(), m(t(Re), v({
850
- key: 19,
851
- modelValue: l.value,
852
- "onUpdate:modelValue": r[20] || (r[20] = (i) => l.value = i),
853
- api: s.value.api,
854
- disabled: e.config.disabled
855
- }, s.value), null, 16, ["modelValue", "api", "disabled"])) : S("", !0)
901
+ }, c.value), null, 16, ["modelValue", "api", "disabled"])) : O("", !0)
856
902
  ], 64))
857
903
  ]),
858
904
  _: 2
859
905
  }, [
860
- u.$slots.label ? {
906
+ v.$slots.label ? {
861
907
  name: "label",
862
- fn: b(() => [
863
- A(u.$slots, "label", { config: e.config })
908
+ fn: k(() => [
909
+ R(v.$slots, "label", { config: e.config })
864
910
  ]),
865
911
  key: "0"
866
912
  } : void 0
867
- ]), 1040, ["prop", "label", "rules"])) : S("", !0);
913
+ ]), 1040, ["prop", "label", "rules"])) : O("", !0);
868
914
  }
869
- }), ot = V({ name: "EzDynamicForm", inheritAttrs: !1 }), nt = /* @__PURE__ */ V({
870
- ...ot,
871
- props: /* @__PURE__ */ O({
915
+ }), Ca = {
916
+ key: 0,
917
+ class: "ez-dynamic-form-group__title"
918
+ }, Aa = {
919
+ key: 1,
920
+ class: "ez-dynamic-form-group__description"
921
+ }, Da = x({ name: "EzDynamicForm", inheritAttrs: !1 }), xa = /* @__PURE__ */ x({
922
+ ...Da,
923
+ props: /* @__PURE__ */ _({
872
924
  items: { default: () => [] },
925
+ groups: { default: () => [] },
873
926
  modelValue: {},
874
927
  cols: { default: 1 },
875
928
  gutter: { default: 20 },
@@ -891,292 +944,494 @@ const at = V({ name: "EzFormItem" }), Ue = /* @__PURE__ */ V({
891
944
  modelModifiers: {}
892
945
  }),
893
946
  emits: ["update:modelValue"],
894
- setup(e, { expose: d }) {
895
- const l = e, o = M(e, "modelValue"), s = Oe(), f = () => {
896
- o.value && l.items.forEach((p) => {
897
- p.prop in o.value || (o.value[p.prop] = p.defaultValue !== void 0 ? p.defaultValue : void 0);
947
+ setup(e, { expose: s }) {
948
+ const t = e, a = ct(), i = ee(e, "modelValue"), o = Ue(), c = Ue({}), h = (u) => Object.prototype.toString.call(u) === "[object Object]", V = (u) => {
949
+ const b = /* @__PURE__ */ new WeakMap(), n = (w) => {
950
+ if (w instanceof Date)
951
+ return new Date(w.getTime());
952
+ if (Array.isArray(w)) {
953
+ const T = w;
954
+ if (b.has(T))
955
+ return b.get(T);
956
+ const Q = [];
957
+ return b.set(T, Q), T.forEach((ce, fe) => {
958
+ Q[fe] = n(ce);
959
+ }), Q;
960
+ }
961
+ if (h(w)) {
962
+ const T = w;
963
+ if (b.has(T))
964
+ return b.get(T);
965
+ const Q = {};
966
+ return b.set(T, Q), Object.entries(T).forEach(([ce, fe]) => {
967
+ Q[ce] = n(fe);
968
+ }), Q;
969
+ }
970
+ return w;
971
+ };
972
+ return n(u);
973
+ }, y = (u) => h(u) && ("value" in u || "fields" in u || "omit" in u), E = () => {
974
+ h(i.value) || (i.value = {});
975
+ }, D = () => {
976
+ E(), i.value && A.value.forEach((u) => {
977
+ u.prop in i.value || (i.value[u.prop] = u.defaultValue !== void 0 ? u.defaultValue : void 0);
898
978
  });
899
- };
900
- Ne(() => l.items, f, { deep: !0, immediate: !0 }), ue(f);
901
- const a = C(() => Math.floor(24 / l.cols)), c = C(() => l.items?.length ? l.items.filter((p) => {
902
- if (p.hidden) return !1;
903
- if (p.show)
979
+ }, H = U(() => {
980
+ const { items: u, groups: b, cols: n, gutter: w, modelValue: T, ...Q } = t;
981
+ return Q;
982
+ }), f = U(() => Math.floor(24 / t.cols)), A = U(() => t.groups?.length ? t.groups.flatMap((u) => u.items || []) : t.items || []), v = U(() => Array.isArray(t.groups) && t.groups.length > 0), d = () => {
983
+ const u = (t.items?.length || 0) > 0, b = (t.groups?.length || 0) > 0;
984
+ if (u && b)
985
+ throw new Error('[EzDynamicForm] "items" and "groups" cannot be used at the same time. Choose exactly one configuration mode.');
986
+ }, m = (u) => {
987
+ const b = {};
988
+ return A.value.forEach((n) => {
989
+ Object.prototype.hasOwnProperty.call(u, n.prop) && (b[n.prop] = V(u[n.prop]));
990
+ }), b;
991
+ }, Z = (u, b, n) => {
992
+ console.error(`[EzDynamicForm] ${u} error for field "${b.prop}":`, n);
993
+ }, F = (u, b) => ({
994
+ item: V(u),
995
+ formData: V(b)
996
+ }), q = (u) => {
997
+ const b = V(u);
998
+ return A.value.forEach((n) => {
999
+ if (n.deserialize)
1000
+ try {
1001
+ const w = F(n, b);
1002
+ b[n.prop] = n.deserialize(b[n.prop], w.formData, w.item);
1003
+ } catch (w) {
1004
+ Z("deserialize", n, w);
1005
+ }
1006
+ }), b;
1007
+ }, N = (u) => {
1008
+ const b = V(u);
1009
+ return A.value.forEach((n) => {
1010
+ if (!n.serialize) return;
1011
+ let w;
904
1012
  try {
905
- return p.show(o.value);
906
- } catch (R) {
907
- return console.error(`[EzDynamicForm] Visibility error for "${p.prop}":`, R), !1;
1013
+ const T = F(n, b);
1014
+ w = n.serialize(b[n.prop], T.formData, T.item);
1015
+ } catch (T) {
1016
+ Z("serialize", n, T);
1017
+ return;
908
1018
  }
909
- return !0;
910
- }) : []), u = (p) => p.span !== void 0 ? Math.max(1, Math.min(24, p.span)) : a.value, r = (p) => {
911
- let R = p.disabled || l.disabled;
912
- if (!R && p.disabledWhen)
913
- try {
914
- R = p.disabledWhen(o.value);
915
- } catch (z) {
916
- console.error(`[EzDynamicForm] Disabled check error for "${p.prop}":`, z);
1019
+ if (w !== void 0) {
1020
+ if (y(w)) {
1021
+ Object.prototype.hasOwnProperty.call(w, "value") && (b[n.prop] = V(w.value)), w.fields && h(w.fields) && Object.assign(b, V(w.fields)), w.omit && delete b[n.prop];
1022
+ return;
1023
+ }
1024
+ b[n.prop] = V(w);
917
1025
  }
918
- return { ...p, disabled: R };
1026
+ }), b;
919
1027
  };
920
- return d({
921
- validate: async () => {
922
- if (!s.value)
923
- return console.warn("[EzDynamicForm] Form ref is not available"), !1;
924
- try {
925
- return await s.value.validate(), !0;
926
- } catch {
927
- return !1;
928
- }
929
- },
930
- validateField: async (p) => {
931
- if (!s.value)
932
- return console.warn("[EzDynamicForm] Form ref is not available"), !1;
1028
+ ye(() => [t.items, t.groups], d, { deep: !0, immediate: !0 }), ye(() => [t.items, t.groups], D, { deep: !0, immediate: !0 }), ye(i, D, { immediate: !0 }), Me(() => {
1029
+ D(), pe();
1030
+ });
1031
+ const re = (u, b, n) => {
1032
+ if (!u) return !0;
1033
+ try {
1034
+ return u(i.value);
1035
+ } catch (w) {
1036
+ return console.error(`[EzDynamicForm] ${b} visibility error for "${n}":`, w), !1;
1037
+ }
1038
+ }, P = U(() => {
1039
+ const u = v.value ? t.groups : [{ items: t.items || [], cols: t.cols, gutter: t.gutter }], b = [];
1040
+ return u.forEach((n, w) => {
1041
+ if (!n || n.hidden) return;
1042
+ const T = n.name || `group-${w}`;
1043
+ if (!re(n.show, "group", T)) return;
1044
+ const Q = (n.items || []).filter((L) => L.hidden ? !1 : re(L.show, "item", L.prop)), ce = Math.max(1, n.cols || t.cols), fe = n.gutter ?? t.gutter, p = n.headerSlot || (n.name ? `group-header-${n.name}` : void 0), z = n.slot || (n.name ? `group-${n.name}` : void 0);
1045
+ b.push({
1046
+ key: `${T}-${w}`,
1047
+ index: w,
1048
+ group: n,
1049
+ items: Q,
1050
+ cols: ce,
1051
+ gutter: fe,
1052
+ headerSlotName: p,
1053
+ bodySlotName: z
1054
+ });
1055
+ }), b;
1056
+ }), $ = (u, b) => {
1057
+ if (u.span !== void 0)
1058
+ return Math.max(1, Math.min(24, u.span));
1059
+ const n = Math.max(1, b);
1060
+ return Math.max(1, Math.floor(24 / n)) || f.value;
1061
+ }, I = (u) => v.value ? u.group.title || u.group.description || u.headerSlotName && a[u.headerSlotName] ? !0 : !!a["group-header"] : !1, J = (u) => {
1062
+ let b = u.disabled || t.disabled;
1063
+ if (!b && u.disabledWhen)
933
1064
  try {
934
- return await s.value.validateField(p), !0;
935
- } catch {
936
- return !1;
1065
+ b = u.disabledWhen(i.value);
1066
+ } catch (n) {
1067
+ console.error(`[EzDynamicForm] Disabled check error for "${u.prop}":`, n);
937
1068
  }
1069
+ return { ...u, disabled: b };
1070
+ }, ae = async () => {
1071
+ if (!o.value)
1072
+ return console.warn("[EzDynamicForm] Form ref is not available"), !1;
1073
+ try {
1074
+ return await o.value.validate(), !0;
1075
+ } catch {
1076
+ return !1;
1077
+ }
1078
+ }, le = async (u) => {
1079
+ if (!o.value)
1080
+ return console.warn("[EzDynamicForm] Form ref is not available"), !1;
1081
+ try {
1082
+ return await o.value.validateField(u), !0;
1083
+ } catch {
1084
+ return !1;
1085
+ }
1086
+ }, oe = (u) => {
1087
+ if (!o.value) {
1088
+ console.warn("[EzDynamicForm] Form ref is not available");
1089
+ return;
1090
+ }
1091
+ o.value.clearValidate(u);
1092
+ }, ne = () => V(i.value), se = () => N(ne()), pe = () => {
1093
+ c.value = ne();
1094
+ }, Ve = (u, b = !0) => {
1095
+ if (!u) return;
1096
+ E();
1097
+ const n = V(u);
1098
+ b ? Object.assign(i.value, n) : i.value = n, D(), Pe(() => {
1099
+ o.value?.clearValidate();
1100
+ });
1101
+ };
1102
+ return s({
1103
+ validate: ae,
1104
+ validateField: le,
1105
+ clearValidate: oe,
1106
+ getFormData: ne,
1107
+ getSubmitData: se,
1108
+ setFormData: Ve,
1109
+ setSubmitData: (u, b = !0) => {
1110
+ u && Ve(m(q(u)), b);
938
1111
  },
939
- clearValidate: (p) => {
940
- if (!s.value) {
941
- console.warn("[EzDynamicForm] Form ref is not available");
942
- return;
943
- }
944
- s.value.clearValidate(p);
945
- },
946
- getFormData: () => ({ ...o.value }),
947
- setFormData: (p, R = !0) => {
948
- p && (R ? Object.assign(o.value, p) : o.value = { ...p });
1112
+ resetForm: () => {
1113
+ i.value = V(c.value), D(), Pe(() => {
1114
+ o.value?.clearValidate();
1115
+ });
949
1116
  },
950
- formRef: s
951
- }), (p, R) => (n(), m(t(ul), v({
1117
+ captureInitialData: pe,
1118
+ formRef: o
1119
+ }), (u, b) => (r(), g(l(xt), S({
952
1120
  ref_key: "formRef",
953
- ref: s,
1121
+ ref: o,
954
1122
  class: "ez-dynamic-form",
955
- "label-width": "auto"
956
- }, p.$attrs, { model: o.value }), {
957
- default: b(() => [
958
- x(t(dl), {
959
- gutter: l.gutter
1123
+ "label-width": t.labelWidth ?? "auto"
1124
+ }, H.value, { model: i.value }), {
1125
+ default: k(() => [
1126
+ (r(!0), C(X, null, ie(P.value, (n) => (r(), g(De(v.value ? "section" : "div"), {
1127
+ key: n.key,
1128
+ class: Ae(v.value ? ["ez-dynamic-form-group", n.group.className] : void 0),
1129
+ style: we(v.value ? n.group.style : void 0)
960
1130
  }, {
961
- default: b(() => [
962
- (n(!0), E(I, null, j(c.value, (z) => (n(), m(t(cl), {
963
- key: z.prop,
964
- span: u(z)
1131
+ default: k(() => [
1132
+ I(n) ? (r(), C("div", {
1133
+ key: 0,
1134
+ class: Ae(["ez-dynamic-form-group__header", n.group.headerClassName]),
1135
+ style: we(n.group.headerStyle)
1136
+ }, [
1137
+ n.headerSlotName && u.$slots[n.headerSlotName] ? R(u.$slots, n.headerSlotName, {
1138
+ key: 0,
1139
+ group: n.group,
1140
+ index: n.index,
1141
+ items: n.items,
1142
+ formData: i.value
1143
+ }) : u.$slots["group-header"] ? R(u.$slots, "group-header", {
1144
+ key: 1,
1145
+ group: n.group,
1146
+ index: n.index,
1147
+ items: n.items,
1148
+ formData: i.value
1149
+ }) : (r(), C(X, { key: 2 }, [
1150
+ n.group.title ? (r(), C("div", Ca, de(n.group.title), 1)) : O("", !0),
1151
+ n.group.description ? (r(), C("div", Aa, de(n.group.description), 1)) : O("", !0)
1152
+ ], 64))
1153
+ ], 6)) : O("", !0),
1154
+ v.value && n.bodySlotName && u.$slots[n.bodySlotName] ? R(u.$slots, n.bodySlotName, {
1155
+ key: 1,
1156
+ group: n.group,
1157
+ index: n.index,
1158
+ items: n.items,
1159
+ formData: i.value
1160
+ }) : v.value && u.$slots.group ? R(u.$slots, "group", {
1161
+ key: 2,
1162
+ group: n.group,
1163
+ index: n.index,
1164
+ items: n.items,
1165
+ formData: i.value
1166
+ }) : (r(), g(l(Ut), {
1167
+ key: 3,
1168
+ gutter: n.gutter,
1169
+ class: Ae(v.value ? ["ez-dynamic-form-group__body", n.group.bodyClassName] : void 0),
1170
+ style: we(v.value ? n.group.bodyStyle : void 0)
965
1171
  }, {
966
- default: b(() => [
967
- x(Ue, {
968
- modelValue: o.value[z.prop],
969
- "onUpdate:modelValue": (y) => o.value[z.prop] = y,
970
- config: r(z),
971
- formData: o.value
972
- }, te({ _: 2 }, [
973
- p.$slots[`label-${z.prop}`] ? {
974
- name: "label",
975
- fn: b(() => [
976
- A(p.$slots, `label-${z.prop}`, { item: z })
977
- ]),
978
- key: "0"
979
- } : void 0,
980
- p.$slots[z.prop] ? {
981
- name: "default",
982
- fn: b(({ config: y, value: g }) => [
983
- A(p.$slots, z.prop, {
984
- item: y,
985
- value: g,
986
- formData: o.value
987
- })
988
- ]),
989
- key: "1"
990
- } : void 0
991
- ]), 1032, ["modelValue", "onUpdate:modelValue", "config", "formData"])
1172
+ default: k(() => [
1173
+ (r(!0), C(X, null, ie(n.items, (w) => (r(), g(l(Pt), {
1174
+ key: `${n.key}-${w.prop}`,
1175
+ span: $(w, n.cols)
1176
+ }, {
1177
+ default: k(() => [
1178
+ W(nt, {
1179
+ modelValue: i.value[w.prop],
1180
+ "onUpdate:modelValue": (T) => i.value[w.prop] = T,
1181
+ config: J(w),
1182
+ formData: i.value
1183
+ }, Se({ _: 2 }, [
1184
+ u.$slots[`label-${w.prop}`] ? {
1185
+ name: "label",
1186
+ fn: k(() => [
1187
+ R(u.$slots, `label-${w.prop}`, { item: w })
1188
+ ]),
1189
+ key: "0"
1190
+ } : void 0,
1191
+ u.$slots[w.prop] ? {
1192
+ name: "default",
1193
+ fn: k(({ config: T, value: Q }) => [
1194
+ R(u.$slots, w.prop, {
1195
+ item: T,
1196
+ value: Q,
1197
+ formData: i.value
1198
+ })
1199
+ ]),
1200
+ key: "1"
1201
+ } : void 0
1202
+ ]), 1032, ["modelValue", "onUpdate:modelValue", "config", "formData"])
1203
+ ]),
1204
+ _: 2
1205
+ }, 1032, ["span"]))), 128))
992
1206
  ]),
993
1207
  _: 2
994
- }, 1032, ["span"]))), 128))
1208
+ }, 1032, ["gutter", "class", "style"]))
995
1209
  ]),
996
- _: 3
997
- }, 8, ["gutter"])
1210
+ _: 2
1211
+ }, 1032, ["class", "style"]))), 128))
998
1212
  ]),
999
1213
  _: 3
1000
- }, 16, ["model"]));
1214
+ }, 16, ["label-width", "model"]));
1001
1215
  }
1002
- }), st = N(nt), rt = N(Ue), it = V({ name: "EzTable" }), ut = /* @__PURE__ */ V({
1003
- ...it,
1216
+ }), Ua = te(xa), Pa = te(nt), Ta = x({ name: "EzTable", inheritAttrs: !1 }), rt = /* @__PURE__ */ x({
1217
+ ...Ta,
1004
1218
  props: {
1005
1219
  data: { default: () => [] },
1006
1220
  columns: { default: () => [] },
1007
- rowKey: {}
1221
+ border: { type: Boolean, default: !0 },
1222
+ rowKey: { type: [String, Function], default: "id" }
1008
1223
  },
1009
- setup(e, { expose: d }) {
1010
- const l = e, o = B(), s = (a) => {
1011
- const c = l.columns[l.columns.length - 1], u = () => a.type ? !1 : a.prop !== c.prop;
1012
- return { ...{
1013
- align: "center",
1014
- hidden: 1,
1015
- resizable: !0,
1016
- reserveSelection: a.type === "selection",
1017
- /** 默认最后一个 */
1018
- showOverflowTooltip: u()
1019
- }, ...a };
1224
+ setup(e, { expose: s }) {
1225
+ const t = e, a = G(), i = /* @__PURE__ */ new Set(["hidden", "emptyValue", "sortMode", "sortField"]), o = (f) => f === !0, c = (f) => f == null || f === "", h = () => t.columns.filter((f) => ["selection", "index", "expand"].includes(f.type || "") ? !1 : !o(f.hidden)), V = U(() => {
1226
+ const f = h(), A = f[f.length - 1];
1227
+ return A?.columnKey || A?.prop || null;
1228
+ }), y = (f) => f.type ? !1 : (f.columnKey || f.prop) !== V.value, E = (f) => {
1229
+ const A = f.formatter, v = f.emptyValue !== void 0;
1230
+ if (!(!A && !v))
1231
+ return (d, m, Z, F) => {
1232
+ const q = A ? A(d, m, Z, F) : Z;
1233
+ return v && c(q) ? f.emptyValue : q;
1234
+ };
1235
+ }, D = (f) => {
1236
+ const v = {
1237
+ ...{
1238
+ align: "center",
1239
+ resizable: !0,
1240
+ reserveSelection: f.type === "selection",
1241
+ showOverflowTooltip: y(f)
1242
+ },
1243
+ ...f,
1244
+ formatter: E(f)
1245
+ }, d = Object.fromEntries(
1246
+ Object.entries(v).filter(([m]) => !i.has(m))
1247
+ );
1248
+ return f.sortMode === "remote" && (d.sortable = "custom"), d;
1020
1249
  };
1021
- return d({
1022
- getTableRef: () => o.value,
1023
- clearSelection: () => o.value?.clearSelection(),
1024
- toggleRowSelection: (a, c) => o.value?.toggleRowSelection(a, c),
1025
- toggleAllSelection: () => o.value?.toggleAllSelection(),
1026
- toggleRowExpansion: (a, c) => o.value?.toggleRowExpansion(a, c),
1027
- setCurrentRow: (a) => o.value?.setCurrentRow(a),
1028
- clearSort: () => o.value?.clearSort(),
1029
- clearFilter: (a) => o.value?.clearFilter(a),
1030
- doLayout: () => o.value?.doLayout(),
1031
- sort: (a, c) => o.value?.sort(a, c)
1032
- }), (a, c) => (n(), m(t(fl), v({
1250
+ return s({
1251
+ getTableRef: () => a.value,
1252
+ clearSelection: () => a.value?.clearSelection(),
1253
+ toggleRowSelection: (f, A) => a.value?.toggleRowSelection(f, A),
1254
+ toggleAllSelection: () => a.value?.toggleAllSelection(),
1255
+ toggleRowExpansion: (f, A) => a.value?.toggleRowExpansion(f, A),
1256
+ setCurrentRow: (f) => a.value?.setCurrentRow(f),
1257
+ clearSort: () => a.value?.clearSort(),
1258
+ clearFilter: (f) => a.value?.clearFilter(f),
1259
+ doLayout: () => a.value?.doLayout(),
1260
+ sort: (f, A) => a.value?.sort(f, A)
1261
+ }), (f, A) => (r(), g(l(Tt), S({
1033
1262
  ref_key: "tableRef",
1034
- ref: o,
1035
- data: l.data,
1036
- border: "",
1037
- "row-key": "id"
1038
- }, a.$attrs), te({
1039
- default: b(() => [
1040
- (n(!0), E(I, null, j(l.columns, (u) => (n(), E(I, {
1041
- key: u.prop
1263
+ ref: a,
1264
+ data: t.data,
1265
+ border: t.border,
1266
+ "row-key": t.rowKey
1267
+ }, f.$attrs), Se({
1268
+ default: k(() => [
1269
+ (r(!0), C(X, null, ie(t.columns, (v, d) => (r(), C(X, {
1270
+ key: v.columnKey || v.prop || `${v.type || "column"}-${d}`
1042
1271
  }, [
1043
- ["selection", "index"].includes(u.type) ? (n(), m(t(ye), v({
1272
+ ["selection", "index"].includes(v.type) ? (r(), g(l(Ge), S({
1044
1273
  key: 0,
1045
1274
  ref_for: !0
1046
- }, s(u)), null, 16)) : u.hidden ? S("", !0) : (n(), m(t(ye), v({
1275
+ }, D(v)), null, 16)) : o(v.hidden) ? O("", !0) : (r(), g(l(Ge), S({
1047
1276
  key: 1,
1048
1277
  ref_for: !0
1049
- }, s(u)), te({ _: 2 }, [
1050
- a.$slots[u.prop] ? {
1278
+ }, D(v)), Se({ _: 2 }, [
1279
+ f.$slots[v.prop] ? {
1051
1280
  name: "default",
1052
- fn: b((r) => [
1053
- A(a.$slots, u.prop, v({ ref_for: !0 }, r))
1281
+ fn: k((m) => [
1282
+ R(f.$slots, v.prop, S({ ref_for: !0 }, m))
1054
1283
  ]),
1055
1284
  key: "0"
1056
- } : u.transform ? {
1057
- name: "default",
1058
- fn: b((r) => [
1059
- Z(Y(u.transform(r.row)), 1)
1060
- ]),
1061
- key: "1"
1062
1285
  } : void 0,
1063
- a.$slots[`header-${u.prop}`] ? {
1286
+ f.$slots[`header-${v.prop}`] ? {
1064
1287
  name: "header",
1065
- fn: b((r) => [
1066
- A(a.$slots, `header-${u.prop}`, v({ ref_for: !0 }, r))
1288
+ fn: k((m) => [
1289
+ R(f.$slots, `header-${v.prop}`, S({ ref_for: !0 }, m))
1067
1290
  ]),
1068
- key: "2"
1291
+ key: "1"
1069
1292
  } : void 0
1070
1293
  ]), 1040))
1071
1294
  ], 64))), 128))
1072
1295
  ]),
1073
1296
  _: 2
1074
1297
  }, [
1075
- a.$slots?.append ? {
1298
+ f.$slots?.append ? {
1076
1299
  name: "append",
1077
- fn: b(() => [
1078
- A(a.$slots, "append")
1300
+ fn: k(() => [
1301
+ R(f.$slots, "append")
1079
1302
  ]),
1080
1303
  key: "0"
1081
1304
  } : void 0,
1082
- a.$slots?.empty ? {
1305
+ f.$slots?.empty ? {
1083
1306
  name: "empty",
1084
- fn: b(() => [
1085
- A(a.$slots, "empty")
1307
+ fn: k(() => [
1308
+ R(f.$slots, "empty")
1086
1309
  ]),
1087
1310
  key: "1"
1088
1311
  } : void 0
1089
- ]), 1040, ["data"]));
1312
+ ]), 1040, ["data", "border", "row-key"]));
1090
1313
  }
1091
- }), De = N(ut), dt = { class: "ez-search-form" }, ct = { class: "ez-search-form__operate" }, ft = V({ name: "EzSearchForm", inheritAttrs: !1 }), mt = /* @__PURE__ */ V({
1092
- ...ft,
1093
- props: /* @__PURE__ */ O({
1094
- collapsedHeight: { default: 50 },
1095
- reset: { type: Boolean }
1314
+ }), Ma = { class: "ez-query-panel" }, Ra = { class: "ez-query-panel__operate" }, Ia = x({ name: "EzQueryPanel", inheritAttrs: !1 }), Oa = /* @__PURE__ */ x({
1315
+ ...Ia,
1316
+ props: /* @__PURE__ */ _({
1317
+ expanded: { type: Boolean },
1318
+ collapsedHeight: { default: 50 }
1096
1319
  }, {
1097
- expanded: { default: !1 },
1320
+ expanded: { type: Boolean, default: !1 },
1098
1321
  expandedModifiers: {}
1099
1322
  }),
1100
1323
  emits: ["update:expanded"],
1101
- setup(e, { expose: d }) {
1102
- const l = e, { t: o } = ae(), s = B(), f = B(0), a = M(e, "expanded"), c = C(() => f.value > l.collapsedHeight), u = C(() => a.value ? ql : Ol), r = C(() => a.value ? o("s.button.collapse") : o("s.button.expand"));
1103
- let i = null;
1104
- const U = $l(() => {
1105
- s.value && (f.value = s.value.scrollHeight);
1106
- }, 100), G = () => {
1107
- a.value = !a.value;
1324
+ setup(e, { expose: s }) {
1325
+ const t = e, { t: a } = ke(), i = G(), o = G(), c = G(0), h = ee(e, "expanded"), V = U(() => c.value > t.collapsedHeight), y = U(() => h.value ? da : ia), E = U(() => h.value ? a("s.button.collapse") : a("s.button.expand"));
1326
+ let D = null;
1327
+ const H = jt(() => {
1328
+ i.value && (c.value = i.value.scrollHeight);
1329
+ }, 100), f = () => {
1330
+ h.value = !h.value;
1108
1331
  };
1109
- return ue(() => {
1332
+ return Me(() => {
1110
1333
  setTimeout(() => {
1111
- s.value && (U(), i = new ResizeObserver(U), i.observe(s.value));
1334
+ i.value && (H(), D = new ResizeObserver(H), D.observe(i.value));
1112
1335
  }, 50);
1113
- }), qe(() => {
1114
- i && (i.disconnect(), i = null);
1115
- }), d({
1116
- countViewHeight: U
1117
- }), (F, W) => (n(), E("div", dt, [
1118
- P("div", {
1119
- class: "ez-search-form__wrapper",
1120
- style: Ce({
1121
- height: f.value ? a.value ? `${f.value}px` : `${l.collapsedHeight}px` : "auto"
1336
+ }), ft(() => {
1337
+ D && (D.disconnect(), D = null);
1338
+ }), s({
1339
+ countViewHeight: H
1340
+ }), (A, v) => (r(), C("div", Ma, [
1341
+ Y("div", {
1342
+ class: "ez-query-panel__wrapper",
1343
+ style: we({
1344
+ height: c.value ? h.value ? `${c.value}px` : `${t.collapsedHeight}px` : "auto"
1122
1345
  })
1123
1346
  }, [
1124
- P("div", ct, [
1125
- A(F.$slots, "operate"),
1126
- c.value ? (n(), m(t(J), {
1127
- key: 0,
1128
- icon: u.value,
1129
- size: "small",
1130
- title: r.value,
1131
- circle: "",
1132
- onClick: W[0] || (W[0] = (p) => G())
1133
- }, null, 8, ["icon", "title"])) : S("", !0)
1134
- ]),
1135
- P("div", {
1136
- ref_key: "wrapRef",
1137
- ref: s
1347
+ Y("div", {
1348
+ ref_key: "layoutRef",
1349
+ ref: i,
1350
+ class: "ez-query-panel__layout"
1138
1351
  }, [
1139
- A(F.$slots, "default")
1352
+ Y("div", Ra, [
1353
+ R(A.$slots, "operate"),
1354
+ V.value ? (r(), g(l(be), {
1355
+ key: 0,
1356
+ icon: y.value,
1357
+ size: "small",
1358
+ title: E.value,
1359
+ circle: "",
1360
+ onClick: v[0] || (v[0] = (d) => f())
1361
+ }, null, 8, ["icon", "title"])) : O("", !0)
1362
+ ]),
1363
+ Y("div", {
1364
+ ref_key: "wrapRef",
1365
+ ref: o,
1366
+ class: "ez-query-panel__content"
1367
+ }, [
1368
+ R(A.$slots, "default")
1369
+ ], 512)
1140
1370
  ], 512)
1141
1371
  ], 4)
1142
1372
  ]));
1143
1373
  }
1144
- }), Me = N(mt), vt = V({ name: "EzPagination", inheritAttrs: !1 }), pt = /* @__PURE__ */ V({
1145
- ...vt,
1146
- props: {
1374
+ }), st = te(Oa), Ba = x({ name: "EzPagination", inheritAttrs: !1 }), Fa = /* @__PURE__ */ x({
1375
+ ...Ba,
1376
+ props: /* @__PURE__ */ _({
1147
1377
  currentPage: {},
1148
- currentPageModifiers: {},
1149
1378
  pageSize: {},
1379
+ total: {},
1380
+ pageSizes: { default: () => [10, 20, 50, 100] },
1381
+ layout: { default: "total, sizes, prev, pager, next, jumper" },
1382
+ background: { type: Boolean, default: !1 },
1383
+ disabled: { type: Boolean, default: !1 }
1384
+ }, {
1385
+ currentPage: { default: 1 },
1386
+ currentPageModifiers: {},
1387
+ pageSize: { default: 10 },
1150
1388
  pageSizeModifiers: {}
1151
- },
1152
- emits: ["update:currentPage", "update:pageSize"],
1153
- setup(e) {
1154
- const d = M(e, "currentPage"), l = M(e, "pageSize"), { attrs: o } = Q(["currentPage", "pageSize"]);
1155
- return (s, f) => (n(), m(t(ml), v({
1156
- "current-page": d.value,
1157
- "onUpdate:currentPage": f[0] || (f[0] = (a) => d.value = a),
1158
- "page-size": l.value,
1159
- "onUpdate:pageSize": f[1] || (f[1] = (a) => l.value = a),
1160
- "page-sizes": [10, 20, 50, 100],
1161
- layout: "total, sizes, prev, pager, next, jumper"
1162
- }, t(o)), null, 16, ["current-page", "page-size"]));
1389
+ }),
1390
+ emits: /* @__PURE__ */ _(["update:currentPage", "update:pageSize", "current-change", "size-change", "change"], ["update:currentPage", "update:pageSize"]),
1391
+ setup(e, { emit: s }) {
1392
+ const t = e, a = ee(e, "currentPage"), i = ee(e, "pageSize"), o = s, c = (y) => {
1393
+ o("current-change", y), o("change", y, i.value);
1394
+ }, h = (y) => {
1395
+ o("size-change", y), o("change", a.value, y);
1396
+ }, { attrs: V } = Ee([
1397
+ "currentPage",
1398
+ "pageSize",
1399
+ "total",
1400
+ "pageSizes",
1401
+ "layout",
1402
+ "background",
1403
+ "disabled"
1404
+ ]);
1405
+ return (y, E) => (r(), g(l(Mt), S({
1406
+ "current-page": a.value,
1407
+ "onUpdate:currentPage": E[0] || (E[0] = (D) => a.value = D),
1408
+ "page-size": i.value,
1409
+ "onUpdate:pageSize": E[1] || (E[1] = (D) => i.value = D),
1410
+ total: t.total,
1411
+ "page-sizes": t.pageSizes,
1412
+ layout: t.layout,
1413
+ background: t.background,
1414
+ disabled: t.disabled,
1415
+ onCurrentChange: c,
1416
+ onSizeChange: h
1417
+ }, l(V)), null, 16, ["current-page", "page-size", "total", "page-sizes", "layout", "background", "disabled"]));
1163
1418
  }
1164
- }), Pe = N(pt);
1165
- var re = /* @__PURE__ */ ((e) => (e.ASC = "ascending", e.DESC = "descending", e[e.EMPTY = null] = "EMPTY", e))(re || {});
1166
- const gt = (e) => {
1167
- const d = B([]), l = C(() => d.value), o = C(() => d.value.map((a) => a[e]));
1419
+ }), it = te(Fa);
1420
+ var Te = /* @__PURE__ */ ((e) => (e.ASC = "ascending", e.DESC = "descending", e[e.EMPTY = null] = "EMPTY", e))(Te || {});
1421
+ const Na = (e, s) => typeof s == "function" ? s(e) : e[s], La = (e) => {
1422
+ const s = Ue([]), t = U(() => s.value), a = U(() => s.value.map((c) => Na(c, e)));
1168
1423
  return {
1169
- selectionChange: (a) => {
1170
- d.value = a;
1424
+ selectionChange: (c) => {
1425
+ s.value = c;
1171
1426
  },
1172
- getSelectedList: l,
1173
- getSelectedIds: o,
1174
- getSortParams: ({ prop: a, order: c }) => {
1175
- const u = { asc: null, desc: null };
1176
- return c === re.ASC ? (u.asc = a, u.desc = null) : c === re.DESC && (u.asc = null, u.desc = a), u;
1427
+ getSelectedList: t,
1428
+ getSelectedIds: a,
1429
+ getSortParams: ({ prop: c, order: h }, V) => {
1430
+ const y = V || c, E = { asc: null, desc: null };
1431
+ return h === Te.ASC ? (E.asc = y, E.desc = null) : h === Te.DESC && (E.asc = null, E.desc = y), E;
1177
1432
  }
1178
1433
  };
1179
- }, bt = /* @__PURE__ */ V({
1434
+ }, qa = /* @__PURE__ */ x({
1180
1435
  __name: "column-config",
1181
1436
  props: {
1182
1437
  modelValue: { type: Boolean, default: !1 },
@@ -1184,242 +1439,370 @@ const gt = (e) => {
1184
1439
  columns: { default: () => [] },
1185
1440
  columnsModifiers: {}
1186
1441
  },
1187
- emits: /* @__PURE__ */ O(["change"], ["update:modelValue", "update:columns"]),
1188
- setup(e, { emit: d }) {
1189
- const { t: l } = ae(), o = ["selection", "index", "expand"], s = d, f = M(e, "modelValue"), a = M(e, "columns"), c = (u) => a.value.filter((i) => i.hidden === 0).length < 2 && u.hidden === 0;
1190
- return (u, r) => (n(), m(t(vl), {
1191
- modelValue: f.value,
1192
- "onUpdate:modelValue": r[1] || (r[1] = (i) => f.value = i),
1442
+ emits: /* @__PURE__ */ _(["change"], ["update:modelValue", "update:columns"]),
1443
+ setup(e, { emit: s }) {
1444
+ const { t } = ke(), a = ["selection", "index", "expand"], i = s, o = ee(e, "modelValue"), c = ee(e, "columns"), h = (V) => c.value.filter((E) => !E.hidden).length < 2 && !V.hidden;
1445
+ return (V, y) => (r(), g(l(Rt), {
1446
+ modelValue: o.value,
1447
+ "onUpdate:modelValue": y[1] || (y[1] = (E) => o.value = E),
1193
1448
  class: "ez-column-wrapper",
1194
- title: t(l)("s.label.column"),
1449
+ title: l(t)("s.label.column"),
1195
1450
  size: "15%"
1196
1451
  }, {
1197
- default: b(() => [
1198
- (n(!0), E(I, null, j(a.value, (i) => (n(), E(I, {
1199
- key: i.prop
1452
+ default: k(() => [
1453
+ (r(!0), C(X, null, ie(c.value, (E, D) => (r(), C(X, {
1454
+ key: E.columnKey || E.prop || `${E.type || "column"}-${D}`
1200
1455
  }, [
1201
- o.includes(i.type) ? S("", !0) : (n(), m(t(Se), {
1456
+ a.includes(E.type) ? O("", !0) : (r(), g(l(et), {
1202
1457
  key: 0,
1203
- modelValue: i.hidden,
1204
- "onUpdate:modelValue": (U) => i.hidden = U,
1458
+ "model-value": !E.hidden,
1205
1459
  class: "flex",
1206
- "true-value": 0,
1207
- "false-value": 1,
1208
- label: i.label,
1209
- checked: "",
1210
- disabled: c(i),
1211
- onChange: r[0] || (r[0] = (U) => s("change"))
1212
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "disabled"]))
1460
+ label: E.label,
1461
+ "onUpdate:modelValue": (H) => E.hidden = !H,
1462
+ disabled: h(E),
1463
+ onChange: y[0] || (y[0] = (H) => i("change"))
1464
+ }, null, 8, ["model-value", "label", "onUpdate:modelValue", "disabled"]))
1213
1465
  ], 64))), 128))
1214
1466
  ]),
1215
1467
  _: 1
1216
1468
  }, 8, ["modelValue", "title"]));
1217
1469
  }
1218
- }), yt = { class: "ez-fast-table" }, ht = { class: "ez-fast-table_wrapper" }, Vt = {
1470
+ }), Ha = { class: "ez-fast-table" }, Ga = { class: "ez-fast-table_wrapper" }, Ka = {
1219
1471
  key: 0,
1220
1472
  class: "ez-fast-table_wrapper_header_operation"
1221
- }, Et = { class: "ez-fast-table_pagination" }, wt = V({
1473
+ }, ja = {
1474
+ key: 1,
1475
+ class: "ez-fast-table_error"
1476
+ }, Wa = { class: "ez-fast-table_pagination" }, Ya = x({
1222
1477
  name: "EzFastTable",
1223
- directives: { loading: de.directive },
1478
+ directives: { loading: Re.directive },
1224
1479
  inheritAttrs: !1
1225
- }), $t = /* @__PURE__ */ V({
1226
- ...wt,
1227
- props: /* @__PURE__ */ O({
1228
- api: { type: Function, default: () => Promise.resolve() },
1480
+ }), Qa = /* @__PURE__ */ x({
1481
+ ...Ya,
1482
+ props: {
1483
+ params: {},
1484
+ loading: { type: Boolean },
1485
+ columns: { default: () => [] },
1486
+ api: { type: Function, default: () => Promise.resolve({}) },
1229
1487
  beforeSearch: { type: Function, default: () => Promise.resolve() },
1488
+ transformParams: { type: Function, default: (e) => e },
1489
+ responseAdapter: { type: Function, default: (e) => {
1490
+ const { code: s, data: t } = e || {};
1491
+ return s === 200 && t?.records ? {
1492
+ records: t.records || [],
1493
+ total: t.total || 0,
1494
+ current: t.current || 1,
1495
+ size: t.size || 10
1496
+ } : {
1497
+ records: [],
1498
+ total: 0,
1499
+ current: 1,
1500
+ size: 10
1501
+ };
1502
+ } },
1503
+ onError: { type: Function, default: async () => {
1504
+ } },
1230
1505
  columnTool: { type: Boolean, default: !0 },
1231
1506
  expanded: { type: Boolean, default: !1 },
1232
- data: {},
1233
- columns: {},
1234
- rowKey: {}
1235
- }, {
1236
- params: {},
1237
- paramsModifiers: {},
1238
- columns: {},
1239
- columnsModifiers: {},
1240
- loading: { type: Boolean },
1241
- loadingModifiers: {}
1242
- }),
1243
- emits: /* @__PURE__ */ O(["changePage", "reset", "query"], ["update:params", "update:columns", "update:loading"]),
1244
- setup(e, { expose: d, emit: l }) {
1245
- const { t: o } = ae(), s = e, f = $e(), a = C(() => {
1246
- const { api: h, beforeSearch: w, columnTool: H, expanded: T, ...oe } = s;
1507
+ border: { type: Boolean, default: !0 },
1508
+ rowKey: { type: [String, Function], default: "id" }
1509
+ },
1510
+ emits: ["update:params", "update:loading", "changePage", "reset", "query", "update:columns"],
1511
+ setup(e, { expose: s, emit: t }) {
1512
+ const { t: a } = ke(), i = () => ({ current: 1, size: 10 }), o = e, c = Ze(), h = U(() => {
1513
+ const { api: p, beforeSearch: z, transformParams: L, responseAdapter: M, onError: K, columnTool: ue, expanded: Oe, columns: tl, border: al, ...dt } = o;
1247
1514
  return {
1248
- ...f,
1249
- ...oe
1515
+ ...c,
1516
+ ...dt
1250
1517
  };
1251
- }), c = B(s.expanded), { selectionChange: u, getSelectedList: r, getSortParams: i, getSelectedIds: U } = gt(s.rowKey), G = B(null), F = B(!1), W = B(null), p = B([]), R = B(0), z = l, y = M(e, "params"), g = M(e, "columns"), $ = M(e, "loading"), D = async () => {
1518
+ }), V = G(o.expanded), { selectionChange: y, getSelectedList: E, getSortParams: D, getSelectedIds: H } = La(o.rowKey), f = G(null), A = G(!1), v = G(null), d = G(0), m = G([]), Z = G(0), F = G(null), q = t, N = G(j(o.params ?? i())), re = G(j(o.columns ?? [])), P = G(o.loading ?? !1), $ = U({
1519
+ get: () => P.value,
1520
+ set: (p) => {
1521
+ P.value = p, q("update:loading", p);
1522
+ }
1523
+ }), I = U(() => ({
1524
+ params: N.value,
1525
+ loading: $.value,
1526
+ expanded: V.value,
1527
+ search: ne,
1528
+ query: oe,
1529
+ reset: u,
1530
+ captureInitialParams: ve,
1531
+ patchParams: se,
1532
+ replaceParams: pe
1533
+ }));
1534
+ ye(
1535
+ () => o.params,
1536
+ (p) => {
1537
+ N.value = j(p ?? i());
1538
+ },
1539
+ { deep: !0 }
1540
+ ), ye(
1541
+ () => o.columns,
1542
+ (p) => {
1543
+ re.value = j(p ?? []);
1544
+ },
1545
+ { deep: !0 }
1546
+ ), ye(
1547
+ () => o.loading,
1548
+ (p) => {
1549
+ P.value = p ?? !1;
1550
+ }
1551
+ );
1552
+ const J = (p) => p, ae = () => {
1553
+ const p = j(N.value);
1554
+ N.value = p, q("update:params", p);
1555
+ }, le = async (p, z, L) => {
1556
+ p === d.value && (console.error(`[EzFastTable] Query pipeline failed at stage "${L.stage}".`, z), F.value = {
1557
+ error: z,
1558
+ stage: L.stage,
1559
+ params: j(L.params)
1560
+ }, await o.onError?.(z, L));
1561
+ }, oe = async () => {
1562
+ const p = d.value + 1;
1563
+ d.value = p, F.value = null;
1252
1564
  try {
1253
- $.value = !0, await s.beforeSearch(y.value);
1254
- const { code: h, data: w } = await s.api(y.value);
1255
- h === 200 && w.records ? (p.value = w.records || [], R.value = w.total) : (p.value = [], R.value = 0), z("query");
1565
+ $.value = !0;
1566
+ const z = j(N.value);
1567
+ try {
1568
+ await o.beforeSearch(z);
1569
+ } catch (ue) {
1570
+ await le(p, ue, { stage: "beforeSearch", params: z });
1571
+ return;
1572
+ }
1573
+ let L;
1574
+ try {
1575
+ L = await o.transformParams(z);
1576
+ } catch (ue) {
1577
+ await le(p, ue, { stage: "transformParams", params: z });
1578
+ return;
1579
+ }
1580
+ let M;
1581
+ try {
1582
+ M = await o.api(L);
1583
+ } catch (ue) {
1584
+ await le(p, ue, { stage: "api", params: z });
1585
+ return;
1586
+ }
1587
+ let K;
1588
+ try {
1589
+ K = await o.responseAdapter(M);
1590
+ } catch (ue) {
1591
+ await le(p, ue, { stage: "responseAdapter", params: z });
1592
+ return;
1593
+ }
1594
+ if (p !== d.value)
1595
+ return;
1596
+ m.value = K.records || [], Z.value = K.total || 0, q("query");
1256
1597
  } finally {
1257
- $.value = !1;
1598
+ p === d.value && ($.value = !1);
1258
1599
  }
1259
- }, L = () => {
1260
- y.value.current = 1, D();
1261
- }, _ = () => G.value?.getTableRef(), K = (h) => {
1262
- const w = i(h);
1263
- y.value = { ...y.value, ...w };
1264
- const { column: H } = h;
1265
- H.sortable === "custom" && L();
1266
- }, q = (h) => {
1267
- if (h === null || typeof h != "object") return h;
1268
- if (h instanceof Date) return new Date(h.getTime());
1269
- if (h instanceof Array) return h.map((H) => q(H));
1270
- const w = Object.create(Object.getPrototypeOf(h));
1271
- for (const H in h)
1272
- h.hasOwnProperty(H) && (w[H] = q(h[H]));
1273
- return w;
1274
- }, Be = () => {
1275
- y.value = q(W.value), z("reset"), Ge(() => L());
1276
- }, ce = (h) => {
1277
- z("changePage", h), h.size ? L() : D();
1278
- }, Le = () => {
1279
- _().doLayout();
1280
- };
1281
- return ue(() => {
1282
- W.value = q(y.value);
1283
- }), d({ search: L, query: D, getTableRef: _ }), (h, w) => {
1284
- const H = ke("loading");
1285
- return n(), E("div", yt, [
1286
- h.$slots.form ? (n(), m(t(Me), {
1600
+ }, ne = () => {
1601
+ N.value.current = 1, ae(), oe();
1602
+ }, se = (p, z = {}) => {
1603
+ const { resetPage: L = !1, captureInitial: M = !1 } = z, K = { ...N.value, ...j(p) };
1604
+ L && (K.current = 1), N.value = K, ae(), M && ve();
1605
+ }, pe = (p, z = {}) => {
1606
+ const { resetPage: L = !1, captureInitial: M = !1 } = z, K = j(p);
1607
+ L && (K.current = 1), N.value = K, ae(), M && ve();
1608
+ }, Ve = () => f.value?.getTableRef(), Ie = (p) => {
1609
+ const { column: z, prop: L } = p;
1610
+ if ((z?.sortMode || "local") === "remote") {
1611
+ const K = D(p, z?.sortField || L);
1612
+ se(K), ne();
1613
+ return;
1614
+ }
1615
+ (N.value.asc || N.value.desc) && se({ asc: null, desc: null });
1616
+ }, ve = () => {
1617
+ v.value = j(N.value);
1618
+ }, u = () => {
1619
+ pe(j(v.value ?? { current: 1, size: 10 })), q("reset"), Pe(() => oe());
1620
+ }, b = (p) => {
1621
+ if (q("changePage", p), p.size) {
1622
+ ne();
1623
+ return;
1624
+ }
1625
+ ae(), oe();
1626
+ }, n = () => {
1627
+ Ve()?.doLayout();
1628
+ }, w = () => {
1629
+ const p = j(re.value);
1630
+ re.value = p, q("update:columns", p), n();
1631
+ }, T = () => {
1632
+ F.value = null;
1633
+ }, Q = () => F.value, ce = () => {
1634
+ T(), oe();
1635
+ }, fe = U(() => ({
1636
+ error: F.value?.error,
1637
+ stage: F.value?.stage || "api",
1638
+ params: F.value?.params ?? N.value,
1639
+ retry: ce
1640
+ }));
1641
+ return Me(() => {
1642
+ ve();
1643
+ }), s({
1644
+ search: ne,
1645
+ query: oe,
1646
+ patchParams: se,
1647
+ replaceParams: pe,
1648
+ reset: u,
1649
+ captureInitialParams: ve,
1650
+ getTableRef: Ve,
1651
+ doLayout: n,
1652
+ clearError: T,
1653
+ getErrorState: Q
1654
+ }), (p, z) => {
1655
+ const L = Je("loading");
1656
+ return r(), C("div", Ha, [
1657
+ p.$slots.form ? (r(), g(l(st), {
1287
1658
  key: 0,
1288
- loading: $.value,
1289
- expanded: c.value
1659
+ expanded: V.value,
1660
+ "onUpdate:expanded": z[0] || (z[0] = (M) => V.value = M)
1290
1661
  }, {
1291
- default: b((T) => [
1292
- A(h.$slots, "form", me(Fe(T)))
1662
+ default: k(() => [
1663
+ R(p.$slots, "form", ze(Fe(I.value)))
1293
1664
  ]),
1294
- operate: b(() => [
1295
- x(t(J), {
1665
+ operate: k(() => [
1666
+ W(l(be), {
1296
1667
  type: "primary",
1297
1668
  loading: $.value,
1298
- onClick: L
1669
+ onClick: ne
1299
1670
  }, {
1300
- default: b(() => [
1301
- Z(Y(t(o)("s.button.query")), 1)
1671
+ default: k(() => [
1672
+ he(de(l(a)("s.button.query")), 1)
1302
1673
  ]),
1303
1674
  _: 1
1304
1675
  }, 8, ["loading"]),
1305
- x(t(J), { onClick: Be }, {
1306
- default: b(() => [
1307
- Z(Y(t(o)("s.button.reset")), 1)
1676
+ W(l(be), { onClick: u }, {
1677
+ default: k(() => [
1678
+ he(de(l(a)("s.button.reset")), 1)
1308
1679
  ]),
1309
1680
  _: 1
1310
1681
  })
1311
1682
  ]),
1312
1683
  _: 3
1313
- }, 8, ["loading", "expanded"])) : S("", !0),
1314
- h.$slots.freeArea ? A(h.$slots, "freeArea", { key: 1 }) : S("", !0),
1315
- P("div", ht, [
1316
- h.$slots.header || s.columnTool ? (n(), E("div", {
1684
+ }, 8, ["expanded"])) : O("", !0),
1685
+ p.$slots.freeArea ? R(p.$slots, "freeArea", ze(S({ key: 1 }, I.value))) : O("", !0),
1686
+ Y("div", Ga, [
1687
+ p.$slots.header || o.columnTool ? (r(), C("div", {
1317
1688
  key: 0,
1318
- class: He(["ez-fast-table_wrapper_header", h.$slots.header ? "justify-between" : "justify-end"])
1689
+ class: Ae(["ez-fast-table_wrapper_header", p.$slots.header ? "justify-between" : "justify-end"])
1319
1690
  }, [
1320
- h.$slots.header ? (n(), E("div", Vt, [
1321
- A(h.$slots, "header", {
1322
- selectList: t(r),
1323
- selectIds: t(U)
1691
+ p.$slots.header ? (r(), C("div", Ka, [
1692
+ R(p.$slots, "header", {
1693
+ selectList: l(E),
1694
+ selectIds: l(H)
1324
1695
  })
1325
- ])) : S("", !0),
1326
- s.columnTool ? (n(), m(t(J), {
1696
+ ])) : O("", !0),
1697
+ o.columnTool ? (r(), g(l(be), {
1327
1698
  key: 1,
1328
- icon: t(Wl),
1699
+ icon: l(pa),
1329
1700
  circle: "",
1330
- onClick: w[0] || (w[0] = (T) => F.value = !0)
1331
- }, null, 8, ["icon"])) : S("", !0)
1332
- ], 2)) : S("", !0),
1333
- ze((n(), m(t(De), v(a.value, {
1701
+ onClick: z[1] || (z[1] = (M) => A.value = !0)
1702
+ }, null, 8, ["icon"])) : O("", !0)
1703
+ ], 2)) : O("", !0),
1704
+ _e((r(), g(rt, S(h.value, {
1334
1705
  ref_key: "fastTableRef",
1335
- ref: G,
1336
- columns: g.value,
1337
- data: p.value,
1338
- onSelectionChange: t(u),
1339
- onSortChange: K
1340
- }), te({ _: 2 }, [
1341
- j(h.$slots, (T, oe, Tt) => ({
1342
- name: oe,
1343
- fn: b((Ie) => [
1344
- ["form"].includes(T.name) ? S("", !0) : A(h.$slots, oe, me(v({ key: 0 }, Ie)))
1706
+ ref: f,
1707
+ border: o.border,
1708
+ columns: re.value,
1709
+ data: m.value,
1710
+ onSelectionChange: l(y),
1711
+ onSortChange: Ie
1712
+ }), Se({ _: 2 }, [
1713
+ ie(p.$slots, (M, K, ue) => ({
1714
+ name: K,
1715
+ fn: k((Oe) => [
1716
+ !["form", "empty", "error", "header"].includes(String(K)) && !String(K).startsWith("header-") ? R(p.$slots, K, ze(S({ key: 0 }, J(Oe)))) : O("", !0)
1345
1717
  ])
1346
- }))
1347
- ]), 1040, ["columns", "data", "onSelectionChange"])), [
1348
- [H, $.value]
1718
+ })),
1719
+ p.$slots.empty && !F.value ? {
1720
+ name: "empty",
1721
+ fn: k(() => [
1722
+ R(p.$slots, "empty")
1723
+ ]),
1724
+ key: "0"
1725
+ } : void 0
1726
+ ]), 1040, ["border", "columns", "data", "onSelectionChange"])), [
1727
+ [L, $.value]
1349
1728
  ]),
1350
- P("div", Et, [
1351
- x(t(Pe), {
1352
- "current-page": y.value.current,
1729
+ F.value && p.$slots.error ? (r(), C("div", ja, [
1730
+ R(p.$slots, "error", ze(Fe(fe.value)))
1731
+ ])) : O("", !0),
1732
+ Y("div", Wa, [
1733
+ W(l(it), {
1734
+ "current-page": N.value.current,
1353
1735
  "onUpdate:currentPage": [
1354
- w[1] || (w[1] = (T) => y.value.current = T),
1355
- w[3] || (w[3] = (T) => ce({ current: T }))
1736
+ z[2] || (z[2] = (M) => N.value.current = M),
1737
+ z[4] || (z[4] = (M) => b({ current: M }))
1356
1738
  ],
1357
- "page-size": y.value.size,
1739
+ "page-size": N.value.size,
1358
1740
  "onUpdate:pageSize": [
1359
- w[2] || (w[2] = (T) => y.value.size = T),
1360
- w[4] || (w[4] = (T) => ce({ size: T }))
1741
+ z[3] || (z[3] = (M) => N.value.size = M),
1742
+ z[5] || (z[5] = (M) => b({ size: M }))
1361
1743
  ],
1362
- total: R.value
1744
+ total: Z.value
1363
1745
  }, null, 8, ["current-page", "page-size", "total"])
1364
1746
  ])
1365
1747
  ]),
1366
- x(bt, {
1367
- modelValue: F.value,
1368
- "onUpdate:modelValue": w[5] || (w[5] = (T) => F.value = T),
1369
- columns: g.value,
1370
- "onUpdate:columns": w[6] || (w[6] = (T) => g.value = T),
1371
- onChange: Le
1748
+ W(qa, {
1749
+ modelValue: A.value,
1750
+ "onUpdate:modelValue": z[6] || (z[6] = (M) => A.value = M),
1751
+ columns: re.value,
1752
+ "onUpdate:columns": z[7] || (z[7] = (M) => re.value = M),
1753
+ onChange: w
1372
1754
  }, null, 8, ["modelValue", "columns"])
1373
1755
  ]);
1374
1756
  };
1375
1757
  }
1376
- }), kt = N($t), we = /* @__PURE__ */ Symbol("INSTALLED_KEY");
1377
- function zt(e = []) {
1758
+ }), ut = te(Qa), nl = () => ut, Xa = te(rt), Xe = /* @__PURE__ */ Symbol("INSTALLED_KEY");
1759
+ function Za(e = []) {
1378
1760
  return {
1379
- install: (l) => {
1380
- l[we] || (l[we] = !0, e.forEach((o) => l.use(o)));
1761
+ install: (t) => {
1762
+ t[Xe] || (t[Xe] = !0, e.forEach((a) => t.use(a)));
1381
1763
  }
1382
1764
  };
1383
1765
  }
1384
- const Ct = [
1385
- Ae,
1386
- Rl,
1766
+ const Ja = [
1767
+ tt,
1768
+ ea,
1769
+ Ua,
1770
+ Pa,
1771
+ ut,
1772
+ me,
1773
+ ot,
1774
+ it,
1387
1775
  st,
1388
- rt,
1389
- kt,
1390
- X,
1776
+ lt,
1777
+ at,
1778
+ Xa
1779
+ ], _a = [
1780
+ It,
1391
1781
  Re,
1392
- Pe,
1393
- xe,
1394
- Me,
1395
- Te,
1396
- De
1397
- ], St = [
1398
- pl,
1399
- de,
1400
- ee,
1401
- gl,
1402
- bl,
1403
- yl
1404
- ], At = zt([...Ct, ...St]), Ut = At.install;
1782
+ ge,
1783
+ Ot,
1784
+ Bt,
1785
+ Ft
1786
+ ], el = Za([...Ja, ..._a]), rl = el.install;
1405
1787
  export {
1406
- et as CHANGE_TRIGGER_TYPES,
1407
- Ae as EzCheckbox,
1408
- Rl as EzDialog,
1409
- st as EzDynamicForm,
1410
- kt as EzFastTable,
1411
- rt as EzFormItem,
1412
- X as EzIcon,
1413
- Re as EzImageUpload,
1414
- Pe as EzPagination,
1415
- xe as EzRadio,
1416
- Me as EzSearchForm,
1417
- Te as EzSelect,
1418
- De as EzTable,
1419
- k as FormItemType,
1420
- _l as SELECT_FORM_TYPES,
1421
- At as default,
1422
- lt as getInputVerb,
1423
- tt as getTrigger,
1424
- Ut as install
1788
+ wa as CHANGE_TRIGGER_TYPES,
1789
+ tt as EzCheckbox,
1790
+ ea as EzDialog,
1791
+ Ua as EzDynamicForm,
1792
+ ut as EzFastTable,
1793
+ Pa as EzFormItem,
1794
+ me as EzIcon,
1795
+ ot as EzImageUpload,
1796
+ it as EzPagination,
1797
+ st as EzQueryPanel,
1798
+ lt as EzRadio,
1799
+ at as EzSelect,
1800
+ Xa as EzTable,
1801
+ B as FormItemType,
1802
+ $a as SELECT_FORM_TYPES,
1803
+ nl as createTypedFastTable,
1804
+ el as default,
1805
+ Sa as getInputVerb,
1806
+ ka as getTrigger,
1807
+ rl as install
1425
1808
  };