@nutui/nutui-react-taro 3.0.20 → 3.0.22-cpp
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 +38 -68
- package/dist/cjs/hooks/use-props-value.js +1 -1
- package/dist/cjs/hooks/use-touch.js +4 -4
- package/dist/cjs/locales/base.d.ts +9 -0
- package/dist/cjs/locales/en-US.js +21 -2
- package/dist/cjs/locales/id-ID.js +21 -2
- package/dist/cjs/locales/ja-JP.js +19 -2
- package/dist/cjs/locales/tr-TR.js +21 -2
- package/dist/cjs/locales/zh-CN.js +19 -2
- package/dist/cjs/locales/zh-TW.js +19 -2
- package/dist/cjs/locales/zh-UG.js +21 -2
- package/dist/cjs/packages/actionsheet/style/style.harmony.css +38 -17
- package/dist/cjs/packages/address/address.d.ts +1 -1
- package/dist/cjs/packages/address/cascaderRender.js +1 -1
- package/dist/cjs/packages/address/existRender.js +1 -1
- package/dist/cjs/packages/address/style/style.harmony.css +38 -17
- package/dist/cjs/packages/animatingnumbers/countup.js +3 -1
- package/dist/cjs/packages/audio/audio.js +1 -1
- package/dist/cjs/packages/audio/style/style.harmony.css +0 -3
- package/dist/cjs/packages/avatar/avatar.js +32 -6
- package/dist/cjs/packages/avatarcropper/avatarcropper.js +3 -7
- package/dist/cjs/packages/badge/badge.js +16 -3
- package/dist/cjs/packages/barrage/barrage.js +2 -1
- package/dist/cjs/packages/button/button.d.ts +2 -24
- package/dist/cjs/packages/button/button.js +9 -12
- package/dist/cjs/packages/button/index.d.ts +0 -1
- package/dist/cjs/packages/button/style/button.scss +0 -3
- package/dist/cjs/packages/button/style/style.css +0 -3
- package/dist/cjs/packages/button/style/style.harmony.css +0 -3
- package/dist/cjs/packages/button/style-jmapp/button.scss +0 -3
- package/dist/cjs/packages/button/style-jmapp/style.css +0 -3
- package/dist/cjs/packages/button/style-jrkf/button.scss +0 -3
- package/dist/cjs/packages/button/style-jrkf/style.css +0 -3
- package/dist/cjs/packages/calendar/style/calendar.scss +32 -1
- package/dist/cjs/packages/calendar/style/style.css +21 -1
- package/dist/cjs/packages/calendar/style/style.harmony.css +59 -18
- package/dist/cjs/packages/calendar/style-jmapp/calendar.scss +32 -1
- package/dist/cjs/packages/calendar/style-jmapp/style.css +21 -1
- package/dist/cjs/packages/calendar/style-jrkf/calendar.scss +32 -1
- package/dist/cjs/packages/calendar/style-jrkf/style.css +21 -1
- package/dist/cjs/packages/calendarcard/calendarcard.js +30 -8
- package/dist/cjs/packages/calendarcard/icon.js +12 -23
- package/dist/cjs/packages/calendarcard/style/calendarcard.scss +19 -0
- package/dist/cjs/packages/calendarcard/style/style.css +13 -0
- package/dist/cjs/packages/calendarcard/style/style.harmony.css +13 -0
- package/dist/cjs/packages/calendarcard/style-jmapp/calendarcard.scss +19 -0
- package/dist/cjs/packages/calendarcard/style-jmapp/style.css +13 -0
- package/dist/cjs/packages/calendarcard/style-jrkf/calendarcard.scss +19 -0
- package/dist/cjs/packages/calendarcard/style-jrkf/style.css +13 -0
- package/dist/cjs/packages/card/card.js +1 -1
- package/dist/cjs/packages/card/style/style.harmony.css +1 -1
- package/dist/cjs/packages/cascader/style/style.harmony.css +38 -17
- package/dist/cjs/packages/cascader/utils.js +4 -4
- package/dist/cjs/packages/cellgroup/cellgroup.js +1 -1
- package/dist/cjs/packages/checkboxgroup/checkboxgroup.js +3 -3
- package/dist/cjs/packages/circleprogress/circleprogress.js +1 -1
- package/dist/cjs/packages/collapseitem/collapseitem.js +1 -1
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/countdown/countdown.js +1 -1
- package/dist/cjs/packages/datepicker/datepicker.js +1 -1
- package/dist/cjs/packages/datepicker/style/style.harmony.css +39 -18
- package/dist/cjs/packages/dialog/dialog.js +20 -14
- package/dist/cjs/packages/dialog/style/dialog.scss +1 -1
- package/dist/cjs/packages/dialog/style/style.css +1 -1
- package/dist/cjs/packages/dialog/style/style.harmony.css +1 -4
- package/dist/cjs/packages/dialog/style-jmapp/dialog.scss +1 -1
- package/dist/cjs/packages/dialog/style-jmapp/style.css +1 -1
- package/dist/cjs/packages/dialog/style-jrkf/dialog.scss +1 -1
- package/dist/cjs/packages/dialog/style-jrkf/style.css +1 -1
- package/dist/cjs/packages/divider/divider.js +3 -3
- package/dist/cjs/packages/elevator/elevator.js +1 -1
- package/dist/cjs/packages/ellipsis/ellipsis.js +1 -1
- package/dist/cjs/packages/empty/empty.d.ts +4 -4
- package/dist/cjs/packages/empty/style/style.harmony.css +0 -3
- package/dist/cjs/packages/form/form.js +1 -1
- package/dist/cjs/packages/form/style/style.harmony.css +0 -5
- package/dist/cjs/packages/formitem/style/formitem.scss +4 -4
- package/dist/cjs/packages/formitem/style/style.css +0 -5
- package/dist/cjs/packages/formitem/style/style.harmony.css +0 -5
- package/dist/cjs/packages/formitem/style-jmapp/formitem.scss +4 -4
- package/dist/cjs/packages/formitem/style-jmapp/style.css +0 -5
- package/dist/cjs/packages/formitem/style-jrkf/formitem.scss +4 -4
- package/dist/cjs/packages/formitem/style-jrkf/style.css +0 -5
- package/dist/cjs/packages/grid/grid.js +1 -1
- package/dist/cjs/packages/griditem/griditem.js +1 -1
- package/dist/cjs/packages/image/image.js +12 -4
- package/dist/cjs/packages/imagepreview/imagepreview.js +3 -2
- package/dist/cjs/packages/imagepreview/style/style.harmony.css +38 -17
- package/dist/cjs/packages/indicator/indicator.js +1 -1
- package/dist/cjs/packages/infiniteloading/infiniteloading.js +3 -3
- package/dist/cjs/packages/input/input.js +11 -4
- package/dist/cjs/packages/inputnumber/inputnumber.js +2 -2
- package/dist/cjs/packages/loading/loading.js +1 -1
- package/dist/cjs/packages/lottie/lottiemp.js +10 -18
- package/dist/cjs/packages/menu/menu.js +1 -1
- package/dist/cjs/packages/numberkeyboard/style/style.css +1 -1
- package/dist/cjs/packages/numberkeyboard/style/style.harmony.css +39 -18
- package/dist/cjs/packages/nutui.react.build.d.ts +3 -1
- package/dist/cjs/packages/nutui.react.build.js +18 -14
- package/dist/cjs/packages/nutui.react.d.ts +4 -1
- package/dist/cjs/packages/nutui.react.js +19 -14
- package/dist/cjs/packages/nutui.react.scss.d.ts +1 -0
- package/dist/cjs/packages/nutui.react.scss.js +1 -0
- package/dist/cjs/packages/overlay/overlay.js +4 -4
- package/dist/cjs/packages/pagination/pagination.js +1 -1
- package/dist/cjs/packages/picker/picker.js +1 -1
- package/dist/cjs/packages/picker/style/style.css +1 -1
- package/dist/cjs/packages/picker/style/style.harmony.css +39 -18
- package/dist/cjs/packages/pickerview/pickerroller.js +1 -1
- package/dist/cjs/packages/popover/popover.js +2 -2
- package/dist/cjs/packages/popover/style/style.harmony.css +38 -17
- package/dist/cjs/packages/popup/popup.js +188 -103
- package/dist/cjs/packages/popup/style/popup.scss +22 -1
- package/dist/cjs/packages/popup/style/style.css +38 -17
- package/dist/cjs/packages/popup/style/style.harmony.css +38 -17
- package/dist/cjs/packages/popup/style-jmapp/popup.scss +22 -1
- package/dist/cjs/packages/popup/style-jmapp/style.css +22 -1
- package/dist/cjs/packages/popup/style-jrkf/popup.scss +22 -1
- package/dist/cjs/packages/popup/style-jrkf/style.css +22 -1
- package/dist/cjs/packages/price/price.js +52 -13
- package/dist/cjs/packages/progress/progress.js +7 -12
- package/dist/cjs/packages/quickenter/index.d.ts +3 -0
- package/dist/cjs/packages/quickenter/index.js +13 -0
- package/dist/cjs/packages/quickenter/quickenter.d.ts +4 -0
- package/dist/cjs/packages/quickenter/quickenter.js +153 -0
- package/dist/cjs/packages/quickenter/style/css.js +2 -0
- package/dist/cjs/packages/quickenter/style/index.js +2 -0
- package/dist/cjs/packages/quickenter/style/quickenter.scss +120 -0
- package/dist/cjs/packages/quickenter/style/style.css +106 -0
- package/dist/cjs/packages/quickenter/style/style.harmony.css +506 -0
- package/dist/cjs/packages/quickenter/style-jmapp/css.js +2 -0
- package/dist/cjs/packages/quickenter/style-jmapp/index.js +2 -0
- package/dist/cjs/packages/quickenter/style-jmapp/quickenter.scss +120 -0
- package/dist/cjs/packages/quickenter/style-jmapp/style.css +106 -0
- package/dist/cjs/packages/quickenter/style-jrkf/css.js +2 -0
- package/dist/cjs/packages/quickenter/style-jrkf/index.js +2 -0
- package/dist/cjs/packages/quickenter/style-jrkf/quickenter.scss +120 -0
- package/dist/cjs/packages/quickenter/style-jrkf/style.css +106 -0
- package/dist/cjs/packages/radio/radio.js +1 -1
- package/dist/cjs/packages/radiogroup/radiogroup.js +3 -3
- package/dist/cjs/packages/range/range.js +35 -10
- package/dist/cjs/packages/rate/rate.js +5 -8
- package/dist/cjs/packages/resultpage/resultpage.js +2 -1
- package/dist/cjs/packages/resultpage/style/style.harmony.css +0 -3
- package/dist/cjs/packages/safearea/safearea.js +3 -12
- package/dist/cjs/packages/safearea/style/safearea.scss +0 -6
- package/dist/cjs/packages/safearea/style/style.css +0 -2
- package/dist/cjs/packages/safearea/style/style.harmony.css +0 -2
- package/dist/cjs/packages/safearea/style-jmapp/safearea.scss +0 -6
- package/dist/cjs/packages/safearea/style-jmapp/style.css +0 -2
- package/dist/cjs/packages/safearea/style-jrkf/safearea.scss +0 -6
- package/dist/cjs/packages/safearea/style-jrkf/style.css +0 -2
- package/dist/cjs/packages/searchbar/searchbar.js +23 -9
- package/dist/cjs/packages/shortpassword/shortpassword.js +1 -1
- package/dist/cjs/packages/shortpassword/style/style.harmony.css +38 -17
- package/dist/cjs/packages/sidebar/sidebar.js +1 -1
- package/dist/cjs/packages/signature/signature.js +2 -2
- package/dist/cjs/packages/skeleton/skeleton.js +1 -1
- package/dist/cjs/packages/step/step.js +3 -8
- package/dist/cjs/packages/step/style/step.scss +0 -2
- package/dist/cjs/packages/step/style/style.css +0 -2
- package/dist/cjs/packages/step/style/style.harmony.css +0 -2
- package/dist/cjs/packages/step/style-jmapp/step.scss +0 -2
- package/dist/cjs/packages/step/style-jmapp/style.css +0 -2
- package/dist/cjs/packages/step/style-jrkf/step.scss +0 -2
- package/dist/cjs/packages/step/style-jrkf/style.css +0 -2
- package/dist/cjs/packages/steps/style/steps.scss +10 -3
- package/dist/cjs/packages/steps/style/style.css +13 -7
- package/dist/cjs/packages/steps/style/style.harmony.css +13 -9
- package/dist/cjs/packages/steps/style-jmapp/steps.scss +10 -3
- package/dist/cjs/packages/steps/style-jmapp/style.css +9 -3
- package/dist/cjs/packages/steps/style-jrkf/steps.scss +10 -3
- package/dist/cjs/packages/steps/style-jrkf/style.css +9 -3
- package/dist/cjs/packages/sticky/sticky.js +3 -3
- package/dist/cjs/packages/swipe/swipe.js +84 -115
- package/dist/cjs/packages/swiper/swiper.js +1 -1
- package/dist/cjs/packages/switch/switch.js +1 -1
- package/dist/cjs/packages/tabbaritem/tabbaritem.js +1 -1
- package/dist/cjs/packages/table/style/style.css +1 -1
- package/dist/cjs/packages/table/style/style.harmony.css +1 -1
- package/dist/cjs/packages/table/style/table.scss +1 -1
- package/dist/cjs/packages/table/style-jmapp/style.css +1 -1
- package/dist/cjs/packages/table/style-jmapp/table.scss +1 -1
- package/dist/cjs/packages/table/style-jrkf/style.css +1 -1
- package/dist/cjs/packages/table/style-jrkf/table.scss +1 -1
- package/dist/cjs/packages/table/table.js +1 -1
- package/dist/cjs/packages/tabs/tabs.js +13 -6
- package/dist/cjs/packages/tag/style/style.css +1 -1
- package/dist/cjs/packages/tag/style/style.harmony.css +1 -1
- package/dist/cjs/packages/tag/style/tag.scss +1 -1
- package/dist/cjs/packages/tag/style-jmapp/style.css +1 -1
- package/dist/cjs/packages/tag/style-jmapp/tag.scss +1 -1
- package/dist/cjs/packages/tag/style-jrkf/style.css +1 -1
- package/dist/cjs/packages/tag/style-jrkf/tag.scss +1 -1
- package/dist/cjs/packages/textarea/textarea.js +1 -1
- package/dist/cjs/packages/timeselect/style/style.harmony.css +38 -17
- package/dist/cjs/packages/timeselect/timeselect.js +1 -1
- package/dist/cjs/packages/toast/style/style.css +2 -4
- package/dist/cjs/packages/toast/style/style.harmony.css +2 -4
- package/dist/cjs/packages/toast/style/toast.scss +2 -4
- package/dist/cjs/packages/toast/style-jmapp/style.css +2 -4
- package/dist/cjs/packages/toast/style-jmapp/toast.scss +2 -4
- package/dist/cjs/packages/toast/style-jrkf/style.css +2 -4
- package/dist/cjs/packages/toast/style-jrkf/toast.scss +2 -4
- package/dist/cjs/packages/toast/toast.js +3 -3
- package/dist/cjs/packages/tour/style/style.harmony.css +38 -17
- package/dist/cjs/packages/trendarrow/trendarrow.js +1 -1
- package/dist/cjs/packages/uploader/uploader.js +1 -1
- package/dist/cjs/packages/video/video.js +2 -2
- package/dist/cjs/packages/virtuallist/utils.js +1 -1
- package/dist/cjs/packages/virtuallist/virtuallist.js +1 -1
- package/dist/cjs/types/index.d.ts +3 -0
- package/dist/cjs/types/index.js +3 -0
- package/dist/cjs/types/spec/button/base.d.ts +2 -1
- package/dist/cjs/types/spec/button/taro.d.ts +5 -1
- package/dist/cjs/types/spec/calendarcard/base.d.ts +2 -0
- package/dist/cjs/types/spec/dialog/base.d.ts +1 -0
- package/dist/cjs/types/spec/dialog/h5.d.ts +2 -0
- package/dist/cjs/types/spec/dialog/taro.d.ts +2 -0
- package/dist/cjs/types/spec/overlay/base.d.ts +1 -0
- package/dist/cjs/types/spec/popup/base.d.ts +2 -0
- package/dist/cjs/types/spec/price/base.d.ts +1 -0
- package/dist/cjs/types/spec/quickenter/base.d.ts +27 -0
- package/dist/cjs/types/spec/quickenter/base.js +4 -0
- package/dist/cjs/types/spec/quickenter/h5.d.ts +5 -0
- package/dist/cjs/types/spec/quickenter/h5.js +4 -0
- package/dist/cjs/types/spec/quickenter/taro.d.ts +5 -0
- package/dist/cjs/types/spec/quickenter/taro.js +4 -0
- package/dist/cjs/utils/should-render-price-raw.d.ts +2 -0
- package/dist/cjs/utils/should-render-price-raw.js +46 -0
- package/dist/cjs/utils/taro/{ConfigurableCSSTransition copy.js → ConfigurableCSSTransition.js} +13 -53
- package/dist/cjs/utils/taro/get-rect.js +4 -2
- package/dist/cjs/utils/taro/get-system-info.d.ts +0 -5
- package/dist/cjs/utils/taro/get-system-info.js +2 -7
- package/dist/es/hooks/taro/use-custom-event.js +4 -3
- package/dist/es/hooks/taro/use-lock-scoll.js +1 -1
- package/dist/es/hooks/use-click-away.js +2 -2
- package/dist/es/hooks/use-lock-scroll.js +3 -3
- package/dist/es/hooks/use-pagination.js +1 -1
- package/dist/es/hooks/use-ref-state.js +3 -3
- package/dist/es/hooks/use-touch.js +13 -13
- package/dist/es/hooks/use-watch.js +1 -1
- package/dist/es/locales/base.d.ts +9 -0
- package/dist/es/locales/en-US.js +24 -5
- package/dist/es/locales/id-ID.js +24 -5
- package/dist/es/locales/ja-JP.js +22 -5
- package/dist/es/locales/tr-TR.js +24 -5
- package/dist/es/locales/zh-CN.js +22 -5
- package/dist/es/locales/zh-TW.js +22 -5
- package/dist/es/locales/zh-UG.js +24 -5
- package/dist/es/packages/actionsheet/actionsheet.js +8 -8
- package/dist/es/packages/actionsheet/style/style.harmony.css +38 -17
- package/dist/es/packages/address/address.d.ts +1 -1
- package/dist/es/packages/address/address.js +10 -10
- package/dist/es/packages/address/cascaderRender.js +4 -4
- package/dist/es/packages/address/elevatorRender.js +17 -17
- package/dist/es/packages/address/existRender.js +5 -5
- package/dist/es/packages/address/style/style.harmony.css +38 -17
- package/dist/es/packages/address/utils.js +5 -5
- package/dist/es/packages/animate/animate.js +3 -3
- package/dist/es/packages/animatingnumbers/countup.js +4 -2
- package/dist/es/packages/audio/audio.js +16 -16
- package/dist/es/packages/audio/style/style.harmony.css +0 -3
- package/dist/es/packages/avatar/avatar.js +35 -9
- package/dist/es/packages/avatarcropper/avatarcropper.js +29 -33
- package/dist/es/packages/avatargroup/avatargroup.js +1 -1
- package/dist/es/packages/backtop/backtop.js +3 -3
- package/dist/es/packages/badge/badge.js +18 -5
- package/dist/es/packages/barrage/barrage.js +10 -9
- package/dist/es/packages/button/button.d.ts +2 -24
- package/dist/es/packages/button/button.js +12 -14
- package/dist/es/packages/button/index.d.ts +0 -1
- package/dist/es/packages/button/style/button.scss +0 -3
- package/dist/es/packages/button/style/style.css +0 -3
- package/dist/es/packages/button/style/style.harmony.css +0 -3
- package/dist/es/packages/button/style-jmapp/button.scss +0 -3
- package/dist/es/packages/button/style-jmapp/style.css +0 -3
- package/dist/es/packages/button/style-jrkf/button.scss +0 -3
- package/dist/es/packages/button/style-jrkf/style.css +0 -3
- package/dist/es/packages/calendar/calendar.js +12 -12
- package/dist/es/packages/calendar/style/calendar.scss +32 -1
- package/dist/es/packages/calendar/style/style.css +21 -1
- package/dist/es/packages/calendar/style/style.harmony.css +59 -18
- package/dist/es/packages/calendar/style-jmapp/calendar.scss +32 -1
- package/dist/es/packages/calendar/style-jmapp/style.css +21 -1
- package/dist/es/packages/calendar/style-jrkf/calendar.scss +32 -1
- package/dist/es/packages/calendar/style-jrkf/style.css +21 -1
- package/dist/es/packages/calendar/utils.js +7 -7
- package/dist/es/packages/calendarcard/calendarcard.js +53 -31
- package/dist/es/packages/calendarcard/icon.js +18 -29
- package/dist/es/packages/calendarcard/style/calendarcard.scss +19 -0
- package/dist/es/packages/calendarcard/style/style.css +13 -0
- package/dist/es/packages/calendarcard/style/style.harmony.css +13 -0
- package/dist/es/packages/calendarcard/style-jmapp/calendarcard.scss +19 -0
- package/dist/es/packages/calendarcard/style-jmapp/style.css +13 -0
- package/dist/es/packages/calendarcard/style-jrkf/calendarcard.scss +19 -0
- package/dist/es/packages/calendarcard/style-jrkf/style.css +13 -0
- package/dist/es/packages/calendarcard/utils.js +5 -5
- package/dist/es/packages/calendaritem/calendaritem.js +32 -32
- package/dist/es/packages/card/card.js +2 -2
- package/dist/es/packages/card/style/style.harmony.css +1 -1
- package/dist/es/packages/cascader/cascader.js +15 -15
- package/dist/es/packages/cascader/style/style.harmony.css +38 -17
- package/dist/es/packages/cascader/utils.js +6 -6
- package/dist/es/packages/cell/cell.js +4 -4
- package/dist/es/packages/cellgroup/cellgroup.js +2 -2
- package/dist/es/packages/checkbox/checkbox.js +10 -10
- package/dist/es/packages/checkboxgroup/checkboxgroup.js +7 -7
- package/dist/es/packages/circleprogress/circleprogress.js +7 -7
- package/dist/es/packages/col/col.js +2 -2
- package/dist/es/packages/collapse/collapse.js +3 -3
- package/dist/es/packages/collapse/context.js +2 -2
- package/dist/es/packages/collapseitem/collapseitem.js +5 -5
- package/dist/es/packages/configprovider/configprovider.js +5 -5
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/countdown/countdown.js +15 -15
- package/dist/es/packages/datepicker/datepicker.js +12 -12
- package/dist/es/packages/datepicker/style/style.harmony.css +39 -18
- package/dist/es/packages/datepicker/utils.js +7 -7
- package/dist/es/packages/datepickerview/datepickerview.js +5 -5
- package/dist/es/packages/dialog/content.js +6 -6
- package/dist/es/packages/dialog/dialog.js +53 -45
- package/dist/es/packages/dialog/style/dialog.scss +1 -1
- package/dist/es/packages/dialog/style/style.css +1 -1
- package/dist/es/packages/dialog/style/style.harmony.css +1 -4
- package/dist/es/packages/dialog/style-jmapp/dialog.scss +1 -1
- package/dist/es/packages/dialog/style-jmapp/style.css +1 -1
- package/dist/es/packages/dialog/style-jrkf/dialog.scss +1 -1
- package/dist/es/packages/dialog/style-jrkf/style.css +1 -1
- package/dist/es/packages/divider/divider.js +4 -4
- package/dist/es/packages/drag/drag.js +5 -5
- package/dist/es/packages/elevator/elevator.js +17 -17
- package/dist/es/packages/ellipsis/ellipsis.js +14 -14
- package/dist/es/packages/empty/empty.d.ts +4 -4
- package/dist/es/packages/empty/empty.js +1 -1
- package/dist/es/packages/empty/style/style.harmony.css +0 -3
- package/dist/es/packages/fixednav/fixednav.js +7 -7
- package/dist/es/packages/form/form.js +7 -7
- package/dist/es/packages/form/style/style.harmony.css +0 -5
- package/dist/es/packages/form/useform.js +4 -4
- package/dist/es/packages/formitem/formitem.js +1 -1
- package/dist/es/packages/formitem/style/formitem.scss +4 -4
- package/dist/es/packages/formitem/style/style.css +0 -5
- package/dist/es/packages/formitem/style/style.harmony.css +0 -5
- package/dist/es/packages/formitem/style-jmapp/formitem.scss +4 -4
- package/dist/es/packages/formitem/style-jmapp/style.css +0 -5
- package/dist/es/packages/formitem/style-jrkf/formitem.scss +4 -4
- package/dist/es/packages/formitem/style-jrkf/style.css +0 -5
- package/dist/es/packages/grid/context.js +1 -1
- package/dist/es/packages/grid/grid.js +4 -4
- package/dist/es/packages/griditem/griditem.js +6 -6
- package/dist/es/packages/hoverbutton/hoverbutton.js +1 -1
- package/dist/es/packages/hoverbuttonitem/hoverbuttonitem.js +6 -6
- package/dist/es/packages/hoverbuttonitem/utils.js +1 -1
- package/dist/es/packages/image/image.js +18 -10
- package/dist/es/packages/imagepreview/imagepreview.js +16 -15
- package/dist/es/packages/imagepreview/style/style.harmony.css +38 -17
- package/dist/es/packages/indicator/indicator.js +5 -5
- package/dist/es/packages/infiniteloading/infiniteloading.js +14 -14
- package/dist/es/packages/input/input.js +23 -16
- package/dist/es/packages/inputnumber/inputnumber.js +13 -13
- package/dist/es/packages/layout/layout.js +1 -1
- package/dist/es/packages/loading/loading.js +3 -3
- package/dist/es/packages/lottie/index.js +1 -1
- package/dist/es/packages/lottie/lottiemp.js +12 -20
- package/dist/es/packages/menu/menu.js +13 -13
- package/dist/es/packages/menuitem/menuitem.js +12 -12
- package/dist/es/packages/navbar/navbar.js +7 -7
- package/dist/es/packages/noticebar/noticebar.js +22 -22
- package/dist/es/packages/notify/notify.js +8 -8
- package/dist/es/packages/numberkeyboard/numberkeyboard.js +12 -12
- package/dist/es/packages/numberkeyboard/style/style.css +1 -1
- package/dist/es/packages/numberkeyboard/style/style.harmony.css +39 -18
- package/dist/es/packages/nutui.react.build.d.ts +3 -1
- package/dist/es/packages/nutui.react.build.js +3 -1
- package/dist/es/packages/overlay/overlay.js +10 -10
- package/dist/es/packages/pagination/pagination.js +8 -8
- package/dist/es/packages/picker/picker.js +15 -15
- package/dist/es/packages/picker/style/style.css +1 -1
- package/dist/es/packages/picker/style/style.harmony.css +39 -18
- package/dist/es/packages/pickerview/pickerroller.js +12 -12
- package/dist/es/packages/pickerview/pickerview.js +3 -3
- package/dist/es/packages/pickerview/utils.js +6 -6
- package/dist/es/packages/popover/popover.js +16 -16
- package/dist/es/packages/popover/style/style.harmony.css +38 -17
- package/dist/es/packages/popup/popup.js +200 -115
- package/dist/es/packages/popup/style/popup.scss +22 -1
- package/dist/es/packages/popup/style/style.css +38 -17
- package/dist/es/packages/popup/style/style.harmony.css +38 -17
- package/dist/es/packages/popup/style-jmapp/popup.scss +22 -1
- package/dist/es/packages/popup/style-jmapp/style.css +22 -1
- package/dist/es/packages/popup/style-jrkf/popup.scss +22 -1
- package/dist/es/packages/popup/style-jrkf/style.css +22 -1
- package/dist/es/packages/price/price.js +60 -21
- package/dist/es/packages/progress/progress.js +17 -22
- package/dist/es/packages/pulltorefresh/pulltorefresh.js +8 -8
- package/dist/es/packages/quickenter/index.d.ts +3 -0
- package/dist/es/packages/quickenter/index.js +2 -0
- package/dist/es/packages/quickenter/quickenter.d.ts +4 -0
- package/dist/es/packages/quickenter/quickenter.js +141 -0
- package/dist/es/packages/quickenter/style/css.js +2 -0
- package/dist/es/packages/quickenter/style/index.js +2 -0
- package/dist/es/packages/quickenter/style/quickenter.scss +120 -0
- package/dist/es/packages/quickenter/style/style.css +106 -0
- package/dist/es/packages/quickenter/style/style.harmony.css +506 -0
- package/dist/es/packages/quickenter/style-jmapp/css.js +2 -0
- package/dist/es/packages/quickenter/style-jmapp/index.js +2 -0
- package/dist/es/packages/quickenter/style-jmapp/quickenter.scss +120 -0
- package/dist/es/packages/quickenter/style-jmapp/style.css +106 -0
- package/dist/es/packages/quickenter/style-jrkf/css.js +2 -0
- package/dist/es/packages/quickenter/style-jrkf/index.js +2 -0
- package/dist/es/packages/quickenter/style-jrkf/quickenter.scss +120 -0
- package/dist/es/packages/quickenter/style-jrkf/style.css +106 -0
- package/dist/es/packages/radio/radio.js +11 -11
- package/dist/es/packages/radiogroup/radiogroup.js +6 -6
- package/dist/es/packages/range/range.js +44 -19
- package/dist/es/packages/rate/rate.js +16 -19
- package/dist/es/packages/resultpage/resultpage.js +3 -2
- package/dist/es/packages/resultpage/style/style.harmony.css +0 -3
- package/dist/es/packages/row/row.js +4 -4
- package/dist/es/packages/safearea/safearea.js +4 -13
- package/dist/es/packages/safearea/style/safearea.scss +0 -6
- package/dist/es/packages/safearea/style/style.css +0 -2
- package/dist/es/packages/safearea/style/style.harmony.css +0 -2
- package/dist/es/packages/safearea/style-jmapp/safearea.scss +0 -6
- package/dist/es/packages/safearea/style-jmapp/style.css +0 -2
- package/dist/es/packages/safearea/style-jrkf/safearea.scss +0 -6
- package/dist/es/packages/safearea/style-jrkf/style.css +0 -2
- package/dist/es/packages/searchbar/searchbar.js +27 -13
- package/dist/es/packages/segmented/segmented.js +4 -4
- package/dist/es/packages/shortpassword/shortpassword.js +7 -7
- package/dist/es/packages/shortpassword/style/style.harmony.css +38 -17
- package/dist/es/packages/sidebar/sidebar.js +11 -11
- package/dist/es/packages/sidebar/utils.js +1 -1
- package/dist/es/packages/sidebaritem/sidebaritem.js +1 -1
- package/dist/es/packages/signature/signature.js +15 -15
- package/dist/es/packages/skeleton/skeleton.js +4 -4
- package/dist/es/packages/space/space.js +1 -1
- package/dist/es/packages/step/step.js +4 -9
- package/dist/es/packages/step/style/step.scss +0 -2
- package/dist/es/packages/step/style/style.css +0 -2
- package/dist/es/packages/step/style/style.harmony.css +0 -2
- package/dist/es/packages/step/style-jmapp/step.scss +0 -2
- package/dist/es/packages/step/style-jmapp/style.css +0 -2
- package/dist/es/packages/step/style-jrkf/step.scss +0 -2
- package/dist/es/packages/step/style-jrkf/style.css +0 -2
- package/dist/es/packages/steps/steps.js +1 -1
- package/dist/es/packages/steps/style/steps.scss +10 -3
- package/dist/es/packages/steps/style/style.css +13 -7
- package/dist/es/packages/steps/style/style.harmony.css +13 -9
- package/dist/es/packages/steps/style-jmapp/steps.scss +10 -3
- package/dist/es/packages/steps/style-jmapp/style.css +9 -3
- package/dist/es/packages/steps/style-jrkf/steps.scss +10 -3
- package/dist/es/packages/steps/style-jrkf/style.css +9 -3
- package/dist/es/packages/sticky/sticky.js +5 -5
- package/dist/es/packages/swipe/swipe.js +98 -129
- package/dist/es/packages/swiper/swiper.js +7 -7
- package/dist/es/packages/swiperitem/swiperitem.js +1 -1
- package/dist/es/packages/switch/switch.js +6 -6
- package/dist/es/packages/tabbar/tabbar.js +2 -2
- package/dist/es/packages/tabbaritem/tabbaritem.js +10 -10
- package/dist/es/packages/table/style/style.css +1 -1
- package/dist/es/packages/table/style/style.harmony.css +1 -1
- package/dist/es/packages/table/style/table.scss +1 -1
- package/dist/es/packages/table/style-jmapp/style.css +1 -1
- package/dist/es/packages/table/style-jmapp/table.scss +1 -1
- package/dist/es/packages/table/style-jrkf/style.css +1 -1
- package/dist/es/packages/table/style-jrkf/table.scss +1 -1
- package/dist/es/packages/table/table.js +10 -10
- package/dist/es/packages/tabpane/tabpane.js +1 -1
- package/dist/es/packages/tabs/tabs.js +23 -16
- package/dist/es/packages/tag/style/style.css +1 -1
- package/dist/es/packages/tag/style/style.harmony.css +1 -1
- package/dist/es/packages/tag/style/tag.scss +1 -1
- package/dist/es/packages/tag/style-jmapp/style.css +1 -1
- package/dist/es/packages/tag/style-jmapp/tag.scss +1 -1
- package/dist/es/packages/tag/style-jrkf/style.css +1 -1
- package/dist/es/packages/tag/style-jrkf/tag.scss +1 -1
- package/dist/es/packages/tag/tag.js +10 -10
- package/dist/es/packages/textarea/textarea.js +11 -11
- package/dist/es/packages/timedetail/timedetail.js +3 -3
- package/dist/es/packages/timeselect/style/style.harmony.css +38 -17
- package/dist/es/packages/timeselect/timeselect.js +6 -6
- package/dist/es/packages/toast/style/style.css +2 -4
- package/dist/es/packages/toast/style/style.harmony.css +2 -4
- package/dist/es/packages/toast/style/toast.scss +2 -4
- package/dist/es/packages/toast/style-jmapp/style.css +2 -4
- package/dist/es/packages/toast/style-jmapp/toast.scss +2 -4
- package/dist/es/packages/toast/style-jrkf/style.css +2 -4
- package/dist/es/packages/toast/style-jrkf/toast.scss +2 -4
- package/dist/es/packages/toast/toast.js +11 -11
- package/dist/es/packages/tour/style/style.harmony.css +38 -17
- package/dist/es/packages/tour/tour.js +10 -10
- package/dist/es/packages/trendarrow/trendarrow.js +4 -4
- package/dist/es/packages/uploader/preview.js +8 -8
- package/dist/es/packages/uploader/uploader.js +19 -19
- package/dist/es/packages/video/video.js +3 -3
- package/dist/es/packages/virtuallist/utils.js +5 -5
- package/dist/es/packages/virtuallist/virtuallist.js +8 -8
- package/dist/es/packages/watermark/watermark.js +2 -2
- package/dist/es/types/index.d.ts +3 -0
- package/dist/es/types/index.js +3 -0
- package/dist/es/types/spec/button/base.d.ts +2 -1
- package/dist/es/types/spec/button/taro.d.ts +5 -1
- package/dist/es/types/spec/calendarcard/base.d.ts +2 -0
- package/dist/es/types/spec/dialog/base.d.ts +3 -8
- package/dist/es/types/spec/dialog/h5.d.ts +2 -0
- package/dist/es/types/spec/dialog/taro.d.ts +2 -0
- package/dist/es/types/spec/overlay/base.d.ts +1 -0
- package/dist/es/types/spec/popup/base.d.ts +4 -5
- package/dist/es/types/spec/price/base.d.ts +4 -0
- package/dist/es/types/spec/quickenter/base.d.ts +45 -0
- package/dist/es/types/spec/quickenter/base.js +1 -0
- package/dist/es/types/spec/quickenter/h5.d.ts +5 -0
- package/dist/es/types/spec/quickenter/h5.js +1 -0
- package/dist/es/types/spec/quickenter/taro.d.ts +5 -0
- package/dist/es/types/spec/quickenter/taro.js +1 -0
- package/dist/es/utils/clamp.js +1 -1
- package/dist/es/utils/date.js +3 -3
- package/dist/es/utils/get-rect.js +1 -1
- package/dist/es/utils/interceptor.js +1 -1
- package/dist/es/utils/is-date.js +1 -1
- package/dist/es/utils/is-empty.js +1 -1
- package/dist/es/utils/is-function.js +1 -1
- package/dist/es/utils/is-object.js +1 -1
- package/dist/es/utils/is-promise.js +1 -1
- package/dist/es/utils/pad-zero.js +1 -1
- package/dist/es/utils/px-check.js +1 -1
- package/dist/es/utils/should-render-price-raw.d.ts +2 -0
- package/dist/es/utils/should-render-price-raw.js +30 -0
- package/dist/es/utils/sleep.js +1 -1
- package/dist/es/utils/taro/{ConfigurableCSSTransition copy.js → ConfigurableCSSTransition.js} +14 -54
- package/dist/es/utils/taro/get-rect-by-id.js +1 -1
- package/dist/es/utils/taro/get-rect.js +6 -4
- package/dist/es/utils/taro/get-system-info.d.ts +0 -5
- package/dist/es/utils/taro/get-system-info.js +10 -9
- package/dist/es/utils/taro/platform.js +4 -4
- package/dist/es/utils/upper-case-first.js +1 -1
- package/dist/nutui.react.umd.js +11331 -10903
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +36 -35
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +32 -31
- package/dist/style.css +1 -1
- package/dist/style.scss +33 -32
- package/dist/styles/jd-font.scss +2 -2
- package/dist/styles/theme-dark.scss +1 -2
- package/dist/styles/themes/daojia.css +1 -1
- package/dist/styles/themes/dark-daojia.css +1 -1
- package/dist/styles/themes/dark.css +1 -1
- package/dist/styles/themes/default.css +1 -1
- package/dist/styles/variables-daojia.scss +41 -0
- package/dist/styles/variables-jmapp.scss +41 -0
- package/dist/styles/variables-jrkf.scss +41 -0
- package/dist/styles/variables.scss +49 -4
- package/package.json +1 -1
- package/dist/cjs/locales/vi-VN.d.ts +0 -3
- package/dist/cjs/locales/vi-VN.js +0 -170
- package/dist/es/locales/vi-VN.d.ts +0 -3
- package/dist/es/locales/vi-VN.js +0 -160
- /package/dist/cjs/utils/taro/{ConfigurableCSSTransition copy.d.ts → ConfigurableCSSTransition.d.ts} +0 -0
- /package/dist/es/utils/taro/{ConfigurableCSSTransition copy.d.ts → ConfigurableCSSTransition.d.ts} +0 -0
|
@@ -4,13 +4,13 @@ import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
|
4
4
|
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
5
5
|
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
6
6
|
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
|
|
7
|
-
import React, { useState, useEffect, useRef } from "react";
|
|
7
|
+
import React, { useState, useEffect, useRef, useMemo, useCallback } from "react";
|
|
8
8
|
import { nextTick } from "@tarojs/taro";
|
|
9
9
|
import { createPortal } from "react-dom";
|
|
10
|
-
import { CSSTransition } from "react-transition-group";
|
|
11
10
|
import classNames from "classnames";
|
|
12
11
|
import { Close } from "@nutui/icons-react-taro";
|
|
13
12
|
import { View } from "@tarojs/components";
|
|
13
|
+
import ConfigurableCSSTransition from "../../utils/taro/ConfigurableCSSTransition";
|
|
14
14
|
import { getRectInMultiPlatformWithoutCache } from "../../utils/taro/get-rect";
|
|
15
15
|
import { defaultOverlayProps } from "../overlay/overlay";
|
|
16
16
|
import Overlay from "../overlay/index";
|
|
@@ -32,70 +32,81 @@ var defaultProps = _object_spread_props(_object_spread({}, defaultOverlayProps),
|
|
|
32
32
|
round: false,
|
|
33
33
|
resizable: false,
|
|
34
34
|
minHeight: '',
|
|
35
|
-
onOpen: function() {},
|
|
36
|
-
onClose: function() {},
|
|
37
|
-
onOverlayClick: function() {
|
|
35
|
+
onOpen: function onOpen() {},
|
|
36
|
+
onClose: function onClose() {},
|
|
37
|
+
onOverlayClick: function onOverlayClick() {
|
|
38
38
|
return true;
|
|
39
39
|
},
|
|
40
|
-
onCloseIconClick: function() {
|
|
40
|
+
onCloseIconClick: function onCloseIconClick() {
|
|
41
41
|
return true;
|
|
42
42
|
},
|
|
43
|
-
onTouchStart: function() {},
|
|
44
|
-
onTouchMove: function() {},
|
|
45
|
-
onTouchEnd: function() {}
|
|
43
|
+
onTouchStart: function onTouchStart() {},
|
|
44
|
+
onTouchMove: function onTouchMove() {},
|
|
45
|
+
onTouchEnd: function onTouchEnd() {},
|
|
46
|
+
overlayProps: {},
|
|
47
|
+
animated: true
|
|
46
48
|
});
|
|
47
49
|
// 默认1000,参看variables
|
|
48
50
|
var _zIndex = 1100;
|
|
49
|
-
export var Popup = function(props) {
|
|
50
|
-
var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, visible = _$_object_spread.visible, overlay = _$_object_spread.overlay, closeOnOverlayClick = _$_object_spread.closeOnOverlayClick, overlayStyle = _$_object_spread.overlayStyle, overlayClassName = _$_object_spread.overlayClassName, zIndex = _$_object_spread.zIndex, lockScroll = _$_object_spread.lockScroll, duration = _$_object_spread.duration, closeable = _$_object_spread.closeable, closeIconPosition = _$_object_spread.closeIconPosition, closeIcon = _$_object_spread.closeIcon, left = _$_object_spread.left, title = _$_object_spread.title, top = _$_object_spread.top, description = _$_object_spread.description, style = _$_object_spread.style, transition = _$_object_spread.transition, round = _$_object_spread.round, position = _$_object_spread.position, className = _$_object_spread.className, destroyOnClose = _$_object_spread.destroyOnClose, portal = _$_object_spread.portal, resizable = _$_object_spread.resizable, minHeight = _$_object_spread.minHeight, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onOverlayClick = _$_object_spread.onOverlayClick, onCloseIconClick = _$_object_spread.onCloseIconClick, afterShow = _$_object_spread.afterShow, afterClose = _$_object_spread.afterClose, onClick = _$_object_spread.onClick, onTouchStart = _$_object_spread.onTouchStart, onTouchMove = _$_object_spread.onTouchMove, onTouchEnd = _$_object_spread.onTouchEnd, closeAriaLabel = _$_object_spread.closeAriaLabel;
|
|
51
|
-
var
|
|
52
|
-
var
|
|
51
|
+
export var Popup = function Popup(props) {
|
|
52
|
+
var _$_object_spread = _object_spread({}, defaultProps, props), children = _$_object_spread.children, visible = _$_object_spread.visible, overlay = _$_object_spread.overlay, closeOnOverlayClick = _$_object_spread.closeOnOverlayClick, overlayStyle = _$_object_spread.overlayStyle, overlayClassName = _$_object_spread.overlayClassName, zIndex = _$_object_spread.zIndex, lockScroll = _$_object_spread.lockScroll, duration = _$_object_spread.duration, closeable = _$_object_spread.closeable, closeIconPosition = _$_object_spread.closeIconPosition, closeIcon = _$_object_spread.closeIcon, left = _$_object_spread.left, title = _$_object_spread.title, top = _$_object_spread.top, description = _$_object_spread.description, style = _$_object_spread.style, transition = _$_object_spread.transition, round = _$_object_spread.round, position = _$_object_spread.position, className = _$_object_spread.className, destroyOnClose = _$_object_spread.destroyOnClose, portal = _$_object_spread.portal, resizable = _$_object_spread.resizable, minHeight = _$_object_spread.minHeight, onOpen = _$_object_spread.onOpen, onClose = _$_object_spread.onClose, onOverlayClick = _$_object_spread.onOverlayClick, onCloseIconClick = _$_object_spread.onCloseIconClick, afterShow = _$_object_spread.afterShow, afterClose = _$_object_spread.afterClose, onClick = _$_object_spread.onClick, onTouchStart = _$_object_spread.onTouchStart, onTouchMove = _$_object_spread.onTouchMove, onTouchEnd = _$_object_spread.onTouchEnd, closeAriaLabel = _$_object_spread.closeAriaLabel, overlayProps = _$_object_spread.overlayProps, animated = _$_object_spread.animated;
|
|
53
|
+
var locale = useConfig().locale;
|
|
54
|
+
var transitionDuration = useMemo(function() {
|
|
55
|
+
return animated ? Number(duration) : 0;
|
|
56
|
+
}, [
|
|
57
|
+
animated,
|
|
58
|
+
duration
|
|
59
|
+
]);
|
|
60
|
+
var _useState = _sliced_to_array(useState(zIndex || _zIndex), 2), index = _useState[0], setIndex = _useState[1];
|
|
53
61
|
var _useState1 = _sliced_to_array(useState(visible), 2), innerVisible = _useState1[0], setInnerVisible = _useState1[1];
|
|
54
62
|
var _useState2 = _sliced_to_array(useState(true), 2), showChildren = _useState2[0], setShowChildren = _useState2[1];
|
|
55
|
-
var _useState3 = _sliced_to_array(useState(''), 2), transitionName = _useState3[0], setTransitionName = _useState3[1];
|
|
56
63
|
var nodeRef = useLockScrollTaro(innerVisible && lockScroll);
|
|
57
|
-
var topNodeRef =
|
|
64
|
+
var topNodeRef = useRef(null);
|
|
58
65
|
var rootRect = useRef(null);
|
|
59
66
|
var touchStartRef = useRef(0);
|
|
60
67
|
var touchMoveDistanceRef = useRef(0);
|
|
61
68
|
var heightRef = useRef(0);
|
|
62
69
|
var defaultHeightRef = useRef(0);
|
|
63
70
|
var isTouching = useRef(false);
|
|
64
|
-
var locale = useConfig().locale;
|
|
65
71
|
var classPrefix = 'nut-popup';
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
72
|
+
var transitionName = useMemo(function() {
|
|
73
|
+
return transition || "".concat(classPrefix, "-slide-").concat(position);
|
|
74
|
+
}, [
|
|
75
|
+
transition,
|
|
76
|
+
position
|
|
77
|
+
]);
|
|
78
|
+
var overlayStyles = useMemo(function() {
|
|
79
|
+
return _object_spread({}, overlayStyle);
|
|
80
|
+
}, [
|
|
81
|
+
overlayStyle
|
|
82
|
+
]);
|
|
83
|
+
var contentZIndex = useMemo(function() {
|
|
84
|
+
return harmony() ? index + 1 : index // 解决harmony层级问题
|
|
85
|
+
;
|
|
86
|
+
}, [
|
|
87
|
+
index
|
|
88
|
+
]);
|
|
89
|
+
var popStyles = useMemo(function() {
|
|
90
|
+
return _object_spread({
|
|
91
|
+
zIndex: contentZIndex,
|
|
92
|
+
minHeight: minHeight
|
|
93
|
+
}, style);
|
|
94
|
+
}, [
|
|
95
|
+
contentZIndex,
|
|
96
|
+
minHeight,
|
|
97
|
+
style
|
|
98
|
+
]);
|
|
99
|
+
var popClassName = useMemo(function() {
|
|
100
|
+
var _obj;
|
|
101
|
+
return classNames(classPrefix, (_obj = {}, _define_property(_obj, "".concat(classPrefix, "-round"), round || position === 'bottom'), _define_property(_obj, "".concat(classPrefix, "-").concat(position), true), _obj), className);
|
|
102
|
+
}, [
|
|
103
|
+
round,
|
|
104
|
+
position,
|
|
105
|
+
className
|
|
106
|
+
]);
|
|
107
|
+
var _useState3 = _sliced_to_array(useState(''), 2), popupHeight = _useState3[0], setPopupHeight = _useState3[1];
|
|
108
|
+
var _useState4 = _sliced_to_array(useState(''), 2), topBottom = _useState4[0], setTopBottom = _useState4[1];
|
|
109
|
+
var getPopupHeight = useCallback(function() {
|
|
99
110
|
return _async_to_generator(function() {
|
|
100
111
|
var _nodeRef_current, rect, height;
|
|
101
112
|
return _ts_generator(this, function(_state) {
|
|
@@ -115,48 +126,109 @@ export var Popup = function(props) {
|
|
|
115
126
|
}
|
|
116
127
|
});
|
|
117
128
|
})();
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
}, [
|
|
130
|
+
nodeRef
|
|
131
|
+
]);
|
|
132
|
+
var open = useCallback(function() {
|
|
133
|
+
if (!innerVisible) {
|
|
134
|
+
// 当高度改变后,再次打开时,将高度置为初始高度
|
|
135
|
+
if (position === 'bottom' && resizable && nodeRef.current && heightRef.current) {
|
|
136
|
+
setPopupHeight(pxTransform(defaultHeightRef.current));
|
|
137
|
+
}
|
|
138
|
+
setInnerVisible(true);
|
|
139
|
+
setIndex(function(prev) {
|
|
140
|
+
return prev + 1;
|
|
125
141
|
});
|
|
126
142
|
}
|
|
143
|
+
if (destroyOnClose) {
|
|
144
|
+
setShowChildren(true);
|
|
145
|
+
}
|
|
146
|
+
onOpen === null || onOpen === void 0 ? void 0 : onOpen();
|
|
127
147
|
}, [
|
|
128
|
-
innerVisible
|
|
148
|
+
innerVisible,
|
|
149
|
+
position,
|
|
150
|
+
resizable,
|
|
151
|
+
destroyOnClose,
|
|
152
|
+
onOpen,
|
|
153
|
+
nodeRef,
|
|
154
|
+
setInnerVisible,
|
|
155
|
+
setIndex,
|
|
156
|
+
setShowChildren
|
|
129
157
|
]);
|
|
130
|
-
var close = function() {
|
|
158
|
+
var close = useCallback(function() {
|
|
131
159
|
if (innerVisible) {
|
|
132
160
|
setInnerVisible(false);
|
|
133
161
|
if (destroyOnClose) {
|
|
134
162
|
setTimeout(function() {
|
|
135
163
|
setShowChildren(false);
|
|
136
|
-
},
|
|
164
|
+
}, transitionDuration);
|
|
137
165
|
}
|
|
138
|
-
onClose
|
|
166
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
139
167
|
}
|
|
140
|
-
}
|
|
141
|
-
|
|
168
|
+
}, [
|
|
169
|
+
innerVisible,
|
|
170
|
+
destroyOnClose,
|
|
171
|
+
transitionDuration,
|
|
172
|
+
onClose,
|
|
173
|
+
setInnerVisible,
|
|
174
|
+
setShowChildren
|
|
175
|
+
]);
|
|
176
|
+
useEffect(function() {
|
|
177
|
+
visible ? open() : close();
|
|
178
|
+
}, [
|
|
179
|
+
visible,
|
|
180
|
+
open,
|
|
181
|
+
close
|
|
182
|
+
]);
|
|
183
|
+
useEffect(function() {
|
|
184
|
+
if (innerVisible && topNodeRef.current && nodeRef.current) {
|
|
185
|
+
nextTick(function() {
|
|
186
|
+
nextTick(function() {
|
|
187
|
+
getPopupHeight();
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}, [
|
|
192
|
+
innerVisible,
|
|
193
|
+
getPopupHeight,
|
|
194
|
+
nodeRef
|
|
195
|
+
]);
|
|
196
|
+
var handleOverlayClick = useCallback(function(e) {
|
|
142
197
|
e.stopPropagation();
|
|
143
198
|
if (closeOnOverlayClick && onOverlayClick(e)) {
|
|
144
199
|
close();
|
|
145
200
|
}
|
|
146
|
-
}
|
|
147
|
-
|
|
201
|
+
}, [
|
|
202
|
+
closeOnOverlayClick,
|
|
203
|
+
onOverlayClick,
|
|
204
|
+
close
|
|
205
|
+
]);
|
|
206
|
+
var handleCloseIconClick = useCallback(function(e) {
|
|
148
207
|
onCloseIconClick(e) && close();
|
|
149
|
-
}
|
|
150
|
-
|
|
208
|
+
}, [
|
|
209
|
+
onCloseIconClick,
|
|
210
|
+
close
|
|
211
|
+
]);
|
|
212
|
+
var renderCloseIcon = useCallback(function() {
|
|
213
|
+
if (!closeable) return null;
|
|
151
214
|
var closeClasses = classNames("".concat(classPrefix, "-title-right"), "".concat(classPrefix, "-title-right-").concat(closeIconPosition));
|
|
152
|
-
return /*#__PURE__*/ React.createElement(
|
|
215
|
+
return /*#__PURE__*/ React.createElement(View, {
|
|
153
216
|
className: closeClasses,
|
|
154
217
|
onClick: handleCloseIconClick,
|
|
155
218
|
ariaRole: "button",
|
|
156
219
|
ariaLabel: closeAriaLabel || locale.close
|
|
157
|
-
}, /*#__PURE__*/ React.isValidElement(closeIcon) ? closeIcon : /*#__PURE__*/ React.createElement(Close,
|
|
158
|
-
|
|
159
|
-
|
|
220
|
+
}, /*#__PURE__*/ React.isValidElement(closeIcon) ? closeIcon : /*#__PURE__*/ React.createElement(Close, {
|
|
221
|
+
ariaHidden: true
|
|
222
|
+
}));
|
|
223
|
+
}, [
|
|
224
|
+
closeable,
|
|
225
|
+
closeIconPosition,
|
|
226
|
+
handleCloseIconClick,
|
|
227
|
+
closeAriaLabel,
|
|
228
|
+
locale.close,
|
|
229
|
+
closeIcon
|
|
230
|
+
]);
|
|
231
|
+
var renderTop = useCallback(function() {
|
|
160
232
|
if (!top) return null;
|
|
161
233
|
return /*#__PURE__*/ React.createElement(View, {
|
|
162
234
|
className: "".concat(classPrefix, "-bottom-top"),
|
|
@@ -165,8 +237,11 @@ export var Popup = function(props) {
|
|
|
165
237
|
bottom: topBottom
|
|
166
238
|
}
|
|
167
239
|
}, top);
|
|
168
|
-
}
|
|
169
|
-
|
|
240
|
+
}, [
|
|
241
|
+
top,
|
|
242
|
+
topBottom
|
|
243
|
+
]);
|
|
244
|
+
var renderTitle = useCallback(function() {
|
|
170
245
|
if (left || title || description) {
|
|
171
246
|
return /*#__PURE__*/ React.createElement(View, {
|
|
172
247
|
className: "".concat(classPrefix, "-title")
|
|
@@ -183,8 +258,15 @@ export var Popup = function(props) {
|
|
|
183
258
|
if (closeable) {
|
|
184
259
|
return renderCloseIcon();
|
|
185
260
|
}
|
|
186
|
-
}
|
|
187
|
-
|
|
261
|
+
}, [
|
|
262
|
+
left,
|
|
263
|
+
title,
|
|
264
|
+
description,
|
|
265
|
+
position,
|
|
266
|
+
closeable,
|
|
267
|
+
renderCloseIcon
|
|
268
|
+
]);
|
|
269
|
+
var handleTouchStart = useCallback(function(event) {
|
|
188
270
|
return _async_to_generator(function() {
|
|
189
271
|
var _nodeRef_current, _rootRect_current, e, rect;
|
|
190
272
|
return _ts_generator(this, function(_state) {
|
|
@@ -214,14 +296,19 @@ export var Popup = function(props) {
|
|
|
214
296
|
}
|
|
215
297
|
});
|
|
216
298
|
})();
|
|
217
|
-
}
|
|
218
|
-
|
|
299
|
+
}, [
|
|
300
|
+
position,
|
|
301
|
+
resizable,
|
|
302
|
+
onTouchStart,
|
|
303
|
+
nodeRef
|
|
304
|
+
]);
|
|
305
|
+
var handleTouchMove = useCallback(function(event) {
|
|
219
306
|
if (position !== 'bottom' || !resizable || !nodeRef.current || !rootRect.current) return;
|
|
220
307
|
var e = event;
|
|
221
308
|
e.stopPropagation();
|
|
222
309
|
// 计算位移:move过程中,当前的pageY 与 start值比较
|
|
223
310
|
touchMoveDistanceRef.current = e.touches[0].pageY - touchStartRef.current;
|
|
224
|
-
var handleMove = function() {
|
|
311
|
+
var handleMove = function handleMove() {
|
|
225
312
|
var min = typeof minHeight === 'number' ? minHeight : parseInt(String(minHeight || 0), 10) || 0;
|
|
226
313
|
var currentHeight = Math.max(min, heightRef.current - touchMoveDistanceRef.current);
|
|
227
314
|
setPopupHeight(pxTransform(currentHeight));
|
|
@@ -234,21 +321,42 @@ export var Popup = function(props) {
|
|
|
234
321
|
}
|
|
235
322
|
};
|
|
236
323
|
requestAnimationFrame(handleMove);
|
|
237
|
-
}
|
|
238
|
-
|
|
324
|
+
}, [
|
|
325
|
+
position,
|
|
326
|
+
resizable,
|
|
327
|
+
minHeight,
|
|
328
|
+
onTouchMove,
|
|
329
|
+
nodeRef
|
|
330
|
+
]);
|
|
331
|
+
var handleTouchEnd = useCallback(function(event) {
|
|
239
332
|
if (position !== 'bottom' || !resizable || !nodeRef.current || !rootRect.current) return;
|
|
240
333
|
var e = event;
|
|
241
334
|
isTouching.current = false;
|
|
242
335
|
var min = typeof minHeight === 'number' ? minHeight : parseInt(String(minHeight || 0), 10) || 0;
|
|
243
336
|
var currentHeight = Math.max(min, heightRef.current - touchMoveDistanceRef.current);
|
|
244
337
|
onTouchEnd === null || onTouchEnd === void 0 ? void 0 : onTouchEnd(currentHeight, e);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
|
|
338
|
+
}, [
|
|
339
|
+
position,
|
|
340
|
+
resizable,
|
|
341
|
+
minHeight,
|
|
342
|
+
onTouchEnd,
|
|
343
|
+
nodeRef
|
|
344
|
+
]);
|
|
345
|
+
var renderPop = function renderPop() {
|
|
346
|
+
return /*#__PURE__*/ React.createElement(ConfigurableCSSTransition, {
|
|
347
|
+
nodeRef: nodeRef,
|
|
348
|
+
classNames: transitionName,
|
|
349
|
+
mountOnEnter: true,
|
|
350
|
+
unmountOnExit: destroyOnClose,
|
|
351
|
+
timeout: Number(transitionDuration),
|
|
352
|
+
in: innerVisible,
|
|
353
|
+
onEntered: afterShow,
|
|
354
|
+
onExited: afterClose
|
|
355
|
+
}, /*#__PURE__*/ React.createElement(View, {
|
|
248
356
|
ref: nodeRef,
|
|
249
|
-
style: _object_spread(
|
|
250
|
-
|
|
251
|
-
}
|
|
357
|
+
style: _object_spread({}, popStyles, popupHeight ? {
|
|
358
|
+
height: popupHeight
|
|
359
|
+
} : {}),
|
|
252
360
|
className: popClassName,
|
|
253
361
|
onClick: onClick,
|
|
254
362
|
catchMove: lockScroll,
|
|
@@ -256,47 +364,24 @@ export var Popup = function(props) {
|
|
|
256
364
|
onTouchMove: handleTouchMove,
|
|
257
365
|
onTouchEnd: handleTouchEnd,
|
|
258
366
|
onTouchCancel: handleTouchEnd
|
|
259
|
-
}, renderTop(), renderTitle(), showChildren ? children : null);
|
|
367
|
+
}, renderTop(), renderTitle(), showChildren ? children : null));
|
|
260
368
|
};
|
|
261
|
-
var
|
|
262
|
-
return /*#__PURE__*/ React.createElement(
|
|
263
|
-
nodeRef: nodeRef,
|
|
264
|
-
classNames: transitionName,
|
|
265
|
-
mountOnEnter: true,
|
|
266
|
-
unmountOnExit: destroyOnClose,
|
|
267
|
-
timeout: duration,
|
|
268
|
-
in: innerVisible,
|
|
269
|
-
onEntered: afterShow,
|
|
270
|
-
onExited: afterClose
|
|
271
|
-
}, renderContent());
|
|
272
|
-
};
|
|
273
|
-
var renderNode = function() {
|
|
274
|
-
return /*#__PURE__*/ React.createElement(React.Fragment, null, overlay ? /*#__PURE__*/ React.createElement(Overlay, {
|
|
369
|
+
var renderNode = function renderNode() {
|
|
370
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, overlay ? /*#__PURE__*/ React.createElement(Overlay, _object_spread({
|
|
275
371
|
zIndex: index,
|
|
276
372
|
style: overlayStyles,
|
|
277
373
|
className: overlayClassName,
|
|
278
374
|
visible: innerVisible,
|
|
279
375
|
closeOnOverlayClick: closeOnOverlayClick,
|
|
280
376
|
lockScroll: lockScroll,
|
|
281
|
-
duration:
|
|
377
|
+
duration: transitionDuration,
|
|
282
378
|
onClick: handleOverlayClick
|
|
283
|
-
}) : null, renderPop());
|
|
379
|
+
}, overlayProps)) : null, renderPop());
|
|
284
380
|
};
|
|
285
|
-
|
|
286
|
-
visible ? open() : close();
|
|
287
|
-
}, [
|
|
288
|
-
visible
|
|
289
|
-
]);
|
|
290
|
-
useEffect(function() {
|
|
291
|
-
setTransitionName(transition || "".concat(classPrefix, "-slide-").concat(position));
|
|
292
|
-
}, [
|
|
293
|
-
position,
|
|
294
|
-
transition
|
|
295
|
-
]);
|
|
296
|
-
var resolveContainer = function(getContainer) {
|
|
381
|
+
var resolveContainer = function resolveContainer(getContainer) {
|
|
297
382
|
return (typeof getContainer === 'function' ? getContainer() : getContainer) || document.body;
|
|
298
383
|
};
|
|
299
|
-
var renderToContainer = function(getContainer, node) {
|
|
384
|
+
var renderToContainer = function renderToContainer(getContainer, node) {
|
|
300
385
|
if (getContainer) {
|
|
301
386
|
var container = resolveContainer(getContainer);
|
|
302
387
|
return /*#__PURE__*/ createPortal(node, container);
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
color: $color-title;
|
|
27
27
|
font-weight: $font-weight-bold;
|
|
28
28
|
font-size: $popup-title-font-size;
|
|
29
|
-
line-height: $popup-title-font-size;
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
&-description {
|
|
@@ -79,6 +78,8 @@
|
|
|
79
78
|
&-center {
|
|
80
79
|
top: 50%;
|
|
81
80
|
left: 50%;
|
|
81
|
+
right: auto;
|
|
82
|
+
bottom: auto;
|
|
82
83
|
min-height: 10%;
|
|
83
84
|
max-width: 295px;
|
|
84
85
|
transform: translate(-50%, -50%);
|
|
@@ -91,6 +92,8 @@
|
|
|
91
92
|
&-bottom {
|
|
92
93
|
bottom: 0;
|
|
93
94
|
left: 0;
|
|
95
|
+
right: auto;
|
|
96
|
+
top: auto;
|
|
94
97
|
width: 100%;
|
|
95
98
|
|
|
96
99
|
&.nut-popup-round {
|
|
@@ -105,6 +108,8 @@
|
|
|
105
108
|
&-right {
|
|
106
109
|
top: 0;
|
|
107
110
|
right: 0;
|
|
111
|
+
left: auto;
|
|
112
|
+
bottom: auto;
|
|
108
113
|
width: 100px;
|
|
109
114
|
height: 100%;
|
|
110
115
|
|
|
@@ -116,6 +121,8 @@
|
|
|
116
121
|
&-left {
|
|
117
122
|
top: 0;
|
|
118
123
|
left: 0;
|
|
124
|
+
right: auto;
|
|
125
|
+
bottom: auto;
|
|
119
126
|
width: 100px;
|
|
120
127
|
height: 100%;
|
|
121
128
|
|
|
@@ -127,6 +134,8 @@
|
|
|
127
134
|
&-top {
|
|
128
135
|
top: 0;
|
|
129
136
|
left: 0;
|
|
137
|
+
right: auto;
|
|
138
|
+
bottom: auto;
|
|
130
139
|
width: 100%;
|
|
131
140
|
|
|
132
141
|
&.nut-popup-round {
|
|
@@ -210,6 +219,9 @@
|
|
|
210
219
|
}
|
|
211
220
|
|
|
212
221
|
@keyframes popup-slide-top-exit {
|
|
222
|
+
from {
|
|
223
|
+
transform: translate3d(0, 0%, 0);
|
|
224
|
+
}
|
|
213
225
|
to {
|
|
214
226
|
transform: translate3d(0, -100%, 0);
|
|
215
227
|
}
|
|
@@ -240,6 +252,9 @@
|
|
|
240
252
|
}
|
|
241
253
|
|
|
242
254
|
@keyframes popup-slide-right-exit {
|
|
255
|
+
from {
|
|
256
|
+
transform: translate3d(0%, 0, 0);
|
|
257
|
+
}
|
|
243
258
|
to {
|
|
244
259
|
transform: translate3d(100%, 0, 0);
|
|
245
260
|
}
|
|
@@ -270,6 +285,9 @@
|
|
|
270
285
|
}
|
|
271
286
|
|
|
272
287
|
@keyframes slide-bottom-exit {
|
|
288
|
+
from {
|
|
289
|
+
transform: translate3d(0, 0%, 0);
|
|
290
|
+
}
|
|
273
291
|
to {
|
|
274
292
|
transform: translate3d(0, 100%, 0);
|
|
275
293
|
}
|
|
@@ -300,6 +318,9 @@
|
|
|
300
318
|
}
|
|
301
319
|
|
|
302
320
|
@keyframes popup-slide-left-exit {
|
|
321
|
+
from {
|
|
322
|
+
transform: translate3d(0%, 0, 0);
|
|
323
|
+
}
|
|
303
324
|
to {
|
|
304
325
|
transform: translate3d(-100%, 0, 0);
|
|
305
326
|
}
|