@element-plus/nightly 0.0.20250430 → 0.0.20250502

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 (630) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.full.js +37 -26
  3. package/dist/index.full.min.js +11 -11
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +11 -11
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +37 -26
  8. package/dist/locale/af.js +1 -1
  9. package/dist/locale/af.min.js +1 -1
  10. package/dist/locale/af.min.mjs +1 -1
  11. package/dist/locale/af.mjs +1 -1
  12. package/dist/locale/ar-eg.js +1 -1
  13. package/dist/locale/ar-eg.min.js +1 -1
  14. package/dist/locale/ar-eg.min.mjs +1 -1
  15. package/dist/locale/ar-eg.mjs +1 -1
  16. package/dist/locale/ar.js +1 -1
  17. package/dist/locale/ar.min.js +1 -1
  18. package/dist/locale/ar.min.mjs +1 -1
  19. package/dist/locale/ar.mjs +1 -1
  20. package/dist/locale/az.js +1 -1
  21. package/dist/locale/az.min.js +1 -1
  22. package/dist/locale/az.min.mjs +1 -1
  23. package/dist/locale/az.mjs +1 -1
  24. package/dist/locale/bg.js +1 -1
  25. package/dist/locale/bg.min.js +1 -1
  26. package/dist/locale/bg.min.mjs +1 -1
  27. package/dist/locale/bg.mjs +1 -1
  28. package/dist/locale/bn.js +1 -1
  29. package/dist/locale/bn.min.js +1 -1
  30. package/dist/locale/bn.min.mjs +1 -1
  31. package/dist/locale/bn.mjs +1 -1
  32. package/dist/locale/ca.js +1 -1
  33. package/dist/locale/ca.min.js +1 -1
  34. package/dist/locale/ca.min.mjs +1 -1
  35. package/dist/locale/ca.mjs +1 -1
  36. package/dist/locale/ckb.js +1 -1
  37. package/dist/locale/ckb.min.js +1 -1
  38. package/dist/locale/ckb.min.mjs +1 -1
  39. package/dist/locale/ckb.mjs +1 -1
  40. package/dist/locale/cs.js +1 -1
  41. package/dist/locale/cs.min.js +1 -1
  42. package/dist/locale/cs.min.mjs +1 -1
  43. package/dist/locale/cs.mjs +1 -1
  44. package/dist/locale/da.js +1 -1
  45. package/dist/locale/da.min.js +1 -1
  46. package/dist/locale/da.min.mjs +1 -1
  47. package/dist/locale/da.mjs +1 -1
  48. package/dist/locale/de.js +1 -1
  49. package/dist/locale/de.min.js +1 -1
  50. package/dist/locale/de.min.mjs +1 -1
  51. package/dist/locale/de.mjs +1 -1
  52. package/dist/locale/el.js +1 -1
  53. package/dist/locale/el.min.js +1 -1
  54. package/dist/locale/el.min.mjs +1 -1
  55. package/dist/locale/el.mjs +1 -1
  56. package/dist/locale/en.js +1 -1
  57. package/dist/locale/en.min.js +1 -1
  58. package/dist/locale/en.min.mjs +1 -1
  59. package/dist/locale/en.mjs +1 -1
  60. package/dist/locale/eo.js +1 -1
  61. package/dist/locale/eo.min.js +1 -1
  62. package/dist/locale/eo.min.mjs +1 -1
  63. package/dist/locale/eo.mjs +1 -1
  64. package/dist/locale/es.js +1 -1
  65. package/dist/locale/es.min.js +1 -1
  66. package/dist/locale/es.min.mjs +1 -1
  67. package/dist/locale/es.mjs +1 -1
  68. package/dist/locale/et.js +1 -1
  69. package/dist/locale/et.min.js +1 -1
  70. package/dist/locale/et.min.mjs +1 -1
  71. package/dist/locale/et.mjs +1 -1
  72. package/dist/locale/eu.js +1 -1
  73. package/dist/locale/eu.min.js +1 -1
  74. package/dist/locale/eu.min.mjs +1 -1
  75. package/dist/locale/eu.mjs +1 -1
  76. package/dist/locale/fa.js +1 -1
  77. package/dist/locale/fa.min.js +1 -1
  78. package/dist/locale/fa.min.mjs +1 -1
  79. package/dist/locale/fa.mjs +1 -1
  80. package/dist/locale/fi.js +1 -1
  81. package/dist/locale/fi.min.js +1 -1
  82. package/dist/locale/fi.min.mjs +1 -1
  83. package/dist/locale/fi.mjs +1 -1
  84. package/dist/locale/fr.js +1 -1
  85. package/dist/locale/fr.min.js +1 -1
  86. package/dist/locale/fr.min.mjs +1 -1
  87. package/dist/locale/fr.mjs +1 -1
  88. package/dist/locale/he.js +1 -1
  89. package/dist/locale/he.min.js +1 -1
  90. package/dist/locale/he.min.mjs +1 -1
  91. package/dist/locale/he.mjs +1 -1
  92. package/dist/locale/hi.js +1 -1
  93. package/dist/locale/hi.min.js +1 -1
  94. package/dist/locale/hi.min.mjs +1 -1
  95. package/dist/locale/hi.mjs +1 -1
  96. package/dist/locale/hr.js +1 -1
  97. package/dist/locale/hr.min.js +1 -1
  98. package/dist/locale/hr.min.mjs +1 -1
  99. package/dist/locale/hr.mjs +1 -1
  100. package/dist/locale/hu.js +1 -1
  101. package/dist/locale/hu.min.js +1 -1
  102. package/dist/locale/hu.min.mjs +1 -1
  103. package/dist/locale/hu.mjs +1 -1
  104. package/dist/locale/hy-am.js +1 -1
  105. package/dist/locale/hy-am.min.js +1 -1
  106. package/dist/locale/hy-am.min.mjs +1 -1
  107. package/dist/locale/hy-am.mjs +1 -1
  108. package/dist/locale/id.js +1 -1
  109. package/dist/locale/id.min.js +1 -1
  110. package/dist/locale/id.min.mjs +1 -1
  111. package/dist/locale/id.mjs +1 -1
  112. package/dist/locale/it.js +1 -1
  113. package/dist/locale/it.min.js +1 -1
  114. package/dist/locale/it.min.mjs +1 -1
  115. package/dist/locale/it.mjs +1 -1
  116. package/dist/locale/ja.js +1 -1
  117. package/dist/locale/ja.min.js +1 -1
  118. package/dist/locale/ja.min.mjs +1 -1
  119. package/dist/locale/ja.mjs +1 -1
  120. package/dist/locale/kk.js +1 -1
  121. package/dist/locale/kk.min.js +1 -1
  122. package/dist/locale/kk.min.mjs +1 -1
  123. package/dist/locale/kk.mjs +1 -1
  124. package/dist/locale/km.js +1 -1
  125. package/dist/locale/km.min.js +1 -1
  126. package/dist/locale/km.min.mjs +1 -1
  127. package/dist/locale/km.mjs +1 -1
  128. package/dist/locale/ko.js +1 -1
  129. package/dist/locale/ko.min.js +1 -1
  130. package/dist/locale/ko.min.mjs +1 -1
  131. package/dist/locale/ko.mjs +1 -1
  132. package/dist/locale/ku.js +1 -1
  133. package/dist/locale/ku.min.js +1 -1
  134. package/dist/locale/ku.min.mjs +1 -1
  135. package/dist/locale/ku.mjs +1 -1
  136. package/dist/locale/ky.js +1 -1
  137. package/dist/locale/ky.min.js +1 -1
  138. package/dist/locale/ky.min.mjs +1 -1
  139. package/dist/locale/ky.mjs +1 -1
  140. package/dist/locale/lo.js +1 -1
  141. package/dist/locale/lo.min.js +1 -1
  142. package/dist/locale/lo.min.mjs +1 -1
  143. package/dist/locale/lo.mjs +1 -1
  144. package/dist/locale/lt.js +1 -1
  145. package/dist/locale/lt.min.js +1 -1
  146. package/dist/locale/lt.min.mjs +1 -1
  147. package/dist/locale/lt.mjs +1 -1
  148. package/dist/locale/lv.js +1 -1
  149. package/dist/locale/lv.min.js +1 -1
  150. package/dist/locale/lv.min.mjs +1 -1
  151. package/dist/locale/lv.mjs +1 -1
  152. package/dist/locale/mg.js +1 -1
  153. package/dist/locale/mg.min.js +1 -1
  154. package/dist/locale/mg.min.mjs +1 -1
  155. package/dist/locale/mg.mjs +1 -1
  156. package/dist/locale/mn.js +1 -1
  157. package/dist/locale/mn.min.js +1 -1
  158. package/dist/locale/mn.min.mjs +1 -1
  159. package/dist/locale/mn.mjs +1 -1
  160. package/dist/locale/ms.js +1 -1
  161. package/dist/locale/ms.min.js +1 -1
  162. package/dist/locale/ms.min.mjs +1 -1
  163. package/dist/locale/ms.mjs +1 -1
  164. package/dist/locale/my.js +1 -1
  165. package/dist/locale/my.min.js +1 -1
  166. package/dist/locale/my.min.mjs +1 -1
  167. package/dist/locale/my.mjs +1 -1
  168. package/dist/locale/nb-no.js +1 -1
  169. package/dist/locale/nb-no.min.js +1 -1
  170. package/dist/locale/nb-no.min.mjs +1 -1
  171. package/dist/locale/nb-no.mjs +1 -1
  172. package/dist/locale/nl.js +1 -1
  173. package/dist/locale/nl.min.js +1 -1
  174. package/dist/locale/nl.min.mjs +1 -1
  175. package/dist/locale/nl.mjs +1 -1
  176. package/dist/locale/no.js +1 -1
  177. package/dist/locale/no.min.js +1 -1
  178. package/dist/locale/no.min.mjs +1 -1
  179. package/dist/locale/no.mjs +1 -1
  180. package/dist/locale/pa.js +1 -1
  181. package/dist/locale/pa.min.js +1 -1
  182. package/dist/locale/pa.min.mjs +1 -1
  183. package/dist/locale/pa.mjs +1 -1
  184. package/dist/locale/pl.js +1 -1
  185. package/dist/locale/pl.min.js +1 -1
  186. package/dist/locale/pl.min.mjs +1 -1
  187. package/dist/locale/pl.mjs +1 -1
  188. package/dist/locale/pt-br.js +1 -1
  189. package/dist/locale/pt-br.min.js +1 -1
  190. package/dist/locale/pt-br.min.mjs +1 -1
  191. package/dist/locale/pt-br.mjs +1 -1
  192. package/dist/locale/pt.js +1 -1
  193. package/dist/locale/pt.min.js +1 -1
  194. package/dist/locale/pt.min.mjs +1 -1
  195. package/dist/locale/pt.mjs +1 -1
  196. package/dist/locale/ro.js +1 -1
  197. package/dist/locale/ro.min.js +1 -1
  198. package/dist/locale/ro.min.mjs +1 -1
  199. package/dist/locale/ro.mjs +1 -1
  200. package/dist/locale/ru.js +1 -1
  201. package/dist/locale/ru.min.js +1 -1
  202. package/dist/locale/ru.min.mjs +1 -1
  203. package/dist/locale/ru.mjs +1 -1
  204. package/dist/locale/sk.js +1 -1
  205. package/dist/locale/sk.min.js +1 -1
  206. package/dist/locale/sk.min.mjs +1 -1
  207. package/dist/locale/sk.mjs +1 -1
  208. package/dist/locale/sl.js +1 -1
  209. package/dist/locale/sl.min.js +1 -1
  210. package/dist/locale/sl.min.mjs +1 -1
  211. package/dist/locale/sl.mjs +1 -1
  212. package/dist/locale/sr.js +1 -1
  213. package/dist/locale/sr.min.js +1 -1
  214. package/dist/locale/sr.min.mjs +1 -1
  215. package/dist/locale/sr.mjs +1 -1
  216. package/dist/locale/sv.js +1 -1
  217. package/dist/locale/sv.min.js +1 -1
  218. package/dist/locale/sv.min.mjs +1 -1
  219. package/dist/locale/sv.mjs +1 -1
  220. package/dist/locale/sw.js +1 -1
  221. package/dist/locale/sw.min.js +1 -1
  222. package/dist/locale/sw.min.mjs +1 -1
  223. package/dist/locale/sw.mjs +1 -1
  224. package/dist/locale/ta.js +1 -1
  225. package/dist/locale/ta.min.js +1 -1
  226. package/dist/locale/ta.min.mjs +1 -1
  227. package/dist/locale/ta.mjs +1 -1
  228. package/dist/locale/te.js +1 -1
  229. package/dist/locale/te.min.js +1 -1
  230. package/dist/locale/te.min.mjs +1 -1
  231. package/dist/locale/te.mjs +1 -1
  232. package/dist/locale/th.js +1 -1
  233. package/dist/locale/th.min.js +1 -1
  234. package/dist/locale/th.min.mjs +1 -1
  235. package/dist/locale/th.mjs +1 -1
  236. package/dist/locale/tk.js +1 -1
  237. package/dist/locale/tk.min.js +1 -1
  238. package/dist/locale/tk.min.mjs +1 -1
  239. package/dist/locale/tk.mjs +1 -1
  240. package/dist/locale/tr.js +1 -1
  241. package/dist/locale/tr.min.js +1 -1
  242. package/dist/locale/tr.min.mjs +1 -1
  243. package/dist/locale/tr.mjs +1 -1
  244. package/dist/locale/ug-cn.js +1 -1
  245. package/dist/locale/ug-cn.min.js +1 -1
  246. package/dist/locale/ug-cn.min.mjs +1 -1
  247. package/dist/locale/ug-cn.mjs +1 -1
  248. package/dist/locale/uk.js +1 -1
  249. package/dist/locale/uk.min.js +1 -1
  250. package/dist/locale/uk.min.mjs +1 -1
  251. package/dist/locale/uk.mjs +1 -1
  252. package/dist/locale/uz-uz.js +1 -1
  253. package/dist/locale/uz-uz.min.js +1 -1
  254. package/dist/locale/uz-uz.min.mjs +1 -1
  255. package/dist/locale/uz-uz.mjs +1 -1
  256. package/dist/locale/vi.js +1 -1
  257. package/dist/locale/vi.min.js +1 -1
  258. package/dist/locale/vi.min.mjs +1 -1
  259. package/dist/locale/vi.mjs +1 -1
  260. package/dist/locale/zh-cn.js +1 -1
  261. package/dist/locale/zh-cn.min.js +1 -1
  262. package/dist/locale/zh-cn.min.mjs +1 -1
  263. package/dist/locale/zh-cn.mjs +1 -1
  264. package/dist/locale/zh-hk.js +1 -1
  265. package/dist/locale/zh-hk.min.js +1 -1
  266. package/dist/locale/zh-hk.min.mjs +1 -1
  267. package/dist/locale/zh-hk.mjs +1 -1
  268. package/dist/locale/zh-mo.js +1 -1
  269. package/dist/locale/zh-mo.min.js +1 -1
  270. package/dist/locale/zh-mo.min.mjs +1 -1
  271. package/dist/locale/zh-mo.mjs +1 -1
  272. package/dist/locale/zh-tw.js +1 -1
  273. package/dist/locale/zh-tw.min.js +1 -1
  274. package/dist/locale/zh-tw.min.mjs +1 -1
  275. package/dist/locale/zh-tw.mjs +1 -1
  276. package/es/components/affix/index.mjs +2 -2
  277. package/es/components/affix/src/affix.mjs +119 -24
  278. package/es/components/affix/src/affix.mjs.map +1 -1
  279. package/es/components/affix/src/affix2.mjs +24 -119
  280. package/es/components/affix/src/affix2.mjs.map +1 -1
  281. package/es/components/anchor/index.mjs +3 -3
  282. package/es/components/anchor/src/anchor-link.mjs +81 -5
  283. package/es/components/anchor/src/anchor-link.mjs.map +1 -1
  284. package/es/components/anchor/src/anchor-link2.mjs +5 -81
  285. package/es/components/anchor/src/anchor-link2.mjs.map +1 -1
  286. package/es/components/anchor/src/anchor.mjs +193 -42
  287. package/es/components/anchor/src/anchor.mjs.map +1 -1
  288. package/es/components/anchor/src/anchor2.mjs +42 -193
  289. package/es/components/anchor/src/anchor2.mjs.map +1 -1
  290. package/es/components/autocomplete/src/autocomplete.mjs +1 -1
  291. package/es/components/breadcrumb/index.mjs +2 -2
  292. package/es/components/breadcrumb/src/breadcrumb.mjs +37 -10
  293. package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
  294. package/es/components/breadcrumb/src/breadcrumb2.mjs +10 -37
  295. package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
  296. package/es/components/carousel/index.mjs +2 -2
  297. package/es/components/carousel/src/carousel-item.mjs +69 -7
  298. package/es/components/carousel/src/carousel-item.mjs.map +1 -1
  299. package/es/components/carousel/src/carousel-item2.mjs +7 -69
  300. package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
  301. package/es/components/cascader/src/cascader.mjs +1 -1
  302. package/es/components/cascader-panel/src/index.mjs +1 -1
  303. package/es/components/cascader-panel/src/menu.mjs +1 -1
  304. package/es/components/cascader-panel/src/node.mjs +206 -115
  305. package/es/components/cascader-panel/src/node.mjs.map +1 -1
  306. package/es/components/cascader-panel/src/node2.mjs +115 -206
  307. package/es/components/cascader-panel/src/node2.mjs.map +1 -1
  308. package/es/components/cascader-panel/src/store.mjs +1 -1
  309. package/es/components/collapse/src/collapse-item.vue.d.ts +3 -1
  310. package/es/components/collapse/src/collapse-item2.mjs +1 -1
  311. package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
  312. package/es/components/color-picker/index.mjs +2 -2
  313. package/es/components/color-picker/src/color-picker.mjs +39 -401
  314. package/es/components/color-picker/src/color-picker.mjs.map +1 -1
  315. package/es/components/color-picker/src/color-picker2.mjs +401 -39
  316. package/es/components/color-picker/src/color-picker2.mjs.map +1 -1
  317. package/es/components/color-picker/src/components/predefine.mjs +1 -1
  318. package/es/components/date-picker/src/date-picker-com/panel-year-range.mjs +1 -1
  319. package/es/components/date-picker/src/date-picker-com/panel-year-range.mjs.map +1 -1
  320. package/es/components/descriptions/src/description2.mjs +1 -1
  321. package/es/components/descriptions/src/descriptions-row.mjs +63 -6
  322. package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
  323. package/es/components/descriptions/src/descriptions-row2.mjs +6 -63
  324. package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
  325. package/es/components/dialog/src/dialog-content.mjs +88 -29
  326. package/es/components/dialog/src/dialog-content.mjs.map +1 -1
  327. package/es/components/dialog/src/dialog-content2.mjs +29 -88
  328. package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
  329. package/es/components/dialog/src/dialog.mjs +1 -1
  330. package/es/components/dialog/src/dialog2.mjs +1 -1
  331. package/es/components/drawer/index.mjs +2 -2
  332. package/es/components/drawer/src/drawer.mjs +178 -26
  333. package/es/components/drawer/src/drawer.mjs.map +1 -1
  334. package/es/components/drawer/src/drawer2.mjs +26 -178
  335. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  336. package/es/components/dropdown/src/dropdown.mjs +1 -1
  337. package/es/components/empty/index.mjs +2 -2
  338. package/es/components/empty/src/empty.mjs +52 -11
  339. package/es/components/empty/src/empty.mjs.map +1 -1
  340. package/es/components/empty/src/empty2.mjs +11 -52
  341. package/es/components/empty/src/empty2.mjs.map +1 -1
  342. package/es/components/form/index.mjs +4 -4
  343. package/es/components/form/src/form-item.mjs +319 -47
  344. package/es/components/form/src/form-item.mjs.map +1 -1
  345. package/es/components/form/src/form-item2.mjs +47 -319
  346. package/es/components/form/src/form-item2.mjs.map +1 -1
  347. package/es/components/form/src/form.mjs +153 -53
  348. package/es/components/form/src/form.mjs.map +1 -1
  349. package/es/components/form/src/form.vue.d.ts +569 -2
  350. package/es/components/form/src/form2.mjs +53 -153
  351. package/es/components/form/src/form2.mjs.map +1 -1
  352. package/es/components/index.mjs +17 -17
  353. package/es/components/link/index.mjs +2 -2
  354. package/es/components/link/src/link.mjs +65 -25
  355. package/es/components/link/src/link.mjs.map +1 -1
  356. package/es/components/link/src/link2.mjs +25 -65
  357. package/es/components/link/src/link2.mjs.map +1 -1
  358. package/es/components/menu/index.mjs +2 -2
  359. package/es/components/menu/src/menu-item-group.mjs +33 -4
  360. package/es/components/menu/src/menu-item-group.mjs.map +1 -1
  361. package/es/components/menu/src/menu-item-group2.mjs +4 -33
  362. package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
  363. package/es/components/message/index.mjs +1 -1
  364. package/es/components/message/src/message.mjs +86 -153
  365. package/es/components/message/src/message.mjs.map +1 -1
  366. package/es/components/message/src/message2.mjs +153 -86
  367. package/es/components/message/src/message2.mjs.map +1 -1
  368. package/es/components/message/src/method.mjs +2 -2
  369. package/es/components/pagination/src/components/pager.mjs +16 -210
  370. package/es/components/pagination/src/components/pager.mjs.map +1 -1
  371. package/es/components/pagination/src/components/pager2.mjs +210 -16
  372. package/es/components/pagination/src/components/pager2.mjs.map +1 -1
  373. package/es/components/pagination/src/pagination.mjs +1 -1
  374. package/es/components/popconfirm/src/popconfirm.mjs +1 -1
  375. package/es/components/popover/src/popover.d.ts +6 -0
  376. package/es/components/popover/src/popover.mjs +2 -1
  377. package/es/components/popover/src/popover.mjs.map +1 -1
  378. package/es/components/popover/src/popover.vue.d.ts +12 -0
  379. package/es/components/popover/src/popover2.mjs +2 -1
  380. package/es/components/popover/src/popover2.mjs.map +1 -1
  381. package/es/components/progress/src/progress.vue.d.ts +1 -1
  382. package/es/components/select/src/select.mjs +1 -1
  383. package/es/components/select/src/useSelect.mjs +1 -1
  384. package/es/components/select/src/useSelect.mjs.map +1 -1
  385. package/es/components/select-v2/src/defaults.mjs +1 -1
  386. package/es/components/select-v2/src/useSelect.mjs +1 -1
  387. package/es/components/select-v2/src/useSelect.mjs.map +1 -1
  388. package/es/components/slider/src/button.mjs +19 -91
  389. package/es/components/slider/src/button.mjs.map +1 -1
  390. package/es/components/slider/src/button2.mjs +91 -19
  391. package/es/components/slider/src/button2.mjs.map +1 -1
  392. package/es/components/slider/src/slider2.mjs +1 -1
  393. package/es/components/steps/index.mjs +2 -2
  394. package/es/components/steps/src/steps.mjs +35 -38
  395. package/es/components/steps/src/steps.mjs.map +1 -1
  396. package/es/components/steps/src/steps2.mjs +38 -35
  397. package/es/components/steps/src/steps2.mjs.map +1 -1
  398. package/es/components/table/src/filter-panel.mjs +1 -1
  399. package/es/components/table/src/store/helper.d.ts +435 -1
  400. package/es/components/table/src/store/index.d.ts +872 -2
  401. package/es/components/table/src/store/tree.d.ts +19 -1
  402. package/es/components/table/src/store/tree.mjs +7 -4
  403. package/es/components/table/src/store/tree.mjs.map +1 -1
  404. package/es/components/table/src/store/watcher.d.ts +78 -1
  405. package/es/components/table/src/table/utils-helper.d.ts +1 -1
  406. package/es/components/table/src/table-footer/index.d.ts +1 -1
  407. package/es/components/table/src/table-footer/mapState-helper.d.ts +6 -6
  408. package/es/components/table/src/table-footer/mapState-helper.mjs +12 -6
  409. package/es/components/table/src/table-footer/mapState-helper.mjs.map +1 -1
  410. package/es/components/table/src/table-footer/style-helper.d.ts +1 -1
  411. package/es/components/table/src/table-header/utils-helper.d.ts +1 -1
  412. package/es/components/table/src/table.vue.d.ts +437 -3
  413. package/es/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +1 -1
  414. package/es/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +1 -1
  415. package/es/components/time-select/index.mjs +2 -2
  416. package/es/components/time-select/src/time-select.mjs +54 -132
  417. package/es/components/time-select/src/time-select.mjs.map +1 -1
  418. package/es/components/time-select/src/time-select.vue.d.ts +1 -1
  419. package/es/components/time-select/src/time-select2.mjs +132 -54
  420. package/es/components/time-select/src/time-select2.mjs.map +1 -1
  421. package/es/components/tooltip/index.mjs +1 -1
  422. package/es/components/tooltip/src/content.mjs +193 -29
  423. package/es/components/tooltip/src/content.mjs.map +1 -1
  424. package/es/components/tooltip/src/content2.mjs +29 -193
  425. package/es/components/tooltip/src/content2.mjs.map +1 -1
  426. package/es/components/tooltip/src/tooltip.mjs +1 -1
  427. package/es/components/tooltip/src/tooltip2.mjs +1 -1
  428. package/es/components/tooltip-v2/index.mjs +1 -1
  429. package/es/components/tooltip-v2/src/tooltip.mjs +1 -1
  430. package/es/components/tooltip-v2/src/tooltip2.mjs +2 -2
  431. package/es/components/tooltip-v2/src/trigger.mjs +89 -12
  432. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  433. package/es/components/tooltip-v2/src/trigger2.mjs +12 -89
  434. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  435. package/es/components/tour/index.mjs +2 -2
  436. package/es/components/tour/src/step.mjs +44 -168
  437. package/es/components/tour/src/step.mjs.map +1 -1
  438. package/es/components/tour/src/step2.mjs +168 -44
  439. package/es/components/tour/src/step2.mjs.map +1 -1
  440. package/es/components/transfer/src/transfer.vue.d.ts +1 -1
  441. package/es/components/upload/src/upload-content.vue.d.ts +1 -1
  442. package/es/components/upload/src/upload.vue.d.ts +1 -1
  443. package/es/components/watermark/index.mjs +2 -2
  444. package/es/components/watermark/src/watermark.mjs +220 -27
  445. package/es/components/watermark/src/watermark.mjs.map +1 -1
  446. package/es/components/watermark/src/watermark2.mjs +27 -220
  447. package/es/components/watermark/src/watermark2.mjs.map +1 -1
  448. package/es/index.mjs +17 -17
  449. package/es/version.d.ts +1 -1
  450. package/es/version.mjs +1 -1
  451. package/es/version.mjs.map +1 -1
  452. package/lib/components/affix/index.js +2 -2
  453. package/lib/components/affix/src/affix.js +119 -25
  454. package/lib/components/affix/src/affix.js.map +1 -1
  455. package/lib/components/affix/src/affix2.js +25 -119
  456. package/lib/components/affix/src/affix2.js.map +1 -1
  457. package/lib/components/anchor/index.js +3 -3
  458. package/lib/components/anchor/src/anchor-link.js +81 -5
  459. package/lib/components/anchor/src/anchor-link.js.map +1 -1
  460. package/lib/components/anchor/src/anchor-link2.js +5 -81
  461. package/lib/components/anchor/src/anchor-link2.js.map +1 -1
  462. package/lib/components/anchor/src/anchor.js +192 -42
  463. package/lib/components/anchor/src/anchor.js.map +1 -1
  464. package/lib/components/anchor/src/anchor2.js +42 -192
  465. package/lib/components/anchor/src/anchor2.js.map +1 -1
  466. package/lib/components/autocomplete/src/autocomplete.js +1 -1
  467. package/lib/components/breadcrumb/index.js +2 -2
  468. package/lib/components/breadcrumb/src/breadcrumb.js +37 -10
  469. package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
  470. package/lib/components/breadcrumb/src/breadcrumb2.js +10 -37
  471. package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
  472. package/lib/components/carousel/index.js +2 -2
  473. package/lib/components/carousel/src/carousel-item.js +69 -7
  474. package/lib/components/carousel/src/carousel-item.js.map +1 -1
  475. package/lib/components/carousel/src/carousel-item2.js +7 -69
  476. package/lib/components/carousel/src/carousel-item2.js.map +1 -1
  477. package/lib/components/cascader/src/cascader.js +1 -1
  478. package/lib/components/cascader-panel/src/index.js +1 -1
  479. package/lib/components/cascader-panel/src/menu.js +1 -1
  480. package/lib/components/cascader-panel/src/node.js +206 -115
  481. package/lib/components/cascader-panel/src/node.js.map +1 -1
  482. package/lib/components/cascader-panel/src/node2.js +115 -206
  483. package/lib/components/cascader-panel/src/node2.js.map +1 -1
  484. package/lib/components/cascader-panel/src/store.js +1 -1
  485. package/lib/components/collapse/src/collapse-item.vue.d.ts +3 -1
  486. package/lib/components/collapse/src/collapse-item2.js +1 -1
  487. package/lib/components/collapse/src/collapse-item2.js.map +1 -1
  488. package/lib/components/color-picker/index.js +2 -2
  489. package/lib/components/color-picker/src/color-picker.js +40 -400
  490. package/lib/components/color-picker/src/color-picker.js.map +1 -1
  491. package/lib/components/color-picker/src/color-picker2.js +400 -40
  492. package/lib/components/color-picker/src/color-picker2.js.map +1 -1
  493. package/lib/components/color-picker/src/components/predefine.js +1 -1
  494. package/lib/components/date-picker/src/date-picker-com/panel-year-range.js +1 -1
  495. package/lib/components/date-picker/src/date-picker-com/panel-year-range.js.map +1 -1
  496. package/lib/components/descriptions/src/description2.js +1 -1
  497. package/lib/components/descriptions/src/descriptions-row.js +63 -6
  498. package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
  499. package/lib/components/descriptions/src/descriptions-row2.js +6 -63
  500. package/lib/components/descriptions/src/descriptions-row2.js.map +1 -1
  501. package/lib/components/dialog/src/dialog-content.js +87 -29
  502. package/lib/components/dialog/src/dialog-content.js.map +1 -1
  503. package/lib/components/dialog/src/dialog-content2.js +29 -87
  504. package/lib/components/dialog/src/dialog-content2.js.map +1 -1
  505. package/lib/components/dialog/src/dialog.js +1 -1
  506. package/lib/components/dialog/src/dialog2.js +1 -1
  507. package/lib/components/drawer/index.js +2 -2
  508. package/lib/components/drawer/src/drawer.js +178 -27
  509. package/lib/components/drawer/src/drawer.js.map +1 -1
  510. package/lib/components/drawer/src/drawer2.js +27 -178
  511. package/lib/components/drawer/src/drawer2.js.map +1 -1
  512. package/lib/components/dropdown/src/dropdown.js +1 -1
  513. package/lib/components/empty/index.js +2 -2
  514. package/lib/components/empty/src/empty.js +52 -11
  515. package/lib/components/empty/src/empty.js.map +1 -1
  516. package/lib/components/empty/src/empty2.js +11 -52
  517. package/lib/components/empty/src/empty2.js.map +1 -1
  518. package/lib/components/form/index.js +4 -4
  519. package/lib/components/form/src/form-item.js +323 -48
  520. package/lib/components/form/src/form-item.js.map +1 -1
  521. package/lib/components/form/src/form-item2.js +48 -323
  522. package/lib/components/form/src/form-item2.js.map +1 -1
  523. package/lib/components/form/src/form.js +152 -54
  524. package/lib/components/form/src/form.js.map +1 -1
  525. package/lib/components/form/src/form.vue.d.ts +569 -2
  526. package/lib/components/form/src/form2.js +54 -152
  527. package/lib/components/form/src/form2.js.map +1 -1
  528. package/lib/components/index.js +17 -17
  529. package/lib/components/link/index.js +2 -2
  530. package/lib/components/link/src/link.js +65 -26
  531. package/lib/components/link/src/link.js.map +1 -1
  532. package/lib/components/link/src/link2.js +26 -65
  533. package/lib/components/link/src/link2.js.map +1 -1
  534. package/lib/components/menu/index.js +2 -2
  535. package/lib/components/menu/src/menu-item-group.js +33 -4
  536. package/lib/components/menu/src/menu-item-group.js.map +1 -1
  537. package/lib/components/menu/src/menu-item-group2.js +4 -33
  538. package/lib/components/menu/src/menu-item-group2.js.map +1 -1
  539. package/lib/components/message/index.js +1 -1
  540. package/lib/components/message/src/message.js +88 -152
  541. package/lib/components/message/src/message.js.map +1 -1
  542. package/lib/components/message/src/message2.js +152 -88
  543. package/lib/components/message/src/message2.js.map +1 -1
  544. package/lib/components/message/src/method.js +2 -2
  545. package/lib/components/pagination/src/components/pager.js +16 -210
  546. package/lib/components/pagination/src/components/pager.js.map +1 -1
  547. package/lib/components/pagination/src/components/pager2.js +210 -16
  548. package/lib/components/pagination/src/components/pager2.js.map +1 -1
  549. package/lib/components/pagination/src/pagination.js +1 -1
  550. package/lib/components/popconfirm/src/popconfirm.js +1 -1
  551. package/lib/components/popover/src/popover.d.ts +6 -0
  552. package/lib/components/popover/src/popover.js +2 -1
  553. package/lib/components/popover/src/popover.js.map +1 -1
  554. package/lib/components/popover/src/popover.vue.d.ts +12 -0
  555. package/lib/components/popover/src/popover2.js +2 -1
  556. package/lib/components/popover/src/popover2.js.map +1 -1
  557. package/lib/components/progress/src/progress.vue.d.ts +1 -1
  558. package/lib/components/select/src/select.js +1 -1
  559. package/lib/components/select/src/useSelect.js +1 -1
  560. package/lib/components/select/src/useSelect.js.map +1 -1
  561. package/lib/components/select-v2/src/defaults.js +1 -1
  562. package/lib/components/select-v2/src/useSelect.js +1 -1
  563. package/lib/components/select-v2/src/useSelect.js.map +1 -1
  564. package/lib/components/slider/src/button.js +20 -91
  565. package/lib/components/slider/src/button.js.map +1 -1
  566. package/lib/components/slider/src/button2.js +91 -20
  567. package/lib/components/slider/src/button2.js.map +1 -1
  568. package/lib/components/slider/src/slider2.js +1 -1
  569. package/lib/components/steps/index.js +2 -2
  570. package/lib/components/steps/src/steps.js +36 -38
  571. package/lib/components/steps/src/steps.js.map +1 -1
  572. package/lib/components/steps/src/steps2.js +38 -36
  573. package/lib/components/steps/src/steps2.js.map +1 -1
  574. package/lib/components/table/src/filter-panel.js +1 -1
  575. package/lib/components/table/src/store/helper.d.ts +435 -1
  576. package/lib/components/table/src/store/index.d.ts +872 -2
  577. package/lib/components/table/src/store/tree.d.ts +19 -1
  578. package/lib/components/table/src/store/tree.js +7 -4
  579. package/lib/components/table/src/store/tree.js.map +1 -1
  580. package/lib/components/table/src/store/watcher.d.ts +78 -1
  581. package/lib/components/table/src/table/utils-helper.d.ts +1 -1
  582. package/lib/components/table/src/table-footer/index.d.ts +1 -1
  583. package/lib/components/table/src/table-footer/mapState-helper.d.ts +6 -6
  584. package/lib/components/table/src/table-footer/mapState-helper.js +12 -6
  585. package/lib/components/table/src/table-footer/mapState-helper.js.map +1 -1
  586. package/lib/components/table/src/table-footer/style-helper.d.ts +1 -1
  587. package/lib/components/table/src/table-header/utils-helper.d.ts +1 -1
  588. package/lib/components/table/src/table.vue.d.ts +437 -3
  589. package/lib/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +1 -1
  590. package/lib/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +1 -1
  591. package/lib/components/time-select/index.js +2 -2
  592. package/lib/components/time-select/src/time-select.js +54 -137
  593. package/lib/components/time-select/src/time-select.js.map +1 -1
  594. package/lib/components/time-select/src/time-select.vue.d.ts +1 -1
  595. package/lib/components/time-select/src/time-select2.js +137 -54
  596. package/lib/components/time-select/src/time-select2.js.map +1 -1
  597. package/lib/components/tooltip/index.js +1 -1
  598. package/lib/components/tooltip/src/content.js +193 -29
  599. package/lib/components/tooltip/src/content.js.map +1 -1
  600. package/lib/components/tooltip/src/content2.js +29 -193
  601. package/lib/components/tooltip/src/content2.js.map +1 -1
  602. package/lib/components/tooltip/src/tooltip.js +1 -1
  603. package/lib/components/tooltip/src/tooltip2.js +1 -1
  604. package/lib/components/tooltip-v2/index.js +1 -1
  605. package/lib/components/tooltip-v2/src/tooltip.js +1 -1
  606. package/lib/components/tooltip-v2/src/tooltip2.js +2 -2
  607. package/lib/components/tooltip-v2/src/trigger.js +89 -12
  608. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  609. package/lib/components/tooltip-v2/src/trigger2.js +12 -89
  610. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  611. package/lib/components/tour/index.js +2 -2
  612. package/lib/components/tour/src/step.js +44 -167
  613. package/lib/components/tour/src/step.js.map +1 -1
  614. package/lib/components/tour/src/step2.js +167 -44
  615. package/lib/components/tour/src/step2.js.map +1 -1
  616. package/lib/components/transfer/src/transfer.vue.d.ts +1 -1
  617. package/lib/components/upload/src/upload-content.vue.d.ts +1 -1
  618. package/lib/components/upload/src/upload.vue.d.ts +1 -1
  619. package/lib/components/watermark/index.js +2 -2
  620. package/lib/components/watermark/src/watermark.js +220 -27
  621. package/lib/components/watermark/src/watermark.js.map +1 -1
  622. package/lib/components/watermark/src/watermark2.js +27 -220
  623. package/lib/components/watermark/src/watermark2.js.map +1 -1
  624. package/lib/index.js +17 -17
  625. package/lib/version.d.ts +1 -1
  626. package/lib/version.js +1 -1
  627. package/lib/version.js.map +1 -1
  628. package/package.json +2 -2
  629. package/tags.json +1 -1
  630. package/web-types.json +1 -1
