@bifrostui/react 0.0.5
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/LICENSE +21 -0
- package/README.md +13 -0
- package/dist/ActionSheet/ActionSheet.css +27 -0
- package/dist/ActionSheet/ActionSheet.d.ts +5 -0
- package/dist/ActionSheet/ActionSheet.js +66 -0
- package/dist/ActionSheet/ActionSheet.types.d.ts +28 -0
- package/dist/ActionSheet/ActionSheet.types.js +5 -0
- package/dist/ActionSheet/ActionSheetContext.d.ts +4 -0
- package/dist/ActionSheet/ActionSheetContext.js +11 -0
- package/dist/ActionSheet/ActionSheetItem.css +51 -0
- package/dist/ActionSheet/ActionSheetItem.d.ts +5 -0
- package/dist/ActionSheet/ActionSheetItem.js +58 -0
- package/dist/ActionSheet/ActionSheetItem.types.d.ts +38 -0
- package/dist/ActionSheet/ActionSheetItem.types.js +5 -0
- package/dist/ActionSheet/index.d.ts +4 -0
- package/dist/ActionSheet/index.js +54 -0
- package/dist/Alert/Alert.d.ts +5 -0
- package/dist/Alert/Alert.js +115 -0
- package/dist/Alert/Alert.types.d.ts +61 -0
- package/dist/Alert/Alert.types.js +5 -0
- package/dist/Alert/index.css +89 -0
- package/dist/Alert/index.d.ts +4 -0
- package/dist/Alert/index.js +34 -0
- package/dist/Avatar/Avatar.css +43 -0
- package/dist/Avatar/Avatar.d.ts +5 -0
- package/dist/Avatar/Avatar.js +59 -0
- package/dist/Avatar/Avatar.types.d.ts +46 -0
- package/dist/Avatar/Avatar.types.js +5 -0
- package/dist/Avatar/AvatarGroup.css +31 -0
- package/dist/Avatar/AvatarGroup.d.ts +5 -0
- package/dist/Avatar/AvatarGroup.js +69 -0
- package/dist/Avatar/AvatarGroup.types.d.ts +27 -0
- package/dist/Avatar/AvatarGroup.types.js +5 -0
- package/dist/Avatar/index.d.ts +6 -0
- package/dist/Avatar/index.js +54 -0
- package/dist/Backdrop/Backdrop.css +14 -0
- package/dist/Backdrop/Backdrop.d.ts +5 -0
- package/dist/Backdrop/Backdrop.js +34 -0
- package/dist/Backdrop/Backdrop.types.d.ts +17 -0
- package/dist/Backdrop/Backdrop.types.js +5 -0
- package/dist/Backdrop/index.d.ts +2 -0
- package/dist/Backdrop/index.js +34 -0
- package/dist/Badge/Badge.css +95 -0
- package/dist/Badge/Badge.d.ts +5 -0
- package/dist/Badge/Badge.js +42 -0
- package/dist/Badge/Badge.types.d.ts +27 -0
- package/dist/Badge/Badge.types.js +5 -0
- package/dist/Badge/index.d.ts +2 -0
- package/dist/Badge/index.js +34 -0
- package/dist/Button/Button.css +200 -0
- package/dist/Button/Button.d.ts +5 -0
- package/dist/Button/Button.js +53 -0
- package/dist/Button/Button.types.d.ts +52 -0
- package/dist/Button/Button.types.js +5 -0
- package/dist/Button/index.d.ts +2 -0
- package/dist/Button/index.js +34 -0
- package/dist/Calendar/Calendar.css +105 -0
- package/dist/Calendar/Calendar.d.ts +5 -0
- package/dist/Calendar/Calendar.js +275 -0
- package/dist/Calendar/Calendar.types.d.ts +76 -0
- package/dist/Calendar/Calendar.types.js +5 -0
- package/dist/Calendar/index.d.ts +2 -0
- package/dist/Calendar/index.js +34 -0
- package/dist/Calendar/utils.d.ts +25 -0
- package/dist/Calendar/utils.js +77 -0
- package/dist/Card/Card.css +9 -0
- package/dist/Card/Card.d.ts +5 -0
- package/dist/Card/Card.js +27 -0
- package/dist/Card/Card.types.d.ts +6 -0
- package/dist/Card/Card.types.js +5 -0
- package/dist/Card/CardContent.css +6 -0
- package/dist/Card/CardContent.d.ts +5 -0
- package/dist/Card/CardContent.js +25 -0
- package/dist/Card/CardContent.types.d.ts +6 -0
- package/dist/Card/CardContent.types.js +5 -0
- package/dist/Card/CardFooter.css +8 -0
- package/dist/Card/CardFooter.d.ts +5 -0
- package/dist/Card/CardFooter.js +25 -0
- package/dist/Card/CardFooter.types.d.ts +6 -0
- package/dist/Card/CardFooter.types.js +5 -0
- package/dist/Card/CardHeader.css +45 -0
- package/dist/Card/CardHeader.d.ts +5 -0
- package/dist/Card/CardHeader.js +59 -0
- package/dist/Card/CardHeader.types.d.ts +23 -0
- package/dist/Card/CardHeader.types.js +5 -0
- package/dist/Card/index.d.ts +10 -0
- package/dist/Card/index.js +94 -0
- package/dist/Checkbox/Checkbox.css +45 -0
- package/dist/Checkbox/Checkbox.d.ts +5 -0
- package/dist/Checkbox/Checkbox.js +101 -0
- package/dist/Checkbox/Checkbox.types.d.ts +84 -0
- package/dist/Checkbox/Checkbox.types.js +5 -0
- package/dist/Checkbox/CheckboxContext.d.ts +5 -0
- package/dist/Checkbox/CheckboxContext.js +11 -0
- package/dist/Checkbox/CheckboxGroup.d.ts +5 -0
- package/dist/Checkbox/CheckboxGroup.js +57 -0
- package/dist/Checkbox/index.d.ts +3 -0
- package/dist/Checkbox/index.js +42 -0
- package/dist/Countdown/Countdown.css +28 -0
- package/dist/Countdown/Countdown.d.ts +5 -0
- package/dist/Countdown/Countdown.js +103 -0
- package/dist/Countdown/Countdown.types.d.ts +123 -0
- package/dist/Countdown/Countdown.types.js +5 -0
- package/dist/Countdown/index.d.ts +3 -0
- package/dist/Countdown/index.js +46 -0
- package/dist/Countdown/useCountdown.d.ts +10 -0
- package/dist/Countdown/useCountdown.js +47 -0
- package/dist/Countdown/utils.d.ts +9 -0
- package/dist/Countdown/utils.js +124 -0
- package/dist/Divider/Divider.css +41 -0
- package/dist/Divider/Divider.d.ts +5 -0
- package/dist/Divider/Divider.js +64 -0
- package/dist/Divider/Divider.types.d.ts +19 -0
- package/dist/Divider/Divider.types.js +5 -0
- package/dist/Divider/index.d.ts +2 -0
- package/dist/Divider/index.js +34 -0
- package/dist/Drawer/Drawer.css +35 -0
- package/dist/Drawer/Drawer.d.ts +5 -0
- package/dist/Drawer/Drawer.js +66 -0
- package/dist/Drawer/Drawer.types.d.ts +51 -0
- package/dist/Drawer/Drawer.types.js +5 -0
- package/dist/Drawer/index.d.ts +2 -0
- package/dist/Drawer/index.js +34 -0
- package/dist/Fade/Fade.d.ts +4 -0
- package/dist/Fade/Fade.js +72 -0
- package/dist/Fade/Fade.types.d.ts +9 -0
- package/dist/Fade/Fade.types.js +5 -0
- package/dist/Fade/index.d.ts +3 -0
- package/dist/Fade/index.js +34 -0
- package/dist/IconButton/IconButton.css +130 -0
- package/dist/IconButton/IconButton.d.ts +5 -0
- package/dist/IconButton/IconButton.js +50 -0
- package/dist/IconButton/IconButton.types.d.ts +41 -0
- package/dist/IconButton/IconButton.types.js +5 -0
- package/dist/IconButton/index.d.ts +2 -0
- package/dist/IconButton/index.js +34 -0
- package/dist/Image/Image.d.ts +5 -0
- package/dist/Image/Image.js +123 -0
- package/dist/Image/Image.types.d.ts +48 -0
- package/dist/Image/Image.types.js +5 -0
- package/dist/Image/index.css +35 -0
- package/dist/Image/index.d.ts +3 -0
- package/dist/Image/index.js +34 -0
- package/dist/Input/Input.css +59 -0
- package/dist/Input/Input.d.ts +5 -0
- package/dist/Input/Input.js +115 -0
- package/dist/Input/Input.types.d.ts +70 -0
- package/dist/Input/Input.types.js +5 -0
- package/dist/Input/index.d.ts +2 -0
- package/dist/Input/index.js +34 -0
- package/dist/List/List.css +9 -0
- package/dist/List/List.d.ts +5 -0
- package/dist/List/List.js +43 -0
- package/dist/List/List.types.d.ts +22 -0
- package/dist/List/List.types.js +5 -0
- package/dist/List/ListContext.d.ts +7 -0
- package/dist/List/ListContext.js +12 -0
- package/dist/List/ListItem.css +23 -0
- package/dist/List/ListItem.d.ts +5 -0
- package/dist/List/ListItem.js +57 -0
- package/dist/List/ListItem.types.d.ts +20 -0
- package/dist/List/ListItem.types.js +5 -0
- package/dist/List/ListItemContent.css +18 -0
- package/dist/List/ListItemContent.d.ts +5 -0
- package/dist/List/ListItemContent.js +37 -0
- package/dist/List/ListItemContent.types.d.ts +16 -0
- package/dist/List/ListItemContent.types.js +5 -0
- package/dist/List/ListItemExtra.css +7 -0
- package/dist/List/ListItemExtra.d.ts +5 -0
- package/dist/List/ListItemExtra.js +29 -0
- package/dist/List/ListItemExtra.types.d.ts +8 -0
- package/dist/List/ListItemExtra.types.js +5 -0
- package/dist/List/ListItemFooter.css +9 -0
- package/dist/List/ListItemFooter.d.ts +5 -0
- package/dist/List/ListItemFooter.js +29 -0
- package/dist/List/ListItemFooter.types.d.ts +8 -0
- package/dist/List/ListItemFooter.types.js +5 -0
- package/dist/List/ListItemHeader.css +7 -0
- package/dist/List/ListItemHeader.d.ts +5 -0
- package/dist/List/ListItemHeader.js +29 -0
- package/dist/List/ListItemHeader.types.d.ts +8 -0
- package/dist/List/ListItemHeader.types.js +5 -0
- package/dist/List/index.d.ts +13 -0
- package/dist/List/index.js +134 -0
- package/dist/Loading/Loading.css +31 -0
- package/dist/Loading/Loading.d.ts +5 -0
- package/dist/Loading/Loading.js +39 -0
- package/dist/Loading/Loading.types.d.ts +20 -0
- package/dist/Loading/Loading.types.js +5 -0
- package/dist/Loading/index.d.ts +2 -0
- package/dist/Loading/index.js +34 -0
- package/dist/Modal/Modal.css +15 -0
- package/dist/Modal/Modal.d.ts +5 -0
- package/dist/Modal/Modal.js +89 -0
- package/dist/Modal/Modal.types.d.ts +20 -0
- package/dist/Modal/Modal.types.js +5 -0
- package/dist/Modal/index.d.ts +3 -0
- package/dist/Modal/index.js +34 -0
- package/dist/NavBar/NavBar.css +57 -0
- package/dist/NavBar/NavBar.d.ts +5 -0
- package/dist/NavBar/NavBar.js +87 -0
- package/dist/NavBar/NavBar.types.d.ts +44 -0
- package/dist/NavBar/NavBar.types.js +5 -0
- package/dist/NavBar/index.d.ts +2 -0
- package/dist/NavBar/index.js +34 -0
- package/dist/Portal/Portal.d.ts +4 -0
- package/dist/Portal/Portal.js +18 -0
- package/dist/Portal/Portal.miniapp.d.ts +4 -0
- package/dist/Portal/Portal.miniapp.js +44 -0
- package/dist/Portal/Portal.types.d.ts +22 -0
- package/dist/Portal/Portal.types.js +5 -0
- package/dist/Portal/PortalCore.d.ts +8 -0
- package/dist/Portal/PortalCore.js +57 -0
- package/dist/Portal/index.d.ts +3 -0
- package/dist/Portal/index.js +34 -0
- package/dist/Progress/Progress.css +22 -0
- package/dist/Progress/Progress.d.ts +8 -0
- package/dist/Progress/Progress.js +89 -0
- package/dist/Progress/Progress.types.d.ts +28 -0
- package/dist/Progress/Progress.types.js +5 -0
- package/dist/Progress/index.d.ts +3 -0
- package/dist/Progress/index.js +34 -0
- package/dist/Radio/Radio.css +65 -0
- package/dist/Radio/Radio.d.ts +5 -0
- package/dist/Radio/Radio.js +120 -0
- package/dist/Radio/Radio.types.d.ts +83 -0
- package/dist/Radio/Radio.types.js +5 -0
- package/dist/Radio/RadioButtonIcon.d.ts +12 -0
- package/dist/Radio/RadioButtonIcon.js +38 -0
- package/dist/Radio/RadioContext.d.ts +5 -0
- package/dist/Radio/RadioContext.js +11 -0
- package/dist/Radio/RadioGroup.d.ts +5 -0
- package/dist/Radio/RadioGroup.js +51 -0
- package/dist/Radio/index.d.ts +3 -0
- package/dist/Radio/index.js +42 -0
- package/dist/Rating/Rating.css +52 -0
- package/dist/Rating/Rating.d.ts +5 -0
- package/dist/Rating/Rating.js +100 -0
- package/dist/Rating/Rating.types.d.ts +66 -0
- package/dist/Rating/Rating.types.js +5 -0
- package/dist/Rating/index.d.ts +2 -0
- package/dist/Rating/index.js +34 -0
- package/dist/ScrollView/ScrollView.css +19 -0
- package/dist/ScrollView/ScrollView.d.ts +5 -0
- package/dist/ScrollView/ScrollView.js +204 -0
- package/dist/ScrollView/ScrollView.types.d.ts +258 -0
- package/dist/ScrollView/ScrollView.types.js +5 -0
- package/dist/ScrollView/index.d.ts +3 -0
- package/dist/ScrollView/index.js +34 -0
- package/dist/ScrollView/index.miniapp.d.ts +3 -0
- package/dist/ScrollView/index.miniapp.js +14 -0
- package/dist/Select/Select.css +89 -0
- package/dist/Select/Select.d.ts +5 -0
- package/dist/Select/Select.js +159 -0
- package/dist/Select/Select.types.d.ts +98 -0
- package/dist/Select/Select.types.js +5 -0
- package/dist/Select/SelectOption.d.ts +5 -0
- package/dist/Select/SelectOption.js +51 -0
- package/dist/Select/index.d.ts +4 -0
- package/dist/Select/index.js +42 -0
- package/dist/Select/selectContext.d.ts +4 -0
- package/dist/Select/selectContext.js +11 -0
- package/dist/Skeleton/Skeleton.css +54 -0
- package/dist/Skeleton/Skeleton.d.ts +5 -0
- package/dist/Skeleton/Skeleton.js +42 -0
- package/dist/Skeleton/Skeleton.types.d.ts +33 -0
- package/dist/Skeleton/Skeleton.types.js +5 -0
- package/dist/Skeleton/index.d.ts +3 -0
- package/dist/Skeleton/index.js +34 -0
- package/dist/Slide/Slide.d.ts +4 -0
- package/dist/Slide/Slide.js +88 -0
- package/dist/Slide/Slide.types.d.ts +14 -0
- package/dist/Slide/Slide.types.js +5 -0
- package/dist/Slide/index.d.ts +3 -0
- package/dist/Slide/index.js +34 -0
- package/dist/Slider/Slider.css +95 -0
- package/dist/Slider/Slider.d.ts +5 -0
- package/dist/Slider/Slider.js +281 -0
- package/dist/Slider/Slider.types.d.ts +62 -0
- package/dist/Slider/Slider.types.js +5 -0
- package/dist/Slider/index.d.ts +2 -0
- package/dist/Slider/index.js +34 -0
- package/dist/Slider/utils.d.ts +14 -0
- package/dist/Slider/utils.js +30 -0
- package/dist/Stack/Stack.css +11 -0
- package/dist/Stack/Stack.d.ts +5 -0
- package/dist/Stack/Stack.js +53 -0
- package/dist/Stack/Stack.types.d.ts +35 -0
- package/dist/Stack/Stack.types.js +5 -0
- package/dist/Stack/demo/StackDemo.d.ts +4 -0
- package/dist/Stack/demo/StackDemo.js +126 -0
- package/dist/Stack/demo/index.css +23 -0
- package/dist/Stack/index.d.ts +3 -0
- package/dist/Stack/index.js +34 -0
- package/dist/Steps/Step.css +174 -0
- package/dist/Steps/Step.d.ts +5 -0
- package/dist/Steps/Step.js +107 -0
- package/dist/Steps/Step.types.d.ts +35 -0
- package/dist/Steps/Step.types.js +5 -0
- package/dist/Steps/Steps.css +14 -0
- package/dist/Steps/Steps.d.ts +5 -0
- package/dist/Steps/Steps.js +65 -0
- package/dist/Steps/Steps.types.d.ts +35 -0
- package/dist/Steps/Steps.types.js +5 -0
- package/dist/Steps/StepsContext.d.ts +5 -0
- package/dist/Steps/StepsContext.js +11 -0
- package/dist/Steps/index.d.ts +4 -0
- package/dist/Steps/index.js +54 -0
- package/dist/Swiper/Swiper.css +20 -0
- package/dist/Swiper/Swiper.d.ts +10 -0
- package/dist/Swiper/Swiper.js +109 -0
- package/dist/Swiper/Swiper.types.d.ts +173 -0
- package/dist/Swiper/Swiper.types.js +5 -0
- package/dist/Swiper/SwiperItem.d.ts +7 -0
- package/dist/Swiper/SwiperItem.js +30 -0
- package/dist/Swiper/index.d.ts +3 -0
- package/dist/Swiper/index.js +42 -0
- package/dist/Swiper/index.miniapp.d.ts +8 -0
- package/dist/Swiper/index.miniapp.js +23 -0
- package/dist/Switch/Switch.css +127 -0
- package/dist/Switch/Switch.d.ts +5 -0
- package/dist/Switch/Switch.js +73 -0
- package/dist/Switch/Switch.types.d.ts +56 -0
- package/dist/Switch/Switch.types.js +5 -0
- package/dist/Switch/index.d.ts +3 -0
- package/dist/Switch/index.js +34 -0
- package/dist/TabBar/TabBar.css +8 -0
- package/dist/TabBar/TabBar.d.ts +5 -0
- package/dist/TabBar/TabBar.js +47 -0
- package/dist/TabBar/TabBarContext.d.ts +27 -0
- package/dist/TabBar/TabBarContext.js +9 -0
- package/dist/TabBar/TabBarItem.css +38 -0
- package/dist/TabBar/TabBarItem.d.ts +5 -0
- package/dist/TabBar/TabBarItem.js +62 -0
- package/dist/TabBar/index.d.ts +4 -0
- package/dist/TabBar/index.js +36 -0
- package/dist/TabBar/index.types.d.ts +54 -0
- package/dist/TabBar/index.types.js +5 -0
- package/dist/Tabs/Tab.css +52 -0
- package/dist/Tabs/Tab.d.ts +5 -0
- package/dist/Tabs/Tab.js +58 -0
- package/dist/Tabs/Tab.types.d.ts +12 -0
- package/dist/Tabs/Tab.types.js +5 -0
- package/dist/Tabs/TabPanel.css +9 -0
- package/dist/Tabs/TabPanel.d.ts +5 -0
- package/dist/Tabs/TabPanel.js +37 -0
- package/dist/Tabs/TabPanel.types.d.ts +19 -0
- package/dist/Tabs/TabPanel.types.js +5 -0
- package/dist/Tabs/Tabs.css +56 -0
- package/dist/Tabs/Tabs.d.ts +5 -0
- package/dist/Tabs/Tabs.js +193 -0
- package/dist/Tabs/Tabs.types.d.ts +45 -0
- package/dist/Tabs/Tabs.types.js +5 -0
- package/dist/Tabs/TabsContext.d.ts +9 -0
- package/dist/Tabs/TabsContext.js +14 -0
- package/dist/Tabs/index.d.ts +6 -0
- package/dist/Tabs/index.js +74 -0
- package/dist/Tabs/utils/bound.d.ts +1 -0
- package/dist/Tabs/utils/bound.js +16 -0
- package/dist/Tag/Tag.css +97 -0
- package/dist/Tag/Tag.d.ts +5 -0
- package/dist/Tag/Tag.js +80 -0
- package/dist/Tag/Tag.types.d.ts +23 -0
- package/dist/Tag/Tag.types.js +5 -0
- package/dist/Tag/TagGroup.css +16 -0
- package/dist/Tag/TagGroup.d.ts +5 -0
- package/dist/Tag/TagGroup.js +27 -0
- package/dist/Tag/TagGroup.types.d.ts +6 -0
- package/dist/Tag/TagGroup.types.js +5 -0
- package/dist/Tag/index.d.ts +5 -0
- package/dist/Tag/index.js +48 -0
- package/dist/TextArea/TextArea.css +43 -0
- package/dist/TextArea/TextArea.d.ts +5 -0
- package/dist/TextArea/TextArea.js +149 -0
- package/dist/TextArea/TextArea.types.d.ts +70 -0
- package/dist/TextArea/TextArea.types.js +5 -0
- package/dist/TextArea/index.d.ts +2 -0
- package/dist/TextArea/index.js +34 -0
- package/dist/Transition/Transition.d.ts +4 -0
- package/dist/Transition/Transition.js +19 -0
- package/dist/Transition/Transition.miniapp.d.ts +4 -0
- package/dist/Transition/Transition.miniapp.js +19 -0
- package/dist/Transition/Transition.types.d.ts +100 -0
- package/dist/Transition/Transition.types.js +5 -0
- package/dist/Transition/TransitionCore.d.ts +4 -0
- package/dist/Transition/TransitionCore.js +180 -0
- package/dist/Transition/index.d.ts +3 -0
- package/dist/Transition/index.js +34 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +423 -0
- package/es/ActionSheet/ActionSheet.css +27 -0
- package/es/ActionSheet/ActionSheet.d.ts +5 -0
- package/es/ActionSheet/ActionSheet.js +59 -0
- package/es/ActionSheet/ActionSheet.types.d.ts +28 -0
- package/es/ActionSheet/ActionSheet.types.js +1 -0
- package/es/ActionSheet/ActionSheetContext.d.ts +4 -0
- package/es/ActionSheet/ActionSheetContext.js +4 -0
- package/es/ActionSheet/ActionSheetItem.css +51 -0
- package/es/ActionSheet/ActionSheetItem.d.ts +5 -0
- package/es/ActionSheet/ActionSheetItem.js +51 -0
- package/es/ActionSheet/ActionSheetItem.types.d.ts +38 -0
- package/es/ActionSheet/ActionSheetItem.types.js +1 -0
- package/es/ActionSheet/index.d.ts +4 -0
- package/es/ActionSheet/index.js +4 -0
- package/es/Alert/Alert.d.ts +5 -0
- package/es/Alert/Alert.js +110 -0
- package/es/Alert/Alert.types.d.ts +61 -0
- package/es/Alert/Alert.types.js +1 -0
- package/es/Alert/index.css +89 -0
- package/es/Alert/index.d.ts +4 -0
- package/es/Alert/index.js +4 -0
- package/es/Avatar/Avatar.css +43 -0
- package/es/Avatar/Avatar.d.ts +5 -0
- package/es/Avatar/Avatar.js +55 -0
- package/es/Avatar/Avatar.types.d.ts +46 -0
- package/es/Avatar/Avatar.types.js +1 -0
- package/es/Avatar/AvatarGroup.css +31 -0
- package/es/Avatar/AvatarGroup.d.ts +5 -0
- package/es/Avatar/AvatarGroup.js +65 -0
- package/es/Avatar/AvatarGroup.types.d.ts +27 -0
- package/es/Avatar/AvatarGroup.types.js +1 -0
- package/es/Avatar/index.d.ts +6 -0
- package/es/Avatar/index.js +6 -0
- package/es/Backdrop/Backdrop.css +14 -0
- package/es/Backdrop/Backdrop.d.ts +5 -0
- package/es/Backdrop/Backdrop.js +30 -0
- package/es/Backdrop/Backdrop.types.d.ts +17 -0
- package/es/Backdrop/Backdrop.types.js +1 -0
- package/es/Backdrop/index.d.ts +2 -0
- package/es/Backdrop/index.js +2 -0
- package/es/Badge/Badge.css +95 -0
- package/es/Badge/Badge.d.ts +5 -0
- package/es/Badge/Badge.js +38 -0
- package/es/Badge/Badge.types.d.ts +27 -0
- package/es/Badge/Badge.types.js +1 -0
- package/es/Badge/index.d.ts +2 -0
- package/es/Badge/index.js +2 -0
- package/es/Button/Button.css +200 -0
- package/es/Button/Button.d.ts +5 -0
- package/es/Button/Button.js +47 -0
- package/es/Button/Button.types.d.ts +52 -0
- package/es/Button/Button.types.js +1 -0
- package/es/Button/index.d.ts +2 -0
- package/es/Button/index.js +2 -0
- package/es/Calendar/Calendar.css +105 -0
- package/es/Calendar/Calendar.d.ts +5 -0
- package/es/Calendar/Calendar.js +286 -0
- package/es/Calendar/Calendar.types.d.ts +76 -0
- package/es/Calendar/Calendar.types.js +1 -0
- package/es/Calendar/index.d.ts +2 -0
- package/es/Calendar/index.js +2 -0
- package/es/Calendar/utils.d.ts +25 -0
- package/es/Calendar/utils.js +66 -0
- package/es/Card/Card.css +9 -0
- package/es/Card/Card.d.ts +5 -0
- package/es/Card/Card.js +21 -0
- package/es/Card/Card.types.d.ts +6 -0
- package/es/Card/Card.types.js +1 -0
- package/es/Card/CardContent.css +6 -0
- package/es/Card/CardContent.d.ts +5 -0
- package/es/Card/CardContent.js +19 -0
- package/es/Card/CardContent.types.d.ts +6 -0
- package/es/Card/CardContent.types.js +1 -0
- package/es/Card/CardFooter.css +8 -0
- package/es/Card/CardFooter.d.ts +5 -0
- package/es/Card/CardFooter.js +19 -0
- package/es/Card/CardFooter.types.d.ts +6 -0
- package/es/Card/CardFooter.types.js +1 -0
- package/es/Card/CardHeader.css +45 -0
- package/es/Card/CardHeader.d.ts +5 -0
- package/es/Card/CardHeader.js +53 -0
- package/es/Card/CardHeader.types.d.ts +23 -0
- package/es/Card/CardHeader.types.js +1 -0
- package/es/Card/index.d.ts +10 -0
- package/es/Card/index.js +10 -0
- package/es/Checkbox/Checkbox.css +45 -0
- package/es/Checkbox/Checkbox.d.ts +5 -0
- package/es/Checkbox/Checkbox.js +108 -0
- package/es/Checkbox/Checkbox.types.d.ts +84 -0
- package/es/Checkbox/Checkbox.types.js +1 -0
- package/es/Checkbox/CheckboxContext.d.ts +5 -0
- package/es/Checkbox/CheckboxContext.js +4 -0
- package/es/Checkbox/CheckboxGroup.d.ts +5 -0
- package/es/Checkbox/CheckboxGroup.js +64 -0
- package/es/Checkbox/index.d.ts +3 -0
- package/es/Checkbox/index.js +3 -0
- package/es/Countdown/Countdown.css +28 -0
- package/es/Countdown/Countdown.d.ts +5 -0
- package/es/Countdown/Countdown.js +109 -0
- package/es/Countdown/Countdown.types.d.ts +123 -0
- package/es/Countdown/Countdown.types.js +1 -0
- package/es/Countdown/index.d.ts +3 -0
- package/es/Countdown/index.js +3 -0
- package/es/Countdown/useCountdown.d.ts +10 -0
- package/es/Countdown/useCountdown.js +55 -0
- package/es/Countdown/utils.d.ts +9 -0
- package/es/Countdown/utils.js +126 -0
- package/es/Divider/Divider.css +41 -0
- package/es/Divider/Divider.d.ts +5 -0
- package/es/Divider/Divider.js +52 -0
- package/es/Divider/Divider.types.d.ts +19 -0
- package/es/Divider/Divider.types.js +1 -0
- package/es/Divider/index.d.ts +2 -0
- package/es/Divider/index.js +2 -0
- package/es/Drawer/Drawer.css +35 -0
- package/es/Drawer/Drawer.d.ts +5 -0
- package/es/Drawer/Drawer.js +71 -0
- package/es/Drawer/Drawer.types.d.ts +51 -0
- package/es/Drawer/Drawer.types.js +1 -0
- package/es/Drawer/index.d.ts +2 -0
- package/es/Drawer/index.js +2 -0
- package/es/Fade/Fade.d.ts +4 -0
- package/es/Fade/Fade.js +70 -0
- package/es/Fade/Fade.types.d.ts +9 -0
- package/es/Fade/Fade.types.js +1 -0
- package/es/Fade/index.d.ts +3 -0
- package/es/Fade/index.js +3 -0
- package/es/IconButton/IconButton.css +130 -0
- package/es/IconButton/IconButton.d.ts +5 -0
- package/es/IconButton/IconButton.js +45 -0
- package/es/IconButton/IconButton.types.d.ts +41 -0
- package/es/IconButton/IconButton.types.js +1 -0
- package/es/IconButton/index.d.ts +2 -0
- package/es/IconButton/index.js +2 -0
- package/es/Image/Image.d.ts +5 -0
- package/es/Image/Image.js +131 -0
- package/es/Image/Image.types.d.ts +48 -0
- package/es/Image/Image.types.js +1 -0
- package/es/Image/index.css +35 -0
- package/es/Image/index.d.ts +3 -0
- package/es/Image/index.js +3 -0
- package/es/Input/Input.css +59 -0
- package/es/Input/Input.d.ts +5 -0
- package/es/Input/Input.js +125 -0
- package/es/Input/Input.types.d.ts +70 -0
- package/es/Input/Input.types.js +1 -0
- package/es/Input/index.d.ts +2 -0
- package/es/Input/index.js +2 -0
- package/es/List/List.css +9 -0
- package/es/List/List.d.ts +5 -0
- package/es/List/List.js +37 -0
- package/es/List/List.types.d.ts +22 -0
- package/es/List/List.types.js +1 -0
- package/es/List/ListContext.d.ts +7 -0
- package/es/List/ListContext.js +5 -0
- package/es/List/ListItem.css +23 -0
- package/es/List/ListItem.d.ts +5 -0
- package/es/List/ListItem.js +52 -0
- package/es/List/ListItem.types.d.ts +20 -0
- package/es/List/ListItem.types.js +1 -0
- package/es/List/ListItemContent.css +18 -0
- package/es/List/ListItemContent.d.ts +5 -0
- package/es/List/ListItemContent.js +31 -0
- package/es/List/ListItemContent.types.d.ts +16 -0
- package/es/List/ListItemContent.types.js +1 -0
- package/es/List/ListItemExtra.css +7 -0
- package/es/List/ListItemExtra.d.ts +5 -0
- package/es/List/ListItemExtra.js +23 -0
- package/es/List/ListItemExtra.types.d.ts +8 -0
- package/es/List/ListItemExtra.types.js +1 -0
- package/es/List/ListItemFooter.css +9 -0
- package/es/List/ListItemFooter.d.ts +5 -0
- package/es/List/ListItemFooter.js +23 -0
- package/es/List/ListItemFooter.types.d.ts +8 -0
- package/es/List/ListItemFooter.types.js +1 -0
- package/es/List/ListItemHeader.css +7 -0
- package/es/List/ListItemHeader.d.ts +5 -0
- package/es/List/ListItemHeader.js +23 -0
- package/es/List/ListItemHeader.types.d.ts +8 -0
- package/es/List/ListItemHeader.types.js +1 -0
- package/es/List/index.d.ts +13 -0
- package/es/List/index.js +13 -0
- package/es/Loading/Loading.css +31 -0
- package/es/Loading/Loading.d.ts +5 -0
- package/es/Loading/Loading.js +33 -0
- package/es/Loading/Loading.types.d.ts +20 -0
- package/es/Loading/Loading.types.js +1 -0
- package/es/Loading/index.d.ts +2 -0
- package/es/Loading/index.js +2 -0
- package/es/Modal/Modal.css +15 -0
- package/es/Modal/Modal.d.ts +5 -0
- package/es/Modal/Modal.js +95 -0
- package/es/Modal/Modal.types.d.ts +20 -0
- package/es/Modal/Modal.types.js +1 -0
- package/es/Modal/index.d.ts +3 -0
- package/es/Modal/index.js +3 -0
- package/es/NavBar/NavBar.css +57 -0
- package/es/NavBar/NavBar.d.ts +5 -0
- package/es/NavBar/NavBar.js +82 -0
- package/es/NavBar/NavBar.types.d.ts +44 -0
- package/es/NavBar/NavBar.types.js +1 -0
- package/es/NavBar/index.d.ts +2 -0
- package/es/NavBar/index.js +2 -0
- package/es/Portal/Portal.d.ts +4 -0
- package/es/Portal/Portal.js +11 -0
- package/es/Portal/Portal.miniapp.d.ts +4 -0
- package/es/Portal/Portal.miniapp.js +33 -0
- package/es/Portal/Portal.types.d.ts +22 -0
- package/es/Portal/Portal.types.js +1 -0
- package/es/Portal/PortalCore.d.ts +8 -0
- package/es/Portal/PortalCore.js +57 -0
- package/es/Portal/index.d.ts +3 -0
- package/es/Portal/index.js +3 -0
- package/es/Progress/Progress.css +22 -0
- package/es/Progress/Progress.d.ts +8 -0
- package/es/Progress/Progress.js +90 -0
- package/es/Progress/Progress.types.d.ts +28 -0
- package/es/Progress/Progress.types.js +1 -0
- package/es/Progress/index.d.ts +3 -0
- package/es/Progress/index.js +3 -0
- package/es/Radio/Radio.css +65 -0
- package/es/Radio/Radio.d.ts +5 -0
- package/es/Radio/Radio.js +126 -0
- package/es/Radio/Radio.types.d.ts +83 -0
- package/es/Radio/Radio.types.js +1 -0
- package/es/Radio/RadioButtonIcon.d.ts +12 -0
- package/es/Radio/RadioButtonIcon.js +33 -0
- package/es/Radio/RadioContext.d.ts +5 -0
- package/es/Radio/RadioContext.js +4 -0
- package/es/Radio/RadioGroup.d.ts +5 -0
- package/es/Radio/RadioGroup.js +52 -0
- package/es/Radio/index.d.ts +3 -0
- package/es/Radio/index.js +3 -0
- package/es/Rating/Rating.css +52 -0
- package/es/Rating/Rating.d.ts +5 -0
- package/es/Rating/Rating.js +107 -0
- package/es/Rating/Rating.types.d.ts +66 -0
- package/es/Rating/Rating.types.js +1 -0
- package/es/Rating/index.d.ts +2 -0
- package/es/Rating/index.js +2 -0
- package/es/ScrollView/ScrollView.css +19 -0
- package/es/ScrollView/ScrollView.d.ts +5 -0
- package/es/ScrollView/ScrollView.js +204 -0
- package/es/ScrollView/ScrollView.types.d.ts +258 -0
- package/es/ScrollView/ScrollView.types.js +1 -0
- package/es/ScrollView/index.d.ts +3 -0
- package/es/ScrollView/index.js +3 -0
- package/es/ScrollView/index.miniapp.d.ts +3 -0
- package/es/ScrollView/index.miniapp.js +3 -0
- package/es/Select/Select.css +89 -0
- package/es/Select/Select.d.ts +5 -0
- package/es/Select/Select.js +165 -0
- package/es/Select/Select.types.d.ts +98 -0
- package/es/Select/Select.types.js +1 -0
- package/es/Select/SelectOption.d.ts +5 -0
- package/es/Select/SelectOption.js +43 -0
- package/es/Select/index.d.ts +4 -0
- package/es/Select/index.js +4 -0
- package/es/Select/selectContext.d.ts +4 -0
- package/es/Select/selectContext.js +5 -0
- package/es/Skeleton/Skeleton.css +54 -0
- package/es/Skeleton/Skeleton.d.ts +5 -0
- package/es/Skeleton/Skeleton.js +38 -0
- package/es/Skeleton/Skeleton.types.d.ts +33 -0
- package/es/Skeleton/Skeleton.types.js +1 -0
- package/es/Skeleton/index.d.ts +3 -0
- package/es/Skeleton/index.js +3 -0
- package/es/Slide/Slide.d.ts +4 -0
- package/es/Slide/Slide.js +85 -0
- package/es/Slide/Slide.types.d.ts +14 -0
- package/es/Slide/Slide.types.js +1 -0
- package/es/Slide/index.d.ts +3 -0
- package/es/Slide/index.js +3 -0
- package/es/Slider/Slider.css +95 -0
- package/es/Slider/Slider.d.ts +5 -0
- package/es/Slider/Slider.js +318 -0
- package/es/Slider/Slider.types.d.ts +62 -0
- package/es/Slider/Slider.types.js +1 -0
- package/es/Slider/index.d.ts +2 -0
- package/es/Slider/index.js +2 -0
- package/es/Slider/utils.d.ts +14 -0
- package/es/Slider/utils.js +25 -0
- package/es/Stack/Stack.css +11 -0
- package/es/Stack/Stack.d.ts +5 -0
- package/es/Stack/Stack.js +50 -0
- package/es/Stack/Stack.types.d.ts +35 -0
- package/es/Stack/Stack.types.js +1 -0
- package/es/Stack/demo/StackDemo.d.ts +4 -0
- package/es/Stack/demo/StackDemo.js +128 -0
- package/es/Stack/demo/index.css +23 -0
- package/es/Stack/index.d.ts +3 -0
- package/es/Stack/index.js +3 -0
- package/es/Steps/Step.css +174 -0
- package/es/Steps/Step.d.ts +5 -0
- package/es/Steps/Step.js +88 -0
- package/es/Steps/Step.types.d.ts +35 -0
- package/es/Steps/Step.types.js +1 -0
- package/es/Steps/Steps.css +14 -0
- package/es/Steps/Steps.d.ts +5 -0
- package/es/Steps/Steps.js +60 -0
- package/es/Steps/Steps.types.d.ts +35 -0
- package/es/Steps/Steps.types.js +1 -0
- package/es/Steps/StepsContext.d.ts +5 -0
- package/es/Steps/StepsContext.js +4 -0
- package/es/Steps/index.d.ts +4 -0
- package/es/Steps/index.js +4 -0
- package/es/Swiper/Swiper.css +20 -0
- package/es/Swiper/Swiper.d.ts +10 -0
- package/es/Swiper/Swiper.js +112 -0
- package/es/Swiper/Swiper.types.d.ts +173 -0
- package/es/Swiper/Swiper.types.js +1 -0
- package/es/Swiper/SwiperItem.d.ts +7 -0
- package/es/Swiper/SwiperItem.js +24 -0
- package/es/Swiper/index.d.ts +3 -0
- package/es/Swiper/index.js +3 -0
- package/es/Swiper/index.miniapp.d.ts +8 -0
- package/es/Swiper/index.miniapp.js +6 -0
- package/es/Switch/Switch.css +127 -0
- package/es/Switch/Switch.d.ts +5 -0
- package/es/Switch/Switch.js +76 -0
- package/es/Switch/Switch.types.d.ts +56 -0
- package/es/Switch/Switch.types.js +1 -0
- package/es/Switch/index.d.ts +3 -0
- package/es/Switch/index.js +3 -0
- package/es/TabBar/TabBar.css +8 -0
- package/es/TabBar/TabBar.d.ts +5 -0
- package/es/TabBar/TabBar.js +42 -0
- package/es/TabBar/TabBarContext.d.ts +27 -0
- package/es/TabBar/TabBarContext.js +3 -0
- package/es/TabBar/TabBarItem.css +38 -0
- package/es/TabBar/TabBarItem.d.ts +5 -0
- package/es/TabBar/TabBarItem.js +54 -0
- package/es/TabBar/index.d.ts +4 -0
- package/es/TabBar/index.js +4 -0
- package/es/TabBar/index.types.d.ts +54 -0
- package/es/TabBar/index.types.js +1 -0
- package/es/Tabs/Tab.css +52 -0
- package/es/Tabs/Tab.d.ts +5 -0
- package/es/Tabs/Tab.js +50 -0
- package/es/Tabs/Tab.types.d.ts +12 -0
- package/es/Tabs/Tab.types.js +1 -0
- package/es/Tabs/TabPanel.css +9 -0
- package/es/Tabs/TabPanel.d.ts +5 -0
- package/es/Tabs/TabPanel.js +30 -0
- package/es/Tabs/TabPanel.types.d.ts +19 -0
- package/es/Tabs/TabPanel.types.js +1 -0
- package/es/Tabs/Tabs.css +56 -0
- package/es/Tabs/Tabs.d.ts +5 -0
- package/es/Tabs/Tabs.js +210 -0
- package/es/Tabs/Tabs.types.d.ts +45 -0
- package/es/Tabs/Tabs.types.js +1 -0
- package/es/Tabs/TabsContext.d.ts +9 -0
- package/es/Tabs/TabsContext.js +7 -0
- package/es/Tabs/index.d.ts +6 -0
- package/es/Tabs/index.js +6 -0
- package/es/Tabs/utils/bound.d.ts +1 -0
- package/es/Tabs/utils/bound.js +10 -0
- package/es/Tag/Tag.css +97 -0
- package/es/Tag/Tag.d.ts +5 -0
- package/es/Tag/Tag.js +76 -0
- package/es/Tag/Tag.types.d.ts +23 -0
- package/es/Tag/Tag.types.js +1 -0
- package/es/Tag/TagGroup.css +16 -0
- package/es/Tag/TagGroup.d.ts +5 -0
- package/es/Tag/TagGroup.js +21 -0
- package/es/Tag/TagGroup.types.d.ts +6 -0
- package/es/Tag/TagGroup.types.js +1 -0
- package/es/Tag/index.d.ts +5 -0
- package/es/Tag/index.js +5 -0
- package/es/TextArea/TextArea.css +43 -0
- package/es/TextArea/TextArea.d.ts +5 -0
- package/es/TextArea/TextArea.js +150 -0
- package/es/TextArea/TextArea.types.d.ts +70 -0
- package/es/TextArea/TextArea.types.js +1 -0
- package/es/TextArea/index.d.ts +2 -0
- package/es/TextArea/index.js +2 -0
- package/es/Transition/Transition.d.ts +4 -0
- package/es/Transition/Transition.js +12 -0
- package/es/Transition/Transition.miniapp.d.ts +4 -0
- package/es/Transition/Transition.miniapp.js +12 -0
- package/es/Transition/Transition.types.d.ts +100 -0
- package/es/Transition/Transition.types.js +1 -0
- package/es/Transition/TransitionCore.d.ts +4 -0
- package/es/Transition/TransitionCore.js +289 -0
- package/es/Transition/index.d.ts +3 -0
- package/es/Transition/index.js +3 -0
- package/es/index.d.ts +38 -0
- package/es/index.js +38 -0
- package/package.json +50 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["className", "defaultChecked", "checked", "inputProps", "inputRef", "name", "value", "disabled", "icon", "checkedIcon", "labelPlacement", "onChange", "children"];
|
|
3
|
+
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); }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
+
import { isAlipay, useValue } from '@bifrostui/utils';
|
|
16
|
+
import clsx from 'clsx';
|
|
17
|
+
import React, { forwardRef, useContext } from 'react';
|
|
18
|
+
import RadioButtonIcon from "./RadioButtonIcon";
|
|
19
|
+
import RadioContext from "./RadioContext";
|
|
20
|
+
import "./Radio.css";
|
|
21
|
+
var prefixCls = 'bui-radio';
|
|
22
|
+
var Radio = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
23
|
+
var className = props.className,
|
|
24
|
+
defaultChecked = props.defaultChecked,
|
|
25
|
+
checked = props.checked,
|
|
26
|
+
inputProps = props.inputProps,
|
|
27
|
+
inputRef = props.inputRef,
|
|
28
|
+
name = props.name,
|
|
29
|
+
value = props.value,
|
|
30
|
+
disabled = props.disabled,
|
|
31
|
+
icon = props.icon,
|
|
32
|
+
checkedIcon = props.checkedIcon,
|
|
33
|
+
labelPlacement = props.labelPlacement,
|
|
34
|
+
onChange = props.onChange,
|
|
35
|
+
children = props.children,
|
|
36
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
37
|
+
var groupContext = useContext(RadioContext);
|
|
38
|
+
var validDefaultChecked = defaultChecked;
|
|
39
|
+
var validChecked = checked;
|
|
40
|
+
// 使用RadioGroup
|
|
41
|
+
if (groupContext) {
|
|
42
|
+
var groupControlled = (groupContext === null || groupContext === void 0 ? void 0 : groupContext.value) !== undefined;
|
|
43
|
+
if (groupControlled) {
|
|
44
|
+
validChecked = (groupContext === null || groupContext === void 0 ? void 0 : groupContext.value) === value;
|
|
45
|
+
} else {
|
|
46
|
+
validDefaultChecked = (groupContext === null || groupContext === void 0 ? void 0 : groupContext.defaultValue) === value;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
var _useValue = useValue({
|
|
50
|
+
defaultValue: validDefaultChecked,
|
|
51
|
+
value: validChecked
|
|
52
|
+
}),
|
|
53
|
+
_useValue2 = _slicedToArray(_useValue, 2),
|
|
54
|
+
radioChecked = _useValue2[0],
|
|
55
|
+
triggerChange = _useValue2[1];
|
|
56
|
+
if (groupContext && !value) {
|
|
57
|
+
console.error('RadioGroup模式下Radio须传入value属性');
|
|
58
|
+
}
|
|
59
|
+
var radioCheckIcon = checkedIcon || /*#__PURE__*/React.createElement(RadioButtonIcon, {
|
|
60
|
+
checked: true
|
|
61
|
+
});
|
|
62
|
+
var radioUncheckIcon = icon || /*#__PURE__*/React.createElement(RadioButtonIcon, null);
|
|
63
|
+
var radioDisabled = disabled !== undefined ? disabled : groupContext === null || groupContext === void 0 ? void 0 : groupContext.disabled;
|
|
64
|
+
var changeAction = function changeAction(e, isChecked) {
|
|
65
|
+
// Radio
|
|
66
|
+
if (!groupContext) {
|
|
67
|
+
triggerChange(e, isChecked);
|
|
68
|
+
onChange === null || onChange === void 0 || onChange(e, {
|
|
69
|
+
checked: isChecked
|
|
70
|
+
});
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// RadioGroup
|
|
75
|
+
if (isChecked) {
|
|
76
|
+
var _groupContext$select;
|
|
77
|
+
groupContext === null || groupContext === void 0 || (_groupContext$select = groupContext.select) === null || _groupContext$select === void 0 || _groupContext$select.call(groupContext, e, value);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* 支付宝小程序label标签与radio配合使用时,无法响应onChange、onClick事件
|
|
83
|
+
* 支付宝小程序改为div标签,并通过div标签上的onClick事件触发onChange
|
|
84
|
+
* 微信小程序/H5使用input onChange
|
|
85
|
+
*/
|
|
86
|
+
var handleChange = function handleChange(e) {
|
|
87
|
+
var _inputProps$onChange;
|
|
88
|
+
if (radioChecked) return;
|
|
89
|
+
changeAction(e, true);
|
|
90
|
+
inputProps === null || inputProps === void 0 || (_inputProps$onChange = inputProps.onChange) === null || _inputProps$onChange === void 0 || _inputProps$onChange.call(inputProps, e);
|
|
91
|
+
};
|
|
92
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
93
|
+
ref: ref,
|
|
94
|
+
className: clsx(prefixCls, className, "".concat(prefixCls, "-label-").concat(labelPlacement), _defineProperty({}, "".concat(prefixCls, "-disabled"), radioDisabled))
|
|
95
|
+
}, others, {
|
|
96
|
+
onClick: function onClick(e) {
|
|
97
|
+
var _others$onClick;
|
|
98
|
+
// radio disabled 会触发onClick事件
|
|
99
|
+
others === null || others === void 0 || (_others$onClick = others.onClick) === null || _others$onClick === void 0 || _others$onClick.call(others, e);
|
|
100
|
+
if (radioDisabled) return;
|
|
101
|
+
if (isAlipay) {
|
|
102
|
+
handleChange(e);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}), /*#__PURE__*/React.createElement("input", _extends({
|
|
106
|
+
ref: inputRef,
|
|
107
|
+
type: "radio",
|
|
108
|
+
value: value,
|
|
109
|
+
name: name,
|
|
110
|
+
checked: radioChecked,
|
|
111
|
+
disabled: radioDisabled
|
|
112
|
+
}, inputProps, {
|
|
113
|
+
onChange: handleChange,
|
|
114
|
+
className: clsx("".concat(prefixCls, "-input"), inputProps === null || inputProps === void 0 ? void 0 : inputProps.className)
|
|
115
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
className: "".concat(prefixCls, "-icon")
|
|
117
|
+
}, radioChecked ? radioCheckIcon : radioUncheckIcon), children && /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
className: "".concat(prefixCls, "-label")
|
|
119
|
+
}, children));
|
|
120
|
+
});
|
|
121
|
+
Radio.displayName = 'BuiRadio';
|
|
122
|
+
Radio.defaultProps = {
|
|
123
|
+
defaultChecked: false,
|
|
124
|
+
labelPlacement: 'right'
|
|
125
|
+
};
|
|
126
|
+
export default Radio;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { OverrideProps } from '@bifrostui/types';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
export type RadioLabelPlacement = 'left' | 'top' | 'right' | 'bottom';
|
|
4
|
+
export interface RadioGroupContextProps {
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
select: (e: React.ChangeEvent<HTMLInputElement>, val: string) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type RadioGroupProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
11
|
+
props: P & {
|
|
12
|
+
/**
|
|
13
|
+
* 默认选中的选项,当组件非受控时使用
|
|
14
|
+
*/
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 指定选中的选项,当组件受控时使用
|
|
18
|
+
*/
|
|
19
|
+
value?: string;
|
|
20
|
+
/**
|
|
21
|
+
* 整组是否禁用,默认false
|
|
22
|
+
*/
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 变化时的回调函数
|
|
26
|
+
*/
|
|
27
|
+
onChange?: (e: React.SyntheticEvent, data: {
|
|
28
|
+
value: string;
|
|
29
|
+
}) => void;
|
|
30
|
+
};
|
|
31
|
+
defaultComponent: D;
|
|
32
|
+
}, D>;
|
|
33
|
+
export type RadioProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
34
|
+
props: P & {
|
|
35
|
+
/**
|
|
36
|
+
* 默认是否选中,当组件非受控时使用
|
|
37
|
+
*/
|
|
38
|
+
defaultChecked?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 是否选中,当组件受控时使用
|
|
41
|
+
*/
|
|
42
|
+
checked?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* 内部<input>标签的标准属性
|
|
45
|
+
*/
|
|
46
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
47
|
+
/**
|
|
48
|
+
* 内部<input>标签的ref
|
|
49
|
+
*/
|
|
50
|
+
inputRef?: React.Ref<HTMLInputElement>;
|
|
51
|
+
/**
|
|
52
|
+
* <input>名称标识
|
|
53
|
+
*/
|
|
54
|
+
name?: string;
|
|
55
|
+
/**
|
|
56
|
+
* 组件的值,若使用RadioGroup应传入该属性
|
|
57
|
+
*/
|
|
58
|
+
value?: string;
|
|
59
|
+
/**
|
|
60
|
+
* 是否禁用
|
|
61
|
+
*/
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* 未选中状态图标
|
|
65
|
+
*/
|
|
66
|
+
icon?: ReactNode;
|
|
67
|
+
/**
|
|
68
|
+
* 选中状态图标
|
|
69
|
+
*/
|
|
70
|
+
checkedIcon?: ReactNode;
|
|
71
|
+
/**
|
|
72
|
+
* 文案位置,默认为right
|
|
73
|
+
*/
|
|
74
|
+
labelPlacement?: RadioLabelPlacement;
|
|
75
|
+
/**
|
|
76
|
+
* 变化时的回调函数
|
|
77
|
+
*/
|
|
78
|
+
onChange?: (e: React.SyntheticEvent, data: {
|
|
79
|
+
checked: boolean;
|
|
80
|
+
}) => void;
|
|
81
|
+
};
|
|
82
|
+
defaultComponent: D;
|
|
83
|
+
}, D>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ISvgIconProps } from '@bifrostui/icons';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface IRadioButtonIconProps extends ISvgIconProps {
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare function RadioButtonIcon(props: IRadioButtonIconProps): React.JSX.Element;
|
|
7
|
+
declare namespace RadioButtonIcon {
|
|
8
|
+
var defaultProps: {
|
|
9
|
+
checked: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export default RadioButtonIcon;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
+
import { CircleOutlinedIcon as RadioButtonUncheckedIcon, RadioCheckedFilledIcon as RadioButtonCheckedIcon } from '@bifrostui/icons';
|
|
6
|
+
import clsx from 'clsx';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
var prefixCls = 'bui-radio-btn-icon';
|
|
9
|
+
function RadioButtonIcon(props) {
|
|
10
|
+
var checked = props.checked,
|
|
11
|
+
_props$size = props.size,
|
|
12
|
+
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
13
|
+
color = props.color,
|
|
14
|
+
_props$htmlColor = props.htmlColor,
|
|
15
|
+
htmlColor = _props$htmlColor === void 0 ? '#959aa5' : _props$htmlColor;
|
|
16
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
17
|
+
className: clsx(prefixCls, _defineProperty({}, "".concat(prefixCls, "-checked"), checked))
|
|
18
|
+
}, /*#__PURE__*/React.createElement(RadioButtonUncheckedIcon, {
|
|
19
|
+
size: size,
|
|
20
|
+
color: checked ? 'primary' : color,
|
|
21
|
+
htmlColor: htmlColor,
|
|
22
|
+
className: "".concat(prefixCls, "-outline")
|
|
23
|
+
}), /*#__PURE__*/React.createElement(RadioButtonCheckedIcon, {
|
|
24
|
+
size: size,
|
|
25
|
+
color: checked ? 'primary' : color,
|
|
26
|
+
htmlColor: htmlColor,
|
|
27
|
+
className: "".concat(prefixCls, "-contained")
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
RadioButtonIcon.defaultProps = {
|
|
31
|
+
checked: false
|
|
32
|
+
};
|
|
33
|
+
export default RadioButtonIcon;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { RadioGroupContextProps } from './Radio.types';
|
|
3
|
+
declare const RadioGroupContext: React.Context<RadioGroupContextProps>;
|
|
4
|
+
export declare const RadioContextProvider: React.Provider<RadioGroupContextProps>;
|
|
5
|
+
export default RadioGroupContext;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var _excluded = ["className", "defaultValue", "value", "onChange", "disabled", "children"];
|
|
2
|
+
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); }
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
+
import { useValue } from '@bifrostui/utils';
|
|
12
|
+
import clsx from 'clsx';
|
|
13
|
+
import React, { forwardRef } from 'react';
|
|
14
|
+
import "./Radio.css";
|
|
15
|
+
import { RadioContextProvider } from "./RadioContext";
|
|
16
|
+
var prefixCls = 'bui-radio-group';
|
|
17
|
+
var RadioGroup = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
18
|
+
var className = props.className,
|
|
19
|
+
defaultValue = props.defaultValue,
|
|
20
|
+
value = props.value,
|
|
21
|
+
onChange = props.onChange,
|
|
22
|
+
disabled = props.disabled,
|
|
23
|
+
children = props.children,
|
|
24
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
25
|
+
var _useValue = useValue({
|
|
26
|
+
defaultValue: defaultValue,
|
|
27
|
+
value: value,
|
|
28
|
+
onChange: onChange
|
|
29
|
+
}),
|
|
30
|
+
_useValue2 = _slicedToArray(_useValue, 2),
|
|
31
|
+
groupValue = _useValue2[0],
|
|
32
|
+
triggerChange = _useValue2[1];
|
|
33
|
+
var select = function select(e, v) {
|
|
34
|
+
triggerChange(e, v);
|
|
35
|
+
};
|
|
36
|
+
return /*#__PURE__*/React.createElement(RadioContextProvider, {
|
|
37
|
+
value: {
|
|
38
|
+
defaultValue: defaultValue,
|
|
39
|
+
value: groupValue,
|
|
40
|
+
select: select,
|
|
41
|
+
disabled: disabled
|
|
42
|
+
}
|
|
43
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
44
|
+
ref: ref,
|
|
45
|
+
className: clsx(prefixCls, className)
|
|
46
|
+
}, others), children));
|
|
47
|
+
});
|
|
48
|
+
RadioGroup.displayName = 'BuiRadioGroup';
|
|
49
|
+
RadioGroup.defaultProps = {
|
|
50
|
+
disabled: false
|
|
51
|
+
};
|
|
52
|
+
export default RadioGroup;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.bui-rating {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
font-family: var(--bui-font-family);
|
|
5
|
+
}
|
|
6
|
+
.bui-rating-disabled {
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
opacity: 0.5;
|
|
9
|
+
}
|
|
10
|
+
.bui-rating-container {
|
|
11
|
+
position: relative;
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
.bui-rating-container:last-child {
|
|
15
|
+
margin-right: 0;
|
|
16
|
+
}
|
|
17
|
+
.bui-rating-container-xsmall {
|
|
18
|
+
font-size: var(--bui-text-size-5);
|
|
19
|
+
}
|
|
20
|
+
.bui-rating-container-small {
|
|
21
|
+
font-size: var(--bui-text-size-1);
|
|
22
|
+
margin-right: 0.5px;
|
|
23
|
+
}
|
|
24
|
+
.bui-rating-container-medium {
|
|
25
|
+
font-size: var(--bui-title-size-3);
|
|
26
|
+
margin-right: 1px;
|
|
27
|
+
}
|
|
28
|
+
.bui-rating-container-large {
|
|
29
|
+
font-size: 22px;
|
|
30
|
+
margin-right: 2px;
|
|
31
|
+
}
|
|
32
|
+
.bui-rating-item {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
color: var(--bui-color-fg-disabled);
|
|
38
|
+
}
|
|
39
|
+
.bui-rating-item-input {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
.bui-rating-item-half {
|
|
43
|
+
position: absolute;
|
|
44
|
+
top: 0;
|
|
45
|
+
width: 50%;
|
|
46
|
+
}
|
|
47
|
+
.bui-rating-item-readonly {
|
|
48
|
+
cursor: unset;
|
|
49
|
+
}
|
|
50
|
+
.bui-rating-item-active {
|
|
51
|
+
color: var(--bui-color-warning);
|
|
52
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["className", "size", "defaultValue", "allowHalf", "icon", "checkedIcon", "count", "readOnly", "disabled", "value", "onChange", "name", "disableClear"];
|
|
3
|
+
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); }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
19
|
+
import { StarFilledIcon } from '@bifrostui/icons';
|
|
20
|
+
import { useValue } from '@bifrostui/utils';
|
|
21
|
+
import clsx from 'clsx';
|
|
22
|
+
import React, { forwardRef } from 'react';
|
|
23
|
+
import "./Rating.css";
|
|
24
|
+
var classes = {
|
|
25
|
+
root: 'bui-rating',
|
|
26
|
+
item: 'bui-rating-item',
|
|
27
|
+
container: 'bui-rating-container'
|
|
28
|
+
};
|
|
29
|
+
var Rating = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
30
|
+
var className = props.className,
|
|
31
|
+
size = props.size,
|
|
32
|
+
defaultValue = props.defaultValue,
|
|
33
|
+
allowHalf = props.allowHalf,
|
|
34
|
+
icon = props.icon,
|
|
35
|
+
checkedIcon = props.checkedIcon,
|
|
36
|
+
count = props.count,
|
|
37
|
+
readOnly = props.readOnly,
|
|
38
|
+
disabled = props.disabled,
|
|
39
|
+
value = props.value,
|
|
40
|
+
onChange = props.onChange,
|
|
41
|
+
name = props.name,
|
|
42
|
+
disableClear = props.disableClear,
|
|
43
|
+
others = _objectWithoutProperties(props, _excluded);
|
|
44
|
+
var _useValue = useValue({
|
|
45
|
+
value: value,
|
|
46
|
+
defaultValue: defaultValue,
|
|
47
|
+
onChange: onChange
|
|
48
|
+
}),
|
|
49
|
+
_useValue2 = _slicedToArray(_useValue, 2),
|
|
50
|
+
rateValue = _useValue2[0],
|
|
51
|
+
triggerChange = _useValue2[1];
|
|
52
|
+
var rateItemList = _toConsumableArray(new Array(count));
|
|
53
|
+
|
|
54
|
+
// 支付宝小程序的radio 无onChange、onClick事件,统一使用点击事件模拟
|
|
55
|
+
var handleChange = function handleChange(e, v) {
|
|
56
|
+
if (readOnly || disabled) return;
|
|
57
|
+
if (!disableClear && v === rateValue) {
|
|
58
|
+
triggerChange(e, null);
|
|
59
|
+
} else {
|
|
60
|
+
triggerChange(e, v);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var renderItem = function renderItem(v, half) {
|
|
64
|
+
var isActive = +rateValue >= v;
|
|
65
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
className: clsx(classes.item, _defineProperty(_defineProperty(_defineProperty({}, "".concat(classes.item, "-active"), isActive), "".concat(classes.item, "-half"), half), "".concat(classes.item, "-readonly"), readOnly)),
|
|
67
|
+
onClick: function onClick(e) {
|
|
68
|
+
return handleChange(e, v);
|
|
69
|
+
}
|
|
70
|
+
}, !readOnly && /*#__PURE__*/React.createElement("input", {
|
|
71
|
+
name: name,
|
|
72
|
+
type: "radio",
|
|
73
|
+
checked: rateValue === v,
|
|
74
|
+
disabled: disabled,
|
|
75
|
+
value: v,
|
|
76
|
+
onChange: function onChange(e) {
|
|
77
|
+
return handleChange(e, v);
|
|
78
|
+
},
|
|
79
|
+
className: "".concat(classes.item, "-input")
|
|
80
|
+
}), isActive ? checkedIcon : icon);
|
|
81
|
+
};
|
|
82
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
83
|
+
className: clsx(classes.root, _defineProperty({}, "".concat(classes.root, "-disabled"), disabled), className),
|
|
84
|
+
ref: ref
|
|
85
|
+
}, others), rateItemList.map(function (_, i) {
|
|
86
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
87
|
+
key: i,
|
|
88
|
+
className: clsx(classes.container, _defineProperty({}, "".concat(classes.container, "-").concat(size), size))
|
|
89
|
+
}, allowHalf && renderItem(i + 0.5, allowHalf), renderItem(i + 1));
|
|
90
|
+
}));
|
|
91
|
+
});
|
|
92
|
+
Rating.displayName = 'BuiRating';
|
|
93
|
+
Rating.defaultProps = {
|
|
94
|
+
size: 'medium',
|
|
95
|
+
count: 5,
|
|
96
|
+
icon: /*#__PURE__*/React.createElement(StarFilledIcon, {
|
|
97
|
+
htmlColor: "#ced1d6"
|
|
98
|
+
}),
|
|
99
|
+
checkedIcon: /*#__PURE__*/React.createElement(StarFilledIcon, {
|
|
100
|
+
color: "warning"
|
|
101
|
+
}),
|
|
102
|
+
readOnly: false,
|
|
103
|
+
disabled: false,
|
|
104
|
+
allowHalf: false,
|
|
105
|
+
disableClear: false
|
|
106
|
+
};
|
|
107
|
+
export default Rating;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { OverrideProps } from '@bifrostui/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type RatingSize = 'xsmall' | 'small' | 'medium' | 'large';
|
|
4
|
+
export type RatingProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
5
|
+
props: P & {
|
|
6
|
+
/**
|
|
7
|
+
* 大小 'xsmall' | 'small' | 'medium' | 'large'
|
|
8
|
+
* @default 'medium'
|
|
9
|
+
*/
|
|
10
|
+
size?: RatingSize;
|
|
11
|
+
/**
|
|
12
|
+
* 是否禁止点击后清空
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
disableClear?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 是否允许半选
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
allowHalf?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* 是否允许禁用
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 未选中态图标
|
|
28
|
+
* @default <StarFilledIcon htmlColor="#ced1d6" />
|
|
29
|
+
*/
|
|
30
|
+
icon?: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* 选中态图标
|
|
33
|
+
* @default <StarFilledIcon color="warning" />
|
|
34
|
+
*/
|
|
35
|
+
checkedIcon?: React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* 评分总数
|
|
38
|
+
* @default 5
|
|
39
|
+
*/
|
|
40
|
+
count?: number;
|
|
41
|
+
/**
|
|
42
|
+
* 是否只读
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
readOnly?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* 当前评分
|
|
48
|
+
*/
|
|
49
|
+
value?: number;
|
|
50
|
+
/**
|
|
51
|
+
* 默认评分 非受控状态使用
|
|
52
|
+
*/
|
|
53
|
+
defaultValue?: number;
|
|
54
|
+
/**
|
|
55
|
+
* input的name属性
|
|
56
|
+
*/
|
|
57
|
+
name?: string;
|
|
58
|
+
/**
|
|
59
|
+
* 评分回调
|
|
60
|
+
*/
|
|
61
|
+
onChange?: (ev?: React.SyntheticEvent, data?: {
|
|
62
|
+
value: number;
|
|
63
|
+
}) => void;
|
|
64
|
+
};
|
|
65
|
+
defaultComponent: D;
|
|
66
|
+
}, D>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.bui-scroll {
|
|
2
|
+
-webkit-overflow-scrolling: auto;
|
|
3
|
+
position: relative;
|
|
4
|
+
font-family: var(--bui-font-family);
|
|
5
|
+
}
|
|
6
|
+
.bui-scroll::-webkit-scrollbar {
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
.bui-scroll-view {
|
|
10
|
+
overflow: hidden;
|
|
11
|
+
}
|
|
12
|
+
.bui-scroll-view-scroll-x {
|
|
13
|
+
overflow-x: scroll;
|
|
14
|
+
overflow-y: hidden;
|
|
15
|
+
}
|
|
16
|
+
.bui-scroll-view-scroll-y {
|
|
17
|
+
overflow-x: hidden;
|
|
18
|
+
overflow-y: scroll;
|
|
19
|
+
}
|