@bifrostui/react 2.0.0-alpha.0 → 2.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Alert/Alert.js +2 -1
- package/dist/Alert/__tests__/fixtures/A11yDemos.d.ts +17 -0
- package/dist/Alert/__tests__/fixtures/A11yDemos.js +143 -0
- package/dist/Alert/index.css +4 -4
- package/dist/Avatar/AvatarGroup.css +8 -8
- package/dist/Avatar/index.css +8 -8
- package/dist/Backdrop/Backdrop.js +3 -2
- package/dist/Backdrop/Backdrop.types.d.ts +4 -0
- package/dist/Backdrop/__tests__/fixtures/A11yDemos.d.ts +8 -0
- package/dist/Backdrop/__tests__/fixtures/A11yDemos.js +51 -0
- package/dist/Backdrop/index.css +2 -2
- package/dist/Badge/Badge.js +38 -11
- package/dist/Badge/Badge.types.d.ts +30 -1
- package/dist/Badge/__tests__/fixtures/A11yDemos.d.ts +25 -0
- package/dist/Badge/__tests__/fixtures/A11yDemos.js +110 -0
- package/dist/Badge/hooks/useBadgeA11y.d.ts +23 -0
- package/dist/Badge/hooks/useBadgeA11y.js +76 -0
- package/dist/Badge/hooks/useBadgeDisplay.d.ts +16 -0
- package/dist/Badge/hooks/useBadgeDisplay.js +56 -0
- package/dist/Button/Button.js +2 -1
- package/dist/Button/__tests__/fixtures/A11yDemos.d.ts +23 -0
- package/dist/Button/__tests__/fixtures/A11yDemos.js +81 -0
- package/dist/Button/index.css +4 -5
- package/dist/CSSTransition/CSSTransition.d.ts +4 -0
- package/dist/CSSTransition/CSSTransition.js +177 -0
- package/dist/CSSTransition/CSSTransition.types.d.ts +13 -0
- package/dist/CSSTransition/CSSTransition.types.js +15 -0
- package/dist/CSSTransition/demo/CSSTransitionDemo.d.ts +4 -0
- package/dist/CSSTransition/demo/CSSTransitionDemo.js +76 -0
- package/dist/CSSTransition/demo/index.css +25 -0
- package/dist/CSSTransition/index.d.ts +2 -0
- package/dist/CSSTransition/index.js +41 -0
- package/dist/Calendar/Calendar.js +131 -34
- package/dist/Calendar/Calendar.types.d.ts +16 -1
- package/dist/Calendar/__tests__/fixtures/A11yDemos.d.ts +2 -0
- package/dist/Calendar/__tests__/fixtures/A11yDemos.js +41 -0
- package/dist/Calendar/index.css +52 -9
- package/dist/Calendar/utils.d.ts +7 -3
- package/dist/Calendar/utils.js +33 -23
- package/dist/Checkbox/Checkbox.js +5 -4
- package/dist/Checkbox/__tests__/fixtures/A11yDemos.d.ts +15 -0
- package/dist/Checkbox/__tests__/fixtures/A11yDemos.js +57 -0
- package/dist/CitySelector/CitySelector.types.d.ts +0 -1
- package/dist/Collapse/Collapse.d.ts +1 -1
- package/dist/Collapse/Collapse.js +26 -12
- package/dist/Collapse/Collapse.miniapp.d.ts +10 -0
- package/dist/Collapse/Collapse.miniapp.js +255 -0
- package/dist/Collapse/index.css +40 -1
- package/dist/CollapsePanel/index.css +1 -1
- package/dist/Countdown/Countdown.js +61 -21
- package/dist/Countdown/Countdown.types.d.ts +19 -15
- package/dist/Countdown/__tests__/fixtures/A11yDemos.d.ts +23 -0
- package/dist/Countdown/__tests__/fixtures/A11yDemos.js +107 -0
- package/dist/Countdown/index.css +11 -0
- package/dist/DatePicker/DatePicker.d.ts +4 -0
- package/dist/DatePicker/DatePicker.js +335 -0
- package/dist/DatePicker/DatePicker.types.d.ts +36 -0
- package/dist/DatePicker/DatePicker.types.js +15 -0
- package/dist/DatePicker/constants.d.ts +9 -0
- package/dist/DatePicker/constants.js +37 -0
- package/dist/DatePicker/index.d.ts +3 -0
- package/dist/DatePicker/index.js +44 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.css +61 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.d.ts +5 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.js +280 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.types.d.ts +163 -0
- package/dist/DesktopDatePicker/DesktopDatePicker.types.js +15 -0
- package/dist/DesktopDatePicker/deskTopPickerContainer.css +100 -0
- package/dist/DesktopDatePicker/index.css +161 -0
- package/dist/DesktopDatePicker/index.d.ts +2 -0
- package/dist/DesktopDatePicker/index.js +41 -0
- package/dist/DesktopDatePicker/useGetDatePickerContent.d.ts +6 -0
- package/dist/DesktopDatePicker/useGetDatePickerContent.js +343 -0
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +5 -0
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.js +322 -0
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +163 -0
- package/dist/DesktopDateTimePicker/DesktopDateTimePicker.types.js +15 -0
- package/dist/DesktopDateTimePicker/index.css +66 -0
- package/dist/DesktopDateTimePicker/index.d.ts +2 -0
- package/dist/DesktopDateTimePicker/index.js +41 -0
- package/dist/DesktopPicker/DesktopPicker.d.ts +5 -0
- package/dist/DesktopPicker/DesktopPicker.js +243 -0
- package/dist/DesktopPicker/DesktopPicker.types.d.ts +61 -0
- package/dist/DesktopPicker/DesktopPicker.types.js +15 -0
- package/dist/DesktopPicker/index.css +39 -0
- package/dist/DesktopPicker/index.d.ts +2 -0
- package/dist/DesktopPicker/index.js +41 -0
- package/dist/DesktopPicker/utils/calcAfterMounted.d.ts +2 -0
- package/dist/{Tabs/utils/bound.js → DesktopPicker/utils/calcAfterMounted.js} +7 -14
- package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +2 -0
- package/dist/DesktopPicker/utils/calcAfterMounted.miniapp.js +38 -0
- package/dist/DesktopTimePicker/DesktopTimePicker.d.ts +5 -0
- package/dist/DesktopTimePicker/DesktopTimePicker.js +288 -0
- package/dist/DesktopTimePicker/DesktopTimePicker.types.d.ts +182 -0
- package/dist/DesktopTimePicker/DesktopTimePicker.types.js +15 -0
- package/dist/DesktopTimePicker/DesktopTimePickerList.d.ts +4 -0
- package/dist/DesktopTimePicker/DesktopTimePickerList.js +111 -0
- package/dist/DesktopTimePicker/index.css +170 -0
- package/dist/DesktopTimePicker/index.d.ts +2 -0
- package/dist/DesktopTimePicker/index.js +41 -0
- package/dist/DesktopTimePicker/useGetTimePickerContent.d.ts +6 -0
- package/dist/DesktopTimePicker/useGetTimePickerContent.js +249 -0
- package/dist/DesktopTimePicker/utils/scrollUtil.d.ts +2 -0
- package/dist/DesktopTimePicker/utils/scrollUtil.js +27 -0
- package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +2 -0
- package/dist/DesktopTimePicker/utils/scrollUtil.miniapp.js +51 -0
- package/dist/DesktopTimePicker/utils/utils.d.ts +28 -0
- package/dist/DesktopTimePicker/utils/utils.js +408 -0
- package/dist/Dialog/Dialog.d.ts +5 -2
- package/dist/Dialog/Dialog.js +56 -34
- package/dist/Dialog/Dialog.types.d.ts +50 -22
- package/dist/Dialog/FunctionalDialog.d.ts +10 -3
- package/dist/Dialog/FunctionalDialog.js +102 -80
- package/dist/Dialog/__tests__/fixtures/A11yDemos.d.ts +9 -0
- package/dist/Dialog/__tests__/fixtures/A11yDemos.js +78 -0
- package/dist/Dialog/index.css +19 -19
- package/dist/Dialog/index.d.ts +4 -1
- package/dist/Dialog/index.js +9 -2
- package/dist/Drawer/Drawer.js +7 -7
- package/dist/Drawer/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/dist/Drawer/__tests__/fixtures/A11yDemos.js +148 -0
- package/dist/Fade/Fade.js +2 -2
- package/dist/Fade/Fade.miniapp.d.ts +10 -0
- package/dist/Fade/Fade.miniapp.js +200 -0
- package/dist/Fade/index.css +18 -0
- package/dist/IconButton/IconButton.js +23 -8
- package/dist/IconButton/IconButton.types.d.ts +35 -1
- package/dist/IconButton/index.css +3 -0
- package/dist/Image/Image.js +17 -10
- package/dist/Image/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/dist/Image/__tests__/fixtures/A11yDemos.js +130 -0
- package/dist/Image/index.css +3 -8
- package/dist/Input/Input.js +5 -3
- package/dist/Input/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/dist/Input/__tests__/fixtures/A11yDemos.js +81 -0
- package/dist/Input/index.css +8 -8
- package/dist/ItemSelector/ItemSelector.types.d.ts +0 -1
- package/dist/Modal/Modal.js +47 -47
- package/dist/Modal/Modal.miniapp.d.ts +2 -2
- package/dist/Modal/Modal.miniapp.js +48 -32
- package/dist/Modal/Modal.types.d.ts +26 -2
- package/dist/Modal/ModalManager.d.ts +21 -0
- package/dist/Modal/ModalManager.js +238 -0
- package/dist/Modal/__tests__/fixtures/A11yDemos.d.ts +8 -0
- package/dist/Modal/__tests__/fixtures/A11yDemos.js +52 -0
- package/dist/Modal/index.css +1 -1
- package/dist/Modal/index.d.ts +3 -0
- package/dist/Modal/index.js +9 -1
- package/dist/Modal/useModal.d.ts +24 -0
- package/dist/Modal/useModal.js +190 -0
- package/dist/NavBar/index.css +2 -2
- package/dist/Picker/Picker.css +4 -0
- package/dist/Picker/Picker.js +72 -18
- package/dist/Picker/Picker.types.d.ts +15 -2
- package/dist/Picker/PickerPanel.css +4 -0
- package/dist/Picker/PickerPanel.js +52 -41
- package/dist/Picker/__tests__/fixtures/A11yDemos.d.ts +2 -0
- package/dist/Picker/__tests__/fixtures/A11yDemos.js +79 -0
- package/dist/Picker/index.css +8 -0
- package/dist/Picker/utils.d.ts +8 -5
- package/dist/Picker/utils.js +9 -12
- package/dist/Popover/Popover.js +123 -91
- package/dist/Popover/Popover.types.d.ts +44 -7
- package/dist/Popover/__tests__/fixtures/A11yDemos.d.ts +25 -0
- package/dist/Popover/__tests__/fixtures/A11yDemos.js +175 -0
- package/dist/Popover/hooks/index.d.ts +8 -0
- package/dist/Popover/hooks/index.js +36 -0
- package/dist/Popover/hooks/usePopoverA11y.d.ts +14 -0
- package/dist/Popover/hooks/usePopoverA11y.js +66 -0
- package/dist/Popover/hooks/usePopoverEvents.d.ts +21 -0
- package/dist/Popover/hooks/usePopoverEvents.js +150 -0
- package/dist/Popover/hooks/usePopoverPosition.d.ts +17 -0
- package/dist/Popover/hooks/usePopoverPosition.js +124 -0
- package/dist/Popover/hooks/usePopoverState.d.ts +16 -0
- package/dist/Popover/hooks/usePopoverState.js +54 -0
- package/dist/Portal/Portal.miniapp.js +20 -11
- package/dist/Portal/Portal.types.d.ts +1 -1
- package/dist/Portal/PortalCore.js +2 -2
- package/dist/Progress/Progress.js +61 -6
- package/dist/Progress/Progress.types.d.ts +44 -0
- package/dist/Progress/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/dist/Progress/__tests__/fixtures/A11yDemos.js +100 -0
- package/dist/Radio/Radio.js +5 -4
- package/dist/Radio/RadioGroup.js +1 -1
- package/dist/Radio/__tests__/fixtures/A11yDemos.d.ts +15 -0
- package/dist/Radio/__tests__/fixtures/A11yDemos.js +57 -0
- package/dist/Rating/index.css +8 -12
- package/dist/ScrollView/ScrollView.js +48 -196
- package/dist/ScrollView/ScrollView.types.d.ts +120 -86
- package/dist/ScrollView/__tests__/fixtures/A11yDemos.d.ts +7 -0
- package/dist/ScrollView/__tests__/fixtures/A11yDemos.js +319 -0
- package/dist/ScrollView/useScrollView.d.ts +10 -0
- package/dist/ScrollView/useScrollView.js +300 -0
- package/dist/Select/Select.js +73 -39
- package/dist/Select/Select.types.d.ts +2 -2
- package/dist/Select/SelectOption.js +5 -1
- package/dist/Select/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/dist/Select/__tests__/fixtures/A11yDemos.js +154 -0
- package/dist/Select/index.css +12 -8
- package/dist/Select/selectContext.d.ts +0 -1
- package/dist/Slide/Slide.js +2 -2
- package/dist/Slide/Slide.miniapp.d.ts +14 -0
- package/dist/Slide/Slide.miniapp.js +213 -0
- package/dist/Slide/index.css +72 -0
- package/dist/Slider/Slider.js +13 -5
- package/dist/Stack/demo/index.css +2 -0
- package/dist/SwipeAction/SwipeAction.css +79 -0
- package/dist/SwipeAction/SwipeAction.d.ts +5 -0
- package/dist/SwipeAction/SwipeAction.js +349 -0
- package/dist/SwipeAction/SwipeAction.types.d.ts +75 -0
- package/dist/SwipeAction/SwipeAction.types.js +15 -0
- package/dist/SwipeAction/SwipeActionContext.d.ts +3 -0
- package/dist/SwipeAction/SwipeActionContext.js +30 -0
- package/dist/SwipeAction/SwipeActionItem.css +31 -0
- package/dist/SwipeAction/SwipeActionItem.d.ts +5 -0
- package/dist/SwipeAction/SwipeActionItem.js +105 -0
- package/dist/SwipeAction/constants.d.ts +9 -0
- package/dist/SwipeAction/constants.js +39 -0
- package/dist/SwipeAction/index.css +110 -0
- package/dist/SwipeAction/index.d.ts +5 -0
- package/dist/SwipeAction/index.js +50 -0
- package/dist/Swiper/Swiper.js +18 -4
- package/dist/Switch/Switch.js +5 -4
- package/dist/Switch/__tests__/fixtures/A11yDemos.d.ts +15 -0
- package/dist/Switch/__tests__/fixtures/A11yDemos.js +57 -0
- package/dist/Tabs/Tab.js +36 -21
- package/dist/Tabs/Tab.types.d.ts +1 -1
- package/dist/Tabs/TabPanel.d.ts +1 -1
- package/dist/Tabs/TabPanel.js +9 -5
- package/dist/Tabs/Tabs.css +2 -2
- package/dist/Tabs/Tabs.js +87 -64
- package/dist/Tabs/Tabs.types.d.ts +1 -1
- package/dist/Tabs/TabsContext.d.ts +4 -5
- package/dist/Tabs/TabsContext.js +3 -1
- package/dist/Tabs/index.css +2 -2
- package/dist/Tabs/utils/scroll.d.ts +2 -0
- package/dist/Tabs/utils/scroll.js +55 -0
- package/dist/Tag/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/dist/Tag/__tests__/fixtures/A11yDemos.js +196 -0
- package/dist/TextArea/TextArea.js +50 -7
- package/dist/TextArea/TextArea.types.d.ts +28 -0
- package/dist/TextArea/__tests__/fixtures/A11yDemos.d.ts +19 -0
- package/dist/TextArea/__tests__/fixtures/A11yDemos.js +91 -0
- package/dist/TextArea/index.css +4 -4
- package/dist/ThemeProvider/ThemeProvider.types.d.ts +2 -2
- package/dist/ThemeProvider/ThemeProvider.types.js +0 -12
- package/dist/Toast/FunctionalToast.d.ts +2 -2
- package/dist/Toast/FunctionalToast.js +180 -85
- package/dist/Toast/Toast.d.ts +2 -2
- package/dist/Toast/Toast.js +69 -28
- package/dist/Toast/Toast.types.d.ts +13 -10
- package/dist/Toast/__tests__/fixtures/A11yDemos.d.ts +2 -0
- package/dist/Toast/__tests__/fixtures/A11yDemos.js +54 -0
- package/dist/Toast/index.css +0 -1
- package/dist/Tooltip/Tooltip.js +63 -107
- package/dist/Tooltip/Tooltip.types.d.ts +94 -43
- package/dist/Tooltip/__tests__/fixtures/A11yDemos.d.ts +25 -0
- package/dist/Tooltip/__tests__/fixtures/A11yDemos.js +100 -0
- package/dist/Tooltip/useTooltip.d.ts +29 -0
- package/dist/Tooltip/useTooltip.js +313 -0
- package/dist/Transition/TransitionCore.js +30 -25
- package/dist/TransitionGroup/TransitionGroup.d.ts +7 -0
- package/dist/TransitionGroup/TransitionGroup.js +132 -0
- package/dist/TransitionGroup/TransitionGroup.types.d.ts +47 -0
- package/dist/TransitionGroup/TransitionGroup.types.js +15 -0
- package/dist/TransitionGroup/demo/TransitionGroupDemo.d.ts +4 -0
- package/dist/TransitionGroup/demo/TransitionGroupDemo.js +68 -0
- package/dist/TransitionGroup/demo/index.css +33 -0
- package/dist/TransitionGroup/index.d.ts +2 -0
- package/dist/TransitionGroup/index.js +41 -0
- package/dist/TransitionGroup/utils/childMapping.d.ts +27 -0
- package/dist/TransitionGroup/utils/childMapping.js +119 -0
- package/dist/_.._/benchmarks/components/Button.js +41 -0
- package/dist/_.._/benchmarks/components/Input.js +45 -0
- package/dist/_.._/benchmarks/components/Tabs.js +50 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +17 -1
- package/dist/locales/base.d.ts +40 -1
- package/dist/locales/en-US.js +54 -2
- package/dist/locales/zh-CN.js +56 -1
- package/dist/locales/zh-TW.js +56 -1
- package/es/Alert/Alert.js +2 -1
- package/es/Alert/__tests__/fixtures/A11yDemos.d.ts +17 -0
- package/es/Alert/__tests__/fixtures/A11yDemos.js +107 -0
- package/es/Alert/index.css +4 -4
- package/es/Avatar/AvatarGroup.css +8 -8
- package/es/Avatar/index.css +8 -8
- package/es/Backdrop/Backdrop.js +3 -2
- package/es/Backdrop/Backdrop.types.d.ts +4 -0
- package/es/Backdrop/__tests__/fixtures/A11yDemos.d.ts +8 -0
- package/es/Backdrop/__tests__/fixtures/A11yDemos.js +17 -0
- package/es/Backdrop/index.css +2 -2
- package/es/Badge/Badge.js +38 -11
- package/es/Badge/Badge.types.d.ts +30 -1
- package/es/Badge/__tests__/fixtures/A11yDemos.d.ts +25 -0
- package/es/Badge/__tests__/fixtures/A11yDemos.js +70 -0
- package/es/Badge/hooks/useBadgeA11y.d.ts +23 -0
- package/es/Badge/hooks/useBadgeA11y.js +53 -0
- package/es/Badge/hooks/useBadgeDisplay.d.ts +16 -0
- package/es/Badge/hooks/useBadgeDisplay.js +33 -0
- package/es/Button/Button.js +2 -1
- package/es/Button/__tests__/fixtures/A11yDemos.d.ts +23 -0
- package/es/Button/__tests__/fixtures/A11yDemos.js +42 -0
- package/es/Button/index.css +4 -5
- package/es/CSSTransition/CSSTransition.d.ts +4 -0
- package/es/CSSTransition/CSSTransition.js +153 -0
- package/es/CSSTransition/CSSTransition.types.d.ts +13 -0
- package/es/CSSTransition/CSSTransition.types.js +1 -0
- package/es/CSSTransition/demo/CSSTransitionDemo.d.ts +4 -0
- package/es/CSSTransition/demo/CSSTransitionDemo.js +47 -0
- package/es/CSSTransition/demo/index.css +25 -0
- package/es/CSSTransition/index.d.ts +2 -0
- package/es/CSSTransition/index.js +6 -0
- package/es/Calendar/Calendar.js +131 -34
- package/es/Calendar/Calendar.types.d.ts +16 -1
- package/es/Calendar/__tests__/fixtures/A11yDemos.d.ts +2 -0
- package/es/Calendar/__tests__/fixtures/A11yDemos.js +8 -0
- package/es/Calendar/index.css +52 -9
- package/es/Calendar/utils.d.ts +7 -3
- package/es/Calendar/utils.js +29 -20
- package/es/Checkbox/Checkbox.js +5 -4
- package/es/Checkbox/__tests__/fixtures/A11yDemos.d.ts +15 -0
- package/es/Checkbox/__tests__/fixtures/A11yDemos.js +22 -0
- package/es/CitySelector/CitySelector.types.d.ts +0 -1
- package/es/Collapse/Collapse.d.ts +1 -1
- package/es/Collapse/Collapse.js +26 -12
- package/es/Collapse/Collapse.miniapp.d.ts +10 -0
- package/es/Collapse/Collapse.miniapp.js +236 -0
- package/es/Collapse/index.css +40 -1
- package/es/CollapsePanel/index.css +1 -1
- package/es/Countdown/Countdown.js +61 -21
- package/es/Countdown/Countdown.types.d.ts +19 -15
- package/es/Countdown/__tests__/fixtures/A11yDemos.d.ts +23 -0
- package/es/Countdown/__tests__/fixtures/A11yDemos.js +68 -0
- package/es/Countdown/index.css +11 -0
- package/es/DatePicker/DatePicker.d.ts +4 -0
- package/es/DatePicker/DatePicker.js +308 -0
- package/es/DatePicker/DatePicker.types.d.ts +36 -0
- package/es/DatePicker/DatePicker.types.js +1 -0
- package/es/DatePicker/constants.d.ts +9 -0
- package/es/DatePicker/constants.js +14 -0
- package/es/DatePicker/index.d.ts +3 -0
- package/es/DatePicker/index.js +8 -0
- package/es/DesktopDatePicker/DesktopDatePicker.css +61 -0
- package/es/DesktopDatePicker/DesktopDatePicker.d.ts +5 -0
- package/es/DesktopDatePicker/DesktopDatePicker.js +253 -0
- package/es/DesktopDatePicker/DesktopDatePicker.types.d.ts +163 -0
- package/es/DesktopDatePicker/DesktopDatePicker.types.js +1 -0
- package/es/DesktopDatePicker/deskTopPickerContainer.css +100 -0
- package/es/DesktopDatePicker/index.css +161 -0
- package/es/DesktopDatePicker/index.d.ts +2 -0
- package/es/DesktopDatePicker/index.js +6 -0
- package/es/DesktopDatePicker/useGetDatePickerContent.d.ts +6 -0
- package/es/DesktopDatePicker/useGetDatePickerContent.js +316 -0
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +5 -0
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.js +295 -0
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +163 -0
- package/es/DesktopDateTimePicker/DesktopDateTimePicker.types.js +1 -0
- package/es/DesktopDateTimePicker/index.css +66 -0
- package/es/DesktopDateTimePicker/index.d.ts +2 -0
- package/es/DesktopDateTimePicker/index.js +9 -0
- package/es/DesktopPicker/DesktopPicker.d.ts +5 -0
- package/es/DesktopPicker/DesktopPicker.js +226 -0
- package/es/DesktopPicker/DesktopPicker.types.d.ts +61 -0
- package/es/DesktopPicker/DesktopPicker.types.js +1 -0
- package/es/DesktopPicker/index.css +39 -0
- package/es/DesktopPicker/index.d.ts +2 -0
- package/es/DesktopPicker/index.js +6 -0
- package/es/DesktopPicker/utils/calcAfterMounted.d.ts +2 -0
- package/es/DesktopPicker/utils/calcAfterMounted.js +6 -0
- package/es/DesktopPicker/utils/calcAfterMounted.miniapp.d.ts +2 -0
- package/es/DesktopPicker/utils/calcAfterMounted.miniapp.js +9 -0
- package/es/DesktopTimePicker/DesktopTimePicker.d.ts +5 -0
- package/es/DesktopTimePicker/DesktopTimePicker.js +261 -0
- package/es/DesktopTimePicker/DesktopTimePicker.types.d.ts +182 -0
- package/es/DesktopTimePicker/DesktopTimePicker.types.js +1 -0
- package/es/DesktopTimePicker/DesktopTimePickerList.d.ts +4 -0
- package/es/DesktopTimePicker/DesktopTimePickerList.js +84 -0
- package/es/DesktopTimePicker/index.css +170 -0
- package/es/DesktopTimePicker/index.d.ts +2 -0
- package/es/DesktopTimePicker/index.js +6 -0
- package/es/DesktopTimePicker/useGetTimePickerContent.d.ts +6 -0
- package/es/DesktopTimePicker/useGetTimePickerContent.js +226 -0
- package/es/DesktopTimePicker/utils/scrollUtil.d.ts +2 -0
- package/es/DesktopTimePicker/utils/scrollUtil.js +8 -0
- package/es/DesktopTimePicker/utils/scrollUtil.miniapp.d.ts +2 -0
- package/es/DesktopTimePicker/utils/scrollUtil.miniapp.js +22 -0
- package/es/DesktopTimePicker/utils/utils.d.ts +28 -0
- package/es/DesktopTimePicker/utils/utils.js +365 -0
- package/es/Dialog/Dialog.d.ts +5 -2
- package/es/Dialog/Dialog.js +57 -35
- package/es/Dialog/Dialog.types.d.ts +50 -22
- package/es/Dialog/FunctionalDialog.d.ts +10 -3
- package/es/Dialog/FunctionalDialog.js +106 -84
- package/es/Dialog/__tests__/fixtures/A11yDemos.d.ts +9 -0
- package/es/Dialog/__tests__/fixtures/A11yDemos.js +43 -0
- package/es/Dialog/index.css +19 -19
- package/es/Dialog/index.d.ts +4 -1
- package/es/Dialog/index.js +10 -3
- package/es/Drawer/Drawer.js +8 -8
- package/es/Drawer/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/es/Drawer/__tests__/fixtures/A11yDemos.js +112 -0
- package/es/Fade/Fade.js +2 -2
- package/es/Fade/Fade.miniapp.d.ts +10 -0
- package/es/Fade/Fade.miniapp.js +179 -0
- package/es/Fade/index.css +18 -0
- package/es/IconButton/IconButton.js +23 -8
- package/es/IconButton/IconButton.types.d.ts +35 -1
- package/es/IconButton/index.css +3 -0
- package/es/Image/Image.js +17 -10
- package/es/Image/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/es/Image/__tests__/fixtures/A11yDemos.js +92 -0
- package/es/Image/index.css +3 -8
- package/es/Input/Input.js +5 -3
- package/es/Input/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/es/Input/__tests__/fixtures/A11yDemos.js +43 -0
- package/es/Input/index.css +8 -8
- package/es/ItemSelector/ItemSelector.types.d.ts +0 -1
- package/es/Modal/Modal.js +48 -48
- package/es/Modal/Modal.miniapp.d.ts +2 -2
- package/es/Modal/Modal.miniapp.js +49 -33
- package/es/Modal/Modal.types.d.ts +26 -2
- package/es/Modal/ModalManager.d.ts +21 -0
- package/es/Modal/ModalManager.js +214 -0
- package/es/Modal/__tests__/fixtures/A11yDemos.d.ts +8 -0
- package/es/Modal/__tests__/fixtures/A11yDemos.js +18 -0
- package/es/Modal/index.css +1 -1
- package/es/Modal/index.d.ts +3 -0
- package/es/Modal/index.js +6 -1
- package/es/Modal/useModal.d.ts +24 -0
- package/es/Modal/useModal.js +169 -0
- package/es/NavBar/index.css +2 -2
- package/es/Picker/Picker.css +4 -0
- package/es/Picker/Picker.js +72 -18
- package/es/Picker/Picker.types.d.ts +15 -2
- package/es/Picker/PickerPanel.css +4 -0
- package/es/Picker/PickerPanel.js +52 -41
- package/es/Picker/__tests__/fixtures/A11yDemos.d.ts +2 -0
- package/es/Picker/__tests__/fixtures/A11yDemos.js +46 -0
- package/es/Picker/index.css +8 -0
- package/es/Picker/utils.d.ts +8 -5
- package/es/Picker/utils.js +9 -12
- package/es/Popover/Popover.js +130 -99
- package/es/Popover/Popover.types.d.ts +44 -7
- package/es/Popover/__tests__/fixtures/A11yDemos.d.ts +25 -0
- package/es/Popover/__tests__/fixtures/A11yDemos.js +135 -0
- package/es/Popover/hooks/index.d.ts +8 -0
- package/es/Popover/hooks/index.js +10 -0
- package/es/Popover/hooks/usePopoverA11y.d.ts +14 -0
- package/es/Popover/hooks/usePopoverA11y.js +43 -0
- package/es/Popover/hooks/usePopoverEvents.d.ts +21 -0
- package/es/Popover/hooks/usePopoverEvents.js +127 -0
- package/es/Popover/hooks/usePopoverPosition.d.ts +17 -0
- package/es/Popover/hooks/usePopoverPosition.js +105 -0
- package/es/Popover/hooks/usePopoverState.d.ts +16 -0
- package/es/Popover/hooks/usePopoverState.js +31 -0
- package/es/Portal/Portal.miniapp.js +21 -12
- package/es/Portal/Portal.types.d.ts +1 -1
- package/es/Portal/PortalCore.js +2 -2
- package/es/Progress/Progress.js +61 -6
- package/es/Progress/Progress.types.d.ts +44 -0
- package/es/Progress/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/es/Progress/__tests__/fixtures/A11yDemos.js +62 -0
- package/es/Radio/Radio.js +5 -4
- package/es/Radio/RadioGroup.js +1 -1
- package/es/Radio/__tests__/fixtures/A11yDemos.d.ts +15 -0
- package/es/Radio/__tests__/fixtures/A11yDemos.js +22 -0
- package/es/Rating/index.css +8 -12
- package/es/ScrollView/ScrollView.js +51 -197
- package/es/ScrollView/ScrollView.types.d.ts +120 -86
- package/es/ScrollView/__tests__/fixtures/A11yDemos.d.ts +7 -0
- package/es/ScrollView/__tests__/fixtures/A11yDemos.js +283 -0
- package/es/ScrollView/useScrollView.d.ts +10 -0
- package/es/ScrollView/useScrollView.js +279 -0
- package/es/Select/Select.js +73 -40
- package/es/Select/Select.types.d.ts +2 -2
- package/es/Select/SelectOption.js +5 -1
- package/es/Select/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/es/Select/__tests__/fixtures/A11yDemos.js +118 -0
- package/es/Select/index.css +12 -8
- package/es/Select/selectContext.d.ts +0 -1
- package/es/Slide/Slide.js +2 -2
- package/es/Slide/Slide.miniapp.d.ts +14 -0
- package/es/Slide/Slide.miniapp.js +192 -0
- package/es/Slide/index.css +72 -0
- package/es/Slider/Slider.js +16 -6
- package/es/Stack/demo/index.css +2 -0
- package/es/SwipeAction/SwipeAction.css +79 -0
- package/es/SwipeAction/SwipeAction.d.ts +5 -0
- package/es/SwipeAction/SwipeAction.js +334 -0
- package/es/SwipeAction/SwipeAction.types.d.ts +75 -0
- package/es/SwipeAction/SwipeAction.types.js +1 -0
- package/es/SwipeAction/SwipeActionContext.d.ts +3 -0
- package/es/SwipeAction/SwipeActionContext.js +11 -0
- package/es/SwipeAction/SwipeActionItem.css +31 -0
- package/es/SwipeAction/SwipeActionItem.d.ts +5 -0
- package/es/SwipeAction/SwipeActionItem.js +78 -0
- package/es/SwipeAction/constants.d.ts +9 -0
- package/es/SwipeAction/constants.js +15 -0
- package/es/SwipeAction/index.css +110 -0
- package/es/SwipeAction/index.d.ts +5 -0
- package/es/SwipeAction/index.js +12 -0
- package/es/Swiper/Swiper.js +18 -4
- package/es/Switch/Switch.js +5 -4
- package/es/Switch/__tests__/fixtures/A11yDemos.d.ts +15 -0
- package/es/Switch/__tests__/fixtures/A11yDemos.js +22 -0
- package/es/Tabs/Tab.js +36 -21
- package/es/Tabs/Tab.types.d.ts +1 -1
- package/es/Tabs/TabPanel.d.ts +1 -1
- package/es/Tabs/TabPanel.js +8 -4
- package/es/Tabs/Tabs.css +2 -2
- package/es/Tabs/Tabs.js +87 -64
- package/es/Tabs/Tabs.types.d.ts +1 -1
- package/es/Tabs/TabsContext.d.ts +4 -5
- package/es/Tabs/TabsContext.js +3 -1
- package/es/Tabs/index.css +2 -2
- package/es/Tabs/utils/scroll.d.ts +2 -0
- package/es/Tabs/utils/scroll.js +36 -0
- package/es/Tag/__tests__/fixtures/A11yDemos.d.ts +21 -0
- package/es/Tag/__tests__/fixtures/A11yDemos.js +160 -0
- package/es/TextArea/TextArea.js +51 -8
- package/es/TextArea/TextArea.types.d.ts +28 -0
- package/es/TextArea/__tests__/fixtures/A11yDemos.d.ts +19 -0
- package/es/TextArea/__tests__/fixtures/A11yDemos.js +54 -0
- package/es/TextArea/index.css +4 -4
- package/es/ThemeProvider/ThemeProvider.types.d.ts +2 -2
- package/es/Toast/FunctionalToast.d.ts +2 -2
- package/es/Toast/FunctionalToast.js +186 -86
- package/es/Toast/Toast.d.ts +2 -2
- package/es/Toast/Toast.js +69 -28
- package/es/Toast/Toast.types.d.ts +13 -10
- package/es/Toast/__tests__/fixtures/A11yDemos.d.ts +2 -0
- package/es/Toast/__tests__/fixtures/A11yDemos.js +21 -0
- package/es/Toast/index.css +0 -1
- package/es/Tooltip/Tooltip.js +64 -114
- package/es/Tooltip/Tooltip.types.d.ts +94 -43
- package/es/Tooltip/__tests__/fixtures/A11yDemos.d.ts +25 -0
- package/es/Tooltip/__tests__/fixtures/A11yDemos.js +60 -0
- package/es/Tooltip/useTooltip.d.ts +29 -0
- package/es/Tooltip/useTooltip.js +290 -0
- package/es/Transition/TransitionCore.js +31 -26
- package/es/TransitionGroup/TransitionGroup.d.ts +7 -0
- package/es/TransitionGroup/TransitionGroup.js +109 -0
- package/es/TransitionGroup/TransitionGroup.types.d.ts +47 -0
- package/es/TransitionGroup/TransitionGroup.types.js +1 -0
- package/es/TransitionGroup/demo/TransitionGroupDemo.d.ts +4 -0
- package/es/TransitionGroup/demo/TransitionGroupDemo.js +39 -0
- package/es/TransitionGroup/demo/index.css +33 -0
- package/es/TransitionGroup/index.d.ts +2 -0
- package/es/TransitionGroup/index.js +6 -0
- package/es/TransitionGroup/utils/childMapping.d.ts +27 -0
- package/es/TransitionGroup/utils/childMapping.js +93 -0
- package/es/_.._/benchmarks/components/Button.js +8 -0
- package/es/_.._/benchmarks/components/Input.js +12 -0
- package/es/_.._/benchmarks/components/Tabs.js +17 -0
- package/es/index.d.ts +8 -0
- package/es/index.js +8 -0
- package/es/locales/base.d.ts +40 -1
- package/es/locales/en-US.js +54 -2
- package/es/locales/zh-CN.js +56 -1
- package/es/locales/zh-TW.js +56 -1
- package/package.json +9 -6
- package/dist/Tabs/utils/bound.d.ts +0 -1
- package/es/Tabs/utils/bound.d.ts +0 -1
- package/es/Tabs/utils/bound.js +0 -13
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { OverrideProps } from '@bifrostui/types';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* 滚动事件详情
|
|
5
|
+
*/
|
|
6
|
+
export interface ScrollViewScrollEvent extends Event {
|
|
4
7
|
detail?: {
|
|
5
8
|
scrollLeft: number;
|
|
6
9
|
scrollTop: number;
|
|
@@ -11,7 +14,10 @@ interface ScrollViewScrollEvent extends Event {
|
|
|
11
14
|
isDrag?: boolean;
|
|
12
15
|
};
|
|
13
16
|
}
|
|
14
|
-
|
|
17
|
+
/**
|
|
18
|
+
* 拖拽事件详情
|
|
19
|
+
*/
|
|
20
|
+
export interface ScrollViewDragEvent extends Event {
|
|
15
21
|
detail?: {
|
|
16
22
|
/** 横向滚动条位置 */
|
|
17
23
|
scrollLeft?: number;
|
|
@@ -21,175 +27,191 @@ interface ScrollViewDragEvent extends Event {
|
|
|
21
27
|
velocity?: number;
|
|
22
28
|
};
|
|
23
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* ScrollIntoView 对齐方式
|
|
32
|
+
*/
|
|
33
|
+
export type ScrollIntoViewAlignment = 'start' | 'center' | 'end' | 'nearest';
|
|
34
|
+
/**
|
|
35
|
+
* ScrollView 组件属性
|
|
36
|
+
*/
|
|
24
37
|
export type ScrollViewProps<D extends React.ElementType = 'div', P = {}> = OverrideProps<{
|
|
25
38
|
props: P & {
|
|
26
39
|
/**
|
|
27
40
|
* 允许横向滚动
|
|
28
41
|
* @default false
|
|
29
|
-
* @type {boolean}
|
|
30
42
|
*/
|
|
31
43
|
scrollX?: boolean;
|
|
32
44
|
/**
|
|
33
45
|
* 允许纵向滚动
|
|
34
46
|
* @default false
|
|
35
|
-
* @type {boolean}
|
|
36
47
|
*/
|
|
37
48
|
scrollY?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* 距顶部/左边多远时(单位px),触发 scrolltoupper 事件
|
|
40
|
-
* @default 50
|
|
41
|
-
* @type {number}
|
|
42
|
-
*/
|
|
43
|
-
upperThreshold?: number;
|
|
44
|
-
/**
|
|
45
|
-
* 距底部/右边多远时(单位px),触发 scrolltolower 事件
|
|
46
|
-
* @default 50
|
|
47
|
-
* @type {number}
|
|
48
|
-
*/
|
|
49
|
-
lowerThreshold?: number;
|
|
50
49
|
/**
|
|
51
50
|
* 设置竖向滚动条位置
|
|
52
|
-
* @type {number}
|
|
53
51
|
*/
|
|
54
52
|
scrollTop?: number;
|
|
55
53
|
/**
|
|
56
54
|
* 设置横向滚动条位置
|
|
57
|
-
* @type {number}
|
|
58
55
|
*/
|
|
59
56
|
scrollLeft?: number;
|
|
60
57
|
/**
|
|
61
|
-
*
|
|
62
|
-
* @type {string}
|
|
58
|
+
* 滚动到指定元素(元素id,不能以数字开头)
|
|
63
59
|
*/
|
|
64
60
|
scrollIntoView?: string;
|
|
61
|
+
/**
|
|
62
|
+
* 指定 scroll-into-view 目标节点在视口内的位置
|
|
63
|
+
* @default 'start'
|
|
64
|
+
*/
|
|
65
|
+
scrollIntoViewAlignment?: ScrollIntoViewAlignment;
|
|
65
66
|
/**
|
|
66
67
|
* 在设置滚动条位置时使用动画过渡
|
|
67
68
|
* @default false
|
|
68
|
-
* @type {boolean}
|
|
69
69
|
*/
|
|
70
70
|
scrollWithAnimation?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
*
|
|
73
|
-
* center - 目标节点显示在视口中间
|
|
74
|
-
* end - 目标节点显示在视口结束处
|
|
75
|
-
* nearest - 目标节点在就近的视口边缘显示,若节点已在视口内则不触发滚动
|
|
76
|
-
* @default 'start'
|
|
71
|
+
/**
|
|
72
|
+
* 当 scroll-with-animation设置为 true 时,可以设置 scroll-animation-duration 来控制动画的执行时间,单位 ms。
|
|
77
73
|
*/
|
|
78
|
-
|
|
74
|
+
scrollAnimationDuration?: number;
|
|
79
75
|
/**
|
|
80
76
|
* 滚动条返回顶部,只支持竖向
|
|
77
|
+
* 仅小程序可用
|
|
81
78
|
* @default false
|
|
82
|
-
* @type {boolean}
|
|
83
79
|
*/
|
|
84
80
|
enableBackToTop?: boolean;
|
|
85
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* 启用 flexbox 布局。开启后,当前节点声明了 `display: flex` 就会成为 flex container,并作用于其孩子节点。
|
|
86
83
|
* 仅小程序可用
|
|
87
84
|
* @default false
|
|
88
85
|
*/
|
|
89
86
|
enableFlex?: boolean;
|
|
90
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* 开启 scroll anchoring 特性,即控制滚动位置不随内容变化而抖动,仅在 iOS 下生效,安卓下可参考 CSS `overflow-anchor` 属性。
|
|
91
89
|
* 仅小程序可用
|
|
92
90
|
* @default false
|
|
93
91
|
*/
|
|
94
92
|
scrollAnchoring?: boolean;
|
|
95
|
-
/**
|
|
96
|
-
*
|
|
97
|
-
* @default false
|
|
98
|
-
*/
|
|
99
|
-
refresherEnabled?: boolean;
|
|
100
|
-
/** 设置自定义下拉刷新默认样式,支持设置 `black | white | none`, none 表示不使用默认样式
|
|
101
|
-
* 仅小程序可用
|
|
102
|
-
* @default 'black'
|
|
103
|
-
*/
|
|
104
|
-
refresherDefaultStyle?: string;
|
|
105
|
-
/** 设置自定义下拉刷新区域背景颜色
|
|
106
|
-
* 仅小程序可用
|
|
107
|
-
* @default '#FFF'
|
|
108
|
-
*/
|
|
109
|
-
refresherBackground?: string;
|
|
110
|
-
/** 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发
|
|
111
|
-
* 仅小程序可用
|
|
112
|
-
* @default false
|
|
113
|
-
*/
|
|
114
|
-
refresherTriggered?: boolean;
|
|
115
|
-
/** 启用 scroll-view 增强特性
|
|
93
|
+
/**
|
|
94
|
+
* 启用 scroll-view 增强特性
|
|
116
95
|
* 仅小程序可用
|
|
117
96
|
* @default false
|
|
118
97
|
*/
|
|
119
98
|
enhanced?: boolean;
|
|
120
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* iOS 下 scroll-view 边界弹性控制 (同时开启 enhanced 属性后生效)
|
|
121
101
|
* 仅小程序可用
|
|
122
102
|
* @default true
|
|
123
103
|
*/
|
|
124
104
|
bounces?: boolean;
|
|
125
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* 滚动条显隐控制 (同时开启 enhanced 属性后生效)
|
|
126
107
|
* 仅小程序可用
|
|
127
108
|
* @default true
|
|
128
109
|
*/
|
|
129
110
|
showScrollbar?: boolean;
|
|
130
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* 分页滑动效果 (同时开启 enhanced 属性后生效)
|
|
131
113
|
* 仅小程序可用
|
|
132
114
|
* @default false
|
|
133
115
|
*/
|
|
134
116
|
pagingEnabled?: boolean;
|
|
135
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* 滑动减速速率控制 (同时开启 enhanced 属性后生效)
|
|
136
119
|
* 仅小程序可用
|
|
137
120
|
* @default false
|
|
138
121
|
*/
|
|
139
122
|
fastDeceleration?: boolean;
|
|
140
|
-
/**
|
|
141
|
-
*
|
|
142
|
-
*/
|
|
143
|
-
scrollAnimationDuration?: number;
|
|
144
|
-
/** 纵向滚动时,当滚动到顶部或底部时,强制禁止触发页面滚动,仍然只触发 scroll-view 自身的滚动。
|
|
123
|
+
/**
|
|
124
|
+
* 纵向滚动时,当滚动到顶部或底部时,强制禁止触发页面滚动,仍然只触发 scroll-view 自身的滚动。
|
|
145
125
|
* 仅小程序可用
|
|
146
126
|
* @default false
|
|
147
127
|
*/
|
|
148
128
|
trapScroll?: string;
|
|
149
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* 发生滚动前,对滚动方向进行判断,当方向是顶部/左边时,如果值为always将始终禁止滚动,如果值为out-of-bounds 且当前已经滚动到顶部/左边,禁止滚动。
|
|
150
131
|
* 仅小程序可用
|
|
151
132
|
*/
|
|
152
133
|
disableLowerScroll?: string;
|
|
153
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* 发生滚动前,对滚动方向进行判断,当方向是底部/右边时,如果值为always将始终禁止滚动,如果值为out-of-bounds 且当前已经滚动到底部/右边,禁止滚动。
|
|
154
136
|
* 仅小程序可用
|
|
155
137
|
*/
|
|
156
138
|
disableUpperScroll?: string;
|
|
157
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* 无障碍访问,(属性)元素的额外描述
|
|
158
141
|
* 仅小程序可用
|
|
159
142
|
*/
|
|
160
143
|
ariaLabel?: string;
|
|
161
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* 开启 passive 特性,能优化一定的滚动性能
|
|
162
146
|
* 仅小程序可用
|
|
163
147
|
* @default false
|
|
164
148
|
*/
|
|
165
149
|
enablePassive?: string;
|
|
166
|
-
/**
|
|
150
|
+
/**
|
|
151
|
+
* 渲染模式
|
|
167
152
|
* list - 列表模式。只会渲染在屏节点,会根据直接子节点是否在屏来按需渲染,若只有一个直接子节点则性能会退化
|
|
168
153
|
* custom - 自定义模式。只会渲染在屏节点,子节点可以是 sticky-section list-view grid-view 等组件
|
|
169
154
|
* 仅小程序可用
|
|
170
155
|
* @default 'list'
|
|
171
156
|
*/
|
|
172
157
|
type?: 'list' | 'custom';
|
|
173
|
-
/**
|
|
158
|
+
/**
|
|
159
|
+
* 是否反向滚动。一般初始滚动位置是在顶部,反向滚动则是在底部。
|
|
174
160
|
* 仅小程序可用
|
|
175
161
|
* @default false
|
|
176
162
|
*/
|
|
177
163
|
reverse?: boolean;
|
|
178
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* 指定视口外渲染区域的距离,默认情况下视口外节点不渲染。指定 cache-extent 可优化滚动体验和加载速度,但会提高内存占用且影响首屏速度,可按需启用。
|
|
179
166
|
* 仅小程序可用
|
|
180
167
|
*/
|
|
181
168
|
cacheExtent?: number;
|
|
182
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* 只 scroll-into-view 到 cacheExtent 以内的目标节点,性能更佳
|
|
183
171
|
* 仅小程序可用
|
|
184
172
|
* @default false
|
|
185
173
|
*/
|
|
186
174
|
scrollIntoViewWithinExtent?: boolean;
|
|
187
175
|
/**
|
|
188
|
-
*
|
|
176
|
+
* 开启自定义下拉刷新
|
|
177
|
+
* 仅小程序可用
|
|
178
|
+
* @default false
|
|
179
|
+
*/
|
|
180
|
+
refresherEnabled?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* 设置自定义下拉刷新默认样式,支持设置 `black | white | none`, none 表示不使用默认样式
|
|
183
|
+
* 仅小程序可用
|
|
184
|
+
* @default 'black'
|
|
185
|
+
*/
|
|
186
|
+
refresherDefaultStyle?: string;
|
|
187
|
+
/**
|
|
188
|
+
* 设置自定义下拉刷新区域背景颜色
|
|
189
|
+
* 仅小程序可用
|
|
190
|
+
* @default '#FFF'
|
|
191
|
+
*/
|
|
192
|
+
refresherBackground?: string;
|
|
193
|
+
/**
|
|
194
|
+
* 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发
|
|
195
|
+
* 仅小程序可用
|
|
196
|
+
* @default false
|
|
197
|
+
*/
|
|
198
|
+
refresherTriggered?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* 距顶部/左边多远时(单位px),触发 onScrollToUpper 事件
|
|
201
|
+
* @default 50
|
|
202
|
+
*/
|
|
203
|
+
upperThreshold?: number;
|
|
204
|
+
/**
|
|
205
|
+
* 距底部/右边多远时(单位px),触发 onScrollToLower 事件
|
|
206
|
+
* @default 50
|
|
207
|
+
*/
|
|
208
|
+
lowerThreshold?: number;
|
|
209
|
+
/**
|
|
210
|
+
* 滚动到顶部/左边时触发
|
|
189
211
|
*/
|
|
190
212
|
onScrollToUpper?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void;
|
|
191
213
|
/**
|
|
192
|
-
*
|
|
214
|
+
* 滚动到底部/右边时触发
|
|
193
215
|
*/
|
|
194
216
|
onScrollToLower?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void;
|
|
195
217
|
/**
|
|
@@ -197,62 +219,74 @@ export type ScrollViewProps<D extends React.ElementType = 'div', P = {}> = Overr
|
|
|
197
219
|
*/
|
|
198
220
|
onScroll?: (e: React.SyntheticEvent<HTMLDivElement, ScrollViewScrollEvent>) => void;
|
|
199
221
|
/**
|
|
200
|
-
*
|
|
222
|
+
* 触摸移动时触发
|
|
201
223
|
*/
|
|
202
224
|
onTouchMove?: (e: React.SyntheticEvent<HTMLDivElement, TouchEvent>) => void;
|
|
203
|
-
/**
|
|
225
|
+
/**
|
|
226
|
+
* 滚动开始事件
|
|
204
227
|
* 仅小程序可用
|
|
205
228
|
*/
|
|
206
229
|
onScrollStart?: (e: React.SyntheticEvent<HTMLDivElement, ScrollViewScrollEvent>) => void;
|
|
207
|
-
/**
|
|
230
|
+
/**
|
|
231
|
+
* 滚动结束事件
|
|
208
232
|
* 仅小程序可用
|
|
209
233
|
*/
|
|
210
234
|
onScrollEnd?: (e: React.SyntheticEvent<HTMLDivElement, ScrollViewScrollEvent>) => void;
|
|
211
|
-
/**
|
|
235
|
+
/**
|
|
236
|
+
* 自定义下拉刷新控件被下拉
|
|
212
237
|
* 仅小程序可用
|
|
213
238
|
*/
|
|
214
239
|
onRefresherPulling?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void;
|
|
215
|
-
/**
|
|
240
|
+
/**
|
|
241
|
+
* 自定义下拉刷新被触发
|
|
216
242
|
* 仅小程序可用
|
|
217
243
|
*/
|
|
218
244
|
onRefresherRefresh?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void;
|
|
219
|
-
/**
|
|
245
|
+
/**
|
|
246
|
+
* 自定义下拉刷新被复位
|
|
220
247
|
* 仅小程序可用
|
|
221
248
|
*/
|
|
222
249
|
onRefresherRestore?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void;
|
|
223
|
-
/**
|
|
250
|
+
/**
|
|
251
|
+
* 自定义下拉刷新被中止
|
|
224
252
|
* 仅小程序可用
|
|
225
253
|
*/
|
|
226
254
|
onRefresherAbort?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void;
|
|
227
|
-
/**
|
|
255
|
+
/**
|
|
256
|
+
* 自定义下拉刷新即将触发刷新(拖动超过 refresher-threshold 时)的事件
|
|
228
257
|
* 仅小程序可用
|
|
229
258
|
*/
|
|
230
259
|
onRefresherWillRefresh?: (e: React.SyntheticEvent<HTMLDivElement, Event>) => void;
|
|
231
|
-
/**
|
|
260
|
+
/**
|
|
261
|
+
* 滑动开始事件 (同时开启 enhanced 属性后生效)
|
|
232
262
|
* 仅小程序可用
|
|
233
263
|
*/
|
|
234
264
|
onDragStart?: (e: React.SyntheticEvent<HTMLDivElement, ScrollViewDragEvent>) => void;
|
|
235
|
-
/**
|
|
265
|
+
/**
|
|
266
|
+
* 滑动事件 (同时开启 enhanced 属性后生效)
|
|
236
267
|
* 仅小程序可用
|
|
237
268
|
*/
|
|
238
269
|
onDragging?: (e: React.SyntheticEvent<HTMLDivElement, ScrollViewDragEvent>) => void;
|
|
239
|
-
/**
|
|
270
|
+
/**
|
|
271
|
+
* 滑动结束事件 (同时开启 enhanced 属性后生效)
|
|
240
272
|
* 仅小程序可用
|
|
241
273
|
*/
|
|
242
274
|
onDragEnd?: (e: React.SyntheticEvent<HTMLDivElement, ScrollViewDragEvent>) => void;
|
|
243
|
-
/**
|
|
275
|
+
/**
|
|
276
|
+
* 触摸动作开始。
|
|
244
277
|
* 仅小程序可用
|
|
245
278
|
*/
|
|
246
279
|
onTouchStart?: (e: React.SyntheticEvent<HTMLDivElement, TouchEvent>) => void;
|
|
247
|
-
/**
|
|
280
|
+
/**
|
|
281
|
+
* 触摸动作结束。
|
|
248
282
|
* 仅小程序可用
|
|
249
283
|
*/
|
|
250
284
|
onTouchEnd?: (e: React.SyntheticEvent<HTMLDivElement, TouchEvent>) => void;
|
|
251
|
-
/**
|
|
285
|
+
/**
|
|
286
|
+
* 触摸动作被打断,如来电提醒、弹窗。
|
|
252
287
|
* 仅小程序可用
|
|
253
288
|
*/
|
|
254
289
|
onTouchCancel?: (e: React.SyntheticEvent<HTMLDivElement, TouchEvent>) => void;
|
|
255
290
|
};
|
|
256
291
|
defaultComponent: D;
|
|
257
292
|
}, D>;
|
|
258
|
-
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const BasicScrollViewDemo: React.FC;
|
|
3
|
+
export declare const HorizontalScrollViewDemo: React.FC;
|
|
4
|
+
export declare const ScrollEventsDemo: React.FC;
|
|
5
|
+
export declare const ControlledScrollDemo: React.FC;
|
|
6
|
+
export declare const BidirectionalScrollDemo: React.FC;
|
|
7
|
+
export declare const ThresholdTestDemo: React.FC;
|