code-monkey-ui 1.1.4-alpha.8 → 1.1.4-alpha.9

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 (555) hide show
  1. package/dist/index.full.js +1 -1
  2. package/dist/index.full.min.js +1 -1
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +1 -1
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +1 -1
  7. package/es/components/affix/index.mjs +2 -2
  8. package/es/components/affix/src/affix.mjs +117 -26
  9. package/es/components/affix/src/affix.mjs.map +1 -1
  10. package/es/components/affix/src/affix2.mjs +26 -117
  11. package/es/components/affix/src/affix2.mjs.map +1 -1
  12. package/es/components/autocomplete/index.mjs +2 -2
  13. package/es/components/autocomplete/src/autocomplete.mjs +361 -81
  14. package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
  15. package/es/components/autocomplete/src/autocomplete2.mjs +81 -361
  16. package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
  17. package/es/components/badge/index.mjs +2 -2
  18. package/es/components/badge/src/badge.mjs +55 -17
  19. package/es/components/badge/src/badge.mjs.map +1 -1
  20. package/es/components/badge/src/badge2.mjs +17 -55
  21. package/es/components/badge/src/badge2.mjs.map +1 -1
  22. package/es/components/batch/src/batch.mjs +1 -1
  23. package/es/components/batch/src/batch.mjs.map +1 -1
  24. package/es/components/button/index.mjs +1 -1
  25. package/es/components/button/src/button-group.mjs +6 -30
  26. package/es/components/button/src/button-group.mjs.map +1 -1
  27. package/es/components/button/src/button-group2.mjs +30 -6
  28. package/es/components/button/src/button-group2.mjs.map +1 -1
  29. package/es/components/calendar/index.mjs +2 -2
  30. package/es/components/calendar/src/calendar.mjs +131 -18
  31. package/es/components/calendar/src/calendar.mjs.map +1 -1
  32. package/es/components/calendar/src/calendar2.mjs +18 -131
  33. package/es/components/calendar/src/calendar2.mjs.map +1 -1
  34. package/es/components/card/index.mjs +2 -2
  35. package/es/components/card/src/card.mjs +17 -35
  36. package/es/components/card/src/card.mjs.map +1 -1
  37. package/es/components/card/src/card2.mjs +35 -17
  38. package/es/components/card/src/card2.mjs.map +1 -1
  39. package/es/components/carousel/index.mjs +4 -4
  40. package/es/components/carousel/src/carousel-item.mjs +69 -8
  41. package/es/components/carousel/src/carousel-item.mjs.map +1 -1
  42. package/es/components/carousel/src/carousel-item2.mjs +8 -69
  43. package/es/components/carousel/src/carousel-item2.mjs.map +1 -1
  44. package/es/components/carousel/src/carousel.mjs +169 -56
  45. package/es/components/carousel/src/carousel.mjs.map +1 -1
  46. package/es/components/carousel/src/carousel2.mjs +56 -169
  47. package/es/components/carousel/src/carousel2.mjs.map +1 -1
  48. package/es/components/cascader/src/cascader2.mjs +1 -1
  49. package/es/components/cascader-panel/src/index.mjs +1 -1
  50. package/es/components/cascader-panel/src/menu.mjs +1 -1
  51. package/es/components/cascader-panel/src/node.mjs +116 -209
  52. package/es/components/cascader-panel/src/node.mjs.map +1 -1
  53. package/es/components/cascader-panel/src/node2.mjs +209 -116
  54. package/es/components/cascader-panel/src/node2.mjs.map +1 -1
  55. package/es/components/cascader-panel/src/store.mjs +1 -1
  56. package/es/components/checkbox/index.mjs +4 -4
  57. package/es/components/checkbox/src/checkbox-button.mjs +1 -1
  58. package/es/components/checkbox/src/checkbox-group.mjs +28 -72
  59. package/es/components/checkbox/src/checkbox-group.mjs.map +1 -1
  60. package/es/components/checkbox/src/checkbox-group2.mjs +72 -28
  61. package/es/components/checkbox/src/checkbox-group2.mjs.map +1 -1
  62. package/es/components/checkbox/src/checkbox.mjs +50 -117
  63. package/es/components/checkbox/src/checkbox.mjs.map +1 -1
  64. package/es/components/checkbox/src/checkbox2.mjs +117 -50
  65. package/es/components/checkbox/src/checkbox2.mjs.map +1 -1
  66. package/es/components/collapse/index.mjs +2 -2
  67. package/es/components/collapse/src/collapse.mjs +28 -17
  68. package/es/components/collapse/src/collapse.mjs.map +1 -1
  69. package/es/components/collapse/src/collapse2.mjs +17 -28
  70. package/es/components/collapse/src/collapse2.mjs.map +1 -1
  71. package/es/components/collection/index.mjs +1 -1
  72. package/es/components/collection/src/collection.mjs +10 -62
  73. package/es/components/collection/src/collection.mjs.map +1 -1
  74. package/es/components/collection/src/collection2.mjs +62 -10
  75. package/es/components/collection/src/collection2.mjs.map +1 -1
  76. package/es/components/countdown/index.mjs +2 -2
  77. package/es/components/countdown/src/countdown.mjs +74 -23
  78. package/es/components/countdown/src/countdown.mjs.map +1 -1
  79. package/es/components/countdown/src/countdown2.mjs +23 -74
  80. package/es/components/countdown/src/countdown2.mjs.map +1 -1
  81. package/es/components/descriptions/src/description.mjs +1 -1
  82. package/es/components/descriptions/src/descriptions-row.mjs +64 -7
  83. package/es/components/descriptions/src/descriptions-row.mjs.map +1 -1
  84. package/es/components/descriptions/src/descriptions-row2.mjs +7 -64
  85. package/es/components/descriptions/src/descriptions-row2.mjs.map +1 -1
  86. package/es/components/dialog/index.mjs +2 -2
  87. package/es/components/dialog/src/dialog.mjs +65 -170
  88. package/es/components/dialog/src/dialog.mjs.map +1 -1
  89. package/es/components/dialog/src/dialog2.mjs +170 -65
  90. package/es/components/dialog/src/dialog2.mjs.map +1 -1
  91. package/es/components/drawer/index.mjs +2 -2
  92. package/es/components/drawer/src/drawer.mjs +26 -176
  93. package/es/components/drawer/src/drawer.mjs.map +1 -1
  94. package/es/components/drawer/src/drawer2.mjs +176 -26
  95. package/es/components/drawer/src/drawer2.mjs.map +1 -1
  96. package/es/components/dropdown/src/dropdown-item-impl.mjs +1 -1
  97. package/es/components/dropdown/src/dropdown.mjs +1 -1
  98. package/es/components/dsh-cascader/index.mjs +2 -2
  99. package/es/components/dsh-cascader/src/dsh-cascader.mjs +87 -728
  100. package/es/components/dsh-cascader/src/dsh-cascader.mjs.map +1 -1
  101. package/es/components/dsh-cascader/src/dsh-cascader2.mjs +728 -87
  102. package/es/components/dsh-cascader/src/dsh-cascader2.mjs.map +1 -1
  103. package/es/components/dsh-cascader-panel/src/index.mjs +1 -1
  104. package/es/components/dsh-cascader-panel/src/menu.mjs +1 -1
  105. package/es/components/dsh-cascader-panel/src/node.mjs +229 -115
  106. package/es/components/dsh-cascader-panel/src/node.mjs.map +1 -1
  107. package/es/components/dsh-cascader-panel/src/node2.mjs +115 -229
  108. package/es/components/dsh-cascader-panel/src/node2.mjs.map +1 -1
  109. package/es/components/dsh-cascader-panel/src/store.mjs +1 -1
  110. package/es/components/dsh-select/src/select.mjs +1 -1
  111. package/es/components/dshIndex.mjs +1 -1
  112. package/es/components/empty/index.mjs +2 -2
  113. package/es/components/empty/src/empty.mjs +55 -11
  114. package/es/components/empty/src/empty.mjs.map +1 -1
  115. package/es/components/empty/src/empty2.mjs +11 -55
  116. package/es/components/empty/src/empty2.mjs.map +1 -1
  117. package/es/components/icon/index.mjs +2 -2
  118. package/es/components/icon/src/icon.mjs +8 -36
  119. package/es/components/icon/src/icon.mjs.map +1 -1
  120. package/es/components/icon/src/icon2.mjs +36 -8
  121. package/es/components/icon/src/icon2.mjs.map +1 -1
  122. package/es/components/image/index.mjs +2 -2
  123. package/es/components/image/src/image.mjs +225 -61
  124. package/es/components/image/src/image.mjs.map +1 -1
  125. package/es/components/image/src/image2.mjs +61 -225
  126. package/es/components/image/src/image2.mjs.map +1 -1
  127. package/es/components/index.mjs +40 -40
  128. package/es/components/input/index.mjs +2 -2
  129. package/es/components/input/src/input.mjs +453 -109
  130. package/es/components/input/src/input.mjs.map +1 -1
  131. package/es/components/input/src/input2.mjs +109 -453
  132. package/es/components/input/src/input2.mjs.map +1 -1
  133. package/es/components/menu/index.mjs +2 -2
  134. package/es/components/menu/src/menu-item-group.mjs +35 -4
  135. package/es/components/menu/src/menu-item-group.mjs.map +1 -1
  136. package/es/components/menu/src/menu-item-group2.mjs +4 -35
  137. package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
  138. package/es/components/message/index.mjs +1 -1
  139. package/es/components/message/src/message.mjs +148 -86
  140. package/es/components/message/src/message.mjs.map +1 -1
  141. package/es/components/message/src/message2.mjs +86 -148
  142. package/es/components/message/src/message2.mjs.map +1 -1
  143. package/es/components/message/src/method.mjs +2 -2
  144. package/es/components/page-header/index.mjs +2 -2
  145. package/es/components/page-header/src/page-header.mjs +17 -103
  146. package/es/components/page-header/src/page-header.mjs.map +1 -1
  147. package/es/components/page-header/src/page-header2.mjs +103 -17
  148. package/es/components/page-header/src/page-header2.mjs.map +1 -1
  149. package/es/components/pagination/src/components/next.mjs +19 -38
  150. package/es/components/pagination/src/components/next.mjs.map +1 -1
  151. package/es/components/pagination/src/components/next2.mjs +38 -19
  152. package/es/components/pagination/src/components/next2.mjs.map +1 -1
  153. package/es/components/pagination/src/components/pager.mjs +216 -17
  154. package/es/components/pagination/src/components/pager.mjs.map +1 -1
  155. package/es/components/pagination/src/components/pager2.mjs +17 -216
  156. package/es/components/pagination/src/components/pager2.mjs.map +1 -1
  157. package/es/components/pagination/src/components/prev.mjs +18 -38
  158. package/es/components/pagination/src/components/prev.mjs.map +1 -1
  159. package/es/components/pagination/src/components/prev2.mjs +38 -18
  160. package/es/components/pagination/src/components/prev2.mjs.map +1 -1
  161. package/es/components/pagination/src/components/sizes.mjs +23 -69
  162. package/es/components/pagination/src/components/sizes.mjs.map +1 -1
  163. package/es/components/pagination/src/components/sizes2.mjs +69 -23
  164. package/es/components/pagination/src/components/sizes2.mjs.map +1 -1
  165. package/es/components/pagination/src/pagination.mjs +4 -4
  166. package/es/components/popover/index.mjs +2 -2
  167. package/es/components/popover/src/popover.mjs +111 -66
  168. package/es/components/popover/src/popover.mjs.map +1 -1
  169. package/es/components/popover/src/popover2.mjs +66 -111
  170. package/es/components/popover/src/popover2.mjs.map +1 -1
  171. package/es/components/popper/index.mjs +4 -4
  172. package/es/components/popper/src/content.mjs +137 -94
  173. package/es/components/popper/src/content.mjs.map +1 -1
  174. package/es/components/popper/src/content2.mjs +94 -137
  175. package/es/components/popper/src/content2.mjs.map +1 -1
  176. package/es/components/popper/src/popper.mjs +25 -32
  177. package/es/components/popper/src/popper.mjs.map +1 -1
  178. package/es/components/popper/src/popper2.mjs +32 -25
  179. package/es/components/popper/src/popper2.mjs.map +1 -1
  180. package/es/components/progress/index.mjs +2 -2
  181. package/es/components/progress/src/progress.mjs +59 -205
  182. package/es/components/progress/src/progress.mjs.map +1 -1
  183. package/es/components/progress/src/progress2.mjs +205 -59
  184. package/es/components/progress/src/progress2.mjs.map +1 -1
  185. package/es/components/radio/index.mjs +4 -4
  186. package/es/components/radio/src/radio-button.mjs +9 -66
  187. package/es/components/radio/src/radio-button.mjs.map +1 -1
  188. package/es/components/radio/src/radio-button2.mjs +66 -9
  189. package/es/components/radio/src/radio-button2.mjs.map +1 -1
  190. package/es/components/radio/src/radio-group.mjs +1 -1
  191. package/es/components/radio/src/radio.mjs +30 -73
  192. package/es/components/radio/src/radio.mjs.map +1 -1
  193. package/es/components/radio/src/radio2.mjs +73 -30
  194. package/es/components/radio/src/radio2.mjs.map +1 -1
  195. package/es/components/rate/index.mjs +2 -2
  196. package/es/components/rate/src/rate.mjs +87 -260
  197. package/es/components/rate/src/rate.mjs.map +1 -1
  198. package/es/components/rate/src/rate2.mjs +260 -87
  199. package/es/components/rate/src/rate2.mjs.map +1 -1
  200. package/es/components/result/index.mjs +2 -2
  201. package/es/components/result/src/result.mjs +63 -29
  202. package/es/components/result/src/result.mjs.map +1 -1
  203. package/es/components/result/src/result2.mjs +29 -63
  204. package/es/components/result/src/result2.mjs.map +1 -1
  205. package/es/components/roving-focus-group/src/roving-focus-group.mjs +1 -1
  206. package/es/components/scrollbar/index.mjs +3 -3
  207. package/es/components/scrollbar/src/bar2.mjs +1 -1
  208. package/es/components/scrollbar/src/scrollbar.mjs +178 -53
  209. package/es/components/scrollbar/src/scrollbar.mjs.map +1 -1
  210. package/es/components/scrollbar/src/scrollbar2.mjs +53 -178
  211. package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
  212. package/es/components/scrollbar/src/thumb.mjs +11 -130
  213. package/es/components/scrollbar/src/thumb.mjs.map +1 -1
  214. package/es/components/scrollbar/src/thumb2.mjs +130 -11
  215. package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
  216. package/es/components/select/src/select.mjs +1 -1
  217. package/es/components/skeleton/index.mjs +4 -4
  218. package/es/components/skeleton/src/skeleton-item.mjs +18 -23
  219. package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
  220. package/es/components/skeleton/src/skeleton-item2.mjs +23 -18
  221. package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
  222. package/es/components/skeleton/src/skeleton.mjs +49 -22
  223. package/es/components/skeleton/src/skeleton.mjs.map +1 -1
  224. package/es/components/skeleton/src/skeleton2.mjs +22 -49
  225. package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
  226. package/es/components/statistic/index.mjs +2 -2
  227. package/es/components/statistic/src/statistic.mjs +70 -25
  228. package/es/components/statistic/src/statistic.mjs.map +1 -1
  229. package/es/components/statistic/src/statistic2.mjs +25 -70
  230. package/es/components/statistic/src/statistic2.mjs.map +1 -1
  231. package/es/components/steps/index.mjs +2 -2
  232. package/es/components/steps/src/item.mjs +191 -19
  233. package/es/components/steps/src/item.mjs.map +1 -1
  234. package/es/components/steps/src/item2.mjs +19 -191
  235. package/es/components/steps/src/item2.mjs.map +1 -1
  236. package/es/components/switch/index.mjs +2 -2
  237. package/es/components/switch/src/switch.mjs +98 -264
  238. package/es/components/switch/src/switch.mjs.map +1 -1
  239. package/es/components/switch/src/switch2.mjs +264 -98
  240. package/es/components/switch/src/switch2.mjs.map +1 -1
  241. package/es/components/tabs/index.mjs +1 -1
  242. package/es/components/tabs/src/tab-bar.mjs +75 -7
  243. package/es/components/tabs/src/tab-bar.mjs.map +1 -1
  244. package/es/components/tabs/src/tab-bar2.mjs +7 -75
  245. package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
  246. package/es/components/tabs/src/tab-nav.mjs +1 -1
  247. package/es/components/tag/index.mjs +2 -2
  248. package/es/components/tag/src/tag.mjs +33 -94
  249. package/es/components/tag/src/tag.mjs.map +1 -1
  250. package/es/components/tag/src/tag2.mjs +94 -33
  251. package/es/components/tag/src/tag2.mjs.map +1 -1
  252. package/es/components/tooltip/index.mjs +2 -2
  253. package/es/components/tooltip/src/content.mjs +1 -1
  254. package/es/components/tooltip/src/content2.mjs +1 -1
  255. package/es/components/tooltip/src/tooltip.mjs +31 -170
  256. package/es/components/tooltip/src/tooltip.mjs.map +1 -1
  257. package/es/components/tooltip/src/tooltip2.mjs +170 -31
  258. package/es/components/tooltip/src/tooltip2.mjs.map +1 -1
  259. package/es/components/tooltip-v2/index.mjs +3 -3
  260. package/es/components/tooltip-v2/src/arrow.mjs +37 -22
  261. package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
  262. package/es/components/tooltip-v2/src/arrow2.mjs +22 -37
  263. package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
  264. package/es/components/tooltip-v2/src/tooltip.mjs +20 -73
  265. package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
  266. package/es/components/tooltip-v2/src/tooltip2.mjs +73 -20
  267. package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
  268. package/es/components/transfer/src/composables/use-check.mjs +1 -1
  269. package/es/components/transfer/src/transfer-panel.mjs +128 -19
  270. package/es/components/transfer/src/transfer-panel.mjs.map +1 -1
  271. package/es/components/transfer/src/transfer-panel2.mjs +19 -128
  272. package/es/components/transfer/src/transfer-panel2.mjs.map +1 -1
  273. package/es/components/transfer/src/transfer2.mjs +1 -1
  274. package/es/components/upload/index.mjs +1 -1
  275. package/es/components/upload/src/upload-list.mjs +177 -26
  276. package/es/components/upload/src/upload-list.mjs.map +1 -1
  277. package/es/components/upload/src/upload-list2.mjs +26 -177
  278. package/es/components/upload/src/upload-list2.mjs.map +1 -1
  279. package/es/components/upload/src/upload.mjs +1 -1
  280. package/es/index.mjs +41 -41
  281. package/lib/components/affix/index.js +2 -2
  282. package/lib/components/affix/src/affix.js +117 -27
  283. package/lib/components/affix/src/affix.js.map +1 -1
  284. package/lib/components/affix/src/affix2.js +27 -117
  285. package/lib/components/affix/src/affix2.js.map +1 -1
  286. package/lib/components/autocomplete/index.js +2 -2
  287. package/lib/components/autocomplete/src/autocomplete.js +360 -81
  288. package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
  289. package/lib/components/autocomplete/src/autocomplete2.js +81 -360
  290. package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
  291. package/lib/components/badge/index.js +2 -2
  292. package/lib/components/badge/src/badge.js +55 -17
  293. package/lib/components/badge/src/badge.js.map +1 -1
  294. package/lib/components/badge/src/badge2.js +17 -55
  295. package/lib/components/badge/src/badge2.js.map +1 -1
  296. package/lib/components/batch/src/batch.js +1 -1
  297. package/lib/components/batch/src/batch.js.map +1 -1
  298. package/lib/components/button/index.js +1 -1
  299. package/lib/components/button/src/button-group.js +6 -30
  300. package/lib/components/button/src/button-group.js.map +1 -1
  301. package/lib/components/button/src/button-group2.js +30 -6
  302. package/lib/components/button/src/button-group2.js.map +1 -1
  303. package/lib/components/calendar/index.js +2 -2
  304. package/lib/components/calendar/src/calendar.js +131 -19
  305. package/lib/components/calendar/src/calendar.js.map +1 -1
  306. package/lib/components/calendar/src/calendar2.js +19 -131
  307. package/lib/components/calendar/src/calendar2.js.map +1 -1
  308. package/lib/components/card/index.js +2 -2
  309. package/lib/components/card/src/card.js +17 -35
  310. package/lib/components/card/src/card.js.map +1 -1
  311. package/lib/components/card/src/card2.js +35 -17
  312. package/lib/components/card/src/card2.js.map +1 -1
  313. package/lib/components/carousel/index.js +4 -4
  314. package/lib/components/carousel/src/carousel-item.js +69 -8
  315. package/lib/components/carousel/src/carousel-item.js.map +1 -1
  316. package/lib/components/carousel/src/carousel-item2.js +8 -69
  317. package/lib/components/carousel/src/carousel-item2.js.map +1 -1
  318. package/lib/components/carousel/src/carousel.js +169 -57
  319. package/lib/components/carousel/src/carousel.js.map +1 -1
  320. package/lib/components/carousel/src/carousel2.js +57 -169
  321. package/lib/components/carousel/src/carousel2.js.map +1 -1
  322. package/lib/components/cascader/src/cascader2.js +1 -1
  323. package/lib/components/cascader-panel/src/index.js +1 -1
  324. package/lib/components/cascader-panel/src/menu.js +1 -1
  325. package/lib/components/cascader-panel/src/node.js +116 -209
  326. package/lib/components/cascader-panel/src/node.js.map +1 -1
  327. package/lib/components/cascader-panel/src/node2.js +209 -116
  328. package/lib/components/cascader-panel/src/node2.js.map +1 -1
  329. package/lib/components/cascader-panel/src/store.js +1 -1
  330. package/lib/components/checkbox/index.js +4 -4
  331. package/lib/components/checkbox/src/checkbox-button.js +1 -1
  332. package/lib/components/checkbox/src/checkbox-group.js +29 -72
  333. package/lib/components/checkbox/src/checkbox-group.js.map +1 -1
  334. package/lib/components/checkbox/src/checkbox-group2.js +72 -29
  335. package/lib/components/checkbox/src/checkbox-group2.js.map +1 -1
  336. package/lib/components/checkbox/src/checkbox.js +51 -117
  337. package/lib/components/checkbox/src/checkbox.js.map +1 -1
  338. package/lib/components/checkbox/src/checkbox2.js +117 -51
  339. package/lib/components/checkbox/src/checkbox2.js.map +1 -1
  340. package/lib/components/collapse/index.js +2 -2
  341. package/lib/components/collapse/src/collapse.js +28 -19
  342. package/lib/components/collapse/src/collapse.js.map +1 -1
  343. package/lib/components/collapse/src/collapse2.js +19 -28
  344. package/lib/components/collapse/src/collapse2.js.map +1 -1
  345. package/lib/components/collection/index.js +1 -1
  346. package/lib/components/collection/src/collection.js +9 -62
  347. package/lib/components/collection/src/collection.js.map +1 -1
  348. package/lib/components/collection/src/collection2.js +62 -9
  349. package/lib/components/collection/src/collection2.js.map +1 -1
  350. package/lib/components/countdown/index.js +2 -2
  351. package/lib/components/countdown/src/countdown.js +74 -24
  352. package/lib/components/countdown/src/countdown.js.map +1 -1
  353. package/lib/components/countdown/src/countdown2.js +24 -74
  354. package/lib/components/countdown/src/countdown2.js.map +1 -1
  355. package/lib/components/descriptions/src/description.js +1 -1
  356. package/lib/components/descriptions/src/descriptions-row.js +64 -7
  357. package/lib/components/descriptions/src/descriptions-row.js.map +1 -1
  358. package/lib/components/descriptions/src/descriptions-row2.js +7 -64
  359. package/lib/components/descriptions/src/descriptions-row2.js.map +1 -1
  360. package/lib/components/dialog/index.js +2 -2
  361. package/lib/components/dialog/src/dialog.js +66 -170
  362. package/lib/components/dialog/src/dialog.js.map +1 -1
  363. package/lib/components/dialog/src/dialog2.js +170 -66
  364. package/lib/components/dialog/src/dialog2.js.map +1 -1
  365. package/lib/components/drawer/index.js +2 -2
  366. package/lib/components/drawer/src/drawer.js +27 -176
  367. package/lib/components/drawer/src/drawer.js.map +1 -1
  368. package/lib/components/drawer/src/drawer2.js +176 -27
  369. package/lib/components/drawer/src/drawer2.js.map +1 -1
  370. package/lib/components/dropdown/src/dropdown-item-impl.js +1 -1
  371. package/lib/components/dropdown/src/dropdown.js +1 -1
  372. package/lib/components/dsh-cascader/index.js +2 -2
  373. package/lib/components/dsh-cascader/src/dsh-cascader.js +88 -728
  374. package/lib/components/dsh-cascader/src/dsh-cascader.js.map +1 -1
  375. package/lib/components/dsh-cascader/src/dsh-cascader2.js +728 -88
  376. package/lib/components/dsh-cascader/src/dsh-cascader2.js.map +1 -1
  377. package/lib/components/dsh-cascader-panel/src/index.js +1 -1
  378. package/lib/components/dsh-cascader-panel/src/menu.js +1 -1
  379. package/lib/components/dsh-cascader-panel/src/node.js +229 -115
  380. package/lib/components/dsh-cascader-panel/src/node.js.map +1 -1
  381. package/lib/components/dsh-cascader-panel/src/node2.js +115 -229
  382. package/lib/components/dsh-cascader-panel/src/node2.js.map +1 -1
  383. package/lib/components/dsh-cascader-panel/src/store.js +1 -1
  384. package/lib/components/dsh-select/src/select.js +1 -1
  385. package/lib/components/dshIndex.js +1 -1
  386. package/lib/components/empty/index.js +2 -2
  387. package/lib/components/empty/src/empty.js +55 -11
  388. package/lib/components/empty/src/empty.js.map +1 -1
  389. package/lib/components/empty/src/empty2.js +11 -55
  390. package/lib/components/empty/src/empty2.js.map +1 -1
  391. package/lib/components/icon/index.js +2 -2
  392. package/lib/components/icon/src/icon.js +8 -36
  393. package/lib/components/icon/src/icon.js.map +1 -1
  394. package/lib/components/icon/src/icon2.js +36 -8
  395. package/lib/components/icon/src/icon2.js.map +1 -1
  396. package/lib/components/image/index.js +2 -2
  397. package/lib/components/image/src/image.js +224 -61
  398. package/lib/components/image/src/image.js.map +1 -1
  399. package/lib/components/image/src/image2.js +61 -224
  400. package/lib/components/image/src/image2.js.map +1 -1
  401. package/lib/components/index.js +40 -40
  402. package/lib/components/input/index.js +2 -2
  403. package/lib/components/input/src/input.js +452 -109
  404. package/lib/components/input/src/input.js.map +1 -1
  405. package/lib/components/input/src/input2.js +109 -452
  406. package/lib/components/input/src/input2.js.map +1 -1
  407. package/lib/components/menu/index.js +2 -2
  408. package/lib/components/menu/src/menu-item-group.js +35 -4
  409. package/lib/components/menu/src/menu-item-group.js.map +1 -1
  410. package/lib/components/menu/src/menu-item-group2.js +4 -35
  411. package/lib/components/menu/src/menu-item-group2.js.map +1 -1
  412. package/lib/components/message/index.js +1 -1
  413. package/lib/components/message/src/message.js +147 -88
  414. package/lib/components/message/src/message.js.map +1 -1
  415. package/lib/components/message/src/message2.js +88 -147
  416. package/lib/components/message/src/message2.js.map +1 -1
  417. package/lib/components/message/src/method.js +2 -2
  418. package/lib/components/page-header/index.js +2 -2
  419. package/lib/components/page-header/src/page-header.js +18 -103
  420. package/lib/components/page-header/src/page-header.js.map +1 -1
  421. package/lib/components/page-header/src/page-header2.js +103 -18
  422. package/lib/components/page-header/src/page-header2.js.map +1 -1
  423. package/lib/components/pagination/src/components/next.js +19 -38
  424. package/lib/components/pagination/src/components/next.js.map +1 -1
  425. package/lib/components/pagination/src/components/next2.js +38 -19
  426. package/lib/components/pagination/src/components/next2.js.map +1 -1
  427. package/lib/components/pagination/src/components/pager.js +216 -17
  428. package/lib/components/pagination/src/components/pager.js.map +1 -1
  429. package/lib/components/pagination/src/components/pager2.js +17 -216
  430. package/lib/components/pagination/src/components/pager2.js.map +1 -1
  431. package/lib/components/pagination/src/components/prev.js +19 -38
  432. package/lib/components/pagination/src/components/prev.js.map +1 -1
  433. package/lib/components/pagination/src/components/prev2.js +38 -19
  434. package/lib/components/pagination/src/components/prev2.js.map +1 -1
  435. package/lib/components/pagination/src/components/sizes.js +23 -69
  436. package/lib/components/pagination/src/components/sizes.js.map +1 -1
  437. package/lib/components/pagination/src/components/sizes2.js +69 -23
  438. package/lib/components/pagination/src/components/sizes2.js.map +1 -1
  439. package/lib/components/pagination/src/pagination.js +4 -4
  440. package/lib/components/popover/index.js +2 -2
  441. package/lib/components/popover/src/popover.js +111 -67
  442. package/lib/components/popover/src/popover.js.map +1 -1
  443. package/lib/components/popover/src/popover2.js +67 -111
  444. package/lib/components/popover/src/popover2.js.map +1 -1
  445. package/lib/components/popper/index.js +4 -4
  446. package/lib/components/popper/src/content.js +137 -99
  447. package/lib/components/popper/src/content.js.map +1 -1
  448. package/lib/components/popper/src/content2.js +99 -137
  449. package/lib/components/popper/src/content2.js.map +1 -1
  450. package/lib/components/popper/src/popper.js +28 -32
  451. package/lib/components/popper/src/popper.js.map +1 -1
  452. package/lib/components/popper/src/popper2.js +32 -28
  453. package/lib/components/popper/src/popper2.js.map +1 -1
  454. package/lib/components/progress/index.js +2 -2
  455. package/lib/components/progress/src/progress.js +59 -205
  456. package/lib/components/progress/src/progress.js.map +1 -1
  457. package/lib/components/progress/src/progress2.js +205 -59
  458. package/lib/components/progress/src/progress2.js.map +1 -1
  459. package/lib/components/radio/index.js +4 -4
  460. package/lib/components/radio/src/radio-button.js +9 -66
  461. package/lib/components/radio/src/radio-button.js.map +1 -1
  462. package/lib/components/radio/src/radio-button2.js +66 -9
  463. package/lib/components/radio/src/radio-button2.js.map +1 -1
  464. package/lib/components/radio/src/radio-group.js +1 -1
  465. package/lib/components/radio/src/radio.js +32 -73
  466. package/lib/components/radio/src/radio.js.map +1 -1
  467. package/lib/components/radio/src/radio2.js +73 -32
  468. package/lib/components/radio/src/radio2.js.map +1 -1
  469. package/lib/components/rate/index.js +2 -2
  470. package/lib/components/rate/src/rate.js +87 -259
  471. package/lib/components/rate/src/rate.js.map +1 -1
  472. package/lib/components/rate/src/rate2.js +259 -87
  473. package/lib/components/rate/src/rate2.js.map +1 -1
  474. package/lib/components/result/index.js +2 -2
  475. package/lib/components/result/src/result.js +63 -31
  476. package/lib/components/result/src/result.js.map +1 -1
  477. package/lib/components/result/src/result2.js +31 -63
  478. package/lib/components/result/src/result2.js.map +1 -1
  479. package/lib/components/roving-focus-group/src/roving-focus-group.js +1 -1
  480. package/lib/components/scrollbar/index.js +3 -3
  481. package/lib/components/scrollbar/src/bar2.js +1 -1
  482. package/lib/components/scrollbar/src/scrollbar.js +178 -54
  483. package/lib/components/scrollbar/src/scrollbar.js.map +1 -1
  484. package/lib/components/scrollbar/src/scrollbar2.js +54 -178
  485. package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
  486. package/lib/components/scrollbar/src/thumb.js +11 -130
  487. package/lib/components/scrollbar/src/thumb.js.map +1 -1
  488. package/lib/components/scrollbar/src/thumb2.js +130 -11
  489. package/lib/components/scrollbar/src/thumb2.js.map +1 -1
  490. package/lib/components/select/src/select.js +1 -1
  491. package/lib/components/skeleton/index.js +4 -4
  492. package/lib/components/skeleton/src/skeleton-item.js +18 -23
  493. package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
  494. package/lib/components/skeleton/src/skeleton-item2.js +23 -18
  495. package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
  496. package/lib/components/skeleton/src/skeleton.js +49 -22
  497. package/lib/components/skeleton/src/skeleton.js.map +1 -1
  498. package/lib/components/skeleton/src/skeleton2.js +22 -49
  499. package/lib/components/skeleton/src/skeleton2.js.map +1 -1
  500. package/lib/components/statistic/index.js +2 -2
  501. package/lib/components/statistic/src/statistic.js +70 -25
  502. package/lib/components/statistic/src/statistic.js.map +1 -1
  503. package/lib/components/statistic/src/statistic2.js +25 -70
  504. package/lib/components/statistic/src/statistic2.js.map +1 -1
  505. package/lib/components/steps/index.js +2 -2
  506. package/lib/components/steps/src/item.js +191 -19
  507. package/lib/components/steps/src/item.js.map +1 -1
  508. package/lib/components/steps/src/item2.js +19 -191
  509. package/lib/components/steps/src/item2.js.map +1 -1
  510. package/lib/components/switch/index.js +2 -2
  511. package/lib/components/switch/src/switch.js +98 -263
  512. package/lib/components/switch/src/switch.js.map +1 -1
  513. package/lib/components/switch/src/switch2.js +263 -98
  514. package/lib/components/switch/src/switch2.js.map +1 -1
  515. package/lib/components/tabs/index.js +1 -1
  516. package/lib/components/tabs/src/tab-bar.js +75 -7
  517. package/lib/components/tabs/src/tab-bar.js.map +1 -1
  518. package/lib/components/tabs/src/tab-bar2.js +7 -75
  519. package/lib/components/tabs/src/tab-bar2.js.map +1 -1
  520. package/lib/components/tabs/src/tab-nav.js +1 -1
  521. package/lib/components/tag/index.js +2 -2
  522. package/lib/components/tag/src/tag.js +34 -94
  523. package/lib/components/tag/src/tag.js.map +1 -1
  524. package/lib/components/tag/src/tag2.js +94 -34
  525. package/lib/components/tag/src/tag2.js.map +1 -1
  526. package/lib/components/tooltip/index.js +2 -2
  527. package/lib/components/tooltip/src/content.js +1 -1
  528. package/lib/components/tooltip/src/content2.js +1 -1
  529. package/lib/components/tooltip/src/tooltip.js +35 -170
  530. package/lib/components/tooltip/src/tooltip.js.map +1 -1
  531. package/lib/components/tooltip/src/tooltip2.js +170 -35
  532. package/lib/components/tooltip/src/tooltip2.js.map +1 -1
  533. package/lib/components/tooltip-v2/index.js +3 -3
  534. package/lib/components/tooltip-v2/src/arrow.js +37 -23
  535. package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
  536. package/lib/components/tooltip-v2/src/arrow2.js +23 -37
  537. package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
  538. package/lib/components/tooltip-v2/src/tooltip.js +20 -73
  539. package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
  540. package/lib/components/tooltip-v2/src/tooltip2.js +73 -20
  541. package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
  542. package/lib/components/transfer/src/composables/use-check.js +1 -1
  543. package/lib/components/transfer/src/transfer-panel.js +128 -21
  544. package/lib/components/transfer/src/transfer-panel.js.map +1 -1
  545. package/lib/components/transfer/src/transfer-panel2.js +21 -128
  546. package/lib/components/transfer/src/transfer-panel2.js.map +1 -1
  547. package/lib/components/transfer/src/transfer2.js +1 -1
  548. package/lib/components/upload/index.js +1 -1
  549. package/lib/components/upload/src/upload-list.js +177 -27
  550. package/lib/components/upload/src/upload-list.js.map +1 -1
  551. package/lib/components/upload/src/upload-list2.js +27 -177
  552. package/lib/components/upload/src/upload-list2.js.map +1 -1
  553. package/lib/components/upload/src/upload.js +1 -1
  554. package/lib/index.js +41 -41
  555. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"switch.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 :aria-label=\"label\"\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=\"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 watch,\n} from 'vue'\nimport { isPromise } from '@vue/shared'\nimport { Loading } from '@element-plus/icons-vue'\nimport {\n addUnit,\n debugWarn,\n isBoolean,\n throwError,\n} from '@code-monkey-ui/utils'\nimport ElIcon from '@code-monkey-ui/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@code-monkey-ui/components/form'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@code-monkey-ui/constants'\nimport { useDeprecated, useNamespace } from '@code-monkey-ui/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 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 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) 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":";;;;;;;;;;;;;;;;;;;;;;;;;mCAuGc,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,CAA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AAA,KAAA,CAAA,WAAA,EAAA,GAAA,IAAA;AAED,QAAA,sBAA0B,GAAA,EAAA,WAAA,EAAA,KAAA,CAAA,aAAA,EAAA,GAAA,IAAA;AACxB,QAAA,GAAA,iBAAqB,GAAA,EAAA,cAAA,EAAA,KAAA,CAAA,WAAA,EAAA,GAAA,IAAA;AAAA,OACvB,CAAA,CAAA;AAEA,KAAA,CAAA,CAAA;AACE,IAAM,MAAA,KAAA,GAAO;AAAkB,MAChC,IAAA,EAAA,EAAA,EAAA,CAAA;AAED,MAAa,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,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
