beyond-webui 1.1.5 → 1.1.7

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 (507) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/affix/index.mjs +2 -2
  3. package/es/components/affix/src/affix.mjs +26 -117
  4. package/es/components/affix/src/affix.mjs.map +1 -1
  5. package/es/components/affix/src/affix2.mjs +117 -26
  6. package/es/components/affix/src/affix2.mjs.map +1 -1
  7. package/es/components/alert/index.mjs +2 -2
  8. package/es/components/alert/src/alert.mjs +96 -36
  9. package/es/components/alert/src/alert.mjs.map +1 -1
  10. package/es/components/alert/src/alert2.mjs +36 -96
  11. package/es/components/alert/src/alert2.mjs.map +1 -1
  12. package/es/components/autocomplete/src/autocomplete2.mjs +1 -1
  13. package/es/components/avatar/index.mjs +2 -2
  14. package/es/components/avatar/src/avatar.mjs +32 -67
  15. package/es/components/avatar/src/avatar.mjs.map +1 -1
  16. package/es/components/avatar/src/avatar2.mjs +67 -32
  17. package/es/components/avatar/src/avatar2.mjs.map +1 -1
  18. package/es/components/badge/index.mjs +2 -2
  19. package/es/components/badge/src/badge.mjs +17 -55
  20. package/es/components/badge/src/badge.mjs.map +1 -1
  21. package/es/components/badge/src/badge2.mjs +55 -17
  22. package/es/components/badge/src/badge2.mjs.map +1 -1
  23. package/es/components/breadcrumb/index.mjs +4 -4
  24. package/es/components/breadcrumb/src/breadcrumb-item.mjs +56 -11
  25. package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
  26. package/es/components/breadcrumb/src/breadcrumb-item2.mjs +11 -56
  27. package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
  28. package/es/components/breadcrumb/src/breadcrumb.mjs +36 -11
  29. package/es/components/breadcrumb/src/breadcrumb.mjs.map +1 -1
  30. package/es/components/breadcrumb/src/breadcrumb2.mjs +11 -36
  31. package/es/components/breadcrumb/src/breadcrumb2.mjs.map +1 -1
  32. package/es/components/button/index.mjs +3 -3
  33. package/es/components/button/src/button-group.mjs +30 -6
  34. package/es/components/button/src/button-group.mjs.map +1 -1
  35. package/es/components/button/src/button-group2.mjs +6 -30
  36. package/es/components/button/src/button-group2.mjs.map +1 -1
  37. package/es/components/button/src/button.mjs +76 -57
  38. package/es/components/button/src/button.mjs.map +1 -1
  39. package/es/components/button/src/button2.mjs +57 -76
  40. package/es/components/button/src/button2.mjs.map +1 -1
  41. package/es/components/carousel/index.mjs +2 -2
  42. package/es/components/carousel/src/carousel.mjs +159 -56
  43. package/es/components/carousel/src/carousel.mjs.map +1 -1
  44. package/es/components/carousel/src/carousel2.mjs +56 -159
  45. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  46. package/es/components/cascader/src/cascader2.mjs +2 -2
  47. package/es/components/checkbox/index.mjs +2 -2
  48. package/es/components/checkbox/src/checkbox-group.mjs +28 -72
  49. package/es/components/checkbox/src/checkbox-group.mjs.map +1 -1
  50. package/es/components/checkbox/src/checkbox-group2.mjs +72 -28
  51. package/es/components/checkbox/src/checkbox-group2.mjs.map +1 -1
  52. package/es/components/collapse/index.mjs +2 -2
  53. package/es/components/collapse/src/collapse-item.mjs +14 -96
  54. package/es/components/collapse/src/collapse-item.mjs.map +1 -1
  55. package/es/components/collapse/src/collapse-item2.mjs +96 -14
  56. package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
  57. package/es/components/countdown/index.mjs +2 -2
  58. package/es/components/countdown/src/countdown.mjs +74 -23
  59. package/es/components/countdown/src/countdown.mjs.map +1 -1
  60. package/es/components/countdown/src/countdown2.mjs +23 -74
  61. package/es/components/countdown/src/countdown2.mjs.map +1 -1
  62. package/es/components/dialog/src/dialog-content.mjs +106 -37
  63. package/es/components/dialog/src/dialog-content.mjs.map +1 -1
  64. package/es/components/dialog/src/dialog-content2.mjs +37 -106
  65. package/es/components/dialog/src/dialog-content2.mjs.map +1 -1
  66. package/es/components/dialog/src/dialog.mjs +1 -1
  67. package/es/components/dialog/src/dialog2.mjs +1 -1
  68. package/es/components/divider/index.mjs +2 -2
  69. package/es/components/divider/src/divider.mjs +17 -35
  70. package/es/components/divider/src/divider.mjs.map +1 -1
  71. package/es/components/divider/src/divider2.mjs +35 -17
  72. package/es/components/divider/src/divider2.mjs.map +1 -1
  73. package/es/components/drawer/index.mjs +2 -2
  74. package/es/components/drawer/src/drawer.mjs +26 -177
  75. package/es/components/drawer/src/drawer.mjs.map +1 -1
  76. package/es/components/drawer/src/drawer2.mjs +177 -26
  77. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  78. package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
  79. package/es/components/dropdown/src/dropdown-menu.mjs +1 -1
  80. package/es/components/dropdown/src/dropdown.mjs +2 -2
  81. package/es/components/dropdown/src/dropdown2.mjs +1 -1
  82. package/es/components/form/index.mjs +2 -2
  83. package/es/components/form/src/form-item.mjs +43 -317
  84. package/es/components/form/src/form-item.mjs.map +1 -1
  85. package/es/components/form/src/form-item2.mjs +317 -43
  86. package/es/components/form/src/form-item2.mjs.map +1 -1
  87. package/es/components/image/index.mjs +2 -2
  88. package/es/components/image/src/image.mjs +220 -62
  89. package/es/components/image/src/image.mjs.map +1 -1
  90. package/es/components/image/src/image2.mjs +62 -220
  91. package/es/components/image/src/image2.mjs.map +1 -1
  92. package/es/components/image-viewer/index.mjs +2 -2
  93. package/es/components/image-viewer/src/image-viewer.mjs +39 -396
  94. package/es/components/image-viewer/src/image-viewer.mjs.map +1 -1
  95. package/es/components/image-viewer/src/image-viewer2.mjs +396 -39
  96. package/es/components/image-viewer/src/image-viewer2.mjs.map +1 -1
  97. package/es/components/index.mjs +34 -34
  98. package/es/components/link/index.mjs +2 -2
  99. package/es/components/link/src/link.mjs +21 -50
  100. package/es/components/link/src/link.mjs.map +1 -1
  101. package/es/components/link/src/link2.mjs +50 -21
  102. package/es/components/link/src/link2.mjs.map +1 -1
  103. package/es/components/menu/index.mjs +2 -2
  104. package/es/components/menu/src/menu-item.mjs +14 -97
  105. package/es/components/menu/src/menu-item.mjs.map +1 -1
  106. package/es/components/menu/src/menu-item2.mjs +97 -14
  107. package/es/components/menu/src/menu-item2.mjs.map +1 -1
  108. package/es/components/pagination/src/components/sizes.vue.d.ts +6 -6
  109. package/es/components/pagination/src/components/total.mjs +7 -28
  110. package/es/components/pagination/src/components/total.mjs.map +1 -1
  111. package/es/components/pagination/src/components/total2.mjs +28 -7
  112. package/es/components/pagination/src/components/total2.mjs.map +1 -1
  113. package/es/components/pagination/src/pagination.mjs +1 -1
  114. package/es/components/popconfirm/src/popconfirm2.mjs +2 -2
  115. package/es/components/popover/src/popover2.mjs +2 -2
  116. package/es/components/progress/index.mjs +2 -2
  117. package/es/components/progress/src/progress.mjs +57 -202
  118. package/es/components/progress/src/progress.mjs.map +1 -1
  119. package/es/components/progress/src/progress2.mjs +202 -57
  120. package/es/components/progress/src/progress2.mjs.map +1 -1
  121. package/es/components/radio/index.mjs +4 -4
  122. package/es/components/radio/src/radio-button.mjs +64 -9
  123. package/es/components/radio/src/radio-button.mjs.map +1 -1
  124. package/es/components/radio/src/radio-button2.mjs +9 -64
  125. package/es/components/radio/src/radio-button2.mjs.map +1 -1
  126. package/es/components/radio/src/radio-group.mjs +1 -1
  127. package/es/components/radio/src/radio.mjs +30 -71
  128. package/es/components/radio/src/radio.mjs.map +1 -1
  129. package/es/components/radio/src/radio2.mjs +71 -30
  130. package/es/components/radio/src/radio2.mjs.map +1 -1
  131. package/es/components/roving-focus-group/index.mjs +3 -3
  132. package/es/components/roving-focus-group/src/roving-focus-group-impl.mjs +1 -1
  133. package/es/components/roving-focus-group/src/roving-focus-group.mjs +27 -29
  134. package/es/components/roving-focus-group/src/roving-focus-group.mjs.map +1 -1
  135. package/es/components/roving-focus-group/src/roving-focus-group2.mjs +29 -27
  136. package/es/components/roving-focus-group/src/roving-focus-group2.mjs.map +1 -1
  137. package/es/components/roving-focus-group/src/roving-focus-item.mjs +1 -1
  138. package/es/components/row/index.mjs +2 -2
  139. package/es/components/row/src/row.mjs +45 -30
  140. package/es/components/row/src/row.mjs.map +1 -1
  141. package/es/components/row/src/row2.mjs +30 -45
  142. package/es/components/row/src/row2.mjs.map +1 -1
  143. package/es/components/scrollbar/index.mjs +3 -3
  144. package/es/components/scrollbar/src/bar.mjs +17 -42
  145. package/es/components/scrollbar/src/bar.mjs.map +1 -1
  146. package/es/components/scrollbar/src/bar2.mjs +42 -17
  147. package/es/components/scrollbar/src/bar2.mjs.map +1 -1
  148. package/es/components/scrollbar/src/scrollbar.mjs +174 -46
  149. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  150. package/es/components/scrollbar/src/scrollbar2.mjs +46 -174
  151. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  152. package/es/components/scrollbar/src/thumb.mjs +11 -130
  153. package/es/components/scrollbar/src/thumb.mjs.map +1 -1
  154. package/es/components/scrollbar/src/thumb2.mjs +130 -11
  155. package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
  156. package/es/components/select/index.d.ts +6 -6
  157. package/es/components/select/src/select.mjs +2 -2
  158. package/es/components/select/src/select.vue.d.ts +6 -6
  159. package/es/components/select-v2/index.d.ts +10 -10
  160. package/es/components/select-v2/src/defaults.mjs +1 -1
  161. package/es/components/select-v2/src/select.vue.d.ts +5 -5
  162. package/es/components/skeleton/index.mjs +2 -2
  163. package/es/components/skeleton/src/skeleton.mjs +49 -22
  164. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  165. package/es/components/skeleton/src/skeleton2.mjs +22 -49
  166. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  167. package/es/components/slider/index.mjs +2 -2
  168. package/es/components/slider/src/slider.mjs +233 -91
  169. package/es/components/slider/src/slider.mjs.map +1 -1
  170. package/es/components/slider/src/slider2.mjs +91 -233
  171. package/es/components/slider/src/slider2.mjs.map +1 -1
  172. package/es/components/statistic/index.mjs +2 -2
  173. package/es/components/statistic/src/statistic.mjs +25 -70
  174. package/es/components/statistic/src/statistic.mjs.map +1 -1
  175. package/es/components/statistic/src/statistic2.mjs +70 -25
  176. package/es/components/statistic/src/statistic2.mjs.map +1 -1
  177. package/es/components/steps/index.mjs +2 -2
  178. package/es/components/steps/src/item.mjs +188 -19
  179. package/es/components/steps/src/item.mjs.map +1 -1
  180. package/es/components/steps/src/item2.mjs +19 -188
  181. package/es/components/steps/src/item2.mjs.map +1 -1
  182. package/es/components/switch/index.mjs +2 -2
  183. package/es/components/switch/src/switch.mjs +88 -241
  184. package/es/components/switch/src/switch.mjs.map +1 -1
  185. package/es/components/switch/src/switch2.mjs +241 -88
  186. package/es/components/switch/src/switch2.mjs.map +1 -1
  187. package/es/components/tag/index.mjs +2 -2
  188. package/es/components/tag/src/tag.mjs +33 -94
  189. package/es/components/tag/src/tag.mjs.map +1 -1
  190. package/es/components/tag/src/tag2.mjs +94 -33
  191. package/es/components/tag/src/tag2.mjs.map +1 -1
  192. package/es/components/teleport/index.mjs +2 -2
  193. package/es/components/teleport/src/teleport.mjs +18 -44
  194. package/es/components/teleport/src/teleport.mjs.map +1 -1
  195. package/es/components/teleport/src/teleport2.mjs +44 -18
  196. package/es/components/teleport/src/teleport2.mjs.map +1 -1
  197. package/es/components/text/index.mjs +2 -2
  198. package/es/components/text/src/text.mjs +22 -35
  199. package/es/components/text/src/text.mjs.map +1 -1
  200. package/es/components/text/src/text2.mjs +35 -22
  201. package/es/components/text/src/text2.mjs.map +1 -1
  202. package/es/components/time-select/index.d.ts +26 -26
  203. package/es/components/time-select/src/time-select.vue.d.ts +13 -13
  204. package/es/components/tooltip/index.mjs +2 -2
  205. package/es/components/tooltip/src/content.mjs +177 -31
  206. package/es/components/tooltip/src/content.mjs.map +1 -1
  207. package/es/components/tooltip/src/content2.mjs +31 -177
  208. package/es/components/tooltip/src/content2.mjs.map +1 -1
  209. package/es/components/tooltip/src/tooltip.mjs +2 -2
  210. package/es/components/tooltip/src/tooltip2.mjs +2 -2
  211. package/es/components/tooltip/src/trigger.mjs +16 -73
  212. package/es/components/tooltip/src/trigger.mjs.map +1 -1
  213. package/es/components/tooltip/src/trigger2.mjs +73 -16
  214. package/es/components/tooltip/src/trigger2.mjs.map +1 -1
  215. package/es/components/tooltip-v2/index.mjs +4 -4
  216. package/es/components/tooltip-v2/src/arrow.mjs +22 -37
  217. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  218. package/es/components/tooltip-v2/src/arrow2.mjs +37 -22
  219. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  220. package/es/components/tooltip-v2/src/content.mjs +50 -112
  221. package/es/components/tooltip-v2/src/content.mjs.map +1 -1
  222. package/es/components/tooltip-v2/src/content2.mjs +112 -50
  223. package/es/components/tooltip-v2/src/content2.mjs.map +1 -1
  224. package/es/components/tooltip-v2/src/root.mjs +80 -17
  225. package/es/components/tooltip-v2/src/root.mjs.map +1 -1
  226. package/es/components/tooltip-v2/src/root2.mjs +17 -80
  227. package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
  228. package/es/components/tooltip-v2/src/tooltip.mjs +4 -4
  229. package/es/components/tooltip-v2/src/tooltip2.mjs +8 -8
  230. package/es/components/tooltip-v2/src/trigger.mjs +89 -12
  231. package/es/components/tooltip-v2/src/trigger.mjs.map +1 -1
  232. package/es/components/tooltip-v2/src/trigger2.mjs +12 -89
  233. package/es/components/tooltip-v2/src/trigger2.mjs.map +1 -1
  234. package/es/components/transfer/index.mjs +2 -2
  235. package/es/components/transfer/src/composables/use-checked-change.mjs +1 -1
  236. package/es/components/transfer/src/transfer-panel.mjs +1 -1
  237. package/es/components/transfer/src/transfer.mjs +160 -69
  238. package/es/components/transfer/src/transfer.mjs.map +1 -1
  239. package/es/components/transfer/src/transfer2.mjs +69 -160
  240. package/es/components/transfer/src/transfer2.mjs.map +1 -1
  241. package/es/index.mjs +34 -34
  242. package/lib/components/affix/index.js +2 -2
  243. package/lib/components/affix/src/affix.js +27 -117
  244. package/lib/components/affix/src/affix.js.map +1 -1
  245. package/lib/components/affix/src/affix2.js +117 -27
  246. package/lib/components/affix/src/affix2.js.map +1 -1
  247. package/lib/components/alert/index.js +2 -2
  248. package/lib/components/alert/src/alert.js +95 -37
  249. package/lib/components/alert/src/alert.js.map +1 -1
  250. package/lib/components/alert/src/alert2.js +37 -95
  251. package/lib/components/alert/src/alert2.js.map +1 -1
  252. package/lib/components/autocomplete/src/autocomplete2.js +1 -1
  253. package/lib/components/avatar/index.js +2 -2
  254. package/lib/components/avatar/src/avatar.js +33 -67
  255. package/lib/components/avatar/src/avatar.js.map +1 -1
  256. package/lib/components/avatar/src/avatar2.js +67 -33
  257. package/lib/components/avatar/src/avatar2.js.map +1 -1
  258. package/lib/components/badge/index.js +2 -2
  259. package/lib/components/badge/src/badge.js +17 -55
  260. package/lib/components/badge/src/badge.js.map +1 -1
  261. package/lib/components/badge/src/badge2.js +55 -17
  262. package/lib/components/badge/src/badge2.js.map +1 -1
  263. package/lib/components/breadcrumb/index.js +4 -4
  264. package/lib/components/breadcrumb/src/breadcrumb-item.js +56 -11
  265. package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
  266. package/lib/components/breadcrumb/src/breadcrumb-item2.js +11 -56
  267. package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
  268. package/lib/components/breadcrumb/src/breadcrumb.js +36 -11
  269. package/lib/components/breadcrumb/src/breadcrumb.js.map +1 -1
  270. package/lib/components/breadcrumb/src/breadcrumb2.js +11 -36
  271. package/lib/components/breadcrumb/src/breadcrumb2.js.map +1 -1
  272. package/lib/components/button/index.js +3 -3
  273. package/lib/components/button/src/button-group.js +30 -6
  274. package/lib/components/button/src/button-group.js.map +1 -1
  275. package/lib/components/button/src/button-group2.js +6 -30
  276. package/lib/components/button/src/button-group2.js.map +1 -1
  277. package/lib/components/button/src/button.js +76 -60
  278. package/lib/components/button/src/button.js.map +1 -1
  279. package/lib/components/button/src/button2.js +60 -76
  280. package/lib/components/button/src/button2.js.map +1 -1
  281. package/lib/components/carousel/index.js +2 -2
  282. package/lib/components/carousel/src/carousel.js +159 -57
  283. package/lib/components/carousel/src/carousel.js.map +1 -1
  284. package/lib/components/carousel/src/carousel2.js +57 -159
  285. package/lib/components/carousel/src/carousel2.js.map +1 -1
  286. package/lib/components/cascader/src/cascader2.js +2 -2
  287. package/lib/components/checkbox/index.js +2 -2
  288. package/lib/components/checkbox/src/checkbox-group.js +29 -72
  289. package/lib/components/checkbox/src/checkbox-group.js.map +1 -1
  290. package/lib/components/checkbox/src/checkbox-group2.js +72 -29
  291. package/lib/components/checkbox/src/checkbox-group2.js.map +1 -1
  292. package/lib/components/collapse/index.js +2 -2
  293. package/lib/components/collapse/src/collapse-item.js +14 -96
  294. package/lib/components/collapse/src/collapse-item.js.map +1 -1
  295. package/lib/components/collapse/src/collapse-item2.js +96 -14
  296. package/lib/components/collapse/src/collapse-item2.js.map +1 -1
  297. package/lib/components/countdown/index.js +2 -2
  298. package/lib/components/countdown/src/countdown.js +74 -24
  299. package/lib/components/countdown/src/countdown.js.map +1 -1
  300. package/lib/components/countdown/src/countdown2.js +24 -74
  301. package/lib/components/countdown/src/countdown2.js.map +1 -1
  302. package/lib/components/dialog/src/dialog-content.js +105 -37
  303. package/lib/components/dialog/src/dialog-content.js.map +1 -1
  304. package/lib/components/dialog/src/dialog-content2.js +37 -105
  305. package/lib/components/dialog/src/dialog-content2.js.map +1 -1
  306. package/lib/components/dialog/src/dialog.js +1 -1
  307. package/lib/components/dialog/src/dialog2.js +1 -1
  308. package/lib/components/divider/index.js +2 -2
  309. package/lib/components/divider/src/divider.js +17 -35
  310. package/lib/components/divider/src/divider.js.map +1 -1
  311. package/lib/components/divider/src/divider2.js +35 -17
  312. package/lib/components/divider/src/divider2.js.map +1 -1
  313. package/lib/components/drawer/index.js +2 -2
  314. package/lib/components/drawer/src/drawer.js +27 -177
  315. package/lib/components/drawer/src/drawer.js.map +1 -1
  316. package/lib/components/drawer/src/drawer2.js +177 -27
  317. package/lib/components/drawer/src/drawer2.js.map +1 -1
  318. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
  319. package/lib/components/dropdown/src/dropdown-menu.js +1 -1
  320. package/lib/components/dropdown/src/dropdown.js +2 -2
  321. package/lib/components/dropdown/src/dropdown2.js +1 -1
  322. package/lib/components/form/index.js +2 -2
  323. package/lib/components/form/src/form-item.js +44 -321
  324. package/lib/components/form/src/form-item.js.map +1 -1
  325. package/lib/components/form/src/form-item2.js +321 -44
  326. package/lib/components/form/src/form-item2.js.map +1 -1
  327. package/lib/components/image/index.js +2 -2
  328. package/lib/components/image/src/image.js +219 -62
  329. package/lib/components/image/src/image.js.map +1 -1
  330. package/lib/components/image/src/image2.js +62 -219
  331. package/lib/components/image/src/image2.js.map +1 -1
  332. package/lib/components/image-viewer/index.js +2 -2
  333. package/lib/components/image-viewer/src/image-viewer.js +40 -396
  334. package/lib/components/image-viewer/src/image-viewer.js.map +1 -1
  335. package/lib/components/image-viewer/src/image-viewer2.js +396 -40
  336. package/lib/components/image-viewer/src/image-viewer2.js.map +1 -1
  337. package/lib/components/index.js +34 -34
  338. package/lib/components/link/index.js +2 -2
  339. package/lib/components/link/src/link.js +22 -50
  340. package/lib/components/link/src/link.js.map +1 -1
  341. package/lib/components/link/src/link2.js +50 -22
  342. package/lib/components/link/src/link2.js.map +1 -1
  343. package/lib/components/menu/index.js +2 -2
  344. package/lib/components/menu/src/menu-item.js +15 -97
  345. package/lib/components/menu/src/menu-item.js.map +1 -1
  346. package/lib/components/menu/src/menu-item2.js +97 -15
  347. package/lib/components/menu/src/menu-item2.js.map +1 -1
  348. package/lib/components/pagination/src/components/sizes.vue.d.ts +6 -6
  349. package/lib/components/pagination/src/components/total.js +7 -28
  350. package/lib/components/pagination/src/components/total.js.map +1 -1
  351. package/lib/components/pagination/src/components/total2.js +28 -7
  352. package/lib/components/pagination/src/components/total2.js.map +1 -1
  353. package/lib/components/pagination/src/pagination.js +1 -1
  354. package/lib/components/popconfirm/src/popconfirm2.js +2 -2
  355. package/lib/components/popover/src/popover2.js +2 -2
  356. package/lib/components/progress/index.js +2 -2
  357. package/lib/components/progress/src/progress.js +57 -202
  358. package/lib/components/progress/src/progress.js.map +1 -1
  359. package/lib/components/progress/src/progress2.js +202 -57
  360. package/lib/components/progress/src/progress2.js.map +1 -1
  361. package/lib/components/radio/index.js +4 -4
  362. package/lib/components/radio/src/radio-button.js +64 -9
  363. package/lib/components/radio/src/radio-button.js.map +1 -1
  364. package/lib/components/radio/src/radio-button2.js +9 -64
  365. package/lib/components/radio/src/radio-button2.js.map +1 -1
  366. package/lib/components/radio/src/radio-group.js +1 -1
  367. package/lib/components/radio/src/radio.js +32 -71
  368. package/lib/components/radio/src/radio.js.map +1 -1
  369. package/lib/components/radio/src/radio2.js +71 -32
  370. package/lib/components/radio/src/radio2.js.map +1 -1
  371. package/lib/components/roving-focus-group/index.js +2 -2
  372. package/lib/components/roving-focus-group/src/roving-focus-group-impl.js +1 -1
  373. package/lib/components/roving-focus-group/src/roving-focus-group.js +27 -33
  374. package/lib/components/roving-focus-group/src/roving-focus-group.js.map +1 -1
  375. package/lib/components/roving-focus-group/src/roving-focus-group2.js +33 -27
  376. package/lib/components/roving-focus-group/src/roving-focus-group2.js.map +1 -1
  377. package/lib/components/roving-focus-group/src/roving-focus-item.js +1 -1
  378. package/lib/components/row/index.js +2 -2
  379. package/lib/components/row/src/row.js +45 -32
  380. package/lib/components/row/src/row.js.map +1 -1
  381. package/lib/components/row/src/row2.js +32 -45
  382. package/lib/components/row/src/row2.js.map +1 -1
  383. package/lib/components/scrollbar/index.js +3 -3
  384. package/lib/components/scrollbar/src/bar.js +17 -42
  385. package/lib/components/scrollbar/src/bar.js.map +1 -1
  386. package/lib/components/scrollbar/src/bar2.js +42 -17
  387. package/lib/components/scrollbar/src/bar2.js.map +1 -1
  388. package/lib/components/scrollbar/src/scrollbar.js +174 -47
  389. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  390. package/lib/components/scrollbar/src/scrollbar2.js +47 -174
  391. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  392. package/lib/components/scrollbar/src/thumb.js +11 -130
  393. package/lib/components/scrollbar/src/thumb.js.map +1 -1
  394. package/lib/components/scrollbar/src/thumb2.js +130 -11
  395. package/lib/components/scrollbar/src/thumb2.js.map +1 -1
  396. package/lib/components/select/index.d.ts +6 -6
  397. package/lib/components/select/src/select.js +2 -2
  398. package/lib/components/select/src/select.vue.d.ts +6 -6
  399. package/lib/components/select-v2/index.d.ts +10 -10
  400. package/lib/components/select-v2/src/defaults.js +1 -1
  401. package/lib/components/select-v2/src/select.vue.d.ts +5 -5
  402. package/lib/components/skeleton/index.js +2 -2
  403. package/lib/components/skeleton/src/skeleton.js +49 -22
  404. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  405. package/lib/components/skeleton/src/skeleton2.js +22 -49
  406. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  407. package/lib/components/slider/index.js +2 -2
  408. package/lib/components/slider/src/slider.js +233 -92
  409. package/lib/components/slider/src/slider.js.map +1 -1
  410. package/lib/components/slider/src/slider2.js +92 -233
  411. package/lib/components/slider/src/slider2.js.map +1 -1
  412. package/lib/components/statistic/index.js +2 -2
  413. package/lib/components/statistic/src/statistic.js +25 -70
  414. package/lib/components/statistic/src/statistic.js.map +1 -1
  415. package/lib/components/statistic/src/statistic2.js +70 -25
  416. package/lib/components/statistic/src/statistic2.js.map +1 -1
  417. package/lib/components/steps/index.js +2 -2
  418. package/lib/components/steps/src/item.js +188 -19
  419. package/lib/components/steps/src/item.js.map +1 -1
  420. package/lib/components/steps/src/item2.js +19 -188
  421. package/lib/components/steps/src/item2.js.map +1 -1
  422. package/lib/components/switch/index.js +2 -2
  423. package/lib/components/switch/src/switch.js +88 -240
  424. package/lib/components/switch/src/switch.js.map +1 -1
  425. package/lib/components/switch/src/switch2.js +240 -88
  426. package/lib/components/switch/src/switch2.js.map +1 -1
  427. package/lib/components/tag/index.js +2 -2
  428. package/lib/components/tag/src/tag.js +34 -94
  429. package/lib/components/tag/src/tag.js.map +1 -1
  430. package/lib/components/tag/src/tag2.js +94 -34
  431. package/lib/components/tag/src/tag2.js.map +1 -1
  432. package/lib/components/teleport/index.js +2 -2
  433. package/lib/components/teleport/src/teleport.js +18 -44
  434. package/lib/components/teleport/src/teleport.js.map +1 -1
  435. package/lib/components/teleport/src/teleport2.js +44 -18
  436. package/lib/components/teleport/src/teleport2.js.map +1 -1
  437. package/lib/components/text/index.js +2 -2
  438. package/lib/components/text/src/text.js +22 -35
  439. package/lib/components/text/src/text.js.map +1 -1
  440. package/lib/components/text/src/text2.js +35 -22
  441. package/lib/components/text/src/text2.js.map +1 -1
  442. package/lib/components/time-select/index.d.ts +26 -26
  443. package/lib/components/time-select/src/time-select.vue.d.ts +13 -13
  444. package/lib/components/tooltip/index.js +2 -2
  445. package/lib/components/tooltip/src/content.js +177 -31
  446. package/lib/components/tooltip/src/content.js.map +1 -1
  447. package/lib/components/tooltip/src/content2.js +31 -177
  448. package/lib/components/tooltip/src/content2.js.map +1 -1
  449. package/lib/components/tooltip/src/tooltip.js +2 -2
  450. package/lib/components/tooltip/src/tooltip2.js +2 -2
  451. package/lib/components/tooltip/src/trigger.js +16 -73
  452. package/lib/components/tooltip/src/trigger.js.map +1 -1
  453. package/lib/components/tooltip/src/trigger2.js +73 -16
  454. package/lib/components/tooltip/src/trigger2.js.map +1 -1
  455. package/lib/components/tooltip-v2/index.js +4 -4
  456. package/lib/components/tooltip-v2/src/arrow.js +23 -37
  457. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  458. package/lib/components/tooltip-v2/src/arrow2.js +37 -23
  459. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  460. package/lib/components/tooltip-v2/src/content.js +50 -112
  461. package/lib/components/tooltip-v2/src/content.js.map +1 -1
  462. package/lib/components/tooltip-v2/src/content2.js +112 -50
  463. package/lib/components/tooltip-v2/src/content2.js.map +1 -1
  464. package/lib/components/tooltip-v2/src/root.js +80 -17
  465. package/lib/components/tooltip-v2/src/root.js.map +1 -1
  466. package/lib/components/tooltip-v2/src/root2.js +17 -80
  467. package/lib/components/tooltip-v2/src/root2.js.map +1 -1
  468. package/lib/components/tooltip-v2/src/tooltip.js +4 -4
  469. package/lib/components/tooltip-v2/src/tooltip2.js +8 -8
  470. package/lib/components/tooltip-v2/src/trigger.js +89 -12
  471. package/lib/components/tooltip-v2/src/trigger.js.map +1 -1
  472. package/lib/components/tooltip-v2/src/trigger2.js +12 -89
  473. package/lib/components/tooltip-v2/src/trigger2.js.map +1 -1
  474. package/lib/components/transfer/index.js +2 -2
  475. package/lib/components/transfer/src/composables/use-checked-change.js +1 -1
  476. package/lib/components/transfer/src/transfer-panel.js +1 -1
  477. package/lib/components/transfer/src/transfer.js +160 -73
  478. package/lib/components/transfer/src/transfer.js.map +1 -1
  479. package/lib/components/transfer/src/transfer2.js +73 -160
  480. package/lib/components/transfer/src/transfer2.js.map +1 -1
  481. package/lib/index.js +34 -34
  482. package/package.json +1 -1
  483. package/theme-chalk/el-button.css +1 -1
  484. package/theme-chalk/el-checkbox.css +1 -1
  485. package/theme-chalk/el-dialog.css +1 -1
  486. package/theme-chalk/el-form.css +1 -1
  487. package/theme-chalk/el-input.css +1 -1
  488. package/theme-chalk/el-link.css +1 -1
  489. package/theme-chalk/el-message-box.css +1 -1
  490. package/theme-chalk/el-message.css +1 -1
  491. package/theme-chalk/el-pagination.css +1 -1
  492. package/theme-chalk/el-select-dropdown.css +1 -1
  493. package/theme-chalk/el-select.css +1 -1
  494. package/theme-chalk/el-table.css +1 -1
  495. package/theme-chalk/index.css +1 -1
  496. package/theme-chalk/src/button.scss +1 -1
  497. package/theme-chalk/src/checkbox.scss +1 -1
  498. package/theme-chalk/src/dialog.scss +2 -2
  499. package/theme-chalk/src/form.scss +1 -1
  500. package/theme-chalk/src/input.scss +2 -2
  501. package/theme-chalk/src/link.scss +1 -1
  502. package/theme-chalk/src/message-box.scss +2 -2
  503. package/theme-chalk/src/message.scss +1 -1
  504. package/theme-chalk/src/pagination.scss +2 -2
  505. package/theme-chalk/src/select-dropdown.scss +1 -1
  506. package/theme-chalk/src/table.scss +5 -2
  507. package/theme-chalk/src/var.scss +1 -0
