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
|
@@ -202,162 +202,8 @@ typeof SuppressedError === "function" ? SuppressedError : function(error, suppre
|
|
|
202
202
|
var e2 = new Error(message);
|
|
203
203
|
return e2.name = "SuppressedError", e2.error = error, e2.suppressed = suppressed, e2;
|
|
204
204
|
};
|
|
205
|
-
function mergeLocale(base2, patch) {
|
|
206
|
-
function merge2(a, b) {
|
|
207
|
-
if (typeof a !== "object" || typeof b !== "object" || Array.isArray(a) || Array.isArray(b)) {
|
|
208
|
-
return b !== void 0 ? b : a;
|
|
209
|
-
}
|
|
210
|
-
const result = {};
|
|
211
|
-
for (const key in a) {
|
|
212
|
-
if (a.hasOwnProperty(key)) {
|
|
213
|
-
result[key] = merge2(a[key], b[key]);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return result;
|
|
217
|
-
}
|
|
218
|
-
return merge2(base2, patch);
|
|
219
|
-
}
|
|
220
|
-
const typeTemplate$2 = "${label} is not a valid ${type}";
|
|
221
|
-
const base = {
|
|
222
|
-
locale: "en",
|
|
223
|
-
common: {
|
|
224
|
-
confirm: "Confirm",
|
|
225
|
-
cancel: "Cancel",
|
|
226
|
-
loading: "Loading",
|
|
227
|
-
close: "Close"
|
|
228
|
-
},
|
|
229
|
-
Calendar: {
|
|
230
|
-
title: "Date selection",
|
|
231
|
-
confirm: "Confirm",
|
|
232
|
-
start: "start",
|
|
233
|
-
end: "end",
|
|
234
|
-
today: "today",
|
|
235
|
-
markItems: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
|
|
236
|
-
yearAndMonth: "${year}/${month}"
|
|
237
|
-
},
|
|
238
|
-
Cascader: {
|
|
239
|
-
placeholder: "Selecting"
|
|
240
|
-
},
|
|
241
|
-
Dialog: {
|
|
242
|
-
ok: "OK"
|
|
243
|
-
},
|
|
244
|
-
DatePicker: {
|
|
245
|
-
tillNow: "Till Now"
|
|
246
|
-
},
|
|
247
|
-
ErrorBlock: {
|
|
248
|
-
default: {
|
|
249
|
-
title: "Oops, something went wrong",
|
|
250
|
-
description: "Please wait a minute and try again"
|
|
251
|
-
},
|
|
252
|
-
busy: {
|
|
253
|
-
title: "Oops, not loading",
|
|
254
|
-
description: "Try to refresh the page"
|
|
255
|
-
},
|
|
256
|
-
disconnected: {
|
|
257
|
-
title: "Network is busy",
|
|
258
|
-
description: "Try to refresh the page"
|
|
259
|
-
},
|
|
260
|
-
empty: {
|
|
261
|
-
title: "Hmm, couldn't find that...",
|
|
262
|
-
description: "Want to try a new search?"
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
Form: {
|
|
266
|
-
required: "Required",
|
|
267
|
-
optional: "Optional",
|
|
268
|
-
defaultValidateMessages: {
|
|
269
|
-
default: "Field validation error for ${label}",
|
|
270
|
-
required: "Please enter ${label}",
|
|
271
|
-
enum: "${label} must be one of [${enum}]",
|
|
272
|
-
whitespace: "${label} cannot be a blank character",
|
|
273
|
-
date: {
|
|
274
|
-
format: "${label} date format is invalid",
|
|
275
|
-
parse: "${label} cannot be converted to a date",
|
|
276
|
-
invalid: "${label} is an invalid date"
|
|
277
|
-
},
|
|
278
|
-
types: {
|
|
279
|
-
string: typeTemplate$2,
|
|
280
|
-
method: typeTemplate$2,
|
|
281
|
-
array: typeTemplate$2,
|
|
282
|
-
object: typeTemplate$2,
|
|
283
|
-
number: typeTemplate$2,
|
|
284
|
-
date: typeTemplate$2,
|
|
285
|
-
boolean: typeTemplate$2,
|
|
286
|
-
integer: typeTemplate$2,
|
|
287
|
-
float: typeTemplate$2,
|
|
288
|
-
regexp: typeTemplate$2,
|
|
289
|
-
email: typeTemplate$2,
|
|
290
|
-
url: typeTemplate$2,
|
|
291
|
-
hex: typeTemplate$2
|
|
292
|
-
},
|
|
293
|
-
string: {
|
|
294
|
-
len: "${label} must be ${len} characters",
|
|
295
|
-
min: "${label} must be at least ${min} characters",
|
|
296
|
-
max: "${label} must be up to ${max} characters",
|
|
297
|
-
range: "${label} must be between ${min}-${max} characters"
|
|
298
|
-
},
|
|
299
|
-
number: {
|
|
300
|
-
len: "${label} must be equal to ${len}",
|
|
301
|
-
min: "${label} must be minimum ${min}",
|
|
302
|
-
max: "${label} must be maximum ${max}",
|
|
303
|
-
range: "${label} must be between ${min}-${max}"
|
|
304
|
-
},
|
|
305
|
-
array: {
|
|
306
|
-
len: "Must be ${len} ${label}",
|
|
307
|
-
min: "At least ${min} ${label}",
|
|
308
|
-
max: "At most ${max} ${label}",
|
|
309
|
-
range: "The amount of ${label} must be between ${min}-${max}"
|
|
310
|
-
},
|
|
311
|
-
pattern: {
|
|
312
|
-
mismatch: "${label} does not match the pattern ${pattern}"
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
},
|
|
316
|
-
ImageUploader: {
|
|
317
|
-
uploading: "Uploading...",
|
|
318
|
-
upload: "Upload"
|
|
319
|
-
},
|
|
320
|
-
InfiniteScroll: {
|
|
321
|
-
noMore: "No more",
|
|
322
|
-
failedToLoad: "Failed to load",
|
|
323
|
-
retry: "Retry"
|
|
324
|
-
},
|
|
325
|
-
Input: {
|
|
326
|
-
clear: "clear"
|
|
327
|
-
},
|
|
328
|
-
Mask: {
|
|
329
|
-
name: "Mask"
|
|
330
|
-
},
|
|
331
|
-
Modal: {
|
|
332
|
-
ok: "OK"
|
|
333
|
-
},
|
|
334
|
-
PasscodeInput: {
|
|
335
|
-
name: "Passcode Input"
|
|
336
|
-
},
|
|
337
|
-
PullToRefresh: {
|
|
338
|
-
pulling: "Scroll down to refresh",
|
|
339
|
-
canRelease: "Release to refresh immediately",
|
|
340
|
-
complete: "Refresh successful"
|
|
341
|
-
},
|
|
342
|
-
SearchBar: {
|
|
343
|
-
name: "Search Bar"
|
|
344
|
-
},
|
|
345
|
-
Slider: {
|
|
346
|
-
name: "Slider"
|
|
347
|
-
},
|
|
348
|
-
Stepper: {
|
|
349
|
-
decrease: "decrease",
|
|
350
|
-
increase: "increase"
|
|
351
|
-
},
|
|
352
|
-
Switch: {
|
|
353
|
-
name: "Switch"
|
|
354
|
-
},
|
|
355
|
-
Selector: {
|
|
356
|
-
name: "Selector"
|
|
357
|
-
}
|
|
358
|
-
};
|
|
359
205
|
const typeTemplate$1 = "${label}不是一个有效的${type}";
|
|
360
|
-
const zhCN =
|
|
206
|
+
const zhCN = {
|
|
361
207
|
locale: "zh-CH",
|
|
362
208
|
common: {
|
|
363
209
|
confirm: "确定",
|
|
@@ -494,7 +340,7 @@ const zhCN = mergeLocale(base, {
|
|
|
494
340
|
Selector: {
|
|
495
341
|
name: "选择组"
|
|
496
342
|
}
|
|
497
|
-
}
|
|
343
|
+
};
|
|
498
344
|
const zhCN$1 = zhCN;
|
|
499
345
|
const defaultConfigRef = {
|
|
500
346
|
current: {
|
|
@@ -21484,6 +21330,29 @@ const InfiniteScrollContent = (props) => {
|
|
|
21484
21330
|
}
|
|
21485
21331
|
return React$1.createElement(React$1.Fragment, null, React$1.createElement("span", null, locale.common.loading), React$1.createElement(DotLoading, null));
|
|
21486
21332
|
};
|
|
21333
|
+
function useInputHandleKeyDown({
|
|
21334
|
+
onEnterPress,
|
|
21335
|
+
onKeyDown,
|
|
21336
|
+
nativeInputRef,
|
|
21337
|
+
enterKeyHint
|
|
21338
|
+
}) {
|
|
21339
|
+
const handleKeydown = (e2) => {
|
|
21340
|
+
if (onEnterPress && (e2.code === "Enter" || e2.keyCode === 13)) {
|
|
21341
|
+
onEnterPress(e2);
|
|
21342
|
+
}
|
|
21343
|
+
onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(e2);
|
|
21344
|
+
};
|
|
21345
|
+
useIsomorphicLayoutEffect$2(() => {
|
|
21346
|
+
const ele = nativeInputRef.current;
|
|
21347
|
+
if (!enterKeyHint || !ele)
|
|
21348
|
+
return;
|
|
21349
|
+
ele.setAttribute("enterkeyhint", enterKeyHint);
|
|
21350
|
+
return () => {
|
|
21351
|
+
ele.removeAttribute("enterkeyhint");
|
|
21352
|
+
};
|
|
21353
|
+
}, [enterKeyHint]);
|
|
21354
|
+
return handleKeydown;
|
|
21355
|
+
}
|
|
21487
21356
|
const classPrefix$A = `adm-input`;
|
|
21488
21357
|
const defaultProps$v = {
|
|
21489
21358
|
defaultValue: "",
|
|
@@ -21498,6 +21367,12 @@ const Input = React$1.forwardRef((p, ref) => {
|
|
|
21498
21367
|
const {
|
|
21499
21368
|
locale
|
|
21500
21369
|
} = useConfig();
|
|
21370
|
+
const handleKeydown = useInputHandleKeyDown({
|
|
21371
|
+
onEnterPress: props.onEnterPress,
|
|
21372
|
+
onKeyDown: props.onKeyDown,
|
|
21373
|
+
nativeInputRef,
|
|
21374
|
+
enterKeyHint: props.enterKeyHint
|
|
21375
|
+
});
|
|
21501
21376
|
React$1.useImperativeHandle(ref, () => ({
|
|
21502
21377
|
clear: () => {
|
|
21503
21378
|
setValue2("");
|
|
@@ -21514,23 +21389,6 @@ const Input = React$1.forwardRef((p, ref) => {
|
|
|
21514
21389
|
return nativeInputRef.current;
|
|
21515
21390
|
}
|
|
21516
21391
|
}));
|
|
21517
|
-
const handleKeydown = (e2) => {
|
|
21518
|
-
var _a;
|
|
21519
|
-
if (props.onEnterPress && (e2.code === "Enter" || e2.keyCode === 13)) {
|
|
21520
|
-
props.onEnterPress(e2);
|
|
21521
|
-
}
|
|
21522
|
-
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, e2);
|
|
21523
|
-
};
|
|
21524
|
-
useIsomorphicLayoutEffect$2(() => {
|
|
21525
|
-
var _a;
|
|
21526
|
-
if (!props.enterKeyHint)
|
|
21527
|
-
return;
|
|
21528
|
-
(_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.setAttribute("enterkeyhint", props.enterKeyHint);
|
|
21529
|
-
return () => {
|
|
21530
|
-
var _a2;
|
|
21531
|
-
(_a2 = nativeInputRef.current) === null || _a2 === void 0 ? void 0 : _a2.removeAttribute("enterkeyhint");
|
|
21532
|
-
};
|
|
21533
|
-
}, [props.enterKeyHint]);
|
|
21534
21392
|
function checkValue() {
|
|
21535
21393
|
let nextValue = value;
|
|
21536
21394
|
if (props.type === "number") {
|
|
@@ -21581,6 +21439,7 @@ const Input = React$1.forwardRef((p, ref) => {
|
|
|
21581
21439
|
max: props.max,
|
|
21582
21440
|
min: props.min,
|
|
21583
21441
|
autoComplete: props.autoComplete,
|
|
21442
|
+
enterKeyHint: props.enterKeyHint,
|
|
21584
21443
|
autoFocus: props.autoFocus,
|
|
21585
21444
|
pattern: props.pattern,
|
|
21586
21445
|
inputMode: props.inputMode,
|
|
@@ -24643,7 +24502,11 @@ const Swiper = React$1.forwardRef(staged_1((p, ref) => {
|
|
|
24643
24502
|
} = props;
|
|
24644
24503
|
const runTimeSwiper = () => {
|
|
24645
24504
|
timeoutRef.current = window.setTimeout(() => {
|
|
24646
|
-
|
|
24505
|
+
if (autoplay === "reverse") {
|
|
24506
|
+
swipePrev();
|
|
24507
|
+
} else {
|
|
24508
|
+
swipeNext();
|
|
24509
|
+
}
|
|
24647
24510
|
runTimeSwiper();
|
|
24648
24511
|
}, autoplayInterval);
|
|
24649
24512
|
};
|
|
@@ -24980,6 +24843,12 @@ const TextArea = React$1.forwardRef((p, ref) => {
|
|
|
24980
24843
|
const nativeTextAreaRef = React$1.useRef(null);
|
|
24981
24844
|
const heightRef = React$1.useRef("auto");
|
|
24982
24845
|
const hiddenTextAreaRef = React$1.useRef(null);
|
|
24846
|
+
const handleKeydown = useInputHandleKeyDown({
|
|
24847
|
+
onEnterPress: props.onEnterPress,
|
|
24848
|
+
onKeyDown: props.onKeyDown,
|
|
24849
|
+
nativeInputRef: nativeTextAreaRef,
|
|
24850
|
+
enterKeyHint: props.enterKeyHint
|
|
24851
|
+
});
|
|
24983
24852
|
React$1.useImperativeHandle(ref, () => ({
|
|
24984
24853
|
clear: () => {
|
|
24985
24854
|
setValue2("");
|
|
@@ -25076,7 +24945,8 @@ const TextArea = React$1.forwardRef((p, ref) => {
|
|
|
25076
24945
|
name: props.name,
|
|
25077
24946
|
onFocus: props.onFocus,
|
|
25078
24947
|
onBlur: props.onBlur,
|
|
25079
|
-
onClick: props.onClick
|
|
24948
|
+
onClick: props.onClick,
|
|
24949
|
+
onKeyDown: handleKeydown
|
|
25080
24950
|
}), count, autoSize && React$1.createElement("textarea", {
|
|
25081
24951
|
ref: hiddenTextAreaRef,
|
|
25082
24952
|
className: `${classPrefix$6}-element ${classPrefix$6}-element-hidden`,
|