@bifrostui/react 1.4.8-beta.0 → 2.0.0-beta.1

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 (313) hide show
  1. package/dist/ActionSheet/ActionSheet.css +2 -2
  2. package/dist/ActionSheet/ActionSheetItem.js +3 -8
  3. package/dist/Avatar/Avatar.js +3 -8
  4. package/dist/Avatar/AvatarGroup.js +2 -6
  5. package/dist/Badge/Badge.js +3 -8
  6. package/dist/Button/Button.css +77 -78
  7. package/dist/Button/Button.d.ts +1 -1
  8. package/dist/Button/Button.js +4 -10
  9. package/dist/Button/Button.types.d.ts +8 -7
  10. package/dist/Calendar/Calendar.js +7 -19
  11. package/dist/Calendar/Calendar.types.d.ts +0 -5
  12. package/dist/Card/Card.css +1 -1
  13. package/dist/Card/CardContent.css +1 -2
  14. package/dist/Card/CardFooter.css +2 -4
  15. package/dist/Card/CardHeader.css +4 -5
  16. package/dist/Checkbox/Checkbox.js +2 -6
  17. package/dist/Checkbox/CheckboxGroup.js +4 -7
  18. package/dist/Collapse/Collapse.css +1 -0
  19. package/dist/Collapse/Collapse.d.ts +1 -1
  20. package/dist/Collapse/Collapse.js +8 -11
  21. package/dist/CollapsePanel/CollapsePanel.css +2 -4
  22. package/dist/CollapsePanel/CollapsePanelItem.js +45 -46
  23. package/dist/Countdown/Countdown.js +5 -12
  24. package/dist/Dialog/FunctionalDialog.js +1 -1
  25. package/dist/Divider/Divider.js +8 -5
  26. package/dist/Drawer/Drawer.js +4 -10
  27. package/dist/Fade/Fade.js +52 -56
  28. package/dist/IconButton/IconButton.js +5 -12
  29. package/dist/Image/Image.js +112 -119
  30. package/dist/Input/Input.js +4 -10
  31. package/dist/List/List.js +3 -8
  32. package/dist/List/ListItem.js +42 -44
  33. package/dist/List/ListItemContent.js +1 -4
  34. package/dist/List/ListItemExtra.js +9 -4
  35. package/dist/List/ListItemFooter.js +9 -4
  36. package/dist/List/ListItemHeader.js +9 -4
  37. package/dist/Loading/Loading.js +13 -4
  38. package/dist/Modal/Modal.js +0 -6
  39. package/dist/Modal/Modal.miniapp.js +4 -10
  40. package/dist/NavBar/NavBar.js +0 -1
  41. package/dist/Picker/Picker.css +0 -5
  42. package/dist/Picker/Picker.js +5 -27
  43. package/dist/Picker/Picker.types.d.ts +2 -15
  44. package/dist/Picker/PickerPanel.css +0 -4
  45. package/dist/Picker/PickerPanel.js +6 -7
  46. package/dist/Popover/Popover.css +5 -5
  47. package/dist/Popover/Popover.js +27 -70
  48. package/dist/Portal/Portal.miniapp.js +4 -7
  49. package/dist/Radio/Radio.css +0 -1
  50. package/dist/Radio/Radio.js +2 -6
  51. package/dist/Radio/RadioGroup.js +0 -3
  52. package/dist/Rating/Rating.js +8 -18
  53. package/dist/ScrollView/ScrollView.js +11 -24
  54. package/dist/ScrollView/ScrollView.types.d.ts +1 -0
  55. package/dist/Select/Select.css +4 -1
  56. package/dist/Select/Select.js +41 -68
  57. package/dist/Skeleton/Skeleton.js +5 -9
  58. package/dist/Slide/Slide.js +69 -74
  59. package/dist/Slider/Slider.js +11 -27
  60. package/dist/Steps/Step.js +81 -82
  61. package/dist/Steps/Steps.d.ts +1 -1
  62. package/dist/Steps/Steps.js +57 -60
  63. package/dist/Switch/Switch.js +75 -78
  64. package/dist/TabBar/TabBar.js +3 -8
  65. package/dist/Tabs/Tab.css +10 -16
  66. package/dist/Tabs/Tab.js +2 -3
  67. package/dist/Tabs/Tabs.css +13 -22
  68. package/dist/Tabs/Tabs.js +39 -70
  69. package/dist/Tabs/Tabs.types.d.ts +0 -10
  70. package/dist/Tabs/utils/bound.d.ts +1 -0
  71. package/dist/{DesktopPicker/utils/calcAfterMounted.js → Tabs/utils/bound.js} +14 -7
  72. package/dist/Tag/Tag.css +1 -1
  73. package/dist/Tag/Tag.js +2 -6
  74. package/dist/TextArea/TextArea.js +5 -12
  75. package/dist/Toast/FunctionalToast.js +1 -1
  76. package/dist/Toast/Toast.css +1 -0
  77. package/dist/Tooltip/Tooltip.css +5 -5
  78. package/dist/Tooltip/Tooltip.js +27 -70
  79. package/dist/Transition/TransitionCore.js +3 -8
  80. package/dist/index.d.ts +0 -6
  81. package/dist/index.js +1 -13
  82. package/dist/locales/base.d.ts +0 -11
  83. package/dist/locales/en-US.js +0 -24
  84. package/dist/locales/zh-CN.js +0 -24
  85. package/dist/locales/zh-TW.js +0 -24
  86. package/es/ActionSheet/ActionSheet.css +2 -2
  87. package/es/ActionSheet/ActionSheetItem.js +3 -8
  88. package/es/Avatar/Avatar.js +3 -8
  89. package/es/Avatar/AvatarGroup.js +2 -6
  90. package/es/Badge/Badge.js +3 -8
  91. package/es/Button/Button.css +77 -78
  92. package/es/Button/Button.d.ts +1 -1
  93. package/es/Button/Button.js +3 -9
  94. package/es/Button/Button.types.d.ts +8 -7
  95. package/es/Calendar/Calendar.js +7 -19
  96. package/es/Calendar/Calendar.types.d.ts +0 -5
  97. package/es/Card/Card.css +1 -1
  98. package/es/Card/CardContent.css +1 -2
  99. package/es/Card/CardFooter.css +2 -4
  100. package/es/Card/CardHeader.css +4 -5
  101. package/es/Checkbox/Checkbox.js +2 -6
  102. package/es/Checkbox/CheckboxGroup.js +4 -7
  103. package/es/Collapse/Collapse.css +1 -0
  104. package/es/Collapse/Collapse.d.ts +1 -1
  105. package/es/Collapse/Collapse.js +8 -11
  106. package/es/CollapsePanel/CollapsePanel.css +2 -4
  107. package/es/CollapsePanel/CollapsePanelItem.js +45 -46
  108. package/es/Countdown/Countdown.js +5 -12
  109. package/es/Dialog/FunctionalDialog.js +2 -2
  110. package/es/Divider/Divider.js +8 -5
  111. package/es/Drawer/Drawer.js +4 -10
  112. package/es/Fade/Fade.js +52 -56
  113. package/es/IconButton/IconButton.js +5 -12
  114. package/es/Image/Image.js +112 -119
  115. package/es/Input/Input.js +4 -10
  116. package/es/List/List.js +3 -8
  117. package/es/List/ListItem.js +42 -44
  118. package/es/List/ListItemContent.js +1 -4
  119. package/es/List/ListItemExtra.js +9 -4
  120. package/es/List/ListItemFooter.js +9 -4
  121. package/es/List/ListItemHeader.js +9 -4
  122. package/es/Loading/Loading.js +13 -4
  123. package/es/Modal/Modal.js +0 -6
  124. package/es/Modal/Modal.miniapp.d.ts +1 -1
  125. package/es/Modal/Modal.miniapp.js +4 -10
  126. package/es/NavBar/NavBar.js +0 -1
  127. package/es/Picker/Picker.css +0 -5
  128. package/es/Picker/Picker.js +5 -27
  129. package/es/Picker/Picker.types.d.ts +2 -15
  130. package/es/Picker/PickerPanel.css +0 -4
  131. package/es/Picker/PickerPanel.js +6 -7
  132. package/es/Popover/Popover.css +5 -5
  133. package/es/Popover/Popover.js +29 -73
  134. package/es/Portal/Portal.miniapp.js +5 -8
  135. package/es/Radio/Radio.css +0 -1
  136. package/es/Radio/Radio.js +2 -6
  137. package/es/Radio/RadioGroup.js +0 -3
  138. package/es/Rating/Rating.js +8 -18
  139. package/es/ScrollView/ScrollView.js +11 -24
  140. package/es/ScrollView/ScrollView.types.d.ts +1 -0
  141. package/es/Select/Select.css +4 -1
  142. package/es/Select/Select.js +42 -68
  143. package/es/Skeleton/Skeleton.js +5 -9
  144. package/es/Slide/Slide.js +69 -74
  145. package/es/Slider/Slider.js +12 -30
  146. package/es/Steps/Step.js +81 -82
  147. package/es/Steps/Steps.d.ts +1 -1
  148. package/es/Steps/Steps.js +57 -60
  149. package/es/Switch/Switch.js +75 -78
  150. package/es/TabBar/TabBar.js +3 -8
  151. package/es/Tabs/Tab.css +10 -16
  152. package/es/Tabs/Tab.js +2 -3
  153. package/es/Tabs/Tabs.css +13 -22
  154. package/es/Tabs/Tabs.js +41 -83
  155. package/es/Tabs/Tabs.types.d.ts +0 -10
  156. package/es/Tabs/utils/bound.d.ts +1 -0
  157. package/es/Tabs/utils/bound.js +13 -0
  158. package/es/Tag/Tag.css +1 -1
  159. package/es/Tag/Tag.js +2 -6
  160. package/es/TextArea/TextArea.js +5 -12
  161. package/es/Toast/FunctionalToast.js +2 -2
  162. package/es/Toast/Toast.css +1 -0
  163. package/es/Tooltip/Tooltip.css +5 -5
  164. package/es/Tooltip/Tooltip.js +29 -73
  165. package/es/Transition/TransitionCore.js +3 -8
  166. package/es/index.d.ts +0 -6
  167. package/es/index.js +0 -6
  168. package/es/locales/base.d.ts +0 -11
  169. package/es/locales/en-US.js +0 -24
  170. package/es/locales/zh-CN.js +0 -24
  171. package/es/locales/zh-TW.js +0 -24
  172. package/package.json +6 -6
  173. package/dist/Collapse/Collapse.miniapp.d.ts +0 -5
  174. package/dist/Collapse/Collapse.miniapp.js +0 -177
  175. package/dist/DatePicker/DatePicker.d.ts +0 -4
  176. package/dist/DatePicker/DatePicker.js +0 -335
  177. package/dist/DatePicker/DatePicker.types.d.ts +0 -36
  178. package/dist/DatePicker/DatePicker.types.js +0 -15
  179. package/dist/DatePicker/constants.d.ts +0 -9
  180. package/dist/DatePicker/constants.js +0 -37
  181. package/dist/DatePicker/index.d.ts +0 -3
  182. package/dist/DatePicker/index.js +0 -44
  183. package/dist/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
  184. package/dist/DesktopDatePicker/DesktopDatePicker.js +0 -280
  185. package/dist/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
  186. package/dist/DesktopDatePicker/DesktopDatePicker.types.js +0 -15
  187. package/dist/DesktopDatePicker/deskTopPickerContainer.css +0 -100
  188. package/dist/DesktopDatePicker/index.css +0 -61
  189. package/dist/DesktopDatePicker/index.d.ts +0 -2
  190. package/dist/DesktopDatePicker/index.js +0 -41
  191. package/dist/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
  192. package/dist/DesktopDatePicker/useGetDatePickerContent.js +0 -343
  193. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
  194. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -322
  195. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
  196. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -15
  197. package/dist/DesktopDateTimePicker/index.css +0 -66
  198. package/dist/DesktopDateTimePicker/index.d.ts +0 -2
  199. package/dist/DesktopDateTimePicker/index.js +0 -41
  200. package/dist/DesktopPicker/DesktopPicker.d.ts +0 -5
  201. package/dist/DesktopPicker/DesktopPicker.js +0 -238
  202. package/dist/DesktopPicker/DesktopPicker.types.d.ts +0 -57
  203. package/dist/DesktopPicker/DesktopPicker.types.js +0 -15
  204. package/dist/DesktopPicker/index.css +0 -37
  205. package/dist/DesktopPicker/index.d.ts +0 -2
  206. package/dist/DesktopPicker/index.js +0 -41
  207. package/dist/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
  208. package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
  209. package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -38
  210. package/dist/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
  211. package/dist/DesktopTimePicker/DesktopTimePicker.js +0 -288
  212. package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
  213. package/dist/DesktopTimePicker/DesktopTimePicker.types.js +0 -15
  214. package/dist/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
  215. package/dist/DesktopTimePicker/DesktopTimePickerList.js +0 -111
  216. package/dist/DesktopTimePicker/index.css +0 -170
  217. package/dist/DesktopTimePicker/index.d.ts +0 -2
  218. package/dist/DesktopTimePicker/index.js +0 -41
  219. package/dist/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
  220. package/dist/DesktopTimePicker/useGetTimePickerContent.js +0 -249
  221. package/dist/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
  222. package/dist/DesktopTimePicker/utils/scrollUtil.js +0 -27
  223. package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
  224. package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -51
  225. package/dist/DesktopTimePicker/utils/utils.d.ts +0 -28
  226. package/dist/DesktopTimePicker/utils/utils.js +0 -408
  227. package/dist/SwipeAction/SwipeAction.css +0 -79
  228. package/dist/SwipeAction/SwipeAction.d.ts +0 -5
  229. package/dist/SwipeAction/SwipeAction.js +0 -349
  230. package/dist/SwipeAction/SwipeAction.types.d.ts +0 -75
  231. package/dist/SwipeAction/SwipeAction.types.js +0 -15
  232. package/dist/SwipeAction/SwipeActionContext.d.ts +0 -4
  233. package/dist/SwipeAction/SwipeActionContext.js +0 -30
  234. package/dist/SwipeAction/SwipeActionItem.css +0 -31
  235. package/dist/SwipeAction/SwipeActionItem.d.ts +0 -5
  236. package/dist/SwipeAction/SwipeActionItem.js +0 -105
  237. package/dist/SwipeAction/constants.d.ts +0 -9
  238. package/dist/SwipeAction/constants.js +0 -39
  239. package/dist/SwipeAction/index.d.ts +0 -5
  240. package/dist/SwipeAction/index.js +0 -50
  241. package/dist/Tabs/utils/scroll.d.ts +0 -2
  242. package/dist/Tabs/utils/scroll.js +0 -55
  243. package/es/Collapse/Collapse.miniapp.d.ts +0 -5
  244. package/es/Collapse/Collapse.miniapp.js +0 -157
  245. package/es/DatePicker/DatePicker.d.ts +0 -4
  246. package/es/DatePicker/DatePicker.js +0 -308
  247. package/es/DatePicker/DatePicker.types.d.ts +0 -36
  248. package/es/DatePicker/DatePicker.types.js +0 -1
  249. package/es/DatePicker/constants.d.ts +0 -9
  250. package/es/DatePicker/constants.js +0 -14
  251. package/es/DatePicker/index.d.ts +0 -3
  252. package/es/DatePicker/index.js +0 -8
  253. package/es/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
  254. package/es/DesktopDatePicker/DesktopDatePicker.js +0 -253
  255. package/es/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
  256. package/es/DesktopDatePicker/DesktopDatePicker.types.js +0 -1
  257. package/es/DesktopDatePicker/deskTopPickerContainer.css +0 -100
  258. package/es/DesktopDatePicker/index.css +0 -61
  259. package/es/DesktopDatePicker/index.d.ts +0 -2
  260. package/es/DesktopDatePicker/index.js +0 -6
  261. package/es/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
  262. package/es/DesktopDatePicker/useGetDatePickerContent.js +0 -316
  263. package/es/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
  264. package/es/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -295
  265. package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
  266. package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -1
  267. package/es/DesktopDateTimePicker/index.css +0 -66
  268. package/es/DesktopDateTimePicker/index.d.ts +0 -2
  269. package/es/DesktopDateTimePicker/index.js +0 -9
  270. package/es/DesktopPicker/DesktopPicker.d.ts +0 -5
  271. package/es/DesktopPicker/DesktopPicker.js +0 -221
  272. package/es/DesktopPicker/DesktopPicker.types.d.ts +0 -57
  273. package/es/DesktopPicker/DesktopPicker.types.js +0 -1
  274. package/es/DesktopPicker/index.css +0 -37
  275. package/es/DesktopPicker/index.d.ts +0 -2
  276. package/es/DesktopPicker/index.js +0 -6
  277. package/es/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
  278. package/es/DesktopPicker/utils/calcAfterMounted.js +0 -6
  279. package/es/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
  280. package/es/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -9
  281. package/es/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
  282. package/es/DesktopTimePicker/DesktopTimePicker.js +0 -261
  283. package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
  284. package/es/DesktopTimePicker/DesktopTimePicker.types.js +0 -1
  285. package/es/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
  286. package/es/DesktopTimePicker/DesktopTimePickerList.js +0 -84
  287. package/es/DesktopTimePicker/index.css +0 -170
  288. package/es/DesktopTimePicker/index.d.ts +0 -2
  289. package/es/DesktopTimePicker/index.js +0 -6
  290. package/es/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
  291. package/es/DesktopTimePicker/useGetTimePickerContent.js +0 -226
  292. package/es/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
  293. package/es/DesktopTimePicker/utils/scrollUtil.js +0 -8
  294. package/es/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
  295. package/es/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -22
  296. package/es/DesktopTimePicker/utils/utils.d.ts +0 -28
  297. package/es/DesktopTimePicker/utils/utils.js +0 -365
  298. package/es/SwipeAction/SwipeAction.css +0 -79
  299. package/es/SwipeAction/SwipeAction.d.ts +0 -5
  300. package/es/SwipeAction/SwipeAction.js +0 -334
  301. package/es/SwipeAction/SwipeAction.types.d.ts +0 -75
  302. package/es/SwipeAction/SwipeAction.types.js +0 -1
  303. package/es/SwipeAction/SwipeActionContext.d.ts +0 -4
  304. package/es/SwipeAction/SwipeActionContext.js +0 -11
  305. package/es/SwipeAction/SwipeActionItem.css +0 -31
  306. package/es/SwipeAction/SwipeActionItem.d.ts +0 -5
  307. package/es/SwipeAction/SwipeActionItem.js +0 -78
  308. package/es/SwipeAction/constants.d.ts +0 -9
  309. package/es/SwipeAction/constants.js +0 -15
  310. package/es/SwipeAction/index.d.ts +0 -5
  311. package/es/SwipeAction/index.js +0 -12
  312. package/es/Tabs/utils/scroll.d.ts +0 -2
  313. package/es/Tabs/utils/scroll.js +0 -36
