element-pe 2.2.77 → 2.2.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (662) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.full.js +157 -101
  3. package/dist/index.full.min.js +13 -13
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +13 -13
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +157 -101
  8. package/es/components/autocomplete/index.d.ts +3 -3
  9. package/es/components/autocomplete/src/autocomplete.mjs +1 -0
  10. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  11. package/es/components/autocomplete/src/autocomplete.vue.d.ts +3 -3
  12. package/es/components/backtop/index.mjs +2 -2
  13. package/es/components/backtop/src/backtop.mjs +61 -23
  14. package/es/components/backtop/src/backtop.mjs.map +1 -1
  15. package/es/components/backtop/src/backtop2.mjs +23 -61
  16. package/es/components/backtop/src/backtop2.mjs.map +1 -1
  17. package/es/components/breadcrumb/index.d.ts +2 -6
  18. package/es/components/breadcrumb/index.mjs +2 -2
  19. package/es/components/breadcrumb/src/breadcrumb-item.mjs +56 -11
  20. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  21. package/es/components/breadcrumb/src/breadcrumb-item.vue.d.ts +1 -3
  22. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +11 -56
  23. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  24. package/es/components/button/index.mjs +3 -3
  25. package/es/components/button/src/button-group.mjs +30 -6
  26. package/es/components/button/src/button-group.mjs.map +1 -1
  27. package/es/components/button/src/button-group2.mjs +6 -30
  28. package/es/components/button/src/button-group2.mjs.map +1 -1
  29. package/es/components/button/src/button.mjs +57 -76
  30. package/es/components/button/src/button.mjs.map +1 -1
  31. package/es/components/button/src/button2.mjs +76 -57
  32. package/es/components/button/src/button2.mjs.map +1 -1
  33. package/es/components/carousel/index.mjs +2 -2
  34. package/es/components/carousel/src/carousel.mjs +56 -169
  35. package/es/components/carousel/src/carousel.mjs.map +1 -1
  36. package/es/components/carousel/src/carousel2.mjs +169 -56
  37. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  38. package/es/components/cascader/index.d.ts +8 -6
  39. package/es/components/cascader/index.mjs +2 -2
  40. package/es/components/cascader/src/cascader.mjs +82 -640
  41. package/es/components/cascader/src/cascader.mjs.map +1 -1
  42. package/es/components/cascader/src/cascader.vue.d.ts +4 -3
  43. package/es/components/cascader/src/cascader2.mjs +647 -82
  44. package/es/components/cascader/src/cascader2.mjs.map +1 -1
  45. package/es/components/cascader-panel/src/index.mjs +7 -3
  46. package/es/components/cascader-panel/src/index.mjs.map +1 -1
  47. package/es/components/cascader-panel/src/menu.mjs +1 -1
  48. package/es/components/cascader-panel/src/node.mjs +209 -116
  49. package/es/components/cascader-panel/src/node.mjs.map +1 -1
  50. package/es/components/cascader-panel/src/node2.mjs +116 -209
  51. package/es/components/cascader-panel/src/node2.mjs.map +1 -1
  52. package/es/components/cascader-panel/src/store.mjs +1 -1
  53. package/es/components/checkbox/index.mjs +2 -2
  54. package/es/components/checkbox/src/checkbox-button.mjs +1 -1
  55. package/es/components/checkbox/src/checkbox.mjs +125 -54
  56. package/es/components/checkbox/src/checkbox.mjs.map +1 -1
  57. package/es/components/checkbox/src/checkbox2.mjs +54 -125
  58. package/es/components/checkbox/src/checkbox2.mjs.map +1 -1
  59. package/es/components/collapse/index.d.ts +6 -0
  60. package/es/components/collapse/src/collapse-item.vue.d.ts +3 -0
  61. package/es/components/collapse-transition/index.d.ts +6 -0
  62. package/es/components/collapse-transition/src/collapse-transition.mjs +15 -8
  63. package/es/components/collapse-transition/src/collapse-transition.mjs.map +1 -1
  64. package/es/components/collapse-transition/src/collapse-transition.vue.d.ts +3 -0
  65. package/es/components/color-picker/index.d.ts +3 -3
  66. package/es/components/color-picker/src/color-picker.vue.d.ts +3 -3
  67. package/es/components/countdown/index.mjs +2 -2
  68. package/es/components/countdown/src/countdown.mjs +23 -76
  69. package/es/components/countdown/src/countdown.mjs.map +1 -1
  70. package/es/components/countdown/src/countdown2.mjs +76 -23
  71. package/es/components/countdown/src/countdown2.mjs.map +1 -1
  72. package/es/components/date-picker/index.d.ts +1 -0
  73. package/es/components/date-picker/index.mjs.map +1 -1
  74. package/es/components/date-picker/src/date-picker-com/panel-date-pick.mjs +19 -2
  75. package/es/components/date-picker/src/date-picker-com/panel-date-pick.mjs.map +1 -1
  76. package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +2 -0
  77. package/es/components/date-picker/src/date-picker.mjs.map +1 -1
  78. package/es/components/date-picker/src/instance.d.ts +8 -0
  79. package/es/components/date-picker/src/instance.mjs +2 -0
  80. package/es/components/date-picker/src/instance.mjs.map +1 -0
  81. package/es/components/date-picker/src/panel-utils.d.ts +2 -0
  82. package/es/components/descriptions/src/description2.mjs +1 -1
  83. package/es/components/descriptions/src/descriptions-row.mjs +64 -7
  84. package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
  85. package/es/components/descriptions/src/descriptions-row2.mjs +7 -64
  86. package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
  87. package/es/components/dialog/index.d.ts +48 -45
  88. package/es/components/dialog/src/dialog-content.d.ts +4 -4
  89. package/es/components/dialog/src/dialog-content.mjs +4 -16
  90. package/es/components/dialog/src/dialog-content.mjs.map +1 -1
  91. package/es/components/dialog/src/dialog-content.vue.d.ts +20 -17
  92. package/es/components/dialog/src/dialog-content2.mjs +9 -8
  93. package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
  94. package/es/components/dialog/src/dialog.d.ts +7 -7
  95. package/es/components/dialog/src/dialog.mjs +3 -12
  96. package/es/components/dialog/src/dialog.mjs.map +1 -1
  97. package/es/components/dialog/src/dialog.vue.d.ts +48 -45
  98. package/es/components/divider/index.mjs +2 -2
  99. package/es/components/divider/src/divider.mjs +35 -17
  100. package/es/components/divider/src/divider.mjs.map +1 -1
  101. package/es/components/divider/src/divider2.mjs +17 -35
  102. package/es/components/divider/src/divider2.mjs.map +1 -1
  103. package/es/components/drawer/index.d.ts +21 -21
  104. package/es/components/drawer/src/drawer.d.ts +7 -7
  105. package/es/components/drawer/src/drawer.vue.d.ts +21 -21
  106. package/es/components/dropdown/index.d.ts +2 -2
  107. package/es/components/dropdown/index.mjs +2 -2
  108. package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
  109. package/es/components/dropdown/src/dropdown-item.mjs +1 -1
  110. package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
  111. package/es/components/dropdown/src/dropdown.mjs +310 -105
  112. package/es/components/dropdown/src/dropdown.mjs.map +1 -1
  113. package/es/components/dropdown/src/dropdown.vue.d.ts +2 -2
  114. package/es/components/dropdown/src/dropdown2.mjs +105 -310
  115. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  116. package/es/components/focus-trap/src/focus-trap.mjs +1 -1
  117. package/es/components/focus-trap/src/focus-trap.mjs.map +1 -1
  118. package/es/components/form/index.mjs +2 -2
  119. package/es/components/form/src/form-item.mjs +46 -328
  120. package/es/components/form/src/form-item.mjs.map +1 -1
  121. package/es/components/form/src/form-item2.mjs +328 -46
  122. package/es/components/form/src/form-item2.mjs.map +1 -1
  123. package/es/components/icon/index.mjs +2 -2
  124. package/es/components/icon/src/icon.mjs +8 -36
  125. package/es/components/icon/src/icon.mjs.map +1 -1
  126. package/es/components/icon/src/icon2.mjs +36 -8
  127. package/es/components/icon/src/icon2.mjs.map +1 -1
  128. package/es/components/image/index.mjs +2 -2
  129. package/es/components/image/src/image.mjs +227 -56
  130. package/es/components/image/src/image.mjs.map +1 -1
  131. package/es/components/image/src/image2.mjs +56 -227
  132. package/es/components/image/src/image2.mjs.map +1 -1
  133. package/es/components/index.mjs +28 -28
  134. package/es/components/input/index.d.ts +1 -2
  135. package/es/components/input/index.mjs +2 -2
  136. package/es/components/input/index.mjs.map +1 -1
  137. package/es/components/input/src/input.mjs +114 -468
  138. package/es/components/input/src/input.mjs.map +1 -1
  139. package/es/components/input/src/input2.mjs +468 -114
  140. package/es/components/input/src/input2.mjs.map +1 -1
  141. package/es/components/input/src/instance.d.ts +2 -0
  142. package/es/components/input/src/instance.mjs +2 -0
  143. package/es/components/input/src/instance.mjs.map +1 -0
  144. package/es/components/link/index.mjs +2 -2
  145. package/es/components/link/src/link.mjs +21 -50
  146. package/es/components/link/src/link.mjs.map +1 -1
  147. package/es/components/link/src/link2.mjs +50 -21
  148. package/es/components/link/src/link2.mjs.map +1 -1
  149. package/es/components/menu/index.mjs +4 -4
  150. package/es/components/menu/src/menu-item-group.mjs +4 -35
  151. package/es/components/menu/src/menu-item-group.mjs.map +1 -1
  152. package/es/components/menu/src/menu-item-group2.mjs +35 -4
  153. package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
  154. package/es/components/menu/src/menu-item.mjs +97 -14
  155. package/es/components/menu/src/menu-item.mjs.map +1 -1
  156. package/es/components/menu/src/menu-item2.mjs +14 -97
  157. package/es/components/menu/src/menu-item2.mjs.map +1 -1
  158. package/es/components/menu/src/sub-menu.mjs +2 -0
  159. package/es/components/menu/src/sub-menu.mjs.map +1 -1
  160. package/es/components/notification/index.mjs +1 -1
  161. package/es/components/notification/src/notification.mjs +151 -67
  162. package/es/components/notification/src/notification.mjs.map +1 -1
  163. package/es/components/notification/src/notification2.mjs +67 -151
  164. package/es/components/notification/src/notification2.mjs.map +1 -1
  165. package/es/components/notification/src/notify.mjs +2 -2
  166. package/es/components/page-header/index.mjs +2 -2
  167. package/es/components/page-header/src/page-header.mjs +17 -103
  168. package/es/components/page-header/src/page-header.mjs.map +1 -1
  169. package/es/components/page-header/src/page-header2.mjs +103 -17
  170. package/es/components/page-header/src/page-header2.mjs.map +1 -1
  171. package/es/components/pagination/src/components/jumper.mjs +60 -9
  172. package/es/components/pagination/src/components/jumper.mjs.map +1 -1
  173. package/es/components/pagination/src/components/jumper2.mjs +9 -60
  174. package/es/components/pagination/src/components/jumper2.mjs.map +1 -1
  175. package/es/components/pagination/src/components/next.mjs +38 -19
  176. package/es/components/pagination/src/components/next.mjs.map +1 -1
  177. package/es/components/pagination/src/components/next2.mjs +19 -38
  178. package/es/components/pagination/src/components/next2.mjs.map +1 -1
  179. package/es/components/pagination/src/components/prev.mjs +38 -18
  180. package/es/components/pagination/src/components/prev.mjs.map +1 -1
  181. package/es/components/pagination/src/components/prev2.mjs +18 -38
  182. package/es/components/pagination/src/components/prev2.mjs.map +1 -1
  183. package/es/components/pagination/src/components/sizes.mjs +70 -22
  184. package/es/components/pagination/src/components/sizes.mjs.map +1 -1
  185. package/es/components/pagination/src/components/sizes.vue.d.ts +5 -5
  186. package/es/components/pagination/src/components/sizes2.mjs +22 -70
  187. package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
  188. package/es/components/pagination/src/pagination.mjs +4 -4
  189. package/es/components/popconfirm/index.d.ts +3 -3
  190. package/es/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
  191. package/es/components/popconfirm/src/popconfirm2.mjs +1 -1
  192. package/es/components/popover/index.d.ts +3 -3
  193. package/es/components/popover/src/popover.vue.d.ts +3 -3
  194. package/es/components/popover/src/popover2.mjs +1 -1
  195. package/es/components/popper/index.mjs +4 -4
  196. package/es/components/popper/src/arrow.mjs +39 -8
  197. package/es/components/popper/src/arrow.mjs.map +1 -1
  198. package/es/components/popper/src/arrow2.mjs +8 -39
  199. package/es/components/popper/src/arrow2.mjs.map +1 -1
  200. package/es/components/popper/src/trigger.mjs +31 -121
  201. package/es/components/popper/src/trigger.mjs.map +1 -1
  202. package/es/components/popper/src/trigger2.mjs +121 -31
  203. package/es/components/popper/src/trigger2.mjs.map +1 -1
  204. package/es/components/radio/index.mjs +2 -2
  205. package/es/components/radio/src/radio-button.mjs +1 -1
  206. package/es/components/radio/src/radio-button.mjs.map +1 -1
  207. package/es/components/radio/src/radio-group.mjs +42 -70
  208. package/es/components/radio/src/radio-group.mjs.map +1 -1
  209. package/es/components/radio/src/radio-group2.mjs +70 -42
  210. package/es/components/radio/src/radio-group2.mjs.map +1 -1
  211. package/es/components/rate/index.mjs +2 -2
  212. package/es/components/rate/src/rate.mjs +92 -258
  213. package/es/components/rate/src/rate.mjs.map +1 -1
  214. package/es/components/rate/src/rate2.mjs +258 -92
  215. package/es/components/rate/src/rate2.mjs.map +1 -1
  216. package/es/components/row/index.d.ts +18 -4
  217. package/es/components/row/src/row.d.ts +6 -1
  218. package/es/components/row/src/row.mjs +1 -1
  219. package/es/components/row/src/row.mjs.map +1 -1
  220. package/es/components/row/src/row.vue.d.ts +18 -4
  221. package/es/components/row/src/row2.mjs +1 -2
  222. package/es/components/row/src/row2.mjs.map +1 -1
  223. package/es/components/scrollbar/index.mjs +1 -1
  224. package/es/components/scrollbar/src/bar2.mjs +1 -1
  225. package/es/components/scrollbar/src/thumb.mjs +11 -134
  226. package/es/components/scrollbar/src/thumb.mjs.map +1 -1
  227. package/es/components/scrollbar/src/thumb2.mjs +134 -11
  228. package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
  229. package/es/components/select/index.d.ts +5 -5
  230. package/es/components/select/src/select.mjs +16 -18
  231. package/es/components/select/src/select.mjs.map +1 -1
  232. package/es/components/select/src/select.vue.d.ts +5 -5
  233. package/es/components/select/src/useSelect.d.ts +10 -4
  234. package/es/components/select/src/useSelect.mjs +31 -22
  235. package/es/components/select/src/useSelect.mjs.map +1 -1
  236. package/es/components/select-v2/index.d.ts +4 -4
  237. package/es/components/select-v2/src/select.vue.d.ts +2 -2
  238. package/es/components/select-v2/src/useSelect.d.ts +2 -2
  239. package/es/components/slider/index.d.ts +5 -5
  240. package/es/components/slider/index.mjs +2 -2
  241. package/es/components/slider/src/button.mjs +94 -21
  242. package/es/components/slider/src/button.mjs.map +1 -1
  243. package/es/components/slider/src/button.vue.d.ts +1 -1
  244. package/es/components/slider/src/button2.mjs +21 -94
  245. package/es/components/slider/src/button2.mjs.map +1 -1
  246. package/es/components/slider/src/composables/use-slide.d.ts +4 -4
  247. package/es/components/slider/src/slider.mjs +96 -237
  248. package/es/components/slider/src/slider.mjs.map +1 -1
  249. package/es/components/slider/src/slider.vue.d.ts +5 -5
  250. package/es/components/slider/src/slider2.mjs +237 -96
  251. package/es/components/slider/src/slider2.mjs.map +1 -1
  252. package/es/components/switch/index.d.ts +36 -0
  253. package/es/components/switch/src/switch.d.ts +12 -0
  254. package/es/components/switch/src/switch.mjs +6 -0
  255. package/es/components/switch/src/switch.mjs.map +1 -1
  256. package/es/components/switch/src/switch.vue.d.ts +36 -0
  257. package/es/components/switch/src/switch2.mjs +11 -1
  258. package/es/components/switch/src/switch2.mjs.map +1 -1
  259. package/es/components/table/index.d.ts +1 -0
  260. package/es/components/table/src/filter-panel.vue.d.ts +2 -2
  261. package/es/components/table/src/table/utils-helper.d.ts +1 -0
  262. package/es/components/table/src/table/utils-helper.mjs +4 -0
  263. package/es/components/table/src/table/utils-helper.mjs.map +1 -1
  264. package/es/components/table/src/table-body/events-helper.mjs +10 -2
  265. package/es/components/table/src/table-body/events-helper.mjs.map +1 -1
  266. package/es/components/table/src/table-column/watcher-helper.mjs +1 -0
  267. package/es/components/table/src/table-column/watcher-helper.mjs.map +1 -1
  268. package/es/components/table/src/table.mjs +2 -0
  269. package/es/components/table/src/table.mjs.map +1 -1
  270. package/es/components/table/src/table.vue.d.ts +1 -0
  271. package/es/components/teleport/index.mjs +2 -2
  272. package/es/components/teleport/src/teleport.mjs +44 -18
  273. package/es/components/teleport/src/teleport.mjs.map +1 -1
  274. package/es/components/teleport/src/teleport2.mjs +18 -44
  275. package/es/components/teleport/src/teleport2.mjs.map +1 -1
  276. package/es/components/time-picker/src/common/picker.vue.d.ts +3 -3
  277. package/es/components/time-select/index.d.ts +20 -20
  278. package/es/components/time-select/index.mjs +1 -1
  279. package/es/components/time-select/src/time-select.mjs +55 -132
  280. package/es/components/time-select/src/time-select.mjs.map +1 -1
  281. package/es/components/time-select/src/time-select.vue.d.ts +10 -10
  282. package/es/components/time-select/src/time-select2.mjs +132 -55
  283. package/es/components/time-select/src/time-select2.mjs.map +1 -1
  284. package/es/components/timeline/index.mjs +2 -2
  285. package/es/components/timeline/src/timeline-item.mjs +72 -42
  286. package/es/components/timeline/src/timeline-item.mjs.map +1 -1
  287. package/es/components/timeline/src/timeline-item2.mjs +42 -72
  288. package/es/components/timeline/src/timeline-item2.mjs.map +1 -1
  289. package/es/components/tooltip/index.d.ts +1 -1
  290. package/es/components/tooltip/src/tooltip.mjs +1 -1
  291. package/es/components/tooltip/src/tooltip.vue.d.ts +151 -410
  292. package/es/components/tooltip/src/tooltip2.mjs +4 -3
  293. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  294. package/es/components/tooltip/src/trigger.mjs +1 -1
  295. package/es/components/tooltip/src/trigger2.mjs +1 -1
  296. package/es/components/tooltip-v2/index.mjs +4 -4
  297. package/es/components/tooltip-v2/src/content.mjs +50 -114
  298. package/es/components/tooltip-v2/src/content.mjs.map +1 -1
  299. package/es/components/tooltip-v2/src/content2.mjs +114 -50
  300. package/es/components/tooltip-v2/src/content2.mjs.map +1 -1
  301. package/es/components/tooltip-v2/src/root.mjs +17 -82
  302. package/es/components/tooltip-v2/src/root.mjs.map +1 -1
  303. package/es/components/tooltip-v2/src/root2.mjs +82 -17
  304. package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
  305. package/es/components/tooltip-v2/src/tooltip.mjs +21 -78
  306. package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
  307. package/es/components/tooltip-v2/src/tooltip2.mjs +78 -21
  308. package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
  309. package/es/components/transfer/index.mjs +2 -2
  310. package/es/components/transfer/src/composables/use-check.mjs +1 -1
  311. package/es/components/transfer/src/composables/use-checked-change.mjs +1 -1
  312. package/es/components/transfer/src/transfer-panel.mjs +128 -19
  313. package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
  314. package/es/components/transfer/src/transfer-panel2.mjs +19 -128
  315. package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
  316. package/es/components/transfer/src/transfer.mjs +69 -162
  317. package/es/components/transfer/src/transfer.mjs.map +1 -1
  318. package/es/components/transfer/src/transfer2.mjs +162 -69
  319. package/es/components/transfer/src/transfer2.mjs.map +1 -1
  320. package/es/components/upload/src/upload.d.ts +1 -1
  321. package/es/components/upload/src/upload2.mjs.map +1 -1
  322. package/es/hooks/use-focus-controller/index.mjs +0 -1
  323. package/es/hooks/use-focus-controller/index.mjs.map +1 -1
  324. package/es/hooks/use-namespace/index.mjs +2 -2
  325. package/es/hooks/use-namespace/index.mjs.map +1 -1
  326. package/es/hooks/use-z-index/index.mjs +2 -2
  327. package/es/hooks/use-z-index/index.mjs.map +1 -1
  328. package/es/index.mjs +28 -28
  329. package/lib/components/autocomplete/index.d.ts +3 -3
  330. package/lib/components/autocomplete/src/autocomplete.js +1 -0
  331. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  332. package/lib/components/autocomplete/src/autocomplete.vue.d.ts +3 -3
  333. package/lib/components/backtop/index.js +2 -2
  334. package/lib/components/backtop/src/backtop.js +61 -24
  335. package/lib/components/backtop/src/backtop.js.map +1 -1
  336. package/lib/components/backtop/src/backtop2.js +24 -61
  337. package/lib/components/backtop/src/backtop2.js.map +1 -1
  338. package/lib/components/breadcrumb/index.d.ts +2 -6
  339. package/lib/components/breadcrumb/index.js +2 -2
  340. package/lib/components/breadcrumb/src/breadcrumb-item.js +56 -11
  341. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  342. package/lib/components/breadcrumb/src/breadcrumb-item.vue.d.ts +1 -3
  343. package/lib/components/breadcrumb/src/breadcrumb-item2.js +11 -56
  344. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  345. package/lib/components/button/index.js +3 -3
  346. package/lib/components/button/src/button-group.js +30 -6
  347. package/lib/components/button/src/button-group.js.map +1 -1
  348. package/lib/components/button/src/button-group2.js +6 -30
  349. package/lib/components/button/src/button-group2.js.map +1 -1
  350. package/lib/components/button/src/button.js +60 -76
  351. package/lib/components/button/src/button.js.map +1 -1
  352. package/lib/components/button/src/button2.js +76 -60
  353. package/lib/components/button/src/button2.js.map +1 -1
  354. package/lib/components/carousel/index.js +2 -2
  355. package/lib/components/carousel/src/carousel.js +57 -169
  356. package/lib/components/carousel/src/carousel.js.map +1 -1
  357. package/lib/components/carousel/src/carousel2.js +169 -57
  358. package/lib/components/carousel/src/carousel2.js.map +1 -1
  359. package/lib/components/cascader/index.d.ts +8 -6
  360. package/lib/components/cascader/index.js +2 -2
  361. package/lib/components/cascader/src/cascader.js +83 -640
  362. package/lib/components/cascader/src/cascader.js.map +1 -1
  363. package/lib/components/cascader/src/cascader.vue.d.ts +4 -3
  364. package/lib/components/cascader/src/cascader2.js +647 -83
  365. package/lib/components/cascader/src/cascader2.js.map +1 -1
  366. package/lib/components/cascader-panel/src/index.js +6 -2
  367. package/lib/components/cascader-panel/src/index.js.map +1 -1
  368. package/lib/components/cascader-panel/src/menu.js +1 -1
  369. package/lib/components/cascader-panel/src/node.js +209 -116
  370. package/lib/components/cascader-panel/src/node.js.map +1 -1
  371. package/lib/components/cascader-panel/src/node2.js +116 -209
  372. package/lib/components/cascader-panel/src/node2.js.map +1 -1
  373. package/lib/components/cascader-panel/src/store.js +1 -1
  374. package/lib/components/checkbox/index.js +2 -2
  375. package/lib/components/checkbox/src/checkbox-button.js +1 -1
  376. package/lib/components/checkbox/src/checkbox.js +125 -55
  377. package/lib/components/checkbox/src/checkbox.js.map +1 -1
  378. package/lib/components/checkbox/src/checkbox2.js +55 -125
  379. package/lib/components/checkbox/src/checkbox2.js.map +1 -1
  380. package/lib/components/collapse/index.d.ts +6 -0
  381. package/lib/components/collapse/src/collapse-item.vue.d.ts +3 -0
  382. package/lib/components/collapse-transition/index.d.ts +6 -0
  383. package/lib/components/collapse-transition/src/collapse-transition.js +15 -8
  384. package/lib/components/collapse-transition/src/collapse-transition.js.map +1 -1
  385. package/lib/components/collapse-transition/src/collapse-transition.vue.d.ts +3 -0
  386. package/lib/components/color-picker/index.d.ts +3 -3
  387. package/lib/components/color-picker/src/color-picker.vue.d.ts +3 -3
  388. package/lib/components/countdown/index.js +2 -2
  389. package/lib/components/countdown/src/countdown.js +24 -76
  390. package/lib/components/countdown/src/countdown.js.map +1 -1
  391. package/lib/components/countdown/src/countdown2.js +76 -24
  392. package/lib/components/countdown/src/countdown2.js.map +1 -1
  393. package/lib/components/date-picker/index.d.ts +1 -0
  394. package/lib/components/date-picker/index.js.map +1 -1
  395. package/lib/components/date-picker/src/date-picker-com/panel-date-pick.js +19 -2
  396. package/lib/components/date-picker/src/date-picker-com/panel-date-pick.js.map +1 -1
  397. package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +2 -0
  398. package/lib/components/date-picker/src/date-picker.js.map +1 -1
  399. package/lib/components/date-picker/src/instance.d.ts +8 -0
  400. package/lib/components/date-picker/src/instance.js +3 -0
  401. package/lib/components/date-picker/src/instance.js.map +1 -0
  402. package/lib/components/date-picker/src/panel-utils.d.ts +2 -0
  403. package/lib/components/descriptions/src/description2.js +1 -1
  404. package/lib/components/descriptions/src/descriptions-row.js +64 -7
  405. package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
  406. package/lib/components/descriptions/src/descriptions-row2.js +7 -64
  407. package/lib/components/descriptions/src/descriptions-row2.js.map +1 -1
  408. package/lib/components/dialog/index.d.ts +48 -45
  409. package/lib/components/dialog/src/dialog-content.d.ts +4 -4
  410. package/lib/components/dialog/src/dialog-content.js +4 -16
  411. package/lib/components/dialog/src/dialog-content.js.map +1 -1
  412. package/lib/components/dialog/src/dialog-content.vue.d.ts +20 -17
  413. package/lib/components/dialog/src/dialog-content2.js +9 -8
  414. package/lib/components/dialog/src/dialog-content2.js.map +1 -1
  415. package/lib/components/dialog/src/dialog.d.ts +7 -7
  416. package/lib/components/dialog/src/dialog.js +3 -12
  417. package/lib/components/dialog/src/dialog.js.map +1 -1
  418. package/lib/components/dialog/src/dialog.vue.d.ts +48 -45
  419. package/lib/components/divider/index.js +2 -2
  420. package/lib/components/divider/src/divider.js +35 -17
  421. package/lib/components/divider/src/divider.js.map +1 -1
  422. package/lib/components/divider/src/divider2.js +17 -35
  423. package/lib/components/divider/src/divider2.js.map +1 -1
  424. package/lib/components/drawer/index.d.ts +21 -21
  425. package/lib/components/drawer/src/drawer.d.ts +7 -7
  426. package/lib/components/drawer/src/drawer.vue.d.ts +21 -21
  427. package/lib/components/dropdown/index.d.ts +2 -2
  428. package/lib/components/dropdown/index.js +2 -2
  429. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
  430. package/lib/components/dropdown/src/dropdown-item.js +1 -1
  431. package/lib/components/dropdown/src/dropdown-menu.js +1 -1
  432. package/lib/components/dropdown/src/dropdown.js +310 -114
  433. package/lib/components/dropdown/src/dropdown.js.map +1 -1
  434. package/lib/components/dropdown/src/dropdown.vue.d.ts +2 -2
  435. package/lib/components/dropdown/src/dropdown2.js +114 -310
  436. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  437. package/lib/components/focus-trap/src/focus-trap.js +1 -1
  438. package/lib/components/focus-trap/src/focus-trap.js.map +1 -1
  439. package/lib/components/form/index.js +2 -2
  440. package/lib/components/form/src/form-item.js +47 -332
  441. package/lib/components/form/src/form-item.js.map +1 -1
  442. package/lib/components/form/src/form-item2.js +332 -47
  443. package/lib/components/form/src/form-item2.js.map +1 -1
  444. package/lib/components/icon/index.js +2 -2
  445. package/lib/components/icon/src/icon.js +8 -36
  446. package/lib/components/icon/src/icon.js.map +1 -1
  447. package/lib/components/icon/src/icon2.js +36 -8
  448. package/lib/components/icon/src/icon2.js.map +1 -1
  449. package/lib/components/image/index.js +2 -2
  450. package/lib/components/image/src/image.js +226 -56
  451. package/lib/components/image/src/image.js.map +1 -1
  452. package/lib/components/image/src/image2.js +56 -226
  453. package/lib/components/image/src/image2.js.map +1 -1
  454. package/lib/components/index.js +28 -28
  455. package/lib/components/input/index.d.ts +1 -2
  456. package/lib/components/input/index.js +2 -2
  457. package/lib/components/input/index.js.map +1 -1
  458. package/lib/components/input/src/input.js +114 -467
  459. package/lib/components/input/src/input.js.map +1 -1
  460. package/lib/components/input/src/input2.js +467 -114
  461. package/lib/components/input/src/input2.js.map +1 -1
  462. package/lib/components/input/src/instance.d.ts +2 -0
  463. package/lib/components/input/src/instance.js +3 -0
  464. package/lib/components/input/src/instance.js.map +1 -0
  465. package/lib/components/link/index.js +2 -2
  466. package/lib/components/link/src/link.js +22 -50
  467. package/lib/components/link/src/link.js.map +1 -1
  468. package/lib/components/link/src/link2.js +50 -22
  469. package/lib/components/link/src/link2.js.map +1 -1
  470. package/lib/components/menu/index.js +4 -4
  471. package/lib/components/menu/src/menu-item-group.js +4 -35
  472. package/lib/components/menu/src/menu-item-group.js.map +1 -1
  473. package/lib/components/menu/src/menu-item-group2.js +35 -4
  474. package/lib/components/menu/src/menu-item-group2.js.map +1 -1
  475. package/lib/components/menu/src/menu-item.js +97 -15
  476. package/lib/components/menu/src/menu-item.js.map +1 -1
  477. package/lib/components/menu/src/menu-item2.js +15 -97
  478. package/lib/components/menu/src/menu-item2.js.map +1 -1
  479. package/lib/components/menu/src/sub-menu.js +2 -0
  480. package/lib/components/menu/src/sub-menu.js.map +1 -1
  481. package/lib/components/notification/index.js +1 -1
  482. package/lib/components/notification/src/notification.js +150 -68
  483. package/lib/components/notification/src/notification.js.map +1 -1
  484. package/lib/components/notification/src/notification2.js +68 -150
  485. package/lib/components/notification/src/notification2.js.map +1 -1
  486. package/lib/components/notification/src/notify.js +2 -2
  487. package/lib/components/page-header/index.js +2 -2
  488. package/lib/components/page-header/src/page-header.js +18 -103
  489. package/lib/components/page-header/src/page-header.js.map +1 -1
  490. package/lib/components/page-header/src/page-header2.js +103 -18
  491. package/lib/components/page-header/src/page-header2.js.map +1 -1
  492. package/lib/components/pagination/src/components/jumper.js +60 -9
  493. package/lib/components/pagination/src/components/jumper.js.map +1 -1
  494. package/lib/components/pagination/src/components/jumper2.js +9 -60
  495. package/lib/components/pagination/src/components/jumper2.js.map +1 -1
  496. package/lib/components/pagination/src/components/next.js +38 -19
  497. package/lib/components/pagination/src/components/next.js.map +1 -1
  498. package/lib/components/pagination/src/components/next2.js +19 -38
  499. package/lib/components/pagination/src/components/next2.js.map +1 -1
  500. package/lib/components/pagination/src/components/prev.js +38 -19
  501. package/lib/components/pagination/src/components/prev.js.map +1 -1
  502. package/lib/components/pagination/src/components/prev2.js +19 -38
  503. package/lib/components/pagination/src/components/prev2.js.map +1 -1
  504. package/lib/components/pagination/src/components/sizes.js +70 -22
  505. package/lib/components/pagination/src/components/sizes.js.map +1 -1
  506. package/lib/components/pagination/src/components/sizes.vue.d.ts +5 -5
  507. package/lib/components/pagination/src/components/sizes2.js +22 -70
  508. package/lib/components/pagination/src/components/sizes2.js.map +1 -1
  509. package/lib/components/pagination/src/pagination.js +4 -4
  510. package/lib/components/popconfirm/index.d.ts +3 -3
  511. package/lib/components/popconfirm/src/popconfirm.vue.d.ts +3 -3
  512. package/lib/components/popconfirm/src/popconfirm2.js +1 -1
  513. package/lib/components/popover/index.d.ts +3 -3
  514. package/lib/components/popover/src/popover.vue.d.ts +3 -3
  515. package/lib/components/popover/src/popover2.js +1 -1
  516. package/lib/components/popper/index.js +4 -4
  517. package/lib/components/popper/src/arrow.js +39 -9
  518. package/lib/components/popper/src/arrow.js.map +1 -1
  519. package/lib/components/popper/src/arrow2.js +9 -39
  520. package/lib/components/popper/src/arrow2.js.map +1 -1
  521. package/lib/components/popper/src/trigger.js +32 -121
  522. package/lib/components/popper/src/trigger.js.map +1 -1
  523. package/lib/components/popper/src/trigger2.js +121 -32
  524. package/lib/components/popper/src/trigger2.js.map +1 -1
  525. package/lib/components/radio/index.js +2 -2
  526. package/lib/components/radio/src/radio-button.js +1 -1
  527. package/lib/components/radio/src/radio-button.js.map +1 -1
  528. package/lib/components/radio/src/radio-group.js +43 -70
  529. package/lib/components/radio/src/radio-group.js.map +1 -1
  530. package/lib/components/radio/src/radio-group2.js +70 -43
  531. package/lib/components/radio/src/radio-group2.js.map +1 -1
  532. package/lib/components/rate/index.js +2 -2
  533. package/lib/components/rate/src/rate.js +92 -257
  534. package/lib/components/rate/src/rate.js.map +1 -1
  535. package/lib/components/rate/src/rate2.js +257 -92
  536. package/lib/components/rate/src/rate2.js.map +1 -1
  537. package/lib/components/row/index.d.ts +18 -4
  538. package/lib/components/row/src/row.d.ts +6 -1
  539. package/lib/components/row/src/row.js +1 -1
  540. package/lib/components/row/src/row.js.map +1 -1
  541. package/lib/components/row/src/row.vue.d.ts +18 -4
  542. package/lib/components/row/src/row2.js +1 -2
  543. package/lib/components/row/src/row2.js.map +1 -1
  544. package/lib/components/scrollbar/index.js +1 -1
  545. package/lib/components/scrollbar/src/bar2.js +1 -1
  546. package/lib/components/scrollbar/src/thumb.js +11 -134
  547. package/lib/components/scrollbar/src/thumb.js.map +1 -1
  548. package/lib/components/scrollbar/src/thumb2.js +134 -11
  549. package/lib/components/scrollbar/src/thumb2.js.map +1 -1
  550. package/lib/components/select/index.d.ts +5 -5
  551. package/lib/components/select/src/select.js +16 -18
  552. package/lib/components/select/src/select.js.map +1 -1
  553. package/lib/components/select/src/select.vue.d.ts +5 -5
  554. package/lib/components/select/src/useSelect.d.ts +10 -4
  555. package/lib/components/select/src/useSelect.js +30 -21
  556. package/lib/components/select/src/useSelect.js.map +1 -1
  557. package/lib/components/select-v2/index.d.ts +4 -4
  558. package/lib/components/select-v2/src/select.vue.d.ts +2 -2
  559. package/lib/components/select-v2/src/useSelect.d.ts +2 -2
  560. package/lib/components/slider/index.d.ts +5 -5
  561. package/lib/components/slider/index.js +2 -2
  562. package/lib/components/slider/src/button.js +94 -22
  563. package/lib/components/slider/src/button.js.map +1 -1
  564. package/lib/components/slider/src/button.vue.d.ts +1 -1
  565. package/lib/components/slider/src/button2.js +22 -94
  566. package/lib/components/slider/src/button2.js.map +1 -1
  567. package/lib/components/slider/src/composables/use-slide.d.ts +4 -4
  568. package/lib/components/slider/src/slider.js +97 -237
  569. package/lib/components/slider/src/slider.js.map +1 -1
  570. package/lib/components/slider/src/slider.vue.d.ts +5 -5
  571. package/lib/components/slider/src/slider2.js +237 -97
  572. package/lib/components/slider/src/slider2.js.map +1 -1
  573. package/lib/components/switch/index.d.ts +36 -0
  574. package/lib/components/switch/src/switch.d.ts +12 -0
  575. package/lib/components/switch/src/switch.js +6 -0
  576. package/lib/components/switch/src/switch.js.map +1 -1
  577. package/lib/components/switch/src/switch.vue.d.ts +36 -0
  578. package/lib/components/switch/src/switch2.js +11 -1
  579. package/lib/components/switch/src/switch2.js.map +1 -1
  580. package/lib/components/table/index.d.ts +1 -0
  581. package/lib/components/table/src/filter-panel.vue.d.ts +2 -2
  582. package/lib/components/table/src/table/utils-helper.d.ts +1 -0
  583. package/lib/components/table/src/table/utils-helper.js +4 -0
  584. package/lib/components/table/src/table/utils-helper.js.map +1 -1
  585. package/lib/components/table/src/table-body/events-helper.js +10 -2
  586. package/lib/components/table/src/table-body/events-helper.js.map +1 -1
  587. package/lib/components/table/src/table-column/watcher-helper.js +1 -0
  588. package/lib/components/table/src/table-column/watcher-helper.js.map +1 -1
  589. package/lib/components/table/src/table.js +2 -0
  590. package/lib/components/table/src/table.js.map +1 -1
  591. package/lib/components/table/src/table.vue.d.ts +1 -0
  592. package/lib/components/teleport/index.js +2 -2
  593. package/lib/components/teleport/src/teleport.js +44 -18
  594. package/lib/components/teleport/src/teleport.js.map +1 -1
  595. package/lib/components/teleport/src/teleport2.js +18 -44
  596. package/lib/components/teleport/src/teleport2.js.map +1 -1
  597. package/lib/components/time-picker/src/common/picker.vue.d.ts +3 -3
  598. package/lib/components/time-select/index.d.ts +20 -20
  599. package/lib/components/time-select/index.js +1 -1
  600. package/lib/components/time-select/src/time-select.js +55 -137
  601. package/lib/components/time-select/src/time-select.js.map +1 -1
  602. package/lib/components/time-select/src/time-select.vue.d.ts +10 -10
  603. package/lib/components/time-select/src/time-select2.js +137 -55
  604. package/lib/components/time-select/src/time-select2.js.map +1 -1
  605. package/lib/components/timeline/index.js +2 -2
  606. package/lib/components/timeline/src/timeline-item.js +72 -42
  607. package/lib/components/timeline/src/timeline-item.js.map +1 -1
  608. package/lib/components/timeline/src/timeline-item2.js +42 -72
  609. package/lib/components/timeline/src/timeline-item2.js.map +1 -1
  610. package/lib/components/tooltip/index.d.ts +1 -1
  611. package/lib/components/tooltip/src/tooltip.js +1 -1
  612. package/lib/components/tooltip/src/tooltip.vue.d.ts +151 -410
  613. package/lib/components/tooltip/src/tooltip2.js +4 -3
  614. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  615. package/lib/components/tooltip/src/trigger.js +1 -1
  616. package/lib/components/tooltip/src/trigger2.js +1 -1
  617. package/lib/components/tooltip-v2/index.js +4 -4
  618. package/lib/components/tooltip-v2/src/content.js +50 -114
  619. package/lib/components/tooltip-v2/src/content.js.map +1 -1
  620. package/lib/components/tooltip-v2/src/content2.js +114 -50
  621. package/lib/components/tooltip-v2/src/content2.js.map +1 -1
  622. package/lib/components/tooltip-v2/src/root.js +17 -82
  623. package/lib/components/tooltip-v2/src/root.js.map +1 -1
  624. package/lib/components/tooltip-v2/src/root2.js +82 -17
  625. package/lib/components/tooltip-v2/src/root2.js.map +1 -1
  626. package/lib/components/tooltip-v2/src/tooltip.js +21 -78
  627. package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
  628. package/lib/components/tooltip-v2/src/tooltip2.js +78 -21
  629. package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
  630. package/lib/components/transfer/index.js +2 -2
  631. package/lib/components/transfer/src/composables/use-check.js +1 -1
  632. package/lib/components/transfer/src/composables/use-checked-change.js +1 -1
  633. package/lib/components/transfer/src/transfer-panel.js +128 -21
  634. package/lib/components/transfer/src/transfer-panel.js.map +1 -1
  635. package/lib/components/transfer/src/transfer-panel2.js +21 -128
  636. package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
  637. package/lib/components/transfer/src/transfer.js +73 -162
  638. package/lib/components/transfer/src/transfer.js.map +1 -1
  639. package/lib/components/transfer/src/transfer2.js +162 -73
  640. package/lib/components/transfer/src/transfer2.js.map +1 -1
  641. package/lib/components/upload/src/upload.d.ts +1 -1
  642. package/lib/components/upload/src/upload2.js.map +1 -1
  643. package/lib/hooks/use-focus-controller/index.js +0 -1
  644. package/lib/hooks/use-focus-controller/index.js.map +1 -1
  645. package/lib/hooks/use-namespace/index.js +1 -1
  646. package/lib/hooks/use-namespace/index.js.map +1 -1
  647. package/lib/hooks/use-z-index/index.js +1 -1
  648. package/lib/hooks/use-z-index/index.js.map +1 -1
  649. package/lib/index.js +28 -28
  650. package/package.json +1 -1
  651. package/theme-chalk/el-avatar.css +1 -1
  652. package/theme-chalk/el-input.css +1 -1
  653. package/theme-chalk/el-menu.css +1 -1
  654. package/theme-chalk/el-row.css +1 -1
  655. package/theme-chalk/el-tree.css +1 -1
  656. package/theme-chalk/index.css +1 -1
  657. package/theme-chalk/src/avatar.scss +1 -0
  658. package/theme-chalk/src/input.scss +1 -1
  659. package/theme-chalk/src/menu.scss +4 -6
  660. package/theme-chalk/src/row.scss +3 -0
  661. package/theme-chalk/src/tree.scss +1 -0
  662. package/web-types.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"transfer.js","sources":["../../../../../../packages/components/transfer/src/transfer.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <transfer-panel\n ref=\"leftPanel\"\n :data=\"sourceData\"\n :option-render=\"optionRender\"\n :placeholder=\"panelFilterPlaceholder\"\n :title=\"leftPanelTitle\"\n :filterable=\"filterable\"\n :format=\"format\"\n :filter-method=\"filterMethod\"\n :default-checked=\"leftDefaultChecked\"\n :props=\"props.props\"\n @checked-change=\"onSourceCheckedChange\"\n >\n <slot name=\"left-footer\" />\n </transfer-panel>\n <div :class=\"ns.e('buttons')\">\n <el-button\n type=\"primary\"\n :class=\"[ns.e('button'), ns.is('with-texts', hasButtonTexts)]\"\n :disabled=\"isEmpty(checkedState.rightChecked)\"\n @click=\"addToLeft\"\n >\n <el-icon><arrow-left /></el-icon>\n <span v-if=\"!isUndefined(buttonTexts[0])\">{{ buttonTexts[0] }}</span>\n </el-button>\n <el-button\n type=\"primary\"\n :class=\"[ns.e('button'), ns.is('with-texts', hasButtonTexts)]\"\n :disabled=\"isEmpty(checkedState.leftChecked)\"\n @click=\"addToRight\"\n >\n <span v-if=\"!isUndefined(buttonTexts[1])\">{{ buttonTexts[1] }}</span>\n <el-icon><arrow-right /></el-icon>\n </el-button>\n </div>\n <transfer-panel\n ref=\"rightPanel\"\n :data=\"targetData\"\n :option-render=\"optionRender\"\n :placeholder=\"panelFilterPlaceholder\"\n :filterable=\"filterable\"\n :format=\"format\"\n :filter-method=\"filterMethod\"\n :title=\"rightPanelTitle\"\n :default-checked=\"rightDefaultChecked\"\n :props=\"props.props\"\n @checked-change=\"onTargetCheckedChange\"\n >\n <slot name=\"right-footer\" />\n </transfer-panel>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, h, reactive, ref, useSlots } from 'vue'\nimport { watch } from '../../config-provider'\nimport { debugWarn, isEmpty, isUndefined } from '@element-plus/utils'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useFormItem } from '@element-plus/components/form'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport { transferEmits, transferProps } from './transfer'\nimport {\n useCheckedChange,\n useComputedData,\n useMove,\n usePropsAlias,\n} from './composables'\nimport TransferPanel from './transfer-panel.vue'\n\nimport type {\n TransferCheckedState,\n TransferDataItem,\n TransferDirection,\n} from './transfer'\nimport type { TransferPanelInstance } from './transfer-panel'\n\ndefineOptions({\n name: 'ElTransfer',\n})\n\nconst props = defineProps(transferProps)\nconst emit = defineEmits(transferEmits)\nconst slots = useSlots()\n\nconst { t } = useLocale()\nconst ns = useNamespace('transfer')\nconst { formItem } = useFormItem()\n\nconst checkedState = reactive<TransferCheckedState>({\n leftChecked: [],\n rightChecked: [],\n})\n\nconst propsAlias = usePropsAlias(props)\n\nconst { sourceData, targetData } = useComputedData(props)\n\nconst { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(\n checkedState,\n emit\n)\n\nconst { addToLeft, addToRight } = useMove(props, checkedState, emit)\n\nconst leftPanel = ref<TransferPanelInstance>()\nconst rightPanel = ref<TransferPanelInstance>()\n\nconst clearQuery = (which: TransferDirection) => {\n switch (which) {\n case 'left':\n leftPanel.value!.query = ''\n break\n case 'right':\n rightPanel.value!.query = ''\n break\n }\n}\n\nconst hasButtonTexts = computed(() => props.buttonTexts.length === 2)\n\nconst leftPanelTitle = computed(\n () => props.titles[0] || t('el.transfer.titles.0')\n)\n\nconst rightPanelTitle = computed(\n () => props.titles[1] || t('el.transfer.titles.1')\n)\n\nconst panelFilterPlaceholder = computed(\n () => props.filterPlaceholder || t('el.transfer.filterPlaceholder')\n)\n\nwatch(\n () => props.modelValue,\n () => {\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n }\n)\n\nconst optionRender = computed(() => (option: TransferDataItem) => {\n if (props.renderContent) return props.renderContent(h, option)\n\n if (slots.default) return slots.default({ option })\n\n return h(\n 'span',\n option[propsAlias.value.label] || option[propsAlias.value.key]\n )\n})\n\ndefineExpose({\n /** @description clear the filter keyword of a certain panel */\n clearQuery,\n /** @description left panel ref */\n leftPanel,\n /** @description left panel ref */\n rightPanel,\n})\n</script>\n"],"names":["useSlots","useLocale","useNamespace","useFormItem","reactive","usePropsAlias","useComputedData","useCheckedChange","useMove","ref","computed","watch","debugWarn","h"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAgFc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAA,MAAM,QAAQA,YAAS,EAAA,CAAA;AAEvB,IAAM,MAAA,EAAE,MAAMC,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,UAAU,CAAA,C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-unified'\nimport {\n buildProps,\n definePropType,\n isArray,\n mutable,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type { ExtractPropTypes, h as H, VNode } from 'vue'\nimport type Transfer from './transfer.vue'\n\nexport type TransferKey = string | number\nexport type TransferDirection = 'left' | 'right'\n\nexport type TransferDataItem = Record<string, any>\n\nexport type renderContent = (\n h: typeof H,\n option: TransferDataItem\n) => VNode | VNode[]\n\nexport interface TransferFormat {\n noChecked?: string\n hasChecked?: string\n}\n\nexport interface TransferPropsAlias {\n label?: string\n key?: string\n disabled?: string\n}\n\nexport interface TransferCheckedState {\n leftChecked: TransferKey[]\n rightChecked: TransferKey[]\n}\n\nexport const LEFT_CHECK_CHANGE_EVENT = 'left-check-change'\nexport const RIGHT_CHECK_CHANGE_EVENT = 'right-check-change'\n\nexport const transferProps = buildProps({\n data: {\n type: definePropType<TransferDataItem[]>(Array),\n default: () => [],\n },\n titles: {\n type: definePropType<[string, string]>(Array),\n default: () => [],\n },\n buttonTexts: {\n type: definePropType<[string, string]>(Array),\n default: () => [],\n },\n filterPlaceholder: String,\n filterMethod: {\n type: definePropType<(query: string, item: TransferDataItem) => boolean>(\n Function\n ),\n },\n leftDefaultChecked: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n rightDefaultChecked: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n renderContent: {\n type: definePropType<renderContent>(Function),\n },\n modelValue: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n format: {\n type: definePropType<TransferFormat>(Object),\n default: () => ({}),\n },\n filterable: Boolean,\n props: {\n type: definePropType<TransferPropsAlias>(Object),\n default: () =>\n mutable({\n label: 'label',\n key: 'key',\n disabled: 'disabled',\n } as const),\n },\n targetOrder: {\n type: String,\n values: ['original', 'push', 'unshift'],\n default: 'original',\n },\n validateEvent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport type TransferProps = ExtractPropTypes<typeof transferProps>\n\nexport const transferCheckedChangeFn = (\n value: TransferKey[],\n movedKeys?: TransferKey[]\n) => [value, movedKeys].every(isArray) || (isArray(value) && isNil(movedKeys))\n\nexport const transferEmits = {\n [CHANGE_EVENT]: (\n value: TransferKey[],\n direction: TransferDirection,\n movedKeys: TransferKey[]\n ) =>\n [value, movedKeys].every(isArray) && ['left', 'right'].includes(direction),\n [UPDATE_MODEL_EVENT]: (value: TransferKey[]) => isArray(value),\n [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,\n [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,\n}\nexport type TransferEmits = typeof transferEmits\n\nexport type TransferInstance = InstanceType<typeof Transfer>\n"],"names":["buildProps","definePropType","mutable","isArray","isNil","CHANGE_EVENT","UPDATE_MODEL_EVENT"],"mappings":";;;;;;;;;;;;AAQY,MAAC,uBAAuB,GAAG,oBAAoB;AAC/C,MAAC,wBAAwB,GAAG,qBAAqB;AACjD,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,iBAAiB,EAAE,MAAM;AAC3B,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAEA,sBAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM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EAAE,CAACC,kBAAY,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,KAAK,CAACF,cAAO,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC7H,EAAE,CAACG,wBAAkB,GAAG,CAAC,KAAK,KAAKH,cAAO,CAAC,KAAK,CAAC;AACjD,EAAE,CAAC,uBAAuB,GAAG,uBAAuB;AACpD,EAAE,CAAC,wBAAwB,GAAG,uBAAuB;AACrD;;;;;;;;"}
@@ -2,82 +2,171 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var lodashUnified = require('lodash-unified');
5
+ var vue = require('vue');
6
+ require('../../config-provider/index.js');
6
7
  require('../../../utils/index.js');
7
- require('../../../constants/index.js');
8
- var runtime = require('../../../utils/vue/props/runtime.js');
9
- var typescript = require('../../../utils/typescript.js');
10
- var shared = require('@vue/shared');
11
- var event = require('../../../constants/event.js');
8
+ require('../../../hooks/index.js');
9
+ var index$2 = require('../../button/index.js');
10
+ var index$3 = require('../../icon/index.js');
11
+ require('../../form/index.js');
12
+ var iconsVue = require('@element-plus/icons-vue');
13
+ var transfer = require('./transfer.js');
14
+ require('./composables/index.js');
15
+ var transferPanel = require('./transfer-panel.js');
16
+ var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
17
+ var index = require('../../../hooks/use-locale/index.js');
18
+ var index$1 = require('../../../hooks/use-namespace/index.js');
19
+ var useFormItem = require('../../form/src/hooks/use-form-item.js');
20
+ var usePropsAlias = require('./composables/use-props-alias.js');
21
+ var useComputedData = require('./composables/use-computed-data.js');
22
+ var useCheckedChange = require('./composables/use-checked-change.js');
23
+ var useMove = require('./composables/use-move.js');
24
+ var forEditor = require('../../config-provider/src/for-editor.js');
25
+ var error = require('../../../utils/error.js');
26
+ var types = require('../../../utils/types.js');
12
27
 
13
- const LEFT_CHECK_CHANGE_EVENT = "left-check-change";
14
- const RIGHT_CHECK_CHANGE_EVENT = "right-check-change";
15
- const transferProps = runtime.buildProps({
16
- data: {
17
- type: runtime.definePropType(Array),
18
- default: () => []
19
- },
20
- titles: {
21
- type: runtime.definePropType(Array),
22
- default: () => []
23
- },
24
- buttonTexts: {
25
- type: runtime.definePropType(Array),
26
- default: () => []
27
- },
28
- filterPlaceholder: String,
29
- filterMethod: {
30
- type: runtime.definePropType(Function)
31
- },
32
- leftDefaultChecked: {
33
- type: runtime.definePropType(Array),
34
- default: () => []
35
- },
36
- rightDefaultChecked: {
37
- type: runtime.definePropType(Array),
38
- default: () => []
39
- },
40
- renderContent: {
41
- type: runtime.definePropType(Function)
42
- },
43
- modelValue: {
44
- type: runtime.definePropType(Array),
45
- default: () => []
46
- },
47
- format: {
48
- type: runtime.definePropType(Object),
49
- default: () => ({})
50
- },
51
- filterable: Boolean,
52
- props: {
53
- type: runtime.definePropType(Object),
54
- default: () => typescript.mutable({
55
- label: "label",
56
- key: "key",
57
- disabled: "disabled"
58
- })
59
- },
60
- targetOrder: {
61
- type: String,
62
- values: ["original", "push", "unshift"],
63
- default: "original"
64
- },
65
- validateEvent: {
66
- type: Boolean,
67
- default: true
28
+ const _hoisted_1 = { key: 0 };
29
+ const _hoisted_2 = { key: 0 };
30
+ const __default__ = vue.defineComponent({
31
+ name: "ElTransfer"
32
+ });
33
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
34
+ ...__default__,
35
+ props: transfer.transferProps,
36
+ emits: transfer.transferEmits,
37
+ setup(__props, { expose, emit }) {
38
+ const props = __props;
39
+ const slots = vue.useSlots();
40
+ const { t } = index.useLocale();
41
+ const ns = index$1.useNamespace("transfer");
42
+ const { formItem } = useFormItem.useFormItem();
43
+ const checkedState = vue.reactive({
44
+ leftChecked: [],
45
+ rightChecked: []
46
+ });
47
+ const propsAlias = usePropsAlias.usePropsAlias(props);
48
+ const { sourceData, targetData } = useComputedData.useComputedData(props);
49
+ const { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange.useCheckedChange(checkedState, emit);
50
+ const { addToLeft, addToRight } = useMove.useMove(props, checkedState, emit);
51
+ const leftPanel = vue.ref();
52
+ const rightPanel = vue.ref();
53
+ const clearQuery = (which) => {
54
+ switch (which) {
55
+ case "left":
56
+ leftPanel.value.query = "";
57
+ break;
58
+ case "right":
59
+ rightPanel.value.query = "";
60
+ break;
61
+ }
62
+ };
63
+ const hasButtonTexts = vue.computed(() => props.buttonTexts.length === 2);
64
+ const leftPanelTitle = vue.computed(() => props.titles[0] || t("el.transfer.titles.0"));
65
+ const rightPanelTitle = vue.computed(() => props.titles[1] || t("el.transfer.titles.1"));
66
+ const panelFilterPlaceholder = vue.computed(() => props.filterPlaceholder || t("el.transfer.filterPlaceholder"));
67
+ forEditor.watch(() => props.modelValue, () => {
68
+ var _a;
69
+ if (props.validateEvent) {
70
+ (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => error.debugWarn(err));
71
+ }
72
+ });
73
+ const optionRender = vue.computed(() => (option) => {
74
+ if (props.renderContent)
75
+ return props.renderContent(vue.h, option);
76
+ if (slots.default)
77
+ return slots.default({ option });
78
+ return vue.h("span", option[propsAlias.value.label] || option[propsAlias.value.key]);
79
+ });
80
+ expose({
81
+ clearQuery,
82
+ leftPanel,
83
+ rightPanel
84
+ });
85
+ return (_ctx, _cache) => {
86
+ return vue.openBlock(), vue.createElementBlock("div", {
87
+ class: vue.normalizeClass(vue.unref(ns).b())
88
+ }, [
89
+ vue.createVNode(transferPanel["default"], {
90
+ ref_key: "leftPanel",
91
+ ref: leftPanel,
92
+ data: vue.unref(sourceData),
93
+ "option-render": vue.unref(optionRender),
94
+ placeholder: vue.unref(panelFilterPlaceholder),
95
+ title: vue.unref(leftPanelTitle),
96
+ filterable: _ctx.filterable,
97
+ format: _ctx.format,
98
+ "filter-method": _ctx.filterMethod,
99
+ "default-checked": _ctx.leftDefaultChecked,
100
+ props: props.props,
101
+ onCheckedChange: vue.unref(onSourceCheckedChange)
102
+ }, {
103
+ default: vue.withCtx(() => [
104
+ vue.renderSlot(_ctx.$slots, "left-footer")
105
+ ]),
106
+ _: 3
107
+ }, 8, ["data", "option-render", "placeholder", "title", "filterable", "format", "filter-method", "default-checked", "props", "onCheckedChange"]),
108
+ vue.createElementVNode("div", {
109
+ class: vue.normalizeClass(vue.unref(ns).e("buttons"))
110
+ }, [
111
+ vue.createVNode(vue.unref(index$2.ElButton), {
112
+ type: "primary",
113
+ class: vue.normalizeClass([vue.unref(ns).e("button"), vue.unref(ns).is("with-texts", vue.unref(hasButtonTexts))]),
114
+ disabled: vue.unref(types.isEmpty)(checkedState.rightChecked),
115
+ onClick: vue.unref(addToLeft)
116
+ }, {
117
+ default: vue.withCtx(() => [
118
+ vue.createVNode(vue.unref(index$3.ElIcon), null, {
119
+ default: vue.withCtx(() => [
120
+ vue.createVNode(vue.unref(iconsVue.ArrowLeft))
121
+ ]),
122
+ _: 1
123
+ }),
124
+ !vue.unref(types.isUndefined)(_ctx.buttonTexts[0]) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, vue.toDisplayString(_ctx.buttonTexts[0]), 1)) : vue.createCommentVNode("v-if", true)
125
+ ]),
126
+ _: 1
127
+ }, 8, ["class", "disabled", "onClick"]),
128
+ vue.createVNode(vue.unref(index$2.ElButton), {
129
+ type: "primary",
130
+ class: vue.normalizeClass([vue.unref(ns).e("button"), vue.unref(ns).is("with-texts", vue.unref(hasButtonTexts))]),
131
+ disabled: vue.unref(types.isEmpty)(checkedState.leftChecked),
132
+ onClick: vue.unref(addToRight)
133
+ }, {
134
+ default: vue.withCtx(() => [
135
+ !vue.unref(types.isUndefined)(_ctx.buttonTexts[1]) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2, vue.toDisplayString(_ctx.buttonTexts[1]), 1)) : vue.createCommentVNode("v-if", true),
136
+ vue.createVNode(vue.unref(index$3.ElIcon), null, {
137
+ default: vue.withCtx(() => [
138
+ vue.createVNode(vue.unref(iconsVue.ArrowRight))
139
+ ]),
140
+ _: 1
141
+ })
142
+ ]),
143
+ _: 1
144
+ }, 8, ["class", "disabled", "onClick"])
145
+ ], 2),
146
+ vue.createVNode(transferPanel["default"], {
147
+ ref_key: "rightPanel",
148
+ ref: rightPanel,
149
+ data: vue.unref(targetData),
150
+ "option-render": vue.unref(optionRender),
151
+ placeholder: vue.unref(panelFilterPlaceholder),
152
+ filterable: _ctx.filterable,
153
+ format: _ctx.format,
154
+ "filter-method": _ctx.filterMethod,
155
+ title: vue.unref(rightPanelTitle),
156
+ "default-checked": _ctx.rightDefaultChecked,
157
+ props: props.props,
158
+ onCheckedChange: vue.unref(onTargetCheckedChange)
159
+ }, {
160
+ default: vue.withCtx(() => [
161
+ vue.renderSlot(_ctx.$slots, "right-footer")
162
+ ]),
163
+ _: 3
164
+ }, 8, ["data", "option-render", "placeholder", "filterable", "format", "filter-method", "title", "default-checked", "props", "onCheckedChange"])
165
+ ], 2);
166
+ };
68
167
  }
69
168
  });
