st-comp 0.0.85 → 0.0.87

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