@element-plus/nightly 0.0.20241220 → 0.0.20241222

Sign up to get free protection for your applications and to get access to all the features.
Files changed (662) 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/anchor/index.mjs +1 -1
  252. package/es/components/anchor/src/anchor-link.mjs +5 -81
  253. package/es/components/anchor/src/anchor-link.mjs.map +1 -1
  254. package/es/components/anchor/src/anchor-link2.mjs +81 -5
  255. package/es/components/anchor/src/anchor-link2.mjs.map +1 -1
  256. package/es/components/autocomplete/index.mjs +2 -2
  257. package/es/components/autocomplete/src/autocomplete.mjs +364 -79
  258. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  259. package/es/components/autocomplete/src/autocomplete2.mjs +79 -364
  260. package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
  261. package/es/components/badge/index.mjs +2 -2
  262. package/es/components/badge/src/badge.mjs +32 -71
  263. package/es/components/badge/src/badge.mjs.map +1 -1
  264. package/es/components/badge/src/badge2.mjs +71 -32
  265. package/es/components/badge/src/badge2.mjs.map +1 -1
  266. package/es/components/breadcrumb/index.mjs +4 -4
  267. package/es/components/breadcrumb/src/breadcrumb-item.mjs +8 -56
  268. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  269. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +56 -8
  270. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  271. package/es/components/breadcrumb/src/breadcrumb.mjs +37 -10
  272. package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
  273. package/es/components/breadcrumb/src/breadcrumb2.mjs +10 -37
  274. package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
  275. package/es/components/carousel/index.mjs +2 -2
  276. package/es/components/carousel/src/carousel-item.mjs +7 -69
  277. package/es/components/carousel/src/carousel-item.mjs.map +1 -1
  278. package/es/components/carousel/src/carousel-item2.mjs +69 -7
  279. package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
  280. package/es/components/cascader/src/cascader.mjs +1 -1
  281. package/es/components/collapse/index.mjs +2 -2
  282. package/es/components/collapse/src/collapse.mjs +16 -28
  283. package/es/components/collapse/src/collapse.mjs.map +1 -1
  284. package/es/components/collapse/src/collapse2.mjs +28 -16
  285. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  286. package/es/components/color-picker/src/color-picker.mjs +1 -1
  287. package/es/components/descriptions/src/description2.mjs +1 -1
  288. package/es/components/descriptions/src/descriptions-row.mjs +63 -6
  289. package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
  290. package/es/components/descriptions/src/descriptions-row2.mjs +6 -63
  291. package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
  292. package/es/components/dialog/index.mjs +2 -2
  293. package/es/components/dialog/src/dialog.mjs +64 -168
  294. package/es/components/dialog/src/dialog.mjs.map +1 -1
  295. package/es/components/dialog/src/dialog2.mjs +168 -64
  296. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  297. package/es/components/drawer/src/drawer.mjs +1 -1
  298. package/es/components/dropdown/index.mjs +2 -2
  299. package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
  300. package/es/components/dropdown/src/dropdown-item.mjs +1 -1
  301. package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
  302. package/es/components/dropdown/src/dropdown.mjs +102 -298
  303. package/es/components/dropdown/src/dropdown.mjs.map +1 -1
  304. package/es/components/dropdown/src/dropdown2.mjs +298 -102
  305. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  306. package/es/components/form/index.mjs +2 -2
  307. package/es/components/form/src/form.mjs +53 -151
  308. package/es/components/form/src/form.mjs.map +1 -1
  309. package/es/components/form/src/form2.mjs +151 -53
  310. package/es/components/form/src/form2.mjs.map +1 -1
  311. package/es/components/image/index.mjs +2 -2
  312. package/es/components/image/src/image.mjs +64 -232
  313. package/es/components/image/src/image.mjs.map +1 -1
  314. package/es/components/image/src/image2.mjs +232 -64
  315. package/es/components/image/src/image2.mjs.map +1 -1
  316. package/es/components/image-viewer/index.mjs +2 -2
  317. package/es/components/image-viewer/src/image-viewer.mjs +412 -45
  318. package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
  319. package/es/components/image-viewer/src/image-viewer2.mjs +45 -412
  320. package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
  321. package/es/components/index.mjs +27 -27
  322. package/es/components/input/index.mjs +2 -2
  323. package/es/components/input/src/input.mjs +102 -431
  324. package/es/components/input/src/input.mjs.map +1 -1
  325. package/es/components/input/src/input2.mjs +431 -102
  326. package/es/components/input/src/input2.mjs.map +1 -1
  327. package/es/components/input-tag/index.mjs +2 -2
  328. package/es/components/input-tag/src/input-tag.mjs +65 -215
  329. package/es/components/input-tag/src/input-tag.mjs.map +1 -1
  330. package/es/components/input-tag/src/input-tag2.mjs +215 -65
  331. package/es/components/input-tag/src/input-tag2.mjs.map +1 -1
  332. package/es/components/mention/index.mjs +2 -2
  333. package/es/components/mention/src/mention-dropdown.mjs +15 -166
  334. package/es/components/mention/src/mention-dropdown.mjs.map +1 -1
  335. package/es/components/mention/src/mention-dropdown2.mjs +166 -15
  336. package/es/components/mention/src/mention-dropdown2.mjs.map +1 -1
  337. package/es/components/mention/src/mention.mjs +63 -283
  338. package/es/components/mention/src/mention.mjs.map +1 -1
  339. package/es/components/mention/src/mention2.mjs +283 -63
  340. package/es/components/mention/src/mention2.mjs.map +1 -1
  341. package/es/components/menu/index.mjs +2 -2
  342. package/es/components/menu/src/menu-item-group.mjs +4 -34
  343. package/es/components/menu/src/menu-item-group.mjs.map +1 -1
  344. package/es/components/menu/src/menu-item-group2.mjs +34 -4
  345. package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
  346. package/es/components/message/index.mjs +1 -1
  347. package/es/components/message/src/message.mjs +91 -145
  348. package/es/components/message/src/message.mjs.map +1 -1
  349. package/es/components/message/src/message2.mjs +145 -91
  350. package/es/components/message/src/message2.mjs.map +1 -1
  351. package/es/components/message/src/method.mjs +2 -2
  352. package/es/components/pagination/src/components/jumper.mjs +58 -7
  353. package/es/components/pagination/src/components/jumper.mjs.map +1 -1
  354. package/es/components/pagination/src/components/jumper2.mjs +7 -58
  355. package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
  356. package/es/components/pagination/src/components/sizes.mjs +71 -23
  357. package/es/components/pagination/src/components/sizes.mjs.map +1 -1
  358. package/es/components/pagination/src/components/sizes2.mjs +23 -71
  359. package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
  360. package/es/components/pagination/src/components/total.mjs +6 -26
  361. package/es/components/pagination/src/components/total.mjs.map +1 -1
  362. package/es/components/pagination/src/components/total2.mjs +26 -6
  363. package/es/components/pagination/src/components/total2.mjs.map +1 -1
  364. package/es/components/pagination/src/pagination.mjs +3 -3
  365. package/es/components/popconfirm/src/popconfirm.mjs +1 -1
  366. package/es/components/popover/index.mjs +2 -2
  367. package/es/components/popover/src/popover.mjs +110 -64
  368. package/es/components/popover/src/popover.mjs.map +1 -1
  369. package/es/components/popover/src/popover2.mjs +64 -110
  370. package/es/components/popover/src/popover2.mjs.map +1 -1
  371. package/es/components/popper/index.mjs +2 -2
  372. package/es/components/popper/src/trigger.mjs +127 -31
  373. package/es/components/popper/src/trigger.mjs.map +1 -1
  374. package/es/components/popper/src/trigger2.mjs +31 -127
  375. package/es/components/popper/src/trigger2.mjs.map +1 -1
  376. package/es/components/progress/index.mjs +2 -2
  377. package/es/components/progress/src/progress.mjs +53 -207
  378. package/es/components/progress/src/progress.mjs.map +1 -1
  379. package/es/components/progress/src/progress2.mjs +207 -53
  380. package/es/components/progress/src/progress2.mjs.map +1 -1
  381. package/es/components/radio/index.mjs +2 -2
  382. package/es/components/radio/src/radio-group.mjs +65 -34
  383. package/es/components/radio/src/radio-group.mjs.map +1 -1
  384. package/es/components/radio/src/radio-group2.mjs +34 -65
  385. package/es/components/radio/src/radio-group2.mjs.map +1 -1
  386. package/es/components/rate/index.mjs +2 -2
  387. package/es/components/rate/src/rate.mjs +258 -83
  388. package/es/components/rate/src/rate.mjs.map +1 -1
  389. package/es/components/rate/src/rate2.mjs +83 -258
  390. package/es/components/rate/src/rate2.mjs.map +1 -1
  391. package/es/components/scrollbar/index.mjs +2 -2
  392. package/es/components/scrollbar/src/scrollbar.mjs +170 -55
  393. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  394. package/es/components/scrollbar/src/scrollbar2.mjs +55 -170
  395. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  396. package/es/components/select/src/select.mjs +1 -1
  397. package/es/components/select-v2/src/defaults.mjs +1 -1
  398. package/es/components/skeleton/index.mjs +2 -2
  399. package/es/components/skeleton/src/skeleton-item.mjs +22 -17
  400. package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
  401. package/es/components/skeleton/src/skeleton-item2.mjs +17 -22
  402. package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
  403. package/es/components/skeleton/src/skeleton2.mjs +1 -1
  404. package/es/components/slider/src/button.mjs +19 -89
  405. package/es/components/slider/src/button.mjs.map +1 -1
  406. package/es/components/slider/src/button2.mjs +89 -19
  407. package/es/components/slider/src/button2.mjs.map +1 -1
  408. package/es/components/slider/src/slider2.mjs +1 -1
  409. package/es/components/table/src/filter-panel.mjs +5 -3
  410. package/es/components/table/src/filter-panel.mjs.map +1 -1
  411. package/es/components/table/src/filter-panel.vue.d.ts +1 -0
  412. package/es/components/table/src/h-helper.mjs +2 -1
  413. package/es/components/table/src/h-helper.mjs.map +1 -1
  414. package/es/components/table/src/store/current.mjs +2 -1
  415. package/es/components/table/src/store/current.mjs.map +1 -1
  416. package/es/components/table/src/store/helper.mjs +2 -1
  417. package/es/components/table/src/store/helper.mjs.map +1 -1
  418. package/es/components/table/src/store/index.mjs +2 -1
  419. package/es/components/table/src/store/index.mjs.map +1 -1
  420. package/es/components/table/src/table-body/render-helper.mjs +2 -2
  421. package/es/components/table/src/table-body/render-helper.mjs.map +1 -1
  422. package/es/components/table/src/table-body/styles-helper.mjs +2 -2
  423. package/es/components/table/src/table-body/styles-helper.mjs.map +1 -1
  424. package/es/components/table/src/table-column/render-helper.mjs +3 -2
  425. package/es/components/table/src/table-column/render-helper.mjs.map +1 -1
  426. package/es/components/table/src/table-header/event-helper.mjs +2 -1
  427. package/es/components/table/src/table-header/event-helper.mjs.map +1 -1
  428. package/es/components/table/src/table-layout.mjs +2 -1
  429. package/es/components/table/src/table-layout.mjs.map +1 -1
  430. package/es/components/table/src/util.mjs +6 -6
  431. package/es/components/table/src/util.mjs.map +1 -1
  432. package/es/components/time-select/index.mjs +2 -2
  433. package/es/components/time-select/src/time-select.mjs +50 -123
  434. package/es/components/time-select/src/time-select.mjs.map +1 -1
  435. package/es/components/time-select/src/time-select2.mjs +123 -50
  436. package/es/components/time-select/src/time-select2.mjs.map +1 -1
  437. package/es/components/tooltip/index.mjs +1 -1
  438. package/es/components/tooltip/src/content.mjs +28 -183
  439. package/es/components/tooltip/src/content.mjs.map +1 -1
  440. package/es/components/tooltip/src/content2.mjs +183 -28
  441. package/es/components/tooltip/src/content2.mjs.map +1 -1
  442. package/es/components/tooltip/src/tooltip.mjs +1 -1
  443. package/es/components/tooltip/src/tooltip2.mjs +1 -1
  444. package/es/components/tooltip/src/trigger.mjs +1 -1
  445. package/es/components/tooltip/src/trigger2.mjs +1 -1
  446. package/es/components/upload/index.mjs +1 -1
  447. package/es/components/upload/src/upload-content2.mjs +1 -1
  448. package/es/components/upload/src/upload-dragger.mjs +47 -10
  449. package/es/components/upload/src/upload-dragger.mjs.map +1 -1
  450. package/es/components/upload/src/upload-dragger2.mjs +10 -47
  451. package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
  452. package/es/index.mjs +27 -27
  453. package/es/version.d.ts +1 -1
  454. package/es/version.mjs +1 -1
  455. package/es/version.mjs.map +1 -1
  456. package/lib/components/anchor/index.js +1 -1
  457. package/lib/components/anchor/src/anchor-link.js +5 -81
  458. package/lib/components/anchor/src/anchor-link.js.map +1 -1
  459. package/lib/components/anchor/src/anchor-link2.js +81 -5
  460. package/lib/components/anchor/src/anchor-link2.js.map +1 -1
  461. package/lib/components/autocomplete/index.js +2 -2
  462. package/lib/components/autocomplete/src/autocomplete.js +363 -79
  463. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  464. package/lib/components/autocomplete/src/autocomplete2.js +79 -363
  465. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  466. package/lib/components/badge/index.js +2 -2
  467. package/lib/components/badge/src/badge.js +32 -71
  468. package/lib/components/badge/src/badge.js.map +1 -1
  469. package/lib/components/badge/src/badge2.js +71 -32
  470. package/lib/components/badge/src/badge2.js.map +1 -1
  471. package/lib/components/breadcrumb/index.js +4 -4
  472. package/lib/components/breadcrumb/src/breadcrumb-item.js +8 -56
  473. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  474. package/lib/components/breadcrumb/src/breadcrumb-item2.js +56 -8
  475. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  476. package/lib/components/breadcrumb/src/breadcrumb.js +37 -10
  477. package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
  478. package/lib/components/breadcrumb/src/breadcrumb2.js +10 -37
  479. package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
  480. package/lib/components/carousel/index.js +2 -2
  481. package/lib/components/carousel/src/carousel-item.js +7 -69
  482. package/lib/components/carousel/src/carousel-item.js.map +1 -1
  483. package/lib/components/carousel/src/carousel-item2.js +69 -7
  484. package/lib/components/carousel/src/carousel-item2.js.map +1 -1
  485. package/lib/components/cascader/src/cascader.js +1 -1
  486. package/lib/components/collapse/index.js +2 -2
  487. package/lib/components/collapse/src/collapse.js +18 -28
  488. package/lib/components/collapse/src/collapse.js.map +1 -1
  489. package/lib/components/collapse/src/collapse2.js +28 -18
  490. package/lib/components/collapse/src/collapse2.js.map +1 -1
  491. package/lib/components/color-picker/src/color-picker.js +1 -1
  492. package/lib/components/descriptions/src/description2.js +1 -1
  493. package/lib/components/descriptions/src/descriptions-row.js +63 -6
  494. package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
  495. package/lib/components/descriptions/src/descriptions-row2.js +6 -63
  496. package/lib/components/descriptions/src/descriptions-row2.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/drawer/src/drawer.js +1 -1
  503. package/lib/components/dropdown/index.js +2 -2
  504. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
  505. package/lib/components/dropdown/src/dropdown-item.js +1 -1
  506. package/lib/components/dropdown/src/dropdown-menu.js +1 -1
  507. package/lib/components/dropdown/src/dropdown.js +111 -298
  508. package/lib/components/dropdown/src/dropdown.js.map +1 -1
  509. package/lib/components/dropdown/src/dropdown2.js +298 -111
  510. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  511. package/lib/components/form/index.js +2 -2
  512. package/lib/components/form/src/form.js +54 -150
  513. package/lib/components/form/src/form.js.map +1 -1
  514. package/lib/components/form/src/form2.js +150 -54
  515. package/lib/components/form/src/form2.js.map +1 -1
  516. package/lib/components/image/index.js +2 -2
  517. package/lib/components/image/src/image.js +64 -231
  518. package/lib/components/image/src/image.js.map +1 -1
  519. package/lib/components/image/src/image2.js +231 -64
  520. package/lib/components/image/src/image2.js.map +1 -1
  521. package/lib/components/image-viewer/index.js +2 -2
  522. package/lib/components/image-viewer/src/image-viewer.js +412 -46
  523. package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
  524. package/lib/components/image-viewer/src/image-viewer2.js +46 -412
  525. package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
  526. package/lib/components/index.js +27 -27
  527. package/lib/components/input/index.js +2 -2
  528. package/lib/components/input/src/input.js +102 -430
  529. package/lib/components/input/src/input.js.map +1 -1
  530. package/lib/components/input/src/input2.js +430 -102
  531. package/lib/components/input/src/input2.js.map +1 -1
  532. package/lib/components/input-tag/index.js +2 -2
  533. package/lib/components/input-tag/src/input-tag.js +65 -214
  534. package/lib/components/input-tag/src/input-tag.js.map +1 -1
  535. package/lib/components/input-tag/src/input-tag2.js +214 -65
  536. package/lib/components/input-tag/src/input-tag2.js.map +1 -1
  537. package/lib/components/mention/index.js +2 -2
  538. package/lib/components/mention/src/mention-dropdown.js +16 -166
  539. package/lib/components/mention/src/mention-dropdown.js.map +1 -1
  540. package/lib/components/mention/src/mention-dropdown2.js +166 -16
  541. package/lib/components/mention/src/mention-dropdown2.js.map +1 -1
  542. package/lib/components/mention/src/mention.js +62 -281
  543. package/lib/components/mention/src/mention.js.map +1 -1
  544. package/lib/components/mention/src/mention2.js +281 -62
  545. package/lib/components/mention/src/mention2.js.map +1 -1
  546. package/lib/components/menu/index.js +2 -2
  547. package/lib/components/menu/src/menu-item-group.js +4 -34
  548. package/lib/components/menu/src/menu-item-group.js.map +1 -1
  549. package/lib/components/menu/src/menu-item-group2.js +34 -4
  550. package/lib/components/menu/src/menu-item-group2.js.map +1 -1
  551. package/lib/components/message/index.js +1 -1
  552. package/lib/components/message/src/message.js +93 -144
  553. package/lib/components/message/src/message.js.map +1 -1
  554. package/lib/components/message/src/message2.js +144 -93
  555. package/lib/components/message/src/message2.js.map +1 -1
  556. package/lib/components/message/src/method.js +2 -2
  557. package/lib/components/pagination/src/components/jumper.js +58 -7
  558. package/lib/components/pagination/src/components/jumper.js.map +1 -1
  559. package/lib/components/pagination/src/components/jumper2.js +7 -58
  560. package/lib/components/pagination/src/components/jumper2.js.map +1 -1
  561. package/lib/components/pagination/src/components/sizes.js +71 -23
  562. package/lib/components/pagination/src/components/sizes.js.map +1 -1
  563. package/lib/components/pagination/src/components/sizes2.js +23 -71
  564. package/lib/components/pagination/src/components/sizes2.js.map +1 -1
  565. package/lib/components/pagination/src/components/total.js +6 -26
  566. package/lib/components/pagination/src/components/total.js.map +1 -1
  567. package/lib/components/pagination/src/components/total2.js +26 -6
  568. package/lib/components/pagination/src/components/total2.js.map +1 -1
  569. package/lib/components/pagination/src/pagination.js +3 -3
  570. package/lib/components/popconfirm/src/popconfirm.js +1 -1
  571. package/lib/components/popover/index.js +2 -2
  572. package/lib/components/popover/src/popover.js +110 -65
  573. package/lib/components/popover/src/popover.js.map +1 -1
  574. package/lib/components/popover/src/popover2.js +65 -110
  575. package/lib/components/popover/src/popover2.js.map +1 -1
  576. package/lib/components/popper/index.js +2 -2
  577. package/lib/components/popper/src/trigger.js +127 -32
  578. package/lib/components/popper/src/trigger.js.map +1 -1
  579. package/lib/components/popper/src/trigger2.js +32 -127
  580. package/lib/components/popper/src/trigger2.js.map +1 -1
  581. package/lib/components/progress/index.js +2 -2
  582. package/lib/components/progress/src/progress.js +53 -207
  583. package/lib/components/progress/src/progress.js.map +1 -1
  584. package/lib/components/progress/src/progress2.js +207 -53
  585. package/lib/components/progress/src/progress2.js.map +1 -1
  586. package/lib/components/radio/index.js +2 -2
  587. package/lib/components/radio/src/radio-group.js +65 -35
  588. package/lib/components/radio/src/radio-group.js.map +1 -1
  589. package/lib/components/radio/src/radio-group2.js +35 -65
  590. package/lib/components/radio/src/radio-group2.js.map +1 -1
  591. package/lib/components/rate/index.js +2 -2
  592. package/lib/components/rate/src/rate.js +257 -83
  593. package/lib/components/rate/src/rate.js.map +1 -1
  594. package/lib/components/rate/src/rate2.js +83 -257
  595. package/lib/components/rate/src/rate2.js.map +1 -1
  596. package/lib/components/scrollbar/index.js +2 -2
  597. package/lib/components/scrollbar/src/scrollbar.js +170 -56
  598. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  599. package/lib/components/scrollbar/src/scrollbar2.js +56 -170
  600. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  601. package/lib/components/select/src/select.js +1 -1
  602. package/lib/components/select-v2/src/defaults.js +1 -1
  603. package/lib/components/skeleton/index.js +2 -2
  604. package/lib/components/skeleton/src/skeleton-item.js +22 -17
  605. package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
  606. package/lib/components/skeleton/src/skeleton-item2.js +17 -22
  607. package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
  608. package/lib/components/skeleton/src/skeleton2.js +1 -1
  609. package/lib/components/slider/src/button.js +20 -89
  610. package/lib/components/slider/src/button.js.map +1 -1
  611. package/lib/components/slider/src/button2.js +89 -20
  612. package/lib/components/slider/src/button2.js.map +1 -1
  613. package/lib/components/slider/src/slider2.js +1 -1
  614. package/lib/components/table/src/filter-panel.js +5 -3
  615. package/lib/components/table/src/filter-panel.js.map +1 -1
  616. package/lib/components/table/src/filter-panel.vue.d.ts +1 -0
  617. package/lib/components/table/src/h-helper.js +2 -1
  618. package/lib/components/table/src/h-helper.js.map +1 -1
  619. package/lib/components/table/src/store/current.js +2 -1
  620. package/lib/components/table/src/store/current.js.map +1 -1
  621. package/lib/components/table/src/store/helper.js +2 -1
  622. package/lib/components/table/src/store/helper.js.map +1 -1
  623. package/lib/components/table/src/store/index.js +2 -1
  624. package/lib/components/table/src/store/index.js.map +1 -1
  625. package/lib/components/table/src/table-body/render-helper.js +1 -1
  626. package/lib/components/table/src/table-body/render-helper.js.map +1 -1
  627. package/lib/components/table/src/table-body/styles-helper.js +1 -1
  628. package/lib/components/table/src/table-body/styles-helper.js.map +1 -1
  629. package/lib/components/table/src/table-column/render-helper.js +3 -2
  630. package/lib/components/table/src/table-column/render-helper.js.map +1 -1
  631. package/lib/components/table/src/table-header/event-helper.js +2 -1
  632. package/lib/components/table/src/table-header/event-helper.js.map +1 -1
  633. package/lib/components/table/src/table-layout.js +2 -1
  634. package/lib/components/table/src/table-layout.js.map +1 -1
  635. package/lib/components/table/src/util.js +4 -4
  636. package/lib/components/table/src/util.js.map +1 -1
  637. package/lib/components/time-select/index.js +2 -2
  638. package/lib/components/time-select/src/time-select.js +50 -128
  639. package/lib/components/time-select/src/time-select.js.map +1 -1
  640. package/lib/components/time-select/src/time-select2.js +128 -50
  641. package/lib/components/time-select/src/time-select2.js.map +1 -1
  642. package/lib/components/tooltip/index.js +1 -1
  643. package/lib/components/tooltip/src/content.js +28 -183
  644. package/lib/components/tooltip/src/content.js.map +1 -1
  645. package/lib/components/tooltip/src/content2.js +183 -28
  646. package/lib/components/tooltip/src/content2.js.map +1 -1
  647. package/lib/components/tooltip/src/tooltip.js +1 -1
  648. package/lib/components/tooltip/src/tooltip2.js +1 -1
  649. package/lib/components/tooltip/src/trigger.js +1 -1
  650. package/lib/components/tooltip/src/trigger2.js +1 -1
  651. package/lib/components/upload/index.js +1 -1
  652. package/lib/components/upload/src/upload-content2.js +1 -1
  653. package/lib/components/upload/src/upload-dragger.js +47 -11
  654. package/lib/components/upload/src/upload-dragger.js.map +1 -1
  655. package/lib/components/upload/src/upload-dragger2.js +11 -47
  656. package/lib/components/upload/src/upload-dragger2.js.map +1 -1
  657. package/lib/index.js +27 -27
  658. package/lib/version.d.ts +1 -1
  659. package/lib/version.js +1 -1
  660. package/lib/version.js.map +1 -1
  661. package/package.json +2 -2
  662. package/web-types.json +1 -1