70
- const transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(shared.isArray) || shared.isArray(value) && lodashUnified.isNil(movedKeys);
71
- const transferEmits = {
72
- [event.CHANGE_EVENT]: (value, direction, movedKeys) => [value, movedKeys].every(shared.isArray) && ["left", "right"].includes(direction),
73
- [event.UPDATE_MODEL_EVENT]: (value) => shared.isArray(value),
74
- [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
75
- [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn
76
- };
169
+ var Transfer = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "D:\\workspace\\element-pe\\packages\\components\\transfer\\src\\transfer.vue"]]);
77
170
 
78
- exports.LEFT_CHECK_CHANGE_EVENT = LEFT_CHECK_CHANGE_EVENT;
79
- exports.RIGHT_CHECK_CHANGE_EVENT = RIGHT_CHECK_CHANGE_EVENT;
80
- exports.transferCheckedChangeFn = transferCheckedChangeFn;
81
- exports.transferEmits = transferEmits;
82
- exports.transferProps = transferProps;
171
+ exports["default"] = Transfer;
83
172
  //# sourceMappingURL=transfer2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transfer2.js","sources":["../../../../../../packages/components/transfer/src/transfer.ts"],"sourcesContent":["import { isNil } from 'lodash-unified'\nimport {\n buildProps,\n definePropType,\n isArray,\n mutable,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\n\nimport type { ExtractPropTypes, h as H, VNode } from 'vue'\nimport type Transfer from './transfer.vue'\n\nexport type TransferKey = string | number\nexport type TransferDirection = 'left' | 'right'\n\nexport type TransferDataItem = Record<string, any>\n\nexport type renderContent = (\n h: typeof H,\n option: TransferDataItem\n) => VNode | VNode[]\n\nexport interface TransferFormat {\n noChecked?: string\n hasChecked?: string\n}\n\nexport interface TransferPropsAlias {\n label?: string\n key?: string\n disabled?: string\n}\n\nexport interface TransferCheckedState {\n leftChecked: TransferKey[]\n rightChecked: TransferKey[]\n}\n\nexport const LEFT_CHECK_CHANGE_EVENT = 'left-check-change'\nexport const RIGHT_CHECK_CHANGE_EVENT = 'right-check-change'\n\nexport const transferProps = buildProps({\n data: {\n type: definePropType<TransferDataItem[]>(Array),\n default: () => [],\n },\n titles: {\n type: definePropType<[string, string]>(Array),\n default: () => [],\n },\n buttonTexts: {\n type: definePropType<[string, string]>(Array),\n default: () => [],\n },\n filterPlaceholder: String,\n filterMethod: {\n type: definePropType<(query: string, item: TransferDataItem) => boolean>(\n Function\n ),\n },\n leftDefaultChecked: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n rightDefaultChecked: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n renderContent: {\n type: definePropType<renderContent>(Function),\n },\n modelValue: {\n type: definePropType<TransferKey[]>(Array),\n default: () => [],\n },\n format: {\n type: definePropType<TransferFormat>(Object),\n default: () => ({}),\n },\n filterable: Boolean,\n props: {\n type: definePropType<TransferPropsAlias>(Object),\n default: () =>\n mutable({\n label: 'label',\n key: 'key',\n disabled: 'disabled',\n } as const),\n },\n targetOrder: {\n type: String,\n values: ['original', 'push', 'unshift'],\n default: 'original',\n },\n validateEvent: {\n type: Boolean,\n default: true,\n },\n} as const)\nexport type TransferProps = ExtractPropTypes<typeof transferProps>\n\nexport const transferCheckedChangeFn = (\n value: TransferKey[],\n movedKeys?: TransferKey[]\n) => [value, movedKeys].every(isArray) || (isArray(value) && isNil(movedKeys))\n\nexport const transferEmits = {\n [CHANGE_EVENT]: (\n value: TransferKey[],\n direction: TransferDirection,\n movedKeys: TransferKey[]\n ) =>\n [value, movedKeys].every(isArray) && ['left', 'right'].includes(direction),\n [UPDATE_MODEL_EVENT]: (value: TransferKey[]) => isArray(value),\n [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,\n [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,\n}\nexport type TransferEmits = typeof transferEmits\n\nexport type TransferInstance = InstanceType<typeof Transfer>\n"],"names":["buildProps","definePropType","mutable","isArray","isNil","CHANGE_EVENT","UPDATE_MODEL_EVENT"],"mappings":";;;;;;;;;;;;AAQY,MAAC,uBAAuB,GAAG,oBAAoB;AAC/C,MAAC,wBAAwB,GAAG,qBAAqB;AACjD,MAAC,aAAa,GAAGA,kBAAU,CAAC;AACxC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAEA,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,iBAAiB,EAAE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C,uBAAuB,GAAG,CAAC,KAAK,EAAE,SAAS,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,KAAK,CAACC,cAAO,CAAC,IAAIA,cAAO,CAAC,KAAK,CAAC,IAAIC,mBAAK,CAAC,SAAS,EAAE;AACzH,MAAC,aAAa,GAAG;AAC7B,EAAE,CAACC,kBAAY,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,KAAK,CAACF,cAAO,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;AAC7H,EAAE,CAACG,wBAAkB,GAAG,CAAC,KAAK,KAAKH,cAAO,CAAC,KAAK,CAAC;AACjD,EAAE,CAAC,uBAAuB,GAAG,uBAAuB;AACpD,EAAE,CAAC,wBAAwB,GAAG,uBAAuB;AACrD;;;;;;;;"}
