st-comp 0.0.201 → 0.0.203

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