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
|
@@ -38,8 +38,7 @@ const defaultProps = {
|
|
|
38
38
|
defaultChecked: false,
|
|
39
39
|
indeterminate: false
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
const Checkbox = p => {
|
|
41
|
+
const Checkbox = (0, _react.forwardRef)((p, ref) => {
|
|
43
42
|
const groupContext = (0, _react.useContext)(_groupContext.CheckboxGroupContext);
|
|
44
43
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
45
44
|
let [checked, setChecked] = (0, _usePropsValue.usePropsValue)({
|
|
@@ -80,6 +79,18 @@ const Checkbox = p => {
|
|
|
80
79
|
disabled = disabled || groupContext.disabled;
|
|
81
80
|
}
|
|
82
81
|
|
|
82
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
83
|
+
check: () => {
|
|
84
|
+
setChecked(true);
|
|
85
|
+
},
|
|
86
|
+
uncheck: () => {
|
|
87
|
+
setChecked(false);
|
|
88
|
+
},
|
|
89
|
+
toggle: () => {
|
|
90
|
+
setChecked(!checked);
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
|
|
83
94
|
const renderIcon = () => {
|
|
84
95
|
if (props.icon) {
|
|
85
96
|
return _react.default.createElement("div", {
|
|
@@ -108,6 +119,5 @@ const Checkbox = p => {
|
|
|
108
119
|
}), renderIcon(), props.children && _react.default.createElement("div", {
|
|
109
120
|
className: `${classPrefix}-content`
|
|
110
121
|
}, props.children)));
|
|
111
|
-
};
|
|
112
|
-
|
|
122
|
+
});
|
|
113
123
|
exports.Checkbox = Checkbox;
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './checkbox.less';
|
|
3
|
-
export type { CheckboxValue, CheckboxProps } from './checkbox';
|
|
3
|
+
export type { CheckboxValue, CheckboxProps, CheckboxRef } from './checkbox';
|
|
4
4
|
export type { CheckboxGroupProps } from './group';
|
|
5
|
-
declare const _default: import("react").
|
|
5
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
6
|
+
checked?: boolean | undefined;
|
|
7
|
+
defaultChecked?: boolean | undefined;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
onChange?: ((checked: boolean) => void) | undefined;
|
|
10
|
+
value?: import("./checkbox").CheckboxValue | undefined;
|
|
11
|
+
indeterminate?: boolean | undefined;
|
|
12
|
+
block?: boolean | undefined;
|
|
13
|
+
id?: string | undefined;
|
|
14
|
+
icon?: ((checked: boolean, indeterminate: boolean) => import("react").ReactNode) | undefined;
|
|
15
|
+
children?: import("react").ReactNode;
|
|
16
|
+
} & {
|
|
17
|
+
className?: string | undefined;
|
|
18
|
+
style?: (import("react").CSSProperties & Partial<Record<"--font-size" | "--icon-size" | "--gap", string>>) | undefined;
|
|
19
|
+
tabIndex?: number | undefined;
|
|
20
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./checkbox").CheckboxRef>> & {
|
|
6
21
|
Group: import("react").FC<import("./group").CheckboxGroupProps>;
|
|
7
22
|
};
|
|
8
23
|
export default _default;
|
|
@@ -7,23 +7,25 @@ exports.NativeInput = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
+
var _ahooks = require("ahooks");
|
|
11
|
+
|
|
10
12
|
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); }
|
|
11
13
|
|
|
12
14
|
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; }
|
|
13
15
|
|
|
14
16
|
const NativeInput = props => {
|
|
15
17
|
const inputRef = (0, _react.useRef)(null);
|
|
18
|
+
const handleClick = (0, _ahooks.useMemoizedFn)(e => {
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
e.stopImmediatePropagation();
|
|
21
|
+
const latestChecked = e.target.checked;
|
|
22
|
+
if (latestChecked === props.checked) return;
|
|
23
|
+
props.onChange(latestChecked);
|
|
24
|
+
});
|
|
16
25
|
(0, _react.useEffect)(() => {
|
|
17
26
|
if (props.disabled) return;
|
|
18
27
|
if (!inputRef.current) return;
|
|
19
28
|
const input = inputRef.current;
|
|
20
|
-
|
|
21
|
-
function handleClick(e) {
|
|
22
|
-
e.stopPropagation();
|
|
23
|
-
e.stopImmediatePropagation();
|
|
24
|
-
props.onChange(input.checked);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
29
|
input.addEventListener('click', handleClick);
|
|
28
30
|
return () => {
|
|
29
31
|
input.removeEventListener('click', handleClick);
|
|
@@ -31,7 +33,7 @@ const NativeInput = props => {
|
|
|
31
33
|
}, [props.disabled, props.onChange]);
|
|
32
34
|
return _react.default.createElement("input", {
|
|
33
35
|
ref: inputRef,
|
|
34
|
-
type:
|
|
36
|
+
type: props.type,
|
|
35
37
|
checked: props.checked,
|
|
36
38
|
onChange: () => {},
|
|
37
39
|
disabled: props.disabled,
|
|
@@ -60,21 +60,6 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
|
|
|
60
60
|
const maxMinute = max.getMinutes();
|
|
61
61
|
const maxSecond = max.getSeconds();
|
|
62
62
|
const rank = precisionRankRecord[precision];
|
|
63
|
-
|
|
64
|
-
if (rank >= precisionRankRecord.year) {
|
|
65
|
-
const years = [];
|
|
66
|
-
|
|
67
|
-
for (let i = minYear; i <= maxYear; i++) {
|
|
68
|
-
const value = i.toString();
|
|
69
|
-
years.push({
|
|
70
|
-
label: renderLabel ? renderLabel('year', i) : value,
|
|
71
|
-
value
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
ret.push(years);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
63
|
const selectedYear = parseInt(selected[0]);
|
|
79
64
|
const firstDayInSelectedMonth = (0, _dayjs.default)(convertStringArrayToDate([selected[0], selected[1], '1']));
|
|
80
65
|
const selectedMonth = parseInt(selected[1]);
|
|
@@ -115,6 +100,18 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
|
|
|
115
100
|
return column;
|
|
116
101
|
};
|
|
117
102
|
|
|
103
|
+
if (rank >= precisionRankRecord.year) {
|
|
104
|
+
const lower = minYear;
|
|
105
|
+
const upper = maxYear;
|
|
106
|
+
const years = generateColumn(lower, upper, 'year');
|
|
107
|
+
ret.push(years.map(v => {
|
|
108
|
+
return {
|
|
109
|
+
label: renderLabel('year', v),
|
|
110
|
+
value: v.toString()
|
|
111
|
+
};
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
|
|
118
115
|
if (rank >= precisionRankRecord.month) {
|
|
119
116
|
const lower = isInMinYear ? minMonth : 1;
|
|
120
117
|
const upper = isInMaxYear ? maxMonth : 12;
|
|
@@ -39,21 +39,6 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
|
|
|
39
39
|
const minYear = min.getFullYear();
|
|
40
40
|
const maxYear = max.getFullYear();
|
|
41
41
|
const rank = precisionRankRecord[precision];
|
|
42
|
-
|
|
43
|
-
if (rank >= precisionRankRecord.year) {
|
|
44
|
-
const years = [];
|
|
45
|
-
|
|
46
|
-
for (let i = minYear; i <= maxYear; i++) {
|
|
47
|
-
const value = i.toString();
|
|
48
|
-
years.push({
|
|
49
|
-
label: renderLabel ? renderLabel('year', i) : value,
|
|
50
|
-
value
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
ret.push(years);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
42
|
const selectedYear = parseInt(selected[0]);
|
|
58
43
|
const isInMinYear = selectedYear === minYear;
|
|
59
44
|
const isInMaxYear = selectedYear === maxYear;
|
|
@@ -91,6 +76,18 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
|
|
|
91
76
|
return column;
|
|
92
77
|
};
|
|
93
78
|
|
|
79
|
+
if (rank >= precisionRankRecord.year) {
|
|
80
|
+
const lower = minYear;
|
|
81
|
+
const upper = maxYear;
|
|
82
|
+
const years = generateColumn(lower, upper, 'year');
|
|
83
|
+
ret.push(years.map(v => {
|
|
84
|
+
return {
|
|
85
|
+
label: renderLabel('year', v),
|
|
86
|
+
value: v.toString()
|
|
87
|
+
};
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
|
|
94
91
|
if (rank >= precisionRankRecord.week) {
|
|
95
92
|
const lower = isInMinYear ? minWeek : 1;
|
|
96
93
|
const upper = isInMaxYear ? maxWeek : selectedYearWeeks;
|
|
@@ -3,7 +3,7 @@ import type { PickerProps, PickerRef, PickerActions } from '../picker';
|
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
import type { Precision, DatePickerFilter } from './date-picker-utils';
|
|
5
5
|
export declare type DatePickerRef = PickerRef;
|
|
6
|
-
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'closeOnMaskClick' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation' | 'style' | 'mouseWheel'> & {
|
|
6
|
+
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'closeOnMaskClick' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation' | 'style' | 'mouseWheel' | 'forceRender' | 'destroyOnClose'> & {
|
|
7
7
|
value?: Date | null;
|
|
8
8
|
defaultValue?: Date | null;
|
|
9
9
|
onSelect?: (value: Date) => void;
|
|
@@ -15,7 +15,7 @@ export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' |
|
|
|
15
15
|
renderLabel?: (type: Precision, data: number) => ReactNode;
|
|
16
16
|
filter?: DatePickerFilter;
|
|
17
17
|
} & NativeProps;
|
|
18
|
-
export declare const DatePicker: React.ForwardRefExoticComponent<Pick<PickerProps, "style" | "title" | "onClick" | "visible" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "
|
|
18
|
+
export declare const DatePicker: React.ForwardRefExoticComponent<Pick<PickerProps, "style" | "title" | "onClick" | "visible" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "closeOnMaskClick" | "cancelText" | "mouseWheel" | "confirmText"> & {
|
|
19
19
|
value?: Date | null | undefined;
|
|
20
20
|
defaultValue?: Date | null | undefined;
|
|
21
21
|
onSelect?: ((value: Date) => void) | undefined;
|
|
@@ -28,4 +28,8 @@ export declare const DatePicker: React.ForwardRefExoticComponent<Pick<PickerProp
|
|
|
28
28
|
filter?: Partial<Record<Precision, (val: number, extend: {
|
|
29
29
|
date: Date;
|
|
30
30
|
}) => boolean>> | undefined;
|
|
31
|
-
} &
|
|
31
|
+
} & {
|
|
32
|
+
className?: string | undefined;
|
|
33
|
+
style?: (React.CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
34
|
+
tabIndex?: number | undefined;
|
|
35
|
+
} & React.AriaAttributes & React.RefAttributes<PickerActions>>;
|
|
@@ -81,7 +81,9 @@ const DatePicker = (0, _react.forwardRef)((p, ref) => {
|
|
|
81
81
|
onClick: props.onClick,
|
|
82
82
|
title: props.title,
|
|
83
83
|
stopPropagation: props.stopPropagation,
|
|
84
|
-
mouseWheel: props.mouseWheel
|
|
84
|
+
mouseWheel: props.mouseWheel,
|
|
85
|
+
destroyOnClose: props.destroyOnClose,
|
|
86
|
+
forceRender: props.forceRender
|
|
85
87
|
}, (_, actions) => {
|
|
86
88
|
var _a;
|
|
87
89
|
|
|
@@ -3,7 +3,7 @@ import './date-picker.less';
|
|
|
3
3
|
import { prompt } from './prompt';
|
|
4
4
|
export type { DatePickerProps, DatePickerRef } from './date-picker';
|
|
5
5
|
export type { DatePickerFilter } from './date-picker-utils';
|
|
6
|
-
declare const _default: import("react").ForwardRefExoticComponent<Pick<import("../picker").PickerProps, "style" | "title" | "onClick" | "visible" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "
|
|
6
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<import("../picker").PickerProps, "style" | "title" | "onClick" | "visible" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "closeOnMaskClick" | "cancelText" | "mouseWheel" | "confirmText"> & {
|
|
7
7
|
value?: Date | null | undefined;
|
|
8
8
|
defaultValue?: Date | null | undefined;
|
|
9
9
|
onSelect?: ((value: Date) => void) | undefined;
|
|
@@ -16,7 +16,11 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<import(".
|
|
|
16
16
|
filter?: Partial<Record<import("./date-picker-utils").Precision, (val: number, extend: {
|
|
17
17
|
date: Date;
|
|
18
18
|
}) => boolean>> | undefined;
|
|
19
|
-
} &
|
|
19
|
+
} & {
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
22
|
+
tabIndex?: number | undefined;
|
|
23
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("../picker").PickerActions>> & {
|
|
20
24
|
prompt: typeof prompt;
|
|
21
25
|
};
|
|
22
26
|
export default _default;
|
|
@@ -85,7 +85,9 @@ const Dialog = p => {
|
|
|
85
85
|
stopPropagation: props.stopPropagation,
|
|
86
86
|
disableBodyScroll: props.disableBodyScroll,
|
|
87
87
|
destroyOnClose: props.destroyOnClose,
|
|
88
|
-
forceRender: props.forceRender
|
|
88
|
+
forceRender: props.forceRender,
|
|
89
|
+
role: 'dialog',
|
|
90
|
+
"aria-label": props['aria-label']
|
|
89
91
|
}, element);
|
|
90
92
|
};
|
|
91
93
|
|
|
@@ -18,7 +18,11 @@ declare const Dropdown: React.ForwardRefExoticComponent<{
|
|
|
18
18
|
closeOnClickAway?: boolean | undefined;
|
|
19
19
|
onChange?: ((key: string | null) => void) | undefined;
|
|
20
20
|
arrow?: React.ReactNode;
|
|
21
|
-
} &
|
|
21
|
+
} & {
|
|
22
|
+
className?: string | undefined;
|
|
23
|
+
style?: (React.CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
24
|
+
tabIndex?: number | undefined;
|
|
25
|
+
} & React.AriaAttributes & {
|
|
22
26
|
children?: React.ReactNode;
|
|
23
27
|
} & React.RefAttributes<DropdownRef>>;
|
|
24
28
|
export default Dropdown;
|
|
@@ -9,7 +9,11 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
9
9
|
closeOnClickAway?: boolean | undefined;
|
|
10
10
|
onChange?: ((key: string | null) => void) | undefined;
|
|
11
11
|
arrow?: import("react").ReactNode;
|
|
12
|
-
} &
|
|
12
|
+
} & {
|
|
13
|
+
className?: string | undefined;
|
|
14
|
+
style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
15
|
+
tabIndex?: number | undefined;
|
|
16
|
+
} & import("react").AriaAttributes & {
|
|
13
17
|
children?: import("react").ReactNode;
|
|
14
18
|
} & import("react").RefAttributes<import("./dropdown").DropdownRef>> & {
|
|
15
19
|
Item: import("react").FC<import("./item").DropdownItemProps>;
|
|
@@ -16,4 +16,8 @@ export declare const FloatingPanel: React.ForwardRefExoticComponent<{
|
|
|
16
16
|
children: ReactNode;
|
|
17
17
|
onHeightChange?: ((height: number, animating: boolean) => void) | undefined;
|
|
18
18
|
handleDraggingOfContent?: boolean | undefined;
|
|
19
|
-
} &
|
|
19
|
+
} & {
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
style?: (React.CSSProperties & Partial<Record<"--z-index" | "--border-radius" | "--header-height", string>>) | undefined;
|
|
22
|
+
tabIndex?: number | undefined;
|
|
23
|
+
} & React.AriaAttributes & React.RefAttributes<FloatingPanelRef>>;
|
|
@@ -107,15 +107,13 @@ const FormItemLayout = props => {
|
|
|
107
107
|
e.preventDefault();
|
|
108
108
|
}
|
|
109
109
|
}, _react.default.createElement(_antdMobileIcons.QuestionCircleOutline, null)))) : null;
|
|
110
|
-
|
|
111
|
-
const description = _react.default.createElement(_react.default.Fragment, null, props.description, hasFeedback && _react.default.createElement(_react.default.Fragment, null, props.errors.map((error, index) => _react.default.createElement("div", {
|
|
110
|
+
const description = props.description || hasFeedback ? _react.default.createElement(_react.default.Fragment, null, props.description, hasFeedback && _react.default.createElement(_react.default.Fragment, null, props.errors.map((error, index) => _react.default.createElement("div", {
|
|
112
111
|
key: `error-${index}`,
|
|
113
112
|
className: `${classPrefix}-feedback-error`
|
|
114
113
|
}, error)), props.warnings.map((warning, index) => _react.default.createElement("div", {
|
|
115
114
|
key: `warning-${index}`,
|
|
116
115
|
className: `${classPrefix}-feedback-warning`
|
|
117
|
-
}, warning))));
|
|
118
|
-
|
|
116
|
+
}, warning)))) : null;
|
|
119
117
|
return _react.default.createElement(_list.default.Item, {
|
|
120
118
|
style: style,
|
|
121
119
|
title: layout === 'vertical' && labelElement,
|
|
@@ -11,27 +11,21 @@ var _rcFieldForm = require("rc-field-form");
|
|
|
11
11
|
|
|
12
12
|
var _ahooks = require("ahooks");
|
|
13
13
|
|
|
14
|
-
var _ = _interopRequireDefault(require("."));
|
|
15
|
-
|
|
16
14
|
var _useIsomorphicUpdateLayoutEffect = require("../../utils/use-isomorphic-update-layout-effect");
|
|
17
15
|
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
16
|
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
17
|
|
|
22
18
|
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; }
|
|
23
19
|
|
|
24
20
|
const FormSubscribe = props => {
|
|
25
21
|
const update = (0, _ahooks.useUpdate)();
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
dependencies: props.to
|
|
29
|
-
}, form => _react.default.createElement(_react.default.Fragment, null, props.children(form.getFieldsValue(props.to), form), props.to.map(namePath => _react.default.createElement(Watcher, {
|
|
22
|
+
const form = (0, _react.useContext)(_rcFieldForm.FieldContext);
|
|
23
|
+
return _react.default.createElement(_react.default.Fragment, null, props.children(form.getFieldsValue(props.to), form), props.to.map(namePath => _react.default.createElement(Watcher, {
|
|
30
24
|
key: namePath.toString(),
|
|
31
25
|
form: form,
|
|
32
26
|
namePath: namePath,
|
|
33
27
|
onChange: update
|
|
34
|
-
})))
|
|
28
|
+
})));
|
|
35
29
|
};
|
|
36
30
|
|
|
37
31
|
exports.FormSubscribe = FormSubscribe;
|
|
@@ -8,7 +8,11 @@ export declare type FormProps = Pick<RcFormProps, 'form' | 'initialValues' | 'na
|
|
|
8
8
|
footer?: ReactNode;
|
|
9
9
|
mode?: ListProps['mode'];
|
|
10
10
|
};
|
|
11
|
-
export declare const Form: React.ForwardRefExoticComponent<Pick<RcFormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> &
|
|
11
|
+
export declare const Form: React.ForwardRefExoticComponent<Pick<RcFormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & {
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
style?: (React.CSSProperties & Partial<Record<"--border-bottom" | "--border-inner" | "--border-top", string>>) | undefined;
|
|
14
|
+
tabIndex?: number | undefined;
|
|
15
|
+
} & React.AriaAttributes & Partial<FormContextType> & {
|
|
12
16
|
footer?: ReactNode;
|
|
13
17
|
mode?: ListProps['mode'];
|
|
14
18
|
} & React.RefAttributes<FormInstance>>;
|
|
@@ -7,7 +7,11 @@ export type { FormItemProps } from './form-item';
|
|
|
7
7
|
export type { FormSubscribeProps } from './form-subscribe';
|
|
8
8
|
export type { ValidateMessages, FieldData, NamePath, } from 'rc-field-form/es/interface';
|
|
9
9
|
export type { FormArrayField, FormArrayOperation, FormArrayProps, } from './form-array';
|
|
10
|
-
declare const _default: import("react").ForwardRefExoticComponent<Pick<import("rc-field-form").FormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> &
|
|
10
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<import("rc-field-form").FormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & {
|
|
11
|
+
className?: string | undefined;
|
|
12
|
+
style?: (import("react").CSSProperties & Partial<Record<"--border-bottom" | "--border-inner" | "--border-top", string>>) | undefined;
|
|
13
|
+
tabIndex?: number | undefined;
|
|
14
|
+
} & import("react").AriaAttributes & Partial<import("./context").FormContextType> & {
|
|
11
15
|
footer?: import("react").ReactNode;
|
|
12
16
|
mode?: "default" | "card" | undefined;
|
|
13
17
|
} & import("react").RefAttributes<import("./form").FormInstance>> & {
|
|
@@ -12,4 +12,8 @@ export declare const IndexBar: React.ForwardRefExoticComponent<{
|
|
|
12
12
|
sticky?: boolean | undefined;
|
|
13
13
|
onIndexChange?: ((index: string) => void) | undefined;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
|
-
} &
|
|
15
|
+
} & {
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
style?: (React.CSSProperties & Partial<Record<"--sticky-offset-top", string>>) | undefined;
|
|
18
|
+
tabIndex?: number | undefined;
|
|
19
|
+
} & React.AriaAttributes & React.RefAttributes<IndexBarRef>>;
|
|
@@ -6,7 +6,11 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
6
6
|
sticky?: boolean | undefined;
|
|
7
7
|
onIndexChange?: ((index: string) => void) | undefined;
|
|
8
8
|
children?: import("react").ReactNode;
|
|
9
|
-
} &
|
|
9
|
+
} & {
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
style?: (import("react").CSSProperties & Partial<Record<"--sticky-offset-top", string>>) | undefined;
|
|
12
|
+
tabIndex?: number | undefined;
|
|
13
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./index-bar").IndexBarRef>> & {
|
|
10
14
|
Panel: import("react").FC<import("./panel").IndexBarPanelProps>;
|
|
11
15
|
};
|
|
12
16
|
export default _default;
|
|
@@ -57,7 +57,9 @@ const InfiniteScroll = p => {
|
|
|
57
57
|
const [flag, setFlag] = (0, _react.useState)({});
|
|
58
58
|
const nextFlagRef = (0, _react.useRef)(flag);
|
|
59
59
|
const [scrollParent, setScrollParent] = (0, _react.useState)();
|
|
60
|
-
const
|
|
60
|
+
const {
|
|
61
|
+
run: check
|
|
62
|
+
} = (0, _ahooks.useThrottleFn)(() => (0, _tslib.__awaiter)(void 0, void 0, void 0, function* () {
|
|
61
63
|
if (nextFlagRef.current !== flag) return;
|
|
62
64
|
if (!props.hasMore) return;
|
|
63
65
|
const element = elementRef.current;
|
|
@@ -76,7 +78,11 @@ const InfiniteScroll = p => {
|
|
|
76
78
|
yield doLoadMore(false);
|
|
77
79
|
setFlag(nextFlag);
|
|
78
80
|
}
|
|
79
|
-
})
|
|
81
|
+
}), {
|
|
82
|
+
wait: 100,
|
|
83
|
+
leading: true,
|
|
84
|
+
trailing: true
|
|
85
|
+
}); // Make sure to trigger `loadMore` when content changes
|
|
80
86
|
|
|
81
87
|
(0, _react.useEffect)(() => {
|
|
82
88
|
check();
|
|
@@ -97,9 +103,11 @@ const InfiniteScroll = p => {
|
|
|
97
103
|
}, [scrollParent]);
|
|
98
104
|
|
|
99
105
|
function retry() {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
106
|
+
return (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
|
|
107
|
+
setFailed(false);
|
|
108
|
+
yield doLoadMore(true);
|
|
109
|
+
setFlag(nextFlagRef.current);
|
|
110
|
+
});
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
declare type NativeInputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
4
|
-
|
|
4
|
+
declare type AriaProps = {
|
|
5
|
+
role?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | 'pattern' | 'inputMode' | 'type' | 'name' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick' | 'step'> & {
|
|
5
8
|
value?: string;
|
|
6
9
|
defaultValue?: string;
|
|
7
10
|
onChange?: (val: string) => void;
|
|
@@ -16,14 +19,14 @@ export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength
|
|
|
16
19
|
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
17
20
|
min?: number;
|
|
18
21
|
max?: number;
|
|
19
|
-
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'
|
|
22
|
+
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'> & AriaProps;
|
|
20
23
|
export declare type InputRef = {
|
|
21
24
|
clear: () => void;
|
|
22
25
|
focus: () => void;
|
|
23
26
|
blur: () => void;
|
|
24
27
|
nativeElement: HTMLInputElement | null;
|
|
25
28
|
};
|
|
26
|
-
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "onClick" | "name" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "autoFocus" | "maxLength" | "minLength"> & {
|
|
29
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "onClick" | "name" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "autoFocus" | "maxLength" | "minLength" | "step"> & {
|
|
27
30
|
value?: string | undefined;
|
|
28
31
|
defaultValue?: string | undefined;
|
|
29
32
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -38,5 +41,9 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProp
|
|
|
38
41
|
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
39
42
|
min?: number | undefined;
|
|
40
43
|
max?: number | undefined;
|
|
41
|
-
} &
|
|
44
|
+
} & {
|
|
45
|
+
className?: string | undefined;
|
|
46
|
+
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align", string>>) | undefined;
|
|
47
|
+
tabIndex?: number | undefined;
|
|
48
|
+
} & React.AriaAttributes & AriaProps & React.RefAttributes<InputRef>>;
|
|
42
49
|
export {};
|
|
@@ -157,7 +157,11 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
157
157
|
compositionStartRef.current = false;
|
|
158
158
|
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
159
159
|
},
|
|
160
|
-
onClick: props.onClick
|
|
160
|
+
onClick: props.onClick,
|
|
161
|
+
role: props.role,
|
|
162
|
+
"aria-valuenow": props['aria-valuenow'],
|
|
163
|
+
"aria-valuemax": props['aria-valuemax'],
|
|
164
|
+
"aria-valuemin": props['aria-valuemin']
|
|
161
165
|
}), shouldShowClear && _react.default.createElement("div", {
|
|
162
166
|
className: `${classPrefix}-clear`,
|
|
163
167
|
onMouseDown: e => {
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './list.less';
|
|
3
|
-
export type { ListProps } from './list';
|
|
3
|
+
export type { ListProps, ListRef } from './list';
|
|
4
4
|
export type { ListItemProps } from './list-item';
|
|
5
|
-
declare const _default: import("react").
|
|
5
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
6
|
+
header?: import("react").ReactNode;
|
|
7
|
+
mode?: "default" | "card" | undefined;
|
|
8
|
+
children?: import("react").ReactNode;
|
|
9
|
+
} & {
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
style?: (import("react").CSSProperties & Partial<Record<"--active-background-color" | "--align-items" | "--border-bottom" | "--border-inner" | "--border-top" | "--extra-max-width" | "--font-size" | "--header-font-size" | "--padding-left" | "--padding-right" | "--prefix-padding-right" | "--prefix-width", string>>) | undefined;
|
|
12
|
+
tabIndex?: number | undefined;
|
|
13
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./list").ListRef>> & {
|
|
6
14
|
Item: import("react").FC<import("./list-item").ListItemProps>;
|
|
7
15
|
};
|
|
8
16
|
export default _default;
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
--padding-left: 24px;
|
|
11
11
|
--padding-right: 24px;
|
|
12
12
|
--font-size: var(--adm-font-size-9);
|
|
13
|
+
--extra-max-width: 70%;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
.adm-list-header {
|
|
@@ -79,9 +80,11 @@
|
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
.adm-list-item-content-extra {
|
|
83
|
+
flex: none;
|
|
82
84
|
padding-left: 24px;
|
|
83
85
|
font-size: var(--adm-font-size-7);
|
|
84
86
|
color: var(--adm-color-weak);
|
|
87
|
+
max-width: var(--extra-max-width);
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
.adm-list-item-content-arrow {
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ListProps = {
|
|
4
4
|
header?: ReactNode;
|
|
5
5
|
mode?: 'default' | 'card';
|
|
6
6
|
children?: ReactNode;
|
|
7
|
-
} & NativeProps<'--
|
|
8
|
-
export declare
|
|
7
|
+
} & NativeProps<'--active-background-color' | '--align-items' | '--border-bottom' | '--border-inner' | '--border-top' | '--extra-max-width' | '--font-size' | '--header-font-size' | '--padding-left' | '--padding-right' | '--prefix-padding-right' | '--prefix-width'>;
|
|
8
|
+
export declare type ListRef = {
|
|
9
|
+
nativeElement: HTMLDivElement | null;
|
|
10
|
+
};
|
|
11
|
+
export declare const List: React.ForwardRefExoticComponent<{
|
|
12
|
+
header?: ReactNode;
|
|
13
|
+
mode?: "default" | "card" | undefined;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
} & {
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
style?: (React.CSSProperties & Partial<Record<"--active-background-color" | "--align-items" | "--border-bottom" | "--border-inner" | "--border-top" | "--extra-max-width" | "--font-size" | "--header-font-size" | "--padding-left" | "--padding-right" | "--prefix-padding-right" | "--prefix-width", string>>) | undefined;
|
|
18
|
+
tabIndex?: number | undefined;
|
|
19
|
+
} & React.AriaAttributes & React.RefAttributes<ListRef>>;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.List = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
|
|
@@ -15,15 +15,26 @@ var _withDefaultProps = require("../../utils/with-default-props");
|
|
|
15
15
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
|
|
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); }
|
|
19
|
+
|
|
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; }
|
|
21
|
+
|
|
18
22
|
const classPrefix = `adm-list`;
|
|
19
23
|
const defaultProps = {
|
|
20
24
|
mode: 'default'
|
|
21
25
|
};
|
|
22
|
-
|
|
23
|
-
const List = p => {
|
|
26
|
+
const List = (0, _react.forwardRef)((p, ref) => {
|
|
24
27
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
28
|
+
const nativeElementRef = (0, _react.useRef)(null);
|
|
29
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
30
|
+
get nativeElement() {
|
|
31
|
+
return nativeElementRef.current;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}));
|
|
25
35
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
26
|
-
className: (0, _classnames.default)(classPrefix, `${classPrefix}-${props.mode}`)
|
|
36
|
+
className: (0, _classnames.default)(classPrefix, `${classPrefix}-${props.mode}`),
|
|
37
|
+
ref: nativeElementRef
|
|
27
38
|
}, props.header && _react.default.createElement("div", {
|
|
28
39
|
className: `${classPrefix}-header`
|
|
29
40
|
}, props.header), _react.default.createElement("div", {
|
|
@@ -31,6 +42,5 @@ const List = p => {
|
|
|
31
42
|
}, _react.default.createElement("div", {
|
|
32
43
|
className: `${classPrefix}-body-inner`
|
|
33
44
|
}, props.children))));
|
|
34
|
-
};
|
|
35
|
-
|
|
45
|
+
});
|
|
36
46
|
exports.List = List;
|