st-comp 0.0.279 → 0.0.280

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 (229) hide show
  1. package/es/ChartLayout.cjs +1 -1
  2. package/es/ChartLayout.js +13 -14
  3. package/es/CustomFunction.cjs +2 -2
  4. package/es/CustomFunction.js +342 -547
  5. package/es/FactorWarning.cjs +1 -1
  6. package/es/FactorWarning.js +294 -294
  7. package/es/Kline.cjs +1 -1
  8. package/es/Kline.js +19 -19
  9. package/es/KlineBasic.cjs +1 -1
  10. package/es/KlineBasic.js +253 -253
  11. package/es/KlineConfig.cjs +1 -1
  12. package/es/KlineConfig.js +579 -553
  13. package/es/KlineNew.cjs +1 -1
  14. package/es/KlineNew.js +17 -17
  15. package/es/KlinePlus.cjs +2 -2
  16. package/es/KlinePlus.js +23 -24
  17. package/es/MonacoEditor.cjs +1 -1
  18. package/es/MonacoEditor.js +30 -29
  19. package/es/Pagination.cjs +1 -1
  20. package/es/Pagination.js +517 -425
  21. package/es/PasswordPrompt.cjs +1 -1
  22. package/es/PasswordPrompt.js +3 -3
  23. package/es/Table.cjs +1 -1
  24. package/es/Table.js +46 -46
  25. package/es/User.cjs +1 -1
  26. package/es/User.js +898 -866
  27. package/es/VarSelectDialog.cjs +3 -3
  28. package/es/VarSelectDialog.js +110 -109
  29. package/es/VarietyAiHelper.cjs +7 -7
  30. package/es/VarietyAiHelper.js +605 -443
  31. package/es/VarietyAutoComplete.cjs +1 -1
  32. package/es/VarietyAutoComplete.js +11 -11
  33. package/es/VarietySearch.cjs +18 -18
  34. package/es/VarietySearch.js +3079 -2913
  35. package/es/{VarietySelect-d58eee29.cjs → VarietySelect-aa082a9c.cjs} +1 -1
  36. package/es/{VarietySelect-41daac7b.js → VarietySelect-c402bade.js} +5 -5
  37. package/es/VarietyTextCopy.cjs +3 -3
  38. package/es/VarietyTextCopy.js +51 -51
  39. package/es/VirtualTable.cjs +13 -1
  40. package/es/VirtualTable.js +1929 -2261
  41. package/es/_baseClone-10bdb989.cjs +1 -0
  42. package/es/_baseClone-98af8b33.js +210 -0
  43. package/es/base-d987e5c9.cjs +5 -0
  44. package/es/base-dd156b8e.js +790 -0
  45. package/es/{castArray-7741a212.js → castArray-18eb6a41.js} +1 -1
  46. package/es/{castArray-35947698.cjs → castArray-d9ffe84a.cjs} +1 -1
  47. package/es/clamp-17c4d8aa.cjs +1 -0
  48. package/es/clamp-c7512966.js +10 -0
  49. package/es/config-provider-33a127c4.cjs +1 -0
  50. package/es/config-provider-563023c9.js +86 -0
  51. package/es/debounce-0a98a9c6.js +57 -0
  52. package/es/debounce-37b17615.cjs +1 -0
  53. package/es/dropdown-ce7496c7.cjs +1 -0
  54. package/es/dropdown-feea8702.js +178 -0
  55. package/es/el-autocomplete-d9253bba.cjs +1 -0
  56. package/es/el-autocomplete-eac54f9f.js +434 -0
  57. package/es/el-button-8259594b.cjs +1 -0
  58. package/es/el-button-8a9721f8.js +343 -0
  59. package/es/el-checkbox-6303fc92.cjs +1 -0
  60. package/es/el-checkbox-c328b097.js +566 -0
  61. package/es/el-dialog-67536fac.js +252 -0
  62. package/es/el-dialog-8788bcc1.cjs +1 -0
  63. package/es/el-divider-3f0320be.cjs +1 -0
  64. package/es/el-divider-c5d72961.js +51 -0
  65. package/es/el-empty-552baf04.js +159 -0
  66. package/es/el-empty-58bc2a10.cjs +1 -0
  67. package/es/el-form-item-8efcf2c3.js +1265 -0
  68. package/es/el-form-item-95e68669.cjs +12 -0
  69. package/es/el-input-c8a9bb71.cjs +1 -0
  70. package/es/el-input-e66500b7.js +761 -0
  71. package/es/el-input-number-68ee0d65.js +390 -0
  72. package/es/el-input-number-d7a81922.cjs +1 -0
  73. package/es/el-loading-62132db2.cjs +1 -0
  74. package/es/el-loading-db4c6d13.js +190 -0
  75. package/es/el-menu-item-4b8e7794.cjs +1 -0
  76. package/es/el-menu-item-c2523d82.js +824 -0
  77. package/es/el-message-box-7c13546c.js +481 -0
  78. package/es/el-message-box-fed174f0.cjs +1 -0
  79. package/es/el-overlay-17299785.cjs +1 -0
  80. package/es/el-overlay-36f223e9.js +444 -0
  81. package/es/el-popconfirm-520b2928.cjs +1 -0
  82. package/es/el-popconfirm-a857c54a.js +190 -0
  83. package/es/el-popper-852446fd.js +2235 -0
  84. package/es/el-popper-f824c63b.cjs +1 -0
  85. package/es/{el-scrollbar-323542e7.js → el-scrollbar-0a42c1d0.js} +4 -9
  86. package/es/{el-scrollbar-bc3f790d.cjs → el-scrollbar-225c6c9e.cjs} +1 -1
  87. package/es/el-segmented-45dcc036.cjs +1 -0
  88. package/es/el-segmented-bf08279f.js +168 -0
  89. package/es/el-select-a34348e1.js +1535 -0
  90. package/es/el-select-d2958ae8.cjs +1 -0
  91. package/es/el-table-column-ad70ee0e.cjs +14 -0
  92. package/es/el-table-column-e2be313e.js +3651 -0
  93. package/es/el-tag-527f06f0.cjs +1 -0
  94. package/es/el-tag-9bcfae32.js +77 -0
  95. package/es/el-text-f9379288.js +84 -0
  96. package/es/el-text-fc345ffd.cjs +1 -0
  97. package/es/index-2419d69a.js +468 -0
  98. package/es/index-3806160e.js +710 -0
  99. package/es/index-3a0a7c36.cjs +1 -0
  100. package/es/index-3e7d5ffb.cjs +1 -0
  101. package/es/index-3ed0c678.cjs +1 -0
  102. package/es/index-47d30a52.js +372 -0
  103. package/es/index-5dec535a.cjs +1 -0
  104. package/es/index-5e76a22d.cjs +1 -0
  105. package/es/{index-eb96e074.js → index-60900c6c.js} +223 -254
  106. package/es/{index-a33b2fb8.js → index-69d2353a.js} +5090 -5090
  107. package/es/index-71ba4c28.cjs +1 -0
  108. package/es/index-7711aa69.cjs +1 -0
  109. package/es/index-7c4d8f5d.js +47 -0
  110. package/es/index-86678b72.js +131 -0
  111. package/es/index-99bb359f.cjs +1 -0
  112. package/es/index-99d4335d.cjs +1 -0
  113. package/es/index-a0522466.js +413 -0
  114. package/es/index-a181f161.js +429 -0
  115. package/es/index-b9a26e7f.js +141 -0
  116. package/es/{index-a9246d17.cjs → index-bb0bc131.cjs} +109 -109
  117. package/es/index-d372e68f.cjs +5 -0
  118. package/es/index-de9ad85c.js +12 -0
  119. package/es/{index-44a382a5.js → index-dfb34e00.js} +12 -12
  120. package/es/index-f5474dcc.cjs +3 -0
  121. package/es/{python-8a1664e6.js → python-6eafa04b.js} +32 -31
  122. package/es/{python-a3db9620.cjs → python-922eca89.cjs} +1 -1
  123. package/es/{raf-8249652f.cjs → raf-735cc598.cjs} +1 -1
  124. package/es/{raf-80ef0c0a.js → raf-b4fd1e12.js} +1 -1
  125. package/es/scroll-07bade1e.cjs +1 -0
  126. package/es/scroll-70271cb1.js +35 -0
  127. package/es/style.css +1 -1
  128. package/es/toNumber-b47ceb68.cjs +1 -0
  129. package/es/toNumber-f077c66a.js +31 -0
  130. package/es/use-form-item-0a831287.cjs +2 -0
  131. package/es/use-form-item-187cd7db.js +422 -0
  132. package/es/use-global-config-17dafd40.js +71 -0
  133. package/es/use-global-config-c90c91f7.cjs +1 -0
  134. package/es/{validator-c60a8956.js → validator-800ed2ba.js} +1 -1
  135. package/es/validator-ee5bc3eb.cjs +1 -0
  136. package/es/vnode-6f7b84f0.cjs +1 -0
  137. package/es/vnode-8ee9bf4e.js +12 -0
  138. package/es/{zh-cn-b59a0910.js → zh-cn-26cc7233.js} +36 -33
  139. package/es/zh-cn-a22a6792.cjs +1 -0
  140. package/lib/bundle.js +1 -1
  141. package/lib/bundle.umd.cjs +271 -252
  142. package/lib/{index-62fa175a.js → index-74ed48c6.js} +54107 -52151
  143. package/lib/{python-4a48fa39.js → python-7aaa84e4.js} +1 -1
  144. package/lib/style.css +1 -1
  145. package/package.json +1 -1
  146. package/es/_initCloneObject-5e73c9c8.js +0 -81
  147. package/es/_initCloneObject-a5832933.cjs +0 -1
  148. package/es/base-a5af3db3.js +0 -288
  149. package/es/base-ef747d02.cjs +0 -5
  150. package/es/config-provider-06ea6b42.cjs +0 -1
  151. package/es/config-provider-88b637a8.js +0 -59
  152. package/es/dayjs.min-2c20abe6.cjs +0 -1
  153. package/es/dayjs.min-8313b006.js +0 -299
  154. package/es/debounce-62f5b6e8.cjs +0 -1
  155. package/es/debounce-8d53f4dd.js +0 -83
  156. package/es/dropdown-4ce4c3e2.cjs +0 -1
  157. package/es/dropdown-72fbc15d.js +0 -178
  158. package/es/el-autocomplete-6cafcdf1.js +0 -329
  159. package/es/el-autocomplete-e0857c5b.cjs +0 -1
  160. package/es/el-button-613e0bb2.cjs +0 -1
  161. package/es/el-button-94d3de38.js +0 -272
  162. package/es/el-checkbox-6d4cb393.js +0 -459
  163. package/es/el-checkbox-e90762df.cjs +0 -1
  164. package/es/el-dialog-02942e22.cjs +0 -1
  165. package/es/el-dialog-5e30161f.js +0 -276
  166. package/es/el-divider-4713d74c.cjs +0 -1
  167. package/es/el-divider-4e059794.js +0 -45
  168. package/es/el-empty-1697ded8.cjs +0 -1
  169. package/es/el-empty-33cb66f1.js +0 -183
  170. package/es/el-form-item-44f060d8.cjs +0 -12
  171. package/es/el-form-item-9e8969ea.js +0 -1269
  172. package/es/el-input-342b2def.js +0 -531
  173. package/es/el-input-9a9a7f7f.cjs +0 -1
  174. package/es/el-input-number-65c847d6.cjs +0 -1
  175. package/es/el-input-number-c22b803a.js +0 -311
  176. package/es/el-loading-8179b497.cjs +0 -1
  177. package/es/el-loading-bcc51e3d.js +0 -203
  178. package/es/el-menu-item-339baf6d.js +0 -768
  179. package/es/el-menu-item-83186444.cjs +0 -1
  180. package/es/el-message-box-035b699c.js +0 -489
  181. package/es/el-message-box-c62d3217.cjs +0 -1
  182. package/es/el-overlay-3e17604b.js +0 -324
  183. package/es/el-overlay-8f1da9e8.cjs +0 -1
  184. package/es/el-popconfirm-4e32ec1b.cjs +0 -1
  185. package/es/el-popconfirm-f8a86e2c.js +0 -162
  186. package/es/el-popper-a4f3ae4d.cjs +0 -1
  187. package/es/el-popper-fbd0dcea.js +0 -2094
  188. package/es/el-segmented-56bd58a8.js +0 -142
  189. package/es/el-segmented-833ac177.cjs +0 -1
  190. package/es/el-select-44fa547d.js +0 -1256
  191. package/es/el-select-70806166.cjs +0 -1
  192. package/es/el-table-column-3e2cdfca.cjs +0 -14
  193. package/es/el-table-column-b74a857d.js +0 -3432
  194. package/es/el-tag-66c83156.js +0 -117
  195. package/es/el-tag-9c2f329f.cjs +0 -1
  196. package/es/el-text-034bd3f4.js +0 -67
  197. package/es/el-text-6b2374bb.cjs +0 -1
  198. package/es/index-00f6ca75.cjs +0 -1
  199. package/es/index-185792a7.cjs +0 -1
  200. package/es/index-1e2a38ab.js +0 -113
  201. package/es/index-2e331d74.js +0 -10
  202. package/es/index-3153c1db.cjs +0 -1
  203. package/es/index-5216d5f5.js +0 -406
  204. package/es/index-5c0dd943.cjs +0 -1
  205. package/es/index-657047bb.js +0 -513
  206. package/es/index-870b6c9d.cjs +0 -1
  207. package/es/index-8c2d7e05.js +0 -368
  208. package/es/index-960806da.js +0 -314
  209. package/es/index-9780a537.cjs +0 -1
  210. package/es/index-9d16cea8.cjs +0 -1
  211. package/es/index-ac8dc53d.cjs +0 -1
  212. package/es/index-bb833443.cjs +0 -1
  213. package/es/index-c5f2d372.js +0 -326
  214. package/es/index-c6584658.js +0 -163
  215. package/es/index-d77a7336.js +0 -204
  216. package/es/index-eea0bcb3.cjs +0 -1
  217. package/es/index-f034b910.js +0 -60
  218. package/es/index-f1c702f6.cjs +0 -1
  219. package/es/index-f58b2920.cjs +0 -1
  220. package/es/scroll-679bd6bf.js +0 -35
  221. package/es/scroll-b108dabd.cjs +0 -1
  222. package/es/use-form-common-props-ac666630.cjs +0 -1
  223. package/es/use-form-common-props-ed72e914.js +0 -364
  224. package/es/use-global-config-23472471.cjs +0 -1
  225. package/es/use-global-config-ee406d58.js +0 -72
  226. package/es/validator-366dbf39.cjs +0 -1
  227. package/es/vnode-5ddb7ed1.js +0 -14
  228. package/es/vnode-b906ae6d.cjs +0 -1
  229. package/es/zh-cn-c21d12d8.cjs +0 -1
