st-comp 0.0.279 → 0.0.281
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ChartLayout.cjs +1 -1
- package/es/ChartLayout.js +13 -14
- package/es/CustomFunction.cjs +2 -2
- package/es/CustomFunction.js +377 -376
- package/es/FactorWarning.cjs +1 -1
- package/es/FactorWarning.js +294 -294
- package/es/Kline.cjs +1 -1
- package/es/Kline.js +19 -19
- package/es/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +260 -260
- package/es/KlineConfig.cjs +1 -1
- package/es/KlineConfig.js +579 -553
- package/es/KlineNew.cjs +1 -1
- package/es/KlineNew.js +17 -17
- package/es/KlinePlus.cjs +2 -2
- package/es/KlinePlus.js +23 -24
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +30 -29
- package/es/Pagination.cjs +1 -1
- package/es/Pagination.js +517 -425
- package/es/PasswordPrompt.cjs +1 -1
- package/es/PasswordPrompt.js +3 -3
- package/es/Table.cjs +1 -1
- package/es/Table.js +43 -43
- package/es/User.cjs +1 -1
- package/es/User.js +898 -866
- package/es/VarSelectDialog.cjs +3 -3
- package/es/VarSelectDialog.js +110 -109
- package/es/VarietyAiHelper.cjs +7 -7
- package/es/VarietyAiHelper.js +615 -464
- package/es/VarietyAutoComplete.cjs +1 -1
- package/es/VarietyAutoComplete.js +11 -11
- package/es/VarietySearch.cjs +18 -18
- package/es/VarietySearch.js +3079 -2913
- package/es/{VarietySelect-41daac7b.js → VarietySelect-3fc0f0ce.js} +5 -5
- package/es/{VarietySelect-d58eee29.cjs → VarietySelect-d2d25a3d.cjs} +1 -1
- package/es/VarietyTextCopy.cjs +3 -3
- package/es/VarietyTextCopy.js +51 -51
- package/es/VirtualTable.cjs +13 -1
- package/es/VirtualTable.js +1927 -2259
- package/es/_baseClone-f8e5d3ba.cjs +1 -0
- package/es/_baseClone-fb6a3947.js +210 -0
- package/es/base-d987e5c9.cjs +5 -0
- package/es/base-dd156b8e.js +790 -0
- package/es/{castArray-7741a212.js → castArray-18eb6a41.js} +1 -1
- package/es/{castArray-35947698.cjs → castArray-d9ffe84a.cjs} +1 -1
- package/es/clamp-17c4d8aa.cjs +1 -0
- package/es/clamp-c7512966.js +10 -0
- package/es/config-provider-06d8207f.js +86 -0
- package/es/config-provider-bb61bd3e.cjs +1 -0
- package/es/debounce-0a98a9c6.js +57 -0
- package/es/debounce-37b17615.cjs +1 -0
- package/es/dropdown-8fa21bfd.cjs +1 -0
- package/es/dropdown-bcf8d198.js +178 -0
- package/es/el-autocomplete-13b9e372.cjs +1 -0
- package/es/el-autocomplete-419bfbcf.js +434 -0
- package/es/el-button-ee9fe159.js +343 -0
- package/es/el-button-fac5e058.cjs +1 -0
- package/es/el-checkbox-6cf1a71c.cjs +1 -0
- package/es/el-checkbox-b5ac7f04.js +566 -0
- package/es/el-dialog-060b3735.js +252 -0
- package/es/el-dialog-54aebacd.cjs +1 -0
- package/es/el-divider-3f0320be.cjs +1 -0
- package/es/el-divider-c5d72961.js +51 -0
- package/es/el-empty-552baf04.js +159 -0
- package/es/el-empty-58bc2a10.cjs +1 -0
- package/es/el-form-item-2be6b683.js +1265 -0
- package/es/el-form-item-758dfefa.cjs +12 -0
- package/es/el-input-7fe53030.cjs +1 -0
- package/es/el-input-d23f5442.js +761 -0
- package/es/el-input-number-484fb184.js +390 -0
- package/es/el-input-number-f0f4eedb.cjs +1 -0
- package/es/el-loading-9d3e405c.js +190 -0
- package/es/el-loading-fafaaa7b.cjs +1 -0
- package/es/el-menu-item-0ac22681.js +824 -0
- package/es/el-menu-item-c91ae430.cjs +1 -0
- package/es/el-message-box-568a0aa6.js +481 -0
- package/es/el-message-box-ceacb54e.cjs +1 -0
- package/es/el-overlay-9f36e73c.cjs +1 -0
- package/es/el-overlay-cb5c85aa.js +444 -0
- package/es/el-popconfirm-4a8cd35c.cjs +1 -0
- package/es/el-popconfirm-6f8e65c8.js +190 -0
- package/es/el-popper-0454c8e8.js +2235 -0
- package/es/el-popper-acd0ff35.cjs +1 -0
- package/es/{el-scrollbar-323542e7.js → el-scrollbar-0a42c1d0.js} +4 -9
- package/es/{el-scrollbar-bc3f790d.cjs → el-scrollbar-225c6c9e.cjs} +1 -1
- package/es/el-segmented-64dc7258.js +168 -0
- package/es/el-segmented-eb3c8e65.cjs +1 -0
- package/es/el-select-a573c78b.js +1535 -0
- package/es/el-select-c317294a.cjs +1 -0
- package/es/el-table-column-1c443963.js +3651 -0
- package/es/el-table-column-f555115d.cjs +14 -0
- package/es/el-tag-2d8a3fe7.js +77 -0
- package/es/el-tag-dca1292c.cjs +1 -0
- package/es/el-text-649c986a.cjs +1 -0
- package/es/el-text-761e6717.js +84 -0
- package/es/index-11181b5f.cjs +1 -0
- package/es/index-21a3dc89.cjs +1 -0
- package/es/index-33e039e3.cjs +1 -0
- package/es/index-3806160e.js +710 -0
- package/es/{index-a9246d17.cjs → index-4614e8e9.cjs} +109 -109
- package/es/{index-44a382a5.js → index-53beef02.js} +12 -12
- package/es/index-5cada1ed.cjs +1 -0
- package/es/index-6a36e1fc.cjs +1 -0
- package/es/{index-eb96e074.js → index-6a52dc7c.js} +235 -236
- package/es/index-71ba4c28.cjs +1 -0
- package/es/index-78dab605.js +141 -0
- package/es/index-798fec2d.cjs +1 -0
- package/es/index-9573f74b.js +372 -0
- package/es/index-a181f161.js +429 -0
- package/es/{index-a33b2fb8.js → index-ab0ad219.js} +5090 -5090
- package/es/index-beb5cb7d.cjs +1 -0
- package/es/index-c09fc6f5.js +131 -0
- package/es/index-ceae4c47.cjs +1 -0
- package/es/index-d372e68f.cjs +5 -0
- package/es/index-d9379af4.js +413 -0
- package/es/index-dddacf80.js +47 -0
- package/es/index-de9ad85c.js +12 -0
- package/es/index-e2e58ea9.js +468 -0
- package/es/index-f5474dcc.cjs +3 -0
- package/es/{python-a3db9620.cjs → python-60e79979.cjs} +1 -1
- package/es/{python-8a1664e6.js → python-673bf8b8.js} +32 -31
- package/es/{raf-8249652f.cjs → raf-735cc598.cjs} +1 -1
- package/es/{raf-80ef0c0a.js → raf-b4fd1e12.js} +1 -1
- package/es/scroll-07bade1e.cjs +1 -0
- package/es/scroll-70271cb1.js +35 -0
- package/es/style.css +1 -1
- package/es/toNumber-b47ceb68.cjs +1 -0
- package/es/toNumber-f077c66a.js +31 -0
- package/es/use-form-item-76516e50.cjs +2 -0
- package/es/use-form-item-784142b4.js +422 -0
- package/es/use-global-config-7ff9a1c2.cjs +1 -0
- package/es/use-global-config-9a4ccf33.js +71 -0
- package/es/validator-1926345b.cjs +1 -0
- package/es/{validator-c60a8956.js → validator-a66ec4f8.js} +1 -1
- package/es/vnode-6f7b84f0.cjs +1 -0
- package/es/vnode-8ee9bf4e.js +12 -0
- package/es/{zh-cn-b59a0910.js → zh-cn-51c2e528.js} +36 -33
- package/es/zh-cn-ad12d9f5.cjs +1 -0
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +265 -246
- package/lib/{index-62fa175a.js → index-7282d3be.js} +52335 -50156
- package/lib/{python-4a48fa39.js → python-418be57d.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/es/_initCloneObject-5e73c9c8.js +0 -81
- package/es/_initCloneObject-a5832933.cjs +0 -1
- package/es/base-a5af3db3.js +0 -288
- package/es/base-ef747d02.cjs +0 -5
- package/es/config-provider-06ea6b42.cjs +0 -1
- package/es/config-provider-88b637a8.js +0 -59
- package/es/dayjs.min-2c20abe6.cjs +0 -1
- package/es/dayjs.min-8313b006.js +0 -299
- package/es/debounce-62f5b6e8.cjs +0 -1
- package/es/debounce-8d53f4dd.js +0 -83
- package/es/dropdown-4ce4c3e2.cjs +0 -1
- package/es/dropdown-72fbc15d.js +0 -178
- package/es/el-autocomplete-6cafcdf1.js +0 -329
- package/es/el-autocomplete-e0857c5b.cjs +0 -1
- package/es/el-button-613e0bb2.cjs +0 -1
- package/es/el-button-94d3de38.js +0 -272
- package/es/el-checkbox-6d4cb393.js +0 -459
- package/es/el-checkbox-e90762df.cjs +0 -1
- package/es/el-dialog-02942e22.cjs +0 -1
- package/es/el-dialog-5e30161f.js +0 -276
- package/es/el-divider-4713d74c.cjs +0 -1
- package/es/el-divider-4e059794.js +0 -45
- package/es/el-empty-1697ded8.cjs +0 -1
- package/es/el-empty-33cb66f1.js +0 -183
- package/es/el-form-item-44f060d8.cjs +0 -12
- package/es/el-form-item-9e8969ea.js +0 -1269
- package/es/el-input-342b2def.js +0 -531
- package/es/el-input-9a9a7f7f.cjs +0 -1
- package/es/el-input-number-65c847d6.cjs +0 -1
- package/es/el-input-number-c22b803a.js +0 -311
- package/es/el-loading-8179b497.cjs +0 -1
- package/es/el-loading-bcc51e3d.js +0 -203
- package/es/el-menu-item-339baf6d.js +0 -768
- package/es/el-menu-item-83186444.cjs +0 -1
- package/es/el-message-box-035b699c.js +0 -489
- package/es/el-message-box-c62d3217.cjs +0 -1
- package/es/el-overlay-3e17604b.js +0 -324
- package/es/el-overlay-8f1da9e8.cjs +0 -1
- package/es/el-popconfirm-4e32ec1b.cjs +0 -1
- package/es/el-popconfirm-f8a86e2c.js +0 -162
- package/es/el-popper-a4f3ae4d.cjs +0 -1
- package/es/el-popper-fbd0dcea.js +0 -2094
- package/es/el-segmented-56bd58a8.js +0 -142
- package/es/el-segmented-833ac177.cjs +0 -1
- package/es/el-select-44fa547d.js +0 -1256
- package/es/el-select-70806166.cjs +0 -1
- package/es/el-table-column-3e2cdfca.cjs +0 -14
- package/es/el-table-column-b74a857d.js +0 -3432
- package/es/el-tag-66c83156.js +0 -117
- package/es/el-tag-9c2f329f.cjs +0 -1
- package/es/el-text-034bd3f4.js +0 -67
- package/es/el-text-6b2374bb.cjs +0 -1
- package/es/index-00f6ca75.cjs +0 -1
- package/es/index-185792a7.cjs +0 -1
- package/es/index-1e2a38ab.js +0 -113
- package/es/index-2e331d74.js +0 -10
- package/es/index-3153c1db.cjs +0 -1
- package/es/index-5216d5f5.js +0 -406
- package/es/index-5c0dd943.cjs +0 -1
- package/es/index-657047bb.js +0 -513
- package/es/index-870b6c9d.cjs +0 -1
- package/es/index-8c2d7e05.js +0 -368
- package/es/index-960806da.js +0 -314
- package/es/index-9780a537.cjs +0 -1
- package/es/index-9d16cea8.cjs +0 -1
- package/es/index-ac8dc53d.cjs +0 -1
- package/es/index-bb833443.cjs +0 -1
- package/es/index-c5f2d372.js +0 -326
- package/es/index-c6584658.js +0 -163
- package/es/index-d77a7336.js +0 -204
- package/es/index-eea0bcb3.cjs +0 -1
- package/es/index-f034b910.js +0 -60
- package/es/index-f1c702f6.cjs +0 -1
- package/es/index-f58b2920.cjs +0 -1
- package/es/scroll-679bd6bf.js +0 -35
- package/es/scroll-b108dabd.cjs +0 -1
- package/es/use-form-common-props-ac666630.cjs +0 -1
- package/es/use-form-common-props-ed72e914.js +0 -364
- package/es/use-global-config-23472471.cjs +0 -1
- package/es/use-global-config-ee406d58.js +0 -72
- package/es/validator-366dbf39.cjs +0 -1
- package/es/vnode-5ddb7ed1.js +0 -14
- package/es/vnode-b906ae6d.cjs +0 -1
- package/es/zh-cn-c21d12d8.cjs +0 -1
package/es/VirtualTable.js
CHANGED
|
@@ -1,101 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { E as
|
|
3
|
-
import {
|
|
4
|
-
import { E as
|
|
5
|
-
import {
|
|
6
|
-
import { getCurrentInstance as
|
|
7
|
-
import { d as
|
|
8
|
-
import { m as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { c as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { E as
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import "./
|
|
18
|
-
import "./
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
function io(e, t) {
|
|
28
|
-
if (e.length !== t.length)
|
|
29
|
-
return !1;
|
|
30
|
-
for (var l = 0; l < e.length; l++)
|
|
31
|
-
if (!so(e[l], t[l]))
|
|
32
|
-
return !1;
|
|
33
|
-
return !0;
|
|
34
|
-
}
|
|
35
|
-
function co(e, t) {
|
|
36
|
-
t === void 0 && (t = io);
|
|
37
|
-
var l = null;
|
|
38
|
-
function o() {
|
|
39
|
-
for (var a = [], r = 0; r < arguments.length; r++)
|
|
40
|
-
a[r] = arguments[r];
|
|
41
|
-
if (l && l.lastThis === this && t(a, l.lastArgs))
|
|
42
|
-
return l.lastResult;
|
|
43
|
-
var s = e.apply(this, a);
|
|
44
|
-
return l = {
|
|
45
|
-
lastResult: s,
|
|
46
|
-
lastArgs: a,
|
|
47
|
-
lastThis: this
|
|
48
|
-
}, s;
|
|
49
|
-
}
|
|
50
|
-
return o.clear = function() {
|
|
51
|
-
l = null;
|
|
52
|
-
}, o;
|
|
53
|
-
}
|
|
54
|
-
const uo = () => {
|
|
55
|
-
const t = nt().proxy.$props;
|
|
56
|
-
return E(() => {
|
|
57
|
-
const l = (o, a, r) => ({});
|
|
58
|
-
return t.perfMode ? eo(l) : co(l);
|
|
59
|
-
});
|
|
60
|
-
}, Wt = 50, Gt = "itemRendered", kt = "scroll", je = "forward", dt = "backward", He = "auto", al = "smart", ut = "start", Fe = "center", ht = "end", ft = "horizontal", sl = "vertical", il = "rtl", mt = "negative", cl = "positive-ascending", dl = "positive-descending", ho = {
|
|
61
|
-
[ft]: "left",
|
|
62
|
-
[sl]: "top"
|
|
63
|
-
}, fo = 20, vt = Oe({
|
|
64
|
-
type: I([Number, Function]),
|
|
1
|
+
import { E as In } from "./el-button-ee9fe159.js";
|
|
2
|
+
import { E as zn } from "./el-divider-c5d72961.js";
|
|
3
|
+
import { E as en } from "./el-empty-552baf04.js";
|
|
4
|
+
import { Z as Ie, c as A, b as ie, u as Oe, s as X, y as Nn, a as Nt, E as Dn, t as ot, B as $e, i as Pn, k as Ct, m as Ve, p as et, w as tn } from "./base-dd156b8e.js";
|
|
5
|
+
import { m as Fn, g as Wn, u as kn } from "./index-a181f161.js";
|
|
6
|
+
import { getCurrentInstance as st, computed as T, defineComponent as xe, ref as P, reactive as Vn, unref as l, watch as Se, onBeforeUnmount as nn, h as ge, withModifiers as Gn, onMounted as ct, nextTick as ve, resolveDynamicComponent as Dt, mergeProps as q, Fragment as Kn, shallowRef as We, isVNode as ze, toRef as Pt, inject as Ht, onUpdated as Bn, createVNode as E, provide as on, onActivated as jn, renderSlot as Ue, mergeModels as Ft, useModel as $n, onUnmounted as qn, openBlock as Je, createBlock as dt, withCtx as Pe, createElementBlock as Un, createTextVNode as Wt, createCommentVNode as kt } from "vue";
|
|
7
|
+
import { d as Yn } from "./debounce-0a98a9c6.js";
|
|
8
|
+
import { m as ln } from "./typescript-7ae59c4c.js";
|
|
9
|
+
import { b as ft, u as Xn } from "./use-form-item-784142b4.js";
|
|
10
|
+
import { g as Zn } from "./scroll-70271cb1.js";
|
|
11
|
+
import { c as lt, r as Mt } from "./raf-b4fd1e12.js";
|
|
12
|
+
import { B as Jn } from "./el-scrollbar-0a42c1d0.js";
|
|
13
|
+
import { c as Qn } from "./castArray-18eb6a41.js";
|
|
14
|
+
import { E as rn, h as eo, J as to, K as no } from "./index-6a52dc7c.js";
|
|
15
|
+
import { _ as oo } from "./_plugin-vue_export-helper-dad06003.js";
|
|
16
|
+
import "./index-de9ad85c.js";
|
|
17
|
+
import "./use-global-config-9a4ccf33.js";
|
|
18
|
+
import "./index-9573f74b.js";
|
|
19
|
+
import "./index-3806160e.js";
|
|
20
|
+
import "./toNumber-f077c66a.js";
|
|
21
|
+
const Vt = "itemRendered", Gt = "scroll", mt = "forward", lo = "backward", pe = "auto", gt = "start", ke = "center", ro = "horizontal", an = "vertical", yt = "negative", sn = "positive-ascending", cn = "positive-descending", ao = {
|
|
22
|
+
[ro]: "left",
|
|
23
|
+
[an]: "top"
|
|
24
|
+
}, bt = Ie({
|
|
25
|
+
type: A([Number, Function]),
|
|
65
26
|
required: !0
|
|
66
|
-
}),
|
|
67
|
-
type: Number
|
|
68
|
-
}), yt = Oe({
|
|
27
|
+
}), wt = Ie({ type: Number }), vt = Ie({
|
|
69
28
|
type: Number,
|
|
70
29
|
default: 2
|
|
71
|
-
}),
|
|
30
|
+
}), so = Ie({
|
|
72
31
|
type: String,
|
|
73
32
|
values: ["ltr", "rtl"],
|
|
74
33
|
default: "ltr"
|
|
75
|
-
}),
|
|
34
|
+
}), St = Ie({
|
|
76
35
|
type: Number,
|
|
77
36
|
default: 0
|
|
78
|
-
}),
|
|
37
|
+
}), rt = Ie({
|
|
79
38
|
type: Number,
|
|
80
39
|
required: !0
|
|
81
|
-
}),
|
|
40
|
+
}), un = Ie({
|
|
82
41
|
type: String,
|
|
83
42
|
values: ["horizontal", "vertical"],
|
|
84
|
-
default:
|
|
85
|
-
}),
|
|
43
|
+
default: an
|
|
44
|
+
}), dn = ie({
|
|
86
45
|
className: {
|
|
87
|
-
type:
|
|
46
|
+
type: A([
|
|
47
|
+
String,
|
|
48
|
+
Array,
|
|
49
|
+
Object,
|
|
50
|
+
Boolean
|
|
51
|
+
]),
|
|
88
52
|
default: ""
|
|
89
53
|
},
|
|
90
54
|
containerElement: {
|
|
91
|
-
type:
|
|
55
|
+
type: A([String, Object]),
|
|
92
56
|
default: "div"
|
|
93
57
|
},
|
|
94
58
|
data: {
|
|
95
|
-
type:
|
|
96
|
-
default: () =>
|
|
59
|
+
type: A(Array),
|
|
60
|
+
default: () => ln([])
|
|
97
61
|
},
|
|
98
|
-
|
|
62
|
+
/**
|
|
63
|
+
* @description controls the horizontal direction.
|
|
64
|
+
*/
|
|
65
|
+
direction: so,
|
|
99
66
|
height: {
|
|
100
67
|
type: [String, Number],
|
|
101
68
|
required: !0
|
|
@@ -104,59 +71,94 @@ const uo = () => {
|
|
|
104
71
|
type: [String, Object],
|
|
105
72
|
default: "div"
|
|
106
73
|
},
|
|
74
|
+
innerProps: {
|
|
75
|
+
type: A(Object),
|
|
76
|
+
default: () => ({})
|
|
77
|
+
},
|
|
107
78
|
style: {
|
|
108
|
-
type:
|
|
79
|
+
type: A([
|
|
80
|
+
Object,
|
|
81
|
+
String,
|
|
82
|
+
Array,
|
|
83
|
+
Boolean
|
|
84
|
+
]),
|
|
85
|
+
default: void 0
|
|
109
86
|
},
|
|
110
87
|
useIsScrolling: Boolean,
|
|
111
88
|
width: {
|
|
112
89
|
type: [Number, String],
|
|
113
90
|
required: !1
|
|
114
91
|
},
|
|
92
|
+
innerWidth: {
|
|
93
|
+
type: [Number, String],
|
|
94
|
+
required: !1
|
|
95
|
+
},
|
|
115
96
|
perfMode: {
|
|
116
97
|
type: Boolean,
|
|
117
98
|
default: !0
|
|
118
99
|
},
|
|
119
100
|
scrollbarAlwaysOn: Boolean
|
|
120
|
-
}),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
101
|
+
}), co = ie({
|
|
102
|
+
/**
|
|
103
|
+
* @description describes how many items should be pre rendered to the head
|
|
104
|
+
* and the tail of the window
|
|
105
|
+
*/
|
|
106
|
+
cache: vt,
|
|
107
|
+
estimatedItemSize: wt,
|
|
108
|
+
/**
|
|
109
|
+
* @description controls the list's orientation
|
|
110
|
+
*/
|
|
111
|
+
layout: un,
|
|
112
|
+
initScrollOffset: St,
|
|
113
|
+
/**
|
|
114
|
+
* @description describes the total number of the list.
|
|
115
|
+
*/
|
|
116
|
+
total: rt,
|
|
117
|
+
itemSize: bt,
|
|
118
|
+
...dn
|
|
119
|
+
}), xt = {
|
|
129
120
|
type: Number,
|
|
130
121
|
default: 6
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
122
|
+
}, hn = {
|
|
123
|
+
type: Number,
|
|
124
|
+
default: 0
|
|
125
|
+
}, fn = {
|
|
126
|
+
type: Number,
|
|
127
|
+
default: 2
|
|
128
|
+
}, Ae = ie({
|
|
129
|
+
columnCache: vt,
|
|
130
|
+
columnWidth: bt,
|
|
131
|
+
estimatedColumnWidth: wt,
|
|
132
|
+
estimatedRowHeight: wt,
|
|
133
|
+
initScrollLeft: St,
|
|
134
|
+
initScrollTop: St,
|
|
138
135
|
itemKey: {
|
|
139
|
-
type:
|
|
140
|
-
default: ({
|
|
141
|
-
columnIndex: e,
|
|
142
|
-
rowIndex: t
|
|
143
|
-
}) => `${t}:${e}`
|
|
136
|
+
type: A(Function),
|
|
137
|
+
default: ({ columnIndex: e, rowIndex: t }) => `${t}:${e}`
|
|
144
138
|
},
|
|
145
|
-
rowCache:
|
|
146
|
-
rowHeight:
|
|
147
|
-
totalColumn:
|
|
148
|
-
totalRow:
|
|
149
|
-
hScrollbarSize:
|
|
150
|
-
vScrollbarSize:
|
|
151
|
-
scrollbarStartGap:
|
|
152
|
-
scrollbarEndGap:
|
|
139
|
+
rowCache: vt,
|
|
140
|
+
rowHeight: bt,
|
|
141
|
+
totalColumn: rt,
|
|
142
|
+
totalRow: rt,
|
|
143
|
+
hScrollbarSize: xt,
|
|
144
|
+
vScrollbarSize: xt,
|
|
145
|
+
scrollbarStartGap: hn,
|
|
146
|
+
scrollbarEndGap: fn,
|
|
153
147
|
role: String,
|
|
154
|
-
...
|
|
155
|
-
}),
|
|
148
|
+
...dn
|
|
149
|
+
}), mn = ie({
|
|
156
150
|
alwaysOn: Boolean,
|
|
157
|
-
class:
|
|
158
|
-
|
|
159
|
-
|
|
151
|
+
class: {
|
|
152
|
+
type: A([
|
|
153
|
+
String,
|
|
154
|
+
Array,
|
|
155
|
+
Object,
|
|
156
|
+
Boolean
|
|
157
|
+
]),
|
|
158
|
+
default: ""
|
|
159
|
+
},
|
|
160
|
+
layout: un,
|
|
161
|
+
total: rt,
|
|
160
162
|
ratio: {
|
|
161
163
|
type: Number,
|
|
162
164
|
required: !0
|
|
@@ -169,666 +171,857 @@ const uo = () => {
|
|
|
169
171
|
type: Number,
|
|
170
172
|
required: !0
|
|
171
173
|
},
|
|
172
|
-
scrollbarSize:
|
|
173
|
-
startGap:
|
|
174
|
-
endGap:
|
|
174
|
+
scrollbarSize: xt,
|
|
175
|
+
startGap: hn,
|
|
176
|
+
endGap: fn,
|
|
175
177
|
visible: Boolean
|
|
176
|
-
}),
|
|
177
|
-
let
|
|
178
|
-
function
|
|
179
|
-
if (
|
|
180
|
-
const t = document.createElement("div"),
|
|
181
|
-
|
|
182
|
-
const o = document.createElement("div"),
|
|
183
|
-
return
|
|
178
|
+
}), Qe = (e, t) => e < t ? mt : lo, Kt = (e) => e === "rtl";
|
|
179
|
+
let Fe = null;
|
|
180
|
+
function Bt(e = !1) {
|
|
181
|
+
if (Fe === null || e) {
|
|
182
|
+
const t = document.createElement("div"), n = t.style;
|
|
183
|
+
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
184
|
+
const o = document.createElement("div"), r = o.style;
|
|
185
|
+
return r.width = "100px", r.height = "100px", t.appendChild(o), document.body.appendChild(t), t.scrollLeft > 0 ? Fe = cn : (t.scrollLeft = 1, t.scrollLeft === 0 ? Fe = yt : Fe = sn), document.body.removeChild(t), Fe;
|
|
184
186
|
}
|
|
185
|
-
return
|
|
187
|
+
return Fe;
|
|
186
188
|
}
|
|
187
|
-
function
|
|
188
|
-
const
|
|
189
|
-
return
|
|
189
|
+
function io({ move: e, size: t, bar: n }, o) {
|
|
190
|
+
const r = {}, a = `translate${n.axis}(${e}px)`;
|
|
191
|
+
return r[n.size] = t, r.transform = a, o === "horizontal" ? r.height = "100%" : r.width = "100%", r;
|
|
192
|
+
}
|
|
193
|
+
var jt = Number.isNaN || function(t) {
|
|
194
|
+
return typeof t == "number" && t !== t;
|
|
195
|
+
};
|
|
196
|
+
function uo(e, t) {
|
|
197
|
+
return !!(e === t || jt(e) && jt(t));
|
|
190
198
|
}
|
|
191
|
-
|
|
199
|
+
function ho(e, t) {
|
|
200
|
+
if (e.length !== t.length)
|
|
201
|
+
return !1;
|
|
202
|
+
for (var n = 0; n < e.length; n++)
|
|
203
|
+
if (!uo(e[n], t[n]))
|
|
204
|
+
return !1;
|
|
205
|
+
return !0;
|
|
206
|
+
}
|
|
207
|
+
function fo(e, t) {
|
|
208
|
+
t === void 0 && (t = ho);
|
|
209
|
+
var n = null;
|
|
210
|
+
function o() {
|
|
211
|
+
for (var r = [], a = 0; a < arguments.length; a++)
|
|
212
|
+
r[a] = arguments[a];
|
|
213
|
+
if (n && n.lastThis === this && t(r, n.lastArgs))
|
|
214
|
+
return n.lastResult;
|
|
215
|
+
var s = e.apply(this, r);
|
|
216
|
+
return n = {
|
|
217
|
+
lastResult: s,
|
|
218
|
+
lastArgs: r,
|
|
219
|
+
lastThis: this
|
|
220
|
+
}, s;
|
|
221
|
+
}
|
|
222
|
+
return o.clear = function() {
|
|
223
|
+
n = null;
|
|
224
|
+
}, o;
|
|
225
|
+
}
|
|
226
|
+
const mo = () => {
|
|
227
|
+
const e = st().proxy.$props;
|
|
228
|
+
return T(() => {
|
|
229
|
+
const t = (n, o, r) => ({});
|
|
230
|
+
return e.perfMode ? Fn(t) : fo(t);
|
|
231
|
+
});
|
|
232
|
+
}, $t = xe({
|
|
192
233
|
name: "ElVirtualScrollBar",
|
|
193
|
-
props:
|
|
194
|
-
emits: [
|
|
234
|
+
props: mn,
|
|
235
|
+
emits: [
|
|
236
|
+
"scroll",
|
|
237
|
+
"start-move",
|
|
238
|
+
"stop-move"
|
|
239
|
+
],
|
|
195
240
|
setup(e, { emit: t }) {
|
|
196
|
-
const
|
|
197
|
-
let
|
|
198
|
-
const f =
|
|
241
|
+
const n = T(() => e.startGap + e.endGap), o = Oe("virtual-scrollbar"), r = Oe("scrollbar"), a = P(), s = P();
|
|
242
|
+
let h = null, g = null;
|
|
243
|
+
const f = Vn({
|
|
199
244
|
isDragging: !1,
|
|
200
245
|
traveled: 0
|
|
201
|
-
}),
|
|
246
|
+
}), i = T(() => Jn[e.layout]), m = T(() => e.clientSize - l(n)), v = T(() => ({
|
|
202
247
|
position: "absolute",
|
|
203
|
-
width: `${
|
|
204
|
-
height: `${
|
|
205
|
-
[
|
|
248
|
+
width: `${e.layout === "horizontal" ? m.value : e.scrollbarSize}px`,
|
|
249
|
+
height: `${e.layout === "horizontal" ? e.scrollbarSize : m.value}px`,
|
|
250
|
+
[ao[e.layout]]: "2px",
|
|
206
251
|
right: "2px",
|
|
207
252
|
bottom: "2px",
|
|
208
253
|
borderRadius: "4px"
|
|
209
|
-
})),
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
254
|
+
})), b = T(() => {
|
|
255
|
+
const S = e.ratio;
|
|
256
|
+
if (S >= 100)
|
|
212
257
|
return Number.POSITIVE_INFINITY;
|
|
213
|
-
if (
|
|
214
|
-
return
|
|
215
|
-
const
|
|
216
|
-
return Math.floor(Math.min(Math.max(
|
|
217
|
-
}),
|
|
218
|
-
if (!Number.isFinite(
|
|
219
|
-
return {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
bar: u.value,
|
|
225
|
-
size: R,
|
|
258
|
+
if (S >= 50)
|
|
259
|
+
return S * m.value / 100;
|
|
260
|
+
const W = m.value / 3;
|
|
261
|
+
return Math.floor(Math.min(Math.max(S * m.value / 100, 20), W));
|
|
262
|
+
}), y = T(() => {
|
|
263
|
+
if (!Number.isFinite(b.value))
|
|
264
|
+
return { display: "none" };
|
|
265
|
+
const S = `${b.value}px`;
|
|
266
|
+
return io({
|
|
267
|
+
bar: i.value,
|
|
268
|
+
size: S,
|
|
226
269
|
move: f.traveled
|
|
227
270
|
}, e.layout);
|
|
228
|
-
}),
|
|
229
|
-
window.addEventListener("mousemove",
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
},
|
|
233
|
-
window.removeEventListener("mousemove",
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
},
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
f.isDragging = !1, f[
|
|
240
|
-
},
|
|
241
|
-
const { isDragging:
|
|
242
|
-
if (
|
|
271
|
+
}), c = T(() => Math.ceil(e.clientSize - b.value - l(n))), u = () => {
|
|
272
|
+
window.addEventListener("mousemove", M), window.addEventListener("mouseup", x);
|
|
273
|
+
const S = l(s);
|
|
274
|
+
S && (g = document.onselectstart, document.onselectstart = () => !1, S.addEventListener("touchmove", M, { passive: !0 }), S.addEventListener("touchend", x));
|
|
275
|
+
}, d = () => {
|
|
276
|
+
window.removeEventListener("mousemove", M), window.removeEventListener("mouseup", x), document.onselectstart = g, g = null;
|
|
277
|
+
const S = l(s);
|
|
278
|
+
S && (S.removeEventListener("touchmove", M), S.removeEventListener("touchend", x));
|
|
279
|
+
}, w = (S) => {
|
|
280
|
+
S.stopImmediatePropagation(), !(S.ctrlKey || [1, 2].includes(S.button)) && (f.isDragging = !0, f[i.value.axis] = S.currentTarget[i.value.offset] - (S[i.value.client] - S.currentTarget.getBoundingClientRect()[i.value.direction]), t("start-move"), u());
|
|
281
|
+
}, x = () => {
|
|
282
|
+
f.isDragging = !1, f[i.value.axis] = 0, t("stop-move"), d();
|
|
283
|
+
}, M = (S) => {
|
|
284
|
+
const { isDragging: W } = f;
|
|
285
|
+
if (!W || !s.value || !a.value)
|
|
243
286
|
return;
|
|
244
|
-
const
|
|
245
|
-
if (!
|
|
287
|
+
const k = f[i.value.axis];
|
|
288
|
+
if (!k)
|
|
246
289
|
return;
|
|
247
|
-
|
|
248
|
-
const G = (
|
|
249
|
-
|
|
250
|
-
f.traveled = Math.max(0, Math.min(
|
|
290
|
+
lt(h);
|
|
291
|
+
const G = (a.value.getBoundingClientRect()[i.value.direction] - S[i.value.client]) * -1 - (s.value[i.value.offset] - k);
|
|
292
|
+
h = Mt(() => {
|
|
293
|
+
f.traveled = Math.max(0, Math.min(G, c.value)), t("scroll", G, c.value);
|
|
251
294
|
});
|
|
252
|
-
},
|
|
253
|
-
const
|
|
254
|
-
f.traveled = Math.max(0, Math.min(
|
|
295
|
+
}, p = (S) => {
|
|
296
|
+
const W = Math.abs(S.target.getBoundingClientRect()[i.value.direction] - S[i.value.client]) - s.value[i.value.offset] / 2;
|
|
297
|
+
f.traveled = Math.max(0, Math.min(W, c.value)), t("scroll", W, c.value);
|
|
255
298
|
};
|
|
256
|
-
return
|
|
257
|
-
f.isDragging || (f.traveled = Math.ceil(
|
|
258
|
-
}),
|
|
259
|
-
|
|
260
|
-
}), () =>
|
|
299
|
+
return Se(() => e.scrollFrom, (S) => {
|
|
300
|
+
f.isDragging || (f.traveled = Math.ceil(S * c.value));
|
|
301
|
+
}), nn(() => {
|
|
302
|
+
d();
|
|
303
|
+
}), () => ge("div", {
|
|
261
304
|
role: "presentation",
|
|
262
|
-
ref:
|
|
305
|
+
ref: a,
|
|
263
306
|
class: [
|
|
264
307
|
o.b(),
|
|
265
308
|
e.class,
|
|
266
309
|
(e.alwaysOn || f.isDragging) && "always-on"
|
|
267
310
|
],
|
|
268
|
-
style:
|
|
269
|
-
onMousedown:
|
|
270
|
-
onTouchstartPrevent:
|
|
271
|
-
},
|
|
311
|
+
style: v.value,
|
|
312
|
+
onMousedown: Gn(p, ["stop", "prevent"]),
|
|
313
|
+
onTouchstartPrevent: w
|
|
314
|
+
}, ge("div", {
|
|
272
315
|
ref: s,
|
|
273
|
-
class:
|
|
274
|
-
style:
|
|
275
|
-
onMousedown:
|
|
316
|
+
class: r.e("thumb"),
|
|
317
|
+
style: y.value,
|
|
318
|
+
onMousedown: w
|
|
276
319
|
}, []));
|
|
277
320
|
}
|
|
278
|
-
})
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
/* ASC */
|
|
284
|
-
}, Ue = Symbol("placeholder"), yo = (e, t, l) => {
|
|
285
|
-
var o;
|
|
286
|
-
const a = {
|
|
287
|
-
flexGrow: 0,
|
|
288
|
-
flexShrink: 0,
|
|
289
|
-
...l ? {} : {
|
|
290
|
-
flexGrow: e.flexGrow || 0,
|
|
291
|
-
flexShrink: e.flexShrink || 1
|
|
292
|
-
}
|
|
293
|
-
};
|
|
294
|
-
l || (a.flexShrink = 1);
|
|
295
|
-
const r = {
|
|
296
|
-
...(o = e.style) != null ? o : {},
|
|
297
|
-
...a,
|
|
298
|
-
flexBasis: "auto",
|
|
299
|
-
width: e.width
|
|
321
|
+
}), go = ({ atXEndEdge: e, atXStartEdge: t, atYEndEdge: n, atYStartEdge: o }, r) => {
|
|
322
|
+
let a = null, s = 0, h = 0;
|
|
323
|
+
const g = (i, m) => {
|
|
324
|
+
const v = i < 0 && t.value || i > 0 && e.value, b = m < 0 && o.value || m > 0 && n.value;
|
|
325
|
+
return v || b;
|
|
300
326
|
};
|
|
301
|
-
return
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
return n(r).forEach((i) => {
|
|
313
|
-
d.push({
|
|
314
|
-
...i,
|
|
315
|
-
placeholderSign: Ue
|
|
316
|
-
});
|
|
317
|
-
}), n(c).forEach((i) => {
|
|
318
|
-
d.push(i);
|
|
319
|
-
}), n(s).forEach((i) => {
|
|
320
|
-
d.push({
|
|
321
|
-
...i,
|
|
322
|
-
placeholderSign: Ue
|
|
327
|
+
return {
|
|
328
|
+
hasReachedEdge: g,
|
|
329
|
+
onWheel: (i) => {
|
|
330
|
+
lt(a);
|
|
331
|
+
let m = i.deltaX, v = i.deltaY;
|
|
332
|
+
if (Math.abs(m) > Math.abs(v) ? v = 0 : m = 0, i.shiftKey && v !== 0 && (m = v, v = 0), g(m, v)) {
|
|
333
|
+
i.deltaX !== 0 && m === 0 && i.preventDefault();
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
s += m, h += v, i.preventDefault(), a = Mt(() => {
|
|
337
|
+
r(s, h), s = 0, h = 0;
|
|
323
338
|
});
|
|
324
|
-
}
|
|
325
|
-
}), f = E(() => n(r).length || n(s).length), u = E(() => n(o).reduce((d, i) => (d[i.key] = yo(i, n(l), e.fixed), d), {})), v = E(() => n(a).reduce((d, i) => d + i.width, 0)), b = (d) => n(o).find((i) => i.key === d), y = (d) => n(u)[d], w = (d, i) => {
|
|
326
|
-
d.width = i;
|
|
339
|
+
}
|
|
327
340
|
};
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
fixedColumnsOnLeft: r,
|
|
342
|
-
fixedColumnsOnRight: s,
|
|
343
|
-
hasFixedColumns: f,
|
|
344
|
-
mainColumns: m,
|
|
345
|
-
normalColumns: c,
|
|
346
|
-
visibleColumns: a,
|
|
347
|
-
getColumn: b,
|
|
348
|
-
getColumnStyle: y,
|
|
349
|
-
updateColumnWidth: w,
|
|
350
|
-
onColumnSorted: h
|
|
341
|
+
}, yo = (e, t, n, o, r, a, s) => {
|
|
342
|
+
const h = P(0), g = P(0);
|
|
343
|
+
let f, i = 0, m = 0;
|
|
344
|
+
const v = (y) => {
|
|
345
|
+
lt(f), h.value = y.touches[0].clientX, g.value = y.touches[0].clientY, i = 0, m = 0;
|
|
346
|
+
}, b = (y) => {
|
|
347
|
+
y.preventDefault(), lt(f), i += h.value - y.touches[0].clientX, m += g.value - y.touches[0].clientY, h.value = y.touches[0].clientX, g.value = y.touches[0].clientY, f = Mt(() => {
|
|
348
|
+
const c = o.value - l(a), u = r.value - l(s);
|
|
349
|
+
n({
|
|
350
|
+
scrollLeft: Math.min(t.value.scrollLeft + i, c),
|
|
351
|
+
scrollTop: Math.min(t.value.scrollTop + m, u)
|
|
352
|
+
}), i = 0, m = 0;
|
|
353
|
+
});
|
|
351
354
|
};
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
onMaybeEndReached: a
|
|
358
|
-
}) => {
|
|
359
|
-
const r = F({ scrollLeft: 0, scrollTop: 0 });
|
|
360
|
-
function s(y) {
|
|
361
|
-
var w, h, d;
|
|
362
|
-
const { scrollTop: i } = y;
|
|
363
|
-
(w = t.value) == null || w.scrollTo(y), (h = l.value) == null || h.scrollToTop(i), (d = o.value) == null || d.scrollToTop(i);
|
|
364
|
-
}
|
|
365
|
-
function c(y) {
|
|
366
|
-
r.value = y, s(y);
|
|
367
|
-
}
|
|
368
|
-
function m(y) {
|
|
369
|
-
r.value.scrollTop = y, s(n(r));
|
|
370
|
-
}
|
|
371
|
-
function f(y) {
|
|
372
|
-
var w, h;
|
|
373
|
-
r.value.scrollLeft = y, (h = (w = t.value) == null ? void 0 : w.scrollTo) == null || h.call(w, n(r));
|
|
374
|
-
}
|
|
375
|
-
function u(y) {
|
|
376
|
-
var w;
|
|
377
|
-
c(y), (w = e.onScroll) == null || w.call(e, y);
|
|
378
|
-
}
|
|
379
|
-
function v({ scrollTop: y }) {
|
|
380
|
-
const { scrollTop: w } = n(r);
|
|
381
|
-
y !== w && m(y);
|
|
382
|
-
}
|
|
383
|
-
function b(y, w = "auto") {
|
|
384
|
-
var h;
|
|
385
|
-
(h = t.value) == null || h.scrollToRow(y, w);
|
|
386
|
-
}
|
|
387
|
-
return Re(() => n(r).scrollTop, (y, w) => {
|
|
388
|
-
y > w && a();
|
|
389
|
-
}), {
|
|
390
|
-
scrollPos: r,
|
|
391
|
-
scrollTo: c,
|
|
392
|
-
scrollToLeft: f,
|
|
393
|
-
scrollToTop: m,
|
|
394
|
-
scrollToRow: b,
|
|
395
|
-
onScroll: u,
|
|
396
|
-
onVerticalScroll: v
|
|
355
|
+
return ft(e, "touchstart", v, { passive: !0 }), ft(e, "touchmove", b, { passive: !1 }), {
|
|
356
|
+
touchStartX: h,
|
|
357
|
+
touchStartY: g,
|
|
358
|
+
handleTouchStart: v,
|
|
359
|
+
handleTouchMove: b
|
|
397
360
|
};
|
|
398
|
-
},
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
361
|
+
}, gn = ({ name: e, clearCache: t, getColumnPosition: n, getColumnStartIndexForOffset: o, getColumnStopIndexForStartIndex: r, getEstimatedTotalHeight: a, getEstimatedTotalWidth: s, getColumnOffset: h, getRowOffset: g, getRowPosition: f, getRowStartIndexForOffset: i, getRowStopIndexForStartIndex: m, initCache: v, injectToInstance: b, validateProps: y }) => xe({
|
|
362
|
+
name: e ?? "ElVirtualList",
|
|
363
|
+
props: Ae,
|
|
364
|
+
emits: [Vt, Gt],
|
|
365
|
+
setup(c, { emit: u, expose: d, slots: w }) {
|
|
366
|
+
const x = Oe("vl");
|
|
367
|
+
y(c);
|
|
368
|
+
const M = st(), p = P(v(c, M));
|
|
369
|
+
b == null || b(M, p);
|
|
370
|
+
const S = P(), W = P(), k = P(), G = P(), R = P({
|
|
371
|
+
isScrolling: !1,
|
|
372
|
+
scrollLeft: X(c.initScrollLeft) ? c.initScrollLeft : 0,
|
|
373
|
+
scrollTop: X(c.initScrollTop) ? c.initScrollTop : 0,
|
|
374
|
+
updateRequested: !1,
|
|
375
|
+
xAxisScrollDir: mt,
|
|
376
|
+
yAxisScrollDir: mt
|
|
377
|
+
}), L = mo(), F = T(() => Number.parseInt(`${c.height}`, 10)), z = T(() => Number.parseInt(`${c.width}`, 10)), K = T(() => {
|
|
378
|
+
const { totalColumn: H, totalRow: C, columnCache: _ } = c, { isScrolling: N, xAxisScrollDir: O, scrollLeft: I } = l(R);
|
|
379
|
+
if (H === 0 || C === 0)
|
|
380
|
+
return [
|
|
381
|
+
0,
|
|
382
|
+
0,
|
|
383
|
+
0,
|
|
384
|
+
0
|
|
385
|
+
];
|
|
386
|
+
const D = o(c, I, l(p)), V = r(c, D, I, l(p)), $ = !N || O === "backward" ? Math.max(1, _) : 1, J = !N || O === "forward" ? Math.max(1, _) : 1;
|
|
387
|
+
return [
|
|
388
|
+
Math.max(0, D - $),
|
|
389
|
+
Math.max(0, Math.min(H - 1, V + J)),
|
|
390
|
+
D,
|
|
391
|
+
V
|
|
392
|
+
];
|
|
393
|
+
}), B = T(() => {
|
|
394
|
+
const { totalColumn: H, totalRow: C, rowCache: _ } = c, { isScrolling: N, yAxisScrollDir: O, scrollTop: I } = l(R);
|
|
395
|
+
if (H === 0 || C === 0)
|
|
396
|
+
return [
|
|
397
|
+
0,
|
|
398
|
+
0,
|
|
399
|
+
0,
|
|
400
|
+
0
|
|
401
|
+
];
|
|
402
|
+
const D = i(c, I, l(p)), V = m(c, D, I, l(p)), $ = !N || O === "backward" ? Math.max(1, _) : 1, J = !N || O === "forward" ? Math.max(1, _) : 1;
|
|
403
|
+
return [
|
|
404
|
+
Math.max(0, D - $),
|
|
405
|
+
Math.max(0, Math.min(C - 1, V + J)),
|
|
406
|
+
D,
|
|
407
|
+
V
|
|
408
|
+
];
|
|
409
|
+
}), j = T(() => a(c, l(p))), U = T(() => s(c, l(p))), re = T(() => [
|
|
410
|
+
{
|
|
411
|
+
position: "relative",
|
|
412
|
+
overflow: "hidden",
|
|
413
|
+
WebkitOverflowScrolling: "touch",
|
|
414
|
+
willChange: "transform"
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
direction: c.direction,
|
|
418
|
+
height: X(c.height) ? `${c.height}px` : c.height,
|
|
419
|
+
width: X(c.width) ? `${c.width}px` : c.width
|
|
420
|
+
},
|
|
421
|
+
c.style ?? {}
|
|
422
|
+
]), Re = T(() => {
|
|
423
|
+
const H = `${l(U)}px`;
|
|
424
|
+
return {
|
|
425
|
+
height: `${l(j)}px`,
|
|
426
|
+
pointerEvents: l(R).isScrolling ? "none" : void 0,
|
|
427
|
+
width: H,
|
|
428
|
+
margin: 0,
|
|
429
|
+
boxSizing: "border-box"
|
|
430
|
+
};
|
|
431
|
+
}), ue = () => {
|
|
432
|
+
const { totalColumn: H, totalRow: C } = c;
|
|
433
|
+
if (H > 0 && C > 0) {
|
|
434
|
+
const [V, $, J, te] = l(K), [oe, Y, Be, Ze] = l(B);
|
|
435
|
+
u(Vt, {
|
|
436
|
+
columnCacheStart: V,
|
|
437
|
+
columnCacheEnd: $,
|
|
438
|
+
rowCacheStart: oe,
|
|
439
|
+
rowCacheEnd: Y,
|
|
440
|
+
columnVisibleStart: J,
|
|
441
|
+
columnVisibleEnd: te,
|
|
442
|
+
rowVisibleStart: Be,
|
|
443
|
+
rowVisibleEnd: Ze
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
const { scrollLeft: _, scrollTop: N, updateRequested: O, xAxisScrollDir: I, yAxisScrollDir: D } = l(R);
|
|
447
|
+
u(Gt, {
|
|
448
|
+
xAxisScrollDir: I,
|
|
449
|
+
scrollLeft: _,
|
|
450
|
+
yAxisScrollDir: D,
|
|
451
|
+
scrollTop: N,
|
|
452
|
+
updateRequested: O
|
|
453
|
+
});
|
|
454
|
+
}, ae = (H) => {
|
|
455
|
+
const { clientHeight: C, clientWidth: _, scrollHeight: N, scrollLeft: O, scrollTop: I, scrollWidth: D } = H.currentTarget, V = l(R);
|
|
456
|
+
if (V.scrollTop === I && V.scrollLeft === O)
|
|
457
|
+
return;
|
|
458
|
+
let $ = O;
|
|
459
|
+
if (Kt(c.direction))
|
|
460
|
+
switch (Bt()) {
|
|
461
|
+
case yt:
|
|
462
|
+
$ = -O;
|
|
463
|
+
break;
|
|
464
|
+
case cn:
|
|
465
|
+
$ = D - _ - O;
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
R.value = {
|
|
469
|
+
...V,
|
|
470
|
+
isScrolling: !0,
|
|
471
|
+
scrollLeft: $,
|
|
472
|
+
scrollTop: Math.max(0, Math.min(I, N - C)),
|
|
473
|
+
updateRequested: !0,
|
|
474
|
+
xAxisScrollDir: Qe(V.scrollLeft, $),
|
|
475
|
+
yAxisScrollDir: Qe(V.scrollTop, I)
|
|
476
|
+
}, ve(() => de()), De(), ue();
|
|
477
|
+
}, Te = (H, C) => {
|
|
478
|
+
const _ = l(F), N = (j.value - _) / C * H;
|
|
479
|
+
ee({ scrollTop: Math.min(j.value - _, N) });
|
|
480
|
+
}, be = (H, C) => {
|
|
481
|
+
const _ = l(z), N = (U.value - _) / C * H;
|
|
482
|
+
ee({ scrollLeft: Math.min(U.value - _, N) });
|
|
483
|
+
}, { onWheel: se } = go({
|
|
484
|
+
atXStartEdge: T(() => R.value.scrollLeft <= 0),
|
|
485
|
+
atXEndEdge: T(() => R.value.scrollLeft >= U.value - l(z)),
|
|
486
|
+
atYStartEdge: T(() => R.value.scrollTop <= 0),
|
|
487
|
+
atYEndEdge: T(() => R.value.scrollTop >= j.value - l(F))
|
|
488
|
+
}, (H, C) => {
|
|
489
|
+
var O, I, D, V;
|
|
490
|
+
(I = (O = W.value) == null ? void 0 : O.onMouseUp) == null || I.call(O), (V = (D = k.value) == null ? void 0 : D.onMouseUp) == null || V.call(D);
|
|
491
|
+
const _ = l(z), N = l(F);
|
|
492
|
+
ee({
|
|
493
|
+
scrollLeft: Math.min(R.value.scrollLeft + H, U.value - _),
|
|
494
|
+
scrollTop: Math.min(R.value.scrollTop + C, j.value - N)
|
|
495
|
+
});
|
|
416
496
|
});
|
|
497
|
+
ft(S, "wheel", se, { passive: !1 });
|
|
498
|
+
const ee = ({ scrollLeft: H = R.value.scrollLeft, scrollTop: C = R.value.scrollTop }) => {
|
|
499
|
+
H = Math.max(H, 0), C = Math.max(C, 0);
|
|
500
|
+
const _ = l(R);
|
|
501
|
+
C === _.scrollTop && H === _.scrollLeft || (R.value = {
|
|
502
|
+
..._,
|
|
503
|
+
xAxisScrollDir: Qe(_.scrollLeft, H),
|
|
504
|
+
yAxisScrollDir: Qe(_.scrollTop, C),
|
|
505
|
+
scrollLeft: H,
|
|
506
|
+
scrollTop: C,
|
|
507
|
+
updateRequested: !0
|
|
508
|
+
}, ve(() => de()), De(), ue());
|
|
509
|
+
}, { touchStartX: ne, touchStartY: Ne, handleTouchStart: Ee, handleTouchMove: Ce } = yo(S, R, ee, U, j, z, F), Ge = (H = 0, C = 0, _ = pe) => {
|
|
510
|
+
const N = l(R);
|
|
511
|
+
C = Math.max(0, Math.min(C, c.totalColumn - 1)), H = Math.max(0, Math.min(H, c.totalRow - 1));
|
|
512
|
+
const O = Zn(x.namespace.value), I = l(p), D = a(c, I), V = s(c, I);
|
|
513
|
+
ee({
|
|
514
|
+
scrollLeft: h(c, C, _, N.scrollLeft, I, V > c.width ? O : 0),
|
|
515
|
+
scrollTop: g(c, H, _, N.scrollTop, I, D > c.height ? O : 0)
|
|
516
|
+
});
|
|
517
|
+
}, Ke = (H, C) => {
|
|
518
|
+
const { columnWidth: _, direction: N, rowHeight: O } = c, I = L.value(t && _, t && O, t && N), D = `${H},${C}`;
|
|
519
|
+
if (Dn(I, D))
|
|
520
|
+
return I[D];
|
|
521
|
+
{
|
|
522
|
+
const [, V] = n(c, C, l(p)), $ = l(p), J = Kt(N), [te, oe] = f(c, H, $), [Y] = n(c, C, $);
|
|
523
|
+
return I[D] = {
|
|
524
|
+
position: "absolute",
|
|
525
|
+
left: J ? void 0 : `${V}px`,
|
|
526
|
+
right: J ? `${V}px` : void 0,
|
|
527
|
+
top: `${oe}px`,
|
|
528
|
+
height: `${te}px`,
|
|
529
|
+
width: `${Y}px`
|
|
530
|
+
}, I[D];
|
|
531
|
+
}
|
|
532
|
+
}, de = () => {
|
|
533
|
+
R.value.isScrolling = !1, ve(() => {
|
|
534
|
+
L.value(-1, null, null);
|
|
535
|
+
});
|
|
536
|
+
};
|
|
537
|
+
ct(() => {
|
|
538
|
+
if (!Nn)
|
|
539
|
+
return;
|
|
540
|
+
const { initScrollLeft: H, initScrollTop: C } = c, _ = l(S);
|
|
541
|
+
_ && (X(H) && (_.scrollLeft = H), X(C) && (_.scrollTop = C)), ue();
|
|
542
|
+
});
|
|
543
|
+
const De = () => {
|
|
544
|
+
const { direction: H } = c, { scrollLeft: C, scrollTop: _, updateRequested: N } = l(R), O = l(S);
|
|
545
|
+
if (N && O) {
|
|
546
|
+
if (H === "rtl")
|
|
547
|
+
switch (Bt()) {
|
|
548
|
+
case yt:
|
|
549
|
+
O.scrollLeft = -C;
|
|
550
|
+
break;
|
|
551
|
+
case sn:
|
|
552
|
+
O.scrollLeft = C;
|
|
553
|
+
break;
|
|
554
|
+
default: {
|
|
555
|
+
const { clientWidth: I, scrollWidth: D } = O;
|
|
556
|
+
O.scrollLeft = D - I - C;
|
|
557
|
+
break;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
else
|
|
561
|
+
O.scrollLeft = Math.max(0, C);
|
|
562
|
+
O.scrollTop = Math.max(0, _);
|
|
563
|
+
}
|
|
564
|
+
}, { resetAfterColumnIndex: Z, resetAfterRowIndex: Q, resetAfter: ce } = M.proxy;
|
|
565
|
+
d({
|
|
566
|
+
windowRef: S,
|
|
567
|
+
innerRef: G,
|
|
568
|
+
getItemStyleCache: L,
|
|
569
|
+
touchStartX: ne,
|
|
570
|
+
touchStartY: Ne,
|
|
571
|
+
handleTouchStart: Ee,
|
|
572
|
+
handleTouchMove: Ce,
|
|
573
|
+
scrollTo: ee,
|
|
574
|
+
scrollToItem: Ge,
|
|
575
|
+
states: R,
|
|
576
|
+
resetAfterColumnIndex: Z,
|
|
577
|
+
resetAfterRowIndex: Q,
|
|
578
|
+
resetAfter: ce
|
|
579
|
+
});
|
|
580
|
+
const he = () => {
|
|
581
|
+
const { scrollbarAlwaysOn: H, scrollbarStartGap: C, scrollbarEndGap: _, totalColumn: N, totalRow: O } = c, I = l(z), D = l(F), V = l(U), $ = l(j), { scrollLeft: J, scrollTop: te } = l(R);
|
|
582
|
+
return {
|
|
583
|
+
horizontalScrollbar: ge($t, {
|
|
584
|
+
ref: W,
|
|
585
|
+
alwaysOn: H,
|
|
586
|
+
startGap: C,
|
|
587
|
+
endGap: _,
|
|
588
|
+
class: x.e("horizontal"),
|
|
589
|
+
clientSize: I,
|
|
590
|
+
layout: "horizontal",
|
|
591
|
+
onScroll: be,
|
|
592
|
+
ratio: I * 100 / V,
|
|
593
|
+
scrollFrom: J / (V - I),
|
|
594
|
+
total: O,
|
|
595
|
+
visible: !0
|
|
596
|
+
}),
|
|
597
|
+
verticalScrollbar: ge($t, {
|
|
598
|
+
ref: k,
|
|
599
|
+
alwaysOn: H,
|
|
600
|
+
startGap: C,
|
|
601
|
+
endGap: _,
|
|
602
|
+
class: x.e("vertical"),
|
|
603
|
+
clientSize: D,
|
|
604
|
+
layout: "vertical",
|
|
605
|
+
onScroll: Te,
|
|
606
|
+
ratio: D * 100 / $,
|
|
607
|
+
scrollFrom: te / ($ - D),
|
|
608
|
+
total: N,
|
|
609
|
+
visible: !0
|
|
610
|
+
})
|
|
611
|
+
};
|
|
612
|
+
}, fe = () => {
|
|
613
|
+
var te;
|
|
614
|
+
const [H, C] = l(K), [_, N] = l(B), { data: O, totalColumn: I, totalRow: D, useIsScrolling: V, itemKey: $ } = c, J = [];
|
|
615
|
+
if (D > 0 && I > 0)
|
|
616
|
+
for (let oe = _; oe <= N; oe++)
|
|
617
|
+
for (let Y = H; Y <= C; Y++) {
|
|
618
|
+
const Be = $({
|
|
619
|
+
columnIndex: Y,
|
|
620
|
+
data: O,
|
|
621
|
+
rowIndex: oe
|
|
622
|
+
});
|
|
623
|
+
J.push(ge(Kn, { key: Be }, (te = w.default) == null ? void 0 : te.call(w, {
|
|
624
|
+
columnIndex: Y,
|
|
625
|
+
data: O,
|
|
626
|
+
isScrolling: V ? l(R).isScrolling : void 0,
|
|
627
|
+
style: Ke(oe, Y),
|
|
628
|
+
rowIndex: oe
|
|
629
|
+
})));
|
|
630
|
+
}
|
|
631
|
+
return J;
|
|
632
|
+
}, it = () => {
|
|
633
|
+
const H = Dt(c.innerElement), C = fe();
|
|
634
|
+
return [ge(H, q(c.innerProps, {
|
|
635
|
+
style: l(Re),
|
|
636
|
+
ref: G
|
|
637
|
+
}), Nt(H) ? C : { default: () => C })];
|
|
638
|
+
};
|
|
639
|
+
return () => {
|
|
640
|
+
const H = Dt(c.containerElement), { horizontalScrollbar: C, verticalScrollbar: _ } = he(), N = it();
|
|
641
|
+
return ge("div", {
|
|
642
|
+
key: 0,
|
|
643
|
+
class: x.e("wrapper"),
|
|
644
|
+
role: c.role
|
|
645
|
+
}, [
|
|
646
|
+
ge(H, {
|
|
647
|
+
class: c.className,
|
|
648
|
+
style: l(re),
|
|
649
|
+
onScroll: ae,
|
|
650
|
+
ref: S
|
|
651
|
+
}, Nt(H) ? N : { default: () => N }),
|
|
652
|
+
C,
|
|
653
|
+
_
|
|
654
|
+
]);
|
|
655
|
+
};
|
|
417
656
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
})
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
657
|
+
}), qt = "ElFixedSizeGrid", bo = gn({
|
|
658
|
+
name: "ElFixedSizeGrid",
|
|
659
|
+
getColumnPosition: ({ columnWidth: e }, t) => [e, t * e],
|
|
660
|
+
getRowPosition: ({ rowHeight: e }, t) => [e, t * e],
|
|
661
|
+
getEstimatedTotalHeight: ({ totalRow: e, rowHeight: t }) => t * e,
|
|
662
|
+
getEstimatedTotalWidth: ({ totalColumn: e, columnWidth: t }) => t * e,
|
|
663
|
+
getColumnOffset: ({ totalColumn: e, columnWidth: t, width: n }, o, r, a, s, h) => {
|
|
664
|
+
n = Number(n);
|
|
665
|
+
const g = Math.max(0, e * t - n), f = Math.min(g, o * t), i = Math.max(0, o * t - n + h + t);
|
|
666
|
+
switch (r === "smart" && (a >= i - n && a <= f + n ? r = pe : r = ke), r) {
|
|
667
|
+
case gt:
|
|
668
|
+
return f;
|
|
669
|
+
case "end":
|
|
670
|
+
return i;
|
|
671
|
+
case ke: {
|
|
672
|
+
const m = Math.round(i + (f - i) / 2);
|
|
673
|
+
return m < Math.ceil(n / 2) ? 0 : m > g + Math.floor(n / 2) ? g : m;
|
|
674
|
+
}
|
|
675
|
+
case pe:
|
|
676
|
+
default:
|
|
677
|
+
return a >= i && a <= f ? a : i > f || a < i ? i : f;
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
getRowOffset: ({ rowHeight: e, height: t, totalRow: n }, o, r, a, s, h) => {
|
|
681
|
+
t = Number(t);
|
|
682
|
+
const g = Math.max(0, n * e - t), f = Math.min(g, o * e), i = Math.max(0, o * e - t + h + e);
|
|
683
|
+
switch (r === "smart" && (a >= i - t && a <= f + t ? r = pe : r = ke), r) {
|
|
684
|
+
case gt:
|
|
685
|
+
return f;
|
|
686
|
+
case "end":
|
|
687
|
+
return i;
|
|
688
|
+
case ke: {
|
|
689
|
+
const m = Math.round(i + (f - i) / 2);
|
|
690
|
+
return m < Math.ceil(t / 2) ? 0 : m > g + Math.floor(t / 2) ? g : m;
|
|
691
|
+
}
|
|
692
|
+
case pe:
|
|
693
|
+
default:
|
|
694
|
+
return a >= i && a <= f ? a : i > f || a < i ? i : f;
|
|
695
|
+
}
|
|
696
|
+
},
|
|
697
|
+
getColumnStartIndexForOffset: ({ columnWidth: e, totalColumn: t }, n) => Math.max(0, Math.min(t - 1, Math.floor(n / e))),
|
|
698
|
+
getColumnStopIndexForStartIndex: ({ columnWidth: e, totalColumn: t, width: n }, o, r) => {
|
|
699
|
+
const a = o * e, s = Math.ceil((n + r - a) / e);
|
|
700
|
+
return Math.max(0, Math.min(t - 1, o + s - 1));
|
|
701
|
+
},
|
|
702
|
+
getRowStartIndexForOffset: ({ rowHeight: e, totalRow: t }, n) => Math.max(0, Math.min(t - 1, Math.floor(n / e))),
|
|
703
|
+
getRowStopIndexForStartIndex: ({ rowHeight: e, totalRow: t, height: n }, o, r) => {
|
|
704
|
+
const a = o * e, s = Math.ceil((n + r - a) / e);
|
|
705
|
+
return Math.max(0, Math.min(t - 1, o + s - 1));
|
|
706
|
+
},
|
|
707
|
+
/**
|
|
708
|
+
* Fixed size grid does not need this cache
|
|
709
|
+
* Using any to bypass it, TODO: Using type inference to fix this.
|
|
710
|
+
*/
|
|
711
|
+
initCache: () => {
|
|
712
|
+
},
|
|
713
|
+
clearCache: !0,
|
|
714
|
+
validateProps: ({ columnWidth: e, rowHeight: t }) => {
|
|
715
|
+
X(e) || ot(qt, `
|
|
716
|
+
"columnWidth" must be passed as number,
|
|
717
|
+
instead ${typeof e} was given.
|
|
718
|
+
`), X(t) || ot(qt, `
|
|
719
|
+
"columnWidth" must be passed as number,
|
|
720
|
+
instead ${typeof t} was given.
|
|
721
|
+
`);
|
|
432
722
|
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
723
|
+
}), { max: at, min: yn, floor: bn } = Math, Ut = "ElDynamicSizeGrid", wo = {
|
|
724
|
+
column: "columnWidth",
|
|
725
|
+
row: "rowHeight"
|
|
726
|
+
}, Rt = {
|
|
727
|
+
column: "lastVisitedColumnIndex",
|
|
728
|
+
row: "lastVisitedRowIndex"
|
|
729
|
+
}, ye = (e, t, n, o) => {
|
|
730
|
+
const [r, a, s] = [
|
|
731
|
+
n[o],
|
|
732
|
+
e[wo[o]],
|
|
733
|
+
n[Rt[o]]
|
|
734
|
+
];
|
|
735
|
+
if (t > s) {
|
|
736
|
+
let h = 0;
|
|
737
|
+
if (s >= 0) {
|
|
738
|
+
const g = r[s];
|
|
739
|
+
h = g.offset + g.size;
|
|
740
|
+
}
|
|
741
|
+
for (let g = s + 1; g <= t; g++) {
|
|
742
|
+
const f = a(g);
|
|
743
|
+
r[g] = {
|
|
744
|
+
offset: h,
|
|
745
|
+
size: f
|
|
746
|
+
}, h += f;
|
|
747
|
+
}
|
|
748
|
+
n[Rt[o]] = t;
|
|
442
749
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
750
|
+
return r[t];
|
|
751
|
+
}, wn = (e, t, n, o, r, a) => {
|
|
752
|
+
for (; n <= o; ) {
|
|
753
|
+
const s = n + bn((o - n) / 2), h = ye(e, s, t, a).offset;
|
|
754
|
+
if (h === r)
|
|
755
|
+
return s;
|
|
756
|
+
h < r ? n = s + 1 : o = s - 1;
|
|
446
757
|
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
758
|
+
return at(0, n - 1);
|
|
759
|
+
}, vo = (e, t, n, o, r) => {
|
|
760
|
+
const a = r === "column" ? e.totalColumn : e.totalRow;
|
|
761
|
+
let s = 1;
|
|
762
|
+
for (; n < a && ye(e, n, t, r).offset < o; )
|
|
763
|
+
n += s, s *= 2;
|
|
764
|
+
return wn(e, t, bn(n / 2), yn(n, a - 1), o, r);
|
|
765
|
+
}, Yt = (e, t, n, o) => {
|
|
766
|
+
const [r, a] = [t[o], t[Rt[o]]];
|
|
767
|
+
return (a > 0 ? r[a].offset : 0) >= n ? wn(e, t, 0, a, n, o) : vo(e, t, at(0, a), n, o);
|
|
768
|
+
}, vn = ({ totalRow: e }, { estimatedRowHeight: t, lastVisitedRowIndex: n, row: o }) => {
|
|
769
|
+
let r = 0;
|
|
770
|
+
if (n >= e && (n = e - 1), n >= 0) {
|
|
771
|
+
const s = o[n];
|
|
772
|
+
r = s.offset + s.size;
|
|
451
773
|
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
774
|
+
const a = (e - n - 1) * t;
|
|
775
|
+
return r + a;
|
|
776
|
+
}, Sn = ({ totalColumn: e }, { column: t, estimatedColumnWidth: n, lastVisitedColumnIndex: o }) => {
|
|
777
|
+
let r = 0;
|
|
778
|
+
if (o > e && (o = e - 1), o >= 0) {
|
|
779
|
+
const s = t[o];
|
|
780
|
+
r = s.offset + s.size;
|
|
781
|
+
}
|
|
782
|
+
const a = (e - o - 1) * n;
|
|
783
|
+
return r + a;
|
|
784
|
+
}, So = {
|
|
785
|
+
column: Sn,
|
|
786
|
+
row: vn
|
|
787
|
+
}, Xt = (e, t, n, o, r, a, s) => {
|
|
788
|
+
const [h, g] = [a === "row" ? e.height : e.width, So[a]], f = ye(e, t, r, a), i = at(0, yn(g(e, r) - h, f.offset)), m = at(0, f.offset - h + s + f.size);
|
|
789
|
+
switch (n === "smart" && (o >= m - h && o <= i + h ? n = pe : n = ke), n) {
|
|
790
|
+
case gt:
|
|
791
|
+
return i;
|
|
792
|
+
case "end":
|
|
468
793
|
return m;
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
v.push(w), b.has(w[f]) && We(w.children) && w.children.length > 0 && (y = [...w.children, ...y], w.children.forEach((h) => c[h[f]] = c[w[f]] + 1));
|
|
475
|
-
}
|
|
476
|
-
return a.value = c, v;
|
|
477
|
-
}), s = E(() => {
|
|
478
|
-
const { data: c, expandColumnKey: m } = e;
|
|
479
|
-
return m ? n(r) : c;
|
|
480
|
-
});
|
|
481
|
-
return Re(s, (c, m) => {
|
|
482
|
-
c !== m && (l.value = -1, o(0, !0));
|
|
483
|
-
}), {
|
|
484
|
-
data: s,
|
|
485
|
-
depthMap: a
|
|
486
|
-
};
|
|
487
|
-
}, xo = (e, t) => e + t, et = (e) => We(e) ? e.reduce(xo, 0) : e, Ae = (e, t, l = {}) => Tt(e) ? e(t) : e ?? l, be = (e) => (["width", "maxWidth", "minWidth", "height"].forEach((t) => {
|
|
488
|
-
e[t] = Qe(e[t]);
|
|
489
|
-
}), e), yl = (e) => Ne(e) ? (t) => ue(e, t) : e, To = (e, {
|
|
490
|
-
columnsTotalWidth: t,
|
|
491
|
-
rowsHeight: l,
|
|
492
|
-
fixedColumnsOnLeft: o,
|
|
493
|
-
fixedColumnsOnRight: a
|
|
494
|
-
}) => {
|
|
495
|
-
const r = E(() => {
|
|
496
|
-
const { fixed: i, width: g, vScrollbarSize: S } = e, H = g - S;
|
|
497
|
-
return i ? Math.max(Math.round(n(t)), H) : H;
|
|
498
|
-
}), s = E(() => {
|
|
499
|
-
const { height: i = 0, maxHeight: g = 0, footerHeight: S, hScrollbarSize: H } = e;
|
|
500
|
-
if (g > 0) {
|
|
501
|
-
const M = n(b), R = n(l), z = n(v) + M + R + H;
|
|
502
|
-
return Math.min(z, g - S);
|
|
503
|
-
}
|
|
504
|
-
return i - S;
|
|
505
|
-
}), c = E(() => {
|
|
506
|
-
const { maxHeight: i } = e, g = n(s);
|
|
507
|
-
if (Q(i) && i > 0)
|
|
508
|
-
return g;
|
|
509
|
-
const S = n(l) + n(v) + n(b);
|
|
510
|
-
return Math.min(g, S);
|
|
511
|
-
}), m = (i) => i.width, f = E(() => et(n(o).map(m))), u = E(() => et(n(a).map(m))), v = E(() => et(e.headerHeight)), b = E(() => {
|
|
512
|
-
var i;
|
|
513
|
-
return (((i = e.fixedData) == null ? void 0 : i.length) || 0) * e.rowHeight;
|
|
514
|
-
}), y = E(() => n(s) - n(v) - n(b)), w = E(() => {
|
|
515
|
-
const { style: i = {}, height: g, width: S } = e;
|
|
516
|
-
return be({
|
|
517
|
-
...i,
|
|
518
|
-
height: g,
|
|
519
|
-
width: S
|
|
520
|
-
});
|
|
521
|
-
}), h = E(() => be({ height: e.footerHeight })), d = E(() => ({
|
|
522
|
-
top: Qe(n(v)),
|
|
523
|
-
bottom: Qe(e.footerHeight),
|
|
524
|
-
width: Qe(e.width)
|
|
525
|
-
}));
|
|
526
|
-
return {
|
|
527
|
-
bodyWidth: r,
|
|
528
|
-
fixedTableHeight: c,
|
|
529
|
-
mainTableHeight: s,
|
|
530
|
-
leftTableWidth: f,
|
|
531
|
-
rightTableWidth: u,
|
|
532
|
-
windowHeight: y,
|
|
533
|
-
footerHeight: h,
|
|
534
|
-
emptyStyle: d,
|
|
535
|
-
rootStyle: w,
|
|
536
|
-
headerHeight: v
|
|
537
|
-
};
|
|
538
|
-
};
|
|
539
|
-
function Eo(e) {
|
|
540
|
-
const t = F(), l = F(), o = F(), {
|
|
541
|
-
columns: a,
|
|
542
|
-
columnsStyles: r,
|
|
543
|
-
columnsTotalWidth: s,
|
|
544
|
-
fixedColumnsOnLeft: c,
|
|
545
|
-
fixedColumnsOnRight: m,
|
|
546
|
-
hasFixedColumns: f,
|
|
547
|
-
mainColumns: u,
|
|
548
|
-
onColumnSorted: v
|
|
549
|
-
} = wo(e, Lt(e, "columns"), Lt(e, "fixed")), {
|
|
550
|
-
scrollTo: b,
|
|
551
|
-
scrollToLeft: y,
|
|
552
|
-
scrollToTop: w,
|
|
553
|
-
scrollToRow: h,
|
|
554
|
-
onScroll: d,
|
|
555
|
-
onVerticalScroll: i,
|
|
556
|
-
scrollPos: g
|
|
557
|
-
} = bo(e, {
|
|
558
|
-
mainTableRef: t,
|
|
559
|
-
leftTableRef: l,
|
|
560
|
-
rightTableRef: o,
|
|
561
|
-
onMaybeEndReached: Ve
|
|
562
|
-
}), S = Ie("table-v2"), H = nt(), M = $e(!1), {
|
|
563
|
-
expandedRowKeys: R,
|
|
564
|
-
lastRenderedRowIndex: $,
|
|
565
|
-
isDynamic: z,
|
|
566
|
-
isResetting: G,
|
|
567
|
-
rowHeights: x,
|
|
568
|
-
resetAfterIndex: A,
|
|
569
|
-
onRowExpanded: W,
|
|
570
|
-
onRowHeightChange: N,
|
|
571
|
-
onRowHovered: j,
|
|
572
|
-
onRowsRendered: B
|
|
573
|
-
} = So(e, {
|
|
574
|
-
mainTableRef: t,
|
|
575
|
-
leftTableRef: l,
|
|
576
|
-
rightTableRef: o,
|
|
577
|
-
tableInstance: H,
|
|
578
|
-
ns: S,
|
|
579
|
-
isScrolling: M
|
|
580
|
-
}), { data: V, depthMap: U } = Ro(e, {
|
|
581
|
-
expandedRowKeys: R,
|
|
582
|
-
lastRenderedRowIndex: $,
|
|
583
|
-
resetAfterIndex: A
|
|
584
|
-
}), le = E(() => {
|
|
585
|
-
const { estimatedRowHeight: q, rowHeight: oe } = e, ce = n(V);
|
|
586
|
-
return Q(q) ? Object.values(n(x)).reduce((T, _) => T + _, 0) : ce.length * oe;
|
|
587
|
-
}), {
|
|
588
|
-
bodyWidth: fe,
|
|
589
|
-
fixedTableHeight: se,
|
|
590
|
-
mainTableHeight: re,
|
|
591
|
-
leftTableWidth: me,
|
|
592
|
-
rightTableWidth: ie,
|
|
593
|
-
windowHeight: ve,
|
|
594
|
-
footerHeight: Z,
|
|
595
|
-
emptyStyle: ge,
|
|
596
|
-
rootStyle: Te,
|
|
597
|
-
headerHeight: ye
|
|
598
|
-
} = To(e, {
|
|
599
|
-
columnsTotalWidth: s,
|
|
600
|
-
fixedColumnsOnLeft: c,
|
|
601
|
-
fixedColumnsOnRight: m,
|
|
602
|
-
rowsHeight: le
|
|
603
|
-
}), Le = F(), Ge = E(() => {
|
|
604
|
-
const q = n(V).length === 0;
|
|
605
|
-
return We(e.fixedData) ? e.fixedData.length === 0 && q : q;
|
|
606
|
-
});
|
|
607
|
-
function ke(q) {
|
|
608
|
-
const { estimatedRowHeight: oe, rowHeight: ce, rowKey: T } = e;
|
|
609
|
-
return oe ? n(x)[n(V)[q][T]] || oe : ce;
|
|
794
|
+
case ke:
|
|
795
|
+
return Math.round(m + (i - m) / 2);
|
|
796
|
+
case pe:
|
|
797
|
+
default:
|
|
798
|
+
return o >= m && o <= i ? o : m > i || o < m ? m : i;
|
|
610
799
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
800
|
+
}, xo = gn({
|
|
801
|
+
name: "ElDynamicSizeGrid",
|
|
802
|
+
getColumnPosition: (e, t, n) => {
|
|
803
|
+
const o = ye(e, t, n, "column");
|
|
804
|
+
return [o.size, o.offset];
|
|
805
|
+
},
|
|
806
|
+
getRowPosition: (e, t, n) => {
|
|
807
|
+
const o = ye(e, t, n, "row");
|
|
808
|
+
return [o.size, o.offset];
|
|
809
|
+
},
|
|
810
|
+
getColumnOffset: (e, t, n, o, r, a) => Xt(e, t, n, o, r, "column", a),
|
|
811
|
+
getRowOffset: (e, t, n, o, r, a) => Xt(e, t, n, o, r, "row", a),
|
|
812
|
+
getColumnStartIndexForOffset: (e, t, n) => Yt(e, n, t, "column"),
|
|
813
|
+
getColumnStopIndexForStartIndex: (e, t, n, o) => {
|
|
814
|
+
const r = ye(e, t, o, "column"), a = n + e.width;
|
|
815
|
+
let s = r.offset + r.size, h = t;
|
|
816
|
+
for (; h < e.totalColumn - 1 && s < a; )
|
|
817
|
+
h++, s += ye(e, t, o, "column").size;
|
|
818
|
+
return h;
|
|
819
|
+
},
|
|
820
|
+
getEstimatedTotalHeight: vn,
|
|
821
|
+
getEstimatedTotalWidth: Sn,
|
|
822
|
+
getRowStartIndexForOffset: (e, t, n) => Yt(e, n, t, "row"),
|
|
823
|
+
getRowStopIndexForStartIndex: (e, t, n, o) => {
|
|
824
|
+
const { totalRow: r, height: a } = e, s = ye(e, t, o, "row"), h = n + a;
|
|
825
|
+
let g = s.size + s.offset, f = t;
|
|
826
|
+
for (; f < r - 1 && g < h; )
|
|
827
|
+
f++, g += ye(e, f, o, "row").size;
|
|
828
|
+
return f;
|
|
829
|
+
},
|
|
830
|
+
injectToInstance: (e, t) => {
|
|
831
|
+
const n = ({ columnIndex: a, rowIndex: s }, h) => {
|
|
832
|
+
var g, f;
|
|
833
|
+
h = Pn(h) ? !0 : h, X(a) && (t.value.lastVisitedColumnIndex = Math.min(t.value.lastVisitedColumnIndex, a - 1)), X(s) && (t.value.lastVisitedRowIndex = Math.min(t.value.lastVisitedRowIndex, s - 1)), (g = e.exposed) == null || g.getItemStyleCache.value(-1, null, null), h && ((f = e.proxy) == null || f.$forceUpdate());
|
|
834
|
+
}, o = (a, s) => {
|
|
835
|
+
n({ columnIndex: a }, s);
|
|
836
|
+
}, r = (a, s) => {
|
|
837
|
+
n({ rowIndex: a }, s);
|
|
838
|
+
};
|
|
839
|
+
Object.assign(e.proxy, {
|
|
840
|
+
resetAfterColumnIndex: o,
|
|
841
|
+
resetAfterRowIndex: r,
|
|
842
|
+
resetAfter: n
|
|
843
|
+
});
|
|
844
|
+
},
|
|
845
|
+
initCache: ({ estimatedColumnWidth: e = 50, estimatedRowHeight: t = 50 }) => ({
|
|
846
|
+
column: {},
|
|
847
|
+
estimatedColumnWidth: e,
|
|
848
|
+
estimatedRowHeight: t,
|
|
849
|
+
lastVisitedColumnIndex: -1,
|
|
850
|
+
lastVisitedRowIndex: -1,
|
|
851
|
+
row: {}
|
|
852
|
+
}),
|
|
853
|
+
clearCache: !1,
|
|
854
|
+
validateProps: ({ columnWidth: e, rowHeight: t }) => {
|
|
855
|
+
$e(e) || ot(Ut, `
|
|
856
|
+
"columnWidth" must be passed as function,
|
|
857
|
+
instead ${typeof e} was given.
|
|
858
|
+
`), $e(t) || ot(Ut, `
|
|
859
|
+
"rowHeight" must be passed as function,
|
|
860
|
+
instead ${typeof t} was given.
|
|
861
|
+
`);
|
|
618
862
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
mainTableRef: t,
|
|
625
|
-
leftTableRef: l,
|
|
626
|
-
rightTableRef: o,
|
|
627
|
-
isDynamic: z,
|
|
628
|
-
isResetting: G,
|
|
629
|
-
isScrolling: M,
|
|
630
|
-
hasFixedColumns: f,
|
|
631
|
-
columnsStyles: r,
|
|
632
|
-
columnsTotalWidth: s,
|
|
633
|
-
data: V,
|
|
634
|
-
expandedRowKeys: R,
|
|
635
|
-
depthMap: U,
|
|
636
|
-
fixedColumnsOnLeft: c,
|
|
637
|
-
fixedColumnsOnRight: m,
|
|
638
|
-
mainColumns: u,
|
|
639
|
-
bodyWidth: fe,
|
|
640
|
-
emptyStyle: ge,
|
|
641
|
-
rootStyle: Te,
|
|
642
|
-
footerHeight: Z,
|
|
643
|
-
mainTableHeight: re,
|
|
644
|
-
fixedTableHeight: se,
|
|
645
|
-
leftTableWidth: me,
|
|
646
|
-
rightTableWidth: ie,
|
|
647
|
-
showEmpty: Ge,
|
|
648
|
-
getRowHeight: ke,
|
|
649
|
-
onColumnSorted: v,
|
|
650
|
-
onRowHovered: j,
|
|
651
|
-
onRowExpanded: W,
|
|
652
|
-
onRowsRendered: B,
|
|
653
|
-
onRowHeightChange: N,
|
|
654
|
-
scrollTo: b,
|
|
655
|
-
scrollToLeft: y,
|
|
656
|
-
scrollToTop: w,
|
|
657
|
-
scrollToRow: h,
|
|
658
|
-
onScroll: d,
|
|
659
|
-
onVerticalScroll: i
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
const _t = Symbol("tableV2"), wl = "tableV2GridScrollLeft", bl = String, Ze = {
|
|
663
|
-
type: I(Array),
|
|
863
|
+
}), Tt = {
|
|
864
|
+
asc: "desc",
|
|
865
|
+
desc: "asc"
|
|
866
|
+
}, qe = Symbol("placeholder"), xn = String, Ye = {
|
|
867
|
+
type: A(Array),
|
|
664
868
|
required: !0
|
|
665
|
-
},
|
|
666
|
-
|
|
667
|
-
}, Sl = {
|
|
668
|
-
...Ct,
|
|
869
|
+
}, pt = { type: A(Array) }, Rn = {
|
|
870
|
+
...pt,
|
|
669
871
|
required: !0
|
|
670
|
-
},
|
|
671
|
-
type:
|
|
672
|
-
default: () =>
|
|
673
|
-
},
|
|
872
|
+
}, Ro = String, Zt = {
|
|
873
|
+
type: A(Array),
|
|
874
|
+
default: () => ln([])
|
|
875
|
+
}, Me = {
|
|
674
876
|
type: Number,
|
|
675
877
|
required: !0
|
|
676
|
-
},
|
|
677
|
-
type:
|
|
878
|
+
}, Tn = {
|
|
879
|
+
type: A([
|
|
880
|
+
String,
|
|
881
|
+
Number,
|
|
882
|
+
Symbol
|
|
883
|
+
]),
|
|
678
884
|
default: "id"
|
|
679
|
-
},
|
|
680
|
-
type: I(Object)
|
|
681
|
-
}, pe = ae({
|
|
885
|
+
}, Jt = { type: A(Object) }, _e = ie({
|
|
682
886
|
class: String,
|
|
683
|
-
columns:
|
|
887
|
+
columns: Ye,
|
|
684
888
|
columnsStyles: {
|
|
685
|
-
type:
|
|
889
|
+
type: A(Object),
|
|
686
890
|
required: !0
|
|
687
891
|
},
|
|
688
892
|
depth: Number,
|
|
689
|
-
expandColumnKey:
|
|
893
|
+
expandColumnKey: Ro,
|
|
690
894
|
estimatedRowHeight: {
|
|
691
|
-
...
|
|
895
|
+
...Ae.estimatedRowHeight,
|
|
692
896
|
default: void 0
|
|
693
897
|
},
|
|
694
898
|
isScrolling: Boolean,
|
|
695
|
-
onRowExpand: {
|
|
696
|
-
|
|
697
|
-
},
|
|
698
|
-
onRowHover: {
|
|
699
|
-
type: I(Function)
|
|
700
|
-
},
|
|
701
|
-
onRowHeightChange: {
|
|
702
|
-
type: I(Function)
|
|
703
|
-
},
|
|
899
|
+
onRowExpand: { type: A(Function) },
|
|
900
|
+
onRowHover: { type: A(Function) },
|
|
901
|
+
onRowHeightChange: { type: A(Function) },
|
|
704
902
|
rowData: {
|
|
705
|
-
type:
|
|
903
|
+
type: A(Object),
|
|
706
904
|
required: !0
|
|
707
905
|
},
|
|
708
|
-
rowEventHandlers: {
|
|
709
|
-
type: I(Object)
|
|
710
|
-
},
|
|
906
|
+
rowEventHandlers: { type: A(Object) },
|
|
711
907
|
rowIndex: {
|
|
712
908
|
type: Number,
|
|
713
909
|
required: !0
|
|
714
910
|
},
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
911
|
+
/**
|
|
912
|
+
* Unique item key
|
|
913
|
+
*/
|
|
914
|
+
rowKey: Tn,
|
|
915
|
+
style: { type: A(Object) }
|
|
916
|
+
}), ht = {
|
|
720
917
|
type: Number,
|
|
721
918
|
required: !0
|
|
722
|
-
},
|
|
919
|
+
}, _t = ie({
|
|
723
920
|
class: String,
|
|
724
|
-
columns:
|
|
725
|
-
fixedHeaderData: {
|
|
726
|
-
type: I(Array)
|
|
727
|
-
},
|
|
921
|
+
columns: Ye,
|
|
922
|
+
fixedHeaderData: { type: A(Array) },
|
|
728
923
|
headerData: {
|
|
729
|
-
type:
|
|
924
|
+
type: A(Array),
|
|
730
925
|
required: !0
|
|
731
926
|
},
|
|
732
927
|
headerHeight: {
|
|
733
|
-
type:
|
|
928
|
+
type: A([Number, Array]),
|
|
734
929
|
default: 50
|
|
735
930
|
},
|
|
736
|
-
rowWidth:
|
|
931
|
+
rowWidth: ht,
|
|
737
932
|
rowHeight: {
|
|
738
933
|
type: Number,
|
|
739
934
|
default: 50
|
|
740
935
|
},
|
|
741
|
-
height:
|
|
742
|
-
width:
|
|
743
|
-
}), tt =
|
|
744
|
-
columns:
|
|
745
|
-
data:
|
|
746
|
-
fixedData:
|
|
747
|
-
estimatedRowHeight:
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
936
|
+
height: ht,
|
|
937
|
+
width: ht
|
|
938
|
+
}), tt = ie({
|
|
939
|
+
columns: Ye,
|
|
940
|
+
data: Rn,
|
|
941
|
+
fixedData: pt,
|
|
942
|
+
estimatedRowHeight: _e.estimatedRowHeight,
|
|
943
|
+
/**
|
|
944
|
+
* Size related attributes
|
|
945
|
+
*/
|
|
946
|
+
width: Me,
|
|
947
|
+
height: Me,
|
|
948
|
+
headerWidth: Me,
|
|
949
|
+
headerHeight: _t.headerHeight,
|
|
950
|
+
bodyWidth: Me,
|
|
951
|
+
rowHeight: Me,
|
|
952
|
+
/**
|
|
953
|
+
* Special attributes
|
|
954
|
+
*/
|
|
955
|
+
cache: co.cache,
|
|
755
956
|
useIsScrolling: Boolean,
|
|
756
|
-
scrollbarAlwaysOn:
|
|
757
|
-
scrollbarStartGap:
|
|
758
|
-
scrollbarEndGap:
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
957
|
+
scrollbarAlwaysOn: Ae.scrollbarAlwaysOn,
|
|
958
|
+
scrollbarStartGap: Ae.scrollbarStartGap,
|
|
959
|
+
scrollbarEndGap: Ae.scrollbarEndGap,
|
|
960
|
+
/**
|
|
961
|
+
* CSS attributes
|
|
962
|
+
*/
|
|
963
|
+
class: xn,
|
|
964
|
+
style: Jt,
|
|
965
|
+
containerStyle: Jt,
|
|
762
966
|
getRowHeight: {
|
|
763
|
-
type:
|
|
967
|
+
type: A(Function),
|
|
764
968
|
required: !0
|
|
765
969
|
},
|
|
766
|
-
rowKey:
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
}), Co = ae({
|
|
970
|
+
rowKey: _e.rowKey,
|
|
971
|
+
/**
|
|
972
|
+
* Event handlers
|
|
973
|
+
*/
|
|
974
|
+
onRowsRendered: { type: A(Function) },
|
|
975
|
+
onScroll: { type: A(Function) }
|
|
976
|
+
}), To = ie({
|
|
774
977
|
cache: tt.cache,
|
|
775
|
-
estimatedRowHeight:
|
|
776
|
-
rowKey:
|
|
777
|
-
headerClass: {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
type: I([
|
|
785
|
-
Object,
|
|
786
|
-
Function
|
|
787
|
-
])
|
|
788
|
-
},
|
|
789
|
-
headerCellProps: {
|
|
790
|
-
type: I([
|
|
791
|
-
Object,
|
|
792
|
-
Function
|
|
793
|
-
])
|
|
794
|
-
},
|
|
795
|
-
headerHeight: Ht.headerHeight,
|
|
978
|
+
estimatedRowHeight: _e.estimatedRowHeight,
|
|
979
|
+
rowKey: Tn,
|
|
980
|
+
headerClass: { type: A([String, Function]) },
|
|
981
|
+
headerProps: { type: A([Object, Function]) },
|
|
982
|
+
headerCellProps: { type: A([Object, Function]) },
|
|
983
|
+
headerHeight: _t.headerHeight,
|
|
984
|
+
/**
|
|
985
|
+
* Footer attributes
|
|
986
|
+
*/
|
|
796
987
|
footerHeight: {
|
|
797
988
|
type: Number,
|
|
798
989
|
default: 0
|
|
799
990
|
},
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
},
|
|
991
|
+
/**
|
|
992
|
+
* Row attributes
|
|
993
|
+
*/
|
|
994
|
+
rowClass: { type: A([String, Function]) },
|
|
995
|
+
rowProps: { type: A([Object, Function]) },
|
|
806
996
|
rowHeight: {
|
|
807
997
|
type: Number,
|
|
808
998
|
default: 50
|
|
809
999
|
},
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
1000
|
+
/**
|
|
1001
|
+
* Cell attributes
|
|
1002
|
+
*/
|
|
1003
|
+
cellProps: { type: A([Object, Function]) },
|
|
1004
|
+
/**
|
|
1005
|
+
* Data models
|
|
1006
|
+
*/
|
|
1007
|
+
columns: Ye,
|
|
1008
|
+
data: Rn,
|
|
1009
|
+
dataGetter: { type: A(Function) },
|
|
1010
|
+
fixedData: pt,
|
|
1011
|
+
/**
|
|
1012
|
+
* Expanded keys
|
|
1013
|
+
*/
|
|
1014
|
+
expandColumnKey: _e.expandColumnKey,
|
|
1015
|
+
expandedRowKeys: Zt,
|
|
1016
|
+
defaultExpandedRowKeys: Zt,
|
|
1017
|
+
/**
|
|
1018
|
+
* Attributes
|
|
1019
|
+
*/
|
|
1020
|
+
class: xn,
|
|
826
1021
|
fixed: Boolean,
|
|
827
|
-
style: {
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
width: Ce,
|
|
831
|
-
height: Ce,
|
|
1022
|
+
style: { type: A(Object) },
|
|
1023
|
+
width: Me,
|
|
1024
|
+
height: Me,
|
|
832
1025
|
maxHeight: Number,
|
|
833
1026
|
useIsScrolling: Boolean,
|
|
834
1027
|
indentSize: {
|
|
@@ -839,855 +1032,579 @@ const _t = Symbol("tableV2"), wl = "tableV2GridScrollLeft", bl = String, Ze = {
|
|
|
839
1032
|
type: Number,
|
|
840
1033
|
default: 12
|
|
841
1034
|
},
|
|
842
|
-
hScrollbarSize:
|
|
843
|
-
vScrollbarSize:
|
|
844
|
-
scrollbarAlwaysOn:
|
|
1035
|
+
hScrollbarSize: Ae.hScrollbarSize,
|
|
1036
|
+
vScrollbarSize: Ae.vScrollbarSize,
|
|
1037
|
+
scrollbarAlwaysOn: mn.alwaysOn,
|
|
1038
|
+
/**
|
|
1039
|
+
* Sorting
|
|
1040
|
+
*/
|
|
845
1041
|
sortBy: {
|
|
846
|
-
type:
|
|
1042
|
+
type: A(Object),
|
|
847
1043
|
default: () => ({})
|
|
848
1044
|
},
|
|
849
1045
|
sortState: {
|
|
850
|
-
type:
|
|
1046
|
+
type: A(Object),
|
|
851
1047
|
default: void 0
|
|
852
1048
|
},
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
},
|
|
859
|
-
|
|
860
|
-
type: I(Function)
|
|
861
|
-
},
|
|
862
|
-
onRowExpand: pe.onRowExpand,
|
|
1049
|
+
/**
|
|
1050
|
+
* Handlers
|
|
1051
|
+
*/
|
|
1052
|
+
onColumnSort: { type: A(Function) },
|
|
1053
|
+
onExpandedRowsChange: { type: A(Function) },
|
|
1054
|
+
onEndReached: { type: A(Function) },
|
|
1055
|
+
onRowExpand: _e.onRowExpand,
|
|
863
1056
|
onScroll: tt.onScroll,
|
|
864
1057
|
onRowsRendered: tt.onRowsRendered,
|
|
865
|
-
rowEventHandlers:
|
|
866
|
-
}),
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
1058
|
+
rowEventHandlers: _e.rowEventHandlers
|
|
1059
|
+
}), Eo = (e, t, n) => {
|
|
1060
|
+
const o = {
|
|
1061
|
+
flexGrow: 0,
|
|
1062
|
+
flexShrink: 0,
|
|
1063
|
+
...n ? {} : {
|
|
1064
|
+
flexGrow: e.flexGrow ?? 0,
|
|
1065
|
+
flexShrink: e.flexShrink ?? 1
|
|
1066
|
+
}
|
|
1067
|
+
}, r = {
|
|
1068
|
+
...e.style ?? {},
|
|
1069
|
+
...o,
|
|
1070
|
+
flexBasis: "auto",
|
|
1071
|
+
width: e.width
|
|
1072
|
+
};
|
|
1073
|
+
return t || (e.maxWidth && (r.maxWidth = e.maxWidth), e.minWidth && (r.minWidth = e.minWidth)), r;
|
|
1074
|
+
};
|
|
1075
|
+
function Co(e, t, n) {
|
|
1076
|
+
const o = T(() => l(t).map((u, d) => ({
|
|
1077
|
+
...u,
|
|
1078
|
+
key: u.key ?? u.dataKey ?? d
|
|
1079
|
+
}))), r = T(() => l(o).filter((u) => !u.hidden)), a = T(() => l(r).filter((u) => u.fixed === "left" || u.fixed === !0)), s = T(() => l(r).filter((u) => u.fixed === "right")), h = T(() => l(r).filter((u) => !u.fixed)), g = T(() => {
|
|
1080
|
+
const u = [];
|
|
1081
|
+
return l(a).forEach((d) => {
|
|
1082
|
+
u.push({
|
|
1083
|
+
...d,
|
|
1084
|
+
placeholderSign: qe
|
|
1085
|
+
});
|
|
1086
|
+
}), l(h).forEach((d) => {
|
|
1087
|
+
u.push(d);
|
|
1088
|
+
}), l(s).forEach((d) => {
|
|
1089
|
+
u.push({
|
|
1090
|
+
...d,
|
|
1091
|
+
placeholderSign: qe
|
|
1092
|
+
});
|
|
1093
|
+
}), u;
|
|
1094
|
+
}), f = T(() => l(a).length || l(s).length), i = T(() => l(o).reduce((u, d) => (u[d.key] = Eo(d, l(n), e.fixed), u), {})), m = T(() => l(r).reduce((u, d) => u + d.width, 0)), v = (u) => l(o).find((d) => d.key === u), b = (u) => l(i)[u], y = (u, d) => {
|
|
1095
|
+
u.width = d;
|
|
1096
|
+
};
|
|
1097
|
+
function c(u) {
|
|
1098
|
+
var p;
|
|
1099
|
+
const { key: d } = u.currentTarget.dataset;
|
|
1100
|
+
if (!d)
|
|
1101
|
+
return;
|
|
1102
|
+
const { sortState: w, sortBy: x } = e;
|
|
1103
|
+
let M = "asc";
|
|
1104
|
+
Ct(w) ? M = Tt[w[d]] : M = Tt[x.order], (p = e.onColumnSort) == null || p.call(e, {
|
|
1105
|
+
column: v(d),
|
|
1106
|
+
key: d,
|
|
1107
|
+
order: M
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
return {
|
|
1111
|
+
columns: o,
|
|
1112
|
+
columnsStyles: i,
|
|
1113
|
+
columnsTotalWidth: m,
|
|
1114
|
+
fixedColumnsOnLeft: a,
|
|
1115
|
+
fixedColumnsOnRight: s,
|
|
1116
|
+
hasFixedColumns: f,
|
|
1117
|
+
mainColumns: g,
|
|
1118
|
+
normalColumns: h,
|
|
1119
|
+
visibleColumns: r,
|
|
1120
|
+
getColumn: v,
|
|
1121
|
+
getColumnStyle: b,
|
|
1122
|
+
updateColumnWidth: y,
|
|
1123
|
+
onColumnSorted: c
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
const Ho = (e, { mainTableRef: t, leftTableRef: n, rightTableRef: o, onMaybeEndReached: r }) => {
|
|
1127
|
+
const a = P({
|
|
1128
|
+
scrollLeft: 0,
|
|
1129
|
+
scrollTop: 0
|
|
1130
|
+
});
|
|
1131
|
+
function s(b) {
|
|
1132
|
+
var c, u, d;
|
|
1133
|
+
const { scrollTop: y } = b;
|
|
1134
|
+
(c = t.value) == null || c.scrollTo(b), (u = n.value) == null || u.scrollToTop(y), (d = o.value) == null || d.scrollToTop(y);
|
|
1135
|
+
}
|
|
1136
|
+
function h(b) {
|
|
1137
|
+
a.value = b, s(b);
|
|
1138
|
+
}
|
|
1139
|
+
function g(b) {
|
|
1140
|
+
a.value.scrollTop = b, s(l(a));
|
|
1141
|
+
}
|
|
1142
|
+
function f(b) {
|
|
1143
|
+
var y, c;
|
|
1144
|
+
a.value.scrollLeft = b, (c = (y = t.value) == null ? void 0 : y.scrollTo) == null || c.call(y, l(a));
|
|
1145
|
+
}
|
|
1146
|
+
function i(b) {
|
|
1147
|
+
var y;
|
|
1148
|
+
h(b), (y = e.onScroll) == null || y.call(e, b);
|
|
1149
|
+
}
|
|
1150
|
+
function m({ scrollTop: b }) {
|
|
1151
|
+
const { scrollTop: y } = l(a);
|
|
1152
|
+
b !== y && g(b);
|
|
1153
|
+
}
|
|
1154
|
+
function v(b, y = "auto") {
|
|
1155
|
+
var c;
|
|
1156
|
+
(c = t.value) == null || c.scrollToRow(b, y);
|
|
1157
|
+
}
|
|
1158
|
+
return Se(() => l(a).scrollTop, (b, y) => {
|
|
1159
|
+
b > y && r();
|
|
1160
|
+
}), {
|
|
1161
|
+
scrollPos: a,
|
|
1162
|
+
scrollTo: h,
|
|
1163
|
+
scrollToLeft: f,
|
|
1164
|
+
scrollToTop: g,
|
|
1165
|
+
scrollToRow: v,
|
|
1166
|
+
onScroll: i,
|
|
1167
|
+
onVerticalScroll: m
|
|
1168
|
+
};
|
|
1169
|
+
}, Mo = (e, { mainTableRef: t, leftTableRef: n, rightTableRef: o, tableInstance: r, ns: a, isScrolling: s }) => {
|
|
1170
|
+
const h = st(), { emit: g } = h, f = We(!1), i = P(e.defaultExpandedRowKeys || []), m = P(-1), v = We(null), b = P({}), y = P({}), c = We({}), u = We({}), d = We({}), w = T(() => X(e.estimatedRowHeight));
|
|
1171
|
+
function x(R) {
|
|
1172
|
+
var L;
|
|
1173
|
+
(L = e.onRowsRendered) == null || L.call(e, R), R.rowCacheEnd > l(m) && (m.value = R.rowCacheEnd);
|
|
1174
|
+
}
|
|
1175
|
+
function M({ hovered: R, rowKey: L }) {
|
|
1176
|
+
s.value || r.vnode.el.querySelectorAll(`[rowkey="${String(L)}"]`).forEach((F) => {
|
|
1177
|
+
R ? F.classList.add(a.is("hovered")) : F.classList.remove(a.is("hovered"));
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
function p({ expanded: R, rowData: L, rowIndex: F, rowKey: z }) {
|
|
1181
|
+
var j, U;
|
|
1182
|
+
const K = [...l(i)], B = K.indexOf(z);
|
|
1183
|
+
R ? B === -1 && K.push(z) : B > -1 && K.splice(B, 1), i.value = K, g("update:expandedRowKeys", K), (j = e.onRowExpand) == null || j.call(e, {
|
|
1184
|
+
expanded: R,
|
|
1185
|
+
rowData: L,
|
|
1186
|
+
rowIndex: F,
|
|
1187
|
+
rowKey: z
|
|
1188
|
+
}), (U = e.onExpandedRowsChange) == null || U.call(e, K), r.vnode.el.querySelector(`.${a.is("hovered")}[rowkey="${String(z)}"]`) && ve(() => M({
|
|
1189
|
+
hovered: !0,
|
|
1190
|
+
rowKey: z
|
|
1191
|
+
}));
|
|
1192
|
+
}
|
|
1193
|
+
const S = Yn(() => {
|
|
1194
|
+
var R, L, F, z;
|
|
1195
|
+
f.value = !0, b.value = {
|
|
1196
|
+
...l(b),
|
|
1197
|
+
...l(y)
|
|
1198
|
+
}, W(l(v), !1), y.value = {}, v.value = null, (R = t.value) == null || R.forceUpdate(), (L = n.value) == null || L.forceUpdate(), (F = o.value) == null || F.forceUpdate(), (z = h.proxy) == null || z.$forceUpdate(), f.value = !1;
|
|
1199
|
+
}, 0);
|
|
1200
|
+
function W(R, L = !1) {
|
|
1201
|
+
l(w) && [
|
|
1202
|
+
t,
|
|
1203
|
+
n,
|
|
1204
|
+
o
|
|
1205
|
+
].forEach((F) => {
|
|
1206
|
+
const z = l(F);
|
|
1207
|
+
z && z.resetAfterRowIndex(R, L);
|
|
1208
|
+
});
|
|
1209
|
+
}
|
|
1210
|
+
function k(R, L, F) {
|
|
1211
|
+
const z = l(v);
|
|
1212
|
+
(z === null || z > F) && (v.value = F), y.value[R] = L;
|
|
1213
|
+
}
|
|
1214
|
+
function G({ rowKey: R, height: L, rowIndex: F }, z) {
|
|
1215
|
+
z ? z === "right" ? d.value[R] = L : c.value[R] = L : u.value[R] = L;
|
|
1216
|
+
const K = Math.max(...[
|
|
1217
|
+
c,
|
|
1218
|
+
d,
|
|
1219
|
+
u
|
|
1220
|
+
].map((B) => B.value[R] || 0));
|
|
1221
|
+
l(b)[R] !== K && (k(R, K, F), S());
|
|
1222
|
+
}
|
|
1223
|
+
return {
|
|
1224
|
+
expandedRowKeys: i,
|
|
1225
|
+
lastRenderedRowIndex: m,
|
|
1226
|
+
isDynamic: w,
|
|
1227
|
+
isResetting: f,
|
|
1228
|
+
rowHeights: b,
|
|
1229
|
+
resetAfterIndex: W,
|
|
1230
|
+
onRowExpanded: p,
|
|
1231
|
+
onRowHovered: M,
|
|
1232
|
+
onRowsRendered: x,
|
|
1233
|
+
onRowHeightChange: G
|
|
1234
|
+
};
|
|
1235
|
+
}, po = (e, { expandedRowKeys: t, lastRenderedRowIndex: n, resetAfterIndex: o }) => {
|
|
1236
|
+
const r = P({}), a = T(() => {
|
|
1237
|
+
const h = {}, { data: g, rowKey: f } = e, i = l(t);
|
|
1238
|
+
if (!i || !i.length)
|
|
1239
|
+
return g;
|
|
1240
|
+
const m = [], v = /* @__PURE__ */ new Set();
|
|
1241
|
+
i.forEach((y) => v.add(y));
|
|
1242
|
+
let b = g.slice();
|
|
1243
|
+
for (b.forEach((y) => h[y[f]] = 0); b.length > 0; ) {
|
|
1244
|
+
const y = b.shift();
|
|
1245
|
+
m.push(y), v.has(y[f]) && Ve(y.children) && y.children.length > 0 && (b = [...y.children, ...b], y.children.forEach((c) => h[c[f]] = h[y[f]] + 1));
|
|
1246
|
+
}
|
|
1247
|
+
return r.value = h, m;
|
|
1248
|
+
}), s = T(() => {
|
|
1249
|
+
const { data: h, expandColumnKey: g } = e;
|
|
1250
|
+
return g ? l(a) : h;
|
|
1251
|
+
});
|
|
1252
|
+
return Se(s, (h, g) => {
|
|
1253
|
+
h !== g && (n.value = -1, o(0, !0));
|
|
1254
|
+
}), {
|
|
1255
|
+
data: s,
|
|
1256
|
+
depthMap: r
|
|
1257
|
+
};
|
|
1258
|
+
}, _o = (e, t) => e + t, nt = (e) => Ve(e) ? e.reduce(_o, 0) : e, Le = (e, t, n = {}) => $e(e) ? e(t) : e ?? n, we = (e) => ([
|
|
1259
|
+
"width",
|
|
1260
|
+
"maxWidth",
|
|
1261
|
+
"minWidth",
|
|
1262
|
+
"height"
|
|
1263
|
+
].forEach((t) => {
|
|
1264
|
+
e[t] = et(e[t]);
|
|
1265
|
+
}), e), En = (e) => ze(e) ? (t) => ge(e, t) : e, Ao = (e, { columnsTotalWidth: t, rowsHeight: n, fixedColumnsOnLeft: o, fixedColumnsOnRight: r }) => {
|
|
1266
|
+
const a = T(() => {
|
|
1267
|
+
const { fixed: c, width: u, vScrollbarSize: d } = e, w = u - d;
|
|
1268
|
+
return c ? Math.max(Math.round(l(t)), w) : w;
|
|
1269
|
+
}), s = T(() => {
|
|
1270
|
+
const { height: c = 0, maxHeight: u = 0, footerHeight: d, hScrollbarSize: w } = e;
|
|
1271
|
+
if (u > 0) {
|
|
1272
|
+
const x = l(v), M = l(n), p = l(m) + x + M + w;
|
|
1273
|
+
return Math.min(p, u - d);
|
|
1274
|
+
}
|
|
1275
|
+
return c - d;
|
|
1276
|
+
}), h = T(() => {
|
|
1277
|
+
const { maxHeight: c } = e, u = l(s);
|
|
1278
|
+
if (X(c) && c > 0)
|
|
1279
|
+
return u;
|
|
1280
|
+
const d = l(n) + l(m) + l(v);
|
|
1281
|
+
return Math.min(u, d);
|
|
1282
|
+
}), g = (c) => c.width, f = T(() => nt(l(o).map(g))), i = T(() => nt(l(r).map(g))), m = T(() => nt(e.headerHeight)), v = T(() => {
|
|
1283
|
+
var c;
|
|
1284
|
+
return (((c = e.fixedData) == null ? void 0 : c.length) || 0) * e.rowHeight;
|
|
1285
|
+
}), b = T(() => l(s) - l(m) - l(v)), y = T(() => {
|
|
1286
|
+
const { style: c = {}, height: u, width: d } = e;
|
|
1287
|
+
return we({
|
|
1288
|
+
...c,
|
|
1289
|
+
height: u,
|
|
1290
|
+
width: d
|
|
1291
|
+
});
|
|
1292
|
+
});
|
|
1293
|
+
return {
|
|
1294
|
+
bodyWidth: a,
|
|
1295
|
+
fixedTableHeight: h,
|
|
1296
|
+
mainTableHeight: s,
|
|
1297
|
+
leftTableWidth: f,
|
|
1298
|
+
rightTableWidth: i,
|
|
1299
|
+
windowHeight: b,
|
|
1300
|
+
footerHeight: T(() => we({ height: e.footerHeight })),
|
|
1301
|
+
emptyStyle: T(() => ({
|
|
1302
|
+
top: et(l(m)),
|
|
1303
|
+
bottom: et(e.footerHeight),
|
|
1304
|
+
width: et(e.width)
|
|
1305
|
+
})),
|
|
1306
|
+
rootStyle: y,
|
|
1307
|
+
headerHeight: m
|
|
1308
|
+
};
|
|
1309
|
+
};
|
|
1310
|
+
function Oo(e) {
|
|
1311
|
+
const t = P(), n = P(), o = P(), { columns: r, columnsStyles: a, columnsTotalWidth: s, fixedColumnsOnLeft: h, fixedColumnsOnRight: g, hasFixedColumns: f, mainColumns: i, onColumnSorted: m } = Co(e, Pt(e, "columns"), Pt(e, "fixed")), { scrollTo: v, scrollToLeft: b, scrollToTop: y, scrollToRow: c, onScroll: u, onVerticalScroll: d, scrollPos: w } = Ho(e, {
|
|
1312
|
+
mainTableRef: t,
|
|
1313
|
+
leftTableRef: n,
|
|
1314
|
+
rightTableRef: o,
|
|
1315
|
+
onMaybeEndReached: De
|
|
1316
|
+
}), x = Oe("table-v2"), M = st(), p = We(!1), { expandedRowKeys: S, lastRenderedRowIndex: W, isDynamic: k, isResetting: G, rowHeights: R, resetAfterIndex: L, onRowExpanded: F, onRowHeightChange: z, onRowHovered: K, onRowsRendered: B } = Mo(e, {
|
|
1317
|
+
mainTableRef: t,
|
|
1318
|
+
leftTableRef: n,
|
|
1319
|
+
rightTableRef: o,
|
|
1320
|
+
tableInstance: M,
|
|
1321
|
+
ns: x,
|
|
1322
|
+
isScrolling: p
|
|
1323
|
+
}), { data: j, depthMap: U } = po(e, {
|
|
1324
|
+
expandedRowKeys: S,
|
|
1325
|
+
lastRenderedRowIndex: W,
|
|
1326
|
+
resetAfterIndex: L
|
|
1327
|
+
}), re = T(() => {
|
|
1328
|
+
const { estimatedRowHeight: Z, rowHeight: Q } = e, ce = l(j);
|
|
1329
|
+
return X(Z) ? Object.values(l(R)).reduce((he, fe) => he + fe, 0) : ce.length * Q;
|
|
1330
|
+
}), { bodyWidth: Re, fixedTableHeight: ue, mainTableHeight: ae, leftTableWidth: Te, rightTableWidth: be, windowHeight: se, footerHeight: ee, emptyStyle: ne, rootStyle: Ne, headerHeight: Ee } = Ao(e, {
|
|
1331
|
+
columnsTotalWidth: s,
|
|
1332
|
+
fixedColumnsOnLeft: h,
|
|
1333
|
+
fixedColumnsOnRight: g,
|
|
1334
|
+
rowsHeight: re
|
|
1335
|
+
}), Ce = P(), Ge = T(() => {
|
|
1336
|
+
const Z = l(j).length === 0;
|
|
1337
|
+
return Ve(e.fixedData) ? e.fixedData.length === 0 && Z : Z;
|
|
1338
|
+
});
|
|
1339
|
+
function Ke(Z) {
|
|
1340
|
+
const { estimatedRowHeight: Q, rowHeight: ce, rowKey: he } = e;
|
|
1341
|
+
return Q ? l(R)[l(j)[Z][he]] || Q : ce;
|
|
1342
|
+
}
|
|
1343
|
+
const de = P(!1);
|
|
1344
|
+
function De() {
|
|
1345
|
+
const { onEndReached: Z } = e;
|
|
1346
|
+
if (!Z)
|
|
1347
|
+
return;
|
|
1348
|
+
const { scrollTop: Q } = l(w), ce = l(re), he = ce - (Q + l(se)) + e.hScrollbarSize;
|
|
1349
|
+
!de.value && l(W) >= 0 && ce <= Q + l(ae) - l(Ee) ? (de.value = !0, Z(he)) : de.value = !1;
|
|
1350
|
+
}
|
|
1351
|
+
return Se(() => l(re), () => de.value = !1), Se(() => e.expandedRowKeys, (Z) => S.value = Z, { deep: !0 }), {
|
|
1352
|
+
columns: r,
|
|
1353
|
+
containerRef: Ce,
|
|
1354
|
+
mainTableRef: t,
|
|
1355
|
+
leftTableRef: n,
|
|
1356
|
+
rightTableRef: o,
|
|
1357
|
+
isDynamic: k,
|
|
1358
|
+
isResetting: G,
|
|
1359
|
+
isScrolling: p,
|
|
1360
|
+
hasFixedColumns: f,
|
|
1361
|
+
columnsStyles: a,
|
|
1362
|
+
columnsTotalWidth: s,
|
|
1363
|
+
data: j,
|
|
1364
|
+
expandedRowKeys: S,
|
|
1365
|
+
depthMap: U,
|
|
1366
|
+
fixedColumnsOnLeft: h,
|
|
1367
|
+
fixedColumnsOnRight: g,
|
|
1368
|
+
mainColumns: i,
|
|
1369
|
+
bodyWidth: Re,
|
|
1370
|
+
emptyStyle: ne,
|
|
1371
|
+
rootStyle: Ne,
|
|
1372
|
+
footerHeight: ee,
|
|
1373
|
+
mainTableHeight: ae,
|
|
1374
|
+
fixedTableHeight: ue,
|
|
1375
|
+
leftTableWidth: Te,
|
|
1376
|
+
rightTableWidth: be,
|
|
1377
|
+
showEmpty: Ge,
|
|
1378
|
+
getRowHeight: Ke,
|
|
1379
|
+
onColumnSorted: m,
|
|
1380
|
+
onRowHovered: K,
|
|
1381
|
+
onRowExpanded: F,
|
|
1382
|
+
onRowsRendered: B,
|
|
1383
|
+
onRowHeightChange: z,
|
|
1384
|
+
scrollTo: v,
|
|
1385
|
+
scrollToLeft: b,
|
|
1386
|
+
scrollToTop: y,
|
|
1387
|
+
scrollToRow: c,
|
|
1388
|
+
onScroll: u,
|
|
1389
|
+
onVerticalScroll: d
|
|
1390
|
+
};
|
|
1391
|
+
}
|
|
1392
|
+
const At = Symbol("tableV2"), Cn = "tableV2GridScrollLeft", Lo = /* @__PURE__ */ xe({
|
|
1393
|
+
name: "ElTableV2Header",
|
|
1394
|
+
props: _t,
|
|
1395
|
+
setup(e, { slots: t, expose: n }) {
|
|
1396
|
+
const o = Oe("table-v2"), r = Ht(Cn), a = P(), s = T(() => we({
|
|
874
1397
|
width: e.width,
|
|
875
1398
|
height: e.height
|
|
876
|
-
})),
|
|
1399
|
+
})), h = T(() => we({
|
|
877
1400
|
width: e.rowWidth,
|
|
878
1401
|
height: e.height
|
|
879
|
-
})),
|
|
880
|
-
const
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
left: b
|
|
884
|
-
});
|
|
1402
|
+
})), g = T(() => Qn(l(e.headerHeight))), f = (v) => {
|
|
1403
|
+
const b = l(a);
|
|
1404
|
+
ve(() => {
|
|
1405
|
+
b != null && b.scroll && b.scroll({ left: v });
|
|
885
1406
|
});
|
|
886
|
-
},
|
|
887
|
-
const
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
return w == null ? void 0 : w.map((d, i) => {
|
|
893
|
-
var g;
|
|
894
|
-
const S = be({
|
|
895
|
-
height: h,
|
|
1407
|
+
}, i = () => {
|
|
1408
|
+
const v = o.e("fixed-header-row"), { columns: b, fixedHeaderData: y, rowHeight: c } = e;
|
|
1409
|
+
return y == null ? void 0 : y.map((u, d) => {
|
|
1410
|
+
var x;
|
|
1411
|
+
const w = we({
|
|
1412
|
+
height: c,
|
|
896
1413
|
width: "100%"
|
|
897
1414
|
});
|
|
898
|
-
return (
|
|
899
|
-
class:
|
|
900
|
-
columns:
|
|
901
|
-
rowData:
|
|
902
|
-
rowIndex: -(
|
|
903
|
-
style:
|
|
1415
|
+
return (x = t.fixed) == null ? void 0 : x.call(t, {
|
|
1416
|
+
class: v,
|
|
1417
|
+
columns: b,
|
|
1418
|
+
rowData: u,
|
|
1419
|
+
rowIndex: -(d + 1),
|
|
1420
|
+
style: w
|
|
904
1421
|
});
|
|
905
1422
|
});
|
|
906
|
-
},
|
|
907
|
-
const
|
|
908
|
-
|
|
909
|
-
} = e;
|
|
910
|
-
return n(m).map((w, h) => {
|
|
1423
|
+
}, m = () => {
|
|
1424
|
+
const v = o.e("dynamic-header-row"), { columns: b } = e;
|
|
1425
|
+
return l(g).map((y, c) => {
|
|
911
1426
|
var d;
|
|
912
|
-
const
|
|
1427
|
+
const u = we({
|
|
913
1428
|
width: "100%",
|
|
914
|
-
height:
|
|
1429
|
+
height: y
|
|
915
1430
|
});
|
|
916
1431
|
return (d = t.dynamic) == null ? void 0 : d.call(t, {
|
|
917
|
-
class:
|
|
918
|
-
columns:
|
|
919
|
-
headerIndex:
|
|
920
|
-
style:
|
|
1432
|
+
class: v,
|
|
1433
|
+
columns: b,
|
|
1434
|
+
headerIndex: c,
|
|
1435
|
+
style: u
|
|
921
1436
|
});
|
|
922
1437
|
});
|
|
923
1438
|
};
|
|
924
|
-
return
|
|
925
|
-
|
|
926
|
-
}),
|
|
1439
|
+
return Bn(() => {
|
|
1440
|
+
r != null && r.value && f(r.value);
|
|
1441
|
+
}), n({
|
|
1442
|
+
/**
|
|
1443
|
+
* @description scroll to position based on the provided value
|
|
1444
|
+
*/
|
|
927
1445
|
scrollToLeft: f
|
|
928
1446
|
}), () => {
|
|
929
1447
|
if (!(e.height <= 0))
|
|
930
|
-
return
|
|
931
|
-
ref:
|
|
1448
|
+
return E("div", {
|
|
1449
|
+
ref: a,
|
|
932
1450
|
class: e.class,
|
|
933
|
-
style:
|
|
1451
|
+
style: l(s),
|
|
934
1452
|
role: "rowgroup"
|
|
935
|
-
}, [
|
|
936
|
-
style:
|
|
1453
|
+
}, [E("div", {
|
|
1454
|
+
style: l(h),
|
|
937
1455
|
class: o.e("header")
|
|
938
|
-
}, [
|
|
939
|
-
};
|
|
940
|
-
}
|
|
941
|
-
});
|
|
942
|
-
var Mo = po;
|
|
943
|
-
const Io = ({ atXEndEdge: e, atXStartEdge: t, atYEndEdge: l, atYStartEdge: o }, a) => {
|
|
944
|
-
let r = null, s = 0, c = 0;
|
|
945
|
-
const m = (u, v) => {
|
|
946
|
-
const b = u <= 0 && t.value || u >= 0 && e.value, y = v <= 0 && o.value || v >= 0 && l.value;
|
|
947
|
-
return b && y;
|
|
948
|
-
};
|
|
949
|
-
return {
|
|
950
|
-
hasReachedEdge: m,
|
|
951
|
-
onWheel: (u) => {
|
|
952
|
-
ol(r);
|
|
953
|
-
let v = u.deltaX, b = u.deltaY;
|
|
954
|
-
Math.abs(v) > Math.abs(b) ? b = 0 : v = 0, u.shiftKey && b !== 0 && (v = b, b = 0), !(m(s, c) && m(s + v, c + b)) && (s += v, c += b, u.preventDefault(), r = nl(() => {
|
|
955
|
-
a(s, c), s = 0, c = 0;
|
|
956
|
-
}));
|
|
957
|
-
}
|
|
958
|
-
};
|
|
959
|
-
}, xl = ({
|
|
960
|
-
name: e,
|
|
961
|
-
clearCache: t,
|
|
962
|
-
getColumnPosition: l,
|
|
963
|
-
getColumnStartIndexForOffset: o,
|
|
964
|
-
getColumnStopIndexForStartIndex: a,
|
|
965
|
-
getEstimatedTotalHeight: r,
|
|
966
|
-
getEstimatedTotalWidth: s,
|
|
967
|
-
getColumnOffset: c,
|
|
968
|
-
getRowOffset: m,
|
|
969
|
-
getRowPosition: f,
|
|
970
|
-
getRowStartIndexForOffset: u,
|
|
971
|
-
getRowStopIndexForStartIndex: v,
|
|
972
|
-
initCache: b,
|
|
973
|
-
injectToInstance: y,
|
|
974
|
-
validateProps: w
|
|
975
|
-
}) => xe({
|
|
976
|
-
name: e ?? "ElVirtualList",
|
|
977
|
-
props: Me,
|
|
978
|
-
emits: [Gt, kt],
|
|
979
|
-
setup(h, { emit: d, expose: i, slots: g }) {
|
|
980
|
-
const S = Ie("vl");
|
|
981
|
-
w(h);
|
|
982
|
-
const H = nt(), M = F(b(h, H));
|
|
983
|
-
y == null || y(H, M);
|
|
984
|
-
const R = F(), $ = F(), z = F(), G = F(null), x = F({
|
|
985
|
-
isScrolling: !1,
|
|
986
|
-
scrollLeft: Q(h.initScrollLeft) ? h.initScrollLeft : 0,
|
|
987
|
-
scrollTop: Q(h.initScrollTop) ? h.initScrollTop : 0,
|
|
988
|
-
updateRequested: !1,
|
|
989
|
-
xAxisScrollDir: je,
|
|
990
|
-
yAxisScrollDir: je
|
|
991
|
-
}), A = uo(), W = E(() => Number.parseInt(`${h.height}`, 10)), N = E(() => Number.parseInt(`${h.width}`, 10)), j = E(() => {
|
|
992
|
-
const { totalColumn: T, totalRow: _, columnCache: p } = h, { isScrolling: D, xAxisScrollDir: L, scrollLeft: O } = n(x);
|
|
993
|
-
if (T === 0 || _ === 0)
|
|
994
|
-
return [0, 0, 0, 0];
|
|
995
|
-
const P = o(h, O, n(M)), k = a(h, P, O, n(M)), K = !D || L === dt ? Math.max(1, p) : 1, X = !D || L === je ? Math.max(1, p) : 1;
|
|
996
|
-
return [
|
|
997
|
-
Math.max(0, P - K),
|
|
998
|
-
Math.max(0, Math.min(T - 1, k + X)),
|
|
999
|
-
P,
|
|
1000
|
-
k
|
|
1001
|
-
];
|
|
1002
|
-
}), B = E(() => {
|
|
1003
|
-
const { totalColumn: T, totalRow: _, rowCache: p } = h, { isScrolling: D, yAxisScrollDir: L, scrollTop: O } = n(x);
|
|
1004
|
-
if (T === 0 || _ === 0)
|
|
1005
|
-
return [0, 0, 0, 0];
|
|
1006
|
-
const P = u(h, O, n(M)), k = v(h, P, O, n(M)), K = !D || L === dt ? Math.max(1, p) : 1, X = !D || L === je ? Math.max(1, p) : 1;
|
|
1007
|
-
return [
|
|
1008
|
-
Math.max(0, P - K),
|
|
1009
|
-
Math.max(0, Math.min(_ - 1, k + X)),
|
|
1010
|
-
P,
|
|
1011
|
-
k
|
|
1012
|
-
];
|
|
1013
|
-
}), V = E(() => r(h, n(M))), U = E(() => s(h, n(M))), le = E(() => {
|
|
1014
|
-
var T;
|
|
1015
|
-
return [
|
|
1016
|
-
{
|
|
1017
|
-
position: "relative",
|
|
1018
|
-
overflow: "hidden",
|
|
1019
|
-
WebkitOverflowScrolling: "touch",
|
|
1020
|
-
willChange: "transform"
|
|
1021
|
-
},
|
|
1022
|
-
{
|
|
1023
|
-
direction: h.direction,
|
|
1024
|
-
height: Q(h.height) ? `${h.height}px` : h.height,
|
|
1025
|
-
width: Q(h.width) ? `${h.width}px` : h.width
|
|
1026
|
-
},
|
|
1027
|
-
(T = h.style) != null ? T : {}
|
|
1028
|
-
];
|
|
1029
|
-
}), fe = E(() => {
|
|
1030
|
-
const T = `${n(U)}px`;
|
|
1031
|
-
return {
|
|
1032
|
-
height: `${n(V)}px`,
|
|
1033
|
-
pointerEvents: n(x).isScrolling ? "none" : void 0,
|
|
1034
|
-
width: T
|
|
1035
|
-
};
|
|
1036
|
-
}), se = () => {
|
|
1037
|
-
const { totalColumn: T, totalRow: _ } = h;
|
|
1038
|
-
if (T > 0 && _ > 0) {
|
|
1039
|
-
const [
|
|
1040
|
-
k,
|
|
1041
|
-
K,
|
|
1042
|
-
X,
|
|
1043
|
-
te
|
|
1044
|
-
] = n(j), [J, ee, Ee, at] = n(B);
|
|
1045
|
-
d(Gt, {
|
|
1046
|
-
columnCacheStart: k,
|
|
1047
|
-
columnCacheEnd: K,
|
|
1048
|
-
rowCacheStart: J,
|
|
1049
|
-
rowCacheEnd: ee,
|
|
1050
|
-
columnVisibleStart: X,
|
|
1051
|
-
columnVisibleEnd: te,
|
|
1052
|
-
rowVisibleStart: Ee,
|
|
1053
|
-
rowVisibleEnd: at
|
|
1054
|
-
});
|
|
1055
|
-
}
|
|
1056
|
-
const {
|
|
1057
|
-
scrollLeft: p,
|
|
1058
|
-
scrollTop: D,
|
|
1059
|
-
updateRequested: L,
|
|
1060
|
-
xAxisScrollDir: O,
|
|
1061
|
-
yAxisScrollDir: P
|
|
1062
|
-
} = n(x);
|
|
1063
|
-
d(kt, {
|
|
1064
|
-
xAxisScrollDir: O,
|
|
1065
|
-
scrollLeft: p,
|
|
1066
|
-
yAxisScrollDir: P,
|
|
1067
|
-
scrollTop: D,
|
|
1068
|
-
updateRequested: L
|
|
1069
|
-
});
|
|
1070
|
-
}, re = (T) => {
|
|
1071
|
-
const {
|
|
1072
|
-
clientHeight: _,
|
|
1073
|
-
clientWidth: p,
|
|
1074
|
-
scrollHeight: D,
|
|
1075
|
-
scrollLeft: L,
|
|
1076
|
-
scrollTop: O,
|
|
1077
|
-
scrollWidth: P
|
|
1078
|
-
} = T.currentTarget, k = n(x);
|
|
1079
|
-
if (k.scrollTop === O && k.scrollLeft === L)
|
|
1080
|
-
return;
|
|
1081
|
-
let K = L;
|
|
1082
|
-
if (Vt(h.direction))
|
|
1083
|
-
switch (Kt()) {
|
|
1084
|
-
case mt:
|
|
1085
|
-
K = -L;
|
|
1086
|
-
break;
|
|
1087
|
-
case dl:
|
|
1088
|
-
K = P - p - L;
|
|
1089
|
-
break;
|
|
1090
|
-
}
|
|
1091
|
-
x.value = {
|
|
1092
|
-
...k,
|
|
1093
|
-
isScrolling: !0,
|
|
1094
|
-
scrollLeft: K,
|
|
1095
|
-
scrollTop: Math.max(0, Math.min(O, D - _)),
|
|
1096
|
-
updateRequested: !0,
|
|
1097
|
-
xAxisScrollDir: Je(k.scrollLeft, K),
|
|
1098
|
-
yAxisScrollDir: Je(k.scrollTop, O)
|
|
1099
|
-
}, Se(() => ye()), Le(), se();
|
|
1100
|
-
}, me = (T, _) => {
|
|
1101
|
-
const p = n(W), D = (V.value - p) / _ * T;
|
|
1102
|
-
Z({
|
|
1103
|
-
scrollTop: Math.min(V.value - p, D)
|
|
1104
|
-
});
|
|
1105
|
-
}, ie = (T, _) => {
|
|
1106
|
-
const p = n(N), D = (U.value - p) / _ * T;
|
|
1107
|
-
Z({
|
|
1108
|
-
scrollLeft: Math.min(U.value - p, D)
|
|
1109
|
-
});
|
|
1110
|
-
}, { onWheel: ve } = Io({
|
|
1111
|
-
atXStartEdge: E(() => x.value.scrollLeft <= 0),
|
|
1112
|
-
atXEndEdge: E(() => x.value.scrollLeft >= U.value - n(N)),
|
|
1113
|
-
atYStartEdge: E(() => x.value.scrollTop <= 0),
|
|
1114
|
-
atYEndEdge: E(() => x.value.scrollTop >= V.value - n(W))
|
|
1115
|
-
}, (T, _) => {
|
|
1116
|
-
var p, D, L, O;
|
|
1117
|
-
(D = (p = $.value) == null ? void 0 : p.onMouseUp) == null || D.call(p), (O = (L = z.value) == null ? void 0 : L.onMouseUp) == null || O.call(L);
|
|
1118
|
-
const P = n(N), k = n(W);
|
|
1119
|
-
Z({
|
|
1120
|
-
scrollLeft: Math.min(x.value.scrollLeft + T, U.value - P),
|
|
1121
|
-
scrollTop: Math.min(x.value.scrollTop + _, V.value - k)
|
|
1122
|
-
});
|
|
1123
|
-
});
|
|
1124
|
-
Jl(R, "wheel", ve, {
|
|
1125
|
-
passive: !1
|
|
1126
|
-
});
|
|
1127
|
-
const Z = ({
|
|
1128
|
-
scrollLeft: T = x.value.scrollLeft,
|
|
1129
|
-
scrollTop: _ = x.value.scrollTop
|
|
1130
|
-
}) => {
|
|
1131
|
-
T = Math.max(T, 0), _ = Math.max(_, 0);
|
|
1132
|
-
const p = n(x);
|
|
1133
|
-
_ === p.scrollTop && T === p.scrollLeft || (x.value = {
|
|
1134
|
-
...p,
|
|
1135
|
-
xAxisScrollDir: Je(p.scrollLeft, T),
|
|
1136
|
-
yAxisScrollDir: Je(p.scrollTop, _),
|
|
1137
|
-
scrollLeft: T,
|
|
1138
|
-
scrollTop: _,
|
|
1139
|
-
updateRequested: !0
|
|
1140
|
-
}, Se(() => ye()), Le(), se());
|
|
1141
|
-
}, ge = (T = 0, _ = 0, p = He) => {
|
|
1142
|
-
const D = n(x);
|
|
1143
|
-
_ = Math.max(0, Math.min(_, h.totalColumn - 1)), T = Math.max(0, Math.min(T, h.totalRow - 1));
|
|
1144
|
-
const L = to(S.namespace.value), O = n(M), P = r(h, O), k = s(h, O);
|
|
1145
|
-
Z({
|
|
1146
|
-
scrollLeft: c(h, _, p, D.scrollLeft, O, k > h.width ? L : 0),
|
|
1147
|
-
scrollTop: m(h, T, p, D.scrollTop, O, P > h.height ? L : 0)
|
|
1148
|
-
});
|
|
1149
|
-
}, Te = (T, _) => {
|
|
1150
|
-
const { columnWidth: p, direction: D, rowHeight: L } = h, O = A.value(t && p, t && L, t && D), P = `${T},${_}`;
|
|
1151
|
-
if (Pl(O, P))
|
|
1152
|
-
return O[P];
|
|
1153
|
-
{
|
|
1154
|
-
const [, k] = l(h, _, n(M)), K = n(M), X = Vt(D), [te, J] = f(h, T, K), [ee] = l(h, _, K);
|
|
1155
|
-
return O[P] = {
|
|
1156
|
-
position: "absolute",
|
|
1157
|
-
left: X ? void 0 : `${k}px`,
|
|
1158
|
-
right: X ? `${k}px` : void 0,
|
|
1159
|
-
top: `${J}px`,
|
|
1160
|
-
height: `${te}px`,
|
|
1161
|
-
width: `${ee}px`
|
|
1162
|
-
}, O[P];
|
|
1163
|
-
}
|
|
1164
|
-
}, ye = () => {
|
|
1165
|
-
x.value.isScrolling = !1, Se(() => {
|
|
1166
|
-
A.value(-1, null, null);
|
|
1167
|
-
});
|
|
1168
|
-
};
|
|
1169
|
-
rt(() => {
|
|
1170
|
-
if (!Dl)
|
|
1171
|
-
return;
|
|
1172
|
-
const { initScrollLeft: T, initScrollTop: _ } = h, p = n(R);
|
|
1173
|
-
p && (Q(T) && (p.scrollLeft = T), Q(_) && (p.scrollTop = _)), se();
|
|
1174
|
-
});
|
|
1175
|
-
const Le = () => {
|
|
1176
|
-
const { direction: T } = h, { scrollLeft: _, scrollTop: p, updateRequested: D } = n(x), L = n(R);
|
|
1177
|
-
if (D && L) {
|
|
1178
|
-
if (T === il)
|
|
1179
|
-
switch (Kt()) {
|
|
1180
|
-
case mt: {
|
|
1181
|
-
L.scrollLeft = -_;
|
|
1182
|
-
break;
|
|
1183
|
-
}
|
|
1184
|
-
case cl: {
|
|
1185
|
-
L.scrollLeft = _;
|
|
1186
|
-
break;
|
|
1187
|
-
}
|
|
1188
|
-
default: {
|
|
1189
|
-
const { clientWidth: O, scrollWidth: P } = L;
|
|
1190
|
-
L.scrollLeft = P - O - _;
|
|
1191
|
-
break;
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
else
|
|
1195
|
-
L.scrollLeft = Math.max(0, _);
|
|
1196
|
-
L.scrollTop = Math.max(0, p);
|
|
1197
|
-
}
|
|
1198
|
-
}, { resetAfterColumnIndex: Ge, resetAfterRowIndex: ke, resetAfter: we } = H.proxy;
|
|
1199
|
-
i({
|
|
1200
|
-
windowRef: R,
|
|
1201
|
-
innerRef: G,
|
|
1202
|
-
getItemStyleCache: A,
|
|
1203
|
-
scrollTo: Z,
|
|
1204
|
-
scrollToItem: ge,
|
|
1205
|
-
states: x,
|
|
1206
|
-
resetAfterColumnIndex: Ge,
|
|
1207
|
-
resetAfterRowIndex: ke,
|
|
1208
|
-
resetAfter: we
|
|
1209
|
-
});
|
|
1210
|
-
const Ve = () => {
|
|
1211
|
-
const {
|
|
1212
|
-
scrollbarAlwaysOn: T,
|
|
1213
|
-
scrollbarStartGap: _,
|
|
1214
|
-
scrollbarEndGap: p,
|
|
1215
|
-
totalColumn: D,
|
|
1216
|
-
totalRow: L
|
|
1217
|
-
} = h, O = n(N), P = n(W), k = n(U), K = n(V), { scrollLeft: X, scrollTop: te } = n(x), J = ue(jt, {
|
|
1218
|
-
ref: $,
|
|
1219
|
-
alwaysOn: T,
|
|
1220
|
-
startGap: _,
|
|
1221
|
-
endGap: p,
|
|
1222
|
-
class: S.e("horizontal"),
|
|
1223
|
-
clientSize: O,
|
|
1224
|
-
layout: "horizontal",
|
|
1225
|
-
onScroll: ie,
|
|
1226
|
-
ratio: O * 100 / k,
|
|
1227
|
-
scrollFrom: X / (k - O),
|
|
1228
|
-
total: L,
|
|
1229
|
-
visible: !0
|
|
1230
|
-
}), ee = ue(jt, {
|
|
1231
|
-
ref: z,
|
|
1232
|
-
alwaysOn: T,
|
|
1233
|
-
startGap: _,
|
|
1234
|
-
endGap: p,
|
|
1235
|
-
class: S.e("vertical"),
|
|
1236
|
-
clientSize: P,
|
|
1237
|
-
layout: "vertical",
|
|
1238
|
-
onScroll: me,
|
|
1239
|
-
ratio: P * 100 / K,
|
|
1240
|
-
scrollFrom: te / (K - P),
|
|
1241
|
-
total: D,
|
|
1242
|
-
visible: !0
|
|
1243
|
-
});
|
|
1244
|
-
return {
|
|
1245
|
-
horizontalScrollbar: J,
|
|
1246
|
-
verticalScrollbar: ee
|
|
1247
|
-
};
|
|
1248
|
-
}, q = () => {
|
|
1249
|
-
var T;
|
|
1250
|
-
const [_, p] = n(j), [D, L] = n(B), { data: O, totalColumn: P, totalRow: k, useIsScrolling: K, itemKey: X } = h, te = [];
|
|
1251
|
-
if (k > 0 && P > 0)
|
|
1252
|
-
for (let J = D; J <= L; J++)
|
|
1253
|
-
for (let ee = _; ee <= p; ee++) {
|
|
1254
|
-
const Ee = X({ columnIndex: ee, data: O, rowIndex: J });
|
|
1255
|
-
te.push(ue(jl, { key: Ee }, (T = g.default) == null ? void 0 : T.call(g, {
|
|
1256
|
-
columnIndex: ee,
|
|
1257
|
-
data: O,
|
|
1258
|
-
isScrolling: K ? n(x).isScrolling : void 0,
|
|
1259
|
-
style: Te(J, ee),
|
|
1260
|
-
rowIndex: J
|
|
1261
|
-
})));
|
|
1262
|
-
}
|
|
1263
|
-
return te;
|
|
1264
|
-
}, oe = () => {
|
|
1265
|
-
const T = zt(h.innerElement), _ = q();
|
|
1266
|
-
return [
|
|
1267
|
-
ue(T, {
|
|
1268
|
-
style: n(fe),
|
|
1269
|
-
ref: G
|
|
1270
|
-
}, Nt(T) ? _ : {
|
|
1271
|
-
default: () => _
|
|
1272
|
-
})
|
|
1273
|
-
];
|
|
1274
|
-
};
|
|
1275
|
-
return () => {
|
|
1276
|
-
const T = zt(h.containerElement), { horizontalScrollbar: _, verticalScrollbar: p } = Ve(), D = oe();
|
|
1277
|
-
return ue("div", {
|
|
1278
|
-
key: 0,
|
|
1279
|
-
class: S.e("wrapper"),
|
|
1280
|
-
role: h.role
|
|
1281
|
-
}, [
|
|
1282
|
-
ue(T, {
|
|
1283
|
-
class: h.className,
|
|
1284
|
-
style: n(le),
|
|
1285
|
-
onScroll: re,
|
|
1286
|
-
ref: R
|
|
1287
|
-
}, Nt(T) ? D : { default: () => D }),
|
|
1288
|
-
_,
|
|
1289
|
-
p
|
|
1290
|
-
]);
|
|
1291
|
-
};
|
|
1292
|
-
}
|
|
1293
|
-
}), { max: ot, min: Tl, floor: El } = Math, Ao = {
|
|
1294
|
-
column: "columnWidth",
|
|
1295
|
-
row: "rowHeight"
|
|
1296
|
-
}, Rt = {
|
|
1297
|
-
column: "lastVisitedColumnIndex",
|
|
1298
|
-
row: "lastVisitedRowIndex"
|
|
1299
|
-
}, he = (e, t, l, o) => {
|
|
1300
|
-
const [a, r, s] = [
|
|
1301
|
-
l[o],
|
|
1302
|
-
e[Ao[o]],
|
|
1303
|
-
l[Rt[o]]
|
|
1304
|
-
];
|
|
1305
|
-
if (t > s) {
|
|
1306
|
-
let c = 0;
|
|
1307
|
-
if (s >= 0) {
|
|
1308
|
-
const m = a[s];
|
|
1309
|
-
c = m.offset + m.size;
|
|
1310
|
-
}
|
|
1311
|
-
for (let m = s + 1; m <= t; m++) {
|
|
1312
|
-
const f = r(m);
|
|
1313
|
-
a[m] = {
|
|
1314
|
-
offset: c,
|
|
1315
|
-
size: f
|
|
1316
|
-
}, c += f;
|
|
1317
|
-
}
|
|
1318
|
-
l[Rt[o]] = t;
|
|
1319
|
-
}
|
|
1320
|
-
return a[t];
|
|
1321
|
-
}, _l = (e, t, l, o, a, r) => {
|
|
1322
|
-
for (; l <= o; ) {
|
|
1323
|
-
const s = l + El((o - l) / 2), c = he(e, s, t, r).offset;
|
|
1324
|
-
if (c === a)
|
|
1325
|
-
return s;
|
|
1326
|
-
c < a ? l = s + 1 : o = s - 1;
|
|
1327
|
-
}
|
|
1328
|
-
return ot(0, l - 1);
|
|
1329
|
-
}, Oo = (e, t, l, o, a) => {
|
|
1330
|
-
const r = a === "column" ? e.totalColumn : e.totalRow;
|
|
1331
|
-
let s = 1;
|
|
1332
|
-
for (; l < r && he(e, l, t, a).offset < o; )
|
|
1333
|
-
l += s, s *= 2;
|
|
1334
|
-
return _l(e, t, El(l / 2), Tl(l, r - 1), o, a);
|
|
1335
|
-
}, Ut = (e, t, l, o) => {
|
|
1336
|
-
const [a, r] = [
|
|
1337
|
-
t[o],
|
|
1338
|
-
t[Rt[o]]
|
|
1339
|
-
];
|
|
1340
|
-
return (r > 0 ? a[r].offset : 0) >= l ? _l(e, t, 0, r, l, o) : Oo(e, t, ot(0, r), l, o);
|
|
1341
|
-
}, Cl = ({ totalRow: e }, { estimatedRowHeight: t, lastVisitedRowIndex: l, row: o }) => {
|
|
1342
|
-
let a = 0;
|
|
1343
|
-
if (l >= e && (l = e - 1), l >= 0) {
|
|
1344
|
-
const c = o[l];
|
|
1345
|
-
a = c.offset + c.size;
|
|
1346
|
-
}
|
|
1347
|
-
const s = (e - l - 1) * t;
|
|
1348
|
-
return a + s;
|
|
1349
|
-
}, Hl = ({ totalColumn: e }, { column: t, estimatedColumnWidth: l, lastVisitedColumnIndex: o }) => {
|
|
1350
|
-
let a = 0;
|
|
1351
|
-
if (o > e && (o = e - 1), o >= 0) {
|
|
1352
|
-
const c = t[o];
|
|
1353
|
-
a = c.offset + c.size;
|
|
1354
|
-
}
|
|
1355
|
-
const s = (e - o - 1) * l;
|
|
1356
|
-
return a + s;
|
|
1357
|
-
}, No = {
|
|
1358
|
-
column: Hl,
|
|
1359
|
-
row: Cl
|
|
1360
|
-
}, Yt = (e, t, l, o, a, r, s) => {
|
|
1361
|
-
const [c, m] = [
|
|
1362
|
-
r === "row" ? e.height : e.width,
|
|
1363
|
-
No[r]
|
|
1364
|
-
], f = he(e, t, a, r), u = m(e, a), v = ot(0, Tl(u - c, f.offset)), b = ot(0, f.offset - c + s + f.size);
|
|
1365
|
-
switch (l === al && (o >= b - c && o <= v + c ? l = He : l = Fe), l) {
|
|
1366
|
-
case ut:
|
|
1367
|
-
return v;
|
|
1368
|
-
case ht:
|
|
1369
|
-
return b;
|
|
1370
|
-
case Fe:
|
|
1371
|
-
return Math.round(b + (v - b) / 2);
|
|
1372
|
-
case He:
|
|
1373
|
-
default:
|
|
1374
|
-
return o >= b && o <= v ? o : b > v || o < b ? b : v;
|
|
1375
|
-
}
|
|
1376
|
-
}, Lo = xl({
|
|
1377
|
-
name: "ElDynamicSizeGrid",
|
|
1378
|
-
getColumnPosition: (e, t, l) => {
|
|
1379
|
-
const o = he(e, t, l, "column");
|
|
1380
|
-
return [o.size, o.offset];
|
|
1381
|
-
},
|
|
1382
|
-
getRowPosition: (e, t, l) => {
|
|
1383
|
-
const o = he(e, t, l, "row");
|
|
1384
|
-
return [o.size, o.offset];
|
|
1385
|
-
},
|
|
1386
|
-
getColumnOffset: (e, t, l, o, a, r) => Yt(e, t, l, o, a, "column", r),
|
|
1387
|
-
getRowOffset: (e, t, l, o, a, r) => Yt(e, t, l, o, a, "row", r),
|
|
1388
|
-
getColumnStartIndexForOffset: (e, t, l) => Ut(e, l, t, "column"),
|
|
1389
|
-
getColumnStopIndexForStartIndex: (e, t, l, o) => {
|
|
1390
|
-
const a = he(e, t, o, "column"), r = l + e.width;
|
|
1391
|
-
let s = a.offset + a.size, c = t;
|
|
1392
|
-
for (; c < e.totalColumn - 1 && s < r; )
|
|
1393
|
-
c++, s += he(e, t, o, "column").size;
|
|
1394
|
-
return c;
|
|
1395
|
-
},
|
|
1396
|
-
getEstimatedTotalHeight: Cl,
|
|
1397
|
-
getEstimatedTotalWidth: Hl,
|
|
1398
|
-
getRowStartIndexForOffset: (e, t, l) => Ut(e, l, t, "row"),
|
|
1399
|
-
getRowStopIndexForStartIndex: (e, t, l, o) => {
|
|
1400
|
-
const { totalRow: a, height: r } = e, s = he(e, t, o, "row"), c = l + r;
|
|
1401
|
-
let m = s.size + s.offset, f = t;
|
|
1402
|
-
for (; f < a - 1 && m < c; )
|
|
1403
|
-
f++, m += he(e, f, o, "row").size;
|
|
1404
|
-
return f;
|
|
1405
|
-
},
|
|
1406
|
-
injectToInstance: (e, t) => {
|
|
1407
|
-
const l = ({ columnIndex: r, rowIndex: s }, c) => {
|
|
1408
|
-
var m, f;
|
|
1409
|
-
c = $l(c) ? !0 : c, Q(r) && (t.value.lastVisitedColumnIndex = Math.min(t.value.lastVisitedColumnIndex, r - 1)), Q(s) && (t.value.lastVisitedRowIndex = Math.min(t.value.lastVisitedRowIndex, s - 1)), (m = e.exposed) == null || m.getItemStyleCache.value(-1, null, null), c && ((f = e.proxy) == null || f.$forceUpdate());
|
|
1410
|
-
}, o = (r, s) => {
|
|
1411
|
-
l({
|
|
1412
|
-
columnIndex: r
|
|
1413
|
-
}, s);
|
|
1414
|
-
}, a = (r, s) => {
|
|
1415
|
-
l({
|
|
1416
|
-
rowIndex: r
|
|
1417
|
-
}, s);
|
|
1456
|
+
}, [m(), i()])]);
|
|
1418
1457
|
};
|
|
1419
|
-
Object.assign(e.proxy, {
|
|
1420
|
-
resetAfterColumnIndex: o,
|
|
1421
|
-
resetAfterRowIndex: a,
|
|
1422
|
-
resetAfter: l
|
|
1423
|
-
});
|
|
1424
|
-
},
|
|
1425
|
-
initCache: ({
|
|
1426
|
-
estimatedColumnWidth: e = Wt,
|
|
1427
|
-
estimatedRowHeight: t = Wt
|
|
1428
|
-
}) => ({
|
|
1429
|
-
column: {},
|
|
1430
|
-
estimatedColumnWidth: e,
|
|
1431
|
-
estimatedRowHeight: t,
|
|
1432
|
-
lastVisitedColumnIndex: -1,
|
|
1433
|
-
lastVisitedRowIndex: -1,
|
|
1434
|
-
row: {}
|
|
1435
|
-
}),
|
|
1436
|
-
clearCache: !1,
|
|
1437
|
-
validateProps: ({ columnWidth: e, rowHeight: t }) => {
|
|
1438
|
-
}
|
|
1439
|
-
}), zo = xl({
|
|
1440
|
-
name: "ElFixedSizeGrid",
|
|
1441
|
-
getColumnPosition: ({ columnWidth: e }, t) => [
|
|
1442
|
-
e,
|
|
1443
|
-
t * e
|
|
1444
|
-
],
|
|
1445
|
-
getRowPosition: ({ rowHeight: e }, t) => [
|
|
1446
|
-
e,
|
|
1447
|
-
t * e
|
|
1448
|
-
],
|
|
1449
|
-
getEstimatedTotalHeight: ({ totalRow: e, rowHeight: t }) => t * e,
|
|
1450
|
-
getEstimatedTotalWidth: ({ totalColumn: e, columnWidth: t }) => t * e,
|
|
1451
|
-
getColumnOffset: ({ totalColumn: e, columnWidth: t, width: l }, o, a, r, s, c) => {
|
|
1452
|
-
l = Number(l);
|
|
1453
|
-
const m = Math.max(0, e * t - l), f = Math.min(m, o * t), u = Math.max(0, o * t - l + c + t);
|
|
1454
|
-
switch (a === "smart" && (r >= u - l && r <= f + l ? a = He : a = Fe), a) {
|
|
1455
|
-
case ut:
|
|
1456
|
-
return f;
|
|
1457
|
-
case ht:
|
|
1458
|
-
return u;
|
|
1459
|
-
case Fe: {
|
|
1460
|
-
const v = Math.round(u + (f - u) / 2);
|
|
1461
|
-
return v < Math.ceil(l / 2) ? 0 : v > m + Math.floor(l / 2) ? m : v;
|
|
1462
|
-
}
|
|
1463
|
-
case He:
|
|
1464
|
-
default:
|
|
1465
|
-
return r >= u && r <= f ? r : u > f || r < u ? u : f;
|
|
1466
|
-
}
|
|
1467
|
-
},
|
|
1468
|
-
getRowOffset: ({ rowHeight: e, height: t, totalRow: l }, o, a, r, s, c) => {
|
|
1469
|
-
t = Number(t);
|
|
1470
|
-
const m = Math.max(0, l * e - t), f = Math.min(m, o * e), u = Math.max(0, o * e - t + c + e);
|
|
1471
|
-
switch (a === al && (r >= u - t && r <= f + t ? a = He : a = Fe), a) {
|
|
1472
|
-
case ut:
|
|
1473
|
-
return f;
|
|
1474
|
-
case ht:
|
|
1475
|
-
return u;
|
|
1476
|
-
case Fe: {
|
|
1477
|
-
const v = Math.round(u + (f - u) / 2);
|
|
1478
|
-
return v < Math.ceil(t / 2) ? 0 : v > m + Math.floor(t / 2) ? m : v;
|
|
1479
|
-
}
|
|
1480
|
-
case He:
|
|
1481
|
-
default:
|
|
1482
|
-
return r >= u && r <= f ? r : u > f || r < u ? u : f;
|
|
1483
|
-
}
|
|
1484
|
-
},
|
|
1485
|
-
getColumnStartIndexForOffset: ({ columnWidth: e, totalColumn: t }, l) => Math.max(0, Math.min(t - 1, Math.floor(l / e))),
|
|
1486
|
-
getColumnStopIndexForStartIndex: ({ columnWidth: e, totalColumn: t, width: l }, o, a) => {
|
|
1487
|
-
const r = o * e, s = Math.ceil((l + a - r) / e);
|
|
1488
|
-
return Math.max(0, Math.min(t - 1, o + s - 1));
|
|
1489
|
-
},
|
|
1490
|
-
getRowStartIndexForOffset: ({ rowHeight: e, totalRow: t }, l) => Math.max(0, Math.min(t - 1, Math.floor(l / e))),
|
|
1491
|
-
getRowStopIndexForStartIndex: ({ rowHeight: e, totalRow: t, height: l }, o, a) => {
|
|
1492
|
-
const r = o * e, s = Math.ceil((l + a - r) / e);
|
|
1493
|
-
return Math.max(0, Math.min(t - 1, o + s - 1));
|
|
1494
|
-
},
|
|
1495
|
-
initCache: () => {
|
|
1496
|
-
},
|
|
1497
|
-
clearCache: !0,
|
|
1498
|
-
validateProps: ({ columnWidth: e, rowHeight: t }) => {
|
|
1499
1458
|
}
|
|
1500
|
-
}),
|
|
1501
|
-
const t =
|
|
1502
|
-
const {
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
} = e;
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
return Math.max(0, d - n(s) - n(r));
|
|
1520
|
-
}), m = E(() => n(s) + n(r) > 0), f = ({
|
|
1521
|
-
data: d,
|
|
1522
|
-
rowIndex: i
|
|
1523
|
-
}) => d[i][e.rowKey];
|
|
1524
|
-
function u({
|
|
1525
|
-
rowCacheStart: d,
|
|
1526
|
-
rowCacheEnd: i,
|
|
1527
|
-
rowVisibleStart: g,
|
|
1528
|
-
rowVisibleEnd: S
|
|
1529
|
-
}) {
|
|
1530
|
-
var H;
|
|
1531
|
-
(H = e.onRowsRendered) == null || H.call(e, {
|
|
1532
|
-
rowCacheStart: d,
|
|
1533
|
-
rowCacheEnd: i,
|
|
1534
|
-
rowVisibleStart: g,
|
|
1535
|
-
rowVisibleEnd: S
|
|
1459
|
+
}), Io = "ElTableV2Grid", zo = (e) => {
|
|
1460
|
+
const t = P(), n = P(), o = P(0), r = T(() => {
|
|
1461
|
+
const { data: u, rowHeight: d, estimatedRowHeight: w } = e;
|
|
1462
|
+
if (!w)
|
|
1463
|
+
return u.length * d;
|
|
1464
|
+
}), a = T(() => {
|
|
1465
|
+
const { fixedData: u, rowHeight: d } = e;
|
|
1466
|
+
return ((u == null ? void 0 : u.length) || 0) * d;
|
|
1467
|
+
}), s = T(() => nt(e.headerHeight)), h = T(() => {
|
|
1468
|
+
const { height: u } = e;
|
|
1469
|
+
return Math.max(0, u - l(s) - l(a));
|
|
1470
|
+
}), g = T(() => l(s) + l(a) > 0), f = ({ data: u, rowIndex: d }) => u[d][e.rowKey];
|
|
1471
|
+
function i({ rowCacheStart: u, rowCacheEnd: d, rowVisibleStart: w, rowVisibleEnd: x }) {
|
|
1472
|
+
var M;
|
|
1473
|
+
(M = e.onRowsRendered) == null || M.call(e, {
|
|
1474
|
+
rowCacheStart: u,
|
|
1475
|
+
rowCacheEnd: d,
|
|
1476
|
+
rowVisibleStart: w,
|
|
1477
|
+
rowVisibleEnd: x
|
|
1536
1478
|
});
|
|
1537
1479
|
}
|
|
1538
|
-
function
|
|
1539
|
-
var
|
|
1540
|
-
(
|
|
1480
|
+
function m(u, d) {
|
|
1481
|
+
var w;
|
|
1482
|
+
(w = n.value) == null || w.resetAfterRowIndex(u, d);
|
|
1541
1483
|
}
|
|
1542
|
-
function
|
|
1543
|
-
const
|
|
1544
|
-
|
|
1545
|
-
scrollLeft:
|
|
1546
|
-
scrollTop:
|
|
1484
|
+
function v(u, d) {
|
|
1485
|
+
const w = l(t), x = l(n);
|
|
1486
|
+
Ct(u) ? (w == null || w.scrollToLeft(u.scrollLeft), o.value = u.scrollLeft, x == null || x.scrollTo(u)) : (w == null || w.scrollToLeft(u), o.value = u, x == null || x.scrollTo({
|
|
1487
|
+
scrollLeft: u,
|
|
1488
|
+
scrollTop: d
|
|
1547
1489
|
}));
|
|
1548
1490
|
}
|
|
1549
|
-
function
|
|
1550
|
-
var
|
|
1551
|
-
(
|
|
1552
|
-
scrollTop: d
|
|
1553
|
-
});
|
|
1491
|
+
function b(u) {
|
|
1492
|
+
var d;
|
|
1493
|
+
(d = l(n)) == null || d.scrollTo({ scrollTop: u });
|
|
1554
1494
|
}
|
|
1555
|
-
function
|
|
1556
|
-
|
|
1557
|
-
|
|
1495
|
+
function y(u, d) {
|
|
1496
|
+
const w = l(n);
|
|
1497
|
+
if (!w)
|
|
1498
|
+
return;
|
|
1499
|
+
const x = o.value;
|
|
1500
|
+
w.scrollToItem(u, 0, d), x && v({ scrollLeft: x });
|
|
1558
1501
|
}
|
|
1559
|
-
function
|
|
1560
|
-
var
|
|
1561
|
-
(
|
|
1502
|
+
function c() {
|
|
1503
|
+
var u, d;
|
|
1504
|
+
(u = l(n)) == null || u.$forceUpdate(), (d = l(t)) == null || d.$forceUpdate();
|
|
1562
1505
|
}
|
|
1563
|
-
return
|
|
1564
|
-
var
|
|
1565
|
-
|
|
1566
|
-
columnIndex: 0
|
|
1567
|
-
}, !1));
|
|
1506
|
+
return Se(() => e.bodyWidth, () => {
|
|
1507
|
+
var u;
|
|
1508
|
+
X(e.estimatedRowHeight) && ((u = n.value) == null || u.resetAfter({ columnIndex: 0 }, !1));
|
|
1568
1509
|
}), {
|
|
1569
|
-
bodyRef:
|
|
1570
|
-
forceUpdate:
|
|
1571
|
-
fixedRowHeight:
|
|
1572
|
-
gridHeight:
|
|
1573
|
-
hasHeader:
|
|
1510
|
+
bodyRef: n,
|
|
1511
|
+
forceUpdate: c,
|
|
1512
|
+
fixedRowHeight: a,
|
|
1513
|
+
gridHeight: h,
|
|
1514
|
+
hasHeader: g,
|
|
1574
1515
|
headerHeight: s,
|
|
1575
1516
|
headerRef: t,
|
|
1576
|
-
totalHeight:
|
|
1517
|
+
totalHeight: r,
|
|
1577
1518
|
itemKey: f,
|
|
1578
|
-
onItemRendered:
|
|
1579
|
-
resetAfterRowIndex:
|
|
1580
|
-
scrollTo:
|
|
1581
|
-
scrollToTop:
|
|
1582
|
-
scrollToRow:
|
|
1519
|
+
onItemRendered: i,
|
|
1520
|
+
resetAfterRowIndex: m,
|
|
1521
|
+
scrollTo: v,
|
|
1522
|
+
scrollToTop: b,
|
|
1523
|
+
scrollToRow: y,
|
|
1583
1524
|
scrollLeft: o
|
|
1584
1525
|
};
|
|
1585
|
-
},
|
|
1586
|
-
name:
|
|
1526
|
+
}, Ot = /* @__PURE__ */ xe({
|
|
1527
|
+
name: Io,
|
|
1587
1528
|
props: tt,
|
|
1588
|
-
setup(e, {
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
scrollTo: h,
|
|
1620
|
-
scrollToTop: d,
|
|
1621
|
-
scrollToRow: i,
|
|
1622
|
-
resetAfterRowIndex: w
|
|
1529
|
+
setup(e, { slots: t, expose: n }) {
|
|
1530
|
+
const { ns: o } = Ht(At), { bodyRef: r, fixedRowHeight: a, gridHeight: s, hasHeader: h, headerRef: g, headerHeight: f, totalHeight: i, forceUpdate: m, itemKey: v, onItemRendered: b, resetAfterRowIndex: y, scrollTo: c, scrollToTop: u, scrollToRow: d, scrollLeft: w } = zo(e);
|
|
1531
|
+
on(Cn, w), jn(async () => {
|
|
1532
|
+
var p;
|
|
1533
|
+
await ve();
|
|
1534
|
+
const M = (p = r.value) == null ? void 0 : p.states.scrollTop;
|
|
1535
|
+
M && u(Math.round(M) + 1);
|
|
1536
|
+
}), n({
|
|
1537
|
+
forceUpdate: m,
|
|
1538
|
+
/**
|
|
1539
|
+
* @description fetch total height
|
|
1540
|
+
*/
|
|
1541
|
+
totalHeight: i,
|
|
1542
|
+
/**
|
|
1543
|
+
* @description scroll to a position
|
|
1544
|
+
*/
|
|
1545
|
+
scrollTo: c,
|
|
1546
|
+
/**
|
|
1547
|
+
* @description scroll vertically to position y
|
|
1548
|
+
*/
|
|
1549
|
+
scrollToTop: u,
|
|
1550
|
+
/**
|
|
1551
|
+
* @description scroll to a given row
|
|
1552
|
+
* @params row {Number} which row to scroll to
|
|
1553
|
+
* @params strategy {ScrollStrategy} use what strategy to scroll to
|
|
1554
|
+
*/
|
|
1555
|
+
scrollToRow: d,
|
|
1556
|
+
/**
|
|
1557
|
+
* @description reset rendered state after row index
|
|
1558
|
+
*/
|
|
1559
|
+
resetAfterRowIndex: y
|
|
1623
1560
|
});
|
|
1624
|
-
const
|
|
1561
|
+
const x = () => e.bodyWidth;
|
|
1625
1562
|
return () => {
|
|
1626
|
-
const {
|
|
1627
|
-
|
|
1628
|
-
columns: M,
|
|
1629
|
-
data: R,
|
|
1630
|
-
fixedData: $,
|
|
1631
|
-
useIsScrolling: z,
|
|
1632
|
-
scrollbarAlwaysOn: G,
|
|
1633
|
-
scrollbarEndGap: x,
|
|
1634
|
-
scrollbarStartGap: A,
|
|
1635
|
-
style: W,
|
|
1636
|
-
rowHeight: N,
|
|
1637
|
-
bodyWidth: j,
|
|
1638
|
-
estimatedRowHeight: B,
|
|
1639
|
-
headerWidth: V,
|
|
1640
|
-
height: U,
|
|
1641
|
-
width: le,
|
|
1642
|
-
getRowHeight: fe,
|
|
1643
|
-
onScroll: se
|
|
1644
|
-
} = e, re = Q(B), me = re ? Lo : zo, ie = n(f);
|
|
1645
|
-
return C("div", {
|
|
1563
|
+
const { cache: M, columns: p, data: S, fixedData: W, useIsScrolling: k, scrollbarAlwaysOn: G, scrollbarEndGap: R, scrollbarStartGap: L, style: F, rowHeight: z, bodyWidth: K, estimatedRowHeight: B, headerWidth: j, height: U, width: re, getRowHeight: Re, onScroll: ue } = e, ae = X(B), Te = ae ? xo : bo, be = l(f);
|
|
1564
|
+
return E("div", {
|
|
1646
1565
|
role: "table",
|
|
1647
1566
|
class: [o.e("table"), e.class],
|
|
1648
|
-
style:
|
|
1649
|
-
}, [
|
|
1650
|
-
ref:
|
|
1651
|
-
data:
|
|
1652
|
-
useIsScrolling:
|
|
1653
|
-
itemKey:
|
|
1567
|
+
style: F
|
|
1568
|
+
}, [E(Te, {
|
|
1569
|
+
ref: r,
|
|
1570
|
+
data: S,
|
|
1571
|
+
useIsScrolling: k,
|
|
1572
|
+
itemKey: v,
|
|
1654
1573
|
columnCache: 0,
|
|
1655
|
-
columnWidth:
|
|
1574
|
+
columnWidth: ae ? x : K,
|
|
1656
1575
|
totalColumn: 1,
|
|
1657
|
-
totalRow:
|
|
1658
|
-
rowCache:
|
|
1659
|
-
rowHeight:
|
|
1660
|
-
width:
|
|
1661
|
-
height:
|
|
1576
|
+
totalRow: S.length,
|
|
1577
|
+
rowCache: M,
|
|
1578
|
+
rowHeight: ae ? Re : z,
|
|
1579
|
+
width: re,
|
|
1580
|
+
height: l(s),
|
|
1662
1581
|
class: o.e("body"),
|
|
1663
1582
|
role: "rowgroup",
|
|
1664
|
-
scrollbarStartGap:
|
|
1665
|
-
scrollbarEndGap:
|
|
1583
|
+
scrollbarStartGap: L,
|
|
1584
|
+
scrollbarEndGap: R,
|
|
1666
1585
|
scrollbarAlwaysOn: G,
|
|
1667
|
-
onScroll:
|
|
1668
|
-
onItemRendered:
|
|
1586
|
+
onScroll: ue,
|
|
1587
|
+
onItemRendered: b,
|
|
1669
1588
|
perfMode: !1
|
|
1670
|
-
}, {
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
}), n(c) && C(Mo, {
|
|
1681
|
-
ref: m,
|
|
1589
|
+
}, { default: (se) => {
|
|
1590
|
+
var ne;
|
|
1591
|
+
const ee = S[se.rowIndex];
|
|
1592
|
+
return (ne = t.row) == null ? void 0 : ne.call(t, {
|
|
1593
|
+
...se,
|
|
1594
|
+
columns: p,
|
|
1595
|
+
rowData: ee
|
|
1596
|
+
});
|
|
1597
|
+
} }), l(h) && E(Lo, {
|
|
1598
|
+
ref: g,
|
|
1682
1599
|
class: o.e("header-wrapper"),
|
|
1683
|
-
columns:
|
|
1684
|
-
headerData:
|
|
1600
|
+
columns: p,
|
|
1601
|
+
headerData: S,
|
|
1685
1602
|
headerHeight: e.headerHeight,
|
|
1686
|
-
fixedHeaderData:
|
|
1687
|
-
rowWidth:
|
|
1688
|
-
rowHeight:
|
|
1689
|
-
width:
|
|
1690
|
-
height: Math.min(
|
|
1603
|
+
fixedHeaderData: W,
|
|
1604
|
+
rowWidth: j,
|
|
1605
|
+
rowHeight: z,
|
|
1606
|
+
width: re,
|
|
1607
|
+
height: Math.min(be + l(a), U)
|
|
1691
1608
|
}, {
|
|
1692
1609
|
dynamic: t.header,
|
|
1693
1610
|
fixed: t.row
|
|
@@ -1695,889 +1612,640 @@ const Io = ({ atXEndEdge: e, atXStartEdge: t, atYEndEdge: l, atYStartEdge: o },
|
|
|
1695
1612
|
};
|
|
1696
1613
|
}
|
|
1697
1614
|
});
|
|
1698
|
-
|
|
1699
|
-
function
|
|
1700
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Ne(e);
|
|
1615
|
+
function No(e) {
|
|
1616
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ze(e);
|
|
1701
1617
|
}
|
|
1702
|
-
const
|
|
1703
|
-
|
|
1704
|
-
}) =>
|
|
1705
|
-
const {
|
|
1706
|
-
mainTableRef: l,
|
|
1707
|
-
...o
|
|
1708
|
-
} = e;
|
|
1709
|
-
return C(pt, Y({
|
|
1710
|
-
ref: l
|
|
1711
|
-
}, o), Fo(t) ? t : {
|
|
1712
|
-
default: () => [t]
|
|
1713
|
-
});
|
|
1618
|
+
const Do = (e, { slots: t }) => {
|
|
1619
|
+
const { mainTableRef: n, ...o } = e;
|
|
1620
|
+
return E(Ot, q({ ref: n }, o), No(t) ? t : { default: () => [t] });
|
|
1714
1621
|
};
|
|
1715
|
-
|
|
1716
|
-
function
|
|
1717
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Ne(e);
|
|
1622
|
+
function Po(e) {
|
|
1623
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ze(e);
|
|
1718
1624
|
}
|
|
1719
|
-
const
|
|
1720
|
-
slots: t
|
|
1721
|
-
}) => {
|
|
1625
|
+
const Fo = (e, { slots: t }) => {
|
|
1722
1626
|
if (!e.columns.length)
|
|
1723
1627
|
return;
|
|
1724
|
-
const {
|
|
1725
|
-
|
|
1726
|
-
...o
|
|
1727
|
-
} = e;
|
|
1728
|
-
return C(pt, Y({
|
|
1729
|
-
ref: l
|
|
1730
|
-
}, o), ko(t) ? t : {
|
|
1731
|
-
default: () => [t]
|
|
1732
|
-
});
|
|
1628
|
+
const { leftTableRef: n, ...o } = e;
|
|
1629
|
+
return E(Ot, q({ ref: n }, o), Po(t) ? t : { default: () => [t] });
|
|
1733
1630
|
};
|
|
1734
|
-
|
|
1735
|
-
function
|
|
1736
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Ne(e);
|
|
1631
|
+
function Wo(e) {
|
|
1632
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ze(e);
|
|
1737
1633
|
}
|
|
1738
|
-
const
|
|
1739
|
-
slots: t
|
|
1740
|
-
}) => {
|
|
1634
|
+
const ko = (e, { slots: t }) => {
|
|
1741
1635
|
if (!e.columns.length)
|
|
1742
1636
|
return;
|
|
1743
|
-
const {
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
} = e
|
|
1747
|
-
|
|
1748
|
-
ref: l
|
|
1749
|
-
}, o), jo(t) ? t : {
|
|
1750
|
-
default: () => [t]
|
|
1751
|
-
});
|
|
1752
|
-
};
|
|
1753
|
-
var qo = Bo;
|
|
1754
|
-
const Uo = (e) => {
|
|
1755
|
-
const {
|
|
1756
|
-
isScrolling: t
|
|
1757
|
-
} = Et(_t), l = F(!1), o = F(), a = E(() => Q(e.estimatedRowHeight) && e.rowIndex >= 0), r = (m = !1) => {
|
|
1758
|
-
const f = n(o);
|
|
1637
|
+
const { rightTableRef: n, ...o } = e;
|
|
1638
|
+
return E(Ot, q({ ref: n }, o), Wo(t) ? t : { default: () => [t] });
|
|
1639
|
+
}, Vo = (e) => {
|
|
1640
|
+
const { isScrolling: t } = Ht(At), n = P(!1), o = P(), r = T(() => X(e.estimatedRowHeight) && e.rowIndex >= 0), a = (g = !1) => {
|
|
1641
|
+
const f = l(o);
|
|
1759
1642
|
if (!f)
|
|
1760
1643
|
return;
|
|
1761
|
-
const {
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
l.value = !0, Se(() => {
|
|
1771
|
-
if (m || h !== Number.parseInt(w.height)) {
|
|
1772
|
-
const d = u[0], i = (d == null ? void 0 : d.placeholderSign) === Ue;
|
|
1773
|
-
v == null || v({
|
|
1774
|
-
rowKey: b,
|
|
1775
|
-
height: h,
|
|
1776
|
-
rowIndex: y
|
|
1777
|
-
}, d && !i && d.fixed);
|
|
1644
|
+
const { columns: i, onRowHeightChange: m, rowKey: v, rowIndex: b, style: y } = e, { height: c } = f.getBoundingClientRect();
|
|
1645
|
+
n.value = !0, ve(() => {
|
|
1646
|
+
if (g || c !== Number.parseInt(y.height)) {
|
|
1647
|
+
const u = i[0], d = (u == null ? void 0 : u.placeholderSign) === qe;
|
|
1648
|
+
m == null || m({
|
|
1649
|
+
rowKey: v,
|
|
1650
|
+
height: c,
|
|
1651
|
+
rowIndex: b
|
|
1652
|
+
}, u && !d && u.fixed);
|
|
1778
1653
|
}
|
|
1779
1654
|
});
|
|
1780
|
-
}, s =
|
|
1781
|
-
const {
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
return Object.entries(b).forEach(([w, h]) => {
|
|
1788
|
-
Tt(h) && (y[w] = (d) => {
|
|
1789
|
-
h({
|
|
1790
|
-
event: d,
|
|
1791
|
-
rowData: m,
|
|
1655
|
+
}, s = T(() => {
|
|
1656
|
+
const { rowData: g, rowIndex: f, rowKey: i, onRowHover: m } = e, v = e.rowEventHandlers || {}, b = {};
|
|
1657
|
+
return Object.entries(v).forEach(([y, c]) => {
|
|
1658
|
+
$e(c) && (b[y] = (u) => {
|
|
1659
|
+
c({
|
|
1660
|
+
event: u,
|
|
1661
|
+
rowData: g,
|
|
1792
1662
|
rowIndex: f,
|
|
1793
|
-
rowKey:
|
|
1663
|
+
rowKey: i
|
|
1794
1664
|
});
|
|
1795
1665
|
});
|
|
1796
|
-
}),
|
|
1666
|
+
}), m && [{
|
|
1797
1667
|
name: "onMouseleave",
|
|
1798
1668
|
hovered: !1
|
|
1799
1669
|
}, {
|
|
1800
1670
|
name: "onMouseenter",
|
|
1801
1671
|
hovered: !0
|
|
1802
|
-
}].forEach(({
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
event: i,
|
|
1810
|
-
hovered: h,
|
|
1811
|
-
rowData: m,
|
|
1672
|
+
}].forEach(({ name: y, hovered: c }) => {
|
|
1673
|
+
const u = b[y];
|
|
1674
|
+
b[y] = (d) => {
|
|
1675
|
+
m({
|
|
1676
|
+
event: d,
|
|
1677
|
+
hovered: c,
|
|
1678
|
+
rowData: g,
|
|
1812
1679
|
rowIndex: f,
|
|
1813
|
-
rowKey:
|
|
1814
|
-
}),
|
|
1680
|
+
rowKey: i
|
|
1681
|
+
}), u == null || u(d);
|
|
1815
1682
|
};
|
|
1816
|
-
}),
|
|
1817
|
-
}),
|
|
1818
|
-
const {
|
|
1819
|
-
onRowExpand: f,
|
|
1820
|
-
rowData: u,
|
|
1821
|
-
rowIndex: v,
|
|
1822
|
-
rowKey: b
|
|
1823
|
-
} = e;
|
|
1683
|
+
}), b;
|
|
1684
|
+
}), h = (g) => {
|
|
1685
|
+
const { onRowExpand: f, rowData: i, rowIndex: m, rowKey: v } = e;
|
|
1824
1686
|
f == null || f({
|
|
1825
|
-
expanded:
|
|
1826
|
-
rowData:
|
|
1827
|
-
rowIndex:
|
|
1828
|
-
rowKey:
|
|
1687
|
+
expanded: g,
|
|
1688
|
+
rowData: i,
|
|
1689
|
+
rowIndex: m,
|
|
1690
|
+
rowKey: v
|
|
1829
1691
|
});
|
|
1830
1692
|
};
|
|
1831
|
-
return
|
|
1832
|
-
|
|
1693
|
+
return ct(() => {
|
|
1694
|
+
l(r) && a(!0);
|
|
1833
1695
|
}), {
|
|
1834
1696
|
isScrolling: t,
|
|
1835
|
-
measurable:
|
|
1836
|
-
measured:
|
|
1697
|
+
measurable: r,
|
|
1698
|
+
measured: n,
|
|
1837
1699
|
rowRef: o,
|
|
1838
1700
|
eventHandlers: s,
|
|
1839
|
-
onExpand:
|
|
1701
|
+
onExpand: h
|
|
1840
1702
|
};
|
|
1841
|
-
},
|
|
1842
|
-
name:
|
|
1843
|
-
props:
|
|
1844
|
-
setup(e, {
|
|
1845
|
-
|
|
1846
|
-
slots: l,
|
|
1847
|
-
attrs: o
|
|
1848
|
-
}) {
|
|
1849
|
-
const {
|
|
1850
|
-
eventHandlers: a,
|
|
1851
|
-
isScrolling: r,
|
|
1852
|
-
measurable: s,
|
|
1853
|
-
measured: c,
|
|
1854
|
-
rowRef: m,
|
|
1855
|
-
onExpand: f
|
|
1856
|
-
} = Uo(e);
|
|
1703
|
+
}, Go = /* @__PURE__ */ xe({
|
|
1704
|
+
name: "ElTableV2TableRow",
|
|
1705
|
+
props: _e,
|
|
1706
|
+
setup(e, { expose: t, slots: n, attrs: o }) {
|
|
1707
|
+
const { eventHandlers: r, isScrolling: a, measurable: s, measured: h, rowRef: g, onExpand: f } = Vo(e);
|
|
1857
1708
|
return t({
|
|
1709
|
+
/**
|
|
1710
|
+
* @description manually dispatching expand action on row.
|
|
1711
|
+
*/
|
|
1858
1712
|
onExpand: f
|
|
1859
1713
|
}), () => {
|
|
1860
|
-
const {
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
depth: y,
|
|
1876
|
-
style: v[g.key],
|
|
1877
|
-
rowData: w,
|
|
1878
|
-
rowIndex: h,
|
|
1879
|
-
isScrolling: n(r),
|
|
1880
|
-
expandIconProps: H ? {
|
|
1881
|
-
rowData: w,
|
|
1882
|
-
rowIndex: h,
|
|
1714
|
+
const { columns: i, columnsStyles: m, expandColumnKey: v, depth: b, rowData: y, rowIndex: c, style: u } = e;
|
|
1715
|
+
let d = i.map((w, x) => {
|
|
1716
|
+
const M = Ve(y.children) && y.children.length > 0 && w.key === v;
|
|
1717
|
+
return n.cell({
|
|
1718
|
+
column: w,
|
|
1719
|
+
columns: i,
|
|
1720
|
+
columnIndex: x,
|
|
1721
|
+
depth: b,
|
|
1722
|
+
style: m[w.key],
|
|
1723
|
+
rowData: y,
|
|
1724
|
+
rowIndex: c,
|
|
1725
|
+
isScrolling: l(a),
|
|
1726
|
+
expandIconProps: M ? {
|
|
1727
|
+
rowData: y,
|
|
1728
|
+
rowIndex: c,
|
|
1883
1729
|
onExpand: f
|
|
1884
1730
|
} : void 0
|
|
1885
1731
|
});
|
|
1886
1732
|
});
|
|
1887
|
-
if (
|
|
1888
|
-
cells:
|
|
1889
|
-
style:
|
|
1890
|
-
columns:
|
|
1891
|
-
depth:
|
|
1892
|
-
rowData:
|
|
1893
|
-
rowIndex:
|
|
1894
|
-
isScrolling:
|
|
1895
|
-
})),
|
|
1896
|
-
const {
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
} = d || {}, H = n(c);
|
|
1900
|
-
return C("div", Y({
|
|
1901
|
-
ref: m,
|
|
1733
|
+
if (n.row && (d = n.row({
|
|
1734
|
+
cells: d.map((w) => Ve(w) && w.length === 1 ? w[0] : w),
|
|
1735
|
+
style: u,
|
|
1736
|
+
columns: i,
|
|
1737
|
+
depth: b,
|
|
1738
|
+
rowData: y,
|
|
1739
|
+
rowIndex: c,
|
|
1740
|
+
isScrolling: l(a)
|
|
1741
|
+
})), l(s)) {
|
|
1742
|
+
const { height: w, ...x } = u || {}, M = l(h);
|
|
1743
|
+
return E("div", q({
|
|
1744
|
+
ref: g,
|
|
1902
1745
|
class: e.class,
|
|
1903
|
-
style:
|
|
1746
|
+
style: M ? u : x,
|
|
1904
1747
|
role: "row"
|
|
1905
|
-
}, o,
|
|
1748
|
+
}, o, l(r)), [d]);
|
|
1906
1749
|
}
|
|
1907
|
-
return
|
|
1908
|
-
ref:
|
|
1750
|
+
return E("div", q(o, {
|
|
1751
|
+
ref: g,
|
|
1909
1752
|
class: e.class,
|
|
1910
|
-
style:
|
|
1753
|
+
style: u,
|
|
1911
1754
|
role: "row"
|
|
1912
|
-
},
|
|
1755
|
+
}, l(r)), [d]);
|
|
1913
1756
|
};
|
|
1914
1757
|
}
|
|
1915
1758
|
});
|
|
1916
|
-
|
|
1917
|
-
function
|
|
1918
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Ne(e);
|
|
1759
|
+
function Ko(e) {
|
|
1760
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ze(e);
|
|
1919
1761
|
}
|
|
1920
|
-
const
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
const {
|
|
1924
|
-
columns: l,
|
|
1925
|
-
columnsStyles: o,
|
|
1926
|
-
depthMap: a,
|
|
1927
|
-
expandColumnKey: r,
|
|
1928
|
-
expandedRowKeys: s,
|
|
1929
|
-
estimatedRowHeight: c,
|
|
1930
|
-
hasFixedColumns: m,
|
|
1931
|
-
rowData: f,
|
|
1932
|
-
rowIndex: u,
|
|
1933
|
-
style: v,
|
|
1934
|
-
isScrolling: b,
|
|
1935
|
-
rowProps: y,
|
|
1936
|
-
rowClass: w,
|
|
1937
|
-
rowKey: h,
|
|
1938
|
-
rowEventHandlers: d,
|
|
1939
|
-
ns: i,
|
|
1940
|
-
onRowHovered: g,
|
|
1941
|
-
onRowExpanded: S
|
|
1942
|
-
} = e, H = Ae(w, {
|
|
1943
|
-
columns: l,
|
|
1762
|
+
const Bo = (e, { slots: t }) => {
|
|
1763
|
+
const { columns: n, columnsStyles: o, depthMap: r, expandColumnKey: a, expandedRowKeys: s, estimatedRowHeight: h, hasFixedColumns: g, rowData: f, rowIndex: i, style: m, isScrolling: v, rowProps: b, rowClass: y, rowKey: c, rowEventHandlers: u, ns: d, onRowHovered: w, onRowExpanded: x } = e, M = Le(y, {
|
|
1764
|
+
columns: n,
|
|
1944
1765
|
rowData: f,
|
|
1945
|
-
rowIndex:
|
|
1946
|
-
}, ""),
|
|
1947
|
-
columns:
|
|
1766
|
+
rowIndex: i
|
|
1767
|
+
}, ""), p = Le(b, {
|
|
1768
|
+
columns: n,
|
|
1948
1769
|
rowData: f,
|
|
1949
|
-
rowIndex:
|
|
1950
|
-
}),
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1770
|
+
rowIndex: i
|
|
1771
|
+
}), S = f[c], W = r[S] || 0, k = !!a, G = i < 0, R = [
|
|
1772
|
+
d.e("row"),
|
|
1773
|
+
M,
|
|
1774
|
+
d.is("expanded", k && s.includes(S)),
|
|
1775
|
+
d.is("fixed", !W && G),
|
|
1776
|
+
d.is("customized", !!t.row),
|
|
1777
|
+
{ [d.e(`row-depth-${W}`)]: k && i >= 0 }
|
|
1778
|
+
], L = g ? w : void 0, F = {
|
|
1779
|
+
...p,
|
|
1780
|
+
columns: n,
|
|
1958
1781
|
columnsStyles: o,
|
|
1959
|
-
class:
|
|
1960
|
-
depth:
|
|
1961
|
-
expandColumnKey:
|
|
1962
|
-
estimatedRowHeight: G ? void 0 :
|
|
1963
|
-
isScrolling:
|
|
1964
|
-
rowIndex:
|
|
1782
|
+
class: R,
|
|
1783
|
+
depth: W,
|
|
1784
|
+
expandColumnKey: a,
|
|
1785
|
+
estimatedRowHeight: G ? void 0 : h,
|
|
1786
|
+
isScrolling: v,
|
|
1787
|
+
rowIndex: i,
|
|
1965
1788
|
rowData: f,
|
|
1966
|
-
rowKey:
|
|
1967
|
-
rowEventHandlers:
|
|
1968
|
-
style:
|
|
1789
|
+
rowKey: S,
|
|
1790
|
+
rowEventHandlers: u,
|
|
1791
|
+
style: m
|
|
1969
1792
|
};
|
|
1970
|
-
return
|
|
1971
|
-
onRowExpand:
|
|
1793
|
+
return E(Go, q(F, {
|
|
1794
|
+
onRowExpand: x,
|
|
1972
1795
|
onMouseenter: (B) => {
|
|
1973
|
-
|
|
1796
|
+
L == null || L({
|
|
1974
1797
|
hovered: !0,
|
|
1975
|
-
rowKey:
|
|
1798
|
+
rowKey: S,
|
|
1976
1799
|
event: B,
|
|
1977
1800
|
rowData: f,
|
|
1978
|
-
rowIndex:
|
|
1801
|
+
rowIndex: i
|
|
1979
1802
|
});
|
|
1980
1803
|
},
|
|
1981
1804
|
onMouseleave: (B) => {
|
|
1982
|
-
|
|
1805
|
+
L == null || L({
|
|
1983
1806
|
hovered: !1,
|
|
1984
|
-
rowKey:
|
|
1807
|
+
rowKey: S,
|
|
1985
1808
|
event: B,
|
|
1986
1809
|
rowData: f,
|
|
1987
|
-
rowIndex:
|
|
1810
|
+
rowIndex: i
|
|
1988
1811
|
});
|
|
1989
1812
|
},
|
|
1990
|
-
rowkey:
|
|
1991
|
-
}),
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
};
|
|
1995
|
-
|
|
1996
|
-
const Mt = (e, {
|
|
1997
|
-
slots: t
|
|
1998
|
-
}) => {
|
|
1999
|
-
var l;
|
|
2000
|
-
const {
|
|
2001
|
-
cellData: o,
|
|
2002
|
-
style: a
|
|
2003
|
-
} = e, r = ((l = o == null ? void 0 : o.toString) == null ? void 0 : l.call(o)) || "", s = Ye(t, "default", e, () => [r]);
|
|
2004
|
-
return C("div", {
|
|
1813
|
+
rowkey: S
|
|
1814
|
+
}), Ko(t) ? t : { default: () => [t] });
|
|
1815
|
+
}, Lt = (e, { slots: t }) => {
|
|
1816
|
+
var s;
|
|
1817
|
+
const { cellData: n, style: o } = e, r = ((s = n == null ? void 0 : n.toString) == null ? void 0 : s.call(n)) || "", a = Ue(t, "default", e, () => [r]);
|
|
1818
|
+
return E("div", {
|
|
2005
1819
|
class: e.class,
|
|
2006
1820
|
title: r,
|
|
2007
|
-
style:
|
|
2008
|
-
}, [
|
|
1821
|
+
style: o
|
|
1822
|
+
}, [a]);
|
|
2009
1823
|
};
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
const
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
style: a,
|
|
2019
|
-
size: r
|
|
2020
|
-
} = e, s = {
|
|
2021
|
-
onClick: l ? () => o(!t) : void 0,
|
|
1824
|
+
Lt.displayName = "ElTableV2Cell";
|
|
1825
|
+
Lt.inheritAttrs = !1;
|
|
1826
|
+
const Hn = (e) => {
|
|
1827
|
+
const { expanded: t, expandable: n, onExpand: o, style: r, size: a, ariaLabel: s } = e;
|
|
1828
|
+
return E("button", q({
|
|
1829
|
+
onClick: n ? () => o(!t) : void 0,
|
|
1830
|
+
ariaLabel: s,
|
|
1831
|
+
ariaExpanded: t,
|
|
2022
1832
|
class: e.class
|
|
2023
|
-
}
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
}), {
|
|
2028
|
-
default: () => [C(lo, null, null)]
|
|
2029
|
-
});
|
|
1833
|
+
}, { type: "button" }), [E(rn, {
|
|
1834
|
+
size: a,
|
|
1835
|
+
style: r
|
|
1836
|
+
}, { default: () => [E(eo, null, null)] })]);
|
|
2030
1837
|
};
|
|
2031
|
-
|
|
2032
|
-
const
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
isScrolling: r,
|
|
2039
|
-
rowData: s,
|
|
2040
|
-
rowIndex: c,
|
|
2041
|
-
style: m,
|
|
2042
|
-
expandedRowKeys: f,
|
|
2043
|
-
ns: u,
|
|
2044
|
-
cellProps: v,
|
|
2045
|
-
expandColumnKey: b,
|
|
2046
|
-
indentSize: y,
|
|
2047
|
-
iconSize: w,
|
|
2048
|
-
rowKey: h
|
|
2049
|
-
}, {
|
|
2050
|
-
slots: d
|
|
2051
|
-
}) => {
|
|
2052
|
-
const i = be(m);
|
|
2053
|
-
if (t.placeholderSign === Ue)
|
|
2054
|
-
return C("div", {
|
|
2055
|
-
class: u.em("row-cell", "placeholder"),
|
|
2056
|
-
style: i
|
|
1838
|
+
Hn.inheritAttrs = !1;
|
|
1839
|
+
const Et = ({ columns: e, column: t, columnIndex: n, depth: o, expandIconProps: r, isScrolling: a, rowData: s, rowIndex: h, style: g, expandedRowKeys: f, ns: i, t: m, cellProps: v, expandColumnKey: b, indentSize: y, iconSize: c, rowKey: u }, { slots: d }) => {
|
|
1840
|
+
const w = we(g);
|
|
1841
|
+
if (t.placeholderSign === qe)
|
|
1842
|
+
return E("div", {
|
|
1843
|
+
class: i.em("row-cell", "placeholder"),
|
|
1844
|
+
style: w
|
|
2057
1845
|
}, null);
|
|
2058
|
-
const {
|
|
2059
|
-
cellRenderer: g,
|
|
2060
|
-
dataKey: S,
|
|
2061
|
-
dataGetter: H
|
|
2062
|
-
} = t, M = Tt(H) ? H({
|
|
1846
|
+
const { cellRenderer: x, dataKey: M, dataGetter: p } = t, S = $e(p) ? p({
|
|
2063
1847
|
columns: e,
|
|
2064
1848
|
column: t,
|
|
2065
|
-
columnIndex:
|
|
1849
|
+
columnIndex: n,
|
|
2066
1850
|
rowData: s,
|
|
2067
|
-
rowIndex:
|
|
2068
|
-
}) :
|
|
2069
|
-
cellData:
|
|
1851
|
+
rowIndex: h
|
|
1852
|
+
}) : Wn(s, M ?? ""), W = Le(v, {
|
|
1853
|
+
cellData: S,
|
|
2070
1854
|
columns: e,
|
|
2071
1855
|
column: t,
|
|
2072
|
-
columnIndex:
|
|
2073
|
-
rowIndex:
|
|
1856
|
+
columnIndex: n,
|
|
1857
|
+
rowIndex: h,
|
|
2074
1858
|
rowData: s
|
|
2075
|
-
}),
|
|
2076
|
-
class:
|
|
1859
|
+
}), k = {
|
|
1860
|
+
class: i.e("cell-text"),
|
|
2077
1861
|
columns: e,
|
|
2078
1862
|
column: t,
|
|
2079
|
-
columnIndex:
|
|
2080
|
-
cellData:
|
|
2081
|
-
isScrolling:
|
|
1863
|
+
columnIndex: n,
|
|
1864
|
+
cellData: S,
|
|
1865
|
+
isScrolling: a,
|
|
2082
1866
|
rowData: s,
|
|
2083
|
-
rowIndex:
|
|
2084
|
-
},
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
1867
|
+
rowIndex: h
|
|
1868
|
+
}, G = En(x), R = G ? G(k) : Ue(d, "default", k, () => [E(Lt, k, null)]), L = [
|
|
1869
|
+
i.e("row-cell"),
|
|
1870
|
+
t.class,
|
|
1871
|
+
t.align === "center" && i.is("align-center"),
|
|
1872
|
+
t.align === "right" && i.is("align-right")
|
|
1873
|
+
], F = h >= 0 && b && t.key === b, z = h >= 0 && f.includes(s[u]);
|
|
1874
|
+
let K;
|
|
1875
|
+
const B = `margin-inline-start: ${o * y}px;`;
|
|
1876
|
+
return F && (Ct(r) ? K = E(Hn, q(r, {
|
|
1877
|
+
class: [i.e("expand-icon"), i.is("expanded", z)],
|
|
1878
|
+
size: c,
|
|
1879
|
+
expanded: z,
|
|
1880
|
+
ariaLabel: m(z ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"),
|
|
1881
|
+
style: B,
|
|
2092
1882
|
expandable: !0
|
|
2093
|
-
}), null) :
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
style: i
|
|
2098
|
-
}, R, {
|
|
2099
|
-
role: "cell"
|
|
2100
|
-
}), [N, G]);
|
|
1883
|
+
}), null) : K = E("div", { style: [B, `width: ${c}px; height: ${c}px;`].join(" ") }, null)), E("div", q({
|
|
1884
|
+
class: L,
|
|
1885
|
+
style: w
|
|
1886
|
+
}, W, { role: "cell" }), [K, R]);
|
|
2101
1887
|
};
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
const nn = ae({
|
|
1888
|
+
Et.inheritAttrs = !1;
|
|
1889
|
+
const jo = ie({
|
|
2105
1890
|
class: String,
|
|
2106
|
-
columns:
|
|
1891
|
+
columns: Ye,
|
|
2107
1892
|
columnsStyles: {
|
|
2108
|
-
type:
|
|
1893
|
+
type: A(Object),
|
|
2109
1894
|
required: !0
|
|
2110
1895
|
},
|
|
2111
1896
|
headerIndex: Number,
|
|
2112
|
-
style: { type:
|
|
2113
|
-
}),
|
|
1897
|
+
style: { type: A(Object) }
|
|
1898
|
+
}), $o = /* @__PURE__ */ xe({
|
|
2114
1899
|
name: "ElTableV2HeaderRow",
|
|
2115
|
-
props:
|
|
2116
|
-
setup(e, {
|
|
2117
|
-
slots: t
|
|
2118
|
-
}) {
|
|
1900
|
+
props: jo,
|
|
1901
|
+
setup(e, { slots: t }) {
|
|
2119
1902
|
return () => {
|
|
2120
|
-
const {
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
columns: l,
|
|
2128
|
-
column: c,
|
|
2129
|
-
columnIndex: m,
|
|
2130
|
-
headerIndex: a,
|
|
2131
|
-
style: o[c.key]
|
|
1903
|
+
const { columns: n, columnsStyles: o, headerIndex: r, style: a } = e;
|
|
1904
|
+
let s = n.map((h, g) => t.cell({
|
|
1905
|
+
columns: n,
|
|
1906
|
+
column: h,
|
|
1907
|
+
columnIndex: g,
|
|
1908
|
+
headerIndex: r,
|
|
1909
|
+
style: o[h.key]
|
|
2132
1910
|
}));
|
|
2133
1911
|
return t.header && (s = t.header({
|
|
2134
|
-
cells: s.map((
|
|
2135
|
-
columns:
|
|
2136
|
-
headerIndex:
|
|
2137
|
-
})),
|
|
1912
|
+
cells: s.map((h) => Ve(h) && h.length === 1 ? h[0] : h),
|
|
1913
|
+
columns: n,
|
|
1914
|
+
headerIndex: r
|
|
1915
|
+
})), E("div", {
|
|
2138
1916
|
class: e.class,
|
|
2139
|
-
style:
|
|
1917
|
+
style: a,
|
|
2140
1918
|
role: "row"
|
|
2141
1919
|
}, [s]);
|
|
2142
1920
|
};
|
|
2143
1921
|
}
|
|
2144
1922
|
});
|
|
2145
|
-
|
|
2146
|
-
function
|
|
2147
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Ne(e);
|
|
1923
|
+
function qo(e) {
|
|
1924
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ze(e);
|
|
2148
1925
|
}
|
|
2149
|
-
const
|
|
2150
|
-
|
|
2151
|
-
columnsStyles: t,
|
|
2152
|
-
headerIndex: l,
|
|
2153
|
-
style: o,
|
|
2154
|
-
headerClass: a,
|
|
2155
|
-
headerProps: r,
|
|
2156
|
-
ns: s
|
|
2157
|
-
}, {
|
|
2158
|
-
slots: c
|
|
2159
|
-
}) => {
|
|
2160
|
-
const m = {
|
|
1926
|
+
const Uo = ({ columns: e, columnsStyles: t, headerIndex: n, style: o, headerClass: r, headerProps: a, ns: s }, { slots: h }) => {
|
|
1927
|
+
const g = {
|
|
2161
1928
|
columns: e,
|
|
2162
|
-
headerIndex:
|
|
2163
|
-
}, f = [
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
1929
|
+
headerIndex: n
|
|
1930
|
+
}, f = [
|
|
1931
|
+
s.e("header-row"),
|
|
1932
|
+
Le(r, g, ""),
|
|
1933
|
+
s.is("customized", !!h.header)
|
|
1934
|
+
];
|
|
1935
|
+
return E($o, {
|
|
1936
|
+
...Le(a, g),
|
|
2167
1937
|
columnsStyles: t,
|
|
2168
1938
|
class: f,
|
|
2169
1939
|
columns: e,
|
|
2170
|
-
headerIndex:
|
|
1940
|
+
headerIndex: n,
|
|
2171
1941
|
style: o
|
|
2172
|
-
};
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
};
|
|
2177
|
-
var dn = cn;
|
|
2178
|
-
const It = (e, {
|
|
2179
|
-
slots: t
|
|
2180
|
-
}) => Ye(t, "default", e, () => {
|
|
2181
|
-
var l, o;
|
|
2182
|
-
return [C("div", {
|
|
1942
|
+
}, qo(h) ? h : { default: () => [h] });
|
|
1943
|
+
}, It = (e, { slots: t }) => Ue(t, "default", e, () => {
|
|
1944
|
+
var n, o;
|
|
1945
|
+
return [E("div", {
|
|
2183
1946
|
class: e.class,
|
|
2184
|
-
title: (
|
|
1947
|
+
title: (n = e.column) == null ? void 0 : n.title
|
|
2185
1948
|
}, [(o = e.column) == null ? void 0 : o.title])];
|
|
2186
1949
|
});
|
|
2187
1950
|
It.displayName = "ElTableV2HeaderCell";
|
|
2188
1951
|
It.inheritAttrs = !1;
|
|
2189
|
-
|
|
2190
|
-
const
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
return C(rl, {
|
|
2195
|
-
size: 14,
|
|
1952
|
+
const Yo = (e) => {
|
|
1953
|
+
const { sortOrder: t } = e;
|
|
1954
|
+
return E("button", {
|
|
1955
|
+
type: "button",
|
|
1956
|
+
"aria-label": e.ariaLabel,
|
|
2196
1957
|
class: e.class
|
|
2197
|
-
}, {
|
|
2198
|
-
|
|
2199
|
-
});
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
const mn = (e, {
|
|
2203
|
-
slots: t
|
|
2204
|
-
}) => {
|
|
2205
|
-
const {
|
|
2206
|
-
column: l,
|
|
2207
|
-
ns: o,
|
|
2208
|
-
style: a,
|
|
2209
|
-
onColumnSorted: r
|
|
2210
|
-
} = e, s = be(a);
|
|
2211
|
-
if (l.placeholderSign === Ue)
|
|
2212
|
-
return C("div", {
|
|
1958
|
+
}, [E(rn, { size: 14 }, { default: () => [t === "asc" ? E(to, null, null) : E(no, null, null)] })]);
|
|
1959
|
+
}, Qt = (e, { slots: t }) => {
|
|
1960
|
+
const { column: n, ns: o, t: r, style: a, onColumnSorted: s } = e, h = we(a);
|
|
1961
|
+
if (n.placeholderSign === qe)
|
|
1962
|
+
return E("div", {
|
|
2213
1963
|
class: o.em("header-row-cell", "placeholder"),
|
|
2214
|
-
style:
|
|
1964
|
+
style: h
|
|
2215
1965
|
}, null);
|
|
2216
|
-
const {
|
|
2217
|
-
headerCellRenderer: c,
|
|
2218
|
-
headerClass: m,
|
|
2219
|
-
sortable: f
|
|
2220
|
-
} = l, u = {
|
|
1966
|
+
const { headerCellRenderer: g, headerClass: f, sortable: i } = n, m = {
|
|
2221
1967
|
...e,
|
|
2222
1968
|
class: o.e("header-cell-text")
|
|
2223
|
-
}, v =
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
let d, i;
|
|
2229
|
-
if (w) {
|
|
2230
|
-
const H = w[l.key];
|
|
2231
|
-
d = !!St[H], i = d ? H : Be.ASC;
|
|
1969
|
+
}, v = En(g), b = v ? v(m) : Ue(t, "default", m, () => [E(It, m, null)]), { sortBy: y, sortState: c, headerCellProps: u } = e;
|
|
1970
|
+
let d, w, x;
|
|
1971
|
+
if (c) {
|
|
1972
|
+
const p = c[n.key];
|
|
1973
|
+
d = !!Tt[p], w = d ? p : "asc";
|
|
2232
1974
|
} else
|
|
2233
|
-
d =
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
"
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
1975
|
+
d = n.key === y.key, w = d ? y.order : "asc";
|
|
1976
|
+
w === "asc" ? x = "ascending" : w === "desc" ? x = "descending" : x = void 0;
|
|
1977
|
+
const M = [
|
|
1978
|
+
o.e("header-cell"),
|
|
1979
|
+
Le(f, e, ""),
|
|
1980
|
+
n.align === "center" && o.is("align-center"),
|
|
1981
|
+
n.align === "right" && o.is("align-right"),
|
|
1982
|
+
i && o.is("sortable")
|
|
1983
|
+
];
|
|
1984
|
+
return E("div", q({
|
|
1985
|
+
...Le(u, e),
|
|
1986
|
+
onClick: n.sortable ? s : void 0,
|
|
1987
|
+
ariaSort: i ? x : void 0,
|
|
1988
|
+
class: M,
|
|
1989
|
+
style: h,
|
|
1990
|
+
"data-key": n.key
|
|
1991
|
+
}, { role: "columnheader" }), [b, i && E(Yo, {
|
|
2244
1992
|
class: [o.e("sort-icon"), d && o.is("sorting")],
|
|
2245
|
-
sortOrder:
|
|
1993
|
+
sortOrder: w,
|
|
1994
|
+
ariaLabel: r("el.table.sortLabel", { column: n.title || "" })
|
|
2246
1995
|
}, null)]);
|
|
2247
|
-
}
|
|
2248
|
-
var
|
|
2249
|
-
|
|
2250
|
-
slots: t
|
|
2251
|
-
}) => {
|
|
2252
|
-
var l;
|
|
2253
|
-
return C("div", {
|
|
1996
|
+
}, Mn = (e, { slots: t }) => {
|
|
1997
|
+
var n;
|
|
1998
|
+
return E("div", {
|
|
2254
1999
|
class: e.class,
|
|
2255
2000
|
style: e.style
|
|
2256
|
-
}, [(
|
|
2001
|
+
}, [(n = t.default) == null ? void 0 : n.call(t)]);
|
|
2257
2002
|
};
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
const
|
|
2261
|
-
|
|
2262
|
-
}) => {
|
|
2263
|
-
const l = Ye(t, "default", {}, () => [C(Qt, null, null)]);
|
|
2264
|
-
return C("div", {
|
|
2003
|
+
Mn.displayName = "ElTableV2Footer";
|
|
2004
|
+
const pn = (e, { slots: t }) => {
|
|
2005
|
+
const n = Ue(t, "default", {}, () => [E(en, null, null)]);
|
|
2006
|
+
return E("div", {
|
|
2265
2007
|
class: e.class,
|
|
2266
2008
|
style: e.style
|
|
2267
|
-
}, [
|
|
2009
|
+
}, [n]);
|
|
2268
2010
|
};
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
}) => {
|
|
2274
|
-
var l;
|
|
2275
|
-
return C("div", {
|
|
2011
|
+
pn.displayName = "ElTableV2Empty";
|
|
2012
|
+
const _n = (e, { slots: t }) => {
|
|
2013
|
+
var n;
|
|
2014
|
+
return E("div", {
|
|
2276
2015
|
class: e.class,
|
|
2277
2016
|
style: e.style
|
|
2278
|
-
}, [(
|
|
2017
|
+
}, [(n = t.default) == null ? void 0 : n.call(t)]);
|
|
2279
2018
|
};
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
function
|
|
2283
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Ne(e);
|
|
2019
|
+
_n.displayName = "ElTableV2Overlay";
|
|
2020
|
+
function je(e) {
|
|
2021
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !ze(e);
|
|
2284
2022
|
}
|
|
2285
|
-
const
|
|
2286
|
-
name:
|
|
2287
|
-
props:
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
footerHeight: G,
|
|
2315
|
-
showEmpty: x,
|
|
2316
|
-
scrollTo: A,
|
|
2317
|
-
scrollToLeft: W,
|
|
2318
|
-
scrollToTop: N,
|
|
2319
|
-
scrollToRow: j,
|
|
2320
|
-
getRowHeight: B,
|
|
2321
|
-
onColumnSorted: V,
|
|
2322
|
-
onRowHeightChange: U,
|
|
2323
|
-
onRowHovered: le,
|
|
2324
|
-
onRowExpanded: fe,
|
|
2325
|
-
onRowsRendered: se,
|
|
2326
|
-
onScroll: re,
|
|
2327
|
-
onVerticalScroll: me
|
|
2328
|
-
} = Eo(e);
|
|
2329
|
-
return l({
|
|
2330
|
-
scrollTo: A,
|
|
2331
|
-
scrollToLeft: W,
|
|
2332
|
-
scrollToTop: N,
|
|
2333
|
-
scrollToRow: j
|
|
2334
|
-
}), tl(_t, {
|
|
2023
|
+
const Xo = /* @__PURE__ */ xe({
|
|
2024
|
+
name: "ElTableV2",
|
|
2025
|
+
props: To,
|
|
2026
|
+
slots: Object,
|
|
2027
|
+
setup(e, { slots: t, expose: n }) {
|
|
2028
|
+
const o = Oe("table-v2"), { t: r } = kn(), { columnsStyles: a, fixedColumnsOnLeft: s, fixedColumnsOnRight: h, mainColumns: g, mainTableHeight: f, fixedTableHeight: i, leftTableWidth: m, rightTableWidth: v, data: b, depthMap: y, expandedRowKeys: c, hasFixedColumns: u, mainTableRef: d, leftTableRef: w, rightTableRef: x, isDynamic: M, isResetting: p, isScrolling: S, bodyWidth: W, emptyStyle: k, rootStyle: G, footerHeight: R, showEmpty: L, scrollTo: F, scrollToLeft: z, scrollToTop: K, scrollToRow: B, getRowHeight: j, onColumnSorted: U, onRowHeightChange: re, onRowHovered: Re, onRowExpanded: ue, onRowsRendered: ae, onScroll: Te, onVerticalScroll: be } = Oo(e);
|
|
2029
|
+
return n({
|
|
2030
|
+
/**
|
|
2031
|
+
* @description scroll to a given position
|
|
2032
|
+
* @params params {{ scrollLeft?: number, scrollTop?: number }} where to scroll to.
|
|
2033
|
+
*/
|
|
2034
|
+
scrollTo: F,
|
|
2035
|
+
/**
|
|
2036
|
+
* @description scroll to a given position horizontally
|
|
2037
|
+
* @params scrollLeft {Number} where to scroll to.
|
|
2038
|
+
*/
|
|
2039
|
+
scrollToLeft: z,
|
|
2040
|
+
/**
|
|
2041
|
+
* @description scroll to a given position vertically
|
|
2042
|
+
* @params scrollTop { Number } where to scroll to.
|
|
2043
|
+
*/
|
|
2044
|
+
scrollToTop: K,
|
|
2045
|
+
/**
|
|
2046
|
+
* @description scroll to a given row
|
|
2047
|
+
* @params row {Number} which row to scroll to
|
|
2048
|
+
* @params @optional strategy {ScrollStrategy} use what strategy to scroll to
|
|
2049
|
+
*/
|
|
2050
|
+
scrollToRow: B
|
|
2051
|
+
}), on(At, {
|
|
2335
2052
|
ns: o,
|
|
2336
|
-
isResetting:
|
|
2337
|
-
isScrolling:
|
|
2053
|
+
isResetting: p,
|
|
2054
|
+
isScrolling: S
|
|
2338
2055
|
}), () => {
|
|
2339
|
-
const {
|
|
2340
|
-
cache:
|
|
2341
|
-
cellProps: ve,
|
|
2342
|
-
estimatedRowHeight: Z,
|
|
2343
|
-
expandColumnKey: ge,
|
|
2344
|
-
fixedData: Te,
|
|
2345
|
-
headerHeight: ye,
|
|
2346
|
-
headerClass: Le,
|
|
2347
|
-
headerProps: Ge,
|
|
2348
|
-
headerCellProps: ke,
|
|
2349
|
-
sortBy: we,
|
|
2350
|
-
sortState: Ve,
|
|
2351
|
-
rowHeight: q,
|
|
2352
|
-
rowClass: oe,
|
|
2353
|
-
rowEventHandlers: ce,
|
|
2354
|
-
rowKey: T,
|
|
2355
|
-
rowProps: _,
|
|
2356
|
-
scrollbarAlwaysOn: p,
|
|
2357
|
-
indentSize: D,
|
|
2358
|
-
iconSize: L,
|
|
2359
|
-
useIsScrolling: O,
|
|
2360
|
-
vScrollbarSize: P,
|
|
2361
|
-
width: k
|
|
2362
|
-
} = e, K = n(b), X = {
|
|
2363
|
-
cache: ie,
|
|
2056
|
+
const { cache: se, cellProps: ee, estimatedRowHeight: ne, expandColumnKey: Ne, fixedData: Ee, headerHeight: Ce, headerClass: Ge, headerProps: Ke, headerCellProps: de, sortBy: De, sortState: Z, rowHeight: Q, rowClass: ce, rowEventHandlers: he, rowKey: fe, rowProps: it, scrollbarAlwaysOn: Xe, indentSize: H, iconSize: C, useIsScrolling: _, vScrollbarSize: N, width: O } = e, I = l(b), D = {
|
|
2057
|
+
cache: se,
|
|
2364
2058
|
class: o.e("main"),
|
|
2365
|
-
columns:
|
|
2366
|
-
data:
|
|
2367
|
-
fixedData:
|
|
2368
|
-
estimatedRowHeight:
|
|
2369
|
-
bodyWidth:
|
|
2370
|
-
headerHeight:
|
|
2371
|
-
headerWidth:
|
|
2372
|
-
height:
|
|
2059
|
+
columns: l(g),
|
|
2060
|
+
data: I,
|
|
2061
|
+
fixedData: Ee,
|
|
2062
|
+
estimatedRowHeight: ne,
|
|
2063
|
+
bodyWidth: l(W),
|
|
2064
|
+
headerHeight: Ce,
|
|
2065
|
+
headerWidth: l(W),
|
|
2066
|
+
height: l(f),
|
|
2373
2067
|
mainTableRef: d,
|
|
2374
|
-
rowKey:
|
|
2375
|
-
rowHeight:
|
|
2376
|
-
scrollbarAlwaysOn:
|
|
2068
|
+
rowKey: fe,
|
|
2069
|
+
rowHeight: Q,
|
|
2070
|
+
scrollbarAlwaysOn: Xe,
|
|
2377
2071
|
scrollbarStartGap: 2,
|
|
2378
|
-
scrollbarEndGap:
|
|
2379
|
-
useIsScrolling:
|
|
2380
|
-
width:
|
|
2381
|
-
getRowHeight:
|
|
2382
|
-
onRowsRendered:
|
|
2383
|
-
onScroll:
|
|
2384
|
-
},
|
|
2385
|
-
cache:
|
|
2072
|
+
scrollbarEndGap: N,
|
|
2073
|
+
useIsScrolling: _,
|
|
2074
|
+
width: O,
|
|
2075
|
+
getRowHeight: j,
|
|
2076
|
+
onRowsRendered: ae,
|
|
2077
|
+
onScroll: Te
|
|
2078
|
+
}, V = l(m), $ = l(i), J = {
|
|
2079
|
+
cache: se,
|
|
2386
2080
|
class: o.e("left"),
|
|
2387
|
-
columns:
|
|
2388
|
-
data:
|
|
2389
|
-
fixedData:
|
|
2390
|
-
estimatedRowHeight:
|
|
2391
|
-
leftTableRef:
|
|
2392
|
-
rowHeight:
|
|
2081
|
+
columns: l(s),
|
|
2082
|
+
data: I,
|
|
2083
|
+
fixedData: Ee,
|
|
2084
|
+
estimatedRowHeight: ne,
|
|
2085
|
+
leftTableRef: w,
|
|
2086
|
+
rowHeight: Q,
|
|
2087
|
+
bodyWidth: V,
|
|
2088
|
+
headerWidth: V,
|
|
2089
|
+
headerHeight: Ce,
|
|
2090
|
+
height: $,
|
|
2091
|
+
rowKey: fe,
|
|
2092
|
+
scrollbarAlwaysOn: Xe,
|
|
2093
|
+
scrollbarStartGap: 2,
|
|
2094
|
+
scrollbarEndGap: N,
|
|
2095
|
+
useIsScrolling: _,
|
|
2096
|
+
width: V,
|
|
2097
|
+
getRowHeight: j,
|
|
2098
|
+
onScroll: be
|
|
2099
|
+
}, te = l(v), oe = {
|
|
2100
|
+
cache: se,
|
|
2101
|
+
class: o.e("right"),
|
|
2102
|
+
columns: l(h),
|
|
2103
|
+
data: I,
|
|
2104
|
+
fixedData: Ee,
|
|
2105
|
+
estimatedRowHeight: ne,
|
|
2106
|
+
rightTableRef: x,
|
|
2107
|
+
rowHeight: Q,
|
|
2393
2108
|
bodyWidth: te,
|
|
2394
2109
|
headerWidth: te,
|
|
2395
|
-
headerHeight:
|
|
2396
|
-
height:
|
|
2397
|
-
rowKey:
|
|
2398
|
-
scrollbarAlwaysOn:
|
|
2110
|
+
headerHeight: Ce,
|
|
2111
|
+
height: $,
|
|
2112
|
+
rowKey: fe,
|
|
2113
|
+
scrollbarAlwaysOn: Xe,
|
|
2399
2114
|
scrollbarStartGap: 2,
|
|
2400
|
-
scrollbarEndGap:
|
|
2401
|
-
useIsScrolling: O,
|
|
2115
|
+
scrollbarEndGap: N,
|
|
2402
2116
|
width: te,
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
columns: n(s),
|
|
2409
|
-
data: K,
|
|
2410
|
-
fixedData: Te,
|
|
2411
|
-
estimatedRowHeight: Z,
|
|
2412
|
-
rightTableRef: g,
|
|
2413
|
-
rowHeight: q,
|
|
2414
|
-
bodyWidth: Ee,
|
|
2415
|
-
headerWidth: Ee,
|
|
2416
|
-
headerHeight: ye,
|
|
2417
|
-
height: J,
|
|
2418
|
-
rowKey: T,
|
|
2419
|
-
scrollbarAlwaysOn: p,
|
|
2420
|
-
scrollbarStartGap: 2,
|
|
2421
|
-
scrollbarEndGap: P,
|
|
2422
|
-
width: Ee,
|
|
2423
|
-
style: `--${n(o.namespace)}-table-scrollbar-size: ${P}px`,
|
|
2424
|
-
useIsScrolling: O,
|
|
2425
|
-
getRowHeight: B,
|
|
2426
|
-
onScroll: me
|
|
2427
|
-
}, ze = n(a), Ol = {
|
|
2117
|
+
style: `${o.cssVarName("table-scrollbar-size")}: ${N}px`,
|
|
2118
|
+
useIsScrolling: _,
|
|
2119
|
+
getRowHeight: j,
|
|
2120
|
+
onScroll: be
|
|
2121
|
+
}, Y = l(a), Be = {
|
|
2428
2122
|
ns: o,
|
|
2429
|
-
depthMap:
|
|
2430
|
-
columnsStyles:
|
|
2431
|
-
expandColumnKey:
|
|
2432
|
-
expandedRowKeys:
|
|
2433
|
-
estimatedRowHeight:
|
|
2434
|
-
hasFixedColumns:
|
|
2435
|
-
rowProps:
|
|
2436
|
-
rowClass:
|
|
2437
|
-
rowKey:
|
|
2438
|
-
rowEventHandlers:
|
|
2439
|
-
onRowHovered:
|
|
2440
|
-
onRowExpanded:
|
|
2441
|
-
onRowHeightChange:
|
|
2442
|
-
},
|
|
2443
|
-
cellProps:
|
|
2444
|
-
expandColumnKey:
|
|
2445
|
-
indentSize:
|
|
2446
|
-
iconSize:
|
|
2447
|
-
rowKey:
|
|
2448
|
-
expandedRowKeys:
|
|
2449
|
-
ns: o
|
|
2450
|
-
}, Nl = {
|
|
2123
|
+
depthMap: l(y),
|
|
2124
|
+
columnsStyles: Y,
|
|
2125
|
+
expandColumnKey: Ne,
|
|
2126
|
+
expandedRowKeys: l(c),
|
|
2127
|
+
estimatedRowHeight: ne,
|
|
2128
|
+
hasFixedColumns: l(u),
|
|
2129
|
+
rowProps: it,
|
|
2130
|
+
rowClass: ce,
|
|
2131
|
+
rowKey: fe,
|
|
2132
|
+
rowEventHandlers: he,
|
|
2133
|
+
onRowHovered: Re,
|
|
2134
|
+
onRowExpanded: ue,
|
|
2135
|
+
onRowHeightChange: re
|
|
2136
|
+
}, Ze = {
|
|
2137
|
+
cellProps: ee,
|
|
2138
|
+
expandColumnKey: Ne,
|
|
2139
|
+
indentSize: H,
|
|
2140
|
+
iconSize: C,
|
|
2141
|
+
rowKey: fe,
|
|
2142
|
+
expandedRowKeys: l(c),
|
|
2451
2143
|
ns: o,
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
columnsStyles: ze
|
|
2455
|
-
}, Ot = {
|
|
2144
|
+
t: r
|
|
2145
|
+
}, An = {
|
|
2456
2146
|
ns: o,
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2147
|
+
headerClass: Ge,
|
|
2148
|
+
headerProps: Ke,
|
|
2149
|
+
columnsStyles: Y
|
|
2150
|
+
}, zt = {
|
|
2151
|
+
ns: o,
|
|
2152
|
+
t: r,
|
|
2153
|
+
sortBy: De,
|
|
2154
|
+
sortState: Z,
|
|
2155
|
+
headerCellProps: de,
|
|
2156
|
+
onColumnSorted: U
|
|
2157
|
+
}, me = {
|
|
2158
|
+
row: (ut) => E(Bo, q(ut, Be), {
|
|
2463
2159
|
row: t.row,
|
|
2464
|
-
cell: (
|
|
2465
|
-
let
|
|
2466
|
-
return t.cell ?
|
|
2467
|
-
style: ze[ne.column.key]
|
|
2468
|
-
}), Ke(_e = t.cell(ne)) ? _e : {
|
|
2469
|
-
default: () => [_e]
|
|
2470
|
-
}) : C(Zt, Y(ne, At, {
|
|
2471
|
-
style: ze[ne.column.key]
|
|
2472
|
-
}), null);
|
|
2160
|
+
cell: (le) => {
|
|
2161
|
+
let He;
|
|
2162
|
+
return t.cell ? E(Et, q(le, Ze, { style: Y[le.column.key] }), je(He = t.cell(le)) ? He : { default: () => [He] }) : E(Et, q(le, Ze, { style: Y[le.column.key] }), null);
|
|
2473
2163
|
}
|
|
2474
2164
|
}),
|
|
2475
|
-
header: (
|
|
2165
|
+
header: (ut) => E(Uo, q(ut, An), {
|
|
2476
2166
|
header: t.header,
|
|
2477
|
-
cell: (
|
|
2478
|
-
let
|
|
2479
|
-
return t["header-cell"] ?
|
|
2480
|
-
style: ze[ne.column.key]
|
|
2481
|
-
}), Ke(_e = t["header-cell"](ne)) ? _e : {
|
|
2482
|
-
default: () => [_e]
|
|
2483
|
-
}) : C(Xt, Y(ne, Ot, {
|
|
2484
|
-
style: ze[ne.column.key]
|
|
2485
|
-
}), null);
|
|
2167
|
+
cell: (le) => {
|
|
2168
|
+
let He;
|
|
2169
|
+
return t["header-cell"] ? E(Qt, q(le, zt, { style: Y[le.column.key] }), je(He = t["header-cell"](le)) ? He : { default: () => [He] }) : E(Qt, q(le, zt, { style: Y[le.column.key] }), null);
|
|
2486
2170
|
}
|
|
2487
2171
|
})
|
|
2488
|
-
},
|
|
2489
|
-
|
|
2490
|
-
|
|
2172
|
+
}, On = [
|
|
2173
|
+
e.class,
|
|
2174
|
+
o.b(),
|
|
2175
|
+
o.e("root"),
|
|
2176
|
+
o.is("dynamic", l(M))
|
|
2177
|
+
], Ln = {
|
|
2491
2178
|
class: o.e("footer"),
|
|
2492
|
-
style:
|
|
2179
|
+
style: l(R)
|
|
2493
2180
|
};
|
|
2494
|
-
return
|
|
2495
|
-
class:
|
|
2496
|
-
style:
|
|
2497
|
-
}, [
|
|
2498
|
-
default: () => [
|
|
2499
|
-
|
|
2500
|
-
default: () => [
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
class: o.e("
|
|
2507
|
-
|
|
2508
|
-
}, {
|
|
2509
|
-
default: t.empty
|
|
2510
|
-
}), t.overlay && C(yn, {
|
|
2511
|
-
class: o.e("overlay")
|
|
2512
|
-
}, {
|
|
2513
|
-
default: t.overlay
|
|
2514
|
-
})]);
|
|
2181
|
+
return E("div", {
|
|
2182
|
+
class: On,
|
|
2183
|
+
style: l(G)
|
|
2184
|
+
}, [
|
|
2185
|
+
E(Do, D, je(me) ? me : { default: () => [me] }),
|
|
2186
|
+
E(Fo, J, je(me) ? me : { default: () => [me] }),
|
|
2187
|
+
E(ko, oe, je(me) ? me : { default: () => [me] }),
|
|
2188
|
+
t.footer && E(Mn, Ln, { default: t.footer }),
|
|
2189
|
+
l(L) && E(pn, {
|
|
2190
|
+
class: o.e("empty"),
|
|
2191
|
+
style: l(k)
|
|
2192
|
+
}, { default: t.empty }),
|
|
2193
|
+
t.overlay && E(_n, { class: o.e("overlay") }, { default: t.overlay })
|
|
2194
|
+
]);
|
|
2515
2195
|
};
|
|
2516
2196
|
}
|
|
2517
|
-
})
|
|
2518
|
-
var Sn = bn;
|
|
2519
|
-
const Rn = ae({
|
|
2197
|
+
}), Zo = ie({
|
|
2520
2198
|
disableWidth: Boolean,
|
|
2521
2199
|
disableHeight: Boolean,
|
|
2522
|
-
onResize: {
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
const { width: s, height: c } = r.contentRect, { paddingLeft: m, paddingRight: f, paddingTop: u, paddingBottom: v } = getComputedStyle(r.target), b = Number.parseInt(m) || 0, y = Number.parseInt(f) || 0, w = Number.parseInt(u) || 0, h = Number.parseInt(v) || 0;
|
|
2531
|
-
l.value = s - b - y, o.value = c - w - h;
|
|
2200
|
+
onResize: { type: A(Function) }
|
|
2201
|
+
}), Jo = (e) => {
|
|
2202
|
+
const t = P(), n = P(0), o = P(0);
|
|
2203
|
+
let r;
|
|
2204
|
+
return ct(() => {
|
|
2205
|
+
r = Xn(t, ([a]) => {
|
|
2206
|
+
const { width: s, height: h } = a.contentRect, { paddingLeft: g, paddingRight: f, paddingTop: i, paddingBottom: m } = getComputedStyle(a.target), v = Number.parseInt(g) || 0, b = Number.parseInt(f) || 0, y = Number.parseInt(i) || 0, c = Number.parseInt(m) || 0;
|
|
2207
|
+
n.value = s - v - b, o.value = h - y - c;
|
|
2532
2208
|
}).stop;
|
|
2533
|
-
}),
|
|
2534
|
-
|
|
2535
|
-
}),
|
|
2536
|
-
var
|
|
2537
|
-
(
|
|
2538
|
-
width:
|
|
2209
|
+
}), nn(() => {
|
|
2210
|
+
r == null || r();
|
|
2211
|
+
}), Se([n, o], ([a, s]) => {
|
|
2212
|
+
var h;
|
|
2213
|
+
(h = e.onResize) == null || h.call(e, {
|
|
2214
|
+
width: a,
|
|
2539
2215
|
height: s
|
|
2540
2216
|
});
|
|
2541
2217
|
}), {
|
|
2542
2218
|
sizer: t,
|
|
2543
|
-
width:
|
|
2219
|
+
width: n,
|
|
2544
2220
|
height: o
|
|
2545
2221
|
};
|
|
2546
|
-
},
|
|
2222
|
+
}, Qo = /* @__PURE__ */ xe({
|
|
2547
2223
|
name: "ElAutoResizer",
|
|
2548
|
-
props:
|
|
2549
|
-
setup(e, {
|
|
2550
|
-
|
|
2551
|
-
}) {
|
|
2552
|
-
const l = Ie("auto-resizer"), {
|
|
2553
|
-
height: o,
|
|
2554
|
-
width: a,
|
|
2555
|
-
sizer: r
|
|
2556
|
-
} = xn(e), s = {
|
|
2224
|
+
props: Zo,
|
|
2225
|
+
setup(e, { slots: t }) {
|
|
2226
|
+
const n = Oe("auto-resizer"), { height: o, width: r, sizer: a } = Jo(e), s = {
|
|
2557
2227
|
width: "100%",
|
|
2558
2228
|
height: "100%"
|
|
2559
2229
|
};
|
|
2560
2230
|
return () => {
|
|
2561
|
-
var
|
|
2562
|
-
return
|
|
2563
|
-
ref:
|
|
2564
|
-
class:
|
|
2231
|
+
var h;
|
|
2232
|
+
return E("div", {
|
|
2233
|
+
ref: a,
|
|
2234
|
+
class: n.b(),
|
|
2565
2235
|
style: s
|
|
2566
|
-
}, [(
|
|
2236
|
+
}, [(h = t.default) == null ? void 0 : h.call(t, {
|
|
2567
2237
|
height: o.value,
|
|
2568
|
-
width:
|
|
2238
|
+
width: r.value
|
|
2569
2239
|
})]);
|
|
2570
2240
|
};
|
|
2571
2241
|
}
|
|
2572
|
-
});
|
|
2573
|
-
|
|
2574
|
-
const _n = Jt(Sn), Cn = Jt(En);
|
|
2575
|
-
const Hn = {
|
|
2242
|
+
}), el = tn(Xo), tl = tn(Qo);
|
|
2243
|
+
const nl = {
|
|
2576
2244
|
key: 0,
|
|
2577
2245
|
class: "footer-box"
|
|
2578
|
-
},
|
|
2246
|
+
}, ol = {
|
|
2579
2247
|
__name: "index",
|
|
2580
|
-
props: /* @__PURE__ */
|
|
2248
|
+
props: /* @__PURE__ */ Ft({
|
|
2581
2249
|
tableData: {
|
|
2582
2250
|
type: Array,
|
|
2583
2251
|
default: []
|
|
@@ -2600,11 +2268,11 @@ const Hn = {
|
|
|
2600
2268
|
},
|
|
2601
2269
|
tableActiveDataModifiers: {}
|
|
2602
2270
|
}),
|
|
2603
|
-
emits: /* @__PURE__ */
|
|
2271
|
+
emits: /* @__PURE__ */ Ft(["touchBottom"], ["update:tableActiveData"]),
|
|
2604
2272
|
setup(e, {
|
|
2605
2273
|
emit: t
|
|
2606
2274
|
}) {
|
|
2607
|
-
const
|
|
2275
|
+
const n = t, o = e, r = T(() => ({
|
|
2608
2276
|
// 表格头高度 支持: Number/Array<Number>
|
|
2609
2277
|
headerHeight: 50,
|
|
2610
2278
|
// 行高度
|
|
@@ -2617,133 +2285,133 @@ const Hn = {
|
|
|
2617
2285
|
pageUpDownEnabled: !0,
|
|
2618
2286
|
// 是否开启键盘pageUp, pageDown切换选中功能
|
|
2619
2287
|
...o.config
|
|
2620
|
-
})),
|
|
2621
|
-
let
|
|
2622
|
-
const
|
|
2623
|
-
rowData:
|
|
2624
|
-
rowIndex:
|
|
2288
|
+
})), a = P(null), s = P(0);
|
|
2289
|
+
let h = 0, g = !1, f = null;
|
|
2290
|
+
const i = $n(e, "tableActiveData"), m = T(() => i.value.map((d) => d[r.value.tableActiveKey])), v = ({
|
|
2291
|
+
rowData: d,
|
|
2292
|
+
rowIndex: w
|
|
2625
2293
|
}) => {
|
|
2626
2294
|
const {
|
|
2627
|
-
tableActiveNum:
|
|
2628
|
-
tableActiveKey:
|
|
2629
|
-
} =
|
|
2630
|
-
if (
|
|
2295
|
+
tableActiveNum: x,
|
|
2296
|
+
tableActiveKey: M
|
|
2297
|
+
} = r.value;
|
|
2298
|
+
if (m.value.includes(d[M]))
|
|
2631
2299
|
return;
|
|
2632
|
-
const
|
|
2633
|
-
|
|
2634
|
-
},
|
|
2635
|
-
code:
|
|
2300
|
+
const p = Math.floor(w / x) * x, S = p + x;
|
|
2301
|
+
i.value = o.tableData.slice(p, S);
|
|
2302
|
+
}, b = ({
|
|
2303
|
+
code: d
|
|
2636
2304
|
}) => {
|
|
2637
2305
|
const {
|
|
2638
|
-
tableData:
|
|
2306
|
+
tableData: w
|
|
2639
2307
|
} = o, {
|
|
2640
|
-
tableActiveNum:
|
|
2641
|
-
tableActiveKey:
|
|
2642
|
-
pageUpDownEnabled:
|
|
2643
|
-
} =
|
|
2644
|
-
if (!
|
|
2308
|
+
tableActiveNum: x,
|
|
2309
|
+
tableActiveKey: M,
|
|
2310
|
+
pageUpDownEnabled: p
|
|
2311
|
+
} = r.value;
|
|
2312
|
+
if (!w.length || !p)
|
|
2645
2313
|
return;
|
|
2646
|
-
const
|
|
2647
|
-
let
|
|
2648
|
-
switch (
|
|
2314
|
+
const S = w.findIndex((R) => R[M] === m.value.at(0)), W = w.findIndex((R) => R[M] === m.value.at(-1));
|
|
2315
|
+
let k = null, G = null;
|
|
2316
|
+
switch (d) {
|
|
2649
2317
|
case "PageUp":
|
|
2650
|
-
if (
|
|
2318
|
+
if (S === 0)
|
|
2651
2319
|
return;
|
|
2652
|
-
|
|
2320
|
+
k = S - x > 0 ? S - x : 0, G = k + x - 1, i.value = w.slice(k, G + 1), c(k, "PageUp");
|
|
2653
2321
|
break;
|
|
2654
2322
|
case "PageDown":
|
|
2655
|
-
if (
|
|
2323
|
+
if (W === w.length - 1)
|
|
2656
2324
|
return;
|
|
2657
|
-
|
|
2325
|
+
k = S + x, G = k + x - 1, i.value = w.slice(k, G + 1), c(G, "PageDown");
|
|
2658
2326
|
break;
|
|
2659
2327
|
}
|
|
2660
|
-
},
|
|
2661
|
-
|
|
2662
|
-
},
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2328
|
+
}, y = (d) => {
|
|
2329
|
+
g || (h === d.scrollLeft && d.yAxisScrollDir === "backward" && (s.value = 0), h = d.scrollLeft);
|
|
2330
|
+
}, c = (d, w) => {
|
|
2331
|
+
d !== null && (clearTimeout(f), g = !0, w === "PageUp" ? s.value = 0 : d >= o.tableData.length - 1 && (s.value = 30, n("touchBottom")), ve(() => {
|
|
2332
|
+
a.value.scrollToRow(d), a.value.scrollToLeft(h), f = setTimeout(() => {
|
|
2333
|
+
g = !1;
|
|
2666
2334
|
}, 500);
|
|
2667
2335
|
}));
|
|
2668
|
-
},
|
|
2669
|
-
rowData:
|
|
2336
|
+
}, u = ({
|
|
2337
|
+
rowData: d
|
|
2670
2338
|
}) => {
|
|
2671
|
-
if (!
|
|
2339
|
+
if (!i.value.length)
|
|
2672
2340
|
return;
|
|
2673
|
-
let
|
|
2341
|
+
let w = "";
|
|
2674
2342
|
const {
|
|
2675
|
-
tableActiveKey:
|
|
2676
|
-
} =
|
|
2677
|
-
return
|
|
2343
|
+
tableActiveKey: x
|
|
2344
|
+
} = r.value;
|
|
2345
|
+
return d[x] === m.value[0] && (w += " virtual-table-active-start"), m.value.includes(d[x]) && (w += " virtual-table-active-row"), d[x] === m.value[m.value.length - 1] && (w += " virtual-table-active-end"), w;
|
|
2678
2346
|
};
|
|
2679
|
-
return
|
|
2680
|
-
window.addEventListener("keydown",
|
|
2681
|
-
}),
|
|
2682
|
-
|
|
2683
|
-
}),
|
|
2684
|
-
window.removeEventListener("keydown",
|
|
2685
|
-
}), (
|
|
2686
|
-
const
|
|
2687
|
-
return
|
|
2688
|
-
default:
|
|
2689
|
-
height:
|
|
2347
|
+
return ct(() => {
|
|
2348
|
+
window.addEventListener("keydown", b);
|
|
2349
|
+
}), Se(() => o.tableLoading, (d) => {
|
|
2350
|
+
d || (s.value = 0);
|
|
2351
|
+
}), qn(() => {
|
|
2352
|
+
window.removeEventListener("keydown", b);
|
|
2353
|
+
}), (d, w) => {
|
|
2354
|
+
const x = en, M = In, p = zn, S = el, W = tl;
|
|
2355
|
+
return Je(), dt(W, null, {
|
|
2356
|
+
default: Pe(({
|
|
2357
|
+
height: k,
|
|
2690
2358
|
width: G
|
|
2691
|
-
}) => [
|
|
2359
|
+
}) => [E(S, {
|
|
2692
2360
|
ref_key: "tableRef",
|
|
2693
|
-
ref:
|
|
2361
|
+
ref: a,
|
|
2694
2362
|
id: "virtualTable",
|
|
2695
2363
|
fixed: "",
|
|
2696
2364
|
data: e.tableData,
|
|
2697
2365
|
columns: e.tableColumn,
|
|
2698
2366
|
width: G,
|
|
2699
|
-
height:
|
|
2700
|
-
"header-height":
|
|
2701
|
-
"row-height":
|
|
2702
|
-
"row-class":
|
|
2367
|
+
height: k,
|
|
2368
|
+
"header-height": r.value.headerHeight,
|
|
2369
|
+
"row-height": r.value.rowHeight,
|
|
2370
|
+
"row-class": u,
|
|
2703
2371
|
"row-event-handlers": {
|
|
2704
|
-
onClick:
|
|
2372
|
+
onClick: v
|
|
2705
2373
|
},
|
|
2706
2374
|
"footer-height": s.value,
|
|
2707
2375
|
"scrollbar-always-on": "",
|
|
2708
|
-
onScroll:
|
|
2709
|
-
onEndReached:
|
|
2376
|
+
onScroll: y,
|
|
2377
|
+
onEndReached: w[0] || (w[0] = (R) => c(e.tableData.length - 1, "PageDown"))
|
|
2710
2378
|
}, {
|
|
2711
|
-
empty:
|
|
2379
|
+
empty: Pe(() => [E(x, {
|
|
2712
2380
|
description: "暂无数据",
|
|
2713
2381
|
style: {
|
|
2714
2382
|
height: "100%"
|
|
2715
2383
|
}
|
|
2716
2384
|
})]),
|
|
2717
|
-
footer:
|
|
2385
|
+
footer: Pe(() => [s.value ? (Je(), Un("div", nl, [e.tableLoading === "more" ? (Je(), dt(p, {
|
|
2718
2386
|
key: 0
|
|
2719
2387
|
}, {
|
|
2720
|
-
default:
|
|
2388
|
+
default: Pe(() => [E(M, {
|
|
2721
2389
|
type: "primary",
|
|
2722
2390
|
text: "",
|
|
2723
2391
|
loading: ""
|
|
2724
2392
|
}, {
|
|
2725
|
-
default:
|
|
2393
|
+
default: Pe(() => [...w[1] || (w[1] = [Wt("正在加载更多数据", -1)])]),
|
|
2726
2394
|
_: 1
|
|
2727
2395
|
})]),
|
|
2728
2396
|
_: 1
|
|
2729
|
-
})) : e.tableLoading === "all" ? (
|
|
2397
|
+
})) : e.tableLoading === "all" ? (Je(), dt(p, {
|
|
2730
2398
|
key: 1
|
|
2731
2399
|
}, {
|
|
2732
|
-
default:
|
|
2400
|
+
default: Pe(() => [...w[2] || (w[2] = [Wt(" 已无更多数据 ", -1)])]),
|
|
2733
2401
|
_: 1
|
|
2734
|
-
})) :
|
|
2735
|
-
_:
|
|
2736
|
-
},
|
|
2402
|
+
})) : kt("", !0)])) : kt("", !0)]),
|
|
2403
|
+
_: 1
|
|
2404
|
+
}, 8, ["data", "columns", "width", "height", "header-height", "row-height", "row-event-handlers", "footer-height"])]),
|
|
2737
2405
|
_: 1
|
|
2738
2406
|
});
|
|
2739
2407
|
};
|
|
2740
2408
|
}
|
|
2741
2409
|
};
|
|
2742
|
-
const
|
|
2410
|
+
const ll = /* @__PURE__ */ oo(ol, [["__scopeId", "data-v-c041c9b6"]]), Cl = {
|
|
2743
2411
|
install(e) {
|
|
2744
|
-
e.component("st-virtualTable",
|
|
2412
|
+
e.component("st-virtualTable", ll);
|
|
2745
2413
|
}
|
|
2746
2414
|
};
|
|
2747
2415
|
export {
|
|
2748
|
-
|
|
2416
|
+
Cl as default
|
|
2749
2417
|
};
|