st-comp 0.0.147 → 0.0.149

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