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