@@ -1,163 +0,0 @@
1
- import React, { Ref } from 'react';
2
- import { OverrideProps } from '@bifrostui/types';
3
- import { DesktopPickerProps } from '../DesktopPicker';
4
- import { CalendarProps } from '../Calendar';
5
- export type IDateTimePickerValue = Date | null;
6
- export interface IDateTimePickerInstance {
7
- /** 日期对象 */
8
- day: Date;
9
- /** 是否禁用 */
10
- disabled: boolean;
11
- }
12
- export interface IDateTimePickerCustomIconProps {
13
- /**
14
- * 是否是最小时间
15
- */
16
- isMinMonth?: boolean;
17
- /**
18
- * 是否是最大时间
19
- */
20
- isMaxMonth?: boolean;
21
- }
22
- export interface IDateTimePickerCalendarProps {
23
- /**
24
- * 是否隐藏当前月之外的日期,默认为false
25
- */
26
- hideDaysOutsideCurrentMonth?: boolean;
27
- /**
28
- * 高亮的日期,默认为today
29
- * today 若选中的非当天,则当天高亮显示,若选中的是当天,则当天展示选中态
30
- * weekend 可选的周末高亮显示
31
- */
32
- highlightDate?: 'today' | 'weekend';
33
- /**
34
- * 自定义日期单元格的内容
35
- */
36
- dateRender?: (currentDate: IDateTimePickerInstance) => React.ReactNode;
37
- /**
38
- * 自定义周单元格的内容
39
- */
40
- weekRender?: (week: string) => React.ReactNode;
41
- }
42
- export type DateTimePickerProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
43
- props: P & {
44
- /**
45
- * 默认选中的值,当组件非受控时使用
46
- */
47
- defaultValue?: IDateTimePickerValue;
48
- /**
49
- * 选中的值,当组件受控时使用
50
- */
51
- value?: IDateTimePickerValue;
52
- /**
53
- * 输入框占位内容
54
- */
55
- placeholder?: string;
56
- /**
57
- * 可选择的最小日期,默认为当前日期
58
- * 渲染指定月时:value=null并指定minDate
59
- */
60
- minDate?: Date;
61
- /**
62
- * 可选择的最大日期,默认为当前日期的一年后
63
- */
64
- maxDate?: Date;
65
- /**
66
- * 弹层是否打开
67
- */
68
- open?: boolean;
69
- /**
70
- * 输入框icon
71
- */
72
- icon?: React.ReactNode;
73
- /**
74
- * inputRef
75
- */
76
- inputRef?: Ref<HTMLInputElement>;
77
- /**
78
- * inputProp
79
- */
80
- inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
81
- /**
82
- * 选择器类型
83
- */
84
- views?: Array<'year' | 'month' | 'day' | 'hour' | 'minute' | 'second'>;
85
- /**
86
- * 头部操作栏左边图标
87
- */
88
- headerBarLeftIcon?: (options: IDateTimePickerCustomIconProps) => React.ReactNode;
89
- /**
90
- * 头部操作栏右边图标
91
- */
92
- headerBarRightIcon?: (options: IDateTimePickerCustomIconProps) => React.ReactNode;
93
- /**
94
- * 是否禁用日期选择器
95
- */
96
- disabled?: boolean;
97
- /**
98
- * 不可选择的日期
99
- */
100
- disabledDate?: (currentDate: Date) => boolean;
101
- /**
102
- * 自定义月份单元格的内容
103
- */
104
- monthRender?: ({ month, currentDate, }: {
105
- month: string | number;
106
- currentDate: IDateTimePickerInstance;
107
- }) => React.ReactNode;
108
- /**
109
- * 自定义年份单元格的内容
110
- */
111
- yearRender?: ({ year, currentDate, }: {
112
- year: string | number;
113
- currentDate: IDateTimePickerInstance;
114
- }) => React.ReactNode;
115
- /**
116
- * 日期发生变化的回调
117
- */
118
- onChange?: (e: React.SyntheticEvent, data: {
119
- value: IDateTimePickerValue;
120
- }) => void;
121
- /**
122
- * 选择日期后是否立刻关闭
123
- */
124
- closeOnSelect?: boolean;
125
- /**
126
- * 禁用弹层选择功能
127
- */
128
- disableOpenPicker?: boolean;
129
- /**
130
- * 日期格式化
131
- */
132
- format?: string;
133
- /**
134
- * 弹层关闭的回调
135
- */
136
- onClose?: () => void;
137
- /**
138
- * 弹层打开的回调
139
- */
140
- onOpen?: () => void;
141
- /**
142
- * 月份切换的回调
143
- */
144
- onMonthChange?: (e: React.SyntheticEvent, data: {
145
- value: Date;
146
- }) => void;
147
- /**
148
- * 年份切换的回调
149
- */
150
- onYearChange?: (e: React.SyntheticEvent, data: {
151
- value: Date;
152
- }) => void;
153
- /**
154
- * DesktopPickerProps
155
- */
156
- DesktopPickerProps?: Omit<DesktopPickerProps, 'open'>;
157
- /**
158
- * CalendarProps
159
- */
160
- CalendarProps?: CalendarProps;
161
- };
162
- defaultComponent: D;
163
- }, D>;
@@ -1,66 +0,0 @@
1
- :root,
2
- page,
3
- xhs-page {
4
- --bui-datetime-picker-height: var(--bui-input-height, 32px);
5
- --bui-datetime-picker-min-width: var(--bui-input-min-width, 100px);
6
- --bui-datetime-picker-icon-size: var(--bui-title-size-3, 16px);
7
- --bui-datetime-picker-font-size: var(--bui-title-size-3, 16px);
8
- --bui-datetime-picker-container-padding: var(--bui-spacing-md, 9px);
9
- --bui-datetime-picker-bg: var(--bui-color-bg-view);
10
- --bui-datetime-picker-font-family: var(--bui-font-family);
11
- --bui-datetime-picker-border: 1px solid var(--bui-color-border-default);
12
- --bui-datetime-picker-shadow: 0 0 0 2px var(--bui-color-bg-default);
13
- --bui-datetime-picker-disabled-color: var(--bui-color-fg-subtle);
14
- }
15
- .bui-datetime-picker {
16
- position: relative;
17
- cursor: pointer;
18
- height: var(--bui-datetime-picker-height);
19
- min-width: 100px;
20
- font-size: var(--bui-datetime-picker-font-size);
21
- border-radius: 5px;
22
- background-color: var(--bui-datetime-picker-bg);
23
- font-family: var(--bui-datetime-picker-font-family);
24
- box-sizing: border-box;
25
- border: var(--bui-datetime-picker-border);
26
- }
27
- .bui-datetime-picker:active,
28
- .bui-datetime-picker-active {
29
- box-shadow: var(--bui-datetime-picker-shadow);
30
- }
31
- .bui-datetime-picker-invalid {
32
- border: 1px solid var(--bui-color-danger);
33
- }
34
- .bui-datetime-picker-icon {
35
- display: flex;
36
- align-items: center;
37
- font-size: var(--bui-datetime-picker-icon-size);
38
- }
39
- .bui-datetime-picker-container {
40
- display: flex;
41
- align-items: center;
42
- padding: 0 10px;
43
- height: 100%;
44
- }
45
- .bui-datetime-picker-input {
46
- display: flex;
47
- justify-content: space-between;
48
- align-items: center;
49
- flex: 1;
50
- height: 100%;
51
- background-color: transparent;
52
- outline: none;
53
- border: 0;
54
- }
55
- .bui-datetime-picker-box {
56
- display: flex;
57
- width: 420px;
58
- }
59
- .bui-datetime-picker.bui-datetime-picker-disabled {
60
- pointer-events: none;
61
- box-shadow: none;
62
- background-color: rgba(188, 188, 188, 0.2);
63
- }
64
- .bui-datetime-picker.bui-datetime-picker-disabled input {
65
- color: var(--bui-datetime-picker-disabled-color);
66
- }
@@ -1,2 +0,0 @@
1
- export { default, default as DesktopDateTimePicker, } from './DesktopDateTimePicker';
2
- export * from './DesktopDateTimePicker.types';
@@ -1,9 +0,0 @@
1
- import {
2
- default as default2,
3
- default as default3
4
- } from "./DesktopDateTimePicker";
5
- export * from "./DesktopDateTimePicker.types";
6
- export {
7
- default3 as DesktopDateTimePicker,
8
- default2 as default
9
- };
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { DesktopPickerProps } from './DesktopPicker.types';
3
- import './index.less';
4
- declare const DesktopPicker: React.ForwardRefExoticComponent<Omit<DesktopPickerProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
- export default DesktopPicker;
@@ -1,221 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
- var __async = (__this, __arguments, generator) => {
33
- return new Promise((resolve, reject) => {
34
- var fulfilled = (value) => {
35
- try {
36
- step(generator.next(value));
37
- } catch (e) {
38
- reject(e);
39
- }
40
- };
41
- var rejected = (value) => {
42
- try {
43
- step(generator.throw(value));
44
- } catch (e) {
45
- reject(e);
46
- }
47
- };
48
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
49
- step((generator = generator.apply(__this, __arguments)).next());
50
- });
51
- };
52
- import clsx from "clsx";
53
- import React, {
54
- useEffect,
55
- useMemo,
56
- useRef,
57
- useState
58
- } from "react";
59
- import {
60
- getStylesAndLocation,
61
- isMini,
62
- getRootContainer,
63
- useDidMountEffect
64
- } from "@bifrostui/utils";
65
- import Backdrop from "../Backdrop";
66
- import Portal from "../Portal";
67
- import calcAfterMounted from "./utils/calcAfterMounted";
68
- import "./index.css";
69
- const prefixCls = "bui-desktop-picker";
70
- const directionMap = {
71
- bottom: "top",
72
- top: "bottom"
73
- };
74
- const DesktopPicker = /* @__PURE__ */ React.forwardRef(
75
- (props, ref) => {
76
- const _a = props, {
77
- className,
78
- open,
79
- container,
80
- children,
81
- defaultDirection = "bottom",
82
- inheritWidth = true,
83
- content,
84
- miniBackdropInvisible = false,
85
- onClose,
86
- onMount,
87
- onUnmounted,
88
- containerWidth = "auto",
89
- BackdropProps
90
- } = _a, others = __objRest(_a, [
91
- "className",
92
- "open",
93
- "container",
94
- "children",
95
- "defaultDirection",
96
- "inheritWidth",
97
- "content",
98
- "miniBackdropInvisible",
99
- "onClose",
100
- "onMount",
101
- "onUnmounted",
102
- "containerWidth",
103
- "BackdropProps"
104
- ]);
105
- const contentRef = useRef(null);
106
- const nodeRef = useRef(null);
107
- const renderChildren = React.cloneElement(children, {
108
- ref: nodeRef
109
- });
110
- const [contentPosition, setContentPosition] = useState(
111
- "bottom"
112
- );
113
- const [transform, setTransform] = useState(false);
114
- const getContentDirection = () => __async(void 0, null, function* () {
115
- const curScrollRoot = getRootContainer(container);
116
- const result = yield getStylesAndLocation({
117
- scrollRoot: container && curScrollRoot,
118
- childrenRef: nodeRef,
119
- arrowDirection: defaultDirection,
120
- arrowLocation: "none",
121
- offsetSpacing: 0,
122
- tipRef: contentRef
123
- });
124
- if (!result)
125
- return;
126
- const { newArrowDirection, styles, childrenStyle } = result;
127
- const element = contentRef.current;
128
- element.style.transform = styles == null ? void 0 : styles.transform;
129
- element.style.visibility = styles == null ? void 0 : styles.visibility;
130
- element.style.top = styles == null ? void 0 : styles.top;
131
- element.style.left = styles == null ? void 0 : styles.left;
132
- if (inheritWidth) {
133
- element.style.width = childrenStyle == null ? void 0 : childrenStyle.width;
134
- }
135
- setContentPosition(newArrowDirection);
136
- });
137
- useEffect(() => {
138
- if (!isMini && open) {
139
- const addEventListenerClick = (e) => {
140
- var _a2;
141
- if (!((_a2 = nodeRef.current) == null ? void 0 : _a2.contains(e.target))) {
142
- onClose(null, { value: !open });
143
- }
144
- };
145
- getContentDirection();
146
- const containerDom = getRootContainer(container, window);
147
- containerDom.addEventListener("scroll", getContentDirection);
148
- window.addEventListener("resize", getContentDirection);
149
- window.addEventListener("click", addEventListenerClick);
150
- return () => {
151
- containerDom.removeEventListener("scroll", getContentDirection);
152
- window.removeEventListener("resize", getContentDirection);
153
- window.removeEventListener("click", addEventListenerClick);
154
- };
155
- }
156
- if (isMini && open) {
157
- calcAfterMounted(getContentDirection);
158
- }
159
- }, [container, open]);
160
- const renderContent = () => {
161
- return /* @__PURE__ */ React.createElement(
162
- "div",
163
- {
164
- className: clsx(
165
- `${prefixCls}-container`,
166
- `${prefixCls}-${contentPosition}`
167
- ),
168
- style: {
169
- width: containerWidth
170
- },
171
- ref: contentRef
172
- },
173
- /* @__PURE__ */ React.createElement(
174
- "div",
175
- {
176
- className: `${prefixCls}-container-${transform && open ? "open" : "close"} ${prefixCls}-container-content`,
177
- style: {
178
- transformOrigin: `${directionMap[contentPosition]} center`
179
- },
180
- onTransitionEnd: () => {
181
- if (!open) {
182
- setTransform(false);
183
- }
184
- }
185
- },
186
- content
187
- )
188
- );
189
- };
190
- useEffect(() => {
191
- if (open) {
192
- calcAfterMounted(() => {
193
- setTransform(true);
194
- });
195
- }
196
- }, [open]);
197
- const renderContainer = useMemo(() => {
198
- return open || transform;
199
- }, [open, transform]);
200
- useDidMountEffect(() => {
201
- if (!renderContainer) {
202
- onUnmounted == null ? void 0 : onUnmounted();
203
- } else {
204
- onMount == null ? void 0 : onMount();
205
- }
206
- }, [renderContainer]);
207
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", __spreadValues({ ref, className: clsx(prefixCls, className) }, others), renderChildren), !isMini && renderContainer && /* @__PURE__ */ React.createElement(Portal, null, renderContent()), isMini && renderContainer && /* @__PURE__ */ React.createElement(Portal, null, renderContent(), !miniBackdropInvisible && /* @__PURE__ */ React.createElement(
208
- Backdrop,
209
- __spreadProps(__spreadValues({}, BackdropProps), {
210
- invisible: true,
211
- open,
212
- onClick: (e) => onClose(e, { value: !open })
213
- })
214
- )));
215
- }
216
- );
217
- DesktopPicker.displayName = "BUIDesktopPicker";
218
- var DesktopPicker_default = DesktopPicker;
219
- export {
220
- DesktopPicker_default as default
221
- };
@@ -1,57 +0,0 @@
1
- import React from 'react';
2
- import { OverrideProps } from '@bifrostui/types';
3
- import { BackdropProps } from '../Backdrop/Backdrop.types';
4
- export type DesktopPickerProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
5
- props: P & {
6
- /**
7
- * 是否继承宽度
8
- * @default true
9
- */
10
- inheritWidth?: boolean;
11
- /**
12
- * 是否打开
13
- */
14
- open: boolean;
15
- /**
16
- * 浮层的内容
17
- */
18
- content?: React.ReactNode;
19
- /**
20
- * 浮层宽度
21
- */
22
- containerWidth?: number;
23
- /**
24
- * 是否指定滚动容器
25
- */
26
- container?: HTMLElement | (() => HTMLElement);
27
- /**
28
- * 小程序是否使用backdrop
29
- * @default false
30
- */
31
- miniBackdropInvisible?: boolean;
32
- /**
33
- * 关闭浮层
34
- */
35
- onClose?: (e: React.MouseEvent<any>, data: {
36
- value: boolean;
37
- }) => void;
38
- /**
39
- * 打开后动画开始的回调
40
- */
41
- onMount?: () => void;
42
- /**
43
- * 卸载后动画结束的回调
44
- */
45
- onUnmounted?: () => void;
46
- /**
47
- * 默认的浮层位置
48
- * @default bottom
49
- */
50
- defaultDirection?: 'top' | 'bottom';
51
- /**
52
- * 透传浮层的Props
53
- */
54
- BackdropProps?: BackdropProps;
55
- };
56
- defaultComponent: D;
57
- }, D>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,37 +0,0 @@
1
- :root,
2
- page,
3
- xhs-page {
4
- --bui-desktop-picker-zindex: var(--bui-z-index-tooltip);
5
- --bui-desktop-picker-bg: var(--bui-color-bg-view);
6
- --bui-desktop-picker-shadow: 0 0 0 2px var(--bui-color-bg-default);
7
- }
8
- .bui-desktop-picker {
9
- position: relative;
10
- height: 100%;
11
- }
12
- .bui-desktop-picker-container {
13
- position: absolute;
14
- box-sizing: border-box;
15
- visibility: hidden;
16
- z-index: var(--bui-desktop-picker-zindex);
17
- }
18
- .bui-desktop-picker-container-content {
19
- border-radius: 3px;
20
- background-color: var(--bui-desktop-picker-bg);
21
- box-shadow: var(--bui-desktop-picker-shadow);
22
- }
23
- .bui-desktop-picker-container-open {
24
- transform: none;
25
- transition: opacity 321ms cubic-bezier(0.4, 0, 0.2, 1), transform 214ms cubic-bezier(0.4, 0, 0.2, 1);
26
- }
27
- .bui-desktop-picker-container-close {
28
- opacity: 0;
29
- transform: scale(0.75, 0.5625);
30
- transition: opacity 321ms cubic-bezier(0.4, 0, 0.2, 1), transform 214ms cubic-bezier(0.4, 0, 0.2, 1) 107ms;
31
- }
32
- .bui-desktop-picker-top {
33
- margin-top: -6px;
34
- }
35
- .bui-desktop-picker-bottom {
36
- margin-top: 6px;
37
- }
@@ -1,2 +0,0 @@
1
- export { default as DesktopPicker, default } from './DesktopPicker';
2
- export * from './DesktopPicker.types';
@@ -1,6 +0,0 @@
1
- import { default as default2, default as default3 } from "./DesktopPicker";
2
- export * from "./DesktopPicker.types";
3
- export {
4
- default2 as DesktopPicker,
5
- default3 as default
6
- };
@@ -1,2 +0,0 @@
1
- declare const _default: (fn: any) => void;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- var calcAfterMounted_default = (fn) => {
2
- fn();
3
- };
4
- export {
5
- calcAfterMounted_default as default
6
- };
@@ -1,2 +0,0 @@
1
- declare const _default: (fn: any) => void;
2
- export default _default;
@@ -1,9 +0,0 @@
1
- import Taro from "@tarojs/taro";
2
- var calcAfterMounted_miniapp_default = (fn) => {
3
- Taro.nextTick(() => {
4
- fn();
5
- });
6
- };
7
- export {
8
- calcAfterMounted_miniapp_default as default
9
- };
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { TimePickerProps } from './DesktopTimePicker.types';
3
- import './index.less';
4
- declare const DesktopTimePicker: React.ForwardRefExoticComponent<Omit<TimePickerProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
- export default DesktopTimePicker;