@bifrostui/react 1.4.7-beta.0 → 2.0.0-beta.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 (304) 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.js +4 -10
  125. package/es/NavBar/NavBar.js +0 -1
  126. package/es/Picker/Picker.css +0 -5
  127. package/es/Picker/Picker.js +5 -27
  128. package/es/Picker/Picker.types.d.ts +2 -15
  129. package/es/Picker/PickerPanel.css +0 -4
  130. package/es/Picker/PickerPanel.js +6 -7
  131. package/es/Popover/Popover.css +5 -5
  132. package/es/Popover/Popover.js +29 -73
  133. package/es/Portal/Portal.miniapp.js +5 -8
  134. package/es/Radio/Radio.css +0 -1
  135. package/es/Radio/Radio.js +2 -6
  136. package/es/Radio/RadioGroup.js +0 -3
  137. package/es/Rating/Rating.js +8 -18
  138. package/es/ScrollView/ScrollView.js +11 -24
  139. package/es/ScrollView/ScrollView.types.d.ts +1 -0
  140. package/es/Select/Select.css +4 -1
  141. package/es/Select/Select.js +42 -68
  142. package/es/Skeleton/Skeleton.js +5 -9
  143. package/es/Slide/Slide.js +69 -74
  144. package/es/Slider/Slider.js +12 -30
  145. package/es/Steps/Step.js +81 -82
  146. package/es/Steps/Steps.d.ts +1 -1
  147. package/es/Steps/Steps.js +57 -60
  148. package/es/Switch/Switch.js +75 -78
  149. package/es/TabBar/TabBar.js +3 -8
  150. package/es/Tabs/Tab.css +10 -16
  151. package/es/Tabs/Tab.js +2 -3
  152. package/es/Tabs/Tabs.css +13 -22
  153. package/es/Tabs/Tabs.js +41 -83
  154. package/es/Tabs/Tabs.types.d.ts +0 -10
  155. package/es/Tabs/utils/bound.d.ts +1 -0
  156. package/es/Tabs/utils/bound.js +13 -0
  157. package/es/Tag/Tag.css +1 -1
  158. package/es/Tag/Tag.js +2 -6
  159. package/es/TextArea/TextArea.js +5 -12
  160. package/es/Toast/FunctionalToast.js +2 -2
  161. package/es/Toast/Toast.css +1 -0
  162. package/es/Tooltip/Tooltip.css +5 -5
  163. package/es/Tooltip/Tooltip.js +29 -73
  164. package/es/Transition/TransitionCore.js +3 -8
  165. package/es/index.d.ts +0 -6
  166. package/es/index.js +0 -6
  167. package/es/locales/base.d.ts +0 -11
  168. package/es/locales/en-US.js +0 -24
  169. package/es/locales/zh-CN.js +0 -24
  170. package/es/locales/zh-TW.js +0 -24
  171. package/package.json +6 -6
  172. package/dist/Collapse/Collapse.miniapp.d.ts +0 -5
  173. package/dist/Collapse/Collapse.miniapp.js +0 -177
  174. package/dist/DatePicker/DatePicker.d.ts +0 -4
  175. package/dist/DatePicker/DatePicker.js +0 -335
  176. package/dist/DatePicker/DatePicker.types.d.ts +0 -43
  177. package/dist/DatePicker/DatePicker.types.js +0 -35
  178. package/dist/DatePicker/index.d.ts +0 -2
  179. package/dist/DatePicker/index.js +0 -41
  180. package/dist/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
  181. package/dist/DesktopDatePicker/DesktopDatePicker.js +0 -280
  182. package/dist/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
  183. package/dist/DesktopDatePicker/DesktopDatePicker.types.js +0 -15
  184. package/dist/DesktopDatePicker/deskTopPickerContainer.css +0 -100
  185. package/dist/DesktopDatePicker/index.css +0 -61
  186. package/dist/DesktopDatePicker/index.d.ts +0 -2
  187. package/dist/DesktopDatePicker/index.js +0 -41
  188. package/dist/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
  189. package/dist/DesktopDatePicker/useGetDatePickerContent.js +0 -343
  190. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
  191. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -322
  192. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
  193. package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -15
  194. package/dist/DesktopDateTimePicker/index.css +0 -66
  195. package/dist/DesktopDateTimePicker/index.d.ts +0 -2
  196. package/dist/DesktopDateTimePicker/index.js +0 -41
  197. package/dist/DesktopPicker/DesktopPicker.d.ts +0 -5
  198. package/dist/DesktopPicker/DesktopPicker.js +0 -238
  199. package/dist/DesktopPicker/DesktopPicker.types.d.ts +0 -57
  200. package/dist/DesktopPicker/DesktopPicker.types.js +0 -15
  201. package/dist/DesktopPicker/index.css +0 -37
  202. package/dist/DesktopPicker/index.d.ts +0 -2
  203. package/dist/DesktopPicker/index.js +0 -41
  204. package/dist/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
  205. package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
  206. package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -38
  207. package/dist/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
  208. package/dist/DesktopTimePicker/DesktopTimePicker.js +0 -288
  209. package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
  210. package/dist/DesktopTimePicker/DesktopTimePicker.types.js +0 -15
  211. package/dist/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
  212. package/dist/DesktopTimePicker/DesktopTimePickerList.js +0 -111
  213. package/dist/DesktopTimePicker/index.css +0 -170
  214. package/dist/DesktopTimePicker/index.d.ts +0 -2
  215. package/dist/DesktopTimePicker/index.js +0 -41
  216. package/dist/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
  217. package/dist/DesktopTimePicker/useGetTimePickerContent.js +0 -246
  218. package/dist/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
  219. package/dist/DesktopTimePicker/utils/scrollUtil.js +0 -27
  220. package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
  221. package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -51
  222. package/dist/DesktopTimePicker/utils/utils.d.ts +0 -28
  223. package/dist/DesktopTimePicker/utils/utils.js +0 -408
  224. package/dist/SwipeAction/SwipeAction.css +0 -79
  225. package/dist/SwipeAction/SwipeAction.d.ts +0 -5
  226. package/dist/SwipeAction/SwipeAction.js +0 -349
  227. package/dist/SwipeAction/SwipeAction.types.d.ts +0 -83
  228. package/dist/SwipeAction/SwipeAction.types.js +0 -39
  229. package/dist/SwipeAction/SwipeActionContext.d.ts +0 -4
  230. package/dist/SwipeAction/SwipeActionContext.js +0 -30
  231. package/dist/SwipeAction/SwipeActionItem.css +0 -31
  232. package/dist/SwipeAction/SwipeActionItem.d.ts +0 -5
  233. package/dist/SwipeAction/SwipeActionItem.js +0 -105
  234. package/dist/SwipeAction/index.d.ts +0 -4
  235. package/dist/SwipeAction/index.js +0 -45
  236. package/dist/Tabs/utils/scroll.d.ts +0 -2
  237. package/dist/Tabs/utils/scroll.js +0 -55
  238. package/es/Collapse/Collapse.miniapp.d.ts +0 -5
  239. package/es/Collapse/Collapse.miniapp.js +0 -157
  240. package/es/DatePicker/DatePicker.d.ts +0 -4
  241. package/es/DatePicker/DatePicker.js +0 -310
  242. package/es/DatePicker/DatePicker.types.d.ts +0 -43
  243. package/es/DatePicker/DatePicker.types.js +0 -1
  244. package/es/DatePicker/index.d.ts +0 -2
  245. package/es/DatePicker/index.js +0 -6
  246. package/es/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
  247. package/es/DesktopDatePicker/DesktopDatePicker.js +0 -253
  248. package/es/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
  249. package/es/DesktopDatePicker/DesktopDatePicker.types.js +0 -1
  250. package/es/DesktopDatePicker/deskTopPickerContainer.css +0 -100
  251. package/es/DesktopDatePicker/index.css +0 -61
  252. package/es/DesktopDatePicker/index.d.ts +0 -2
  253. package/es/DesktopDatePicker/index.js +0 -6
  254. package/es/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
  255. package/es/DesktopDatePicker/useGetDatePickerContent.js +0 -316
  256. package/es/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
  257. package/es/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -295
  258. package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
  259. package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -1
  260. package/es/DesktopDateTimePicker/index.css +0 -66
  261. package/es/DesktopDateTimePicker/index.d.ts +0 -2
  262. package/es/DesktopDateTimePicker/index.js +0 -9
  263. package/es/DesktopPicker/DesktopPicker.d.ts +0 -5
  264. package/es/DesktopPicker/DesktopPicker.js +0 -221
  265. package/es/DesktopPicker/DesktopPicker.types.d.ts +0 -57
  266. package/es/DesktopPicker/DesktopPicker.types.js +0 -1
  267. package/es/DesktopPicker/index.css +0 -37
  268. package/es/DesktopPicker/index.d.ts +0 -2
  269. package/es/DesktopPicker/index.js +0 -6
  270. package/es/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
  271. package/es/DesktopPicker/utils/calcAfterMounted.js +0 -6
  272. package/es/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
  273. package/es/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -9
  274. package/es/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
  275. package/es/DesktopTimePicker/DesktopTimePicker.js +0 -261
  276. package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
  277. package/es/DesktopTimePicker/DesktopTimePicker.types.js +0 -1
  278. package/es/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
  279. package/es/DesktopTimePicker/DesktopTimePickerList.js +0 -84
  280. package/es/DesktopTimePicker/index.css +0 -170
  281. package/es/DesktopTimePicker/index.d.ts +0 -2
  282. package/es/DesktopTimePicker/index.js +0 -6
  283. package/es/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
  284. package/es/DesktopTimePicker/useGetTimePickerContent.js +0 -223
  285. package/es/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
  286. package/es/DesktopTimePicker/utils/scrollUtil.js +0 -8
  287. package/es/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
  288. package/es/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -22
  289. package/es/DesktopTimePicker/utils/utils.d.ts +0 -28
  290. package/es/DesktopTimePicker/utils/utils.js +0 -365
  291. package/es/SwipeAction/SwipeAction.css +0 -79
  292. package/es/SwipeAction/SwipeAction.d.ts +0 -5
  293. package/es/SwipeAction/SwipeAction.js +0 -337
  294. package/es/SwipeAction/SwipeAction.types.d.ts +0 -83
  295. package/es/SwipeAction/SwipeAction.types.js +0 -1
  296. package/es/SwipeAction/SwipeActionContext.d.ts +0 -4
  297. package/es/SwipeAction/SwipeActionContext.js +0 -11
  298. package/es/SwipeAction/SwipeActionItem.css +0 -31
  299. package/es/SwipeAction/SwipeActionItem.d.ts +0 -5
  300. package/es/SwipeAction/SwipeActionItem.js +0 -78
  301. package/es/SwipeAction/index.d.ts +0 -4
  302. package/es/SwipeAction/index.js +0 -9
  303. package/es/Tabs/utils/scroll.d.ts +0 -2
  304. package/es/Tabs/utils/scroll.js +0 -36
