@mtn-ui/components 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/antd-wrapped/action-group/action-group.vue.js +2 -2
  2. package/dist/antd-wrapped/action-group/action-group.vue2.js +244 -213
  3. package/dist/components.css +1 -1
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.mjs +431 -400
  6. package/dist/types/index.d.ts +18 -0
  7. package/dist/types/packages/components/src/_utils/__tests__/filterMenuByPermission.test.d.ts +1 -0
  8. package/dist/types/packages/components/src/_utils/__tests__/usePermission.test.d.ts +1 -0
  9. package/dist/types/packages/components/src/_utils/constants.d.ts +7 -0
  10. package/dist/types/packages/components/src/_utils/filterMenuByPermission.d.ts +14 -0
  11. package/dist/types/packages/components/src/_utils/index.d.ts +7 -0
  12. package/dist/types/packages/components/src/_utils/types.d.ts +7 -0
  13. package/dist/types/packages/components/src/_utils/usePermission.d.ts +29 -0
  14. package/dist/types/packages/components/src/antd-wrapped/action-group/__tests__/action-group.test.d.ts +1 -0
  15. package/dist/types/packages/components/src/antd-wrapped/action-group/index.d.ts +4 -0
  16. package/dist/types/packages/components/src/antd-wrapped/action-group/props.d.ts +91 -0
  17. package/dist/types/packages/components/src/antd-wrapped/action-group/types.d.ts +110 -0
  18. package/dist/types/packages/components/src/antd-wrapped/action-group/utils.d.ts +17 -0
  19. package/dist/types/packages/components/src/antd-wrapped/button/__tests__/button.test.d.ts +1 -0
  20. package/dist/types/packages/components/src/antd-wrapped/button/button.d.ts +112 -0
  21. package/dist/types/packages/components/src/antd-wrapped/button/index.d.ts +5 -0
  22. package/dist/types/packages/components/src/antd-wrapped/button/props.d.ts +55 -0
  23. package/dist/types/packages/components/src/antd-wrapped/button/types.d.ts +38 -0
  24. package/dist/types/packages/components/src/antd-wrapped/button-group/button-group.d.ts +50 -0
  25. package/dist/types/packages/components/src/antd-wrapped/button-group/index.d.ts +5 -0
  26. package/dist/types/packages/components/src/antd-wrapped/button-group/props.d.ts +28 -0
  27. package/dist/types/packages/components/src/antd-wrapped/delete-button/__tests__/delete-button.test.d.ts +1 -0
  28. package/dist/types/packages/components/src/antd-wrapped/delete-button/index.d.ts +2 -0
  29. package/dist/types/packages/components/src/antd-wrapped/delete-button/props.d.ts +122 -0
  30. package/dist/types/packages/components/src/antd-wrapped/dropdown-button/__tests__/dropdown-button.test.d.ts +1 -0
  31. package/dist/types/packages/components/src/antd-wrapped/dropdown-button/dropdown-button.d.ts +106 -0
  32. package/dist/types/packages/components/src/antd-wrapped/dropdown-button/index.d.ts +5 -0
  33. package/dist/types/packages/components/src/antd-wrapped/dropdown-button/props.d.ts +49 -0
  34. package/dist/types/packages/components/src/antd-wrapped/dropdown-button/types.d.ts +36 -0
  35. package/dist/types/packages/components/src/antd-wrapped/index.d.ts +10 -0
  36. package/dist/types/packages/components/src/antd-wrapped/table/index.d.ts +4 -0
  37. package/dist/types/packages/components/src/antd-wrapped/table/table.d.ts +128 -0
  38. package/dist/types/packages/components/src/data-display/index.d.ts +5 -0
  39. package/dist/types/packages/components/src/data-display/tag/__tests__/tag.test.d.ts +1 -0
  40. package/dist/types/packages/components/src/data-display/tag/index.d.ts +21 -0
  41. package/dist/types/packages/components/src/data-display/tag/props.d.ts +11 -0
  42. package/dist/types/packages/components/src/data-display/tag/tag.d.ts +20 -0
  43. package/dist/types/packages/components/src/index.d.ts +18 -0
  44. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
