antd-mobile 5.10.2 → 5.11.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/cjs/components/auto-center/auto-center.d.ts +4 -2
- package/2x/cjs/components/badge/badge.d.ts +1 -0
- package/2x/cjs/components/button/button.d.ts +6 -4
- package/2x/cjs/components/button/button.js +31 -7
- package/2x/cjs/components/calendar/calendar.css +2 -2
- package/2x/cjs/components/calendar/calendar.d.ts +2 -0
- package/2x/cjs/components/calendar/calendar.js +7 -2
- package/2x/cjs/components/capsule-tabs/capsule-tabs.d.ts +3 -1
- package/2x/cjs/components/card/card.d.ts +1 -0
- package/2x/cjs/components/check-list/check-list.d.ts +2 -1
- package/2x/cjs/components/checkbox/checkbox.d.ts +1 -0
- package/2x/cjs/components/checkbox/group.d.ts +2 -1
- package/2x/cjs/components/collapse/collapse.d.ts +4 -1
- package/2x/cjs/components/config-provider/config-provider.d.ts +2 -1
- package/2x/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/2x/cjs/components/date-picker/date-picker.js +3 -1
- package/2x/cjs/components/date-picker-view/date-picker-view.d.ts +1 -1
- package/2x/cjs/components/date-picker-view/date-picker-view.js +1 -0
- package/2x/cjs/components/dialog/dialog-action-button.js +3 -26
- package/2x/cjs/components/divider/divider.d.ts +2 -1
- package/2x/cjs/components/dropdown/item.d.ts +2 -1
- package/2x/cjs/components/error-block/error-block.d.ts +2 -1
- package/2x/cjs/components/floating-bubble/floating-bubble.d.ts +1 -0
- package/2x/cjs/components/floating-panel/floating-panel.js +1 -1
- package/2x/cjs/components/form/context.d.ts +1 -0
- package/2x/cjs/components/form/context.js +2 -1
- package/2x/cjs/components/form/form-item.css +2 -2
- package/2x/cjs/components/form/form-item.js +5 -2
- package/2x/cjs/components/form/form.d.ts +0 -3
- package/2x/cjs/components/form/form.js +4 -2
- package/2x/cjs/components/form/header.d.ts +4 -2
- package/2x/cjs/components/form/index.css +2 -2
- package/2x/cjs/components/form/index.d.ts +5 -3
- package/2x/cjs/components/form/index.js +2 -1
- package/2x/cjs/components/grid/grid.d.ts +2 -0
- package/2x/cjs/components/image-uploader/image-uploader.d.ts +2 -1
- package/2x/cjs/components/index-bar/panel.d.ts +1 -0
- package/2x/cjs/components/infinite-scroll/infinite-scroll.d.ts +2 -1
- package/2x/cjs/components/infinite-scroll/infinite-scroll.js +6 -1
- package/2x/cjs/components/input/input.css +4 -0
- package/2x/cjs/components/input/input.d.ts +4 -2
- package/2x/cjs/components/input/input.js +15 -3
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.d.ts +3 -1
- package/2x/cjs/components/list/list.css +1 -0
- package/2x/cjs/components/list/list.d.ts +1 -0
- package/2x/cjs/components/mask/mask.d.ts +1 -0
- package/2x/cjs/components/modal/modal-action-button.js +3 -26
- package/2x/cjs/components/nav-bar/nav-bar.d.ts +2 -1
- package/2x/cjs/components/picker/picker.d.ts +1 -0
- package/2x/cjs/components/picker/picker.js +1 -0
- package/2x/cjs/components/picker-view/picker-view.d.ts +1 -0
- package/2x/cjs/components/picker-view/picker-view.js +4 -2
- package/2x/cjs/components/picker-view/wheel.d.ts +1 -0
- package/2x/cjs/components/picker-view/wheel.js +24 -4
- package/2x/cjs/components/popover/wrapper.d.ts +3 -1
- package/2x/cjs/components/popup/popup.d.ts +1 -0
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.d.ts +2 -1
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +2 -2
- package/2x/cjs/components/radio/group.d.ts +2 -1
- package/2x/cjs/components/radio/radio.d.ts +1 -0
- package/2x/cjs/components/search-bar/search-bar.d.ts +2 -0
- package/2x/cjs/components/search-bar/search-bar.js +2 -0
- package/2x/cjs/components/side-bar/side-bar.d.ts +2 -0
- package/2x/cjs/components/space/space.d.ts +1 -0
- package/2x/cjs/components/steps/steps.d.ts +2 -1
- package/2x/cjs/components/swiper/index.d.ts +2 -16
- package/2x/cjs/components/swiper/swiper-item.d.ts +1 -0
- package/2x/cjs/components/swiper/swiper.d.ts +1 -16
- package/2x/cjs/components/tab-bar/tab-bar.d.ts +2 -0
- package/2x/cjs/components/tabs/tabs.d.ts +3 -1
- package/2x/cjs/components/tag/tag.d.ts +1 -0
- package/2x/cjs/components/text-area/text-area.d.ts +2 -2
- package/2x/cjs/components/text-area/text-area.js +2 -1
- package/2x/cjs/global/index.js +2 -0
- package/2x/cjs/locales/base.d.ts +3 -0
- package/2x/cjs/locales/base.js +4 -1
- package/2x/cjs/locales/en-US.d.ts +3 -0
- package/2x/cjs/locales/es-ES.d.ts +3 -0
- package/2x/cjs/locales/es-ES.js +1 -1
- package/2x/cjs/locales/fa-IR.d.ts +3 -0
- package/2x/cjs/locales/ko-KR.d.ts +3 -0
- package/2x/cjs/locales/ko-KR.js +2 -2
- package/2x/cjs/locales/zh-CN.d.ts +3 -0
- package/2x/cjs/locales/zh-CN.js +4 -1
- package/2x/cjs/locales/zh-HK.d.ts +3 -0
- package/2x/cjs/locales/zh-HK.js +4 -1
- package/2x/cjs/locales/zh-TW.d.ts +3 -0
- package/2x/cjs/locales/zh-TW.js +4 -1
- package/2x/cjs/utils/get-scroll-parent.js +7 -4
- package/2x/es/components/auto-center/auto-center.d.ts +4 -2
- package/2x/es/components/badge/badge.d.ts +1 -0
- package/2x/es/components/button/button.d.ts +6 -4
- package/2x/es/components/button/button.js +30 -8
- package/2x/es/components/calendar/calendar.css +2 -2
- package/2x/es/components/calendar/calendar.d.ts +2 -0
- package/2x/es/components/calendar/calendar.js +7 -3
- package/2x/es/components/capsule-tabs/capsule-tabs.d.ts +3 -1
- package/2x/es/components/card/card.d.ts +1 -0
- package/2x/es/components/check-list/check-list.d.ts +2 -1
- package/2x/es/components/checkbox/checkbox.d.ts +1 -0
- package/2x/es/components/checkbox/group.d.ts +2 -1
- package/2x/es/components/collapse/collapse.d.ts +4 -1
- package/2x/es/components/config-provider/config-provider.d.ts +2 -1
- package/2x/es/components/date-picker/date-picker.d.ts +1 -1
- package/2x/es/components/date-picker/date-picker.js +3 -1
- package/2x/es/components/date-picker-view/date-picker-view.d.ts +1 -1
- package/2x/es/components/date-picker-view/date-picker-view.js +1 -0
- package/2x/es/components/dialog/dialog-action-button.js +3 -21
- package/2x/es/components/divider/divider.d.ts +2 -1
- package/2x/es/components/dropdown/item.d.ts +2 -1
- package/2x/es/components/error-block/error-block.d.ts +2 -1
- package/2x/es/components/floating-bubble/floating-bubble.d.ts +1 -0
- package/2x/es/components/floating-panel/floating-panel.js +1 -1
- package/2x/es/components/form/context.d.ts +1 -0
- package/2x/es/components/form/context.js +2 -1
- package/2x/es/components/form/form-item.css +2 -2
- package/2x/es/components/form/form-item.js +5 -2
- package/2x/es/components/form/form.d.ts +0 -3
- package/2x/es/components/form/form.js +4 -2
- package/2x/es/components/form/header.d.ts +4 -2
- package/2x/es/components/form/index.css +2 -2
- package/2x/es/components/form/index.d.ts +5 -3
- package/2x/es/components/form/index.js +3 -2
- package/2x/es/components/grid/grid.d.ts +2 -0
- package/2x/es/components/image-uploader/image-uploader.d.ts +2 -1
- package/2x/es/components/index-bar/panel.d.ts +1 -0
- package/2x/es/components/infinite-scroll/infinite-scroll.d.ts +2 -1
- package/2x/es/components/infinite-scroll/infinite-scroll.js +5 -1
- package/2x/es/components/input/input.css +4 -0
- package/2x/es/components/input/input.d.ts +4 -2
- package/2x/es/components/input/input.js +15 -3
- package/2x/es/components/jumbo-tabs/jumbo-tabs.d.ts +3 -1
- package/2x/es/components/list/list.css +1 -0
- package/2x/es/components/list/list.d.ts +1 -0
- package/2x/es/components/mask/mask.d.ts +1 -0
- package/2x/es/components/modal/modal-action-button.js +3 -21
- package/2x/es/components/nav-bar/nav-bar.d.ts +2 -1
- package/2x/es/components/picker/picker.d.ts +1 -0
- package/2x/es/components/picker/picker.js +1 -0
- package/2x/es/components/picker-view/picker-view.d.ts +1 -0
- package/2x/es/components/picker-view/picker-view.js +4 -2
- package/2x/es/components/picker-view/wheel.d.ts +1 -0
- package/2x/es/components/picker-view/wheel.js +24 -5
- package/2x/es/components/popover/wrapper.d.ts +3 -1
- package/2x/es/components/popup/popup.d.ts +1 -0
- package/2x/es/components/pull-to-refresh/pull-to-refresh.d.ts +2 -1
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +2 -2
- package/2x/es/components/radio/group.d.ts +2 -1
- package/2x/es/components/radio/radio.d.ts +1 -0
- package/2x/es/components/search-bar/search-bar.d.ts +2 -0
- package/2x/es/components/search-bar/search-bar.js +2 -0
- package/2x/es/components/side-bar/side-bar.d.ts +2 -0
- package/2x/es/components/space/space.d.ts +1 -0
- package/2x/es/components/steps/steps.d.ts +2 -1
- package/2x/es/components/swiper/index.d.ts +2 -16
- package/2x/es/components/swiper/swiper-item.d.ts +1 -0
- package/2x/es/components/swiper/swiper.d.ts +1 -16
- package/2x/es/components/tab-bar/tab-bar.d.ts +2 -0
- package/2x/es/components/tabs/tabs.d.ts +3 -1
- package/2x/es/components/tag/tag.d.ts +1 -0
- package/2x/es/components/text-area/text-area.d.ts +2 -2
- package/2x/es/components/text-area/text-area.js +2 -1
- package/2x/es/global/index.js +2 -0
- package/2x/es/locales/base.d.ts +3 -0
- package/2x/es/locales/base.js +4 -1
- package/2x/es/locales/en-US.d.ts +3 -0
- package/2x/es/locales/es-ES.d.ts +3 -0
- package/2x/es/locales/es-ES.js +1 -1
- package/2x/es/locales/fa-IR.d.ts +3 -0
- package/2x/es/locales/ko-KR.d.ts +3 -0
- package/2x/es/locales/ko-KR.js +2 -2
- package/2x/es/locales/zh-CN.d.ts +3 -0
- package/2x/es/locales/zh-CN.js +4 -1
- package/2x/es/locales/zh-HK.d.ts +3 -0
- package/2x/es/locales/zh-HK.js +4 -1
- package/2x/es/locales/zh-TW.d.ts +3 -0
- package/2x/es/locales/zh-TW.js +4 -1
- package/2x/es/utils/get-scroll-parent.js +7 -4
- package/2x/package.json +3 -2
- package/bundle/antd-mobile.cjs.js +121 -66
- package/bundle/antd-mobile.es.js +123 -68
- package/bundle/style.css +8 -4
- package/cjs/components/auto-center/auto-center.d.ts +4 -2
- package/cjs/components/badge/badge.d.ts +1 -0
- package/cjs/components/button/button.d.ts +6 -4
- package/cjs/components/button/button.js +31 -7
- package/cjs/components/calendar/calendar.css +2 -2
- package/cjs/components/calendar/calendar.d.ts +2 -0
- package/cjs/components/calendar/calendar.js +7 -2
- package/cjs/components/capsule-tabs/capsule-tabs.d.ts +3 -1
- package/cjs/components/card/card.d.ts +1 -0
- package/cjs/components/check-list/check-list.d.ts +2 -1
- package/cjs/components/checkbox/checkbox.d.ts +1 -0
- package/cjs/components/checkbox/group.d.ts +2 -1
- package/cjs/components/collapse/collapse.d.ts +4 -1
- package/cjs/components/config-provider/config-provider.d.ts +2 -1
- package/cjs/components/date-picker/date-picker.d.ts +1 -1
- package/cjs/components/date-picker/date-picker.js +3 -1
- package/cjs/components/date-picker-view/date-picker-view.d.ts +1 -1
- package/cjs/components/date-picker-view/date-picker-view.js +1 -0
- package/cjs/components/dialog/dialog-action-button.js +3 -26
- package/cjs/components/divider/divider.d.ts +2 -1
- package/cjs/components/dropdown/item.d.ts +2 -1
- package/cjs/components/error-block/error-block.d.ts +2 -1
- package/cjs/components/floating-bubble/floating-bubble.d.ts +1 -0
- package/cjs/components/floating-panel/floating-panel.js +1 -1
- package/cjs/components/form/context.d.ts +1 -0
- package/cjs/components/form/context.js +2 -1
- package/cjs/components/form/form-item.css +2 -2
- package/cjs/components/form/form-item.js +5 -2
- package/cjs/components/form/form.d.ts +0 -3
- package/cjs/components/form/form.js +4 -2
- package/cjs/components/form/header.d.ts +4 -2
- package/cjs/components/form/index.css +2 -2
- package/cjs/components/form/index.d.ts +5 -3
- package/cjs/components/form/index.js +2 -1
- package/cjs/components/grid/grid.d.ts +2 -0
- package/cjs/components/image-uploader/image-uploader.d.ts +2 -1
- package/cjs/components/index-bar/panel.d.ts +1 -0
- package/cjs/components/infinite-scroll/infinite-scroll.d.ts +2 -1
- package/cjs/components/infinite-scroll/infinite-scroll.js +6 -1
- package/cjs/components/input/input.css +3 -0
- package/cjs/components/input/input.d.ts +4 -2
- package/cjs/components/input/input.js +15 -3
- package/cjs/components/jumbo-tabs/jumbo-tabs.d.ts +3 -1
- package/cjs/components/list/list.css +1 -0
- package/cjs/components/list/list.d.ts +1 -0
- package/cjs/components/mask/mask.d.ts +1 -0
- package/cjs/components/modal/modal-action-button.js +3 -26
- package/cjs/components/nav-bar/nav-bar.d.ts +2 -1
- package/cjs/components/picker/picker.d.ts +1 -0
- package/cjs/components/picker/picker.js +1 -0
- package/cjs/components/picker-view/picker-view.d.ts +1 -0
- package/cjs/components/picker-view/picker-view.js +4 -2
- package/cjs/components/picker-view/wheel.d.ts +1 -0
- package/cjs/components/picker-view/wheel.js +24 -4
- package/cjs/components/popover/wrapper.d.ts +3 -1
- package/cjs/components/popup/popup.d.ts +1 -0
- package/cjs/components/pull-to-refresh/pull-to-refresh.d.ts +2 -1
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +2 -2
- package/cjs/components/radio/group.d.ts +2 -1
- package/cjs/components/radio/radio.d.ts +1 -0
- package/cjs/components/search-bar/search-bar.d.ts +2 -0
- package/cjs/components/search-bar/search-bar.js +2 -0
- package/cjs/components/side-bar/side-bar.d.ts +2 -0
- package/cjs/components/space/space.d.ts +1 -0
- package/cjs/components/steps/steps.d.ts +2 -1
- package/cjs/components/swiper/index.d.ts +2 -16
- package/cjs/components/swiper/swiper-item.d.ts +1 -0
- package/cjs/components/swiper/swiper.d.ts +1 -16
- package/cjs/components/tab-bar/tab-bar.d.ts +2 -0
- package/cjs/components/tabs/tabs.d.ts +3 -1
- package/cjs/components/tag/tag.d.ts +1 -0
- package/cjs/components/text-area/text-area.d.ts +2 -2
- package/cjs/components/text-area/text-area.js +2 -1
- package/cjs/global/index.js +2 -0
- package/cjs/locales/base.d.ts +3 -0
- package/cjs/locales/base.js +4 -1
- package/cjs/locales/en-US.d.ts +3 -0
- package/cjs/locales/es-ES.d.ts +3 -0
- package/cjs/locales/es-ES.js +1 -1
- package/cjs/locales/fa-IR.d.ts +3 -0
- package/cjs/locales/ko-KR.d.ts +3 -0
- package/cjs/locales/ko-KR.js +2 -2
- package/cjs/locales/zh-CN.d.ts +3 -0
- package/cjs/locales/zh-CN.js +4 -1
- package/cjs/locales/zh-HK.d.ts +3 -0
- package/cjs/locales/zh-HK.js +4 -1
- package/cjs/locales/zh-TW.d.ts +3 -0
- package/cjs/locales/zh-TW.js +4 -1
- package/cjs/utils/get-scroll-parent.js +7 -4
- package/es/components/auto-center/auto-center.d.ts +4 -2
- package/es/components/badge/badge.d.ts +1 -0
- package/es/components/button/button.d.ts +6 -4
- package/es/components/button/button.js +30 -8
- package/es/components/calendar/calendar.css +2 -2
- package/es/components/calendar/calendar.d.ts +2 -0
- package/es/components/calendar/calendar.js +7 -3
- package/es/components/capsule-tabs/capsule-tabs.d.ts +3 -1
- package/es/components/card/card.d.ts +1 -0
- package/es/components/check-list/check-list.d.ts +2 -1
- package/es/components/checkbox/checkbox.d.ts +1 -0
- package/es/components/checkbox/group.d.ts +2 -1
- package/es/components/collapse/collapse.d.ts +4 -1
- package/es/components/config-provider/config-provider.d.ts +2 -1
- package/es/components/date-picker/date-picker.d.ts +1 -1
- package/es/components/date-picker/date-picker.js +3 -1
- package/es/components/date-picker-view/date-picker-view.d.ts +1 -1
- package/es/components/date-picker-view/date-picker-view.js +1 -0
- package/es/components/dialog/dialog-action-button.js +3 -21
- package/es/components/divider/divider.d.ts +2 -1
- package/es/components/dropdown/item.d.ts +2 -1
- package/es/components/error-block/error-block.d.ts +2 -1
- package/es/components/floating-bubble/floating-bubble.d.ts +1 -0
- package/es/components/floating-panel/floating-panel.js +1 -1
- package/es/components/form/context.d.ts +1 -0
- package/es/components/form/context.js +2 -1
- package/es/components/form/form-item.css +2 -2
- package/es/components/form/form-item.js +5 -2
- package/es/components/form/form.d.ts +0 -3
- package/es/components/form/form.js +4 -2
- package/es/components/form/header.d.ts +4 -2
- package/es/components/form/index.css +2 -2
- package/es/components/form/index.d.ts +5 -3
- package/es/components/form/index.js +3 -2
- package/es/components/grid/grid.d.ts +2 -0
- package/es/components/image-uploader/image-uploader.d.ts +2 -1
- package/es/components/index-bar/panel.d.ts +1 -0
- package/es/components/infinite-scroll/infinite-scroll.d.ts +2 -1
- package/es/components/infinite-scroll/infinite-scroll.js +5 -1
- package/es/components/input/input.css +3 -0
- package/es/components/input/input.d.ts +4 -2
- package/es/components/input/input.js +15 -3
- package/es/components/jumbo-tabs/jumbo-tabs.d.ts +3 -1
- package/es/components/list/list.css +1 -0
- package/es/components/list/list.d.ts +1 -0
- package/es/components/mask/mask.d.ts +1 -0
- package/es/components/modal/modal-action-button.js +3 -21
- package/es/components/nav-bar/nav-bar.d.ts +2 -1
- package/es/components/picker/picker.d.ts +1 -0
- package/es/components/picker/picker.js +1 -0
- package/es/components/picker-view/picker-view.d.ts +1 -0
- package/es/components/picker-view/picker-view.js +4 -2
- package/es/components/picker-view/wheel.d.ts +1 -0
- package/es/components/picker-view/wheel.js +24 -5
- package/es/components/popover/wrapper.d.ts +3 -1
- package/es/components/popup/popup.d.ts +1 -0
- package/es/components/pull-to-refresh/pull-to-refresh.d.ts +2 -1
- package/es/components/pull-to-refresh/pull-to-refresh.js +2 -2
- package/es/components/radio/group.d.ts +2 -1
- package/es/components/radio/radio.d.ts +1 -0
- package/es/components/search-bar/search-bar.d.ts +2 -0
- package/es/components/search-bar/search-bar.js +2 -0
- package/es/components/side-bar/side-bar.d.ts +2 -0
- package/es/components/space/space.d.ts +1 -0
- package/es/components/steps/steps.d.ts +2 -1
- package/es/components/swiper/index.d.ts +2 -16
- package/es/components/swiper/swiper-item.d.ts +1 -0
- package/es/components/swiper/swiper.d.ts +1 -16
- package/es/components/tab-bar/tab-bar.d.ts +2 -0
- package/es/components/tabs/tabs.d.ts +3 -1
- package/es/components/tag/tag.d.ts +1 -0
- package/es/components/text-area/text-area.d.ts +2 -2
- package/es/components/text-area/text-area.js +2 -1
- package/es/global/index.js +2 -0
- package/es/locales/base.d.ts +3 -0
- package/es/locales/base.js +4 -1
- package/es/locales/en-US.d.ts +3 -0
- package/es/locales/es-ES.d.ts +3 -0
- package/es/locales/es-ES.js +1 -1
- package/es/locales/fa-IR.d.ts +3 -0
- package/es/locales/ko-KR.d.ts +3 -0
- package/es/locales/ko-KR.js +2 -2
- package/es/locales/zh-CN.d.ts +3 -0
- package/es/locales/zh-CN.js +4 -1
- package/es/locales/zh-HK.d.ts +3 -0
- package/es/locales/zh-HK.js +4 -1
- package/es/locales/zh-TW.d.ts +3 -0
- package/es/locales/zh-TW.js +4 -1
- package/es/utils/get-scroll-parent.js +7 -4
- package/package.json +3 -2
- package/umd/antd-mobile.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, ReactElement, ReactNode } from 'react';
|
|
1
|
+
import React, { FC, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ErrorBlockProps = {
|
|
4
4
|
status?: 'default' | 'disconnected' | 'empty' | 'busy';
|
|
@@ -6,5 +6,6 @@ export declare type ErrorBlockProps = {
|
|
|
6
6
|
image?: string | ReactElement;
|
|
7
7
|
description?: ReactNode;
|
|
8
8
|
fullPage?: boolean;
|
|
9
|
+
children?: React.ReactNode;
|
|
9
10
|
} & NativeProps<'--image-height' | '--image-height-full-page' | '--image-width' | '--image-width-full-page'>;
|
|
10
11
|
export declare const ErrorBlock: FC<ErrorBlockProps>;
|
|
@@ -4,5 +4,6 @@ export declare type FloatingBubbleProps = {
|
|
|
4
4
|
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
5
5
|
axis?: 'x' | 'y' | 'xy' | 'lock';
|
|
6
6
|
magnetic?: 'x' | 'y';
|
|
7
|
+
children?: React.ReactNode;
|
|
7
8
|
} & NativeProps<'--initial-position-left' | '--initial-position-right' | '--initial-position-top' | '--initial-position-bottom' | '--z-index' | '--edge-distance' | '--size' | '--border-radius' | '--background'>;
|
|
8
9
|
export declare const FloatingBubble: FC<FloatingBubbleProps>;
|
|
@@ -6,6 +6,7 @@ export declare type FormContextType = {
|
|
|
6
6
|
hasFeedback: boolean;
|
|
7
7
|
layout: FormLayout;
|
|
8
8
|
requiredMarkStyle: 'asterisk' | 'text-required' | 'text-optional';
|
|
9
|
+
disabled: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare const defaultFormContext: FormContextType;
|
|
11
12
|
export declare const FormContext: React.Context<FormContextType>;
|
|
@@ -3,7 +3,8 @@ export const defaultFormContext = {
|
|
|
3
3
|
name: undefined,
|
|
4
4
|
hasFeedback: true,
|
|
5
5
|
layout: 'vertical',
|
|
6
|
-
requiredMarkStyle: 'asterisk'
|
|
6
|
+
requiredMarkStyle: 'asterisk',
|
|
7
|
+
disabled: false
|
|
7
8
|
};
|
|
8
9
|
export const FormContext = React.createContext(defaultFormContext);
|
|
9
10
|
export const NoStyleItemContext = React.createContext(null);
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.adm-form-item-child-position-right {
|
|
46
|
-
justify-content:
|
|
46
|
+
justify-content: flex-end;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.adm-form-item-child-position-right > * {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
|
|
67
67
|
.adm-form-item.adm-form-item-horizontal.adm-list-item {
|
|
68
68
|
--align-items: stretch;
|
|
69
|
-
--prefix-width:
|
|
69
|
+
--prefix-width: 6.8em;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.adm-form-item.adm-form-item-horizontal .adm-list-item-content-prefix {
|
|
@@ -18,6 +18,8 @@ const MemoInput = React.memo(({
|
|
|
18
18
|
}) => children, (prev, next) => prev.value === next.value && prev.update === next.update);
|
|
19
19
|
|
|
20
20
|
const FormItemLayout = props => {
|
|
21
|
+
var _a;
|
|
22
|
+
|
|
21
23
|
const {
|
|
22
24
|
className,
|
|
23
25
|
style,
|
|
@@ -25,7 +27,6 @@ const FormItemLayout = props => {
|
|
|
25
27
|
label,
|
|
26
28
|
help,
|
|
27
29
|
required,
|
|
28
|
-
disabled,
|
|
29
30
|
children,
|
|
30
31
|
htmlFor,
|
|
31
32
|
hidden,
|
|
@@ -38,6 +39,7 @@ const FormItemLayout = props => {
|
|
|
38
39
|
} = useConfig();
|
|
39
40
|
const hasFeedback = props.hasFeedback !== undefined ? props.hasFeedback : context.hasFeedback;
|
|
40
41
|
const layout = props.layout || context.layout;
|
|
42
|
+
const disabled = (_a = props.disabled) !== null && _a !== void 0 ? _a : context.disabled;
|
|
41
43
|
|
|
42
44
|
const requiredMark = (() => {
|
|
43
45
|
const {
|
|
@@ -92,7 +94,8 @@ const FormItemLayout = props => {
|
|
|
92
94
|
extra: extra,
|
|
93
95
|
description: description,
|
|
94
96
|
className: classNames(classPrefix, className, `${classPrefix}-${layout}`, {
|
|
95
|
-
[`${classPrefix}-hidden`]: hidden
|
|
97
|
+
[`${classPrefix}-hidden`]: hidden,
|
|
98
|
+
[`${classPrefix}-has-error`]: props.errors.length
|
|
96
99
|
}),
|
|
97
100
|
disabled: disabled,
|
|
98
101
|
onClick: props.onClick,
|
|
@@ -3,15 +3,12 @@ import { NativeProps } from '../../utils/native-props';
|
|
|
3
3
|
import { ListProps } from '../list';
|
|
4
4
|
import type { FormProps as RcFormProps, FormInstance as RCFormInstance } from 'rc-field-form';
|
|
5
5
|
import { FormContextType } from './context';
|
|
6
|
-
import type { FormLayout } from '.';
|
|
7
6
|
export declare type FormInstance = Pick<RCFormInstance, 'getFieldValue' | 'getFieldsValue' | 'getFieldError' | 'getFieldsError' | 'isFieldTouched' | 'isFieldsTouched' | 'resetFields' | 'setFields' | 'setFieldsValue' | 'submit' | 'validateFields'>;
|
|
8
7
|
export declare type FormProps = Pick<RcFormProps, 'form' | 'initialValues' | 'name' | 'preserve' | 'validateMessages' | 'validateTrigger' | 'onFieldsChange' | 'onFinish' | 'onFinishFailed' | 'onValuesChange' | 'children'> & NativeProps<'--border-inner' | '--border-top' | '--border-bottom'> & Partial<FormContextType> & {
|
|
9
8
|
footer?: ReactNode;
|
|
10
|
-
layout?: FormLayout;
|
|
11
9
|
mode?: ListProps['mode'];
|
|
12
10
|
};
|
|
13
11
|
export declare const Form: React.ForwardRefExoticComponent<Pick<RcFormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & NativeProps<"--border-inner" | "--border-top" | "--border-bottom"> & Partial<FormContextType> & {
|
|
14
12
|
footer?: ReactNode;
|
|
15
|
-
layout?: FormLayout | undefined;
|
|
16
13
|
mode?: ListProps['mode'];
|
|
17
14
|
} & React.RefAttributes<FormInstance>>;
|
|
@@ -23,9 +23,10 @@ export const Form = forwardRef((p, ref) => {
|
|
|
23
23
|
layout,
|
|
24
24
|
footer,
|
|
25
25
|
mode,
|
|
26
|
+
disabled,
|
|
26
27
|
requiredMarkStyle
|
|
27
28
|
} = props,
|
|
28
|
-
formProps = __rest(props, ["className", "style", "hasFeedback", "children", "layout", "footer", "mode", "requiredMarkStyle"]);
|
|
29
|
+
formProps = __rest(props, ["className", "style", "hasFeedback", "children", "layout", "footer", "mode", "disabled", "requiredMarkStyle"]);
|
|
29
30
|
|
|
30
31
|
const {
|
|
31
32
|
locale
|
|
@@ -76,7 +77,8 @@ export const Form = forwardRef((p, ref) => {
|
|
|
76
77
|
name: formProps.name,
|
|
77
78
|
hasFeedback,
|
|
78
79
|
layout,
|
|
79
|
-
requiredMarkStyle
|
|
80
|
+
requiredMarkStyle,
|
|
81
|
+
disabled: disabled
|
|
80
82
|
}
|
|
81
83
|
}, lists), footer && React.createElement("div", {
|
|
82
84
|
className: `${classPrefix}-footer`
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
.adm-form-item-child-position-right {
|
|
72
|
-
justify-content:
|
|
72
|
+
justify-content: flex-end;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.adm-form-item-child-position-right > * {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
|
|
93
93
|
.adm-form-item.adm-form-item-horizontal.adm-list-item {
|
|
94
94
|
--align-items: stretch;
|
|
95
|
-
--prefix-width:
|
|
95
|
+
--prefix-width: 6.8em;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
.adm-form-item.adm-form-item-horizontal .adm-list-item-content-prefix {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './index.less';
|
|
3
|
-
import { useForm } from 'rc-field-form';
|
|
3
|
+
import { useWatch, useForm } from 'rc-field-form';
|
|
4
4
|
export declare type FormLayout = 'vertical' | 'horizontal';
|
|
5
5
|
export type { FormProps, FormInstance } from './form';
|
|
6
6
|
export type { FormItemProps } from './form-item';
|
|
@@ -9,13 +9,15 @@ export type { ValidateMessages, FieldData, NamePath, } from 'rc-field-form/es/in
|
|
|
9
9
|
export type { FormArrayField, FormArrayOperation, FormArrayProps, } from './form-array';
|
|
10
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"> & import("../../utils/native-props").NativeProps<"--border-inner" | "--border-top" | "--border-bottom"> & Partial<import("./context").FormContextType> & {
|
|
11
11
|
footer?: import("react").ReactNode;
|
|
12
|
-
layout?: FormLayout | undefined;
|
|
13
12
|
mode?: "default" | "card" | undefined;
|
|
14
13
|
} & import("react").RefAttributes<import("./form").FormInstance>> & {
|
|
15
14
|
Item: import("react").FC<import("./form-item").FormItemProps>;
|
|
16
15
|
Subscribe: import("react").VFC<import("./form-subscribe").FormSubscribeProps>;
|
|
17
|
-
Header: import("react").FC<{
|
|
16
|
+
Header: import("react").FC<{
|
|
17
|
+
children?: import("react").ReactNode;
|
|
18
|
+
}>;
|
|
18
19
|
Array: import("react").FC<import("./form-array").FormArrayProps>;
|
|
19
20
|
useForm: typeof useForm;
|
|
21
|
+
useWatch: typeof useWatch;
|
|
20
22
|
};
|
|
21
23
|
export default _default;
|
|
@@ -3,7 +3,7 @@ import { Form } from './form';
|
|
|
3
3
|
import { attachPropertiesToComponent } from '../../utils/attach-properties-to-component';
|
|
4
4
|
import { FormItem } from './form-item';
|
|
5
5
|
import { Header } from './header';
|
|
6
|
-
import { useForm } from 'rc-field-form';
|
|
6
|
+
import { useWatch, useForm } from 'rc-field-form';
|
|
7
7
|
import { FormSubscribe } from './form-subscribe';
|
|
8
8
|
import { FormArray } from './form-array';
|
|
9
9
|
export default attachPropertiesToComponent(Form, {
|
|
@@ -11,5 +11,6 @@ export default attachPropertiesToComponent(Form, {
|
|
|
11
11
|
Subscribe: FormSubscribe,
|
|
12
12
|
Header,
|
|
13
13
|
Array: FormArray,
|
|
14
|
-
useForm
|
|
14
|
+
useForm,
|
|
15
|
+
useWatch
|
|
15
16
|
});
|
|
@@ -3,10 +3,12 @@ import { NativeProps } from '../../utils/native-props';
|
|
|
3
3
|
export declare type GridProps = {
|
|
4
4
|
columns: number;
|
|
5
5
|
gap?: number | string | [number | string, number | string];
|
|
6
|
+
children?: React.ReactNode;
|
|
6
7
|
} & NativeProps<'--gap' | '--gap-vertical' | '--gap-horizontal'>;
|
|
7
8
|
export declare const Grid: FC<GridProps>;
|
|
8
9
|
export declare type GridItemProps = {
|
|
9
10
|
span?: number;
|
|
10
11
|
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
12
|
+
children?: React.ReactNode;
|
|
11
13
|
} & NativeProps;
|
|
12
14
|
export declare const GridItem: FC<GridItemProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, InputHTMLAttributes } from 'react';
|
|
1
|
+
import React, { FC, InputHTMLAttributes } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
import type { ImageProps } from '../image';
|
|
4
4
|
export declare type TaskStatus = 'pending' | 'fail';
|
|
@@ -27,5 +27,6 @@ export declare type ImageUploaderProps = {
|
|
|
27
27
|
preview?: boolean;
|
|
28
28
|
showFailed?: boolean;
|
|
29
29
|
imageFit?: ImageProps['fit'];
|
|
30
|
+
children?: React.ReactNode;
|
|
30
31
|
} & NativeProps<'--cell-size'>;
|
|
31
32
|
export declare const ImageUploader: FC<ImageUploaderProps>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type InfiniteScrollProps = {
|
|
4
4
|
loadMore: () => Promise<void>;
|
|
5
5
|
hasMore: boolean;
|
|
6
6
|
threshold?: number;
|
|
7
|
+
children?: React.ReactNode;
|
|
7
8
|
} & NativeProps;
|
|
8
9
|
export declare const InfiniteScroll: FC<InfiniteScrollProps>;
|
|
@@ -4,6 +4,7 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
4
4
|
import { useLockFn, useMemoizedFn } from 'ahooks';
|
|
5
5
|
import { withNativeProps } from '../../utils/native-props';
|
|
6
6
|
import { getScrollParent } from '../../utils/get-scroll-parent';
|
|
7
|
+
import { useConfig } from '../config-provider';
|
|
7
8
|
import DotLoading from '../dot-loading';
|
|
8
9
|
|
|
9
10
|
function isWindow(element) {
|
|
@@ -15,7 +16,10 @@ const classPrefix = `adm-infinite-scroll`;
|
|
|
15
16
|
const InfiniteScrollContent = ({
|
|
16
17
|
hasMore
|
|
17
18
|
}) => {
|
|
18
|
-
|
|
19
|
+
const {
|
|
20
|
+
locale
|
|
21
|
+
} = useConfig();
|
|
22
|
+
return React.createElement(React.Fragment, null, hasMore ? React.createElement(React.Fragment, null, React.createElement("span", null, locale.common.loading), React.createElement(DotLoading, null)) : React.createElement("span", null, locale.InfiniteScroll.noMore));
|
|
19
23
|
};
|
|
20
24
|
|
|
21
25
|
export const InfiniteScroll = p => {
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | 'pattern' | 'inputMode' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
4
|
+
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | 'pattern' | 'inputMode' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick'> & {
|
|
5
5
|
value?: string;
|
|
6
6
|
defaultValue?: string;
|
|
7
7
|
onChange?: (val: string) => void;
|
|
@@ -9,6 +9,7 @@ export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
readOnly?: boolean;
|
|
11
11
|
clearable?: boolean;
|
|
12
|
+
onlyShowClearWhenFocus?: boolean;
|
|
12
13
|
onClear?: () => void;
|
|
13
14
|
id?: string;
|
|
14
15
|
onEnterPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
@@ -22,7 +23,7 @@ export declare type InputRef = {
|
|
|
22
23
|
blur: () => void;
|
|
23
24
|
nativeElement: HTMLInputElement | null;
|
|
24
25
|
};
|
|
25
|
-
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "autoFocus" | "maxLength" | "minLength"> & {
|
|
26
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "onClick" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "autoFocus" | "maxLength" | "minLength"> & {
|
|
26
27
|
value?: string | undefined;
|
|
27
28
|
defaultValue?: string | undefined;
|
|
28
29
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -30,6 +31,7 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProp
|
|
|
30
31
|
disabled?: boolean | undefined;
|
|
31
32
|
readOnly?: boolean | undefined;
|
|
32
33
|
clearable?: boolean | undefined;
|
|
34
|
+
onlyShowClearWhenFocus?: boolean | undefined;
|
|
33
35
|
onClear?: (() => void) | undefined;
|
|
34
36
|
id?: string | undefined;
|
|
35
37
|
onEnterPress?: ((e: React.KeyboardEvent<HTMLInputElement>) => void) | undefined;
|
|
@@ -8,7 +8,8 @@ import { useIsomorphicLayoutEffect } from 'ahooks';
|
|
|
8
8
|
import { bound } from '../../utils/bound';
|
|
9
9
|
const classPrefix = `adm-input`;
|
|
10
10
|
const defaultProps = {
|
|
11
|
-
defaultValue: ''
|
|
11
|
+
defaultValue: '',
|
|
12
|
+
onlyShowClearWhenFocus: true
|
|
12
13
|
};
|
|
13
14
|
export const Input = forwardRef((p, ref) => {
|
|
14
15
|
const props = mergeProps(defaultProps, p);
|
|
@@ -70,6 +71,16 @@ export const Input = forwardRef((p, ref) => {
|
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
|
|
74
|
+
const shouldShowClear = (() => {
|
|
75
|
+
if (!props.clearable || !value || props.readOnly) return false;
|
|
76
|
+
|
|
77
|
+
if (props.onlyShowClearWhenFocus) {
|
|
78
|
+
return hasFocus;
|
|
79
|
+
} else {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
})();
|
|
83
|
+
|
|
73
84
|
return withNativeProps(props, React.createElement("div", {
|
|
74
85
|
className: classNames(`${classPrefix}`, props.disabled && `${classPrefix}-disabled`)
|
|
75
86
|
}, React.createElement("input", {
|
|
@@ -110,8 +121,9 @@ export const Input = forwardRef((p, ref) => {
|
|
|
110
121
|
onKeyDown: handleKeydown,
|
|
111
122
|
onKeyUp: props.onKeyUp,
|
|
112
123
|
onCompositionStart: props.onCompositionStart,
|
|
113
|
-
onCompositionEnd: props.onCompositionEnd
|
|
114
|
-
|
|
124
|
+
onCompositionEnd: props.onCompositionEnd,
|
|
125
|
+
onClick: props.onClick
|
|
126
|
+
}), shouldShowClear && React.createElement("div", {
|
|
115
127
|
className: `${classPrefix}-clear`,
|
|
116
128
|
onMouseDown: e => {
|
|
117
129
|
e.preventDefault();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
1
|
+
import React, { FC, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type JumboTabProps = {
|
|
4
4
|
title: ReactNode;
|
|
@@ -6,11 +6,13 @@ export declare type JumboTabProps = {
|
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
forceRender?: boolean;
|
|
8
8
|
destroyOnClose?: boolean;
|
|
9
|
+
children?: React.ReactNode;
|
|
9
10
|
} & NativeProps;
|
|
10
11
|
export declare const JumboTab: FC<JumboTabProps>;
|
|
11
12
|
export declare type JumboTabsProps = {
|
|
12
13
|
activeKey?: string | null;
|
|
13
14
|
defaultActiveKey?: string | null;
|
|
14
15
|
onChange?: (key: string) => void;
|
|
16
|
+
children?: React.ReactNode;
|
|
15
17
|
} & NativeProps;
|
|
16
18
|
export declare const JumboTabs: FC<JumboTabsProps>;
|
|
@@ -3,5 +3,6 @@ import { NativeProps } from '../../utils/native-props';
|
|
|
3
3
|
export declare type ListProps = {
|
|
4
4
|
header?: ReactNode;
|
|
5
5
|
mode?: 'default' | 'card';
|
|
6
|
+
children?: ReactNode;
|
|
6
7
|
} & NativeProps<'--header-font-size' | '--prefix-width' | '--prefix-padding-right' | '--align-items' | '--active-background-color' | '--border-inner' | '--border-top' | '--border-bottom' | '--padding-left' | '--padding-right' | '--font-size'>;
|
|
7
8
|
export declare const List: FC<ListProps>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import Button from '../button';
|
|
5
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
@@ -7,26 +6,9 @@ export const ModalActionButton = props => {
|
|
|
7
6
|
const {
|
|
8
7
|
action
|
|
9
8
|
} = props;
|
|
10
|
-
const [loading, setLoading] = useState(false);
|
|
11
|
-
|
|
12
|
-
function handleClick() {
|
|
13
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
-
setLoading(true);
|
|
15
|
-
|
|
16
|
-
try {
|
|
17
|
-
const promise = props.onAction();
|
|
18
|
-
yield promise;
|
|
19
|
-
setLoading(false);
|
|
20
|
-
} catch (e) {
|
|
21
|
-
setLoading(false);
|
|
22
|
-
throw e;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
9
|
return withNativeProps(props.action, React.createElement(Button, {
|
|
28
10
|
key: action.key,
|
|
29
|
-
onClick:
|
|
11
|
+
onClick: props.onAction,
|
|
30
12
|
className: classNames('adm-modal-button', {
|
|
31
13
|
'adm-modal-button-primary': props.action.primary
|
|
32
14
|
}),
|
|
@@ -34,7 +16,7 @@ export const ModalActionButton = props => {
|
|
|
34
16
|
size: props.action.primary ? 'large' : 'middle',
|
|
35
17
|
block: true,
|
|
36
18
|
color: action.danger ? 'danger' : 'primary',
|
|
37
|
-
loading:
|
|
19
|
+
loading: 'auto',
|
|
38
20
|
disabled: action.disabled
|
|
39
21
|
}, action.text));
|
|
40
22
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
1
|
+
import React, { FC, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type NavBarProps = {
|
|
4
4
|
back?: string | null;
|
|
@@ -6,5 +6,6 @@ export declare type NavBarProps = {
|
|
|
6
6
|
left?: ReactNode;
|
|
7
7
|
right?: ReactNode;
|
|
8
8
|
onBack?: () => void;
|
|
9
|
+
children?: React.ReactNode;
|
|
9
10
|
} & NativeProps<'--height' | '--border-bottom'>;
|
|
10
11
|
export declare const NavBar: FC<NavBarProps>;
|
|
@@ -17,5 +17,6 @@ export declare type PickerProps = {
|
|
|
17
17
|
cancelText?: ReactNode;
|
|
18
18
|
children?: (items: (PickerColumnItem | null)[]) => ReactNode;
|
|
19
19
|
renderLabel?: (item: PickerColumnItem) => ReactNode;
|
|
20
|
+
mouseWheel?: boolean;
|
|
20
21
|
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation'> & NativeProps<'--header-button-font-size' | '--title-font-size' | '--item-font-size' | '--item-height'>;
|
|
21
22
|
export declare const Picker: React.NamedExoticComponent<PickerProps>;
|
|
@@ -16,6 +16,7 @@ export declare type PickerViewProps = {
|
|
|
16
16
|
columns: PickerColumn[] | ((value: PickerValue[]) => PickerColumn[]);
|
|
17
17
|
value?: PickerValue[];
|
|
18
18
|
defaultValue?: PickerValue[];
|
|
19
|
+
mouseWheel?: boolean;
|
|
19
20
|
onChange?: (value: PickerValue[], extend: PickerValueExtend) => void;
|
|
20
21
|
} & Pick<PickerProps, 'renderLabel'> & NativeProps<'--height' | '--item-height' | '--item-font-size'>;
|
|
21
22
|
export declare const PickerView: React.NamedExoticComponent<PickerViewProps>;
|
|
@@ -8,7 +8,8 @@ import { defaultRenderLabel } from '../picker/picker-utils';
|
|
|
8
8
|
const classPrefix = `adm-picker-view`;
|
|
9
9
|
const defaultProps = {
|
|
10
10
|
defaultValue: [],
|
|
11
|
-
renderLabel: defaultRenderLabel
|
|
11
|
+
renderLabel: defaultRenderLabel,
|
|
12
|
+
mouseWheel: false
|
|
12
13
|
};
|
|
13
14
|
export const PickerView = memo(p => {
|
|
14
15
|
const props = mergeProps(defaultProps, p);
|
|
@@ -58,7 +59,8 @@ export const PickerView = memo(p => {
|
|
|
58
59
|
column: column,
|
|
59
60
|
value: innerValue[index],
|
|
60
61
|
onSelect: handleSelect,
|
|
61
|
-
renderLabel: props.renderLabel
|
|
62
|
+
renderLabel: props.renderLabel,
|
|
63
|
+
mouseWheel: props.mouseWheel
|
|
62
64
|
})), React.createElement("div", {
|
|
63
65
|
className: `${classPrefix}-mask`
|
|
64
66
|
}, React.createElement("div", {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { memo, useRef } from 'react';
|
|
2
2
|
import { useSpring, animated } from '@react-spring/web';
|
|
3
|
-
import { useDrag } from '@use-gesture/react';
|
|
3
|
+
import { useDrag, useWheel } from '@use-gesture/react';
|
|
4
4
|
import { rubberbandIfOutOfBounds } from '../../utils/rubberband';
|
|
5
5
|
import { bound } from '../../utils/bound';
|
|
6
6
|
import isEqual from 'lodash/isEqual';
|
|
7
7
|
import { useIsomorphicLayoutEffect } from 'ahooks';
|
|
8
8
|
import { measureCSSLength } from '../../utils/measure-css-length';
|
|
9
|
+
import { supportsPassive } from '../../utils/supports-passive';
|
|
9
10
|
const classPrefix = `adm-picker-view`;
|
|
10
11
|
export const Wheel = memo(props => {
|
|
11
12
|
const {
|
|
@@ -71,7 +72,7 @@ export const Wheel = memo(props => {
|
|
|
71
72
|
onSelect(item.value);
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
const
|
|
75
|
+
const handleDrag = state => {
|
|
75
76
|
draggingRef.current = true;
|
|
76
77
|
const min = -((column.length - 1) * itemHeight.current);
|
|
77
78
|
const max = 0;
|
|
@@ -87,13 +88,31 @@ export const Wheel = memo(props => {
|
|
|
87
88
|
y: rubberbandIfOutOfBounds(position, min, max, itemHeight.current * 50, 0.2)
|
|
88
89
|
});
|
|
89
90
|
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
useDrag(state => {
|
|
94
|
+
state.event.stopPropagation();
|
|
95
|
+
handleDrag(state);
|
|
90
96
|
}, {
|
|
91
97
|
axis: 'y',
|
|
92
98
|
from: () => [0, y.get()],
|
|
93
99
|
filterTaps: true,
|
|
94
100
|
pointer: {
|
|
95
101
|
touch: true
|
|
96
|
-
}
|
|
102
|
+
},
|
|
103
|
+
target: rootRef
|
|
104
|
+
});
|
|
105
|
+
useWheel(state => {
|
|
106
|
+
state.event.stopPropagation();
|
|
107
|
+
handleDrag(state);
|
|
108
|
+
}, {
|
|
109
|
+
axis: 'y',
|
|
110
|
+
from: () => [0, y.get()],
|
|
111
|
+
preventDefault: true,
|
|
112
|
+
target: props.mouseWheel ? rootRef : undefined,
|
|
113
|
+
eventOptions: supportsPassive ? {
|
|
114
|
+
passive: false
|
|
115
|
+
} : false
|
|
97
116
|
});
|
|
98
117
|
let selectedIndex = null;
|
|
99
118
|
|
|
@@ -130,10 +149,10 @@ export const Wheel = memo(props => {
|
|
|
130
149
|
}, "-")));
|
|
131
150
|
}
|
|
132
151
|
|
|
133
|
-
return React.createElement("div",
|
|
152
|
+
return React.createElement("div", {
|
|
134
153
|
ref: rootRef,
|
|
135
154
|
className: `${classPrefix}-column`
|
|
136
|
-
},
|
|
155
|
+
}, React.createElement(animated.div, {
|
|
137
156
|
style: {
|
|
138
157
|
translateY: y
|
|
139
158
|
},
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare class Wrapper extends React.Component<{
|
|
2
|
+
export declare class Wrapper extends React.Component<{
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
}, {}> {
|
|
3
5
|
element: Element | null;
|
|
4
6
|
componentDidMount(): void;
|
|
5
7
|
componentDidUpdate(): void;
|
|
@@ -18,5 +18,6 @@ export declare type PopupProps = {
|
|
|
18
18
|
maskStyle?: React.CSSProperties;
|
|
19
19
|
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
20
20
|
stopPropagation?: PropagationEvent[];
|
|
21
|
+
children?: React.ReactNode;
|
|
21
22
|
} & NativeProps<'--z-index'>;
|
|
22
23
|
export declare const Popup: FC<PopupProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
1
|
+
import React, { FC, ReactNode } from 'react';
|
|
2
2
|
export declare type PullStatus = 'pulling' | 'canRelease' | 'refreshing' | 'complete';
|
|
3
3
|
export declare type PullToRefreshProps = {
|
|
4
4
|
onRefresh?: () => Promise<any>;
|
|
@@ -11,6 +11,7 @@ export declare type PullToRefreshProps = {
|
|
|
11
11
|
threshold?: number;
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
renderText?: (status: PullStatus) => ReactNode;
|
|
14
|
+
children?: React.ReactNode;
|
|
14
15
|
};
|
|
15
16
|
export declare const defaultProps: {
|
|
16
17
|
pullingText: string;
|