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