@@ -1,96 +1,249 @@
1
+ import { defineComponent, getCurrentInstance, computed, ref, watch, nextTick, onMounted, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, withModifiers, createElementVNode, withKeys, createBlock, withCtx, resolveDynamicComponent, createCommentVNode, toDisplayString, createVNode } from 'vue';
2
+ import { isPromise } from '@vue/shared';
1
3
  import '../../../utils/index.mjs';
4
+ import { ElIcon } from '../../icon/index.mjs';
5
+ import '../../form/index.mjs';
6
+ import { Loading } from '@element-plus/icons-vue';
2
7
  import '../../../constants/index.mjs';
3
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
4
- import { iconPropType } from '../../../utils/vue/icon.mjs';
5
- import { isValidComponentSize } from '../../../utils/vue/validator.mjs';
8
+ import '../../../hooks/index.mjs';
9
+ import { switchProps, switchEmits } from './switch.mjs';
10
+ import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
11
+ import { useFormItem, useFormItemInputId } from '../../form/src/hooks/use-form-item.mjs';
12
+ import { useFormSize, useFormDisabled } from '../../form/src/hooks/use-form-common-props.mjs';
13
+ import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
14
+ import { useDeprecated } from '../../../hooks/use-deprecated/index.mjs';
15
+ import { addUnit } from '../../../utils/dom/style.mjs';
6
16
  import { UPDATE_MODEL_EVENT, CHANGE_EVENT, INPUT_EVENT } from '../../../constants/event.mjs';
