@maxtan/ez-ui 0.15.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.js +1026 -822
  4. package/dist/types/index.d.ts +1933 -0
  5. package/package.json +4 -3
  6. package/dist/types/components/checkbox/index.d.ts +0 -45
  7. package/dist/types/components/checkbox/src/checkbox.d.ts +0 -12
  8. package/dist/types/components/checkbox/src/checkbox.vue.d.ts +0 -17
  9. package/dist/types/components/dialog/index.d.ts +0 -58
  10. package/dist/types/components/dialog/src/dialog.d.ts +0 -17
  11. package/dist/types/components/dialog/src/dialog.vue.d.ts +0 -33
  12. package/dist/types/components/dynamic-form/index.d.ts +0 -245
  13. package/dist/types/components/dynamic-form/src/dynamic-form.d.ts +0 -128
  14. package/dist/types/components/dynamic-form/src/dynamic-form.vue.d.ts +0 -398
  15. package/dist/types/components/fast-table/index.d.ts +0 -71
  16. package/dist/types/components/fast-table/src/column-config.vue.d.ts +0 -21
  17. package/dist/types/components/fast-table/src/fast-table.d.ts +0 -51
  18. package/dist/types/components/fast-table/src/fast-table.vue.d.ts +0 -48
  19. package/dist/types/components/fast-table/src/use-fast-table.d.ts +0 -13
  20. package/dist/types/components/icon/index.d.ts +0 -30
  21. package/dist/types/components/icon/src/icon.d.ts +0 -4
  22. package/dist/types/components/icon/src/icon.vue.d.ts +0 -23
  23. package/dist/types/components/image-upload/index.d.ts +0 -479
  24. package/dist/types/components/image-upload/src/image-upload.d.ts +0 -36
  25. package/dist/types/components/image-upload/src/image-upload.vue.d.ts +0 -432
  26. package/dist/types/components/index.d.ts +0 -11
  27. package/dist/types/components/pagination/index.d.ts +0 -49
  28. package/dist/types/components/pagination/src/pagination.d.ts +0 -2
  29. package/dist/types/components/pagination/src/pagination.vue.d.ts +0 -16
  30. package/dist/types/components/radio/index.d.ts +0 -45
  31. package/dist/types/components/radio/src/radio.d.ts +0 -10
  32. package/dist/types/components/radio/src/radio.vue.d.ts +0 -16
  33. package/dist/types/components/search-form/index.d.ts +0 -50
  34. package/dist/types/components/search-form/src/search-form.d.ts +0 -4
  35. package/dist/types/components/search-form/src/search-form.vue.d.ts +0 -35
  36. package/dist/types/components/select/index.d.ts +0 -37
  37. package/dist/types/components/select/src/select.d.ts +0 -20
  38. package/dist/types/components/select/src/select.vue.d.ts +0 -13
  39. package/dist/types/components/table/index.d.ts +0 -49
  40. package/dist/types/components/table/src/table.d.ts +0 -27
  41. package/dist/types/components/table/src/table.vue.d.ts +0 -30
  42. package/dist/types/ez-ui/component.d.ts +0 -1600
  43. package/dist/types/ez-ui/defaults.d.ts +0 -4
  44. package/dist/types/ez-ui/index.d.ts +0 -4
  45. package/dist/types/ez-ui/make-installer.d.ts +0 -4
  46. package/dist/types/ez-ui/plugin.d.ts +0 -3
  47. package/dist/types/ez-ui/vite.config.d.ts +0 -2
