element-plus 2.1.10 → 2.1.11

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 (709) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +404 -1684
  4. package/dist/index.full.min.js +6 -6
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +10 -10
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +404 -1684
  9. package/dist/locale/af.js +1 -1
  10. package/dist/locale/af.min.js +1 -1
  11. package/dist/locale/af.min.mjs +1 -1
  12. package/dist/locale/af.mjs +1 -1
  13. package/dist/locale/ar.js +1 -1
  14. package/dist/locale/ar.min.js +1 -1
  15. package/dist/locale/ar.min.mjs +1 -1
  16. package/dist/locale/ar.mjs +1 -1
  17. package/dist/locale/az.js +1 -1
  18. package/dist/locale/az.min.js +1 -1
  19. package/dist/locale/az.min.mjs +1 -1
  20. package/dist/locale/az.mjs +1 -1
  21. package/dist/locale/bg.js +1 -1
  22. package/dist/locale/bg.min.js +1 -1
  23. package/dist/locale/bg.min.mjs +1 -1
  24. package/dist/locale/bg.mjs +1 -1
  25. package/dist/locale/bn.js +1 -1
  26. package/dist/locale/bn.min.js +1 -1
  27. package/dist/locale/bn.min.mjs +1 -1
  28. package/dist/locale/bn.mjs +1 -1
  29. package/dist/locale/ca.js +1 -1
  30. package/dist/locale/ca.min.js +1 -1
  31. package/dist/locale/ca.min.mjs +1 -1
  32. package/dist/locale/ca.mjs +1 -1
  33. package/dist/locale/cs.js +1 -1
  34. package/dist/locale/cs.min.js +1 -1
  35. package/dist/locale/cs.min.mjs +1 -1
  36. package/dist/locale/cs.mjs +1 -1
  37. package/dist/locale/da.js +1 -1
  38. package/dist/locale/da.min.js +1 -1
  39. package/dist/locale/da.min.mjs +1 -1
  40. package/dist/locale/da.mjs +1 -1
  41. package/dist/locale/de.js +1 -1
  42. package/dist/locale/de.min.js +1 -1
  43. package/dist/locale/de.min.mjs +1 -1
  44. package/dist/locale/de.mjs +1 -1
  45. package/dist/locale/el.js +1 -1
  46. package/dist/locale/el.min.js +1 -1
  47. package/dist/locale/el.min.mjs +1 -1
  48. package/dist/locale/el.mjs +1 -1
  49. package/dist/locale/en.js +1 -1
  50. package/dist/locale/en.min.js +1 -1
  51. package/dist/locale/en.min.mjs +1 -1
  52. package/dist/locale/en.mjs +1 -1
  53. package/dist/locale/eo.js +1 -1
  54. package/dist/locale/eo.min.js +1 -1
  55. package/dist/locale/eo.min.mjs +1 -1
  56. package/dist/locale/eo.mjs +1 -1
  57. package/dist/locale/es.js +1 -1
  58. package/dist/locale/es.min.js +1 -1
  59. package/dist/locale/es.min.mjs +1 -1
  60. package/dist/locale/es.mjs +1 -1
  61. package/dist/locale/et.js +1 -1
  62. package/dist/locale/et.min.js +1 -1
  63. package/dist/locale/et.min.mjs +1 -1
  64. package/dist/locale/et.mjs +1 -1
  65. package/dist/locale/eu.js +1 -1
  66. package/dist/locale/eu.min.js +1 -1
  67. package/dist/locale/eu.min.mjs +1 -1
  68. package/dist/locale/eu.mjs +1 -1
  69. package/dist/locale/fa.js +1 -1
  70. package/dist/locale/fa.min.js +1 -1
  71. package/dist/locale/fa.min.mjs +1 -1
  72. package/dist/locale/fa.mjs +1 -1
  73. package/dist/locale/fi.js +1 -1
  74. package/dist/locale/fi.min.js +1 -1
  75. package/dist/locale/fi.min.mjs +1 -1
  76. package/dist/locale/fi.mjs +1 -1
  77. package/dist/locale/fr.js +1 -1
  78. package/dist/locale/fr.min.js +1 -1
  79. package/dist/locale/fr.min.mjs +1 -1
  80. package/dist/locale/fr.mjs +1 -1
  81. package/dist/locale/he.js +1 -1
  82. package/dist/locale/he.min.js +1 -1
  83. package/dist/locale/he.min.mjs +1 -1
  84. package/dist/locale/he.mjs +1 -1
  85. package/dist/locale/hr.js +1 -1
  86. package/dist/locale/hr.min.js +1 -1
  87. package/dist/locale/hr.min.mjs +1 -1
  88. package/dist/locale/hr.mjs +1 -1
  89. package/dist/locale/hu.js +1 -1
  90. package/dist/locale/hu.min.js +1 -1
  91. package/dist/locale/hu.min.mjs +1 -1
  92. package/dist/locale/hu.mjs +1 -1
  93. package/dist/locale/hy-am.js +1 -1
  94. package/dist/locale/hy-am.min.js +1 -1
  95. package/dist/locale/hy-am.min.mjs +1 -1
  96. package/dist/locale/hy-am.mjs +1 -1
  97. package/dist/locale/id.js +1 -1
  98. package/dist/locale/id.min.js +1 -1
  99. package/dist/locale/id.min.mjs +1 -1
  100. package/dist/locale/id.mjs +1 -1
  101. package/dist/locale/it.js +1 -1
  102. package/dist/locale/it.min.js +1 -1
  103. package/dist/locale/it.min.mjs +1 -1
  104. package/dist/locale/it.mjs +1 -1
  105. package/dist/locale/ja.js +1 -1
  106. package/dist/locale/ja.min.js +1 -1
  107. package/dist/locale/ja.min.mjs +1 -1
  108. package/dist/locale/ja.mjs +1 -1
  109. package/dist/locale/kk.js +1 -1
  110. package/dist/locale/kk.min.js +1 -1
  111. package/dist/locale/kk.min.mjs +1 -1
  112. package/dist/locale/kk.mjs +1 -1
  113. package/dist/locale/km.js +1 -1
  114. package/dist/locale/km.min.js +1 -1
  115. package/dist/locale/km.min.mjs +1 -1
  116. package/dist/locale/km.mjs +1 -1
  117. package/dist/locale/ko.js +1 -1
  118. package/dist/locale/ko.min.js +1 -1
  119. package/dist/locale/ko.min.mjs +1 -1
  120. package/dist/locale/ko.mjs +1 -1
  121. package/dist/locale/ku.js +1 -1
  122. package/dist/locale/ku.min.js +1 -1
  123. package/dist/locale/ku.min.mjs +1 -1
  124. package/dist/locale/ku.mjs +1 -1
  125. package/dist/locale/ky.js +1 -1
  126. package/dist/locale/ky.min.js +1 -1
  127. package/dist/locale/ky.min.mjs +1 -1
  128. package/dist/locale/ky.mjs +1 -1
  129. package/dist/locale/lt.js +1 -1
  130. package/dist/locale/lt.min.js +1 -1
  131. package/dist/locale/lt.min.mjs +1 -1
  132. package/dist/locale/lt.mjs +1 -1
  133. package/dist/locale/lv.js +1 -1
  134. package/dist/locale/lv.min.js +1 -1
  135. package/dist/locale/lv.min.mjs +1 -1
  136. package/dist/locale/lv.mjs +1 -1
  137. package/dist/locale/mg.js +1 -1
  138. package/dist/locale/mg.min.js +1 -1
  139. package/dist/locale/mg.min.mjs +1 -1
  140. package/dist/locale/mg.mjs +1 -1
  141. package/dist/locale/mn.js +1 -1
  142. package/dist/locale/mn.min.js +1 -1
  143. package/dist/locale/mn.min.mjs +1 -1
  144. package/dist/locale/mn.mjs +1 -1
  145. package/dist/locale/nb-no.js +1 -1
  146. package/dist/locale/nb-no.min.js +1 -1
  147. package/dist/locale/nb-no.min.mjs +1 -1
  148. package/dist/locale/nb-no.mjs +1 -1
  149. package/dist/locale/nl.js +1 -1
  150. package/dist/locale/nl.min.js +1 -1
  151. package/dist/locale/nl.min.mjs +1 -1
  152. package/dist/locale/nl.mjs +1 -1
  153. package/dist/locale/pa.js +1 -1
  154. package/dist/locale/pa.min.js +1 -1
  155. package/dist/locale/pa.min.mjs +1 -1
  156. package/dist/locale/pa.mjs +1 -1
  157. package/dist/locale/pl.js +1 -1
  158. package/dist/locale/pl.min.js +1 -1
  159. package/dist/locale/pl.min.mjs +1 -1
  160. package/dist/locale/pl.mjs +1 -1
  161. package/dist/locale/pt-br.js +1 -1
  162. package/dist/locale/pt-br.min.js +1 -1
  163. package/dist/locale/pt-br.min.mjs +1 -1
  164. package/dist/locale/pt-br.mjs +1 -1
  165. package/dist/locale/pt.js +1 -1
  166. package/dist/locale/pt.min.js +1 -1
  167. package/dist/locale/pt.min.mjs +1 -1
  168. package/dist/locale/pt.mjs +1 -1
  169. package/dist/locale/ro.js +1 -1
  170. package/dist/locale/ro.min.js +1 -1
  171. package/dist/locale/ro.min.mjs +1 -1
  172. package/dist/locale/ro.mjs +1 -1
  173. package/dist/locale/ru.js +1 -1
  174. package/dist/locale/ru.min.js +1 -1
  175. package/dist/locale/ru.min.mjs +1 -1
  176. package/dist/locale/ru.mjs +1 -1
  177. package/dist/locale/sk.js +1 -1
  178. package/dist/locale/sk.min.js +1 -1
  179. package/dist/locale/sk.min.mjs +1 -1
  180. package/dist/locale/sk.mjs +1 -1
  181. package/dist/locale/sl.js +1 -1
  182. package/dist/locale/sl.min.js +1 -1
  183. package/dist/locale/sl.min.mjs +1 -1
  184. package/dist/locale/sl.mjs +1 -1
  185. package/dist/locale/sr.js +1 -1
  186. package/dist/locale/sr.min.js +1 -1
  187. package/dist/locale/sr.min.mjs +1 -1
  188. package/dist/locale/sr.mjs +1 -1
  189. package/dist/locale/sv.js +1 -1
  190. package/dist/locale/sv.min.js +1 -1
  191. package/dist/locale/sv.min.mjs +1 -1
  192. package/dist/locale/sv.mjs +1 -1
  193. package/dist/locale/ta.js +1 -1
  194. package/dist/locale/ta.min.js +1 -1
  195. package/dist/locale/ta.min.mjs +1 -1
  196. package/dist/locale/ta.mjs +1 -1
  197. package/dist/locale/th.js +1 -1
  198. package/dist/locale/th.min.js +1 -1
  199. package/dist/locale/th.min.mjs +1 -1
  200. package/dist/locale/th.mjs +1 -1
  201. package/dist/locale/tk.js +1 -1
  202. package/dist/locale/tk.min.js +1 -1
  203. package/dist/locale/tk.min.mjs +1 -1
  204. package/dist/locale/tk.mjs +1 -1
  205. package/dist/locale/tr.js +1 -1
  206. package/dist/locale/tr.min.js +1 -1
  207. package/dist/locale/tr.min.mjs +1 -1
  208. package/dist/locale/tr.mjs +1 -1
  209. package/dist/locale/ug-cn.js +1 -1
  210. package/dist/locale/ug-cn.min.js +1 -1
  211. package/dist/locale/ug-cn.min.mjs +1 -1
  212. package/dist/locale/ug-cn.mjs +1 -1
  213. package/dist/locale/uk.js +1 -1
  214. package/dist/locale/uk.min.js +1 -1
  215. package/dist/locale/uk.min.mjs +1 -1
  216. package/dist/locale/uk.mjs +1 -1
  217. package/dist/locale/uz-uz.js +1 -1
  218. package/dist/locale/uz-uz.min.js +1 -1
  219. package/dist/locale/uz-uz.min.mjs +1 -1
  220. package/dist/locale/uz-uz.mjs +1 -1
  221. package/dist/locale/vi.js +1 -1
  222. package/dist/locale/vi.min.js +1 -1
  223. package/dist/locale/vi.min.mjs +1 -1
  224. package/dist/locale/vi.mjs +1 -1
  225. package/dist/locale/zh-cn.js +1 -1
  226. package/dist/locale/zh-cn.min.js +1 -1
  227. package/dist/locale/zh-cn.min.mjs +1 -1
  228. package/dist/locale/zh-cn.mjs +1 -1
  229. package/dist/locale/zh-tw.js +1 -1
  230. package/dist/locale/zh-tw.min.js +1 -1
  231. package/dist/locale/zh-tw.min.mjs +1 -1
  232. package/dist/locale/zh-tw.mjs +1 -1
  233. package/es/components/autocomplete/index.d.ts +29 -1
  234. package/es/components/autocomplete/src/autocomplete.mjs +1 -1
  235. package/es/components/autocomplete/src/autocomplete.vue.d.ts +29 -1
  236. package/es/components/avatar/src/avatar2.mjs +1 -1
  237. package/es/components/calendar/src/calendar2.mjs +1 -1
  238. package/es/components/calendar/src/calendar2.mjs.map +1 -1
  239. package/es/components/calendar/src/date-table2.mjs +3 -2
  240. package/es/components/calendar/src/date-table2.mjs.map +1 -1
  241. package/es/components/cascader/index.d.ts +38 -2
  242. package/es/components/cascader/src/index.mjs +1 -1
  243. package/es/components/cascader/src/index.vue.d.ts +19 -1
  244. package/es/components/col/src/col.d.ts +2 -0
  245. package/es/components/col/src/col.mjs.map +1 -1
  246. package/es/components/color-picker/src/index.mjs +4 -1
  247. package/es/components/color-picker/src/index.mjs.map +1 -1
  248. package/es/components/descriptions/src/descriptions-cell.mjs +1 -1
  249. package/es/components/dropdown/src/dropdown.mjs +1 -1
  250. package/es/components/dropdown/src/dropdown2.mjs +1 -1
  251. package/es/components/form/src/form-item2.mjs +1 -1
  252. package/es/components/icon/src/icon2.mjs +1 -1
  253. package/es/components/image/index.d.ts +8 -0
  254. package/es/components/image/src/image.d.ts +1 -0
  255. package/es/components/image/src/image.mjs +4 -0
  256. package/es/components/image/src/image.mjs.map +1 -1
  257. package/es/components/image/src/image.vue.d.ts +8 -0
  258. package/es/components/image/src/image2.mjs +2 -1
  259. package/es/components/image/src/image2.mjs.map +1 -1
  260. package/es/components/image-viewer/index.d.ts +4 -0
  261. package/es/components/image-viewer/src/image-viewer.d.ts +1 -0
  262. package/es/components/image-viewer/src/image-viewer.mjs +4 -0
  263. package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
  264. package/es/components/image-viewer/src/image-viewer.vue.d.ts +4 -0
  265. package/es/components/image-viewer/src/image-viewer2.mjs +1 -1
  266. package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
  267. package/es/components/index.mjs +1 -1
  268. package/es/components/input/index.d.ts +10 -0
  269. package/es/components/input/src/input.d.ts +2 -0
  270. package/es/components/input/src/input.mjs +6 -0
  271. package/es/components/input/src/input.mjs.map +1 -1
  272. package/es/components/input/src/input.vue.d.ts +10 -0
  273. package/es/components/input/src/input2.mjs +30 -17
  274. package/es/components/input/src/input2.mjs.map +1 -1
  275. package/es/components/input-number/index.d.ts +20 -0
  276. package/es/components/input-number/src/input-number.vue.d.ts +20 -0
  277. package/es/components/popconfirm/src/popconfirm.mjs +1 -1
  278. package/es/components/popover/src/popover.mjs +1 -1
  279. package/es/components/scrollbar/src/scrollbar2.mjs +1 -1
  280. package/es/components/scrollbar/src/thumb.vue.d.ts +16 -16
  281. package/es/components/scrollbar/src/util.d.ts +18 -18
  282. package/es/components/scrollbar/src/util.mjs.map +1 -1
  283. package/es/components/select/src/select.mjs +6 -12
  284. package/es/components/select/src/select.mjs.map +1 -1
  285. package/es/components/select/src/useSelect.mjs +1 -1
  286. package/es/components/select/src/useSelect.mjs.map +1 -1
  287. package/es/components/select-v2/src/defaults.mjs +1 -1
  288. package/es/components/table/src/table/style-helper.mjs +1 -4
  289. package/es/components/table/src/table/style-helper.mjs.map +1 -1
  290. package/es/components/table-v2/index.d.ts +4 -1
  291. package/es/components/table-v2/index.mjs +3 -1
  292. package/es/components/table-v2/index.mjs.map +1 -1
  293. package/es/components/table-v2/src/column.d.ts +2 -2
  294. package/es/components/table-v2/src/components/cell.d.ts +4 -0
  295. package/es/components/table-v2/src/components/cell.mjs +22 -0
  296. package/es/components/table-v2/src/components/cell.mjs.map +1 -0
  297. package/{lib/components/table-v2/src → es/components/table-v2/src/components}/expand-icon.d.ts +1 -1
  298. package/es/components/table-v2/src/components/expand-icon.mjs +26 -0
  299. package/es/components/table-v2/src/components/expand-icon.mjs.map +1 -0
  300. package/es/components/table-v2/src/components/header-cell.d.ts +4 -0
  301. package/es/components/table-v2/src/components/header-cell.mjs +15 -0
  302. package/es/components/table-v2/src/components/header-cell.mjs.map +1 -0
  303. package/es/components/table-v2/src/{table-header-row.d.ts → components/header-row.d.ts} +6 -6
  304. package/es/components/table-v2/src/components/header-row.mjs +40 -0
  305. package/es/components/table-v2/src/components/header-row.mjs.map +1 -0
  306. package/{lib/components/table-v2/src/table-header.d.ts → es/components/table-v2/src/components/header.d.ts} +3 -3
  307. package/es/components/table-v2/src/components/header.mjs +96 -0
  308. package/es/components/table-v2/src/components/header.mjs.map +1 -0
  309. package/es/components/table-v2/src/components/index.d.ts +10 -0
  310. package/es/components/table-v2/src/components/index.mjs +8 -0
  311. package/es/components/table-v2/src/components/index.mjs.map +1 -0
  312. package/es/components/table-v2/src/{table-row.d.ts → components/row.d.ts} +18 -19
  313. package/es/components/table-v2/src/components/row.mjs +204 -0
  314. package/es/components/table-v2/src/components/row.mjs.map +1 -0
  315. package/es/components/table-v2/src/{sort-icon.d.ts → components/sort-icon.d.ts} +1 -1
  316. package/es/components/table-v2/src/components/sort-icon.mjs +19 -0
  317. package/es/components/table-v2/src/components/sort-icon.mjs.map +1 -0
  318. package/es/components/table-v2/src/composables/index.d.ts +5 -0
  319. package/es/components/table-v2/src/composables/index.mjs +6 -0
  320. package/es/components/table-v2/src/composables/index.mjs.map +1 -0
  321. package/{lib/components/table-v2/src → es/components/table-v2/src/composables}/use-columns.d.ts +8 -6
  322. package/es/components/table-v2/src/{use-columns.mjs → composables/use-columns.mjs} +26 -30
  323. package/es/components/table-v2/src/composables/use-columns.mjs.map +1 -0
  324. package/es/components/table-v2/src/composables/use-data.d.ts +17 -0
  325. package/es/components/table-v2/src/composables/use-data.mjs +44 -0
  326. package/es/components/table-v2/src/composables/use-data.mjs.map +1 -0
  327. package/es/components/table-v2/src/composables/use-row.d.ts +32 -0
  328. package/es/components/table-v2/src/composables/use-row.mjs +123 -0
  329. package/es/components/table-v2/src/composables/use-row.mjs.map +1 -0
  330. package/es/components/table-v2/src/composables/use-scrollbar.d.ts +26 -0
  331. package/es/components/table-v2/src/composables/use-scrollbar.mjs +55 -0
  332. package/es/components/table-v2/src/composables/use-scrollbar.mjs.map +1 -0
  333. package/es/components/table-v2/src/composables/use-styles.d.ts +25 -0
  334. package/es/components/table-v2/src/composables/use-styles.mjs +87 -0
  335. package/es/components/table-v2/src/composables/use-styles.mjs.map +1 -0
  336. package/es/components/table-v2/src/composables/utils.d.ts +3 -0
  337. package/es/components/table-v2/src/composables/utils.mjs +26 -0
  338. package/es/components/table-v2/src/composables/utils.mjs.map +1 -0
  339. package/es/components/table-v2/src/constants.d.ts +4 -0
  340. package/es/components/table-v2/src/constants.mjs +6 -1
  341. package/es/components/table-v2/src/constants.mjs.map +1 -1
  342. package/es/components/table-v2/src/grid.d.ts +4 -1
  343. package/es/components/table-v2/src/grid.mjs +5 -0
  344. package/es/components/table-v2/src/grid.mjs.map +1 -1
  345. package/es/components/table-v2/src/renderers/cell.d.ts +1 -1
  346. package/es/components/table-v2/src/renderers/cell.mjs +91 -0
  347. package/es/components/table-v2/src/renderers/cell.mjs.map +1 -0
  348. package/es/components/table-v2/src/renderers/empty.d.ts +7 -0
  349. package/es/components/table-v2/src/renderers/empty.mjs +15 -0
  350. package/es/components/table-v2/src/renderers/empty.mjs.map +1 -0
  351. package/es/components/table-v2/src/renderers/footer.d.ts +7 -0
  352. package/es/components/table-v2/src/renderers/footer.mjs +15 -0
  353. package/es/components/table-v2/src/renderers/footer.mjs.map +1 -0
  354. package/es/components/table-v2/src/renderers/header-cell.d.ts +1 -1
  355. package/es/components/table-v2/src/renderers/header-cell.mjs +65 -0
  356. package/es/components/table-v2/src/renderers/header-cell.mjs.map +1 -0
  357. package/es/components/table-v2/src/renderers/header.d.ts +1 -1
  358. package/es/components/table-v2/src/renderers/header.mjs +39 -0
  359. package/es/components/table-v2/src/renderers/header.mjs.map +1 -0
  360. package/es/components/table-v2/src/renderers/left-table.mjs +24 -0
  361. package/es/components/table-v2/src/renderers/left-table.mjs.map +1 -0
  362. package/es/components/table-v2/src/renderers/main-table.mjs +22 -0
  363. package/es/components/table-v2/src/renderers/main-table.mjs.map +1 -0
  364. package/es/components/table-v2/src/renderers/overlay.d.ts +3 -0
  365. package/es/components/table-v2/src/renderers/overlay.mjs +15 -0
  366. package/es/components/table-v2/src/renderers/overlay.mjs.map +1 -0
  367. package/es/components/table-v2/src/renderers/right-table.mjs +24 -0
  368. package/es/components/table-v2/src/renderers/right-table.mjs.map +1 -0
  369. package/es/components/table-v2/src/renderers/row.mjs +77 -0
  370. package/es/components/table-v2/src/renderers/row.mjs.map +1 -0
  371. package/es/components/table-v2/src/row.d.ts +6 -1
  372. package/es/components/table-v2/src/row.mjs.map +1 -1
  373. package/es/components/table-v2/src/table-grid.d.ts +8 -2
  374. package/es/components/table-v2/src/table-grid.mjs +221 -0
  375. package/es/components/table-v2/src/table-grid.mjs.map +1 -0
  376. package/es/components/table-v2/src/table-v2.d.ts +3 -12
  377. package/es/components/table-v2/src/table-v2.mjs +250 -0
  378. package/es/components/table-v2/src/table-v2.mjs.map +1 -0
  379. package/es/components/table-v2/src/table.d.ts +2 -5
  380. package/es/components/table-v2/src/table.mjs.map +1 -1
  381. package/es/components/table-v2/src/types.d.ts +15 -2
  382. package/es/components/table-v2/src/use-table.d.ts +20 -29
  383. package/es/components/table-v2/src/use-table.mjs +84 -238
  384. package/es/components/table-v2/src/use-table.mjs.map +1 -1
  385. package/es/components/table-v2/src/utils.mjs +1 -1
  386. package/es/components/table-v2/src/utils.mjs.map +1 -1
  387. package/es/components/tooltip/index.mjs +2 -2
  388. package/es/components/tooltip/src/content.mjs +1 -1
  389. package/es/components/tooltip/src/tooltip.mjs +62 -174
  390. package/es/components/tooltip/src/tooltip.mjs.map +1 -1
  391. package/es/components/tooltip/src/tooltip2.mjs +174 -62
  392. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  393. package/es/components/tooltip/src/trigger.mjs +1 -1
  394. package/es/components/upload/index.d.ts +16 -12
  395. package/es/components/upload/src/upload-content.d.ts +1 -1
  396. package/es/components/upload/src/upload-content.vue.d.ts +4 -3
  397. package/es/components/upload/src/upload-content2.mjs +3 -1
  398. package/es/components/upload/src/upload-content2.mjs.map +1 -1
  399. package/es/components/upload/src/upload-list2.mjs +5 -3
  400. package/es/components/upload/src/upload-list2.mjs.map +1 -1
  401. package/es/components/upload/src/upload.d.ts +2 -2
  402. package/es/components/upload/src/upload.mjs +1 -1
  403. package/es/components/upload/src/upload.mjs.map +1 -1
  404. package/es/components/upload/src/upload.vue.d.ts +16 -12
  405. package/es/components/virtual-list/src/builders/build-grid.d.ts +11 -2
  406. package/es/components/virtual-list/src/builders/build-grid.mjs +7 -3
  407. package/es/components/virtual-list/src/builders/build-grid.mjs.map +1 -1
  408. package/es/components/virtual-list/src/components/dynamic-size-grid.d.ts +11 -2
  409. package/es/components/virtual-list/src/components/dynamic-size-grid.mjs +4 -2
  410. package/es/components/virtual-list/src/components/dynamic-size-grid.mjs.map +1 -1
  411. package/es/components/virtual-list/src/components/fixed-size-grid.d.ts +11 -2
  412. package/es/components/virtual-list/src/components/scrollbar.d.ts +2 -2
  413. package/es/components/virtual-list/src/props.d.ts +7 -3
  414. package/es/components/virtual-list/src/props.mjs +5 -1
  415. package/es/components/virtual-list/src/props.mjs.map +1 -1
  416. package/es/components/virtual-list/src/types.d.ts +7 -0
  417. package/es/components/virtual-list/src/utils.d.ts +10 -5
  418. package/es/components/virtual-list/src/utils.mjs.map +1 -1
  419. package/es/constants/index.mjs +1 -1
  420. package/es/constants/size.d.ts +0 -1
  421. package/es/constants/size.mjs +1 -4
  422. package/es/constants/size.mjs.map +1 -1
  423. package/es/directives/mousewheel/index.mjs +1 -7
  424. package/es/directives/mousewheel/index.mjs.map +1 -1
  425. package/es/hooks/index.d.ts +1 -0
  426. package/es/hooks/index.mjs +1 -0
  427. package/es/hooks/index.mjs.map +1 -1
  428. package/es/hooks/use-cursor/index.d.ts +2 -0
  429. package/es/hooks/use-cursor/index.mjs +46 -0
  430. package/es/hooks/use-cursor/index.mjs.map +1 -0
  431. package/es/hooks/use-draggable/index.mjs +1 -1
  432. package/es/index.mjs +3 -2
  433. package/es/index.mjs.map +1 -1
  434. package/es/utils/dom/index.mjs +1 -1
  435. package/es/utils/dom/style.d.ts +1 -0
  436. package/es/utils/dom/style.mjs +15 -3
  437. package/es/utils/dom/style.mjs.map +1 -1
  438. package/es/utils/index.mjs +2 -2
  439. package/es/utils/vue/index.d.ts +1 -1
  440. package/es/utils/vue/index.mjs +1 -1
  441. package/es/utils/vue/size.d.ts +1 -0
  442. package/es/utils/vue/size.mjs +9 -0
  443. package/es/utils/vue/size.mjs.map +1 -0
  444. package/es/version.d.ts +1 -1
  445. package/es/version.mjs +1 -1
  446. package/es/version.mjs.map +1 -1
  447. package/lib/components/autocomplete/index.d.ts +29 -1
  448. package/lib/components/autocomplete/src/autocomplete.js +1 -1
  449. package/lib/components/autocomplete/src/autocomplete.vue.d.ts +29 -1
  450. package/lib/components/avatar/src/avatar2.js +1 -1
  451. package/lib/components/calendar/src/calendar2.js +1 -1
  452. package/lib/components/calendar/src/calendar2.js.map +1 -1
  453. package/lib/components/calendar/src/date-table2.js +3 -2
  454. package/lib/components/calendar/src/date-table2.js.map +1 -1
  455. package/lib/components/cascader/index.d.ts +38 -2
  456. package/lib/components/cascader/src/index.js +1 -1
  457. package/lib/components/cascader/src/index.vue.d.ts +19 -1
  458. package/lib/components/col/src/col.d.ts +2 -0
  459. package/lib/components/col/src/col.js.map +1 -1
  460. package/lib/components/color-picker/src/index.js +4 -1
  461. package/lib/components/color-picker/src/index.js.map +1 -1
  462. package/lib/components/descriptions/src/descriptions-cell.js +1 -1
  463. package/lib/components/dropdown/src/dropdown.js +1 -1
  464. package/lib/components/dropdown/src/dropdown2.js +1 -1
  465. package/lib/components/form/src/form-item2.js +1 -1
  466. package/lib/components/icon/src/icon2.js +1 -1
  467. package/lib/components/image/index.d.ts +8 -0
  468. package/lib/components/image/src/image.d.ts +1 -0
  469. package/lib/components/image/src/image.js +4 -0
  470. package/lib/components/image/src/image.js.map +1 -1
  471. package/lib/components/image/src/image.vue.d.ts +8 -0
  472. package/lib/components/image/src/image2.js +2 -1
  473. package/lib/components/image/src/image2.js.map +1 -1
  474. package/lib/components/image-viewer/index.d.ts +4 -0
  475. package/lib/components/image-viewer/src/image-viewer.d.ts +1 -0
  476. package/lib/components/image-viewer/src/image-viewer.js +4 -0
  477. package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
  478. package/lib/components/image-viewer/src/image-viewer.vue.d.ts +4 -0
  479. package/lib/components/image-viewer/src/image-viewer2.js +1 -1
  480. package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
  481. package/lib/components/index.js +1 -1
  482. package/lib/components/input/index.d.ts +10 -0
  483. package/lib/components/input/src/input.d.ts +2 -0
  484. package/lib/components/input/src/input.js +6 -0
  485. package/lib/components/input/src/input.js.map +1 -1
  486. package/lib/components/input/src/input.vue.d.ts +10 -0
  487. package/lib/components/input/src/input2.js +35 -22
  488. package/lib/components/input/src/input2.js.map +1 -1
  489. package/lib/components/input-number/index.d.ts +20 -0
  490. package/lib/components/input-number/src/input-number.vue.d.ts +20 -0
  491. package/lib/components/popconfirm/src/popconfirm.js +1 -1
  492. package/lib/components/popover/src/popover.js +1 -1
  493. package/lib/components/scrollbar/src/scrollbar2.js +1 -1
  494. package/lib/components/scrollbar/src/thumb.vue.d.ts +16 -16
  495. package/lib/components/scrollbar/src/util.d.ts +18 -18
  496. package/lib/components/scrollbar/src/util.js.map +1 -1
  497. package/lib/components/select/src/select.js +6 -12
  498. package/lib/components/select/src/select.js.map +1 -1
  499. package/lib/components/select/src/useSelect.js +1 -1
  500. package/lib/components/select/src/useSelect.js.map +1 -1
  501. package/lib/components/select-v2/src/defaults.js +1 -1
  502. package/lib/components/table/src/table/style-helper.js +1 -4
  503. package/lib/components/table/src/table/style-helper.js.map +1 -1
  504. package/lib/components/table-v2/index.d.ts +4 -1
  505. package/lib/components/table-v2/index.js +13 -0
  506. package/lib/components/table-v2/index.js.map +1 -1
  507. package/lib/components/table-v2/src/column.d.ts +2 -2
  508. package/lib/components/table-v2/src/components/cell.d.ts +4 -0
  509. package/lib/components/table-v2/src/components/cell.js +26 -0
  510. package/lib/components/table-v2/src/components/cell.js.map +1 -0
  511. package/{es/components/table-v2/src → lib/components/table-v2/src/components}/expand-icon.d.ts +1 -1
  512. package/lib/components/table-v2/src/components/expand-icon.js +30 -0
  513. package/lib/components/table-v2/src/components/expand-icon.js.map +1 -0
  514. package/lib/components/table-v2/src/components/header-cell.d.ts +4 -0
  515. package/lib/components/table-v2/src/components/header-cell.js +19 -0
  516. package/lib/components/table-v2/src/components/header-cell.js.map +1 -0
  517. package/lib/components/table-v2/src/{table-header-row.d.ts → components/header-row.d.ts} +6 -6
  518. package/lib/components/table-v2/src/components/header-row.js +44 -0
  519. package/lib/components/table-v2/src/components/header-row.js.map +1 -0
  520. package/{es/components/table-v2/src/table-header.d.ts → lib/components/table-v2/src/components/header.d.ts} +3 -3
  521. package/lib/components/table-v2/src/components/header.js +100 -0
  522. package/lib/components/table-v2/src/components/header.js.map +1 -0
  523. package/lib/components/table-v2/src/components/index.d.ts +10 -0
  524. package/lib/components/table-v2/src/components/index.js +22 -0
  525. package/lib/components/table-v2/src/components/index.js.map +1 -0
  526. package/lib/components/table-v2/src/{table-row.d.ts → components/row.d.ts} +18 -19
  527. package/lib/components/table-v2/src/components/row.js +208 -0
  528. package/lib/components/table-v2/src/components/row.js.map +1 -0
  529. package/lib/components/table-v2/src/{sort-icon.d.ts → components/sort-icon.d.ts} +1 -1
  530. package/lib/components/table-v2/src/components/sort-icon.js +23 -0
  531. package/lib/components/table-v2/src/components/sort-icon.js.map +1 -0
  532. package/lib/components/table-v2/src/composables/index.d.ts +5 -0
  533. package/lib/components/table-v2/src/composables/index.js +18 -0
  534. package/lib/components/table-v2/src/composables/index.js.map +1 -0
  535. package/{es/components/table-v2/src → lib/components/table-v2/src/composables}/use-columns.d.ts +8 -6
  536. package/lib/components/table-v2/src/{use-columns.js → composables/use-columns.js} +27 -31
  537. package/lib/components/table-v2/src/composables/use-columns.js.map +1 -0
  538. package/lib/components/table-v2/src/composables/use-data.d.ts +17 -0
  539. package/lib/components/table-v2/src/composables/use-data.js +48 -0
  540. package/lib/components/table-v2/src/composables/use-data.js.map +1 -0
  541. package/lib/components/table-v2/src/composables/use-row.d.ts +32 -0
  542. package/lib/components/table-v2/src/composables/use-row.js +127 -0
  543. package/lib/components/table-v2/src/composables/use-row.js.map +1 -0
  544. package/lib/components/table-v2/src/composables/use-scrollbar.d.ts +26 -0
  545. package/lib/components/table-v2/src/composables/use-scrollbar.js +59 -0
  546. package/lib/components/table-v2/src/composables/use-scrollbar.js.map +1 -0
  547. package/lib/components/table-v2/src/composables/use-styles.d.ts +25 -0
  548. package/lib/components/table-v2/src/composables/use-styles.js +91 -0
  549. package/lib/components/table-v2/src/composables/use-styles.js.map +1 -0
  550. package/lib/components/table-v2/src/composables/utils.d.ts +3 -0
  551. package/lib/components/table-v2/src/composables/utils.js +30 -0
  552. package/lib/components/table-v2/src/composables/utils.js.map +1 -0
  553. package/lib/components/table-v2/src/constants.d.ts +4 -0
  554. package/lib/components/table-v2/src/constants.js +6 -0
  555. package/lib/components/table-v2/src/constants.js.map +1 -1
  556. package/lib/components/table-v2/src/grid.d.ts +4 -1
  557. package/lib/components/table-v2/src/grid.js +5 -0
  558. package/lib/components/table-v2/src/grid.js.map +1 -1
  559. package/lib/components/table-v2/src/renderers/cell.d.ts +1 -1
  560. package/lib/components/table-v2/src/renderers/cell.js +95 -0
  561. package/lib/components/table-v2/src/renderers/cell.js.map +1 -0
  562. package/lib/components/table-v2/src/renderers/empty.d.ts +7 -0
  563. package/lib/components/table-v2/src/renderers/empty.js +19 -0
  564. package/lib/components/table-v2/src/renderers/empty.js.map +1 -0
  565. package/lib/components/table-v2/src/renderers/footer.d.ts +7 -0
  566. package/lib/components/table-v2/src/renderers/footer.js +19 -0
  567. package/lib/components/table-v2/src/renderers/footer.js.map +1 -0
  568. package/lib/components/table-v2/src/renderers/header-cell.d.ts +1 -1
  569. package/lib/components/table-v2/src/renderers/header-cell.js +69 -0
  570. package/lib/components/table-v2/src/renderers/header-cell.js.map +1 -0
  571. package/lib/components/table-v2/src/renderers/header.d.ts +1 -1
  572. package/lib/components/table-v2/src/renderers/header.js +43 -0
  573. package/lib/components/table-v2/src/renderers/header.js.map +1 -0
  574. package/lib/components/table-v2/src/renderers/left-table.js +28 -0
  575. package/lib/components/table-v2/src/renderers/left-table.js.map +1 -0
  576. package/lib/components/table-v2/src/renderers/main-table.js +26 -0
  577. package/lib/components/table-v2/src/renderers/main-table.js.map +1 -0
  578. package/lib/components/table-v2/src/renderers/overlay.d.ts +3 -0
  579. package/lib/components/table-v2/src/renderers/overlay.js +19 -0
  580. package/lib/components/table-v2/src/renderers/overlay.js.map +1 -0
  581. package/lib/components/table-v2/src/renderers/right-table.js +28 -0
  582. package/lib/components/table-v2/src/renderers/right-table.js.map +1 -0
  583. package/lib/components/table-v2/src/renderers/row.js +81 -0
  584. package/lib/components/table-v2/src/renderers/row.js.map +1 -0
  585. package/lib/components/table-v2/src/row.d.ts +6 -1
  586. package/lib/components/table-v2/src/row.js.map +1 -1
  587. package/lib/components/table-v2/src/table-grid.d.ts +8 -2
  588. package/lib/components/table-v2/src/table-grid.js +225 -0
  589. package/lib/components/table-v2/src/table-grid.js.map +1 -0
  590. package/lib/components/table-v2/src/table-v2.d.ts +3 -12
  591. package/lib/components/table-v2/src/table-v2.js +254 -0
  592. package/lib/components/table-v2/src/table-v2.js.map +1 -0
  593. package/lib/components/table-v2/src/table.d.ts +2 -5
  594. package/lib/components/table-v2/src/table.js.map +1 -1
  595. package/lib/components/table-v2/src/types.d.ts +15 -2
  596. package/lib/components/table-v2/src/use-table.d.ts +20 -29
  597. package/lib/components/table-v2/src/use-table.js +82 -236
  598. package/lib/components/table-v2/src/use-table.js.map +1 -1
  599. package/lib/components/table-v2/src/utils.js +1 -1
  600. package/lib/components/table-v2/src/utils.js.map +1 -1
  601. package/lib/components/tooltip/index.js +2 -2
  602. package/lib/components/tooltip/src/content.js +1 -1
  603. package/lib/components/tooltip/src/tooltip.js +64 -174
  604. package/lib/components/tooltip/src/tooltip.js.map +1 -1
  605. package/lib/components/tooltip/src/tooltip2.js +174 -64
  606. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  607. package/lib/components/tooltip/src/trigger.js +1 -1
  608. package/lib/components/upload/index.d.ts +16 -12
  609. package/lib/components/upload/src/upload-content.d.ts +1 -1
  610. package/lib/components/upload/src/upload-content.vue.d.ts +4 -3
  611. package/lib/components/upload/src/upload-content2.js +3 -1
  612. package/lib/components/upload/src/upload-content2.js.map +1 -1
  613. package/lib/components/upload/src/upload-list2.js +4 -2
  614. package/lib/components/upload/src/upload-list2.js.map +1 -1
  615. package/lib/components/upload/src/upload.d.ts +2 -2
  616. package/lib/components/upload/src/upload.js +1 -1
  617. package/lib/components/upload/src/upload.js.map +1 -1
  618. package/lib/components/upload/src/upload.vue.d.ts +16 -12
  619. package/lib/components/virtual-list/src/builders/build-grid.d.ts +11 -2
  620. package/lib/components/virtual-list/src/builders/build-grid.js +7 -3
  621. package/lib/components/virtual-list/src/builders/build-grid.js.map +1 -1
  622. package/lib/components/virtual-list/src/components/dynamic-size-grid.d.ts +11 -2
  623. package/lib/components/virtual-list/src/components/dynamic-size-grid.js +4 -2
  624. package/lib/components/virtual-list/src/components/dynamic-size-grid.js.map +1 -1
  625. package/lib/components/virtual-list/src/components/fixed-size-grid.d.ts +11 -2
  626. package/lib/components/virtual-list/src/components/scrollbar.d.ts +2 -2
  627. package/lib/components/virtual-list/src/props.d.ts +7 -3
  628. package/lib/components/virtual-list/src/props.js +5 -1
  629. package/lib/components/virtual-list/src/props.js.map +1 -1
  630. package/lib/components/virtual-list/src/types.d.ts +7 -0
  631. package/lib/components/virtual-list/src/utils.d.ts +10 -5
  632. package/lib/components/virtual-list/src/utils.js.map +1 -1
  633. package/lib/constants/index.js +0 -1
  634. package/lib/constants/index.js.map +1 -1
  635. package/lib/constants/size.d.ts +0 -1
  636. package/lib/constants/size.js +0 -4
  637. package/lib/constants/size.js.map +1 -1
  638. package/lib/directives/mousewheel/index.js +1 -7
  639. package/lib/directives/mousewheel/index.js.map +1 -1
  640. package/lib/hooks/index.d.ts +1 -0
  641. package/lib/hooks/index.js +2 -0
  642. package/lib/hooks/index.js.map +1 -1
  643. package/lib/hooks/use-cursor/index.d.ts +2 -0
  644. package/lib/hooks/use-cursor/index.js +50 -0
  645. package/lib/hooks/use-cursor/index.js.map +1 -0
  646. package/lib/hooks/use-draggable/index.js +1 -1
  647. package/lib/index.js +3 -2
  648. package/lib/index.js.map +1 -1
  649. package/lib/utils/dom/index.js +1 -0
  650. package/lib/utils/dom/index.js.map +1 -1
  651. package/lib/utils/dom/style.d.ts +1 -0
  652. package/lib/utils/dom/style.js +13 -0
  653. package/lib/utils/dom/style.js.map +1 -1
  654. package/lib/utils/index.js +3 -2
  655. package/lib/utils/index.js.map +1 -1
  656. package/lib/utils/vue/index.d.ts +1 -1
  657. package/lib/utils/vue/index.js +2 -2
  658. package/lib/utils/vue/size.d.ts +1 -0
  659. package/lib/utils/vue/size.js +13 -0
  660. package/lib/utils/vue/size.js.map +1 -0
  661. package/lib/version.d.ts +1 -1
  662. package/lib/version.js +1 -1
  663. package/lib/version.js.map +1 -1
  664. package/package.json +7 -7
  665. package/tags.json +1 -1
  666. package/theme-chalk/el-autocomplete.css +1 -1
  667. package/theme-chalk/el-date-picker.css +1 -1
  668. package/theme-chalk/el-input-number.css +1 -1
  669. package/theme-chalk/el-input.css +1 -1
  670. package/theme-chalk/el-pagination.css +1 -1
  671. package/theme-chalk/el-step.css +1 -1
  672. package/theme-chalk/el-table-v2.css +1 -1
  673. package/theme-chalk/el-tabs.css +1 -1
  674. package/theme-chalk/el-time-picker.css +1 -1
  675. package/theme-chalk/el-upload.css +1 -1
  676. package/theme-chalk/index.css +1 -1
  677. package/theme-chalk/src/autocomplete.scss +9 -9
  678. package/theme-chalk/src/check-tag.scss +5 -5
  679. package/theme-chalk/src/dark/var.scss +7 -7
  680. package/theme-chalk/src/date-picker/time-picker.scss +2 -2
  681. package/theme-chalk/src/date-picker/year-table.scss +2 -2
  682. package/theme-chalk/src/input-number.scss +0 -1
  683. package/theme-chalk/src/input.scss +12 -5
  684. package/theme-chalk/src/pagination.scss +6 -0
  685. package/theme-chalk/src/step.scss +1 -1
  686. package/theme-chalk/src/table-v2.scss +30 -6
  687. package/theme-chalk/src/tabs.scss +1 -1
  688. package/theme-chalk/src/upload.scss +7 -4
  689. package/web-types.json +1 -1
  690. package/es/components/table-v2/src/column-resizer.d.ts +0 -14
  691. package/es/components/table-v2/src/column-resizer.mjs +0 -24
  692. package/es/components/table-v2/src/column-resizer.mjs.map +0 -1
  693. package/es/components/table-v2/src/table-cell.d.ts +0 -9
  694. package/es/components/table-v2/src/table-column-resizer.d.ts +0 -31
  695. package/es/components/table-v2/src/table-header-cell.d.ts +0 -8
  696. package/es/components/table-v2/src/use-columns.mjs.map +0 -1
  697. package/es/utils/vue/style.d.ts +0 -1
  698. package/es/utils/vue/style.mjs +0 -19
  699. package/es/utils/vue/style.mjs.map +0 -1
  700. package/lib/components/table-v2/src/column-resizer.d.ts +0 -14
  701. package/lib/components/table-v2/src/column-resizer.js +0 -28
  702. package/lib/components/table-v2/src/column-resizer.js.map +0 -1
  703. package/lib/components/table-v2/src/table-cell.d.ts +0 -9
  704. package/lib/components/table-v2/src/table-column-resizer.d.ts +0 -31
  705. package/lib/components/table-v2/src/table-header-cell.d.ts +0 -8
  706. package/lib/components/table-v2/src/use-columns.js.map +0 -1
  707. package/lib/utils/vue/style.d.ts +0 -1
  708. package/lib/utils/vue/style.js +0 -23
  709. package/lib/utils/vue/style.js.map +0 -1
