vue3-smart-table 2.1.1 → 2.1.3

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,16 +1,16 @@
1
- var pe = Object.defineProperty;
2
- var fe = (t, e, r) => e in t ? pe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var j = (t, e, r) => fe(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { ref as O, watch as N, computed as E, defineComponent as z, h as b, resolveComponent as T, createBlock as B, openBlock as w, mergeProps as S, withKeys as G, withCtx as $, createElementBlock as A, Fragment as I, renderList as J, resolveDirective as de, withDirectives as me, createTextVNode as ne, toDisplayString as P, renderSlot as ge, createCommentVNode as ye, resolveDynamicComponent as he, unref as oe, normalizeClass as Ce, normalizeStyle as be } from "vue";
5
- import { ElImage as U, ElTag as ve, ElMessage as R, ElButton as we } from "element-plus";
6
- import { CopyDocument as ke, DocumentCopy as _e } from "@element-plus/icons-vue";
7
- function se(t) {
1
+ var fe = Object.defineProperty;
2
+ var de = (t, e, r) => e in t ? fe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var j = (t, e, r) => de(t, typeof e != "symbol" ? e + "" : e, r);
4
+ import { ref as O, watch as N, computed as E, defineComponent as R, h as b, resolveComponent as T, createBlock as B, openBlock as w, mergeProps as S, withKeys as G, withCtx as $, createElementBlock as A, Fragment as I, renderList as J, resolveDirective as me, withDirectives as ye, createTextVNode as ne, toDisplayString as P, renderSlot as ge, createCommentVNode as he, resolveDynamicComponent as Ce, unref as oe, normalizeClass as be, normalizeStyle as ve } from "vue";
5
+ import { ElImage as U, ElTag as we, ElMessage as z, ElButton as ke } from "element-plus";
6
+ import { CopyDocument as _e, DocumentCopy as xe } from "@element-plus/icons-vue";
7
+ function ie(t) {
8
8
  return t === "selection" || t === "index" || t === "operation";
9
9
  }
10
- function Xe(t) {
11
- return t ? !se(t) : !1;
10
+ function Ze(t) {
11
+ return t ? !ie(t) : !1;
12
12
  }
13
- function xe(t) {
13
+ function Be(t) {
14
14
  return t.type === "operation";
15
15
  }
16
16
  function re(t, e) {
@@ -26,7 +26,7 @@ function re(t, e) {
26
26
  } : l;
27
27
  });
28
28
  }
29
- function Be(t, e) {
29
+ function Ee(t, e) {
30
30
  const { cacheKey: r, storage: l = localStorage } = e || {}, a = r ? l.getItem(r) : null, p = O(
31
31
  re(
32
32
  t,
@@ -37,14 +37,14 @@ function Be(t, e) {
37
37
  p,
38
38
  (u) => {
39
39
  if (!r) return;
40
- const y = u.map((d) => ({
40
+ const g = u.map((d) => ({
41
41
  key: d.key,
42
42
  visible: d.visible,
43
43
  columnOpts: d.columnOpts
44
44
  }));
45
45
  l.setItem(
46
46
  r,
47
- JSON.stringify(y)
47
+ JSON.stringify(g)
48
48
  );
49
49
  },
50
50
  { deep: !0 }
@@ -72,34 +72,34 @@ function Be(t, e) {
72
72
  }
73
73
  };
74
74
  }
75
- function Ee(t, e = 10, r = []) {
75
+ function Se(t, e = 10, r = []) {
76
76
  const a = "*:*:*", p = (o) => {
77
77
  if (!o) return !0;
78
78
  const f = Array.isArray(o) ? o : [o];
79
79
  return r.some(
80
80
  (h) => h === a || f.includes(h)
81
81
  );
82
- }, u = E(() => t.some((o) => p(o.permission))), y = E(() => t.filter((f) => p(f.permission)).slice(0, e).reduce(
82
+ }, u = E(() => t.some((o) => p(o.permission))), g = E(() => t.filter((f) => p(f.permission)).slice(0, e).reduce(
83
83
  (f, h) => f + (h.width ?? 55),
84
84
  0
85
- )), d = (o, f) => p(o.permission) && (o.visible ? o.visible(f) : !0), g = (o) => t.filter((h) => d(h, o)).slice(0, e).reduce(
85
+ )), d = (o, f) => p(o.permission) && (o.visible ? o.visible(f) : !0), y = (o) => t.filter((h) => d(h, o)).slice(0, e).reduce(
86
86
  (h, M) => h + (M.width ?? 55),
87
87
  0
88
88
  );
89
89
  return {
90
90
  hasAnyButton: u,
91
- optWidth: y,
91
+ optWidth: g,
92
92
  hasAnyVisibleButton: (o) => o != null && o.length ? o.some(
93
93
  (f) => t.some((h) => d(h, f))
94
94
  ) : !1,
95
95
  getMaxOptWidth: (o) => o != null && o.length ? o.reduce(
96
- (f, h) => Math.max(f, g(h)),
96
+ (f, h) => Math.max(f, y(h)),
97
97
  0
98
- ) : y.value,
98
+ ) : g.value,
99
99
  getVisibleButtons: (o) => t.filter((f) => d(f, o)).slice(0, e)
100
100
  };
101
101
  }
102
- class Se {
102
+ class Ve {
103
103
  constructor() {
104
104
  j(this, "renderers", /* @__PURE__ */ new Map());
105
105
  }
@@ -129,10 +129,10 @@ class Se {
129
129
  }
130
130
  let q = null;
131
131
  function Y() {
132
- return q || (q = new Se()), q;
132
+ return q || (q = new Ve()), q;
133
133
  }
134
134
  function Q(t) {
135
- return z({
135
+ return R({
136
136
  props: ["row", "col", "index", "onCellChange", "onCellBlur", "onCellEnter", "onClick"],
137
137
  setup(e) {
138
138
  return () => b(t, e);
@@ -140,14 +140,14 @@ function Q(t) {
140
140
  });
141
141
  }
142
142
  function V(t) {
143
- return z({
143
+ return R({
144
144
  props: ["row", "col", "index", "onCellChange", "onCellBlur", "onCellEnter", "onClick"],
145
145
  setup(e) {
146
146
  return () => t(e);
147
147
  }
148
148
  });
149
149
  }
150
- function Ze(t, e) {
150
+ function et(t, e) {
151
151
  if (process.env.NODE_ENV !== "production" && e)
152
152
  switch (t) {
153
153
  case "dict":
@@ -187,10 +187,10 @@ function k(t, e) {
187
187
  }
188
188
  function X(t, e, r) {
189
189
  if (!t || !e) return;
190
- const l = e.split("."), a = l.pop(), p = l.reduce((u, y) => (u[y] || (u[y] = {}), u[y]), t);
190
+ const l = e.split("."), a = l.pop(), p = l.reduce((u, g) => (u[g] || (u[g] = {}), u[g]), t);
191
191
  p[a] = r;
192
192
  }
193
- const Ve = /* @__PURE__ */ z({
193
+ const Fe = /* @__PURE__ */ R({
194
194
  __name: "input",
195
195
  props: {
196
196
  row: {},
@@ -222,13 +222,13 @@ const Ve = /* @__PURE__ */ z({
222
222
  }, u = (i) => {
223
223
  var n, s;
224
224
  (s = (n = e.col.props) == null ? void 0 : n.onFocus) == null || s.call(n, i, e.row, e.col);
225
- }, y = (i) => {
225
+ }, g = (i) => {
226
226
  var n, s;
227
227
  (s = (n = e.col.props) == null ? void 0 : n.onInput) == null || s.call(n, i, e.row, e.col);
228
228
  }, d = (i) => {
229
229
  var n, s, o;
230
230
  (n = e.onCellEnter) == null || n.call(e, e.row, e.col), (o = (s = e.col.props) == null ? void 0 : s.onEnter) == null || o.call(s, i, e.row, e.col);
231
- }, g = () => {
231
+ }, y = () => {
232
232
  var i, n;
233
233
  (n = (i = e.col.props) == null ? void 0 : i.onClear) == null || n.call(i, e.row, e.col);
234
234
  };
@@ -241,13 +241,13 @@ const Ve = /* @__PURE__ */ z({
241
241
  onBlur: p,
242
242
  onFocus: u,
243
243
  onChange: a,
244
- onInput: y,
244
+ onInput: g,
245
245
  onKeyup: G(d, ["enter"]),
246
- onClear: g
246
+ onClear: y
247
247
  }), null, 16, ["modelValue"]);
248
248
  };
249
249
  }
250
- }), Fe = /* @__PURE__ */ z({
250
+ }), Te = /* @__PURE__ */ R({
251
251
  __name: "inputNumber",
252
252
  props: {
253
253
  row: {},
@@ -259,7 +259,7 @@ const Ve = /* @__PURE__ */ z({
259
259
  },
260
260
  setup(t) {
261
261
  const e = t, r = O(k(e.row, e.col.key)), l = E(() => {
262
- const d = e.col.props || {}, { onBlur: g, onFocus: i, onChange: n, onEnter: s, ...o } = d;
262
+ const d = e.col.props || {}, { onBlur: y, onFocus: i, onChange: n, onEnter: s, ...o } = d;
263
263
  return {
264
264
  min: 0,
265
265
  max: 99999,
@@ -271,33 +271,33 @@ const Ve = /* @__PURE__ */ z({
271
271
  N(r, (d) => {
272
272
  X(e.row, e.col.key, d);
273
273
  });
274
- const a = (d, g) => {
274
+ const a = (d, y) => {
275
275
  var i, n, s;
276
- (i = e.onCellChange) == null || i.call(e, e.row, e.col), (s = (n = e.col.props) == null ? void 0 : n.onChange) == null || s.call(n, d, g, e.row, e.col);
276
+ (i = e.onCellChange) == null || i.call(e, e.row, e.col), (s = (n = e.col.props) == null ? void 0 : n.onChange) == null || s.call(n, d, y, e.row, e.col);
277
277
  }, p = (d) => {
278
- var g, i, n;
279
- (g = e.onCellBlur) == null || g.call(e, e.row, e.col), (n = (i = e.col.props) == null ? void 0 : i.onBlur) == null || n.call(i, d, e.row, e.col);
278
+ var y, i, n;
279
+ (y = e.onCellBlur) == null || y.call(e, e.row, e.col), (n = (i = e.col.props) == null ? void 0 : i.onBlur) == null || n.call(i, d, e.row, e.col);
280
280
  }, u = (d) => {
281
- var g, i;
282
- (i = (g = e.col.props) == null ? void 0 : g.onFocus) == null || i.call(g, d, e.row, e.col);
283
- }, y = (d) => {
284
- var g, i, n;
285
- (g = e.onCellEnter) == null || g.call(e, e.row, e.col), (n = (i = e.col.props) == null ? void 0 : i.onEnter) == null || n.call(i, d, e.row, e.col);
281
+ var y, i;
282
+ (i = (y = e.col.props) == null ? void 0 : y.onFocus) == null || i.call(y, d, e.row, e.col);
283
+ }, g = (d) => {
284
+ var y, i, n;
285
+ (y = e.onCellEnter) == null || y.call(e, e.row, e.col), (n = (i = e.col.props) == null ? void 0 : i.onEnter) == null || n.call(i, d, e.row, e.col);
286
286
  };
287
- return (d, g) => {
287
+ return (d, y) => {
288
288
  const i = T("el-input-number");
289
289
  return w(), B(i, S({
290
290
  modelValue: r.value,
291
- "onUpdate:modelValue": g[0] || (g[0] = (n) => r.value = n)
291
+ "onUpdate:modelValue": y[0] || (y[0] = (n) => r.value = n)
292
292
  }, l.value, {
293
293
  onBlur: p,
294
294
  onFocus: u,
295
295
  onChange: a,
296
- onKeyup: G(y, ["enter"])
296
+ onKeyup: G(g, ["enter"])
297
297
  }), null, 16, ["modelValue"]);
298
298
  };
299
299
  }
300
- }), Te = /* @__PURE__ */ z({
300
+ }), Me = /* @__PURE__ */ R({
301
301
  __name: "select",
302
302
  props: {
303
303
  row: {},
@@ -326,13 +326,13 @@ const Ve = /* @__PURE__ */ z({
326
326
  }, u = (n) => {
327
327
  var s, o, f;
328
328
  (s = e.onCellBlur) == null || s.call(e, e.row, e.col), (f = (o = e.col.props) == null ? void 0 : o.onBlur) == null || f.call(o, n, e.row, e.col);
329
- }, y = (n) => {
329
+ }, g = (n) => {
330
330
  var s, o;
331
331
  (o = (s = e.col.props) == null ? void 0 : s.onFocus) == null || o.call(s, n, e.row, e.col);
332
332
  }, d = (n) => {
333
333
  var s, o;
334
334
  (o = (s = e.col.props) == null ? void 0 : s.onVisibleChange) == null || o.call(s, n, e.row, e.col);
335
- }, g = () => {
335
+ }, y = () => {
336
336
  var n, s;
337
337
  (s = (n = e.col.props) == null ? void 0 : n.onClear) == null || s.call(n, e.row, e.col);
338
338
  }, i = (n) => {
@@ -347,9 +347,9 @@ const Ve = /* @__PURE__ */ z({
347
347
  }, l.value, {
348
348
  onChange: p,
349
349
  onBlur: u,
350
- onFocus: y,
350
+ onFocus: g,
351
351
  onVisibleChange: d,
352
- onClear: g,
352
+ onClear: y,
353
353
  onKeyup: G(i, ["enter"])
354
354
  }), {
355
355
  default: $(() => [
@@ -364,23 +364,23 @@ const Ve = /* @__PURE__ */ z({
364
364
  }, 16, ["modelValue"]);
365
365
  };
366
366
  }
367
- }), Me = Q(Ve), $e = Q(Fe), Ae = Q(Te), Oe = (t) => {
367
+ }), $e = Q(Fe), Ae = Q(Te), Oe = Q(Me), le = (t, e) => t == null || t === "" ? e : typeof t == "number" ? t + "px" : t, Re = (t) => {
368
368
  const e = {}, r = {};
369
369
  return Object.keys(t).forEach((l) => {
370
370
  l.startsWith("on") && typeof t[l] == "function" ? e[l] = t[l] : r[l] = t[l];
371
371
  }), { events: e, props: r };
372
372
  }, ze = V((t) => {
373
- const e = t.col.props || {}, r = k(t.row, t.col.key), { events: l, props: a } = Oe(e);
374
- return b(we, {
373
+ const e = t.col.props || {}, r = k(t.row, t.col.key), { events: l, props: a } = Re(e);
374
+ return b(ke, {
375
375
  type: "primary",
376
376
  ...a,
377
377
  ...l,
378
378
  onClick: (p) => {
379
- var u, y;
380
- (u = t.onClick) == null || u.call(t, t.row, t.col), (y = e.onClick) == null || y.call(e, p, t.row, t.col);
379
+ var u, g;
380
+ (u = t.onClick) == null || u.call(t, t.row, t.col), (g = e.onClick) == null || g.call(e, p, t.row, t.col);
381
381
  }
382
382
  }, () => e.label || r);
383
- }), Re = V((t) => {
383
+ }), Ie = V((t) => {
384
384
  const e = t.col.props || {}, r = k(t.row, t.col.key), { href: l, blank: a, label: p, ...u } = e;
385
385
  return b("a", {
386
386
  href: l || r || "#",
@@ -389,7 +389,7 @@ const Ve = /* @__PURE__ */ z({
389
389
  style: "color:#409EFF;cursor:pointer;text-decoration:none;",
390
390
  ...u
391
391
  }, p || r);
392
- }), Ie = V((t) => {
392
+ }), Ne = V((t) => {
393
393
  var u;
394
394
  const e = k(t.row, t.col.key), r = ((u = t.col) == null ? void 0 : u.props) || {}, { style: l, class: a, ...p } = r;
395
395
  return b("div", {
@@ -398,8 +398,8 @@ const Ve = /* @__PURE__ */ z({
398
398
  innerHTML: e ?? "",
399
399
  ...p
400
400
  });
401
- }), Ne = V((t) => {
402
- const e = k(t.row, t.col.key) ?? "", r = t.col.props ?? {}, { iconColor: l, copyTitle: a, successText: p, errorText: u, lineClamp: y, textStyles: d, textClass: g, ...i } = r, n = {
401
+ }), Ke = V((t) => {
402
+ const e = k(t.row, t.col.key) ?? "", r = t.col.props ?? {}, { iconColor: l, copyTitle: a, successText: p, errorText: u, lineClamp: g, textStyles: d, textClass: y, ...i } = r, n = {
403
403
  position: "absolute",
404
404
  right: "-5px",
405
405
  top: "50%",
@@ -413,7 +413,7 @@ const Ve = /* @__PURE__ */ z({
413
413
  "padding-right": "10px",
414
414
  display: "-webkit-box",
415
415
  "-webkit-box-orient": "vertical",
416
- "-webkit-line-clamp": y ?? 2,
416
+ "-webkit-line-clamp": g ?? 2,
417
417
  overflow: "hidden",
418
418
  ...d
419
419
  };
@@ -426,7 +426,7 @@ const Ve = /* @__PURE__ */ z({
426
426
  },
427
427
  [
428
428
  b("span", {
429
- class: `st_copy_text ${g ?? ""}`,
429
+ class: `st_copy_text ${y ?? ""}`,
430
430
  style: s,
431
431
  title: e
432
432
  }, e),
@@ -439,33 +439,33 @@ const Ve = /* @__PURE__ */ z({
439
439
  try {
440
440
  if (navigator.clipboard && navigator.clipboard.writeText)
441
441
  navigator.clipboard.writeText(e).then(() => {
442
- R.success(p ?? "复制成功");
442
+ z.success(p ?? "复制成功");
443
443
  }).catch(() => {
444
- R.error(u ?? "复制失败");
444
+ z.error(u ?? "复制失败");
445
445
  });
446
446
  else {
447
447
  const o = document.createElement("textarea");
448
448
  o.value = e, o.style.position = "fixed", o.style.opacity = "0", document.body.appendChild(o), o.select();
449
449
  const f = document.execCommand("copy");
450
- document.body.removeChild(o), f ? R.success(p ?? "复制成功") : R.error(u ?? "复制失败");
450
+ document.body.removeChild(o), f ? z.success(p ?? "复制成功") : z.error(u ?? "复制失败");
451
451
  }
452
452
  } catch {
453
- R.error(u ?? "复制失败");
453
+ z.error(u ?? "复制失败");
454
454
  }
455
455
  }
456
- }, [b(_e, {
456
+ }, [b(xe, {
457
457
  style: "width: 1em; height: 1em;"
458
458
  })])
459
459
  ].filter(Boolean)
460
460
  );
461
- }), Ke = V((t) => {
461
+ }), We = V((t) => {
462
462
  var f;
463
- const e = k(t.row, t.col.key) ?? "", r = ((f = t.col) == null ? void 0 : f.props) || {}, { width: l, height: a, fit: p, previewSrcList: u, placeholder: y, style: d, ...g } = r, n = e ? Array.isArray(e) ? e.filter((h) => h && typeof h == "string") : [e] : [];
463
+ const e = k(t.row, t.col.key) ?? "", r = ((f = t.col) == null ? void 0 : f.props) || {}, { width: l, height: a, fit: p, previewSrcList: u, placeholder: g, style: d, ...y } = r, n = e ? Array.isArray(e) ? e.filter((h) => h && typeof h == "string") : [e] : [];
464
464
  if (n.length === 0)
465
- return y || "";
465
+ return g || "";
466
466
  const s = {
467
- width: l || "80px",
468
- height: a || "80px",
467
+ width: le(l, "80px"),
468
+ height: le(a, "80px"),
469
469
  marginRight: n.length > 1 ? "4px" : "0",
470
470
  ...typeof d == "object" ? d : {}
471
471
  }, o = {
@@ -473,7 +473,7 @@ const Ve = /* @__PURE__ */ z({
473
473
  previewTeleported: !0,
474
474
  fit: p || "contain",
475
475
  style: s,
476
- ...g
476
+ ...y
477
477
  };
478
478
  return n.length === 1 ? b(U, {
479
479
  src: n[0],
@@ -493,16 +493,16 @@ const Ve = /* @__PURE__ */ z({
493
493
  class: "st_img_total",
494
494
  style: "position: absolute; top: 0; right: 0; ",
495
495
  title: `${n.length}`
496
- }, [b(ke, { style: "width: 1em; height: 1em; " })])
496
+ }, [b(_e, { style: "width: 1em; height: 1em; " })])
497
497
  ]
498
498
  );
499
- }), We = V((t) => {
499
+ }), je = V((t) => {
500
500
  const e = k(t.row, t.col.key) ?? "", r = t.col.props || {}, { options: l = [], showValue: a = !1, ...p } = r;
501
501
  if (e == null || e === "") return "";
502
- const u = Array.isArray(e) ? e.map(String) : [String(e)], y = l.filter((i) => u.includes(String(i.value))), d = u.filter((i) => !l.some((n) => String(n.value) === i)), g = y.map((i) => {
502
+ const u = Array.isArray(e) ? e.map(String) : [String(e)], g = l.filter((i) => u.includes(String(i.value))), d = u.filter((i) => !l.some((n) => String(n.value) === i)), y = g.map((i) => {
503
503
  const { listClass: n, cssClass: s, tagProps: o, ...f } = i;
504
504
  return b(
505
- ve,
505
+ we,
506
506
  {
507
507
  key: i.value,
508
508
  type: n,
@@ -514,23 +514,23 @@ const Ve = /* @__PURE__ */ z({
514
514
  { default: () => i.label + " " }
515
515
  );
516
516
  });
517
- return a && d.length > 0 && g.push(b("span", {}, d.join(" "))), b("div", { style: "display: inline-flex; gap: 4px; flex-wrap: wrap;" }, g);
518
- }), je = V((t) => {
517
+ return a && d.length > 0 && y.push(b("span", {}, d.join(" "))), b("div", { style: "display: inline-flex; gap: 4px; flex-wrap: wrap;" }, y);
518
+ }), De = V((t) => {
519
519
  const e = k(t.row, t.col.key) ?? "", r = t.col.props || {}, { options: l = {}, ...a } = r, p = e != null ? l[e] ?? "" : "";
520
520
  return b("span", { ...a }, p);
521
521
  });
522
- function De(t) {
522
+ function Le(t) {
523
523
  return typeof t.formatter == "function";
524
524
  }
525
- const Le = V((t) => {
526
- var y;
525
+ const Pe = V((t) => {
526
+ var g;
527
527
  const { col: e, row: r, index: l } = t, a = k(t.row, t.col.key) ?? "", p = t.col.props || {};
528
528
  let u = a;
529
- return De(e) && (u = ((y = e.formatter) == null ? void 0 : y.call(e, a, r, l)) ?? a), b("span", { ...p }, u);
530
- }), Pe = V((t) => {
529
+ return Le(e) && (u = ((g = e.formatter) == null ? void 0 : g.call(e, a, r, l)) ?? a), b("span", { ...p }, u);
530
+ }), qe = V((t) => {
531
531
  const e = k(t.row, t.col.key) ?? "", r = t.col.props || {}, { style: l, size: a, class: p, ...u } = r;
532
532
  if (!e) return "";
533
- const y = a ? `${a}px` : "20px";
533
+ const g = a ? `${a}px` : "20px";
534
534
  return /^https?:\/\//.test(e) ? b(U, {
535
535
  src: e,
536
536
  previewSrcList: [e],
@@ -551,32 +551,32 @@ const Le = V((t) => {
551
551
  }) : b("i", {
552
552
  class: [e, p].filter(Boolean).join(" "),
553
553
  style: {
554
- fontSize: y,
554
+ fontSize: g,
555
555
  ...typeof l == "object" ? l : {}
556
556
  },
557
557
  ...u
558
558
  });
559
- }), ie = {
560
- input: Me,
561
- "input-number": $e,
562
- select: Ae,
559
+ }), ae = {
560
+ input: $e,
561
+ "input-number": Ae,
562
+ select: Oe,
563
563
  button: ze,
564
- link: Re,
565
- html: Ie,
566
- copy: Ne,
567
- img: Ke,
568
- dict: We,
569
- map: je,
570
- formatter: Le,
571
- icon: Pe
564
+ link: Ie,
565
+ html: Ne,
566
+ copy: Ke,
567
+ img: We,
568
+ dict: je,
569
+ map: De,
570
+ formatter: Pe,
571
+ icon: qe
572
572
  };
573
- function qe(t) {
574
- t.registerMultiple(ie);
573
+ function He(t) {
574
+ t.registerMultiple(ae);
575
575
  }
576
- function et() {
577
- return ie;
576
+ function tt() {
577
+ return ae;
578
578
  }
579
- const le = {
579
+ const se = {
580
580
  defaultPagination: {
581
581
  page: 1,
582
582
  size: 10,
@@ -585,9 +585,9 @@ const le = {
585
585
  defaultTableProps: {},
586
586
  defaultColumnProps: {}
587
587
  };
588
- class He {
588
+ class Je {
589
589
  constructor() {
590
- j(this, "config", { ...le });
590
+ j(this, "config", { ...se });
591
591
  j(this, "_initialized", !1);
592
592
  }
593
593
  /**
@@ -600,7 +600,7 @@ class He {
600
600
  * 初始化(注册内置渲染器)
601
601
  */
602
602
  init() {
603
- this._initialized || (qe(Y()), this._initialized = !0);
603
+ this._initialized || (He(Y()), this._initialized = !0);
604
604
  }
605
605
  /**
606
606
  * 获取所有配置
@@ -624,7 +624,7 @@ class He {
624
624
  * 重置为默认配置
625
625
  */
626
626
  reset() {
627
- this.config = { ...le };
627
+ this.config = { ...se };
628
628
  }
629
629
  /**
630
630
  * 深度合并配置
@@ -638,15 +638,15 @@ class He {
638
638
  }
639
639
  let H = null;
640
640
  function Z() {
641
- return H || (H = new He()), H;
641
+ return H || (H = new Je()), H;
642
642
  }
643
- function tt(t) {
643
+ function nt(t) {
644
644
  Z().setConfig(t);
645
645
  }
646
- function nt() {
646
+ function ot() {
647
647
  return Z().getConfig();
648
648
  }
649
- const Je = ["title"], ot = /* @__PURE__ */ z({
649
+ const Ue = ["title"], rt = /* @__PURE__ */ R({
650
650
  __name: "index",
651
651
  props: {
652
652
  data: { default: () => [] },
@@ -661,7 +661,7 @@ const Je = ["title"], ot = /* @__PURE__ */ z({
661
661
  setup(t, { expose: e, emit: r }) {
662
662
  const l = t, a = r;
663
663
  Z().init();
664
- const { columns: p } = Be(l.columns, {
664
+ const { columns: p } = Ee(l.columns, {
665
665
  cacheKey: l.cacheKey ?? ""
666
666
  }), u = O(!1);
667
667
  N(
@@ -671,32 +671,32 @@ const Je = ["title"], ot = /* @__PURE__ */ z({
671
671
  },
672
672
  { deep: !0, immediate: !0 }
673
673
  );
674
- const y = E(
674
+ const g = E(
675
675
  () => p.value.filter((c) => c.type === "operation")
676
676
  ), d = E(() => {
677
677
  const c = /* @__PURE__ */ new Map();
678
- return y.value.forEach((m) => {
679
- const v = Ee(
678
+ return g.value.forEach((m) => {
679
+ const v = Se(
680
680
  m.buttons || [],
681
681
  m.maxbtn ?? 10,
682
682
  l.permissions || []
683
683
  );
684
684
  c.set(m.key, v);
685
685
  }), c;
686
- }), g = (c) => d.value.get(c.key), i = (c) => {
686
+ }), y = (c) => d.value.get(c.key), i = (c) => {
687
687
  var _;
688
- if (!xe(c)) return !1;
689
- const m = g(c);
688
+ if (!Be(c)) return !1;
689
+ const m = y(c);
690
690
  return !m || !(c.buttons || []).length ? !1 : (_ = l.data) != null && _.length ? m.hasAnyVisibleButton(l.data) : m.hasAnyButton.value;
691
691
  }, n = (c) => {
692
692
  var v;
693
- const m = g(c);
693
+ const m = y(c);
694
694
  return m ? (v = l.data) != null && v.length ? m.getMaxOptWidth(l.data) : m.optWidth.value : 0;
695
695
  }, s = (c, m) => {
696
- const v = g(c);
696
+ const v = y(c);
697
697
  return v ? (c.buttons || []).length ? v.getVisibleButtons(m) : [] : [];
698
698
  }, o = E(
699
- () => p.value.filter((c) => c.type === "operation" ? i(c) : se(c.type) ? !0 : c.visible !== !1)
699
+ () => p.value.filter((c) => c.type === "operation" ? i(c) : ie(c.type) ? !0 : c.visible !== !1)
700
700
  ), f = (c, m) => c.type === "selection" ? `selection-${m}` : c.type === "index" ? `index-${m}` : c.type === "operation" ? `operation-${c.key}-${m}` : `${c.key}-${m}`, h = (c) => {
701
701
  var _, W;
702
702
  const m = (_ = l.pagination) == null ? void 0 : _.page, v = (W = l.pagination) == null ? void 0 : W.size;
@@ -713,14 +713,14 @@ const Je = ["title"], ot = /* @__PURE__ */ z({
713
713
  a("cellBlur", c, m);
714
714
  }, D = (c, m) => {
715
715
  a("cellEnter", c, m);
716
- }, ae = (c, m) => {
716
+ }, ce = (c, m) => {
717
717
  m && a("cellClick", c, m);
718
718
  }, te = O();
719
719
  return e({
720
720
  tableRef: te
721
721
  }), (c, m) => {
722
- const v = T("el-table-column"), _ = T("el-button"), W = T("el-table"), ce = de("loading");
723
- return me((w(), B(W, S({
722
+ const v = T("el-table-column"), _ = T("el-button"), W = T("el-table"), ue = me("loading");
723
+ return ye((w(), B(W, S({
724
724
  ref_key: "tableRef",
725
725
  ref: te
726
726
  }, c.$attrs, {
@@ -729,8 +729,8 @@ const Je = ["title"], ot = /* @__PURE__ */ z({
729
729
  class: "smart_table"
730
730
  }), {
731
731
  default: $(() => [
732
- (w(!0), A(I, null, J(o.value, (C, ue) => (w(), A(I, {
733
- key: f(C, ue)
732
+ (w(!0), A(I, null, J(o.value, (C, pe) => (w(), A(I, {
733
+ key: f(C, pe)
734
734
  }, [
735
735
  C.type === "selection" ? (w(), B(v, S({
736
736
  key: 0,
@@ -769,6 +769,7 @@ const Je = ["title"], ot = /* @__PURE__ */ z({
769
769
  _: 2
770
770
  }, 1040, ["label"])) : (w(), B(v, S({
771
771
  key: 3,
772
+ prop: C.key,
772
773
  label: C.label,
773
774
  align: "center"
774
775
  }, { ref_for: !0 }, C.columnProps || {}), {
@@ -779,8 +780,8 @@ const Je = ["title"], ot = /* @__PURE__ */ z({
779
780
  x.$index >= 0 ? ge(c.$slots, C.slot || C.key, S({
780
781
  key: 0,
781
782
  ref_for: !0
782
- }, x)) : ye("", !0)
783
- ], 64)) : C.type && M.value[C.type] ? (w(), B(he(M.value[C.type]), {
783
+ }, x)) : he("", !0)
784
+ ], 64)) : C.type && M.value[C.type] ? (w(), B(Ce(M.value[C.type]), {
784
785
  key: 1,
785
786
  row: x.row,
786
787
  col: C,
@@ -788,47 +789,47 @@ const Je = ["title"], ot = /* @__PURE__ */ z({
788
789
  onCellChange: K,
789
790
  onCellBlur: ee,
790
791
  onCellEnter: D,
791
- onClick: ae
792
+ onClick: ce
792
793
  }, null, 40, ["row", "col", "index"])) : (w(), A("span", {
793
794
  key: 2,
794
- style: be(((F = C.props) == null ? void 0 : F.style) || ""),
795
- class: Ce(((L = C.props) == null ? void 0 : L.class) || ""),
795
+ style: ve(((F = C.props) == null ? void 0 : F.style) || ""),
796
+ class: be(((L = C.props) == null ? void 0 : L.class) || ""),
796
797
  title: oe(k)(x.row, C.key)
797
- }, P(oe(k)(x.row, C.key)), 15, Je))
798
+ }, P(oe(k)(x.row, C.key)), 15, Ue))
798
799
  ];
799
800
  }),
800
801
  _: 2
801
- }, 1040, ["label"]))
802
+ }, 1040, ["prop", "label"]))
802
803
  ], 64))), 128))
803
804
  ]),
804
805
  _: 3
805
806
  }, 16, ["data", "row-key"])), [
806
- [ce, t.loading]
807
+ [ue, t.loading]
807
808
  ]);
808
809
  };
809
810
  }
810
811
  });
811
- function rt(t, e) {
812
+ function lt(t, e) {
812
813
  return {
813
814
  key: t,
814
815
  ...e
815
816
  };
816
817
  }
817
818
  export {
818
- ot as SmartTable,
819
- ie as builtInRenderers,
819
+ rt as SmartTable,
820
+ ae as builtInRenderers,
820
821
  V as createFunctionalRenderer,
821
- et as createRenderer,
822
- ot as default,
823
- rt as defineColumn,
822
+ tt as createRenderer,
823
+ rt as default,
824
+ lt as defineColumn,
824
825
  Y as getRendererManager,
825
- nt as getSmartTableConfig,
826
- xe as isOperationColumn,
827
- Xe as isRendererType,
828
- se as isSpecialColumn,
829
- qe as registerBuiltInRenderers,
830
- tt as setSmartTableConfig,
831
- Ze as validateRendererProps,
826
+ ot as getSmartTableConfig,
827
+ Be as isOperationColumn,
828
+ Ze as isRendererType,
829
+ ie as isSpecialColumn,
830
+ He as registerBuiltInRenderers,
831
+ nt as setSmartTableConfig,
832
+ et as validateRendererProps,
832
833
  Q as wrapSFCComponent
833
834
  };
834
835
  //# sourceMappingURL=vue3-smart-table.es.js.map