@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,5 +0,0 @@
1
- import React from 'react';
2
- import { SwipeActionProps, SwipeActionRef } from './SwipeAction.types';
3
- import './SwipeAction.less';
4
- declare const SwipeAction: React.ForwardRefExoticComponent<Omit<SwipeActionProps<"div", {}>, "ref"> & React.RefAttributes<SwipeActionRef>>;
5
- export default SwipeAction;
@@ -1,334 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- var __objRest = (source, exclude) => {
18
- var target = {};
19
- for (var prop in source)
20
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
- target[prop] = source[prop];
22
- if (source != null && __getOwnPropSymbols)
23
- for (var prop of __getOwnPropSymbols(source)) {
24
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
- target[prop] = source[prop];
26
- }
27
- return target;
28
- };
29
- var __async = (__this, __arguments, generator) => {
30
- return new Promise((resolve, reject) => {
31
- var fulfilled = (value) => {
32
- try {
33
- step(generator.next(value));
34
- } catch (e) {
35
- reject(e);
36
- }
37
- };
38
- var rejected = (value) => {
39
- try {
40
- step(generator.throw(value));
41
- } catch (e) {
42
- reject(e);
43
- }
44
- };
45
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
46
- step((generator = generator.apply(__this, __arguments)).next());
47
- });
48
- };
49
- import React, {
50
- useImperativeHandle,
51
- useRef,
52
- useState,
53
- useEffect,
54
- useMemo
55
- } from "react";
56
- import clsx from "clsx";
57
- import {
58
- useTouch,
59
- touchEmulator,
60
- isMini,
61
- getBoundingClientRect,
62
- throttle
63
- } from "@bifrostui/utils";
64
- import BuiSwipeActionContext from "./SwipeActionContext";
65
- import { DragPhaseEnum, SideTypeEnum } from "./constants";
66
- import "./SwipeAction.css";
67
- const classPrefix = "bui-swipe-action";
68
- const SwipeAction = /* @__PURE__ */ React.forwardRef(
69
- (props, ref) => {
70
- const _a = props, {
71
- className,
72
- children,
73
- rightActions,
74
- leftActions,
75
- disabled,
76
- closeOnClickActionItem = true,
77
- closeOnClickContainer = false,
78
- onActionsReveal
79
- } = _a, others = __objRest(_a, [
80
- "className",
81
- "children",
82
- "rightActions",
83
- "leftActions",
84
- "disabled",
85
- "closeOnClickActionItem",
86
- "closeOnClickContainer",
87
- "onActionsReveal"
88
- ]);
89
- const touch = useTouch();
90
- const rootRef = useRef(null);
91
- const leftRef = useRef(null);
92
- const rightRef = useRef(null);
93
- const contentRef = useRef(null);
94
- const [translateX, setTranslateX] = useState(0);
95
- const [isOpen, setIsOpen] = useState(false);
96
- const startingX = useRef(0);
97
- const currentX = useRef(0);
98
- const isDragging = useRef(false);
99
- let pretranslateX = 0;
100
- let dragPhase = DragPhaseEnum.START;
101
- const dragThreshold = 5;
102
- const leftWidthCache = useRef(0);
103
- const rightWidthCache = useRef(0);
104
- const getWidth = (_ref) => {
105
- if (!_ref.current)
106
- return Promise.resolve(0);
107
- return new Promise((resolve) => {
108
- if (isMini) {
109
- getBoundingClientRect(_ref.current).then((rect) => {
110
- if (rect) {
111
- resolve(rect.width || 0);
112
- }
113
- });
114
- } else {
115
- resolve(_ref.current.offsetWidth);
116
- }
117
- });
118
- };
119
- const getLefRefWidth = () => __async(void 0, null, function* () {
120
- if (leftRef.current && leftActions && !leftWidthCache.current) {
121
- leftWidthCache.current = yield getWidth(leftRef);
122
- }
123
- return leftWidthCache.current;
124
- });
125
- const getRightRefWidth = () => __async(void 0, null, function* () {
126
- if (rightRef.current && rightActions && !rightWidthCache.current) {
127
- rightWidthCache.current = yield getWidth(rightRef);
128
- }
129
- return rightWidthCache.current;
130
- });
131
- const initRefWidth = () => {
132
- getLefRefWidth();
133
- getRightRefWidth();
134
- };
135
- const handleTouchStart = (e) => {
136
- dragPhase = DragPhaseEnum.START;
137
- const isMaskEle = e.target.id === "content-mask";
138
- if (isDragging.current || disabled || isMaskEle)
139
- return;
140
- touch.start(e);
141
- isDragging.current = true;
142
- startingX.current = touch.deltaX.current - translateX;
143
- };
144
- const handleTouchMove = throttle(
145
- (e) => __async(void 0, null, function* () {
146
- if (!isDragging.current || disabled)
147
- return;
148
- if (dragPhase === DragPhaseEnum.START) {
149
- dragPhase = DragPhaseEnum.MOVE;
150
- }
151
- touch.move(e);
152
- currentX.current = touch.deltaX.current - startingX.current;
153
- if (Math.abs(currentX.current) < dragThreshold)
154
- return;
155
- const leftWidth = yield getLefRefWidth();
156
- const rightWidth = yield getRightRefWidth();
157
- currentX.current = Math.max(
158
- -rightWidth,
159
- Math.min(leftWidth, currentX.current)
160
- );
161
- setTranslateX(currentX.current);
162
- }),
163
- 100
164
- );
165
- const emitActionsReveal = (targetX, stop = false) => {
166
- const isSpecial = targetX === pretranslateX && targetX !== 0;
167
- if (targetX === pretranslateX && !isSpecial || stop)
168
- return;
169
- let resStr = null;
170
- const shouldOpen = targetX > 0 && pretranslateX <= 0 || targetX < 0 && pretranslateX >= 0 || isSpecial;
171
- if (shouldOpen) {
172
- if (targetX > 0) {
173
- resStr = SideTypeEnum.LEFT;
174
- } else if (targetX < 0) {
175
- resStr = SideTypeEnum.RIGHT;
176
- }
177
- setIsOpen(true);
178
- } else {
179
- setIsOpen(false);
180
- }
181
- if (resStr) {
182
- onActionsReveal == null ? void 0 : onActionsReveal({ side: resStr });
183
- }
184
- };
185
- const handleTouchEnd = (e) => __async(void 0, null, function* () {
186
- if (!isDragging.current)
187
- return;
188
- if (dragPhase === DragPhaseEnum.MOVE) {
189
- dragPhase = DragPhaseEnum.END;
190
- }
191
- const leftWidth = yield getLefRefWidth();
192
- const rightWidth = yield getRightRefWidth();
193
- const threshold = 0.5;
194
- let targetX = 0;
195
- isDragging.current = false;
196
- if (Math.abs(currentX.current) < dragThreshold)
197
- return;
198
- if (currentX.current > leftWidth * threshold) {
199
- targetX = leftWidth;
200
- } else if (currentX.current < -rightWidth * threshold) {
201
- targetX = -rightWidth;
202
- }
203
- if (dragPhase === DragPhaseEnum.END || isMini) {
204
- emitActionsReveal(targetX);
205
- console.log("handleTouchEnd\uFF1A", targetX, e);
206
- setTranslateX(targetX);
207
- pretranslateX = targetX;
208
- }
209
- currentX.current = 0;
210
- });
211
- const close = () => {
212
- setTranslateX(0);
213
- pretranslateX = 0;
214
- setIsOpen(false);
215
- };
216
- useEffect(() => {
217
- initRefWidth();
218
- if (!contentRef.current)
219
- return;
220
- const removeTouchEmulator = touchEmulator(contentRef.current);
221
- return () => {
222
- removeTouchEmulator();
223
- };
224
- }, []);
225
- useEffect(() => {
226
- var _a2, _b, _c, _d;
227
- (_a2 = contentRef == null ? void 0 : contentRef.current) == null ? void 0 : _a2.addEventListener("touchstart", handleTouchStart);
228
- (_b = contentRef == null ? void 0 : contentRef.current) == null ? void 0 : _b.addEventListener("touchmove", handleTouchMove);
229
- (_c = contentRef == null ? void 0 : contentRef.current) == null ? void 0 : _c.addEventListener("touchend", handleTouchEnd);
230
- (_d = contentRef == null ? void 0 : contentRef.current) == null ? void 0 : _d.addEventListener("touchcancel", handleTouchEnd);
231
- if (!isMini && document) {
232
- document.addEventListener("mouseup", handleTouchEnd);
233
- }
234
- return () => {
235
- var _a3, _b2, _c2, _d2;
236
- (_a3 = contentRef == null ? void 0 : contentRef.current) == null ? void 0 : _a3.removeEventListener(
237
- "touchstart",
238
- handleTouchStart
239
- );
240
- (_b2 = contentRef == null ? void 0 : contentRef.current) == null ? void 0 : _b2.removeEventListener("touchmove", handleTouchMove);
241
- (_c2 = contentRef == null ? void 0 : contentRef.current) == null ? void 0 : _c2.removeEventListener("touchend", handleTouchEnd);
242
- (_d2 = contentRef == null ? void 0 : contentRef.current) == null ? void 0 : _d2.removeEventListener("touchcancel", handleTouchEnd);
243
- if (!isMini && document) {
244
- document.removeEventListener("mouseup", handleTouchEnd);
245
- }
246
- };
247
- }, []);
248
- useImperativeHandle(ref, () => ({
249
- show: (params) => __async(void 0, null, function* () {
250
- let targetX = 0;
251
- if (params && params.side === SideTypeEnum.RIGHT) {
252
- targetX = -(yield getRightRefWidth());
253
- } else {
254
- targetX = yield getLefRefWidth();
255
- }
256
- setTranslateX(targetX);
257
- pretranslateX = targetX;
258
- emitActionsReveal(targetX);
259
- }),
260
- close,
261
- // 获取当前是否打开
262
- open: isOpen,
263
- ref: rootRef.current
264
- }));
265
- const outClickHandle = (e) => {
266
- e.preventDefault();
267
- e.stopPropagation();
268
- if (translateX !== 0 && closeOnClickContainer) {
269
- close();
270
- }
271
- };
272
- const SwipeActionContext = useMemo(
273
- () => ({ closeOnClickActionItem, close }),
274
- [closeOnClickActionItem]
275
- );
276
- return /* @__PURE__ */ React.createElement(BuiSwipeActionContext.Provider, { value: SwipeActionContext }, /* @__PURE__ */ React.createElement(
277
- "div",
278
- __spreadValues({
279
- className: clsx(`${classPrefix}`, className),
280
- ref: rootRef
281
- }, others),
282
- /* @__PURE__ */ React.createElement(
283
- "div",
284
- {
285
- className: `${classPrefix}-track`,
286
- style: {
287
- transform: `translate3d(${translateX}px, 0, 0)`
288
- }
289
- },
290
- /* @__PURE__ */ React.createElement(
291
- "div",
292
- {
293
- className: `${classPrefix}-actions ${classPrefix}-actions-left`,
294
- ref: leftRef
295
- },
296
- leftActions
297
- ),
298
- /* @__PURE__ */ React.createElement(
299
- "div",
300
- {
301
- className: `${classPrefix}-content-container`,
302
- ref: contentRef,
303
- onTouchStart: handleTouchStart,
304
- onTouchMove: handleTouchMove,
305
- onTouchEnd: handleTouchEnd,
306
- onTouchCancel: handleTouchEnd
307
- },
308
- isOpen && closeOnClickContainer && /* @__PURE__ */ React.createElement(
309
- "div",
310
- {
311
- className: `${classPrefix}-content-mask`,
312
- id: "content-mask",
313
- onClick: outClickHandle
314
- }
315
- ),
316
- children
317
- ),
318
- /* @__PURE__ */ React.createElement(
319
- "div",
320
- {
321
- className: `${classPrefix}-actions ${classPrefix}-actions-right`,
322
- ref: rightRef
323
- },
324
- rightActions
325
- )
326
- )
327
- ));
328
- }
329
- );
330
- SwipeAction.displayName = "BuiSwipeAction";
331
- var SwipeAction_default = SwipeAction;
332
- export {
333
- SwipeAction_default as default
334
- };
@@ -1,75 +0,0 @@
1
- import { OverrideProps, ThemeColor } from '@bifrostui/types';
2
- import React from 'react';
3
- import { SideTypeEnum } from './constants';
4
- export type SwipeActionProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
5
- props: P & {
6
- /**
7
- * 右侧的操作按钮列表区域
8
- */
9
- rightActions?: React.ReactNode;
10
- /**
11
- * 左侧的操作按钮列表区域
12
- */
13
- leftActions?: React.ReactNode;
14
- /**
15
- * 是否在点击按钮区自动归位
16
- */
17
- closeOnClickActionItem?: boolean;
18
- /**
19
- * 是否在点击其他区域时自动归位
20
- */
21
- closeOnClickContainer?: boolean;
22
- /**
23
- * 操作按钮展开时触发
24
- */
25
- onActionsReveal?: (params: RevealParams) => void;
26
- /**
27
- * 是否禁用拖动
28
- */
29
- disabled?: boolean;
30
- };
31
- defaultComponent: D;
32
- }, D>;
33
- interface RevealParams {
34
- side: SideTypeEnum | '';
35
- }
36
- export type SwipeActionItemProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
37
- props: P & {
38
- /**
39
- * 颜色风格
40
- */
41
- color?: ThemeColor | 'vip';
42
- /**
43
- * id
44
- */
45
- id?: string | number;
46
- /**
47
- * 点击事件
48
- */
49
- onClick?: (e: React.SyntheticEvent, item: {
50
- id: string | number;
51
- color: ThemeColor | 'vip';
52
- text: React.ReactNode;
53
- }) => void;
54
- };
55
- defaultComponent: D;
56
- }, D>;
57
- export interface BuiSwipeActionContextProps {
58
- /**
59
- * 是否在点击操作按钮时自动归位
60
- */
61
- closeOnClickActionItem?: boolean;
62
- /**
63
- * 关闭函数
64
- */
65
- close: () => void;
66
- }
67
- export type SwipeActionRef = {
68
- close: () => void;
69
- show: (params?: {
70
- side: SideTypeEnum;
71
- }) => void;
72
- open: boolean;
73
- ref?: HTMLDivElement;
74
- };
75
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { BuiSwipeActionContextProps } from './SwipeAction.types';
3
- declare const BuiSwipeActionContext: import("react").Context<BuiSwipeActionContextProps>;
4
- export default BuiSwipeActionContext;
@@ -1,11 +0,0 @@
1
- import { createContext } from "react";
2
- const BuiSwipeActionContext = createContext({
3
- closeOnClickActionItem: true,
4
- // eslint-disable-next-line @typescript-eslint/no-empty-function
5
- close: () => {
6
- }
7
- });
8
- var SwipeActionContext_default = BuiSwipeActionContext;
9
- export {
10
- SwipeActionContext_default as default
11
- };
@@ -1,31 +0,0 @@
1
- .bui-swipe-action-item {
2
- padding: 0 15px;
3
- display: flex;
4
- align-items: center;
5
- justify-content: center;
6
- height: 100%;
7
- width: 100%;
8
- background: var(--background-button-color);
9
- color: #fff;
10
- box-sizing: content-box;
11
- white-space: nowrap;
12
- font-family: var(--bui-font-family);
13
- }
14
- .bui-swipe-action-item-primary {
15
- background-color: var(--bui-color-primary);
16
- }
17
- .bui-swipe-action-item-vip {
18
- background-color: var(--bui-color-vip);
19
- }
20
- .bui-swipe-action-item-success {
21
- background-color: var(--bui-color-success);
22
- }
23
- .bui-swipe-action-item-info {
24
- background-color: var(--bui-color-info);
25
- }
26
- .bui-swipe-action-item-warning {
27
- background-color: var(--bui-color-warning);
28
- }
29
- .bui-swipe-action-item-danger {
30
- background-color: var(--bui-color-danger);
31
- }
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { SwipeActionItemProps } from './SwipeAction.types';
3
- import './SwipeActionItem.less';
4
- declare const SwipeActionItem: React.ForwardRefExoticComponent<Omit<SwipeActionItemProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
- export default SwipeActionItem;
@@ -1,78 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
- var __hasOwnProp = Object.prototype.hasOwnProperty;
4
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __spreadValues = (a, b) => {
7
- for (var prop in b || (b = {}))
8
- if (__hasOwnProp.call(b, prop))
9
- __defNormalProp(a, prop, b[prop]);
10
- if (__getOwnPropSymbols)
11
- for (var prop of __getOwnPropSymbols(b)) {
12
- if (__propIsEnum.call(b, prop))
13
- __defNormalProp(a, prop, b[prop]);
14
- }
15
- return a;
16
- };
17
- var __objRest = (source, exclude) => {
18
- var target = {};
19
- for (var prop in source)
20
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
21
- target[prop] = source[prop];
22
- if (source != null && __getOwnPropSymbols)
23
- for (var prop of __getOwnPropSymbols(source)) {
24
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
25
- target[prop] = source[prop];
26
- }
27
- return target;
28
- };
29
- import React, { useContext } from "react";
30
- import clsx from "clsx";
31
- import BuiSwipeActionContext from "./SwipeActionContext";
32
- import "./SwipeActionItem.css";
33
- const prefixCls = "bui-swipe-action-item";
34
- const SwipeActionItem = /* @__PURE__ */ React.forwardRef(
35
- (props, ref) => {
36
- const _a = props, {
37
- className,
38
- children,
39
- onClick,
40
- color = "primary",
41
- id = ""
42
- } = _a, others = __objRest(_a, [
43
- "className",
44
- "children",
45
- "onClick",
46
- "color",
47
- "id"
48
- ]);
49
- const { closeOnClickActionItem, close } = useContext(BuiSwipeActionContext);
50
- const onClickHandle = (e) => {
51
- e.stopPropagation();
52
- if (closeOnClickActionItem) {
53
- close == null ? void 0 : close();
54
- }
55
- onClick == null ? void 0 : onClick(e, {
56
- color,
57
- id,
58
- text: children
59
- });
60
- };
61
- return /* @__PURE__ */ React.createElement(
62
- "div",
63
- __spreadValues({
64
- className: clsx(prefixCls, className, {
65
- [`${prefixCls}-${color}`]: color
66
- }),
67
- ref,
68
- onClick: onClickHandle
69
- }, others),
70
- children
71
- );
72
- }
73
- );
74
- SwipeActionItem.displayName = "SwipeActionItem";
75
- var SwipeActionItem_default = SwipeActionItem;
76
- export {
77
- SwipeActionItem_default as default
78
- };
@@ -1,9 +0,0 @@
1
- export declare enum SideTypeEnum {
2
- LEFT = "left",
3
- RIGHT = "right"
4
- }
5
- export declare enum DragPhaseEnum {
6
- START = 1,
7
- MOVE = 2,
8
- END = 3
9
- }
@@ -1,15 +0,0 @@
1
- var SideTypeEnum = /* @__PURE__ */ ((SideTypeEnum2) => {
2
- SideTypeEnum2["LEFT"] = "left";
3
- SideTypeEnum2["RIGHT"] = "right";
4
- return SideTypeEnum2;
5
- })(SideTypeEnum || {});
6
- var DragPhaseEnum = /* @__PURE__ */ ((DragPhaseEnum2) => {
7
- DragPhaseEnum2[DragPhaseEnum2["START"] = 1] = "START";
8
- DragPhaseEnum2[DragPhaseEnum2["MOVE"] = 2] = "MOVE";
9
- DragPhaseEnum2[DragPhaseEnum2["END"] = 3] = "END";
10
- return DragPhaseEnum2;
11
- })(DragPhaseEnum || {});
12
- export {
13
- DragPhaseEnum,
14
- SideTypeEnum
15
- };
@@ -1,5 +0,0 @@
1
- export * from './SwipeAction.types';
2
- export { default } from './SwipeAction';
3
- export { default as SwipeAction } from './SwipeAction';
4
- export { default as SwipeActionItem } from './SwipeActionItem';
5
- export { SideTypeEnum, DragPhaseEnum } from './constants';
@@ -1,12 +0,0 @@
1
- export * from "./SwipeAction.types";
2
- import { default as default2 } from "./SwipeAction";
3
- import { default as default3 } from "./SwipeAction";
4
- import { default as default4 } from "./SwipeActionItem";
5
- import { SideTypeEnum, DragPhaseEnum } from "./constants";
6
- export {
7
- DragPhaseEnum,
8
- SideTypeEnum,
9
- default3 as SwipeAction,
10
- default4 as SwipeActionItem,
11
- default2 as default
12
- };
@@ -1,2 +0,0 @@
1
- declare const scrollLeftTo: (scroller: HTMLElement, to: number, duration: number) => void;
2
- export default scrollLeftTo;
@@ -1,36 +0,0 @@
1
- const root = window || global;
2
- let rafId;
3
- let prev = Date.now();
4
- const rafPolyfill = (fn) => {
5
- const curr = Date.now();
6
- const ms = Math.max(0, 16 - (curr - prev));
7
- const id = setTimeout(fn, ms);
8
- prev = curr + ms;
9
- return id;
10
- };
11
- const cancelRaf = (id) => {
12
- const cancelAnimationFrame = (root == null ? void 0 : root.cancelAnimationFrame) || (root == null ? void 0 : root.clearTimeout) || clearTimeout;
13
- cancelAnimationFrame.call(root, id);
14
- };
15
- const raf = (fn) => {
16
- const requestAnimationFrame = (root == null ? void 0 : root.requestAnimationFrame) || rafPolyfill;
17
- return requestAnimationFrame.call(root, fn);
18
- };
19
- const scrollLeftTo = (scroller, to, duration) => {
20
- cancelRaf(rafId);
21
- let count = 0;
22
- const from = scroller.scrollLeft;
23
- const frames = duration === 0 ? 1 : Math.round(duration / 16);
24
- function animate() {
25
- scroller.scrollLeft += (to - from) / frames;
26
- count += 1;
27
- if (count < frames) {
28
- rafId = raf(animate);
29
- }
30
- }
31
- animate();
32
- };
33
- var scroll_default = scrollLeftTo;
34
- export {
35
- scroll_default as default
36
- };