antd-mobile 5.15.0 → 5.16.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/README.md +30 -16
- package/2x/bundle/antd-mobile.cjs.js +381 -228
- package/2x/bundle/antd-mobile.es.js +382 -229
- package/2x/bundle/style.css +66 -13
- 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/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 +29 -14
- package/2x/cjs/components/checkbox/checkbox.d.ts +5 -1
- package/2x/cjs/components/checkbox/index.d.ts +5 -1
- 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 +5 -2
- 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.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/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.d.ts +13 -2
- 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 +6 -12
- 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/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 +5 -1
- package/2x/cjs/components/virtual-input/virtual-input.d.ts +5 -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/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/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 +27 -14
- package/2x/es/components/checkbox/checkbox.d.ts +5 -1
- package/2x/es/components/checkbox/index.d.ts +5 -1
- 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 +5 -2
- 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.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/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.d.ts +13 -2
- 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 +6 -11
- 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/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 +5 -1
- package/2x/es/components/virtual-input/virtual-input.d.ts +5 -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/package.json +1 -1
- package/2x/umd/antd-mobile.js +1 -1
- package/README.md +30 -16
- package/bundle/antd-mobile.cjs.js +381 -228
- package/bundle/antd-mobile.es.js +382 -229
- package/bundle/style.css +56 -12
- package/cjs/components/action-sheet/action-sheet.d.ts +2 -4
- package/cjs/components/action-sheet/action-sheet.js +6 -2
- 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 +29 -14
- package/cjs/components/checkbox/checkbox.d.ts +5 -1
- package/cjs/components/checkbox/index.d.ts +5 -1
- 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 +5 -2
- 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.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/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.d.ts +13 -2
- 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 +6 -12
- 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/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 +5 -1
- package/cjs/components/virtual-input/virtual-input.d.ts +5 -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/es/components/action-sheet/action-sheet.d.ts +2 -4
- package/es/components/action-sheet/action-sheet.js +6 -2
- 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 +27 -14
- package/es/components/checkbox/checkbox.d.ts +5 -1
- package/es/components/checkbox/index.d.ts +5 -1
- 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 +5 -2
- 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.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/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.d.ts +13 -2
- 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 +6 -11
- 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/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 +5 -1
- package/es/components/virtual-input/virtual-input.d.ts +5 -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/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
|
@@ -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;
|
|
@@ -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 {};
|
|
@@ -135,7 +135,11 @@ export const Input = forwardRef((p, ref) => {
|
|
|
135
135
|
compositionStartRef.current = false;
|
|
136
136
|
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
137
137
|
},
|
|
138
|
-
onClick: props.onClick
|
|
138
|
+
onClick: props.onClick,
|
|
139
|
+
role: props.role,
|
|
140
|
+
"aria-valuenow": props['aria-valuenow'],
|
|
141
|
+
"aria-valuemax": props['aria-valuemax'],
|
|
142
|
+
"aria-valuemin": props['aria-valuemin']
|
|
139
143
|
}), shouldShowClear && React.createElement("div", {
|
|
140
144
|
className: `${classPrefix}-clear`,
|
|
141
145
|
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;
|
|
@@ -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
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
|
|
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>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { forwardRef, useImperativeHandle, useRef } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { withNativeProps } from '../../utils/native-props';
|
|
4
4
|
import { mergeProps } from '../../utils/with-default-props';
|
|
@@ -6,10 +6,18 @@ const classPrefix = `adm-list`;
|
|
|
6
6
|
const defaultProps = {
|
|
7
7
|
mode: 'default'
|
|
8
8
|
};
|
|
9
|
-
export const List = p => {
|
|
9
|
+
export const List = forwardRef((p, ref) => {
|
|
10
10
|
const props = mergeProps(defaultProps, p);
|
|
11
|
+
const nativeElementRef = useRef(null);
|
|
12
|
+
useImperativeHandle(ref, () => ({
|
|
13
|
+
get nativeElement() {
|
|
14
|
+
return nativeElementRef.current;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}));
|
|
11
18
|
return withNativeProps(props, React.createElement("div", {
|
|
12
|
-
className: classNames(classPrefix, `${classPrefix}-${props.mode}`)
|
|
19
|
+
className: classNames(classPrefix, `${classPrefix}-${props.mode}`),
|
|
20
|
+
ref: nativeElementRef
|
|
13
21
|
}, props.header && React.createElement("div", {
|
|
14
22
|
className: `${classPrefix}-header`
|
|
15
23
|
}, props.header), React.createElement("div", {
|
|
@@ -17,4 +25,4 @@ export const List = p => {
|
|
|
17
25
|
}, React.createElement("div", {
|
|
18
26
|
className: `${classPrefix}-body-inner`
|
|
19
27
|
}, props.children))));
|
|
20
|
-
};
|
|
28
|
+
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type Action = {
|
|
4
4
|
key: string | number;
|
|
5
|
-
text:
|
|
5
|
+
text: ReactNode;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
danger?: boolean;
|
|
8
8
|
primary?: boolean;
|
|
@@ -48,14 +48,6 @@
|
|
|
48
48
|
line-height: 1.4;
|
|
49
49
|
color: var(--adm-color-text);
|
|
50
50
|
}
|
|
51
|
-
.adm-modal-close {
|
|
52
|
-
position: absolute;
|
|
53
|
-
right: 8px;
|
|
54
|
-
top: 8px;
|
|
55
|
-
color: var(--adm-color-weak);
|
|
56
|
-
padding: 4px;
|
|
57
|
-
font-size: var(--adm-font-size-10);
|
|
58
|
-
}
|
|
59
51
|
.adm-modal-footer {
|
|
60
52
|
user-select: none;
|
|
61
53
|
padding: 8px 12px 12px;
|
|
@@ -6,19 +6,16 @@ import { ModalActionButton } from './modal-action-button';
|
|
|
6
6
|
import Image from '../image';
|
|
7
7
|
import Space from '../space';
|
|
8
8
|
import AutoCenter from '../auto-center';
|
|
9
|
-
import { CloseOutline } from 'antd-mobile-icons';
|
|
10
9
|
import CenterPopup from '../center-popup';
|
|
11
10
|
const defaultProps = {
|
|
12
11
|
actions: [],
|
|
13
12
|
closeOnAction: false,
|
|
14
|
-
closeOnMaskClick: false
|
|
13
|
+
closeOnMaskClick: false,
|
|
14
|
+
getContainer: null
|
|
15
15
|
};
|
|
16
16
|
export const Modal = p => {
|
|
17
17
|
const props = mergeProps(defaultProps, p);
|
|
18
|
-
const element = React.createElement(React.Fragment, null, props.
|
|
19
|
-
className: classNames(cls('close'), 'adm-plain-anchor'),
|
|
20
|
-
onClick: props.onClose
|
|
21
|
-
}, React.createElement(CloseOutline, null)), !!props.image && React.createElement("div", {
|
|
18
|
+
const element = React.createElement(React.Fragment, null, !!props.image && React.createElement("div", {
|
|
22
19
|
className: cls('image-container')
|
|
23
20
|
}, React.createElement(Image, {
|
|
24
21
|
src: props.image,
|
|
@@ -54,11 +51,9 @@ export const Modal = p => {
|
|
|
54
51
|
style: props.style,
|
|
55
52
|
afterClose: props.afterClose,
|
|
56
53
|
afterShow: props.afterShow,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
61
|
-
} : undefined,
|
|
54
|
+
showCloseButton: props.showCloseButton,
|
|
55
|
+
closeOnMaskClick: props.closeOnMaskClick,
|
|
56
|
+
onClose: props.onClose,
|
|
62
57
|
visible: props.visible,
|
|
63
58
|
getContainer: props.getContainer,
|
|
64
59
|
bodyStyle: props.bodyStyle,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PopupProps } from '../popup';
|
|
3
|
-
import { GetContainer } from '../../utils/render-to-container';
|
|
4
3
|
import { NativeProps } from '../../utils/native-props';
|
|
5
4
|
export declare type NumberKeyboardProps = {
|
|
6
5
|
visible?: boolean;
|
|
7
6
|
title?: string;
|
|
8
|
-
getContainer?: GetContainer;
|
|
9
7
|
confirmText?: string | null;
|
|
10
8
|
customKey?: '-' | '.' | 'X';
|
|
11
9
|
randomOrder?: boolean;
|
|
@@ -14,9 +12,7 @@ export declare type NumberKeyboardProps = {
|
|
|
14
12
|
onDelete?: () => void;
|
|
15
13
|
onClose?: () => void;
|
|
16
14
|
onConfirm?: () => void;
|
|
17
|
-
afterShow?: () => void;
|
|
18
|
-
afterClose?: () => void;
|
|
19
15
|
closeOnConfirm?: boolean;
|
|
20
16
|
safeArea?: boolean;
|
|
21
|
-
} & Pick<PopupProps, 'stopPropagation'> & NativeProps;
|
|
17
|
+
} & Pick<PopupProps, 'afterClose' | 'afterShow' | 'getContainer' | 'destroyOnClose' | 'forceRender' | 'stopPropagation'> & NativeProps;
|
|
22
18
|
export declare const NumberKeyboard: React.FC<NumberKeyboardProps>;
|
|
@@ -14,7 +14,9 @@ const defaultProps = {
|
|
|
14
14
|
showCloseButton: true,
|
|
15
15
|
confirmText: null,
|
|
16
16
|
closeOnConfirm: true,
|
|
17
|
-
safeArea: true
|
|
17
|
+
safeArea: true,
|
|
18
|
+
destroyOnClose: false,
|
|
19
|
+
forceRender: false
|
|
18
20
|
};
|
|
19
21
|
export const NumberKeyboard = p => {
|
|
20
22
|
const props = mergeProps(defaultProps, p);
|
|
@@ -119,7 +121,11 @@ export const NumberKeyboard = p => {
|
|
|
119
121
|
'sign-key': !isNumberKey && key,
|
|
120
122
|
'mid-key': index === 9 && !!confirmText
|
|
121
123
|
});
|
|
122
|
-
|
|
124
|
+
const ariaProps = key ? {
|
|
125
|
+
role: 'button',
|
|
126
|
+
title: key
|
|
127
|
+
} : undefined;
|
|
128
|
+
return React.createElement("div", Object.assign({
|
|
123
129
|
key: key,
|
|
124
130
|
className: className,
|
|
125
131
|
onTouchStart: () => {
|
|
@@ -133,10 +139,8 @@ export const NumberKeyboard = p => {
|
|
|
133
139
|
if (key === 'BACKSPACE') {
|
|
134
140
|
onBackspacePressEnd();
|
|
135
141
|
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
role: 'button'
|
|
139
|
-
}, key === 'BACKSPACE' ? React.createElement(TextDeletionOutline, null) : key);
|
|
142
|
+
}
|
|
143
|
+
}, ariaProps), key === 'BACKSPACE' ? React.createElement(TextDeletionOutline, null) : key);
|
|
140
144
|
};
|
|
141
145
|
|
|
142
146
|
return React.createElement(Popup, {
|
|
@@ -146,7 +150,9 @@ export const NumberKeyboard = p => {
|
|
|
146
150
|
afterClose: props.afterClose,
|
|
147
151
|
afterShow: props.afterShow,
|
|
148
152
|
className: `${classPrefix}-popup`,
|
|
149
|
-
stopPropagation: props.stopPropagation
|
|
153
|
+
stopPropagation: props.stopPropagation,
|
|
154
|
+
destroyOnClose: props.destroyOnClose,
|
|
155
|
+
forceRender: props.forceRender
|
|
150
156
|
}, withNativeProps(props, React.createElement("div", {
|
|
151
157
|
ref: keyboardRef,
|
|
152
158
|
className: classPrefix,
|
|
@@ -32,4 +32,8 @@ export declare const PasscodeInput: React.ForwardRefExoticComponent<{
|
|
|
32
32
|
onFocus?: (() => void) | undefined;
|
|
33
33
|
keyboard?: React.ReactElement<NumberKeyboardProps, string | React.JSXElementConstructor<any>> | undefined;
|
|
34
34
|
onFill?: ((val: string) => void) | undefined;
|
|
35
|
-
} &
|
|
35
|
+
} & {
|
|
36
|
+
className?: string | undefined;
|
|
37
|
+
style?: (React.CSSProperties & Partial<Record<"--border-radius" | "--border-color" | "--cell-size" | "--dot-size" | "--cell-gap", string>>) | undefined;
|
|
38
|
+
tabIndex?: number | undefined;
|
|
39
|
+
} & React.AriaAttributes & React.RefAttributes<PasscodeInputRef>>;
|
|
@@ -20,9 +20,11 @@ declare const _default: import("react").NamedExoticComponent<{
|
|
|
20
20
|
mouseWheel?: boolean | undefined;
|
|
21
21
|
popupClassName?: string | undefined;
|
|
22
22
|
popupStyle?: import("react").CSSProperties | undefined;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
} & Pick<import("../popup").PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
24
|
+
className?: string | undefined;
|
|
25
|
+
style?: (import("react").CSSProperties & Partial<Record<"--item-height" | "--header-button-font-size" | "--title-font-size" | "--item-font-size", string>>) | undefined;
|
|
26
|
+
tabIndex?: number | undefined;
|
|
27
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./picker").PickerActions>> & {
|
|
26
28
|
readonly type: import("react").ForwardRefExoticComponent<{
|
|
27
29
|
columns: import("../picker-view").PickerColumn[] | ((value: import("../picker-view").PickerValue[]) => import("../picker-view").PickerColumn[]);
|
|
28
30
|
value?: import("../picker-view").PickerValue[] | undefined;
|
|
@@ -41,9 +43,11 @@ declare const _default: import("react").NamedExoticComponent<{
|
|
|
41
43
|
mouseWheel?: boolean | undefined;
|
|
42
44
|
popupClassName?: string | undefined;
|
|
43
45
|
popupStyle?: import("react").CSSProperties | undefined;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
} & Pick<import("../popup").PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
47
|
+
className?: string | undefined;
|
|
48
|
+
style?: (import("react").CSSProperties & Partial<Record<"--item-height" | "--header-button-font-size" | "--title-font-size" | "--item-font-size", string>>) | undefined;
|
|
49
|
+
tabIndex?: number | undefined;
|
|
50
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./picker").PickerActions>>;
|
|
47
51
|
} & {
|
|
48
52
|
prompt: typeof prompt;
|
|
49
53
|
};
|
|
@@ -26,9 +26,7 @@ export declare type PickerProps = {
|
|
|
26
26
|
mouseWheel?: boolean;
|
|
27
27
|
popupClassName?: string;
|
|
28
28
|
popupStyle?: React.CSSProperties;
|
|
29
|
-
|
|
30
|
-
destroyOnClose?: boolean;
|
|
31
|
-
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation'> & NativeProps<'--header-button-font-size' | '--title-font-size' | '--item-font-size' | '--item-height'>;
|
|
29
|
+
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation' | 'forceRender' | 'destroyOnClose'> & NativeProps<'--header-button-font-size' | '--title-font-size' | '--item-font-size' | '--item-height'>;
|
|
32
30
|
export declare const Picker: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
33
31
|
columns: PickerColumn[] | ((value: PickerValue[]) => PickerColumn[]);
|
|
34
32
|
value?: PickerValue[] | undefined;
|
|
@@ -47,6 +45,8 @@ export declare const Picker: React.MemoExoticComponent<React.ForwardRefExoticCom
|
|
|
47
45
|
mouseWheel?: boolean | undefined;
|
|
48
46
|
popupClassName?: string | undefined;
|
|
49
47
|
popupStyle?: React.CSSProperties | undefined;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
} & Pick<PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
49
|
+
className?: string | undefined;
|
|
50
|
+
style?: (React.CSSProperties & Partial<Record<"--item-height" | "--header-button-font-size" | "--title-font-size" | "--item-font-size", string>>) | undefined;
|
|
51
|
+
tabIndex?: number | undefined;
|
|
52
|
+
} & React.AriaAttributes & React.RefAttributes<PickerActions>>>;
|
|
@@ -10,12 +10,13 @@ import { useConfig } from '../config-provider';
|
|
|
10
10
|
import { useMemoizedFn } from 'ahooks';
|
|
11
11
|
import SafeArea from '../safe-area';
|
|
12
12
|
import { defaultRenderLabel } from './picker-utils';
|
|
13
|
-
import { useShouldRender } from '../../utils/should-render';
|
|
14
13
|
const classPrefix = `adm-picker`;
|
|
15
14
|
const defaultProps = {
|
|
16
15
|
defaultValue: [],
|
|
17
16
|
closeOnMaskClick: true,
|
|
18
|
-
renderLabel: defaultRenderLabel
|
|
17
|
+
renderLabel: defaultRenderLabel,
|
|
18
|
+
destroyOnClose: false,
|
|
19
|
+
forceRender: false
|
|
19
20
|
};
|
|
20
21
|
export const Picker = memo(forwardRef((p, ref) => {
|
|
21
22
|
var _a;
|
|
@@ -79,12 +80,12 @@ export const Picker = memo(forwardRef((p, ref) => {
|
|
|
79
80
|
(_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, val, ext);
|
|
80
81
|
}
|
|
81
82
|
});
|
|
82
|
-
const shouldRender = useShouldRender(visible, props.forceRender, props.destroyOnClose);
|
|
83
83
|
const pickerElement = withNativeProps(props, React.createElement("div", {
|
|
84
84
|
className: classPrefix
|
|
85
85
|
}, React.createElement("div", {
|
|
86
86
|
className: `${classPrefix}-header`
|
|
87
87
|
}, React.createElement("a", {
|
|
88
|
+
role: 'button',
|
|
88
89
|
className: `${classPrefix}-header-button`,
|
|
89
90
|
onClick: () => {
|
|
90
91
|
var _a;
|
|
@@ -95,6 +96,7 @@ export const Picker = memo(forwardRef((p, ref) => {
|
|
|
95
96
|
}, props.cancelText), React.createElement("div", {
|
|
96
97
|
className: `${classPrefix}-header-title`
|
|
97
98
|
}, props.title), React.createElement("a", {
|
|
99
|
+
role: 'button',
|
|
98
100
|
className: `${classPrefix}-header-button`,
|
|
99
101
|
onClick: () => {
|
|
100
102
|
setValue(innerValue);
|
|
@@ -122,13 +124,13 @@ export const Picker = memo(forwardRef((p, ref) => {
|
|
|
122
124
|
setVisible(false);
|
|
123
125
|
},
|
|
124
126
|
getContainer: props.getContainer,
|
|
125
|
-
destroyOnClose:
|
|
127
|
+
destroyOnClose: props.destroyOnClose,
|
|
126
128
|
afterShow: props.afterShow,
|
|
127
129
|
afterClose: props.afterClose,
|
|
128
130
|
onClick: props.onClick,
|
|
129
|
-
forceRender:
|
|
131
|
+
forceRender: props.forceRender,
|
|
130
132
|
stopPropagation: props.stopPropagation
|
|
131
|
-
},
|
|
133
|
+
}, pickerElement, React.createElement(SafeArea, {
|
|
132
134
|
position: 'bottom'
|
|
133
135
|
}));
|
|
134
136
|
return React.createElement(React.Fragment, null, popupElement, (_a = props.children) === null || _a === void 0 ? void 0 : _a.call(props, extend.items, actions));
|
|
@@ -132,27 +132,29 @@ export const Wheel = memo(props => {
|
|
|
132
132
|
className: 'adm-picker-view-column-accessible-current',
|
|
133
133
|
role: 'button',
|
|
134
134
|
"aria-label": current ? `当前选择的是:${current.label}` : '当前未选择'
|
|
135
|
-
}, "-"), React.createElement("div",
|
|
135
|
+
}, "-"), React.createElement("div", {
|
|
136
136
|
className: 'adm-picker-view-column-accessible-button',
|
|
137
137
|
onClick: () => {
|
|
138
|
+
if (!previous) return;
|
|
138
139
|
scrollSelect(previousIndex);
|
|
139
140
|
},
|
|
140
|
-
role: 'button',
|
|
141
|
-
"aria-label": `选择上一项:${previous.label}`
|
|
142
|
-
}, "-")
|
|
141
|
+
role: previous ? 'button' : 'text',
|
|
142
|
+
"aria-label": !previous ? '没有上一项' : `选择上一项:${previous.label}`
|
|
143
|
+
}, "-"), React.createElement("div", {
|
|
143
144
|
className: 'adm-picker-view-column-accessible-button',
|
|
144
145
|
onClick: () => {
|
|
146
|
+
if (!next) return;
|
|
145
147
|
scrollSelect(nextIndex);
|
|
146
148
|
},
|
|
147
|
-
role: 'button',
|
|
148
|
-
"aria-label": `选择下一项:${next.label}`
|
|
149
|
-
}, "-"))
|
|
149
|
+
role: next ? 'button' : 'text',
|
|
150
|
+
"aria-label": !next ? '没有下一项' : `选择下一项:${next.label}`
|
|
151
|
+
}, "-"));
|
|
150
152
|
}
|
|
151
153
|
|
|
152
154
|
return React.createElement("div", {
|
|
153
|
-
ref: rootRef,
|
|
154
155
|
className: `${classPrefix}-column`
|
|
155
156
|
}, React.createElement(animated.div, {
|
|
157
|
+
ref: rootRef,
|
|
156
158
|
style: {
|
|
157
159
|
translateY: y
|
|
158
160
|
},
|
|
@@ -17,7 +17,11 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
17
17
|
placement?: DeprecatedPlacement | Placement | undefined;
|
|
18
18
|
stopPropagation?: "click"[] | undefined;
|
|
19
19
|
content: import("react").ReactNode;
|
|
20
|
-
} &
|
|
20
|
+
} & {
|
|
21
|
+
className?: string | undefined;
|
|
22
|
+
style?: (import("react").CSSProperties & Partial<Record<"--z-index", string>>) | undefined;
|
|
23
|
+
tabIndex?: number | undefined;
|
|
24
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./popover").PopoverRef>> & {
|
|
21
25
|
Menu: import("react").ForwardRefExoticComponent<Omit<import("./popover").PopoverProps, "content"> & {
|
|
22
26
|
actions: import("./popover-menu").Action[];
|
|
23
27
|
onAction?: ((item: import("./popover-menu").Action) => void) | undefined;
|
|
@@ -33,4 +33,8 @@ export declare const Popover: React.ForwardRefExoticComponent<{
|
|
|
33
33
|
placement?: DeprecatedPlacement | Placement | undefined;
|
|
34
34
|
stopPropagation?: "click"[] | undefined;
|
|
35
35
|
content: React.ReactNode;
|
|
36
|
-
} &
|
|
36
|
+
} & {
|
|
37
|
+
className?: string | undefined;
|
|
38
|
+
style?: (React.CSSProperties & Partial<Record<"--z-index", string>>) | undefined;
|
|
39
|
+
tabIndex?: number | undefined;
|
|
40
|
+
} & React.AriaAttributes & React.RefAttributes<PopoverRef>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GetContainer } from '../../utils/render-to-container';
|
|
3
|
+
import { MaskProps } from '../mask';
|
|
4
|
+
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
5
|
+
export declare type PopupBaseProps = {
|
|
6
|
+
afterClose?: () => void;
|
|
7
|
+
afterShow?: () => void;
|
|
8
|
+
bodyClassName?: string;
|
|
9
|
+
bodyStyle?: React.CSSProperties;
|
|
10
|
+
closeOnMaskClick?: boolean;
|
|
11
|
+
destroyOnClose?: boolean;
|
|
12
|
+
disableBodyScroll?: boolean;
|
|
13
|
+
forceRender?: boolean;
|
|
14
|
+
getContainer?: GetContainer;
|
|
15
|
+
mask?: boolean;
|
|
16
|
+
maskClassName?: string;
|
|
17
|
+
maskStyle?: MaskProps['style'];
|
|
18
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
19
|
+
onClose?: () => void;
|
|
20
|
+
onMaskClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
21
|
+
showCloseButton?: boolean;
|
|
22
|
+
stopPropagation?: PropagationEvent[];
|
|
23
|
+
visible?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare const defaultPopupBaseProps: {
|
|
26
|
+
closeOnMaskClick: boolean;
|
|
27
|
+
destroyOnClose: boolean;
|
|
28
|
+
disableBodyScroll: boolean;
|
|
29
|
+
forceRender: boolean;
|
|
30
|
+
getContainer: () => HTMLElement;
|
|
31
|
+
mask: boolean;
|
|
32
|
+
showCloseButton: boolean;
|
|
33
|
+
stopPropagation: string[];
|
|
34
|
+
visible: boolean;
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const defaultPopupBaseProps = {
|
|
2
|
+
closeOnMaskClick: false,
|
|
3
|
+
destroyOnClose: false,
|
|
4
|
+
disableBodyScroll: true,
|
|
5
|
+
forceRender: false,
|
|
6
|
+
getContainer: () => document.body,
|
|
7
|
+
mask: true,
|
|
8
|
+
showCloseButton: false,
|
|
9
|
+
stopPropagation: ['click'],
|
|
10
|
+
visible: false
|
|
11
|
+
};
|
|
@@ -8,23 +8,49 @@
|
|
|
8
8
|
background-color: var(--adm-color-background);
|
|
9
9
|
z-index: calc(var(--z-index) + 10);
|
|
10
10
|
}
|
|
11
|
+
.adm-popup-body .adm-popup-close-icon {
|
|
12
|
+
position: absolute;
|
|
13
|
+
z-index: 100;
|
|
14
|
+
}
|
|
11
15
|
.adm-popup-body-position-bottom {
|
|
12
16
|
width: 100%;
|
|
13
17
|
bottom: 0;
|
|
14
18
|
left: 0;
|
|
15
19
|
}
|
|
20
|
+
.adm-popup-body-position-bottom .adm-popup-close-icon {
|
|
21
|
+
right: 8px;
|
|
22
|
+
top: 8px;
|
|
23
|
+
}
|
|
16
24
|
.adm-popup-body-position-top {
|
|
17
25
|
width: 100%;
|
|
18
26
|
top: 0;
|
|
19
27
|
left: 0;
|
|
20
28
|
}
|
|
29
|
+
.adm-popup-body-position-top .adm-popup-close-icon {
|
|
30
|
+
right: 8px;
|
|
31
|
+
bottom: 8px;
|
|
32
|
+
}
|
|
21
33
|
.adm-popup-body-position-left {
|
|
22
34
|
height: 100%;
|
|
23
35
|
top: 0;
|
|
24
36
|
left: 0;
|
|
25
37
|
}
|
|
38
|
+
.adm-popup-body-position-left .adm-popup-close-icon {
|
|
39
|
+
right: 8px;
|
|
40
|
+
top: 8px;
|
|
41
|
+
}
|
|
26
42
|
.adm-popup-body-position-right {
|
|
27
43
|
height: 100%;
|
|
28
44
|
top: 0;
|
|
29
45
|
right: 0;
|
|
30
46
|
}
|
|
47
|
+
.adm-popup-body-position-right .adm-popup-close-icon {
|
|
48
|
+
left: 8px;
|
|
49
|
+
top: 8px;
|
|
50
|
+
}
|
|
51
|
+
.adm-popup-close-icon {
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
padding: 4px;
|
|
54
|
+
font-size: 18px;
|
|
55
|
+
color: var(--adm-color-weak);
|
|
56
|
+
}
|