antd-mobile 5.15.1 → 5.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2x/README.md +30 -16
- package/2x/bundle/antd-mobile.cjs.js +322 -193
- package/2x/bundle/antd-mobile.es.js +323 -194
- 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/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 +3 -20
- package/2x/cjs/components/center-popup/center-popup.js +24 -13
- package/2x/cjs/components/date-picker/date-picker.d.ts +2 -2
- package/2x/cjs/components/date-picker/date-picker.js +3 -1
- package/2x/cjs/components/date-picker/index.d.ts +1 -1
- package/2x/cjs/components/input/input.css +4 -0
- package/2x/cjs/components/input/input.d.ts +7 -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 +4 -11
- 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/picker/index.d.ts +2 -6
- package/2x/cjs/components/picker/picker.d.ts +2 -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/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/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/locales/base.d.ts +7 -0
- package/2x/cjs/locales/base.js +7 -0
- package/2x/cjs/locales/en-US.d.ts +7 -0
- package/2x/cjs/locales/es-ES.d.ts +7 -0
- package/2x/cjs/locales/fa-IR.d.ts +7 -0
- package/2x/cjs/locales/fr-FR.d.ts +7 -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 +7 -0
- package/2x/cjs/locales/zh-CN.d.ts +7 -0
- package/2x/cjs/locales/zh-CN.js +7 -0
- package/2x/cjs/locales/zh-HK.d.ts +7 -0
- package/2x/cjs/locales/zh-TW.d.ts +7 -0
- 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/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 +3 -20
- package/2x/es/components/center-popup/center-popup.js +22 -13
- package/2x/es/components/date-picker/date-picker.d.ts +2 -2
- package/2x/es/components/date-picker/date-picker.js +3 -1
- package/2x/es/components/date-picker/index.d.ts +1 -1
- package/2x/es/components/input/input.css +4 -0
- package/2x/es/components/input/input.d.ts +7 -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 +4 -10
- 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/picker/index.d.ts +2 -6
- package/2x/es/components/picker/picker.d.ts +2 -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/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/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/locales/base.d.ts +7 -0
- package/2x/es/locales/base.js +7 -0
- package/2x/es/locales/en-US.d.ts +7 -0
- package/2x/es/locales/es-ES.d.ts +7 -0
- package/2x/es/locales/fa-IR.d.ts +7 -0
- package/2x/es/locales/fr-FR.d.ts +7 -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 +7 -0
- package/2x/es/locales/zh-CN.d.ts +7 -0
- package/2x/es/locales/zh-CN.js +7 -0
- package/2x/es/locales/zh-HK.d.ts +7 -0
- package/2x/es/locales/zh-TW.d.ts +7 -0
- 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 +322 -193
- package/bundle/antd-mobile.es.js +323 -194
- 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/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 +3 -20
- package/cjs/components/center-popup/center-popup.js +24 -13
- package/cjs/components/date-picker/date-picker.d.ts +2 -2
- package/cjs/components/date-picker/date-picker.js +3 -1
- package/cjs/components/date-picker/index.d.ts +1 -1
- package/cjs/components/input/input.css +3 -0
- package/cjs/components/input/input.d.ts +7 -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 +4 -11
- package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/cjs/components/number-keyboard/number-keyboard.js +13 -7
- package/cjs/components/picker/index.d.ts +2 -6
- package/cjs/components/picker/picker.d.ts +2 -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/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/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/locales/base.d.ts +7 -0
- package/cjs/locales/base.js +7 -0
- package/cjs/locales/en-US.d.ts +7 -0
- package/cjs/locales/es-ES.d.ts +7 -0
- package/cjs/locales/fa-IR.d.ts +7 -0
- package/cjs/locales/fr-FR.d.ts +7 -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 +7 -0
- package/cjs/locales/zh-CN.d.ts +7 -0
- package/cjs/locales/zh-CN.js +7 -0
- package/cjs/locales/zh-HK.d.ts +7 -0
- package/cjs/locales/zh-TW.d.ts +7 -0
- package/es/components/action-sheet/action-sheet.d.ts +2 -4
- package/es/components/action-sheet/action-sheet.js +6 -2
- 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 +3 -20
- package/es/components/center-popup/center-popup.js +22 -13
- package/es/components/date-picker/date-picker.d.ts +2 -2
- package/es/components/date-picker/date-picker.js +3 -1
- package/es/components/date-picker/index.d.ts +1 -1
- package/es/components/input/input.css +3 -0
- package/es/components/input/input.d.ts +7 -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 +4 -10
- package/es/components/number-keyboard/number-keyboard.d.ts +1 -5
- package/es/components/number-keyboard/number-keyboard.js +13 -7
- package/es/components/picker/index.d.ts +2 -6
- package/es/components/picker/picker.d.ts +2 -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/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/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/locales/base.d.ts +7 -0
- package/es/locales/base.js +7 -0
- package/es/locales/en-US.d.ts +7 -0
- package/es/locales/es-ES.d.ts +7 -0
- package/es/locales/fa-IR.d.ts +7 -0
- package/es/locales/fr-FR.d.ts +7 -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 +7 -0
- package/es/locales/zh-CN.d.ts +7 -0
- package/es/locales/zh-CN.js +7 -0
- package/es/locales/zh-HK.d.ts +7 -0
- package/es/locales/zh-TW.d.ts +7 -0
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
package/bundle/style.css
CHANGED
|
@@ -145,26 +145,52 @@ div.adm-px-tester {
|
|
|
145
145
|
background-color: var(--adm-color-background);
|
|
146
146
|
z-index: calc(var(--z-index) + 10);
|
|
147
147
|
}
|
|
148
|
+
.adm-popup-body .adm-popup-close-icon {
|
|
149
|
+
position: absolute;
|
|
150
|
+
z-index: 100;
|
|
151
|
+
}
|
|
148
152
|
.adm-popup-body-position-bottom {
|
|
149
153
|
width: 100%;
|
|
150
154
|
bottom: 0;
|
|
151
155
|
left: 0;
|
|
152
156
|
}
|
|
157
|
+
.adm-popup-body-position-bottom .adm-popup-close-icon {
|
|
158
|
+
right: 8px;
|
|
159
|
+
top: 8px;
|
|
160
|
+
}
|
|
153
161
|
.adm-popup-body-position-top {
|
|
154
162
|
width: 100%;
|
|
155
163
|
top: 0;
|
|
156
164
|
left: 0;
|
|
157
165
|
}
|
|
166
|
+
.adm-popup-body-position-top .adm-popup-close-icon {
|
|
167
|
+
right: 8px;
|
|
168
|
+
bottom: 8px;
|
|
169
|
+
}
|
|
158
170
|
.adm-popup-body-position-left {
|
|
159
171
|
height: 100%;
|
|
160
172
|
top: 0;
|
|
161
173
|
left: 0;
|
|
162
174
|
}
|
|
175
|
+
.adm-popup-body-position-left .adm-popup-close-icon {
|
|
176
|
+
right: 8px;
|
|
177
|
+
top: 8px;
|
|
178
|
+
}
|
|
163
179
|
.adm-popup-body-position-right {
|
|
164
180
|
height: 100%;
|
|
165
181
|
top: 0;
|
|
166
182
|
right: 0;
|
|
167
183
|
}
|
|
184
|
+
.adm-popup-body-position-right .adm-popup-close-icon {
|
|
185
|
+
left: 8px;
|
|
186
|
+
top: 8px;
|
|
187
|
+
}
|
|
188
|
+
.adm-popup-close-icon {
|
|
189
|
+
cursor: pointer;
|
|
190
|
+
padding: 4px;
|
|
191
|
+
font-size: 18px;
|
|
192
|
+
color: var(--adm-color-weak);
|
|
193
|
+
}
|
|
168
194
|
.adm-mask {
|
|
169
195
|
--z-index: var(--adm-mask-z-index, 1000);
|
|
170
196
|
position: fixed;
|
|
@@ -692,6 +718,7 @@ div.adm-px-tester {
|
|
|
692
718
|
flex-direction: column;
|
|
693
719
|
position: relative;
|
|
694
720
|
z-index: 0;
|
|
721
|
+
padding-bottom: 1px;
|
|
695
722
|
}
|
|
696
723
|
.adm-picker-view-column-accessible > * {
|
|
697
724
|
flex: 1;
|
|
@@ -1064,6 +1091,16 @@ a.adm-list-item:active:not(.adm-list-item-disabled)::after {
|
|
|
1064
1091
|
background-color: var(--background-color);
|
|
1065
1092
|
border-radius: var(--border-radius);
|
|
1066
1093
|
}
|
|
1094
|
+
.adm-center-popup-close {
|
|
1095
|
+
position: absolute;
|
|
1096
|
+
z-index: 100;
|
|
1097
|
+
right: 8px;
|
|
1098
|
+
top: 8px;
|
|
1099
|
+
cursor: pointer;
|
|
1100
|
+
padding: 4px;
|
|
1101
|
+
font-size: 18px;
|
|
1102
|
+
color: var(--adm-color-weak);
|
|
1103
|
+
}
|
|
1067
1104
|
.adm-checkbox {
|
|
1068
1105
|
--icon-size: 22px;
|
|
1069
1106
|
--font-size: var(--adm-font-size-9);
|
|
@@ -2137,6 +2174,9 @@ a.adm-list-item:active:not(.adm-list-item-disabled)::after {
|
|
|
2137
2174
|
.adm-input-element::-ms-clear {
|
|
2138
2175
|
display: none;
|
|
2139
2176
|
}
|
|
2177
|
+
.adm-input-element::-ms-reveal {
|
|
2178
|
+
display: none;
|
|
2179
|
+
}
|
|
2140
2180
|
.adm-input-element::-webkit-search-cancel-button {
|
|
2141
2181
|
display: none;
|
|
2142
2182
|
}
|
|
@@ -2286,14 +2326,6 @@ a.adm-list-item:active:not(.adm-list-item-disabled)::after {
|
|
|
2286
2326
|
line-height: 1.4;
|
|
2287
2327
|
color: var(--adm-color-text);
|
|
2288
2328
|
}
|
|
2289
|
-
.adm-modal-close {
|
|
2290
|
-
position: absolute;
|
|
2291
|
-
right: 8px;
|
|
2292
|
-
top: 8px;
|
|
2293
|
-
color: var(--adm-color-weak);
|
|
2294
|
-
padding: 4px;
|
|
2295
|
-
font-size: var(--adm-font-size-10);
|
|
2296
|
-
}
|
|
2297
2329
|
.adm-modal-footer {
|
|
2298
2330
|
user-select: none;
|
|
2299
2331
|
padding: 8px 12px 12px;
|
|
@@ -2725,20 +2757,32 @@ a.adm-list-item:active:not(.adm-list-item-disabled)::after {
|
|
|
2725
2757
|
}
|
|
2726
2758
|
}
|
|
2727
2759
|
.adm-progress-bar {
|
|
2728
|
-
--track-width: var(--adm-progress-bar-track-width,
|
|
2760
|
+
--track-width: var(--adm-progress-bar-track-width, 8px);
|
|
2729
2761
|
--track-color: var(--adm-progress-bar-track-color, #e5e5e5);
|
|
2730
2762
|
--fill-color: var(--adm-progress-bar-fill-color, var(--adm-color-primary));
|
|
2763
|
+
--text-width: var(--adm-progress-bar-text-width, 40px);
|
|
2764
|
+
display: flex;
|
|
2765
|
+
align-items: center;
|
|
2731
2766
|
}
|
|
2732
2767
|
.adm-progress-bar-trail {
|
|
2768
|
+
flex: auto;
|
|
2733
2769
|
background: var(--track-color);
|
|
2734
2770
|
overflow: hidden;
|
|
2735
2771
|
height: var(--track-width);
|
|
2736
|
-
border-radius: var(--track-width);
|
|
2737
2772
|
}
|
|
2738
2773
|
.adm-progress-bar-fill {
|
|
2739
2774
|
transition: width 0.3s;
|
|
2740
2775
|
background: var(--fill-color);
|
|
2741
|
-
height:
|
|
2776
|
+
height: var(--track-width);
|
|
2777
|
+
}
|
|
2778
|
+
.adm-progress-bar-text {
|
|
2779
|
+
flex: none;
|
|
2780
|
+
width: calc(var(--text-width) + 8px);
|
|
2781
|
+
padding-left: 8px;
|
|
2782
|
+
color: #999999;
|
|
2783
|
+
}
|
|
2784
|
+
.adm-progress-bar-rounded .adm-progress-bar-trail,
|
|
2785
|
+
.adm-progress-bar-rounded .adm-progress-bar-fill {
|
|
2742
2786
|
border-radius: var(--track-width);
|
|
2743
2787
|
}
|
|
2744
2788
|
/*进度圈*/
|
|
@@ -3308,7 +3352,7 @@ a.adm-list-item:active:not(.adm-list-item-disabled)::after {
|
|
|
3308
3352
|
.adm-step .adm-step-indicator .adm-step-icon-container {
|
|
3309
3353
|
position: absolute;
|
|
3310
3354
|
z-index: 1;
|
|
3311
|
-
background: var(--adm-color-
|
|
3355
|
+
background: var(--adm-color-background);
|
|
3312
3356
|
color: var(--icon-color);
|
|
3313
3357
|
}
|
|
3314
3358
|
.adm-step .adm-step-indicator .adm-step-icon-container > .antd-mobile-icon {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { FC, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
|
-
import {
|
|
3
|
+
import { PopupProps } from '../popup';
|
|
4
4
|
export declare type Action = {
|
|
5
5
|
key: string | number;
|
|
6
6
|
text: ReactNode;
|
|
@@ -16,15 +16,13 @@ export declare type ActionSheetProps = {
|
|
|
16
16
|
cancelText?: React.ReactNode;
|
|
17
17
|
onAction?: (action: Action, index: number) => void;
|
|
18
18
|
onClose?: () => void;
|
|
19
|
-
afterClose?: () => void;
|
|
20
19
|
onMaskClick?: () => void;
|
|
21
20
|
closeOnAction?: boolean;
|
|
22
21
|
closeOnMaskClick?: boolean;
|
|
23
|
-
getContainer?: GetContainer;
|
|
24
22
|
safeArea?: boolean;
|
|
25
23
|
popupClassName?: string;
|
|
26
24
|
popupStyle?: React.CSSProperties;
|
|
27
|
-
} & NativeProps;
|
|
25
|
+
} & Pick<PopupProps, 'afterClose' | 'getContainer' | 'destroyOnClose' | 'forceRender'> & NativeProps;
|
|
28
26
|
export declare const ActionSheet: FC<ActionSheetProps>;
|
|
29
27
|
export declare type ActionSheetShowHandler = {
|
|
30
28
|
close: () => void;
|
|
@@ -29,7 +29,9 @@ const defaultProps = {
|
|
|
29
29
|
cancelText: '',
|
|
30
30
|
closeOnAction: false,
|
|
31
31
|
closeOnMaskClick: true,
|
|
32
|
-
safeArea: true
|
|
32
|
+
safeArea: true,
|
|
33
|
+
destroyOnClose: false,
|
|
34
|
+
forceRender: false
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
const ActionSheet = p => {
|
|
@@ -48,7 +50,9 @@ const ActionSheet = p => {
|
|
|
48
50
|
afterClose: props.afterClose,
|
|
49
51
|
className: (0, _classnames.default)(`${classPrefix}-popup`, props.popupClassName),
|
|
50
52
|
style: props.popupStyle,
|
|
51
|
-
getContainer: props.getContainer
|
|
53
|
+
getContainer: props.getContainer,
|
|
54
|
+
destroyOnClose: props.destroyOnClose,
|
|
55
|
+
forceRender: props.forceRender
|
|
52
56
|
}, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
53
57
|
className: classPrefix
|
|
54
58
|
}, props.extra && _react.default.createElement("div", {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { ReactNode
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { PopupProps } from '../popup';
|
|
3
3
|
import { CascaderValue, CascaderValueExtend, CascaderOption } from '../cascader-view';
|
|
4
4
|
import { NativeProps } from '../../utils/native-props';
|
|
5
|
+
export declare type CascaderActions = {
|
|
6
|
+
open: () => void;
|
|
7
|
+
close: () => void;
|
|
8
|
+
toggle: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare type CascaderRef = CascaderActions;
|
|
5
11
|
export declare type CascaderProps = {
|
|
6
12
|
options: CascaderOption[];
|
|
7
13
|
value?: CascaderValue[];
|
|
@@ -15,7 +21,26 @@ export declare type CascaderProps = {
|
|
|
15
21
|
title?: ReactNode;
|
|
16
22
|
confirmText?: ReactNode;
|
|
17
23
|
cancelText?: ReactNode;
|
|
18
|
-
children?: (items: (CascaderOption | null)[]) => ReactNode;
|
|
24
|
+
children?: (items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode;
|
|
19
25
|
onTabsChange?: (index: number) => void;
|
|
20
|
-
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation'> & NativeProps;
|
|
21
|
-
export declare const Cascader:
|
|
26
|
+
} & Pick<PopupProps, 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'stopPropagation' | 'destroyOnClose' | 'forceRender'> & NativeProps;
|
|
27
|
+
export declare const Cascader: React.ForwardRefExoticComponent<{
|
|
28
|
+
options: CascaderOption[];
|
|
29
|
+
value?: string[] | undefined;
|
|
30
|
+
defaultValue?: string[] | undefined;
|
|
31
|
+
placeholder?: string | undefined;
|
|
32
|
+
onSelect?: ((value: CascaderValue[], extend: CascaderValueExtend) => void) | undefined;
|
|
33
|
+
onConfirm?: ((value: CascaderValue[], extend: CascaderValueExtend) => void) | undefined;
|
|
34
|
+
onCancel?: (() => void) | undefined;
|
|
35
|
+
onClose?: (() => void) | undefined;
|
|
36
|
+
visible?: boolean | undefined;
|
|
37
|
+
title?: ReactNode;
|
|
38
|
+
confirmText?: ReactNode;
|
|
39
|
+
cancelText?: ReactNode;
|
|
40
|
+
children?: ((items: (CascaderOption | null)[], actions: CascaderActions) => ReactNode) | undefined;
|
|
41
|
+
onTabsChange?: ((index: number) => void) | undefined;
|
|
42
|
+
} & Pick<PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
43
|
+
className?: string | undefined;
|
|
44
|
+
style?: (React.CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
45
|
+
tabIndex?: number | undefined;
|
|
46
|
+
} & React.AriaAttributes & React.RefAttributes<CascaderActions>>;
|
|
@@ -29,10 +29,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
29
29
|
|
|
30
30
|
const classPrefix = `adm-cascader`;
|
|
31
31
|
const defaultProps = {
|
|
32
|
-
defaultValue: []
|
|
32
|
+
defaultValue: [],
|
|
33
|
+
destroyOnClose: true,
|
|
34
|
+
forceRender: false
|
|
33
35
|
};
|
|
34
|
-
|
|
35
|
-
const Cascader = p => {
|
|
36
|
+
const Cascader = (0, _react.forwardRef)((p, ref) => {
|
|
36
37
|
var _a;
|
|
37
38
|
|
|
38
39
|
const {
|
|
@@ -43,6 +44,29 @@ const Cascader = p => {
|
|
|
43
44
|
cancelText: locale.common.cancel,
|
|
44
45
|
placeholder: locale.Cascader.placeholder
|
|
45
46
|
}, p);
|
|
47
|
+
const [visible, setVisible] = (0, _usePropsValue.usePropsValue)({
|
|
48
|
+
value: props.visible,
|
|
49
|
+
defaultValue: false,
|
|
50
|
+
onChange: v => {
|
|
51
|
+
var _a;
|
|
52
|
+
|
|
53
|
+
if (v === false) {
|
|
54
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const actions = {
|
|
59
|
+
toggle: () => {
|
|
60
|
+
setVisible(v => !v);
|
|
61
|
+
},
|
|
62
|
+
open: () => {
|
|
63
|
+
setVisible(true);
|
|
64
|
+
},
|
|
65
|
+
close: () => {
|
|
66
|
+
setVisible(false);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
(0, _react.useImperativeHandle)(ref, () => actions);
|
|
46
70
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(Object.assign(Object.assign({}, props), {
|
|
47
71
|
onChange: val => {
|
|
48
72
|
var _a;
|
|
@@ -53,12 +77,12 @@ const Cascader = p => {
|
|
|
53
77
|
const generateValueExtend = (0, _useCascaderValueExtend.useCascaderValueExtend)(props.options);
|
|
54
78
|
const [innerValue, setInnerValue] = (0, _react.useState)(value);
|
|
55
79
|
(0, _react.useEffect)(() => {
|
|
56
|
-
if (!
|
|
80
|
+
if (!visible) {
|
|
57
81
|
setInnerValue(value);
|
|
58
82
|
}
|
|
59
|
-
}, [
|
|
83
|
+
}, [visible]);
|
|
60
84
|
(0, _react.useEffect)(() => {
|
|
61
|
-
if (!
|
|
85
|
+
if (!visible) {
|
|
62
86
|
setInnerValue(value);
|
|
63
87
|
}
|
|
64
88
|
}, [value]);
|
|
@@ -69,20 +93,18 @@ const Cascader = p => {
|
|
|
69
93
|
}, _react.default.createElement("a", {
|
|
70
94
|
className: `${classPrefix}-header-button`,
|
|
71
95
|
onClick: () => {
|
|
72
|
-
var _a
|
|
96
|
+
var _a;
|
|
73
97
|
|
|
74
98
|
(_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
75
|
-
(
|
|
99
|
+
setVisible(false);
|
|
76
100
|
}
|
|
77
101
|
}, props.cancelText), _react.default.createElement("div", {
|
|
78
102
|
className: `${classPrefix}-header-title`
|
|
79
103
|
}, props.title), _react.default.createElement("a", {
|
|
80
104
|
className: `${classPrefix}-header-button`,
|
|
81
105
|
onClick: () => {
|
|
82
|
-
var _a;
|
|
83
|
-
|
|
84
106
|
setValue(innerValue);
|
|
85
|
-
(
|
|
107
|
+
setVisible(false);
|
|
86
108
|
}
|
|
87
109
|
}, props.confirmText)), _react.default.createElement("div", {
|
|
88
110
|
className: `${classPrefix}-body`
|
|
@@ -93,30 +115,30 @@ const Cascader = p => {
|
|
|
93
115
|
|
|
94
116
|
setInnerValue(val);
|
|
95
117
|
|
|
96
|
-
if (
|
|
118
|
+
if (visible) {
|
|
97
119
|
(_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, val, ext);
|
|
98
120
|
}
|
|
99
121
|
}
|
|
100
122
|
})))));
|
|
101
123
|
|
|
102
124
|
const popupElement = _react.default.createElement(_popup.default, {
|
|
103
|
-
visible:
|
|
125
|
+
visible: visible,
|
|
104
126
|
position: 'bottom',
|
|
105
127
|
onMaskClick: () => {
|
|
106
|
-
var _a
|
|
128
|
+
var _a;
|
|
107
129
|
|
|
108
130
|
(_a = props.onCancel) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
109
|
-
(
|
|
131
|
+
setVisible(false);
|
|
110
132
|
},
|
|
111
133
|
getContainer: props.getContainer,
|
|
112
|
-
destroyOnClose:
|
|
134
|
+
destroyOnClose: props.destroyOnClose,
|
|
135
|
+
forceRender: props.forceRender,
|
|
113
136
|
afterShow: props.afterShow,
|
|
114
137
|
afterClose: props.afterClose,
|
|
115
138
|
onClick: props.onClick,
|
|
116
139
|
stopPropagation: props.stopPropagation
|
|
117
140
|
}, cascaderElement);
|
|
118
141
|
|
|
119
|
-
return _react.default.createElement(_react.default.Fragment, null, popupElement, (_a = props.children) === null || _a === void 0 ? void 0 : _a.call(props, generateValueExtend(value).items));
|
|
120
|
-
};
|
|
121
|
-
|
|
142
|
+
return _react.default.createElement(_react.default.Fragment, null, popupElement, (_a = props.children) === null || _a === void 0 ? void 0 : _a.call(props, generateValueExtend(value).items, actions));
|
|
143
|
+
});
|
|
122
144
|
exports.Cascader = Cascader;
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { prompt } from './prompt';
|
|
3
3
|
import './cascader.less';
|
|
4
|
-
export type { CascaderProps } from './cascader';
|
|
4
|
+
export type { CascaderProps, CascaderRef, CascaderActions } from './cascader';
|
|
5
5
|
export type { CascaderValue, CascaderValueExtend, CascaderOption, } from '../cascader-view';
|
|
6
|
-
declare const _default: import("react").
|
|
6
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
7
|
+
options: import("../cascader-view").CascaderOption[];
|
|
8
|
+
value?: string[] | undefined;
|
|
9
|
+
defaultValue?: string[] | undefined;
|
|
10
|
+
placeholder?: string | undefined;
|
|
11
|
+
onSelect?: ((value: string[], extend: import("../cascader-view").CascaderValueExtend) => void) | undefined;
|
|
12
|
+
onConfirm?: ((value: string[], extend: import("../cascader-view").CascaderValueExtend) => void) | undefined;
|
|
13
|
+
onCancel?: (() => void) | undefined;
|
|
14
|
+
onClose?: (() => void) | undefined;
|
|
15
|
+
visible?: boolean | undefined;
|
|
16
|
+
title?: import("react").ReactNode;
|
|
17
|
+
confirmText?: import("react").ReactNode;
|
|
18
|
+
cancelText?: import("react").ReactNode;
|
|
19
|
+
children?: ((items: (import("../cascader-view").CascaderOption | null)[], actions: import("./cascader").CascaderActions) => import("react").ReactNode) | undefined;
|
|
20
|
+
onTabsChange?: ((index: number) => void) | undefined;
|
|
21
|
+
} & Pick<import("../popup").PopupProps, "onClick" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation"> & {
|
|
22
|
+
className?: string | undefined;
|
|
23
|
+
style?: (import("react").CSSProperties & Partial<Record<never, string>>) | undefined;
|
|
24
|
+
tabIndex?: number | undefined;
|
|
25
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./cascader").CascaderActions>> & {
|
|
7
26
|
prompt: typeof prompt;
|
|
8
27
|
optionSkeleton: import("../cascader-view").CascaderOption[];
|
|
9
28
|
};
|
|
@@ -24,3 +24,13 @@
|
|
|
24
24
|
background-color: var(--background-color);
|
|
25
25
|
border-radius: var(--border-radius);
|
|
26
26
|
}
|
|
27
|
+
.adm-center-popup-close {
|
|
28
|
+
position: absolute;
|
|
29
|
+
z-index: 100;
|
|
30
|
+
right: 8px;
|
|
31
|
+
top: 8px;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
padding: 4px;
|
|
34
|
+
font-size: 18px;
|
|
35
|
+
color: var(--adm-color-weak);
|
|
36
|
+
}
|
|
@@ -1,24 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { GetContainer } from '../../utils/render-to-container';
|
|
3
|
-
import { MaskProps } from '../mask';
|
|
4
|
-
import { PropagationEvent } from '../../utils/with-stop-propagation';
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
5
2
|
import { NativeProps } from '../../utils/native-props';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
afterShow?: () => void;
|
|
9
|
-
bodyClassName?: string;
|
|
10
|
-
bodyStyle?: React.CSSProperties;
|
|
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
|
-
onMaskClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
20
|
-
stopPropagation?: PropagationEvent[];
|
|
21
|
-
visible?: boolean;
|
|
3
|
+
import { PopupBaseProps } from '../popup/popup-base-props';
|
|
4
|
+
export declare type CenterPopupProps = PopupBaseProps & PropsWithChildren<{
|
|
22
5
|
role?: string;
|
|
23
6
|
}> & NativeProps<'--background-color' | '--border-radius' | '--max-width' | '--min-width' | '--z-index'>;
|
|
24
7
|
export declare const CenterPopup: FC<CenterPopupProps>;
|
|
@@ -29,22 +29,17 @@ var _shouldRender = require("../../utils/should-render");
|
|
|
29
29
|
|
|
30
30
|
var _useLockScroll = require("../../utils/use-lock-scroll");
|
|
31
31
|
|
|
32
|
+
var _antdMobileIcons = require("antd-mobile-icons");
|
|
33
|
+
|
|
34
|
+
var _popupBaseProps = require("../popup/popup-base-props");
|
|
35
|
+
|
|
32
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
37
|
|
|
34
38
|
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); }
|
|
35
39
|
|
|
36
40
|
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; }
|
|
37
41
|
|
|
38
|
-
const defaultProps =
|
|
39
|
-
destroyOnClose: false,
|
|
40
|
-
disableBodyScroll: true,
|
|
41
|
-
forceRender: false,
|
|
42
|
-
getContainer: null,
|
|
43
|
-
mask: true,
|
|
44
|
-
showCloseButton: false,
|
|
45
|
-
stopPropagation: ['click'],
|
|
46
|
-
visible: false
|
|
47
|
-
};
|
|
42
|
+
const defaultProps = _popupBaseProps.defaultPopupBaseProps;
|
|
48
43
|
|
|
49
44
|
const CenterPopup = p => {
|
|
50
45
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
@@ -96,10 +91,19 @@ const CenterPopup = p => {
|
|
|
96
91
|
visible: maskVisible,
|
|
97
92
|
forceRender: props.forceRender,
|
|
98
93
|
destroyOnClose: props.destroyOnClose,
|
|
99
|
-
onMaskClick:
|
|
94
|
+
onMaskClick: e => {
|
|
95
|
+
var _a, _b;
|
|
96
|
+
|
|
97
|
+
(_a = props.onMaskClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
98
|
+
|
|
99
|
+
if (props.closeOnMaskClick) {
|
|
100
|
+
(_b = props.onClose) === null || _b === void 0 ? void 0 : _b.call(props);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
100
103
|
style: props.maskStyle,
|
|
101
104
|
className: (0, _classnames.default)('adm-center-popup-mask', props.maskClassName),
|
|
102
|
-
disableBodyScroll: false
|
|
105
|
+
disableBodyScroll: false,
|
|
106
|
+
stopPropagation: props.stopPropagation
|
|
103
107
|
}), _react.default.createElement("div", {
|
|
104
108
|
className: 'adm-center-popup-wrap',
|
|
105
109
|
role: props.role,
|
|
@@ -107,7 +111,14 @@ const CenterPopup = p => {
|
|
|
107
111
|
}, _react.default.createElement(_web.animated.div, {
|
|
108
112
|
style: style,
|
|
109
113
|
ref: ref
|
|
110
|
-
},
|
|
114
|
+
}, props.showCloseButton && _react.default.createElement("a", {
|
|
115
|
+
className: (0, _classnames.default)('adm-center-popup-close', 'adm-plain-anchor'),
|
|
116
|
+
onClick: () => {
|
|
117
|
+
var _a;
|
|
118
|
+
|
|
119
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
120
|
+
}
|
|
121
|
+
}, _react.default.createElement(_antdMobileIcons.CloseOutline, null)), body)))));
|
|
111
122
|
return _react.default.createElement(_shouldRender.ShouldRender, {
|
|
112
123
|
active: active,
|
|
113
124
|
forceRender: props.forceRender,
|
|
@@ -3,7 +3,7 @@ import type { PickerProps, PickerRef, PickerActions } from '../picker';
|
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
4
|
import type { Precision, DatePickerFilter } from './date-picker-utils';
|
|
5
5
|
export declare type DatePickerRef = PickerRef;
|
|
6
|
-
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'closeOnMaskClick' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation' | 'style' | 'mouseWheel'> & {
|
|
6
|
+
export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' | 'closeOnMaskClick' | 'visible' | 'confirmText' | 'cancelText' | 'getContainer' | 'afterShow' | 'afterClose' | 'onClick' | 'title' | 'stopPropagation' | 'style' | 'mouseWheel' | 'forceRender' | 'destroyOnClose'> & {
|
|
7
7
|
value?: Date | null;
|
|
8
8
|
defaultValue?: Date | null;
|
|
9
9
|
onSelect?: (value: Date) => void;
|
|
@@ -15,7 +15,7 @@ export declare type DatePickerProps = Pick<PickerProps, 'onCancel' | 'onClose' |
|
|
|
15
15
|
renderLabel?: (type: Precision, data: number) => ReactNode;
|
|
16
16
|
filter?: DatePickerFilter;
|
|
17
17
|
} & NativeProps;
|
|
18
|
-
export declare const DatePicker: React.ForwardRefExoticComponent<Pick<PickerProps, "style" | "title" | "onClick" | "visible" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "
|
|
18
|
+
export declare const DatePicker: React.ForwardRefExoticComponent<Pick<PickerProps, "style" | "title" | "onClick" | "visible" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "closeOnMaskClick" | "cancelText" | "mouseWheel" | "confirmText"> & {
|
|
19
19
|
value?: Date | null | undefined;
|
|
20
20
|
defaultValue?: Date | null | undefined;
|
|
21
21
|
onSelect?: ((value: Date) => void) | undefined;
|
|
@@ -81,7 +81,9 @@ const DatePicker = (0, _react.forwardRef)((p, ref) => {
|
|
|
81
81
|
onClick: props.onClick,
|
|
82
82
|
title: props.title,
|
|
83
83
|
stopPropagation: props.stopPropagation,
|
|
84
|
-
mouseWheel: props.mouseWheel
|
|
84
|
+
mouseWheel: props.mouseWheel,
|
|
85
|
+
destroyOnClose: props.destroyOnClose,
|
|
86
|
+
forceRender: props.forceRender
|
|
85
87
|
}, (_, actions) => {
|
|
86
88
|
var _a;
|
|
87
89
|
|
|
@@ -3,7 +3,7 @@ import './date-picker.less';
|
|
|
3
3
|
import { prompt } from './prompt';
|
|
4
4
|
export type { DatePickerProps, DatePickerRef } from './date-picker';
|
|
5
5
|
export type { DatePickerFilter } from './date-picker-utils';
|
|
6
|
-
declare const _default: import("react").ForwardRefExoticComponent<Pick<import("../picker").PickerProps, "style" | "title" | "onClick" | "visible" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "
|
|
6
|
+
declare const _default: import("react").ForwardRefExoticComponent<Pick<import("../picker").PickerProps, "style" | "title" | "onClick" | "visible" | "destroyOnClose" | "forceRender" | "getContainer" | "afterShow" | "afterClose" | "stopPropagation" | "onCancel" | "onClose" | "closeOnMaskClick" | "cancelText" | "mouseWheel" | "confirmText"> & {
|
|
7
7
|
value?: Date | null | undefined;
|
|
8
8
|
defaultValue?: Date | null | undefined;
|
|
9
9
|
onSelect?: ((value: Date) => void) | undefined;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
declare type NativeInputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
4
|
-
|
|
4
|
+
declare type AriaProps = {
|
|
5
|
+
role?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | 'pattern' | 'inputMode' | 'type' | 'name' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick' | 'step'> & {
|
|
5
8
|
value?: string;
|
|
6
9
|
defaultValue?: string;
|
|
7
10
|
onChange?: (val: string) => void;
|
|
@@ -16,14 +19,14 @@ export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength
|
|
|
16
19
|
enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
17
20
|
min?: number;
|
|
18
21
|
max?: number;
|
|
19
|
-
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'
|
|
22
|
+
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'> & AriaProps;
|
|
20
23
|
export declare type InputRef = {
|
|
21
24
|
clear: () => void;
|
|
22
25
|
focus: () => void;
|
|
23
26
|
blur: () => void;
|
|
24
27
|
nativeElement: HTMLInputElement | null;
|
|
25
28
|
};
|
|
26
|
-
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "onClick" | "name" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "autoFocus" | "maxLength" | "minLength"> & {
|
|
29
|
+
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "onClick" | "name" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "autoFocus" | "maxLength" | "minLength" | "step"> & {
|
|
27
30
|
value?: string | undefined;
|
|
28
31
|
defaultValue?: string | undefined;
|
|
29
32
|
onChange?: ((val: string) => void) | undefined;
|
|
@@ -42,5 +45,5 @@ export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProp
|
|
|
42
45
|
className?: string | undefined;
|
|
43
46
|
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align", string>>) | undefined;
|
|
44
47
|
tabIndex?: number | undefined;
|
|
45
|
-
} & React.AriaAttributes & React.RefAttributes<InputRef>>;
|
|
48
|
+
} & React.AriaAttributes & AriaProps & React.RefAttributes<InputRef>>;
|
|
46
49
|
export {};
|
|
@@ -157,7 +157,11 @@ const Input = (0, _react.forwardRef)((p, ref) => {
|
|
|
157
157
|
compositionStartRef.current = false;
|
|
158
158
|
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
159
159
|
},
|
|
160
|
-
onClick: props.onClick
|
|
160
|
+
onClick: props.onClick,
|
|
161
|
+
role: props.role,
|
|
162
|
+
"aria-valuenow": props['aria-valuenow'],
|
|
163
|
+
"aria-valuemax": props['aria-valuemax'],
|
|
164
|
+
"aria-valuemin": props['aria-valuemin']
|
|
161
165
|
}), shouldShowClear && _react.default.createElement("div", {
|
|
162
166
|
className: `${classPrefix}-clear`,
|
|
163
167
|
onMouseDown: e => {
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './list.less';
|
|
3
|
-
export type { ListProps } from './list';
|
|
3
|
+
export type { ListProps, ListRef } from './list';
|
|
4
4
|
export type { ListItemProps } from './list-item';
|
|
5
|
-
declare const _default: import("react").
|
|
5
|
+
declare const _default: import("react").ForwardRefExoticComponent<{
|
|
6
|
+
header?: import("react").ReactNode;
|
|
7
|
+
mode?: "default" | "card" | undefined;
|
|
8
|
+
children?: import("react").ReactNode;
|
|
9
|
+
} & {
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
style?: (import("react").CSSProperties & Partial<Record<"--active-background-color" | "--align-items" | "--border-bottom" | "--border-inner" | "--border-top" | "--extra-max-width" | "--font-size" | "--header-font-size" | "--padding-left" | "--padding-right" | "--prefix-padding-right" | "--prefix-width", string>>) | undefined;
|
|
12
|
+
tabIndex?: number | undefined;
|
|
13
|
+
} & import("react").AriaAttributes & import("react").RefAttributes<import("./list").ListRef>> & {
|
|
6
14
|
Item: import("react").FC<import("./list-item").ListItemProps>;
|
|
7
15
|
};
|
|
8
16
|
export default _default;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ListProps = {
|
|
4
4
|
header?: ReactNode;
|
|
5
5
|
mode?: 'default' | 'card';
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
} & NativeProps<'--active-background-color' | '--align-items' | '--border-bottom' | '--border-inner' | '--border-top' | '--extra-max-width' | '--font-size' | '--header-font-size' | '--padding-left' | '--padding-right' | '--prefix-padding-right' | '--prefix-width'>;
|
|
8
|
-
export declare
|
|
8
|
+
export declare type ListRef = {
|
|
9
|
+
nativeElement: HTMLDivElement | null;
|
|
10
|
+
};
|
|
11
|
+
export declare const List: React.ForwardRefExoticComponent<{
|
|
12
|
+
header?: ReactNode;
|
|
13
|
+
mode?: "default" | "card" | undefined;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
} & {
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
style?: (React.CSSProperties & Partial<Record<"--active-background-color" | "--align-items" | "--border-bottom" | "--border-inner" | "--border-top" | "--extra-max-width" | "--font-size" | "--header-font-size" | "--padding-left" | "--padding-right" | "--prefix-padding-right" | "--prefix-width", string>>) | undefined;
|
|
18
|
+
tabIndex?: number | undefined;
|
|
19
|
+
} & React.AriaAttributes & React.RefAttributes<ListRef>>;
|