element-pe 2.2.83 → 2.2.84

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 (472) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.full.js +48 -11
  3. package/dist/index.full.min.js +20 -20
  4. package/dist/index.full.min.js.map +1 -1
  5. package/dist/index.full.min.mjs +21 -21
  6. package/dist/index.full.min.mjs.map +1 -1
  7. package/dist/index.full.mjs +48 -11
  8. package/es/components/affix/index.mjs +2 -2
  9. package/es/components/affix/src/affix.mjs +119 -26
  10. package/es/components/affix/src/affix.mjs.map +1 -1
  11. package/es/components/affix/src/affix2.mjs +26 -119
  12. package/es/components/affix/src/affix2.mjs.map +1 -1
  13. package/es/components/alert/index.mjs +2 -2
  14. package/es/components/alert/src/alert.mjs +38 -103
  15. package/es/components/alert/src/alert.mjs.map +1 -1
  16. package/es/components/alert/src/alert2.mjs +103 -38
  17. package/es/components/alert/src/alert2.mjs.map +1 -1
  18. package/es/components/autocomplete/src/autocomplete.mjs +1 -1
  19. package/es/components/breadcrumb/index.mjs +2 -2
  20. package/es/components/breadcrumb/src/breadcrumb.mjs +11 -36
  21. package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
  22. package/es/components/breadcrumb/src/breadcrumb2.mjs +36 -11
  23. package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
  24. package/es/components/calendar/index.mjs +2 -2
  25. package/es/components/calendar/src/calendar.mjs +131 -18
  26. package/es/components/calendar/src/calendar.mjs.map +1 -1
  27. package/es/components/calendar/src/calendar2.mjs +18 -131
  28. package/es/components/calendar/src/calendar2.mjs.map +1 -1
  29. package/es/components/calendar/src/date-table.mjs +87 -33
  30. package/es/components/calendar/src/date-table.mjs.map +1 -1
  31. package/es/components/calendar/src/date-table2.mjs +33 -87
  32. package/es/components/calendar/src/date-table2.mjs.map +1 -1
  33. package/es/components/calendar/src/use-date-table.mjs +1 -1
  34. package/es/components/carousel/index.mjs +2 -2
  35. package/es/components/carousel/src/carousel.mjs +169 -56
  36. package/es/components/carousel/src/carousel.mjs.map +1 -1
  37. package/es/components/carousel/src/carousel2.mjs +56 -169
  38. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  39. package/es/components/cascader/src/cascader.mjs +1 -1
  40. package/es/components/checkbox/index.mjs +2 -2
  41. package/es/components/checkbox/src/checkbox-group.mjs +72 -33
  42. package/es/components/checkbox/src/checkbox-group.mjs.map +1 -1
  43. package/es/components/checkbox/src/checkbox-group2.mjs +33 -72
  44. package/es/components/checkbox/src/checkbox-group2.mjs.map +1 -1
  45. package/es/components/col/index.mjs +2 -2
  46. package/es/components/col/src/col.mjs +66 -43
  47. package/es/components/col/src/col.mjs.map +1 -1
  48. package/es/components/col/src/col2.mjs +43 -66
  49. package/es/components/col/src/col2.mjs.map +1 -1
  50. package/es/components/color-picker/src/color-picker2.mjs +1 -1
  51. package/es/components/dialog/src/dialog-content.mjs +30 -96
  52. package/es/components/dialog/src/dialog-content.mjs.map +1 -1
  53. package/es/components/dialog/src/dialog-content2.mjs +96 -30
  54. package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
  55. package/es/components/dialog/src/dialog.mjs +1 -1
  56. package/es/components/dialog/src/dialog2.mjs +1 -1
  57. package/es/components/drawer/index.mjs +2 -2
  58. package/es/components/drawer/src/drawer.mjs +187 -29
  59. package/es/components/drawer/src/drawer.mjs.map +1 -1
  60. package/es/components/drawer/src/drawer2.mjs +29 -187
  61. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  62. package/es/components/dropdown/index.mjs +2 -2
  63. package/es/components/dropdown/src/dropdown-item-impl.mjs +2 -2
  64. package/es/components/dropdown/src/dropdown-item.mjs +1 -1
  65. package/es/components/dropdown/src/dropdown-menu.mjs +2 -2
  66. package/es/components/dropdown/src/dropdown.d.ts +1 -2
  67. package/es/components/dropdown/src/dropdown.mjs +310 -109
  68. package/es/components/dropdown/src/dropdown.mjs.map +1 -1
  69. package/es/components/dropdown/src/dropdown2.mjs +109 -310
  70. package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
  71. package/es/components/form/index.mjs +4 -4
  72. package/es/components/form/src/form-item.mjs +328 -46
  73. package/es/components/form/src/form-item.mjs.map +1 -1
  74. package/es/components/form/src/form-item2.mjs +46 -328
  75. package/es/components/form/src/form-item2.mjs.map +1 -1
  76. package/es/components/form/src/form.mjs +58 -150
  77. package/es/components/form/src/form.mjs.map +1 -1
  78. package/es/components/form/src/form2.mjs +150 -58
  79. package/es/components/form/src/form2.mjs.map +1 -1
  80. package/es/components/icon/index.mjs +2 -2
  81. package/es/components/icon/src/icon.mjs +8 -36
  82. package/es/components/icon/src/icon.mjs.map +1 -1
  83. package/es/components/icon/src/icon2.mjs +36 -8
  84. package/es/components/icon/src/icon2.mjs.map +1 -1
  85. package/es/components/image-viewer/index.mjs +2 -2
  86. package/es/components/image-viewer/src/image-viewer.mjs +403 -32
  87. package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
  88. package/es/components/image-viewer/src/image-viewer2.mjs +32 -403
  89. package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
  90. package/es/components/index.mjs +32 -32
  91. package/es/components/input-number/index.mjs +2 -2
  92. package/es/components/input-number/src/input-number.mjs +69 -335
  93. package/es/components/input-number/src/input-number.mjs.map +1 -1
  94. package/es/components/input-number/src/input-number2.mjs +335 -69
  95. package/es/components/input-number/src/input-number2.mjs.map +1 -1
  96. package/es/components/link/index.mjs +2 -2
  97. package/es/components/link/src/link.mjs +21 -50
  98. package/es/components/link/src/link.mjs.map +1 -1
  99. package/es/components/link/src/link2.mjs +50 -21
  100. package/es/components/link/src/link2.mjs.map +1 -1
  101. package/es/components/menu/index.mjs +2 -2
  102. package/es/components/menu/src/menu-item.mjs +14 -97
  103. package/es/components/menu/src/menu-item.mjs.map +1 -1
  104. package/es/components/menu/src/menu-item2.mjs +97 -14
  105. package/es/components/menu/src/menu-item2.mjs.map +1 -1
  106. package/es/components/pagination/src/components/next.mjs +19 -38
  107. package/es/components/pagination/src/components/next.mjs.map +1 -1
  108. package/es/components/pagination/src/components/next2.mjs +38 -19
  109. package/es/components/pagination/src/components/next2.mjs.map +1 -1
  110. package/es/components/pagination/src/components/total.mjs +28 -7
  111. package/es/components/pagination/src/components/total.mjs.map +1 -1
  112. package/es/components/pagination/src/components/total2.mjs +7 -28
  113. package/es/components/pagination/src/components/total2.mjs.map +1 -1
  114. package/es/components/pagination/src/pagination.mjs +2 -2
  115. package/es/components/popconfirm/src/popconfirm.mjs +1 -1
  116. package/es/components/popover/src/popover.mjs +2 -2
  117. package/es/components/progress/index.mjs +2 -2
  118. package/es/components/progress/src/progress.mjs +59 -205
  119. package/es/components/progress/src/progress.mjs.map +1 -1
  120. package/es/components/progress/src/progress2.mjs +205 -59
  121. package/es/components/progress/src/progress2.mjs.map +1 -1
  122. package/es/components/radio/index.mjs +4 -4
  123. package/es/components/radio/src/radio-button.mjs +67 -9
  124. package/es/components/radio/src/radio-button.mjs.map +1 -1
  125. package/es/components/radio/src/radio-button2.mjs +9 -67
  126. package/es/components/radio/src/radio-button2.mjs.map +1 -1
  127. package/es/components/radio/src/radio-group.mjs +1 -1
  128. package/es/components/radio/src/radio.mjs +35 -76
  129. package/es/components/radio/src/radio.mjs.map +1 -1
  130. package/es/components/radio/src/radio2.mjs +76 -35
  131. package/es/components/radio/src/radio2.mjs.map +1 -1
  132. package/es/components/rate/index.mjs +2 -2
  133. package/es/components/rate/src/rate.mjs +92 -258
  134. package/es/components/rate/src/rate.mjs.map +1 -1
  135. package/es/components/rate/src/rate2.mjs +258 -92
  136. package/es/components/rate/src/rate2.mjs.map +1 -1
  137. package/es/components/resizable-columns/index.d.ts +61 -0
  138. package/es/components/resizable-columns/index.mjs +2 -2
  139. package/es/components/resizable-columns/src/resizable-column.d.ts +1 -0
  140. package/es/components/resizable-columns/src/resizable-column.mjs +1 -0
  141. package/es/components/resizable-columns/src/resizable-column.mjs.map +1 -1
  142. package/es/components/resizable-columns/src/resizable-column.vue.d.ts +27 -0
  143. package/es/components/resizable-columns/src/resizable-column2.mjs +28 -6
  144. package/es/components/resizable-columns/src/resizable-column2.mjs.map +1 -1
  145. package/es/components/resizable-columns/src/resizable-columns.d.ts +2 -0
  146. package/es/components/resizable-columns/src/resizable-columns.mjs +242 -12
  147. package/es/components/resizable-columns/src/resizable-columns.mjs.map +1 -1
  148. package/es/components/resizable-columns/src/resizable-columns.vue.d.ts +7 -0
  149. package/es/components/resizable-columns/src/resizable-columns2.mjs +21 -237
  150. package/es/components/resizable-columns/src/resizable-columns2.mjs.map +1 -1
  151. package/es/components/roving-focus-group/index.mjs +3 -3
  152. package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
  153. package/es/components/roving-focus-group/src/roving-focus-group.mjs +29 -27
  154. package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
  155. package/es/components/roving-focus-group/src/roving-focus-group2.mjs +27 -29
  156. package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
  157. package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
  158. package/es/components/scrollbar/index.mjs +1 -1
  159. package/es/components/scrollbar/src/bar2.mjs +1 -1
  160. package/es/components/scrollbar/src/thumb.mjs +11 -134
  161. package/es/components/scrollbar/src/thumb.mjs.map +1 -1
  162. package/es/components/scrollbar/src/thumb2.mjs +134 -11
  163. package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
  164. package/es/components/select/src/select.mjs +1 -1
  165. package/es/components/select-v2/src/defaults.mjs +1 -1
  166. package/es/components/slider/index.mjs +2 -2
  167. package/es/components/slider/src/slider.mjs +237 -96
  168. package/es/components/slider/src/slider.mjs.map +1 -1
  169. package/es/components/slider/src/slider2.mjs +96 -237
  170. package/es/components/slider/src/slider2.mjs.map +1 -1
  171. package/es/components/steps/index.mjs +4 -4
  172. package/es/components/steps/src/item.mjs +19 -193
  173. package/es/components/steps/src/item.mjs.map +1 -1
  174. package/es/components/steps/src/item2.mjs +193 -19
  175. package/es/components/steps/src/item2.mjs.map +1 -1
  176. package/es/components/steps/src/steps.mjs +39 -36
  177. package/es/components/steps/src/steps.mjs.map +1 -1
  178. package/es/components/steps/src/steps2.mjs +36 -39
  179. package/es/components/steps/src/steps2.mjs.map +1 -1
  180. package/es/components/switch/index.mjs +2 -2
  181. package/es/components/switch/src/switch.mjs +99 -267
  182. package/es/components/switch/src/switch.mjs.map +1 -1
  183. package/es/components/switch/src/switch2.mjs +267 -99
  184. package/es/components/switch/src/switch2.mjs.map +1 -1
  185. package/es/components/tabs/index.mjs +3 -3
  186. package/es/components/tabs/src/tab-bar.mjs +7 -75
  187. package/es/components/tabs/src/tab-bar.mjs.map +1 -1
  188. package/es/components/tabs/src/tab-bar2.mjs +75 -7
  189. package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
  190. package/es/components/tabs/src/tab-nav.mjs +1 -1
  191. package/es/components/tabs/src/tab-pane.mjs +76 -14
  192. package/es/components/tabs/src/tab-pane.mjs.map +1 -1
  193. package/es/components/tabs/src/tab-pane2.mjs +14 -76
  194. package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
  195. package/es/components/teleport/index.mjs +2 -2
  196. package/es/components/teleport/src/teleport.mjs +44 -18
  197. package/es/components/teleport/src/teleport.mjs.map +1 -1
  198. package/es/components/teleport/src/teleport2.mjs +18 -44
  199. package/es/components/teleport/src/teleport2.mjs.map +1 -1
  200. package/es/components/time-select/index.mjs +1 -1
  201. package/es/components/time-select/src/time-select.mjs +55 -132
  202. package/es/components/time-select/src/time-select.mjs.map +1 -1
  203. package/es/components/time-select/src/time-select2.mjs +132 -55
  204. package/es/components/time-select/src/time-select2.mjs.map +1 -1
  205. package/es/components/tooltip/index.mjs +1 -1
  206. package/es/components/tooltip/src/content.mjs +179 -31
  207. package/es/components/tooltip/src/content.mjs.map +1 -1
  208. package/es/components/tooltip/src/content2.mjs +31 -179
  209. package/es/components/tooltip/src/content2.mjs.map +1 -1
  210. package/es/components/tooltip/src/tooltip.mjs +1 -1
  211. package/es/components/tooltip/src/tooltip2.mjs +1 -1
  212. package/es/components/tooltip-v2/index.mjs +2 -2
  213. package/es/components/tooltip-v2/src/root.mjs +82 -17
  214. package/es/components/tooltip-v2/src/root.mjs.map +1 -1
  215. package/es/components/tooltip-v2/src/root2.mjs +17 -82
  216. package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
  217. package/es/components/tooltip-v2/src/tooltip.mjs +2 -2
  218. package/es/components/tooltip-v2/src/tooltip2.mjs +4 -4
  219. package/es/components/tooltip-v2/src/trigger.mjs +12 -91
  220. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  221. package/es/components/tooltip-v2/src/trigger2.mjs +91 -12
  222. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  223. package/es/components/upload/index.mjs +3 -3
  224. package/es/components/upload/src/upload-content.mjs +196 -33
  225. package/es/components/upload/src/upload-content.mjs.map +1 -1
  226. package/es/components/upload/src/upload-content2.mjs +33 -196
  227. package/es/components/upload/src/upload-content2.mjs.map +1 -1
  228. package/es/components/upload/src/upload-dragger.mjs +11 -72
  229. package/es/components/upload/src/upload-dragger.mjs.map +1 -1
  230. package/es/components/upload/src/upload-dragger2.mjs +72 -11
  231. package/es/components/upload/src/upload-dragger2.mjs.map +1 -1
  232. package/es/components/upload/src/upload-list.mjs +179 -26
  233. package/es/components/upload/src/upload-list.mjs.map +1 -1
  234. package/es/components/upload/src/upload-list2.mjs +26 -179
  235. package/es/components/upload/src/upload-list2.mjs.map +1 -1
  236. package/es/components/upload/src/upload2.mjs +2 -2
  237. package/es/index.mjs +32 -32
  238. package/lib/components/affix/index.js +2 -2
  239. package/lib/components/affix/src/affix.js +119 -27
  240. package/lib/components/affix/src/affix.js.map +1 -1
  241. package/lib/components/affix/src/affix2.js +27 -119
  242. package/lib/components/affix/src/affix2.js.map +1 -1
  243. package/lib/components/alert/index.js +2 -2
  244. package/lib/components/alert/src/alert.js +39 -102
  245. package/lib/components/alert/src/alert.js.map +1 -1
  246. package/lib/components/alert/src/alert2.js +102 -39
  247. package/lib/components/alert/src/alert2.js.map +1 -1
  248. package/lib/components/autocomplete/src/autocomplete.js +1 -1
  249. package/lib/components/breadcrumb/index.js +2 -2
  250. package/lib/components/breadcrumb/src/breadcrumb.js +11 -36
  251. package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
  252. package/lib/components/breadcrumb/src/breadcrumb2.js +36 -11
  253. package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
  254. package/lib/components/calendar/index.js +2 -2
  255. package/lib/components/calendar/src/calendar.js +131 -19
  256. package/lib/components/calendar/src/calendar.js.map +1 -1
  257. package/lib/components/calendar/src/calendar2.js +19 -131
  258. package/lib/components/calendar/src/calendar2.js.map +1 -1
  259. package/lib/components/calendar/src/date-table.js +87 -37
  260. package/lib/components/calendar/src/date-table.js.map +1 -1
  261. package/lib/components/calendar/src/date-table2.js +37 -87
  262. package/lib/components/calendar/src/date-table2.js.map +1 -1
  263. package/lib/components/calendar/src/use-date-table.js +1 -1
  264. package/lib/components/carousel/index.js +2 -2
  265. package/lib/components/carousel/src/carousel.js +169 -57
  266. package/lib/components/carousel/src/carousel.js.map +1 -1
  267. package/lib/components/carousel/src/carousel2.js +57 -169
  268. package/lib/components/carousel/src/carousel2.js.map +1 -1
  269. package/lib/components/cascader/src/cascader.js +1 -1
  270. package/lib/components/checkbox/index.js +2 -2
  271. package/lib/components/checkbox/src/checkbox-group.js +72 -34
  272. package/lib/components/checkbox/src/checkbox-group.js.map +1 -1
  273. package/lib/components/checkbox/src/checkbox-group2.js +34 -72
  274. package/lib/components/checkbox/src/checkbox-group2.js.map +1 -1
  275. package/lib/components/col/index.js +2 -2
  276. package/lib/components/col/src/col.js +66 -43
  277. package/lib/components/col/src/col.js.map +1 -1
  278. package/lib/components/col/src/col2.js +43 -66
  279. package/lib/components/col/src/col2.js.map +1 -1
  280. package/lib/components/color-picker/src/color-picker2.js +1 -1
  281. package/lib/components/dialog/src/dialog-content.js +30 -95
  282. package/lib/components/dialog/src/dialog-content.js.map +1 -1
  283. package/lib/components/dialog/src/dialog-content2.js +95 -30
  284. package/lib/components/dialog/src/dialog-content2.js.map +1 -1
  285. package/lib/components/dialog/src/dialog.js +1 -1
  286. package/lib/components/dialog/src/dialog2.js +1 -1
  287. package/lib/components/drawer/index.js +2 -2
  288. package/lib/components/drawer/src/drawer.js +187 -30
  289. package/lib/components/drawer/src/drawer.js.map +1 -1
  290. package/lib/components/drawer/src/drawer2.js +30 -187
  291. package/lib/components/drawer/src/drawer2.js.map +1 -1
  292. package/lib/components/dropdown/index.js +2 -2
  293. package/lib/components/dropdown/src/dropdown-item-impl.js +2 -2
  294. package/lib/components/dropdown/src/dropdown-item.js +1 -1
  295. package/lib/components/dropdown/src/dropdown-menu.js +2 -2
  296. package/lib/components/dropdown/src/dropdown.d.ts +1 -2
  297. package/lib/components/dropdown/src/dropdown.js +310 -118
  298. package/lib/components/dropdown/src/dropdown.js.map +1 -1
  299. package/lib/components/dropdown/src/dropdown2.js +118 -310
  300. package/lib/components/dropdown/src/dropdown2.js.map +1 -1
  301. package/lib/components/form/index.js +4 -4
  302. package/lib/components/form/src/form-item.js +332 -47
  303. package/lib/components/form/src/form-item.js.map +1 -1
  304. package/lib/components/form/src/form-item2.js +47 -332
  305. package/lib/components/form/src/form-item2.js.map +1 -1
  306. package/lib/components/form/src/form.js +58 -149
  307. package/lib/components/form/src/form.js.map +1 -1
  308. package/lib/components/form/src/form2.js +149 -58
  309. package/lib/components/form/src/form2.js.map +1 -1
  310. package/lib/components/icon/index.js +2 -2
  311. package/lib/components/icon/src/icon.js +8 -36
  312. package/lib/components/icon/src/icon.js.map +1 -1
  313. package/lib/components/icon/src/icon2.js +36 -8
  314. package/lib/components/icon/src/icon2.js.map +1 -1
  315. package/lib/components/image-viewer/index.js +2 -2
  316. package/lib/components/image-viewer/src/image-viewer.js +403 -33
  317. package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
  318. package/lib/components/image-viewer/src/image-viewer2.js +33 -403
  319. package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
  320. package/lib/components/index.js +32 -32
  321. package/lib/components/input-number/index.js +2 -2
  322. package/lib/components/input-number/src/input-number.js +68 -333
  323. package/lib/components/input-number/src/input-number.js.map +1 -1
  324. package/lib/components/input-number/src/input-number2.js +333 -68
  325. package/lib/components/input-number/src/input-number2.js.map +1 -1
  326. package/lib/components/link/index.js +2 -2
  327. package/lib/components/link/src/link.js +22 -50
  328. package/lib/components/link/src/link.js.map +1 -1
  329. package/lib/components/link/src/link2.js +50 -22
  330. package/lib/components/link/src/link2.js.map +1 -1
  331. package/lib/components/menu/index.js +2 -2
  332. package/lib/components/menu/src/menu-item.js +15 -97
  333. package/lib/components/menu/src/menu-item.js.map +1 -1
  334. package/lib/components/menu/src/menu-item2.js +97 -15
  335. package/lib/components/menu/src/menu-item2.js.map +1 -1
  336. package/lib/components/pagination/src/components/next.js +19 -38
  337. package/lib/components/pagination/src/components/next.js.map +1 -1
  338. package/lib/components/pagination/src/components/next2.js +38 -19
  339. package/lib/components/pagination/src/components/next2.js.map +1 -1
  340. package/lib/components/pagination/src/components/total.js +28 -7
  341. package/lib/components/pagination/src/components/total.js.map +1 -1
  342. package/lib/components/pagination/src/components/total2.js +7 -28
  343. package/lib/components/pagination/src/components/total2.js.map +1 -1
  344. package/lib/components/pagination/src/pagination.js +2 -2
  345. package/lib/components/popconfirm/src/popconfirm.js +1 -1
  346. package/lib/components/popover/src/popover.js +2 -2
  347. package/lib/components/progress/index.js +2 -2
  348. package/lib/components/progress/src/progress.js +59 -205
  349. package/lib/components/progress/src/progress.js.map +1 -1
  350. package/lib/components/progress/src/progress2.js +205 -59
  351. package/lib/components/progress/src/progress2.js.map +1 -1
  352. package/lib/components/radio/index.js +4 -4
  353. package/lib/components/radio/src/radio-button.js +67 -9
  354. package/lib/components/radio/src/radio-button.js.map +1 -1
  355. package/lib/components/radio/src/radio-button2.js +9 -67
  356. package/lib/components/radio/src/radio-button2.js.map +1 -1
  357. package/lib/components/radio/src/radio-group.js +1 -1
  358. package/lib/components/radio/src/radio.js +37 -76
  359. package/lib/components/radio/src/radio.js.map +1 -1
  360. package/lib/components/radio/src/radio2.js +76 -37
  361. package/lib/components/radio/src/radio2.js.map +1 -1
  362. package/lib/components/rate/index.js +2 -2
  363. package/lib/components/rate/src/rate.js +92 -257
  364. package/lib/components/rate/src/rate.js.map +1 -1
  365. package/lib/components/rate/src/rate2.js +257 -92
  366. package/lib/components/rate/src/rate2.js.map +1 -1
  367. package/lib/components/resizable-columns/index.d.ts +61 -0
  368. package/lib/components/resizable-columns/index.js +2 -2
  369. package/lib/components/resizable-columns/src/resizable-column.d.ts +1 -0
  370. package/lib/components/resizable-columns/src/resizable-column.js +1 -0
  371. package/lib/components/resizable-columns/src/resizable-column.js.map +1 -1
  372. package/lib/components/resizable-columns/src/resizable-column.vue.d.ts +27 -0
  373. package/lib/components/resizable-columns/src/resizable-column2.js +27 -5
  374. package/lib/components/resizable-columns/src/resizable-column2.js.map +1 -1
  375. package/lib/components/resizable-columns/src/resizable-columns.d.ts +2 -0
  376. package/lib/components/resizable-columns/src/resizable-columns.js +242 -12
  377. package/lib/components/resizable-columns/src/resizable-columns.js.map +1 -1
  378. package/lib/components/resizable-columns/src/resizable-columns.vue.d.ts +7 -0
  379. package/lib/components/resizable-columns/src/resizable-columns2.js +21 -237
  380. package/lib/components/resizable-columns/src/resizable-columns2.js.map +1 -1
  381. package/lib/components/roving-focus-group/index.js +2 -2
  382. package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
  383. package/lib/components/roving-focus-group/src/roving-focus-group.js +33 -27
  384. package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
  385. package/lib/components/roving-focus-group/src/roving-focus-group2.js +27 -33
  386. package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
  387. package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
  388. package/lib/components/scrollbar/index.js +1 -1
  389. package/lib/components/scrollbar/src/bar2.js +1 -1
  390. package/lib/components/scrollbar/src/thumb.js +11 -134
  391. package/lib/components/scrollbar/src/thumb.js.map +1 -1
  392. package/lib/components/scrollbar/src/thumb2.js +134 -11
  393. package/lib/components/scrollbar/src/thumb2.js.map +1 -1
  394. package/lib/components/select/src/select.js +1 -1
  395. package/lib/components/select-v2/src/defaults.js +1 -1
  396. package/lib/components/slider/index.js +2 -2
  397. package/lib/components/slider/src/slider.js +237 -97
  398. package/lib/components/slider/src/slider.js.map +1 -1
  399. package/lib/components/slider/src/slider2.js +97 -237
  400. package/lib/components/slider/src/slider2.js.map +1 -1
  401. package/lib/components/steps/index.js +4 -4
  402. package/lib/components/steps/src/item.js +19 -193
  403. package/lib/components/steps/src/item.js.map +1 -1
  404. package/lib/components/steps/src/item2.js +193 -19
  405. package/lib/components/steps/src/item2.js.map +1 -1
  406. package/lib/components/steps/src/steps.js +39 -37
  407. package/lib/components/steps/src/steps.js.map +1 -1
  408. package/lib/components/steps/src/steps2.js +37 -39
  409. package/lib/components/steps/src/steps2.js.map +1 -1
  410. package/lib/components/switch/index.js +2 -2
  411. package/lib/components/switch/src/switch.js +99 -266
  412. package/lib/components/switch/src/switch.js.map +1 -1
  413. package/lib/components/switch/src/switch2.js +266 -99
  414. package/lib/components/switch/src/switch2.js.map +1 -1
  415. package/lib/components/tabs/index.js +3 -3
  416. package/lib/components/tabs/src/tab-bar.js +7 -75
  417. package/lib/components/tabs/src/tab-bar.js.map +1 -1
  418. package/lib/components/tabs/src/tab-bar2.js +75 -7
  419. package/lib/components/tabs/src/tab-bar2.js.map +1 -1
  420. package/lib/components/tabs/src/tab-nav.js +1 -1
  421. package/lib/components/tabs/src/tab-pane.js +76 -14
  422. package/lib/components/tabs/src/tab-pane.js.map +1 -1
  423. package/lib/components/tabs/src/tab-pane2.js +14 -76
  424. package/lib/components/tabs/src/tab-pane2.js.map +1 -1
  425. package/lib/components/teleport/index.js +2 -2
  426. package/lib/components/teleport/src/teleport.js +44 -18
  427. package/lib/components/teleport/src/teleport.js.map +1 -1
  428. package/lib/components/teleport/src/teleport2.js +18 -44
  429. package/lib/components/teleport/src/teleport2.js.map +1 -1
  430. package/lib/components/time-select/index.js +1 -1
  431. package/lib/components/time-select/src/time-select.js +55 -137
  432. package/lib/components/time-select/src/time-select.js.map +1 -1
  433. package/lib/components/time-select/src/time-select2.js +137 -55
  434. package/lib/components/time-select/src/time-select2.js.map +1 -1
  435. package/lib/components/tooltip/index.js +1 -1
  436. package/lib/components/tooltip/src/content.js +179 -31
  437. package/lib/components/tooltip/src/content.js.map +1 -1
  438. package/lib/components/tooltip/src/content2.js +31 -179
  439. package/lib/components/tooltip/src/content2.js.map +1 -1
  440. package/lib/components/tooltip/src/tooltip.js +1 -1
  441. package/lib/components/tooltip/src/tooltip2.js +1 -1
  442. package/lib/components/tooltip-v2/index.js +2 -2
  443. package/lib/components/tooltip-v2/src/root.js +82 -17
  444. package/lib/components/tooltip-v2/src/root.js.map +1 -1
  445. package/lib/components/tooltip-v2/src/root2.js +17 -82
  446. package/lib/components/tooltip-v2/src/root2.js.map +1 -1
  447. package/lib/components/tooltip-v2/src/tooltip.js +2 -2
  448. package/lib/components/tooltip-v2/src/tooltip2.js +4 -4
  449. package/lib/components/tooltip-v2/src/trigger.js +12 -91
  450. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  451. package/lib/components/tooltip-v2/src/trigger2.js +91 -12
  452. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  453. package/lib/components/upload/index.js +3 -3
  454. package/lib/components/upload/src/upload-content.js +194 -31
  455. package/lib/components/upload/src/upload-content.js.map +1 -1
  456. package/lib/components/upload/src/upload-content2.js +31 -194
  457. package/lib/components/upload/src/upload-content2.js.map +1 -1
  458. package/lib/components/upload/src/upload-dragger.js +12 -72
  459. package/lib/components/upload/src/upload-dragger.js.map +1 -1
  460. package/lib/components/upload/src/upload-dragger2.js +72 -12
  461. package/lib/components/upload/src/upload-dragger2.js.map +1 -1
  462. package/lib/components/upload/src/upload-list.js +179 -27
  463. package/lib/components/upload/src/upload-list.js.map +1 -1
  464. package/lib/components/upload/src/upload-list2.js +27 -179
  465. package/lib/components/upload/src/upload-list2.js.map +1 -1
  466. package/lib/components/upload/src/upload2.js +2 -2
  467. package/lib/index.js +32 -32
  468. package/package.json +1 -1
  469. package/theme-chalk/el-resizable-columns.css +1 -1
  470. package/theme-chalk/index.css +1 -1
  471. package/theme-chalk/src/resizable-columns.scss +61 -12
  472. package/web-types.json +1 -1
