@mtn-ui/components 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/antd-wrapped/action-group/action-group.vue.js +2 -2
- package/dist/antd-wrapped/action-group/action-group.vue2.js +249 -215
- 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 +453 -460
- package/dist/types/packages/components/src/antd-wrapped/table/index.d.ts +3 -67
- package/dist/types/packages/components/src/antd-wrapped/table/table.d.ts +128 -67
- 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/packages/components/src/antd-wrapped/table/props.d.ts +0 -37
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./action-group.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-29d941f4"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,259 +1,292 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { MoreOutlined as
|
|
4
|
-
import { Menu as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { actionGroupProps as
|
|
9
|
-
import { PERMISSION_CHECKER_KEY as
|
|
10
|
-
import { filterValidChildren as
|
|
11
|
-
const
|
|
1
|
+
import { defineComponent as Ae, useSlots as Me, useAttrs as Se, ref as I, inject as Ie, computed as i, shallowRef as Te, watch as te, cloneVNode as oe, onMounted as Ee, nextTick as K, onUnmounted as Ne, createElementBlock as v, openBlock as r, createVNode as $, createElementVNode as re, unref as C, normalizeProps as se, guardReactiveProps as Re, withCtx as m, createBlock as u, createCommentVNode as Ve, Fragment as P, renderList as z, resolveDynamicComponent as d, mergeProps as U, createSlots as F, createTextVNode as G, toDisplayString as L, normalizeStyle as we } from "vue";
|
|
2
|
+
import { useDebounceFn as Be } from "@vueuse/core";
|
|
3
|
+
import { MoreOutlined as Oe } from "@ant-design/icons-vue";
|
|
4
|
+
import { Menu as Y } from "ant-design-vue";
|
|
5
|
+
import Ue from "../button/button.js";
|
|
6
|
+
import De from "../button-group/button-group.js";
|
|
7
|
+
import le from "../dropdown-button/dropdown-button.js";
|
|
8
|
+
import { actionGroupProps as je } from "./props.js";
|
|
9
|
+
import { PERMISSION_CHECKER_KEY as We, defaultPermissionChecker as Ke } from "@mtn-ui/shared";
|
|
10
|
+
import { filterValidChildren as $e, getButtonKey as Fe } from "./utils.js";
|
|
11
|
+
const H = "link", ae = "small", Ge = 150, tn = /* @__PURE__ */ Ae({
|
|
12
12
|
name: "MActionGroup",
|
|
13
13
|
inheritAttrs: !1,
|
|
14
14
|
__name: "action-group",
|
|
15
|
-
props:
|
|
15
|
+
props: je,
|
|
16
16
|
emits: ["action-click"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
function
|
|
20
|
-
if (!e) return;
|
|
21
|
-
const r = e;
|
|
22
|
-
return r.name || r.__name || r.displayName;
|
|
23
|
-
}
|
|
24
|
-
const z = l(() => n.mode === "table"), A = l(
|
|
25
|
-
() => z.value ? "small" : n.size
|
|
26
|
-
), B = l(
|
|
27
|
-
() => z.value ? "link" : "default"
|
|
28
|
-
), H = l(
|
|
29
|
-
() => z.value ? "" : n.moreText
|
|
30
|
-
), L = l(() => n.moreIcon || xe);
|
|
31
|
-
function E(e) {
|
|
17
|
+
setup(ie, { emit: ue }) {
|
|
18
|
+
const t = ie, ce = ue, D = Me(), pe = Se(), y = I(), T = I(), E = I(), me = Ie(We, I(Ke)), x = i(() => t.mode === "table"), A = i(() => x.value ? "small" : t.size), N = i(() => x.value ? "link" : "default"), q = i(() => x.value ? "" : t.moreText), Z = i(() => t.moreIcon || Oe);
|
|
19
|
+
function R(e) {
|
|
32
20
|
return e ? me.value(e) : !0;
|
|
33
21
|
}
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
22
|
+
const J = i(() => {
|
|
23
|
+
var e;
|
|
24
|
+
return $e((e = D.default) == null ? void 0 : e.call(D));
|
|
25
|
+
}), h = Te([]);
|
|
26
|
+
function Q(e) {
|
|
27
|
+
var c, l, p;
|
|
28
|
+
const o = e.icon && (e.icon.name || e.icon.__name) || "", n = e.component && (e.component.name || e.component.__name) || "";
|
|
37
29
|
return [
|
|
38
30
|
e.key ?? "",
|
|
39
31
|
e.label ?? "",
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
o,
|
|
33
|
+
n,
|
|
42
34
|
Array.isArray(e.permission) ? e.permission.join(",") : e.permission ?? "",
|
|
43
35
|
e.permissionAction ?? "",
|
|
44
36
|
String(e.disabled ?? !1),
|
|
45
|
-
String(((
|
|
46
|
-
String(((
|
|
47
|
-
String(((
|
|
37
|
+
String(((c = e.componentProps) == null ? void 0 : c.confirm) ?? ""),
|
|
38
|
+
String(((l = e.componentProps) == null ? void 0 : l.showSuccess) ?? ""),
|
|
39
|
+
String(((p = e.componentProps) == null ? void 0 : p.danger) ?? "")
|
|
48
40
|
].join("|");
|
|
49
41
|
}
|
|
50
|
-
|
|
51
|
-
() =>
|
|
42
|
+
te(
|
|
43
|
+
() => t.actions,
|
|
52
44
|
(e) => {
|
|
53
45
|
if (!e) {
|
|
54
|
-
|
|
46
|
+
h.value = [];
|
|
55
47
|
return;
|
|
56
48
|
}
|
|
57
|
-
if (
|
|
58
|
-
|
|
49
|
+
if (h.value.length !== e.length) {
|
|
50
|
+
h.value = e;
|
|
59
51
|
return;
|
|
60
52
|
}
|
|
61
|
-
const
|
|
62
|
-
|
|
53
|
+
const o = e.map(Q).join("||"), n = h.value.map(Q).join("||");
|
|
54
|
+
o !== n && (h.value = e);
|
|
63
55
|
},
|
|
64
56
|
{ immediate: !0, deep: !1 }
|
|
65
57
|
);
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
58
|
+
const j = i(() => h.value.length ? h.value.filter((e) => R(e.permission)) : []), f = i(() => t.actions ? j.value.length : J.value.length), V = i(() => t.actions ? j.value.map((e, o) => ({
|
|
59
|
+
key: be(e, o),
|
|
60
|
+
label: e.label || "",
|
|
61
|
+
icon: e.icon || null,
|
|
62
|
+
component: ge(e),
|
|
63
|
+
props: _e(e),
|
|
64
|
+
menuProps: Ce(e),
|
|
65
|
+
handler: () => Pe(e)
|
|
66
|
+
})) : J.value.filter((e) => {
|
|
67
|
+
const o = e.props || {};
|
|
68
|
+
return o.permission && o.permissionAction === "hide" ? R(o.permission) : !0;
|
|
69
|
+
}).map((e, o) => {
|
|
70
|
+
var l, p;
|
|
71
|
+
const n = Fe(e, o), s = oe(e, {
|
|
72
|
+
type: ((l = e.props) == null ? void 0 : l.type) ?? (x.value ? N.value : void 0),
|
|
73
|
+
size: ((p = e.props) == null ? void 0 : p.size) ?? A.value
|
|
74
|
+
}), c = oe(e, {
|
|
75
|
+
...e.props,
|
|
76
|
+
type: H,
|
|
77
|
+
size: ae
|
|
78
|
+
});
|
|
79
|
+
return {
|
|
80
|
+
key: n,
|
|
81
|
+
label: "",
|
|
82
|
+
// 插槽模式没有 label,由组件自身渲染
|
|
83
|
+
icon: null,
|
|
84
|
+
component: s,
|
|
85
|
+
props: {},
|
|
86
|
+
// 插槽模式使用 cloneVNode 已经处理了 props
|
|
87
|
+
menuProps: {},
|
|
88
|
+
// 菜单模式使用 cloneVNode 已经处理了 props
|
|
89
|
+
handler: null,
|
|
90
|
+
// 插槽模式的事件由组件自身处理
|
|
91
|
+
vnode: s,
|
|
92
|
+
// 保存原始 vnode 用于渲染
|
|
93
|
+
menuVnode: c
|
|
94
|
+
// 保存菜单模式的 vnode
|
|
95
|
+
};
|
|
96
|
+
})), X = i(() => V.value.slice(0, ee.value)), W = i(() => V.value.slice(ee.value)), fe = i(() => ({
|
|
97
|
+
size: A.value,
|
|
98
|
+
compact: t.compact,
|
|
99
|
+
vertical: t.vertical,
|
|
100
|
+
block: t.block,
|
|
101
|
+
...pe
|
|
102
|
+
})), de = i(() => ({
|
|
103
|
+
text: q.value,
|
|
104
|
+
size: A.value,
|
|
105
|
+
type: N.value,
|
|
106
|
+
...t.moreProps
|
|
107
|
+
})), w = I(t.maxItems);
|
|
108
|
+
function ve() {
|
|
109
|
+
if (!y.value || !T.value || !E.value)
|
|
110
|
+
return Math.min(t.maxItems, f.value);
|
|
111
|
+
const e = y.value.clientWidth, o = T.value.querySelectorAll(".measure-item");
|
|
112
|
+
if (o.length === 0) return Math.min(t.maxItems, f.value);
|
|
113
|
+
const n = f.value, s = [];
|
|
114
|
+
for (let a = 0; a < Math.min(n, o.length); a++)
|
|
115
|
+
s.push(o[a].offsetWidth);
|
|
116
|
+
const c = E.value.offsetWidth ?? 0;
|
|
117
|
+
let l = 0, p = 0;
|
|
118
|
+
for (let a = 0; a < s.length; a++) {
|
|
119
|
+
const k = s[a], b = l === 0 ? k : l + t.gap + k, _ = s.length - (a + 1) > 0 ? l === 0 ? c : t.gap + c : 0;
|
|
120
|
+
if (b + _ <= e) {
|
|
121
|
+
l = b, p++;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
break;
|
|
81
125
|
}
|
|
82
|
-
return Math.max(0, Math.min(
|
|
126
|
+
return Math.max(0, Math.min(p, t.maxItems, n));
|
|
83
127
|
}
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
()
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
128
|
+
const B = () => {
|
|
129
|
+
if (t.disableCollapse) {
|
|
130
|
+
w.value = f.value;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (f.value <= 1) {
|
|
134
|
+
w.value = f.value;
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
w.value = ve();
|
|
138
|
+
}, g = Be(() => {
|
|
139
|
+
B();
|
|
140
|
+
}, Ge), M = (e = !1) => {
|
|
141
|
+
e ? (typeof g == "function" && "cancel" in g && g.cancel(), B()) : g();
|
|
142
|
+
};
|
|
143
|
+
M.cancel = () => {
|
|
144
|
+
typeof g == "function" && "cancel" in g && g.cancel();
|
|
145
|
+
};
|
|
146
|
+
let S = null;
|
|
147
|
+
const ye = async () => {
|
|
148
|
+
await K(), B(), y.value && typeof ResizeObserver < "u" && (S = new ResizeObserver((e) => {
|
|
149
|
+
e[0].contentRect.width > 0 && M();
|
|
150
|
+
}), S.observe(y.value));
|
|
151
|
+
}, ke = () => {
|
|
152
|
+
S && y.value && S.unobserve(y.value), S = null, "cancel" in M && M.cancel();
|
|
153
|
+
};
|
|
154
|
+
Ee(async () => {
|
|
155
|
+
B(), await K(), ye();
|
|
156
|
+
}), Ne(() => {
|
|
157
|
+
ke();
|
|
158
|
+
}), te(
|
|
159
|
+
[j, f, () => t.maxItems, () => t.gap],
|
|
160
|
+
async () => {
|
|
161
|
+
await K(), M(!0);
|
|
99
162
|
},
|
|
100
|
-
{
|
|
163
|
+
{ deep: !1 }
|
|
101
164
|
);
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return k.value >= e.length ? e : e.slice(0, k.value);
|
|
106
|
-
}), J = l(() => {
|
|
107
|
-
if (n.actions) return [];
|
|
108
|
-
const e = N.value;
|
|
109
|
-
return k.value >= e.length ? [] : e.slice(k.value);
|
|
110
|
-
}), ye = l(() => n.actions ? [] : J.value.filter((e) => {
|
|
111
|
-
const r = e.props || {};
|
|
112
|
-
return r.permission && r.permissionAction === "hide" ? E(r.permission) : !0;
|
|
113
|
-
})), ke = l(() => n.disableCollapse ? !1 : (n.actions ? Z.value.length : J.value.length) > 0);
|
|
114
|
-
function W(e) {
|
|
115
|
-
return e.component || Ie;
|
|
165
|
+
const ee = i(() => t.disableCollapse || f.value <= 1 ? f.value : T.value && E.value && y.value ? w.value : Math.min(t.maxItems, f.value)), he = i(() => t.disableCollapse ? !1 : W.value.length > 0);
|
|
166
|
+
function ge(e) {
|
|
167
|
+
return e.component || Ue;
|
|
116
168
|
}
|
|
117
|
-
function
|
|
118
|
-
return e.key || e.label || `action-${
|
|
169
|
+
function be(e, o) {
|
|
170
|
+
return e.key || e.label || `action-${o}`;
|
|
119
171
|
}
|
|
120
|
-
function
|
|
172
|
+
function ne(e) {
|
|
121
173
|
const {
|
|
122
|
-
label:
|
|
123
|
-
key:
|
|
124
|
-
onClick:
|
|
125
|
-
permission:
|
|
126
|
-
permissionAction:
|
|
127
|
-
icon:
|
|
128
|
-
component:
|
|
129
|
-
componentProps:
|
|
130
|
-
slot:
|
|
131
|
-
type:
|
|
132
|
-
size:
|
|
133
|
-
disabled:
|
|
134
|
-
...
|
|
174
|
+
label: o,
|
|
175
|
+
key: n,
|
|
176
|
+
onClick: s,
|
|
177
|
+
permission: c,
|
|
178
|
+
permissionAction: l,
|
|
179
|
+
icon: p,
|
|
180
|
+
component: a,
|
|
181
|
+
componentProps: k,
|
|
182
|
+
slot: b,
|
|
183
|
+
type: O,
|
|
184
|
+
size: _,
|
|
185
|
+
disabled: ze,
|
|
186
|
+
...xe
|
|
135
187
|
} = e;
|
|
136
188
|
return {
|
|
137
|
-
component:
|
|
138
|
-
componentProps:
|
|
139
|
-
type:
|
|
140
|
-
size:
|
|
141
|
-
rest:
|
|
142
|
-
permission:
|
|
143
|
-
permissionAction:
|
|
144
|
-
disabled:
|
|
189
|
+
component: a,
|
|
190
|
+
componentProps: k,
|
|
191
|
+
type: O,
|
|
192
|
+
size: _,
|
|
193
|
+
rest: xe,
|
|
194
|
+
permission: c,
|
|
195
|
+
permissionAction: l,
|
|
196
|
+
disabled: ze
|
|
145
197
|
};
|
|
146
198
|
}
|
|
147
|
-
function
|
|
148
|
-
const { component:
|
|
149
|
-
type:
|
|
199
|
+
function _e(e) {
|
|
200
|
+
const { component: o, componentProps: n, type: s, rest: c, permission: l, permissionAction: p, disabled: a } = ne(e), k = {
|
|
201
|
+
type: s || N.value,
|
|
150
202
|
size: A.value,
|
|
151
|
-
disabled:
|
|
152
|
-
...
|
|
203
|
+
disabled: a || !R(l) && p === "disable",
|
|
204
|
+
...c
|
|
153
205
|
};
|
|
154
|
-
if (
|
|
155
|
-
const
|
|
156
|
-
return
|
|
206
|
+
if (o && n) {
|
|
207
|
+
const b = { ...k, ...n };
|
|
208
|
+
return x.value && (b.type = "link"), b;
|
|
157
209
|
}
|
|
158
|
-
return
|
|
210
|
+
return k;
|
|
159
211
|
}
|
|
160
|
-
function
|
|
161
|
-
const { component:
|
|
162
|
-
type:
|
|
163
|
-
size:
|
|
164
|
-
disabled:
|
|
165
|
-
...
|
|
212
|
+
function Ce(e) {
|
|
213
|
+
const { component: o, componentProps: n, rest: s, permission: c, permissionAction: l, disabled: p } = ne(e), a = {
|
|
214
|
+
type: H,
|
|
215
|
+
size: ae,
|
|
216
|
+
disabled: p || !R(c) && l === "disable",
|
|
217
|
+
...s
|
|
166
218
|
};
|
|
167
|
-
if (
|
|
168
|
-
const { type:
|
|
169
|
-
return
|
|
219
|
+
if (o && n) {
|
|
220
|
+
const { type: k, size: b, ...O } = n, _ = { ...a, ...O };
|
|
221
|
+
return _.type = H, _;
|
|
170
222
|
}
|
|
171
|
-
return
|
|
223
|
+
return a;
|
|
172
224
|
}
|
|
173
|
-
function
|
|
225
|
+
function Pe(e) {
|
|
174
226
|
e.onClick && e.onClick(e), ce("action-click", e);
|
|
175
227
|
}
|
|
176
|
-
return (e,
|
|
228
|
+
return (e, o) => (r(), v("div", {
|
|
177
229
|
ref_key: "containerRef",
|
|
178
|
-
ref:
|
|
230
|
+
ref: y,
|
|
179
231
|
class: "mtn-action-group"
|
|
180
232
|
}, [
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
onClick: (s) => te(t)
|
|
192
|
-
}), j({
|
|
193
|
-
default: a(() => [
|
|
194
|
-
O(" " + $(t.label), 1)
|
|
233
|
+
$(C(De), se(Re(fe.value)), {
|
|
234
|
+
default: m(() => [
|
|
235
|
+
t.actions ? (r(!0), v(P, { key: 0 }, z(X.value, (n) => (r(), u(d(n.component), U({
|
|
236
|
+
key: n.key,
|
|
237
|
+
ref_for: !0
|
|
238
|
+
}, n.props, {
|
|
239
|
+
onClick: n.handler
|
|
240
|
+
}), F({
|
|
241
|
+
default: m(() => [
|
|
242
|
+
G(" " + L(n.label), 1)
|
|
195
243
|
]),
|
|
196
244
|
_: 2
|
|
197
245
|
}, [
|
|
198
|
-
|
|
246
|
+
n.icon ? {
|
|
199
247
|
name: "icon",
|
|
200
|
-
fn:
|
|
201
|
-
(
|
|
248
|
+
fn: m(() => [
|
|
249
|
+
(r(), u(d(n.icon)))
|
|
202
250
|
]),
|
|
203
251
|
key: "0"
|
|
204
252
|
} : void 0
|
|
205
|
-
]), 1040, ["onClick"]))), 128)) : (
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
key: v(se)(t, i)
|
|
212
|
-
});
|
|
213
|
-
}), 128)),
|
|
214
|
-
ke.value ? (o(), u(v(ie), I({
|
|
215
|
-
key: 2,
|
|
216
|
-
text: H.value,
|
|
217
|
-
size: A.value,
|
|
218
|
-
type: B.value
|
|
219
|
-
}, n.moreProps), {
|
|
220
|
-
icon: a(() => [
|
|
221
|
-
(o(), u(m(L.value)))
|
|
253
|
+
]), 1040, ["onClick"]))), 128)) : (r(!0), v(P, { key: 1 }, z(X.value, (n) => (r(), u(d(n.vnode), {
|
|
254
|
+
key: n.key
|
|
255
|
+
}))), 128)),
|
|
256
|
+
he.value ? (r(), u(C(le), se(U({ key: 2 }, de.value)), {
|
|
257
|
+
icon: m(() => [
|
|
258
|
+
(r(), u(d(Z.value)))
|
|
222
259
|
]),
|
|
223
|
-
overlay:
|
|
224
|
-
|
|
225
|
-
default:
|
|
226
|
-
|
|
227
|
-
key:
|
|
260
|
+
overlay: m(() => [
|
|
261
|
+
$(C(Y), null, {
|
|
262
|
+
default: m(() => [
|
|
263
|
+
t.actions ? (r(!0), v(P, { key: 0 }, z(W.value, (n) => (r(), u(C(Y).Item, {
|
|
264
|
+
key: n.key
|
|
228
265
|
}, {
|
|
229
|
-
default:
|
|
230
|
-
(
|
|
231
|
-
onClick:
|
|
232
|
-
}),
|
|
233
|
-
default:
|
|
234
|
-
|
|
266
|
+
default: m(() => [
|
|
267
|
+
(r(), u(d(n.component), U({ ref_for: !0 }, n.menuProps, {
|
|
268
|
+
onClick: n.handler
|
|
269
|
+
}), F({
|
|
270
|
+
default: m(() => [
|
|
271
|
+
G(" " + L(n.label), 1)
|
|
235
272
|
]),
|
|
236
273
|
_: 2
|
|
237
274
|
}, [
|
|
238
|
-
|
|
275
|
+
n.icon ? {
|
|
239
276
|
name: "icon",
|
|
240
|
-
fn:
|
|
241
|
-
(
|
|
277
|
+
fn: m(() => [
|
|
278
|
+
(r(), u(d(n.icon)))
|
|
242
279
|
]),
|
|
243
280
|
key: "0"
|
|
244
281
|
} : void 0
|
|
245
282
|
]), 1040, ["onClick"]))
|
|
246
283
|
]),
|
|
247
284
|
_: 2
|
|
248
|
-
}, 1024))), 128)) : (
|
|
249
|
-
key:
|
|
285
|
+
}, 1024))), 128)) : (r(!0), v(P, { key: 1 }, z(W.value, (n) => (r(), u(C(Y).Item, {
|
|
286
|
+
key: n.key
|
|
250
287
|
}, {
|
|
251
|
-
default:
|
|
252
|
-
(
|
|
253
|
-
...t.props,
|
|
254
|
-
type: w,
|
|
255
|
-
size: le
|
|
256
|
-
}))))
|
|
288
|
+
default: m(() => [
|
|
289
|
+
(r(), u(d(n.menuVnode)))
|
|
257
290
|
]),
|
|
258
291
|
_: 2
|
|
259
292
|
}, 1024))), 128))
|
|
@@ -262,59 +295,60 @@ const w = "link", le = "small", Ve = 150, Fe = /* @__PURE__ */ Ce({
|
|
|
262
295
|
})
|
|
263
296
|
]),
|
|
264
297
|
_: 1
|
|
265
|
-
}, 16
|
|
298
|
+
}, 16)) : Ve("", !0)
|
|
266
299
|
]),
|
|
267
300
|
_: 1
|
|
268
|
-
}, 16
|
|
269
|
-
|
|
301
|
+
}, 16),
|
|
302
|
+
re("div", {
|
|
270
303
|
ref_key: "measureRef",
|
|
271
|
-
ref:
|
|
272
|
-
class: "mtn-action-group-measure"
|
|
304
|
+
ref: T,
|
|
305
|
+
class: "mtn-action-group-measure",
|
|
306
|
+
style: we({ gap: `${t.gap}px` })
|
|
273
307
|
}, [
|
|
274
|
-
|
|
275
|
-
key:
|
|
308
|
+
t.actions ? (r(!0), v(P, { key: 0 }, z(V.value, (n, s) => (r(), v("span", {
|
|
309
|
+
key: s,
|
|
276
310
|
class: "measure-item"
|
|
277
311
|
}, [
|
|
278
|
-
(
|
|
279
|
-
default:
|
|
280
|
-
|
|
312
|
+
(r(), u(d(n.component), U({ ref_for: !0 }, n.props), F({
|
|
313
|
+
default: m(() => [
|
|
314
|
+
G(" " + L(n.label), 1)
|
|
281
315
|
]),
|
|
282
316
|
_: 2
|
|
283
317
|
}, [
|
|
284
|
-
|
|
318
|
+
n.icon ? {
|
|
285
319
|
name: "icon",
|
|
286
|
-
fn:
|
|
287
|
-
(
|
|
320
|
+
fn: m(() => [
|
|
321
|
+
(r(), u(d(n.icon)))
|
|
288
322
|
]),
|
|
289
323
|
key: "0"
|
|
290
324
|
} : void 0
|
|
291
325
|
]), 1040))
|
|
292
|
-
]))), 128)) : (
|
|
293
|
-
key:
|
|
326
|
+
]))), 128)) : (r(!0), v(P, { key: 1 }, z(V.value, (n, s) => (r(), v("span", {
|
|
327
|
+
key: s,
|
|
294
328
|
class: "measure-item"
|
|
295
329
|
}, [
|
|
296
|
-
(
|
|
330
|
+
(r(), u(d(n.vnode)))
|
|
297
331
|
]))), 128)),
|
|
298
|
-
|
|
332
|
+
re("span", {
|
|
299
333
|
ref_key: "moreTriggerRef",
|
|
300
|
-
ref:
|
|
334
|
+
ref: E,
|
|
301
335
|
class: "measure-item"
|
|
302
336
|
}, [
|
|
303
|
-
|
|
304
|
-
text:
|
|
337
|
+
$(C(le), {
|
|
338
|
+
text: q.value,
|
|
305
339
|
size: A.value,
|
|
306
|
-
type:
|
|
340
|
+
type: N.value
|
|
307
341
|
}, {
|
|
308
|
-
icon:
|
|
309
|
-
(
|
|
342
|
+
icon: m(() => [
|
|
343
|
+
(r(), u(d(Z.value)))
|
|
310
344
|
]),
|
|
311
345
|
_: 1
|
|
312
346
|
}, 8, ["text", "size", "type"])
|
|
313
347
|
], 512)
|
|
314
|
-
],
|
|
348
|
+
], 4)
|
|
315
349
|
], 512));
|
|
316
350
|
}
|
|
317
351
|
});
|
|
318
352
|
export {
|
|
319
|
-
|
|
353
|
+
tn as default
|
|
320
354
|
};
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { Table as m } from "ant-design-vue";
|
|
3
|
-
import { tableProps as c } from "./props.js";
|
|
4
|
-
function f(e) {
|
|
5
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !a(e);
|
|
6
|
-
}
|
|
7
|
-
const u = /* @__PURE__ */ r({
|
|
8
|
-
name: "MTable",
|
|
9
|
-
props: c,
|
|
10
|
-
setup(e, {
|
|
11
|
-
slots: t,
|
|
12
|
-
attrs: o
|
|
13
|
-
}) {
|
|
14
|
-
return () => n(m, p(e, o, {
|
|
15
|
-
class: "mtn-table"
|
|
16
|
-
}), f(t) ? t : {
|
|
17
|
-
default: () => [t]
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
});
|
|
1
|
+
var t = /* @__PURE__ */ ((r) => (r.TEXT = "text", r.TAG = "tag", r.DATE = "date", r.DATETIME = "dateTime", r.SELECT = "select", r.STATUS = "status", r.CUSTOM = "custom", r))(t || {}), L = /* @__PURE__ */ ((r) => (r.LEFT = "left", r.CENTER = "center", r.RIGHT = "right", r))(L || {}), d = /* @__PURE__ */ ((r) => (r.SMALL = "small", r.MIDDLE = "middle", r.LARGE = "large", r))(d || {}), v = /* @__PURE__ */ ((r) => (r.CHECKBOX = "checkbox", r.RADIO = "radio", r))(v || {}), A = /* @__PURE__ */ ((r) => (r.LEFT = "left", r.RIGHT = "right", r))(A || {});
|
|
21
2
|
export {
|
|
22
|
-
|
|
3
|
+
A as ButtonPositionEnum,
|
|
4
|
+
L as TableColumnAlignEnum,
|
|
5
|
+
t as TableColumnTypeEnum,
|
|
6
|
+
v as TableSelectionTypeEnum,
|
|
7
|
+
d as TableSizeEnum
|
|
23
8
|
};
|
package/dist/components.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.mtn-action-group[data-v-
|
|
1
|
+
.mtn-action-group[data-v-29d941f4]{width:100%;container-type:inline-size}.mtn-action-group-measure[data-v-29d941f4]{position:absolute;display:flex;visibility:hidden;align-items:center;height:0;overflow:hidden;pointer-events:none;white-space:nowrap}.measure-item[data-v-29d941f4]{display:inline-flex}[data-v-a943bc19] .ant-btn-dangerous{transition:transform .1s ease}[data-v-a943bc19] .ant-btn-dangerous:active{transform:scale(.95)}
|