@@ -1,3 +1,21 @@
1
1
  import type { WatcherPropsData } from '.';
2
- declare function useTree<T>(watcherData: WatcherPropsData<T>): any;
2
+ declare function useTree<T>(watcherData: WatcherPropsData<T>): {
3
+ loadData: (row: T, key: string, treeNode: any) => void;
4
+ loadOrToggle: (row: any) => void;
5
+ toggleTreeExpansion: (row: T, expanded?: boolean) => void;
6
+ updateTreeExpandKeys: (value: string[]) => void;
7
+ updateTreeData: (ifChangeExpandRowKeys?: boolean) => void;
8
+ updateKeyChildren: (key: string, data: T[]) => void;
9
+ normalize: (data: any) => {};
10
+ states: {
11
+ expandRowKeys: import("vue").Ref<string[]>;
12
+ treeData: import("vue").Ref<unknown>;
13
+ indent: import("vue").Ref<number>;
14
+ lazy: import("vue").Ref<boolean>;
15
+ lazyTreeNodeMap: import("vue").Ref<{}>;
16
+ lazyColumnIdentifier: import("vue").Ref<string>;
17
+ childrenColumnName: import("vue").Ref<string>;
18
+ checkStrictly: import("vue").Ref<boolean>;
19
+ };
20
+ };
3
21
  export default useTree;
