@maxtan/ez-ui 0.13.0 → 0.14.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 (36) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.js +1045 -688
  4. package/dist/types/components/checkbox/index.d.ts +24 -3
  5. package/dist/types/components/checkbox/src/checkbox.d.ts +4 -5
  6. package/dist/types/components/checkbox/src/checkbox.vue.d.ts +12 -1
  7. package/dist/types/components/dialog/index.d.ts +0 -15
  8. package/dist/types/components/dialog/src/dialog.d.ts +1 -5
  9. package/dist/types/components/dialog/src/dialog.vue.d.ts +0 -5
  10. package/dist/types/components/dynamic-form/index.d.ts +245 -0
  11. package/dist/types/components/dynamic-form/src/dynamic-form.d.ts +128 -0
  12. package/dist/types/components/dynamic-form/src/dynamic-form.vue.d.ts +398 -0
  13. package/dist/types/components/fast-table/index.d.ts +8 -9
  14. package/dist/types/components/fast-table/src/column-config.vue.d.ts +1 -1
  15. package/dist/types/components/fast-table/src/fast-table.vue.d.ts +4 -4
  16. package/dist/types/components/icon/src/icon.d.ts +0 -1
  17. package/dist/types/components/image-upload/index.d.ts +257 -352
  18. package/dist/types/components/image-upload/src/image-upload.vue.d.ts +253 -348
  19. package/dist/types/components/index.d.ts +1 -0
  20. package/dist/types/components/pagination/index.d.ts +37 -21
  21. package/dist/types/components/pagination/src/pagination.d.ts +0 -10
  22. package/dist/types/components/pagination/src/pagination.vue.d.ts +15 -8
  23. package/dist/types/components/radio/index.d.ts +24 -3
  24. package/dist/types/components/radio/src/radio.d.ts +2 -5
  25. package/dist/types/components/radio/src/radio.vue.d.ts +11 -1
  26. package/dist/types/components/search-form/index.d.ts +3 -3
  27. package/dist/types/components/search-form/src/search-form.d.ts +1 -1
  28. package/dist/types/components/search-form/src/search-form.vue.d.ts +1 -1
  29. package/dist/types/components/select/index.d.ts +19 -6
  30. package/dist/types/components/select/src/select.d.ts +0 -1
  31. package/dist/types/components/select/src/select.vue.d.ts +9 -2
  32. package/dist/types/components/table/index.d.ts +8 -9
  33. package/dist/types/components/table/src/table.d.ts +4 -5
  34. package/dist/types/components/table/src/table.vue.d.ts +4 -4
  35. package/dist/types/ez-ui/component.d.ts +1257 -583
  36. package/package.json +1 -4
