@element-plus/nightly 0.0.20241220 → 0.0.20241221

Sign up to get free protection for your applications and to get access to all the features.
Files changed (626) hide show
  1. package/dist/index.full.js +20 -19
  2. package/dist/index.full.min.js +13 -13
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +13 -13
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +20 -19
  7. package/dist/locale/af.js +1 -1
  8. package/dist/locale/af.min.js +1 -1
  9. package/dist/locale/af.min.mjs +1 -1
  10. package/dist/locale/af.mjs +1 -1
  11. package/dist/locale/ar-eg.js +1 -1
  12. package/dist/locale/ar-eg.min.js +1 -1
  13. package/dist/locale/ar-eg.min.mjs +1 -1
  14. package/dist/locale/ar-eg.mjs +1 -1
  15. package/dist/locale/ar.js +1 -1
  16. package/dist/locale/ar.min.js +1 -1
  17. package/dist/locale/ar.min.mjs +1 -1
  18. package/dist/locale/ar.mjs +1 -1
  19. package/dist/locale/az.js +1 -1
  20. package/dist/locale/az.min.js +1 -1
  21. package/dist/locale/az.min.mjs +1 -1
  22. package/dist/locale/az.mjs +1 -1
  23. package/dist/locale/bg.js +1 -1
  24. package/dist/locale/bg.min.js +1 -1
  25. package/dist/locale/bg.min.mjs +1 -1
  26. package/dist/locale/bg.mjs +1 -1
  27. package/dist/locale/bn.js +1 -1
  28. package/dist/locale/bn.min.js +1 -1
  29. package/dist/locale/bn.min.mjs +1 -1
  30. package/dist/locale/bn.mjs +1 -1
  31. package/dist/locale/ca.js +1 -1
  32. package/dist/locale/ca.min.js +1 -1
  33. package/dist/locale/ca.min.mjs +1 -1
  34. package/dist/locale/ca.mjs +1 -1
  35. package/dist/locale/ckb.js +1 -1
  36. package/dist/locale/ckb.min.js +1 -1
  37. package/dist/locale/ckb.min.mjs +1 -1
  38. package/dist/locale/ckb.mjs +1 -1
  39. package/dist/locale/cs.js +1 -1
  40. package/dist/locale/cs.min.js +1 -1
  41. package/dist/locale/cs.min.mjs +1 -1
  42. package/dist/locale/cs.mjs +1 -1
  43. package/dist/locale/da.js +1 -1
  44. package/dist/locale/da.min.js +1 -1
  45. package/dist/locale/da.min.mjs +1 -1
  46. package/dist/locale/da.mjs +1 -1
  47. package/dist/locale/de.js +1 -1
  48. package/dist/locale/de.min.js +1 -1
  49. package/dist/locale/de.min.mjs +1 -1
  50. package/dist/locale/de.mjs +1 -1
  51. package/dist/locale/el.js +1 -1
  52. package/dist/locale/el.min.js +1 -1
  53. package/dist/locale/el.min.mjs +1 -1
  54. package/dist/locale/el.mjs +1 -1
  55. package/dist/locale/en.js +1 -1
  56. package/dist/locale/en.min.js +1 -1
  57. package/dist/locale/en.min.mjs +1 -1
  58. package/dist/locale/en.mjs +1 -1
  59. package/dist/locale/eo.js +1 -1
  60. package/dist/locale/eo.min.js +1 -1
  61. package/dist/locale/eo.min.mjs +1 -1
  62. package/dist/locale/eo.mjs +1 -1
  63. package/dist/locale/es.js +1 -1
  64. package/dist/locale/es.min.js +1 -1
  65. package/dist/locale/es.min.mjs +1 -1
  66. package/dist/locale/es.mjs +1 -1
  67. package/dist/locale/et.js +1 -1
  68. package/dist/locale/et.min.js +1 -1
  69. package/dist/locale/et.min.mjs +1 -1
  70. package/dist/locale/et.mjs +1 -1
  71. package/dist/locale/eu.js +1 -1
  72. package/dist/locale/eu.min.js +1 -1
  73. package/dist/locale/eu.min.mjs +1 -1
  74. package/dist/locale/eu.mjs +1 -1
  75. package/dist/locale/fa.js +1 -1
  76. package/dist/locale/fa.min.js +1 -1
  77. package/dist/locale/fa.min.mjs +1 -1
  78. package/dist/locale/fa.mjs +1 -1
  79. package/dist/locale/fi.js +1 -1
  80. package/dist/locale/fi.min.js +1 -1
  81. package/dist/locale/fi.min.mjs +1 -1
  82. package/dist/locale/fi.mjs +1 -1
  83. package/dist/locale/fr.js +1 -1
  84. package/dist/locale/fr.min.js +1 -1
  85. package/dist/locale/fr.min.mjs +1 -1
  86. package/dist/locale/fr.mjs +1 -1
  87. package/dist/locale/he.js +1 -1
  88. package/dist/locale/he.min.js +1 -1
  89. package/dist/locale/he.min.mjs +1 -1
  90. package/dist/locale/he.mjs +1 -1
  91. package/dist/locale/hr.js +1 -1
  92. package/dist/locale/hr.min.js +1 -1
  93. package/dist/locale/hr.min.mjs +1 -1
  94. package/dist/locale/hr.mjs +1 -1
  95. package/dist/locale/hu.js +1 -1
  96. package/dist/locale/hu.min.js +1 -1
  97. package/dist/locale/hu.min.mjs +1 -1
  98. package/dist/locale/hu.mjs +1 -1
  99. package/dist/locale/hy-am.js +1 -1
  100. package/dist/locale/hy-am.min.js +1 -1
  101. package/dist/locale/hy-am.min.mjs +1 -1
  102. package/dist/locale/hy-am.mjs +1 -1
  103. package/dist/locale/id.js +1 -1
  104. package/dist/locale/id.min.js +1 -1
  105. package/dist/locale/id.min.mjs +1 -1
  106. package/dist/locale/id.mjs +1 -1
  107. package/dist/locale/it.js +1 -1
  108. package/dist/locale/it.min.js +1 -1
  109. package/dist/locale/it.min.mjs +1 -1
  110. package/dist/locale/it.mjs +1 -1
  111. package/dist/locale/ja.js +1 -1
  112. package/dist/locale/ja.min.js +1 -1
  113. package/dist/locale/ja.min.mjs +1 -1
  114. package/dist/locale/ja.mjs +1 -1
  115. package/dist/locale/kk.js +1 -1
  116. package/dist/locale/kk.min.js +1 -1
  117. package/dist/locale/kk.min.mjs +1 -1
  118. package/dist/locale/kk.mjs +1 -1
  119. package/dist/locale/km.js +1 -1
  120. package/dist/locale/km.min.js +1 -1
  121. package/dist/locale/km.min.mjs +1 -1
  122. package/dist/locale/km.mjs +1 -1
  123. package/dist/locale/ko.js +1 -1
  124. package/dist/locale/ko.min.js +1 -1
  125. package/dist/locale/ko.min.mjs +1 -1
  126. package/dist/locale/ko.mjs +1 -1
  127. package/dist/locale/ku.js +1 -1
  128. package/dist/locale/ku.min.js +1 -1
  129. package/dist/locale/ku.min.mjs +1 -1
  130. package/dist/locale/ku.mjs +1 -1
  131. package/dist/locale/ky.js +1 -1
  132. package/dist/locale/ky.min.js +1 -1
  133. package/dist/locale/ky.min.mjs +1 -1
  134. package/dist/locale/ky.mjs +1 -1
  135. package/dist/locale/lt.js +1 -1
  136. package/dist/locale/lt.min.js +1 -1
  137. package/dist/locale/lt.min.mjs +1 -1
  138. package/dist/locale/lt.mjs +1 -1
  139. package/dist/locale/lv.js +1 -1
  140. package/dist/locale/lv.min.js +1 -1
  141. package/dist/locale/lv.min.mjs +1 -1
  142. package/dist/locale/lv.mjs +1 -1
  143. package/dist/locale/mg.js +1 -1
  144. package/dist/locale/mg.min.js +1 -1
  145. package/dist/locale/mg.min.mjs +1 -1
  146. package/dist/locale/mg.mjs +1 -1
  147. package/dist/locale/mn.js +1 -1
  148. package/dist/locale/mn.min.js +1 -1
  149. package/dist/locale/mn.min.mjs +1 -1
  150. package/dist/locale/mn.mjs +1 -1
  151. package/dist/locale/ms.js +1 -1
  152. package/dist/locale/ms.min.js +1 -1
  153. package/dist/locale/ms.min.mjs +1 -1
  154. package/dist/locale/ms.mjs +1 -1
  155. package/dist/locale/my.js +1 -1
  156. package/dist/locale/my.min.js +1 -1
  157. package/dist/locale/my.min.mjs +1 -1
  158. package/dist/locale/my.mjs +1 -1
  159. package/dist/locale/nb-no.js +1 -1
  160. package/dist/locale/nb-no.min.js +1 -1
  161. package/dist/locale/nb-no.min.mjs +1 -1
  162. package/dist/locale/nb-no.mjs +1 -1
  163. package/dist/locale/nl.js +1 -1
  164. package/dist/locale/nl.min.js +1 -1
  165. package/dist/locale/nl.min.mjs +1 -1
  166. package/dist/locale/nl.mjs +1 -1
  167. package/dist/locale/pa.js +1 -1
  168. package/dist/locale/pa.min.js +1 -1
  169. package/dist/locale/pa.min.mjs +1 -1
  170. package/dist/locale/pa.mjs +1 -1
  171. package/dist/locale/pl.js +1 -1
  172. package/dist/locale/pl.min.js +1 -1
  173. package/dist/locale/pl.min.mjs +1 -1
  174. package/dist/locale/pl.mjs +1 -1
  175. package/dist/locale/pt-br.js +1 -1
  176. package/dist/locale/pt-br.min.js +1 -1
  177. package/dist/locale/pt-br.min.mjs +1 -1
  178. package/dist/locale/pt-br.mjs +1 -1
  179. package/dist/locale/pt.js +1 -1
  180. package/dist/locale/pt.min.js +1 -1
  181. package/dist/locale/pt.min.mjs +1 -1
  182. package/dist/locale/pt.mjs +1 -1
  183. package/dist/locale/ro.js +1 -1
  184. package/dist/locale/ro.min.js +1 -1
  185. package/dist/locale/ro.min.mjs +1 -1
  186. package/dist/locale/ro.mjs +1 -1
  187. package/dist/locale/ru.js +1 -1
  188. package/dist/locale/ru.min.js +1 -1
  189. package/dist/locale/ru.min.mjs +1 -1
  190. package/dist/locale/ru.mjs +1 -1
  191. package/dist/locale/sk.js +1 -1
  192. package/dist/locale/sk.min.js +1 -1
  193. package/dist/locale/sk.min.mjs +1 -1
  194. package/dist/locale/sk.mjs +1 -1
  195. package/dist/locale/sl.js +1 -1
  196. package/dist/locale/sl.min.js +1 -1
  197. package/dist/locale/sl.min.mjs +1 -1
  198. package/dist/locale/sl.mjs +1 -1
  199. package/dist/locale/sr.js +1 -1
  200. package/dist/locale/sr.min.js +1 -1
  201. package/dist/locale/sr.min.mjs +1 -1
  202. package/dist/locale/sr.mjs +1 -1
  203. package/dist/locale/sv.js +1 -1
  204. package/dist/locale/sv.min.js +1 -1
  205. package/dist/locale/sv.min.mjs +1 -1
  206. package/dist/locale/sv.mjs +1 -1
  207. package/dist/locale/sw.js +1 -1
  208. package/dist/locale/sw.min.js +1 -1
  209. package/dist/locale/sw.min.mjs +1 -1
  210. package/dist/locale/sw.mjs +1 -1
  211. package/dist/locale/ta.js +1 -1
  212. package/dist/locale/ta.min.js +1 -1
  213. package/dist/locale/ta.min.mjs +1 -1
  214. package/dist/locale/ta.mjs +1 -1
  215. package/dist/locale/th.js +1 -1
  216. package/dist/locale/th.min.js +1 -1
  217. package/dist/locale/th.min.mjs +1 -1
  218. package/dist/locale/th.mjs +1 -1
  219. package/dist/locale/tk.js +1 -1
  220. package/dist/locale/tk.min.js +1 -1
  221. package/dist/locale/tk.min.mjs +1 -1
  222. package/dist/locale/tk.mjs +1 -1
  223. package/dist/locale/tr.js +1 -1
  224. package/dist/locale/tr.min.js +1 -1
  225. package/dist/locale/tr.min.mjs +1 -1
  226. package/dist/locale/tr.mjs +1 -1
  227. package/dist/locale/ug-cn.js +1 -1
  228. package/dist/locale/ug-cn.min.js +1 -1
  229. package/dist/locale/ug-cn.min.mjs +1 -1
  230. package/dist/locale/ug-cn.mjs +1 -1
  231. package/dist/locale/uk.js +1 -1
  232. package/dist/locale/uk.min.js +1 -1
  233. package/dist/locale/uk.min.mjs +1 -1
  234. package/dist/locale/uk.mjs +1 -1
  235. package/dist/locale/uz-uz.js +1 -1
  236. package/dist/locale/uz-uz.min.js +1 -1
  237. package/dist/locale/uz-uz.min.mjs +1 -1
  238. package/dist/locale/uz-uz.mjs +1 -1
  239. package/dist/locale/vi.js +1 -1
  240. package/dist/locale/vi.min.js +1 -1
  241. package/dist/locale/vi.min.mjs +1 -1
  242. package/dist/locale/vi.mjs +1 -1
  243. package/dist/locale/zh-cn.js +1 -1
  244. package/dist/locale/zh-cn.min.js +1 -1
  245. package/dist/locale/zh-cn.min.mjs +1 -1
  246. package/dist/locale/zh-cn.mjs +1 -1
  247. package/dist/locale/zh-tw.js +1 -1
  248. package/dist/locale/zh-tw.min.js +1 -1
  249. package/dist/locale/zh-tw.min.mjs +1 -1
  250. package/dist/locale/zh-tw.mjs +1 -1
  251. package/es/components/affix/index.mjs +2 -2
  252. package/es/components/affix/src/affix.mjs +118 -25
  253. package/es/components/affix/src/affix.mjs.map +1 -1
  254. package/es/components/affix/src/affix2.mjs +25 -118
  255. package/es/components/affix/src/affix2.mjs.map +1 -1
  256. package/es/components/anchor/index.mjs +1 -1
  257. package/es/components/anchor/src/anchor-link.mjs +5 -81
  258. package/es/components/anchor/src/anchor-link.mjs.map +1 -1
  259. package/es/components/anchor/src/anchor-link2.mjs +81 -5
  260. package/es/components/anchor/src/anchor-link2.mjs.map +1 -1
  261. package/es/components/autocomplete/src/autocomplete.mjs +1 -1
  262. package/es/components/badge/index.mjs +2 -2
  263. package/es/components/badge/src/badge.mjs +32 -71
  264. package/es/components/badge/src/badge.mjs.map +1 -1
  265. package/es/components/badge/src/badge2.mjs +71 -32
  266. package/es/components/badge/src/badge2.mjs.map +1 -1
  267. package/es/components/breadcrumb/index.mjs +2 -2
  268. package/es/components/breadcrumb/src/breadcrumb-item.mjs +8 -56
  269. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  270. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +56 -8
  271. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  272. package/es/components/carousel/index.mjs +2 -2
  273. package/es/components/carousel/src/carousel-item.mjs +7 -69
  274. package/es/components/carousel/src/carousel-item.mjs.map +1 -1
  275. package/es/components/carousel/src/carousel-item2.mjs +69 -7
  276. package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
  277. package/es/components/cascader/src/cascader.mjs +1 -1
  278. package/es/components/check-tag/index.mjs +2 -2
  279. package/es/components/check-tag/src/check-tag.mjs +38 -14
  280. package/es/components/check-tag/src/check-tag.mjs.map +1 -1
  281. package/es/components/check-tag/src/check-tag2.mjs +14 -38
  282. package/es/components/check-tag/src/check-tag2.mjs.map +1 -1
  283. package/es/components/checkbox/index.mjs +2 -2
  284. package/es/components/checkbox/src/checkbox-button.mjs +1 -1
  285. package/es/components/checkbox/src/checkbox.mjs +119 -59
  286. package/es/components/checkbox/src/checkbox.mjs.map +1 -1
  287. package/es/components/checkbox/src/checkbox2.mjs +59 -119
  288. package/es/components/checkbox/src/checkbox2.mjs.map +1 -1
  289. package/es/components/col/index.mjs +2 -2
  290. package/es/components/col/src/col.mjs +64 -43
  291. package/es/components/col/src/col.mjs.map +1 -1
  292. package/es/components/col/src/col2.mjs +43 -64
  293. package/es/components/col/src/col2.mjs.map +1 -1
  294. package/es/components/collapse/index.mjs +2 -2
  295. package/es/components/collapse/src/collapse.mjs +16 -28
  296. package/es/components/collapse/src/collapse.mjs.map +1 -1
  297. package/es/components/collapse/src/collapse2.mjs +28 -16
  298. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  299. package/es/components/collection/index.mjs +1 -1
  300. package/es/components/collection/src/collection.mjs +10 -62
  301. package/es/components/collection/src/collection.mjs.map +1 -1
  302. package/es/components/collection/src/collection2.mjs +62 -10
  303. package/es/components/collection/src/collection2.mjs.map +1 -1
  304. package/es/components/color-picker/src/color-picker.mjs +1 -1
  305. package/es/components/countdown/index.mjs +2 -2
  306. package/es/components/countdown/src/countdown.mjs +79 -22
  307. package/es/components/countdown/src/countdown.mjs.map +1 -1
  308. package/es/components/countdown/src/countdown2.mjs +22 -79
  309. package/es/components/countdown/src/countdown2.mjs.map +1 -1
  310. package/es/components/dialog/index.mjs +2 -2
  311. package/es/components/dialog/src/dialog.mjs +64 -168
  312. package/es/components/dialog/src/dialog.mjs.map +1 -1
  313. package/es/components/dialog/src/dialog2.mjs +168 -64
  314. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  315. package/es/components/divider/index.mjs +2 -2
  316. package/es/components/divider/src/divider.mjs +34 -16
  317. package/es/components/divider/src/divider.mjs.map +1 -1
  318. package/es/components/divider/src/divider2.mjs +16 -34
  319. package/es/components/divider/src/divider2.mjs.map +1 -1
  320. package/es/components/drawer/index.mjs +2 -2
  321. package/es/components/drawer/src/drawer.mjs +178 -26
  322. package/es/components/drawer/src/drawer.mjs.map +1 -1
  323. package/es/components/drawer/src/drawer2.mjs +26 -178
  324. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  325. package/es/components/dropdown/index.mjs +2 -2
  326. package/es/components/dropdown/src/dropdown-item-impl.mjs +2 -2
  327. package/es/components/dropdown/src/dropdown-item.mjs +1 -1
  328. package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
  329. package/es/components/dropdown/src/dropdown.mjs +102 -298
  330. package/es/components/dropdown/src/dropdown.mjs.map +1 -1
  331. package/es/components/dropdown/src/dropdown2.mjs +298 -102
  332. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  333. package/es/components/form/index.mjs +2 -2
  334. package/es/components/form/src/form-item.mjs +319 -47
  335. package/es/components/form/src/form-item.mjs.map +1 -1
  336. package/es/components/form/src/form-item2.mjs +47 -319
  337. package/es/components/form/src/form-item2.mjs.map +1 -1
  338. package/es/components/image/index.mjs +2 -2
  339. package/es/components/image/src/image.mjs +64 -232
  340. package/es/components/image/src/image.mjs.map +1 -1
  341. package/es/components/image/src/image2.mjs +232 -64
  342. package/es/components/image/src/image2.mjs.map +1 -1
  343. package/es/components/index.mjs +25 -25
  344. package/es/components/input/index.mjs +2 -2
  345. package/es/components/input/src/input.mjs +102 -431
  346. package/es/components/input/src/input.mjs.map +1 -1
  347. package/es/components/input/src/input2.mjs +431 -102
  348. package/es/components/input/src/input2.mjs.map +1 -1
  349. package/es/components/mention/index.mjs +2 -2
  350. package/es/components/mention/src/mention-dropdown.mjs +15 -166
  351. package/es/components/mention/src/mention-dropdown.mjs.map +1 -1
  352. package/es/components/mention/src/mention-dropdown2.mjs +166 -15
  353. package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
  354. package/es/components/mention/src/mention.mjs +63 -283
  355. package/es/components/mention/src/mention.mjs.map +1 -1
  356. package/es/components/mention/src/mention2.mjs +283 -63
  357. package/es/components/mention/src/mention2.mjs.map +1 -1
  358. package/es/components/menu/index.mjs +2 -2
  359. package/es/components/menu/src/menu-item-group.mjs +4 -34
  360. package/es/components/menu/src/menu-item-group.mjs.map +1 -1
  361. package/es/components/menu/src/menu-item-group2.mjs +34 -4
  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 +91 -145
  365. package/es/components/message/src/message.mjs.map +1 -1
  366. package/es/components/message/src/message2.mjs +145 -91
  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/total.mjs +6 -26
  370. package/es/components/pagination/src/components/total.mjs.map +1 -1
  371. package/es/components/pagination/src/components/total2.mjs +26 -6
  372. package/es/components/pagination/src/components/total2.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/index.mjs +2 -2
  376. package/es/components/popover/src/popover.mjs +110 -64
  377. package/es/components/popover/src/popover.mjs.map +1 -1
  378. package/es/components/popover/src/popover2.mjs +64 -110
  379. package/es/components/popover/src/popover2.mjs.map +1 -1
  380. package/es/components/progress/index.mjs +2 -2
  381. package/es/components/progress/src/progress.mjs +53 -207
  382. package/es/components/progress/src/progress.mjs.map +1 -1
  383. package/es/components/progress/src/progress2.mjs +207 -53
  384. package/es/components/progress/src/progress2.mjs.map +1 -1
  385. package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
  386. package/es/components/scrollbar/index.mjs +1 -1
  387. package/es/components/scrollbar/src/bar2.mjs +1 -1
  388. package/es/components/scrollbar/src/thumb.mjs +129 -11
  389. package/es/components/scrollbar/src/thumb.mjs.map +1 -1
  390. package/es/components/scrollbar/src/thumb2.mjs +11 -129
  391. package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
  392. package/es/components/select/src/select.mjs +1 -1
  393. package/es/components/select-v2/src/defaults.mjs +1 -1
  394. package/es/components/table/src/filter-panel.mjs +5 -3
  395. package/es/components/table/src/filter-panel.mjs.map +1 -1
  396. package/es/components/table/src/filter-panel.vue.d.ts +1 -0
  397. package/es/components/table/src/h-helper.mjs +2 -1
  398. package/es/components/table/src/h-helper.mjs.map +1 -1
  399. package/es/components/table/src/store/current.mjs +2 -1
  400. package/es/components/table/src/store/current.mjs.map +1 -1
  401. package/es/components/table/src/store/helper.mjs +2 -1
  402. package/es/components/table/src/store/helper.mjs.map +1 -1
  403. package/es/components/table/src/store/index.mjs +2 -1
  404. package/es/components/table/src/store/index.mjs.map +1 -1
  405. package/es/components/table/src/table-body/render-helper.mjs +2 -2
  406. package/es/components/table/src/table-body/render-helper.mjs.map +1 -1
  407. package/es/components/table/src/table-body/styles-helper.mjs +2 -2
  408. package/es/components/table/src/table-body/styles-helper.mjs.map +1 -1
  409. package/es/components/table/src/table-column/render-helper.mjs +3 -2
  410. package/es/components/table/src/table-column/render-helper.mjs.map +1 -1
  411. package/es/components/table/src/table-header/event-helper.mjs +2 -1
  412. package/es/components/table/src/table-header/event-helper.mjs.map +1 -1
  413. package/es/components/table/src/table-layout.mjs +2 -1
  414. package/es/components/table/src/table-layout.mjs.map +1 -1
  415. package/es/components/table/src/util.mjs +6 -6
  416. package/es/components/table/src/util.mjs.map +1 -1
  417. package/es/components/time-select/index.mjs +2 -2
  418. package/es/components/time-select/src/time-select.mjs +50 -123
  419. package/es/components/time-select/src/time-select.mjs.map +1 -1
  420. package/es/components/time-select/src/time-select2.mjs +123 -50
  421. package/es/components/time-select/src/time-select2.mjs.map +1 -1
  422. package/es/components/tooltip/index.mjs +1 -1
  423. package/es/components/tooltip/src/content.mjs +28 -183
  424. package/es/components/tooltip/src/content.mjs.map +1 -1
  425. package/es/components/tooltip/src/content2.mjs +183 -28
  426. package/es/components/tooltip/src/content2.mjs.map +1 -1
  427. package/es/components/tooltip/src/tooltip.mjs +1 -1
  428. package/es/components/tooltip/src/tooltip2.mjs +1 -1
  429. package/es/components/watermark/index.mjs +2 -2
  430. package/es/components/watermark/src/watermark.mjs +210 -27
  431. package/es/components/watermark/src/watermark.mjs.map +1 -1
  432. package/es/components/watermark/src/watermark2.mjs +27 -210
  433. package/es/components/watermark/src/watermark2.mjs.map +1 -1
  434. package/es/index.mjs +25 -25
  435. package/es/version.d.ts +1 -1
  436. package/es/version.mjs +1 -1
  437. package/es/version.mjs.map +1 -1
  438. package/lib/components/affix/index.js +2 -2
  439. package/lib/components/affix/src/affix.js +118 -26
  440. package/lib/components/affix/src/affix.js.map +1 -1
  441. package/lib/components/affix/src/affix2.js +26 -118
  442. package/lib/components/affix/src/affix2.js.map +1 -1
  443. package/lib/components/anchor/index.js +1 -1
  444. package/lib/components/anchor/src/anchor-link.js +5 -81
  445. package/lib/components/anchor/src/anchor-link.js.map +1 -1
  446. package/lib/components/anchor/src/anchor-link2.js +81 -5
  447. package/lib/components/anchor/src/anchor-link2.js.map +1 -1
  448. package/lib/components/autocomplete/src/autocomplete.js +1 -1
  449. package/lib/components/badge/index.js +2 -2
  450. package/lib/components/badge/src/badge.js +32 -71
  451. package/lib/components/badge/src/badge.js.map +1 -1
  452. package/lib/components/badge/src/badge2.js +71 -32
  453. package/lib/components/badge/src/badge2.js.map +1 -1
  454. package/lib/components/breadcrumb/index.js +2 -2
  455. package/lib/components/breadcrumb/src/breadcrumb-item.js +8 -56
  456. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  457. package/lib/components/breadcrumb/src/breadcrumb-item2.js +56 -8
  458. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  459. package/lib/components/carousel/index.js +2 -2
  460. package/lib/components/carousel/src/carousel-item.js +7 -69
  461. package/lib/components/carousel/src/carousel-item.js.map +1 -1
  462. package/lib/components/carousel/src/carousel-item2.js +69 -7
  463. package/lib/components/carousel/src/carousel-item2.js.map +1 -1
  464. package/lib/components/cascader/src/cascader.js +1 -1
  465. package/lib/components/check-tag/index.js +2 -2
  466. package/lib/components/check-tag/src/check-tag.js +38 -15
  467. package/lib/components/check-tag/src/check-tag.js.map +1 -1
  468. package/lib/components/check-tag/src/check-tag2.js +15 -38
  469. package/lib/components/check-tag/src/check-tag2.js.map +1 -1
  470. package/lib/components/checkbox/index.js +2 -2
  471. package/lib/components/checkbox/src/checkbox-button.js +1 -1
  472. package/lib/components/checkbox/src/checkbox.js +119 -60
  473. package/lib/components/checkbox/src/checkbox.js.map +1 -1
  474. package/lib/components/checkbox/src/checkbox2.js +60 -119
  475. package/lib/components/checkbox/src/checkbox2.js.map +1 -1
  476. package/lib/components/col/index.js +2 -2
  477. package/lib/components/col/src/col.js +64 -43
  478. package/lib/components/col/src/col.js.map +1 -1
  479. package/lib/components/col/src/col2.js +43 -64
  480. package/lib/components/col/src/col2.js.map +1 -1
  481. package/lib/components/collapse/index.js +2 -2
  482. package/lib/components/collapse/src/collapse.js +18 -28
  483. package/lib/components/collapse/src/collapse.js.map +1 -1
  484. package/lib/components/collapse/src/collapse2.js +28 -18
  485. package/lib/components/collapse/src/collapse2.js.map +1 -1
  486. package/lib/components/collection/index.js +1 -1
  487. package/lib/components/collection/src/collection.js +9 -62
  488. package/lib/components/collection/src/collection.js.map +1 -1
  489. package/lib/components/collection/src/collection2.js +62 -9
  490. package/lib/components/collection/src/collection2.js.map +1 -1
  491. package/lib/components/color-picker/src/color-picker.js +1 -1
  492. package/lib/components/countdown/index.js +2 -2
  493. package/lib/components/countdown/src/countdown.js +79 -23
  494. package/lib/components/countdown/src/countdown.js.map +1 -1
  495. package/lib/components/countdown/src/countdown2.js +23 -79
  496. package/lib/components/countdown/src/countdown2.js.map +1 -1
  497. package/lib/components/dialog/index.js +2 -2
  498. package/lib/components/dialog/src/dialog.js +65 -168
  499. package/lib/components/dialog/src/dialog.js.map +1 -1
  500. package/lib/components/dialog/src/dialog2.js +168 -65
  501. package/lib/components/dialog/src/dialog2.js.map +1 -1
  502. package/lib/components/divider/index.js +2 -2
  503. package/lib/components/divider/src/divider.js +34 -16
  504. package/lib/components/divider/src/divider.js.map +1 -1
  505. package/lib/components/divider/src/divider2.js +16 -34
  506. package/lib/components/divider/src/divider2.js.map +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/index.js +2 -2
  513. package/lib/components/dropdown/src/dropdown-item-impl.js +2 -2
  514. package/lib/components/dropdown/src/dropdown-item.js +1 -1
  515. package/lib/components/dropdown/src/dropdown-menu.js +1 -1
  516. package/lib/components/dropdown/src/dropdown.js +111 -298
  517. package/lib/components/dropdown/src/dropdown.js.map +1 -1
  518. package/lib/components/dropdown/src/dropdown2.js +298 -111
  519. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  520. package/lib/components/form/index.js +2 -2
  521. package/lib/components/form/src/form-item.js +323 -48
  522. package/lib/components/form/src/form-item.js.map +1 -1
  523. package/lib/components/form/src/form-item2.js +48 -323
  524. package/lib/components/form/src/form-item2.js.map +1 -1
  525. package/lib/components/image/index.js +2 -2
  526. package/lib/components/image/src/image.js +64 -231
  527. package/lib/components/image/src/image.js.map +1 -1
  528. package/lib/components/image/src/image2.js +231 -64
  529. package/lib/components/image/src/image2.js.map +1 -1
  530. package/lib/components/index.js +25 -25
  531. package/lib/components/input/index.js +2 -2
  532. package/lib/components/input/src/input.js +102 -430
  533. package/lib/components/input/src/input.js.map +1 -1
  534. package/lib/components/input/src/input2.js +430 -102
  535. package/lib/components/input/src/input2.js.map +1 -1
  536. package/lib/components/mention/index.js +2 -2
  537. package/lib/components/mention/src/mention-dropdown.js +16 -166
  538. package/lib/components/mention/src/mention-dropdown.js.map +1 -1
  539. package/lib/components/mention/src/mention-dropdown2.js +166 -16
  540. package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
  541. package/lib/components/mention/src/mention.js +62 -281
  542. package/lib/components/mention/src/mention.js.map +1 -1
  543. package/lib/components/mention/src/mention2.js +281 -62
  544. package/lib/components/mention/src/mention2.js.map +1 -1
  545. package/lib/components/menu/index.js +2 -2
  546. package/lib/components/menu/src/menu-item-group.js +4 -34
  547. package/lib/components/menu/src/menu-item-group.js.map +1 -1
  548. package/lib/components/menu/src/menu-item-group2.js +34 -4
  549. package/lib/components/menu/src/menu-item-group2.js.map +1 -1
  550. package/lib/components/message/index.js +1 -1
  551. package/lib/components/message/src/message.js +93 -144
  552. package/lib/components/message/src/message.js.map +1 -1
  553. package/lib/components/message/src/message2.js +144 -93
  554. package/lib/components/message/src/message2.js.map +1 -1
  555. package/lib/components/message/src/method.js +2 -2
  556. package/lib/components/pagination/src/components/total.js +6 -26
  557. package/lib/components/pagination/src/components/total.js.map +1 -1
  558. package/lib/components/pagination/src/components/total2.js +26 -6
  559. package/lib/components/pagination/src/components/total2.js.map +1 -1
  560. package/lib/components/pagination/src/pagination.js +1 -1
  561. package/lib/components/popconfirm/src/popconfirm.js +1 -1
  562. package/lib/components/popover/index.js +2 -2
  563. package/lib/components/popover/src/popover.js +110 -65
  564. package/lib/components/popover/src/popover.js.map +1 -1
  565. package/lib/components/popover/src/popover2.js +65 -110
  566. package/lib/components/popover/src/popover2.js.map +1 -1
  567. package/lib/components/progress/index.js +2 -2
  568. package/lib/components/progress/src/progress.js +53 -207
  569. package/lib/components/progress/src/progress.js.map +1 -1
  570. package/lib/components/progress/src/progress2.js +207 -53
  571. package/lib/components/progress/src/progress2.js.map +1 -1
  572. package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
  573. package/lib/components/scrollbar/index.js +1 -1
  574. package/lib/components/scrollbar/src/bar2.js +1 -1
  575. package/lib/components/scrollbar/src/thumb.js +129 -11
  576. package/lib/components/scrollbar/src/thumb.js.map +1 -1
  577. package/lib/components/scrollbar/src/thumb2.js +11 -129
  578. package/lib/components/scrollbar/src/thumb2.js.map +1 -1
  579. package/lib/components/select/src/select.js +1 -1
  580. package/lib/components/select-v2/src/defaults.js +1 -1
  581. package/lib/components/table/src/filter-panel.js +5 -3
  582. package/lib/components/table/src/filter-panel.js.map +1 -1
  583. package/lib/components/table/src/filter-panel.vue.d.ts +1 -0
  584. package/lib/components/table/src/h-helper.js +2 -1
  585. package/lib/components/table/src/h-helper.js.map +1 -1
  586. package/lib/components/table/src/store/current.js +2 -1
  587. package/lib/components/table/src/store/current.js.map +1 -1
  588. package/lib/components/table/src/store/helper.js +2 -1
  589. package/lib/components/table/src/store/helper.js.map +1 -1
  590. package/lib/components/table/src/store/index.js +2 -1
  591. package/lib/components/table/src/store/index.js.map +1 -1
  592. package/lib/components/table/src/table-body/render-helper.js +1 -1
  593. package/lib/components/table/src/table-body/render-helper.js.map +1 -1
  594. package/lib/components/table/src/table-body/styles-helper.js +1 -1
  595. package/lib/components/table/src/table-body/styles-helper.js.map +1 -1
  596. package/lib/components/table/src/table-column/render-helper.js +3 -2
  597. package/lib/components/table/src/table-column/render-helper.js.map +1 -1
  598. package/lib/components/table/src/table-header/event-helper.js +2 -1
  599. package/lib/components/table/src/table-header/event-helper.js.map +1 -1
  600. package/lib/components/table/src/table-layout.js +2 -1
  601. package/lib/components/table/src/table-layout.js.map +1 -1
  602. package/lib/components/table/src/util.js +4 -4
  603. package/lib/components/table/src/util.js.map +1 -1
  604. package/lib/components/time-select/index.js +2 -2
  605. package/lib/components/time-select/src/time-select.js +50 -128
  606. package/lib/components/time-select/src/time-select.js.map +1 -1
  607. package/lib/components/time-select/src/time-select2.js +128 -50
  608. package/lib/components/time-select/src/time-select2.js.map +1 -1
  609. package/lib/components/tooltip/index.js +1 -1
  610. package/lib/components/tooltip/src/content.js +28 -183
  611. package/lib/components/tooltip/src/content.js.map +1 -1
  612. package/lib/components/tooltip/src/content2.js +183 -28
  613. package/lib/components/tooltip/src/content2.js.map +1 -1
  614. package/lib/components/tooltip/src/tooltip.js +1 -1
  615. package/lib/components/tooltip/src/tooltip2.js +1 -1
  616. package/lib/components/watermark/index.js +2 -2
  617. package/lib/components/watermark/src/watermark.js +210 -27
  618. package/lib/components/watermark/src/watermark.js.map +1 -1
  619. package/lib/components/watermark/src/watermark2.js +27 -210
  620. package/lib/components/watermark/src/watermark2.js.map +1 -1
  621. package/lib/index.js +25 -25
  622. package/lib/version.d.ts +1 -1
  623. package/lib/version.js +1 -1
  624. package/lib/version.js.map +1 -1
  625. package/package.json +2 -2
  626. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sources":["../../../../../../../packages/components/table/src/store/helper.ts"],"sourcesContent":["// @ts-nocheck\nimport { watch } from 'vue'\nimport { debounce } from 'lodash-unified'\nimport useStore from '.'\n\nimport type { Store } from '.'\nimport type { Table, TableProps } from '../table/defaults'\n\nconst InitialStateMap = {\n rowKey: 'rowKey',\n defaultExpandAll: 'defaultExpandAll',\n selectOnIndeterminate: 'selectOnIndeterminate',\n indent: 'indent',\n lazy: 'lazy',\n data: 'data',\n ['treeProps.hasChildren']: {\n key: 'lazyColumnIdentifier',\n default: 'hasChildren',\n },\n ['treeProps.children']: {\n key: 'childrenColumnName',\n default: 'children',\n },\n ['treeProps.checkStrictly']: {\n key: 'checkStrictly',\n default: false,\n },\n}\n\nexport function createStore<T>(table: Table<T>, props: TableProps<T>) {\n if (!table) {\n throw new Error('Table is required.')\n }\n\n const store = useStore<T>()\n // fix https://github.com/ElemeFE/element/issues/14075\n // related pr https://github.com/ElemeFE/element/pull/14146\n store.toggleAllSelection = debounce(store._toggleAllSelection, 10)\n Object.keys(InitialStateMap).forEach((key) => {\n handleValue(getArrKeysValue(props, key), key, store)\n })\n proxyTableProps(store, props)\n return store\n}\n\nfunction proxyTableProps<T>(store: Store<T>, props: TableProps<T>) {\n Object.keys(InitialStateMap).forEach((key) => {\n watch(\n () => getArrKeysValue(props, key),\n (value) => {\n handleValue(value, key, store)\n }\n )\n })\n}\n\nfunction handleValue<T>(value, propsKey: string, store: Store<T>) {\n let newVal = value\n let storeKey = InitialStateMap[propsKey]\n if (typeof InitialStateMap[propsKey] === 'object') {\n storeKey = storeKey.key\n newVal = newVal || InitialStateMap[propsKey].default\n }\n store.states[storeKey].value = newVal\n}\n\nfunction getArrKeysValue<T>(props: TableProps<T>, keys: string) {\n if (keys.includes('.')) {\n const keyList = keys.split('.')\n let value = props\n keyList.forEach((key) => {\n value = value[key]\n })\n return value\n } else {\n return props[keys]\n }\n}\n"],"names":["useStore","debounce","watch"],"mappings":";;;;;;;;AAGA,MAAM,eAAe,GAAG;AACxB,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,gBAAgB,EAAE,kBAAkB;AACtC,EAAE,qBAAqB,EAAE,uBAAuB;AAChD,EAAE,MAAM,E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K;AACxD,MAAM,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACrC,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,CAAC;AACL,CAAC;AACD,SAAS,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;AAC7C,EAAE,IAAI,MAAM,GAAG,KAAK,CAAC;AACrB,EAAE,IAAI,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AAC3C,EAAE,IAAI,OAAO,eAAe,CAAC,QAAQ,CAAC,KAAK,QAAQ,EAAE;AACrD,IAAI,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC;AAC5B,IAAI,MAAM,GAAG,MAAM,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;AACzD,GAAG;AACH,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC;AACxC,CAAC;AACD,SAAS,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE;AACtC,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC1B,IAAI,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACpC,IAAI,IAAI,KAAK,GAAG,KAAK,CAAC;AACtB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK;AAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AACzB,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG,MAAM;AACT,IAAI,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;AACvB,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"helper.js","sources":["../../../../../../../packages/components/table/src/store/helper.ts"],"sourcesContent":["// @ts-nocheck\nimport { watch } from 'vue'\nimport { debounce } from 'lodash-unified'\nimport { isObject } from '@element-plus/utils'\nimport useStore from '.'\n\nimport type { Store } from '.'\nimport type { Table, TableProps } from '../table/defaults'\n\nconst InitialStateMap = {\n rowKey: 'rowKey',\n defaultExpandAll: 'defaultExpandAll',\n selectOnIndeterminate: 'selectOnIndeterminate',\n indent: 'indent',\n lazy: 'lazy',\n data: 'data',\n ['treeProps.hasChildren']: {\n key: 'lazyColumnIdentifier',\n default: 'hasChildren',\n },\n ['treeProps.children']: {\n key: 'childrenColumnName',\n default: 'children',\n },\n ['treeProps.checkStrictly']: {\n key: 'checkStrictly',\n default: false,\n },\n}\n\nexport function createStore<T>(table: Table<T>, props: TableProps<T>) {\n if (!table) {\n throw new Error('Table is required.')\n }\n\n const store = useStore<T>()\n // fix https://github.com/ElemeFE/element/issues/14075\n // related pr https://github.com/ElemeFE/element/pull/14146\n store.toggleAllSelection = debounce(store._toggleAllSelection, 10)\n Object.keys(InitialStateMap).forEach((key) => {\n handleValue(getArrKeysValue(props, key), key, store)\n })\n proxyTableProps(store, props)\n return store\n}\n\nfunction proxyTableProps<T>(store: Store<T>, props: TableProps<T>) {\n Object.keys(InitialStateMap).forEach((key) => {\n watch(\n () => getArrKeysValue(props, key),\n (value) => {\n handleValue(value, key, store)\n }\n )\n })\n}\n\nfunction handleValue<T>(value, propsKey: string, store: Store<T>) {\n let newVal = value\n let storeKey = InitialStateMap[propsKey]\n if (isObject(InitialStateMap[propsKey])) {\n storeKey = storeKey.key\n newVal = newVal || InitialStateMap[propsKey].default\n }\n store.states[storeKey].value = newVal\n}\n\nfunction getArrKeysValue<T>(props: TableProps<T>, keys: string) {\n if (keys.includes('.')) {\n const keyList = keys.split('.')\n let value = props\n keyList.forEach((key) => {\n value = value[key]\n })\n return value\n } else {\n return props[keys]\n }\n}\n"],"names":["useStore","debounce","watch","isObject"],"mappings":";;;;;;;;;AAIA,MAAM,eAAe,GAAG;AACxB,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,gBAAgB,EAAE,kBAAkB;AACtC,EAAE,qBAAqB,EAAE,uBAAuB;AAChD,EAA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KAAK,KAAK;AACxD,MAAM,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACrC,KAAK,CAAC,CAAC;AACP,GAAG,CAAC,CAAC;AACL,CAAC;AACD,SAAS,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;AAC7C,EAAE,IAAI,MAAM,GAAG,KAAK,CAAC;AACrB,EAAE,IAAI,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AAC3C,EAAE,IAAIC,eAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,EAAE;AAC3C,IAAI,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC;AAC5B,IAAI,MAAM,GAAG,MAAM,IAAI,eAAe,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;AACzD,GAAG;AACH,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,MAAM,CAAC;AACxC,CAAC;AACD,SAAS,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE;AACtC,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC1B,IAAI,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACpC,IAAI,IAAI,KAAK,GAAG,KAAK,CAAC;AACtB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK;AAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AACzB,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG,MAAM;AACT,IAAI,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;AACvB,GAAG;AACH;;;;"}
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
+ var lodashUnified = require('lodash-unified');
6
7
  var watcher = require('./watcher.js');
