centui 0.0.0-stage → 3.1.0

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 (411) hide show
  1. package/LICENSE +433 -0
  2. package/README.md +54 -2
  3. package/dist/ActionBar-Bs5fkyFH.cjs +1 -0
  4. package/dist/ActionBar-CF1zMUMC.js +56 -0
  5. package/dist/ActivityIndicator-BOZRJBDn.cjs +1 -0
  6. package/dist/ActivityIndicator-Cp20c1E0.js +162 -0
  7. package/dist/Agree-ZswFiFNy.cjs +1 -0
  8. package/dist/Agree-lAcOo38C.js +43 -0
  9. package/dist/Amount-B2StZGGW.js +56 -0
  10. package/dist/Amount-CU7Oc4vv.cjs +1 -0
  11. package/dist/Bill-DDVs3Lu3.cjs +1 -0
  12. package/dist/Bill-qQ4LdkmR.js +58 -0
  13. package/dist/Button-Bu8liJQE.cjs +1 -0
  14. package/dist/Button-D7e-cuA1.js +60 -0
  15. package/dist/Captcha-BEF-de8-.cjs +1 -0
  16. package/dist/Captcha-CgpynYTc.js +283 -0
  17. package/dist/Cashier-CJLfQOXm.js +363 -0
  18. package/dist/Cashier-CLJngM0n.cjs +1 -0
  19. package/dist/CellItem-BHEh4Cp-.js +71 -0
  20. package/dist/CellItem-J0LkwZNL.cjs +1 -0
  21. package/dist/Chart-BINJAx7V.js +135 -0
  22. package/dist/Chart-DJ0Q1g1P.cjs +1 -0
  23. package/dist/CheckBox-D5bCJUXD.js +55 -0
  24. package/dist/CheckBox-DDeCshDK.cjs +1 -0
  25. package/dist/CheckBoxBase-BIPGJ-TD.js +43 -0
  26. package/dist/CheckBoxBase-CobK6-tL.cjs +1 -0
  27. package/dist/CheckList-BsKo_Fl3.cjs +1 -0
  28. package/dist/CheckList-ViiCo4yi.js +195 -0
  29. package/dist/Codebox-BLPrFnIv.js +188 -0
  30. package/dist/Codebox-yLkdTU7w.cjs +1 -0
  31. package/dist/DatePicker-CCU6gqG3.cjs +1 -0
  32. package/dist/DatePicker-CYvPJatt.js +175 -0
  33. package/dist/DetailItem-D6-zbZmd.js +21 -0
  34. package/dist/DetailItem-DDJXXao0.cjs +1 -0
  35. package/dist/Dialog-208_XUAL.cjs +1 -0
  36. package/dist/Dialog-Bb7Gth3j.js +148 -0
  37. package/dist/DropMenu-5TA_6bas.js +95 -0
  38. package/dist/DropMenu-D_ZMGOOi.cjs +1 -0
  39. package/dist/Field-0hdNWFNm.js +50 -0
  40. package/dist/Field-DDmHa4zB.cjs +1 -0
  41. package/dist/FieldItem-D79w330m.js +87 -0
  42. package/dist/FieldItem-UFKrl_5J.cjs +1 -0
  43. package/dist/Icon-83WWqE5z.cjs +31 -0
  44. package/dist/Icon-BgCtu0ZV.js +117 -0
  45. package/dist/ImageReader-DjshA_hh.cjs +1 -0
  46. package/dist/ImageReader-hUb5CEbV.js +122 -0
  47. package/dist/ImageViewer-BCEK4DOF.cjs +1 -0
  48. package/dist/ImageViewer-_dTRCIsV.js +68 -0
  49. package/dist/InputItem-DO5Yo_IH.cjs +1 -0
  50. package/dist/InputItem-yHsLFvKt.js +327 -0
  51. package/dist/Landscape-BsHyoM4N.cjs +1 -0
  52. package/dist/Landscape-Dd0abEy1.js +73 -0
  53. package/dist/LicensePlate-CTcAIbcb.js +201 -0
  54. package/dist/LicensePlate-CfwpVw0G.cjs +1 -0
  55. package/dist/NoticeBar-CV355FeO.cjs +1 -0
  56. package/dist/NoticeBar-G5aKL6VO.js +92 -0
  57. package/dist/NumberKeyboard-BWpxsbYt.cjs +1 -0
  58. package/dist/NumberKeyboard-B_TJXxki.js +335 -0
  59. package/dist/Picker-BOEGTBaN.cjs +1 -0
  60. package/dist/Picker-CA-JQ_OC.js +493 -0
  61. package/dist/Popup-Ca1jPi0t.cjs +1 -0
  62. package/dist/Popup-qLk-BsRS.js +116 -0
  63. package/dist/PopupTitleBar-9P4RUMC1.js +84 -0
  64. package/dist/PopupTitleBar-Bfl49eYJ.cjs +1 -0
  65. package/dist/Progress-CT-LHaQ0.cjs +1 -0
  66. package/dist/Progress-Clet0W_n.js +65 -0
  67. package/dist/Radio-B_MxJ65X.cjs +1 -0
  68. package/dist/Radio-DY-ZX0BP.js +67 -0
  69. package/dist/RadioGroup-B00aqM9e.js +84 -0
  70. package/dist/RadioGroup-B6ukqnm5.cjs +1 -0
  71. package/dist/RadioList-D-9PITpr.cjs +1 -0
  72. package/dist/RadioList-DNGsEzgf.js +125 -0
  73. package/dist/ResultPage-DUs8ok5R.js +64 -0
  74. package/dist/ResultPage-YQWDaFmz.cjs +1 -0
  75. package/dist/Roller-BznN57fL.js +91 -0
  76. package/dist/Roller-DALhjhfg.cjs +1 -0
  77. package/dist/RollerSuccess-BbMzNlkv.cjs +1 -0
  78. package/dist/RollerSuccess-CTh43Rh0.js +65 -0
  79. package/dist/Ruler-Bhf5J7hU.js +136 -0
  80. package/dist/Ruler-CEzB0oqG.cjs +1 -0
  81. package/dist/ScrollView-BNY62f7B.js +228 -0
  82. package/dist/ScrollView-BnadVBJC.cjs +1 -0
  83. package/dist/ScrollViewMore-BL1vpyMj.cjs +1 -0
  84. package/dist/ScrollViewMore-DBhoiI1X.js +54 -0
  85. package/dist/Selector-DOU8Af55.js +209 -0
  86. package/dist/Selector-DnFvOGbv.cjs +1 -0
  87. package/dist/Skeleton--SCiydNl.cjs +1 -0
  88. package/dist/Skeleton-DqA5IxL5.js +54 -0
  89. package/dist/Slider-BB2Nhpys.js +100 -0
  90. package/dist/Slider-vV7_nULf.cjs +1 -0
  91. package/dist/Stepper-BnDhL8IO.js +137 -0
  92. package/dist/Stepper-n_mc16V2.cjs +1 -0
  93. package/dist/Steps-BPQwab3T.js +157 -0
  94. package/dist/Steps-Dfpmgl8B.cjs +1 -0
  95. package/dist/SwiperItem-BY5cUoGn.cjs +1 -0
  96. package/dist/SwiperItem-BydyBdYU.js +323 -0
  97. package/dist/Switch-B1rsBY-M.js +31 -0
  98. package/dist/Switch-CghubImq.cjs +1 -0
  99. package/dist/TabPane-BCVsdptu.cjs +1 -0
  100. package/dist/TabPane-Q7oUFzmP.js +237 -0
  101. package/dist/TabPicker-BcL9assY.cjs +1 -0
  102. package/dist/TabPicker-BicPrto7.js +173 -0
  103. package/dist/Tag-C7ygxOwU.js +78 -0
  104. package/dist/Tag-CIA2npnD.cjs +1 -0
  105. package/dist/TextareaItem-Dl-PCLl-.js +168 -0
  106. package/dist/TextareaItem-Du5nl7tv.cjs +1 -0
  107. package/dist/Tip-DHPmevlv.js +165 -0
  108. package/dist/Tip-De_3tKtb.cjs +1 -0
  109. package/dist/Transition-B-baX512.js +14 -0
  110. package/dist/Transition-Bwbqr4Xr.cjs +1 -0
  111. package/dist/WaterMark-CgkuQjv3.js +103 -0
  112. package/dist/WaterMark-M81jg6T5.cjs +1 -0
  113. package/dist/action-bar.cjs +1 -0
  114. package/dist/action-bar.d.ts +1 -0
  115. package/dist/action-bar.js +1 -0
  116. package/dist/action-sheet-BjaReHkr.cjs +1 -0
  117. package/dist/action-sheet-Da8dHevy.js +121 -0
  118. package/dist/action-sheet.cjs +1 -0
  119. package/dist/action-sheet.d.ts +2 -0
  120. package/dist/action-sheet.js +1 -0
  121. package/dist/activity-indicator.cjs +1 -0
  122. package/dist/activity-indicator.d.ts +1 -0
  123. package/dist/activity-indicator.js +4 -0
  124. package/dist/agree.cjs +1 -0
  125. package/dist/agree.d.ts +1 -0
  126. package/dist/agree.js +1 -0
  127. package/dist/amount.cjs +1 -0
  128. package/dist/amount.d.ts +1 -0
  129. package/dist/amount.js +1 -0
  130. package/dist/bill.cjs +1 -0
  131. package/dist/bill.d.ts +1 -0
  132. package/dist/bill.js +1 -0
  133. package/dist/button.cjs +1 -0
  134. package/dist/button.d.ts +1 -0
  135. package/dist/button.js +1 -0
  136. package/dist/captcha.cjs +1 -0
  137. package/dist/captcha.d.ts +1 -0
  138. package/dist/captcha.js +1 -0
  139. package/dist/cashier.cjs +1 -0
  140. package/dist/cashier.d.ts +1 -0
  141. package/dist/cashier.js +1 -0
  142. package/dist/cell-item.cjs +1 -0
  143. package/dist/cell-item.d.ts +1 -0
  144. package/dist/cell-item.js +1 -0
  145. package/dist/chart.cjs +1 -0
  146. package/dist/chart.d.ts +1 -0
  147. package/dist/chart.js +1 -0
  148. package/dist/check-base.cjs +1 -0
  149. package/dist/check-base.d.ts +1 -0
  150. package/dist/check-base.js +1 -0
  151. package/dist/check.cjs +1 -0
  152. package/dist/check.d.ts +1 -0
  153. package/dist/check.js +3 -0
  154. package/dist/codebox.cjs +1 -0
  155. package/dist/codebox.d.ts +1 -0
  156. package/dist/codebox.js +1 -0
  157. package/dist/components/action-bar/ActionBar.vue.d.ts +34 -0
  158. package/dist/components/action-bar/index.d.ts +2 -0
  159. package/dist/components/action-sheet/ActionSheet.vue.d.ts +49 -0
  160. package/dist/components/action-sheet/index.d.ts +25 -0
  161. package/dist/components/activity-indicator/ActivityIndicator.vue.d.ts +31 -0
  162. package/dist/components/activity-indicator/Carousel.vue.d.ts +10 -0
  163. package/dist/components/activity-indicator/CarouselCircle.vue.d.ts +12 -0
  164. package/dist/components/activity-indicator/Roller.vue.d.ts +37 -0
  165. package/dist/components/activity-indicator/RollerSuccess.vue.d.ts +14 -0
  166. package/dist/components/activity-indicator/Spinning.vue.d.ts +10 -0
  167. package/dist/components/activity-indicator/index.d.ts +5 -0
  168. package/dist/components/agree/Agree.vue.d.ts +35 -0
  169. package/dist/components/agree/index.d.ts +1 -0
  170. package/dist/components/amount/Amount.vue.d.ts +25 -0
  171. package/dist/components/amount/index.d.ts +1 -0
  172. package/dist/components/bill/Bill.vue.d.ts +33 -0
  173. package/dist/components/bill/index.d.ts +1 -0
  174. package/dist/components/button/Button.vue.d.ts +38 -0
  175. package/dist/components/button/index.d.ts +1 -0
  176. package/dist/components/captcha/Captcha.vue.d.ts +76 -0
  177. package/dist/components/captcha/index.d.ts +1 -0
  178. package/dist/components/cashier/Cashier.vue.d.ts +101 -0
  179. package/dist/components/cashier/CashierChannel.vue.d.ts +58 -0
  180. package/dist/components/cashier/CashierChannelButton.vue.d.ts +14 -0
  181. package/dist/components/cashier/CashierChannelItem.vue.d.ts +30 -0
  182. package/dist/components/cashier/index.d.ts +4 -0
  183. package/dist/components/cell-item/CellItem.vue.d.ts +38 -0
  184. package/dist/components/cell-item/index.d.ts +1 -0
  185. package/dist/components/chart/Chart.vue.d.ts +30 -0
  186. package/dist/components/chart/index.d.ts +2 -0
  187. package/dist/components/check/Check.vue.d.ts +38 -0
  188. package/dist/components/check/CheckBox.vue.d.ts +31 -0
  189. package/dist/components/check/CheckGroup.vue.d.ts +27 -0
  190. package/dist/components/check/CheckList.vue.d.ts +58 -0
  191. package/dist/components/check/index.d.ts +6 -0
  192. package/dist/components/check/shared.d.ts +52 -0
  193. package/dist/components/check-base/CheckBoxBase.vue.d.ts +25 -0
  194. package/dist/components/check-base/index.d.ts +1 -0
  195. package/dist/components/codebox/Codebox.vue.d.ts +58 -0
  196. package/dist/components/codebox/index.d.ts +1 -0
  197. package/dist/components/date-picker/DatePicker.vue.d.ts +70 -0
  198. package/dist/components/date-picker/index.d.ts +1 -0
  199. package/dist/components/detail-item/DetailItem.vue.d.ts +22 -0
  200. package/dist/components/detail-item/index.d.ts +1 -0
  201. package/dist/components/dialog/Dialog.vue.d.ts +88 -0
  202. package/dist/components/dialog/index.d.ts +40 -0
  203. package/dist/components/drop-menu/DropMenu.vue.d.ts +55 -0
  204. package/dist/components/drop-menu/index.d.ts +1 -0
  205. package/dist/components/field/Field.vue.d.ts +30 -0
  206. package/dist/components/field/index.d.ts +1 -0
  207. package/dist/components/field-item/FieldItem.vue.d.ts +42 -0
  208. package/dist/components/field-item/index.d.ts +1 -0
  209. package/dist/components/icon/Icon.vue.d.ts +20 -0
  210. package/dist/components/icon/default-svg-list.d.ts +2 -0
  211. package/dist/components/icon/index.d.ts +1 -0
  212. package/dist/components/icon/load-sprite.d.ts +6 -0
  213. package/dist/components/image-reader/ImageReader.vue.d.ts +46 -0
  214. package/dist/components/image-reader/index.d.ts +1 -0
  215. package/dist/components/image-viewer/ImageViewer.vue.d.ts +25 -0
  216. package/dist/components/image-viewer/index.d.ts +1 -0
  217. package/dist/components/index.d.ts +3 -0
  218. package/dist/components/input-item/InputItem.vue.d.ts +97 -0
  219. package/dist/components/input-item/cursor.d.ts +7 -0
  220. package/dist/components/input-item/index.d.ts +1 -0
  221. package/dist/components/landscape/Landscape.vue.d.ts +38 -0
  222. package/dist/components/landscape/index.d.ts +1 -0
  223. package/dist/components/license-plate/LicensePlate.vue.d.ts +32 -0
  224. package/dist/components/license-plate/LicensePlateInput.vue.d.ts +14 -0
  225. package/dist/components/license-plate/LicensePlateKeyboard.vue.d.ts +30 -0
  226. package/dist/components/license-plate/index.d.ts +3 -0
  227. package/dist/components/notice-bar/NoticeBar.vue.d.ts +44 -0
  228. package/dist/components/notice-bar/index.d.ts +1 -0
  229. package/dist/components/number-keyboard/KeyboardBoard.vue.d.ts +33 -0
  230. package/dist/components/number-keyboard/KeyboardKey.vue.d.ts +19 -0
  231. package/dist/components/number-keyboard/NumberKeyboard.vue.d.ts +59 -0
  232. package/dist/components/number-keyboard/index.d.ts +3 -0
  233. package/dist/components/picker/Picker.vue.d.ts +64 -0
  234. package/dist/components/picker/PickerColumn.vue.d.ts +64 -0
  235. package/dist/components/picker/index.d.ts +3 -0
  236. package/dist/components/popup/Popup.vue.d.ts +50 -0
  237. package/dist/components/popup/PopupTitleBar.vue.d.ts +45 -0
  238. package/dist/components/popup/index.d.ts +2 -0
  239. package/dist/components/progress/Progress.vue.d.ts +39 -0
  240. package/dist/components/progress/index.d.ts +1 -0
  241. package/dist/components/radio/Radio.vue.d.ts +39 -0
  242. package/dist/components/radio/RadioBox.vue.d.ts +31 -0
  243. package/dist/components/radio/RadioGroup.vue.d.ts +24 -0
  244. package/dist/components/radio/index.d.ts +3 -0
  245. package/dist/components/radio-list/RadioList.vue.d.ts +72 -0
  246. package/dist/components/radio-list/index.d.ts +2 -0
  247. package/dist/components/result-page/ResultPage.vue.d.ts +28 -0
  248. package/dist/components/result-page/index.d.ts +1 -0
  249. package/dist/components/ruler/Ruler.vue.d.ts +34 -0
  250. package/dist/components/ruler/index.d.ts +1 -0
  251. package/dist/components/scroll-view/ScrollView.vue.d.ts +84 -0
  252. package/dist/components/scroll-view/ScrollViewMore.vue.d.ts +12 -0
  253. package/dist/components/scroll-view/ScrollViewRefresh.vue.d.ts +20 -0
  254. package/dist/components/scroll-view/index.d.ts +3 -0
  255. package/dist/components/selector/Selector.vue.d.ts +88 -0
  256. package/dist/components/selector/index.d.ts +2 -0
  257. package/dist/components/skeleton/Skeleton.vue.d.ts +30 -0
  258. package/dist/components/skeleton/index.d.ts +1 -0
  259. package/dist/components/slider/Slider.vue.d.ts +24 -0
  260. package/dist/components/slider/index.d.ts +1 -0
  261. package/dist/components/stepper/Stepper.vue.d.ts +32 -0
  262. package/dist/components/stepper/index.d.ts +1 -0
  263. package/dist/components/steps/Steps.vue.d.ts +56 -0
  264. package/dist/components/steps/index.d.ts +2 -0
  265. package/dist/components/swiper/Swiper.vue.d.ts +57 -0
  266. package/dist/components/swiper/SwiperItem.vue.d.ts +26 -0
  267. package/dist/components/swiper/index.d.ts +2 -0
  268. package/dist/components/switch/Switch.vue.d.ts +16 -0
  269. package/dist/components/switch/index.d.ts +1 -0
  270. package/dist/components/tab-picker/TabPicker.vue.d.ts +78 -0
  271. package/dist/components/tab-picker/index.d.ts +1 -0
  272. package/dist/components/tabs/TabBar.vue.d.ts +50 -0
  273. package/dist/components/tabs/TabPane.vue.d.ts +31 -0
  274. package/dist/components/tabs/Tabs.vue.d.ts +34 -0
  275. package/dist/components/tabs/index.d.ts +3 -0
  276. package/dist/components/tag/Tag.vue.d.ts +39 -0
  277. package/dist/components/tag/index.d.ts +1 -0
  278. package/dist/components/textarea-item/TextareaItem.vue.d.ts +80 -0
  279. package/dist/components/textarea-item/index.d.ts +1 -0
  280. package/dist/components/tip/Tip.vue.d.ts +98 -0
  281. package/dist/components/tip/TipContent.vue.d.ts +33 -0
  282. package/dist/components/tip/index.d.ts +2 -0
  283. package/dist/components/toast/Toast.vue.d.ts +45 -0
  284. package/dist/components/toast/index.d.ts +129 -0
  285. package/dist/components/transition/Transition.vue.d.ts +13 -0
  286. package/dist/components/transition/index.d.ts +1 -0
  287. package/dist/components/water-mark/WaterMark.vue.d.ts +35 -0
  288. package/dist/components/water-mark/index.d.ts +1 -0
  289. package/dist/cursor-BIPoNm8V.js +11 -0
  290. package/dist/cursor-tQE3LcbU.cjs +1 -0
  291. package/dist/date-picker.cjs +1 -0
  292. package/dist/date-picker.d.ts +1 -0
  293. package/dist/date-picker.js +1 -0
  294. package/dist/detail-item.cjs +1 -0
  295. package/dist/detail-item.d.ts +1 -0
  296. package/dist/detail-item.js +1 -0
  297. package/dist/dialog-C38EDWGJ.cjs +1 -0
  298. package/dist/dialog-DdNA6YSe.js +91 -0
  299. package/dist/dialog.cjs +1 -0
  300. package/dist/dialog.d.ts +2 -0
  301. package/dist/dialog.js +3 -0
  302. package/dist/drop-menu.cjs +1 -0
  303. package/dist/drop-menu.d.ts +1 -0
  304. package/dist/drop-menu.js +1 -0
  305. package/dist/field-item.cjs +1 -0
  306. package/dist/field-item.d.ts +1 -0
  307. package/dist/field-item.js +1 -0
  308. package/dist/field.cjs +1 -0
  309. package/dist/field.d.ts +1 -0
  310. package/dist/field.js +1 -0
  311. package/dist/icon.cjs +1 -0
  312. package/dist/icon.d.ts +1 -0
  313. package/dist/icon.js +1 -0
  314. package/dist/image-reader.cjs +1 -0
  315. package/dist/image-reader.d.ts +1 -0
  316. package/dist/image-reader.js +1 -0
  317. package/dist/image-viewer.cjs +1 -0
  318. package/dist/image-viewer.d.ts +1 -0
  319. package/dist/image-viewer.js +1 -0
  320. package/dist/index.cjs +1 -0
  321. package/dist/index.d.ts +64 -0
  322. package/dist/index.js +61 -0
  323. package/dist/input-item.cjs +1 -0
  324. package/dist/input-item.d.ts +1 -0
  325. package/dist/input-item.js +1 -0
  326. package/dist/landscape.cjs +1 -0
  327. package/dist/landscape.d.ts +1 -0
  328. package/dist/landscape.js +1 -0
  329. package/dist/license-plate.cjs +1 -0
  330. package/dist/license-plate.d.ts +1 -0
  331. package/dist/license-plate.js +1 -0
  332. package/dist/notice-bar.cjs +1 -0
  333. package/dist/notice-bar.d.ts +1 -0
  334. package/dist/notice-bar.js +1 -0
  335. package/dist/number-keyboard.cjs +1 -0
  336. package/dist/number-keyboard.d.ts +1 -0
  337. package/dist/number-keyboard.js +1 -0
  338. package/dist/picker.cjs +1 -0
  339. package/dist/picker.d.ts +1 -0
  340. package/dist/picker.js +1 -0
  341. package/dist/popup.cjs +1 -0
  342. package/dist/popup.d.ts +1 -0
  343. package/dist/popup.js +3 -0
  344. package/dist/progress.cjs +1 -0
  345. package/dist/progress.d.ts +1 -0
  346. package/dist/progress.js +1 -0
  347. package/dist/radio-list.cjs +1 -0
  348. package/dist/radio-list.d.ts +1 -0
  349. package/dist/radio-list.js +1 -0
  350. package/dist/radio.cjs +1 -0
  351. package/dist/radio.d.ts +1 -0
  352. package/dist/radio.js +3 -0
  353. package/dist/result-page.cjs +1 -0
  354. package/dist/result-page.d.ts +1 -0
  355. package/dist/result-page.js +1 -0
  356. package/dist/ruler.cjs +1 -0
  357. package/dist/ruler.d.ts +1 -0
  358. package/dist/ruler.js +1 -0
  359. package/dist/scroll-view.cjs +1 -0
  360. package/dist/scroll-view.d.ts +1 -0
  361. package/dist/scroll-view.js +3 -0
  362. package/dist/selector.cjs +1 -0
  363. package/dist/selector.d.ts +1 -0
  364. package/dist/selector.js +1 -0
  365. package/dist/shared-C9XlLe7F.js +36 -0
  366. package/dist/shared-k9cbQbvK.cjs +1 -0
  367. package/dist/skeleton.cjs +1 -0
  368. package/dist/skeleton.d.ts +1 -0
  369. package/dist/skeleton.js +1 -0
  370. package/dist/slider.cjs +1 -0
  371. package/dist/slider.d.ts +1 -0
  372. package/dist/slider.js +1 -0
  373. package/dist/stepper.cjs +1 -0
  374. package/dist/stepper.d.ts +1 -0
  375. package/dist/stepper.js +1 -0
  376. package/dist/steps.cjs +1 -0
  377. package/dist/steps.d.ts +1 -0
  378. package/dist/steps.js +1 -0
  379. package/dist/swiper.cjs +1 -0
  380. package/dist/swiper.d.ts +1 -0
  381. package/dist/swiper.js +1 -0
  382. package/dist/switch.cjs +1 -0
  383. package/dist/switch.d.ts +1 -0
  384. package/dist/switch.js +1 -0
  385. package/dist/tab-picker.cjs +1 -0
  386. package/dist/tab-picker.d.ts +1 -0
  387. package/dist/tab-picker.js +1 -0
  388. package/dist/tabs.cjs +1 -0
  389. package/dist/tabs.d.ts +1 -0
  390. package/dist/tabs.js +1 -0
  391. package/dist/tag.cjs +1 -0
  392. package/dist/tag.d.ts +1 -0
  393. package/dist/tag.js +1 -0
  394. package/dist/textarea-item.cjs +1 -0
  395. package/dist/textarea-item.d.ts +1 -0
  396. package/dist/textarea-item.js +1 -0
  397. package/dist/tip.cjs +1 -0
  398. package/dist/tip.d.ts +1 -0
  399. package/dist/tip.js +1 -0
  400. package/dist/toast-ByIFvpMs.js +146 -0
  401. package/dist/toast-C1K2_cOo.cjs +1 -0
  402. package/dist/toast.cjs +1 -0
  403. package/dist/toast.d.ts +2 -0
  404. package/dist/toast.js +1 -0
  405. package/dist/transition.cjs +1 -0
  406. package/dist/transition.d.ts +1 -0
  407. package/dist/transition.js +1 -0
  408. package/dist/water-mark.cjs +1 -0
  409. package/dist/water-mark.d.ts +1 -0
  410. package/dist/water-mark.js +1 -0
  411. package/package.json +296 -3