package/dist/index.js CHANGED
@@ -1,18 +1,36 @@
1
- import { computed as M, defineComponent as $, mergeModels as I, useModel as P, useAttrs as J, createBlock as p, openBlock as r, unref as l, mergeProps as h, withCtx as b, createElementBlock as w, Fragment as O, renderList as W, resolveDynamicComponent as ce, createTextVNode as le, toDisplayString as Y, resolveDirective as Te, renderSlot as R, createCommentVNode as A, withDirectives as Se, createElementVNode as D, ref as x, createVNode as S, withModifiers as ge, normalizeStyle as Ae, shallowRef as Be, watch as he, nextTick as ue, onMounted as fe, createSlots as de, onUnmounted as Oe, normalizeProps as Ee, guardReactiveProps as He, normalizeClass as qe } from "vue";
2
- import { useLocale as Fe, ElCheckbox as Ue, ElCheckboxButton as Ge, ElCheckboxGroup as je, ElLoading as ve, ElDialog as We, ElButton as te, ElScrollbar as Ke, ElSelect as Xe, ElOptionGroup as Ye, ElOption as be, ElRadio as Je, ElRadioButton as Ze, ElRadioGroup as Qe, ElUpload as ye, ElImage as _e, ElImageViewer as el, ElMessage as oe, ElForm as ll, ElRow as al, ElCol as tl, ElFormItem as ol, ElInput as ie, ElInputNumber as rl, ElDatePicker as ne, ElTimePicker as Ve, ElSwitch as sl, ElTreeSelect as nl, ElCascader as ul, ElTree as dl, ElSlider as il, ElRate as pl, ElTable as cl, ElTableColumn as we, ElPagination as fl, ElDrawer as vl, ElInfiniteScroll as ml, ElMessageBox as gl, ElNotification as hl, ElPopoverDirective as El } from "element-plus";
3
- const F = (t, m) => (t.install = (o) => {
4
- for (const s of [t, ...Object.values({})])
5
- s.name ? o.component(s.name, s) : process.env.NODE_ENV !== "production" && console.warn("[withInstall] Component is missing name property:", s);
6
- }, t);
7
- function Z(t) {
8
- return M(() => {
9
- const m = {};
10
- for (const o in t)
11
- o === "class" || o === "style" || o.startsWith("on") || (m[o] = t[o]);
12
- return m;
1
+ import { useAttrs as Me, computed as T, defineComponent as w, mergeModels as F, useModel as L, createBlock as v, openBlock as o, unref as t, mergeProps as g, withCtx as y, createElementBlock as V, Fragment as P, renderList as W, resolveDynamicComponent as ge, createTextVNode as _, toDisplayString as Y, resolveDirective as Ue, renderSlot as C, createCommentVNode as D, withDirectives as Pe, createElementVNode as N, ref as O, createVNode as M, withModifiers as Ve, normalizeStyle as ie, createSlots as ae, useSlots as je, shallowRef as We, watch as fe, onMounted as ye, normalizeClass as ce, nextTick as Le, onUnmounted as Ke, normalizeProps as Ee, guardReactiveProps as Ye } from "vue";
2
+ import { useLocale as Xe, ElCheckbox as Ne, ElCheckboxButton as Ze, ElCheckboxGroup as Je, ElLoading as be, ElDialog as Qe, ElButton as te, ElSelect as _e, ElOptionGroup as el, ElOption as $e, ElRadio as ll, ElRadioButton as tl, ElRadioGroup as al, ElUpload as ke, ElImage as we, ElImageViewer as ol, ElMessage as se, ElFormItem as nl, ElInput as me, ElInputNumber as sl, ElDatePicker as de, ElTimePicker as Se, ElSwitch as rl, ElTreeSelect as il, ElCascader as ul, ElTree as dl, ElSlider as cl, ElRate as fl, ElForm as ml, ElRow as ze, ElCol as Ce, ElTable as pl, ElTableColumn as Ae, ElPagination as vl, ElDrawer as gl, ElInfiniteScroll as yl, ElMessageBox as bl, ElNotification as hl, ElPopoverDirective as Vl } from "element-plus";
3
+ const G = (e, c) => (e.install = (l) => {
4
+ for (const i of [e, ...Object.values({})])
5
+ i.name ? l.component(i.name, i) : process.env.NODE_ENV !== "production" && console.warn("[withInstall] Component is missing name property:", i);
6
+ }, e);
7
+ function oe(e = []) {
8
+ const c = Me(), l = T(() => {
9
+ const f = {};
10
+ for (const n in c)
11
+ e.includes(n) || (f[n] = c[n]);
12
+ return f;
13
+ }), i = T(() => {
14
+ const f = {};
15
+ for (const n in l.value)
16
+ n.startsWith("on") || (f[n] = l.value[n]);
17
+ return f;
18
+ }), a = T(() => {
19
+ const f = {};
20
+ for (const n in l.value)
21
+ n.startsWith("on") && (f[n] = l.value[n]);
22
+ return f;
13
23
  });
24
+ return {
25
+ /** 所有过滤后的属性(包括事件) */
26
+ attrs: l,
27
+ /** 只包含普通属性 */
28
+ props: i,
29
+ /** 只包含事件监听器 */
30
+ listeners: a
31
+ };
14
32
  }
15
- var bl = {
33
+ var El = {
16
34
  s: {
17
35
  label: {
18
36
  name: "姓名",
@@ -92,57 +110,63 @@ var bl = {
92
110
  }
93
111
  }
94
112
  };
95
- const { s: yl } = bl;
96
- function _l(t, m) {
97
- return m.split(".").reduce((o, s) => o && typeof o == "object" ? o[s] : void 0, t);
113
+ const { s: $l } = El;
114
+ function kl(e, c) {
115
+ return c.split(".").reduce((l, i) => l && typeof l == "object" ? l[i] : void 0, e);
98
116
  }
99
- function Vl(t, m = {}) {
100
- return t.replace(/\{\s*(\w+)\s*\}/g, (o, s) => {
101
- const f = m[s];
102
- return f !== void 0 ? String(f) : `{${s}}`;
117
+ function wl(e, c = {}) {
118
+ return e.replace(/\{\s*(\w+)\s*\}/g, (l, i) => {
119
+ const a = c[i];
120
+ return a !== void 0 ? String(a) : `{${i}}`;
103
121
  });
104
122
  }
105
- function se() {
106
- const { t, lang: m } = Fe();
123
+ function ue() {
124
+ const { t: e, lang: c } = Xe();
107
125
  return {
108
- t: (s, f = {}) => {
109
- const g = t(s, f);
110
- if (g !== s) return g;
111
- const a = _l({ s: yl }, s);
112
- return typeof a == "string" ? Vl(a, f) : s;
126
+ t: (i, a = {}) => {
127
+ const f = e(i, a);
128
+ if (f !== i) return f;
129
+ const n = kl({ s: $l }, i);
130
+ return typeof n == "string" ? wl(n, a) : i;
113
131
  },
114
- lang: m
132
+ lang: c
133
+ };
134
+ }
135
+ function Sl(e, c = 200) {
136
+ let l = null;
137
+ return function(...i) {
138
+ l || (l = setTimeout(() => {
139
+ e.apply(this, i), l = null;
140
+ }, c));
115
141
  };
116
142
  }
117
- const wl = $({ name: "EzCheckbox", inheritAttrs: !1 }), $l = /* @__PURE__ */ $({
118
- ...wl,
119
- props: /* @__PURE__ */ I({
143
+ const zl = w({ name: "EzCheckbox", inheritAttrs: !1 }), Cl = /* @__PURE__ */ w({
144
+ ...zl,
145
+ props: /* @__PURE__ */ F({
120
146
  type: { default: "default" },
121
147
  options: { default: () => [] }
122
148
  }, {
123
149
  modelValue: {},
124
150
  modelModifiers: {}
125
151
  }),
126
- emits: /* @__PURE__ */ I(["change"], ["update:modelValue"]),
127
- setup(t, { emit: m }) {
128
- const o = t, s = m, f = P(t, "modelValue"), g = J(), a = Z(g), V = M(
129
- () => ["default", "border"].includes(o.type) ? Ue : Ge
130
- ), u = (_) => {
131
- s("change", _);
132
- };
133
- return (_, d) => (r(), p(l(je), h({
134
- modelValue: f.value,
135
- "onUpdate:modelValue": d[0] || (d[0] = (E) => f.value = E)
136
- }, l(a), { onChange: u }), {
137
- default: b(() => [
138
- (r(!0), w(O, null, W(t.options, (E) => (r(), p(ce(V.value), h({
139
- key: String(E.value),
152
+ emits: ["update:modelValue"],
153
+ setup(e) {
154
+ const c = e, l = L(e, "modelValue"), { attrs: i } = oe(["options", "type", "modelValue"]), a = T(
155
+ () => ["default", "border"].includes(c.type) ? Ne : Ze
156
+ );
157
+ return (f, n) => (o(), v(t(Je), g({
158
+ modelValue: l.value,
159
+ "onUpdate:modelValue": n[0] || (n[0] = (m) => l.value = m)
160
+ }, t(i)), {
161
+ default: y(() => [
162
+ (o(!0), V(P, null, W(e.options, (m) => (o(), v(ge(a.value), g({
163
+ key: String(m.value),
140
164
  ref_for: !0
141
- }, E, {
142
- border: t.type === "border"
165
+ }, m, {
166
+ border: e.type === "border"
143
167
  }), {
144
- default: b(() => [
145
- le(Y(E.label), 1)
168
+ default: y(() => [
169
+ _(Y(m.label), 1)
146
170
  ]),
147
171
  _: 2
148
172
  }, 1040, ["border"]))), 128))
@@ -150,14 +174,14 @@ const wl = $({ name: "EzCheckbox", inheritAttrs: !1 }), $l = /* @__PURE__ */ $({
150
174
  _: 1
151
175
  }, 16, ["modelValue"]));
152
176
  }
153
- }), Re = F($l);
154
- var re = /* @__PURE__ */ ((t) => (t.CANCEL = "取消", t.CONFIRM = "确定", t))(re || {});
155
- const Cl = { key: 1 }, kl = {
177
+ }), Be = G(Cl);
178
+ var re = /* @__PURE__ */ ((e) => (e.CANCEL = "取消", e.CONFIRM = "确定", e))(re || {});
179
+ const Al = { key: 1 }, Dl = {
156
180
  key: 0,
157
181
  class: "ez-dialog__body"
158
- }, zl = { key: 1 }, Tl = $({ name: "EzDialog", inheritAttrs: !1, directives: { loading: ve.directive } }), Sl = /* @__PURE__ */ $({
159
- ...Tl,
160
- props: /* @__PURE__ */ I({
182
+ }, Tl = { key: 1 }, Rl = w({ name: "EzDialog", inheritAttrs: !1, directives: { loading: be.directive } }), xl = /* @__PURE__ */ w({
183
+ ...Rl,
184
+ props: /* @__PURE__ */ F({
161
185
  title: { default: "" },
162
186
  loading: { type: Boolean, default: !1 },
163
187
  cancelText: { default: re.CANCEL },
@@ -166,135 +190,128 @@ const Cl = { key: 1 }, kl = {
166
190
  modelValue: { type: Boolean },
167
191
  modelModifiers: {}
168
192
  }),
169
- emits: /* @__PURE__ */ I(["cancel", "confirm"], ["update:modelValue"]),
170
- setup(t, { emit: m }) {
171
- const { t: o } = se(), s = t, f = m, g = P(t, "modelValue"), a = J(), V = Z(a), u = () => {
172
- g.value = !1, f("cancel");
173
- }, _ = () => {
174
- f("confirm");
193
+ emits: /* @__PURE__ */ F(["cancel", "confirm"], ["update:modelValue"]),
194
+ setup(e, { emit: c }) {
195
+ const { t: l } = ue(), i = e, a = c, f = L(e, "modelValue"), { attrs: n } = oe(["title", "loading", "cancelText", "confirmText", "modelValue"]), m = () => {
196
+ f.value = !1, a("cancel");
197
+ }, d = () => {
198
+ a("confirm");
175
199
  };
176
- return (d, E) => {
177
- const L = Te("loading");
178
- return r(), p(l(We), h({
179
- modelValue: g.value,
180
- "onUpdate:modelValue": E[0] || (E[0] = (N) => g.value = N),
200
+ return (s, r) => {
201
+ const R = Ue("loading");
202
+ return o(), v(t(Qe), g({
203
+ modelValue: f.value,
204
+ "onUpdate:modelValue": r[0] || (r[0] = (K) => f.value = K),
181
205
  class: "ez-dialog",
182
206
  width: 800,
183
207
  "append-to-body": !1,
184
208
  "close-on-click-modal": !1,
185
209
  "destroy-on-close": !0,
186
210
  "close-on-press-escape": !1
187
- }, l(V)), {
188
- header: b(() => [
189
- d.$slots.header ? R(d.$slots, "header", { key: 0 }) : (r(), w("p", Cl, Y(s.title), 1))
211
+ }, t(n)), {
212
+ header: y(() => [
213
+ s.$slots.header ? C(s.$slots, "header", { key: 0 }) : (o(), V("p", Al, Y(i.title), 1))
190
214
  ]),
191
- default: b(() => [
192
- Se((r(), p(l(Ke), null, {
193
- default: b(() => [
194
- d.$slots.default ? (r(), w("div", kl, [
195
- R(d.$slots, "default")
196
- ])) : A("", !0)
197
- ]),
198
- _: 3
199
- })), [
200
- [L, s.loading]
201
- ])
215
+ default: y(() => [
216
+ s.$slots.default ? Pe((o(), V("div", Dl, [
217
+ C(s.$slots, "default")
218
+ ])), [
219
+ [R, i.loading]
220
+ ]) : D("", !0)
202
221
  ]),
203
- footer: b(() => [
204
- d.$slots.footer ? R(d.$slots, "footer", { key: 0 }) : (r(), w("div", zl, [
205
- s.cancelText ? (r(), p(l(te), {
222
+ footer: y(() => [
223
+ s.$slots.footer ? C(s.$slots, "footer", { key: 0 }) : (o(), V("div", Tl, [
224
+ i.cancelText ? (o(), v(t(te), {
206
225
  key: 0,
207
226
  type: "default",
208
- onClick: u
227
+ onClick: m
209
228
  }, {
210
- default: b(() => [
211
- le(Y(s.cancelText === l(re).CANCEL ? l(o)("s.button.cancel") : s.cancelText), 1)
229
+ default: y(() => [
230
+ _(Y(i.cancelText === t(re).CANCEL ? t(l)("s.button.cancel") : i.cancelText), 1)
212
231
  ]),
213
232
  _: 1
214
- })) : A("", !0),
215
- s.confirmText ? (r(), p(l(te), {
233
+ })) : D("", !0),
234
+ i.confirmText ? (o(), v(t(te), {
216
235
  key: 1,
217
236
  type: "primary",
218
- loading: s.loading,
219
- onClick: _
237
+ loading: i.loading,
238
+ onClick: d
220
239
  }, {
221
- default: b(() => [
222
- le(Y(s.confirmText === l(re).CONFIRM ? l(o)("s.button.confirm") : s.confirmText), 1)
240
+ default: y(() => [
241
+ _(Y(i.confirmText === t(re).CONFIRM ? t(l)("s.button.confirm") : i.confirmText), 1)
223
242
  ]),
224
243
  _: 1
225
- }, 8, ["loading"])) : A("", !0)
244
+ }, 8, ["loading"])) : D("", !0)
226
245
  ]))
227
246
  ]),
228
247
  _: 3
229
248
  }, 16, ["modelValue"]);
230
249
  };
231
250
  }
232
- }), Al = F(Sl), Ul = $({ name: "EzSelect", inheritAttrs: !1 }), Rl = /* @__PURE__ */ $({
251
+ }), Ml = G(xl), Ul = w({ name: "EzSelect", inheritAttrs: !1 }), Pl = /* @__PURE__ */ w({
233
252
  ...Ul,
234
- props: /* @__PURE__ */ I({
253
+ props: /* @__PURE__ */ F({
235
254
  options: { default: () => [] }
236
255
  }, {
237
256
  modelValue: {},
238
257
  modelModifiers: {}
239
258
  }),
240
259
  emits: ["update:modelValue"],
241
- setup(t) {
242
- const m = t, o = P(t, "modelValue"), s = (a) => typeof a > "u", f = (a) => !s(a.options), g = (a, V) => a.value != null && typeof a.value != "object" ? String(a.value) : V;
243
- return (a, V) => (r(), p(l(Xe), h({
244
- modelValue: o.value,
245
- "onUpdate:modelValue": V[0] || (V[0] = (u) => o.value = u),
260
+ setup(e) {
261
+ const c = L(e, "modelValue"), { attrs: l } = oe(["options", "modelValue"]), i = (n) => typeof n > "u", a = (n) => !i(n.options), f = (n, m) => n.value != null && typeof n.value != "object" ? String(n.value) : m;
262
+ return (n, m) => (o(), v(t(_e), g({
263
+ modelValue: c.value,
264
+ "onUpdate:modelValue": m[0] || (m[0] = (d) => c.value = d),
246
265
  clearable: ""
247
- }, a.$attrs), {
248
- default: b(() => [
249
- (r(!0), w(O, null, W(m.options, (u, _) => (r(), w(O, {
250
- key: g(u, _)
266
+ }, t(l)), {
267
+ default: y(() => [
268
+ (o(!0), V(P, null, W(e.options, (d, s) => (o(), V(P, {
269
+ key: f(d, s)
251
270
  }, [
252
- f(u) ? (r(), p(l(Ye), h({
271
+ a(d) ? (o(), v(t(el), g({
253
272
  key: 0,
254
273
  ref_for: !0
255
- }, u), {
256
- default: b(() => [
257
- (r(!0), w(O, null, W(u.options, (d) => (r(), p(l(be), h({
258
- key: g(d, d.value)
259
- }, { ref_for: !0 }, d), null, 16))), 128))
274
+ }, d), {
275
+ default: y(() => [
276
+ (o(!0), V(P, null, W(d.options, (r) => (o(), v(t($e), g({
277
+ key: f(r, r.value)
278
+ }, { ref_for: !0 }, r), null, 16))), 128))
260
279
  ]),
261
280
  _: 2
262
- }, 1040)) : (r(), p(l(be), h({
281
+ }, 1040)) : (o(), v(t($e), g({
263
282
  key: 1,
264
283
  ref_for: !0
265
- }, u), null, 16))
284
+ }, d), null, 16))
266
285
  ], 64))), 128))
267
286
  ]),
268
287
  _: 1
269
288
  }, 16, ["modelValue"]));
270
289
  }
271
- }), De = F(Rl), Dl = $({ name: "EzRadio", inheritAttrs: !1 }), xl = /* @__PURE__ */ $({
272
- ...Dl,
273
- props: /* @__PURE__ */ I({
290
+ }), Ie = G(Pl), Ll = w({ name: "EzRadio", inheritAttrs: !1 }), Nl = /* @__PURE__ */ w({
291
+ ...Ll,
292
+ props: /* @__PURE__ */ F({
274
293
  type: { default: "default" },
275
294
  options: { default: () => [] }
276
295
  }, {
277
296
  modelValue: { type: [String, Number, Boolean] },
278
297
  modelModifiers: {}
279
298
  }),
280
- emits: /* @__PURE__ */ I(["change"], ["update:modelValue"]),
281
- setup(t, { emit: m }) {
282
- const o = t, s = m, f = P(t, "modelValue"), g = J(), a = Z(g), V = M(() => ["default", "border"].includes(o.type) ? Je : Ze), u = (_) => {
283
- s("change", _);
284
- };
285
- return (_, d) => (r(), p(l(Qe), h({
286
- modelValue: f.value,
287
- "onUpdate:modelValue": d[0] || (d[0] = (E) => f.value = E)
288
- }, l(a), { onChange: u }), {
289
- default: b(() => [
290
- (r(!0), w(O, null, W(t.options, (E) => (r(), p(ce(V.value), h({
291
- key: String(E.value),
299
+ emits: ["update:modelValue"],
300
+ setup(e) {
301
+ const c = e, l = L(e, "modelValue"), { attrs: i } = oe(["options", "type", "modelValue"]), a = T(() => ["default", "border"].includes(c.type) ? ll : tl);
302
+ return (f, n) => (o(), v(t(al), g({
303
+ modelValue: l.value,
304
+ "onUpdate:modelValue": n[0] || (n[0] = (m) => l.value = m)
305
+ }, t(i)), {
306
+ default: y(() => [
307
+ (o(!0), V(P, null, W(e.options, (m) => (o(), v(ge(a.value), g({
308
+ key: String(m.value),
292
309
  ref_for: !0
293
- }, E, {
294
- border: t.type === "border"
310
+ }, m, {
311
+ border: e.type === "border"
295
312
  }), {
296
- default: b(() => [
297
- le(Y(E.label), 1)
313
+ default: y(() => [
314
+ _(Y(m.label), 1)
298
315
  ]),
299
316
  _: 2
300
317
  }, 1040, ["border"]))), 128))
@@ -302,136 +319,136 @@ const Cl = { key: 1 }, kl = {
302
319
  _: 1
303
320
  }, 16, ["modelValue"]));
304
321
  }
305
- }), xe = F(xl), Ml = $({ name: "EzIcon", inheritAttrs: !1 }), Pl = /* @__PURE__ */ $({
306
- ...Ml,
322
+ }), Oe = G(Nl), Bl = w({ name: "EzIcon", inheritAttrs: !1 }), Il = /* @__PURE__ */ w({
323
+ ...Bl,
307
324
  props: {
308
325
  size: { default: 20 },
309
326
  color: { default: "inherit" }
310
327
  },
311
- setup(t) {
312
- const m = t, o = M(() => {
313
- const { size: s, color: f } = m;
314
- return !s && !f ? {} : {
315
- fontSize: s ? `${s}px` : void 0,
316
- color: f
328
+ setup(e) {
329
+ const c = e, l = T(() => {
330
+ const { size: i, color: a } = c;
331
+ return !i && !a ? {} : {
332
+ fontSize: i ? `${i}px` : void 0,
333
+ color: a
317
334
  };
318
335
  });
319
- return (s, f) => (r(), w("i", h({
336
+ return (i, a) => (o(), V("i", g({
320
337
  class: "ez-icon",
321
- style: o.value
322
- }, s.$attrs), [
323
- R(s.$slots, "default", { class: "w-[1em] h-[1em]" })
338
+ style: l.value
339
+ }, i.$attrs), [
340
+ C(i.$slots, "default", { class: "w-[1em] h-[1em]" })
324
341
  ], 16));
325
342
  }
326
- }), ee = F(Pl), Il = {
343
+ }), Q = G(Il), Ol = {
327
344
  xmlns: "http://www.w3.org/2000/svg",
328
345
  width: "200",
329
346
  height: "200",
330
347
  viewBox: "0 0 1024 1024"
331
- }, Ll = /* @__PURE__ */ $({
348
+ }, ql = /* @__PURE__ */ w({
332
349
  name: "ArrowDown",
333
350
  __name: "ArrowDown",
334
- setup(t) {
335
- return (m, o) => (r(), w("svg", Il, [...o[0] || (o[0] = [
336
- D("path", {
351
+ setup(e) {
352
+ return (c, l) => (o(), V("svg", Ol, [...l[0] || (l[0] = [
353
+ N("path", {
337
354
  fill: "currentColor",
338
355
  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"
339
356
  }, null, -1)
340
357
  ])]));
341
358
  }
342
- }), Nl = {
359
+ }), Fl = {
343
360
  xmlns: "http://www.w3.org/2000/svg",
344
361
  width: "200",
345
362
  height: "200",
346
363
  viewBox: "0 0 1024 1024"
347
- }, Bl = /* @__PURE__ */ $({
364
+ }, Gl = /* @__PURE__ */ w({
348
365
  name: "ArrowUp",
349
366
  __name: "ArrowUp",
350
- setup(t) {
351
- return (m, o) => (r(), w("svg", Nl, [...o[0] || (o[0] = [
352
- D("path", {
367
+ setup(e) {
368
+ return (c, l) => (o(), V("svg", Fl, [...l[0] || (l[0] = [
369
+ N("path", {
353
370
  fill: "currentColor",
354
371
  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"
355
372
  }, null, -1)
356
373
  ])]));
357
374
  }
358
- }), Ol = {
375
+ }), Hl = {
359
376
  xmlns: "http://www.w3.org/2000/svg",
360
377
  width: "200",
361
378
  height: "200",
362
379
  viewBox: "0 0 1024 1024"
363
- }, $e = /* @__PURE__ */ $({
380
+ }, De = /* @__PURE__ */ w({
364
381
  name: "Delete",
365
382
  __name: "delete",
366
- setup(t) {
367
- return (m, o) => (r(), w("svg", Ol, [...o[0] || (o[0] = [
368
- D("path", {
383
+ setup(e) {
384
+ return (c, l) => (o(), V("svg", Hl, [...l[0] || (l[0] = [
385
+ N("path", {
369
386
  fill: "currentColor",
370
387
  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"
371
388
  }, null, -1)
372
389
  ])]));
373
390
  }
374
- }), Hl = {
391
+ }), jl = {
375
392
  xmlns: "http://www.w3.org/2000/svg",
376
393
  width: "200",
377
394
  height: "200",
378
395
  viewBox: "0 0 1024 1024"
379
- }, Ce = /* @__PURE__ */ $({
396
+ }, Te = /* @__PURE__ */ w({
380
397
  name: "Plus",
381
398
  __name: "plus",
382
- setup(t) {
383
- return (m, o) => (r(), w("svg", Hl, [...o[0] || (o[0] = [
384
- D("path", {
399
+ setup(e) {
400
+ return (c, l) => (o(), V("svg", jl, [...l[0] || (l[0] = [
401
+ N("path", {
385
402
  fill: "currentColor",
386
403
  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"
387
404
  }, null, -1)
388
405
  ])]));
389
406
  }
390
- }), ql = {
407
+ }), Wl = {
391
408
  xmlns: "http://www.w3.org/2000/svg",
392
409
  width: "200",
393
410
  height: "200",
394
411
  viewBox: "0 0 1024 1024"
395
- }, Fl = /* @__PURE__ */ $({
412
+ }, Kl = /* @__PURE__ */ w({
396
413
  name: "Setting",
397
414
  __name: "setting",
398
- setup(t) {
399
- return (m, o) => (r(), w("svg", ql, [...o[0] || (o[0] = [
400
- D("path", {
415
+ setup(e) {
416
+ return (c, l) => (o(), V("svg", Wl, [...l[0] || (l[0] = [
417
+ N("path", {
401
418
  fill: "currentColor",
402
419
  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"
403
420
  }, null, -1)
404
421
  ])]));
405
422
  }
406
- }), Gl = {
423
+ }), Yl = {
407
424
  xmlns: "http://www.w3.org/2000/svg",
408
425
  width: "200",
409
426
  height: "200",
410
427
  viewBox: "0 0 1024 1024"
411
- }, ke = /* @__PURE__ */ $({
428
+ }, Re = /* @__PURE__ */ w({
412
429
  name: "ZoomIn",
413
430
  __name: "ZoomIn",
414
- setup(t) {
415
- return (m, o) => (r(), w("svg", Gl, [...o[0] || (o[0] = [
416
- D("path", {
431
+ setup(e) {
432
+ return (c, l) => (o(), V("svg", Yl, [...l[0] || (l[0] = [
433
+ N("path", {
417
434
  fill: "currentColor",
418
435
  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"
419
436
  }, null, -1),
420
- D("path", {
437
+ N("path", {
421
438
  fill: "currentColor",
422
439
  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"
423
440
  }, null, -1)
424
441
  ])]));
425
442
  }
426
- }), jl = { class: "ez-image-upload" }, Wl = {
443
+ }), Xl = { class: "ez-image-upload" }, Zl = {
427
444
  key: 0,
428
445
  class: "ez-image-upload__image"
429
- }, Kl = {
446
+ }, Jl = {
430
447
  key: 1,
431
448
  class: "ez-image-upload__list"
432
- }, Xl = { class: "flex items-center justify-center h-full" }, Yl = $({ name: "EzImageUpload", inheritAttrs: !1 }), Jl = /* @__PURE__ */ $({
433
- ...Yl,
434
- props: /* @__PURE__ */ I({
449
+ }, Ql = { class: "flex items-center justify-center h-full" }, _l = w({ name: "EzImageUpload", inheritAttrs: !1 }), et = /* @__PURE__ */ w({
450
+ ..._l,
451
+ props: /* @__PURE__ */ F({
435
452
  api: { type: Function, default: () => Promise.resolve({ url: "" }) },
436
453
  imageTypes: { default: () => ["image/webp", "image/png", "image/jpg", "image/gif", "image/bmp", "image/jpeg"] },
437
454
  limitSize: { default: 10 },
@@ -445,566 +462,739 @@ const Cl = { key: 1 }, kl = {
445
462
  modelModifiers: {}
446
463
  }),
447
464
  emits: ["update:modelValue"],
448
- setup(t, { expose: m }) {
449
- const o = t, s = J(), f = Z(s), { t: g } = se(), a = x(!1), V = x(0), u = P(t, "modelValue"), _ = M(() => o.multiple), d = /^(https?:\/\/|data:|blob:)/i, E = M(() => u.value ? L(u.value) : []);
450
- function L(C) {
451
- if (!C) return [];
452
- const i = /^(https?:\/\/|data:|blob:)/i;
453
- let k = [], z = "", H = !1;
454
- C = C.trim().replace(/,$/, "");
455
- const ae = C.split(",");
456
- for (let q = 0; q < ae.length; q++) {
457
- const G = ae[q].trim();
458
- G && (i.test(G) ? (H && z && k.push(z.trim()), z = G, H = !0) : H ? z += "," + G : i.test(G.trim()) && k.push(G.trim()));
465
+ setup(e, { expose: c }) {
466
+ const l = e, { attrs: i } = oe([
467
+ "api",
468
+ "imageTypes",
469
+ "limitSize",
470
+ "style",
471
+ "fit",
472
+ "multiple",
473
+ "limit",
474
+ "disabled",
475
+ "modelValue"
476
+ ]), { t: a } = ue(), f = O(!1), n = O(0), m = L(e, "modelValue"), d = T(() => l.multiple), s = /^(https?:\/\/|data:|blob:)/i, r = T(() => m.value ? R(m.value) : []);
477
+ function R($) {
478
+ if (!$) return [];
479
+ const E = /^(https?:\/\/|data:|blob:)/i;
480
+ let z = [], U = "", B = !1;
481
+ $ = $.trim().replace(/,$/, "");
482
+ const ee = $.split(",");
483
+ for (let u = 0; u < ee.length; u++) {
484
+ const k = ee[u].trim();
485
+ k && (E.test(k) ? (B && U && z.push(U.trim()), U = k, B = !0) : B ? U += "," + k : E.test(k.trim()) && z.push(k.trim()));
459
486
  }
460
- return H && z && k.push(z.trim()), k.filter((q) => q && i.test(q));
487
+ return B && U && z.push(U.trim()), z.filter((u) => u && E.test(u));
461
488
  }
462
- function N(C) {
463
- return !C || C.length === 0 ? "" : C.filter((i) => i.trim()).map((i) => i.trim()).join(",");
489
+ function K($) {
490
+ return !$ || $.length === 0 ? "" : $.filter((E) => E.trim()).map((E) => E.trim()).join(",");
464
491
  }
465
- const B = (C) => o.disabled ? (oe.warning(g("s.message.disabled")), !1) : o.imageTypes.includes(C.type.toLocaleLowerCase()) ? C.size > o.limitSize * 1024 * 1024 ? (oe.error(g("s.validate.upload.limit", { max: o.limitSize })), !1) : !0 : (oe.error(g("s.validate.upload.image")), !1), j = async ({ file: C }) => {
466
- if (!o.disabled)
492
+ const H = ($) => l.disabled ? (se.warning(a("s.message.disabled")), !1) : l.imageTypes.includes($.type.toLocaleLowerCase()) ? $.size > l.limitSize * 1024 * 1024 ? (se.error(a("s.validate.upload.limit", { max: l.limitSize })), !1) : !0 : (se.error(a("s.validate.upload.image")), !1), j = async ({ file: $ }) => {
493
+ if (!l.disabled)
467
494
  try {
468
- const { url: i } = await o.api(C);
469
- if (!i) throw new Error(g("s.message.uploadFail"));
470
- if (_.value) {
471
- const k = u.value ? L(u.value) : [];
472
- i && d.test(i) && (k.push(i), u.value = N(k));
495
+ const { url: E } = await l.api($);
496
+ if (!E) throw new Error(a("s.message.uploadFail"));
497
+ if (d.value) {
498
+ const z = m.value ? R(m.value) : [];
499
+ E && s.test(E) && (z.push(E), m.value = K(z));
473
500
  } else
474
- u.value = i;
475
- } catch (i) {
476
- oe.error(i.message);
501
+ m.value = E;
502
+ } catch (E) {
503
+ se.error(E.message);
477
504
  }
478
- }, K = (C, i = 0) => {
479
- C && (V.value = i, a.value = !0);
480
- }, X = (C) => {
481
- if (!o.disabled && !(!C || !u.value))
482
- if (_.value) {
483
- const i = L(u.value), k = i.findIndex((z) => z === C);
484
- k !== -1 && (i.splice(k, 1), u.value = i.join(","));
505
+ }, X = ($, E = 0) => {
506
+ $ && (n.value = E, f.value = !0);
507
+ }, Z = ($) => {
508
+ if (!l.disabled && !(!$ || !m.value))
509
+ if (d.value) {
510
+ const E = R(m.value), z = E.findIndex((U) => U === $);
511
+ z !== -1 && (E.splice(z, 1), m.value = E.join(","));
485
512
  } else
486
- u.value = null;
487
- }, T = x();
488
- return m({
489
- getUploadRef: () => T.value,
490
- getUrlList: () => E.value
491
- }), (C, i) => (r(), w("div", jl, [
492
- _.value ? (r(), w("div", Kl, [
493
- (r(!0), w(O, null, W(E.value, (k, z) => (r(), w("div", {
494
- key: z,
513
+ m.value = null;
514
+ }, J = O();
515
+ return c({
516
+ getUploadRef: () => J.value,
517
+ getUrlList: () => r.value
518
+ }), ($, E) => (o(), V("div", Xl, [
519
+ d.value ? (o(), V("div", Jl, [
520
+ (o(!0), V(P, null, W(r.value, (z, U) => (o(), V("div", {
521
+ key: U,
495
522
  class: "ez-image-upload__item",
496
- style: Ae(o.style)
523
+ style: ie(l.style)
497
524
  }, [
498
- S(l(_e), {
499
- src: k,
500
- fit: o.fit
525
+ M(t(we), {
526
+ src: z,
527
+ fit: l.fit
501
528
  }, null, 8, ["src", "fit"]),
502
- D("div", {
529
+ N("div", {
503
530
  class: "ez-image-upload__handler",
504
- onClick: i[3] || (i[3] = ge(() => {
531
+ onClick: E[3] || (E[3] = Ve(() => {
505
532
  }, ["stop"]))
506
533
  }, [
507
- S(l(ee), {
534
+ M(t(Q), {
508
535
  size: 18,
509
- onClick: (H) => K(k, z)
536
+ onClick: (B) => X(z, U)
510
537
  }, {
511
- default: b(() => [
512
- S(l(ke))
538
+ default: y(() => [
539
+ M(t(Re))
513
540
  ]),
514
541
  _: 1
515
542
  }, 8, ["onClick"]),
516
- o.disabled ? A("", !0) : (r(), p(l(ee), {
543
+ l.disabled ? D("", !0) : (o(), v(t(Q), {
517
544
  key: 0,
518
545
  size: 18,
519
- onClick: (H) => X(k)
546
+ onClick: (B) => Z(z)
520
547
  }, {
521
- default: b(() => [
522
- S(l($e))
548
+ default: y(() => [
549
+ M(t(De))
523
550
  ]),
524
551
  _: 1
525
552
  }, 8, ["onClick"]))
526
553
  ])
527
554
  ], 4))), 128)),
528
- E.value.length < o.limit && !o.disabled || E.value.length === 0 ? (r(), p(l(ye), h({ key: 0 }, l(f), {
555
+ r.value.length < l.limit && !l.disabled || r.value.length === 0 ? (o(), v(t(ke), g({ key: 0 }, t(i), {
529
556
  ref_key: "uploadRef",
530
- ref: T,
557
+ ref: J,
531
558
  action: "",
532
559
  accept: "image/*",
533
560
  "show-file-list": !1,
534
- "before-upload": B,
561
+ "before-upload": H,
535
562
  "http-request": j,
536
- style: o.style,
537
- disabled: o.disabled,
538
- class: [{ "is-disabled": o.disabled }, "ez-image-upload__item ez-image-upload__button"]
563
+ style: l.style,
564
+ disabled: l.disabled,
565
+ class: [{ "is-disabled": l.disabled }, "ez-image-upload__item ez-image-upload__button"]
539
566
  }), {
540
- default: b(() => [
541
- D("div", Xl, [
542
- S(l(ee), null, {
543
- default: b(() => [
544
- S(l(Ce))
567
+ default: y(() => [
568
+ N("div", Ql, [
569
+ M(t(Q), null, {
570
+ default: y(() => [
571
+ M(t(Te))
545
572
  ]),
546
573
  _: 1
547
574
  })
548
575
  ])
549
576
  ]),
550
577
  _: 1
551
- }, 16, ["style", "disabled", "class"])) : A("", !0)
552
- ])) : (r(), p(l(ye), h({ key: 0 }, l(f), {
578
+ }, 16, ["style", "disabled", "class"])) : D("", !0)
579
+ ])) : (o(), v(t(ke), g({ key: 0 }, t(i), {
553
580
  ref_key: "uploadRef",
554
- ref: T,
581
+ ref: J,
555
582
  action: "",
556
583
  accept: "image/*",
557
584
  "show-file-list": !1,
558
- "before-upload": B,
585
+ "before-upload": H,
559
586
  "http-request": j,
560
- style: o.style,
561
- disabled: o.disabled,
562
- class: ["ez-image-upload__wrapper", { "is-disabled": o.disabled }]
587
+ style: l.style,
588
+ disabled: l.disabled,
589
+ class: ["ez-image-upload__wrapper", { "is-disabled": l.disabled }]
563
590
  }), {
564
- default: b(() => [
565
- u.value ? (r(), w("div", Wl, [
566
- S(l(_e), {
567
- src: u.value,
568
- fit: o.fit
591
+ default: y(() => [
592
+ m.value ? (o(), V("div", Zl, [
593
+ M(t(we), {
594
+ src: m.value,
595
+ fit: l.fit
569
596
  }, null, 8, ["src", "fit"]),
570
- D("div", {
597
+ N("div", {
571
598
  class: "ez-image-upload__handler",
572
- onClick: i[2] || (i[2] = ge(() => {
599
+ onClick: E[2] || (E[2] = Ve(() => {
573
600
  }, ["stop"]))
574
601
  }, [
575
- S(l(ee), {
602
+ M(t(Q), {
576
603
  size: 18,
577
- onClick: i[0] || (i[0] = (k) => K(u.value, 0))
604
+ onClick: E[0] || (E[0] = (z) => X(m.value, 0))
578
605
  }, {
579
- default: b(() => [
580
- S(l(ke))
606
+ default: y(() => [
607
+ M(t(Re))
581
608
  ]),
582
609
  _: 1
583
610
  }),
584
- o.disabled ? A("", !0) : (r(), p(l(ee), {
611
+ l.disabled ? D("", !0) : (o(), v(t(Q), {
585
612
  key: 0,
586
613
  size: 18,
587
- onClick: i[1] || (i[1] = (k) => X(u.value))
614
+ onClick: E[1] || (E[1] = (z) => Z(m.value))
588
615
  }, {
589
- default: b(() => [
590
- S(l($e))
616
+ default: y(() => [
617
+ M(t(De))
591
618
  ]),
592
619
  _: 1
593
620
  }))
594
621
  ])
595
- ])) : (r(), p(l(ee), { key: 1 }, {
596
- default: b(() => [
597
- S(l(Ce))
622
+ ])) : (o(), v(t(Q), { key: 1 }, {
623
+ default: y(() => [
624
+ M(t(Te))
598
625
  ]),
599
626
  _: 1
600
627
  }))
601
628
  ]),
602
629
  _: 1
603
630
  }, 16, ["style", "disabled", "class"])),
604
- a.value ? (r(), p(l(el), {
631
+ f.value ? (o(), v(t(ol), {
605
632
  key: 2,
606
- "url-list": _.value ? E.value : [u.value],
607
- "initial-index": V.value,
608
- onClose: i[4] || (i[4] = (k) => a.value = !1)
609
- }, null, 8, ["url-list", "initial-index"])) : A("", !0)
633
+ "url-list": d.value ? r.value : [m.value],
634
+ "initial-index": n.value,
635
+ onClose: E[4] || (E[4] = (z) => f.value = !1)
636
+ }, null, 8, ["url-list", "initial-index"])) : D("", !0)
610
637
  ]));
611
638
  }
612
- }), Me = F(Jl);
613
- var c = /* @__PURE__ */ ((t) => (t.INPUT = "input", t.TEXTAREA = "textarea", t.NUMBER = "number", t.PASSWORD = "password", t.SELECT = "select", t.RADIO = "radio", t.CHECKBOX = "checkbox", t.DATE = "date", t.DATETIME = "datetime", t.DATERANGE = "daterange", t.DATETIMERANGE = "datetimerange", t.TIME = "time", t.TIMERANGE = "timerange", t.UPLOAD_IMAGES = "upload-images", t.SWITCH = "switch", t.TREE_SELECT = "tree-select", t.CASCADER = "cascader", t.TREE = "tree", t.SLIDER = "slider", t.RATE = "rate", t))(c || {});
614
- const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */ $({
615
- ...Zl,
616
- props: {
639
+ }), qe = G(et);
640
+ var A = /* @__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))(A || {});
641
+ const lt = /* @__PURE__ */ new Set([
642
+ "select",
643
+ "radio",
644
+ "checkbox",
645
+ "date",
646
+ "datetime",
647
+ "daterange",
648
+ "datetimerange",
649
+ "time",
650
+ "timerange",
651
+ "switch",
652
+ "cascader",
653
+ "tree",
654
+ "tree-select"
655
+ /* TREE_SELECT */
656
+ ]), tt = /* @__PURE__ */ new Set([
657
+ "select",
658
+ "radio",
659
+ "checkbox",
660
+ "date",
661
+ "datetime",
662
+ "daterange",
663
+ "datetimerange",
664
+ "time",
665
+ "timerange",
666
+ "switch",
667
+ "cascader",
668
+ "tree",
669
+ "tree-select",
670
+ "slider",
671
+ "rate"
672
+ /* RATE */
673
+ ]);
674
+ function at(e) {
675
+ return e && lt.has(e) ? "选择" : "输入";
676
+ }
677
+ function ot(e) {
678
+ return e && tt.has(e) ? "change" : "blur";
679
+ }
680
+ const nt = w({ name: "EzFormItem" }), pe = /* @__PURE__ */ w({
681
+ ...nt,
682
+ props: /* @__PURE__ */ F({
683
+ config: {},
684
+ formData: { default: () => ({}) }
685
+ }, {
686
+ modelValue: {},
687
+ modelModifiers: {}
688
+ }),
689
+ emits: ["update:modelValue"],
690
+ setup(e) {
691
+ const c = e, l = L(e, "modelValue"), i = T(() => c.config?.itemAttrs && typeof c.config.itemAttrs == "object" ? c.config.itemAttrs : {}), a = T(() => c.config?.attrs && typeof c.config.attrs == "object" ? c.config.attrs : {}), f = T(() => c.config?.options && Array.isArray(c.config.options) ? c.config.options : []), n = /* @__PURE__ */ new WeakMap(), m = () => {
692
+ const { config: d } = c;
693
+ if (!d || typeof d != "object") return;
694
+ if (n.has(d))
695
+ return n.get(d);
696
+ let s;
697
+ return d.rules ? s = d.rules : d.required && (s = [{ required: !0, message: d.requiredMessage || `请${at(d.type)}${d.label || ""}`, trigger: ot(d.type) }]), s !== void 0 && n.set(d, s), s;
698
+ };
699
+ return (d, s) => e.config && e.config.prop ? (o(), v(t(nl), g({
700
+ key: 0,
701
+ prop: e.config.prop,
702
+ label: e.config.label,
703
+ rules: m()
704
+ }, i.value), ae({
705
+ default: y(() => [
706
+ d.$slots.default ? C(d.$slots, "default", {
707
+ key: 0,
708
+ config: e.config,
709
+ value: l.value,
710
+ formData: e.formData
711
+ }) : e.config.component ? (o(), v(ge(e.config.component), g({
712
+ key: 1,
713
+ modelValue: l.value,
714
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => l.value = r),
715
+ disabled: e.config.disabled
716
+ }, a.value), null, 16, ["modelValue", "disabled"])) : (o(), V(P, { key: 2 }, [
717
+ e.config.type === t(A).INPUT || !e.config.type ? (o(), v(t(me), g({
718
+ key: 0,
719
+ modelValue: l.value,
720
+ "onUpdate:modelValue": s[1] || (s[1] = (r) => l.value = r),
721
+ placeholder: e.config.placeholder || `请输入${e.config.label || ""}`,
722
+ disabled: e.config.disabled,
723
+ clearable: ""
724
+ }, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).TEXTAREA ? (o(), v(t(me), g({
725
+ key: 1,
726
+ modelValue: l.value,
727
+ "onUpdate:modelValue": s[2] || (s[2] = (r) => l.value = r),
728
+ type: "textarea",
729
+ placeholder: e.config.placeholder || `请输入${e.config.label || ""}`,
730
+ disabled: e.config.disabled
731
+ }, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).NUMBER ? (o(), v(t(sl), g({
732
+ key: 2,
733
+ modelValue: l.value,
734
+ "onUpdate:modelValue": s[3] || (s[3] = (r) => l.value = r),
735
+ placeholder: e.config.placeholder,
736
+ disabled: e.config.disabled
737
+ }, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).PASSWORD ? (o(), v(t(me), g({
738
+ key: 3,
739
+ modelValue: l.value,
740
+ "onUpdate:modelValue": s[4] || (s[4] = (r) => l.value = r),
741
+ type: "password",
742
+ placeholder: e.config.placeholder || `请输入${e.config.label || ""}`,
743
+ disabled: e.config.disabled,
744
+ "show-password": "",
745
+ clearable: ""
746
+ }, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).SELECT ? (o(), v(t(Ie), g({
747
+ key: 4,
748
+ modelValue: l.value,
749
+ "onUpdate:modelValue": s[5] || (s[5] = (r) => l.value = r),
750
+ options: f.value,
751
+ placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
752
+ disabled: e.config.disabled
753
+ }, a.value), null, 16, ["modelValue", "options", "placeholder", "disabled"])) : e.config.type === t(A).RADIO ? (o(), v(t(Oe), g({
754
+ key: 5,
755
+ modelValue: l.value,
756
+ "onUpdate:modelValue": s[6] || (s[6] = (r) => l.value = r),
757
+ options: f.value,
758
+ disabled: e.config.disabled
759
+ }, a.value), null, 16, ["modelValue", "options", "disabled"])) : e.config.type === t(A).CHECKBOX ? (o(), v(t(Be), g({
760
+ key: 6,
761
+ modelValue: l.value,
762
+ "onUpdate:modelValue": s[7] || (s[7] = (r) => l.value = r),
763
+ options: f.value,
764
+ disabled: e.config.disabled
765
+ }, a.value), null, 16, ["modelValue", "options", "disabled"])) : e.config.type === t(A).DATE ? (o(), v(t(de), g({
766
+ key: 7,
767
+ modelValue: l.value,
768
+ "onUpdate:modelValue": s[8] || (s[8] = (r) => l.value = r),
769
+ type: "date",
770
+ placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
771
+ disabled: e.config.disabled
772
+ }, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).DATETIME ? (o(), v(t(de), g({
773
+ key: 8,
774
+ modelValue: l.value,
775
+ "onUpdate:modelValue": s[9] || (s[9] = (r) => l.value = r),
776
+ type: "datetime",
777
+ placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
778
+ disabled: e.config.disabled
779
+ }, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).DATERANGE ? (o(), v(t(de), g({
780
+ key: 9,
781
+ modelValue: l.value,
782
+ "onUpdate:modelValue": s[10] || (s[10] = (r) => l.value = r),
783
+ type: "daterange",
784
+ "range-separator": "至",
785
+ "start-placeholder": "开始日期",
786
+ "end-placeholder": "结束日期",
787
+ disabled: e.config.disabled
788
+ }, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).DATETIMERANGE ? (o(), v(t(de), g({
789
+ key: 10,
790
+ modelValue: l.value,
791
+ "onUpdate:modelValue": s[11] || (s[11] = (r) => l.value = r),
792
+ type: "datetimerange",
793
+ "range-separator": "至",
794
+ "start-placeholder": "开始时间",
795
+ "end-placeholder": "结束时间",
796
+ disabled: e.config.disabled
797
+ }, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).TIME ? (o(), v(t(Se), g({
798
+ key: 11,
799
+ modelValue: l.value,
800
+ "onUpdate:modelValue": s[12] || (s[12] = (r) => l.value = r),
801
+ placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
802
+ disabled: e.config.disabled
803
+ }, a.value), null, 16, ["modelValue", "placeholder", "disabled"])) : e.config.type === t(A).TIMERANGE ? (o(), v(t(Se), g({
804
+ key: 12,
805
+ modelValue: l.value,
806
+ "onUpdate:modelValue": s[13] || (s[13] = (r) => l.value = r),
807
+ "is-range": "",
808
+ "range-separator": "至",
809
+ "start-placeholder": "开始时间",
810
+ "end-placeholder": "结束时间",
811
+ disabled: e.config.disabled
812
+ }, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).SWITCH ? (o(), v(t(rl), g({
813
+ key: 13,
814
+ modelValue: l.value,
815
+ "onUpdate:modelValue": s[14] || (s[14] = (r) => l.value = r),
816
+ disabled: e.config.disabled
817
+ }, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).TREE_SELECT ? (o(), v(t(il), g({
818
+ key: 14,
819
+ modelValue: l.value,
820
+ "onUpdate:modelValue": s[15] || (s[15] = (r) => l.value = r),
821
+ data: f.value,
822
+ placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
823
+ disabled: e.config.disabled
824
+ }, a.value), null, 16, ["modelValue", "data", "placeholder", "disabled"])) : e.config.type === t(A).CASCADER ? (o(), v(t(ul), g({
825
+ key: 15,
826
+ modelValue: l.value,
827
+ "onUpdate:modelValue": s[16] || (s[16] = (r) => l.value = r),
828
+ options: f.value,
829
+ placeholder: e.config.placeholder || `请选择${e.config.label || ""}`,
830
+ disabled: e.config.disabled,
831
+ clearable: ""
832
+ }, a.value), null, 16, ["modelValue", "options", "placeholder", "disabled"])) : e.config.type === t(A).TREE ? (o(), v(t(dl), g({
833
+ key: 16,
834
+ modelValue: l.value,
835
+ "onUpdate:modelValue": s[17] || (s[17] = (r) => l.value = r),
836
+ data: f.value,
837
+ "show-checkbox": "",
838
+ "node-key": "id"
839
+ }, a.value), null, 16, ["modelValue", "data"])) : e.config.type === t(A).SLIDER ? (o(), v(t(cl), g({
840
+ key: 17,
841
+ modelValue: l.value,
842
+ "onUpdate:modelValue": s[18] || (s[18] = (r) => l.value = r),
843
+ disabled: e.config.disabled
844
+ }, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).RATE ? (o(), v(t(fl), g({
845
+ key: 18,
846
+ modelValue: l.value,
847
+ "onUpdate:modelValue": s[19] || (s[19] = (r) => l.value = r),
848
+ disabled: e.config.disabled
849
+ }, a.value), null, 16, ["modelValue", "disabled"])) : e.config.type === t(A).UPLOAD_IMAGES && a.value.api ? (o(), v(t(qe), g({
850
+ key: 19,
851
+ modelValue: l.value,
852
+ "onUpdate:modelValue": s[20] || (s[20] = (r) => l.value = r),
853
+ api: a.value.api,
854
+ disabled: e.config.disabled
855
+ }, a.value), null, 16, ["modelValue", "api", "disabled"])) : D("", !0)
856
+ ], 64))
857
+ ]),
858
+ _: 2
859
+ }, [
860
+ d.$slots.label ? {
861
+ name: "label",
862
+ fn: y(() => [
863
+ C(d.$slots, "label", { config: e.config })
864
+ ]),
865
+ key: "0"
866
+ } : void 0
867
+ ]), 1040, ["prop", "label", "rules"])) : D("", !0);
868
+ }
869
+ }), st = {
870
+ key: 0,
871
+ class: "ez-dynamic-form-group__title"
872
+ }, rt = {
873
+ key: 1,
874
+ class: "ez-dynamic-form-group__description"
875
+ }, it = w({ name: "EzDynamicForm", inheritAttrs: !1 }), ut = /* @__PURE__ */ w({
876
+ ...it,
877
+ props: /* @__PURE__ */ F({
617
878
  items: { default: () => [] },
879
+ groups: { default: () => [] },
618
880
  modelValue: {},
619
881
  cols: { default: 1 },
620
882
  gutter: { default: 20 },
621
- formProps: {}
622
- },
883
+ disabled: { type: Boolean },
884
+ labelPosition: {},
885
+ requireAsteriskPosition: {},
886
+ labelWidth: {},
887
+ labelSuffix: {},
888
+ inline: { type: Boolean },
889
+ inlineMessage: { type: Boolean },
890
+ statusIcon: { type: Boolean },
891
+ validateOnRuleChange: { type: Boolean },
892
+ hideRequiredAsterisk: { type: Boolean },
893
+ scrollToError: { type: Boolean },
894
+ scrollIntoViewOptions: {},
895
+ size: {}
896
+ }, {
897
+ modelValue: { default: () => ({}) },
898
+ modelModifiers: {}
899
+ }),
623
900
  emits: ["update:modelValue"],
624
- setup(t, { expose: m, emit: o }) {
625
- const s = t, f = o, g = Be(), a = x({});
626
- let V = !1;
627
- const u = J(), _ = M(() => ({
628
- ...Z(u).value,
629
- ...s.formProps || {}
630
- })), d = () => {
631
- const n = { ...s.modelValue || {} };
632
- for (const y of s.items)
633
- y.defaultValue !== void 0 && !(y.prop in n) && (n[y.prop] = y.defaultValue);
634
- a.value = n;
635
- }, E = M(() => !s.items || s.items.length === 0 ? [] : s.items.filter((n) => {
636
- if (!n.hidden && !n.show) return !0;
637
- if (n.hidden) return !1;
638
- if (n.show)
639
- try {
640
- return n.show(a.value);
641
- } catch (y) {
642
- return console.error(`[EzDynamicForm] Error in show function for field "${n.prop}":`, y), !1;
643
- }
644
- return !0;
645
- })), L = M(() => Math.floor(24 / s.cols)), N = (n) => n.span !== void 0 ? Math.max(1, Math.min(24, n.span)) : L.value, B = /* @__PURE__ */ new WeakMap(), j = (n) => {
646
- if (n.rules) return n.rules;
647
- if (n.required) {
648
- if (B.has(n))
649
- return B.get(n);
650
- const e = [{ required: !0, message: n.requiredMessage || `请${X(n.type)}${n.label || ""}`, trigger: C(n.type) }];
651
- return B.set(n, e), e;
901
+ setup(e, { expose: c }) {
902
+ const l = e, i = je(), a = L(e, "modelValue"), f = We(), n = "__legacy__";
903
+ let m = !1;
904
+ const d = (u) => Object.prototype.toString.call(u) === "[object Object]", s = (u) => u instanceof Date ? new Date(u.getTime()) : Array.isArray(u) ? u.map((k) => s(k)) : d(u) ? Object.fromEntries(Object.entries(u).map(([k, p]) => [k, s(p)])) : u, r = () => {
905
+ d(a.value) || (a.value = {});
906
+ }, R = () => {
907
+ r(), a.value && H.value.forEach((u) => {
908
+ u.prop in a.value || (a.value[u.prop] = u.defaultValue !== void 0 ? u.defaultValue : void 0);
909
+ });
910
+ }, K = T(() => Math.floor(24 / l.cols)), H = T(() => l.groups?.length ? l.groups.flatMap((u) => u.items || []) : l.items || []);
911
+ fe(
912
+ () => [l.items?.length || 0, l.groups?.length || 0],
913
+ ([u, k]) => {
914
+ m || u === 0 || k === 0 || (m = !0, console.warn('[EzDynamicForm] Both "items" and "groups" were provided. "groups" takes precedence and "items" will be ignored.'));
915
+ },
916
+ { immediate: !0 }
917
+ ), fe(() => [l.items, l.groups], R, { deep: !0, immediate: !0 }), fe(a, R, { immediate: !0 }), ye(R);
918
+ const j = (u, k, p) => {
919
+ if (!u) return !0;
920
+ try {
921
+ return u(a.value);
922
+ } catch (b) {
923
+ return console.error(`[EzDynamicForm] ${k} visibility error for "${p}":`, b), !1;
652
924
  }
653
- }, K = /* @__PURE__ */ new Set([
654
- c.SELECT,
655
- c.RADIO,
656
- c.CHECKBOX,
657
- c.DATE,
658
- c.DATETIME,
659
- c.DATERANGE,
660
- c.DATETIMERANGE,
661
- c.TIME,
662
- c.TIMERANGE,
663
- c.SWITCH,
664
- c.CASCADER,
665
- c.TREE,
666
- c.TREE_SELECT
667
- ]), X = (n) => n && K.has(n) ? "选择" : "输入", T = /* @__PURE__ */ new Set([
668
- c.SELECT,
669
- c.RADIO,
670
- c.CHECKBOX,
671
- c.DATE,
672
- c.DATETIME,
673
- c.DATERANGE,
674
- c.DATETIMERANGE,
675
- c.TIME,
676
- c.TIMERANGE,
677
- c.SWITCH,
678
- c.CASCADER,
679
- c.TREE,
680
- c.TREE_SELECT,
681
- c.SLIDER,
682
- c.RATE
683
- ]), C = (n) => n && T.has(n) ? "change" : "blur", i = (n) => {
684
- if (n.disabled) return !0;
685
- if (n.disabledWhen)
925
+ }, X = T(() => {
926
+ const u = Array.isArray(l.groups) && l.groups.length > 0, k = u ? l.groups : [{ name: n, items: l.items || [], cols: l.cols, gutter: l.gutter }], p = [];
927
+ return k.forEach((b, I) => {
928
+ if (!b || b.hidden) return;
929
+ const h = b.name || `group-${I}`;
930
+ if (!j(b.show, "group", h)) return;
931
+ const S = (b.items || []).filter((ne) => ne.hidden ? !1 : j(ne.show, "item", ne.prop)), q = Math.max(1, b.cols || l.cols), x = b.gutter ?? l.gutter, le = b.headerSlot || (b.name ? `group-header-${b.name}` : void 0), he = b.slot || (b.name ? `group-${b.name}` : void 0);
932
+ p.push({
933
+ key: `${h}-${I}`,
934
+ index: I,
935
+ group: b,
936
+ items: S,
937
+ cols: q,
938
+ gutter: x,
939
+ isLegacy: !u,
940
+ headerSlotName: le,
941
+ bodySlotName: he
942
+ });
943
+ }), p;
944
+ }), Z = (u, k) => {
945
+ if (u.span !== void 0)
946
+ return Math.max(1, Math.min(24, u.span));
947
+ const p = Math.max(1, k);
948
+ return Math.max(1, Math.floor(24 / p)) || K.value;
949
+ }, J = (u) => u.isLegacy ? !1 : u.group.title || u.group.description || u.headerSlotName && i[u.headerSlotName] ? !0 : !!i["group-header"], $ = (u) => {
950
+ let k = u.disabled || l.disabled;
951
+ if (!k && u.disabledWhen)
686
952
  try {
687
- return n.disabledWhen(a.value);
688
- } catch (y) {
689
- return console.error(`[EzDynamicForm] Error in disabledWhen function for field "${n.prop}":`, y), !1;
953
+ k = u.disabledWhen(a.value);
954
+ } catch (p) {
955
+ console.error(`[EzDynamicForm] Disabled check error for "${u.prop}":`, p);
690
956
  }
691
- return !1;
692
- }, k = async () => {
693
- if (!g.value)
694
- return console.warn("[EzDynamicForm] Form ref is not available"), !1;
695
- try {
696
- return await g.value.validate(), !0;
697
- } catch {
698
- return !1;
699
- }
700
- }, z = async (n) => {
701
- if (!g.value)
702
- return console.warn("[EzDynamicForm] Form ref is not available"), !1;
703
- try {
704
- return await g.value.validateField(n), !0;
705
- } catch {
706
- return !1;
707
- }
708
- }, H = (n) => {
709
- if (!g.value) {
710
- console.warn("[EzDynamicForm] Form ref is not available");
711
- return;
712
- }
713
- g.value.clearValidate(n);
714
- }, ae = (n) => {
715
- if (!g.value) {
716
- console.warn("[EzDynamicForm] Form ref is not available");
717
- return;
718
- }
719
- g.value.resetFields(n), ue(() => {
720
- d();
721
- });
722
- }, q = () => ({ ...a.value }), G = (n, y = !0) => {
723
- if (!n || typeof n != "object") {
724
- console.warn("[EzDynamicForm] Invalid data provided to setFormData");
725
- return;
726
- }
727
- V = !0, a.value = y ? { ...a.value, ...n } : { ...n }, ue(() => {
728
- V = !1;
729
- });
957
+ return { ...u, disabled: k };
730
958
  };
731
- he(
732
- () => s.modelValue,
733
- (n) => {
734
- n && !V && typeof n == "object" && (V = !0, a.value = { ...n }, ue(() => {
735
- V = !1;
736
- }));
959
+ return c({
960
+ validate: async () => {
961
+ if (!f.value)
962
+ return console.warn("[EzDynamicForm] Form ref is not available"), !1;
963
+ try {
964
+ return await f.value.validate(), !0;
965
+ } catch {
966
+ return !1;
967
+ }
737
968
  },
738
- { deep: !0, flush: "post" }
739
- );
740
- let Q = null;
741
- return he(
742
- a,
743
- (n) => {
744
- V || (Q && clearTimeout(Q), Q = setTimeout(() => {
745
- f("update:modelValue", { ...n }), Q = null;
746
- }, 0));
969
+ validateField: async (u) => {
970
+ if (!f.value)
971
+ return console.warn("[EzDynamicForm] Form ref is not available"), !1;
972
+ try {
973
+ return await f.value.validateField(u), !0;
974
+ } catch {
975
+ return !1;
976
+ }
977
+ },
978
+ clearValidate: (u) => {
979
+ if (!f.value) {
980
+ console.warn("[EzDynamicForm] Form ref is not available");
981
+ return;
982
+ }
983
+ f.value.clearValidate(u);
984
+ },
985
+ getFormData: () => s(a.value),
986
+ setFormData: (u, k = !0) => {
987
+ if (!u) return;
988
+ r();
989
+ const p = s(u);
990
+ k ? Object.assign(a.value, p) : a.value = p, R(), Le(() => {
991
+ f.value?.clearValidate();
992
+ });
747
993
  },
748
- { deep: !0, flush: "post" }
749
- ), fe(() => {
750
- d();
751
- }), m({
752
- validate: k,
753
- validateField: z,
754
- clearValidate: H,
755
- resetFields: ae,
756
- getFormData: q,
757
- setFormData: G,
758
- formRef: g
759
- }), (n, y) => (r(), p(l(ll), h({
994
+ formRef: f
995
+ }), (u, k) => (o(), v(t(ml), g({
760
996
  ref_key: "formRef",
761
- ref: g,
762
- model: a.value
763
- }, _.value, { class: "ez-dynamic-form" }), {
764
- default: b(() => [
765
- S(l(al), {
766
- gutter: s.gutter
767
- }, {
768
- default: b(() => [
769
- (r(!0), w(O, null, W(E.value, (e) => (r(), p(l(tl), {
770
- key: e.prop,
771
- span: N(e)
997
+ ref: f,
998
+ class: "ez-dynamic-form",
999
+ "label-width": "auto"
1000
+ }, u.$attrs, { model: a.value }), {
1001
+ default: y(() => [
1002
+ (o(!0), V(P, null, W(X.value, (p) => (o(), V(P, {
1003
+ key: p.key
1004
+ }, [
1005
+ p.isLegacy ? (o(), v(t(ze), {
1006
+ key: 0,
1007
+ gutter: p.gutter
1008
+ }, {
1009
+ default: y(() => [
1010
+ (o(!0), V(P, null, W(p.items, (b) => (o(), v(t(Ce), {
1011
+ key: b.prop,
1012
+ span: Z(b, p.cols)
1013
+ }, {
1014
+ default: y(() => [
1015
+ M(pe, {
1016
+ modelValue: a.value[b.prop],
1017
+ "onUpdate:modelValue": (I) => a.value[b.prop] = I,
1018
+ config: $(b),
1019
+ formData: a.value
1020
+ }, ae({ _: 2 }, [
1021
+ u.$slots[`label-${b.prop}`] ? {
1022
+ name: "label",
1023
+ fn: y(() => [
1024
+ C(u.$slots, `label-${b.prop}`, { item: b })
1025
+ ]),
1026
+ key: "0"
1027
+ } : void 0,
1028
+ u.$slots[b.prop] ? {
1029
+ name: "default",
1030
+ fn: y(({ config: I, value: h }) => [
1031
+ C(u.$slots, b.prop, {
1032
+ item: I,
1033
+ value: h,
1034
+ formData: a.value
1035
+ })
1036
+ ]),
1037
+ key: "1"
1038
+ } : void 0
1039
+ ]), 1032, ["modelValue", "onUpdate:modelValue", "config", "formData"])
1040
+ ]),
1041
+ _: 2
1042
+ }, 1032, ["span"]))), 128))
1043
+ ]),
1044
+ _: 2
1045
+ }, 1032, ["gutter"])) : (o(), V("section", {
1046
+ key: 1,
1047
+ class: ce(["ez-dynamic-form-group", p.group.className]),
1048
+ style: ie(p.group.style)
1049
+ }, [
1050
+ J(p) ? (o(), V("div", {
1051
+ key: 0,
1052
+ class: ce(["ez-dynamic-form-group__header", p.group.headerClassName]),
1053
+ style: ie(p.group.headerStyle)
1054
+ }, [
1055
+ p.headerSlotName && u.$slots[p.headerSlotName] ? C(u.$slots, p.headerSlotName, {
1056
+ key: 0,
1057
+ group: p.group,
1058
+ index: p.index,
1059
+ items: p.items,
1060
+ formData: a.value
1061
+ }) : u.$slots["group-header"] ? C(u.$slots, "group-header", {
1062
+ key: 1,
1063
+ group: p.group,
1064
+ index: p.index,
1065
+ items: p.items,
1066
+ formData: a.value
1067
+ }) : (o(), V(P, { key: 2 }, [
1068
+ p.group.title ? (o(), V("div", st, Y(p.group.title), 1)) : D("", !0),
1069
+ p.group.description ? (o(), V("div", rt, Y(p.group.description), 1)) : D("", !0)
1070
+ ], 64))
1071
+ ], 6)) : D("", !0),
1072
+ p.bodySlotName && u.$slots[p.bodySlotName] ? C(u.$slots, p.bodySlotName, {
1073
+ key: 1,
1074
+ group: p.group,
1075
+ index: p.index,
1076
+ items: p.items,
1077
+ formData: a.value
1078
+ }) : u.$slots.group ? C(u.$slots, "group", {
1079
+ key: 2,
1080
+ group: p.group,
1081
+ index: p.index,
1082
+ items: p.items,
1083
+ formData: a.value
1084
+ }) : (o(), v(t(ze), {
1085
+ key: 3,
1086
+ gutter: p.gutter,
1087
+ class: ce(["ez-dynamic-form-group__body", p.group.bodyClassName]),
1088
+ style: ie(p.group.bodyStyle)
772
1089
  }, {
773
- default: b(() => [
774
- S(l(ol), h({
775
- prop: e.prop,
776
- label: e.label,
777
- rules: j(e)
778
- }, { ref_for: !0 }, e.itemAttrs), de({
779
- default: b(() => [
780
- n.$slots[e.prop] ? R(n.$slots, e.prop, {
781
- key: 0,
782
- item: e,
783
- value: a.value[e.prop],
1090
+ default: y(() => [
1091
+ (o(!0), V(P, null, W(p.items, (b) => (o(), v(t(Ce), {
1092
+ key: `${p.key}-${b.prop}`,
1093
+ span: Z(b, p.cols)
1094
+ }, {
1095
+ default: y(() => [
1096
+ M(pe, {
1097
+ modelValue: a.value[b.prop],
1098
+ "onUpdate:modelValue": (I) => a.value[b.prop] = I,
1099
+ config: $(b),
784
1100
  formData: a.value
785
- }) : e.component ? (r(), p(ce(e.component), h({
786
- key: 1,
787
- modelValue: a.value[e.prop],
788
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
789
- disabled: i(e)
790
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : (r(), w(O, { key: 2 }, [
791
- e.type === l(c).INPUT || !e.type ? (r(), p(l(ie), h({
792
- key: 0,
793
- modelValue: a.value[e.prop],
794
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
795
- placeholder: e.placeholder || `请输入${e.label || ""}`,
796
- disabled: i(e),
797
- clearable: ""
798
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).TEXTAREA ? (r(), p(l(ie), h({
799
- key: 1,
800
- modelValue: a.value[e.prop],
801
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
802
- type: "textarea",
803
- placeholder: e.placeholder || `请输入${e.label || ""}`,
804
- disabled: i(e)
805
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).NUMBER ? (r(), p(l(rl), h({
806
- key: 2,
807
- modelValue: a.value[e.prop],
808
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
809
- placeholder: e.placeholder,
810
- disabled: i(e)
811
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).PASSWORD ? (r(), p(l(ie), h({
812
- key: 3,
813
- modelValue: a.value[e.prop],
814
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
815
- type: "password",
816
- placeholder: e.placeholder || `请输入${e.label || ""}`,
817
- disabled: i(e),
818
- "show-password": "",
819
- clearable: ""
820
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).SELECT ? (r(), p(l(De), h({
821
- key: 4,
822
- modelValue: a.value[e.prop],
823
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
824
- options: e.options || [],
825
- placeholder: e.placeholder || `请选择${e.label || ""}`,
826
- disabled: i(e)
827
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "options", "placeholder", "disabled"])) : e.type === l(c).RADIO ? (r(), p(l(xe), h({
828
- key: 5,
829
- modelValue: a.value[e.prop],
830
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
831
- options: e.options || [],
832
- disabled: i(e)
833
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "options", "disabled"])) : e.type === l(c).CHECKBOX ? (r(), p(l(Re), h({
834
- key: 6,
835
- modelValue: a.value[e.prop],
836
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
837
- options: e.options || [],
838
- disabled: i(e)
839
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "options", "disabled"])) : e.type === l(c).DATE ? (r(), p(l(ne), h({
840
- key: 7,
841
- modelValue: a.value[e.prop],
842
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
843
- type: "date",
844
- placeholder: e.placeholder || `请选择${e.label || ""}`,
845
- disabled: i(e)
846
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).DATETIME ? (r(), p(l(ne), h({
847
- key: 8,
848
- modelValue: a.value[e.prop],
849
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
850
- type: "datetime",
851
- placeholder: e.placeholder || `请选择${e.label || ""}`,
852
- disabled: i(e)
853
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).DATERANGE ? (r(), p(l(ne), h({
854
- key: 9,
855
- modelValue: a.value[e.prop],
856
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
857
- type: "daterange",
858
- "range-separator": "至",
859
- "start-placeholder": "开始日期",
860
- "end-placeholder": "结束日期",
861
- disabled: i(e)
862
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).DATETIMERANGE ? (r(), p(l(ne), h({
863
- key: 10,
864
- modelValue: a.value[e.prop],
865
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
866
- type: "datetimerange",
867
- "range-separator": "至",
868
- "start-placeholder": "开始时间",
869
- "end-placeholder": "结束时间",
870
- disabled: i(e)
871
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).TIME ? (r(), p(l(Ve), h({
872
- key: 11,
873
- modelValue: a.value[e.prop],
874
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
875
- placeholder: e.placeholder || `请选择${e.label || ""}`,
876
- disabled: i(e)
877
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "disabled"])) : e.type === l(c).TIMERANGE ? (r(), p(l(Ve), h({
878
- key: 12,
879
- modelValue: a.value[e.prop],
880
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
881
- "is-range": "",
882
- "range-separator": "至",
883
- "start-placeholder": "开始时间",
884
- "end-placeholder": "结束时间",
885
- disabled: i(e)
886
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).SWITCH ? (r(), p(l(sl), h({
887
- key: 13,
888
- modelValue: a.value[e.prop],
889
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
890
- disabled: i(e)
891
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).TREE_SELECT ? (r(), p(l(nl), h({
892
- key: 14,
893
- modelValue: a.value[e.prop],
894
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
895
- data: e.options,
896
- placeholder: e.placeholder || `请选择${e.label || ""}`,
897
- disabled: i(e)
898
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "data", "placeholder", "disabled"])) : e.type === l(c).CASCADER ? (r(), p(l(ul), h({
899
- key: 15,
900
- modelValue: a.value[e.prop],
901
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
902
- options: e.options,
903
- placeholder: e.placeholder || `请选择${e.label || ""}`,
904
- disabled: i(e),
905
- clearable: ""
906
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "options", "placeholder", "disabled"])) : e.type === l(c).TREE ? (r(), p(l(dl), h({
907
- key: 16,
908
- modelValue: a.value[e.prop],
909
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
910
- data: e.options,
911
- "show-checkbox": "",
912
- "node-key": "id"
913
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "data"])) : e.type === l(c).SLIDER ? (r(), p(l(il), h({
914
- key: 17,
915
- modelValue: a.value[e.prop],
916
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
917
- disabled: i(e)
918
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === l(c).RATE ? (r(), p(l(pl), h({
919
- key: 18,
920
- modelValue: a.value[e.prop],
921
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
922
- disabled: i(e)
923
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])) : e.type === "upload-images" && e.attrs?.api ? (r(), p(l(Me), h({
924
- key: 19,
925
- modelValue: a.value[e.prop],
926
- "onUpdate:modelValue": (v) => a.value[e.prop] = v,
927
- api: e.attrs?.api,
928
- disabled: i(e)
929
- }, { ref_for: !0 }, e.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "api", "disabled"])) : A("", !0)
930
- ], 64))
1101
+ }, ae({ _: 2 }, [
1102
+ u.$slots[`label-${b.prop}`] ? {
1103
+ name: "label",
1104
+ fn: y(() => [
1105
+ C(u.$slots, `label-${b.prop}`, { item: b })
1106
+ ]),
1107
+ key: "0"
1108
+ } : void 0,
1109
+ u.$slots[b.prop] ? {
1110
+ name: "default",
1111
+ fn: y(({ config: I, value: h }) => [
1112
+ C(u.$slots, b.prop, {
1113
+ item: I,
1114
+ value: h,
1115
+ formData: a.value
1116
+ })
1117
+ ]),
1118
+ key: "1"
1119
+ } : void 0
1120
+ ]), 1032, ["modelValue", "onUpdate:modelValue", "config", "formData"])
931
1121
  ]),
932
1122
  _: 2
933
- }, [
934
- n.$slots[`label-${e.prop}`] ? {
935
- name: "label",
936
- fn: b(() => [
937
- R(n.$slots, `label-${e.prop}`, { item: e })
938
- ]),
939
- key: "0"
940
- } : void 0
941
- ]), 1040, ["prop", "label", "rules"])
1123
+ }, 1032, ["span"]))), 128))
942
1124
  ]),
943
1125
  _: 2
944
- }, 1032, ["span"]))), 128))
945
- ]),
946
- _: 3
947
- }, 8, ["gutter"])
1126
+ }, 1032, ["gutter", "class", "style"]))
1127
+ ], 6))
1128
+ ], 64))), 128))
948
1129
  ]),
949
1130
  _: 3
950
1131
  }, 16, ["model"]));
951
1132
  }
952
- }), $a = F(Ql), ea = $({ name: "EzTable", inheritAttrs: !1 }), la = /* @__PURE__ */ $({
953
- ...ea,
1133
+ }), dt = G(ut), ct = G(pe), ft = w({ name: "EzTable" }), mt = /* @__PURE__ */ w({
1134
+ ...ft,
954
1135
  props: {
955
1136
  data: { default: () => [] },
956
1137
  columns: { default: () => [] },
957
1138
  rowKey: {}
958
1139
  },
959
- setup(t, { expose: m }) {
960
- const o = t, s = x(), f = J(), g = Z(f), a = (u) => {
961
- const _ = o.columns[o.columns.length - 1], d = () => u.type ? !1 : u.prop !== _.prop;
1140
+ setup(e, { expose: c }) {
1141
+ const l = e, i = O(), a = (n) => {
1142
+ const m = l.columns[l.columns.length - 1], d = () => n.type ? !1 : n.prop !== m.prop;
962
1143
  return { ...{
963
1144
  align: "center",
964
1145
  hidden: 1,
965
1146
  resizable: !0,
966
- reserveSelection: u.type === "selection",
1147
+ reserveSelection: n.type === "selection",
967
1148
  /** 默认最后一个 */
968
1149
  showOverflowTooltip: d()
969
- }, ...u };
1150
+ }, ...n };
970
1151
  };
971
- return m({
972
- getTableRef: () => s.value
973
- }), (u, _) => (r(), p(l(cl), h({
1152
+ return c({
1153
+ getTableRef: () => i.value,
1154
+ clearSelection: () => i.value?.clearSelection(),
1155
+ toggleRowSelection: (n, m) => i.value?.toggleRowSelection(n, m),
1156
+ toggleAllSelection: () => i.value?.toggleAllSelection(),
1157
+ toggleRowExpansion: (n, m) => i.value?.toggleRowExpansion(n, m),
1158
+ setCurrentRow: (n) => i.value?.setCurrentRow(n),
1159
+ clearSort: () => i.value?.clearSort(),
1160
+ clearFilter: (n) => i.value?.clearFilter(n),
1161
+ doLayout: () => i.value?.doLayout(),
1162
+ sort: (n, m) => i.value?.sort(n, m)
1163
+ }), (n, m) => (o(), v(t(pl), g({
974
1164
  ref_key: "tableRef",
975
- ref: s,
976
- data: o.data,
1165
+ ref: i,
1166
+ data: l.data,
977
1167
  border: "",
978
1168
  "row-key": "id"
979
- }, l(g)), de({
980
- default: b(() => [
981
- (r(!0), w(O, null, W(o.columns, (d) => (r(), w(O, {
1169
+ }, n.$attrs), ae({
1170
+ default: y(() => [
1171
+ (o(!0), V(P, null, W(l.columns, (d) => (o(), V(P, {
982
1172
  key: d.prop
983
1173
  }, [
984
- ["selection", "index"].includes(d.type) ? (r(), p(l(we), h({
1174
+ ["selection", "index"].includes(d.type) ? (o(), v(t(Ae), g({
985
1175
  key: 0,
986
1176
  ref_for: !0
987
- }, a(d)), null, 16)) : d.hidden ? A("", !0) : (r(), p(l(we), h({
1177
+ }, a(d)), null, 16)) : d.hidden ? D("", !0) : (o(), v(t(Ae), g({
988
1178
  key: 1,
989
1179
  ref_for: !0
990
- }, a(d)), de({ _: 2 }, [
991
- u.$slots[d.prop] ? {
1180
+ }, a(d)), ae({ _: 2 }, [
1181
+ n.$slots[d.prop] ? {
992
1182
  name: "default",
993
- fn: b((E) => [
994
- R(u.$slots, d.prop, h({ ref_for: !0 }, E))
1183
+ fn: y((s) => [
1184
+ C(n.$slots, d.prop, g({ ref_for: !0 }, s))
995
1185
  ]),
996
1186
  key: "0"
997
1187
  } : d.transform ? {
998
1188
  name: "default",
999
- fn: b((E) => [
1000
- le(Y(d.transform(E.row)), 1)
1189
+ fn: y((s) => [
1190
+ _(Y(d.transform(s.row)), 1)
1001
1191
  ]),
1002
1192
  key: "1"
1003
1193
  } : void 0,
1004
- u.$slots[`header-${d.prop}`] ? {
1194
+ n.$slots[`header-${d.prop}`] ? {
1005
1195
  name: "header",
1006
- fn: b((E) => [
1007
- R(u.$slots, `header-${d.prop}`, h({ ref_for: !0 }, E))
1196
+ fn: y((s) => [
1197
+ C(n.$slots, `header-${d.prop}`, g({ ref_for: !0 }, s))
1008
1198
  ]),
1009
1199
  key: "2"
1010
1200
  } : void 0
@@ -1013,25 +1203,25 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
1013
1203
  ]),
1014
1204
  _: 2
1015
1205
  }, [
1016
- u.$slots?.append ? {
1206
+ n.$slots?.append ? {
1017
1207
  name: "append",
1018
- fn: b(() => [
1019
- R(u.$slots, "append")
1208
+ fn: y(() => [
1209
+ C(n.$slots, "append")
1020
1210
  ]),
1021
1211
  key: "0"
1022
1212
  } : void 0,
1023
- u.$slots?.empty ? {
1213
+ n.$slots?.empty ? {
1024
1214
  name: "empty",
1025
- fn: b(() => [
1026
- R(u.$slots, "empty")
1215
+ fn: y(() => [
1216
+ C(n.$slots, "empty")
1027
1217
  ]),
1028
1218
  key: "1"
1029
1219
  } : void 0
1030
1220
  ]), 1040, ["data"]));
1031
1221
  }
1032
- }), Pe = F(la), aa = { class: "ez-search-form" }, ta = { class: "ez-search-form__operate" }, oa = $({ name: "EzSearchForm", inheritAttrs: !1 }), ra = /* @__PURE__ */ $({
1033
- ...oa,
1034
- props: /* @__PURE__ */ I({
1222
+ }), Fe = G(mt), pt = { class: "ez-search-form" }, vt = { class: "ez-search-form__operate" }, gt = w({ name: "EzSearchForm", inheritAttrs: !1 }), yt = /* @__PURE__ */ w({
1223
+ ...gt,
1224
+ props: /* @__PURE__ */ F({
1035
1225
  collapsedHeight: { default: 50 },
1036
1226
  reset: { type: Boolean }
1037
1227
  }, {
@@ -1039,92 +1229,85 @@ const Zl = $({ name: "EzDynamicForm", inheritAttrs: !1 }), Ql = /* @__PURE__ */
1039
1229
  expandedModifiers: {}
1040
1230
  }),
1041
1231
  emits: ["update:expanded"],
1042
- setup(t, { expose: m }) {
1043
- const o = t, { t: s } = se(), f = x(), g = x(0), a = P(t, "expanded"), V = M(() => g.value > o.collapsedHeight), u = M(() => a.value ? Bl : Ll), _ = M(() => a.value ? s("s.button.collapse") : s("s.button.expand"));
1044
- let d = null;
1045
- const E = () => {
1046
- f.value && (g.value = f.value.scrollHeight);
1047
- }, L = () => {
1048
- a.value = !a.value;
1232
+ setup(e, { expose: c }) {
1233
+ const l = e, { t: i } = ue(), a = O(), f = O(0), n = L(e, "expanded"), m = T(() => f.value > l.collapsedHeight), d = T(() => n.value ? Gl : ql), s = T(() => n.value ? i("s.button.collapse") : i("s.button.expand"));
1234
+ let r = null;
1235
+ const R = Sl(() => {
1236
+ a.value && (f.value = a.value.scrollHeight);
1237
+ }, 100), K = () => {
1238
+ n.value = !n.value;
1049
1239
  };
1050
- return fe(() => {
1240
+ return ye(() => {
1051
1241
  setTimeout(() => {
1052
- f.value && (E(), d = new ResizeObserver(E), d.observe(f.value));
1242
+ a.value && (R(), r = new ResizeObserver(R), r.observe(a.value));
1053
1243
  }, 50);
1054
- }), Oe(() => {
1055
- d && (d.disconnect(), d = null);
1056
- }), m({
1057
- countViewHeight: E
1058
- }), (N, B) => (r(), w("div", aa, [
1059
- D("div", {
1244
+ }), Ke(() => {
1245
+ r && (r.disconnect(), r = null);
1246
+ }), c({
1247
+ countViewHeight: R
1248
+ }), (H, j) => (o(), V("div", pt, [
1249
+ N("div", {
1060
1250
  class: "ez-search-form__wrapper",
1061
- style: Ae({
1062
- height: g.value ? a.value ? `${g.value}px` : `${o.collapsedHeight}px` : "auto"
1251
+ style: ie({
1252
+ height: f.value ? n.value ? `${f.value}px` : `${l.collapsedHeight}px` : "auto"
1063
1253
  })
1064
1254
  }, [
1065
- D("div", ta, [
1066
- R(N.$slots, "operate"),
1067
- V.value ? (r(), p(l(te), {
1255
+ N("div", vt, [
1256
+ C(H.$slots, "operate"),
1257
+ m.value ? (o(), v(t(te), {
1068
1258
  key: 0,
1069
- icon: u.value,
1259
+ icon: d.value,
1070
1260
  size: "small",
1071
- title: _.value,
1261
+ title: s.value,
1072
1262
  circle: "",
1073
- onClick: B[0] || (B[0] = (j) => L())
1074
- }, null, 8, ["icon", "title"])) : A("", !0)
1263
+ onClick: j[0] || (j[0] = (X) => K())
1264
+ }, null, 8, ["icon", "title"])) : D("", !0)
1075
1265
  ]),
1076
- D("div", {
1266
+ N("div", {
1077
1267
  ref_key: "wrapRef",
1078
- ref: f
1268
+ ref: a
1079
1269
  }, [
1080
- R(N.$slots, "default")
1270
+ C(H.$slots, "default")
1081
1271
  ], 512)
1082
1272
  ], 4)
1083
1273
  ]));
1084
1274
  }
1085
- }), Ie = F(ra), sa = $({ name: "EzPagination", inheritAttrs: !1 }), na = /* @__PURE__ */ $({
1086
- ...sa,
1275
+ }), Ge = G(yt), bt = w({ name: "EzPagination", inheritAttrs: !1 }), ht = /* @__PURE__ */ w({
1276
+ ...bt,
1087
1277
  props: {
1088
1278
  currentPage: {},
1089
1279
  currentPageModifiers: {},
1090
1280
  pageSize: {},
1091
1281
  pageSizeModifiers: {}
1092
1282
  },
1093
- emits: /* @__PURE__ */ I(["current-change", "size-change"], ["update:currentPage", "update:pageSize"]),
1094
- setup(t, { emit: m }) {
1095
- const o = m, s = P(t, "currentPage"), f = P(t, "pageSize"), g = J(), a = Z(g), V = (_) => {
1096
- o("current-change", _);
1097
- }, u = (_) => {
1098
- o("size-change", _);
1099
- };
1100
- return (_, d) => (r(), p(l(fl), h({
1101
- "current-page": s.value,
1102
- "onUpdate:currentPage": d[0] || (d[0] = (E) => s.value = E),
1103
- "page-size": f.value,
1104
- "onUpdate:pageSize": d[1] || (d[1] = (E) => f.value = E),
1283
+ emits: ["update:currentPage", "update:pageSize"],
1284
+ setup(e) {
1285
+ const c = L(e, "currentPage"), l = L(e, "pageSize"), { attrs: i } = oe(["currentPage", "pageSize"]);
1286
+ return (a, f) => (o(), v(t(vl), g({
1287
+ "current-page": c.value,
1288
+ "onUpdate:currentPage": f[0] || (f[0] = (n) => c.value = n),
1289
+ "page-size": l.value,
1290
+ "onUpdate:pageSize": f[1] || (f[1] = (n) => l.value = n),
1105
1291
  "page-sizes": [10, 20, 50, 100],
1106
1292
  layout: "total, sizes, prev, pager, next, jumper"
1107
- }, l(a), {
1108
- onCurrentChange: V,
1109
- onSizeChange: u
1110
- }), null, 16, ["current-page", "page-size"]));
1293
+ }, t(i)), null, 16, ["current-page", "page-size"]));
1111
1294
  }
1112
- }), Le = F(na);
1113
- var pe = /* @__PURE__ */ ((t) => (t.ASC = "ascending", t.DESC = "descending", t[t.EMPTY = null] = "EMPTY", t))(pe || {});
1114
- const ua = (t) => {
1115
- const m = x([]), o = M(() => m.value), s = M(() => m.value.map((a) => a[t]));
1295
+ }), He = G(ht);
1296
+ var ve = /* @__PURE__ */ ((e) => (e.ASC = "ascending", e.DESC = "descending", e[e.EMPTY = null] = "EMPTY", e))(ve || {});
1297
+ const Vt = (e) => {
1298
+ const c = O([]), l = T(() => c.value), i = T(() => c.value.map((n) => n[e]));
1116
1299
  return {
1117
- selectionChange: (a) => {
1118
- m.value = a;
1300
+ selectionChange: (n) => {
1301
+ c.value = n;
1119
1302
  },
1120
- getSelectedList: o,
1121
- getSelectedIds: s,
1122
- getSortParams: ({ prop: a, order: V }) => {
1123
- const u = { asc: null, desc: null };
1124
- return V === pe.ASC ? (u.asc = a, u.desc = null) : V === pe.DESC && (u.asc = null, u.desc = a), u;
1303
+ getSelectedList: l,
1304
+ getSelectedIds: i,
1305
+ getSortParams: ({ prop: n, order: m }) => {
1306
+ const d = { asc: null, desc: null };
1307
+ return m === ve.ASC ? (d.asc = n, d.desc = null) : m === ve.DESC && (d.asc = null, d.desc = n), d;
1125
1308
  }
1126
1309
  };
1127
- }, da = /* @__PURE__ */ $({
1310
+ }, Et = /* @__PURE__ */ w({
1128
1311
  __name: "column-config",
1129
1312
  props: {
1130
1313
  modelValue: { type: Boolean, default: !1 },
@@ -1132,47 +1315,47 @@ const ua = (t) => {
1132
1315
  columns: { default: () => [] },
1133
1316
  columnsModifiers: {}
1134
1317
  },
1135
- emits: /* @__PURE__ */ I(["change"], ["update:modelValue", "update:columns"]),
1136
- setup(t, { emit: m }) {
1137
- const { t: o } = se(), s = ["selection", "index", "expand"], f = m, g = P(t, "modelValue"), a = P(t, "columns"), V = (u) => a.value.filter((d) => d.hidden === 0).length < 2 && u.hidden === 0;
1138
- return (u, _) => (r(), p(l(vl), {
1139
- modelValue: g.value,
1140
- "onUpdate:modelValue": _[1] || (_[1] = (d) => g.value = d),
1318
+ emits: /* @__PURE__ */ F(["change"], ["update:modelValue", "update:columns"]),
1319
+ setup(e, { emit: c }) {
1320
+ const { t: l } = ue(), i = ["selection", "index", "expand"], a = c, f = L(e, "modelValue"), n = L(e, "columns"), m = (d) => n.value.filter((r) => r.hidden === 0).length < 2 && d.hidden === 0;
1321
+ return (d, s) => (o(), v(t(gl), {
1322
+ modelValue: f.value,
1323
+ "onUpdate:modelValue": s[1] || (s[1] = (r) => f.value = r),
1141
1324
  class: "ez-column-wrapper",
1142
- title: l(o)("s.label.column"),
1325
+ title: t(l)("s.label.column"),
1143
1326
  size: "15%"
1144
1327
  }, {
1145
- default: b(() => [
1146
- (r(!0), w(O, null, W(a.value, (d) => (r(), w(O, {
1147
- key: d.prop
1328
+ default: y(() => [
1329
+ (o(!0), V(P, null, W(n.value, (r) => (o(), V(P, {
1330
+ key: r.prop
1148
1331
  }, [
1149
- s.includes(d.type) ? A("", !0) : (r(), p(l(Ue), {
1332
+ i.includes(r.type) ? D("", !0) : (o(), v(t(Ne), {
1150
1333
  key: 0,
1151
- modelValue: d.hidden,
1152
- "onUpdate:modelValue": (E) => d.hidden = E,
1334
+ modelValue: r.hidden,
1335
+ "onUpdate:modelValue": (R) => r.hidden = R,
1153
1336
  class: "flex",
1154
1337
  "true-value": 0,
1155
1338
  "false-value": 1,
1156
- label: d.label,
1339
+ label: r.label,
1157
1340
  checked: "",
1158
- disabled: V(d),
1159
- onChange: _[0] || (_[0] = (E) => f("change"))
1341
+ disabled: m(r),
1342
+ onChange: s[0] || (s[0] = (R) => a("change"))
1160
1343
  }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "disabled"]))
1161
1344
  ], 64))), 128))
1162
1345
  ]),
1163
1346
  _: 1
1164
1347
  }, 8, ["modelValue", "title"]));
1165
1348
  }
1166
- }), ia = { class: "ez-fast-table" }, pa = { class: "ez-fast-table_wrapper" }, ca = {
1349
+ }), $t = { class: "ez-fast-table" }, kt = { class: "ez-fast-table_wrapper" }, wt = {
1167
1350
  key: 0,
1168
1351
  class: "ez-fast-table_wrapper_header_operation"
1169
- }, fa = { class: "ez-fast-table_pagination" }, va = $({
1352
+ }, St = { class: "ez-fast-table_pagination" }, zt = w({
1170
1353
  name: "EzFastTable",
1171
- directives: { loading: ve.directive },
1354
+ directives: { loading: be.directive },
1172
1355
  inheritAttrs: !1
1173
- }), ma = /* @__PURE__ */ $({
1174
- ...va,
1175
- props: /* @__PURE__ */ I({
1356
+ }), Ct = /* @__PURE__ */ w({
1357
+ ...zt,
1358
+ props: /* @__PURE__ */ F({
1176
1359
  api: { type: Function, default: () => Promise.resolve() },
1177
1360
  beforeSearch: { type: Function, default: () => Promise.resolve() },
1178
1361
  columnTool: { type: Boolean, default: !0 },
@@ -1188,165 +1371,186 @@ const ua = (t) => {
1188
1371
  loading: { type: Boolean },
1189
1372
  loadingModifiers: {}
1190
1373
  }),
1191
- emits: /* @__PURE__ */ I(["changePage", "reset", "query"], ["update:params", "update:columns", "update:loading"]),
1192
- setup(t, { expose: m, emit: o }) {
1193
- const { t: s } = se(), f = t, g = J(), a = Z(g), V = x(f.expanded), { selectionChange: u, getSelectedList: _, getSortParams: d, getSelectedIds: E } = ua(f.rowKey), L = x(null), N = x(!1), B = x(null), j = x([]), K = x(0), X = o, T = P(t, "params"), C = P(t, "columns"), i = P(t, "loading"), k = async () => {
1374
+ emits: /* @__PURE__ */ F(["changePage", "reset", "query"], ["update:params", "update:columns", "update:loading"]),
1375
+ setup(e, { expose: c, emit: l }) {
1376
+ const { t: i } = ue(), a = e, f = Me(), n = T(() => {
1377
+ const { api: h, beforeSearch: S, columnTool: q, expanded: x, ...le } = a;
1378
+ return {
1379
+ ...f,
1380
+ ...le
1381
+ };
1382
+ }), m = O(a.expanded), { selectionChange: d, getSelectedList: s, getSortParams: r, getSelectedIds: R } = Vt(a.rowKey), K = O(null), H = O(!1), j = O(null), X = O([]), Z = O(0), J = l, $ = L(e, "params"), E = L(e, "columns"), z = L(e, "loading"), U = async () => {
1194
1383
  try {
1195
- i.value = !0, await f.beforeSearch(T.value);
1196
- const { code: y, data: e } = await f.api(T.value);
1197
- y === 200 && e.records ? (j.value = e.records || [], K.value = e.total) : (j.value = [], K.value = 0), X("query");
1384
+ z.value = !0, await a.beforeSearch($.value);
1385
+ const { code: h, data: S } = await a.api($.value);
1386
+ h === 200 && S.records ? (X.value = S.records || [], Z.value = S.total) : (X.value = [], Z.value = 0), J("query");
1198
1387
  } finally {
1199
- i.value = !1;
1388
+ z.value = !1;
1200
1389
  }
1201
- }, z = () => {
1202
- T.value.current = 1, k();
1203
- }, H = () => L.value?.getTableRef(), ae = (y) => {
1204
- const e = d(y);
1205
- T.value = { ...T.value, ...e };
1206
- const { column: v } = y;
1207
- v.sortable === "custom" && z();
1208
- }, q = (y) => JSON.parse(JSON.stringify(y)), G = () => {
1209
- T.value = q(B.value), X("reset"), ue(() => z());
1210
- }, Q = (y) => {
1211
- X("changePage", y), y.size ? z() : k();
1212
- }, n = () => {
1213
- H().doLayout();
1390
+ }, B = () => {
1391
+ $.value.current = 1, U();
1392
+ }, ee = () => K.value?.getTableRef(), u = (h) => {
1393
+ const S = r(h);
1394
+ $.value = { ...$.value, ...S };
1395
+ const { column: q } = h;
1396
+ q.sortable === "custom" && B();
1397
+ }, k = (h) => {
1398
+ if (h === null || typeof h != "object") return h;
1399
+ if (h instanceof Date) return new Date(h.getTime());
1400
+ if (h instanceof Array) return h.map((q) => k(q));
1401
+ const S = Object.create(Object.getPrototypeOf(h));
1402
+ for (const q in h)
1403
+ h.hasOwnProperty(q) && (S[q] = k(h[q]));
1404
+ return S;
1405
+ }, p = () => {
1406
+ $.value = k(j.value), J("reset"), Le(() => B());
1407
+ }, b = (h) => {
1408
+ J("changePage", h), h.size ? B() : U();
1409
+ }, I = () => {
1410
+ ee().doLayout();
1214
1411
  };
1215
- return fe(() => {
1216
- B.value = q(T.value);
1217
- }), m({ search: z, query: k, getTableRef: H }), (y, e) => {
1218
- const v = Te("loading");
1219
- return r(), w("div", ia, [
1220
- y.$slots.form ? (r(), p(l(Ie), {
1412
+ return ye(() => {
1413
+ j.value = k($.value);
1414
+ }), c({ search: B, query: U, getTableRef: ee }), (h, S) => {
1415
+ const q = Ue("loading");
1416
+ return o(), V("div", $t, [
1417
+ h.$slots.form ? (o(), v(t(Ge), {
1221
1418
  key: 0,
1222
- loading: i.value,
1223
- expanded: V.value
1419
+ loading: z.value,
1420
+ expanded: m.value
1224
1421
  }, {
1225
- default: b((U) => [
1226
- R(y.$slots, "form", Ee(He(U)))
1422
+ default: y((x) => [
1423
+ C(h.$slots, "form", Ee(Ye(x)))
1227
1424
  ]),
1228
- operate: b(() => [
1229
- S(l(te), {
1425
+ operate: y(() => [
1426
+ M(t(te), {
1230
1427
  type: "primary",
1231
- loading: i.value,
1232
- onClick: z
1428
+ loading: z.value,
1429
+ onClick: B
1233
1430
  }, {
1234
- default: b(() => [
1235
- le(Y(l(s)("s.button.query")), 1)
1431
+ default: y(() => [
1432
+ _(Y(t(i)("s.button.query")), 1)
1236
1433
  ]),
1237
1434
  _: 1
1238
1435
  }, 8, ["loading"]),
1239
- S(l(te), { onClick: G }, {
1240
- default: b(() => [
1241
- le(Y(l(s)("s.button.reset")), 1)
1436
+ M(t(te), { onClick: p }, {
1437
+ default: y(() => [
1438
+ _(Y(t(i)("s.button.reset")), 1)
1242
1439
  ]),
1243
1440
  _: 1
1244
1441
  })
1245
1442
  ]),
1246
1443
  _: 3
1247
- }, 8, ["loading", "expanded"])) : A("", !0),
1248
- y.$slots.freeArea ? R(y.$slots, "freeArea", { key: 1 }) : A("", !0),
1249
- D("div", pa, [
1250
- y.$slots.header || f.columnTool ? (r(), w("div", {
1444
+ }, 8, ["loading", "expanded"])) : D("", !0),
1445
+ h.$slots.freeArea ? C(h.$slots, "freeArea", { key: 1 }) : D("", !0),
1446
+ N("div", kt, [
1447
+ h.$slots.header || a.columnTool ? (o(), V("div", {
1251
1448
  key: 0,
1252
- class: qe(["ez-fast-table_wrapper_header", y.$slots.header ? "justify-between" : "justify-end"])
1449
+ class: ce(["ez-fast-table_wrapper_header", h.$slots.header ? "justify-between" : "justify-end"])
1253
1450
  }, [
1254
- y.$slots.header ? (r(), w("div", ca, [
1255
- R(y.$slots, "header", {
1256
- selectList: l(_),
1257
- selectIds: l(E)
1451
+ h.$slots.header ? (o(), V("div", wt, [
1452
+ C(h.$slots, "header", {
1453
+ selectList: t(s),
1454
+ selectIds: t(R)
1258
1455
  })
1259
- ])) : A("", !0),
1260
- f.columnTool ? (r(), p(l(te), {
1456
+ ])) : D("", !0),
1457
+ a.columnTool ? (o(), v(t(te), {
1261
1458
  key: 1,
1262
- icon: l(Fl),
1459
+ icon: t(Kl),
1263
1460
  circle: "",
1264
- onClick: e[0] || (e[0] = (U) => N.value = !0)
1265
- }, null, 8, ["icon"])) : A("", !0)
1266
- ], 2)) : A("", !0),
1267
- Se((r(), p(l(Pe), h(l(a), {
1461
+ onClick: S[0] || (S[0] = (x) => H.value = !0)
1462
+ }, null, 8, ["icon"])) : D("", !0)
1463
+ ], 2)) : D("", !0),
1464
+ Pe((o(), v(t(Fe), g(n.value, {
1268
1465
  ref_key: "fastTableRef",
1269
- ref: L,
1270
- columns: C.value,
1271
- data: j.value,
1272
- onSelectionChange: l(u),
1273
- onSortChange: ae
1274
- }), de({ _: 2 }, [
1275
- W(y.$slots, (U, me, _a) => ({
1276
- name: me,
1277
- fn: b((Ne) => [
1278
- ["form"].includes(U.name) ? A("", !0) : R(y.$slots, me, Ee(h({ key: 0 }, Ne)))
1466
+ ref: K,
1467
+ columns: E.value,
1468
+ data: X.value,
1469
+ onSelectionChange: t(d),
1470
+ onSortChange: u
1471
+ }), ae({ _: 2 }, [
1472
+ W(h.$slots, (x, le, he) => ({
1473
+ name: le,
1474
+ fn: y((ne) => [
1475
+ ["form"].includes(x.name) ? D("", !0) : C(h.$slots, le, Ee(g({ key: 0 }, ne)))
1279
1476
  ])
1280
1477
  }))
1281
1478
  ]), 1040, ["columns", "data", "onSelectionChange"])), [
1282
- [v, i.value]
1479
+ [q, z.value]
1283
1480
  ]),
1284
- D("div", fa, [
1285
- S(l(Le), {
1286
- "current-page": T.value.current,
1481
+ N("div", St, [
1482
+ M(t(He), {
1483
+ "current-page": $.value.current,
1287
1484
  "onUpdate:currentPage": [
1288
- e[1] || (e[1] = (U) => T.value.current = U),
1289
- e[3] || (e[3] = (U) => Q({ current: U }))
1485
+ S[1] || (S[1] = (x) => $.value.current = x),
1486
+ S[3] || (S[3] = (x) => b({ current: x }))
1290
1487
  ],
1291
- "page-size": T.value.size,
1488
+ "page-size": $.value.size,
1292
1489
  "onUpdate:pageSize": [
1293
- e[2] || (e[2] = (U) => T.value.size = U),
1294
- e[4] || (e[4] = (U) => Q({ size: U }))
1490
+ S[2] || (S[2] = (x) => $.value.size = x),
1491
+ S[4] || (S[4] = (x) => b({ size: x }))
1295
1492
  ],
1296
- total: K.value
1493
+ total: Z.value
1297
1494
  }, null, 8, ["current-page", "page-size", "total"])
1298
1495
  ])
1299
1496
  ]),
1300
- S(da, {
1301
- modelValue: N.value,
1302
- "onUpdate:modelValue": e[5] || (e[5] = (U) => N.value = U),
1303
- columns: C.value,
1304
- "onUpdate:columns": e[6] || (e[6] = (U) => C.value = U),
1305
- onChange: n
1497
+ M(Et, {
1498
+ modelValue: H.value,
1499
+ "onUpdate:modelValue": S[5] || (S[5] = (x) => H.value = x),
1500
+ columns: E.value,
1501
+ "onUpdate:columns": S[6] || (S[6] = (x) => E.value = x),
1502
+ onChange: I
1306
1503
  }, null, 8, ["modelValue", "columns"])
1307
1504
  ]);
1308
1505
  };
1309
1506
  }
1310
- }), ga = F(ma), ze = /* @__PURE__ */ Symbol("INSTALLED_KEY");
1311
- function ha(t = []) {
1507
+ }), At = G(Ct), xe = /* @__PURE__ */ Symbol("INSTALLED_KEY");
1508
+ function Dt(e = []) {
1312
1509
  return {
1313
- install: (o) => {
1314
- o[ze] || (o[ze] = !0, t.forEach((s) => o.use(s)));
1510
+ install: (l) => {
1511
+ l[xe] || (l[xe] = !0, e.forEach((i) => l.use(i)));
1315
1512
  }
1316
1513
  };
1317
1514
  }
1318
- const Ea = [
1319
- Re,
1320
- Al,
1321
- ga,
1322
- ee,
1323
- Me,
1324
- Le,
1325
- xe,
1515
+ const Tt = [
1516
+ Be,
1517
+ Ml,
1518
+ dt,
1519
+ ct,
1520
+ At,
1521
+ Q,
1522
+ qe,
1523
+ He,
1524
+ Oe,
1525
+ Ge,
1326
1526
  Ie,
1327
- De,
1328
- Pe
1329
- ], ba = [
1330
- ml,
1331
- ve,
1332
- oe,
1333
- gl,
1527
+ Fe
1528
+ ], Rt = [
1529
+ yl,
1530
+ be,
1531
+ se,
1532
+ bl,
1334
1533
  hl,
1335
- El
1336
- ], ya = ha([...Ea, ...ba]), Ca = ya.install;
1534
+ Vl
1535
+ ], xt = Dt([...Tt, ...Rt]), Pt = xt.install;
1337
1536
  export {
1338
- Re as EzCheckbox,
1339
- Al as EzDialog,
1340
- $a as EzDynamicForm,
1341
- ga as EzFastTable,
1342
- ee as EzIcon,
1343
- Me as EzImageUpload,
1344
- Le as EzPagination,
1345
- xe as EzRadio,
1346
- Ie as EzSearchForm,
1347
- De as EzSelect,
1348
- Pe as EzTable,
1349
- c as FormItemType,
1350
- ya as default,
1351
- Ca as install
1537
+ tt as CHANGE_TRIGGER_TYPES,
1538
+ Be as EzCheckbox,
1539
+ Ml as EzDialog,
1540
+ dt as EzDynamicForm,
1541
+ At as EzFastTable,
1542
+ ct as EzFormItem,
1543
+ Q as EzIcon,
1544
+ qe as EzImageUpload,
1545
+ He as EzPagination,
1546
+ Oe as EzRadio,
1547
+ Ge as EzSearchForm,
1548
+ Ie as EzSelect,
1549
+ Fe as EzTable,
1550
+ A as FormItemType,
1551
+ lt as SELECT_FORM_TYPES,
1552
+ xt as default,
1553
+ at as getInputVerb,
1554
+ ot as getTrigger,
1555
+ Pt as install
1352
1556
  };