antd-mobile 5.14.2 → 5.15.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 +1 -2
- package/2x/bundle/antd-mobile.cjs.js +201 -162
- package/2x/bundle/antd-mobile.es.js +196 -157
- package/2x/bundle/style.css +9 -6
- package/2x/cjs/components/badge/badge.css +1 -1
- package/2x/cjs/components/badge/badge.d.ts +2 -0
- package/2x/cjs/components/badge/badge.js +2 -1
- package/2x/cjs/components/button/button.d.ts +5 -1
- package/2x/cjs/components/center-popup/center-popup.d.ts +1 -0
- package/2x/cjs/components/center-popup/center-popup.js +3 -1
- package/2x/cjs/components/checkbox/checkbox.d.ts +22 -2
- package/2x/cjs/components/checkbox/checkbox.js +14 -4
- package/2x/cjs/components/checkbox/index.d.ts +17 -2
- package/2x/cjs/components/checkbox/native-input.js +10 -8
- package/2x/cjs/components/date-picker/date-picker-date-utils.js +12 -15
- package/2x/cjs/components/date-picker/date-picker-week-utils.js +12 -15
- package/2x/cjs/components/date-picker/date-picker.d.ts +5 -1
- package/2x/cjs/components/date-picker/index.d.ts +5 -1
- package/2x/cjs/components/dialog/dialog.js +3 -1
- package/2x/cjs/components/dropdown/dropdown.d.ts +5 -1
- package/2x/cjs/components/dropdown/index.d.ts +5 -1
- package/2x/cjs/components/floating-panel/floating-panel.d.ts +5 -1
- package/2x/cjs/components/form/form-item.js +2 -4
- package/2x/cjs/components/form/form-subscribe.d.ts +7 -2
- package/2x/cjs/components/form/form-subscribe.js +28 -16
- package/2x/cjs/components/form/form.d.ts +5 -1
- package/2x/cjs/components/form/index.d.ts +6 -2
- package/2x/cjs/components/index-bar/index-bar.d.ts +5 -1
- package/2x/cjs/components/index-bar/index.d.ts +5 -1
- package/2x/cjs/components/infinite-scroll/infinite-scroll.js +13 -4
- package/2x/cjs/components/input/input.d.ts +5 -1
- package/2x/cjs/components/list/list.css +3 -0
- package/2x/cjs/components/list/list.d.ts +1 -1
- package/2x/cjs/components/passcode-input/passcode-input.d.ts +5 -1
- package/2x/cjs/components/picker/index.d.ts +10 -2
- package/2x/cjs/components/picker/picker.d.ts +5 -1
- package/2x/cjs/components/popover/index.d.ts +5 -1
- package/2x/cjs/components/popover/popover.d.ts +5 -1
- package/2x/cjs/components/radio/radio.js +3 -3
- package/2x/cjs/components/rate/rate.css +2 -2
- package/2x/cjs/components/rate/rate.js +3 -3
- package/2x/cjs/components/rate/star.d.ts +2 -0
- package/2x/cjs/components/rate/star.js +37 -0
- package/2x/cjs/components/safe-area/safe-area.css +3 -2
- package/2x/cjs/components/search-bar/search-bar.d.ts +5 -1
- package/2x/cjs/components/swipe-action/swipe-action.d.ts +5 -1
- package/2x/cjs/components/swiper/index.d.ts +10 -2
- package/2x/cjs/components/swiper/swiper.d.ts +5 -1
- package/2x/cjs/components/switch/switch.js +10 -1
- package/2x/cjs/components/text-area/text-area.d.ts +6 -1
- package/2x/cjs/components/text-area/text-area.js +5 -0
- package/2x/cjs/components/toast/methods.js +32 -73
- package/2x/cjs/components/toast/toast.js +6 -2
- package/2x/cjs/components/virtual-input/virtual-input.d.ts +5 -1
- package/2x/cjs/components/water-mark/water-mark.js +3 -2
- package/2x/cjs/global/global.css +0 -1
- package/2x/cjs/global/theme-default.css +0 -1
- package/2x/cjs/locales/base.d.ts +3 -0
- package/2x/cjs/locales/base.js +3 -0
- package/2x/cjs/locales/en-US.d.ts +3 -0
- package/2x/cjs/locales/es-ES.d.ts +3 -0
- package/2x/cjs/locales/fa-IR.d.ts +3 -0
- package/2x/cjs/locales/fr-FR.d.ts +3 -0
- package/2x/cjs/locales/ko-KR.d.ts +3 -0
- package/2x/cjs/locales/zh-CN.d.ts +3 -0
- package/2x/cjs/locales/zh-CN.js +3 -0
- package/2x/cjs/locales/zh-HK.d.ts +3 -0
- package/2x/cjs/locales/zh-TW.d.ts +3 -0
- package/2x/cjs/utils/native-props.d.ts +3 -3
- package/2x/cjs/utils/render-imperatively.d.ts +4 -1
- package/2x/cjs/utils/render-imperatively.js +23 -11
- package/2x/cjs/utils/use-props-value.js +2 -6
- package/2x/es/components/badge/badge.css +1 -1
- package/2x/es/components/badge/badge.d.ts +2 -0
- package/2x/es/components/badge/badge.js +2 -1
- package/2x/es/components/button/button.d.ts +5 -1
- package/2x/es/components/center-popup/center-popup.d.ts +1 -0
- package/2x/es/components/center-popup/center-popup.js +3 -1
- package/2x/es/components/checkbox/checkbox.d.ts +22 -2
- package/2x/es/components/checkbox/checkbox.js +15 -3
- package/2x/es/components/checkbox/index.d.ts +17 -2
- package/2x/es/components/checkbox/native-input.js +9 -8
- package/2x/es/components/date-picker/date-picker-date-utils.js +12 -15
- package/2x/es/components/date-picker/date-picker-week-utils.js +12 -15
- package/2x/es/components/date-picker/date-picker.d.ts +5 -1
- package/2x/es/components/date-picker/index.d.ts +5 -1
- package/2x/es/components/dialog/dialog.js +3 -1
- package/2x/es/components/dropdown/dropdown.d.ts +5 -1
- package/2x/es/components/dropdown/index.d.ts +5 -1
- package/2x/es/components/floating-panel/floating-panel.d.ts +5 -1
- package/2x/es/components/form/form-item.js +2 -2
- package/2x/es/components/form/form-subscribe.d.ts +7 -2
- package/2x/es/components/form/form-subscribe.js +21 -14
- package/2x/es/components/form/form.d.ts +5 -1
- package/2x/es/components/form/index.d.ts +6 -2
- package/2x/es/components/index-bar/index-bar.d.ts +5 -1
- package/2x/es/components/index-bar/index.d.ts +5 -1
- package/2x/es/components/infinite-scroll/infinite-scroll.js +14 -5
- package/2x/es/components/input/input.d.ts +5 -1
- package/2x/es/components/list/list.css +3 -0
- package/2x/es/components/list/list.d.ts +1 -1
- package/2x/es/components/passcode-input/passcode-input.d.ts +5 -1
- package/2x/es/components/picker/index.d.ts +10 -2
- package/2x/es/components/picker/picker.d.ts +5 -1
- package/2x/es/components/popover/index.d.ts +5 -1
- package/2x/es/components/popover/popover.d.ts +5 -1
- package/2x/es/components/radio/radio.js +3 -3
- package/2x/es/components/rate/rate.css +2 -2
- package/2x/es/components/rate/rate.js +2 -2
- package/2x/es/components/rate/star.d.ts +2 -0
- package/2x/es/components/rate/star.js +25 -0
- package/2x/es/components/safe-area/safe-area.css +3 -2
- package/2x/es/components/search-bar/search-bar.d.ts +5 -1
- package/2x/es/components/swipe-action/swipe-action.d.ts +5 -1
- package/2x/es/components/swiper/index.d.ts +10 -2
- package/2x/es/components/swiper/swiper.d.ts +5 -1
- package/2x/es/components/switch/switch.js +9 -1
- package/2x/es/components/text-area/text-area.d.ts +6 -1
- package/2x/es/components/text-area/text-area.js +5 -0
- package/2x/es/components/toast/methods.js +29 -67
- package/2x/es/components/toast/toast.js +6 -2
- package/2x/es/components/virtual-input/virtual-input.d.ts +5 -1
- package/2x/es/components/water-mark/water-mark.js +3 -2
- package/2x/es/global/global.css +0 -1
- package/2x/es/global/theme-default.css +0 -1
- package/2x/es/locales/base.d.ts +3 -0
- package/2x/es/locales/base.js +3 -0
- package/2x/es/locales/en-US.d.ts +3 -0
- package/2x/es/locales/es-ES.d.ts +3 -0
- package/2x/es/locales/fa-IR.d.ts +3 -0
- package/2x/es/locales/fr-FR.d.ts +3 -0
- package/2x/es/locales/ko-KR.d.ts +3 -0
- package/2x/es/locales/zh-CN.d.ts +3 -0
- package/2x/es/locales/zh-CN.js +3 -0
- package/2x/es/locales/zh-HK.d.ts +3 -0
- package/2x/es/locales/zh-TW.d.ts +3 -0
- package/2x/es/utils/native-props.d.ts +3 -3
- package/2x/es/utils/render-imperatively.d.ts +4 -1
- package/2x/es/utils/render-imperatively.js +23 -11
- package/2x/es/utils/use-props-value.js +2 -6
- package/2x/package.json +3 -3
- package/2x/umd/antd-mobile.js +1 -1
- package/README.md +1 -2
- package/bundle/antd-mobile.cjs.js +201 -162
- package/bundle/antd-mobile.es.js +196 -157
- package/bundle/style.css +9 -6
- package/cjs/components/badge/badge.css +1 -1
- package/cjs/components/badge/badge.d.ts +2 -0
- package/cjs/components/badge/badge.js +2 -1
- package/cjs/components/button/button.d.ts +5 -1
- package/cjs/components/center-popup/center-popup.d.ts +1 -0
- package/cjs/components/center-popup/center-popup.js +3 -1
- package/cjs/components/checkbox/checkbox.d.ts +22 -2
- package/cjs/components/checkbox/checkbox.js +14 -4
- package/cjs/components/checkbox/index.d.ts +17 -2
- package/cjs/components/checkbox/native-input.js +10 -8
- package/cjs/components/date-picker/date-picker-date-utils.js +12 -15
- package/cjs/components/date-picker/date-picker-week-utils.js +12 -15
- package/cjs/components/date-picker/date-picker.d.ts +5 -1
- package/cjs/components/date-picker/index.d.ts +5 -1
- package/cjs/components/dialog/dialog.js +3 -1
- package/cjs/components/dropdown/dropdown.d.ts +5 -1
- package/cjs/components/dropdown/index.d.ts +5 -1
- package/cjs/components/floating-panel/floating-panel.d.ts +5 -1
- package/cjs/components/form/form-item.js +2 -4
- package/cjs/components/form/form-subscribe.d.ts +7 -2
- package/cjs/components/form/form-subscribe.js +28 -16
- package/cjs/components/form/form.d.ts +5 -1
- package/cjs/components/form/index.d.ts +6 -2
- package/cjs/components/index-bar/index-bar.d.ts +5 -1
- package/cjs/components/index-bar/index.d.ts +5 -1
- package/cjs/components/infinite-scroll/infinite-scroll.js +13 -4
- package/cjs/components/input/input.d.ts +5 -1
- package/cjs/components/list/list.css +3 -0
- package/cjs/components/list/list.d.ts +1 -1
- package/cjs/components/passcode-input/passcode-input.d.ts +5 -1
- package/cjs/components/picker/index.d.ts +10 -2
- package/cjs/components/picker/picker.d.ts +5 -1
- package/cjs/components/popover/index.d.ts +5 -1
- package/cjs/components/popover/popover.d.ts +5 -1
- package/cjs/components/radio/radio.js +3 -3
- package/cjs/components/rate/rate.css +2 -2
- package/cjs/components/rate/rate.js +3 -3
- package/cjs/components/rate/star.d.ts +2 -0
- package/cjs/components/rate/star.js +37 -0
- package/cjs/components/safe-area/safe-area.css +3 -2
- package/cjs/components/search-bar/search-bar.d.ts +5 -1
- package/cjs/components/swipe-action/swipe-action.d.ts +5 -1
- package/cjs/components/swiper/index.d.ts +10 -2
- package/cjs/components/swiper/swiper.d.ts +5 -1
- package/cjs/components/switch/switch.js +10 -1
- package/cjs/components/text-area/text-area.d.ts +6 -1
- package/cjs/components/text-area/text-area.js +5 -0
- package/cjs/components/toast/methods.js +32 -73
- package/cjs/components/toast/toast.js +6 -2
- package/cjs/components/virtual-input/virtual-input.d.ts +5 -1
- package/cjs/components/water-mark/water-mark.js +3 -2
- package/cjs/global/global.css +0 -1
- package/cjs/global/theme-default.css +0 -1
- package/cjs/locales/base.d.ts +3 -0
- package/cjs/locales/base.js +3 -0
- package/cjs/locales/en-US.d.ts +3 -0
- package/cjs/locales/es-ES.d.ts +3 -0
- package/cjs/locales/fa-IR.d.ts +3 -0
- package/cjs/locales/fr-FR.d.ts +3 -0
- package/cjs/locales/ko-KR.d.ts +3 -0
- package/cjs/locales/zh-CN.d.ts +3 -0
- package/cjs/locales/zh-CN.js +3 -0
- package/cjs/locales/zh-HK.d.ts +3 -0
- package/cjs/locales/zh-TW.d.ts +3 -0
- package/cjs/utils/native-props.d.ts +3 -3
- package/cjs/utils/render-imperatively.d.ts +4 -1
- package/cjs/utils/render-imperatively.js +23 -11
- package/cjs/utils/use-props-value.js +2 -6
- package/es/components/badge/badge.css +1 -1
- package/es/components/badge/badge.d.ts +2 -0
- package/es/components/badge/badge.js +2 -1
- package/es/components/button/button.d.ts +5 -1
- package/es/components/center-popup/center-popup.d.ts +1 -0
- package/es/components/center-popup/center-popup.js +3 -1
- package/es/components/checkbox/checkbox.d.ts +22 -2
- package/es/components/checkbox/checkbox.js +15 -3
- package/es/components/checkbox/index.d.ts +17 -2
- package/es/components/checkbox/native-input.js +9 -8
- package/es/components/date-picker/date-picker-date-utils.js +12 -15
- package/es/components/date-picker/date-picker-week-utils.js +12 -15
- package/es/components/date-picker/date-picker.d.ts +5 -1
- package/es/components/date-picker/index.d.ts +5 -1
- package/es/components/dialog/dialog.js +3 -1
- package/es/components/dropdown/dropdown.d.ts +5 -1
- package/es/components/dropdown/index.d.ts +5 -1
- package/es/components/floating-panel/floating-panel.d.ts +5 -1
- package/es/components/form/form-item.js +2 -2
- package/es/components/form/form-subscribe.d.ts +7 -2
- package/es/components/form/form-subscribe.js +21 -14
- package/es/components/form/form.d.ts +5 -1
- package/es/components/form/index.d.ts +6 -2
- package/es/components/index-bar/index-bar.d.ts +5 -1
- package/es/components/index-bar/index.d.ts +5 -1
- package/es/components/infinite-scroll/infinite-scroll.js +14 -5
- package/es/components/input/input.d.ts +5 -1
- package/es/components/list/list.css +3 -0
- package/es/components/list/list.d.ts +1 -1
- package/es/components/passcode-input/passcode-input.d.ts +5 -1
- package/es/components/picker/index.d.ts +10 -2
- package/es/components/picker/picker.d.ts +5 -1
- package/es/components/popover/index.d.ts +5 -1
- package/es/components/popover/popover.d.ts +5 -1
- package/es/components/radio/radio.js +3 -3
- package/es/components/rate/rate.css +2 -2
- package/es/components/rate/rate.js +2 -2
- package/es/components/rate/star.d.ts +2 -0
- package/es/components/rate/star.js +25 -0
- package/es/components/safe-area/safe-area.css +3 -2
- package/es/components/search-bar/search-bar.d.ts +5 -1
- package/es/components/swipe-action/swipe-action.d.ts +5 -1
- package/es/components/swiper/index.d.ts +10 -2
- package/es/components/swiper/swiper.d.ts +5 -1
- package/es/components/switch/switch.js +9 -1
- package/es/components/text-area/text-area.d.ts +6 -1
- package/es/components/text-area/text-area.js +5 -0
- package/es/components/toast/methods.js +29 -67
- package/es/components/toast/toast.js +6 -2
- package/es/components/virtual-input/virtual-input.d.ts +5 -1
- package/es/components/water-mark/water-mark.js +3 -2
- package/es/global/global.css +0 -1
- package/es/global/theme-default.css +0 -1
- package/es/locales/base.d.ts +3 -0
- package/es/locales/base.js +3 -0
- package/es/locales/en-US.d.ts +3 -0
- package/es/locales/es-ES.d.ts +3 -0
- package/es/locales/fa-IR.d.ts +3 -0
- package/es/locales/fr-FR.d.ts +3 -0
- package/es/locales/ko-KR.d.ts +3 -0
- package/es/locales/zh-CN.d.ts +3 -0
- package/es/locales/zh-CN.js +3 -0
- package/es/locales/zh-HK.d.ts +3 -0
- package/es/locales/zh-TW.d.ts +3 -0
- package/es/utils/native-props.d.ts +3 -3
- package/es/utils/render-imperatively.d.ts +4 -1
- package/es/utils/render-imperatively.js +23 -11
- package/es/utils/use-props-value.js +2 -6
- package/package.json +3 -3
- package/umd/antd-mobile.js +1 -1
- package/2x/cjs/components/form/form-imperative-item.d.ts +0 -5
- package/2x/cjs/components/form/form-imperative-item.js +0 -57
- package/2x/es/components/form/form-imperative-item.d.ts +0 -5
- package/2x/es/components/form/form-imperative-item.js +0 -38
- package/cjs/components/form/form-imperative-item.d.ts +0 -5
- package/cjs/components/form/form-imperative-item.js +0 -57
- package/es/components/form/form-imperative-item.d.ts +0 -5
- package/es/components/form/form-imperative-item.js +0 -38
package/2x/bundle/style.css
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
--adm-font-size-8: 32px;
|
|
13
13
|
--adm-font-size-9: 34px;
|
|
14
14
|
--adm-font-size-10: 36px;
|
|
15
|
-
--adm-hd: 2;
|
|
16
15
|
--adm-color-primary: #1677ff;
|
|
17
16
|
--adm-color-success: #00b578;
|
|
18
17
|
--adm-color-warning: #ff8f1f;
|
|
@@ -221,16 +220,17 @@ div.adm-px-tester {
|
|
|
221
220
|
}
|
|
222
221
|
|
|
223
222
|
.adm-safe-area {
|
|
223
|
+
--multiple: var(--adm-safe-area-multiple, 1);
|
|
224
224
|
display: block;
|
|
225
225
|
width: 100%;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
.adm-safe-area-position-top {
|
|
229
|
-
padding-top: calc(env(safe-area-inset-top) * var(--
|
|
229
|
+
padding-top: calc(env(safe-area-inset-top) * var(--multiple));
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
.adm-safe-area-position-bottom {
|
|
233
|
-
padding-bottom: calc(env(safe-area-inset-bottom) * var(--
|
|
233
|
+
padding-bottom: calc(env(safe-area-inset-bottom) * var(--multiple));
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
.adm-auto-center {
|
|
@@ -259,7 +259,7 @@ div.adm-px-tester {
|
|
|
259
259
|
display: block;
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
.adm-badge-
|
|
262
|
+
.adm-badge-wrapper {
|
|
263
263
|
display: inline-block;
|
|
264
264
|
position: relative;
|
|
265
265
|
}
|
|
@@ -1036,6 +1036,7 @@ div.adm-px-tester {
|
|
|
1036
1036
|
--padding-left: 24px;
|
|
1037
1037
|
--padding-right: 24px;
|
|
1038
1038
|
--font-size: var(--adm-font-size-9);
|
|
1039
|
+
--extra-max-width: 70%;
|
|
1039
1040
|
}
|
|
1040
1041
|
|
|
1041
1042
|
.adm-list-header {
|
|
@@ -1105,9 +1106,11 @@ div.adm-px-tester {
|
|
|
1105
1106
|
}
|
|
1106
1107
|
|
|
1107
1108
|
.adm-list-item-content-extra {
|
|
1109
|
+
flex: none;
|
|
1108
1110
|
padding-left: 24px;
|
|
1109
1111
|
font-size: var(--adm-font-size-7);
|
|
1110
1112
|
color: var(--adm-color-weak);
|
|
1113
|
+
max-width: var(--extra-max-width);
|
|
1111
1114
|
}
|
|
1112
1115
|
|
|
1113
1116
|
.adm-list-item-content-arrow {
|
|
@@ -3405,7 +3408,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled)::after {
|
|
|
3405
3408
|
.adm-rate {
|
|
3406
3409
|
--star-size: 48px;
|
|
3407
3410
|
--active-color: #ffd21e;
|
|
3408
|
-
--inactive-color: var(--adm-color-
|
|
3411
|
+
--inactive-color: var(--adm-color-border);
|
|
3409
3412
|
display: inline-flex;
|
|
3410
3413
|
}
|
|
3411
3414
|
|
|
@@ -3414,7 +3417,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled)::after {
|
|
|
3414
3417
|
}
|
|
3415
3418
|
|
|
3416
3419
|
.adm-rate-star {
|
|
3417
|
-
padding:
|
|
3420
|
+
padding: 0.125em;
|
|
3418
3421
|
line-height: var(--star-size);
|
|
3419
3422
|
font-size: var(--star-size);
|
|
3420
3423
|
color: var(--inactive-color);
|
|
@@ -6,5 +6,7 @@ export declare type BadgeProps = {
|
|
|
6
6
|
color?: string;
|
|
7
7
|
bordered?: boolean;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
|
+
wrapperClassName?: string;
|
|
10
|
+
wrapperStyle?: React.CSSProperties;
|
|
9
11
|
} & NativeProps<'--right' | '--top' | '--color'>;
|
|
10
12
|
export declare const Badge: FC<BadgeProps>;
|
|
@@ -36,7 +36,8 @@ const Badge = props => {
|
|
|
36
36
|
className: `${classPrefix}-content`
|
|
37
37
|
}, content))) : null;
|
|
38
38
|
return children ? _react.default.createElement("div", {
|
|
39
|
-
className: `${classPrefix}-
|
|
39
|
+
className: (0, _classnames.default)(`${classPrefix}-wrapper`, props.wrapperClassName),
|
|
40
|
+
style: props.wrapperStyle
|
|
40
41
|
}, children, element) : element;
|
|
41
42
|
};
|
|
42
43
|
|
|
@@ -31,5 +31,9 @@ export declare const Button: React.ForwardRefExoticComponent<{
|
|
|
31
31
|
type?: "reset" | "submit" | "button" | undefined;
|
|
32
32
|
shape?: "default" | "rounded" | "rectangular" | undefined;
|
|
33
33
|
children?: React.ReactNode;
|
|
34
|
-
} & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> &
|
|
34
|
+
} & Pick<NativeButtonProps, "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & {
|
|
35
|
+
className?: string | undefined;
|
|
36
|
+
style?: (React.CSSProperties & Partial<Record<"--border-radius" | "--text-color" | "--background-color" | "--border-width" | "--border-style" | "--border-color", string>>) | undefined;
|
|
37
|
+
tabIndex?: number | undefined;
|
|
38
|
+
} & React.AriaAttributes & React.RefAttributes<ButtonRef>>;
|
|
35
39
|
export {};
|
|
@@ -19,5 +19,6 @@ export declare type CenterPopupProps = PropsWithChildren<{
|
|
|
19
19
|
onMaskClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
20
20
|
stopPropagation?: PropagationEvent[];
|
|
21
21
|
visible?: boolean;
|
|
22
|
+
role?: string;
|
|
22
23
|
}> & NativeProps<'--background-color' | '--border-radius' | '--max-width' | '--min-width' | '--z-index'>;
|
|
23
24
|
export declare const CenterPopup: FC<CenterPopupProps>;
|
|
@@ -101,7 +101,9 @@ const CenterPopup = p => {
|
|
|
101
101
|
className: (0, _classnames.default)('adm-center-popup-mask', props.maskClassName),
|
|
102
102
|
disableBodyScroll: false
|
|
103
103
|
}), _react.default.createElement("div", {
|
|
104
|
-
className: 'adm-center-popup-wrap'
|
|
104
|
+
className: 'adm-center-popup-wrap',
|
|
105
|
+
role: props.role,
|
|
106
|
+
"aria-label": props['aria-label']
|
|
105
107
|
}, _react.default.createElement(_web.animated.div, {
|
|
106
108
|
style: style,
|
|
107
109
|
ref: ref
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type CheckboxValue = string | number;
|
|
4
4
|
export declare type CheckboxProps = {
|
|
@@ -13,4 +13,24 @@ export declare type CheckboxProps = {
|
|
|
13
13
|
icon?: (checked: boolean, indeterminate: boolean) => React.ReactNode;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
15
|
} & NativeProps<'--icon-size' | '--font-size' | '--gap'>;
|
|
16
|
-
export declare
|
|
16
|
+
export declare type CheckboxRef = {
|
|
17
|
+
check: () => void;
|
|
18
|
+
uncheck: () => void;
|
|
19
|
+
toggle: () => void;
|
|
20
|
+
};
|
|
21
|
+
export declare const Checkbox: React.ForwardRefExoticComponent<{
|
|
22
|
+
checked?: boolean | undefined;
|
|
23
|
+
defaultChecked?: boolean | undefined;
|
|
24
|
+
disabled?: boolean | undefined;
|
|
25
|
+
onChange?: ((checked: boolean) => void) | undefined;
|
|
26
|
+
value?: CheckboxValue | undefined;
|
|
27
|
+
indeterminate?: boolean | undefined;
|
|
28
|
+
block?: boolean | undefined;
|
|
29
|
+
id?: string | undefined;
|
|
30
|
+
icon?: ((checked: boolean, indeterminate: boolean) => React.ReactNode) | undefined;
|
|
31
|
+
children?: React.ReactNode;
|
|
32
|
+
} & {
|
|
33
|
+
className?: string | undefined;
|
|
34
|
+
style?: (React.CSSProperties & Partial<Record<"--font-size" | "--icon-size" | "--gap", string>>) | undefined;
|
|
35
|
+
tabIndex?: number | undefined;
|
|
36
|
+
} & React.AriaAttributes & React.RefAttributes<CheckboxRef>>;
|
|
@@ -38,8 +38,7 @@ const defaultProps = {
|
|
|
38
38
|
defaultChecked: false,
|
|
39
39
|
indeterminate: false
|
|
40
40
|
};
|
|
41
|
-
|
|
42
|
-
const Checkbox = p => {
|
|
41
|
+
const Checkbox = (0, _react.forwardRef)((p, ref) => {
|
|
43
42
|
const groupContext = (0, _react.useContext)(_groupContext.CheckboxGroupContext);
|
|
44
43
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
45
44
|
let [checked, setChecked] = (0, _usePropsValue.usePropsValue)({
|
|
@@ -80,6 +79,18 @@ const Checkbox = p => {
|
|
|
80
79
|
disabled = disabled || groupContext.disabled;
|
|
81
80
|
}
|
|
82
81
|
|
|
82
|
+
(0, _react.useImperativeHandle)(ref, () => ({
|
|
83
|
+
check: () => {
|
|
84
|
+
setChecked(true);
|
|
85
|
+
},
|
|
86
|
+
uncheck: () => {
|
|
87
|
+
setChecked(false);
|
|
88
|
+
},
|
|
89
|
+
toggle: () => {
|
|
90
|
+
setChecked(!checked);
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
|
|
83
94
|
const renderIcon = () => {
|
|
84
95
|
if (props.icon) {
|
|
85
96
|
return _react.default.createElement("div", {
|
|
@@ -108,6 +119,5 @@ const Checkbox = p => {
|
|
|
108
119
|
}), renderIcon(), props.children && _react.default.createElement("div", {
|
|
109
120
|
className: `${classPrefix}-content`
|
|
110
121
|
}, props.children)));
|
|
111
|
-
};
|
|
112
|
-
|
|
122
|
+
});
|
|
113
123
|
exports.Checkbox = Checkbox;
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './checkbox.less';
|
|
3
|
-
export type { CheckboxValue, CheckboxProps } from './checkbox';
|
|
3
|
+
export type { CheckboxValue, CheckboxProps, CheckboxRef } from './checkbox';
|
|
4
4
|
export type { CheckboxGroupProps } from './group';
|
|
5
|
-
declare const _default: import("react").
|
|
5
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
6
|
+
checked?: boolean | undefined;
|
|
7
|
+
defaultChecked?: boolean | undefined;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
onChange?: ((checked: boolean) => void) | undefined;
|
|
10
|
+
value?: import("./checkbox").CheckboxValue | undefined;
|
|
11
|
+
indeterminate?: boolean | undefined;
|
|
12
|
+
block?: boolean | undefined;
|
|
13
|
+
id?: string | undefined;
|
|
14
|
+
icon?: ((checked: boolean, indeterminate: boolean) => import("react").ReactNode) | undefined;
|
|
15
|
+
children?: import("react").ReactNode;
|
|
16
|
+
} & {
|
|
17
|
+
className?: string | undefined;
|
|
18
|
+
style?: (import("react").CSSProperties & Partial<Record<"--font-size" | "--icon-size" | "--gap", string>>) | undefined;
|
|
19
|
+
tabIndex?: number | undefined;
|
|
20
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./checkbox").CheckboxRef>> & {
|
|
6
21
|
Group: import("react").FC<import("./group").CheckboxGroupProps>;
|
|
7
22
|
};
|
|
8
23
|
export default _default;
|
|
@@ -7,23 +7,25 @@ exports.NativeInput = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
+
var _ahooks = require("ahooks");
|
|
11
|
+
|
|
10
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
13
|
|
|
12
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
15
|
|
|
14
16
|
const NativeInput = props => {
|
|
15
17
|
const inputRef = (0, _react.useRef)(null);
|
|
18
|
+
const handleClick = (0, _ahooks.useMemoizedFn)(e => {
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
e.stopImmediatePropagation();
|
|
21
|
+
const latestChecked = e.target.checked;
|
|
22
|
+
if (latestChecked === props.checked) return;
|
|
23
|
+
props.onChange(latestChecked);
|
|
24
|
+
});
|
|
16
25
|
(0, _react.useEffect)(() => {
|
|
17
26
|
if (props.disabled) return;
|
|
18
27
|
if (!inputRef.current) return;
|
|
19
28
|
const input = inputRef.current;
|
|
20
|
-
|
|
21
|
-
function handleClick(e) {
|
|
22
|
-
e.stopPropagation();
|
|
23
|
-
e.stopImmediatePropagation();
|
|
24
|
-
props.onChange(input.checked);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
29
|
input.addEventListener('click', handleClick);
|
|
28
30
|
return () => {
|
|
29
31
|
input.removeEventListener('click', handleClick);
|
|
@@ -31,7 +33,7 @@ const NativeInput = props => {
|
|
|
31
33
|
}, [props.disabled, props.onChange]);
|
|
32
34
|
return _react.default.createElement("input", {
|
|
33
35
|
ref: inputRef,
|
|
34
|
-
type:
|
|
36
|
+
type: props.type,
|
|
35
37
|
checked: props.checked,
|
|
36
38
|
onChange: () => {},
|
|
37
39
|
disabled: props.disabled,
|
|
@@ -60,21 +60,6 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
|
|
|
60
60
|
const maxMinute = max.getMinutes();
|
|
61
61
|
const maxSecond = max.getSeconds();
|
|
62
62
|
const rank = precisionRankRecord[precision];
|
|
63
|
-
|
|
64
|
-
if (rank >= precisionRankRecord.year) {
|
|
65
|
-
const years = [];
|
|
66
|
-
|
|
67
|
-
for (let i = minYear; i <= maxYear; i++) {
|
|
68
|
-
const value = i.toString();
|
|
69
|
-
years.push({
|
|
70
|
-
label: renderLabel ? renderLabel('year', i) : value,
|
|
71
|
-
value
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
ret.push(years);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
63
|
const selectedYear = parseInt(selected[0]);
|
|
79
64
|
const firstDayInSelectedMonth = (0, _dayjs.default)(convertStringArrayToDate([selected[0], selected[1], '1']));
|
|
80
65
|
const selectedMonth = parseInt(selected[1]);
|
|
@@ -115,6 +100,18 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
|
|
|
115
100
|
return column;
|
|
116
101
|
};
|
|
117
102
|
|
|
103
|
+
if (rank >= precisionRankRecord.year) {
|
|
104
|
+
const lower = minYear;
|
|
105
|
+
const upper = maxYear;
|
|
106
|
+
const years = generateColumn(lower, upper, 'year');
|
|
107
|
+
ret.push(years.map(v => {
|
|
108
|
+
return {
|
|
109
|
+
label: renderLabel('year', v),
|
|
110
|
+
value: v.toString()
|
|
111
|
+
};
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
|
|
118
115
|
if (rank >= precisionRankRecord.month) {
|
|
119
116
|
const lower = isInMinYear ? minMonth : 1;
|
|
120
117
|
const upper = isInMaxYear ? maxMonth : 12;
|
|
@@ -39,21 +39,6 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
|
|
|
39
39
|
const minYear = min.getFullYear();
|
|
40
40
|
const maxYear = max.getFullYear();
|
|
41
41
|
const rank = precisionRankRecord[precision];
|
|
42
|
-
|
|
43
|
-
if (rank >= precisionRankRecord.year) {
|
|
44
|
-
const years = [];
|
|
45
|
-
|
|
46
|
-
for (let i = minYear; i <= maxYear; i++) {
|
|
47
|
-
const value = i.toString();
|
|
48
|
-
years.push({
|
|
49
|
-
label: renderLabel ? renderLabel('year', i) : value,
|
|
50
|
-
value
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
ret.push(years);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
42
|
const selectedYear = parseInt(selected[0]);
|
|
58
43
|
const isInMinYear = selectedYear === minYear;
|
|
59
44
|
const isInMaxYear = selectedYear === maxYear;
|
|
@@ -91,6 +76,18 @@ function generateDatePickerColumns(selected, min, max, precision, renderLabel, f
|
|
|
91
76
|
return column;
|
|
92
77
|
};
|
|
93
78
|
|
|
79
|
+
if (rank >= precisionRankRecord.year) {
|
|
80
|
+
const lower = minYear;
|
|
81
|
+
const upper = maxYear;
|
|
82
|
+
const years = generateColumn(lower, upper, 'year');
|
|
83
|
+
ret.push(years.map(v => {
|
|
84
|
+
return {
|
|
85
|
+
label: renderLabel('year', v),
|
|
86
|
+
value: v.toString()
|
|
87
|
+
};
|
|
88
|
+
}));
|
|
89
|
+
}
|
|
90
|
+
|
|
94
91
|
if (rank >= precisionRankRecord.week) {
|
|
95
92
|
const lower = isInMinYear ? minWeek : 1;
|
|
96
93
|
const upper = isInMaxYear ? maxWeek : selectedYearWeeks;
|
|
@@ -28,4 +28,8 @@ export declare const DatePicker: React.ForwardRefExoticComponent<Pick<PickerProp
|
|
|
28
28
|
filter?: Partial<Record<Precision, (val: number, extend: {
|
|
29
29
|
date: Date;
|
|
30
30
|
}) => boolean>> | undefined;
|
|
31
|
-
} &
|
|
31
|
+
} & {
|
|
32
|
+
className?: string | undefined;
|
|
33
|
+
style?: (React.CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
34
|
+
tabIndex?: number | undefined;
|
|
35
|
+
} & React.AriaAttributes & React.RefAttributes<PickerActions>>;
|
|
@@ -16,7 +16,11 @@ declare const _default: import("react").ForwardRefExoticComponent<Pick<import(".
|
|
|
16
16
|
filter?: Partial<Record<import("./date-picker-utils").Precision, (val: number, extend: {
|
|
17
17
|
date: Date;
|
|
18
18
|
}) => boolean>> | undefined;
|
|
19
|
-
} &
|
|
19
|
+
} & {
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
22
|
+
tabIndex?: number | undefined;
|
|
23
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("../picker").PickerActions>> & {
|
|
20
24
|
prompt: typeof prompt;
|
|
21
25
|
};
|
|
22
26
|
export default _default;
|
|
@@ -85,7 +85,9 @@ const Dialog = p => {
|
|
|
85
85
|
stopPropagation: props.stopPropagation,
|
|
86
86
|
disableBodyScroll: props.disableBodyScroll,
|
|
87
87
|
destroyOnClose: props.destroyOnClose,
|
|
88
|
-
forceRender: props.forceRender
|
|
88
|
+
forceRender: props.forceRender,
|
|
89
|
+
role: 'dialog',
|
|
90
|
+
"aria-label": props['aria-label']
|
|
89
91
|
}, element);
|
|
90
92
|
};
|
|
91
93
|
|
|
@@ -18,7 +18,11 @@ declare const Dropdown: React.ForwardRefExoticComponent<{
|
|
|
18
18
|
closeOnClickAway?: boolean | undefined;
|
|
19
19
|
onChange?: ((key: string | null) => void) | undefined;
|
|
20
20
|
arrow?: React.ReactNode;
|
|
21
|
-
} &
|
|
21
|
+
} & {
|
|
22
|
+
className?: string | undefined;
|
|
23
|
+
style?: (React.CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
24
|
+
tabIndex?: number | undefined;
|
|
25
|
+
} & React.AriaAttributes & {
|
|
22
26
|
children?: React.ReactNode;
|
|
23
27
|
} & React.RefAttributes<DropdownRef>>;
|
|
24
28
|
export default Dropdown;
|
|
@@ -9,7 +9,11 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
9
9
|
closeOnClickAway?: boolean | undefined;
|
|
10
10
|
onChange?: ((key: string | null) => void) | undefined;
|
|
11
11
|
arrow?: import("react").ReactNode;
|
|
12
|
-
} &
|
|
12
|
+
} & {
|
|
13
|
+
className?: string | undefined;
|
|
14
|
+
style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
15
|
+
tabIndex?: number | undefined;
|
|
16
|
+
} & import("react").AriaAttributes & {
|
|
13
17
|
children?: import("react").ReactNode;
|
|
14
18
|
} & import("react").RefAttributes<import("./dropdown").DropdownRef>> & {
|
|
15
19
|
Item: import("react").FC<import("./item").DropdownItemProps>;
|
|
@@ -16,4 +16,8 @@ export declare const FloatingPanel: React.ForwardRefExoticComponent<{
|
|
|
16
16
|
children: ReactNode;
|
|
17
17
|
onHeightChange?: ((height: number, animating: boolean) => void) | undefined;
|
|
18
18
|
handleDraggingOfContent?: boolean | undefined;
|
|
19
|
-
} &
|
|
19
|
+
} & {
|
|
20
|
+
className?: string | undefined;
|
|
21
|
+
style?: (React.CSSProperties & Partial<Record<"--z-index" | "--border-radius" | "--header-height", string>>) | undefined;
|
|
22
|
+
tabIndex?: number | undefined;
|
|
23
|
+
} & React.AriaAttributes & React.RefAttributes<FloatingPanelRef>>;
|
|
@@ -107,15 +107,13 @@ const FormItemLayout = props => {
|
|
|
107
107
|
e.preventDefault();
|
|
108
108
|
}
|
|
109
109
|
}, _react.default.createElement(_antdMobileIcons.QuestionCircleOutline, null)))) : null;
|
|
110
|
-
|
|
111
|
-
const description = _react.default.createElement(_react.default.Fragment, null, props.description, hasFeedback && _react.default.createElement(_react.default.Fragment, null, props.errors.map((error, index) => _react.default.createElement("div", {
|
|
110
|
+
const description = props.description || hasFeedback ? _react.default.createElement(_react.default.Fragment, null, props.description, hasFeedback && _react.default.createElement(_react.default.Fragment, null, props.errors.map((error, index) => _react.default.createElement("div", {
|
|
112
111
|
key: `error-${index}`,
|
|
113
112
|
className: `${classPrefix}-feedback-error`
|
|
114
113
|
}, error)), props.warnings.map((warning, index) => _react.default.createElement("div", {
|
|
115
114
|
key: `warning-${index}`,
|
|
116
115
|
className: `${classPrefix}-feedback-warning`
|
|
117
|
-
}, warning))));
|
|
118
|
-
|
|
116
|
+
}, warning)))) : null;
|
|
119
117
|
return _react.default.createElement(_list.default.Item, {
|
|
120
118
|
style: style,
|
|
121
119
|
title: layout === 'vertical' && labelElement,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
2
|
import type { FormInstance } from 'rc-field-form';
|
|
3
3
|
import type { NamePath } from 'rc-field-form/es/interface';
|
|
4
4
|
declare type RenderChildren<Values = any> = (changedValues: Record<string, any>, form: FormInstance<Values>) => React.ReactNode;
|
|
@@ -7,5 +7,10 @@ export interface FormSubscribeProps {
|
|
|
7
7
|
to: NamePath[];
|
|
8
8
|
children: ChildrenType;
|
|
9
9
|
}
|
|
10
|
-
export declare const FormSubscribe:
|
|
10
|
+
export declare const FormSubscribe: FC<FormSubscribeProps>;
|
|
11
|
+
export declare const Watcher: React.NamedExoticComponent<{
|
|
12
|
+
form: FormInstance;
|
|
13
|
+
namePath: NamePath;
|
|
14
|
+
onChange: () => void;
|
|
15
|
+
}>;
|
|
11
16
|
export {};
|
|
@@ -3,25 +3,37 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.FormSubscribe = void 0;
|
|
6
|
+
exports.Watcher = exports.FormSubscribe = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _rcFieldForm = require("rc-field-form");
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
var _ahooks = require("ahooks");
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
var _useIsomorphicUpdateLayoutEffect = require("../../utils/use-isomorphic-update-layout-effect");
|
|
15
|
+
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
|
+
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
|
+
|
|
20
|
+
const FormSubscribe = props => {
|
|
21
|
+
const update = (0, _ahooks.useUpdate)();
|
|
22
|
+
const form = (0, _react.useContext)(_rcFieldForm.FieldContext);
|
|
23
|
+
return _react.default.createElement(_react.default.Fragment, null, props.children(form.getFieldsValue(props.to), form), props.to.map(namePath => _react.default.createElement(Watcher, {
|
|
24
|
+
key: namePath.toString(),
|
|
25
|
+
form: form,
|
|
26
|
+
namePath: namePath,
|
|
27
|
+
onChange: update
|
|
28
|
+
})));
|
|
25
29
|
};
|
|
26
30
|
|
|
27
|
-
exports.FormSubscribe = FormSubscribe;
|
|
31
|
+
exports.FormSubscribe = FormSubscribe;
|
|
32
|
+
const Watcher = (0, _react.memo)(props => {
|
|
33
|
+
const value = (0, _rcFieldForm.useWatch)(props.namePath, props.form);
|
|
34
|
+
(0, _useIsomorphicUpdateLayoutEffect.useIsomorphicUpdateLayoutEffect)(() => {
|
|
35
|
+
props.onChange();
|
|
36
|
+
}, [value]);
|
|
37
|
+
return null;
|
|
38
|
+
});
|
|
39
|
+
exports.Watcher = Watcher;
|
|
@@ -8,7 +8,11 @@ export declare type FormProps = Pick<RcFormProps, 'form' | 'initialValues' | 'na
|
|
|
8
8
|
footer?: ReactNode;
|
|
9
9
|
mode?: ListProps['mode'];
|
|
10
10
|
};
|
|
11
|
-
export declare const Form: React.ForwardRefExoticComponent<Pick<RcFormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> &
|
|
11
|
+
export declare const Form: React.ForwardRefExoticComponent<Pick<RcFormProps<any>, "children" | "form" | "name" | "initialValues" | "preserve" | "validateMessages" | "validateTrigger" | "onFieldsChange" | "onFinish" | "onFinishFailed" | "onValuesChange"> & {
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
style?: (React.CSSProperties & Partial<Record<"--border-bottom" | "--border-inner" | "--border-top", string>>) | undefined;
|
|
14
|
+
tabIndex?: number | undefined;
|
|
15
|
+
} & React.AriaAttributes & Partial<FormContextType> & {
|
|
12
16
|
footer?: ReactNode;
|
|
13
17
|
mode?: ListProps['mode'];
|
|
14
18
|
} & React.RefAttributes<FormInstance>>;
|
|
@@ -7,12 +7,16 @@ 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>> & {
|
|
14
18
|
Item: import("react").FC<import("./form-item").FormItemProps>;
|
|
15
|
-
Subscribe: import("react").
|
|
19
|
+
Subscribe: import("react").FC<import("./form-subscribe").FormSubscribeProps>;
|
|
16
20
|
Header: import("react").FC<{
|
|
17
21
|
children?: import("react").ReactNode;
|
|
18
22
|
}>;
|
|
@@ -12,4 +12,8 @@ export declare const IndexBar: React.ForwardRefExoticComponent<{
|
|
|
12
12
|
sticky?: boolean | undefined;
|
|
13
13
|
onIndexChange?: ((index: string) => void) | undefined;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
|
-
} &
|
|
15
|
+
} & {
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
style?: (React.CSSProperties & Partial<Record<"--sticky-offset-top", string>>) | undefined;
|
|
18
|
+
tabIndex?: number | undefined;
|
|
19
|
+
} & React.AriaAttributes & React.RefAttributes<IndexBarRef>>;
|
|
@@ -6,7 +6,11 @@ declare const _default: import("react").ForwardRefExoticComponent<{
|
|
|
6
6
|
sticky?: boolean | undefined;
|
|
7
7
|
onIndexChange?: ((index: string) => void) | undefined;
|
|
8
8
|
children?: import("react").ReactNode;
|
|
9
|
-
} &
|
|
9
|
+
} & {
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
style?: (import("react").CSSProperties & Partial<Record<"--sticky-offset-top", string>>) | undefined;
|
|
12
|
+
tabIndex?: number | undefined;
|
|
13
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./index-bar").IndexBarRef>> & {
|
|
10
14
|
Panel: import("react").FC<import("./panel").IndexBarPanelProps>;
|
|
11
15
|
};
|
|
12
16
|
export default _default;
|
|
@@ -57,7 +57,9 @@ const InfiniteScroll = p => {
|
|
|
57
57
|
const [flag, setFlag] = (0, _react.useState)({});
|
|
58
58
|
const nextFlagRef = (0, _react.useRef)(flag);
|
|
59
59
|
const [scrollParent, setScrollParent] = (0, _react.useState)();
|
|
60
|
-
const
|
|
60
|
+
const {
|
|
61
|
+
run: check
|
|
62
|
+
} = (0, _ahooks.useThrottleFn)(() => (0, _tslib.__awaiter)(void 0, void 0, void 0, function* () {
|
|
61
63
|
if (nextFlagRef.current !== flag) return;
|
|
62
64
|
if (!props.hasMore) return;
|
|
63
65
|
const element = elementRef.current;
|
|
@@ -76,7 +78,11 @@ const InfiniteScroll = p => {
|
|
|
76
78
|
yield doLoadMore(false);
|
|
77
79
|
setFlag(nextFlag);
|
|
78
80
|
}
|
|
79
|
-
})
|
|
81
|
+
}), {
|
|
82
|
+
wait: 100,
|
|
83
|
+
leading: true,
|
|
84
|
+
trailing: true
|
|
85
|
+
}); // Make sure to trigger `loadMore` when content changes
|
|
80
86
|
|
|
81
87
|
(0, _react.useEffect)(() => {
|
|
82
88
|
check();
|
|
@@ -97,8 +103,11 @@ const InfiniteScroll = p => {
|
|
|
97
103
|
}, [scrollParent]);
|
|
98
104
|
|
|
99
105
|
function retry() {
|
|
100
|
-
|
|
101
|
-
|
|
106
|
+
return (0, _tslib.__awaiter)(this, void 0, void 0, function* () {
|
|
107
|
+
setFailed(false);
|
|
108
|
+
yield doLoadMore(true);
|
|
109
|
+
setFlag(nextFlagRef.current);
|
|
110
|
+
});
|
|
102
111
|
}
|
|
103
112
|
|
|
104
113
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
@@ -38,5 +38,9 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProp
|
|
|
38
38
|
enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined;
|
|
39
39
|
min?: number | undefined;
|
|
40
40
|
max?: number | undefined;
|
|
41
|
-
} &
|
|
41
|
+
} & {
|
|
42
|
+
className?: string | undefined;
|
|
43
|
+
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align", string>>) | undefined;
|
|
44
|
+
tabIndex?: number | undefined;
|
|
45
|
+
} & React.AriaAttributes & React.RefAttributes<InputRef>>;
|
|
42
46
|
export {};
|