@@ -60,18 +60,21 @@ function useTree(watcherData) {
60
60
  }, childrenColumnName.value, lazyColumnIdentifier.value);
61
61
  return res;
62
62
  };
63
- const updateTreeData = (ifChangeExpandRowKeys = false, ifExpandAll = ((_a) => (_a = instance.store) == null ? void 0 : _a.states.defaultExpandAll.value)()) => {
64
- var _a2;
63
+ let isInitTree = true;
64
+ const updateTreeData = (ifChangeExpandRowKeys = false) => {
65
+ var _a, _b;
65
66
  const nested = normalizedData.value;
66
67
  const normalizedLazyNode_ = normalizedLazyNode.value;
67
68
  const keys = Object.keys(nested);
68
69
  const newTreeData = {};
70
+ const ifExpandAll = ((_a = instance.store) == null ? void 0 : _a.states.defaultExpandAll.value) && isInitTree;
71
+ isInitTree = false;
69
72
  if (keys.length) {
70
73
  const oldTreeData = unref(treeData);
71
74
  const rootLazyRowKeys = [];
72
75
  const getExpanded = (oldValue, key) => {
73
76
  if (ifChangeExpandRowKeys) {
74
- if (expandRowKeys.value) {
77
+ if (expandRowKeys.value.length) {
75
78
  return ifExpandAll || expandRowKeys.value.includes(key);
76
79
  } else {
77
80
  return !!(ifExpandAll || (oldValue == null ? void 0 : oldValue.expanded));
@@ -118,7 +121,7 @@ function useTree(watcherData) {
118
121
  }
119
122
  }
120
123
  treeData.value = newTreeData;
121
- (_a2 = instance.store) == null ? void 0 : _a2.updateTableScrollY();
124
+ (_b = instance.store) == null ? void 0 : _b.updateTableScrollY();
122
125
  };
123
126
  watch(() => expandRowKeys.value, () => {
124
127
  updateTreeData(true);
@@ -1 +1 @@
1
- {"version":3,"file":"tree.mjs","sources":["../../../../../../../packages/components/table/src/store/tree.ts"],"sourcesContent":["// @ts-nocheck\nimport { computed, getCurrentInstance, ref, unref, watch } from 'vue'\nimport { isArray, isUndefined } from '@element-plus/utils'\nimport { getRowIdentity, walkTreeNode } from '../util'\n\nimport type { WatcherPropsData } from '.'\nimport type { Table, TableProps } from '../table/defaults'\n\nfunction useTree<T>(watcherData: WatcherPropsData<T>) {\n const expandRowKeys = ref<string[]>([])\n const treeData = ref<unknown>({})\n const indent = ref(16)\n const lazy = ref(false)\n const lazyTreeNodeMap = ref({})\n const lazyColumnIdentifier = ref('hasChildren')\n const childrenColumnName = ref('children')\n const checkStrictly = ref(false)\n const instance = getCurrentInstance() as Table<T>\n const normalizedData = computed(() => {\n if (!watcherData.rowKey.value) return {}\n const data = watcherData.data.value || []\n return normalize(data)\n })\n const normalizedLazyNode = computed(() => {\n const rowKey = watcherData.rowKey.value\n const keys = Object.keys(lazyTreeNodeMap.value)\n const res = {}\n if (!keys.length) return res\n keys.forEach((key) => {\n if (lazyTreeNodeMap.value[key].length) {\n const item = { children: [] }\n lazyTreeNodeMap.value[key].forEach((row) => {\n const currentRowKey = getRowIdentity(row, rowKey)\n item.children.push(currentRowKey)\n if (row[lazyColumnIdentifier.value] && !res[currentRowKey]) {\n res[currentRowKey] = { children: [] }\n }\n })\n res[key] = item\n }\n })\n return res\n })\n\n const normalize = (data) => {\n const rowKey = watcherData.rowKey.value\n const res = {}\n walkTreeNode(\n data,\n (parent, children, level) => {\n const parentId = getRowIdentity(parent, rowKey)\n if (isArray(children)) {\n res[parentId] = {\n children: children.map((row) => getRowIdentity(row, rowKey)),\n level,\n }\n } else if (lazy.value) {\n // 当 children 不存在且 lazy 为 true,该节点即为懒加载的节点\n res[parentId] = {\n children: [],\n lazy: true,\n level,\n }\n }\n },\n childrenColumnName.value,\n lazyColumnIdentifier.value\n )\n return res\n }\n\n const updateTreeData = (\n ifChangeExpandRowKeys = false,\n ifExpandAll = instance.store?.states.defaultExpandAll.value\n ) => {\n const nested = normalizedData.value\n const normalizedLazyNode_ = normalizedLazyNode.value\n const keys = Object.keys(nested)\n const newTreeData = {}\n if (keys.length) {\n const oldTreeData = unref(treeData)\n const rootLazyRowKeys = []\n const getExpanded = (oldValue, key) => {\n if (ifChangeExpandRowKeys) {\n if (expandRowKeys.value) {\n return ifExpandAll || expandRowKeys.value.includes(key)\n } else {\n return !!(ifExpandAll || oldValue?.expanded)\n }\n } else {\n const included =\n ifExpandAll ||\n (expandRowKeys.value && expandRowKeys.value.includes(key))\n return !!(oldValue?.expanded || included)\n }\n }\n // 合并 expanded 与 display,确保数据刷新后,状态不变\n keys.forEach((key) => {\n const oldValue = oldTreeData[key]\n const newValue = { ...nested[key] }\n newValue.expanded = getExpanded(oldValue, key)\n if (newValue.lazy) {\n const { loaded = false, loading = false } = oldValue || {}\n newValue.loaded = !!loaded\n newValue.loading = !!loading\n rootLazyRowKeys.push(key)\n }\n newTreeData[key] = newValue\n })\n // 根据懒加载数据更新 treeData\n const lazyKeys = Object.keys(normalizedLazyNode_)\n if (lazy.value && lazyKeys.length && rootLazyRowKeys.length) {\n lazyKeys.forEach((key) => {\n const oldValue = oldTreeData[key]\n const lazyNodeChildren = normalizedLazyNode_[key].children\n if (rootLazyRowKeys.includes(key)) {\n // 懒加载的 root 节点,更新一下原有的数据,原来的 children 一定是空数组\n if (newTreeData[key].children.length !== 0) {\n throw new Error('[ElTable]children must be an empty array.')\n }\n newTreeData[key].children = lazyNodeChildren\n } else {\n const { loaded = false, loading = false } = oldValue || {}\n newTreeData[key] = {\n lazy: true,\n loaded: !!loaded,\n loading: !!loading,\n expanded: getExpanded(oldValue, key),\n children: lazyNodeChildren,\n level: '',\n }\n }\n })\n }\n }\n treeData.value = newTreeData\n instance.store?.updateTableScrollY()\n }\n\n watch(\n () => expandRowKeys.value,\n () => {\n updateTreeData(true)\n }\n )\n\n watch(\n () => normalizedData.value,\n () => {\n updateTreeData()\n }\n )\n watch(\n () => normalizedLazyNode.value,\n () => {\n updateTreeData()\n }\n )\n\n const updateTreeExpandKeys = (value: string[]) => {\n expandRowKeys.value = value\n updateTreeData()\n }\n const isUseLazy = (data): boolean => {\n return lazy.value && data && 'loaded' in data && !data.loaded\n }\n const toggleTreeExpansion = (row: T, expanded?: boolean) => {\n instance.store.assertRowKey()\n\n const rowKey = watcherData.rowKey.value\n const id = getRowIdentity(row, rowKey)\n const data = id && treeData.value[id]\n if (id && data && 'expanded' in data) {\n const oldExpanded = data.expanded\n expanded = isUndefined(expanded) ? !data.expanded : expanded\n treeData.value[id].expanded = expanded\n if (oldExpanded !== expanded) {\n instance.emit('expand-change', row, expanded)\n }\n isUseLazy(data) && loadData(row, id, data)\n instance.store.updateTableScrollY()\n }\n }\n\n const loadOrToggle = (row) => {\n instance.store.assertRowKey()\n const rowKey = watcherData.rowKey.value\n const id = getRowIdentity(row, rowKey)\n const data = treeData.value[id]\n if (isUseLazy(data)) {\n loadData(row, id, data)\n } else {\n toggleTreeExpansion(row, undefined)\n }\n }\n\n const loadData = (row: T, key: string, treeNode) => {\n const { load } = instance.props as unknown as TableProps<T>\n if (load && !treeData.value[key].loaded) {\n treeData.value[key].loading = true\n load(row, treeNode, (data) => {\n if (!isArray(data)) {\n throw new TypeError('[ElTable] data must be an array')\n }\n treeData.value[key].loading = false\n treeData.value[key].loaded = true\n treeData.value[key].expanded = true\n if (data.length) {\n lazyTreeNodeMap.value[key] = data\n }\n instance.emit('expand-change', row, true)\n })\n }\n }\n\n const updateKeyChildren = (key: string, data: T[]) => {\n const { lazy, rowKey } = instance.props as unknown as TableProps<T>\n if (!lazy) return\n if (!rowKey) throw new Error('[Table] rowKey is required in updateKeyChild')\n\n if (lazyTreeNodeMap.value[key]) {\n lazyTreeNodeMap.value[key] = data\n }\n }\n\n return {\n loadData,\n loadOrToggle,\n toggleTreeExpansion,\n updateTreeExpandKeys,\n updateTreeData,\n updateKeyChildren,\n normalize,\n states: {\n expandRowKeys,\n treeData,\n indent,\n lazy,\n lazyTreeNodeMap,\n lazyColumnIdentifier,\n childrenColumnName,\n checkStrictly,\n },\n }\n}\n\nexport default useTree\n"],"names":[],"mappings":";;;;;AAGA,SAAS,OAAO,CAAC,WAAW,EAAE;AAC9B,EAAE,MAAM,aAAa,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AAChC,EAAE,MAAM,QAAQ,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AAC3B,EAAE,MAAM,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AACzB,EAAE,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC;AAC1B,EAAE,MAAM,eAAe,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AAClC,EAAE,MAAM,oBAAoB,GAAG,GAAG,CAAC,aAAa,CAAC,CAAC;AAClD,EAAE,MAAM,kBAAkB,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC;AAC7C,EAAE,MAAM,aAAa,GAAG,GAAG,CAAC,KAAK,CAAC,CAA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AACzB,UAAU,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AAC5C,SAAS;AACT,QAAQ,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;AAClD,OAAO,CAAC,CAAC;AACT,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK;AAC3C,IAAI,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC;AACnD,IAAI,IAAI,CAAC,KAAK;AACd,MAAM,OAAO;AACb,IAAI,IAAI,CAAC,MAAM;AACf,MAAM,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;AACtE,IAAI,IAAI,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;AACpC,MAAM,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;AACxC,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,QAAQ;AACZ,IAAI,YAAY;AAChB,IAAI,mBAAmB;AACvB,IAAI,oBAAoB;AACxB,IAAI,cAAc;AAClB,IAAI,iBAAiB;AACrB,IAAI,SAAS;AACb,IAAI,MAAM,EAAE;AACZ,MAAM,aAAa;AACnB,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,IAAI;AACV,MAAM,eAAe;AACrB,MAAM,oBAAoB;AAC1B,MAAM,kBAAkB;AACxB,MAAM,aAAa;AACnB,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"tree.mjs","sources":["../../../../../../../packages/components/table/src/store/tree.ts"],"sourcesContent":["// @ts-nocheck\nimport { computed, getCurrentInstance, ref, unref, watch } from 'vue'\nimport { isArray, isUndefined } from '@element-plus/utils'\nimport { getRowIdentity, walkTreeNode } from '../util'\n\nimport type { WatcherPropsData } from '.'\nimport type { Table, TableProps } from '../table/defaults'\n\nfunction useTree<T>(watcherData: WatcherPropsData<T>) {\n const expandRowKeys = ref<string[]>([])\n const treeData = ref<unknown>({})\n const indent = ref(16)\n const lazy = ref(false)\n const lazyTreeNodeMap = ref({})\n const lazyColumnIdentifier = ref('hasChildren')\n const childrenColumnName = ref('children')\n const checkStrictly = ref(false)\n const instance = getCurrentInstance() as Table<T>\n const normalizedData = computed(() => {\n if (!watcherData.rowKey.value) return {}\n const data = watcherData.data.value || []\n return normalize(data)\n })\n const normalizedLazyNode = computed(() => {\n const rowKey = watcherData.rowKey.value\n const keys = Object.keys(lazyTreeNodeMap.value)\n const res = {}\n if (!keys.length) return res\n keys.forEach((key) => {\n if (lazyTreeNodeMap.value[key].length) {\n const item = { children: [] }\n lazyTreeNodeMap.value[key].forEach((row) => {\n const currentRowKey = getRowIdentity(row, rowKey)\n item.children.push(currentRowKey)\n if (row[lazyColumnIdentifier.value] && !res[currentRowKey]) {\n res[currentRowKey] = { children: [] }\n }\n })\n res[key] = item\n }\n })\n return res\n })\n\n const normalize = (data) => {\n const rowKey = watcherData.rowKey.value\n const res = {}\n walkTreeNode(\n data,\n (parent, children, level) => {\n const parentId = getRowIdentity(parent, rowKey)\n if (isArray(children)) {\n res[parentId] = {\n children: children.map((row) => getRowIdentity(row, rowKey)),\n level,\n }\n } else if (lazy.value) {\n // 当 children 不存在且 lazy 为 true,该节点即为懒加载的节点\n res[parentId] = {\n children: [],\n lazy: true,\n level,\n }\n }\n },\n childrenColumnName.value,\n lazyColumnIdentifier.value\n )\n return res\n }\n\n let isInitTree = true\n const updateTreeData = (ifChangeExpandRowKeys = false) => {\n const nested = normalizedData.value\n const normalizedLazyNode_ = normalizedLazyNode.value\n const keys = Object.keys(nested)\n const newTreeData = {}\n const ifExpandAll =\n instance.store?.states.defaultExpandAll.value && isInitTree\n isInitTree = false\n if (keys.length) {\n const oldTreeData = unref(treeData)\n const rootLazyRowKeys = []\n const getExpanded = (oldValue, key) => {\n if (ifChangeExpandRowKeys) {\n if (expandRowKeys.value.length) {\n return ifExpandAll || expandRowKeys.value.includes(key)\n } else {\n return !!(ifExpandAll || oldValue?.expanded)\n }\n } else {\n const included =\n ifExpandAll ||\n (expandRowKeys.value && expandRowKeys.value.includes(key))\n return !!(oldValue?.expanded || included)\n }\n }\n // 合并 expanded 与 display,确保数据刷新后,状态不变\n keys.forEach((key) => {\n const oldValue = oldTreeData[key]\n const newValue = { ...nested[key] }\n newValue.expanded = getExpanded(oldValue, key)\n if (newValue.lazy) {\n const { loaded = false, loading = false } = oldValue || {}\n newValue.loaded = !!loaded\n newValue.loading = !!loading\n rootLazyRowKeys.push(key)\n }\n newTreeData[key] = newValue\n })\n // 根据懒加载数据更新 treeData\n const lazyKeys = Object.keys(normalizedLazyNode_)\n if (lazy.value && lazyKeys.length && rootLazyRowKeys.length) {\n lazyKeys.forEach((key) => {\n const oldValue = oldTreeData[key]\n const lazyNodeChildren = normalizedLazyNode_[key].children\n if (rootLazyRowKeys.includes(key)) {\n // 懒加载的 root 节点,更新一下原有的数据,原来的 children 一定是空数组\n if (newTreeData[key].children.length !== 0) {\n throw new Error('[ElTable]children must be an empty array.')\n }\n newTreeData[key].children = lazyNodeChildren\n } else {\n const { loaded = false, loading = false } = oldValue || {}\n newTreeData[key] = {\n lazy: true,\n loaded: !!loaded,\n loading: !!loading,\n expanded: getExpanded(oldValue, key),\n children: lazyNodeChildren,\n level: '',\n }\n }\n })\n }\n }\n treeData.value = newTreeData\n instance.store?.updateTableScrollY()\n }\n\n watch(\n () => expandRowKeys.value,\n () => {\n updateTreeData(true)\n }\n )\n\n watch(\n () => normalizedData.value,\n () => {\n updateTreeData()\n }\n )\n watch(\n () => normalizedLazyNode.value,\n () => {\n updateTreeData()\n }\n )\n\n const updateTreeExpandKeys = (value: string[]) => {\n expandRowKeys.value = value\n updateTreeData()\n }\n const isUseLazy = (data): boolean => {\n return lazy.value && data && 'loaded' in data && !data.loaded\n }\n const toggleTreeExpansion = (row: T, expanded?: boolean) => {\n instance.store.assertRowKey()\n\n const rowKey = watcherData.rowKey.value\n const id = getRowIdentity(row, rowKey)\n const data = id && treeData.value[id]\n if (id && data && 'expanded' in data) {\n const oldExpanded = data.expanded\n expanded = isUndefined(expanded) ? !data.expanded : expanded\n treeData.value[id].expanded = expanded\n if (oldExpanded !== expanded) {\n instance.emit('expand-change', row, expanded)\n }\n isUseLazy(data) && loadData(row, id, data)\n instance.store.updateTableScrollY()\n }\n }\n\n const loadOrToggle = (row) => {\n instance.store.assertRowKey()\n const rowKey = watcherData.rowKey.value\n const id = getRowIdentity(row, rowKey)\n const data = treeData.value[id]\n if (isUseLazy(data)) {\n loadData(row, id, data)\n } else {\n toggleTreeExpansion(row, undefined)\n }\n }\n\n const loadData = (row: T, key: string, treeNode) => {\n const { load } = instance.props as unknown as TableProps<T>\n if (load && !treeData.value[key].loaded) {\n treeData.value[key].loading = true\n load(row, treeNode, (data) => {\n if (!isArray(data)) {\n throw new TypeError('[ElTable] data must be an array')\n }\n treeData.value[key].loading = false\n treeData.value[key].loaded = true\n treeData.value[key].expanded = true\n if (data.length) {\n lazyTreeNodeMap.value[key] = data\n }\n instance.emit('expand-change', row, true)\n })\n }\n }\n\n const updateKeyChildren = (key: string, data: T[]) => {\n const { lazy, rowKey } = instance.props as unknown as TableProps<T>\n if (!lazy) return\n if (!rowKey) throw new Error('[Table] rowKey is required in updateKeyChild')\n\n if (lazyTreeNodeMap.value[key]) {\n lazyTreeNodeMap.value[key] = data\n }\n }\n\n return {\n loadData,\n loadOrToggle,\n toggleTreeExpansion,\n updateTreeExpandKeys,\n updateTreeData,\n updateKeyChildren,\n normalize,\n states: {\n expandRowKeys,\n treeData,\n indent,\n lazy,\n lazyTreeNodeMap,\n lazyColumnIdentifier,\n childrenColumnName,\n checkStrictly,\n },\n }\n}\n\nexport default useTree\n"],"names":[],"mappings":";;;;;AAGA,SAAS,OAAO,CAAC,WAAW,EAAE;AAC9B,EAAE,MAAM,aAAa,GAAG,GAAG,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AACT,IAAI,QAAQ;AACZ,IAAI,YAAY;AAChB,IAAI,mBAAmB;AACvB,IAAI,oBAAoB;AACxB,IAAI,cAAc;AAClB,IAAI,iBAAiB;AACrB,IAAI,SAAS;AACb,IAAI,MAAM,EAAE;AACZ,MAAM,aAAa;AACnB,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,IAAI;AACV,MAAM,eAAe;AACrB,MAAM,oBAAoB;AAC1B,MAAM,kBAAkB;AACxB,MAAM,aAAa;AACnB,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
@@ -1,2 +1,79 @@
1
- declare function useWatcher<T>(): any;
1
+ import type { Ref } from 'vue';
2
+ import type { TableColumnCtx } from '../table-column/defaults';
3
+ import type { DefaultRow } from '../table/defaults';
4
+ import type { StoreFilter } from '.';
5
+ declare function useWatcher<T>(): {
6
+ assertRowKey: () => void;
7
+ updateColumns: () => void;
8
+ scheduleLayout: (needUpdateColumns?: boolean, immediate?: boolean) => void;
9
+ isSelected: (row: DefaultRow) => boolean;
10
+ clearSelection: () => void;
11
+ cleanSelection: () => void;
12
+ getSelectionRows: () => T[];
13
+ toggleRowSelection: (row: T, selected?: boolean, emitChange?: boolean, ignoreSelectable?: boolean) => void;
14
+ _toggleAllSelection: () => void;
15
+ toggleAllSelection: null;
16
+ updateSelectionByRowKey: () => void;
17
+ updateAllSelected: () => void;
18
+ updateFilters: (columns: any, values: any) => {};
19
+ updateCurrentRow: (_currentRow: T) => void;
20
+ updateSort: (column: any, prop: any, order: any) => void;
21
+ execFilter: () => void;
22
+ execSort: () => void;
23
+ execQuery: (ignore?: undefined) => void;
24
+ clearFilter: (columnKeys: any) => void;
25
+ clearSort: () => void;
26
+ toggleRowExpansion: (row: T, expanded?: boolean) => void;
27
+ setExpandRowKeysAdapter: (val: string[]) => void;
28
+ setCurrentRowKey: (key: string) => void;
29
+ toggleRowExpansionAdapter: (row: T, expanded?: boolean) => void;
30
+ isRowExpanded: (row: T) => boolean;
31
+ updateExpandRows: () => void;
32
+ updateCurrentRowData: () => void;
33
+ loadOrToggle: (row: any) => void;
34
+ updateTreeData: (ifChangeExpandRowKeys?: boolean) => void;
35
+ updateKeyChildren: (key: string, data: T[]) => void;
36
+ states: {
37
+ _currentRowKey: Ref<string>;
38
+ currentRow: Ref<T>;
39
+ expandRowKeys: Ref<string[]>;
40
+ treeData: Ref<unknown>;
41
+ indent: Ref<number>;
42
+ lazy: Ref<boolean>;
43
+ lazyTreeNodeMap: Ref<{}>;
44
+ lazyColumnIdentifier: Ref<string>;
45
+ childrenColumnName: Ref<string>;
46
+ checkStrictly: Ref<boolean>;
47
+ expandRows: Ref<T[]>;
48
+ defaultExpandAll: Ref<boolean>;
49
+ tableSize: Ref<any>;
50
+ rowKey: Ref<string>;
51
+ data: Ref<T[]>;
52
+ _data: Ref<T[]>;
53
+ isComplex: Ref<boolean>;
54
+ _columns: Ref<TableColumnCtx<T>[]>;
55
+ originColumns: Ref<TableColumnCtx<T>[]>;
56
+ columns: Ref<TableColumnCtx<T>[]>;
57
+ fixedColumns: Ref<TableColumnCtx<T>[]>;
58
+ rightFixedColumns: Ref<TableColumnCtx<T>[]>;
59
+ leafColumns: Ref<TableColumnCtx<T>[]>;
60
+ fixedLeafColumns: Ref<TableColumnCtx<T>[]>;
61
+ rightFixedLeafColumns: Ref<TableColumnCtx<T>[]>;
62
+ updateOrderFns: (() => void)[];
63
+ leafColumnsLength: Ref<number>;
64
+ fixedLeafColumnsLength: Ref<number>;
65
+ rightFixedLeafColumnsLength: Ref<number>;
66
+ isAllSelected: Ref<boolean>;
67
+ selection: Ref<T[]>;
68
+ reserveSelection: Ref<boolean>;
69
+ selectOnIndeterminate: Ref<boolean>;
70
+ selectable: Ref<(row: T, index: number) => boolean>;
71
+ filters: Ref<StoreFilter>;
72
+ filteredData: Ref<null>;
73
+ sortingColumn: Ref<null>;
74
+ sortProp: Ref<null>;
75
+ sortOrder: Ref<null>;
76
+ hoverRow: Ref<null>;
77
+ };
78
+ };
2
79
  export default useWatcher;
@@ -1,7 +1,7 @@
1
1
  import type { Store } from '../store';
2
2
  declare function useUtils<T>(store: Store<T>): {
3
3
  setCurrentRow: (row: T) => void;
4
- getSelectionRows: () => any;
4
+ getSelectionRows: () => T[];
5
5
  toggleRowSelection: (row: T, selected?: boolean, ignoreSelectable?: boolean) => void;
6
6
  clearSelection: () => void;
7
7
  clearFilter: (columnKeys?: string[]) => void;
@@ -51,7 +51,7 @@ declare const _default: import("vue").DefineComponent<{
51
51
  onColumnsChange: (layout: import("../table-layout").default<any>) => void;
52
52
  getCellClasses: (columns: import("../table-column/defaults").TableColumnCtx<any>[], cellIndex: number) => string[];
53
53
  getCellStyles: (column: import("../table-column/defaults").TableColumnCtx<any>, cellIndex: number) => any;
54
- columns: any;
54
+ columns: never[] | import("vue").Ref<import("../table-column/defaults").TableColumnCtx<any>[]>;
55
55
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
56
56
  fixed: {
57
57
  type: StringConstructor;
@@ -1,9 +1,9 @@
1
1
  declare function useMapState(): {
2
- leftFixedLeafCount: import("vue").ComputedRef<any>;
3
- rightFixedLeafCount: import("vue").ComputedRef<any>;
4
- columnsCount: import("vue").ComputedRef<any>;
5
- leftFixedCount: import("vue").ComputedRef<any>;
6
- rightFixedCount: import("vue").ComputedRef<any>;
7
- columns: any;
2
+ leftFixedLeafCount: import("vue").ComputedRef<number>;
3
+ rightFixedLeafCount: import("vue").ComputedRef<number>;
4
+ columnsCount: import("vue").ComputedRef<number>;
5
+ leftFixedCount: import("vue").ComputedRef<number>;
6
+ rightFixedCount: import("vue").ComputedRef<number>;
7
+ columns: never[] | import("vue").Ref<import("element-plus").TableColumnCtx<any>[]>;
8
8
  };
9
9
  export default useMapState;
@@ -2,22 +2,28 @@ import { inject, computed } from 'vue';
2
2
  import { TABLE_INJECTION_KEY } from '../tokens.mjs';
3
3
 
4
4
  function useMapState() {
5
+ var _a;
5
6
  const table = inject(TABLE_INJECTION_KEY);
6
7
  const store = table == null ? void 0 : table.store;
7
8
  const leftFixedLeafCount = computed(() => {
8
- return store.states.fixedLeafColumnsLength.value;
9
+ var _a2;
10
+ return (_a2 = store == null ? void 0 : store.states.fixedLeafColumnsLength.value) != null ? _a2 : 0;
9
11
  });
10
12
  const rightFixedLeafCount = computed(() => {
11
- return store.states.rightFixedColumns.value.length;
13
+ var _a2;
14
+ return (_a2 = store == null ? void 0 : store.states.rightFixedColumns.value.length) != null ? _a2 : 0;
12
15
  });
13
16
  const columnsCount = computed(() => {
14
- return store.states.columns.value.length;
17
+ var _a2;
18
+ return (_a2 = store == null ? void 0 : store.states.columns.value.length) != null ? _a2 : 0;
15
19
  });
16
20
  const leftFixedCount = computed(() => {
17
- return store.states.fixedColumns.value.length;
21
+ var _a2;
22
+ return (_a2 = store == null ? void 0 : store.states.fixedColumns.value.length) != null ? _a2 : 0;
18
23
  });
19
24
  const rightFixedCount = computed(() => {
20
- return store.states.rightFixedColumns.value.length;
25
+ var _a2;
26
+ return (_a2 = store == null ? void 0 : store.states.rightFixedColumns.value.length) != null ? _a2 : 0;
21
27
  });
22
28
  return {
23
29
  leftFixedLeafCount,
@@ -25,7 +31,7 @@ function useMapState() {
25
31
  columnsCount,
26
32
  leftFixedCount,
27
33
  rightFixedCount,
28
- columns: store.states.columns
34
+ columns: (_a = store == null ? void 0 : store.states.columns) != null ? _a : []
29
35
  };
30
36
  }
31
37
 
@@ -1 +1 @@
1
- {"version":3,"file":"mapState-helper.mjs","sources":["../../../../../../../packages/components/table/src/table-footer/mapState-helper.ts"],"sourcesContent":["import { computed, inject } from 'vue'\nimport { TABLE_INJECTION_KEY } from '../tokens'\n\nfunction useMapState() {\n const table = inject(TABLE_INJECTION_KEY)\n const store = table?.store\n const leftFixedLeafCount = computed(() => {\n return store.states.fixedLeafColumnsLength.value\n })\n const rightFixedLeafCount = computed(() => {\n return store.states.rightFixedColumns.value.length\n })\n const columnsCount = computed(() => {\n return store.states.columns.value.length\n })\n const leftFixedCount = computed(() => {\n return store.states.fixedColumns.value.length\n })\n const rightFixedCount = computed(() => {\n return store.states.rightFixedColumns.value.length\n })\n\n return {\n leftFixedLeafCount,\n rightFixedLeafCount,\n columnsCount,\n leftFixedCount,\n rightFixedCount,\n columns: store.states.columns,\n }\n}\n\nexport default useMapState\n"],"names":[],"mappings":";;;AAEA,SAAS,WAAW,GAAG;AACvB,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAC5C,EAAE,MAAM,KAAK,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;AACrD,EAAE,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM;AAC5C,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,KAAK,CAAC;AACrD,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM;AAC7C,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC;AACvD,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM;AACtC,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC;AAC7C,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM;AACxC,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC;AAClD,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM;AACzC,IAAI,OAAO,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC;AACvD,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,kBAAkB;AACtB,IAAI,mBAAmB;AACvB,IAAI,YAAY;AAChB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;AACjC,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"mapState-helper.mjs","sources":["../../../../../../../packages/components/table/src/table-footer/mapState-helper.ts"],"sourcesContent":["import { computed, inject } from 'vue'\nimport { TABLE_INJECTION_KEY } from '../tokens'\n\nfunction useMapState() {\n const table = inject(TABLE_INJECTION_KEY)\n const store = table?.store\n const leftFixedLeafCount = computed(() => {\n return store?.states.fixedLeafColumnsLength.value ?? 0\n })\n const rightFixedLeafCount = computed(() => {\n return store?.states.rightFixedColumns.value.length ?? 0\n })\n const columnsCount = computed(() => {\n return store?.states.columns.value.length ?? 0\n })\n const leftFixedCount = computed(() => {\n return store?.states.fixedColumns.value.length ?? 0\n })\n const rightFixedCount = computed(() => {\n return store?.states.rightFixedColumns.value.length ?? 0\n })\n\n return {\n leftFixedLeafCount,\n rightFixedLeafCount,\n columnsCount,\n leftFixedCount,\n rightFixedCount,\n columns: store?.states.columns ?? [],\n }\n}\n\nexport default useMapState\n"],"names":[],"mappings":";;;AAEA,SAAS,WAAW,GAAG;AACvB,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAC5C,EAAE,MAAM,KAAK,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;AACrD,EAAE,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM;AAC5C,IAAI,IAAI,GAAG,CAAC;AACZ,IAAI,OAAO,CAAC,GAAG,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,sBAAsB,CAAC,KAAK,KAAK,IAAI,GAAG,GAAG,G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;AAChB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,OAAO,EAAE,CAAC,EAAE,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,KAAK,IAAI,GAAG,EAAE,GAAG,EAAE;AACnF,GAAG,CAAC;AACJ;;;;"}
@@ -3,6 +3,6 @@ import type { TableFooter } from '.';
3
3
  declare function useStyle<T>(props: TableFooter<T>): {
4
4
  getCellClasses: (columns: TableColumnCtx<T>[], cellIndex: number) => string[];
5
5
  getCellStyles: (column: TableColumnCtx<T>, cellIndex: number) => any;
6
- columns: any;
6
+ columns: never[] | import("vue").Ref<TableColumnCtx<any>[]>;
7
7
  };
8
8
  export default useStyle;
@@ -4,6 +4,6 @@ export declare const convertToRows: <T>(originColumns: TableColumnCtx<T>[]) => T
4
4
  declare function useUtils<T>(props: TableHeaderProps<T>): {
5
5
  isGroup: import("vue").ComputedRef<boolean>;
6
6
  toggleAllSelection: (event: Event) => void;
7
- columnRows: import("vue").ComputedRef<TableColumnCtx<unknown>[]>;
7
+ columnRows: import("vue").ComputedRef<TableColumnCtx<T>[]>;
8
8
  };
9
9
  export default useUtils;