zxt-table 0.5.9 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- import { createElementBlock as m, openBlock as s, normalizeClass as ue, renderSlot as O, defineComponent as z, createVNode as F, ref as k, watch as X, resolveComponent as S, createBlock as V, h as K, inject as je, computed as C, mergeProps as M, withCtx as w, Fragment as B, renderList as T, createSlots as Y, resolveDynamicComponent as be, createTextVNode as j, toDisplayString as ee, useSlots as Me, provide as Ee, onMounted as Le, nextTick as Ie, resolveDirective as Ne, normalizeStyle as Ue, withDirectives as qe, createCommentVNode as W, createElementVNode as b, reactive as We, toHandlers as Ge, useAttrs as Je, normalizeProps as Oe, guardReactiveProps as Te } from "vue";
2
- import { ElPagination as Ke, ElLink as Qe, ElCheckbox as Xe, ElSelect as Ye, ElOption as et, ElInput as tt, ElTableColumn as at, ElTable as nt } from "element-plus";
1
+ import { createElementBlock as m, openBlock as i, normalizeClass as ue, renderSlot as T, defineComponent as b, createVNode as F, ref as k, watch as X, resolveComponent as S, createBlock as V, h as K, inject as Ee, computed as _, mergeProps as M, withCtx as w, Fragment as L, renderList as O, createSlots as Y, resolveDynamicComponent as be, createTextVNode as j, toDisplayString as ee, useSlots as Be, provide as Ie, onMounted as Le, nextTick as Ne, resolveDirective as Ue, normalizeStyle as qe, withDirectives as We, createCommentVNode as W, createElementVNode as y, reactive as Ge, toHandlers as Je, withModifiers as Te, useAttrs as Ke, normalizeProps as Oe, guardReactiveProps as Me } from "vue";
2
+ import { ElPagination as Qe, ElLink as Xe, ElCheckbox as Ye, ElSelect as et, ElOption as tt, ElInput as at, ElTableColumn as nt, ElTable as ot } from "element-plus";
3
3
  const G = (e, t) => {
4
4
  const a = e.__vccOpts || e;
5
- for (const [l, u] of t)
6
- a[l] = u;
5
+ for (const [r, u] of t)
6
+ a[r] = u;
7
7
  return a;
8
- }, ot = {
8
+ }, lt = {
9
9
  name: "MyButton",
10
10
  props: {
11
11
  type: {
@@ -21,26 +21,26 @@ const G = (e, t) => {
21
21
  emits: ["click"],
22
22
  setup(e, { emit: t }) {
23
23
  return {
24
- handleClick: (l) => {
25
- t("click", l);
24
+ handleClick: (r) => {
25
+ t("click", r);
26
26
  }
27
27
  };
28
28
  }
29
- }, lt = ["disabled"];
30
- function rt(e, t, a, l, u, d) {
31
- return s(), m("button", {
29
+ }, rt = ["disabled"];
30
+ function st(e, t, a, r, u, d) {
31
+ return i(), m("button", {
32
32
  class: ue(["my-button", [`my-button--${a.type}`, { "is-disabled": a.disabled }]]),
33
33
  disabled: a.disabled,
34
- onClick: t[0] || (t[0] = (...o) => l.handleClick && l.handleClick(...o))
34
+ onClick: t[0] || (t[0] = (...l) => r.handleClick && r.handleClick(...l))
35
35
  }, [
36
- O(e.$slots, "default", {}, void 0, !0)
37
- ], 10, lt);
36
+ T(e.$slots, "default", {}, void 0, !0)
37
+ ], 10, rt);
38
38
  }
39
- const te = /* @__PURE__ */ G(ot, [["render", rt], ["__scopeId", "data-v-4480e77d"]]);
39
+ const te = /* @__PURE__ */ G(lt, [["render", st], ["__scopeId", "data-v-4480e77d"]]);
40
40
  te.install = function(e) {
41
41
  e.component(te.name, te);
42
42
  };
43
- const ae = /* @__PURE__ */ z({
43
+ const ae = /* @__PURE__ */ b({
44
44
  name: "JsxButton",
45
45
  props: {
46
46
  type: {
@@ -58,7 +58,7 @@ const ae = /* @__PURE__ */ z({
58
58
  emit: t,
59
59
  slots: a
60
60
  }) {
61
- const l = (u) => {
61
+ const r = (u) => {
62
62
  e.disabled || t("click", u);
63
63
  };
64
64
  return () => F("button", {
@@ -66,16 +66,16 @@ const ae = /* @__PURE__ */ z({
66
66
  "is-disabled": e.disabled
67
67
  }],
68
68
  disabled: e.disabled,
69
- onClick: l
69
+ onClick: r
70
70
  }, [a.default?.()]);
71
71
  }
72
72
  });
73
73
  ae.install = function(e) {
74
74
  e.component(ae.name, ae);
75
75
  };
76
- const st = z({
76
+ const it = b({
77
77
  name: "ZxtPagination",
78
- components: { ElPagination: Ke },
78
+ components: { ElPagination: Qe },
79
79
  props: {
80
80
  // 当前页码
81
81
  modelValue: { type: Number, default: 1 },
@@ -93,36 +93,36 @@ const st = z({
93
93
  },
94
94
  emits: ["update:modelValue", "update:pageSize", "page-change", "size-change"],
95
95
  setup(e, { emit: t }) {
96
- const a = k(e.modelValue), l = k(e.pageSize);
96
+ const a = k(e.modelValue), r = k(e.pageSize);
97
97
  return X(
98
98
  () => e.modelValue,
99
- (o) => {
100
- a.value = o;
99
+ (l) => {
100
+ a.value = l;
101
101
  }
102
102
  ), X(
103
103
  () => e.pageSize,
104
- (o) => {
105
- l.value = o;
104
+ (l) => {
105
+ r.value = l;
106
106
  }
107
107
  ), {
108
108
  currentPage: a,
109
- pageSize: l,
110
- handleSizeChange: (o) => {
111
- l.value = o, a.value = 1, t("update:pageSize", o), t("size-change", { page: a.value, size: o });
109
+ pageSize: r,
110
+ handleSizeChange: (l) => {
111
+ r.value = l, a.value = 1, t("update:pageSize", l), t("size-change", { page: a.value, size: l });
112
112
  },
113
- handleCurrentChange: (o) => {
114
- a.value = o, t("update:modelValue", o), t("page-change", { page: o, size: l.value });
113
+ handleCurrentChange: (l) => {
114
+ a.value = l, t("update:modelValue", l), t("page-change", { page: l, size: r.value });
115
115
  }
116
116
  };
117
117
  }
118
118
  });
119
- function it(e, t, a, l, u, d) {
120
- const o = S("el-pagination");
121
- return s(), V(o, {
119
+ function ut(e, t, a, r, u, d) {
120
+ const l = S("el-pagination");
121
+ return i(), V(l, {
122
122
  "current-page": e.currentPage,
123
- "onUpdate:currentPage": t[0] || (t[0] = (p) => e.currentPage = p),
123
+ "onUpdate:currentPage": t[0] || (t[0] = (c) => e.currentPage = c),
124
124
  "page-size": e.pageSize,
125
- "onUpdate:pageSize": t[1] || (t[1] = (p) => e.pageSize = p),
125
+ "onUpdate:pageSize": t[1] || (t[1] = (c) => e.pageSize = c),
126
126
  "page-sizes": e.pageSizes,
127
127
  total: e.total,
128
128
  layout: e.layout,
@@ -131,31 +131,31 @@ function it(e, t, a, l, u, d) {
131
131
  onCurrentChange: e.handleCurrentChange
132
132
  }, null, 8, ["current-page", "page-size", "page-sizes", "total", "layout", "onSizeChange", "onCurrentChange"]);
133
133
  }
134
- const Q = /* @__PURE__ */ G(st, [["render", it], ["__scopeId", "data-v-497aa44d"]]), ne = {
134
+ const Q = /* @__PURE__ */ G(it, [["render", ut], ["__scopeId", "data-v-497aa44d"]]), ne = {
135
135
  default: ({ cellValue: e }) => e ?? "",
136
- input: ({ cellValue: e, row: t, column: a, updateRow: l }) => K(tt, {
136
+ input: ({ cellValue: e, row: t, column: a, updateRow: r }) => K(at, {
137
137
  modelValue: e,
138
138
  size: "small",
139
- onInput: (u) => l({ ...t, [a.property]: u })
139
+ onInput: (u) => r({ ...t, [a.property]: u })
140
140
  }),
141
- select: ({ cellValue: e, row: t, column: a, updateRow: l, options: u = [] }) => K(
142
- Ye,
141
+ select: ({ cellValue: e, row: t, column: a, updateRow: r, options: u = [] }) => K(
142
+ et,
143
143
  {
144
144
  modelValue: e,
145
145
  size: "small",
146
- onChange: (d) => l({ ...t, [a.property]: d })
146
+ onChange: (d) => r({ ...t, [a.property]: d })
147
147
  },
148
148
  () => u.map(
149
- (d) => K(et, { label: d.label, value: d.value, key: d.value })
149
+ (d) => K(tt, { label: d.label, value: d.value, key: d.value })
150
150
  )
151
151
  ),
152
- checkbox: ({ cellValue: e, row: t, column: a, updateRow: l }) => K(Xe, {
152
+ checkbox: ({ cellValue: e, row: t, column: a, updateRow: r }) => K(Ye, {
153
153
  modelValue: !!e,
154
- onChange: (u) => l({ ...t, [a.property]: u })
154
+ onChange: (u) => r({ ...t, [a.property]: u })
155
155
  }),
156
- link: ({ cellValue: e, href: t, target: a = "_blank" }) => K(Qe, { href: t, target: a }, () => e)
156
+ link: ({ cellValue: e, href: t, target: a = "_blank" }) => K(Xe, { href: t, target: a }, () => e)
157
157
  };
158
- function ut(e, t) {
158
+ function dt(e, t) {
159
159
  if (!e) return null;
160
160
  if (typeof e == "string") {
161
161
  const a = ne[e];
@@ -164,22 +164,22 @@ function ut(e, t) {
164
164
  if (typeof e == "function")
165
165
  return e(t);
166
166
  if (typeof e == "object" && !Array.isArray(e)) {
167
- const { name: a, props: l = {}, attrs: u = {}, events: d = {}, content: o } = e;
167
+ const { name: a, props: r = {}, attrs: u = {}, events: d = {}, content: l } = e;
168
168
  return typeof a == "string" && ne[a] ? ne[a]({
169
169
  ...t,
170
- ...l,
170
+ ...r,
171
171
  ...u,
172
172
  ...d
173
- }) : typeof a == "object" || typeof a == "function" ? K(a, { ...l, ...u, ...d }, o) : (console.warn("[ZxtTable] cellRender 对象缺少有效的 name 字段"), t.cellValue ?? "");
173
+ }) : typeof a == "object" || typeof a == "function" ? K(a, { ...r, ...u, ...d }, l) : (console.warn("[ZxtTable] cellRender 对象缺少有效的 name 字段"), t.cellValue ?? "");
174
174
  }
175
175
  return t.cellValue ?? "";
176
176
  }
177
- function dt(e, t) {
177
+ function ct(e, t) {
178
178
  ne[e] && console.warn(`[ZxtTable] 内置渲染器 ${e} 已被覆盖`), ne[e] = t;
179
179
  }
180
- const ct = z({
180
+ const pt = b({
181
181
  name: "ZxtTableColumn",
182
- components: { ElTableColumn: at },
182
+ components: { ElTableColumn: nt },
183
183
  props: {
184
184
  column: {
185
185
  type: Object,
@@ -195,88 +195,88 @@ const ct = z({
195
195
  }
196
196
  },
197
197
  setup(e) {
198
- const t = je("updateRow", () => {
199
- }), a = (o) => {
200
- const { currentPage: p, pageSize: g } = e;
201
- return (p - 1) * g + o + 1;
202
- }, l = C(() => {
203
- const o = e.column;
198
+ const t = Ee("updateRow", () => {
199
+ }), a = (l) => {
200
+ const { currentPage: c, pageSize: g } = e;
201
+ return (c - 1) * g + l + 1;
202
+ }, r = _(() => {
203
+ const l = e.column;
204
204
  return {
205
- ...o,
206
- prop: o.prop ?? o.field,
205
+ ...l,
206
+ prop: l.prop ?? l.field,
207
207
  // 优先使用 prop,兼容 field
208
- label: o.label ?? o.title
208
+ label: l.label ?? l.title
209
209
  // 优先使用 label,兼容 title
210
210
  };
211
- }), u = C(() => {
212
- const { children: o, ...p } = l.value;
213
- return p;
211
+ }), u = _(() => {
212
+ const { children: l, ...c } = r.value;
213
+ return c;
214
214
  });
215
215
  return {
216
- normalizedColumn: l,
216
+ normalizedColumn: r,
217
217
  columnProps: u,
218
- renderCell: (o) => {
219
- const p = l.value, g = o.row[p.prop], c = g ?? p.defaultValue ?? "";
220
- return ut(p.cellRender, {
221
- row: o.row,
222
- column: p,
223
- rowIndex: o.$index,
224
- cellValue: c,
225
- updateRow: (h) => t(h, o.$index)
218
+ renderCell: (l) => {
219
+ const c = r.value, g = l.row[c.prop], z = g ?? c.defaultValue ?? "";
220
+ return dt(c.cellRender, {
221
+ row: l.row,
222
+ column: c,
223
+ rowIndex: l.$index,
224
+ cellValue: z,
225
+ updateRow: (p) => t(p, l.$index)
226
226
  });
227
227
  },
228
228
  defaultIndexMethod: a
229
229
  };
230
230
  }
231
231
  });
232
- function pt(e, t, a, l, u, d) {
233
- const o = S("ZxtTableColumn", !0), p = S("el-table-column");
234
- return e.normalizedColumn.children && e.normalizedColumn.children.length ? (s(), V(p, M({ key: 0 }, e.columnProps, {
232
+ function ft(e, t, a, r, u, d) {
233
+ const l = S("ZxtTableColumn", !0), c = S("el-table-column");
234
+ return e.normalizedColumn.children && e.normalizedColumn.children.length ? (i(), V(c, M({ key: 0 }, e.columnProps, {
235
235
  key: e.normalizedColumn.prop + "-group"
236
236
  }), {
237
237
  default: w(() => [
238
- (s(!0), m(B, null, T(e.normalizedColumn.children, (g, c) => (s(), V(o, {
239
- key: c,
238
+ (i(!0), m(L, null, O(e.normalizedColumn.children, (g, z) => (i(), V(l, {
239
+ key: z,
240
240
  column: g,
241
241
  "current-page": e.currentPage,
242
242
  "page-size": e.pageSize
243
243
  }, Y({ _: 2 }, [
244
- T(e.$slots, (h, i) => ({
245
- name: i,
246
- fn: w((y) => [
247
- O(e.$slots, i, M({ ref_for: !0 }, y))
244
+ O(e.$slots, (p, n) => ({
245
+ name: n,
246
+ fn: w((v) => [
247
+ T(e.$slots, n, M({ ref_for: !0 }, v))
248
248
  ])
249
249
  }))
250
250
  ]), 1032, ["column", "current-page", "page-size"]))), 128))
251
251
  ]),
252
252
  _: 3
253
- }, 16)) : (s(), V(p, M({ key: 1 }, e.columnProps, {
253
+ }, 16)) : (i(), V(c, M({ key: 1 }, e.columnProps, {
254
254
  key: e.normalizedColumn.prop,
255
255
  index: e.normalizedColumn.indexMethod || e.defaultIndexMethod
256
256
  }), Y({ _: 2 }, [
257
257
  e.normalizedColumn.headerSlot ? {
258
258
  name: "header",
259
259
  fn: w((g) => [
260
- O(e.$slots, e.normalizedColumn.headerSlot, M({ column: e.normalizedColumn }, g))
260
+ T(e.$slots, e.normalizedColumn.headerSlot, M({ column: e.normalizedColumn }, g))
261
261
  ]),
262
262
  key: "0"
263
263
  } : void 0,
264
264
  !["selection", "index"].includes(e.normalizedColumn.type) && (e.normalizedColumn.type !== "expand" || e.normalizedColumn.slot) ? {
265
265
  name: "default",
266
266
  fn: w((g) => [
267
- e.normalizedColumn.slot ? O(e.$slots, e.normalizedColumn.slot, {
267
+ e.normalizedColumn.slot ? T(e.$slots, e.normalizedColumn.slot, {
268
268
  key: 0,
269
269
  row: g.row,
270
270
  index: g.$index,
271
271
  column: e.normalizedColumn
272
- }) : e.normalizedColumn.cellRender ? (s(), V(be(e.renderCell(g)), { key: 1 })) : e.normalizedColumn.formatter ? (s(), m(B, { key: 2 }, [
272
+ }) : e.normalizedColumn.cellRender ? (i(), V(be(e.renderCell(g)), { key: 1 })) : e.normalizedColumn.formatter ? (i(), m(L, { key: 2 }, [
273
273
  j(ee(e.normalizedColumn.formatter(
274
274
  g.row,
275
275
  e.normalizedColumn,
276
276
  g.row[e.normalizedColumn.prop],
277
277
  g.$index
278
278
  )), 1)
279
- ], 64)) : (s(), m(B, { key: 3 }, [
279
+ ], 64)) : (i(), m(L, { key: 3 }, [
280
280
  j(ee(g.row[e.normalizedColumn.prop]), 1)
281
281
  ], 64))
282
282
  ]),
@@ -284,10 +284,10 @@ function pt(e, t, a, l, u, d) {
284
284
  } : void 0
285
285
  ]), 1040, ["index"]));
286
286
  }
287
- const ft = /* @__PURE__ */ G(ct, [["render", pt]]), mt = /* @__PURE__ */ new Set(["append", "empty"]), gt = z({
287
+ const mt = /* @__PURE__ */ G(pt, [["render", ft]]), gt = /* @__PURE__ */ new Set(["append", "empty"]), ht = b({
288
288
  name: "ZxtTable",
289
289
  inheritAttrs: !1,
290
- components: { ZxtPagination: Q, ZxtTableColumn: ft, ElTable: nt },
290
+ components: { ZxtPagination: Q, ZxtTableColumn: mt, ElTable: ot },
291
291
  props: {
292
292
  // 表格唯一标识
293
293
  id: { type: String, default: "" },
@@ -333,91 +333,91 @@ const ft = /* @__PURE__ */ G(ct, [["render", pt]]), mt = /* @__PURE__ */ new Set
333
333
  "update:row"
334
334
  ],
335
335
  setup(e, { emit: t }) {
336
- const a = Me(), l = k(null), u = k(e.pageSize), d = k(e.currentPage), o = k(!1), p = k([]), g = k(0), c = k({ prop: "", order: "" }), h = k({}), i = k({});
336
+ const a = Be(), r = k(null), u = k(e.pageSize), d = k(e.currentPage), l = k(!1), c = k([]), g = k(0), z = k({ prop: "", order: "" }), p = k({}), n = k({});
337
337
  X(() => e.currentPage, (f) => {
338
338
  d.value = f;
339
339
  }), X(() => e.pageSize, (f) => {
340
340
  u.value = f;
341
341
  });
342
- const y = C(() => e.height === "full" ? { height: "100%" } : {}), r = C(() => {
342
+ const v = _(() => e.height === "full" ? { height: "100%" } : {}), s = _(() => {
343
343
  if (e.height !== "full")
344
344
  return e.height;
345
- }), _ = C(() => !!e.proxyConfig), x = C(() => _.value ? g.value : e.total > 0 ? e.total : e.data.length), J = C(
346
- () => _.value ? p.value : e.data
345
+ }), C = _(() => !!e.proxyConfig), x = _(() => C.value ? g.value : e.total > 0 ? e.total : e.data.length), J = _(
346
+ () => C.value ? c.value : e.data
347
347
  ), R = () => {
348
- Ie(() => {
349
- const f = l.value?.$el?.querySelector(
348
+ Ne(() => {
349
+ const f = r.value?.$el?.querySelector(
350
350
  ".el-table__body-wrapper .el-scrollbar__wrap"
351
351
  );
352
352
  f && (typeof f.scrollTo == "function" ? f.scrollTo({ top: 0, left: 0 }) : (f.scrollTop = 0, f.scrollLeft = 0));
353
353
  });
354
354
  }, E = (f) => {
355
- _.value && (d.value = f.page, u.value = f.size, H()), R(), t("size-change", f);
355
+ C.value && (d.value = f.page, u.value = f.size, H()), R(), t("size-change", f);
356
356
  }, de = (f) => {
357
- _.value && (d.value = f.page, u.value = f.size, H()), R(), t("page-change", f);
357
+ C.value && (d.value = f.page, u.value = f.size, H()), R(), t("page-change", f);
358
358
  }, ce = ({ column: f, prop: $, order: I }) => {
359
- c.value = { prop: $, order: I }, _.value && H(), t("sort-change", { column: f, prop: $, order: I });
359
+ z.value = { prop: $, order: I }, C.value && H(), t("sort-change", { column: f, prop: $, order: I });
360
360
  }, pe = (f) => {
361
- h.value = f || {}, _.value && H(), t("filter-change", h.value);
361
+ p.value = f || {}, C.value && H(), t("filter-change", p.value);
362
362
  }, H = async (f) => {
363
- if (!_.value) return;
363
+ if (!C.value) return;
364
364
  const $ = e.proxyConfig || {}, I = $.ajax?.query;
365
365
  if (typeof I != "function") return;
366
366
  const N = $.props || {}, he = N.pageField || "page";
367
367
  N.sizeField;
368
- const ve = N.sortField || "sort", _e = N.orderField || "order", Ce = N.filtersField || "filters";
369
- f?.formData !== void 0 ? i.value = f.formData : $._formData && (i.value = $._formData);
370
- const ye = $.params || {}, U = {
368
+ const ve = N.sortField || "sort", Ce = N.orderField || "order", _e = N.filtersField || "filters";
369
+ f?.formData !== void 0 ? n.value = f.formData : $._formData && (n.value = $._formData);
370
+ const we = $.params || {}, U = {
371
371
  [he]: {
372
372
  currentPage: f?.page ?? d.value,
373
373
  pageSize: f?.pageSize ?? u.value
374
374
  },
375
- form: i.value,
376
- ...ye
375
+ form: n.value,
376
+ ...we
377
377
  };
378
- c.value?.prop && (U[ve] = c.value.prop, U[_e] = c.value.order), h.value && Object.keys(h.value).length && (U[Ce] = h.value), o.value = !0;
378
+ z.value?.prop && (U[ve] = z.value.prop, U[Ce] = z.value.order), p.value && Object.keys(p.value).length && (U[_e] = p.value), l.value = !0;
379
379
  try {
380
- const A = await I(U), P = $.response || {}, n = P.listField || "list", v = P.totalField || "total", D = P.transform;
380
+ const A = await I(U), P = $.response || {}, o = P.listField || "list", h = P.totalField || "total", D = P.transform;
381
381
  let Z = [], re = 0;
382
382
  if (typeof D == "function") {
383
- const we = D(A);
384
- Z = we?.list ?? [], re = we?.total ?? 0;
385
- } else A && typeof A == "object" && (Z = A?.[n] ?? A?.data ?? [], re = A?.[v] ?? A?.total ?? 0);
386
- p.value = Array.isArray(Z) ? Z : [], g.value = Number(re) || 0, t("loaded", {
387
- data: p.value,
383
+ const ye = D(A);
384
+ Z = ye?.list ?? [], re = ye?.total ?? 0;
385
+ } else A && typeof A == "object" && (Z = A?.[o] ?? A?.data ?? [], re = A?.[h] ?? A?.total ?? 0);
386
+ c.value = Array.isArray(Z) ? Z : [], g.value = Number(re) || 0, t("loaded", {
387
+ data: c.value,
388
388
  total: g.value,
389
389
  payload: U
390
390
  });
391
391
  } catch (A) {
392
392
  t("load-error", A);
393
393
  } finally {
394
- o.value = !1;
394
+ l.value = !1;
395
395
  }
396
396
  }, oe = (f, $) => {
397
- _.value ? p.value.splice($, 1, f) : t("update:row", { index: $, row: f });
397
+ C.value ? c.value.splice($, 1, f) : t("update:row", { index: $, row: f });
398
398
  };
399
- Ee("updateRow", oe), Le(() => {
400
- _.value && e.autoLoad && H();
399
+ Ie("updateRow", oe), Le(() => {
400
+ C.value && e.autoLoad && H();
401
401
  });
402
- const fe = () => l.value, me = () => l.value?.getSelectionRows?.() || [], ge = (f) => H(f), le = () => R();
402
+ const fe = () => r.value, me = () => r.value?.getSelectionRows?.() || [], ge = (f) => H(f), le = () => R();
403
403
  return {
404
- columnSlots: C(() => {
404
+ columnSlots: _(() => {
405
405
  const f = {};
406
406
  for (const $ in a)
407
- mt.has($) || (f[$] = a[$]);
407
+ gt.has($) || (f[$] = a[$]);
408
408
  return f;
409
409
  }),
410
- tableRef: l,
411
- containerStyle: y,
412
- tableHeight: r,
410
+ tableRef: r,
411
+ containerStyle: v,
412
+ tableHeight: s,
413
413
  getTableRef: fe,
414
414
  pageSize: u,
415
415
  currentPage: d,
416
- loading: o,
416
+ loading: l,
417
417
  renderData: J,
418
418
  total: x,
419
- pageSizes: C(() => e.pageSizes),
420
- paginationLayout: C(() => e.paginationLayout),
419
+ pageSizes: _(() => e.pageSizes),
420
+ paginationLayout: _(() => e.paginationLayout),
421
421
  handleSizeChange: E,
422
422
  handlePageChange: de,
423
423
  handleSortChange: ce,
@@ -428,17 +428,17 @@ const ft = /* @__PURE__ */ G(ct, [["render", pt]]), mt = /* @__PURE__ */ new Set
428
428
  resetScrollTop: le
429
429
  };
430
430
  }
431
- }), ht = {
431
+ }), vt = {
432
432
  key: 0,
433
433
  class: "zxt-table-footer"
434
434
  };
435
- function vt(e, t, a, l, u, d) {
436
- const o = S("ZxtTableColumn"), p = S("el-table"), g = S("ZxtPagination"), c = Ne("loading");
437
- return s(), m("div", {
435
+ function Ct(e, t, a, r, u, d) {
436
+ const l = S("ZxtTableColumn"), c = S("el-table"), g = S("ZxtPagination"), z = Ue("loading");
437
+ return i(), m("div", {
438
438
  class: ue(["zxt-table-container", { "zxt-table-container--full": e.height === "full" }]),
439
- style: Ue(e.containerStyle)
439
+ style: qe(e.containerStyle)
440
440
  }, [
441
- qe((s(), V(p, M({
441
+ We((i(), V(c, M({
442
442
  ref: "tableRef",
443
443
  data: e.renderData,
444
444
  height: e.tableHeight
@@ -448,16 +448,16 @@ function vt(e, t, a, l, u, d) {
448
448
  onFilterChange: e.handleFilterChange
449
449
  }), Y({
450
450
  default: w(() => [
451
- (s(!0), m(B, null, T(e.columns, (h, i) => (s(), V(o, {
452
- key: i,
453
- column: h,
451
+ (i(!0), m(L, null, O(e.columns, (p, n) => (i(), V(l, {
452
+ key: n,
453
+ column: p,
454
454
  "current-page": e.currentPage,
455
455
  "page-size": e.pageSize
456
456
  }, Y({ _: 2 }, [
457
- T(e.columnSlots, (y, r) => ({
458
- name: r,
459
- fn: w((_) => [
460
- O(e.$slots, r, M({ ref_for: !0 }, _), void 0, !0)
457
+ O(e.columnSlots, (v, s) => ({
458
+ name: s,
459
+ fn: w((C) => [
460
+ T(e.$slots, s, M({ ref_for: !0 }, C), void 0, !0)
461
461
  ])
462
462
  }))
463
463
  ]), 1032, ["column", "current-page", "page-size"]))), 128))
@@ -467,21 +467,21 @@ function vt(e, t, a, l, u, d) {
467
467
  e.$slots.empty ? {
468
468
  name: "empty",
469
469
  fn: w(() => [
470
- O(e.$slots, "empty", {}, void 0, !0)
470
+ T(e.$slots, "empty", {}, void 0, !0)
471
471
  ]),
472
472
  key: "0"
473
473
  } : void 0
474
474
  ]), 1040, ["data", "height", "id", "onSortChange", "onFilterChange"])), [
475
- [c, e.loading]
475
+ [z, e.loading]
476
476
  ]),
477
- e.$slots.append ? (s(), m("div", ht, [
478
- O(e.$slots, "append", {}, void 0, !0)
477
+ e.$slots.append ? (i(), m("div", vt, [
478
+ T(e.$slots, "append", {}, void 0, !0)
479
479
  ])) : W("", !0),
480
- e.pageable ? (s(), V(g, {
480
+ e.pageable ? (i(), V(g, {
481
481
  key: 1,
482
482
  "model-value": e.currentPage,
483
483
  "page-size": e.pageSize,
484
- "onUpdate:pageSize": t[0] || (t[0] = (h) => e.pageSize = h),
484
+ "onUpdate:pageSize": t[0] || (t[0] = (p) => e.pageSize = p),
485
485
  "page-sizes": e.pageSizes,
486
486
  total: e.total,
487
487
  layout: e.paginationLayout,
@@ -490,7 +490,7 @@ function vt(e, t, a, l, u, d) {
490
490
  }, null, 8, ["model-value", "page-size", "page-sizes", "total", "layout", "onPageChange", "onSizeChange"])) : W("", !0)
491
491
  ], 6);
492
492
  }
493
- const L = /* @__PURE__ */ G(gt, [["render", vt], ["__scopeId", "data-v-cfbfc1e6"]]), q = /* @__PURE__ */ new Map();
493
+ const B = /* @__PURE__ */ G(ht, [["render", Ct], ["__scopeId", "data-v-cfbfc1e6"]]), q = /* @__PURE__ */ new Map();
494
494
  class _t {
495
495
  /**
496
496
  * 注册自定义渲染器
@@ -545,12 +545,12 @@ class _t {
545
545
  }
546
546
  }
547
547
  const ze = new _t();
548
- function Ct(e, t, a = {}) {
548
+ function wt(e, t, a = {}) {
549
549
  if (!e || !e.itemRender)
550
550
  return null;
551
- const { name: l } = e.itemRender;
552
- if (l && ze.has(l)) {
553
- const u = ze.get(l);
551
+ const { name: r } = e.itemRender;
552
+ if (r && ze.has(r)) {
553
+ const u = ze.get(r);
554
554
  if (typeof u.renderItemContent == "function") {
555
555
  const d = {
556
556
  data: t,
@@ -560,288 +560,288 @@ function Ct(e, t, a = {}) {
560
560
  };
561
561
  try {
562
562
  return u.renderItemContent(a, d);
563
- } catch (o) {
564
- return console.error(`[ZxtTable] 渲染器 "${l}" 执行出错:`, o), null;
563
+ } catch (l) {
564
+ return console.error(`[ZxtTable] 渲染器 "${r}" 执行出错:`, l), null;
565
565
  }
566
566
  }
567
567
  }
568
568
  return null;
569
569
  }
570
- L.install = function(e) {
571
- e.component(L.name, L);
570
+ B.install = function(e) {
571
+ e.component(B.name, B);
572
572
  };
573
- L.registerRenderer = dt;
574
- L.renderer = ze;
575
- var yt = /* @__PURE__ */ z({
573
+ B.registerRenderer = ct;
574
+ B.renderer = ze;
575
+ var yt = /* @__PURE__ */ b({
576
576
  name: "ArrowDown",
577
577
  __name: "arrow-down",
578
578
  setup(e) {
579
- return (t, a) => (s(), m("svg", {
579
+ return (t, a) => (i(), m("svg", {
580
580
  xmlns: "http://www.w3.org/2000/svg",
581
581
  viewBox: "0 0 1024 1024"
582
582
  }, [
583
- b("path", {
583
+ y("path", {
584
584
  fill: "currentColor",
585
585
  d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
586
586
  })
587
587
  ]));
588
588
  }
589
- }), Be = yt, wt = /* @__PURE__ */ z({
589
+ }), xe = yt, bt = /* @__PURE__ */ b({
590
590
  name: "Check",
591
591
  __name: "check",
592
592
  setup(e) {
593
- return (t, a) => (s(), m("svg", {
593
+ return (t, a) => (i(), m("svg", {
594
594
  xmlns: "http://www.w3.org/2000/svg",
595
595
  viewBox: "0 0 1024 1024"
596
596
  }, [
597
- b("path", {
597
+ y("path", {
598
598
  fill: "currentColor",
599
599
  d: "M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"
600
600
  })
601
601
  ]));
602
602
  }
603
- }), bt = wt, zt = /* @__PURE__ */ z({
603
+ }), zt = bt, St = /* @__PURE__ */ b({
604
604
  name: "Close",
605
605
  __name: "close",
606
606
  setup(e) {
607
- return (t, a) => (s(), m("svg", {
607
+ return (t, a) => (i(), m("svg", {
608
608
  xmlns: "http://www.w3.org/2000/svg",
609
609
  viewBox: "0 0 1024 1024"
610
610
  }, [
611
- b("path", {
611
+ y("path", {
612
612
  fill: "currentColor",
613
613
  d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
614
614
  })
615
615
  ]));
616
616
  }
617
- }), St = zt, kt = /* @__PURE__ */ z({
617
+ }), kt = St, $t = /* @__PURE__ */ b({
618
618
  name: "CopyDocument",
619
619
  __name: "copy-document",
620
620
  setup(e) {
621
- return (t, a) => (s(), m("svg", {
621
+ return (t, a) => (i(), m("svg", {
622
622
  xmlns: "http://www.w3.org/2000/svg",
623
623
  viewBox: "0 0 1024 1024"
624
624
  }, [
625
- b("path", {
625
+ y("path", {
626
626
  fill: "currentColor",
627
627
  d: "M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"
628
628
  }),
629
- b("path", {
629
+ y("path", {
630
630
  fill: "currentColor",
631
631
  d: "M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"
632
632
  })
633
633
  ]));
634
634
  }
635
- }), $t = kt, Vt = /* @__PURE__ */ z({
635
+ }), Vt = $t, Pt = /* @__PURE__ */ b({
636
636
  name: "Delete",
637
637
  __name: "delete",
638
638
  setup(e) {
639
- return (t, a) => (s(), m("svg", {
639
+ return (t, a) => (i(), m("svg", {
640
640
  xmlns: "http://www.w3.org/2000/svg",
641
641
  viewBox: "0 0 1024 1024"
642
642
  }, [
643
- b("path", {
643
+ y("path", {
644
644
  fill: "currentColor",
645
645
  d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"
646
646
  })
647
647
  ]));
648
648
  }
649
- }), Se = Vt, Pt = /* @__PURE__ */ z({
649
+ }), Se = Pt, Dt = /* @__PURE__ */ b({
650
650
  name: "Document",
651
651
  __name: "document",
652
652
  setup(e) {
653
- return (t, a) => (s(), m("svg", {
653
+ return (t, a) => (i(), m("svg", {
654
654
  xmlns: "http://www.w3.org/2000/svg",
655
655
  viewBox: "0 0 1024 1024"
656
656
  }, [
657
- b("path", {
657
+ y("path", {
658
658
  fill: "currentColor",
659
659
  d: "M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"
660
660
  })
661
661
  ]));
662
662
  }
663
- }), Dt = Pt, Ft = /* @__PURE__ */ z({
663
+ }), Ft = Dt, Rt = /* @__PURE__ */ b({
664
664
  name: "Download",
665
665
  __name: "download",
666
666
  setup(e) {
667
- return (t, a) => (s(), m("svg", {
667
+ return (t, a) => (i(), m("svg", {
668
668
  xmlns: "http://www.w3.org/2000/svg",
669
669
  viewBox: "0 0 1024 1024"
670
670
  }, [
671
- b("path", {
671
+ y("path", {
672
672
  fill: "currentColor",
673
673
  d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"
674
674
  })
675
675
  ]));
676
676
  }
677
- }), ke = Ft, Rt = /* @__PURE__ */ z({
677
+ }), ke = Rt, At = /* @__PURE__ */ b({
678
678
  name: "Edit",
679
679
  __name: "edit",
680
680
  setup(e) {
681
- return (t, a) => (s(), m("svg", {
681
+ return (t, a) => (i(), m("svg", {
682
682
  xmlns: "http://www.w3.org/2000/svg",
683
683
  viewBox: "0 0 1024 1024"
684
684
  }, [
685
- b("path", {
685
+ y("path", {
686
686
  fill: "currentColor",
687
687
  d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"
688
688
  }),
689
- b("path", {
689
+ y("path", {
690
690
  fill: "currentColor",
691
691
  d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
692
692
  })
693
693
  ]));
694
694
  }
695
- }), $e = Rt, At = /* @__PURE__ */ z({
695
+ }), $e = At, Tt = /* @__PURE__ */ b({
696
696
  name: "Lock",
697
697
  __name: "lock",
698
698
  setup(e) {
699
- return (t, a) => (s(), m("svg", {
699
+ return (t, a) => (i(), m("svg", {
700
700
  xmlns: "http://www.w3.org/2000/svg",
701
701
  viewBox: "0 0 1024 1024"
702
702
  }, [
703
- b("path", {
703
+ y("path", {
704
704
  fill: "currentColor",
705
705
  d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
706
706
  }),
707
- b("path", {
707
+ y("path", {
708
708
  fill: "currentColor",
709
709
  d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"
710
710
  })
711
711
  ]));
712
712
  }
713
- }), Ot = At, Tt = /* @__PURE__ */ z({
713
+ }), Ot = Tt, Mt = /* @__PURE__ */ b({
714
714
  name: "Plus",
715
715
  __name: "plus",
716
716
  setup(e) {
717
- return (t, a) => (s(), m("svg", {
717
+ return (t, a) => (i(), m("svg", {
718
718
  xmlns: "http://www.w3.org/2000/svg",
719
719
  viewBox: "0 0 1024 1024"
720
720
  }, [
721
- b("path", {
721
+ y("path", {
722
722
  fill: "currentColor",
723
723
  d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"
724
724
  })
725
725
  ]));
726
726
  }
727
- }), Ve = Tt, Mt = /* @__PURE__ */ z({
727
+ }), Ve = Mt, Bt = /* @__PURE__ */ b({
728
728
  name: "Refresh",
729
729
  __name: "refresh",
730
730
  setup(e) {
731
- return (t, a) => (s(), m("svg", {
731
+ return (t, a) => (i(), m("svg", {
732
732
  xmlns: "http://www.w3.org/2000/svg",
733
733
  viewBox: "0 0 1024 1024"
734
734
  }, [
735
- b("path", {
735
+ y("path", {
736
736
  fill: "currentColor",
737
737
  d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
738
738
  })
739
739
  ]));
740
740
  }
741
- }), se = Mt, Lt = /* @__PURE__ */ z({
741
+ }), se = Bt, Lt = /* @__PURE__ */ b({
742
742
  name: "Search",
743
743
  __name: "search",
744
744
  setup(e) {
745
- return (t, a) => (s(), m("svg", {
745
+ return (t, a) => (i(), m("svg", {
746
746
  xmlns: "http://www.w3.org/2000/svg",
747
747
  viewBox: "0 0 1024 1024"
748
748
  }, [
749
- b("path", {
749
+ y("path", {
750
750
  fill: "currentColor",
751
751
  d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
752
752
  })
753
753
  ]));
754
754
  }
755
- }), ie = Lt, Bt = /* @__PURE__ */ z({
755
+ }), ie = Lt, xt = /* @__PURE__ */ b({
756
756
  name: "Setting",
757
757
  __name: "setting",
758
758
  setup(e) {
759
- return (t, a) => (s(), m("svg", {
759
+ return (t, a) => (i(), m("svg", {
760
760
  xmlns: "http://www.w3.org/2000/svg",
761
761
  viewBox: "0 0 1024 1024"
762
762
  }, [
763
- b("path", {
763
+ y("path", {
764
764
  fill: "currentColor",
765
765
  d: "M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256"
766
766
  })
767
767
  ]));
768
768
  }
769
- }), Pe = Bt, xt = /* @__PURE__ */ z({
769
+ }), Pe = xt, Ht = /* @__PURE__ */ b({
770
770
  name: "Share",
771
771
  __name: "share",
772
772
  setup(e) {
773
- return (t, a) => (s(), m("svg", {
773
+ return (t, a) => (i(), m("svg", {
774
774
  xmlns: "http://www.w3.org/2000/svg",
775
775
  viewBox: "0 0 1024 1024"
776
776
  }, [
777
- b("path", {
777
+ y("path", {
778
778
  fill: "currentColor",
779
779
  d: "m679.872 348.8-301.76 188.608a127.8 127.8 0 0 1 5.12 52.16l279.936 104.96a128 128 0 1 1-22.464 59.904l-279.872-104.96a128 128 0 1 1-16.64-166.272l301.696-188.608a128 128 0 1 1 33.92 54.272z"
780
780
  })
781
781
  ]));
782
782
  }
783
- }), Ht = xt, Zt = /* @__PURE__ */ z({
783
+ }), Zt = Ht, jt = /* @__PURE__ */ b({
784
784
  name: "Unlock",
785
785
  __name: "unlock",
786
786
  setup(e) {
787
- return (t, a) => (s(), m("svg", {
787
+ return (t, a) => (i(), m("svg", {
788
788
  xmlns: "http://www.w3.org/2000/svg",
789
789
  viewBox: "0 0 1024 1024"
790
790
  }, [
791
- b("path", {
791
+ y("path", {
792
792
  fill: "currentColor",
793
793
  d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
794
794
  }),
795
- b("path", {
795
+ y("path", {
796
796
  fill: "currentColor",
797
797
  d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"
798
798
  })
799
799
  ]));
800
800
  }
801
- }), jt = Zt, Et = /* @__PURE__ */ z({
801
+ }), Et = jt, It = /* @__PURE__ */ b({
802
802
  name: "Upload",
803
803
  __name: "upload",
804
804
  setup(e) {
805
- return (t, a) => (s(), m("svg", {
805
+ return (t, a) => (i(), m("svg", {
806
806
  xmlns: "http://www.w3.org/2000/svg",
807
807
  viewBox: "0 0 1024 1024"
808
808
  }, [
809
- b("path", {
809
+ y("path", {
810
810
  fill: "currentColor",
811
811
  d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z"
812
812
  })
813
813
  ]));
814
814
  }
815
- }), De = Et, It = /* @__PURE__ */ z({
815
+ }), De = It, Nt = /* @__PURE__ */ b({
816
816
  name: "View",
817
817
  __name: "view",
818
818
  setup(e) {
819
- return (t, a) => (s(), m("svg", {
819
+ return (t, a) => (i(), m("svg", {
820
820
  xmlns: "http://www.w3.org/2000/svg",
821
821
  viewBox: "0 0 1024 1024"
822
822
  }, [
823
- b("path", {
823
+ y("path", {
824
824
  fill: "currentColor",
825
825
  d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"
826
826
  })
827
827
  ]));
828
828
  }
829
- }), Fe = It, Nt = /* @__PURE__ */ z({
829
+ }), Fe = Nt, Ut = /* @__PURE__ */ b({
830
830
  name: "Warning",
831
831
  __name: "warning",
832
832
  setup(e) {
833
- return (t, a) => (s(), m("svg", {
833
+ return (t, a) => (i(), m("svg", {
834
834
  xmlns: "http://www.w3.org/2000/svg",
835
835
  viewBox: "0 0 1024 1024"
836
836
  }, [
837
- b("path", {
837
+ y("path", {
838
838
  fill: "currentColor",
839
839
  d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"
840
840
  })
841
841
  ]));
842
842
  }
843
- }), Ut = Nt;
844
- const qt = z({
843
+ }), qt = Ut;
844
+ const Wt = b({
845
845
  name: "ZxtForm",
846
846
  inheritAttrs: !1,
847
847
  props: {
@@ -852,7 +852,7 @@ const qt = z({
852
852
  },
853
853
  emits: ["submit", "reset"],
854
854
  setup(e, { emit: t, expose: a }) {
855
- const l = k(null), u = We({}), d = {
855
+ const r = k(null), u = Ge({}), d = {
856
856
  input: "el-input",
857
857
  select: "el-select",
858
858
  date: "el-date-picker",
@@ -860,39 +860,39 @@ const qt = z({
860
860
  datetime: "el-date-picker",
861
861
  datetimerange: "el-date-picker",
862
862
  cascader: "el-cascader"
863
- }, o = (r) => d[r] || "el-input", p = (r) => {
864
- const _ = r.type || "input", x = [
863
+ }, l = (s) => d[s] || "el-input", c = (s) => {
864
+ const C = s.type || "input", x = [
865
865
  "select",
866
866
  "date",
867
867
  "daterange",
868
868
  "datetime",
869
869
  "datetimerange",
870
870
  "cascader"
871
- ].includes(_), J = {
872
- placeholder: r.placeholder || `请${x ? "选择" : "输入"}${r.label}`,
873
- disabled: r.disabled,
871
+ ].includes(C), J = {
872
+ placeholder: s.placeholder || `请${x ? "选择" : "输入"}${s.label}`,
873
+ disabled: s.disabled,
874
874
  style: "width: 100%",
875
875
  "popper-class": "zxt-form-popper"
876
876
  };
877
877
  let R = {};
878
- switch (_) {
878
+ switch (C) {
879
879
  case "date":
880
880
  case "daterange":
881
881
  case "datetime":
882
882
  case "datetimerange":
883
883
  R = {
884
- type: r.dateType || _,
885
- startPlaceholder: r.startPlaceholder || "开始日期",
886
- endPlaceholder: r.endPlaceholder || "结束日期",
887
- format: r.format,
888
- valueFormat: r.valueFormat
884
+ type: s.dateType || C,
885
+ startPlaceholder: s.startPlaceholder || "开始日期",
886
+ endPlaceholder: s.endPlaceholder || "结束日期",
887
+ format: s.format,
888
+ valueFormat: s.valueFormat
889
889
  };
890
890
  break;
891
891
  case "cascader":
892
892
  R = {
893
- options: r.options,
894
- props: r.cascaderProps,
895
- clearable: r.clearable !== !1
893
+ options: s.options,
894
+ props: s.cascaderProps,
895
+ clearable: s.clearable !== !1
896
896
  };
897
897
  break;
898
898
  default:
@@ -902,30 +902,30 @@ const qt = z({
902
902
  ...J,
903
903
  ...R
904
904
  };
905
- return "clearable" in r && (E.clearable = r.clearable), r.props && typeof r.props == "object" && Object.assign(E, r.props), E;
906
- }, g = C(() => e.formColumns.map((r) => ({
907
- ...r,
905
+ return "clearable" in s && (E.clearable = s.clearable), s.props && typeof s.props == "object" && Object.assign(E, s.props), E;
906
+ }, g = _(() => e.formColumns.map((s) => ({
907
+ ...s,
908
908
  colSpan: {
909
- xs: r.xs ?? r.span ?? 24,
910
- sm: r.sm ?? r.span ?? 12,
911
- md: r.md ?? r.span ?? 12,
912
- lg: r.lg ?? r.span ?? 12,
913
- xl: r.xl ?? r.span ?? 12
909
+ xs: s.xs ?? s.span ?? 24,
910
+ sm: s.sm ?? s.span ?? 12,
911
+ md: s.md ?? s.span ?? 12,
912
+ lg: s.lg ?? s.span ?? 12,
913
+ xl: s.xl ?? s.span ?? 12
914
914
  }
915
915
  })));
916
916
  X(
917
917
  () => e.initialFormData,
918
- (r) => {
919
- Object.keys(u).forEach((_) => {
920
- delete u[_];
921
- }), Object.assign(u, r);
918
+ (s) => {
919
+ Object.keys(u).forEach((C) => {
920
+ delete u[C];
921
+ }), Object.assign(u, s);
922
922
  },
923
923
  { immediate: !0, deep: !0 }
924
924
  );
925
- const c = C(() => {
926
- const r = { ...e.rules };
927
- return Object.keys(r).length === 0 && e.formColumns.length > 0 && e.formColumns.forEach((_) => {
928
- if (_.required) {
925
+ const z = _(() => {
926
+ const s = { ...e.rules };
927
+ return Object.keys(s).length === 0 && e.formColumns.length > 0 && e.formColumns.forEach((C) => {
928
+ if (C.required) {
929
929
  const x = [
930
930
  "select",
931
931
  "date",
@@ -933,85 +933,85 @@ const qt = z({
933
933
  "datetime",
934
934
  "datetimerange",
935
935
  "cascader"
936
- ].includes(_.type);
937
- r[_.prop] = [
936
+ ].includes(C.type);
937
+ s[C.prop] = [
938
938
  {
939
939
  required: !0,
940
- message: `请${x ? "选择" : "输入"}${_.label}`,
940
+ message: `请${x ? "选择" : "输入"}${C.label}`,
941
941
  trigger: x ? "change" : "blur"
942
942
  }
943
943
  ];
944
944
  }
945
- }), r;
946
- }), h = () => {
947
- l.value && l.value.validate((r) => {
948
- r && t("submit", { ...u });
945
+ }), s;
946
+ }), p = () => {
947
+ r.value && r.value.validate((s) => {
948
+ s && t("submit", { ...u });
949
949
  });
950
- }, i = () => {
951
- l.value && l.value.resetFields(), t("reset");
952
- }, y = (r) => () => Ct(r, u, {}) || null;
950
+ }, n = () => {
951
+ r.value && r.value.resetFields(), t("reset");
952
+ }, v = (s) => () => wt(s, u, {}) || null;
953
953
  return a({
954
- validate: () => l.value ? l.value.validate() : Promise.resolve(!1),
955
- resetFields: () => l.value && l.value.resetFields(),
954
+ validate: () => r.value ? r.value.validate() : Promise.resolve(!1),
955
+ resetFields: () => r.value && r.value.resetFields(),
956
956
  getFormData: () => ({ ...u }),
957
- submitForm: h,
958
- resetForm: i
957
+ submitForm: p,
958
+ resetForm: n
959
959
  }), {
960
- formRef: l,
960
+ formRef: r,
961
961
  formData: u,
962
- formRules: c,
963
- submitForm: h,
964
- resetForm: i,
962
+ formRules: z,
963
+ submitForm: p,
964
+ resetForm: n,
965
965
  processedColumns: g,
966
- getComponentType: o,
967
- getComponentProps: p,
968
- renderCustomItem: y
966
+ getComponentType: l,
967
+ getComponentProps: c,
968
+ renderCustomItem: v
969
969
  };
970
970
  }
971
- }), Wt = { class: "zxt-form-container" }, Gt = {
971
+ }), Gt = { class: "zxt-form-container" }, Jt = {
972
972
  key: 0,
973
973
  class: "form-label"
974
- }, Jt = { class: "form-control" };
975
- function Kt(e, t, a, l, u, d) {
976
- const o = S("el-option"), p = S("el-form-item"), g = S("el-col"), c = S("el-row"), h = S("el-form");
977
- return s(), m("div", Wt, [
978
- F(h, M({ ref: "formRef" }, e.$attrs, {
974
+ }, Kt = { class: "form-control" };
975
+ function Qt(e, t, a, r, u, d) {
976
+ const l = S("el-option"), c = S("el-form-item"), g = S("el-col"), z = S("el-row"), p = S("el-form");
977
+ return i(), m("div", Gt, [
978
+ F(p, M({ ref: "formRef" }, e.$attrs, {
979
979
  model: e.formData,
980
980
  rules: e.formRules,
981
981
  "label-width": e.labelWidth,
982
982
  class: "zxt-form"
983
983
  }), {
984
984
  default: w(() => [
985
- F(c, { gutter: 20 }, {
985
+ F(z, { gutter: 20 }, {
986
986
  default: w(() => [
987
- (s(!0), m(B, null, T(e.processedColumns, (i, y) => (s(), V(g, M({ key: y }, { ref_for: !0 }, i.colSpan), {
987
+ (i(!0), m(L, null, O(e.processedColumns, (n, v) => (i(), V(g, M({ key: v }, { ref_for: !0 }, n.colSpan), {
988
988
  default: w(() => [
989
- F(p, {
990
- prop: i.prop,
991
- required: i.required,
989
+ F(c, {
990
+ prop: n.prop,
991
+ required: n.required,
992
992
  "label-width": "0",
993
993
  class: "custom-form-item"
994
994
  }, {
995
995
  default: w(() => [
996
- b("div", {
997
- class: ue(["form-item-wrapper", { "is-action": i.isAction }])
996
+ y("div", {
997
+ class: ue(["form-item-wrapper", { "is-action": n.isAction }])
998
998
  }, [
999
- i.label ? (s(), m("span", Gt, ee(i.label), 1)) : W("", !0),
1000
- b("div", Jt, [
1001
- i.type === "slot" ? O(e.$slots, i.slotName || i.prop, {
999
+ n.label ? (i(), m("span", Jt, ee(n.label), 1)) : W("", !0),
1000
+ y("div", Kt, [
1001
+ n.type === "slot" ? T(e.$slots, n.slotName || n.prop, {
1002
1002
  key: 0,
1003
1003
  formData: e.formData,
1004
- column: i
1005
- }, void 0, !0) : i.itemRender ? (s(), V(be(e.renderCustomItem(i)), { key: 1 })) : (s(), V(be(e.getComponentType(i.type)), M({
1004
+ column: n
1005
+ }, void 0, !0) : n.itemRender ? (i(), V(be(e.renderCustomItem(n)), { key: 1 })) : (i(), V(be(e.getComponentType(n.type)), M({
1006
1006
  key: 2,
1007
- modelValue: e.formData[i.prop],
1008
- "onUpdate:modelValue": (r) => e.formData[i.prop] = r
1009
- }, { ref_for: !0 }, e.getComponentProps(i), Ge(i.events || {})), {
1007
+ modelValue: e.formData[n.prop],
1008
+ "onUpdate:modelValue": (s) => e.formData[n.prop] = s
1009
+ }, { ref_for: !0 }, e.getComponentProps(n), Je(n.events || {})), {
1010
1010
  default: w(() => [
1011
- i.type === "select" ? (s(!0), m(B, { key: 0 }, T(i.options, (r, _) => (s(), V(o, {
1012
- key: _,
1013
- label: r.label,
1014
- value: r.value
1011
+ n.type === "select" ? (i(!0), m(L, { key: 0 }, O(n.options, (s, C) => (i(), V(l, {
1012
+ key: C,
1013
+ label: s.label,
1014
+ value: s.value
1015
1015
  }, null, 8, ["label", "value"]))), 128)) : W("", !0)
1016
1016
  ]),
1017
1017
  _: 2
@@ -1032,7 +1032,7 @@ function Kt(e, t, a, l, u, d) {
1032
1032
  }, 16, ["model", "rules", "label-width"])
1033
1033
  ]);
1034
1034
  }
1035
- const Re = /* @__PURE__ */ G(qt, [["render", Kt], ["__scopeId", "data-v-6b22a57b"]]), Qt = {
1035
+ const Re = /* @__PURE__ */ G(Wt, [["render", Qt], ["__scopeId", "data-v-6b22a57b"]]), Xt = {
1036
1036
  Plus: Ve,
1037
1037
  Delete: Se,
1038
1038
  Refresh: se,
@@ -1042,18 +1042,18 @@ const Re = /* @__PURE__ */ G(qt, [["render", Kt], ["__scopeId", "data-v-6b22a57b
1042
1042
  View: Fe,
1043
1043
  Upload: De,
1044
1044
  Setting: Pe,
1045
- Warning: Ut,
1046
- Check: bt,
1047
- Close: St,
1048
- Document: Dt,
1049
- CopyDocument: $t,
1050
- Share: Ht,
1045
+ Warning: qt,
1046
+ Check: zt,
1047
+ Close: kt,
1048
+ Document: Ft,
1049
+ CopyDocument: Vt,
1050
+ Share: Zt,
1051
1051
  Lock: Ot,
1052
- Unlock: jt,
1053
- ArrowDown: Be
1054
- }, Xt = z({
1052
+ Unlock: Et,
1053
+ ArrowDown: xe
1054
+ }, Yt = b({
1055
1055
  name: "ActionColumn",
1056
- components: { ArrowDown: Be },
1056
+ components: { ArrowDown: xe },
1057
1057
  props: {
1058
1058
  buttons: {
1059
1059
  type: Array,
@@ -1070,60 +1070,68 @@ const Re = /* @__PURE__ */ G(qt, [["render", Kt], ["__scopeId", "data-v-6b22a57b
1070
1070
  },
1071
1071
  emits: ["action-click"],
1072
1072
  setup(e, { emit: t }) {
1073
- const a = C(() => e.buttons.filter((c) => typeof c.visible == "function" ? c.visible(e.row) : typeof c.visible == "boolean" ? c.visible : !0)), l = C(
1073
+ const a = _(() => e.buttons.filter((n) => typeof n.visible == "function" ? n.visible(e.row) : typeof n.visible == "boolean" ? n.visible : !0)), r = _(
1074
1074
  () => a.value.length > e.maxVisible
1075
- ), u = C(
1076
- () => l.value ? a.value.slice(0, e.maxVisible) : a.value
1077
- ), d = C(
1078
- () => l.value ? a.value.slice(e.maxVisible) : []
1079
- );
1075
+ ), u = _(
1076
+ () => r.value ? a.value.slice(0, e.maxVisible) : a.value
1077
+ ), d = _(
1078
+ () => r.value ? a.value.slice(e.maxVisible) : []
1079
+ ), l = (n) => {
1080
+ if (n)
1081
+ return typeof n == "object" || typeof n == "function" ? n : Xt[n];
1082
+ }, c = (n) => {
1083
+ n?.currentTarget?.blur?.();
1084
+ };
1080
1085
  return {
1081
1086
  visibleButtons: u,
1082
1087
  overflowButtons: d,
1083
- getIconComponent: (c) => {
1084
- if (c)
1085
- return typeof c == "object" || typeof c == "function" ? c : Qt[c];
1088
+ getIconComponent: l,
1089
+ handleClick: (n, v) => {
1090
+ c(v), t("action-click", { code: n.code, button: n, row: e.row });
1086
1091
  },
1087
- handleClick: (c) => {
1088
- t("action-click", { code: c.code, button: c, row: e.row });
1092
+ handleCommand: (n) => {
1093
+ t("action-click", { code: n.code, button: n, row: e.row });
1089
1094
  },
1090
- handleCommand: (c) => {
1091
- t("action-click", { code: c.code, button: c, row: e.row });
1095
+ handleTriggerClick: (n) => {
1096
+ c(n);
1092
1097
  }
1093
1098
  };
1094
1099
  }
1095
- }), Yt = { class: "action-column" };
1096
- function ea(e, t, a, l, u, d) {
1097
- const o = S("el-button"), p = S("ArrowDown"), g = S("el-icon"), c = S("el-dropdown-item"), h = S("el-dropdown-menu"), i = S("el-dropdown");
1098
- return s(), m("div", Yt, [
1099
- (s(!0), m(B, null, T(e.visibleButtons, (y) => (s(), V(o, {
1100
- key: y.code,
1101
- type: y.type || "",
1102
- icon: e.getIconComponent(y.icon),
1100
+ }), ea = { class: "action-column" };
1101
+ function ta(e, t, a, r, u, d) {
1102
+ const l = S("el-button"), c = S("ArrowDown"), g = S("el-icon"), z = S("el-dropdown-item"), p = S("el-dropdown-menu"), n = S("el-dropdown");
1103
+ return i(), m("div", ea, [
1104
+ (i(!0), m(L, null, O(e.visibleButtons, (v) => (i(), V(l, {
1105
+ key: v.code,
1106
+ class: "action-btn",
1107
+ type: v.type || "",
1108
+ icon: e.getIconComponent(v.icon),
1103
1109
  size: "small",
1104
1110
  link: "",
1105
- onClick: (r) => e.handleClick(y)
1111
+ onMousedown: t[0] || (t[0] = Te(() => {
1112
+ }, ["prevent"])),
1113
+ onClick: (s) => e.handleClick(v, s)
1106
1114
  }, {
1107
1115
  default: w(() => [
1108
- j(ee(y.label), 1)
1116
+ j(ee(v.label), 1)
1109
1117
  ]),
1110
1118
  _: 2
1111
1119
  }, 1032, ["type", "icon", "onClick"]))), 128)),
1112
- e.overflowButtons.length ? (s(), V(i, {
1120
+ e.overflowButtons.length ? (i(), V(n, {
1113
1121
  key: 0,
1114
1122
  trigger: "hover",
1115
1123
  onCommand: e.handleCommand
1116
1124
  }, {
1117
1125
  dropdown: w(() => [
1118
- F(h, null, {
1126
+ F(p, null, {
1119
1127
  default: w(() => [
1120
- (s(!0), m(B, null, T(e.overflowButtons, (y) => (s(), V(c, {
1121
- key: y.code,
1122
- command: y,
1123
- icon: e.getIconComponent(y.icon)
1128
+ (i(!0), m(L, null, O(e.overflowButtons, (v) => (i(), V(z, {
1129
+ key: v.code,
1130
+ command: v,
1131
+ icon: e.getIconComponent(v.icon)
1124
1132
  }, {
1125
1133
  default: w(() => [
1126
- j(ee(y.label), 1)
1134
+ j(ee(v.label), 1)
1127
1135
  ]),
1128
1136
  _: 2
1129
1137
  }, 1032, ["command", "icon"]))), 128))
@@ -1132,34 +1140,38 @@ function ea(e, t, a, l, u, d) {
1132
1140
  })
1133
1141
  ]),
1134
1142
  default: w(() => [
1135
- F(o, {
1143
+ F(l, {
1144
+ class: "action-btn",
1136
1145
  type: "",
1137
1146
  size: "small",
1138
- link: ""
1147
+ link: "",
1148
+ onMousedown: t[1] || (t[1] = Te(() => {
1149
+ }, ["prevent"])),
1150
+ onClick: e.handleTriggerClick
1139
1151
  }, {
1140
1152
  default: w(() => [
1141
- t[0] || (t[0] = j(" 更多 ", -1)),
1153
+ t[2] || (t[2] = j(" 更多 ", -1)),
1142
1154
  F(g, { class: "el-icon--right" }, {
1143
1155
  default: w(() => [
1144
- F(p)
1156
+ F(c)
1145
1157
  ]),
1146
1158
  _: 1
1147
1159
  })
1148
1160
  ]),
1149
1161
  _: 1
1150
- })
1162
+ }, 8, ["onClick"])
1151
1163
  ]),
1152
1164
  _: 1
1153
1165
  }, 8, ["onCommand"])) : W("", !0)
1154
1166
  ]);
1155
1167
  }
1156
- const ta = /* @__PURE__ */ G(Xt, [["render", ea], ["__scopeId", "data-v-6d75a891"]]), aa = z({
1168
+ const aa = /* @__PURE__ */ G(Yt, [["render", ta], ["__scopeId", "data-v-fe798e9c"]]), na = b({
1157
1169
  name: "ZxtGrid",
1158
1170
  inheritAttrs: !1,
1159
1171
  components: {
1160
- ZxtTable: L,
1172
+ ZxtTable: B,
1161
1173
  ZxtForm: Re,
1162
- ActionColumn: ta,
1174
+ ActionColumn: aa,
1163
1175
  Plus: Ve,
1164
1176
  Delete: Se,
1165
1177
  Refresh: se,
@@ -1196,9 +1208,9 @@ const ta = /* @__PURE__ */ G(Xt, [["render", ea], ["__scopeId", "data-v-6d75a891
1196
1208
  },
1197
1209
  emits: ["toolbar-click", "action-click", "submit", "reset", "page-change", "size-change"],
1198
1210
  setup(e, { emit: t, expose: a }) {
1199
- const l = Je(), u = Me(), d = k(null), o = k(null), p = k(1), g = k(10), c = k(null), h = k(e.gridOptions.formMode !== !1), i = k({
1211
+ const r = Ke(), u = Be(), d = k(null), l = k(null), c = k(1), g = k(10), z = k(null), p = k(e.gridOptions.formMode !== !1), n = k({
1200
1212
  ...e.gridOptions.formConfig?.data || {}
1201
- }), y = {
1213
+ }), v = {
1202
1214
  Plus: Ve,
1203
1215
  Delete: Se,
1204
1216
  Refresh: se,
@@ -1208,141 +1220,143 @@ const ta = /* @__PURE__ */ G(Xt, [["render", ea], ["__scopeId", "data-v-6d75a891
1208
1220
  View: Fe,
1209
1221
  Upload: De,
1210
1222
  Setting: Pe
1211
- }, r = C(() => {
1212
- const v = (e.gridOptions.columns || []).find((D) => D.actionColumn);
1213
- return v ? v.actionColumn : null;
1214
- }), _ = C(() => (e.gridOptions.columns || []).map((v) => v.actionColumn ? {
1215
- ...v,
1223
+ }, s = _(() => {
1224
+ const o = e.gridOptions.columns || [];
1225
+ console.log("cols", e.gridOptions.columns);
1226
+ const h = o.find((D) => D.actionColumn);
1227
+ return h ? h.actionColumn : null;
1228
+ }), C = _(() => (e.gridOptions.columns || []).map((h) => h.actionColumn ? {
1229
+ ...h,
1216
1230
  slot: "__action__",
1217
1231
  actionColumn: void 0
1218
- } : v)), x = (n) => {
1219
- t("action-click", n);
1220
- }, J = C(() => {
1221
- const n = e.gridOptions.formConfig;
1222
- if (!n || !n.items) return [];
1223
- const v = [...n.items];
1224
- return v.some(
1232
+ } : h)), x = (o) => {
1233
+ t("action-click", o);
1234
+ }, J = _(() => {
1235
+ const o = e.gridOptions.formConfig;
1236
+ if (!o || !o.items) return [];
1237
+ const h = [...o.items];
1238
+ return h.some(
1225
1239
  (Z) => Z.type === "slot" && Z.slotName === "search-actions"
1226
- ) || v.push({
1240
+ ) || h.push({
1227
1241
  type: "slot",
1228
1242
  slotName: "search-actions",
1229
1243
  span: 6,
1230
1244
  labelWidth: "0px",
1231
1245
  isAction: !0,
1232
- ...n.actionConfig
1233
- }), v;
1234
- }), R = C(() => {
1235
- const n = /* @__PURE__ */ new Set(["search-actions"]);
1236
- return (J.value || []).forEach((v) => {
1237
- v.type === "slot" && n.add(v.slotName || v.prop);
1238
- }), n;
1239
- }), E = C(() => {
1240
- const n = {};
1241
- for (const v in u)
1242
- v === "search-actions" || v === "toolbar" || (R.value.has(v) || v.startsWith("form-")) && (n[v] = u[v]);
1243
- return n;
1244
- }), de = C(() => {
1245
- const n = {};
1246
- for (const v in u)
1247
- v !== "toolbar" && !R.value.has(v) && !v.startsWith("form-") && (n[v] = u[v]);
1248
- return n;
1246
+ ...o.actionConfig
1247
+ }), h;
1248
+ }), R = _(() => {
1249
+ const o = /* @__PURE__ */ new Set(["search-actions"]);
1250
+ return (J.value || []).forEach((h) => {
1251
+ h.type === "slot" && o.add(h.slotName || h.prop);
1252
+ }), o;
1253
+ }), E = _(() => {
1254
+ const o = {};
1255
+ for (const h in u)
1256
+ h === "search-actions" || h === "toolbar" || (R.value.has(h) || h.startsWith("form-")) && (o[h] = u[h]);
1257
+ return o;
1258
+ }), de = _(() => {
1259
+ const o = {};
1260
+ for (const h in u)
1261
+ h !== "toolbar" && !R.value.has(h) && !h.startsWith("form-") && (o[h] = u[h]);
1262
+ return o;
1249
1263
  }), ce = () => {
1250
- o.value?.submitForm();
1251
- }, pe = (n) => {
1252
- t("submit", n), e.gridOptions.proxyConfig && (i.value = { ...n }, p.value = 1, d.value?.reload?.({ formData: i.value, page: 1 }));
1264
+ l.value?.submitForm();
1265
+ }, pe = (o) => {
1266
+ t("submit", o), e.gridOptions.proxyConfig && (n.value = { ...o }, c.value = 1, d.value?.reload?.({ formData: n.value, page: 1 }));
1253
1267
  }, H = () => {
1254
- o.value?.resetForm();
1268
+ l.value?.resetForm();
1255
1269
  }, oe = () => {
1256
- t("reset"), e.gridOptions.proxyConfig && (i.value = {}, p.value = 1, d.value?.reload?.({ formData: {}, page: 1 }));
1257
- }, fe = (n) => {
1258
- if (n)
1259
- return typeof n == "object" || typeof n == "function" ? n : y[n];
1260
- }, me = C(() => {
1261
- const n = e.gridOptions.proxyConfig;
1262
- return n ? {
1263
- ...n,
1264
- _formData: i.value
1270
+ t("reset"), e.gridOptions.proxyConfig && (n.value = {}, c.value = 1, d.value?.reload?.({ formData: {}, page: 1 }));
1271
+ }, fe = (o) => {
1272
+ if (o)
1273
+ return typeof o == "object" || typeof o == "function" ? o : v[o];
1274
+ }, me = _(() => {
1275
+ const o = e.gridOptions.proxyConfig;
1276
+ return o ? {
1277
+ ...o,
1278
+ _formData: n.value
1265
1279
  } : null;
1266
- }), ge = C(() => {
1280
+ }), ge = _(() => {
1267
1281
  const {
1268
- formConfig: n,
1269
- toolbar: v,
1282
+ formConfig: o,
1283
+ toolbar: h,
1270
1284
  formMode: D,
1271
1285
  formColumns: Z,
1272
1286
  rules: re,
1273
- data: we,
1274
- proxyConfig: He,
1275
- ...Ze
1287
+ data: ye,
1288
+ proxyConfig: Ze,
1289
+ ...je
1276
1290
  } = e.gridOptions;
1277
1291
  return {
1278
- ...Ze,
1279
- proxyConfig: me.value || He || null
1292
+ ...je,
1293
+ proxyConfig: me.value || Ze || null
1280
1294
  };
1281
- }), le = C(() => c.value !== null ? c.value : e.externalData.length > 0 ? e.externalData : e.gridOptions.data || []), Ae = C(() => !!e.gridOptions.proxyConfig), f = C(() => Ae.value ? 0 : le.value.length), $ = (n, v) => {
1282
- t("toolbar-click", { code: n, button: v, grid: d.value });
1283
- }, I = (n) => {
1284
- p.value = n.page, t("page-change", n);
1285
- }, N = (n) => {
1286
- g.value = n.size, t("size-change", n);
1287
- }, he = () => d.value, ve = () => o.value, _e = () => d.value?.getTableRef()?.getSelectionRows?.() || [], Ce = (n) => {
1288
- c.value = n ?? null;
1289
- }, ye = (n) => {
1290
- h.value = n;
1291
- }, U = (n, v = !0) => {
1295
+ }), le = _(() => z.value !== null ? z.value : e.externalData.length > 0 ? e.externalData : e.gridOptions.data || []), Ae = _(() => !!e.gridOptions.proxyConfig), f = _(() => Ae.value ? 0 : le.value.length), $ = (o, h) => {
1296
+ t("toolbar-click", { code: o, button: h, grid: d.value });
1297
+ }, I = (o) => {
1298
+ c.value = o.page, t("page-change", o);
1299
+ }, N = (o) => {
1300
+ g.value = o.size, t("size-change", o);
1301
+ }, he = () => d.value, ve = () => l.value, Ce = () => d.value?.getTableRef()?.getSelectionRows?.() || [], _e = (o) => {
1302
+ z.value = o ?? null;
1303
+ }, we = (o) => {
1304
+ p.value = o;
1305
+ }, U = (o, h = !0) => {
1292
1306
  const D = e.gridOptions.formConfig;
1293
- D?.data && Object.assign(D.data, n), i.value = { ...D?.data || {}, ...n }, v && e.gridOptions.proxyConfig && (p.value = 1, d.value?.reload?.({ formData: i.value, page: 1 }));
1294
- }, A = (n, ...v) => {
1295
- const D = i.value;
1296
- switch (n) {
1307
+ D?.data && Object.assign(D.data, o), n.value = { ...D?.data || {}, ...o }, h && e.gridOptions.proxyConfig && (c.value = 1, d.value?.reload?.({ formData: n.value, page: 1 }));
1308
+ }, A = (o, ...h) => {
1309
+ const D = n.value;
1310
+ switch (o) {
1297
1311
  case "query":
1298
- p.value = 1, d.value?.reload?.({ formData: D, page: 1 });
1312
+ c.value = 1, d.value?.reload?.({ formData: D, page: 1 });
1299
1313
  break;
1300
1314
  case "reload":
1301
1315
  d.value?.reload?.({ formData: D });
1302
1316
  break;
1303
1317
  default:
1304
- console.warn(`[ZxtGrid] commitProxy: unknown type "${n}"`);
1318
+ console.warn(`[ZxtGrid] commitProxy: unknown type "${o}"`);
1305
1319
  }
1306
1320
  };
1307
1321
  X(
1308
1322
  () => e.gridOptions.formMode,
1309
- (n) => {
1310
- n !== void 0 && (h.value = n);
1323
+ (o) => {
1324
+ o !== void 0 && (p.value = o);
1311
1325
  }
1312
1326
  ), Le(() => {
1313
- e.gridOptions.proxyConfig && e.gridOptions.autoLoad !== !1 && d.value?.reload?.({ formData: i.value, page: 1 });
1327
+ e.gridOptions.proxyConfig && e.gridOptions.autoLoad !== !1 && d.value?.reload?.({ formData: n.value, page: 1 });
1314
1328
  });
1315
1329
  const P = () => d.value?.getTableRef?.();
1316
1330
  return a({
1317
1331
  getGridRef: he,
1318
1332
  getFormRef: ve,
1319
1333
  getElTableRef: P,
1320
- getSelectedRows: _e,
1321
- reloadData: Ce,
1322
- setFormVisible: ye,
1334
+ getSelectedRows: Ce,
1335
+ reloadData: _e,
1336
+ setFormVisible: we,
1323
1337
  setFormData: U,
1324
1338
  commitProxy: A,
1325
1339
  clearSelection: () => P()?.clearSelection(),
1326
- toggleRowSelection: (...n) => P()?.toggleRowSelection(...n),
1340
+ toggleRowSelection: (...o) => P()?.toggleRowSelection(...o),
1327
1341
  toggleAllSelection: () => P()?.toggleAllSelection(),
1328
- toggleRowExpansion: (...n) => P()?.toggleRowExpansion(...n),
1329
- setCurrentRow: (...n) => P()?.setCurrentRow(...n),
1342
+ toggleRowExpansion: (...o) => P()?.toggleRowExpansion(...o),
1343
+ setCurrentRow: (...o) => P()?.setCurrentRow(...o),
1330
1344
  clearSort: () => P()?.clearSort(),
1331
- clearFilter: (...n) => P()?.clearFilter(...n),
1345
+ clearFilter: (...o) => P()?.clearFilter(...o),
1332
1346
  doLayout: () => P()?.doLayout(),
1333
- sort: (...n) => P()?.sort(...n)
1347
+ sort: (...o) => P()?.sort(...o)
1334
1348
  }), {
1335
- attrs: l,
1349
+ attrs: r,
1336
1350
  gridRef: d,
1337
- searchFormRef: o,
1338
- currentPage: p,
1351
+ searchFormRef: l,
1352
+ currentPage: c,
1339
1353
  pageSize: g,
1340
1354
  tableData: le,
1341
1355
  tableProps: ge,
1342
- mergedColumns: _,
1343
- actionColumnConfig: r,
1356
+ mergedColumns: C,
1357
+ actionColumnConfig: s,
1344
1358
  total: f,
1345
- isFormVisible: h,
1359
+ isFormVisible: p,
1346
1360
  searchFormColumns: J,
1347
1361
  formFilteredSlots: E,
1348
1362
  tableFilteredSlots: de,
@@ -1359,20 +1373,20 @@ const ta = /* @__PURE__ */ G(Xt, [["render", ea], ["__scopeId", "data-v-6d75a891
1359
1373
  Refresh: se
1360
1374
  };
1361
1375
  }
1362
- }), na = {
1376
+ }), oa = {
1363
1377
  key: 0,
1364
1378
  class: "grid-search-form"
1365
- }, oa = { class: "search-btn-group" }, la = { class: "grid-table-wrapper" }, ra = {
1379
+ }, la = { class: "search-btn-group" }, ra = { class: "grid-table-wrapper" }, sa = {
1366
1380
  key: 0,
1367
1381
  class: "grid-toolbar"
1368
1382
  };
1369
- function sa(e, t, a, l, u, d) {
1370
- const o = S("el-button"), p = S("ZxtForm"), g = S("ActionColumn"), c = S("ZxtTable");
1371
- return s(), m("div", {
1383
+ function ia(e, t, a, r, u, d) {
1384
+ const l = S("el-button"), c = S("ZxtForm"), g = S("ActionColumn"), z = S("ZxtTable");
1385
+ return i(), m("div", {
1372
1386
  class: ue(["zxt-grid-container", { "zxt-grid-container--full": e.gridOptions.height === "full" }])
1373
1387
  }, [
1374
- e.gridOptions.formConfig && e.isFormVisible ? (s(), m("div", na, [
1375
- F(p, {
1388
+ e.gridOptions.formConfig && e.isFormVisible ? (i(), m("div", oa, [
1389
+ F(c, {
1376
1390
  ref: "searchFormRef",
1377
1391
  "form-columns": e.searchFormColumns,
1378
1392
  "initial-form-data": e.gridOptions.formConfig.data,
@@ -1381,8 +1395,8 @@ function sa(e, t, a, l, u, d) {
1381
1395
  onReset: e.handleSearchReset
1382
1396
  }, Y({
1383
1397
  "search-actions": w(() => [
1384
- b("div", oa, [
1385
- F(o, {
1398
+ y("div", la, [
1399
+ F(l, {
1386
1400
  class: "btn-search",
1387
1401
  icon: e.Search,
1388
1402
  onClick: e.handleSearch
@@ -1392,7 +1406,7 @@ function sa(e, t, a, l, u, d) {
1392
1406
  ])]),
1393
1407
  _: 1
1394
1408
  }, 8, ["icon", "onClick"]),
1395
- F(o, {
1409
+ F(l, {
1396
1410
  class: "btn-reset",
1397
1411
  icon: e.Refresh,
1398
1412
  onClick: e.handleReset
@@ -1406,34 +1420,34 @@ function sa(e, t, a, l, u, d) {
1406
1420
  ]),
1407
1421
  _: 2
1408
1422
  }, [
1409
- T(e.formFilteredSlots, (h, i) => ({
1410
- name: i,
1411
- fn: w((y) => [
1412
- O(e.$slots, i, Oe(Te(y)), void 0, !0)
1423
+ O(e.formFilteredSlots, (p, n) => ({
1424
+ name: n,
1425
+ fn: w((v) => [
1426
+ T(e.$slots, n, Oe(Me(v)), void 0, !0)
1413
1427
  ])
1414
1428
  }))
1415
1429
  ]), 1032, ["form-columns", "initial-form-data", "rules", "onSubmit", "onReset"])
1416
1430
  ])) : W("", !0),
1417
- b("div", la, [
1418
- e.gridOptions.toolbar ? (s(), m("div", ra, [
1419
- (s(!0), m(B, null, T(e.gridOptions.toolbar.buttons, (h, i) => (s(), V(o, {
1420
- key: i,
1421
- type: h.type || "default",
1422
- size: h.size || "small",
1423
- icon: e.getIconComponent(h.icon),
1424
- disabled: h.disabled,
1425
- onClick: (y) => e.handleToolbarClick(h.code, h)
1431
+ y("div", ra, [
1432
+ e.gridOptions.toolbar ? (i(), m("div", sa, [
1433
+ (i(!0), m(L, null, O(e.gridOptions.toolbar.buttons, (p, n) => (i(), V(l, {
1434
+ key: n,
1435
+ type: p.type || "default",
1436
+ size: p.size || "small",
1437
+ icon: e.getIconComponent(p.icon),
1438
+ disabled: p.disabled,
1439
+ onClick: (v) => e.handleToolbarClick(p.code, p)
1426
1440
  }, {
1427
1441
  default: w(() => [
1428
- j(ee(h.name), 1)
1442
+ j(ee(p.name), 1)
1429
1443
  ]),
1430
1444
  _: 2
1431
1445
  }, 1032, ["type", "size", "icon", "disabled", "onClick"]))), 128)),
1432
- O(e.$slots, "toolbar", {
1446
+ T(e.$slots, "toolbar", {
1433
1447
  grid: e.$refs.gridRef
1434
1448
  }, void 0, !0)
1435
1449
  ])) : W("", !0),
1436
- F(c, M({ ref: "gridRef" }, { ...e.tableProps, ...e.attrs }, {
1450
+ F(z, M({ ref: "gridRef" }, { ...e.tableProps, ...e.attrs }, {
1437
1451
  id: e.gridOptions.id,
1438
1452
  columns: e.mergedColumns,
1439
1453
  data: e.tableData,
@@ -1450,59 +1464,59 @@ function sa(e, t, a, l, u, d) {
1450
1464
  }), Y({ _: 2 }, [
1451
1465
  e.actionColumnConfig ? {
1452
1466
  name: "__action__",
1453
- fn: w(({ row: h }) => [
1467
+ fn: w(({ row: p }) => [
1454
1468
  F(g, {
1455
1469
  buttons: e.actionColumnConfig.buttons,
1456
- row: h,
1470
+ row: p,
1457
1471
  "max-visible": e.actionColumnConfig.maxVisible || 2,
1458
1472
  onActionClick: e.handleActionClick
1459
1473
  }, null, 8, ["buttons", "row", "max-visible", "onActionClick"])
1460
1474
  ]),
1461
1475
  key: "0"
1462
1476
  } : void 0,
1463
- T(e.tableFilteredSlots, (h, i) => ({
1464
- name: i,
1465
- fn: w((y) => [
1466
- O(e.$slots, i, Oe(Te(y)), void 0, !0)
1477
+ O(e.tableFilteredSlots, (p, n) => ({
1478
+ name: n,
1479
+ fn: w((v) => [
1480
+ T(e.$slots, n, Oe(Me(v)), void 0, !0)
1467
1481
  ])
1468
1482
  }))
1469
1483
  ]), 1040, ["id", "columns", "data", "height", "pageable", "current-page", "page-size", "page-sizes", "total", "pagination-layout", "onPageChange", "onSizeChange"])
1470
1484
  ])
1471
1485
  ], 2);
1472
1486
  }
1473
- const xe = /* @__PURE__ */ G(aa, [["render", sa], ["__scopeId", "data-v-f8b2d913"]]);
1487
+ const He = /* @__PURE__ */ G(na, [["render", ia], ["__scopeId", "data-v-d4ae9c2a"]]);
1474
1488
  Q.install = function(e) {
1475
1489
  e.component(Q.name, Q);
1476
1490
  };
1477
- const ia = [
1491
+ const ua = [
1478
1492
  te,
1479
1493
  ae,
1480
- L,
1481
- xe,
1494
+ B,
1495
+ He,
1482
1496
  Re,
1483
1497
  Q
1484
- ], ua = (e) => {
1485
- ia.forEach((t) => {
1498
+ ], da = (e) => {
1499
+ ua.forEach((t) => {
1486
1500
  e.component(t.name, t);
1487
1501
  });
1488
- }, pa = {
1489
- install: ua,
1502
+ }, fa = {
1503
+ install: da,
1490
1504
  MyButton: te,
1491
1505
  JsxButton: ae,
1492
- ZxtTable: L,
1493
- ZxtGrid: xe,
1506
+ ZxtTable: B,
1507
+ ZxtGrid: He,
1494
1508
  ZxtForm: Re,
1495
1509
  ZxtPagination: Q,
1496
1510
  // 暴露渲染器 API
1497
- renderer: L.renderer,
1498
- registerRenderer: L.registerRenderer
1511
+ renderer: B.renderer,
1512
+ registerRenderer: B.registerRenderer
1499
1513
  };
1500
1514
  export {
1501
1515
  ae as JsxButton,
1502
1516
  te as MyButton,
1503
1517
  Re as ZxtForm,
1504
- xe as ZxtGrid,
1518
+ He as ZxtGrid,
1505
1519
  Q as ZxtPagination,
1506
- L as ZxtTable,
1507
- pa as default
1520
+ B as ZxtTable,
1521
+ fa as default
1508
1522
  };