antd-mobile 5.31.1 → 5.32.1
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/bundle/antd-mobile.cjs.development.js +665 -553
- package/2x/bundle/antd-mobile.cjs.js +9 -9
- package/2x/bundle/antd-mobile.es.development.js +666 -554
- package/2x/bundle/antd-mobile.es.js +5659 -5580
- package/2x/bundle/antd-mobile.umd.development.js +665 -553
- package/2x/bundle/antd-mobile.umd.js +9 -9
- package/2x/bundle/style.css +16 -15
- package/2x/cjs/components/action-sheet/action-sheet.css +1 -1
- package/2x/cjs/components/button/button.css +2 -2
- package/2x/cjs/components/calendar/calendar.js +5 -1
- package/2x/cjs/components/calendar/convert.js +1 -6
- package/2x/cjs/components/capsule-tabs/capsule-tabs.js +2 -4
- package/2x/cjs/components/cascader/cascader.d.ts +2 -0
- package/2x/cjs/components/cascader/index.d.ts +1 -0
- package/2x/cjs/components/center-popup/center-popup.js +6 -5
- package/2x/cjs/components/checkbox/checkbox.d.ts +2 -0
- package/2x/cjs/components/checkbox/checkbox.js +1 -0
- package/2x/cjs/components/checkbox/index.d.ts +1 -0
- package/2x/cjs/components/collapse/collapse.js +28 -13
- package/2x/cjs/components/date-picker/date-picker-date-utils.js +24 -36
- package/2x/cjs/components/date-picker/date-picker-week-utils.js +12 -18
- package/2x/cjs/components/date-picker-view/date-picker-view.d.ts +7 -5
- package/2x/cjs/components/date-picker-view/date-picker-view.js +8 -2
- package/2x/cjs/components/dropdown/dropdown.js +1 -1
- package/2x/cjs/components/ellipsis/ellipsis.js +4 -4
- package/2x/cjs/components/error-block/create-error-block.js +4 -4
- package/2x/cjs/components/error-block/error-block.css +1 -1
- package/2x/cjs/components/floating-panel/floating-panel.js +8 -7
- package/2x/cjs/components/footer/footer.js +17 -21
- package/2x/cjs/components/form/form-item.d.ts +1 -1
- package/2x/cjs/components/form/form-item.js +6 -9
- package/2x/cjs/components/form/form.css +1 -1
- package/2x/cjs/components/form/index.css +1 -1
- package/2x/cjs/components/image-uploader/image-uploader.css +1 -1
- package/2x/cjs/components/image-uploader/image-uploader.js +1 -3
- package/2x/cjs/components/input/input.d.ts +2 -8
- package/2x/cjs/components/input/input.js +5 -1
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.js +1 -1
- package/2x/cjs/components/modal/modal.js +11 -13
- package/2x/cjs/components/notice-bar/notice-bar.css +2 -2
- package/2x/cjs/components/number-keyboard/number-keyboard.css +2 -2
- package/2x/cjs/components/picker-view/wheel.js +61 -14
- package/2x/cjs/components/popover/popover-menu.css +2 -2
- package/2x/cjs/components/popover/popover.js +5 -7
- package/2x/cjs/components/popup/popup.js +3 -3
- package/2x/cjs/components/progress-bar/progress-bar.css +1 -1
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/2x/cjs/components/radio/radio.d.ts +1 -0
- package/2x/cjs/components/radio/radio.js +1 -0
- package/2x/cjs/components/rate/rate.d.ts +1 -1
- package/2x/cjs/components/rate/star.d.ts +1 -1
- package/2x/cjs/components/result/result.js +2 -2
- package/2x/cjs/components/safe-area/safe-area.d.ts +1 -1
- package/2x/cjs/components/safe-area/safe-area.js +1 -1
- package/2x/cjs/components/side-bar/side-bar.d.ts +1 -2
- package/2x/cjs/components/side-bar/side-bar.js +4 -2
- package/2x/cjs/components/skeleton/skeleton.d.ts +1 -1
- package/2x/cjs/components/stepper/stepper.js +1 -5
- package/2x/cjs/components/steps/steps.js +5 -5
- package/2x/cjs/components/swipe-action/swipe-action.d.ts +4 -3
- package/2x/cjs/components/tab-bar/tab-bar.d.ts +1 -2
- package/2x/cjs/components/tab-bar/tab-bar.js +4 -2
- package/2x/cjs/components/tabs/tabs.js +1 -1
- package/2x/cjs/components/tag/tag.js +1 -1
- package/2x/cjs/components/text-area/text-area.css +1 -0
- package/2x/cjs/components/text-area/text-area.js +11 -2
- package/2x/cjs/components/toast/toast.css +2 -2
- package/2x/cjs/components/tree-select/multiple.js +2 -6
- package/2x/cjs/components/virtual-input/virtual-input.js +1 -1
- package/2x/cjs/components/water-mark/water-mark.js +1 -1
- package/2x/cjs/locales/base.d.ts +1 -1
- package/2x/cjs/locales/base.js +1 -1
- package/2x/cjs/locales/da-DK.d.ts +1 -1
- package/2x/cjs/locales/da-DK.js +1 -1
- package/2x/cjs/locales/en-US.d.ts +1 -1
- package/2x/cjs/locales/es-ES.d.ts +1 -1
- package/2x/cjs/locales/es-ES.js +1 -1
- package/2x/cjs/locales/fa-IR.d.ts +1 -1
- package/2x/cjs/locales/fa-IR.js +1 -1
- package/2x/cjs/locales/fr-FR.d.ts +1 -1
- package/2x/cjs/locales/fr-FR.js +1 -1
- package/2x/cjs/locales/id-ID.d.ts +1 -1
- package/2x/cjs/locales/id-ID.js +1 -1
- package/2x/cjs/locales/it-IT.d.ts +1 -1
- package/2x/cjs/locales/it-IT.js +1 -1
- package/2x/cjs/locales/ja-JP.d.ts +1 -1
- package/2x/cjs/locales/ja-JP.js +1 -1
- package/2x/cjs/locales/kk-KZ.d.ts +1 -1
- package/2x/cjs/locales/kk-KZ.js +1 -1
- package/2x/cjs/locales/ko-KR.d.ts +1 -1
- package/2x/cjs/locales/ko-KR.js +1 -1
- package/2x/cjs/locales/nb-NO.d.ts +1 -1
- package/2x/cjs/locales/nb-NO.js +1 -1
- package/2x/cjs/locales/nl-NL.d.ts +1 -1
- package/2x/cjs/locales/nl-NL.js +1 -1
- package/2x/cjs/locales/ru-RU.d.ts +134 -0
- package/2x/cjs/locales/ru-RU.js +144 -0
- package/2x/cjs/locales/zh-CN.d.ts +1 -1
- package/2x/cjs/locales/zh-CN.js +1 -1
- package/2x/cjs/locales/zh-HK.d.ts +1 -1
- package/2x/cjs/locales/zh-HK.js +1 -1
- package/2x/cjs/locales/zh-TW.d.ts +1 -1
- package/2x/cjs/locales/zh-TW.js +1 -1
- package/2x/cjs/utils/replace-message.d.ts +1 -0
- package/2x/cjs/utils/replace-message.js +13 -0
- package/2x/cjs/utils/use-lock-scroll.js +6 -2
- package/2x/es/components/action-sheet/action-sheet.css +1 -1
- package/2x/es/components/button/button.css +2 -2
- package/2x/es/components/calendar/calendar.js +5 -1
- package/2x/es/components/calendar/convert.js +1 -6
- package/2x/es/components/capsule-tabs/capsule-tabs.js +3 -5
- package/2x/es/components/cascader/cascader.d.ts +2 -0
- package/2x/es/components/cascader/index.d.ts +1 -0
- package/2x/es/components/center-popup/center-popup.js +6 -5
- package/2x/es/components/checkbox/checkbox.d.ts +2 -0
- package/2x/es/components/checkbox/checkbox.js +1 -0
- package/2x/es/components/checkbox/index.d.ts +1 -0
- package/2x/es/components/collapse/collapse.js +29 -14
- package/2x/es/components/date-picker/date-picker-date-utils.js +24 -36
- package/2x/es/components/date-picker/date-picker-week-utils.js +12 -18
- package/2x/es/components/date-picker-view/date-picker-view.d.ts +7 -5
- package/2x/es/components/date-picker-view/date-picker-view.js +8 -2
- package/2x/es/components/dropdown/dropdown.js +2 -2
- package/2x/es/components/ellipsis/ellipsis.js +4 -4
- package/2x/es/components/error-block/create-error-block.js +4 -4
- package/2x/es/components/error-block/error-block.css +1 -1
- package/2x/es/components/floating-panel/floating-panel.js +8 -7
- package/2x/es/components/footer/footer.js +17 -21
- package/2x/es/components/form/form-item.d.ts +1 -1
- package/2x/es/components/form/form-item.js +6 -9
- package/2x/es/components/form/form.css +1 -1
- package/2x/es/components/form/index.css +1 -1
- package/2x/es/components/image-uploader/image-uploader.css +1 -1
- package/2x/es/components/image-uploader/image-uploader.js +1 -3
- package/2x/es/components/input/input.d.ts +2 -8
- package/2x/es/components/input/input.js +5 -1
- package/2x/es/components/jumbo-tabs/jumbo-tabs.js +2 -2
- package/2x/es/components/modal/modal.js +11 -13
- package/2x/es/components/notice-bar/notice-bar.css +2 -2
- package/2x/es/components/number-keyboard/number-keyboard.css +2 -2
- package/2x/es/components/picker-view/wheel.js +61 -14
- package/2x/es/components/popover/popover-menu.css +2 -2
- package/2x/es/components/popover/popover.js +5 -7
- package/2x/es/components/popup/popup.js +3 -3
- package/2x/es/components/progress-bar/progress-bar.css +1 -1
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/2x/es/components/radio/radio.d.ts +1 -0
- package/2x/es/components/radio/radio.js +1 -0
- package/2x/es/components/rate/rate.d.ts +1 -1
- package/2x/es/components/rate/star.d.ts +1 -1
- package/2x/es/components/result/result.js +2 -2
- package/2x/es/components/safe-area/safe-area.d.ts +1 -1
- package/2x/es/components/safe-area/safe-area.js +1 -1
- package/2x/es/components/side-bar/side-bar.d.ts +1 -2
- package/2x/es/components/side-bar/side-bar.js +2 -2
- package/2x/es/components/skeleton/skeleton.d.ts +1 -1
- package/2x/es/components/stepper/stepper.js +1 -5
- package/2x/es/components/steps/steps.js +5 -5
- package/2x/es/components/swipe-action/swipe-action.d.ts +4 -3
- package/2x/es/components/tab-bar/tab-bar.d.ts +1 -2
- package/2x/es/components/tab-bar/tab-bar.js +2 -2
- package/2x/es/components/tabs/tabs.js +2 -2
- package/2x/es/components/tag/tag.js +1 -1
- package/2x/es/components/text-area/text-area.css +1 -0
- package/2x/es/components/text-area/text-area.js +11 -2
- package/2x/es/components/toast/toast.css +2 -2
- package/2x/es/components/tree-select/multiple.js +2 -6
- package/2x/es/components/virtual-input/virtual-input.js +1 -1
- package/2x/es/components/water-mark/water-mark.js +1 -1
- package/2x/es/locales/base.d.ts +1 -1
- package/2x/es/locales/base.js +1 -1
- package/2x/es/locales/da-DK.d.ts +1 -1
- package/2x/es/locales/da-DK.js +1 -1
- package/2x/es/locales/en-US.d.ts +1 -1
- package/2x/es/locales/es-ES.d.ts +1 -1
- package/2x/es/locales/es-ES.js +1 -1
- package/2x/es/locales/fa-IR.d.ts +1 -1
- package/2x/es/locales/fa-IR.js +1 -1
- package/2x/es/locales/fr-FR.d.ts +1 -1
- package/2x/es/locales/fr-FR.js +1 -1
- package/2x/es/locales/id-ID.d.ts +1 -1
- package/2x/es/locales/id-ID.js +1 -1
- package/2x/es/locales/it-IT.d.ts +1 -1
- package/2x/es/locales/it-IT.js +1 -1
- package/2x/es/locales/ja-JP.d.ts +1 -1
- package/2x/es/locales/ja-JP.js +1 -1
- package/2x/es/locales/kk-KZ.d.ts +1 -1
- package/2x/es/locales/kk-KZ.js +1 -1
- package/2x/es/locales/ko-KR.d.ts +1 -1
- package/2x/es/locales/ko-KR.js +1 -1
- package/2x/es/locales/nb-NO.d.ts +1 -1
- package/2x/es/locales/nb-NO.js +1 -1
- package/2x/es/locales/nl-NL.d.ts +1 -1
- package/2x/es/locales/nl-NL.js +1 -1
- package/2x/es/locales/ru-RU.d.ts +134 -0
- package/2x/es/locales/ru-RU.js +137 -0
- package/2x/es/locales/zh-CN.d.ts +1 -1
- package/2x/es/locales/zh-CN.js +1 -1
- package/2x/es/locales/zh-HK.d.ts +1 -1
- package/2x/es/locales/zh-HK.js +1 -1
- package/2x/es/locales/zh-TW.d.ts +1 -1
- package/2x/es/locales/zh-TW.js +1 -1
- package/2x/es/utils/replace-message.d.ts +1 -0
- package/2x/es/utils/replace-message.js +7 -0
- package/2x/es/utils/use-lock-scroll.js +6 -2
- package/2x/package.json +2 -2
- package/bundle/antd-mobile.cjs.development.js +665 -553
- package/bundle/antd-mobile.cjs.js +9 -9
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +666 -554
- package/bundle/antd-mobile.es.js +5659 -5580
- package/bundle/antd-mobile.umd.development.js +665 -553
- package/bundle/antd-mobile.umd.js +9 -9
- package/bundle/style.css +1 -1
- package/cjs/components/action-sheet/action-sheet.css +1 -1
- package/cjs/components/button/button.css +2 -2
- package/cjs/components/calendar/calendar.js +5 -1
- package/cjs/components/calendar/convert.js +1 -6
- package/cjs/components/capsule-tabs/capsule-tabs.js +2 -4
- package/cjs/components/cascader/cascader.d.ts +2 -0
- package/cjs/components/cascader/index.d.ts +1 -0
- package/cjs/components/center-popup/center-popup.js +6 -5
- package/cjs/components/checkbox/checkbox.d.ts +2 -0
- package/cjs/components/checkbox/checkbox.js +1 -0
- package/cjs/components/checkbox/index.d.ts +1 -0
- package/cjs/components/collapse/collapse.js +28 -13
- package/cjs/components/date-picker/date-picker-date-utils.js +24 -36
- package/cjs/components/date-picker/date-picker-week-utils.js +12 -18
- package/cjs/components/date-picker-view/date-picker-view.d.ts +7 -5
- package/cjs/components/date-picker-view/date-picker-view.js +8 -2
- package/cjs/components/dropdown/dropdown.js +1 -1
- package/cjs/components/ellipsis/ellipsis.js +4 -4
- package/cjs/components/error-block/create-error-block.js +4 -4
- package/cjs/components/error-block/error-block.css +1 -1
- package/cjs/components/floating-panel/floating-panel.js +8 -7
- package/cjs/components/footer/footer.js +17 -21
- package/cjs/components/form/form-item.d.ts +1 -1
- package/cjs/components/form/form-item.js +6 -9
- package/cjs/components/form/form.css +1 -1
- package/cjs/components/form/index.css +1 -1
- package/cjs/components/image-uploader/image-uploader.css +1 -1
- package/cjs/components/image-uploader/image-uploader.js +1 -3
- package/cjs/components/input/input.d.ts +2 -8
- package/cjs/components/input/input.js +5 -1
- package/cjs/components/jumbo-tabs/jumbo-tabs.js +1 -1
- package/cjs/components/modal/modal.js +11 -13
- package/cjs/components/notice-bar/notice-bar.css +2 -2
- package/cjs/components/number-keyboard/number-keyboard.css +2 -2
- package/cjs/components/picker-view/wheel.js +61 -14
- package/cjs/components/popover/popover-menu.css +2 -2
- package/cjs/components/popover/popover.js +5 -7
- package/cjs/components/popup/popup.js +3 -3
- package/cjs/components/progress-bar/progress-bar.css +1 -1
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/cjs/components/radio/radio.d.ts +1 -0
- package/cjs/components/radio/radio.js +1 -0
- package/cjs/components/rate/rate.d.ts +1 -1
- package/cjs/components/rate/star.d.ts +1 -1
- package/cjs/components/result/result.js +2 -2
- package/cjs/components/safe-area/safe-area.d.ts +1 -1
- package/cjs/components/safe-area/safe-area.js +1 -1
- package/cjs/components/side-bar/side-bar.d.ts +1 -2
- package/cjs/components/side-bar/side-bar.js +4 -2
- package/cjs/components/skeleton/skeleton.d.ts +1 -1
- package/cjs/components/stepper/stepper.js +1 -5
- package/cjs/components/steps/steps.js +5 -5
- package/cjs/components/swipe-action/swipe-action.d.ts +4 -3
- package/cjs/components/tab-bar/tab-bar.d.ts +1 -2
- package/cjs/components/tab-bar/tab-bar.js +4 -2
- package/cjs/components/tabs/tabs.js +1 -1
- package/cjs/components/tag/tag.js +1 -1
- package/cjs/components/text-area/text-area.css +1 -0
- package/cjs/components/text-area/text-area.js +11 -2
- package/cjs/components/toast/toast.css +2 -2
- package/cjs/components/tree-select/multiple.js +2 -6
- package/cjs/components/virtual-input/virtual-input.js +1 -1
- package/cjs/components/water-mark/water-mark.js +1 -1
- package/cjs/locales/base.d.ts +1 -1
- package/cjs/locales/base.js +1 -1
- package/cjs/locales/da-DK.d.ts +1 -1
- package/cjs/locales/da-DK.js +1 -1
- package/cjs/locales/en-US.d.ts +1 -1
- package/cjs/locales/es-ES.d.ts +1 -1
- package/cjs/locales/es-ES.js +1 -1
- package/cjs/locales/fa-IR.d.ts +1 -1
- package/cjs/locales/fa-IR.js +1 -1
- package/cjs/locales/fr-FR.d.ts +1 -1
- package/cjs/locales/fr-FR.js +1 -1
- package/cjs/locales/id-ID.d.ts +1 -1
- package/cjs/locales/id-ID.js +1 -1
- package/cjs/locales/it-IT.d.ts +1 -1
- package/cjs/locales/it-IT.js +1 -1
- package/cjs/locales/ja-JP.d.ts +1 -1
- package/cjs/locales/ja-JP.js +1 -1
- package/cjs/locales/kk-KZ.d.ts +1 -1
- package/cjs/locales/kk-KZ.js +1 -1
- package/cjs/locales/ko-KR.d.ts +1 -1
- package/cjs/locales/ko-KR.js +1 -1
- package/cjs/locales/nb-NO.d.ts +1 -1
- package/cjs/locales/nb-NO.js +1 -1
- package/cjs/locales/nl-NL.d.ts +1 -1
- package/cjs/locales/nl-NL.js +1 -1
- package/cjs/locales/ru-RU.d.ts +134 -0
- package/cjs/locales/ru-RU.js +144 -0
- package/cjs/locales/zh-CN.d.ts +1 -1
- package/cjs/locales/zh-CN.js +1 -1
- package/cjs/locales/zh-HK.d.ts +1 -1
- package/cjs/locales/zh-HK.js +1 -1
- package/cjs/locales/zh-TW.d.ts +1 -1
- package/cjs/locales/zh-TW.js +1 -1
- package/cjs/utils/replace-message.d.ts +1 -0
- package/cjs/utils/replace-message.js +13 -0
- package/cjs/utils/use-lock-scroll.js +6 -2
- package/es/components/action-sheet/action-sheet.css +1 -1
- package/es/components/button/button.css +2 -2
- package/es/components/calendar/calendar.js +5 -1
- package/es/components/calendar/convert.js +1 -6
- package/es/components/capsule-tabs/capsule-tabs.js +3 -5
- package/es/components/cascader/cascader.d.ts +2 -0
- package/es/components/cascader/index.d.ts +1 -0
- package/es/components/center-popup/center-popup.js +6 -5
- package/es/components/checkbox/checkbox.d.ts +2 -0
- package/es/components/checkbox/checkbox.js +1 -0
- package/es/components/checkbox/index.d.ts +1 -0
- package/es/components/collapse/collapse.js +29 -14
- package/es/components/date-picker/date-picker-date-utils.js +24 -36
- package/es/components/date-picker/date-picker-week-utils.js +12 -18
- package/es/components/date-picker-view/date-picker-view.d.ts +7 -5
- package/es/components/date-picker-view/date-picker-view.js +8 -2
- package/es/components/dropdown/dropdown.js +2 -2
- package/es/components/ellipsis/ellipsis.js +4 -4
- package/es/components/error-block/create-error-block.js +4 -4
- package/es/components/error-block/error-block.css +1 -1
- package/es/components/floating-panel/floating-panel.js +8 -7
- package/es/components/footer/footer.js +17 -21
- package/es/components/form/form-item.d.ts +1 -1
- package/es/components/form/form-item.js +6 -9
- package/es/components/form/form.css +1 -1
- package/es/components/form/index.css +1 -1
- package/es/components/image-uploader/image-uploader.css +1 -1
- package/es/components/image-uploader/image-uploader.js +1 -3
- package/es/components/input/input.d.ts +2 -8
- package/es/components/input/input.js +5 -1
- package/es/components/jumbo-tabs/jumbo-tabs.js +2 -2
- package/es/components/modal/modal.js +11 -13
- package/es/components/notice-bar/notice-bar.css +2 -2
- package/es/components/number-keyboard/number-keyboard.css +2 -2
- package/es/components/picker-view/wheel.js +61 -14
- package/es/components/popover/popover-menu.css +2 -2
- package/es/components/popover/popover.js +5 -7
- package/es/components/popup/popup.js +3 -3
- package/es/components/progress-bar/progress-bar.css +1 -1
- package/es/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/es/components/radio/radio.d.ts +1 -0
- package/es/components/radio/radio.js +1 -0
- package/es/components/rate/rate.d.ts +1 -1
- package/es/components/rate/star.d.ts +1 -1
- package/es/components/result/result.js +2 -2
- package/es/components/safe-area/safe-area.d.ts +1 -1
- package/es/components/safe-area/safe-area.js +1 -1
- package/es/components/side-bar/side-bar.d.ts +1 -2
- package/es/components/side-bar/side-bar.js +2 -2
- package/es/components/skeleton/skeleton.d.ts +1 -1
- package/es/components/stepper/stepper.js +1 -5
- package/es/components/steps/steps.js +5 -5
- package/es/components/swipe-action/swipe-action.d.ts +4 -3
- package/es/components/tab-bar/tab-bar.d.ts +1 -2
- package/es/components/tab-bar/tab-bar.js +2 -2
- package/es/components/tabs/tabs.js +2 -2
- package/es/components/tag/tag.js +1 -1
- package/es/components/text-area/text-area.css +1 -0
- package/es/components/text-area/text-area.js +11 -2
- package/es/components/toast/toast.css +2 -2
- package/es/components/tree-select/multiple.js +2 -6
- package/es/components/virtual-input/virtual-input.js +1 -1
- package/es/components/water-mark/water-mark.js +1 -1
- package/es/locales/base.d.ts +1 -1
- package/es/locales/base.js +1 -1
- package/es/locales/da-DK.d.ts +1 -1
- package/es/locales/da-DK.js +1 -1
- package/es/locales/en-US.d.ts +1 -1
- package/es/locales/es-ES.d.ts +1 -1
- package/es/locales/es-ES.js +1 -1
- package/es/locales/fa-IR.d.ts +1 -1
- package/es/locales/fa-IR.js +1 -1
- package/es/locales/fr-FR.d.ts +1 -1
- package/es/locales/fr-FR.js +1 -1
- package/es/locales/id-ID.d.ts +1 -1
- package/es/locales/id-ID.js +1 -1
- package/es/locales/it-IT.d.ts +1 -1
- package/es/locales/it-IT.js +1 -1
- package/es/locales/ja-JP.d.ts +1 -1
- package/es/locales/ja-JP.js +1 -1
- package/es/locales/kk-KZ.d.ts +1 -1
- package/es/locales/kk-KZ.js +1 -1
- package/es/locales/ko-KR.d.ts +1 -1
- package/es/locales/ko-KR.js +1 -1
- package/es/locales/nb-NO.d.ts +1 -1
- package/es/locales/nb-NO.js +1 -1
- package/es/locales/nl-NL.d.ts +1 -1
- package/es/locales/nl-NL.js +1 -1
- package/es/locales/ru-RU.d.ts +134 -0
- package/es/locales/ru-RU.js +137 -0
- package/es/locales/zh-CN.d.ts +1 -1
- package/es/locales/zh-CN.js +1 -1
- package/es/locales/zh-HK.d.ts +1 -1
- package/es/locales/zh-HK.js +1 -1
- package/es/locales/zh-TW.d.ts +1 -1
- package/es/locales/zh-TW.js +1 -1
- package/es/utils/replace-message.d.ts +1 -0
- package/es/utils/replace-message.js +7 -0
- package/es/utils/use-lock-scroll.js +6 -2
- package/package.json +2 -2
- package/umd/antd-mobile.js +1 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _mergeLocale = require("../utils/merge-locale");
|
|
8
|
+
var _base = require("./base");
|
|
9
|
+
const typeTemplate = '${label} не соответствует типу ${type}';
|
|
10
|
+
const ruRU = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
11
|
+
locale: 'ru',
|
|
12
|
+
common: {
|
|
13
|
+
confirm: 'Подтвердить',
|
|
14
|
+
cancel: 'Отменить',
|
|
15
|
+
loading: 'Загрузка',
|
|
16
|
+
close: 'Закрыть'
|
|
17
|
+
},
|
|
18
|
+
Calendar: {
|
|
19
|
+
markItems: ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'],
|
|
20
|
+
yearAndMonth: '${year}/${month}'
|
|
21
|
+
},
|
|
22
|
+
Cascader: {
|
|
23
|
+
placeholder: 'Выбор'
|
|
24
|
+
},
|
|
25
|
+
Dialog: {
|
|
26
|
+
ok: 'ОК'
|
|
27
|
+
},
|
|
28
|
+
DatePicker: {
|
|
29
|
+
tillNow: 'До настоящего времени'
|
|
30
|
+
},
|
|
31
|
+
ErrorBlock: {
|
|
32
|
+
default: {
|
|
33
|
+
title: 'Упс! Что-то пошло не так',
|
|
34
|
+
description: 'Пожалуйста, подождите минуту и повторите попытку'
|
|
35
|
+
},
|
|
36
|
+
busy: {
|
|
37
|
+
title: 'Упс, не загружается',
|
|
38
|
+
description: 'Попробуйте обновить страницу'
|
|
39
|
+
},
|
|
40
|
+
disconnected: {
|
|
41
|
+
title: 'Сеть занята',
|
|
42
|
+
description: 'Попробуйте обновить страницу'
|
|
43
|
+
},
|
|
44
|
+
empty: {
|
|
45
|
+
title: 'Хм, не могу найти...',
|
|
46
|
+
description: 'Хотите попробовать другой запрос?'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
Form: {
|
|
50
|
+
required: 'Обязательное',
|
|
51
|
+
optional: 'Опциональное',
|
|
52
|
+
defaultValidateMessages: {
|
|
53
|
+
default: 'Ошибка валидации поля ${label}',
|
|
54
|
+
required: 'Пожалуйста, заполните поле ${label}',
|
|
55
|
+
enum: 'Значение ${label} должно быть одним из [${enum}]',
|
|
56
|
+
whitespace: '${label} не может быть пустым символом',
|
|
57
|
+
date: {
|
|
58
|
+
format: '${label} имеет некорректный формат даты',
|
|
59
|
+
parse: '${label} не может быть конвертировано в дату',
|
|
60
|
+
invalid: '${label} не является валидной датой'
|
|
61
|
+
},
|
|
62
|
+
types: {
|
|
63
|
+
string: typeTemplate,
|
|
64
|
+
method: typeTemplate,
|
|
65
|
+
array: typeTemplate,
|
|
66
|
+
object: typeTemplate,
|
|
67
|
+
number: typeTemplate,
|
|
68
|
+
date: typeTemplate,
|
|
69
|
+
boolean: typeTemplate,
|
|
70
|
+
integer: typeTemplate,
|
|
71
|
+
float: typeTemplate,
|
|
72
|
+
regexp: typeTemplate,
|
|
73
|
+
email: typeTemplate,
|
|
74
|
+
url: typeTemplate,
|
|
75
|
+
hex: typeTemplate
|
|
76
|
+
},
|
|
77
|
+
string: {
|
|
78
|
+
len: 'Длина ${label} должна быть ${len} символов(-а)',
|
|
79
|
+
min: 'Длина ${label} должна быть не меньше ${min} символов(-а)',
|
|
80
|
+
max: 'Длина ${label} должна быть не больше ${max} символов(-а)',
|
|
81
|
+
range: 'Длина ${label} должна быть в диапазоне от ${min} до ${max} символов(-а)'
|
|
82
|
+
},
|
|
83
|
+
number: {
|
|
84
|
+
len: '${label} должно быть равно ${len}',
|
|
85
|
+
min: '${label} должно быть значением не меньше ${min}',
|
|
86
|
+
max: '${label} должно быть значением не больше ${max}',
|
|
87
|
+
range: '${label} должно быть значением в диапазоне от ${min} до ${max}'
|
|
88
|
+
},
|
|
89
|
+
array: {
|
|
90
|
+
len: 'Размер ${label} должен быть ${len}',
|
|
91
|
+
min: 'Размер ${label} должен быть не меньше ${min}',
|
|
92
|
+
max: 'Размер ${label} должен быть не больше ${max}',
|
|
93
|
+
range: 'Размер ${label} должен быть в диапазоне от ${min} до ${max}'
|
|
94
|
+
},
|
|
95
|
+
pattern: {
|
|
96
|
+
mismatch: '${label} не соответствует шаблону ${pattern}'
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
ImageUploader: {
|
|
101
|
+
uploading: 'Выгружается...',
|
|
102
|
+
upload: 'Выгрузить'
|
|
103
|
+
},
|
|
104
|
+
InfiniteScroll: {
|
|
105
|
+
noMore: 'Больше нет',
|
|
106
|
+
failedToLoad: 'Ошибка загрузки',
|
|
107
|
+
retry: 'Повторить'
|
|
108
|
+
},
|
|
109
|
+
Input: {
|
|
110
|
+
clear: 'очистить'
|
|
111
|
+
},
|
|
112
|
+
Mask: {
|
|
113
|
+
name: 'Маска'
|
|
114
|
+
},
|
|
115
|
+
Modal: {
|
|
116
|
+
ok: 'ОК'
|
|
117
|
+
},
|
|
118
|
+
PasscodeInput: {
|
|
119
|
+
name: 'Ввод пароля'
|
|
120
|
+
},
|
|
121
|
+
PullToRefresh: {
|
|
122
|
+
pulling: 'Прокрутите вниз, чтобы обновления',
|
|
123
|
+
canRelease: 'Отпустите, чтобы немедленно обновить',
|
|
124
|
+
complete: 'Обновление успешно'
|
|
125
|
+
},
|
|
126
|
+
SearchBar: {
|
|
127
|
+
name: 'Панель поиска'
|
|
128
|
+
},
|
|
129
|
+
Slider: {
|
|
130
|
+
name: 'Слайдер'
|
|
131
|
+
},
|
|
132
|
+
Stepper: {
|
|
133
|
+
decrease: 'вычесть',
|
|
134
|
+
increase: 'прибавить'
|
|
135
|
+
},
|
|
136
|
+
Switch: {
|
|
137
|
+
name: 'Переключатель'
|
|
138
|
+
},
|
|
139
|
+
Selector: {
|
|
140
|
+
name: 'Селектор'
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
var _default = ruRU;
|
|
144
|
+
exports.default = _default;
|
package/2x/cjs/locales/zh-CN.js
CHANGED
|
@@ -17,7 +17,7 @@ const zhCN = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
17
17
|
},
|
|
18
18
|
Calendar: {
|
|
19
19
|
markItems: ['一', '二', '三', '四', '五', '六', '日'],
|
|
20
|
-
|
|
20
|
+
yearAndMonth: '${year}年${month}月'
|
|
21
21
|
},
|
|
22
22
|
Cascader: {
|
|
23
23
|
placeholder: '请选择'
|
package/2x/cjs/locales/zh-HK.js
CHANGED
|
@@ -17,7 +17,7 @@ const zhHK = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
17
17
|
},
|
|
18
18
|
Calendar: {
|
|
19
19
|
markItems: ['一', '二', '三', '四', '五', '六', '日'],
|
|
20
|
-
|
|
20
|
+
yearAndMonth: '${year}年${month}月'
|
|
21
21
|
},
|
|
22
22
|
Cascader: {
|
|
23
23
|
placeholder: '請選擇'
|
package/2x/cjs/locales/zh-TW.js
CHANGED
|
@@ -17,7 +17,7 @@ const zhTW = (0, _mergeLocale.mergeLocale)(_base.base, {
|
|
|
17
17
|
},
|
|
18
18
|
Calendar: {
|
|
19
19
|
markItems: ['一', '二', '三', '四', '五', '六', '日'],
|
|
20
|
-
|
|
20
|
+
yearAndMonth: '${year}年${month}月'
|
|
21
21
|
},
|
|
22
22
|
Cascader: {
|
|
23
23
|
placeholder: '請選擇'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function replaceMessage(template: string, kv: Record<string, string>): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.replaceMessage = replaceMessage;
|
|
7
|
+
// 移植自 field-form https://github.com/react-component/field-form/blob/master/src/utils/validateUtil.ts#L21
|
|
8
|
+
function replaceMessage(template, kv) {
|
|
9
|
+
return template.replace(/\$\{\w+\}/g, str => {
|
|
10
|
+
const key = str.slice(2, -1);
|
|
11
|
+
return kv[key];
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -41,14 +41,18 @@ function useLockScroll(rootRef, shouldLock) {
|
|
|
41
41
|
offsetHeight,
|
|
42
42
|
scrollTop
|
|
43
43
|
} = el;
|
|
44
|
+
const {
|
|
45
|
+
height
|
|
46
|
+
} = el.getBoundingClientRect();
|
|
44
47
|
let status = '11';
|
|
45
48
|
if (scrollTop === 0) {
|
|
46
49
|
status = offsetHeight >= scrollHeight ? '00' : '01';
|
|
47
|
-
} else if (
|
|
50
|
+
} else if (scrollHeight <= Math.round(height + scrollTop)) {
|
|
48
51
|
status = '10';
|
|
49
52
|
}
|
|
50
53
|
if (status !== '11' && touch.isVertical() && !(parseInt(status, 2) & parseInt(direction, 2))) {
|
|
51
|
-
if (event.cancelable) {
|
|
54
|
+
if (event.cancelable && _supportsPassive.supportsPassive) {
|
|
55
|
+
// https://github.com/ant-design/ant-design-mobile/issues/6282
|
|
52
56
|
event.preventDefault();
|
|
53
57
|
}
|
|
54
58
|
}
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
transform: translate(calc(var(--border-width) * -1), calc(var(--border-width) * -1));
|
|
37
37
|
width: 100%;
|
|
38
38
|
height: 100%;
|
|
39
|
-
background-color:
|
|
40
|
-
border: var(--border-width) var(--border-style)
|
|
39
|
+
background-color: var(--adm-color-text-dark-solid);
|
|
40
|
+
border: var(--border-width) var(--border-style) var(--adm-color-text-dark-solid);
|
|
41
41
|
border-radius: var(--border-radius);
|
|
42
42
|
opacity: 0;
|
|
43
43
|
content: ' ';
|
|
@@ -9,6 +9,7 @@ import { useConfig } from '../config-provider';
|
|
|
9
9
|
import isoWeek from 'dayjs/plugin/isoWeek';
|
|
10
10
|
import { useUpdateEffect } from 'ahooks';
|
|
11
11
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
12
|
+
import { replaceMessage } from '../../utils/replace-message';
|
|
12
13
|
import { convertValueToRange, convertPageToDayjs } from './convert';
|
|
13
14
|
dayjs.extend(isoWeek);
|
|
14
15
|
const classPrefix = 'adm-calendar';
|
|
@@ -97,7 +98,10 @@ export const Calendar = forwardRef((p, ref) => {
|
|
|
97
98
|
}
|
|
98
99
|
}, props.prevMonthButton), React.createElement("div", {
|
|
99
100
|
className: `${classPrefix}-title`
|
|
100
|
-
}, locale.Calendar.
|
|
101
|
+
}, replaceMessage(locale.Calendar.yearAndMonth, {
|
|
102
|
+
year: current.year().toString(),
|
|
103
|
+
month: (current.month() + 1).toString()
|
|
104
|
+
})), React.createElement("a", {
|
|
101
105
|
className: classNames(`${classPrefix}-arrow-button`, `${classPrefix}-arrow-button-right`, `${classPrefix}-arrow-button-right-month`),
|
|
102
106
|
onClick: () => {
|
|
103
107
|
handlePageChange('add', 1, 'month');
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
2
|
export function convertValueToRange(selectionMode, value) {
|
|
3
|
-
if (selectionMode === undefined)
|
|
4
|
-
return null;
|
|
5
|
-
}
|
|
6
|
-
if (value === null) {
|
|
7
|
-
return null;
|
|
8
|
-
}
|
|
3
|
+
if (selectionMode === undefined || value === null) return null;
|
|
9
4
|
if (Array.isArray(value)) {
|
|
10
5
|
return value;
|
|
11
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
1
|
+
import React, { isValidElement, useRef } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { animated } from '@react-spring/web';
|
|
4
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
@@ -9,9 +9,7 @@ import ScrollMask from '../scroll-mask';
|
|
|
9
9
|
import { ShouldRender } from '../../utils/should-render';
|
|
10
10
|
import { traverseReactNode } from '../../utils/traverse-react-node';
|
|
11
11
|
const classPrefix = `adm-capsule-tabs`;
|
|
12
|
-
export const CapsuleTab = () =>
|
|
13
|
-
return null;
|
|
14
|
-
};
|
|
12
|
+
export const CapsuleTab = () => null;
|
|
15
13
|
export const CapsuleTabs = props => {
|
|
16
14
|
var _a;
|
|
17
15
|
const tabListContainerRef = useRef(null);
|
|
@@ -20,7 +18,7 @@ export const CapsuleTabs = props => {
|
|
|
20
18
|
let firstActiveKey = null;
|
|
21
19
|
const panes = [];
|
|
22
20
|
traverseReactNode(props.children, (child, index) => {
|
|
23
|
-
if (!
|
|
21
|
+
if (!isValidElement(child)) return;
|
|
24
22
|
const key = child.key;
|
|
25
23
|
if (typeof key !== 'string') return;
|
|
26
24
|
if (index === 0) {
|
|
@@ -21,6 +21,7 @@ export declare type CascaderProps = {
|
|
|
21
21
|
title?: ReactNode;
|
|
22
22
|
confirmText?: ReactNode;
|
|
23
23
|
cancelText?: ReactNode;
|
|
24
|
+
loading?: boolean;
|
|
24
25
|
children?: (items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode;
|
|
25
26
|
onTabsChange?: (index: number) => void;
|
|
26
27
|
activeIcon?: ReactNode;
|
|
@@ -38,6 +39,7 @@ export declare const Cascader: React.ForwardRefExoticComponent<{
|
|
|
38
39
|
title?: ReactNode;
|
|
39
40
|
confirmText?: ReactNode;
|
|
40
41
|
cancelText?: ReactNode;
|
|
42
|
+
loading?: boolean | undefined;
|
|
41
43
|
children?: ((items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode) | undefined;
|
|
42
44
|
onTabsChange?: ((index: number) => void) | undefined;
|
|
43
45
|
activeIcon?: ReactNode;
|
|
@@ -15,6 +15,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
15
15
|
title?: import("react").ReactNode;
|
|
16
16
|
confirmText?: import("react").ReactNode;
|
|
17
17
|
cancelText?: import("react").ReactNode;
|
|
18
|
+
loading?: boolean | undefined;
|
|
18
19
|
children?: ((items: (import("../cascader-view").CascaderOption | null)[], actions: import("./cascader").CascaderActions) => import("react").ReactNode) | undefined;
|
|
19
20
|
onTabsChange?: ((index: number) => void) | undefined;
|
|
20
21
|
activeIcon?: import("react").ReactNode;
|
|
@@ -12,6 +12,7 @@ import { ShouldRender } from '../../utils/should-render';
|
|
|
12
12
|
import { useLockScroll } from '../../utils/use-lock-scroll';
|
|
13
13
|
import { CloseOutline } from 'antd-mobile-icons';
|
|
14
14
|
import { defaultPopupBaseProps } from '../popup/popup-base-props';
|
|
15
|
+
const classPrefix = 'adm-center-popup';
|
|
15
16
|
const defaultProps = Object.assign(Object.assign({}, defaultPopupBaseProps), {
|
|
16
17
|
getContainer: null
|
|
17
18
|
});
|
|
@@ -48,11 +49,11 @@ export const CenterPopup = p => {
|
|
|
48
49
|
useLockScroll(ref, props.disableBodyScroll && active);
|
|
49
50
|
const maskVisible = useInnerVisible(active && props.visible);
|
|
50
51
|
const body = React.createElement("div", {
|
|
51
|
-
className: classNames(
|
|
52
|
+
className: classNames(`${classPrefix}-body`, props.bodyClassName),
|
|
52
53
|
style: props.bodyStyle
|
|
53
54
|
}, props.children);
|
|
54
55
|
const node = withStopPropagation(props.stopPropagation, withNativeProps(props, React.createElement("div", {
|
|
55
|
-
className:
|
|
56
|
+
className: classPrefix,
|
|
56
57
|
style: {
|
|
57
58
|
display: active ? undefined : 'none',
|
|
58
59
|
pointerEvents: active ? undefined : 'none'
|
|
@@ -69,18 +70,18 @@ export const CenterPopup = p => {
|
|
|
69
70
|
}
|
|
70
71
|
},
|
|
71
72
|
style: props.maskStyle,
|
|
72
|
-
className: classNames(
|
|
73
|
+
className: classNames(`${classPrefix}-mask`, props.maskClassName),
|
|
73
74
|
disableBodyScroll: false,
|
|
74
75
|
stopPropagation: props.stopPropagation
|
|
75
76
|
}), React.createElement("div", {
|
|
76
|
-
className:
|
|
77
|
+
className: `${classPrefix}-wrap`,
|
|
77
78
|
role: props.role,
|
|
78
79
|
"aria-label": props['aria-label']
|
|
79
80
|
}, React.createElement(animated.div, {
|
|
80
81
|
style: style,
|
|
81
82
|
ref: ref
|
|
82
83
|
}, props.showCloseButton && React.createElement("a", {
|
|
83
|
-
className: classNames(
|
|
84
|
+
className: classNames(`${classPrefix}-close`, 'adm-plain-anchor'),
|
|
84
85
|
onClick: () => {
|
|
85
86
|
var _a;
|
|
86
87
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
@@ -12,6 +12,7 @@ export declare type CheckboxProps = {
|
|
|
12
12
|
id?: string;
|
|
13
13
|
icon?: (checked: boolean, indeterminate: boolean) => React.ReactNode;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
|
+
onClick?: (event: React.MouseEvent<HTMLLabelElement, MouseEvent>) => void;
|
|
15
16
|
} & NativeProps<'--icon-size' | '--font-size' | '--gap'>;
|
|
16
17
|
export declare type CheckboxRef = {
|
|
17
18
|
check: () => void;
|
|
@@ -29,6 +30,7 @@ export declare const Checkbox: React.ForwardRefExoticComponent<{
|
|
|
29
30
|
id?: string | undefined;
|
|
30
31
|
icon?: ((checked: boolean, indeterminate: boolean) => React.ReactNode) | undefined;
|
|
31
32
|
children?: React.ReactNode;
|
|
33
|
+
onClick?: ((event: React.MouseEvent<HTMLLabelElement, MouseEvent>) => void) | undefined;
|
|
32
34
|
} & {
|
|
33
35
|
className?: string | undefined;
|
|
34
36
|
style?: (React.CSSProperties & Partial<Record<"--font-size" | "--icon-size" | "--gap", string>>) | undefined;
|
|
@@ -69,6 +69,7 @@ export const Checkbox = forwardRef((p, ref) => {
|
|
|
69
69
|
}, props.indeterminate ? React.createElement(IndeterminateIcon, null) : checked && React.createElement(CheckIcon, null));
|
|
70
70
|
};
|
|
71
71
|
return withNativeProps(props, React.createElement("label", {
|
|
72
|
+
onClick: props.onClick,
|
|
72
73
|
className: classNames(classPrefix, {
|
|
73
74
|
[`${classPrefix}-checked`]: checked && !props.indeterminate,
|
|
74
75
|
[`${classPrefix}-indeterminate`]: props.indeterminate,
|
|
@@ -12,6 +12,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
12
12
|
id?: string | undefined;
|
|
13
13
|
icon?: ((checked: boolean, indeterminate: boolean) => import("react").ReactNode) | undefined;
|
|
14
14
|
children?: import("react").ReactNode;
|
|
15
|
+
onClick?: ((event: import("react").MouseEvent<HTMLLabelElement, MouseEvent>) => void) | undefined;
|
|
15
16
|
} & {
|
|
16
17
|
className?: string | undefined;
|
|
17
18
|
style?: (import("react").CSSProperties & Partial<Record<"--font-size" | "--icon-size" | "--gap", string>>) | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useRef } from 'react';
|
|
1
|
+
import React, { isValidElement, useRef } from 'react';
|
|
2
2
|
import { withNativeProps } from '../../utils/native-props';
|
|
3
3
|
import List from '../list';
|
|
4
4
|
import { DownOutline } from 'antd-mobile-icons';
|
|
@@ -78,26 +78,41 @@ const CollapsePanelContent = props => {
|
|
|
78
78
|
}, React.createElement(List.Item, null, shouldRender && props.children)));
|
|
79
79
|
};
|
|
80
80
|
export const Collapse = props => {
|
|
81
|
-
var _a;
|
|
82
81
|
const panels = [];
|
|
83
82
|
traverseReactNode(props.children, child => {
|
|
84
|
-
if (!
|
|
83
|
+
if (!isValidElement(child)) return;
|
|
85
84
|
const key = child.key;
|
|
86
85
|
if (typeof key !== 'string') return;
|
|
87
86
|
panels.push(child);
|
|
88
87
|
});
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
88
|
+
const handlePropsValue = () => {
|
|
89
|
+
var _a;
|
|
90
|
+
if (!props.accordion) {
|
|
91
|
+
return {
|
|
92
|
+
value: props.activeKey,
|
|
93
|
+
defaultValue: (_a = props.defaultActiveKey) !== null && _a !== void 0 ? _a : [],
|
|
94
|
+
onChange: props.onChange
|
|
95
|
+
};
|
|
95
96
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
const initValue = {
|
|
98
|
+
value: [],
|
|
99
|
+
defaultValue: [],
|
|
100
|
+
onChange: v => {
|
|
101
|
+
var _a, _b;
|
|
102
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, (_b = v[0]) !== null && _b !== void 0 ? _b : null);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
if (props.activeKey === undefined) {
|
|
106
|
+
initValue.value = undefined;
|
|
107
|
+
} else if (props.activeKey !== null) {
|
|
108
|
+
initValue.value = [props.activeKey];
|
|
109
|
+
}
|
|
110
|
+
if (![null, undefined].includes(props.defaultActiveKey)) {
|
|
111
|
+
initValue.defaultValue = [props.defaultActiveKey];
|
|
112
|
+
}
|
|
113
|
+
return initValue;
|
|
114
|
+
};
|
|
115
|
+
const [activeKey, setActiveKey] = usePropsValue(handlePropsValue());
|
|
101
116
|
const activeKeyList = activeKey === null ? [] : Array.isArray(activeKey) ? activeKey : [activeKey];
|
|
102
117
|
return withNativeProps(props, React.createElement("div", {
|
|
103
118
|
className: classPrefix
|
|
@@ -66,67 +66,55 @@ export function generateDatePickerColumns(selected, min, max, precision, renderL
|
|
|
66
66
|
const lower = minYear;
|
|
67
67
|
const upper = maxYear;
|
|
68
68
|
const years = generateColumn(lower, upper, 'year');
|
|
69
|
-
ret.push(years.map(v => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
};
|
|
74
|
-
}));
|
|
69
|
+
ret.push(years.map(v => ({
|
|
70
|
+
label: renderLabel('year', v),
|
|
71
|
+
value: v.toString()
|
|
72
|
+
})));
|
|
75
73
|
}
|
|
76
74
|
if (rank >= precisionRankRecord.month) {
|
|
77
75
|
const lower = isInMinYear ? minMonth : 1;
|
|
78
76
|
const upper = isInMaxYear ? maxMonth : 12;
|
|
79
77
|
const months = generateColumn(lower, upper, 'month');
|
|
80
|
-
ret.push(months.map(v => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
};
|
|
85
|
-
}));
|
|
78
|
+
ret.push(months.map(v => ({
|
|
79
|
+
label: renderLabel('month', v),
|
|
80
|
+
value: v.toString()
|
|
81
|
+
})));
|
|
86
82
|
}
|
|
87
83
|
if (rank >= precisionRankRecord.day) {
|
|
88
84
|
const lower = isInMinMonth ? minDay : 1;
|
|
89
85
|
const upper = isInMaxMonth ? maxDay : firstDayInSelectedMonth.daysInMonth();
|
|
90
86
|
const days = generateColumn(lower, upper, 'day');
|
|
91
|
-
ret.push(days.map(v => {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
};
|
|
96
|
-
}));
|
|
87
|
+
ret.push(days.map(v => ({
|
|
88
|
+
label: renderLabel('day', v),
|
|
89
|
+
value: v.toString()
|
|
90
|
+
})));
|
|
97
91
|
}
|
|
98
92
|
if (rank >= precisionRankRecord.hour) {
|
|
99
93
|
const lower = isInMinDay ? minHour : 0;
|
|
100
94
|
const upper = isInMaxDay ? maxHour : 23;
|
|
101
95
|
const hours = generateColumn(lower, upper, 'hour');
|
|
102
|
-
ret.push(hours.map(v => {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
};
|
|
107
|
-
}));
|
|
96
|
+
ret.push(hours.map(v => ({
|
|
97
|
+
label: renderLabel('hour', v),
|
|
98
|
+
value: v.toString()
|
|
99
|
+
})));
|
|
108
100
|
}
|
|
109
101
|
if (rank >= precisionRankRecord.minute) {
|
|
110
102
|
const lower = isInMinHour ? minMinute : 0;
|
|
111
103
|
const upper = isInMaxHour ? maxMinute : 59;
|
|
112
104
|
const minutes = generateColumn(lower, upper, 'minute');
|
|
113
|
-
ret.push(minutes.map(v => {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
};
|
|
118
|
-
}));
|
|
105
|
+
ret.push(minutes.map(v => ({
|
|
106
|
+
label: renderLabel('minute', v),
|
|
107
|
+
value: v.toString()
|
|
108
|
+
})));
|
|
119
109
|
}
|
|
120
110
|
if (rank >= precisionRankRecord.second) {
|
|
121
111
|
const lower = isInMinMinute ? minSecond : 0;
|
|
122
112
|
const upper = isInMaxMinute ? maxSecond : 59;
|
|
123
113
|
const seconds = generateColumn(lower, upper, 'second');
|
|
124
|
-
ret.push(seconds.map(v => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
};
|
|
129
|
-
}));
|
|
114
|
+
ret.push(seconds.map(v => ({
|
|
115
|
+
label: renderLabel('second', v),
|
|
116
|
+
value: v.toString()
|
|
117
|
+
})));
|
|
130
118
|
}
|
|
131
119
|
// Till Now
|
|
132
120
|
if (tillNow) {
|
|
@@ -49,34 +49,28 @@ export function generateDatePickerColumns(selected, min, max, precision, renderL
|
|
|
49
49
|
const lower = minYear;
|
|
50
50
|
const upper = maxYear;
|
|
51
51
|
const years = generateColumn(lower, upper, 'year');
|
|
52
|
-
ret.push(years.map(v => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
}));
|
|
52
|
+
ret.push(years.map(v => ({
|
|
53
|
+
label: renderLabel('year', v),
|
|
54
|
+
value: v.toString()
|
|
55
|
+
})));
|
|
58
56
|
}
|
|
59
57
|
if (rank >= precisionRankRecord.week) {
|
|
60
58
|
const lower = isInMinYear ? minWeek : 1;
|
|
61
59
|
const upper = isInMaxYear ? maxWeek : selectedYearWeeks;
|
|
62
60
|
const weeks = generateColumn(lower, upper, 'week');
|
|
63
|
-
ret.push(weeks.map(v => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
};
|
|
68
|
-
}));
|
|
61
|
+
ret.push(weeks.map(v => ({
|
|
62
|
+
label: renderLabel('week', v),
|
|
63
|
+
value: v.toString()
|
|
64
|
+
})));
|
|
69
65
|
}
|
|
70
66
|
if (rank >= precisionRankRecord['week-day']) {
|
|
71
67
|
const lower = isInMinWeek ? minWeekday : 1;
|
|
72
68
|
const upper = isInMaxWeek ? maxWeekday : 7;
|
|
73
69
|
const weeks = generateColumn(lower, upper, 'week-day');
|
|
74
|
-
ret.push(weeks.map(v => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
}));
|
|
70
|
+
ret.push(weeks.map(v => ({
|
|
71
|
+
label: renderLabel('week-day', v),
|
|
72
|
+
value: v.toString()
|
|
73
|
+
})));
|
|
80
74
|
}
|
|
81
75
|
return ret;
|
|
82
76
|
}
|
|
@@ -2,15 +2,17 @@ import { FC, ReactNode } from 'react';
|
|
|
2
2
|
import type { PickerViewProps } from '../picker-view';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
import type { Precision, DatePickerFilter } from '../date-picker/date-picker-utils';
|
|
5
|
+
import type { PickerDate } from '../date-picker/util';
|
|
5
6
|
export declare type RenderLabel = (type: Precision | 'now', data: number) => ReactNode;
|
|
6
7
|
export declare type DatePickerViewProps = Pick<PickerViewProps, 'style' | 'mouseWheel' | 'loading' | 'loadingContent'> & {
|
|
7
|
-
value?:
|
|
8
|
-
defaultValue?:
|
|
9
|
-
onChange?: (value:
|
|
10
|
-
min?:
|
|
11
|
-
max?:
|
|
8
|
+
value?: PickerDate;
|
|
9
|
+
defaultValue?: PickerDate;
|
|
10
|
+
onChange?: (value: PickerDate) => void;
|
|
11
|
+
min?: PickerDate;
|
|
12
|
+
max?: PickerDate;
|
|
12
13
|
precision?: Precision;
|
|
13
14
|
renderLabel?: RenderLabel;
|
|
14
15
|
filter?: DatePickerFilter;
|
|
16
|
+
tillNow?: boolean;
|
|
15
17
|
} & NativeProps;
|
|
16
18
|
export declare const DatePickerView: FC<DatePickerViewProps>;
|