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