@bifrostui/react 1.4.8-beta.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.
- package/dist/ActionSheet/ActionSheet.css +16 -6
- package/dist/ActionSheet/ActionSheetItem.css +11 -17
- package/dist/ActionSheet/ActionSheetItem.js +3 -8
- package/dist/ActionSheet/ActionSheetItem.types.d.ts +2 -2
- package/dist/ActionSheet/index.css +89 -0
- package/dist/Alert/Alert.types.d.ts +3 -3
- package/dist/Alert/index.css +18 -14
- package/dist/Avatar/Avatar.css +16 -12
- package/dist/Avatar/Avatar.js +3 -8
- package/dist/Avatar/AvatarGroup.css +19 -15
- package/dist/Avatar/AvatarGroup.js +2 -6
- package/dist/Avatar/index.css +93 -0
- package/dist/Backdrop/Backdrop.d.ts +1 -1
- package/dist/Backdrop/Backdrop.js +1 -1
- package/dist/Backdrop/{Backdrop.css → index.css} +6 -2
- package/dist/Badge/Badge.d.ts +1 -1
- package/dist/Badge/Badge.js +4 -9
- package/dist/Badge/Badge.types.d.ts +1 -1
- package/dist/Badge/{Badge.css → index.css} +47 -27
- package/dist/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/Breadcrumb/index.css +38 -0
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.js +6 -11
- package/dist/Button/Button.types.d.ts +8 -7
- package/{es/Button/Button.css → dist/Button/index.css} +93 -63
- package/dist/Calendar/Calendar.d.ts +1 -1
- package/dist/Calendar/Calendar.js +10 -22
- package/dist/Calendar/Calendar.types.d.ts +0 -5
- package/dist/Calendar/{Calendar.css → index.css} +35 -31
- package/dist/Card/Card.css +9 -0
- package/dist/Card/CardContent.css +1 -2
- package/dist/Card/CardFooter.css +2 -4
- package/dist/Card/CardHeader.css +5 -5
- package/dist/Card/CardHeader.js +2 -2
- package/dist/Card/index.css +77 -0
- package/dist/Checkbox/Checkbox.d.ts +1 -1
- package/dist/Checkbox/Checkbox.js +4 -8
- package/dist/Checkbox/CheckboxGroup.d.ts +1 -1
- package/dist/Checkbox/CheckboxGroup.js +5 -8
- package/dist/Checkbox/{Checkbox.css → index.css} +14 -10
- package/dist/CitySelector/CitySelector.miniapp.d.ts +0 -1
- package/dist/CitySelector/CitySelector.miniapp.js +0 -1
- package/dist/CitySelector/CitySelectorCore.d.ts +1 -1
- package/dist/CitySelector/CitySelectorCore.js +1 -1
- package/dist/CitySelector/Selector/index.css +4 -4
- package/{es/CitySelector/CitySelector.css → dist/CitySelector/index.css} +31 -27
- package/dist/Collapse/Collapse.d.ts +2 -2
- package/dist/Collapse/Collapse.js +9 -12
- package/{es/Collapse/Collapse.css → dist/Collapse/index.css} +1 -0
- package/dist/CollapsePanel/CollapsePanel.d.ts +1 -1
- package/dist/CollapsePanel/CollapsePanel.js +1 -1
- package/dist/CollapsePanel/CollapsePanelItem.js +45 -46
- package/{es/CollapsePanel/CollapsePanel.css → dist/CollapsePanel/index.css} +12 -10
- package/dist/Countdown/Countdown.d.ts +1 -1
- package/dist/Countdown/Countdown.js +6 -13
- package/{es/Countdown/Countdown.css → dist/Countdown/index.css} +12 -8
- package/dist/Dialog/FunctionalDialog.js +1 -1
- package/dist/Dialog/index.css +26 -23
- package/dist/Divider/Divider.d.ts +1 -1
- package/dist/Divider/Divider.js +9 -6
- package/{es/Divider/Divider.css → dist/Divider/index.css} +14 -10
- package/dist/Drawer/Drawer.d.ts +1 -1
- package/dist/Drawer/Drawer.js +5 -11
- package/dist/Drawer/{Drawer.css → index.css} +2 -0
- package/dist/Fade/Fade.js +52 -56
- package/dist/IconButton/IconButton.d.ts +1 -1
- package/dist/IconButton/IconButton.js +7 -14
- package/dist/IconButton/IconButton.types.d.ts +4 -3
- package/{es/IconButton/IconButton.css → dist/IconButton/index.css} +79 -29
- package/dist/Image/Image.js +112 -119
- package/dist/Image/index.css +6 -2
- package/dist/Input/Input.d.ts +1 -1
- package/dist/Input/Input.js +6 -12
- package/{es/Input/Input.css → dist/Input/index.css} +22 -18
- package/dist/ItemSelector/ItemSelector.miniapp.d.ts +0 -1
- package/dist/ItemSelector/ItemSelector.miniapp.js +0 -1
- package/dist/ItemSelector/ItemSelectorCore.d.ts +1 -1
- package/dist/ItemSelector/ItemSelectorCore.js +1 -1
- package/dist/List/List.css +7 -3
- package/dist/List/List.js +3 -8
- package/dist/List/ListItem.css +3 -3
- package/dist/List/ListItem.js +42 -44
- package/dist/List/ListItemContent.js +1 -4
- package/dist/List/ListItemExtra.js +9 -4
- package/dist/List/ListItemFooter.js +9 -4
- package/dist/List/ListItemHeader.js +9 -4
- package/dist/List/index.css +80 -0
- package/dist/Loading/Loading.d.ts +1 -1
- package/dist/Loading/Loading.js +14 -5
- package/{es/Loading/Loading.css → dist/Loading/index.css} +10 -6
- package/dist/Modal/Modal.d.ts +1 -1
- package/dist/Modal/Modal.js +1 -7
- package/dist/Modal/Modal.miniapp.d.ts +2 -2
- package/dist/Modal/Modal.miniapp.js +5 -11
- package/dist/NavBar/NavBar.d.ts +1 -1
- package/dist/NavBar/NavBar.js +1 -2
- package/dist/NavBar/index.css +65 -0
- package/dist/Picker/Picker.css +21 -21
- package/dist/Picker/Picker.js +6 -28
- package/dist/Picker/Picker.types.d.ts +4 -17
- package/dist/Picker/PickerPanel.css +8 -12
- package/dist/Picker/PickerPanel.js +39 -29
- package/dist/Picker/index.css +116 -0
- package/dist/Popover/Popover.d.ts +1 -1
- package/dist/Popover/Popover.js +28 -71
- package/{es/Popover/Popover.css → dist/Popover/index.css} +32 -28
- package/dist/Portal/Portal.miniapp.js +4 -7
- package/dist/Progress/Progress.d.ts +1 -1
- package/dist/Progress/Progress.js +1 -1
- package/dist/Progress/index.css +28 -0
- package/dist/Radio/Radio.d.ts +1 -1
- package/dist/Radio/Radio.js +3 -7
- package/dist/Radio/RadioButtonIcon.js +6 -1
- package/dist/Radio/RadioGroup.d.ts +1 -1
- package/dist/Radio/RadioGroup.js +1 -4
- package/dist/Radio/{Radio.css → index.css} +10 -7
- package/dist/Rating/Rating.d.ts +1 -1
- package/dist/Rating/Rating.js +9 -19
- package/{es/Rating/Rating.css → dist/Rating/index.css} +20 -7
- package/dist/ScrollView/ScrollView.d.ts +1 -1
- package/dist/ScrollView/ScrollView.js +12 -25
- package/dist/ScrollView/ScrollView.types.d.ts +1 -0
- package/dist/Select/Select.d.ts +1 -1
- package/dist/Select/Select.js +43 -76
- package/dist/Select/SelectOption.d.ts +1 -1
- package/dist/Select/SelectOption.js +1 -1
- package/dist/Select/{Select.css → index.css} +30 -20
- package/dist/Skeleton/Skeleton.d.ts +1 -1
- package/dist/Skeleton/Skeleton.js +6 -10
- package/dist/Skeleton/{Skeleton.css → index.css} +7 -3
- package/dist/Slide/Slide.js +69 -74
- package/dist/Slider/Slider.d.ts +1 -1
- package/dist/Slider/Slider.js +13 -29
- package/dist/Slider/index.css +111 -0
- package/dist/Stack/Stack.d.ts +1 -1
- package/dist/Stack/Stack.js +1 -1
- package/dist/Steps/Step.css +14 -14
- package/dist/Steps/Step.js +81 -82
- package/dist/Steps/Steps.css +18 -14
- package/dist/Steps/Steps.d.ts +1 -1
- package/dist/Steps/Steps.js +57 -60
- package/dist/Steps/index.css +199 -0
- package/dist/Swiper/Swiper.d.ts +1 -1
- package/dist/Swiper/Swiper.js +1 -1
- package/{es/Swiper/Swiper.css → dist/Swiper/index.css} +6 -2
- package/dist/Switch/Switch.d.ts +1 -1
- package/dist/Switch/Switch.js +76 -79
- package/dist/Switch/Switch.types.d.ts +1 -1
- package/{es/Switch/Switch.css → dist/Switch/index.css} +46 -35
- package/dist/TabBar/TabBar.css +12 -8
- package/dist/TabBar/TabBar.js +3 -8
- package/dist/TabBar/TabBarContext.d.ts +3 -3
- package/dist/TabBar/TabBarItem.css +6 -0
- package/dist/TabBar/TabBarItem.js +3 -3
- package/dist/TabBar/index.css +59 -0
- package/dist/TabBar/index.types.d.ts +3 -3
- package/dist/Tabs/Tab.css +10 -16
- package/dist/Tabs/Tab.js +2 -3
- package/dist/Tabs/Tabs.css +32 -21
- package/dist/Tabs/Tabs.js +39 -70
- package/dist/Tabs/Tabs.types.d.ts +0 -10
- package/dist/Tabs/index.css +135 -0
- package/dist/Tabs/utils/bound.d.ts +1 -0
- package/dist/{DesktopPicker/utils/calcAfterMounted.js → Tabs/utils/bound.js} +14 -7
- package/dist/Tag/Tag.css +49 -23
- package/dist/Tag/Tag.js +3 -7
- package/dist/Tag/Tag.types.d.ts +4 -4
- package/dist/Tag/TagGroup.css +15 -11
- package/dist/Tag/TagGroup.d.ts +2 -2
- package/dist/Tag/TagGroup.js +16 -14
- package/dist/Tag/index.css +182 -0
- package/dist/TextArea/TextArea.d.ts +1 -1
- package/dist/TextArea/TextArea.js +6 -13
- package/dist/TextArea/index.css +57 -0
- package/dist/ThemeProvider/ThemeProvider.js +1 -4
- package/dist/ThemeProvider/ThemeProvider.types.d.ts +5 -10
- package/dist/ThemeProvider/utils/constants.d.ts +1 -1
- package/dist/ThemeProvider/utils/constants.js +4 -1
- package/dist/ThemeProvider/utils/mountTokens.d.ts +4 -4
- package/dist/Toast/FunctionalToast.js +1 -1
- package/dist/Toast/Toast.d.ts +1 -1
- package/dist/Toast/Toast.js +5 -5
- package/dist/Toast/index.css +58 -0
- package/dist/Tooltip/Tooltip.d.ts +1 -1
- package/dist/Tooltip/Tooltip.js +28 -71
- package/dist/Tooltip/index.css +95 -0
- package/dist/Transition/TransitionCore.js +3 -8
- package/dist/index.d.ts +0 -6
- package/dist/index.js +1 -13
- package/dist/locales/base.d.ts +0 -11
- package/dist/locales/en-US.js +0 -24
- package/dist/locales/zh-CN.js +0 -24
- package/dist/locales/zh-TW.js +0 -24
- package/es/ActionSheet/ActionSheet.css +16 -6
- package/es/ActionSheet/ActionSheetItem.css +11 -17
- package/es/ActionSheet/ActionSheetItem.js +3 -8
- package/es/ActionSheet/ActionSheetItem.types.d.ts +2 -2
- package/es/ActionSheet/index.css +89 -0
- package/es/Alert/Alert.types.d.ts +3 -3
- package/es/Alert/index.css +18 -14
- package/es/Avatar/Avatar.css +16 -12
- package/es/Avatar/Avatar.js +3 -8
- package/es/Avatar/AvatarGroup.css +19 -15
- package/es/Avatar/AvatarGroup.js +2 -6
- package/es/Avatar/index.css +93 -0
- package/es/Backdrop/Backdrop.d.ts +1 -1
- package/es/Backdrop/Backdrop.js +1 -1
- package/es/Backdrop/{Backdrop.css → index.css} +6 -2
- package/es/Badge/Badge.d.ts +1 -1
- package/es/Badge/Badge.js +4 -9
- package/es/Badge/Badge.types.d.ts +1 -1
- package/es/Badge/{Badge.css → index.css} +47 -27
- package/es/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/es/Breadcrumb/Breadcrumb.js +1 -1
- package/es/Breadcrumb/index.css +38 -0
- package/es/Button/Button.d.ts +1 -1
- package/es/Button/Button.js +6 -11
- package/es/Button/Button.types.d.ts +8 -7
- package/{dist/Button/Button.css → es/Button/index.css} +93 -63
- package/es/Calendar/Calendar.d.ts +1 -1
- package/es/Calendar/Calendar.js +10 -22
- package/es/Calendar/Calendar.types.d.ts +0 -5
- package/es/Calendar/{Calendar.css → index.css} +35 -31
- package/es/Card/Card.css +9 -0
- package/es/Card/CardContent.css +1 -2
- package/es/Card/CardFooter.css +2 -4
- package/es/Card/CardHeader.css +5 -5
- package/es/Card/CardHeader.js +2 -2
- package/es/Card/index.css +77 -0
- package/es/Checkbox/Checkbox.d.ts +1 -1
- package/es/Checkbox/Checkbox.js +4 -8
- package/es/Checkbox/CheckboxGroup.d.ts +1 -1
- package/es/Checkbox/CheckboxGroup.js +5 -8
- package/es/Checkbox/{Checkbox.css → index.css} +14 -10
- package/es/CitySelector/CitySelector.miniapp.d.ts +0 -1
- package/es/CitySelector/CitySelector.miniapp.js +0 -1
- package/es/CitySelector/CitySelectorCore.d.ts +1 -1
- package/es/CitySelector/CitySelectorCore.js +1 -1
- package/es/CitySelector/Selector/index.css +4 -4
- package/{dist/CitySelector/CitySelector.css → es/CitySelector/index.css} +31 -27
- package/es/Collapse/Collapse.d.ts +2 -2
- package/es/Collapse/Collapse.js +9 -12
- package/{dist/Collapse/Collapse.css → es/Collapse/index.css} +1 -0
- package/es/CollapsePanel/CollapsePanel.d.ts +1 -1
- package/es/CollapsePanel/CollapsePanel.js +1 -1
- package/es/CollapsePanel/CollapsePanelItem.js +45 -46
- package/{dist/CollapsePanel/CollapsePanel.css → es/CollapsePanel/index.css} +12 -10
- package/es/Countdown/Countdown.d.ts +1 -1
- package/es/Countdown/Countdown.js +6 -13
- package/{dist/Countdown/Countdown.css → es/Countdown/index.css} +12 -8
- package/es/Dialog/FunctionalDialog.js +2 -2
- package/es/Dialog/index.css +26 -23
- package/es/Divider/Divider.d.ts +1 -1
- package/es/Divider/Divider.js +9 -6
- package/{dist/Divider/Divider.css → es/Divider/index.css} +14 -10
- package/es/Drawer/Drawer.d.ts +1 -1
- package/es/Drawer/Drawer.js +5 -11
- package/es/Drawer/{Drawer.css → index.css} +2 -0
- package/es/Fade/Fade.js +52 -56
- package/es/IconButton/IconButton.d.ts +1 -1
- package/es/IconButton/IconButton.js +7 -14
- package/es/IconButton/IconButton.types.d.ts +4 -3
- package/{dist/IconButton/IconButton.css → es/IconButton/index.css} +79 -29
- package/es/Image/Image.js +112 -119
- package/es/Image/index.css +6 -2
- package/es/Input/Input.d.ts +1 -1
- package/es/Input/Input.js +6 -12
- package/{dist/Input/Input.css → es/Input/index.css} +22 -18
- package/es/ItemSelector/ItemSelector.miniapp.d.ts +0 -1
- package/es/ItemSelector/ItemSelector.miniapp.js +0 -1
- package/es/ItemSelector/ItemSelectorCore.d.ts +1 -1
- package/es/ItemSelector/ItemSelectorCore.js +1 -1
- package/es/List/List.css +7 -3
- package/es/List/List.js +3 -8
- package/es/List/ListItem.css +3 -3
- package/es/List/ListItem.js +42 -44
- package/es/List/ListItemContent.js +1 -4
- package/es/List/ListItemExtra.js +9 -4
- package/es/List/ListItemFooter.js +9 -4
- package/es/List/ListItemHeader.js +9 -4
- package/es/List/index.css +80 -0
- package/es/Loading/Loading.d.ts +1 -1
- package/es/Loading/Loading.js +14 -5
- package/{dist/Loading/Loading.css → es/Loading/index.css} +10 -6
- package/es/Modal/Modal.d.ts +1 -1
- package/es/Modal/Modal.js +1 -7
- package/es/Modal/Modal.miniapp.d.ts +2 -2
- package/es/Modal/Modal.miniapp.js +5 -11
- package/es/NavBar/NavBar.d.ts +1 -1
- package/es/NavBar/NavBar.js +1 -2
- package/es/NavBar/index.css +65 -0
- package/es/Picker/Picker.css +21 -21
- package/es/Picker/Picker.js +6 -28
- package/es/Picker/Picker.types.d.ts +4 -17
- package/es/Picker/PickerPanel.css +8 -12
- package/es/Picker/PickerPanel.js +52 -31
- package/es/Picker/index.css +116 -0
- package/es/Popover/Popover.d.ts +1 -1
- package/es/Popover/Popover.js +30 -74
- package/{dist/Popover/Popover.css → es/Popover/index.css} +32 -28
- package/es/Portal/Portal.miniapp.js +5 -8
- package/es/Progress/Progress.d.ts +1 -1
- package/es/Progress/Progress.js +1 -1
- package/es/Progress/index.css +28 -0
- package/es/Radio/Radio.d.ts +1 -1
- package/es/Radio/Radio.js +3 -7
- package/es/Radio/RadioButtonIcon.js +6 -1
- package/es/Radio/RadioGroup.d.ts +1 -1
- package/es/Radio/RadioGroup.js +1 -4
- package/es/Radio/{Radio.css → index.css} +10 -7
- package/es/Rating/Rating.d.ts +1 -1
- package/es/Rating/Rating.js +9 -19
- package/{dist/Rating/Rating.css → es/Rating/index.css} +20 -7
- package/es/ScrollView/ScrollView.d.ts +1 -1
- package/es/ScrollView/ScrollView.js +12 -25
- package/es/ScrollView/ScrollView.types.d.ts +1 -0
- package/es/Select/Select.d.ts +1 -1
- package/es/Select/Select.js +44 -76
- package/es/Select/SelectOption.d.ts +1 -1
- package/es/Select/SelectOption.js +1 -1
- package/es/Select/{Select.css → index.css} +30 -20
- package/es/Skeleton/Skeleton.d.ts +1 -1
- package/es/Skeleton/Skeleton.js +6 -10
- package/es/Skeleton/{Skeleton.css → index.css} +7 -3
- package/es/Slide/Slide.js +69 -74
- package/es/Slider/Slider.d.ts +1 -1
- package/es/Slider/Slider.js +14 -32
- package/es/Slider/index.css +111 -0
- package/es/Stack/Stack.d.ts +1 -1
- package/es/Stack/Stack.js +1 -1
- package/es/Steps/Step.css +14 -14
- package/es/Steps/Step.js +81 -82
- package/es/Steps/Steps.css +18 -14
- package/es/Steps/Steps.d.ts +1 -1
- package/es/Steps/Steps.js +57 -60
- package/es/Steps/index.css +199 -0
- package/es/Swiper/Swiper.d.ts +1 -1
- package/es/Swiper/Swiper.js +1 -1
- package/{dist/Swiper/Swiper.css → es/Swiper/index.css} +6 -2
- package/es/Switch/Switch.d.ts +1 -1
- package/es/Switch/Switch.js +76 -79
- package/es/Switch/Switch.types.d.ts +1 -1
- package/{dist/Switch/Switch.css → es/Switch/index.css} +46 -35
- package/es/TabBar/TabBar.css +12 -8
- package/es/TabBar/TabBar.js +3 -8
- package/es/TabBar/TabBarContext.d.ts +3 -3
- package/es/TabBar/TabBarItem.css +6 -0
- package/es/TabBar/TabBarItem.js +2 -2
- package/es/TabBar/index.css +59 -0
- package/es/TabBar/index.types.d.ts +3 -3
- package/es/Tabs/Tab.css +10 -16
- package/es/Tabs/Tab.js +2 -3
- package/es/Tabs/Tabs.css +32 -21
- package/es/Tabs/Tabs.js +41 -83
- package/es/Tabs/Tabs.types.d.ts +0 -10
- package/es/Tabs/index.css +135 -0
- package/es/Tabs/utils/bound.d.ts +1 -0
- package/es/Tabs/utils/bound.js +13 -0
- package/es/Tag/Tag.css +49 -23
- package/es/Tag/Tag.js +3 -7
- package/es/Tag/Tag.types.d.ts +4 -4
- package/es/Tag/TagGroup.css +15 -11
- package/es/Tag/TagGroup.d.ts +2 -2
- package/es/Tag/TagGroup.js +16 -14
- package/es/Tag/index.css +182 -0
- package/es/TextArea/TextArea.d.ts +1 -1
- package/es/TextArea/TextArea.js +6 -13
- package/es/TextArea/index.css +57 -0
- package/es/ThemeProvider/ThemeProvider.js +1 -4
- package/es/ThemeProvider/ThemeProvider.types.d.ts +5 -10
- package/es/ThemeProvider/utils/constants.d.ts +1 -1
- package/es/ThemeProvider/utils/constants.js +4 -1
- package/es/ThemeProvider/utils/mountTokens.d.ts +4 -4
- package/es/Toast/FunctionalToast.js +2 -2
- package/es/Toast/Toast.d.ts +1 -1
- package/es/Toast/Toast.js +5 -5
- package/es/Toast/index.css +58 -0
- package/es/Tooltip/Tooltip.d.ts +1 -1
- package/es/Tooltip/Tooltip.js +30 -74
- package/es/Tooltip/index.css +95 -0
- package/es/Transition/TransitionCore.js +3 -8
- package/es/index.d.ts +0 -6
- package/es/index.js +0 -6
- package/es/locales/base.d.ts +0 -11
- package/es/locales/en-US.js +0 -24
- package/es/locales/zh-CN.js +0 -24
- package/es/locales/zh-TW.js +0 -24
- package/package.json +14 -6
- package/dist/Breadcrumb/Breadcrumb.css +0 -34
- package/dist/CitySelector/miniapp.css +0 -4
- package/dist/Collapse/Collapse.miniapp.d.ts +0 -5
- package/dist/Collapse/Collapse.miniapp.js +0 -177
- package/dist/DatePicker/DatePicker.d.ts +0 -4
- package/dist/DatePicker/DatePicker.js +0 -335
- package/dist/DatePicker/DatePicker.types.d.ts +0 -36
- package/dist/DatePicker/DatePicker.types.js +0 -15
- package/dist/DatePicker/constants.d.ts +0 -9
- package/dist/DatePicker/constants.js +0 -37
- package/dist/DatePicker/index.d.ts +0 -3
- package/dist/DatePicker/index.js +0 -44
- package/dist/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
- package/dist/DesktopDatePicker/DesktopDatePicker.js +0 -280
- package/dist/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
- package/dist/DesktopDatePicker/DesktopDatePicker.types.js +0 -15
- package/dist/DesktopDatePicker/deskTopPickerContainer.css +0 -100
- package/dist/DesktopDatePicker/index.css +0 -61
- package/dist/DesktopDatePicker/index.d.ts +0 -2
- package/dist/DesktopDatePicker/index.js +0 -41
- package/dist/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
- package/dist/DesktopDatePicker/useGetDatePickerContent.js +0 -343
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -322
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -15
- package/dist/DesktopDateTimePicker/index.css +0 -66
- package/dist/DesktopDateTimePicker/index.d.ts +0 -2
- package/dist/DesktopDateTimePicker/index.js +0 -41
- package/dist/DesktopPicker/DesktopPicker.d.ts +0 -5
- package/dist/DesktopPicker/DesktopPicker.js +0 -238
- package/dist/DesktopPicker/DesktopPicker.types.d.ts +0 -57
- package/dist/DesktopPicker/DesktopPicker.types.js +0 -15
- package/dist/DesktopPicker/index.css +0 -37
- package/dist/DesktopPicker/index.d.ts +0 -2
- package/dist/DesktopPicker/index.js +0 -41
- package/dist/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
- package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
- package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -38
- package/dist/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
- package/dist/DesktopTimePicker/DesktopTimePicker.js +0 -288
- package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
- package/dist/DesktopTimePicker/DesktopTimePicker.types.js +0 -15
- package/dist/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
- package/dist/DesktopTimePicker/DesktopTimePickerList.js +0 -111
- package/dist/DesktopTimePicker/index.css +0 -170
- package/dist/DesktopTimePicker/index.d.ts +0 -2
- package/dist/DesktopTimePicker/index.js +0 -41
- package/dist/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
- package/dist/DesktopTimePicker/useGetTimePickerContent.js +0 -249
- package/dist/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
- package/dist/DesktopTimePicker/utils/scrollUtil.js +0 -27
- package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
- package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -51
- package/dist/DesktopTimePicker/utils/utils.d.ts +0 -28
- package/dist/DesktopTimePicker/utils/utils.js +0 -408
- package/dist/ItemSelector/miniapp.css +0 -4
- package/dist/NavBar/NavBar.css +0 -61
- package/dist/Progress/Progress.css +0 -24
- package/dist/Slider/Slider.css +0 -106
- package/dist/SwipeAction/SwipeAction.css +0 -79
- package/dist/SwipeAction/SwipeAction.d.ts +0 -5
- package/dist/SwipeAction/SwipeAction.js +0 -349
- package/dist/SwipeAction/SwipeAction.types.d.ts +0 -75
- package/dist/SwipeAction/SwipeAction.types.js +0 -15
- package/dist/SwipeAction/SwipeActionContext.d.ts +0 -4
- package/dist/SwipeAction/SwipeActionContext.js +0 -30
- package/dist/SwipeAction/SwipeActionItem.css +0 -31
- package/dist/SwipeAction/SwipeActionItem.d.ts +0 -5
- package/dist/SwipeAction/SwipeActionItem.js +0 -105
- package/dist/SwipeAction/constants.d.ts +0 -9
- package/dist/SwipeAction/constants.js +0 -39
- package/dist/SwipeAction/index.d.ts +0 -5
- package/dist/SwipeAction/index.js +0 -50
- package/dist/Tabs/utils/scroll.d.ts +0 -2
- package/dist/Tabs/utils/scroll.js +0 -55
- package/dist/TextArea/TextArea.css +0 -53
- package/dist/Toast/Toast.css +0 -53
- package/dist/Tooltip/Tooltip.css +0 -91
- package/es/Breadcrumb/Breadcrumb.css +0 -34
- package/es/CitySelector/miniapp.css +0 -4
- package/es/Collapse/Collapse.miniapp.d.ts +0 -5
- package/es/Collapse/Collapse.miniapp.js +0 -157
- package/es/DatePicker/DatePicker.d.ts +0 -4
- package/es/DatePicker/DatePicker.js +0 -308
- package/es/DatePicker/DatePicker.types.d.ts +0 -36
- package/es/DatePicker/DatePicker.types.js +0 -1
- package/es/DatePicker/constants.d.ts +0 -9
- package/es/DatePicker/constants.js +0 -14
- package/es/DatePicker/index.d.ts +0 -3
- package/es/DatePicker/index.js +0 -8
- package/es/DesktopDatePicker/DesktopDatePicker.d.ts +0 -5
- package/es/DesktopDatePicker/DesktopDatePicker.js +0 -253
- package/es/DesktopDatePicker/DesktopDatePicker.types.d.ts +0 -163
- package/es/DesktopDatePicker/DesktopDatePicker.types.js +0 -1
- package/es/DesktopDatePicker/deskTopPickerContainer.css +0 -100
- package/es/DesktopDatePicker/index.css +0 -61
- package/es/DesktopDatePicker/index.d.ts +0 -2
- package/es/DesktopDatePicker/index.js +0 -6
- package/es/DesktopDatePicker/useGetDatePickerContent.d.ts +0 -6
- package/es/DesktopDatePicker/useGetDatePickerContent.js +0 -316
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -5
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -295
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +0 -163
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.js +0 -1
- package/es/DesktopDateTimePicker/index.css +0 -66
- package/es/DesktopDateTimePicker/index.d.ts +0 -2
- package/es/DesktopDateTimePicker/index.js +0 -9
- package/es/DesktopPicker/DesktopPicker.d.ts +0 -5
- package/es/DesktopPicker/DesktopPicker.js +0 -221
- package/es/DesktopPicker/DesktopPicker.types.d.ts +0 -57
- package/es/DesktopPicker/DesktopPicker.types.js +0 -1
- package/es/DesktopPicker/index.css +0 -37
- package/es/DesktopPicker/index.d.ts +0 -2
- package/es/DesktopPicker/index.js +0 -6
- package/es/DesktopPicker/utils/calcAfterMounted.d.ts +0 -2
- package/es/DesktopPicker/utils/calcAfterMounted.js +0 -6
- package/es/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +0 -2
- package/es/DesktopPicker/utils/calcAfterMounted.miniapp.js +0 -9
- package/es/DesktopTimePicker/DesktopTimePicker.d.ts +0 -5
- package/es/DesktopTimePicker/DesktopTimePicker.js +0 -261
- package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +0 -182
- package/es/DesktopTimePicker/DesktopTimePicker.types.js +0 -1
- package/es/DesktopTimePicker/DesktopTimePickerList.d.ts +0 -4
- package/es/DesktopTimePicker/DesktopTimePickerList.js +0 -84
- package/es/DesktopTimePicker/index.css +0 -170
- package/es/DesktopTimePicker/index.d.ts +0 -2
- package/es/DesktopTimePicker/index.js +0 -6
- package/es/DesktopTimePicker/useGetTimePickerContent.d.ts +0 -6
- package/es/DesktopTimePicker/useGetTimePickerContent.js +0 -226
- package/es/DesktopTimePicker/utils/scrollUtil.d.ts +0 -2
- package/es/DesktopTimePicker/utils/scrollUtil.js +0 -8
- package/es/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +0 -2
- package/es/DesktopTimePicker/utils/scrollUtil.miniapp.js +0 -22
- package/es/DesktopTimePicker/utils/utils.d.ts +0 -28
- package/es/DesktopTimePicker/utils/utils.js +0 -365
- package/es/ItemSelector/miniapp.css +0 -4
- package/es/NavBar/NavBar.css +0 -61
- package/es/Progress/Progress.css +0 -24
- package/es/Slider/Slider.css +0 -106
- package/es/SwipeAction/SwipeAction.css +0 -79
- package/es/SwipeAction/SwipeAction.d.ts +0 -5
- package/es/SwipeAction/SwipeAction.js +0 -334
- package/es/SwipeAction/SwipeAction.types.d.ts +0 -75
- package/es/SwipeAction/SwipeAction.types.js +0 -1
- package/es/SwipeAction/SwipeActionContext.d.ts +0 -4
- package/es/SwipeAction/SwipeActionContext.js +0 -11
- package/es/SwipeAction/SwipeActionItem.css +0 -31
- package/es/SwipeAction/SwipeActionItem.d.ts +0 -5
- package/es/SwipeAction/SwipeActionItem.js +0 -78
- package/es/SwipeAction/constants.d.ts +0 -9
- package/es/SwipeAction/constants.js +0 -15
- package/es/SwipeAction/index.d.ts +0 -5
- package/es/SwipeAction/index.js +0 -12
- package/es/Tabs/utils/scroll.d.ts +0 -2
- package/es/Tabs/utils/scroll.js +0 -36
- package/es/TextArea/TextArea.css +0 -53
- package/es/Toast/Toast.css +0 -53
- package/es/Tooltip/Tooltip.css +0 -91
- /package/dist/ItemSelector/{ItemSelector.css → index.css} +0 -0
- /package/dist/Modal/{Modal.css → index.css} +0 -0
- /package/dist/ScrollView/{ScrollView.css → index.css} +0 -0
- /package/dist/Stack/{Stack.css → index.css} +0 -0
- /package/es/ItemSelector/{ItemSelector.css → index.css} +0 -0
- /package/es/Modal/{Modal.css → index.css} +0 -0
- /package/es/ScrollView/{ScrollView.css → index.css} +0 -0
- /package/es/Stack/{Stack.css → index.css} +0 -0
|
@@ -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,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;
|
|
@@ -1,261 +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 { AccessTimeCircleOutlinedIcon } from "@bifrostui/icons";
|
|
33
|
-
import dayjs from "dayjs";
|
|
34
|
-
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
35
|
-
import clsx from "clsx";
|
|
36
|
-
import React, { useMemo, useState, useEffect } from "react";
|
|
37
|
-
import { useValue } from "@bifrostui/utils";
|
|
38
|
-
import { isDisabledTime, dateToDayjs } from "./utils/utils";
|
|
39
|
-
import DesktopPicker from "../DesktopPicker";
|
|
40
|
-
import useGetTimePickerContent from "./useGetTimePickerContent";
|
|
41
|
-
import "./index.css";
|
|
42
|
-
dayjs.extend(customParseFormat);
|
|
43
|
-
const prefixCls = "bui-d-time-picker";
|
|
44
|
-
const allowedViews = ["hour", "minute", "second"];
|
|
45
|
-
const DesktopTimePicker = /* @__PURE__ */ React.forwardRef(
|
|
46
|
-
(props, ref) => {
|
|
47
|
-
const _a = props, {
|
|
48
|
-
views = allowedViews,
|
|
49
|
-
timeSteps = { hour: 1, minute: 1, second: 1 },
|
|
50
|
-
ampm = false,
|
|
51
|
-
className,
|
|
52
|
-
inputRef,
|
|
53
|
-
inputProps,
|
|
54
|
-
value,
|
|
55
|
-
defaultValue,
|
|
56
|
-
disabled = false,
|
|
57
|
-
disableOpenPicker = false,
|
|
58
|
-
placeholder,
|
|
59
|
-
open,
|
|
60
|
-
format = ampm ? "hh:mm:ss A" : "HH:mm:ss",
|
|
61
|
-
disabledTimeView = () => ({
|
|
62
|
-
hour: () => [],
|
|
63
|
-
minute: () => [],
|
|
64
|
-
second: () => []
|
|
65
|
-
}),
|
|
66
|
-
minTime,
|
|
67
|
-
maxTime,
|
|
68
|
-
icon,
|
|
69
|
-
closeOnSelect = true,
|
|
70
|
-
onChange,
|
|
71
|
-
onClose,
|
|
72
|
-
onOpen,
|
|
73
|
-
DesktopPickerProps,
|
|
74
|
-
timeRender
|
|
75
|
-
} = _a, others = __objRest(_a, [
|
|
76
|
-
"views",
|
|
77
|
-
"timeSteps",
|
|
78
|
-
"ampm",
|
|
79
|
-
"className",
|
|
80
|
-
"inputRef",
|
|
81
|
-
"inputProps",
|
|
82
|
-
"value",
|
|
83
|
-
"defaultValue",
|
|
84
|
-
"disabled",
|
|
85
|
-
"disableOpenPicker",
|
|
86
|
-
"placeholder",
|
|
87
|
-
"open",
|
|
88
|
-
"format",
|
|
89
|
-
"disabledTimeView",
|
|
90
|
-
"minTime",
|
|
91
|
-
"maxTime",
|
|
92
|
-
"icon",
|
|
93
|
-
"closeOnSelect",
|
|
94
|
-
"onChange",
|
|
95
|
-
"onClose",
|
|
96
|
-
"onOpen",
|
|
97
|
-
"DesktopPickerProps",
|
|
98
|
-
"timeRender"
|
|
99
|
-
]);
|
|
100
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
101
|
-
const [inputStr, setInputStr] = useState("");
|
|
102
|
-
const [useUserStr, setUseUserStr] = useState(false);
|
|
103
|
-
const [isInvalid, setIsInvalid] = useState(false);
|
|
104
|
-
const [timeValue, triggerChange] = useValue({
|
|
105
|
-
value,
|
|
106
|
-
defaultValue,
|
|
107
|
-
onChange
|
|
108
|
-
});
|
|
109
|
-
const handleDatePickerIconClick = (e) => {
|
|
110
|
-
e.stopPropagation();
|
|
111
|
-
if (disabled || disableOpenPicker || open !== void 0)
|
|
112
|
-
return;
|
|
113
|
-
setIsOpen(!isOpen);
|
|
114
|
-
};
|
|
115
|
-
const handleTimePickerInputClick = (e) => {
|
|
116
|
-
e.stopPropagation();
|
|
117
|
-
if (inputProps == null ? void 0 : inputProps.readOnly) {
|
|
118
|
-
if (disabled || disableOpenPicker || open !== void 0)
|
|
119
|
-
return;
|
|
120
|
-
setIsOpen(!isOpen);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
setIsOpen(false);
|
|
124
|
-
};
|
|
125
|
-
const { desktopTimePanel } = useGetTimePickerContent({
|
|
126
|
-
views: Array.from(
|
|
127
|
-
new Set(views.filter((view) => allowedViews.includes(view)))
|
|
128
|
-
),
|
|
129
|
-
timeSteps,
|
|
130
|
-
ampm,
|
|
131
|
-
minTime: dateToDayjs(minTime),
|
|
132
|
-
maxTime: dateToDayjs(maxTime),
|
|
133
|
-
setIsOpen,
|
|
134
|
-
triggerChange,
|
|
135
|
-
disabledTimeView,
|
|
136
|
-
timeValue: dateToDayjs(timeValue),
|
|
137
|
-
onClose,
|
|
138
|
-
onOpen,
|
|
139
|
-
closeOnSelect,
|
|
140
|
-
timeRender,
|
|
141
|
-
setIsInvalid
|
|
142
|
-
});
|
|
143
|
-
const onInputChange = (e) => {
|
|
144
|
-
e.stopPropagation();
|
|
145
|
-
const newValue = e.target.value;
|
|
146
|
-
if (newValue.length === 0) {
|
|
147
|
-
setInputStr("");
|
|
148
|
-
setUseUserStr(true);
|
|
149
|
-
triggerChange(e, null);
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
if (!dayjs(newValue, format, true).isValid()) {
|
|
153
|
-
setInputStr(newValue);
|
|
154
|
-
setUseUserStr(true);
|
|
155
|
-
} else {
|
|
156
|
-
setInputStr("");
|
|
157
|
-
setUseUserStr(false);
|
|
158
|
-
let validTime;
|
|
159
|
-
if (dateToDayjs(timeValue)) {
|
|
160
|
-
validTime = dateToDayjs(timeValue);
|
|
161
|
-
} else if (minTime) {
|
|
162
|
-
validTime = dateToDayjs(minTime);
|
|
163
|
-
} else if (maxTime) {
|
|
164
|
-
validTime = dateToDayjs(maxTime);
|
|
165
|
-
} else {
|
|
166
|
-
validTime = dayjs();
|
|
167
|
-
}
|
|
168
|
-
const year = validTime.year();
|
|
169
|
-
const month = validTime.month() + 1;
|
|
170
|
-
const date = validTime.date();
|
|
171
|
-
const newTimeValue = dayjs(`${year}-${month}-${date} ${newValue}`);
|
|
172
|
-
if (isDisabledTime(
|
|
173
|
-
newTimeValue,
|
|
174
|
-
dateToDayjs(minTime),
|
|
175
|
-
dateToDayjs(maxTime),
|
|
176
|
-
disabledTimeView
|
|
177
|
-
)) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
triggerChange(e, newTimeValue.toDate());
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
const onMount = () => {
|
|
184
|
-
onOpen == null ? void 0 : onOpen();
|
|
185
|
-
};
|
|
186
|
-
const unMounted = () => {
|
|
187
|
-
onClose == null ? void 0 : onClose();
|
|
188
|
-
};
|
|
189
|
-
const showPlaceholder = useMemo(
|
|
190
|
-
() => placeholder || format,
|
|
191
|
-
[placeholder, format]
|
|
192
|
-
);
|
|
193
|
-
const inputValue = useMemo(() => {
|
|
194
|
-
if (useUserStr) {
|
|
195
|
-
return inputStr;
|
|
196
|
-
}
|
|
197
|
-
if (timeValue) {
|
|
198
|
-
return dayjs(timeValue).format(format);
|
|
199
|
-
}
|
|
200
|
-
return "";
|
|
201
|
-
}, [timeValue, inputStr, useUserStr, format]);
|
|
202
|
-
useEffect(() => {
|
|
203
|
-
setUseUserStr(false);
|
|
204
|
-
}, [timeValue]);
|
|
205
|
-
return /* @__PURE__ */ React.createElement(
|
|
206
|
-
"div",
|
|
207
|
-
__spreadProps(__spreadValues({}, others), {
|
|
208
|
-
className: clsx(prefixCls, className, {
|
|
209
|
-
[`${prefixCls}-disabled`]: disabled,
|
|
210
|
-
[`${prefixCls}-active`]: isOpen,
|
|
211
|
-
[`${prefixCls}-invalid`]: isInvalid
|
|
212
|
-
}),
|
|
213
|
-
ref
|
|
214
|
-
}),
|
|
215
|
-
/* @__PURE__ */ React.createElement(
|
|
216
|
-
DesktopPicker,
|
|
217
|
-
__spreadValues({
|
|
218
|
-
open: open != null ? open : isOpen,
|
|
219
|
-
miniBackdropInvisible: open !== void 0,
|
|
220
|
-
onClose: (e, data) => {
|
|
221
|
-
setIsOpen(data == null ? void 0 : data.value);
|
|
222
|
-
},
|
|
223
|
-
onMount,
|
|
224
|
-
onUnmounted: unMounted,
|
|
225
|
-
content: desktopTimePanel(),
|
|
226
|
-
inheritWidth: false
|
|
227
|
-
}, DesktopPickerProps),
|
|
228
|
-
/* @__PURE__ */ React.createElement("div", { className: `${prefixCls}-container` }, /* @__PURE__ */ React.createElement(
|
|
229
|
-
"input",
|
|
230
|
-
__spreadProps(__spreadValues({}, inputProps), {
|
|
231
|
-
"aria-invalid": true,
|
|
232
|
-
autoComplete: "off",
|
|
233
|
-
placeholder: showPlaceholder,
|
|
234
|
-
type: "text",
|
|
235
|
-
inputMode: "text",
|
|
236
|
-
ref: inputRef,
|
|
237
|
-
className: clsx(`${prefixCls}-content`, {
|
|
238
|
-
[inputProps == null ? void 0 : inputProps.className]: inputProps == null ? void 0 : inputProps.className
|
|
239
|
-
}),
|
|
240
|
-
onBlur: () => setUseUserStr(false),
|
|
241
|
-
onClick: handleTimePickerInputClick,
|
|
242
|
-
onChange: onInputChange,
|
|
243
|
-
value: inputValue
|
|
244
|
-
})
|
|
245
|
-
), /* @__PURE__ */ React.createElement(
|
|
246
|
-
"div",
|
|
247
|
-
{
|
|
248
|
-
onClick: handleDatePickerIconClick,
|
|
249
|
-
className: `${prefixCls}-icon`
|
|
250
|
-
},
|
|
251
|
-
icon || /* @__PURE__ */ React.createElement(AccessTimeCircleOutlinedIcon, { htmlColor: "#9c9ca5" })
|
|
252
|
-
))
|
|
253
|
-
)
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
);
|
|
257
|
-
DesktopTimePicker.displayName = "BUITimePicker";
|
|
258
|
-
var DesktopTimePicker_default = DesktopTimePicker;
|
|
259
|
-
export {
|
|
260
|
-
DesktopTimePicker_default as default
|
|
261
|
-
};
|