@nutui/nutui-react 3.0.0-beta.9 → 3.0.1
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/CHANGELOG.md +123 -1340
- package/README.md +1 -1
- package/dist/cjs/{utils → hooks}/use-click-away.js +2 -2
- package/dist/cjs/{utils → hooks}/use-custom-event.js +2 -2
- package/dist/cjs/{utils → hooks}/use-isomprphic-layout-effect.js +1 -1
- package/dist/cjs/{utils → hooks}/use-lock-scroll.js +2 -2
- package/dist/cjs/packages/actionsheet/style/style.css +25 -18
- package/dist/cjs/packages/address/address.js +1 -1
- package/dist/cjs/packages/address/style/style.css +62 -57
- package/dist/cjs/packages/animate/animate.js +5 -6
- package/dist/cjs/packages/animate/style/animate.scss +63 -105
- package/dist/cjs/packages/animate/style/style.css +45 -44
- package/dist/cjs/packages/animatingnumbers/style/style.css +3 -3
- package/dist/cjs/packages/audio/style/style.css +60 -64
- package/dist/cjs/packages/avatar/style/style.css +2 -2
- package/dist/cjs/packages/avatarcropper/avatarcropper.js +2 -2
- package/dist/cjs/packages/backtop/style/backtop.scss +0 -4
- package/dist/cjs/packages/backtop/style/index.js +2 -0
- package/dist/cjs/packages/backtop/style/style.css +126 -3
- package/dist/cjs/packages/badge/badge.js +13 -15
- package/dist/cjs/packages/badge/style/style.css +4 -4
- package/dist/cjs/packages/barrage/style/style.css +2 -2
- package/dist/cjs/packages/button/button.js +14 -11
- package/dist/cjs/packages/button/style/button.scss +5 -8
- package/dist/cjs/packages/button/style/style.css +48 -52
- package/dist/cjs/packages/calendar/style/calendar.scss +25 -31
- package/dist/cjs/packages/calendar/style/style.css +40 -39
- package/dist/cjs/packages/calendarcard/calendarcard.js +1 -1
- package/dist/cjs/packages/calendarcard/style/style.css +8 -8
- package/dist/cjs/packages/calendaritem/calendaritem.js +1 -1
- package/dist/cjs/packages/card/style/style.css +8 -8
- package/dist/cjs/packages/cascader/cascader.d.ts +2 -2
- package/dist/cjs/packages/cascader/cascader.js +3 -3
- package/dist/cjs/packages/cascader/style/style.css +52 -47
- package/dist/cjs/packages/cell/style/style.css +8 -8
- package/dist/cjs/packages/cellgroup/style/style.css +3 -3
- package/dist/cjs/packages/checkbox/checkbox.js +10 -9
- package/dist/cjs/packages/checkbox/style/checkbox.scss +32 -26
- package/dist/cjs/packages/checkbox/style/style.css +53 -45
- package/dist/cjs/packages/checkboxgroup/checkboxgroup.js +1 -1
- package/dist/cjs/packages/checkboxgroup/style/checkboxgroup.scss +9 -8
- package/dist/cjs/packages/checkboxgroup/style/style.css +14 -12
- package/dist/cjs/packages/circleprogress/style/style.css +3 -3
- package/dist/cjs/packages/col/style/col.scss +0 -1
- package/dist/cjs/packages/collapse/collapse.js +1 -1
- package/dist/cjs/packages/collapse/style/style.css +11 -11
- package/dist/cjs/packages/collapseitem/style/style.css +11 -11
- package/dist/cjs/packages/configprovider/configprovider.js +3 -3
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/countdown/style/style.css +8 -8
- package/dist/cjs/packages/countup/style/style.css +3 -3
- package/dist/cjs/packages/datepicker/datepicker.d.ts +4 -23
- package/dist/cjs/packages/datepicker/datepicker.js +86 -235
- package/dist/cjs/packages/datepicker/index.d.ts +2 -2
- package/dist/cjs/packages/datepicker/index.js +3 -2
- package/dist/cjs/packages/datepicker/style/style.css +24 -123
- package/dist/cjs/packages/datepicker/types.d.ts +28 -0
- package/dist/cjs/packages/datepicker/types.js +4 -0
- package/dist/cjs/packages/datepicker/utils.d.ts +70 -0
- package/dist/cjs/packages/datepicker/utils.js +240 -0
- package/dist/cjs/packages/datepickerview/datepickerview.d.ts +3 -0
- package/dist/cjs/packages/datepickerview/datepickerview.js +118 -0
- package/dist/cjs/packages/datepickerview/index.d.ts +3 -0
- package/dist/cjs/packages/{sidenavbaritem → datepickerview}/index.js +2 -2
- package/dist/cjs/packages/datepickerview/style/datepickerview.scss +4 -0
- package/dist/cjs/packages/datepickerview/style/index.js +1 -0
- package/dist/cjs/packages/datepickerview/style/style.css +8 -0
- package/dist/cjs/packages/datepickerview/types.d.ts +15 -0
- package/dist/cjs/packages/datepickerview/types.js +4 -0
- package/dist/cjs/packages/dialog/confirm.d.ts +4 -3
- package/dist/cjs/packages/dialog/confirm.js +7 -21
- package/dist/cjs/packages/dialog/content.d.ts +4 -11
- package/dist/cjs/packages/dialog/content.js +30 -14
- package/dist/cjs/packages/dialog/dialog.d.ts +1 -2
- package/dist/cjs/packages/dialog/dialog.js +23 -10
- package/dist/cjs/packages/dialog/dialogwrap.d.ts +3 -14
- package/dist/cjs/packages/dialog/dialogwrap.js +36 -15
- package/dist/cjs/packages/dialog/index.d.ts +1 -2
- package/dist/cjs/packages/dialog/style/dialog.scss +28 -23
- package/dist/cjs/packages/dialog/style/style.css +82 -85
- package/dist/cjs/packages/dialog/types.d.ts +57 -0
- package/dist/cjs/packages/divider/style/style.css +4 -4
- package/dist/cjs/packages/drag/style/drag.scss +1 -0
- package/dist/cjs/packages/drag/style/style.css +1 -0
- package/dist/cjs/packages/elevator/style/style.css +8 -8
- package/dist/cjs/packages/ellipsis/ellipsis.js +1 -1
- package/dist/cjs/packages/empty/style/style.css +3 -3
- package/dist/cjs/packages/fixednav/fixednav.d.ts +2 -15
- package/dist/cjs/packages/fixednav/fixednav.js +20 -23
- package/dist/cjs/packages/fixednav/index.d.ts +1 -2
- package/dist/cjs/packages/fixednav/style/style.css +3 -8
- package/dist/cjs/packages/fixednav/types.d.ts +12 -0
- package/dist/cjs/packages/form/style/style.css +15 -15
- package/dist/cjs/packages/formitem/style/style.css +4 -4
- package/dist/cjs/packages/grid/style/style.css +6 -6
- package/dist/cjs/packages/griditem/style/style.css +5 -5
- package/dist/cjs/packages/hoverbutton/style/hoverbutton.scss +0 -4
- package/dist/cjs/packages/hoverbutton/style/style.css +4 -7
- package/dist/cjs/packages/hoverbuttonitem/style/style.css +4 -4
- package/dist/cjs/packages/image/image.d.ts +3 -2
- package/dist/cjs/packages/image/style/style.css +2 -2
- package/dist/cjs/packages/imagepreview/imagepreview.js +1 -1
- package/dist/cjs/packages/imagepreview/style/style.css +40 -47
- package/dist/cjs/packages/indicator/style/indicator.scss +17 -19
- package/dist/cjs/packages/indicator/style/style.css +15 -23
- package/dist/cjs/packages/infiniteloading/style/style.css +4 -4
- package/dist/cjs/packages/input/input.d.ts +2 -2
- package/dist/cjs/packages/input/input.js +46 -59
- package/dist/cjs/packages/input/style/input.scss +7 -11
- package/dist/cjs/packages/input/style/style.css +13 -15
- package/dist/cjs/packages/inputnumber/inputnumber.js +1 -1
- package/dist/cjs/packages/inputnumber/style/style.css +7 -7
- package/dist/cjs/packages/loading/style/loading.scss +8 -2
- package/dist/cjs/packages/loading/style/style.css +6 -4
- package/dist/cjs/packages/lottie/animation/dark/global.gif +0 -0
- package/dist/cjs/packages/lottie/animation/dark/global.json +1 -0
- package/dist/cjs/packages/lottie/animation/dark/loading.gif +0 -0
- package/dist/cjs/packages/lottie/animation/dark/loading.json +1 -0
- package/dist/cjs/packages/lottie/animation/dark/pulltorefresh-white.gif +0 -0
- package/dist/cjs/packages/lottie/animation/dark/pulltorefresh-white.json +1 -0
- package/dist/cjs/packages/lottie/animation/dark/pulltorefresh.gif +0 -0
- package/dist/cjs/packages/lottie/animation/dark/pulltorefresh.json +1 -0
- package/dist/cjs/packages/lottie/animation/light/global.gif +0 -0
- package/dist/cjs/packages/lottie/animation/light/global.json +1 -0
- package/dist/cjs/packages/lottie/animation/light/loading.gif +0 -0
- package/dist/cjs/packages/lottie/animation/light/loading.json +1 -0
- package/dist/cjs/packages/lottie/animation/light/pulltorefresh.gif +0 -0
- package/dist/cjs/packages/lottie/animation/light/pulltorefresh.json +1 -0
- package/dist/cjs/packages/menu/style/style.css +8 -13
- package/dist/cjs/packages/menuitem/menuitem.js +2 -2
- package/dist/cjs/packages/menuitem/style/style.css +4 -9
- package/dist/cjs/packages/navbar/style/navbar.scss +1 -1
- package/dist/cjs/packages/navbar/style/style.css +3 -3
- package/dist/cjs/packages/noticebar/noticebar.js +1 -1
- package/dist/cjs/packages/notify/style/style.css +4 -4
- package/dist/cjs/packages/numberkeyboard/numberkeyboard.d.ts +1 -1
- package/dist/cjs/packages/numberkeyboard/numberkeyboard.js +2 -2
- package/dist/cjs/packages/numberkeyboard/style/style.css +25 -18
- package/dist/cjs/packages/nutui.react.build.d.ts +17 -17
- package/dist/cjs/packages/nutui.react.build.js +16 -16
- package/dist/cjs/packages/nutui.react.d.ts +25 -25
- package/dist/cjs/packages/nutui.react.js +24 -24
- package/dist/cjs/packages/nutui.react.scss.d.ts +8 -8
- package/dist/cjs/packages/nutui.react.scss.js +8 -8
- package/dist/cjs/packages/overlay/index.d.ts +1 -1
- package/dist/cjs/packages/overlay/overlay.d.ts +2 -12
- package/dist/cjs/packages/overlay/overlay.js +11 -17
- package/dist/cjs/packages/overlay/style/overlay.scss +0 -9
- package/dist/cjs/packages/overlay/style/style.css +1 -6
- package/dist/cjs/packages/overlay/types.d.ts +11 -0
- package/dist/cjs/packages/overlay/types.js +4 -0
- package/dist/cjs/packages/pagination/pagination.js +1 -1
- package/dist/cjs/packages/pagination/style/style.css +7 -7
- package/dist/cjs/packages/picker/index.d.ts +1 -2
- package/dist/cjs/packages/picker/picker.d.ts +3 -26
- package/dist/cjs/packages/picker/picker.js +72 -188
- package/dist/cjs/packages/picker/style/picker.scss +3 -132
- package/dist/cjs/packages/picker/style/style.css +24 -123
- package/dist/cjs/packages/picker/types.d.ts +25 -6
- package/dist/cjs/packages/pickerview/index.d.ts +3 -0
- package/dist/cjs/packages/pickerview/index.js +13 -0
- package/dist/cjs/packages/pickerview/pickerroller.d.ts +7 -0
- package/dist/cjs/packages/pickerview/pickerroller.js +183 -0
- package/dist/cjs/packages/pickerview/pickerview.d.ts +4 -0
- package/dist/cjs/packages/pickerview/pickerview.js +200 -0
- package/dist/cjs/packages/pickerview/style/index.js +1 -0
- package/dist/cjs/packages/pickerview/style/pickerview.scss +79 -0
- package/dist/cjs/packages/pickerview/style/style.css +73 -0
- package/dist/cjs/packages/pickerview/types.d.ts +32 -0
- package/dist/cjs/packages/pickerview/types.js +4 -0
- package/dist/cjs/packages/pickerview/utils.d.ts +14 -0
- package/dist/cjs/packages/pickerview/utils.js +46 -0
- package/dist/cjs/packages/popover/popover.d.ts +3 -3
- package/dist/cjs/packages/popover/popover.js +5 -5
- package/dist/cjs/packages/popover/style/style.css +24 -17
- package/dist/cjs/packages/popover/types.d.ts +3 -2
- package/dist/cjs/packages/popup/index.d.ts +1 -1
- package/dist/cjs/packages/popup/popup.d.ts +2 -24
- package/dist/cjs/packages/popup/popup.js +25 -42
- package/dist/cjs/packages/popup/style/popup.scss +12 -4
- package/dist/cjs/packages/popup/style/style.css +17 -10
- package/dist/cjs/packages/popup/types.d.ts +25 -0
- package/dist/cjs/packages/popup/types.js +6 -0
- package/dist/cjs/packages/price/style/style.css +1 -1
- package/dist/cjs/packages/progress/style/style.css +1 -1
- package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +1 -1
- package/dist/cjs/packages/pulltorefresh/style/pulltorefresh.scss +1 -1
- package/dist/cjs/packages/pulltorefresh/style/style.css +4 -4
- package/dist/cjs/packages/radio/radio.js +1 -1
- package/dist/cjs/packages/radio/style/radio.scss +1 -5
- package/dist/cjs/packages/radio/style/style.css +28 -25
- package/dist/cjs/packages/radiogroup/radiogroup.js +1 -1
- package/dist/cjs/packages/radiogroup/style/radiogroup.scss +10 -2
- package/dist/cjs/packages/radiogroup/style/style.css +14 -8
- package/dist/cjs/packages/range/range.js +3 -3
- package/dist/cjs/packages/range/style/style.css +9 -9
- package/dist/cjs/packages/rate/rate.js +3 -3
- package/dist/cjs/packages/rate/style/style.css +4 -4
- package/dist/cjs/packages/resultpage/style/resultpage.scss +3 -0
- package/dist/cjs/packages/resultpage/style/style.css +5 -2
- package/dist/cjs/packages/searchbar/searchbar.js +0 -1
- package/dist/cjs/packages/searchbar/style/style.css +5 -5
- package/dist/cjs/packages/segmented/segmented.js +1 -1
- package/dist/cjs/packages/segmented/style/style.css +2 -2
- package/dist/cjs/packages/shortpassword/shortpassword.js +8 -10
- package/dist/cjs/packages/shortpassword/style/shortpassword.scss +10 -0
- package/dist/cjs/packages/shortpassword/style/style.css +36 -20
- package/dist/cjs/packages/sidebar/index.d.ts +3 -0
- package/dist/cjs/packages/{sidenavbar → sidebar}/index.js +2 -2
- package/dist/cjs/packages/sidebar/sidebar.d.ts +6 -0
- package/dist/cjs/packages/sidebar/sidebar.js +173 -0
- package/dist/cjs/packages/sidebar/style/index.js +3 -0
- package/dist/cjs/packages/sidebar/style/sidebar.scss +61 -0
- package/dist/cjs/packages/sidebar/style/style.css +79 -0
- package/dist/cjs/packages/sidebar/types.d.ts +16 -0
- package/dist/cjs/packages/sidebar/types.js +4 -0
- package/dist/cjs/packages/sidebaritem/index.d.ts +3 -0
- package/dist/cjs/packages/{subsidenavbar → sidebaritem}/index.js +2 -2
- package/dist/cjs/packages/sidebaritem/sidebaritem.d.ts +9 -0
- package/dist/cjs/packages/sidebaritem/sidebaritem.js +29 -0
- package/dist/cjs/packages/sidebaritem/style/index.js +1 -0
- package/dist/cjs/packages/sidebaritem/style/sidebaritem.scss +16 -0
- package/dist/cjs/packages/sidebaritem/style/style.css +19 -0
- package/dist/cjs/packages/signature/style/style.css +2 -2
- package/dist/cjs/packages/skeleton/style/skeleton.scss +0 -18
- package/dist/cjs/packages/skeleton/style/style.css +5 -11
- package/dist/cjs/packages/step/style/style.css +19 -19
- package/dist/cjs/packages/steps/style/style.css +19 -19
- package/dist/cjs/packages/sticky/sticky.js +2 -2
- package/dist/cjs/packages/swipe/swipe.js +2 -2
- package/dist/cjs/packages/swiper/effects/focus.js +1 -1
- package/dist/cjs/packages/swiper/style/style.css +21 -35
- package/dist/cjs/packages/swiper/style/swiper.scss +10 -12
- package/dist/cjs/packages/swiper/swiper.js +6 -9
- package/dist/cjs/packages/switch/style/style.css +6 -6
- package/dist/cjs/packages/switch/switch.js +1 -1
- package/dist/cjs/packages/tabbar/style/style.css +21 -20
- package/dist/cjs/packages/tabbar/tabbar.js +1 -1
- package/dist/cjs/packages/tabbaritem/style/style.css +20 -19
- package/dist/cjs/packages/tabbaritem/style/tabbaritem.scss +13 -13
- package/dist/cjs/packages/tabbaritem/tabbaritem.js +7 -6
- package/dist/cjs/packages/table/style/style.css +11 -11
- package/dist/cjs/packages/table/table.js +1 -1
- package/dist/cjs/packages/tabpane/style/style.css +1 -1
- package/dist/cjs/packages/tabpane/tabpane.js +2 -2
- package/dist/cjs/packages/tabs/style/style.css +30 -32
- package/dist/cjs/packages/tabs/style/tabs.scss +9 -9
- package/dist/cjs/packages/tabs/tabs.js +37 -54
- package/dist/cjs/packages/tag/style/style.css +5 -5
- package/dist/cjs/packages/tag/style/tag.scss +0 -2
- package/dist/cjs/packages/textarea/style/style.css +13 -13
- package/dist/cjs/packages/textarea/textarea.d.ts +1 -1
- package/dist/cjs/packages/textarea/textarea.js +20 -25
- package/dist/cjs/packages/timedetail/style/style.css +4 -4
- package/dist/cjs/packages/timeselect/style/style.css +26 -19
- package/dist/cjs/packages/toast/Notification.d.ts +6 -20
- package/dist/cjs/packages/toast/Notification.js +8 -7
- package/dist/cjs/packages/toast/index.d.ts +1 -1
- package/dist/cjs/packages/toast/style/style.css +2 -20
- package/dist/cjs/packages/toast/style/toast.scss +0 -13
- package/dist/cjs/packages/toast/toast.d.ts +4 -22
- package/dist/cjs/packages/toast/toast.js +10 -9
- package/dist/cjs/packages/toast/types.d.ts +17 -0
- package/dist/cjs/packages/toast/types.js +4 -0
- package/dist/cjs/packages/tour/style/style.css +28 -21
- package/dist/cjs/packages/tour/tour.d.ts +1 -1
- package/dist/cjs/packages/tour/tour.js +1 -1
- package/dist/cjs/packages/trendarrow/style/style.css +1 -1
- package/dist/cjs/packages/uploader/style/style.css +12 -12
- package/dist/cjs/packages/uploader/types.d.ts +2 -1
- package/dist/cjs/packages/uploader/uploader.js +1 -1
- package/dist/cjs/packages/virtuallist/style/style.css +4 -4
- package/dist/cjs/types/fix-string-literal-union.d.ts +1 -0
- package/dist/cjs/utils/get-rect-by-taro.js +1 -15
- package/dist/cjs/utils/get-system-info.d.ts +19 -0
- package/dist/cjs/utils/get-system-info.js +32 -0
- package/dist/cjs/utils/platform-taro.d.ts +0 -2
- package/dist/cjs/utils/platform-taro.js +0 -21
- package/dist/cjs/utils/px-transform.js +0 -1
- package/dist/es/{utils → hooks}/use-click-away.js +3 -2
- package/dist/es/{utils → hooks}/use-custom-event.js +1 -1
- package/dist/es/{utils → hooks}/use-isomprphic-layout-effect.js +1 -1
- package/dist/es/{utils → hooks}/use-lock-scroll.js +2 -2
- package/dist/es/packages/actionsheet/style/style.css +25 -18
- package/dist/es/packages/address/address.js +1 -1
- package/dist/es/packages/address/style/style.css +62 -57
- package/dist/es/packages/animate/animate.js +5 -6
- package/dist/es/packages/animate/style/animate.scss +63 -105
- package/dist/es/packages/animate/style/style.css +45 -44
- package/dist/es/packages/animatingnumbers/style/style.css +3 -3
- package/dist/es/packages/audio/style/style.css +60 -64
- package/dist/es/packages/avatar/style/style.css +2 -2
- package/dist/es/packages/avatarcropper/avatarcropper.js +2 -2
- package/dist/es/packages/backtop/style/backtop.scss +0 -4
- package/dist/es/packages/backtop/style/index.js +2 -0
- package/dist/es/packages/backtop/style/style.css +126 -3
- package/dist/es/packages/badge/badge.js +13 -15
- package/dist/es/packages/badge/style/style.css +4 -4
- package/dist/es/packages/barrage/style/style.css +2 -2
- package/dist/es/packages/button/button.js +15 -12
- package/dist/es/packages/button/style/button.scss +5 -8
- package/dist/es/packages/button/style/style.css +48 -52
- package/dist/es/packages/calendar/calendar.d.ts +27 -135
- package/dist/es/packages/calendar/style/calendar.scss +25 -31
- package/dist/es/packages/calendar/style/style.css +40 -39
- package/dist/es/packages/calendarcard/calendarcard.js +1 -1
- package/dist/es/packages/calendarcard/style/style.css +8 -8
- package/dist/es/packages/calendaritem/calendaritem.js +1 -1
- package/dist/es/packages/card/style/style.css +8 -8
- package/dist/es/packages/cascader/cascader.d.ts +2 -2
- package/dist/es/packages/cascader/cascader.js +2 -2
- package/dist/es/packages/cascader/style/style.css +52 -47
- package/dist/es/packages/cell/style/style.css +8 -8
- package/dist/es/packages/cellgroup/style/style.css +3 -3
- package/dist/es/packages/checkbox/checkbox.js +10 -9
- package/dist/es/packages/checkbox/style/checkbox.scss +32 -26
- package/dist/es/packages/checkbox/style/style.css +53 -45
- package/dist/es/packages/checkboxgroup/checkboxgroup.js +1 -1
- package/dist/es/packages/checkboxgroup/style/checkboxgroup.scss +9 -8
- package/dist/es/packages/checkboxgroup/style/style.css +14 -12
- package/dist/es/packages/circleprogress/style/style.css +3 -3
- package/dist/es/packages/col/style/col.scss +0 -1
- package/dist/es/packages/collapse/collapse.js +1 -1
- package/dist/es/packages/collapse/style/style.css +11 -11
- package/dist/es/packages/collapseitem/style/style.css +11 -11
- package/dist/es/packages/configprovider/configprovider.js +3 -3
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/countdown/style/style.css +8 -8
- package/dist/es/packages/countup/style/style.css +3 -3
- package/dist/es/packages/datepicker/datepicker.d.ts +4 -91
- package/dist/es/packages/datepicker/datepicker.js +85 -234
- package/dist/es/packages/datepicker/index.d.ts +2 -2
- package/dist/es/packages/datepicker/index.js +1 -1
- package/dist/es/packages/datepicker/style/style.css +24 -123
- package/dist/es/packages/datepicker/types.d.ts +28 -0
- package/dist/es/packages/datepicker/types.js +1 -0
- package/dist/es/packages/datepicker/utils.d.ts +70 -0
- package/dist/es/packages/datepicker/utils.js +248 -0
- package/dist/es/packages/datepickerview/datepickerview.d.ts +3 -0
- package/dist/es/packages/datepickerview/datepickerview.js +106 -0
- package/dist/es/packages/datepickerview/index.d.ts +3 -0
- package/dist/es/packages/datepickerview/index.js +2 -0
- package/dist/es/packages/datepickerview/style/datepickerview.scss +4 -0
- package/dist/es/packages/datepickerview/style/index.js +1 -0
- package/dist/es/packages/datepickerview/style/style.css +8 -0
- package/dist/es/packages/datepickerview/types.d.ts +15 -0
- package/dist/es/packages/datepickerview/types.js +1 -0
- package/dist/es/packages/dialog/confirm.d.ts +4 -3
- package/dist/es/packages/dialog/confirm.js +3 -17
- package/dist/es/packages/dialog/content.d.ts +4 -11
- package/dist/es/packages/dialog/content.js +19 -11
- package/dist/es/packages/dialog/dialog.d.ts +1 -2
- package/dist/es/packages/dialog/dialog.js +25 -12
- package/dist/es/packages/dialog/dialogwrap.d.ts +3 -14
- package/dist/es/packages/dialog/dialogwrap.js +26 -13
- package/dist/es/packages/dialog/index.d.ts +1 -2
- package/dist/es/packages/dialog/style/dialog.scss +28 -23
- package/dist/es/packages/dialog/style/style.css +82 -85
- package/dist/es/packages/dialog/types.d.ts +57 -0
- package/dist/es/packages/divider/style/style.css +4 -4
- package/dist/es/packages/drag/drag.d.ts +6 -30
- package/dist/es/packages/drag/style/drag.scss +1 -0
- package/dist/es/packages/drag/style/style.css +1 -0
- package/dist/es/packages/elevator/style/style.css +8 -8
- package/dist/es/packages/ellipsis/ellipsis.js +1 -1
- package/dist/es/packages/empty/style/style.css +3 -3
- package/dist/es/packages/fixednav/fixednav.d.ts +2 -55
- package/dist/es/packages/fixednav/fixednav.js +19 -22
- package/dist/es/packages/fixednav/index.d.ts +1 -2
- package/dist/es/packages/fixednav/style/style.css +3 -8
- package/dist/es/packages/fixednav/types.d.ts +12 -0
- package/dist/es/packages/form/style/style.css +15 -15
- package/dist/es/packages/formitem/style/style.css +4 -4
- package/dist/es/packages/grid/style/style.css +6 -6
- package/dist/es/packages/griditem/style/style.css +5 -5
- package/dist/es/packages/hoverbutton/style/hoverbutton.scss +0 -4
- package/dist/es/packages/hoverbutton/style/style.css +4 -7
- package/dist/es/packages/hoverbuttonitem/style/style.css +4 -4
- package/dist/es/packages/image/image.d.ts +3 -2
- package/dist/es/packages/image/style/style.css +2 -2
- package/dist/es/packages/imagepreview/imagepreview.js +1 -1
- package/dist/es/packages/imagepreview/style/style.css +40 -47
- package/dist/es/packages/indicator/style/indicator.scss +17 -19
- package/dist/es/packages/indicator/style/style.css +15 -23
- package/dist/es/packages/infiniteloading/style/style.css +4 -4
- package/dist/es/packages/input/input.d.ts +2 -2
- package/dist/es/packages/input/input.js +47 -60
- package/dist/es/packages/input/style/input.scss +7 -11
- package/dist/es/packages/input/style/style.css +13 -15
- package/dist/es/packages/inputnumber/inputnumber.js +1 -1
- package/dist/es/packages/inputnumber/style/style.css +7 -7
- package/dist/es/packages/loading/style/loading.scss +8 -2
- package/dist/es/packages/loading/style/style.css +6 -4
- package/dist/es/packages/lottie/animation/dark/global.gif +0 -0
- package/dist/es/packages/lottie/animation/dark/global.json +1 -0
- package/dist/es/packages/lottie/animation/dark/loading.gif +0 -0
- package/dist/es/packages/lottie/animation/dark/loading.json +1 -0
- package/dist/es/packages/lottie/animation/dark/pulltorefresh-white.gif +0 -0
- package/dist/es/packages/lottie/animation/dark/pulltorefresh-white.json +1 -0
- package/dist/es/packages/lottie/animation/dark/pulltorefresh.gif +0 -0
- package/dist/es/packages/lottie/animation/dark/pulltorefresh.json +1 -0
- package/dist/es/packages/lottie/animation/light/global.gif +0 -0
- package/dist/es/packages/lottie/animation/light/global.json +1 -0
- package/dist/es/packages/lottie/animation/light/loading.gif +0 -0
- package/dist/es/packages/lottie/animation/light/loading.json +1 -0
- package/dist/es/packages/lottie/animation/light/pulltorefresh.gif +0 -0
- package/dist/es/packages/lottie/animation/light/pulltorefresh.json +1 -0
- package/dist/es/packages/menu/style/style.css +8 -13
- package/dist/es/packages/menuitem/menuitem.js +2 -2
- package/dist/es/packages/menuitem/style/style.css +4 -9
- package/dist/es/packages/navbar/style/navbar.scss +1 -1
- package/dist/es/packages/navbar/style/style.css +3 -3
- package/dist/es/packages/noticebar/noticebar.js +1 -1
- package/dist/es/packages/notify/style/style.css +4 -4
- package/dist/es/packages/numberkeyboard/numberkeyboard.d.ts +1 -1
- package/dist/es/packages/numberkeyboard/numberkeyboard.js +1 -1
- package/dist/es/packages/numberkeyboard/style/style.css +25 -18
- package/dist/es/packages/nutui.react.build.d.ts +17 -17
- package/dist/es/packages/nutui.react.build.js +17 -17
- package/dist/es/packages/overlay/index.d.ts +1 -1
- package/dist/es/packages/overlay/overlay.d.ts +2 -12
- package/dist/es/packages/overlay/overlay.js +11 -17
- package/dist/es/packages/overlay/style/overlay.scss +0 -9
- package/dist/es/packages/overlay/style/style.css +1 -6
- package/dist/es/packages/overlay/types.d.ts +11 -0
- package/dist/es/packages/overlay/types.js +1 -0
- package/dist/es/packages/pagination/pagination.js +1 -1
- package/dist/es/packages/pagination/style/style.css +7 -7
- package/dist/es/packages/picker/index.d.ts +1 -2
- package/dist/es/packages/picker/picker.d.ts +3 -82
- package/dist/es/packages/picker/picker.js +71 -187
- package/dist/es/packages/picker/style/picker.scss +3 -132
- package/dist/es/packages/picker/style/style.css +24 -123
- package/dist/es/packages/picker/types.d.ts +25 -6
- package/dist/es/packages/pickerview/index.d.ts +3 -0
- package/dist/es/packages/pickerview/index.js +2 -0
- package/dist/es/packages/pickerview/pickerroller.d.ts +7 -0
- package/dist/es/packages/pickerview/pickerroller.js +172 -0
- package/dist/es/packages/pickerview/pickerview.d.ts +4 -0
- package/dist/es/packages/pickerview/pickerview.js +188 -0
- package/dist/es/packages/pickerview/style/index.js +1 -0
- package/dist/es/packages/pickerview/style/pickerview.scss +79 -0
- package/dist/es/packages/pickerview/style/style.css +73 -0
- package/dist/es/packages/pickerview/types.d.ts +32 -0
- package/dist/es/packages/pickerview/types.js +1 -0
- package/dist/es/packages/pickerview/utils.d.ts +14 -0
- package/dist/es/packages/pickerview/utils.js +28 -0
- package/dist/es/packages/popover/popover.d.ts +3 -3
- package/dist/es/packages/popover/popover.js +4 -4
- package/dist/es/packages/popover/style/style.css +24 -17
- package/dist/es/packages/popover/types.d.ts +3 -2
- package/dist/es/packages/popup/index.d.ts +1 -1
- package/dist/es/packages/popup/popup.d.ts +2 -24
- package/dist/es/packages/popup/popup.js +25 -42
- package/dist/es/packages/popup/style/popup.scss +12 -4
- package/dist/es/packages/popup/style/style.css +17 -10
- package/dist/es/packages/popup/types.d.ts +25 -0
- package/dist/es/packages/popup/types.js +1 -0
- package/dist/es/packages/price/style/style.css +1 -1
- package/dist/es/packages/progress/style/style.css +1 -1
- package/dist/es/packages/pulltorefresh/pulltorefresh.js +1 -1
- package/dist/es/packages/pulltorefresh/style/pulltorefresh.scss +1 -1
- package/dist/es/packages/pulltorefresh/style/style.css +4 -4
- package/dist/es/packages/radio/radio.js +1 -1
- package/dist/es/packages/radio/style/radio.scss +1 -5
- package/dist/es/packages/radio/style/style.css +28 -25
- package/dist/es/packages/radiogroup/radiogroup.js +1 -1
- package/dist/es/packages/radiogroup/style/radiogroup.scss +10 -2
- package/dist/es/packages/radiogroup/style/style.css +14 -8
- package/dist/es/packages/range/range.js +3 -3
- package/dist/es/packages/range/style/style.css +9 -9
- package/dist/es/packages/rate/rate.js +3 -3
- package/dist/es/packages/rate/style/style.css +4 -4
- package/dist/es/packages/resultpage/style/resultpage.scss +3 -0
- package/dist/es/packages/resultpage/style/style.css +5 -2
- package/dist/es/packages/searchbar/searchbar.js +0 -1
- package/dist/es/packages/searchbar/style/style.css +5 -5
- package/dist/es/packages/segmented/segmented.js +1 -1
- package/dist/es/packages/segmented/style/style.css +2 -2
- package/dist/es/packages/shortpassword/shortpassword.js +7 -9
- package/dist/es/packages/shortpassword/style/shortpassword.scss +10 -0
- package/dist/es/packages/shortpassword/style/style.css +36 -20
- package/dist/es/packages/sidebar/index.d.ts +3 -0
- package/dist/es/packages/sidebar/index.js +2 -0
- package/dist/es/packages/sidebar/sidebar.d.ts +6 -0
- package/dist/es/packages/sidebar/sidebar.js +161 -0
- package/dist/es/packages/sidebar/style/css.js +1 -0
- package/dist/es/packages/sidebar/style/index.js +3 -0
- package/dist/es/packages/sidebar/style/sidebar.scss +61 -0
- package/dist/es/packages/sidebar/style/style.css +79 -0
- package/dist/es/packages/sidebar/types.d.ts +16 -0
- package/dist/es/packages/sidebar/types.js +1 -0
- package/dist/es/packages/sidebaritem/index.d.ts +3 -0
- package/dist/es/packages/sidebaritem/index.js +2 -0
- package/dist/es/packages/sidebaritem/sidebaritem.d.ts +9 -0
- package/dist/es/packages/sidebaritem/sidebaritem.js +18 -0
- package/dist/es/packages/sidebaritem/style/css.js +1 -0
- package/dist/es/packages/sidebaritem/style/index.js +1 -0
- package/dist/es/packages/sidebaritem/style/sidebaritem.scss +16 -0
- package/dist/es/packages/sidebaritem/style/style.css +19 -0
- package/dist/es/packages/signature/style/style.css +2 -2
- package/dist/es/packages/skeleton/style/skeleton.scss +0 -18
- package/dist/es/packages/skeleton/style/style.css +5 -11
- package/dist/es/packages/step/style/style.css +19 -19
- package/dist/es/packages/steps/style/style.css +19 -19
- package/dist/es/packages/sticky/sticky.js +2 -2
- package/dist/es/packages/swipe/swipe.js +2 -2
- package/dist/es/packages/swiper/effects/focus.js +1 -1
- package/dist/es/packages/swiper/style/style.css +21 -35
- package/dist/es/packages/swiper/style/swiper.scss +10 -12
- package/dist/es/packages/swiper/swiper.js +6 -9
- package/dist/es/packages/switch/style/style.css +6 -6
- package/dist/es/packages/switch/switch.js +1 -1
- package/dist/es/packages/tabbar/style/style.css +21 -20
- package/dist/es/packages/tabbar/tabbar.js +1 -1
- package/dist/es/packages/tabbaritem/style/style.css +20 -19
- package/dist/es/packages/tabbaritem/style/tabbaritem.scss +13 -13
- package/dist/es/packages/tabbaritem/tabbaritem.js +7 -6
- package/dist/es/packages/table/style/style.css +11 -11
- package/dist/es/packages/table/table.js +1 -1
- package/dist/es/packages/tabpane/style/style.css +1 -1
- package/dist/es/packages/tabpane/tabpane.js +2 -2
- package/dist/es/packages/tabs/style/style.css +30 -32
- package/dist/es/packages/tabs/style/tabs.scss +9 -9
- package/dist/es/packages/tabs/tabs.js +37 -54
- package/dist/es/packages/tag/style/style.css +5 -5
- package/dist/es/packages/tag/style/tag.scss +0 -2
- package/dist/es/packages/textarea/style/style.css +13 -13
- package/dist/es/packages/textarea/textarea.d.ts +1 -1
- package/dist/es/packages/textarea/textarea.js +20 -25
- package/dist/es/packages/timedetail/style/style.css +4 -4
- package/dist/es/packages/timeselect/style/style.css +26 -19
- package/dist/es/packages/toast/Notification.d.ts +6 -20
- package/dist/es/packages/toast/Notification.js +8 -7
- package/dist/es/packages/toast/index.d.ts +1 -1
- package/dist/es/packages/toast/style/style.css +2 -20
- package/dist/es/packages/toast/style/toast.scss +0 -13
- package/dist/es/packages/toast/toast.d.ts +4 -22
- package/dist/es/packages/toast/toast.js +10 -8
- package/dist/es/packages/toast/types.d.ts +17 -0
- package/dist/es/packages/toast/types.js +1 -0
- package/dist/es/packages/tour/style/style.css +28 -21
- package/dist/es/packages/tour/tour.d.ts +3 -3
- package/dist/es/packages/tour/tour.js +1 -1
- package/dist/es/packages/trendarrow/style/style.css +1 -1
- package/dist/es/packages/uploader/style/style.css +12 -12
- package/dist/es/packages/uploader/types.d.ts +2 -1
- package/dist/es/packages/uploader/uploader.js +1 -1
- package/dist/es/packages/virtuallist/style/style.css +4 -4
- package/dist/es/types/fix-string-literal-union.d.ts +1 -0
- package/dist/es/utils/get-rect-by-taro.js +1 -15
- package/dist/es/utils/get-system-info.d.ts +19 -0
- package/dist/es/utils/get-system-info.js +19 -0
- package/dist/es/utils/platform-taro.d.ts +0 -2
- package/dist/es/utils/platform-taro.js +0 -15
- package/dist/es/utils/px-transform.js +1 -2
- package/dist/nutui.react.umd.js +2269 -2685
- package/dist/style.css +1 -1
- package/dist/style.scss +49 -49
- package/dist/styles/theme-dark.scss +1 -0
- package/dist/styles/theme-default.scss +1 -0
- package/dist/styles/themes/dark.css +1 -0
- package/dist/styles/themes/default.css +1 -1
- package/dist/styles/themes/jmapp.css +1 -0
- package/dist/styles/themes/jrkf.css +1 -0
- package/dist/styles/variables-jmapp.scss +1 -50
- package/dist/styles/variables-jrkf.scss +1 -50
- package/dist/styles/variables.scss +119 -106
- package/package.json +1 -80
- package/dist/cjs/packages/dialog/config.d.ts +0 -50
- package/dist/cjs/packages/picker/pickerpanel.d.ts +0 -15
- package/dist/cjs/packages/picker/pickerpanel.js +0 -238
- package/dist/cjs/packages/sidenavbar/context.d.ts +0 -1
- package/dist/cjs/packages/sidenavbar/context.js +0 -12
- package/dist/cjs/packages/sidenavbar/index.d.ts +0 -3
- package/dist/cjs/packages/sidenavbar/sidenavbar.d.ts +0 -14
- package/dist/cjs/packages/sidenavbar/sidenavbar.js +0 -70
- package/dist/cjs/packages/sidenavbar/style/index.js +0 -2
- package/dist/cjs/packages/sidenavbar/style/sidenavbar.scss +0 -89
- package/dist/cjs/packages/sidenavbar/style/style.css +0 -448
- package/dist/cjs/packages/sidenavbaritem/index.d.ts +0 -3
- package/dist/cjs/packages/sidenavbaritem/sidenavbaritem.d.ts +0 -11
- package/dist/cjs/packages/sidenavbaritem/sidenavbaritem.js +0 -34
- package/dist/cjs/packages/sidenavbaritem/style/index.js +0 -1
- package/dist/cjs/packages/sidenavbaritem/style/sidenavbaritem.scss +0 -13
- package/dist/cjs/packages/sidenavbaritem/style/style.css +0 -14
- package/dist/cjs/packages/subsidenavbar/index.d.ts +0 -3
- package/dist/cjs/packages/subsidenavbar/style/index.js +0 -1
- package/dist/cjs/packages/subsidenavbar/style/style.css +0 -20
- package/dist/cjs/packages/subsidenavbar/style/subsidenavbar.scss +0 -26
- package/dist/cjs/packages/subsidenavbar/subsidenavbar.d.ts +0 -13
- package/dist/cjs/packages/subsidenavbar/subsidenavbar.js +0 -88
- package/dist/es/packages/dialog/config.d.ts +0 -50
- package/dist/es/packages/picker/pickerpanel.d.ts +0 -15
- package/dist/es/packages/picker/pickerpanel.js +0 -227
- package/dist/es/packages/sidenavbar/context.d.ts +0 -1
- package/dist/es/packages/sidenavbar/context.js +0 -2
- package/dist/es/packages/sidenavbar/index.d.ts +0 -3
- package/dist/es/packages/sidenavbar/index.js +0 -2
- package/dist/es/packages/sidenavbar/sidenavbar.d.ts +0 -38
- package/dist/es/packages/sidenavbar/sidenavbar.js +0 -58
- package/dist/es/packages/sidenavbar/style/index.js +0 -2
- package/dist/es/packages/sidenavbar/style/sidenavbar.scss +0 -89
- package/dist/es/packages/sidenavbar/style/style.css +0 -448
- package/dist/es/packages/sidenavbaritem/index.d.ts +0 -3
- package/dist/es/packages/sidenavbaritem/index.js +0 -2
- package/dist/es/packages/sidenavbaritem/sidenavbaritem.d.ts +0 -11
- package/dist/es/packages/sidenavbaritem/sidenavbaritem.js +0 -23
- package/dist/es/packages/sidenavbaritem/style/index.js +0 -1
- package/dist/es/packages/sidenavbaritem/style/sidenavbaritem.scss +0 -13
- package/dist/es/packages/sidenavbaritem/style/style.css +0 -14
- package/dist/es/packages/subsidenavbar/index.d.ts +0 -3
- package/dist/es/packages/subsidenavbar/index.js +0 -2
- package/dist/es/packages/subsidenavbar/style/index.js +0 -1
- package/dist/es/packages/subsidenavbar/style/style.css +0 -20
- package/dist/es/packages/subsidenavbar/style/subsidenavbar.scss +0 -26
- package/dist/es/packages/subsidenavbar/subsidenavbar.d.ts +0 -13
- package/dist/es/packages/subsidenavbar/subsidenavbar.js +0 -77
- package/dist/styles/themes/default.scss +0 -3
- /package/dist/cjs/{utils → hooks}/use-click-away.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-client-rect.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-client-rect.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-custom-event.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-force-update.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-force-update.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-isomprphic-layout-effect.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-lock-scoll-taro.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-lock-scoll-taro.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-lock-scroll.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-memo.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-memo.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-props-value.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-props-value.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-ref-state.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-ref-state.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-refs.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-refs.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-taro-rect.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-taro-rect.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-touch.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-touch.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-uuid.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-uuid.js +0 -0
- /package/dist/cjs/{utils → hooks}/use-watch.d.ts +0 -0
- /package/dist/cjs/{utils → hooks}/use-watch.js +0 -0
- /package/dist/cjs/packages/{sidenavbar → datepickerview}/style/css.js +0 -0
- /package/dist/cjs/packages/dialog/{config.js → types.js} +0 -0
- /package/dist/cjs/packages/{sidenavbaritem → pickerview}/style/css.js +0 -0
- /package/dist/cjs/packages/{subsidenavbar → sidebar}/style/css.js +0 -0
- /package/dist/cjs/packages/{sidenavbar → sidebar}/utils.d.ts +0 -0
- /package/dist/cjs/packages/{sidenavbar → sidebar}/utils.js +0 -0
- /package/dist/{es/packages/sidenavbar → cjs/packages/sidebaritem}/style/css.js +0 -0
- /package/dist/es/{utils → hooks}/use-click-away.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-client-rect.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-client-rect.js +0 -0
- /package/dist/es/{utils → hooks}/use-custom-event.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-force-update.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-force-update.js +0 -0
- /package/dist/es/{utils → hooks}/use-isomprphic-layout-effect.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-lock-scoll-taro.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-lock-scoll-taro.js +0 -0
- /package/dist/es/{utils → hooks}/use-lock-scroll.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-memo.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-memo.js +0 -0
- /package/dist/es/{utils → hooks}/use-props-value.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-props-value.js +0 -0
- /package/dist/es/{utils → hooks}/use-ref-state.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-ref-state.js +0 -0
- /package/dist/es/{utils → hooks}/use-refs.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-refs.js +0 -0
- /package/dist/es/{utils → hooks}/use-taro-rect.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-taro-rect.js +0 -0
- /package/dist/es/{utils → hooks}/use-touch.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-touch.js +0 -0
- /package/dist/es/{utils → hooks}/use-uuid.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-uuid.js +0 -0
- /package/dist/es/{utils → hooks}/use-watch.d.ts +0 -0
- /package/dist/es/{utils → hooks}/use-watch.js +0 -0
- /package/dist/es/packages/{sidenavbaritem → datepickerview}/style/css.js +0 -0
- /package/dist/es/packages/dialog/{config.js → types.js} +0 -0
- /package/dist/es/packages/{subsidenavbar → pickerview}/style/css.js +0 -0
- /package/dist/es/packages/{sidenavbar → sidebar}/utils.d.ts +0 -0
- /package/dist/es/packages/{sidenavbar → sidebar}/utils.js +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
.nut-pickerview {
|
|
2
|
+
--nutui-picker-item-height: 36px;
|
|
3
|
+
position: relative;
|
|
4
|
+
display: flex;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: $picker-list-height;
|
|
7
|
+
$pickerview-top: calc(($picker-list-height - $picker-item-height) / 2);
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
|
|
10
|
+
&-mask,
|
|
11
|
+
&-indicator {
|
|
12
|
+
position: absolute;
|
|
13
|
+
left: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
z-index: 3;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&-mask {
|
|
20
|
+
top: 0;
|
|
21
|
+
bottom: 0;
|
|
22
|
+
background-image: $picker-mask-background;
|
|
23
|
+
background-position: top, bottom;
|
|
24
|
+
background-size: 100% $pickerview-top;
|
|
25
|
+
background-repeat: no-repeat;
|
|
26
|
+
transform: translateZ(0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-indicator {
|
|
30
|
+
top: $pickerview-top;
|
|
31
|
+
height: $picker-item-height;
|
|
32
|
+
border: $picker-item-active-line-border;
|
|
33
|
+
border-left: 0;
|
|
34
|
+
border-right: 0;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&-list {
|
|
39
|
+
position: relative;
|
|
40
|
+
flex: 1;
|
|
41
|
+
height: $picker-list-height;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
touch-action: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&-roller {
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: $pickerview-top;
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: $picker-item-height;
|
|
51
|
+
z-index: 1;
|
|
52
|
+
transform-style: preserve-3d;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&-roller-item {
|
|
56
|
+
position: absolute;
|
|
57
|
+
top: 0;
|
|
58
|
+
backface-visibility: hidden;
|
|
59
|
+
-moz-backface-visibility: hidden;
|
|
60
|
+
-webkit-backface-visibility: hidden;
|
|
61
|
+
&-hidden {
|
|
62
|
+
visibility: hidden;
|
|
63
|
+
opacity: 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&-roller-item,
|
|
68
|
+
&-roller-item-tiled {
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: $picker-item-height;
|
|
71
|
+
line-height: $picker-item-height;
|
|
72
|
+
color: $picker-item-text-color;
|
|
73
|
+
font-size: $picker-item-text-font-size;
|
|
74
|
+
text-align: center;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
text-overflow: ellipsis;
|
|
77
|
+
white-space: nowrap;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* #ifdef harmony */
|
|
2
|
+
/* #endif */
|
|
3
|
+
/* #ifndef harmony */
|
|
4
|
+
/* #endif */
|
|
5
|
+
.nut-pickerview {
|
|
6
|
+
--nutui-picker-item-height: 36px;
|
|
7
|
+
position: relative;
|
|
8
|
+
display: flex;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: calc(var(--nutui-picker-item-height, 36px) * 7);
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
}
|
|
13
|
+
.nut-pickerview-mask, .nut-pickerview-indicator {
|
|
14
|
+
position: absolute;
|
|
15
|
+
left: 0;
|
|
16
|
+
right: 0;
|
|
17
|
+
z-index: 3;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
}
|
|
20
|
+
.nut-pickerview-mask {
|
|
21
|
+
top: 0;
|
|
22
|
+
bottom: 0;
|
|
23
|
+
background-image: var(--picker-mask-background, linear-gradient(180deg, var(--nutui-white-12), var(--nutui-white-7)), linear-gradient(0deg, var(--nutui-white-12), var(--nutui-white-7)));
|
|
24
|
+
background-position: top, bottom;
|
|
25
|
+
background-size: 100% calc((var(--nutui-picker-item-height, 36px) * 7 - var(--nutui-picker-item-height, 36px)) / 2);
|
|
26
|
+
background-repeat: no-repeat;
|
|
27
|
+
transform: translateZ(0);
|
|
28
|
+
}
|
|
29
|
+
.nut-pickerview-indicator {
|
|
30
|
+
top: calc((var(--nutui-picker-item-height, 36px) * 7 - var(--nutui-picker-item-height, 36px)) / 2);
|
|
31
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
32
|
+
border: var(--nutui-picker-item-active-line-border, 1px solid var(--nutui-color-border, rgba(0, 0, 0, 0.06)));
|
|
33
|
+
border-left: 0;
|
|
34
|
+
border-right: 0;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
}
|
|
37
|
+
.nut-pickerview-list {
|
|
38
|
+
position: relative;
|
|
39
|
+
flex: 1;
|
|
40
|
+
height: calc(var(--nutui-picker-item-height, 36px) * 7);
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
touch-action: none;
|
|
43
|
+
}
|
|
44
|
+
.nut-pickerview-roller {
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: calc((var(--nutui-picker-item-height, 36px) * 7 - var(--nutui-picker-item-height, 36px)) / 2);
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
49
|
+
z-index: 1;
|
|
50
|
+
transform-style: preserve-3d;
|
|
51
|
+
}
|
|
52
|
+
.nut-pickerview-roller-item {
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 0;
|
|
55
|
+
backface-visibility: hidden;
|
|
56
|
+
-moz-backface-visibility: hidden;
|
|
57
|
+
-webkit-backface-visibility: hidden;
|
|
58
|
+
}
|
|
59
|
+
.nut-pickerview-roller-item-hidden {
|
|
60
|
+
visibility: hidden;
|
|
61
|
+
opacity: 0;
|
|
62
|
+
}
|
|
63
|
+
.nut-pickerview-roller-item, .nut-pickerview-roller-item-tiled {
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: var(--nutui-picker-item-height, 36px);
|
|
66
|
+
line-height: var(--nutui-picker-item-height, 36px);
|
|
67
|
+
color: var(--nutui-picker-item-text-color, var(--nutui-color-title, #1a1a1a));
|
|
68
|
+
font-size: var(--nutui-picker-item-text-font-size, var(--nutui-font-size-base, 14px));
|
|
69
|
+
text-align: center;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
text-overflow: ellipsis;
|
|
72
|
+
white-space: nowrap;
|
|
73
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BasicComponent } from "../../utils/typings";
|
|
2
|
+
export type PickerValue = string | number | null;
|
|
3
|
+
export interface PickerOption {
|
|
4
|
+
label: string | number;
|
|
5
|
+
value: string | number;
|
|
6
|
+
children?: PickerOptions;
|
|
7
|
+
}
|
|
8
|
+
export type PickerOptions = PickerOption[];
|
|
9
|
+
export interface PickerRollerProps {
|
|
10
|
+
options: PickerOptions;
|
|
11
|
+
keyIndex: number;
|
|
12
|
+
value: PickerValue;
|
|
13
|
+
threeDimensional?: boolean;
|
|
14
|
+
duration?: number | string;
|
|
15
|
+
onSelect: (option: PickerOption, index: number) => void;
|
|
16
|
+
renderLabel: (item: PickerOption) => React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export interface PickerOnChangeCallbackParameter {
|
|
19
|
+
value: PickerValue[];
|
|
20
|
+
index: number;
|
|
21
|
+
selectedOptions: PickerOptions;
|
|
22
|
+
}
|
|
23
|
+
export interface PickerViewProps extends BasicComponent {
|
|
24
|
+
setRefs?: (ref: any) => any;
|
|
25
|
+
options: PickerOptions[];
|
|
26
|
+
value?: PickerValue[];
|
|
27
|
+
defaultValue?: PickerValue[];
|
|
28
|
+
threeDimensional?: boolean;
|
|
29
|
+
duration?: number | string;
|
|
30
|
+
renderLabel: (item: PickerOption) => React.ReactNode;
|
|
31
|
+
onChange?: (arg0: PickerOnChangeCallbackParameter) => void;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const momentum: (distance: number, duration: number) => number;
|
|
2
|
+
export declare const useStyles: (touchTime: number, touchDeg: string, scrollDistance: number, lineSpacing: React.MutableRefObject<number>, rotation: number) => {
|
|
3
|
+
touchRollerStyle: () => {
|
|
4
|
+
transition: string;
|
|
5
|
+
transform: string;
|
|
6
|
+
};
|
|
7
|
+
touchTiledStyle: () => {
|
|
8
|
+
transition: string;
|
|
9
|
+
transform: string;
|
|
10
|
+
};
|
|
11
|
+
rollerStyle: (index: number) => {
|
|
12
|
+
transform: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export var momentum = function(distance, duration) {
|
|
2
|
+
var speed = Math.abs(distance / duration);
|
|
3
|
+
return speed / 0.003 * (distance < 0 ? -1 : 1);
|
|
4
|
+
};
|
|
5
|
+
export var useStyles = function(touchTime, touchDeg, scrollDistance, lineSpacing, rotation) {
|
|
6
|
+
var getTransitionStyle = function(transformValue) {
|
|
7
|
+
return {
|
|
8
|
+
transition: "transform ".concat(touchTime, "ms cubic-bezier(0.17, 0.89, 0.45, 1)"),
|
|
9
|
+
transform: transformValue
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
var touchRollerStyle = function() {
|
|
13
|
+
return getTransitionStyle("rotate3d(1, 0, 0, ".concat(touchDeg, ")"));
|
|
14
|
+
};
|
|
15
|
+
var touchTiledStyle = function() {
|
|
16
|
+
return getTransitionStyle("translate3d(0, ".concat(scrollDistance, "px, 0)"));
|
|
17
|
+
};
|
|
18
|
+
var rollerStyle = function(index) {
|
|
19
|
+
return {
|
|
20
|
+
transform: "rotate3d(1, 0, 0, ".concat(-rotation * (index + 1), "deg) translate3d(0px, 0px, ").concat(Math.round(lineSpacing.current * 3.2), "px)")
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
touchRollerStyle: touchRollerStyle,
|
|
25
|
+
touchTiledStyle: touchTiledStyle,
|
|
26
|
+
rollerStyle: rollerStyle
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { FunctionComponent } from 'react';
|
|
2
|
-
import { PopupProps } from "../popup/
|
|
2
|
+
import { PopupProps } from "../popup/index";
|
|
3
3
|
import { PopoverTheme, PopoverLocation, PopoverList } from './types';
|
|
4
4
|
export interface PopoverProps extends PopupProps {
|
|
5
5
|
list: PopoverList[];
|
|
6
|
-
theme: PopoverTheme
|
|
7
|
-
location: PopoverLocation
|
|
6
|
+
theme: PopoverTheme;
|
|
7
|
+
location: PopoverLocation;
|
|
8
8
|
visible: boolean;
|
|
9
9
|
offset: string[] | number[];
|
|
10
10
|
arrowOffset: number;
|
|
@@ -7,10 +7,10 @@ import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
|
7
7
|
import classNames from "classnames";
|
|
8
8
|
import { createPortal } from "react-dom";
|
|
9
9
|
import { ArrowRadius } from "@nutui/icons-react";
|
|
10
|
-
import Popup from "../popup";
|
|
11
|
-
import { getRect } from "../../
|
|
10
|
+
import Popup from "../popup/index";
|
|
11
|
+
import { getRect } from "../../hooks/use-client-rect";
|
|
12
12
|
import { ComponentDefaults } from "../../utils/typings";
|
|
13
|
-
import useClickAway from "../../
|
|
13
|
+
import useClickAway from "../../hooks/use-click-away";
|
|
14
14
|
import { canUseDom } from "../../utils/can-use-dom";
|
|
15
15
|
import { getAllScrollableParents } from "../../utils/get-scroll-parent";
|
|
16
16
|
import { useRtl } from "../configprovider";
|
|
@@ -249,7 +249,7 @@ export var Popover = function(props) {
|
|
|
249
249
|
className: "nut-popover-content nut-popover-content-".concat(location),
|
|
250
250
|
visible: showPopup,
|
|
251
251
|
overlay: overlay,
|
|
252
|
-
position: "
|
|
252
|
+
position: "none",
|
|
253
253
|
lockScroll: false
|
|
254
254
|
}, rest), /*#__PURE__*/ React.createElement("div", {
|
|
255
255
|
className: "nut-popover-content-group",
|
|
@@ -4,19 +4,14 @@
|
|
|
4
4
|
/* #ifndef harmony */
|
|
5
5
|
/* #endif */
|
|
6
6
|
.nut-overlay {
|
|
7
|
-
/* #ifdef rn */
|
|
8
|
-
position: absolute;
|
|
9
|
-
/* #endif */
|
|
10
|
-
/* #ifndef rn */
|
|
11
7
|
position: fixed;
|
|
12
|
-
/* #endif */
|
|
13
8
|
top: 0;
|
|
14
9
|
left: 0;
|
|
15
10
|
bottom: 0;
|
|
16
11
|
right: 0;
|
|
17
12
|
width: 100%;
|
|
18
13
|
height: 100%;
|
|
19
|
-
background-color: var(--nutui-overlay-bg-color, var(--nutui-
|
|
14
|
+
background-color: var(--nutui-overlay-bg-color, var(--nutui-color-mask, rgba(0, 0, 0, 0.7)));
|
|
20
15
|
z-index: var(--nutui-overlay-zIndex, 1000);
|
|
21
16
|
}
|
|
22
17
|
|
|
@@ -67,7 +62,7 @@
|
|
|
67
62
|
position: fixed;
|
|
68
63
|
min-height: 46%;
|
|
69
64
|
max-height: 100%;
|
|
70
|
-
background-color: var(--nutui-overlay-content-bg-color, var(--nutui-
|
|
65
|
+
background-color: var(--nutui-overlay-content-bg-color, var(--nutui-color-background-overlay, #ffffff));
|
|
71
66
|
-webkit-overflow-scrolling: touch;
|
|
72
67
|
font-size: var(--nutui-font-size-base, 14px);
|
|
73
68
|
}
|
|
@@ -87,13 +82,13 @@
|
|
|
87
82
|
align-items: center;
|
|
88
83
|
}
|
|
89
84
|
.nut-popup-title-title {
|
|
90
|
-
color: var(--nutui-
|
|
85
|
+
color: var(--nutui-color-title, #1a1a1a);
|
|
91
86
|
font-weight: var(--nutui-font-weight-bold, 600);
|
|
92
87
|
font-size: var(--nutui-popup-title-font-size, var(--nutui-font-size-l, 16px));
|
|
93
88
|
line-height: var(--nutui-popup-title-font-size, var(--nutui-font-size-l, 16px));
|
|
94
89
|
}
|
|
95
90
|
.nut-popup-title-description {
|
|
96
|
-
color: var(--nutui-
|
|
91
|
+
color: var(--nutui-color-text, #505259);
|
|
97
92
|
font-size: var(--nutui-popup-description-font-size, var(--nutui-font-size-base, 14px));
|
|
98
93
|
font-weight: var(--nutui-font-weight, 400);
|
|
99
94
|
}
|
|
@@ -112,7 +107,7 @@
|
|
|
112
107
|
z-index: 1;
|
|
113
108
|
width: var(--nutui-popup-icon-size, 20px);
|
|
114
109
|
height: var(--nutui-popup-icon-size, 20px);
|
|
115
|
-
color: var(--nutui-
|
|
110
|
+
color: var(--nutui-color-title, #1a1a1a);
|
|
116
111
|
cursor: pointer;
|
|
117
112
|
}
|
|
118
113
|
.nut-popup-title-right:active {
|
|
@@ -243,6 +238,9 @@
|
|
|
243
238
|
from {
|
|
244
239
|
transform: translate3d(0, -100%, 0);
|
|
245
240
|
}
|
|
241
|
+
to {
|
|
242
|
+
transform: translate3d(0, 0%, 0);
|
|
243
|
+
}
|
|
246
244
|
}
|
|
247
245
|
@keyframes popup-slide-top-exit {
|
|
248
246
|
to {
|
|
@@ -264,6 +262,9 @@
|
|
|
264
262
|
from {
|
|
265
263
|
transform: translate3d(100%, 0, 0);
|
|
266
264
|
}
|
|
265
|
+
to {
|
|
266
|
+
transform: translate3d(0%, 0, 0);
|
|
267
|
+
}
|
|
267
268
|
}
|
|
268
269
|
@keyframes popup-slide-right-exit {
|
|
269
270
|
to {
|
|
@@ -285,6 +286,9 @@
|
|
|
285
286
|
from {
|
|
286
287
|
transform: translate3d(0, 100%, 0);
|
|
287
288
|
}
|
|
289
|
+
to {
|
|
290
|
+
transform: translate3d(0, 0%, 0);
|
|
291
|
+
}
|
|
288
292
|
}
|
|
289
293
|
@keyframes slide-bottom-exit {
|
|
290
294
|
to {
|
|
@@ -306,6 +310,9 @@
|
|
|
306
310
|
from {
|
|
307
311
|
transform: translate3d(-100%, 0, 0);
|
|
308
312
|
}
|
|
313
|
+
to {
|
|
314
|
+
transform: translate3d(0%, 0, 0);
|
|
315
|
+
}
|
|
309
316
|
}
|
|
310
317
|
@keyframes popup-slide-left-exit {
|
|
311
318
|
to {
|
|
@@ -437,7 +444,7 @@
|
|
|
437
444
|
background: var(--nutui-popover-content-background-color, #ffffff);
|
|
438
445
|
border-radius: var(--nutui-popover-border-radius, var(--nutui-radius-xs, 4px));
|
|
439
446
|
font-size: var(--nutui-popover-font-size, var(--nutui-font-size-s, 12px));
|
|
440
|
-
color: var(--nutui-popover-text-color, var(--nutui-
|
|
447
|
+
color: var(--nutui-popover-text-color, var(--nutui-color-mask, rgba(0, 0, 0, 0.7)));
|
|
441
448
|
line-height: 28px;
|
|
442
449
|
max-height: initial;
|
|
443
450
|
overflow-y: initial;
|
|
@@ -447,7 +454,7 @@
|
|
|
447
454
|
align-items: center;
|
|
448
455
|
justify-content: center;
|
|
449
456
|
padding: 0 var(--nutui-popover-menu-item-padding, 8px);
|
|
450
|
-
border-bottom: 1px solid var(--nutui-popover-divider-color, var(--nutui-
|
|
457
|
+
border-bottom: 1px solid var(--nutui-popover-divider-color, var(--nutui-color-border, rgba(0, 0, 0, 0.06)));
|
|
451
458
|
max-width: var(--nutui-popover-menu-item-width, 160px);
|
|
452
459
|
word-wrap: break-word;
|
|
453
460
|
}
|
|
@@ -481,7 +488,7 @@
|
|
|
481
488
|
width: 12px;
|
|
482
489
|
height: 12px;
|
|
483
490
|
font-size: 12px;
|
|
484
|
-
color: var(--nutui-
|
|
491
|
+
color: var(--nutui-color-text, #505259);
|
|
485
492
|
}
|
|
486
493
|
.nut-popover .nut-popover-content .nut-popover-menu-item-action-icon .nut-icon {
|
|
487
494
|
width: 12px;
|
|
@@ -489,7 +496,7 @@
|
|
|
489
496
|
font-size: 12px;
|
|
490
497
|
}
|
|
491
498
|
.nut-popover .nut-popover-content .nut-popover-menu-item.nut-popover-menu-disabled {
|
|
492
|
-
color: var(--nutui-popover-disable-color, var(--nutui-
|
|
499
|
+
color: var(--nutui-popover-disable-color, var(--nutui-color-text-disabled, #c2c4cc));
|
|
493
500
|
cursor: not-allowed;
|
|
494
501
|
}
|
|
495
502
|
.nut-popover .nut-popover-content .nut-popover-menu-item.nut-popover-menu-taroitem {
|
|
@@ -548,14 +555,14 @@
|
|
|
548
555
|
}
|
|
549
556
|
|
|
550
557
|
.nut-popover-dark {
|
|
551
|
-
background: var(--nutui-popover-text-color, var(--nutui-
|
|
558
|
+
background: var(--nutui-popover-text-color, var(--nutui-color-mask, rgba(0, 0, 0, 0.7)));
|
|
552
559
|
color: var(--nutui-popover-content-background-color, #ffffff);
|
|
553
560
|
}
|
|
554
561
|
.nut-popover-dark .nut-popover-arrow .nut-icon-ArrowRadius {
|
|
555
|
-
color: var(--nutui-popover-text-color, var(--nutui-
|
|
562
|
+
color: var(--nutui-popover-text-color, var(--nutui-color-mask, rgba(0, 0, 0, 0.7)));
|
|
556
563
|
}
|
|
557
564
|
.nut-popover-dark .nut-popover-content {
|
|
558
|
-
background: var(--nutui-popover-text-color, var(--nutui-
|
|
565
|
+
background: var(--nutui-popover-text-color, var(--nutui-color-mask, rgba(0, 0, 0, 0.7))) !important;
|
|
559
566
|
color: var(--nutui-popover-content-background-color, #ffffff) !important;
|
|
560
567
|
}
|
|
561
568
|
.nut-popover-dark .nut-popover-content .nut-popover-menu-item-action-icon {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
1
|
+
import { FixAutoComplete } from "../../types/fix-string-literal-union";
|
|
2
|
+
export type PopoverTheme = FixAutoComplete<'light' | 'dark'>;
|
|
3
|
+
export type PopoverLocation = FixAutoComplete<'bottom' | 'top' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end'>;
|
|
3
4
|
export interface PopoverList {
|
|
4
5
|
key?: string;
|
|
5
6
|
name: string;
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
import React, { FunctionComponent
|
|
2
|
-
import {
|
|
3
|
-
type Teleport = HTMLElement | (() => HTMLElement) | null;
|
|
4
|
-
export interface PopupProps extends OverlayProps {
|
|
5
|
-
position: string;
|
|
6
|
-
transition: string;
|
|
7
|
-
overlayStyle: React.CSSProperties;
|
|
8
|
-
overlayClassName: string;
|
|
9
|
-
closeable: boolean;
|
|
10
|
-
closeIconPosition: string;
|
|
11
|
-
closeIcon: ReactNode;
|
|
12
|
-
left: ReactNode;
|
|
13
|
-
title: ReactNode;
|
|
14
|
-
description: ReactNode;
|
|
15
|
-
destroyOnClose: boolean;
|
|
16
|
-
portal: Teleport;
|
|
17
|
-
overlay: boolean;
|
|
18
|
-
round: boolean;
|
|
19
|
-
onOpen: () => void;
|
|
20
|
-
onClose: () => void;
|
|
21
|
-
onOverlayClick: (e: MouseEvent) => boolean | void;
|
|
22
|
-
onCloseIconClick: (e: MouseEvent) => boolean | void;
|
|
23
|
-
}
|
|
1
|
+
import React, { FunctionComponent } from 'react';
|
|
2
|
+
import { PopupProps } from './types';
|
|
24
3
|
export declare const Popup: FunctionComponent<Partial<PopupProps> & Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>>;
|
|
25
|
-
export {};
|
|
@@ -9,9 +9,8 @@ import classNames from "classnames";
|
|
|
9
9
|
import { Close } from "@nutui/icons-react";
|
|
10
10
|
import { defaultOverlayProps } from "../overlay/overlay";
|
|
11
11
|
import Overlay from "../overlay";
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
var defaultProps = _object_spread(_object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
12
|
+
import { useLockScroll } from "../../hooks/use-lock-scroll";
|
|
13
|
+
var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps), {
|
|
15
14
|
position: 'center',
|
|
16
15
|
transition: '',
|
|
17
16
|
overlayStyle: {},
|
|
@@ -25,13 +24,13 @@ var defaultProps = _object_spread(_object_spread_props(_object_spread({}, Compon
|
|
|
25
24
|
round: false,
|
|
26
25
|
onOpen: function() {},
|
|
27
26
|
onClose: function() {},
|
|
28
|
-
onOverlayClick: function(
|
|
27
|
+
onOverlayClick: function() {
|
|
29
28
|
return true;
|
|
30
29
|
},
|
|
31
|
-
onCloseIconClick: function(
|
|
30
|
+
onCloseIconClick: function() {
|
|
32
31
|
return true;
|
|
33
32
|
}
|
|
34
|
-
})
|
|
33
|
+
});
|
|
35
34
|
// 默认1000,参看variables
|
|
36
35
|
var _zIndex = 1100;
|
|
37
36
|
export var Popup = function(props) {
|
|
@@ -42,20 +41,14 @@ export var Popup = function(props) {
|
|
|
42
41
|
var _useState1 = _sliced_to_array(useState(visible), 2), innerVisible = _useState1[0], setInnerVisible = _useState1[1];
|
|
43
42
|
var _useState2 = _sliced_to_array(useState(true), 2), showChildren = _useState2[0], setShowChildren = _useState2[1];
|
|
44
43
|
var _useState3 = _sliced_to_array(useState(''), 2), transitionName = _useState3[0], setTransitionName = _useState3[1];
|
|
45
|
-
|
|
46
|
-
useLockScroll(nodeRef, shouldLockScroll);
|
|
44
|
+
useLockScroll(nodeRef, innerVisible && lockScroll);
|
|
47
45
|
var classPrefix = 'nut-popup';
|
|
48
|
-
var
|
|
46
|
+
var overlayStyles = _object_spread({}, overlayStyle);
|
|
47
|
+
var popStyles = _object_spread_props(_object_spread({}, style), {
|
|
49
48
|
zIndex: index
|
|
50
|
-
};
|
|
51
|
-
var overlayStyles = _object_spread_props(_object_spread({}, overlayStyle), {
|
|
52
|
-
'--nutui-overlay-zIndex': index
|
|
53
49
|
});
|
|
54
|
-
var popStyles = _object_spread({}, style, baseStyle);
|
|
55
50
|
var _obj;
|
|
56
|
-
var popClassName = classNames((_obj = {}, _define_property(_obj, "".concat(classPrefix
|
|
57
|
-
var _obj1;
|
|
58
|
-
var closeClasses = classNames((_obj1 = {}, _define_property(_obj1, "".concat(classPrefix, "-title-right"), true), _define_property(_obj1, "".concat(classPrefix, "-title-right-").concat(closeIconPosition), true), _obj1));
|
|
51
|
+
var popClassName = classNames(classPrefix, (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-round"), round || position === 'bottom'), _define_property(_obj, "".concat(classPrefix, "-").concat(position), true), _obj), className);
|
|
59
52
|
var open = function() {
|
|
60
53
|
if (!innerVisible) {
|
|
61
54
|
setInnerVisible(true);
|
|
@@ -77,30 +70,20 @@ export var Popup = function(props) {
|
|
|
77
70
|
onClose && onClose();
|
|
78
71
|
}
|
|
79
72
|
};
|
|
80
|
-
var
|
|
73
|
+
var handleOverlayClick = function(e) {
|
|
81
74
|
e.stopPropagation();
|
|
82
|
-
if (closeOnOverlayClick) {
|
|
83
|
-
|
|
84
|
-
closed && close();
|
|
75
|
+
if (closeOnOverlayClick && onOverlayClick(e)) {
|
|
76
|
+
close();
|
|
85
77
|
}
|
|
86
78
|
};
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
};
|
|
90
|
-
var onHandleClickCloseIcon = function(e) {
|
|
91
|
-
var closed = onCloseIconClick && onCloseIconClick(e);
|
|
92
|
-
closed && close();
|
|
93
|
-
};
|
|
94
|
-
var onHandleOpened = function(e) {
|
|
95
|
-
afterShow && afterShow();
|
|
96
|
-
};
|
|
97
|
-
var onHandleClosed = function(e) {
|
|
98
|
-
afterClose && afterClose();
|
|
79
|
+
var handleCloseIconClick = function(e) {
|
|
80
|
+
onCloseIconClick(e) && close();
|
|
99
81
|
};
|
|
100
82
|
var renderCloseIcon = function() {
|
|
83
|
+
var closeClasses = classNames("".concat(classPrefix, "-title-right"), "".concat(classPrefix, "-title-right-").concat(closeIconPosition));
|
|
101
84
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, closeable && /*#__PURE__*/ React.createElement("div", {
|
|
102
85
|
className: closeClasses,
|
|
103
|
-
onClick:
|
|
86
|
+
onClick: handleCloseIconClick
|
|
104
87
|
}, /*#__PURE__*/ React.isValidElement(closeIcon) ? closeIcon : /*#__PURE__*/ React.createElement(Close, null)));
|
|
105
88
|
};
|
|
106
89
|
var renderTitle = function() {
|
|
@@ -129,25 +112,26 @@ export var Popup = function(props) {
|
|
|
129
112
|
unmountOnExit: destroyOnClose,
|
|
130
113
|
timeout: duration,
|
|
131
114
|
in: innerVisible,
|
|
132
|
-
onEntered:
|
|
133
|
-
onExited:
|
|
115
|
+
onEntered: afterShow,
|
|
116
|
+
onExited: afterClose
|
|
134
117
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
135
118
|
ref: nodeRef,
|
|
136
119
|
style: popStyles,
|
|
137
120
|
className: popClassName,
|
|
138
|
-
onClick:
|
|
139
|
-
}, renderTitle(), showChildren
|
|
121
|
+
onClick: onClick
|
|
122
|
+
}, renderTitle(), showChildren && children));
|
|
140
123
|
};
|
|
141
124
|
var renderNode = function() {
|
|
142
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, overlay
|
|
125
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, overlay && /*#__PURE__*/ React.createElement(Overlay, {
|
|
126
|
+
zIndex: index,
|
|
143
127
|
style: overlayStyles,
|
|
144
128
|
className: overlayClassName,
|
|
145
129
|
visible: innerVisible,
|
|
146
130
|
closeOnOverlayClick: closeOnOverlayClick,
|
|
147
131
|
lockScroll: lockScroll,
|
|
148
132
|
duration: duration,
|
|
149
|
-
onClick:
|
|
150
|
-
})
|
|
133
|
+
onClick: handleOverlayClick
|
|
134
|
+
}), renderPop());
|
|
151
135
|
};
|
|
152
136
|
useEffect(function() {
|
|
153
137
|
visible ? open() : close();
|
|
@@ -161,8 +145,7 @@ export var Popup = function(props) {
|
|
|
161
145
|
transition
|
|
162
146
|
]);
|
|
163
147
|
var resolveContainer = function(getContainer) {
|
|
164
|
-
|
|
165
|
-
return container || document.body;
|
|
148
|
+
return (typeof getContainer === 'function' ? getContainer() : getContainer) || document.body;
|
|
166
149
|
};
|
|
167
150
|
var renderToContainer = function(getContainer, node) {
|
|
168
151
|
if (getContainer) {
|
|
@@ -141,7 +141,6 @@
|
|
|
141
141
|
opacity: 0;
|
|
142
142
|
transform: scale(0.8);
|
|
143
143
|
}
|
|
144
|
-
|
|
145
144
|
to {
|
|
146
145
|
opacity: 1;
|
|
147
146
|
transform: scale(1);
|
|
@@ -153,7 +152,6 @@
|
|
|
153
152
|
opacity: 1;
|
|
154
153
|
transform: scale(1);
|
|
155
154
|
}
|
|
156
|
-
|
|
157
155
|
to {
|
|
158
156
|
opacity: 0;
|
|
159
157
|
transform: scale(0.8);
|
|
@@ -176,7 +174,6 @@
|
|
|
176
174
|
from {
|
|
177
175
|
opacity: 0;
|
|
178
176
|
}
|
|
179
|
-
|
|
180
177
|
to {
|
|
181
178
|
opacity: 1;
|
|
182
179
|
}
|
|
@@ -186,7 +183,6 @@
|
|
|
186
183
|
from {
|
|
187
184
|
opacity: 1;
|
|
188
185
|
}
|
|
189
|
-
|
|
190
186
|
to {
|
|
191
187
|
opacity: 0;
|
|
192
188
|
}
|
|
@@ -209,6 +205,9 @@
|
|
|
209
205
|
from {
|
|
210
206
|
transform: translate3d(0, -100%, 0);
|
|
211
207
|
}
|
|
208
|
+
to {
|
|
209
|
+
transform: translate3d(0, 0%, 0);
|
|
210
|
+
}
|
|
212
211
|
}
|
|
213
212
|
|
|
214
213
|
@keyframes popup-slide-top-exit {
|
|
@@ -236,6 +235,9 @@
|
|
|
236
235
|
from {
|
|
237
236
|
transform: translate3d(100%, 0, 0);
|
|
238
237
|
}
|
|
238
|
+
to {
|
|
239
|
+
transform: translate3d(0%, 0, 0);
|
|
240
|
+
}
|
|
239
241
|
}
|
|
240
242
|
|
|
241
243
|
@keyframes popup-slide-right-exit {
|
|
@@ -263,6 +265,9 @@
|
|
|
263
265
|
from {
|
|
264
266
|
transform: translate3d(0, 100%, 0);
|
|
265
267
|
}
|
|
268
|
+
to {
|
|
269
|
+
transform: translate3d(0, 0%, 0);
|
|
270
|
+
}
|
|
266
271
|
}
|
|
267
272
|
|
|
268
273
|
@keyframes slide-bottom-exit {
|
|
@@ -290,6 +295,9 @@
|
|
|
290
295
|
from {
|
|
291
296
|
transform: translate3d(-100%, 0, 0);
|
|
292
297
|
}
|
|
298
|
+
to {
|
|
299
|
+
transform: translate3d(0%, 0, 0);
|
|
300
|
+
}
|
|
293
301
|
}
|
|
294
302
|
|
|
295
303
|
@keyframes popup-slide-left-exit {
|