@nutui/nutui-react-taro 3.0.19 → 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 -59
- 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/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/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 -7523
- 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 +32 -31
- package/dist/style.css +1 -1
- package/dist/style.scss +32 -31
- 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
|
@@ -79,20 +79,16 @@ export var WaterMark = function(props) {
|
|
|
79
79
|
setBase64Url(canvas.toDataURL());
|
|
80
80
|
};
|
|
81
81
|
} else if (content) {
|
|
82
|
-
ctx.textBaseline = 'middle' // 设置或返回在绘制文本时使用的当前文本基线。(正中)
|
|
83
|
-
;
|
|
84
|
-
ctx.textAlign = 'center' // 设置或返回文本内容的当前对齐方式。
|
|
85
|
-
;
|
|
82
|
+
ctx.textBaseline = 'middle'; // 设置或返回在绘制文本时使用的当前文本基线。(正中)
|
|
83
|
+
ctx.textAlign = 'center'; // 设置或返回文本内容的当前对齐方式。
|
|
86
84
|
// 文字绕中间旋转
|
|
87
85
|
ctx.translate(markWidth / 2, markHeight / 2);
|
|
88
86
|
ctx.rotate(Math.PI / 180 * Number(rotate));
|
|
89
87
|
var markSize = Number(fontSize) * ratio;
|
|
90
88
|
ctx.font = "".concat(fontStyle, " normal ").concat(fontWeight, " ").concat(markSize, "px/").concat(markHeight, "px ").concat(fontFamily);
|
|
91
89
|
ctx.fillStyle = color;
|
|
92
|
-
ctx.fillText(content, startX, startY) // 在画布上绘制"被填充的"文本。
|
|
93
|
-
;
|
|
94
|
-
ctx.restore() // 返回之前保存过的路径状态和属性。
|
|
95
|
-
;
|
|
90
|
+
ctx.fillText(content, startX, startY); // 在画布上绘制"被填充的"文本。
|
|
91
|
+
ctx.restore(); // 返回之前保存过的路径状态和属性。
|
|
96
92
|
setBase64Url(canvas.toDataURL());
|
|
97
93
|
}
|
|
98
94
|
} else {
|
package/dist/es/types/index.d.ts
CHANGED
|
@@ -262,3 +262,6 @@ export * from './spec/audio/taro';
|
|
|
262
262
|
export * from './spec/steps/base';
|
|
263
263
|
export * from './spec/steps/h5';
|
|
264
264
|
export * from './spec/steps/taro';
|
|
265
|
+
export * from './spec/quickenter/base';
|
|
266
|
+
export * from './spec/quickenter/h5';
|
|
267
|
+
export * from './spec/quickenter/taro';
|
package/dist/es/types/index.js
CHANGED
|
@@ -262,3 +262,6 @@ export * from "./spec/audio/taro";
|
|
|
262
262
|
export * from "./spec/steps/base";
|
|
263
263
|
export * from "./spec/steps/h5";
|
|
264
264
|
export * from "./spec/steps/taro";
|
|
265
|
+
export * from "./spec/quickenter/base";
|
|
266
|
+
export * from "./spec/quickenter/h5";
|
|
267
|
+
export * from "./spec/quickenter/taro";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import type { MouseEvent } from 'react';
|
|
2
3
|
import { BaseProps } from '../../base/props';
|
|
3
4
|
import { UIFill, UIRound, UISize, UIType } from '../../base/atoms';
|
|
4
5
|
export interface BaseButton extends BaseProps {
|
|
@@ -50,5 +51,5 @@ export interface BaseButton extends BaseProps {
|
|
|
50
51
|
/**
|
|
51
52
|
* 点击按钮时触发
|
|
52
53
|
*/
|
|
53
|
-
onClick: (e:
|
|
54
|
+
onClick: (e: MouseEvent<HTMLButtonElement>) => void
|
|
54
55
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { ButtonProps as MiniProgramButtonProps } from '@tarojs/components';
|
|
1
2
|
import { BaseButton } from './base';
|
|
2
|
-
|
|
3
|
+
type OmitMiniProgramButtonProps = Omit<MiniProgramButtonProps, 'size' | 'type' | 'onClick' | 'style' | 'disabled' | 'loading' | 'id'>;
|
|
4
|
+
export interface TaroButtonProps extends BaseButton, OmitMiniProgramButtonProps {
|
|
5
|
+
nativeType: 'submit' | 'reset';
|
|
3
6
|
}
|
|
7
|
+
export {};
|
|
@@ -44,6 +44,7 @@ export interface BaseCalendarCard extends BaseProps {
|
|
|
44
44
|
* 限制范围结束日期
|
|
45
45
|
*/
|
|
46
46
|
endDate: Date
|
|
47
|
+
weekdays?: string[];
|
|
47
48
|
/**
|
|
48
49
|
* 设置不可选日期
|
|
49
50
|
*/
|
|
@@ -60,6 +61,7 @@ export interface BaseCalendarCard extends BaseProps {
|
|
|
60
61
|
* 日期底部信息
|
|
61
62
|
*/
|
|
62
63
|
renderDayBottom: (day: CalendarCardDay) => ReactNode
|
|
64
|
+
renderDayAriaLabel?: (day: CalendarCardDay) => string;
|
|
63
65
|
/**
|
|
64
66
|
* 点击后触发
|
|
65
67
|
*/
|
|
@@ -38,14 +38,8 @@ export interface BaseDialog extends DialogWrapProps {
|
|
|
38
38
|
* 取消按钮文案
|
|
39
39
|
*/
|
|
40
40
|
cancelText: ReactNode
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
*/
|
|
44
|
-
confirmBadge: ReactNode
|
|
45
|
-
/**
|
|
46
|
-
* 取消按钮徽标
|
|
47
|
-
*/
|
|
48
|
-
cancelBadge: ReactNode
|
|
41
|
+
confirmBadge: ReactNode;
|
|
42
|
+
cancelBadge: ReactNode;
|
|
49
43
|
/**
|
|
50
44
|
* 是否隐藏确定按钮
|
|
51
45
|
*/
|
|
@@ -78,6 +72,7 @@ export interface BaseDialog extends DialogWrapProps {
|
|
|
78
72
|
* 确定按钮回调
|
|
79
73
|
*/
|
|
80
74
|
onConfirm: (e?: MouseEvent<HTMLButtonElement>) => PromiseLike<any> | void
|
|
75
|
+
ariaLabel?: string;
|
|
81
76
|
}
|
|
82
77
|
export type DialogReturnProps = {
|
|
83
78
|
update: (newConfig: Partial<BaseDialog>) => void;
|
|
@@ -2,6 +2,8 @@ import { ITouchEvent } from '@tarojs/components';
|
|
|
2
2
|
import { BaseDialog, BaseContentProps } from './base';
|
|
3
3
|
export interface TaroContentProps extends BaseContentProps {
|
|
4
4
|
onClick: (event: ITouchEvent) => void;
|
|
5
|
+
ariaRole?: string;
|
|
6
|
+
ariaLabel?: string;
|
|
5
7
|
}
|
|
6
8
|
export interface TaroDialogProps extends Omit<BaseDialog, 'onOverlayClick' | 'onClick'> {
|
|
7
9
|
onClick: (event: ITouchEvent) => void;
|
|
@@ -34,7 +34,7 @@ export interface BasePopup extends BaseProps, BaseOverlay {
|
|
|
34
34
|
*/
|
|
35
35
|
title?: ReactNode
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* 頂部佔位
|
|
38
38
|
*/
|
|
39
39
|
top?: ReactNode
|
|
40
40
|
/**
|
|
@@ -89,8 +89,7 @@ export interface BasePopup extends BaseProps, BaseOverlay {
|
|
|
89
89
|
* 结束触碰时触发
|
|
90
90
|
*/
|
|
91
91
|
onTouchEnd: (height: number, e: any) => void
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
closeAriaLabel?: string
|
|
92
|
+
closeAriaLabel?: string;
|
|
93
|
+
overlayProps?: any;
|
|
94
|
+
animated?: boolean;
|
|
96
95
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../base/props';
|
|
3
|
+
export type QuickEnterRef = QuickEnterActions;
|
|
4
|
+
export type QuickEnterActions = {
|
|
5
|
+
open: () => void;
|
|
6
|
+
close: () => void;
|
|
7
|
+
};
|
|
8
|
+
export interface QuickEnterOption extends Record<string, any> {
|
|
9
|
+
title?: string;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
type?: string;
|
|
12
|
+
url?: string;
|
|
13
|
+
badge?: boolean | ReactNode;
|
|
14
|
+
badgeProps?: any;
|
|
15
|
+
}
|
|
16
|
+
export interface BaseQuickEnter<POPUP_PROPS = any> extends BaseProps {
|
|
17
|
+
/**
|
|
18
|
+
* 是否可见
|
|
19
|
+
*/
|
|
20
|
+
visible?: boolean
|
|
21
|
+
/**
|
|
22
|
+
* 标题
|
|
23
|
+
*/
|
|
24
|
+
title?: ReactNode
|
|
25
|
+
/**
|
|
26
|
+
* 选项列表
|
|
27
|
+
*/
|
|
28
|
+
options?: QuickEnterOption[]
|
|
29
|
+
/**
|
|
30
|
+
* 透传给 Popup 组件的属性
|
|
31
|
+
*/
|
|
32
|
+
popupProps?: POPUP_PROPS
|
|
33
|
+
/**
|
|
34
|
+
* 是否在点击遮罩层后关闭
|
|
35
|
+
*/
|
|
36
|
+
closeOnOverlayClick?: boolean
|
|
37
|
+
/**
|
|
38
|
+
* 自定义关闭图标
|
|
39
|
+
*/
|
|
40
|
+
closeIcon?: ReactNode
|
|
41
|
+
safeAreaInsetTop?: boolean;
|
|
42
|
+
onClose?: () => void;
|
|
43
|
+
onChange?: (item: QuickEnterOption, index: number) => void;
|
|
44
|
+
children?: ReactNode;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -72,10 +72,7 @@ export function triggerDrag(el) {
|
|
|
72
72
|
* @param {number} endY 结束触摸点的 Y 坐标
|
|
73
73
|
* @param {number} duration 移动持续时间(毫秒)
|
|
74
74
|
*/ export function simulateTouchMove(element, startX, startY, endX, endY, duration) {
|
|
75
|
-
return
|
|
76
|
-
}
|
|
77
|
-
function _simulateTouchMove() {
|
|
78
|
-
_simulateTouchMove = _async_to_generator(function(element, startX, startY, endX, endY, duration) {
|
|
75
|
+
return _async_to_generator(function() {
|
|
79
76
|
var touch, touchList, distanceX, distanceY, startTime, elapsed, progress, currentX, currentY, currentTouch, currentTouchList;
|
|
80
77
|
return _ts_generator(this, function(_state) {
|
|
81
78
|
switch(_state.label){
|
|
@@ -128,8 +125,7 @@ function _simulateTouchMove() {
|
|
|
128
125
|
];
|
|
129
126
|
}
|
|
130
127
|
});
|
|
131
|
-
});
|
|
132
|
-
return _simulateTouchMove.apply(this, arguments);
|
|
128
|
+
})();
|
|
133
129
|
}
|
|
134
130
|
/**
|
|
135
131
|
* 模拟触摸缩放方法
|
|
@@ -138,10 +134,7 @@ function _simulateTouchMove() {
|
|
|
138
134
|
* @param {number} endDistance 结束触摸点的距离
|
|
139
135
|
* @param {number} duration 缩放持续时间(毫秒)
|
|
140
136
|
*/ export function simulateTouchZoom(element, startDistance, endDistance, duration) {
|
|
141
|
-
return
|
|
142
|
-
}
|
|
143
|
-
function _simulateTouchZoom() {
|
|
144
|
-
_simulateTouchZoom = _async_to_generator(function(element, startDistance, endDistance, duration) {
|
|
137
|
+
return _async_to_generator(function() {
|
|
145
138
|
var centerX, centerY, startScale, endScale, startTouches, endTouches, progress, currentScale, currentDistance, currentTouches;
|
|
146
139
|
return _ts_generator(this, function(_state) {
|
|
147
140
|
switch(_state.label){
|
|
@@ -201,6 +194,5 @@ function _simulateTouchZoom() {
|
|
|
201
194
|
];
|
|
202
195
|
}
|
|
203
196
|
});
|
|
204
|
-
});
|
|
205
|
-
return _simulateTouchZoom.apply(this, arguments);
|
|
197
|
+
})();
|
|
206
198
|
}
|
package/dist/es/utils/render.js
CHANGED
|
@@ -45,10 +45,7 @@ function legacyUnmount(container) {
|
|
|
45
45
|
return unmountComponentAtNode(container);
|
|
46
46
|
}
|
|
47
47
|
function concurrentUnmount(container) {
|
|
48
|
-
return
|
|
49
|
-
}
|
|
50
|
-
function _concurrentUnmount() {
|
|
51
|
-
_concurrentUnmount = _async_to_generator(function(container) {
|
|
48
|
+
return _async_to_generator(function() {
|
|
52
49
|
return _ts_generator(this, function(_state) {
|
|
53
50
|
// Delay to unmount to avoid React 18 sync warning
|
|
54
51
|
return [
|
|
@@ -60,8 +57,7 @@ function _concurrentUnmount() {
|
|
|
60
57
|
})
|
|
61
58
|
];
|
|
62
59
|
});
|
|
63
|
-
});
|
|
64
|
-
return _concurrentUnmount.apply(this, arguments);
|
|
60
|
+
})();
|
|
65
61
|
}
|
|
66
62
|
export function unmount(container) {
|
|
67
63
|
if (createRoot) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var RE_NUM = /\d+(?:\.\d+)?/g;
|
|
2
|
+
// 价格合法字符:数字、小数点、负号、大写货币代码(HK USD EUR 等)、常见货币符号 Unicode 区块(含全角 ¥)
|
|
3
|
+
var PRICE_CHARS = /^[\d.\-A-Z¥¥$€£₩₹₽₺₴₪฿\u20A0-\u20CF\uFE69\uFF04\uFFE5]*$/;
|
|
4
|
+
// 无法提取出有效价格时直接按原文展示,避免把纯文案误格式化成 0 或空串
|
|
5
|
+
function hasNoExtractablePrice(s) {
|
|
6
|
+
var t = s.trim();
|
|
7
|
+
if (!t) return true;
|
|
8
|
+
if (!/\d/.test(t)) return true;
|
|
9
|
+
if (t.replace(/[^\d.]/g, '') === '') return true;
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
// 只有两段数字之间出现非法字符时,才认为该字符串应走原样渲染
|
|
13
|
+
export function shouldRenderPriceAsRaw(s) {
|
|
14
|
+
if (hasNoExtractablePrice(s)) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
var t = s.trim();
|
|
18
|
+
var matches = Array.from(t.matchAll(RE_NUM));
|
|
19
|
+
if (matches.length < 2) return false;
|
|
20
|
+
var a = matches[0];
|
|
21
|
+
var b = matches[1];
|
|
22
|
+
var i0 = a.index;
|
|
23
|
+
var i1 = b.index;
|
|
24
|
+
var between = t.slice(i0 + a[0].length, i1);
|
|
25
|
+
return !PRICE_CHARS.test(between);
|
|
26
|
+
}
|
|
27
|
+
// 提供给 Price.raw 开关:调用方可用它判断整串是否包含非法字符
|
|
28
|
+
export function hasNonPriceChars(s) {
|
|
29
|
+
return !PRICE_CHARS.test(s);
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type TransitionStatus = 'entering' | 'entered' | 'exiting' | 'exited' | 'unmounted';
|
|
3
|
+
interface CSSTransitionProps {
|
|
4
|
+
in?: boolean;
|
|
5
|
+
timeout?: number;
|
|
6
|
+
classNames?: string;
|
|
7
|
+
nodeRef?: React.RefObject<any>;
|
|
8
|
+
mountOnEnter?: boolean;
|
|
9
|
+
unmountOnExit?: boolean;
|
|
10
|
+
onEntered?: () => void;
|
|
11
|
+
onExited?: () => void;
|
|
12
|
+
children: React.ReactElement;
|
|
13
|
+
}
|
|
14
|
+
declare const ConfigurableCSSTransition: React.FC<CSSTransitionProps>;
|
|
15
|
+
export default ConfigurableCSSTransition;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
|
|
2
|
+
import React, { useState, useEffect, useRef, cloneElement, useCallback } from "react";
|
|
3
|
+
var ConfigurableCSSTransition = function(props) {
|
|
4
|
+
var inPhase = props.in, _props_timeout = props.timeout, timeout = _props_timeout === void 0 ? 300 : _props_timeout, tmp = props.classNames, baseClassName = tmp === void 0 ? '' : tmp, nodeRef = props.nodeRef, mountOnEnter = props.mountOnEnter, unmountOnExit = props.unmountOnExit, onEntered = props.onEntered, onExited = props.onExited, children = props.children;
|
|
5
|
+
var _useState = _sliced_to_array(useState(function() {
|
|
6
|
+
if (inPhase) return 'entered';
|
|
7
|
+
return unmountOnExit || mountOnEnter ? 'unmounted' : 'exited';
|
|
8
|
+
}), 2), status = _useState[0], setStatus = _useState[1];
|
|
9
|
+
var _useState1 = _sliced_to_array(useState(function() {
|
|
10
|
+
if (inPhase) return "".concat(baseClassName, "-enter-done");
|
|
11
|
+
return "".concat(baseClassName, "-exit-done");
|
|
12
|
+
}), 2), classes = _useState1[0], setClasses = _useState1[1];
|
|
13
|
+
var timerRef = useRef(null);
|
|
14
|
+
var statusRef = useRef(status);
|
|
15
|
+
var prevInPhase = useRef(inPhase);
|
|
16
|
+
var updateStatus = useCallback(function(nextStatus) {
|
|
17
|
+
statusRef.current = nextStatus;
|
|
18
|
+
setStatus(nextStatus);
|
|
19
|
+
}, []);
|
|
20
|
+
var enter = useCallback(function() {
|
|
21
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
22
|
+
if (statusRef.current === 'unmounted') {
|
|
23
|
+
updateStatus('exited');
|
|
24
|
+
}
|
|
25
|
+
updateStatus('entering');
|
|
26
|
+
setClasses("".concat(baseClassName, "-enter ").concat(baseClassName, "-enter-active"));
|
|
27
|
+
timerRef.current = setTimeout(function() {
|
|
28
|
+
updateStatus('entered');
|
|
29
|
+
setClasses("".concat(baseClassName, "-enter-done"));
|
|
30
|
+
onEntered === null || onEntered === void 0 ? void 0 : onEntered();
|
|
31
|
+
}, timeout);
|
|
32
|
+
}, [
|
|
33
|
+
baseClassName,
|
|
34
|
+
onEntered,
|
|
35
|
+
timeout,
|
|
36
|
+
updateStatus
|
|
37
|
+
]);
|
|
38
|
+
var exit = useCallback(function() {
|
|
39
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
40
|
+
updateStatus('exiting');
|
|
41
|
+
setClasses("".concat(baseClassName, "-exit ").concat(baseClassName, "-exit-active"));
|
|
42
|
+
timerRef.current = setTimeout(function() {
|
|
43
|
+
updateStatus('exited');
|
|
44
|
+
setClasses("".concat(baseClassName, "-exit-done"));
|
|
45
|
+
if (unmountOnExit) {
|
|
46
|
+
updateStatus('unmounted');
|
|
47
|
+
}
|
|
48
|
+
onExited === null || onExited === void 0 ? void 0 : onExited();
|
|
49
|
+
}, timeout);
|
|
50
|
+
}, [
|
|
51
|
+
baseClassName,
|
|
52
|
+
onExited,
|
|
53
|
+
timeout,
|
|
54
|
+
unmountOnExit,
|
|
55
|
+
updateStatus
|
|
56
|
+
]);
|
|
57
|
+
useEffect(function() {
|
|
58
|
+
if (prevInPhase.current !== inPhase) {
|
|
59
|
+
if (inPhase) {
|
|
60
|
+
enter();
|
|
61
|
+
} else {
|
|
62
|
+
exit();
|
|
63
|
+
}
|
|
64
|
+
prevInPhase.current = inPhase;
|
|
65
|
+
}
|
|
66
|
+
return function() {
|
|
67
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
68
|
+
};
|
|
69
|
+
}, [
|
|
70
|
+
inPhase,
|
|
71
|
+
enter,
|
|
72
|
+
exit
|
|
73
|
+
]);
|
|
74
|
+
if (status === 'unmounted') return null;
|
|
75
|
+
return /*#__PURE__*/ cloneElement(children, {
|
|
76
|
+
className: "".concat(children.props.className || '', " ").concat(classes)
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
export default ConfigurableCSSTransition;
|
|
@@ -15,12 +15,10 @@ export function makeRect(width, height) {
|
|
|
15
15
|
height: height
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
export var getRectInMultiPlatform =
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
var _arguments = arguments;
|
|
18
|
+
export var getRectInMultiPlatform = function(element) {
|
|
19
|
+
var harmonyId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
|
|
20
|
+
return _async_to_generator(function() {
|
|
22
21
|
return _ts_generator(this, function(_state) {
|
|
23
|
-
harmonyId = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : '';
|
|
24
22
|
if (element) {
|
|
25
23
|
if (inBrowser) {
|
|
26
24
|
return [
|
|
@@ -36,7 +34,8 @@ export var getRectInMultiPlatform = /*#__PURE__*/ function() {
|
|
|
36
34
|
resolve(lru.get(element));
|
|
37
35
|
return;
|
|
38
36
|
}
|
|
39
|
-
createSelectorQuery()
|
|
37
|
+
createSelectorQuery()// https://taro.jd.com/docs/reference/config/page/
|
|
38
|
+
.in((element === null || element === void 0 ? void 0 : element._scope) || element).select("#".concat(harmonyId || element.uid)).boundingClientRect().exec(function(param) {
|
|
40
39
|
var _param = _sliced_to_array(param, 1), rects = _param[0];
|
|
41
40
|
if (rects) {
|
|
42
41
|
lru.set(element, rects);
|
|
@@ -51,18 +50,13 @@ export var getRectInMultiPlatform = /*#__PURE__*/ function() {
|
|
|
51
50
|
Promise.resolve(makeRect(0, 0))
|
|
52
51
|
];
|
|
53
52
|
});
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
return _ref.apply(this, arguments);
|
|
57
|
-
};
|
|
58
|
-
}();
|
|
53
|
+
})();
|
|
54
|
+
};
|
|
59
55
|
// 获取元素位置,不走缓存
|
|
60
|
-
export var getRectInMultiPlatformWithoutCache =
|
|
61
|
-
var
|
|
62
|
-
|
|
63
|
-
var _arguments = arguments;
|
|
56
|
+
export var getRectInMultiPlatformWithoutCache = function(element) {
|
|
57
|
+
var harmonyId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
|
|
58
|
+
return _async_to_generator(function() {
|
|
64
59
|
return _ts_generator(this, function(_state) {
|
|
65
|
-
harmonyId = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : '';
|
|
66
60
|
if (element) {
|
|
67
61
|
if (inBrowser) {
|
|
68
62
|
return [
|
|
@@ -73,7 +67,8 @@ export var getRectInMultiPlatformWithoutCache = /*#__PURE__*/ function() {
|
|
|
73
67
|
return [
|
|
74
68
|
2,
|
|
75
69
|
new Promise(function(resolve, reject) {
|
|
76
|
-
createSelectorQuery()
|
|
70
|
+
createSelectorQuery()// https://taro.jd.com/docs/reference/config/page/
|
|
71
|
+
.in((element === null || element === void 0 ? void 0 : element._scope) || element).select("#".concat(harmonyId || element.uid)).boundingClientRect().exec(function(param) {
|
|
77
72
|
var _param = _sliced_to_array(param, 1), rects = _param[0];
|
|
78
73
|
resolve(rects);
|
|
79
74
|
});
|
|
@@ -85,8 +80,5 @@ export var getRectInMultiPlatformWithoutCache = /*#__PURE__*/ function() {
|
|
|
85
80
|
Promise.resolve(makeRect(0, 0))
|
|
86
81
|
];
|
|
87
82
|
});
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
return _ref.apply(this, arguments);
|
|
91
|
-
};
|
|
92
|
-
}();
|
|
83
|
+
})();
|
|
84
|
+
};
|
|
@@ -14,9 +14,4 @@ export declare const getDeviceInfo: () => IDeviceInfo;
|
|
|
14
14
|
* @returns {Taro.getWindowInfo.Result} 窗口信息
|
|
15
15
|
*/
|
|
16
16
|
export declare const getWindowInfo: () => Taro.getWindowInfo.Result;
|
|
17
|
-
/**
|
|
18
|
-
* 获取应用基础信息,兼容新旧 API
|
|
19
|
-
* @returns {Taro.getAppBaseInfo.Result} 应用基础信息
|
|
20
|
-
*/
|
|
21
|
-
export declare const getAppBaseInfo: () => Taro.getAppBaseInfo.Result;
|
|
22
17
|
export {};
|
|
@@ -13,10 +13,11 @@ import Taro from "@tarojs/taro";
|
|
|
13
13
|
* @returns {Taro.getWindowInfo.Result} 窗口信息
|
|
14
14
|
*/ export var getWindowInfo = function() {
|
|
15
15
|
return typeof Taro.getWindowInfo === 'function' ? Taro.getWindowInfo() : Taro.getSystemInfoSync();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
16
|
+
} // /**
|
|
17
|
+
// * 获取应用基础信息,兼容新旧 API
|
|
18
|
+
// * @returns {Taro.getAppBaseInfo.Result} 应用基础信息
|
|
19
|
+
// */
|
|
20
|
+
// export const getAppBaseInfo = (): Taro.getAppBaseInfo.Result => {
|
|
21
|
+
// return canIUse('getAppBaseInfo') ? taroGetAppBaseInfo() : getSystemInfoSync()
|
|
22
|
+
// }
|
|
23
|
+
;
|