@keyblade/pro-components 1.15.0-alpha.1 → 1.15.0-alpha.3
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/es/pro-layout/hooks.js +53 -59
- package/es/pro-reuse-tabs/pro-reuse-tabs.vue.js +15 -15
- package/es/pro-table/column-setting.vue.d.ts +14 -0
- package/es/pro-table/column-setting.vue.js +132 -0
- package/es/pro-table/column-setting.vue2.js +4 -0
- package/es/pro-table/index.d.ts +4 -1
- package/es/pro-table/index.vue.d.ts +4 -1
- package/es/pro-table/index.vue.js +102 -185
- package/package.json +1 -1
package/es/pro-layout/hooks.js
CHANGED
|
@@ -2,36 +2,36 @@ var V = Object.defineProperty, X = Object.defineProperties;
|
|
|
2
2
|
var Y = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var x = Object.getOwnPropertySymbols;
|
|
4
4
|
var Z = Object.prototype.hasOwnProperty, $ = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var J = (
|
|
6
|
-
for (var i in
|
|
7
|
-
Z.call(
|
|
5
|
+
var J = (s, c, i) => c in s ? V(s, c, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[c] = i, w = (s, c) => {
|
|
6
|
+
for (var i in c || (c = {}))
|
|
7
|
+
Z.call(c, i) && J(s, i, c[i]);
|
|
8
8
|
if (x)
|
|
9
|
-
for (var i of x(
|
|
10
|
-
$.call(
|
|
11
|
-
return
|
|
12
|
-
}, O = (
|
|
13
|
-
var L = (
|
|
14
|
-
var p = (
|
|
9
|
+
for (var i of x(c))
|
|
10
|
+
$.call(c, i) && J(s, i, c[i]);
|
|
11
|
+
return s;
|
|
12
|
+
}, O = (s, c) => X(s, Y(c));
|
|
13
|
+
var L = (s, c, i) => new Promise((K, g) => {
|
|
14
|
+
var p = (u) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
16
|
+
r(i.next(u));
|
|
17
17
|
} catch (d) {
|
|
18
18
|
g(d);
|
|
19
19
|
}
|
|
20
|
-
}, M = (
|
|
20
|
+
}, M = (u) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
r(i.throw(u));
|
|
23
23
|
} catch (d) {
|
|
24
24
|
g(d);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, r = (u) => u.done ? K(u.value) : Promise.resolve(u.value).then(p, M);
|
|
27
|
+
r((i = i.apply(s, c)).next());
|
|
28
28
|
});
|
|
29
29
|
import { ref as v, computed as _, watch as A } from "vue";
|
|
30
30
|
import { useRoute as I, useRouter as m } from "vue-router";
|
|
31
31
|
import { ProLayoutMode as E, ProLayoutMenuType as R } from "./enum.js";
|
|
32
|
-
const te = (
|
|
33
|
-
const
|
|
34
|
-
const e = [...
|
|
32
|
+
const te = (s) => {
|
|
33
|
+
const c = I(), i = m(), K = v([]), g = v([]), p = v([]), M = v([]), r = v(), u = v([]), d = v({}), k = v([]), f = v([]), P = v([]), T = v([]), y = v([]), b = _(() => {
|
|
34
|
+
const e = [...s.menuItems], a = (t) => {
|
|
35
35
|
t.forEach((l) => {
|
|
36
36
|
if (l != null && l.children && l.children.length > 0) {
|
|
37
37
|
if ((l == null ? void 0 : l.topChildrenMenu) !== void 0)
|
|
@@ -44,7 +44,7 @@ const te = (c) => {
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
|
-
return
|
|
47
|
+
return s.layout === E.mix && a(e), e;
|
|
48
48
|
}), W = (e) => {
|
|
49
49
|
var a;
|
|
50
50
|
if (K.value = [e.name], !(e != null && e.children) || ((a = e == null ? void 0 : e.children) == null ? void 0 : a.length) === 0)
|
|
@@ -53,14 +53,14 @@ const te = (c) => {
|
|
|
53
53
|
if (typeof e.redirect == "string")
|
|
54
54
|
i == null || i.push({ path: e.redirect });
|
|
55
55
|
else if (typeof e.redirect == "function") {
|
|
56
|
-
const t = e.redirect(
|
|
56
|
+
const t = e.redirect(c);
|
|
57
57
|
i == null || i.push(t);
|
|
58
58
|
} else
|
|
59
59
|
i == null || i.push(e.redirect);
|
|
60
60
|
}, B = (e) => {
|
|
61
61
|
e != null && e.name ? i == null || i.push({ name: e.name }) : i == null || i.push({ path: e.path }), g.value = [e.name];
|
|
62
62
|
}, D = (e, a) => L(null, null, function* () {
|
|
63
|
-
if (a != null && a.path && !(
|
|
63
|
+
if (a != null && a.path && !(s != null && s.onMenuItemClick && !(yield s.onMenuItemClick(a)))) {
|
|
64
64
|
if (a.path.startsWith("http") || a.path.startsWith("https")) {
|
|
65
65
|
window.open(a.path);
|
|
66
66
|
return;
|
|
@@ -74,63 +74,57 @@ const te = (c) => {
|
|
|
74
74
|
var l;
|
|
75
75
|
for (const n in t) {
|
|
76
76
|
const o = t[n];
|
|
77
|
-
if (o.name === ((l =
|
|
77
|
+
if (o.name === ((l = r == null ? void 0 : r.value) == null ? void 0 : l.name) || o.children && o.children.length > 0 && a(o.children))
|
|
78
78
|
return e.unshift(o), !0;
|
|
79
79
|
}
|
|
80
80
|
return !1;
|
|
81
81
|
};
|
|
82
|
-
a(JSON.parse(JSON.stringify(b.value))),
|
|
82
|
+
a(JSON.parse(JSON.stringify(b.value))), u.value = e;
|
|
83
83
|
}, q = () => {
|
|
84
84
|
var a, t, l;
|
|
85
|
-
const e = (a =
|
|
86
|
-
k.value = (t =
|
|
85
|
+
const e = (a = u.value) == null ? void 0 : a.map((n) => ({ path: n == null ? void 0 : n.path, label: n == null ? void 0 : n.title }));
|
|
86
|
+
k.value = (t = r.value) != null && t.breadcrumbs ? (l = r.value) == null ? void 0 : l.breadcrumbs : e.length !== 0 ? e : [];
|
|
87
87
|
};
|
|
88
88
|
function z() {
|
|
89
|
-
if (!
|
|
89
|
+
if (!r.value || r.value.noAffix) {
|
|
90
90
|
f.value.forEach((n) => {
|
|
91
91
|
n.active = !1;
|
|
92
92
|
});
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
-
const { name: e, title: a } =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
n.active = !1, n.name === e && (t = o);
|
|
95
|
+
const { name: e, title: a } = r.value;
|
|
96
|
+
f.value.forEach((n) => {
|
|
97
|
+
n.active = !1;
|
|
99
98
|
});
|
|
100
|
-
const
|
|
99
|
+
const t = {
|
|
101
100
|
name: e,
|
|
102
|
-
parentNames:
|
|
101
|
+
parentNames: u.value.map((n) => n.name),
|
|
103
102
|
title: a != null ? a : e,
|
|
104
|
-
fullPath:
|
|
103
|
+
fullPath: c.fullPath,
|
|
105
104
|
active: !0
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
const n = f.value[t];
|
|
109
|
-
n.fullPath === s.fullPath ? (n.active = !0, n.fullPath = s.fullPath) : (f.value.splice(t, 1), setTimeout(() => {
|
|
110
|
-
f.value.push(l);
|
|
111
|
-
}));
|
|
112
|
-
} else
|
|
113
|
-
f.value.push(l);
|
|
105
|
+
}, l = f.value.findIndex((n) => n.fullPath === c.fullPath);
|
|
106
|
+
~l ? f.value[l].active = !0 : f.value.push(t);
|
|
114
107
|
}
|
|
115
108
|
const F = (e) => {
|
|
116
|
-
const a = f.value.
|
|
117
|
-
i.push(
|
|
109
|
+
const a = f.value.find((t) => t.fullPath === e);
|
|
110
|
+
a && i.push(a.fullPath);
|
|
118
111
|
}, G = (e) => {
|
|
119
112
|
let a = -1, t = -1;
|
|
120
113
|
if (f.value.forEach((n, o) => {
|
|
121
|
-
n.
|
|
122
|
-
}),
|
|
114
|
+
n.fullPath === e && (t = o), n.active && (a = o);
|
|
115
|
+
}), t === -1) return;
|
|
116
|
+
if (a === t) {
|
|
123
117
|
let n;
|
|
124
|
-
t === 0 ? n = f.value[t + 1] : n = f.value[t - 1], n.active = !0, i.push(n.fullPath);
|
|
118
|
+
t === 0 ? n = f.value[t + 1] : n = f.value[t - 1], n && (n.active = !0, i.push(n.fullPath));
|
|
125
119
|
}
|
|
126
120
|
const l = f.value.splice(t, 1);
|
|
127
121
|
U(l[0]);
|
|
128
122
|
}, Q = () => {
|
|
129
123
|
var a;
|
|
130
|
-
if (
|
|
124
|
+
if (s != null && s.disableKeepAlive || (a = c == null ? void 0 : c.meta) != null && a.ignoreCache)
|
|
131
125
|
return;
|
|
132
126
|
const e = new Set(P.value);
|
|
133
|
-
|
|
127
|
+
u.value.forEach((t) => {
|
|
134
128
|
t.name && e.add(t.name);
|
|
135
129
|
}), P.value = Array.from(e.values());
|
|
136
130
|
}, U = (e) => {
|
|
@@ -151,27 +145,27 @@ const te = (c) => {
|
|
|
151
145
|
});
|
|
152
146
|
};
|
|
153
147
|
a(JSON.parse(JSON.stringify(b.value))), d.value = e;
|
|
154
|
-
}, { immediate: !0 }), A(() => [
|
|
148
|
+
}, { immediate: !0 }), A(() => [s.layout, b.value], () => {
|
|
155
149
|
var e, a, t;
|
|
156
|
-
if (T.value = [], y.value = [], p.value = [...((e =
|
|
150
|
+
if (T.value = [], y.value = [], p.value = [...((e = s.menuProps) == null ? void 0 : e.defaultOpenKeys) || [], ...p.value], M.value = [...((a = s.menuProps) == null ? void 0 : a.defaultOpenKeys) || [], ...M.value], s.layout === E.side)
|
|
157
151
|
y.value = b.value;
|
|
158
|
-
else if (
|
|
152
|
+
else if (s.layout === E.mix) {
|
|
159
153
|
const l = (t = b.value) == null ? void 0 : t.filter((n) => n.topMenu);
|
|
160
154
|
(l == null ? void 0 : l.length) === 0 ? y.value = b.value : T.value = l;
|
|
161
155
|
}
|
|
162
|
-
}, { immediate: !0 }), A(() =>
|
|
156
|
+
}, { immediate: !0 }), A(() => c == null ? void 0 : c.name, () => {
|
|
163
157
|
var t, l, n;
|
|
164
|
-
const e =
|
|
165
|
-
|
|
166
|
-
const a =
|
|
167
|
-
if (a.length > 0 && T.value.length > 0 && (y.value = ((t = a[a.length - 1]) == null ? void 0 : t.children) || []), K.value =
|
|
168
|
-
const o =
|
|
169
|
-
|
|
158
|
+
const e = c == null ? void 0 : c.name;
|
|
159
|
+
r.value = d.value[e], j();
|
|
160
|
+
const a = u.value.filter((o) => o.topMenu);
|
|
161
|
+
if (a.length > 0 && T.value.length > 0 && (y.value = ((t = a[a.length - 1]) == null ? void 0 : t.children) || []), K.value = r != null && r.value ? [...a.map((o) => o.name), ...((l = r.value) == null ? void 0 : l.activatedKeys) || []] : [], g.value = r != null && r.value ? [r.value.name, ...((n = r.value) == null ? void 0 : n.activatedKeys) || []] : [], r.value) {
|
|
162
|
+
const o = u.value.filter((h, C) => C < u.value.length - 1), S = o.filter((h) => h.topMenu).map((h) => h.name), N = o.filter((h) => !h.topMenu).map((h) => h.name);
|
|
163
|
+
r.value.activatedKeys && r.value.activatedKeys.length > 0 && r.value.activatedKeys.forEach((h) => {
|
|
170
164
|
const C = d.value[h];
|
|
171
165
|
C && (C.topMenu ? S.push(h) : N.push(h));
|
|
172
166
|
}), p.value = Array.from(/* @__PURE__ */ new Set([...p.value, ...S])), M.value = Array.from(/* @__PURE__ */ new Set([...M.value, ...N]));
|
|
173
167
|
}
|
|
174
|
-
q(),
|
|
168
|
+
q(), s.hideTabs || z(), Q();
|
|
175
169
|
}, { immediate: !0 }), {
|
|
176
170
|
topMenuItems: T,
|
|
177
171
|
siderMenuItems: y,
|
|
@@ -179,7 +173,7 @@ const te = (c) => {
|
|
|
179
173
|
siderMenuSelectedKeys: g,
|
|
180
174
|
topMenuOpenKeys: p,
|
|
181
175
|
siderMenuOpenKeys: M,
|
|
182
|
-
activeMenuItem:
|
|
176
|
+
activeMenuItem: r,
|
|
183
177
|
menuItemMap: d,
|
|
184
178
|
breadcrumbItems: k,
|
|
185
179
|
tabs: f,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as f, computed as y, createElementBlock as n, openBlock as i, normalizeClass as m, createVNode as p, unref as d, withCtx as k, Fragment as g, renderList as h, createBlock as v } from "vue";
|
|
2
2
|
import { Tabs as S, TabPane as T } from "@arco-design/web-vue";
|
|
3
|
-
const z = "keyblade-pro-reuse-tabs",
|
|
3
|
+
const z = "keyblade-pro-reuse-tabs", q = /* @__PURE__ */ f({
|
|
4
4
|
__name: "pro-reuse-tabs",
|
|
5
5
|
props: {
|
|
6
6
|
tabs: {
|
|
@@ -30,31 +30,31 @@ const z = "keyblade-pro-reuse-tabs", x = /* @__PURE__ */ m({
|
|
|
30
30
|
"tab-delete": (e) => !0
|
|
31
31
|
},
|
|
32
32
|
setup(e, { emit: s }) {
|
|
33
|
-
const o = e,
|
|
33
|
+
const o = e, l = s, u = y(() => {
|
|
34
34
|
var t, r;
|
|
35
|
-
return (r = (t = o.tabs.find((a) => a.active)) == null ? void 0 : t.
|
|
36
|
-
}),
|
|
37
|
-
|
|
35
|
+
return (r = (t = o.tabs.find((a) => a.active)) == null ? void 0 : t.fullPath) != null ? r : void 0;
|
|
36
|
+
}), c = (t) => {
|
|
37
|
+
l("tab-click", String(t));
|
|
38
38
|
}, b = (t) => {
|
|
39
|
-
|
|
39
|
+
l("tab-delete", String(t));
|
|
40
40
|
};
|
|
41
|
-
return (t, r) => (
|
|
42
|
-
class:
|
|
41
|
+
return (t, r) => (i(), n("div", {
|
|
42
|
+
class: m(z)
|
|
43
43
|
}, [
|
|
44
|
-
p(
|
|
45
|
-
"active-key":
|
|
44
|
+
p(d(S), {
|
|
45
|
+
"active-key": u.value,
|
|
46
46
|
size: e.tabsSize,
|
|
47
47
|
type: e.tabsType,
|
|
48
48
|
"header-padding": e.tabsHeaderPadding,
|
|
49
49
|
editable: e.tabs.length > 1,
|
|
50
50
|
"hide-content": "",
|
|
51
51
|
"destroy-on-hide": "",
|
|
52
|
-
onTabClick:
|
|
52
|
+
onTabClick: c,
|
|
53
53
|
onDelete: b
|
|
54
54
|
}, {
|
|
55
55
|
default: k(() => [
|
|
56
|
-
(
|
|
57
|
-
key: a.
|
|
56
|
+
(i(!0), n(g, null, h(e.tabs, (a) => (i(), v(d(T), {
|
|
57
|
+
key: a.fullPath,
|
|
58
58
|
title: a.title
|
|
59
59
|
}, null, 8, ["title"]))), 128))
|
|
60
60
|
]),
|
|
@@ -64,5 +64,5 @@ const z = "keyblade-pro-reuse-tabs", x = /* @__PURE__ */ m({
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
export {
|
|
67
|
-
|
|
67
|
+
q as default
|
|
68
68
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue: any[];
|
|
3
|
+
prefixClsName: string;
|
|
4
|
+
draggable?: boolean;
|
|
5
|
+
checkable?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (...args: any[]) => void;
|
|
9
|
+
reset: (...args: any[]) => void;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
12
|
+
onReset?: ((...args: any[]) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
var A = Object.defineProperty, T = Object.defineProperties;
|
|
2
|
+
var U = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var C = Object.getOwnPropertySymbols;
|
|
4
|
+
var x = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var k = (o, a, t) => a in o ? A(o, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[a] = t, V = (o, a) => {
|
|
6
|
+
for (var t in a || (a = {}))
|
|
7
|
+
x.call(a, t) && k(o, t, a[t]);
|
|
8
|
+
if (C)
|
|
9
|
+
for (var t of C(a))
|
|
10
|
+
F.call(a, t) && k(o, t, a[t]);
|
|
11
|
+
return o;
|
|
12
|
+
}, h = (o, a) => T(o, U(a));
|
|
13
|
+
import { defineComponent as L, computed as y, ref as M, createBlock as f, openBlock as u, unref as s, withCtx as g, createVNode as p, createElementVNode as m, normalizeClass as i, createTextVNode as b, createElementBlock as N, Fragment as O, renderList as P, withModifiers as j, createCommentVNode as $, toDisplayString as q } from "vue";
|
|
14
|
+
import { Popover as G, Tooltip as H, Checkbox as D, Button as J, Divider as K } from "@arco-design/web-vue";
|
|
15
|
+
import { IconSettings as Q, IconDragDotVertical as R } from "@arco-design/web-vue/es/icon";
|
|
16
|
+
const W = ["draggable", "onDragstart", "onDragover"], ee = /* @__PURE__ */ L({
|
|
17
|
+
__name: "column-setting",
|
|
18
|
+
props: {
|
|
19
|
+
modelValue: {},
|
|
20
|
+
prefixClsName: {},
|
|
21
|
+
draggable: { type: Boolean },
|
|
22
|
+
checkable: { type: Boolean }
|
|
23
|
+
},
|
|
24
|
+
emits: ["update:modelValue", "reset"],
|
|
25
|
+
setup(o, { emit: a }) {
|
|
26
|
+
const t = o, v = a, B = y(() => t.modelValue.every((e) => e.checked)), I = y(() => {
|
|
27
|
+
const e = t.modelValue.filter((l) => l.checked).length;
|
|
28
|
+
return e > 0 && e < t.modelValue.length;
|
|
29
|
+
}), S = (e) => {
|
|
30
|
+
const l = typeof e == "boolean" ? e : !!e.length, n = t.modelValue.map((d) => h(V({}, d), {
|
|
31
|
+
checked: l
|
|
32
|
+
}));
|
|
33
|
+
v("update:modelValue", n);
|
|
34
|
+
}, r = M(null), w = (e) => {
|
|
35
|
+
r.value = e;
|
|
36
|
+
}, E = (e) => {
|
|
37
|
+
if (r.value === null || r.value === e) return;
|
|
38
|
+
const l = [...t.modelValue], n = l[r.value];
|
|
39
|
+
n && (l.splice(r.value, 1), l.splice(e, 0, n), r.value = e, v("update:modelValue", l));
|
|
40
|
+
}, z = () => {
|
|
41
|
+
r.value = null;
|
|
42
|
+
};
|
|
43
|
+
return (e, l) => (u(), f(s(G), {
|
|
44
|
+
position: "br",
|
|
45
|
+
trigger: "click",
|
|
46
|
+
"content-style": { padding: 0 }
|
|
47
|
+
}, {
|
|
48
|
+
content: g(() => [
|
|
49
|
+
m("div", {
|
|
50
|
+
class: i(`${e.prefixClsName}-column-setting`)
|
|
51
|
+
}, [
|
|
52
|
+
m("div", {
|
|
53
|
+
class: i(`${e.prefixClsName}-column-setting-title`),
|
|
54
|
+
style: { "margin-top": "10px" }
|
|
55
|
+
}, [
|
|
56
|
+
p(s(D), {
|
|
57
|
+
"model-value": B.value,
|
|
58
|
+
indeterminate: I.value,
|
|
59
|
+
onChange: S
|
|
60
|
+
}, {
|
|
61
|
+
default: g(() => l[2] || (l[2] = [
|
|
62
|
+
b(" 列展示 ")
|
|
63
|
+
])),
|
|
64
|
+
_: 1
|
|
65
|
+
}, 8, ["model-value", "indeterminate"]),
|
|
66
|
+
p(s(J), {
|
|
67
|
+
type: "text",
|
|
68
|
+
size: "mini",
|
|
69
|
+
onClick: l[0] || (l[0] = (n) => e.$emit("reset"))
|
|
70
|
+
}, {
|
|
71
|
+
default: g(() => l[3] || (l[3] = [
|
|
72
|
+
b("重置")
|
|
73
|
+
])),
|
|
74
|
+
_: 1
|
|
75
|
+
})
|
|
76
|
+
], 2),
|
|
77
|
+
p(s(K), { style: { margin: "0" } }),
|
|
78
|
+
m("div", {
|
|
79
|
+
class: i(`${e.prefixClsName}-column-setting-list`)
|
|
80
|
+
}, [
|
|
81
|
+
(u(!0), N(O, null, P(e.modelValue, (n, d) => (u(), N("div", {
|
|
82
|
+
key: String(n.dataIndex || (typeof n.title == "string" ? n.title : d)),
|
|
83
|
+
class: i([
|
|
84
|
+
`${e.prefixClsName}-column-setting-item`,
|
|
85
|
+
{ "is-dragging": r.value === d }
|
|
86
|
+
]),
|
|
87
|
+
style: { "margin-top": "10px", "margin-bottom": "10px", display: "flex", "align-items": "center" },
|
|
88
|
+
draggable: e.draggable,
|
|
89
|
+
onDragstart: (c) => e.draggable ? w(d) : void 0,
|
|
90
|
+
onDragover: j((c) => e.draggable ? E(d) : void 0, ["prevent"]),
|
|
91
|
+
onDragend: l[1] || (l[1] = (c) => e.draggable ? z() : void 0)
|
|
92
|
+
}, [
|
|
93
|
+
m("div", {
|
|
94
|
+
class: i(`${e.prefixClsName}-column-setting-item-left`)
|
|
95
|
+
}, [
|
|
96
|
+
e.draggable ? (u(), f(s(R), {
|
|
97
|
+
key: 0,
|
|
98
|
+
class: i(`${e.prefixClsName}-column-setting-item-drag`)
|
|
99
|
+
}, null, 8, ["class"])) : $("", !0),
|
|
100
|
+
e.checkable ? (u(), f(s(D), {
|
|
101
|
+
key: 1,
|
|
102
|
+
modelValue: n.checked,
|
|
103
|
+
"onUpdate:modelValue": (c) => n.checked = c
|
|
104
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : $("", !0),
|
|
105
|
+
m("span", {
|
|
106
|
+
class: i(`${e.prefixClsName}-column-setting-item-title`),
|
|
107
|
+
style: { "margin-left": "5px" }
|
|
108
|
+
}, q(n.title), 3)
|
|
109
|
+
], 2)
|
|
110
|
+
], 42, W))), 128))
|
|
111
|
+
], 2)
|
|
112
|
+
], 2)
|
|
113
|
+
]),
|
|
114
|
+
default: g(() => [
|
|
115
|
+
p(s(H), { content: "列设置" }, {
|
|
116
|
+
default: g(() => [
|
|
117
|
+
m("div", {
|
|
118
|
+
class: i(`${e.prefixClsName}-header-icon`)
|
|
119
|
+
}, [
|
|
120
|
+
p(s(Q))
|
|
121
|
+
], 2)
|
|
122
|
+
]),
|
|
123
|
+
_: 1
|
|
124
|
+
})
|
|
125
|
+
]),
|
|
126
|
+
_: 1
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
export {
|
|
131
|
+
ee as default
|
|
132
|
+
};
|
package/es/pro-table/index.d.ts
CHANGED
|
@@ -78,7 +78,10 @@ declare const ProTable: {
|
|
|
78
78
|
stickyHeader: number | boolean;
|
|
79
79
|
showEmptyTree: boolean;
|
|
80
80
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
81
|
-
$slots: Partial<Record<NonNullable<string | number>, (_: any) => any
|
|
81
|
+
$slots: Partial<Record<NonNullable<string | number>, (_: any) => any>> & {
|
|
82
|
+
'pagination-left'?(_: {}): any;
|
|
83
|
+
'pagination-left'?(_: {}): any;
|
|
84
|
+
};
|
|
82
85
|
}) & {
|
|
83
86
|
install: (app: App) => void;
|
|
84
87
|
};
|
|
@@ -2,7 +2,10 @@ import { PaginationProps } from '@arco-design/web-vue';
|
|
|
2
2
|
import { IProTable, IProTableColumn } from './interface';
|
|
3
3
|
declare function __VLS_template(): {
|
|
4
4
|
attrs: Partial<{}>;
|
|
5
|
-
slots: Partial<Record<NonNullable<string | number>, (_: any) => any
|
|
5
|
+
slots: Partial<Record<NonNullable<string | number>, (_: any) => any>> & {
|
|
6
|
+
'pagination-left'?(_: {}): any;
|
|
7
|
+
'pagination-left'?(_: {}): any;
|
|
8
|
+
};
|
|
6
9
|
refs: {};
|
|
7
10
|
rootEl: HTMLDivElement;
|
|
8
11
|
};
|
|
@@ -1,38 +1,42 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
1
|
+
var L = Object.defineProperty, D = Object.defineProperties;
|
|
2
|
+
var H = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var V = Object.getOwnPropertySymbols;
|
|
4
|
+
var T = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var z = (a, e, o) => e in a ? L(a, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : a[e] = o, m = (a, e) => {
|
|
6
|
+
for (var o in e || (e = {}))
|
|
7
|
+
T.call(e, o) && z(a, o, e[o]);
|
|
8
|
+
if (V)
|
|
9
|
+
for (var o of V(e))
|
|
10
|
+
U.call(e, o) && z(a, o, e[o]);
|
|
11
|
+
return a;
|
|
12
|
+
}, $ = (a, e) => D(a, H(e));
|
|
13
|
+
var N = (a, e, o) => new Promise((S, b) => {
|
|
14
|
+
var w = (r) => {
|
|
15
15
|
try {
|
|
16
|
-
p(
|
|
17
|
-
} catch (
|
|
18
|
-
|
|
16
|
+
p(o.next(r));
|
|
17
|
+
} catch (f) {
|
|
18
|
+
b(f);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, l = (r) => {
|
|
21
21
|
try {
|
|
22
|
-
p(
|
|
23
|
-
} catch (
|
|
24
|
-
|
|
22
|
+
p(o.throw(r));
|
|
23
|
+
} catch (f) {
|
|
24
|
+
b(f);
|
|
25
25
|
}
|
|
26
|
-
}, p = (
|
|
27
|
-
p((
|
|
26
|
+
}, p = (r) => r.done ? S(r.value) : Promise.resolve(r.value).then(w, l);
|
|
27
|
+
p((o = o.apply(a, e)).next());
|
|
28
28
|
});
|
|
29
|
-
import { defineComponent as
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { conclude as
|
|
33
|
-
import { globalProps as
|
|
34
|
-
import { useClipboard as
|
|
35
|
-
|
|
29
|
+
import { defineComponent as F, useSlots as q, useAttrs as G, computed as d, ref as J, watch as Q, createElementBlock as C, openBlock as g, normalizeClass as h, createCommentVNode as k, createVNode as B, renderSlot as E, createElementVNode as j, unref as y, mergeProps as K, createSlots as W, withCtx as x, normalizeStyle as X, withModifiers as Y, createBlock as Z, toDisplayString as ee, renderList as te, normalizeProps as oe, guardReactiveProps as ae } from "vue";
|
|
30
|
+
import { Table as le, Tooltip as ne, Message as se } from "@arco-design/web-vue";
|
|
31
|
+
import { IconCopy as re } from "@arco-design/web-vue/es/icon";
|
|
32
|
+
import { conclude as ie } from "vue-global-config";
|
|
33
|
+
import { globalProps as ue } from "../global-props.js";
|
|
34
|
+
import { useClipboard as de } from "@vueuse/core";
|
|
35
|
+
import M from "./column-setting.vue.js";
|
|
36
|
+
const pe = {
|
|
37
|
+
key: 0,
|
|
38
|
+
style: { "margin-left": "10px" }
|
|
39
|
+
}, ce = ["onClick"], u = "keyblade-pro-table", ke = /* @__PURE__ */ F({
|
|
36
40
|
__name: "index",
|
|
37
41
|
props: {
|
|
38
42
|
size: { default: "large" },
|
|
@@ -96,181 +100,94 @@ const $e = ["draggable", "onDragstart", "onDragover"], Se = ["onClick"], s = "ke
|
|
|
96
100
|
"onUpdate:selectedKeys": {},
|
|
97
101
|
"onUpdate:expandedKeys": {}
|
|
98
102
|
},
|
|
99
|
-
setup(
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
102
|
-
const
|
|
103
|
+
setup(a) {
|
|
104
|
+
const e = a, o = q(), { copy: S } = de(), b = G(), w = d(() => ie([e, ue.table || {}]) || {}), l = d(() => {
|
|
105
|
+
if (e.options === !1) return !1;
|
|
106
|
+
const t = {
|
|
103
107
|
setting: !0
|
|
104
108
|
};
|
|
105
|
-
return
|
|
106
|
-
}), p =
|
|
107
|
-
var
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
g.value = t.columns.map((e) => I(B({}, e), {
|
|
109
|
+
return e.options === !0 || e.options === void 0 ? t : m(m({}, t), e.options);
|
|
110
|
+
}), p = d(() => typeof l.value == "object" && typeof l.value.setting == "object" ? l.value.setting.draggable !== !1 : !0), r = d(() => typeof l.value == "object" && typeof l.value.setting == "object" ? l.value.setting.checkable !== !1 : !0), f = d(() => {
|
|
111
|
+
var n, s;
|
|
112
|
+
return !((n = e.pagination) == null ? void 0 : n.total) && !((s = e.data) != null && s.length) && o["pagination-left"];
|
|
113
|
+
}), I = d(() => !!l.value && !!l.value.setting && e.pagination), P = d(() => !!l.value && !!l.value.setting && !e.pagination), c = J([]), O = () => {
|
|
114
|
+
c.value = e.columns.map((t) => $(m({}, t), {
|
|
112
115
|
checked: !0
|
|
113
116
|
}));
|
|
114
117
|
};
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
const e = g.value.filter((l) => l.checked).length;
|
|
118
|
-
return e > 0 && e < g.value.length;
|
|
119
|
-
}), U = (e) => {
|
|
120
|
-
const l = typeof e == "boolean" ? e : !!e.length;
|
|
121
|
-
g.value.forEach((n) => {
|
|
122
|
-
n.checked = l;
|
|
123
|
-
});
|
|
124
|
-
}, H = () => {
|
|
118
|
+
Q(() => e.columns, O, { immediate: !0 });
|
|
119
|
+
const R = () => {
|
|
125
120
|
O();
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const l = [...g.value], n = l[h.value];
|
|
131
|
-
n && (l.splice(h.value, 1), l.splice(e, 0, n), h.value = e, g.value = l);
|
|
132
|
-
}, J = () => {
|
|
133
|
-
h.value = null;
|
|
134
|
-
}, Q = b(() => g.value.filter((e) => e.checked).map((e) => e.clipboard ? I(B({}, e), {
|
|
135
|
-
hover: e.hover === void 0 ? !0 : e.hover,
|
|
136
|
-
slotName: `${s}-clipboard`
|
|
137
|
-
}) : e)), W = (e) => z(null, null, function* () {
|
|
121
|
+
}, _ = d(() => c.value.filter((t) => t.checked).map((t) => t.clipboard ? $(m({}, t), {
|
|
122
|
+
hover: t.hover === void 0 ? !0 : t.hover,
|
|
123
|
+
slotName: `${u}-clipboard`
|
|
124
|
+
}) : t)), A = (t) => N(null, null, function* () {
|
|
138
125
|
try {
|
|
139
|
-
yield
|
|
140
|
-
} catch (
|
|
141
|
-
console.info(
|
|
126
|
+
yield S(t), se.success("拷贝成功!");
|
|
127
|
+
} catch (n) {
|
|
128
|
+
console.info(n);
|
|
142
129
|
}
|
|
143
130
|
});
|
|
144
|
-
return (
|
|
145
|
-
class: u
|
|
131
|
+
return (t, n) => (g(), C("div", {
|
|
132
|
+
class: h(u)
|
|
146
133
|
}, [
|
|
147
|
-
|
|
134
|
+
f.value ? (g(), C("div", {
|
|
148
135
|
key: 0,
|
|
149
|
-
class:
|
|
136
|
+
class: h(`${u}-header`)
|
|
150
137
|
}, [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
v("div", {
|
|
168
|
-
class: u(`${s}-column-setting`)
|
|
169
|
-
}, [
|
|
170
|
-
v("div", {
|
|
171
|
-
class: u(`${s}-column-setting-title`)
|
|
172
|
-
}, [
|
|
173
|
-
C(r(P), {
|
|
174
|
-
"model-value": T.value,
|
|
175
|
-
indeterminate: F.value,
|
|
176
|
-
onChange: U
|
|
177
|
-
}, {
|
|
178
|
-
default: y(() => l[1] || (l[1] = [
|
|
179
|
-
N(" 列展示 ")
|
|
180
|
-
])),
|
|
181
|
-
_: 1
|
|
182
|
-
}, 8, ["model-value", "indeterminate"]),
|
|
183
|
-
C(r(ge), {
|
|
184
|
-
type: "text",
|
|
185
|
-
size: "mini",
|
|
186
|
-
onClick: H
|
|
187
|
-
}, {
|
|
188
|
-
default: y(() => l[2] || (l[2] = [
|
|
189
|
-
N("重置")
|
|
190
|
-
])),
|
|
191
|
-
_: 1
|
|
192
|
-
})
|
|
193
|
-
], 2),
|
|
194
|
-
C(r(me), { style: { margin: "0" } }),
|
|
195
|
-
v("div", {
|
|
196
|
-
class: u(`${s}-column-setting-list`)
|
|
197
|
-
}, [
|
|
198
|
-
(m(!0), $(se, null, A(g.value, (n, o) => (m(), $("div", {
|
|
199
|
-
key: String(n.dataIndex || (typeof n.title == "string" ? n.title : o)),
|
|
200
|
-
class: u([
|
|
201
|
-
`${s}-column-setting-item`,
|
|
202
|
-
{ "is-dragging": h.value === o }
|
|
203
|
-
]),
|
|
204
|
-
style: { "margin-top": "10px", "margin-bottom": "10px", display: "flex", "align-items": "center" },
|
|
205
|
-
draggable: p.value,
|
|
206
|
-
onDragstart: (d) => p.value ? q(o) : void 0,
|
|
207
|
-
onDragover: K((d) => p.value ? G(o) : void 0, ["prevent"]),
|
|
208
|
-
onDragend: l[0] || (l[0] = (d) => p.value ? J() : void 0)
|
|
209
|
-
}, [
|
|
210
|
-
v("div", {
|
|
211
|
-
class: u(`${s}-column-setting-item-left`)
|
|
212
|
-
}, [
|
|
213
|
-
p.value ? (m(), D(r(be), {
|
|
214
|
-
key: 0,
|
|
215
|
-
class: u(`${s}-column-setting-item-drag`)
|
|
216
|
-
}, null, 8, ["class"])) : k("", !0),
|
|
217
|
-
f.value ? (m(), D(r(P), {
|
|
218
|
-
key: 1,
|
|
219
|
-
modelValue: n.checked,
|
|
220
|
-
"onUpdate:modelValue": (d) => n.checked = d
|
|
221
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])) : k("", !0),
|
|
222
|
-
v("span", {
|
|
223
|
-
class: u(`${s}-column-setting-item-title`),
|
|
224
|
-
style: { "margin-left": "5px" }
|
|
225
|
-
}, M(n.title), 3)
|
|
226
|
-
], 2)
|
|
227
|
-
], 42, $e))), 128))
|
|
228
|
-
], 2)
|
|
229
|
-
], 2)
|
|
230
|
-
]),
|
|
231
|
-
default: y(() => [
|
|
232
|
-
C(r(L), { content: "列设置" }, {
|
|
233
|
-
default: y(() => [
|
|
234
|
-
v("div", {
|
|
235
|
-
class: u(`${s}-header-icon`)
|
|
236
|
-
}, [
|
|
237
|
-
C(r(he))
|
|
238
|
-
], 2)
|
|
239
|
-
]),
|
|
240
|
-
_: 1
|
|
241
|
-
})
|
|
242
|
-
]),
|
|
243
|
-
_: 1
|
|
244
|
-
})) : k("", !0)
|
|
245
|
-
]),
|
|
246
|
-
_: 1
|
|
247
|
-
})
|
|
248
|
-
], 2)) : k("", !0)
|
|
138
|
+
E(t.$slots, "pagination-left")
|
|
139
|
+
], 2)) : k("", !0),
|
|
140
|
+
P.value ? (g(), C("div", {
|
|
141
|
+
key: 1,
|
|
142
|
+
class: h(`${u}-header`)
|
|
143
|
+
}, [
|
|
144
|
+
E(t.$slots, "pagination-left"),
|
|
145
|
+
n[2] || (n[2] = j("div", null, null, -1)),
|
|
146
|
+
B(M, {
|
|
147
|
+
modelValue: c.value,
|
|
148
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => c.value = s),
|
|
149
|
+
"prefix-cls-name": u,
|
|
150
|
+
draggable: p.value,
|
|
151
|
+
checkable: r.value,
|
|
152
|
+
onReset: R
|
|
153
|
+
}, null, 8, ["modelValue", "draggable", "checkable"])
|
|
249
154
|
], 2)) : k("", !0),
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
155
|
+
B(y(le), K(K(w.value, y(b)), { columns: _.value }), W({
|
|
156
|
+
"pagination-right": x(() => [
|
|
157
|
+
I.value ? (g(), C("div", pe, [
|
|
158
|
+
B(M, {
|
|
159
|
+
modelValue: c.value,
|
|
160
|
+
"onUpdate:modelValue": n[1] || (n[1] = (s) => c.value = s),
|
|
161
|
+
"prefix-cls-name": u,
|
|
162
|
+
draggable: p.value,
|
|
163
|
+
checkable: r.value,
|
|
164
|
+
onReset: R
|
|
165
|
+
}, null, 8, ["modelValue", "draggable", "checkable"])
|
|
166
|
+
])) : k("", !0)
|
|
167
|
+
]),
|
|
168
|
+
[`${u}-clipboard`]: x(({ record: s, column: i }) => [
|
|
169
|
+
B(y(ne), {
|
|
170
|
+
style: X({ display: i.ellipsis && i.hover ? "" : "none" }),
|
|
171
|
+
content: s[i.dataIndex]
|
|
255
172
|
}, {
|
|
256
|
-
default:
|
|
257
|
-
|
|
258
|
-
class:
|
|
259
|
-
onClick:
|
|
173
|
+
default: x(() => [
|
|
174
|
+
j("div", {
|
|
175
|
+
class: h([`${u}-clipboard`, i.ellipsis ? `${u}-ellipsis` : ""]),
|
|
176
|
+
onClick: Y((v) => A(s[i.dataIndex]), ["stop"])
|
|
260
177
|
}, [
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
], 10,
|
|
178
|
+
j("span", null, ee(s[i.dataIndex]), 1),
|
|
179
|
+
i.copyIcon ? (g(), Z(y(re), { key: 0 })) : k("", !0)
|
|
180
|
+
], 10, ce)
|
|
264
181
|
]),
|
|
265
182
|
_: 2
|
|
266
183
|
}, 1032, ["style", "content"])
|
|
267
184
|
]),
|
|
268
185
|
_: 2
|
|
269
186
|
}, [
|
|
270
|
-
|
|
271
|
-
name:
|
|
272
|
-
fn:
|
|
273
|
-
|
|
187
|
+
te(y(o), (s, i) => ({
|
|
188
|
+
name: i,
|
|
189
|
+
fn: x((v) => [
|
|
190
|
+
E(t.$slots, i, oe(ae(v != null ? v : {})))
|
|
274
191
|
])
|
|
275
192
|
}))
|
|
276
193
|
]), 1040, ["columns"])
|
|
@@ -278,5 +195,5 @@ const $e = ["draggable", "onDragstart", "onDragover"], Se = ["onClick"], s = "ke
|
|
|
278
195
|
}
|
|
279
196
|
});
|
|
280
197
|
export {
|
|
281
|
-
|
|
198
|
+
ke as default
|
|
282
199
|
};
|
package/package.json
CHANGED