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