+ {"version":3,"file":"switch.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 '@code-monkey-ui/utils'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@code-monkey-ui/constants'\nimport type { ComponentSize } from '@code-monkey-ui/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 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 /**\n * @description native input aria-label\n */\n label: {\n type: String,\n default: undefined,\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":";;;;;;;;;AAcY,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,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,SAAS,EAAE,oBAAoB;AACnC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,OAAO;AACjB,IA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E;AAChB,IAAI,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AAClC,GAAG;AACH,EAAE,EAAE,EAAE,MAAM;AACZ,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;AACnC,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,WAAW,GAAG;AAC3B,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AACjF,EAAE,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AAC3E,EAAE,CAAC,WAAW,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AAC1E;;;;"}
@@ -1,106 +1,272 @@
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';
3
+ import { Loading } from '@element-plus/icons-vue';
1
4
  import '../../../utils/index.mjs';
5
+ import { ElIcon } from '../../icon/index.mjs';
6
+ import '../../form/index.mjs';
2
7
  import '../../../constants/index.mjs';
3
- import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
4
- import { isValidComponentSize } from '../../../utils/vue/validator.mjs';
5
- import { iconPropType } from '../../../utils/vue/icon.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
- disabled: {
16
- type: Boolean,
17
- default: false
18
- },
19
- loading: {
20
- type: Boolean,
21
- default: false
22
- },
23
- size: {
24
- type: String,
25
- validator: isValidComponentSize
26
- },
27
- width: {
28
- type: [String, Number],
29
- default: ""
30
- },
31
- inlinePrompt: {
32
- type: Boolean,
33
- default: false
34
- },
35
- inactiveActionIcon: {
36
- type: iconPropType
37
- },
38
- activeActionIcon: {
39
- type: iconPropType
40
- },
41
- activeIcon: {
42
- type: iconPropType
43
- },
44
- inactiveIcon: {
45
- type: iconPropType
46
- },
47
- activeText: {
48
- type: String,
49
- default: ""
50
- },
51
- inactiveText: {
52
- type: String,
53
- default: ""
54
- },
55
- activeValue: {
56
- type: [Boolean, String, Number],
57
- default: true
58
- },
59
- inactiveValue: {
60
- type: [Boolean, String, Number],
61
- default: false
62
- },
63
- activeColor: {
64
- type: String,
65
- default: ""
66
- },
67
- inactiveColor: {
68
- type: String,
69
- default: ""
70
- },
71
- borderColor: {
72
- type: String,
73
- default: ""
74
- },
75
- name: {
76
- type: String,
77
- default: ""
78
- },
79
- validateEvent: {
80
- type: Boolean,
81
- default: true
82
- },
83
- beforeChange: {
84
- type: definePropType(Function)
85
- },
86
- id: String,
87
- tabindex: {
88
- type: [String, Number]
89
- },
90
- value: {
91
- type: [Boolean, String, Number],
92
- default: false
93
- },
94
- label: {
95
- type: String,
96
- default: void 0
20
+ const _hoisted_1 = ["onClick"];
21
+ const _hoisted_2 = ["id", "aria-checked", "aria-disabled", "aria-label", "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
+ const useBatchDeprecated = (list) => {
40
+ list.forEach((param) => {
41
+ useDeprecated({
42
+ from: param[0],
43
+ replacement: param[1],
44
+ scope: COMPONENT_NAME,
45
+ version: "2.3.0",
46
+ ref: "https://element-plus.org/en-US/component/switch.html#attributes",
47
+ type: "Attribute"
48
+ }, computed(() => {
49
+ var _a;
50
+ return !!((_a = vm.vnode.props) == null ? void 0 : _a[param[2]]);
51
+ }));
52
+ });
53
+ };
54
+ useBatchDeprecated([
55
+ ['"value"', '"model-value" or "v-model"', "value"],
56
+ ['"active-color"', "CSS var `--el-switch-on-color`", "activeColor"],
57
+ ['"inactive-color"', "CSS var `--el-switch-off-color`", "inactiveColor"],
58
+ ['"border-color"', "CSS var `--el-switch-border-color`", "borderColor"]
59
+ ]);
60
+ const { inputId } = useFormItemInputId(props, {
61
+ formItemContext: formItem
62
+ });
63
+ const switchDisabled = useFormDisabled(computed(() => props.loading));
64
+ const isControlled = ref(props.modelValue !== false);
65
+ const input = ref();
66
+ const core = ref();
67
+ const switchKls = computed(() => [
68
+ ns.b(),
69
+ ns.m(switchSize.value),
70
+ ns.is("disabled", switchDisabled.value),
71
+ ns.is("checked", checked.value)
72
+ ]);
73
+ const labelLeftKls = computed(() => [
74
+ ns.e("label"),
75
+ ns.em("label", "left"),
76
+ ns.is("active", !checked.value)
77
+ ]);
78
+ const labelRightKls = computed(() => [
79
+ ns.e("label"),
80
+ ns.em("label", "right"),
81
+ ns.is("active", checked.value)
82
+ ]);
83
+ const coreStyle = computed(() => ({
84
+ width: addUnit(props.width)
85
+ }));
86
+ watch(() => props.modelValue, () => {
87
+ isControlled.value = true;
88
+ });
89
+ watch(() => props.value, () => {
90
+ isControlled.value = false;
91
+ });
92
+ const actualValue = computed(() => {
93
+ return isControlled.value ? props.modelValue : props.value;
94
+ });
95
+ const checked = computed(() => actualValue.value === props.activeValue);
96
+ if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {
97
+ emit(UPDATE_MODEL_EVENT, props.inactiveValue);
98
+ emit(CHANGE_EVENT, props.inactiveValue);
99
+ emit(INPUT_EVENT, props.inactiveValue);
100
+ }
101
+ watch(checked, (val) => {
102
+ var _a;
103
+ input.value.checked = val;
104
+ if (props.validateEvent) {
105
+ (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn(err));
106
+ }
107
+ });
108
+ const handleChange = () => {
109
+ const val = checked.value ? props.inactiveValue : props.activeValue;
110
+ emit(UPDATE_MODEL_EVENT, val);
111
+ emit(CHANGE_EVENT, val);
112
+ emit(INPUT_EVENT, val);
113
+ nextTick(() => {
114
+ input.value.checked = checked.value;
115
+ });
116
+ };
117
+ const switchValue = () => {
118
+ if (switchDisabled.value)
119
+ return;
120
+ const { beforeChange } = props;
121
+ if (!beforeChange) {
122
+ handleChange();
123
+ return;
124
+ }
125
+ const shouldChange = beforeChange();
126
+ const isPromiseOrBool = [
127
+ isPromise(shouldChange),
128
+ isBoolean(shouldChange)
129
+ ].includes(true);
130
+ if (!isPromiseOrBool) {
131
+ throwError(COMPONENT_NAME, "beforeChange must return type `Promise<boolean>` or `boolean`");
132
+ }
133
+ if (isPromise(shouldChange)) {
134
+ shouldChange.then((result) => {
135
+ if (result) {
136
+ handleChange();
137
+ }
138
+ }).catch((e) => {
139
+ debugWarn(COMPONENT_NAME, `some error occurred: ${e}`);
140
+ });
141
+ } else if (shouldChange) {
142
+ handleChange();
143
+ }
144
+ };
145
+ const styles = computed(() => {
146
+ return ns.cssVarBlock({
147
+ ...props.activeColor ? { "on-color": props.activeColor } : null,
148
+ ...props.inactiveColor ? { "off-color": props.inactiveColor } : null,
149
+ ...props.borderColor ? { "border-color": props.borderColor } : null
150
+ });
151
+ });
152
+ const focus = () => {
153
+ var _a, _b;
154
+ (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
155
+ };
156
+ onMounted(() => {
157
+ input.value.checked = checked.value;
158
+ });
159
+ expose({
160
+ focus,
161
+ checked
162
+ });
163
+ return (_ctx, _cache) => {
164
+ return openBlock(), createElementBlock("div", {
165
+ class: normalizeClass(unref(switchKls)),
166
+ style: normalizeStyle(unref(styles)),
167
+ onClick: withModifiers(switchValue, ["prevent"])
168
+ }, [
169
+ createElementVNode("input", {
170
+ id: unref(inputId),
171
+ ref_key: "input",
172
+ ref: input,
173
+ class: normalizeClass(unref(ns).e("input")),
174
+ type: "checkbox",
175
+ role: "switch",
176
+ "aria-checked": unref(checked),
177
+ "aria-disabled": unref(switchDisabled),
178
+ "aria-label": _ctx.label,
179
+ name: _ctx.name,
180
+ "true-value": _ctx.activeValue,
181
+ "false-value": _ctx.inactiveValue,
182
+ disabled: unref(switchDisabled),
183
+ tabindex: _ctx.tabindex,
184
+ onChange: handleChange,
185
+ onKeydown: withKeys(switchValue, ["enter"])
186
+ }, null, 42, _hoisted_2),
187
+ !_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (openBlock(), createElementBlock("span", {
188
+ key: 0,
189
+ class: normalizeClass(unref(labelLeftKls))
190
+ }, [
191
+ _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
192
+ default: withCtx(() => [
193
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))
194
+ ]),
195
+ _: 1
196
+ })) : createCommentVNode("v-if", true),
197
+ !_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
198
+ key: 1,
199
+ "aria-hidden": unref(checked)
200
+ }, toDisplayString(_ctx.inactiveText), 9, _hoisted_3)) : createCommentVNode("v-if", true)
201
+ ], 2)) : createCommentVNode("v-if", true),
202
+ createElementVNode("span", {
203
+ ref_key: "core",
204
+ ref: core,
205
+ class: normalizeClass(unref(ns).e("core")),
206
+ style: normalizeStyle(unref(coreStyle))
207
+ }, [
208
+ _ctx.inlinePrompt ? (openBlock(), createElementBlock("div", {
209
+ key: 0,
210
+ class: normalizeClass(unref(ns).e("inner"))
211
+ }, [
212
+ _ctx.activeIcon || _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), {
213
+ key: 0,
214
+ class: normalizeClass(unref(ns).is("icon"))
215
+ }, {
216
+ default: withCtx(() => [
217
+ (openBlock(), createBlock(resolveDynamicComponent(unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))
218
+ ]),
219
+ _: 1
220
+ }, 8, ["class"])) : _ctx.activeText || _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
221
+ key: 1,
222
+ class: normalizeClass(unref(ns).is("text")),
223
+ "aria-hidden": !unref(checked)
224
+ }, toDisplayString(unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, _hoisted_4)) : createCommentVNode("v-if", true)
225
+ ], 2)) : createCommentVNode("v-if", true),
226
+ createElementVNode("div", {
227
+ class: normalizeClass(unref(ns).e("action"))
228
+ }, [
229
+ _ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {
230
+ key: 0,
231
+ class: normalizeClass(unref(ns).is("loading"))
232
+ }, {
233
+ default: withCtx(() => [
234
+ createVNode(unref(Loading))
235
+ ]),
236
+ _: 1
237
+ }, 8, ["class"])) : _ctx.activeActionIcon && unref(checked) ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
238
+ default: withCtx(() => [
239
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeActionIcon)))
240
+ ]),
241
+ _: 1
242
+ })) : _ctx.inactiveActionIcon && !unref(checked) ? (openBlock(), createBlock(unref(ElIcon), { key: 2 }, {
243
+ default: withCtx(() => [
244
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveActionIcon)))
245
+ ]),
246
+ _: 1
247
+ })) : createCommentVNode("v-if", true)
248
+ ], 2)
249
+ ], 6),
250
+ !_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (openBlock(), createElementBlock("span", {
251
+ key: 1,
252
+ class: normalizeClass(unref(labelRightKls))
253
+ }, [
254
+ _ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
255
+ default: withCtx(() => [
256
+ (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))
257
+ ]),
258
+ _: 1
259
+ })) : createCommentVNode("v-if", true),
260
+ !_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock("span", {
261
+ key: 1,
262
+ "aria-hidden": !unref(checked)
263
+ }, toDisplayString(_ctx.activeText), 9, _hoisted_5)) : createCommentVNode("v-if", true)
264
+ ], 2)) : createCommentVNode("v-if", true)
265
+ ], 14, _hoisted_1);
266
+ };
97
267
  }
