@mtn-ui/components 1.0.5 → 1.0.6

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.
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { cn as _e, withInstall as ge, PERMISSION_CHECKER_KEY as Z, defaultPermissionChecker as J } from "@mtn-ui/shared";
2
- import { defineComponent as _, createVNode as v, inject as Q, ref as D, computed as c, mergeProps as S, Fragment as I, h as Ee, Comment as Ne, Text as $e, useSlots as Oe, createElementBlock as w, openBlock as u, createElementVNode as re, unref as B, withCtx as f, createBlock as g, createCommentVNode as Le, renderList as O, resolveDynamicComponent as A, createSlots as j, createTextVNode as W, toDisplayString as q, cloneVNode as ae, watch as le, nextTick as ue, onBeforeUnmount as Re, renderSlot as V, isVNode as Ve } from "vue";
1
+ import { cn as _e, withInstall as ve, PERMISSION_CHECKER_KEY as J, defaultPermissionChecker as Q } from "@mtn-ui/shared";
2
+ import { defineComponent as _, createVNode as b, inject as X, ref as w, computed as p, mergeProps as S, Fragment as I, h as Ee, Comment as Ne, Text as $e, useSlots as Oe, createElementBlock as D, openBlock as u, createElementVNode as ae, unref as B, withCtx as m, createBlock as v, createCommentVNode as Le, renderList as L, resolveDynamicComponent as A, createSlots as W, createTextVNode as F, toDisplayString as Y, cloneVNode as le, watch as ue, nextTick as se, onBeforeUnmount as Re, renderSlot as j, isVNode as Ve } from "vue";
3
3
  import { cva as je } from "class-variance-authority";
4
- import { Button as ve, Space as se, Dropdown as ce, Menu as G, Popconfirm as We, message as de, Modal as Fe, Table as Ge } from "ant-design-vue";
4
+ import { Button as be, Space as ce, Dropdown as de, Menu as H, Popconfirm as We, message as fe, Modal as Fe, Table as Ge } from "ant-design-vue";
5
5
  import { useElementSize as He, useDebounceFn as Ke } from "@vueuse/core";