7
- import { isBoolean, isNumber } from '../../../utils/types.mjs';
8
- import { isString } from '@vue/shared';
17
+ import { debugWarn, throwError } from '../../../utils/error.mjs';
18
+ import { isBoolean } from '../../../utils/types.mjs';
9
19
 
10
- const switchProps = buildProps({
11
- modelValue: {
12
- type: [Boolean, String, Number],
13
- default: false
14
- },
15
- value: {
16
- type: [Boolean, String, Number],
17
- default: false
18
- },
19
- disabled: {
20
- type: Boolean,
21
- default: false
22
- },
23
- width: {
24
- type: [String, Number],
25
- default: ""
26
- },
27
- inlinePrompt: {
28
- type: Boolean,
29
- default: false
30
- },
31
- activeIcon: {
32
- type: iconPropType
33
- },
34
- inactiveIcon: {
35
- type: iconPropType
36
- },
37
- activeText: {
38
- type: String,
39
- default: ""
40
- },
41
- inactiveText: {
42
- type: String,
43
- default: ""
44
- },
45
- activeColor: {
46
- type: String,
47
- default: ""
48
- },
49
- inactiveColor: {
50
- type: String,
51
- default: ""
52
- },
53
- borderColor: {
54
- type: String,
55
- default: ""
56
- },
57
- activeValue: {
58
- type: [Boolean, String, Number],
59
- default: true
60
- },
61
- inactiveValue: {
62
- type: [Boolean, String, Number],
63
- default: false
64
- },
65
- name: {
66
- type: String,
67
- default: ""
68
- },
69
- validateEvent: {
70
- type: Boolean,
71
- default: true
72
- },
73
- id: String,
74
- loading: {
75
- type: Boolean,
76
- default: false
77
- },
78
- beforeChange: {
79
- type: definePropType(Function)
80
- },
81
- size: {
82
- type: String,
83
- validator: isValidComponentSize
84
- },
85
- tabindex: {
86
- type: [String, Number]
20
+ const _hoisted_1 = ["onClick"];
21
+ const _hoisted_2 = ["id", "aria-checked", "aria-disabled", "name", "true-value", "false-value", "disabled", "tabindex", "onKeydown"];
22
+ const _hoisted_3 = ["aria-hidden"];
23
+ const _hoisted_4 = ["aria-hidden"];
24
+ const _hoisted_5 = ["aria-hidden"];
25
+ const COMPONENT_NAME = "ElSwitch";
26
+ const __default__ = defineComponent({
27
+ name: COMPONENT_NAME
28
+ });
29
+ const _sfc_main = /* @__PURE__ */ defineComponent({
30
+ ...__default__,
31
+ props: switchProps,
32
+ emits: switchEmits,
33
+ setup(__props, { expose, emit }) {
34
+ const props = __props;
35
+ const vm = getCurrentInstance();
36
+ const { formItem } = useFormItem();
37
+ const switchSize = useFormSize();
38
+ const ns = useNamespace("switch");
39
+ useDeprecated({
40
+ from: '"value"',
41
+ replacement: '"model-value" or "v-model"',
42
+ scope: COMPONENT_NAME,
43
+ version: "2.3.0",
44
+ ref: "https://element-plus.org/en-US/component/switch.html#attributes",
45
+ type: "Attribute"
46
+ }, computed(() => {
47
+ var _a;
48
+ return !!((_a = vm.vnode.props) == null ? void 0 : _a.value);
49
+ }));
50
+ const { inputId } = useFormItemInputId(props, {
51
+ formItemContext: formItem
52
+ });
53
+ const switchDisabled = useFormDisabled(computed(() => props.loading));
54
+ const isControlled = ref(props.modelValue !== false);
55
+ const input = ref();
56
+ const core = ref();
57
+ const switchKls = computed(() => [
58
+ ns.b(),
59
+ ns.m(switchSize.value),
60
+ ns.is("disabled", switchDisabled.value),
61
+ ns.is("checked", checked.value)
62
+ ]);
63
+ const coreStyle = computed(() => ({
64
+ width: addUnit(props.width)
65
+ }));
66
+ watch(() => props.modelValue, () => {
67
+ isControlled.value = true;
68
+ });
69
+ watch(() => props.value, () => {
70
+ isControlled.value = false;
71
+ });
72
+ const actualValue = computed(() => {
73
+ return isControlled.value ? props.modelValue : props.value;
74
+ });
75
+ const checked = computed(() => actualValue.value === props.activeValue);
76
+ if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {
77
+ emit(UPDATE_MODEL_EVENT, props.inactiveValue);
78
+ emit(CHANGE_EVENT, props.inactiveValue);
79
+ emit(INPUT_EVENT, props.inactiveValue);
80
+ }
81
+ watch(checked, (val) => {
82
+ var _a;
83
+ input.value.checked = val;
84
+ if (props.validateEvent) {
85
+ (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
86
+ }
87
+ });
88
+ const handleChange = () => {
89
+ const val = checked.value ? props.inactiveValue : props.activeValue;
90
+ emit(UPDATE_MODEL_EVENT, val);
91
+ emit(CHANGE_EVENT, val);
92
+ emit(INPUT_EVENT, val);
93
+ nextTick(() => {
94
+ input.value.checked = checked.value;
95
+ });
96
+ };
97
+ const switchValue = () => {
98
+ if (switchDisabled.value)
99
+ return;
100
+ const { beforeChange } = props;
101
+ if (!beforeChange) {
102
+ handleChange();
103
+ return;
104
+ }
105
+ const shouldChange = beforeChange();
106
+ const isPromiseOrBool = [
107
+ isPromise(shouldChange),
108
+ isBoolean(shouldChange)
109
+ ].includes(true);
110
+ if (!isPromiseOrBool) {
111
+ throwError(COMPONENT_NAME, "beforeChange must return type `Promise<boolean>` or `boolean`");
112
+ }
113
+ if (isPromise(shouldChange)) {
114
+ shouldChange.then((result) => {
115
+ if (result) {
116
+ handleChange();
117
+ }
118
+ }).catch((e) => {
119
+ debugWarn(COMPONENT_NAME, `some error occurred: ${e}`);
120
+ });
121
+ } else if (shouldChange) {
122
+ handleChange();
123
+ }
124
+ };
125
+ const styles = computed(() => {
126
+ return ns.cssVarBlock({
127
+ ...props.activeColor ? { "on-color": props.activeColor } : null,
128
+ ...props.inactiveColor ? { "off-color": props.inactiveColor } : null,
129
+ ...props.borderColor ? { "border-color": props.borderColor } : null
130
+ });
131
+ });
132
+ const focus = () => {
133
+ var _a, _b;
134
+ (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
135
+ };
136
+ onMounted(() => {
137
+ input.value.checked = checked.value;
138
+ });
139
+ expose({
140
+ focus,
141
+ checked
142
+ });
143
+ return (_ctx, _cache) => {
144
+ return openBlock(), createElementBlock("div", {
145
+ class: normalizeClass(unref(switchKls)),
146
+ style: normalizeStyle(unref(styles)),
147
+ onClick: withModifiers(switchValue, ["prevent"])
148
+ }, [
149
+ createElementVNode("input", {
150
+ id: unref(inputId),
151
+ ref_key: "input",
152
+ ref: input,
153
+ class: normalizeClass(unref(ns).e("input")),
154
+ type: "checkbox",
155
+ role: "switch",
156
+ "aria-checked": unref(checked),
157
+ "aria-disabled": unref(switchDisabled),
158
+ name: _ctx.name,
159
+ "true-value": _ctx.activeValue,
160
+ "false-value": _ctx.inactiveValue,
161
+ disabled: unref(switchDisabled),
162
+ tabindex: _ctx.tabindex,
163
+ onChange: handleChange,
164
+ onKeydown: withKeys(switchValue, ["enter"])
165
+ }, null, 42, _hoisted_2),
166
+ !_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (openBlock(), createElementBlock("span", {
167
+ key: 0,
168
+ class: normalizeClass([
169
+ unref(ns).e("label"),
170
+ unref(ns).em("label", "left"),
171
+ unref(ns).is("active", !unref(checked))
172
+ ])
173
+ }, [
174
+ _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
175
+ default: withCtx(() => [
176
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))
177
+ ]),
178
+ _: 1
179
+ })) : createCommentVNode("v-if", true),
180
+ !_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
181
+ key: 1,
182
+ "aria-hidden": unref(checked)
183
+ }, toDisplayString(_ctx.inactiveText), 9, _hoisted_3)) : createCommentVNode("v-if", true)
184
+ ], 2)) : createCommentVNode("v-if", true),
185
+ createElementVNode("span", {
186
+ ref_key: "core",
187
+ ref: core,
188
+ class: normalizeClass(unref(ns).e("core")),
189
+ style: normalizeStyle(unref(coreStyle))
190
+ }, [
191
+ _ctx.inlinePrompt ? (openBlock(), createElementBlock("div", {
192
+ key: 0,
193
+ class: normalizeClass(unref(ns).e("inner"))
194
+ }, [
195
+ _ctx.activeIcon || _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), {
196
+ key: 0,
197
+ class: normalizeClass(unref(ns).is("icon"))
198
+ }, {
199
+ default: withCtx(() => [
200
+ (openBlock(), createBlock(resolveDynamicComponent(unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))
201
+ ]),
202
+ _: 1
203
+ }, 8, ["class"])) : _ctx.activeText || _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
204
+ key: 1,
205
+ class: normalizeClass(unref(ns).is("text")),
206
+ "aria-hidden": !unref(checked)
207
+ }, toDisplayString(unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, _hoisted_4)) : createCommentVNode("v-if", true)
208
+ ], 2)) : createCommentVNode("v-if", true),
209
+ createElementVNode("div", {
210
+ class: normalizeClass(unref(ns).e("action"))
211
+ }, [
212
+ _ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {
213
+ key: 0,
214
+ class: normalizeClass(unref(ns).is("loading"))
215
+ }, {
216
+ default: withCtx(() => [
217
+ createVNode(unref(Loading))
218
+ ]),
219
+ _: 1
220
+ }, 8, ["class"])) : createCommentVNode("v-if", true)
221
+ ], 2)
222
+ ], 6),
223
+ !_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (openBlock(), createElementBlock("span", {
224
+ key: 1,
225
+ class: normalizeClass([
226
+ unref(ns).e("label"),
227
+ unref(ns).em("label", "right"),
228
+ unref(ns).is("active", unref(checked))
229
+ ])
230
+ }, [
231
+ _ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
232
+ default: withCtx(() => [
233
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))
234
+ ]),
235
+ _: 1
236
+ })) : createCommentVNode("v-if", true),
237
+ !_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock("span", {
238
+ key: 1,
239
+ "aria-hidden": !unref(checked)
240
+ }, toDisplayString(_ctx.activeText), 9, _hoisted_5)) : createCommentVNode("v-if", true)
241
+ ], 2)) : createCommentVNode("v-if", true)
242
+ ], 14, _hoisted_1);
243
+ };
87
244
  }