@@ -1,24 +1,94 @@
1
- import { placements } from '@popperjs/core';
2
- import { buildProps } from '../../../utils/vue/props/runtime.mjs';
3
- import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
4
- import { isNumber } from '../../../utils/types.mjs';
1
+ import { defineComponent, reactive, toRefs, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, createVNode, withCtx, createElementVNode, toDisplayString } from 'vue';
2
+ import { ElTooltip } from '../../tooltip/index.mjs';
3
+ import { sliderButtonProps, sliderButtonEmits } from './button.mjs';
4
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
5
+ import { useSliderButton } from './composables/use-slider-button.mjs';
6
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
5
7
 
6
- const sliderButtonProps = buildProps({
7
- modelValue: {
8
- type: Number,
9
- default: 0
10
- },
11
- vertical: Boolean,
12
- tooltipClass: String,
13
- placement: {
14
- type: String,
15
- values: placements,
16
- default: "top"
8
+ const __default__ = defineComponent({
9
+ name: "ElSliderButton"
10
+ });
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ ...__default__,
13
+ props: sliderButtonProps,
14
+ emits: sliderButtonEmits,
15
+ setup(__props, { expose, emit }) {
16
+ const props = __props;
17
+ const ns = useNamespace("slider");
18
+ const initData = reactive({
19
+ hovering: false,
20
+ dragging: false,
21
+ isClick: false,
22
+ startX: 0,
23
+ currentX: 0,
24
+ startY: 0,
25
+ currentY: 0,
26
+ startPosition: 0,
27
+ newPosition: 0,
28
+ oldValue: props.modelValue
29
+ });
30
+ const {
31
+ disabled,
32
+ button,
33
+ tooltip,
34
+ showTooltip,
35
+ tooltipVisible,
36
+ wrapperStyle,
37
+ formatValue,
38
+ handleMouseEnter,
39
+ handleMouseLeave,
40
+ onButtonDown,
41
+ onKeyDown,
42
+ setPosition
43
+ } = useSliderButton(props, initData, emit);
44
+ const { hovering, dragging } = toRefs(initData);
45
+ expose({
46
+ onButtonDown,
47
+ onKeyDown,
48
+ setPosition,
49
+ hovering,
50
+ dragging
51
+ });
52
+ return (_ctx, _cache) => {
53
+ return openBlock(), createElementBlock("div", {
54
+ ref_key: "button",
55
+ ref: button,
56
+ class: normalizeClass([unref(ns).e("button-wrapper"), { hover: unref(hovering), dragging: unref(dragging) }]),
57
+ style: normalizeStyle(unref(wrapperStyle)),
58
+ tabindex: unref(disabled) ? -1 : 0,
59
+ onMouseenter: unref(handleMouseEnter),
60
+ onMouseleave: unref(handleMouseLeave),
61
+ onMousedown: unref(onButtonDown),
62
+ onFocus: unref(handleMouseEnter),
63
+ onBlur: unref(handleMouseLeave),
64
+ onKeydown: unref(onKeyDown)
65
+ }, [
66
+ createVNode(unref(ElTooltip), {
67
+ ref_key: "tooltip",
68
+ ref: tooltip,
69
+ visible: unref(tooltipVisible),
70
+ placement: _ctx.placement,
71
+ "fallback-placements": ["top", "bottom", "right", "left"],
72
+ "stop-popper-mouse-event": false,
73
+ "popper-class": _ctx.tooltipClass,
74
+ disabled: !unref(showTooltip),
75
+ persistent: unref(showTooltip)
76
+ }, {
77
+ content: withCtx(() => [
78
+ createElementVNode("span", null, toDisplayString(unref(formatValue)), 1)
79
+ ]),
80
+ default: withCtx(() => [
81
+ createElementVNode("div", {
82
+ class: normalizeClass([unref(ns).e("button"), { hover: unref(hovering), dragging: unref(dragging) }])
83
+ }, null, 2)
84
+ ]),
85
+ _: 1
86
+ }, 8, ["visible", "placement", "popper-class", "disabled", "persistent"])
87
+ ], 46, ["tabindex", "onMouseenter", "onMouseleave", "onMousedown", "onFocus", "onBlur", "onKeydown"]);
88
+ };
17
89
  }
18
90
  });
19
- const sliderButtonEmits = {
20
- [UPDATE_MODEL_EVENT]: (value) => isNumber(value)
21
- };
91
+ var SliderButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "button.vue"]]);
22
92
 
