@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
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var A11yDemos_exports = {};
|
|
29
|
+
__export(A11yDemos_exports, {
|
|
30
|
+
accessibilityTooltipDemo: () => accessibilityTooltipDemo,
|
|
31
|
+
basicTooltipDemo: () => basicTooltipDemo,
|
|
32
|
+
complexContentTooltipDemo: () => complexContentTooltipDemo,
|
|
33
|
+
complexInteractionTooltipDemo: () => complexInteractionTooltipDemo,
|
|
34
|
+
default: () => A11yDemos_default,
|
|
35
|
+
edgeCaseTooltipDemo: () => edgeCaseTooltipDemo,
|
|
36
|
+
offsetTooltipDemo: () => offsetTooltipDemo,
|
|
37
|
+
placementTooltipDemo: () => placementTooltipDemo,
|
|
38
|
+
triggerTooltipDemo: () => triggerTooltipDemo
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(A11yDemos_exports);
|
|
41
|
+
var import_react = __toESM(require("react"));
|
|
42
|
+
var import_Tooltip = __toESM(require("../../Tooltip"));
|
|
43
|
+
const basicTooltipDemo = () => {
|
|
44
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u8FD9\u662F\u4E00\u4E2A\u57FA\u7840\u7684\u63D0\u793A\u6587\u672C" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u57FA\u7840Tooltip")));
|
|
45
|
+
};
|
|
46
|
+
const placementTooltipDemo = () => {
|
|
47
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", gap: "10px", flexWrap: "wrap" } }, /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u9876\u90E8\u63D0\u793A", placement: "top" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u9876\u90E8")), /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u53F3\u4FA7\u63D0\u793A", placement: "right" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u53F3\u4FA7")), /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u5E95\u90E8\u63D0\u793A", placement: "bottom" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u5E95\u90E8")), /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u5DE6\u4FA7\u63D0\u793A", placement: "left" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u5DE6\u4FA7")));
|
|
48
|
+
};
|
|
49
|
+
const triggerTooltipDemo = () => {
|
|
50
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u70B9\u51FB\u89E6\u53D1\u7684\u63D0\u793A", trigger: "click" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u70B9\u51FB\u89E6\u53D1")), /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u60AC\u505C\u89E6\u53D1\u7684\u63D0\u793A", trigger: "hover" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u60AC\u505C\u89E6\u53D1")));
|
|
51
|
+
};
|
|
52
|
+
const accessibilityTooltipDemo = () => {
|
|
53
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", gap: "10px", flexDirection: "column" } }, /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u81EA\u5B9A\u4E49\u89D2\u8272\u7684\u63D0\u793A", role: "status", "aria-label": "\u72B6\u6001\u63D0\u793A" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u72B6\u6001\u63D0\u793A")), /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u652F\u6301Escape\u952E\u5173\u95ED", closeOnEscape: true, trigger: "click" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "Escape\u952E\u5173\u95ED")));
|
|
54
|
+
};
|
|
55
|
+
const complexInteractionTooltipDemo = () => {
|
|
56
|
+
const ComplexInteractionTooltipDemo = () => {
|
|
57
|
+
const [open, setOpen] = import_react.default.useState(false);
|
|
58
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", gap: "10px", alignItems: "center" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
59
|
+
import_Tooltip.default,
|
|
60
|
+
{
|
|
61
|
+
title: "\u53D7\u63A7\u6A21\u5F0F\u7684\u63D0\u793A",
|
|
62
|
+
open,
|
|
63
|
+
onOpenChange: (_, data) => setOpen(data.open)
|
|
64
|
+
},
|
|
65
|
+
/* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u53D7\u63A7Tooltip")
|
|
66
|
+
), /* @__PURE__ */ import_react.default.createElement("button", { type: "button", onClick: () => setOpen(!open) }, "\u5916\u90E8\u63A7\u5236: ", open ? "\u5173\u95ED" : "\u6253\u5F00"));
|
|
67
|
+
};
|
|
68
|
+
return /* @__PURE__ */ import_react.default.createElement(ComplexInteractionTooltipDemo, null);
|
|
69
|
+
};
|
|
70
|
+
const complexContentTooltipDemo = () => {
|
|
71
|
+
const ComplexContent = () => /* @__PURE__ */ import_react.default.createElement("div", { style: { maxWidth: "200px" } }, /* @__PURE__ */ import_react.default.createElement("h4", { style: { margin: "0 0 8px 0", fontSize: "14px" } }, "\u590D\u6742\u5185\u5BB9"), /* @__PURE__ */ import_react.default.createElement("p", { style: { margin: "0 0 8px 0", fontSize: "12px" } }, "\u8FD9\u662F\u4E00\u4E2A\u5305\u542B\u591A\u79CD\u5143\u7D20\u7684\u590D\u6742\u63D0\u793A\u5185\u5BB9\u3002"), /* @__PURE__ */ import_react.default.createElement("ul", { style: { margin: 0, fontSize: "12px", paddingLeft: "16px" } }, /* @__PURE__ */ import_react.default.createElement("li", null, "\u9879\u76EE\u4E00"), /* @__PURE__ */ import_react.default.createElement("li", null, "\u9879\u76EE\u4E8C")));
|
|
72
|
+
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: /* @__PURE__ */ import_react.default.createElement(ComplexContent, null) }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u590D\u6742\u5185\u5BB9Tooltip")));
|
|
73
|
+
};
|
|
74
|
+
const offsetTooltipDemo = () => {
|
|
75
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", gap: "10px" } }, /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u65E0\u504F\u79FB", offset: 0 }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u65E0\u504F\u79FB")), /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u504F\u79FB10px", offset: 10 }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u504F\u79FB10px")), /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u504F\u79FB20px", offset: 20 }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u504F\u79FB20px")));
|
|
76
|
+
};
|
|
77
|
+
const edgeCaseTooltipDemo = () => {
|
|
78
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: { display: "flex", gap: "10px", flexDirection: "column" } }, /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u7A7A\u5185\u5BB9")), /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: "\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u5F88\u957F\u7684\u63D0\u793A\u6587\u672C\u5185\u5BB9" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u957F\u6587\u672C")), /* @__PURE__ */ import_react.default.createElement(import_Tooltip.default, { title: `\u7279\u6B8A\u5B57\u7B26 !@#$%^&*()_+-=[]{}|;':",./` }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button" }, "\u7279\u6B8A\u5B57\u7B26")));
|
|
79
|
+
};
|
|
80
|
+
var A11yDemos_default = {
|
|
81
|
+
basicTooltipDemo,
|
|
82
|
+
placementTooltipDemo,
|
|
83
|
+
triggerTooltipDemo,
|
|
84
|
+
accessibilityTooltipDemo,
|
|
85
|
+
complexInteractionTooltipDemo,
|
|
86
|
+
complexContentTooltipDemo,
|
|
87
|
+
offsetTooltipDemo,
|
|
88
|
+
edgeCaseTooltipDemo
|
|
89
|
+
};
|
|
90
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
+
0 && (module.exports = {
|
|
92
|
+
accessibilityTooltipDemo,
|
|
93
|
+
basicTooltipDemo,
|
|
94
|
+
complexContentTooltipDemo,
|
|
95
|
+
complexInteractionTooltipDemo,
|
|
96
|
+
edgeCaseTooltipDemo,
|
|
97
|
+
offsetTooltipDemo,
|
|
98
|
+
placementTooltipDemo,
|
|
99
|
+
triggerTooltipDemo
|
|
100
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipProps } from './Tooltip.types';
|
|
3
|
+
export interface UseTooltipParameters {
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
offset?: number;
|
|
8
|
+
placement?: TooltipProps['placement'];
|
|
9
|
+
trigger?: TooltipProps['trigger'];
|
|
10
|
+
onOpenChange?: TooltipProps['onOpenChange'];
|
|
11
|
+
autoFocus?: boolean;
|
|
12
|
+
closeOnEscape?: boolean;
|
|
13
|
+
children: React.ReactElement;
|
|
14
|
+
rootRef?: React.Ref<HTMLElement>;
|
|
15
|
+
}
|
|
16
|
+
export interface UseTooltipReturnValue {
|
|
17
|
+
getTooltipProps: (otherProps?: Record<string, unknown>) => Record<string, unknown>;
|
|
18
|
+
getChildProps: () => Record<string, unknown>;
|
|
19
|
+
getPortalProps: () => {
|
|
20
|
+
onMounted: () => void;
|
|
21
|
+
};
|
|
22
|
+
tooltipRef: React.RefCallback<HTMLElement>;
|
|
23
|
+
isOpen: boolean;
|
|
24
|
+
toolStyles: React.CSSProperties;
|
|
25
|
+
arrowDirection: string;
|
|
26
|
+
arrowLocation: string;
|
|
27
|
+
tooltipId: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function useTooltip(parameters: UseTooltipParameters): UseTooltipReturnValue;
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __export = (target, all) => {
|
|
25
|
+
for (var name in all)
|
|
26
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
27
|
+
};
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
33
|
+
}
|
|
34
|
+
return to;
|
|
35
|
+
};
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
37
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
38
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
39
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
40
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
41
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
42
|
+
mod
|
|
43
|
+
));
|
|
44
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
|
+
var __async = (__this, __arguments, generator) => {
|
|
46
|
+
return new Promise((resolve, reject) => {
|
|
47
|
+
var fulfilled = (value) => {
|
|
48
|
+
try {
|
|
49
|
+
step(generator.next(value));
|
|
50
|
+
} catch (e) {
|
|
51
|
+
reject(e);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var rejected = (value) => {
|
|
55
|
+
try {
|
|
56
|
+
step(generator.throw(value));
|
|
57
|
+
} catch (e) {
|
|
58
|
+
reject(e);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
62
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
var useTooltip_exports = {};
|
|
66
|
+
__export(useTooltip_exports, {
|
|
67
|
+
useTooltip: () => useTooltip
|
|
68
|
+
});
|
|
69
|
+
module.exports = __toCommonJS(useTooltip_exports);
|
|
70
|
+
var import_react = __toESM(require("react"));
|
|
71
|
+
var import_utils = require("@bifrostui/utils");
|
|
72
|
+
function useTooltip(parameters) {
|
|
73
|
+
const {
|
|
74
|
+
defaultOpen = false,
|
|
75
|
+
open,
|
|
76
|
+
offset,
|
|
77
|
+
placement = "top",
|
|
78
|
+
trigger = "click",
|
|
79
|
+
onOpenChange,
|
|
80
|
+
autoFocus = false,
|
|
81
|
+
closeOnEscape = false,
|
|
82
|
+
children,
|
|
83
|
+
rootRef
|
|
84
|
+
} = parameters;
|
|
85
|
+
const controlByUser = typeof open !== "undefined";
|
|
86
|
+
const { direction, location = "center" } = (0, import_utils.parsePlacement)(placement);
|
|
87
|
+
const childrenRef = (0, import_react.useRef)();
|
|
88
|
+
const [openStatus, setOpenStatus] = (0, import_react.useState)(defaultOpen);
|
|
89
|
+
const [arrowDirection, setArrowDirection] = (0, import_react.useState)(direction);
|
|
90
|
+
const [arrowLocation, setArrowLocation] = (0, import_react.useState)(location);
|
|
91
|
+
const [toolStyles, setToolStyles] = (0, import_react.useState)({});
|
|
92
|
+
const tipRef = (0, import_react.useRef)(null);
|
|
93
|
+
const tooltipId = (0, import_utils.useUniqueId)();
|
|
94
|
+
(0, import_react.useEffect)(() => {
|
|
95
|
+
setArrowDirection(direction);
|
|
96
|
+
setArrowLocation(location);
|
|
97
|
+
}, [direction, location]);
|
|
98
|
+
const isOpen = open || openStatus;
|
|
99
|
+
const clearRef = (status) => {
|
|
100
|
+
if (status === false) {
|
|
101
|
+
tipRef.current = null;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const changeOpenStatus = (event, status) => {
|
|
105
|
+
if (controlByUser)
|
|
106
|
+
return;
|
|
107
|
+
clearRef(status);
|
|
108
|
+
setOpenStatus(status);
|
|
109
|
+
onOpenChange == null ? void 0 : onOpenChange(event, { open: status });
|
|
110
|
+
};
|
|
111
|
+
const triggerClick = (event) => {
|
|
112
|
+
event.stopPropagation();
|
|
113
|
+
const targetStatus = !openStatus;
|
|
114
|
+
changeOpenStatus(event, targetStatus);
|
|
115
|
+
};
|
|
116
|
+
const hideTooltip = (event) => {
|
|
117
|
+
changeOpenStatus(event, false);
|
|
118
|
+
};
|
|
119
|
+
const showTooltip = (event) => {
|
|
120
|
+
changeOpenStatus(event, true);
|
|
121
|
+
};
|
|
122
|
+
const handleKeyDown = (0, import_react.useCallback)(
|
|
123
|
+
(event) => {
|
|
124
|
+
if (closeOnEscape && event.key === "Escape" && isOpen) {
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
event.stopPropagation();
|
|
127
|
+
hideTooltip(event);
|
|
128
|
+
if (childrenRef.current && "focus" in childrenRef.current) {
|
|
129
|
+
childrenRef.current.focus();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
[closeOnEscape, isOpen, hideTooltip]
|
|
134
|
+
);
|
|
135
|
+
(0, import_react.useEffect)(() => {
|
|
136
|
+
if (isOpen && autoFocus && tipRef.current) {
|
|
137
|
+
const timer = setTimeout(() => {
|
|
138
|
+
if (tipRef.current && "focus" in tipRef.current) {
|
|
139
|
+
tipRef.current.focus();
|
|
140
|
+
}
|
|
141
|
+
}, 0);
|
|
142
|
+
return () => clearTimeout(timer);
|
|
143
|
+
}
|
|
144
|
+
return void 0;
|
|
145
|
+
}, [isOpen, autoFocus]);
|
|
146
|
+
(0, import_react.useEffect)(() => {
|
|
147
|
+
if (!controlByUser)
|
|
148
|
+
return;
|
|
149
|
+
setOpenStatus(open != null ? open : false);
|
|
150
|
+
clearRef(open != null ? open : false);
|
|
151
|
+
}, [open, controlByUser]);
|
|
152
|
+
(0, import_react.useEffect)(() => {
|
|
153
|
+
if (!openStatus) {
|
|
154
|
+
setToolStyles({
|
|
155
|
+
visibility: "hidden"
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}, [openStatus]);
|
|
159
|
+
const shouldListenGlobalClick = (0, import_react.useCallback)(() => {
|
|
160
|
+
if (typeof trigger === "string") {
|
|
161
|
+
return trigger === "click";
|
|
162
|
+
}
|
|
163
|
+
if (Array.isArray(trigger)) {
|
|
164
|
+
return trigger.includes("click");
|
|
165
|
+
}
|
|
166
|
+
return true;
|
|
167
|
+
}, [trigger]);
|
|
168
|
+
const clickEventHandler = (0, import_react.useCallback)(
|
|
169
|
+
(event) => {
|
|
170
|
+
if (!shouldListenGlobalClick()) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
hideTooltip(event);
|
|
174
|
+
},
|
|
175
|
+
[shouldListenGlobalClick, hideTooltip]
|
|
176
|
+
);
|
|
177
|
+
const onMounted = (0, import_utils.throttle)(() => __async(this, null, function* () {
|
|
178
|
+
if (!tipRef.current)
|
|
179
|
+
return;
|
|
180
|
+
const {
|
|
181
|
+
direction: newParsedDirection,
|
|
182
|
+
location: newParsedLocation = "center"
|
|
183
|
+
} = (0, import_utils.parsePlacement)(placement);
|
|
184
|
+
const result = yield (0, import_utils.getStylesAndLocation)({
|
|
185
|
+
childrenRef,
|
|
186
|
+
arrowDirection: newParsedDirection,
|
|
187
|
+
arrowLocation: newParsedLocation,
|
|
188
|
+
offsetSpacing: offset || 0,
|
|
189
|
+
tipRef
|
|
190
|
+
});
|
|
191
|
+
if (!result)
|
|
192
|
+
return;
|
|
193
|
+
const { styles, newArrowDirection, newArrowLocation } = result;
|
|
194
|
+
if (newArrowDirection !== arrowDirection) {
|
|
195
|
+
setArrowDirection(newArrowDirection);
|
|
196
|
+
}
|
|
197
|
+
if (newArrowLocation !== arrowLocation) {
|
|
198
|
+
setArrowLocation(newArrowLocation);
|
|
199
|
+
}
|
|
200
|
+
setToolStyles(styles);
|
|
201
|
+
}), 100);
|
|
202
|
+
(0, import_react.useEffect)(() => {
|
|
203
|
+
const bindEvent = () => {
|
|
204
|
+
if (!openStatus)
|
|
205
|
+
return;
|
|
206
|
+
if (!controlByUser && shouldListenGlobalClick() && !import_utils.isMini) {
|
|
207
|
+
document.addEventListener("click", clickEventHandler);
|
|
208
|
+
}
|
|
209
|
+
if (!import_utils.isMini) {
|
|
210
|
+
window.addEventListener("resize", onMounted);
|
|
211
|
+
}
|
|
212
|
+
if (isOpen && !import_utils.isMini) {
|
|
213
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
const unbindEvent = () => {
|
|
217
|
+
if (!controlByUser && shouldListenGlobalClick() && !import_utils.isMini) {
|
|
218
|
+
document.removeEventListener("click", clickEventHandler);
|
|
219
|
+
}
|
|
220
|
+
if (!import_utils.isMini) {
|
|
221
|
+
window.removeEventListener("resize", onMounted);
|
|
222
|
+
}
|
|
223
|
+
if (!import_utils.isMini) {
|
|
224
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
bindEvent();
|
|
228
|
+
return () => {
|
|
229
|
+
unbindEvent();
|
|
230
|
+
};
|
|
231
|
+
}, [
|
|
232
|
+
openStatus,
|
|
233
|
+
controlByUser,
|
|
234
|
+
shouldListenGlobalClick,
|
|
235
|
+
clickEventHandler,
|
|
236
|
+
onMounted,
|
|
237
|
+
isOpen,
|
|
238
|
+
handleKeyDown
|
|
239
|
+
]);
|
|
240
|
+
const tooltipRef = (0, import_utils.useForkRef)(tipRef, rootRef);
|
|
241
|
+
const getTooltipProps = (0, import_react.useCallback)(
|
|
242
|
+
(otherProps = {}) => {
|
|
243
|
+
return __spreadValues({
|
|
244
|
+
id: tooltipId,
|
|
245
|
+
ref: tooltipRef,
|
|
246
|
+
tabIndex: autoFocus ? -1 : void 0
|
|
247
|
+
}, otherProps);
|
|
248
|
+
},
|
|
249
|
+
[tooltipId, tooltipRef, autoFocus]
|
|
250
|
+
);
|
|
251
|
+
const getChildProps = (0, import_react.useCallback)(() => {
|
|
252
|
+
var _a;
|
|
253
|
+
let triggerEventOption = {};
|
|
254
|
+
if (!controlByUser) {
|
|
255
|
+
triggerEventOption = (0, import_utils.triggerEventTransform)({
|
|
256
|
+
trigger,
|
|
257
|
+
click: triggerClick,
|
|
258
|
+
show: showTooltip,
|
|
259
|
+
hide: hideTooltip
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
const childProps = __spreadProps(__spreadValues({
|
|
263
|
+
ref: childrenRef
|
|
264
|
+
}, triggerEventOption), {
|
|
265
|
+
"aria-describedby": isOpen ? tooltipId : void 0
|
|
266
|
+
});
|
|
267
|
+
if (import_react.default.isValidElement(children)) {
|
|
268
|
+
const elementType = typeof children.type === "string" ? children.type : ((_a = children.type) == null ? void 0 : _a.displayName) || "";
|
|
269
|
+
const interactiveElements = [
|
|
270
|
+
"button",
|
|
271
|
+
"a",
|
|
272
|
+
"input",
|
|
273
|
+
"select",
|
|
274
|
+
"textarea"
|
|
275
|
+
];
|
|
276
|
+
const childElementProps = children.props;
|
|
277
|
+
const isInteractive = interactiveElements.includes(elementType.toLowerCase()) || (childElementProps == null ? void 0 : childElementProps.role) === "button" || (childElementProps == null ? void 0 : childElementProps.role) === "menuitem" || (childElementProps == null ? void 0 : childElementProps.role) === "tab" || (childElementProps == null ? void 0 : childElementProps.tabIndex) !== void 0;
|
|
278
|
+
if (isInteractive) {
|
|
279
|
+
childProps["aria-expanded"] = isOpen;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return childProps;
|
|
283
|
+
}, [
|
|
284
|
+
controlByUser,
|
|
285
|
+
trigger,
|
|
286
|
+
triggerClick,
|
|
287
|
+
showTooltip,
|
|
288
|
+
hideTooltip,
|
|
289
|
+
isOpen,
|
|
290
|
+
tooltipId,
|
|
291
|
+
children
|
|
292
|
+
]);
|
|
293
|
+
const getPortalProps = (0, import_react.useCallback)(() => {
|
|
294
|
+
return {
|
|
295
|
+
onMounted
|
|
296
|
+
};
|
|
297
|
+
}, [onMounted]);
|
|
298
|
+
return {
|
|
299
|
+
getTooltipProps,
|
|
300
|
+
getChildProps,
|
|
301
|
+
getPortalProps,
|
|
302
|
+
tooltipRef,
|
|
303
|
+
isOpen,
|
|
304
|
+
toolStyles,
|
|
305
|
+
arrowDirection,
|
|
306
|
+
arrowLocation,
|
|
307
|
+
tooltipId
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
311
|
+
0 && (module.exports = {
|
|
312
|
+
useTooltip
|
|
313
|
+
});
|
|
@@ -92,7 +92,7 @@ const TransitionCore = (0, import_react.forwardRef)(
|
|
|
92
92
|
enter = true,
|
|
93
93
|
exit = true,
|
|
94
94
|
timeout: _timeout,
|
|
95
|
-
delay: _delay,
|
|
95
|
+
delay: _delay = 0,
|
|
96
96
|
onEnter,
|
|
97
97
|
onEntering,
|
|
98
98
|
onEntered,
|
|
@@ -130,13 +130,16 @@ const TransitionCore = (0, import_react.forwardRef)(
|
|
|
130
130
|
});
|
|
131
131
|
const innerNodeRef = (0, import_react.useRef)();
|
|
132
132
|
const nodeRef = (0, import_utils.useForkRef)(innerNodeRef, ref);
|
|
133
|
-
const timeout = typeof _timeout === "object" ? __spreadValues({}, _timeout) : { enter: _timeout, exit: _timeout };
|
|
134
|
-
const delay = typeof _delay === "object" ? _delay : { enter: _delay, exit: _delay };
|
|
135
|
-
timeout.enter
|
|
136
|
-
|
|
133
|
+
const timeout = typeof _timeout === "object" ? __spreadValues({}, _timeout) : { enter: _timeout, exit: _timeout, appear: _timeout };
|
|
134
|
+
const delay = typeof _delay === "object" ? _delay : { enter: _delay, exit: _delay, appear: _delay };
|
|
135
|
+
if (timeout.enter !== void 0)
|
|
136
|
+
timeout.enter += delay.enter || 0;
|
|
137
|
+
if (timeout.exit !== void 0)
|
|
138
|
+
timeout.exit += delay.exit || 0;
|
|
139
|
+
if (timeout.appear !== void 0)
|
|
140
|
+
timeout.appear += delay.appear || 0;
|
|
137
141
|
const nextCallback = (0, import_react.useRef)(null);
|
|
138
142
|
const appearStatus = (0, import_react.useRef)(inProp && appear ? ENTERING : null);
|
|
139
|
-
const isFirstRender = (0, import_react.useRef)(false);
|
|
140
143
|
const cancelNextCallback = () => {
|
|
141
144
|
var _a2;
|
|
142
145
|
if (nextCallback.current !== null) {
|
|
@@ -173,8 +176,8 @@ const TransitionCore = (0, import_react.forwardRef)(
|
|
|
173
176
|
(_a2 = nextCallback == null ? void 0 : nextCallback.current) == null ? void 0 : _a2.call(nextCallback);
|
|
174
177
|
});
|
|
175
178
|
};
|
|
176
|
-
const performEnter = () => __async(void 0, null, function* () {
|
|
177
|
-
if (!enter) {
|
|
179
|
+
const performEnter = (mounting) => __async(void 0, null, function* () {
|
|
180
|
+
if (!enter && !mounting) {
|
|
178
181
|
safeSetState(ENTERED, () => __async(void 0, null, function* () {
|
|
179
182
|
yield onEntered == null ? void 0 : onEntered(innerNodeRef == null ? void 0 : innerNodeRef.current);
|
|
180
183
|
}));
|
|
@@ -193,7 +196,9 @@ const TransitionCore = (0, import_react.forwardRef)(
|
|
|
193
196
|
});
|
|
194
197
|
const performExit = () => __async(void 0, null, function* () {
|
|
195
198
|
if (!exit) {
|
|
196
|
-
safeSetState(
|
|
199
|
+
safeSetState(EXITED, () => __async(void 0, null, function* () {
|
|
200
|
+
if (unmountOnExit)
|
|
201
|
+
setStatus(UNMOUNTED);
|
|
197
202
|
yield onExited == null ? void 0 : onExited(innerNodeRef == null ? void 0 : innerNodeRef.current);
|
|
198
203
|
}));
|
|
199
204
|
return;
|
|
@@ -202,34 +207,34 @@ const TransitionCore = (0, import_react.forwardRef)(
|
|
|
202
207
|
safeSetState(EXITING, () => __async(void 0, null, function* () {
|
|
203
208
|
yield onExiting == null ? void 0 : onExiting(innerNodeRef == null ? void 0 : innerNodeRef.current);
|
|
204
209
|
onTransitionEnd(timeout.exit, () => {
|
|
205
|
-
safeSetState(
|
|
210
|
+
safeSetState(EXITED, () => __async(void 0, null, function* () {
|
|
211
|
+
if (unmountOnExit)
|
|
212
|
+
setStatus(UNMOUNTED);
|
|
206
213
|
yield onExited == null ? void 0 : onExited(innerNodeRef == null ? void 0 : innerNodeRef.current);
|
|
207
214
|
}));
|
|
208
215
|
});
|
|
209
216
|
}));
|
|
210
217
|
});
|
|
211
|
-
const updateStatus = (nextStatus) => {
|
|
218
|
+
const updateStatus = (nextStatus, mounting) => {
|
|
212
219
|
if (nextStatus !== null) {
|
|
213
220
|
cancelNextCallback();
|
|
214
221
|
if (nextStatus === ENTERING) {
|
|
215
|
-
|
|
222
|
+
if (unmountOnExit || mountOnEnter) {
|
|
223
|
+
forceReflow(innerNodeRef == null ? void 0 : innerNodeRef.current);
|
|
224
|
+
}
|
|
225
|
+
performEnter(mounting);
|
|
216
226
|
} else if (nextStatus === EXITING) {
|
|
217
227
|
performExit();
|
|
218
228
|
}
|
|
219
229
|
}
|
|
220
230
|
};
|
|
221
231
|
(0, import_react.useEffect)(() => {
|
|
222
|
-
nextTick(() => updateStatus(appearStatus.current));
|
|
232
|
+
nextTick(() => updateStatus(appearStatus.current, true));
|
|
223
233
|
return () => {
|
|
224
234
|
cancelNextCallback();
|
|
225
235
|
};
|
|
226
236
|
}, []);
|
|
227
|
-
(0,
|
|
228
|
-
const isMounted = status !== UNMOUNTED;
|
|
229
|
-
if (!isFirstRender.current) {
|
|
230
|
-
isFirstRender.current = true;
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
237
|
+
(0, import_utils.useDidMountEffect)(() => {
|
|
233
238
|
let nextStatus = null;
|
|
234
239
|
if (inProp) {
|
|
235
240
|
if (status !== ENTERING && status !== ENTERED) {
|
|
@@ -238,13 +243,13 @@ const TransitionCore = (0, import_react.forwardRef)(
|
|
|
238
243
|
} else if (status === ENTERING || status === ENTERED) {
|
|
239
244
|
nextStatus = EXITING;
|
|
240
245
|
}
|
|
241
|
-
if (
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
safeSetState(inProp ? "EXITED" : "ENTERED", () => {
|
|
245
|
-
forceReflow(innerNodeRef == null ? void 0 : innerNodeRef.current);
|
|
246
|
-
updateStatus(nextStatus);
|
|
246
|
+
if (inProp && status === UNMOUNTED) {
|
|
247
|
+
safeSetState(EXITED, () => {
|
|
248
|
+
updateStatus(nextStatus, false);
|
|
247
249
|
});
|
|
250
|
+
} else {
|
|
251
|
+
updateStatus(nextStatus, false);
|
|
252
|
+
}
|
|
248
253
|
}, [inProp]);
|
|
249
254
|
if (status === UNMOUNTED)
|
|
250
255
|
return null;
|