@@ -0,0 +1,323 @@
1
+ import { Fragment as e, cloneVNode as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, getCurrentInstance as c, inject as l, nextTick as ee, normalizeClass as u, normalizeStyle as d, onActivated as te, onBeforeUnmount as ne, onDeactivated as re, onMounted as ie, openBlock as f, provide as ae, ref as p, renderList as oe, renderSlot as se, useSlots as ce, watch as le } from "vue";
2
+ import { debounce as ue, warn as de } from "@centui/core";
3
+ import { Scroller as fe, render as pe } from "@centui/core/web";
4
+ // src/components/swiper/Swiper.vue?vue&type=script&setup=true&lang.ts
5
+ var me = .5, he = 300, m = /* @__PURE__ */ s({
6
+ name: "cu-swiper",
7
+ __name: "Swiper",
8
+ props: {
9
+ autoplay: { default: 3e3 },
10
+ transition: { default: "slide" },
11
+ transitionDuration: { default: 250 },
12
+ defaultIndex: { default: 0 },
13
+ hasDots: {
14
+ type: Boolean,
15
+ default: !0
16
+ },
17
+ isPrevent: {
18
+ type: Boolean,
19
+ default: !0
20
+ },
21
+ isLoop: {
22
+ type: Boolean,
23
+ default: !0
24
+ },
25
+ dragable: {
26
+ type: Boolean,
27
+ default: !0
28
+ },
29
+ useNativeDriver: {
30
+ type: Boolean,
31
+ default: !0
32
+ }
33
+ },
34
+ emits: ["beforeChange", "afterChange"],
35
+ setup(s, { expose: c, emit: l }) {
36
+ let d = typeof process < "u" && process.env.MAND_ENV === "test", m = s, h = l, ge = ce(), g = p(), _e = p(), _ = p(), v = p(!1), y = p(!1), b = p(!1), x = p(0), S = p(0), C = p(0), w = p(0), T = p(0), E = p(0), D = p(0), O = p(0), k = p(0), A = p(!1), j = p(!0), M = p(null), ve = p(!1), N = {}, P = null, F = null, I = null, L = null, R = !1, z = null, B = null, V = [];
37
+ function ye(e) {
38
+ V.push(e), v.value && xe();
39
+ }
40
+ function be(e) {
41
+ let t = V.indexOf(e);
42
+ t >= 0 && V.splice(t, 1), v.value && xe();
43
+ }
44
+ let xe = ue(() => {
45
+ R || ee(() => {
46
+ R || (Y(), J(), j.value || $(x.value));
47
+ });
48
+ }, 50);
49
+ ae("mdSwiper", {
50
+ dimension: () => k.value,
51
+ isVertical: () => U.value,
52
+ register: ye,
53
+ unregister: be
54
+ }), le(() => m.autoplay, (e) => {
55
+ x.value = e;
56
+ }, { immediate: !0 });
57
+ let Se = n(() => S.value === O.value - 1), Ce = n(() => S.value === 0), we = n(() => Ke()), H = n(() => m.transition.toLowerCase().includes("slide")), U = n(() => m.transition === "slideY"), Te = n(() => {
58
+ let e = (ge.default?.() ?? []).filter((e) => e.type !== Symbol.for("v-cmt"));
59
+ return !W.value || e.length < 2 ? null : t(e[0], {
60
+ class: "cu-swiper-item-first-copy",
61
+ style: De.value,
62
+ isCopy: !0
63
+ });
64
+ }), Ee = n(() => {
65
+ let e = (ge.default?.() ?? []).filter((e) => e.type !== Symbol.for("v-cmt"));
66
+ return !W.value || e.length < 2 ? null : t(e[e.length - 1], {
67
+ class: "cu-swiper-item-last-copy",
68
+ style: De.value,
69
+ isCopy: !0
70
+ });
71
+ }), W = n(() => H.value && b.value), G = (e) => e.vnode;
72
+ G.props = ["vnode"];
73
+ let De = n(() => U.value ? { height: `${k.value}px` } : { width: `${k.value}px` });
74
+ ie(() => {
75
+ ke();
76
+ }), te(() => {
77
+ ke();
78
+ }), re(() => {
79
+ Ae();
80
+ }), ne(() => {
81
+ R = !0, I = null, z &&= (clearTimeout(z), null), B &&= (clearTimeout(B), null), Ae();
82
+ });
83
+ function Oe() {
84
+ L && clearTimeout(L);
85
+ let e = S.value;
86
+ L = setTimeout(() => {
87
+ J(e);
88
+ }, 300);
89
+ }
90
+ function ke() {
91
+ v.value = !0, ee(() => {
92
+ J(), $(x.value), window.addEventListener("resize", Oe);
93
+ });
94
+ }
95
+ function Ae() {
96
+ v.value = !1, Y(), window.removeEventListener("resize", Oe), L && clearTimeout(L);
97
+ }
98
+ function je() {
99
+ k.value = U.value ? g.value?.clientHeight ?? 0 : g.value?.clientWidth ?? 0;
100
+ }
101
+ function Me() {
102
+ let e = new fe((e, t) => {
103
+ pe(_.value, e, t, 1, m.useNativeDriver);
104
+ }, {
105
+ scrollingY: U.value,
106
+ scrollingX: !U.value,
107
+ snapping: !1,
108
+ bouncing: !1,
109
+ animationDuration: m.transitionDuration,
110
+ scrollingComplete: () => {
111
+ I && I();
112
+ }
113
+ }), t = _e.value;
114
+ if (!t) return;
115
+ let n = U.value ? t.clientWidth : t.clientWidth * O.value, r = U.value ? t.clientHeight * O.value : t.clientHeight;
116
+ e.setPosition(t.clientLeft, t.clientTop), e.setDimensions(t.clientWidth, t.clientHeight, n, r), M.value = e;
117
+ }
118
+ function Ne() {
119
+ V.length > 1 && m.isLoop && (T.value++, E.value++, S.value++, ve.value = !0);
120
+ }
121
+ function K(e, t, n = !0) {
122
+ if (!e) {
123
+ de("[cu-swiper] no element for translate");
124
+ return;
125
+ }
126
+ let r = U.value ? 0 : -t, i = U.value ? -t : 0;
127
+ M.value?.scrollTo(r, i, n);
128
+ }
129
+ function q(e = !0, t) {
130
+ let n = V;
131
+ if (!n || !n.length) return;
132
+ if (t !== void 0) {
133
+ let r = 0, i = w.value, a = O.value;
134
+ t > 0 ? i > 0 ? r = i - 1 : i === 0 && (r = a - 1) : i < a - 1 ? r = i + 1 : i === a - 1 && (r = 0);
135
+ let o = n[i]?.$el, s = n[r]?.$el;
136
+ if (!o || !s) return;
137
+ o.style.opacity = String(1 - Math.abs(t)), o.style.transition = e ? "opacity 300ms ease" : "", s.style.opacity = String(Math.abs(t));
138
+ return;
139
+ }
140
+ let r = n[C.value]?.$el, i = n[w.value]?.$el;
141
+ r && i && (r.style.opacity = "0", r.style.transition = e ? "opacity 500ms ease" : "", i.style.opacity = "1", e && (B && clearTimeout(B), B = setTimeout(() => {
142
+ B = null, R || h("afterChange", C.value, w.value);
143
+ }, 500)));
144
+ }
145
+ function Pe(e, t) {
146
+ D.value = e, O.value = e + (m.isLoop && H.value && e > 1 ? 2 : 0), ve.value = !1, A.value = e === 1 || !m.dragable, S.value = t === void 0 ? m.defaultIndex >= 0 && m.defaultIndex < e ? parseInt(String(m.defaultIndex)) : 0 : X(t), T.value = 0, E.value = e - 1, C.value = S.value === T.value ? E.value : S.value === E.value ? T.value : S.value + 1, w.value = S.value;
147
+ }
148
+ function J(e) {
149
+ let t = V.length;
150
+ t && (je(), Pe(t, e), H.value ? (Ne(), Me(), K(_.value, -k.value * S.value, !1)) : q(!1), b.value = !0);
151
+ }
152
+ function Fe() {
153
+ x.value > 0 && D.value > 1 && (Y(), F = setInterval(() => {
154
+ if (!m.isLoop && S.value >= O.value - 1) return Y();
155
+ y.value || Ue();
156
+ }, x.value));
157
+ }
158
+ function Y() {
159
+ F &&= (clearInterval(F), null);
160
+ }
161
+ function Ie(e, t) {
162
+ let n = U.value, { currentLeft: r, currentTop: i, startLeft: a, startTop: o } = N;
163
+ if (P === null) {
164
+ if (!n && i === o || n && r === a) return !1;
165
+ if (e * e + t * t >= 25) {
166
+ let r = Math.atan2(Math.abs(t), Math.abs(e)) * 180 / Math.PI;
167
+ return n ? 90 - r > 45 : r > 45;
168
+ }
169
+ return !1;
170
+ }
171
+ return P;
172
+ }
173
+ function X(e) {
174
+ return m.isLoop && H.value && D.value > 0 ? e - 1 < 0 ? D.value - 1 : e - 1 > D.value - 1 ? 0 : e - 1 : e;
175
+ }
176
+ function Le(e) {
177
+ return e < 0 ? e = 0 : D.value > 0 && e > D.value - 1 && (e = D.value - 1), m.isLoop && H.value ? e + 1 : e;
178
+ }
179
+ function Z(e, t) {
180
+ if (D.value === 0 || !t && D.value < 2) return;
181
+ let n = S.value, r = O.value, i = S.value;
182
+ e && (t && t.index !== void 0 ? S.value = t.index : e === "prev" ? n > 0 ? S.value = n - 1 : (!H.value && n === 0 || m.isLoop && n === 0) && (S.value = r - 1) : e === "next" && (n < r - 1 ? S.value = n + 1 : !H.value && n === r - 1 ? S.value = 0 : m.isLoop && n === r - 1 && (S.value = 1)), m.isLoop && H.value ? (C.value = X(i), w.value = X(S.value)) : (C.value = w.value, w.value = S.value), h("beforeChange", C.value, w.value), H.value ? (z && clearTimeout(z), z = setTimeout(() => {
183
+ if (z = null, R) return;
184
+ let e = Ce.value && m.isLoop, t = Se.value && m.isLoop;
185
+ I = () => {
186
+ if (t) {
187
+ let e = U.value ? 0 : T.value * k.value, t = U.value ? T.value * k.value : 0;
188
+ M.value?.scrollTo(e, t, !1);
189
+ }
190
+ if (e) {
191
+ let e = U.value ? 0 : E.value * k.value, t = U.value ? E.value * k.value : 0;
192
+ M.value?.scrollTo(e, t, !1);
193
+ }
194
+ h("afterChange", C.value, w.value), I = null;
195
+ }, K(_.value, -k.value * S.value), e ? S.value = E.value : t && (S.value = T.value);
196
+ }, 10)) : q());
197
+ }
198
+ function Re(e) {
199
+ if (A.value) return;
200
+ qe();
201
+ let t = e, n = t.changedTouches?.[0] ?? t.touches?.[0] ?? t.targetTouches?.[0] ?? t;
202
+ N = {}, N.startTime = /* @__PURE__ */ new Date(), N.startLeft = n.pageX, N.startTop = n.pageY, N.itemWidth = d ? 100 : g.value?.offsetWidth ?? 0, N.itemHeight = d ? 100 : g.value?.offsetHeight ?? 0;
203
+ }
204
+ function ze(e) {
205
+ if (A.value) return;
206
+ let t = e, n = t.changedTouches?.[0] ?? t.touches?.[0] ?? t.targetTouches?.[0] ?? t;
207
+ N.currentLeft = n.pageX, N.currentTop = n.pageY;
208
+ let r = Number(N.currentLeft) - Number(N.startLeft), i = Number(N.currentTop) - Number(N.startTop);
209
+ if (P = Ie(Math.abs(r), Math.abs(i)), P) return;
210
+ e.preventDefault();
211
+ let a = Number(N.itemWidth), o = Number(N.itemHeight), s = Math.min(Math.max(-a + 1, r), a - 1), c = Math.min(Math.max(-o + 1, i), o - 1), l = U.value ? c - o * S.value : s - a * S.value;
212
+ H.value ? K(_.value, l, !1) : q(!1, r / a);
213
+ }
214
+ function Be() {
215
+ if (A.value) return;
216
+ let e = Number(/* @__PURE__ */ new Date()) - Number(N.startTime), t = Number(N.currentLeft) - Number(N.startLeft), n = Number(N.currentTop) - Number(N.startTop), r = Number(N.itemWidth), i = Number(N.itemHeight), a = S.value, o = O.value, s = e < he, c = null;
217
+ s && N.currentLeft === void 0 || (U.value ? Math.abs(n) > i * me || s ? c = n < 0 ? "next" : "prev" : K(_.value, -k.value * a, !0) : Math.abs(t) > r * me || s ? c = t < 0 ? "next" : "prev" : H.value ? K(_.value, -k.value * a, !0) : q(!0, 0), m.isLoop || (a === 0 && c === "prev" || a === o - 1 && c === "next") && (c = null), Z(c), N = {}), $(x.value);
218
+ }
219
+ function Ve(e) {
220
+ I && I(), m.isPrevent && e.preventDefault(), y.value = !0, P = null, Re(e);
221
+ }
222
+ function He(e) {
223
+ m.isPrevent && e.preventDefault(), y.value && ze(e);
224
+ }
225
+ function Q(e) {
226
+ m.isPrevent && e.preventDefault(), P ? ($(x.value), y.value = !1, N = {}) : y.value &&= (Be(), !1);
227
+ }
228
+ function Ue() {
229
+ Z("next");
230
+ }
231
+ function We() {
232
+ Z("prev");
233
+ }
234
+ function Ge(e) {
235
+ if (isNaN(e)) return;
236
+ e = parseInt(String(e));
237
+ let t = Le(e);
238
+ Z(t > S.value ? "next" : "prev", { index: t }), $(x.value);
239
+ }
240
+ function Ke() {
241
+ return X(S.value);
242
+ }
243
+ function $(e = 3e3) {
244
+ Y(), e < 500 || (x.value = e || m.autoplay, Fe(), j.value = !1);
245
+ }
246
+ function qe() {
247
+ Y(), j.value = !0;
248
+ }
249
+ return c({
250
+ next: Ue,
251
+ prev: We,
252
+ goto: Ge,
253
+ getIndex: Ke,
254
+ play: $,
255
+ stop: qe,
256
+ index: S,
257
+ rItemCount: O,
258
+ oItemCount: D
259
+ }), (t, n) => (f(), a("div", {
260
+ ref_key: "root",
261
+ ref: g,
262
+ class: u(["cu-swiper", {
263
+ "cu-swiper-vertical": U.value,
264
+ "cu-swiper-fade": !H.value,
265
+ disabled: !b.value
266
+ }]),
267
+ onMousedown: Ve,
268
+ onMousemove: He,
269
+ onMouseup: Q,
270
+ onMouseleave: Q,
271
+ onTouchstart: Ve,
272
+ onTouchmove: He,
273
+ onTouchend: Q,
274
+ onTouchcancel: Q
275
+ }, [o("div", {
276
+ ref_key: "swiperBox",
277
+ ref: _e,
278
+ class: "cu-swiper-box"
279
+ }, [o("div", {
280
+ ref_key: "swiper",
281
+ ref: _,
282
+ class: "cu-swiper-container"
283
+ }, [
284
+ W.value && t.$slots.default ? (f(), a(e, { key: 0 }, [Ee.value ? (f(), r(G, {
285
+ key: 0,
286
+ vnode: Ee.value
287
+ }, null, 8, ["vnode"])) : i("", !0)], 64)) : i("", !0),
288
+ se(t.$slots, "default"),
289
+ W.value && t.$slots.default ? (f(), a(e, { key: 1 }, [Te.value ? (f(), r(G, {
290
+ key: 0,
291
+ vnode: Te.value
292
+ }, null, 8, ["vnode"])) : i("", !0)], 64)) : i("", !0)
293
+ ], 512)], 512), D.value > 1 && s.hasDots ? (f(), a("div", {
294
+ key: 0,
295
+ class: u(["cu-swiper-indicators", { disabled: !s.hasDots }])
296
+ }, [(f(!0), a(e, null, oe(D.value, (e) => (f(), a("div", {
297
+ key: e,
298
+ class: u(["cu-swiper-indicator", { "cu-swiper-indicator-active": e - 1 === we.value }])
299
+ }, null, 2))), 128))], 2)) : i("", !0)], 34));
300
+ }
301
+ }), h = /* @__PURE__ */ s({
302
+ name: "cu-swiper-item",
303
+ __name: "SwiperItem",
304
+ props: { isCopy: {
305
+ type: Boolean,
306
+ default: !1
307
+ } },
308
+ setup(e) {
309
+ let t = e, r = l("mdSwiper", null), i = n(() => !r || r.isVertical() ? "auto" : `${r.dimension()}px`), o = n(() => !r || !r.isVertical() ? "auto" : `${r.dimension()}px`), s = c()?.proxy;
310
+ return ie(() => {
311
+ t.isCopy || r && s && r.register(s);
312
+ }), ne(() => {
313
+ t.isCopy || r && s && r.unregister(s);
314
+ }), (e, t) => (f(), a("div", {
315
+ class: "cu-swiper-item",
316
+ style: d({
317
+ width: i.value,
318
+ height: o.value
319
+ })
320
+ }, [se(e.$slots, "default")], 4));
321
+ }
322
+ });
323
+ export { m as n, h as t };
@@ -0,0 +1,31 @@
1
+ import { createElementBlock as e, defineComponent as t, normalizeClass as n, openBlock as r } from "vue";
2
+ // src/components/switch/Switch.vue?vue&type=script&setup=true&lang.ts
3
+ var i = ["aria-checked", "aria-disabled"], a = /* @__PURE__ */ t({
4
+ name: "cu-switch",
5
+ __name: "Switch",
6
+ props: {
7
+ modelValue: {
8
+ type: Boolean,
9
+ default: !1
10
+ },
11
+ disabled: {
12
+ type: Boolean,
13
+ default: !1
14
+ }
15
+ },
16
+ emits: ["update:modelValue", "change"],
17
+ setup(t, { emit: a }) {
18
+ let o = t, s = a;
19
+ function c(e) {
20
+ o.disabled || (s("update:modelValue", !o.modelValue), s("change", e));
21
+ }
22
+ return (a, o) => (r(), e("div", {
23
+ class: n(["cu-switch", [t.disabled ? "disabled" : "", t.modelValue ? "active" : ""]]),
24
+ role: "switch",
25
+ "aria-checked": t.modelValue,
26
+ "aria-disabled": t.disabled,
27
+ onClick: o[0] ||= (e) => c(e)
28
+ }, null, 10, i));
29
+ }
30
+ });
31
+ export { a as t };
@@ -0,0 +1 @@
1
+ let e=require("vue");var t=[`aria-checked`,`aria-disabled`],n=(0,e.defineComponent)({name:`cu-switch`,__name:`Switch`,props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`,`change`],setup(n,{emit:r}){let i=n,a=r;function o(e){i.disabled||(a(`update:modelValue`,!i.modelValue),a(`change`,e))}return(r,i)=>((0,e.openBlock)(),(0,e.createElementBlock)(`div`,{class:(0,e.normalizeClass)([`cu-switch`,[n.disabled?`disabled`:``,n.modelValue?`active`:``]]),role:`switch`,"aria-checked":n.modelValue,"aria-disabled":n.disabled,onClick:i[0]||=e=>o(e)},null,10,t))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
@@ -0,0 +1 @@
1
+ const e=require("./ScrollView-BnadVBJC.cjs");let t=require("vue");var n={class:`cu-tab-bar`},r={class:`cu-tab-bar-start`},i={class:`cu-tab-bar-end`},a=[`onClick`],o=(0,t.defineComponent)({name:`cu-tab-bar`,__name:`TabBar`,props:{modelValue:{default:``},value:{default:``},items:{default:()=>[]},hasInk:{type:Boolean,default:!0},inkLength:{default:`25`},immediate:{type:Boolean,default:!1}},emits:[`change`,`update:modelValue`,`input`],setup(o,{expose:s,emit:c}){let l=o,u=c,d=(0,t.ref)(``),f=(0,t.ref)(0),p=(0,t.ref)(0),m=(0,t.ref)(0),h=(0,t.ref)(0),g=(0,t.ref)(Date.now()),_=(0,t.ref)(!1),v=(0,t.ref)(!0),y=(0,t.ref)(),b=(0,t.ref)(null),x=[];function S(e,t){e&&(x[t]=e)}let C=(0,t.computed)(()=>p.value>f.value),w=(0,t.computed)(()=>{for(let e=0,t=l.items.length;e<t;e++)if(l.items[e].name===d.value)return e;return-1}),T=(0,t.computed)(()=>{if(w.value)return l.items[w.value]});(0,t.watch)(()=>l.modelValue===``?l.value:l.modelValue,e=>{e!==d.value&&(d.value=e)},{immediate:!0}),(0,t.watch)(m,()=>{(0,t.nextTick)(()=>A())}),(0,t.watch)(()=>l.items,()=>{(0,t.nextTick)(()=>A())}),(0,t.watch)(w,()=>{(0,t.nextTick)(()=>A())}),(0,t.watch)(C,()=>{g.value=Date.now()}),d.value===``&&l.items.length&&(d.value=l.items[0].name,u(`change`,l.items[0],0,0)),(0,t.onMounted)(()=>{O()}),(0,t.onActivated)(()=>{O()}),(0,t.onDeactivated)(()=>{k()}),(0,t.onBeforeUnmount)(()=>{k()});function E({scrollLeft:e}){e>0?_.value=!0:_.value=!1,v.value=!(p.value>0&&e>=p.value-f.value)}function D(e,t){e.disabled||(u(`change`,e,t,w.value),d.value=e.name,u(`update:modelValue`,e.name))}function O(){window.addEventListener(`resize`,A),A(),l.immediate&&(0,t.nextTick)(()=>{let e=l.items[w.value];e&&u(`change`,e,w.value,w.value)})}function k(){window.removeEventListener(`resize`,A)}function A(){if(!x.length)return;let e=y.value?.getBoundingClientRect();f.value=e?.width??0;let n=0;for(let e=0,t=l.items.length;e<t;e++){let t=x[e]?.getBoundingClientRect();n+=t?.width??0}p.value=n,b.value?.reflowScroller(),(0,t.nextTick)(()=>{let e=x[w.value];if(!e)return;m.value=typeof l.inkLength==`string`?Number(l.inkLength):e.offsetWidth*l.inkLength/100,h.value=e.offsetLeft+(e.offsetWidth-m.value)/2;let t=x[w.value-1],n=x[w.value+1];if(!t){b.value?.scrollTo(0,0,!0);return}if(!n){b.value?.scrollTo(p.value,0,!0);return}let r=y.value?.getBoundingClientRect(),i=t.getBoundingClientRect(),a=n.getBoundingClientRect();r&&i.left<r.left?b.value?.scrollTo(t.offsetLeft,0,!0):r&&a.right>r.right&&b.value?.scrollTo(n.offsetLeft+n.offsetWidth-f.value,0,!0)})}return s({reflow:A}),(s,c)=>((0,t.openBlock)(),(0,t.createElementBlock)(`nav`,n,[(0,t.createElementVNode)(`div`,{ref_key:`wrapper`,ref:y,class:`cu-tab-bar-inner`},[C.value?((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.withDirectives)((0,t.createElementVNode)(`div`,r,null,512),[[t.vShow,_.value]]),(0,t.withDirectives)((0,t.createElementVNode)(`div`,i,null,512),[[t.vShow,v.value]])],64)):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(),(0,t.createBlock)(e.t,{ref_key:`scroller`,ref:b,"scrolling-x":C.value,"scrolling-y":!1,key:g.value,onScroll:E},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:`cu-tab-bar-list`,style:(0,t.normalizeStyle)({width:p.value+`px`})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.items,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`a`,{key:e.name,ref_for:!0,ref:e=>S(e,n),class:(0,t.normalizeClass)([`cu-tab-bar-item`,{"is-active":d.value===e.name,"is-disabled":!!e.disabled,"more-than-five":o.items.length>5&&n===0}]),onClick:t=>D(e,n)},[(0,t.renderSlot)(s.$slots,`item`,{item:e,items:o.items,index:n,currentName:d.value},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e.label),1)])],10,a))),128))],4),o.hasInk?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)([`cu-tab-bar-ink`,{"is-disabled":T.value&&T.value.disabled}]),style:(0,t.normalizeStyle)({width:m.value+`px`,transform:`translateX(`+h.value+`px)`})},null,6)):(0,t.createCommentVNode)(``,!0)]),_:3},8,[`scrolling-x`]))],512)]))}}),s={class:`cu-tabs`},c={class:`cu-tabs-content`},l=(0,t.defineComponent)({name:`cu-tabs`,__name:`Tabs`,props:{modelValue:{default:void 0},hasInk:{type:Boolean,default:!0},inkLength:{default:25},immediate:{type:Boolean,default:!1}},emits:[`update:modelValue`,`change`],setup(e,{expose:n,emit:r}){let i=e,a=r,l=(0,t.ref)(null),u=(0,t.ref)(i.modelValue),d=(0,t.ref)(0),f=(0,t.ref)([]),p=(0,t.computed)(()=>f.value.map(e=>({name:e.name,label:e.label,disabled:e.disabled}))),m=(0,t.computed)(()=>{for(let e=0,t=p.value.length;e<t;e++)if(p.value[e].name===u.value)return e;return 0});(0,t.provide)(`rootTabs`,{get currentName(){return u.value},get prevIndex(){return d.value},get currentIndex(){return m.value},addPane(e){f.value.indexOf(e)===-1&&f.value.push(e)},removePane(e){let t=f.value.indexOf(e);t>=0&&f.value.splice(t,1)},forceUpdate(){f.value=[...f.value]}}),(0,t.watch)(()=>i.modelValue,e=>{e!==u.value&&(u.value=e)}),(0,t.onMounted)(()=>{!u.value&&p.value.length&&(u.value=p.value[0].name)});function h(e,t,n){u.value=e.name,d.value=n,a(`update:modelValue`,e.name),a(`change`,e)}function g(){l.value?.reflow()}return n({reflowTabBar:g}),(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,s,[(0,t.createVNode)(o,{ref_key:`tabBar`,ref:l,items:p.value,value:u.value,"has-ink":e.hasInk,"ink-length":e.inkLength,immediate:e.immediate,onChange:h,onInput:r[0]||=e=>u.value=e},null,8,[`items`,`value`,`has-ink`,`ink-length`,`immediate`]),(0,t.createElementVNode)(`div`,c,[(0,t.renderSlot)(n.$slots,`default`)])]))}}),u=[`tab`],d=(0,t.defineComponent)({name:`cu-tab-pane`,__name:`TabPane`,props:{label:{default:void 0},name:{default:void 0},disabled:{type:Boolean,default:!1}},setup(e){let n=e,r=(0,t.getCurrentInstance)()?.proxy,i=(0,t.inject)(`rootTabs`,null),a=(0,t.computed)(()=>i?.currentName===n.name),o=(0,t.computed)(()=>i&&i.prevIndex>i.currentIndex?`cu-tab-slide-right`:`cu-tab-slide-left`);return(0,t.watch)(()=>n.label,()=>i?.forceUpdate?.()),(0,t.watch)(()=>n.disabled,()=>i?.forceUpdate?.()),i&&r&&i.addPane(r),(0,t.onBeforeUnmount)(()=>{i&&r&&i.removePane(r)}),(n,r)=>((0,t.openBlock)(),(0,t.createBlock)(t.Transition,{name:o.value},{default:(0,t.withCtx)(()=>[(0,t.withDirectives)((0,t.createElementVNode)(`div`,{class:`cu-tab-pane`,role:`tabpanel`,tab:e.name},[(0,t.renderSlot)(n.$slots,`default`)],8,u),[[t.vShow,a.value]])]),_:3},8,[`name`]))}});Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
@@ -0,0 +1,237 @@
1
+ import { t as e } from "./ScrollView-BNY62f7B.js";
2
+ import { Fragment as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, getCurrentInstance as d, inject as f, nextTick as p, normalizeClass as m, normalizeStyle as h, onActivated as g, onBeforeUnmount as _, onDeactivated as v, onMounted as y, openBlock as b, provide as x, ref as S, renderList as C, renderSlot as w, toDisplayString as T, vShow as E, watch as D, withCtx as O, withDirectives as k } from "vue";
3
+ // src/components/tabs/TabBar.vue?vue&type=script&setup=true&lang.ts
4
+ var A = { class: "cu-tab-bar" }, j = { class: "cu-tab-bar-start" }, M = { class: "cu-tab-bar-end" }, N = ["onClick"], P = /* @__PURE__ */ u({
5
+ name: "cu-tab-bar",
6
+ __name: "TabBar",
7
+ props: {
8
+ modelValue: { default: "" },
9
+ value: { default: "" },
10
+ items: { default: () => [] },
11
+ hasInk: {
12
+ type: Boolean,
13
+ default: !0
14
+ },
15
+ inkLength: { default: "25" },
16
+ immediate: {
17
+ type: Boolean,
18
+ default: !1
19
+ }
20
+ },
21
+ emits: [
22
+ "change",
23
+ "update:modelValue",
24
+ "input"
25
+ ],
26
+ setup(n, { expose: l, emit: u }) {
27
+ let d = n, f = u, x = S(""), P = S(0), F = S(0), I = S(0), L = S(0), R = S(Date.now()), z = S(!1), B = S(!0), V = S(), H = S(null), U = [];
28
+ function W(e, t) {
29
+ e && (U[t] = e);
30
+ }
31
+ let G = r(() => F.value > P.value), K = r(() => {
32
+ for (let e = 0, t = d.items.length; e < t; e++) if (d.items[e].name === x.value) return e;
33
+ return -1;
34
+ }), q = r(() => {
35
+ if (K.value) return d.items[K.value];
36
+ });
37
+ D(() => d.modelValue === "" ? d.value : d.modelValue, (e) => {
38
+ e !== x.value && (x.value = e);
39
+ }, { immediate: !0 }), D(I, () => {
40
+ p(() => Q());
41
+ }), D(() => d.items, () => {
42
+ p(() => Q());
43
+ }), D(K, () => {
44
+ p(() => Q());
45
+ }), D(G, () => {
46
+ R.value = Date.now();
47
+ }), x.value === "" && d.items.length && (x.value = d.items[0].name, f("change", d.items[0], 0, 0)), y(() => {
48
+ X();
49
+ }), g(() => {
50
+ X();
51
+ }), v(() => {
52
+ Z();
53
+ }), _(() => {
54
+ Z();
55
+ });
56
+ function J({ scrollLeft: e }) {
57
+ e > 0 ? z.value = !0 : z.value = !1, B.value = !(F.value > 0 && e >= F.value - P.value);
58
+ }
59
+ function Y(e, t) {
60
+ e.disabled || (f("change", e, t, K.value), x.value = e.name, f("update:modelValue", e.name));
61
+ }
62
+ function X() {
63
+ window.addEventListener("resize", Q), Q(), d.immediate && p(() => {
64
+ let e = d.items[K.value];
65
+ e && f("change", e, K.value, K.value);
66
+ });
67
+ }
68
+ function Z() {
69
+ window.removeEventListener("resize", Q);
70
+ }
71
+ function Q() {
72
+ if (!U.length) return;
73
+ let e = V.value?.getBoundingClientRect();
74
+ P.value = e?.width ?? 0;
75
+ let t = 0;
76
+ for (let e = 0, n = d.items.length; e < n; e++) {
77
+ let n = U[e]?.getBoundingClientRect();
78
+ t += n?.width ?? 0;
79
+ }
80
+ F.value = t, H.value?.reflowScroller(), p(() => {
81
+ let e = U[K.value];
82
+ if (!e) return;
83
+ I.value = typeof d.inkLength == "string" ? Number(d.inkLength) : e.offsetWidth * d.inkLength / 100, L.value = e.offsetLeft + (e.offsetWidth - I.value) / 2;
84
+ let t = U[K.value - 1], n = U[K.value + 1];
85
+ if (!t) {
86
+ H.value?.scrollTo(0, 0, !0);
87
+ return;
88
+ }
89
+ if (!n) {
90
+ H.value?.scrollTo(F.value, 0, !0);
91
+ return;
92
+ }
93
+ let r = V.value?.getBoundingClientRect(), i = t.getBoundingClientRect(), a = n.getBoundingClientRect();
94
+ r && i.left < r.left ? H.value?.scrollTo(t.offsetLeft, 0, !0) : r && a.right > r.right && H.value?.scrollTo(n.offsetLeft + n.offsetWidth - P.value, 0, !0);
95
+ });
96
+ }
97
+ return l({ reflow: Q }), (r, l) => (b(), o("nav", A, [s("div", {
98
+ ref_key: "wrapper",
99
+ ref: V,
100
+ class: "cu-tab-bar-inner"
101
+ }, [G.value ? (b(), o(t, { key: 0 }, [k(s("div", j, null, 512), [[E, z.value]]), k(s("div", M, null, 512), [[E, B.value]])], 64)) : a("", !0), (b(), i(e, {
102
+ ref_key: "scroller",
103
+ ref: H,
104
+ "scrolling-x": G.value,
105
+ "scrolling-y": !1,
106
+ key: R.value,
107
+ onScroll: J
108
+ }, {
109
+ default: O(() => [s("div", {
110
+ class: "cu-tab-bar-list",
111
+ style: h({ width: F.value + "px" })
112
+ }, [(b(!0), o(t, null, C(n.items, (e, t) => (b(), o("a", {
113
+ key: e.name,
114
+ ref_for: !0,
115
+ ref: (e) => W(e, t),
116
+ class: m(["cu-tab-bar-item", {
117
+ "is-active": x.value === e.name,
118
+ "is-disabled": !!e.disabled,
119
+ "more-than-five": n.items.length > 5 && t === 0
120
+ }]),
121
+ onClick: (n) => Y(e, t)
122
+ }, [w(r.$slots, "item", {
123
+ item: e,
124
+ items: n.items,
125
+ index: t,
126
+ currentName: x.value
127
+ }, () => [c(T(e.label), 1)])], 10, N))), 128))], 4), n.hasInk ? (b(), o("span", {
128
+ key: 0,
129
+ class: m(["cu-tab-bar-ink", { "is-disabled": q.value && q.value.disabled }]),
130
+ style: h({
131
+ width: I.value + "px",
132
+ transform: "translateX(" + L.value + "px)"
133
+ })
134
+ }, null, 6)) : a("", !0)]),
135
+ _: 3
136
+ }, 8, ["scrolling-x"]))], 512)]));
137
+ }
138
+ }), F = { class: "cu-tabs" }, I = { class: "cu-tabs-content" }, L = /* @__PURE__ */ u({
139
+ name: "cu-tabs",
140
+ __name: "Tabs",
141
+ props: {
142
+ modelValue: { default: void 0 },
143
+ hasInk: {
144
+ type: Boolean,
145
+ default: !0
146
+ },
147
+ inkLength: { default: 25 },
148
+ immediate: {
149
+ type: Boolean,
150
+ default: !1
151
+ }
152
+ },
153
+ emits: ["update:modelValue", "change"],
154
+ setup(e, { expose: t, emit: n }) {
155
+ let i = e, a = n, c = S(null), u = S(i.modelValue), d = S(0), f = S([]), p = r(() => f.value.map((e) => ({
156
+ name: e.name,
157
+ label: e.label,
158
+ disabled: e.disabled
159
+ }))), m = r(() => {
160
+ for (let e = 0, t = p.value.length; e < t; e++) if (p.value[e].name === u.value) return e;
161
+ return 0;
162
+ });
163
+ x("rootTabs", {
164
+ get currentName() {
165
+ return u.value;
166
+ },
167
+ get prevIndex() {
168
+ return d.value;
169
+ },
170
+ get currentIndex() {
171
+ return m.value;
172
+ },
173
+ addPane(e) {
174
+ f.value.indexOf(e) === -1 && f.value.push(e);
175
+ },
176
+ removePane(e) {
177
+ let t = f.value.indexOf(e);
178
+ t >= 0 && f.value.splice(t, 1);
179
+ },
180
+ forceUpdate() {
181
+ f.value = [...f.value];
182
+ }
183
+ }), D(() => i.modelValue, (e) => {
184
+ e !== u.value && (u.value = e);
185
+ }), y(() => {
186
+ !u.value && p.value.length && (u.value = p.value[0].name);
187
+ });
188
+ function h(e, t, n) {
189
+ u.value = e.name, d.value = n, a("update:modelValue", e.name), a("change", e);
190
+ }
191
+ function g() {
192
+ c.value?.reflow();
193
+ }
194
+ return t({ reflowTabBar: g }), (t, n) => (b(), o("div", F, [l(P, {
195
+ ref_key: "tabBar",
196
+ ref: c,
197
+ items: p.value,
198
+ value: u.value,
199
+ "has-ink": e.hasInk,
200
+ "ink-length": e.inkLength,
201
+ immediate: e.immediate,
202
+ onChange: h,
203
+ onInput: n[0] ||= (e) => u.value = e
204
+ }, null, 8, [
205
+ "items",
206
+ "value",
207
+ "has-ink",
208
+ "ink-length",
209
+ "immediate"
210
+ ]), s("div", I, [w(t.$slots, "default")])]));
211
+ }
212
+ }), R = ["tab"], z = /* @__PURE__ */ u({
213
+ name: "cu-tab-pane",
214
+ __name: "TabPane",
215
+ props: {
216
+ label: { default: void 0 },
217
+ name: { default: void 0 },
218
+ disabled: {
219
+ type: Boolean,
220
+ default: !1
221
+ }
222
+ },
223
+ setup(e) {
224
+ let t = e, a = d()?.proxy, o = f("rootTabs", null), c = r(() => o?.currentName === t.name), l = r(() => o && o.prevIndex > o.currentIndex ? "cu-tab-slide-right" : "cu-tab-slide-left");
225
+ return D(() => t.label, () => o?.forceUpdate?.()), D(() => t.disabled, () => o?.forceUpdate?.()), o && a && o.addPane(a), _(() => {
226
+ o && a && o.removePane(a);
227
+ }), (t, r) => (b(), i(n, { name: l.value }, {
228
+ default: O(() => [k(s("div", {
229
+ class: "cu-tab-pane",
230
+ role: "tabpanel",
231
+ tab: e.name
232
+ }, [w(t.$slots, "default")], 8, R), [[E, c.value]])]),
233
+ _: 3
234
+ }, 8, ["name"]));
235
+ }
236
+ });
237
+ export { L as n, P as r, z as t };
@@ -0,0 +1 @@
1
+ const e=require("./Popup-Ca1jPi0t.cjs"),t=require("./PopupTitleBar-Bfl49eYJ.cjs"),n=require("./Icon-83WWqE5z.cjs"),r=require("./TabPane-BCVsdptu.cjs"),i=require("./ScrollView-BnadVBJC.cjs"),a=require("./RadioList-D-9PITpr.cjs");let o=require("vue"),s=require("@centui/core");var c={class:`cu-tab-picker`},l={class:`cu-tab-picker-content`},u=(0,o.defineComponent)({name:`cu-tab-picker`,__name:`TabPicker`,props:{modelValue:{type:Boolean,default:!1},data:{default:()=>({})},defaultValue:{default:()=>[]},placeholder:{default:()=>String((0,s.t)(`md.tab_picker.choose`))},title:{default:``},describe:{default:``},maskClosable:{type:Boolean,default:!0},largeRadius:{type:Boolean,default:!1}},emits:[`update:modelValue`,`select`,`change`,`show`,`hide`],setup(s,{expose:u,emit:d}){let f=s,p=d,m=(0,o.useSlots)(),h=(0,o.ref)(null),g=(0,o.ref)(null),_=(0,o.ref)(f.defaultValue.slice()),v=(0,o.ref)([]),y=(0,o.ref)(f.data.name??``),b=(0,o.ref)(``),x=(0,o.ref)(Date.now()),S=(0,o.computed)(()=>{let e=m.default;return e?e({option:{}}).some(e=>e.type!==Comment):!1}),C=(0,o.computed)(()=>{let e=[],t=f.data,n=0;for(;t&&t.name;){let r={name:t.name,label:t.label||f.placeholder,value:_.value[n],selected:null,options:t.options??[]},i=!1,a=t.options??[];for(let e=0,o=a.length;e<o;e++)if(a[e].value===_.value[n]){r.label=a[e].label,r.selected=a[e],t=a[e].children,i=!0,n++;break}i||(t=void 0),e.push(r)}return e});(0,o.watch)(C,e=>{let t=e[e.length-1];t&&t.name&&(y.value=t.name)},{immediate:!0});function w(e){p(`update:modelValue`,e)}function T(){h.value?.reflowTabBar(),p(`show`),setTimeout(()=>{v.value=_.value.slice(),b.value=y.value},100)}function E(){p(`update:modelValue`,!1),setTimeout(()=>{_.value=v.value.slice(),y.value=b.value,x.value=Date.now()},100)}function D(e,t){_.value.splice(t,_.value.length-t,e),Promise.resolve().then(()=>{let n=C.value[t+1];p(`select`,{index:t,value:e,option:C.value[t]}),n?(y.value=n.name,g.value?.scrollTo(0,0)):e!==``&&setTimeout(()=>{p(`change`,{values:O(),options:k()}),p(`update:modelValue`,!1)},300)})}function O(){return _.value.slice()}function k(){return C.value.filter(e=>e.value).map(e=>e.selected)}return u({getSelectedValues:O,getSelectedOptions:k}),(u,d)=>((0,o.openBlock)(),(0,o.createElementBlock)(`div`,c,[(0,o.createVNode)(e.t,{"model-value":s.modelValue,position:`bottom`,"mask-closable":s.maskClosable,"onUpdate:modelValue":w,onShow:T,onHide:d[0]||=e=>u.$emit(`hide`),onMaskClick:E},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(t.t,{title:s.title,describe:s.describe,"large-radius":s.largeRadius,"only-close":``,onCancel:E},{cancel:(0,o.withCtx)(()=>[(0,o.createVNode)(n.t,{name:`close`,size:`lg`})]),_:1},8,[`title`,`describe`,`large-radius`]),(0,o.createElementVNode)(`div`,l,[((0,o.openBlock)(),(0,o.createBlock)(r.n,{ref_key:`tabs`,ref:h,"model-value":y.value,key:x.value,"ink-length":100},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(i.t,{ref_key:`scrollView`,ref:g,"scrolling-x":!1,"auto-reflow":``},{default:(0,o.withCtx)(()=>[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(C.value,(e,t)=>((0,o.openBlock)(),(0,o.createBlock)(r.t,{key:e.name,name:e.name,label:e.label},{default:(0,o.withCtx)(()=>[(0,o.createVNode)(a.t,{"model-value":e.value,options:e.options,"is-slot-scope":S.value,icon:``,"icon-inverse":``,"icon-position":`right`,"onUpdate:modelValue":e=>D(e,t)},(0,o.createSlots)({_:2},[S.value?{name:`default`,fn:(0,o.withCtx)(({option:e})=>[(0,o.renderSlot)(u.$slots,`default`,{option:e})]),key:`0`}:void 0]),1032,[`model-value`,`options`,`is-slot-scope`,`onUpdate:modelValue`])]),_:2},1032,[`name`,`label`]))),128))]),_:3},512)]),_:3},8,[`model-value`]))])]),_:3},8,[`model-value`,`mask-closable`])]))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});