23
- export { sliderButtonEmits, sliderButtonProps };
93
+ export { SliderButton as default };
24
94
  //# sourceMappingURL=button2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"button2.mjs","sources":["../../../../../../packages/components/slider/src/button.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport { buildProps, isNumber } from '@element-plus/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport type { ComponentPublicInstance, ExtractPropTypes, Ref } from 'vue'\nimport type Button from './button.vue'\n\nexport const sliderButtonProps = buildProps({\n modelValue: {\n type: Number,\n default: 0,\n },\n vertical: Boolean,\n tooltipClass: String,\n placement: {\n type: String,\n values: placements,\n default: 'top',\n },\n} as const)\nexport type SliderButtonProps = ExtractPropTypes<typeof sliderButtonProps>\n\nexport const sliderButtonEmits = {\n [UPDATE_MODEL_EVENT]: (value: number) => isNumber(value),\n}\nexport type SliderButtonEmits = typeof sliderButtonEmits\n\nexport type SliderButtonInstance = ComponentPublicInstance<typeof Button>\n\nexport type ButtonRefs = Record<\n 'firstButton' | 'secondButton',\n Ref<SliderButtonInstance | undefined>\n>\n\nexport interface SliderButtonInitData {\n hovering: boolean\n dragging: boolean\n isClick: boolean\n startX: number\n currentX: number\n startY: number\n currentY: number\n startPosition: number\n newPosition: number\n oldValue: number\n}\n"],"names":[],"mappings":";;;;;AAGY,MAAC,iBAAiB,GAAG,UAAU,CAAC;AAC5C,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,YAAY,EAAE,MAAM;AACtB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,UAAU;AACtB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,iBAAiB,GAAG;AACjC,EAAE,CAAC,kBAAkB,GAAG,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK,CAAC;AAClD;;;;"}
