@bifrostui/react 1.1.11-beta.0 → 1.1.11-beta.9
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/README.md +3 -0
- package/dist/ActionSheet/ActionSheet.js +107 -62
- package/dist/ActionSheet/ActionSheet.types.js +15 -5
- package/dist/ActionSheet/ActionSheetContext.js +35 -10
- package/dist/ActionSheet/ActionSheetItem.d.ts +1 -1
- package/dist/ActionSheet/ActionSheetItem.js +113 -52
- package/dist/ActionSheet/ActionSheetItem.types.js +15 -5
- package/dist/ActionSheet/index.js +42 -50
- package/dist/Alert/Alert.d.ts +1 -1
- package/dist/Alert/Alert.js +157 -95
- package/dist/Alert/Alert.types.js +15 -5
- package/dist/Alert/index.js +38 -30
- package/dist/Avatar/Avatar.d.ts +1 -1
- package/dist/Avatar/Avatar.js +118 -43
- package/dist/Avatar/Avatar.types.js +15 -5
- package/dist/Avatar/AvatarGroup.d.ts +1 -1
- package/dist/Avatar/AvatarGroup.js +122 -64
- package/dist/Avatar/AvatarGroup.types.js +15 -5
- package/dist/Avatar/index.js +43 -50
- package/dist/Backdrop/Backdrop.d.ts +1 -1
- package/dist/Backdrop/Backdrop.js +95 -33
- package/dist/Backdrop/Backdrop.types.js +15 -5
- package/dist/Backdrop/index.js +37 -30
- package/dist/Badge/Badge.d.ts +1 -1
- package/dist/Badge/Badge.js +102 -31
- package/dist/Badge/Badge.types.js +15 -5
- package/dist/Badge/index.js +37 -30
- package/dist/Button/Button.css +31 -7
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.js +111 -48
- package/dist/Button/Button.types.js +15 -5
- package/dist/Button/index.js +37 -30
- package/dist/Calendar/Calendar.d.ts +1 -1
- package/dist/Calendar/Calendar.js +303 -257
- package/dist/Calendar/Calendar.types.js +15 -5
- package/dist/Calendar/index.js +37 -30
- package/dist/Calendar/utils.js +55 -44
- package/dist/Card/Card.d.ts +1 -1
- package/dist/Card/Card.js +74 -25
- package/dist/Card/Card.types.js +15 -5
- package/dist/Card/CardContent.d.ts +1 -1
- package/dist/Card/CardContent.js +69 -24
- package/dist/Card/CardContent.types.js +15 -5
- package/dist/Card/CardFooter.d.ts +1 -1
- package/dist/Card/CardFooter.js +69 -24
- package/dist/Card/CardFooter.types.js +15 -5
- package/dist/Card/CardHeader.d.ts +1 -1
- package/dist/Card/CardHeader.js +91 -56
- package/dist/Card/CardHeader.types.js +15 -5
- package/dist/Card/index.js +54 -91
- package/dist/Checkbox/Checkbox.d.ts +1 -1
- package/dist/Checkbox/Checkbox.js +133 -66
- package/dist/Checkbox/Checkbox.types.js +15 -5
- package/dist/Checkbox/CheckboxContext.js +40 -10
- package/dist/Checkbox/CheckboxGroup.d.ts +1 -1
- package/dist/Checkbox/CheckboxGroup.js +109 -52
- package/dist/Checkbox/index.js +40 -38
- package/dist/CitySelector/CitySelector.d.ts +1 -1
- package/dist/CitySelector/CitySelector.js +83 -35
- package/dist/CitySelector/CitySelector.miniapp.d.ts +1 -1
- package/dist/CitySelector/CitySelector.miniapp.js +123 -77
- package/dist/CitySelector/CitySelector.types.js +15 -5
- package/dist/CitySelector/CitySelectorCore.js +228 -174
- package/dist/CitySelector/Selector/index.js +46 -20
- package/dist/CitySelector/index.js +37 -30
- package/dist/Countdown/Countdown.css +11 -1
- package/dist/Countdown/Countdown.d.ts +1 -1
- package/dist/Countdown/Countdown.js +126 -70
- package/dist/Countdown/Countdown.types.js +15 -5
- package/dist/Countdown/index.js +39 -42
- package/dist/Countdown/useCountdown.js +37 -27
- package/dist/Countdown/utils.js +73 -74
- package/dist/Divider/Divider.d.ts +1 -1
- package/dist/Divider/Divider.js +70 -51
- package/dist/Divider/Divider.types.js +15 -5
- package/dist/Divider/index.js +37 -30
- package/dist/Drawer/Drawer.css +0 -1
- package/dist/Drawer/Drawer.js +124 -46
- package/dist/Drawer/Drawer.types.js +15 -5
- package/dist/Drawer/index.js +37 -30
- package/dist/Fade/Fade.js +111 -52
- package/dist/Fade/Fade.types.js +15 -5
- package/dist/Fade/index.js +38 -30
- package/dist/IconButton/IconButton.css +26 -6
- package/dist/IconButton/IconButton.d.ts +1 -1
- package/dist/IconButton/IconButton.js +114 -46
- package/dist/IconButton/IconButton.types.js +15 -5
- package/dist/IconButton/index.js +37 -30
- package/dist/Image/Image.d.ts +1 -1
- package/dist/Image/Image.js +143 -78
- package/dist/Image/Image.types.js +15 -5
- package/dist/Image/index.js +38 -30
- package/dist/Input/Input.d.ts +1 -1
- package/dist/Input/Input.js +144 -74
- package/dist/Input/Input.types.js +15 -5
- package/dist/Input/index.js +37 -30
- package/dist/List/List.d.ts +1 -1
- package/dist/List/List.js +89 -28
- package/dist/List/List.types.js +15 -5
- package/dist/List/ListContext.js +34 -9
- package/dist/List/ListItem.d.ts +1 -1
- package/dist/List/ListItem.js +97 -42
- package/dist/List/ListItem.types.js +15 -5
- package/dist/List/ListItemContent.d.ts +1 -1
- package/dist/List/ListItemContent.js +82 -34
- package/dist/List/ListItemContent.types.js +15 -5
- package/dist/List/ListItemExtra.d.ts +1 -1
- package/dist/List/ListItemExtra.js +70 -26
- package/dist/List/ListItemExtra.types.js +15 -5
- package/dist/List/ListItemFooter.d.ts +1 -1
- package/dist/List/ListItemFooter.js +70 -26
- package/dist/List/ListItemFooter.types.js +15 -5
- package/dist/List/ListItemHeader.d.ts +1 -1
- package/dist/List/ListItemHeader.js +70 -26
- package/dist/List/ListItemHeader.types.js +15 -5
- package/dist/List/index.js +62 -130
- package/dist/Loading/Loading.d.ts +1 -1
- package/dist/Loading/Loading.js +82 -33
- package/dist/Loading/Loading.types.js +15 -5
- package/dist/Loading/index.js +37 -30
- package/dist/Modal/Modal.d.ts +1 -1
- package/dist/Modal/Modal.js +112 -56
- package/dist/Modal/Modal.miniapp.d.ts +3 -3
- package/dist/Modal/Modal.miniapp.js +132 -63
- package/dist/Modal/Modal.types.js +15 -5
- package/dist/Modal/index.js +38 -30
- package/dist/NavBar/NavBar.d.ts +1 -1
- package/dist/NavBar/NavBar.js +109 -59
- package/dist/NavBar/NavBar.types.js +15 -5
- package/dist/NavBar/index.js +37 -30
- package/dist/Picker/Picker.d.ts +1 -1
- package/dist/Picker/Picker.js +155 -97
- package/dist/Picker/Picker.types.js +15 -5
- package/dist/Picker/PickerPanel.css +9 -1
- package/dist/Picker/PickerPanel.d.ts +1 -1
- package/dist/Picker/PickerPanel.js +255 -202
- package/dist/Picker/index.js +37 -30
- package/dist/Picker/utils.js +42 -37
- package/dist/Portal/Portal.js +61 -16
- package/dist/Portal/Portal.miniapp.js +68 -31
- package/dist/Portal/Portal.types.js +15 -5
- package/dist/Portal/PortalCore.js +70 -52
- package/dist/Portal/index.js +38 -30
- package/dist/Progress/Progress.d.ts +1 -1
- package/dist/Progress/Progress.js +102 -61
- package/dist/Progress/Progress.types.js +15 -5
- package/dist/Progress/index.js +38 -30
- package/dist/Radio/Radio.d.ts +1 -1
- package/dist/Radio/Radio.js +144 -80
- package/dist/Radio/Radio.types.js +15 -5
- package/dist/Radio/RadioButtonIcon.js +63 -32
- package/dist/Radio/RadioContext.js +40 -10
- package/dist/Radio/RadioGroup.d.ts +1 -1
- package/dist/Radio/RadioGroup.js +89 -34
- package/dist/Radio/index.js +40 -38
- package/dist/Rating/Rating.d.ts +1 -1
- package/dist/Rating/Rating.js +139 -62
- package/dist/Rating/Rating.types.js +15 -5
- package/dist/Rating/index.js +37 -30
- package/dist/ScrollView/ScrollView.d.ts +1 -1
- package/dist/ScrollView/ScrollView.js +226 -178
- package/{es/ScrollView/index.miniapp.js → dist/ScrollView/ScrollView.miniapp.d.ts} +0 -1
- package/dist/ScrollView/ScrollView.miniapp.js +24 -0
- package/dist/ScrollView/ScrollView.types.js +15 -5
- package/dist/ScrollView/index.js +38 -30
- package/dist/Select/Select.d.ts +1 -1
- package/dist/Select/Select.js +176 -114
- package/dist/Select/Select.types.js +15 -5
- package/dist/Select/SelectOption.d.ts +1 -1
- package/dist/Select/SelectOption.js +92 -48
- package/dist/Select/index.js +40 -38
- package/dist/Select/selectContext.js +24 -8
- package/dist/Skeleton/Skeleton.css +7 -2
- package/dist/Skeleton/Skeleton.d.ts +1 -1
- package/dist/Skeleton/Skeleton.js +101 -37
- package/dist/Skeleton/Skeleton.types.js +15 -5
- package/dist/Skeleton/index.js +38 -30
- package/dist/Slide/Slide.js +125 -64
- package/dist/Slide/Slide.types.js +15 -5
- package/dist/Slide/index.js +38 -30
- package/dist/Slider/Slider.css +2 -2
- package/dist/Slider/Slider.d.ts +1 -1
- package/dist/Slider/Slider.js +215 -171
- package/dist/Slider/Slider.types.js +15 -5
- package/dist/Slider/index.js +37 -30
- package/dist/Slider/utils.js +35 -24
- package/dist/Stack/Stack.css +0 -1
- package/dist/Stack/Stack.d.ts +1 -1
- package/dist/Stack/Stack.js +96 -41
- package/dist/Stack/Stack.types.js +15 -5
- package/dist/Stack/demo/StackDemo.js +148 -122
- package/dist/Stack/index.js +38 -30
- package/dist/Steps/Step.css +2 -2
- package/dist/Steps/Step.d.ts +1 -1
- package/dist/Steps/Step.js +144 -87
- package/dist/Steps/Step.types.js +15 -5
- package/dist/Steps/Steps.d.ts +1 -1
- package/dist/Steps/Steps.js +107 -46
- package/dist/Steps/Steps.types.js +15 -5
- package/dist/Steps/StepsContext.js +40 -10
- package/dist/Steps/index.js +42 -50
- package/dist/Swiper/Swiper.d.ts +1 -1
- package/dist/Swiper/Swiper.js +149 -82
- package/dist/Swiper/Swiper.miniapp.d.ts +2 -0
- package/dist/Swiper/Swiper.miniapp.js +24 -0
- package/dist/Swiper/Swiper.types.js +15 -5
- package/dist/Swiper/SwiperItem.js +66 -28
- package/dist/Swiper/SwiperItem.miniapp.d.ts +2 -0
- package/dist/Swiper/SwiperItem.miniapp.js +24 -0
- package/dist/Swiper/index.js +40 -38
- package/dist/Switch/Switch.css +1 -1
- package/dist/Switch/Switch.d.ts +1 -1
- package/dist/Switch/Switch.js +121 -48
- package/dist/Switch/Switch.types.js +15 -5
- package/dist/Switch/index.js +38 -30
- package/dist/TabBar/TabBar.d.ts +1 -1
- package/dist/TabBar/TabBar.js +95 -37
- package/dist/TabBar/TabBarContext.js +24 -8
- package/dist/TabBar/TabBarItem.d.ts +1 -1
- package/dist/TabBar/TabBarItem.js +123 -59
- package/dist/TabBar/index.js +39 -32
- package/dist/TabBar/index.types.js +15 -5
- package/dist/Tabs/Tab.d.ts +1 -1
- package/dist/Tabs/Tab.js +104 -52
- package/dist/Tabs/Tab.types.js +15 -5
- package/dist/Tabs/TabPanel.d.ts +1 -1
- package/dist/Tabs/TabPanel.js +76 -31
- package/dist/Tabs/TabPanel.types.js +15 -5
- package/dist/Tabs/Tabs.css +10 -3
- package/dist/Tabs/Tabs.d.ts +1 -1
- package/dist/Tabs/Tabs.js +177 -127
- package/dist/Tabs/Tabs.types.js +15 -5
- package/dist/Tabs/TabsContext.d.ts +2 -2
- package/dist/Tabs/TabsContext.js +42 -12
- package/dist/Tabs/index.js +48 -71
- package/dist/Tabs/utils/bound.js +24 -8
- package/dist/Tag/Tag.d.ts +1 -1
- package/dist/Tag/Tag.js +102 -47
- package/dist/Tag/Tag.types.js +15 -5
- package/dist/Tag/TagGroup.css +1 -1
- package/dist/Tag/TagGroup.d.ts +1 -1
- package/dist/Tag/TagGroup.js +74 -25
- package/dist/Tag/TagGroup.types.js +15 -5
- package/dist/Tag/index.js +41 -44
- package/dist/TextArea/TextArea.d.ts +1 -1
- package/dist/TextArea/TextArea.js +203 -137
- package/dist/TextArea/TextArea.types.js +15 -5
- package/dist/TextArea/index.js +37 -30
- package/dist/Transition/Transition.js +61 -17
- package/dist/Transition/Transition.miniapp.js +62 -17
- package/dist/Transition/Transition.types.js +15 -5
- package/dist/Transition/TransitionCore.js +243 -161
- package/dist/Transition/index.js +38 -30
- package/dist/index.js +98 -444
- package/es/ActionSheet/ActionSheet.js +79 -54
- package/es/ActionSheet/ActionSheet.types.js +0 -1
- package/es/ActionSheet/ActionSheetContext.js +7 -4
- package/es/ActionSheet/ActionSheetItem.d.ts +1 -1
- package/es/ActionSheet/ActionSheetItem.js +86 -45
- package/es/ActionSheet/ActionSheetItem.types.js +0 -1
- package/es/ActionSheet/index.js +8 -3
- package/es/Alert/Alert.d.ts +1 -1
- package/es/Alert/Alert.js +145 -99
- package/es/Alert/Alert.types.js +0 -1
- package/es/Alert/index.js +5 -2
- package/es/Avatar/Avatar.d.ts +1 -1
- package/es/Avatar/Avatar.js +102 -50
- package/es/Avatar/Avatar.types.js +0 -1
- package/es/Avatar/AvatarGroup.d.ts +1 -1
- package/es/Avatar/AvatarGroup.js +96 -61
- package/es/Avatar/AvatarGroup.types.js +0 -1
- package/es/Avatar/index.js +7 -3
- package/es/Backdrop/Backdrop.d.ts +1 -1
- package/es/Backdrop/Backdrop.js +67 -28
- package/es/Backdrop/Backdrop.types.js +0 -1
- package/es/Backdrop/index.js +6 -2
- package/es/Badge/Badge.d.ts +1 -1
- package/es/Badge/Badge.js +82 -34
- package/es/Badge/Badge.types.js +0 -1
- package/es/Badge/index.js +6 -2
- package/es/Button/Button.css +31 -7
- package/es/Button/Button.d.ts +1 -1
- package/es/Button/Button.js +84 -42
- package/es/Button/Button.types.js +0 -1
- package/es/Button/index.js +6 -2
- package/es/Calendar/Calendar.d.ts +1 -1
- package/es/Calendar/Calendar.js +272 -264
- package/es/Calendar/Calendar.types.js +0 -1
- package/es/Calendar/index.js +6 -2
- package/es/Calendar/utils.js +27 -42
- package/es/Card/Card.d.ts +1 -1
- package/es/Card/Card.js +47 -19
- package/es/Card/Card.types.js +0 -1
- package/es/Card/CardContent.d.ts +1 -1
- package/es/Card/CardContent.js +42 -18
- package/es/Card/CardContent.types.js +0 -1
- package/es/Card/CardFooter.d.ts +1 -1
- package/es/Card/CardFooter.js +42 -18
- package/es/Card/CardFooter.types.js +0 -1
- package/es/Card/CardHeader.d.ts +1 -1
- package/es/Card/CardHeader.js +65 -51
- package/es/Card/CardHeader.types.js +0 -1
- package/es/Card/index.js +9 -3
- package/es/Checkbox/Checkbox.d.ts +1 -1
- package/es/Checkbox/Checkbox.js +123 -90
- package/es/Checkbox/Checkbox.types.js +0 -1
- package/es/Checkbox/CheckboxContext.js +8 -4
- package/es/Checkbox/CheckboxGroup.d.ts +1 -1
- package/es/Checkbox/CheckboxGroup.js +81 -58
- package/es/Checkbox/index.js +7 -2
- package/es/CitySelector/CitySelector.d.ts +1 -1
- package/es/CitySelector/CitySelector.js +56 -35
- package/es/CitySelector/CitySelector.miniapp.d.ts +1 -1
- package/es/CitySelector/CitySelector.miniapp.js +95 -74
- package/es/CitySelector/CitySelector.types.js +0 -1
- package/es/CitySelector/CitySelectorCore.js +203 -187
- package/es/CitySelector/Selector/index.js +17 -11
- package/es/CitySelector/index.js +6 -2
- package/es/Countdown/Countdown.css +11 -1
- package/es/Countdown/Countdown.d.ts +1 -1
- package/es/Countdown/Countdown.js +108 -85
- package/es/Countdown/Countdown.types.js +0 -1
- package/es/Countdown/index.js +6 -2
- package/es/Countdown/useCountdown.js +26 -43
- package/es/Countdown/utils.js +78 -105
- package/es/Divider/Divider.d.ts +1 -1
- package/es/Divider/Divider.js +45 -41
- package/es/Divider/Divider.types.js +0 -1
- package/es/Divider/index.js +6 -2
- package/es/Drawer/Drawer.css +0 -1
- package/es/Drawer/Drawer.js +107 -61
- package/es/Drawer/Drawer.types.js +0 -1
- package/es/Drawer/index.js +6 -2
- package/es/Fade/Fade.js +95 -55
- package/es/Fade/Fade.types.js +0 -1
- package/es/Fade/index.js +7 -3
- package/es/IconButton/IconButton.css +26 -6
- package/es/IconButton/IconButton.d.ts +1 -1
- package/es/IconButton/IconButton.js +87 -41
- package/es/IconButton/IconButton.types.js +0 -1
- package/es/IconButton/index.js +6 -2
- package/es/Image/Image.d.ts +1 -1
- package/es/Image/Image.js +136 -106
- package/es/Image/Image.types.js +0 -1
- package/es/Image/index.js +7 -3
- package/es/Input/Input.d.ts +1 -1
- package/es/Input/Input.js +136 -103
- package/es/Input/Input.types.js +0 -1
- package/es/Input/index.js +6 -2
- package/es/List/List.d.ts +1 -1
- package/es/List/List.js +68 -28
- package/es/List/List.types.js +0 -1
- package/es/List/ListContext.js +6 -3
- package/es/List/ListItem.d.ts +1 -1
- package/es/List/ListItem.js +75 -42
- package/es/List/ListItem.types.js +0 -1
- package/es/List/ListItemContent.d.ts +1 -1
- package/es/List/ListItemContent.js +55 -28
- package/es/List/ListItemContent.types.js +0 -1
- package/es/List/ListItemExtra.d.ts +1 -1
- package/es/List/ListItemExtra.js +43 -20
- package/es/List/ListItemExtra.types.js +0 -1
- package/es/List/ListItemFooter.d.ts +1 -1
- package/es/List/ListItemFooter.js +43 -20
- package/es/List/ListItemFooter.types.js +0 -1
- package/es/List/ListItemHeader.d.ts +1 -1
- package/es/List/ListItemHeader.js +43 -20
- package/es/List/ListItemHeader.types.js +0 -1
- package/es/List/index.js +10 -2
- package/es/Loading/Loading.d.ts +1 -1
- package/es/Loading/Loading.js +56 -28
- package/es/Loading/Loading.types.js +0 -1
- package/es/Loading/index.js +6 -2
- package/es/Modal/Modal.d.ts +1 -1
- package/es/Modal/Modal.js +93 -70
- package/es/Modal/Modal.miniapp.d.ts +3 -3
- package/es/Modal/Modal.miniapp.js +104 -67
- package/es/Modal/Modal.types.js +0 -1
- package/es/Modal/index.js +7 -3
- package/es/NavBar/NavBar.d.ts +1 -1
- package/es/NavBar/NavBar.js +95 -67
- package/es/NavBar/NavBar.types.js +0 -1
- package/es/NavBar/index.js +6 -2
- package/es/Picker/Picker.d.ts +1 -1
- package/es/Picker/Picker.js +139 -124
- package/es/Picker/Picker.types.js +0 -1
- package/es/Picker/PickerPanel.css +9 -1
- package/es/Picker/PickerPanel.d.ts +1 -1
- package/es/Picker/PickerPanel.js +228 -226
- package/es/Picker/index.js +6 -2
- package/es/Picker/utils.js +28 -47
- package/es/Portal/Portal.js +31 -10
- package/es/Portal/Portal.miniapp.js +40 -23
- package/es/Portal/Portal.types.js +0 -1
- package/es/Portal/PortalCore.js +42 -53
- package/es/Portal/index.js +7 -3
- package/es/Progress/Progress.d.ts +1 -1
- package/es/Progress/Progress.js +76 -67
- package/es/Progress/Progress.types.js +0 -1
- package/es/Progress/index.js +7 -3
- package/es/Radio/Radio.d.ts +1 -1
- package/es/Radio/Radio.js +133 -102
- package/es/Radio/Radio.types.js +0 -1
- package/es/Radio/RadioButtonIcon.js +38 -28
- package/es/Radio/RadioContext.js +8 -4
- package/es/Radio/RadioGroup.d.ts +1 -1
- package/es/Radio/RadioGroup.js +71 -44
- package/es/Radio/index.js +7 -2
- package/es/Rating/Rating.d.ts +1 -1
- package/es/Rating/Rating.js +132 -89
- package/es/Rating/Rating.types.js +0 -1
- package/es/Rating/index.js +6 -2
- package/es/ScrollView/ScrollView.d.ts +1 -1
- package/es/ScrollView/ScrollView.js +204 -185
- package/{dist/ScrollView/index.miniapp.d.ts → es/ScrollView/ScrollView.miniapp.d.ts} +0 -1
- package/es/ScrollView/ScrollView.miniapp.js +5 -0
- package/es/ScrollView/ScrollView.types.js +0 -1
- package/es/ScrollView/index.js +7 -3
- package/es/Select/Select.d.ts +1 -1
- package/es/Select/Select.js +167 -138
- package/es/Select/Select.types.js +0 -1
- package/es/Select/SelectOption.d.ts +1 -1
- package/es/Select/SelectOption.js +66 -41
- package/es/Select/index.js +6 -2
- package/es/Select/selectContext.js +6 -3
- package/es/Skeleton/Skeleton.css +7 -2
- package/es/Skeleton/Skeleton.d.ts +1 -1
- package/es/Skeleton/Skeleton.js +76 -35
- package/es/Skeleton/Skeleton.types.js +0 -1
- package/es/Skeleton/index.js +7 -3
- package/es/Slide/Slide.js +110 -67
- package/es/Slide/Slide.types.js +0 -1
- package/es/Slide/index.js +7 -3
- package/es/Slider/Slider.css +2 -2
- package/es/Slider/Slider.d.ts +1 -1
- package/es/Slider/Slider.js +236 -244
- package/es/Slider/Slider.types.js +0 -1
- package/es/Slider/index.js +6 -2
- package/es/Slider/utils.js +13 -22
- package/es/Stack/Stack.css +0 -1
- package/es/Stack/Stack.d.ts +1 -1
- package/es/Stack/Stack.js +78 -47
- package/es/Stack/Stack.types.js +0 -1
- package/es/Stack/demo/StackDemo.js +123 -126
- package/es/Stack/index.js +7 -3
- package/es/Steps/Step.css +2 -2
- package/es/Steps/Step.d.ts +1 -1
- package/es/Steps/Step.js +130 -77
- package/es/Steps/Step.types.js +0 -1
- package/es/Steps/Steps.d.ts +1 -1
- package/es/Steps/Steps.js +83 -44
- package/es/Steps/Steps.types.js +0 -1
- package/es/Steps/StepsContext.js +8 -4
- package/es/Steps/index.js +8 -3
- package/es/Swiper/Swiper.d.ts +1 -1
- package/es/Swiper/Swiper.js +136 -99
- package/es/Swiper/Swiper.miniapp.d.ts +2 -0
- package/es/Swiper/Swiper.miniapp.js +5 -0
- package/es/Swiper/Swiper.types.js +0 -1
- package/es/Swiper/SwiperItem.js +40 -23
- package/es/Swiper/SwiperItem.miniapp.d.ts +2 -0
- package/es/Swiper/SwiperItem.miniapp.js +5 -0
- package/es/Swiper/index.js +8 -3
- package/es/Switch/Switch.css +1 -1
- package/es/Switch/Switch.d.ts +1 -1
- package/es/Switch/Switch.js +110 -67
- package/es/Switch/Switch.types.js +0 -1
- package/es/Switch/index.js +7 -3
- package/es/TabBar/TabBar.d.ts +1 -1
- package/es/TabBar/TabBar.js +72 -36
- package/es/TabBar/TabBarContext.js +6 -3
- package/es/TabBar/TabBarItem.d.ts +1 -1
- package/es/TabBar/TabBarItem.js +97 -52
- package/es/TabBar/index.js +5 -2
- package/es/TabBar/index.types.js +0 -1
- package/es/Tabs/Tab.d.ts +1 -1
- package/es/Tabs/Tab.js +77 -44
- package/es/Tabs/Tab.types.js +0 -1
- package/es/Tabs/TabPanel.d.ts +1 -1
- package/es/Tabs/TabPanel.js +50 -25
- package/es/Tabs/TabPanel.types.js +0 -1
- package/es/Tabs/Tabs.css +10 -3
- package/es/Tabs/Tabs.d.ts +1 -1
- package/es/Tabs/Tabs.js +180 -163
- package/es/Tabs/Tabs.types.js +0 -1
- package/es/Tabs/TabsContext.d.ts +2 -2
- package/es/Tabs/TabsContext.js +10 -6
- package/es/Tabs/index.js +10 -4
- package/es/Tabs/utils/bound.js +8 -5
- package/es/Tag/Tag.d.ts +1 -1
- package/es/Tag/Tag.js +85 -53
- package/es/Tag/Tag.types.js +0 -1
- package/es/Tag/TagGroup.css +1 -1
- package/es/Tag/TagGroup.d.ts +1 -1
- package/es/Tag/TagGroup.js +47 -19
- package/es/Tag/TagGroup.types.js +0 -1
- package/es/Tag/index.js +5 -2
- package/es/TextArea/TextArea.d.ts +1 -1
- package/es/TextArea/TextArea.js +177 -139
- package/es/TextArea/TextArea.types.js +0 -1
- package/es/TextArea/index.js +6 -2
- package/es/Transition/Transition.js +31 -11
- package/es/Transition/Transition.miniapp.js +32 -11
- package/es/Transition/Transition.types.js +0 -1
- package/es/Transition/TransitionCore.js +218 -272
- package/es/Transition/index.js +7 -3
- package/es/index.js +1 -1
- package/package.json +15 -14
- package/dist/ScrollView/index.miniapp.js +0 -14
- package/dist/Swiper/index.miniapp.d.ts +0 -8
- package/dist/Swiper/index.miniapp.js +0 -23
- package/es/ScrollView/index.miniapp.d.ts +0 -3
- package/es/Swiper/index.miniapp.d.ts +0 -8
- package/es/Swiper/index.miniapp.js +0 -6
package/dist/Slider/Slider.js
CHANGED
|
@@ -1,31 +1,99 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
var __export = (target, all) => {
|
|
34
|
+
for (var name in all)
|
|
35
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
36
|
+
};
|
|
37
|
+
var __copyProps = (to, from, except, desc) => {
|
|
38
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
39
|
+
for (let key of __getOwnPropNames(from))
|
|
40
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
41
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
42
|
+
}
|
|
43
|
+
return to;
|
|
44
|
+
};
|
|
45
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
46
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
47
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
48
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
49
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
50
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
51
|
+
mod
|
|
52
|
+
));
|
|
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
|
+
var Slider_exports = {};
|
|
75
|
+
__export(Slider_exports, {
|
|
76
|
+
default: () => Slider_default
|
|
5
77
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
require("./Slider.css");
|
|
12
|
-
var
|
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
78
|
+
module.exports = __toCommonJS(Slider_exports);
|
|
79
|
+
var import_icons = require("@bifrostui/icons");
|
|
80
|
+
var import_utils = require("@bifrostui/utils");
|
|
81
|
+
var import_clsx = __toESM(require("clsx"));
|
|
82
|
+
var import_react = __toESM(require("react"));
|
|
83
|
+
var import_Slider = require("./Slider.css");
|
|
84
|
+
var import_utils2 = require("./utils");
|
|
17
85
|
const classes = {
|
|
18
|
-
root:
|
|
19
|
-
button:
|
|
20
|
-
tooltip:
|
|
21
|
-
disabled:
|
|
86
|
+
root: "bui-slider",
|
|
87
|
+
button: "bui-slider-button",
|
|
88
|
+
tooltip: "bui-slider-tooltip",
|
|
89
|
+
disabled: "bui-slider-disabled"
|
|
22
90
|
};
|
|
23
91
|
const SLIDER_BUTTON = {
|
|
24
92
|
FRONT: 0,
|
|
25
93
|
END: 1
|
|
26
94
|
};
|
|
27
|
-
const Slider =
|
|
28
|
-
const {
|
|
95
|
+
const Slider = import_react.default.forwardRef((props, ref) => {
|
|
96
|
+
const _a = props, {
|
|
29
97
|
className,
|
|
30
98
|
defaultValue,
|
|
31
99
|
value: valueProp,
|
|
@@ -38,169 +106,136 @@ const Slider = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
38
106
|
startIcon,
|
|
39
107
|
endIcon,
|
|
40
108
|
disableSwap,
|
|
41
|
-
onChange
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
109
|
+
onChange
|
|
110
|
+
} = _a, others = __objRest(_a, [
|
|
111
|
+
"className",
|
|
112
|
+
"defaultValue",
|
|
113
|
+
"value",
|
|
114
|
+
"min",
|
|
115
|
+
"max",
|
|
116
|
+
"step",
|
|
117
|
+
"tipVisible",
|
|
118
|
+
"tooltipRender",
|
|
119
|
+
"disabled",
|
|
120
|
+
"startIcon",
|
|
121
|
+
"endIcon",
|
|
122
|
+
"disableSwap",
|
|
123
|
+
"onChange"
|
|
124
|
+
]);
|
|
125
|
+
const initialDefaultValue = (0, import_react.useRef)(defaultValue);
|
|
126
|
+
const latestVal = (0, import_react.useRef)(0);
|
|
127
|
+
const shouldProtection = valueProp === void 0 && defaultValue === void 0;
|
|
48
128
|
const value = shouldProtection ? latestVal.current : valueProp;
|
|
49
|
-
const [rootRef, setRootRef] = (0,
|
|
50
|
-
const handleRef = (0,
|
|
51
|
-
(0,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const beforeMoveValue = (0, _react.useRef)([0, 0]);
|
|
63
|
-
|
|
64
|
-
// 默认图标
|
|
65
|
-
const defaultIcon = /*#__PURE__*/_react.default.createElement(_icons.GripperBarVerticalIcon, {
|
|
66
|
-
htmlColor: "#2e333e"
|
|
67
|
-
});
|
|
68
|
-
// 根据初始化时的数据判断是否为双滑块
|
|
69
|
-
const initialRange = (0, _react.useRef)(value !== undefined && Array.isArray(value) || defaultValue !== undefined && Array.isArray(defaultValue));
|
|
70
|
-
// 是否为双滑块
|
|
71
|
-
const range = (0, _react.useMemo)(() => {
|
|
72
|
-
// defaultValue传state,且通过setState改变defaltValue类型,此时使用初始化时的range(initialRange)判断
|
|
129
|
+
const [rootRef, setRootRef] = (0, import_react.useState)(null);
|
|
130
|
+
const handleRef = (0, import_utils.useForkRef)(ref, setRootRef);
|
|
131
|
+
(0, import_utils.useTouchEmulator)(rootRef);
|
|
132
|
+
const sliderRect = (0, import_react.useRef)();
|
|
133
|
+
const touchStartPageX = (0, import_react.useRef)();
|
|
134
|
+
const touchStartLeft = (0, import_react.useRef)();
|
|
135
|
+
const buttonIndex = (0, import_react.useRef)(0);
|
|
136
|
+
const beforeMoveValue = (0, import_react.useRef)([0, 0]);
|
|
137
|
+
const defaultIcon = /* @__PURE__ */ import_react.default.createElement(import_icons.GripperBarVerticalIcon, { htmlColor: "#2e333e" });
|
|
138
|
+
const initialRange = (0, import_react.useRef)(
|
|
139
|
+
value !== void 0 && Array.isArray(value) || defaultValue !== void 0 && Array.isArray(defaultValue)
|
|
140
|
+
);
|
|
141
|
+
const range = (0, import_react.useMemo)(() => {
|
|
73
142
|
if (Array.isArray(defaultValue) && !Array.isArray(initialDefaultValue.current)) {
|
|
74
143
|
return initialRange.current;
|
|
75
144
|
}
|
|
76
|
-
return value !==
|
|
145
|
+
return value !== void 0 && Array.isArray(value) || defaultValue !== void 0 && Array.isArray(defaultValue);
|
|
77
146
|
}, [value, defaultValue]);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* 格式化value、defaultValue
|
|
85
|
-
* @type undefined | number[]
|
|
86
|
-
*/
|
|
87
|
-
const formattedValue = (0, _utils2.formatValue)(value);
|
|
88
|
-
const formattedDefaultValue = (0, _utils2.formatValue)(defaultValue);
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* 使用格式化后的value、defaultValue初始化sliderValue,应始终使用triggerChange改变值
|
|
92
|
-
* @type undefined | number[]
|
|
93
|
-
*/
|
|
94
|
-
const [sliderValue, triggerChange] = (0, _utils.useValue)({
|
|
147
|
+
const [frontTooltipVisible, setFrontTooltipVisible] = (0, import_react.useState)(false);
|
|
148
|
+
const [endTooltipVisible, setEndTooltipVisible] = (0, import_react.useState)(false);
|
|
149
|
+
const formattedValue = (0, import_utils2.formatValue)(value);
|
|
150
|
+
const formattedDefaultValue = (0, import_utils2.formatValue)(defaultValue);
|
|
151
|
+
const [sliderValue, triggerChange] = (0, import_utils.useValue)({
|
|
95
152
|
value: formattedValue,
|
|
96
153
|
defaultValue: formattedDefaultValue,
|
|
97
154
|
onChange: (e, data) => {
|
|
98
|
-
onChange
|
|
99
|
-
value: data
|
|
155
|
+
onChange == null ? void 0 : onChange(e, {
|
|
156
|
+
value: data == null ? void 0 : data.value,
|
|
100
157
|
buttonIndex: buttonIndex.current
|
|
101
158
|
});
|
|
102
159
|
},
|
|
103
160
|
config: {
|
|
104
|
-
name:
|
|
105
|
-
state:
|
|
161
|
+
name: "Slider",
|
|
162
|
+
state: "value"
|
|
106
163
|
}
|
|
107
164
|
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const internalValue = (0, _react.useMemo)(() => {
|
|
111
|
-
return sliderValue === undefined ? [min, max] : sliderValue;
|
|
165
|
+
const internalValue = (0, import_react.useMemo)(() => {
|
|
166
|
+
return sliderValue === void 0 ? [min, max] : sliderValue;
|
|
112
167
|
}, [sliderValue]);
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
// 最大最小值范围
|
|
119
|
-
const scope = (0, _react.useMemo)(() => Number(max) - Number(min), [max, min]);
|
|
120
|
-
|
|
121
|
-
// 提示气泡展示逻辑
|
|
122
|
-
const tooltipVisible = (0, _react.useMemo)(() => {
|
|
168
|
+
const preValueRef = (0, import_react.useRef)(internalValue[buttonIndex.current]);
|
|
169
|
+
const tooltipRef = (0, import_react.useRef)(internalValue);
|
|
170
|
+
const scope = (0, import_react.useMemo)(() => Number(max) - Number(min), [max, min]);
|
|
171
|
+
const tooltipVisible = (0, import_react.useMemo)(() => {
|
|
123
172
|
const startVisible = buttonIndex.current === SLIDER_BUTTON.FRONT && frontTooltipVisible;
|
|
124
173
|
const endVisible = buttonIndex.current === SLIDER_BUTTON.END && endTooltipVisible;
|
|
125
174
|
return tipVisible || !tipVisible && (startVisible || endVisible);
|
|
126
175
|
}, [tipVisible, frontTooltipVisible, endTooltipVisible]);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const lineStyle = (0, _react.useMemo)(() => {
|
|
130
|
-
const sortedValue = (0, _utils2.sortValue)(internalValue);
|
|
176
|
+
const lineStyle = (0, import_react.useMemo)(() => {
|
|
177
|
+
const sortedValue = (0, import_utils2.sortValue)(internalValue);
|
|
131
178
|
let width = `${(sortedValue[1] - sortedValue[0] - min) / scope * 100}%`;
|
|
132
|
-
// 单滑块模式但动态修改value为数组,此时按照数组最小值计算着色条宽度
|
|
133
179
|
if (!range && Array.isArray(value)) {
|
|
134
180
|
width = `${(sortedValue[0] - min) / scope * 100}%`;
|
|
135
181
|
}
|
|
136
182
|
return {
|
|
137
|
-
left: range ? `${(sortedValue[0] - min) / scope * 100}%` :
|
|
183
|
+
left: range ? `${(sortedValue[0] - min) / scope * 100}%` : "0%",
|
|
138
184
|
width
|
|
139
185
|
};
|
|
140
186
|
}, [internalValue, scope, value]);
|
|
141
|
-
const getLineWidth = (0,
|
|
142
|
-
if (!rootRef)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
187
|
+
const getLineWidth = (0, import_react.useCallback)(() => __async(void 0, null, function* () {
|
|
188
|
+
if (!rootRef)
|
|
189
|
+
return;
|
|
190
|
+
sliderRect.current = yield (0, import_utils.getBoundingClientRect)(rootRef);
|
|
191
|
+
}), [rootRef]);
|
|
192
|
+
(0, import_react.useLayoutEffect)(() => {
|
|
147
193
|
setTimeout(() => {
|
|
148
194
|
getLineWidth();
|
|
149
195
|
}, 100);
|
|
150
196
|
}, [rootRef]);
|
|
151
|
-
const onTouchStart = e => {
|
|
152
|
-
if (disabled)
|
|
197
|
+
const onTouchStart = (e) => {
|
|
198
|
+
if (disabled)
|
|
199
|
+
return;
|
|
153
200
|
beforeMoveValue.current = internalValue;
|
|
154
201
|
tooltipRef.current = internalValue;
|
|
155
|
-
// 补偿获取宽度,隐藏元素getBoundingClientRect获取不到dom信息
|
|
156
202
|
if (!sliderRect.current.width) {
|
|
157
203
|
getLineWidth();
|
|
158
204
|
}
|
|
159
|
-
|
|
160
|
-
const currentTarget = _utils.isMini ? e.mpEvent.currentTarget : e.currentTarget;
|
|
205
|
+
const currentTarget = import_utils.isMini ? e.mpEvent.currentTarget : e.currentTarget;
|
|
161
206
|
touchStartPageX.current = e.touches[0].pageX;
|
|
162
|
-
touchStartLeft.current = currentTarget
|
|
163
|
-
|
|
164
|
-
// 显示气泡提示
|
|
207
|
+
touchStartLeft.current = currentTarget == null ? void 0 : currentTarget.offsetLeft;
|
|
165
208
|
if (buttonIndex.current === SLIDER_BUTTON.END) {
|
|
166
209
|
setEndTooltipVisible(true);
|
|
167
210
|
} else {
|
|
168
211
|
setFrontTooltipVisible(true);
|
|
169
212
|
}
|
|
170
213
|
};
|
|
171
|
-
const onTouchMove = e => {
|
|
172
|
-
if (disabled)
|
|
173
|
-
|
|
214
|
+
const onTouchMove = (e) => {
|
|
215
|
+
if (disabled)
|
|
216
|
+
return;
|
|
174
217
|
const currentX = e.touches[0].pageX;
|
|
175
|
-
// X轴滑动距离
|
|
176
218
|
const moveX = currentX - touchStartPageX.current;
|
|
177
|
-
// 计算下一个值
|
|
178
219
|
const posX = (touchStartLeft.current + moveX) / sliderRect.current.width * scope;
|
|
179
|
-
// 兼容一位小数
|
|
180
220
|
let nextPosition = step < 1 ? Math.round(posX * 10) / 10 : Math.round(posX);
|
|
181
|
-
if (nextPosition <= 0)
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
221
|
+
if (nextPosition <= 0)
|
|
222
|
+
nextPosition = 0;
|
|
223
|
+
if (nextPosition >= scope)
|
|
224
|
+
nextPosition = scope;
|
|
185
225
|
const nextValue = min + nextPosition;
|
|
186
226
|
const inStep = nextValue % step === 0;
|
|
187
|
-
|
|
188
|
-
// 滑动的最新值与上一次值不等时 & 符合当前步长,则更新sliderValue
|
|
189
|
-
if (!(0, _utils2.isSameValue)(nextValue, preValueRef.current) && inStep) {
|
|
227
|
+
if (!(0, import_utils2.isSameValue)(nextValue, preValueRef.current) && inStep) {
|
|
190
228
|
let latestValue = nextValue;
|
|
191
229
|
preValueRef.current = nextValue;
|
|
192
|
-
// 单滑块
|
|
193
230
|
tooltipRef.current = [latestValue, 0];
|
|
194
231
|
if (range) {
|
|
195
232
|
latestValue = [...beforeMoveValue.current];
|
|
196
233
|
if (disableSwap) {
|
|
197
|
-
// 滑动前按钮
|
|
198
234
|
if (buttonIndex.current === SLIDER_BUTTON.FRONT && nextValue >= latestValue[SLIDER_BUTTON.END]) {
|
|
199
235
|
latestValue[SLIDER_BUTTON.END] = nextValue;
|
|
200
236
|
} else {
|
|
201
237
|
latestValue[buttonIndex.current] = nextValue;
|
|
202
238
|
}
|
|
203
|
-
// 滑动后按钮
|
|
204
239
|
if (buttonIndex.current === SLIDER_BUTTON.END && nextValue <= latestValue[SLIDER_BUTTON.FRONT]) {
|
|
205
240
|
latestValue[SLIDER_BUTTON.FRONT] = nextValue;
|
|
206
241
|
} else {
|
|
@@ -209,73 +244,82 @@ const Slider = /*#__PURE__*/_react.default.forwardRef((props, ref) => {
|
|
|
209
244
|
tooltipRef.current = latestValue;
|
|
210
245
|
} else {
|
|
211
246
|
latestValue[buttonIndex.current] = nextValue;
|
|
212
|
-
// 气泡值不应sort排序
|
|
213
247
|
tooltipRef.current = latestValue;
|
|
214
|
-
latestValue = (0,
|
|
248
|
+
latestValue = (0, import_utils2.sortValue)(latestValue);
|
|
215
249
|
}
|
|
216
250
|
preValueRef.current = latestValue[buttonIndex.current];
|
|
217
251
|
}
|
|
218
|
-
latestVal.current = defaultValue !==
|
|
252
|
+
latestVal.current = defaultValue !== void 0 ? (0, import_utils2.formatValue)(latestValue) : latestValue;
|
|
219
253
|
triggerChange(e, latestVal.current);
|
|
220
254
|
}
|
|
221
255
|
};
|
|
222
256
|
const onTouchEnd = () => {
|
|
223
|
-
if (disabled)
|
|
224
|
-
|
|
257
|
+
if (disabled)
|
|
258
|
+
return;
|
|
225
259
|
tooltipRef.current = internalValue;
|
|
226
|
-
// 隐藏左右气泡提示
|
|
227
260
|
setFrontTooltipVisible(false);
|
|
228
261
|
setEndTooltipVisible(false);
|
|
229
262
|
};
|
|
230
|
-
const renderButton = index => {
|
|
263
|
+
const renderButton = (index) => {
|
|
231
264
|
const valuenow = internalValue[index];
|
|
232
|
-
return
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
265
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
266
|
+
"div",
|
|
267
|
+
{
|
|
268
|
+
key: index,
|
|
269
|
+
role: "slider",
|
|
270
|
+
className: (0, import_clsx.default)(classes.button, `${classes.button}-${index}`),
|
|
271
|
+
style: {
|
|
272
|
+
left: `${(valuenow - min) / scope * 100}%`
|
|
273
|
+
},
|
|
274
|
+
tabIndex: disabled ? -1 : 0,
|
|
275
|
+
"aria-valuemin": props.min,
|
|
276
|
+
"aria-valuenow": valuenow,
|
|
277
|
+
"aria-valuemax": props.max,
|
|
278
|
+
"aria-orientation": "horizontal",
|
|
279
|
+
onTouchStart: (event) => {
|
|
280
|
+
buttonIndex.current = index;
|
|
281
|
+
onTouchStart(event);
|
|
282
|
+
},
|
|
283
|
+
onTouchMove,
|
|
284
|
+
onTouchEnd,
|
|
285
|
+
onTouchCancel: onTouchEnd
|
|
238
286
|
},
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
"aria-valuenow": valuenow,
|
|
242
|
-
"aria-valuemax": props.max,
|
|
243
|
-
"aria-orientation": "horizontal",
|
|
244
|
-
onTouchStart: event => {
|
|
245
|
-
buttonIndex.current = index;
|
|
246
|
-
onTouchStart(event);
|
|
247
|
-
},
|
|
248
|
-
onTouchMove: onTouchMove,
|
|
249
|
-
onTouchEnd: onTouchEnd,
|
|
250
|
-
onTouchCancel: onTouchEnd
|
|
251
|
-
}, index === SLIDER_BUTTON.FRONT ? startIcon || defaultIcon : endIcon || defaultIcon);
|
|
287
|
+
index === SLIDER_BUTTON.FRONT ? startIcon || defaultIcon : endIcon || defaultIcon
|
|
288
|
+
);
|
|
252
289
|
};
|
|
253
|
-
return
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
className: `${classes.root}-
|
|
262
|
-
style: lineStyle
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
290
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
291
|
+
"div",
|
|
292
|
+
__spreadValues({
|
|
293
|
+
className: (0, import_clsx.default)(classes.root, className, {
|
|
294
|
+
[classes.disabled]: disabled
|
|
295
|
+
}),
|
|
296
|
+
ref: handleRef
|
|
297
|
+
}, others),
|
|
298
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: `${classes.root}-rail` }),
|
|
299
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: `${classes.root}-line`, style: lineStyle }),
|
|
300
|
+
renderButton(SLIDER_BUTTON.FRONT),
|
|
301
|
+
range && renderButton(SLIDER_BUTTON.END),
|
|
302
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
303
|
+
"div",
|
|
304
|
+
{
|
|
305
|
+
className: (0, import_clsx.default)(classes.tooltip, {
|
|
306
|
+
[`${classes.tooltip}-hidden`]: !tooltipVisible
|
|
307
|
+
}),
|
|
308
|
+
style: {
|
|
309
|
+
left: `${(tooltipRef.current[buttonIndex.current] - min) / scope * 100}%`
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
tooltipRender(tooltipRef.current[buttonIndex.current])
|
|
313
|
+
)
|
|
314
|
+
);
|
|
271
315
|
});
|
|
272
|
-
Slider.displayName =
|
|
316
|
+
Slider.displayName = "BuiSlider";
|
|
273
317
|
Slider.defaultProps = {
|
|
274
318
|
min: 0,
|
|
275
319
|
max: 100,
|
|
276
320
|
step: 1,
|
|
277
321
|
disableSwap: false,
|
|
278
322
|
tipVisible: false,
|
|
279
|
-
tooltipRender: value => value
|
|
323
|
+
tooltipRender: (value) => value
|
|
280
324
|
};
|
|
281
|
-
var
|
|
325
|
+
var Slider_default = Slider;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var Slider_types_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(Slider_types_exports);
|
package/dist/Slider/index.js
CHANGED
|
@@ -1,34 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
10
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
Object.defineProperty(exports, "default", {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () {
|
|
18
|
-
return _Slider.default;
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
16
|
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var Slider_exports = {};
|
|
30
|
+
__export(Slider_exports, {
|
|
31
|
+
Slider: () => import_Slider.default,
|
|
32
|
+
default: () => import_Slider.default
|
|
20
33
|
});
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function () {
|
|
30
|
-
return _Slider2[key];
|
|
31
|
-
}
|
|
32
|
-
});
|
|
34
|
+
module.exports = __toCommonJS(Slider_exports);
|
|
35
|
+
var import_Slider = __toESM(require("./Slider"));
|
|
36
|
+
__reExport(Slider_exports, require("./Slider.types"), module.exports);
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
Slider,
|
|
40
|
+
...require("./Slider.types")
|
|
33
41
|
});
|
|
34
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/dist/Slider/utils.js
CHANGED
|
@@ -1,30 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var utils_exports = {};
|
|
19
|
+
__export(utils_exports, {
|
|
20
|
+
formatValue: () => formatValue,
|
|
21
|
+
isSameValue: () => isSameValue,
|
|
22
|
+
sortValue: () => sortValue
|
|
5
23
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
const formatValue = value => {
|
|
12
|
-
if (value === undefined) return value;
|
|
24
|
+
module.exports = __toCommonJS(utils_exports);
|
|
25
|
+
const formatValue = (value) => {
|
|
26
|
+
if (value === void 0)
|
|
27
|
+
return value;
|
|
13
28
|
return Array.isArray(value) ? value : [value, 0];
|
|
14
29
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
exports.formatValue = formatValue;
|
|
20
|
-
const sortValue = v => {
|
|
21
|
-
if (!v) return v;
|
|
30
|
+
const sortValue = (v) => {
|
|
31
|
+
if (!v)
|
|
32
|
+
return v;
|
|
22
33
|
return v.slice().sort((a, b) => a - b);
|
|
23
34
|
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 是否为相同值
|
|
27
|
-
*/
|
|
28
|
-
exports.sortValue = sortValue;
|
|
29
35
|
const isSameValue = (newValue, oldValue) => JSON.stringify(newValue) === JSON.stringify(oldValue);
|
|
30
|
-
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
formatValue,
|
|
39
|
+
isSameValue,
|
|
40
|
+
sortValue
|
|
41
|
+
});
|
package/dist/Stack/Stack.css
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
align-items: var(--align-items);
|
|
4
4
|
justify-content: var(--justify-content);
|
|
5
5
|
flex-direction: var(--flex-direction);
|
|
6
|
-
/* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
|
|
7
6
|
flex-wrap: var(--flex-wrap);
|
|
8
7
|
row-gap: var(--spacing);
|
|
9
8
|
column-gap: var(--spacing);
|