@@ -1,107 +1,275 @@
1
+ import { defineComponent, getCurrentInstance, computed, ref, nextTick, onMounted, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, withModifiers, createElementVNode, withKeys, createBlock, withCtx, resolveDynamicComponent, createCommentVNode, toDisplayString, createVNode } from 'vue';
2
+ import '../../config-provider/index.mjs';
3
+ import { isPromise } from '@vue/shared';
1
4
  import '../../../utils/index.mjs';
5
+ import { ElIcon } from '../../icon/index.mjs';
6
+ import '../../form/index.mjs';
7
+ import { Loading } from '@element-plus/icons-vue';
2
8
  import '../../../constants/index.mjs';
3
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
4
- import { viewModes } from '../../../constants/size.mjs';
5
- import { isValidComponentSize } from '../../../utils/vue/validator.mjs';
6
- import { iconPropType } from '../../../utils/vue/icon.mjs';
9
+ import '../../../hooks/index.mjs';
10
+ import { switchProps, switchEmits } from './switch.mjs';
11
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
12
+ import { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
13
+ import { useFormSize, useFormDisabled, useFormViewMode } from '../../form/src/hooks/use-form-common-props.mjs';
14
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
15
+ import { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';
16
+ import { addUnit } from '../../../utils/dom/style.mjs';
17
+ import { watch } from '../../config-provider/src/for-editor.mjs';
7
18
  import { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
8
- import { isBoolean, isNumber } from '../../../utils/types.mjs';
9
- import { isString } from '@vue/shared';
19
+ import { debugWarn, throwError } from '../../../utils/error.mjs';
20
+ import { isBoolean } from '../../../utils/types.mjs';
10
21
 
11
- const switchProps = buildProps({
12
- modelValue: {
13
- type: [Boolean, String, Number],
14
- default: false
15
- },
16
- disabled: {
17
- type: Boolean,
18
- default: false
19
- },
20
- viewMode: {
21
- type: String,
22
- values: viewModes
23
- },
24
- loading: {
25
- type: Boolean,
26
- default: false
27
- },
28
- size: {
29
- type: String,
30
- validator: isValidComponentSize
31
- },
32
- width: {
33
- type: [String, Number],
34
- default: ""
35
- },
36
- inlinePrompt: {
37
- type: Boolean,
38
- default: false
39
- },
40
- inactiveActionIcon: {
41
- type: iconPropType
42
- },
43
- activeActionIcon: {
44
- type: iconPropType
45
- },
46
- activeIcon: {
47
- type: iconPropType
48
- },
49
- inactiveIcon: {
50
- type: iconPropType
51
- },
52
- activeText: {
53
- type: String,
54
- default: ""
55
- },
56
- inactiveText: {
57
- type: String,
58
- default: ""
59
- },
60
- activeValue: {
61
- type: [Boolean, String, Number],
62
- default: true
63
- },
64
- inactiveValue: {
65
- type: [Boolean, String, Number],
66
- default: false
67
- },
68
- activeColor: {
69
- type: String,
70
- default: ""
71
- },
72
- inactiveColor: {
73
- type: String,
74
- default: ""
75
- },
76
- borderColor: {
77
- type: String,
78
- default: ""
79
- },
80
- name: {
81
- type: String,
82
- default: ""
83
- },
84
- validateEvent: {
85
- type: Boolean,
86
- default: true
87
- },
88
- beforeChange: {
89
- type: definePropType(Function)
90
- },
91
- id: String,
92
- tabindex: {
93
- type: [String, Number]
94
- },
95
- value: {
96
- type: [Boolean, String, Number],
97
- default: false
22
+ const _hoisted_1 = ["onClick"];
23
+ const _hoisted_2 = ["id", "aria-checked", "aria-disabled", "name", "true-value", "false-value", "disabled", "tabindex", "onKeydown"];
24
+ const _hoisted_3 = ["aria-hidden"];
25
+ const _hoisted_4 = ["aria-hidden"];
26
+ const _hoisted_5 = ["aria-hidden"];
27
+ const COMPONENT_NAME = "ElSwitch";
28
+ const __default__ = defineComponent({
29
+ name: COMPONENT_NAME
30
+ });
31
+ const _sfc_main = /* @__PURE__ */ defineComponent({
32
+ ...__default__,
33
+ props: switchProps,
34
+ emits: switchEmits,
35
+ setup(__props, { expose, emit }) {
36
+ const props = __props;
37
+ const vm = getCurrentInstance();
38
+ const { formItem } = useFormItem();
39
+ const switchSize = useFormSize();
40
+ const ns = useNamespace("switch");
41
+ const useBatchDeprecated = (list) => {
42
+ list.forEach((param) => {
43
+ useDeprecated({
44
+ from: param[0],
45
+ replacement: param[1],
46
+ scope: COMPONENT_NAME,
47
+ version: "2.3.0",
48
+ ref: "https://element-plus.org/en-US/component/switch.html#attributes",
49
+ type: "Attribute"
50
+ }, computed(() => {
51
+ var _a;
52
+ return !!((_a = vm.vnode.props) == null ? void 0 : _a[param[2]]);
53
+ }));
54
+ });
55
+ };
56
+ useBatchDeprecated([
57
+ ['"value"', '"model-value" or "v-model"', "value"],
58
+ ['"active-color"', "CSS var `--el-switch-on-color`", "activeColor"],
59
+ ['"inactive-color"', "CSS var `--el-switch-off-color`", "inactiveColor"],
60
+ ['"border-color"', "CSS var `--el-switch-border-color`", "borderColor"]
61
+ ]);
62
+ const { inputId } = useFormItemInputId(props, {
63
+ formItemContext: formItem
64
+ });
65
+ const switchDisabled = useFormDisabled(computed(() => props.loading));
66
+ const switchViewMode = useFormViewMode();
67
+ const isControlled = ref(props.modelValue !== false);
68
+ const input = ref();
69
+ const core = ref();
70
+ const switchKls = computed(() => [
71
+ ns.b(),
72
+ ns.m(switchSize.value),
73
+ ns.is("disabled", switchDisabled.value),
74
+ ns.is("view-mode", !!switchViewMode.value),
75
+ ns.is("checked", checked.value)
76
+ ]);
77
+ const labelLeftKls = computed(() => [
78
+ ns.e("label"),
79
+ ns.em("label", "left"),
80
+ ns.is("active", !checked.value)
81
+ ]);
82
+ const labelRightKls = computed(() => [
83
+ ns.e("label"),
84
+ ns.em("label", "right"),
85
+ ns.is("active", checked.value)
86
+ ]);
87
+ const coreStyle = computed(() => ({
88
+ width: addUnit(props.width)
89
+ }));
90
+ watch(() => props.modelValue, () => {
91
+ isControlled.value = true;
92
+ });
93
+ watch(() => props.value, () => {
94
+ isControlled.value = false;
95
+ });
96
+ const actualValue = computed(() => {
97
+ return isControlled.value ? props.modelValue : props.value;
98
+ });
99
+ const checked = computed(() => actualValue.value === props.activeValue);
100
+ if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {
101
+ emit(UPDATE_MODEL_EVENT, props.inactiveValue);
102
+ emit(CHANGE_EVENT, props.inactiveValue);
103
+ emit(INPUT_EVENT, props.inactiveValue);
104
+ }
105
+ watch(checked, (val) => {
106
+ var _a;
107
+ input.value.checked = val;
108
+ if (props.validateEvent) {
109
+ (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
110
+ }
111
+ });
112
+ const handleChange = () => {
113
+ const val = checked.value ? props.inactiveValue : props.activeValue;
114
+ emit(UPDATE_MODEL_EVENT, val);
115
+ emit(CHANGE_EVENT, val);
116
+ emit(INPUT_EVENT, val);
117
+ nextTick(() => {
118
+ input.value.checked = checked.value;
119
+ });
120
+ };
121
+ const switchValue = () => {
122
+ if (switchDisabled.value || switchViewMode.value)
123
+ return;
124
+ const { beforeChange } = props;
125
+ if (!beforeChange) {
126
+ handleChange();
127
+ return;
128
+ }
129
+ const shouldChange = beforeChange();
130
+ const isPromiseOrBool = [
131
+ isPromise(shouldChange),
132
+ isBoolean(shouldChange)
133
+ ].includes(true);
134
+ if (!isPromiseOrBool) {
135
+ throwError(COMPONENT_NAME, "beforeChange must return type `Promise<boolean>` or `boolean`");
136
+ }
137
+ if (isPromise(shouldChange)) {
138
+ shouldChange.then((result) => {
139
+ if (result) {
140
+ handleChange();
141
+ }
142
+ }).catch((e) => {
143
+ debugWarn(COMPONENT_NAME, `some error occurred: ${e}`);
144
+ });
145
+ } else if (shouldChange) {
146
+ handleChange();
147
+ }
148
+ };
149
+ const styles = computed(() => {
150
+ return ns.cssVarBlock({
151
+ ...props.activeColor ? { "on-color": props.activeColor } : null,
152
+ ...props.inactiveColor ? { "off-color": props.inactiveColor } : null,
153
+ ...props.borderColor ? { "border-color": props.borderColor } : null
154
+ });
155
+ });
156
+ const focus = () => {
157
+ var _a, _b;
158
+ (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
159
+ };
160
+ onMounted(() => {
161
+ input.value.checked = checked.value;
162
+ });
163
+ expose({
164
+ focus,
165
+ checked
166
+ });
167
+ return (_ctx, _cache) => {
168
+ return openBlock(), createElementBlock("div", {
169
+ class: normalizeClass(unref(switchKls)),
170
+ style: normalizeStyle(unref(styles)),
171
+ onClick: withModifiers(switchValue, ["prevent"])
172
+ }, [
173
+ createElementVNode("input", {
174
+ id: unref(inputId),
175
+ ref_key: "input",
176
+ ref: input,
177
+ class: normalizeClass(unref(ns).e("input")),
178
+ type: "checkbox",
179
+ role: "switch",
180
+ "aria-checked": unref(checked),
181
+ "aria-disabled": unref(switchDisabled),
182
+ name: _ctx.name,
183
+ "true-value": _ctx.activeValue,
184
+ "false-value": _ctx.inactiveValue,
185
+ disabled: unref(switchDisabled) || unref(switchViewMode),
186
+ tabindex: _ctx.tabindex,
187
+ onChange: handleChange,
188
+ onKeydown: withKeys(switchValue, ["enter"])
189
+ }, null, 42, _hoisted_2),
190
+ !_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (openBlock(), createElementBlock("span", {
191
+ key: 0,
192
+ class: normalizeClass(unref(labelLeftKls))
193
+ }, [
194
+ _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
195
+ default: withCtx(() => [
196
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))
197
+ ]),
198
+ _: 1
199
+ })) : createCommentVNode("v-if", true),
200
+ !_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
201
+ key: 1,
202
+ "aria-hidden": unref(checked)
203
+ }, toDisplayString(_ctx.inactiveText), 9, _hoisted_3)) : createCommentVNode("v-if", true)
204
+ ], 2)) : createCommentVNode("v-if", true),
205
+ createElementVNode("span", {
206
+ ref_key: "core",
207
+ ref: core,
208
+ class: normalizeClass(unref(ns).e("core")),
209
+ style: normalizeStyle(unref(coreStyle))
210
+ }, [
211
+ _ctx.inlinePrompt ? (openBlock(), createElementBlock("div", {
212
+ key: 0,
213
+ class: normalizeClass(unref(ns).e("inner"))
214
+ }, [
215
+ _ctx.activeIcon || _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), {
216
+ key: 0,
217
+ class: normalizeClass(unref(ns).is("icon"))
218
+ }, {
219
+ default: withCtx(() => [
220
+ (openBlock(), createBlock(resolveDynamicComponent(unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))
221
+ ]),
222
+ _: 1
223
+ }, 8, ["class"])) : _ctx.activeText || _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
224
+ key: 1,
225
+ class: normalizeClass(unref(ns).is("text")),
226
+ "aria-hidden": !unref(checked)
227
+ }, toDisplayString(unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, _hoisted_4)) : createCommentVNode("v-if", true)
228
+ ], 2)) : createCommentVNode("v-if", true),
229
+ createElementVNode("div", {
230
+ class: normalizeClass(unref(ns).e("action"))
231
+ }, [
232
+ _ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {
233
+ key: 0,
234
+ class: normalizeClass(unref(ns).is("loading"))
235
+ }, {
236
+ default: withCtx(() => [
237
+ createVNode(unref(Loading))
238
+ ]),
239
+ _: 1
240
+ }, 8, ["class"])) : _ctx.activeActionIcon && unref(checked) ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
241
+ default: withCtx(() => [
242
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeActionIcon)))
243
+ ]),
244
+ _: 1
245
+ })) : _ctx.inactiveActionIcon && !unref(checked) ? (openBlock(), createBlock(unref(ElIcon), { key: 2 }, {
246
+ default: withCtx(() => [
247
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveActionIcon)))
248
+ ]),
249
+ _: 1
250
+ })) : createCommentVNode("v-if", true)
251
+ ], 2)
252
+ ], 6),
253
+ !_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (openBlock(), createElementBlock("span", {
254
+ key: 1,
255
+ class: normalizeClass(unref(labelRightKls))
256
+ }, [
257
+ _ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
258
+ default: withCtx(() => [
259
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))
260
+ ]),
261
+ _: 1
262
+ })) : createCommentVNode("v-if", true),
263
+ !_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock("span", {
264
+ key: 1,
265
+ "aria-hidden": !unref(checked)
266
+ }, toDisplayString(_ctx.activeText), 9, _hoisted_5)) : createCommentVNode("v-if", true)
267
+ ], 2)) : createCommentVNode("v-if", true)
268
+ ], 14, _hoisted_1);
269
+ };
98
270
  }