6
- import { MoreOutlined as Ue, DeleteOutlined as fe, ExclamationCircleOutlined as qe } from "@ant-design/icons-vue";
6
+ import { MoreOutlined as Ue, DeleteOutlined as pe, ExclamationCircleOutlined as qe } from "@ant-design/icons-vue";
7
7
  const Ye = {
8
8
  type: {
9
9
  type: String,
@@ -37,14 +37,14 @@ const Ye = {
37
37
  const {
38
38
  type: o
39
39
  } = e;
40
- return v("span", {
40
+ return b("span", {
41
41
  class: _e(Ze({
42
42
  type: o
43
43
  }), t.class)
44
44
  }, [(l = n.default) == null ? void 0 : l.call(n)]);
45
45
  };
46
46
  }
47
- }), Qe = ge(Je), be = {
47
+ }), Qe = ve(Je), ke = {
48
48
  // 按钮类型
49
49
  type: {
50
50
  type: String,
@@ -105,12 +105,12 @@ const Ye = {
105
105
  default: "hide"
106
106
  }
107
107
  };
108
- function ke(e) {
109
- const { permission: n, permissionAction: t = "hide" } = e, o = Q(Z, D(J)), l = c(() => n ? o.value(n) : !0), p = c(() => !l.value && t === "hide"), m = c(() => !l.value && t === "disable");
108
+ function he(e) {
109
+ const { permission: n, permissionAction: t = "hide" } = e, o = X(J, w(Q)), l = p(() => n ? o.value(n) : !0), y = p(() => !l.value && t === "hide"), g = p(() => !l.value && t === "disable");
110
110
  return {
111
111
  hasPermission: l,
112
- shouldHide: p,
113
- shouldDisable: m
112
+ shouldHide: y,
113
+ shouldDisable: g
114
114
  };
115
115
  }
116
116
  function Xe(e, n) {
@@ -127,9 +127,9 @@ function Xe(e, n) {
127
127
  return t;
128
128
  }).filter(Boolean);
129
129
  }
130
- const H = /* @__PURE__ */ _({
130
+ const K = /* @__PURE__ */ _({
131
131
  name: "MButton",
132
- props: be,
132
+ props: ke,
133
133
  emits: ["click"],
134
134
  setup(e, {
135
135
  slots: n,
@@ -138,18 +138,18 @@ const H = /* @__PURE__ */ _({
138
138
  }) {
139
139
  const {
140
140
  shouldHide: l,
141
- shouldDisable: p
142
- } = ke({
141
+ shouldDisable: y
142
+ } = he({
143
143
  permission: e.permission,
144
144
  permissionAction: e.permissionAction
145
- }), m = (y) => {
146
- o("click", y);
145
+ }), g = (d) => {
146
+ o("click", d);
147
147
  };
148
- return () => l.value ? null : v(ve, S({
148
+ return () => l.value ? null : b(be, S({
149
149
  type: e.type,
150
150
  size: e.size,
151
151
  loading: e.loading,
152
- disabled: e.disabled || p.value,
152
+ disabled: e.disabled || y.value,
153
153
  danger: e.danger,
154
154
  block: e.block,
155
155
  ghost: e.ghost,
@@ -158,11 +158,15 @@ const H = /* @__PURE__ */ _({
158
158
  icon: e.icon
159
159
  }, t, {
160
160
  class: ["mtn-button", t.class],
161
- onClick: m
161
+ onClick: g
162
162
  }), {
163
163
  default: () => {
164
- var y;
165
- return [(y = n.default) == null ? void 0 : y.call(n)];
164
+ var d;
165
+ return (d = n.default) == null ? void 0 : d.call(n);
166
+ },
167
+ icon: () => {
168
+ var d;
169
+ return (d = n.icon) == null ? void 0 : d.call(n);
166
170
  }
167
171
  });
168
172
  }
@@ -192,16 +196,16 @@ const H = /* @__PURE__ */ _({
192
196
  type: Boolean,
193
197
  default: !1
194
198
  }
195
- }, he = /* @__PURE__ */ _({
199
+ }, Be = /* @__PURE__ */ _({
196
200
  name: "MButtonGroup",
197
201
  props: et,
198
202
  setup(e, {
199
203
  slots: n,
200
204
  attrs: t
201
205
  }) {
202
- return () => v(I, null, [e.compact ? (
206
+ return () => b(I, null, [e.compact ? (
203
207
  // 紧凑模式:按钮紧密连接
204
- v(se.Compact, S({
208
+ b(ce.Compact, S({
205
209
  size: e.size,
206
210
  direction: e.vertical ? "vertical" : "horizontal",
207
211
  block: e.block
@@ -215,7 +219,7 @@ const H = /* @__PURE__ */ _({
215
219
  })
216
220
  ) : (
217
221
  // 普通模式:按钮有间距
218
- v(se, S({
222
+ b(ce, S({
219
223
  size: typeof e.gap == "number" ? e.gap : parseInt(e.gap) || 8,
220
224
  direction: e.vertical ? "vertical" : "horizontal"
221
225
  }, t, {
@@ -284,7 +288,7 @@ const H = /* @__PURE__ */ _({
284
288
  type: String,
285
289
  default: "hide"
286
290
  }
287
- }, Y = /* @__PURE__ */ _({
291
+ }, Z = /* @__PURE__ */ _({
288
292
  name: "MDropdownButton",
289
293
  props: tt,
290
294
  emits: ["click"],
@@ -295,62 +299,62 @@ const H = /* @__PURE__ */ _({
295
299
  }) {
296
300
  const {
297
301
  shouldHide: l,
298
- shouldDisable: p
299
- } = ke({
302
+ shouldDisable: y
303
+ } = he({
300
304
  permission: e.permission,
301
305
  permissionAction: e.permissionAction
302
- }), m = Q(Z, D(J)), y = (b) => {
303
- o("click", b);
306
+ }), g = X(J, w(Q)), d = (k) => {
307
+ o("click", k);
304
308
  };
305
309
  return () => {
306
310
  if (l.value)
307
311
  return null;
308
- const b = {};
312
+ const k = {};
309
313
  if (n.overlay)
310
- b.overlay = n.overlay;
314
+ k.overlay = n.overlay;
311
315
  else if (e.menu && e.menu.length > 0) {
312
- const k = Xe(e.menu, m.value);
313
- b.overlay = () => Ee(G, {
314
- items: k
316
+ const h = Xe(e.menu, g.value);
317
+ k.overlay = () => Ee(H, {
318
+ items: h
315
319
  });
316
320
  }
317
- return n.icon && (b.icon = n.icon), !(n.default || e.text) ? v(ce, S({
321
+ return n.icon && (k.icon = n.icon), !(n.default || e.text) ? b(de, S({
318
322
  placement: e.placement,
319
323
  trigger: e.trigger
320
324
  }, t, {
321
325
  class: ["mtn-dropdown-button", t.class]
322
326
  }), {
323
- default: () => [v(ve, {
327
+ default: () => [b(be, {
324
328
  type: e.type,
325
329
  size: e.size === "middle" ? void 0 : e.size,
326
- disabled: e.disabled || p.value,
330
+ disabled: e.disabled || y.value,
327
331
  loading: e.loading,
328
332
  danger: e.danger,
329
- onClick: y
333
+ onClick: d
330
334
  }, {
331
335
  default: () => {
332
- var k;
333
- return [(k = n.icon) == null ? void 0 : k.call(n)];
336
+ var h;
337
+ return [(h = n.icon) == null ? void 0 : h.call(n)];
334
338
  }
335
339
  })],
336
- ...b
337
- }) : v(ce.Button, S({
340
+ ...k
341
+ }) : b(de.Button, S({
338
342
  type: e.type,
339
343
  size: e.size === "middle" ? void 0 : e.size,
340
- disabled: e.disabled || p.value,
344
+ disabled: e.disabled || y.value,
341
345
  loading: e.loading,
342
346
  danger: e.danger,
343
347
  placement: e.placement,
344
348
  trigger: e.trigger
345
349
  }, t, {
346
350
  class: ["mtn-dropdown-button", t.class],
347
- onClick: y
351
+ onClick: d
348
352
  }), {
349
353
  default: () => {
350
- var k;
351
- return [((k = n.default) == null ? void 0 : k.call(n)) || e.text];
354
+ var h;
355
+ return [((h = n.default) == null ? void 0 : h.call(n)) || e.text];
352
356
  },
353
- ...b
357
+ ...k
354
358
  });
355
359
  };
356
360
  }
@@ -448,7 +452,7 @@ function ot(e) {
448
452
  (n) => n.type !== Ne && n.type !== $e && n.type !== Symbol.for("v-fgt")
449
453
  ) : [];
450
454
  }
451
- function pe(e, n) {
455
+ function me(e, n) {
452
456
  var t, o;
453
457
  if (e.key !== null && e.key !== void 0)
454
458
  return typeof e.key == "symbol" ? e.key.toString() : e.key;
@@ -458,200 +462,204 @@ function pe(e, n) {
458
462
  }
459
463
  return `button-${n}`;
460
464
  }
461
- const me = "link", ye = "small", it = /* @__PURE__ */ _({
465
+ const ye = "link", ge = "small", it = /* @__PURE__ */ _({
462
466
  name: "MActionGroup",
463
467
  inheritAttrs: !1,
464
468
  __name: "action-group",
465
469
  props: nt,
466
470
  emits: ["action-click"],
467
471
  setup(e, { emit: n }) {
468
- const t = e, o = n, l = Oe(), p = D(), m = D(), y = D(), { width: b } = He(p), F = Q(Z, D(J)), k = c(() => t.mode === "table"), M = c(
469
- () => k.value ? "small" : t.size
470
- ), a = c(
471
- () => k.value ? "link" : "default"
472
- ), s = c(
473
- () => k.value ? "" : t.moreText
474
- ), P = c(() => t.moreIcon || Ue);
472
+ const t = e, o = n, l = Oe(), y = w(), g = w(), d = w(), { width: k } = He(y), G = X(J, w(Q)), h = p(() => t.mode === "table"), M = p(
473
+ () => h.value ? "small" : t.size
474
+ ), a = p(
475
+ () => h.value ? "link" : "default"
476
+ ), s = p(
477
+ () => h.value ? "" : t.moreText
478
+ ), P = p(() => t.moreIcon || Ue);
475
479
  function z(i) {
476
- return i ? F.value(i) : !0;
480
+ return i ? G.value(i) : !0;
477
481
  }
478
- const E = c(() => {
482
+ const E = p(() => {
479
483
  var i;
480
484
  return ot((i = l.default) == null ? void 0 : i.call(l));
481
- }), N = c(() => t.actions ? t.actions.filter((i) => z(i.permission)) : []), $ = c(() => {
485
+ }), N = p(() => t.actions ? t.actions.filter((i) => z(i.permission)) : []), $ = p(() => {
482
486
  if (t.disableCollapse)
483
487
  return t.actions ? N.value.length : E.value.length;
484
488
  const i = t.actions ? N.value.length : E.value.length;
485
- return i <= 1 ? i : m.value && y.value && b.value ? Se() : Math.min(t.maxItems, i);
489
+ return i <= 1 ? i : g.value && d.value && k.value ? Te() : Math.min(t.maxItems, i);
486
490
  });
487
- function Se() {
488
- if (!m.value || !y.value || !b.value)
491
+ function Te() {
492
+ if (!g.value || !d.value || !k.value)
489
493
  return t.maxItems;
490
- const i = y.value.offsetWidth, h = Array.from(
491
- m.value.querySelectorAll(".measure-item")
494
+ const i = d.value.offsetWidth, c = Array.from(
495
+ g.value.querySelectorAll(".measure-item")
492
496
  );
493
- if (h.length === 0) return t.maxItems;
494
- let r = i, d = 0;
495
- for (let C = 0; C < h.length - 1; C++) {
496
- const x = h[C].offsetWidth + t.gap;
497
- if (r + x <= b.value)
498
- r += x, d++;
497
+ if (c.length === 0) return t.maxItems;
498
+ let r = i, f = 0;
499
+ for (let C = 0; C < c.length - 1; C++) {
500
+ const x = c[C].offsetWidth + t.gap;
501
+ if (r + x <= k.value)
502
+ r += x, f++;
499
503
  else
500
504
  break;
501
505
  }
502
506
  const T = t.actions ? N.value.length : E.value.length;
503
- return Math.max(0, Math.min(d, t.maxItems, T));
507
+ return Math.max(0, Math.min(f, t.maxItems, T));
504
508
  }
505
- const Te = c(() => t.actions ? N.value.slice(0, $.value) : []), X = c(() => t.actions ? N.value.slice($.value) : []), Ce = c(() => {
509
+ const Ce = p(() => t.actions ? N.value.slice(0, $.value) : []), ee = p(() => t.actions ? N.value.slice($.value) : []), ze = p(() => {
506
510
  if (t.actions) return [];
507
511
  const i = E.value;
508
512
  return $.value >= i.length ? i : i.slice(0, $.value);
509
- }), ee = c(() => {
513
+ }), te = p(() => {
510
514
  if (t.actions) return [];
511
515
  const i = E.value;
512
516
  return $.value >= i.length ? [] : i.slice($.value);
513
- }), ze = c(() => t.actions ? X.value.filter((i) => z(i.permission)) : []), Ae = c(() => t.actions ? [] : ee.value.filter((i) => {
514
- const h = i.props || {};
515
- return h.permission && h.permissionAction === "hide" ? z(h.permission) : !0;
516
- })), Pe = c(() => t.disableCollapse ? !1 : (t.actions ? X.value.length : ee.value.length) > 0);
517
- function K(i) {
518
- return i.component || H;
517
+ }), Ae = p(() => t.actions ? ee.value.filter((i) => z(i.permission)) : []), Pe = p(() => t.actions ? [] : te.value.filter((i) => {
518
+ const c = i.props || {};
519
+ return c.permission && c.permissionAction === "hide" ? z(c.permission) : !0;
520
+ })), xe = p(() => t.disableCollapse ? !1 : (t.actions ? ee.value.length : te.value.length) > 0);
521
+ function U(i) {
522
+ return i.component || K;
519
523
  }
520
- function te(i, h) {
521
- return i.key || i.label || `action-${h}`;
524
+ function ne(i, c) {
525
+ return i.key || i.label || `action-${c}`;
522
526
  }
523
- function ne(i) {
527
+ function oe(i) {
524
528
  const {
525
- label: h,
529
+ label: c,
526
530
  key: r,
527
- onClick: d,
531
+ onClick: f,
528
532
  permission: T,
529
533
  permissionAction: C,
530
- icon: L,
534
+ icon: R,
531
535
  component: x,
532
- componentProps: R,
533
- slot: we,
534
- type: U,
535
- size: De,
536
+ componentProps: V,
537
+ slot: q,
538
+ type: O,
539
+ size: we,
536
540
  disabled: Me,
537
541
  ...Ie
538
542
  } = i;
539
543
  return {
540
544
  component: x,
541
- componentProps: R,
542
- type: U,
543
- size: De,
545
+ componentProps: V,
546
+ type: O,
547
+ size: we,
544
548
  rest: Ie,
545
549
  permission: T,
546
550
  permissionAction: C,
547
551
  disabled: Me
548
552
  };
549
553
  }
550
- function oe(i) {
551
- const { component: h, componentProps: r, type: d, rest: T, permission: C, permissionAction: L, disabled: x } = ne(i), R = {
552
- type: d || a.value,
554
+ function ie(i) {
555
+ const { component: c, componentProps: r, type: f, rest: T, permission: C, permissionAction: R, disabled: x } = oe(i), V = {
556
+ type: f || a.value,
553
557
  size: M.value,
554
- disabled: x || !z(C) && L === "disable",
558
+ disabled: x || !z(C) && R === "disable",
555
559
  ...T
556
560
  };
557
- return h && r ? { ...R, ...r } : R;
561
+ if (c && r) {
562
+ const q = (c == null ? void 0 : c.name) === "MDeleteButton" || (c == null ? void 0 : c.__name) === "MDeleteButton", O = { ...V };
563
+ return !r.type && !f && q && delete O.type, { ...O, ...r };
564
+ }
565
+ return V;
558
566
  }
559
- function xe(i) {
560
- const { component: h, componentProps: r, rest: d, permission: T, permissionAction: C, disabled: L } = ne(i), x = {
561
- type: me,
562
- size: ye,
563
- disabled: L || !z(T) && C === "disable",
564
- ...d
567
+ function De(i) {
568
+ const { component: c, componentProps: r, rest: f, permission: T, permissionAction: C, disabled: R } = oe(i), x = {
569
+ type: ye,
570
+ size: ge,
571
+ disabled: R || !z(T) && C === "disable",
572
+ ...f
565
573
  };
566
- if (h && r) {
567
- const { type: R, size: we, ...U } = r;
568
- return { ...x, ...U };
574
+ if (c && r) {
575
+ const { type: V, size: q, ...O } = r;
576
+ return { ...x, ...O };
569
577
  }
570
578
  return x;
571
579
  }
572
- function ie(i) {
580
+ function re(i) {
573
581
  i.onClick && i.onClick(i), o("action-click", i);
574
582
  }
575
- return (i, h) => (u(), w("div", {
583
+ return (i, c) => (u(), D("div", {
576
584
  ref_key: "containerRef",
577
- ref: p,
585
+ ref: y,
578
586
  class: "mtn-action-group"
579
587
  }, [
580
- v(B(he), S({
588
+ b(B(Be), S({
581
589
  size: M.value,
582
590
  compact: i.compact,
583
591
  vertical: i.vertical,
584
592
  block: i.block
585
593
  }, i.$attrs), {
586
- default: f(() => [
587
- t.actions ? (u(!0), w(I, { key: 0 }, O(Te.value, (r, d) => (u(), g(A(K(r)), S({
588
- key: te(r, d)
589
- }, { ref_for: !0 }, oe(r), {
590
- onClick: (T) => ie(r)
591
- }), j({
592
- default: f(() => [
593
- W(" " + q(r.label), 1)
594
+ default: m(() => [
595
+ t.actions ? (u(!0), D(I, { key: 0 }, L(Ce.value, (r, f) => (u(), v(A(U(r)), S({
596
+ key: ne(r, f)
597
+ }, { ref_for: !0 }, ie(r), {
598
+ onClick: (T) => re(r)
599
+ }), W({
600
+ default: m(() => [
601
+ F(" " + Y(r.label), 1)
594
602
  ]),
595
603
  _: 2
596
604
  }, [
597
- r.icon && !r.component ? {
605
+ r.icon ? {
598
606
  name: "icon",
599
- fn: f(() => [
600
- (u(), g(A(r.icon)))
607
+ fn: m(() => [
608
+ (u(), v(A(r.icon)))
601
609
  ]),
602
610
  key: "0"
603
611
  } : void 0
604
- ]), 1040, ["onClick"]))), 128)) : (u(!0), w(I, { key: 1 }, O(Ce.value, (r, d) => {
612
+ ]), 1040, ["onClick"]))), 128)) : (u(!0), D(I, { key: 1 }, L(ze.value, (r, f) => {
605
613
  var T, C;
606
- return u(), g(A(ae(r, {
607
- type: ((T = r.props) == null ? void 0 : T.type) ?? (k.value ? a.value : void 0),
614
+ return u(), v(A(le(r, {
615
+ type: ((T = r.props) == null ? void 0 : T.type) ?? (h.value ? a.value : void 0),
608
616
  size: ((C = r.props) == null ? void 0 : C.size) ?? M.value
609
617
  })), {
610
- key: B(pe)(r, d)
618
+ key: B(me)(r, f)
611
619
  });
612
620
  }), 128)),
613
- Pe.value ? (u(), g(B(Y), S({
621
+ xe.value ? (u(), v(B(Z), S({
614
622
  key: 2,
615
623
  text: s.value,
616
624
  size: M.value,
617
625
  type: a.value
618
626
  }, t.moreProps), {
619
- icon: f(() => [
620
- (u(), g(A(P.value)))
627
+ icon: m(() => [
628
+ (u(), v(A(P.value)))
621
629
  ]),
622
- overlay: f(() => [
623
- v(B(G), null, {
624
- default: f(() => [
625
- t.actions ? (u(!0), w(I, { key: 0 }, O(ze.value, (r, d) => (u(), g(B(G).Item, {
626
- key: te(r, d)
630
+ overlay: m(() => [
631
+ b(B(H), null, {
632
+ default: m(() => [
633
+ t.actions ? (u(!0), D(I, { key: 0 }, L(Ae.value, (r, f) => (u(), v(B(H).Item, {
634
+ key: ne(r, f)
627
635
  }, {
628
- default: f(() => [
629
- (u(), g(A(K(r)), S({ ref_for: !0 }, xe(r), {
630
- onClick: (T) => ie(r)
631
- }), j({
632
- default: f(() => [
633
- W(" " + q(r.label), 1)
636
+ default: m(() => [
637
+ (u(), v(A(U(r)), S({ ref_for: !0 }, De(r), {
638
+ onClick: (T) => re(r)
639
+ }), W({
640
+ default: m(() => [
641
+ F(" " + Y(r.label), 1)
634
642
  ]),
635
643
  _: 2
636
644
  }, [
637
- r.icon && !r.component ? {
645
+ r.icon ? {
638
646
  name: "icon",
639
- fn: f(() => [
640
- (u(), g(A(r.icon)))
647
+ fn: m(() => [
648
+ (u(), v(A(r.icon)))
641
649
  ]),
642
650
  key: "0"
643
651
  } : void 0
644
652
  ]), 1040, ["onClick"]))
645
653
  ]),
646
654
  _: 2
647
- }, 1024))), 128)) : (u(!0), w(I, { key: 1 }, O(Ae.value, (r, d) => (u(), g(B(G).Item, {
648
- key: B(pe)(r, d)
655
+ }, 1024))), 128)) : (u(!0), D(I, { key: 1 }, L(Pe.value, (r, f) => (u(), v(B(H).Item, {
656
+ key: B(me)(r, f)
649
657
  }, {
650
- default: f(() => [
651
- (u(), g(A(ae(r, {
658
+ default: m(() => [
659
+ (u(), v(A(le(r, {
652
660
  ...r.props,
653
- type: me,
654
- size: ye
661
+ type: ye,
662
+ size: ge
655
663
  }))))
656
664
  ]),
657
665
  _: 2
@@ -665,47 +673,47 @@ const me = "link", ye = "small", it = /* @__PURE__ */ _({
665
673
  ]),
666
674
  _: 1
667
675
  }, 16, ["size", "compact", "vertical", "block"]),
668
- re("div", {
676
+ ae("div", {
669
677
  ref_key: "measureRef",
670
- ref: m,
678
+ ref: g,
671
679
  class: "mtn-action-group-measure"
672
680
  }, [
673
- t.actions ? (u(!0), w(I, { key: 0 }, O(N.value, (r, d) => (u(), w("span", {
674
- key: d,
681
+ t.actions ? (u(!0), D(I, { key: 0 }, L(N.value, (r, f) => (u(), D("span", {
682
+ key: f,
675
683
  class: "measure-item"
676
684
  }, [
677
- (u(), g(A(K(r)), S({ ref_for: !0 }, oe(r)), j({
678
- default: f(() => [
679
- W(" " + q(r.label), 1)
685
+ (u(), v(A(U(r)), S({ ref_for: !0 }, ie(r)), W({
686
+ default: m(() => [
687
+ F(" " + Y(r.label), 1)
680
688
  ]),
681
689
  _: 2
682
690
  }, [
683
- r.icon && !r.component ? {
691
+ r.icon ? {
684
692
  name: "icon",
685
- fn: f(() => [
686
- (u(), g(A(r.icon)))
693
+ fn: m(() => [
694
+ (u(), v(A(r.icon)))
687
695
  ]),
688
696
  key: "0"
689
697
  } : void 0
690
698
  ]), 1040))
691
- ]))), 128)) : (u(!0), w(I, { key: 1 }, O(E.value, (r, d) => (u(), w("span", {
692
- key: d,
699
+ ]))), 128)) : (u(!0), D(I, { key: 1 }, L(E.value, (r, f) => (u(), D("span", {
700
+ key: f,
693
701
  class: "measure-item"
694
702
  }, [
695
- (u(), g(A(r)))
703
+ (u(), v(A(r)))
696
704
  ]))), 128)),
697
- re("span", {
705
+ ae("span", {
698
706
  ref_key: "moreTriggerRef",
699
- ref: y,
707
+ ref: d,
700
708
  class: "measure-item"
701
709
  }, [
702
- v(B(Y), {
710
+ b(B(Z), {
703
711
  text: s.value,
704
712
  size: M.value,
705
713
  type: a.value
706
714
  }, {
707
- icon: f(() => [
708
- (u(), g(A(P.value)))
715
+ icon: m(() => [
716
+ (u(), v(A(P.value)))
709
717
  ]),
710
718
  _: 1
711
719
  }, 8, ["text", "size", "type"])
@@ -713,14 +721,14 @@ const me = "link", ye = "small", it = /* @__PURE__ */ _({
713
721
  ], 512)
714
722
  ], 512));
715
723
  }
716
- }), Be = (e, n) => {
724
+ }), Se = (e, n) => {
717
725
  const t = e.__vccOpts || e;
718
726
  for (const [o, l] of n)
719
727
  t[o] = l;
720
728
  return t;
721
- }, rt = /* @__PURE__ */ Be(it, [["__scopeId", "data-v-b8d47218"]]), at = {
729
+ }, rt = /* @__PURE__ */ Se(it, [["__scopeId", "data-v-6b35de38"]]), at = {
722
730
  // 继承 Button 的所有 props
723
- ...be,
731
+ ...ke,
724
732
  // 覆盖 loading prop,使其默认值为 undefined,以便自动 loading 功能正常工作
725
733
  loading: {
726
734
  type: Boolean,
@@ -803,18 +811,18 @@ const me = "link", ye = "small", it = /* @__PURE__ */ _({
803
811
  props: at,
804
812
  emits: ["delete", "success", "error"],
805
813
  setup(e, { emit: n }) {
806
- const t = n, o = e, l = D(!1), p = D(null), m = c(() => o.loading !== void 0 ? o.loading : o.autoLoading ? l.value : !1), y = c(() => typeof o.confirm == "function" ? o.confirm(o.count) : o.confirm);
807
- le(m, (a) => {
808
- p.value && ue(() => {
814
+ const t = n, o = e, l = w(!1), y = w(null), g = p(() => o.loading !== void 0 ? o.loading : o.autoLoading ? l.value : !1), d = p(() => typeof o.confirm == "function" ? o.confirm(o.count) : o.confirm);
815
+ ue(g, (a) => {
816
+ y.value && se(() => {
809
817
  var s;
810
- (s = p.value) == null || s.update({
818
+ (s = y.value) == null || s.update({
811
819
  okButtonProps: { loading: a }
812
820
  });
813
821
  });
814
822
  }, { flush: "post" }), Re(() => {
815
- p.value && (p.value.destroy(), p.value = null);
823
+ y.value && (y.value.destroy(), y.value = null);
816
824
  });
817
- const b = async () => {
825
+ const k = async () => {
818
826
  try {
819
827
  if (o.beforeDelete && await o.beforeDelete() === !1)
820
828
  return;
@@ -828,7 +836,7 @@ const me = "link", ye = "small", it = /* @__PURE__ */ _({
828
836
  if (P && typeof P.then == "function")
829
837
  try {
830
838
  const z = await P;
831
- a || s(), F(z);
839
+ a || s(), G(z);
832
840
  } catch (z) {
833
841
  throw a || s(), z;
834
842
  }
@@ -839,32 +847,32 @@ const me = "link", ye = "small", it = /* @__PURE__ */ _({
839
847
  } catch (a) {
840
848
  o.autoLoading && o.loading === void 0 && (l.value = !1);
841
849
  const s = a instanceof Error ? a : new Error(String(a));
842
- t("error", s), o.showError && de.error(s.message || "删除失败,请重试");
850
+ t("error", s), o.showError && fe.error(s.message || "删除失败,请重试");
843
851
  }
844
- }, F = (a) => {
845
- o.showSuccess && de.success(o.successText || "删除成功"), t("success", a);
846
- }, k = o.debounce > 0 ? Ke(b, o.debounce) : b, M = () => {
847
- if (!y.value) {
848
- k();
852
+ }, G = (a) => {
853
+ o.showSuccess && fe.success(o.successText || "删除成功"), t("success", a);
854
+ }, h = o.debounce > 0 ? Ke(k, o.debounce) : k, M = () => {
855
+ if (!d.value) {
856
+ h();
849
857
  return;
850
858
  }
851
859
  if (o.confirmType === "popconfirm") return;
852
- ue(() => {
853
- p.value = Fe.confirm({
860
+ se(() => {
861
+ y.value = Fe.confirm({
854
862
  title: o.confirmTitle,
855
- content: y.value,
863
+ content: d.value,
856
864
  okText: o.okText,
857
865
  cancelText: o.cancelText,
858
866
  okType: "danger",
859
- okButtonProps: { loading: m.value },
867
+ okButtonProps: { loading: g.value },
860
868
  onOk: async () => {
861
869
  try {
862
- return await b(), new Promise((s) => {
863
- if (!m.value) {
870
+ return await k(), new Promise((s) => {
871
+ if (!g.value) {
864
872
  s();
865
873
  return;
866
874
  }
867
- const P = le(m, (z) => {
875
+ const P = ue(g, (z) => {
868
876
  z || (P(), s());
869
877
  });
870
878
  });
@@ -873,50 +881,50 @@ const me = "link", ye = "small", it = /* @__PURE__ */ _({
873
881
  }
874
882
  },
875
883
  onCancel: () => {
876
- p.value = null;
884
+ y.value = null;
877
885
  },
878
886
  afterClose: () => {
879
- p.value = null;
887
+ y.value = null;
880
888
  }
881
889
  });
882
890
  });
883
891
  };
884
- return (a, s) => y.value && a.confirmType === "popconfirm" ? (u(), g(B(We), {
892
+ return (a, s) => d.value && a.confirmType === "popconfirm" ? (u(), v(B(We), {
885
893
  key: 0,
886
- title: y.value,
894
+ title: d.value,
887
895
  "ok-text": a.okText,
888
896
  "cancel-text": a.cancelText,
889
- "ok-button-props": { loading: m.value, danger: !0 },
890
- onConfirm: B(k)
897
+ "ok-button-props": { loading: g.value, danger: !0 },
898
+ onConfirm: B(h)
891
899
  }, {
892
- icon: f(() => [
893
- V(a.$slots, "popconfirmIcon", {}, () => [
894
- v(B(qe), { class: "text-[--color-ant-error]" })
900
+ icon: m(() => [
901
+ j(a.$slots, "popconfirmIcon", {}, () => [
902
+ b(B(qe), { class: "text-[--color-ant-error]" })
895
903
  ], !0)
896
904
  ]),
897
- default: f(() => [
898
- v(B(H), S(a.$attrs, {
905
+ default: m(() => [
906
+ b(B(K), S(a.$attrs, {
899
907
  type: a.type,
900
908
  size: a.size,
901
909
  danger: !0,
902
- loading: m.value,
910
+ loading: g.value,
903
911
  disabled: a.disabled,
904
912
  permission: a.permission,
905
913
  "permission-action": a.permissionAction,
906
914
  class: "group"
907
- }), j({
908
- default: f(() => [
909
- V(a.$slots, "default", {}, () => [
910
- s[0] || (s[0] = W("删除", -1))
915
+ }), W({
916
+ default: m(() => [
917
+ j(a.$slots, "default", {}, () => [
918
+ s[0] || (s[0] = F("删除", -1))
911
919
  ], !0)
912
920
  ]),
913
921
  _: 2
914
922
  }, [
915
923
  a.hideIcon ? void 0 : {
916
924
  name: "icon",
917
- fn: f(() => [
918
- V(a.$slots, "icon", {}, () => [
919
- v(B(fe))
925
+ fn: m(() => [
926
+ j(a.$slots, "icon", {}, () => [
927
+ b(B(pe))
920
928
  ], !0)
921
929
  ]),
922
930
  key: "0"
@@ -924,35 +932,35 @@ const me = "link", ye = "small", it = /* @__PURE__ */ _({
924
932
  ]), 1040, ["type", "size", "loading", "disabled", "permission", "permission-action"])
925
933
  ]),
926
934
  _: 3
927
- }, 8, ["title", "ok-text", "cancel-text", "ok-button-props", "onConfirm"])) : (u(), g(B(H), S({ key: 1 }, a.$attrs, {
935
+ }, 8, ["title", "ok-text", "cancel-text", "ok-button-props", "onConfirm"])) : (u(), v(B(K), S({ key: 1 }, a.$attrs, {
928
936
  type: a.type,
929
937
  size: a.size,
930
938
  danger: !0,
931
- loading: m.value,
939
+ loading: g.value,
932
940
  disabled: a.disabled,
933
941
  permission: a.permission,
934
942
  "permission-action": a.permissionAction,
935
943
  onClick: M
936
- }), j({
937
- default: f(() => [
938
- V(a.$slots, "default", {}, () => [
939
- s[1] || (s[1] = W("删除", -1))
944
+ }), W({
945
+ default: m(() => [
946
+ j(a.$slots, "default", {}, () => [
947
+ s[1] || (s[1] = F("删除", -1))
940
948
  ], !0)
941
949
  ]),
942
950
  _: 2
943
951
  }, [
944
952
  a.hideIcon ? void 0 : {
945
953
  name: "icon",
946
- fn: f(() => [
947
- V(a.$slots, "icon", {}, () => [
948
- v(B(fe))
954
+ fn: m(() => [
955
+ j(a.$slots, "icon", {}, () => [
956
+ b(B(pe))
949
957
  ], !0)
950
958
  ]),
951
959
  key: "0"
952
960
  }
953
961
  ]), 1040, ["type", "size", "loading", "disabled", "permission", "permission-action"]));
954
962
  }
955
- }), ut = /* @__PURE__ */ Be(lt, [["__scopeId", "data-v-a943bc19"]]), st = {
963
+ }), ut = /* @__PURE__ */ Se(lt, [["__scopeId", "data-v-a943bc19"]]), st = {
956
964
  // 继承 antd 的所有 props
957
965
  columns: {
958
966
  type: Array,
@@ -994,13 +1002,13 @@ const dt = /* @__PURE__ */ _({
994
1002
  slots: n,
995
1003
  attrs: t
996
1004
  }) {
997
- return () => v(Ge, S(e, t, {
1005
+ return () => b(Ge, S(e, t, {
998
1006
  class: "mtn-table"
999
1007
  }), ct(n) ? n : {
1000
1008
  default: () => [n]
1001
1009
  });
1002
1010
  }
1003
- }), ft = ge(dt), pt = [H, he, Y, rt, ut, Qe, ft], ht = {
1011
+ }), ft = ve(dt), pt = [K, Be, Z, rt, ut, Qe, ft], ht = {
1004
1012
  install(e) {
1005
1013
  pt.forEach((n) => {
1006
1014
  e.component(n.name || "", n);
@@ -1009,10 +1017,10 @@ const dt = /* @__PURE__ */ _({
1009
1017
  };
1010
1018
  export {
1011
1019
  rt as ActionGroup,
1012
- H as Button,
1013
- he as ButtonGroup,
1020
+ K as Button,
1021
+ Be as ButtonGroup,
1014
1022
  ut as DeleteButton,
1015
- Y as DropdownButton,
1023
+ Z as DropdownButton,
1016
1024
  ft as Table,
1017
1025
  Qe as Tag,
1018
1026
  et as buttonGroupProps,