88
245
  });
89
- const switchEmits = {
90
- [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
91
- [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
92
- [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
93
- };
246
+ var Switch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:\\Haulistix\\beyond-ui\\packages\\components\\switch\\src\\switch.vue"]]);
94
247
 
95
- export { switchEmits, switchProps };
248
+ export { Switch as default };
96
249
  //# 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,\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 modelValue: {\n type: [Boolean, String, Number],\n default: false,\n },\n value: {\n type: [Boolean, String, Number],\n default: false,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n width: {\n type: [String, Number],\n default: '',\n },\n inlinePrompt: {\n type: Boolean,\n default: false,\n },\n activeIcon: {\n type: iconPropType,\n },\n inactiveIcon: {\n type: iconPropType,\n },\n activeText: {\n type: String,\n default: '',\n },\n inactiveText: {\n type: String,\n default: '',\n },\n activeColor: {\n type: String,\n default: '',\n },\n inactiveColor: {\n type: String,\n default: '',\n },\n borderColor: {\n type: String,\n default: '',\n },\n activeValue: {\n type: [Boolean, String, Number],\n default: true,\n },\n inactiveValue: {\n type: [Boolean, String, Number],\n default: false,\n },\n name: {\n type: String,\n default: '',\n },\n validateEvent: {\n type: Boolean,\n default: true,\n },\n id: String,\n loading: {\n type: Boolean,\n default: false,\n },\n beforeChange: {\n type: definePropType<() => Promise<boolean> | boolean>(Function),\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n tabindex: {\n type: [String, Number],\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 switchE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,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AAC1E;;;;"}
1
+ {"version":3,"file":"switch2.mjs","sources":["../../../../../../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\"\n :tabindex=\"tabindex\"\n @change=\"handleChange\"\n @keydown.enter=\"switchValue\"\n />\n <span\n v-if=\"!inlinePrompt && (inactiveIcon || inactiveText)\"\n :class=\"[\n ns.e('label'),\n ns.em('label', 'left'),\n ns.is('active', !checked),\n ]\"\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 </div>\n </span>\n <span\n v-if=\"!inlinePrompt && (activeIcon || activeText)\"\n :class=\"[\n ns.e('label'),\n ns.em('label', 'right'),\n ns.is('active', checked),\n ]\"\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 watch,\n} from 'vue'\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,\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\nuseDeprecated(\n {\n from: '\"value\"',\n replacement: '\"model-value\" or \"v-model\"',\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?.value)\n)\n\nconst { inputId } = useFormItemInputId(props, {\n formItemContext: formItem,\n})\n\nconst switchDisabled = useFormDisabled(computed(() => props.loading))\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('checked', 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) 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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A,GAAA,OAAA,CAAA,KAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import '../../utils/index.mjs';
2
- import Tag from './src/tag.mjs';
3
- export { tagEmits, tagProps } from './src/tag2.mjs';
2
+ import Tag from './src/tag2.mjs';
3
+ export { tagEmits, tagProps } from './src/tag.mjs';
4
4
  import { withInstall } from '../../utils/vue/install.mjs';
5
5
 
6
6
  const ElTag = withInstall(Tag);
@@ -1,98 +1,37 @@
1
- import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, createElementVNode, renderSlot, createBlock, withModifiers, withCtx, createVNode, createCommentVNode, Transition } from 'vue';
2
- import { ElIcon } from '../../icon/index.mjs';
3
- import { Close } from '@element-plus/icons-vue';
4
- import '../../../hooks/index.mjs';
5
- import '../../form/index.mjs';
6
- import { tagProps, tagEmits } from './tag2.mjs';
7
- import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
8
- import { useFormSize } from '../../form/src/hooks/use-form-common-props.mjs';
9
- import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
1
+ import '../../../utils/index.mjs';
2
+ import '../../../constants/index.mjs';
3
+ import { buildProps } from '../../../utils/vue/props/runtime.mjs';
4
+ import { componentSizes } from '../../../constants/size.mjs';
10
5
 
11
- const __default__ = defineComponent({
12
- name: "ElTag"
6
+ const tagProps = buildProps({
7
+ closable: Boolean,
8
+ type: {
9
+ type: String,
10
+ values: ["success", "info", "warning", "danger", ""],
11
+ default: ""
12
+ },
13
+ hit: Boolean,
14
+ disableTransitions: Boolean,
15
+ color: {
16
+ type: String,
17
+ default: ""
18
+ },
19
+ size: {
20
+ type: String,
21
+ values: componentSizes,
22
+ default: ""
23
+ },
24
+ effect: {
25
+ type: String,
26
+ values: ["dark", "light", "plain"],
27
+ default: "light"
28
+ },
29
+ round: Boolean
13
30
  });
14
- const _sfc_main = /* @__PURE__ */ defineComponent({
15
- ...__default__,
16
- props: tagProps,
17
- emits: tagEmits,
18
- setup(__props, { emit }) {
19
- const props = __props;
20
- const tagSize = useFormSize();
21
- const ns = useNamespace("tag");
22
- const classes = computed(() => {
23
- const { type, hit, effect, closable, round } = props;
24
- return [
25
- ns.b(),
26
- ns.is("closable", closable),
27
- ns.m(type),
28
- ns.m(tagSize.value),
29
- ns.m(effect),
30
- ns.is("hit", hit),
31
- ns.is("round", round)
32
- ];
33
- });
34
- const handleClose = (event) => {
35
- emit("close", event);
36
- };
37
- const handleClick = (event) => {
38
- emit("click", event);
39
- };
40
- return (_ctx, _cache) => {
41
- return _ctx.disableTransitions ? (openBlock(), createElementBlock("span", {
42
- key: 0,
43
- class: normalizeClass(unref(classes)),
44
- style: normalizeStyle({ backgroundColor: _ctx.color }),
45
- onClick: handleClick
46
- }, [
47
- createElementVNode("span", {
48
- class: normalizeClass(unref(ns).e("content"))
49
- }, [
50
- renderSlot(_ctx.$slots, "default")
51
- ], 2),
52
- _ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
53
- key: 0,
54
- class: normalizeClass(unref(ns).e("close")),
55
- onClick: withModifiers(handleClose, ["stop"])
56
- }, {
57
- default: withCtx(() => [
58
- createVNode(unref(Close))
59
- ]),
60
- _: 1
61
- }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
62
- ], 6)) : (openBlock(), createBlock(Transition, {
63
- key: 1,
64
- name: `${unref(ns).namespace.value}-zoom-in-center`,
65
- appear: ""
66
- }, {
67
- default: withCtx(() => [
68
- createElementVNode("span", {
69
- class: normalizeClass(unref(classes)),
70
- style: normalizeStyle({ backgroundColor: _ctx.color }),
71
- onClick: handleClick
72
- }, [
73
- createElementVNode("span", {
74
- class: normalizeClass(unref(ns).e("content"))
75
- }, [
76
- renderSlot(_ctx.$slots, "default")
77
- ], 2),
78
- _ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
79
- key: 0,
80
- class: normalizeClass(unref(ns).e("close")),
81
- onClick: withModifiers(handleClose, ["stop"])
82
- }, {
83
- default: withCtx(() => [
84
- createVNode(unref(Close))
85
- ]),
86
- _: 1
87
- }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
88
- ], 6)
89
- ]),
90
- _: 3
91
- }, 8, ["name"]));
92
- };
93
- }
94
- });
95
- var Tag = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:\\Haulistix\\beyond-ui\\packages\\components\\tag\\src\\tag.vue"]]);
31
+ const tagEmits = {
32
+ close: (evt) => evt instanceof MouseEvent,
33
+ click: (evt) => evt instanceof MouseEvent
34
+ };
96
35
 
97
- export { Tag as default };
36
+ export { tagEmits, tagProps };
98
37
  //# sourceMappingURL=tag.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tag.mjs","sources":["../../../../../../packages/components/tag/src/tag.vue"],"sourcesContent":["<template>\n <span\n v-if=\"disableTransitions\"\n :class=\"classes\"\n :style=\"{ backgroundColor: color }\"\n @click=\"handleClick\"\n >\n <span :class=\"ns.e('content')\">\n <slot />\n </span>\n <el-icon v-if=\"closable\" :class=\"ns.e('close')\" @click.stop=\"handleClose\">\n <Close />\n </el-icon>\n </span>\n <transition v-else :name=\"`${ns.namespace.value}-zoom-in-center`\" appear>\n <span\n :class=\"classes\"\n :style=\"{ backgroundColor: color }\"\n @click=\"handleClick\"\n >\n <span :class=\"ns.e('content')\">\n <slot />\n </span>\n <el-icon v-if=\"closable\" :class=\"ns.e('close')\" @click.stop=\"handleClose\">\n <Close />\n </el-icon>\n </span>\n </transition>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport ElIcon from '@element-plus/components/icon'\nimport { Close } from '@element-plus/icons-vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from '@element-plus/components/form'\n\nimport { tagEmits, tagProps } from './tag'\n\ndefineOptions({\n name: 'ElTag',\n})\nconst props = defineProps(tagProps)\nconst emit = defineEmits(tagEmits)\n\nconst tagSize = useFormSize()\nconst ns = useNamespace('tag')\nconst classes = computed(() => {\n const { type, hit, effect, closable, round } = props\n return [\n ns.b(),\n ns.is('closable', closable),\n ns.m(type),\n ns.m(tagSize.value),\n ns.m(effect),\n ns.is('hit', hit),\n ns.is('round', round),\n ]\n})\n\n// methods\nconst handleClose = (event: MouseEvent) => {\n emit('close', event)\n}\n\nconst handleClick = (event: MouseEvent) => {\n emit('click', event)\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;mCAuCc,CAAA;AAAA,EACZ,IAAM,EAAA,OAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAA,MAAM,UAAU,WAAY,EAAA,CAAA;AAC5B,IAAM,MAAA,EAAA,GAAK,aAAa,KAAK,CAAA,CAAA;AAC7B,IAAM,MAAA,OAAA,GAAU,SAAS,MAAM;AAC7B,MAAA,MAAM,EAAE,IAAA,EAAM,GAAK,EAAA,MAAA,EAAQ,UAAU,KAAU,EAAA,GAAA,KAAA,CAAA;AAC/C,MAAO,OAAA;AAAA,QACL,GAAG,CAAE,EAAA;AAAA,QACL,EAAA,CAAG,EAAG,CAAA,UAAA,EAAY,QAAQ,CAAA;AAAA,QAC1B,EAAA,CAAG,EAAE,IAAI,CAAA;AAAA,QACT,EAAA,CAAG,CAAE,CAAA,OAAA,CAAQ,KAAK,CAAA;AAAA,QAClB,EAAA,CAAG,EAAE,MAAM,CAAA;AAAA,QACX,EAAA,CAAG,EAAG,CAAA,KAAA,EAAO,GAAG,CAAA;AAAA,QAChB,EAAA,CAAG,EAAG,CAAA,OAAA,EAAS,KAAK,CAAA;AAAA,OACtB,CAAA;AAAA,KACD,CAAA,CAAA;AAGD,IAAM,MAAA,WAAA,GAAc,CAAC,KAAsB,KAAA;AACzC,MAAA,IAAA,CAAK,SAAS,KAAK,CAAA,CAAA;AAAA,KACrB,CAAA;AAEA,IAAM,MAAA,WAAA,GAAc,CAAC,KAAsB,KAAA;AACzC,MAAA,IAAA,CAAK,SAAS,KAAK,CAAA,CAAA;AAAA,KACrB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"tag.mjs","sources":["../../../../../../packages/components/tag/src/tag.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport { componentSizes } from '@element-plus/constants'\nimport type Tag from './tag.vue'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const tagProps = buildProps({\n closable: Boolean,\n type: {\n type: String,\n values: ['success', 'info', 'warning', 'danger', ''],\n default: '',\n },\n hit: Boolean,\n disableTransitions: Boolean,\n color: {\n type: String,\n default: '',\n },\n size: {\n type: String,\n values: componentSizes,\n default: '',\n },\n effect: {\n type: String,\n values: ['dark', 'light', 'plain'],\n default: 'light',\n },\n round: Boolean,\n} as const)\nexport type TagProps = ExtractPropTypes<typeof tagProps>\n\nexport const tagEmits = {\n close: (evt: MouseEvent) => evt instanceof MouseEvent,\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type TagEmits = typeof tagEmits\n\nexport type TagInstance = InstanceType<typeof Tag>\n"],"names":[],"mappings":";;;;;AAEY,MAAC,QAAQ,GAAG,UAAU,CAAC;AACnC,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;AACxD,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,GAAG,EAAE,OAAO;AACd,EAAE,kBAAkB,EAAE,OAAO;AAC7B,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,cAAc;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;AACtC,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,EAAE,KAAK,EAAE,OAAO;AAChB,CAAC,EAAE;AACS,MAAC,QAAQ,GAAG;AACxB,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;"}