@mtn-ui/components 1.0.7 → 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 +60 -57
- 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 +269 -307
- package/package.json +1 -1
- 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 tt = {
|
|
|
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,26 +26,26 @@ const tt = {
|
|
|
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 () => {
|
|
36
37
|
var l;
|
|
37
38
|
const {
|
|
38
|
-
type:
|
|
39
|
+
type: o
|
|
39
40
|
} = e;
|
|
40
|
-
return
|
|
41
|
-
class:
|
|
42
|
-
type:
|
|
41
|
+
return S("span", {
|
|
42
|
+
class: Re(tt({
|
|
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 tt = {
|
|
|
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
|
+
shouldHide: v,
|
|
113
114
|
shouldDisable: m
|
|
114
115
|
};
|
|
115
116
|
}
|
|
116
|
-
function rt(e,
|
|
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 rt(e, o) {
|
|
|
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
|
-
emit:
|
|
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
|
}), m = (f) => {
|
|
146
|
-
|
|
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,
|
|
@@ -162,15 +163,15 @@ const Q = /* @__PURE__ */ N({
|
|
|
162
163
|
}), {
|
|
163
164
|
default: () => {
|
|
164
165
|
var f;
|
|
165
|
-
return (f =
|
|
166
|
+
return (f = r.default) == null ? void 0 : f.call(r);
|
|
166
167
|
},
|
|
167
168
|
icon: () => {
|
|
168
169
|
var f;
|
|
169
|
-
return (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 Q = /* @__PURE__ */ N({
|
|
|
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
|
|
@@ -213,26 +214,26 @@ const Q = /* @__PURE__ */ N({
|
|
|
213
214
|
class: ["mtn-button-group", "mtn-button-group--compact", t.class]
|
|
214
215
|
}), {
|
|
215
216
|
default: () => {
|
|
216
|
-
var
|
|
217
|
-
return [(
|
|
217
|
+
var 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, {
|
|
226
227
|
class: ["mtn-button-group", "mtn-button-group--normal", t.class]
|
|
227
228
|
}), {
|
|
228
229
|
default: () => {
|
|
229
|
-
var
|
|
230
|
-
return [(
|
|
230
|
+
var 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,60 +289,60 @@ const Q = /* @__PURE__ */ N({
|
|
|
288
289
|
type: String,
|
|
289
290
|
default: "hide"
|
|
290
291
|
}
|
|
291
|
-
}, oe = /* @__PURE__ */
|
|
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
|
-
emit:
|
|
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
|
-
}), m = ae(
|
|
307
|
-
|
|
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
317
|
const B = rt(e.menu, m.value);
|
|
317
|
-
|
|
318
|
+
g.overlay = () => Ge(q, {
|
|
318
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
334
|
onClick: f
|
|
334
335
|
}, {
|
|
335
336
|
default: () => {
|
|
336
337
|
var B;
|
|
337
|
-
return [(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,
|
|
@@ -352,13 +353,13 @@ const Q = /* @__PURE__ */ N({
|
|
|
352
353
|
}), {
|
|
353
354
|
default: () => {
|
|
354
355
|
var B;
|
|
355
|
-
return [((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,47 +448,50 @@ const Q = /* @__PURE__ */ N({
|
|
|
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 Se(e,
|
|
456
|
-
var t,
|
|
456
|
+
function Se(e, r) {
|
|
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;
|
|
459
|
-
if (((t = e.props) == null ? void 0 : t.key) !== null && ((
|
|
460
|
+
if (((t = e.props) == null ? void 0 : t.key) !== null && ((o = e.props) == null ? void 0 : o.key) !== void 0) {
|
|
460
461
|
const l = e.props.key;
|
|
461
462
|
return typeof l == "symbol" ? l.toString() : l;
|
|
462
463
|
}
|
|
463
|
-
return `button-${
|
|
464
|
+
return `button-${r}`;
|
|
464
465
|
}
|
|
465
|
-
const ne = "link", Be = "small",
|
|
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,
|
|
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));
|
|
473
474
|
function B(n) {
|
|
474
475
|
if (!n) return;
|
|
475
476
|
const c = n;
|
|
476
477
|
return c.name || c.__name || c.displayName;
|
|
477
478
|
}
|
|
478
|
-
const
|
|
479
|
-
() =>
|
|
479
|
+
const M = p(() => t.mode === "table"), a = p(
|
|
480
|
+
() => M.value ? "small" : t.size
|
|
480
481
|
), u = p(
|
|
481
|
-
() =>
|
|
482
|
+
() => M.value ? "link" : "default"
|
|
482
483
|
), A = p(
|
|
483
|
-
() =>
|
|
484
|
-
),
|
|
485
|
-
function
|
|
486
|
-
return n ?
|
|
484
|
+
() => M.value ? "" : t.moreText
|
|
485
|
+
), I = p(() => t.moreIcon || Je);
|
|
486
|
+
function F(n) {
|
|
487
|
+
return n ? H.value(n) : !0;
|
|
487
488
|
}
|
|
488
|
-
const
|
|
489
|
+
const W = p(() => {
|
|
490
|
+
var n;
|
|
491
|
+
return ut((n = l.default) == null ? void 0 : n.call(l));
|
|
492
|
+
}), _ = He([]);
|
|
489
493
|
function le(n) {
|
|
490
|
-
var
|
|
494
|
+
var i, d, h;
|
|
491
495
|
return [
|
|
492
496
|
n.key ?? "",
|
|
493
497
|
n.label ?? "",
|
|
@@ -496,77 +500,77 @@ const ne = "link", Be = "small", ct = 150, dt = /* @__PURE__ */ N({
|
|
|
496
500
|
Array.isArray(n.permission) ? n.permission.join(",") : n.permission ?? "",
|
|
497
501
|
n.permissionAction ?? "",
|
|
498
502
|
String(n.disabled ?? !1),
|
|
499
|
-
String(((
|
|
503
|
+
String(((i = n.componentProps) == null ? void 0 : i.confirm) ?? ""),
|
|
500
504
|
String(((d = n.componentProps) == null ? void 0 : d.showSuccess) ?? ""),
|
|
501
|
-
String(((
|
|
505
|
+
String(((h = n.componentProps) == null ? void 0 : h.danger) ?? "")
|
|
502
506
|
].join("|");
|
|
503
507
|
}
|
|
504
|
-
|
|
508
|
+
Z(
|
|
505
509
|
() => t.actions,
|
|
506
510
|
(n) => {
|
|
507
511
|
if (!n) {
|
|
508
|
-
|
|
512
|
+
_.value = [];
|
|
509
513
|
return;
|
|
510
514
|
}
|
|
511
|
-
if (
|
|
512
|
-
|
|
515
|
+
if (_.value.length !== n.length) {
|
|
516
|
+
_.value = n;
|
|
513
517
|
return;
|
|
514
518
|
}
|
|
515
|
-
const c = n.map(le).join("||"),
|
|
516
|
-
c !==
|
|
519
|
+
const c = n.map(le).join("||"), i = _.value.map(le).join("||");
|
|
520
|
+
c !== i && (_.value = n);
|
|
517
521
|
},
|
|
518
522
|
{ immediate: !0, deep: !1 }
|
|
519
523
|
);
|
|
520
|
-
const K = p(() =>
|
|
521
|
-
function
|
|
522
|
-
if (!m.value || !f.value || !
|
|
523
|
-
return Math.min(t.maxItems,
|
|
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);
|
|
524
528
|
const n = f.value.offsetWidth, c = Array.from(
|
|
525
529
|
m.value.querySelectorAll(".measure-item")
|
|
526
530
|
);
|
|
527
|
-
if (c.length === 0) return Math.min(t.maxItems,
|
|
528
|
-
let
|
|
529
|
-
for (let
|
|
530
|
-
const w = c[
|
|
531
|
-
if (
|
|
532
|
-
|
|
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++;
|
|
533
537
|
else
|
|
534
538
|
break;
|
|
535
539
|
}
|
|
536
|
-
return Math.max(0, Math.min(d, t.maxItems,
|
|
540
|
+
return Math.max(0, Math.min(d, t.maxItems, C.value));
|
|
537
541
|
}
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
},
|
|
541
|
-
|
|
542
|
-
[
|
|
542
|
+
const $ = D(t.maxItems), Ie = ze(() => {
|
|
543
|
+
$.value = De();
|
|
544
|
+
}, st);
|
|
545
|
+
Z(
|
|
546
|
+
[g, C, () => t.maxItems, () => t.gap],
|
|
543
547
|
() => {
|
|
544
548
|
if (t.disableCollapse) {
|
|
545
|
-
|
|
549
|
+
$.value = C.value;
|
|
546
550
|
return;
|
|
547
551
|
}
|
|
548
|
-
if (
|
|
549
|
-
|
|
552
|
+
if (C.value <= 1) {
|
|
553
|
+
$.value = C.value;
|
|
550
554
|
return;
|
|
551
555
|
}
|
|
552
|
-
m.value && f.value &&
|
|
556
|
+
m.value && f.value && g.value ? Ie() : $.value = Math.min(t.maxItems, C.value);
|
|
553
557
|
},
|
|
554
558
|
{ immediate: !0 }
|
|
555
559
|
);
|
|
556
|
-
const
|
|
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(() => {
|
|
557
561
|
if (t.actions) return [];
|
|
558
|
-
const n =
|
|
559
|
-
return
|
|
562
|
+
const n = W.value;
|
|
563
|
+
return N.value >= n.length ? n : n.slice(0, N.value);
|
|
560
564
|
}), se = p(() => {
|
|
561
565
|
if (t.actions) return [];
|
|
562
|
-
const n =
|
|
563
|
-
return
|
|
564
|
-
}),
|
|
566
|
+
const n = W.value;
|
|
567
|
+
return N.value >= n.length ? [] : n.slice(N.value);
|
|
568
|
+
}), we = p(() => t.actions ? [] : se.value.filter((n) => {
|
|
565
569
|
const c = n.props || {};
|
|
566
|
-
return c.permission && c.permissionAction === "hide" ?
|
|
567
|
-
})),
|
|
568
|
-
function
|
|
569
|
-
return n.component ||
|
|
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;
|
|
570
574
|
}
|
|
571
575
|
function ce(n, c) {
|
|
572
576
|
return n.key || n.label || `action-${c}`;
|
|
@@ -574,137 +578,137 @@ const ne = "link", Be = "small", ct = 150, dt = /* @__PURE__ */ N({
|
|
|
574
578
|
function de(n) {
|
|
575
579
|
const {
|
|
576
580
|
label: c,
|
|
577
|
-
key:
|
|
581
|
+
key: i,
|
|
578
582
|
onClick: d,
|
|
579
|
-
permission:
|
|
583
|
+
permission: h,
|
|
580
584
|
permissionAction: P,
|
|
581
585
|
icon: w,
|
|
582
|
-
component:
|
|
583
|
-
componentProps:
|
|
586
|
+
component: L,
|
|
587
|
+
componentProps: G,
|
|
584
588
|
slot: Y,
|
|
585
589
|
type: ee,
|
|
586
|
-
size:
|
|
587
|
-
disabled:
|
|
588
|
-
...
|
|
590
|
+
size: X,
|
|
591
|
+
disabled: Le,
|
|
592
|
+
...Oe
|
|
589
593
|
} = n;
|
|
590
594
|
return {
|
|
591
|
-
component:
|
|
592
|
-
componentProps:
|
|
595
|
+
component: L,
|
|
596
|
+
componentProps: G,
|
|
593
597
|
type: ee,
|
|
594
|
-
size:
|
|
595
|
-
rest:
|
|
596
|
-
permission:
|
|
598
|
+
size: X,
|
|
599
|
+
rest: Oe,
|
|
600
|
+
permission: h,
|
|
597
601
|
permissionAction: P,
|
|
598
|
-
disabled:
|
|
602
|
+
disabled: Le
|
|
599
603
|
};
|
|
600
604
|
}
|
|
601
605
|
function fe(n) {
|
|
602
|
-
const { component: c, componentProps:
|
|
606
|
+
const { component: c, componentProps: i, type: d, rest: h, permission: P, permissionAction: w, disabled: L } = de(n), G = {
|
|
603
607
|
type: d || u.value,
|
|
604
608
|
size: a.value,
|
|
605
|
-
disabled:
|
|
606
|
-
...
|
|
609
|
+
disabled: L || !F(P) && w === "disable",
|
|
610
|
+
...h
|
|
607
611
|
};
|
|
608
|
-
if (c &&
|
|
609
|
-
const Y = { ...
|
|
610
|
-
return
|
|
612
|
+
if (c && i) {
|
|
613
|
+
const Y = { ...G, ...i };
|
|
614
|
+
return M.value && (Y.type = "link"), Y;
|
|
611
615
|
}
|
|
612
|
-
return
|
|
616
|
+
return G;
|
|
613
617
|
}
|
|
614
|
-
function
|
|
615
|
-
const { component: c, componentProps:
|
|
618
|
+
function Ne(n) {
|
|
619
|
+
const { component: c, componentProps: i, rest: d, permission: h, permissionAction: P, disabled: w } = de(n), L = {
|
|
616
620
|
type: ne,
|
|
617
621
|
size: Be,
|
|
618
|
-
disabled: w || !
|
|
622
|
+
disabled: w || !F(h) && P === "disable",
|
|
619
623
|
...d
|
|
620
624
|
};
|
|
621
|
-
if (c &&
|
|
622
|
-
const { type:
|
|
623
|
-
return
|
|
625
|
+
if (c && i) {
|
|
626
|
+
const { type: G, size: Y, ...ee } = i, X = { ...L, ...ee };
|
|
627
|
+
return X.type = ne, X;
|
|
624
628
|
}
|
|
625
|
-
return
|
|
629
|
+
return L;
|
|
626
630
|
}
|
|
627
631
|
function pe(n) {
|
|
628
|
-
n.onClick && n.onClick(n),
|
|
632
|
+
n.onClick && n.onClick(n), o("action-click", n);
|
|
629
633
|
}
|
|
630
634
|
return (n, c) => (s(), x("div", {
|
|
631
635
|
ref_key: "containerRef",
|
|
632
|
-
ref:
|
|
636
|
+
ref: v,
|
|
633
637
|
class: "mtn-action-group"
|
|
634
638
|
}, [
|
|
635
|
-
|
|
639
|
+
S(b(Pe), z({
|
|
636
640
|
size: a.value,
|
|
637
641
|
compact: n.compact,
|
|
638
642
|
vertical: n.vertical,
|
|
639
643
|
block: n.block
|
|
640
644
|
}, n.$attrs), {
|
|
641
645
|
default: y(() => [
|
|
642
|
-
t.actions ? (s(!0), x(E, { key: 0 },
|
|
643
|
-
key: ce(
|
|
644
|
-
}, { ref_for: !0 }, fe(
|
|
645
|
-
onClick: (
|
|
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)
|
|
646
650
|
}), U({
|
|
647
651
|
default: y(() => [
|
|
648
|
-
|
|
652
|
+
j(" " + te(i.label), 1)
|
|
649
653
|
]),
|
|
650
654
|
_: 2
|
|
651
655
|
}, [
|
|
652
|
-
|
|
656
|
+
i.icon ? {
|
|
653
657
|
name: "icon",
|
|
654
658
|
fn: y(() => [
|
|
655
|
-
(s(), k(
|
|
659
|
+
(s(), k(T(i.icon)))
|
|
656
660
|
]),
|
|
657
661
|
key: "0"
|
|
658
662
|
} : void 0
|
|
659
|
-
]), 1040, ["onClick"]))), 128)) : (s(!0), x(E, { key: 1 },
|
|
660
|
-
var
|
|
661
|
-
return s(), k(
|
|
662
|
-
type: ((
|
|
663
|
-
size: ((P =
|
|
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
|
|
664
668
|
})), {
|
|
665
|
-
key:
|
|
669
|
+
key: b(Se)(i, d)
|
|
666
670
|
});
|
|
667
671
|
}), 128)),
|
|
668
|
-
|
|
672
|
+
Ee.value ? (s(), k(b(oe), z({
|
|
669
673
|
key: 2,
|
|
670
674
|
text: A.value,
|
|
671
675
|
size: a.value,
|
|
672
676
|
type: u.value
|
|
673
677
|
}, t.moreProps), {
|
|
674
678
|
icon: y(() => [
|
|
675
|
-
(s(), k(
|
|
679
|
+
(s(), k(T(I.value)))
|
|
676
680
|
]),
|
|
677
681
|
overlay: y(() => [
|
|
678
|
-
|
|
682
|
+
S(b(q), null, {
|
|
679
683
|
default: y(() => [
|
|
680
|
-
t.actions ? (s(!0), x(E, { key: 0 },
|
|
681
|
-
key: ce(
|
|
684
|
+
t.actions ? (s(!0), x(E, { key: 0 }, O(ue.value, (i, d) => (s(), k(b(q).Item, {
|
|
685
|
+
key: ce(i, d)
|
|
682
686
|
}, {
|
|
683
687
|
default: y(() => [
|
|
684
|
-
(s(), k(
|
|
685
|
-
onClick: (
|
|
688
|
+
(s(), k(T(Q(i)), z({ ref_for: !0 }, Ne(i), {
|
|
689
|
+
onClick: (h) => pe(i)
|
|
686
690
|
}), U({
|
|
687
691
|
default: y(() => [
|
|
688
|
-
|
|
692
|
+
j(" " + te(i.label), 1)
|
|
689
693
|
]),
|
|
690
694
|
_: 2
|
|
691
695
|
}, [
|
|
692
|
-
|
|
696
|
+
i.icon ? {
|
|
693
697
|
name: "icon",
|
|
694
698
|
fn: y(() => [
|
|
695
|
-
(s(), k(
|
|
699
|
+
(s(), k(T(i.icon)))
|
|
696
700
|
]),
|
|
697
701
|
key: "0"
|
|
698
702
|
} : void 0
|
|
699
703
|
]), 1040, ["onClick"]))
|
|
700
704
|
]),
|
|
701
705
|
_: 2
|
|
702
|
-
}, 1024))), 128)) : (s(!0), x(E, { key: 1 },
|
|
703
|
-
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)
|
|
704
708
|
}, {
|
|
705
709
|
default: y(() => [
|
|
706
|
-
(s(), k(
|
|
707
|
-
...
|
|
710
|
+
(s(), k(T(ye(i, {
|
|
711
|
+
...i.props,
|
|
708
712
|
type: ne,
|
|
709
713
|
size: Be
|
|
710
714
|
}))))
|
|
@@ -716,7 +720,7 @@ const ne = "link", Be = "small", ct = 150, dt = /* @__PURE__ */ N({
|
|
|
716
720
|
})
|
|
717
721
|
]),
|
|
718
722
|
_: 1
|
|
719
|
-
}, 16, ["text", "size", "type"])) :
|
|
723
|
+
}, 16, ["text", "size", "type"])) : Fe("", !0)
|
|
720
724
|
]),
|
|
721
725
|
_: 1
|
|
722
726
|
}, 16, ["size", "compact", "vertical", "block"]),
|
|
@@ -725,42 +729,42 @@ const ne = "link", Be = "small", ct = 150, dt = /* @__PURE__ */ N({
|
|
|
725
729
|
ref: m,
|
|
726
730
|
class: "mtn-action-group-measure"
|
|
727
731
|
}, [
|
|
728
|
-
t.actions ? (s(!0), x(E, { key: 0 },
|
|
732
|
+
t.actions ? (s(!0), x(E, { key: 0 }, O(K.value, (i, d) => (s(), x("span", {
|
|
729
733
|
key: d,
|
|
730
734
|
class: "measure-item"
|
|
731
735
|
}, [
|
|
732
|
-
(s(), k(
|
|
736
|
+
(s(), k(T(Q(i)), z({ ref_for: !0 }, fe(i)), U({
|
|
733
737
|
default: y(() => [
|
|
734
|
-
|
|
738
|
+
j(" " + te(i.label), 1)
|
|
735
739
|
]),
|
|
736
740
|
_: 2
|
|
737
741
|
}, [
|
|
738
|
-
|
|
742
|
+
i.icon ? {
|
|
739
743
|
name: "icon",
|
|
740
744
|
fn: y(() => [
|
|
741
|
-
(s(), k(
|
|
745
|
+
(s(), k(T(i.icon)))
|
|
742
746
|
]),
|
|
743
747
|
key: "0"
|
|
744
748
|
} : void 0
|
|
745
749
|
]), 1040))
|
|
746
|
-
]))), 128)) : (s(!0), x(E, { key: 1 },
|
|
750
|
+
]))), 128)) : (s(!0), x(E, { key: 1 }, O(W.value, (i, d) => (s(), x("span", {
|
|
747
751
|
key: d,
|
|
748
752
|
class: "measure-item"
|
|
749
753
|
}, [
|
|
750
|
-
(s(), k(
|
|
754
|
+
(s(), k(T(i)))
|
|
751
755
|
]))), 128)),
|
|
752
756
|
me("span", {
|
|
753
757
|
ref_key: "moreTriggerRef",
|
|
754
758
|
ref: f,
|
|
755
759
|
class: "measure-item"
|
|
756
760
|
}, [
|
|
757
|
-
|
|
761
|
+
S(b(oe), {
|
|
758
762
|
text: A.value,
|
|
759
763
|
size: a.value,
|
|
760
764
|
type: u.value
|
|
761
765
|
}, {
|
|
762
766
|
icon: y(() => [
|
|
763
|
-
(s(), k(
|
|
767
|
+
(s(), k(T(I.value)))
|
|
764
768
|
]),
|
|
765
769
|
_: 1
|
|
766
770
|
}, 8, ["text", "size", "type"])
|
|
@@ -768,14 +772,14 @@ const ne = "link", Be = "small", ct = 150, dt = /* @__PURE__ */ N({
|
|
|
768
772
|
], 512)
|
|
769
773
|
], 512));
|
|
770
774
|
}
|
|
771
|
-
}),
|
|
775
|
+
}), xe = (e, r) => {
|
|
772
776
|
const t = e.__vccOpts || e;
|
|
773
|
-
for (const [
|
|
774
|
-
t[
|
|
777
|
+
for (const [o, l] of r)
|
|
778
|
+
t[o] = l;
|
|
775
779
|
return t;
|
|
776
|
-
},
|
|
780
|
+
}, dt = /* @__PURE__ */ xe(ct, [["__scopeId", "data-v-ccd228a1"]]), ft = {
|
|
777
781
|
// 继承 Button 的所有 props
|
|
778
|
-
...
|
|
782
|
+
...Te,
|
|
779
783
|
// 覆盖 loading prop,使其默认值为 undefined,以便自动 loading 功能正常工作
|
|
780
784
|
loading: {
|
|
781
785
|
type: Boolean,
|
|
@@ -851,76 +855,76 @@ const ne = "link", Be = "small", ct = 150, dt = /* @__PURE__ */ N({
|
|
|
851
855
|
type: Function,
|
|
852
856
|
default: void 0
|
|
853
857
|
}
|
|
854
|
-
},
|
|
858
|
+
}, pt = /* @__PURE__ */ R({
|
|
855
859
|
name: "MDeleteButton",
|
|
856
860
|
inheritAttrs: !1,
|
|
857
861
|
__name: "delete-button",
|
|
858
|
-
props:
|
|
862
|
+
props: ft,
|
|
859
863
|
emits: ["delete", "success", "error"],
|
|
860
|
-
setup(e, { emit:
|
|
861
|
-
const t =
|
|
862
|
-
|
|
863
|
-
|
|
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(() => {
|
|
864
868
|
var u;
|
|
865
|
-
(u =
|
|
869
|
+
(u = v.value) == null || u.update({
|
|
866
870
|
okButtonProps: { loading: a }
|
|
867
871
|
});
|
|
868
872
|
});
|
|
869
|
-
}, { flush: "post" }),
|
|
870
|
-
|
|
873
|
+
}, { flush: "post" }), We(() => {
|
|
874
|
+
v.value && (v.value.destroy(), v.value = null);
|
|
871
875
|
});
|
|
872
|
-
const
|
|
876
|
+
const g = async () => {
|
|
873
877
|
try {
|
|
874
|
-
if (
|
|
878
|
+
if (o.beforeDelete && await o.beforeDelete() === !1)
|
|
875
879
|
return;
|
|
876
|
-
|
|
880
|
+
o.autoLoading && o.loading === void 0 && (l.value = !0);
|
|
877
881
|
let a = !1;
|
|
878
882
|
const u = () => {
|
|
879
|
-
a || (a = !0,
|
|
883
|
+
a || (a = !0, o.autoLoading && o.loading === void 0 && (l.value = !1));
|
|
880
884
|
};
|
|
881
|
-
if (
|
|
882
|
-
const A =
|
|
885
|
+
if (o.onDelete) {
|
|
886
|
+
const A = o.onDelete(u);
|
|
883
887
|
if (A && typeof A.then == "function")
|
|
884
888
|
try {
|
|
885
|
-
const
|
|
886
|
-
a || u(),
|
|
887
|
-
} catch (
|
|
888
|
-
throw a || u(),
|
|
889
|
+
const I = await A;
|
|
890
|
+
a || u(), H(I);
|
|
891
|
+
} catch (I) {
|
|
892
|
+
throw a || u(), I;
|
|
889
893
|
}
|
|
890
894
|
} else
|
|
891
|
-
t("delete", u),
|
|
895
|
+
t("delete", u), o.autoLoading && o.loading === void 0 && setTimeout(() => {
|
|
892
896
|
a || u();
|
|
893
897
|
}, 5e3);
|
|
894
898
|
} catch (a) {
|
|
895
|
-
|
|
899
|
+
o.autoLoading && o.loading === void 0 && (l.value = !1);
|
|
896
900
|
const u = a instanceof Error ? a : new Error(String(a));
|
|
897
|
-
t("error", u),
|
|
901
|
+
t("error", u), o.showError && ke.error(u.message || "删除失败,请重试");
|
|
898
902
|
}
|
|
899
|
-
},
|
|
900
|
-
|
|
901
|
-
}, B =
|
|
903
|
+
}, H = (a) => {
|
|
904
|
+
o.showSuccess && ke.success(o.successText || "删除成功"), t("success", a);
|
|
905
|
+
}, B = o.debounce > 0 ? ze(g, o.debounce) : g, M = () => {
|
|
902
906
|
if (!f.value) {
|
|
903
907
|
B();
|
|
904
908
|
return;
|
|
905
909
|
}
|
|
906
|
-
if (
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
title:
|
|
910
|
+
if (o.confirmType === "popconfirm") return;
|
|
911
|
+
ve(() => {
|
|
912
|
+
v.value = Xe.confirm({
|
|
913
|
+
title: o.confirmTitle,
|
|
910
914
|
content: f.value,
|
|
911
|
-
okText:
|
|
912
|
-
cancelText:
|
|
915
|
+
okText: o.okText,
|
|
916
|
+
cancelText: o.cancelText,
|
|
913
917
|
okType: "danger",
|
|
914
918
|
okButtonProps: { loading: m.value },
|
|
915
919
|
onOk: async () => {
|
|
916
920
|
try {
|
|
917
|
-
return await
|
|
921
|
+
return await g(), new Promise((u) => {
|
|
918
922
|
if (!m.value) {
|
|
919
923
|
u();
|
|
920
924
|
return;
|
|
921
925
|
}
|
|
922
|
-
const A =
|
|
923
|
-
|
|
926
|
+
const A = Z(m, (I) => {
|
|
927
|
+
I || (A(), u());
|
|
924
928
|
});
|
|
925
929
|
});
|
|
926
930
|
} catch (u) {
|
|
@@ -928,29 +932,29 @@ const ne = "link", Be = "small", ct = 150, dt = /* @__PURE__ */ N({
|
|
|
928
932
|
}
|
|
929
933
|
},
|
|
930
934
|
onCancel: () => {
|
|
931
|
-
|
|
935
|
+
v.value = null;
|
|
932
936
|
},
|
|
933
937
|
afterClose: () => {
|
|
934
|
-
|
|
938
|
+
v.value = null;
|
|
935
939
|
}
|
|
936
940
|
});
|
|
937
941
|
});
|
|
938
942
|
};
|
|
939
|
-
return (a, u) => f.value && a.confirmType === "popconfirm" ? (s(), k(
|
|
943
|
+
return (a, u) => f.value && a.confirmType === "popconfirm" ? (s(), k(b(Ye), {
|
|
940
944
|
key: 0,
|
|
941
945
|
title: f.value,
|
|
942
946
|
"ok-text": a.okText,
|
|
943
947
|
"cancel-text": a.cancelText,
|
|
944
948
|
"ok-button-props": { loading: m.value, danger: !0 },
|
|
945
|
-
onConfirm:
|
|
949
|
+
onConfirm: b(B)
|
|
946
950
|
}, {
|
|
947
951
|
icon: y(() => [
|
|
948
|
-
|
|
949
|
-
|
|
952
|
+
V(a.$slots, "popconfirmIcon", {}, () => [
|
|
953
|
+
S(b(Qe), { class: "text-[--color-ant-error]" })
|
|
950
954
|
], !0)
|
|
951
955
|
]),
|
|
952
956
|
default: y(() => [
|
|
953
|
-
|
|
957
|
+
S(b(J), z(a.$attrs, {
|
|
954
958
|
type: a.type,
|
|
955
959
|
size: a.size,
|
|
956
960
|
danger: !0,
|
|
@@ -961,8 +965,8 @@ const ne = "link", Be = "small", ct = 150, dt = /* @__PURE__ */ N({
|
|
|
961
965
|
class: "group"
|
|
962
966
|
}), U({
|
|
963
967
|
default: y(() => [
|
|
964
|
-
|
|
965
|
-
u[0] || (u[0] =
|
|
968
|
+
V(a.$slots, "default", {}, () => [
|
|
969
|
+
u[0] || (u[0] = j("删除", -1))
|
|
966
970
|
], !0)
|
|
967
971
|
]),
|
|
968
972
|
_: 2
|
|
@@ -970,8 +974,8 @@ const ne = "link", Be = "small", ct = 150, dt = /* @__PURE__ */ N({
|
|
|
970
974
|
a.hideIcon ? void 0 : {
|
|
971
975
|
name: "icon",
|
|
972
976
|
fn: y(() => [
|
|
973
|
-
|
|
974
|
-
|
|
977
|
+
V(a.$slots, "icon", {}, () => [
|
|
978
|
+
S(b(be))
|
|
975
979
|
], !0)
|
|
976
980
|
]),
|
|
977
981
|
key: "0"
|
|
@@ -979,7 +983,7 @@ const ne = "link", Be = "small", ct = 150, dt = /* @__PURE__ */ N({
|
|
|
979
983
|
]), 1040, ["type", "size", "loading", "disabled", "permission", "permission-action"])
|
|
980
984
|
]),
|
|
981
985
|
_: 3
|
|
982
|
-
}, 8, ["title", "ok-text", "cancel-text", "ok-button-props", "onConfirm"])) : (s(), k(
|
|
986
|
+
}, 8, ["title", "ok-text", "cancel-text", "ok-button-props", "onConfirm"])) : (s(), k(b(J), z({ key: 1 }, a.$attrs, {
|
|
983
987
|
type: a.type,
|
|
984
988
|
size: a.size,
|
|
985
989
|
danger: !0,
|
|
@@ -987,11 +991,11 @@ const ne = "link", Be = "small", ct = 150, dt = /* @__PURE__ */ N({
|
|
|
987
991
|
disabled: a.disabled,
|
|
988
992
|
permission: a.permission,
|
|
989
993
|
"permission-action": a.permissionAction,
|
|
990
|
-
onClick:
|
|
994
|
+
onClick: M
|
|
991
995
|
}), U({
|
|
992
996
|
default: y(() => [
|
|
993
|
-
|
|
994
|
-
u[1] || (u[1] =
|
|
997
|
+
V(a.$slots, "default", {}, () => [
|
|
998
|
+
u[1] || (u[1] = j("删除", -1))
|
|
995
999
|
], !0)
|
|
996
1000
|
]),
|
|
997
1001
|
_: 2
|
|
@@ -999,79 +1003,37 @@ const ne = "link", Be = "small", ct = 150, dt = /* @__PURE__ */ N({
|
|
|
999
1003
|
a.hideIcon ? void 0 : {
|
|
1000
1004
|
name: "icon",
|
|
1001
1005
|
fn: y(() => [
|
|
1002
|
-
|
|
1003
|
-
|
|
1006
|
+
V(a.$slots, "icon", {}, () => [
|
|
1007
|
+
S(b(be))
|
|
1004
1008
|
], !0)
|
|
1005
1009
|
]),
|
|
1006
1010
|
key: "0"
|
|
1007
1011
|
}
|
|
1008
1012
|
]), 1040, ["type", "size", "loading", "disabled", "permission", "permission-action"]));
|
|
1009
1013
|
}
|
|
1010
|
-
}),
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
type: Array,
|
|
1014
|
-
required: !0
|
|
1015
|
-
},
|
|
1016
|
-
dataSource: {
|
|
1017
|
-
type: Array,
|
|
1018
|
-
default: () => []
|
|
1019
|
-
},
|
|
1020
|
-
rowKey: {
|
|
1021
|
-
type: [String, Function],
|
|
1022
|
-
default: "id"
|
|
1023
|
-
},
|
|
1024
|
-
pagination: {
|
|
1025
|
-
type: [Object, Boolean],
|
|
1026
|
-
default: void 0
|
|
1027
|
-
},
|
|
1028
|
-
loading: {
|
|
1029
|
-
type: Boolean,
|
|
1030
|
-
default: !1
|
|
1031
|
-
},
|
|
1032
|
-
bordered: {
|
|
1033
|
-
type: Boolean,
|
|
1034
|
-
default: !1
|
|
1035
|
-
},
|
|
1036
|
-
size: {
|
|
1037
|
-
type: String,
|
|
1038
|
-
default: "middle"
|
|
1039
|
-
}
|
|
1040
|
-
// 可以添加更多自定义 props
|
|
1041
|
-
};
|
|
1042
|
-
function vt(e) {
|
|
1043
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Ke(e);
|
|
1044
|
-
}
|
|
1045
|
-
const bt = /* @__PURE__ */ N({
|
|
1046
|
-
name: "MTable",
|
|
1047
|
-
props: gt,
|
|
1048
|
-
setup(e, {
|
|
1049
|
-
slots: o,
|
|
1050
|
-
attrs: t
|
|
1051
|
-
}) {
|
|
1052
|
-
return () => h(Je, C(e, t, {
|
|
1053
|
-
class: "mtn-table"
|
|
1054
|
-
}), vt(o) ? o : {
|
|
1055
|
-
default: () => [o]
|
|
1056
|
-
});
|
|
1057
|
-
}
|
|
1058
|
-
}), kt = Ce(bt), ht = [Q, xe, oe, ft, yt, it, kt], Pt = {
|
|
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 = {
|
|
1059
1017
|
install(e) {
|
|
1060
|
-
|
|
1061
|
-
e.component(
|
|
1018
|
+
bt.forEach((r) => {
|
|
1019
|
+
e.component(r.name || "", r);
|
|
1062
1020
|
});
|
|
1063
1021
|
}
|
|
1064
1022
|
};
|
|
1065
1023
|
export {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1024
|
+
dt as ActionGroup,
|
|
1025
|
+
J as Button,
|
|
1026
|
+
Pe as ButtonGroup,
|
|
1027
|
+
kt as ButtonPositionEnum,
|
|
1028
|
+
mt as DeleteButton,
|
|
1070
1029
|
oe as DropdownButton,
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
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,
|
|
1074
1037
|
Pt as default,
|
|
1075
|
-
|
|
1076
|
-
tt as tagProps
|
|
1038
|
+
et as tagProps
|
|
1077
1039
|
};
|