react-vant-nova 1.0.0-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -0
- package/bundle/index.css +6711 -0
- package/bundle/index.min.css +1 -0
- package/bundle/react-vant-nova.es.js +14636 -0
- package/bundle/react-vant-nova.js +25073 -0
- package/bundle/react-vant-nova.min.js +3 -0
- package/es/action-bar/ActionBar.d.ts +4 -0
- package/es/action-bar/ActionBar.js +32 -0
- package/es/action-bar/ActionBarButton.d.ts +6 -0
- package/es/action-bar/ActionBarButton.js +55 -0
- package/es/action-bar/ActionBarContext.d.ts +6 -0
- package/es/action-bar/ActionBarContext.js +3 -0
- package/es/action-bar/ActionBarIcon.d.ts +4 -0
- package/es/action-bar/ActionBarIcon.js +31 -0
- package/es/action-bar/PropsType.d.ts +34 -0
- package/es/action-bar/PropsType.js +1 -0
- package/es/action-bar/index.d.ts +11 -0
- package/es/action-bar/index.js +10 -0
- package/es/action-bar/style/index.css +76 -0
- package/es/action-bar/style/var.css +0 -0
- package/es/action-sheet/ActionSheet.d.ts +4 -0
- package/es/action-sheet/ActionSheet.js +136 -0
- package/es/action-sheet/PropsType.d.ts +38 -0
- package/es/action-sheet/PropsType.js +1 -0
- package/es/action-sheet/index.d.ts +5 -0
- package/es/action-sheet/index.js +4 -0
- package/es/action-sheet/style/index.css +126 -0
- package/es/action-sheet/style/var.css +0 -0
- package/es/area/Area.d.ts +4 -0
- package/es/area/Area.js +73 -0
- package/es/area/PropsType.d.ts +30 -0
- package/es/area/PropsType.js +1 -0
- package/es/area/index.d.ts +4 -0
- package/es/area/index.js +3 -0
- package/es/badge/Badge.d.ts +4 -0
- package/es/badge/Badge.js +84 -0
- package/es/badge/PropsType.d.ts +28 -0
- package/es/badge/PropsType.js +1 -0
- package/es/badge/index.d.ts +5 -0
- package/es/badge/index.js +4 -0
- package/es/badge/style/index.css +45 -0
- package/es/badge/style/var.css +0 -0
- package/es/button/Button.d.ts +4 -0
- package/es/button/Button.js +134 -0
- package/es/button/ButtonContext.d.ts +7 -0
- package/es/button/ButtonContext.js +3 -0
- package/es/button/ButtonGroup.d.ts +4 -0
- package/es/button/ButtonGroup.js +38 -0
- package/es/button/PropsType.d.ts +67 -0
- package/es/button/PropsType.js +1 -0
- package/es/button/index.d.ts +8 -0
- package/es/button/index.js +8 -0
- package/es/button/style/index.css +242 -0
- package/es/button/style/var.css +0 -0
- package/es/calendar/Calendar.d.ts +4 -0
- package/es/calendar/Calendar.js +488 -0
- package/es/calendar/CalendarDay.d.ts +4 -0
- package/es/calendar/CalendarDay.js +126 -0
- package/es/calendar/CalendarHeader.d.ts +4 -0
- package/es/calendar/CalendarHeader.js +63 -0
- package/es/calendar/CalendarMonth.d.ts +4 -0
- package/es/calendar/CalendarMonth.js +202 -0
- package/es/calendar/PropsType.d.ts +118 -0
- package/es/calendar/PropsType.js +1 -0
- package/es/calendar/index.d.ts +5 -0
- package/es/calendar/index.js +4 -0
- package/es/calendar/style/index.css +186 -0
- package/es/calendar/style/var.css +0 -0
- package/es/calendar/utils.d.ts +10 -0
- package/es/calendar/utils.js +42 -0
- package/es/card/Card.d.ts +8 -0
- package/es/card/Card.js +79 -0
- package/es/card/PropsType.d.ts +34 -0
- package/es/card/PropsType.js +1 -0
- package/es/card/index.d.ts +10 -0
- package/es/card/index.js +10 -0
- package/es/card/style/index.css +68 -0
- package/es/card/style/var.css +0 -0
- package/es/cascader/Cascader.d.ts +5 -0
- package/es/cascader/Cascader.js +282 -0
- package/es/cascader/PropsType.d.ts +68 -0
- package/es/cascader/PropsType.js +1 -0
- package/es/cascader/index.d.ts +5 -0
- package/es/cascader/index.js +4 -0
- package/es/cascader/style/index.css +90 -0
- package/es/cascader/style/var.css +0 -0
- package/es/cascader/useCascaderExtend.d.ts +12 -0
- package/es/cascader/useCascaderExtend.js +45 -0
- package/es/cell/Cell.d.ts +4 -0
- package/es/cell/Cell.js +107 -0
- package/es/cell/CellGroup.d.ts +4 -0
- package/es/cell/CellGroup.js +42 -0
- package/es/cell/PropsType.d.ts +53 -0
- package/es/cell/PropsType.js +1 -0
- package/es/cell/index.d.ts +9 -0
- package/es/cell/index.js +8 -0
- package/es/cell/style/index.css +140 -0
- package/es/cell/style/var.css +0 -0
- package/es/checkbox/Checkbox.d.ts +4 -0
- package/es/checkbox/Checkbox.js +80 -0
- package/es/checkbox/CheckboxContext.d.ts +11 -0
- package/es/checkbox/CheckboxContext.js +3 -0
- package/es/checkbox/CheckboxGroup.d.ts +4 -0
- package/es/checkbox/CheckboxGroup.js +68 -0
- package/es/checkbox/Checker.d.ts +4 -0
- package/es/checkbox/Checker.js +97 -0
- package/es/checkbox/PropsType.d.ts +96 -0
- package/es/checkbox/PropsType.js +1 -0
- package/es/checkbox/index.d.ts +9 -0
- package/es/checkbox/index.js +8 -0
- package/es/checkbox/style/index.css +84 -0
- package/es/checkbox/style/var.css +0 -0
- package/es/circle/Circle.d.ts +4 -0
- package/es/circle/Circle.js +156 -0
- package/es/circle/PropsType.d.ts +30 -0
- package/es/circle/PropsType.js +1 -0
- package/es/circle/index.d.ts +5 -0
- package/es/circle/index.js +4 -0
- package/es/circle/style/index.css +44 -0
- package/es/circle/style/var.css +0 -0
- package/es/collapse/Collapse.d.ts +4 -0
- package/es/collapse/Collapse.js +88 -0
- package/es/collapse/CollapseContext.d.ts +7 -0
- package/es/collapse/CollapseContext.js +3 -0
- package/es/collapse/CollapseItem.d.ts +4 -0
- package/es/collapse/CollapseItem.js +125 -0
- package/es/collapse/PropsType.d.ts +31 -0
- package/es/collapse/PropsType.js +1 -0
- package/es/collapse/index.d.ts +9 -0
- package/es/collapse/index.js +8 -0
- package/es/collapse/style/index.css +59 -0
- package/es/collapse/style/var.css +0 -0
- package/es/config-provider/ConfigProvider.d.ts +4 -0
- package/es/config-provider/ConfigProvider.js +47 -0
- package/es/config-provider/ConfigProviderContext.d.ts +8 -0
- package/es/config-provider/ConfigProviderContext.js +9 -0
- package/es/config-provider/PropsType.d.ts +14 -0
- package/es/config-provider/PropsType.js +1 -0
- package/es/config-provider/index.d.ts +3 -0
- package/es/config-provider/index.js +2 -0
- package/es/count-down/CountDown.d.ts +4 -0
- package/es/count-down/CountDown.js +53 -0
- package/es/count-down/PropsType.d.ts +38 -0
- package/es/count-down/PropsType.js +1 -0
- package/es/count-down/index.d.ts +5 -0
- package/es/count-down/index.js +4 -0
- package/es/count-down/style/index.css +10 -0
- package/es/count-down/style/var.css +0 -0
- package/es/count-down/utils.d.ts +2 -0
- package/es/count-down/utils.js +43 -0
- package/es/coupon-cell/CouponCell.d.ts +4 -0
- package/es/coupon-cell/CouponCell.js +51 -0
- package/es/coupon-cell/index.d.ts +4 -0
- package/es/coupon-cell/index.js +4 -0
- package/es/coupon-cell/style/index.css +6 -0
- package/es/coupon-cell/style/var.css +0 -0
- package/es/coupon-list/Coupon.d.ts +4 -0
- package/es/coupon-list/Coupon.js +114 -0
- package/es/coupon-list/CouponList.d.ts +4 -0
- package/es/coupon-list/CouponList.js +172 -0
- package/es/coupon-list/PropsType.d.ts +59 -0
- package/es/coupon-list/PropsType.js +1 -0
- package/es/coupon-list/index.d.ts +3 -0
- package/es/coupon-list/index.js +3 -0
- package/es/coupon-list/style/index.css +194 -0
- package/es/coupon-list/style/var.css +0 -0
- package/es/datetime-picker/DatePicker.d.ts +4 -0
- package/es/datetime-picker/DatePicker.js +236 -0
- package/es/datetime-picker/DatetimePicker.d.ts +6 -0
- package/es/datetime-picker/DatetimePicker.js +20 -0
- package/es/datetime-picker/PropsType.d.ts +49 -0
- package/es/datetime-picker/PropsType.js +1 -0
- package/es/datetime-picker/TimePicker.d.ts +4 -0
- package/es/datetime-picker/TimePicker.js +103 -0
- package/es/datetime-picker/index.d.ts +3 -0
- package/es/datetime-picker/index.js +2 -0
- package/es/datetime-picker/utils.d.ts +5 -0
- package/es/datetime-picker/utils.js +35 -0
- package/es/dialog/Dialog.d.ts +4 -0
- package/es/dialog/Dialog.js +146 -0
- package/es/dialog/PropsType.d.ts +70 -0
- package/es/dialog/PropsType.js +1 -0
- package/es/dialog/index.d.ts +4 -0
- package/es/dialog/index.js +4 -0
- package/es/dialog/method.d.ts +3 -0
- package/es/dialog/method.js +145 -0
- package/es/dialog/style/index.css +121 -0
- package/es/dialog/style/var.css +0 -0
- package/es/divider/Divider.d.ts +4 -0
- package/es/divider/Divider.js +28 -0
- package/es/divider/PropsType.d.ts +22 -0
- package/es/divider/PropsType.js +1 -0
- package/es/divider/index.d.ts +4 -0
- package/es/divider/index.js +3 -0
- package/es/divider/style/index.css +72 -0
- package/es/divider/style/var.css +0 -0
- package/es/dropdown-menu/DropdownMenu.d.ts +4 -0
- package/es/dropdown-menu/DropdownMenu.js +209 -0
- package/es/dropdown-menu/DropdownMenuContext.d.ts +11 -0
- package/es/dropdown-menu/DropdownMenuContext.js +3 -0
- package/es/dropdown-menu/DropdownMenuItem.d.ts +4 -0
- package/es/dropdown-menu/DropdownMenuItem.js +151 -0
- package/es/dropdown-menu/PropsType.d.ts +95 -0
- package/es/dropdown-menu/PropsType.js +1 -0
- package/es/dropdown-menu/index.d.ts +8 -0
- package/es/dropdown-menu/index.js +8 -0
- package/es/dropdown-menu/style/index.css +104 -0
- package/es/dropdown-menu/style/var.css +0 -0
- package/es/empty/Empty.d.ts +4 -0
- package/es/empty/Empty.js +63 -0
- package/es/empty/Network.d.ts +1 -0
- package/es/empty/Network.js +143 -0
- package/es/empty/PropsType.d.ts +9 -0
- package/es/empty/PropsType.js +1 -0
- package/es/empty/index.d.ts +4 -0
- package/es/empty/index.js +3 -0
- package/es/empty/style/index.css +36 -0
- package/es/empty/style/var.css +0 -0
- package/es/field/Field.d.ts +7 -0
- package/es/field/Field.js +287 -0
- package/es/field/PropsType.d.ts +82 -0
- package/es/field/PropsType.js +1 -0
- package/es/field/index.d.ts +5 -0
- package/es/field/index.js +4 -0
- package/es/field/style/index.css +132 -0
- package/es/field/style/var.css +0 -0
- package/es/flex/Flex.d.ts +4 -0
- package/es/flex/Flex.js +43 -0
- package/es/flex/FlexContext.d.ts +6 -0
- package/es/flex/FlexContext.js +3 -0
- package/es/flex/FlexItem.d.ts +4 -0
- package/es/flex/FlexItem.js +52 -0
- package/es/flex/PropsType.d.ts +35 -0
- package/es/flex/PropsType.js +1 -0
- package/es/flex/index.d.ts +8 -0
- package/es/flex/index.js +8 -0
- package/es/flex/style/index.css +187 -0
- package/es/flex/style/mixins.css +0 -0
- package/es/floating-ball/FloatingBall.d.ts +4 -0
- package/es/floating-ball/FloatingBall.js +272 -0
- package/es/floating-ball/FloatingBallContext.d.ts +6 -0
- package/es/floating-ball/FloatingBallContext.js +3 -0
- package/es/floating-ball/FloatingBallItem.d.ts +3 -0
- package/es/floating-ball/FloatingBallItem.js +16 -0
- package/es/floating-ball/PropsType.d.ts +77 -0
- package/es/floating-ball/PropsType.js +1 -0
- package/es/floating-ball/index.d.ts +4 -0
- package/es/floating-ball/index.js +3 -0
- package/es/floating-ball/style/index.css +197 -0
- package/es/floating-ball/style/var.css +4 -0
- package/es/floating-ball/useFloatingTouch.d.ts +66 -0
- package/es/floating-ball/useFloatingTouch.js +106 -0
- package/es/floating-panel/FloatingPanel.d.ts +4 -0
- package/es/floating-panel/FloatingPanel.js +125 -0
- package/es/floating-panel/PropsType.d.ts +8 -0
- package/es/floating-panel/PropsType.js +1 -0
- package/es/floating-panel/index.d.ts +6 -0
- package/es/floating-panel/index.js +4 -0
- package/es/floating-panel/style/index.css +38 -0
- package/es/floating-panel/style/var.css +0 -0
- package/es/form/Form.d.ts +10 -0
- package/es/form/Form.js +48 -0
- package/es/form/FormContext.d.ts +11 -0
- package/es/form/FormContext.js +9 -0
- package/es/form/FormItem.d.ts +4 -0
- package/es/form/FormItem.js +197 -0
- package/es/form/FormSubscribe.d.ts +16 -0
- package/es/form/FormSubscribe.js +24 -0
- package/es/form/PropsType.d.ts +41 -0
- package/es/form/PropsType.js +1 -0
- package/es/form/index.d.ts +19 -0
- package/es/form/index.js +13 -0
- package/es/form/style/index.css +8 -0
- package/es/form/style/var.css +0 -0
- package/es/form/utils.d.ts +1 -0
- package/es/form/utils.js +16 -0
- package/es/grid/Grid.d.ts +4 -0
- package/es/grid/Grid.js +35 -0
- package/es/grid/GridItem.d.ts +8 -0
- package/es/grid/GridItem.js +128 -0
- package/es/grid/PropsType.d.ts +40 -0
- package/es/grid/PropsType.js +1 -0
- package/es/grid/index.d.ts +11 -0
- package/es/grid/index.js +7 -0
- package/es/grid/style/index.css +80 -0
- package/es/grid/style/var.css +0 -0
- package/es/hooks/create-update-effect.d.ts +4 -0
- package/es/hooks/create-update-effect.js +17 -0
- package/es/hooks/index.d.ts +38 -0
- package/es/hooks/index.js +37 -0
- package/es/hooks/use-click-away.d.ts +5 -0
- package/es/hooks/use-click-away.js +24 -0
- package/es/hooks/use-count-down.d.ts +32 -0
- package/es/hooks/use-count-down.js +111 -0
- package/es/hooks/use-debunce-effect.d.ts +4 -0
- package/es/hooks/use-debunce-effect.js +16 -0
- package/es/hooks/use-debunce-fn.d.ts +18 -0
- package/es/hooks/use-debunce-fn.js +28 -0
- package/es/hooks/use-drag-and-pinch.d.ts +1 -0
- package/es/hooks/use-drag-and-pinch.js +2 -0
- package/es/hooks/use-effect-with-target.d.ts +4 -0
- package/es/hooks/use-effect-with-target.js +53 -0
- package/es/hooks/use-event-listener.d.ts +11 -0
- package/es/hooks/use-event-listener.js +54 -0
- package/es/hooks/use-form-smart.d.ts +20 -0
- package/es/hooks/use-form-smart.js +54 -0
- package/es/hooks/use-height.d.ts +4 -0
- package/es/hooks/use-height.js +12 -0
- package/es/hooks/use-in-viewport.d.ts +8 -0
- package/es/hooks/use-in-viewport.js +27 -0
- package/es/hooks/use-isomorphic-layout-effect.d.ts +4 -0
- package/es/hooks/use-isomorphic-layout-effect.js +6 -0
- package/es/hooks/use-latest.d.ts +3 -0
- package/es/hooks/use-latest.js +7 -0
- package/es/hooks/use-lazy-effect.d.ts +3 -0
- package/es/hooks/use-lazy-effect.js +11 -0
- package/es/hooks/use-lazy-render.d.ts +3 -0
- package/es/hooks/use-lazy-render.js +11 -0
- package/es/hooks/use-lock-fn.d.ts +2 -0
- package/es/hooks/use-lock-fn.js +18 -0
- package/es/hooks/use-lock-scroll.d.ts +2 -0
- package/es/hooks/use-lock-scroll.js +61 -0
- package/es/hooks/use-memoized-fn.d.ts +3 -0
- package/es/hooks/use-memoized-fn.js +22 -0
- package/es/hooks/use-merged-state.d.ts +5 -0
- package/es/hooks/use-merged-state.js +22 -0
- package/es/hooks/use-mount.d.ts +2 -0
- package/es/hooks/use-mount.js +8 -0
- package/es/hooks/use-next-tick.d.ts +2 -0
- package/es/hooks/use-next-tick.js +17 -0
- package/es/hooks/use-page-visibility.d.ts +3 -0
- package/es/hooks/use-page-visibility.js +20 -0
- package/es/hooks/use-props-value.d.ts +8 -0
- package/es/hooks/use-props-value.js +24 -0
- package/es/hooks/use-rect.d.ts +11 -0
- package/es/hooks/use-rect.js +31 -0
- package/es/hooks/use-ref-state.d.ts +4 -0
- package/es/hooks/use-ref-state.js +13 -0
- package/es/hooks/use-refs.d.ts +1 -0
- package/es/hooks/use-refs.js +12 -0
- package/es/hooks/use-resize-effect.d.ts +2 -0
- package/es/hooks/use-resize-effect.js +20 -0
- package/es/hooks/use-scroll-parent.d.ts +5 -0
- package/es/hooks/use-scroll-parent.js +43 -0
- package/es/hooks/use-set-state.d.ts +3 -0
- package/es/hooks/use-set-state.js +14 -0
- package/es/hooks/use-throttle-fn.d.ts +17 -0
- package/es/hooks/use-throttle-fn.js +27 -0
- package/es/hooks/use-touch.d.ts +17 -0
- package/es/hooks/use-touch.js +67 -0
- package/es/hooks/use-unmount.d.ts +2 -0
- package/es/hooks/use-unmount.js +16 -0
- package/es/hooks/use-unmounted-ref.d.ts +2 -0
- package/es/hooks/use-unmounted-ref.js +13 -0
- package/es/hooks/use-update-effect.d.ts +3 -0
- package/es/hooks/use-update-effect.js +13 -0
- package/es/hooks/use-update.d.ts +2 -0
- package/es/hooks/use-update.js +6 -0
- package/es/hooks/use-visibility-change.d.ts +2 -0
- package/es/hooks/use-visibility-change.js +33 -0
- package/es/hooks/use-window-size.d.ts +5 -0
- package/es/hooks/use-window-size.js +18 -0
- package/es/image/Image.d.ts +4 -0
- package/es/image/Image.js +128 -0
- package/es/image/LazyImage.d.ts +9 -0
- package/es/image/LazyImage.js +63 -0
- package/es/image/PropsType.d.ts +55 -0
- package/es/image/PropsType.js +1 -0
- package/es/image/index.d.ts +5 -0
- package/es/image/index.js +4 -0
- package/es/image/style/index.css +70 -0
- package/es/image/style/var.css +0 -0
- package/es/image-preview/ImagePreview.d.ts +6 -0
- package/es/image-preview/ImagePreview.js +105 -0
- package/es/image-preview/PropsType.d.ts +47 -0
- package/es/image-preview/PropsType.js +1 -0
- package/es/image-preview/index.d.ts +4 -0
- package/es/image-preview/index.js +4 -0
- package/es/image-preview/method.d.ts +3 -0
- package/es/image-preview/method.js +66 -0
- package/es/image-preview/slide.d.ts +12 -0
- package/es/image-preview/slide.js +172 -0
- package/es/image-preview/slides.d.ts +14 -0
- package/es/image-preview/slides.js +94 -0
- package/es/image-preview/style/index.css +118 -0
- package/es/image-preview/style/var.css +0 -0
- package/es/index-bar/IndexAnchor.d.ts +5 -0
- package/es/index-bar/IndexAnchor.js +98 -0
- package/es/index-bar/IndexBar.d.ts +4 -0
- package/es/index-bar/IndexBar.js +253 -0
- package/es/index-bar/IndexBarContext.d.ts +8 -0
- package/es/index-bar/IndexBarContext.js +3 -0
- package/es/index-bar/PropsType.d.ts +37 -0
- package/es/index-bar/PropsType.js +1 -0
- package/es/index-bar/index.d.ts +8 -0
- package/es/index-bar/index.js +7 -0
- package/es/index-bar/style/index.css +54 -0
- package/es/index-bar/style/var.css +0 -0
- package/es/index.d.ts +73 -0
- package/es/index.js +73 -0
- package/es/input/Input.d.ts +4 -0
- package/es/input/Input.js +172 -0
- package/es/input/PropsType.d.ts +55 -0
- package/es/input/PropsType.js +1 -0
- package/es/input/index.d.ts +9 -0
- package/es/input/index.js +8 -0
- package/es/input/style/index.css +82 -0
- package/es/input/style/var.css +0 -0
- package/es/lazyload/Lazyload.d.ts +4 -0
- package/es/lazyload/Lazyload.js +36 -0
- package/es/lazyload/PropsType.d.ts +9 -0
- package/es/lazyload/PropsType.js +1 -0
- package/es/lazyload/index.d.ts +4 -0
- package/es/lazyload/index.js +4 -0
- package/es/lazyload/style/index.css +5 -0
- package/es/lazyload/style/var.css +0 -0
- package/es/list/List.d.ts +4 -0
- package/es/list/List.js +24 -0
- package/es/list/LoadMore.d.ts +4 -0
- package/es/list/LoadMore.js +134 -0
- package/es/list/PropsType.d.ts +31 -0
- package/es/list/PropsType.js +1 -0
- package/es/list/index.d.ts +5 -0
- package/es/list/index.js +4 -0
- package/es/list/style/index.css +18 -0
- package/es/list/style/var.css +0 -0
- package/es/loading/Loading.d.ts +4 -0
- package/es/loading/Loading.js +88 -0
- package/es/loading/PropsType.d.ts +25 -0
- package/es/loading/PropsType.js +1 -0
- package/es/loading/index.d.ts +5 -0
- package/es/loading/index.js +4 -0
- package/es/loading/style/index.css +199 -0
- package/es/loading/style/var.css +0 -0
- package/es/locale/index.d.ts +7 -0
- package/es/locale/index.js +6 -0
- package/es/locale/lang/base.d.ts +75 -0
- package/es/locale/lang/base.js +74 -0
- package/es/locale/lang/en-US.d.ts +75 -0
- package/es/locale/lang/en-US.js +74 -0
- package/es/locale/lang/fr-FR.d.ts +74 -0
- package/es/locale/lang/fr-FR.js +73 -0
- package/es/locale/lang/ja-JP.d.ts +75 -0
- package/es/locale/lang/ja-JP.js +74 -0
- package/es/locale/lang/types.d.ts +75 -0
- package/es/locale/lang/types.js +1 -0
- package/es/locale/lang/zh-CN.d.ts +11 -0
- package/es/locale/lang/zh-CN.js +8 -0
- package/es/locale/lang/zh-HK.d.ts +75 -0
- package/es/locale/lang/zh-HK.js +74 -0
- package/es/locale/lang/zh-TW.d.ts +75 -0
- package/es/locale/lang/zh-TW.js +74 -0
- package/es/nav-bar/Navbar.d.ts +4 -0
- package/es/nav-bar/Navbar.js +104 -0
- package/es/nav-bar/PropsType.d.ts +25 -0
- package/es/nav-bar/PropsType.js +1 -0
- package/es/nav-bar/index.d.ts +4 -0
- package/es/nav-bar/index.js +3 -0
- package/es/nav-bar/style/index.css +72 -0
- package/es/nav-bar/style/var.css +0 -0
- package/es/notice-bar/NoticeBar.d.ts +4 -0
- package/es/notice-bar/NoticeBar.js +176 -0
- package/es/notice-bar/PropsType.d.ts +36 -0
- package/es/notice-bar/PropsType.js +1 -0
- package/es/notice-bar/index.d.ts +4 -0
- package/es/notice-bar/index.js +3 -0
- package/es/notice-bar/style/index.css +62 -0
- package/es/notice-bar/style/var.css +0 -0
- package/es/notify/Notify.d.ts +4 -0
- package/es/notify/Notify.js +41 -0
- package/es/notify/PropsType.d.ts +59 -0
- package/es/notify/PropsType.js +1 -0
- package/es/notify/index.d.ts +5 -0
- package/es/notify/index.js +4 -0
- package/es/notify/method.d.ts +11 -0
- package/es/notify/method.js +112 -0
- package/es/notify/style/index.css +35 -0
- package/es/notify/style/var.css +0 -0
- package/es/number-keyboard/NumberKeyboard.d.ts +4 -0
- package/es/number-keyboard/NumberKeyboard.js +226 -0
- package/es/number-keyboard/NumberKeyboardKey.d.ts +4 -0
- package/es/number-keyboard/NumberKeyboardKey.js +105 -0
- package/es/number-keyboard/PropsType.d.ts +75 -0
- package/es/number-keyboard/PropsType.js +1 -0
- package/es/number-keyboard/index.d.ts +5 -0
- package/es/number-keyboard/index.js +4 -0
- package/es/number-keyboard/style/index.css +134 -0
- package/es/number-keyboard/style/var.css +0 -0
- package/es/overlay/Overlay.d.ts +4 -0
- package/es/overlay/Overlay.js +60 -0
- package/es/overlay/PropsType.d.ts +17 -0
- package/es/overlay/PropsType.js +1 -0
- package/es/overlay/index.d.ts +5 -0
- package/es/overlay/index.js +4 -0
- package/es/overlay/style/index.css +13 -0
- package/es/overlay/style/var.css +0 -0
- package/es/pagination/Pagination.d.ts +4 -0
- package/es/pagination/Pagination.js +138 -0
- package/es/pagination/PropsType.d.ts +33 -0
- package/es/pagination/PropsType.js +1 -0
- package/es/pagination/index.d.ts +4 -0
- package/es/pagination/index.js +3 -0
- package/es/pagination/style/index.css +69 -0
- package/es/pagination/style/var.css +0 -0
- package/es/password-input/PasswordInput.d.ts +4 -0
- package/es/password-input/PasswordInput.js +193 -0
- package/es/password-input/PropsType.d.ts +36 -0
- package/es/password-input/PropsType.js +1 -0
- package/es/password-input/index.d.ts +4 -0
- package/es/password-input/index.js +3 -0
- package/es/password-input/style/index.css +112 -0
- package/es/password-input/style/var.css +0 -0
- package/es/picker/Picker.d.ts +7 -0
- package/es/picker/Picker.js +309 -0
- package/es/picker/PickerColumn.d.ts +8 -0
- package/es/picker/PickerColumn.js +270 -0
- package/es/picker/PropsType.d.ts +106 -0
- package/es/picker/PropsType.js +1 -0
- package/es/picker/columnsExtend.d.ts +9 -0
- package/es/picker/columnsExtend.js +124 -0
- package/es/picker/index.d.ts +5 -0
- package/es/picker/index.js +4 -0
- package/es/picker/style/index.css +113 -0
- package/es/picker/style/var.css +0 -0
- package/es/popover/Popover.d.ts +4 -0
- package/es/popover/Popover.js +188 -0
- package/es/popover/PropsType.d.ts +71 -0
- package/es/popover/PropsType.js +1 -0
- package/es/popover/index.d.ts +5 -0
- package/es/popover/index.js +4 -0
- package/es/popover/style/index.css +213 -0
- package/es/popover/style/var.css +0 -0
- package/es/popup/Popup.d.ts +5 -0
- package/es/popup/Popup.js +215 -0
- package/es/popup/PopupContext.d.ts +6 -0
- package/es/popup/PopupContext.js +3 -0
- package/es/popup/PropsType.d.ts +72 -0
- package/es/popup/PropsType.js +1 -0
- package/es/popup/index.d.ts +5 -0
- package/es/popup/index.js +4 -0
- package/es/popup/style/index.css +132 -0
- package/es/popup/style/var.css +0 -0
- package/es/product-card/ProductCard.d.ts +4 -0
- package/es/product-card/ProductCard.js +151 -0
- package/es/product-card/PropsType.d.ts +40 -0
- package/es/product-card/PropsType.js +1 -0
- package/es/product-card/index.d.ts +3 -0
- package/es/product-card/index.js +3 -0
- package/es/product-card/style/index.css +108 -0
- package/es/product-card/style/var.css +0 -0
- package/es/progress/Progress.d.ts +4 -0
- package/es/progress/Progress.js +60 -0
- package/es/progress/PropsType.d.ts +13 -0
- package/es/progress/PropsType.js +1 -0
- package/es/progress/index.d.ts +4 -0
- package/es/progress/index.js +3 -0
- package/es/progress/style/index.css +41 -0
- package/es/progress/style/var.css +0 -0
- package/es/pull-refresh/PropsType.d.ts +39 -0
- package/es/pull-refresh/PropsType.js +1 -0
- package/es/pull-refresh/PullRefresh.d.ts +4 -0
- package/es/pull-refresh/PullRefresh.js +229 -0
- package/es/pull-refresh/index.d.ts +4 -0
- package/es/pull-refresh/index.js +3 -0
- package/es/pull-refresh/style/index.css +31 -0
- package/es/pull-refresh/style/var.css +0 -0
- package/es/radio/PropsType.d.ts +24 -0
- package/es/radio/PropsType.js +1 -0
- package/es/radio/Radio.d.ts +3 -0
- package/es/radio/Radio.js +29 -0
- package/es/radio/RadioContext.d.ts +11 -0
- package/es/radio/RadioContext.js +3 -0
- package/es/radio/RadioGroup.d.ts +3 -0
- package/es/radio/RadioGroup.js +35 -0
- package/es/radio/index.d.ts +8 -0
- package/es/radio/index.js +7 -0
- package/es/radio/style/index.css +90 -0
- package/es/radio/style/var.css +0 -0
- package/es/rate/PropsType.d.ts +55 -0
- package/es/rate/PropsType.js +1 -0
- package/es/rate/Rate.d.ts +4 -0
- package/es/rate/Rate.js +199 -0
- package/es/rate/index.d.ts +4 -0
- package/es/rate/index.js +3 -0
- package/es/rate/style/index.css +43 -0
- package/es/rate/style/var.css +0 -0
- package/es/search/PropsType.d.ts +29 -0
- package/es/search/PropsType.js +1 -0
- package/es/search/Search.d.ts +4 -0
- package/es/search/Search.js +158 -0
- package/es/search/index.d.ts +4 -0
- package/es/search/index.js +3 -0
- package/es/search/style/index.css +64 -0
- package/es/search/style/var.css +0 -0
- package/es/selector/CheckMark.d.ts +2 -0
- package/es/selector/CheckMark.js +42 -0
- package/es/selector/PropsType.d.ts +25 -0
- package/es/selector/PropsType.js +1 -0
- package/es/selector/Selector.d.ts +2 -0
- package/es/selector/Selector.js +68 -0
- package/es/selector/index.d.ts +4 -0
- package/es/selector/index.js +3 -0
- package/es/selector/style/index.css +69 -0
- package/es/selector/style/var.css +0 -0
- package/es/share-sheet/PropsType.d.ts +29 -0
- package/es/share-sheet/PropsType.js +1 -0
- package/es/share-sheet/ShareSheet.d.ts +4 -0
- package/es/share-sheet/ShareSheet.js +125 -0
- package/es/share-sheet/index.d.ts +5 -0
- package/es/share-sheet/index.js +4 -0
- package/es/share-sheet/style/index.css +103 -0
- package/es/share-sheet/style/var.css +0 -0
- package/es/sidebar/PropsType.d.ts +41 -0
- package/es/sidebar/PropsType.js +1 -0
- package/es/sidebar/Sidebar.d.ts +4 -0
- package/es/sidebar/Sidebar.js +66 -0
- package/es/sidebar/SidebarItem.d.ts +4 -0
- package/es/sidebar/SidebarItem.js +44 -0
- package/es/sidebar/index.d.ts +8 -0
- package/es/sidebar/index.js +7 -0
- package/es/sidebar/style/index.css +77 -0
- package/es/sidebar/style/var.css +0 -0
- package/es/skeleton/PropsType.d.ts +31 -0
- package/es/skeleton/PropsType.js +1 -0
- package/es/skeleton/Skeleton.d.ts +4 -0
- package/es/skeleton/Skeleton.js +97 -0
- package/es/skeleton/index.d.ts +5 -0
- package/es/skeleton/index.js +4 -0
- package/es/skeleton/style/index.css +56 -0
- package/es/skeleton/style/var.css +0 -0
- package/es/sku/PropsType.d.ts +189 -0
- package/es/sku/PropsType.js +1 -0
- package/es/sku/Sku.d.ts +4 -0
- package/es/sku/Sku.js +504 -0
- package/es/sku/components/SkuRow.d.ts +7 -0
- package/es/sku/components/SkuRow.js +41 -0
- package/es/sku/components/SkuRowItem.d.ts +15 -0
- package/es/sku/components/SkuRowItem.js +76 -0
- package/es/sku/components/SkuRowPropItem.d.ts +10 -0
- package/es/sku/components/SkuRowPropItem.js +38 -0
- package/es/sku/components/SkuStepper.d.ts +17 -0
- package/es/sku/components/SkuStepper.js +122 -0
- package/es/sku/constants.d.ts +13 -0
- package/es/sku/constants.js +9 -0
- package/es/sku/index.d.ts +5 -0
- package/es/sku/index.js +4 -0
- package/es/sku/style/index.css +283 -0
- package/es/sku/style/var.css +0 -0
- package/es/sku/utils.d.ts +25 -0
- package/es/sku/utils.js +153 -0
- package/es/slider/PropsType.d.ts +59 -0
- package/es/slider/PropsType.js +1 -0
- package/es/slider/Slider.d.ts +4 -0
- package/es/slider/Slider.js +271 -0
- package/es/slider/index.d.ts +4 -0
- package/es/slider/index.js +3 -0
- package/es/slider/style/index.css +85 -0
- package/es/slider/style/var.css +0 -0
- package/es/space/PropsType.d.ts +25 -0
- package/es/space/PropsType.js +1 -0
- package/es/space/Space.d.ts +4 -0
- package/es/space/Space.js +56 -0
- package/es/space/index.d.ts +4 -0
- package/es/space/index.js +3 -0
- package/es/space/style/index.css +56 -0
- package/es/space/style/var.css +0 -0
- package/es/stepper/PropsType.d.ts +66 -0
- package/es/stepper/PropsType.js +1 -0
- package/es/stepper/Stepper.d.ts +4 -0
- package/es/stepper/Stepper.js +231 -0
- package/es/stepper/index.d.ts +5 -0
- package/es/stepper/index.js +4 -0
- package/es/stepper/style/index.css +130 -0
- package/es/stepper/style/var.css +0 -0
- package/es/steps/PropsType.d.ts +33 -0
- package/es/steps/PropsType.js +1 -0
- package/es/steps/Steps.d.ts +4 -0
- package/es/steps/Steps.js +35 -0
- package/es/steps/StepsItem.d.ts +4 -0
- package/es/steps/StepsItem.js +118 -0
- package/es/steps/index.d.ts +8 -0
- package/es/steps/index.js +7 -0
- package/es/steps/style/index.css +143 -0
- package/es/steps/style/var.css +0 -0
- package/es/sticky/PropsType.d.ts +25 -0
- package/es/sticky/PropsType.js +1 -0
- package/es/sticky/Sticky.d.ts +4 -0
- package/es/sticky/Sticky.js +124 -0
- package/es/sticky/index.d.ts +5 -0
- package/es/sticky/index.js +4 -0
- package/es/sticky/style/index.css +7 -0
- package/es/sticky/style/var.css +0 -0
- package/es/styles/animation.css +130 -0
- package/es/styles/base.css +310 -0
- package/es/styles/css-variables.css +66 -0
- package/es/styles/index.d.ts +1 -0
- package/es/styles/index.js +1 -0
- package/es/styles/mixins/ellipsis.css +0 -0
- package/es/styles/mixins/hairline.css +0 -0
- package/es/styles/normalize.css +29 -0
- package/es/styles/var.css +0 -0
- package/es/submit-bar/PropsType.d.ts +40 -0
- package/es/submit-bar/PropsType.js +1 -0
- package/es/submit-bar/SubmitBar.d.ts +4 -0
- package/es/submit-bar/SubmitBar.js +105 -0
- package/es/submit-bar/index.d.ts +4 -0
- package/es/submit-bar/index.js +4 -0
- package/es/submit-bar/style/index.css +84 -0
- package/es/submit-bar/style/var.css +0 -0
- package/es/swipe-cell/PropsType.d.ts +39 -0
- package/es/swipe-cell/PropsType.js +1 -0
- package/es/swipe-cell/SwipeCell.d.ts +4 -0
- package/es/swipe-cell/SwipeCell.js +179 -0
- package/es/swipe-cell/index.d.ts +4 -0
- package/es/swipe-cell/index.js +3 -0
- package/es/swipe-cell/style/index.css +23 -0
- package/es/swiper/PropsType.d.ts +70 -0
- package/es/swiper/PropsType.js +1 -0
- package/es/swiper/Swiper.d.ts +4 -0
- package/es/swiper/Swiper.js +315 -0
- package/es/swiper/SwiperItem.d.ts +4 -0
- package/es/swiper/SwiperItem.js +31 -0
- package/es/swiper/SwiperPagIndicator.d.ts +4 -0
- package/es/swiper/SwiperPagIndicator.js +29 -0
- package/es/swiper/index.d.ts +8 -0
- package/es/swiper/index.js +8 -0
- package/es/swiper/style/index.css +107 -0
- package/es/swiper/style/var.css +0 -0
- package/es/switch/PropsType.d.ts +25 -0
- package/es/switch/PropsType.js +1 -0
- package/es/switch/Switch.d.ts +4 -0
- package/es/switch/Switch.js +70 -0
- package/es/switch/index.d.ts +5 -0
- package/es/switch/index.js +4 -0
- package/es/switch/style/index.css +60 -0
- package/es/switch/style/var.css +0 -0
- package/es/tabbar/PropsType.d.ts +36 -0
- package/es/tabbar/PropsType.js +1 -0
- package/es/tabbar/Tabbar.d.ts +4 -0
- package/es/tabbar/Tabbar.js +80 -0
- package/es/tabbar/TabbarContext.d.ts +7 -0
- package/es/tabbar/TabbarContext.js +3 -0
- package/es/tabbar/TabbarItem.d.ts +4 -0
- package/es/tabbar/TabbarItem.js +64 -0
- package/es/tabbar/index.d.ts +8 -0
- package/es/tabbar/index.js +7 -0
- package/es/tabbar/style/index.css +54 -0
- package/es/tabbar/style/var.css +0 -0
- package/es/tabs/PropsType.d.ts +149 -0
- package/es/tabs/PropsType.js +1 -0
- package/es/tabs/TabPane.d.ts +4 -0
- package/es/tabs/TabPane.js +57 -0
- package/es/tabs/Tabs.d.ts +4 -0
- package/es/tabs/Tabs.js +341 -0
- package/es/tabs/TabsContent.d.ts +4 -0
- package/es/tabs/TabsContent.js +68 -0
- package/es/tabs/TabsContext.d.ts +9 -0
- package/es/tabs/TabsContext.js +3 -0
- package/es/tabs/TabsTitle.d.ts +4 -0
- package/es/tabs/TabsTitle.js +99 -0
- package/es/tabs/index.d.ts +8 -0
- package/es/tabs/index.js +8 -0
- package/es/tabs/style/index.css +201 -0
- package/es/tabs/style/var.css +0 -0
- package/es/tabs/utils.d.ts +1 -0
- package/es/tabs/utils.js +40 -0
- package/es/tag/PropsType.d.ts +26 -0
- package/es/tag/PropsType.js +1 -0
- package/es/tag/Tag.d.ts +4 -0
- package/es/tag/Tag.js +73 -0
- package/es/tag/index.d.ts +5 -0
- package/es/tag/index.js +4 -0
- package/es/tag/style/index.css +110 -0
- package/es/tag/style/var.css +0 -0
- package/es/text-area/PropsType.d.ts +32 -0
- package/es/text-area/PropsType.js +1 -0
- package/es/text-area/TextArea.d.ts +4 -0
- package/es/text-area/TextArea.js +183 -0
- package/es/text-area/index.d.ts +5 -0
- package/es/text-area/index.js +4 -0
- package/es/text-area/style/index.css +144 -0
- package/es/text-area/style/var.css +0 -0
- package/es/toast/PropsType.d.ts +74 -0
- package/es/toast/PropsType.js +1 -0
- package/es/toast/Toast.d.ts +6 -0
- package/es/toast/Toast.js +93 -0
- package/es/toast/index.d.ts +5 -0
- package/es/toast/index.js +4 -0
- package/es/toast/lock-click.d.ts +1 -0
- package/es/toast/lock-click.js +14 -0
- package/es/toast/method.d.ts +3 -0
- package/es/toast/method.js +139 -0
- package/es/toast/style/index.css +72 -0
- package/es/toast/style/var.css +0 -0
- package/es/typography/Ellipsis.d.ts +4 -0
- package/es/typography/Ellipsis.js +127 -0
- package/es/typography/PropsType.d.ts +34 -0
- package/es/typography/PropsType.js +1 -0
- package/es/typography/Typography.d.ts +6 -0
- package/es/typography/Typography.js +117 -0
- package/es/typography/index.d.ts +12 -0
- package/es/typography/index.js +21 -0
- package/es/typography/style/index.css +132 -0
- package/es/typography/style/var.css +0 -0
- package/es/uploader/PropsType.d.ts +132 -0
- package/es/uploader/PropsType.js +1 -0
- package/es/uploader/Uploader.d.ts +4 -0
- package/es/uploader/Uploader.js +272 -0
- package/es/uploader/UploaderPreviewItem.d.ts +3 -0
- package/es/uploader/UploaderPreviewItem.js +98 -0
- package/es/uploader/index.d.ts +4 -0
- package/es/uploader/index.js +3 -0
- package/es/uploader/style/index.css +166 -0
- package/es/uploader/style/var.css +0 -0
- package/es/uploader/utils.d.ts +10 -0
- package/es/uploader/utils.js +75 -0
- package/es/utils/base.d.ts +18 -0
- package/es/utils/base.js +41 -0
- package/es/utils/bound.d.ts +1 -0
- package/es/utils/bound.js +10 -0
- package/es/utils/constant.d.ts +16 -0
- package/es/utils/constant.js +20 -0
- package/es/utils/create/bem.d.ts +14 -0
- package/es/utils/create/bem.js +32 -0
- package/es/utils/create/index.d.ts +3 -0
- package/es/utils/create/index.js +6 -0
- package/es/utils/debounce.d.ts +6 -0
- package/es/utils/debounce.js +122 -0
- package/es/utils/deep-assign.d.ts +3 -0
- package/es/utils/deep-assign.js +19 -0
- package/es/utils/deep-clone.d.ts +4 -0
- package/es/utils/deep-clone.js +28 -0
- package/es/utils/dev-log.d.ts +1 -0
- package/es/utils/dev-log.js +7 -0
- package/es/utils/dom/canUseDom.d.ts +1 -0
- package/es/utils/dom/canUseDom.js +3 -0
- package/es/utils/dom/event.d.ts +5 -0
- package/es/utils/dom/event.js +29 -0
- package/es/utils/dom/getContainer.d.ts +1 -0
- package/es/utils/dom/getContainer.js +4 -0
- package/es/utils/dom/getTargetElement.d.ts +4 -0
- package/es/utils/dom/getTargetElement.js +14 -0
- package/es/utils/dom/render copy.d.ts +9 -0
- package/es/utils/dom/render copy.js +66 -0
- package/es/utils/dom/render.d.ts +9 -0
- package/es/utils/dom/render.js +82 -0
- package/es/utils/dom/renderToContainer.d.ts +3 -0
- package/es/utils/dom/renderToContainer.js +11 -0
- package/es/utils/dom/scroll.d.ts +12 -0
- package/es/utils/dom/scroll.js +86 -0
- package/es/utils/dom/style.d.ts +1 -0
- package/es/utils/dom/style.js +13 -0
- package/es/utils/dom/version.d.ts +2 -0
- package/es/utils/dom/version.js +4 -0
- package/es/utils/format/number.d.ts +3 -0
- package/es/utils/format/number.js +34 -0
- package/es/utils/format/react.d.ts +2 -0
- package/es/utils/format/react.js +14 -0
- package/es/utils/format/string.d.ts +2 -0
- package/es/utils/format/string.js +11 -0
- package/es/utils/format/unit.d.ts +12 -0
- package/es/utils/format/unit.js +69 -0
- package/es/utils/get-default-props.d.ts +2 -0
- package/es/utils/get-default-props.js +12 -0
- package/es/utils/index.d.ts +10 -0
- package/es/utils/index.js +10 -0
- package/es/utils/interceptor.d.ts +7 -0
- package/es/utils/interceptor.js +30 -0
- package/es/utils/interface.d.ts +13 -0
- package/es/utils/interface.js +1 -0
- package/es/utils/is-dev.d.ts +1 -0
- package/es/utils/is-dev.js +1 -0
- package/es/utils/raf.d.ts +4 -0
- package/es/utils/raf.js +26 -0
- package/es/utils/rubberband.d.ts +2 -0
- package/es/utils/rubberband.js +10 -0
- package/es/utils/supports-passive.d.ts +1 -0
- package/es/utils/supports-passive.js +14 -0
- package/es/utils/throttle.d.ts +7 -0
- package/es/utils/throttle.js +20 -0
- package/es/utils/validate/date.d.ts +1 -0
- package/es/utils/validate/date.js +4 -0
- package/es/utils/validate/number.d.ts +2 -0
- package/es/utils/validate/number.js +10 -0
- package/es/utils/validate/system.d.ts +2 -0
- package/es/utils/validate/system.js +7 -0
- package/es/water-mark/PropsType.d.ts +39 -0
- package/es/water-mark/PropsType.js +1 -0
- package/es/water-mark/WaterMark.d.ts +4 -0
- package/es/water-mark/WaterMark.js +102 -0
- package/es/water-mark/index.d.ts +4 -0
- package/es/water-mark/index.js +3 -0
- package/es/water-mark/style/index.css +16 -0
- package/lib/action-bar/ActionBar.d.ts +4 -0
- package/lib/action-bar/ActionBar.js +58 -0
- package/lib/action-bar/ActionBarButton.d.ts +6 -0
- package/lib/action-bar/ActionBarButton.js +81 -0
- package/lib/action-bar/ActionBarContext.d.ts +6 -0
- package/lib/action-bar/ActionBarContext.js +16 -0
- package/lib/action-bar/ActionBarIcon.d.ts +4 -0
- package/lib/action-bar/ActionBarIcon.js +50 -0
- package/lib/action-bar/PropsType.d.ts +34 -0
- package/lib/action-bar/PropsType.js +6 -0
- package/lib/action-bar/index.d.ts +11 -0
- package/lib/action-bar/index.js +16 -0
- package/lib/action-bar/style/index.css +76 -0
- package/lib/action-bar/style/var.css +0 -0
- package/lib/action-sheet/ActionSheet.d.ts +4 -0
- package/lib/action-sheet/ActionSheet.js +167 -0
- package/lib/action-sheet/PropsType.d.ts +38 -0
- package/lib/action-sheet/PropsType.js +6 -0
- package/lib/action-sheet/index.d.ts +5 -0
- package/lib/action-sheet/index.js +16 -0
- package/lib/action-sheet/style/index.css +126 -0
- package/lib/action-sheet/style/var.css +0 -0
- package/lib/area/Area.d.ts +4 -0
- package/lib/area/Area.js +99 -0
- package/lib/area/PropsType.d.ts +30 -0
- package/lib/area/PropsType.js +6 -0
- package/lib/area/index.d.ts +4 -0
- package/lib/area/index.js +15 -0
- package/lib/badge/Badge.d.ts +4 -0
- package/lib/badge/Badge.js +103 -0
- package/lib/badge/PropsType.d.ts +28 -0
- package/lib/badge/PropsType.js +6 -0
- package/lib/badge/index.d.ts +5 -0
- package/lib/badge/index.js +16 -0
- package/lib/badge/style/index.css +45 -0
- package/lib/badge/style/var.css +0 -0
- package/lib/button/Button.d.ts +4 -0
- package/lib/button/Button.js +166 -0
- package/lib/button/ButtonContext.d.ts +7 -0
- package/lib/button/ButtonContext.js +16 -0
- package/lib/button/ButtonGroup.d.ts +4 -0
- package/lib/button/ButtonGroup.js +64 -0
- package/lib/button/PropsType.d.ts +67 -0
- package/lib/button/PropsType.js +6 -0
- package/lib/button/index.d.ts +8 -0
- package/lib/button/index.js +14 -0
- package/lib/button/style/index.css +242 -0
- package/lib/button/style/var.css +0 -0
- package/lib/calendar/Calendar.d.ts +4 -0
- package/lib/calendar/Calendar.js +520 -0
- package/lib/calendar/CalendarDay.d.ts +4 -0
- package/lib/calendar/CalendarDay.js +152 -0
- package/lib/calendar/CalendarHeader.d.ts +4 -0
- package/lib/calendar/CalendarHeader.js +89 -0
- package/lib/calendar/CalendarMonth.d.ts +4 -0
- package/lib/calendar/CalendarMonth.js +228 -0
- package/lib/calendar/PropsType.d.ts +118 -0
- package/lib/calendar/PropsType.js +6 -0
- package/lib/calendar/index.d.ts +5 -0
- package/lib/calendar/index.js +16 -0
- package/lib/calendar/style/index.css +186 -0
- package/lib/calendar/style/var.css +0 -0
- package/lib/calendar/utils.d.ts +10 -0
- package/lib/calendar/utils.js +60 -0
- package/lib/card/Card.d.ts +8 -0
- package/lib/card/Card.js +102 -0
- package/lib/card/PropsType.d.ts +34 -0
- package/lib/card/PropsType.js +6 -0
- package/lib/card/index.d.ts +10 -0
- package/lib/card/index.js +17 -0
- package/lib/card/style/index.css +68 -0
- package/lib/card/style/var.css +0 -0
- package/lib/cascader/Cascader.d.ts +5 -0
- package/lib/cascader/Cascader.js +321 -0
- package/lib/cascader/PropsType.d.ts +68 -0
- package/lib/cascader/PropsType.js +6 -0
- package/lib/cascader/index.d.ts +5 -0
- package/lib/cascader/index.js +16 -0
- package/lib/cascader/style/index.css +90 -0
- package/lib/cascader/style/var.css +0 -0
- package/lib/cascader/useCascaderExtend.d.ts +12 -0
- package/lib/cascader/useCascaderExtend.js +58 -0
- package/lib/cell/Cell.d.ts +4 -0
- package/lib/cell/Cell.js +138 -0
- package/lib/cell/CellGroup.d.ts +4 -0
- package/lib/cell/CellGroup.js +61 -0
- package/lib/cell/PropsType.d.ts +53 -0
- package/lib/cell/PropsType.js +6 -0
- package/lib/cell/index.d.ts +9 -0
- package/lib/cell/index.js +21 -0
- package/lib/cell/style/index.css +140 -0
- package/lib/cell/style/var.css +0 -0
- package/lib/checkbox/Checkbox.d.ts +4 -0
- package/lib/checkbox/Checkbox.js +106 -0
- package/lib/checkbox/CheckboxContext.d.ts +11 -0
- package/lib/checkbox/CheckboxContext.js +16 -0
- package/lib/checkbox/CheckboxGroup.d.ts +4 -0
- package/lib/checkbox/CheckboxGroup.js +94 -0
- package/lib/checkbox/Checker.d.ts +4 -0
- package/lib/checkbox/Checker.js +129 -0
- package/lib/checkbox/PropsType.d.ts +96 -0
- package/lib/checkbox/PropsType.js +6 -0
- package/lib/checkbox/index.d.ts +9 -0
- package/lib/checkbox/index.js +21 -0
- package/lib/checkbox/style/index.css +84 -0
- package/lib/checkbox/style/var.css +0 -0
- package/lib/circle/Circle.d.ts +4 -0
- package/lib/circle/Circle.js +182 -0
- package/lib/circle/PropsType.d.ts +30 -0
- package/lib/circle/PropsType.js +6 -0
- package/lib/circle/index.d.ts +5 -0
- package/lib/circle/index.js +16 -0
- package/lib/circle/style/index.css +44 -0
- package/lib/circle/style/var.css +0 -0
- package/lib/collapse/Collapse.d.ts +4 -0
- package/lib/collapse/Collapse.js +114 -0
- package/lib/collapse/CollapseContext.d.ts +7 -0
- package/lib/collapse/CollapseContext.js +16 -0
- package/lib/collapse/CollapseItem.d.ts +4 -0
- package/lib/collapse/CollapseItem.js +157 -0
- package/lib/collapse/PropsType.d.ts +31 -0
- package/lib/collapse/PropsType.js +6 -0
- package/lib/collapse/index.d.ts +9 -0
- package/lib/collapse/index.js +21 -0
- package/lib/collapse/style/index.css +59 -0
- package/lib/collapse/style/var.css +0 -0
- package/lib/config-provider/ConfigProvider.d.ts +4 -0
- package/lib/config-provider/ConfigProvider.js +72 -0
- package/lib/config-provider/ConfigProviderContext.d.ts +8 -0
- package/lib/config-provider/ConfigProviderContext.js +22 -0
- package/lib/config-provider/PropsType.d.ts +14 -0
- package/lib/config-provider/PropsType.js +6 -0
- package/lib/config-provider/index.d.ts +3 -0
- package/lib/config-provider/index.js +13 -0
- package/lib/count-down/CountDown.d.ts +4 -0
- package/lib/count-down/CountDown.js +79 -0
- package/lib/count-down/PropsType.d.ts +38 -0
- package/lib/count-down/PropsType.js +6 -0
- package/lib/count-down/index.d.ts +5 -0
- package/lib/count-down/index.js +16 -0
- package/lib/count-down/style/index.css +10 -0
- package/lib/count-down/style/var.css +0 -0
- package/lib/count-down/utils.d.ts +2 -0
- package/lib/count-down/utils.js +50 -0
- package/lib/coupon-cell/CouponCell.d.ts +4 -0
- package/lib/coupon-cell/CouponCell.js +77 -0
- package/lib/coupon-cell/index.d.ts +4 -0
- package/lib/coupon-cell/index.js +16 -0
- package/lib/coupon-cell/style/index.css +6 -0
- package/lib/coupon-cell/style/var.css +0 -0
- package/lib/coupon-list/Coupon.d.ts +4 -0
- package/lib/coupon-list/Coupon.js +140 -0
- package/lib/coupon-list/CouponList.d.ts +4 -0
- package/lib/coupon-list/CouponList.js +198 -0
- package/lib/coupon-list/PropsType.d.ts +59 -0
- package/lib/coupon-list/PropsType.js +6 -0
- package/lib/coupon-list/index.d.ts +3 -0
- package/lib/coupon-list/index.js +14 -0
- package/lib/coupon-list/style/index.css +194 -0
- package/lib/coupon-list/style/var.css +0 -0
- package/lib/datetime-picker/DatePicker.d.ts +4 -0
- package/lib/datetime-picker/DatePicker.js +262 -0
- package/lib/datetime-picker/DatetimePicker.d.ts +6 -0
- package/lib/datetime-picker/DatetimePicker.js +45 -0
- package/lib/datetime-picker/PropsType.d.ts +49 -0
- package/lib/datetime-picker/PropsType.js +6 -0
- package/lib/datetime-picker/TimePicker.d.ts +4 -0
- package/lib/datetime-picker/TimePicker.js +129 -0
- package/lib/datetime-picker/index.d.ts +3 -0
- package/lib/datetime-picker/index.js +13 -0
- package/lib/datetime-picker/utils.d.ts +5 -0
- package/lib/datetime-picker/utils.js +47 -0
- package/lib/dialog/Dialog.d.ts +4 -0
- package/lib/dialog/Dialog.js +178 -0
- package/lib/dialog/PropsType.d.ts +70 -0
- package/lib/dialog/PropsType.js +6 -0
- package/lib/dialog/index.d.ts +4 -0
- package/lib/dialog/index.js +16 -0
- package/lib/dialog/method.d.ts +3 -0
- package/lib/dialog/method.js +177 -0
- package/lib/dialog/style/index.css +121 -0
- package/lib/dialog/style/var.css +0 -0
- package/lib/divider/Divider.d.ts +4 -0
- package/lib/divider/Divider.js +53 -0
- package/lib/divider/PropsType.d.ts +22 -0
- package/lib/divider/PropsType.js +6 -0
- package/lib/divider/index.d.ts +4 -0
- package/lib/divider/index.js +14 -0
- package/lib/divider/style/index.css +72 -0
- package/lib/divider/style/var.css +0 -0
- package/lib/dropdown-menu/DropdownMenu.d.ts +4 -0
- package/lib/dropdown-menu/DropdownMenu.js +235 -0
- package/lib/dropdown-menu/DropdownMenuContext.d.ts +11 -0
- package/lib/dropdown-menu/DropdownMenuContext.js +16 -0
- package/lib/dropdown-menu/DropdownMenuItem.d.ts +4 -0
- package/lib/dropdown-menu/DropdownMenuItem.js +189 -0
- package/lib/dropdown-menu/PropsType.d.ts +95 -0
- package/lib/dropdown-menu/PropsType.js +6 -0
- package/lib/dropdown-menu/index.d.ts +8 -0
- package/lib/dropdown-menu/index.js +14 -0
- package/lib/dropdown-menu/style/index.css +104 -0
- package/lib/dropdown-menu/style/var.css +0 -0
- package/lib/empty/Empty.d.ts +4 -0
- package/lib/empty/Empty.js +89 -0
- package/lib/empty/Network.d.ts +1 -0
- package/lib/empty/Network.js +156 -0
- package/lib/empty/PropsType.d.ts +9 -0
- package/lib/empty/PropsType.js +6 -0
- package/lib/empty/index.d.ts +4 -0
- package/lib/empty/index.js +14 -0
- package/lib/empty/style/index.css +36 -0
- package/lib/empty/style/var.css +0 -0
- package/lib/field/Field.d.ts +7 -0
- package/lib/field/Field.js +325 -0
- package/lib/field/PropsType.d.ts +82 -0
- package/lib/field/PropsType.js +6 -0
- package/lib/field/index.d.ts +5 -0
- package/lib/field/index.js +16 -0
- package/lib/field/style/index.css +132 -0
- package/lib/field/style/var.css +0 -0
- package/lib/flex/Flex.d.ts +4 -0
- package/lib/flex/Flex.js +76 -0
- package/lib/flex/FlexContext.d.ts +6 -0
- package/lib/flex/FlexContext.js +16 -0
- package/lib/flex/FlexItem.d.ts +4 -0
- package/lib/flex/FlexItem.js +77 -0
- package/lib/flex/PropsType.d.ts +35 -0
- package/lib/flex/PropsType.js +6 -0
- package/lib/flex/index.d.ts +8 -0
- package/lib/flex/index.js +14 -0
- package/lib/flex/style/index.css +187 -0
- package/lib/flex/style/mixins.css +0 -0
- package/lib/floating-ball/FloatingBall.d.ts +4 -0
- package/lib/floating-ball/FloatingBall.js +298 -0
- package/lib/floating-ball/FloatingBallContext.d.ts +6 -0
- package/lib/floating-ball/FloatingBallContext.js +16 -0
- package/lib/floating-ball/FloatingBallItem.d.ts +3 -0
- package/lib/floating-ball/FloatingBallItem.js +42 -0
- package/lib/floating-ball/PropsType.d.ts +77 -0
- package/lib/floating-ball/PropsType.js +6 -0
- package/lib/floating-ball/index.d.ts +4 -0
- package/lib/floating-ball/index.js +14 -0
- package/lib/floating-ball/style/index.css +197 -0
- package/lib/floating-ball/style/var.css +4 -0
- package/lib/floating-ball/useFloatingTouch.d.ts +66 -0
- package/lib/floating-ball/useFloatingTouch.js +119 -0
- package/lib/floating-panel/FloatingPanel.d.ts +4 -0
- package/lib/floating-panel/FloatingPanel.js +157 -0
- package/lib/floating-panel/PropsType.d.ts +8 -0
- package/lib/floating-panel/PropsType.js +6 -0
- package/lib/floating-panel/index.d.ts +6 -0
- package/lib/floating-panel/index.js +16 -0
- package/lib/floating-panel/style/index.css +38 -0
- package/lib/floating-panel/style/var.css +0 -0
- package/lib/form/Form.d.ts +10 -0
- package/lib/form/Form.js +86 -0
- package/lib/form/FormContext.d.ts +11 -0
- package/lib/form/FormContext.js +22 -0
- package/lib/form/FormItem.d.ts +4 -0
- package/lib/form/FormItem.js +233 -0
- package/lib/form/FormSubscribe.d.ts +16 -0
- package/lib/form/FormSubscribe.js +50 -0
- package/lib/form/PropsType.d.ts +41 -0
- package/lib/form/PropsType.js +6 -0
- package/lib/form/index.d.ts +19 -0
- package/lib/form/index.js +25 -0
- package/lib/form/style/index.css +8 -0
- package/lib/form/style/var.css +0 -0
- package/lib/form/utils.d.ts +1 -0
- package/lib/form/utils.js +29 -0
- package/lib/grid/Grid.d.ts +4 -0
- package/lib/grid/Grid.js +66 -0
- package/lib/grid/GridItem.d.ts +8 -0
- package/lib/grid/GridItem.js +160 -0
- package/lib/grid/PropsType.d.ts +40 -0
- package/lib/grid/PropsType.js +6 -0
- package/lib/grid/index.d.ts +11 -0
- package/lib/grid/index.js +19 -0
- package/lib/grid/style/index.css +80 -0
- package/lib/grid/style/var.css +0 -0
- package/lib/hooks/create-update-effect.d.ts +4 -0
- package/lib/hooks/create-update-effect.js +31 -0
- package/lib/hooks/index.d.ts +38 -0
- package/lib/hooks/index.js +145 -0
- package/lib/hooks/use-click-away.d.ts +5 -0
- package/lib/hooks/use-click-away.js +37 -0
- package/lib/hooks/use-count-down.d.ts +32 -0
- package/lib/hooks/use-count-down.js +124 -0
- package/lib/hooks/use-debunce-effect.d.ts +4 -0
- package/lib/hooks/use-debunce-effect.js +30 -0
- package/lib/hooks/use-debunce-fn.d.ts +18 -0
- package/lib/hooks/use-debunce-fn.js +42 -0
- package/lib/hooks/use-drag-and-pinch.d.ts +1 -0
- package/lib/hooks/use-drag-and-pinch.js +15 -0
- package/lib/hooks/use-effect-with-target.d.ts +4 -0
- package/lib/hooks/use-effect-with-target.js +66 -0
- package/lib/hooks/use-event-listener.d.ts +11 -0
- package/lib/hooks/use-event-listener.js +68 -0
- package/lib/hooks/use-form-smart.d.ts +20 -0
- package/lib/hooks/use-form-smart.js +67 -0
- package/lib/hooks/use-height.d.ts +4 -0
- package/lib/hooks/use-height.js +26 -0
- package/lib/hooks/use-in-viewport.d.ts +8 -0
- package/lib/hooks/use-in-viewport.js +41 -0
- package/lib/hooks/use-isomorphic-layout-effect.d.ts +4 -0
- package/lib/hooks/use-isomorphic-layout-effect.js +19 -0
- package/lib/hooks/use-latest.d.ts +3 -0
- package/lib/hooks/use-latest.js +20 -0
- package/lib/hooks/use-lazy-effect.d.ts +3 -0
- package/lib/hooks/use-lazy-effect.js +24 -0
- package/lib/hooks/use-lazy-render.d.ts +3 -0
- package/lib/hooks/use-lazy-render.js +24 -0
- package/lib/hooks/use-lock-fn.d.ts +2 -0
- package/lib/hooks/use-lock-fn.js +37 -0
- package/lib/hooks/use-lock-scroll.d.ts +2 -0
- package/lib/hooks/use-lock-scroll.js +75 -0
- package/lib/hooks/use-memoized-fn.d.ts +3 -0
- package/lib/hooks/use-memoized-fn.js +35 -0
- package/lib/hooks/use-merged-state.d.ts +5 -0
- package/lib/hooks/use-merged-state.js +35 -0
- package/lib/hooks/use-mount.d.ts +2 -0
- package/lib/hooks/use-mount.js +21 -0
- package/lib/hooks/use-next-tick.d.ts +2 -0
- package/lib/hooks/use-next-tick.js +30 -0
- package/lib/hooks/use-page-visibility.d.ts +3 -0
- package/lib/hooks/use-page-visibility.js +35 -0
- package/lib/hooks/use-props-value.d.ts +8 -0
- package/lib/hooks/use-props-value.js +38 -0
- package/lib/hooks/use-rect.d.ts +11 -0
- package/lib/hooks/use-rect.js +38 -0
- package/lib/hooks/use-ref-state.d.ts +4 -0
- package/lib/hooks/use-ref-state.js +26 -0
- package/lib/hooks/use-refs.d.ts +1 -0
- package/lib/hooks/use-refs.js +26 -0
- package/lib/hooks/use-resize-effect.d.ts +2 -0
- package/lib/hooks/use-resize-effect.js +27 -0
- package/lib/hooks/use-scroll-parent.d.ts +5 -0
- package/lib/hooks/use-scroll-parent.js +58 -0
- package/lib/hooks/use-set-state.d.ts +3 -0
- package/lib/hooks/use-set-state.js +28 -0
- package/lib/hooks/use-throttle-fn.d.ts +17 -0
- package/lib/hooks/use-throttle-fn.js +41 -0
- package/lib/hooks/use-touch.d.ts +17 -0
- package/lib/hooks/use-touch.js +80 -0
- package/lib/hooks/use-unmount.d.ts +2 -0
- package/lib/hooks/use-unmount.js +30 -0
- package/lib/hooks/use-unmounted-ref.d.ts +2 -0
- package/lib/hooks/use-unmounted-ref.js +26 -0
- package/lib/hooks/use-update-effect.d.ts +3 -0
- package/lib/hooks/use-update-effect.js +26 -0
- package/lib/hooks/use-update.d.ts +2 -0
- package/lib/hooks/use-update.js +19 -0
- package/lib/hooks/use-visibility-change.d.ts +2 -0
- package/lib/hooks/use-visibility-change.js +46 -0
- package/lib/hooks/use-window-size.d.ts +5 -0
- package/lib/hooks/use-window-size.js +32 -0
- package/lib/image/Image.d.ts +4 -0
- package/lib/image/Image.js +154 -0
- package/lib/image/LazyImage.d.ts +9 -0
- package/lib/image/LazyImage.js +95 -0
- package/lib/image/PropsType.d.ts +55 -0
- package/lib/image/PropsType.js +6 -0
- package/lib/image/index.d.ts +5 -0
- package/lib/image/index.js +16 -0
- package/lib/image/style/index.css +70 -0
- package/lib/image/style/var.css +0 -0
- package/lib/image-preview/ImagePreview.d.ts +6 -0
- package/lib/image-preview/ImagePreview.js +131 -0
- package/lib/image-preview/PropsType.d.ts +47 -0
- package/lib/image-preview/PropsType.js +6 -0
- package/lib/image-preview/index.d.ts +4 -0
- package/lib/image-preview/index.js +16 -0
- package/lib/image-preview/method.d.ts +3 -0
- package/lib/image-preview/method.js +98 -0
- package/lib/image-preview/slide.d.ts +12 -0
- package/lib/image-preview/slide.js +205 -0
- package/lib/image-preview/slides.d.ts +14 -0
- package/lib/image-preview/slides.js +132 -0
- package/lib/image-preview/style/index.css +118 -0
- package/lib/image-preview/style/var.css +0 -0
- package/lib/index-bar/IndexAnchor.d.ts +5 -0
- package/lib/index-bar/IndexAnchor.js +124 -0
- package/lib/index-bar/IndexBar.d.ts +4 -0
- package/lib/index-bar/IndexBar.js +280 -0
- package/lib/index-bar/IndexBarContext.d.ts +8 -0
- package/lib/index-bar/IndexBarContext.js +16 -0
- package/lib/index-bar/PropsType.d.ts +37 -0
- package/lib/index-bar/PropsType.js +6 -0
- package/lib/index-bar/index.d.ts +8 -0
- package/lib/index-bar/index.js +19 -0
- package/lib/index-bar/style/index.css +54 -0
- package/lib/index-bar/style/var.css +0 -0
- package/lib/index.css +6711 -0
- package/lib/index.d.ts +73 -0
- package/lib/index.js +869 -0
- package/lib/index.min.css +1 -0
- package/lib/input/Input.d.ts +4 -0
- package/lib/input/Input.js +204 -0
- package/lib/input/PropsType.d.ts +55 -0
- package/lib/input/PropsType.js +6 -0
- package/lib/input/index.d.ts +9 -0
- package/lib/input/index.js +14 -0
- package/lib/input/style/index.css +82 -0
- package/lib/input/style/var.css +0 -0
- package/lib/lazyload/Lazyload.d.ts +4 -0
- package/lib/lazyload/Lazyload.js +62 -0
- package/lib/lazyload/PropsType.d.ts +9 -0
- package/lib/lazyload/PropsType.js +6 -0
- package/lib/lazyload/index.d.ts +4 -0
- package/lib/lazyload/index.js +16 -0
- package/lib/lazyload/style/index.css +5 -0
- package/lib/lazyload/style/var.css +0 -0
- package/lib/list/List.d.ts +4 -0
- package/lib/list/List.js +50 -0
- package/lib/list/LoadMore.d.ts +4 -0
- package/lib/list/LoadMore.js +165 -0
- package/lib/list/PropsType.d.ts +31 -0
- package/lib/list/PropsType.js +6 -0
- package/lib/list/index.d.ts +5 -0
- package/lib/list/index.js +16 -0
- package/lib/list/style/index.css +18 -0
- package/lib/list/style/var.css +0 -0
- package/lib/loading/Loading.d.ts +4 -0
- package/lib/loading/Loading.js +114 -0
- package/lib/loading/PropsType.d.ts +25 -0
- package/lib/loading/PropsType.js +6 -0
- package/lib/loading/index.d.ts +5 -0
- package/lib/loading/index.js +16 -0
- package/lib/loading/style/index.css +199 -0
- package/lib/loading/style/var.css +0 -0
- package/lib/locale/index.d.ts +7 -0
- package/lib/locale/index.js +55 -0
- package/lib/locale/lang/base.d.ts +75 -0
- package/lib/locale/lang/base.js +81 -0
- package/lib/locale/lang/en-US.d.ts +75 -0
- package/lib/locale/lang/en-US.js +81 -0
- package/lib/locale/lang/fr-FR.d.ts +74 -0
- package/lib/locale/lang/fr-FR.js +80 -0
- package/lib/locale/lang/ja-JP.d.ts +75 -0
- package/lib/locale/lang/ja-JP.js +81 -0
- package/lib/locale/lang/types.d.ts +75 -0
- package/lib/locale/lang/types.js +6 -0
- package/lib/locale/lang/zh-CN.d.ts +11 -0
- package/lib/locale/lang/zh-CN.js +15 -0
- package/lib/locale/lang/zh-HK.d.ts +75 -0
- package/lib/locale/lang/zh-HK.js +81 -0
- package/lib/locale/lang/zh-TW.d.ts +75 -0
- package/lib/locale/lang/zh-TW.js +81 -0
- package/lib/nav-bar/Navbar.d.ts +4 -0
- package/lib/nav-bar/Navbar.js +136 -0
- package/lib/nav-bar/PropsType.d.ts +25 -0
- package/lib/nav-bar/PropsType.js +6 -0
- package/lib/nav-bar/index.d.ts +4 -0
- package/lib/nav-bar/index.js +14 -0
- package/lib/nav-bar/style/index.css +72 -0
- package/lib/nav-bar/style/var.css +0 -0
- package/lib/notice-bar/NoticeBar.d.ts +4 -0
- package/lib/notice-bar/NoticeBar.js +208 -0
- package/lib/notice-bar/PropsType.d.ts +36 -0
- package/lib/notice-bar/PropsType.js +6 -0
- package/lib/notice-bar/index.d.ts +4 -0
- package/lib/notice-bar/index.js +14 -0
- package/lib/notice-bar/style/index.css +62 -0
- package/lib/notice-bar/style/var.css +0 -0
- package/lib/notify/Notify.d.ts +4 -0
- package/lib/notify/Notify.js +66 -0
- package/lib/notify/PropsType.d.ts +59 -0
- package/lib/notify/PropsType.js +6 -0
- package/lib/notify/index.d.ts +5 -0
- package/lib/notify/index.js +16 -0
- package/lib/notify/method.d.ts +11 -0
- package/lib/notify/method.js +138 -0
- package/lib/notify/style/index.css +35 -0
- package/lib/notify/style/var.css +0 -0
- package/lib/number-keyboard/NumberKeyboard.d.ts +4 -0
- package/lib/number-keyboard/NumberKeyboard.js +264 -0
- package/lib/number-keyboard/NumberKeyboardKey.d.ts +4 -0
- package/lib/number-keyboard/NumberKeyboardKey.js +137 -0
- package/lib/number-keyboard/PropsType.d.ts +75 -0
- package/lib/number-keyboard/PropsType.js +6 -0
- package/lib/number-keyboard/index.d.ts +5 -0
- package/lib/number-keyboard/index.js +16 -0
- package/lib/number-keyboard/style/index.css +134 -0
- package/lib/number-keyboard/style/var.css +0 -0
- package/lib/overlay/Overlay.d.ts +4 -0
- package/lib/overlay/Overlay.js +92 -0
- package/lib/overlay/PropsType.d.ts +17 -0
- package/lib/overlay/PropsType.js +6 -0
- package/lib/overlay/index.d.ts +5 -0
- package/lib/overlay/index.js +16 -0
- package/lib/overlay/style/index.css +13 -0
- package/lib/overlay/style/var.css +0 -0
- package/lib/pagination/Pagination.d.ts +4 -0
- package/lib/pagination/Pagination.js +164 -0
- package/lib/pagination/PropsType.d.ts +33 -0
- package/lib/pagination/PropsType.js +6 -0
- package/lib/pagination/index.d.ts +4 -0
- package/lib/pagination/index.js +14 -0
- package/lib/pagination/style/index.css +69 -0
- package/lib/pagination/style/var.css +0 -0
- package/lib/password-input/PasswordInput.d.ts +4 -0
- package/lib/password-input/PasswordInput.js +219 -0
- package/lib/password-input/PropsType.d.ts +36 -0
- package/lib/password-input/PropsType.js +6 -0
- package/lib/password-input/index.d.ts +4 -0
- package/lib/password-input/index.js +14 -0
- package/lib/password-input/style/index.css +112 -0
- package/lib/password-input/style/var.css +0 -0
- package/lib/picker/Picker.d.ts +7 -0
- package/lib/picker/Picker.js +341 -0
- package/lib/picker/PickerColumn.d.ts +8 -0
- package/lib/picker/PickerColumn.js +295 -0
- package/lib/picker/PropsType.d.ts +106 -0
- package/lib/picker/PropsType.js +6 -0
- package/lib/picker/columnsExtend.d.ts +9 -0
- package/lib/picker/columnsExtend.js +138 -0
- package/lib/picker/index.d.ts +5 -0
- package/lib/picker/index.js +16 -0
- package/lib/picker/style/index.css +113 -0
- package/lib/picker/style/var.css +0 -0
- package/lib/popover/Popover.d.ts +4 -0
- package/lib/popover/Popover.js +226 -0
- package/lib/popover/PropsType.d.ts +71 -0
- package/lib/popover/PropsType.js +6 -0
- package/lib/popover/index.d.ts +5 -0
- package/lib/popover/index.js +16 -0
- package/lib/popover/style/index.css +213 -0
- package/lib/popover/style/var.css +0 -0
- package/lib/popup/Popup.d.ts +5 -0
- package/lib/popup/Popup.js +254 -0
- package/lib/popup/PopupContext.d.ts +6 -0
- package/lib/popup/PopupContext.js +16 -0
- package/lib/popup/PropsType.d.ts +72 -0
- package/lib/popup/PropsType.js +6 -0
- package/lib/popup/index.d.ts +5 -0
- package/lib/popup/index.js +16 -0
- package/lib/popup/style/index.css +132 -0
- package/lib/popup/style/var.css +0 -0
- package/lib/product-card/ProductCard.d.ts +4 -0
- package/lib/product-card/ProductCard.js +170 -0
- package/lib/product-card/PropsType.d.ts +40 -0
- package/lib/product-card/PropsType.js +6 -0
- package/lib/product-card/index.d.ts +3 -0
- package/lib/product-card/index.js +14 -0
- package/lib/product-card/style/index.css +108 -0
- package/lib/product-card/style/var.css +0 -0
- package/lib/progress/Progress.d.ts +4 -0
- package/lib/progress/Progress.js +86 -0
- package/lib/progress/PropsType.d.ts +13 -0
- package/lib/progress/PropsType.js +6 -0
- package/lib/progress/index.d.ts +4 -0
- package/lib/progress/index.js +14 -0
- package/lib/progress/style/index.css +41 -0
- package/lib/progress/style/var.css +0 -0
- package/lib/pull-refresh/PropsType.d.ts +39 -0
- package/lib/pull-refresh/PropsType.js +6 -0
- package/lib/pull-refresh/PullRefresh.d.ts +4 -0
- package/lib/pull-refresh/PullRefresh.js +261 -0
- package/lib/pull-refresh/index.d.ts +4 -0
- package/lib/pull-refresh/index.js +14 -0
- package/lib/pull-refresh/style/index.css +31 -0
- package/lib/pull-refresh/style/var.css +0 -0
- package/lib/radio/PropsType.d.ts +24 -0
- package/lib/radio/PropsType.js +6 -0
- package/lib/radio/Radio.d.ts +3 -0
- package/lib/radio/Radio.js +55 -0
- package/lib/radio/RadioContext.d.ts +11 -0
- package/lib/radio/RadioContext.js +16 -0
- package/lib/radio/RadioGroup.d.ts +3 -0
- package/lib/radio/RadioGroup.js +54 -0
- package/lib/radio/index.d.ts +8 -0
- package/lib/radio/index.js +19 -0
- package/lib/radio/style/index.css +90 -0
- package/lib/radio/style/var.css +0 -0
- package/lib/rate/PropsType.d.ts +55 -0
- package/lib/rate/PropsType.js +6 -0
- package/lib/rate/Rate.d.ts +4 -0
- package/lib/rate/Rate.js +238 -0
- package/lib/rate/index.d.ts +4 -0
- package/lib/rate/index.js +14 -0
- package/lib/rate/style/index.css +43 -0
- package/lib/rate/style/var.css +0 -0
- package/lib/search/PropsType.d.ts +29 -0
- package/lib/search/PropsType.js +6 -0
- package/lib/search/Search.d.ts +4 -0
- package/lib/search/Search.js +191 -0
- package/lib/search/index.d.ts +4 -0
- package/lib/search/index.js +14 -0
- package/lib/search/style/index.css +64 -0
- package/lib/search/style/var.css +0 -0
- package/lib/selector/CheckMark.d.ts +2 -0
- package/lib/selector/CheckMark.js +61 -0
- package/lib/selector/PropsType.d.ts +25 -0
- package/lib/selector/PropsType.js +6 -0
- package/lib/selector/Selector.d.ts +2 -0
- package/lib/selector/Selector.js +88 -0
- package/lib/selector/index.d.ts +4 -0
- package/lib/selector/index.js +14 -0
- package/lib/selector/style/index.css +69 -0
- package/lib/selector/style/var.css +0 -0
- package/lib/share-sheet/PropsType.d.ts +29 -0
- package/lib/share-sheet/PropsType.js +6 -0
- package/lib/share-sheet/ShareSheet.d.ts +4 -0
- package/lib/share-sheet/ShareSheet.js +151 -0
- package/lib/share-sheet/index.d.ts +5 -0
- package/lib/share-sheet/index.js +16 -0
- package/lib/share-sheet/style/index.css +103 -0
- package/lib/share-sheet/style/var.css +0 -0
- package/lib/sidebar/PropsType.d.ts +41 -0
- package/lib/sidebar/PropsType.js +6 -0
- package/lib/sidebar/Sidebar.d.ts +4 -0
- package/lib/sidebar/Sidebar.js +98 -0
- package/lib/sidebar/SidebarItem.d.ts +4 -0
- package/lib/sidebar/SidebarItem.js +63 -0
- package/lib/sidebar/index.d.ts +8 -0
- package/lib/sidebar/index.js +19 -0
- package/lib/sidebar/style/index.css +77 -0
- package/lib/sidebar/style/var.css +0 -0
- package/lib/skeleton/PropsType.d.ts +31 -0
- package/lib/skeleton/PropsType.js +6 -0
- package/lib/skeleton/Skeleton.d.ts +4 -0
- package/lib/skeleton/Skeleton.js +122 -0
- package/lib/skeleton/index.d.ts +5 -0
- package/lib/skeleton/index.js +16 -0
- package/lib/skeleton/style/index.css +56 -0
- package/lib/skeleton/style/var.css +0 -0
- package/lib/sku/PropsType.d.ts +189 -0
- package/lib/sku/PropsType.js +6 -0
- package/lib/sku/Sku.d.ts +4 -0
- package/lib/sku/Sku.js +537 -0
- package/lib/sku/components/SkuRow.d.ts +7 -0
- package/lib/sku/components/SkuRow.js +60 -0
- package/lib/sku/components/SkuRowItem.d.ts +15 -0
- package/lib/sku/components/SkuRowItem.js +108 -0
- package/lib/sku/components/SkuRowPropItem.d.ts +10 -0
- package/lib/sku/components/SkuRowPropItem.js +64 -0
- package/lib/sku/components/SkuStepper.d.ts +17 -0
- package/lib/sku/components/SkuStepper.js +148 -0
- package/lib/sku/constants.d.ts +13 -0
- package/lib/sku/constants.js +16 -0
- package/lib/sku/index.d.ts +5 -0
- package/lib/sku/index.js +16 -0
- package/lib/sku/style/index.css +283 -0
- package/lib/sku/style/var.css +0 -0
- package/lib/sku/utils.d.ts +25 -0
- package/lib/sku/utils.js +170 -0
- package/lib/slider/PropsType.d.ts +59 -0
- package/lib/slider/PropsType.js +6 -0
- package/lib/slider/Slider.d.ts +4 -0
- package/lib/slider/Slider.js +297 -0
- package/lib/slider/index.d.ts +4 -0
- package/lib/slider/index.js +14 -0
- package/lib/slider/style/index.css +85 -0
- package/lib/slider/style/var.css +0 -0
- package/lib/space/PropsType.d.ts +25 -0
- package/lib/space/PropsType.js +6 -0
- package/lib/space/Space.d.ts +4 -0
- package/lib/space/Space.js +82 -0
- package/lib/space/index.d.ts +4 -0
- package/lib/space/index.js +14 -0
- package/lib/space/style/index.css +56 -0
- package/lib/space/style/var.css +0 -0
- package/lib/stepper/PropsType.d.ts +66 -0
- package/lib/stepper/PropsType.js +6 -0
- package/lib/stepper/Stepper.d.ts +4 -0
- package/lib/stepper/Stepper.js +257 -0
- package/lib/stepper/index.d.ts +5 -0
- package/lib/stepper/index.js +16 -0
- package/lib/stepper/style/index.css +130 -0
- package/lib/stepper/style/var.css +0 -0
- package/lib/steps/PropsType.d.ts +33 -0
- package/lib/steps/PropsType.js +6 -0
- package/lib/steps/Steps.d.ts +4 -0
- package/lib/steps/Steps.js +72 -0
- package/lib/steps/StepsItem.d.ts +4 -0
- package/lib/steps/StepsItem.js +150 -0
- package/lib/steps/index.d.ts +8 -0
- package/lib/steps/index.js +19 -0
- package/lib/steps/style/index.css +143 -0
- package/lib/steps/style/var.css +0 -0
- package/lib/sticky/PropsType.d.ts +25 -0
- package/lib/sticky/PropsType.js +6 -0
- package/lib/sticky/Sticky.d.ts +4 -0
- package/lib/sticky/Sticky.js +150 -0
- package/lib/sticky/index.d.ts +5 -0
- package/lib/sticky/index.js +16 -0
- package/lib/sticky/style/index.css +7 -0
- package/lib/sticky/style/var.css +0 -0
- package/lib/styles/animation.css +130 -0
- package/lib/styles/base.css +310 -0
- package/lib/styles/css-variables.css +66 -0
- package/lib/styles/index.d.ts +1 -0
- package/lib/styles/index.js +4 -0
- package/lib/styles/mixins/ellipsis.css +0 -0
- package/lib/styles/mixins/hairline.css +0 -0
- package/lib/styles/normalize.css +29 -0
- package/lib/styles/var.css +0 -0
- package/lib/submit-bar/PropsType.d.ts +40 -0
- package/lib/submit-bar/PropsType.js +6 -0
- package/lib/submit-bar/SubmitBar.d.ts +4 -0
- package/lib/submit-bar/SubmitBar.js +131 -0
- package/lib/submit-bar/index.d.ts +4 -0
- package/lib/submit-bar/index.js +16 -0
- package/lib/submit-bar/style/index.css +84 -0
- package/lib/submit-bar/style/var.css +0 -0
- package/lib/swipe-cell/PropsType.d.ts +39 -0
- package/lib/swipe-cell/PropsType.js +6 -0
- package/lib/swipe-cell/SwipeCell.d.ts +4 -0
- package/lib/swipe-cell/SwipeCell.js +205 -0
- package/lib/swipe-cell/index.d.ts +4 -0
- package/lib/swipe-cell/index.js +14 -0
- package/lib/swipe-cell/style/index.css +23 -0
- package/lib/swiper/PropsType.d.ts +70 -0
- package/lib/swiper/PropsType.js +6 -0
- package/lib/swiper/Swiper.d.ts +4 -0
- package/lib/swiper/Swiper.js +353 -0
- package/lib/swiper/SwiperItem.d.ts +4 -0
- package/lib/swiper/SwiperItem.js +56 -0
- package/lib/swiper/SwiperPagIndicator.d.ts +4 -0
- package/lib/swiper/SwiperPagIndicator.js +60 -0
- package/lib/swiper/index.d.ts +8 -0
- package/lib/swiper/index.js +14 -0
- package/lib/swiper/style/index.css +107 -0
- package/lib/swiper/style/var.css +0 -0
- package/lib/switch/PropsType.d.ts +25 -0
- package/lib/switch/PropsType.js +6 -0
- package/lib/switch/Switch.d.ts +4 -0
- package/lib/switch/Switch.js +96 -0
- package/lib/switch/index.d.ts +5 -0
- package/lib/switch/index.js +16 -0
- package/lib/switch/style/index.css +60 -0
- package/lib/switch/style/var.css +0 -0
- package/lib/tabbar/PropsType.d.ts +36 -0
- package/lib/tabbar/PropsType.js +6 -0
- package/lib/tabbar/Tabbar.d.ts +4 -0
- package/lib/tabbar/Tabbar.js +106 -0
- package/lib/tabbar/TabbarContext.d.ts +7 -0
- package/lib/tabbar/TabbarContext.js +16 -0
- package/lib/tabbar/TabbarItem.d.ts +4 -0
- package/lib/tabbar/TabbarItem.js +90 -0
- package/lib/tabbar/index.d.ts +8 -0
- package/lib/tabbar/index.js +19 -0
- package/lib/tabbar/style/index.css +54 -0
- package/lib/tabbar/style/var.css +0 -0
- package/lib/tabs/PropsType.d.ts +149 -0
- package/lib/tabs/PropsType.js +6 -0
- package/lib/tabs/TabPane.d.ts +4 -0
- package/lib/tabs/TabPane.js +83 -0
- package/lib/tabs/Tabs.d.ts +4 -0
- package/lib/tabs/Tabs.js +367 -0
- package/lib/tabs/TabsContent.d.ts +4 -0
- package/lib/tabs/TabsContent.js +94 -0
- package/lib/tabs/TabsContext.d.ts +9 -0
- package/lib/tabs/TabsContext.js +16 -0
- package/lib/tabs/TabsTitle.d.ts +4 -0
- package/lib/tabs/TabsTitle.js +125 -0
- package/lib/tabs/index.d.ts +8 -0
- package/lib/tabs/index.js +14 -0
- package/lib/tabs/style/index.css +201 -0
- package/lib/tabs/style/var.css +0 -0
- package/lib/tabs/utils.d.ts +1 -0
- package/lib/tabs/utils.js +47 -0
- package/lib/tag/PropsType.d.ts +26 -0
- package/lib/tag/PropsType.js +6 -0
- package/lib/tag/Tag.d.ts +4 -0
- package/lib/tag/Tag.js +111 -0
- package/lib/tag/index.d.ts +5 -0
- package/lib/tag/index.js +16 -0
- package/lib/tag/style/index.css +110 -0
- package/lib/tag/style/var.css +0 -0
- package/lib/text-area/PropsType.d.ts +32 -0
- package/lib/text-area/PropsType.js +6 -0
- package/lib/text-area/TextArea.d.ts +4 -0
- package/lib/text-area/TextArea.js +215 -0
- package/lib/text-area/index.d.ts +5 -0
- package/lib/text-area/index.js +16 -0
- package/lib/text-area/style/index.css +144 -0
- package/lib/text-area/style/var.css +0 -0
- package/lib/toast/PropsType.d.ts +74 -0
- package/lib/toast/PropsType.js +6 -0
- package/lib/toast/Toast.d.ts +6 -0
- package/lib/toast/Toast.js +125 -0
- package/lib/toast/index.d.ts +5 -0
- package/lib/toast/index.js +16 -0
- package/lib/toast/lock-click.d.ts +1 -0
- package/lib/toast/lock-click.js +21 -0
- package/lib/toast/method.d.ts +3 -0
- package/lib/toast/method.js +159 -0
- package/lib/toast/style/index.css +72 -0
- package/lib/toast/style/var.css +0 -0
- package/lib/typography/Ellipsis.d.ts +4 -0
- package/lib/typography/Ellipsis.js +153 -0
- package/lib/typography/PropsType.d.ts +34 -0
- package/lib/typography/PropsType.js +6 -0
- package/lib/typography/Typography.d.ts +6 -0
- package/lib/typography/Typography.js +149 -0
- package/lib/typography/index.d.ts +12 -0
- package/lib/typography/index.js +33 -0
- package/lib/typography/style/index.css +132 -0
- package/lib/typography/style/var.css +0 -0
- package/lib/uploader/PropsType.d.ts +132 -0
- package/lib/uploader/PropsType.js +6 -0
- package/lib/uploader/Uploader.d.ts +4 -0
- package/lib/uploader/Uploader.js +312 -0
- package/lib/uploader/UploaderPreviewItem.d.ts +3 -0
- package/lib/uploader/UploaderPreviewItem.js +133 -0
- package/lib/uploader/index.d.ts +4 -0
- package/lib/uploader/index.js +14 -0
- package/lib/uploader/style/index.css +166 -0
- package/lib/uploader/style/var.css +0 -0
- package/lib/uploader/utils.d.ts +10 -0
- package/lib/uploader/utils.js +87 -0
- package/lib/utils/base.d.ts +18 -0
- package/lib/utils/base.js +57 -0
- package/lib/utils/bound.d.ts +1 -0
- package/lib/utils/bound.js +17 -0
- package/lib/utils/constant.d.ts +16 -0
- package/lib/utils/constant.js +27 -0
- package/lib/utils/create/bem.d.ts +14 -0
- package/lib/utils/create/bem.js +39 -0
- package/lib/utils/create/index.d.ts +3 -0
- package/lib/utils/create/index.js +14 -0
- package/lib/utils/debounce.d.ts +6 -0
- package/lib/utils/debounce.js +129 -0
- package/lib/utils/deep-assign.d.ts +3 -0
- package/lib/utils/deep-assign.js +26 -0
- package/lib/utils/deep-clone.d.ts +4 -0
- package/lib/utils/deep-clone.js +36 -0
- package/lib/utils/dev-log.d.ts +1 -0
- package/lib/utils/dev-log.js +15 -0
- package/lib/utils/dom/canUseDom.d.ts +1 -0
- package/lib/utils/dom/canUseDom.js +10 -0
- package/lib/utils/dom/event.d.ts +5 -0
- package/lib/utils/dom/event.js +44 -0
- package/lib/utils/dom/getContainer.d.ts +1 -0
- package/lib/utils/dom/getContainer.js +11 -0
- package/lib/utils/dom/getTargetElement.d.ts +4 -0
- package/lib/utils/dom/getTargetElement.js +21 -0
- package/lib/utils/dom/render copy.d.ts +9 -0
- package/lib/utils/dom/render copy.js +87 -0
- package/lib/utils/dom/render.d.ts +9 -0
- package/lib/utils/dom/render.js +103 -0
- package/lib/utils/dom/renderToContainer.d.ts +3 -0
- package/lib/utils/dom/renderToContainer.js +24 -0
- package/lib/utils/dom/scroll.d.ts +12 -0
- package/lib/utils/dom/scroll.js +103 -0
- package/lib/utils/dom/style.d.ts +1 -0
- package/lib/utils/dom/style.js +20 -0
- package/lib/utils/dom/version.d.ts +2 -0
- package/lib/utils/dom/version.js +23 -0
- package/lib/utils/format/number.d.ts +3 -0
- package/lib/utils/format/number.js +43 -0
- package/lib/utils/format/react.d.ts +2 -0
- package/lib/utils/format/react.js +27 -0
- package/lib/utils/format/string.d.ts +2 -0
- package/lib/utils/format/string.js +19 -0
- package/lib/utils/format/unit.d.ts +12 -0
- package/lib/utils/format/unit.js +80 -0
- package/lib/utils/get-default-props.d.ts +2 -0
- package/lib/utils/get-default-props.js +19 -0
- package/lib/utils/index.d.ts +10 -0
- package/lib/utils/index.js +116 -0
- package/lib/utils/interceptor.d.ts +7 -0
- package/lib/utils/interceptor.js +38 -0
- package/lib/utils/interface.d.ts +13 -0
- package/lib/utils/interface.js +6 -0
- package/lib/utils/is-dev.d.ts +1 -0
- package/lib/utils/is-dev.js +8 -0
- package/lib/utils/raf.d.ts +4 -0
- package/lib/utils/raf.js +37 -0
- package/lib/utils/rubberband.d.ts +2 -0
- package/lib/utils/rubberband.js +18 -0
- package/lib/utils/supports-passive.d.ts +1 -0
- package/lib/utils/supports-passive.js +21 -0
- package/lib/utils/throttle.d.ts +7 -0
- package/lib/utils/throttle.js +27 -0
- package/lib/utils/validate/date.d.ts +1 -0
- package/lib/utils/validate/date.js +11 -0
- package/lib/utils/validate/number.d.ts +2 -0
- package/lib/utils/validate/number.js +18 -0
- package/lib/utils/validate/system.d.ts +2 -0
- package/lib/utils/validate/system.js +15 -0
- package/lib/water-mark/PropsType.d.ts +39 -0
- package/lib/water-mark/PropsType.js +6 -0
- package/lib/water-mark/WaterMark.d.ts +4 -0
- package/lib/water-mark/WaterMark.js +127 -0
- package/lib/water-mark/index.d.ts +4 -0
- package/lib/water-mark/index.js +14 -0
- package/lib/water-mark/style/index.css +16 -0
- package/package.json +96 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, forwardRef, useImperativeHandle, useRef, useState, useMemo } from 'react';
|
|
3
|
+
import { Clear } from '@react-vant/icons';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { createNamespace, isDef, isObject, resetScroll } from '../utils';
|
|
6
|
+
import { usePropsValue } from '../hooks';
|
|
7
|
+
import { mergeProps } from '../utils/get-default-props';
|
|
8
|
+
const [bem] = createNamespace('textarea');
|
|
9
|
+
const TextArea = forwardRef((p, ref) => {
|
|
10
|
+
const props = mergeProps(p, {
|
|
11
|
+
rows: 2,
|
|
12
|
+
clearIcon: _jsx(Clear, {}),
|
|
13
|
+
clearTrigger: 'focus',
|
|
14
|
+
defaultValue: ''
|
|
15
|
+
});
|
|
16
|
+
const [hasFocus, setHasFocus] = useState(false);
|
|
17
|
+
const nativeTextAreaRef = useRef();
|
|
18
|
+
const compositionStartRef = useRef(false);
|
|
19
|
+
const [value, setValue] = usePropsValue(props);
|
|
20
|
+
const {
|
|
21
|
+
className,
|
|
22
|
+
style,
|
|
23
|
+
name,
|
|
24
|
+
rows,
|
|
25
|
+
placeholder,
|
|
26
|
+
disabled,
|
|
27
|
+
readOnly,
|
|
28
|
+
maxLength,
|
|
29
|
+
showWordLimit,
|
|
30
|
+
autoFocus
|
|
31
|
+
} = props;
|
|
32
|
+
const focus = () => {
|
|
33
|
+
if (nativeTextAreaRef === null || nativeTextAreaRef === void 0 ? void 0 : nativeTextAreaRef.current) {
|
|
34
|
+
nativeTextAreaRef.current.focus();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const blur = () => {
|
|
38
|
+
if (nativeTextAreaRef === null || nativeTextAreaRef === void 0 ? void 0 : nativeTextAreaRef.current) {
|
|
39
|
+
nativeTextAreaRef.current.blur();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
useImperativeHandle(ref, () => ({
|
|
43
|
+
clear: () => {
|
|
44
|
+
setValue('');
|
|
45
|
+
},
|
|
46
|
+
focus,
|
|
47
|
+
blur,
|
|
48
|
+
get nativeElement() {
|
|
49
|
+
return nativeTextAreaRef.current;
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
const adjustSize = () => {
|
|
53
|
+
const input = nativeTextAreaRef.current;
|
|
54
|
+
if (!input) return;
|
|
55
|
+
input.style.height = 'auto';
|
|
56
|
+
let height = input.scrollHeight;
|
|
57
|
+
if (isObject(props.autoSize)) {
|
|
58
|
+
const {
|
|
59
|
+
maxHeight,
|
|
60
|
+
minHeight
|
|
61
|
+
} = props.autoSize;
|
|
62
|
+
if (maxHeight) {
|
|
63
|
+
height = Math.min(height, maxHeight);
|
|
64
|
+
}
|
|
65
|
+
if (minHeight) {
|
|
66
|
+
height = Math.max(height, minHeight);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (height) {
|
|
70
|
+
input.style.height = `${height}px`;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
adjustSize();
|
|
75
|
+
}, [value]);
|
|
76
|
+
const controlClass = React.useMemo(() => {
|
|
77
|
+
return bem('control', [{
|
|
78
|
+
'min-height': !props.autoSize,
|
|
79
|
+
clear: props.clearable
|
|
80
|
+
}]);
|
|
81
|
+
}, [props.autoSize]);
|
|
82
|
+
const handleValueChange = inputValue => {
|
|
83
|
+
var _a;
|
|
84
|
+
let finalValue = inputValue;
|
|
85
|
+
if (!compositionStartRef.current) {
|
|
86
|
+
if (isDef(maxLength) && finalValue.length > +maxLength) {
|
|
87
|
+
finalValue = finalValue.slice(0, maxLength);
|
|
88
|
+
(_a = props.onOverlimit) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
setValue(finalValue);
|
|
92
|
+
};
|
|
93
|
+
const handleFocus = e => {
|
|
94
|
+
var _a;
|
|
95
|
+
setHasFocus(true);
|
|
96
|
+
(_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
97
|
+
// readOnly not work in legacy mobile safari
|
|
98
|
+
if (readOnly) {
|
|
99
|
+
blur();
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const handleBulr = e => {
|
|
103
|
+
var _a;
|
|
104
|
+
setHasFocus(false);
|
|
105
|
+
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
106
|
+
resetScroll();
|
|
107
|
+
};
|
|
108
|
+
const renderWordLimit = () => {
|
|
109
|
+
if (showWordLimit) {
|
|
110
|
+
const currentCount = (value ? `${value}` : '').length;
|
|
111
|
+
return _jsx("div", Object.assign({
|
|
112
|
+
className: clsx(bem('word-limit'))
|
|
113
|
+
}, {
|
|
114
|
+
children: typeof showWordLimit === 'function' ? showWordLimit({
|
|
115
|
+
currentCount,
|
|
116
|
+
maxLength
|
|
117
|
+
}) : _jsxs(_Fragment, {
|
|
118
|
+
children: [_jsx("span", Object.assign({
|
|
119
|
+
className: clsx(bem('word-num'))
|
|
120
|
+
}, {
|
|
121
|
+
children: currentCount
|
|
122
|
+
})), maxLength ? `/${maxLength}` : false]
|
|
123
|
+
})
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
};
|
|
128
|
+
const handleClear = e => {
|
|
129
|
+
var _a;
|
|
130
|
+
setValue('');
|
|
131
|
+
(_a = props.onClear) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
132
|
+
};
|
|
133
|
+
const showClear = useMemo(() => {
|
|
134
|
+
if (props.clearable && !readOnly) {
|
|
135
|
+
const hasValue = value !== '';
|
|
136
|
+
const trigger = props.clearTrigger === 'always' || props.clearTrigger === 'focus' && hasFocus;
|
|
137
|
+
return hasValue && trigger;
|
|
138
|
+
}
|
|
139
|
+
return false;
|
|
140
|
+
}, [value, props.clearTrigger, hasFocus]);
|
|
141
|
+
return _jsxs("div", Object.assign({
|
|
142
|
+
className: clsx(bem(), className),
|
|
143
|
+
style: style
|
|
144
|
+
}, {
|
|
145
|
+
children: [_jsx("textarea", {
|
|
146
|
+
ref: nativeTextAreaRef,
|
|
147
|
+
name: name,
|
|
148
|
+
rows: rows,
|
|
149
|
+
className: clsx(controlClass),
|
|
150
|
+
value: value,
|
|
151
|
+
disabled: disabled,
|
|
152
|
+
autoFocus: autoFocus,
|
|
153
|
+
readOnly: readOnly,
|
|
154
|
+
placeholder: placeholder || '',
|
|
155
|
+
onBlur: handleBulr,
|
|
156
|
+
onFocus: handleFocus,
|
|
157
|
+
onChange: e => {
|
|
158
|
+
var _a;
|
|
159
|
+
return handleValueChange((_a = e === null || e === void 0 ? void 0 : e.currentTarget) === null || _a === void 0 ? void 0 : _a.value);
|
|
160
|
+
},
|
|
161
|
+
onKeyPress: props.onKeyPress,
|
|
162
|
+
onKeyDown: props.onKeyDown,
|
|
163
|
+
onKeyUp: props.onKeyUp,
|
|
164
|
+
autoComplete: props.autoComplete,
|
|
165
|
+
onCompositionStart: e => {
|
|
166
|
+
var _a;
|
|
167
|
+
compositionStartRef.current = true;
|
|
168
|
+
(_a = props.onCompositionStart) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
169
|
+
},
|
|
170
|
+
onCompositionEnd: e => {
|
|
171
|
+
var _a, _b;
|
|
172
|
+
compositionStartRef.current = false;
|
|
173
|
+
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
174
|
+
handleValueChange((_b = e === null || e === void 0 ? void 0 : e.currentTarget) === null || _b === void 0 ? void 0 : _b.value);
|
|
175
|
+
},
|
|
176
|
+
onClick: props.onClick
|
|
177
|
+
}), showClear && React.cloneElement(props.clearIcon, {
|
|
178
|
+
className: clsx(bem('clear')),
|
|
179
|
+
onTouchStart: handleClear
|
|
180
|
+
}), renderWordLimit()]
|
|
181
|
+
}));
|
|
182
|
+
});
|
|
183
|
+
export default TextArea;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--rv-input-text-color: var(--rv-text-color);
|
|
3
|
+
--rv-input-disabled-text-color: var(--rv-gray-5);
|
|
4
|
+
--rv-input-placeholder-text-color: var(--rv-gray-5);
|
|
5
|
+
--rv-input-placeholder-text-font-size: var(--rv-font-size-md);
|
|
6
|
+
--rv-input-background-color: transparent;
|
|
7
|
+
--rv-input-clear-icon-size: 16px;
|
|
8
|
+
--rv-input-clear-icon-color: var(--rv-gray-5);
|
|
9
|
+
}
|
|
10
|
+
.rv-input {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: flex-start;
|
|
13
|
+
align-items: center;
|
|
14
|
+
width: 100%;
|
|
15
|
+
text-align: left;
|
|
16
|
+
}
|
|
17
|
+
.rv-input--center .rv-input__control {
|
|
18
|
+
text-align: center;
|
|
19
|
+
}
|
|
20
|
+
.rv-input--right .rv-input__control {
|
|
21
|
+
text-align: right;
|
|
22
|
+
}
|
|
23
|
+
.rv-input--right .rv-input__clear {
|
|
24
|
+
padding-right: 0;
|
|
25
|
+
}
|
|
26
|
+
.rv-input__control {
|
|
27
|
+
display: block;
|
|
28
|
+
box-sizing: border-box;
|
|
29
|
+
flex: 1;
|
|
30
|
+
width: 100%;
|
|
31
|
+
min-width: 0;
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
color: var(--rv-input-text-color);
|
|
35
|
+
line-height: inherit;
|
|
36
|
+
text-align: inherit;
|
|
37
|
+
background-color: var(--rv-input-background-color);
|
|
38
|
+
border: 0;
|
|
39
|
+
resize: none;
|
|
40
|
+
user-select: auto;
|
|
41
|
+
}
|
|
42
|
+
.rv-input__control::placeholder {
|
|
43
|
+
color: var(--rv-input-placeholder-text-color);
|
|
44
|
+
font-size: var(--rv-input-placeholder-text-font-size);
|
|
45
|
+
}
|
|
46
|
+
.rv-input__control:disabled {
|
|
47
|
+
color: var(--rv-input-disabled-text-color);
|
|
48
|
+
cursor: not-allowed;
|
|
49
|
+
opacity: 1;
|
|
50
|
+
-webkit-text-fill-color: var(--rv-input-disabled-text-color);
|
|
51
|
+
}
|
|
52
|
+
.rv-input__control:read-only {
|
|
53
|
+
cursor: default;
|
|
54
|
+
}
|
|
55
|
+
.rv-input__control[type='date'],
|
|
56
|
+
.rv-input__control[type='time'],
|
|
57
|
+
.rv-input__control[type='datetime-local'] {
|
|
58
|
+
min-height: var(--rv-cell-line-height);
|
|
59
|
+
}
|
|
60
|
+
.rv-input__control[type='search'] {
|
|
61
|
+
-webkit-appearance: none;
|
|
62
|
+
}
|
|
63
|
+
.rv-input__clear {
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
color: var(--rv-input-clear-icon-color);
|
|
66
|
+
font-size: var(--rv-input-clear-icon-size);
|
|
67
|
+
margin-right: calc(var(--rv-padding-xs) * -1);
|
|
68
|
+
padding: 0 var(--rv-padding-xs);
|
|
69
|
+
box-sizing: content-box;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
}
|
|
72
|
+
.rv-input__prefix,
|
|
73
|
+
.rv-input__suffix {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
}
|
|
77
|
+
.rv-input__prefix {
|
|
78
|
+
padding-right: var(--rv-padding-xs);
|
|
79
|
+
}
|
|
80
|
+
.rv-input__suffix {
|
|
81
|
+
padding-left: var(--rv-padding-xs);
|
|
82
|
+
}
|
|
83
|
+
:root {
|
|
84
|
+
--rv-textarea-min-height: 60px;
|
|
85
|
+
--rv-textarea-word-limit-color: var(--rv-gray-7);
|
|
86
|
+
--rv-textarea-word-limit-font-size: var(--rv-font-size-sm);
|
|
87
|
+
--rv-textarea-word-limit-line-height: 16px;
|
|
88
|
+
}
|
|
89
|
+
.rv-textarea {
|
|
90
|
+
position: relative;
|
|
91
|
+
width: 100%;
|
|
92
|
+
max-width: 100%;
|
|
93
|
+
text-align: left;
|
|
94
|
+
}
|
|
95
|
+
.rv-textarea .rv-textarea__control {
|
|
96
|
+
display: block;
|
|
97
|
+
box-sizing: border-box;
|
|
98
|
+
width: 100%;
|
|
99
|
+
min-width: 0;
|
|
100
|
+
margin: 0;
|
|
101
|
+
padding: 0;
|
|
102
|
+
color: var(--rv-input-text-color);
|
|
103
|
+
line-height: inherit;
|
|
104
|
+
text-align: inherit;
|
|
105
|
+
background-color: var(--rv-input-background-color);
|
|
106
|
+
border: 0;
|
|
107
|
+
resize: none;
|
|
108
|
+
user-select: auto;
|
|
109
|
+
}
|
|
110
|
+
.rv-textarea .rv-textarea__control::placeholder {
|
|
111
|
+
color: var(--rv-input-placeholder-text-color);
|
|
112
|
+
font-size: var(--rv-input-placeholder-text-font-size);
|
|
113
|
+
}
|
|
114
|
+
.rv-textarea .rv-textarea__control:disabled {
|
|
115
|
+
color: var(--rv-input-disabled-text-color);
|
|
116
|
+
cursor: not-allowed;
|
|
117
|
+
opacity: 1;
|
|
118
|
+
-webkit-text-fill-color: var(--rv-input-disabled-text-color);
|
|
119
|
+
}
|
|
120
|
+
.rv-textarea .rv-textarea__control:read-only {
|
|
121
|
+
cursor: default;
|
|
122
|
+
}
|
|
123
|
+
.rv-textarea .rv-textarea__control--min-height {
|
|
124
|
+
min-height: var(--rv-textarea-min-height);
|
|
125
|
+
}
|
|
126
|
+
.rv-textarea .rv-textarea__control--clear {
|
|
127
|
+
padding-right: var(--rv-padding-md);
|
|
128
|
+
}
|
|
129
|
+
.rv-textarea .rv-textarea__clear {
|
|
130
|
+
position: absolute;
|
|
131
|
+
top: 4px;
|
|
132
|
+
right: 0;
|
|
133
|
+
z-index: 1;
|
|
134
|
+
color: var(--rv-input-clear-icon-color);
|
|
135
|
+
font-size: var(--rv-input-clear-icon-size);
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
}
|
|
138
|
+
.rv-textarea .rv-textarea__word-limit {
|
|
139
|
+
margin-top: var(--rv-padding-base);
|
|
140
|
+
color: var(--rv-textarea-word-limit-color);
|
|
141
|
+
font-size: var(--rv-textarea-word-limit-font-size);
|
|
142
|
+
line-height: var(--rv-textarea-word-limit-line-height);
|
|
143
|
+
text-align: right;
|
|
144
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LoadingType } from '../loading/PropsType';
|
|
3
|
+
import { BaseTypeProps } from '../utils';
|
|
4
|
+
export declare type ToastType = 'loading' | 'success' | 'fail' | 'info';
|
|
5
|
+
export declare type ToastPosition = 'top' | 'middle' | 'bottom';
|
|
6
|
+
export interface ToastProps extends BaseTypeProps {
|
|
7
|
+
/** 提示类型 */
|
|
8
|
+
type?: ToastType;
|
|
9
|
+
/** 文本内容,支持通过\n换行 */
|
|
10
|
+
message?: number | string;
|
|
11
|
+
/** 展示时长(ms),值为 0 时,toast 不会消失 */
|
|
12
|
+
duration?: number | string;
|
|
13
|
+
/** 自定义图标 */
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
/** 图标大小,如 20px 2em,默认单位为 px */
|
|
16
|
+
iconSize?: number | string;
|
|
17
|
+
/** 加载图标类型, 可选值为 spinner */
|
|
18
|
+
loadingType?: LoadingType;
|
|
19
|
+
/** 是否显示背景遮罩层 */
|
|
20
|
+
overlay?: boolean;
|
|
21
|
+
overlayClass?: string;
|
|
22
|
+
overlayStyle?: React.CSSProperties;
|
|
23
|
+
/** 是否禁止背景点击 */
|
|
24
|
+
forbidClick?: boolean;
|
|
25
|
+
/** 是否在点击遮罩层后关闭 */
|
|
26
|
+
closeOnClickOverlay?: boolean;
|
|
27
|
+
/** 是否在点击后关闭 */
|
|
28
|
+
closeOnClick?: boolean;
|
|
29
|
+
/** 位置,可选值为 top bottom */
|
|
30
|
+
position?: ToastPosition;
|
|
31
|
+
/** 动画类名 */
|
|
32
|
+
transition?: string;
|
|
33
|
+
/** 轻提示弹出时的的父容器 */
|
|
34
|
+
teleport?: HTMLElement | (() => HTMLElement);
|
|
35
|
+
/** 关闭时的回调函数 */
|
|
36
|
+
onClose?: () => void;
|
|
37
|
+
/** 完全展示后的回调函数 */
|
|
38
|
+
onOpened?: () => void;
|
|
39
|
+
}
|
|
40
|
+
export declare type ToastPrivateProps = {
|
|
41
|
+
onClosed?: () => void;
|
|
42
|
+
};
|
|
43
|
+
export declare type ToastOptions = Omit<ToastProps, 'type'> | string;
|
|
44
|
+
export declare type ToastReturnType = {
|
|
45
|
+
/** 动态更新方法 */
|
|
46
|
+
config: React.Dispatch<React.SetStateAction<ToastProps>>;
|
|
47
|
+
/** 清除单例toast */
|
|
48
|
+
clear: () => void;
|
|
49
|
+
};
|
|
50
|
+
export interface ToastInstance {
|
|
51
|
+
(opts: ToastProps | string): ToastReturnType;
|
|
52
|
+
/** 文本提示 */
|
|
53
|
+
info(opts: ToastOptions): ToastReturnType;
|
|
54
|
+
/** 展示加载提示 */
|
|
55
|
+
loading(opts: ToastOptions): ToastReturnType;
|
|
56
|
+
/** 展示成功提示 */
|
|
57
|
+
success(opts: ToastOptions): ToastReturnType;
|
|
58
|
+
/** 展示失败提示 */
|
|
59
|
+
fail(opts: ToastOptions): ToastReturnType;
|
|
60
|
+
/**
|
|
61
|
+
* 修改默认配置,对所有 Toast 生效。
|
|
62
|
+
* 传入 type 可以修改指定类型的默认配置
|
|
63
|
+
*/
|
|
64
|
+
setDefaultOptions(type: ToastType | ToastProps, options?: ToastProps): void;
|
|
65
|
+
/**
|
|
66
|
+
* 重置默认配置,对所有 Toast 生效。
|
|
67
|
+
* 传入 type 可以重置指定类型的默认配置
|
|
68
|
+
*/
|
|
69
|
+
resetDefaultOptions(type?: ToastType): void;
|
|
70
|
+
/** 允许同时存在多个 Toast */
|
|
71
|
+
allowMultiple(value?: boolean): void;
|
|
72
|
+
/** 关闭提示 */
|
|
73
|
+
clear(): void;
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { Cross, Success } from '@react-vant/icons';
|
|
5
|
+
import Popup from '../popup';
|
|
6
|
+
import Loading from '../loading';
|
|
7
|
+
import { lockClick } from './lock-click';
|
|
8
|
+
import { createNamespace, isDef } from '../utils';
|
|
9
|
+
import { mergeProps } from '../utils/get-default-props';
|
|
10
|
+
const [bem] = createNamespace('toast');
|
|
11
|
+
const Toast = p => {
|
|
12
|
+
const props = mergeProps(p, {
|
|
13
|
+
type: 'info',
|
|
14
|
+
duration: 2000,
|
|
15
|
+
position: 'middle',
|
|
16
|
+
transition: 'rv-fade',
|
|
17
|
+
loadingType: 'circular',
|
|
18
|
+
overlay: false
|
|
19
|
+
});
|
|
20
|
+
const onClick = () => {
|
|
21
|
+
if (props.closeOnClick) {
|
|
22
|
+
props.onClose();
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!props.visible) {
|
|
27
|
+
lockClick(false);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
let clickable = false;
|
|
31
|
+
const newValue = props.visible && props.forbidClick;
|
|
32
|
+
if (clickable !== newValue) {
|
|
33
|
+
clickable = newValue;
|
|
34
|
+
lockClick(clickable);
|
|
35
|
+
}
|
|
36
|
+
}, [props.visible, props.forbidClick]);
|
|
37
|
+
const renderIcon = () => {
|
|
38
|
+
const {
|
|
39
|
+
icon,
|
|
40
|
+
type,
|
|
41
|
+
iconSize,
|
|
42
|
+
loadingType
|
|
43
|
+
} = props;
|
|
44
|
+
const hasIcon = icon || type === 'success' || type === 'fail';
|
|
45
|
+
if (hasIcon) {
|
|
46
|
+
const buildInIcon = type === 'fail' ? _jsx(Cross, {}) : _jsx(Success, {});
|
|
47
|
+
return React.cloneElement(icon || buildInIcon, {
|
|
48
|
+
className: clsx(bem('icon')),
|
|
49
|
+
fontSize: iconSize
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (type === 'loading') {
|
|
53
|
+
return _jsx(Loading, {
|
|
54
|
+
className: clsx(bem('loading')),
|
|
55
|
+
type: loadingType
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
};
|
|
60
|
+
const renderMessage = () => {
|
|
61
|
+
const {
|
|
62
|
+
message
|
|
63
|
+
} = props;
|
|
64
|
+
if (isDef(message) && message !== '') {
|
|
65
|
+
return _jsx("div", Object.assign({
|
|
66
|
+
className: clsx(bem('info'))
|
|
67
|
+
}, {
|
|
68
|
+
children: message
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
};
|
|
73
|
+
return _jsxs(Popup, Object.assign({
|
|
74
|
+
className: clsx([bem([props.position, {
|
|
75
|
+
[props.type]: !props.icon
|
|
76
|
+
}]), props.className]),
|
|
77
|
+
visible: props.visible,
|
|
78
|
+
overlay: props.overlay,
|
|
79
|
+
transition: props.transition,
|
|
80
|
+
overlayClass: props.overlayClass,
|
|
81
|
+
overlayStyle: props.overlayStyle,
|
|
82
|
+
closeOnClickOverlay: props.closeOnClickOverlay,
|
|
83
|
+
lockScroll: false,
|
|
84
|
+
onClick: onClick,
|
|
85
|
+
onClose: props.onClose,
|
|
86
|
+
onClosed: props.onClosed,
|
|
87
|
+
onOpened: props.onOpened,
|
|
88
|
+
teleport: props.teleport
|
|
89
|
+
}, {
|
|
90
|
+
children: [renderIcon(), renderMessage()]
|
|
91
|
+
}));
|
|
92
|
+
};
|
|
93
|
+
export default Toast;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function lockClick(lock: boolean): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
let lockCount = 0;
|
|
2
|
+
export function lockClick(lock) {
|
|
3
|
+
if (lock) {
|
|
4
|
+
if (!lockCount) {
|
|
5
|
+
document.body.classList.add('rv-toast--unclickable');
|
|
6
|
+
}
|
|
7
|
+
lockCount += 1;
|
|
8
|
+
} else if (lockCount) {
|
|
9
|
+
lockCount -= 1;
|
|
10
|
+
if (!lockCount) {
|
|
11
|
+
document.body.classList.remove('rv-toast--unclickable');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import { extend, isObject } from '../utils';
|
|
4
|
+
import { resolveContainer } from '../utils/dom/getContainer';
|
|
5
|
+
import { lockClick } from './lock-click';
|
|
6
|
+
import BaseToast from './Toast';
|
|
7
|
+
import { render, unmount } from '../utils/dom/render';
|
|
8
|
+
import canUseDom from '../utils/dom/canUseDom';
|
|
9
|
+
const defaultOptions = {
|
|
10
|
+
message: '',
|
|
11
|
+
className: '',
|
|
12
|
+
type: 'info',
|
|
13
|
+
position: 'middle',
|
|
14
|
+
forbidClick: false,
|
|
15
|
+
duration: 2000,
|
|
16
|
+
teleport: () => document.body
|
|
17
|
+
};
|
|
18
|
+
const toastArray = [];
|
|
19
|
+
let allowMultiple = false;
|
|
20
|
+
let currentOptions = extend({}, defaultOptions);
|
|
21
|
+
// default options of specific type
|
|
22
|
+
const defaultOptionsMap = new Map();
|
|
23
|
+
// 同步的销毁
|
|
24
|
+
function syncClear() {
|
|
25
|
+
let fn = toastArray.pop();
|
|
26
|
+
while (fn) {
|
|
27
|
+
fn();
|
|
28
|
+
fn = toastArray.pop();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// 针对 toast 还没弹出来就立刻销毁的情况,将销毁放到下一个 event loop 中,避免销毁失败。
|
|
32
|
+
function nextTickClear() {
|
|
33
|
+
setTimeout(syncClear);
|
|
34
|
+
}
|
|
35
|
+
// 可返回用于销毁此弹窗的方法
|
|
36
|
+
const ToastObj = p => {
|
|
37
|
+
if (!canUseDom()) return null;
|
|
38
|
+
const props = parseOptions(p);
|
|
39
|
+
const update = {
|
|
40
|
+
config: () => {},
|
|
41
|
+
clear: () => null
|
|
42
|
+
};
|
|
43
|
+
let timer = 0;
|
|
44
|
+
const {
|
|
45
|
+
onClose,
|
|
46
|
+
teleport
|
|
47
|
+
} = props;
|
|
48
|
+
const container = document.createElement('div');
|
|
49
|
+
const bodyContainer = resolveContainer(teleport);
|
|
50
|
+
bodyContainer.appendChild(container);
|
|
51
|
+
const TempToast = () => {
|
|
52
|
+
const options = Object.assign({
|
|
53
|
+
duration: 2000
|
|
54
|
+
}, props);
|
|
55
|
+
const [visible, setVisible] = useState(false);
|
|
56
|
+
const [state, setState] = useState(Object.assign({}, options));
|
|
57
|
+
// clearDOM after animation
|
|
58
|
+
const internalOnClosed = useCallback(() => {
|
|
59
|
+
if (state.forbidClick) {
|
|
60
|
+
lockClick(false);
|
|
61
|
+
}
|
|
62
|
+
setVisible(false);
|
|
63
|
+
window.setTimeout(() => {
|
|
64
|
+
const unmountResult = unmount(container);
|
|
65
|
+
if (unmountResult && container.parentNode) {
|
|
66
|
+
container.parentNode.removeChild(container);
|
|
67
|
+
}
|
|
68
|
+
}, +state.duration || +defaultOptions.duration);
|
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
70
|
+
}, [container]);
|
|
71
|
+
// close with animation
|
|
72
|
+
const destroy = useCallback(() => {
|
|
73
|
+
setVisible(false);
|
|
74
|
+
if (onClose) onClose();
|
|
75
|
+
}, []);
|
|
76
|
+
update.clear = internalOnClosed;
|
|
77
|
+
update.config = useCallback(nextState => {
|
|
78
|
+
setState(prev => typeof nextState === 'function' ? Object.assign(Object.assign({}, prev), nextState(prev)) : Object.assign(Object.assign({}, prev), nextState));
|
|
79
|
+
}, [setState]);
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
setVisible(true);
|
|
82
|
+
if (!allowMultiple) syncClear();
|
|
83
|
+
toastArray.push(internalOnClosed);
|
|
84
|
+
if (state.duration !== 0 && 'duration' in state) {
|
|
85
|
+
timer = window.setTimeout(destroy, +state.duration);
|
|
86
|
+
}
|
|
87
|
+
return () => {
|
|
88
|
+
if (timer !== 0) {
|
|
89
|
+
window.clearTimeout(timer);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
93
|
+
}, []);
|
|
94
|
+
return _jsx(BaseToast, Object.assign({}, state, {
|
|
95
|
+
visible: visible,
|
|
96
|
+
teleport: () => container,
|
|
97
|
+
onClose: destroy,
|
|
98
|
+
onClosed: internalOnClosed
|
|
99
|
+
}));
|
|
100
|
+
};
|
|
101
|
+
render(_jsx(TempToast, {}), container);
|
|
102
|
+
return update;
|
|
103
|
+
};
|
|
104
|
+
function parseOptions(message) {
|
|
105
|
+
if (isObject(message)) {
|
|
106
|
+
return message;
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
message
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
const createMethod = type => options => ToastObj(Object.assign(Object.assign(Object.assign(Object.assign({}, currentOptions), defaultOptionsMap.get(type)), parseOptions(options)), {
|
|
113
|
+
type
|
|
114
|
+
}));
|
|
115
|
+
['info', 'loading', 'success', 'fail'].forEach(method => {
|
|
116
|
+
ToastObj[method] = createMethod(method);
|
|
117
|
+
});
|
|
118
|
+
ToastObj.allowMultiple = (value = true) => {
|
|
119
|
+
allowMultiple = value;
|
|
120
|
+
};
|
|
121
|
+
ToastObj.clear = nextTickClear;
|
|
122
|
+
function setDefaultOptions(type, options) {
|
|
123
|
+
if (typeof type === 'string') {
|
|
124
|
+
defaultOptionsMap.set(type, options);
|
|
125
|
+
} else {
|
|
126
|
+
extend(currentOptions, type);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
ToastObj.setDefaultOptions = setDefaultOptions;
|
|
130
|
+
ToastObj.resetDefaultOptions = type => {
|
|
131
|
+
if (typeof type === 'string') {
|
|
132
|
+
defaultOptionsMap.delete(type);
|
|
133
|
+
} else {
|
|
134
|
+
currentOptions = extend({}, defaultOptions);
|
|
135
|
+
defaultOptionsMap.clear();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const Toast = ToastObj;
|
|
139
|
+
export default Toast;
|