99
271
  });
100
- const switchEmits = {
101
- [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
102
- [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
103
- [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
104
- };
272
+ var Switch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:\\workspace\\element-pe\\packages\\components\\switch\\src\\switch.vue"]]);
105
273
 
106
- export { switchEmits, switchProps };
274
+ export { Switch as default };
107
275
  //# sourceMappingURL=switch2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"switch2.mjs","sources":["../../../../../../packages/components/switch/src/switch.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n iconPropType,\n isBoolean,\n isNumber,\n isString,\n isValidComponentSize,\n} from '@element-plus/utils'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT, viewModes\n} from '@element-plus/constants'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type Switch from './switch.vue'\nimport type { ExtractPropTypes, PropType } from 'vue'\n\nexport const switchProps = buildProps({\n /**\n * @description binding value, it should be equivalent to either `active-value` or `inactive-value`, by default it's `boolean` type\n */\n modelValue: {\n type: [Boolean, String, Number],\n default: false,\n },\n /**\n * @description whether Switch is disabled\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * @description 浏览模式\n */\n viewMode: {\n type: String,\n values: viewModes\n },\n /**\n * @description whether Switch is in loading state\n */\n loading: {\n type: Boolean,\n default: false,\n },\n /**\n * @description size of Switch\n */\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n /**\n * @description width of Switch\n */\n width: {\n type: [String, Number],\n default: '',\n },\n /**\n * @description whether icon or text is displayed inside dot, only the first character will be rendered for text\n */\n inlinePrompt: {\n type: Boolean,\n default: false,\n },\n /**\n * @description component of the icon displayed in action when in `off` state\n */\n inactiveActionIcon: {\n type: iconPropType,\n },\n /**\n * @description component of the icon displayed in action when in `on` state\n */\n activeActionIcon: {\n type: iconPropType,\n },\n /**\n * @description component of the icon displayed when in `on` state, overrides `active-text`\n */\n activeIcon: {\n type: iconPropType,\n },\n /**\n * @description component of the icon displayed when in `off` state, overrides `inactive-text`\n */\n inactiveIcon: {\n type: iconPropType,\n },\n /**\n * @description text displayed when in `on` state\n */\n activeText: {\n type: String,\n default: '',\n },\n /**\n * @description text displayed when in `off` state\n */\n inactiveText: {\n type: String,\n default: '',\n },\n /**\n * @description switch value when in `on` state\n */\n activeValue: {\n type: [Boolean, String, Number],\n default: true,\n },\n /**\n * @description switch value when in `off` state\n */\n inactiveValue: {\n type: [Boolean, String, Number],\n default: false,\n },\n /**\n * @deprecated background color when in `on` state ( deprecated, use CSS var `--el-switch-on-color` instead )\n */\n activeColor: {\n type: String,\n default: '',\n },\n /**\n * @deprecated background color when in `off` state ( deprecated, use CSS var `--el-switch-off-color` instead )\n */\n inactiveColor: {\n type: String,\n default: '',\n },\n /**\n * @deprecated border color of the switch ( deprecated, use CSS var `--el-switch-border-color` instead )\n */\n borderColor: {\n type: String,\n default: '',\n },\n /**\n * @description input name of Switch\n */\n name: {\n type: String,\n default: '',\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description before-change hook before the switch state changes. If `false` is returned or a `Promise` is returned and then is rejected, will stop switching\n */\n beforeChange: {\n type: definePropType<() => Promise<boolean> | boolean>(Function),\n },\n /**\n * @description id for input\n */\n id: String,\n /**\n * @description tabindex for input\n */\n tabindex: {\n type: [String, Number],\n },\n /**\n * @deprecated binding value ( deprecated, use `model-value / v-model` instead )\n */\n value: {\n type: [Boolean, String, Number],\n default: false,\n },\n} as const)\n\nexport type SwitchProps = ExtractPropTypes<typeof switchProps>\n\nexport const switchEmits = {\n [UPDATE_MODEL_EVENT]: (val: boolean | string | number) =>\n isBoolean(val) || isString(val) || isNumber(val),\n [CHANGE_EVENT]: (val: boolean | string | number) =>\n isBoolean(val) || isString(val) || isNumber(val),\n [INPUT_EVENT]: (val: boolean | string | number) =>\n isBoolean(val) || isString(val) || isNumber(val),\n}\nexport type SwitchEmits = typeof switchEmits\n\nexport type SwitchInstance = InstanceType<typeof Switch>\n"],"names":[],"mappings":";;;;;;;;;;AAeY,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;AACnC,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,M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../packages/components/switch/src/switch.vue"],"sourcesContent":["<template>\n <div :class=\"switchKls\" :style=\"styles\" @click.prevent=\"switchValue\">\n <input\n :id=\"inputId\"\n ref=\"input\"\n :class=\"ns.e('input')\"\n type=\"checkbox\"\n role=\"switch\"\n :aria-checked=\"checked\"\n :aria-disabled=\"switchDisabled\"\n :name=\"name\"\n :true-value=\"activeValue\"\n :false-value=\"inactiveValue\"\n :disabled=\"switchDisabled || switchViewMode\"\n :tabindex=\"tabindex\"\n @change=\"handleChange\"\n @keydown.enter=\"switchValue\"\n />\n <span\n v-if=\"!inlinePrompt && (inactiveIcon || inactiveText)\"\n :class=\"labelLeftKls\"\n >\n <el-icon v-if=\"inactiveIcon\">\n <component :is=\"inactiveIcon\" />\n </el-icon>\n <span v-if=\"!inactiveIcon && inactiveText\" :aria-hidden=\"checked\">{{\n inactiveText\n }}</span>\n </span>\n <span ref=\"core\" :class=\"ns.e('core')\" :style=\"coreStyle\">\n <div v-if=\"inlinePrompt\" :class=\"ns.e('inner')\">\n <template v-if=\"activeIcon || inactiveIcon\">\n <el-icon :class=\"ns.is('icon')\">\n <component :is=\"checked ? activeIcon : inactiveIcon\" />\n </el-icon>\n </template>\n <template v-else-if=\"activeText || inactiveText\">\n <span :class=\"ns.is('text')\" :aria-hidden=\"!checked\">\n {{ checked ? activeText : inactiveText }}\n </span>\n </template>\n </div>\n <div :class=\"ns.e('action')\">\n <el-icon v-if=\"loading\" :class=\"ns.is('loading')\">\n <loading />\n </el-icon>\n <el-icon v-else-if=\"activeActionIcon && checked\">\n <component :is=\"activeActionIcon\" />\n </el-icon>\n <el-icon v-else-if=\"inactiveActionIcon && !checked\">\n <component :is=\"inactiveActionIcon\" />\n </el-icon>\n </div>\n </span>\n <span\n v-if=\"!inlinePrompt && (activeIcon || activeText)\"\n :class=\"labelRightKls\"\n >\n <el-icon v-if=\"activeIcon\">\n <component :is=\"activeIcon\" />\n </el-icon>\n <span v-if=\"!activeIcon && activeText\" :aria-hidden=\"!checked\">{{\n activeText\n }}</span>\n </span>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport {\n computed,\n getCurrentInstance,\n nextTick,\n onMounted,\n ref,\n} from 'vue'\nimport { watch } from '../../config-provider'\nimport { isPromise } from '@vue/shared'\nimport { addUnit, debugWarn, isBoolean, throwError } from '@element-plus/utils'\nimport ElIcon from '@element-plus/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize, useFormViewMode\n} from '@element-plus/components/form'\nimport { Loading } from '@element-plus/icons-vue'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@element-plus/constants'\nimport { useDeprecated, useNamespace } from '@element-plus/hooks'\nimport { switchEmits, switchProps } from './switch'\nimport type { CSSProperties } from 'vue'\n\nconst COMPONENT_NAME = 'ElSwitch'\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(switchProps)\nconst emit = defineEmits(switchEmits)\n\nconst vm = getCurrentInstance()!\nconst { formItem } = useFormItem()\nconst switchSize = useFormSize()\nconst ns = useNamespace('switch')\n\nconst useBatchDeprecated = (list: string[][]) => {\n list.forEach((param) => {\n useDeprecated(\n {\n from: param[0],\n replacement: param[1],\n scope: COMPONENT_NAME,\n version: '2.3.0',\n ref: 'https://element-plus.org/en-US/component/switch.html#attributes',\n type: 'Attribute',\n },\n computed(() => !!vm.vnode.props?.[param[2]])\n )\n })\n}\nuseBatchDeprecated([\n ['\"value\"', '\"model-value\" or \"v-model\"', 'value'],\n ['\"active-color\"', 'CSS var `--el-switch-on-color`', 'activeColor'],\n ['\"inactive-color\"', 'CSS var `--el-switch-off-color`', 'inactiveColor'],\n ['\"border-color\"', 'CSS var `--el-switch-border-color`', 'borderColor'],\n])\n\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst switchDisabled = useFormDisabled(computed(() => props.loading))\nconst switchViewMode = useFormViewMode()\nconst isControlled = ref(props.modelValue !== false)\nconst input = ref<HTMLInputElement>()\nconst core = ref<HTMLSpanElement>()\n\nconst switchKls = computed(() => [\n ns.b(),\n ns.m(switchSize.value),\n ns.is('disabled', switchDisabled.value),\n ns.is('view-mode', !!switchViewMode.value),\n ns.is('checked', checked.value),\n])\n\nconst labelLeftKls = computed(() => [\n ns.e('label'),\n ns.em('label', 'left'),\n ns.is('active', !checked.value),\n])\n\nconst labelRightKls = computed(() => [\n ns.e('label'),\n ns.em('label', 'right'),\n ns.is('active', checked.value),\n])\n\nconst coreStyle = computed<CSSProperties>(() => ({\n width: addUnit(props.width),\n}))\n\nwatch(\n () => props.modelValue,\n () => {\n isControlled.value = true\n }\n)\n\nwatch(\n () => props.value,\n () => {\n isControlled.value = false\n }\n)\n\nconst actualValue = computed(() => {\n return isControlled.value ? props.modelValue : props.value\n})\n\nconst checked = computed(() => actualValue.value === props.activeValue)\n\nif (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {\n emit(UPDATE_MODEL_EVENT, props.inactiveValue)\n emit(CHANGE_EVENT, props.inactiveValue)\n emit(INPUT_EVENT, props.inactiveValue)\n}\n\nwatch(checked, (val) => {\n input.value!.checked = val\n\n if (props.validateEvent) {\n formItem?.validate?.('change').catch((err) => debugWarn(err))\n }\n})\n\nconst handleChange = () => {\n const val = checked.value ? props.inactiveValue : props.activeValue\n emit(UPDATE_MODEL_EVENT, val)\n emit(CHANGE_EVENT, val)\n emit(INPUT_EVENT, val)\n nextTick(() => {\n input.value!.checked = checked.value\n })\n}\n\nconst switchValue = () => {\n if (switchDisabled.value || switchViewMode.value) return\n\n const { beforeChange } = props\n if (!beforeChange) {\n handleChange()\n return\n }\n\n const shouldChange = beforeChange()\n\n const isPromiseOrBool = [\n isPromise(shouldChange),\n isBoolean(shouldChange),\n ].includes(true)\n if (!isPromiseOrBool) {\n throwError(\n COMPONENT_NAME,\n 'beforeChange must return type `Promise<boolean>` or `boolean`'\n )\n }\n\n if (isPromise(shouldChange)) {\n shouldChange\n .then((result) => {\n if (result) {\n handleChange()\n }\n })\n .catch((e) => {\n debugWarn(COMPONENT_NAME, `some error occurred: ${e}`)\n })\n } else if (shouldChange) {\n handleChange()\n }\n}\n\nconst styles = computed(() => {\n return ns.cssVarBlock({\n ...(props.activeColor ? { 'on-color': props.activeColor } : null),\n ...(props.inactiveColor ? { 'off-color': props.inactiveColor } : null),\n ...(props.borderColor ? { 'border-color': props.borderColor } : null),\n })\n})\n\nconst focus = (): void => {\n input.value?.focus?.()\n}\n\nonMounted(() => {\n input.value!.checked = checked.value\n})\n\ndefineExpose({\n /**\n * @description manual focus to the switch component\n **/\n focus,\n /**\n * @description whether Switch is checked\n */\n checked,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;mCAiGc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAKA,IAAA,MAAM,KAAK,kBAAmB,EAAA,CAAA;AAC9B,IAAM,MAAA,EAAE,aAAa,WAAY,EAAA,CAAA;AACjC,IAAA,MAAM,aAAa,WAAY,EAAA,CAAA;AAC/B,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAEhC,IAAM,MAAA,kBAAA,GAAqB,CAAC,IAAqB,KAAA;AAC/C,MAAK,IAAA,CAAA,OAAA,CAAQ,CAAC,KAAU,KAAA;AACtB,QACE,aAAA,CAAA;AAAA,UACE,MAAM,KAAM,CAAA,CAAA,CAAA;AAAA,UACZ,aAAa,KAAM,CAAA,CAAA,CAAA;AAAA,UACnB,KAAO,EAAA,cAAA;AAAA,UACP,OAAS,EAAA,OAAA;AAAA,UACT,GAAK,EAAA,iEAAA;AAAA,UACL,IAAM,EAAA,WAAA;AAAA,SACR,EACA,QAAS,CAAA,MAAM;AACjB,UACD,IAAA,EAAA,CAAA;AAAA,UACH,OAAA,CAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,KAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAA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A,KAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA;AAAA,KAIX,CAAA;AAAA,IAIA,SAAA,CAAA,MAAA;AAAA,MACD,KAAA,CAAA,KAAA,CAAA,OAAA,GAAA,OAAA,CAAA,KAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,10 @@
1
1
  import '../../utils/index.mjs';
2
2
  import Tabs from './src/tabs.mjs';
3
3
  export { tabsEmits, tabsProps } from './src/tabs.mjs';
4
- import TabPane from './src/tab-pane2.mjs';
5
- export { tabBarProps } from './src/tab-bar2.mjs';
4
+ import TabPane from './src/tab-pane.mjs';
5
+ export { tabBarProps } from './src/tab-bar.mjs';
6
6
  export { tabNavEmits, tabNavProps } from './src/tab-nav.mjs';
7
- export { tabPaneProps } from './src/tab-pane.mjs';
7
+ export { tabPaneProps } from './src/tab-pane2.mjs';
8
8
  export { tabsRootContextKey } from './src/constants.mjs';
9
9
  import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
10
10
 
@@ -1,81 +1,13 @@
1
- import { defineComponent, getCurrentInstance, inject, ref, watch, nextTick, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle } from 'vue';
2
- import { useResizeObserver } from '@vueuse/core';
3
1
  import '../../../utils/index.mjs';
4
- import '../../../hooks/index.mjs';
5
- import { tabsRootContextKey } from './constants.mjs';
6
- import { tabBarProps } from './tab-bar2.mjs';
7
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
8
- import { throwError } from '../../../utils/error.mjs';
9
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
10
- import { capitalize } from '../../../utils/strings.mjs';
2
+ import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
3
+ import { mutable } from '../../../utils/typescript.mjs';
11
4
 
12
- const COMPONENT_NAME = "ElTabBar";
13
- const __default__ = defineComponent({
14
- name: COMPONENT_NAME
15
- });
16
- const _sfc_main = /* @__PURE__ */ defineComponent({
17
- ...__default__,
18
- props: tabBarProps,
19
- setup(__props, { expose }) {
20
- const props = __props;
21
- const instance = getCurrentInstance();
22
- const rootTabs = inject(tabsRootContextKey);
23
- if (!rootTabs)
24
- throwError(COMPONENT_NAME, "<el-tabs><el-tab-bar /></el-tabs>");
25
- const ns = useNamespace("tabs");
26
- const barRef = ref();
27
- const barStyle = ref();
28
- const getBarStyle = () => {
29
- let offset = 0;
30
- let tabSize = 0;
31
- const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height";
32
- const sizeDir = sizeName === "width" ? "x" : "y";
33
- const position = sizeDir === "x" ? "left" : "top";
34
- props.tabs.every((tab) => {
35
- var _a, _b;
36
- const $el = (_b = (_a = instance.parent) == null ? void 0 : _a.refs) == null ? void 0 : _b[`tab-${tab.uid}`];
37
- if (!$el)
38
- return false;
39
- if (!tab.active) {
40
- return true;
41
- }
42
- offset = $el[`offset${capitalize(position)}`];
43
- tabSize = $el[`client${capitalize(sizeName)}`];
44
- const tabStyles = window.getComputedStyle($el);
45
- if (sizeName === "width") {
46
- if (props.tabs.length > 1) {
47
- tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
48
- }
49
- offset += Number.parseFloat(tabStyles.paddingLeft);
50
- }
51
- return false;
52
- });
53
- return {
54
- [sizeName]: `${tabSize}px`,
55
- transform: `translate${capitalize(sizeDir)}(${offset}px)`
56
- };
57
- };
58
- const update = () => barStyle.value = getBarStyle();
59
- watch(() => props.tabs, async () => {
60
- await nextTick();
61
- update();
62
- }, { immediate: true });
63
- useResizeObserver(barRef, () => update());
64
- expose({
65
- ref: barRef,
66
- update
67
- });
68
- return (_ctx, _cache) => {
69
- return openBlock(), createElementBlock("div", {
70
- ref_key: "barRef",
71
- ref: barRef,
72
- class: normalizeClass([unref(ns).e("active-bar"), unref(ns).is(unref(rootTabs).props.tabPosition)]),
73
- style: normalizeStyle(barStyle.value)
74
- }, null, 6);
75
- };
5
+ const tabBarProps = buildProps({
6
+ tabs: {
7
+ type: definePropType(Array),
8
+ default: () => mutable([])
76
9
  }
77
10
  });
78
- var TabBar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:\\workspace\\element-pe\\packages\\components\\tabs\\src\\tab-bar.vue"]]);
79
11
 
80
- export { TabBar as default };
12
+ export { tabBarProps };
81
13
  //# sourceMappingURL=tab-bar.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tab-bar.mjs","sources":["../../../../../../packages/components/tabs/src/tab-bar.vue"],"sourcesContent":["<template>\n <div\n ref=\"barRef\"\n :class=\"[ns.e('active-bar'), ns.is(rootTabs.props.tabPosition)]\"\n :style=\"barStyle\"\n />\n</template>\n\n<script lang=\"ts\" setup>\nimport { getCurrentInstance, inject, nextTick, ref, watch } from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { capitalize, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { tabsRootContextKey } from './constants'\nimport { tabBarProps } from './tab-bar'\n\nimport type { CSSProperties } from 'vue'\n\nconst COMPONENT_NAME = 'ElTabBar'\ndefineOptions({\n name: COMPONENT_NAME,\n})\nconst props = defineProps(tabBarProps)\n\nconst instance = getCurrentInstance()!\nconst rootTabs = inject(tabsRootContextKey)\nif (!rootTabs) throwError(COMPONENT_NAME, '<el-tabs><el-tab-bar /></el-tabs>')\n\nconst ns = useNamespace('tabs')\n\nconst barRef = ref<HTMLDivElement>()\nconst barStyle = ref<CSSProperties>()\n\nconst getBarStyle = (): CSSProperties => {\n let offset = 0\n let tabSize = 0\n\n const sizeName = ['top', 'bottom'].includes(rootTabs.props.tabPosition)\n ? 'width'\n : 'height'\n const sizeDir = sizeName === 'width' ? 'x' : 'y'\n const position = sizeDir === 'x' ? 'left' : 'top'\n\n props.tabs.every((tab) => {\n const $el = instance.parent?.refs?.[`tab-${tab.uid}`] as HTMLElement\n if (!$el) return false\n\n if (!tab.active) {\n return true\n }\n\n offset = $el[`offset${capitalize(position)}`]\n tabSize = $el[`client${capitalize(sizeName)}`]\n\n const tabStyles = window.getComputedStyle($el)\n\n if (sizeName === 'width') {\n if (props.tabs.length > 1) {\n tabSize -=\n Number.parseFloat(tabStyles.paddingLeft) +\n Number.parseFloat(tabStyles.paddingRight)\n }\n offset += Number.parseFloat(tabStyles.paddingLeft)\n }\n return false\n })\n\n return {\n [sizeName]: `${tabSize}px`,\n transform: `translate${capitalize(sizeDir)}(${offset}px)`,\n }\n}\n\nconst update = () => (barStyle.value = getBarStyle())\n\nwatch(\n () => props.tabs,\n async () => {\n await nextTick()\n update()\n },\n { immediate: true }\n)\nuseResizeObserver(barRef, () => update())\n\ndefineExpose({\n /** @description tab root html element */\n ref: barRef,\n /** @description method to manually update tab bar style */\n update,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;mCAmBc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;AAGA,IAAA,MAAM,WAAW,kBAAmB,EAAA,CAAA;AACpC,IAAM,MAAA,QAAA,GAAW,OAAO,kBAAkB,CAAA,CAAA;AAC1C,IAAA,IAAI,CAAC,QAAA;AAAU,MAAA,UAAA,CAAW,gBAAgB,mCAAmC,CAAA,CAAA;AAE7E,IAAM,MAAA,EAAA,GAAK,aAAa,MAAM,CAAA,CAAA;AAE9B,IAAA,MAAM,SAAS,GAAoB,EAAA,CAAA;AACnC,IAAA,MAAM,WAAW,GAAmB,EAAA,CAAA;AAEpC,IAAA,MAAM,cAAc,MAAqB;AACvC,MAAA,IAAI,MAAS,GAAA,CAAA,CAAA;AACb,MAAA,IAAI,OAAU,GAAA,CAAA,CAAA;AAEd,MAAM,MAAA,QAAA,GAA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AA,SAAA,CAAA,YAAA,CAAA,CAAA;AACA,WAAU;AAAuC,UACnD,MAAA,IAAA,MAAA,CAAA,UAAA,CAAA,SAAA,CAAA,WAAA,CAAA,CAAA;AACA,SAAO;AAAA,QACR,OAAA,KAAA,CAAA;AAED,OAAO,CAAA,CAAA;AAAA,MACL;AAAe,QACf,CAAW,QAAA,GAAA,CAAA,EAAA,OAAA,CAAY,EAAW,CAAA;AAAY,QAChD,SAAA,EAAA,CAAA,SAAA,EAAA,UAAA,CAAA,OAAA,CAAA,CAAA,CAAA,EAAA,MAAA,CAAA,GAAA,CAAA;AAAA,OACF,CAAA;AAEA,KAAA,CAAA;AAEA,IACE,MAAA,MAAM,GAAM,MAAA,QACA,CAAA,KAAA,GAAA,WAAA,EAAA,CAAA;AACV,IAAA,KAAA,CAAA,MAAe,KAAA,CAAA,IAAA,EAAA,YAAA;AACf,MAAO,MAAA,QAAA,EAAA,CAAA;AAAA,MAET,MAAa,EAAA,CAAA;AAEf,KAAkB,EAAA,EAAA,SAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AAElB,IAAa,iBAAA,CAAA,MAAA,EAAA,MAAA,MAAA,EAAA,CAAA,CAAA;AAAA,IAAA,MAEN,CAAA;AAAA,MAEL,GAAA,EAAA,MAAA;AAAA,MACD,MAAA;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"tab-bar.mjs","sources":["../../../../../../packages/components/tabs/src/tab-bar.ts"],"sourcesContent":["import { buildProps, definePropType, mutable } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { TabsPaneContext } from './constants'\nimport type TabBar from './tab-bar.vue'\n\nexport const tabBarProps = buildProps({\n tabs: {\n type: definePropType<TabsPaneContext[]>(Array),\n default: () => mutable([] as const),\n },\n} as const)\n\nexport type TabBarProps = ExtractPropTypes<typeof tabBarProps>\nexport type TabBarInstance = InstanceType<typeof TabBar>\n"],"names":[],"mappings":";;;;AACY,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,CAAC;;;;"}
@@ -1,13 +1,81 @@
1
+ import { defineComponent, getCurrentInstance, inject, ref, watch, nextTick, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle } from 'vue';
2
+ import { useResizeObserver } from '@vueuse/core';
1
3
  import '../../../utils/index.mjs';
2
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
3
- import { mutable } from '../../../utils/typescript.mjs';
4
+ import '../../../hooks/index.mjs';
5
+ import { tabsRootContextKey } from './constants.mjs';
6
+ import { tabBarProps } from './tab-bar.mjs';
7
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
8
+ import { throwError } from '../../../utils/error.mjs';
9
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
10
+ import { capitalize } from '../../../utils/strings.mjs';
4
11
 
5
- const tabBarProps = buildProps({
6
- tabs: {
7
- type: definePropType(Array),
8
- default: () => mutable([])
12
+ const COMPONENT_NAME = "ElTabBar";
13
+ const __default__ = defineComponent({
14
+ name: COMPONENT_NAME
15
+ });
16
+ const _sfc_main = /* @__PURE__ */ defineComponent({
17
+ ...__default__,
18
+ props: tabBarProps,
19
+ setup(__props, { expose }) {
20
+ const props = __props;
21
+ const instance = getCurrentInstance();
22
+ const rootTabs = inject(tabsRootContextKey);
23
+ if (!rootTabs)
24
+ throwError(COMPONENT_NAME, "<el-tabs><el-tab-bar /></el-tabs>");
25
+ const ns = useNamespace("tabs");
26
+ const barRef = ref();
27
+ const barStyle = ref();
28
+ const getBarStyle = () => {
29
+ let offset = 0;
30
+ let tabSize = 0;
31
+ const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height";
32
+ const sizeDir = sizeName === "width" ? "x" : "y";
33
+ const position = sizeDir === "x" ? "left" : "top";
34
+ props.tabs.every((tab) => {
35
+ var _a, _b;
36
+ const $el = (_b = (_a = instance.parent) == null ? void 0 : _a.refs) == null ? void 0 : _b[`tab-${tab.uid}`];
37
+ if (!$el)
38
+ return false;
39
+ if (!tab.active) {
40
+ return true;
41
+ }
42
+ offset = $el[`offset${capitalize(position)}`];
43
+ tabSize = $el[`client${capitalize(sizeName)}`];
44
+ const tabStyles = window.getComputedStyle($el);
45
+ if (sizeName === "width") {
46
+ if (props.tabs.length > 1) {
47
+ tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
48
+ }
49
+ offset += Number.parseFloat(tabStyles.paddingLeft);
50
+ }
51
+ return false;
52
+ });
53
+ return {
54
+ [sizeName]: `${tabSize}px`,
55
+ transform: `translate${capitalize(sizeDir)}(${offset}px)`
56
+ };
57
+ };
58
+ const update = () => barStyle.value = getBarStyle();
59
+ watch(() => props.tabs, async () => {
60
+ await nextTick();
61
+ update();
62
+ }, { immediate: true });
63
+ useResizeObserver(barRef, () => update());
64
+ expose({
65
+ ref: barRef,
66
+ update
67
+ });
68
+ return (_ctx, _cache) => {
69
+ return openBlock(), createElementBlock("div", {
70
+ ref_key: "barRef",
71
+ ref: barRef,
72
+ class: normalizeClass([unref(ns).e("active-bar"), unref(ns).is(unref(rootTabs).props.tabPosition)]),
73
+ style: normalizeStyle(barStyle.value)
74
+ }, null, 6);
75
+ };
9
76
  }
10
77
  });
78
+ var TabBar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:\\workspace\\element-pe\\packages\\components\\tabs\\src\\tab-bar.vue"]]);
11
79
 
12
- export { tabBarProps };
80
+ export { TabBar as default };
13
81
  //# sourceMappingURL=tab-bar2.mjs.map