- import { cn as Re, withInstall as $e, PERMISSION_CHECKER_KEY as re, defaultPermissionChecker as ie } from "@mtn-ui/shared";
2
- import { defineComponent as R, createVNode as S, inject as ae, ref as D, computed as p, mergeProps as z, Fragment as E, h as Ge, Comment as Ve, Text as Ue, useSlots as je, shallowRef as He, watch as Z, createElementBlock as x, openBlock as s, createElementVNode as me, unref as b, withCtx as y, createBlock as k, createCommentVNode as Fe, renderList as O, resolveDynamicComponent as T, createSlots as U, createTextVNode as j, toDisplayString as te, cloneVNode as ye, nextTick as ve, onBeforeUnmount as We, renderSlot as V } from "vue";
3
- import { cva as Ke } from "class-variance-authority";
4
- import { Button as Ce, Space as ge, Dropdown as he, Menu as q, Popconfirm as Ye, message as ke, Modal as Xe, Table as qe } from "ant-design-vue";
5
- import { Table as It } from "ant-design-vue";
6
- import { useElementSize as Ze, useDebounceFn as ze } from "@vueuse/core";
7
- import { MoreOutlined as Je, DeleteOutlined as be, ExclamationCircleOutlined as Qe } from "@ant-design/icons-vue";
8
- const et = {
1
+ import { cn as Ue, withInstall as je, PERMISSION_CHECKER_KEY as le, defaultPermissionChecker as se } from "@mtn-ui/shared";
2
+ import { defineComponent as G, createVNode as B, inject as ue, ref as D, computed as p, mergeProps as x, Fragment as R, h as Fe, Comment as He, Text as Ke, useSlots as We, useAttrs as Ye, shallowRef as Xe, watch as ee, cloneVNode as ye, onMounted as qe, nextTick as H, onUnmounted as Ze, createElementBlock as M, openBlock as s, createElementVNode as ge, unref as P, normalizeProps as ve, guardReactiveProps as Je, withCtx as m, createBlock as h, createCommentVNode as Qe, renderList as $, resolveDynamicComponent as A, createSlots as K, createTextVNode as W, toDisplayString as re, normalizeStyle as et, onBeforeUnmount as tt, renderSlot as F } from "vue";
3
+ import { cva as nt } from "class-variance-authority";
4
+ import { Button as ze, Space as be, Dropdown as ke, Menu as Q, Popconfirm as ot, message as he, Modal as rt, Table as at } from "ant-design-vue";
5
+ import { Table as Vt } from "ant-design-vue";
6
+ import { useDebounceFn as Ce } from "@vueuse/core";
7
+ import { MoreOutlined as it, DeleteOutlined as Se, ExclamationCircleOutlined as lt } from "@ant-design/icons-vue";
8
+ const st = {
9
9
  type: {
10
10
  type: String,
11
11
  default: "default"
@@ -13,7 +13,7 @@ const et = {
13
13
  color: {
14
14
  type: String
15
15
  }
16
- }, tt = Ke("inline-flex items-center px-2 py-0.5 rounded text-xs font-medium border transition-colors", {
16
+ }, ut = nt("inline-flex items-center px-2 py-0.5 rounded text-xs font-medium border transition-colors", {
17
17
  variants: {
18
18
  type: {
19
19
  default: "bg-gray-100 text-gray-800 border-gray-200",
@@ -26,26 +26,26 @@ const et = {
26
26
  defaultVariants: {
27
27
  type: "default"
28
28
  }
29
- }), nt = /* @__PURE__ */ R({
29
+ }), ct = /* @__PURE__ */ G({
30
30
  name: "MTag",
31
- props: et,
31
+ props: st,
32
32
  setup(e, {
33
33
  slots: r,
34
- attrs: t
34
+ attrs: n
35
35
  }) {
36
36
  return () => {
37
37
  var l;
38
38
  const {
39
39
  type: o
40
40
  } = e;
41
- return S("span", {
42
- class: Re(tt({
41
+ return B("span", {
42
+ class: Ue(ut({
43
43
  type: o
44
- }), t.class)
44
+ }), n.class)
45
45
  }, [(l = r.default) == null ? void 0 : l.call(r)]);
46
46
  };
47
47
  }
48
- }), ot = $e(nt), Te = {
48
+ }), dt = je(ct), Pe = {
49
49
  // 按钮类型
50
50
  type: {
51
51
  type: String,
@@ -106,60 +106,60 @@ const et = {
106
106
  default: "hide"
107
107
  }
108
108
  };
109
- function Ae(e) {
110
- const { permission: r, permissionAction: t = "hide" } = e, o = ae(re, D(ie)), l = p(() => r ? o.value(r) : !0), v = p(() => !l.value && t === "hide"), m = p(() => !l.value && t === "disable");
109
+ function Te(e) {
110
+ const { permission: r, permissionAction: n = "hide" } = e, o = ue(le, D(se)), l = p(() => r ? o.value(r) : !0), y = p(() => !l.value && n === "hide"), d = p(() => !l.value && n === "disable");
111
111
  return {
112
112
  hasPermission: l,
113
- shouldHide: v,
114
- shouldDisable: m
113
+ shouldHide: y,
114
+ shouldDisable: d
115
115
  };
116
116
  }
117
- function rt(e, r) {
118
- return e.map((t) => {
119
- if (!t || t.type === "divider" || !t.permission)
120
- return t;
121
- if (!r(t.permission)) {
122
- const l = t.permissionAction || "hide";
117
+ function ft(e, r) {
118
+ return e.map((n) => {
119
+ if (!n || n.type === "divider" || !n.permission)
120
+ return n;
121
+ if (!r(n.permission)) {
122
+ const l = n.permissionAction || "hide";
123
123
  if (l === "hide")
124
124
  return null;
125
125
  if (l === "disable")
126
- return { ...t, disabled: !0 };
126
+ return { ...n, disabled: !0 };
127
127
  }
128
- return t;
128
+ return n;
129
129
  }).filter(Boolean);
130
130
  }
131
- const J = /* @__PURE__ */ R({
131
+ const te = /* @__PURE__ */ G({
132
132
  name: "MButton",
133
- props: Te,
133
+ props: Pe,
134
134
  emits: ["click"],
135
135
  setup(e, {
136
136
  slots: r,
137
- attrs: t,
137
+ attrs: n,
138
138
  emit: o
139
139
  }) {
140
140
  const {
141
141
  shouldHide: l,
142
- shouldDisable: v
143
- } = Ae({
142
+ shouldDisable: y
143
+ } = Te({
144
144
  permission: e.permission,
145
145
  permissionAction: e.permissionAction
146
- }), m = (f) => {
146
+ }), d = (f) => {
147
147
  o("click", f);
148
148
  };
149
- return () => l.value ? null : S(Ce, z({
149
+ return () => l.value ? null : B(ze, x({
150
150
  type: e.type,
151
151
  size: e.size,
152
152
  loading: e.loading,
153
- disabled: e.disabled || v.value,
153
+ disabled: e.disabled || y.value,
154
154
  danger: e.danger,
155
155
  block: e.block,
156
156
  ghost: e.ghost,
157
157
  shape: e.shape,
158
158
  htmlType: e.htmlType,
159
159
  icon: e.icon
160
- }, t, {
161
- class: ["mtn-button", t.class],
162
- onClick: m
160
+ }, n, {
161
+ class: ["mtn-button", n.class],
162
+ onClick: d
163
163
  }), {
164
164
  default: () => {
165
165
  var f;
@@ -171,7 +171,7 @@ const J = /* @__PURE__ */ R({
171
171
  }
172
172
  });
173
173
  }
174
- }), it = {
174
+ }), pt = {
175
175
  // 按钮组尺寸
176
176
  size: {
177
177
  type: String,
@@ -197,21 +197,21 @@ const J = /* @__PURE__ */ R({
197
197
  type: Boolean,
198
198
  default: !1
199
199
  }
200
- }, Pe = /* @__PURE__ */ R({
200
+ }, Ae = /* @__PURE__ */ G({
201
201
  name: "MButtonGroup",
202
- props: it,
202
+ props: pt,
203
203
  setup(e, {
204
204
  slots: r,
205
- attrs: t
205
+ attrs: n
206
206
  }) {
207
- return () => S(E, null, [e.compact ? (
207
+ return () => B(R, null, [e.compact ? (
208
208
  // 紧凑模式:按钮紧密连接
209
- S(ge.Compact, z({
209
+ B(be.Compact, x({
210
210
  size: e.size,
211
211
  direction: e.vertical ? "vertical" : "horizontal",
212
212
  block: e.block
213
- }, t, {
214
- class: ["mtn-button-group", "mtn-button-group--compact", t.class]
213
+ }, n, {
214
+ class: ["mtn-button-group", "mtn-button-group--compact", n.class]
215
215
  }), {
216
216
  default: () => {
217
217
  var o;
@@ -220,11 +220,11 @@ const J = /* @__PURE__ */ R({
220
220
  })
221
221
  ) : (
222
222
  // 普通模式:按钮有间距
223
- S(ge, z({
223
+ B(be, x({
224
224
  size: typeof e.gap == "number" ? e.gap : parseInt(e.gap) || 8,
225
225
  direction: e.vertical ? "vertical" : "horizontal"
226
- }, t, {
227
- class: ["mtn-button-group", "mtn-button-group--normal", t.class]
226
+ }, n, {
227
+ class: ["mtn-button-group", "mtn-button-group--normal", n.class]
228
228
  }), {
229
229
  default: () => {
230
230
  var o;
@@ -233,7 +233,7 @@ const J = /* @__PURE__ */ R({
233
233
  })
234
234
  )]);
235
235
  }
236
- }), at = {
236
+ }), mt = {
237
237
  // 按钮文字
238
238
  text: {
239
239
  type: String,
@@ -289,77 +289,77 @@ const J = /* @__PURE__ */ R({
289
289
  type: String,
290
290
  default: "hide"
291
291
  }
292
- }, oe = /* @__PURE__ */ R({
292
+ }, ie = /* @__PURE__ */ G({
293
293
  name: "MDropdownButton",
294
- props: at,
294
+ props: mt,
295
295
  emits: ["click"],
296
296
  setup(e, {
297
297
  slots: r,
298
- attrs: t,
298
+ attrs: n,
299
299
  emit: o
300
300
  }) {
301
301
  const {
302
302
  shouldHide: l,
303
- shouldDisable: v
304
- } = Ae({
303
+ shouldDisable: y
304
+ } = Te({
305
305
  permission: e.permission,
306
306
  permissionAction: e.permissionAction
307
- }), m = ae(re, D(ie)), f = (g) => {
308
- o("click", g);
307
+ }), d = ue(le, D(se)), f = (v) => {
308
+ o("click", v);
309
309
  };
310
310
  return () => {
311
311
  if (l.value)
312
312
  return null;
313
- const g = {};
313
+ const v = {};
314
314
  if (r.overlay)
315
- g.overlay = r.overlay;
315
+ v.overlay = r.overlay;
316
316
  else if (e.menu && e.menu.length > 0) {
317
- const B = rt(e.menu, m.value);
318
- g.overlay = () => Ge(q, {
319
- items: B
317
+ const b = ft(e.menu, d.value);
318
+ v.overlay = () => Fe(Q, {
319
+ items: b
320
320
  });
321
321
  }
322
- return r.icon && (g.icon = r.icon), !(r.default || e.text) ? S(he, z({
322
+ return r.icon && (v.icon = r.icon), !(r.default || e.text) ? B(ke, x({
323
323
  placement: e.placement,
324
324
  trigger: e.trigger
325
- }, t, {
326
- class: ["mtn-dropdown-button", t.class]
325
+ }, n, {
326
+ class: ["mtn-dropdown-button", n.class]
327
327
  }), {
328
- default: () => [S(Ce, {
328
+ default: () => [B(ze, {
329
329
  type: e.type,
330
330
  size: e.size === "middle" ? void 0 : e.size,
331
- disabled: e.disabled || v.value,
331
+ disabled: e.disabled || y.value,
332
332
  loading: e.loading,
333
333
  danger: e.danger,
334
334
  onClick: f
335
335
  }, {
336
336
  default: () => {
337
- var B;
338
- return [(B = r.icon) == null ? void 0 : B.call(r)];
337
+ var b;
338
+ return [(b = r.icon) == null ? void 0 : b.call(r)];
339
339
  }
340
340
  })],
341
- ...g
342
- }) : S(he.Button, z({
341
+ ...v
342
+ }) : B(ke.Button, x({
343
343
  type: e.type,
344
344
  size: e.size === "middle" ? void 0 : e.size,
345
- disabled: e.disabled || v.value,
345
+ disabled: e.disabled || y.value,
346
346
  loading: e.loading,
347
347
  danger: e.danger,
348
348
  placement: e.placement,
349
349
  trigger: e.trigger
350
- }, t, {
351
- class: ["mtn-dropdown-button", t.class],
350
+ }, n, {
351
+ class: ["mtn-dropdown-button", n.class],
352
352
  onClick: f
353
353
  }), {
354
354
  default: () => {
355
- var B;
356
- return [((B = r.default) == null ? void 0 : B.call(r)) || e.text];
355
+ var b;
356
+ return [((b = r.default) == null ? void 0 : b.call(r)) || e.text];
357
357
  },
358
- ...g
358
+ ...v
359
359
  });
360
360
  };
361
361
  }
362
- }), lt = {
362
+ }), yt = {
363
363
  // ===== 配置化 API =====
364
364
  /**
365
365
  * 操作项配置列表
@@ -448,270 +448,300 @@ const J = /* @__PURE__ */ R({
448
448
  default: !1
449
449
  }
450
450
  };
451
- function ut(e) {
451
+ function gt(e) {
452
452
  return e ? e.filter(
453
- (r) => r.type !== Ve && r.type !== Ue && r.type !== Symbol.for("v-fgt")
453
+ (r) => r.type !== He && r.type !== Ke && r.type !== Symbol.for("v-fgt")
454
454
  ) : [];
455
455
  }
456
- function Se(e, r) {
457
- var t, o;
456
+ function vt(e, r) {
457
+ var n, o;
458
458
  if (e.key !== null && e.key !== void 0)
459
459
  return typeof e.key == "symbol" ? e.key.toString() : e.key;
460
- if (((t = e.props) == null ? void 0 : t.key) !== null && ((o = e.props) == null ? void 0 : o.key) !== void 0) {
460
+ if (((n = e.props) == null ? void 0 : n.key) !== null && ((o = e.props) == null ? void 0 : o.key) !== void 0) {
461
461
  const l = e.props.key;
462
462
  return typeof l == "symbol" ? l.toString() : l;
463
463
  }
464
464
  return `button-${r}`;
465
465
  }
466
- const ne = "link", Be = "small", st = 150, ct = /* @__PURE__ */ R({
466
+ const ae = "link", Be = "small", bt = 150, kt = /* @__PURE__ */ G({
467
467
  name: "MActionGroup",
468
468
  inheritAttrs: !1,
469
469
  __name: "action-group",
470
- props: lt,
470
+ props: yt,
471
471
  emits: ["action-click"],
472
472
  setup(e, { emit: r }) {
473
- const t = e, o = r, l = je(), v = D(), m = D(), f = D(), { width: g } = Ze(v), H = ae(re, D(ie));
474
- function B(n) {
475
- if (!n) return;
476
- const c = n;
477
- return c.name || c.__name || c.displayName;
478
- }
479
- const M = p(() => t.mode === "table"), a = p(
480
- () => M.value ? "small" : t.size
481
- ), u = p(
482
- () => M.value ? "link" : "default"
483
- ), A = p(
484
- () => M.value ? "" : t.moreText
485
- ), I = p(() => t.moreIcon || Je);
486
- function F(n) {
487
- return n ? H.value(n) : !0;
473
+ const n = e, o = r, l = We(), y = Ye(), d = D(), f = D(), v = D(), Y = ue(le, D(se)), b = p(() => n.mode === "table"), E = p(() => b.value ? "small" : n.size), i = p(() => b.value ? "link" : "default"), u = p(() => b.value ? "" : n.moreText), I = p(() => n.moreIcon || it);
474
+ function w(t) {
475
+ return t ? Y.value(t) : !0;
488
476
  }
489
- const W = p(() => {
490
- var n;
491
- return ut((n = l.default) == null ? void 0 : n.call(l));
492
- }), _ = He([]);
493
- function le(n) {
494
- var i, d, h;
477
+ const ce = p(() => {
478
+ var t;
479
+ return gt((t = l.default) == null ? void 0 : t.call(l));
480
+ }), O = Xe([]);
481
+ function de(t) {
482
+ var z, k, C;
483
+ const c = t.icon && (t.icon.name || t.icon.__name) || "", a = t.component && (t.component.name || t.component.__name) || "";
495
484
  return [
496
- n.key ?? "",
497
- n.label ?? "",
498
- B(n.icon) ?? "",
499
- B(n.component) ?? "",
500
- Array.isArray(n.permission) ? n.permission.join(",") : n.permission ?? "",
501
- n.permissionAction ?? "",
502
- String(n.disabled ?? !1),
503
- String(((i = n.componentProps) == null ? void 0 : i.confirm) ?? ""),
504
- String(((d = n.componentProps) == null ? void 0 : d.showSuccess) ?? ""),
505
- String(((h = n.componentProps) == null ? void 0 : h.danger) ?? "")
485
+ t.key ?? "",
486
+ t.label ?? "",
487
+ c,
488
+ a,
489
+ Array.isArray(t.permission) ? t.permission.join(",") : t.permission ?? "",
490
+ t.permissionAction ?? "",
491
+ String(t.disabled ?? !1),
492
+ String(((z = t.componentProps) == null ? void 0 : z.confirm) ?? ""),
493
+ String(((k = t.componentProps) == null ? void 0 : k.showSuccess) ?? ""),
494
+ String(((C = t.componentProps) == null ? void 0 : C.danger) ?? "")
506
495
  ].join("|");
507
496
  }
508
- Z(
509
- () => t.actions,
510
- (n) => {
511
- if (!n) {
512
- _.value = [];
497
+ ee(
498
+ () => n.actions,
499
+ (t) => {
500
+ if (!t) {
501
+ O.value = [];
513
502
  return;
514
503
  }
515
- if (_.value.length !== n.length) {
516
- _.value = n;
504
+ if (O.value.length !== t.length) {
505
+ O.value = t;
517
506
  return;
518
507
  }
519
- const c = n.map(le).join("||"), i = _.value.map(le).join("||");
520
- c !== i && (_.value = n);
508
+ const c = t.map(de).join("||"), a = O.value.map(de).join("||");
509
+ c !== a && (O.value = t);
521
510
  },
522
511
  { immediate: !0, deep: !1 }
523
512
  );
524
- const K = p(() => _.value.length ? _.value.filter((n) => F(n.permission)) : []), C = p(() => t.actions ? K.value.length : W.value.length);
525
- function De() {
526
- if (!m.value || !f.value || !g.value)
527
- return Math.min(t.maxItems, C.value);
528
- const n = f.value.offsetWidth, c = Array.from(
529
- m.value.querySelectorAll(".measure-item")
530
- );
531
- if (c.length === 0) return Math.min(t.maxItems, C.value);
532
- let i = n, d = 0;
533
- for (let h = 0; h < c.length - 1; h++) {
534
- const w = c[h].offsetWidth + t.gap;
535
- if (i + w <= g.value)
536
- i += w, d++;
537
- else
538
- break;
513
+ const ne = p(() => O.value.length ? O.value.filter((t) => w(t.permission)) : []), T = p(() => n.actions ? ne.value.length : ce.value.length), X = p(() => n.actions ? ne.value.map((t, c) => ({
514
+ key: Le(t, c),
515
+ label: t.label || "",
516
+ icon: t.icon || null,
517
+ component: Oe(t),
518
+ props: Ne(t),
519
+ menuProps: Re(t),
520
+ handler: () => Ve(t)
521
+ })) : ce.value.filter((t) => {
522
+ const c = t.props || {};
523
+ return c.permission && c.permissionAction === "hide" ? w(c.permission) : !0;
524
+ }).map((t, c) => {
525
+ var k, C;
526
+ const a = vt(t, c), g = ye(t, {
527
+ type: ((k = t.props) == null ? void 0 : k.type) ?? (b.value ? i.value : void 0),
528
+ size: ((C = t.props) == null ? void 0 : C.size) ?? E.value
529
+ }), z = ye(t, {
530
+ ...t.props,
531
+ type: ae,
532
+ size: Be
533
+ });
534
+ return {
535
+ key: a,
536
+ label: "",
537
+ // 插槽模式没有 label,由组件自身渲染
538
+ icon: null,
539
+ component: g,
540
+ props: {},
541
+ // 插槽模式使用 cloneVNode 已经处理了 props
542
+ menuProps: {},
543
+ // 菜单模式使用 cloneVNode 已经处理了 props
544
+ handler: null,
545
+ // 插槽模式的事件由组件自身处理
546
+ vnode: g,
547
+ // 保存原始 vnode 用于渲染
548
+ menuVnode: z
549
+ // 保存菜单模式的 vnode
550
+ };
551
+ })), fe = p(() => X.value.slice(0, pe.value)), oe = p(() => X.value.slice(pe.value)), we = p(() => ({
552
+ size: E.value,
553
+ compact: n.compact,
554
+ vertical: n.vertical,
555
+ block: n.block,
556
+ ...y
557
+ })), Ie = p(() => ({
558
+ text: u.value,
559
+ size: E.value,
560
+ type: i.value,
561
+ ...n.moreProps
562
+ })), q = D(n.maxItems);
563
+ function Me() {
564
+ if (!d.value || !f.value || !v.value)
565
+ return Math.min(n.maxItems, T.value);
566
+ const t = d.value.clientWidth, c = f.value.querySelectorAll(".measure-item");
567
+ if (c.length === 0) return Math.min(n.maxItems, T.value);
568
+ const a = T.value, g = [];
569
+ for (let S = 0; S < Math.min(a, c.length); S++)
570
+ g.push(c[S].offsetWidth);
571
+ const z = v.value.offsetWidth ?? 0;
572
+ let k = 0, C = 0;
573
+ for (let S = 0; S < g.length; S++) {
574
+ const _ = g[S], N = k === 0 ? _ : k + n.gap + _, V = g.length - (S + 1) > 0 ? k === 0 ? z : n.gap + z : 0;
575
+ if (N + V <= t) {
576
+ k = N, C++;
577
+ continue;
578
+ }
579
+ break;
539
580
  }
540
- return Math.max(0, Math.min(d, t.maxItems, C.value));
581
+ return Math.max(0, Math.min(C, n.maxItems, a));
541
582
  }
542
- const $ = D(t.maxItems), Ie = ze(() => {
543
- $.value = De();
544
- }, st);
545
- Z(
546
- [g, C, () => t.maxItems, () => t.gap],
547
- () => {
548
- if (t.disableCollapse) {
549
- $.value = C.value;
550
- return;
551
- }
552
- if (C.value <= 1) {
553
- $.value = C.value;
554
- return;
555
- }
556
- m.value && f.value && g.value ? Ie() : $.value = Math.min(t.maxItems, C.value);
583
+ const Z = () => {
584
+ if (n.disableCollapse) {
585
+ q.value = T.value;
586
+ return;
587
+ }
588
+ if (T.value <= 1) {
589
+ q.value = T.value;
590
+ return;
591
+ }
592
+ q.value = Me();
593
+ }, L = Ce(() => {
594
+ Z();
595
+ }, bt), U = (t = !1) => {
596
+ t ? (typeof L == "function" && "cancel" in L && L.cancel(), Z()) : L();
597
+ };
598
+ U.cancel = () => {
599
+ typeof L == "function" && "cancel" in L && L.cancel();
600
+ };
601
+ let j = null;
602
+ const De = async () => {
603
+ await H(), Z(), d.value && typeof ResizeObserver < "u" && (j = new ResizeObserver((t) => {
604
+ t[0].contentRect.width > 0 && U();
605
+ }), j.observe(d.value));
606
+ }, _e = () => {
607
+ j && d.value && j.unobserve(d.value), j = null, "cancel" in U && U.cancel();
608
+ };
609
+ qe(async () => {
610
+ Z(), await H(), De();
611
+ }), Ze(() => {
612
+ _e();
613
+ }), ee(
614
+ [ne, T, () => n.maxItems, () => n.gap],
615
+ async () => {
616
+ await H(), U(!0);
557
617
  },
558
- { immediate: !0 }
618
+ { deep: !1 }
559
619
  );
560
- const N = p(() => t.disableCollapse || C.value <= 1 ? C.value : m.value && f.value && g.value ? $.value : Math.min(t.maxItems, C.value)), Me = p(() => t.actions ? K.value.slice(0, N.value) : []), ue = p(() => t.actions ? K.value.slice(N.value) : []), _e = p(() => {
561
- if (t.actions) return [];
562
- const n = W.value;
563
- return N.value >= n.length ? n : n.slice(0, N.value);
564
- }), se = p(() => {
565
- if (t.actions) return [];
566
- const n = W.value;
567
- return N.value >= n.length ? [] : n.slice(N.value);
568
- }), we = p(() => t.actions ? [] : se.value.filter((n) => {
569
- const c = n.props || {};
570
- return c.permission && c.permissionAction === "hide" ? F(c.permission) : !0;
571
- })), Ee = p(() => t.disableCollapse ? !1 : (t.actions ? ue.value.length : se.value.length) > 0);
572
- function Q(n) {
573
- return n.component || J;
620
+ const pe = p(() => n.disableCollapse || T.value <= 1 ? T.value : f.value && v.value && d.value ? q.value : Math.min(n.maxItems, T.value)), Ee = p(() => n.disableCollapse ? !1 : oe.value.length > 0);
621
+ function Oe(t) {
622
+ return t.component || te;
574
623
  }
575
- function ce(n, c) {
576
- return n.key || n.label || `action-${c}`;
624
+ function Le(t, c) {
625
+ return t.key || t.label || `action-${c}`;
577
626
  }
578
- function de(n) {
627
+ function me(t) {
579
628
  const {
580
629
  label: c,
581
- key: i,
582
- onClick: d,
583
- permission: h,
584
- permissionAction: P,
585
- icon: w,
586
- component: L,
587
- componentProps: G,
588
- slot: Y,
589
- type: ee,
590
- size: X,
591
- disabled: Le,
592
- ...Oe
593
- } = n;
630
+ key: a,
631
+ onClick: g,
632
+ permission: z,
633
+ permissionAction: k,
634
+ icon: C,
635
+ component: S,
636
+ componentProps: _,
637
+ slot: N,
638
+ type: J,
639
+ size: V,
640
+ disabled: $e,
641
+ ...Ge
642
+ } = t;
594
643
  return {
595
- component: L,
596
- componentProps: G,
597
- type: ee,
598
- size: X,
599
- rest: Oe,
600
- permission: h,
601
- permissionAction: P,
602
- disabled: Le
644
+ component: S,
645
+ componentProps: _,
646
+ type: J,
647
+ size: V,
648
+ rest: Ge,
649
+ permission: z,
650
+ permissionAction: k,
651
+ disabled: $e
603
652
  };
604
653
  }
605
- function fe(n) {
606
- const { component: c, componentProps: i, type: d, rest: h, permission: P, permissionAction: w, disabled: L } = de(n), G = {
607
- type: d || u.value,
608
- size: a.value,
609
- disabled: L || !F(P) && w === "disable",
610
- ...h
654
+ function Ne(t) {
655
+ const { component: c, componentProps: a, type: g, rest: z, permission: k, permissionAction: C, disabled: S } = me(t), _ = {
656
+ type: g || i.value,
657
+ size: E.value,
658
+ disabled: S || !w(k) && C === "disable",
659
+ ...z
611
660
  };
612
- if (c && i) {
613
- const Y = { ...G, ...i };
614
- return M.value && (Y.type = "link"), Y;
661
+ if (c && a) {
662
+ const N = { ..._, ...a };
663
+ return b.value && (N.type = "link"), N;
615
664
  }
616
- return G;
665
+ return _;
617
666
  }
618
- function Ne(n) {
619
- const { component: c, componentProps: i, rest: d, permission: h, permissionAction: P, disabled: w } = de(n), L = {
620
- type: ne,
667
+ function Re(t) {
668
+ const { component: c, componentProps: a, rest: g, permission: z, permissionAction: k, disabled: C } = me(t), S = {
669
+ type: ae,
621
670
  size: Be,
622
- disabled: w || !F(h) && P === "disable",
623
- ...d
671
+ disabled: C || !w(z) && k === "disable",
672
+ ...g
624
673
  };
625
- if (c && i) {
626
- const { type: G, size: Y, ...ee } = i, X = { ...L, ...ee };
627
- return X.type = ne, X;
674
+ if (c && a) {
675
+ const { type: _, size: N, ...J } = a, V = { ...S, ...J };
676
+ return V.type = ae, V;
628
677
  }
629
- return L;
678
+ return S;
630
679
  }
631
- function pe(n) {
632
- n.onClick && n.onClick(n), o("action-click", n);
680
+ function Ve(t) {
681
+ t.onClick && t.onClick(t), o("action-click", t);
633
682
  }
634
- return (n, c) => (s(), x("div", {
683
+ return (t, c) => (s(), M("div", {
635
684
  ref_key: "containerRef",
636
- ref: v,
685
+ ref: d,
637
686
  class: "mtn-action-group"
638
687
  }, [
639
- S(b(Pe), z({
640
- size: a.value,
641
- compact: n.compact,
642
- vertical: n.vertical,
643
- block: n.block
644
- }, n.$attrs), {
645
- default: y(() => [
646
- t.actions ? (s(!0), x(E, { key: 0 }, O(Me.value, (i, d) => (s(), k(T(Q(i)), z({
647
- key: ce(i, d)
648
- }, { ref_for: !0 }, fe(i), {
649
- onClick: (h) => pe(i)
650
- }), U({
651
- default: y(() => [
652
- j(" " + te(i.label), 1)
688
+ B(P(Ae), ve(Je(we.value)), {
689
+ default: m(() => [
690
+ n.actions ? (s(!0), M(R, { key: 0 }, $(fe.value, (a) => (s(), h(A(a.component), x({
691
+ key: a.key,
692
+ ref_for: !0
693
+ }, a.props, {
694
+ onClick: a.handler
695
+ }), K({
696
+ default: m(() => [
697
+ W(" " + re(a.label), 1)
653
698
  ]),
654
699
  _: 2
655
700
  }, [
656
- i.icon ? {
701
+ a.icon ? {
657
702
  name: "icon",
658
- fn: y(() => [
659
- (s(), k(T(i.icon)))
703
+ fn: m(() => [
704
+ (s(), h(A(a.icon)))
660
705
  ]),
661
706
  key: "0"
662
707
  } : void 0
663
- ]), 1040, ["onClick"]))), 128)) : (s(!0), x(E, { key: 1 }, O(_e.value, (i, d) => {
664
- var h, P;
665
- return s(), k(T(ye(i, {
666
- type: ((h = i.props) == null ? void 0 : h.type) ?? (M.value ? u.value : void 0),
667
- size: ((P = i.props) == null ? void 0 : P.size) ?? a.value
668
- })), {
669
- key: b(Se)(i, d)
670
- });
671
- }), 128)),
672
- Ee.value ? (s(), k(b(oe), z({
673
- key: 2,
674
- text: A.value,
675
- size: a.value,
676
- type: u.value
677
- }, t.moreProps), {
678
- icon: y(() => [
679
- (s(), k(T(I.value)))
708
+ ]), 1040, ["onClick"]))), 128)) : (s(!0), M(R, { key: 1 }, $(fe.value, (a) => (s(), h(A(a.vnode), {
709
+ key: a.key
710
+ }))), 128)),
711
+ Ee.value ? (s(), h(P(ie), ve(x({ key: 2 }, Ie.value)), {
712
+ icon: m(() => [
713
+ (s(), h(A(I.value)))
680
714
  ]),
681
- overlay: y(() => [
682
- S(b(q), null, {
683
- default: y(() => [
684
- t.actions ? (s(!0), x(E, { key: 0 }, O(ue.value, (i, d) => (s(), k(b(q).Item, {
685
- key: ce(i, d)
715
+ overlay: m(() => [
716
+ B(P(Q), null, {
717
+ default: m(() => [
718
+ n.actions ? (s(!0), M(R, { key: 0 }, $(oe.value, (a) => (s(), h(P(Q).Item, {
719
+ key: a.key
686
720
  }, {
687
- default: y(() => [
688
- (s(), k(T(Q(i)), z({ ref_for: !0 }, Ne(i), {
689
- onClick: (h) => pe(i)
690
- }), U({
691
- default: y(() => [
692
- j(" " + te(i.label), 1)
721
+ default: m(() => [
722
+ (s(), h(A(a.component), x({ ref_for: !0 }, a.menuProps, {
723
+ onClick: a.handler
724
+ }), K({
725
+ default: m(() => [
726
+ W(" " + re(a.label), 1)
693
727
  ]),
694
728
  _: 2
695
729
  }, [
696
- i.icon ? {
730
+ a.icon ? {
697
731
  name: "icon",
698
- fn: y(() => [
699
- (s(), k(T(i.icon)))
732
+ fn: m(() => [
733
+ (s(), h(A(a.icon)))
700
734
  ]),
701
735
  key: "0"
702
736
  } : void 0
703
737
  ]), 1040, ["onClick"]))
704
738
  ]),
705
739
  _: 2
706
- }, 1024))), 128)) : (s(!0), x(E, { key: 1 }, O(we.value, (i, d) => (s(), k(b(q).Item, {
707
- key: b(Se)(i, d)
740
+ }, 1024))), 128)) : (s(!0), M(R, { key: 1 }, $(oe.value, (a) => (s(), h(P(Q).Item, {
741
+ key: a.key
708
742
  }, {
709
- default: y(() => [
710
- (s(), k(T(ye(i, {
711
- ...i.props,
712
- type: ne,
713
- size: Be
714
- }))))
743
+ default: m(() => [
744
+ (s(), h(A(a.menuVnode)))
715
745
  ]),
716
746
  _: 2
717
747
  }, 1024))), 128))
@@ -720,66 +750,67 @@ const ne = "link", Be = "small", st = 150, ct = /* @__PURE__ */ R({
720
750
  })
721
751
  ]),
722
752
  _: 1
723
- }, 16, ["text", "size", "type"])) : Fe("", !0)
753
+ }, 16)) : Qe("", !0)
724
754
  ]),
725
755
  _: 1
726
- }, 16, ["size", "compact", "vertical", "block"]),
727
- me("div", {
756
+ }, 16),
757
+ ge("div", {
728
758
  ref_key: "measureRef",
729
- ref: m,
730
- class: "mtn-action-group-measure"
759
+ ref: f,
760
+ class: "mtn-action-group-measure",
761
+ style: et({ gap: `${n.gap}px` })
731
762
  }, [
732
- t.actions ? (s(!0), x(E, { key: 0 }, O(K.value, (i, d) => (s(), x("span", {
733
- key: d,
763
+ n.actions ? (s(!0), M(R, { key: 0 }, $(X.value, (a, g) => (s(), M("span", {
764
+ key: g,
734
765
  class: "measure-item"
735
766
  }, [
736
- (s(), k(T(Q(i)), z({ ref_for: !0 }, fe(i)), U({
737
- default: y(() => [
738
- j(" " + te(i.label), 1)
767
+ (s(), h(A(a.component), x({ ref_for: !0 }, a.props), K({
768
+ default: m(() => [
769
+ W(" " + re(a.label), 1)
739
770
  ]),
740
771
  _: 2
741
772
  }, [
742
- i.icon ? {
773
+ a.icon ? {
743
774
  name: "icon",
744
- fn: y(() => [
745
- (s(), k(T(i.icon)))
775
+ fn: m(() => [
776
+ (s(), h(A(a.icon)))
746
777
  ]),
747
778
  key: "0"
748
779
  } : void 0
749
780
  ]), 1040))
750
- ]))), 128)) : (s(!0), x(E, { key: 1 }, O(W.value, (i, d) => (s(), x("span", {
751
- key: d,
781
+ ]))), 128)) : (s(!0), M(R, { key: 1 }, $(X.value, (a, g) => (s(), M("span", {
782
+ key: g,
752
783
  class: "measure-item"
753
784
  }, [
754
- (s(), k(T(i)))
785
+ (s(), h(A(a.vnode)))
755
786
  ]))), 128)),
756
- me("span", {
787
+ ge("span", {
757
788
  ref_key: "moreTriggerRef",
758
- ref: f,
789
+ ref: v,
759
790
  class: "measure-item"
760
791
  }, [
761
- S(b(oe), {
762
- text: A.value,
763
- size: a.value,
764
- type: u.value
792
+ B(P(ie), {
793
+ text: u.value,
794
+ size: E.value,
795
+ type: i.value
765
796
  }, {
766
- icon: y(() => [
767
- (s(), k(T(I.value)))
797
+ icon: m(() => [
798
+ (s(), h(A(I.value)))
768
799
  ]),
769
800
  _: 1
770
801
  }, 8, ["text", "size", "type"])
771
802
  ], 512)
772
- ], 512)
803
+ ], 4)
773
804
  ], 512));
774
805
  }
775
806
  }), xe = (e, r) => {
776
- const t = e.__vccOpts || e;
807
+ const n = e.__vccOpts || e;
777
808
  for (const [o, l] of r)
778
- t[o] = l;
779
- return t;
780
- }, dt = /* @__PURE__ */ xe(ct, [["__scopeId", "data-v-ccd228a1"]]), ft = {
809
+ n[o] = l;
810
+ return n;
811
+ }, ht = /* @__PURE__ */ xe(kt, [["__scopeId", "data-v-29d941f4"]]), St = {
781
812
  // 继承 Button 的所有 props
782
- ...Te,
813
+ ...Pe,
783
814
  // 覆盖 loading prop,使其默认值为 undefined,以便自动 loading 功能正常工作
784
815
  loading: {
785
816
  type: Boolean,
@@ -855,76 +886,76 @@ const ne = "link", Be = "small", st = 150, ct = /* @__PURE__ */ R({
855
886
  type: Function,
856
887
  default: void 0
857
888
  }
858
- }, pt = /* @__PURE__ */ R({
889
+ }, Bt = /* @__PURE__ */ G({
859
890
  name: "MDeleteButton",
860
891
  inheritAttrs: !1,
861
892
  __name: "delete-button",
862
- props: ft,
893
+ props: St,
863
894
  emits: ["delete", "success", "error"],
864
895
  setup(e, { emit: r }) {
865
- const t = r, o = e, l = D(!1), v = D(null), m = p(() => o.loading !== void 0 ? o.loading : o.autoLoading ? l.value : !1), f = p(() => typeof o.confirm == "function" ? o.confirm(o.count) : o.confirm);
866
- Z(m, (a) => {
867
- v.value && ve(() => {
896
+ const n = r, o = e, l = D(!1), y = D(null), d = p(() => o.loading !== void 0 ? o.loading : o.autoLoading ? l.value : !1), f = p(() => typeof o.confirm == "function" ? o.confirm(o.count) : o.confirm);
897
+ ee(d, (i) => {
898
+ y.value && H(() => {
868
899
  var u;
869
- (u = v.value) == null || u.update({
870
- okButtonProps: { loading: a }
900
+ (u = y.value) == null || u.update({
901
+ okButtonProps: { loading: i }
871
902
  });
872
903
  });
873
- }, { flush: "post" }), We(() => {
874
- v.value && (v.value.destroy(), v.value = null);
904
+ }, { flush: "post" }), tt(() => {
905
+ y.value && (y.value.destroy(), y.value = null);
875
906
  });
876
- const g = async () => {
907
+ const v = async () => {
877
908
  try {
878
909
  if (o.beforeDelete && await o.beforeDelete() === !1)
879
910
  return;
880
911
  o.autoLoading && o.loading === void 0 && (l.value = !0);
881
- let a = !1;
912
+ let i = !1;
882
913
  const u = () => {
883
- a || (a = !0, o.autoLoading && o.loading === void 0 && (l.value = !1));
914
+ i || (i = !0, o.autoLoading && o.loading === void 0 && (l.value = !1));
884
915
  };
885
916
  if (o.onDelete) {
886
- const A = o.onDelete(u);
887
- if (A && typeof A.then == "function")
917
+ const I = o.onDelete(u);
918
+ if (I && typeof I.then == "function")
888
919
  try {
889
- const I = await A;
890
- a || u(), H(I);
891
- } catch (I) {
892
- throw a || u(), I;
920
+ const w = await I;
921
+ i || u(), Y(w);
922
+ } catch (w) {
923
+ throw i || u(), w;
893
924
  }
894
925
  } else
895
- t("delete", u), o.autoLoading && o.loading === void 0 && setTimeout(() => {
896
- a || u();
926
+ n("delete", u), o.autoLoading && o.loading === void 0 && setTimeout(() => {
927
+ i || u();
897
928
  }, 5e3);
898
- } catch (a) {
929
+ } catch (i) {
899
930
  o.autoLoading && o.loading === void 0 && (l.value = !1);
900
- const u = a instanceof Error ? a : new Error(String(a));
901
- t("error", u), o.showError && ke.error(u.message || "删除失败,请重试");
931
+ const u = i instanceof Error ? i : new Error(String(i));
932
+ n("error", u), o.showError && he.error(u.message || "删除失败,请重试");
902
933
  }
903
- }, H = (a) => {
904
- o.showSuccess && ke.success(o.successText || "删除成功"), t("success", a);
905
- }, B = o.debounce > 0 ? ze(g, o.debounce) : g, M = () => {
934
+ }, Y = (i) => {
935
+ o.showSuccess && he.success(o.successText || "删除成功"), n("success", i);
936
+ }, b = o.debounce > 0 ? Ce(v, o.debounce) : v, E = () => {
906
937
  if (!f.value) {
907
- B();
938
+ b();
908
939
  return;
909
940
  }
910
941
  if (o.confirmType === "popconfirm") return;
911
- ve(() => {
912
- v.value = Xe.confirm({
942
+ H(() => {
943
+ y.value = rt.confirm({
913
944
  title: o.confirmTitle,
914
945
  content: f.value,
915
946
  okText: o.okText,
916
947
  cancelText: o.cancelText,
917
948
  okType: "danger",
918
- okButtonProps: { loading: m.value },
949
+ okButtonProps: { loading: d.value },
919
950
  onOk: async () => {
920
951
  try {
921
- return await g(), new Promise((u) => {
922
- if (!m.value) {
952
+ return await v(), new Promise((u) => {
953
+ if (!d.value) {
923
954
  u();
924
955
  return;
925
956
  }
926
- const A = Z(m, (I) => {
927
- I || (A(), u());
957
+ const I = ee(d, (w) => {
958
+ w || (I(), u());
928
959
  });
929
960
  });
930
961
  } catch (u) {
@@ -932,50 +963,50 @@ const ne = "link", Be = "small", st = 150, ct = /* @__PURE__ */ R({
932
963
  }
933
964
  },
934
965
  onCancel: () => {
935
- v.value = null;
966
+ y.value = null;
936
967
  },
937
968
  afterClose: () => {
938
- v.value = null;
969
+ y.value = null;
939
970
  }
940
971
  });
941
972
  });
942
973
  };
943
- return (a, u) => f.value && a.confirmType === "popconfirm" ? (s(), k(b(Ye), {
974
+ return (i, u) => f.value && i.confirmType === "popconfirm" ? (s(), h(P(ot), {
944
975
  key: 0,
945
976
  title: f.value,
946
- "ok-text": a.okText,
947
- "cancel-text": a.cancelText,
948
- "ok-button-props": { loading: m.value, danger: !0 },
949
- onConfirm: b(B)
977
+ "ok-text": i.okText,
978
+ "cancel-text": i.cancelText,
979
+ "ok-button-props": { loading: d.value, danger: !0 },
980
+ onConfirm: P(b)
950
981
  }, {
951
- icon: y(() => [
952
- V(a.$slots, "popconfirmIcon", {}, () => [
953
- S(b(Qe), { class: "text-[--color-ant-error]" })
982
+ icon: m(() => [
983
+ F(i.$slots, "popconfirmIcon", {}, () => [
984
+ B(P(lt), { class: "text-[--color-ant-error]" })
954
985
  ], !0)
955
986
  ]),
956
- default: y(() => [
957
- S(b(J), z(a.$attrs, {
958
- type: a.type,
959
- size: a.size,
987
+ default: m(() => [
988
+ B(P(te), x(i.$attrs, {
989
+ type: i.type,
990
+ size: i.size,
960
991
  danger: !0,
961
- loading: m.value,
962
- disabled: a.disabled,
963
- permission: a.permission,
964
- "permission-action": a.permissionAction,
992
+ loading: d.value,
993
+ disabled: i.disabled,
994
+ permission: i.permission,
995
+ "permission-action": i.permissionAction,
965
996
  class: "group"
966
- }), U({
967
- default: y(() => [
968
- V(a.$slots, "default", {}, () => [
969
- u[0] || (u[0] = j("删除", -1))
997
+ }), K({
998
+ default: m(() => [
999
+ F(i.$slots, "default", {}, () => [
1000
+ u[0] || (u[0] = W("删除", -1))
970
1001
  ], !0)
971
1002
  ]),
972
1003
  _: 2
973
1004
  }, [
974
- a.hideIcon ? void 0 : {
1005
+ i.hideIcon ? void 0 : {
975
1006
  name: "icon",
976
- fn: y(() => [
977
- V(a.$slots, "icon", {}, () => [
978
- S(b(be))
1007
+ fn: m(() => [
1008
+ F(i.$slots, "icon", {}, () => [
1009
+ B(P(Se))
979
1010
  ], !0)
980
1011
  ]),
981
1012
  key: "0"
@@ -983,57 +1014,57 @@ const ne = "link", Be = "small", st = 150, ct = /* @__PURE__ */ R({
983
1014
  ]), 1040, ["type", "size", "loading", "disabled", "permission", "permission-action"])
984
1015
  ]),
985
1016
  _: 3
986
- }, 8, ["title", "ok-text", "cancel-text", "ok-button-props", "onConfirm"])) : (s(), k(b(J), z({ key: 1 }, a.$attrs, {
987
- type: a.type,
988
- size: a.size,
1017
+ }, 8, ["title", "ok-text", "cancel-text", "ok-button-props", "onConfirm"])) : (s(), h(P(te), x({ key: 1 }, i.$attrs, {
1018
+ type: i.type,
1019
+ size: i.size,
989
1020
  danger: !0,
990
- loading: m.value,
991
- disabled: a.disabled,
992
- permission: a.permission,
993
- "permission-action": a.permissionAction,
994
- onClick: M
995
- }), U({
996
- default: y(() => [
997
- V(a.$slots, "default", {}, () => [
998
- u[1] || (u[1] = j("删除", -1))
1021
+ loading: d.value,
1022
+ disabled: i.disabled,
1023
+ permission: i.permission,
1024
+ "permission-action": i.permissionAction,
1025
+ onClick: E
1026
+ }), K({
1027
+ default: m(() => [
1028
+ F(i.$slots, "default", {}, () => [
1029
+ u[1] || (u[1] = W("删除", -1))
999
1030
  ], !0)
1000
1031
  ]),
1001
1032
  _: 2
1002
1033
  }, [
1003
- a.hideIcon ? void 0 : {
1034
+ i.hideIcon ? void 0 : {
1004
1035
  name: "icon",
1005
- fn: y(() => [
1006
- V(a.$slots, "icon", {}, () => [
1007
- S(b(be))
1036
+ fn: m(() => [
1037
+ F(i.$slots, "icon", {}, () => [
1038
+ B(P(Se))
1008
1039
  ], !0)
1009
1040
  ]),
1010
1041
  key: "0"
1011
1042
  }
1012
1043
  ]), 1040, ["type", "size", "loading", "disabled", "permission", "permission-action"]));
1013
1044
  }
1014
- }), mt = /* @__PURE__ */ xe(pt, [["__scopeId", "data-v-a943bc19"]]);
1015
- var yt = /* @__PURE__ */ ((e) => (e.TEXT = "text", e.TAG = "tag", e.DATE = "date", e.DATETIME = "dateTime", e.SELECT = "select", e.STATUS = "status", e.CUSTOM = "custom", e))(yt || {}), vt = /* @__PURE__ */ ((e) => (e.LEFT = "left", e.CENTER = "center", e.RIGHT = "right", e))(vt || {}), gt = /* @__PURE__ */ ((e) => (e.SMALL = "small", e.MIDDLE = "middle", e.LARGE = "large", e))(gt || {}), ht = /* @__PURE__ */ ((e) => (e.CHECKBOX = "checkbox", e.RADIO = "radio", e))(ht || {}), kt = /* @__PURE__ */ ((e) => (e.LEFT = "left", e.RIGHT = "right", e))(kt || {});
1016
- const bt = [J, Pe, oe, dt, mt, ot, qe], Pt = {
1045
+ }), zt = /* @__PURE__ */ xe(Bt, [["__scopeId", "data-v-a943bc19"]]);
1046
+ var Ct = /* @__PURE__ */ ((e) => (e.TEXT = "text", e.TAG = "tag", e.DATE = "date", e.DATETIME = "dateTime", e.SELECT = "select", e.STATUS = "status", e.CUSTOM = "custom", e))(Ct || {}), Pt = /* @__PURE__ */ ((e) => (e.LEFT = "left", e.CENTER = "center", e.RIGHT = "right", e))(Pt || {}), Tt = /* @__PURE__ */ ((e) => (e.SMALL = "small", e.MIDDLE = "middle", e.LARGE = "large", e))(Tt || {}), At = /* @__PURE__ */ ((e) => (e.CHECKBOX = "checkbox", e.RADIO = "radio", e))(At || {}), xt = /* @__PURE__ */ ((e) => (e.LEFT = "left", e.RIGHT = "right", e))(xt || {});
1047
+ const wt = [te, Ae, ie, ht, zt, dt, at], Lt = {
1017
1048
  install(e) {
1018
- bt.forEach((r) => {
1049
+ wt.forEach((r) => {
1019
1050
  e.component(r.name || "", r);
1020
1051
  });
1021
1052
  }
1022
1053
  };
1023
1054
  export {
1024
- dt as ActionGroup,
1025
- J as Button,
1026
- Pe as ButtonGroup,
1027
- kt as ButtonPositionEnum,
1028
- mt as DeleteButton,
1029
- oe as DropdownButton,
1030
- It as Table,
1031
- vt as TableColumnAlignEnum,
1032
- yt as TableColumnTypeEnum,
1033
- ht as TableSelectionTypeEnum,
1034
- gt as TableSizeEnum,
1035
- ot as Tag,
1036
- it as buttonGroupProps,
1037
- Pt as default,
1038
- et as tagProps
1055
+ ht as ActionGroup,
1056
+ te as Button,
1057
+ Ae as ButtonGroup,
1058
+ xt as ButtonPositionEnum,
1059
+ zt as DeleteButton,
1060
+ ie as DropdownButton,
1061
+ Vt as Table,
1062
+ Pt as TableColumnAlignEnum,
1063
+ Ct as TableColumnTypeEnum,
1064
+ At as TableSelectionTypeEnum,
1065
+ Tt as TableSizeEnum,
1066
+ dt as Tag,
1067
+ pt as buttonGroupProps,
1068
+ Lt as default,
1069
+ st as tagProps
1039
1070
  };