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