1
+ {"version":3,"file":"button2.mjs","sources":["../../../../../../packages/components/slider/src/button.vue"],"sourcesContent":["<template>\n <div\n ref=\"button\"\n :class=\"[ns.e('button-wrapper'), { hover: hovering, dragging }]\"\n :style=\"wrapperStyle\"\n :tabindex=\"disabled ? -1 : 0\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n @mousedown=\"onButtonDown\"\n @focus=\"handleMouseEnter\"\n @blur=\"handleMouseLeave\"\n @keydown=\"onKeyDown\"\n >\n <el-tooltip\n ref=\"tooltip\"\n :visible=\"tooltipVisible\"\n :placement=\"placement\"\n :fallback-placements=\"['top', 'bottom', 'right', 'left']\"\n :stop-popper-mouse-event=\"false\"\n :popper-class=\"tooltipClass\"\n :disabled=\"!showTooltip\"\n :persistent=\"showTooltip\"\n >\n <template #content>\n <span>{{ formatValue }}</span>\n </template>\n <div :class=\"[ns.e('button'), { hover: hovering, dragging }]\" />\n </el-tooltip>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { reactive, toRefs } from 'vue'\nimport { ElTooltip } from '@element-plus/components/tooltip'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useSliderButton } from './composables'\nimport { sliderButtonEmits, sliderButtonProps } from './button'\nimport type { SliderButtonInitData } from './button'\n\ndefineOptions({\n name: 'ElSliderButton',\n})\n\nconst props = defineProps(sliderButtonProps)\nconst emit = defineEmits(sliderButtonEmits)\n\nconst ns = useNamespace('slider')\n\nconst initData = reactive<SliderButtonInitData>({\n hovering: false,\n dragging: false,\n isClick: false,\n startX: 0,\n currentX: 0,\n startY: 0,\n currentY: 0,\n startPosition: 0,\n newPosition: 0,\n oldValue: props.modelValue,\n})\n\nconst {\n disabled,\n button,\n tooltip,\n showTooltip,\n tooltipVisible,\n wrapperStyle,\n formatValue,\n handleMouseEnter,\n handleMouseLeave,\n onButtonDown,\n onKeyDown,\n setPosition,\n} = useSliderButton(props, initData, emit)\n\nconst { hovering, dragging } = toRefs(initData)\n\ndefineExpose({\n onButtonDown,\n onKeyDown,\n setPosition,\n hovering,\n dragging,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;mCAuCc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAEhC,IAAA,MAAM,WAAW,QAA+B,CAAA;AAAA,MAC9C,QAAU,EAAA,KAAA;AAAA,MACV,QAAU,EAAA,KAAA;AAAA,MACV,OAAS,EAAA,KAAA;AAAA,MACT,MAAQ,EAAA,CAAA;AAAA,MACR,QAAU,EAAA,CAAA;AAAA,MACV,MAAQ,EAAA,CAAA;AAAA,MACR,QAAU,EAAA,CAAA;AAAA,MACV,aAAe,EAAA,CAAA;AAAA,MACf,WAAa,EAAA,CAAA;AAAA,MACb,UAAU,KAAM,CAAA,UAAA;AAAA,KACjB,CAAA,CAAA;AAED,IAAM,MAAA;AAAA,MACJ,QAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,WAAA;AAAA,MACA,cAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,MACA,gBAAA;AAAA,MACA,gBAAA;AAAA,MACA,YAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA;AAAA,KACE,GAAA,eAAA,CAAgB,KAAO,EAAA,QAAA,EAAU,IAAI,CAAA,CAAA;AAEzC,IAAA,MAAM,EAAE,QAAA,EAAU,QAAS,EAAA,GAAI,OAAO,QAAQ,CAAA,CAAA;AAE9C,IAAa,MAAA,CAAA;AAAA,MACX,YAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,7 +3,7 @@ import { useEventListener } from '@vueuse/core';
3
3
  import { ElInputNumber } from '../../input-number/index.mjs';
4
4
  import { sliderContextKey } from './constants.mjs';
5
5
  import { sliderProps, sliderEmits } from './slider.mjs';
6
- import SliderButton from './button.mjs';
6
+ import SliderButton from './button2.mjs';
7
7
  import SliderMarker from './marker.mjs';
8
8
  import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
9
9
  import { useSlide } from './composables/use-slide.mjs';
@@ -8,6 +8,7 @@ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
8
8
  import ClickOutside from '../../../directives/click-outside/index.mjs';
9
9
  import { useLocale } from '../../../hooks/use-locale/index.mjs';
10
10
  import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
11
+ import { isPropAbsent } from '../../../utils/types.mjs';
11
12
 
12
13
  const { CheckboxGroup: ElCheckboxGroup } = ElCheckbox;
13
14
  const _sfc_main = defineComponent({
@@ -66,7 +67,7 @@ const _sfc_main = defineComponent({
66
67
  },
67
68
  set: (value) => {
68
69
  if (filteredValue.value) {
69
- if (typeof value !== "undefined" && value !== null) {
70
+ if (!isPropAbsent(value)) {
70
71
  filteredValue.value.splice(0, 1, value);
71
72
  } else {
72
73
  filteredValue.value.splice(0, 1);
@@ -117,7 +118,7 @@ const _sfc_main = defineComponent({
117
118
  };
118
119
  const handleSelect = (_filterValue) => {
119
120
  filterValue.value = _filterValue;
120
- if (typeof _filterValue !== "undefined" && _filterValue !== null) {
121
+ if (!isPropAbsent(_filterValue)) {
121
122
  confirmFilter(filteredValue.value);
122
123
  } else {
123
124
  confirmFilter([]);
@@ -152,6 +153,7 @@ const _sfc_main = defineComponent({
152
153
  handleConfirm,
153
154
  handleReset,
154
155
  handleSelect,
156
+ isPropAbsent,
155
157
  isActive,
156
158
  t,
157
159
  ns,
@@ -240,7 +242,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
240
242
  class: normalizeClass([
241
243
  _ctx.ns.e("list-item"),
242
244
  {
243
- [_ctx.ns.is("active")]: _ctx.filterValue === void 0 || _ctx.filterValue === null
245
+ [_ctx.ns.is("active")]: _ctx.isPropAbsent(_ctx.filterValue)
244
246
  }
245
247
  ]),
246
248
  onClick: ($event) => _ctx.handleSelect(null)
@@ -1 +1 @@
1
- {"version":3,"file":"filter-panel.mjs","sources":["../../../../../../packages/components/table/src/filter-panel.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltip\"\n :visible=\"tooltipVisible\"\n :offset=\"0\"\n :placement=\"placement\"\n :show-arrow=\"false\"\n :stop-popper-mouse-event=\"false\"\n teleported\n effect=\"light\"\n pure\n :popper-class=\"filterClassName\"\n persistent\n :append-to=\"appendTo\"\n >\n <template #content>\n <div v-if=\"multiple\">\n <div :class=\"ns.e('content')\">\n <el-scrollbar :wrap-class=\"ns.e('wrap')\">\n <el-checkbox-group\n v-model=\"filteredValue\"\n :class=\"ns.e('checkbox-group')\"\n >\n <el-checkbox\n v-for=\"filter in filters\"\n :key=\"filter.value\"\n :value=\"filter.value\"\n >\n {{ filter.text }}\n </el-checkbox>\n </el-checkbox-group>\n </el-scrollbar>\n </div>\n <div :class=\"ns.e('bottom')\">\n <button\n :class=\"{ [ns.is('disabled')]: filteredValue.length === 0 }\"\n :disabled=\"filteredValue.length === 0\"\n type=\"button\"\n @click=\"handleConfirm\"\n >\n {{ t('el.table.confirmFilter') }}\n </button>\n <button type=\"button\" @click=\"handleReset\">\n {{ t('el.table.resetFilter') }}\n </button>\n </div>\n </div>\n <ul v-else :class=\"ns.e('list')\">\n <li\n :class=\"[\n ns.e('list-item'),\n {\n [ns.is('active')]:\n filterValue === undefined || filterValue === null,\n },\n ]\"\n @click=\"handleSelect(null)\"\n >\n {{ t('el.table.clearFilter') }}\n </li>\n <li\n v-for=\"filter in filters\"\n :key=\"filter.value\"\n :class=\"[ns.e('list-item'), ns.is('active', isActive(filter))]\"\n :label=\"filter.value\"\n @click=\"handleSelect(filter.value)\"\n >\n {{ filter.text }}\n </li>\n </ul>\n </template>\n <template #default>\n <span\n v-click-outside:[popperPaneRef]=\"hideFilterPanel\"\n :class=\"[\n `${ns.namespace.value}-table__column-filter-trigger`,\n `${ns.namespace.value}-none-outline`,\n ]\"\n @click=\"showFilterPanel\"\n >\n <el-icon>\n <slot name=\"filter-icon\">\n <arrow-up v-if=\"column.filterOpened\" />\n <arrow-down v-else />\n </slot>\n </el-icon>\n </span>\n </template>\n </el-tooltip>\n</template>\n\n<script lang=\"ts\">\n// @ts-nocheck\nimport { computed, defineComponent, getCurrentInstance, ref, watch } from 'vue'\nimport ElCheckbox from '@element-plus/components/checkbox'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ArrowDown, ArrowUp } from '@element-plus/icons-vue'\nimport { ClickOutside } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport ElScrollbar from '@element-plus/components/scrollbar'\nimport type { Placement } from '@element-plus/components/popper'\n\nimport type { PropType, WritableComputedRef } from 'vue'\nimport type { TableColumnCtx } from './table-column/defaults'\nimport type { TableHeader } from './table-header'\nimport type { Store } from './store'\n\nconst { CheckboxGroup: ElCheckboxGroup } = ElCheckbox\n\nexport default defineComponent({\n name: 'ElTableFilterPanel',\n components: {\n ElCheckbox,\n ElCheckboxGroup,\n ElScrollbar,\n ElTooltip,\n ElIcon,\n ArrowDown,\n ArrowUp,\n },\n directives: { ClickOutside },\n props: {\n placement: {\n type: String as PropType<Placement>,\n default: 'bottom-start',\n },\n store: {\n type: Object as PropType<Store<unknown>>,\n },\n column: {\n type: Object as PropType<TableColumnCtx<unknown>>,\n },\n upDataColumn: {\n type: Function,\n },\n appendTo: {\n type: String,\n },\n },\n setup(props) {\n const instance = getCurrentInstance()\n const { t } = useLocale()\n const ns = useNamespace('table-filter')\n const parent = instance?.parent as TableHeader\n if (!parent.filterPanels.value[props.column.id]) {\n parent.filterPanels.value[props.column.id] = instance\n }\n const tooltipVisible = ref(false)\n const tooltip = ref<InstanceType<typeof ElTooltip> | null>(null)\n const filters = computed(() => {\n return props.column && props.column.filters\n })\n const filterClassName = computed(() => {\n if (props.column.filterClassName) {\n return `${ns.b()} ${props.column.filterClassName}`\n }\n return ns.b()\n })\n const filterValue = computed({\n get: () => (props.column?.filteredValue || [])[0],\n set: (value: string) => {\n if (filteredValue.value) {\n if (typeof value !== 'undefined' && value !== null) {\n filteredValue.value.splice(0, 1, value)\n } else {\n filteredValue.value.splice(0, 1)\n }\n }\n },\n })\n const filteredValue: WritableComputedRef<unknown[]> = computed({\n get() {\n if (props.column) {\n return props.column.filteredValue || []\n }\n return []\n },\n set(value: unknown[]) {\n if (props.column) {\n props.upDataColumn('filteredValue', value)\n }\n },\n })\n const multiple = computed(() => {\n if (props.column) {\n return props.column.filterMultiple\n }\n return true\n })\n const isActive = (filter) => {\n return filter.value === filterValue.value\n }\n const hidden = () => {\n tooltipVisible.value = false\n }\n const showFilterPanel = (e: MouseEvent) => {\n e.stopPropagation()\n tooltipVisible.value = !tooltipVisible.value\n }\n const hideFilterPanel = () => {\n tooltipVisible.value = false\n }\n const handleConfirm = () => {\n confirmFilter(filteredValue.value)\n hidden()\n }\n const handleReset = () => {\n filteredValue.value = []\n confirmFilter(filteredValue.value)\n hidden()\n }\n const handleSelect = (_filterValue?: string) => {\n filterValue.value = _filterValue\n if (typeof _filterValue !== 'undefined' && _filterValue !== null) {\n confirmFilter(filteredValue.value)\n } else {\n confirmFilter([])\n }\n hidden()\n }\n const confirmFilter = (filteredValue: unknown[]) => {\n props.store.commit('filterChange', {\n column: props.column,\n values: filteredValue,\n })\n props.store.updateAllSelected()\n }\n watch(\n tooltipVisible,\n (value) => {\n // todo\n if (props.column) {\n props.upDataColumn('filterOpened', value)\n }\n },\n {\n immediate: true,\n }\n )\n\n const popperPaneRef = computed(() => {\n return tooltip.value?.popperRef?.contentRef\n })\n\n return {\n tooltipVisible,\n multiple,\n filterClassName,\n filteredValue,\n filterValue,\n filters,\n handleConfirm,\n handleReset,\n handleSelect,\n isActive,\n t,\n ns,\n showFilterPanel,\n hideFilterPanel,\n popperPaneRef,\n tooltip,\n }\n },\n})\n</script>\n"],"names":["filteredValue","_createBlock","_withCtx","_createElementBlock","_createElementVNode","_normalizeClass","_createVNode","_openBlock","_Fragment","_renderList","_createTextVNode","_toDisplayString","_renderSlot"],"mappings":";;;;;;;;;;;AA4GA,MAAM,EAAE,aAAe,EAAA,eAAA,EAAoB,GAAA,UAAA,CAAA;AAE3C,MAAK,YAAa,eAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,oBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,UAAA;AAAA,IACA,eAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,GACF;AAAA,EACA,UAAA,EAAY,EAAE,YAAa,EAAA;AAAA,EAC3B,KAAO,EAAA;AAAA,IACL,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MAAA;AAAA,MACN,OAAS,EAAA,cAAA;AAAA,KACX;AAAA,IACA,KAAO,EAAA;AAAA,MACL,IAAM,EAAA,MAAA;AAAA,KACR;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,MAAA;AAAA,KACR;AAAA,IACA,YAAc,EAAA;AAAA,MACZ,IAAM,EAAA,QAAA;AAAA,KACR;AAAA,IACA,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,MAAA;AAAA,KACR;AAAA,GACF;AAAA,EACA,MAAM,KAAO,EAAA;AACX,IAAA,MAAM,WAAW,kBAAmB,EAAA,CAAA;AACpC,IAAM,MAAA,EAAE,CAAE,EAAA,GAAI,SAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAK,aAAa,cAAc,CAAA,CAAA;AACtC,IAAA,MAAM,SAAS,QAAU,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,QAAA,CAAA,MAAA,CAAA;AACzB,IAAA,IAAI,CAAC,MAAO,CAAA,Y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sBK,CAAA,EAAA,IAAA,CAAA,EAAA,CAAA,SAAA,CAAA,KAAA,CAAA,6BAAA,CAAA;AAAA,UAAA,CAAA,EAAA,IAAA,CAAA,EAAA,CAAA,SAAA,CAAA,KAAA,CAAA,aAAA,CAAA;AAAA,SAAA,CAAA;eAtBY,EAAA,IAAA,CAAA;AAAM,OAAA,EAAA;;UACrB,OAWK,EAAAH,OAAA,CAAA,MAAA;AAAA,YAVFU,UAAK,CAAA,IAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,EAAA,MAAA;AAAA,cAAgB,WAAI,CAAA,YAAA,IAAAL,SAAA,EAAA,EAAAN,WAAA,CAAA,mBAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA,KAAAM,SAAA,EAAA,EAAAN,WAAA,CAAA,qBAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA,CAAA;AAAA,aAAA,CAAA;AAA4C,WAAA,CAAA;AAA0E,UAAA,CAAA,EAAA,CAAA;;AAO/I,OAAA,EAAA,EAAA,EAAA,CAAA;AAAmB,QAAA,CAAA,wBAEhB,EAAA,IAAA,CAAA,eAAA,EAAA,IAAA,CAAA,aAAA,CAAA;AAAA,OAEN,CAAA;AAAA,KAQK,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA,GAPc,EAAA,CAAA,EAAA,CAAA,SAAA,EAAA,WAAA,EAAA,cAAJ,EAAA,WAAA,CAAA,CAAA,CAAA;;AACA,kBACZ,2BAAW,CAAA,qBAAgB,EAAG,WAAa,CAAA,EAAA,CAAA,QAAA,EAAA,kBAAe,CAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"filter-panel.mjs","sources":["../../../../../../packages/components/table/src/filter-panel.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltip\"\n :visible=\"tooltipVisible\"\n :offset=\"0\"\n :placement=\"placement\"\n :show-arrow=\"false\"\n :stop-popper-mouse-event=\"false\"\n teleported\n effect=\"light\"\n pure\n :popper-class=\"filterClassName\"\n persistent\n :append-to=\"appendTo\"\n >\n <template #content>\n <div v-if=\"multiple\">\n <div :class=\"ns.e('content')\">\n <el-scrollbar :wrap-class=\"ns.e('wrap')\">\n <el-checkbox-group\n v-model=\"filteredValue\"\n :class=\"ns.e('checkbox-group')\"\n >\n <el-checkbox\n v-for=\"filter in filters\"\n :key=\"filter.value\"\n :value=\"filter.value\"\n >\n {{ filter.text }}\n </el-checkbox>\n </el-checkbox-group>\n </el-scrollbar>\n </div>\n <div :class=\"ns.e('bottom')\">\n <button\n :class=\"{ [ns.is('disabled')]: filteredValue.length === 0 }\"\n :disabled=\"filteredValue.length === 0\"\n type=\"button\"\n @click=\"handleConfirm\"\n >\n {{ t('el.table.confirmFilter') }}\n </button>\n <button type=\"button\" @click=\"handleReset\">\n {{ t('el.table.resetFilter') }}\n </button>\n </div>\n </div>\n <ul v-else :class=\"ns.e('list')\">\n <li\n :class=\"[\n ns.e('list-item'),\n {\n [ns.is('active')]: isPropAbsent(filterValue),\n },\n ]\"\n @click=\"handleSelect(null)\"\n >\n {{ t('el.table.clearFilter') }}\n </li>\n <li\n v-for=\"filter in filters\"\n :key=\"filter.value\"\n :class=\"[ns.e('list-item'), ns.is('active', isActive(filter))]\"\n :label=\"filter.value\"\n @click=\"handleSelect(filter.value)\"\n >\n {{ filter.text }}\n </li>\n </ul>\n </template>\n <template #default>\n <span\n v-click-outside:[popperPaneRef]=\"hideFilterPanel\"\n :class=\"[\n `${ns.namespace.value}-table__column-filter-trigger`,\n `${ns.namespace.value}-none-outline`,\n ]\"\n @click=\"showFilterPanel\"\n >\n <el-icon>\n <slot name=\"filter-icon\">\n <arrow-up v-if=\"column.filterOpened\" />\n <arrow-down v-else />\n </slot>\n </el-icon>\n </span>\n </template>\n </el-tooltip>\n</template>\n\n<script lang=\"ts\">\n// @ts-nocheck\nimport { computed, defineComponent, getCurrentInstance, ref, watch } from 'vue'\nimport ElCheckbox from '@element-plus/components/checkbox'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { ArrowDown, ArrowUp } from '@element-plus/icons-vue'\nimport { ClickOutside } from '@element-plus/directives'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport ElScrollbar from '@element-plus/components/scrollbar'\nimport { isPropAbsent } from '@element-plus/utils'\n\nimport type { Placement } from '@element-plus/components/popper'\nimport type { PropType, WritableComputedRef } from 'vue'\nimport type { TableColumnCtx } from './table-column/defaults'\nimport type { TableHeader } from './table-header'\nimport type { Store } from './store'\n\nconst { CheckboxGroup: ElCheckboxGroup } = ElCheckbox\n\nexport default defineComponent({\n name: 'ElTableFilterPanel',\n components: {\n ElCheckbox,\n ElCheckboxGroup,\n ElScrollbar,\n ElTooltip,\n ElIcon,\n ArrowDown,\n ArrowUp,\n },\n directives: { ClickOutside },\n props: {\n placement: {\n type: String as PropType<Placement>,\n default: 'bottom-start',\n },\n store: {\n type: Object as PropType<Store<unknown>>,\n },\n column: {\n type: Object as PropType<TableColumnCtx<unknown>>,\n },\n upDataColumn: {\n type: Function,\n },\n appendTo: {\n type: String,\n },\n },\n setup(props) {\n const instance = getCurrentInstance()\n const { t } = useLocale()\n const ns = useNamespace('table-filter')\n const parent = instance?.parent as TableHeader\n if (!parent.filterPanels.value[props.column.id]) {\n parent.filterPanels.value[props.column.id] = instance\n }\n const tooltipVisible = ref(false)\n const tooltip = ref<InstanceType<typeof ElTooltip> | null>(null)\n const filters = computed(() => {\n return props.column && props.column.filters\n })\n const filterClassName = computed(() => {\n if (props.column.filterClassName) {\n return `${ns.b()} ${props.column.filterClassName}`\n }\n return ns.b()\n })\n const filterValue = computed({\n get: () => (props.column?.filteredValue || [])[0],\n set: (value: string) => {\n if (filteredValue.value) {\n if (!isPropAbsent(value)) {\n filteredValue.value.splice(0, 1, value)\n } else {\n filteredValue.value.splice(0, 1)\n }\n }\n },\n })\n const filteredValue: WritableComputedRef<unknown[]> = computed({\n get() {\n if (props.column) {\n return props.column.filteredValue || []\n }\n return []\n },\n set(value: unknown[]) {\n if (props.column) {\n props.upDataColumn('filteredValue', value)\n }\n },\n })\n const multiple = computed(() => {\n if (props.column) {\n return props.column.filterMultiple\n }\n return true\n })\n const isActive = (filter) => {\n return filter.value === filterValue.value\n }\n const hidden = () => {\n tooltipVisible.value = false\n }\n const showFilterPanel = (e: MouseEvent) => {\n e.stopPropagation()\n tooltipVisible.value = !tooltipVisible.value\n }\n const hideFilterPanel = () => {\n tooltipVisible.value = false\n }\n const handleConfirm = () => {\n confirmFilter(filteredValue.value)\n hidden()\n }\n const handleReset = () => {\n filteredValue.value = []\n confirmFilter(filteredValue.value)\n hidden()\n }\n const handleSelect = (_filterValue?: string) => {\n filterValue.value = _filterValue\n if (!isPropAbsent(_filterValue)) {\n confirmFilter(filteredValue.value)\n } else {\n confirmFilter([])\n }\n hidden()\n }\n const confirmFilter = (filteredValue: unknown[]) => {\n props.store.commit('filterChange', {\n column: props.column,\n values: filteredValue,\n })\n props.store.updateAllSelected()\n }\n watch(\n tooltipVisible,\n (value) => {\n // todo\n if (props.column) {\n props.upDataColumn('filterOpened', value)\n }\n },\n {\n immediate: true,\n }\n )\n\n const popperPaneRef = computed(() => {\n return tooltip.value?.popperRef?.contentRef\n })\n\n return {\n tooltipVisible,\n multiple,\n filterClassName,\n filteredValue,\n filterValue,\n filters,\n handleConfirm,\n handleReset,\n handleSelect,\n isPropAbsent,\n isActive,\n t,\n ns,\n showFilterPanel,\n hideFilterPanel,\n popperPaneRef,\n tooltip,\n }\n },\n})\n</script>\n"],"names":["filteredValue","_createBlock","_withCtx","_createElementBlock","_createElementVNode","_normalizeClass","_createVNode","_openBlock","_Fragment","_renderList","_createTextVNode","_toDisplayString","_renderSlot"],"mappings":";;;;;;;;;;;;AA4GA,MAAM,EAAE,aAAe,EAAA,eAAA,EAAoB,GAAA,UAAA,CAAA;AAE3C,MAAK,YAAa,eAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,oBAAA;AAAA,EACN,UAAY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,mBAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA,KAAAM,SAAA,EAAA,EAAAN,WAAA,CAAA,qBAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA,CAAA;AAAA,aAAA,CAAA;;AAAsF,UAAA,CAAA,EAAA,CAAA;;AAM/G,OAAA,EAAA,EAAA,EAAA,CAAA;AAAmB,QAAA,CAAA,wBAEhB,EAAA,IAAA,CAAA,eAAA,EAAA,IAAA,CAAA,aAAA,CAAA;AAAA,OAEN,CAAA;AAAA,KAQK,CAAA;AAAA,IAAA,CAAA,EAAA,CAAA;AAAA,GAPc,EAAA,CAAA,EAAA,CAAA,SAAA,EAAA,WAAA,EAAA,cAAJ,EAAA,WAAA,CAAA,CAAA,CAAA;;AACA,kBACZ,2BAAW,CAAA,qBAAgB,EAAG,WAAa,CAAA,EAAA,CAAA,QAAA,EAAA,kBAAe,CAAA,CAAA,CAAA;;;;"}
@@ -29,6 +29,7 @@ declare const _default: import("vue").DefineComponent<{
29
29
  handleConfirm: () => void;
30
30
  handleReset: () => void;
31
31
  handleSelect: (_filterValue?: string) => void;
32
+ isPropAbsent: (prop: unknown) => prop is null | undefined;
32
33
  isActive: (filter: any) => boolean;
33
34
  t: import("@element-plus/nightly/es/hooks").Translator;
34
35
  ns: {
@@ -1,10 +1,11 @@
1
1
  import { h } from 'vue';
2
+ import { isUndefined } from '../../../utils/types.mjs';
2
3
 
3
4
  function hColgroup(props) {
4
5
  const isAuto = props.tableLayout === "auto";
5
6
  let columns = props.columns || [];
6
7
  if (isAuto) {
7
- if (columns.every((column) => column.width === void 0)) {
8
+ if (columns.every(({ width }) => isUndefined(width))) {
8
9
  columns = [];
9
10
  }
10
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"h-helper.mjs","sources":["../../../../../../packages/components/table/src/h-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport { h } from 'vue'\nexport function hColgroup(props) {\n const isAuto = props.tableLayout === 'auto'\n let columns = props.columns || []\n if (isAuto) {\n if (columns.every((column) => column.width === undefined)) {\n columns = []\n }\n }\n const getPropsData = (column) => {\n const propsData = {\n key: `${props.tableLayout}_${column.id}`,\n style: {},\n name: undefined,\n }\n if (isAuto) {\n propsData.style = {\n width: `${column.width}px`,\n }\n } else {\n propsData.name = column.id\n }\n return propsData\n }\n\n return h(\n 'colgroup',\n {},\n columns.map((column) => h('col', getPropsData(column)))\n )\n}\n\nhColgroup.props = ['columns', 'tableLayout']\n"],"names":[],"mappings":";;AACO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,EAAE,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,KAAK,MAAM,CAAC;AAC9C,EAAE,IAAI,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;AACpC,EAAE,IAAI,MAAM,EAAE;AACd,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC,EAAE;AAC5D,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,KAAK;AACL,GAAG;AACH,EAAE,MAAM,YAAY,GAAG,CAAC,MAAM,KAAK;AACnC,IAAI,MAAM,SAAS,GAAG;AACtB,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AAC9C,MAAM,KAAK,EAAE,EAAE;AACf,MAAM,IAAI,EAAE,KAAK,CAAC;AAClB,KAAK,CAAC;AACN,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,SAAS,CAAC,KAAK,GAAG;AACxB,QAAQ,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAClC,OAAO,CAAC;AACR,KAAK,MAAM;AACX,MAAM,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC;AACjC,KAAK;AACL,IAAI,OAAO,SAAS,CAAC;AACrB,GAAG,CAAC;AACJ,EAAE,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACpF,CAAC;AACD,SAAS,CAAC,KAAK,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC;;;;"}
1
+ {"version":3,"file":"h-helper.mjs","sources":["../../../../../../packages/components/table/src/h-helper.ts"],"sourcesContent":["// @ts-nocheck\nimport { h } from 'vue'\nimport { isUndefined } from '@element-plus/utils'\n\nexport function hColgroup(props) {\n const isAuto = props.tableLayout === 'auto'\n let columns = props.columns || []\n if (isAuto) {\n if (columns.every(({ width }) => isUndefined(width))) {\n columns = []\n }\n }\n const getPropsData = (column) => {\n const propsData = {\n key: `${props.tableLayout}_${column.id}`,\n style: {},\n name: undefined,\n }\n if (isAuto) {\n propsData.style = {\n width: `${column.width}px`,\n }\n } else {\n propsData.name = column.id\n }\n return propsData\n }\n\n return h(\n 'colgroup',\n {},\n columns.map((column) => h('col', getPropsData(column)))\n )\n}\n\nhColgroup.props = ['columns', 'tableLayout']\n"],"names":[],"mappings":";;;AAEO,SAAS,SAAS,CAAC,KAAK,EAAE;AACjC,EAAE,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,KAAK,MAAM,CAAC;AAC9C,EAAE,IAAI,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC;AACpC,EAAE,IAAI,MAAM,EAAE;AACd,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE;AAC1D,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,KAAK;AACL,GAAG;AACH,EAAE,MAAM,YAAY,GAAG,CAAC,MAAM,KAAK;AACnC,IAAI,MAAM,SAAS,GAAG;AACtB,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AAC9C,MAAM,KAAK,EAAE,EAAE;AACf,MAAM,IAAI,EAAE,KAAK,CAAC;AAClB,KAAK,CAAC;AACN,IAAI,IAAI,MAAM,EAAE;AAChB,MAAM,SAAS,CAAC,KAAK,GAAG;AACxB,QAAQ,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AAClC,OAAO,CAAC;AACR,KAAK,MAAM;AACX,MAAM,SAAS,CAAC,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC;AACjC,KAAK;AACL,IAAI,OAAO,SAAS,CAAC;AACrB,GAAG,CAAC;AACJ,EAAE,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACpF,CAAC;AACD,SAAS,CAAC,KAAK,GAAG,CAAC,SAAS,EAAE,aAAa,CAAC;;;;"}
@@ -1,4 +1,5 @@
1
1
  import { getCurrentInstance, ref, unref } from 'vue';
2
+ import { isNull } from 'lodash-unified';
2
3
  import { getRowIdentity } from '../util.mjs';
3
4
 
4
5
  function useCurrent(watcherData) {
@@ -45,7 +46,7 @@ function useCurrent(watcherData) {
45
46
  } else {
46
47
  currentRow.value = null;
47
48
  }
48
- if (currentRow.value === null) {
49
+ if (isNull(currentRow.value)) {
49
50
  instance.emit("current-change", null, oldCurrentRow);
50
51
  }
51
52
  } else if (_currentRowKey.value) {
@@ -1 +1 @@
1
- {"version":3,"file":"current.mjs","sources":["../../../../../../../packages/components/table/src/store/current.ts"],"sourcesContent":["// @ts-nocheck\nimport { getCurrentInstance, ref, unref } from 'vue'\nimport { getRowIdentity } from '../util'\n\nimport type { Ref } from 'vue'\nimport type { Table } from '../table/defaults'\nimport type { WatcherPropsData } from '.'\n\nfunction useCurrent<T>(watcherData: WatcherPropsData<T>) {\n const instance = getCurrentInstance() as Table<T>\n const _currentRowKey = ref<string>(null)\n const currentRow: Ref<T> = ref(null)\n\n const setCurrentRowKey = (key: string) => {\n instance.store.assertRowKey()\n _currentRowKey.value = key\n setCurrentRowByKey(key)\n }\n\n const restoreCurrentRowKey = () => {\n _currentRowKey.value = null\n }\n\n const setCurrentRowByKey = (key: string) => {\n const { data, rowKey } = watcherData\n let _currentRow = null\n if (rowKey.value) {\n _currentRow = (unref(data) || []).find(\n (item) => getRowIdentity(item, rowKey.value) === key\n )\n }\n currentRow.value = _currentRow\n instance.emit('current-change', currentRow.value, null)\n }\n\n const updateCurrentRow = (_currentRow: T) => {\n const oldCurrentRow = currentRow.value\n if (_currentRow && _currentRow !== oldCurrentRow) {\n currentRow.value = _currentRow\n instance.emit('current-change', currentRow.value, oldCurrentRow)\n return\n }\n if (!_currentRow && oldCurrentRow) {\n currentRow.value = null\n instance.emit('current-change', null, oldCurrentRow)\n }\n }\n\n const updateCurrentRowData = () => {\n const rowKey = watcherData.rowKey.value\n // data 为 null 时,解构时的默认值会被忽略\n const data = watcherData.data.value || []\n const oldCurrentRow = currentRow.value\n // 当 currentRow 不在 data 中时尝试更新数据\n if (!data.includes(oldCurrentRow) && oldCurrentRow) {\n if (rowKey) {\n const currentRowKey = getRowIdentity(oldCurrentRow, rowKey)\n setCurrentRowByKey(currentRowKey)\n } else {\n currentRow.value = null\n }\n if (currentRow.value === null) {\n instance.emit('current-change', null, oldCurrentRow)\n }\n } else if (_currentRowKey.value) {\n // 把初始时下设置的 rowKey 转化成 rowData\n setCurrentRowByKey(_currentRowKey.value)\n restoreCurrentRowKey()\n }\n }\n\n return {\n setCurrentRowKey,\n restoreCurrentRowKey,\n setCurrentRowByKey,\n updateCurrentRow,\n updateCurrentRowData,\n states: {\n _currentRowKey,\n currentRow,\n },\n }\n}\n\nexport default useCurrent\n"],"names":[],"mappings":";;;AAEA,SAAS,UAAU,CAAC,WAAW,EAAE;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AAO;AACT,IAAI,gBAAgB;AACpB,IAAI,oBAAoB;AACxB,IAAI,kBAAkB;AACtB,IAAI,gBAAgB;AACpB,IAAI,oBAAoB;AACxB,IAAI,MAAM,EAAE;AACZ,MAAM,cAAc;AACpB,MAAM,UAAU;AAChB,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"current.mjs","sources":["../../../../../../../packages/components/table/src/store/current.ts"],"sourcesContent":["// @ts-nocheck\nimport { getCurrentInstance, ref, unref } from 'vue'\nimport { isNull } from 'lodash-unified'\nimport { getRowIdentity } from '../util'\n\nimport type { Ref } from 'vue'\nimport type { Table } from '../table/defaults'\nimport type { WatcherPropsData } from '.'\n\nfunction useCurrent<T>(watcherData: WatcherPropsData<T>) {\n const instance = getCurrentInstance() as Table<T>\n const _currentRowKey = ref<string>(null)\n const currentRow: Ref<T> = ref(null)\n\n const setCurrentRowKey = (key: string) => {\n instance.store.assertRowKey()\n _currentRowKey.value = key\n setCurrentRowByKey(key)\n }\n\n const restoreCurrentRowKey = () => {\n _currentRowKey.value = null\n }\n\n const setCurrentRowByKey = (key: string) => {\n const { data, rowKey } = watcherData\n let _currentRow = null\n if (rowKey.value) {\n _currentRow = (unref(data) || []).find(\n (item) => getRowIdentity(item, rowKey.value) === key\n )\n }\n currentRow.value = _currentRow\n instance.emit('current-change', currentRow.value, null)\n }\n\n const updateCurrentRow = (_currentRow: T) => {\n const oldCurrentRow = currentRow.value\n if (_currentRow && _currentRow !== oldCurrentRow) {\n currentRow.value = _currentRow\n instance.emit('current-change', currentRow.value, oldCurrentRow)\n return\n }\n if (!_currentRow && oldCurrentRow) {\n currentRow.value = null\n instance.emit('current-change', null, oldCurrentRow)\n }\n }\n\n const updateCurrentRowData = () => {\n const rowKey = watcherData.rowKey.value\n // data 为 null 时,解构时的默认值会被忽略\n const data = watcherData.data.value || []\n const oldCurrentRow = currentRow.value\n // 当 currentRow 不在 data 中时尝试更新数据\n if (!data.includes(oldCurrentRow) && oldCurrentRow) {\n if (rowKey) {\n const currentRowKey = getRowIdentity(oldCurrentRow, rowKey)\n setCurrentRowByKey(currentRowKey)\n } else {\n currentRow.value = null\n }\n if (isNull(currentRow.value)) {\n instance.emit('current-change', null, oldCurrentRow)\n }\n } else if (_currentRowKey.value) {\n // 把初始时下设置的 rowKey 转化成 rowData\n setCurrentRowByKey(_currentRowKey.value)\n restoreCurrentRowKey()\n }\n }\n\n return {\n setCurrentRowKey,\n restoreCurrentRowKey,\n setCurrentRowByKey,\n updateCurrentRow,\n updateCurrentRowData,\n states: {\n _currentRowKey,\n currentRow,\n },\n }\n}\n\nexport default useCurrent\n"],"names":[],"mappings":";;;;AAGA,SAAS,UAAU,CAAC,WAAW,EAAE;AACjC,EAAE,MAAM,QAAQ,GAAG,kBAAkB,EAAE,CAAC;AACxC,EAAE,MAAM,cAAc,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;AACnC,EAAE,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;AAC/B,EAAE,MAAM,gBAAgB,GAAG,CAAC,GAAG,KAAK;AACpC,IAAI,QAAQ,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;AAClC,IAAI,cAAc,CAAC,KAAK,GAAG,GAAG,CAAC;AAC/B,IAAI,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAC5B,GAAG,CAAC;AACJ,EAAE,MAAM,oBAAoB,GAAG,MAAM;AACrC,IAAI,cAAc,CAAC,KAAK,GAAG,IAAI,CAAC;AAChC,GAAG,CAAC;AACJ,EAAE,MAAM,kBAAkB,GAAG,CAAC,GAAG,KAAK;AACtC,IAAI,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;AACzC,IAAI,IAAI,WAAW,GAAG,IAAI,CAAC;AAC3B,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE;AACtB,MAAM,WAAW,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,C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AAQ,kBAAkB,CAAC,aAAa,CAAC,CAAC;AAC1C,OAAO,MAAM;AACb,QAAQ,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC;AAChC,OAAO;AACP,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;AACpC,QAAQ,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;AAC7D,OAAO;AACP,KAAK,MAAM,IAAI,cAAc,CAAC,KAAK,EAAE;AACrC,MAAM,kBAAkB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;AAC/C,MAAM,oBAAoB,EAAE,CAAC;AAC7B,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,gBAAgB;AACpB,IAAI,oBAAoB;AACxB,IAAI,kBAAkB;AACtB,IAAI,gBAAgB;AACpB,IAAI,oBAAoB;AACxB,IAAI,MAAM,EAAE;AACZ,MAAM,cAAc;AACpB,MAAM,UAAU;AAChB,KAAK;AACL,GAAG,CAAC;AACJ;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { watch } from 'vue';
2
2
  import { debounce } from 'lodash-unified';
3
3
  import useStore from './index.mjs';
4
+ import { isObject } from '@vue/shared';
4
5
 
5
6
  const InitialStateMap = {
6
7
  rowKey: "rowKey",
@@ -44,7 +45,7 @@ function proxyTableProps(store, props) {
44
45
  function handleValue(value, propsKey, store) {
45
46
  let newVal = value;
46
47
  let storeKey = InitialStateMap[propsKey];
47
- if (typeof InitialStateMap[propsKey] === "object") {
48
+ if (isObject(InitialStateMap[propsKey])) {
48
49
  storeKey = storeKey.key;
49
50
  newVal = newVal || InitialStateMap[propsKey].default;
50
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"helper.mjs","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":[],"mappings":";;;;AAGA,MAAM,eAAe,GAAG;AACxB,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,gBAAgB,EAAE,kBAAkB;AACtC,EAAE,qBAAqB,EAAE,uBAAuB;AAChD,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,IAAI,E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,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.mjs","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":[],"mappings":";;;;;AAIA,MAAM,eAAe,GAAG;AACxB,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,gBAAgB,EAAE,kBAAkB;AACtC,EAAE,qBAAqB,EAAE,uBAAuB;AAChD,EAAE,MAAM,EAAE,QAAQ;AAClB,EAAE,IAAI,EAAE,MAAM;AACd,E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K,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,QAAQ,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;;;;"}
@@ -1,4 +1,5 @@
1
1
  import { getCurrentInstance, unref, nextTick } from 'vue';
2
+ import { isNull } from 'lodash-unified';
2
3
  import useWatcher from './watcher.mjs';
3
4
  import { useNamespace } from '../../../../hooks/use-namespace/index.mjs';
4
5
 
@@ -125,7 +126,7 @@ function useStore() {
125
126
  changeSortCondition(states, options) {
126
127
  const { sortingColumn, sortProp, sortOrder } = states;
127
128
  const columnValue = unref(sortingColumn), propValue = unref(sortProp), orderValue = unref(sortOrder);
128
- if (orderValue === null) {
129
+ if (isNull(orderValue)) {
129
130
  states.sortingColumn.value = null;
130
131
  states.sortProp.value = null;
131
132
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","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":[],"mappings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IAAI,QAAQ,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,GAAG,OAAO;AACd,IAAI,SAAS;AACb,IAAI,MAAM;AACV,IAAI,kBAAkB;AACtB,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"index.mjs","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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AkB,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACnD,KAAK;AACL,GAAG,CAAC;AACJ,EAAE,MAAM,kBAAkB,GAAG,WAAW;AACxC,IAAI,QAAQ,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,GAAG,OAAO;AACd,IAAI,SAAS;AACb,IAAI,MAAM;AACV,IAAI,kBAAkB;AACtB,GAAG,CAAC;AACJ;;;;"}
@@ -6,7 +6,7 @@ import useEvents from './events-helper.mjs';
6
6
  import useStyles from './styles-helper.mjs';
7
7
  import TdWrapper from './td-wrapper.mjs';
8
8
  import { useNamespace } from '../../../../hooks/use-namespace/index.mjs';
9
- import { isBoolean } from '../../../../utils/types.mjs';
9
+ import { isBoolean, isPropAbsent } from '../../../../utils/types.mjs';
10
10
 
11
11
  function useRender(props) {
12
12
  const parent = inject(TABLE_INJECTION_KEY);
@@ -177,7 +177,7 @@ function useRender(props) {
177
177
  loading: false
178
178
  };
179
179
  const childKey = getRowIdentity(node, rowKey.value);
180
- if (childKey === void 0 || childKey === null) {
180
+ if (isPropAbsent(childKey)) {
181
181
  throw new Error("For nested data item, row-key is required.");
182
182
  }
183
183
  cur = { ...treeData.value[childKey] };
@@ -1 +1 @@
1
- {"version":3,"file":"render-helper.mjs","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":[],"mappings":";;;;;;;;;;AASA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAC7C,EAAE,MAAM,EAAE,GAAG,YAAY,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,GAAG,SAAS,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,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;AACvB,EAAE,MAAM,uBAAuB,GAAG,QAAQ,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,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;AACvC,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AAO,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.mjs","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":[],"mappings":";;;;;;;;;;AASA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAC7C,EAAE,MAAM,EAAE,GAAG,YAAY,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;AACx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AC,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;;;;"}
@@ -2,7 +2,7 @@ import { inject } from 'vue';
2
2
  import { getFixedColumnOffset, ensurePosition, getFixedColumnsClass } from '../util.mjs';
3
3
  import { TABLE_INJECTION_KEY } from '../tokens.mjs';
4
4
  import { useNamespace } from '../../../../hooks/use-namespace/index.mjs';
5
- import { isFunction, isString, isArray } from '@vue/shared';
5
+ import { isFunction, isString, isArray, isObject } from '@vue/shared';
6
6
 
7
7
  function useStyles(props) {
8
8
  const parent = inject(TABLE_INJECTION_KEY);
@@ -83,7 +83,7 @@ function useStyles(props) {
83
83
  if (isArray(result)) {
84
84
  rowspan = result[0];
85
85
  colspan = result[1];
86
- } else if (typeof result === "object") {
86
+ } else if (isObject(result)) {
87
87
  rowspan = result.rowspan;
88
88
  colspan = result.colspan;
89
89
  }