98
268
  });
99
- const switchEmits = {
100
- [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
101
- [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
102
- [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
103
- };
269
+ var Switch = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:\\project\\work\\code-monkey-ui\\packages\\components\\switch\\src\\switch.vue"]]);
104
270
 
105
- export { switchEmits, switchProps };
271
+ export { Switch as default };
106
272
  //# 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 '@code-monkey-ui/utils'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@code-monkey-ui/constants'\nimport type { ComponentSize } from '@code-monkey-ui/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 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 /**\n * @description native input aria-label\n */\n label: {\n type: String,\n default: undefined,\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":";;;;;;;;;AAcY,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,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,SAAS,EAAE,oBAAoB;AACnC,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AAC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G,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AACjF,EAAE,CAAC,YAAY,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC;AAC3E,EAAE,CAAC,WAAW,GAAG,CAAC,GAAG,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 :aria-label=\"label\"\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=\"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 watch,\n} from 'vue'\nimport { isPromise } from '@vue/shared'\nimport { Loading } from '@element-plus/icons-vue'\nimport {\n addUnit,\n debugWarn,\n isBoolean,\n throwError,\n} from '@code-monkey-ui/utils'\nimport ElIcon from '@code-monkey-ui/components/icon'\nimport {\n useFormDisabled,\n useFormItem,\n useFormItemInputId,\n useFormSize,\n} from '@code-monkey-ui/components/form'\nimport {\n CHANGE_EVENT,\n INPUT_EVENT,\n UPDATE_MODEL_EVENT,\n} from '@code-monkey-ui/constants'\nimport { useDeprecated, useNamespace } from '@code-monkey-ui/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 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 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) 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":";;;;;;;;;;;;;;;;;;;;;;;;;mCAuGc,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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A,EAAA,GAAA,IAAA;AACxB,QAAA,GAAA,iBAAqB,GAAA,EAAA,cAAA,EAAA,KAAA,CAAA,WAAA,EAAA,GAAA,IAAA;AAAA,OACvB,CAAA,CAAA;AAEA,KAAA,CAAA,CAAA;AACE,IAAM,MAAA,KAAA,GAAO;AAAkB,MAChC,IAAA,EAAA,EAAA,EAAA,CAAA;AAED,MAAa,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import '../../utils/index.mjs';
2
2
  import Tabs from './src/tabs.mjs';
3
3
  export { tabsEmits, tabsProps } from './src/tabs.mjs';
4
4
  import TabPane from './src/tab-pane2.mjs';
5
- export { tabBarProps } from './src/tab-bar.mjs';
5
+ export { tabBarProps } from './src/tab-bar2.mjs';
6
6
  export { tabNavEmits, tabNavProps } from './src/tab-nav.mjs';
7
7
  export { tabPaneProps } from './src/tab-pane.mjs';
8
8
  export { tabsRootContextKey } from './src/constants.mjs';
@@ -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-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';
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:\\project\\work\\code-monkey-ui\\packages\\components\\tabs\\src\\tab-bar.vue"]]);
11
79
 
12
- export { tabBarProps };
80
+ export { TabBar as default };
13
81
  //# sourceMappingURL=tab-bar.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tab-bar.mjs","sources":["../../../../../../packages/components/tabs/src/tab-bar.ts"],"sourcesContent":["import { buildProps, definePropType, mutable } from '@code-monkey-ui/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
+ {"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 '@code-monkey-ui/utils'\nimport { useNamespace } from '@code-monkey-ui/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,GAAW,CAAC,KAAA,EAAO,QAAQ,CAAA,CAAE,SAAS,QAAS,CAAA,KAAA,CAAM,WAAW,CAAA,GAClE,OACA,GAAA,QAAA,CAAA;AACJ,MAAM,MAAA,OAAA,GAAU,QAAa,KAAA,OAAA,GAAU,GAAM,GAAA,GAAA,CAAA;AAC7C,MAAM,MAAA,QAAA,GAAW,OAAY,KAAA,GAAA,GAAM,MAAS,GAAA,KAAA,CAAA;AAE5C,MAAM,KAAA,CAAA,IAAA,CAAK,KAAM,CAAA,CAAC,GAAQ,KAAA;AACxB,QAAA,IAAA,EAAM,EAAM,EAAA,CAAA;AACZ,QAAA,MAAK,GAAA,GAAA,CAAA,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