7
8
  var index = require('../../../../hooks/use-namespace/index.js');
8
9
 
@@ -129,7 +130,7 @@ function useStore() {
129
130
  changeSortCondition(states, options) {
130
131
  const { sortingColumn, sortProp, sortOrder } = states;
131
132
  const columnValue = vue.unref(sortingColumn), propValue = vue.unref(sortProp), orderValue = vue.unref(sortOrder);
132
- if (orderValue === null) {
133
+ if (lodashUnified.isNull(orderValue)) {
133
134
  states.sortingColumn.value = null;
134
135
  states.sortProp.value = null;
135
136
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../packages/components/table/src/store/index.ts"],"sourcesContent":["// @ts-nocheck\nimport { getCurrentInstance, nextTick, unref } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport useWatcher from './watcher'\n\nimport type { Ref } from 'vue'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { Filter, Sort, Table } from '../table/defaults'\n\ninterface WatcherPropsData<T> {\n data: Ref<T[]>\n rowKey: Ref<string>\n}\n\nfunction replaceColumn<T>(\n array: TableColumnCtx<T>[],\n column: TableColumnCtx<T>\n) {\n return array.map((item) => {\n if (item.id === column.id) {\n return column\n } else if (item.children?.length) {\n item.children = replaceColumn(item.children, column)\n }\n return item\n })\n}\n\nfunction sortColumn<T>(array: TableColumnCtx<T>[]) {\n array.forEach((item) => {\n item.no = item.getColumnIndex?.()\n if (item.children?.length) {\n sortColumn(item.children)\n }\n })\n array.sort((cur, pre) => cur.no - pre.no)\n}\n\nfunction useStore<T>() {\n const instance = getCurrentInstance() as Table<T>\n const watcher = useWatcher<T>()\n const ns = useNamespace('table')\n type StoreStates = typeof watcher.states\n const mutations = {\n setData(states: StoreStates, data: T[]) {\n const dataInstanceChanged = unref(states._data) !== data\n states.data.value = data\n states._data.value = data\n instance.store.execQuery()\n // 数据变化,更新部分数据。\n // 没有使用 computed,而是手动更新部分数据 https://github.com/vuejs/vue/issues/6660#issuecomment-331417140\n instance.store.updateCurrentRowData()\n instance.store.updateExpandRows()\n instance.store.updateTreeData(\n instance.store.states.defaultExpandAll.value\n )\n if (unref(states.reserveSelection)) {\n instance.store.assertRowKey()\n instance.store.updateSelectionByRowKey()\n } else {\n if (dataInstanceChanged) {\n instance.store.clearSelection()\n } else {\n instance.store.cleanSelection()\n }\n }\n instance.store.updateAllSelected()\n if (instance.$ready) {\n instance.store.scheduleLayout()\n }\n },\n\n insertColumn(\n states: StoreStates,\n column: TableColumnCtx<T>,\n parent: TableColumnCtx<T>,\n updateColumnOrder: () => void\n ) {\n const array = unref(states._columns)\n let newColumns = []\n if (!parent) {\n array.push(column)\n newColumns = array\n } else {\n if (parent && !parent.children) {\n parent.children = []\n }\n parent.children.push(column)\n newColumns = replaceColumn(array, parent)\n }\n sortColumn(newColumns)\n states._columns.value = newColumns\n states.updateOrderFns.push(updateColumnOrder)\n if (column.type === 'selection') {\n states.selectable.value = column.selectable\n states.reserveSelection.value = column.reserveSelection\n }\n if (instance.$ready) {\n instance.store.updateColumns() // hack for dynamics insert column\n instance.store.scheduleLayout()\n }\n },\n\n updateColumnOrder(states: StoreStates, column: TableColumnCtx<T>) {\n const newColumnIndex = column.getColumnIndex?.()\n if (newColumnIndex === column.no) return\n\n sortColumn(states._columns.value)\n\n if (instance.$ready) {\n instance.store.updateColumns()\n }\n },\n\n removeColumn(\n states: StoreStates,\n column: TableColumnCtx<T>,\n parent: TableColumnCtx<T>,\n updateColumnOrder: () => void\n ) {\n const array = unref(states._columns) || []\n if (parent) {\n parent.children.splice(\n parent.children.findIndex((item) => item.id === column.id),\n 1\n )\n // fix #10699, delete parent.children immediately will trigger again\n nextTick(() => {\n if (parent.children?.length === 0) {\n delete parent.children\n }\n })\n states._columns.value = replaceColumn(array, parent)\n } else {\n const index = array.indexOf(column)\n if (index > -1) {\n array.splice(index, 1)\n states._columns.value = array\n }\n }\n\n const updateFnIndex = states.updateOrderFns.indexOf(updateColumnOrder)\n updateFnIndex > -1 && states.updateOrderFns.splice(updateFnIndex, 1)\n\n if (instance.$ready) {\n instance.store.updateColumns() // hack for dynamics remove column\n instance.store.scheduleLayout()\n }\n },\n\n sort(states: StoreStates, options: Sort) {\n const { prop, order, init } = options\n if (prop) {\n const column = unref(states.columns).find(\n (column) => column.property === prop\n )\n if (column) {\n column.order = order\n instance.store.updateSort(column, prop, order)\n instance.store.commit('changeSortCondition', { init })\n }\n }\n },\n\n changeSortCondition(states: StoreStates, options: Sort) {\n // 修复 pr https://github.com/ElemeFE/element/pull/15012 导致的 bug\n // https://github.com/element-plus/element-plus/pull/4640\n const { sortingColumn, sortProp, sortOrder } = states\n const columnValue = unref(sortingColumn),\n propValue = unref(sortProp),\n orderValue = unref(sortOrder)\n if (orderValue === null) {\n states.sortingColumn.value = null\n states.sortProp.value = null\n }\n const ignore = { filter: true }\n instance.store.execQuery(ignore)\n\n if (!options || !(options.silent || options.init)) {\n instance.emit('sort-change', {\n column: columnValue,\n prop: propValue,\n order: orderValue,\n })\n }\n\n instance.store.updateTableScrollY()\n },\n\n filterChange(_states: StoreStates, options: Filter<T>) {\n const { column, values, silent } = options\n const newFilters = instance.store.updateFilters(column, values)\n instance.store.execQuery()\n\n if (!silent) {\n instance.emit('filter-change', newFilters)\n }\n instance.store.updateTableScrollY()\n },\n\n toggleAllSelection() {\n instance.store.toggleAllSelection()\n },\n\n rowSelectedChanged(_states, row: T) {\n instance.store.toggleRowSelection(row)\n instance.store.updateAllSelected()\n },\n\n setHoverRow(states: StoreStates, row: T) {\n states.hoverRow.value = row\n },\n\n setCurrentRow(_states, row: T) {\n instance.store.updateCurrentRow(row)\n },\n }\n const commit = function (name: keyof typeof mutations, ...args) {\n const mutations = instance.store.mutations\n if (mutations[name]) {\n mutations[name].apply(instance, [instance.store.states].concat(args))\n } else {\n throw new Error(`Action not found: ${name}`)\n }\n }\n const updateTableScrollY = function () {\n nextTick(() => instance.layout.updateScrollY.apply(instance.layout))\n }\n return {\n ns,\n ...watcher,\n mutations,\n commit,\n updateTableScrollY,\n }\n}\n\nexport default useStore\n\nclass HelperStore<T> {\n Return = useStore<T>()\n}\n\ntype StoreFilter = Record<string, string[]>\ntype Store<T> = HelperStore<T>['Return']\nexport type { WatcherPropsData, Store, StoreFilter }\n"],"names":["getCurrentInstance","watcher","useWatcher","useNamespace","unref","nextTick"],"mappings":";;;;;;;;AAGA,SAAS,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE;AACtC,EAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK;AAC7B,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,IAAI,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,EAAE;AAC/B,MAAM,OAAO,MAAM,CAAC;AACpB,KAAK,MAAM,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE;AAClE,MAAM,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC3D,KAAK;AACL,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC,CAAC;AACL,CAAC;AACD,SAAS,UAAU,CAAC,KAAK,EAAE;AAC3B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK;AAC1B,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC;AACf,IAAI,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,cAAc,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1E,IAAI,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE;AAC3D,MAAM,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAChC,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,GAA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X,MAAM,MAAM,IAAI,KAAK,CAAC,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACnD,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,MAAM,kBAAkB,GAAG,WAAW;AACxC,IAAIC,YAAQ,CAAC,MAAM,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACzE,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,EAAE;AACN,IAAI,GAAGJ,SAAO;AACd,IAAI,SAAS;AACb,IAAI,MAAM;AACV,IAAI,kBAAkB;AACtB,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../packages/components/table/src/store/index.ts"],"sourcesContent":["// @ts-nocheck\nimport { getCurrentInstance, nextTick, unref } from 'vue'\nimport { isNull } from 'lodash-unified'\nimport { useNamespace } from '@element-plus/hooks'\nimport useWatcher from './watcher'\n\nimport type { Ref } from 'vue'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { Filter, Sort, Table } from '../table/defaults'\n\ninterface WatcherPropsData<T> {\n data: Ref<T[]>\n rowKey: Ref<string>\n}\n\nfunction replaceColumn<T>(\n array: TableColumnCtx<T>[],\n column: TableColumnCtx<T>\n) {\n return array.map((item) => {\n if (item.id === column.id) {\n return column\n } else if (item.children?.length) {\n item.children = replaceColumn(item.children, column)\n }\n return item\n })\n}\n\nfunction sortColumn<T>(array: TableColumnCtx<T>[]) {\n array.forEach((item) => {\n item.no = item.getColumnIndex?.()\n if (item.children?.length) {\n sortColumn(item.children)\n }\n })\n array.sort((cur, pre) => cur.no - pre.no)\n}\n\nfunction useStore<T>() {\n const instance = getCurrentInstance() as Table<T>\n const watcher = useWatcher<T>()\n const ns = useNamespace('table')\n type StoreStates = typeof watcher.states\n const mutations = {\n setData(states: StoreStates, data: T[]) {\n const dataInstanceChanged = unref(states._data) !== data\n states.data.value = data\n states._data.value = data\n instance.store.execQuery()\n // 数据变化,更新部分数据。\n // 没有使用 computed,而是手动更新部分数据 https://github.com/vuejs/vue/issues/6660#issuecomment-331417140\n instance.store.updateCurrentRowData()\n instance.store.updateExpandRows()\n instance.store.updateTreeData(\n instance.store.states.defaultExpandAll.value\n )\n if (unref(states.reserveSelection)) {\n instance.store.assertRowKey()\n instance.store.updateSelectionByRowKey()\n } else {\n if (dataInstanceChanged) {\n instance.store.clearSelection()\n } else {\n instance.store.cleanSelection()\n }\n }\n instance.store.updateAllSelected()\n if (instance.$ready) {\n instance.store.scheduleLayout()\n }\n },\n\n insertColumn(\n states: StoreStates,\n column: TableColumnCtx<T>,\n parent: TableColumnCtx<T>,\n updateColumnOrder: () => void\n ) {\n const array = unref(states._columns)\n let newColumns = []\n if (!parent) {\n array.push(column)\n newColumns = array\n } else {\n if (parent && !parent.children) {\n parent.children = []\n }\n parent.children.push(column)\n newColumns = replaceColumn(array, parent)\n }\n sortColumn(newColumns)\n states._columns.value = newColumns\n states.updateOrderFns.push(updateColumnOrder)\n if (column.type === 'selection') {\n states.selectable.value = column.selectable\n states.reserveSelection.value = column.reserveSelection\n }\n if (instance.$ready) {\n instance.store.updateColumns() // hack for dynamics insert column\n instance.store.scheduleLayout()\n }\n },\n\n updateColumnOrder(states: StoreStates, column: TableColumnCtx<T>) {\n const newColumnIndex = column.getColumnIndex?.()\n if (newColumnIndex === column.no) return\n\n sortColumn(states._columns.value)\n\n if (instance.$ready) {\n instance.store.updateColumns()\n }\n },\n\n removeColumn(\n states: StoreStates,\n column: TableColumnCtx<T>,\n parent: TableColumnCtx<T>,\n updateColumnOrder: () => void\n ) {\n const array = unref(states._columns) || []\n if (parent) {\n parent.children.splice(\n parent.children.findIndex((item) => item.id === column.id),\n 1\n )\n // fix #10699, delete parent.children immediately will trigger again\n nextTick(() => {\n if (parent.children?.length === 0) {\n delete parent.children\n }\n })\n states._columns.value = replaceColumn(array, parent)\n } else {\n const index = array.indexOf(column)\n if (index > -1) {\n array.splice(index, 1)\n states._columns.value = array\n }\n }\n\n const updateFnIndex = states.updateOrderFns.indexOf(updateColumnOrder)\n updateFnIndex > -1 && states.updateOrderFns.splice(updateFnIndex, 1)\n\n if (instance.$ready) {\n instance.store.updateColumns() // hack for dynamics remove column\n instance.store.scheduleLayout()\n }\n },\n\n sort(states: StoreStates, options: Sort) {\n const { prop, order, init } = options\n if (prop) {\n const column = unref(states.columns).find(\n (column) => column.property === prop\n )\n if (column) {\n column.order = order\n instance.store.updateSort(column, prop, order)\n instance.store.commit('changeSortCondition', { init })\n }\n }\n },\n\n changeSortCondition(states: StoreStates, options: Sort) {\n // 修复 pr https://github.com/ElemeFE/element/pull/15012 导致的 bug\n // https://github.com/element-plus/element-plus/pull/4640\n const { sortingColumn, sortProp, sortOrder } = states\n const columnValue = unref(sortingColumn),\n propValue = unref(sortProp),\n orderValue = unref(sortOrder)\n if (isNull(orderValue)) {\n states.sortingColumn.value = null\n states.sortProp.value = null\n }\n const ignore = { filter: true }\n instance.store.execQuery(ignore)\n\n if (!options || !(options.silent || options.init)) {\n instance.emit('sort-change', {\n column: columnValue,\n prop: propValue,\n order: orderValue,\n })\n }\n\n instance.store.updateTableScrollY()\n },\n\n filterChange(_states: StoreStates, options: Filter<T>) {\n const { column, values, silent } = options\n const newFilters = instance.store.updateFilters(column, values)\n instance.store.execQuery()\n\n if (!silent) {\n instance.emit('filter-change', newFilters)\n }\n instance.store.updateTableScrollY()\n },\n\n toggleAllSelection() {\n instance.store.toggleAllSelection()\n },\n\n rowSelectedChanged(_states, row: T) {\n instance.store.toggleRowSelection(row)\n instance.store.updateAllSelected()\n },\n\n setHoverRow(states: StoreStates, row: T) {\n states.hoverRow.value = row\n },\n\n setCurrentRow(_states, row: T) {\n instance.store.updateCurrentRow(row)\n },\n }\n const commit = function (name: keyof typeof mutations, ...args) {\n const mutations = instance.store.mutations\n if (mutations[name]) {\n mutations[name].apply(instance, [instance.store.states].concat(args))\n } else {\n throw new Error(`Action not found: ${name}`)\n }\n }\n const updateTableScrollY = function () {\n nextTick(() => instance.layout.updateScrollY.apply(instance.layout))\n }\n return {\n ns,\n ...watcher,\n mutations,\n commit,\n updateTableScrollY,\n }\n}\n\nexport default useStore\n\nclass HelperStore<T> {\n Return = useStore<T>()\n}\n\ntype StoreFilter = Record<string, string[]>\ntype Store<T> = HelperStore<T>['Return']\nexport type { WatcherPropsData, Store, StoreFilter }\n"],"names":["getCurrentInstance","watcher","useWatcher","useNamespace","unref","nextTick","isNull"],"mappings":";;;;;;;;;AAIA,SAAS,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE;AACtC,EAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK;AAC7B,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,IAAI,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,EAAE;AAC/B,MAAM,OAAO,MAAM,CAAC;AACpB,KAAK,MAAM,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE;AAClE,MAAM,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC3D,KAAK;AACL,IAAI,OAAO,IAAI,CAAC;AAChB,GAAG,CAAC,CAAC;AACL,CAAC;AACD,SAAS,UAAU,CAAC,KAAK,EAAE;AAC3B,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK;AAC1B,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC;AACf,IAAI,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,cAAc,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1E,IAAI,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CA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C,EAAE;AAC1B,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;AAC7E,KAAK,MAAM;AACX,MAAM,MAAM,IAAI,KAAK,CAAC,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACnD,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,MAAM,kBAAkB,GAAG,WAAW;AACxC,IAAID,YAAQ,CAAC,MAAM,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACzE,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,EAAE;AACN,IAAI,GAAGJ,SAAO;AACd,IAAI,SAAS;AACb,IAAI,MAAM;AACV,IAAI,kBAAkB;AACtB,GAAG,CAAC;AACJ;;;;"}
@@ -181,7 +181,7 @@ function useRender(props) {
181
181
  loading: false
182
182
  };
183
183
  const childKey = util.getRowIdentity(node, rowKey.value);
184
- if (childKey === void 0 || childKey === null) {
184
+ if (types.isPropAbsent(childKey)) {
185
185
  throw new Error("For nested data item, row-key is required.");
186
186
  }
187
187
  cur = { ...treeData.value[childKey] };
@@ -1 +1 @@
1
- {"version":3,"file":"render-helper.js","sources":["../../../../../../../packages/components/table/src/table-body/render-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport { computed, h, inject } from 'vue'\nimport { merge } from 'lodash-unified'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isBoolean } from '@element-plus/utils'\nimport { getRowIdentity } from '../util'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport useEvents from './events-helper'\nimport useStyles from './styles-helper'\nimport TdWrapper from './td-wrapper.vue'\nimport type { TableBodyProps } from './defaults'\nimport type { RenderRowData, TableProps, TreeNode } from '../table/defaults'\n\nfunction useRender<T>(props: Partial<TableBodyProps<T>>) {\n const parent = inject(TABLE_INJECTION_KEY)\n const ns = useNamespace('table')\n const {\n handleDoubleClick,\n handleClick,\n handleContextMenu,\n handleMouseEnter,\n handleMouseLeave,\n handleCellMouseEnter,\n handleCellMouseLeave,\n tooltipContent,\n tooltipTrigger,\n } = useEvents(props)\n const {\n getRowStyle,\n getRowClass,\n getCellStyle,\n getCellClass,\n getSpan,\n getColspanRealWidth,\n } = useStyles(props)\n const firstDefaultColumnIndex = computed(() => {\n return props.store.states.columns.value.findIndex(\n ({ type }) => type === 'default'\n )\n })\n const getKeyOfRow = (row: T, index: number) => {\n const rowKey = (parent.props as Partial<TableProps<T>>).rowKey\n if (rowKey) {\n return getRowIdentity(row, rowKey)\n }\n return index\n }\n const rowRender = (\n row: T,\n $index: number,\n treeRowData?: TreeNode,\n expanded = false\n ) => {\n const { tooltipEffect, tooltipOptions, store } = props\n const { indent, columns } = store.states\n const rowClasses = getRowClass(row, $index)\n let display = true\n if (treeRowData) {\n rowClasses.push(ns.em('row', `level-${treeRowData.level}`))\n display = treeRowData.display\n }\n const displayStyle = display\n ? null\n : {\n display: 'none',\n }\n return h(\n 'tr',\n {\n style: [displayStyle, getRowStyle(row, $index)],\n class: rowClasses,\n key: getKeyOfRow(row, $index),\n onDblclick: ($event) => handleDoubleClick($event, row),\n onClick: ($event) => handleClick($event, row),\n onContextmenu: ($event) => handleContextMenu($event, row),\n onMouseenter: () => handleMouseEnter($index),\n onMouseleave: handleMouseLeave,\n },\n columns.value.map((column, cellIndex) => {\n const { rowspan, colspan } = getSpan(row, column, $index, cellIndex)\n if (!rowspan || !colspan) {\n return null\n }\n const columnData = Object.assign({}, column)\n columnData.realWidth = getColspanRealWidth(\n columns.value,\n colspan,\n cellIndex\n )\n const data: RenderRowData<T> = {\n store: props.store,\n _self: props.context || parent,\n column: columnData,\n row,\n $index,\n cellIndex,\n expanded,\n }\n if (cellIndex === firstDefaultColumnIndex.value && treeRowData) {\n data.treeNode = {\n indent: treeRowData.level * indent.value,\n level: treeRowData.level,\n }\n if (isBoolean(treeRowData.expanded)) {\n data.treeNode.expanded = treeRowData.expanded\n // 表明是懒加载\n if ('loading' in treeRowData) {\n data.treeNode.loading = treeRowData.loading\n }\n if ('noLazyChildren' in treeRowData) {\n data.treeNode.noLazyChildren = treeRowData.noLazyChildren\n }\n }\n }\n const baseKey = `${getKeyOfRow(row, $index)},${cellIndex}`\n const patchKey = columnData.columnKey || columnData.rawColumnKey || ''\n const mergedTooltipOptions =\n column.showOverflowTooltip &&\n merge(\n {\n effect: tooltipEffect,\n },\n tooltipOptions,\n column.showOverflowTooltip\n )\n return h(\n TdWrapper,\n {\n style: getCellStyle($index, cellIndex, row, column),\n class: getCellClass($index, cellIndex, row, column, colspan - 1),\n key: `${patchKey}${baseKey}`,\n rowspan,\n colspan,\n onMouseenter: ($event) =>\n handleCellMouseEnter($event, row, mergedTooltipOptions),\n onMouseleave: handleCellMouseLeave,\n },\n {\n default: () => cellChildren(cellIndex, column, data),\n }\n )\n })\n )\n }\n const cellChildren = (cellIndex, column, data) => {\n return column.renderCell(data)\n }\n\n const wrappedRowRender = (row: T, $index: number) => {\n const store = props.store\n const { isRowExpanded, assertRowKey } = store\n const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey } =\n store.states\n const columns = store.states.columns.value\n const hasExpandColumn = columns.some(({ type }) => type === 'expand')\n if (hasExpandColumn) {\n const expanded = isRowExpanded(row)\n const tr = rowRender(row, $index, undefined, expanded)\n const renderExpanded = parent.renderExpanded\n if (expanded) {\n if (!renderExpanded) {\n console.error('[Element Error]renderExpanded is required.')\n return tr\n }\n // 使用二维数组,避免修改 $index\n // Use a matrix to avoid modifying $index\n return [\n [\n tr,\n h(\n 'tr',\n {\n key: `expanded-row__${tr.key as string}`,\n },\n [\n h(\n 'td',\n {\n colspan: columns.length,\n class: `${ns.e('cell')} ${ns.e('expanded-cell')}`,\n },\n [renderExpanded({ row, $index, store, expanded })]\n ),\n ]\n ),\n ],\n ]\n } else {\n // 使用二维数组,避免修改 $index\n // Use a two dimensional array avoid modifying $index\n return [[tr]]\n }\n } else if (Object.keys(treeData.value).length) {\n assertRowKey()\n // TreeTable 时,rowKey 必须由用户设定,不使用 getKeyOfRow 计算\n // 在调用 rowRender 函数时,仍然会计算 rowKey,不太好的操作\n const key = getRowIdentity(row, rowKey.value)\n let cur = treeData.value[key]\n let treeRowData = null\n if (cur) {\n treeRowData = {\n expanded: cur.expanded,\n level: cur.level,\n display: true,\n }\n if (isBoolean(cur.lazy)) {\n if (isBoolean(cur.loaded) && cur.loaded) {\n treeRowData.noLazyChildren = !(cur.children && cur.children.length)\n }\n treeRowData.loading = cur.loading\n }\n }\n const tmp = [rowRender(row, $index, treeRowData)]\n // 渲染嵌套数据\n if (cur) {\n // currentRow 记录的是 index,所以还需主动增加 TreeTable 的 index\n let i = 0\n const traverse = (children, parent) => {\n if (!(children && children.length && parent)) return\n children.forEach((node) => {\n // 父节点的 display 状态影响子节点的显示状态\n const innerTreeRowData = {\n display: parent.display && parent.expanded,\n level: parent.level + 1,\n expanded: false,\n noLazyChildren: false,\n loading: false,\n }\n const childKey = getRowIdentity(node, rowKey.value)\n if (childKey === undefined || childKey === null) {\n throw new Error('For nested data item, row-key is required.')\n }\n cur = { ...treeData.value[childKey] }\n // 对于当前节点,分成有无子节点两种情况。\n // 如果包含子节点的,设置 expanded 属性。\n // 对于它子节点的 display 属性由它本身的 expanded 与 display 共同决定。\n if (cur) {\n innerTreeRowData.expanded = cur.expanded\n // 懒加载的某些节点,level 未知\n cur.level = cur.level || innerTreeRowData.level\n cur.display = !!(cur.expanded && innerTreeRowData.display)\n if (isBoolean(cur.lazy)) {\n if (isBoolean(cur.loaded) && cur.loaded) {\n innerTreeRowData.noLazyChildren = !(\n cur.children && cur.children.length\n )\n }\n innerTreeRowData.loading = cur.loading\n }\n }\n i++\n tmp.push(rowRender(node, $index + i, innerTreeRowData))\n if (cur) {\n const nodes =\n lazyTreeNodeMap.value[childKey] ||\n node[childrenColumnName.value]\n traverse(nodes, cur)\n }\n })\n }\n // 对于 root 节点,display 一定为 true\n cur.display = true\n const nodes =\n lazyTreeNodeMap.value[key] || row[childrenColumnName.value]\n traverse(nodes, cur)\n }\n return tmp\n } else {\n return rowRender(row, $index, undefined)\n }\n }\n\n return {\n wrappedRowRender,\n tooltipContent,\n tooltipTrigger,\n }\n}\n\nexport default useRender\n"],"names":["inject","TABLE_INJECTION_KEY","useNamespace","useEvents","useStyles","computed","getRowIdentity","h","isBoolean","merge","TdWrapper"],"mappings":";;;;;;;;;;;;;;AASA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,EAAE,MAAM,MAAM,GAAGA,UAAM,CAACC,0BAAmB,CAAC,CAAC;AAC7C,EAAE,MAAM,EAAE,GAAGC,kBAAY,CAAC,OAAO,CAAC,CAAC;AACnC,EAAE,MAAM;AACR,IAAI,iBAAiB;AACrB,IAAI,WAAW;AACf,IAAI,iBAAiB;AACrB,IAAI,gBAAgB;AACpB,IAAI,gBAAgB;AACpB,IAAI,oBAAoB;AACxB,IAAI,oBAAoB;AACxB,IAAI,cAAc;AAClB,IAAI,cAAc;AAClB,GAAG,GAAGC,uBAAS,CAAC,KAAK,CAAC,CAAC;AACvB,EAAE,MAAM;AACR,IAAI,WAAW;AACf,IAAI,WAAW;AACf,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,IAAI,OAAO;AACX,IAAI,mBAAmB;AACvB,GAAG,GAAGC,uBAAS,CAAC,KAAK,CAAC,CAAC;AACvB,EAAE,MAAM,uBAAuB,GAAGC,YAAQ,CAAC,MAAM;AACjD,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,IAAI,KAAK,SAAS,CAAC,CAAC;AACxF,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,KAAK,KAAK;AACtC,IAAI,MAAM,MAAM,GA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AAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC7B,OAAO;AACP,MAAM,OAAO,GAAG,CAAC;AACjB,KAAK,MAAM;AACX,MAAM,OAAO,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAC5C,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,gBAAgB;AACpB,IAAI,cAAc;AAClB,IAAI,cAAc;AAClB,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"render-helper.js","sources":["../../../../../../../packages/components/table/src/table-body/render-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport { computed, h, inject } from 'vue'\nimport { merge } from 'lodash-unified'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isBoolean, isPropAbsent } from '@element-plus/utils'\nimport { getRowIdentity } from '../util'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport useEvents from './events-helper'\nimport useStyles from './styles-helper'\nimport TdWrapper from './td-wrapper.vue'\nimport type { TableBodyProps } from './defaults'\nimport type { RenderRowData, TableProps, TreeNode } from '../table/defaults'\n\nfunction useRender<T>(props: Partial<TableBodyProps<T>>) {\n const parent = inject(TABLE_INJECTION_KEY)\n const ns = useNamespace('table')\n const {\n handleDoubleClick,\n handleClick,\n handleContextMenu,\n handleMouseEnter,\n handleMouseLeave,\n handleCellMouseEnter,\n handleCellMouseLeave,\n tooltipContent,\n tooltipTrigger,\n } = useEvents(props)\n const {\n getRowStyle,\n getRowClass,\n getCellStyle,\n getCellClass,\n getSpan,\n getColspanRealWidth,\n } = useStyles(props)\n const firstDefaultColumnIndex = computed(() => {\n return props.store.states.columns.value.findIndex(\n ({ type }) => type === 'default'\n )\n })\n const getKeyOfRow = (row: T, index: number) => {\n const rowKey = (parent.props as Partial<TableProps<T>>).rowKey\n if (rowKey) {\n return getRowIdentity(row, rowKey)\n }\n return index\n }\n const rowRender = (\n row: T,\n $index: number,\n treeRowData?: TreeNode,\n expanded = false\n ) => {\n const { tooltipEffect, tooltipOptions, store } = props\n const { indent, columns } = store.states\n const rowClasses = getRowClass(row, $index)\n let display = true\n if (treeRowData) {\n rowClasses.push(ns.em('row', `level-${treeRowData.level}`))\n display = treeRowData.display\n }\n const displayStyle = display\n ? null\n : {\n display: 'none',\n }\n return h(\n 'tr',\n {\n style: [displayStyle, getRowStyle(row, $index)],\n class: rowClasses,\n key: getKeyOfRow(row, $index),\n onDblclick: ($event) => handleDoubleClick($event, row),\n onClick: ($event) => handleClick($event, row),\n onContextmenu: ($event) => handleContextMenu($event, row),\n onMouseenter: () => handleMouseEnter($index),\n onMouseleave: handleMouseLeave,\n },\n columns.value.map((column, cellIndex) => {\n const { rowspan, colspan } = getSpan(row, column, $index, cellIndex)\n if (!rowspan || !colspan) {\n return null\n }\n const columnData = Object.assign({}, column)\n columnData.realWidth = getColspanRealWidth(\n columns.value,\n colspan,\n cellIndex\n )\n const data: RenderRowData<T> = {\n store: props.store,\n _self: props.context || parent,\n column: columnData,\n row,\n $index,\n cellIndex,\n expanded,\n }\n if (cellIndex === firstDefaultColumnIndex.value && treeRowData) {\n data.treeNode = {\n indent: treeRowData.level * indent.value,\n level: treeRowData.level,\n }\n if (isBoolean(treeRowData.expanded)) {\n data.treeNode.expanded = treeRowData.expanded\n // 表明是懒加载\n if ('loading' in treeRowData) {\n data.treeNode.loading = treeRowData.loading\n }\n if ('noLazyChildren' in treeRowData) {\n data.treeNode.noLazyChildren = treeRowData.noLazyChildren\n }\n }\n }\n const baseKey = `${getKeyOfRow(row, $index)},${cellIndex}`\n const patchKey = columnData.columnKey || columnData.rawColumnKey || ''\n const mergedTooltipOptions =\n column.showOverflowTooltip &&\n merge(\n {\n effect: tooltipEffect,\n },\n tooltipOptions,\n column.showOverflowTooltip\n )\n return h(\n TdWrapper,\n {\n style: getCellStyle($index, cellIndex, row, column),\n class: getCellClass($index, cellIndex, row, column, colspan - 1),\n key: `${patchKey}${baseKey}`,\n rowspan,\n colspan,\n onMouseenter: ($event) =>\n handleCellMouseEnter($event, row, mergedTooltipOptions),\n onMouseleave: handleCellMouseLeave,\n },\n {\n default: () => cellChildren(cellIndex, column, data),\n }\n )\n })\n )\n }\n const cellChildren = (cellIndex, column, data) => {\n return column.renderCell(data)\n }\n\n const wrappedRowRender = (row: T, $index: number) => {\n const store = props.store\n const { isRowExpanded, assertRowKey } = store\n const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey } =\n store.states\n const columns = store.states.columns.value\n const hasExpandColumn = columns.some(({ type }) => type === 'expand')\n if (hasExpandColumn) {\n const expanded = isRowExpanded(row)\n const tr = rowRender(row, $index, undefined, expanded)\n const renderExpanded = parent.renderExpanded\n if (expanded) {\n if (!renderExpanded) {\n console.error('[Element Error]renderExpanded is required.')\n return tr\n }\n // 使用二维数组,避免修改 $index\n // Use a matrix to avoid modifying $index\n return [\n [\n tr,\n h(\n 'tr',\n {\n key: `expanded-row__${tr.key as string}`,\n },\n [\n h(\n 'td',\n {\n colspan: columns.length,\n class: `${ns.e('cell')} ${ns.e('expanded-cell')}`,\n },\n [renderExpanded({ row, $index, store, expanded })]\n ),\n ]\n ),\n ],\n ]\n } else {\n // 使用二维数组,避免修改 $index\n // Use a two dimensional array avoid modifying $index\n return [[tr]]\n }\n } else if (Object.keys(treeData.value).length) {\n assertRowKey()\n // TreeTable 时,rowKey 必须由用户设定,不使用 getKeyOfRow 计算\n // 在调用 rowRender 函数时,仍然会计算 rowKey,不太好的操作\n const key = getRowIdentity(row, rowKey.value)\n let cur = treeData.value[key]\n let treeRowData = null\n if (cur) {\n treeRowData = {\n expanded: cur.expanded,\n level: cur.level,\n display: true,\n }\n if (isBoolean(cur.lazy)) {\n if (isBoolean(cur.loaded) && cur.loaded) {\n treeRowData.noLazyChildren = !(cur.children && cur.children.length)\n }\n treeRowData.loading = cur.loading\n }\n }\n const tmp = [rowRender(row, $index, treeRowData)]\n // 渲染嵌套数据\n if (cur) {\n // currentRow 记录的是 index,所以还需主动增加 TreeTable 的 index\n let i = 0\n const traverse = (children, parent) => {\n if (!(children && children.length && parent)) return\n children.forEach((node) => {\n // 父节点的 display 状态影响子节点的显示状态\n const innerTreeRowData = {\n display: parent.display && parent.expanded,\n level: parent.level + 1,\n expanded: false,\n noLazyChildren: false,\n loading: false,\n }\n const childKey = getRowIdentity(node, rowKey.value)\n if (isPropAbsent(childKey)) {\n throw new Error('For nested data item, row-key is required.')\n }\n cur = { ...treeData.value[childKey] }\n // 对于当前节点,分成有无子节点两种情况。\n // 如果包含子节点的,设置 expanded 属性。\n // 对于它子节点的 display 属性由它本身的 expanded 与 display 共同决定。\n if (cur) {\n innerTreeRowData.expanded = cur.expanded\n // 懒加载的某些节点,level 未知\n cur.level = cur.level || innerTreeRowData.level\n cur.display = !!(cur.expanded && innerTreeRowData.display)\n if (isBoolean(cur.lazy)) {\n if (isBoolean(cur.loaded) && cur.loaded) {\n innerTreeRowData.noLazyChildren = !(\n cur.children && cur.children.length\n )\n }\n innerTreeRowData.loading = cur.loading\n }\n }\n i++\n tmp.push(rowRender(node, $index + i, innerTreeRowData))\n if (cur) {\n const nodes =\n lazyTreeNodeMap.value[childKey] ||\n node[childrenColumnName.value]\n traverse(nodes, cur)\n }\n })\n }\n // 对于 root 节点,display 一定为 true\n cur.display = true\n const nodes =\n lazyTreeNodeMap.value[key] || row[childrenColumnName.value]\n traverse(nodes, cur)\n }\n return tmp\n } else {\n return rowRender(row, $index, undefined)\n }\n }\n\n return {\n wrappedRowRender,\n tooltipContent,\n tooltipTrigger,\n }\n}\n\nexport default useRender\n"],"names":["inject","TABLE_INJECTION_KEY","useNamespace","useEvents","useStyles","computed","getRowIdentity","h","isBoolean","merge","TdWrapper","isPropAbsent"],"mappings":";;;;;;;;;;;;;;AASA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,EAAE,MAAM,MAAM,GAAGA,UAAM,CAACC,0BAAmB,CAAC,CAAC;AAC7C,EAAE,MAAM,EAAE,GAAGC,kBAAY,CAAC,OAAO,CAAC,CAAC;A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CAAC,MAAM,CAAC,CAAC;AAC3F,iBAAiB;AACjB,gBAAgB,gBAAgB,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;AACvD,eAAe;AACf,aAAa;AACb,YAAY,CAAC,EAAE,CAAC;AAChB,YAAY,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC;AACpE,YAAY,IAAI,GAAG,EAAE;AACrB,cAAc,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAC/F,cAAc,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACpC,aAAa;AACb,WAAW,CAAC,CAAC;AACb,SAAS,CAAC;AACV,QAAQ,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;AAC3B,QAAQ,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAClF,QAAQ,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC7B,OAAO;AACP,MAAM,OAAO,GAAG,CAAC;AACjB,KAAK,MAAM;AACX,MAAM,OAAO,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC;AAC5C,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,gBAAgB;AACpB,IAAI,cAAc;AAClB,IAAI,cAAc;AAClB,GAAG,CAAC;AACJ;;;;"}
@@ -87,7 +87,7 @@ function useStyles(props) {
87
87
  if (shared.isArray(result)) {
88
88
  rowspan = result[0];
89
89
  colspan = result[1];
90
- } else if (typeof result === "object") {
90
+ } else if (shared.isObject(result)) {
91
91
  rowspan = result.rowspan;
92
92
  colspan = result.colspan;
93
93
  }
@@ -1 +1 @@
1
- {"version":3,"file":"styles-helper.js","sources":["../../../../../../../packages/components/table/src/table-body/styles-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport { inject } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isArray, isFunction, isString } from '@element-plus/utils'\nimport {\n ensurePosition,\n getFixedColumnOffset,\n getFixedColumnsClass,\n} from '../util'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { TableBodyProps } from './defaults'\n\nfunction useStyles<T>(props: Partial<TableBodyProps<T>>) {\n const parent = inject(TABLE_INJECTION_KEY)\n const ns = useNamespace('table')\n\n const getRowStyle = (row: T, rowIndex: number) => {\n const rowStyle = parent?.props.rowStyle\n if (isFunction(rowStyle)) {\n return rowStyle.call(null, {\n row,\n rowIndex,\n })\n }\n return rowStyle || null\n }\n\n const getRowClass = (row: T, rowIndex: number) => {\n const classes = [ns.e('row')]\n if (\n parent?.props.highlightCurrentRow &&\n row === props.store.states.currentRow.value\n ) {\n classes.push('current-row')\n }\n\n if (props.stripe && rowIndex % 2 === 1) {\n classes.push(ns.em('row', 'striped'))\n }\n const rowClassName = parent?.props.rowClassName\n if (isString(rowClassName)) {\n classes.push(rowClassName)\n } else if (isFunction(rowClassName)) {\n classes.push(\n rowClassName.call(null, {\n row,\n rowIndex,\n })\n )\n }\n return classes\n }\n\n const getCellStyle = (\n rowIndex: number,\n columnIndex: number,\n row: T,\n column: TableColumnCtx<T>\n ) => {\n const cellStyle = parent?.props.cellStyle\n let cellStyles = cellStyle ?? {}\n if (isFunction(cellStyle)) {\n cellStyles = cellStyle.call(null, {\n rowIndex,\n columnIndex,\n row,\n column,\n })\n }\n const fixedStyle = getFixedColumnOffset(\n columnIndex,\n props?.fixed,\n props.store\n )\n ensurePosition(fixedStyle, 'left')\n ensurePosition(fixedStyle, 'right')\n return Object.assign({}, cellStyles, fixedStyle)\n }\n\n const getCellClass = (\n rowIndex: number,\n columnIndex: number,\n row: T,\n column: TableColumnCtx<T>,\n offset: number\n ) => {\n const fixedClasses = getFixedColumnsClass(\n ns.b(),\n columnIndex,\n props?.fixed,\n props.store,\n undefined,\n offset\n )\n const classes = [column.id, column.align, column.className, ...fixedClasses]\n const cellClassName = parent?.props.cellClassName\n if (isString(cellClassName)) {\n classes.push(cellClassName)\n } else if (isFunction(cellClassName)) {\n classes.push(\n cellClassName.call(null, {\n rowIndex,\n columnIndex,\n row,\n column,\n })\n )\n }\n classes.push(ns.e('cell'))\n return classes.filter((className) => Boolean(className)).join(' ')\n }\n const getSpan = (\n row: T,\n column: TableColumnCtx<T>,\n rowIndex: number,\n columnIndex: number\n ) => {\n let rowspan = 1\n let colspan = 1\n const fn = parent?.props.spanMethod\n if (isFunction(fn)) {\n const result = fn({\n row,\n column,\n rowIndex,\n columnIndex,\n })\n if (isArray(result)) {\n rowspan = result[0]\n colspan = result[1]\n } else if (typeof result === 'object') {\n rowspan = result.rowspan\n colspan = result.colspan\n }\n }\n return { rowspan, colspan }\n }\n const getColspanRealWidth = (\n columns: TableColumnCtx<T>[],\n colspan: number,\n index: number\n ): number => {\n if (colspan < 1) {\n return columns[index].realWidth\n }\n const widthArr = columns\n .map(({ realWidth, width }) => realWidth || width)\n .slice(index, index + colspan)\n return Number(\n widthArr.reduce((acc, width) => Number(acc) + Number(width), -1)\n )\n }\n\n return {\n getRowStyle,\n getRowClass,\n getCellStyle,\n getCellClass,\n getSpan,\n getColspanRealWidth,\n }\n}\n\nexport default useStyles\n"],"names":["inject","TABLE_INJECTION_KEY","useNamespace","isFunction","isString","getFixedColumnOffset","ensurePosition","getFixedColumnsClass","isArray"],"mappings":";;;;;;;;;;AASA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,EAAE,MAAM,MAAM,GAAGA,UAAM,CAACC,0BAAmB,CAAC,CAAC;AAC7C,EAAE,MAAM,EAAE,GAAGC,kBAAY,CAAC,OAAO,CAAC,CAAC;AACnC,EAAE,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,QAAQ,KAA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,YAAY;AAChB,IAAI,OAAO;AACX,IAAI,mBAAmB;AACvB,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"styles-helper.js","sources":["../../../../../../../packages/components/table/src/table-body/styles-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport { inject } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isArray, isFunction, isObject, isString } from '@element-plus/utils'\nimport {\n ensurePosition,\n getFixedColumnOffset,\n getFixedColumnsClass,\n} from '../util'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport type { TableColumnCtx } from '../table-column/defaults'\nimport type { TableBodyProps } from './defaults'\n\nfunction useStyles<T>(props: Partial<TableBodyProps<T>>) {\n const parent = inject(TABLE_INJECTION_KEY)\n const ns = useNamespace('table')\n\n const getRowStyle = (row: T, rowIndex: number) => {\n const rowStyle = parent?.props.rowStyle\n if (isFunction(rowStyle)) {\n return rowStyle.call(null, {\n row,\n rowIndex,\n })\n }\n return rowStyle || null\n }\n\n const getRowClass = (row: T, rowIndex: number) => {\n const classes = [ns.e('row')]\n if (\n parent?.props.highlightCurrentRow &&\n row === props.store.states.currentRow.value\n ) {\n classes.push('current-row')\n }\n\n if (props.stripe && rowIndex % 2 === 1) {\n classes.push(ns.em('row', 'striped'))\n }\n const rowClassName = parent?.props.rowClassName\n if (isString(rowClassName)) {\n classes.push(rowClassName)\n } else if (isFunction(rowClassName)) {\n classes.push(\n rowClassName.call(null, {\n row,\n rowIndex,\n })\n )\n }\n return classes\n }\n\n const getCellStyle = (\n rowIndex: number,\n columnIndex: number,\n row: T,\n column: TableColumnCtx<T>\n ) => {\n const cellStyle = parent?.props.cellStyle\n let cellStyles = cellStyle ?? {}\n if (isFunction(cellStyle)) {\n cellStyles = cellStyle.call(null, {\n rowIndex,\n columnIndex,\n row,\n column,\n })\n }\n const fixedStyle = getFixedColumnOffset(\n columnIndex,\n props?.fixed,\n props.store\n )\n ensurePosition(fixedStyle, 'left')\n ensurePosition(fixedStyle, 'right')\n return Object.assign({}, cellStyles, fixedStyle)\n }\n\n const getCellClass = (\n rowIndex: number,\n columnIndex: number,\n row: T,\n column: TableColumnCtx<T>,\n offset: number\n ) => {\n const fixedClasses = getFixedColumnsClass(\n ns.b(),\n columnIndex,\n props?.fixed,\n props.store,\n undefined,\n offset\n )\n const classes = [column.id, column.align, column.className, ...fixedClasses]\n const cellClassName = parent?.props.cellClassName\n if (isString(cellClassName)) {\n classes.push(cellClassName)\n } else if (isFunction(cellClassName)) {\n classes.push(\n cellClassName.call(null, {\n rowIndex,\n columnIndex,\n row,\n column,\n })\n )\n }\n classes.push(ns.e('cell'))\n return classes.filter((className) => Boolean(className)).join(' ')\n }\n const getSpan = (\n row: T,\n column: TableColumnCtx<T>,\n rowIndex: number,\n columnIndex: number\n ) => {\n let rowspan = 1\n let colspan = 1\n const fn = parent?.props.spanMethod\n if (isFunction(fn)) {\n const result = fn({\n row,\n column,\n rowIndex,\n columnIndex,\n })\n if (isArray(result)) {\n rowspan = result[0]\n colspan = result[1]\n } else if (isObject(result)) {\n rowspan = result.rowspan\n colspan = result.colspan\n }\n }\n return { rowspan, colspan }\n }\n const getColspanRealWidth = (\n columns: TableColumnCtx<T>[],\n colspan: number,\n index: number\n ): number => {\n if (colspan < 1) {\n return columns[index].realWidth\n }\n const widthArr = columns\n .map(({ realWidth, width }) => realWidth || width)\n .slice(index, index + colspan)\n return Number(\n widthArr.reduce((acc, width) => Number(acc) + Number(width), -1)\n )\n }\n\n return {\n getRowStyle,\n getRowClass,\n getCellStyle,\n getCellClass,\n getSpan,\n getColspanRealWidth,\n }\n}\n\nexport default useStyles\n"],"names":["inject","TABLE_INJECTION_KEY","useNamespace","isFunction","isString","getFixedColumnOffset","ensurePosition","getFixedColumnsClass","isArray","isObject"],"mappings":";;;;;;;;;;AASA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,EAAE,MAAM,MAAM,GAAGA,UAAM,CAACC,0BAAmB,CAAC,CAAC;AAC7C,EAAE,MAAM,EAA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C;AACpF,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,WAAW;AACf,IAAI,WAAW;AACf,IAAI,YAAY;AAChB,IAAI,YAAY;AAChB,IAAI,OAAO;AACX,IAAI,mBAAmB;AACvB,GAAG,CAAC;AACJ;;;;"}
@@ -6,6 +6,7 @@ var vue = require('vue');
6
6
  var config = require('../config.js');
7
7
  var util = require('../util.js');
8
8
  var index = require('../../../../hooks/use-namespace/index.js');
9
+ var types = require('../../../../utils/types.js');
9
10
  var error = require('../../../../utils/error.js');
10
11
  var shared = require('@vue/shared');
11
12
 
@@ -53,7 +54,7 @@ function useRender(props, slots, owner) {
53
54
  if (!column.minWidth) {
54
55
  column.minWidth = 80;
55
56
  }
56
- column.realWidth = Number(column.width === void 0 ? column.minWidth : column.width);
57
+ column.realWidth = Number(types.isUndefined(column.width) ? column.minWidth : column.width);
57
58
  return column;
58
59
  };
59
60
  const setColumnForcedProps = (column) => {
@@ -61,7 +62,7 @@ function useRender(props, slots, owner) {
61
62
  const source = config.cellForced[type] || {};
62
63
  Object.keys(source).forEach((prop) => {
63
64
  const value = source[prop];
64
- if (prop !== "className" && value !== void 0) {
65
+ if (prop !== "className" && !types.isUndefined(value)) {
65
66
  column[prop] = value;
66
67
  }
67
68
  });
@@ -1 +1 @@
1
- {"version":3,"file":"render-helper.js","sources":["../../../../../../../packages/components/table/src/table-column/render-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport {\n Comment,\n computed,\n getCurrentInstance,\n h,\n ref,\n renderSlot,\n unref,\n watchEffect,\n} from 'vue'\nimport { debugWarn, isArray } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport {\n cellForced,\n defaultRenderCell,\n getDefaultClassName,\n treeCellPrefix,\n} from '../config'\nimport { parseMinWidth, parseWidth } from '../util'\nimport type { ComputedRef } from 'vue'\nimport type { TableColumn, TableColumnCtx } from './defaults'\n\nfunction useRender<T>(\n props: TableColumnCtx<T>,\n slots,\n owner: ComputedRef<any>\n) {\n const instance = getCurrentInstance() as TableColumn<T>\n const columnId = ref('')\n const isSubColumn = ref(false)\n const realAlign = ref<string>()\n const realHeaderAlign = ref<string>()\n const ns = useNamespace('table')\n watchEffect(() => {\n realAlign.value = props.align ? `is-${props.align}` : null\n // nextline help render\n realAlign.value\n })\n watchEffect(() => {\n realHeaderAlign.value = props.headerAlign\n ? `is-${props.headerAlign}`\n : realAlign.value\n // nextline help render\n realHeaderAlign.value\n })\n const columnOrTableParent = computed(() => {\n let parent: any = instance.vnode.vParent || instance.parent\n while (parent && !parent.tableId && !parent.columnId) {\n parent = parent.vnode.vParent || parent.parent\n }\n return parent\n })\n const hasTreeColumn = computed<boolean>(() => {\n const { store } = instance.parent\n if (!store) return false\n const { treeData } = store.states\n const treeDataValue = treeData.value\n return treeDataValue && Object.keys(treeDataValue).length > 0\n })\n\n const realWidth = ref(parseWidth(props.width))\n const realMinWidth = ref(parseMinWidth(props.minWidth))\n const setColumnWidth = (column: TableColumnCtx<T>) => {\n if (realWidth.value) column.width = realWidth.value\n if (realMinWidth.value) {\n column.minWidth = realMinWidth.value\n }\n if (!realWidth.value && realMinWidth.value) {\n column.width = undefined\n }\n if (!column.minWidth) {\n column.minWidth = 80\n }\n column.realWidth = Number(\n column.width === undefined ? column.minWidth : column.width\n )\n return column\n }\n const setColumnForcedProps = (column: TableColumnCtx<T>) => {\n // 对于特定类型的 column,某些属性不允许设置\n const type = column.type\n const source = cellForced[type] || {}\n Object.keys(source).forEach((prop) => {\n const value = source[prop]\n if (prop !== 'className' && value !== undefined) {\n column[prop] = value\n }\n })\n const className = getDefaultClassName(type)\n if (className) {\n const forceClass = `${unref(ns.namespace)}-${className}`\n column.className = column.className\n ? `${column.className} ${forceClass}`\n : forceClass\n }\n return column\n }\n\n const checkSubColumn = (children: TableColumn<T> | TableColumn<T>[]) => {\n if (isArray(children)) {\n children.forEach((child) => check(child))\n } else {\n check(children)\n }\n function check(item: TableColumn<T>) {\n if (item?.type?.name === 'ElTableColumn') {\n item.vParent = instance\n }\n }\n }\n const setColumnRenders = (column: TableColumnCtx<T>) => {\n // renderHeader 属性不推荐使用。\n if (props.renderHeader) {\n debugWarn(\n 'TableColumn',\n 'Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header.'\n )\n } else if (column.type !== 'selection') {\n column.renderHeader = (scope) => {\n // help render\n instance.columnConfig.value['label']\n return renderSlot(slots, 'header', scope, () => [column.label])\n }\n }\n\n if (slots['filter-icon']) {\n column.renderFilterIcon = (scope) => {\n return renderSlot(slots, 'filter-icon', scope)\n }\n }\n\n let originRenderCell = column.renderCell\n // TODO: 这里的实现调整\n if (column.type === 'expand') {\n // 对于展开行,renderCell 不允许配置的。在上一步中已经设置过,这里需要简单封装一下。\n column.renderCell = (data) =>\n h(\n 'div',\n {\n class: 'cell',\n },\n [originRenderCell(data)]\n )\n owner.value.renderExpanded = (data) => {\n return slots.default ? slots.default(data) : slots.default\n }\n } else {\n originRenderCell = originRenderCell || defaultRenderCell\n // 对 renderCell 进行包装\n column.renderCell = (data) => {\n let children = null\n if (slots.default) {\n const vnodes = slots.default(data)\n children = vnodes.some((v) => v.type !== Comment)\n ? vnodes\n : originRenderCell(data)\n } else {\n children = originRenderCell(data)\n }\n\n const { columns } = owner.value.store.states\n const firstUserColumnIndex = columns.value.findIndex(\n (item) => item.type === 'default'\n )\n const shouldCreatePlaceholder =\n hasTreeColumn.value && data.cellIndex === firstUserColumnIndex\n const prefix = treeCellPrefix(data, shouldCreatePlaceholder)\n const props = {\n class: 'cell',\n style: {},\n }\n if (column.showOverflowTooltip) {\n props.class = `${props.class} ${unref(ns.namespace)}-tooltip`\n props.style = {\n width: `${\n (data.column.realWidth || Number(data.column.width)) - 1\n }px`,\n }\n }\n checkSubColumn(children)\n return h('div', props, [prefix, children])\n }\n }\n return column\n }\n const getPropsData = (...propsKey: unknown[]) => {\n return propsKey.reduce((prev, cur) => {\n if (isArray(cur)) {\n cur.forEach((key) => {\n prev[key] = props[key]\n })\n }\n return prev\n }, {})\n }\n const getColumnElIndex = (children, child) => {\n return Array.prototype.indexOf.call(children, child)\n }\n\n const updateColumnOrder = () => {\n owner.value.store.commit('updateColumnOrder', instance.columnConfig.value)\n }\n\n return {\n columnId,\n realAlign,\n isSubColumn,\n realHeaderAlign,\n columnOrTableParent,\n setColumnWidth,\n setColumnForcedProps,\n setColumnRenders,\n getPropsData,\n getColumnElIndex,\n updateColumnOrder,\n }\n}\n\nexport default useRender\n"],"names":["getCurrentInstance","ref","useNamespace","watchEffect","computed","parseWidth","parseMinWidth","cellForced","getDefaultClassName","unref","isArray","debugWarn","renderSlot","h","defaultRenderCell","Comment","treeCellPrefix"],"mappings":";;;;;;;;;;;AAmBA,SAAS,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;AACxC,EAAE,MAAM,QAAQ,GAAGA,sBAAkB,EAAE,CAAC;AACxC,EAAE,MAAM,QAAQ,GAAGC,OAAG,CAAC,EAAE,CAAC,CAAC;AAC3B,EAAE,MAAM,WAAW,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AACjC,EAAE,MAAM,SAAS,GAAGA,OAAG,EAAE,CAAC;AAC1B,EAAE,MAAM,eAAe,GAAGA,OAAG,EAAE,CAAC;AAChC,EAAE,MAAM,EAAE,GAAGC,kBAAY,CAAC,OAAO,CAAC,CAAC;AACnC,EAAEC,eAAW,CAAC,MAAM;AACpB,IAAI,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;AAC/D,IAAI,SAAS,CAAC,KAAK,CAAC;AACpB,GAAG,CAAC,CAAC;AACL,EAAEA,eAAW,CAAC,MAAM;AACpB,IAAI,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC,WAAW,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC;AAC5F,IAAI,e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,KAAK;AACxC,IAAI,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,KAAK;AAC1C,MAAM,IAAIH,cAAO,CAAC,GAAG,CAAC,EAAE;AACxB,QAAQ,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK;AAC7B,UAAU,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AACjC,SAAS,CAAC,CAAC;AACX,OAAO;AACP,MAAM,OAAO,IAAI,CAAC;AAClB,KAAK,EAAE,EAAE,CAAC,CAAC;AACX,GAAG,CAAC;AACJ,EAAE,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,KAAK,KAAK;AAChD,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACzD,GAAG,CAAC;AACJ,EAAE,MAAM,iBAAiB,GAAG,MAAM;AAClC,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAC/E,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,QAAQ;AACZ,IAAI,SAAS;AACb,IAAI,WAAW;AACf,IAAI,eAAe;AACnB,IAAI,mBAAmB;AACvB,IAAI,cAAc;AAClB,IAAI,oBAAoB;AACxB,IAAI,gBAAgB;AACpB,IAAI,YAAY;AAChB,IAAI,gBAAgB;AACpB,IAAI,iBAAiB;AACrB,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"render-helper.js","sources":["../../../../../../../packages/components/table/src/table-column/render-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport {\n Comment,\n computed,\n getCurrentInstance,\n h,\n ref,\n renderSlot,\n unref,\n watchEffect,\n} from 'vue'\nimport { debugWarn, isArray, isUndefined } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport {\n cellForced,\n defaultRenderCell,\n getDefaultClassName,\n treeCellPrefix,\n} from '../config'\nimport { parseMinWidth, parseWidth } from '../util'\nimport type { ComputedRef } from 'vue'\nimport type { TableColumn, TableColumnCtx } from './defaults'\n\nfunction useRender<T>(\n props: TableColumnCtx<T>,\n slots,\n owner: ComputedRef<any>\n) {\n const instance = getCurrentInstance() as TableColumn<T>\n const columnId = ref('')\n const isSubColumn = ref(false)\n const realAlign = ref<string>()\n const realHeaderAlign = ref<string>()\n const ns = useNamespace('table')\n watchEffect(() => {\n realAlign.value = props.align ? `is-${props.align}` : null\n // nextline help render\n realAlign.value\n })\n watchEffect(() => {\n realHeaderAlign.value = props.headerAlign\n ? `is-${props.headerAlign}`\n : realAlign.value\n // nextline help render\n realHeaderAlign.value\n })\n const columnOrTableParent = computed(() => {\n let parent: any = instance.vnode.vParent || instance.parent\n while (parent && !parent.tableId && !parent.columnId) {\n parent = parent.vnode.vParent || parent.parent\n }\n return parent\n })\n const hasTreeColumn = computed<boolean>(() => {\n const { store } = instance.parent\n if (!store) return false\n const { treeData } = store.states\n const treeDataValue = treeData.value\n return treeDataValue && Object.keys(treeDataValue).length > 0\n })\n\n const realWidth = ref(parseWidth(props.width))\n const realMinWidth = ref(parseMinWidth(props.minWidth))\n const setColumnWidth = (column: TableColumnCtx<T>) => {\n if (realWidth.value) column.width = realWidth.value\n if (realMinWidth.value) {\n column.minWidth = realMinWidth.value\n }\n if (!realWidth.value && realMinWidth.value) {\n column.width = undefined\n }\n if (!column.minWidth) {\n column.minWidth = 80\n }\n column.realWidth = Number(\n isUndefined(column.width) ? column.minWidth : column.width\n )\n return column\n }\n const setColumnForcedProps = (column: TableColumnCtx<T>) => {\n // 对于特定类型的 column,某些属性不允许设置\n const type = column.type\n const source = cellForced[type] || {}\n Object.keys(source).forEach((prop) => {\n const value = source[prop]\n if (prop !== 'className' && !isUndefined(value)) {\n column[prop] = value\n }\n })\n const className = getDefaultClassName(type)\n if (className) {\n const forceClass = `${unref(ns.namespace)}-${className}`\n column.className = column.className\n ? `${column.className} ${forceClass}`\n : forceClass\n }\n return column\n }\n\n const checkSubColumn = (children: TableColumn<T> | TableColumn<T>[]) => {\n if (isArray(children)) {\n children.forEach((child) => check(child))\n } else {\n check(children)\n }\n function check(item: TableColumn<T>) {\n if (item?.type?.name === 'ElTableColumn') {\n item.vParent = instance\n }\n }\n }\n const setColumnRenders = (column: TableColumnCtx<T>) => {\n // renderHeader 属性不推荐使用。\n if (props.renderHeader) {\n debugWarn(\n 'TableColumn',\n 'Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header.'\n )\n } else if (column.type !== 'selection') {\n column.renderHeader = (scope) => {\n // help render\n instance.columnConfig.value['label']\n return renderSlot(slots, 'header', scope, () => [column.label])\n }\n }\n\n if (slots['filter-icon']) {\n column.renderFilterIcon = (scope) => {\n return renderSlot(slots, 'filter-icon', scope)\n }\n }\n\n let originRenderCell = column.renderCell\n // TODO: 这里的实现调整\n if (column.type === 'expand') {\n // 对于展开行,renderCell 不允许配置的。在上一步中已经设置过,这里需要简单封装一下。\n column.renderCell = (data) =>\n h(\n 'div',\n {\n class: 'cell',\n },\n [originRenderCell(data)]\n )\n owner.value.renderExpanded = (data) => {\n return slots.default ? slots.default(data) : slots.default\n }\n } else {\n originRenderCell = originRenderCell || defaultRenderCell\n // 对 renderCell 进行包装\n column.renderCell = (data) => {\n let children = null\n if (slots.default) {\n const vnodes = slots.default(data)\n children = vnodes.some((v) => v.type !== Comment)\n ? vnodes\n : originRenderCell(data)\n } else {\n children = originRenderCell(data)\n }\n\n const { columns } = owner.value.store.states\n const firstUserColumnIndex = columns.value.findIndex(\n (item) => item.type === 'default'\n )\n const shouldCreatePlaceholder =\n hasTreeColumn.value && data.cellIndex === firstUserColumnIndex\n const prefix = treeCellPrefix(data, shouldCreatePlaceholder)\n const props = {\n class: 'cell',\n style: {},\n }\n if (column.showOverflowTooltip) {\n props.class = `${props.class} ${unref(ns.namespace)}-tooltip`\n props.style = {\n width: `${\n (data.column.realWidth || Number(data.column.width)) - 1\n }px`,\n }\n }\n checkSubColumn(children)\n return h('div', props, [prefix, children])\n }\n }\n return column\n }\n const getPropsData = (...propsKey: unknown[]) => {\n return propsKey.reduce((prev, cur) => {\n if (isArray(cur)) {\n cur.forEach((key) => {\n prev[key] = props[key]\n })\n }\n return prev\n }, {})\n }\n const getColumnElIndex = (children, child) => {\n return Array.prototype.indexOf.call(children, child)\n }\n\n const updateColumnOrder = () => {\n owner.value.store.commit('updateColumnOrder', instance.columnConfig.value)\n }\n\n return {\n columnId,\n realAlign,\n isSubColumn,\n realHeaderAlign,\n columnOrTableParent,\n setColumnWidth,\n setColumnForcedProps,\n setColumnRenders,\n getPropsData,\n getColumnElIndex,\n updateColumnOrder,\n }\n}\n\nexport default useRender\n"],"names":["getCurrentInstance","ref","useNamespace","watchEffect","computed","parseWidth","parseMinWidth","isUndefined","cellForced","getDefaultClassName","unref","isArray","debugWarn","renderSlot","h","defaultRenderCell","Comment","treeCellPrefix"],"mappings":";;;;;;;;;;;;AAmBA,SAAS,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;AACxC,EAAE,MAAM,QAAQ,GAAGA,sBAAkB,EAAE,CAAC;AACxC,EAAE,MAAM,QAAQ,GAAGC,OAAG,CAAC,EAAE,CAAC,CAAC;AAC3B,EAAE,MAAM,WAAW,GAAGA,OAAG,CAAC,KAAK,CAAC,CAAC;AACjC,EAAE,MAAM,SAAS,GAAGA,OAAG,EAAE,CAAC;AAC1B,EAAE,MAAM,eAAe,GAAGA,OAAG,EAAE,CAAC;AAChC,EAAE,MAAM,EAAE,GAAGC,kBAAY,CAAC,OAAO,CAAC,CAAC;AACnC,EAAEC,eAAW,CAAC,MAAM;AACpB,IAAI,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC;AAC/D,IAAI,SAAS,CAAC,KAA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@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
+ var lodashUnified = require('lodash-unified');
6
7
  var tokens = require('../tokens.js');
7
8
  var core = require('@vueuse/core');
8
9
  var style = require('../../../../utils/dom/style.js');
@@ -153,7 +154,7 @@ function useEvent(props, emit) {
153
154
  let sortProp = states.sortProp.value;
154
155
  let sortOrder;
155
156
  const sortingColumn = states.sortingColumn.value;
156
- if (sortingColumn !== column || sortingColumn === column && sortingColumn.order === null) {
157
+ if (sortingColumn !== column || sortingColumn === column && lodashUnified.isNull(sortingColumn.order)) {
157
158
  if (sortingColumn) {
158
159
  sortingColumn.order = null;
159
160
  }
@@ -1 +1 @@
1
- {"version":3,"file":"event-helper.js","sources":["../../../../../../../packages/components/table/src/table-header/event-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport { getCurrentInstance, inject, ref } from 'vue'\nimport {\n addClass,\n hasClass,\n isClient,\n isElement,\n removeClass,\n} from '@element-plus/utils'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport type { TableHeaderProps } from '.'\nimport type { TableColumnCtx } from '../table-column/defaults'\n\nfunction useEvent<T>(props: TableHeaderProps<T>, emit) {\n const instance = getCurrentInstance()\n const parent = inject(TABLE_INJECTION_KEY)\n const handleFilterClick = (event: Event) => {\n event.stopPropagation()\n return\n }\n\n const handleHeaderClick = (event: Event, column: TableColumnCtx<T>) => {\n if (!column.filters && column.sortable) {\n handleSortClick(event, column, false)\n } else if (column.filterable && !column.sortable) {\n handleFilterClick(event)\n }\n parent?.emit('header-click', column, event)\n }\n\n const handleHeaderContextMenu = (event: Event, column: TableColumnCtx<T>) => {\n parent?.emit('header-contextmenu', column, event)\n }\n const draggingColumn = ref(null)\n const dragging = ref(false)\n const dragState = ref({})\n const handleMouseDown = (event: MouseEvent, column: TableColumnCtx<T>) => {\n if (!isClient) return\n if (column.children && column.children.length > 0) return\n /* istanbul ignore if */\n if (draggingColumn.value && props.border) {\n dragging.value = true\n\n const table = parent\n emit('set-drag-visible', true)\n const tableEl = table?.vnode.el\n const tableLeft = tableEl.getBoundingClientRect().left\n const columnEl = instance.vnode.el.querySelector(`th.${column.id}`)\n const columnRect = columnEl.getBoundingClientRect()\n const minLeft = columnRect.left - tableLeft + 30\n\n addClass(columnEl, 'noclick')\n\n dragState.value = {\n startMouseLeft: event.clientX,\n startLeft: columnRect.right - tableLeft,\n startColumnLeft: columnRect.left - tableLeft,\n tableLeft,\n }\n const resizeProxy = table?.refs.resizeProxy as HTMLElement\n resizeProxy.style.left = `${(dragState.value as any).startLeft}px`\n\n document.onselectstart = function () {\n return false\n }\n document.ondragstart = function () {\n return false\n }\n\n const handleMouseMove = (event: MouseEvent) => {\n const deltaLeft =\n event.clientX - (dragState.value as any).startMouseLeft\n const proxyLeft = (dragState.value as any).startLeft + deltaLeft\n\n resizeProxy.style.left = `${Math.max(minLeft, proxyLeft)}px`\n }\n\n const handleMouseUp = () => {\n if (dragging.value) {\n const { startColumnLeft, startLeft } = dragState.value as any\n const finalLeft = Number.parseInt(resizeProxy.style.left, 10)\n const columnWidth = finalLeft - startColumnLeft\n column.width = column.realWidth = columnWidth\n table?.emit(\n 'header-dragend',\n column.width,\n startLeft - startColumnLeft,\n column,\n event\n )\n requestAnimationFrame(() => {\n props.store.scheduleLayout(false, true)\n })\n document.body.style.cursor = ''\n dragging.value = false\n draggingColumn.value = null\n dragState.value = {}\n emit('set-drag-visible', false)\n }\n\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.onselectstart = null\n document.ondragstart = null\n\n setTimeout(() => {\n removeClass(columnEl, 'noclick')\n }, 0)\n }\n\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n }\n }\n\n const handleMouseMove = (event: MouseEvent, column: TableColumnCtx<T>) => {\n if (column.children && column.children.length > 0) return\n const el = event.target as HTMLElement\n if (!isElement(el)) {\n return\n }\n const target = el?.closest('th')\n\n if (!column || !column.resizable || !target) return\n\n if (!dragging.value && props.border) {\n const rect = target.getBoundingClientRect()\n\n const bodyStyle = document.body.style\n const isLastTh = target.parentNode?.lastElementChild === target\n if (rect.width > 12 && rect.right - event.pageX < 8 && !isLastTh) {\n bodyStyle.cursor = 'col-resize'\n if (hasClass(target, 'is-sortable')) {\n target.style.cursor = 'col-resize'\n }\n draggingColumn.value = column\n } else if (!dragging.value) {\n bodyStyle.cursor = ''\n if (hasClass(target, 'is-sortable')) {\n target.style.cursor = 'pointer'\n }\n draggingColumn.value = null\n }\n }\n }\n\n const handleMouseOut = () => {\n if (!isClient) return\n document.body.style.cursor = ''\n }\n const toggleOrder = ({ order, sortOrders }) => {\n if (order === '') return sortOrders[0]\n const index = sortOrders.indexOf(order || null)\n return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1]\n }\n const handleSortClick = (\n event: Event,\n column: TableColumnCtx<T>,\n givenOrder: string | boolean\n ) => {\n event.stopPropagation()\n const order =\n column.order === givenOrder ? null : givenOrder || toggleOrder(column)\n const target = (event.target as HTMLElement)?.closest('th')\n\n if (target) {\n if (hasClass(target, 'noclick')) {\n removeClass(target, 'noclick')\n return\n }\n }\n\n if (!column.sortable) return\n\n const clickTarget = event.currentTarget\n\n if (\n ['ascending', 'descending'].some(\n (str) => hasClass(clickTarget, str) && !column.sortOrders.includes(str)\n )\n ) {\n return\n }\n\n const states = props.store.states\n let sortProp = states.sortProp.value\n let sortOrder\n const sortingColumn = states.sortingColumn.value\n\n if (\n sortingColumn !== column ||\n (sortingColumn === column && sortingColumn.order === null)\n ) {\n if (sortingColumn) {\n sortingColumn.order = null\n }\n states.sortingColumn.value = column\n sortProp = column.property\n }\n if (!order) {\n sortOrder = column.order = null\n } else {\n sortOrder = column.order = order\n }\n\n states.sortProp.value = sortProp\n states.sortOrder.value = sortOrder\n\n parent?.store.commit('changeSortCondition')\n }\n\n return {\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n }\n}\n\nexport default useEvent\n"],"names":["getCurrentInstance","inject","TABLE_INJECTION_KEY","ref","isClient","addClass","removeClass","isElement","hasClass"],"mappings":";;;;;;;;;;AASA,SAAS,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE;AAC/B,EAAE,MAAM,QAAQ,GAAGA,sBAAkB,EAAE,CAAC;AACxC,EAAE,MAAM,MAAM,GAAGC,UAAM,CAACC,0BAAmB,CAAC,CAAC;AAC7C,EAAE,MAAM,iBAAiB,GAAG,CAAC,KAAK,KAAK;AACvC,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;AAC5B,IAAI,OAAO;AACX,GAAG,CAAC;AACJ,EAAE,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK;AAC/C,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE;AAC5C,MAAM,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC5C,KAAK,MAAM,IAAI,MAAM,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;AACtD,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACzE,GAAG,CAAC;AACJ,EAAE,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK;AACrD,IAAI,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/E,GAAG,CAAC;AACJ,EAAE,MAAM,cAAc,GAAGC,OAAG,CAAC,IAAI,CAAC,CAAC;AACnC,EAAE,MAAM,QAAQ,GAAGA,OAAG,CAAC,KAAK,CAAC,CAA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AK,CAAC;AACvC,KAAK;AACL,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC;AACrC,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC;AACvC,IAAI,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;AACzE,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,iBAAiB;AACrB,IAAI,uBAAuB;AAC3B,IAAI,eAAe;AACnB,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"event-helper.js","sources":["../../../../../../../packages/components/table/src/table-header/event-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport { getCurrentInstance, inject, ref } from 'vue'\nimport { isNull } from 'lodash-unified'\nimport {\n addClass,\n hasClass,\n isClient,\n isElement,\n removeClass,\n} from '@element-plus/utils'\nimport { TABLE_INJECTION_KEY } from '../tokens'\nimport type { TableHeaderProps } from '.'\nimport type { TableColumnCtx } from '../table-column/defaults'\n\nfunction useEvent<T>(props: TableHeaderProps<T>, emit) {\n const instance = getCurrentInstance()\n const parent = inject(TABLE_INJECTION_KEY)\n const handleFilterClick = (event: Event) => {\n event.stopPropagation()\n return\n }\n\n const handleHeaderClick = (event: Event, column: TableColumnCtx<T>) => {\n if (!column.filters && column.sortable) {\n handleSortClick(event, column, false)\n } else if (column.filterable && !column.sortable) {\n handleFilterClick(event)\n }\n parent?.emit('header-click', column, event)\n }\n\n const handleHeaderContextMenu = (event: Event, column: TableColumnCtx<T>) => {\n parent?.emit('header-contextmenu', column, event)\n }\n const draggingColumn = ref(null)\n const dragging = ref(false)\n const dragState = ref({})\n const handleMouseDown = (event: MouseEvent, column: TableColumnCtx<T>) => {\n if (!isClient) return\n if (column.children && column.children.length > 0) return\n /* istanbul ignore if */\n if (draggingColumn.value && props.border) {\n dragging.value = true\n\n const table = parent\n emit('set-drag-visible', true)\n const tableEl = table?.vnode.el\n const tableLeft = tableEl.getBoundingClientRect().left\n const columnEl = instance.vnode.el.querySelector(`th.${column.id}`)\n const columnRect = columnEl.getBoundingClientRect()\n const minLeft = columnRect.left - tableLeft + 30\n\n addClass(columnEl, 'noclick')\n\n dragState.value = {\n startMouseLeft: event.clientX,\n startLeft: columnRect.right - tableLeft,\n startColumnLeft: columnRect.left - tableLeft,\n tableLeft,\n }\n const resizeProxy = table?.refs.resizeProxy as HTMLElement\n resizeProxy.style.left = `${(dragState.value as any).startLeft}px`\n\n document.onselectstart = function () {\n return false\n }\n document.ondragstart = function () {\n return false\n }\n\n const handleMouseMove = (event: MouseEvent) => {\n const deltaLeft =\n event.clientX - (dragState.value as any).startMouseLeft\n const proxyLeft = (dragState.value as any).startLeft + deltaLeft\n\n resizeProxy.style.left = `${Math.max(minLeft, proxyLeft)}px`\n }\n\n const handleMouseUp = () => {\n if (dragging.value) {\n const { startColumnLeft, startLeft } = dragState.value as any\n const finalLeft = Number.parseInt(resizeProxy.style.left, 10)\n const columnWidth = finalLeft - startColumnLeft\n column.width = column.realWidth = columnWidth\n table?.emit(\n 'header-dragend',\n column.width,\n startLeft - startColumnLeft,\n column,\n event\n )\n requestAnimationFrame(() => {\n props.store.scheduleLayout(false, true)\n })\n document.body.style.cursor = ''\n dragging.value = false\n draggingColumn.value = null\n dragState.value = {}\n emit('set-drag-visible', false)\n }\n\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.onselectstart = null\n document.ondragstart = null\n\n setTimeout(() => {\n removeClass(columnEl, 'noclick')\n }, 0)\n }\n\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n }\n }\n\n const handleMouseMove = (event: MouseEvent, column: TableColumnCtx<T>) => {\n if (column.children && column.children.length > 0) return\n const el = event.target as HTMLElement\n if (!isElement(el)) {\n return\n }\n const target = el?.closest('th')\n\n if (!column || !column.resizable || !target) return\n\n if (!dragging.value && props.border) {\n const rect = target.getBoundingClientRect()\n\n const bodyStyle = document.body.style\n const isLastTh = target.parentNode?.lastElementChild === target\n if (rect.width > 12 && rect.right - event.pageX < 8 && !isLastTh) {\n bodyStyle.cursor = 'col-resize'\n if (hasClass(target, 'is-sortable')) {\n target.style.cursor = 'col-resize'\n }\n draggingColumn.value = column\n } else if (!dragging.value) {\n bodyStyle.cursor = ''\n if (hasClass(target, 'is-sortable')) {\n target.style.cursor = 'pointer'\n }\n draggingColumn.value = null\n }\n }\n }\n\n const handleMouseOut = () => {\n if (!isClient) return\n document.body.style.cursor = ''\n }\n const toggleOrder = ({ order, sortOrders }) => {\n if (order === '') return sortOrders[0]\n const index = sortOrders.indexOf(order || null)\n return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1]\n }\n const handleSortClick = (\n event: Event,\n column: TableColumnCtx<T>,\n givenOrder: string | boolean\n ) => {\n event.stopPropagation()\n const order =\n column.order === givenOrder ? null : givenOrder || toggleOrder(column)\n const target = (event.target as HTMLElement)?.closest('th')\n\n if (target) {\n if (hasClass(target, 'noclick')) {\n removeClass(target, 'noclick')\n return\n }\n }\n\n if (!column.sortable) return\n\n const clickTarget = event.currentTarget\n\n if (\n ['ascending', 'descending'].some(\n (str) => hasClass(clickTarget, str) && !column.sortOrders.includes(str)\n )\n ) {\n return\n }\n\n const states = props.store.states\n let sortProp = states.sortProp.value\n let sortOrder\n const sortingColumn = states.sortingColumn.value\n\n if (\n sortingColumn !== column ||\n (sortingColumn === column && isNull(sortingColumn.order))\n ) {\n if (sortingColumn) {\n sortingColumn.order = null\n }\n states.sortingColumn.value = column\n sortProp = column.property\n }\n if (!order) {\n sortOrder = column.order = null\n } else {\n sortOrder = column.order = order\n }\n\n states.sortProp.value = sortProp\n states.sortOrder.value = sortOrder\n\n parent?.store.commit('changeSortCondition')\n }\n\n return {\n handleHeaderClick,\n handleHeaderContextMenu,\n handleMouseDown,\n handleMouseMove,\n handleMouseOut,\n handleSortClick,\n handleFilterClick,\n }\n}\n\nexport default useEvent\n"],"names":["getCurrentInstance","inject","TABLE_INJECTION_KEY","ref","isClient","addClass","removeClass","isElement","hasClass","isNull"],"mappings":";;;;;;;;;;;AAUA,SAAS,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE;AAC/B,EAAE,MAAM,QAAQ,GAAGA,sBAAkB,EAAE,CAAC;AACxC,EAAE,MAAM,MAAM,GAAGC,UAAM,CAACC,0BAAmB,CAAC,CAAC;AAC7C,EAAE,MAAM,iBAAiB,GAAG,CAAC,KAAK,KAAK;AACvC,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;AAC5B,IAAI,OAAO;AACX,GAAG,CAAC;AACJ,EAAE,MAAM,iBAAiB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK;AAC/C,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE;AAC5C,MAAM,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC5C,KAAK,MAAM,IAAI,MAAM,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;AACtD,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACzE,GAAG,CAAC;AACJ,EAAE,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK;AACrD,IAAI,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/E,GAAG,CAAC;AACJ,EAAE,MAAM,cAAc,GAAGC,OAAG,CAAC,IAAI,CAAC,CAAC;AACnC,EA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AAK,MAAM;AACX,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;AACvC,KAAK;AACL,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC;AACrC,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC;AACvC,IAAI,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC;AACzE,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,iBAAiB;AACrB,IAAI,uBAAuB;AAC3B,IAAI,eAAe;AACnB,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,IAAI,eAAe;AACnB,IAAI,iBAAiB;AACrB,GAAG,CAAC;AACJ;;;;"}
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var vue = require('vue');
6
+ var lodashUnified = require('lodash-unified');
6
7
  var util = require('./util.js');
7
8
  var shared = require('@vue/shared');
8
9
  var core = require('@vueuse/core');
@@ -41,7 +42,7 @@ class TableLayout {
41
42
  }
42
43
  updateScrollY() {
43
44
  const height = this.height.value;
44
- if (height === null)
45
+ if (lodashUnified.isNull(height))
45
46
  return false;
46
47
  const scrollBarRef = this.table.refs.scrollBarRef;
47
48
  if (this.table.vnode.el && (scrollBarRef == null ? void 0 : scrollBarRef.wrapRef)) {
@@ -1 +1 @@
1
- {"version":3,"file":"table-layout.js","sources":["../../../../../../packages/components/table/src/table-layout.ts"],"sourcesContent":["// @ts-nocheck\nimport { isRef, nextTick, ref } from 'vue'\nimport { hasOwn, isClient, isNumber, isString } from '@element-plus/utils'\nimport { parseHeight } from './util'\nimport type { Ref } from 'vue'\n\nimport type { TableColumnCtx } from './table-column/defaults'\nimport type { TableHeader } from './table-header'\nimport type { Table } from './table/defaults'\nimport type { Store } from './store'\nclass TableLayout<T> {\n observers: TableHeader[]\n table: Table<T>\n store: Store<T>\n columns: TableColumnCtx<T>[]\n fit: boolean\n showHeader: boolean\n\n height: Ref<null | number>\n scrollX: Ref<boolean>\n scrollY: Ref<boolean>\n bodyWidth: Ref<null | number>\n fixedWidth: Ref<null | number>\n rightFixedWidth: Ref<null | number>\n tableHeight: Ref<null | number>\n headerHeight: Ref<null | number> // Table Header Height\n appendHeight: Ref<null | number> // Append Slot Height\n footerHeight: Ref<null | number> // Table Footer Height\n gutterWidth: number\n constructor(options: Record<string, any>) {\n this.observers = []\n this.table = null\n this.store = null\n this.columns = []\n this.fit = true\n this.showHeader = true\n this.height = ref(null)\n this.scrollX = ref(false)\n this.scrollY = ref(false)\n this.bodyWidth = ref(null)\n this.fixedWidth = ref(null)\n this.rightFixedWidth = ref(null)\n this.gutterWidth = 0\n for (const name in options) {\n if (hasOwn(options, name)) {\n if (isRef(this[name])) {\n this[name as string].value = options[name]\n } else {\n this[name as string] = options[name]\n }\n }\n }\n if (!this.table) {\n throw new Error('Table is required for Table Layout')\n }\n if (!this.store) {\n throw new Error('Store is required for Table Layout')\n }\n }\n\n updateScrollY() {\n const height = this.height.value\n /**\n * When the height is not initialized, it is null.\n * After the table is initialized, when the height is not configured, the height is 0.\n */\n if (height === null) return false\n const scrollBarRef = this.table.refs.scrollBarRef\n if (this.table.vnode.el && scrollBarRef?.wrapRef) {\n let scrollY = true\n const prevScrollY = this.scrollY.value\n scrollY =\n scrollBarRef.wrapRef.scrollHeight > scrollBarRef.wrapRef.clientHeight\n this.scrollY.value = scrollY\n return prevScrollY !== scrollY\n }\n return false\n }\n\n setHeight(value: string | number, prop = 'height') {\n if (!isClient) return\n const el = this.table.vnode.el\n value = parseHeight(value)\n this.height.value = Number(value)\n\n if (!el && (value || value === 0))\n return nextTick(() => this.setHeight(value, prop))\n\n if (isNumber(value)) {\n el.style[prop] = `${value}px`\n this.updateElsHeight()\n } else if (isString(value)) {\n el.style[prop] = value\n this.updateElsHeight()\n }\n }\n\n setMaxHeight(value: string | number) {\n this.setHeight(value, 'max-height')\n }\n\n getFlattenColumns(): TableColumnCtx<T>[] {\n const flattenColumns = []\n const columns = this.table.store.states.columns.value\n columns.forEach((column) => {\n if (column.isColumnGroup) {\n // eslint-disable-next-line prefer-spread\n flattenColumns.push.apply(flattenColumns, column.columns)\n } else {\n flattenColumns.push(column)\n }\n })\n\n return flattenColumns\n }\n\n updateElsHeight() {\n this.updateScrollY()\n this.notifyObservers('scrollable')\n }\n\n headerDisplayNone(elm: HTMLElement) {\n if (!elm) return true\n let headerChild = elm\n while (headerChild.tagName !== 'DIV') {\n if (getComputedStyle(headerChild).display === 'none') {\n return true\n }\n headerChild = headerChild.parentElement\n }\n return false\n }\n\n updateColumnsWidth() {\n if (!isClient) return\n const fit = this.fit\n const bodyWidth = this.table.vnode.el.clientWidth\n let bodyMinWidth = 0\n\n const flattenColumns = this.getFlattenColumns()\n const flexColumns = flattenColumns.filter(\n (column) => !isNumber(column.width)\n )\n flattenColumns.forEach((column) => {\n // Clean those columns whose width changed from flex to unflex\n if (isNumber(column.width) && column.realWidth) column.realWidth = null\n })\n if (flexColumns.length > 0 && fit) {\n flattenColumns.forEach((column) => {\n bodyMinWidth += Number(column.width || column.minWidth || 80)\n })\n if (bodyMinWidth <= bodyWidth) {\n // DON'T HAVE SCROLL BAR\n this.scrollX.value = false\n\n const totalFlexWidth = bodyWidth - bodyMinWidth\n\n if (flexColumns.length === 1) {\n flexColumns[0].realWidth =\n Number(flexColumns[0].minWidth || 80) + totalFlexWidth\n } else {\n const allColumnsWidth = flexColumns.reduce(\n (prev, column) => prev + Number(column.minWidth || 80),\n 0\n )\n const flexWidthPerPixel = totalFlexWidth / allColumnsWidth\n let noneFirstWidth = 0\n\n flexColumns.forEach((column, index) => {\n if (index === 0) return\n const flexWidth = Math.floor(\n Number(column.minWidth || 80) * flexWidthPerPixel\n )\n noneFirstWidth += flexWidth\n column.realWidth = Number(column.minWidth || 80) + flexWidth\n })\n\n flexColumns[0].realWidth =\n Number(flexColumns[0].minWidth || 80) +\n totalFlexWidth -\n noneFirstWidth\n }\n } else {\n // HAVE HORIZONTAL SCROLL BAR\n this.scrollX.value = true\n flexColumns.forEach((column) => {\n column.realWidth = Number(column.minWidth)\n })\n }\n\n this.bodyWidth.value = Math.max(bodyMinWidth, bodyWidth)\n this.table.state.resizeState.value.width = this.bodyWidth.value\n } else {\n flattenColumns.forEach((column) => {\n if (!column.width && !column.minWidth) {\n column.realWidth = 80\n } else {\n column.realWidth = Number(column.width || column.minWidth)\n }\n bodyMinWidth += column.realWidth\n })\n this.scrollX.value = bodyMinWidth > bodyWidth\n\n this.bodyWidth.value = bodyMinWidth\n }\n\n const fixedColumns = this.store.states.fixedColumns.value\n\n if (fixedColumns.length > 0) {\n let fixedWidth = 0\n fixedColumns.forEach((column) => {\n fixedWidth += Number(column.realWidth || column.width)\n })\n\n this.fixedWidth.value = fixedWidth\n }\n\n const rightFixedColumns = this.store.states.rightFixedColumns.value\n if (rightFixedColumns.length > 0) {\n let rightFixedWidth = 0\n rightFixedColumns.forEach((column) => {\n rightFixedWidth += Number(column.realWidth || column.width)\n })\n\n this.rightFixedWidth.value = rightFixedWidth\n }\n this.notifyObservers('columns')\n }\n\n addObserver(observer: TableHeader) {\n this.observers.push(observer)\n }\n\n removeObserver(observer: TableHeader) {\n const index = this.observers.indexOf(observer)\n if (index !== -1) {\n this.observers.splice(index, 1)\n }\n }\n\n notifyObservers(event: string) {\n const observers = this.observers\n observers.forEach((observer) => {\n switch (event) {\n case 'columns':\n observer.state?.onColumnsChange(this)\n break\n case 'scrollable':\n observer.state?.onScrollableChange(this)\n break\n default:\n throw new Error(`Table Layout don't have event ${event}.`)\n }\n })\n }\n}\n\nexport default TableLayout\n"],"names":["ref","hasOwn","isRef","isClient","parseHeight","nextTick","isNumber","isString"],"mappings":";;;;;;;;;;AAGA,MAAM,WAAW,CAAC;AAClB,EAAE,WAAW,CAAC,OAAO,EAAE;AACvB,IAAI,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;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AAS,GAAG,IAAI,CAAC,SAAS,CAAC;AACrC,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAK;AACpC,MAAM,IAAI,EAAE,EAAE,EAAE,CAAC;AACjB,MAAM,QAAQ,KAAK;AACnB,QAAQ,KAAK,SAAS;AACtB,UAAU,CAAC,EAAE,GAAG,QAAQ,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AAC5E,UAAU,MAAM;AAChB,QAAQ,KAAK,YAAY;AACzB,UAAU,CAAC,EAAE,GAAG,QAAQ,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC/E,UAAU,MAAM;AAChB,QAAQ;AACR,UAAU,MAAM,IAAI,KAAK,CAAC,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACrE,OAAO;AACP,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"table-layout.js","sources":["../../../../../../packages/components/table/src/table-layout.ts"],"sourcesContent":["// @ts-nocheck\nimport { isRef, nextTick, ref } from 'vue'\nimport { isNull } from 'lodash-unified'\nimport { hasOwn, isClient, isNumber, isString } from '@element-plus/utils'\nimport { parseHeight } from './util'\n\nimport type { Ref } from 'vue'\nimport type { TableColumnCtx } from './table-column/defaults'\nimport type { TableHeader } from './table-header'\nimport type { Table } from './table/defaults'\nimport type { Store } from './store'\nclass TableLayout<T> {\n observers: TableHeader[]\n table: Table<T>\n store: Store<T>\n columns: TableColumnCtx<T>[]\n fit: boolean\n showHeader: boolean\n\n height: Ref<null | number>\n scrollX: Ref<boolean>\n scrollY: Ref<boolean>\n bodyWidth: Ref<null | number>\n fixedWidth: Ref<null | number>\n rightFixedWidth: Ref<null | number>\n tableHeight: Ref<null | number>\n headerHeight: Ref<null | number> // Table Header Height\n appendHeight: Ref<null | number> // Append Slot Height\n footerHeight: Ref<null | number> // Table Footer Height\n gutterWidth: number\n constructor(options: Record<string, any>) {\n this.observers = []\n this.table = null\n this.store = null\n this.columns = []\n this.fit = true\n this.showHeader = true\n this.height = ref(null)\n this.scrollX = ref(false)\n this.scrollY = ref(false)\n this.bodyWidth = ref(null)\n this.fixedWidth = ref(null)\n this.rightFixedWidth = ref(null)\n this.gutterWidth = 0\n for (const name in options) {\n if (hasOwn(options, name)) {\n if (isRef(this[name])) {\n this[name as string].value = options[name]\n } else {\n this[name as string] = options[name]\n }\n }\n }\n if (!this.table) {\n throw new Error('Table is required for Table Layout')\n }\n if (!this.store) {\n throw new Error('Store is required for Table Layout')\n }\n }\n\n updateScrollY() {\n const height = this.height.value\n /**\n * When the height is not initialized, it is null.\n * After the table is initialized, when the height is not configured, the height is 0.\n */\n if (isNull(height)) return false\n const scrollBarRef = this.table.refs.scrollBarRef\n if (this.table.vnode.el && scrollBarRef?.wrapRef) {\n let scrollY = true\n const prevScrollY = this.scrollY.value\n scrollY =\n scrollBarRef.wrapRef.scrollHeight > scrollBarRef.wrapRef.clientHeight\n this.scrollY.value = scrollY\n return prevScrollY !== scrollY\n }\n return false\n }\n\n setHeight(value: string | number, prop = 'height') {\n if (!isClient) return\n const el = this.table.vnode.el\n value = parseHeight(value)\n this.height.value = Number(value)\n\n if (!el && (value || value === 0))\n return nextTick(() => this.setHeight(value, prop))\n\n if (isNumber(value)) {\n el.style[prop] = `${value}px`\n this.updateElsHeight()\n } else if (isString(value)) {\n el.style[prop] = value\n this.updateElsHeight()\n }\n }\n\n setMaxHeight(value: string | number) {\n this.setHeight(value, 'max-height')\n }\n\n getFlattenColumns(): TableColumnCtx<T>[] {\n const flattenColumns = []\n const columns = this.table.store.states.columns.value\n columns.forEach((column) => {\n if (column.isColumnGroup) {\n // eslint-disable-next-line prefer-spread\n flattenColumns.push.apply(flattenColumns, column.columns)\n } else {\n flattenColumns.push(column)\n }\n })\n\n return flattenColumns\n }\n\n updateElsHeight() {\n this.updateScrollY()\n this.notifyObservers('scrollable')\n }\n\n headerDisplayNone(elm: HTMLElement) {\n if (!elm) return true\n let headerChild = elm\n while (headerChild.tagName !== 'DIV') {\n if (getComputedStyle(headerChild).display === 'none') {\n return true\n }\n headerChild = headerChild.parentElement\n }\n return false\n }\n\n updateColumnsWidth() {\n if (!isClient) return\n const fit = this.fit\n const bodyWidth = this.table.vnode.el.clientWidth\n let bodyMinWidth = 0\n\n const flattenColumns = this.getFlattenColumns()\n const flexColumns = flattenColumns.filter(\n (column) => !isNumber(column.width)\n )\n flattenColumns.forEach((column) => {\n // Clean those columns whose width changed from flex to unflex\n if (isNumber(column.width) && column.realWidth) column.realWidth = null\n })\n if (flexColumns.length > 0 && fit) {\n flattenColumns.forEach((column) => {\n bodyMinWidth += Number(column.width || column.minWidth || 80)\n })\n if (bodyMinWidth <= bodyWidth) {\n // DON'T HAVE SCROLL BAR\n this.scrollX.value = false\n\n const totalFlexWidth = bodyWidth - bodyMinWidth\n\n if (flexColumns.length === 1) {\n flexColumns[0].realWidth =\n Number(flexColumns[0].minWidth || 80) + totalFlexWidth\n } else {\n const allColumnsWidth = flexColumns.reduce(\n (prev, column) => prev + Number(column.minWidth || 80),\n 0\n )\n const flexWidthPerPixel = totalFlexWidth / allColumnsWidth\n let noneFirstWidth = 0\n\n flexColumns.forEach((column, index) => {\n if (index === 0) return\n const flexWidth = Math.floor(\n Number(column.minWidth || 80) * flexWidthPerPixel\n )\n noneFirstWidth += flexWidth\n column.realWidth = Number(column.minWidth || 80) + flexWidth\n })\n\n flexColumns[0].realWidth =\n Number(flexColumns[0].minWidth || 80) +\n totalFlexWidth -\n noneFirstWidth\n }\n } else {\n // HAVE HORIZONTAL SCROLL BAR\n this.scrollX.value = true\n flexColumns.forEach((column) => {\n column.realWidth = Number(column.minWidth)\n })\n }\n\n this.bodyWidth.value = Math.max(bodyMinWidth, bodyWidth)\n this.table.state.resizeState.value.width = this.bodyWidth.value\n } else {\n flattenColumns.forEach((column) => {\n if (!column.width && !column.minWidth) {\n column.realWidth = 80\n } else {\n column.realWidth = Number(column.width || column.minWidth)\n }\n bodyMinWidth += column.realWidth\n })\n this.scrollX.value = bodyMinWidth > bodyWidth\n\n this.bodyWidth.value = bodyMinWidth\n }\n\n const fixedColumns = this.store.states.fixedColumns.value\n\n if (fixedColumns.length > 0) {\n let fixedWidth = 0\n fixedColumns.forEach((column) => {\n fixedWidth += Number(column.realWidth || column.width)\n })\n\n this.fixedWidth.value = fixedWidth\n }\n\n const rightFixedColumns = this.store.states.rightFixedColumns.value\n if (rightFixedColumns.length > 0) {\n let rightFixedWidth = 0\n rightFixedColumns.forEach((column) => {\n rightFixedWidth += Number(column.realWidth || column.width)\n })\n\n this.rightFixedWidth.value = rightFixedWidth\n }\n this.notifyObservers('columns')\n }\n\n addObserver(observer: TableHeader) {\n this.observers.push(observer)\n }\n\n removeObserver(observer: TableHeader) {\n const index = this.observers.indexOf(observer)\n if (index !== -1) {\n this.observers.splice(index, 1)\n }\n }\n\n notifyObservers(event: string) {\n const observers = this.observers\n observers.forEach((observer) => {\n switch (event) {\n case 'columns':\n observer.state?.onColumnsChange(this)\n break\n case 'scrollable':\n observer.state?.onScrollableChange(this)\n break\n default:\n throw new Error(`Table Layout don't have event ${event}.`)\n }\n })\n }\n}\n\nexport default TableLayout\n"],"names":["ref","hasOwn","isRef","isNull","isClient","parseHeight","nextTick","isNumber","isString"],"mappings":";;;;;;;;;;;AAIA,MAAM,WAAW,CAAC;AAClB,EAAE,WAAW,CAAC,OAAO,EAAE;AACvB,IAAI,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;AACxB,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;AACtB,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;AACtB,IAAI,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;AACtB,IAAI,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;AACpB,IAAI,IAAI,CAAC,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AAG,QAAQ,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AAC5E,UAAU,MAAM;AAChB,QAAQ,KAAK,YAAY;AACzB,UAAU,CAAC,EAAE,GAAG,QAAQ,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC/E,UAAU,MAAM;AAChB,QAAQ;AACR,UAAU,MAAM,IAAI,KAAK,CAAC,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACrE,OAAO;AACP,KAAK,CAAC,CAAC;AACP,GAAG;AACH;;;;"}
@@ -131,7 +131,7 @@ function mergeOptions(defaults, config) {
131
131
  for (key in config) {
132
132
  if (shared.hasOwn(config, key)) {
133
133
  const value = config[key];
134
- if (typeof value !== "undefined") {
134
+ if (!types.isUndefined(value)) {
135
135
  options[key] = value;
136
136
  }
137
137
  }
@@ -141,7 +141,7 @@ function mergeOptions(defaults, config) {
141
141
  function parseWidth(width) {
142
142
  if (width === "")
143
143
  return width;
144
- if (width !== void 0) {
144
+ if (!types.isUndefined(width)) {
145
145
  width = Number.parseInt(width, 10);
146
146
  if (Number.isNaN(width)) {
147
147
  width = "";
@@ -152,7 +152,7 @@ function parseWidth(width) {
152
152
  function parseMinWidth(minWidth) {
153
153
  if (minWidth === "")
154
154
  return minWidth;
155
- if (minWidth !== void 0) {
155
+ if (!types.isUndefined(minWidth)) {
156
156
  minWidth = parseWidth(minWidth);
157
157
  if (Number.isNaN(minWidth)) {
158
158
  minWidth = 80;
@@ -357,7 +357,7 @@ const getFixedColumnsClass = (namespace, index, fixed, store, realColumns, offse
357
357
  return classes;
358
358
  };
359
359
  function getOffset(offset, column) {
360
- return offset + (column.realWidth === null || Number.isNaN(column.realWidth) ? Number(column.width) : column.realWidth);
360
+ return offset + (lodashUnified.isNull(column.realWidth) || Number.isNaN(column.realWidth) ? Number(column.width) : column.realWidth);
361
361
  }
362
362
  const getFixedColumnOffset = (index, fixed, store, realColumns) => {
363
363
  const {