@bifrostui/react 1.5.0 → 2.0.0-alpha.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 (560) hide show
  1. package/dist/ActionSheet/ActionSheet.css +16 -6
  2. package/dist/ActionSheet/ActionSheetItem.css +11 -17
  3. package/dist/ActionSheet/ActionSheetItem.js +3 -8
  4. package/dist/ActionSheet/ActionSheetItem.types.d.ts +2 -2
  5. package/dist/ActionSheet/index.css +89 -0
  6. package/dist/Alert/Alert.types.d.ts +3 -3
  7. package/dist/Alert/index.css +18 -14
  8. package/dist/Avatar/Avatar.css +16 -12
  9. package/dist/Avatar/Avatar.js +3 -8
  10. package/dist/Avatar/AvatarGroup.css +19 -15
  11. package/dist/Avatar/AvatarGroup.js +2 -6
  12. package/dist/Avatar/index.css +93 -0
  13. package/dist/Backdrop/Backdrop.d.ts +1 -1
  14. package/dist/Backdrop/Backdrop.js +1 -1
  15. package/dist/Backdrop/{Backdrop.css → index.css} +6 -2
  16. package/dist/Badge/Badge.d.ts +1 -1
  17. package/dist/Badge/Badge.js +4 -9
  18. package/dist/Badge/Badge.types.d.ts +1 -1
  19. package/dist/Badge/{Badge.css → index.css} +47 -27
  20. package/dist/Breadcrumb/Breadcrumb.d.ts +1 -1
  21. package/dist/Breadcrumb/Breadcrumb.js +1 -1
  22. package/dist/Breadcrumb/index.css +38 -0
  23. package/dist/Button/Button.d.ts +1 -1
  24. package/dist/Button/Button.js +6 -11
  25. package/dist/Button/Button.types.d.ts +8 -7
  26. package/{es/Button/Button.css → dist/Button/index.css} +93 -63
  27. package/dist/Calendar/Calendar.d.ts +1 -1
  28. package/dist/Calendar/Calendar.js +10 -22
  29. package/dist/Calendar/Calendar.types.d.ts +0 -5
  30. package/dist/Calendar/{Calendar.css → index.css} +35 -31
  31. package/dist/Card/Card.css +9 -0
  32. package/dist/Card/CardContent.css +1 -2
  33. package/dist/Card/CardFooter.css +2 -4
  34. package/dist/Card/CardHeader.css +5 -5
  35. package/dist/Card/CardHeader.js +2 -2
  36. package/dist/Card/index.css +77 -0
  37. package/dist/Checkbox/Checkbox.d.ts +1 -1
  38. package/dist/Checkbox/Checkbox.js +4 -8
  39. package/dist/Checkbox/CheckboxGroup.d.ts +1 -1
  40. package/dist/Checkbox/CheckboxGroup.js +5 -8
  41. package/dist/Checkbox/{Checkbox.css → index.css} +14 -10
  42. package/dist/CitySelector/CitySelector.miniapp.d.ts +0 -1
  43. package/dist/CitySelector/CitySelector.miniapp.js +0 -1
  44. package/dist/CitySelector/CitySelectorCore.d.ts +1 -1
  45. package/dist/CitySelector/CitySelectorCore.js +1 -1
  46. package/dist/CitySelector/Selector/index.css +4 -4
  47. package/{es/CitySelector/CitySelector.css → dist/CitySelector/index.css} +31 -27
  48. package/dist/Collapse/Collapse.d.ts +2 -2
  49. package/dist/Collapse/Collapse.js +9 -12
  50. package/{es/Collapse/Collapse.css → dist/Collapse/index.css} +1 -0
  51. package/dist/CollapsePanel/CollapsePanel.d.ts +1 -1
  52. package/dist/CollapsePanel/CollapsePanel.js +1 -1
  53. package/dist/CollapsePanel/CollapsePanelItem.js +45 -46
  54. package/dist/CollapsePanel/{CollapsePanel.css → index.css} +12 -10
  55. package/dist/Countdown/Countdown.d.ts +1 -1
  56. package/dist/Countdown/Countdown.js +6 -13
  57. package/{es/Countdown/Countdown.css → dist/Countdown/index.css} +12 -8
  58. package/dist/Dialog/Dialog.types.d.ts +0 -5
  59. package/dist/Dialog/FunctionalDialog.js +2 -13
  60. package/dist/Dialog/index.css +26 -23
  61. package/dist/Divider/Divider.d.ts +1 -1
  62. package/dist/Divider/Divider.js +9 -6
  63. package/dist/Divider/{Divider.css → index.css} +14 -10
  64. package/dist/Drawer/Drawer.d.ts +1 -1
  65. package/dist/Drawer/Drawer.js +5 -11
  66. package/{es/Drawer/Drawer.css → dist/Drawer/index.css} +2 -0
  67. package/dist/Fade/Fade.js +52 -56
  68. package/dist/IconButton/IconButton.d.ts +1 -1
  69. package/dist/IconButton/IconButton.js +7 -14
  70. package/dist/IconButton/IconButton.types.d.ts +4 -3
  71. package/{es/IconButton/IconButton.css → dist/IconButton/index.css} +79 -29
  72. package/dist/Image/Image.js +112 -119
  73. package/dist/Image/index.css +6 -2
  74. package/dist/Input/Input.d.ts +1 -1
  75. package/dist/Input/Input.js +6 -12
  76. package/{es/Input/Input.css → dist/Input/index.css} +22 -16
  77. package/dist/ItemSelector/ItemSelector.miniapp.d.ts +0 -1
  78. package/dist/ItemSelector/ItemSelector.miniapp.js +0 -1
  79. package/dist/ItemSelector/ItemSelectorCore.d.ts +1 -1
  80. package/dist/ItemSelector/ItemSelectorCore.js +1 -1
  81. package/dist/List/List.css +7 -3
  82. package/dist/List/List.js +3 -8
  83. package/dist/List/ListItem.css +3 -3
  84. package/dist/List/ListItem.js +42 -44
  85. package/dist/List/ListItemContent.js +1 -4
  86. package/dist/List/ListItemExtra.js +9 -4
  87. package/dist/List/ListItemFooter.js +9 -4
  88. package/dist/List/ListItemHeader.js +9 -4
  89. package/dist/List/index.css +80 -0
  90. package/dist/Loading/Loading.d.ts +1 -1
  91. package/dist/Loading/Loading.js +14 -5
  92. package/{es/Loading/Loading.css → dist/Loading/index.css} +10 -6
  93. package/dist/Modal/Modal.d.ts +1 -1
  94. package/dist/Modal/Modal.js +1 -7
  95. package/dist/Modal/Modal.miniapp.d.ts +2 -2
  96. package/dist/Modal/Modal.miniapp.js +5 -11
  97. package/dist/NavBar/NavBar.d.ts +1 -1
  98. package/dist/NavBar/NavBar.js +1 -2
  99. package/dist/NavBar/index.css +65 -0
  100. package/dist/Picker/Picker.css +21 -21
  101. package/dist/Picker/Picker.js +6 -28
  102. package/dist/Picker/Picker.types.d.ts +4 -17
  103. package/dist/Picker/PickerPanel.css +8 -12
  104. package/dist/Picker/PickerPanel.js +39 -29
  105. package/dist/Picker/index.css +116 -0
  106. package/dist/Popover/Popover.d.ts +1 -1
  107. package/dist/Popover/Popover.js +28 -71
  108. package/{es/Popover/Popover.css → dist/Popover/index.css} +32 -28
  109. package/dist/Portal/Portal.miniapp.js +4 -7
  110. package/dist/Progress/Progress.d.ts +1 -1
  111. package/dist/Progress/Progress.js +1 -1
  112. package/dist/Progress/index.css +28 -0
  113. package/dist/Radio/Radio.d.ts +1 -1
  114. package/dist/Radio/Radio.js +3 -7
  115. package/dist/Radio/RadioButtonIcon.js +6 -1
  116. package/dist/Radio/RadioGroup.d.ts +1 -1
  117. package/dist/Radio/RadioGroup.js +1 -4
  118. package/dist/Radio/{Radio.css → index.css} +10 -7
  119. package/dist/Rating/Rating.d.ts +1 -1
  120. package/dist/Rating/Rating.js +9 -19
  121. package/{es/Rating/Rating.css → dist/Rating/index.css} +20 -7
  122. package/dist/ScrollView/ScrollView.d.ts +1 -1
  123. package/dist/ScrollView/ScrollView.js +12 -25
  124. package/dist/ScrollView/ScrollView.types.d.ts +1 -0
  125. package/dist/Select/Select.d.ts +1 -1
  126. package/dist/Select/Select.js +43 -76
  127. package/dist/Select/SelectOption.d.ts +1 -1
  128. package/dist/Select/SelectOption.js +1 -1
  129. package/dist/Select/{Select.css → index.css} +30 -20
  130. package/dist/Skeleton/Skeleton.d.ts +1 -1
  131. package/dist/Skeleton/Skeleton.js +6 -10
  132. package/dist/Skeleton/{Skeleton.css → index.css} +7 -3
  133. package/dist/Slide/Slide.js +69 -74
  134. package/dist/Slider/Slider.d.ts +1 -1
  135. package/dist/Slider/Slider.js +13 -29
  136. package/dist/Slider/index.css +111 -0
  137. package/dist/Stack/Stack.d.ts +1 -1
  138. package/dist/Stack/Stack.js +1 -1
  139. package/dist/Steps/Step.css +14 -14
  140. package/dist/Steps/Step.js +81 -82
  141. package/dist/Steps/Steps.css +18 -14
  142. package/dist/Steps/Steps.d.ts +1 -1
  143. package/dist/Steps/Steps.js +57 -60
  144. package/dist/Steps/index.css +199 -0
  145. package/dist/Swiper/Swiper.d.ts +1 -1
  146. package/dist/Swiper/Swiper.js +1 -1
  147. package/{es/Swiper/Swiper.css → dist/Swiper/index.css} +6 -2
  148. package/dist/Switch/Switch.d.ts +1 -1
  149. package/dist/Switch/Switch.js +76 -79
  150. package/dist/Switch/Switch.types.d.ts +1 -1
  151. package/{es/Switch/Switch.css → dist/Switch/index.css} +46 -35
  152. package/dist/TabBar/TabBar.css +12 -8
  153. package/dist/TabBar/TabBar.js +3 -8
  154. package/dist/TabBar/TabBarContext.d.ts +3 -3
  155. package/dist/TabBar/TabBarItem.css +6 -0
  156. package/dist/TabBar/TabBarItem.js +3 -3
  157. package/dist/TabBar/index.css +59 -0
  158. package/dist/TabBar/index.types.d.ts +3 -3
  159. package/dist/Tabs/Tab.css +10 -16
  160. package/dist/Tabs/Tab.js +2 -3
  161. package/dist/Tabs/Tabs.css +32 -21
  162. package/dist/Tabs/Tabs.js +39 -70
  163. package/dist/Tabs/Tabs.types.d.ts +0 -10
  164. package/dist/Tabs/index.css +135 -0
  165. package/dist/Tabs/utils/bound.d.ts +1 -0
  166. package/dist/{DesktopPicker/utils/calcAfterMounted.js → Tabs/utils/bound.js} +14 -7
  167. package/dist/Tag/Tag.css +49 -23
  168. package/dist/Tag/Tag.js +3 -7
  169. package/dist/Tag/Tag.types.d.ts +4 -4
  170. package/dist/Tag/TagGroup.css +15 -11
  171. package/dist/Tag/TagGroup.d.ts +2 -2
  172. package/dist/Tag/TagGroup.js +16 -14
  173. package/dist/Tag/index.css +182 -0
  174. package/dist/TextArea/TextArea.d.ts +1 -1
  175. package/dist/TextArea/TextArea.js +6 -13
  176. package/dist/TextArea/index.css +57 -0
  177. package/dist/ThemeProvider/ThemeProvider.js +1 -4
  178. package/dist/ThemeProvider/ThemeProvider.types.d.ts +5 -10
  179. package/dist/ThemeProvider/utils/constants.d.ts +1 -1
  180. package/dist/ThemeProvider/utils/constants.js +4 -1
  181. package/dist/ThemeProvider/utils/mountTokens.d.ts +4 -4
  182. package/dist/Toast/FunctionalToast.js +2 -13
  183. package/dist/Toast/Toast.d.ts +1 -1
  184. package/dist/Toast/Toast.js +5 -5
  185. package/dist/Toast/Toast.types.d.ts +0 -5
  186. package/dist/Toast/index.css +58 -0
  187. package/dist/Tooltip/Tooltip.d.ts +1 -1
  188. package/dist/Tooltip/Tooltip.js +28 -71
  189. package/dist/Tooltip/index.css +95 -0
  190. package/dist/Transition/TransitionCore.js +3 -8
  191. package/dist/index.d.ts +0 -6
  192. package/dist/index.js +1 -13
  193. package/dist/locales/base.d.ts +0 -11
  194. package/dist/locales/en-US.js +0 -24
  195. package/dist/locales/zh-CN.js +0 -24
  196. package/dist/locales/zh-TW.js +0 -24
  197. package/es/ActionSheet/ActionSheet.css +16 -6
  198. package/es/ActionSheet/ActionSheetItem.css +11 -17
  199. package/es/ActionSheet/ActionSheetItem.js +3 -8
  200. package/es/ActionSheet/ActionSheetItem.types.d.ts +2 -2
  201. package/es/ActionSheet/index.css +89 -0
  202. package/es/Alert/Alert.types.d.ts +3 -3
  203. package/es/Alert/index.css +18 -14
  204. package/es/Avatar/Avatar.css +16 -12
  205. package/es/Avatar/Avatar.js +3 -8
  206. package/es/Avatar/AvatarGroup.css +19 -15
  207. package/es/Avatar/AvatarGroup.js +2 -6
  208. package/es/Avatar/index.css +93 -0
  209. package/es/Backdrop/Backdrop.d.ts +1 -1
  210. package/es/Backdrop/Backdrop.js +1 -1
  211. package/es/Backdrop/{Backdrop.css → index.css} +6 -2
  212. package/es/Badge/Badge.d.ts +1 -1
  213. package/es/Badge/Badge.js +4 -9
  214. package/es/Badge/Badge.types.d.ts +1 -1
  215. package/es/Badge/{Badge.css → index.css} +47 -27
  216. package/es/Breadcrumb/Breadcrumb.d.ts +1 -1
  217. package/es/Breadcrumb/Breadcrumb.js +1 -1
  218. package/es/Breadcrumb/index.css +38 -0
  219. package/es/Button/Button.d.ts +1 -1
  220. package/es/Button/Button.js +6 -11
  221. package/es/Button/Button.types.d.ts +8 -7
  222. package/{dist/Button/Button.css → es/Button/index.css} +93 -63
  223. package/es/Calendar/Calendar.d.ts +1 -1
  224. package/es/Calendar/Calendar.js +10 -22
  225. package/es/Calendar/Calendar.types.d.ts +0 -5
  226. package/es/Calendar/{Calendar.css → index.css} +35 -31
  227. package/es/Card/Card.css +9 -0
  228. package/es/Card/CardContent.css +1 -2
  229. package/es/Card/CardFooter.css +2 -4
  230. package/es/Card/CardHeader.css +5 -5
  231. package/es/Card/CardHeader.js +2 -2
  232. package/es/Card/index.css +77 -0
  233. package/es/Checkbox/Checkbox.d.ts +1 -1
  234. package/es/Checkbox/Checkbox.js +4 -8
  235. package/es/Checkbox/CheckboxGroup.d.ts +1 -1
  236. package/es/Checkbox/CheckboxGroup.js +5 -8
  237. package/es/Checkbox/{Checkbox.css → index.css} +14 -10
  238. package/es/CitySelector/CitySelector.miniapp.d.ts +0 -1
  239. package/es/CitySelector/CitySelector.miniapp.js +0 -1
  240. package/es/CitySelector/CitySelectorCore.d.ts +1 -1
  241. package/es/CitySelector/CitySelectorCore.js +1 -1
  242. package/es/CitySelector/Selector/index.css +4 -4
  243. package/{dist/CitySelector/CitySelector.css → es/CitySelector/index.css} +31 -27
  244. package/es/Collapse/Collapse.d.ts +2 -2
  245. package/es/Collapse/Collapse.js +9 -12
  246. package/{dist/Collapse/Collapse.css → es/Collapse/index.css} +1 -0
  247. package/es/CollapsePanel/CollapsePanel.d.ts +1 -1
  248. package/es/CollapsePanel/CollapsePanel.js +1 -1
  249. package/es/CollapsePanel/CollapsePanelItem.js +45 -46
  250. package/es/CollapsePanel/{CollapsePanel.css → index.css} +12 -10
  251. package/es/Countdown/Countdown.d.ts +1 -1
  252. package/es/Countdown/Countdown.js +6 -13
  253. package/{dist/Countdown/Countdown.css → es/Countdown/index.css} +12 -8
  254. package/es/Dialog/Dialog.types.d.ts +0 -5
  255. package/es/Dialog/FunctionalDialog.js +3 -14
  256. package/es/Dialog/index.css +26 -23
  257. package/es/Divider/Divider.d.ts +1 -1
  258. package/es/Divider/Divider.js +9 -6
  259. package/es/Divider/{Divider.css → index.css} +14 -10
  260. package/es/Drawer/Drawer.d.ts +1 -1
  261. package/es/Drawer/Drawer.js +5 -11
  262. package/{dist/Drawer/Drawer.css → es/Drawer/index.css} +2 -0
  263. package/es/Fade/Fade.js +52 -56
  264. package/es/IconButton/IconButton.d.ts +1 -1
  265. package/es/IconButton/IconButton.js +7 -14
  266. package/es/IconButton/IconButton.types.d.ts +4 -3
  267. package/{dist/IconButton/IconButton.css → es/IconButton/index.css} +79 -29
  268. package/es/Image/Image.js +112 -119
  269. package/es/Image/index.css +6 -2
  270. package/es/Input/Input.d.ts +1 -1
  271. package/es/Input/Input.js +6 -12
  272. package/{dist/Input/Input.css → es/Input/index.css} +22 -16
  273. package/es/ItemSelector/ItemSelector.miniapp.d.ts +0 -1
  274. package/es/ItemSelector/ItemSelector.miniapp.js +0 -1
  275. package/es/ItemSelector/ItemSelectorCore.d.ts +1 -1
  276. package/es/ItemSelector/ItemSelectorCore.js +1 -1
  277. package/es/List/List.css +7 -3
  278. package/es/List/List.js +3 -8
  279. package/es/List/ListItem.css +3 -3
  280. package/es/List/ListItem.js +42 -44
  281. package/es/List/ListItemContent.js +1 -4
  282. package/es/List/ListItemExtra.js +9 -4
  283. package/es/List/ListItemFooter.js +9 -4
  284. package/es/List/ListItemHeader.js +9 -4
  285. package/es/List/index.css +80 -0
  286. package/es/Loading/Loading.d.ts +1 -1
  287. package/es/Loading/Loading.js +14 -5
  288. package/{dist/Loading/Loading.css → es/Loading/index.css} +10 -6
  289. package/es/Modal/Modal.d.ts +1 -1
  290. package/es/Modal/Modal.js +1 -7
  291. package/es/Modal/Modal.miniapp.d.ts +2 -2
  292. package/es/Modal/Modal.miniapp.js +5 -11
  293. package/es/NavBar/NavBar.d.ts +1 -1
  294. package/es/NavBar/NavBar.js +1 -2
  295. package/es/NavBar/index.css +65 -0
  296. package/es/Picker/Picker.css +21 -21
  297. package/es/Picker/Picker.js +6 -28
  298. package/es/Picker/Picker.types.d.ts +4 -17
  299. package/es/Picker/PickerPanel.css +8 -12
  300. package/es/Picker/PickerPanel.js +52 -31
  301. package/es/Picker/index.css +116 -0
  302. package/es/Popover/Popover.d.ts +1 -1
  303. package/es/Popover/Popover.js +30 -74
  304. package/{dist/Popover/Popover.css → es/Popover/index.css} +32 -28
  305. package/es/Portal/Portal.miniapp.js +5 -8
  306. package/es/Progress/Progress.d.ts +1 -1
  307. package/es/Progress/Progress.js +1 -1
  308. package/es/Progress/index.css +28 -0
  309. package/es/Radio/Radio.d.ts +1 -1
  310. package/es/Radio/Radio.js +3 -7
  311. package/es/Radio/RadioButtonIcon.js +6 -1
  312. package/es/Radio/RadioGroup.d.ts +1 -1
  313. package/es/Radio/RadioGroup.js +1 -4
  314. package/es/Radio/{Radio.css → index.css} +10 -7
  315. package/es/Rating/Rating.d.ts +1 -1
  316. package/es/Rating/Rating.js +9 -19
  317. package/{dist/Rating/Rating.css → es/Rating/index.css} +20 -7
  318. package/es/ScrollView/ScrollView.d.ts +1 -1
  319. package/es/ScrollView/ScrollView.js +12 -25
  320. package/es/ScrollView/ScrollView.types.d.ts +1 -0
  321. package/es/Select/Select.d.ts +1 -1
  322. package/es/Select/Select.js +44 -76
  323. package/es/Select/SelectOption.d.ts +1 -1
  324. package/es/Select/SelectOption.js +1 -1
  325. package/es/Select/{Select.css → index.css} +30 -20
  326. package/es/Skeleton/Skeleton.d.ts +1 -1
  327. package/es/Skeleton/Skeleton.js +6 -10
  328. package/es/Skeleton/{Skeleton.css → index.css} +7 -3
  329. package/es/Slide/Slide.js +69 -74
  330. package/es/Slider/Slider.d.ts +1 -1
  331. package/es/Slider/Slider.js +14 -32
  332. package/es/Slider/index.css +111 -0
  333. package/es/Stack/Stack.d.ts +1 -1
  334. package/es/Stack/Stack.js +1 -1
  335. package/es/Steps/Step.css +14 -14
  336. package/es/Steps/Step.js +81 -82
  337. package/es/Steps/Steps.css +18 -14
  338. package/es/Steps/Steps.d.ts +1 -1
  339. package/es/Steps/Steps.js +57 -60
  340. package/es/Steps/index.css +199 -0
  341. package/es/Swiper/Swiper.d.ts +1 -1
  342. package/es/Swiper/Swiper.js +1 -1
  343. package/{dist/Swiper/Swiper.css → es/Swiper/index.css} +6 -2
  344. package/es/Switch/Switch.d.ts +1 -1
  345. package/es/Switch/Switch.js +76 -79
  346. package/es/Switch/Switch.types.d.ts +1 -1
  347. package/{dist/Switch/Switch.css → es/Switch/index.css} +46 -35
  348. package/es/TabBar/TabBar.css +12 -8
  349. package/es/TabBar/TabBar.js +3 -8
  350. package/es/TabBar/TabBarContext.d.ts +3 -3
  351. package/es/TabBar/TabBarItem.css +6 -0
  352. package/es/TabBar/TabBarItem.js +2 -2
  353. package/es/TabBar/index.css +59 -0
  354. package/es/TabBar/index.types.d.ts +3 -3
  355. package/es/Tabs/Tab.css +10 -16
  356. package/es/Tabs/Tab.js +2 -3
  357. package/es/Tabs/Tabs.css +32 -21
  358. package/es/Tabs/Tabs.js +41 -83
  359. package/es/Tabs/Tabs.types.d.ts +0 -10
  360. package/es/Tabs/index.css +135 -0
  361. package/es/Tabs/utils/bound.d.ts +1 -0
  362. package/es/Tabs/utils/bound.js +13 -0
  363. package/es/Tag/Tag.css +49 -23
  364. package/es/Tag/Tag.js +3 -7
  365. package/es/Tag/Tag.types.d.ts +4 -4
  366. package/es/Tag/TagGroup.css +15 -11
  367. package/es/Tag/TagGroup.d.ts +2 -2
  368. package/es/Tag/TagGroup.js +16 -14
  369. package/es/Tag/index.css +182 -0
  370. package/es/TextArea/TextArea.d.ts +1 -1
  371. package/es/TextArea/TextArea.js +6 -13
  372. package/es/TextArea/index.css +57 -0
  373. package/es/ThemeProvider/ThemeProvider.js +1 -4
  374. package/es/ThemeProvider/ThemeProvider.types.d.ts +5 -10
  375. package/es/ThemeProvider/utils/constants.d.ts +1 -1
  376. package/es/ThemeProvider/utils/constants.js +4 -1
  377. package/es/ThemeProvider/utils/mountTokens.d.ts +4 -4
  378. package/es/Toast/FunctionalToast.js +3 -14
  379. package/es/Toast/Toast.d.ts +1 -1
  380. package/es/Toast/Toast.js +5 -5
  381. package/es/Toast/Toast.types.d.ts +0 -5
  382. package/es/Toast/index.css +58 -0
  383. package/es/Tooltip/Tooltip.d.ts +1 -1
  384. package/es/Tooltip/Tooltip.js +30 -74
  385. package/es/Tooltip/index.css +95 -0
  386. package/es/Transition/TransitionCore.js +3 -8
  387. package/es/index.d.ts +0 -6
  388. package/es/index.js +0 -6
  389. package/es/locales/base.d.ts +0 -11
  390. package/es/locales/en-US.js +0 -24
  391. package/es/locales/zh-CN.js +0 -24
  392. package/es/locales/zh-TW.js +0 -24
  393. package/package.json +14 -6
  394. package/dist/Breadcrumb/Breadcrumb.css +0 -34
  395. package/dist/CitySelector/miniapp.css +0 -4
  396. package/dist/Collapse/Collapse.miniapp.d.ts +0 -5
  397. package/dist/Collapse/Collapse.miniapp.js +0 -177
  398. package/dist/DatePicker/DatePicker.d.ts +0 -4
  399. package/dist/DatePicker/DatePicker.js +0 -335
  400. package/dist/DatePicker/DatePicker.types.d.ts +0 -36
  401. package/dist/DatePicker/DatePicker.types.js +0 -15
  402. package/dist/DatePicker/constants.d.ts +0 -9
  403. package/dist/DatePicker/constants.js +0 -37
  404. package/dist/DatePicker/index.d.ts +0 -3
  405. package/dist/DatePicker/index.js +0 -44
  406. package/dist/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
  407. package/dist/DesktopDatePicker/DesktopDatePicker.js +0 -280
  408. package/dist/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
  409. package/dist/DesktopDatePicker/DesktopDatePicker.types.js +0 -15
  410. package/dist/DesktopDatePicker/deskTopPickerContainer.css +0 -100
  411. package/dist/DesktopDatePicker/index.css +0 -61
  412. package/dist/DesktopDatePicker/index.d.ts +0 -2
  413. package/dist/DesktopDatePicker/index.js +0 -41
  414. package/dist/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
  415. package/dist/DesktopDatePicker/useGetDatePickerContent.js +0 -343
  416. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
  417. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -322
  418. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
  419. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -15
  420. package/dist/DesktopDateTimePicker/index.css +0 -66
  421. package/dist/DesktopDateTimePicker/index.d.ts +0 -2
  422. package/dist/DesktopDateTimePicker/index.js +0 -41
  423. package/dist/DesktopPicker/DesktopPicker.d.ts +0 -5
  424. package/dist/DesktopPicker/DesktopPicker.js +0 -243
  425. package/dist/DesktopPicker/DesktopPicker.types.d.ts +0 -61
  426. package/dist/DesktopPicker/DesktopPicker.types.js +0 -15
  427. package/dist/DesktopPicker/index.css +0 -39
  428. package/dist/DesktopPicker/index.d.ts +0 -2
  429. package/dist/DesktopPicker/index.js +0 -41
  430. package/dist/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
  431. package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
  432. package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -38
  433. package/dist/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
  434. package/dist/DesktopTimePicker/DesktopTimePicker.js +0 -288
  435. package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
  436. package/dist/DesktopTimePicker/DesktopTimePicker.types.js +0 -15
  437. package/dist/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
  438. package/dist/DesktopTimePicker/DesktopTimePickerList.js +0 -111
  439. package/dist/DesktopTimePicker/index.css +0 -170
  440. package/dist/DesktopTimePicker/index.d.ts +0 -2
  441. package/dist/DesktopTimePicker/index.js +0 -41
  442. package/dist/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
  443. package/dist/DesktopTimePicker/useGetTimePickerContent.js +0 -249
  444. package/dist/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
  445. package/dist/DesktopTimePicker/utils/scrollUtil.js +0 -27
  446. package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
  447. package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -51
  448. package/dist/DesktopTimePicker/utils/utils.d.ts +0 -28
  449. package/dist/DesktopTimePicker/utils/utils.js +0 -408
  450. package/dist/ItemSelector/miniapp.css +0 -4
  451. package/dist/NavBar/NavBar.css +0 -61
  452. package/dist/Progress/Progress.css +0 -24
  453. package/dist/Slider/Slider.css +0 -106
  454. package/dist/SwipeAction/SwipeAction.css +0 -79
  455. package/dist/SwipeAction/SwipeAction.d.ts +0 -5
  456. package/dist/SwipeAction/SwipeAction.js +0 -349
  457. package/dist/SwipeAction/SwipeAction.types.d.ts +0 -75
  458. package/dist/SwipeAction/SwipeAction.types.js +0 -15
  459. package/dist/SwipeAction/SwipeActionContext.d.ts +0 -4
  460. package/dist/SwipeAction/SwipeActionContext.js +0 -30
  461. package/dist/SwipeAction/SwipeActionItem.css +0 -31
  462. package/dist/SwipeAction/SwipeActionItem.d.ts +0 -5
  463. package/dist/SwipeAction/SwipeActionItem.js +0 -105
  464. package/dist/SwipeAction/constants.d.ts +0 -9
  465. package/dist/SwipeAction/constants.js +0 -39
  466. package/dist/SwipeAction/index.d.ts +0 -5
  467. package/dist/SwipeAction/index.js +0 -50
  468. package/dist/Tabs/utils/scroll.d.ts +0 -2
  469. package/dist/Tabs/utils/scroll.js +0 -55
  470. package/dist/TextArea/TextArea.css +0 -53
  471. package/dist/Toast/Toast.css +0 -53
  472. package/dist/Tooltip/Tooltip.css +0 -91
  473. package/es/Breadcrumb/Breadcrumb.css +0 -34
  474. package/es/CitySelector/miniapp.css +0 -4
  475. package/es/Collapse/Collapse.miniapp.d.ts +0 -5
  476. package/es/Collapse/Collapse.miniapp.js +0 -157
  477. package/es/DatePicker/DatePicker.d.ts +0 -4
  478. package/es/DatePicker/DatePicker.js +0 -308
  479. package/es/DatePicker/DatePicker.types.d.ts +0 -36
  480. package/es/DatePicker/DatePicker.types.js +0 -1
  481. package/es/DatePicker/constants.d.ts +0 -9
  482. package/es/DatePicker/constants.js +0 -14
  483. package/es/DatePicker/index.d.ts +0 -3
  484. package/es/DatePicker/index.js +0 -8
  485. package/es/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
  486. package/es/DesktopDatePicker/DesktopDatePicker.js +0 -253
  487. package/es/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
  488. package/es/DesktopDatePicker/DesktopDatePicker.types.js +0 -1
  489. package/es/DesktopDatePicker/deskTopPickerContainer.css +0 -100
  490. package/es/DesktopDatePicker/index.css +0 -61
  491. package/es/DesktopDatePicker/index.d.ts +0 -2
  492. package/es/DesktopDatePicker/index.js +0 -6
  493. package/es/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
  494. package/es/DesktopDatePicker/useGetDatePickerContent.js +0 -316
  495. package/es/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
  496. package/es/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -295
  497. package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
  498. package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -1
  499. package/es/DesktopDateTimePicker/index.css +0 -66
  500. package/es/DesktopDateTimePicker/index.d.ts +0 -2
  501. package/es/DesktopDateTimePicker/index.js +0 -9
  502. package/es/DesktopPicker/DesktopPicker.d.ts +0 -5
  503. package/es/DesktopPicker/DesktopPicker.js +0 -226
  504. package/es/DesktopPicker/DesktopPicker.types.d.ts +0 -61
  505. package/es/DesktopPicker/DesktopPicker.types.js +0 -1
  506. package/es/DesktopPicker/index.css +0 -39
  507. package/es/DesktopPicker/index.d.ts +0 -2
  508. package/es/DesktopPicker/index.js +0 -6
  509. package/es/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
  510. package/es/DesktopPicker/utils/calcAfterMounted.js +0 -6
  511. package/es/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
  512. package/es/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -9
  513. package/es/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
  514. package/es/DesktopTimePicker/DesktopTimePicker.js +0 -261
  515. package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
  516. package/es/DesktopTimePicker/DesktopTimePicker.types.js +0 -1
  517. package/es/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
  518. package/es/DesktopTimePicker/DesktopTimePickerList.js +0 -84
  519. package/es/DesktopTimePicker/index.css +0 -170
  520. package/es/DesktopTimePicker/index.d.ts +0 -2
  521. package/es/DesktopTimePicker/index.js +0 -6
  522. package/es/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
  523. package/es/DesktopTimePicker/useGetTimePickerContent.js +0 -226
  524. package/es/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
  525. package/es/DesktopTimePicker/utils/scrollUtil.js +0 -8
  526. package/es/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
  527. package/es/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -22
  528. package/es/DesktopTimePicker/utils/utils.d.ts +0 -28
  529. package/es/DesktopTimePicker/utils/utils.js +0 -365
  530. package/es/ItemSelector/miniapp.css +0 -4
  531. package/es/NavBar/NavBar.css +0 -61
  532. package/es/Progress/Progress.css +0 -24
  533. package/es/Slider/Slider.css +0 -106
  534. package/es/SwipeAction/SwipeAction.css +0 -79
  535. package/es/SwipeAction/SwipeAction.d.ts +0 -5
  536. package/es/SwipeAction/SwipeAction.js +0 -334
  537. package/es/SwipeAction/SwipeAction.types.d.ts +0 -75
  538. package/es/SwipeAction/SwipeAction.types.js +0 -1
  539. package/es/SwipeAction/SwipeActionContext.d.ts +0 -4
  540. package/es/SwipeAction/SwipeActionContext.js +0 -11
  541. package/es/SwipeAction/SwipeActionItem.css +0 -31
  542. package/es/SwipeAction/SwipeActionItem.d.ts +0 -5
  543. package/es/SwipeAction/SwipeActionItem.js +0 -78
  544. package/es/SwipeAction/constants.d.ts +0 -9
  545. package/es/SwipeAction/constants.js +0 -15
  546. package/es/SwipeAction/index.d.ts +0 -5
  547. package/es/SwipeAction/index.js +0 -12
  548. package/es/Tabs/utils/scroll.d.ts +0 -2
  549. package/es/Tabs/utils/scroll.js +0 -36
  550. package/es/TextArea/TextArea.css +0 -53
  551. package/es/Toast/Toast.css +0 -53
  552. package/es/Tooltip/Tooltip.css +0 -91
  553. /package/dist/ItemSelector/{ItemSelector.css → index.css} +0 -0
  554. /package/dist/Modal/{Modal.css → index.css} +0 -0
  555. /package/dist/ScrollView/{ScrollView.css → index.css} +0 -0
  556. /package/dist/Stack/{Stack.css → index.css} +0 -0
  557. /package/es/ItemSelector/{ItemSelector.css → index.css} +0 -0
  558. /package/es/Modal/{Modal.css → index.css} +0 -0
  559. /package/es/ScrollView/{ScrollView.css → index.css} +0 -0
  560. /package/es/Stack/{Stack.css → index.css} +0 -0
