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