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