@@ -1,101 +1,68 @@
1
- import { I as Oe, e as I, b as ae, u as Ie, f as xt, p as Q, j as We, n as Qe, x as Tt, s as Dl, c as Nt, y as Pl, i as $l, w as Jt } from "./base-a5af3db3.js";
2
- import { E as Qt } from "./el-empty-33cb66f1.js";
3
- import { B as Fl } from "./el-scrollbar-323542e7.js";
4
- import { E as Wl } from "./el-divider-4e059794.js";
5
- import { E as Gl } from "./el-button-94d3de38.js";
6
- import { getCurrentInstance as nt, computed as E, defineComponent as xe, ref as F, reactive as kl, unref as n, watch as Re, onBeforeUnmount as el, h as ue, withModifiers as Vl, shallowRef as $e, nextTick as Se, isVNode as Ne, toRef as Lt, inject as Et, onUpdated as Kl, createVNode as C, onMounted as rt, resolveDynamicComponent as zt, Fragment as jl, provide as tl, onActivated as Bl, mergeProps as Y, renderSlot as Ye, mergeModels as Dt, useModel as ql, onUnmounted as Ul, openBlock as Xe, createBlock as it, withCtx as De, createElementBlock as Yl, createTextVNode as Pt, createCommentVNode as $t } from "vue";
7
- import { d as Zl } from "./debounce-8d53f4dd.js";
8
- import { m as ll } from "./typescript-7ae59c4c.js";
9
- import { c as Xl } from "./castArray-7741a212.js";
10
- import { c as Jl, u as Ql } from "./use-form-common-props-ed72e914.js";
11
- import { c as ol, r as nl } from "./raf-80ef0c0a.js";
12
- import { m as eo } from "./index-960806da.js";
13
- import { g as to } from "./scroll-679bd6bf.js";
14
- import { E as rl, h as lo, J as oo, K as no } from "./index-eb96e074.js";
15
- import { g as ro } from "./index-d77a7336.js";
16
- import { _ as ao } from "./_plugin-vue_export-helper-dad06003.js";
17
- import "./index-2e331d74.js";
18
- import "./use-global-config-ee406d58.js";
19
- import "./index-8c2d7e05.js";
20
- import "./index-657047bb.js";
21
- var Ft = Number.isNaN || function(t) {
22
- return typeof t == "number" && t !== t;
23
- };
24
- function so(e, t) {
25
- return !!(e === t || Ft(e) && Ft(t));
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 Ln } from "./el-button-8a9721f8.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 Le, 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-187cd7db.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, g as eo, H as to, I as no } from "./index-60900c6c.js";
15
+ import { _ as oo } from "./_plugin-vue_export-helper-dad06003.js";
16
+ import "./index-de9ad85c.js";
17
+ import "./use-global-config-17dafd40.js";
18
+ import "./index-47d30a52.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 = Le({
25
+ type: A([Number, Function]),
65
26
  required: !0
66
- }), gt = Oe({
67
- type: Number
68
- }), yt = Oe({
27
+ }), wt = Le({ type: Number }), vt = Le({
69
28
  type: Number,
70
29
  default: 2
71
- }), mo = Oe({
30
+ }), so = Le({
72
31
  type: String,
73
32
  values: ["ltr", "rtl"],
74
33
  default: "ltr"
75
- }), wt = Oe({
34
+ }), St = Le({
76
35
  type: Number,
77
36
  default: 0
78
- }), lt = Oe({
37
+ }), rt = Le({
79
38
  type: Number,
80
39
  required: !0
81
- }), ul = Oe({
40
+ }), un = Le({
82
41
  type: String,
83
42
  values: ["horizontal", "vertical"],
84
- default: sl
85
- }), hl = ae({
43
+ default: an
44
+ }), dn = ie({
86
45
  className: {
87
- type: String,
46
+ type: A([
47
+ String,
48
+ Array,
49
+ Object,
50
+ Boolean
51
+ ]),
88
52
  default: ""
89
53
  },
90
54
  containerElement: {
91
- type: I([String, Object]),
55
+ type: A([String, Object]),
92
56
  default: "div"
93
57
  },
94
58
  data: {
95
- type: I(Array),
96
- default: () => ll([])
59
+ type: A(Array),
60
+ default: () => ln([])
97
61
  },
98
- direction: mo,
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: I([Object, String, Array])
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
- }), vo = ae({
121
- cache: yt,
122
- estimatedItemSize: gt,
123
- layout: ul,
124
- initScrollOffset: wt,
125
- total: lt,
126
- itemSize: vt,
127
- ...hl
128
- }), bt = {
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
- }, fl = { type: Number, default: 0 }, ml = { type: Number, default: 2 }, Me = ae({
132
- columnCache: yt,
133
- columnWidth: vt,
134
- estimatedColumnWidth: gt,
135
- estimatedRowHeight: gt,
136
- initScrollLeft: wt,
137
- initScrollTop: wt,
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: I(Function),
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: yt,
146
- rowHeight: vt,
147
- totalColumn: lt,
148
- totalRow: lt,
149
- hScrollbarSize: bt,
150
- vScrollbarSize: bt,
151
- scrollbarStartGap: fl,
152
- scrollbarEndGap: ml,
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
- ...hl
155
- }), vl = ae({
148
+ ...dn
149
+ }), mn = ie({
156
150
  alwaysOn: Boolean,
157
- class: String,
158
- layout: ul,
159
- total: lt,
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: bt,
173
- startGap: fl,
174
- endGap: ml,
174
+ scrollbarSize: xt,
175
+ startGap: hn,
176
+ endGap: fn,
175
177
  visible: Boolean
176
- }), Je = (e, t) => e < t ? je : dt, Vt = (e) => e === il;
177
- let Pe = null;
178
- function Kt(e = !1) {
179
- if (Pe === null || e) {
180
- const t = document.createElement("div"), l = t.style;
181
- l.width = "50px", l.height = "50px", l.overflow = "scroll", l.direction = "rtl";
182
- const o = document.createElement("div"), a = o.style;
183
- return a.width = "100px", a.height = "100px", t.appendChild(o), document.body.appendChild(t), t.scrollLeft > 0 ? Pe = dl : (t.scrollLeft = 1, t.scrollLeft === 0 ? Pe = mt : Pe = cl), document.body.removeChild(t), Pe;
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 Pe;
187
+ return Fe;
188
+ }
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));
198
+ }
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;
186
206
  }