@@ -1,45 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var SwipeAction_exports = {};
30
- __export(SwipeAction_exports, {
31
- SwipeAction: () => import_SwipeAction2.default,
32
- SwipeActionItem: () => import_SwipeActionItem.default,
33
- default: () => import_SwipeAction.default
34
- });
35
- module.exports = __toCommonJS(SwipeAction_exports);
36
- __reExport(SwipeAction_exports, require("./SwipeAction.types"), module.exports);
37
- var import_SwipeAction = __toESM(require("./SwipeAction"));
38
- var import_SwipeAction2 = __toESM(require("./SwipeAction"));
39
- var import_SwipeActionItem = __toESM(require("./SwipeActionItem"));
40
- // Annotate the CommonJS export names for ESM import in node:
41
- 0 && (module.exports = {
42
- SwipeAction,
43
- SwipeActionItem,
44
- ...require("./SwipeAction.types")
45
- });
@@ -1,2 +0,0 @@
1
- declare const scrollLeftTo: (scroller: HTMLElement, to: number, duration: number) => void;
2
- export default scrollLeftTo;
@@ -1,55 +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 scroll_exports = {};
19
- __export(scroll_exports, {
20
- default: () => scroll_default
21
- });
22
- module.exports = __toCommonJS(scroll_exports);
23
- const root = window || global;
24
- let rafId;
25
- let prev = Date.now();
26
- const rafPolyfill = (fn) => {
27
- const curr = Date.now();
28
- const ms = Math.max(0, 16 - (curr - prev));
29
- const id = setTimeout(fn, ms);
30
- prev = curr + ms;
31
- return id;
32
- };
33
- const cancelRaf = (id) => {
34
- const cancelAnimationFrame = (root == null ? void 0 : root.cancelAnimationFrame) || (root == null ? void 0 : root.clearTimeout) || clearTimeout;
35
- cancelAnimationFrame.call(root, id);
36
- };
37
- const raf = (fn) => {
38
- const requestAnimationFrame = (root == null ? void 0 : root.requestAnimationFrame) || rafPolyfill;
39
- return requestAnimationFrame.call(root, fn);
40
- };
41
- const scrollLeftTo = (scroller, to, duration) => {
42
- cancelRaf(rafId);
43
- let count = 0;
44
- const from = scroller.scrollLeft;
45
- const frames = duration === 0 ? 1 : Math.round(duration / 16);
46
- function animate() {
47
- scroller.scrollLeft += (to - from) / frames;
48
- count += 1;
49
- if (count < frames) {
50
- rafId = raf(animate);
51
- }
52
- }
53
- animate();
54
- };
55
- var scroll_default = scrollLeftTo;
@@ -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,157 +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
- import React, { useEffect, useRef, useState } from "react";
33
- import {
34
- useForkRef,
35
- duration,
36
- easing,
37
- getTransitionProps,
38
- createTransitions,
39
- getBoundingClientRect
40
- } from "@bifrostui/utils";
41
- import { Transition } from "../Transition";
42
- import "./Collapse.css";
43
- const defaultEasing = {
44
- enter: easing.easeOut,
45
- exit: easing.sharp
46
- };
47
- const defaultTimeout = {
48
- enter: duration.enteringScreen,
49
- exit: duration.leavingScreen
50
- };
51
- const FIT_CONTENT = "fit-content";
52
- const Collapse = /* @__PURE__ */ React.forwardRef((props, ref) => {
53
- const _a = props, {
54
- appear = false,
55
- in: inProp,
56
- easing: easingProp = defaultEasing,
57
- direction = "vertical",
58
- timeout = defaultTimeout,
59
- delay = 0,
60
- collapsedSize: collapsedSizeProp = 0,
61
- style,
62
- className,
63
- children
64
- } = _a, other = __objRest(_a, [
65
- "appear",
66
- "in",
67
- "easing",
68
- "direction",
69
- "timeout",
70
- "delay",
71
- "collapsedSize",
72
- "style",
73
- "className",
74
- "children"
75
- ]);
76
- const wrapperRef = useRef(null);
77
- const collapseRef = useForkRef(wrapperRef, ref);
78
- const [wrapperSize, setWrapperSize] = useState("");
79
- const transitions = createTransitions();
80
- const isHorizontal = direction === "horizontal";
81
- const collapsedSize = typeof collapsedSizeProp === "number" ? `${collapsedSizeProp}px` : collapsedSizeProp;
82
- const size = isHorizontal ? "width" : "height";
83
- const getCollapseWrapperSize = (reactNode) => {
84
- return new Promise((resolve) => {
85
- var _a2;
86
- const reactNodeChild = (_a2 = reactNode == null ? void 0 : reactNode.children) == null ? void 0 : _a2[0];
87
- if (!reactNodeChild) {
88
- resolve(FIT_CONTENT);
89
- }
90
- getBoundingClientRect(reactNodeChild).then((res) => {
91
- if (!res) {
92
- resolve(FIT_CONTENT);
93
- setWrapperSize(FIT_CONTENT);
94
- } else {
95
- setWrapperSize(isHorizontal ? `${res == null ? void 0 : res.width}px` : `${res == null ? void 0 : res.height}px`);
96
- }
97
- });
98
- });
99
- };
100
- useEffect(() => {
101
- if (appear === false && inProp === true && wrapperSize === FIT_CONTENT) {
102
- getCollapseWrapperSize(wrapperRef.current).then((res) => {
103
- setWrapperSize(res);
104
- });
105
- }
106
- }, [appear, inProp]);
107
- if (!children)
108
- return null;
109
- return /* @__PURE__ */ React.createElement(
110
- Transition,
111
- __spreadProps(__spreadValues({}, other), {
112
- in: inProp,
113
- timeout,
114
- delay,
115
- appear
116
- }),
117
- (state, childProps) => {
118
- var _a2;
119
- const transition = transitions.create(
120
- size,
121
- getTransitionProps(
122
- { timeout, style, easing: easingProp, delay },
123
- { mode: state }
124
- )
125
- );
126
- if (state === "entering" || state === "entered") {
127
- getCollapseWrapperSize(wrapperRef.current).then(
128
- (res = FIT_CONTENT) => {
129
- setWrapperSize(res);
130
- }
131
- );
132
- } else {
133
- setWrapperSize(collapsedSize);
134
- }
135
- return React.createElement(
136
- "div",
137
- __spreadProps(__spreadValues({
138
- className: `bui-collapse ${className || ""}`,
139
- style: __spreadValues(__spreadProps(__spreadValues({}, style), {
140
- transition,
141
- WebkitTransition: transition
142
- }), isHorizontal ? { width: wrapperSize, WebKitWidth: wrapperSize } : { height: wrapperSize, WebKitHeight: wrapperSize })
143
- }, childProps), {
144
- ref: collapseRef
145
- }),
146
- React.cloneElement(children, {
147
- style: __spreadValues({}, (_a2 = children.props) == null ? void 0 : _a2.style)
148
- })
149
- );
150
- }
151
- );
152
- });
153
- Collapse.displayName = "BuiCollapse";
154
- var Collapse_miniapp_default = Collapse;
155
- export {
156
- Collapse_miniapp_default as default
157
- };
@@ -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,310 +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
- import React, { forwardRef, useEffect, useState } from "react";
33
- import clsx from "clsx";
34
- import { useValue } from "@bifrostui/utils";
35
- import {
36
- DatePickerType
37
- } from "./DatePicker.types";
38
- import Picker from "../Picker";
39
- import { useLocaleText } from "../locales";
40
- const MIN_DATE = new Date((/* @__PURE__ */ new Date()).getFullYear() - 10, 0, 1);
41
- const MAX_DATE = new Date((/* @__PURE__ */ new Date()).getFullYear() + 10, 11, 31);
42
- const DEFAULT_PICKER = [
43
- DatePickerType.YEAR,
44
- DatePickerType.MONTH,
45
- DatePickerType.DAY
46
- ];
47
- function isValidDate(value) {
48
- return value instanceof Date && !Number.isNaN(value.getTime());
49
- }
50
- const padZero = (num, targetLength = 2) => {
51
- let str = `${num}`;
52
- while (str.length < targetLength) {
53
- str = `0${str}`;
54
- }
55
- return str;
56
- };
57
- const getMaxDay = (year, monthIndex) => {
58
- return new Date(year, monthIndex + 1, 0).getDate();
59
- };
60
- const getDateTypeValue = (date, type) => {
61
- switch (type) {
62
- case DatePickerType.YEAR:
63
- return date.getFullYear();
64
- case DatePickerType.MONTH:
65
- return date.getMonth() + 1;
66
- case DatePickerType.DAY:
67
- return date.getDate();
68
- case DatePickerType.HOUR:
69
- return date.getHours();
70
- case DatePickerType.MINUTE:
71
- return date.getMinutes();
72
- case DatePickerType.SECOND:
73
- return date.getSeconds();
74
- default:
75
- throw new Error(`\u9519\u8BEF\u7684picker\u7C7B\u578B\uFF1A${type}`);
76
- }
77
- };
78
- const DatePicker = forwardRef((props, ref) => {
79
- const _a = props, {
80
- className,
81
- value: propValue,
82
- defaultValue,
83
- views = DEFAULT_PICKER,
84
- minDate: propMinDate = MIN_DATE,
85
- maxDate: propMaxDate = MAX_DATE,
86
- showUnit = false,
87
- formatter,
88
- filter,
89
- disableDateTimeView,
90
- dateTimeStep,
91
- onConfirm,
92
- onClose,
93
- onChange
94
- } = _a, others = __objRest(_a, [
95
- "className",
96
- "value",
97
- "defaultValue",
98
- "views",
99
- "minDate",
100
- "maxDate",
101
- "showUnit",
102
- "formatter",
103
- "filter",
104
- "disableDateTimeView",
105
- "dateTimeStep",
106
- "onConfirm",
107
- "onClose",
108
- "onChange"
109
- ]);
110
- const [options, setOptions] = useState([]);
111
- const [pickerValue, setPickerValue] = useState([]);
112
- const datePickerText = useLocaleText("datePicker");
113
- const formatDate = (date) => {
114
- let formattedDate = date;
115
- if (!formattedDate || !isValidDate(date) || formattedDate.getTime() < propMinDate.getTime()) {
116
- formattedDate = propMinDate;
117
- }
118
- if (formattedDate.getTime() > propMaxDate.getTime()) {
119
- formattedDate = propMaxDate;
120
- }
121
- return formattedDate;
122
- };
123
- const [currentDate, triggerChange] = useValue({
124
- value: propValue && formatDate(propValue),
125
- defaultValue: formatDate(defaultValue)
126
- });
127
- const handleConfirm = (e) => {
128
- onConfirm == null ? void 0 : onConfirm(e, { value: currentDate });
129
- };
130
- const handleClose = (e) => {
131
- onClose == null ? void 0 : onClose(e, { value: currentDate });
132
- };
133
- const handleChange = (e, { value, columnIndex }) => {
134
- if (value[columnIndex] === null)
135
- return;
136
- const current = new Date(currentDate);
137
- switch (views[columnIndex]) {
138
- case DatePickerType.YEAR:
139
- current.setFullYear(value[columnIndex]);
140
- break;
141
- case DatePickerType.MONTH: {
142
- const selectedMaxDay = getMaxDay(
143
- current.getFullYear(),
144
- Number(value[columnIndex]) - 1
145
- );
146
- if (current.getDate() > selectedMaxDay) {
147
- current.setDate(selectedMaxDay);
148
- }
149
- current.setMonth(value[columnIndex] - 1);
150
- break;
151
- }
152
- case DatePickerType.DAY:
153
- current.setDate(value[columnIndex]);
154
- break;
155
- case DatePickerType.HOUR:
156
- current.setHours(value[columnIndex]);
157
- break;
158
- case DatePickerType.MINUTE:
159
- current.setMinutes(value[columnIndex]);
160
- break;
161
- case DatePickerType.SECOND:
162
- current.setSeconds(value[columnIndex]);
163
- break;
164
- default:
165
- throw new Error(`\u9519\u8BEF\u7684picker\u7C7B\u578B\uFF1A${views[columnIndex]}`);
166
- }
167
- triggerChange(e, formatDate(current));
168
- onChange == null ? void 0 : onChange(e, { type: views[columnIndex], value: current });
169
- };
170
- const formatOption = (type, value) => {
171
- let label = padZero(value);
172
- if (formatter) {
173
- return formatter(type, {
174
- value,
175
- label
176
- });
177
- }
178
- if (showUnit) {
179
- label += datePickerText[type];
180
- }
181
- return { value, label };
182
- };
183
- const generateOptions = (min, max, type, columnIndex) => {
184
- const step = (dateTimeStep == null ? void 0 : dateTimeStep[type]) || 1;
185
- let valueIndex = 0;
186
- const optionsArray = Array.from(
187
- { length: (max - min + 1) / step || 1 },
188
- (_, index) => {
189
- const value = index * step + min;
190
- if (value <= getDateTypeValue(currentDate, type)) {
191
- valueIndex = index;
192
- }
193
- return formatOption(type, value);
194
- }
195
- );
196
- pickerValue[columnIndex] = optionsArray[valueIndex].value;
197
- setPickerValue([...pickerValue]);
198
- if ((disableDateTimeView == null ? void 0 : disableDateTimeView[type]) && typeof disableDateTimeView[type] === "function") {
199
- const disabledOptionsValue = disableDateTimeView[type](
200
- optionsArray.map((i) => i.value)
201
- );
202
- return optionsArray.map((option) => {
203
- if (disabledOptionsValue.includes(option.value)) {
204
- return __spreadProps(__spreadValues({}, option), {
205
- disabled: true
206
- });
207
- }
208
- return option;
209
- });
210
- }
211
- if (filter) {
212
- return filter(type, optionsArray);
213
- }
214
- return optionsArray;
215
- };
216
- const getBoundary = (type, value) => {
217
- const boundary = type === "min" ? propMinDate : propMaxDate;
218
- const year = boundary.getFullYear();
219
- let month = 1;
220
- let date = 1;
221
- let hour = 0;
222
- let minute = 0;
223
- let seconds = 0;
224
- if (type === "max") {
225
- month = 12;
226
- date = getMaxDay(value.getFullYear(), value.getMonth());
227
- hour = 23;
228
- minute = 59;
229
- seconds = 59;
230
- }
231
- if (value.getFullYear() === year) {
232
- month = boundary.getMonth() + 1;
233
- if (value.getMonth() + 1 === month) {
234
- date = boundary.getDate();
235
- if (value.getDate() === date) {
236
- hour = boundary.getHours();
237
- if (value.getHours() === hour) {
238
- minute = boundary.getMinutes();
239
- if (value.getMinutes() === minute) {
240
- seconds = boundary.getSeconds();
241
- }
242
- }
243
- }
244
- }
245
- }
246
- return {
247
- [`${type}Year`]: year,
248
- [`${type}Month`]: month,
249
- [`${type}Date`]: date,
250
- [`${type}Hour`]: hour,
251
- [`${type}Minute`]: minute,
252
- [`${type}Seconds`]: seconds
253
- };
254
- };
255
- const generateRanges = () => {
256
- const ranges = [];
257
- const { minYear, minMonth, minDate, minHour, minMinute, minSeconds } = getBoundary("min", currentDate);
258
- const { maxYear, maxMonth, maxDate, maxHour, maxMinute, maxSeconds } = getBoundary("max", currentDate);
259
- for (let i = 0; i < views.length; i += 1) {
260
- const type = views[i];
261
- switch (type) {
262
- case DatePickerType.YEAR:
263
- ranges.push([minYear, maxYear]);
264
- break;
265
- case DatePickerType.MONTH:
266
- ranges.push([minMonth, maxMonth]);
267
- break;
268
- case DatePickerType.DAY:
269
- ranges.push([minDate, maxDate]);
270
- break;
271
- case DatePickerType.HOUR:
272
- ranges.push([minHour, maxHour]);
273
- break;
274
- case DatePickerType.MINUTE:
275
- ranges.push([minMinute, maxMinute]);
276
- break;
277
- case DatePickerType.SECOND:
278
- ranges.push([minSeconds, maxSeconds]);
279
- break;
280
- default:
281
- throw new Error(`\u9519\u8BEF\u7684picker\u7C7B\u578B\uFF1A${type}`);
282
- }
283
- }
284
- return ranges;
285
- };
286
- const generateRangeOptions = () => generateRanges().map(
287
- (range, index) => generateOptions(range[0], range[1], views[index], index)
288
- );
289
- useEffect(() => {
290
- setOptions(generateRangeOptions());
291
- }, [currentDate, views, propMinDate, propMaxDate]);
292
- return /* @__PURE__ */ React.createElement(
293
- Picker,
294
- __spreadProps(__spreadValues({}, others), {
295
- "data-selected": currentDate ? currentDate.getTime() : "",
296
- className: clsx("bui-date-picker", className),
297
- ref,
298
- options,
299
- value: pickerValue,
300
- onConfirm: handleConfirm,
301
- onClose: handleClose,
302
- onOptionChange: handleChange
303
- })
304
- );
305
- });
306
- DatePicker.displayName = "BuiDatePicker";
307
- var DatePicker_default = DatePicker;
308
- export {
309
- DatePicker_default as default
310
- };
@@ -1,43 +0,0 @@
1
- import React from 'react';
2
- import { OverrideProps } from '@bifrostui/types';
3
- import { PickerProps, IPickerOptionItem } from '../Picker';
4
- export declare enum DatePickerType {
5
- YEAR = "year",
6
- MONTH = "month",
7
- DAY = "day",
8
- HOUR = "hour",
9
- MINUTE = "minute",
10
- SECOND = "second"
11
- }
12
- export type DatePickerOption = IPickerOptionItem & {
13
- value: number;
14
- };
15
- export type DatePickerProps<D extends React.ElementType = 'div', P = Omit<PickerProps, 'value' | 'defaultValue' | 'onChange' | 'onConfirm' | 'onClose'>> = OverrideProps<{
16
- props: P & {
17
- defaultValue?: Date;
18
- value?: Date;
19
- views?: DatePickerType[];
20
- minDate?: Date;
21
- maxDate?: Date;
22
- showUnit?: boolean;
23
- disableDateTimeView?: Partial<{
24
- [key in DatePickerType]: (options: number[]) => number[];
25
- }>;
26
- dateTimeStep?: Partial<{
27
- [key in DatePickerType]: number;
28
- }>;
29
- formatter?: (type: DatePickerType, option: DatePickerOption) => DatePickerOption;
30
- filter?: (type: DatePickerType, options: DatePickerOption[]) => DatePickerOption[];
31
- onConfirm?: (e: React.SyntheticEvent, { value }: {
32
- value: Date;
33
- }) => void;
34
- onClose?: (e: React.SyntheticEvent, { value }: {
35
- value: Date;
36
- }) => void;
37
- onChange?: (e: React.SyntheticEvent, { value }: {
38
- type: DatePickerType;
39
- value: Date;
40
- }) => void;
41
- };
42
- defaultComponent: D;
43
- }, D>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- export { default, default as DatePicker } from './DatePicker';
2
- export * from './DatePicker.types';
@@ -1,6 +0,0 @@
1
- import { default as default2, default as default3 } from "./DatePicker";
2
- export * from "./DatePicker.types";
3
- export {
4
- default3 as DatePicker,
5
- default2 as default
6
- };
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { DesktopDatePickerProps } from './DesktopDatePicker.types';
3
- import './index.less';
4
- declare const DesktopDatePicker: React.ForwardRefExoticComponent<Omit<DesktopDatePickerProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
5
- export default DesktopDatePicker;