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