antd-mobile 5.14.3 → 5.16.0
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/2x/README.md +31 -18
- package/2x/bundle/antd-mobile.cjs.js +504 -348
- package/2x/bundle/antd-mobile.es.js +499 -343
- package/2x/bundle/style.css +75 -19
- package/2x/cjs/components/action-sheet/action-sheet.d.ts +2 -4
- package/2x/cjs/components/action-sheet/action-sheet.js +6 -2
- package/2x/cjs/components/badge/badge.css +1 -1
- package/2x/cjs/components/badge/badge.d.ts +2 -0
- package/2x/cjs/components/badge/badge.js +2 -1
- package/2x/cjs/components/button/button.d.ts +5 -1
- package/2x/cjs/components/cascader/cascader.d.ts +29 -4
- package/2x/cjs/components/cascader/cascader.js +41 -19
- package/2x/cjs/components/cascader/index.d.ts +21 -2
- package/2x/cjs/components/center-popup/center-popup.css +11 -0
- package/2x/cjs/components/center-popup/center-popup.d.ts +4 -20
- package/2x/cjs/components/center-popup/center-popup.js +27 -14
- package/2x/cjs/components/checkbox/checkbox.d.ts +22 -2
- package/2x/cjs/components/checkbox/checkbox.js +14 -4
- package/2x/cjs/components/checkbox/index.d.ts +17 -2
- package/2x/cjs/components/checkbox/native-input.js +10 -8
- package/2x/cjs/components/date-picker/date-picker-date-utils.js +12 -15
- package/2x/cjs/components/date-picker/date-picker-week-utils.js +12 -15
- package/2x/cjs/components/date-picker/date-picker.d.ts +7 -3
- package/2x/cjs/components/date-picker/date-picker.js +3 -1
- package/2x/cjs/components/date-picker/index.d.ts +6 -2
- package/2x/cjs/components/dialog/dialog.js +3 -1
- package/2x/cjs/components/dropdown/dropdown.d.ts +5 -1
- package/2x/cjs/components/dropdown/index.d.ts +5 -1
- package/2x/cjs/components/floating-panel/floating-panel.d.ts +5 -1
- package/2x/cjs/components/form/form-item.js +2 -4
- package/2x/cjs/components/form/form-subscribe.js +3 -9
- package/2x/cjs/components/form/form.d.ts +5 -1
- package/2x/cjs/components/form/index.d.ts +5 -1
- package/2x/cjs/components/index-bar/index-bar.d.ts +5 -1
- package/2x/cjs/components/index-bar/index.d.ts +5 -1
- package/2x/cjs/components/infinite-scroll/infinite-scroll.js +13 -5
- package/2x/cjs/components/input/input.css +4 -0
- package/2x/cjs/components/input/input.d.ts +11 -4
- package/2x/cjs/components/input/input.js +5 -1
- package/2x/cjs/components/list/index.d.ts +10 -2
- package/2x/cjs/components/list/list.css +3 -0
- package/2x/cjs/components/list/list.d.ts +14 -3
- package/2x/cjs/components/list/list.js +16 -6
- package/2x/cjs/components/modal/modal-action-button.d.ts +2 -2
- package/2x/cjs/components/modal/modal.css +0 -9
- package/2x/cjs/components/modal/modal.js +4 -11
- package/2x/cjs/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/2x/cjs/components/number-keyboard/number-keyboard.js +13 -7
- package/2x/cjs/components/passcode-input/passcode-input.d.ts +5 -1
- package/2x/cjs/components/picker/index.d.ts +10 -6
- package/2x/cjs/components/picker/picker.d.ts +6 -6
- package/2x/cjs/components/picker/picker.js +8 -7
- package/2x/cjs/components/picker-view/picker-view.css +1 -0
- package/2x/cjs/components/picker-view/wheel.js +10 -8
- package/2x/cjs/components/popover/index.d.ts +5 -1
- package/2x/cjs/components/popover/popover.d.ts +5 -1
- package/2x/cjs/components/popup/popup-base-props.d.ts +35 -0
- package/2x/cjs/components/popup/popup-base-props.js +18 -0
- package/2x/cjs/components/popup/popup.css +32 -0
- package/2x/cjs/components/popup/popup.d.ts +3 -19
- package/2x/cjs/components/popup/popup.js +43 -18
- package/2x/cjs/components/progress-bar/progress-bar.css +17 -3
- package/2x/cjs/components/progress-bar/progress-bar.d.ts +4 -2
- package/2x/cjs/components/progress-bar/progress-bar.js +27 -5
- package/2x/cjs/components/radio/radio.js +3 -3
- package/2x/cjs/components/rate/rate.css +2 -2
- package/2x/cjs/components/rate/rate.js +3 -3
- package/2x/cjs/components/rate/star.d.ts +2 -0
- package/2x/cjs/components/rate/star.js +37 -0
- package/2x/cjs/components/safe-area/safe-area.css +3 -2
- package/2x/cjs/components/search-bar/search-bar.d.ts +5 -1
- package/2x/cjs/components/slider/slider.js +2 -1
- package/2x/cjs/components/slider/thumb.d.ts +2 -1
- package/2x/cjs/components/slider/thumb.js +13 -1
- package/2x/cjs/components/stepper/stepper.js +14 -3
- package/2x/cjs/components/steps/steps.css +1 -1
- package/2x/cjs/components/swipe-action/swipe-action.d.ts +5 -1
- package/2x/cjs/components/swiper/index.d.ts +10 -2
- package/2x/cjs/components/swiper/swiper.d.ts +5 -1
- package/2x/cjs/components/switch/switch.js +10 -1
- package/2x/cjs/components/text-area/text-area.d.ts +6 -1
- package/2x/cjs/components/text-area/text-area.js +5 -0
- package/2x/cjs/components/toast/methods.js +32 -73
- package/2x/cjs/components/virtual-input/virtual-input.d.ts +5 -1
- package/2x/cjs/components/water-mark/water-mark.js +3 -2
- package/2x/cjs/global/global.css +0 -1
- package/2x/cjs/global/theme-default.css +0 -1
- package/2x/cjs/locales/base.d.ts +10 -0
- package/2x/cjs/locales/base.js +10 -0
- package/2x/cjs/locales/en-US.d.ts +10 -0
- package/2x/cjs/locales/es-ES.d.ts +10 -0
- package/2x/cjs/locales/fa-IR.d.ts +10 -0
- package/2x/cjs/locales/fr-FR.d.ts +10 -0
- package/2x/cjs/locales/id-ID.d.ts +118 -0
- package/2x/cjs/locales/id-ID.js +121 -0
- package/2x/cjs/locales/kk-KZ.d.ts +118 -0
- package/2x/cjs/locales/kk-KZ.js +124 -0
- package/2x/cjs/locales/ko-KR.d.ts +10 -0
- package/2x/cjs/locales/zh-CN.d.ts +10 -0
- package/2x/cjs/locales/zh-CN.js +10 -0
- package/2x/cjs/locales/zh-HK.d.ts +10 -0
- package/2x/cjs/locales/zh-TW.d.ts +10 -0
- package/2x/cjs/utils/native-props.d.ts +3 -3
- package/2x/cjs/utils/render-imperatively.d.ts +4 -1
- package/2x/cjs/utils/render-imperatively.js +23 -11
- package/2x/cjs/utils/use-props-value.js +2 -6
- package/2x/es/components/action-sheet/action-sheet.d.ts +2 -4
- package/2x/es/components/action-sheet/action-sheet.js +6 -2
- package/2x/es/components/badge/badge.css +1 -1
- package/2x/es/components/badge/badge.d.ts +2 -0
- package/2x/es/components/badge/badge.js +2 -1
- package/2x/es/components/button/button.d.ts +5 -1
- package/2x/es/components/cascader/cascader.d.ts +29 -4
- package/2x/es/components/cascader/cascader.js +42 -18
- package/2x/es/components/cascader/index.d.ts +21 -2
- package/2x/es/components/center-popup/center-popup.css +11 -0
- package/2x/es/components/center-popup/center-popup.d.ts +4 -20
- package/2x/es/components/center-popup/center-popup.js +25 -14
- package/2x/es/components/checkbox/checkbox.d.ts +22 -2
- package/2x/es/components/checkbox/checkbox.js +15 -3
- package/2x/es/components/checkbox/index.d.ts +17 -2
- package/2x/es/components/checkbox/native-input.js +9 -8
- package/2x/es/components/date-picker/date-picker-date-utils.js +12 -15
- package/2x/es/components/date-picker/date-picker-week-utils.js +12 -15
- package/2x/es/components/date-picker/date-picker.d.ts +7 -3
- package/2x/es/components/date-picker/date-picker.js +3 -1
- package/2x/es/components/date-picker/index.d.ts +6 -2
- package/2x/es/components/dialog/dialog.js +3 -1
- package/2x/es/components/dropdown/dropdown.d.ts +5 -1
- package/2x/es/components/dropdown/index.d.ts +5 -1
- package/2x/es/components/floating-panel/floating-panel.d.ts +5 -1
- package/2x/es/components/form/form-item.js +2 -2
- package/2x/es/components/form/form-subscribe.js +5 -8
- package/2x/es/components/form/form.d.ts +5 -1
- package/2x/es/components/form/index.d.ts +5 -1
- package/2x/es/components/index-bar/index-bar.d.ts +5 -1
- package/2x/es/components/index-bar/index.d.ts +5 -1
- package/2x/es/components/infinite-scroll/infinite-scroll.js +14 -6
- package/2x/es/components/input/input.css +4 -0
- package/2x/es/components/input/input.d.ts +11 -4
- package/2x/es/components/input/input.js +5 -1
- package/2x/es/components/list/index.d.ts +10 -2
- package/2x/es/components/list/list.css +3 -0
- package/2x/es/components/list/list.d.ts +14 -3
- package/2x/es/components/list/list.js +12 -4
- package/2x/es/components/modal/modal-action-button.d.ts +2 -2
- package/2x/es/components/modal/modal.css +0 -9
- package/2x/es/components/modal/modal.js +4 -10
- package/2x/es/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/2x/es/components/number-keyboard/number-keyboard.js +13 -7
- package/2x/es/components/passcode-input/passcode-input.d.ts +5 -1
- package/2x/es/components/picker/index.d.ts +10 -6
- package/2x/es/components/picker/picker.d.ts +6 -6
- package/2x/es/components/picker/picker.js +8 -6
- package/2x/es/components/picker-view/picker-view.css +1 -0
- package/2x/es/components/picker-view/wheel.js +10 -8
- package/2x/es/components/popover/index.d.ts +5 -1
- package/2x/es/components/popover/popover.d.ts +5 -1
- package/2x/es/components/popup/popup-base-props.d.ts +35 -0
- package/2x/es/components/popup/popup-base-props.js +11 -0
- package/2x/es/components/popup/popup.css +32 -0
- package/2x/es/components/popup/popup.d.ts +3 -19
- package/2x/es/components/popup/popup.js +41 -19
- package/2x/es/components/progress-bar/progress-bar.css +17 -3
- package/2x/es/components/progress-bar/progress-bar.d.ts +4 -2
- package/2x/es/components/progress-bar/progress-bar.js +25 -5
- package/2x/es/components/radio/radio.js +3 -3
- package/2x/es/components/rate/rate.css +2 -2
- package/2x/es/components/rate/rate.js +2 -2
- package/2x/es/components/rate/star.d.ts +2 -0
- package/2x/es/components/rate/star.js +25 -0
- package/2x/es/components/safe-area/safe-area.css +3 -2
- package/2x/es/components/search-bar/search-bar.d.ts +5 -1
- package/2x/es/components/slider/slider.js +2 -1
- package/2x/es/components/slider/thumb.d.ts +2 -1
- package/2x/es/components/slider/thumb.js +12 -1
- package/2x/es/components/stepper/stepper.js +13 -3
- package/2x/es/components/steps/steps.css +1 -1
- package/2x/es/components/swipe-action/swipe-action.d.ts +5 -1
- package/2x/es/components/swiper/index.d.ts +10 -2
- package/2x/es/components/swiper/swiper.d.ts +5 -1
- package/2x/es/components/switch/switch.js +9 -1
- package/2x/es/components/text-area/text-area.d.ts +6 -1
- package/2x/es/components/text-area/text-area.js +5 -0
- package/2x/es/components/toast/methods.js +29 -67
- package/2x/es/components/virtual-input/virtual-input.d.ts +5 -1
- package/2x/es/components/water-mark/water-mark.js +3 -2
- package/2x/es/global/global.css +0 -1
- package/2x/es/global/theme-default.css +0 -1
- package/2x/es/locales/base.d.ts +10 -0
- package/2x/es/locales/base.js +10 -0
- package/2x/es/locales/en-US.d.ts +10 -0
- package/2x/es/locales/es-ES.d.ts +10 -0
- package/2x/es/locales/fa-IR.d.ts +10 -0
- package/2x/es/locales/fr-FR.d.ts +10 -0
- package/2x/es/locales/id-ID.d.ts +118 -0
- package/2x/es/locales/id-ID.js +111 -0
- package/2x/es/locales/kk-KZ.d.ts +118 -0
- package/2x/es/locales/kk-KZ.js +114 -0
- package/2x/es/locales/ko-KR.d.ts +10 -0
- package/2x/es/locales/zh-CN.d.ts +10 -0
- package/2x/es/locales/zh-CN.js +10 -0
- package/2x/es/locales/zh-HK.d.ts +10 -0
- package/2x/es/locales/zh-TW.d.ts +10 -0
- package/2x/es/utils/native-props.d.ts +3 -3
- package/2x/es/utils/render-imperatively.d.ts +4 -1
- package/2x/es/utils/render-imperatively.js +23 -11
- package/2x/es/utils/use-props-value.js +2 -6
- package/2x/package.json +3 -3
- package/2x/umd/antd-mobile.js +1 -1
- package/README.md +31 -18
- package/bundle/antd-mobile.cjs.js +504 -348
- package/bundle/antd-mobile.es.js +499 -343
- package/bundle/style.css +65 -18
- package/cjs/components/action-sheet/action-sheet.d.ts +2 -4
- package/cjs/components/action-sheet/action-sheet.js +6 -2
- package/cjs/components/badge/badge.css +1 -1
- package/cjs/components/badge/badge.d.ts +2 -0
- package/cjs/components/badge/badge.js +2 -1
- package/cjs/components/button/button.d.ts +5 -1
- package/cjs/components/cascader/cascader.d.ts +29 -4
- package/cjs/components/cascader/cascader.js +41 -19
- package/cjs/components/cascader/index.d.ts +21 -2
- package/cjs/components/center-popup/center-popup.css +10 -0
- package/cjs/components/center-popup/center-popup.d.ts +4 -20
- package/cjs/components/center-popup/center-popup.js +27 -14
- package/cjs/components/checkbox/checkbox.d.ts +22 -2
- package/cjs/components/checkbox/checkbox.js +14 -4
- package/cjs/components/checkbox/index.d.ts +17 -2
- package/cjs/components/checkbox/native-input.js +10 -8
- package/cjs/components/date-picker/date-picker-date-utils.js +12 -15
- package/cjs/components/date-picker/date-picker-week-utils.js +12 -15
- package/cjs/components/date-picker/date-picker.d.ts +7 -3
- package/cjs/components/date-picker/date-picker.js +3 -1
- package/cjs/components/date-picker/index.d.ts +6 -2
- package/cjs/components/dialog/dialog.js +3 -1
- package/cjs/components/dropdown/dropdown.d.ts +5 -1
- package/cjs/components/dropdown/index.d.ts +5 -1
- package/cjs/components/floating-panel/floating-panel.d.ts +5 -1
- package/cjs/components/form/form-item.js +2 -4
- package/cjs/components/form/form-subscribe.js +3 -9
- package/cjs/components/form/form.d.ts +5 -1
- package/cjs/components/form/index.d.ts +5 -1
- package/cjs/components/index-bar/index-bar.d.ts +5 -1
- package/cjs/components/index-bar/index.d.ts +5 -1
- package/cjs/components/infinite-scroll/infinite-scroll.js +13 -5
- package/cjs/components/input/input.css +3 -0
- package/cjs/components/input/input.d.ts +11 -4
- package/cjs/components/input/input.js +5 -1
- package/cjs/components/list/index.d.ts +10 -2
- package/cjs/components/list/list.css +3 -0
- package/cjs/components/list/list.d.ts +14 -3
- package/cjs/components/list/list.js +16 -6
- package/cjs/components/modal/modal-action-button.d.ts +2 -2
- package/cjs/components/modal/modal.css +0 -8
- package/cjs/components/modal/modal.js +4 -11
- package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/cjs/components/number-keyboard/number-keyboard.js +13 -7
- package/cjs/components/passcode-input/passcode-input.d.ts +5 -1
- package/cjs/components/picker/index.d.ts +10 -6
- package/cjs/components/picker/picker.d.ts +6 -6
- package/cjs/components/picker/picker.js +8 -7
- package/cjs/components/picker-view/picker-view.css +1 -0
- package/cjs/components/picker-view/wheel.js +10 -8
- package/cjs/components/popover/index.d.ts +5 -1
- package/cjs/components/popover/popover.d.ts +5 -1
- package/cjs/components/popup/popup-base-props.d.ts +35 -0
- package/cjs/components/popup/popup-base-props.js +18 -0
- package/cjs/components/popup/popup.css +26 -0
- package/cjs/components/popup/popup.d.ts +3 -19
- package/cjs/components/popup/popup.js +43 -18
- package/cjs/components/progress-bar/progress-bar.css +15 -3
- package/cjs/components/progress-bar/progress-bar.d.ts +4 -2
- package/cjs/components/progress-bar/progress-bar.js +27 -5
- package/cjs/components/radio/radio.js +3 -3
- package/cjs/components/rate/rate.css +2 -2
- package/cjs/components/rate/rate.js +3 -3
- package/cjs/components/rate/star.d.ts +2 -0
- package/cjs/components/rate/star.js +37 -0
- package/cjs/components/safe-area/safe-area.css +3 -2
- package/cjs/components/search-bar/search-bar.d.ts +5 -1
- package/cjs/components/slider/slider.js +2 -1
- package/cjs/components/slider/thumb.d.ts +2 -1
- package/cjs/components/slider/thumb.js +13 -1
- package/cjs/components/stepper/stepper.js +14 -3
- package/cjs/components/steps/steps.css +1 -1
- package/cjs/components/swipe-action/swipe-action.d.ts +5 -1
- package/cjs/components/swiper/index.d.ts +10 -2
- package/cjs/components/swiper/swiper.d.ts +5 -1
- package/cjs/components/switch/switch.js +10 -1
- package/cjs/components/text-area/text-area.d.ts +6 -1
- package/cjs/components/text-area/text-area.js +5 -0
- package/cjs/components/toast/methods.js +32 -73
- package/cjs/components/virtual-input/virtual-input.d.ts +5 -1
- package/cjs/components/water-mark/water-mark.js +3 -2
- package/cjs/global/global.css +0 -1
- package/cjs/global/theme-default.css +0 -1
- package/cjs/locales/base.d.ts +10 -0
- package/cjs/locales/base.js +10 -0
- package/cjs/locales/en-US.d.ts +10 -0
- package/cjs/locales/es-ES.d.ts +10 -0
- package/cjs/locales/fa-IR.d.ts +10 -0
- package/cjs/locales/fr-FR.d.ts +10 -0
- package/cjs/locales/id-ID.d.ts +118 -0
- package/cjs/locales/id-ID.js +121 -0
- package/cjs/locales/kk-KZ.d.ts +118 -0
- package/cjs/locales/kk-KZ.js +124 -0
- package/cjs/locales/ko-KR.d.ts +10 -0
- package/cjs/locales/zh-CN.d.ts +10 -0
- package/cjs/locales/zh-CN.js +10 -0
- package/cjs/locales/zh-HK.d.ts +10 -0
- package/cjs/locales/zh-TW.d.ts +10 -0
- package/cjs/utils/native-props.d.ts +3 -3
- package/cjs/utils/render-imperatively.d.ts +4 -1
- package/cjs/utils/render-imperatively.js +23 -11
- package/cjs/utils/use-props-value.js +2 -6
- package/es/components/action-sheet/action-sheet.d.ts +2 -4
- package/es/components/action-sheet/action-sheet.js +6 -2
- package/es/components/badge/badge.css +1 -1
- package/es/components/badge/badge.d.ts +2 -0
- package/es/components/badge/badge.js +2 -1
- package/es/components/button/button.d.ts +5 -1
- package/es/components/cascader/cascader.d.ts +29 -4
- package/es/components/cascader/cascader.js +42 -18
- package/es/components/cascader/index.d.ts +21 -2
- package/es/components/center-popup/center-popup.css +10 -0
- package/es/components/center-popup/center-popup.d.ts +4 -20
- package/es/components/center-popup/center-popup.js +25 -14
- package/es/components/checkbox/checkbox.d.ts +22 -2
- package/es/components/checkbox/checkbox.js +15 -3
- package/es/components/checkbox/index.d.ts +17 -2
- package/es/components/checkbox/native-input.js +9 -8
- package/es/components/date-picker/date-picker-date-utils.js +12 -15
- package/es/components/date-picker/date-picker-week-utils.js +12 -15
- package/es/components/date-picker/date-picker.d.ts +7 -3
- package/es/components/date-picker/date-picker.js +3 -1
- package/es/components/date-picker/index.d.ts +6 -2
- package/es/components/dialog/dialog.js +3 -1
- package/es/components/dropdown/dropdown.d.ts +5 -1
- package/es/components/dropdown/index.d.ts +5 -1
- package/es/components/floating-panel/floating-panel.d.ts +5 -1
- package/es/components/form/form-item.js +2 -2
- package/es/components/form/form-subscribe.js +5 -8
- package/es/components/form/form.d.ts +5 -1
- package/es/components/form/index.d.ts +5 -1
- package/es/components/index-bar/index-bar.d.ts +5 -1
- package/es/components/index-bar/index.d.ts +5 -1
- package/es/components/infinite-scroll/infinite-scroll.js +14 -6
- package/es/components/input/input.css +3 -0
- package/es/components/input/input.d.ts +11 -4
- package/es/components/input/input.js +5 -1
- package/es/components/list/index.d.ts +10 -2
- package/es/components/list/list.css +3 -0
- package/es/components/list/list.d.ts +14 -3
- package/es/components/list/list.js +12 -4
- package/es/components/modal/modal-action-button.d.ts +2 -2
- package/es/components/modal/modal.css +0 -8
- package/es/components/modal/modal.js +4 -10
- package/es/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/es/components/number-keyboard/number-keyboard.js +13 -7
- package/es/components/passcode-input/passcode-input.d.ts +5 -1
- package/es/components/picker/index.d.ts +10 -6
- package/es/components/picker/picker.d.ts +6 -6
- package/es/components/picker/picker.js +8 -6
- package/es/components/picker-view/picker-view.css +1 -0
- package/es/components/picker-view/wheel.js +10 -8
- package/es/components/popover/index.d.ts +5 -1
- package/es/components/popover/popover.d.ts +5 -1
- package/es/components/popup/popup-base-props.d.ts +35 -0
- package/es/components/popup/popup-base-props.js +11 -0
- package/es/components/popup/popup.css +26 -0
- package/es/components/popup/popup.d.ts +3 -19
- package/es/components/popup/popup.js +41 -19
- package/es/components/progress-bar/progress-bar.css +15 -3
- package/es/components/progress-bar/progress-bar.d.ts +4 -2
- package/es/components/progress-bar/progress-bar.js +25 -5
- package/es/components/radio/radio.js +3 -3
- package/es/components/rate/rate.css +2 -2
- package/es/components/rate/rate.js +2 -2
- package/es/components/rate/star.d.ts +2 -0
- package/es/components/rate/star.js +25 -0
- package/es/components/safe-area/safe-area.css +3 -2
- package/es/components/search-bar/search-bar.d.ts +5 -1
- package/es/components/slider/slider.js +2 -1
- package/es/components/slider/thumb.d.ts +2 -1
- package/es/components/slider/thumb.js +12 -1
- package/es/components/stepper/stepper.js +13 -3
- package/es/components/steps/steps.css +1 -1
- package/es/components/swipe-action/swipe-action.d.ts +5 -1
- package/es/components/swiper/index.d.ts +10 -2
- package/es/components/swiper/swiper.d.ts +5 -1
- package/es/components/switch/switch.js +9 -1
- package/es/components/text-area/text-area.d.ts +6 -1
- package/es/components/text-area/text-area.js +5 -0
- package/es/components/toast/methods.js +29 -67
- package/es/components/virtual-input/virtual-input.d.ts +5 -1
- package/es/components/water-mark/water-mark.js +3 -2
- package/es/global/global.css +0 -1
- package/es/global/theme-default.css +0 -1
- package/es/locales/base.d.ts +10 -0
- package/es/locales/base.js +10 -0
- package/es/locales/en-US.d.ts +10 -0
- package/es/locales/es-ES.d.ts +10 -0
- package/es/locales/fa-IR.d.ts +10 -0
- package/es/locales/fr-FR.d.ts +10 -0
- package/es/locales/id-ID.d.ts +118 -0
- package/es/locales/id-ID.js +111 -0
- package/es/locales/kk-KZ.d.ts +118 -0
- package/es/locales/kk-KZ.js +114 -0
- package/es/locales/ko-KR.d.ts +10 -0
- package/es/locales/zh-CN.d.ts +10 -0
- package/es/locales/zh-CN.js +10 -0
- package/es/locales/zh-HK.d.ts +10 -0
- package/es/locales/zh-TW.d.ts +10 -0
- package/es/utils/native-props.d.ts +3 -3
- package/es/utils/render-imperatively.d.ts +4 -1
- package/es/utils/render-imperatively.js +23 -11
- package/es/utils/use-props-value.js +2 -6
- package/package.json +3 -3
- package/umd/antd-mobile.js +1 -1
- package/2x/cjs/components/form/form-imperative-item.d.ts +0 -5
- package/2x/cjs/components/form/form-imperative-item.js +0 -57
- package/2x/es/components/form/form-imperative-item.d.ts +0 -5
- package/2x/es/components/form/form-imperative-item.js +0 -38
- package/cjs/components/form/form-imperative-item.d.ts +0 -5
- package/cjs/components/form/form-imperative-item.js +0 -57
- package/es/components/form/form-imperative-item.d.ts +0 -5
- package/es/components/form/form-imperative-item.js +0 -38
|
@@ -11,25 +11,47 @@ var _nativeProps = require("../../utils/native-props");
|
|
|
11
11
|
|
|
12
12
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
13
13
|
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
16
|
+
var _isNodeWithContent = require("../../utils/is-node-with-content");
|
|
17
|
+
|
|
14
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
19
|
|
|
16
20
|
const classPrefix = `adm-progress-bar`;
|
|
21
|
+
const defaultProps = {
|
|
22
|
+
percent: 0,
|
|
23
|
+
rounded: true,
|
|
24
|
+
text: false
|
|
25
|
+
};
|
|
17
26
|
|
|
18
27
|
const ProgressBar = p => {
|
|
19
|
-
const props = (0, _withDefaultProps.mergeProps)(
|
|
20
|
-
percent: 0
|
|
21
|
-
}, p);
|
|
28
|
+
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
22
29
|
const fillStyle = {
|
|
23
30
|
width: `${props.percent}%`
|
|
24
31
|
};
|
|
32
|
+
|
|
33
|
+
const textElement = function () {
|
|
34
|
+
if (props.text === true) {
|
|
35
|
+
return `${props.percent}%`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (typeof props.text === 'function') {
|
|
39
|
+
return props.text(props.percent);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return props.text;
|
|
43
|
+
}();
|
|
44
|
+
|
|
25
45
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
26
|
-
className: classPrefix
|
|
46
|
+
className: (0, _classnames.default)(classPrefix, props.rounded && `${classPrefix}-rounded`)
|
|
27
47
|
}, _react.default.createElement("div", {
|
|
28
48
|
className: `${classPrefix}-trail`
|
|
29
49
|
}, _react.default.createElement("div", {
|
|
30
50
|
className: `${classPrefix}-fill`,
|
|
31
51
|
style: fillStyle
|
|
32
|
-
}))))
|
|
52
|
+
})), (0, _isNodeWithContent.isNodeWithContent)(textElement) && _react.default.createElement("div", {
|
|
53
|
+
className: `${classPrefix}-text`
|
|
54
|
+
}, textElement)));
|
|
33
55
|
};
|
|
34
56
|
|
|
35
57
|
exports.ProgressBar = ProgressBar;
|
|
@@ -62,16 +62,16 @@ const Radio = p => {
|
|
|
62
62
|
|
|
63
63
|
checked = groupContext.value.includes(value);
|
|
64
64
|
|
|
65
|
-
setChecked =
|
|
65
|
+
setChecked = innerChecked => {
|
|
66
66
|
var _a;
|
|
67
67
|
|
|
68
|
-
if (
|
|
68
|
+
if (innerChecked) {
|
|
69
69
|
groupContext.check(value);
|
|
70
70
|
} else {
|
|
71
71
|
groupContext.uncheck(value);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props,
|
|
74
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, innerChecked);
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
disabled = disabled || groupContext.disabled;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.adm-rate {
|
|
2
2
|
--star-size: 48px;
|
|
3
3
|
--active-color: #ffd21e;
|
|
4
|
-
--inactive-color: var(--adm-color-
|
|
4
|
+
--inactive-color: var(--adm-color-border);
|
|
5
5
|
display: inline-flex;
|
|
6
6
|
}
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.adm-rate-star {
|
|
13
|
-
padding:
|
|
13
|
+
padding: 0.125em;
|
|
14
14
|
line-height: var(--star-size);
|
|
15
15
|
font-size: var(--star-size);
|
|
16
16
|
color: var(--inactive-color);
|
|
@@ -13,17 +13,17 @@ var _nativeProps = require("../../utils/native-props");
|
|
|
13
13
|
|
|
14
14
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
15
15
|
|
|
16
|
-
var _antdMobileIcons = require("antd-mobile-icons");
|
|
17
|
-
|
|
18
16
|
var _usePropsValue = require("../../utils/use-props-value");
|
|
19
17
|
|
|
18
|
+
var _star = require("./star");
|
|
19
|
+
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
22
22
|
const classPrefix = `adm-rate`;
|
|
23
23
|
const defaultProps = {
|
|
24
24
|
count: 5,
|
|
25
25
|
allowHalf: false,
|
|
26
|
-
character: _react.default.createElement(
|
|
26
|
+
character: _react.default.createElement(_star.Star, null),
|
|
27
27
|
defaultValue: 0,
|
|
28
28
|
readOnly: false,
|
|
29
29
|
allowClear: true
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Star = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const Star = () => {
|
|
13
|
+
// return (
|
|
14
|
+
// <svg height='1em' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'>
|
|
15
|
+
// <title>{'star-fill\u5907\u4EFD 71'}</title>
|
|
16
|
+
// <path
|
|
17
|
+
// d='m24 36-10.52 5.53a2 2 0 0 1-2.902-2.108l2.01-11.714-8.511-8.296a2 2 0 0 1 1.108-3.411l11.762-1.71 5.26-10.657a2 2 0 0 1 3.586 0l5.26 10.658L42.815 16a2 2 0 0 1 1.108 3.411l-8.51 8.296 2.009 11.714a2 2 0 0 1-2.902 2.109L24 36Z'
|
|
18
|
+
// fill='#E5E5E5'
|
|
19
|
+
// fillRule='evenodd'
|
|
20
|
+
// />
|
|
21
|
+
// </svg>
|
|
22
|
+
// )
|
|
23
|
+
return _react.default.createElement("svg", {
|
|
24
|
+
viewBox: '0 0 42 40',
|
|
25
|
+
height: '1em',
|
|
26
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
27
|
+
style: {
|
|
28
|
+
verticalAlign: '-0.125em'
|
|
29
|
+
}
|
|
30
|
+
}, _react.default.createElement("path", {
|
|
31
|
+
d: 'm21 34-10.52 5.53a2 2 0 0 1-2.902-2.108l2.01-11.714-8.511-8.296a2 2 0 0 1 1.108-3.411l11.762-1.71 5.26-10.657a2 2 0 0 1 3.586 0l5.26 10.658L39.815 14a2 2 0 0 1 1.108 3.411l-8.51 8.296 2.009 11.714a2 2 0 0 1-2.902 2.109L21 34Z',
|
|
32
|
+
fill: 'currentColor',
|
|
33
|
+
fillRule: 'evenodd'
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.Star = Star;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
.adm-safe-area {
|
|
2
|
+
--multiple: var(--adm-safe-area-multiple, 1);
|
|
2
3
|
display: block;
|
|
3
4
|
width: 100%;
|
|
4
5
|
}
|
|
5
6
|
|
|
6
7
|
.adm-safe-area-position-top {
|
|
7
|
-
padding-top: calc(env(safe-area-inset-top) * var(--
|
|
8
|
+
padding-top: calc(env(safe-area-inset-top) * var(--multiple));
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
.adm-safe-area-position-bottom {
|
|
11
|
-
padding-bottom: calc(env(safe-area-inset-bottom) * var(--
|
|
12
|
+
padding-bottom: calc(env(safe-area-inset-bottom) * var(--multiple));
|
|
12
13
|
}
|
|
@@ -31,4 +31,8 @@ export declare const SearchBar: React.ForwardRefExoticComponent<Pick<InputProps,
|
|
|
31
31
|
onSearch?: ((val: string) => void) | undefined;
|
|
32
32
|
onChange?: ((val: string) => void) | undefined;
|
|
33
33
|
onCancel?: (() => void) | undefined;
|
|
34
|
-
} &
|
|
34
|
+
} & {
|
|
35
|
+
className?: string | undefined;
|
|
36
|
+
style?: (React.CSSProperties & Partial<Record<"--height" | "--border-radius" | "--padding-left" | "--background" | "--placeholder-color", string>>) | undefined;
|
|
37
|
+
tabIndex?: number | undefined;
|
|
38
|
+
} & React.AriaAttributes & React.RefAttributes<InputRef>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { FC, RefObject, ReactNode } from 'react';
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
2
3
|
declare type ThumbProps = {
|
|
3
4
|
value: number;
|
|
4
5
|
min: number;
|
|
@@ -8,6 +9,6 @@ declare type ThumbProps = {
|
|
|
8
9
|
trackRef: RefObject<HTMLDivElement>;
|
|
9
10
|
icon?: React.ReactNode;
|
|
10
11
|
popover: boolean | ((value: number) => ReactNode);
|
|
11
|
-
};
|
|
12
|
+
} & NativeProps;
|
|
12
13
|
declare const Thumb: FC<ThumbProps>;
|
|
13
14
|
export default Thumb;
|
|
@@ -13,6 +13,8 @@ var _thumbIcon = require("./thumb-icon");
|
|
|
13
13
|
|
|
14
14
|
var _popover = require("../popover/popover");
|
|
15
15
|
|
|
16
|
+
var _configProvider = require("../config-provider");
|
|
17
|
+
|
|
16
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
19
|
|
|
18
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -29,6 +31,9 @@ const Thumb = props => {
|
|
|
29
31
|
icon
|
|
30
32
|
} = props;
|
|
31
33
|
const prevValue = (0, _react.useRef)(value);
|
|
34
|
+
const {
|
|
35
|
+
locale
|
|
36
|
+
} = (0, _configProvider.useConfig)();
|
|
32
37
|
|
|
33
38
|
const currentPosition = () => {
|
|
34
39
|
return {
|
|
@@ -70,7 +75,14 @@ const Thumb = props => {
|
|
|
70
75
|
return _react.default.createElement("div", Object.assign({
|
|
71
76
|
className: `${classPrefix}-thumb-container`,
|
|
72
77
|
style: currentPosition()
|
|
73
|
-
}, bind()
|
|
78
|
+
}, bind(), {
|
|
79
|
+
role: 'slider',
|
|
80
|
+
"aria-label": props['aria-label'] || locale.Slider.name,
|
|
81
|
+
"aria-valuemax": max,
|
|
82
|
+
"aria-valuemin": min,
|
|
83
|
+
"aria-valuenow": value,
|
|
84
|
+
"aria-disabled": disabled
|
|
85
|
+
}), renderPopoverContent ? _react.default.createElement(_popover.Popover, {
|
|
74
86
|
content: renderPopoverContent(value),
|
|
75
87
|
placement: 'top',
|
|
76
88
|
visible: dragging,
|
|
@@ -25,6 +25,8 @@ var _button = _interopRequireDefault(require("../button"));
|
|
|
25
25
|
|
|
26
26
|
var _big = _interopRequireDefault(require("big.js"));
|
|
27
27
|
|
|
28
|
+
var _configProvider = require("../config-provider");
|
|
29
|
+
|
|
28
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
31
|
|
|
30
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -48,6 +50,9 @@ const Stepper = p => {
|
|
|
48
50
|
min,
|
|
49
51
|
inputReadOnly
|
|
50
52
|
} = props;
|
|
53
|
+
const {
|
|
54
|
+
locale
|
|
55
|
+
} = (0, _configProvider.useConfig)();
|
|
51
56
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
|
|
52
57
|
const [inputValue, setInputValue] = (0, _react.useState)(() => convertValueToText(value, props.digits));
|
|
53
58
|
|
|
@@ -129,7 +134,8 @@ const Stepper = p => {
|
|
|
129
134
|
disabled: minusDisabled(),
|
|
130
135
|
fill: 'none',
|
|
131
136
|
shape: 'rectangular',
|
|
132
|
-
color: 'primary'
|
|
137
|
+
color: 'primary',
|
|
138
|
+
"aria-label": locale.Stepper.decrease
|
|
133
139
|
}, _react.default.createElement(_antdMobileIcons.MinusOutline, null)), _react.default.createElement("div", {
|
|
134
140
|
className: `${classPrefix}-middle`
|
|
135
141
|
}, _react.default.createElement(_input.default, {
|
|
@@ -151,14 +157,19 @@ const Stepper = p => {
|
|
|
151
157
|
setHasFocus(false);
|
|
152
158
|
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
153
159
|
},
|
|
154
|
-
readOnly: inputReadOnly
|
|
160
|
+
readOnly: inputReadOnly,
|
|
161
|
+
role: 'spinbutton',
|
|
162
|
+
"aria-valuenow": Number(inputValue),
|
|
163
|
+
"aria-valuemax": max,
|
|
164
|
+
"aria-valuemin": min
|
|
155
165
|
})), _react.default.createElement(_button.default, {
|
|
156
166
|
className: `${classPrefix}-plus`,
|
|
157
167
|
onClick: handlePlus,
|
|
158
168
|
disabled: plusDisabled(),
|
|
159
169
|
fill: 'none',
|
|
160
170
|
shape: 'rectangular',
|
|
161
|
-
color: 'primary'
|
|
171
|
+
color: 'primary',
|
|
172
|
+
"aria-label": locale.Stepper.increase
|
|
162
173
|
}, _react.default.createElement(_antdMobileIcons.AddOutline, null))));
|
|
163
174
|
};
|
|
164
175
|
|
|
@@ -29,5 +29,9 @@ export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
|
29
29
|
closeOnAction?: boolean | undefined;
|
|
30
30
|
children: ReactNode;
|
|
31
31
|
stopPropagation?: "click"[] | undefined;
|
|
32
|
-
} &
|
|
32
|
+
} & {
|
|
33
|
+
className?: string | undefined;
|
|
34
|
+
style?: (React.CSSProperties & Partial<Record<"--background", string>>) | undefined;
|
|
35
|
+
tabIndex?: number | undefined;
|
|
36
|
+
} & React.AriaAttributes & React.RefAttributes<SwipeActionRef>>;
|
|
33
37
|
export {};
|
|
@@ -16,10 +16,18 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
16
16
|
stuckAtBoundary?: boolean | undefined;
|
|
17
17
|
rubberband?: boolean | undefined;
|
|
18
18
|
children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | undefined;
|
|
19
|
-
} &
|
|
19
|
+
} & {
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
style?: (import("react").CSSProperties & Partial<Record<"--width" | "--height" | "--border-radius" | "--track-padding", string>>) | undefined;
|
|
22
|
+
tabIndex?: number | undefined;
|
|
23
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./swiper").SwiperRef>> & {
|
|
20
24
|
Item: import("react").FC<{
|
|
21
25
|
onClick?: ((e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
22
26
|
children?: import("react").ReactNode;
|
|
23
|
-
} &
|
|
27
|
+
} & {
|
|
28
|
+
className?: string | undefined;
|
|
29
|
+
style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
30
|
+
tabIndex?: number | undefined;
|
|
31
|
+
} & import("react").AriaAttributes>;
|
|
24
32
|
};
|
|
25
33
|
export default _default;
|
|
@@ -37,4 +37,8 @@ export declare const Swiper: React.ForwardRefExoticComponent<{
|
|
|
37
37
|
stuckAtBoundary?: boolean | undefined;
|
|
38
38
|
rubberband?: boolean | undefined;
|
|
39
39
|
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
40
|
-
} &
|
|
40
|
+
} & {
|
|
41
|
+
className?: string | undefined;
|
|
42
|
+
style?: (React.CSSProperties & Partial<Record<"--width" | "--height" | "--border-radius" | "--track-padding", string>>) | undefined;
|
|
43
|
+
tabIndex?: number | undefined;
|
|
44
|
+
} & React.AriaAttributes & React.RefAttributes<SwiperRef>>;
|
|
@@ -19,6 +19,8 @@ var _withDefaultProps = require("../../utils/with-default-props");
|
|
|
19
19
|
|
|
20
20
|
var _spinIcon = require("./spin-icon");
|
|
21
21
|
|
|
22
|
+
var _configProvider = require("../config-provider");
|
|
23
|
+
|
|
22
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
25
|
|
|
24
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -34,6 +36,9 @@ const Switch = p => {
|
|
|
34
36
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
35
37
|
const disabled = props.disabled || props.loading || false;
|
|
36
38
|
const [changing, setChanging] = (0, _react.useState)(false);
|
|
39
|
+
const {
|
|
40
|
+
locale
|
|
41
|
+
} = (0, _configProvider.useConfig)();
|
|
37
42
|
const [checked, setChecked] = (0, _usePropsValue.usePropsValue)({
|
|
38
43
|
value: props.checked,
|
|
39
44
|
defaultValue: props.defaultChecked,
|
|
@@ -70,7 +75,11 @@ const Switch = p => {
|
|
|
70
75
|
className: (0, _classnames.default)(classPrefix, {
|
|
71
76
|
[`${classPrefix}-checked`]: checked,
|
|
72
77
|
[`${classPrefix}-disabled`]: disabled || changing
|
|
73
|
-
})
|
|
78
|
+
}),
|
|
79
|
+
role: 'switch',
|
|
80
|
+
"aria-label": locale.Switch.name,
|
|
81
|
+
"aria-checked": checked,
|
|
82
|
+
"aria-disabled": disabled
|
|
74
83
|
}, _react.default.createElement("div", {
|
|
75
84
|
className: `${classPrefix}-checkbox`
|
|
76
85
|
}, _react.default.createElement("div", {
|
|
@@ -19,6 +19,7 @@ export declare type TextAreaRef = {
|
|
|
19
19
|
clear: () => void;
|
|
20
20
|
focus: () => void;
|
|
21
21
|
blur: () => void;
|
|
22
|
+
nativeElement: HTMLTextAreaElement | null;
|
|
22
23
|
};
|
|
23
24
|
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "name" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
|
|
24
25
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -33,4 +34,8 @@ export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.Detail
|
|
|
33
34
|
maxRows?: number | undefined;
|
|
34
35
|
} | undefined;
|
|
35
36
|
id?: string | undefined;
|
|
36
|
-
} &
|
|
37
|
+
} & {
|
|
38
|
+
className?: string | undefined;
|
|
39
|
+
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--count-text-align", string>>) | undefined;
|
|
40
|
+
tabIndex?: number | undefined;
|
|
41
|
+
} & React.AriaAttributes & React.RefAttributes<TextAreaRef>>;
|
|
@@ -57,7 +57,12 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
57
57
|
var _a;
|
|
58
58
|
|
|
59
59
|
(_a = nativeTextAreaRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
get nativeElement() {
|
|
63
|
+
return nativeTextAreaRef.current;
|
|
60
64
|
}
|
|
65
|
+
|
|
61
66
|
}));
|
|
62
67
|
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
63
68
|
if (!autoSize) return;
|
|
@@ -7,100 +7,59 @@ exports.clear = clear;
|
|
|
7
7
|
exports.config = config;
|
|
8
8
|
exports.show = show;
|
|
9
9
|
|
|
10
|
-
var _react =
|
|
11
|
-
|
|
12
|
-
var _getContainer = require("../../utils/get-container");
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
11
|
|
|
14
12
|
var _toast = require("./toast");
|
|
15
13
|
|
|
16
14
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
17
15
|
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
-
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
var _renderImperatively = require("../../utils/render-imperatively");
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function unmount(container) {
|
|
27
|
-
const unmountResult = (0, _render.unmount)(container);
|
|
28
|
-
|
|
29
|
-
if (unmountResult && container.parentNode) {
|
|
30
|
-
container.parentNode.removeChild(container);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
19
|
|
|
20
|
+
let currentHandler = null;
|
|
21
|
+
let currentTimeout = null;
|
|
34
22
|
const defaultProps = {
|
|
35
23
|
duration: 2000,
|
|
36
24
|
position: 'center',
|
|
37
25
|
maskClickable: true
|
|
38
26
|
};
|
|
39
27
|
|
|
28
|
+
const ToastInner = props => _react.default.createElement(_toast.InternalToast, Object.assign({}, props));
|
|
29
|
+
|
|
40
30
|
function show(p) {
|
|
41
31
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, typeof p === 'string' ? {
|
|
42
32
|
content: p
|
|
43
33
|
} : p);
|
|
44
|
-
|
|
45
|
-
const {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const container = document.createElement('div');
|
|
49
|
-
const bodyContainer = (0, _getContainer.resolveContainer)(getContainer);
|
|
50
|
-
bodyContainer.appendChild(container);
|
|
51
|
-
clear();
|
|
52
|
-
containers.push(container);
|
|
53
|
-
const TempToast = (0, _react.forwardRef)((_, ref) => {
|
|
54
|
-
const [visible, setVisible] = (0, _react.useState)(true);
|
|
55
|
-
(0, _react.useEffect)(() => {
|
|
56
|
-
return () => {
|
|
57
|
-
var _a;
|
|
58
|
-
|
|
59
|
-
(_a = props.afterClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
60
|
-
};
|
|
61
|
-
}, []);
|
|
62
|
-
(0, _react.useEffect)(() => {
|
|
63
|
-
if (props.duration === 0) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
timer = window.setTimeout(() => {
|
|
68
|
-
setVisible(false);
|
|
69
|
-
}, props.duration);
|
|
70
|
-
return () => {
|
|
71
|
-
window.clearTimeout(timer);
|
|
72
|
-
};
|
|
73
|
-
}, []);
|
|
74
|
-
(0, _react.useImperativeHandle)(ref, () => ({
|
|
75
|
-
close: () => setVisible(false)
|
|
76
|
-
}));
|
|
77
|
-
return _react.default.createElement(_toast.InternalToast, Object.assign({}, props, {
|
|
78
|
-
getContainer: () => container,
|
|
79
|
-
visible: visible,
|
|
80
|
-
afterClose: () => {
|
|
81
|
-
unmount(container);
|
|
82
|
-
}
|
|
83
|
-
}));
|
|
84
|
-
});
|
|
85
|
-
const ref = (0, _react.createRef)();
|
|
86
|
-
(0, _render.render)(_react.default.createElement(TempToast, {
|
|
87
|
-
ref: ref
|
|
88
|
-
}), container);
|
|
89
|
-
return {
|
|
90
|
-
close: () => {
|
|
91
|
-
var _a;
|
|
92
|
-
|
|
93
|
-
(_a = ref.current) === null || _a === void 0 ? void 0 : _a.close();
|
|
34
|
+
|
|
35
|
+
const element = _react.default.createElement(ToastInner, Object.assign({}, props, {
|
|
36
|
+
onClose: () => {
|
|
37
|
+
currentHandler = null;
|
|
94
38
|
}
|
|
95
|
-
};
|
|
39
|
+
}));
|
|
40
|
+
|
|
41
|
+
if (currentHandler) {
|
|
42
|
+
currentHandler.replace(element);
|
|
43
|
+
} else {
|
|
44
|
+
currentHandler = (0, _renderImperatively.renderImperatively)(element);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (currentTimeout) {
|
|
48
|
+
window.clearTimeout(currentTimeout);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (props.duration !== 0) {
|
|
52
|
+
currentTimeout = window.setTimeout(() => {
|
|
53
|
+
clear();
|
|
54
|
+
}, props.duration);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return currentHandler;
|
|
96
58
|
}
|
|
97
59
|
|
|
98
60
|
function clear() {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (!container) break;
|
|
102
|
-
unmount(container);
|
|
103
|
-
}
|
|
61
|
+
currentHandler === null || currentHandler === void 0 ? void 0 : currentHandler.close();
|
|
62
|
+
currentHandler = null;
|
|
104
63
|
}
|
|
105
64
|
|
|
106
65
|
function config(val) {
|
|
@@ -21,4 +21,8 @@ export declare const VirtualInput: React.ForwardRefExoticComponent<{
|
|
|
21
21
|
keyboard?: React.ReactElement<NumberKeyboardProps, string | React.JSXElementConstructor<any>> | undefined;
|
|
22
22
|
clearable?: boolean | undefined;
|
|
23
23
|
onClear?: (() => void) | undefined;
|
|
24
|
-
} & Pick<InputProps, "value" | "onChange" | "disabled" | "placeholder"> &
|
|
24
|
+
} & Pick<InputProps, "value" | "onChange" | "disabled" | "placeholder"> & {
|
|
25
|
+
className?: string | undefined;
|
|
26
|
+
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--caret-width" | "--caret-color", string>>) | undefined;
|
|
27
|
+
tabIndex?: number | undefined;
|
|
28
|
+
} & React.AriaAttributes & React.RefAttributes<VirtualInputRef>>;
|
|
@@ -62,13 +62,14 @@ const WaterMark = p => {
|
|
|
62
62
|
const img = new Image();
|
|
63
63
|
img.crossOrigin = 'anonymous';
|
|
64
64
|
img.referrerPolicy = 'no-referrer';
|
|
65
|
-
img.src = image;
|
|
66
65
|
|
|
67
66
|
img.onload = () => {
|
|
68
67
|
ctx.drawImage(img, -imageWidth * ratio / 2, -imageHeight * ratio / 2, imageWidth * ratio, imageHeight * ratio);
|
|
69
68
|
ctx.restore();
|
|
70
69
|
setBase64Url(canvas.toDataURL());
|
|
71
70
|
};
|
|
71
|
+
|
|
72
|
+
img.src = image;
|
|
72
73
|
} else if (content) {
|
|
73
74
|
ctx.textBaseline = 'middle';
|
|
74
75
|
ctx.textAlign = 'center'; // 文字绕中间旋转
|
|
@@ -83,7 +84,7 @@ const WaterMark = p => {
|
|
|
83
84
|
setBase64Url(canvas.toDataURL());
|
|
84
85
|
}
|
|
85
86
|
} else {
|
|
86
|
-
throw new Error('
|
|
87
|
+
throw new Error('Canvas is not supported in the current environment');
|
|
87
88
|
}
|
|
88
89
|
}, [gapX, gapY, rotate, fontStyle, fontWeight, width, height, fontFamily, fontColor, image, content, fontSize]);
|
|
89
90
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
package/2x/cjs/global/global.css
CHANGED
package/2x/cjs/locales/base.d.ts
CHANGED
|
@@ -104,5 +104,15 @@ export declare const base: {
|
|
|
104
104
|
canRelease: string;
|
|
105
105
|
complete: string;
|
|
106
106
|
};
|
|
107
|
+
Slider: {
|
|
108
|
+
name: string;
|
|
109
|
+
};
|
|
110
|
+
Stepper: {
|
|
111
|
+
decrease: string;
|
|
112
|
+
increase: string;
|
|
113
|
+
};
|
|
114
|
+
Switch: {
|
|
115
|
+
name: string;
|
|
116
|
+
};
|
|
107
117
|
};
|
|
108
118
|
export declare type Locale = typeof base;
|
package/2x/cjs/locales/base.js
CHANGED
|
@@ -110,6 +110,16 @@ const base = {
|
|
|
110
110
|
pulling: 'Scroll down to refresh',
|
|
111
111
|
canRelease: 'Release to refresh immediately',
|
|
112
112
|
complete: 'Refresh successful'
|
|
113
|
+
},
|
|
114
|
+
Slider: {
|
|
115
|
+
name: 'Slider'
|
|
116
|
+
},
|
|
117
|
+
Stepper: {
|
|
118
|
+
decrease: 'decrease',
|
|
119
|
+
increase: 'increase'
|
|
120
|
+
},
|
|
121
|
+
Switch: {
|
|
122
|
+
name: 'Switch'
|
|
113
123
|
}
|
|
114
124
|
};
|
|
115
125
|
exports.base = base;
|
|
@@ -104,5 +104,15 @@ declare const enUS: {
|
|
|
104
104
|
canRelease: string;
|
|
105
105
|
complete: string;
|
|
106
106
|
};
|
|
107
|
+
Slider: {
|
|
108
|
+
name: string;
|
|
109
|
+
};
|
|
110
|
+
Stepper: {
|
|
111
|
+
decrease: string;
|
|
112
|
+
increase: string;
|
|
113
|
+
};
|
|
114
|
+
Switch: {
|
|
115
|
+
name: string;
|
|
116
|
+
};
|
|
107
117
|
};
|
|
108
118
|
export default enUS;
|