antd-mobile 5.17.1 → 5.19.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/bundle/antd-mobile.cjs.js +47 -19173
- package/2x/bundle/antd-mobile.compatible.umd.js +25752 -0
- package/2x/bundle/antd-mobile.es.js +16416 -17055
- package/2x/bundle/antd-mobile.umd.js +64 -0
- package/2x/bundle/style.css +240 -277
- package/2x/cjs/components/action-sheet/action-sheet.d.ts +1 -1
- package/2x/cjs/components/button/button.js +1 -1
- package/2x/cjs/components/calendar/calendar.d.ts +3 -3
- package/2x/cjs/components/calendar/index.d.ts +1 -1
- package/2x/cjs/components/cascader/cascader.d.ts +2 -0
- package/2x/cjs/components/cascader/index.d.ts +1 -0
- package/2x/cjs/components/cascader-view/cascader-view.d.ts +2 -1
- package/2x/cjs/components/cascader-view/cascader-view.js +2 -1
- package/2x/cjs/components/dialog/show.d.ts +1 -1
- package/2x/cjs/components/floating-panel/floating-panel.css +4 -4
- package/2x/cjs/components/form/form-item.js +6 -4
- package/2x/cjs/components/image-viewer/slide.js +75 -56
- package/2x/cjs/components/input/input.js +9 -2
- package/2x/cjs/components/modal/show.d.ts +1 -1
- package/2x/cjs/components/notice-bar/notice-bar.css +9 -0
- package/2x/cjs/components/notice-bar/notice-bar.js +5 -3
- package/2x/cjs/components/number-keyboard/number-keyboard.css +11 -15
- package/2x/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/2x/cjs/components/number-keyboard/number-keyboard.js +19 -17
- package/2x/cjs/components/passcode-input/index.d.ts +1 -1
- package/2x/cjs/components/passcode-input/passcode-input.css +12 -12
- package/2x/cjs/components/passcode-input/passcode-input.js +16 -8
- package/2x/cjs/components/picker-view/wheel.js +1 -1
- package/2x/cjs/components/rate/rate.js +7 -2
- package/2x/cjs/components/rate/star.js +0 -10
- package/2x/cjs/components/result/result.d.ts +1 -1
- package/2x/cjs/components/result/result.js +7 -1
- package/2x/cjs/components/search-bar/search-bar.js +12 -2
- package/2x/cjs/components/switch/switch.d.ts +2 -1
- package/2x/cjs/components/switch/switch.js +16 -3
- package/2x/cjs/components/text-area/text-area.js +1 -0
- package/2x/cjs/locales/base.d.ts +9 -0
- package/2x/cjs/locales/base.js +9 -0
- package/2x/cjs/locales/en-US.d.ts +9 -0
- package/2x/cjs/locales/es-ES.d.ts +9 -0
- package/2x/cjs/locales/fa-IR.d.ts +9 -0
- package/2x/cjs/locales/fr-FR.d.ts +9 -0
- package/2x/cjs/locales/id-ID.d.ts +9 -0
- package/2x/cjs/locales/kk-KZ.d.ts +9 -0
- package/2x/cjs/locales/ko-KR.d.ts +9 -0
- package/2x/cjs/locales/zh-CN.d.ts +9 -0
- package/2x/cjs/locales/zh-CN.js +9 -0
- package/2x/cjs/locales/zh-HK.d.ts +9 -0
- package/2x/cjs/locales/zh-TW.d.ts +9 -0
- package/2x/cjs/utils/matrix.d.ts +10 -0
- package/2x/cjs/utils/matrix.js +60 -0
- package/2x/cjs/utils/merge-locale.d.ts +1 -1
- package/2x/cjs/utils/merge-locale.js +15 -5
- package/2x/cjs/utils/use-drag-and-pinch.d.ts +1 -1
- package/2x/cjs/utils/use-props-value.js +1 -1
- package/2x/cjs/utils/with-default-props.js +2 -6
- package/2x/es/components/action-sheet/action-sheet.d.ts +1 -1
- package/2x/es/components/button/button.js +1 -1
- package/2x/es/components/calendar/calendar.d.ts +3 -3
- package/2x/es/components/calendar/index.d.ts +1 -1
- package/2x/es/components/cascader/cascader.d.ts +2 -0
- package/2x/es/components/cascader/index.d.ts +1 -0
- package/2x/es/components/cascader-view/cascader-view.d.ts +2 -1
- package/2x/es/components/cascader-view/cascader-view.js +2 -1
- package/2x/es/components/dialog/show.d.ts +1 -1
- package/2x/es/components/floating-panel/floating-panel.css +4 -4
- package/2x/es/components/form/form-item.js +5 -4
- package/2x/es/components/image-viewer/slide.js +73 -56
- package/2x/es/components/input/input.js +8 -2
- package/2x/es/components/modal/show.d.ts +1 -1
- package/2x/es/components/notice-bar/notice-bar.css +9 -0
- package/2x/es/components/notice-bar/notice-bar.js +5 -3
- package/2x/es/components/number-keyboard/number-keyboard.css +11 -15
- package/2x/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/2x/es/components/number-keyboard/number-keyboard.js +19 -17
- package/2x/es/components/passcode-input/index.d.ts +1 -1
- package/2x/es/components/passcode-input/passcode-input.css +12 -12
- package/2x/es/components/passcode-input/passcode-input.js +15 -8
- package/2x/es/components/picker-view/wheel.js +1 -1
- package/2x/es/components/rate/rate.js +7 -2
- package/2x/es/components/rate/star.js +0 -10
- package/2x/es/components/result/result.d.ts +1 -1
- package/2x/es/components/result/result.js +6 -1
- package/2x/es/components/search-bar/search-bar.js +12 -2
- package/2x/es/components/switch/switch.d.ts +2 -1
- package/2x/es/components/switch/switch.js +15 -3
- package/2x/es/components/text-area/text-area.js +1 -0
- package/2x/es/locales/base.d.ts +9 -0
- package/2x/es/locales/base.js +9 -0
- package/2x/es/locales/en-US.d.ts +9 -0
- package/2x/es/locales/es-ES.d.ts +9 -0
- package/2x/es/locales/fa-IR.d.ts +9 -0
- package/2x/es/locales/fr-FR.d.ts +9 -0
- package/2x/es/locales/id-ID.d.ts +9 -0
- package/2x/es/locales/kk-KZ.d.ts +9 -0
- package/2x/es/locales/ko-KR.d.ts +9 -0
- package/2x/es/locales/zh-CN.d.ts +9 -0
- package/2x/es/locales/zh-CN.js +9 -0
- package/2x/es/locales/zh-HK.d.ts +9 -0
- package/2x/es/locales/zh-TW.d.ts +9 -0
- package/2x/es/utils/matrix.d.ts +10 -0
- package/2x/es/utils/matrix.js +27 -0
- package/2x/es/utils/merge-locale.d.ts +1 -1
- package/2x/es/utils/merge-locale.js +17 -3
- package/2x/es/utils/use-drag-and-pinch.d.ts +1 -1
- package/2x/es/utils/use-props-value.js +1 -1
- package/2x/es/utils/with-default-props.js +2 -4
- package/2x/package.json +4 -4
- package/2x/umd/antd-mobile.js +25752 -2
- package/bundle/antd-mobile.cjs.js +47 -19173
- package/bundle/antd-mobile.compatible.umd.js +25752 -0
- package/bundle/antd-mobile.es.js +16416 -17055
- package/bundle/antd-mobile.umd.js +64 -0
- package/bundle/style.css +1 -4080
- package/cjs/components/action-sheet/action-sheet.d.ts +1 -1
- package/cjs/components/button/button.js +1 -1
- package/cjs/components/calendar/calendar.d.ts +3 -3
- package/cjs/components/calendar/index.d.ts +1 -1
- package/cjs/components/cascader/cascader.d.ts +2 -0
- package/cjs/components/cascader/index.d.ts +1 -0
- package/cjs/components/cascader-view/cascader-view.d.ts +2 -1
- package/cjs/components/cascader-view/cascader-view.js +2 -1
- package/cjs/components/dialog/show.d.ts +1 -1
- package/cjs/components/floating-panel/floating-panel.css +4 -4
- package/cjs/components/form/form-item.js +6 -4
- package/cjs/components/image-viewer/slide.js +75 -56
- package/cjs/components/input/input.js +9 -2
- package/cjs/components/modal/show.d.ts +1 -1
- package/cjs/components/notice-bar/notice-bar.css +8 -0
- package/cjs/components/notice-bar/notice-bar.js +5 -3
- package/cjs/components/number-keyboard/number-keyboard.css +11 -14
- package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/cjs/components/number-keyboard/number-keyboard.js +19 -17
- package/cjs/components/passcode-input/index.d.ts +1 -1
- package/cjs/components/passcode-input/passcode-input.css +12 -12
- package/cjs/components/passcode-input/passcode-input.js +16 -8
- package/cjs/components/picker-view/wheel.js +1 -1
- package/cjs/components/rate/rate.js +7 -2
- package/cjs/components/rate/star.js +0 -10
- package/cjs/components/result/result.d.ts +1 -1
- package/cjs/components/result/result.js +7 -1
- package/cjs/components/search-bar/search-bar.js +12 -2
- package/cjs/components/switch/switch.d.ts +2 -1
- package/cjs/components/switch/switch.js +16 -3
- package/cjs/components/text-area/text-area.js +1 -0
- package/cjs/locales/base.d.ts +9 -0
- package/cjs/locales/base.js +9 -0
- package/cjs/locales/en-US.d.ts +9 -0
- package/cjs/locales/es-ES.d.ts +9 -0
- package/cjs/locales/fa-IR.d.ts +9 -0
- package/cjs/locales/fr-FR.d.ts +9 -0
- package/cjs/locales/id-ID.d.ts +9 -0
- package/cjs/locales/kk-KZ.d.ts +9 -0
- package/cjs/locales/ko-KR.d.ts +9 -0
- package/cjs/locales/zh-CN.d.ts +9 -0
- package/cjs/locales/zh-CN.js +9 -0
- package/cjs/locales/zh-HK.d.ts +9 -0
- package/cjs/locales/zh-TW.d.ts +9 -0
- package/cjs/utils/matrix.d.ts +10 -0
- package/cjs/utils/matrix.js +60 -0
- package/cjs/utils/merge-locale.d.ts +1 -1
- package/cjs/utils/merge-locale.js +15 -5
- package/cjs/utils/use-drag-and-pinch.d.ts +1 -1
- package/cjs/utils/use-props-value.js +1 -1
- package/cjs/utils/with-default-props.js +2 -6
- package/es/components/action-sheet/action-sheet.d.ts +1 -1
- package/es/components/button/button.js +1 -1
- package/es/components/calendar/calendar.d.ts +3 -3
- package/es/components/calendar/index.d.ts +1 -1
- package/es/components/cascader/cascader.d.ts +2 -0
- package/es/components/cascader/index.d.ts +1 -0
- package/es/components/cascader-view/cascader-view.d.ts +2 -1
- package/es/components/cascader-view/cascader-view.js +2 -1
- package/es/components/dialog/show.d.ts +1 -1
- package/es/components/floating-panel/floating-panel.css +4 -4
- package/es/components/form/form-item.js +5 -4
- package/es/components/image-viewer/slide.js +73 -56
- package/es/components/input/input.js +8 -2
- package/es/components/modal/show.d.ts +1 -1
- package/es/components/notice-bar/notice-bar.css +8 -0
- package/es/components/notice-bar/notice-bar.js +5 -3
- package/es/components/number-keyboard/number-keyboard.css +11 -14
- package/es/components/number-keyboard/number-keyboard.d.ts +1 -1
- package/es/components/number-keyboard/number-keyboard.js +19 -17
- package/es/components/passcode-input/index.d.ts +1 -1
- package/es/components/passcode-input/passcode-input.css +12 -12
- package/es/components/passcode-input/passcode-input.js +15 -8
- package/es/components/picker-view/wheel.js +1 -1
- package/es/components/rate/rate.js +7 -2
- package/es/components/rate/star.js +0 -10
- package/es/components/result/result.d.ts +1 -1
- package/es/components/result/result.js +6 -1
- package/es/components/search-bar/search-bar.js +12 -2
- package/es/components/switch/switch.d.ts +2 -1
- package/es/components/switch/switch.js +15 -3
- package/es/components/text-area/text-area.js +1 -0
- package/es/locales/base.d.ts +9 -0
- package/es/locales/base.js +9 -0
- package/es/locales/en-US.d.ts +9 -0
- package/es/locales/es-ES.d.ts +9 -0
- package/es/locales/fa-IR.d.ts +9 -0
- package/es/locales/fr-FR.d.ts +9 -0
- package/es/locales/id-ID.d.ts +9 -0
- package/es/locales/kk-KZ.d.ts +9 -0
- package/es/locales/ko-KR.d.ts +9 -0
- package/es/locales/zh-CN.d.ts +9 -0
- package/es/locales/zh-CN.js +9 -0
- package/es/locales/zh-HK.d.ts +9 -0
- package/es/locales/zh-TW.d.ts +9 -0
- package/es/utils/matrix.d.ts +10 -0
- package/es/utils/matrix.js +27 -0
- package/es/utils/merge-locale.d.ts +1 -1
- package/es/utils/merge-locale.js +17 -3
- package/es/utils/use-drag-and-pinch.d.ts +1 -1
- package/es/utils/use-props-value.js +1 -1
- package/es/utils/with-default-props.js +2 -4
- package/package.json +4 -4
- package/umd/antd-mobile.js +1 -1
- package/2x/umd/antd-mobile.js.LICENSE.txt +0 -35
|
@@ -57,13 +57,18 @@ const NumberKeyboard = p => {
|
|
|
57
57
|
const keys = (0, _react.useMemo)(() => {
|
|
58
58
|
const defaultKeys = ['1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
59
59
|
const keyList = randomOrder ? (0, _shuffle.shuffle)(defaultKeys) : defaultKeys;
|
|
60
|
+
const customKeys = Array.isArray(customKey) ? customKey : [customKey];
|
|
60
61
|
keyList.push('0');
|
|
61
62
|
|
|
62
63
|
if (confirmText) {
|
|
63
|
-
|
|
64
|
+
if (customKeys.length === 2) {
|
|
65
|
+
keyList.splice(9, 0, customKeys.pop());
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
keyList.push(customKeys[0] || '');
|
|
64
69
|
} else {
|
|
65
|
-
keyList.splice(9, 0,
|
|
66
|
-
keyList.push('BACKSPACE');
|
|
70
|
+
keyList.splice(9, 0, customKeys[0] || '');
|
|
71
|
+
keyList.push(customKeys[1] || 'BACKSPACE');
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
return keyList;
|
|
@@ -86,8 +91,7 @@ const NumberKeyboard = p => {
|
|
|
86
91
|
const onBackspacePressEnd = () => {
|
|
87
92
|
clearTimeout(timeoutRef.current);
|
|
88
93
|
clearInterval(intervalRef.current);
|
|
89
|
-
};
|
|
90
|
-
|
|
94
|
+
};
|
|
91
95
|
|
|
92
96
|
const onKeyPress = (e, key) => {
|
|
93
97
|
var _a, _b;
|
|
@@ -109,18 +113,17 @@ const NumberKeyboard = p => {
|
|
|
109
113
|
break;
|
|
110
114
|
|
|
111
115
|
default:
|
|
112
|
-
//
|
|
116
|
+
// onInput should't be called when customKey doesn't exist
|
|
113
117
|
if (key !== '') onInput === null || onInput === void 0 ? void 0 : onInput(key);
|
|
114
118
|
break;
|
|
115
119
|
}
|
|
116
|
-
};
|
|
117
|
-
|
|
120
|
+
};
|
|
118
121
|
|
|
119
122
|
const renderHeader = () => {
|
|
120
123
|
if (!showCloseButton && !title) return null;
|
|
121
124
|
return _react.default.createElement("div", {
|
|
122
125
|
className: (0, _classnames.default)(`${classPrefix}-header`, {
|
|
123
|
-
|
|
126
|
+
[`${classPrefix}-header-with-title`]: !!title
|
|
124
127
|
})
|
|
125
128
|
}, title && _react.default.createElement("div", {
|
|
126
129
|
className: `${classPrefix}-title`
|
|
@@ -134,15 +137,14 @@ const NumberKeyboard = p => {
|
|
|
134
137
|
role: 'button',
|
|
135
138
|
title: 'CLOSE'
|
|
136
139
|
}, _react.default.createElement(_antdMobileIcons.DownOutline, null)));
|
|
137
|
-
};
|
|
138
|
-
|
|
140
|
+
};
|
|
139
141
|
|
|
140
142
|
const renderKey = (key, index) => {
|
|
141
143
|
const isNumberKey = /^\d$/.test(key);
|
|
142
144
|
const className = (0, _classnames.default)(`${classPrefix}-key`, {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
[`${classPrefix}-key-number`]: isNumberKey,
|
|
146
|
+
[`${classPrefix}-key-sign`]: !isNumberKey && key,
|
|
147
|
+
[`${classPrefix}-key-mid`]: index === 9 && !!confirmText && keys.length < 12
|
|
146
148
|
});
|
|
147
149
|
const ariaProps = key ? {
|
|
148
150
|
role: 'button',
|
|
@@ -186,12 +188,12 @@ const NumberKeyboard = p => {
|
|
|
186
188
|
className: `${classPrefix}-wrapper`
|
|
187
189
|
}, _react.default.createElement("div", {
|
|
188
190
|
className: (0, _classnames.default)(`${classPrefix}-main`, {
|
|
189
|
-
|
|
191
|
+
[`${classPrefix}-main-confirmed-style`]: !!confirmText
|
|
190
192
|
})
|
|
191
193
|
}, keys.map(renderKey)), !!confirmText && _react.default.createElement("div", {
|
|
192
194
|
className: `${classPrefix}-confirm`
|
|
193
195
|
}, _react.default.createElement("div", {
|
|
194
|
-
className: `${classPrefix}-key
|
|
196
|
+
className: `${classPrefix}-key ${classPrefix}-key-extra ${classPrefix}-key-bs`,
|
|
195
197
|
onTouchStart: () => {
|
|
196
198
|
onBackspacePressStart();
|
|
197
199
|
},
|
|
@@ -202,7 +204,7 @@ const NumberKeyboard = p => {
|
|
|
202
204
|
title: 'BACKSPACE',
|
|
203
205
|
role: 'button'
|
|
204
206
|
}, _react.default.createElement(_antdMobileIcons.TextDeletionOutline, null)), _react.default.createElement("div", {
|
|
205
|
-
className: `${classPrefix}-key
|
|
207
|
+
className: `${classPrefix}-key ${classPrefix}-key-extra ${classPrefix}-key-ok`,
|
|
206
208
|
onTouchEnd: e => onKeyPress(e, 'OK'),
|
|
207
209
|
role: 'button'
|
|
208
210
|
}, confirmText))), props.safeArea && _react.default.createElement("div", {
|
|
@@ -25,56 +25,56 @@
|
|
|
25
25
|
background: var(--adm-color-background);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.adm-passcode-input:not(.seperated) {
|
|
28
|
+
.adm-passcode-input:not(.adm-passcode-input-seperated) {
|
|
29
29
|
border-radius: var(--border-radius);
|
|
30
30
|
overflow: hidden;
|
|
31
31
|
border: 2px solid var(--border-color);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.adm-passcode-input:not(.seperated) .adm-passcode-input-cell:not(:last-child) {
|
|
34
|
+
.adm-passcode-input:not(.adm-passcode-input-seperated) .adm-passcode-input-cell:not(:last-child) {
|
|
35
35
|
border-right: 2px solid var(--border-color);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
.adm-passcode-input:not(.seperated).focused {
|
|
38
|
+
.adm-passcode-input:not(.adm-passcode-input-seperated).adm-passcode-input-focused {
|
|
39
39
|
border-color: var(--adm-color-primary);
|
|
40
40
|
box-shadow: 0 0 4px 0 var(--adm-color-primary);
|
|
41
41
|
outline: none;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.adm-passcode-input:not(.seperated).error {
|
|
44
|
+
.adm-passcode-input:not(.adm-passcode-input-seperated).adm-passcode-input-error {
|
|
45
45
|
border-color: var(--adm-color-danger);
|
|
46
46
|
box-shadow: 0 0 4px 0 var(--adm-color-danger);
|
|
47
47
|
animation: 100ms ease-in-out 0s 3 normal none running adm-shake-horizontal;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
.adm-passcode-input.seperated .adm-passcode-input-cell {
|
|
50
|
+
.adm-passcode-input.adm-passcode-input-seperated .adm-passcode-input-cell {
|
|
51
51
|
border-radius: var(--border-radius);
|
|
52
52
|
border: 2px solid var(--border-color);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.adm-passcode-input.seperated .adm-passcode-input-cell:not(:last-child) {
|
|
55
|
+
.adm-passcode-input.adm-passcode-input-seperated .adm-passcode-input-cell:not(:last-child) {
|
|
56
56
|
margin-right: var(--cell-gap);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
.adm-passcode-input.seperated .adm-passcode-input-cell
|
|
59
|
+
.adm-passcode-input.adm-passcode-input-seperated .adm-passcode-input-cell-focused {
|
|
60
60
|
border-color: var(--adm-color-primary);
|
|
61
61
|
box-shadow: 0 0 4px 0 var(--adm-color-primary);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
.adm-passcode-input
|
|
64
|
+
.adm-passcode-input-seperated.adm-passcode-input-focused {
|
|
65
65
|
outline: none;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
.adm-passcode-input.seperated.error {
|
|
68
|
+
.adm-passcode-input.adm-passcode-input-seperated.adm-passcode-input-error {
|
|
69
69
|
animation: 100ms ease-in-out 0s 3 normal none running adm-shake-horizontal;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.adm-passcode-input.seperated.error .adm-passcode-input-cell {
|
|
72
|
+
.adm-passcode-input.adm-passcode-input-seperated.adm-passcode-input-error .adm-passcode-input-cell {
|
|
73
73
|
border-color: var(--adm-color-danger);
|
|
74
74
|
box-shadow: 0 0 4px 0 var(--adm-color-danger);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
.adm-passcode-input-cell
|
|
77
|
+
.adm-passcode-input-cell-dot::before {
|
|
78
78
|
content: '';
|
|
79
79
|
width: var(--dot-size);
|
|
80
80
|
height: var(--dot-size);
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
background: var(--adm-color-text);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
.adm-passcode-input-cell
|
|
85
|
+
.adm-passcode-input-cell-caret::after {
|
|
86
86
|
content: '';
|
|
87
87
|
width: 4px;
|
|
88
88
|
height: 1.1em;
|
|
@@ -17,6 +17,8 @@ var _bound = require("../../utils/bound");
|
|
|
17
17
|
|
|
18
18
|
var _usePropsValue = require("../../utils/use-props-value");
|
|
19
19
|
|
|
20
|
+
var _configProvider = require("../config-provider");
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
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); }
|
|
@@ -36,6 +38,9 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
36
38
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p); // 防止 length 值不合法
|
|
37
39
|
|
|
38
40
|
const cellLength = props.length > 0 && props.length < Infinity ? Math.floor(props.length) : defaultProps.length;
|
|
41
|
+
const {
|
|
42
|
+
locale
|
|
43
|
+
} = (0, _configProvider.useConfig)();
|
|
39
44
|
const [focused, setFocused] = (0, _react.useState)(false);
|
|
40
45
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
|
|
41
46
|
const rootRef = (0, _react.useRef)(null);
|
|
@@ -106,9 +111,9 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
106
111
|
for (let i = 0; i < cellLength; i++) {
|
|
107
112
|
cells.push(_react.default.createElement("div", {
|
|
108
113
|
className: (0, _classnames.default)(`${classPrefix}-cell`, {
|
|
109
|
-
caret: props.caret && caretIndex === i && focused,
|
|
110
|
-
focused: focusedIndex === i && focused,
|
|
111
|
-
dot: !props.plain && chars[i]
|
|
114
|
+
[`${classPrefix}-cell-caret`]: props.caret && caretIndex === i && focused,
|
|
115
|
+
[`${classPrefix}-cell-focused`]: focusedIndex === i && focused,
|
|
116
|
+
[`${classPrefix}-cell-dot`]: !props.plain && chars[i]
|
|
112
117
|
}),
|
|
113
118
|
key: i
|
|
114
119
|
}, chars[i] && props.plain ? chars[i] : ''));
|
|
@@ -118,16 +123,18 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
118
123
|
};
|
|
119
124
|
|
|
120
125
|
const cls = (0, _classnames.default)(classPrefix, {
|
|
121
|
-
focused: focused,
|
|
122
|
-
error: props.error,
|
|
123
|
-
seperated: props.seperated
|
|
126
|
+
[`${classPrefix}-focused`]: focused,
|
|
127
|
+
[`${classPrefix}-error`]: props.error,
|
|
128
|
+
[`${classPrefix}-seperated`]: props.seperated
|
|
124
129
|
});
|
|
125
130
|
return _react.default.createElement(_react.default.Fragment, null, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
126
131
|
ref: rootRef,
|
|
127
132
|
tabIndex: 0,
|
|
128
133
|
className: cls,
|
|
129
134
|
onFocus: onFocus,
|
|
130
|
-
onBlur: onBlur
|
|
135
|
+
onBlur: onBlur,
|
|
136
|
+
role: 'button',
|
|
137
|
+
"aria-label": locale.PasscodeInput.name
|
|
131
138
|
}, _react.default.createElement("div", {
|
|
132
139
|
className: `${classPrefix}-cell-container`
|
|
133
140
|
}, renderCells()), _react.default.createElement("input", {
|
|
@@ -139,7 +146,8 @@ const PasscodeInput = (0, _react.forwardRef)((p, ref) => {
|
|
|
139
146
|
inputMode: 'numeric',
|
|
140
147
|
onChange: e => {
|
|
141
148
|
setValue(e.target.value.slice(0, props.length));
|
|
142
|
-
}
|
|
149
|
+
},
|
|
150
|
+
"aria-hidden": true
|
|
143
151
|
}))), props.keyboard && _react.default.cloneElement(props.keyboard, {
|
|
144
152
|
visible: focused,
|
|
145
153
|
onInput: v => {
|
|
@@ -62,7 +62,7 @@ const Wheel = (0, _react.memo)(props => {
|
|
|
62
62
|
});
|
|
63
63
|
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
64
64
|
if (draggingRef.current) return;
|
|
65
|
-
if (
|
|
65
|
+
if (value === null) return;
|
|
66
66
|
const targetIndex = column.findIndex(item => item.value === value);
|
|
67
67
|
if (targetIndex < 0) return;
|
|
68
68
|
const finalPosition = targetIndex * -itemHeight.current;
|
|
@@ -49,12 +49,17 @@ const Rate = p => {
|
|
|
49
49
|
} else {
|
|
50
50
|
setValue(v);
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
},
|
|
53
|
+
role: 'radio',
|
|
54
|
+
"aria-checked": value >= v,
|
|
55
|
+
"aria-label": '' + v
|
|
53
56
|
}, props.character);
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
|
|
57
|
-
className: classPrefix
|
|
60
|
+
className: classPrefix,
|
|
61
|
+
role: 'radiogroup',
|
|
62
|
+
"aria-readonly": props.readOnly
|
|
58
63
|
}, starList.map((_, i) => _react.default.createElement("div", {
|
|
59
64
|
key: i,
|
|
60
65
|
className: (0, _classnames.default)(`${classPrefix}-box`)
|
|
@@ -10,16 +10,6 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
12
|
const Star = () => {
|
|
13
|
-
// return (
|
|
14
|
-
// <svg height='1em' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'>
|
|
15
|
-
// <title>{'star-fill\u5907\u4EFD 71'}</title>
|
|
16
|
-
// <path
|
|
17
|
-
// d='m24 36-10.52 5.53a2 2 0 0 1-2.902-2.108l2.01-11.714-8.511-8.296a2 2 0 0 1 1.108-3.411l11.762-1.71 5.26-10.657a2 2 0 0 1 3.586 0l5.26 10.658L42.815 16a2 2 0 0 1 1.108 3.411l-8.51 8.296 2.009 11.714a2 2 0 0 1-2.902 2.109L24 36Z'
|
|
18
|
-
// fill='#E5E5E5'
|
|
19
|
-
// fillRule='evenodd'
|
|
20
|
-
// />
|
|
21
|
-
// </svg>
|
|
22
|
-
// )
|
|
23
13
|
return _react.default.createElement("svg", {
|
|
24
14
|
viewBox: '0 0 42 40',
|
|
25
15
|
height: '1em',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ResultProps = {
|
|
4
|
-
status
|
|
4
|
+
status?: 'success' | 'error' | 'info' | 'waiting' | 'warning';
|
|
5
5
|
title: ReactNode;
|
|
6
6
|
description?: ReactNode;
|
|
7
7
|
icon?: ReactNode;
|
|
@@ -13,6 +13,8 @@ var _antdMobileIcons = require("antd-mobile-icons");
|
|
|
13
13
|
|
|
14
14
|
var _nativeProps = require("../../utils/native-props");
|
|
15
15
|
|
|
16
|
+
var _withDefaultProps = require("../../utils/with-default-props");
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
20
|
const classPrefix = `adm-result`;
|
|
@@ -23,8 +25,12 @@ const iconRecord = {
|
|
|
23
25
|
waiting: _antdMobileIcons.ClockCircleFill,
|
|
24
26
|
warning: _antdMobileIcons.ExclamationCircleFill
|
|
25
27
|
};
|
|
28
|
+
const defaultProps = {
|
|
29
|
+
status: 'info'
|
|
30
|
+
};
|
|
26
31
|
|
|
27
|
-
const Result =
|
|
32
|
+
const Result = p => {
|
|
33
|
+
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
28
34
|
const {
|
|
29
35
|
status,
|
|
30
36
|
title,
|
|
@@ -48,6 +48,7 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
48
48
|
const [value, setValue] = (0, _usePropsValue.usePropsValue)(props);
|
|
49
49
|
const [hasFocus, setHasFocus] = (0, _react.useState)(false);
|
|
50
50
|
const inputRef = (0, _react.useRef)(null);
|
|
51
|
+
const composingRef = (0, _react.useRef)(false);
|
|
51
52
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
52
53
|
clear: () => {
|
|
53
54
|
var _a;
|
|
@@ -140,8 +141,17 @@ const SearchBar = (0, _react.forwardRef)((p, ref) => {
|
|
|
140
141
|
onEnterPress: () => {
|
|
141
142
|
var _a, _b;
|
|
142
143
|
|
|
143
|
-
(
|
|
144
|
-
|
|
144
|
+
if (!composingRef.current) {
|
|
145
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
146
|
+
(_b = props.onSearch) === null || _b === void 0 ? void 0 : _b.call(props, value);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"aria-label": locale.SearchBar.name,
|
|
150
|
+
onCompositionStart: () => {
|
|
151
|
+
composingRef.current = true;
|
|
152
|
+
},
|
|
153
|
+
onCompositionEnd: () => {
|
|
154
|
+
composingRef.current = false;
|
|
145
155
|
}
|
|
146
156
|
})), renderCancelButton()));
|
|
147
157
|
});
|
|
@@ -5,8 +5,9 @@ export declare type SwitchProps = {
|
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
checked?: boolean;
|
|
7
7
|
defaultChecked?: boolean;
|
|
8
|
+
/** @deprecated use `onChange` instead */
|
|
8
9
|
beforeChange?: (val: boolean) => Promise<void>;
|
|
9
|
-
onChange?: (checked: boolean) => void
|
|
10
|
+
onChange?: (checked: boolean) => void | Promise<void>;
|
|
10
11
|
checkedText?: ReactNode;
|
|
11
12
|
uncheckedText?: ReactNode;
|
|
12
13
|
} & NativeProps<'--checked-color' | '--width' | '--height' | '--border-width'>;
|
|
@@ -21,6 +21,8 @@ var _spinIcon = require("./spin-icon");
|
|
|
21
21
|
|
|
22
22
|
var _configProvider = require("../config-provider");
|
|
23
23
|
|
|
24
|
+
var _validate = require("../../utils/validate");
|
|
25
|
+
|
|
24
26
|
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); }
|
|
25
27
|
|
|
26
28
|
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; }
|
|
@@ -58,14 +60,25 @@ const Switch = p => {
|
|
|
58
60
|
|
|
59
61
|
try {
|
|
60
62
|
yield props.beforeChange(nextChecked);
|
|
61
|
-
setChecked(nextChecked);
|
|
62
63
|
setChanging(false);
|
|
63
64
|
} catch (e) {
|
|
64
65
|
setChanging(false);
|
|
65
66
|
throw e;
|
|
66
67
|
}
|
|
67
|
-
}
|
|
68
|
-
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const result = setChecked(nextChecked);
|
|
71
|
+
|
|
72
|
+
if ((0, _validate.isPromise)(result)) {
|
|
73
|
+
setChanging(true);
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
yield result;
|
|
77
|
+
setChanging(false);
|
|
78
|
+
} catch (e) {
|
|
79
|
+
setChanging(false);
|
|
80
|
+
throw e;
|
|
81
|
+
}
|
|
69
82
|
}
|
|
70
83
|
});
|
|
71
84
|
}
|
|
@@ -68,6 +68,7 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
68
68
|
if (!autoSize) return;
|
|
69
69
|
const textArea = nativeTextAreaRef.current;
|
|
70
70
|
if (!textArea) return;
|
|
71
|
+
textArea.style.height = 'auto';
|
|
71
72
|
let height = textArea.scrollHeight;
|
|
72
73
|
|
|
73
74
|
if (typeof autoSize === 'object') {
|
package/2x/cjs/locales/base.d.ts
CHANGED
|
@@ -93,17 +93,26 @@ export declare const base: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
package/2x/cjs/locales/base.js
CHANGED
|
@@ -100,17 +100,26 @@ const base = {
|
|
|
100
100
|
failedToLoad: 'Failed to load',
|
|
101
101
|
retry: 'Retry'
|
|
102
102
|
},
|
|
103
|
+
Input: {
|
|
104
|
+
clear: 'clear'
|
|
105
|
+
},
|
|
103
106
|
Mask: {
|
|
104
107
|
name: 'Mask'
|
|
105
108
|
},
|
|
106
109
|
Modal: {
|
|
107
110
|
ok: 'OK'
|
|
108
111
|
},
|
|
112
|
+
PasscodeInput: {
|
|
113
|
+
name: 'Passcode Input'
|
|
114
|
+
},
|
|
109
115
|
PullToRefresh: {
|
|
110
116
|
pulling: 'Scroll down to refresh',
|
|
111
117
|
canRelease: 'Release to refresh immediately',
|
|
112
118
|
complete: 'Refresh successful'
|
|
113
119
|
},
|
|
120
|
+
SearchBar: {
|
|
121
|
+
name: 'Search Bar'
|
|
122
|
+
},
|
|
114
123
|
Slider: {
|
|
115
124
|
name: 'Slider'
|
|
116
125
|
},
|
|
@@ -93,17 +93,26 @@ declare const enUS: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const esES: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const faIR: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const frFR: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const idID: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const kkKZ: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|
|
@@ -93,17 +93,26 @@ declare const koKR: {
|
|
|
93
93
|
failedToLoad: string;
|
|
94
94
|
retry: string;
|
|
95
95
|
};
|
|
96
|
+
Input: {
|
|
97
|
+
clear: string;
|
|
98
|
+
};
|
|
96
99
|
Mask: {
|
|
97
100
|
name: string;
|
|
98
101
|
};
|
|
99
102
|
Modal: {
|
|
100
103
|
ok: string;
|
|
101
104
|
};
|
|
105
|
+
PasscodeInput: {
|
|
106
|
+
name: string;
|
|
107
|
+
};
|
|
102
108
|
PullToRefresh: {
|
|
103
109
|
pulling: string;
|
|
104
110
|
canRelease: string;
|
|
105
111
|
complete: string;
|
|
106
112
|
};
|
|
113
|
+
SearchBar: {
|
|
114
|
+
name: string;
|
|
115
|
+
};
|
|
107
116
|
Slider: {
|
|
108
117
|
name: string;
|
|
109
118
|
};
|