187
- function go({ move: e, size: t, bar: l }, o) {
188
- const a = {}, r = `translate${l.axis}(${e}px)`;
189
- return a[l.size] = t, a.transform = r, o === "horizontal" ? a.height = "100%" : a.width = "100%", a;
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;
190
225
  }
191
- const jt = xe({
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: vl,
194
- emits: ["scroll", "start-move", "stop-move"],
234
+ props: mn,
235
+ emits: [
236
+ "scroll",
237
+ "start-move",
238
+ "stop-move"
239
+ ],
195
240
  setup(e, { emit: t }) {
196
- const l = E(() => e.startGap + e.endGap), o = Ie("virtual-scrollbar"), a = Ie("scrollbar"), r = F(), s = F();
197
- let c = null, m = null;
198
- const f = kl({
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
- }), u = E(() => Fl[e.layout]), v = E(() => e.clientSize - n(l)), b = E(() => ({
246
+ }), i = T(() => Jn[e.layout]), m = T(() => e.clientSize - l(n)), v = T(() => ({
202
247
  position: "absolute",
203
- width: `${ft === e.layout ? v.value : e.scrollbarSize}px`,
204
- height: `${ft === e.layout ? e.scrollbarSize : v.value}px`,
205
- [ho[e.layout]]: "2px",
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
- })), y = E(() => {
210
- const R = e.ratio;
211
- if (R >= 100)
254
+ })), b = T(() => {
255
+ const S = e.ratio;
256
+ if (S >= 100)
212
257
  return Number.POSITIVE_INFINITY;
213
- if (R >= 50)
214
- return R * v.value / 100;
215
- const $ = v.value / 3;
216
- return Math.floor(Math.min(Math.max(R * v.value / 100, fo), $));
217
- }), w = E(() => {
218
- if (!Number.isFinite(y.value))
219
- return {
220
- display: "none"
221
- };
222
- const R = `${y.value}px`;
223
- return go({
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
- }), h = E(() => Math.ceil(e.clientSize - y.value - n(l))), d = () => {
229
- window.addEventListener("mousemove", H), window.addEventListener("mouseup", S);
230
- const R = n(s);
231
- R && (m = document.onselectstart, document.onselectstart = () => !1, R.addEventListener("touchmove", H, { passive: !0 }), R.addEventListener("touchend", S));
232
- }, i = () => {
233
- window.removeEventListener("mousemove", H), window.removeEventListener("mouseup", S), document.onselectstart = m, m = null;
234
- const R = n(s);
235
- R && (R.removeEventListener("touchmove", H), R.removeEventListener("touchend", S));
236
- }, g = (R) => {
237
- R.stopImmediatePropagation(), !(R.ctrlKey || [1, 2].includes(R.button)) && (f.isDragging = !0, f[u.value.axis] = R.currentTarget[u.value.offset] - (R[u.value.client] - R.currentTarget.getBoundingClientRect()[u.value.direction]), t("start-move"), d());
238
- }, S = () => {
239
- f.isDragging = !1, f[u.value.axis] = 0, t("stop-move"), i();
240
- }, H = (R) => {
241
- const { isDragging: $ } = f;
242
- if (!$ || !s.value || !r.value)
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 z = f[u.value.axis];
245
- if (!z)
287
+ const k = f[i.value.axis];
288
+ if (!k)
246
289
  return;
247
- ol(c);
248
- const G = (r.value.getBoundingClientRect()[u.value.direction] - R[u.value.client]) * -1, x = s.value[u.value.offset] - z, A = G - x;
249
- c = nl(() => {
250
- f.traveled = Math.max(0, Math.min(A, h.value)), t("scroll", A, h.value);
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
- }, M = (R) => {
253
- const $ = Math.abs(R.target.getBoundingClientRect()[u.value.direction] - R[u.value.client]), z = s.value[u.value.offset] / 2, G = $ - z;
254
- f.traveled = Math.max(0, Math.min(G, h.value)), t("scroll", G, h.value);
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 Re(() => e.scrollFrom, (R) => {
257
- f.isDragging || (f.traveled = Math.ceil(R * h.value));
258
- }), el(() => {
259
- i();
260
- }), () => ue("div", {
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: r,
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: b.value,
269
- onMousedown: Vl(M, ["stop", "prevent"]),
270
- onTouchstartPrevent: g
271
- }, ue("div", {
311
+ style: v.value,
312
+ onMousedown: Gn(p, ["stop", "prevent"]),
313
+ onTouchstartPrevent: w
314
+ }, ge("div", {
272
315
  ref: s,
273
- class: a.e("thumb"),
274
- style: w.value,
275
- onMousedown: g
316
+ class: r.e("thumb"),
317
+ style: y.value,
318
+ onMousedown: w
276
319
  }, []));
277
320
  }
278
- });
279
- var Be = /* @__PURE__ */ ((e) => (e.ASC = "asc", e.DESC = "desc", e))(Be || {}), qe = /* @__PURE__ */ ((e) => (e.LEFT = "left", e.CENTER = "center", e.RIGHT = "right", e))(qe || {}), gl = /* @__PURE__ */ ((e) => (e.LEFT = "left", e.RIGHT = "right", e))(gl || {});
280
- const St = {
281
- asc: "desc",
282
- desc: "asc"
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
- }
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;
293
326
  };
294
- l || (a.flexShrink = 1);
295
- const r = {
296
- ...(o = e.style) != null ? o : {},
297
- ...a,
298
- flexBasis: "auto",
299
- width: e.width
300
- };
301
- return t || (e.maxWidth && (r.maxWidth = e.maxWidth), e.minWidth && (r.minWidth = e.minWidth)), r;
302
- };
303
- function wo(e, t, l) {
304
- const o = E(() => n(t).map((d, i) => {
305
- var g, S;
306
- return {
307
- ...d,
308
- key: (S = (g = d.key) != null ? g : d.dataKey) != null ? S : i
309
- };
310
- })), a = E(() => n(o).filter((d) => !d.hidden)), r = E(() => n(a).filter((d) => d.fixed === "left" || d.fixed === !0)), s = E(() => n(a).filter((d) => d.fixed === "right")), c = E(() => n(a).filter((d) => !d.fixed)), m = E(() => {
311
- const d = [];
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
- }), d;
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
- function h(d) {
329
- var i;
330
- const { key: g } = d.currentTarget.dataset;
331
- if (!g)
332
- return;
333
- const { sortState: S, sortBy: H } = e;
334
- let M = Be.ASC;
335
- xt(S) ? M = St[S[g]] : M = St[H.order], (i = e.onColumnSort) == null || i.call(e, { column: b(g), key: g, order: M });
336
- }
337
- return {
338
- columns: o,
339
- columnsStyles: u,
340
- columnsTotalWidth: v,
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
- const bo = (e, {
354
- mainTableRef: t,
355
- leftTableRef: l,
356
- rightTableRef: o,
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
- }, So = (e, {
399
- mainTableRef: t,
400
- leftTableRef: l,
401
- rightTableRef: o,
402
- tableInstance: a,
403
- ns: r,
404
- isScrolling: s
405
- }) => {
406
- const c = nt(), { emit: m } = c, f = $e(!1), u = F(e.defaultExpandedRowKeys || []), v = F(-1), b = $e(null), y = F({}), w = F({}), h = $e({}), d = $e({}), i = $e({}), g = E(() => Q(e.estimatedRowHeight));
407
- function S(x) {
408
- var A;
409
- (A = e.onRowsRendered) == null || A.call(e, x), x.rowCacheEnd > n(v) && (v.value = x.rowCacheEnd);
410
- }
411
- function H({ hovered: x, rowKey: A }) {
412
- if (s.value)
413
- return;
414
- a.vnode.el.querySelectorAll(`[rowkey="${String(A)}"]`).forEach((j) => {
415
- x ? j.classList.add(r.is("hovered")) : j.classList.remove(r.is("hovered"));
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
+ }), I = 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: L } = l(R);
379
+ if (H === 0 || C === 0)
380
+ return [
381
+ 0,
382
+ 0,
383
+ 0,
384
+ 0
385
+ ];
386
+ const D = o(c, L, l(p)), V = r(c, D, L, 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: L } = l(R);
395
+ if (H === 0 || C === 0)
396
+ return [
397
+ 0,
398
+ 0,
399
+ 0,
400
+ 0
401
+ ];
402
+ const D = i(c, L, l(p)), V = m(c, D, L, 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: L, yAxisScrollDir: D } = l(R);
447
+ u(Gt, {
448
+ xAxisScrollDir: L,
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: L, scrollWidth: D } = H.currentTarget, V = l(R);
456
+ if (V.scrollTop === L && 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(L, N - C)),
473
+ updateRequested: !0,
474
+ xAxisScrollDir: Qe(V.scrollLeft, $),
475
+ yAxisScrollDir: Qe(V.scrollTop, L)
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, L, D, V;
490
+ (L = (O = W.value) == null ? void 0 : O.onMouseUp) == null || L.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), L = l(p), D = a(c, L), V = s(c, L);
513
+ ee({
514
+ scrollLeft: h(c, C, _, N.scrollLeft, L, V > c.width ? O : 0),
515
+ scrollTop: g(c, H, _, N.scrollTop, L, D > c.height ? O : 0)
516
+ });
517
+ }, Ke = (H, C) => {
518
+ const { columnWidth: _, direction: N, rowHeight: O } = c, L = I.value(t && _, t && O, t && N), D = `${H},${C}`;
519
+ if (Dn(L, D))
520
+ return L[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 L[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
+ }, L[D];
531
+ }
532
+ }, de = () => {
533
+ R.value.isScrolling = !1, ve(() => {
534
+ I.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: L, scrollWidth: D } = O;
556
+ O.scrollLeft = D - L - 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: I,
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, L = 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: L,
590
+ layout: "horizontal",
591
+ onScroll: be,
592
+ ratio: L * 100 / V,
593
+ scrollFrom: J / (V - L),
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: L, totalRow: D, useIsScrolling: V, itemKey: $ } = c, J = [];
615
+ if (D > 0 && L > 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
- function M({
419
- expanded: x,
420
- rowData: A,
421
- rowIndex: W,
422
- rowKey: N
423
- }) {
424
- var j, B;
425
- const V = [...n(u)], U = V.indexOf(N);
426
- x ? U === -1 && V.push(N) : U > -1 && V.splice(U, 1), u.value = V, m("update:expandedRowKeys", V), (j = e.onRowExpand) == null || j.call(e, {
427
- expanded: x,
428
- rowData: A,
429
- rowIndex: W,
430
- rowKey: N
431
- }), (B = e.onExpandedRowsChange) == null || B.call(e, V), a.vnode.el.querySelector(`.${r.is("hovered")}[rowkey="${String(N)}"]`) && Se(() => H({ hovered: !0, rowKey: N }));
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
- const R = Zl(() => {
434
- var x, A, W, N;
435
- f.value = !0, y.value = { ...n(y), ...n(w) }, $(n(b), !1), w.value = {}, b.value = null, (x = t.value) == null || x.forceUpdate(), (A = l.value) == null || A.forceUpdate(), (W = o.value) == null || W.forceUpdate(), (N = c.proxy) == null || N.$forceUpdate(), f.value = !1;
436
- }, 0);
437
- function $(x, A = !1) {
438
- n(g) && [t, l, o].forEach((W) => {
439
- const N = n(W);
440
- N && N.resetAfterRowIndex(x, A);
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
- function z(x, A, W) {
444
- const N = n(b);
445
- (N === null || N > W) && (b.value = W), w.value[x] = A;
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
- function G({ rowKey: x, height: A, rowIndex: W }, N) {
448
- N ? N === gl.RIGHT ? i.value[x] = A : h.value[x] = A : d.value[x] = A;
449
- const j = Math.max(...[h, i, d].map((B) => B.value[x] || 0));
450
- n(y)[x] !== j && (z(x, j, W), R());
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
- return {
453
- expandedRowKeys: u,
454
- lastRenderedRowIndex: v,
455
- isDynamic: g,
456
- isResetting: f,
457
- rowHeights: y,
458
- resetAfterIndex: $,
459
- onRowExpanded: M,
460
- onRowHovered: H,
461
- onRowsRendered: S,
462
- onRowHeightChange: G
463
- };
464
- }, Ro = (e, { expandedRowKeys: t, lastRenderedRowIndex: l, resetAfterIndex: o }) => {
465
- const a = F({}), r = E(() => {
466
- const c = {}, { data: m, rowKey: f } = e, u = n(t);
467
- if (!u || !u.length)
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
- const v = [], b = /* @__PURE__ */ new Set();
470
- u.forEach((w) => b.add(w));
471
- let y = m.slice();
472
- for (y.forEach((w) => c[w[f]] = 0); y.length > 0; ) {
473
- const w = y.shift();
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
- const we = F(!1);
612
- function Ve() {
613
- const { onEndReached: q } = e;
614
- if (!q)
615
- return;
616
- const { scrollTop: oe } = n(g), ce = n(le), T = n(ve), _ = ce - (oe + T) + e.hScrollbarSize;
617
- !we.value && n($) >= 0 && ce <= oe + n(re) - n(ye) ? (we.value = !0, q(_)) : we.value = !1;
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
- return Re(() => n(le), () => we.value = !1), Re(() => e.expandedRowKeys, (q) => R.value = q, {
620
- deep: !0
621
- }), {
622
- columns: a,
623
- containerRef: Le,
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
- }, Ct = {
666
- type: I(Array)
667
- }, Sl = {
668
- ...Ct,
869
+ }, pt = { type: A(Array) }, Rn = {
870
+ ...pt,
669
871
  required: !0
670
- }, _o = String, Bt = {
671
- type: I(Array),
672
- default: () => ll([])
673
- }, Ce = {
872
+ }, Ro = String, Zt = {
873
+ type: A(Array),
874
+ default: () => ln([])
875
+ }, Me = {
674
876
  type: Number,
675
877
  required: !0
676
- }, Rl = {
677
- type: I([String, Number, Symbol]),
878
+ }, Tn = {
879
+ type: A([
880
+ String,
881
+ Number,
882
+ Symbol
883
+ ]),
678
884
  default: "id"
679
- }, qt = {
680
- type: I(Object)
681
- }, pe = ae({
885
+ }, Jt = { type: A(Object) }, _e = ie({
682
886
  class: String,
683
- columns: Ze,
887
+ columns: Ye,
684
888
  columnsStyles: {
685
- type: I(Object),
889
+ type: A(Object),
686
890
  required: !0
687
891
  },
688
892
  depth: Number,
689
- expandColumnKey: _o,
893
+ expandColumnKey: Ro,
690
894
  estimatedRowHeight: {
691
- ...Me.estimatedRowHeight,
895
+ ...Ae.estimatedRowHeight,
692
896
  default: void 0
693
897
  },
694
898
  isScrolling: Boolean,
695
- onRowExpand: {
696
- type: I(Function)
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: I(Object),
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
- rowKey: Rl,
716
- style: {
717
- type: I(Object)
718
- }
719
- }), ct = {
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
- }, Ht = ae({
919
+ }, _t = ie({
723
920
  class: String,
724
- columns: Ze,
725
- fixedHeaderData: {
726
- type: I(Array)
727
- },
921
+ columns: Ye,
922
+ fixedHeaderData: { type: A(Array) },
728
923
  headerData: {
729
- type: I(Array),
924
+ type: A(Array),
730
925
  required: !0
731
926
  },
732
927
  headerHeight: {
733
- type: I([Number, Array]),
928
+ type: A([Number, Array]),
734
929
  default: 50
735
930
  },
736
- rowWidth: ct,
931
+ rowWidth: ht,
737
932
  rowHeight: {
738
933
  type: Number,
739
934
  default: 50
740
935
  },
741
- height: ct,
742
- width: ct
743
- }), tt = ae({
744
- columns: Ze,
745
- data: Sl,
746
- fixedData: Ct,
747
- estimatedRowHeight: pe.estimatedRowHeight,
748
- width: Ce,
749
- height: Ce,
750
- headerWidth: Ce,
751
- headerHeight: Ht.headerHeight,
752
- bodyWidth: Ce,
753
- rowHeight: Ce,
754
- cache: vo.cache,
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: Me.scrollbarAlwaysOn,
757
- scrollbarStartGap: Me.scrollbarStartGap,
758
- scrollbarEndGap: Me.scrollbarEndGap,
759
- class: bl,
760
- style: qt,
761
- containerStyle: qt,
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: I(Function),
967
+ type: A(Function),
764
968
  required: !0
765
969
  },
766
- rowKey: pe.rowKey,
767
- onRowsRendered: {
768
- type: I(Function)
769
- },
770
- onScroll: {
771
- type: I(Function)
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: pe.estimatedRowHeight,
776
- rowKey: Rl,
777
- headerClass: {
778
- type: I([
779
- String,
780
- Function
781
- ])
782
- },
783
- headerProps: {
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
- rowClass: {
801
- type: I([String, Function])
802
- },
803
- rowProps: {
804
- type: I([Object, Function])
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
- cellProps: {
811
- type: I([
812
- Object,
813
- Function
814
- ])
815
- },
816
- columns: Ze,
817
- data: Sl,
818
- dataGetter: {
819
- type: I(Function)
820
- },
821
- fixedData: Ct,
822
- expandColumnKey: pe.expandColumnKey,
823
- expandedRowKeys: Bt,
824
- defaultExpandedRowKeys: Bt,
825
- class: bl,
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
- type: I(Object)
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: Me.hScrollbarSize,
843
- vScrollbarSize: Me.vScrollbarSize,
844
- scrollbarAlwaysOn: vl.alwaysOn,
1035
+ hScrollbarSize: Ae.hScrollbarSize,
1036
+ vScrollbarSize: Ae.vScrollbarSize,
1037
+ scrollbarAlwaysOn: mn.alwaysOn,
1038
+ /**
1039
+ * Sorting
1040
+ */
845
1041
  sortBy: {
846
- type: I(Object),
1042
+ type: A(Object),
847
1043
  default: () => ({})
848
1044
  },
849
1045
  sortState: {
850
- type: I(Object),
1046
+ type: A(Object),
851
1047
  default: void 0
852
1048
  },
853
- onColumnSort: {
854
- type: I(Function)
855
- },
856
- onExpandedRowsChange: {
857
- type: I(Function)
858
- },
859
- onEndReached: {
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: pe.rowEventHandlers
866
- }), Ho = "ElTableV2Header", po = xe({
867
- name: Ho,
868
- props: Ht,
869
- setup(e, {
870
- slots: t,
871
- expose: l
872
- }) {
873
- const o = Ie("table-v2"), a = Et(wl), r = F(), s = E(() => be({
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 I;
1173
+ (I = e.onRowsRendered) == null || I.call(e, R), R.rowCacheEnd > l(m) && (m.value = R.rowCacheEnd);
1174
+ }
1175
+ function M({ hovered: R, rowKey: I }) {
1176
+ s.value || r.vnode.el.querySelectorAll(`[rowkey="${String(I)}"]`).forEach((F) => {
1177
+ R ? F.classList.add(a.is("hovered")) : F.classList.remove(a.is("hovered"));
1178
+ });
1179
+ }
1180
+ function p({ expanded: R, rowData: I, 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: I,
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, I, 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(), (I = n.value) == null || I.forceUpdate(), (F = o.value) == null || F.forceUpdate(), (z = h.proxy) == null || z.$forceUpdate(), f.value = !1;
1199
+ }, 0);
1200
+ function W(R, I = !1) {
1201
+ l(w) && [
1202
+ t,
1203
+ n,
1204
+ o
1205
+ ].forEach((F) => {
1206
+ const z = l(F);
1207
+ z && z.resetAfterRowIndex(R, I);
1208
+ });
1209
+ }
1210
+ function k(R, I, F) {
1211
+ const z = l(v);
1212
+ (z === null || z > F) && (v.value = F), y.value[R] = I;
1213
+ }
1214
+ function G({ rowKey: R, height: I, rowIndex: F }, z) {
1215
+ z ? z === "right" ? d.value[R] = I : c.value[R] = I : u.value[R] = I;
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, Ie = (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: I, 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: I
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", Io = /* @__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
- })), c = E(() => be({
1399
+ })), h = T(() => we({
877
1400
  width: e.rowWidth,
878
1401
  height: e.height
879
- })), m = E(() => Xl(n(e.headerHeight))), f = (b) => {
880
- const y = n(r);
881
- Se(() => {
882
- y != null && y.scroll && y.scroll({
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
- }, u = () => {
887
- const b = o.e("fixed-header-row"), {
888
- columns: y,
889
- fixedHeaderData: w,
890
- rowHeight: h
891
- } = e;
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 (g = t.fixed) == null ? void 0 : g.call(t, {
899
- class: b,
900
- columns: y,
901
- rowData: d,
902
- rowIndex: -(i + 1),
903
- style: S
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
- }, v = () => {
907
- const b = o.e("dynamic-header-row"), {
908
- columns: y
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 i = be({
1427
+ const u = we({
913
1428
  width: "100%",
914
- height: w
1429
+ height: y
915
1430
  });
916
1431
  return (d = t.dynamic) == null ? void 0 : d.call(t, {
917
- class: b,
918
- columns: y,
919
- headerIndex: h,
920
- style: i
1432
+ class: v,
1433
+ columns: b,
1434
+ headerIndex: c,
1435
+ style: u
921
1436
  });
922
1437
  });
923
1438
  };
924
- return Kl(() => {
925
- a != null && a.value && f(a.value);
926
- }), l({
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 C("div", {
931
- ref: r,
1448
+ return E("div", {
1449
+ ref: a,
932
1450
  class: e.class,
933
- style: n(s),
1451
+ style: l(s),
934
1452
  role: "rowgroup"
935
- }, [C("div", {
936
- style: n(c),
1453
+ }, [E("div", {
1454
+ style: l(h),
937
1455
  class: o.e("header")
938
- }, [v(), u()])]);
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
- }), Do = "ElTableV2Grid", Po = (e) => {
1501
- const t = F(), l = F(), o = F(0), a = E(() => {
1502
- const {
1503
- data: d,
1504
- rowHeight: i,
1505
- estimatedRowHeight: g
1506
- } = e;
1507
- if (!g)
1508
- return d.length * i;
1509
- }), r = E(() => {
1510
- const {
1511
- fixedData: d,
1512
- rowHeight: i
1513
- } = e;
1514
- return ((d == null ? void 0 : d.length) || 0) * i;
1515
- }), s = E(() => et(e.headerHeight)), c = E(() => {
1516
- const {
1517
- height: d
1518
- } = e;
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
+ }), Lo = "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 v(d, i) {
1539
- var g;
1540
- (g = l.value) == null || g.resetAfterRowIndex(d, i);
1480
+ function m(u, d) {
1481
+ var w;
1482
+ (w = n.value) == null || w.resetAfterRowIndex(u, d);
1541
1483
  }
1542
- function b(d, i) {
1543
- const g = n(t), S = n(l);
1544
- xt(d) ? (g == null || g.scrollToLeft(d.scrollLeft), o.value = d.scrollLeft, S == null || S.scrollTo(d)) : (g == null || g.scrollToLeft(d), o.value = d, S == null || S.scrollTo({
1545
- scrollLeft: d,
1546
- scrollTop: i
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 y(d) {
1550
- var i;
1551
- (i = n(l)) == null || i.scrollTo({
1552
- scrollTop: d
1553
- });
1491
+ function b(u) {
1492
+ var d;
1493
+ (d = l(n)) == null || d.scrollTo({ scrollTop: u });
1554
1494
  }
1555
- function w(d, i) {
1556
- var g;
1557
- (g = n(l)) == null || g.scrollToItem(d, 1, i);
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 h() {
1560
- var d, i;
1561
- (d = n(l)) == null || d.$forceUpdate(), (i = n(t)) == null || i.$forceUpdate();
1502
+ function c() {
1503
+ var u, d;
1504
+ (u = l(n)) == null || u.$forceUpdate(), (d = l(t)) == null || d.$forceUpdate();
1562
1505
  }
1563
- return Re(() => e.bodyWidth, () => {
1564
- var d;
1565
- Q(e.estimatedRowHeight) && ((d = l.value) == null || d.resetAfter({
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: l,
1570
- forceUpdate: h,
1571
- fixedRowHeight: r,
1572
- gridHeight: c,
1573
- hasHeader: m,
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: a,
1517
+ totalHeight: r,
1577
1518
  itemKey: f,
1578
- onItemRendered: u,
1579
- resetAfterRowIndex: v,
1580
- scrollTo: b,
1581
- scrollToTop: y,
1582
- scrollToRow: w,
1519
+ onItemRendered: i,
1520
+ resetAfterRowIndex: m,
1521
+ scrollTo: v,
1522
+ scrollToTop: b,
1523
+ scrollToRow: y,
1583
1524
  scrollLeft: o
1584
1525
  };
1585
- }, $o = xe({
1586
- name: Do,
1526
+ }, Ot = /* @__PURE__ */ xe({
1527
+ name: Lo,
1587
1528
  props: tt,
1588
- setup(e, {
1589
- slots: t,
1590
- expose: l
1591
- }) {
1592
- const {
1593
- ns: o
1594
- } = Et(_t), {
1595
- bodyRef: a,
1596
- fixedRowHeight: r,
1597
- gridHeight: s,
1598
- hasHeader: c,
1599
- headerRef: m,
1600
- headerHeight: f,
1601
- totalHeight: u,
1602
- forceUpdate: v,
1603
- itemKey: b,
1604
- onItemRendered: y,
1605
- resetAfterRowIndex: w,
1606
- scrollTo: h,
1607
- scrollToTop: d,
1608
- scrollToRow: i,
1609
- scrollLeft: g
1610
- } = Po(e);
1611
- tl(wl, g), Bl(async () => {
1612
- var H;
1613
- await Se();
1614
- const M = (H = a.value) == null ? void 0 : H.states.scrollTop;
1615
- M && d(Math.round(M) + 1);
1616
- }), l({
1617
- forceUpdate: v,
1618
- totalHeight: u,
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 S = () => e.bodyWidth;
1561
+ const x = () => e.bodyWidth;
1625
1562
  return () => {
1626
- const {
1627
- cache: H,
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: I, 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: W
1649
- }, [C(me, {
1650
- ref: a,
1651
- data: R,
1652
- useIsScrolling: z,
1653
- itemKey: b,
1567
+ style: F
1568
+ }, [E(Te, {
1569
+ ref: r,
1570
+ data: S,
1571
+ useIsScrolling: k,
1572
+ itemKey: v,
1654
1573
  columnCache: 0,
1655
- columnWidth: re ? S : j,
1574
+ columnWidth: ae ? x : K,
1656
1575
  totalColumn: 1,
1657
- totalRow: R.length,
1658
- rowCache: H,
1659
- rowHeight: re ? fe : N,
1660
- width: le,
1661
- height: n(s),
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: A,
1665
- scrollbarEndGap: x,
1583
+ scrollbarStartGap: I,
1584
+ scrollbarEndGap: R,
1666
1585
  scrollbarAlwaysOn: G,
1667
- onScroll: se,
1668
- onItemRendered: y,
1586
+ onScroll: ue,
1587
+ onItemRendered: b,
1669
1588
  perfMode: !1
1670
- }, {
1671
- default: (ve) => {
1672
- var Z;
1673
- const ge = R[ve.rowIndex];
1674
- return (Z = t.row) == null ? void 0 : Z.call(t, {
1675
- ...ve,
1676
- columns: M,
1677
- rowData: ge
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(Io, {
1598
+ ref: g,
1682
1599
  class: o.e("header-wrapper"),
1683
- columns: M,
1684
- headerData: R,
1600
+ columns: p,
1601
+ headerData: S,
1685
1602
  headerHeight: e.headerHeight,
1686
- fixedHeaderData: $,
1687
- rowWidth: V,
1688
- rowHeight: N,
1689
- width: le,
1690
- height: Math.min(ie + n(r), U)
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
- var pt = $o;
1699
- function Fo(e) {
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 Wo = (e, {
1703
- slots: t
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
- var Go = Wo;
1716
- function ko(e) {
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 Vo = (e, {
1720
- slots: t
1721
- }) => {
1625
+ const Fo = (e, { slots: t }) => {
1722
1626
  if (!e.columns.length)
1723
1627
  return;
1724
- const {
1725
- leftTableRef: l,
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
- var Ko = Vo;
1735
- function jo(e) {
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 Bo = (e, {
1739
- slots: t
1740
- }) => {
1634
+ const ko = (e, { slots: t }) => {
1741
1635
  if (!e.columns.length)
1742
1636
  return;
1743
- const {
1744
- rightTableRef: l,
1745
- ...o
1746
- } = e;
1747
- return C(pt, Y({
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
- columns: u,
1763
- onRowHeightChange: v,
1764
- rowKey: b,
1765
- rowIndex: y,
1766
- style: w
1767
- } = e, {
1768
- height: h
1769
- } = f.getBoundingClientRect();
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 = E(() => {
1781
- const {
1782
- rowData: m,
1783
- rowIndex: f,
1784
- rowKey: u,
1785
- onRowHover: v
1786
- } = e, b = e.rowEventHandlers || {}, y = {};
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: u
1663
+ rowKey: i
1794
1664
  });
1795
1665
  });
1796
- }), v && [{
1666
+ }), m && [{
1797
1667
  name: "onMouseleave",
1798
1668
  hovered: !1
1799
1669
  }, {
1800
1670
  name: "onMouseenter",
1801
1671
  hovered: !0
1802
- }].forEach(({
1803
- name: w,
1804
- hovered: h
1805
- }) => {
1806
- const d = y[w];
1807
- y[w] = (i) => {
1808
- v({
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: u
1814
- }), d == null || d(i);
1680
+ rowKey: i
1681
+ }), u == null || u(d);
1815
1682
  };
1816
- }), y;
1817
- }), c = (m) => {
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: m,
1826
- rowData: u,
1827
- rowIndex: v,
1828
- rowKey: b
1687
+ expanded: g,
1688
+ rowData: i,
1689
+ rowIndex: m,
1690
+ rowKey: v
1829
1691
  });
1830
1692
  };
1831
- return rt(() => {
1832
- n(a) && r(!0);
1693
+ return ct(() => {
1694
+ l(r) && a(!0);
1833
1695
  }), {
1834
1696
  isScrolling: t,
1835
- measurable: a,
1836
- measured: l,
1697
+ measurable: r,
1698
+ measured: n,
1837
1699
  rowRef: o,
1838
1700
  eventHandlers: s,
1839
- onExpand: c
1701
+ onExpand: h
1840
1702
  };
1841
- }, Yo = "ElTableV2TableRow", Zo = xe({
1842
- name: Yo,
1843
- props: pe,
1844
- setup(e, {
1845
- expose: t,
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
- columns: u,
1862
- columnsStyles: v,
1863
- expandColumnKey: b,
1864
- depth: y,
1865
- rowData: w,
1866
- rowIndex: h,
1867
- style: d
1868
- } = e;
1869
- let i = u.map((g, S) => {
1870
- const H = We(w.children) && w.children.length > 0 && g.key === b;
1871
- return l.cell({
1872
- column: g,
1873
- columns: u,
1874
- columnIndex: S,
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 (l.row && (i = l.row({
1888
- cells: i.map((g) => We(g) && g.length === 1 ? g[0] : g),
1889
- style: d,
1890
- columns: u,
1891
- depth: y,
1892
- rowData: w,
1893
- rowIndex: h,
1894
- isScrolling: n(r)
1895
- })), n(s)) {
1896
- const {
1897
- height: g,
1898
- ...S
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: H ? d : S,
1746
+ style: M ? u : x,
1904
1747
  role: "row"
1905
- }, o, n(a)), [i]);
1748
+ }, o, l(r)), [d]);
1906
1749
  }
1907
- return C("div", Y(o, {
1908
- ref: m,
1750
+ return E("div", q(o, {
1751
+ ref: g,
1909
1752
  class: e.class,
1910
- style: d,
1753
+ style: u,
1911
1754
  role: "row"
1912
- }, n(a)), [i]);
1755
+ }, l(r)), [d]);
1913
1756
  };
1914
1757
  }
1915
1758
  });
1916
- var Xo = Zo;
1917
- function Jo(e) {
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 Qo = (e, {
1921
- slots: t
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 = Ie(y, {
1764
+ columns: n,
1944
1765
  rowData: f,
1945
- rowIndex: u
1946
- }, ""), M = Ae(y, {
1947
- columns: l,
1766
+ rowIndex: i
1767
+ }, ""), p = Ie(b, {
1768
+ columns: n,
1948
1769
  rowData: f,
1949
- rowIndex: u
1950
- }), R = f[h], $ = a[R] || 0, z = !!r, G = u < 0, x = [i.e("row"), H, {
1951
- [i.e(`row-depth-${$}`)]: z && u >= 0,
1952
- [i.is("expanded")]: z && s.includes(R),
1953
- [i.is("fixed")]: !$ && G,
1954
- [i.is("customized")]: !!t.row
1955
- }], A = m ? g : void 0, W = {
1956
- ...M,
1957
- columns: l,
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
+ ], I = g ? w : void 0, F = {
1779
+ ...p,
1780
+ columns: n,
1958
1781
  columnsStyles: o,
1959
- class: x,
1960
- depth: $,
1961
- expandColumnKey: r,
1962
- estimatedRowHeight: G ? void 0 : c,
1963
- isScrolling: b,
1964
- rowIndex: u,
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: R,
1967
- rowEventHandlers: d,
1968
- style: v
1789
+ rowKey: S,
1790
+ rowEventHandlers: u,
1791
+ style: m
1969
1792
  };
1970
- return C(Xo, Y(W, {
1971
- onRowExpand: S,
1793
+ return E(Go, q(F, {
1794
+ onRowExpand: x,
1972
1795
  onMouseenter: (B) => {
1973
- A == null || A({
1796
+ I == null || I({
1974
1797
  hovered: !0,
1975
- rowKey: R,
1798
+ rowKey: S,
1976
1799
  event: B,
1977
1800
  rowData: f,
1978
- rowIndex: u
1801
+ rowIndex: i
1979
1802
  });
1980
1803
  },
1981
1804
  onMouseleave: (B) => {
1982
- A == null || A({
1805
+ I == null || I({
1983
1806
  hovered: !1,
1984
- rowKey: R,
1807
+ rowKey: S,
1985
1808
  event: B,
1986
1809
  rowData: f,
1987
- rowIndex: u
1810
+ rowIndex: i
1988
1811
  });
1989
1812
  },
1990
- rowkey: R
1991
- }), Jo(t) ? t : {
1992
- default: () => [t]
1993
- });
1994
- };
1995
- var en = Qo;
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
+ }, It = (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: a
2008
- }, [s]);
1821
+ style: o
1822
+ }, [a]);
2009
1823
  };
2010
- Mt.displayName = "ElTableV2Cell";
2011
- Mt.inheritAttrs = !1;
2012
- var tn = Mt;
2013
- const ln = (e) => {
2014
- const {
2015
- expanded: t,
2016
- expandable: l,
2017
- onExpand: o,
2018
- style: a,
2019
- size: r
2020
- } = e, s = {
2021
- onClick: l ? () => o(!t) : void 0,
1824
+ It.displayName = "ElTableV2Cell";
1825
+ It.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
- return C(rl, Y(s, {
2025
- size: r,
2026
- style: a
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
- var on = ln;
2032
- const pl = ({
2033
- columns: e,
2034
- column: t,
2035
- columnIndex: l,
2036
- depth: o,
2037
- expandIconProps: a,
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: l,
1849
+ columnIndex: n,
2066
1850
  rowData: s,
2067
- rowIndex: c
2068
- }) : ro(s, S ?? ""), R = Ae(v, {
2069
- cellData: M,
1851
+ rowIndex: h
1852
+ }) : Wn(s, M ?? ""), W = Ie(v, {
1853
+ cellData: S,
2070
1854
  columns: e,
2071
1855
  column: t,
2072
- columnIndex: l,
2073
- rowIndex: c,
1856
+ columnIndex: n,
1857
+ rowIndex: h,
2074
1858
  rowData: s
2075
- }), $ = {
2076
- class: u.e("cell-text"),
1859
+ }), k = {
1860
+ class: i.e("cell-text"),
2077
1861
  columns: e,
2078
1862
  column: t,
2079
- columnIndex: l,
2080
- cellData: M,
2081
- isScrolling: r,
1863
+ columnIndex: n,
1864
+ cellData: S,
1865
+ isScrolling: a,
2082
1866
  rowData: s,
2083
- rowIndex: c
2084
- }, z = yl(g), G = z ? z($) : Ye(d, "default", $, () => [C(tn, $, null)]), x = [u.e("row-cell"), t.class, t.align === qe.CENTER && u.is("align-center"), t.align === qe.RIGHT && u.is("align-right")], A = c >= 0 && b && t.key === b, W = c >= 0 && f.includes(s[h]);
2085
- let N;
2086
- const j = `margin-inline-start: ${o * y}px;`;
2087
- return A && (xt(a) ? N = C(on, Y(a, {
2088
- class: [u.e("expand-icon"), u.is("expanded", W)],
2089
- size: w,
2090
- expanded: W,
2091
- style: j,
1867
+ rowIndex: h
1868
+ }, G = En(x), R = G ? G(k) : Ue(d, "default", k, () => [E(It, k, null)]), I = [
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) : N = C("div", {
2094
- style: [j, `width: ${w}px; height: ${w}px;`].join(" ")
2095
- }, null)), C("div", Y({
2096
- class: x,
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: I,
1885
+ style: w
1886
+ }, W, { role: "cell" }), [K, R]);
2101
1887
  };
2102
- pl.inheritAttrs = !1;
2103
- var Zt = pl;
2104
- const nn = ae({
1888
+ Et.inheritAttrs = !1;
1889
+ const jo = ie({
2105
1890
  class: String,
2106
- columns: Ze,
1891
+ columns: Ye,
2107
1892
  columnsStyles: {
2108
- type: I(Object),
1893
+ type: A(Object),
2109
1894
  required: !0
2110
1895
  },
2111
1896
  headerIndex: Number,
2112
- style: { type: I(Object) }
2113
- }), rn = xe({
1897
+ style: { type: A(Object) }
1898
+ }), $o = /* @__PURE__ */ xe({
2114
1899
  name: "ElTableV2HeaderRow",
2115
- props: nn,
2116
- setup(e, {
2117
- slots: t
2118
- }) {
1900
+ props: jo,
1901
+ setup(e, { slots: t }) {
2119
1902
  return () => {
2120
- const {
2121
- columns: l,
2122
- columnsStyles: o,
2123
- headerIndex: a,
2124
- style: r
2125
- } = e;
2126
- let s = l.map((c, m) => t.cell({
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((c) => We(c) && c.length === 1 ? c[0] : c),
2135
- columns: l,
2136
- headerIndex: a
2137
- })), C("div", {
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: r,
1917
+ style: a,
2140
1918
  role: "row"
2141
1919
  }, [s]);
2142
1920
  };
2143
1921
  }
2144
1922
  });
2145
- var an = rn;
2146
- function sn(e) {
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 cn = ({
2150
- columns: e,
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: l
2163
- }, f = [s.e("header-row"), Ae(a, m, ""), {
2164
- [s.is("customized")]: !!c.header
2165
- }], u = {
2166
- ...Ae(r, m),
1929
+ headerIndex: n
1930
+ }, f = [
1931
+ s.e("header-row"),
1932
+ Ie(r, g, ""),
1933
+ s.is("customized", !!h.header)
1934
+ ];
1935
+ return E($o, {
1936
+ ...Ie(a, g),
2167
1937
  columnsStyles: t,
2168
1938
  class: f,
2169
1939
  columns: e,
2170
- headerIndex: l,
1940
+ headerIndex: n,
2171
1941
  style: o
2172
- };
2173
- return C(an, u, sn(c) ? c : {
2174
- default: () => [c]
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
+ }, Lt = (e, { slots: t }) => Ue(t, "default", e, () => {
1944
+ var n, o;
1945
+ return [E("div", {
2183
1946
  class: e.class,
2184
- title: (l = e.column) == null ? void 0 : l.title
1947
+ title: (n = e.column) == null ? void 0 : n.title
2185
1948
  }, [(o = e.column) == null ? void 0 : o.title])];
2186
1949
  });
2187
- It.displayName = "ElTableV2HeaderCell";
2188
- It.inheritAttrs = !1;
2189
- var un = It;
2190
- const hn = (e) => {
2191
- const {
2192
- sortOrder: t
2193
- } = e;
2194
- return C(rl, {
2195
- size: 14,
1950
+ Lt.displayName = "ElTableV2HeaderCell";
1951
+ Lt.inheritAttrs = !1;
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
- default: () => [t === Be.ASC ? C(oo, null, null) : C(no, null, null)]
2199
- });
2200
- };
2201
- var fn = hn;
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: s
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 = yl(c), b = v ? v(u) : Ye(t, "default", u, () => [C(un, u, null)]), {
2224
- sortBy: y,
2225
- sortState: w,
2226
- headerCellProps: h
2227
- } = e;
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(Lt, 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 = l.key === y.key, i = d ? y.order : Be.ASC;
2234
- const g = [o.e("header-cell"), Ae(m, e, ""), l.align === qe.CENTER && o.is("align-center"), l.align === qe.RIGHT && o.is("align-right"), f && o.is("sortable")], S = {
2235
- ...Ae(h, e),
2236
- onClick: l.sortable ? r : void 0,
2237
- class: g,
2238
- style: s,
2239
- "data-key": l.key
2240
- };
2241
- return C("div", Y(S, {
2242
- role: "columnheader"
2243
- }), [b, f && C(fn, {
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
+ Ie(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
+ ...Ie(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: i
1993
+ sortOrder: w,
1994
+ ariaLabel: r("el.table.sortLabel", { column: n.title || "" })
2246
1995
  }, null)]);
2247
- };
2248
- var Xt = mn;
2249
- const Ml = (e, {
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
- }, [(l = t.default) == null ? void 0 : l.call(t)]);
2001
+ }, [(n = t.default) == null ? void 0 : n.call(t)]);
2257
2002
  };
2258
- Ml.displayName = "ElTableV2Footer";
2259
- var vn = Ml;
2260
- const Il = (e, {
2261
- slots: t
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
- }, [l]);
2009
+ }, [n]);
2268
2010
  };
2269
- Il.displayName = "ElTableV2Empty";
2270
- var gn = Il;
2271
- const Al = (e, {
2272
- slots: t
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
- }, [(l = t.default) == null ? void 0 : l.call(t)]);
2017
+ }, [(n = t.default) == null ? void 0 : n.call(t)]);
2279
2018
  };
2280
- Al.displayName = "ElTableV2Overlay";
2281
- var yn = Al;
2282
- function Ke(e) {
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 wn = "ElTableV2", bn = xe({
2286
- name: wn,
2287
- props: Co,
2288
- setup(e, {
2289
- slots: t,
2290
- expose: l
2291
- }) {
2292
- const o = Ie("table-v2"), {
2293
- columnsStyles: a,
2294
- fixedColumnsOnLeft: r,
2295
- fixedColumnsOnRight: s,
2296
- mainColumns: c,
2297
- mainTableHeight: m,
2298
- fixedTableHeight: f,
2299
- leftTableWidth: u,
2300
- rightTableWidth: v,
2301
- data: b,
2302
- depthMap: y,
2303
- expandedRowKeys: w,
2304
- hasFixedColumns: h,
2305
- mainTableRef: d,
2306
- leftTableRef: i,
2307
- rightTableRef: g,
2308
- isDynamic: S,
2309
- isResetting: H,
2310
- isScrolling: M,
2311
- bodyWidth: R,
2312
- emptyStyle: $,
2313
- rootStyle: z,
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: I, 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: H,
2337
- isScrolling: M
2053
+ isResetting: p,
2054
+ isScrolling: S
2338
2055
  }), () => {
2339
- const {
2340
- cache: ie,
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, L = l(b), D = {
2057
+ cache: se,
2364
2058
  class: o.e("main"),
2365
- columns: n(c),
2366
- data: K,
2367
- fixedData: Te,
2368
- estimatedRowHeight: Z,
2369
- bodyWidth: n(R),
2370
- headerHeight: ye,
2371
- headerWidth: n(R),
2372
- height: n(m),
2059
+ columns: l(g),
2060
+ data: L,
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: T,
2375
- rowHeight: q,
2376
- scrollbarAlwaysOn: p,
2068
+ rowKey: fe,
2069
+ rowHeight: Q,
2070
+ scrollbarAlwaysOn: Xe,
2377
2071
  scrollbarStartGap: 2,
2378
- scrollbarEndGap: P,
2379
- useIsScrolling: O,
2380
- width: k,
2381
- getRowHeight: B,
2382
- onRowsRendered: se,
2383
- onScroll: re
2384
- }, te = n(u), J = n(f), ee = {
2385
- cache: ie,
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: n(r),
2388
- data: K,
2389
- fixedData: Te,
2390
- estimatedRowHeight: Z,
2391
- leftTableRef: i,
2392
- rowHeight: q,
2081
+ columns: l(s),
2082
+ data: L,
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: L,
2104
+ fixedData: Ee,
2105
+ estimatedRowHeight: ne,
2106
+ rightTableRef: x,
2107
+ rowHeight: Q,
2393
2108
  bodyWidth: te,
2394
2109
  headerWidth: te,
2395
- headerHeight: ye,
2396
- height: J,
2397
- rowKey: T,
2398
- scrollbarAlwaysOn: p,
2110
+ headerHeight: Ce,
2111
+ height: $,
2112
+ rowKey: fe,
2113
+ scrollbarAlwaysOn: Xe,
2399
2114
  scrollbarStartGap: 2,
2400
- scrollbarEndGap: P,
2401
- useIsScrolling: O,
2115
+ scrollbarEndGap: N,
2402
2116
  width: te,
2403
- getRowHeight: B,
2404
- onScroll: me
2405
- }, Ee = n(v), at = {
2406
- cache: ie,
2407
- class: o.e("right"),
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: n(y),
2430
- columnsStyles: ze,
2431
- expandColumnKey: ge,
2432
- expandedRowKeys: n(w),
2433
- estimatedRowHeight: Z,
2434
- hasFixedColumns: n(h),
2435
- rowProps: _,
2436
- rowClass: oe,
2437
- rowKey: T,
2438
- rowEventHandlers: ce,
2439
- onRowHovered: le,
2440
- onRowExpanded: fe,
2441
- onRowHeightChange: U
2442
- }, At = {
2443
- cellProps: ve,
2444
- expandColumnKey: ge,
2445
- indentSize: D,
2446
- iconSize: L,
2447
- rowKey: T,
2448
- expandedRowKeys: n(w),
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
- headerClass: Le,
2453
- headerProps: Ge,
2454
- columnsStyles: ze
2455
- }, Ot = {
2144
+ t: r
2145
+ }, An = {
2456
2146
  ns: o,
2457
- sortBy: we,
2458
- sortState: Ve,
2459
- headerCellProps: ke,
2460
- onColumnSorted: V
2461
- }, de = {
2462
- row: (st) => C(en, Y(st, Ol), {
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: (ne) => {
2465
- let _e;
2466
- return t.cell ? C(Zt, Y(ne, At, {
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: (st) => C(dn, Y(st, Nl), {
2165
+ header: (ut) => E(Uo, q(ut, An), {
2476
2166
  header: t.header,
2477
- cell: (ne) => {
2478
- let _e;
2479
- return t["header-cell"] ? C(Xt, Y(ne, Ot, {
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
- }, Ll = [e.class, o.b(), o.e("root"), {
2489
- [o.is("dynamic")]: n(S)
2490
- }], zl = {
2172
+ }, On = [
2173
+ e.class,
2174
+ o.b(),
2175
+ o.e("root"),
2176
+ o.is("dynamic", l(M))
2177
+ ], In = {
2491
2178
  class: o.e("footer"),
2492
- style: n(G)
2179
+ style: l(R)
2493
2180
  };
2494
- return C("div", {
2495
- class: Ll,
2496
- style: n(z)
2497
- }, [C(Go, X, Ke(de) ? de : {
2498
- default: () => [de]
2499
- }), C(Ko, ee, Ke(de) ? de : {
2500
- default: () => [de]
2501
- }), C(qo, at, Ke(de) ? de : {
2502
- default: () => [de]
2503
- }), t.footer && C(vn, zl, {
2504
- default: t.footer
2505
- }), n(x) && C(gn, {
2506
- class: o.e("empty"),
2507
- style: n($)
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, In, { default: t.footer }),
2189
+ l(I) && 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
- type: I(Function)
2524
- }
2525
- }), xn = (e) => {
2526
- const t = F(), l = F(0), o = F(0);
2527
- let a;
2528
- return rt(() => {
2529
- a = Ql(t, ([r]) => {
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
- }), el(() => {
2534
- a == null || a();
2535
- }), Re([l, o], ([r, s]) => {
2536
- var c;
2537
- (c = e.onResize) == null || c.call(e, {
2538
- width: r,
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: l,
2219
+ width: n,
2544
2220
  height: o
2545
2221
  };
2546
- }, Tn = xe({
2222
+ }, Qo = /* @__PURE__ */ xe({
2547
2223
  name: "ElAutoResizer",
2548
- props: Rn,
2549
- setup(e, {
2550
- slots: t
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 c;
2562
- return C("div", {
2563
- ref: r,
2564
- class: l.b(),
2231
+ var h;
2232
+ return E("div", {
2233
+ ref: a,
2234
+ class: n.b(),
2565
2235
  style: s
2566
- }, [(c = t.default) == null ? void 0 : c.call(t, {
2236
+ }, [(h = t.default) == null ? void 0 : h.call(t, {
2567
2237
  height: o.value,
2568
- width: a.value
2238
+ width: r.value
2569
2239
  })]);
2570
2240
  };
2571
2241
  }
2572
- });
2573
- var En = Tn;
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
- }, pn = {
2246
+ }, ol = {
2579
2247
  __name: "index",
2580
- props: /* @__PURE__ */ Dt({
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__ */ Dt(["touchBottom"], ["update:tableActiveData"]),
2271
+ emits: /* @__PURE__ */ Ft(["touchBottom"], ["update:tableActiveData"]),
2604
2272
  setup(e, {
2605
2273
  emit: t
2606
2274
  }) {
2607
- const l = t, o = e, a = E(() => ({
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
- })), r = F(null), s = F(0);
2621
- let c = 0, m = !1, f = null;
2622
- const u = ql(e, "tableActiveData"), v = E(() => u.value.map((i) => i[a.value.tableActiveKey])), b = ({
2623
- rowData: i,
2624
- rowIndex: g
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: S,
2628
- tableActiveKey: H
2629
- } = a.value;
2630
- if (v.value.includes(i[H]))
2295
+ tableActiveNum: x,
2296
+ tableActiveKey: M
2297
+ } = r.value;
2298
+ if (m.value.includes(d[M]))
2631
2299
  return;
2632
- const M = Math.floor(g / S) * S, R = M + S;
2633
- u.value = o.tableData.slice(M, R);
2634
- }, y = ({
2635
- code: i
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: g
2306
+ tableData: w
2639
2307
  } = o, {
2640
- tableActiveNum: S,
2641
- tableActiveKey: H,
2642
- pageUpDownEnabled: M
2643
- } = a.value;
2644
- if (!g.length || !M)
2308
+ tableActiveNum: x,
2309
+ tableActiveKey: M,
2310
+ pageUpDownEnabled: p
2311
+ } = r.value;
2312
+ if (!w.length || !p)
2645
2313
  return;
2646
- const R = g.findIndex((x) => x[H] === v.value.at(0)), $ = g.findIndex((x) => x[H] === v.value.at(-1));
2647
- let z = null, G = null;
2648
- switch (i) {
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 (R === 0)
2318
+ if (S === 0)
2651
2319
  return;
2652
- z = R - S > 0 ? R - S : 0, G = z + S - 1, u.value = g.slice(z, G + 1), h(z, "PageUp");
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 ($ === g.length - 1)
2323
+ if (W === w.length - 1)
2656
2324
  return;
2657
- z = R + S, G = z + S - 1, u.value = g.slice(z, G + 1), h(G, "PageDown");
2325
+ k = S + x, G = k + x - 1, i.value = w.slice(k, G + 1), c(G, "PageDown");
2658
2326
  break;
2659
2327
  }
2660
- }, w = (i) => {
2661
- m || (c === i.scrollLeft && i.yAxisScrollDir === "backward" && (s.value = 0), c = i.scrollLeft);
2662
- }, h = (i, g) => {
2663
- i !== null && (clearTimeout(f), m = !0, g === "PageUp" ? s.value = 0 : i >= o.tableData.length - 1 && (s.value = 30, l("touchBottom")), Se(() => {
2664
- r.value.scrollToRow(i), r.value.scrollToLeft(c), f = setTimeout(() => {
2665
- m = !1;
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
- }, d = ({
2669
- rowData: i
2336
+ }, u = ({
2337
+ rowData: d
2670
2338
  }) => {
2671
- if (!u.value.length)
2339
+ if (!i.value.length)
2672
2340
  return;
2673
- let g = "";
2341
+ let w = "";
2674
2342
  const {
2675
- tableActiveKey: S
2676
- } = a.value;
2677
- return i[S] === v.value[0] && (g += " virtual-table-active-start"), v.value.includes(i[S]) && (g += " virtual-table-active-row"), i[S] === v.value[v.value.length - 1] && (g += " virtual-table-active-end"), g;
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 rt(() => {
2680
- window.addEventListener("keydown", y);
2681
- }), Re(() => o.tableLoading, (i) => {
2682
- i || (s.value = 0);
2683
- }), Ul(() => {
2684
- window.removeEventListener("keydown", y);
2685
- }), (i, g) => {
2686
- const S = Qt, H = Gl, M = Wl, R = _n, $ = Cn;
2687
- return Xe(), it($, null, {
2688
- default: De(({
2689
- height: z,
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 = Ln, p = zn, S = el, W = tl;
2355
+ return Je(), dt(W, null, {
2356
+ default: Pe(({
2357
+ height: k,
2690
2358
  width: G
2691
- }) => [C(R, {
2359
+ }) => [E(S, {
2692
2360
  ref_key: "tableRef",
2693
- ref: r,
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: z,
2700
- "header-height": a.value.headerHeight,
2701
- "row-height": a.value.rowHeight,
2702
- "row-class": d,
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: b
2372
+ onClick: v
2705
2373
  },
2706
2374
  "footer-height": s.value,
2707
2375
  "scrollbar-always-on": "",
2708
- onScroll: w,
2709
- onEndReached: g[0] || (g[0] = (x) => h(e.tableData.length - 1, "PageDown"))
2376
+ onScroll: y,
2377
+ onEndReached: w[0] || (w[0] = (R) => c(e.tableData.length - 1, "PageDown"))
2710
2378
  }, {
2711
- empty: De(() => [C(S, {
2379
+ empty: Pe(() => [E(x, {
2712
2380
  description: "暂无数据",
2713
2381
  style: {
2714
2382
  height: "100%"
2715
2383
  }
2716
2384
  })]),
2717
- footer: De(() => [s.value ? (Xe(), Yl("div", Hn, [e.tableLoading === "more" ? (Xe(), it(M, {
2385
+ footer: Pe(() => [s.value ? (Je(), Un("div", nl, [e.tableLoading === "more" ? (Je(), dt(p, {
2718
2386
  key: 0
2719
2387
  }, {
2720
- default: De(() => [C(H, {
2388
+ default: Pe(() => [E(M, {
2721
2389
  type: "primary",
2722
2390
  text: "",
2723
2391
  loading: ""
2724
2392
  }, {
2725
- default: De(() => [Pt("正在加载更多数据")]),
2393
+ default: Pe(() => [...w[1] || (w[1] = [Wt("正在加载更多数据", -1)])]),
2726
2394
  _: 1
2727
2395
  })]),
2728
2396
  _: 1
2729
- })) : e.tableLoading === "all" ? (Xe(), it(M, {
2397
+ })) : e.tableLoading === "all" ? (Je(), dt(p, {
2730
2398
  key: 1
2731
2399
  }, {
2732
- default: De(() => [Pt(" 已无更多数据 ")]),
2400
+ default: Pe(() => [...w[2] || (w[2] = [Wt(" 已无更多数据 ", -1)])]),
2733
2401
  _: 1
2734
- })) : $t("", !0)])) : $t("", !0)]),
2735
- _: 2
2736
- }, 1032, ["data", "columns", "width", "height", "header-height", "row-height", "row-event-handlers", "footer-height"])]),
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 Mn = /* @__PURE__ */ ao(pn, [["__scopeId", "data-v-c041c9b6"]]), Zn = {
2410
+ const ll = /* @__PURE__ */ oo(ol, [["__scopeId", "data-v-c041c9b6"]]), Cl = {
2743
2411
  install(e) {
2744
- e.component("st-virtualTable", Mn);
2412
+ e.component("st-virtualTable", ll);
2745
2413
  }
2746
2414
  };
2747
2415
  export {
2748
- Zn as default
2416
+ Cl as default
2749
2417
  };