@@ -1,34 +0,0 @@
1
- .bui-breadcrumb {
2
- --margin: var(--bui-breadcrumb-margin, 0);
3
- --padding: var(--bui-breadcrumb-padding, 0);
4
- --color: var(--bui-breadcrumb-color, rgba(0, 0, 0, 0.45));
5
- --item-separator-margin: var(--bui-breadcrumb-item-separator-margin, 0 8px);
6
- --list-li-color: var(--bui-breadcrumb-list-li-color, rgba(0, 0, 0, 0.88));
7
- margin: var(--margin);
8
- padding: var(--padding);
9
- color: var(--color);
10
- list-style: none;
11
- font-size: var(--bui-text-size-1);
12
- line-height: var(--bui-line-height);
13
- }
14
- .bui-breadcrumb-list {
15
- display: flex;
16
- flex-wrap: wrap;
17
- margin: var(--margin);
18
- padding: var(--padding);
19
- list-style: none;
20
- }
21
- .bui-breadcrumb-list a {
22
- color: var(--color);
23
- text-decoration: none;
24
- cursor: pointer;
25
- }
26
- .bui-breadcrumb-list li:last-child {
27
- color: var(--list-li-color);
28
- }
29
- .bui-breadcrumb-item {
30
- cursor: pointer;
31
- }
32
- .bui-breadcrumb-item-separator {
33
- margin: var(--item-separator-margin);
34
- }
@@ -1,4 +0,0 @@
1
- .bui-city-scroll-view-container {
2
- height: 100%;
3
- display: block;
4
- }
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { CollapseProps } from './Collapse.types';
3
- import './Collapse.less';
4
- declare const Collapse: React.ForwardRefExoticComponent<CollapseProps & React.RefAttributes<HTMLElement>>;
5
- export default Collapse;
@@ -1,177 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues = (a, b) => {
13
- for (var prop in b || (b = {}))
14
- if (__hasOwnProp.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- if (__getOwnPropSymbols)
17
- for (var prop of __getOwnPropSymbols(b)) {
18
- if (__propIsEnum.call(b, prop))
19
- __defNormalProp(a, prop, b[prop]);
20
- }
21
- return a;
22
- };
23
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __objRest = (source, exclude) => {
25
- var target = {};
26
- for (var prop in source)
27
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
- target[prop] = source[prop];
29
- if (source != null && __getOwnPropSymbols)
30
- for (var prop of __getOwnPropSymbols(source)) {
31
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
- target[prop] = source[prop];
33
- }
34
- return target;
35
- };
36
- var __export = (target, all) => {
37
- for (var name in all)
38
- __defProp(target, name, { get: all[name], enumerable: true });
39
- };
40
- var __copyProps = (to, from, except, desc) => {
41
- if (from && typeof from === "object" || typeof from === "function") {
42
- for (let key of __getOwnPropNames(from))
43
- if (!__hasOwnProp.call(to, key) && key !== except)
44
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
45
- }
46
- return to;
47
- };
48
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
49
- // If the importer is in node compatibility mode or this is not an ESM
50
- // file that has been converted to a CommonJS file using a Babel-
51
- // compatible transform (i.e. "__esModule" has not been set), then set
52
- // "default" to the CommonJS "module.exports" for node compatibility.
53
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
54
- mod
55
- ));
56
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
57
- var Collapse_miniapp_exports = {};
58
- __export(Collapse_miniapp_exports, {
59
- default: () => Collapse_miniapp_default
60
- });
61
- module.exports = __toCommonJS(Collapse_miniapp_exports);
62
- var import_react = __toESM(require("react"));
63
- var import_utils = require("@bifrostui/utils");
64
- var import_Transition = require("../Transition");
65
- var import_Collapse2 = require("./Collapse.css");
66
- const defaultEasing = {
67
- enter: import_utils.easing.easeOut,
68
- exit: import_utils.easing.sharp
69
- };
70
- const defaultTimeout = {
71
- enter: import_utils.duration.enteringScreen,
72
- exit: import_utils.duration.leavingScreen
73
- };
74
- const FIT_CONTENT = "fit-content";
75
- const Collapse = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
76
- const _a = props, {
77
- appear = false,
78
- in: inProp,
79
- easing: easingProp = defaultEasing,
80
- direction = "vertical",
81
- timeout = defaultTimeout,
82
- delay = 0,
83
- collapsedSize: collapsedSizeProp = 0,
84
- style,
85
- className,
86
- children
87
- } = _a, other = __objRest(_a, [
88
- "appear",
89
- "in",
90
- "easing",
91
- "direction",
92
- "timeout",
93
- "delay",
94
- "collapsedSize",
95
- "style",
96
- "className",
97
- "children"
98
- ]);
99
- const wrapperRef = (0, import_react.useRef)(null);
100
- const collapseRef = (0, import_utils.useForkRef)(wrapperRef, ref);
101
- const [wrapperSize, setWrapperSize] = (0, import_react.useState)("");
102
- const transitions = (0, import_utils.createTransitions)();
103
- const isHorizontal = direction === "horizontal";
104
- const collapsedSize = typeof collapsedSizeProp === "number" ? `${collapsedSizeProp}px` : collapsedSizeProp;
105
- const size = isHorizontal ? "width" : "height";
106
- const getCollapseWrapperSize = (reactNode) => {
107
- return new Promise((resolve) => {
108
- var _a2;
109
- const reactNodeChild = (_a2 = reactNode == null ? void 0 : reactNode.children) == null ? void 0 : _a2[0];
110
- if (!reactNodeChild) {
111
- resolve(FIT_CONTENT);
112
- }
113
- (0, import_utils.getBoundingClientRect)(reactNodeChild).then((res) => {
114
- if (!res) {
115
- resolve(FIT_CONTENT);
116
- setWrapperSize(FIT_CONTENT);
117
- } else {
118
- setWrapperSize(isHorizontal ? `${res == null ? void 0 : res.width}px` : `${res == null ? void 0 : res.height}px`);
119
- }
120
- });
121
- });
122
- };
123
- (0, import_react.useEffect)(() => {
124
- if (appear === false && inProp === true && wrapperSize === FIT_CONTENT) {
125
- getCollapseWrapperSize(wrapperRef.current).then((res) => {
126
- setWrapperSize(res);
127
- });
128
- }
129
- }, [appear, inProp]);
130
- if (!children)
131
- return null;
132
- return /* @__PURE__ */ import_react.default.createElement(
133
- import_Transition.Transition,
134
- __spreadProps(__spreadValues({}, other), {
135
- in: inProp,
136
- timeout,
137
- delay,
138
- appear
139
- }),
140
- (state, childProps) => {
141
- var _a2;
142
- const transition = transitions.create(
143
- size,
144
- (0, import_utils.getTransitionProps)(
145
- { timeout, style, easing: easingProp, delay },
146
- { mode: state }
147
- )
148
- );
149
- if (state === "entering" || state === "entered") {
150
- getCollapseWrapperSize(wrapperRef.current).then(
151
- (res = FIT_CONTENT) => {
152
- setWrapperSize(res);
153
- }
154
- );
155
- } else {
156
- setWrapperSize(collapsedSize);
157
- }
158
- return import_react.default.createElement(
159
- "div",
160
- __spreadProps(__spreadValues({
161
- className: `bui-collapse ${className || ""}`,
162
- style: __spreadValues(__spreadProps(__spreadValues({}, style), {
163
- transition,
164
- WebkitTransition: transition
165
- }), isHorizontal ? { width: wrapperSize, WebKitWidth: wrapperSize } : { height: wrapperSize, WebKitHeight: wrapperSize })
166
- }, childProps), {
167
- ref: collapseRef
168
- }),
169
- import_react.default.cloneElement(children, {
170
- style: __spreadValues({}, (_a2 = children.props) == null ? void 0 : _a2.style)
171
- })
172
- );
173
- }
174
- );
175
- });
176
- Collapse.displayName = "BuiCollapse";
177
- var Collapse_miniapp_default = Collapse;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { DatePickerProps } from './DatePicker.types';
3
- declare const DatePicker: React.ForwardRefExoticComponent<Omit<DatePickerProps<"div", Omit<import("../Picker").PickerProps<"div", import("..").DrawerProps>, "value" | "defaultValue" | "onChange" | "onClose" | "onConfirm">>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
- export default DatePicker;
@@ -1,335 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __defProps = Object.defineProperties;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
- var __getProtoOf = Object.getPrototypeOf;
9
- var __hasOwnProp = Object.prototype.hasOwnProperty;
10
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
- var __spreadValues = (a, b) => {
13
- for (var prop in b || (b = {}))
14
- if (__hasOwnProp.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- if (__getOwnPropSymbols)
17
- for (var prop of __getOwnPropSymbols(b)) {
18
- if (__propIsEnum.call(b, prop))
19
- __defNormalProp(a, prop, b[prop]);
20
- }
21
- return a;
22
- };
23
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
- var __objRest = (source, exclude) => {
25
- var target = {};
26
- for (var prop in source)
27
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
- target[prop] = source[prop];
29
- if (source != null && __getOwnPropSymbols)
30
- for (var prop of __getOwnPropSymbols(source)) {
31
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
- target[prop] = source[prop];
33
- }
34
- return target;
35
- };
36
- var __export = (target, all) => {
37
- for (var name in all)
38
- __defProp(target, name, { get: all[name], enumerable: true });
39
- };
40
- var __copyProps = (to, from, except, desc) => {
41
- if (from && typeof from === "object" || typeof from === "function") {
42
- for (let key of __getOwnPropNames(from))
43
- if (!__hasOwnProp.call(to, key) && key !== except)
44
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
45
- }
46
- return to;
47
- };
48
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
49
- // If the importer is in node compatibility mode or this is not an ESM
50
- // file that has been converted to a CommonJS file using a Babel-
51
- // compatible transform (i.e. "__esModule" has not been set), then set
52
- // "default" to the CommonJS "module.exports" for node compatibility.
53
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
54
- mod
55
- ));
56
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
57
- var DatePicker_exports = {};
58
- __export(DatePicker_exports, {
59
- default: () => DatePicker_default
60
- });
61
- module.exports = __toCommonJS(DatePicker_exports);
62
- var import_react = __toESM(require("react"));
63
- var import_clsx = __toESM(require("clsx"));
64
- var import_utils = require("@bifrostui/utils");
65
- var import_Picker = __toESM(require("../Picker"));
66
- var import_locales = require("../locales");
67
- var import_constants = require("./constants");
68
- const MIN_DATE = new Date((/* @__PURE__ */ new Date()).getFullYear() - 10, 0, 1);
69
- const MAX_DATE = new Date((/* @__PURE__ */ new Date()).getFullYear() + 10, 11, 31);
70
- const DEFAULT_PICKER = [
71
- import_constants.DatePickerType.YEAR,
72
- import_constants.DatePickerType.MONTH,
73
- import_constants.DatePickerType.DAY
74
- ];
75
- function isValidDate(value) {
76
- return value instanceof Date && !Number.isNaN(value.getTime());
77
- }
78
- const padZero = (num, targetLength = 2) => {
79
- let str = `${num}`;
80
- while (str.length < targetLength) {
81
- str = `0${str}`;
82
- }
83
- return str;
84
- };
85
- const getMaxDay = (year, monthIndex) => {
86
- return new Date(year, monthIndex + 1, 0).getDate();
87
- };
88
- const getDateTypeValue = (date, type) => {
89
- switch (type) {
90
- case import_constants.DatePickerType.YEAR:
91
- return date.getFullYear();
92
- case import_constants.DatePickerType.MONTH:
93
- return date.getMonth() + 1;
94
- case import_constants.DatePickerType.DAY:
95
- return date.getDate();
96
- case import_constants.DatePickerType.HOUR:
97
- return date.getHours();
98
- case import_constants.DatePickerType.MINUTE:
99
- return date.getMinutes();
100
- case import_constants.DatePickerType.SECOND:
101
- return date.getSeconds();
102
- default:
103
- throw new Error(`\u9519\u8BEF\u7684picker\u7C7B\u578B\uFF1A${type}`);
104
- }
105
- };
106
- const DatePicker = (0, import_react.forwardRef)((props, ref) => {
107
- const _a = props, {
108
- className,
109
- value: propValue,
110
- defaultValue,
111
- views = DEFAULT_PICKER,
112
- minDate: propMinDate = MIN_DATE,
113
- maxDate: propMaxDate = MAX_DATE,
114
- showUnit = false,
115
- formatter,
116
- filter,
117
- disableDateTimeView,
118
- dateTimeStep,
119
- onConfirm,
120
- onClose,
121
- onChange
122
- } = _a, others = __objRest(_a, [
123
- "className",
124
- "value",
125
- "defaultValue",
126
- "views",
127
- "minDate",
128
- "maxDate",
129
- "showUnit",
130
- "formatter",
131
- "filter",
132
- "disableDateTimeView",
133
- "dateTimeStep",
134
- "onConfirm",
135
- "onClose",
136
- "onChange"
137
- ]);
138
- const [options, setOptions] = (0, import_react.useState)([]);
139
- const [pickerValue, setPickerValue] = (0, import_react.useState)([]);
140
- const datePickerText = (0, import_locales.useLocaleText)("datePicker");
141
- const formatDate = (date) => {
142
- let formattedDate = date;
143
- if (!formattedDate || !isValidDate(date) || formattedDate.getTime() < propMinDate.getTime()) {
144
- formattedDate = propMinDate;
145
- }
146
- if (formattedDate.getTime() > propMaxDate.getTime()) {
147
- formattedDate = propMaxDate;
148
- }
149
- return formattedDate;
150
- };
151
- const [currentDate, triggerChange] = (0, import_utils.useValue)({
152
- value: propValue && formatDate(propValue),
153
- defaultValue: formatDate(defaultValue)
154
- });
155
- const handleConfirm = (e) => {
156
- onConfirm == null ? void 0 : onConfirm(e, { value: currentDate });
157
- };
158
- const handleClose = (e) => {
159
- onClose == null ? void 0 : onClose(e, { value: currentDate });
160
- };
161
- const handleChange = (e, { value, columnIndex }) => {
162
- if (value[columnIndex] === null)
163
- return;
164
- const current = new Date(currentDate);
165
- switch (views[columnIndex]) {
166
- case import_constants.DatePickerType.YEAR:
167
- current.setFullYear(value[columnIndex]);
168
- break;
169
- case import_constants.DatePickerType.MONTH: {
170
- const selectedMaxDay = getMaxDay(
171
- current.getFullYear(),
172
- Number(value[columnIndex]) - 1
173
- );
174
- if (current.getDate() > selectedMaxDay) {
175
- current.setDate(selectedMaxDay);
176
- }
177
- current.setMonth(value[columnIndex] - 1);
178
- break;
179
- }
180
- case import_constants.DatePickerType.DAY:
181
- current.setDate(value[columnIndex]);
182
- break;
183
- case import_constants.DatePickerType.HOUR:
184
- current.setHours(value[columnIndex]);
185
- break;
186
- case import_constants.DatePickerType.MINUTE:
187
- current.setMinutes(value[columnIndex]);
188
- break;
189
- case import_constants.DatePickerType.SECOND:
190
- current.setSeconds(value[columnIndex]);
191
- break;
192
- default:
193
- throw new Error(`\u9519\u8BEF\u7684picker\u7C7B\u578B\uFF1A${views[columnIndex]}`);
194
- }
195
- triggerChange(e, formatDate(current));
196
- onChange == null ? void 0 : onChange(e, { type: views[columnIndex], value: current });
197
- };
198
- const formatOption = (type, value) => {
199
- let label = padZero(value);
200
- if (formatter) {
201
- return formatter(type, {
202
- value,
203
- label
204
- });
205
- }
206
- if (showUnit) {
207
- label += datePickerText[type];
208
- }
209
- return { value, label };
210
- };
211
- const generateOptions = (min, max, type, columnIndex) => {
212
- const step = (dateTimeStep == null ? void 0 : dateTimeStep[type]) || 1;
213
- let valueIndex = 0;
214
- const optionsArray = Array.from(
215
- { length: (max - min + 1) / step || 1 },
216
- (_, index) => {
217
- const value = index * step + min;
218
- if (value <= getDateTypeValue(currentDate, type)) {
219
- valueIndex = index;
220
- }
221
- return formatOption(type, value);
222
- }
223
- );
224
- pickerValue[columnIndex] = optionsArray[valueIndex].value;
225
- setPickerValue([...pickerValue]);
226
- if ((disableDateTimeView == null ? void 0 : disableDateTimeView[type]) && typeof disableDateTimeView[type] === "function") {
227
- const disabledOptionsValue = disableDateTimeView[type](
228
- optionsArray.map((i) => i.value)
229
- );
230
- return optionsArray.map((option) => {
231
- if (disabledOptionsValue.includes(option.value)) {
232
- return __spreadProps(__spreadValues({}, option), {
233
- disabled: true
234
- });
235
- }
236
- return option;
237
- });
238
- }
239
- if (filter) {
240
- return filter(type, optionsArray);
241
- }
242
- return optionsArray;
243
- };
244
- const getBoundary = (type, value) => {
245
- const boundary = type === "min" ? propMinDate : propMaxDate;
246
- const year = boundary.getFullYear();
247
- let month = 1;
248
- let date = 1;
249
- let hour = 0;
250
- let minute = 0;
251
- let seconds = 0;
252
- if (type === "max") {
253
- month = 12;
254
- date = getMaxDay(value.getFullYear(), value.getMonth());
255
- hour = 23;
256
- minute = 59;
257
- seconds = 59;
258
- }
259
- if (value.getFullYear() === year) {
260
- month = boundary.getMonth() + 1;
261
- if (value.getMonth() + 1 === month) {
262
- date = boundary.getDate();
263
- if (value.getDate() === date) {
264
- hour = boundary.getHours();
265
- if (value.getHours() === hour) {
266
- minute = boundary.getMinutes();
267
- if (value.getMinutes() === minute) {
268
- seconds = boundary.getSeconds();
269
- }
270
- }
271
- }
272
- }
273
- }
274
- return {
275
- [`${type}Year`]: year,
276
- [`${type}Month`]: month,
277
- [`${type}Date`]: date,
278
- [`${type}Hour`]: hour,
279
- [`${type}Minute`]: minute,
280
- [`${type}Seconds`]: seconds
281
- };
282
- };
283
- const generateRanges = () => {
284
- const ranges = [];
285
- const { minYear, minMonth, minDate, minHour, minMinute, minSeconds } = getBoundary("min", currentDate);
286
- const { maxYear, maxMonth, maxDate, maxHour, maxMinute, maxSeconds } = getBoundary("max", currentDate);
287
- for (let i = 0; i < views.length; i += 1) {
288
- const type = views[i];
289
- switch (type) {
290
- case import_constants.DatePickerType.YEAR:
291
- ranges.push([minYear, maxYear]);
292
- break;
293
- case import_constants.DatePickerType.MONTH:
294
- ranges.push([minMonth, maxMonth]);
295
- break;
296
- case import_constants.DatePickerType.DAY:
297
- ranges.push([minDate, maxDate]);
298
- break;
299
- case import_constants.DatePickerType.HOUR:
300
- ranges.push([minHour, maxHour]);
301
- break;
302
- case import_constants.DatePickerType.MINUTE:
303
- ranges.push([minMinute, maxMinute]);
304
- break;
305
- case import_constants.DatePickerType.SECOND:
306
- ranges.push([minSeconds, maxSeconds]);
307
- break;
308
- default:
309
- throw new Error(`\u9519\u8BEF\u7684picker\u7C7B\u578B\uFF1A${type}`);
310
- }
311
- }
312
- return ranges;
313
- };
314
- const generateRangeOptions = () => generateRanges().map(
315
- (range, index) => generateOptions(range[0], range[1], views[index], index)
316
- );
317
- (0, import_react.useEffect)(() => {
318
- setOptions(generateRangeOptions());
319
- }, [currentDate, views, propMinDate, propMaxDate]);
320
- return /* @__PURE__ */ import_react.default.createElement(
321
- import_Picker.default,
322
- __spreadProps(__spreadValues({}, others), {
323
- "data-selected": currentDate ? currentDate.getTime() : "",
324
- className: (0, import_clsx.default)("bui-date-picker", className),
325
- ref,
326
- options,
327
- value: pickerValue,
328
- onConfirm: handleConfirm,
329
- onClose: handleClose,
330
- onOptionChange: handleChange
331
- })
332
- );
333
- });
334
- DatePicker.displayName = "BuiDatePicker";
335
- var DatePicker_default = DatePicker;
@@ -1,36 +0,0 @@
1
- import React from 'react';
2
- import { OverrideProps } from '@bifrostui/types';
3
- import { PickerProps, IPickerOptionItem } from '../Picker';
4
- import { DatePickerType } from './constants';
5
- export type DatePickerOption = IPickerOptionItem & {
6
- value: number;
7
- };
8
- export type DatePickerProps<D extends React.ElementType = 'div', P = Omit<PickerProps, 'value' | 'defaultValue' | 'onChange' | 'onConfirm' | 'onClose'>> = OverrideProps<{
9
- props: P & {
10
- defaultValue?: Date;
11
- value?: Date;
12
- views?: DatePickerType[];
13
- minDate?: Date;
14
- maxDate?: Date;
15
- showUnit?: boolean;
16
- disableDateTimeView?: Partial<{
17
- [key in DatePickerType]: (options: number[]) => number[];
18
- }>;
19
- dateTimeStep?: Partial<{
20
- [key in DatePickerType]: number;
21
- }>;
22
- formatter?: (type: DatePickerType, option: DatePickerOption) => DatePickerOption;
23
- filter?: (type: DatePickerType, options: DatePickerOption[]) => DatePickerOption[];
24
- onConfirm?: (e: React.SyntheticEvent, { value }: {
25
- value: Date;
26
- }) => void;
27
- onClose?: (e: React.SyntheticEvent, { value }: {
28
- value: Date;
29
- }) => void;
30
- onChange?: (e: React.SyntheticEvent, { value }: {
31
- type: DatePickerType;
32
- value: Date;
33
- }) => void;
34
- };
35
- defaultComponent: D;
36
- }, D>;
@@ -1,15 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from === "object" || typeof from === "function") {
7
- for (let key of __getOwnPropNames(from))
8
- if (!__hasOwnProp.call(to, key) && key !== except)
9
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
- }
11
- return to;
12
- };
13
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
14
- var DatePicker_types_exports = {};
15
- module.exports = __toCommonJS(DatePicker_types_exports);
@@ -1,9 +0,0 @@
1
- export declare enum DatePickerType {
2
- YEAR = "year",
3
- MONTH = "month",
4
- DAY = "day",
5
- HOUR = "hour",
6
- MINUTE = "minute",
7
- SECOND = "second"
8
- }
9
- export default DatePickerType;
@@ -1,37 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var constants_exports = {};
19
- __export(constants_exports, {
20
- DatePickerType: () => DatePickerType,
21
- default: () => constants_default
22
- });
23
- module.exports = __toCommonJS(constants_exports);
24
- var DatePickerType = /* @__PURE__ */ ((DatePickerType2) => {
25
- DatePickerType2["YEAR"] = "year";
26
- DatePickerType2["MONTH"] = "month";
27
- DatePickerType2["DAY"] = "day";
28
- DatePickerType2["HOUR"] = "hour";
29
- DatePickerType2["MINUTE"] = "minute";
30
- DatePickerType2["SECOND"] = "second";
31
- return DatePickerType2;
32
- })(DatePickerType || {});
33
- var constants_default = DatePickerType;
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- DatePickerType
37
- });
@@ -1,3 +0,0 @@
1
- export { default, default as DatePicker } from './DatePicker';
2
- export * from './DatePicker.types';
3
- export { DatePickerType } from './constants';