@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
|
@@ -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 {
|
|
@@ -377,23 +384,24 @@
|
|
|
377
384
|
}
|
|
378
385
|
|
|
379
386
|
.nut-picker {
|
|
380
|
-
background-color: var(--nutui-
|
|
387
|
+
background-color: var(--nutui-color-background-overlay, #ffffff);
|
|
381
388
|
width: 100%;
|
|
382
389
|
}
|
|
383
390
|
.nut-picker-control {
|
|
384
391
|
display: flex;
|
|
385
|
-
height: var(--nutui-popup-title-height, 50px);
|
|
386
|
-
font-size: var(--nutui-popup-title-font-size, var(--nutui-font-size-l, 16px));
|
|
387
392
|
align-items: center;
|
|
388
393
|
justify-content: space-between;
|
|
394
|
+
height: var(--nutui-popup-title-height, 50px);
|
|
389
395
|
padding: var(--nutui-popup-title-padding, 16px);
|
|
396
|
+
box-sizing: border-box;
|
|
397
|
+
font-size: var(--nutui-popup-title-font-size, var(--nutui-font-size-l, 16px));
|
|
390
398
|
}
|
|
391
399
|
.nut-picker-cancel-btn {
|
|
392
|
-
color: var(--nutui-picker-title-cancel-color, var(--nutui-
|
|
400
|
+
color: var(--nutui-picker-title-cancel-color, var(--nutui-color-text, #505259));
|
|
393
401
|
font-size: var(--nutui-picker-title-cancel-font-size, var(--nutui-font-size-base, 14px));
|
|
394
402
|
}
|
|
395
403
|
.nut-picker-confirm-btn {
|
|
396
|
-
color: var(--nutui-picker-title-ok-color, var(--nutui-
|
|
404
|
+
color: var(--nutui-picker-title-ok-color, var(--nutui-color-primary, #ff0f23));
|
|
397
405
|
font-size: var(--nutui-picker-title-ok-font-size, var(--nutui-font-size-base, 14px));
|
|
398
406
|
}
|
|
399
407
|
.nut-picker-title {
|
|
@@ -402,117 +410,10 @@
|
|
|
402
410
|
text-overflow: ellipsis;
|
|
403
411
|
white-space: nowrap;
|
|
404
412
|
text-align: center;
|
|
405
|
-
color: var(--nutui-
|
|
413
|
+
color: var(--nutui-color-title, #1a1a1a);
|
|
406
414
|
font-size: var(--nutui-popup-title-font-size, var(--nutui-font-size-l, 16px));
|
|
407
415
|
font-weight: var(--nutui-popup-title-font-weight, var(--nutui-font-weight-bold, 600));
|
|
408
416
|
}
|
|
409
417
|
.nut-picker-panel {
|
|
410
418
|
display: flex;
|
|
411
|
-
position: relative;
|
|
412
|
-
}
|
|
413
|
-
.nut-picker-indicator {
|
|
414
|
-
position: absolute;
|
|
415
|
-
top: 108px;
|
|
416
|
-
height: var(--nutui-picker-item-height, 36px);
|
|
417
|
-
width: 100%;
|
|
418
|
-
border: var(--nutui-picker-item-active-line-border, 1px solid var(--nutui-black-3));
|
|
419
|
-
border-left: 0;
|
|
420
|
-
border-right: 0;
|
|
421
|
-
color: var(--nutui-picker-item-text-color, var(--nutui-gray-7));
|
|
422
|
-
font-size: var(--nutui-picker-item-text-font-size, var(--nutui-font-size-base, 14px));
|
|
423
|
-
z-index: 3;
|
|
424
|
-
}
|
|
425
|
-
.nut-picker-indicator-taro {
|
|
426
|
-
height: var(--nutui-picker-item-height, 36px);
|
|
427
|
-
border: 0;
|
|
428
|
-
}
|
|
429
|
-
.nut-picker-indicator-taro::before, .nut-picker-indicator-taro::after {
|
|
430
|
-
border: var(--nutui-picker-item-active-line-border, 1px solid var(--nutui-black-3));
|
|
431
|
-
border-left: 0;
|
|
432
|
-
border-right: 0;
|
|
433
|
-
}
|
|
434
|
-
.nut-picker-list {
|
|
435
|
-
flex: 1;
|
|
436
|
-
position: relative;
|
|
437
|
-
height: var(--nutui-picker-list-height, 252px);
|
|
438
|
-
overflow: hidden;
|
|
439
|
-
text-align: center;
|
|
440
|
-
}
|
|
441
|
-
.nut-picker-list-panel {
|
|
442
|
-
transform-style: preserve-3d;
|
|
443
|
-
}
|
|
444
|
-
.nut-picker-mask {
|
|
445
|
-
position: absolute;
|
|
446
|
-
top: 0;
|
|
447
|
-
left: 0;
|
|
448
|
-
right: 0;
|
|
449
|
-
bottom: 0;
|
|
450
|
-
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)));
|
|
451
|
-
background-position: top, bottom;
|
|
452
|
-
background-size: 100% 108px;
|
|
453
|
-
background-repeat: no-repeat;
|
|
454
|
-
transform: translateZ(0);
|
|
455
|
-
z-index: 3;
|
|
456
|
-
}
|
|
457
|
-
.nut-picker-view-panel {
|
|
458
|
-
height: var(--nutui-picker-list-height, 252px);
|
|
459
|
-
flex-grow: 1;
|
|
460
|
-
}
|
|
461
|
-
.nut-picker-content, .nut-picker-roller {
|
|
462
|
-
position: absolute;
|
|
463
|
-
top: 108px;
|
|
464
|
-
width: 100%;
|
|
465
|
-
height: var(--nutui-picker-item-height, 36px);
|
|
466
|
-
}
|
|
467
|
-
.nut-picker-content {
|
|
468
|
-
background: #fff;
|
|
469
|
-
z-index: 2;
|
|
470
|
-
overflow: hidden;
|
|
471
|
-
}
|
|
472
|
-
.nut-picker-item, .nut-picker-roller-item {
|
|
473
|
-
white-space: nowrap;
|
|
474
|
-
overflow: hidden;
|
|
475
|
-
text-overflow: ellipsis;
|
|
476
|
-
height: var(--nutui-picker-item-height, 36px);
|
|
477
|
-
line-height: var(--nutui-picker-item-height, 36px);
|
|
478
|
-
color: var(--nutui-picker-item-text-color, var(--nutui-gray-7));
|
|
479
|
-
font-size: var(--nutui-picker-item-text-font-size, var(--nutui-font-size-base, 14px));
|
|
480
|
-
text-align: center;
|
|
481
|
-
}
|
|
482
|
-
.nut-picker-item {
|
|
483
|
-
font-size: 16px;
|
|
484
|
-
background: #fff;
|
|
485
|
-
}
|
|
486
|
-
.nut-picker-roller {
|
|
487
|
-
z-index: 1;
|
|
488
|
-
transform-style: preserve-3d;
|
|
489
|
-
}
|
|
490
|
-
.nut-picker-roller-item {
|
|
491
|
-
backface-visibility: hidden;
|
|
492
|
-
-moz-backface-visibility: hidden;
|
|
493
|
-
-webkit-backface-visibility: hidden;
|
|
494
|
-
position: absolute;
|
|
495
|
-
top: 0;
|
|
496
|
-
width: 100%;
|
|
497
|
-
}
|
|
498
|
-
.nut-picker-roller-item-title {
|
|
499
|
-
display: block;
|
|
500
|
-
width: 100%;
|
|
501
|
-
height: var(--nutui-picker-item-height, 36px);
|
|
502
|
-
line-height: var(--nutui-picker-item-height, 36px);
|
|
503
|
-
text-align: center;
|
|
504
|
-
color: var(--nutui-gray-7);
|
|
505
|
-
font-size: var(--nutui-font-size-base, 14px);
|
|
506
|
-
}
|
|
507
|
-
.nut-picker-roller-item-hidden {
|
|
508
|
-
visibility: hidden;
|
|
509
|
-
opacity: 0;
|
|
510
|
-
}
|
|
511
|
-
.nut-picker-placeholder {
|
|
512
|
-
height: 1px;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
[dir=rtl] .nut-picker-mask,
|
|
516
|
-
.nut-rtl .nut-picker-mask {
|
|
517
|
-
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)));
|
|
518
419
|
}
|
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { PopupProps } from "../popup/types";
|
|
2
|
+
import { BasicComponent } from "../../utils/typings";
|
|
3
|
+
import { PickerOnChangeCallbackParameter, PickerOption, PickerOptions, PickerValue } from "../pickerview/types";
|
|
4
|
+
export type PickerRef = PickerActions;
|
|
5
|
+
export type PickerActions = {
|
|
6
|
+
open: () => void;
|
|
7
|
+
close: () => void;
|
|
8
|
+
};
|
|
9
|
+
export type ColumnsType = 'single' | 'multiple' | 'cascade';
|
|
10
|
+
export interface PickerProps extends Omit<BasicComponent, 'children'> {
|
|
11
|
+
visible?: boolean | undefined;
|
|
12
|
+
title?: string;
|
|
13
|
+
options: PickerOptions[];
|
|
14
|
+
value?: PickerValue[];
|
|
15
|
+
defaultValue?: PickerValue[];
|
|
16
|
+
threeDimensional?: boolean;
|
|
17
|
+
duration: number | string;
|
|
18
|
+
closeOnOverlayClick: boolean;
|
|
19
|
+
renderLabel?: (item: PickerOption) => React.ReactNode;
|
|
20
|
+
popupProps: Partial<Omit<PopupProps, 'title' | 'onClose' | 'closeOnOverlayClick'>>;
|
|
21
|
+
onConfirm?: (selectedOptions: PickerOptions, selectedValue: PickerValue[]) => void;
|
|
22
|
+
onCancel?: () => void;
|
|
23
|
+
onClose?: (selectedOptions: PickerOptions, selectedValue: PickerValue[]) => void;
|
|
24
|
+
onChange?: (args0: PickerOnChangeCallbackParameter) => void;
|
|
25
|
+
children?: any;
|
|
7
26
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PickerRollerProps } from './types';
|
|
3
|
+
declare const PickerRoller: React.ForwardRefExoticComponent<Partial<PickerRollerProps> & React.RefAttributes<{
|
|
4
|
+
stopMomentum: () => void;
|
|
5
|
+
moving: boolean;
|
|
6
|
+
}>>;
|
|
7
|
+
export default PickerRoller;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
2
|
+
import React, { useState, useEffect, useRef, useImperativeHandle } from "react";
|
|
3
|
+
import { useTouch } from "../../hooks/use-touch";
|
|
4
|
+
import { passiveSupported } from "../../utils/supports-passive";
|
|
5
|
+
import { preventDefault } from "../../utils";
|
|
6
|
+
import { momentum, useStyles } from "./utils";
|
|
7
|
+
var InternalPickerRoller = function(props, ref) {
|
|
8
|
+
var _props_keyIndex = props.keyIndex, keyIndex = _props_keyIndex === void 0 ? 0 : _props_keyIndex, _props_options = props.options, options = _props_options === void 0 ? [] : _props_options, _props_threeDimensional = props.threeDimensional, threeDimensional = _props_threeDimensional === void 0 ? true : _props_threeDimensional, _props_duration = props.duration, duration = _props_duration === void 0 ? 1000 : _props_duration, onSelect = props.onSelect, _props_renderLabel = props.renderLabel, renderLabel = _props_renderLabel === void 0 ? function(item) {
|
|
9
|
+
return item.label;
|
|
10
|
+
} : _props_renderLabel;
|
|
11
|
+
var DEFAULT_DURATION = 200;
|
|
12
|
+
var INERTIA_TIME = 300;
|
|
13
|
+
var INERTIA_DISTANCE = 15;
|
|
14
|
+
var ROTATION = 20;
|
|
15
|
+
var touch = useTouch();
|
|
16
|
+
var _useState = _sliced_to_array(useState(1), 2), currentIndex = _useState[0], setCurrentIndex = _useState[1];
|
|
17
|
+
var lineSpacing = useRef(36);
|
|
18
|
+
var _useState1 = _sliced_to_array(useState(0), 2), touchTime = _useState1[0], setTouchTime = _useState1[1];
|
|
19
|
+
var _useState2 = _sliced_to_array(useState('0deg'), 2), touchDeg = _useState2[0], setTouchDeg = _useState2[1];
|
|
20
|
+
var isMoving = useRef(false);
|
|
21
|
+
var rollerRef = useRef(null);
|
|
22
|
+
var pickerRollerRef = useRef(null);
|
|
23
|
+
var _useState3 = _sliced_to_array(useState(0), 2), startTime = _useState3[0], setStartTime = _useState3[1];
|
|
24
|
+
var _useState4 = _sliced_to_array(useState(0), 2), startY = _useState4[0], setStartY = _useState4[1];
|
|
25
|
+
var transformY = useRef(0);
|
|
26
|
+
var _useState5 = _sliced_to_array(useState(0), 2), scrollDistance = _useState5[0], setScrollDistance = _useState5[1];
|
|
27
|
+
var _useStyles = useStyles(touchTime, touchDeg, scrollDistance, lineSpacing, ROTATION), touchRollerStyle = _useStyles.touchRollerStyle, touchTiledStyle = _useStyles.touchTiledStyle, rollerStyle = _useStyles.rollerStyle;
|
|
28
|
+
var isItemHidden = function(index) {
|
|
29
|
+
return index >= currentIndex + 8 || index <= currentIndex - 8;
|
|
30
|
+
};
|
|
31
|
+
var applyTransform = function(type, deg) {
|
|
32
|
+
var time = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : DEFAULT_DURATION, translateY = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
|
|
33
|
+
setTouchTime(type !== 'end' ? 0 : time);
|
|
34
|
+
setTouchDeg(deg);
|
|
35
|
+
setScrollDistance(translateY);
|
|
36
|
+
};
|
|
37
|
+
var handleMove = function(move, type, time) {
|
|
38
|
+
var updatedMove = move + transformY.current;
|
|
39
|
+
if (type === 'end') {
|
|
40
|
+
updatedMove = Math.max(Math.min(updatedMove, 0), -(options.length - 1) * lineSpacing.current);
|
|
41
|
+
// 滚动距离为lineSpacing.current的倍数值
|
|
42
|
+
var endMove = Math.round(updatedMove / lineSpacing.current) * lineSpacing.current;
|
|
43
|
+
var deg = "".concat((Math.abs(Math.round(endMove / lineSpacing.current)) + 1) * ROTATION, "deg");
|
|
44
|
+
applyTransform(type, deg, time, endMove);
|
|
45
|
+
setCurrentIndex(Math.abs(Math.round(endMove / lineSpacing.current)) + 1);
|
|
46
|
+
} else {
|
|
47
|
+
var currentDeg = (-updatedMove / lineSpacing.current + 1) * ROTATION;
|
|
48
|
+
var deg1 = Math.min(Math.max(currentDeg, 0), (options.length + 1) * ROTATION);
|
|
49
|
+
if (deg1 >= 0 && deg1 < (options.length + 1) * ROTATION) {
|
|
50
|
+
applyTransform('', "".concat(deg1, "deg"), undefined, updatedMove);
|
|
51
|
+
setCurrentIndex(Math.abs(Math.round(updatedMove / lineSpacing.current)) + 1);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var selectValue = function(move) {
|
|
56
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(options === null || options === void 0 ? void 0 : options[Math.round(-move / lineSpacing.current)], keyIndex);
|
|
57
|
+
};
|
|
58
|
+
var handleTouchStart = function(event) {
|
|
59
|
+
touch.start(event);
|
|
60
|
+
setStartY(touch.deltaY.current);
|
|
61
|
+
setStartTime(Date.now());
|
|
62
|
+
transformY.current = scrollDistance;
|
|
63
|
+
};
|
|
64
|
+
var handleTouchMove = function(event) {
|
|
65
|
+
touch.move(event);
|
|
66
|
+
if (touch.isVertical) {
|
|
67
|
+
isMoving.current = true;
|
|
68
|
+
preventDefault(event, true);
|
|
69
|
+
}
|
|
70
|
+
var move = touch.deltaY.current - startY;
|
|
71
|
+
handleMove(move);
|
|
72
|
+
};
|
|
73
|
+
var handleTouchEnd = function() {
|
|
74
|
+
if (!isMoving.current) return;
|
|
75
|
+
var move = touch.deltaY.current - startY;
|
|
76
|
+
var moveTime = Date.now() - startTime;
|
|
77
|
+
if (moveTime <= INERTIA_TIME && Math.abs(move) > INERTIA_DISTANCE) {
|
|
78
|
+
var distance = momentum(move, moveTime);
|
|
79
|
+
handleMove(distance, 'end', +duration);
|
|
80
|
+
} else {
|
|
81
|
+
handleMove(move, 'end');
|
|
82
|
+
}
|
|
83
|
+
setTimeout(function() {
|
|
84
|
+
touch.reset();
|
|
85
|
+
}, 0);
|
|
86
|
+
};
|
|
87
|
+
var updateStatus = function(shouldSelect, value) {
|
|
88
|
+
var selectedValue = value || props.value;
|
|
89
|
+
var index = options.findIndex(function(item) {
|
|
90
|
+
return item.value === selectedValue;
|
|
91
|
+
});
|
|
92
|
+
setCurrentIndex(index === -1 ? 1 : index + 1);
|
|
93
|
+
var move = index * lineSpacing.current;
|
|
94
|
+
shouldSelect && selectValue(-move);
|
|
95
|
+
handleMove(-move);
|
|
96
|
+
};
|
|
97
|
+
var stopMomentumScroll = function() {
|
|
98
|
+
isMoving.current = false;
|
|
99
|
+
setTouchTime(0);
|
|
100
|
+
selectValue(scrollDistance);
|
|
101
|
+
};
|
|
102
|
+
// lineSpacing.current CSS variable
|
|
103
|
+
useEffect(function() {
|
|
104
|
+
var element = pickerRollerRef.current;
|
|
105
|
+
if (element) {
|
|
106
|
+
var computedStyle = getComputedStyle(element);
|
|
107
|
+
var currentLineSpacing = computedStyle.getPropertyValue('--nutui-picker-item-height');
|
|
108
|
+
!!currentLineSpacing && (lineSpacing.current = parseFloat(currentLineSpacing));
|
|
109
|
+
}
|
|
110
|
+
}, [
|
|
111
|
+
pickerRollerRef.current
|
|
112
|
+
]);
|
|
113
|
+
useEffect(function() {
|
|
114
|
+
isMoving.current = false;
|
|
115
|
+
setScrollDistance(0);
|
|
116
|
+
transformY.current = 0;
|
|
117
|
+
updateStatus(false);
|
|
118
|
+
}, [
|
|
119
|
+
options,
|
|
120
|
+
props.value
|
|
121
|
+
]);
|
|
122
|
+
useImperativeHandle(ref, function() {
|
|
123
|
+
return {
|
|
124
|
+
stopMomentum: stopMomentumScroll,
|
|
125
|
+
moving: isMoving.current
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
useEffect(function() {
|
|
129
|
+
var _pickerRollerRef_current, _pickerRollerRef_current1, _pickerRollerRef_current2;
|
|
130
|
+
var options = passiveSupported ? {
|
|
131
|
+
passive: false
|
|
132
|
+
} : false;
|
|
133
|
+
(_pickerRollerRef_current = pickerRollerRef.current) === null || _pickerRollerRef_current === void 0 ? void 0 : _pickerRollerRef_current.addEventListener('touchstart', handleTouchStart, options);
|
|
134
|
+
(_pickerRollerRef_current1 = pickerRollerRef.current) === null || _pickerRollerRef_current1 === void 0 ? void 0 : _pickerRollerRef_current1.addEventListener('touchmove', handleTouchMove, options);
|
|
135
|
+
(_pickerRollerRef_current2 = pickerRollerRef.current) === null || _pickerRollerRef_current2 === void 0 ? void 0 : _pickerRollerRef_current2.addEventListener('touchend', handleTouchEnd, options);
|
|
136
|
+
return function() {
|
|
137
|
+
var _pickerRollerRef_current, _pickerRollerRef_current1, _pickerRollerRef_current2;
|
|
138
|
+
(_pickerRollerRef_current = pickerRollerRef.current) === null || _pickerRollerRef_current === void 0 ? void 0 : _pickerRollerRef_current.removeEventListener('touchstart', handleTouchStart);
|
|
139
|
+
(_pickerRollerRef_current1 = pickerRollerRef.current) === null || _pickerRollerRef_current1 === void 0 ? void 0 : _pickerRollerRef_current1.removeEventListener('touchmove', handleTouchMove);
|
|
140
|
+
(_pickerRollerRef_current2 = pickerRollerRef.current) === null || _pickerRollerRef_current2 === void 0 ? void 0 : _pickerRollerRef_current2.removeEventListener('touchend', handleTouchEnd);
|
|
141
|
+
};
|
|
142
|
+
}, [
|
|
143
|
+
pickerRollerRef.current,
|
|
144
|
+
handleTouchStart,
|
|
145
|
+
handleTouchMove,
|
|
146
|
+
handleTouchEnd
|
|
147
|
+
]);
|
|
148
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
149
|
+
className: "nut-pickerview-list",
|
|
150
|
+
ref: pickerRollerRef
|
|
151
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
152
|
+
className: "nut-pickerview-roller",
|
|
153
|
+
ref: rollerRef,
|
|
154
|
+
style: threeDimensional ? touchRollerStyle() : touchTiledStyle(),
|
|
155
|
+
onTransitionEnd: stopMomentumScroll
|
|
156
|
+
}, threeDimensional && options.map(function(item, index) {
|
|
157
|
+
var _item_value;
|
|
158
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
159
|
+
className: "nut-pickerview-roller-item ".concat(isItemHidden(index + 1) && 'nut-pickerview-roller-item-hidden'),
|
|
160
|
+
style: rollerStyle(index),
|
|
161
|
+
key: (_item_value = item.value) !== null && _item_value !== void 0 ? _item_value : index
|
|
162
|
+
}, renderLabel(item));
|
|
163
|
+
}), !threeDimensional && options.map(function(item, index) {
|
|
164
|
+
var _item_value;
|
|
165
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
166
|
+
className: "nut-pickerview-roller-item-tiled",
|
|
167
|
+
key: (_item_value = item.value) !== null && _item_value !== void 0 ? _item_value : index
|
|
168
|
+
}, renderLabel(item));
|
|
169
|
+
})));
|
|
170
|
+
};
|
|
171
|
+
var PickerRoller = /*#__PURE__*/ React.forwardRef(InternalPickerRoller);
|
|
172
|
+
export default PickerRoller;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
2
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
3
|
+
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
4
|
+
import { _ as _to_consumable_array } from "@swc/helpers/_/_to_consumable_array";
|
|
5
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
6
|
+
import classNames from "classnames";
|
|
7
|
+
import isEqual from "react-fast-compare";
|
|
8
|
+
import { ComponentDefaults } from "../../utils/typings";
|
|
9
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
10
|
+
import PickerRoller from "./pickerroller";
|
|
11
|
+
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
12
|
+
options: [],
|
|
13
|
+
defaultValue: [],
|
|
14
|
+
value: undefined,
|
|
15
|
+
renderLabel: function(item) {
|
|
16
|
+
return item.label;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var InternalPickerView = function(props, ref) {
|
|
20
|
+
var _$_object_spread = _object_spread({}, defaultProps, props), options = _$_object_spread.options, _object_spread_defaultValue = _$_object_spread.defaultValue, defaultValue = _object_spread_defaultValue === void 0 ? [] : _object_spread_defaultValue, value = _$_object_spread.value, duration = _$_object_spread.duration, threeDimensional = _$_object_spread.threeDimensional, renderLabel = _$_object_spread.renderLabel, className = _$_object_spread.className, style = _$_object_spread.style, onChange = _$_object_spread.onChange;
|
|
21
|
+
var classPrefix = 'nut-pickerview';
|
|
22
|
+
var cls = classNames(classPrefix, className);
|
|
23
|
+
var _usePropsValue = _sliced_to_array(usePropsValue({
|
|
24
|
+
value: value,
|
|
25
|
+
defaultValue: _to_consumable_array(defaultValue),
|
|
26
|
+
finalValue: _to_consumable_array(defaultValue)
|
|
27
|
+
}), 1), selectedValue = _usePropsValue[0];
|
|
28
|
+
var _useState = _sliced_to_array(useState(selectedValue), 2), innerValue = _useState[0], setInnerValue = _useState[1];
|
|
29
|
+
var _useState1 = _sliced_to_array(useState([]), 2), innerOptions = _useState1[0], setInnerOptions = _useState1[1];
|
|
30
|
+
var changeIndex = useRef(0);
|
|
31
|
+
/**
|
|
32
|
+
* 数据类型:级联、多列
|
|
33
|
+
*/ var columnsType = useMemo(function() {
|
|
34
|
+
var firstColumn = props.options[0] || [];
|
|
35
|
+
if (Array.isArray(firstColumn) && firstColumn.length > 0 && 'children' in firstColumn[0]) {
|
|
36
|
+
return 'cascade';
|
|
37
|
+
}
|
|
38
|
+
return 'multiple';
|
|
39
|
+
}, [
|
|
40
|
+
props.options
|
|
41
|
+
]);
|
|
42
|
+
var formatCascadeOptions = function(options, value) {
|
|
43
|
+
var _loop = function() {
|
|
44
|
+
var currentOptions = columnOptions.children;
|
|
45
|
+
formatted.push(currentOptions);
|
|
46
|
+
var currentValue = value === null || value === void 0 ? void 0 : value[columnIndex];
|
|
47
|
+
if (currentValue === 0) {
|
|
48
|
+
// 如果 currentValue 为 0,返回第一个 children
|
|
49
|
+
columnOptions = currentOptions[0];
|
|
50
|
+
} else if (currentValue) {
|
|
51
|
+
// 如果 currentValue 存在,查找匹配的项
|
|
52
|
+
var index = currentOptions.findIndex(function(columnItem) {
|
|
53
|
+
return columnItem.value === currentValue;
|
|
54
|
+
});
|
|
55
|
+
columnOptions = currentOptions[index === -1 ? 0 : index] // 如果未找到,默认取第一个
|
|
56
|
+
;
|
|
57
|
+
} else {
|
|
58
|
+
return "break" // 如果 currentValue 不存在,终止循环
|
|
59
|
+
;
|
|
60
|
+
}
|
|
61
|
+
columnIndex++;
|
|
62
|
+
};
|
|
63
|
+
if (!options.length) return [] // 如果 options 为空,直接返回空数组
|
|
64
|
+
;
|
|
65
|
+
var formatted = [];
|
|
66
|
+
var columnOptions = {
|
|
67
|
+
label: '',
|
|
68
|
+
value: '',
|
|
69
|
+
children: options
|
|
70
|
+
};
|
|
71
|
+
var columnIndex = 0;
|
|
72
|
+
while(columnOptions && columnOptions.children){
|
|
73
|
+
var _ret = _loop();
|
|
74
|
+
if (_ret === "break") break;
|
|
75
|
+
}
|
|
76
|
+
return formatted;
|
|
77
|
+
};
|
|
78
|
+
var formatOptions = useMemo(function() {
|
|
79
|
+
if (columnsType === 'cascade') {
|
|
80
|
+
var _props_options;
|
|
81
|
+
return formatCascadeOptions(props === null || props === void 0 ? void 0 : (_props_options = props.options) === null || _props_options === void 0 ? void 0 : _props_options[0], innerValue);
|
|
82
|
+
}
|
|
83
|
+
return props.options;
|
|
84
|
+
}, [
|
|
85
|
+
innerValue,
|
|
86
|
+
options,
|
|
87
|
+
columnsType
|
|
88
|
+
]);
|
|
89
|
+
useEffect(function() {
|
|
90
|
+
var options = props.options;
|
|
91
|
+
if (Array.isArray(options) && options.length && options !== innerOptions) {
|
|
92
|
+
setInnerOptions(formatOptions);
|
|
93
|
+
}
|
|
94
|
+
}, [
|
|
95
|
+
props.options,
|
|
96
|
+
innerValue
|
|
97
|
+
]);
|
|
98
|
+
useEffect(function() {
|
|
99
|
+
if (selectedValue !== innerValue) {
|
|
100
|
+
setInnerValue(selectedValue);
|
|
101
|
+
}
|
|
102
|
+
}, [
|
|
103
|
+
selectedValue
|
|
104
|
+
]);
|
|
105
|
+
var handleSelect = useCallback(function(option, index) {
|
|
106
|
+
var newValue = option === null || option === void 0 ? void 0 : option.value;
|
|
107
|
+
if (!newValue || innerValue[index] === newValue) return;
|
|
108
|
+
changeIndex.current = index;
|
|
109
|
+
if (columnsType === 'multiple') {
|
|
110
|
+
setInnerValue(function(prev) {
|
|
111
|
+
var next = _to_consumable_array(prev);
|
|
112
|
+
next[index] = newValue;
|
|
113
|
+
return next;
|
|
114
|
+
});
|
|
115
|
+
} else {
|
|
116
|
+
var _option_children, _option_children1, _props_options;
|
|
117
|
+
var startIndex = index;
|
|
118
|
+
var values = [];
|
|
119
|
+
values[index] = option.value;
|
|
120
|
+
while(option === null || option === void 0 ? void 0 : (_option_children = option.children) === null || _option_children === void 0 ? void 0 : _option_children[0]){
|
|
121
|
+
values[index + 1] = option.children[0].value;
|
|
122
|
+
index++;
|
|
123
|
+
option = option.children[0];
|
|
124
|
+
}
|
|
125
|
+
// 当前改变列的下一列 children 值为空
|
|
126
|
+
if (option === null || option === void 0 ? void 0 : (_option_children1 = option.children) === null || _option_children1 === void 0 ? void 0 : _option_children1.length) {
|
|
127
|
+
values[index + 1] = '';
|
|
128
|
+
}
|
|
129
|
+
var combineResult = _to_consumable_array(innerValue.slice(0, startIndex)).concat(_to_consumable_array(values.splice(startIndex)));
|
|
130
|
+
setInnerValue(_to_consumable_array(combineResult));
|
|
131
|
+
var optionFirst = props === null || props === void 0 ? void 0 : (_props_options = props.options) === null || _props_options === void 0 ? void 0 : _props_options[0];
|
|
132
|
+
if (!isEqual(formatCascadeOptions(optionFirst, combineResult), innerOptions)) {
|
|
133
|
+
setInnerOptions(formatCascadeOptions(optionFirst, combineResult));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}, [
|
|
137
|
+
innerValue,
|
|
138
|
+
props.options,
|
|
139
|
+
columnsType,
|
|
140
|
+
innerOptions
|
|
141
|
+
]);
|
|
142
|
+
var selectedOptions = useMemo(function() {
|
|
143
|
+
return innerOptions.map(function(columnOptions, index) {
|
|
144
|
+
var selectedOption = columnOptions.find(function(item) {
|
|
145
|
+
return item.value === innerValue[index];
|
|
146
|
+
});
|
|
147
|
+
return selectedOption;
|
|
148
|
+
// return selectedOption || columnOptions[0]
|
|
149
|
+
}).filter(Boolean);
|
|
150
|
+
}, [
|
|
151
|
+
innerOptions,
|
|
152
|
+
innerValue
|
|
153
|
+
]);
|
|
154
|
+
useEffect(function() {
|
|
155
|
+
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
156
|
+
value: innerValue,
|
|
157
|
+
index: changeIndex.current,
|
|
158
|
+
selectedOptions: selectedOptions
|
|
159
|
+
});
|
|
160
|
+
}, [
|
|
161
|
+
innerValue,
|
|
162
|
+
selectedOptions,
|
|
163
|
+
onChange
|
|
164
|
+
]);
|
|
165
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
166
|
+
className: cls,
|
|
167
|
+
style: style
|
|
168
|
+
}, innerOptions.map(function(item, index) {
|
|
169
|
+
var _props_setRefs;
|
|
170
|
+
return /*#__PURE__*/ React.createElement(PickerRoller, {
|
|
171
|
+
ref: props === null || props === void 0 ? void 0 : (_props_setRefs = props.setRefs) === null || _props_setRefs === void 0 ? void 0 : _props_setRefs.call(props, index),
|
|
172
|
+
key: index,
|
|
173
|
+
keyIndex: index,
|
|
174
|
+
value: innerValue[index],
|
|
175
|
+
options: item,
|
|
176
|
+
renderLabel: renderLabel,
|
|
177
|
+
onSelect: handleSelect,
|
|
178
|
+
duration: duration,
|
|
179
|
+
threeDimensional: threeDimensional
|
|
180
|
+
});
|
|
181
|
+
}), (innerOptions === null || innerOptions === void 0 ? void 0 : innerOptions.length) ? /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("div", {
|
|
182
|
+
className: "nut-pickerview-mask"
|
|
183
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
184
|
+
className: "nut-pickerview-indicator"
|
|
185
|
+
})) : null);
|
|
186
|
+
};
|
|
187
|
+
var PickerView = /*#__PURE__*/ React.forwardRef(InternalPickerView);
|
|
188
|
+
export default PickerView;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './pickerview.scss';
|