@nutui/nutui-react-taro 3.0.20-beta.0 → 3.0.20-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 +28 -70
- package/dist/cjs/hooks/taro/use-custom-event.js +5 -5
- package/dist/cjs/hooks/use-ref-state.js +3 -3
- package/dist/cjs/hooks/use-touch.js +1 -2
- 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/style/style.harmony.css +38 -17
- package/dist/cjs/packages/address/utils.js +3 -3
- package/dist/cjs/packages/animatingnumbers/countup.js +3 -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 +18 -34
- package/dist/cjs/packages/badge/badge.js +20 -10
- package/dist/cjs/packages/barrage/barrage.js +14 -24
- 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/calendar/utils.js +8 -8
- package/dist/cjs/packages/calendarcard/calendarcard.js +30 -8
- package/dist/cjs/packages/calendarcard/icon.js +17 -28
- 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/calendarcard/utils.js +6 -6
- package/dist/cjs/packages/card/style/style.harmony.css +1 -1
- package/dist/cjs/packages/cascader/cascader.js +12 -21
- package/dist/cjs/packages/cascader/style/style.harmony.css +38 -17
- package/dist/cjs/packages/cascader/utils.js +3 -3
- package/dist/cjs/packages/collapseitem/collapseitem.js +4 -7
- package/dist/cjs/packages/configprovider/configprovider.js +7 -7
- package/dist/cjs/packages/configprovider/index.js +6 -6
- package/dist/cjs/packages/configprovider/types.d.ts +1 -1
- package/dist/cjs/packages/countdown/countdown.js +1 -2
- package/dist/cjs/packages/datepicker/style/style.harmony.css +39 -18
- package/dist/cjs/packages/datepicker/utils.js +9 -9
- package/dist/cjs/packages/dialog/content.js +3 -3
- package/dist/cjs/packages/dialog/dialog.js +26 -23
- 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 +2 -2
- package/dist/cjs/packages/drag/drag.js +4 -7
- package/dist/cjs/packages/elevator/elevator.js +7 -10
- package/dist/cjs/packages/ellipsis/ellipsis.js +17 -30
- 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/index.js +0 -2
- package/dist/cjs/packages/form/style/style.harmony.css +0 -5
- package/dist/cjs/packages/form/useform.js +50 -57
- 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/image/image.js +11 -3
- package/dist/cjs/packages/imagepreview/style/style.harmony.css +38 -17
- package/dist/cjs/packages/infiniteloading/infiniteloading.js +8 -14
- package/dist/cjs/packages/input/input.js +10 -3
- package/dist/cjs/packages/inputnumber/inputnumber.js +17 -29
- package/dist/cjs/packages/lottie/lottiemp.js +10 -18
- package/dist/cjs/packages/lottie/types.js +0 -2
- package/dist/cjs/packages/menuitem/menuitem.js +24 -22
- package/dist/cjs/packages/noticebar/noticebar.js +74 -70
- package/dist/cjs/packages/notify/notify.js +4 -4
- 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 +123 -119
- package/dist/cjs/packages/nutui.react.d.ts +4 -1
- package/dist/cjs/packages/nutui.react.js +124 -119
- 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 +6 -6
- 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 +4 -7
- package/dist/cjs/packages/pickerview/pickerview.js +1 -2
- package/dist/cjs/packages/pickerview/utils.js +3 -3
- package/dist/cjs/packages/popover/popover.js +75 -77
- package/dist/cjs/packages/popover/style/style.harmony.css +38 -17
- package/dist/cjs/packages/popup/popup.js +192 -113
- 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 +2 -4
- package/dist/cjs/packages/pulltorefresh/pulltorefresh.js +52 -56
- 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/index.js +0 -2
- package/dist/cjs/packages/range/range.js +44 -28
- 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 +3 -3
- package/dist/cjs/packages/shortpassword/style/style.harmony.css +38 -17
- 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 +4 -7
- package/dist/cjs/packages/swipe/swipe.js +84 -122
- package/dist/cjs/packages/swiper/index.js +0 -1
- package/dist/cjs/packages/switch/switch.js +4 -7
- 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/tabs/tabs.js +12 -5
- 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/timeselect/style/style.harmony.css +38 -17
- 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 +5 -5
- package/dist/cjs/packages/tour/style/style.harmony.css +38 -17
- package/dist/cjs/packages/uploader/uploader.js +38 -51
- package/dist/cjs/packages/virtuallist/utils.js +6 -6
- package/dist/cjs/packages/watermark/watermark.js +4 -8
- package/dist/cjs/types/index.d.ts +3 -0
- package/dist/cjs/types/index.js +3 -0
- package/dist/cjs/types/spec/address/base.js +0 -2
- 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/date.js +5 -5
- package/dist/cjs/utils/event-mocker.js +10 -18
- package/dist/cjs/utils/get-rect.js +4 -4
- package/dist/cjs/utils/get-scroll-parent.js +3 -3
- package/dist/cjs/utils/merge-props.js +3 -3
- package/dist/cjs/utils/merge.js +6 -6
- package/dist/cjs/utils/raf.js +3 -3
- package/dist/cjs/utils/render.js +5 -9
- package/dist/cjs/utils/rubberband.js +3 -3
- 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.d.ts +15 -0
- package/dist/cjs/utils/taro/ConfigurableCSSTransition.js +90 -0
- package/dist/cjs/utils/taro/get-rect.js +18 -26
- package/dist/cjs/utils/taro/get-system-info.d.ts +0 -5
- package/dist/cjs/utils/taro/get-system-info.js +5 -10
- package/dist/cjs/utils/taro/platform.js +5 -5
- package/dist/es/hooks/taro/use-custom-event.js +1 -0
- package/dist/es/hooks/use-touch.js +1 -1
- package/dist/es/locales/base.d.ts +9 -0
- package/dist/es/locales/en-US.js +21 -2
- package/dist/es/locales/id-ID.js +21 -2
- package/dist/es/locales/ja-JP.js +19 -2
- package/dist/es/locales/tr-TR.js +21 -2
- package/dist/es/locales/zh-CN.js +19 -2
- package/dist/es/locales/zh-TW.js +19 -2
- package/dist/es/locales/zh-UG.js +21 -2
- 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/style/style.harmony.css +38 -17
- package/dist/es/packages/animatingnumbers/countup.js +3 -1
- package/dist/es/packages/audio/style/style.harmony.css +0 -3
- package/dist/es/packages/avatar/avatar.js +32 -6
- package/dist/es/packages/avatarcropper/avatarcropper.js +20 -36
- package/dist/es/packages/badge/badge.js +20 -10
- package/dist/es/packages/barrage/barrage.js +14 -24
- package/dist/es/packages/button/button.d.ts +2 -24
- package/dist/es/packages/button/button.js +10 -12
- 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/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/calendarcard/calendarcard.js +31 -9
- package/dist/es/packages/calendarcard/icon.js +13 -24
- 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/card/style/style.harmony.css +1 -1
- package/dist/es/packages/cascader/cascader.js +12 -21
- package/dist/es/packages/cascader/style/style.harmony.css +38 -17
- package/dist/es/packages/collapseitem/collapseitem.js +4 -7
- package/dist/es/packages/configprovider/types.d.ts +1 -1
- package/dist/es/packages/countdown/countdown.js +1 -2
- package/dist/es/packages/datepicker/style/style.harmony.css +39 -18
- package/dist/es/packages/dialog/dialog.js +33 -28
- 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 +1 -1
- package/dist/es/packages/drag/drag.js +4 -7
- package/dist/es/packages/elevator/elevator.js +4 -7
- package/dist/es/packages/ellipsis/ellipsis.js +17 -30
- package/dist/es/packages/empty/empty.d.ts +4 -4
- package/dist/es/packages/empty/style/style.harmony.css +0 -3
- package/dist/es/packages/form/index.js +0 -1
- package/dist/es/packages/form/style/style.harmony.css +0 -5
- package/dist/es/packages/form/useform.js +46 -53
- 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/image/image.js +11 -3
- package/dist/es/packages/imagepreview/style/style.harmony.css +38 -17
- package/dist/es/packages/infiniteloading/infiniteloading.js +8 -14
- package/dist/es/packages/input/input.js +10 -3
- package/dist/es/packages/inputnumber/inputnumber.js +17 -29
- package/dist/es/packages/lottie/lottiemp.js +12 -20
- package/dist/es/packages/lottie/types.js +1 -1
- package/dist/es/packages/menuitem/menuitem.js +24 -22
- package/dist/es/packages/noticebar/noticebar.js +74 -70
- 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 +3 -3
- 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 +4 -7
- package/dist/es/packages/pickerview/pickerview.js +1 -2
- package/dist/es/packages/popover/popover.js +75 -77
- package/dist/es/packages/popover/style/style.harmony.css +38 -17
- package/dist/es/packages/popup/popup.js +193 -114
- 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 +53 -14
- package/dist/es/packages/progress/progress.js +2 -4
- package/dist/es/packages/pulltorefresh/pulltorefresh.js +52 -56
- 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/index.js +0 -1
- package/dist/es/packages/range/range.js +45 -29
- package/dist/es/packages/rate/rate.js +6 -9
- package/dist/es/packages/resultpage/resultpage.js +2 -1
- package/dist/es/packages/resultpage/style/style.harmony.css +0 -3
- package/dist/es/packages/safearea/safearea.js +3 -12
- 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 +23 -9
- package/dist/es/packages/shortpassword/style/style.harmony.css +38 -17
- package/dist/es/packages/step/step.js +3 -8
- 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/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 +4 -7
- package/dist/es/packages/swipe/swipe.js +85 -123
- package/dist/es/packages/swiper/index.js +0 -1
- package/dist/es/packages/switch/switch.js +4 -7
- 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/tabs/tabs.js +12 -5
- 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/timeselect/style/style.harmony.css +38 -17
- 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 +1 -1
- package/dist/es/packages/tour/style/style.harmony.css +38 -17
- package/dist/es/packages/uploader/uploader.js +38 -51
- package/dist/es/packages/watermark/watermark.js +4 -8
- package/dist/es/types/index.d.ts +3 -0
- package/dist/es/types/index.js +3 -0
- package/dist/es/types/spec/address/base.js +1 -1
- 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/event-mocker.js +4 -12
- package/dist/es/utils/render.js +2 -6
- 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/taro/ConfigurableCSSTransition.d.ts +15 -0
- package/dist/es/utils/taro/ConfigurableCSSTransition.js +79 -0
- package/dist/es/utils/taro/get-rect.js +14 -22
- package/dist/es/utils/taro/get-system-info.d.ts +0 -5
- package/dist/es/utils/taro/get-system-info.js +8 -7
- package/dist/nutui.react.umd.js +8698 -7529
- package/dist/style-jmapp.css +1 -1
- package/dist/style-jmapp.scss +47 -46
- package/dist/style-jrkf.css +1 -1
- package/dist/style-jrkf.scss +31 -30
- package/dist/style.css +1 -1
- package/dist/style.scss +34 -33
- 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/postinstall.js +0 -9
|
@@ -7,7 +7,8 @@ import classNames from "classnames";
|
|
|
7
7
|
import { ComponentDefaults } from "../../utils/typings";
|
|
8
8
|
import { useRtl } from "../configprovider/index";
|
|
9
9
|
import { PriceColorEnum } from "../../types";
|
|
10
|
-
import { harmony
|
|
10
|
+
import { harmony } from "../../utils/taro/platform";
|
|
11
|
+
import { shouldRenderPriceAsRaw, hasNonPriceChars } from "../../utils/should-render-price-raw";
|
|
11
12
|
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
12
13
|
color: 'primary',
|
|
13
14
|
price: 0,
|
|
@@ -16,16 +17,25 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
16
17
|
thousands: false,
|
|
17
18
|
position: 'before',
|
|
18
19
|
size: 'normal',
|
|
19
|
-
line: false
|
|
20
|
+
line: false,
|
|
21
|
+
raw: false
|
|
20
22
|
});
|
|
21
23
|
export var Price = function(props) {
|
|
22
|
-
var _$_object_spread = _object_spread({}, defaultProps, props), color = _$_object_spread.color, originalPrice = _$_object_spread.price, symbol = _$_object_spread.symbol, digits = _$_object_spread.digits, thousands = _$_object_spread.thousands, position = _$_object_spread.position, size = _$_object_spread.size, line = _$_object_spread.line, className = _$_object_spread.className, style = _$_object_spread.style;
|
|
24
|
+
var _$_object_spread = _object_spread({}, defaultProps, props), color = _$_object_spread.color, originalPrice = _$_object_spread.price, symbol = _$_object_spread.symbol, digits = _$_object_spread.digits, thousands = _$_object_spread.thousands, position = _$_object_spread.position, size = _$_object_spread.size, line = _$_object_spread.line, raw = _$_object_spread.raw, className = _$_object_spread.className, style = _$_object_spread.style;
|
|
23
25
|
var classPrefix = 'nut-price';
|
|
24
26
|
var rtl = useRtl();
|
|
27
|
+
var isRenderPriceRaw = useMemo(function() {
|
|
28
|
+
return typeof originalPrice === 'string' && shouldRenderPriceAsRaw(originalPrice) || raw && typeof originalPrice === 'string' && hasNonPriceChars(originalPrice);
|
|
29
|
+
}, [
|
|
30
|
+
originalPrice,
|
|
31
|
+
raw
|
|
32
|
+
]);
|
|
25
33
|
var price = useMemo(function() {
|
|
34
|
+
if (isRenderPriceRaw) return '';
|
|
26
35
|
return originalPrice.toString().replace(/[^\d.]/g, '');
|
|
27
36
|
}, [
|
|
28
|
-
originalPrice
|
|
37
|
+
originalPrice,
|
|
38
|
+
isRenderPriceRaw
|
|
29
39
|
]);
|
|
30
40
|
var isCustomPriceColor = useMemo(function() {
|
|
31
41
|
var specificPriceColor = Object.values(PriceColorEnum);
|
|
@@ -67,7 +77,7 @@ export var Price = function(props) {
|
|
|
67
77
|
return num;
|
|
68
78
|
};
|
|
69
79
|
var formatDecimal = function(decimalNum) {
|
|
70
|
-
if (Number(decimalNum) === 0) {
|
|
80
|
+
if (Number(decimalNum) === 0 && !checkPoint(decimalNum)) {
|
|
71
81
|
decimalNum = 0;
|
|
72
82
|
}
|
|
73
83
|
if (checkPoint(decimalNum)) {
|
|
@@ -91,27 +101,56 @@ export var Price = function(props) {
|
|
|
91
101
|
"".concat(classPrefix, "-symbol-").concat(size),
|
|
92
102
|
(_obj = {}, _define_property(_obj, "".concat(classPrefix, "-line"), line), _define_property(_obj, "".concat(classPrefix, "-rtl"), rtl), _obj)
|
|
93
103
|
]),
|
|
94
|
-
style: priceColorStyle
|
|
104
|
+
style: priceColorStyle,
|
|
105
|
+
// @ts-ignore
|
|
106
|
+
ariaHidden: true
|
|
95
107
|
}, symbol ? replaceSpecialChar(symbol) : '');
|
|
96
108
|
};
|
|
97
109
|
var renderInner = function() {
|
|
98
110
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, symbol && position === 'before' ? renderSymbol() : null, /*#__PURE__*/ React.createElement(Text, {
|
|
99
111
|
className: "".concat(classPrefix, "-integer ").concat(classPrefix, "-integer-").concat(size, " ").concat(line ? "".concat(classPrefix, "-line") : ''),
|
|
100
|
-
style: priceColorStyle
|
|
112
|
+
style: priceColorStyle,
|
|
113
|
+
// @ts-ignore
|
|
114
|
+
ariaHidden: true
|
|
101
115
|
}, formatThousands(price)), digits !== 0 ? /*#__PURE__*/ React.createElement(React.Fragment, null, checkPoint(price) || digits ? /*#__PURE__*/ React.createElement(Text, {
|
|
102
116
|
className: "".concat(classPrefix, "-decimal ").concat(classPrefix, "-decimal-").concat(size, " ").concat(line ? "".concat(classPrefix, "-line") : ''),
|
|
103
|
-
style: priceColorStyle
|
|
117
|
+
style: priceColorStyle,
|
|
118
|
+
// @ts-ignore
|
|
119
|
+
ariaHidden: true
|
|
104
120
|
}, ".") : null, /*#__PURE__*/ React.createElement(Text, {
|
|
105
121
|
className: "".concat(classPrefix, "-decimal ").concat(classPrefix, "-decimal-").concat(size, " ").concat(line ? "".concat(classPrefix, "-line") : ''),
|
|
106
|
-
style: priceColorStyle
|
|
122
|
+
style: priceColorStyle,
|
|
123
|
+
// @ts-ignore
|
|
124
|
+
ariaHidden: true
|
|
107
125
|
}, formatDecimal(price))) : null, symbol && position === 'after' ? renderSymbol() : null);
|
|
108
126
|
};
|
|
109
|
-
|
|
127
|
+
var renderRawContent = function() {
|
|
128
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, originalPrice);
|
|
129
|
+
};
|
|
130
|
+
var accessiblePriceText = useMemo(function() {
|
|
131
|
+
var safeSymbol = symbol ? replaceSpecialChar(symbol) : '';
|
|
132
|
+
var numberText = isRenderPriceRaw ? "".concat(originalPrice) : "".concat(price);
|
|
133
|
+
return position === 'after' ? "".concat(numberText).concat(safeSymbol) : "".concat(safeSymbol).concat(numberText);
|
|
134
|
+
}, [
|
|
135
|
+
symbol,
|
|
136
|
+
price,
|
|
137
|
+
position,
|
|
138
|
+
originalPrice,
|
|
139
|
+
isRenderPriceRaw
|
|
140
|
+
]);
|
|
141
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, harmony() || process.env.TARO_ENV === 'dynamic' ? /*#__PURE__*/ React.createElement(Text, {
|
|
110
142
|
className: "".concat(classPrefix, " ").concat(classPrefix, "-").concat(color, " ").concat(className),
|
|
111
|
-
style: style
|
|
112
|
-
|
|
143
|
+
style: style,
|
|
144
|
+
// @ts-ignore
|
|
145
|
+
ariaLabel: accessiblePriceText,
|
|
146
|
+
// eslint-disable-next-line jsx-a11y/aria-role
|
|
147
|
+
role: "text"
|
|
148
|
+
}, isRenderPriceRaw ? renderRawContent() : renderInner()) : /*#__PURE__*/ React.createElement(View, {
|
|
113
149
|
className: "".concat(classPrefix, " ").concat(classPrefix, "-").concat(color, " ").concat(className),
|
|
114
|
-
style: style
|
|
115
|
-
|
|
150
|
+
style: style,
|
|
151
|
+
ariaLabel: accessiblePriceText,
|
|
152
|
+
// eslint-disable-next-line jsx-a11y/aria-role
|
|
153
|
+
role: "text"
|
|
154
|
+
}, isRenderPriceRaw ? renderRawContent() : renderInner()));
|
|
116
155
|
};
|
|
117
156
|
Price.displayName = 'NutPrice';
|
|
@@ -22,7 +22,7 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
22
22
|
export var Progress = function(props) {
|
|
23
23
|
var rtl = useRtl();
|
|
24
24
|
var _ref = _object_spread({}, defaultProps, props), className = _ref.className, style = _ref.style, percent = _ref.percent, background = _ref.background, color = _ref.color, strokeWidth = _ref.strokeWidth, showText = _ref.showText, animated = _ref.animated, children = _ref.children, lazy = _ref.lazy, delay = _ref.delay, // tc
|
|
25
|
-
showInfo = _ref.showInfo, borderRadius = _ref.borderRadius, fontSize = _ref.fontSize, activeColor = _ref.activeColor, backgroundColor = _ref.backgroundColor, active = _ref.active, activeMode = _ref.activeMode, duration = _ref.duration,
|
|
25
|
+
showInfo = _ref.showInfo, borderRadius = _ref.borderRadius, fontSize = _ref.fontSize, activeColor = _ref.activeColor, backgroundColor = _ref.backgroundColor, active = _ref.active, activeMode = _ref.activeMode, duration = _ref.duration, onActiveEnd = _ref.onActiveEnd, rest = _object_without_properties(_ref, [
|
|
26
26
|
"className",
|
|
27
27
|
"style",
|
|
28
28
|
"percent",
|
|
@@ -42,7 +42,6 @@ export var Progress = function(props) {
|
|
|
42
42
|
"active",
|
|
43
43
|
"activeMode",
|
|
44
44
|
"duration",
|
|
45
|
-
"ariaLabel",
|
|
46
45
|
"onActiveEnd"
|
|
47
46
|
]);
|
|
48
47
|
var classPrefix = 'nut-progress';
|
|
@@ -209,8 +208,7 @@ export var Progress = function(props) {
|
|
|
209
208
|
ref: progressRef,
|
|
210
209
|
id: selector,
|
|
211
210
|
className: classNames(classPrefix, className),
|
|
212
|
-
style: style
|
|
213
|
-
"aria-label": ariaLabel
|
|
211
|
+
style: style
|
|
214
212
|
}, rest), /*#__PURE__*/ React.createElement(View, {
|
|
215
213
|
className: "".concat(classPrefix, "-outer"),
|
|
216
214
|
style: stylesOuter
|
|
@@ -31,7 +31,58 @@ var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
|
31
31
|
});
|
|
32
32
|
export var PullToRefresh = function(p) {
|
|
33
33
|
var doRefresh = function doRefresh() {
|
|
34
|
-
return
|
|
34
|
+
return _async_to_generator(function() {
|
|
35
|
+
var e;
|
|
36
|
+
return _ts_generator(this, function(_state) {
|
|
37
|
+
switch(_state.label){
|
|
38
|
+
case 0:
|
|
39
|
+
setHeight(headHeight);
|
|
40
|
+
setStatus('refreshing');
|
|
41
|
+
_state.label = 1;
|
|
42
|
+
case 1:
|
|
43
|
+
_state.trys.push([
|
|
44
|
+
1,
|
|
45
|
+
3,
|
|
46
|
+
,
|
|
47
|
+
4
|
|
48
|
+
]);
|
|
49
|
+
return [
|
|
50
|
+
4,
|
|
51
|
+
props.onRefresh()
|
|
52
|
+
];
|
|
53
|
+
case 2:
|
|
54
|
+
_state.sent();
|
|
55
|
+
setStatus('complete');
|
|
56
|
+
return [
|
|
57
|
+
3,
|
|
58
|
+
4
|
|
59
|
+
];
|
|
60
|
+
case 3:
|
|
61
|
+
e = _state.sent();
|
|
62
|
+
setHeight(0);
|
|
63
|
+
setStatus('pulling');
|
|
64
|
+
throw e;
|
|
65
|
+
case 4:
|
|
66
|
+
if (!(props.completeDelay > 0)) return [
|
|
67
|
+
3,
|
|
68
|
+
6
|
|
69
|
+
];
|
|
70
|
+
return [
|
|
71
|
+
4,
|
|
72
|
+
sleep(props.completeDelay)
|
|
73
|
+
];
|
|
74
|
+
case 5:
|
|
75
|
+
_state.sent();
|
|
76
|
+
_state.label = 6;
|
|
77
|
+
case 6:
|
|
78
|
+
setHeight(0);
|
|
79
|
+
setStatus('pulling');
|
|
80
|
+
return [
|
|
81
|
+
2
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
})();
|
|
35
86
|
};
|
|
36
87
|
var classPrefix = 'nut-pulltorefresh';
|
|
37
88
|
var locale = useConfig().locale;
|
|
@@ -88,61 +139,6 @@ export var PullToRefresh = function(p) {
|
|
|
88
139
|
}
|
|
89
140
|
clearTimeout(timer.current);
|
|
90
141
|
};
|
|
91
|
-
function _doRefresh() {
|
|
92
|
-
_doRefresh = _async_to_generator(function() {
|
|
93
|
-
var e;
|
|
94
|
-
return _ts_generator(this, function(_state) {
|
|
95
|
-
switch(_state.label){
|
|
96
|
-
case 0:
|
|
97
|
-
setHeight(headHeight);
|
|
98
|
-
setStatus('refreshing');
|
|
99
|
-
_state.label = 1;
|
|
100
|
-
case 1:
|
|
101
|
-
_state.trys.push([
|
|
102
|
-
1,
|
|
103
|
-
3,
|
|
104
|
-
,
|
|
105
|
-
4
|
|
106
|
-
]);
|
|
107
|
-
return [
|
|
108
|
-
4,
|
|
109
|
-
props.onRefresh()
|
|
110
|
-
];
|
|
111
|
-
case 2:
|
|
112
|
-
_state.sent();
|
|
113
|
-
setStatus('complete');
|
|
114
|
-
return [
|
|
115
|
-
3,
|
|
116
|
-
4
|
|
117
|
-
];
|
|
118
|
-
case 3:
|
|
119
|
-
e = _state.sent();
|
|
120
|
-
setHeight(0);
|
|
121
|
-
setStatus('pulling');
|
|
122
|
-
throw e;
|
|
123
|
-
case 4:
|
|
124
|
-
if (!(props.completeDelay > 0)) return [
|
|
125
|
-
3,
|
|
126
|
-
6
|
|
127
|
-
];
|
|
128
|
-
return [
|
|
129
|
-
4,
|
|
130
|
-
sleep(props.completeDelay)
|
|
131
|
-
];
|
|
132
|
-
case 5:
|
|
133
|
-
_state.sent();
|
|
134
|
-
_state.label = 6;
|
|
135
|
-
case 6:
|
|
136
|
-
setHeight(0);
|
|
137
|
-
setStatus('pulling');
|
|
138
|
-
return [
|
|
139
|
-
2
|
|
140
|
-
];
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
return _doRefresh.apply(this, arguments);
|
|
145
|
-
}
|
|
146
142
|
var handleTouchEnd = function() {
|
|
147
143
|
if (props.disabled) return;
|
|
148
144
|
pullingRef.current = false;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { _ as _define_property } from "@swc/helpers/_/_define_property";
|
|
2
|
+
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
|
|
3
|
+
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
|
|
4
|
+
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
|
|
5
|
+
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
6
|
+
import React, { useImperativeHandle } from "react";
|
|
7
|
+
import { View } from "@tarojs/components";
|
|
8
|
+
import Taro from "@tarojs/taro";
|
|
9
|
+
import classNames from "classnames";
|
|
10
|
+
import { Close } from "@nutui/icons-react-taro";
|
|
11
|
+
import Popup from "../popup/index";
|
|
12
|
+
import { ComponentDefaults } from "../../utils/typings";
|
|
13
|
+
import { usePropsValue } from "../../hooks/use-props-value";
|
|
14
|
+
import Badge from "../badge/index";
|
|
15
|
+
import { useConfig } from "../configprovider";
|
|
16
|
+
var defaultProps = _object_spread_props(_object_spread({}, ComponentDefaults), {
|
|
17
|
+
options: [],
|
|
18
|
+
visible: false,
|
|
19
|
+
closeOnOverlayClick: true,
|
|
20
|
+
safeAreaInsetTop: true
|
|
21
|
+
});
|
|
22
|
+
var InternalQuickEnter = function(props, ref) {
|
|
23
|
+
var _ref = _object_spread({}, defaultProps, props), children = _ref.children, visible = _ref.visible, title = _ref.title, _ref_options = _ref.options, options = _ref_options === void 0 ? [] : _ref_options, closeOnOverlayClick = _ref.closeOnOverlayClick, _ref_popupProps = _ref.popupProps, popupProps = _ref_popupProps === void 0 ? {} : _ref_popupProps, className = _ref.className, style = _ref.style, onClose = _ref.onClose, onChange = _ref.onChange, closeIcon = _ref.closeIcon, safeAreaInsetTop = _ref.safeAreaInsetTop, rest = _object_without_properties(_ref, [
|
|
24
|
+
"children",
|
|
25
|
+
"visible",
|
|
26
|
+
"title",
|
|
27
|
+
"options",
|
|
28
|
+
"closeOnOverlayClick",
|
|
29
|
+
"popupProps",
|
|
30
|
+
"className",
|
|
31
|
+
"style",
|
|
32
|
+
"onClose",
|
|
33
|
+
"onChange",
|
|
34
|
+
"closeIcon",
|
|
35
|
+
"safeAreaInsetTop"
|
|
36
|
+
]);
|
|
37
|
+
var locale = useConfig().locale;
|
|
38
|
+
var mergedTitle = title || locale.quickenter.title;
|
|
39
|
+
var classPrefix = 'nut-quickenter';
|
|
40
|
+
var classes = classNames(classPrefix, className, {
|
|
41
|
+
'safe-area-top': safeAreaInsetTop
|
|
42
|
+
});
|
|
43
|
+
var _usePropsValue = _sliced_to_array(usePropsValue({
|
|
44
|
+
value: props.visible,
|
|
45
|
+
defaultValue: false,
|
|
46
|
+
finalValue: false,
|
|
47
|
+
onChange: function(v) {
|
|
48
|
+
if (!v) {
|
|
49
|
+
var _props_onClose;
|
|
50
|
+
(_props_onClose = props.onClose) === null || _props_onClose === void 0 ? void 0 : _props_onClose.call(props);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}), 2), innerVisible = _usePropsValue[0], setInnerVisible = _usePropsValue[1];
|
|
54
|
+
var actions = {
|
|
55
|
+
open: function() {
|
|
56
|
+
setInnerVisible(true);
|
|
57
|
+
},
|
|
58
|
+
close: function() {
|
|
59
|
+
setInnerVisible(false);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
useImperativeHandle(ref, function() {
|
|
63
|
+
return actions;
|
|
64
|
+
});
|
|
65
|
+
var onCancelEvent = function() {
|
|
66
|
+
setInnerVisible(false);
|
|
67
|
+
};
|
|
68
|
+
var handleItemClick = function(item, index) {
|
|
69
|
+
if (item.url) {
|
|
70
|
+
Taro.navigateTo({
|
|
71
|
+
url: item.url
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(item, index);
|
|
75
|
+
};
|
|
76
|
+
var renderTitleBar = function() {
|
|
77
|
+
return /*#__PURE__*/ React.createElement(View, {
|
|
78
|
+
className: "".concat(classPrefix, "-control")
|
|
79
|
+
}, /*#__PURE__*/ React.createElement(View, {
|
|
80
|
+
className: "".concat(classPrefix, "-title")
|
|
81
|
+
}, mergedTitle), /*#__PURE__*/ React.createElement(View, {
|
|
82
|
+
className: "".concat(classPrefix, "-close-btn"),
|
|
83
|
+
onClick: function(e) {
|
|
84
|
+
e.stopPropagation();
|
|
85
|
+
onCancelEvent();
|
|
86
|
+
}
|
|
87
|
+
}, closeIcon || /*#__PURE__*/ React.createElement(Close, {
|
|
88
|
+
ariaLabel: locale.close
|
|
89
|
+
})));
|
|
90
|
+
};
|
|
91
|
+
var renderContent = function() {
|
|
92
|
+
return /*#__PURE__*/ React.createElement(View, {
|
|
93
|
+
className: classNames("".concat(classPrefix, "-content"), _define_property({}, "".concat(classPrefix, "-content-scrollable"), options.length > 8))
|
|
94
|
+
}, /*#__PURE__*/ React.createElement(View, {
|
|
95
|
+
className: "".concat(classPrefix, "-list")
|
|
96
|
+
}, options.map(function(item, index) {
|
|
97
|
+
var _item_badgeProps, _item_badgeProps1;
|
|
98
|
+
var _item_badge, _item_badge1;
|
|
99
|
+
return /*#__PURE__*/ React.createElement(View, {
|
|
100
|
+
key: index,
|
|
101
|
+
className: "".concat(classPrefix, "-item"),
|
|
102
|
+
ariaLabel: "".concat(item.title, " ").concat((_item_badge = item.badge) !== null && _item_badge !== void 0 ? _item_badge : (_item_badgeProps = item.badgeProps) === null || _item_badgeProps === void 0 ? void 0 : _item_badgeProps.value),
|
|
103
|
+
onClick: function() {
|
|
104
|
+
return handleItemClick(item, index);
|
|
105
|
+
}
|
|
106
|
+
}, /*#__PURE__*/ React.createElement(View, {
|
|
107
|
+
className: "".concat(classPrefix, "-item-icon"),
|
|
108
|
+
ariaHidden: true
|
|
109
|
+
}, /*#__PURE__*/ React.createElement(Badge, _object_spread_props(_object_spread({}, item.badgeProps), {
|
|
110
|
+
value: (_item_badge1 = item.badge) !== null && _item_badge1 !== void 0 ? _item_badge1 : (_item_badgeProps1 = item.badgeProps) === null || _item_badgeProps1 === void 0 ? void 0 : _item_badgeProps1.value
|
|
111
|
+
}), item.icon)), /*#__PURE__*/ React.createElement(View, {
|
|
112
|
+
className: "".concat(classPrefix, "-item-title"),
|
|
113
|
+
ariaHidden: true
|
|
114
|
+
}, item.title));
|
|
115
|
+
})));
|
|
116
|
+
};
|
|
117
|
+
var renderQuickEnterElement = function() {
|
|
118
|
+
return /*#__PURE__*/ React.createElement(View, _object_spread({
|
|
119
|
+
className: classes,
|
|
120
|
+
style: style
|
|
121
|
+
}, rest), renderTitleBar(), children, renderContent());
|
|
122
|
+
};
|
|
123
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Popup, _object_spread_props(_object_spread({
|
|
124
|
+
style: {
|
|
125
|
+
background: 'transparent'
|
|
126
|
+
}
|
|
127
|
+
}, popupProps), {
|
|
128
|
+
overlayStyle: {
|
|
129
|
+
background: 'transparent'
|
|
130
|
+
},
|
|
131
|
+
visible: innerVisible,
|
|
132
|
+
position: "top",
|
|
133
|
+
onOverlayClick: function() {
|
|
134
|
+
if (!closeOnOverlayClick) return;
|
|
135
|
+
onCancelEvent();
|
|
136
|
+
},
|
|
137
|
+
onClose: onCancelEvent
|
|
138
|
+
}), renderQuickEnterElement()));
|
|
139
|
+
};
|
|
140
|
+
var QuickEnter = /*#__PURE__*/ React.forwardRef(InternalQuickEnter);
|
|
141
|
+
export default QuickEnter;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
.nut-quickenter {
|
|
2
|
+
width: 100%;
|
|
3
|
+
/* 限制弹层最大高度,包含安全区 */
|
|
4
|
+
max-height: calc(#{$quickenter-max-height} + env(safe-area-inset-top, 0));
|
|
5
|
+
background: $quickenter-bg-color;
|
|
6
|
+
border-radius: 0 0 12px 12px;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
box-shadow: $quickenter-box-shadow;
|
|
12
|
+
// backdrop-filter: $quickenter-backdrop-filter;
|
|
13
|
+
|
|
14
|
+
&.safe-area-top {
|
|
15
|
+
/* 使用 env fallback,确保旧浏览器返回 0 */
|
|
16
|
+
padding-top: calc(
|
|
17
|
+
env(safe-area-inset-top, 0) * var(--nutui-safe-area-multiple, 1)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-control {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
padding: 30px 16px 0;
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&-title {
|
|
30
|
+
flex: 1;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
text-overflow: ellipsis;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
text-align: left;
|
|
35
|
+
color: $quickenter-title-color;
|
|
36
|
+
font-size: $quickenter-title-font-size;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-close-btn {
|
|
40
|
+
color: $quickenter-close-icon-color;
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: center;
|
|
44
|
+
|
|
45
|
+
svg,
|
|
46
|
+
.nut-icon {
|
|
47
|
+
width: $quickenter-close-icon-size;
|
|
48
|
+
height: $quickenter-close-icon-size;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&-content {
|
|
53
|
+
flex: 1;
|
|
54
|
+
padding: 10px 28px;
|
|
55
|
+
overflow-y: hidden; // 始终可滚动,防止内容被遮挡
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
|
|
58
|
+
&-scrollable {
|
|
59
|
+
overflow-y: auto; // Only scroll when > 8 items
|
|
60
|
+
-webkit-overflow-scrolling: touch;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&-list {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-wrap: wrap;
|
|
67
|
+
align-items: flex-start;
|
|
68
|
+
width: 100%;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&-item {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-direction: column;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: flex-start;
|
|
76
|
+
width: 56px;
|
|
77
|
+
padding: 0 0 12px 0; // Reduced from 16px to ensure 2 rows fit in 256px
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
|
|
81
|
+
// Calculate gap for 4 items per row: (100% - 4 * 56px) / 3
|
|
82
|
+
margin-right: calc((100% - 224px) / 3);
|
|
83
|
+
|
|
84
|
+
&:nth-child(4n) {
|
|
85
|
+
margin-right: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&-icon {
|
|
89
|
+
width: 56px;
|
|
90
|
+
height: 56px;
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
border-radius: 50%;
|
|
95
|
+
background: $quickenter-item-icon-bg-color;
|
|
96
|
+
color: $quickenter-item-icon-color;
|
|
97
|
+
margin-bottom: 8px;
|
|
98
|
+
flex-shrink: 0;
|
|
99
|
+
|
|
100
|
+
svg,
|
|
101
|
+
.nut-icon {
|
|
102
|
+
width: 22px;
|
|
103
|
+
height: 22px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&-title {
|
|
108
|
+
font-size: $quickenter-item-title-font-size;
|
|
109
|
+
color: $quickenter-item-title-color;
|
|
110
|
+
text-align: center;
|
|
111
|
+
line-height: 1.4;
|
|
112
|
+
// Allow multi-line if text is long, preventing truncation
|
|
113
|
+
white-space: normal;
|
|
114
|
+
word-wrap: break-word;
|
|
115
|
+
width: 72px; // Allow text to be slightly wider than icon
|
|
116
|
+
margin-left: -8px; // Center 72px title over 56px icon
|
|
117
|
+
margin-right: -8px;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/* #ifdef harmony */
|
|
3
|
+
/* #endif */
|
|
4
|
+
/* #ifndef harmony */
|
|
5
|
+
/* #endif */
|
|
6
|
+
.nut-quickenter {
|
|
7
|
+
width: 100%;
|
|
8
|
+
/* 限制弹层最大高度,包含安全区 */
|
|
9
|
+
max-height: calc(var(--nutui-quickenter-max-height, 256px) + env(safe-area-inset-top, 0));
|
|
10
|
+
background: var(--nutui-quickenter-bg-color, #f5f5f5);
|
|
11
|
+
border-radius: 0 0 12px 12px;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
box-shadow: var(--nutui-quickenter-box-shadow, 0px 8px 16px rgba(141, 153, 167, 0.2), 0px -0.5px 0px rgba(0, 0, 0, 0.05) inset);
|
|
17
|
+
}
|
|
18
|
+
.nut-quickenter.safe-area-top {
|
|
19
|
+
/* 使用 env fallback,确保旧浏览器返回 0 */
|
|
20
|
+
padding-top: calc(env(safe-area-inset-top, 0) * var(--nutui-safe-area-multiple, 1));
|
|
21
|
+
}
|
|
22
|
+
.nut-quickenter-control {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
padding: 30px 16px 0;
|
|
27
|
+
box-sizing: border-box;
|
|
28
|
+
}
|
|
29
|
+
.nut-quickenter-title {
|
|
30
|
+
flex: 1;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
text-overflow: ellipsis;
|
|
33
|
+
white-space: nowrap;
|
|
34
|
+
text-align: left;
|
|
35
|
+
color: var(--nutui-quickenter-title-color, var(--nutui-color-title, #1a1a1a));
|
|
36
|
+
font-size: var(--nutui-quickenter-title-font-size, var(--nutui-font-size-base, 14px));
|
|
37
|
+
}
|
|
38
|
+
.nut-quickenter-close-btn {
|
|
39
|
+
color: var(--nutui-quickenter-close-icon-color, #808080);
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
}
|
|
44
|
+
.nut-quickenter-close-btn svg,
|
|
45
|
+
.nut-quickenter-close-btn .nut-icon {
|
|
46
|
+
width: var(--nutui-quickenter-close-icon-size, 12px);
|
|
47
|
+
height: var(--nutui-quickenter-close-icon-size, 12px);
|
|
48
|
+
}
|
|
49
|
+
.nut-quickenter-content {
|
|
50
|
+
flex: 1;
|
|
51
|
+
padding: 10px 28px;
|
|
52
|
+
overflow-y: hidden;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
}
|
|
55
|
+
.nut-quickenter-content-scrollable {
|
|
56
|
+
overflow-y: auto;
|
|
57
|
+
-webkit-overflow-scrolling: touch;
|
|
58
|
+
}
|
|
59
|
+
.nut-quickenter-list {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
align-items: flex-start;
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
.nut-quickenter-item {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: flex-start;
|
|
70
|
+
width: 56px;
|
|
71
|
+
padding: 0 0 12px 0;
|
|
72
|
+
box-sizing: border-box;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
margin-right: calc((100% - 224px) / 3);
|
|
75
|
+
}
|
|
76
|
+
.nut-quickenter-item:nth-child(4n) {
|
|
77
|
+
margin-right: 0;
|
|
78
|
+
}
|
|
79
|
+
.nut-quickenter-item-icon {
|
|
80
|
+
width: 56px;
|
|
81
|
+
height: 56px;
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
border-radius: 50%;
|
|
86
|
+
background: var(--nutui-quickenter-item-icon-bg-color, #ffffff);
|
|
87
|
+
color: var(--nutui-quickenter-item-icon-color, var(--nutui-color-title, #1a1a1a));
|
|
88
|
+
margin-bottom: 8px;
|
|
89
|
+
flex-shrink: 0;
|
|
90
|
+
}
|
|
91
|
+
.nut-quickenter-item-icon svg,
|
|
92
|
+
.nut-quickenter-item-icon .nut-icon {
|
|
93
|
+
width: 22px;
|
|
94
|
+
height: 22px;
|
|
95
|
+
}
|
|
96
|
+
.nut-quickenter-item-title {
|
|
97
|
+
font-size: var(--nutui-quickenter-item-title-font-size, var(--nutui-font-size-s, 12px));
|
|
98
|
+
color: var(--nutui-quickenter-item-title-color, var(--nutui-color-title, #1a1a1a));
|
|
99
|
+
text-align: center;
|
|
100
|
+
line-height: 1.4;
|
|
101
|
+
white-space: normal;
|
|
102
|
+
word-wrap: break-word;
|
|
103
|
+
width: 72px;
|
|
104
|
+
margin-left: -8px;
|
|
105
|
+
margin-right: -8px;
|
|
106
|
+
}
|