bp-aicc-editor 1.2.521 → 1.2.522
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/lib/{ScreenPreview-CV95NWOd.js → ScreenPreview-yUHo60be.js} +51 -105
- package/lib/atlas-BMjKIOwk.js +3891 -0
- package/lib/{button-base-DHNVBrQ9.js → button-base-CXl1z-_m.js} +1 -1
- package/lib/{cache-lsjsKZHu.js → cache-DbHSDjJy.js} +1 -1
- package/lib/config-provider-Bui8m4GV.js +62 -0
- package/lib/{container-group-DqAcKEBy.js → container-group-D6Extorz.js} +1 -1
- package/lib/{copy-C5Pi6nJh.js → copy-CsCmPy4J.js} +1 -1
- package/lib/{datav-BER95ty-.js → datav-BTD-HJhV.js} +27 -27
- package/lib/{delete-C2EW4JCs.js → delete-COj0ilHh.js} +1 -1
- package/lib/{divider-BazBGRgV.js → divider-B3K_URZc.js} +1 -1
- package/lib/dropdown-CWvnuJsO.js +105 -0
- package/lib/{edit-B2pfd2q1.js → edit-vdJaEine.js} +1 -1
- package/lib/{el-form-item-BDdxk5F5.js → el-form-item-BbaNohQv.js} +51 -51
- package/lib/{el-link-D2ol9BHQ.js → el-link-Dq721Q7-.js} +12 -12
- package/lib/{el-loading-Cgwgez55.js → el-loading-DOxnN3bm.js} +17 -17
- package/lib/{fullscreen-OChDsSnk.js → fullscreen-DXSogbcG.js} +1 -1
- package/lib/{image-C5ZAY3yt.js → image-Cu7JTK9-.js} +1 -1
- package/lib/{index-Ci8AbyIq.js → index-68soBnbK.js} +8 -8
- package/lib/{index-BatyRVpL.js → index-B-d8WIg1.js} +7 -7
- package/lib/{index-BfIEunKC.js → index-B4zV3cxV.js} +18 -17
- package/lib/{index-CZJriuFt.js → index-B8QqTLfg.js} +4974 -4898
- package/lib/index-BBMItxtW.js +619 -0
- package/lib/{index-CGrR_i0u.js → index-BMm0MRz5.js} +14 -15
- package/lib/index-BMn8EzMD.js +1027 -0
- package/lib/index-BNTW8F-9.js +322 -0
- package/lib/index-BTI518b1.js +69 -0
- package/lib/{index-BWPVi43E.js → index-BZxUAT4z.js} +4 -4
- package/lib/{index-Ck7uFsPE.js → index-BdYTc41r.js} +24 -24
- package/lib/index-BfI55Ioc.js +404 -0
- package/lib/{index-BhP9eBCp.js → index-BmAcetSf.js} +19 -20
- package/lib/index-C35Yp3i8.js +545 -0
- package/lib/{index-B19lEYui.js → index-C6GUNRx9.js} +2 -2
- package/lib/index-CC28_8Jl.js +567 -0
- package/lib/index-CDhmvVt8.js +338 -0
- package/lib/index-CDx0y0fp.js +144 -0
- package/lib/{el-button-DvLKp6Ga.js → index-CJjljoJG.js} +106 -106
- package/lib/index-CNCgXPiO.js +235 -0
- package/lib/{index-CWbZmzNT.js → index-CPa_MnOD.js} +30 -29
- package/lib/index-CW6ljdNf.js +1582 -0
- package/lib/index-C_WopEui.js +513 -0
- package/lib/{index-CX_Ghcb6.js → index-CejowjGd.js} +56 -53
- package/lib/{index-BwCQWH-N.js → index-CfZXOvi-.js} +42 -40
- package/lib/{index-CVsy2qTh.js → index-CgzRTmPh.js} +16 -15
- package/lib/index-CmzuNM9v.js +32 -0
- package/lib/index-CrxcAFt8.js +5343 -0
- package/lib/{index-C7k49L2T.js → index-CuHA7QXu.js} +10 -10
- package/lib/{index-qVyixI57.js → index-CyBGAB7D.js} +21 -20
- package/lib/index-D6J7coU0.js +129 -0
- package/lib/index-DDHxrdAo.js +1773 -0
- package/lib/index-DDL-yqq0.js +1401 -0
- package/lib/{index-BPcvYtHf.js → index-DOxy-bey.js} +6 -6
- package/lib/{index-CVE37oE7.js → index-DOyr0BHr.js} +7 -7
- package/lib/index-DPOanmXI.js +887 -0
- package/lib/{index-3pzVrvby.js → index-DR_husZg.js} +46 -46
- package/lib/{el-tab-pane-DD2eM9rB.js → index-DUzOCQrW.js} +125 -124
- package/lib/{index-CGFEhUh9.js → index-DVYI-g8Q.js} +53 -52
- package/lib/index-DVyjilLy.js +51 -0
- package/lib/{index-CJyYGViv.js → index-DWAJ9GyC.js} +9 -9
- package/lib/index-Dj2qCwPD.js +178 -0
- package/lib/{index-D4X0_jbv.js → index-Dx2Gld1J.js} +32 -32
- package/lib/{index-C2XeCqtq.js → index-E9T-y2Yz.js} +3 -3
- package/lib/{index-Buoc0ISP.js → index-FlmXAW0Z.js} +60 -58
- package/lib/index-NqqOvc6V.js +169 -0
- package/lib/{index-BkdiXCRY.js → index-ObKRNOmJ.js} +6 -7
- package/lib/index-bOWjoplU.js +448 -0
- package/lib/{index-CXQ258ID.js → index-buU8mDzi.js} +15 -16
- package/lib/{index-tbhuYbb0.js → index-mGKAWDJZ.js} +11 -12
- package/lib/index.es.js +4 -4
- package/lib/index.umd.js +46 -40
- package/lib/{layer-setting-panel-VvDSQ-cn.js → layer-setting-panel-BGPj32nP.js} +2 -2
- package/lib/{line-show-Bp4G-LqO.js → line-show-DUn1bu_P.js} +1 -1
- package/lib/{multi-layout-config-drSy7ezf.js → multi-layout-config-BTWxJeuc.js} +7 -8
- package/lib/{multiline-text-D89kYrA2.js → multiline-text-CPJdCWJ7.js} +1 -1
- package/lib/{navigation-YAGxZ0OT.js → navigation-ZLJaBOUj.js} +1 -1
- package/lib/page-config-CHP07Ndf.js +253 -0
- package/lib/{page-tabs-wFeNBY4c.js → page-tabs-CKLhgrip.js} +45 -41
- package/lib/{plus-3mdO6yXY.js → plus-xgpQU22I.js} +1 -1
- package/lib/raf-CJog_tcv.js +6 -0
- package/lib/refs-DZMysoBI.js +8 -0
- package/lib/{requestOld-DRcjsmRQ.js → requestOld-CaGzCXrV.js} +97 -96
- package/lib/{schema-BsnIOGBI.js → schema-BaFWGeFt.js} +1 -1
- package/lib/{schema-_APJMUW3.js → schema-CUR-UK2S.js} +44 -41
- package/lib/{schema-BavJE-SK.js → schema-WUk7XVq7.js} +58 -54
- package/lib/{schema-qKI1F8Bt.js → schema-geZfujv8.js} +1 -1
- package/lib/{schema-BflqDw-a.js → schema-iosjRxCC.js} +1 -1
- package/lib/{schema-Bo30dbBx.js → schema-tuPllxn6.js} +1 -1
- package/lib/scroll-CWfl60Tu.js +58 -0
- package/lib/{setting-panel-BgzN3BUP.js → setting-panel-0qLcwYyT.js} +154 -151
- package/lib/{show-C4AeWlKj.js → show-BCwE3hGY.js} +1 -1
- package/lib/{stepper-D5EFeJWG.js → stepper-Bud1Jppr.js} +1 -1
- package/lib/strings-BvUQWzDM.js +6 -0
- package/lib/{switch-B0dR4LM_.js → switch-VlaUmSpJ.js} +1 -1
- package/lib/{unlock-Cq9PLhBA.js → unlock-B2FVPQlm.js} +1 -1
- package/lib/{use-env-url-BM9dgwx_.js → use-env-url-D1p8ib2L.js} +1 -1
- package/lib/use-global-config-D_yoqf3Q.js +90 -0
- package/lib/validator-BOXH2OMA.js +5 -0
- package/lib/{vnode-B_Dj8zxu.js → vnode-Bxs1g06p.js} +1 -1
- package/package.json +1 -1
- package/lib/atlas-DsmLq2V0.js +0 -38
- package/lib/el-overlay-BK0_UIU6.js +0 -704
- package/lib/index-B1yAU2Cb.js +0 -390
- package/lib/index-BCFXuK7k.js +0 -68
- package/lib/index-BD4Jwo8Z.js +0 -449
- package/lib/index-BMWqf88L.js +0 -356
- package/lib/index-Belsn8kt.js +0 -107
- package/lib/index-CIADz1i0.js +0 -8494
- package/lib/index-DKTrbqcA.js +0 -56
- package/lib/index-Ge_d2xqD.js +0 -127
- package/lib/page-config-Cmsi8Vpr.js +0 -582
- package/lib/strings-_mHAdgA4.js +0 -6
- package/lib/use-global-config-CflpFoxU.js +0 -115
|
@@ -0,0 +1,3891 @@
|
|
|
1
|
+
import { isVNode as Xt, Comment as Gt, Fragment as Ie, createVNode as ge, render as kt, getCurrentInstance as ue, ref as E, unref as ae, computed as D, watch as ie, toRefs as zl, nextTick as Pe, isRef as Il, defineComponent as Oe, resolveComponent as ce, createBlock as ke, openBlock as J, withCtx as Ne, createElementVNode as se, normalizeClass as U, renderSlot as Fe, createElementBlock as fe, renderList as Mt, createTextVNode as St, toDisplayString as He, onBeforeMount as Qt, onMounted as je, onUpdated as _l, onUnmounted as xt, inject as Ce, h as P, reactive as Dl, onBeforeUnmount as Et, watchEffect as ct, resolveDirective as Vl, normalizeStyle as Be, withDirectives as st, createCommentVNode as Ee, vShow as At, provide as jl } from "vue";
|
|
2
|
+
import { E as Jt } from "./index-BfI55Ioc.js";
|
|
3
|
+
import { bi as Me, aU as xe, i as Ae, V as ve, az as he, R as de, bT as Ue, n as Zt, k as el, al as Ul, ak as Le, bU as tl, aL as $t, ai as ll, j as tt, h as ye, t as at, af as lt, Q as _e, g as Rt, b0 as Yl, bV as ql, ar as Xl, E as Nt, aV as ze, M as Gl, N as Re, bQ as Xe, aH as De, T as Ql, aJ as nt, B as Pt, b6 as Kt, at as Jl, a6 as Zl, G as nl, aS as en, a5 as tn, w as ln, an as nn } from "./index-B8QqTLfg.js";
|
|
4
|
+
import { g as ol } from "./use-global-config-D_yoqf3Q.js";
|
|
5
|
+
import { a as on, E as Ve } from "./index-C35Yp3i8.js";
|
|
6
|
+
import { r as an } from "./raf-CJog_tcv.js";
|
|
7
|
+
import { s as rn } from "./requestOld-CaGzCXrV.js";
|
|
8
|
+
const it = function(e) {
|
|
9
|
+
var t;
|
|
10
|
+
return (t = e.target) == null ? void 0 : t.closest("td");
|
|
11
|
+
}, sn = function(e, t, n, l, r) {
|
|
12
|
+
if (!t && !l && (!r || de(r) && !r.length))
|
|
13
|
+
return e;
|
|
14
|
+
ve(n) ? n = n === "descending" ? -1 : 1 : n = n && n < 0 ? -1 : 1;
|
|
15
|
+
const i = l ? null : function(o, s) {
|
|
16
|
+
return r ? tl(ll(r), (a) => ve(a) ? $t(o, a) : a(o, s, e)) : (t !== "$key" && tt(o) && "$value" in o && (o = o.$value), [
|
|
17
|
+
tt(o) ? t ? $t(o, t) : null : o
|
|
18
|
+
]);
|
|
19
|
+
}, f = function(o, s) {
|
|
20
|
+
var a, u, d, m, h, p;
|
|
21
|
+
if (l)
|
|
22
|
+
return l(o.value, s.value);
|
|
23
|
+
for (let b = 0, C = (u = (a = o.key) == null ? void 0 : a.length) != null ? u : 0; b < C; b++) {
|
|
24
|
+
if (((d = o.key) == null ? void 0 : d[b]) < ((m = s.key) == null ? void 0 : m[b]))
|
|
25
|
+
return -1;
|
|
26
|
+
if (((h = o.key) == null ? void 0 : h[b]) > ((p = s.key) == null ? void 0 : p[b]))
|
|
27
|
+
return 1;
|
|
28
|
+
}
|
|
29
|
+
return 0;
|
|
30
|
+
};
|
|
31
|
+
return e.map((o, s) => ({
|
|
32
|
+
value: o,
|
|
33
|
+
index: s,
|
|
34
|
+
key: i ? i(o, s) : null
|
|
35
|
+
})).sort((o, s) => {
|
|
36
|
+
let a = f(o, s);
|
|
37
|
+
return a || (a = o.index - s.index), a * +n;
|
|
38
|
+
}).map((o) => o.value);
|
|
39
|
+
}, al = function(e, t) {
|
|
40
|
+
let n = null;
|
|
41
|
+
return e.columns.forEach((l) => {
|
|
42
|
+
l.id === t && (n = l);
|
|
43
|
+
}), n;
|
|
44
|
+
}, un = function(e, t) {
|
|
45
|
+
let n = null;
|
|
46
|
+
for (let l = 0; l < e.columns.length; l++) {
|
|
47
|
+
const r = e.columns[l];
|
|
48
|
+
if (r.columnKey === t) {
|
|
49
|
+
n = r;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return n || Ul("ElTable", `No column matching with column-key: ${t}`), n;
|
|
54
|
+
}, Bt = function(e, t, n) {
|
|
55
|
+
const l = (t.className || "").match(
|
|
56
|
+
new RegExp(`${n}-table_[^\\s]+`, "gm")
|
|
57
|
+
);
|
|
58
|
+
return l ? al(e, l[0]) : null;
|
|
59
|
+
}, te = (e, t) => {
|
|
60
|
+
if (!e)
|
|
61
|
+
throw new Error("Row is required when get row identity");
|
|
62
|
+
if (ve(t)) {
|
|
63
|
+
if (!t.includes("."))
|
|
64
|
+
return `${e[t]}`;
|
|
65
|
+
const n = t.split(".");
|
|
66
|
+
let l = e;
|
|
67
|
+
for (const r of n)
|
|
68
|
+
l = l[r];
|
|
69
|
+
return `${l}`;
|
|
70
|
+
} else if (he(t))
|
|
71
|
+
return t.call(null, e);
|
|
72
|
+
return "";
|
|
73
|
+
}, $e = function(e, t, n = !1, l = "children") {
|
|
74
|
+
const r = e || [], i = {};
|
|
75
|
+
return r.forEach((f, o) => {
|
|
76
|
+
if (i[te(f, t)] = { row: f, index: o }, n) {
|
|
77
|
+
const s = f[l];
|
|
78
|
+
de(s) && Object.assign(i, $e(s, t, !0, l));
|
|
79
|
+
}
|
|
80
|
+
}), i;
|
|
81
|
+
};
|
|
82
|
+
function dn(e, t) {
|
|
83
|
+
const n = {};
|
|
84
|
+
let l;
|
|
85
|
+
for (l in e)
|
|
86
|
+
n[l] = e[l];
|
|
87
|
+
for (l in t)
|
|
88
|
+
if (Me(t, l)) {
|
|
89
|
+
const r = t[l];
|
|
90
|
+
xe(r) || (n[l] = r);
|
|
91
|
+
}
|
|
92
|
+
return n;
|
|
93
|
+
}
|
|
94
|
+
function Lt(e) {
|
|
95
|
+
return e === "" || xe(e) || (e = Number.parseInt(e, 10), Number.isNaN(e) && (e = "")), e;
|
|
96
|
+
}
|
|
97
|
+
function rl(e) {
|
|
98
|
+
return e === "" || xe(e) || (e = Lt(e), Number.isNaN(e) && (e = 80)), e;
|
|
99
|
+
}
|
|
100
|
+
function cn(e) {
|
|
101
|
+
return Ae(e) ? e : ve(e) ? /^\d+(?:px)?$/.test(e) ? Number.parseInt(e, 10) : e : null;
|
|
102
|
+
}
|
|
103
|
+
function fn(...e) {
|
|
104
|
+
return e.length === 0 ? (t) => t : e.length === 1 ? e[0] : e.reduce(
|
|
105
|
+
(t, n) => (...l) => t(n(...l))
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
function ot(e, t, n, l, r, i, f) {
|
|
109
|
+
let o = i ?? 0, s = !1;
|
|
110
|
+
const u = (() => {
|
|
111
|
+
if (!f)
|
|
112
|
+
return e.indexOf(t);
|
|
113
|
+
const b = te(t, f);
|
|
114
|
+
return e.findIndex((C) => te(C, f) === b);
|
|
115
|
+
})(), d = u !== -1, m = r?.call(null, t, o), h = (b) => {
|
|
116
|
+
b === "add" ? e.push(t) : e.splice(u, 1), s = !0;
|
|
117
|
+
}, p = (b) => {
|
|
118
|
+
let C = 0;
|
|
119
|
+
const O = l?.children && b[l.children];
|
|
120
|
+
return O && de(O) && (C += O.length, O.forEach((N) => {
|
|
121
|
+
C += p(N);
|
|
122
|
+
})), C;
|
|
123
|
+
};
|
|
124
|
+
return (!r || m) && (Le(n) ? n && !d ? h("add") : !n && d && h("remove") : h(d ? "remove" : "add")), !l?.checkStrictly && l?.children && de(t[l.children]) && t[l.children].forEach((b) => {
|
|
125
|
+
const C = ot(
|
|
126
|
+
e,
|
|
127
|
+
b,
|
|
128
|
+
n ?? !d,
|
|
129
|
+
l,
|
|
130
|
+
r,
|
|
131
|
+
o + 1,
|
|
132
|
+
f
|
|
133
|
+
);
|
|
134
|
+
o += p(b) + 1, C && (s = C);
|
|
135
|
+
}), s;
|
|
136
|
+
}
|
|
137
|
+
function hn(e, t, n = "children", l = "hasChildren", r = !1) {
|
|
138
|
+
const i = (o) => !(de(o) && o.length);
|
|
139
|
+
function f(o, s, a) {
|
|
140
|
+
t(o, s, a), s.forEach((u) => {
|
|
141
|
+
if (u[l] && r) {
|
|
142
|
+
t(u, null, a + 1);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const d = u[n];
|
|
146
|
+
i(d) || f(u, d, a + 1);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
e.forEach((o) => {
|
|
150
|
+
if (o[l] && r) {
|
|
151
|
+
t(o, null, 0);
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const s = o[n];
|
|
155
|
+
i(s) || f(o, s, 0);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
const vn = (e, t, n, l) => {
|
|
159
|
+
const r = {
|
|
160
|
+
strategy: "fixed",
|
|
161
|
+
...e.popperOptions
|
|
162
|
+
}, i = he(l?.tooltipFormatter) ? l.tooltipFormatter({
|
|
163
|
+
row: n,
|
|
164
|
+
column: l,
|
|
165
|
+
cellValue: ol(n, l.property).value
|
|
166
|
+
}) : void 0;
|
|
167
|
+
return Xt(i) ? {
|
|
168
|
+
slotContent: i,
|
|
169
|
+
content: null,
|
|
170
|
+
...e,
|
|
171
|
+
popperOptions: r
|
|
172
|
+
} : {
|
|
173
|
+
slotContent: null,
|
|
174
|
+
content: i ?? t,
|
|
175
|
+
...e,
|
|
176
|
+
popperOptions: r
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
let le = null;
|
|
180
|
+
function pn(e, t, n, l, r, i) {
|
|
181
|
+
var f;
|
|
182
|
+
const o = vn(
|
|
183
|
+
e,
|
|
184
|
+
t,
|
|
185
|
+
n,
|
|
186
|
+
l
|
|
187
|
+
), s = {
|
|
188
|
+
...o,
|
|
189
|
+
slotContent: void 0
|
|
190
|
+
};
|
|
191
|
+
if (le?.trigger === r) {
|
|
192
|
+
const p = (f = le.vm) == null ? void 0 : f.component;
|
|
193
|
+
Zt(p?.props, s), p && o.slotContent && (p.slots.content = () => [o.slotContent]);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
le?.();
|
|
197
|
+
const a = i?.refs.tableWrapper, u = a?.dataset.prefix, d = ge(
|
|
198
|
+
el,
|
|
199
|
+
{
|
|
200
|
+
virtualTriggering: !0,
|
|
201
|
+
virtualRef: r,
|
|
202
|
+
appendTo: a,
|
|
203
|
+
placement: "top",
|
|
204
|
+
transition: "none",
|
|
205
|
+
offset: 0,
|
|
206
|
+
hideAfter: 0,
|
|
207
|
+
...s
|
|
208
|
+
},
|
|
209
|
+
o.slotContent ? {
|
|
210
|
+
content: () => o.slotContent
|
|
211
|
+
} : void 0
|
|
212
|
+
);
|
|
213
|
+
d.appContext = { ...i.appContext, ...i };
|
|
214
|
+
const m = document.createElement("div");
|
|
215
|
+
kt(d, m), d.component.exposed.onOpen();
|
|
216
|
+
const h = a?.querySelector(`.${u}-scrollbar__wrap`);
|
|
217
|
+
le = () => {
|
|
218
|
+
var p, b;
|
|
219
|
+
(b = (p = d.component) == null ? void 0 : p.exposed) != null && b.onClose && d.component.exposed.onClose(), kt(null, m);
|
|
220
|
+
const C = le;
|
|
221
|
+
h?.removeEventListener("scroll", C), C.trigger = void 0, C.vm = void 0, le = null;
|
|
222
|
+
}, le.trigger = r ?? void 0, le.vm = d, h?.addEventListener("scroll", le);
|
|
223
|
+
}
|
|
224
|
+
function sl(e) {
|
|
225
|
+
return e.children ? tl(e.children, sl) : [e];
|
|
226
|
+
}
|
|
227
|
+
function zt(e, t) {
|
|
228
|
+
return e + t.colSpan;
|
|
229
|
+
}
|
|
230
|
+
const il = (e, t, n, l) => {
|
|
231
|
+
let r = 0, i = e;
|
|
232
|
+
const f = n.states.columns.value;
|
|
233
|
+
if (l) {
|
|
234
|
+
const s = sl(l[e]);
|
|
235
|
+
r = f.slice(0, f.indexOf(s[0])).reduce(zt, 0), i = r + s.reduce(zt, 0) - 1;
|
|
236
|
+
} else
|
|
237
|
+
r = e;
|
|
238
|
+
let o;
|
|
239
|
+
switch (t) {
|
|
240
|
+
case "left":
|
|
241
|
+
i < n.states.fixedLeafColumnsLength.value && (o = "left");
|
|
242
|
+
break;
|
|
243
|
+
case "right":
|
|
244
|
+
r >= f.length - n.states.rightFixedLeafColumnsLength.value && (o = "right");
|
|
245
|
+
break;
|
|
246
|
+
default:
|
|
247
|
+
i < n.states.fixedLeafColumnsLength.value ? o = "left" : r >= f.length - n.states.rightFixedLeafColumnsLength.value && (o = "right");
|
|
248
|
+
}
|
|
249
|
+
return o ? {
|
|
250
|
+
direction: o,
|
|
251
|
+
start: r,
|
|
252
|
+
after: i
|
|
253
|
+
} : {};
|
|
254
|
+
}, Tt = (e, t, n, l, r, i = 0) => {
|
|
255
|
+
const f = [], { direction: o, start: s, after: a } = il(
|
|
256
|
+
t,
|
|
257
|
+
n,
|
|
258
|
+
l,
|
|
259
|
+
r
|
|
260
|
+
);
|
|
261
|
+
if (o) {
|
|
262
|
+
const u = o === "left";
|
|
263
|
+
f.push(`${e}-fixed-column--${o}`), u && a + i === l.states.fixedLeafColumnsLength.value - 1 ? f.push("is-last-column") : !u && s - i === l.states.columns.value.length - l.states.rightFixedLeafColumnsLength.value && f.push("is-first-column");
|
|
264
|
+
}
|
|
265
|
+
return f;
|
|
266
|
+
};
|
|
267
|
+
function It(e, t) {
|
|
268
|
+
return e + (Ue(t.realWidth) || Number.isNaN(t.realWidth) ? Number(t.width) : t.realWidth);
|
|
269
|
+
}
|
|
270
|
+
const Ft = (e, t, n, l) => {
|
|
271
|
+
const {
|
|
272
|
+
direction: r,
|
|
273
|
+
start: i = 0,
|
|
274
|
+
after: f = 0
|
|
275
|
+
} = il(e, t, n, l);
|
|
276
|
+
if (!r)
|
|
277
|
+
return;
|
|
278
|
+
const o = {}, s = r === "left", a = n.states.columns.value;
|
|
279
|
+
return s ? o.left = a.slice(0, i).reduce(It, 0) : o.right = a.slice(f + 1).reverse().reduce(It, 0), o;
|
|
280
|
+
}, Ke = (e, t) => {
|
|
281
|
+
e && (Number.isNaN(e[t]) || (e[t] = `${e[t]}px`));
|
|
282
|
+
};
|
|
283
|
+
function ul(e) {
|
|
284
|
+
return e.some((t) => Xt(t) ? !(t.type === Gt || t.type === Ie && !ul(t.children)) : !0) ? e : null;
|
|
285
|
+
}
|
|
286
|
+
function mn(e) {
|
|
287
|
+
const t = ue(), n = E(!1), l = E([]);
|
|
288
|
+
return {
|
|
289
|
+
updateExpandRows: () => {
|
|
290
|
+
const s = e.data.value || [], a = e.rowKey.value;
|
|
291
|
+
if (n.value)
|
|
292
|
+
l.value = s.slice();
|
|
293
|
+
else if (a) {
|
|
294
|
+
const u = $e(l.value, a);
|
|
295
|
+
l.value = s.reduce((d, m) => {
|
|
296
|
+
const h = te(m, a);
|
|
297
|
+
return u[h] && d.push(m), d;
|
|
298
|
+
}, []);
|
|
299
|
+
} else
|
|
300
|
+
l.value = [];
|
|
301
|
+
},
|
|
302
|
+
toggleRowExpansion: (s, a) => {
|
|
303
|
+
ot(
|
|
304
|
+
l.value,
|
|
305
|
+
s,
|
|
306
|
+
a,
|
|
307
|
+
void 0,
|
|
308
|
+
void 0,
|
|
309
|
+
void 0,
|
|
310
|
+
e.rowKey.value
|
|
311
|
+
) && t.emit("expand-change", s, l.value.slice());
|
|
312
|
+
},
|
|
313
|
+
setExpandRowKeys: (s) => {
|
|
314
|
+
t.store.assertRowKey();
|
|
315
|
+
const a = e.data.value || [], u = e.rowKey.value, d = $e(a, u);
|
|
316
|
+
l.value = s.reduce((m, h) => {
|
|
317
|
+
const p = d[h];
|
|
318
|
+
return p && m.push(p.row), m;
|
|
319
|
+
}, []);
|
|
320
|
+
},
|
|
321
|
+
isRowExpanded: (s) => {
|
|
322
|
+
const a = e.rowKey.value;
|
|
323
|
+
return a ? !!$e(l.value, a)[te(s, a)] : l.value.includes(s);
|
|
324
|
+
},
|
|
325
|
+
states: {
|
|
326
|
+
expandRows: l,
|
|
327
|
+
defaultExpandAll: n
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
function gn(e) {
|
|
332
|
+
const t = ue(), n = E(null), l = E(null), r = (a) => {
|
|
333
|
+
t.store.assertRowKey(), n.value = a, f(a);
|
|
334
|
+
}, i = () => {
|
|
335
|
+
n.value = null;
|
|
336
|
+
}, f = (a) => {
|
|
337
|
+
var u;
|
|
338
|
+
const { data: d, rowKey: m } = e;
|
|
339
|
+
let h = null;
|
|
340
|
+
m.value && (h = (u = (ae(d) || []).find(
|
|
341
|
+
(p) => te(p, m.value) === a
|
|
342
|
+
)) != null ? u : null), l.value = h ?? null, t.emit("current-change", l.value, null);
|
|
343
|
+
};
|
|
344
|
+
return {
|
|
345
|
+
setCurrentRowKey: r,
|
|
346
|
+
restoreCurrentRowKey: i,
|
|
347
|
+
setCurrentRowByKey: f,
|
|
348
|
+
updateCurrentRow: (a) => {
|
|
349
|
+
const u = l.value;
|
|
350
|
+
if (a && a !== u) {
|
|
351
|
+
l.value = a, t.emit("current-change", l.value, u);
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
!a && u && (l.value = null, t.emit("current-change", null, u));
|
|
355
|
+
},
|
|
356
|
+
updateCurrentRowData: () => {
|
|
357
|
+
const a = e.rowKey.value, u = e.data.value || [], d = l.value;
|
|
358
|
+
if (d && !u.includes(d)) {
|
|
359
|
+
if (a) {
|
|
360
|
+
const m = te(d, a);
|
|
361
|
+
f(m);
|
|
362
|
+
} else
|
|
363
|
+
l.value = null;
|
|
364
|
+
Ue(l.value) && t.emit("current-change", null, d);
|
|
365
|
+
} else n.value && (f(n.value), i());
|
|
366
|
+
},
|
|
367
|
+
states: {
|
|
368
|
+
_currentRowKey: n,
|
|
369
|
+
currentRow: l
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
function yn(e) {
|
|
374
|
+
const t = E([]), n = E({}), l = E(16), r = E(!1), i = E({}), f = E("hasChildren"), o = E("children"), s = E(!1), a = ue(), u = D(() => {
|
|
375
|
+
if (!e.rowKey.value)
|
|
376
|
+
return {};
|
|
377
|
+
const c = e.data.value || [];
|
|
378
|
+
return m(c);
|
|
379
|
+
}), d = D(() => {
|
|
380
|
+
const c = e.rowKey.value, v = Object.keys(i.value), w = {};
|
|
381
|
+
return v.length && v.forEach((g) => {
|
|
382
|
+
if (i.value[g].length) {
|
|
383
|
+
const y = { children: [] };
|
|
384
|
+
i.value[g].forEach((x) => {
|
|
385
|
+
const R = te(x, c);
|
|
386
|
+
y.children.push(R), x[f.value] && !w[R] && (w[R] = { children: [] });
|
|
387
|
+
}), w[g] = y;
|
|
388
|
+
}
|
|
389
|
+
}), w;
|
|
390
|
+
}), m = (c) => {
|
|
391
|
+
const v = e.rowKey.value, w = {};
|
|
392
|
+
return hn(
|
|
393
|
+
c,
|
|
394
|
+
(g, y, x) => {
|
|
395
|
+
const R = te(g, v);
|
|
396
|
+
de(y) ? w[R] = {
|
|
397
|
+
children: y.map((H) => te(H, v)),
|
|
398
|
+
level: x
|
|
399
|
+
} : r.value && (w[R] = {
|
|
400
|
+
children: [],
|
|
401
|
+
lazy: !0,
|
|
402
|
+
level: x
|
|
403
|
+
});
|
|
404
|
+
},
|
|
405
|
+
o.value,
|
|
406
|
+
f.value,
|
|
407
|
+
r.value
|
|
408
|
+
), w;
|
|
409
|
+
}, h = (c = !1, v) => {
|
|
410
|
+
var w, g;
|
|
411
|
+
v || (v = (w = a.store) == null ? void 0 : w.states.defaultExpandAll.value);
|
|
412
|
+
const y = u.value, x = d.value, R = Object.keys(y), H = {};
|
|
413
|
+
if (R.length) {
|
|
414
|
+
const k = ae(n), $ = [], M = (I, L) => {
|
|
415
|
+
if (c)
|
|
416
|
+
return t.value ? v || t.value.includes(L) : !!(v || I?.expanded);
|
|
417
|
+
{
|
|
418
|
+
const W = v || t.value && t.value.includes(L);
|
|
419
|
+
return !!(I?.expanded || W);
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
R.forEach((I) => {
|
|
423
|
+
const L = k[I], W = { ...y[I] };
|
|
424
|
+
if (W.expanded = M(L, I), W.lazy) {
|
|
425
|
+
const { loaded: A = !1, loading: T = !1 } = L || {};
|
|
426
|
+
W.loaded = !!A, W.loading = !!T, $.push(I);
|
|
427
|
+
}
|
|
428
|
+
H[I] = W;
|
|
429
|
+
});
|
|
430
|
+
const X = Object.keys(x);
|
|
431
|
+
r.value && X.length && $.length && X.forEach((I) => {
|
|
432
|
+
var L;
|
|
433
|
+
const W = k[I], A = x[I].children;
|
|
434
|
+
if ($.includes(I)) {
|
|
435
|
+
if (((L = H[I].children) == null ? void 0 : L.length) !== 0)
|
|
436
|
+
throw new Error("[ElTable]children must be an empty array.");
|
|
437
|
+
H[I].children = A;
|
|
438
|
+
} else {
|
|
439
|
+
const { loaded: T = !1, loading: z = !1 } = W || {};
|
|
440
|
+
H[I] = {
|
|
441
|
+
lazy: !0,
|
|
442
|
+
loaded: !!T,
|
|
443
|
+
loading: !!z,
|
|
444
|
+
expanded: M(W, I),
|
|
445
|
+
children: A,
|
|
446
|
+
level: void 0
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
n.value = H, (g = a.store) == null || g.updateTableScrollY();
|
|
452
|
+
};
|
|
453
|
+
ie(
|
|
454
|
+
() => t.value,
|
|
455
|
+
() => {
|
|
456
|
+
h(!0);
|
|
457
|
+
}
|
|
458
|
+
), ie(
|
|
459
|
+
() => u.value,
|
|
460
|
+
() => {
|
|
461
|
+
h();
|
|
462
|
+
}
|
|
463
|
+
), ie(
|
|
464
|
+
() => d.value,
|
|
465
|
+
() => {
|
|
466
|
+
h();
|
|
467
|
+
}
|
|
468
|
+
);
|
|
469
|
+
const p = (c) => {
|
|
470
|
+
t.value = c, h();
|
|
471
|
+
}, b = (c) => r.value && c && "loaded" in c && !c.loaded, C = (c, v) => {
|
|
472
|
+
a.store.assertRowKey();
|
|
473
|
+
const w = e.rowKey.value, g = te(c, w), y = g && n.value[g];
|
|
474
|
+
if (g && y && "expanded" in y) {
|
|
475
|
+
const x = y.expanded;
|
|
476
|
+
v = xe(v) ? !y.expanded : v, n.value[g].expanded = v, x !== v && a.emit("expand-change", c, v), v && b(y) && N(c, g, y), a.store.updateTableScrollY();
|
|
477
|
+
}
|
|
478
|
+
}, O = (c) => {
|
|
479
|
+
a.store.assertRowKey();
|
|
480
|
+
const v = e.rowKey.value, w = te(c, v), g = n.value[w];
|
|
481
|
+
b(g) ? N(c, w, g) : C(c, void 0);
|
|
482
|
+
}, N = (c, v, w) => {
|
|
483
|
+
const { load: g } = a.props;
|
|
484
|
+
g && !n.value[v].loaded && (n.value[v].loading = !0, g(c, w, (y) => {
|
|
485
|
+
if (!de(y))
|
|
486
|
+
throw new TypeError("[ElTable] data must be an array");
|
|
487
|
+
n.value[v].loading = !1, n.value[v].loaded = !0, n.value[v].expanded = !0, y.length && (i.value[v] = y), a.emit("expand-change", c, !0);
|
|
488
|
+
}));
|
|
489
|
+
};
|
|
490
|
+
return {
|
|
491
|
+
loadData: N,
|
|
492
|
+
loadOrToggle: O,
|
|
493
|
+
toggleTreeExpansion: C,
|
|
494
|
+
updateTreeExpandKeys: p,
|
|
495
|
+
updateTreeData: h,
|
|
496
|
+
updateKeyChildren: (c, v) => {
|
|
497
|
+
const { lazy: w, rowKey: g } = a.props;
|
|
498
|
+
if (w) {
|
|
499
|
+
if (!g)
|
|
500
|
+
throw new Error("[Table] rowKey is required in updateKeyChild");
|
|
501
|
+
i.value[c] && (i.value[c] = v);
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
normalize: m,
|
|
505
|
+
states: {
|
|
506
|
+
expandRowKeys: t,
|
|
507
|
+
treeData: n,
|
|
508
|
+
indent: l,
|
|
509
|
+
lazy: r,
|
|
510
|
+
lazyTreeNodeMap: i,
|
|
511
|
+
lazyColumnIdentifier: f,
|
|
512
|
+
childrenColumnName: o,
|
|
513
|
+
checkStrictly: s
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
const bn = (e, t) => {
|
|
518
|
+
const n = t.sortingColumn;
|
|
519
|
+
return !n || ve(n.sortable) ? e : sn(
|
|
520
|
+
e,
|
|
521
|
+
t.sortProp,
|
|
522
|
+
t.sortOrder,
|
|
523
|
+
n.sortMethod,
|
|
524
|
+
n.sortBy
|
|
525
|
+
);
|
|
526
|
+
}, Ge = (e) => {
|
|
527
|
+
const t = [];
|
|
528
|
+
return e.forEach((n) => {
|
|
529
|
+
n.children && n.children.length > 0 ? t.push.apply(t, Ge(n.children)) : t.push(n);
|
|
530
|
+
}), t;
|
|
531
|
+
};
|
|
532
|
+
function Cn() {
|
|
533
|
+
var e;
|
|
534
|
+
const t = ue(), { size: n } = zl((e = t.proxy) == null ? void 0 : e.$props), l = E(null), r = E([]), i = E([]), f = E(!1), o = E([]), s = E([]), a = E([]), u = E([]), d = E([]), m = E([]), h = E([]), p = E([]), b = [], C = E(0), O = E(0), N = E(0), S = E(!1), c = E([]), v = E(!1), w = E(!1), g = E(null), y = E({}), x = E(null), R = E(null), H = E(null), k = E(null), $ = E(null), M = D(() => l.value ? $e(c.value, l.value) : void 0);
|
|
535
|
+
ie(
|
|
536
|
+
r,
|
|
537
|
+
() => {
|
|
538
|
+
var F;
|
|
539
|
+
t.state && (W(!1), t.props.tableLayout === "auto" && ((F = t.refs.tableHeaderRef) == null || F.updateFixedColumnStyle()));
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
deep: !0
|
|
543
|
+
}
|
|
544
|
+
);
|
|
545
|
+
const X = () => {
|
|
546
|
+
if (!l.value)
|
|
547
|
+
throw new Error("[ElTable] prop row-key is required");
|
|
548
|
+
}, I = (F) => {
|
|
549
|
+
var K;
|
|
550
|
+
(K = F.children) == null || K.forEach((_) => {
|
|
551
|
+
_.fixed = F.fixed, I(_);
|
|
552
|
+
});
|
|
553
|
+
}, L = () => {
|
|
554
|
+
o.value.forEach((q) => {
|
|
555
|
+
I(q);
|
|
556
|
+
}), u.value = o.value.filter(
|
|
557
|
+
(q) => [!0, "left"].includes(q.fixed)
|
|
558
|
+
);
|
|
559
|
+
const F = o.value.find(
|
|
560
|
+
(q) => q.type === "selection"
|
|
561
|
+
);
|
|
562
|
+
let K;
|
|
563
|
+
F && F.fixed !== "right" && !u.value.includes(F) && o.value.indexOf(F) === 0 && u.value.length && (u.value.unshift(F), K = !0), d.value = o.value.filter(
|
|
564
|
+
(q) => q.fixed === "right"
|
|
565
|
+
);
|
|
566
|
+
const _ = o.value.filter(
|
|
567
|
+
(q) => (K ? q.type !== "selection" : !0) && !q.fixed
|
|
568
|
+
);
|
|
569
|
+
s.value = Array.from(u.value).concat(_).concat(d.value);
|
|
570
|
+
const B = Ge(_), V = Ge(u.value), j = Ge(d.value);
|
|
571
|
+
C.value = B.length, O.value = V.length, N.value = j.length, a.value = Array.from(V).concat(B).concat(j), f.value = u.value.length > 0 || d.value.length > 0;
|
|
572
|
+
}, W = (F, K = !1) => {
|
|
573
|
+
F && L(), K ? t.state.doLayout() : t.state.debouncedUpdateLayout();
|
|
574
|
+
}, A = (F) => M.value ? !!M.value[te(F, l.value)] : c.value.includes(F), T = () => {
|
|
575
|
+
S.value = !1;
|
|
576
|
+
const F = c.value;
|
|
577
|
+
c.value = [], F.length && t.emit("selection-change", []);
|
|
578
|
+
}, z = () => {
|
|
579
|
+
var F, K;
|
|
580
|
+
let _;
|
|
581
|
+
if (l.value) {
|
|
582
|
+
_ = [];
|
|
583
|
+
const B = (K = (F = t?.store) == null ? void 0 : F.states) == null ? void 0 : K.childrenColumnName.value, V = $e(r.value, l.value, !0, B);
|
|
584
|
+
for (const j in M.value)
|
|
585
|
+
Me(M.value, j) && !V[j] && _.push(M.value[j].row);
|
|
586
|
+
} else
|
|
587
|
+
_ = c.value.filter((B) => !r.value.includes(B));
|
|
588
|
+
if (_.length) {
|
|
589
|
+
const B = c.value.filter(
|
|
590
|
+
(V) => !_.includes(V)
|
|
591
|
+
);
|
|
592
|
+
c.value = B, t.emit("selection-change", B.slice());
|
|
593
|
+
}
|
|
594
|
+
}, Y = () => (c.value || []).slice(), Z = (F, K, _ = !0, B = !1) => {
|
|
595
|
+
var V, j, q, we;
|
|
596
|
+
const Se = {
|
|
597
|
+
children: (j = (V = t?.store) == null ? void 0 : V.states) == null ? void 0 : j.childrenColumnName.value,
|
|
598
|
+
checkStrictly: (we = (q = t?.store) == null ? void 0 : q.states) == null ? void 0 : we.checkStrictly.value
|
|
599
|
+
};
|
|
600
|
+
if (ot(
|
|
601
|
+
c.value,
|
|
602
|
+
F,
|
|
603
|
+
K,
|
|
604
|
+
Se,
|
|
605
|
+
B ? void 0 : g.value,
|
|
606
|
+
r.value.indexOf(F),
|
|
607
|
+
l.value
|
|
608
|
+
)) {
|
|
609
|
+
const qe = (c.value || []).slice();
|
|
610
|
+
_ && t.emit("select", qe, F), t.emit("selection-change", qe);
|
|
611
|
+
}
|
|
612
|
+
}, Q = () => {
|
|
613
|
+
var F, K;
|
|
614
|
+
const _ = w.value ? !S.value : !(S.value || c.value.length);
|
|
615
|
+
S.value = _;
|
|
616
|
+
let B = !1, V = 0;
|
|
617
|
+
const j = (K = (F = t?.store) == null ? void 0 : F.states) == null ? void 0 : K.rowKey.value, { childrenColumnName: q } = t.store.states, we = {
|
|
618
|
+
children: q.value,
|
|
619
|
+
checkStrictly: !1
|
|
620
|
+
};
|
|
621
|
+
r.value.forEach((Se, Ye) => {
|
|
622
|
+
const qe = Ye + V;
|
|
623
|
+
ot(
|
|
624
|
+
c.value,
|
|
625
|
+
Se,
|
|
626
|
+
_,
|
|
627
|
+
we,
|
|
628
|
+
g.value,
|
|
629
|
+
qe,
|
|
630
|
+
j
|
|
631
|
+
) && (B = !0), V += G(te(Se, j));
|
|
632
|
+
}), B && t.emit(
|
|
633
|
+
"selection-change",
|
|
634
|
+
c.value ? c.value.slice() : []
|
|
635
|
+
), t.emit("select-all", (c.value || []).slice());
|
|
636
|
+
}, ne = () => {
|
|
637
|
+
var F;
|
|
638
|
+
if (((F = r.value) == null ? void 0 : F.length) === 0) {
|
|
639
|
+
S.value = !1;
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
const { childrenColumnName: K } = t.store.states;
|
|
643
|
+
let _ = 0, B = 0;
|
|
644
|
+
const V = (q) => {
|
|
645
|
+
var we;
|
|
646
|
+
for (const Se of q) {
|
|
647
|
+
const Ye = g.value && g.value.call(null, Se, _);
|
|
648
|
+
if (A(Se))
|
|
649
|
+
B++;
|
|
650
|
+
else if (!g.value || Ye)
|
|
651
|
+
return !1;
|
|
652
|
+
if (_++, (we = Se[K.value]) != null && we.length && !V(Se[K.value]))
|
|
653
|
+
return !1;
|
|
654
|
+
}
|
|
655
|
+
return !0;
|
|
656
|
+
}, j = V(r.value || []);
|
|
657
|
+
S.value = B === 0 ? !1 : j;
|
|
658
|
+
}, G = (F) => {
|
|
659
|
+
var K;
|
|
660
|
+
if (!t || !t.store)
|
|
661
|
+
return 0;
|
|
662
|
+
const { treeData: _ } = t.store.states;
|
|
663
|
+
let B = 0;
|
|
664
|
+
const V = (K = _.value[F]) == null ? void 0 : K.children;
|
|
665
|
+
return V && (B += V.length, V.forEach((j) => {
|
|
666
|
+
B += G(j);
|
|
667
|
+
})), B;
|
|
668
|
+
}, pe = (F, K) => {
|
|
669
|
+
const _ = {};
|
|
670
|
+
return ll(F).forEach((B) => {
|
|
671
|
+
y.value[B.id] = K, _[B.columnKey || B.id] = K;
|
|
672
|
+
}), _;
|
|
673
|
+
}, oe = (F, K, _) => {
|
|
674
|
+
R.value && R.value !== F && (R.value.order = null), R.value = F, H.value = K, k.value = _;
|
|
675
|
+
}, me = () => {
|
|
676
|
+
let F = ae(i);
|
|
677
|
+
Object.keys(y.value).forEach((K) => {
|
|
678
|
+
const _ = y.value[K];
|
|
679
|
+
if (!_ || _.length === 0)
|
|
680
|
+
return;
|
|
681
|
+
const B = al(
|
|
682
|
+
{
|
|
683
|
+
columns: a.value
|
|
684
|
+
},
|
|
685
|
+
K
|
|
686
|
+
);
|
|
687
|
+
B && B.filterMethod && (F = F.filter((V) => _.some(
|
|
688
|
+
(j) => B.filterMethod.call(null, j, V, B)
|
|
689
|
+
)));
|
|
690
|
+
}), x.value = F;
|
|
691
|
+
}, We = () => {
|
|
692
|
+
var F;
|
|
693
|
+
r.value = bn((F = x.value) != null ? F : [], {
|
|
694
|
+
sortingColumn: R.value,
|
|
695
|
+
sortProp: H.value,
|
|
696
|
+
sortOrder: k.value
|
|
697
|
+
});
|
|
698
|
+
}, rt = (F = void 0) => {
|
|
699
|
+
F?.filter || me(), We();
|
|
700
|
+
}, El = (F) => {
|
|
701
|
+
const { tableHeaderRef: K } = t.refs;
|
|
702
|
+
if (!K)
|
|
703
|
+
return;
|
|
704
|
+
const _ = Object.assign({}, K.filterPanels), B = Object.keys(_);
|
|
705
|
+
if (B.length)
|
|
706
|
+
if (ve(F) && (F = [F]), de(F)) {
|
|
707
|
+
const V = F.map(
|
|
708
|
+
(j) => un(
|
|
709
|
+
{
|
|
710
|
+
columns: a.value
|
|
711
|
+
},
|
|
712
|
+
j
|
|
713
|
+
)
|
|
714
|
+
);
|
|
715
|
+
B.forEach((j) => {
|
|
716
|
+
const q = V.find((we) => we.id === j);
|
|
717
|
+
q && (q.filteredValue = []);
|
|
718
|
+
}), t.store.commit("filterChange", {
|
|
719
|
+
column: V,
|
|
720
|
+
values: [],
|
|
721
|
+
silent: !0,
|
|
722
|
+
multi: !0
|
|
723
|
+
});
|
|
724
|
+
} else
|
|
725
|
+
B.forEach((V) => {
|
|
726
|
+
const j = a.value.find((q) => q.id === V);
|
|
727
|
+
j && (j.filteredValue = []);
|
|
728
|
+
}), y.value = {}, t.store.commit("filterChange", {
|
|
729
|
+
column: {},
|
|
730
|
+
values: [],
|
|
731
|
+
silent: !0
|
|
732
|
+
});
|
|
733
|
+
}, Rl = () => {
|
|
734
|
+
R.value && (oe(null, null, null), t.store.commit("changeSortCondition", {
|
|
735
|
+
silent: !0
|
|
736
|
+
}));
|
|
737
|
+
}, {
|
|
738
|
+
setExpandRowKeys: Nl,
|
|
739
|
+
toggleRowExpansion: Ht,
|
|
740
|
+
updateExpandRows: Ll,
|
|
741
|
+
states: Tl,
|
|
742
|
+
isRowExpanded: Fl
|
|
743
|
+
} = mn({
|
|
744
|
+
data: r,
|
|
745
|
+
rowKey: l
|
|
746
|
+
}), {
|
|
747
|
+
updateTreeExpandKeys: Ol,
|
|
748
|
+
toggleTreeExpansion: Wl,
|
|
749
|
+
updateTreeData: Hl,
|
|
750
|
+
updateKeyChildren: kl,
|
|
751
|
+
loadOrToggle: Ml,
|
|
752
|
+
states: Al
|
|
753
|
+
} = yn({
|
|
754
|
+
data: r,
|
|
755
|
+
rowKey: l
|
|
756
|
+
}), {
|
|
757
|
+
updateCurrentRowData: $l,
|
|
758
|
+
updateCurrentRow: Pl,
|
|
759
|
+
setCurrentRowKey: Kl,
|
|
760
|
+
states: Bl
|
|
761
|
+
} = gn({
|
|
762
|
+
data: r,
|
|
763
|
+
rowKey: l
|
|
764
|
+
});
|
|
765
|
+
return {
|
|
766
|
+
assertRowKey: X,
|
|
767
|
+
updateColumns: L,
|
|
768
|
+
scheduleLayout: W,
|
|
769
|
+
isSelected: A,
|
|
770
|
+
clearSelection: T,
|
|
771
|
+
cleanSelection: z,
|
|
772
|
+
getSelectionRows: Y,
|
|
773
|
+
toggleRowSelection: Z,
|
|
774
|
+
_toggleAllSelection: Q,
|
|
775
|
+
toggleAllSelection: null,
|
|
776
|
+
updateAllSelected: ne,
|
|
777
|
+
updateFilters: pe,
|
|
778
|
+
updateCurrentRow: Pl,
|
|
779
|
+
updateSort: oe,
|
|
780
|
+
execFilter: me,
|
|
781
|
+
execSort: We,
|
|
782
|
+
execQuery: rt,
|
|
783
|
+
clearFilter: El,
|
|
784
|
+
clearSort: Rl,
|
|
785
|
+
toggleRowExpansion: Ht,
|
|
786
|
+
setExpandRowKeysAdapter: (F) => {
|
|
787
|
+
Nl(F), Ol(F);
|
|
788
|
+
},
|
|
789
|
+
setCurrentRowKey: Kl,
|
|
790
|
+
toggleRowExpansionAdapter: (F, K) => {
|
|
791
|
+
a.value.some(({ type: B }) => B === "expand") ? Ht(F, K) : Wl(F, K);
|
|
792
|
+
},
|
|
793
|
+
isRowExpanded: Fl,
|
|
794
|
+
updateExpandRows: Ll,
|
|
795
|
+
updateCurrentRowData: $l,
|
|
796
|
+
loadOrToggle: Ml,
|
|
797
|
+
updateTreeData: Hl,
|
|
798
|
+
updateKeyChildren: kl,
|
|
799
|
+
states: {
|
|
800
|
+
tableSize: n,
|
|
801
|
+
rowKey: l,
|
|
802
|
+
data: r,
|
|
803
|
+
_data: i,
|
|
804
|
+
isComplex: f,
|
|
805
|
+
_columns: o,
|
|
806
|
+
originColumns: s,
|
|
807
|
+
columns: a,
|
|
808
|
+
fixedColumns: u,
|
|
809
|
+
rightFixedColumns: d,
|
|
810
|
+
leafColumns: m,
|
|
811
|
+
fixedLeafColumns: h,
|
|
812
|
+
rightFixedLeafColumns: p,
|
|
813
|
+
updateOrderFns: b,
|
|
814
|
+
leafColumnsLength: C,
|
|
815
|
+
fixedLeafColumnsLength: O,
|
|
816
|
+
rightFixedLeafColumnsLength: N,
|
|
817
|
+
isAllSelected: S,
|
|
818
|
+
selection: c,
|
|
819
|
+
reserveSelection: v,
|
|
820
|
+
selectOnIndeterminate: w,
|
|
821
|
+
selectable: g,
|
|
822
|
+
filters: y,
|
|
823
|
+
filteredData: x,
|
|
824
|
+
sortingColumn: R,
|
|
825
|
+
sortProp: H,
|
|
826
|
+
sortOrder: k,
|
|
827
|
+
hoverRow: $,
|
|
828
|
+
...Tl,
|
|
829
|
+
...Al,
|
|
830
|
+
...Bl
|
|
831
|
+
}
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
function ft(e, t) {
|
|
835
|
+
return e.map((n) => {
|
|
836
|
+
var l;
|
|
837
|
+
return n.id === t.id ? t : ((l = n.children) != null && l.length && (n.children = ft(n.children, t)), n);
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
function ht(e) {
|
|
841
|
+
e.forEach((t) => {
|
|
842
|
+
var n, l;
|
|
843
|
+
t.no = (n = t.getColumnIndex) == null ? void 0 : n.call(t), (l = t.children) != null && l.length && ht(t.children);
|
|
844
|
+
}), e.sort((t, n) => t.no - n.no);
|
|
845
|
+
}
|
|
846
|
+
function wn() {
|
|
847
|
+
const e = ue(), t = Cn(), n = ye("table"), { t: l } = at();
|
|
848
|
+
return {
|
|
849
|
+
ns: n,
|
|
850
|
+
t: l,
|
|
851
|
+
...t,
|
|
852
|
+
mutations: {
|
|
853
|
+
setData(o, s) {
|
|
854
|
+
const a = ae(o._data) !== s;
|
|
855
|
+
o.data.value = s, o._data.value = s, e.store.execQuery(), e.store.updateCurrentRowData(), e.store.updateExpandRows(), e.store.updateTreeData(
|
|
856
|
+
e.store.states.defaultExpandAll.value
|
|
857
|
+
), ae(o.reserveSelection) ? e.store.assertRowKey() : a ? e.store.clearSelection() : e.store.cleanSelection(), e.store.updateAllSelected(), e.$ready && e.store.scheduleLayout();
|
|
858
|
+
},
|
|
859
|
+
insertColumn(o, s, a, u) {
|
|
860
|
+
var d;
|
|
861
|
+
const m = ae(o._columns);
|
|
862
|
+
let h = [];
|
|
863
|
+
a ? (a && !a.children && (a.children = []), (d = a.children) == null || d.push(s), h = ft(m, a)) : (m.push(s), h = m), ht(h), o._columns.value = h, o.updateOrderFns.push(u), s.type === "selection" && (o.selectable.value = s.selectable, o.reserveSelection.value = s.reserveSelection), e.$ready && (e.store.updateColumns(), e.store.scheduleLayout());
|
|
864
|
+
},
|
|
865
|
+
updateColumnOrder(o, s) {
|
|
866
|
+
var a;
|
|
867
|
+
((a = s.getColumnIndex) == null ? void 0 : a.call(s)) !== s.no && (ht(o._columns.value), e.$ready && e.store.updateColumns());
|
|
868
|
+
},
|
|
869
|
+
removeColumn(o, s, a, u) {
|
|
870
|
+
var d;
|
|
871
|
+
const m = ae(o._columns) || [];
|
|
872
|
+
if (a)
|
|
873
|
+
(d = a.children) == null || d.splice(
|
|
874
|
+
a.children.findIndex((p) => p.id === s.id),
|
|
875
|
+
1
|
|
876
|
+
), Pe(() => {
|
|
877
|
+
var p;
|
|
878
|
+
((p = a.children) == null ? void 0 : p.length) === 0 && delete a.children;
|
|
879
|
+
}), o._columns.value = ft(m, a);
|
|
880
|
+
else {
|
|
881
|
+
const p = m.indexOf(s);
|
|
882
|
+
p > -1 && (m.splice(p, 1), o._columns.value = m);
|
|
883
|
+
}
|
|
884
|
+
const h = o.updateOrderFns.indexOf(u);
|
|
885
|
+
h > -1 && o.updateOrderFns.splice(h, 1), e.$ready && (e.store.updateColumns(), e.store.scheduleLayout());
|
|
886
|
+
},
|
|
887
|
+
sort(o, s) {
|
|
888
|
+
const { prop: a, order: u, init: d } = s;
|
|
889
|
+
if (a) {
|
|
890
|
+
const m = ae(o.columns).find(
|
|
891
|
+
(h) => h.property === a
|
|
892
|
+
);
|
|
893
|
+
m && (m.order = u, e.store.updateSort(m, a, u), e.store.commit("changeSortCondition", { init: d }));
|
|
894
|
+
}
|
|
895
|
+
},
|
|
896
|
+
changeSortCondition(o, s) {
|
|
897
|
+
const { sortingColumn: a, sortProp: u, sortOrder: d } = o, m = ae(a), h = ae(u), p = ae(d);
|
|
898
|
+
Ue(p) && (o.sortingColumn.value = null, o.sortProp.value = null);
|
|
899
|
+
const b = { filter: !0 };
|
|
900
|
+
e.store.execQuery(b), (!s || !(s.silent || s.init)) && e.emit("sort-change", {
|
|
901
|
+
column: m,
|
|
902
|
+
prop: h,
|
|
903
|
+
order: p
|
|
904
|
+
}), e.store.updateTableScrollY();
|
|
905
|
+
},
|
|
906
|
+
filterChange(o, s) {
|
|
907
|
+
const { column: a, values: u, silent: d } = s, m = e.store.updateFilters(a, u);
|
|
908
|
+
e.store.execQuery(), d || e.emit("filter-change", m), e.store.updateTableScrollY();
|
|
909
|
+
},
|
|
910
|
+
toggleAllSelection() {
|
|
911
|
+
var o, s;
|
|
912
|
+
(s = (o = e.store).toggleAllSelection) == null || s.call(o);
|
|
913
|
+
},
|
|
914
|
+
rowSelectedChanged(o, s) {
|
|
915
|
+
e.store.toggleRowSelection(s), e.store.updateAllSelected();
|
|
916
|
+
},
|
|
917
|
+
setHoverRow(o, s) {
|
|
918
|
+
o.hoverRow.value = s;
|
|
919
|
+
},
|
|
920
|
+
setCurrentRow(o, s) {
|
|
921
|
+
e.store.updateCurrentRow(s);
|
|
922
|
+
}
|
|
923
|
+
},
|
|
924
|
+
commit: function(o, ...s) {
|
|
925
|
+
const a = e.store.mutations;
|
|
926
|
+
if (a[o])
|
|
927
|
+
a[o].apply(e, [
|
|
928
|
+
e.store.states,
|
|
929
|
+
...s
|
|
930
|
+
]);
|
|
931
|
+
else
|
|
932
|
+
throw new Error(`Action not found: ${o}`);
|
|
933
|
+
},
|
|
934
|
+
updateTableScrollY: function() {
|
|
935
|
+
Pe(() => e.layout.updateScrollY.apply(e.layout));
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
const Ot = {
|
|
940
|
+
rowKey: "rowKey",
|
|
941
|
+
defaultExpandAll: "defaultExpandAll",
|
|
942
|
+
selectOnIndeterminate: "selectOnIndeterminate",
|
|
943
|
+
indent: "indent",
|
|
944
|
+
lazy: "lazy",
|
|
945
|
+
"treeProps.hasChildren": {
|
|
946
|
+
key: "lazyColumnIdentifier",
|
|
947
|
+
default: "hasChildren"
|
|
948
|
+
},
|
|
949
|
+
"treeProps.children": {
|
|
950
|
+
key: "childrenColumnName",
|
|
951
|
+
default: "children"
|
|
952
|
+
},
|
|
953
|
+
"treeProps.checkStrictly": {
|
|
954
|
+
key: "checkStrictly",
|
|
955
|
+
default: !1
|
|
956
|
+
}
|
|
957
|
+
};
|
|
958
|
+
function Sn(e, t) {
|
|
959
|
+
if (!e)
|
|
960
|
+
throw new Error("Table is required.");
|
|
961
|
+
const n = wn();
|
|
962
|
+
return n.toggleAllSelection = lt(n._toggleAllSelection, 10), Object.keys(Ot).forEach((l) => {
|
|
963
|
+
dl(cl(t, l), l, n);
|
|
964
|
+
}), xn(n, t), n;
|
|
965
|
+
}
|
|
966
|
+
function xn(e, t) {
|
|
967
|
+
Object.keys(Ot).forEach((n) => {
|
|
968
|
+
ie(
|
|
969
|
+
() => cl(t, n),
|
|
970
|
+
(l) => {
|
|
971
|
+
dl(l, n, e);
|
|
972
|
+
}
|
|
973
|
+
);
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
function dl(e, t, n) {
|
|
977
|
+
let l = e, r = Ot[t];
|
|
978
|
+
tt(r) && (l = l || r.default, r = r.key), n.states[r].value = l;
|
|
979
|
+
}
|
|
980
|
+
function cl(e, t) {
|
|
981
|
+
if (t.includes(".")) {
|
|
982
|
+
const n = t.split(".");
|
|
983
|
+
let l = e;
|
|
984
|
+
return n.forEach((r) => {
|
|
985
|
+
l = l[r];
|
|
986
|
+
}), l;
|
|
987
|
+
} else
|
|
988
|
+
return e[t];
|
|
989
|
+
}
|
|
990
|
+
class En {
|
|
991
|
+
constructor(t) {
|
|
992
|
+
this.observers = [], this.table = null, this.store = null, this.columns = [], this.fit = !0, this.showHeader = !0, this.height = E(null), this.scrollX = E(!1), this.scrollY = E(!1), this.bodyWidth = E(null), this.fixedWidth = E(null), this.rightFixedWidth = E(null), this.gutterWidth = 0;
|
|
993
|
+
for (const n in t)
|
|
994
|
+
Me(t, n) && (Il(this[n]) ? this[n].value = t[n] : this[n] = t[n]);
|
|
995
|
+
if (!this.table)
|
|
996
|
+
throw new Error("Table is required for Table Layout");
|
|
997
|
+
if (!this.store)
|
|
998
|
+
throw new Error("Store is required for Table Layout");
|
|
999
|
+
}
|
|
1000
|
+
updateScrollY() {
|
|
1001
|
+
const t = this.height.value;
|
|
1002
|
+
if (Ue(t))
|
|
1003
|
+
return !1;
|
|
1004
|
+
const n = this.table.refs.scrollBarRef;
|
|
1005
|
+
if (this.table.vnode.el && n?.wrapRef) {
|
|
1006
|
+
let l = !0;
|
|
1007
|
+
const r = this.scrollY.value;
|
|
1008
|
+
return l = n.wrapRef.scrollHeight > n.wrapRef.clientHeight, this.scrollY.value = l, r !== l;
|
|
1009
|
+
}
|
|
1010
|
+
return !1;
|
|
1011
|
+
}
|
|
1012
|
+
setHeight(t, n = "height") {
|
|
1013
|
+
if (!_e)
|
|
1014
|
+
return;
|
|
1015
|
+
const l = this.table.vnode.el;
|
|
1016
|
+
if (t = cn(t), this.height.value = Number(t), !l && (t || t === 0)) {
|
|
1017
|
+
Pe(() => this.setHeight(t, n));
|
|
1018
|
+
return;
|
|
1019
|
+
}
|
|
1020
|
+
l && Ae(t) ? (l.style[n] = `${t}px`, this.updateElsHeight()) : l && ve(t) && (l.style[n] = t, this.updateElsHeight());
|
|
1021
|
+
}
|
|
1022
|
+
setMaxHeight(t) {
|
|
1023
|
+
this.setHeight(t, "max-height");
|
|
1024
|
+
}
|
|
1025
|
+
getFlattenColumns() {
|
|
1026
|
+
const t = [];
|
|
1027
|
+
return this.table.store.states.columns.value.forEach((l) => {
|
|
1028
|
+
l.isColumnGroup ? t.push.apply(t, l.columns) : t.push(l);
|
|
1029
|
+
}), t;
|
|
1030
|
+
}
|
|
1031
|
+
updateElsHeight() {
|
|
1032
|
+
this.updateScrollY(), this.notifyObservers("scrollable");
|
|
1033
|
+
}
|
|
1034
|
+
headerDisplayNone(t) {
|
|
1035
|
+
if (!t)
|
|
1036
|
+
return !0;
|
|
1037
|
+
let n = t;
|
|
1038
|
+
for (; n.tagName !== "DIV"; ) {
|
|
1039
|
+
if (getComputedStyle(n).display === "none")
|
|
1040
|
+
return !0;
|
|
1041
|
+
n = n.parentElement;
|
|
1042
|
+
}
|
|
1043
|
+
return !1;
|
|
1044
|
+
}
|
|
1045
|
+
updateColumnsWidth() {
|
|
1046
|
+
var t;
|
|
1047
|
+
if (!_e)
|
|
1048
|
+
return;
|
|
1049
|
+
const n = this.fit, l = (t = this.table.vnode.el) == null ? void 0 : t.clientWidth;
|
|
1050
|
+
let r = 0;
|
|
1051
|
+
const i = this.getFlattenColumns(), f = i.filter(
|
|
1052
|
+
(a) => !Ae(a.width)
|
|
1053
|
+
);
|
|
1054
|
+
if (i.forEach((a) => {
|
|
1055
|
+
Ae(a.width) && a.realWidth && (a.realWidth = null);
|
|
1056
|
+
}), f.length > 0 && n) {
|
|
1057
|
+
if (i.forEach((a) => {
|
|
1058
|
+
r += Number(a.width || a.minWidth || 80);
|
|
1059
|
+
}), r <= l) {
|
|
1060
|
+
this.scrollX.value = !1;
|
|
1061
|
+
const a = l - r;
|
|
1062
|
+
if (f.length === 1)
|
|
1063
|
+
f[0].realWidth = Number(f[0].minWidth || 80) + a;
|
|
1064
|
+
else {
|
|
1065
|
+
const u = f.reduce(
|
|
1066
|
+
(h, p) => h + Number(p.minWidth || 80),
|
|
1067
|
+
0
|
|
1068
|
+
), d = a / u;
|
|
1069
|
+
let m = 0;
|
|
1070
|
+
f.forEach((h, p) => {
|
|
1071
|
+
if (p === 0)
|
|
1072
|
+
return;
|
|
1073
|
+
const b = Math.floor(
|
|
1074
|
+
Number(h.minWidth || 80) * d
|
|
1075
|
+
);
|
|
1076
|
+
m += b, h.realWidth = Number(h.minWidth || 80) + b;
|
|
1077
|
+
}), f[0].realWidth = Number(f[0].minWidth || 80) + a - m;
|
|
1078
|
+
}
|
|
1079
|
+
} else
|
|
1080
|
+
this.scrollX.value = !0, f.forEach((a) => {
|
|
1081
|
+
a.realWidth = Number(a.minWidth);
|
|
1082
|
+
});
|
|
1083
|
+
this.bodyWidth.value = Math.max(r, l), this.table.state.resizeState.value.width = this.bodyWidth.value;
|
|
1084
|
+
} else
|
|
1085
|
+
i.forEach((a) => {
|
|
1086
|
+
!a.width && !a.minWidth ? a.realWidth = 80 : a.realWidth = Number(a.width || a.minWidth), r += a.realWidth;
|
|
1087
|
+
}), this.scrollX.value = r > l, this.bodyWidth.value = r;
|
|
1088
|
+
const o = this.store.states.fixedColumns.value;
|
|
1089
|
+
if (o.length > 0) {
|
|
1090
|
+
let a = 0;
|
|
1091
|
+
o.forEach((u) => {
|
|
1092
|
+
a += Number(u.realWidth || u.width);
|
|
1093
|
+
}), this.fixedWidth.value = a;
|
|
1094
|
+
}
|
|
1095
|
+
const s = this.store.states.rightFixedColumns.value;
|
|
1096
|
+
if (s.length > 0) {
|
|
1097
|
+
let a = 0;
|
|
1098
|
+
s.forEach((u) => {
|
|
1099
|
+
a += Number(u.realWidth || u.width);
|
|
1100
|
+
}), this.rightFixedWidth.value = a;
|
|
1101
|
+
}
|
|
1102
|
+
this.notifyObservers("columns");
|
|
1103
|
+
}
|
|
1104
|
+
addObserver(t) {
|
|
1105
|
+
this.observers.push(t);
|
|
1106
|
+
}
|
|
1107
|
+
removeObserver(t) {
|
|
1108
|
+
const n = this.observers.indexOf(t);
|
|
1109
|
+
n !== -1 && this.observers.splice(n, 1);
|
|
1110
|
+
}
|
|
1111
|
+
notifyObservers(t) {
|
|
1112
|
+
this.observers.forEach((l) => {
|
|
1113
|
+
var r, i;
|
|
1114
|
+
switch (t) {
|
|
1115
|
+
case "columns":
|
|
1116
|
+
(r = l.state) == null || r.onColumnsChange(this);
|
|
1117
|
+
break;
|
|
1118
|
+
case "scrollable":
|
|
1119
|
+
(i = l.state) == null || i.onScrollableChange(this);
|
|
1120
|
+
break;
|
|
1121
|
+
default:
|
|
1122
|
+
throw new Error(`Table Layout don't have event ${t}.`);
|
|
1123
|
+
}
|
|
1124
|
+
});
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
const Rn = Oe({
|
|
1128
|
+
name: "ElTableFilterPanel",
|
|
1129
|
+
components: {
|
|
1130
|
+
ElCheckbox: Ve,
|
|
1131
|
+
ElCheckboxGroup: on,
|
|
1132
|
+
ElScrollbar: Jt,
|
|
1133
|
+
ElTooltip: el,
|
|
1134
|
+
ElIcon: Nt,
|
|
1135
|
+
ArrowDown: Xl,
|
|
1136
|
+
ArrowUp: ql
|
|
1137
|
+
},
|
|
1138
|
+
props: {
|
|
1139
|
+
placement: {
|
|
1140
|
+
type: String,
|
|
1141
|
+
default: "bottom-start"
|
|
1142
|
+
},
|
|
1143
|
+
store: {
|
|
1144
|
+
type: Object
|
|
1145
|
+
},
|
|
1146
|
+
column: {
|
|
1147
|
+
type: Object
|
|
1148
|
+
},
|
|
1149
|
+
upDataColumn: {
|
|
1150
|
+
type: Function
|
|
1151
|
+
},
|
|
1152
|
+
appendTo: Yl.appendTo
|
|
1153
|
+
},
|
|
1154
|
+
setup(e) {
|
|
1155
|
+
const t = ue(), { t: n } = at(), l = ye("table-filter"), r = t?.parent;
|
|
1156
|
+
e.column && !r.filterPanels.value[e.column.id] && (r.filterPanels.value[e.column.id] = t);
|
|
1157
|
+
const i = E(null), f = E(null), o = E(0), s = D(() => e.column && e.column.filters), a = D(() => e.column && e.column.filterClassName ? `${l.b()} ${e.column.filterClassName}` : l.b()), u = D({
|
|
1158
|
+
get: () => {
|
|
1159
|
+
var g;
|
|
1160
|
+
return (((g = e.column) == null ? void 0 : g.filteredValue) || [])[0];
|
|
1161
|
+
},
|
|
1162
|
+
set: (g) => {
|
|
1163
|
+
d.value && (ze(g) ? d.value.splice(0, 1) : d.value.splice(0, 1, g));
|
|
1164
|
+
}
|
|
1165
|
+
}), d = D({
|
|
1166
|
+
get() {
|
|
1167
|
+
return e.column ? e.column.filteredValue || [] : [];
|
|
1168
|
+
},
|
|
1169
|
+
set(g) {
|
|
1170
|
+
var y;
|
|
1171
|
+
e.column && ((y = e.upDataColumn) == null || y.call(e, "filteredValue", g));
|
|
1172
|
+
}
|
|
1173
|
+
}), m = D(() => e.column ? e.column.filterMultiple : !0), h = (g) => g.value === u.value, p = () => {
|
|
1174
|
+
var g;
|
|
1175
|
+
(g = i.value) == null || g.onClose();
|
|
1176
|
+
}, b = () => {
|
|
1177
|
+
N(d.value), p();
|
|
1178
|
+
}, C = () => {
|
|
1179
|
+
d.value = [], N(d.value), p();
|
|
1180
|
+
}, O = (g, y) => {
|
|
1181
|
+
u.value = g, o.value = y, ze(g) ? N([]) : N(d.value), p();
|
|
1182
|
+
}, N = (g) => {
|
|
1183
|
+
var y, x;
|
|
1184
|
+
(y = e.store) == null || y.commit("filterChange", {
|
|
1185
|
+
column: e.column,
|
|
1186
|
+
values: g
|
|
1187
|
+
}), (x = e.store) == null || x.updateAllSelected();
|
|
1188
|
+
}, S = () => {
|
|
1189
|
+
var g, y;
|
|
1190
|
+
(g = f.value) == null || g.focus(), !m.value && v(), e.column && ((y = e.upDataColumn) == null || y.call(e, "filterOpened", !0));
|
|
1191
|
+
}, c = () => {
|
|
1192
|
+
var g;
|
|
1193
|
+
e.column && ((g = e.upDataColumn) == null || g.call(e, "filterOpened", !1));
|
|
1194
|
+
}, v = () => {
|
|
1195
|
+
if (ze(u)) {
|
|
1196
|
+
o.value = 0;
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
const g = (s.value || []).findIndex((y) => y.value === u.value);
|
|
1200
|
+
o.value = g >= 0 ? g + 1 : 0;
|
|
1201
|
+
};
|
|
1202
|
+
return {
|
|
1203
|
+
multiple: m,
|
|
1204
|
+
filterClassName: a,
|
|
1205
|
+
filteredValue: d,
|
|
1206
|
+
filterValue: u,
|
|
1207
|
+
filters: s,
|
|
1208
|
+
handleConfirm: b,
|
|
1209
|
+
handleReset: C,
|
|
1210
|
+
handleSelect: O,
|
|
1211
|
+
isPropAbsent: ze,
|
|
1212
|
+
isActive: h,
|
|
1213
|
+
t: n,
|
|
1214
|
+
ns: l,
|
|
1215
|
+
tooltipRef: i,
|
|
1216
|
+
rootRef: f,
|
|
1217
|
+
checkedIndex: o,
|
|
1218
|
+
handleShowTooltip: S,
|
|
1219
|
+
handleHideTooltip: c,
|
|
1220
|
+
handleKeydown: (g) => {
|
|
1221
|
+
var y, x;
|
|
1222
|
+
const R = Gl(g), H = (s.value ? s.value.length : 0) + 1;
|
|
1223
|
+
let k = o.value, $ = !0;
|
|
1224
|
+
switch (R) {
|
|
1225
|
+
case Re.down:
|
|
1226
|
+
case Re.right:
|
|
1227
|
+
k = (k + 1) % H;
|
|
1228
|
+
break;
|
|
1229
|
+
case Re.up:
|
|
1230
|
+
case Re.left:
|
|
1231
|
+
k = (k - 1 + H) % H;
|
|
1232
|
+
break;
|
|
1233
|
+
case Re.tab:
|
|
1234
|
+
p(), $ = !1;
|
|
1235
|
+
break;
|
|
1236
|
+
case Re.enter:
|
|
1237
|
+
case Re.space:
|
|
1238
|
+
if (k === 0)
|
|
1239
|
+
O(null, 0);
|
|
1240
|
+
else {
|
|
1241
|
+
const M = (s.value || [])[k - 1];
|
|
1242
|
+
M.value && O(M.value, k);
|
|
1243
|
+
}
|
|
1244
|
+
break;
|
|
1245
|
+
default:
|
|
1246
|
+
$ = !1;
|
|
1247
|
+
break;
|
|
1248
|
+
}
|
|
1249
|
+
$ && g.preventDefault(), o.value = k, (x = (y = f.value) == null ? void 0 : y.querySelector(
|
|
1250
|
+
`.${l.e("list-item")}:nth-child(${k + 1})`
|
|
1251
|
+
)) == null || x.focus();
|
|
1252
|
+
}
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
}), Nn = ["disabled"], Ln = ["tabindex", "aria-checked"], Tn = ["tabindex", "aria-checked", "onClick"], Fn = ["aria-label"];
|
|
1256
|
+
function On(e, t, n, l, r, i) {
|
|
1257
|
+
const f = ce("el-checkbox"), o = ce("el-checkbox-group"), s = ce("el-scrollbar"), a = ce("arrow-up"), u = ce("arrow-down"), d = ce("el-icon"), m = ce("el-tooltip");
|
|
1258
|
+
return J(), ke(m, {
|
|
1259
|
+
ref: "tooltipRef",
|
|
1260
|
+
offset: 0,
|
|
1261
|
+
placement: e.placement,
|
|
1262
|
+
"show-arrow": !1,
|
|
1263
|
+
trigger: "click",
|
|
1264
|
+
role: "dialog",
|
|
1265
|
+
teleported: "",
|
|
1266
|
+
effect: "light",
|
|
1267
|
+
pure: "",
|
|
1268
|
+
loop: "",
|
|
1269
|
+
"popper-class": e.filterClassName,
|
|
1270
|
+
persistent: "",
|
|
1271
|
+
"append-to": e.appendTo,
|
|
1272
|
+
onShow: e.handleShowTooltip,
|
|
1273
|
+
onHide: e.handleHideTooltip
|
|
1274
|
+
}, {
|
|
1275
|
+
content: Ne(() => [
|
|
1276
|
+
e.multiple ? (J(), fe(
|
|
1277
|
+
"div",
|
|
1278
|
+
{
|
|
1279
|
+
key: 0,
|
|
1280
|
+
ref: "rootRef",
|
|
1281
|
+
tabindex: "-1",
|
|
1282
|
+
class: U(e.ns.e("multiple"))
|
|
1283
|
+
},
|
|
1284
|
+
[
|
|
1285
|
+
se(
|
|
1286
|
+
"div",
|
|
1287
|
+
{
|
|
1288
|
+
class: U(e.ns.e("content"))
|
|
1289
|
+
},
|
|
1290
|
+
[
|
|
1291
|
+
ge(s, {
|
|
1292
|
+
"wrap-class": e.ns.e("wrap")
|
|
1293
|
+
}, {
|
|
1294
|
+
default: Ne(() => [
|
|
1295
|
+
ge(o, {
|
|
1296
|
+
modelValue: e.filteredValue,
|
|
1297
|
+
"onUpdate:modelValue": t[0] || (t[0] = (h) => e.filteredValue = h),
|
|
1298
|
+
class: U(e.ns.e("checkbox-group"))
|
|
1299
|
+
}, {
|
|
1300
|
+
default: Ne(() => [
|
|
1301
|
+
(J(!0), fe(
|
|
1302
|
+
Ie,
|
|
1303
|
+
null,
|
|
1304
|
+
Mt(e.filters, (h) => (J(), ke(f, {
|
|
1305
|
+
key: h.value,
|
|
1306
|
+
value: h.value
|
|
1307
|
+
}, {
|
|
1308
|
+
default: Ne(() => [
|
|
1309
|
+
St(
|
|
1310
|
+
He(h.text),
|
|
1311
|
+
1
|
|
1312
|
+
)
|
|
1313
|
+
]),
|
|
1314
|
+
_: 2
|
|
1315
|
+
}, 1032, ["value"]))),
|
|
1316
|
+
128
|
|
1317
|
+
))
|
|
1318
|
+
]),
|
|
1319
|
+
_: 1
|
|
1320
|
+
}, 8, ["modelValue", "class"])
|
|
1321
|
+
]),
|
|
1322
|
+
_: 1
|
|
1323
|
+
}, 8, ["wrap-class"])
|
|
1324
|
+
],
|
|
1325
|
+
2
|
|
1326
|
+
),
|
|
1327
|
+
se(
|
|
1328
|
+
"div",
|
|
1329
|
+
{
|
|
1330
|
+
class: U(e.ns.e("bottom"))
|
|
1331
|
+
},
|
|
1332
|
+
[
|
|
1333
|
+
se("button", {
|
|
1334
|
+
class: U(e.ns.is("disabled", e.filteredValue.length === 0)),
|
|
1335
|
+
disabled: e.filteredValue.length === 0,
|
|
1336
|
+
type: "button",
|
|
1337
|
+
onClick: t[1] || (t[1] = (...h) => e.handleConfirm && e.handleConfirm(...h))
|
|
1338
|
+
}, He(e.t("el.table.confirmFilter")), 11, Nn),
|
|
1339
|
+
se(
|
|
1340
|
+
"button",
|
|
1341
|
+
{
|
|
1342
|
+
type: "button",
|
|
1343
|
+
onClick: t[2] || (t[2] = (...h) => e.handleReset && e.handleReset(...h))
|
|
1344
|
+
},
|
|
1345
|
+
He(e.t("el.table.resetFilter")),
|
|
1346
|
+
1
|
|
1347
|
+
)
|
|
1348
|
+
],
|
|
1349
|
+
2
|
|
1350
|
+
)
|
|
1351
|
+
],
|
|
1352
|
+
2
|
|
1353
|
+
)) : (J(), fe(
|
|
1354
|
+
"ul",
|
|
1355
|
+
{
|
|
1356
|
+
key: 1,
|
|
1357
|
+
ref: "rootRef",
|
|
1358
|
+
tabindex: "-1",
|
|
1359
|
+
role: "radiogroup",
|
|
1360
|
+
class: U(e.ns.e("list")),
|
|
1361
|
+
onKeydown: t[4] || (t[4] = (...h) => e.handleKeydown && e.handleKeydown(...h))
|
|
1362
|
+
},
|
|
1363
|
+
[
|
|
1364
|
+
se("li", {
|
|
1365
|
+
role: "radio",
|
|
1366
|
+
class: U([
|
|
1367
|
+
e.ns.e("list-item"),
|
|
1368
|
+
e.ns.is("active", e.isPropAbsent(e.filterValue))
|
|
1369
|
+
]),
|
|
1370
|
+
tabindex: e.checkedIndex === 0 ? 0 : -1,
|
|
1371
|
+
"aria-checked": e.isPropAbsent(e.filterValue),
|
|
1372
|
+
onClick: t[3] || (t[3] = (h) => e.handleSelect(null, 0))
|
|
1373
|
+
}, He(e.t("el.table.clearFilter")), 11, Ln),
|
|
1374
|
+
(J(!0), fe(
|
|
1375
|
+
Ie,
|
|
1376
|
+
null,
|
|
1377
|
+
Mt(e.filters, (h, p) => (J(), fe("li", {
|
|
1378
|
+
key: h.value,
|
|
1379
|
+
role: "radio",
|
|
1380
|
+
class: U([e.ns.e("list-item"), e.ns.is("active", e.isActive(h))]),
|
|
1381
|
+
tabindex: e.checkedIndex === p + 1 ? 0 : -1,
|
|
1382
|
+
"aria-checked": e.isActive(h),
|
|
1383
|
+
onClick: (b) => e.handleSelect(h.value, p + 1)
|
|
1384
|
+
}, He(h.text), 11, Tn))),
|
|
1385
|
+
128
|
|
1386
|
+
))
|
|
1387
|
+
],
|
|
1388
|
+
34
|
|
1389
|
+
))
|
|
1390
|
+
]),
|
|
1391
|
+
default: Ne(() => {
|
|
1392
|
+
var h;
|
|
1393
|
+
return [
|
|
1394
|
+
se("button", {
|
|
1395
|
+
type: "button",
|
|
1396
|
+
class: U(`${e.ns.namespace.value}-table__column-filter-trigger`),
|
|
1397
|
+
"aria-label": e.t("el.table.filterLabel", { column: ((h = e.column) == null ? void 0 : h.label) || "" })
|
|
1398
|
+
}, [
|
|
1399
|
+
ge(d, null, {
|
|
1400
|
+
default: Ne(() => [
|
|
1401
|
+
Fe(e.$slots, "filter-icon", {}, () => {
|
|
1402
|
+
var p;
|
|
1403
|
+
return [
|
|
1404
|
+
(p = e.column) != null && p.filterOpened ? (J(), ke(a, { key: 0 })) : (J(), ke(u, { key: 1 }))
|
|
1405
|
+
];
|
|
1406
|
+
})
|
|
1407
|
+
]),
|
|
1408
|
+
_: 3
|
|
1409
|
+
})
|
|
1410
|
+
], 10, Fn)
|
|
1411
|
+
];
|
|
1412
|
+
}),
|
|
1413
|
+
_: 3
|
|
1414
|
+
}, 8, ["placement", "popper-class", "append-to", "onShow", "onHide"]);
|
|
1415
|
+
}
|
|
1416
|
+
var Wn = /* @__PURE__ */ Rt(Rn, [["render", On], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/table/src/filter-panel.vue"]]);
|
|
1417
|
+
function Wt(e) {
|
|
1418
|
+
const t = ue();
|
|
1419
|
+
Qt(() => {
|
|
1420
|
+
n.value.addObserver(t);
|
|
1421
|
+
}), je(() => {
|
|
1422
|
+
l(n.value), r(n.value);
|
|
1423
|
+
}), _l(() => {
|
|
1424
|
+
l(n.value), r(n.value);
|
|
1425
|
+
}), xt(() => {
|
|
1426
|
+
n.value.removeObserver(t);
|
|
1427
|
+
});
|
|
1428
|
+
const n = D(() => {
|
|
1429
|
+
const i = e.layout;
|
|
1430
|
+
if (!i)
|
|
1431
|
+
throw new Error("Can not find table layout.");
|
|
1432
|
+
return i;
|
|
1433
|
+
}), l = (i) => {
|
|
1434
|
+
var f;
|
|
1435
|
+
const o = ((f = e.vnode.el) == null ? void 0 : f.querySelectorAll("colgroup > col")) || [];
|
|
1436
|
+
if (!o.length)
|
|
1437
|
+
return;
|
|
1438
|
+
const s = i.getFlattenColumns(), a = {};
|
|
1439
|
+
s.forEach((u) => {
|
|
1440
|
+
a[u.id] = u;
|
|
1441
|
+
});
|
|
1442
|
+
for (let u = 0, d = o.length; u < d; u++) {
|
|
1443
|
+
const m = o[u], h = m.getAttribute("name"), p = a[h];
|
|
1444
|
+
p && m.setAttribute("width", p.realWidth || p.width);
|
|
1445
|
+
}
|
|
1446
|
+
}, r = (i) => {
|
|
1447
|
+
var f, o;
|
|
1448
|
+
const s = ((f = e.vnode.el) == null ? void 0 : f.querySelectorAll("colgroup > col[name=gutter]")) || [];
|
|
1449
|
+
for (let u = 0, d = s.length; u < d; u++)
|
|
1450
|
+
s[u].setAttribute("width", i.scrollY.value ? i.gutterWidth : "0");
|
|
1451
|
+
const a = ((o = e.vnode.el) == null ? void 0 : o.querySelectorAll("th.gutter")) || [];
|
|
1452
|
+
for (let u = 0, d = a.length; u < d; u++) {
|
|
1453
|
+
const m = a[u];
|
|
1454
|
+
m.style.width = i.scrollY.value ? `${i.gutterWidth}px` : "0", m.style.display = i.scrollY.value ? "" : "none";
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
return {
|
|
1458
|
+
tableLayout: n.value,
|
|
1459
|
+
onColumnsChange: l,
|
|
1460
|
+
onScrollableChange: r
|
|
1461
|
+
};
|
|
1462
|
+
}
|
|
1463
|
+
const be = Symbol("ElTable");
|
|
1464
|
+
function Hn(e, t) {
|
|
1465
|
+
const n = ue(), l = Ce(be), r = (b) => {
|
|
1466
|
+
b.stopPropagation();
|
|
1467
|
+
}, i = (b, C) => {
|
|
1468
|
+
!C.filters && C.sortable ? p(b, C, !1) : C.filterable && !C.sortable && r(b), l?.emit("header-click", C, b);
|
|
1469
|
+
}, f = (b, C) => {
|
|
1470
|
+
l?.emit("header-contextmenu", C, b);
|
|
1471
|
+
}, o = E(null), s = E(!1), a = E(), u = (b, C) => {
|
|
1472
|
+
var O, N;
|
|
1473
|
+
if (_e && !(C.children && C.children.length > 0) && o.value && e.border && o.value.id === C.id) {
|
|
1474
|
+
s.value = !0;
|
|
1475
|
+
const S = l;
|
|
1476
|
+
t("set-drag-visible", !0);
|
|
1477
|
+
const c = S?.vnode.el, v = c?.getBoundingClientRect().left, w = (N = (O = n?.vnode) == null ? void 0 : O.el) == null ? void 0 : N.querySelector(`th.${C.id}`), g = w.getBoundingClientRect(), y = g.left - v + 30;
|
|
1478
|
+
nt(w, "noclick"), a.value = {
|
|
1479
|
+
startMouseLeft: b.clientX,
|
|
1480
|
+
startLeft: g.right - v,
|
|
1481
|
+
startColumnLeft: g.left - v,
|
|
1482
|
+
tableLeft: v
|
|
1483
|
+
};
|
|
1484
|
+
const x = S?.refs.resizeProxy;
|
|
1485
|
+
x.style.left = `${a.value.startLeft}px`, document.onselectstart = function() {
|
|
1486
|
+
return !1;
|
|
1487
|
+
}, document.ondragstart = function() {
|
|
1488
|
+
return !1;
|
|
1489
|
+
};
|
|
1490
|
+
const R = (k) => {
|
|
1491
|
+
const $ = k.clientX - a.value.startMouseLeft, M = a.value.startLeft + $;
|
|
1492
|
+
x.style.left = `${Math.max(y, M)}px`;
|
|
1493
|
+
}, H = () => {
|
|
1494
|
+
if (s.value) {
|
|
1495
|
+
const { startColumnLeft: k, startLeft: $ } = a.value, X = Number.parseInt(x.style.left, 10) - k;
|
|
1496
|
+
C.width = C.realWidth = X, S?.emit(
|
|
1497
|
+
"header-dragend",
|
|
1498
|
+
C.width,
|
|
1499
|
+
$ - k,
|
|
1500
|
+
C,
|
|
1501
|
+
b
|
|
1502
|
+
), requestAnimationFrame(() => {
|
|
1503
|
+
e.store.scheduleLayout(!1, !0);
|
|
1504
|
+
}), document.body.style.cursor = "", s.value = !1, o.value = null, a.value = void 0, t("set-drag-visible", !1);
|
|
1505
|
+
}
|
|
1506
|
+
document.removeEventListener("mousemove", R), document.removeEventListener("mouseup", H), document.onselectstart = null, document.ondragstart = null, setTimeout(() => {
|
|
1507
|
+
De(w, "noclick");
|
|
1508
|
+
}, 0);
|
|
1509
|
+
};
|
|
1510
|
+
document.addEventListener("mousemove", R), document.addEventListener("mouseup", H);
|
|
1511
|
+
}
|
|
1512
|
+
}, d = (b, C) => {
|
|
1513
|
+
var O;
|
|
1514
|
+
if (!e.border || C.children && C.children.length > 0)
|
|
1515
|
+
return;
|
|
1516
|
+
const N = b.target, S = Ql(N) ? N.closest("th") : null;
|
|
1517
|
+
if (!S)
|
|
1518
|
+
return;
|
|
1519
|
+
const c = Xe(S, "is-sortable");
|
|
1520
|
+
if (c) {
|
|
1521
|
+
const R = s.value ? "col-resize" : "";
|
|
1522
|
+
S.style.cursor = R;
|
|
1523
|
+
const H = S.querySelector(".caret-wrapper");
|
|
1524
|
+
H && (H.style.cursor = R);
|
|
1525
|
+
}
|
|
1526
|
+
if (!C.resizable || s.value) {
|
|
1527
|
+
o.value = null;
|
|
1528
|
+
return;
|
|
1529
|
+
}
|
|
1530
|
+
const v = S.getBoundingClientRect(), w = ((O = S.parentNode) == null ? void 0 : O.lastElementChild) === S, g = e.allowDragLastColumn || !w, y = v.width > 12 && v.right - b.clientX < 8 && g, x = y ? "col-resize" : "";
|
|
1531
|
+
document.body.style.cursor = x, o.value = y ? C : null, c && (S.style.cursor = x);
|
|
1532
|
+
}, m = () => {
|
|
1533
|
+
!_e || s.value || (document.body.style.cursor = "");
|
|
1534
|
+
}, h = ({ order: b, sortOrders: C }) => {
|
|
1535
|
+
if (b === "")
|
|
1536
|
+
return C[0];
|
|
1537
|
+
const O = C.indexOf(b || null);
|
|
1538
|
+
return C[O > C.length - 2 ? 0 : O + 1];
|
|
1539
|
+
}, p = (b, C, O) => {
|
|
1540
|
+
var N;
|
|
1541
|
+
b.stopPropagation();
|
|
1542
|
+
const S = C.order === O ? null : O || h(C), c = (N = b.target) == null ? void 0 : N.closest("th");
|
|
1543
|
+
if (c && Xe(c, "noclick")) {
|
|
1544
|
+
De(c, "noclick");
|
|
1545
|
+
return;
|
|
1546
|
+
}
|
|
1547
|
+
if (!C.sortable)
|
|
1548
|
+
return;
|
|
1549
|
+
const v = b.currentTarget;
|
|
1550
|
+
if (["ascending", "descending"].some(
|
|
1551
|
+
(R) => Xe(v, R) && !C.sortOrders.includes(R)
|
|
1552
|
+
))
|
|
1553
|
+
return;
|
|
1554
|
+
const w = e.store.states;
|
|
1555
|
+
let g = w.sortProp.value, y;
|
|
1556
|
+
const x = w.sortingColumn.value;
|
|
1557
|
+
(x !== C || x === C && Ue(x.order)) && (x && (x.order = null), w.sortingColumn.value = C, g = C.property), S ? y = C.order = S : y = C.order = null, w.sortProp.value = g, w.sortOrder.value = y, l?.store.commit("changeSortCondition");
|
|
1558
|
+
};
|
|
1559
|
+
return {
|
|
1560
|
+
handleHeaderClick: i,
|
|
1561
|
+
handleHeaderContextMenu: f,
|
|
1562
|
+
handleMouseDown: u,
|
|
1563
|
+
handleMouseMove: d,
|
|
1564
|
+
handleMouseOut: m,
|
|
1565
|
+
handleSortClick: p,
|
|
1566
|
+
handleFilterClick: r
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
function kn(e) {
|
|
1570
|
+
const t = Ce(be), n = ye("table");
|
|
1571
|
+
return {
|
|
1572
|
+
getHeaderRowStyle: (o) => {
|
|
1573
|
+
const s = t?.props.headerRowStyle;
|
|
1574
|
+
return he(s) ? s.call(null, { rowIndex: o }) : s;
|
|
1575
|
+
},
|
|
1576
|
+
getHeaderRowClass: (o) => {
|
|
1577
|
+
const s = [], a = t?.props.headerRowClassName;
|
|
1578
|
+
return ve(a) ? s.push(a) : he(a) && s.push(a.call(null, { rowIndex: o })), s.join(" ");
|
|
1579
|
+
},
|
|
1580
|
+
getHeaderCellStyle: (o, s, a, u) => {
|
|
1581
|
+
var d;
|
|
1582
|
+
let m = (d = t?.props.headerCellStyle) != null ? d : {};
|
|
1583
|
+
he(m) && (m = m.call(null, {
|
|
1584
|
+
rowIndex: o,
|
|
1585
|
+
columnIndex: s,
|
|
1586
|
+
row: a,
|
|
1587
|
+
column: u
|
|
1588
|
+
}));
|
|
1589
|
+
const h = Ft(
|
|
1590
|
+
s,
|
|
1591
|
+
u.fixed,
|
|
1592
|
+
e.store,
|
|
1593
|
+
a
|
|
1594
|
+
);
|
|
1595
|
+
return Ke(h, "left"), Ke(h, "right"), Object.assign({}, m, h);
|
|
1596
|
+
},
|
|
1597
|
+
getHeaderCellClass: (o, s, a, u) => {
|
|
1598
|
+
const d = Tt(
|
|
1599
|
+
n.b(),
|
|
1600
|
+
s,
|
|
1601
|
+
u.fixed,
|
|
1602
|
+
e.store,
|
|
1603
|
+
a
|
|
1604
|
+
), m = [
|
|
1605
|
+
u.id,
|
|
1606
|
+
u.order,
|
|
1607
|
+
u.headerAlign,
|
|
1608
|
+
u.className,
|
|
1609
|
+
u.labelClassName,
|
|
1610
|
+
...d
|
|
1611
|
+
];
|
|
1612
|
+
u.children || m.push("is-leaf"), u.sortable && m.push("is-sortable");
|
|
1613
|
+
const h = t?.props.headerCellClassName;
|
|
1614
|
+
return ve(h) ? m.push(h) : he(h) && m.push(
|
|
1615
|
+
h.call(null, {
|
|
1616
|
+
rowIndex: o,
|
|
1617
|
+
columnIndex: s,
|
|
1618
|
+
row: a,
|
|
1619
|
+
column: u
|
|
1620
|
+
})
|
|
1621
|
+
), m.push(n.e("cell")), m.filter((p) => !!p).join(" ");
|
|
1622
|
+
}
|
|
1623
|
+
};
|
|
1624
|
+
}
|
|
1625
|
+
const fl = (e) => {
|
|
1626
|
+
const t = [];
|
|
1627
|
+
return e.forEach((n) => {
|
|
1628
|
+
n.children ? (t.push(n), t.push.apply(t, fl(n.children))) : t.push(n);
|
|
1629
|
+
}), t;
|
|
1630
|
+
}, hl = (e) => {
|
|
1631
|
+
let t = 1;
|
|
1632
|
+
const n = (i, f) => {
|
|
1633
|
+
if (f && (i.level = f.level + 1, t < i.level && (t = i.level)), i.children) {
|
|
1634
|
+
let o = 0;
|
|
1635
|
+
i.children.forEach((s) => {
|
|
1636
|
+
n(s, i), o += s.colSpan;
|
|
1637
|
+
}), i.colSpan = o;
|
|
1638
|
+
} else
|
|
1639
|
+
i.colSpan = 1;
|
|
1640
|
+
};
|
|
1641
|
+
e.forEach((i) => {
|
|
1642
|
+
i.level = 1, n(i, void 0);
|
|
1643
|
+
});
|
|
1644
|
+
const l = [];
|
|
1645
|
+
for (let i = 0; i < t; i++)
|
|
1646
|
+
l.push([]);
|
|
1647
|
+
return fl(e).forEach((i) => {
|
|
1648
|
+
i.children ? (i.rowSpan = 1, i.children.forEach((f) => f.isSubColumn = !0)) : i.rowSpan = t - i.level + 1, l[i.level - 1].push(i);
|
|
1649
|
+
}), l;
|
|
1650
|
+
};
|
|
1651
|
+
function Mn(e) {
|
|
1652
|
+
const t = Ce(be), n = D(() => hl(e.store.states.originColumns.value));
|
|
1653
|
+
return {
|
|
1654
|
+
isGroup: D(() => {
|
|
1655
|
+
const i = n.value.length > 1;
|
|
1656
|
+
return i && t && (t.state.isGroup.value = !0), i;
|
|
1657
|
+
}),
|
|
1658
|
+
toggleAllSelection: (i) => {
|
|
1659
|
+
i.stopPropagation(), t?.store.commit("toggleAllSelection");
|
|
1660
|
+
},
|
|
1661
|
+
columnRows: n
|
|
1662
|
+
};
|
|
1663
|
+
}
|
|
1664
|
+
var An = Oe({
|
|
1665
|
+
name: "ElTableHeader",
|
|
1666
|
+
components: {
|
|
1667
|
+
ElCheckbox: Ve
|
|
1668
|
+
},
|
|
1669
|
+
props: {
|
|
1670
|
+
fixed: {
|
|
1671
|
+
type: String,
|
|
1672
|
+
default: ""
|
|
1673
|
+
},
|
|
1674
|
+
store: {
|
|
1675
|
+
required: !0,
|
|
1676
|
+
type: Object
|
|
1677
|
+
},
|
|
1678
|
+
border: Boolean,
|
|
1679
|
+
defaultSort: {
|
|
1680
|
+
type: Object,
|
|
1681
|
+
default: () => ({
|
|
1682
|
+
prop: "",
|
|
1683
|
+
order: ""
|
|
1684
|
+
})
|
|
1685
|
+
},
|
|
1686
|
+
appendFilterPanelTo: {
|
|
1687
|
+
type: String
|
|
1688
|
+
},
|
|
1689
|
+
allowDragLastColumn: {
|
|
1690
|
+
type: Boolean
|
|
1691
|
+
}
|
|
1692
|
+
},
|
|
1693
|
+
setup(e, { emit: t }) {
|
|
1694
|
+
const n = ue(), l = Ce(be), r = ye("table"), i = E({}), { onColumnsChange: f, onScrollableChange: o } = Wt(l), s = l?.props.tableLayout === "auto", a = Dl(/* @__PURE__ */ new Map()), u = E();
|
|
1695
|
+
let d;
|
|
1696
|
+
const m = () => {
|
|
1697
|
+
d = setTimeout(() => {
|
|
1698
|
+
a.size > 0 && (a.forEach((k, $) => {
|
|
1699
|
+
const M = u.value.querySelector(
|
|
1700
|
+
`.${$.replace(/\s/g, ".")}`
|
|
1701
|
+
);
|
|
1702
|
+
if (M) {
|
|
1703
|
+
const X = M.getBoundingClientRect().width;
|
|
1704
|
+
k.width = X || k.width;
|
|
1705
|
+
}
|
|
1706
|
+
}), a.clear());
|
|
1707
|
+
});
|
|
1708
|
+
};
|
|
1709
|
+
ie(a, m), Et(() => {
|
|
1710
|
+
d && (clearTimeout(d), d = void 0);
|
|
1711
|
+
}), je(async () => {
|
|
1712
|
+
await Pe(), await Pe();
|
|
1713
|
+
const { prop: k, order: $ } = e.defaultSort;
|
|
1714
|
+
l?.store.commit("sort", { prop: k, order: $, init: !0 }), m();
|
|
1715
|
+
});
|
|
1716
|
+
const {
|
|
1717
|
+
handleHeaderClick: h,
|
|
1718
|
+
handleHeaderContextMenu: p,
|
|
1719
|
+
handleMouseDown: b,
|
|
1720
|
+
handleMouseMove: C,
|
|
1721
|
+
handleMouseOut: O,
|
|
1722
|
+
handleSortClick: N,
|
|
1723
|
+
handleFilterClick: S
|
|
1724
|
+
} = Hn(e, t), {
|
|
1725
|
+
getHeaderRowStyle: c,
|
|
1726
|
+
getHeaderRowClass: v,
|
|
1727
|
+
getHeaderCellStyle: w,
|
|
1728
|
+
getHeaderCellClass: g
|
|
1729
|
+
} = kn(e), { isGroup: y, toggleAllSelection: x, columnRows: R } = Mn(
|
|
1730
|
+
e
|
|
1731
|
+
), { t: H } = at();
|
|
1732
|
+
return n.state = {
|
|
1733
|
+
onColumnsChange: f,
|
|
1734
|
+
onScrollableChange: o
|
|
1735
|
+
}, n.filterPanels = i, {
|
|
1736
|
+
ns: r,
|
|
1737
|
+
t: H,
|
|
1738
|
+
filterPanels: i,
|
|
1739
|
+
onColumnsChange: f,
|
|
1740
|
+
onScrollableChange: o,
|
|
1741
|
+
columnRows: R,
|
|
1742
|
+
getHeaderRowClass: v,
|
|
1743
|
+
getHeaderRowStyle: c,
|
|
1744
|
+
getHeaderCellClass: g,
|
|
1745
|
+
getHeaderCellStyle: w,
|
|
1746
|
+
handleHeaderClick: h,
|
|
1747
|
+
handleHeaderContextMenu: p,
|
|
1748
|
+
handleMouseDown: b,
|
|
1749
|
+
handleMouseMove: C,
|
|
1750
|
+
handleMouseOut: O,
|
|
1751
|
+
handleSortClick: N,
|
|
1752
|
+
handleFilterClick: S,
|
|
1753
|
+
isGroup: y,
|
|
1754
|
+
toggleAllSelection: x,
|
|
1755
|
+
saveIndexSelection: a,
|
|
1756
|
+
isTableLayoutAuto: s,
|
|
1757
|
+
theadRef: u,
|
|
1758
|
+
updateFixedColumnStyle: m
|
|
1759
|
+
};
|
|
1760
|
+
},
|
|
1761
|
+
render() {
|
|
1762
|
+
const {
|
|
1763
|
+
ns: e,
|
|
1764
|
+
t,
|
|
1765
|
+
isGroup: n,
|
|
1766
|
+
columnRows: l,
|
|
1767
|
+
getHeaderCellStyle: r,
|
|
1768
|
+
getHeaderCellClass: i,
|
|
1769
|
+
getHeaderRowClass: f,
|
|
1770
|
+
getHeaderRowStyle: o,
|
|
1771
|
+
handleHeaderClick: s,
|
|
1772
|
+
handleHeaderContextMenu: a,
|
|
1773
|
+
handleMouseDown: u,
|
|
1774
|
+
handleMouseMove: d,
|
|
1775
|
+
handleSortClick: m,
|
|
1776
|
+
handleMouseOut: h,
|
|
1777
|
+
store: p,
|
|
1778
|
+
$parent: b,
|
|
1779
|
+
saveIndexSelection: C,
|
|
1780
|
+
isTableLayoutAuto: O
|
|
1781
|
+
} = this;
|
|
1782
|
+
let N = 1;
|
|
1783
|
+
return P(
|
|
1784
|
+
"thead",
|
|
1785
|
+
{
|
|
1786
|
+
ref: "theadRef",
|
|
1787
|
+
class: e.is("group", n)
|
|
1788
|
+
},
|
|
1789
|
+
l.map(
|
|
1790
|
+
(S, c) => P(
|
|
1791
|
+
"tr",
|
|
1792
|
+
{
|
|
1793
|
+
class: f(c),
|
|
1794
|
+
key: c,
|
|
1795
|
+
style: o(c)
|
|
1796
|
+
},
|
|
1797
|
+
S.map((v, w) => {
|
|
1798
|
+
v.rowSpan > N && (N = v.rowSpan);
|
|
1799
|
+
const g = i(
|
|
1800
|
+
c,
|
|
1801
|
+
w,
|
|
1802
|
+
S,
|
|
1803
|
+
v
|
|
1804
|
+
);
|
|
1805
|
+
return O && v.fixed && C.set(g, v), P(
|
|
1806
|
+
"th",
|
|
1807
|
+
{
|
|
1808
|
+
class: g,
|
|
1809
|
+
colspan: v.colSpan,
|
|
1810
|
+
key: `${v.id}-thead`,
|
|
1811
|
+
rowspan: v.rowSpan,
|
|
1812
|
+
scope: v.colSpan > 1 ? "colgroup" : "col",
|
|
1813
|
+
ariaSort: v.sortable ? v.order : void 0,
|
|
1814
|
+
style: r(
|
|
1815
|
+
c,
|
|
1816
|
+
w,
|
|
1817
|
+
S,
|
|
1818
|
+
v
|
|
1819
|
+
),
|
|
1820
|
+
onClick: (y) => {
|
|
1821
|
+
var x;
|
|
1822
|
+
(x = y.currentTarget) != null && x.classList.contains(
|
|
1823
|
+
"noclick"
|
|
1824
|
+
) || s(y, v);
|
|
1825
|
+
},
|
|
1826
|
+
onContextmenu: (y) => a(y, v),
|
|
1827
|
+
onMousedown: (y) => u(y, v),
|
|
1828
|
+
onMousemove: (y) => d(y, v),
|
|
1829
|
+
onMouseout: h
|
|
1830
|
+
},
|
|
1831
|
+
[
|
|
1832
|
+
P(
|
|
1833
|
+
"div",
|
|
1834
|
+
{
|
|
1835
|
+
class: [
|
|
1836
|
+
"cell",
|
|
1837
|
+
v.filteredValue && v.filteredValue.length > 0 ? "highlight" : ""
|
|
1838
|
+
]
|
|
1839
|
+
},
|
|
1840
|
+
[
|
|
1841
|
+
v.renderHeader ? v.renderHeader({
|
|
1842
|
+
column: v,
|
|
1843
|
+
$index: w,
|
|
1844
|
+
store: p,
|
|
1845
|
+
_self: b
|
|
1846
|
+
}) : v.label,
|
|
1847
|
+
v.sortable && P(
|
|
1848
|
+
"button",
|
|
1849
|
+
{
|
|
1850
|
+
type: "button",
|
|
1851
|
+
class: "caret-wrapper",
|
|
1852
|
+
"aria-label": t("el.table.sortLabel", {
|
|
1853
|
+
column: v.label || ""
|
|
1854
|
+
}),
|
|
1855
|
+
onClick: (y) => m(y, v)
|
|
1856
|
+
},
|
|
1857
|
+
[
|
|
1858
|
+
P("i", {
|
|
1859
|
+
onClick: (y) => m(y, v, "ascending"),
|
|
1860
|
+
class: "sort-caret ascending"
|
|
1861
|
+
}),
|
|
1862
|
+
P("i", {
|
|
1863
|
+
onClick: (y) => m(y, v, "descending"),
|
|
1864
|
+
class: "sort-caret descending"
|
|
1865
|
+
})
|
|
1866
|
+
]
|
|
1867
|
+
),
|
|
1868
|
+
v.filterable && P(
|
|
1869
|
+
Wn,
|
|
1870
|
+
{
|
|
1871
|
+
store: p,
|
|
1872
|
+
placement: v.filterPlacement || "bottom-start",
|
|
1873
|
+
appendTo: b?.appendFilterPanelTo,
|
|
1874
|
+
column: v,
|
|
1875
|
+
upDataColumn: (y, x) => {
|
|
1876
|
+
v[y] = x;
|
|
1877
|
+
}
|
|
1878
|
+
},
|
|
1879
|
+
{
|
|
1880
|
+
"filter-icon": () => v.renderFilterIcon ? v.renderFilterIcon({
|
|
1881
|
+
filterOpened: v.filterOpened
|
|
1882
|
+
}) : null
|
|
1883
|
+
}
|
|
1884
|
+
)
|
|
1885
|
+
]
|
|
1886
|
+
)
|
|
1887
|
+
]
|
|
1888
|
+
);
|
|
1889
|
+
})
|
|
1890
|
+
)
|
|
1891
|
+
)
|
|
1892
|
+
);
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1895
|
+
function ut(e, t, n = 0.03) {
|
|
1896
|
+
return e - t > n;
|
|
1897
|
+
}
|
|
1898
|
+
function $n(e) {
|
|
1899
|
+
const t = Ce(be), n = E(""), l = E(P("div")), r = (p, b, C) => {
|
|
1900
|
+
var O, N, S;
|
|
1901
|
+
const c = t, v = it(p);
|
|
1902
|
+
let w = null;
|
|
1903
|
+
const g = (O = c?.vnode.el) == null ? void 0 : O.dataset.prefix;
|
|
1904
|
+
v && (w = Bt(
|
|
1905
|
+
{
|
|
1906
|
+
columns: (S = (N = e.store) == null ? void 0 : N.states.columns.value) != null ? S : []
|
|
1907
|
+
},
|
|
1908
|
+
v,
|
|
1909
|
+
g
|
|
1910
|
+
), w && c?.emit(`cell-${C}`, b, w, v, p)), c?.emit(`row-${C}`, b, w, p);
|
|
1911
|
+
}, i = (p, b) => {
|
|
1912
|
+
r(p, b, "dblclick");
|
|
1913
|
+
}, f = (p, b) => {
|
|
1914
|
+
var C;
|
|
1915
|
+
(C = e.store) == null || C.commit("setCurrentRow", b), r(p, b, "click");
|
|
1916
|
+
}, o = (p, b) => {
|
|
1917
|
+
r(p, b, "contextmenu");
|
|
1918
|
+
}, s = lt((p) => {
|
|
1919
|
+
var b;
|
|
1920
|
+
(b = e.store) == null || b.commit("setHoverRow", p);
|
|
1921
|
+
}, 30), a = lt(() => {
|
|
1922
|
+
var p;
|
|
1923
|
+
(p = e.store) == null || p.commit("setHoverRow", null);
|
|
1924
|
+
}, 30), u = (p) => {
|
|
1925
|
+
const b = window.getComputedStyle(p, null), C = Number.parseInt(b.paddingLeft, 10) || 0, O = Number.parseInt(b.paddingRight, 10) || 0, N = Number.parseInt(b.paddingTop, 10) || 0, S = Number.parseInt(b.paddingBottom, 10) || 0;
|
|
1926
|
+
return {
|
|
1927
|
+
left: C,
|
|
1928
|
+
right: O,
|
|
1929
|
+
top: N,
|
|
1930
|
+
bottom: S
|
|
1931
|
+
};
|
|
1932
|
+
}, d = (p, b, C) => {
|
|
1933
|
+
var O;
|
|
1934
|
+
let N = (O = b?.target) == null ? void 0 : O.parentNode;
|
|
1935
|
+
for (; p > 1 && (N = N?.nextSibling, !(!N || N.nodeName !== "TR")); )
|
|
1936
|
+
C(N, "hover-row hover-fixed-row"), p--;
|
|
1937
|
+
};
|
|
1938
|
+
return {
|
|
1939
|
+
handleDoubleClick: i,
|
|
1940
|
+
handleClick: f,
|
|
1941
|
+
handleContextMenu: o,
|
|
1942
|
+
handleMouseEnter: s,
|
|
1943
|
+
handleMouseLeave: a,
|
|
1944
|
+
handleCellMouseEnter: (p, b, C) => {
|
|
1945
|
+
var O, N, S, c, v, w, g, y, x;
|
|
1946
|
+
if (!t)
|
|
1947
|
+
return;
|
|
1948
|
+
const R = t, H = it(p), k = (O = R?.vnode.el) == null ? void 0 : O.dataset.prefix;
|
|
1949
|
+
let $ = null;
|
|
1950
|
+
if (H) {
|
|
1951
|
+
if ($ = Bt(
|
|
1952
|
+
{
|
|
1953
|
+
columns: (S = (N = e.store) == null ? void 0 : N.states.columns.value) != null ? S : []
|
|
1954
|
+
},
|
|
1955
|
+
H,
|
|
1956
|
+
k
|
|
1957
|
+
), !$)
|
|
1958
|
+
return;
|
|
1959
|
+
H.rowSpan > 1 && d(H.rowSpan, p, nt);
|
|
1960
|
+
const G = R.hoverState = {
|
|
1961
|
+
cell: H,
|
|
1962
|
+
column: $,
|
|
1963
|
+
row: b
|
|
1964
|
+
};
|
|
1965
|
+
R?.emit(
|
|
1966
|
+
"cell-mouse-enter",
|
|
1967
|
+
G.row,
|
|
1968
|
+
G.column,
|
|
1969
|
+
G.cell,
|
|
1970
|
+
p
|
|
1971
|
+
);
|
|
1972
|
+
}
|
|
1973
|
+
if (!C) {
|
|
1974
|
+
((c = le) == null ? void 0 : c.trigger) === H && ((v = le) == null || v());
|
|
1975
|
+
return;
|
|
1976
|
+
}
|
|
1977
|
+
const M = p.target.querySelector(
|
|
1978
|
+
".cell"
|
|
1979
|
+
);
|
|
1980
|
+
if (!(Xe(M, `${k}-tooltip`) && M.childNodes.length && ((w = M.textContent) != null && w.trim())))
|
|
1981
|
+
return;
|
|
1982
|
+
const X = document.createRange();
|
|
1983
|
+
X.setStart(M, 0), X.setEnd(M, M.childNodes.length);
|
|
1984
|
+
const { width: I, height: L } = X.getBoundingClientRect(), { width: W, height: A } = M.getBoundingClientRect(), { top: T, left: z, right: Y, bottom: Z } = u(M), Q = z + Y, ne = T + Z;
|
|
1985
|
+
ut(I + Q, W) || ut(L + ne, A) || ut(M.scrollWidth, W) ? pn(
|
|
1986
|
+
C,
|
|
1987
|
+
(g = H?.innerText || H?.textContent) != null ? g : "",
|
|
1988
|
+
b,
|
|
1989
|
+
$,
|
|
1990
|
+
H,
|
|
1991
|
+
R
|
|
1992
|
+
) : ((y = le) == null ? void 0 : y.trigger) === H && ((x = le) == null || x());
|
|
1993
|
+
},
|
|
1994
|
+
handleCellMouseLeave: (p) => {
|
|
1995
|
+
const b = it(p);
|
|
1996
|
+
if (!b)
|
|
1997
|
+
return;
|
|
1998
|
+
b.rowSpan > 1 && d(b.rowSpan, p, De);
|
|
1999
|
+
const C = t?.hoverState;
|
|
2000
|
+
t?.emit(
|
|
2001
|
+
"cell-mouse-leave",
|
|
2002
|
+
C?.row,
|
|
2003
|
+
C?.column,
|
|
2004
|
+
C?.cell,
|
|
2005
|
+
p
|
|
2006
|
+
);
|
|
2007
|
+
},
|
|
2008
|
+
tooltipContent: n,
|
|
2009
|
+
tooltipTrigger: l
|
|
2010
|
+
};
|
|
2011
|
+
}
|
|
2012
|
+
function Pn(e) {
|
|
2013
|
+
const t = Ce(be), n = ye("table");
|
|
2014
|
+
return {
|
|
2015
|
+
getRowStyle: (a, u) => {
|
|
2016
|
+
const d = t?.props.rowStyle;
|
|
2017
|
+
return he(d) ? d.call(null, {
|
|
2018
|
+
row: a,
|
|
2019
|
+
rowIndex: u
|
|
2020
|
+
}) : d || null;
|
|
2021
|
+
},
|
|
2022
|
+
getRowClass: (a, u, d) => {
|
|
2023
|
+
var m;
|
|
2024
|
+
const h = [n.e("row")];
|
|
2025
|
+
t?.props.highlightCurrentRow && a === ((m = e.store) == null ? void 0 : m.states.currentRow.value) && h.push("current-row"), e.stripe && d % 2 === 1 && h.push(n.em("row", "striped"));
|
|
2026
|
+
const p = t?.props.rowClassName;
|
|
2027
|
+
return ve(p) ? h.push(p) : he(p) && h.push(
|
|
2028
|
+
p.call(null, {
|
|
2029
|
+
row: a,
|
|
2030
|
+
rowIndex: u
|
|
2031
|
+
})
|
|
2032
|
+
), h;
|
|
2033
|
+
},
|
|
2034
|
+
getCellStyle: (a, u, d, m) => {
|
|
2035
|
+
const h = t?.props.cellStyle;
|
|
2036
|
+
let p = h ?? {};
|
|
2037
|
+
he(h) && (p = h.call(null, {
|
|
2038
|
+
rowIndex: a,
|
|
2039
|
+
columnIndex: u,
|
|
2040
|
+
row: d,
|
|
2041
|
+
column: m
|
|
2042
|
+
}));
|
|
2043
|
+
const b = Ft(
|
|
2044
|
+
u,
|
|
2045
|
+
e?.fixed,
|
|
2046
|
+
e.store
|
|
2047
|
+
);
|
|
2048
|
+
return Ke(b, "left"), Ke(b, "right"), Object.assign({}, p, b);
|
|
2049
|
+
},
|
|
2050
|
+
getCellClass: (a, u, d, m, h) => {
|
|
2051
|
+
const p = Tt(
|
|
2052
|
+
n.b(),
|
|
2053
|
+
u,
|
|
2054
|
+
e?.fixed,
|
|
2055
|
+
e.store,
|
|
2056
|
+
void 0,
|
|
2057
|
+
h
|
|
2058
|
+
), b = [m.id, m.align, m.className, ...p], C = t?.props.cellClassName;
|
|
2059
|
+
return ve(C) ? b.push(C) : he(C) && b.push(
|
|
2060
|
+
C.call(null, {
|
|
2061
|
+
rowIndex: a,
|
|
2062
|
+
columnIndex: u,
|
|
2063
|
+
row: d,
|
|
2064
|
+
column: m
|
|
2065
|
+
})
|
|
2066
|
+
), b.push(n.e("cell")), b.filter((O) => !!O).join(" ");
|
|
2067
|
+
},
|
|
2068
|
+
getSpan: (a, u, d, m) => {
|
|
2069
|
+
let h = 1, p = 1;
|
|
2070
|
+
const b = t?.props.spanMethod;
|
|
2071
|
+
if (he(b)) {
|
|
2072
|
+
const C = b({
|
|
2073
|
+
row: a,
|
|
2074
|
+
column: u,
|
|
2075
|
+
rowIndex: d,
|
|
2076
|
+
columnIndex: m
|
|
2077
|
+
});
|
|
2078
|
+
de(C) ? (h = C[0], p = C[1]) : tt(C) && (h = C.rowspan, p = C.colspan);
|
|
2079
|
+
}
|
|
2080
|
+
return { rowspan: h, colspan: p };
|
|
2081
|
+
},
|
|
2082
|
+
getColspanRealWidth: (a, u, d) => {
|
|
2083
|
+
if (u < 1)
|
|
2084
|
+
return a[d].realWidth;
|
|
2085
|
+
const m = a.map(({ realWidth: h, width: p }) => h || p).slice(d, d + u);
|
|
2086
|
+
return Number(
|
|
2087
|
+
m.reduce((h, p) => Number(h) + Number(p), -1)
|
|
2088
|
+
);
|
|
2089
|
+
}
|
|
2090
|
+
};
|
|
2091
|
+
}
|
|
2092
|
+
const Kn = ["colspan", "rowspan"], Bn = Oe({
|
|
2093
|
+
name: "TableTdWrapper",
|
|
2094
|
+
__name: "td-wrapper",
|
|
2095
|
+
props: {
|
|
2096
|
+
colspan: {
|
|
2097
|
+
type: Number,
|
|
2098
|
+
default: 1
|
|
2099
|
+
},
|
|
2100
|
+
rowspan: {
|
|
2101
|
+
type: Number,
|
|
2102
|
+
default: 1
|
|
2103
|
+
}
|
|
2104
|
+
},
|
|
2105
|
+
setup(e) {
|
|
2106
|
+
return (t, n) => (J(), fe("td", {
|
|
2107
|
+
colspan: e.colspan,
|
|
2108
|
+
rowspan: e.rowspan
|
|
2109
|
+
}, [
|
|
2110
|
+
Fe(t.$slots, "default")
|
|
2111
|
+
], 8, Kn));
|
|
2112
|
+
}
|
|
2113
|
+
});
|
|
2114
|
+
var zn = /* @__PURE__ */ Rt(Bn, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/table/src/table-body/td-wrapper.vue"]]);
|
|
2115
|
+
function In(e) {
|
|
2116
|
+
const t = Ce(be), n = ye("table"), {
|
|
2117
|
+
handleDoubleClick: l,
|
|
2118
|
+
handleClick: r,
|
|
2119
|
+
handleContextMenu: i,
|
|
2120
|
+
handleMouseEnter: f,
|
|
2121
|
+
handleMouseLeave: o,
|
|
2122
|
+
handleCellMouseEnter: s,
|
|
2123
|
+
handleCellMouseLeave: a,
|
|
2124
|
+
tooltipContent: u,
|
|
2125
|
+
tooltipTrigger: d
|
|
2126
|
+
} = $n(e), {
|
|
2127
|
+
getRowStyle: m,
|
|
2128
|
+
getRowClass: h,
|
|
2129
|
+
getCellStyle: p,
|
|
2130
|
+
getCellClass: b,
|
|
2131
|
+
getSpan: C,
|
|
2132
|
+
getColspanRealWidth: O
|
|
2133
|
+
} = Pn(e);
|
|
2134
|
+
let N = -1;
|
|
2135
|
+
const S = D(() => {
|
|
2136
|
+
var y;
|
|
2137
|
+
return (y = e.store) == null ? void 0 : y.states.columns.value.findIndex(
|
|
2138
|
+
({ type: x }) => x === "default"
|
|
2139
|
+
);
|
|
2140
|
+
}), c = (y, x) => {
|
|
2141
|
+
var R;
|
|
2142
|
+
const H = (R = t?.props) == null ? void 0 : R.rowKey;
|
|
2143
|
+
return H ? te(y, H) : x;
|
|
2144
|
+
}, v = (y, x, R, H = !1) => {
|
|
2145
|
+
const { tooltipEffect: k, tooltipOptions: $, store: M } = e, { indent: X, columns: I } = M.states, L = [];
|
|
2146
|
+
let W = !0;
|
|
2147
|
+
return R && (L.push(n.em("row", `level-${R.level}`)), W = !!R.display), x === 0 && (N = -1), e.stripe && W && N++, L.push(...h(y, x, N)), P(
|
|
2148
|
+
"tr",
|
|
2149
|
+
{
|
|
2150
|
+
style: [W ? null : { display: "none" }, m(y, x)],
|
|
2151
|
+
class: L,
|
|
2152
|
+
key: c(y, x),
|
|
2153
|
+
onDblclick: (T) => l(T, y),
|
|
2154
|
+
onClick: (T) => r(T, y),
|
|
2155
|
+
onContextmenu: (T) => i(T, y),
|
|
2156
|
+
onMouseenter: () => f(x),
|
|
2157
|
+
onMouseleave: o
|
|
2158
|
+
},
|
|
2159
|
+
I.value.map((T, z) => {
|
|
2160
|
+
const { rowspan: Y, colspan: Z } = C(y, T, x, z);
|
|
2161
|
+
if (!Y || !Z)
|
|
2162
|
+
return null;
|
|
2163
|
+
const Q = Object.assign({}, T);
|
|
2164
|
+
Q.realWidth = O(
|
|
2165
|
+
I.value,
|
|
2166
|
+
Z,
|
|
2167
|
+
z
|
|
2168
|
+
);
|
|
2169
|
+
const ne = {
|
|
2170
|
+
store: M,
|
|
2171
|
+
_self: e.context || t,
|
|
2172
|
+
column: Q,
|
|
2173
|
+
row: y,
|
|
2174
|
+
$index: x,
|
|
2175
|
+
cellIndex: z,
|
|
2176
|
+
expanded: H
|
|
2177
|
+
};
|
|
2178
|
+
z === S.value && R && (ne.treeNode = {
|
|
2179
|
+
indent: R.level && R.level * X.value,
|
|
2180
|
+
level: R.level
|
|
2181
|
+
}, Le(R.expanded) && (ne.treeNode.expanded = R.expanded, "loading" in R && (ne.treeNode.loading = R.loading), "noLazyChildren" in R && (ne.treeNode.noLazyChildren = R.noLazyChildren)));
|
|
2182
|
+
const G = `${c(y, x)},${z}`, pe = Q.columnKey || Q.rawColumnKey || "", oe = T.showOverflowTooltip && Zt(
|
|
2183
|
+
{
|
|
2184
|
+
effect: k
|
|
2185
|
+
},
|
|
2186
|
+
$,
|
|
2187
|
+
T.showOverflowTooltip
|
|
2188
|
+
);
|
|
2189
|
+
return P(
|
|
2190
|
+
zn,
|
|
2191
|
+
{
|
|
2192
|
+
style: p(x, z, y, T),
|
|
2193
|
+
class: b(x, z, y, T, Z - 1),
|
|
2194
|
+
key: `${pe}${G}`,
|
|
2195
|
+
rowspan: Y,
|
|
2196
|
+
colspan: Z,
|
|
2197
|
+
onMouseenter: (me) => s(
|
|
2198
|
+
me,
|
|
2199
|
+
y,
|
|
2200
|
+
oe
|
|
2201
|
+
),
|
|
2202
|
+
onMouseleave: a
|
|
2203
|
+
},
|
|
2204
|
+
{
|
|
2205
|
+
default: () => w(z, T, ne)
|
|
2206
|
+
}
|
|
2207
|
+
);
|
|
2208
|
+
})
|
|
2209
|
+
);
|
|
2210
|
+
}, w = (y, x, R) => x.renderCell(R);
|
|
2211
|
+
return {
|
|
2212
|
+
wrappedRowRender: (y, x) => {
|
|
2213
|
+
const R = e.store, { isRowExpanded: H, assertRowKey: k } = R, { treeData: $, lazyTreeNodeMap: M, childrenColumnName: X, rowKey: I } = R.states, L = R.states.columns.value;
|
|
2214
|
+
if (L.some(({ type: A }) => A === "expand")) {
|
|
2215
|
+
const A = H(y), T = v(y, x, void 0, A), z = t?.renderExpanded;
|
|
2216
|
+
if (!z)
|
|
2217
|
+
return console.error("[Element Error]renderExpanded is required."), T;
|
|
2218
|
+
const Y = [[T]];
|
|
2219
|
+
return (t.props.preserveExpandedContent || A) && Y[0].push(
|
|
2220
|
+
P(
|
|
2221
|
+
"tr",
|
|
2222
|
+
{
|
|
2223
|
+
key: `expanded-row__${T.key}`,
|
|
2224
|
+
style: { display: A ? "" : "none" }
|
|
2225
|
+
},
|
|
2226
|
+
[
|
|
2227
|
+
P(
|
|
2228
|
+
"td",
|
|
2229
|
+
{
|
|
2230
|
+
colspan: L.length,
|
|
2231
|
+
class: `${n.e("cell")} ${n.e("expanded-cell")}`
|
|
2232
|
+
},
|
|
2233
|
+
[z({ row: y, $index: x, store: R, expanded: A })]
|
|
2234
|
+
)
|
|
2235
|
+
]
|
|
2236
|
+
)
|
|
2237
|
+
), Y;
|
|
2238
|
+
} else if (Object.keys($.value).length) {
|
|
2239
|
+
k();
|
|
2240
|
+
const A = te(y, I.value);
|
|
2241
|
+
let T = $.value[A], z = null;
|
|
2242
|
+
T && (z = {
|
|
2243
|
+
expanded: T.expanded,
|
|
2244
|
+
level: T.level,
|
|
2245
|
+
display: !0,
|
|
2246
|
+
noLazyChildren: void 0,
|
|
2247
|
+
loading: void 0
|
|
2248
|
+
}, Le(T.lazy) && (z && Le(T.loaded) && T.loaded && (z.noLazyChildren = !(T.children && T.children.length)), z.loading = T.loading));
|
|
2249
|
+
const Y = [v(y, x, z ?? void 0)];
|
|
2250
|
+
if (T) {
|
|
2251
|
+
let Z = 0;
|
|
2252
|
+
const Q = (G, pe) => {
|
|
2253
|
+
G && G.length && pe && G.forEach((oe) => {
|
|
2254
|
+
const me = {
|
|
2255
|
+
display: pe.display && pe.expanded,
|
|
2256
|
+
level: pe.level + 1,
|
|
2257
|
+
expanded: !1,
|
|
2258
|
+
noLazyChildren: !1,
|
|
2259
|
+
loading: !1
|
|
2260
|
+
}, We = te(oe, I.value);
|
|
2261
|
+
if (ze(We))
|
|
2262
|
+
throw new Error("For nested data item, row-key is required.");
|
|
2263
|
+
if (T = { ...$.value[We] }, T && (me.expanded = T.expanded, T.level = T.level || me.level, T.display = !!(T.expanded && me.display), Le(T.lazy) && (Le(T.loaded) && T.loaded && (me.noLazyChildren = !(T.children && T.children.length)), me.loading = T.loading)), Z++, Y.push(v(oe, x + Z, me)), T) {
|
|
2264
|
+
const rt = M.value[We] || oe[X.value];
|
|
2265
|
+
Q(rt, T);
|
|
2266
|
+
}
|
|
2267
|
+
});
|
|
2268
|
+
};
|
|
2269
|
+
T.display = !0;
|
|
2270
|
+
const ne = M.value[A] || y[X.value];
|
|
2271
|
+
Q(ne, T);
|
|
2272
|
+
}
|
|
2273
|
+
return Y;
|
|
2274
|
+
} else
|
|
2275
|
+
return v(y, x, void 0);
|
|
2276
|
+
},
|
|
2277
|
+
tooltipContent: u,
|
|
2278
|
+
tooltipTrigger: d
|
|
2279
|
+
};
|
|
2280
|
+
}
|
|
2281
|
+
const _n = {
|
|
2282
|
+
store: {
|
|
2283
|
+
required: !0,
|
|
2284
|
+
type: Object
|
|
2285
|
+
},
|
|
2286
|
+
stripe: Boolean,
|
|
2287
|
+
tooltipEffect: String,
|
|
2288
|
+
tooltipOptions: {
|
|
2289
|
+
type: Object
|
|
2290
|
+
},
|
|
2291
|
+
context: {
|
|
2292
|
+
default: () => ({}),
|
|
2293
|
+
type: Object
|
|
2294
|
+
},
|
|
2295
|
+
rowClassName: [String, Function],
|
|
2296
|
+
rowStyle: [Object, Function],
|
|
2297
|
+
fixed: {
|
|
2298
|
+
type: String,
|
|
2299
|
+
default: ""
|
|
2300
|
+
},
|
|
2301
|
+
highlight: Boolean
|
|
2302
|
+
};
|
|
2303
|
+
var Dn = Oe({
|
|
2304
|
+
name: "ElTableBody",
|
|
2305
|
+
props: _n,
|
|
2306
|
+
setup(e) {
|
|
2307
|
+
var t;
|
|
2308
|
+
const n = ue(), l = Ce(be), r = ye("table"), { wrappedRowRender: i, tooltipContent: f, tooltipTrigger: o } = In(e), { onColumnsChange: s, onScrollableChange: a } = Wt(l), u = [];
|
|
2309
|
+
return ie((t = e.store) == null ? void 0 : t.states.hoverRow, (d, m) => {
|
|
2310
|
+
var h, p;
|
|
2311
|
+
const b = n?.vnode.el, C = Array.from(b?.children || []).filter(
|
|
2312
|
+
(S) => S?.classList.contains(`${r.e("row")}`)
|
|
2313
|
+
);
|
|
2314
|
+
let O = d;
|
|
2315
|
+
const N = (h = C[O]) == null ? void 0 : h.childNodes;
|
|
2316
|
+
if (N?.length) {
|
|
2317
|
+
let S = 0;
|
|
2318
|
+
Array.from(N).reduce((v, w, g) => {
|
|
2319
|
+
var y, x;
|
|
2320
|
+
return ((y = N[g]) == null ? void 0 : y.colSpan) > 1 && (S = (x = N[g]) == null ? void 0 : x.colSpan), w.nodeName !== "TD" && S === 0 && v.push(g), S > 0 && S--, v;
|
|
2321
|
+
}, []).forEach((v) => {
|
|
2322
|
+
var w;
|
|
2323
|
+
for (O = d; O > 0; ) {
|
|
2324
|
+
const g = (w = C[O - 1]) == null ? void 0 : w.childNodes;
|
|
2325
|
+
if (g[v] && g[v].nodeName === "TD" && g[v].rowSpan > 1) {
|
|
2326
|
+
nt(g[v], "hover-cell"), u.push(g[v]);
|
|
2327
|
+
break;
|
|
2328
|
+
}
|
|
2329
|
+
O--;
|
|
2330
|
+
}
|
|
2331
|
+
});
|
|
2332
|
+
} else
|
|
2333
|
+
u.forEach((S) => De(S, "hover-cell")), u.length = 0;
|
|
2334
|
+
!((p = e.store) != null && p.states.isComplex.value) || !_e || an(() => {
|
|
2335
|
+
const S = C[m], c = C[d];
|
|
2336
|
+
S && !S.classList.contains("hover-fixed-row") && De(S, "hover-row"), c && nt(c, "hover-row");
|
|
2337
|
+
});
|
|
2338
|
+
}), xt(() => {
|
|
2339
|
+
var d;
|
|
2340
|
+
(d = le) == null || d();
|
|
2341
|
+
}), {
|
|
2342
|
+
ns: r,
|
|
2343
|
+
onColumnsChange: s,
|
|
2344
|
+
onScrollableChange: a,
|
|
2345
|
+
wrappedRowRender: i,
|
|
2346
|
+
tooltipContent: f,
|
|
2347
|
+
tooltipTrigger: o
|
|
2348
|
+
};
|
|
2349
|
+
},
|
|
2350
|
+
render() {
|
|
2351
|
+
const { wrappedRowRender: e, store: t } = this, n = t?.states.data.value || [];
|
|
2352
|
+
return P("tbody", { tabIndex: -1 }, [
|
|
2353
|
+
n.reduce((l, r) => l.concat(e(r, l.length)), [])
|
|
2354
|
+
]);
|
|
2355
|
+
}
|
|
2356
|
+
});
|
|
2357
|
+
function Vn() {
|
|
2358
|
+
const e = Ce(be), t = e?.store, n = D(() => {
|
|
2359
|
+
var o;
|
|
2360
|
+
return (o = t?.states.fixedLeafColumnsLength.value) != null ? o : 0;
|
|
2361
|
+
}), l = D(() => {
|
|
2362
|
+
var o;
|
|
2363
|
+
return (o = t?.states.rightFixedColumns.value.length) != null ? o : 0;
|
|
2364
|
+
}), r = D(() => {
|
|
2365
|
+
var o;
|
|
2366
|
+
return (o = t?.states.columns.value.length) != null ? o : 0;
|
|
2367
|
+
}), i = D(() => {
|
|
2368
|
+
var o;
|
|
2369
|
+
return (o = t?.states.fixedColumns.value.length) != null ? o : 0;
|
|
2370
|
+
}), f = D(() => {
|
|
2371
|
+
var o;
|
|
2372
|
+
return (o = t?.states.rightFixedColumns.value.length) != null ? o : 0;
|
|
2373
|
+
});
|
|
2374
|
+
return {
|
|
2375
|
+
leftFixedLeafCount: n,
|
|
2376
|
+
rightFixedLeafCount: l,
|
|
2377
|
+
columnsCount: r,
|
|
2378
|
+
leftFixedCount: i,
|
|
2379
|
+
rightFixedCount: f,
|
|
2380
|
+
columns: D(() => {
|
|
2381
|
+
var o;
|
|
2382
|
+
return (o = t?.states.columns.value) != null ? o : [];
|
|
2383
|
+
})
|
|
2384
|
+
};
|
|
2385
|
+
}
|
|
2386
|
+
function jn(e) {
|
|
2387
|
+
const { columns: t } = Vn(), n = ye("table");
|
|
2388
|
+
return {
|
|
2389
|
+
getCellClasses: (i, f) => {
|
|
2390
|
+
const o = i[f], s = [
|
|
2391
|
+
n.e("cell"),
|
|
2392
|
+
o.id,
|
|
2393
|
+
o.align,
|
|
2394
|
+
o.labelClassName,
|
|
2395
|
+
...Tt(n.b(), f, o.fixed, e.store)
|
|
2396
|
+
];
|
|
2397
|
+
return o.className && s.push(o.className), o.children || s.push(n.is("leaf")), s;
|
|
2398
|
+
},
|
|
2399
|
+
getCellStyles: (i, f) => {
|
|
2400
|
+
const o = Ft(
|
|
2401
|
+
f,
|
|
2402
|
+
i.fixed,
|
|
2403
|
+
e.store
|
|
2404
|
+
);
|
|
2405
|
+
return Ke(o, "left"), Ke(o, "right"), o;
|
|
2406
|
+
},
|
|
2407
|
+
columns: t
|
|
2408
|
+
};
|
|
2409
|
+
}
|
|
2410
|
+
var Un = Oe({
|
|
2411
|
+
name: "ElTableFooter",
|
|
2412
|
+
props: {
|
|
2413
|
+
fixed: {
|
|
2414
|
+
type: String,
|
|
2415
|
+
default: ""
|
|
2416
|
+
},
|
|
2417
|
+
store: {
|
|
2418
|
+
required: !0,
|
|
2419
|
+
type: Object
|
|
2420
|
+
},
|
|
2421
|
+
summaryMethod: Function,
|
|
2422
|
+
sumText: String,
|
|
2423
|
+
border: Boolean,
|
|
2424
|
+
defaultSort: {
|
|
2425
|
+
type: Object,
|
|
2426
|
+
default: () => ({
|
|
2427
|
+
prop: "",
|
|
2428
|
+
order: ""
|
|
2429
|
+
})
|
|
2430
|
+
}
|
|
2431
|
+
},
|
|
2432
|
+
setup(e) {
|
|
2433
|
+
const t = Ce(be), n = ye("table"), { getCellClasses: l, getCellStyles: r, columns: i } = jn(
|
|
2434
|
+
e
|
|
2435
|
+
), { onScrollableChange: f, onColumnsChange: o } = Wt(t);
|
|
2436
|
+
return {
|
|
2437
|
+
ns: n,
|
|
2438
|
+
onScrollableChange: f,
|
|
2439
|
+
onColumnsChange: o,
|
|
2440
|
+
getCellClasses: l,
|
|
2441
|
+
getCellStyles: r,
|
|
2442
|
+
columns: i
|
|
2443
|
+
};
|
|
2444
|
+
},
|
|
2445
|
+
render() {
|
|
2446
|
+
const { columns: e, getCellStyles: t, getCellClasses: n, summaryMethod: l, sumText: r } = this, i = this.store.states.data.value;
|
|
2447
|
+
let f = [];
|
|
2448
|
+
return l ? f = l({
|
|
2449
|
+
columns: e,
|
|
2450
|
+
data: i
|
|
2451
|
+
}) : e.forEach((o, s) => {
|
|
2452
|
+
if (s === 0) {
|
|
2453
|
+
f[s] = r;
|
|
2454
|
+
return;
|
|
2455
|
+
}
|
|
2456
|
+
const a = i.map((h) => Number(h[o.property])), u = [];
|
|
2457
|
+
let d = !0;
|
|
2458
|
+
a.forEach((h) => {
|
|
2459
|
+
if (!Number.isNaN(+h)) {
|
|
2460
|
+
d = !1;
|
|
2461
|
+
const p = `${h}`.split(".")[1];
|
|
2462
|
+
u.push(p ? p.length : 0);
|
|
2463
|
+
}
|
|
2464
|
+
});
|
|
2465
|
+
const m = Math.max.apply(null, u);
|
|
2466
|
+
d ? f[s] = "" : f[s] = a.reduce((h, p) => {
|
|
2467
|
+
const b = Number(p);
|
|
2468
|
+
return Number.isNaN(+b) ? h : Number.parseFloat(
|
|
2469
|
+
(h + p).toFixed(Math.min(m, 20))
|
|
2470
|
+
);
|
|
2471
|
+
}, 0);
|
|
2472
|
+
}), P(
|
|
2473
|
+
P("tfoot", [
|
|
2474
|
+
P("tr", {}, [
|
|
2475
|
+
...e.map(
|
|
2476
|
+
(o, s) => P(
|
|
2477
|
+
"td",
|
|
2478
|
+
{
|
|
2479
|
+
key: s,
|
|
2480
|
+
colspan: o.colSpan,
|
|
2481
|
+
rowspan: o.rowSpan,
|
|
2482
|
+
class: n(e, s),
|
|
2483
|
+
style: t(o, s)
|
|
2484
|
+
},
|
|
2485
|
+
[
|
|
2486
|
+
P(
|
|
2487
|
+
"div",
|
|
2488
|
+
{
|
|
2489
|
+
class: ["cell", o.labelClassName]
|
|
2490
|
+
},
|
|
2491
|
+
[f[s]]
|
|
2492
|
+
)
|
|
2493
|
+
]
|
|
2494
|
+
)
|
|
2495
|
+
)
|
|
2496
|
+
])
|
|
2497
|
+
])
|
|
2498
|
+
);
|
|
2499
|
+
}
|
|
2500
|
+
});
|
|
2501
|
+
function Yn(e) {
|
|
2502
|
+
return {
|
|
2503
|
+
setCurrentRow: (d) => {
|
|
2504
|
+
e.commit("setCurrentRow", d);
|
|
2505
|
+
},
|
|
2506
|
+
getSelectionRows: () => e.getSelectionRows(),
|
|
2507
|
+
toggleRowSelection: (d, m, h = !0) => {
|
|
2508
|
+
e.toggleRowSelection(d, m, !1, h), e.updateAllSelected();
|
|
2509
|
+
},
|
|
2510
|
+
clearSelection: () => {
|
|
2511
|
+
e.clearSelection();
|
|
2512
|
+
},
|
|
2513
|
+
clearFilter: (d) => {
|
|
2514
|
+
e.clearFilter(d);
|
|
2515
|
+
},
|
|
2516
|
+
toggleAllSelection: () => {
|
|
2517
|
+
e.commit("toggleAllSelection");
|
|
2518
|
+
},
|
|
2519
|
+
toggleRowExpansion: (d, m) => {
|
|
2520
|
+
e.toggleRowExpansionAdapter(d, m);
|
|
2521
|
+
},
|
|
2522
|
+
clearSort: () => {
|
|
2523
|
+
e.clearSort();
|
|
2524
|
+
},
|
|
2525
|
+
sort: (d, m) => {
|
|
2526
|
+
e.commit("sort", { prop: d, order: m });
|
|
2527
|
+
},
|
|
2528
|
+
updateKeyChildren: (d, m) => {
|
|
2529
|
+
e.updateKeyChildren(d, m);
|
|
2530
|
+
}
|
|
2531
|
+
};
|
|
2532
|
+
}
|
|
2533
|
+
function qn(e, t, n, l) {
|
|
2534
|
+
const r = E(!1), i = E(null), f = E(!1), o = (L) => {
|
|
2535
|
+
f.value = L;
|
|
2536
|
+
}, s = E({
|
|
2537
|
+
width: null,
|
|
2538
|
+
height: null,
|
|
2539
|
+
headerHeight: null
|
|
2540
|
+
}), a = E(!1), u = {
|
|
2541
|
+
display: "inline-block",
|
|
2542
|
+
verticalAlign: "middle"
|
|
2543
|
+
}, d = E(), m = E(0), h = E(0), p = E(0), b = E(0), C = E(0);
|
|
2544
|
+
ie(
|
|
2545
|
+
() => e.height,
|
|
2546
|
+
(L) => {
|
|
2547
|
+
t.setHeight(L ?? null);
|
|
2548
|
+
},
|
|
2549
|
+
{ immediate: !0 }
|
|
2550
|
+
), ie(
|
|
2551
|
+
() => e.maxHeight,
|
|
2552
|
+
(L) => {
|
|
2553
|
+
t.setMaxHeight(L ?? null);
|
|
2554
|
+
},
|
|
2555
|
+
{ immediate: !0 }
|
|
2556
|
+
), ie(
|
|
2557
|
+
() => [e.currentRowKey, n.states.rowKey],
|
|
2558
|
+
([L, W]) => {
|
|
2559
|
+
!ae(W) || !ae(L) || n.setCurrentRowKey(`${L}`);
|
|
2560
|
+
},
|
|
2561
|
+
{
|
|
2562
|
+
immediate: !0
|
|
2563
|
+
}
|
|
2564
|
+
), ie(
|
|
2565
|
+
() => e.data,
|
|
2566
|
+
(L) => {
|
|
2567
|
+
l.store.commit("setData", L);
|
|
2568
|
+
},
|
|
2569
|
+
{
|
|
2570
|
+
immediate: !0,
|
|
2571
|
+
deep: !0
|
|
2572
|
+
}
|
|
2573
|
+
), ct(() => {
|
|
2574
|
+
e.expandRowKeys && n.setExpandRowKeysAdapter(e.expandRowKeys);
|
|
2575
|
+
});
|
|
2576
|
+
const O = () => {
|
|
2577
|
+
l.store.commit("setHoverRow", null), l.hoverState && (l.hoverState = null);
|
|
2578
|
+
}, N = (L, W) => {
|
|
2579
|
+
const { pixelX: A, pixelY: T } = W;
|
|
2580
|
+
Math.abs(A) >= Math.abs(T) && (l.refs.bodyWrapper.scrollLeft += W.pixelX / 5);
|
|
2581
|
+
}, S = D(() => e.height || e.maxHeight || n.states.fixedColumns.value.length > 0 || n.states.rightFixedColumns.value.length > 0), c = D(() => ({
|
|
2582
|
+
width: t.bodyWidth.value ? `${t.bodyWidth.value}px` : ""
|
|
2583
|
+
})), v = () => {
|
|
2584
|
+
S.value && t.updateElsHeight(), t.updateColumnsWidth(), !(typeof window > "u") && requestAnimationFrame(x);
|
|
2585
|
+
};
|
|
2586
|
+
je(async () => {
|
|
2587
|
+
await Pe(), n.updateColumns(), R(), requestAnimationFrame(v);
|
|
2588
|
+
const L = l.vnode.el, W = l.refs.headerWrapper;
|
|
2589
|
+
e.flexible && L && L.parentElement && (L.parentElement.style.minWidth = "0"), s.value = {
|
|
2590
|
+
width: d.value = L.offsetWidth,
|
|
2591
|
+
height: L.offsetHeight,
|
|
2592
|
+
headerHeight: e.showHeader && W ? W.offsetHeight : null
|
|
2593
|
+
}, n.states.columns.value.forEach((A) => {
|
|
2594
|
+
A.filteredValue && A.filteredValue.length && l.store.commit("filterChange", {
|
|
2595
|
+
column: A,
|
|
2596
|
+
values: A.filteredValue,
|
|
2597
|
+
silent: !0
|
|
2598
|
+
});
|
|
2599
|
+
}), l.$ready = !0;
|
|
2600
|
+
});
|
|
2601
|
+
const w = (L, W) => {
|
|
2602
|
+
if (!L)
|
|
2603
|
+
return;
|
|
2604
|
+
const A = Array.from(L.classList).filter(
|
|
2605
|
+
(T) => !T.startsWith("is-scrolling-")
|
|
2606
|
+
);
|
|
2607
|
+
A.push(t.scrollX.value ? W : "is-scrolling-none"), L.className = A.join(" ");
|
|
2608
|
+
}, g = (L) => {
|
|
2609
|
+
const { tableWrapper: W } = l.refs;
|
|
2610
|
+
w(W, L);
|
|
2611
|
+
}, y = (L) => {
|
|
2612
|
+
const { tableWrapper: W } = l.refs;
|
|
2613
|
+
return !!(W && W.classList.contains(L));
|
|
2614
|
+
}, x = function() {
|
|
2615
|
+
if (!l.refs.scrollBarRef)
|
|
2616
|
+
return;
|
|
2617
|
+
if (!t.scrollX.value) {
|
|
2618
|
+
const Q = "is-scrolling-none";
|
|
2619
|
+
y(Q) || g(Q);
|
|
2620
|
+
return;
|
|
2621
|
+
}
|
|
2622
|
+
const L = l.refs.scrollBarRef.wrapRef;
|
|
2623
|
+
if (!L)
|
|
2624
|
+
return;
|
|
2625
|
+
const { scrollLeft: W, offsetWidth: A, scrollWidth: T } = L, { headerWrapper: z, footerWrapper: Y } = l.refs;
|
|
2626
|
+
z && (z.scrollLeft = W), Y && (Y.scrollLeft = W);
|
|
2627
|
+
const Z = T - A - 1;
|
|
2628
|
+
W >= Z ? g("is-scrolling-right") : g(W === 0 ? "is-scrolling-left" : "is-scrolling-middle");
|
|
2629
|
+
}, R = () => {
|
|
2630
|
+
l.refs.scrollBarRef && (l.refs.scrollBarRef.wrapRef && Pt(
|
|
2631
|
+
l.refs.scrollBarRef.wrapRef,
|
|
2632
|
+
"scroll",
|
|
2633
|
+
x,
|
|
2634
|
+
{
|
|
2635
|
+
passive: !0
|
|
2636
|
+
}
|
|
2637
|
+
), e.fit ? Kt(l.vnode.el, H) : Pt(window, "resize", H), Kt(l.refs.tableInnerWrapper, () => {
|
|
2638
|
+
var L, W;
|
|
2639
|
+
H(), (W = (L = l.refs) == null ? void 0 : L.scrollBarRef) == null || W.update();
|
|
2640
|
+
}));
|
|
2641
|
+
}, H = () => {
|
|
2642
|
+
var L, W, A, T;
|
|
2643
|
+
const z = l.vnode.el;
|
|
2644
|
+
if (!l.$ready || !z)
|
|
2645
|
+
return;
|
|
2646
|
+
let Y = !1;
|
|
2647
|
+
const {
|
|
2648
|
+
width: Z,
|
|
2649
|
+
height: Q,
|
|
2650
|
+
headerHeight: ne
|
|
2651
|
+
} = s.value, G = d.value = z.offsetWidth;
|
|
2652
|
+
Z !== G && (Y = !0);
|
|
2653
|
+
const pe = z.offsetHeight;
|
|
2654
|
+
(e.height || S.value) && Q !== pe && (Y = !0);
|
|
2655
|
+
const oe = e.tableLayout === "fixed" ? l.refs.headerWrapper : (L = l.refs.tableHeaderRef) == null ? void 0 : L.$el;
|
|
2656
|
+
e.showHeader && oe?.offsetHeight !== ne && (Y = !0), m.value = ((W = l.refs.tableWrapper) == null ? void 0 : W.scrollHeight) || 0, p.value = oe?.scrollHeight || 0, b.value = ((A = l.refs.footerWrapper) == null ? void 0 : A.offsetHeight) || 0, C.value = ((T = l.refs.appendWrapper) == null ? void 0 : T.offsetHeight) || 0, h.value = m.value - p.value - b.value - C.value, Y && (s.value = {
|
|
2657
|
+
width: G,
|
|
2658
|
+
height: pe,
|
|
2659
|
+
headerHeight: e.showHeader && oe?.offsetHeight || 0
|
|
2660
|
+
}, v());
|
|
2661
|
+
}, k = Jl(), $ = D(() => {
|
|
2662
|
+
const { bodyWidth: L, scrollY: W, gutterWidth: A } = t;
|
|
2663
|
+
return L.value ? `${L.value - (W.value ? A : 0)}px` : "";
|
|
2664
|
+
}), M = D(() => e.maxHeight ? "fixed" : e.tableLayout), X = D(() => {
|
|
2665
|
+
if (e.data && e.data.length)
|
|
2666
|
+
return;
|
|
2667
|
+
let L = "100%";
|
|
2668
|
+
e.height && h.value && (L = `${h.value}px`);
|
|
2669
|
+
const W = d.value;
|
|
2670
|
+
return {
|
|
2671
|
+
width: W ? `${W}px` : "",
|
|
2672
|
+
height: L
|
|
2673
|
+
};
|
|
2674
|
+
}), I = D(() => e.height ? {
|
|
2675
|
+
height: "100%"
|
|
2676
|
+
} : e.maxHeight ? Number.isNaN(Number(e.maxHeight)) ? {
|
|
2677
|
+
maxHeight: `calc(${e.maxHeight} - ${p.value + b.value}px)`
|
|
2678
|
+
} : {
|
|
2679
|
+
maxHeight: `${+e.maxHeight - p.value - b.value}px`
|
|
2680
|
+
} : {});
|
|
2681
|
+
return {
|
|
2682
|
+
isHidden: r,
|
|
2683
|
+
renderExpanded: i,
|
|
2684
|
+
setDragVisible: o,
|
|
2685
|
+
isGroup: a,
|
|
2686
|
+
handleMouseLeave: O,
|
|
2687
|
+
handleHeaderFooterMousewheel: N,
|
|
2688
|
+
tableSize: k,
|
|
2689
|
+
emptyBlockStyle: X,
|
|
2690
|
+
resizeProxyVisible: f,
|
|
2691
|
+
bodyWidth: $,
|
|
2692
|
+
resizeState: s,
|
|
2693
|
+
doLayout: v,
|
|
2694
|
+
tableBodyStyles: c,
|
|
2695
|
+
tableLayout: M,
|
|
2696
|
+
scrollbarViewStyle: u,
|
|
2697
|
+
scrollbarStyle: I
|
|
2698
|
+
};
|
|
2699
|
+
}
|
|
2700
|
+
function Xn(e) {
|
|
2701
|
+
const t = E(), n = () => {
|
|
2702
|
+
const r = e.vnode.el.querySelector(".hidden-columns"), i = { childList: !0, subtree: !0 }, f = e.store.states.updateOrderFns;
|
|
2703
|
+
t.value = new MutationObserver(() => {
|
|
2704
|
+
f.forEach((o) => o());
|
|
2705
|
+
}), t.value.observe(r, i);
|
|
2706
|
+
};
|
|
2707
|
+
je(() => {
|
|
2708
|
+
n();
|
|
2709
|
+
}), xt(() => {
|
|
2710
|
+
var l;
|
|
2711
|
+
(l = t.value) == null || l.disconnect();
|
|
2712
|
+
});
|
|
2713
|
+
}
|
|
2714
|
+
var Gn = {
|
|
2715
|
+
data: {
|
|
2716
|
+
type: Array,
|
|
2717
|
+
default: () => []
|
|
2718
|
+
},
|
|
2719
|
+
size: Zl,
|
|
2720
|
+
width: [String, Number],
|
|
2721
|
+
height: [String, Number],
|
|
2722
|
+
maxHeight: [String, Number],
|
|
2723
|
+
fit: {
|
|
2724
|
+
type: Boolean,
|
|
2725
|
+
default: !0
|
|
2726
|
+
},
|
|
2727
|
+
stripe: Boolean,
|
|
2728
|
+
border: Boolean,
|
|
2729
|
+
rowKey: [String, Function],
|
|
2730
|
+
showHeader: {
|
|
2731
|
+
type: Boolean,
|
|
2732
|
+
default: !0
|
|
2733
|
+
},
|
|
2734
|
+
showSummary: Boolean,
|
|
2735
|
+
sumText: String,
|
|
2736
|
+
summaryMethod: Function,
|
|
2737
|
+
rowClassName: [String, Function],
|
|
2738
|
+
rowStyle: [Object, Function],
|
|
2739
|
+
cellClassName: [String, Function],
|
|
2740
|
+
cellStyle: [Object, Function],
|
|
2741
|
+
headerRowClassName: [String, Function],
|
|
2742
|
+
headerRowStyle: [Object, Function],
|
|
2743
|
+
headerCellClassName: [String, Function],
|
|
2744
|
+
headerCellStyle: [Object, Function],
|
|
2745
|
+
highlightCurrentRow: Boolean,
|
|
2746
|
+
currentRowKey: [String, Number],
|
|
2747
|
+
emptyText: String,
|
|
2748
|
+
expandRowKeys: Array,
|
|
2749
|
+
defaultExpandAll: Boolean,
|
|
2750
|
+
defaultSort: Object,
|
|
2751
|
+
tooltipEffect: String,
|
|
2752
|
+
tooltipOptions: Object,
|
|
2753
|
+
spanMethod: Function,
|
|
2754
|
+
selectOnIndeterminate: {
|
|
2755
|
+
type: Boolean,
|
|
2756
|
+
default: !0
|
|
2757
|
+
},
|
|
2758
|
+
indent: {
|
|
2759
|
+
type: Number,
|
|
2760
|
+
default: 16
|
|
2761
|
+
},
|
|
2762
|
+
treeProps: {
|
|
2763
|
+
type: Object,
|
|
2764
|
+
default: () => ({
|
|
2765
|
+
hasChildren: "hasChildren",
|
|
2766
|
+
children: "children",
|
|
2767
|
+
checkStrictly: !1
|
|
2768
|
+
})
|
|
2769
|
+
},
|
|
2770
|
+
lazy: Boolean,
|
|
2771
|
+
load: Function,
|
|
2772
|
+
style: {
|
|
2773
|
+
type: [String, Object, Array],
|
|
2774
|
+
default: () => ({})
|
|
2775
|
+
},
|
|
2776
|
+
className: {
|
|
2777
|
+
type: String,
|
|
2778
|
+
default: ""
|
|
2779
|
+
},
|
|
2780
|
+
tableLayout: {
|
|
2781
|
+
type: String,
|
|
2782
|
+
default: "fixed"
|
|
2783
|
+
},
|
|
2784
|
+
scrollbarAlwaysOn: Boolean,
|
|
2785
|
+
flexible: Boolean,
|
|
2786
|
+
showOverflowTooltip: [Boolean, Object],
|
|
2787
|
+
tooltipFormatter: Function,
|
|
2788
|
+
appendFilterPanelTo: String,
|
|
2789
|
+
scrollbarTabindex: {
|
|
2790
|
+
type: [Number, String],
|
|
2791
|
+
default: void 0
|
|
2792
|
+
},
|
|
2793
|
+
allowDragLastColumn: {
|
|
2794
|
+
type: Boolean,
|
|
2795
|
+
default: !0
|
|
2796
|
+
},
|
|
2797
|
+
preserveExpandedContent: Boolean,
|
|
2798
|
+
nativeScrollbar: Boolean
|
|
2799
|
+
};
|
|
2800
|
+
function vl(e) {
|
|
2801
|
+
const t = e.tableLayout === "auto";
|
|
2802
|
+
let n = e.columns || [];
|
|
2803
|
+
t && n.every(({ width: r }) => xe(r)) && (n = []);
|
|
2804
|
+
const l = (r) => {
|
|
2805
|
+
const i = {
|
|
2806
|
+
key: `${e.tableLayout}_${r.id}`,
|
|
2807
|
+
style: {},
|
|
2808
|
+
name: void 0
|
|
2809
|
+
};
|
|
2810
|
+
return t ? i.style = {
|
|
2811
|
+
width: `${r.width}px`
|
|
2812
|
+
} : i.name = r.id, i;
|
|
2813
|
+
};
|
|
2814
|
+
return P(
|
|
2815
|
+
"colgroup",
|
|
2816
|
+
{},
|
|
2817
|
+
n.map((r) => P("col", l(r)))
|
|
2818
|
+
);
|
|
2819
|
+
}
|
|
2820
|
+
vl.props = ["columns", "tableLayout"];
|
|
2821
|
+
const Qn = () => {
|
|
2822
|
+
const e = E(), t = (i, f) => {
|
|
2823
|
+
const o = e.value;
|
|
2824
|
+
o && o.scrollTo(i, f);
|
|
2825
|
+
}, n = (i, f) => {
|
|
2826
|
+
const o = e.value;
|
|
2827
|
+
o && Ae(f) && ["Top", "Left"].includes(i) && o[`setScroll${i}`](f);
|
|
2828
|
+
};
|
|
2829
|
+
return {
|
|
2830
|
+
scrollBarRef: e,
|
|
2831
|
+
scrollTo: t,
|
|
2832
|
+
setScrollTop: (i) => n("Top", i),
|
|
2833
|
+
setScrollLeft: (i) => n("Left", i)
|
|
2834
|
+
};
|
|
2835
|
+
};
|
|
2836
|
+
var _t = !1, Te, vt, pt, Qe, Je, pl, Ze, mt, gt, yt, ml, bt, Ct, gl, yl;
|
|
2837
|
+
function re() {
|
|
2838
|
+
if (!_t) {
|
|
2839
|
+
_t = !0;
|
|
2840
|
+
var e = navigator.userAgent, t = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e), n = /(Mac OS X)|(Windows)|(Linux)/.exec(e);
|
|
2841
|
+
if (bt = /\b(iPhone|iP[ao]d)/.exec(e), Ct = /\b(iP[ao]d)/.exec(e), yt = /Android/i.exec(e), gl = /FBAN\/\w+;/i.exec(e), yl = /Mobile/i.exec(e), ml = !!/Win64/.exec(e), t) {
|
|
2842
|
+
Te = t[1] ? parseFloat(t[1]) : t[5] ? parseFloat(t[5]) : NaN, Te && document && document.documentMode && (Te = document.documentMode);
|
|
2843
|
+
var l = /(?:Trident\/(\d+.\d+))/.exec(e);
|
|
2844
|
+
pl = l ? parseFloat(l[1]) + 4 : Te, vt = t[2] ? parseFloat(t[2]) : NaN, pt = t[3] ? parseFloat(t[3]) : NaN, Qe = t[4] ? parseFloat(t[4]) : NaN, Qe ? (t = /(?:Chrome\/(\d+\.\d+))/.exec(e), Je = t && t[1] ? parseFloat(t[1]) : NaN) : Je = NaN;
|
|
2845
|
+
} else Te = vt = pt = Je = Qe = NaN;
|
|
2846
|
+
if (n) {
|
|
2847
|
+
if (n[1]) {
|
|
2848
|
+
var r = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);
|
|
2849
|
+
Ze = r ? parseFloat(r[1].replace("_", ".")) : !0;
|
|
2850
|
+
} else Ze = !1;
|
|
2851
|
+
mt = !!n[2], gt = !!n[3];
|
|
2852
|
+
} else Ze = mt = gt = !1;
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
var wt = { ie: function() {
|
|
2856
|
+
return re() || Te;
|
|
2857
|
+
}, ieCompatibilityMode: function() {
|
|
2858
|
+
return re() || pl > Te;
|
|
2859
|
+
}, ie64: function() {
|
|
2860
|
+
return wt.ie() && ml;
|
|
2861
|
+
}, firefox: function() {
|
|
2862
|
+
return re() || vt;
|
|
2863
|
+
}, opera: function() {
|
|
2864
|
+
return re() || pt;
|
|
2865
|
+
}, webkit: function() {
|
|
2866
|
+
return re() || Qe;
|
|
2867
|
+
}, safari: function() {
|
|
2868
|
+
return wt.webkit();
|
|
2869
|
+
}, chrome: function() {
|
|
2870
|
+
return re() || Je;
|
|
2871
|
+
}, windows: function() {
|
|
2872
|
+
return re() || mt;
|
|
2873
|
+
}, osx: function() {
|
|
2874
|
+
return re() || Ze;
|
|
2875
|
+
}, linux: function() {
|
|
2876
|
+
return re() || gt;
|
|
2877
|
+
}, iphone: function() {
|
|
2878
|
+
return re() || bt;
|
|
2879
|
+
}, mobile: function() {
|
|
2880
|
+
return re() || bt || Ct || yt || yl;
|
|
2881
|
+
}, nativeApp: function() {
|
|
2882
|
+
return re() || gl;
|
|
2883
|
+
}, android: function() {
|
|
2884
|
+
return re() || yt;
|
|
2885
|
+
}, ipad: function() {
|
|
2886
|
+
return re() || Ct;
|
|
2887
|
+
} }, Jn = wt, Zn = !!(typeof window < "u" && window.document && window.document.createElement), eo = { canUseDOM: Zn }, bl = eo, Cl;
|
|
2888
|
+
bl.canUseDOM && (Cl = document.implementation && document.implementation.hasFeature && document.implementation.hasFeature("", "") !== !0);
|
|
2889
|
+
function to(e, t) {
|
|
2890
|
+
if (!bl.canUseDOM || t && !("addEventListener" in document)) return !1;
|
|
2891
|
+
var n = "on" + e, l = n in document;
|
|
2892
|
+
if (!l) {
|
|
2893
|
+
var r = document.createElement("div");
|
|
2894
|
+
r.setAttribute(n, "return;"), l = typeof r[n] == "function";
|
|
2895
|
+
}
|
|
2896
|
+
return !l && Cl && e === "wheel" && (l = document.implementation.hasFeature("Events.wheel", "3.0")), l;
|
|
2897
|
+
}
|
|
2898
|
+
var lo = to, Dt = 10, Vt = 40, jt = 800;
|
|
2899
|
+
function wl(e) {
|
|
2900
|
+
var t = 0, n = 0, l = 0, r = 0;
|
|
2901
|
+
return "detail" in e && (n = e.detail), "wheelDelta" in e && (n = -e.wheelDelta / 120), "wheelDeltaY" in e && (n = -e.wheelDeltaY / 120), "wheelDeltaX" in e && (t = -e.wheelDeltaX / 120), "axis" in e && e.axis === e.HORIZONTAL_AXIS && (t = n, n = 0), l = t * Dt, r = n * Dt, "deltaY" in e && (r = e.deltaY), "deltaX" in e && (l = e.deltaX), (l || r) && e.deltaMode && (e.deltaMode == 1 ? (l *= Vt, r *= Vt) : (l *= jt, r *= jt)), l && !t && (t = l < 1 ? -1 : 1), r && !n && (n = r < 1 ? -1 : 1), { spinX: t, spinY: n, pixelX: l, pixelY: r };
|
|
2902
|
+
}
|
|
2903
|
+
wl.getEventType = function() {
|
|
2904
|
+
return Jn.firefox() ? "DOMMouseScroll" : lo("wheel") ? "wheel" : "mousewheel";
|
|
2905
|
+
};
|
|
2906
|
+
var no = wl;
|
|
2907
|
+
const et = "_Mousewheel", Ut = function(e, t) {
|
|
2908
|
+
if (e && e.addEventListener) {
|
|
2909
|
+
Sl(e);
|
|
2910
|
+
const n = function(l) {
|
|
2911
|
+
const r = no(l);
|
|
2912
|
+
t && Reflect.apply(t, this, [l, r]);
|
|
2913
|
+
};
|
|
2914
|
+
e[et] = { wheelHandler: n }, e.addEventListener("wheel", n, { passive: !0 });
|
|
2915
|
+
}
|
|
2916
|
+
}, Sl = (e) => {
|
|
2917
|
+
var t;
|
|
2918
|
+
(t = e[et]) != null && t.wheelHandler && (e.removeEventListener("wheel", e[et].wheelHandler), e[et] = null);
|
|
2919
|
+
}, oo = {
|
|
2920
|
+
beforeMount(e, t) {
|
|
2921
|
+
Ut(e, t.value);
|
|
2922
|
+
},
|
|
2923
|
+
unmounted(e) {
|
|
2924
|
+
Sl(e);
|
|
2925
|
+
},
|
|
2926
|
+
updated(e, t) {
|
|
2927
|
+
t.value !== t.oldValue && Ut(e, t.value);
|
|
2928
|
+
}
|
|
2929
|
+
};
|
|
2930
|
+
let ao = 1;
|
|
2931
|
+
const ro = Oe({
|
|
2932
|
+
name: "ElTable",
|
|
2933
|
+
directives: {
|
|
2934
|
+
Mousewheel: oo
|
|
2935
|
+
},
|
|
2936
|
+
components: {
|
|
2937
|
+
TableHeader: An,
|
|
2938
|
+
TableBody: Dn,
|
|
2939
|
+
TableFooter: Un,
|
|
2940
|
+
ElScrollbar: Jt,
|
|
2941
|
+
hColgroup: vl
|
|
2942
|
+
},
|
|
2943
|
+
props: Gn,
|
|
2944
|
+
emits: [
|
|
2945
|
+
"select",
|
|
2946
|
+
"select-all",
|
|
2947
|
+
"selection-change",
|
|
2948
|
+
"cell-mouse-enter",
|
|
2949
|
+
"cell-mouse-leave",
|
|
2950
|
+
"cell-contextmenu",
|
|
2951
|
+
"cell-click",
|
|
2952
|
+
"cell-dblclick",
|
|
2953
|
+
"row-click",
|
|
2954
|
+
"row-contextmenu",
|
|
2955
|
+
"row-dblclick",
|
|
2956
|
+
"header-click",
|
|
2957
|
+
"header-contextmenu",
|
|
2958
|
+
"sort-change",
|
|
2959
|
+
"filter-change",
|
|
2960
|
+
"current-change",
|
|
2961
|
+
"header-dragend",
|
|
2962
|
+
"expand-change",
|
|
2963
|
+
"scroll"
|
|
2964
|
+
],
|
|
2965
|
+
setup(e) {
|
|
2966
|
+
const { t } = at(), n = ye("table"), l = ue();
|
|
2967
|
+
jl(be, l);
|
|
2968
|
+
const r = Sn(l, e);
|
|
2969
|
+
l.store = r;
|
|
2970
|
+
const i = new En({
|
|
2971
|
+
store: l.store,
|
|
2972
|
+
table: l,
|
|
2973
|
+
fit: e.fit,
|
|
2974
|
+
showHeader: e.showHeader
|
|
2975
|
+
});
|
|
2976
|
+
l.layout = i;
|
|
2977
|
+
const f = D(() => (r.states.data.value || []).length === 0), {
|
|
2978
|
+
setCurrentRow: o,
|
|
2979
|
+
getSelectionRows: s,
|
|
2980
|
+
toggleRowSelection: a,
|
|
2981
|
+
clearSelection: u,
|
|
2982
|
+
clearFilter: d,
|
|
2983
|
+
toggleAllSelection: m,
|
|
2984
|
+
toggleRowExpansion: h,
|
|
2985
|
+
clearSort: p,
|
|
2986
|
+
sort: b,
|
|
2987
|
+
updateKeyChildren: C
|
|
2988
|
+
} = Yn(r), {
|
|
2989
|
+
isHidden: O,
|
|
2990
|
+
renderExpanded: N,
|
|
2991
|
+
setDragVisible: S,
|
|
2992
|
+
isGroup: c,
|
|
2993
|
+
handleMouseLeave: v,
|
|
2994
|
+
handleHeaderFooterMousewheel: w,
|
|
2995
|
+
tableSize: g,
|
|
2996
|
+
emptyBlockStyle: y,
|
|
2997
|
+
resizeProxyVisible: x,
|
|
2998
|
+
bodyWidth: R,
|
|
2999
|
+
resizeState: H,
|
|
3000
|
+
doLayout: k,
|
|
3001
|
+
tableBodyStyles: $,
|
|
3002
|
+
tableLayout: M,
|
|
3003
|
+
scrollbarViewStyle: X,
|
|
3004
|
+
scrollbarStyle: I
|
|
3005
|
+
} = qn(e, i, r, l), { scrollBarRef: L, scrollTo: W, setScrollLeft: A, setScrollTop: T } = Qn(), z = lt(k, 50), Y = `${n.namespace.value}-table_${ao++}`;
|
|
3006
|
+
l.tableId = Y, l.state = {
|
|
3007
|
+
isGroup: c,
|
|
3008
|
+
resizeState: H,
|
|
3009
|
+
doLayout: k,
|
|
3010
|
+
debouncedUpdateLayout: z
|
|
3011
|
+
};
|
|
3012
|
+
const Z = D(
|
|
3013
|
+
() => {
|
|
3014
|
+
var G;
|
|
3015
|
+
return (G = e.sumText) != null ? G : t("el.table.sumText");
|
|
3016
|
+
}
|
|
3017
|
+
), Q = D(() => {
|
|
3018
|
+
var G;
|
|
3019
|
+
return (G = e.emptyText) != null ? G : t("el.table.emptyText");
|
|
3020
|
+
}), ne = D(() => hl(r.states.originColumns.value)[0]);
|
|
3021
|
+
return Xn(l), Et(() => {
|
|
3022
|
+
z.cancel();
|
|
3023
|
+
}), {
|
|
3024
|
+
ns: n,
|
|
3025
|
+
layout: i,
|
|
3026
|
+
store: r,
|
|
3027
|
+
columns: ne,
|
|
3028
|
+
handleHeaderFooterMousewheel: w,
|
|
3029
|
+
handleMouseLeave: v,
|
|
3030
|
+
tableId: Y,
|
|
3031
|
+
tableSize: g,
|
|
3032
|
+
isHidden: O,
|
|
3033
|
+
isEmpty: f,
|
|
3034
|
+
renderExpanded: N,
|
|
3035
|
+
resizeProxyVisible: x,
|
|
3036
|
+
resizeState: H,
|
|
3037
|
+
isGroup: c,
|
|
3038
|
+
bodyWidth: R,
|
|
3039
|
+
tableBodyStyles: $,
|
|
3040
|
+
emptyBlockStyle: y,
|
|
3041
|
+
debouncedUpdateLayout: z,
|
|
3042
|
+
setCurrentRow: o,
|
|
3043
|
+
getSelectionRows: s,
|
|
3044
|
+
toggleRowSelection: a,
|
|
3045
|
+
clearSelection: u,
|
|
3046
|
+
clearFilter: d,
|
|
3047
|
+
toggleAllSelection: m,
|
|
3048
|
+
toggleRowExpansion: h,
|
|
3049
|
+
clearSort: p,
|
|
3050
|
+
doLayout: k,
|
|
3051
|
+
sort: b,
|
|
3052
|
+
updateKeyChildren: C,
|
|
3053
|
+
t,
|
|
3054
|
+
setDragVisible: S,
|
|
3055
|
+
context: l,
|
|
3056
|
+
computedSumText: Z,
|
|
3057
|
+
computedEmptyText: Q,
|
|
3058
|
+
tableLayout: M,
|
|
3059
|
+
scrollbarViewStyle: X,
|
|
3060
|
+
scrollbarStyle: I,
|
|
3061
|
+
scrollBarRef: L,
|
|
3062
|
+
scrollTo: W,
|
|
3063
|
+
setScrollLeft: A,
|
|
3064
|
+
setScrollTop: T,
|
|
3065
|
+
allowDragLastColumn: e.allowDragLastColumn
|
|
3066
|
+
};
|
|
3067
|
+
}
|
|
3068
|
+
}), so = ["data-prefix"], io = {
|
|
3069
|
+
ref: "hiddenColumns",
|
|
3070
|
+
class: "hidden-columns"
|
|
3071
|
+
};
|
|
3072
|
+
function uo(e, t, n, l, r, i) {
|
|
3073
|
+
const f = ce("hColgroup"), o = ce("table-header"), s = ce("table-body"), a = ce("table-footer"), u = ce("el-scrollbar"), d = Vl("mousewheel");
|
|
3074
|
+
return J(), fe("div", {
|
|
3075
|
+
ref: "tableWrapper",
|
|
3076
|
+
class: U([
|
|
3077
|
+
{
|
|
3078
|
+
[e.ns.m("fit")]: e.fit,
|
|
3079
|
+
[e.ns.m("striped")]: e.stripe,
|
|
3080
|
+
[e.ns.m("border")]: e.border || e.isGroup,
|
|
3081
|
+
[e.ns.m("hidden")]: e.isHidden,
|
|
3082
|
+
[e.ns.m("group")]: e.isGroup,
|
|
3083
|
+
[e.ns.m("fluid-height")]: e.maxHeight,
|
|
3084
|
+
[e.ns.m("scrollable-x")]: e.layout.scrollX.value,
|
|
3085
|
+
[e.ns.m("scrollable-y")]: e.layout.scrollY.value,
|
|
3086
|
+
[e.ns.m("enable-row-hover")]: !e.store.states.isComplex.value,
|
|
3087
|
+
[e.ns.m("enable-row-transition")]: (e.store.states.data.value || []).length !== 0 && (e.store.states.data.value || []).length < 100,
|
|
3088
|
+
"has-footer": e.showSummary
|
|
3089
|
+
},
|
|
3090
|
+
e.ns.m(e.tableSize),
|
|
3091
|
+
e.className,
|
|
3092
|
+
e.ns.b(),
|
|
3093
|
+
e.ns.m(`layout-${e.tableLayout}`)
|
|
3094
|
+
]),
|
|
3095
|
+
style: Be(e.style),
|
|
3096
|
+
"data-prefix": e.ns.namespace.value,
|
|
3097
|
+
onMouseleave: t[1] || (t[1] = (...m) => e.handleMouseLeave && e.handleMouseLeave(...m))
|
|
3098
|
+
}, [
|
|
3099
|
+
se(
|
|
3100
|
+
"div",
|
|
3101
|
+
{
|
|
3102
|
+
ref: "tableInnerWrapper",
|
|
3103
|
+
class: U(e.ns.e("inner-wrapper"))
|
|
3104
|
+
},
|
|
3105
|
+
[
|
|
3106
|
+
se(
|
|
3107
|
+
"div",
|
|
3108
|
+
io,
|
|
3109
|
+
[
|
|
3110
|
+
Fe(e.$slots, "default")
|
|
3111
|
+
],
|
|
3112
|
+
512
|
|
3113
|
+
),
|
|
3114
|
+
e.showHeader && e.tableLayout === "fixed" ? st((J(), fe(
|
|
3115
|
+
"div",
|
|
3116
|
+
{
|
|
3117
|
+
key: 0,
|
|
3118
|
+
ref: "headerWrapper",
|
|
3119
|
+
class: U(e.ns.e("header-wrapper"))
|
|
3120
|
+
},
|
|
3121
|
+
[
|
|
3122
|
+
se(
|
|
3123
|
+
"table",
|
|
3124
|
+
{
|
|
3125
|
+
ref: "tableHeader",
|
|
3126
|
+
class: U(e.ns.e("header")),
|
|
3127
|
+
style: Be(e.tableBodyStyles),
|
|
3128
|
+
border: "0",
|
|
3129
|
+
cellpadding: "0",
|
|
3130
|
+
cellspacing: "0"
|
|
3131
|
+
},
|
|
3132
|
+
[
|
|
3133
|
+
ge(f, {
|
|
3134
|
+
columns: e.store.states.columns.value,
|
|
3135
|
+
"table-layout": e.tableLayout
|
|
3136
|
+
}, null, 8, ["columns", "table-layout"]),
|
|
3137
|
+
ge(o, {
|
|
3138
|
+
ref: "tableHeaderRef",
|
|
3139
|
+
border: e.border,
|
|
3140
|
+
"default-sort": e.defaultSort,
|
|
3141
|
+
store: e.store,
|
|
3142
|
+
"append-filter-panel-to": e.appendFilterPanelTo,
|
|
3143
|
+
"allow-drag-last-column": e.allowDragLastColumn,
|
|
3144
|
+
onSetDragVisible: e.setDragVisible
|
|
3145
|
+
}, null, 8, ["border", "default-sort", "store", "append-filter-panel-to", "allow-drag-last-column", "onSetDragVisible"])
|
|
3146
|
+
],
|
|
3147
|
+
6
|
|
3148
|
+
)
|
|
3149
|
+
],
|
|
3150
|
+
2
|
|
3151
|
+
)), [
|
|
3152
|
+
[d, e.handleHeaderFooterMousewheel]
|
|
3153
|
+
]) : Ee("v-if", !0),
|
|
3154
|
+
se(
|
|
3155
|
+
"div",
|
|
3156
|
+
{
|
|
3157
|
+
ref: "bodyWrapper",
|
|
3158
|
+
class: U(e.ns.e("body-wrapper"))
|
|
3159
|
+
},
|
|
3160
|
+
[
|
|
3161
|
+
ge(u, {
|
|
3162
|
+
ref: "scrollBarRef",
|
|
3163
|
+
"view-style": e.scrollbarViewStyle,
|
|
3164
|
+
"wrap-style": e.scrollbarStyle,
|
|
3165
|
+
always: e.scrollbarAlwaysOn,
|
|
3166
|
+
tabindex: e.scrollbarTabindex,
|
|
3167
|
+
native: e.nativeScrollbar,
|
|
3168
|
+
onScroll: t[0] || (t[0] = (m) => e.$emit("scroll", m))
|
|
3169
|
+
}, {
|
|
3170
|
+
default: Ne(() => [
|
|
3171
|
+
se(
|
|
3172
|
+
"table",
|
|
3173
|
+
{
|
|
3174
|
+
ref: "tableBody",
|
|
3175
|
+
class: U(e.ns.e("body")),
|
|
3176
|
+
cellspacing: "0",
|
|
3177
|
+
cellpadding: "0",
|
|
3178
|
+
border: "0",
|
|
3179
|
+
style: Be({
|
|
3180
|
+
width: e.bodyWidth,
|
|
3181
|
+
tableLayout: e.tableLayout
|
|
3182
|
+
})
|
|
3183
|
+
},
|
|
3184
|
+
[
|
|
3185
|
+
ge(f, {
|
|
3186
|
+
columns: e.store.states.columns.value,
|
|
3187
|
+
"table-layout": e.tableLayout
|
|
3188
|
+
}, null, 8, ["columns", "table-layout"]),
|
|
3189
|
+
e.showHeader && e.tableLayout === "auto" ? (J(), ke(o, {
|
|
3190
|
+
key: 0,
|
|
3191
|
+
ref: "tableHeaderRef",
|
|
3192
|
+
class: U(e.ns.e("body-header")),
|
|
3193
|
+
border: e.border,
|
|
3194
|
+
"default-sort": e.defaultSort,
|
|
3195
|
+
store: e.store,
|
|
3196
|
+
"append-filter-panel-to": e.appendFilterPanelTo,
|
|
3197
|
+
onSetDragVisible: e.setDragVisible
|
|
3198
|
+
}, null, 8, ["class", "border", "default-sort", "store", "append-filter-panel-to", "onSetDragVisible"])) : Ee("v-if", !0),
|
|
3199
|
+
ge(s, {
|
|
3200
|
+
context: e.context,
|
|
3201
|
+
highlight: e.highlightCurrentRow,
|
|
3202
|
+
"row-class-name": e.rowClassName,
|
|
3203
|
+
"tooltip-effect": e.tooltipEffect,
|
|
3204
|
+
"tooltip-options": e.tooltipOptions,
|
|
3205
|
+
"row-style": e.rowStyle,
|
|
3206
|
+
store: e.store,
|
|
3207
|
+
stripe: e.stripe
|
|
3208
|
+
}, null, 8, ["context", "highlight", "row-class-name", "tooltip-effect", "tooltip-options", "row-style", "store", "stripe"]),
|
|
3209
|
+
e.showSummary && e.tableLayout === "auto" ? (J(), ke(a, {
|
|
3210
|
+
key: 1,
|
|
3211
|
+
class: U(e.ns.e("body-footer")),
|
|
3212
|
+
border: e.border,
|
|
3213
|
+
"default-sort": e.defaultSort,
|
|
3214
|
+
store: e.store,
|
|
3215
|
+
"sum-text": e.computedSumText,
|
|
3216
|
+
"summary-method": e.summaryMethod
|
|
3217
|
+
}, null, 8, ["class", "border", "default-sort", "store", "sum-text", "summary-method"])) : Ee("v-if", !0)
|
|
3218
|
+
],
|
|
3219
|
+
6
|
|
3220
|
+
),
|
|
3221
|
+
e.isEmpty ? (J(), fe(
|
|
3222
|
+
"div",
|
|
3223
|
+
{
|
|
3224
|
+
key: 0,
|
|
3225
|
+
ref: "emptyBlock",
|
|
3226
|
+
style: Be(e.emptyBlockStyle),
|
|
3227
|
+
class: U(e.ns.e("empty-block"))
|
|
3228
|
+
},
|
|
3229
|
+
[
|
|
3230
|
+
se(
|
|
3231
|
+
"span",
|
|
3232
|
+
{
|
|
3233
|
+
class: U(e.ns.e("empty-text"))
|
|
3234
|
+
},
|
|
3235
|
+
[
|
|
3236
|
+
Fe(e.$slots, "empty", {}, () => [
|
|
3237
|
+
St(
|
|
3238
|
+
He(e.computedEmptyText),
|
|
3239
|
+
1
|
|
3240
|
+
)
|
|
3241
|
+
])
|
|
3242
|
+
],
|
|
3243
|
+
2
|
|
3244
|
+
)
|
|
3245
|
+
],
|
|
3246
|
+
6
|
|
3247
|
+
)) : Ee("v-if", !0),
|
|
3248
|
+
e.$slots.append ? (J(), fe(
|
|
3249
|
+
"div",
|
|
3250
|
+
{
|
|
3251
|
+
key: 1,
|
|
3252
|
+
ref: "appendWrapper",
|
|
3253
|
+
class: U(e.ns.e("append-wrapper"))
|
|
3254
|
+
},
|
|
3255
|
+
[
|
|
3256
|
+
Fe(e.$slots, "append")
|
|
3257
|
+
],
|
|
3258
|
+
2
|
|
3259
|
+
)) : Ee("v-if", !0)
|
|
3260
|
+
]),
|
|
3261
|
+
_: 3
|
|
3262
|
+
}, 8, ["view-style", "wrap-style", "always", "tabindex", "native"])
|
|
3263
|
+
],
|
|
3264
|
+
2
|
|
3265
|
+
),
|
|
3266
|
+
e.showSummary && e.tableLayout === "fixed" ? st((J(), fe(
|
|
3267
|
+
"div",
|
|
3268
|
+
{
|
|
3269
|
+
key: 1,
|
|
3270
|
+
ref: "footerWrapper",
|
|
3271
|
+
class: U(e.ns.e("footer-wrapper"))
|
|
3272
|
+
},
|
|
3273
|
+
[
|
|
3274
|
+
se(
|
|
3275
|
+
"table",
|
|
3276
|
+
{
|
|
3277
|
+
class: U(e.ns.e("footer")),
|
|
3278
|
+
cellspacing: "0",
|
|
3279
|
+
cellpadding: "0",
|
|
3280
|
+
border: "0",
|
|
3281
|
+
style: Be(e.tableBodyStyles)
|
|
3282
|
+
},
|
|
3283
|
+
[
|
|
3284
|
+
ge(f, {
|
|
3285
|
+
columns: e.store.states.columns.value,
|
|
3286
|
+
"table-layout": e.tableLayout
|
|
3287
|
+
}, null, 8, ["columns", "table-layout"]),
|
|
3288
|
+
ge(a, {
|
|
3289
|
+
border: e.border,
|
|
3290
|
+
"default-sort": e.defaultSort,
|
|
3291
|
+
store: e.store,
|
|
3292
|
+
"sum-text": e.computedSumText,
|
|
3293
|
+
"summary-method": e.summaryMethod
|
|
3294
|
+
}, null, 8, ["border", "default-sort", "store", "sum-text", "summary-method"])
|
|
3295
|
+
],
|
|
3296
|
+
6
|
|
3297
|
+
)
|
|
3298
|
+
],
|
|
3299
|
+
2
|
|
3300
|
+
)), [
|
|
3301
|
+
[At, !e.isEmpty],
|
|
3302
|
+
[d, e.handleHeaderFooterMousewheel]
|
|
3303
|
+
]) : Ee("v-if", !0),
|
|
3304
|
+
e.border || e.isGroup ? (J(), fe(
|
|
3305
|
+
"div",
|
|
3306
|
+
{
|
|
3307
|
+
key: 2,
|
|
3308
|
+
class: U(e.ns.e("border-left-patch"))
|
|
3309
|
+
},
|
|
3310
|
+
null,
|
|
3311
|
+
2
|
|
3312
|
+
)) : Ee("v-if", !0)
|
|
3313
|
+
],
|
|
3314
|
+
2
|
|
3315
|
+
),
|
|
3316
|
+
st(se(
|
|
3317
|
+
"div",
|
|
3318
|
+
{
|
|
3319
|
+
ref: "resizeProxy",
|
|
3320
|
+
class: U(e.ns.e("column-resize-proxy"))
|
|
3321
|
+
},
|
|
3322
|
+
null,
|
|
3323
|
+
2
|
|
3324
|
+
), [
|
|
3325
|
+
[At, e.resizeProxyVisible]
|
|
3326
|
+
])
|
|
3327
|
+
], 46, so);
|
|
3328
|
+
}
|
|
3329
|
+
var co = /* @__PURE__ */ Rt(ro, [["render", uo], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/table/src/table.vue"]]);
|
|
3330
|
+
const fo = {
|
|
3331
|
+
selection: "table-column--selection",
|
|
3332
|
+
expand: "table__expand-column"
|
|
3333
|
+
}, ho = {
|
|
3334
|
+
default: {
|
|
3335
|
+
order: ""
|
|
3336
|
+
},
|
|
3337
|
+
selection: {
|
|
3338
|
+
width: 48,
|
|
3339
|
+
minWidth: 48,
|
|
3340
|
+
realWidth: 48,
|
|
3341
|
+
order: ""
|
|
3342
|
+
},
|
|
3343
|
+
expand: {
|
|
3344
|
+
width: 48,
|
|
3345
|
+
minWidth: 48,
|
|
3346
|
+
realWidth: 48,
|
|
3347
|
+
order: ""
|
|
3348
|
+
},
|
|
3349
|
+
index: {
|
|
3350
|
+
width: 48,
|
|
3351
|
+
minWidth: 48,
|
|
3352
|
+
realWidth: 48,
|
|
3353
|
+
order: ""
|
|
3354
|
+
}
|
|
3355
|
+
}, vo = (e) => fo[e] || "", po = {
|
|
3356
|
+
selection: {
|
|
3357
|
+
renderHeader({ store: e }) {
|
|
3358
|
+
var t;
|
|
3359
|
+
function n() {
|
|
3360
|
+
return e.states.data.value && e.states.data.value.length === 0;
|
|
3361
|
+
}
|
|
3362
|
+
return P(Ve, {
|
|
3363
|
+
disabled: n(),
|
|
3364
|
+
size: e.states.tableSize.value,
|
|
3365
|
+
indeterminate: e.states.selection.value.length > 0 && !e.states.isAllSelected.value,
|
|
3366
|
+
"onUpdate:modelValue": (t = e.toggleAllSelection) != null ? t : void 0,
|
|
3367
|
+
modelValue: e.states.isAllSelected.value,
|
|
3368
|
+
ariaLabel: e.t("el.table.selectAllLabel")
|
|
3369
|
+
});
|
|
3370
|
+
},
|
|
3371
|
+
renderCell({
|
|
3372
|
+
row: e,
|
|
3373
|
+
column: t,
|
|
3374
|
+
store: n,
|
|
3375
|
+
$index: l
|
|
3376
|
+
}) {
|
|
3377
|
+
return P(Ve, {
|
|
3378
|
+
disabled: t.selectable ? !t.selectable.call(null, e, l) : !1,
|
|
3379
|
+
size: n.states.tableSize.value,
|
|
3380
|
+
onChange: () => {
|
|
3381
|
+
n.commit("rowSelectedChanged", e);
|
|
3382
|
+
},
|
|
3383
|
+
onClick: (r) => r.stopPropagation(),
|
|
3384
|
+
modelValue: n.isSelected(e),
|
|
3385
|
+
ariaLabel: n.t("el.table.selectRowLabel")
|
|
3386
|
+
});
|
|
3387
|
+
},
|
|
3388
|
+
sortable: !1,
|
|
3389
|
+
resizable: !1
|
|
3390
|
+
},
|
|
3391
|
+
index: {
|
|
3392
|
+
renderHeader({
|
|
3393
|
+
column: e
|
|
3394
|
+
}) {
|
|
3395
|
+
return e.label || "#";
|
|
3396
|
+
},
|
|
3397
|
+
renderCell({
|
|
3398
|
+
column: e,
|
|
3399
|
+
$index: t
|
|
3400
|
+
}) {
|
|
3401
|
+
let n = t + 1;
|
|
3402
|
+
const l = e.index;
|
|
3403
|
+
return Ae(l) ? n = t + l : he(l) && (n = l(t)), P("div", {}, [n]);
|
|
3404
|
+
},
|
|
3405
|
+
sortable: !1
|
|
3406
|
+
},
|
|
3407
|
+
expand: {
|
|
3408
|
+
renderHeader({
|
|
3409
|
+
column: e
|
|
3410
|
+
}) {
|
|
3411
|
+
return e.label || "";
|
|
3412
|
+
},
|
|
3413
|
+
renderCell({
|
|
3414
|
+
column: e,
|
|
3415
|
+
row: t,
|
|
3416
|
+
store: n,
|
|
3417
|
+
expanded: l
|
|
3418
|
+
}) {
|
|
3419
|
+
const { ns: r } = n, i = [r.e("expand-icon")];
|
|
3420
|
+
!e.renderExpand && l && i.push(r.em("expand-icon", "expanded"));
|
|
3421
|
+
const f = function(o) {
|
|
3422
|
+
o.stopPropagation(), n.toggleRowExpansion(t);
|
|
3423
|
+
};
|
|
3424
|
+
return P(
|
|
3425
|
+
"button",
|
|
3426
|
+
{
|
|
3427
|
+
type: "button",
|
|
3428
|
+
"aria-label": n.t(
|
|
3429
|
+
l ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"
|
|
3430
|
+
),
|
|
3431
|
+
"aria-expanded": l,
|
|
3432
|
+
class: i,
|
|
3433
|
+
onClick: f
|
|
3434
|
+
},
|
|
3435
|
+
{
|
|
3436
|
+
default: () => e.renderExpand ? [
|
|
3437
|
+
e.renderExpand({
|
|
3438
|
+
expanded: l
|
|
3439
|
+
})
|
|
3440
|
+
] : [
|
|
3441
|
+
P(Nt, null, {
|
|
3442
|
+
default: () => [P(nl)]
|
|
3443
|
+
})
|
|
3444
|
+
]
|
|
3445
|
+
}
|
|
3446
|
+
);
|
|
3447
|
+
},
|
|
3448
|
+
sortable: !1,
|
|
3449
|
+
resizable: !1
|
|
3450
|
+
}
|
|
3451
|
+
};
|
|
3452
|
+
function mo({
|
|
3453
|
+
row: e,
|
|
3454
|
+
column: t,
|
|
3455
|
+
$index: n
|
|
3456
|
+
}) {
|
|
3457
|
+
var l;
|
|
3458
|
+
const r = t.property, i = r && ol(e, r).value;
|
|
3459
|
+
return t && t.formatter ? t.formatter(e, t, i, n) : ((l = i?.toString) == null ? void 0 : l.call(i)) || "";
|
|
3460
|
+
}
|
|
3461
|
+
function go({
|
|
3462
|
+
row: e,
|
|
3463
|
+
treeNode: t,
|
|
3464
|
+
store: n
|
|
3465
|
+
}, l = !1) {
|
|
3466
|
+
const { ns: r } = n;
|
|
3467
|
+
if (!t)
|
|
3468
|
+
return l ? [
|
|
3469
|
+
P("span", {
|
|
3470
|
+
class: r.e("placeholder")
|
|
3471
|
+
})
|
|
3472
|
+
] : null;
|
|
3473
|
+
const i = [], f = function(o) {
|
|
3474
|
+
o.stopPropagation(), !t.loading && n.loadOrToggle(e);
|
|
3475
|
+
};
|
|
3476
|
+
if (t.indent && i.push(
|
|
3477
|
+
P("span", {
|
|
3478
|
+
class: r.e("indent"),
|
|
3479
|
+
style: { "padding-left": `${t.indent}px` }
|
|
3480
|
+
})
|
|
3481
|
+
), Le(t.expanded) && !t.noLazyChildren) {
|
|
3482
|
+
const o = [
|
|
3483
|
+
r.e("expand-icon"),
|
|
3484
|
+
t.expanded ? r.em("expand-icon", "expanded") : ""
|
|
3485
|
+
];
|
|
3486
|
+
let s = nl;
|
|
3487
|
+
t.loading && (s = en), i.push(
|
|
3488
|
+
P(
|
|
3489
|
+
"button",
|
|
3490
|
+
{
|
|
3491
|
+
type: "button",
|
|
3492
|
+
"aria-label": n.t(
|
|
3493
|
+
t.expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"
|
|
3494
|
+
),
|
|
3495
|
+
"aria-expanded": t.expanded,
|
|
3496
|
+
class: o,
|
|
3497
|
+
onClick: f
|
|
3498
|
+
},
|
|
3499
|
+
{
|
|
3500
|
+
default: () => [
|
|
3501
|
+
P(
|
|
3502
|
+
Nt,
|
|
3503
|
+
{ class: r.is("loading", t.loading) },
|
|
3504
|
+
{
|
|
3505
|
+
default: () => [P(s)]
|
|
3506
|
+
}
|
|
3507
|
+
)
|
|
3508
|
+
]
|
|
3509
|
+
}
|
|
3510
|
+
)
|
|
3511
|
+
);
|
|
3512
|
+
} else
|
|
3513
|
+
i.push(
|
|
3514
|
+
P("span", {
|
|
3515
|
+
class: r.e("placeholder")
|
|
3516
|
+
})
|
|
3517
|
+
);
|
|
3518
|
+
return i;
|
|
3519
|
+
}
|
|
3520
|
+
function Yt(e, t) {
|
|
3521
|
+
return e.reduce((n, l) => (n[l] = l, n), t);
|
|
3522
|
+
}
|
|
3523
|
+
function yo(e, t) {
|
|
3524
|
+
const n = ue();
|
|
3525
|
+
return {
|
|
3526
|
+
registerComplexWatchers: () => {
|
|
3527
|
+
const i = ["fixed"], f = {
|
|
3528
|
+
realWidth: "width",
|
|
3529
|
+
realMinWidth: "minWidth"
|
|
3530
|
+
}, o = Yt(i, f);
|
|
3531
|
+
Object.keys(o).forEach((s) => {
|
|
3532
|
+
const a = f[s];
|
|
3533
|
+
Me(t, a) && ie(
|
|
3534
|
+
() => t[a],
|
|
3535
|
+
(u) => {
|
|
3536
|
+
let d = u;
|
|
3537
|
+
a === "width" && s === "realWidth" && (d = Lt(u)), a === "minWidth" && s === "realMinWidth" && (d = rl(u)), n.columnConfig.value[a] = d, n.columnConfig.value[s] = d;
|
|
3538
|
+
const m = a === "fixed";
|
|
3539
|
+
e.value.store.scheduleLayout(m);
|
|
3540
|
+
}
|
|
3541
|
+
);
|
|
3542
|
+
});
|
|
3543
|
+
},
|
|
3544
|
+
registerNormalWatchers: () => {
|
|
3545
|
+
const i = [
|
|
3546
|
+
"label",
|
|
3547
|
+
"filters",
|
|
3548
|
+
"filterMultiple",
|
|
3549
|
+
"filteredValue",
|
|
3550
|
+
"sortable",
|
|
3551
|
+
"index",
|
|
3552
|
+
"formatter",
|
|
3553
|
+
"className",
|
|
3554
|
+
"labelClassName",
|
|
3555
|
+
"filterClassName",
|
|
3556
|
+
"showOverflowTooltip",
|
|
3557
|
+
"tooltipFormatter",
|
|
3558
|
+
"resizable"
|
|
3559
|
+
], f = ["showOverflowTooltip"], o = {
|
|
3560
|
+
property: "prop",
|
|
3561
|
+
align: "realAlign",
|
|
3562
|
+
headerAlign: "realHeaderAlign"
|
|
3563
|
+
}, s = Yt(i, o);
|
|
3564
|
+
Object.keys(s).forEach((a) => {
|
|
3565
|
+
const u = o[a];
|
|
3566
|
+
Me(t, u) && ie(
|
|
3567
|
+
() => t[u],
|
|
3568
|
+
(d) => {
|
|
3569
|
+
n.columnConfig.value[a] = d, (a === "filters" || a === "filterMethod") && (n.columnConfig.value.filterable = !!(n.columnConfig.value.filters || n.columnConfig.value.filterMethod));
|
|
3570
|
+
}
|
|
3571
|
+
);
|
|
3572
|
+
}), f.forEach((a) => {
|
|
3573
|
+
Me(e.value.props, a) && ie(
|
|
3574
|
+
() => e.value.props[a],
|
|
3575
|
+
(u) => {
|
|
3576
|
+
n.columnConfig.value[a] = u;
|
|
3577
|
+
}
|
|
3578
|
+
);
|
|
3579
|
+
});
|
|
3580
|
+
}
|
|
3581
|
+
};
|
|
3582
|
+
}
|
|
3583
|
+
function bo(e, t, n) {
|
|
3584
|
+
const l = ue(), r = E(""), i = E(!1), f = E(), o = E(), s = ye("table");
|
|
3585
|
+
ct(() => {
|
|
3586
|
+
f.value = e.align ? `is-${e.align}` : null, f.value;
|
|
3587
|
+
}), ct(() => {
|
|
3588
|
+
o.value = e.headerAlign ? `is-${e.headerAlign}` : f.value, o.value;
|
|
3589
|
+
});
|
|
3590
|
+
const a = D(() => {
|
|
3591
|
+
let c = l.vnode.vParent || l.parent;
|
|
3592
|
+
for (; c && !c.tableId && !c.columnId; )
|
|
3593
|
+
c = c.vnode.vParent || c.parent;
|
|
3594
|
+
return c;
|
|
3595
|
+
}), u = D(() => {
|
|
3596
|
+
const { store: c } = l.parent;
|
|
3597
|
+
if (!c)
|
|
3598
|
+
return !1;
|
|
3599
|
+
const { treeData: v } = c.states, w = v.value;
|
|
3600
|
+
return w && Object.keys(w).length > 0;
|
|
3601
|
+
}), d = E(Lt(e.width)), m = E(rl(e.minWidth)), h = (c) => (d.value && (c.width = d.value), m.value && (c.minWidth = m.value), !d.value && m.value && (c.width = void 0), c.minWidth || (c.minWidth = 80), c.realWidth = Number(
|
|
3602
|
+
xe(c.width) ? c.minWidth : c.width
|
|
3603
|
+
), c), p = (c) => {
|
|
3604
|
+
const v = c.type, w = po[v] || {};
|
|
3605
|
+
Object.keys(w).forEach((y) => {
|
|
3606
|
+
const x = w[y];
|
|
3607
|
+
y !== "className" && !xe(x) && (c[y] = x);
|
|
3608
|
+
});
|
|
3609
|
+
const g = vo(v);
|
|
3610
|
+
if (g) {
|
|
3611
|
+
const y = `${ae(s.namespace)}-${g}`;
|
|
3612
|
+
c.className = c.className ? `${c.className} ${y}` : y;
|
|
3613
|
+
}
|
|
3614
|
+
return c;
|
|
3615
|
+
}, b = (c) => {
|
|
3616
|
+
de(c) ? c.forEach((w) => v(w)) : v(c);
|
|
3617
|
+
function v(w) {
|
|
3618
|
+
var g;
|
|
3619
|
+
((g = w?.type) == null ? void 0 : g.name) === "ElTableColumn" && (w.vParent = l);
|
|
3620
|
+
}
|
|
3621
|
+
};
|
|
3622
|
+
return {
|
|
3623
|
+
columnId: r,
|
|
3624
|
+
realAlign: f,
|
|
3625
|
+
isSubColumn: i,
|
|
3626
|
+
realHeaderAlign: o,
|
|
3627
|
+
columnOrTableParent: a,
|
|
3628
|
+
setColumnWidth: h,
|
|
3629
|
+
setColumnForcedProps: p,
|
|
3630
|
+
setColumnRenders: (c) => {
|
|
3631
|
+
e.renderHeader ? tn(
|
|
3632
|
+
"TableColumn",
|
|
3633
|
+
"Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."
|
|
3634
|
+
) : c.type !== "selection" && (c.renderHeader = (w) => {
|
|
3635
|
+
if (l.columnConfig.value.label, t.header) {
|
|
3636
|
+
const g = t.header(w);
|
|
3637
|
+
if (ul(g))
|
|
3638
|
+
return P(Ie, g);
|
|
3639
|
+
}
|
|
3640
|
+
return St(c.label);
|
|
3641
|
+
}), t["filter-icon"] && (c.renderFilterIcon = (w) => Fe(t, "filter-icon", w)), t.expand && (c.renderExpand = (w) => Fe(t, "expand", w));
|
|
3642
|
+
let v = c.renderCell;
|
|
3643
|
+
return c.type === "expand" ? (c.renderCell = (w) => P(
|
|
3644
|
+
"div",
|
|
3645
|
+
{
|
|
3646
|
+
class: "cell"
|
|
3647
|
+
},
|
|
3648
|
+
[v(w)]
|
|
3649
|
+
), n.value.renderExpanded = (w) => t.default ? t.default(w) : t.default) : (v = v || mo, c.renderCell = (w) => {
|
|
3650
|
+
let g = null;
|
|
3651
|
+
if (t.default) {
|
|
3652
|
+
const $ = t.default(w);
|
|
3653
|
+
g = $.some((M) => M.type !== Gt) ? $ : v(w);
|
|
3654
|
+
} else
|
|
3655
|
+
g = v(w);
|
|
3656
|
+
const { columns: y } = n.value.store.states, x = y.value.findIndex(
|
|
3657
|
+
($) => $.type === "default"
|
|
3658
|
+
), R = u.value && w.cellIndex === x, H = go(w, R), k = {
|
|
3659
|
+
class: "cell",
|
|
3660
|
+
style: {}
|
|
3661
|
+
};
|
|
3662
|
+
return c.showOverflowTooltip && (k.class = `${k.class} ${ae(s.namespace)}-tooltip`, k.style = {
|
|
3663
|
+
width: `${(w.column.realWidth || Number(w.column.width)) - 1}px`
|
|
3664
|
+
}), b(g), P("div", k, [H, g]);
|
|
3665
|
+
}), c;
|
|
3666
|
+
},
|
|
3667
|
+
getPropsData: (...c) => c.reduce(
|
|
3668
|
+
(v, w) => (de(w) && w.forEach((g) => {
|
|
3669
|
+
v[g] = e[g];
|
|
3670
|
+
}), v),
|
|
3671
|
+
{}
|
|
3672
|
+
),
|
|
3673
|
+
getColumnElIndex: (c, v) => Array.prototype.indexOf.call(c, v),
|
|
3674
|
+
updateColumnOrder: () => {
|
|
3675
|
+
n.value.store.commit("updateColumnOrder", l.columnConfig.value);
|
|
3676
|
+
}
|
|
3677
|
+
};
|
|
3678
|
+
}
|
|
3679
|
+
var Co = {
|
|
3680
|
+
type: {
|
|
3681
|
+
type: String,
|
|
3682
|
+
default: "default"
|
|
3683
|
+
},
|
|
3684
|
+
label: String,
|
|
3685
|
+
className: String,
|
|
3686
|
+
labelClassName: String,
|
|
3687
|
+
property: String,
|
|
3688
|
+
prop: String,
|
|
3689
|
+
width: {
|
|
3690
|
+
type: [String, Number],
|
|
3691
|
+
default: ""
|
|
3692
|
+
},
|
|
3693
|
+
minWidth: {
|
|
3694
|
+
type: [String, Number],
|
|
3695
|
+
default: ""
|
|
3696
|
+
},
|
|
3697
|
+
renderHeader: Function,
|
|
3698
|
+
sortable: {
|
|
3699
|
+
type: [Boolean, String],
|
|
3700
|
+
default: !1
|
|
3701
|
+
},
|
|
3702
|
+
sortMethod: Function,
|
|
3703
|
+
sortBy: [String, Function, Array],
|
|
3704
|
+
resizable: {
|
|
3705
|
+
type: Boolean,
|
|
3706
|
+
default: !0
|
|
3707
|
+
},
|
|
3708
|
+
columnKey: String,
|
|
3709
|
+
align: String,
|
|
3710
|
+
headerAlign: String,
|
|
3711
|
+
showOverflowTooltip: {
|
|
3712
|
+
type: [Boolean, Object],
|
|
3713
|
+
default: void 0
|
|
3714
|
+
},
|
|
3715
|
+
tooltipFormatter: Function,
|
|
3716
|
+
fixed: [Boolean, String],
|
|
3717
|
+
formatter: Function,
|
|
3718
|
+
selectable: Function,
|
|
3719
|
+
reserveSelection: Boolean,
|
|
3720
|
+
filterMethod: Function,
|
|
3721
|
+
filteredValue: Array,
|
|
3722
|
+
filters: Array,
|
|
3723
|
+
filterPlacement: String,
|
|
3724
|
+
filterMultiple: {
|
|
3725
|
+
type: Boolean,
|
|
3726
|
+
default: !0
|
|
3727
|
+
},
|
|
3728
|
+
filterClassName: String,
|
|
3729
|
+
index: [Number, Function],
|
|
3730
|
+
sortOrders: {
|
|
3731
|
+
type: Array,
|
|
3732
|
+
default: () => ["ascending", "descending", null],
|
|
3733
|
+
validator: (e) => e.every(
|
|
3734
|
+
(t) => ["ascending", "descending", null].includes(t)
|
|
3735
|
+
)
|
|
3736
|
+
}
|
|
3737
|
+
};
|
|
3738
|
+
let wo = 1;
|
|
3739
|
+
var xl = Oe({
|
|
3740
|
+
name: "ElTableColumn",
|
|
3741
|
+
components: {
|
|
3742
|
+
ElCheckbox: Ve
|
|
3743
|
+
},
|
|
3744
|
+
props: Co,
|
|
3745
|
+
setup(e, { slots: t }) {
|
|
3746
|
+
const n = ue(), l = E({}), r = D(() => {
|
|
3747
|
+
let S = n.parent;
|
|
3748
|
+
for (; S && !S.tableId; )
|
|
3749
|
+
S = S.parent;
|
|
3750
|
+
return S;
|
|
3751
|
+
}), { registerNormalWatchers: i, registerComplexWatchers: f } = yo(
|
|
3752
|
+
r,
|
|
3753
|
+
e
|
|
3754
|
+
), {
|
|
3755
|
+
columnId: o,
|
|
3756
|
+
isSubColumn: s,
|
|
3757
|
+
realHeaderAlign: a,
|
|
3758
|
+
columnOrTableParent: u,
|
|
3759
|
+
setColumnWidth: d,
|
|
3760
|
+
setColumnForcedProps: m,
|
|
3761
|
+
setColumnRenders: h,
|
|
3762
|
+
getPropsData: p,
|
|
3763
|
+
getColumnElIndex: b,
|
|
3764
|
+
realAlign: C,
|
|
3765
|
+
updateColumnOrder: O
|
|
3766
|
+
} = bo(e, t, r), N = u.value;
|
|
3767
|
+
o.value = `${"tableId" in N && N.tableId || "columnId" in N && N.columnId}_column_${wo++}`, Qt(() => {
|
|
3768
|
+
s.value = r.value !== N;
|
|
3769
|
+
const S = e.type || "default", c = e.sortable === "" ? !0 : e.sortable, v = S === "selection" ? !1 : xe(e.showOverflowTooltip) ? N.props.showOverflowTooltip : e.showOverflowTooltip, w = xe(e.tooltipFormatter) ? N.props.tooltipFormatter : e.tooltipFormatter, g = {
|
|
3770
|
+
...ho[S],
|
|
3771
|
+
id: o.value,
|
|
3772
|
+
type: S,
|
|
3773
|
+
property: e.prop || e.property,
|
|
3774
|
+
align: C,
|
|
3775
|
+
headerAlign: a,
|
|
3776
|
+
showOverflowTooltip: v,
|
|
3777
|
+
tooltipFormatter: w,
|
|
3778
|
+
filterable: e.filters || e.filterMethod,
|
|
3779
|
+
filteredValue: [],
|
|
3780
|
+
filterPlacement: "",
|
|
3781
|
+
filterClassName: "",
|
|
3782
|
+
isColumnGroup: !1,
|
|
3783
|
+
isSubColumn: !1,
|
|
3784
|
+
filterOpened: !1,
|
|
3785
|
+
sortable: c,
|
|
3786
|
+
index: e.index,
|
|
3787
|
+
rawColumnKey: n.vnode.key
|
|
3788
|
+
};
|
|
3789
|
+
let k = p([
|
|
3790
|
+
"columnKey",
|
|
3791
|
+
"label",
|
|
3792
|
+
"className",
|
|
3793
|
+
"labelClassName",
|
|
3794
|
+
"type",
|
|
3795
|
+
"renderHeader",
|
|
3796
|
+
"formatter",
|
|
3797
|
+
"fixed",
|
|
3798
|
+
"resizable"
|
|
3799
|
+
], ["sortMethod", "sortBy", "sortOrders"], ["selectable", "reserveSelection"], [
|
|
3800
|
+
"filterMethod",
|
|
3801
|
+
"filters",
|
|
3802
|
+
"filterMultiple",
|
|
3803
|
+
"filterOpened",
|
|
3804
|
+
"filteredValue",
|
|
3805
|
+
"filterPlacement",
|
|
3806
|
+
"filterClassName"
|
|
3807
|
+
]);
|
|
3808
|
+
k = dn(g, k), k = fn(
|
|
3809
|
+
h,
|
|
3810
|
+
d,
|
|
3811
|
+
m
|
|
3812
|
+
)(k), l.value = k, i(), f();
|
|
3813
|
+
}), je(() => {
|
|
3814
|
+
var S, c;
|
|
3815
|
+
const v = u.value, w = s.value ? (S = v.vnode.el) == null ? void 0 : S.children : (c = v.refs.hiddenColumns) == null ? void 0 : c.children, g = () => b(w || [], n.vnode.el);
|
|
3816
|
+
l.value.getColumnIndex = g, g() > -1 && r.value.store.commit(
|
|
3817
|
+
"insertColumn",
|
|
3818
|
+
l.value,
|
|
3819
|
+
s.value ? "columnConfig" in v && v.columnConfig.value : null,
|
|
3820
|
+
O
|
|
3821
|
+
);
|
|
3822
|
+
}), Et(() => {
|
|
3823
|
+
const S = l.value.getColumnIndex;
|
|
3824
|
+
(S ? S() : -1) > -1 && r.value.store.commit(
|
|
3825
|
+
"removeColumn",
|
|
3826
|
+
l.value,
|
|
3827
|
+
s.value ? "columnConfig" in N && N.columnConfig.value : null,
|
|
3828
|
+
O
|
|
3829
|
+
);
|
|
3830
|
+
}), n.columnId = o.value, n.columnConfig = l;
|
|
3831
|
+
},
|
|
3832
|
+
render() {
|
|
3833
|
+
var e, t, n;
|
|
3834
|
+
try {
|
|
3835
|
+
const l = (t = (e = this.$slots).default) == null ? void 0 : t.call(e, {
|
|
3836
|
+
row: {},
|
|
3837
|
+
column: {},
|
|
3838
|
+
$index: -1
|
|
3839
|
+
}), r = [];
|
|
3840
|
+
if (de(l))
|
|
3841
|
+
for (const f of l)
|
|
3842
|
+
((n = f.type) == null ? void 0 : n.name) === "ElTableColumn" || f.shapeFlag & 2 ? r.push(f) : f.type === Ie && de(f.children) && f.children.forEach((o) => {
|
|
3843
|
+
o?.patchFlag !== 1024 && !ve(o?.children) && r.push(o);
|
|
3844
|
+
});
|
|
3845
|
+
return P("div", r);
|
|
3846
|
+
} catch {
|
|
3847
|
+
return P("div", []);
|
|
3848
|
+
}
|
|
3849
|
+
}
|
|
3850
|
+
});
|
|
3851
|
+
const Ao = ln(co, {
|
|
3852
|
+
TableColumn: xl
|
|
3853
|
+
}), $o = nn(xl), ee = [];
|
|
3854
|
+
for (let e = 0; e < 256; ++e)
|
|
3855
|
+
ee.push((e + 256).toString(16).slice(1));
|
|
3856
|
+
function So(e, t = 0) {
|
|
3857
|
+
return (ee[e[t + 0]] + ee[e[t + 1]] + ee[e[t + 2]] + ee[e[t + 3]] + "-" + ee[e[t + 4]] + ee[e[t + 5]] + "-" + ee[e[t + 6]] + ee[e[t + 7]] + "-" + ee[e[t + 8]] + ee[e[t + 9]] + "-" + ee[e[t + 10]] + ee[e[t + 11]] + ee[e[t + 12]] + ee[e[t + 13]] + ee[e[t + 14]] + ee[e[t + 15]]).toLowerCase();
|
|
3858
|
+
}
|
|
3859
|
+
let dt;
|
|
3860
|
+
const xo = new Uint8Array(16);
|
|
3861
|
+
function Eo() {
|
|
3862
|
+
if (!dt) {
|
|
3863
|
+
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
3864
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
3865
|
+
dt = crypto.getRandomValues.bind(crypto);
|
|
3866
|
+
}
|
|
3867
|
+
return dt(xo);
|
|
3868
|
+
}
|
|
3869
|
+
const Ro = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), qt = { randomUUID: Ro };
|
|
3870
|
+
function Po(e, t, n) {
|
|
3871
|
+
if (qt.randomUUID && !e)
|
|
3872
|
+
return qt.randomUUID();
|
|
3873
|
+
e = e || {};
|
|
3874
|
+
const l = e.random ?? e.rng?.() ?? Eo();
|
|
3875
|
+
if (l.length < 16)
|
|
3876
|
+
throw new Error("Random bytes length must be >= 16");
|
|
3877
|
+
return l[6] = l[6] & 15 | 64, l[8] = l[8] & 63 | 128, So(l);
|
|
3878
|
+
}
|
|
3879
|
+
function Ko(e) {
|
|
3880
|
+
return rn({
|
|
3881
|
+
url: "/api/command/list",
|
|
3882
|
+
method: "get",
|
|
3883
|
+
params: e
|
|
3884
|
+
});
|
|
3885
|
+
}
|
|
3886
|
+
export {
|
|
3887
|
+
Ao as E,
|
|
3888
|
+
$o as a,
|
|
3889
|
+
Ko as c,
|
|
3890
|
+
Po as v
|
|
3891
|
+
};
|