@@ -3,37 +3,18 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
- var _private = require('./private.js');
6
+ require('../../../../utils/index.js');
7
+ var constants = require('../constants.js');
8
+ var _private = require('../private.js');
9
+ var utils = require('./utils.js');
10
+ var shared = require('@vue/shared');
7
11
 
8
- const calcColumnStyle = (column, fixedColumn) => {
9
- var _a;
10
- const flex = {
11
- flexGrow: 0,
12
- flexShrink: 0
13
- };
14
- if (column.fixed) {
15
- flex.flexShrink = 1;
16
- }
17
- const style = {
18
- ...(_a = column.style) != null ? _a : {},
19
- ...flex,
20
- flexBasis: "auto",
21
- width: column.width
22
- };
23
- if (!fixedColumn) {
24
- if (column.maxWidth)
25
- style.maxWidth = column.maxWidth;
26
- if (column.minWidth)
27
- style.maxWidth = column.minWidth;
28
- }
29
- return style;
30
- };
31
- function useColumns(columns, fixed) {
12
+ function useColumns(props, columns, fixed) {
32
13
  const visibleColumns = vue.computed(() => {
33
14
  return vue.unref(columns).filter((column) => !column.hidden);
34
15
  });
35
16
  const fixedColumnsOnLeft = vue.computed(() => vue.unref(visibleColumns).filter((column) => column.fixed === "left" || column.fixed === true));
36
- const fixedColumnOnRight = vue.computed(() => vue.unref(visibleColumns).filter((column) => column.fixed === "right"));
17
+ const fixedColumnsOnRight = vue.computed(() => vue.unref(visibleColumns).filter((column) => column.fixed === "right"));
37
18
  const normalColumns = vue.computed(() => vue.unref(visibleColumns).filter((column) => !column.fixed));
38
19
  const mainColumns = vue.computed(() => {
39
20
  const ret = [];
@@ -46,7 +27,7 @@ function useColumns(columns, fixed) {
46
27
  vue.unref(normalColumns).forEach((column) => {
47
28
  ret.push(column);
48
29
  });
49
- vue.unref(fixedColumnOnRight).forEach((column) => {
30
+ vue.unref(fixedColumnsOnRight).forEach((column) => {
50
31
  ret.push({
51
32
  ...column,
52
33
  placeholderSign: _private.placeholderSign
@@ -55,12 +36,12 @@ function useColumns(columns, fixed) {
55
36
  return ret;
56
37
  });
57
38
  const hasFixedColumns = vue.computed(() => {
58
- return vue.unref(fixedColumnsOnLeft).length || vue.unref(fixedColumnOnRight).length;
39
+ return vue.unref(fixedColumnsOnLeft).length || vue.unref(fixedColumnsOnRight).length;
59
40
  });
60
41
  const columnsStyles = vue.computed(() => {
61
42
  const _columns = vue.unref(columns);
62
43
  return _columns.reduce((style, column) => {
63
- style[column.key] = calcColumnStyle(column, vue.unref(fixed));
44
+ style[column.key] = utils.calcColumnStyle(column, vue.unref(fixed));
64
45
  return style;
65
46
  }, {});
66
47
  });
@@ -76,19 +57,34 @@ function useColumns(columns, fixed) {
76
57
  const updateColumnWidth = (column, width) => {
77
58
  column.width = width;
78
59
  };
60
+ function onColumnSorted(e) {
61
+ var _a;
62
+ const { key } = e.currentTarget.dataset;
63
+ if (!key)
64
+ return;
65
+ const { sortState, sortBy } = props;
66
+ let order = constants.SortOrder.ASC;
67
+ if (shared.isObject(sortState)) {
68
+ order = constants.oppositeOrderMap[sortState[key]];
69
+ } else {
70
+ order = constants.oppositeOrderMap[sortBy.order];
71
+ }
72
+ (_a = props.onColumnSort) == null ? void 0 : _a.call(props, { column: getColumn(key), key, order });
73
+ }
79
74
  return {
80
75
  columns,
81
76
  columnsStyles,
82
77
  columnsTotalWidth,
83
78
  fixedColumnsOnLeft,
84
- fixedColumnOnRight,
79
+ fixedColumnsOnRight,
85
80
  hasFixedColumns,
86
81
  mainColumns,
87
82
  normalColumns,
88
83
  visibleColumns,
89
84
  getColumn,
90
85
  getColumnStyle,
91
- updateColumnWidth
86
+ updateColumnWidth,
87
+ onColumnSorted
92
88
  };
93
89
  }
94
90
 
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-columns.js","sources":["../../../../../../../packages/components/table-v2/src/composables/use-columns.ts"],"sourcesContent":["import { computed, unref } from 'vue'\nimport { isObject } from '@element-plus/utils'\nimport { SortOrder, oppositeOrderMap } from '../constants'\nimport { placeholderSign } from '../private'\nimport { calcColumnStyle } from './utils'\n\nimport type { CSSProperties, Ref } from 'vue'\nimport type { TableV2Props } from '../table'\nimport type { AnyColumns, Column, KeyType } from '../types'\n\nfunction useColumns(\n props: TableV2Props,\n columns: Ref<AnyColumns>,\n fixed: Ref<boolean>\n) {\n const visibleColumns = computed(() => {\n return unref(columns).filter((column) => !column.hidden)\n })\n\n const fixedColumnsOnLeft = computed(() =>\n unref(visibleColumns).filter(\n (column) => column.fixed === 'left' || column.fixed === true\n )\n )\n\n const fixedColumnsOnRight = computed(() =>\n unref(visibleColumns).filter((column) => column.fixed === 'right')\n )\n\n const normalColumns = computed(() =>\n unref(visibleColumns).filter((column) => !column.fixed)\n )\n\n const mainColumns = computed(() => {\n const ret: AnyColumns = []\n\n unref(fixedColumnsOnLeft).forEach((column) => {\n ret.push({\n ...column,\n placeholderSign,\n })\n })\n\n unref(normalColumns).forEach((column) => {\n ret.push(column)\n })\n\n unref(fixedColumnsOnRight).forEach((column) => {\n ret.push({\n ...column,\n placeholderSign,\n })\n })\n\n return ret\n })\n\n const hasFixedColumns = computed(() => {\n return unref(fixedColumnsOnLeft).length || unref(fixedColumnsOnRight).length\n })\n\n const columnsStyles = computed(() => {\n const _columns = unref(columns)\n\n return _columns.reduce<Record<Column<any>['key'], CSSProperties>>(\n (style, column) => {\n style[column.key] = calcColumnStyle(column, unref(fixed))\n return style\n },\n {}\n )\n })\n\n const columnsTotalWidth = computed(() => {\n return unref(visibleColumns).reduce(\n (width, column) => width + column.width,\n 0\n )\n })\n\n const getColumn = (key: KeyType) => {\n return unref(columns).find((column) => column.key === key)\n }\n\n const getColumnStyle = (key: KeyType) => {\n return unref(columnsStyles)[key]\n }\n\n const updateColumnWidth = (column: Column<any>, width: number) => {\n column.width = width\n }\n\n function onColumnSorted(e: MouseEvent) {\n const { key } = (e.currentTarget as HTMLElement).dataset\n if (!key) return\n const { sortState, sortBy } = props\n\n let order = SortOrder.ASC\n\n if (isObject(sortState)) {\n order = oppositeOrderMap[sortState[key]]\n } else {\n order = oppositeOrderMap[sortBy.order]\n }\n\n props.onColumnSort?.({ column: getColumn(key)!, key, order })\n }\n\n return {\n columns,\n columnsStyles,\n columnsTotalWidth,\n fixedColumnsOnLeft,\n fixedColumnsOnRight,\n hasFixedColumns,\n mainColumns,\n normalColumns,\n visibleColumns,\n\n getColumn,\n getColumnStyle,\n updateColumnWidth,\n onColumnSorted,\n }\n}\n\nexport { useColumns }\nexport type UseColumnsReturn = ReturnType<typeof useColumns>\n"],"names":["computed","unref","placeholderSign","calcColumnStyle","SortOrder","isObject","oppositeOrderMap"],"mappings":";;;;;;;;;;;AAKA,SAAS,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;AAC3C,EAAE,MAAM,cAAc,GAAGA,YAAQ,CAAC,MAAM;AACxC,IAAI,OAAOC,SAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC7D,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,kBAAkB,GAAGD,YAAQ,CAAC,MAAMC,SAAK,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,KAAK,MAAM,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC;AACxI,EAAE,MAAM,mBAAmB,GAAGD,YAAQ,CAAC,MAAMC,SAAK,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC;AACjH,EAAE,MAAM,aAAa,GAAGD,YAAQ,CAAC,MAAMC,SAAK,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,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AAC/C,KAAK,MAAM;AACX,MAAM,KAAK,GAAGA,0BAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7C,KAAK;AACL,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,YAAY,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;AACxG,GAAG;AACH,EAAE,OAAO;AACT,IAAI,OAAO;AACX,IAAI,aAAa;AACjB,IAAI,iBAAiB;AACrB,IAAI,kBAAkB;AACtB,IAAI,mBAAmB;AACvB,IAAI,eAAe;AACnB,IAAI,WAAW;AACf,IAAI,aAAa;AACjB,IAAI,cAAc;AAClB,IAAI,SAAS;AACb,IAAI,cAAc;AAClB,IAAI,iBAAiB;AACrB,IAAI,cAAc;AAClB,GAAG,CAAC;AACJ;;;;"}
@@ -0,0 +1,17 @@
1
+ import type { TableV2Props } from '../table';
2
+ import type { UseRowReturn } from './use-row';
3
+ declare type UseDataProps = {
4
+ expandedRowKeys: UseRowReturn['expandedRowKeys'];
5
+ lastRenderedRowIndex: UseRowReturn['lastRenderedRowIndex'];
6
+ resetAfterIndex: UseRowReturn['resetAfterIndex'];
7
+ };
8
+ export declare const useData: (props: TableV2Props, { expandedRowKeys, lastRenderedRowIndex, resetAfterIndex }: UseDataProps) => {
9
+ data: import("vue").ComputedRef<any[]>;
10
+ depthMap: import("vue").Ref<{
11
+ [x: string]: number;
12
+ [x: number]: number;
13
+ [x: symbol]: number;
14
+ }>;
15
+ };
16
+ export declare type UseDataReturn = ReturnType<typeof useData>;
17
+ export {};
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+
7
+ const useData = (props, { expandedRowKeys, lastRenderedRowIndex, resetAfterIndex }) => {
8
+ const depthMap = vue.ref({});
9
+ const flattenedData = vue.computed(() => {
10
+ const depths = {};
11
+ const { data: data2, rowKey } = props;
12
+ const _expandedRowKeys = vue.unref(expandedRowKeys);
13
+ if (!_expandedRowKeys || !_expandedRowKeys.length)
14
+ return data2;
15
+ const array = [];
16
+ const keysSet = /* @__PURE__ */ new Set();
17
+ _expandedRowKeys.forEach((x) => keysSet.add(x));
18
+ let copy = data2.slice();
19
+ copy.forEach((x) => depths[x[rowKey]] = 0);
20
+ while (copy.length > 0) {
21
+ const item = copy.shift();
22
+ array.push(item);
23
+ if (keysSet.has(item[rowKey]) && Array.isArray(item.children) && item.children.length > 0) {
24
+ copy = [...item.children, ...copy];
25
+ item.children.forEach((child) => depths[child[rowKey]] = depths[item[rowKey]] + 1);
26
+ }
27
+ }
28
+ depthMap.value = depths;
29
+ return array;
30
+ });
31
+ const data = vue.computed(() => {
32
+ const { data: data2, expandColumnKey } = props;
33
+ return expandColumnKey ? vue.unref(flattenedData) : data2;
34
+ });
35
+ vue.watch(data, (val, prev) => {
36
+ if (val !== prev) {
37
+ lastRenderedRowIndex.value = -1;
38
+ resetAfterIndex(0, true);
39
+ }
40
+ });
41
+ return {
42
+ data,
43
+ depthMap
44
+ };
45
+ };
46
+
47
+ exports.useData = useData;
48
+ //# sourceMappingURL=use-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-data.js","sources":["../../../../../../../packages/components/table-v2/src/composables/use-data.ts"],"sourcesContent":["import { computed, ref, unref, watch } from 'vue'\n\nimport type { TableV2Props } from '../table'\nimport type { KeyType } from '../types'\nimport type { UseRowReturn } from './use-row'\n\ntype UseDataProps = {\n expandedRowKeys: UseRowReturn['expandedRowKeys']\n lastRenderedRowIndex: UseRowReturn['lastRenderedRowIndex']\n resetAfterIndex: UseRowReturn['resetAfterIndex']\n}\n\nexport const useData = (\n props: TableV2Props,\n { expandedRowKeys, lastRenderedRowIndex, resetAfterIndex }: UseDataProps\n) => {\n const depthMap = ref<Record<KeyType, number>>({})\n\n const flattenedData = computed(() => {\n const depths: Record<KeyType, number> = {}\n const { data, rowKey } = props\n\n const _expandedRowKeys = unref(expandedRowKeys)\n\n if (!_expandedRowKeys || !_expandedRowKeys.length) return data\n\n const array: any[] = []\n const keysSet = new Set()\n _expandedRowKeys.forEach((x) => keysSet.add(x))\n\n let copy: any[] = data.slice()\n copy.forEach((x) => (depths[x[rowKey]] = 0))\n while (copy.length > 0) {\n const item = copy.shift()!\n\n array.push(item)\n if (\n keysSet.has(item[rowKey]) &&\n Array.isArray(item.children) &&\n item.children.length > 0\n ) {\n copy = [...item.children, ...copy]\n item.children.forEach(\n (child: any) => (depths[child[rowKey]] = depths[item[rowKey]] + 1)\n )\n }\n }\n\n depthMap.value = depths\n return array\n })\n\n const data = computed(() => {\n const { data, expandColumnKey } = props\n return expandColumnKey ? unref(flattenedData) : data\n })\n\n watch(data, (val, prev) => {\n if (val !== prev) {\n lastRenderedRowIndex.value = -1\n resetAfterIndex(0, true)\n }\n })\n\n return {\n data,\n depthMap,\n }\n}\n\nexport type UseDataReturn = ReturnType<typeof useData>\n"],"names":["ref","computed","unref","watch"],"mappings":";;;;;;AACY,MAAC,OAAO,GAAG,CAAC,KAAK,EAAE,EAAE,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAE,KAAK;AAC9F,EAAE,MAAM,QAAQ,GAAGA,OAAG,CAAC,EAAE,CAAC,CAAC;AAC3B,EAAE,MAAM,aAAa,GAAGC,YAAQ,CAAC,MAAM;AACvC,IAAI,MAAM,MAAM,GAAG,EAAE,CAAC;AACtB,IAAI,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;AAC1C,IAAI,MAAM,gBAAgB,GAAGC,SAAK,CAAC,eAAe,CAAC,CAAC;AACpD,IAAI,IAAI,CAAC,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,MAAM;AACrD,MAAM,OAAO,KAAK,CAAC;AACnB,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;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AAI,OAAO,eAAe,GAAGC,SAAK,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC;AAC1D,GAAG,CAAC,CAAC;AACL,EAAEC,SAAK,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK;AAC7B,IAAI,IAAI,GAAG,KAAK,IAAI,EAAE;AACtB,MAAM,oBAAoB,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;AACtC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAC/B,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,IAAI;AACR,IAAI,QAAQ;AACZ,GAAG,CAAC;AACJ;;;;"}
@@ -0,0 +1,32 @@
1
+ import type { Ref } from 'vue';
2
+ import type { TableV2Props } from '../table';
3
+ import type { RowExpandParams, RowHeightChangedParams, RowHoverParams } from '../row';
4
+ import type { FixedDirection, KeyType } from '../types';
5
+ import type { onRowRenderedParams } from '../grid';
6
+ import type { TableGridInstance } from '../table-grid';
7
+ declare type GridInstanceRef = Ref<TableGridInstance | undefined>;
8
+ declare type UseRowProps = {
9
+ mainTableRef: GridInstanceRef;
10
+ leftTableRef: GridInstanceRef;
11
+ rightTableRef: GridInstanceRef;
12
+ onMaybeEndReached: () => void;
13
+ };
14
+ export declare const useRow: (props: TableV2Props, { mainTableRef, leftTableRef, rightTableRef, onMaybeEndReached }: UseRowProps) => {
15
+ hoveringRowKey: import("vue").ShallowRef<KeyType | null>;
16
+ expandedRowKeys: Ref<KeyType[]>;
17
+ lastRenderedRowIndex: Ref<number>;
18
+ isDynamic: import("vue").ComputedRef<boolean>;
19
+ isResetting: import("vue").ShallowRef<boolean>;
20
+ rowHeights: Ref<{
21
+ [x: string]: number;
22
+ [x: number]: number;
23
+ [x: symbol]: number;
24
+ }>;
25
+ resetAfterIndex: (index: number, forceUpdate?: boolean) => void;
26
+ onRowExpanded: ({ expanded, rowData, rowIndex, rowKey, }: RowExpandParams<any>) => void;
27
+ onRowHovered: ({ hovered, rowKey }: RowHoverParams<any>) => void;
28
+ onRowsRendered: (params: onRowRenderedParams) => void;
29
+ onRowHeightChange: ({ rowKey, height, rowIndex }: RowHeightChangedParams, fixedDir: FixedDirection) => void;
30
+ };
31
+ export declare type UseRowReturn = ReturnType<typeof useRow>;
32
+ export {};
@@ -0,0 +1,127 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var lodashUnified = require('lodash-unified');
7
+ require('../../../../utils/index.js');
8
+ var constants = require('../constants.js');
9
+ var core = require('@vueuse/core');
10
+
11
+ const useRow = (props, { mainTableRef, leftTableRef, rightTableRef, onMaybeEndReached }) => {
12
+ const vm = vue.getCurrentInstance();
13
+ const { emit } = vm;
14
+ const isResetting = vue.shallowRef(false);
15
+ const hoveringRowKey = vue.shallowRef(null);
16
+ const expandedRowKeys = vue.ref(props.defaultExpandedRowKeys || []);
17
+ const lastRenderedRowIndex = vue.ref(-1);
18
+ const resetIndex = vue.shallowRef(null);
19
+ const rowHeights = vue.ref({});
20
+ const pendingRowHeights = vue.ref({});
21
+ const leftTableHeights = vue.shallowRef({});
22
+ const mainTableHeights = vue.shallowRef({});
23
+ const rightTableHeights = vue.shallowRef({});
24
+ const isDynamic = vue.computed(() => core.isNumber(props.estimatedRowHeight));
25
+ function onRowsRendered(params) {
26
+ var _a;
27
+ (_a = props.onRowRendered) == null ? void 0 : _a.call(props, params);
28
+ if (params.rowCacheEnd > vue.unref(lastRenderedRowIndex)) {
29
+ lastRenderedRowIndex.value = params.rowCacheEnd;
30
+ }
31
+ }
32
+ function onRowHovered({ hovered, rowKey }) {
33
+ hoveringRowKey.value = hovered ? rowKey : null;
34
+ }
35
+ function onRowExpanded({
36
+ expanded,
37
+ rowData,
38
+ rowIndex,
39
+ rowKey
40
+ }) {
41
+ var _a, _b;
42
+ const _expandedRowKeys = [...vue.unref(expandedRowKeys)];
43
+ const currentKeyIndex = _expandedRowKeys.indexOf(rowKey);
44
+ if (expanded) {
45
+ if (currentKeyIndex === -1)
46
+ _expandedRowKeys.push(rowKey);
47
+ } else {
48
+ if (currentKeyIndex > -1)
49
+ _expandedRowKeys.splice(currentKeyIndex, 1);
50
+ }
51
+ expandedRowKeys.value = _expandedRowKeys;
52
+ emit("update:expandedRowKeys", _expandedRowKeys);
53
+ (_a = props.onRowExpand) == null ? void 0 : _a.call(props, {
54
+ expanded,
55
+ rowData,
56
+ rowIndex,
57
+ rowKey
58
+ });
59
+ (_b = props.onExpandedRowsChange) == null ? void 0 : _b.call(props, _expandedRowKeys);
60
+ }
61
+ const flushingRowHeights = lodashUnified.debounce(() => {
62
+ var _a, _b, _c, _d;
63
+ isResetting.value = true;
64
+ rowHeights.value = { ...vue.unref(rowHeights), ...vue.unref(pendingRowHeights) };
65
+ resetAfterIndex(vue.unref(resetIndex), false);
66
+ pendingRowHeights.value = {};
67
+ resetIndex.value = null;
68
+ (_a = mainTableRef.value) == null ? void 0 : _a.forceUpdate();
69
+ (_b = leftTableRef.value) == null ? void 0 : _b.forceUpdate();
70
+ (_c = rightTableRef.value) == null ? void 0 : _c.forceUpdate();
71
+ (_d = vm.proxy) == null ? void 0 : _d.$forceUpdate();
72
+ isResetting.value = false;
73
+ }, 0);
74
+ function resetAfterIndex(index, forceUpdate = false) {
75
+ if (!vue.unref(isDynamic))
76
+ return;
77
+ [mainTableRef, leftTableRef, rightTableRef].forEach((tableRef) => {
78
+ const table = vue.unref(tableRef);
79
+ if (table)
80
+ table.resetAfterRowIndex(index, forceUpdate);
81
+ });
82
+ }
83
+ function resetHeights(rowKey, height, rowIdx) {
84
+ const resetIdx = vue.unref(resetIndex);
85
+ if (resetIdx === null) {
86
+ resetIndex.value = rowIdx;
87
+ } else {
88
+ if (resetIdx > rowIdx) {
89
+ resetIndex.value = rowIdx;
90
+ }
91
+ }
92
+ pendingRowHeights.value[rowKey] = height;
93
+ }
94
+ function onRowHeightChange({ rowKey, height, rowIndex }, fixedDir) {
95
+ if (!fixedDir) {
96
+ mainTableHeights.value[rowKey] = height;
97
+ } else {
98
+ if (fixedDir === constants.FixedDir.RIGHT) {
99
+ rightTableHeights.value[rowKey] = height;
100
+ } else {
101
+ leftTableHeights.value[rowKey] = height;
102
+ }
103
+ }
104
+ const maximumHeight = Math.max(...[leftTableHeights, rightTableHeights, mainTableHeights].map((records) => records.value[rowKey] || 0));
105
+ if (vue.unref(rowHeights)[rowKey] !== maximumHeight) {
106
+ resetHeights(rowKey, maximumHeight, rowIndex);
107
+ flushingRowHeights();
108
+ }
109
+ }
110
+ vue.watch(lastRenderedRowIndex, () => onMaybeEndReached());
111
+ return {
112
+ hoveringRowKey,
113
+ expandedRowKeys,
114
+ lastRenderedRowIndex,
115
+ isDynamic,
116
+ isResetting,
117
+ rowHeights,
118
+ resetAfterIndex,
119
+ onRowExpanded,
120
+ onRowHovered,
121
+ onRowsRendered,
122
+ onRowHeightChange
123
+ };
124
+ };
125
+
126
+ exports.useRow = useRow;
127
+ //# sourceMappingURL=use-row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-row.js","sources":["../../../../../../../packages/components/table-v2/src/composables/use-row.ts"],"sourcesContent":["import {\n computed,\n getCurrentInstance,\n ref,\n shallowRef,\n unref,\n watch,\n} from 'vue'\nimport { debounce } from 'lodash-unified'\nimport { isNumber } from '@element-plus/utils'\nimport { FixedDir } from '../constants'\n\nimport type { Ref } from 'vue'\nimport type { TableV2Props } from '../table'\nimport type {\n RowExpandParams,\n RowHeightChangedParams,\n RowHoverParams,\n} from '../row'\nimport type { FixedDirection, KeyType } from '../types'\nimport type { onRowRenderedParams } from '../grid'\nimport type { TableGridInstance } from '../table-grid'\n\ntype Heights = Record<KeyType, number>\ntype GridInstanceRef = Ref<TableGridInstance | undefined>\n\ntype UseRowProps = {\n mainTableRef: GridInstanceRef\n leftTableRef: GridInstanceRef\n rightTableRef: GridInstanceRef\n\n onMaybeEndReached: () => void\n}\n\nexport const useRow = (\n props: TableV2Props,\n { mainTableRef, leftTableRef, rightTableRef, onMaybeEndReached }: UseRowProps\n) => {\n const vm = getCurrentInstance()!\n const { emit } = vm\n const isResetting = shallowRef(false)\n const hoveringRowKey = shallowRef<KeyType | null>(null)\n const expandedRowKeys = ref<KeyType[]>(props.defaultExpandedRowKeys || [])\n const lastRenderedRowIndex = ref(-1)\n const resetIndex = shallowRef<number | null>(null)\n const rowHeights = ref<Heights>({})\n const pendingRowHeights = ref<Heights>({})\n const leftTableHeights = shallowRef<Heights>({})\n const mainTableHeights = shallowRef<Heights>({})\n const rightTableHeights = shallowRef<Heights>({})\n const isDynamic = computed(() => isNumber(props.estimatedRowHeight))\n\n function onRowsRendered(params: onRowRenderedParams) {\n props.onRowRendered?.(params)\n\n if (params.rowCacheEnd > unref(lastRenderedRowIndex)) {\n lastRenderedRowIndex.value = params.rowCacheEnd\n }\n }\n\n function onRowHovered({ hovered, rowKey }: RowHoverParams<any>) {\n hoveringRowKey.value = hovered ? rowKey : null\n }\n\n function onRowExpanded({\n expanded,\n rowData,\n rowIndex,\n rowKey,\n }: RowExpandParams<any>) {\n const _expandedRowKeys = [...unref(expandedRowKeys)]\n const currentKeyIndex = _expandedRowKeys.indexOf(rowKey)\n if (expanded) {\n if (currentKeyIndex === -1) _expandedRowKeys.push(rowKey)\n } else {\n if (currentKeyIndex > -1) _expandedRowKeys.splice(currentKeyIndex, 1)\n }\n expandedRowKeys.value = _expandedRowKeys\n\n emit('update:expandedRowKeys', _expandedRowKeys)\n props.onRowExpand?.({\n expanded,\n rowData,\n rowIndex,\n rowKey,\n })\n // If this is not controlled, then use this to notify changes\n props.onExpandedRowsChange?.(_expandedRowKeys)\n }\n\n const flushingRowHeights = debounce(() => {\n isResetting.value = true\n rowHeights.value = { ...unref(rowHeights), ...unref(pendingRowHeights) }\n resetAfterIndex(unref(resetIndex)!, false)\n pendingRowHeights.value = {}\n // force update\n resetIndex.value = null\n mainTableRef.value?.forceUpdate()\n leftTableRef.value?.forceUpdate()\n rightTableRef.value?.forceUpdate()\n vm.proxy?.$forceUpdate()\n isResetting.value = false\n }, 0)\n\n function resetAfterIndex(index: number, forceUpdate = false) {\n if (!unref(isDynamic)) return\n ;[mainTableRef, leftTableRef, rightTableRef].forEach((tableRef) => {\n const table = unref(tableRef)\n if (table) table.resetAfterRowIndex(index, forceUpdate)\n })\n }\n\n function resetHeights(rowKey: KeyType, height: number, rowIdx: number) {\n const resetIdx = unref(resetIndex)\n if (resetIdx === null) {\n resetIndex.value = rowIdx\n } else {\n if (resetIdx > rowIdx) {\n resetIndex.value = rowIdx\n }\n }\n\n pendingRowHeights.value[rowKey] = height\n }\n\n function onRowHeightChange(\n { rowKey, height, rowIndex }: RowHeightChangedParams,\n fixedDir: FixedDirection\n ) {\n if (!fixedDir) {\n mainTableHeights.value[rowKey] = height\n } else {\n if (fixedDir === FixedDir.RIGHT) {\n rightTableHeights.value[rowKey] = height\n } else {\n leftTableHeights.value[rowKey] = height\n }\n }\n\n const maximumHeight = Math.max(\n ...[leftTableHeights, rightTableHeights, mainTableHeights].map(\n (records) => records.value[rowKey] || 0\n )\n )\n\n if (unref(rowHeights)[rowKey] !== maximumHeight) {\n resetHeights(rowKey, maximumHeight, rowIndex)\n flushingRowHeights()\n }\n }\n // when rendered row changes, maybe reaching the bottom\n watch(lastRenderedRowIndex, () => onMaybeEndReached())\n\n return {\n hoveringRowKey,\n expandedRowKeys,\n lastRenderedRowIndex,\n isDynamic,\n isResetting,\n rowHeights,\n\n resetAfterIndex,\n onRowExpanded,\n onRowHovered,\n onRowsRendered,\n onRowHeightChange,\n }\n}\n\nexport type UseRowReturn = ReturnType<typeof useRow>\n"],"names":["getCurrentInstance","shallowRef","ref","computed","isNumber","unref","debounce","FixedDir","watch"],"mappings":";;;;;;;;;;AAWY,MAAC,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,KAAK;AACnG,EAAE,MAAM,EAAE,GAAGA,sBAAkB,E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AC,CAAC,CAAC,CAAC;AAC5I,IAAI,IAAIF,SAAK,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,aAAa,EAAE;AACrD,MAAM,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;AACpD,MAAM,kBAAkB,EAAE,CAAC;AAC3B,KAAK;AACL,GAAG;AACH,EAAEG,SAAK,CAAC,oBAAoB,EAAE,MAAM,iBAAiB,EAAE,CAAC,CAAC;AACzD,EAAE,OAAO;AACT,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,oBAAoB;AACxB,IAAI,SAAS;AACb,IAAI,WAAW;AACf,IAAI,UAAU;AACd,IAAI,eAAe;AACnB,IAAI,aAAa;AACjB,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAAI,iBAAiB;AACrB,GAAG,CAAC;AACJ;;;;"}
@@ -0,0 +1,26 @@
1
+ import type { Ref } from 'vue';
2
+ import type { TableV2Props } from '../table';
3
+ import type { TableGridInstance } from '../table-grid';
4
+ export declare type ScrollPos = {
5
+ scrollLeft: number;
6
+ scrollTop: number;
7
+ };
8
+ declare type GridInstanceRef = Ref<TableGridInstance | undefined>;
9
+ declare type UseScrollBarProps = {
10
+ mainTableRef: GridInstanceRef;
11
+ leftTableRef: GridInstanceRef;
12
+ rightTableRef: GridInstanceRef;
13
+ onMaybeEndReached: () => void;
14
+ };
15
+ export declare const useScrollbar: (props: TableV2Props, { mainTableRef, leftTableRef, rightTableRef, onMaybeEndReached, }: UseScrollBarProps) => {
16
+ scrollPos: Ref<{
17
+ scrollLeft: number;
18
+ scrollTop: number;
19
+ }>;
20
+ scrollTo: (params: ScrollPos) => void;
21
+ scrollToLeft: (scrollLeft: number) => void;
22
+ scrollToTop: (scrollTop: number) => void;
23
+ onScroll: (params: ScrollPos) => void;
24
+ onVerticalScroll: ({ scrollTop }: ScrollPos) => void;
25
+ };
26
+ export {};
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+
7
+ const useScrollbar = (props, {
8
+ mainTableRef,
9
+ leftTableRef,
10
+ rightTableRef,
11
+ onMaybeEndReached
12
+ }) => {
13
+ const scrollPos = vue.ref({ scrollLeft: 0, scrollTop: 0 });
14
+ function doScroll(params) {
15
+ var _a, _b, _c;
16
+ const { scrollTop } = params;
17
+ (_a = mainTableRef.value) == null ? void 0 : _a.scrollTo(params);
18
+ (_b = leftTableRef.value) == null ? void 0 : _b.scrollToTop(scrollTop);
19
+ (_c = rightTableRef.value) == null ? void 0 : _c.scrollToTop(scrollTop);
20
+ }
21
+ function scrollTo(params) {
22
+ scrollPos.value = params;
23
+ doScroll(params);
24
+ }
25
+ function scrollToTop(scrollTop) {
26
+ scrollPos.value.scrollTop = scrollTop;
27
+ doScroll(vue.unref(scrollPos));
28
+ }
29
+ function scrollToLeft(scrollLeft) {
30
+ var _a, _b;
31
+ scrollPos.value.scrollLeft = scrollLeft;
32
+ (_b = (_a = mainTableRef.value) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, vue.unref(scrollPos));
33
+ }
34
+ function onScroll(params) {
35
+ var _a;
36
+ scrollTo(params);
37
+ (_a = props.onScroll) == null ? void 0 : _a.call(props, params);
38
+ }
39
+ function onVerticalScroll({ scrollTop }) {
40
+ const { scrollTop: currentScrollTop } = vue.unref(scrollPos);
41
+ if (scrollTop !== currentScrollTop)
42
+ scrollToTop(scrollTop);
43
+ }
44
+ vue.watch(() => vue.unref(scrollPos).scrollTop, (cur, prev) => {
45
+ if (cur > prev)
46
+ onMaybeEndReached();
47
+ });
48
+ return {
49
+ scrollPos,
50
+ scrollTo,
51
+ scrollToLeft,
52
+ scrollToTop,
53
+ onScroll,
54
+ onVerticalScroll
55
+ };
56
+ };
57
+
58
+ exports.useScrollbar = useScrollbar;
59
+ //# sourceMappingURL=use-scrollbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-scrollbar.js","sources":["../../../../../../../packages/components/table-v2/src/composables/use-scrollbar.ts"],"sourcesContent":["import { ref, unref, watch } from 'vue'\n\nimport type { Ref } from 'vue'\nimport type { TableV2Props } from '../table'\nimport type { TableGridInstance } from '../table-grid'\n\nexport type ScrollPos = { scrollLeft: number; scrollTop: number }\ntype GridInstanceRef = Ref<TableGridInstance | undefined>\n\ntype UseScrollBarProps = {\n mainTableRef: GridInstanceRef\n leftTableRef: GridInstanceRef\n rightTableRef: GridInstanceRef\n\n onMaybeEndReached: () => void\n}\n\nexport const useScrollbar = (\n props: TableV2Props,\n {\n mainTableRef,\n leftTableRef,\n rightTableRef,\n onMaybeEndReached,\n }: UseScrollBarProps\n) => {\n const scrollPos = ref<ScrollPos>({ scrollLeft: 0, scrollTop: 0 })\n\n function doScroll(params: ScrollPos) {\n const { scrollTop } = params\n\n mainTableRef.value?.scrollTo(params)\n leftTableRef.value?.scrollToTop(scrollTop)\n rightTableRef.value?.scrollToTop(scrollTop)\n }\n\n // methods\n function scrollTo(params: ScrollPos) {\n scrollPos.value = params\n\n doScroll(params)\n }\n\n function scrollToTop(scrollTop: number) {\n scrollPos.value.scrollTop = scrollTop\n\n doScroll(unref(scrollPos))\n }\n\n function scrollToLeft(scrollLeft: number) {\n scrollPos.value.scrollLeft = scrollLeft\n\n mainTableRef.value?.scrollTo?.(unref(scrollPos))\n }\n\n function onScroll(params: ScrollPos) {\n scrollTo(params)\n props.onScroll?.(params)\n }\n\n function onVerticalScroll({ scrollTop }: ScrollPos) {\n const { scrollTop: currentScrollTop } = unref(scrollPos)\n if (scrollTop !== currentScrollTop) scrollToTop(scrollTop)\n }\n\n // When scrollTop changes, maybe reaching the bottom\n watch(\n () => unref(scrollPos).scrollTop,\n (cur, prev) => {\n if (cur > prev) onMaybeEndReached()\n }\n )\n\n return {\n scrollPos,\n\n scrollTo,\n scrollToLeft,\n scrollToTop,\n onScroll,\n onVerticalScroll,\n }\n}\n"],"names":["ref","unref","watch"],"mappings":";;;;;;A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,GAAG,UAAU,CAAC;AAC5C,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,YAAY,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,EAAEA,SAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AACrH,GAAG;AACH,EAAE,SAAS,QAAQ,CAAC,MAAM,EAAE;AAC5B,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;AACrB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,QAAQ,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACpE,GAAG;AACH,EAAE,SAAS,gBAAgB,CAAC,EAAE,SAAS,EAAE,EAAE;AAC3C,IAAI,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,GAAGA,SAAK,CAAC,SAAS,CAAC,CAAC;AAC7D,IAAI,IAAI,SAAS,KAAK,gBAAgB;AACtC,MAAM,WAAW,CAAC,SAAS,CAAC,CAAC;AAC7B,GAAG;AACH,EAAEC,SAAK,CAAC,MAAMD,SAAK,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK;AACzD,IAAI,IAAI,GAAG,GAAG,IAAI;AAClB,MAAM,iBAAiB,EAAE,CAAC;AAC1B,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,SAAS;AACb,IAAI,QAAQ;AACZ,IAAI,YAAY;AAChB,IAAI,WAAW;AACf,IAAI,QAAQ;AACZ,IAAI,gBAAgB;AACpB,GAAG,CAAC;AACJ;;;;"}
@@ -0,0 +1,25 @@
1
+ import type { CSSProperties } from 'vue';
2
+ import type { TableV2Props } from '../table';
3
+ import type { UseColumnsReturn } from './use-columns';
4
+ import type { UseDataReturn } from './use-data';
5
+ declare type UseStyleProps = {
6
+ columnsTotalWidth: UseColumnsReturn['columnsTotalWidth'];
7
+ data: UseDataReturn['data'];
8
+ fixedColumnsOnLeft: UseColumnsReturn['fixedColumnsOnLeft'];
9
+ fixedColumnsOnRight: UseColumnsReturn['fixedColumnsOnRight'];
10
+ };
11
+ export declare const useStyles: (props: TableV2Props, { columnsTotalWidth, data, fixedColumnsOnLeft, fixedColumnsOnRight, }: UseStyleProps) => {
12
+ bodyWidth: import("vue").ComputedRef<number>;
13
+ fixedTableHeight: import("vue").ComputedRef<number>;
14
+ mainTableHeight: import("vue").ComputedRef<number>;
15
+ leftTableWidth: import("vue").ComputedRef<number>;
16
+ rightTableWidth: import("vue").ComputedRef<number>;
17
+ headerWidth: import("vue").ComputedRef<number>;
18
+ rowsHeight: import("vue").ComputedRef<number>;
19
+ windowHeight: import("vue").ComputedRef<number>;
20
+ footerHeight: import("vue").ComputedRef<CSSProperties>;
21
+ emptyStyle: import("vue").ComputedRef<CSSProperties>;
22
+ rootStyle: import("vue").ComputedRef<CSSProperties>;
23
+ };
24
+ export declare type UseStyleReturn = ReturnType<typeof useStyles>;
25
+ export {};
@@ -0,0 +1,91 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ require('../../../../utils/index.js');
7
+ var utils = require('../utils.js');
8
+ var core = require('@vueuse/core');
9
+ var style = require('../../../../utils/dom/style.js');
10
+
11
+ const useStyles = (props, {
12
+ columnsTotalWidth,
13
+ data,
14
+ fixedColumnsOnLeft,
15
+ fixedColumnsOnRight
16
+ }) => {
17
+ const bodyWidth = vue.computed(() => {
18
+ const { fixed, width, vScrollbarSize } = props;
19
+ const ret = width - vScrollbarSize;
20
+ return fixed ? Math.max(Math.round(vue.unref(columnsTotalWidth)), ret) : ret;
21
+ });
22
+ const headerWidth = vue.computed(() => vue.unref(bodyWidth) + (props.fixed ? props.vScrollbarSize : 0));
23
+ const mainTableHeight = vue.computed(() => {
24
+ const { height = 0, maxHeight = 0, footerHeight: footerHeight2, hScrollbarSize } = props;
25
+ if (maxHeight > 0) {
26
+ const _fixedRowsHeight = vue.unref(fixedRowsHeight);
27
+ const _rowsHeight = vue.unref(rowsHeight);
28
+ const _headerHeight = vue.unref(headerHeight);
29
+ const total = _headerHeight + _fixedRowsHeight + _rowsHeight + hScrollbarSize;
30
+ return Math.min(total, maxHeight - footerHeight2);
31
+ }
32
+ return height - footerHeight2;
33
+ });
34
+ const rowsHeight = vue.computed(() => {
35
+ const { rowHeight, estimatedRowHeight } = props;
36
+ const _data = vue.unref(data);
37
+ if (core.isNumber(estimatedRowHeight)) {
38
+ return _data.length * estimatedRowHeight;
39
+ }
40
+ return _data.length * rowHeight;
41
+ });
42
+ const fixedTableHeight = vue.computed(() => {
43
+ const { maxHeight } = props;
44
+ const tableHeight = vue.unref(mainTableHeight);
45
+ if (core.isNumber(maxHeight) && maxHeight > 0)
46
+ return tableHeight;
47
+ const totalHeight = vue.unref(rowsHeight) + vue.unref(headerHeight) + vue.unref(fixedRowsHeight);
48
+ return Math.min(tableHeight, totalHeight);
49
+ });
50
+ const mapColumn = (column) => column.width;
51
+ const leftTableWidth = vue.computed(() => utils.sum(vue.unref(fixedColumnsOnLeft).map(mapColumn)));
52
+ const rightTableWidth = vue.computed(() => utils.sum(vue.unref(fixedColumnsOnRight).map(mapColumn)));
53
+ const headerHeight = vue.computed(() => utils.sum(props.headerHeight));
54
+ const fixedRowsHeight = vue.computed(() => {
55
+ var _a;
56
+ return (((_a = props.fixedData) == null ? void 0 : _a.length) || 0) * props.rowHeight;
57
+ });
58
+ const windowHeight = vue.computed(() => {
59
+ return vue.unref(mainTableHeight) - vue.unref(headerHeight) - vue.unref(fixedRowsHeight);
60
+ });
61
+ const rootStyle = vue.computed(() => {
62
+ const { style = {}, height, width } = props;
63
+ return utils.enforceUnit({
64
+ ...style,
65
+ height,
66
+ width
67
+ });
68
+ });
69
+ const footerHeight = vue.computed(() => utils.enforceUnit({ height: props.footerHeight }));
70
+ const emptyStyle = vue.computed(() => ({
71
+ top: style.addUnit(vue.unref(headerHeight)),
72
+ bottom: style.addUnit(props.footerHeight),
73
+ width: style.addUnit(props.width)
74
+ }));
75
+ return {
76
+ bodyWidth,
77
+ fixedTableHeight,
78
+ mainTableHeight,
79
+ leftTableWidth,
80
+ rightTableWidth,
81
+ headerWidth,
82
+ rowsHeight,
83
+ windowHeight,
84
+ footerHeight,
85
+ emptyStyle,
86
+ rootStyle
87
+ };
88
+ };
89
+
90
+ exports.useStyles = useStyles;
91
+ //# sourceMappingURL=use-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-styles.js","sources":["../../../../../../../packages/components/table-v2/src/composables/use-styles.ts"],"sourcesContent":["import { computed, unref } from 'vue'\nimport { addUnit, isNumber } from '@element-plus/utils'\nimport { enforceUnit, sum } from '../utils'\n\nimport type { CSSProperties } from 'vue'\nimport type { TableV2Props } from '../table'\nimport type { UseColumnsReturn } from './use-columns'\nimport type { UseDataReturn } from './use-data'\n\ntype UseStyleProps = {\n columnsTotalWidth: UseColumnsReturn['columnsTotalWidth']\n data: UseDataReturn['data']\n fixedColumnsOnLeft: UseColumnsReturn['fixedColumnsOnLeft']\n fixedColumnsOnRight: UseColumnsReturn['fixedColumnsOnRight']\n}\n\nexport const useStyles = (\n props: TableV2Props,\n {\n columnsTotalWidth,\n data,\n fixedColumnsOnLeft,\n fixedColumnsOnRight,\n }: UseStyleProps\n) => {\n const bodyWidth = computed(() => {\n const { fixed, width, vScrollbarSize } = props\n const ret = width - vScrollbarSize\n return fixed ? Math.max(Math.round(unref(columnsTotalWidth)), ret) : ret\n })\n\n const headerWidth = computed(\n () => unref(bodyWidth) + (props.fixed ? props.vScrollbarSize : 0)\n )\n\n const mainTableHeight = computed(() => {\n const { height = 0, maxHeight = 0, footerHeight, hScrollbarSize } = props\n\n if (maxHeight > 0) {\n const _fixedRowsHeight = unref(fixedRowsHeight)\n const _rowsHeight = unref(rowsHeight)\n const _headerHeight = unref(headerHeight)\n const total =\n _headerHeight + _fixedRowsHeight + _rowsHeight + hScrollbarSize\n\n return Math.min(total, maxHeight - footerHeight)\n }\n\n return height - footerHeight\n })\n\n const rowsHeight = computed(() => {\n const { rowHeight, estimatedRowHeight } = props\n const _data = unref(data)\n if (isNumber(estimatedRowHeight)) {\n return _data.length * estimatedRowHeight\n }\n\n return _data.length * rowHeight\n })\n\n const fixedTableHeight = computed(() => {\n const { maxHeight } = props\n const tableHeight = unref(mainTableHeight)\n if (isNumber(maxHeight) && maxHeight > 0) return tableHeight\n\n const totalHeight =\n unref(rowsHeight) + unref(headerHeight) + unref(fixedRowsHeight)\n\n return Math.min(tableHeight, totalHeight)\n })\n\n const mapColumn = (column: TableV2Props['columns'][number]) => column.width\n\n const leftTableWidth = computed(() =>\n sum(unref(fixedColumnsOnLeft).map(mapColumn))\n )\n\n const rightTableWidth = computed(() =>\n sum(unref(fixedColumnsOnRight).map(mapColumn))\n )\n\n const headerHeight = computed(() => sum(props.headerHeight))\n\n const fixedRowsHeight = computed(() => {\n return (props.fixedData?.length || 0) * props.rowHeight\n })\n\n const windowHeight = computed(() => {\n return unref(mainTableHeight) - unref(headerHeight) - unref(fixedRowsHeight)\n })\n\n const rootStyle = computed<CSSProperties>(() => {\n const { style = {}, height, width } = props\n return enforceUnit({\n ...style,\n height,\n width,\n })\n })\n\n const footerHeight = computed(() =>\n enforceUnit({ height: props.footerHeight })\n )\n\n const emptyStyle = computed<CSSProperties>(() => ({\n top: addUnit(unref(headerHeight)),\n bottom: addUnit(props.footerHeight),\n width: addUnit(props.width),\n }))\n\n return {\n bodyWidth,\n fixedTableHeight,\n mainTableHeight,\n leftTableWidth,\n rightTableWidth,\n headerWidth,\n rowsHeight,\n windowHeight,\n footerHeight,\n emptyStyle,\n rootStyle,\n }\n}\n\nexport type UseStyleReturn = ReturnType<typeof useStyles>\n"],"names":["computed","unref","isNumber","sum","enforceUnit","addUnit"],"mappings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CAAC,KAAK,CAAC,KAAK,CAAC;AAC/B,GAAG,CAAC,CAAC,CAAC;AACN,EAAE,OAAO;AACT,IAAI,SAAS;AACb,IAAI,gBAAgB;AACpB,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,WAAW;AACf,IAAI,UAAU;AACd,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,IAAI,UAAU;AACd,IAAI,SAAS;AACb,GAAG,CAAC;AACJ;;;;"}
@@ -0,0 +1,3 @@
1
+ import type { CSSProperties } from 'vue';
2
+ import type { AnyColumns } from '../types';
3
+ export declare const calcColumnStyle: (column: AnyColumns[number], fixedColumn: boolean) => CSSProperties;
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const calcColumnStyle = (column, fixedColumn) => {
6
+ var _a;
7
+ const flex = {
8
+ flexGrow: 0,
9
+ flexShrink: 0
10
+ };
11
+ if (column.fixed) {
12
+ flex.flexShrink = 1;
13
+ }
14
+ const style = {
15
+ ...(_a = column.style) != null ? _a : {},
16
+ ...flex,
17
+ flexBasis: "auto",
18
+ width: column.width
19
+ };
20
+ if (!fixedColumn) {
21
+ if (column.maxWidth)
22
+ style.maxWidth = column.maxWidth;
23
+ if (column.minWidth)
24
+ style.maxWidth = column.minWidth;
25
+ }
26
+ return style;
27
+ };
28
+
29
+ exports.calcColumnStyle = calcColumnStyle;
30
+ //# sourceMappingURL=utils.js.map