@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
|
@@ -10,10 +10,6 @@ export interface IPickerOptionItem {
|
|
|
10
10
|
* 选项对应唯一的值
|
|
11
11
|
*/
|
|
12
12
|
value: string | number;
|
|
13
|
-
/**
|
|
14
|
-
* 是否禁用
|
|
15
|
-
*/
|
|
16
|
-
disabled?: boolean;
|
|
17
13
|
}
|
|
18
14
|
export type ICascadePickerChildOptionItem = IPickerOptionItem & {
|
|
19
15
|
/**
|
|
@@ -38,14 +34,6 @@ export type PickerProps<D extends React.ElementType = 'div', P = DrawerProps> =
|
|
|
38
34
|
* 标题
|
|
39
35
|
*/
|
|
40
36
|
title?: string;
|
|
41
|
-
/**
|
|
42
|
-
* 确认文本内容
|
|
43
|
-
*/
|
|
44
|
-
confirmText?: string;
|
|
45
|
-
/**
|
|
46
|
-
* 取消文本内容
|
|
47
|
-
*/
|
|
48
|
-
cancelText?: string;
|
|
49
37
|
/**
|
|
50
38
|
* 列表数据
|
|
51
39
|
* @default []
|
|
@@ -73,7 +61,6 @@ export type PickerProps<D extends React.ElementType = 'div', P = DrawerProps> =
|
|
|
73
61
|
value: (string | number)[];
|
|
74
62
|
options: ICascadePickerChildOptionItem[][];
|
|
75
63
|
currentOption: ICascadePickerChildOptionItem;
|
|
76
|
-
columnIndex: number;
|
|
77
64
|
}) => void;
|
|
78
65
|
/**
|
|
79
66
|
* 点击取消按钮时候回调
|
|
@@ -98,17 +85,17 @@ export type PickerPanelProps<D extends React.ElementType = 'div', P = {}> = Over
|
|
|
98
85
|
*/
|
|
99
86
|
options?: ICascadePickerChildOptionItem[];
|
|
100
87
|
/**
|
|
101
|
-
*
|
|
88
|
+
* 默认值
|
|
102
89
|
*/
|
|
103
|
-
|
|
90
|
+
defaultValue?: string | number;
|
|
104
91
|
/**
|
|
105
92
|
* 列索引
|
|
106
93
|
*/
|
|
107
94
|
columnIndex?: number;
|
|
108
95
|
/**
|
|
109
|
-
*
|
|
96
|
+
* 是否展示选择器
|
|
110
97
|
*/
|
|
111
|
-
|
|
98
|
+
open?: boolean;
|
|
112
99
|
/**
|
|
113
100
|
* 选择选项时的回调
|
|
114
101
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
.bui-picker-panel {
|
|
2
|
-
--bui-picker-option-disabled-opacity: 0.38;
|
|
3
2
|
flex: 1;
|
|
4
3
|
flex-shrink: 0;
|
|
5
4
|
position: relative;
|
|
@@ -9,9 +8,9 @@
|
|
|
9
8
|
transform: rotate3d(1, 0, 0, 60deg);
|
|
10
9
|
transform-style: preserve-3d;
|
|
11
10
|
position: absolute;
|
|
12
|
-
top: var(--indicator-top);
|
|
11
|
+
top: var(--bui-picker-indicator-top);
|
|
13
12
|
width: 100%;
|
|
14
|
-
height: var(--option-height);
|
|
13
|
+
height: var(--bui-picker-option-height);
|
|
15
14
|
}
|
|
16
15
|
.bui-picker-panel-mask {
|
|
17
16
|
position: absolute;
|
|
@@ -29,14 +28,14 @@
|
|
|
29
28
|
var(--bui-color-bg-alpha-light-9),
|
|
30
29
|
var(--bui-color-bg-alpha-light-3));
|
|
31
30
|
background-position: top, bottom;
|
|
32
|
-
background-size: 100% var(--indicator-top);
|
|
31
|
+
background-size: 100% var(--bui-picker-indicator-top);
|
|
33
32
|
background-repeat: no-repeat;
|
|
34
33
|
transform: translateZ(0);
|
|
35
34
|
}
|
|
36
35
|
.bui-picker-panel-indicator {
|
|
37
36
|
position: absolute;
|
|
38
|
-
top: var(--indicator-top);
|
|
39
|
-
height: var(--option-height);
|
|
37
|
+
top: var(--bui-picker-indicator-top);
|
|
38
|
+
height: var(--bui-picker-option-height);
|
|
40
39
|
width: 100%;
|
|
41
40
|
border-top: 1px solid var(--bui-color-border-default);
|
|
42
41
|
border-bottom: 1px solid var(--bui-color-border-default);
|
|
@@ -46,10 +45,10 @@
|
|
|
46
45
|
top: 0;
|
|
47
46
|
left: 0;
|
|
48
47
|
text-align: center;
|
|
49
|
-
height: var(--option-height);
|
|
50
|
-
line-height: var(--option-height);
|
|
48
|
+
height: var(--bui-picker-option-height);
|
|
49
|
+
line-height: var(--bui-picker-option-height);
|
|
51
50
|
color: var(--bui-color-fg-default);
|
|
52
|
-
font-size: var(--option-font-size);
|
|
51
|
+
font-size: var(--bui-picker-option-font-size);
|
|
53
52
|
backface-visibility: hidden;
|
|
54
53
|
width: auto;
|
|
55
54
|
overflow: hidden;
|
|
@@ -57,9 +56,6 @@
|
|
|
57
56
|
white-space: nowrap;
|
|
58
57
|
width: 100%;
|
|
59
58
|
}
|
|
60
|
-
.bui-picker-panel-option-disabled {
|
|
61
|
-
opacity: var(--bui-picker-option-disabled-opacity);
|
|
62
|
-
}
|
|
63
59
|
.bui-picker-panel-option-hidden {
|
|
64
60
|
visibility: hidden;
|
|
65
61
|
opacity: 0;
|
|
@@ -63,19 +63,18 @@ var import_PickerPanel = require("./PickerPanel.css");
|
|
|
63
63
|
const prefixCls = "bui-picker-panel";
|
|
64
64
|
const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
65
65
|
(props, ref) => {
|
|
66
|
-
var _b;
|
|
67
66
|
const _a = props, {
|
|
68
67
|
options = [],
|
|
69
|
-
|
|
68
|
+
defaultValue,
|
|
70
69
|
onSelect,
|
|
71
70
|
columnIndex,
|
|
72
|
-
|
|
71
|
+
open
|
|
73
72
|
} = _a, others = __objRest(_a, [
|
|
74
73
|
"options",
|
|
75
|
-
"
|
|
74
|
+
"defaultValue",
|
|
76
75
|
"onSelect",
|
|
77
76
|
"columnIndex",
|
|
78
|
-
"
|
|
77
|
+
"open"
|
|
79
78
|
]);
|
|
80
79
|
const touch = (0, import_utils.useTouch)();
|
|
81
80
|
let timer;
|
|
@@ -85,9 +84,8 @@ const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
85
84
|
const ROTATION = 20;
|
|
86
85
|
const TOUCH_END = "end";
|
|
87
86
|
const DEFAULT_LINE_SPACING = 36;
|
|
88
|
-
const
|
|
89
|
-
const
|
|
90
|
-
const INDICATOR_OFFSET = LINE_SPACING * 108 / DEFAULT_LINE_SPACING;
|
|
87
|
+
const lineSpacing = (0, import_react.useRef)(DEFAULT_LINE_SPACING);
|
|
88
|
+
const [indicatorOffset, setIndicatorOffset] = (0, import_react.useState)(108);
|
|
91
89
|
const [startY, setStartY] = (0, import_react.useState)(0);
|
|
92
90
|
const [currIndex, setCurrIndex] = (0, import_react.useState)(1);
|
|
93
91
|
const [startTime, setStartTime] = (0, import_react.useState)(0);
|
|
@@ -96,15 +94,23 @@ const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
96
94
|
const [scrollDistance, setScrollDistance] = (0, import_react.useState)(0);
|
|
97
95
|
const transformY = (0, import_react.useRef)(0);
|
|
98
96
|
const isVerticalMoving = (0, import_react.useRef)(false);
|
|
99
|
-
const
|
|
97
|
+
const fitstOptionRef = (0, import_react.useRef)(null);
|
|
100
98
|
const PickerPanelRef = (0, import_react.useRef)(null);
|
|
101
99
|
const pickerPanelRef = (0, import_utils.useForkRef)(PickerPanelRef, ref);
|
|
102
100
|
(0, import_utils.useTouchEmulator)(PickerPanelRef.current);
|
|
101
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
102
|
+
if (!open)
|
|
103
|
+
return;
|
|
104
|
+
(0, import_utils.getBoundingClientRect)(fitstOptionRef.current).then((rect) => {
|
|
105
|
+
lineSpacing.current = (rect == null ? void 0 : rect.height) || DEFAULT_LINE_SPACING;
|
|
106
|
+
setIndicatorOffset(lineSpacing.current * 108 / DEFAULT_LINE_SPACING);
|
|
107
|
+
});
|
|
108
|
+
}, [open]);
|
|
103
109
|
const updateSelect = () => {
|
|
104
110
|
let index = -1;
|
|
105
|
-
if (
|
|
111
|
+
if (defaultValue) {
|
|
106
112
|
options.some((item, idx) => {
|
|
107
|
-
if (item.value ===
|
|
113
|
+
if (item.value === defaultValue) {
|
|
108
114
|
index = idx;
|
|
109
115
|
return true;
|
|
110
116
|
}
|
|
@@ -112,7 +118,7 @@ const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
112
118
|
});
|
|
113
119
|
}
|
|
114
120
|
setCurrIndex(index === -1 ? 1 : index + 1);
|
|
115
|
-
const move = index === -1 ? 0 : index *
|
|
121
|
+
const move = index === -1 ? 0 : index * lineSpacing.current;
|
|
116
122
|
setMove({ move: -move });
|
|
117
123
|
};
|
|
118
124
|
(0, import_react.useEffect)(() => {
|
|
@@ -122,7 +128,7 @@ const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
122
128
|
return () => {
|
|
123
129
|
clearTimeout(timer);
|
|
124
130
|
};
|
|
125
|
-
}, [options
|
|
131
|
+
}, [options]);
|
|
126
132
|
const setTransform = (type, deg, time = DEFAULT_DURATION, translateY = 0) => {
|
|
127
133
|
let nTime = time;
|
|
128
134
|
if (type !== TOUCH_END) {
|
|
@@ -139,22 +145,24 @@ const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
139
145
|
if (updateMove > 0) {
|
|
140
146
|
updateMove = 0;
|
|
141
147
|
}
|
|
142
|
-
if (updateMove < -(options.length - 1) *
|
|
143
|
-
updateMove = -(options.length - 1) *
|
|
148
|
+
if (updateMove < -(options.length - 1) * lineSpacing.current) {
|
|
149
|
+
updateMove = -(options.length - 1) * lineSpacing.current;
|
|
144
150
|
}
|
|
145
|
-
const endMove = Math.round(updateMove /
|
|
146
|
-
const deg = `${(Math.abs(Math.round(endMove /
|
|
151
|
+
const endMove = Math.round(updateMove / lineSpacing.current) * lineSpacing.current;
|
|
152
|
+
const deg = `${(Math.abs(Math.round(endMove / lineSpacing.current)) + 1) * ROTATION}deg`;
|
|
147
153
|
setTransform(type, deg, time, endMove);
|
|
148
|
-
setCurrIndex(Math.abs(Math.round(endMove /
|
|
154
|
+
setCurrIndex(Math.abs(Math.round(endMove / lineSpacing.current)) + 1);
|
|
149
155
|
} else {
|
|
150
156
|
let deg = 0;
|
|
151
|
-
const currentDeg = (-updateMove /
|
|
157
|
+
const currentDeg = (-updateMove / lineSpacing.current + 1) * ROTATION;
|
|
152
158
|
const maxDeg = (options.length + 1) * ROTATION;
|
|
153
159
|
const minDeg = 0;
|
|
154
160
|
deg = Math.min(Math.max(currentDeg, minDeg), maxDeg);
|
|
155
161
|
if (minDeg < deg && deg < maxDeg) {
|
|
156
162
|
setTransform("", `${deg}deg`, void 0, updateMove);
|
|
157
|
-
setCurrIndex(
|
|
163
|
+
setCurrIndex(
|
|
164
|
+
Math.abs(Math.round(updateMove / lineSpacing.current)) + 1
|
|
165
|
+
);
|
|
158
166
|
}
|
|
159
167
|
}
|
|
160
168
|
};
|
|
@@ -203,17 +211,17 @@ const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
203
211
|
}, 0);
|
|
204
212
|
};
|
|
205
213
|
(0, import_react.useEffect)(() => {
|
|
206
|
-
var _a2,
|
|
214
|
+
var _a2, _b, _c;
|
|
207
215
|
(_a2 = PickerPanelRef.current) == null ? void 0 : _a2.addEventListener("touchstart", panelTouchStart);
|
|
208
|
-
(
|
|
216
|
+
(_b = PickerPanelRef.current) == null ? void 0 : _b.addEventListener("touchmove", panelTouchMove);
|
|
209
217
|
(_c = PickerPanelRef.current) == null ? void 0 : _c.addEventListener("touchend", panelTouchEnd);
|
|
210
218
|
return () => {
|
|
211
|
-
var _a3,
|
|
219
|
+
var _a3, _b2, _c2;
|
|
212
220
|
(_a3 = PickerPanelRef.current) == null ? void 0 : _a3.removeEventListener(
|
|
213
221
|
"touchstart",
|
|
214
222
|
panelTouchStart
|
|
215
223
|
);
|
|
216
|
-
(
|
|
224
|
+
(_b2 = PickerPanelRef.current) == null ? void 0 : _b2.removeEventListener(
|
|
217
225
|
"touchmove",
|
|
218
226
|
panelTouchMove
|
|
219
227
|
);
|
|
@@ -224,7 +232,7 @@ const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
224
232
|
isVerticalMoving.current = false;
|
|
225
233
|
setTouchTime(0);
|
|
226
234
|
onSelect == null ? void 0 : onSelect(e, {
|
|
227
|
-
columnOption: options == null ? void 0 : options[Math.round(-scrollDistance /
|
|
235
|
+
columnOption: options == null ? void 0 : options[Math.round(-scrollDistance / lineSpacing.current)],
|
|
228
236
|
columnIndex
|
|
229
237
|
});
|
|
230
238
|
};
|
|
@@ -244,7 +252,6 @@ const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
244
252
|
"div",
|
|
245
253
|
{
|
|
246
254
|
className: `${prefixCls}-roller`,
|
|
247
|
-
ref: rollerRef,
|
|
248
255
|
style: {
|
|
249
256
|
transition: `transform ${touchTime}ms cubic-bezier(0.17, 0.89, 0.45, 1)`,
|
|
250
257
|
transform: `rotate3d(1, 0, 0, ${touchDeg})`
|
|
@@ -254,13 +261,16 @@ const PickerPanel = /* @__PURE__ */ import_react.default.forwardRef(
|
|
|
254
261
|
options.map((item, i) => /* @__PURE__ */ import_react.default.createElement(
|
|
255
262
|
"div",
|
|
256
263
|
{
|
|
264
|
+
ref: (el) => {
|
|
265
|
+
if (i === 0 && !fitstOptionRef.current)
|
|
266
|
+
fitstOptionRef.current = el;
|
|
267
|
+
},
|
|
257
268
|
className: (0, import_clsx.default)(`${prefixCls}-option`, {
|
|
258
|
-
[`${prefixCls}-option-hidden`]: i + 1 <= currIndex - 8 || i + 1 >= currIndex + 8
|
|
259
|
-
[`${prefixCls}-option-disabled`]: item == null ? void 0 : item.disabled
|
|
269
|
+
[`${prefixCls}-option-hidden`]: i + 1 <= currIndex - 8 || i + 1 >= currIndex + 8
|
|
260
270
|
}),
|
|
261
271
|
key: `${item == null ? void 0 : item.value}-${i}`,
|
|
262
272
|
style: {
|
|
263
|
-
transform: `rotate3d(1, 0, 0, ${-ROTATION * (i + 1)}deg) translate3d(0px, 0px, ${
|
|
273
|
+
transform: `rotate3d(1, 0, 0, ${-ROTATION * (i + 1)}deg) translate3d(0px, 0px, ${indicatorOffset}px)`
|
|
264
274
|
}
|
|
265
275
|
},
|
|
266
276
|
item == null ? void 0 : item.label
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
page,
|
|
3
|
+
xhs-page {
|
|
4
|
+
--bui-picker-header-height: 50px;
|
|
5
|
+
--bui-picker-header-padding: 0 var(--bui-spacing-lg);
|
|
6
|
+
--bui-picker-cancel-height: 100%;
|
|
7
|
+
--bui-picker-cancel-line-height: 50px;
|
|
8
|
+
--bui-picker-confirm-height: 100%;
|
|
9
|
+
--bui-picker-confirm-line-height: 50px;
|
|
10
|
+
--bui-picker-panel-height: 260px;
|
|
11
|
+
--bui-picker-indicator-top: 108px;
|
|
12
|
+
--bui-picker-option-height: 36px;
|
|
13
|
+
--bui-picker-option-font-size: var(--bui-title-size-4);
|
|
14
|
+
}
|
|
15
|
+
.bui-picker {
|
|
16
|
+
font-family: var(--bui-font-family);
|
|
17
|
+
}
|
|
18
|
+
.bui-picker .bui-drawer-content {
|
|
19
|
+
border-radius: var(--bui-shape-radius-drawer) var(--bui-shape-radius-drawer) 0 0;
|
|
20
|
+
}
|
|
21
|
+
.bui-picker-header {
|
|
22
|
+
height: var(--bui-picker-header-height);
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
padding: var(--bui-picker-header-padding);
|
|
27
|
+
}
|
|
28
|
+
.bui-picker-cancel {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
height: var(--bui-picker-cancel-height);
|
|
31
|
+
font-size: var(--bui-title-size-4);
|
|
32
|
+
text-align: center;
|
|
33
|
+
line-height: var(--bui-picker-cancel-line-height);
|
|
34
|
+
color: var(--bui-color-fg-default);
|
|
35
|
+
}
|
|
36
|
+
.bui-picker-title {
|
|
37
|
+
font-size: var(--bui-title-size-3);
|
|
38
|
+
color: var(--bui-color-fg-default);
|
|
39
|
+
font-weight: var(--bui-font-weight-medium);
|
|
40
|
+
}
|
|
41
|
+
.bui-picker-confirm {
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
height: var(--bui-picker-confirm-height);
|
|
44
|
+
font-size: var(--bui-title-size-4);
|
|
45
|
+
text-align: center;
|
|
46
|
+
line-height: var(--bui-picker-confirm-line-height);
|
|
47
|
+
color: var(--bui-color-primary);
|
|
48
|
+
}
|
|
49
|
+
.bui-picker-container {
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: var(--bui-picker-panel-height);
|
|
52
|
+
display: flex;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
}
|
|
55
|
+
.bui-picker-panel {
|
|
56
|
+
flex: 1;
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
position: relative;
|
|
59
|
+
font-family: var(--bui-font-family);
|
|
60
|
+
}
|
|
61
|
+
.bui-picker-panel-roller {
|
|
62
|
+
transform: rotate3d(1, 0, 0, 60deg);
|
|
63
|
+
transform-style: preserve-3d;
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: var(--bui-picker-indicator-top);
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: var(--bui-picker-option-height);
|
|
68
|
+
}
|
|
69
|
+
.bui-picker-panel-mask {
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: 0;
|
|
72
|
+
left: 0;
|
|
73
|
+
width: 100%;
|
|
74
|
+
height: 100%;
|
|
75
|
+
background-image:
|
|
76
|
+
linear-gradient(
|
|
77
|
+
180deg,
|
|
78
|
+
var(--bui-color-bg-alpha-light-9),
|
|
79
|
+
var(--bui-color-bg-alpha-light-3)),
|
|
80
|
+
linear-gradient(
|
|
81
|
+
0deg,
|
|
82
|
+
var(--bui-color-bg-alpha-light-9),
|
|
83
|
+
var(--bui-color-bg-alpha-light-3));
|
|
84
|
+
background-position: top, bottom;
|
|
85
|
+
background-size: 100% var(--bui-picker-indicator-top);
|
|
86
|
+
background-repeat: no-repeat;
|
|
87
|
+
transform: translateZ(0);
|
|
88
|
+
}
|
|
89
|
+
.bui-picker-panel-indicator {
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: var(--bui-picker-indicator-top);
|
|
92
|
+
height: var(--bui-picker-option-height);
|
|
93
|
+
width: 100%;
|
|
94
|
+
border-top: 1px solid var(--bui-color-border-default);
|
|
95
|
+
border-bottom: 1px solid var(--bui-color-border-default);
|
|
96
|
+
}
|
|
97
|
+
.bui-picker-panel-option {
|
|
98
|
+
position: absolute;
|
|
99
|
+
top: 0;
|
|
100
|
+
left: 0;
|
|
101
|
+
text-align: center;
|
|
102
|
+
height: var(--bui-picker-option-height);
|
|
103
|
+
line-height: var(--bui-picker-option-height);
|
|
104
|
+
color: var(--bui-color-fg-default);
|
|
105
|
+
font-size: var(--bui-picker-option-font-size);
|
|
106
|
+
backface-visibility: hidden;
|
|
107
|
+
width: auto;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
text-overflow: ellipsis;
|
|
110
|
+
white-space: nowrap;
|
|
111
|
+
width: 100%;
|
|
112
|
+
}
|
|
113
|
+
.bui-picker-panel-option-hidden {
|
|
114
|
+
visibility: hidden;
|
|
115
|
+
opacity: 0;
|
|
116
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import './Popover.less';
|
|
3
2
|
import { PopoverProps } from './Popover.types';
|
|
3
|
+
import './index.less';
|
|
4
4
|
declare const Popover: React.ForwardRefExoticComponent<Omit<PopoverProps<"div", {}>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
export default Popover;
|
package/dist/Popover/Popover.js
CHANGED
|
@@ -51,26 +51,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
51
51
|
mod
|
|
52
52
|
));
|
|
53
53
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
54
|
-
var __async = (__this, __arguments, generator) => {
|
|
55
|
-
return new Promise((resolve, reject) => {
|
|
56
|
-
var fulfilled = (value) => {
|
|
57
|
-
try {
|
|
58
|
-
step(generator.next(value));
|
|
59
|
-
} catch (e) {
|
|
60
|
-
reject(e);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
var rejected = (value) => {
|
|
64
|
-
try {
|
|
65
|
-
step(generator.throw(value));
|
|
66
|
-
} catch (e) {
|
|
67
|
-
reject(e);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
71
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
54
|
var Popover_exports = {};
|
|
75
55
|
__export(Popover_exports, {
|
|
76
56
|
default: () => Popover_default
|
|
@@ -80,7 +60,7 @@ var import_clsx = __toESM(require("clsx"));
|
|
|
80
60
|
var import_react = __toESM(require("react"));
|
|
81
61
|
var import_utils = require("@bifrostui/utils");
|
|
82
62
|
var import_Portal = __toESM(require("../Portal"));
|
|
83
|
-
var
|
|
63
|
+
var import_index = require("./index.css");
|
|
84
64
|
const prefixCls = "bui-popover";
|
|
85
65
|
const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) => {
|
|
86
66
|
const _a = props, {
|
|
@@ -93,9 +73,9 @@ const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
|
|
|
93
73
|
offsetSpacing = 0,
|
|
94
74
|
placement = "top",
|
|
95
75
|
trigger = "click",
|
|
76
|
+
onOpenChange,
|
|
96
77
|
open,
|
|
97
|
-
hideArrow
|
|
98
|
-
onOpenChange
|
|
78
|
+
hideArrow
|
|
99
79
|
} = _a, others = __objRest(_a, [
|
|
100
80
|
"className",
|
|
101
81
|
"style",
|
|
@@ -106,9 +86,9 @@ const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
|
|
|
106
86
|
"offsetSpacing",
|
|
107
87
|
"placement",
|
|
108
88
|
"trigger",
|
|
89
|
+
"onOpenChange",
|
|
109
90
|
"open",
|
|
110
|
-
"hideArrow"
|
|
111
|
-
"onOpenChange"
|
|
91
|
+
"hideArrow"
|
|
112
92
|
]);
|
|
113
93
|
const controlByUser = typeof open !== "undefined";
|
|
114
94
|
const { direction, location = "center" } = (0, import_utils.parsePlacement)(placement);
|
|
@@ -116,18 +96,11 @@ const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
|
|
|
116
96
|
const [openStatus, setOpenStatus] = (0, import_react.useState)(defaultOpen);
|
|
117
97
|
const [arrowDirection, setArrowDirection] = (0, import_react.useState)(direction);
|
|
118
98
|
const [arrowLocation, setArrowLocation] = (0, import_react.useState)(location);
|
|
119
|
-
const [
|
|
120
|
-
const
|
|
121
|
-
const nodeRef = (0, import_utils.useForkRef)(ref, tipRef);
|
|
122
|
-
const clearRef = (status) => {
|
|
123
|
-
if (status === false) {
|
|
124
|
-
tipRef.current = null;
|
|
125
|
-
}
|
|
126
|
-
};
|
|
99
|
+
const [tooltyles, setTooltyles] = (0, import_react.useState)({});
|
|
100
|
+
const ttId = (0, import_utils.useUniqueId)();
|
|
127
101
|
const changeOpenStatus = (event, status) => {
|
|
128
102
|
if (controlByUser)
|
|
129
103
|
return;
|
|
130
|
-
clearRef(status);
|
|
131
104
|
setOpenStatus(status);
|
|
132
105
|
onOpenChange == null ? void 0 : onOpenChange(event, { open: status });
|
|
133
106
|
};
|
|
@@ -146,33 +119,23 @@ const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
|
|
|
146
119
|
if (!controlByUser)
|
|
147
120
|
return;
|
|
148
121
|
setOpenStatus(open);
|
|
149
|
-
clearRef(open);
|
|
150
122
|
}, [open]);
|
|
151
|
-
(0, import_react.useEffect)(() => {
|
|
152
|
-
if (!openStatus) {
|
|
153
|
-
setToolStyles({
|
|
154
|
-
visibility: "hidden"
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
}, [openStatus]);
|
|
158
123
|
const clickEventHandler = (event) => {
|
|
159
124
|
if (trigger === "hover" || (trigger == null ? void 0 : trigger.length) === 1 && (trigger == null ? void 0 : trigger[0]) === "hover")
|
|
160
125
|
return;
|
|
161
126
|
hidePopover(event);
|
|
162
127
|
};
|
|
163
|
-
const onRootElementMouted = (0, import_utils.throttle)(() =>
|
|
164
|
-
if (!tipRef.current)
|
|
165
|
-
return;
|
|
128
|
+
const onRootElementMouted = (0, import_utils.throttle)(() => {
|
|
166
129
|
const {
|
|
167
130
|
direction: newParsedDirection,
|
|
168
131
|
location: newParsedLocation = "center"
|
|
169
132
|
} = (0, import_utils.parsePlacement)(placement);
|
|
170
|
-
const result =
|
|
133
|
+
const result = (0, import_utils.getStylesAndLocation)({
|
|
171
134
|
childrenRef,
|
|
172
135
|
arrowDirection: newParsedDirection,
|
|
173
136
|
arrowLocation: newParsedLocation,
|
|
174
137
|
offsetSpacing,
|
|
175
|
-
|
|
138
|
+
selector: `[data-id="tt_${ttId}"]`
|
|
176
139
|
});
|
|
177
140
|
if (!result)
|
|
178
141
|
return;
|
|
@@ -183,32 +146,26 @@ const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
|
|
|
183
146
|
if (newArrowLocation !== arrowLocation) {
|
|
184
147
|
setArrowLocation(newArrowLocation);
|
|
185
148
|
}
|
|
186
|
-
|
|
187
|
-
}
|
|
149
|
+
setTooltyles(styles);
|
|
150
|
+
}, 100);
|
|
151
|
+
const bindEvent = () => {
|
|
152
|
+
if (!controlByUser) {
|
|
153
|
+
document.addEventListener("click", clickEventHandler);
|
|
154
|
+
}
|
|
155
|
+
window.addEventListener("resize", onRootElementMouted);
|
|
156
|
+
};
|
|
157
|
+
const unbindEvent = () => {
|
|
158
|
+
if (!controlByUser) {
|
|
159
|
+
document.removeEventListener("click", clickEventHandler);
|
|
160
|
+
}
|
|
161
|
+
window.removeEventListener("resize", onRootElementMouted);
|
|
162
|
+
};
|
|
188
163
|
(0, import_react.useEffect)(() => {
|
|
189
|
-
const bindEvent = () => {
|
|
190
|
-
if (!tipRef.current)
|
|
191
|
-
return;
|
|
192
|
-
if (!controlByUser) {
|
|
193
|
-
document.addEventListener("click", clickEventHandler);
|
|
194
|
-
}
|
|
195
|
-
if (!import_utils.isMini) {
|
|
196
|
-
window.addEventListener("resize", onRootElementMouted);
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
const unbindEvent = () => {
|
|
200
|
-
if (!controlByUser) {
|
|
201
|
-
document.removeEventListener("click", clickEventHandler);
|
|
202
|
-
}
|
|
203
|
-
if (!import_utils.isMini) {
|
|
204
|
-
window.removeEventListener("resize", onRootElementMouted);
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
164
|
bindEvent();
|
|
208
165
|
return () => {
|
|
209
166
|
unbindEvent();
|
|
210
167
|
};
|
|
211
|
-
}, [
|
|
168
|
+
}, []);
|
|
212
169
|
if (!title && !content)
|
|
213
170
|
return null;
|
|
214
171
|
let triggerEventOption;
|
|
@@ -223,14 +180,14 @@ const Popover = /* @__PURE__ */ import_react.default.forwardRef((props, ref) =>
|
|
|
223
180
|
const childrenOptions = __spreadValues({
|
|
224
181
|
ref: childrenRef
|
|
225
182
|
}, triggerEventOption);
|
|
226
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, open || openStatus ? /* @__PURE__ */ import_react.default.createElement(import_Portal.default, { onRootElementMouted }, /* @__PURE__ */ import_react.default.createElement(
|
|
183
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, open || openStatus ? /* @__PURE__ */ import_react.default.createElement(import_Portal.default, { onRootElementMouted, ref }, /* @__PURE__ */ import_react.default.createElement(
|
|
227
184
|
"div",
|
|
228
185
|
__spreadValues({
|
|
229
186
|
className: (0, import_clsx.default)(prefixCls, className, `popover-${arrowDirection}`, {
|
|
230
187
|
"bui-popover-arrow-hide": hideArrow
|
|
231
188
|
}),
|
|
232
|
-
|
|
233
|
-
|
|
189
|
+
"data-id": `tt_${ttId}`,
|
|
190
|
+
style: __spreadValues(__spreadValues({}, style), tooltyles)
|
|
234
191
|
}, others),
|
|
235
192
|
!hideArrow ? /* @__PURE__ */ import_react.default.createElement(
|
|
236
193
|
"div",
|