antd-mobile 5.35.0 → 5.36.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.development.js +45 -175
- package/2x/bundle/antd-mobile.cjs.js +7 -7
- package/2x/bundle/antd-mobile.es.development.js +45 -175
- package/2x/bundle/antd-mobile.es.js +5189 -5319
- package/2x/bundle/antd-mobile.umd.development.js +45 -175
- package/2x/bundle/antd-mobile.umd.js +7 -7
- package/2x/cjs/components/button/button.d.ts +2 -2
- package/2x/cjs/components/input/input.d.ts +2 -4
- package/2x/cjs/components/input/input.js +8 -17
- package/2x/cjs/components/input/useInputHandleKeyDown.d.ts +8 -0
- package/2x/cjs/components/input/useInputHandleKeyDown.js +29 -0
- package/2x/cjs/components/result-page/result-page.d.ts +1 -1
- package/2x/cjs/components/swiper/index.d.ts +1 -1
- package/2x/cjs/components/swiper/swiper.d.ts +2 -2
- package/2x/cjs/components/swiper/swiper.js +5 -1
- package/2x/cjs/components/text-area/text-area.d.ts +6 -2
- package/2x/cjs/components/text-area/text-area.js +9 -1
- package/2x/cjs/locales/ar-SA.d.ts +139 -0
- package/2x/cjs/locales/ar-SA.js +149 -0
- package/2x/cjs/locales/de-DE.d.ts +139 -0
- package/2x/cjs/locales/de-DE.js +149 -0
- package/2x/cjs/locales/ms-MY.d.ts +139 -0
- package/2x/cjs/locales/ms-MY.js +149 -0
- package/2x/cjs/locales/pt-BR.d.ts +139 -0
- package/2x/cjs/locales/pt-BR.js +144 -0
- package/2x/cjs/locales/vi-VN.d.ts +139 -0
- package/2x/cjs/locales/vi-VN.js +149 -0
- package/2x/cjs/locales/zh-CN.d.ts +2 -138
- package/2x/cjs/locales/zh-CN.js +2 -4
- package/2x/cjs/locales/zh-CN.test.d.ts +1 -0
- package/2x/cjs/locales/zh-CN.test.js +19 -0
- package/2x/es/components/button/button.d.ts +2 -2
- package/2x/es/components/input/input.d.ts +2 -4
- package/2x/es/components/input/input.js +8 -17
- package/2x/es/components/input/useInputHandleKeyDown.d.ts +8 -0
- package/2x/es/components/input/useInputHandleKeyDown.js +23 -0
- package/2x/es/components/result-page/result-page.d.ts +1 -1
- package/2x/es/components/swiper/index.d.ts +1 -1
- package/2x/es/components/swiper/swiper.d.ts +2 -2
- package/2x/es/components/swiper/swiper.js +5 -1
- package/2x/es/components/text-area/text-area.d.ts +6 -2
- package/2x/es/components/text-area/text-area.js +9 -1
- package/2x/es/locales/ar-SA.d.ts +139 -0
- package/2x/es/locales/ar-SA.js +142 -0
- package/2x/es/locales/de-DE.d.ts +139 -0
- package/2x/es/locales/de-DE.js +142 -0
- package/2x/es/locales/ms-MY.d.ts +139 -0
- package/2x/es/locales/ms-MY.js +142 -0
- package/2x/es/locales/pt-BR.d.ts +139 -0
- package/2x/es/locales/pt-BR.js +137 -0
- package/2x/es/locales/vi-VN.d.ts +139 -0
- package/2x/es/locales/vi-VN.js +142 -0
- package/2x/es/locales/zh-CN.d.ts +2 -138
- package/2x/es/locales/zh-CN.js +2 -4
- package/2x/es/locales/zh-CN.test.d.ts +1 -0
- package/2x/es/locales/zh-CN.test.js +16 -0
- package/2x/package.json +29 -20
- package/bundle/antd-mobile.cjs.development.js +45 -175
- package/bundle/antd-mobile.cjs.js +7 -7
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +45 -175
- package/bundle/antd-mobile.es.js +5189 -5319
- package/bundle/antd-mobile.umd.development.js +45 -175
- package/bundle/antd-mobile.umd.js +7 -7
- package/cjs/components/button/button.d.ts +2 -2
- package/cjs/components/input/input.d.ts +2 -4
- package/cjs/components/input/input.js +8 -17
- package/cjs/components/input/useInputHandleKeyDown.d.ts +8 -0
- package/cjs/components/input/useInputHandleKeyDown.js +29 -0
- package/cjs/components/result-page/result-page.d.ts +1 -1
- package/cjs/components/swiper/index.d.ts +1 -1
- package/cjs/components/swiper/swiper.d.ts +2 -2
- package/cjs/components/swiper/swiper.js +5 -1
- package/cjs/components/text-area/text-area.d.ts +6 -2
- package/cjs/components/text-area/text-area.js +9 -1
- package/cjs/locales/ar-SA.d.ts +139 -0
- package/cjs/locales/ar-SA.js +149 -0
- package/cjs/locales/de-DE.d.ts +139 -0
- package/cjs/locales/de-DE.js +149 -0
- package/cjs/locales/ms-MY.d.ts +139 -0
- package/cjs/locales/ms-MY.js +149 -0
- package/cjs/locales/pt-BR.d.ts +139 -0
- package/cjs/locales/pt-BR.js +144 -0
- package/cjs/locales/vi-VN.d.ts +139 -0
- package/cjs/locales/vi-VN.js +149 -0
- package/cjs/locales/zh-CN.d.ts +2 -138
- package/cjs/locales/zh-CN.js +2 -4
- package/cjs/locales/zh-CN.test.d.ts +1 -0
- package/cjs/locales/zh-CN.test.js +19 -0
- package/es/components/button/button.d.ts +2 -2
- package/es/components/input/input.d.ts +2 -4
- package/es/components/input/input.js +8 -17
- package/es/components/input/useInputHandleKeyDown.d.ts +8 -0
- package/es/components/input/useInputHandleKeyDown.js +23 -0
- package/es/components/result-page/result-page.d.ts +1 -1
- package/es/components/swiper/index.d.ts +1 -1
- package/es/components/swiper/swiper.d.ts +2 -2
- package/es/components/swiper/swiper.js +5 -1
- package/es/components/text-area/text-area.d.ts +6 -2
- package/es/components/text-area/text-area.js +9 -1
- package/es/locales/ar-SA.d.ts +139 -0
- package/es/locales/ar-SA.js +142 -0
- package/es/locales/de-DE.d.ts +139 -0
- package/es/locales/de-DE.js +142 -0
- package/es/locales/ms-MY.d.ts +139 -0
- package/es/locales/ms-MY.js +142 -0
- package/es/locales/pt-BR.d.ts +139 -0
- package/es/locales/pt-BR.js +137 -0
- package/es/locales/vi-VN.d.ts +139 -0
- package/es/locales/vi-VN.js +142 -0
- package/es/locales/zh-CN.d.ts +2 -138
- package/es/locales/zh-CN.js +2 -4
- package/es/locales/zh-CN.test.d.ts +1 -0
- package/es/locales/zh-CN.test.js +16 -0
- package/package.json +29 -20
- package/umd/antd-mobile.js +1 -1
|
@@ -184,162 +184,8 @@ typeof SuppressedError === "function" ? SuppressedError : function(error, suppre
|
|
|
184
184
|
var e2 = new Error(message);
|
|
185
185
|
return e2.name = "SuppressedError", e2.error = error, e2.suppressed = suppressed, e2;
|
|
186
186
|
};
|
|
187
|
-
function mergeLocale(base2, patch) {
|
|
188
|
-
function merge2(a, b) {
|
|
189
|
-
if (typeof a !== "object" || typeof b !== "object" || Array.isArray(a) || Array.isArray(b)) {
|
|
190
|
-
return b !== void 0 ? b : a;
|
|
191
|
-
}
|
|
192
|
-
const result = {};
|
|
193
|
-
for (const key in a) {
|
|
194
|
-
if (a.hasOwnProperty(key)) {
|
|
195
|
-
result[key] = merge2(a[key], b[key]);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
return result;
|
|
199
|
-
}
|
|
200
|
-
return merge2(base2, patch);
|
|
201
|
-
}
|
|
202
|
-
const typeTemplate$2 = "${label} is not a valid ${type}";
|
|
203
|
-
const base = {
|
|
204
|
-
locale: "en",
|
|
205
|
-
common: {
|
|
206
|
-
confirm: "Confirm",
|
|
207
|
-
cancel: "Cancel",
|
|
208
|
-
loading: "Loading",
|
|
209
|
-
close: "Close"
|
|
210
|
-
},
|
|
211
|
-
Calendar: {
|
|
212
|
-
title: "Date selection",
|
|
213
|
-
confirm: "Confirm",
|
|
214
|
-
start: "start",
|
|
215
|
-
end: "end",
|
|
216
|
-
today: "today",
|
|
217
|
-
markItems: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
|
218
|
-
yearAndMonth: "${year}/${month}"
|
|
219
|
-
},
|
|
220
|
-
Cascader: {
|
|
221
|
-
placeholder: "Selecting"
|
|
222
|
-
},
|
|
223
|
-
Dialog: {
|
|
224
|
-
ok: "OK"
|
|
225
|
-
},
|
|
226
|
-
DatePicker: {
|
|
227
|
-
tillNow: "Till Now"
|
|
228
|
-
},
|
|
229
|
-
ErrorBlock: {
|
|
230
|
-
default: {
|
|
231
|
-
title: "Oops, something went wrong",
|
|
232
|
-
description: "Please wait a minute and try again"
|
|
233
|
-
},
|
|
234
|
-
busy: {
|
|
235
|
-
title: "Oops, not loading",
|
|
236
|
-
description: "Try to refresh the page"
|
|
237
|
-
},
|
|
238
|
-
disconnected: {
|
|
239
|
-
title: "Network is busy",
|
|
240
|
-
description: "Try to refresh the page"
|
|
241
|
-
},
|
|
242
|
-
empty: {
|
|
243
|
-
title: "Hmm, couldn't find that...",
|
|
244
|
-
description: "Want to try a new search?"
|
|
245
|
-
}
|
|
246
|
-
},
|
|
247
|
-
Form: {
|
|
248
|
-
required: "Required",
|
|
249
|
-
optional: "Optional",
|
|
250
|
-
defaultValidateMessages: {
|
|
251
|
-
default: "Field validation error for ${label}",
|
|
252
|
-
required: "Please enter ${label}",
|
|
253
|
-
enum: "${label} must be one of [${enum}]",
|
|
254
|
-
whitespace: "${label} cannot be a blank character",
|
|
255
|
-
date: {
|
|
256
|
-
format: "${label} date format is invalid",
|
|
257
|
-
parse: "${label} cannot be converted to a date",
|
|
258
|
-
invalid: "${label} is an invalid date"
|
|
259
|
-
},
|
|
260
|
-
types: {
|
|
261
|
-
string: typeTemplate$2,
|
|
262
|
-
method: typeTemplate$2,
|
|
263
|
-
array: typeTemplate$2,
|
|
264
|
-
object: typeTemplate$2,
|
|
265
|
-
number: typeTemplate$2,
|
|
266
|
-
date: typeTemplate$2,
|
|
267
|
-
boolean: typeTemplate$2,
|
|
268
|
-
integer: typeTemplate$2,
|
|
269
|
-
float: typeTemplate$2,
|
|
270
|
-
regexp: typeTemplate$2,
|
|
271
|
-
email: typeTemplate$2,
|
|
272
|
-
url: typeTemplate$2,
|
|
273
|
-
hex: typeTemplate$2
|
|
274
|
-
},
|
|
275
|
-
string: {
|
|
276
|
-
len: "${label} must be ${len} characters",
|
|
277
|
-
min: "${label} must be at least ${min} characters",
|
|
278
|
-
max: "${label} must be up to ${max} characters",
|
|
279
|
-
range: "${label} must be between ${min}-${max} characters"
|
|
280
|
-
},
|
|
281
|
-
number: {
|
|
282
|
-
len: "${label} must be equal to ${len}",
|
|
283
|
-
min: "${label} must be minimum ${min}",
|
|
284
|
-
max: "${label} must be maximum ${max}",
|
|
285
|
-
range: "${label} must be between ${min}-${max}"
|
|
286
|
-
},
|
|
287
|
-
array: {
|
|
288
|
-
len: "Must be ${len} ${label}",
|
|
289
|
-
min: "At least ${min} ${label}",
|
|
290
|
-
max: "At most ${max} ${label}",
|
|
291
|
-
range: "The amount of ${label} must be between ${min}-${max}"
|
|
292
|
-
},
|
|
293
|
-
pattern: {
|
|
294
|
-
mismatch: "${label} does not match the pattern ${pattern}"
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
ImageUploader: {
|
|
299
|
-
uploading: "Uploading...",
|
|
300
|
-
upload: "Upload"
|
|
301
|
-
},
|
|
302
|
-
InfiniteScroll: {
|
|
303
|
-
noMore: "No more",
|
|
304
|
-
failedToLoad: "Failed to load",
|
|
305
|
-
retry: "Retry"
|
|
306
|
-
},
|
|
307
|
-
Input: {
|
|
308
|
-
clear: "clear"
|
|
309
|
-
},
|
|
310
|
-
Mask: {
|
|
311
|
-
name: "Mask"
|
|
312
|
-
},
|
|
313
|
-
Modal: {
|
|
314
|
-
ok: "OK"
|
|
315
|
-
},
|
|
316
|
-
PasscodeInput: {
|
|
317
|
-
name: "Passcode Input"
|
|
318
|
-
},
|
|
319
|
-
PullToRefresh: {
|
|
320
|
-
pulling: "Scroll down to refresh",
|
|
321
|
-
canRelease: "Release to refresh immediately",
|
|
322
|
-
complete: "Refresh successful"
|
|
323
|
-
},
|
|
324
|
-
SearchBar: {
|
|
325
|
-
name: "Search Bar"
|
|
326
|
-
},
|
|
327
|
-
Slider: {
|
|
328
|
-
name: "Slider"
|
|
329
|
-
},
|
|
330
|
-
Stepper: {
|
|
331
|
-
decrease: "decrease",
|
|
332
|
-
increase: "increase"
|
|
333
|
-
},
|
|
334
|
-
Switch: {
|
|
335
|
-
name: "Switch"
|
|
336
|
-
},
|
|
337
|
-
Selector: {
|
|
338
|
-
name: "Selector"
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
187
|
const typeTemplate$1 = "${label}不是一个有效的${type}";
|
|
342
|
-
const zhCN =
|
|
188
|
+
const zhCN = {
|
|
343
189
|
locale: "zh-CH",
|
|
344
190
|
common: {
|
|
345
191
|
confirm: "确定",
|
|
@@ -476,7 +322,7 @@ const zhCN = mergeLocale(base, {
|
|
|
476
322
|
Selector: {
|
|
477
323
|
name: "选择组"
|
|
478
324
|
}
|
|
479
|
-
}
|
|
325
|
+
};
|
|
480
326
|
const zhCN$1 = zhCN;
|
|
481
327
|
const defaultConfigRef = {
|
|
482
328
|
current: {
|
|
@@ -21466,6 +21312,29 @@ const InfiniteScrollContent = (props) => {
|
|
|
21466
21312
|
}
|
|
21467
21313
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement("span", null, locale.common.loading), React__default.createElement(DotLoading, null));
|
|
21468
21314
|
};
|
|
21315
|
+
function useInputHandleKeyDown({
|
|
21316
|
+
onEnterPress,
|
|
21317
|
+
onKeyDown,
|
|
21318
|
+
nativeInputRef,
|
|
21319
|
+
enterKeyHint
|
|
21320
|
+
}) {
|
|
21321
|
+
const handleKeydown = (e2) => {
|
|
21322
|
+
if (onEnterPress && (e2.code === "Enter" || e2.keyCode === 13)) {
|
|
21323
|
+
onEnterPress(e2);
|
|
21324
|
+
}
|
|
21325
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e2);
|
|
21326
|
+
};
|
|
21327
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
21328
|
+
const ele = nativeInputRef.current;
|
|
21329
|
+
if (!enterKeyHint || !ele)
|
|
21330
|
+
return;
|
|
21331
|
+
ele.setAttribute("enterkeyhint", enterKeyHint);
|
|
21332
|
+
return () => {
|
|
21333
|
+
ele.removeAttribute("enterkeyhint");
|
|
21334
|
+
};
|
|
21335
|
+
}, [enterKeyHint]);
|
|
21336
|
+
return handleKeydown;
|
|
21337
|
+
}
|
|
21469
21338
|
const classPrefix$A = `adm-input`;
|
|
21470
21339
|
const defaultProps$v = {
|
|
21471
21340
|
defaultValue: "",
|
|
@@ -21480,6 +21349,12 @@ const Input = forwardRef((p, ref) => {
|
|
|
21480
21349
|
const {
|
|
21481
21350
|
locale
|
|
21482
21351
|
} = useConfig();
|
|
21352
|
+
const handleKeydown = useInputHandleKeyDown({
|
|
21353
|
+
onEnterPress: props.onEnterPress,
|
|
21354
|
+
onKeyDown: props.onKeyDown,
|
|
21355
|
+
nativeInputRef,
|
|
21356
|
+
enterKeyHint: props.enterKeyHint
|
|
21357
|
+
});
|
|
21483
21358
|
useImperativeHandle(ref, () => ({
|
|
21484
21359
|
clear: () => {
|
|
21485
21360
|
setValue2("");
|
|
@@ -21496,23 +21371,6 @@ const Input = forwardRef((p, ref) => {
|
|
|
21496
21371
|
return nativeInputRef.current;
|
|
21497
21372
|
}
|
|
21498
21373
|
}));
|
|
21499
|
-
const handleKeydown = (e2) => {
|
|
21500
|
-
var _a;
|
|
21501
|
-
if (props.onEnterPress && (e2.code === "Enter" || e2.keyCode === 13)) {
|
|
21502
|
-
props.onEnterPress(e2);
|
|
21503
|
-
}
|
|
21504
|
-
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e2);
|
|
21505
|
-
};
|
|
21506
|
-
useIsomorphicLayoutEffect$2(() => {
|
|
21507
|
-
var _a;
|
|
21508
|
-
if (!props.enterKeyHint)
|
|
21509
|
-
return;
|
|
21510
|
-
(_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.setAttribute("enterkeyhint", props.enterKeyHint);
|
|
21511
|
-
return () => {
|
|
21512
|
-
var _a2;
|
|
21513
|
-
(_a2 = nativeInputRef.current) === null || _a2 === void 0 ? void 0 : _a2.removeAttribute("enterkeyhint");
|
|
21514
|
-
};
|
|
21515
|
-
}, [props.enterKeyHint]);
|
|
21516
21374
|
function checkValue() {
|
|
21517
21375
|
let nextValue = value;
|
|
21518
21376
|
if (props.type === "number") {
|
|
@@ -21563,6 +21421,7 @@ const Input = forwardRef((p, ref) => {
|
|
|
21563
21421
|
max: props.max,
|
|
21564
21422
|
min: props.min,
|
|
21565
21423
|
autoComplete: props.autoComplete,
|
|
21424
|
+
enterKeyHint: props.enterKeyHint,
|
|
21566
21425
|
autoFocus: props.autoFocus,
|
|
21567
21426
|
pattern: props.pattern,
|
|
21568
21427
|
inputMode: props.inputMode,
|
|
@@ -24625,7 +24484,11 @@ const Swiper = forwardRef(staged_1((p, ref) => {
|
|
|
24625
24484
|
} = props;
|
|
24626
24485
|
const runTimeSwiper = () => {
|
|
24627
24486
|
timeoutRef.current = window.setTimeout(() => {
|
|
24628
|
-
|
|
24487
|
+
if (autoplay === "reverse") {
|
|
24488
|
+
swipePrev();
|
|
24489
|
+
} else {
|
|
24490
|
+
swipeNext();
|
|
24491
|
+
}
|
|
24629
24492
|
runTimeSwiper();
|
|
24630
24493
|
}, autoplayInterval);
|
|
24631
24494
|
};
|
|
@@ -24962,6 +24825,12 @@ const TextArea = forwardRef((p, ref) => {
|
|
|
24962
24825
|
const nativeTextAreaRef = useRef(null);
|
|
24963
24826
|
const heightRef = useRef("auto");
|
|
24964
24827
|
const hiddenTextAreaRef = useRef(null);
|
|
24828
|
+
const handleKeydown = useInputHandleKeyDown({
|
|
24829
|
+
onEnterPress: props.onEnterPress,
|
|
24830
|
+
onKeyDown: props.onKeyDown,
|
|
24831
|
+
nativeInputRef: nativeTextAreaRef,
|
|
24832
|
+
enterKeyHint: props.enterKeyHint
|
|
24833
|
+
});
|
|
24965
24834
|
useImperativeHandle(ref, () => ({
|
|
24966
24835
|
clear: () => {
|
|
24967
24836
|
setValue2("");
|
|
@@ -25058,7 +24927,8 @@ const TextArea = forwardRef((p, ref) => {
|
|
|
25058
24927
|
name: props.name,
|
|
25059
24928
|
onFocus: props.onFocus,
|
|
25060
24929
|
onBlur: props.onBlur,
|
|
25061
|
-
onClick: props.onClick
|
|
24930
|
+
onClick: props.onClick,
|
|
24931
|
+
onKeyDown: handleKeydown
|
|
25062
24932
|
}), count, autoSize && React__default.createElement("textarea", {
|
|
25063
24933
|
ref: hiddenTextAreaRef,
|
|
25064
24934
|
className: `${classPrefix$6}-element ${classPrefix$6}-element-hidden`,
|