jmash-core 0.0.9 → 0.0.11

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