package/dist/index.js CHANGED
@@ -1,10 +1,18 @@
1
- import { useLocale as Se, ElCheckbox as ge, ElCheckboxButton as Te, ElCheckboxGroup as Be, ElLoading as ae, ElDialog as Ve, ElButton as Y, ElScrollbar as Me, ElTable as Le, ElTableColumn as re, ElPagination as Pe, ElDrawer as Re, ElRadio as Ue, ElRadioButton as Ie, ElRadioGroup as qe, ElSelect as De, ElOptionGroup as Ae, ElOption as ie, ElUpload as ue, ElImage as de, ElImageViewer as Fe, ElMessage as J, ElInfiniteScroll as Oe, ElMessageBox as Ne, ElNotification as je, ElPopoverDirective as He } from "element-plus";
2
- import { defineComponent as v, computed as P, createBlock as p, openBlock as o, unref as s, normalizeProps as X, guardReactiveProps as oe, withCtx as d, createElementBlock as m, Fragment as R, renderList as O, resolveDynamicComponent as ye, mergeProps as k, createTextVNode as H, toDisplayString as A, mergeModels as K, useModel as F, resolveDirective as he, renderSlot as B, createCommentVNode as E, withDirectives as _e, ref as V, createSlots as te, createElementVNode as T, onMounted as be, nextTick as we, onUnmounted as Ke, normalizeStyle as $e, createVNode as S, normalizeClass as Ge, withModifiers as ce } from "vue";
3
- const U = (l, n) => (l.install = (e) => {
4
- for (const t of [l, ...Object.values({})])
5
- e.component(t.name, t);
6
- }, l);
7
- var Ye = {
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, g) => (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 g = {};
10
+ for (const o in t)
11
+ o === "class" || o === "style" || o.startsWith("on") || (g[o] = t[o]);
12
+ return g;
13
+ });
14
+ }
15
+ var bl = {
8
16
  s: {
9
17
  label: {
10
18
  name: "姓名",
@@ -84,414 +92,1039 @@ var Ye = {
84
92
  }
85
93
  }
86
94
  };
87
- const { s: Je } = Ye;
88
- function Ze(l, n) {
89
- return n.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, l);
95
+ const { s: yl } = bl;
96
+ function _l(t, g) {
97
+ return g.split(".").reduce((o, s) => o && typeof o == "object" ? o[s] : void 0, t);
90
98
  }
91
- function Qe(l, n = {}) {
92
- return l.replace(/\{\s*(\w+)\s*\}/g, (e, t) => {
93
- const r = n[t];
94
- return r !== void 0 ? String(r) : `{${t}}`;
99
+ function Vl(t, g = {}) {
100
+ return t.replace(/\{\s*(\w+)\s*\}/g, (o, s) => {
101
+ const f = g[s];
102
+ return f !== void 0 ? String(f) : `{${s}}`;
95
103
  });
96
104
  }
97
- function Q() {
98
- const { t: l, lang: n } = Se();
105
+ function se() {
106
+ const { t, lang: g } = Fe();
99
107
  return {
100
- t: (t, r = {}) => {
101
- const c = l(t, r);
102
- if (c !== t) return c;
103
- const a = Ze({ s: Je }, t);
104
- return typeof a == "string" ? Qe(a, r) : t;
108
+ t: (s, f = {}) => {
109
+ const v = t(s, f);
110
+ if (v !== s) return v;
111
+ const a = _l({ s: yl }, s);
112
+ return typeof a == "string" ? Vl(a, f) : s;
105
113
  },
106
- lang: n
114
+ lang: g
107
115
  };
108
116
  }
109
- const We = v({ name: "EzCheckbox" }), Xe = /* @__PURE__ */ v({
110
- ...We,
111
- props: {
117
+ const wl = $({ name: "EzCheckbox", inheritAttrs: !1 }), $l = /* @__PURE__ */ $({
118
+ ...wl,
119
+ props: /* @__PURE__ */ I({
112
120
  type: { default: "default" },
113
121
  options: { default: () => [] }
114
- },
115
- setup(l) {
116
- const n = l, e = P(
117
- () => ["default", "border"].includes(n.type) ? ge : Te
118
- );
119
- return (t, r) => (o(), p(s(Be), X(oe(t.$attrs)), {
120
- default: d(() => [
121
- (o(!0), m(R, null, O(t.options, (c) => (o(), p(ye(e.value), k({
122
- key: String(c.value),
122
+ }, {
123
+ modelValue: {},
124
+ modelModifiers: {}
125
+ }),
126
+ emits: /* @__PURE__ */ I(["change"], ["update:modelValue"]),
127
+ setup(t, { emit: g }) {
128
+ const o = t, s = g, f = P(t, "modelValue"), v = J(), a = Z(v), 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),
123
140
  ref_for: !0
124
- }, c, {
125
- value: c.value,
141
+ }, E, {
126
142
  border: t.type === "border"
127
143
  }), {
128
- default: d(() => [
129
- H(A(c.label), 1)
144
+ default: b(() => [
145
+ le(Y(E.label), 1)
130
146
  ]),
131
147
  _: 2
132
- }, 1040, ["value", "border"]))), 128))
148
+ }, 1040, ["border"]))), 128))
133
149
  ]),
134
150
  _: 1
135
- }, 16));
151
+ }, 16, ["modelValue"]));
136
152
  }
137
- }), et = U(Xe);
138
- var Z = /* @__PURE__ */ ((l) => (l.CANCEL = "取消", l.CONFIRM = "确定", l))(Z || {});
139
- const tt = { key: 1 }, lt = {
153
+ }), Re = F($l);
154
+ var re = /* @__PURE__ */ ((t) => (t.CANCEL = "取消", t.CONFIRM = "确定", t))(re || {});
155
+ const Cl = { key: 1 }, kl = {
140
156
  key: 0,
141
157
  class: "ez-dialog__body"
142
- }, at = { key: 1 }, ot = v({ name: "EzDialog", directives: { loading: ae.directive } }), st = /* @__PURE__ */ v({
143
- ...ot,
144
- props: /* @__PURE__ */ K({
158
+ }, zl = { key: 1 }, Tl = $({ name: "EzDialog", inheritAttrs: !1, directives: { loading: ve.directive } }), Sl = /* @__PURE__ */ $({
159
+ ...Tl,
160
+ props: /* @__PURE__ */ I({
145
161
  title: { default: "" },
146
162
  loading: { type: Boolean, default: !1 },
147
- cancelText: { default: Z.CANCEL },
148
- confirmText: { default: Z.CONFIRM },
149
- width: { default: 800 },
150
- appendToBody: { type: Boolean, default: !1 },
151
- destroyOnClose: { type: Boolean, default: !0 },
152
- closeOnPressEscape: { type: Boolean, default: !1 },
153
- closeOnClickModal: { type: Boolean, default: !1 }
163
+ cancelText: { default: re.CANCEL },
164
+ confirmText: { default: re.CONFIRM }
154
165
  }, {
155
166
  modelValue: { type: Boolean },
156
167
  modelModifiers: {}
157
168
  }),
158
- emits: /* @__PURE__ */ K(["cancel", "confirm"], ["update:modelValue"]),
159
- setup(l, { emit: n }) {
160
- const { t: e } = Q(), t = l, r = n, c = F(l, "modelValue"), a = () => {
161
- c.value = !1, r("cancel");
162
- }, b = () => {
163
- r("confirm");
169
+ emits: /* @__PURE__ */ I(["cancel", "confirm"], ["update:modelValue"]),
170
+ setup(t, { emit: g }) {
171
+ const { t: o } = se(), s = t, f = g, v = P(t, "modelValue"), a = J(), V = Z(a), u = () => {
172
+ v.value = !1, f("cancel");
173
+ }, _ = () => {
174
+ f("confirm");
164
175
  };
165
- return (f, h) => {
166
- const u = he("loading");
167
- return o(), p(s(Ve), k({
168
- modelValue: c.value,
169
- "onUpdate:modelValue": h[0] || (h[0] = ($) => c.value = $)
170
- }, f.$attrs, {
171
- width: t.width,
172
- "append-to-body": t.appendToBody,
173
- "close-on-click-modal": t.closeOnClickModal,
174
- "destroy-on-close": t.destroyOnClose,
175
- "close-on-press-escape": t.closeOnPressEscape,
176
- class: "ez-dialog"
177
- }), {
178
- header: d(() => [
179
- f.$slots.header ? B(f.$slots, "header", { key: 0 }) : (o(), m("p", tt, A(t.title), 1))
176
+ return (d, E) => {
177
+ const L = Te("loading");
178
+ return r(), p(l(We), h({
179
+ modelValue: v.value,
180
+ "onUpdate:modelValue": E[0] || (E[0] = (N) => v.value = N),
181
+ class: "ez-dialog",
182
+ width: 800,
183
+ "append-to-body": !1,
184
+ "close-on-click-modal": !1,
185
+ "destroy-on-close": !0,
186
+ "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))
180
190
  ]),
181
- default: d(() => [
182
- _e((o(), p(s(Me), null, {
183
- default: d(() => [
184
- f.$slots.default ? (o(), m("div", lt, [
185
- B(f.$slots, "default")
186
- ])) : E("", !0)
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)
187
197
  ]),
188
198
  _: 3
189
199
  })), [
190
- [u, t.loading]
200
+ [L, s.loading]
191
201
  ])
192
202
  ]),
193
- footer: d(() => [
194
- f.$slots.footer ? B(f.$slots, "footer", { key: 0 }) : (o(), m("div", at, [
195
- t.cancelText ? (o(), p(s(Y), {
203
+ footer: b(() => [
204
+ d.$slots.footer ? R(d.$slots, "footer", { key: 0 }) : (r(), w("div", zl, [
205
+ s.cancelText ? (r(), p(l(te), {
196
206
  key: 0,
197
207
  type: "default",
198
- onClick: a
208
+ onClick: u
199
209
  }, {
200
- default: d(() => [
201
- H(A(t.cancelText === s(Z).CANCEL ? s(e)("s.button.cancel") : t.cancelText), 1)
210
+ default: b(() => [
211
+ le(Y(s.cancelText === l(re).CANCEL ? l(o)("s.button.cancel") : s.cancelText), 1)
202
212
  ]),
203
213
  _: 1
204
- })) : E("", !0),
205
- t.confirmText ? (o(), p(s(Y), {
214
+ })) : A("", !0),
215
+ s.confirmText ? (r(), p(l(te), {
206
216
  key: 1,
207
217
  type: "primary",
208
- loading: t.loading,
209
- onClick: b
218
+ loading: s.loading,
219
+ onClick: _
210
220
  }, {
211
- default: d(() => [
212
- H(A(t.confirmText === s(Z).CONFIRM ? s(e)("s.button.confirm") : t.confirmText), 1)
221
+ default: b(() => [
222
+ le(Y(s.confirmText === l(re).CONFIRM ? l(o)("s.button.confirm") : s.confirmText), 1)
213
223
  ]),
214
224
  _: 1
215
- }, 8, ["loading"])) : E("", !0)
225
+ }, 8, ["loading"])) : A("", !0)
216
226
  ]))
217
227
  ]),
218
228
  _: 3
219
- }, 16, ["modelValue", "width", "append-to-body", "close-on-click-modal", "destroy-on-close", "close-on-press-escape"]);
229
+ }, 16, ["modelValue"]);
220
230
  };
221
231
  }
222
- }), nt = U(st), rt = v({ name: "EzTable" }), it = /* @__PURE__ */ v({
223
- ...rt,
224
- props: {
225
- data: { default: () => [] },
226
- columns: { default: () => [] },
227
- border: { type: Boolean, default: !0 },
228
- rowKey: { default: "id" }
229
- },
230
- setup(l, { expose: n }) {
231
- const e = l, t = V(), r = (a) => {
232
- const b = e.columns[e.columns.length - 1], f = () => a.type ? !1 : a.prop !== b.prop;
233
- return { ...{
234
- align: "center",
235
- hidden: 1,
236
- resizable: !0,
237
- reserveSelection: a.type === "selection",
238
- /** 默认最后一个 */
239
- showOverflowTooltip: f()
240
- }, ...a };
232
+ }), Al = F(Sl), Ul = $({ name: "EzSelect", inheritAttrs: !1 }), Rl = /* @__PURE__ */ $({
233
+ ...Ul,
234
+ props: /* @__PURE__ */ I({
235
+ options: { default: () => [] }
236
+ }, {
237
+ modelValue: {},
238
+ modelModifiers: {}
239
+ }),
240
+ emits: ["update:modelValue"],
241
+ setup(t) {
242
+ const g = t, o = P(t, "modelValue"), s = (a) => typeof a > "u", f = (a) => !s(a.options), v = (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),
246
+ clearable: ""
247
+ }, a.$attrs), {
248
+ default: b(() => [
249
+ (r(!0), w(O, null, W(g.options, (u, _) => (r(), w(O, {
250
+ key: v(u, _)
251
+ }, [
252
+ f(u) ? (r(), p(l(Ye), h({
253
+ key: 0,
254
+ 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: v(d, d.value)
259
+ }, { ref_for: !0 }, d), null, 16))), 128))
260
+ ]),
261
+ _: 2
262
+ }, 1040)) : (r(), p(l(be), h({
263
+ key: 1,
264
+ ref_for: !0
265
+ }, u), null, 16))
266
+ ], 64))), 128))
267
+ ]),
268
+ _: 1
269
+ }, 16, ["modelValue"]));
270
+ }
271
+ }), De = F(Rl), Dl = $({ name: "EzRadio", inheritAttrs: !1 }), xl = /* @__PURE__ */ $({
272
+ ...Dl,
273
+ props: /* @__PURE__ */ I({
274
+ type: { default: "default" },
275
+ options: { default: () => [] }
276
+ }, {
277
+ modelValue: { type: [String, Number, Boolean] },
278
+ modelModifiers: {}
279
+ }),
280
+ emits: /* @__PURE__ */ I(["change"], ["update:modelValue"]),
281
+ setup(t, { emit: g }) {
282
+ const o = t, s = g, f = P(t, "modelValue"), v = J(), a = Z(v), V = M(() => ["default", "border"].includes(o.type) ? Je : Ze), u = (_) => {
283
+ s("change", _);
241
284
  };
242
- return n({
243
- getTableRef: () => t.value
244
- }), (a, b) => {
245
- var f, h;
246
- return o(), p(s(Le), k(a.$attrs, {
247
- ref_key: "tableRef",
248
- ref: t,
249
- data: e.data,
250
- border: e.border,
251
- "row-key": e.rowKey
252
- }), te({
253
- default: d(() => [
254
- (o(!0), m(R, null, O(e.columns, (u) => (o(), m(R, {
255
- key: u.prop
256
- }, [
257
- ["selection", "index"].includes(u.type) ? (o(), p(s(re), k({
258
- key: 0,
259
- ref_for: !0
260
- }, r(u)), null, 16)) : u.hidden ? E("", !0) : (o(), p(s(re), k({
261
- key: 1,
262
- ref_for: !0
263
- }, r(u)), te({ _: 2 }, [
264
- a.$slots[u.prop] ? {
265
- name: "default",
266
- fn: d(($) => [
267
- B(a.$slots, u.prop, k({ ref_for: !0 }, $))
268
- ]),
269
- key: "0"
270
- } : u.transform ? {
271
- name: "default",
272
- fn: d(($) => [
273
- H(A(u.transform($.row)), 1)
274
- ]),
275
- key: "1"
276
- } : void 0,
277
- a.$slots[`header-${u.prop}`] ? {
278
- name: "header",
279
- fn: d(($) => [
280
- B(a.$slots, `header-${u.prop}`, k({ ref_for: !0 }, $))
281
- ]),
282
- key: "2"
283
- } : void 0
284
- ]), 1040))
285
- ], 64))), 128))
286
- ]),
287
- _: 2
288
- }, [
289
- (f = a.$slots) != null && f.append ? {
290
- name: "append",
291
- fn: d(() => [
292
- B(a.$slots, "append")
293
- ]),
294
- key: "0"
295
- } : void 0,
296
- (h = a.$slots) != null && h.empty ? {
297
- name: "empty",
298
- fn: d(() => [
299
- B(a.$slots, "empty")
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),
292
+ ref_for: !0
293
+ }, E, {
294
+ border: t.type === "border"
295
+ }), {
296
+ default: b(() => [
297
+ le(Y(E.label), 1)
300
298
  ]),
301
- key: "1"
302
- } : void 0
303
- ]), 1040, ["data", "border", "row-key"]);
304
- };
299
+ _: 2
300
+ }, 1040, ["border"]))), 128))
301
+ ]),
302
+ _: 1
303
+ }, 16, ["modelValue"]));
305
304
  }