1
+ {"version":3,"file":"transfer2.js","sources":["../../../../../../packages/components/transfer/src/transfer.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <transfer-panel\n ref=\"leftPanel\"\n :data=\"sourceData\"\n :option-render=\"optionRender\"\n :placeholder=\"panelFilterPlaceholder\"\n :title=\"leftPanelTitle\"\n :filterable=\"filterable\"\n :format=\"format\"\n :filter-method=\"filterMethod\"\n :default-checked=\"leftDefaultChecked\"\n :props=\"props.props\"\n @checked-change=\"onSourceCheckedChange\"\n >\n <slot name=\"left-footer\" />\n </transfer-panel>\n <div :class=\"ns.e('buttons')\">\n <el-button\n type=\"primary\"\n :class=\"[ns.e('button'), ns.is('with-texts', hasButtonTexts)]\"\n :disabled=\"isEmpty(checkedState.rightChecked)\"\n @click=\"addToLeft\"\n >\n <el-icon><arrow-left /></el-icon>\n <span v-if=\"!isUndefined(buttonTexts[0])\">{{ buttonTexts[0] }}</span>\n </el-button>\n <el-button\n type=\"primary\"\n :class=\"[ns.e('button'), ns.is('with-texts', hasButtonTexts)]\"\n :disabled=\"isEmpty(checkedState.leftChecked)\"\n @click=\"addToRight\"\n >\n <span v-if=\"!isUndefined(buttonTexts[1])\">{{ buttonTexts[1] }}</span>\n <el-icon><arrow-right /></el-icon>\n </el-button>\n </div>\n <transfer-panel\n ref=\"rightPanel\"\n :data=\"targetData\"\n :option-render=\"optionRender\"\n :placeholder=\"panelFilterPlaceholder\"\n :filterable=\"filterable\"\n :format=\"format\"\n :filter-method=\"filterMethod\"\n :title=\"rightPanelTitle\"\n :default-checked=\"rightDefaultChecked\"\n :props=\"props.props\"\n @checked-change=\"onTargetCheckedChange\"\n >\n <slot name=\"right-footer\" />\n </transfer-panel>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, h, reactive, ref, useSlots } from 'vue'\nimport { watch } from '../../config-provider'\nimport { debugWarn, isEmpty, isUndefined } from '@element-plus/utils'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { ElButton } from '@element-plus/components/button'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { useFormItem } from '@element-plus/components/form'\nimport { ArrowLeft, ArrowRight } from '@element-plus/icons-vue'\nimport { transferEmits, transferProps } from './transfer'\nimport {\n useCheckedChange,\n useComputedData,\n useMove,\n usePropsAlias,\n} from './composables'\nimport TransferPanel from './transfer-panel.vue'\n\nimport type {\n TransferCheckedState,\n TransferDataItem,\n TransferDirection,\n} from './transfer'\nimport type { TransferPanelInstance } from './transfer-panel'\n\ndefineOptions({\n name: 'ElTransfer',\n})\n\nconst props = defineProps(transferProps)\nconst emit = defineEmits(transferEmits)\nconst slots = useSlots()\n\nconst { t } = useLocale()\nconst ns = useNamespace('transfer')\nconst { formItem } = useFormItem()\n\nconst checkedState = reactive<TransferCheckedState>({\n leftChecked: [],\n rightChecked: [],\n})\n\nconst propsAlias = usePropsAlias(props)\n\nconst { sourceData, targetData } = useComputedData(props)\n\nconst { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(\n checkedState,\n emit\n)\n\nconst { addToLeft, addToRight } = useMove(props, checkedState, emit)\n\nconst leftPanel = ref<TransferPanelInstance>()\nconst rightPanel = ref<TransferPanelInstance>()\n\nconst clearQuery = (which: TransferDirection) => {\n switch (which) {\n case 'left':\n leftPanel.value!.query = ''\n break\n case 'right':\n rightPanel.value!.query = ''\n break\n }\n}\n\nconst hasButtonTexts = computed(() => props.buttonTexts.length === 2)\n\nconst leftPanelTitle = computed(\n () => props.titles[0] || t('el.transfer.titles.0')\n)\n\nconst rightPanelTitle = computed(\n () => props.titles[1] || t('el.transfer.titles.1')\n)\n\nconst panelFilterPlaceholder = computed(\n () => props.filterPlaceholder || t('el.transfer.filterPlaceholder')\n)\n\nwatch(\n () => props.modelValue,\n () => {\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n }\n)\n\nconst optionRender = computed(() => (option: TransferDataItem) => {\n if (props.renderContent) return props.renderContent(h, option)\n\n if (slots.default) return slots.default({ option })\n\n return h(\n 'span',\n option[propsAlias.value.label] || option[propsAlias.value.key]\n )\n})\n\ndefineExpose({\n /** @description clear the filter keyword of a certain panel */\n clearQuery,\n /** @description left panel ref */\n leftPanel,\n /** @description left panel ref */\n rightPanel,\n})\n</script>\n"],"names":["useSlots","useLocale","useNamespace","useFormItem","reactive","usePropsAlias","useComputedData","useCheckedChange","useMove","ref","computed","watch","debugWarn","h"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAgFc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAA,MAAM,QAAQA,YAAS,EAAA,CAAA;AAEvB,IAAM,MAAA,EAAE,MAAMC,eAAU,EAAA,CAAA;AACxB,IAAM,MAAA,EAAA,GAAKC,qBAAa,UAAU,CAAA,CAAA;AAClC,IAAM,MAAA,EAAE,aAAaC,uBAAY,EAAA,CAAA;AAEjC,IAAA,MAAM,eAAeC,YAA+B,CAAA;AAAA,MAClD,aAAa,EAAC;AAAA,MACd,cAAc,EAAC;AA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AAA,UAAA,EACZ,MAAM;AACJ,MAAA,IAAI;AACF,MAAU,IAAA,KAAA,CAAA,aAAW;AAAuC,QAC9D,CAAA,EAAA,GAAA,QAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,QAAA,CAAA,QAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,QAAA,EAAA,QAAA,CAAA,CAAA,KAAA,CAAA,CAAA,GAAA,KAAAC,eAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AAAA,OAEJ;AAEA,KAAA,CAAA,CAAA;AACE,IAAA,MAAI,YAAM,GAAAF,YAAA,CAAA,MAAA,CAAA,MAAA,KAAA;AAAe,MAAO,IAAA,KAAA,CAAA,aAAoB;AAEpD,QAAA,OAAU,KAAA,CAAA,aAAA,CAAAG,KAAA,EAAA,MAAA,CAAA,CAAA;AAAS,MAAA,IAAA,KAAO,CAAM,OAAA;AAEhC,QAAO,OACL,aACO,CAAA,EAAA,MAAA,EAAA,CAAA,CAAW;AACpB,MACD,OAAAA,KAAA,CAAA,MAAA,EAAA,MAAA,CAAA,UAAA,CAAA,KAAA,CAAA,KAAA,CAAA,IAAA,MAAA,CAAA,UAAA,CAAA,KAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AAED,KAAa,CAAA,CAAA;AAAA,IAEX,MAAA,CAAA;AAAA,MAEA,UAAA;AAAA,MAEA,SAAA;AAAA,MACD,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -13,7 +13,7 @@ export interface UploadRequestOptions {
13
13
  method: string;
14
14
  data: Record<string, string | Blob | [string | Blob, string]>;
15
15
  filename: string;
16
- file: File;
16
+ file: UploadRawFile;
17
17
  headers: Headers | Record<string, string | number | null | undefined>;
18
18
  onError: (evt: UploadAjaxError) => void;
19
19
  onProgress: (evt: UploadProgressEvent) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"upload2.js","sources":["../../../../../../packages/components/upload/src/upload.ts"],"sourcesContent":["import { NOOP } from '@vue/shared'\nimport { buildProps, definePropType, mutable } from '@element-plus/utils'\nimport { ajaxUpload } from './ajax'\n\nimport type { UploadAjaxError } from './ajax'\nimport type { Awaitable } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Upload from './upload.vue'\n\nexport const uploadListTypes = ['text', 'picture', 'picture-card'] as const\n\nlet fileId = 1\nexport const genFileId = () => Date.now() + fileId++\n\nexport type UploadStatus = 'ready' | 'uploading' | 'success' | 'fail'\nexport interface UploadProgressEvent extends ProgressEvent {\n percent: number\n}\n\nexport interface UploadRequestOptions {\n action: string\n method: string\n data: Record<string, string | Blob | [string | Blob, string]>\n filename: string\n file: File\n headers: Headers | Record<string, string | number | null | undefined>\n onError: (evt: UploadAjaxError) => void\n onProgress: (evt: UploadProgressEvent) => void\n onSuccess: (response: any) => void\n withCredentials: boolean\n}\nexport interface UploadFile {\n name: string\n percentage?: number\n status: UploadStatus\n size?: number\n response?: unknown\n uid: number\n url?: string\n raw?: UploadRawFile\n}\nexport type UploadUserFile = Omit<UploadFile, 'status' | 'uid'> &\n Partial<Pick<UploadFile, 'status' | 'uid'>>\n\nexport type UploadFiles = UploadFile[]\nexport interface UploadRawFile extends File {\n uid: number\n}\nexport type UploadRequestHandler = (\n options: UploadRequestOptions\n) => XMLHttpRequest | Promise<unknown>\nexport interface UploadHooks {\n beforeUpload: (\n rawFile: UploadRawFile\n ) => Awaitable<void | undefined | null | boolean | File | Blob>\n beforeRemove: (\n uploadFile: UploadFile,\n uploadFiles: UploadFiles\n ) => Awaitable<boolean>\n onRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void\n onChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void\n onPreview: (uploadFile: UploadFile) => void\n onSuccess: (\n response: any,\n uploadFile: UploadFile,\n uploadFiles: UploadFiles\n ) => void\n onProgress: (\n evt: UploadProgressEvent,\n uploadFile: UploadFile,\n uploadFiles: UploadFiles\n ) => void\n onError: (\n error: Error,\n uploadFile: UploadFile,\n uploadFiles: UploadFiles\n ) => void\n onExceed: (files: File[], uploadFiles: UploadUserFile[]) => void\n}\n\nexport const uploadBaseProps = buildProps({\n uploadConfig: String,\n action: {\n type: String,\n default: '#',\n },\n headers: {\n type: definePropType<Headers | Record<string, any>>(Object),\n },\n method: {\n type: String,\n default: 'post',\n },\n data: {\n type: Object,\n default: () => mutable({} as const),\n },\n multiple: {\n type: Boolean,\n default: false,\n },\n name: {\n type: String,\n default: 'file',\n },\n drag: {\n type: Boolean,\n default: false,\n },\n withCredentials: Boolean,\n showFileList: {\n type: Boolean,\n default: true,\n },\n accept: {\n type: String,\n default: '',\n },\n type: {\n type: String,\n default: 'select',\n },\n fileList: {\n type: definePropType<UploadUserFile[]>(Array),\n default: () => mutable([] as const),\n },\n autoUpload: {\n type: Boolean,\n default: true,\n },\n listType: {\n type: String,\n values: uploadListTypes,\n default: 'text',\n },\n httpRequest: {\n type: definePropType<UploadRequestHandler>(Function),\n default: ajaxUpload,\n },\n disabled: Boolean,\n limit: Number,\n} as const)\n\nexport const uploadProps = buildProps({\n ...uploadBaseProps,\n beforeUpload: {\n type: definePropType<UploadHooks['beforeUpload']>(Function),\n default: NOOP,\n },\n beforeRemove: {\n type: definePropType<UploadHooks['beforeRemove']>(Function),\n },\n onRemove: {\n type: definePropType<UploadHooks['onRemove']>(Function),\n default: NOOP,\n },\n onChange: {\n type: definePropType<UploadHooks['onChange']>(Function),\n default: NOOP,\n },\n onPreview: {\n type: definePropType<UploadHooks['onPreview']>(Function),\n default: NOOP,\n },\n onSuccess: {\n type: definePropType<UploadHooks['onSuccess']>(Function),\n default: NOOP,\n },\n onProgress: {\n type: definePropType<UploadHooks['onProgress']>(Function),\n default: NOOP,\n },\n onError: {\n type: definePropType<UploadHooks['onError']>(Function),\n default: NOOP,\n },\n onExceed: {\n type: definePropType<UploadHooks['onExceed']>(Function),\n default: NOOP,\n },\n} as const)\n\nexport type UploadProps = ExtractPropTypes<typeof uploadProps>\n\nexport type UploadInstance = InstanceType<typeof Upload>\n"],"names":["buildProps","definePropType","mutable","ajaxUpload","NOOP"],"mappings":";;;;;;;;;;AAGY,MAAC,eAAe,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE;AACnE,IAAI,MAAM,GAAG,CAAC,CAAC;AACH,MAAC,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,GAAG;AACzC,MAAC,eAAe,GAAGA,kBAAU,CAAC;AAC1C,EAAE,YAAY,EAAE,MAAM;AACtB,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAEC,sBAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAMC,kBAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,eAAe,EAAE,OAAO;AAC1B,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,MAAM,EAAE;A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EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEH,sBAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAEG,WAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAEH,sBAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAEG,WAAI;AACjB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAEH,sBAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAEG,WAAI;AACjB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAEH,sBAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAEG,WAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAEH,sBAAc,CAAC,QAAQ,CAAC;AAClC,IAAI,OAAO,EAAEG,WAAI;AACjB,GAAG;AACH,CAAC;;;;;;;"}
1
+ {"version":3,"file":"upload2.js","sources":["../../../../../../packages/components/upload/src/upload.ts"],"sourcesContent":["import { NOOP } from '@vue/shared'\nimport { buildProps, definePropType, mutable } from '@element-plus/utils'\nimport { ajaxUpload } from './ajax'\n\nimport type { UploadAjaxError } from './ajax'\nimport type { Awaitable } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Upload from './upload.vue'\n\nexport const uploadListTypes = ['text', 'picture', 'picture-card'] as const\n\nlet fileId = 1\nexport const genFileId = () => Date.now() + fileId++\n\nexport type UploadStatus = 'ready' | 'uploading' | 'success' | 'fail'\nexport interface UploadProgressEvent extends ProgressEvent {\n percent: number\n}\n\nexport interface UploadRequestOptions {\n action: string\n method: string\n data: Record<string, string | Blob | [string | Blob, string]>\n filename: string\n file: UploadRawFile\n headers: Headers | Record<string, string | number | null | undefined>\n onError: (evt: UploadAjaxError) => void\n onProgress: (evt: UploadProgressEvent) => void\n onSuccess: (response: any) => void\n withCredentials: boolean\n}\nexport interface UploadFile {\n name: string\n percentage?: number\n status: UploadStatus\n size?: number\n response?: unknown\n uid: number\n url?: string\n raw?: UploadRawFile\n}\nexport type UploadUserFile = Omit<UploadFile, 'status' | 'uid'> &\n Partial<Pick<UploadFile, 'status' | 'uid'>>\n\nexport type UploadFiles = UploadFile[]\nexport interface UploadRawFile extends File {\n uid: number\n}\nexport type UploadRequestHandler = (\n options: UploadRequestOptions\n) => XMLHttpRequest | Promise<unknown>\nexport interface UploadHooks {\n beforeUpload: (\n rawFile: UploadRawFile\n ) => Awaitable<void | undefined | null | boolean | File | Blob>\n beforeRemove: (\n uploadFile: UploadFile,\n uploadFiles: UploadFiles\n ) => Awaitable<boolean>\n onRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void\n onChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => void\n onPreview: (uploadFile: UploadFile) => void\n onSuccess: (\n response: any,\n uploadFile: UploadFile,\n uploadFiles: UploadFiles\n ) => void\n onProgress: (\n evt: UploadProgressEvent,\n uploadFile: UploadFile,\n uploadFiles: UploadFiles\n ) => void\n onError: (\n error: Error,\n uploadFile: UploadFile,\n uploadFiles: UploadFiles\n ) => void\n onExceed: (files: File[], uploadFiles: UploadUserFile[]) => void\n}\n\nexport const uploadBaseProps = buildProps({\n uploadConfig: String,\n action: {\n type: String,\n default: '#',\n },\n headers: {\n type: definePropType<Headers | Record<string, any>>(Object),\n },\n method: {\n type: String,\n default: 'post',\n },\n data: {\n type: Object,\n default: () => mutable({} as const),\n },\n multiple: {\n type: Boolean,\n default: false,\n },\n name: {\n type: String,\n default: 'file',\n },\n drag: {\n type: Boolean,\n default: false,\n },\n withCredentials: Boolean,\n showFileList: {\n type: Boolean,\n default: true,\n },\n accept: {\n type: String,\n default: '',\n },\n type: {\n type: String,\n default: 'select',\n },\n fileList: {\n type: definePropType<UploadUserFile[]>(Array),\n default: () => mutable([] as const),\n },\n autoUpload: {\n type: Boolean,\n default: true,\n },\n listType: {\n type: String,\n values: uploadListTypes,\n default: 'text',\n },\n httpRequest: {\n type: definePropType<UploadRequestHandler>(Function),\n default: ajaxUpload,\n },\n disabled: Boolean,\n limit: Number,\n} as const)\n\nexport const uploadProps = buildProps({\n ...uploadBaseProps,\n beforeUpload: {\n type: definePropType<UploadHooks['beforeUpload']>(Function),\n default: NOOP,\n },\n beforeRemove: {\n type: definePropType<UploadHooks['beforeRemove']>(Function),\n },\n onRemove: {\n type: definePropType<UploadHooks['onRemove']>(Function),\n default: NOOP,\n },\n onChange: {\n type: definePropType<UploadHooks['onChange']>(Function),\n default: NOOP,\n },\n onPreview: {\n type: definePropType<UploadHooks['onPreview']>(Function),\n default: NOOP,\n },\n onSuccess: {\n type: definePropType<UploadHooks['onSuccess']>(Function),\n default: NOOP,\n },\n onProgress: {\n type: definePropType<UploadHooks['onProgress']>(Function),\n default: NOOP,\n },\n onError: {\n type: definePropType<UploadHooks['onError']>(Function),\n default: NOOP,\n },\n onExceed: {\n type: definePropType<UploadHooks['onExceed']>(Function),\n default: NOOP,\n },\n} as const)\n\nexport type UploadProps = ExtractPropTypes<typeof uploadProps>\n\nexport type UploadInstance = InstanceType<typeof Upload>\n"],"names":["buildProps","definePropType","mutable","ajaxUpload","NOOP"],"mappings":";;;;;;;;;;AAGY,MAAC,eAAe,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE;AACnE,IAAI,MAAM,GAAG,CAAC,CAAC;AACH,MAAC,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,GAAG;AACzC,MAAC,eAAe,GAAGA,kBAAU,CAAC;AAC1C,EAAE,YAAY,EAAE,MAAM;AACtB,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAEC,sBAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MA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target, { afterFocus, afterBlur } = {}) {
31
31
  };
32
32
  vue.watch(wrapperRef, (el) => {
33
33
  if (el) {
34
- el.setAttribute("role", "button");
35
34
  el.setAttribute("tabindex", "-1");
36
35
  }
37
36
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-focus-controller/index.ts"],"sourcesContent":["import { getCurrentInstance, ref, shallowRef, watch } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport type { ShallowRef } from 'vue'\n\ninterface UseFocusControllerOptions {\n afterFocus?: () => void\n afterBlur?: () => void\n}\n\nexport function useFocusController<T extends HTMLElement>(\n target: ShallowRef<T | undefined>,\n { afterFocus, afterBlur }: UseFocusControllerOptions = {}\n) {\n const instance = getCurrentInstance()!\n const { emit } = instance\n const wrapperRef = shallowRef<HTMLElement>()\n const isFocused = ref(false)\n\n const handleFocus = (event: FocusEvent) => {\n if (isFocused.value) return\n isFocused.value = true\n emit('focus', event)\n afterFocus?.()\n }\n\n const handleBlur = (event: FocusEvent) => {\n if (\n event.relatedTarget &&\n wrapperRef.value?.contains(event.relatedTarget as Node)\n )\n return\n\n isFocused.value = false\n emit('blur', event)\n afterBlur?.()\n }\n\n const handleClick = () => {\n target.value?.focus()\n }\n\n watch(wrapperRef, (el) => {\n if (el) {\n el.setAttribute('role', 'button')\n el.setAttribute('tabindex', '-1')\n }\n })\n\n // TODO: using useEventListener will fail the test\n // useEventListener(target, 'focus', handleFocus)\n // useEventListener(target, 'blur', handleBlur)\n useEventListener(wrapperRef, 'click', handleClick)\n\n return {\n wrapperRef,\n isFocused,\n handleFocus,\n handleBlur,\n }\n}\n"],"names":["getCurrentInstance","shallowRef","ref","watch","useEventListener"],"mappings":";;;;;;;AAEO,SAAS,kBAAkB,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE;AAC3E,EAAE,MAAM,QAAQ,GAAGA,sBAAkB,EAAE,CAAC;AACxC,EAAE,MAAM,EAAE,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,QAAQ,CAAC,CAAC;AACxC,MAAM,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AACxC,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAEC,qBAAgB,CAAC,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AACrD,EAAE,OAAO;AACT,IAAI,UAAU;AACd,IAAI,SAAS;AACb,IAAI,WAAW;AACf,IAAI,UAAU;AACd,GAAG,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-focus-controller/index.ts"],"sourcesContent":["import { getCurrentInstance, ref, shallowRef, watch } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport type { ShallowRef } from 'vue'\n\ninterface UseFocusControllerOptions {\n afterFocus?: () => void\n afterBlur?: () => void\n}\n\nexport function useFocusController<T extends HTMLElement>(\n target: ShallowRef<T | undefined>,\n { afterFocus, afterBlur }: UseFocusControllerOptions = {}\n) {\n const instance = getCurrentInstance()!\n const { emit } = instance\n const wrapperRef = shallowRef<HTMLElement>()\n const isFocused = ref(false)\n\n const handleFocus = (event: FocusEvent) => {\n if (isFocused.value) return\n isFocused.value = true\n emit('focus', event)\n afterFocus?.()\n }\n\n const handleBlur = (event: FocusEvent) => {\n if (\n event.relatedTarget &&\n wrapperRef.value?.contains(event.relatedTarget as Node)\n )\n return\n\n isFocused.value = false\n emit('blur', event)\n afterBlur?.()\n }\n\n const handleClick = () => {\n target.value?.focus()\n }\n\n watch(wrapperRef, (el) => {\n if (el) {\n el.setAttribute('tabindex', '-1')\n }\n })\n\n // TODO: using useEventListener will fail the test\n // useEventListener(target, 'focus', handleFocus)\n // useEventListener(target, 'blur', handleBlur)\n useEventListener(wrapperRef, 'click', handleClick)\n\n return {\n wrapperRef,\n isFocused,\n handleFocus,\n handleBlur,\n }\n}\n"],"names":["getCurrentInstance","shallowRef","ref","watch","useEventListener"],"mappings":";;;;;;;AAEO,SAAS,kBAAkB,CAAC,MAAM,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ACJ,EAAEC,SAAK,CAAC,UAAU,EAAE,CAAC,EAAE,KAAK;AAC5B,IAAI,IAAI,EAAE,EAAE;AACZ,MAAM,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AACxC,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAEC,qBAAgB,CAAC,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AACrD,EAAE,OAAO;AACT,IAAI,UAAU;AACd,IAAI,SAAS;AACb,IAAI,WAAW;AACf,IAAI,UAAU;AACd,GAAG,CAAC;AACJ;;;;"}
@@ -21,7 +21,7 @@ const _bem = (namespace, block, blockSuffix, element, modifier) => {
21
21
  };
22
22
  const namespaceContextKey = Symbol("namespaceContextKey");
23
23
  const useGetDerivedNamespace = (namespaceOverrides) => {
24
- const derivedNamespace = namespaceOverrides || vue.inject(namespaceContextKey, vue.ref(defaultNamespace));
24
+ const derivedNamespace = namespaceOverrides || (vue.getCurrentInstance() ? vue.inject(namespaceContextKey, vue.ref(defaultNamespace)) : vue.ref(defaultNamespace));
25
25
  const namespace = vue.computed(() => {
26
26
  return vue.unref(derivedNamespace) || defaultNamespace;
27
27
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-namespace/index.ts"],"sourcesContent":["import { computed, inject, ref, unref } from 'vue'\n\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const defaultNamespace = 'el'\nconst statePrefix = 'is-'\n\nconst _bem = (\n namespace: string,\n block: string,\n blockSuffix: string,\n element: string,\n modifier: string\n) => {\n let cls = `${namespace}-${block}`\n if (blockSuffix) {\n cls += `-${blockSuffix}`\n }\n if (element) {\n cls += `__${element}`\n }\n if (modifier) {\n cls += `--${modifier}`\n }\n return cls\n}\n\nexport const namespaceContextKey: InjectionKey<Ref<string | undefined>> =\n Symbol('namespaceContextKey')\n\nexport const useGetDerivedNamespace = (\n namespaceOverrides?: Ref<string | undefined>\n) => {\n const derivedNamespace =\n namespaceOverrides || inject(namespaceContextKey, ref(defaultNamespace))\n const namespace = computed(() => {\n return unref(derivedNamespace) || defaultNamespace\n })\n return namespace\n}\n\nexport const useNamespace = (\n block: string,\n namespaceOverrides?: Ref<string | undefined>\n) => {\n const namespace = useGetDerivedNamespace(namespaceOverrides)\n const b = (blockSuffix = '') =>\n _bem(namespace.value, block, blockSuffix, '', '')\n const e = (element?: string) =>\n element ? _bem(namespace.value, block, '', element, '') : ''\n const m = (modifier?: string) =>\n modifier ? _bem(namespace.value, block, '', '', modifier) : ''\n const be = (blockSuffix?: string, element?: string) =>\n blockSuffix && element\n ? _bem(namespace.value, block, blockSuffix, element, '')\n : ''\n const em = (element?: string, modifier?: string) =>\n element && modifier\n ? _bem(namespace.value, block, '', element, modifier)\n : ''\n const bm = (blockSuffix?: string, modifier?: string) =>\n blockSuffix && modifier\n ? _bem(namespace.value, block, blockSuffix, '', modifier)\n : ''\n const bem = (blockSuffix?: string, element?: string, modifier?: string) =>\n blockSuffix && element && modifier\n ? _bem(namespace.value, block, blockSuffix, element, modifier)\n : ''\n const is: {\n (name: string, state: boolean | undefined): string\n (name: string): string\n } = (name: string, ...args: [boolean | undefined] | []) => {\n const state = args.length >= 1 ? args[0]! : true\n return name && state ? `${statePrefix}${name}` : ''\n }\n\n // for css var\n // --el-xxx: value;\n const cssVar = (object: Record<string, string>) => {\n const styles: Record<string, string> = {}\n for (const key in object) {\n if (object[key]) {\n styles[`--${namespace.value}-${key}`] = object[key]\n }\n }\n return styles\n }\n // with block\n const cssVarBlock = (object: Record<string, string>) => {\n const styles: Record<string, string> = {}\n for (const key in object) {\n if (object[key]) {\n styles[`--${namespace.value}-${block}-${key}`] = object[key]\n }\n }\n return styles\n }\n\n const cssVarName = (name: string) => `--${namespace.value}-${name}`\n const cssVarBlockName = (name: string) =>\n `--${namespace.value}-${block}-${name}`\n\n return {\n namespace,\n b,\n e,\n m,\n be,\n em,\n bm,\n bem,\n is,\n // css\n cssVar,\n cssVarName,\n cssVarB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AAS,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC9D,EAAE,MAAM,eAAe,GAAG,CAAC,IAAI,KAAK,CAAC,EAAE,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC5E,EAAE,OAAO;AACT,IAAI,SAAS;AACb,IAAI,CAAC;AACL,IAAI,CAAC;AACL,IAAI,CAAC;AACL,IAAI,EAAE;AACN,IAAI,EAAE;AACN,IAAI,EAAE;AACN,IAAI,GAAG;AACP,IAAI,EAAE;AACN,IAAI,MAAM;AACV,IAAI,UAAU;AACd,IAAI,WAAW;AACf,IAAI,eAAe;AACnB,GAAG,CAAC;AACJ;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-namespace/index.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, ref, unref } from 'vue'\n\nimport type { InjectionKey, Ref } from 'vue'\n\nexport const defaultNamespace = 'el'\nconst statePrefix = 'is-'\n\nconst _bem = (\n namespace: string,\n block: string,\n blockSuffix: string,\n element: string,\n modifier: string\n) => {\n let cls = `${namespace}-${block}`\n if (blockSuffix) {\n cls += `-${blockSuffix}`\n }\n if (element) {\n cls += `__${element}`\n }\n if (modifier) {\n cls += `--${modifier}`\n }\n return cls\n}\n\nexport const namespaceContextKey: InjectionKey<Ref<string | undefined>> =\n Symbol('namespaceContextKey')\n\nexport const useGetDerivedNamespace = (\n namespaceOverrides?: Ref<string | undefined>\n) => {\n const derivedNamespace =\n namespaceOverrides ||\n (getCurrentInstance()\n ? inject(namespaceContextKey, ref(defaultNamespace))\n : ref(defaultNamespace))\n const namespace = computed(() => {\n return unref(derivedNamespace) || defaultNamespace\n })\n return namespace\n}\n\nexport const useNamespace = (\n block: string,\n namespaceOverrides?: Ref<string | undefined>\n) => {\n const namespace = useGetDerivedNamespace(namespaceOverrides)\n const b = (blockSuffix = '') =>\n _bem(namespace.value, block, blockSuffix, '', '')\n const e = (element?: string) =>\n element ? _bem(namespace.value, block, '', element, '') : ''\n const m = (modifier?: string) =>\n modifier ? _bem(namespace.value, block, '', '', modifier) : ''\n const be = (blockSuffix?: string, element?: string) =>\n blockSuffix && element\n ? _bem(namespace.value, block, blockSuffix, element, '')\n : ''\n const em = (element?: string, modifier?: string) =>\n element && modifier\n ? _bem(namespace.value, block, '', element, modifier)\n : ''\n const bm = (blockSuffix?: string, modifier?: string) =>\n blockSuffix && modifier\n ? _bem(namespace.value, block, blockSuffix, '', modifier)\n : ''\n const bem = (blockSuffix?: string, element?: string, modifier?: string) =>\n blockSuffix && element && modifier\n ? _bem(namespace.value, block, blockSuffix, element, modifier)\n : ''\n const is: {\n (name: string, state: boolean | undefined): string\n (name: string): string\n } = (name: string, ...args: [boolean | undefined] | []) => {\n const state = args.length >= 1 ? args[0]! : true\n return name && state ? `${statePrefix}${name}` : ''\n }\n\n // for css var\n // --el-xxx: value;\n const cssVar = (object: Record<string, string>) => {\n const styles: Record<string, string> = {}\n for (const key in object) {\n if (object[key]) {\n styles[`--${namespace.value}-${key}`] = object[key]\n }\n }\n return styles\n }\n // with block\n const cssVarBlock = (object: Record<string, string>) => {\n const styles: Record<string, string> = {}\n for (const key in object) {\n if (object[key]) {\n styles[`--${namespace.value}-${block}-${key}`] = object[key]\n }\n }\n return styles\n }\n\n const cssVarName = (name: string) => `--${namespace.value}-${name}`\n const cssVarBlockName = (name: string) =>\n `--${namespace.value}-${block}-${name}`\n\n return {\n namespace,\n b,\n e,\n m,\n be,\n em,\n bm,\n bem,\n is,\n // css\n cssVar,\n cssVarName,\n cssVarBlock,\n cssVarBlockName,\n }\n}\n\nexport type UseNamespaceReturn = ReturnType<typeof useNamespace>\n"],"names":["getCurrentInstance","inject","ref","computed","unref"],"mappings":";;;;;;AACY,MAAC,gBAAgB,GAAG,KAAK;AACrC,MAAM,WAAW,GAAG,KAAK,CAAC;AAC1B,MAAM,IAAI,GAAG,CAAC,SAAS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,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAC5E,EAAE,OAAO;AACT,IAAI,SAAS;AACb,IAAI,CAAC;AACL,IAAI,CAAC;AACL,IAAI,CAAC;AACL,IAAI,EAAE;AACN,IAAI,EAAE;AACN,IAAI,EAAE;AACN,IAAI,GAAG;AACP,IAAI,EAAE;AACN,IAAI,MAAM;AACV,IAAI,UAAU;AACd,IAAI,WAAW;AACf,IAAI,eAAe;AACnB,GAAG,CAAC;AACJ;;;;;;;"}
@@ -10,7 +10,7 @@ const zIndex = vue.ref(0);
10
10
  const defaultInitialZIndex = 2e3;
11
11
  const zIndexContextKey = Symbol("zIndexContextKey");
12
12
  const useZIndex = (zIndexOverrides) => {
13
- const zIndexInjection = zIndexOverrides || vue.inject(zIndexContextKey, void 0);
13
+ const zIndexInjection = zIndexOverrides || (vue.getCurrentInstance() ? vue.inject(zIndexContextKey, void 0) : void 0);
14
14
  const initialZIndex = vue.computed(() => {
15
15
  const zIndexFromInjection = vue.unref(zIndexInjection);
16
16
  return types.isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-z-index/index.ts"],"sourcesContent":["import { computed, inject, ref, unref } from 'vue'\nimport { isNumber } from '@element-plus/utils'\n\nimport type { InjectionKey, Ref } from 'vue'\n\nconst zIndex = ref(0)\nexport const defaultInitialZIndex = 2000\n\nexport const zIndexContextKey: InjectionKey<Ref<number | undefined>> =\n Symbol('zIndexContextKey')\n\nexport const useZIndex = (zIndexOverrides?: Ref<number>) => {\n const zIndexInjection = zIndexOverrides || inject(zIndexContextKey, undefined)\n const initialZIndex = computed(() => {\n const zIndexFromInjection = unref(zIndexInjection)\n return isNumber(zIndexFromInjection)\n ? zIndexFromInjection\n : defaultInitialZIndex\n })\n const currentZIndex = computed(() => initialZIndex.value + zIndex.value)\n\n const nextZIndex = () => {\n zIndex.value++\n return currentZIndex.value\n }\n\n return {\n initialZIndex,\n currentZIndex,\n nextZIndex,\n }\n}\n\nexport type UseZIndexReturn = ReturnType<typeof useZIndex>\n"],"names":["ref","inject","computed","unref","isNumber"],"mappings":";;;;;;;;AAEA,MAAM,MAAM,GAAGA,OAAG,CAAC,CAAC,CAAC,CAAC;AACV,MAAC,oBAAoB,GAAG,IAAI;AAC5B,MAAC,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,EAAE;AAC/C,MAAC,SAAS,GAAG,CAAC,eAAe,KAAK;AAC9C,EAAE,MAAM,eAAe,GAAG,eAAe,IAAIC,UAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC;AAC9E,EAAE,MAAM,aAAa,GAAGC,YAAQ,CAAC,MAAM;AACvC,IAAI,MAAM,mBAAmB,GAAGC,SAAK,CAAC,eAAe,CAAC,CAAC;AACvD,IAAI,OAAOC,cAAQ,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AACtF,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,aAAa,GAAGF,YAAQ,CAAC,MAAM,aAAa,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3E,EAAE,MAAM,UAAU,GAAG,MAAM;AAC3B,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;AACnB,IAAI,OAAO,aAAa,CAAC,KAAK,CAAC;AAC/B,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,aAAa;AACjB,IAAI,aAAa;AACjB,IAAI,UAAU;AACd,GAAG,CAAC;AACJ;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-z-index/index.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, ref, unref } from 'vue'\nimport { isNumber } from '@element-plus/utils'\n\nimport type { InjectionKey, Ref } from 'vue'\n\nconst zIndex = ref(0)\nexport const defaultInitialZIndex = 2000\n\nexport const zIndexContextKey: InjectionKey<Ref<number | undefined>> =\n Symbol('zIndexContextKey')\n\nexport const useZIndex = (zIndexOverrides?: Ref<number>) => {\n const zIndexInjection =\n zIndexOverrides ||\n (getCurrentInstance() ? inject(zIndexContextKey, undefined) : undefined)\n const initialZIndex = computed(() => {\n const zIndexFromInjection = unref(zIndexInjection)\n return isNumber(zIndexFromInjection)\n ? zIndexFromInjection\n : defaultInitialZIndex\n })\n const currentZIndex = computed(() => initialZIndex.value + zIndex.value)\n\n const nextZIndex = () => {\n zIndex.value++\n return currentZIndex.value\n }\n\n return {\n initialZIndex,\n currentZIndex,\n nextZIndex,\n }\n}\n\nexport type UseZIndexReturn = ReturnType<typeof useZIndex>\n"],"names":["ref","getCurrentInstance","inject","computed","unref","isNumber"],"mappings":";;;;;;;;AAEA,MAAM,MAAM,GAAGA,OAAG,CAAC,CAAC,CAAC,CAAC;AACV,MAAC,oBAAoB,GAAG,IAAI;AAC5B,MAAC,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,EAAE;AAC/C,MAAC,SAAS,GAAG,CAAC,eAAe,KAAK;AAC9C,EAAE,MAAM,eAAe,GAAG,eAAe,KAAKC,sBAAkB,EAAE,GAAGC,UAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;AAChH,EAAE,MAAM,aAAa,GAAGC,YAAQ,CAAC,MAAM;AACvC,IAAI,MAAM,mBAAmB,GAAGC,SAAK,CAAC,eAAe,CAAC,CAAC;AACvD,IAAI,OAAOC,cAAQ,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AACtF,GAAG,CAAC,CAAC;AACL,EAAE,MAAM,aAAa,GAAGF,YAAQ,CAAC,MAAM,aAAa,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC3E,EAAE,MAAM,UAAU,GAAG,MAAM;AAC3B,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;AACnB,IAAI,OAAO,aAAa,CAAC,KAAK,CAAC;AAC/B,GAAG,CAAC;AACJ,EAAE,OAAO;AACT,IAAI,aAAa;AACjB,IAAI,aAAa;AACjB,IAAI,UAAU;AACd,GAAG,CAAC;AACJ;;;;;;"}