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
|
@@ -154,27 +154,29 @@ const Wheel = (0, _react.memo)(props => {
|
|
|
154
154
|
className: 'adm-picker-view-column-accessible-current',
|
|
155
155
|
role: 'button',
|
|
156
156
|
"aria-label": current ? `当前选择的是:${current.label}` : '当前未选择'
|
|
157
|
-
}, "-"), _react.default.createElement("div",
|
|
157
|
+
}, "-"), _react.default.createElement("div", {
|
|
158
158
|
className: 'adm-picker-view-column-accessible-button',
|
|
159
159
|
onClick: () => {
|
|
160
|
+
if (!previous) return;
|
|
160
161
|
scrollSelect(previousIndex);
|
|
161
162
|
},
|
|
162
|
-
role: 'button',
|
|
163
|
-
"aria-label": `选择上一项:${previous.label}`
|
|
164
|
-
}, "-")
|
|
163
|
+
role: previous ? 'button' : 'text',
|
|
164
|
+
"aria-label": !previous ? '没有上一项' : `选择上一项:${previous.label}`
|
|
165
|
+
}, "-"), _react.default.createElement("div", {
|
|
165
166
|
className: 'adm-picker-view-column-accessible-button',
|
|
166
167
|
onClick: () => {
|
|
168
|
+
if (!next) return;
|
|
167
169
|
scrollSelect(nextIndex);
|
|
168
170
|
},
|
|
169
|
-
role: 'button',
|
|
170
|
-
"aria-label": `选择下一项:${next.label}`
|
|
171
|
-
}, "-"))
|
|
171
|
+
role: next ? 'button' : 'text',
|
|
172
|
+
"aria-label": !next ? '没有下一项' : `选择下一项:${next.label}`
|
|
173
|
+
}, "-"));
|
|
172
174
|
}
|
|
173
175
|
|
|
174
176
|
return _react.default.createElement("div", {
|
|
175
|
-
ref: rootRef,
|
|
176
177
|
className: `${classPrefix}-column`
|
|
177
178
|
}, _react.default.createElement(_web.animated.div, {
|
|
179
|
+
ref: rootRef,
|
|
178
180
|
style: {
|
|
179
181
|
translateY: y
|
|
180
182
|
},
|
|
@@ -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,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultPopupBaseProps = void 0;
|
|
7
|
+
const defaultPopupBaseProps = {
|
|
8
|
+
closeOnMaskClick: false,
|
|
9
|
+
destroyOnClose: false,
|
|
10
|
+
disableBodyScroll: true,
|
|
11
|
+
forceRender: false,
|
|
12
|
+
getContainer: () => document.body,
|
|
13
|
+
mask: true,
|
|
14
|
+
showCloseButton: false,
|
|
15
|
+
stopPropagation: ['click'],
|
|
16
|
+
visible: false
|
|
17
|
+
};
|
|
18
|
+
exports.defaultPopupBaseProps = defaultPopupBaseProps;
|
|
@@ -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
|
+
}
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
6
|
-
export declare type PopupProps = PropsWithChildren<{
|
|
7
|
-
afterClose?: () => void;
|
|
8
|
-
afterShow?: () => void;
|
|
9
|
-
bodyClassName?: string;
|
|
10
|
-
bodyStyle?: React.CSSProperties;
|
|
11
|
-
destroyOnClose?: boolean;
|
|
12
|
-
forceRender?: boolean;
|
|
13
|
-
getContainer?: GetContainer;
|
|
14
|
-
mask?: boolean;
|
|
15
|
-
maskClassName?: string;
|
|
16
|
-
maskStyle?: MaskProps['style'];
|
|
17
|
-
onClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
18
|
-
onMaskClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
3
|
+
import { PopupBaseProps } from './popup-base-props';
|
|
4
|
+
export declare type PopupProps = PopupBaseProps & PropsWithChildren<{
|
|
19
5
|
position?: 'bottom' | 'top' | 'left' | 'right';
|
|
20
|
-
stopPropagation?: PropagationEvent[];
|
|
21
|
-
visible?: boolean;
|
|
22
6
|
}> & NativeProps<'--z-index'>;
|
|
23
7
|
export declare const Popup: FC<PopupProps>;
|
|
@@ -23,9 +23,15 @@ var _renderToContainer = require("../../utils/render-to-container");
|
|
|
23
23
|
|
|
24
24
|
var _web = require("@react-spring/web");
|
|
25
25
|
|
|
26
|
+
var _withStopPropagation = require("../../utils/with-stop-propagation");
|
|
27
|
+
|
|
26
28
|
var _shouldRender = require("../../utils/should-render");
|
|
27
29
|
|
|
28
|
-
var
|
|
30
|
+
var _antdMobileIcons = require("antd-mobile-icons");
|
|
31
|
+
|
|
32
|
+
var _popupBaseProps = require("./popup-base-props");
|
|
33
|
+
|
|
34
|
+
var _useInnerVisible = require("../../utils/use-inner-visible");
|
|
29
35
|
|
|
30
36
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
37
|
|
|
@@ -34,21 +40,21 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
34
40
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
35
41
|
|
|
36
42
|
const classPrefix = `adm-popup`;
|
|
37
|
-
const defaultProps = {
|
|
38
|
-
position: 'bottom'
|
|
39
|
-
|
|
40
|
-
getContainer: () => document.body,
|
|
41
|
-
mask: true,
|
|
42
|
-
stopPropagation: ['click']
|
|
43
|
-
};
|
|
43
|
+
const defaultProps = Object.assign(Object.assign({}, _popupBaseProps.defaultPopupBaseProps), {
|
|
44
|
+
position: 'bottom'
|
|
45
|
+
});
|
|
44
46
|
|
|
45
47
|
const Popup = p => {
|
|
46
48
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
47
49
|
const bodyCls = (0, _classnames.default)(`${classPrefix}-body`, props.bodyClassName, `${classPrefix}-body-position-${props.position}`);
|
|
48
|
-
const ref = (0, _react.useRef)(null);
|
|
49
50
|
const [active, setActive] = (0, _react.useState)(props.visible);
|
|
50
|
-
(0,
|
|
51
|
-
|
|
51
|
+
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
52
|
+
if (props.visible) {
|
|
53
|
+
setActive(true);
|
|
54
|
+
}
|
|
55
|
+
}, [props.visible]);
|
|
56
|
+
const ref = (0, _react.useRef)(null);
|
|
57
|
+
(0, _useLockScroll.useLockScroll)(ref, props.disableBodyScroll && active);
|
|
52
58
|
const unmountedRef = (0, _ahooks.useUnmountedRef)();
|
|
53
59
|
const {
|
|
54
60
|
percent
|
|
@@ -60,9 +66,6 @@ const Popup = p => {
|
|
|
60
66
|
tension: 300,
|
|
61
67
|
friction: 30
|
|
62
68
|
},
|
|
63
|
-
onStart: () => {
|
|
64
|
-
setActive(true);
|
|
65
|
-
},
|
|
66
69
|
onRest: () => {
|
|
67
70
|
var _a, _b;
|
|
68
71
|
|
|
@@ -76,6 +79,7 @@ const Popup = p => {
|
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
81
|
});
|
|
82
|
+
const maskVisible = (0, _useInnerVisible.useInnerVisible)(active && props.visible);
|
|
79
83
|
const node = (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
80
84
|
className: classPrefix,
|
|
81
85
|
onClick: props.onClick,
|
|
@@ -83,8 +87,18 @@ const Popup = p => {
|
|
|
83
87
|
display: active ? undefined : 'none'
|
|
84
88
|
}
|
|
85
89
|
}, props.mask && _react.default.createElement(_mask.default, {
|
|
86
|
-
visible:
|
|
87
|
-
|
|
90
|
+
visible: maskVisible,
|
|
91
|
+
forceRender: props.forceRender,
|
|
92
|
+
destroyOnClose: props.destroyOnClose,
|
|
93
|
+
onMaskClick: e => {
|
|
94
|
+
var _a, _b;
|
|
95
|
+
|
|
96
|
+
(_a = props.onMaskClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
97
|
+
|
|
98
|
+
if (props.closeOnMaskClick) {
|
|
99
|
+
(_b = props.onClose) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
100
|
+
}
|
|
101
|
+
},
|
|
88
102
|
className: props.maskClassName,
|
|
89
103
|
style: props.maskStyle,
|
|
90
104
|
disableBodyScroll: false,
|
|
@@ -113,8 +127,19 @@ const Popup = p => {
|
|
|
113
127
|
})
|
|
114
128
|
}),
|
|
115
129
|
ref: ref
|
|
116
|
-
},
|
|
117
|
-
|
|
130
|
+
}, props.showCloseButton && _react.default.createElement("a", {
|
|
131
|
+
className: (0, _classnames.default)(`${classPrefix}-close-icon`, 'adm-plain-anchor'),
|
|
132
|
+
onClick: () => {
|
|
133
|
+
var _a;
|
|
134
|
+
|
|
135
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
136
|
+
}
|
|
137
|
+
}, _react.default.createElement(_antdMobileIcons.CloseOutline, null)), props.children))));
|
|
138
|
+
return _react.default.createElement(_shouldRender.ShouldRender, {
|
|
139
|
+
active: active,
|
|
140
|
+
forceRender: props.forceRender,
|
|
141
|
+
destroyOnClose: props.destroyOnClose
|
|
142
|
+
}, (0, _renderToContainer.renderToContainer)(props.getContainer, node));
|
|
118
143
|
};
|
|
119
144
|
|
|
120
145
|
exports.Popup = Popup;
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
.adm-progress-bar {
|
|
2
|
-
--track-width: var(--adm-progress-bar-track-width,
|
|
2
|
+
--track-width: var(--adm-progress-bar-track-width, 8px);
|
|
3
3
|
--track-color: var(--adm-progress-bar-track-color, #e5e5e5);
|
|
4
4
|
--fill-color: var(--adm-progress-bar-fill-color, var(--adm-color-primary));
|
|
5
|
+
--text-width: var(--adm-progress-bar-text-width, 40px);
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
5
8
|
}
|
|
6
9
|
.adm-progress-bar-trail {
|
|
10
|
+
flex: auto;
|
|
7
11
|
background: var(--track-color);
|
|
8
12
|
overflow: hidden;
|
|
9
13
|
height: var(--track-width);
|
|
10
|
-
border-radius: var(--track-width);
|
|
11
14
|
}
|
|
12
15
|
.adm-progress-bar-fill {
|
|
13
16
|
transition: width 0.3s;
|
|
14
17
|
background: var(--fill-color);
|
|
15
|
-
height:
|
|
18
|
+
height: var(--track-width);
|
|
19
|
+
}
|
|
20
|
+
.adm-progress-bar-text {
|
|
21
|
+
flex: none;
|
|
22
|
+
width: calc(var(--text-width) + 8px);
|
|
23
|
+
padding-left: 8px;
|
|
24
|
+
color: #999999;
|
|
25
|
+
}
|
|
26
|
+
.adm-progress-bar-rounded .adm-progress-bar-trail,
|
|
27
|
+
.adm-progress-bar-rounded .adm-progress-bar-fill {
|
|
16
28
|
border-radius: var(--track-width);
|
|
17
29
|
}
|
|
@@ -1,6 +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 ProgressBarProps = {
|
|
4
4
|
percent?: number;
|
|
5
|
-
|
|
5
|
+
rounded?: boolean;
|
|
6
|
+
text?: boolean | ReactNode | ((percent: number) => ReactNode);
|
|
7
|
+
} & NativeProps<'--track-width' | '--track-color' | '--fill-color' | '--text-width'>;
|
|
6
8
|
export declare const ProgressBar: FC<ProgressBarProps>;
|
|
@@ -11,25 +11,47 @@ var _nativeProps = require("../../utils/native-props");
|
|
|
11
11
|
|
|
12
12
|
var _withDefaultProps = require("../../utils/with-default-props");
|
|
13
13
|
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
16
|
+
var _isNodeWithContent = require("../../utils/is-node-with-content");
|
|
17
|
+
|
|
14
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
19
|
|
|
16
20
|
const classPrefix = `adm-progress-bar`;
|
|
21
|
+
const defaultProps = {
|
|
22
|
+
percent: 0,
|
|
23
|
+
rounded: true,
|
|
24
|
+
text: false
|
|
25
|
+
};
|
|
17
26
|
|
|
18
27
|
const ProgressBar = p => {
|
|
19
|
-
const props = (0, _withDefaultProps.mergeProps)(
|
|
20
|
-
percent: 0
|
|
21
|
-
}, p);
|
|
28
|
+
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
22
29
|
const fillStyle = {
|
|
23
30
|
width: `${props.percent}%`
|
|
24
31
|
};
|
|
32
|
+
|
|
33
|
+
const textElement = function () {
|
|
34
|
+
if (props.text === true) {
|
|
35
|
+
return `${props.percent}%`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (typeof props.text === 'function') {
|
|
39
|
+
return props.text(props.percent);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return props.text;
|
|
43
|
+
}();
|
|
44
|
+
|
|
25
45
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
26
|
-
className: classPrefix
|
|
46
|
+
className: (0, _classnames.default)(classPrefix, props.rounded && `${classPrefix}-rounded`)
|
|
27
47
|
}, _react.default.createElement("div", {
|
|
28
48
|
className: `${classPrefix}-trail`
|
|
29
49
|
}, _react.default.createElement("div", {
|
|
30
50
|
className: `${classPrefix}-fill`,
|
|
31
51
|
style: fillStyle
|
|
32
|
-
}))))
|
|
52
|
+
})), (0, _isNodeWithContent.isNodeWithContent)(textElement) && _react.default.createElement("div", {
|
|
53
|
+
className: `${classPrefix}-text`
|
|
54
|
+
}, textElement)));
|
|
33
55
|
};
|
|
34
56
|
|
|
35
57
|
exports.ProgressBar = ProgressBar;
|
|
@@ -62,16 +62,16 @@ const Radio = p => {
|
|
|
62
62
|
|
|
63
63
|
checked = groupContext.value.includes(value);
|
|
64
64
|
|
|
65
|
-
setChecked =
|
|
65
|
+
setChecked = innerChecked => {
|
|
66
66
|
var _a;
|
|
67
67
|
|
|
68
|
-
if (
|
|
68
|
+
if (innerChecked) {
|
|
69
69
|
groupContext.check(value);
|
|
70
70
|
} else {
|
|
71
71
|
groupContext.uncheck(value);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props,
|
|
74
|
+
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, innerChecked);
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
disabled = disabled || groupContext.disabled;
|
|
@@ -31,4 +31,8 @@ export declare const SearchBar: React.ForwardRefExoticComponent<Pick<InputProps,
|
|
|
31
31
|
onSearch?: ((val: string) => void) | undefined;
|
|
32
32
|
onChange?: ((val: string) => void) | undefined;
|
|
33
33
|
onCancel?: (() => void) | undefined;
|
|
34
|
-
} &
|
|
34
|
+
} & {
|
|
35
|
+
className?: string | undefined;
|
|
36
|
+
style?: (React.CSSProperties & Partial<Record<"--height" | "--border-radius" | "--padding-left" | "--background" | "--placeholder-color", string>>) | undefined;
|
|
37
|
+
tabIndex?: number | undefined;
|
|
38
|
+
} & React.AriaAttributes & React.RefAttributes<InputRef>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { FC, RefObject, ReactNode } from 'react';
|
|
2
|
+
import { NativeProps } from '../../utils/native-props';
|
|
2
3
|
declare type ThumbProps = {
|
|
3
4
|
value: number;
|
|
4
5
|
min: number;
|
|
@@ -8,6 +9,6 @@ declare type ThumbProps = {
|
|
|
8
9
|
trackRef: RefObject<HTMLDivElement>;
|
|
9
10
|
icon?: React.ReactNode;
|
|
10
11
|
popover: boolean | ((value: number) => ReactNode);
|
|
11
|
-
};
|
|
12
|
+
} & NativeProps;
|
|
12
13
|
declare const Thumb: FC<ThumbProps>;
|
|
13
14
|
export default Thumb;
|
|
@@ -13,6 +13,8 @@ var _thumbIcon = require("./thumb-icon");
|
|
|
13
13
|
|
|
14
14
|
var _popover = require("../popover/popover");
|
|
15
15
|
|
|
16
|
+
var _configProvider = require("../config-provider");
|
|
17
|
+
|
|
16
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
19
|
|
|
18
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -29,6 +31,9 @@ const Thumb = props => {
|
|
|
29
31
|
icon
|
|
30
32
|
} = props;
|
|
31
33
|
const prevValue = (0, _react.useRef)(value);
|
|
34
|
+
const {
|
|
35
|
+
locale
|
|
36
|
+
} = (0, _configProvider.useConfig)();
|
|
32
37
|
|
|
33
38
|
const currentPosition = () => {
|
|
34
39
|
return {
|
|
@@ -70,7 +75,14 @@ const Thumb = props => {
|
|
|
70
75
|
return _react.default.createElement("div", Object.assign({
|
|
71
76
|
className: `${classPrefix}-thumb-container`,
|
|
72
77
|
style: currentPosition()
|
|
73
|
-
}, bind()
|
|
78
|
+
}, bind(), {
|
|
79
|
+
role: 'slider',
|
|
80
|
+
"aria-label": props['aria-label'] || locale.Slider.name,
|
|
81
|
+
"aria-valuemax": max,
|
|
82
|
+
"aria-valuemin": min,
|
|
83
|
+
"aria-valuenow": value,
|
|
84
|
+
"aria-disabled": disabled
|
|
85
|
+
}), renderPopoverContent ? _react.default.createElement(_popover.Popover, {
|
|
74
86
|
content: renderPopoverContent(value),
|
|
75
87
|
placement: 'top',
|
|
76
88
|
visible: dragging,
|
|
@@ -25,6 +25,8 @@ var _button = _interopRequireDefault(require("../button"));
|
|
|
25
25
|
|
|
26
26
|
var _big = _interopRequireDefault(require("big.js"));
|
|
27
27
|
|
|
28
|
+
var _configProvider = require("../config-provider");
|
|
29
|
+
|
|
28
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
31
|
|
|
30
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -48,6 +50,9 @@ const Stepper = p => {
|
|
|
48
50
|
min,
|
|
49
51
|
inputReadOnly
|
|
50
52
|
} = props;
|
|
53
|
+
const {
|
|
54
|
+
locale
|
|
55
|
+
} = (0, _configProvider.useConfig)();
|
|
51
56
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
|
|
52
57
|
const [inputValue, setInputValue] = (0, _react.useState)(() => convertValueToText(value, props.digits));
|
|
53
58
|
|
|
@@ -129,7 +134,8 @@ const Stepper = p => {
|
|
|
129
134
|
disabled: minusDisabled(),
|
|
130
135
|
fill: 'none',
|
|
131
136
|
shape: 'rectangular',
|
|
132
|
-
color: 'primary'
|
|
137
|
+
color: 'primary',
|
|
138
|
+
"aria-label": locale.Stepper.decrease
|
|
133
139
|
}, _react.default.createElement(_antdMobileIcons.MinusOutline, null)), _react.default.createElement("div", {
|
|
134
140
|
className: `${classPrefix}-middle`
|
|
135
141
|
}, _react.default.createElement(_input.default, {
|
|
@@ -151,14 +157,19 @@ const Stepper = p => {
|
|
|
151
157
|
setHasFocus(false);
|
|
152
158
|
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
153
159
|
},
|
|
154
|
-
readOnly: inputReadOnly
|
|
160
|
+
readOnly: inputReadOnly,
|
|
161
|
+
role: 'spinbutton',
|
|
162
|
+
"aria-valuenow": Number(inputValue),
|
|
163
|
+
"aria-valuemax": max,
|
|
164
|
+
"aria-valuemin": min
|
|
155
165
|
})), _react.default.createElement(_button.default, {
|
|
156
166
|
className: `${classPrefix}-plus`,
|
|
157
167
|
onClick: handlePlus,
|
|
158
168
|
disabled: plusDisabled(),
|
|
159
169
|
fill: 'none',
|
|
160
170
|
shape: 'rectangular',
|
|
161
|
-
color: 'primary'
|
|
171
|
+
color: 'primary',
|
|
172
|
+
"aria-label": locale.Stepper.increase
|
|
162
173
|
}, _react.default.createElement(_antdMobileIcons.AddOutline, null))));
|
|
163
174
|
};
|
|
164
175
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
.adm-step .adm-step-indicator .adm-step-icon-container {
|
|
15
15
|
position: absolute;
|
|
16
16
|
z-index: 1;
|
|
17
|
-
background: var(--adm-color-
|
|
17
|
+
background: var(--adm-color-background);
|
|
18
18
|
color: var(--icon-color);
|
|
19
19
|
}
|
|
20
20
|
.adm-step .adm-step-indicator .adm-step-icon-container > .antd-mobile-icon {
|
|
@@ -29,5 +29,9 @@ export declare const SwipeAction: React.ForwardRefExoticComponent<{
|
|
|
29
29
|
closeOnAction?: boolean | undefined;
|
|
30
30
|
children: ReactNode;
|
|
31
31
|
stopPropagation?: "click"[] | undefined;
|
|
32
|
-
} &
|
|
32
|
+
} & {
|
|
33
|
+
className?: string | undefined;
|
|
34
|
+
style?: (React.CSSProperties & Partial<Record<"--background", string>>) | undefined;
|
|
35
|
+
tabIndex?: number | undefined;
|
|
36
|
+
} & React.AriaAttributes & React.RefAttributes<SwipeActionRef>>;
|
|
33
37
|
export {};
|
|
@@ -16,10 +16,18 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
16
16
|
stuckAtBoundary?: boolean | undefined;
|
|
17
17
|
rubberband?: boolean | undefined;
|
|
18
18
|
children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | undefined;
|
|
19
|
-
} &
|
|
19
|
+
} & {
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
style?: (import("react").CSSProperties & Partial<Record<"--width" | "--height" | "--border-radius" | "--track-padding", string>>) | undefined;
|
|
22
|
+
tabIndex?: number | undefined;
|
|
23
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./swiper").SwiperRef>> & {
|
|
20
24
|
Item: import("react").FC<{
|
|
21
25
|
onClick?: ((e: import("react").MouseEvent<HTMLDivElement, MouseEvent>) => void) | undefined;
|
|
22
26
|
children?: import("react").ReactNode;
|
|
23
|
-
} &
|
|
27
|
+
} & {
|
|
28
|
+
className?: string | undefined;
|
|
29
|
+
style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
30
|
+
tabIndex?: number | undefined;
|
|
31
|
+
} & import("react").AriaAttributes>;
|
|
24
32
|
};
|
|
25
33
|
export default _default;
|
|
@@ -37,4 +37,8 @@ export declare const Swiper: React.ForwardRefExoticComponent<{
|
|
|
37
37
|
stuckAtBoundary?: boolean | undefined;
|
|
38
38
|
rubberband?: boolean | undefined;
|
|
39
39
|
children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
40
|
-
} &
|
|
40
|
+
} & {
|
|
41
|
+
className?: string | undefined;
|
|
42
|
+
style?: (React.CSSProperties & Partial<Record<"--width" | "--height" | "--border-radius" | "--track-padding", string>>) | undefined;
|
|
43
|
+
tabIndex?: number | undefined;
|
|
44
|
+
} & React.AriaAttributes & React.RefAttributes<SwiperRef>>;
|
|
@@ -19,6 +19,8 @@ var _withDefaultProps = require("../../utils/with-default-props");
|
|
|
19
19
|
|
|
20
20
|
var _spinIcon = require("./spin-icon");
|
|
21
21
|
|
|
22
|
+
var _configProvider = require("../config-provider");
|
|
23
|
+
|
|
22
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
25
|
|
|
24
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -34,6 +36,9 @@ const Switch = p => {
|
|
|
34
36
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
35
37
|
const disabled = props.disabled || props.loading || false;
|
|
36
38
|
const [changing, setChanging] = (0, _react.useState)(false);
|
|
39
|
+
const {
|
|
40
|
+
locale
|
|
41
|
+
} = (0, _configProvider.useConfig)();
|
|
37
42
|
const [checked, setChecked] = (0, _usePropsValue.usePropsValue)({
|
|
38
43
|
value: props.checked,
|
|
39
44
|
defaultValue: props.defaultChecked,
|
|
@@ -70,7 +75,11 @@ const Switch = p => {
|
|
|
70
75
|
className: (0, _classnames.default)(classPrefix, {
|
|
71
76
|
[`${classPrefix}-checked`]: checked,
|
|
72
77
|
[`${classPrefix}-disabled`]: disabled || changing
|
|
73
|
-
})
|
|
78
|
+
}),
|
|
79
|
+
role: 'switch',
|
|
80
|
+
"aria-label": locale.Switch.name,
|
|
81
|
+
"aria-checked": checked,
|
|
82
|
+
"aria-disabled": disabled
|
|
74
83
|
}, _react.default.createElement("div", {
|
|
75
84
|
className: `${classPrefix}-checkbox`
|
|
76
85
|
}, _react.default.createElement("div", {
|
|
@@ -34,4 +34,8 @@ export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.Detail
|
|
|
34
34
|
maxRows?: number | undefined;
|
|
35
35
|
} | undefined;
|
|
36
36
|
id?: string | undefined;
|
|
37
|
-
} &
|
|
37
|
+
} & {
|
|
38
|
+
className?: string | undefined;
|
|
39
|
+
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align" | "--disabled-color" | "--count-text-align", string>>) | undefined;
|
|
40
|
+
tabIndex?: number | undefined;
|
|
41
|
+
} & React.AriaAttributes & React.RefAttributes<TextAreaRef>>;
|