306
- }), ke = U(it), ut = {
305
+ }), xe = F(xl), Ml = $({ name: "EzIcon", inheritAttrs: !1 }), Pl = /* @__PURE__ */ $({
306
+ ...Ml,
307
+ props: {
308
+ size: { default: 20 },
309
+ color: { default: "inherit" }
310
+ },
311
+ setup(t) {
312
+ const g = t, o = M(() => {
313
+ const { size: s, color: f } = g;
314
+ return !s && !f ? {} : {
315
+ fontSize: s ? `${s}px` : void 0,
316
+ color: f
317
+ };
318
+ });
319
+ return (s, f) => (r(), w("i", h({
320
+ class: "ez-icon",
321
+ style: o.value
322
+ }, s.$attrs), [
323
+ R(s.$slots, "default", { class: "w-[1em] h-[1em]" })
324
+ ], 16));
325
+ }
326
+ }), ee = F(Pl), Il = {
307
327
  xmlns: "http://www.w3.org/2000/svg",
308
328
  width: "200",
309
329
  height: "200",
310
330
  viewBox: "0 0 1024 1024"
311
- }, dt = /* @__PURE__ */ v({
331
+ }, Ll = /* @__PURE__ */ $({
312
332
  name: "ArrowDown",
313
333
  __name: "ArrowDown",
314
- setup(l) {
315
- return (n, e) => (o(), m("svg", ut, e[0] || (e[0] = [
316
- T("path", {
334
+ setup(t) {
335
+ return (g, o) => (r(), w("svg", Il, [...o[0] || (o[0] = [
336
+ D("path", {
317
337
  fill: "currentColor",
318
338
  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"
319
339
  }, null, -1)
320
- ])));
340
+ ])]));
321
341
  }
322
- }), ct = {
342
+ }), Nl = {
323
343
  xmlns: "http://www.w3.org/2000/svg",
324
344
  width: "200",
325
345
  height: "200",
326
346
  viewBox: "0 0 1024 1024"
327
- }, ft = /* @__PURE__ */ v({
347
+ }, Bl = /* @__PURE__ */ $({
328
348
  name: "ArrowUp",
329
349
  __name: "ArrowUp",
330
- setup(l) {
331
- return (n, e) => (o(), m("svg", ct, e[0] || (e[0] = [
332
- T("path", {
350
+ setup(t) {
351
+ return (g, o) => (r(), w("svg", Nl, [...o[0] || (o[0] = [
352
+ D("path", {
333
353
  fill: "currentColor",
334
354
  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"
335
355
  }, null, -1)
336
- ])));
356
+ ])]));
337
357
  }
338
- }), pt = {
358
+ }), Ol = {
339
359
  xmlns: "http://www.w3.org/2000/svg",
340
360
  width: "200",
341
361
  height: "200",
342
362
  viewBox: "0 0 1024 1024"
343
- }, fe = /* @__PURE__ */ v({
363
+ }, $e = /* @__PURE__ */ $({
344
364
  name: "Delete",
345
365
  __name: "delete",
346
- setup(l) {
347
- return (n, e) => (o(), m("svg", pt, e[0] || (e[0] = [
348
- T("path", {
366
+ setup(t) {
367
+ return (g, o) => (r(), w("svg", Ol, [...o[0] || (o[0] = [
368
+ D("path", {
349
369
  fill: "currentColor",
350
370
  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"
351
371
  }, null, -1)
352
- ])));
372
+ ])]));
353
373
  }
354
- }), mt = {
374
+ }), Hl = {
355
375
  xmlns: "http://www.w3.org/2000/svg",
356
376
  width: "200",
357
377
  height: "200",
358
378
  viewBox: "0 0 1024 1024"
359
- }, pe = /* @__PURE__ */ v({
379
+ }, Ce = /* @__PURE__ */ $({
360
380
  name: "Plus",
361
381
  __name: "plus",
362
- setup(l) {
363
- return (n, e) => (o(), m("svg", mt, e[0] || (e[0] = [
364
- T("path", {
382
+ setup(t) {
383
+ return (g, o) => (r(), w("svg", Hl, [...o[0] || (o[0] = [
384
+ D("path", {
365
385
  fill: "currentColor",
366
386
  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"
367
387
  }, null, -1)
368
- ])));
388
+ ])]));
369
389
  }
370
- }), vt = {
390
+ }), ql = {
371
391
  xmlns: "http://www.w3.org/2000/svg",
372
392
  width: "200",
373
393
  height: "200",
374
394
  viewBox: "0 0 1024 1024"
375
- }, gt = /* @__PURE__ */ v({
395
+ }, Fl = /* @__PURE__ */ $({
376
396
  name: "Setting",
377
397
  __name: "setting",
378
- setup(l) {
379
- return (n, e) => (o(), m("svg", vt, e[0] || (e[0] = [
380
- T("path", {
398
+ setup(t) {
399
+ return (g, o) => (r(), w("svg", ql, [...o[0] || (o[0] = [
400
+ D("path", {
381
401
  fill: "currentColor",
382
402
  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"
383
403
  }, null, -1)
384
- ])));
404
+ ])]));
385
405
  }
386
- }), yt = {
406
+ }), Gl = {
387
407
  xmlns: "http://www.w3.org/2000/svg",
388
408
  width: "200",
389
409
  height: "200",
390
410
  viewBox: "0 0 1024 1024"
391
- }, me = /* @__PURE__ */ v({
411
+ }, ke = /* @__PURE__ */ $({
392
412
  name: "ZoomIn",
393
413
  __name: "ZoomIn",
394
- setup(l) {
395
- return (n, e) => (o(), m("svg", yt, e[0] || (e[0] = [
396
- T("path", {
414
+ setup(t) {
415
+ return (g, o) => (r(), w("svg", Gl, [...o[0] || (o[0] = [
416
+ D("path", {
397
417
  fill: "currentColor",
398
418
  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"
399
419
  }, null, -1),
400
- T("path", {
420
+ D("path", {
401
421
  fill: "currentColor",
402
422
  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"
403
423
  }, null, -1)
404
- ])));
424
+ ])]));
425
+ }
426
+ }), jl = { class: "ez-image-upload" }, Wl = {
427
+ key: 0,
428
+ class: "ez-image-upload__image"
429
+ }, Kl = {
430
+ key: 1,
431
+ 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({
435
+ api: { type: Function, default: () => Promise.resolve({ url: "" }) },
436
+ imageTypes: { default: () => ["image/webp", "image/png", "image/jpg", "image/gif", "image/bmp", "image/jpeg"] },
437
+ limitSize: { default: 10 },
438
+ style: { default: () => ({ width: "100px", height: "100px" }) },
439
+ fit: { default: "contain" },
440
+ multiple: { type: Boolean, default: !1 },
441
+ limit: { default: 9 },
442
+ disabled: { type: Boolean, default: !1 }
443
+ }, {
444
+ modelValue: {},
445
+ modelModifiers: {}
446
+ }),
447
+ emits: ["update:modelValue"],
448
+ setup(t, { expose: g }) {
449
+ const o = t, s = J(), f = Z(s), { t: v } = 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()));
459
+ }
460
+ return H && z && k.push(z.trim()), k.filter((q) => q && i.test(q));
461
+ }
462
+ function N(C) {
463
+ return !C || C.length === 0 ? "" : C.filter((i) => i.trim()).map((i) => i.trim()).join(",");
464
+ }
465
+ const B = (C) => o.disabled ? (oe.warning(v("s.message.disabled")), !1) : o.imageTypes.includes(C.type.toLocaleLowerCase()) ? C.size > o.limitSize * 1024 * 1024 ? (oe.error(v("s.validate.upload.limit", { max: o.limitSize })), !1) : !0 : (oe.error(v("s.validate.upload.image")), !1), j = async ({ file: C }) => {
466
+ if (!o.disabled)
467
+ try {
468
+ const { url: i } = await o.api(C);
469
+ if (!i) throw new Error(v("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));
473
+ } else
474
+ u.value = i;
475
+ } catch (i) {
476
+ oe.error(i.message);
477
+ }
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(","));
485
+ } else
486
+ u.value = null;
487
+ }, T = x();
488
+ return g({
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,
495
+ class: "ez-image-upload__item",
496
+ style: Ae(o.style)
497
+ }, [
498
+ S(l(_e), {
499
+ src: k,
500
+ fit: o.fit
501
+ }, null, 8, ["src", "fit"]),
502
+ D("div", {
503
+ class: "ez-image-upload__handler",
504
+ onClick: i[3] || (i[3] = ge(() => {
505
+ }, ["stop"]))
506
+ }, [
507
+ S(l(ee), {
508
+ size: 18,
509
+ onClick: (H) => K(k, z)
510
+ }, {
511
+ default: b(() => [
512
+ S(l(ke))
513
+ ]),
514
+ _: 1
515
+ }, 8, ["onClick"]),
516
+ o.disabled ? A("", !0) : (r(), p(l(ee), {
517
+ key: 0,
518
+ size: 18,
519
+ onClick: (H) => X(k)
520
+ }, {
521
+ default: b(() => [
522
+ S(l($e))
523
+ ]),
524
+ _: 1
525
+ }, 8, ["onClick"]))
526
+ ])
527
+ ], 4))), 128)),
528
+ E.value.length < o.limit && !o.disabled || E.value.length === 0 ? (r(), p(l(ye), h({ key: 0 }, l(f), {
529
+ ref_key: "uploadRef",
530
+ ref: T,
531
+ action: "",
532
+ accept: "image/*",
533
+ "show-file-list": !1,
534
+ "before-upload": B,
535
+ "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"]
539
+ }), {
540
+ default: b(() => [
541
+ D("div", Xl, [
542
+ S(l(ee), null, {
543
+ default: b(() => [
544
+ S(l(Ce))
545
+ ]),
546
+ _: 1
547
+ })
548
+ ])
549
+ ]),
550
+ _: 1
551
+ }, 16, ["style", "disabled", "class"])) : A("", !0)
552
+ ])) : (r(), p(l(ye), h({ key: 0 }, l(f), {
553
+ ref_key: "uploadRef",
554
+ ref: T,
555
+ action: "",
556
+ accept: "image/*",
557
+ "show-file-list": !1,
558
+ "before-upload": B,
559
+ "http-request": j,
560
+ style: o.style,
561
+ disabled: o.disabled,
562
+ class: ["ez-image-upload__wrapper", { "is-disabled": o.disabled }]
563
+ }), {
564
+ default: b(() => [
565
+ u.value ? (r(), w("div", Wl, [
566
+ S(l(_e), {
567
+ src: u.value,
568
+ fit: o.fit
569
+ }, null, 8, ["src", "fit"]),
570
+ D("div", {
571
+ class: "ez-image-upload__handler",
572
+ onClick: i[2] || (i[2] = ge(() => {
573
+ }, ["stop"]))
574
+ }, [
575
+ S(l(ee), {
576
+ size: 18,
577
+ onClick: i[0] || (i[0] = (k) => K(u.value, 0))
578
+ }, {
579
+ default: b(() => [
580
+ S(l(ke))
581
+ ]),
582
+ _: 1
583
+ }),
584
+ o.disabled ? A("", !0) : (r(), p(l(ee), {
585
+ key: 0,
586
+ size: 18,
587
+ onClick: i[1] || (i[1] = (k) => X(u.value))
588
+ }, {
589
+ default: b(() => [
590
+ S(l($e))
591
+ ]),
592
+ _: 1
593
+ }))
594
+ ])
595
+ ])) : (r(), p(l(ee), { key: 1 }, {
596
+ default: b(() => [
597
+ S(l(Ce))
598
+ ]),
599
+ _: 1
600
+ }))
601
+ ]),
602
+ _: 1
603
+ }, 16, ["style", "disabled", "class"])),
604
+ a.value ? (r(), p(l(el), {
605
+ 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)
610
+ ]));
405
611
  }
406
- }), ht = { class: "ez-search-from" }, _t = { class: "ez-search-from_operate" }, bt = v({ name: "EzSearchForm", inheritAttrs: !1 }), wt = /* @__PURE__ */ v({
407
- ...bt,
408
- props: /* @__PURE__ */ K({
409
- arrowHeight: { default: 50 },
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: {
617
+ items: { default: () => [] },
618
+ modelValue: {},
619
+ cols: { default: 1 },
620
+ gutter: { default: 20 },
621
+ formProps: {}
622
+ },
623
+ emits: ["update:modelValue"],
624
+ setup(t, { expose: g, emit: o }) {
625
+ const s = t, f = o, v = 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;
652
+ }
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)
686
+ 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;
690
+ }
691
+ return !1;
692
+ }, k = async () => {
693
+ if (!v.value)
694
+ return console.warn("[EzDynamicForm] Form ref is not available"), !1;
695
+ try {
696
+ return await v.value.validate(), !0;
697
+ } catch {
698
+ return !1;
699
+ }
700
+ }, z = async (n) => {
701
+ if (!v.value)
702
+ return console.warn("[EzDynamicForm] Form ref is not available"), !1;
703
+ try {
704
+ return await v.value.validateField(n), !0;
705
+ } catch {
706
+ return !1;
707
+ }
708
+ }, H = (n) => {
709
+ if (!v.value) {
710
+ console.warn("[EzDynamicForm] Form ref is not available");
711
+ return;
712
+ }
713
+ v.value.clearValidate(n);
714
+ }, ae = (n) => {
715
+ if (!v.value) {
716
+ console.warn("[EzDynamicForm] Form ref is not available");
717
+ return;
718
+ }
719
+ v.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
+ });
730
+ };
731
+ he(
732
+ () => s.modelValue,
733
+ (n) => {
734
+ n && !V && typeof n == "object" && (V = !0, a.value = { ...n }, ue(() => {
735
+ V = !1;
736
+ }));
737
+ },
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));
747
+ },
748
+ { deep: !0, flush: "post" }
749
+ ), fe(() => {
750
+ d();
751
+ }), g({
752
+ validate: k,
753
+ validateField: z,
754
+ clearValidate: H,
755
+ resetFields: ae,
756
+ getFormData: q,
757
+ setFormData: G,
758
+ formRef: v
759
+ }), (n, y) => (r(), p(l(ll), h({
760
+ ref_key: "formRef",
761
+ ref: v,
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)
772
+ }, {
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],
784
+ formData: a.value
785
+ }) : e.component ? (r(), p(ce(e.component), h({
786
+ key: 1,
787
+ modelValue: a.value[e.prop],
788
+ "onUpdate:modelValue": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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": (m) => a.value[e.prop] = m,
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))
931
+ ]),
932
+ _: 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"])
942
+ ]),
943
+ _: 2
944
+ }, 1032, ["span"]))), 128))
945
+ ]),
946
+ _: 3
947
+ }, 8, ["gutter"])
948
+ ]),
949
+ _: 3
950
+ }, 16, ["model"]));
951
+ }
952
+ }), $a = F(Ql), ea = $({ name: "EzTable", inheritAttrs: !1 }), la = /* @__PURE__ */ $({
953
+ ...ea,
954
+ props: {
955
+ data: { default: () => [] },
956
+ columns: { default: () => [] },
957
+ rowKey: {}
958
+ },
959
+ setup(t, { expose: g }) {
960
+ const o = t, s = x(), f = J(), v = Z(f), a = (u) => {
961
+ const _ = o.columns[o.columns.length - 1], d = () => u.type ? !1 : u.prop !== _.prop;
962
+ return { ...{
963
+ align: "center",
964
+ hidden: 1,
965
+ resizable: !0,
966
+ reserveSelection: u.type === "selection",
967
+ /** 默认最后一个 */
968
+ showOverflowTooltip: d()
969
+ }, ...u };
970
+ };
971
+ return g({
972
+ getTableRef: () => s.value
973
+ }), (u, _) => (r(), p(l(cl), h({
974
+ ref_key: "tableRef",
975
+ ref: s,
976
+ data: o.data,
977
+ border: "",
978
+ "row-key": "id"
979
+ }, l(v)), de({
980
+ default: b(() => [
981
+ (r(!0), w(O, null, W(o.columns, (d) => (r(), w(O, {
982
+ key: d.prop
983
+ }, [
984
+ ["selection", "index"].includes(d.type) ? (r(), p(l(we), h({
985
+ key: 0,
986
+ ref_for: !0
987
+ }, a(d)), null, 16)) : d.hidden ? A("", !0) : (r(), p(l(we), h({
988
+ key: 1,
989
+ ref_for: !0
990
+ }, a(d)), de({ _: 2 }, [
991
+ u.$slots[d.prop] ? {
992
+ name: "default",
993
+ fn: b((E) => [
994
+ R(u.$slots, d.prop, h({ ref_for: !0 }, E))
995
+ ]),
996
+ key: "0"
997
+ } : d.transform ? {
998
+ name: "default",
999
+ fn: b((E) => [
1000
+ le(Y(d.transform(E.row)), 1)
1001
+ ]),
1002
+ key: "1"
1003
+ } : void 0,
1004
+ u.$slots[`header-${d.prop}`] ? {
1005
+ name: "header",
1006
+ fn: b((E) => [
1007
+ R(u.$slots, `header-${d.prop}`, h({ ref_for: !0 }, E))
1008
+ ]),
1009
+ key: "2"
1010
+ } : void 0
1011
+ ]), 1040))
1012
+ ], 64))), 128))
1013
+ ]),
1014
+ _: 2
1015
+ }, [
1016
+ u.$slots?.append ? {
1017
+ name: "append",
1018
+ fn: b(() => [
1019
+ R(u.$slots, "append")
1020
+ ]),
1021
+ key: "0"
1022
+ } : void 0,
1023
+ u.$slots?.empty ? {
1024
+ name: "empty",
1025
+ fn: b(() => [
1026
+ R(u.$slots, "empty")
1027
+ ]),
1028
+ key: "1"
1029
+ } : void 0
1030
+ ]), 1040, ["data"]));
1031
+ }
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({
1035
+ collapsedHeight: { default: 50 },
410
1036
  reset: { type: Boolean }
411
1037
  }, {
412
1038
  expanded: { default: !1 },
413
1039
  expandedModifiers: {}
414
1040
  }),
415
1041
  emits: ["update:expanded"],
416
- setup(l, { expose: n }) {
417
- const e = l, { t } = Q(), r = V(), c = V(0), a = F(l, "expanded"), b = P(() => c.value > e.arrowHeight), f = P(() => a.value ? ft : dt), h = P(() => a.value ? t("s.button.collapse") : t("s.button.expand")), u = () => {
418
- const L = setTimeout(() => {
419
- if (clearTimeout(L), r.value) {
420
- const { height: M } = r.value.getBoundingClientRect();
421
- c.value = M;
422
- }
423
- }, 50);
424
- }, $ = () => {
1042
+ setup(t, { expose: g }) {
1043
+ const o = t, { t: s } = se(), f = x(), v = x(0), a = P(t, "expanded"), V = M(() => v.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 && (v.value = f.value.scrollHeight, console.log(v.value, o.collapsedHeight, V.value));
1047
+ }, L = () => {
425
1048
  a.value = !a.value;
426
1049
  };
427
- return be(() => {
428
- we(u), window.addEventListener("resize", u);
429
- }), Ke(() => {
430
- window.removeEventListener("resize", u);
431
- }), n({
432
- countViewHeight: u
433
- }), (L, M) => (o(), m("div", ht, [
434
- T("div", {
435
- class: "overflow-hidden transition-[height] duration-300 ease-linear",
436
- style: $e({
437
- height: a.value ? `${c.value}px` : `${e.arrowHeight}px`
1050
+ return fe(() => {
1051
+ setTimeout(() => {
1052
+ f.value && (E(), d = new ResizeObserver(E), d.observe(f.value));
1053
+ }, 50);
1054
+ }), Oe(() => {
1055
+ d && (d.disconnect(), d = null);
1056
+ }), g({
1057
+ countViewHeight: E
1058
+ }), (N, B) => (r(), w("div", aa, [
1059
+ D("div", {
1060
+ class: "ez-search-form__wrapper",
1061
+ style: Ae({
1062
+ height: v.value ? a.value ? `${v.value}px` : `${o.collapsedHeight}px` : "auto"
438
1063
  })
439
1064
  }, [
440
- T("div", _t, [
441
- B(L.$slots, "operate"),
442
- b.value ? (o(), p(s(Y), {
1065
+ D("div", ta, [
1066
+ R(N.$slots, "operate"),
1067
+ V.value ? (r(), p(l(te), {
443
1068
  key: 0,
444
- icon: f.value,
1069
+ icon: u.value,
445
1070
  size: "small",
446
- title: h.value,
1071
+ title: _.value,
447
1072
  circle: "",
448
- onClick: M[0] || (M[0] = (N) => $())
449
- }, null, 8, ["icon", "title"])) : E("", !0)
1073
+ onClick: B[0] || (B[0] = (j) => L())
1074
+ }, null, 8, ["icon", "title"])) : A("", !0)
450
1075
  ]),
451
- T("div", {
1076
+ D("div", {
452
1077
  ref_key: "wrapRef",
453
- ref: r
1078
+ ref: f
454
1079
  }, [
455
- B(L.$slots, "default")
1080
+ R(N.$slots, "default")
456
1081
  ], 512)
457
1082
  ], 4)
458
1083
  ]));
459
1084
  }
460
- }), ze = U(wt), $t = v({ name: "EzPagination" }), kt = /* @__PURE__ */ v({
461
- ...$t,
1085
+ }), Ie = F(ra), sa = $({ name: "EzPagination", inheritAttrs: !1 }), na = /* @__PURE__ */ $({
1086
+ ...sa,
462
1087
  props: {
463
- background: { type: Boolean, default: !1 },
464
- size: { default: "default" },
465
- total: { default: 0 },
466
- pageSizes: { default: () => [10, 20, 50, 100] },
467
- layout: { default: "total, sizes, prev, pager, next, jumper" }
1088
+ currentPage: {},
1089
+ currentPageModifiers: {},
1090
+ pageSize: {},
1091
+ pageSizeModifiers: {}
468
1092
  },
469
- setup(l) {
470
- const n = l;
471
- return (e, t) => (o(), p(s(Pe), k({
472
- "page-sizes": n.pageSizes,
473
- background: n.background,
474
- size: n.size,
475
- layout: n.layout,
476
- total: n.total
477
- }, e.$attrs), null, 16, ["page-sizes", "background", "size", "layout", "total"]));
1093
+ emits: /* @__PURE__ */ I(["current-change", "size-change"], ["update:currentPage", "update:pageSize"]),
1094
+ setup(t, { emit: g }) {
1095
+ const o = g, s = P(t, "currentPage"), f = P(t, "pageSize"), v = J(), a = Z(v), 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),
1105
+ "page-sizes": [10, 20, 50, 100],
1106
+ layout: "total, sizes, prev, pager, next, jumper"
1107
+ }, l(a), {
1108
+ onCurrentChange: V,
1109
+ onSizeChange: u
1110
+ }), null, 16, ["current-page", "page-size"]));
478
1111
  }
479
- }), Ce = U(kt);
480
- var le = /* @__PURE__ */ ((l) => (l.ASC = "ascending", l.DESC = "descending", l[l.EMPTY = null] = "EMPTY", l))(le || {});
481
- const zt = (l) => {
482
- const n = V([]), e = P(() => n.value), t = P(() => n.value.map((a) => a[l]));
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 g = x([]), o = M(() => g.value), s = M(() => g.value.map((a) => a[t]));
483
1116
  return {
484
1117
  selectionChange: (a) => {
485
- n.value = a;
1118
+ g.value = a;
486
1119
  },
487
- getSelectedList: e,
488
- getSelectedIds: t,
489
- getSortParams: ({ prop: a, order: b }) => {
490
- const f = { asc: null, desc: null };
491
- return b === le.ASC ? (f.asc = a, f.desc = null) : b === le.DESC && (f.asc = null, f.desc = a), f;
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;
492
1125
  }
493
1126
  };
494
- }, Ct = /* @__PURE__ */ v({
1127
+ }, da = /* @__PURE__ */ $({
495
1128
  __name: "column-config",
496
1129
  props: {
497
1130
  modelValue: { type: Boolean, default: !1 },
@@ -499,55 +1132,54 @@ const zt = (l) => {
499
1132
  columns: { default: () => [] },
500
1133
  columnsModifiers: {}
501
1134
  },
502
- emits: /* @__PURE__ */ K(["change"], ["update:modelValue", "update:columns"]),
503
- setup(l, { emit: n }) {
504
- const { t: e } = Q(), t = ["selection", "index", "expand"], r = n, c = F(l, "modelValue"), a = F(l, "columns"), b = (f) => a.value.filter((u) => u.hidden === 0).length < 2 && f.hidden === 0;
505
- return (f, h) => (o(), p(s(Re), {
506
- modelValue: c.value,
507
- "onUpdate:modelValue": h[1] || (h[1] = (u) => c.value = u),
1135
+ emits: /* @__PURE__ */ I(["change"], ["update:modelValue", "update:columns"]),
1136
+ setup(t, { emit: g }) {
1137
+ const { t: o } = se(), s = ["selection", "index", "expand"], f = g, v = 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: v.value,
1140
+ "onUpdate:modelValue": _[1] || (_[1] = (d) => v.value = d),
508
1141
  class: "ez-column-wrapper",
509
- title: s(e)("s.label.column"),
1142
+ title: l(o)("s.label.column"),
510
1143
  size: "15%"
511
1144
  }, {
512
- default: d(() => [
513
- (o(!0), m(R, null, O(a.value, (u) => (o(), m(R, {
514
- key: u.prop
1145
+ default: b(() => [
1146
+ (r(!0), w(O, null, W(a.value, (d) => (r(), w(O, {
1147
+ key: d.prop
515
1148
  }, [
516
- t.includes(u.type) ? E("", !0) : (o(), p(s(ge), {
1149
+ s.includes(d.type) ? A("", !0) : (r(), p(l(Ue), {
517
1150
  key: 0,
518
- modelValue: u.hidden,
519
- "onUpdate:modelValue": ($) => u.hidden = $,
1151
+ modelValue: d.hidden,
1152
+ "onUpdate:modelValue": (E) => d.hidden = E,
520
1153
  class: "flex",
521
1154
  "true-value": 0,
522
1155
  "false-value": 1,
523
- label: u.label,
1156
+ label: d.label,
524
1157
  checked: "",
525
- disabled: b(u),
526
- onChange: h[0] || (h[0] = ($) => r("change"))
1158
+ disabled: V(d),
1159
+ onChange: _[0] || (_[0] = (E) => f("change"))
527
1160
  }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "disabled"]))
528
1161
  ], 64))), 128))
529
1162
  ]),
530
1163
  _: 1
531
1164
  }, 8, ["modelValue", "title"]));
532
1165
  }
533
- }), Et = { class: "ez-fast-table" }, xt = { class: "ez-fast-table-wrapper" }, St = {
1166
+ }), ia = { class: "ez-fast-table" }, pa = { class: "ez-fast-table_wrapper" }, ca = {
534
1167
  key: 0,
535
- class: "ez-fast-table-wrapper_header_operation"
536
- }, Tt = { class: "mt-[10px] flex justify-end" }, Bt = v({
1168
+ class: "ez-fast-table_wrapper_header_operation"
1169
+ }, fa = { class: "ez-fast-table_pagination" }, va = $({
537
1170
  name: "EzFastTable",
538
- directives: { loading: ae.directive },
1171
+ directives: { loading: ve.directive },
539
1172
  inheritAttrs: !1
540
- }), Vt = /* @__PURE__ */ v({
541
- ...Bt,
542
- props: /* @__PURE__ */ K({
1173
+ }), ma = /* @__PURE__ */ $({
1174
+ ...va,
1175
+ props: /* @__PURE__ */ I({
543
1176
  api: { type: Function, default: () => Promise.resolve() },
544
1177
  beforeSearch: { type: Function, default: () => Promise.resolve() },
545
1178
  columnTool: { type: Boolean, default: !0 },
546
1179
  expanded: { type: Boolean, default: !1 },
547
1180
  data: {},
548
1181
  columns: {},
549
- border: { type: Boolean },
550
- rowKey: { default: "id" }
1182
+ rowKey: {}
551
1183
  }, {
552
1184
  params: {},
553
1185
  paramsModifiers: {},
@@ -556,440 +1188,165 @@ const zt = (l) => {
556
1188
  loading: { type: Boolean },
557
1189
  loadingModifiers: {}
558
1190
  }),
559
- emits: /* @__PURE__ */ K(["changePage", "reset", "query"], ["update:params", "update:columns", "update:loading"]),
560
- setup(l, { expose: n, emit: e }) {
561
- const { t } = Q(), r = l, c = V(r.expanded), { selectionChange: a, getSelectedList: b, getSortParams: f, getSelectedIds: h } = zt(r.rowKey), u = V(null), $ = V(!1), L = V(null), M = V([]), N = V(0), G = e, x = F(l, "params"), g = F(l, "columns"), i = F(l, "loading"), _ = async () => {
1191
+ emits: /* @__PURE__ */ I(["changePage", "reset", "query"], ["update:params", "update:columns", "update:loading"]),
1192
+ setup(t, { expose: g, emit: o }) {
1193
+ const { t: s } = se(), f = t, v = J(), a = Z(v), 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 () => {
562
1194
  try {
563
- i.value = !0, await r.beforeSearch(x.value);
564
- const { code: y, data: w } = await r.api(x.value);
565
- y === 200 && w.records ? (M.value = w.records || [], N.value = w.total) : (M.value = [], N.value = 0), G("query");
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");
566
1198
  } finally {
567
1199
  i.value = !1;
568
1200
  }
569
1201
  }, z = () => {
570
- x.value.current = 1, _();
571
- }, I = () => {
572
- var y;
573
- return (y = u.value) == null ? void 0 : y.getTableRef();
574
- }, W = (y) => {
575
- const w = f(y);
576
- x.value = { ...x.value, ...w };
577
- const { column: ee } = y;
578
- ee.sortable === "custom" && z();
579
- }, q = (y) => JSON.parse(JSON.stringify(y)), D = () => {
580
- x.value = q(L.value), G("reset"), we(() => z());
581
- }, se = (y) => {
582
- G("changePage", y), y.size ? z() : _();
583
- }, Ee = () => {
584
- I().doLayout();
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: m } = y;
1207
+ m.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();
585
1214
  };
586
- return be(() => {
587
- L.value = q(x.value);
588
- }), n({ search: z, query: _, getTableRef: I }), (y, w) => {
589
- const ee = he("loading");
590
- return o(), m("div", Et, [
591
- y.$slots.form ? (o(), p(s(ze), {
1215
+ return fe(() => {
1216
+ B.value = q(T.value);
1217
+ }), g({ search: z, query: k, getTableRef: H }), (y, e) => {
1218
+ const m = Te("loading");
1219
+ return r(), w("div", ia, [
1220
+ y.$slots.form ? (r(), p(l(Ie), {
592
1221
  key: 0,
593
1222
  loading: i.value,
594
- expanded: c.value
1223
+ expanded: V.value
595
1224
  }, {
596
- default: d((C) => [
597
- B(y.$slots, "form", X(oe(C)))
1225
+ default: b((U) => [
1226
+ R(y.$slots, "form", Ee(He(U)))
598
1227
  ]),
599
- operate: d(() => [
600
- S(s(Y), {
1228
+ operate: b(() => [
1229
+ S(l(te), {
601
1230
  type: "primary",
602
1231
  loading: i.value,
603
1232
  onClick: z
604
1233
  }, {
605
- default: d(() => [
606
- H(A(s(t)("s.button.query")), 1)
1234
+ default: b(() => [
1235
+ le(Y(l(s)("s.button.query")), 1)
607
1236
  ]),
608
1237
  _: 1
609
1238
  }, 8, ["loading"]),
610
- S(s(Y), { onClick: D }, {
611
- default: d(() => [
612
- H(A(s(t)("s.button.reset")), 1)
1239
+ S(l(te), { onClick: G }, {
1240
+ default: b(() => [
1241
+ le(Y(l(s)("s.button.reset")), 1)
613
1242
  ]),
614
1243
  _: 1
615
1244
  })
616
1245
  ]),
617
1246
  _: 3
618
- }, 8, ["loading", "expanded"])) : E("", !0),
619
- y.$slots.freeArea ? B(y.$slots, "freeArea", { key: 1 }) : E("", !0),
620
- T("div", xt, [
621
- y.$slots.header || r.columnTool ? (o(), m("div", {
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", {
622
1251
  key: 0,
623
- class: Ge(["ez-fast-table-wrapper_header flex", y.$slots.header ? "justify-between" : "justify-end"])
1252
+ class: qe(["ez-fast-table_wrapper_header", y.$slots.header ? "justify-between" : "justify-end"])
624
1253
  }, [
625
- y.$slots.header ? (o(), m("div", St, [
626
- B(y.$slots, "header", {
627
- selectList: s(b),
628
- selectIds: s(h)
1254
+ y.$slots.header ? (r(), w("div", ca, [
1255
+ R(y.$slots, "header", {
1256
+ selectList: l(_),
1257
+ selectIds: l(E)
629
1258
  })
630
- ])) : E("", !0),
631
- r.columnTool ? (o(), p(s(Y), {
1259
+ ])) : A("", !0),
1260
+ f.columnTool ? (r(), p(l(te), {
632
1261
  key: 1,
633
- icon: s(gt),
1262
+ icon: l(Fl),
634
1263
  circle: "",
635
- onClick: w[0] || (w[0] = (C) => $.value = !0)
636
- }, null, 8, ["icon"])) : E("", !0)
637
- ], 2)) : E("", !0),
638
- _e((o(), p(s(ke), k(y.$attrs, {
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), {
639
1268
  ref_key: "fastTableRef",
640
- ref: u,
641
- columns: g.value,
642
- data: M.value,
643
- "row-key": r.rowKey,
644
- onSelectionChange: s(a),
645
- onSortChange: W
646
- }), te({ _: 2 }, [
647
- O(y.$slots, (C, ne, Wt) => ({
648
- name: ne,
649
- fn: d((xe) => [
650
- ["form"].includes(C.name) ? E("", !0) : B(y.$slots, ne, X(k({ key: 0 }, xe)))
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)))
651
1279
  ])
652
1280
  }))
653
- ]), 1040, ["columns", "data", "row-key", "onSelectionChange"])), [
654
- [ee, i.value]
1281
+ ]), 1040, ["columns", "data", "onSelectionChange"])), [
1282
+ [m, i.value]
655
1283
  ]),
656
- T("div", Tt, [
657
- S(s(Ce), {
658
- "current-page": x.value.current,
1284
+ D("div", fa, [
1285
+ S(l(Le), {
1286
+ "current-page": T.value.current,
659
1287
  "onUpdate:currentPage": [
660
- w[1] || (w[1] = (C) => x.value.current = C),
661
- w[3] || (w[3] = (C) => se({ current: C }))
1288
+ e[1] || (e[1] = (U) => T.value.current = U),
1289
+ e[3] || (e[3] = (U) => Q({ current: U }))
662
1290
  ],
663
- "page-size": x.value.size,
1291
+ "page-size": T.value.size,
664
1292
  "onUpdate:pageSize": [
665
- w[2] || (w[2] = (C) => x.value.size = C),
666
- w[4] || (w[4] = (C) => se({ size: C }))
1293
+ e[2] || (e[2] = (U) => T.value.size = U),
1294
+ e[4] || (e[4] = (U) => Q({ size: U }))
667
1295
  ],
668
- total: N.value
1296
+ total: K.value
669
1297
  }, null, 8, ["current-page", "page-size", "total"])
670
1298
  ])
671
1299
  ]),
672
- S(Ct, {
673
- modelValue: $.value,
674
- "onUpdate:modelValue": w[5] || (w[5] = (C) => $.value = C),
675
- columns: g.value,
676
- "onUpdate:columns": w[6] || (w[6] = (C) => g.value = C),
677
- onChange: Ee
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
678
1306
  }, null, 8, ["modelValue", "columns"])
679
1307
  ]);
680
1308
  };
681
1309
  }
682
- }), Mt = U(Vt), Lt = v({ name: "EzIcon", inheritAttrs: !1 }), Pt = /* @__PURE__ */ v({
683
- ...Lt,
684
- props: {
685
- size: { default: 20 },
686
- color: { default: "inherit" },
687
- class: {}
688
- },
689
- setup(l) {
690
- const n = l, e = P(() => {
691
- const { size: t, color: r } = n;
692
- return !t && !r ? {} : {
693
- fontSize: t ? `${t}px` : void 0,
694
- color: r
695
- };
696
- });
697
- return (t, r) => (o(), m("i", k(t.$attrs, {
698
- class: ["ez-icon", n.class],
699
- style: e.value
700
- }), [
701
- B(t.$slots, "default", { class: "w-[1em] h-[1em]" })
702
- ], 16));
703
- }
704
- }), j = U(Pt), Rt = v({ name: "EzRadio" }), Ut = /* @__PURE__ */ v({
705
- ...Rt,
706
- props: {
707
- type: { default: "default" },
708
- options: { default: () => [] }
709
- },
710
- setup(l) {
711
- const n = l, e = P(() => ["default", "border"].includes(n.type) ? Ue : Ie);
712
- return (t, r) => (o(), p(s(qe), X(oe(t.$attrs)), {
713
- default: d(() => [
714
- (o(!0), m(R, null, O(t.options, (c) => (o(), p(ye(e.value), k({
715
- key: String(c.value),
716
- ref_for: !0
717
- }, c, {
718
- value: c.value,
719
- border: t.type === "border"
720
- }), {
721
- default: d(() => [
722
- H(A(c.label), 1)
723
- ]),
724
- _: 2
725
- }, 1040, ["value", "border"]))), 128))
726
- ]),
727
- _: 1
728
- }, 16));
729
- }
730
- }), It = U(Ut), qt = v({ name: "EzSelect" }), Dt = /* @__PURE__ */ v({
731
- ...qt,
732
- props: {
733
- options: { default: () => [] },
734
- clearable: { type: Boolean, default: !1 }
735
- },
736
- setup(l) {
737
- const n = l, e = (r) => typeof r > "u", t = (r) => !e(r.options);
738
- return (r, c) => (o(), p(s(De), k(r.$attrs, {
739
- clearable: n.clearable
740
- }), {
741
- default: d(() => [
742
- (o(!0), m(R, null, O(n.options, (a, b) => (o(), m(R, { key: b }, [
743
- t(a) ? (o(), p(s(Ae), k({
744
- key: 0,
745
- ref_for: !0
746
- }, a), {
747
- default: d(() => [
748
- (o(!0), m(R, null, O(a.options, (f) => (o(), p(s(ie), k({
749
- key: f.label
750
- }, { ref_for: !0 }, f), null, 16))), 128))
751
- ]),
752
- _: 2
753
- }, 1040)) : (o(), p(s(ie), k({
754
- key: 1,
755
- ref_for: !0
756
- }, a), null, 16))
757
- ], 64))), 128))
758
- ]),
759
- _: 1
760
- }, 16, ["clearable"]));
761
- }
762
- }), At = U(Dt), Ft = { class: "ez-upload-image" }, Ot = {
763
- key: 0,
764
- class: "flex items-center justify-center"
765
- }, Nt = {
766
- key: 1,
767
- class: "ez-upload-image-list"
768
- }, jt = { class: "flex items-center justify-center h-full" }, Ht = v({ name: "EzImageUpload" }), Kt = /* @__PURE__ */ v({
769
- ...Ht,
770
- props: /* @__PURE__ */ K({
771
- api: { type: Function, default: () => Promise.resolve({ url: "" }) },
772
- imageTypes: { default: () => [
773
- "image/webp",
774
- "image/png",
775
- "image/jpg",
776
- "image/gif",
777
- "image/bmp",
778
- "image/jpeg"
779
- ] },
780
- limitSize: { default: 10 },
781
- style: { default: () => ({ width: "100px", height: "100px" }) },
782
- fit: { default: "contain" },
783
- multiple: { type: Boolean, default: !1 },
784
- limit: { default: 9 },
785
- disabled: { type: Boolean, default: !1 }
786
- }, {
787
- modelValue: {},
788
- modelModifiers: {}
789
- }),
790
- emits: ["update:modelValue"],
791
- setup(l, { expose: n }) {
792
- const e = l, { t } = Q(), r = V(!1), c = V(0), a = F(l, "modelValue"), b = P(() => e.multiple), f = /^(https?:\/\/|data:|blob:)/i, h = P(() => a.value ? u(a.value) : []);
793
- function u(g) {
794
- if (!g) return [];
795
- const i = /^(https?:\/\/|data:|blob:)/i;
796
- let _ = [], z = "", I = !1;
797
- g = g.trim().replace(/,$/, "");
798
- const W = g.split(",");
799
- for (let q = 0; q < W.length; q++) {
800
- const D = W[q].trim();
801
- D && (i.test(D) ? (I && z && _.push(z.trim()), z = D, I = !0) : I ? z += "," + D : i.test(D.trim()) && _.push(D.trim()));
802
- }
803
- return I && z && _.push(z.trim()), _.filter((q) => q && i.test(q));
804
- }
805
- function $(g) {
806
- return !g || g.length === 0 ? "" : g.filter((i) => i.trim()).map((i) => i.trim()).join(",");
807
- }
808
- const L = (g) => e.disabled ? (J.warning(t("s.message.disabled")), !1) : e.imageTypes.includes(g.type.toLocaleLowerCase()) ? g.size > e.limitSize * 1024 * 1024 ? (J.error(t("s.validate.upload.limit", { max: e.limitSize })), !1) : !0 : (J.error(t("s.validate.upload.image")), !1), M = async ({ file: g }) => {
809
- if (!e.disabled)
810
- try {
811
- const { url: i } = await e.api(g);
812
- if (!i) throw new Error(t("s.message.uploadFail"));
813
- if (b.value) {
814
- const _ = a.value ? u(a.value) : [];
815
- i && f.test(i) && (_.push(i), a.value = $(_));
816
- } else
817
- a.value = i;
818
- } catch (i) {
819
- J.error(i.message);
820
- }
821
- }, N = (g, i = 0) => {
822
- g && (c.value = i, r.value = !0);
823
- }, G = (g) => {
824
- if (!e.disabled && !(!g || !a.value))
825
- if (b.value) {
826
- const i = u(a.value), _ = i.findIndex((z) => z === g);
827
- _ !== -1 && (i.splice(_, 1), a.value = i.join(","));
828
- } else
829
- a.value = null;
830
- }, x = V();
831
- return n({
832
- getUploadRef: () => x.value,
833
- getUrlList: () => h.value
834
- }), (g, i) => (o(), m("div", Ft, [
835
- b.value ? (o(), m("div", Nt, [
836
- (o(!0), m(R, null, O(h.value, (_, z) => (o(), m("div", {
837
- key: z,
838
- class: "ez-upload-image-item",
839
- style: $e(e.style)
840
- }, [
841
- S(s(de), {
842
- src: _,
843
- fit: e.fit
844
- }, null, 8, ["src", "fit"]),
845
- T("div", {
846
- class: "ez-upload-image_handle",
847
- onClick: i[3] || (i[3] = ce(() => {
848
- }, ["stop"]))
849
- }, [
850
- S(s(j), {
851
- size: 18,
852
- onClick: (I) => N(_, z)
853
- }, {
854
- default: d(() => [
855
- S(s(me))
856
- ]),
857
- _: 2
858
- }, 1032, ["onClick"]),
859
- e.disabled ? E("", !0) : (o(), p(s(j), {
860
- key: 0,
861
- size: 18,
862
- onClick: (I) => G(_)
863
- }, {
864
- default: d(() => [
865
- S(s(fe))
866
- ]),
867
- _: 2
868
- }, 1032, ["onClick"]))
869
- ])
870
- ], 4))), 128)),
871
- h.value.length < e.limit && !e.disabled || h.value.length === 0 ? (o(), p(s(ue), k({ key: 0 }, g.$attrs, {
872
- ref_key: "uploadRef",
873
- ref: x,
874
- action: "",
875
- accept: "image/*",
876
- "show-file-list": !1,
877
- "before-upload": L,
878
- "http-request": M,
879
- style: e.style,
880
- disabled: e.disabled,
881
- class: [{ "is-disabled": e.disabled }, "ez-upload-image-item ez-upload-button"]
882
- }), {
883
- default: d(() => [
884
- T("div", jt, [
885
- S(s(j), null, {
886
- default: d(() => [
887
- S(s(pe))
888
- ]),
889
- _: 1
890
- })
891
- ])
892
- ]),
893
- _: 1
894
- }, 16, ["style", "disabled", "class"])) : E("", !0)
895
- ])) : (o(), p(s(ue), k({ key: 0 }, g.$attrs, {
896
- ref_key: "uploadRef",
897
- ref: x,
898
- action: "",
899
- accept: "image/*",
900
- "show-file-list": !1,
901
- "before-upload": L,
902
- "http-request": M,
903
- style: e.style,
904
- disabled: e.disabled,
905
- class: ["ez-upload-image-wrapper", { "is-disabled": e.disabled }]
906
- }), {
907
- default: d(() => [
908
- a.value ? (o(), m("div", Ot, [
909
- S(s(de), {
910
- src: a.value,
911
- fit: e.fit
912
- }, null, 8, ["src", "fit"]),
913
- T("div", {
914
- class: "ez-upload-image_handle",
915
- onClick: i[2] || (i[2] = ce(() => {
916
- }, ["stop"]))
917
- }, [
918
- S(s(j), {
919
- size: 18,
920
- onClick: i[0] || (i[0] = (_) => N(a.value, 0))
921
- }, {
922
- default: d(() => [
923
- S(s(me))
924
- ]),
925
- _: 1
926
- }),
927
- e.disabled ? E("", !0) : (o(), p(s(j), {
928
- key: 0,
929
- size: 18,
930
- onClick: i[1] || (i[1] = (_) => G(a.value))
931
- }, {
932
- default: d(() => [
933
- S(s(fe))
934
- ]),
935
- _: 1
936
- }))
937
- ])
938
- ])) : (o(), p(s(j), { key: 1 }, {
939
- default: d(() => [
940
- S(s(pe))
941
- ]),
942
- _: 1
943
- }))
944
- ]),
945
- _: 1
946
- }, 16, ["style", "disabled", "class"])),
947
- r.value ? (o(), p(s(Fe), {
948
- key: 2,
949
- "url-list": b.value ? h.value : [a.value],
950
- "initial-index": c.value,
951
- onClose: i[4] || (i[4] = (_) => r.value = !1)
952
- }, null, 8, ["url-list", "initial-index"])) : E("", !0)
953
- ]));
954
- }
955
- }), Gt = U(Kt), ve = Symbol("INSTALLED_KEY");
956
- function Yt(l = []) {
1310
+ }), ga = F(ma), ze = /* @__PURE__ */ Symbol("INSTALLED_KEY");
1311
+ function ha(t = []) {
957
1312
  return {
958
- install: (e) => {
959
- e[ve] || (e[ve] = !0, l.forEach((t) => e.use(t)));
1313
+ install: (o) => {
1314
+ o[ze] || (o[ze] = !0, t.forEach((s) => o.use(s)));
960
1315
  }
961
1316
  };
962
1317
  }
963
- const Jt = [
964
- et,
965
- nt,
966
- Mt,
967
- j,
968
- Gt,
969
- Ce,
970
- It,
971
- ze,
972
- At,
973
- ke
974
- ], Zt = [
975
- Oe,
976
- ae,
977
- J,
978
- Ne,
979
- je,
980
- He
981
- ], Qt = Yt([...Jt, ...Zt]), tl = Qt.install;
1318
+ const Ea = [
1319
+ Re,
1320
+ Al,
1321
+ ga,
1322
+ ee,
1323
+ Me,
1324
+ Le,
1325
+ xe,
1326
+ Ie,
1327
+ De,
1328
+ Pe
1329
+ ], ba = [
1330
+ ml,
1331
+ ve,
1332
+ oe,
1333
+ gl,
1334
+ hl,
1335
+ El
1336
+ ], ya = ha([...Ea, ...ba]), Ca = ya.install;
982
1337
  export {
983
- et as EzCheckbox,
984
- nt as EzDialog,
985
- Mt as EzFastTable,
986
- j as EzIcon,
987
- Gt as EzImageUpload,
988
- Ce as EzPagination,
989
- It as EzRadio,
990
- ze as EzSearchForm,
991
- At as EzSelect,
992
- ke as EzTable,
993
- Qt as default,
994
- tl as install
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
995
1352
  };