antd-mobile 5.7.0 → 5.8.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/cjs/components/collapse/collapse.js +7 -0
- package/2x/cjs/components/dialog/confirm.js +9 -1
- package/2x/cjs/components/dialog/dialog.js +2 -2
- package/2x/cjs/components/form/form-item.d.ts +1 -1
- package/2x/cjs/components/form/form-item.js +6 -3
- package/2x/cjs/components/input/input.d.ts +3 -2
- package/2x/cjs/components/input/input.js +6 -0
- package/2x/cjs/components/modal/confirm.js +9 -1
- package/2x/cjs/components/modal/modal.js +2 -2
- package/2x/cjs/components/passcode-input/passcode-input.js +1 -1
- package/2x/cjs/components/popover/popover.js +6 -6
- package/2x/cjs/components/pull-to-refresh/pull-to-refresh.js +11 -1
- package/2x/cjs/components/result/result.d.ts +2 -2
- package/2x/cjs/components/search-bar/search-bar.js +7 -0
- package/2x/cjs/components/slider/slider.css +2 -0
- package/2x/cjs/components/slider/slider.d.ts +2 -1
- package/2x/cjs/components/slider/slider.js +3 -1
- package/2x/cjs/components/slider/thumb.d.ts +2 -1
- package/2x/cjs/components/slider/thumb.js +3 -2
- package/2x/cjs/components/text-area/text-area.d.ts +2 -2
- package/2x/cjs/components/text-area/text-area.js +1 -0
- package/2x/cjs/components/virtual-input/virtual-input.js +25 -14
- package/2x/cjs/locales/base.d.ts +7 -0
- package/2x/cjs/locales/base.js +8 -1
- package/2x/cjs/locales/en-US.d.ts +7 -0
- package/2x/cjs/locales/fa-IR.d.ts +102 -0
- package/2x/cjs/locales/fa-IR.js +109 -0
- package/2x/cjs/locales/zh-CN.d.ts +7 -0
- package/2x/cjs/locales/zh-CN.js +8 -1
- package/2x/cjs/locales/zh-HK.d.ts +102 -0
- package/2x/cjs/locales/zh-HK.js +59 -0
- package/2x/cjs/locales/zh-TW.d.ts +102 -0
- package/2x/cjs/locales/zh-TW.js +59 -0
- package/2x/es/components/collapse/collapse.js +7 -0
- package/2x/es/components/dialog/confirm.js +8 -1
- package/2x/es/components/dialog/dialog.js +2 -2
- package/2x/es/components/form/form-item.d.ts +1 -1
- package/2x/es/components/form/form-item.js +6 -3
- package/2x/es/components/input/input.d.ts +3 -2
- package/2x/es/components/input/input.js +6 -0
- package/2x/es/components/modal/confirm.js +8 -1
- package/2x/es/components/modal/modal.js +2 -2
- package/2x/es/components/passcode-input/passcode-input.js +1 -1
- package/2x/es/components/popover/popover.js +1 -1
- package/2x/es/components/pull-to-refresh/pull-to-refresh.js +10 -1
- package/2x/es/components/result/result.d.ts +2 -2
- package/2x/es/components/search-bar/search-bar.js +7 -0
- package/2x/es/components/slider/slider.css +2 -0
- package/2x/es/components/slider/slider.d.ts +2 -1
- package/2x/es/components/slider/slider.js +3 -1
- package/2x/es/components/slider/thumb.d.ts +2 -1
- package/2x/es/components/slider/thumb.js +3 -2
- package/2x/es/components/text-area/text-area.d.ts +2 -2
- package/2x/es/components/text-area/text-area.js +1 -0
- package/2x/es/components/virtual-input/virtual-input.js +23 -14
- package/2x/es/locales/base.d.ts +7 -0
- package/2x/es/locales/base.js +8 -1
- package/2x/es/locales/en-US.d.ts +7 -0
- package/2x/es/locales/fa-IR.d.ts +102 -0
- package/2x/es/locales/fa-IR.js +99 -0
- package/2x/es/locales/zh-CN.d.ts +7 -0
- package/2x/es/locales/zh-CN.js +8 -1
- package/2x/es/locales/zh-HK.d.ts +102 -0
- package/2x/es/locales/zh-HK.js +49 -0
- package/2x/es/locales/zh-TW.d.ts +102 -0
- package/2x/es/locales/zh-TW.js +49 -0
- package/2x/package.json +1 -1
- package/cjs/components/collapse/collapse.js +7 -0
- package/cjs/components/dialog/confirm.js +9 -1
- package/cjs/components/dialog/dialog.js +2 -2
- package/cjs/components/form/form-item.d.ts +1 -1
- package/cjs/components/form/form-item.js +6 -3
- package/cjs/components/input/input.d.ts +3 -2
- package/cjs/components/input/input.js +6 -0
- package/cjs/components/modal/confirm.js +9 -1
- package/cjs/components/modal/modal.js +2 -2
- package/cjs/components/passcode-input/passcode-input.js +1 -1
- package/cjs/components/popover/popover.js +6 -6
- package/cjs/components/pull-to-refresh/pull-to-refresh.js +11 -1
- package/cjs/components/result/result.d.ts +2 -2
- package/cjs/components/search-bar/search-bar.js +7 -0
- package/cjs/components/slider/slider.css +2 -0
- package/cjs/components/slider/slider.d.ts +2 -1
- package/cjs/components/slider/slider.js +3 -1
- package/cjs/components/slider/thumb.d.ts +2 -1
- package/cjs/components/slider/thumb.js +3 -2
- package/cjs/components/text-area/text-area.d.ts +2 -2
- package/cjs/components/text-area/text-area.js +1 -0
- package/cjs/components/virtual-input/virtual-input.js +25 -14
- package/cjs/locales/base.d.ts +7 -0
- package/cjs/locales/base.js +8 -1
- package/cjs/locales/en-US.d.ts +7 -0
- package/cjs/locales/fa-IR.d.ts +102 -0
- package/cjs/locales/fa-IR.js +109 -0
- package/cjs/locales/zh-CN.d.ts +7 -0
- package/cjs/locales/zh-CN.js +8 -1
- package/cjs/locales/zh-HK.d.ts +102 -0
- package/cjs/locales/zh-HK.js +59 -0
- package/cjs/locales/zh-TW.d.ts +102 -0
- package/cjs/locales/zh-TW.js +59 -0
- package/es/components/collapse/collapse.js +7 -0
- package/es/components/dialog/confirm.js +8 -1
- package/es/components/dialog/dialog.js +2 -2
- package/es/components/form/form-item.d.ts +1 -1
- package/es/components/form/form-item.js +6 -3
- package/es/components/input/input.d.ts +3 -2
- package/es/components/input/input.js +6 -0
- package/es/components/modal/confirm.js +8 -1
- package/es/components/modal/modal.js +2 -2
- package/es/components/passcode-input/passcode-input.js +1 -1
- package/es/components/popover/popover.js +1 -1
- package/es/components/pull-to-refresh/pull-to-refresh.js +10 -1
- package/es/components/result/result.d.ts +2 -2
- package/es/components/search-bar/search-bar.js +7 -0
- package/es/components/slider/slider.css +2 -0
- package/es/components/slider/slider.d.ts +2 -1
- package/es/components/slider/slider.js +3 -1
- package/es/components/slider/thumb.d.ts +2 -1
- package/es/components/slider/thumb.js +3 -2
- package/es/components/text-area/text-area.d.ts +2 -2
- package/es/components/text-area/text-area.js +1 -0
- package/es/components/virtual-input/virtual-input.js +23 -14
- package/es/locales/base.d.ts +7 -0
- package/es/locales/base.js +8 -1
- package/es/locales/en-US.d.ts +7 -0
- package/es/locales/fa-IR.d.ts +102 -0
- package/es/locales/fa-IR.js +99 -0
- package/es/locales/zh-CN.d.ts +7 -0
- package/es/locales/zh-CN.js +8 -1
- package/es/locales/zh-HK.d.ts +102 -0
- package/es/locales/zh-HK.js +49 -0
- package/es/locales/zh-TW.d.ts +102 -0
- package/es/locales/zh-TW.js +49 -0
- package/package.json +1 -1
- package/umd/antd-mobile.js +1 -1
- package/2x/cjs/components/popover/temp-floating-ui.min.d.ts +0 -1
- package/2x/cjs/components/popover/temp-floating-ui.min.js +0 -1
- package/2x/es/components/popover/temp-floating-ui.min.d.ts +0 -1
- package/2x/es/components/popover/temp-floating-ui.min.js +0 -1
- package/cjs/components/popover/temp-floating-ui.min.d.ts +0 -1
- package/cjs/components/popover/temp-floating-ui.min.js +0 -1
- package/es/components/popover/temp-floating-ui.min.d.ts +0 -1
- package/es/components/popover/temp-floating-ui.min.js +0 -1
|
@@ -28,7 +28,12 @@ export const Input = forwardRef((p, ref) => {
|
|
|
28
28
|
var _a;
|
|
29
29
|
|
|
30
30
|
(_a = nativeInputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
get nativeElement() {
|
|
34
|
+
return nativeInputRef.current;
|
|
31
35
|
}
|
|
36
|
+
|
|
32
37
|
}));
|
|
33
38
|
|
|
34
39
|
const handleKeydown = e => {
|
|
@@ -96,6 +101,7 @@ export const Input = forwardRef((p, ref) => {
|
|
|
96
101
|
max: props.max,
|
|
97
102
|
min: props.min,
|
|
98
103
|
autoComplete: props.autoComplete,
|
|
104
|
+
autoFocus: props.autoFocus,
|
|
99
105
|
pattern: props.pattern,
|
|
100
106
|
inputMode: props.inputMode,
|
|
101
107
|
type: props.type,
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { show } from './show';
|
|
3
3
|
import { mergeProps } from '../../utils/with-default-props';
|
|
4
|
+
import { getDefaultConfig } from '../config-provider';
|
|
4
5
|
const defaultProps = {
|
|
5
6
|
confirmText: '确认',
|
|
6
7
|
cancelText: '取消'
|
|
7
8
|
};
|
|
8
9
|
export function confirm(p) {
|
|
9
|
-
const
|
|
10
|
+
const {
|
|
11
|
+
locale
|
|
12
|
+
} = getDefaultConfig();
|
|
13
|
+
const props = mergeProps(defaultProps, {
|
|
14
|
+
confirmText: locale.common.confirm,
|
|
15
|
+
cancelText: locale.common.cancel
|
|
16
|
+
}, p);
|
|
10
17
|
return new Promise(resolve => {
|
|
11
18
|
show(Object.assign(Object.assign({}, props), {
|
|
12
19
|
closeOnAction: true,
|
|
@@ -27,7 +27,7 @@ export const PasscodeInput = forwardRef((p, ref) => {
|
|
|
27
27
|
if (value.length >= cellLength) {
|
|
28
28
|
(_a = props.onFill) === null || _a === void 0 ? void 0 : _a.call(props, value);
|
|
29
29
|
}
|
|
30
|
-
}, [
|
|
30
|
+
}, [value, cellLength]);
|
|
31
31
|
|
|
32
32
|
const onFocus = () => {
|
|
33
33
|
var _a, _b;
|
|
@@ -7,7 +7,7 @@ import { withNativeProps } from '../../utils/native-props';
|
|
|
7
7
|
import { withStopPropagation } from '../../utils/with-stop-propagation';
|
|
8
8
|
import { Arrow } from './arrow';
|
|
9
9
|
import { renderToContainer } from '../../utils/render-to-container';
|
|
10
|
-
import { arrow, computePosition, flip, offset, autoUpdate, hide, shift, limitShift } from '
|
|
10
|
+
import { arrow, computePosition, flip, offset, autoUpdate, hide, shift, limitShift } from '@floating-ui/dom';
|
|
11
11
|
import { Wrapper } from './wrapper';
|
|
12
12
|
import { useShouldRender } from '../../utils/should-render';
|
|
13
13
|
import { useClickAway, useIsomorphicLayoutEffect } from 'ahooks';
|
|
@@ -7,6 +7,7 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
7
7
|
import { supportsPassive } from '../../utils/supports-passive';
|
|
8
8
|
import { convertPx } from '../../utils/convert-px';
|
|
9
9
|
import { rubberbandIfOutOfBounds } from '../../utils/rubberband';
|
|
10
|
+
import { useConfig } from '../config-provider';
|
|
10
11
|
import { sleep } from '../../utils/sleep';
|
|
11
12
|
const classPrefix = `adm-pull-to-refresh`;
|
|
12
13
|
export const defaultProps = {
|
|
@@ -21,7 +22,15 @@ export const defaultProps = {
|
|
|
21
22
|
export const PullToRefresh = p => {
|
|
22
23
|
var _a, _b;
|
|
23
24
|
|
|
24
|
-
const
|
|
25
|
+
const {
|
|
26
|
+
locale
|
|
27
|
+
} = useConfig();
|
|
28
|
+
const props = mergeProps(defaultProps, {
|
|
29
|
+
refreshingText: locale.common.loading,
|
|
30
|
+
pullingText: locale.PullToRefresh.pulling,
|
|
31
|
+
canReleaseText: locale.PullToRefresh.canRelease,
|
|
32
|
+
completeText: locale.PullToRefresh.complete
|
|
33
|
+
}, p);
|
|
25
34
|
const headHeight = (_a = props.headHeight) !== null && _a !== void 0 ? _a : convertPx(40);
|
|
26
35
|
const threshold = (_b = props.threshold) !== null && _b !== void 0 ? _b : convertPx(60);
|
|
27
36
|
const [status, setStatus] = useState('pulling');
|
|
@@ -2,8 +2,8 @@ import { FC, ReactNode } from 'react';
|
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type ResultProps = {
|
|
4
4
|
status: 'success' | 'error' | 'info' | 'waiting' | 'warning';
|
|
5
|
-
title:
|
|
6
|
-
description?:
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
7
|
icon?: ReactNode;
|
|
8
8
|
} & NativeProps;
|
|
9
9
|
export declare const Result: FC<ResultProps>;
|
|
@@ -40,7 +40,14 @@ export const SearchBar = forwardRef((p, ref) => {
|
|
|
40
40
|
var _a;
|
|
41
41
|
|
|
42
42
|
return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
get nativeElement() {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
|
|
48
|
+
return (_b = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.nativeElement) !== null && _b !== void 0 ? _b : null;
|
|
43
49
|
}
|
|
50
|
+
|
|
44
51
|
}));
|
|
45
52
|
|
|
46
53
|
const renderCancelButton = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
import { SliderMarks } from './marks';
|
|
4
4
|
export declare type SliderValue = number | [number, number];
|
|
@@ -12,6 +12,7 @@ export declare type SliderProps = {
|
|
|
12
12
|
ticks?: boolean;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
range?: boolean;
|
|
15
|
+
icon?: React.ReactNode;
|
|
15
16
|
onChange?: (value: SliderValue) => void;
|
|
16
17
|
onAfterChange?: (value: SliderValue) => void;
|
|
17
18
|
} & NativeProps<'--fill-color'>;
|
|
@@ -26,7 +26,8 @@ export const Slider = p => {
|
|
|
26
26
|
disabled,
|
|
27
27
|
marks,
|
|
28
28
|
ticks,
|
|
29
|
-
step
|
|
29
|
+
step,
|
|
30
|
+
icon
|
|
30
31
|
} = props;
|
|
31
32
|
|
|
32
33
|
function sortValue(val) {
|
|
@@ -126,6 +127,7 @@ export const Slider = p => {
|
|
|
126
127
|
|
|
127
128
|
const renderThumb = index => {
|
|
128
129
|
return React.createElement(Thumb, {
|
|
130
|
+
icon: icon,
|
|
129
131
|
key: index,
|
|
130
132
|
value: sliderValue[index],
|
|
131
133
|
min: min,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, RefObject } from 'react';
|
|
1
|
+
import React, { FC, RefObject } from 'react';
|
|
2
2
|
declare type ThumbProps = {
|
|
3
3
|
value: number;
|
|
4
4
|
min: number;
|
|
@@ -6,6 +6,7 @@ declare type ThumbProps = {
|
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
onDrag: (value: number, first: boolean, last: boolean) => void;
|
|
8
8
|
trackRef: RefObject<HTMLDivElement>;
|
|
9
|
+
icon?: React.ReactNode;
|
|
9
10
|
};
|
|
10
11
|
declare const Thumb: FC<ThumbProps>;
|
|
11
12
|
export default Thumb;
|
|
@@ -9,7 +9,8 @@ const Thumb = props => {
|
|
|
9
9
|
min,
|
|
10
10
|
max,
|
|
11
11
|
disabled,
|
|
12
|
-
onDrag
|
|
12
|
+
onDrag,
|
|
13
|
+
icon
|
|
13
14
|
} = props;
|
|
14
15
|
const prevValue = useRef(value);
|
|
15
16
|
|
|
@@ -45,7 +46,7 @@ const Thumb = props => {
|
|
|
45
46
|
style: currentPosition()
|
|
46
47
|
}, bind()), React.createElement("div", {
|
|
47
48
|
className: `${classPrefix}-thumb`
|
|
48
|
-
}, React.createElement(ThumbIcon, {
|
|
49
|
+
}, icon ? icon : React.createElement(ThumbIcon, {
|
|
49
50
|
className: `${classPrefix}-thumb-icon`
|
|
50
51
|
})));
|
|
51
52
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import { NativeProps } from '../../utils/native-props';
|
|
4
|
-
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
4
|
+
export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd'> & {
|
|
5
5
|
onChange?: (val: string) => void;
|
|
6
6
|
value?: string;
|
|
7
7
|
defaultValue?: string;
|
|
@@ -20,7 +20,7 @@ export declare type TextAreaRef = {
|
|
|
20
20
|
focus: () => void;
|
|
21
21
|
blur: () => void;
|
|
22
22
|
};
|
|
23
|
-
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "readOnly"> & {
|
|
23
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
|
|
24
24
|
onChange?: ((val: string) => void) | undefined;
|
|
25
25
|
value?: string | undefined;
|
|
26
26
|
defaultValue?: string | undefined;
|
|
@@ -111,6 +111,7 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
111
111
|
(_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
112
112
|
},
|
|
113
113
|
autoComplete: props.autoComplete,
|
|
114
|
+
autoFocus: props.autoFocus,
|
|
114
115
|
disabled: props.disabled,
|
|
115
116
|
readOnly: props.readOnly,
|
|
116
117
|
onFocus: props.onFocus,
|
|
@@ -64,6 +64,28 @@ export const VirtualInput = forwardRef((p, ref) => {
|
|
|
64
64
|
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
const keyboard = props.keyboard;
|
|
68
|
+
const keyboardElement = keyboard && React.cloneElement(keyboard, {
|
|
69
|
+
onInput: v => {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
|
|
72
|
+
setValue(value + v);
|
|
73
|
+
(_b = (_a = keyboard.props).onInput) === null || _b === void 0 ? void 0 : _b.call(_a, v);
|
|
74
|
+
},
|
|
75
|
+
onDelete: () => {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
|
|
78
|
+
setValue(value.slice(0, -1));
|
|
79
|
+
(_b = (_a = keyboard.props).onDelete) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
80
|
+
},
|
|
81
|
+
visible: hasFocus,
|
|
82
|
+
onClose: () => {
|
|
83
|
+
var _a, _b, _c;
|
|
84
|
+
|
|
85
|
+
(_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
86
|
+
(_c = (_b = keyboard.props).onClose) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
67
89
|
return withNativeProps(props, React.createElement("div", {
|
|
68
90
|
ref: rootRef,
|
|
69
91
|
className: classNames(classPrefix, {
|
|
@@ -91,18 +113,5 @@ export const VirtualInput = forwardRef((p, ref) => {
|
|
|
91
113
|
}
|
|
92
114
|
}, React.createElement(CloseCircleFill, null)), !value && React.createElement("div", {
|
|
93
115
|
className: `${classPrefix}-placeholder`
|
|
94
|
-
}, props.placeholder),
|
|
95
|
-
onInput: v => {
|
|
96
|
-
setValue(value + v);
|
|
97
|
-
},
|
|
98
|
-
onDelete: () => {
|
|
99
|
-
setValue(value.slice(0, -1));
|
|
100
|
-
},
|
|
101
|
-
visible: hasFocus,
|
|
102
|
-
onClose: () => {
|
|
103
|
-
var _a;
|
|
104
|
-
|
|
105
|
-
(_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.blur();
|
|
106
|
-
}
|
|
107
|
-
})));
|
|
116
|
+
}, props.placeholder), keyboardElement));
|
|
108
117
|
});
|
package/es/locales/base.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export declare const base: {
|
|
2
|
+
locale: string;
|
|
2
3
|
common: {
|
|
3
4
|
confirm: string;
|
|
4
5
|
cancel: string;
|
|
6
|
+
loading: string;
|
|
5
7
|
};
|
|
6
8
|
Calendar: {
|
|
7
9
|
markItems: string[];
|
|
@@ -91,5 +93,10 @@ export declare const base: {
|
|
|
91
93
|
Modal: {
|
|
92
94
|
ok: string;
|
|
93
95
|
};
|
|
96
|
+
PullToRefresh: {
|
|
97
|
+
pulling: string;
|
|
98
|
+
canRelease: string;
|
|
99
|
+
complete: string;
|
|
100
|
+
};
|
|
94
101
|
};
|
|
95
102
|
export declare type Locale = typeof base;
|
package/es/locales/base.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
const typeTemplate = '${label} is not a valid ${type}';
|
|
2
2
|
export const base = {
|
|
3
|
+
locale: 'en',
|
|
3
4
|
common: {
|
|
4
5
|
confirm: 'Confirm',
|
|
5
|
-
cancel: 'Cancel'
|
|
6
|
+
cancel: 'Cancel',
|
|
7
|
+
loading: 'Loading...'
|
|
6
8
|
},
|
|
7
9
|
Calendar: {
|
|
8
10
|
markItems: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
|
@@ -91,5 +93,10 @@ export const base = {
|
|
|
91
93
|
},
|
|
92
94
|
Modal: {
|
|
93
95
|
ok: 'OK'
|
|
96
|
+
},
|
|
97
|
+
PullToRefresh: {
|
|
98
|
+
pulling: 'Scroll down to refresh',
|
|
99
|
+
canRelease: 'Release to refresh immediately',
|
|
100
|
+
complete: 'Refresh successful'
|
|
94
101
|
}
|
|
95
102
|
};
|
package/es/locales/en-US.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
declare const enUS: {
|
|
2
|
+
locale: string;
|
|
2
3
|
common: {
|
|
3
4
|
confirm: string;
|
|
4
5
|
cancel: string;
|
|
6
|
+
loading: string;
|
|
5
7
|
};
|
|
6
8
|
Calendar: {
|
|
7
9
|
markItems: string[];
|
|
@@ -91,5 +93,10 @@ declare const enUS: {
|
|
|
91
93
|
Modal: {
|
|
92
94
|
ok: string;
|
|
93
95
|
};
|
|
96
|
+
PullToRefresh: {
|
|
97
|
+
pulling: string;
|
|
98
|
+
canRelease: string;
|
|
99
|
+
complete: string;
|
|
100
|
+
};
|
|
94
101
|
};
|
|
95
102
|
export default enUS;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
declare const faIR: {
|
|
2
|
+
locale: string;
|
|
3
|
+
common: {
|
|
4
|
+
confirm: string;
|
|
5
|
+
cancel: string;
|
|
6
|
+
loading: string;
|
|
7
|
+
};
|
|
8
|
+
Calendar: {
|
|
9
|
+
markItems: string[];
|
|
10
|
+
renderYearAndMonth: (year: number, month: number) => string;
|
|
11
|
+
};
|
|
12
|
+
Cascader: {
|
|
13
|
+
placeholder: string;
|
|
14
|
+
};
|
|
15
|
+
Dialog: {
|
|
16
|
+
ok: string;
|
|
17
|
+
};
|
|
18
|
+
ErrorBlock: {
|
|
19
|
+
default: {
|
|
20
|
+
title: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
busy: {
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
disconnected: {
|
|
28
|
+
title: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
empty: {
|
|
32
|
+
title: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
Form: {
|
|
37
|
+
required: string;
|
|
38
|
+
optional: string;
|
|
39
|
+
defaultValidateMessages: {
|
|
40
|
+
default: string;
|
|
41
|
+
required: string;
|
|
42
|
+
enum: string;
|
|
43
|
+
whitespace: string;
|
|
44
|
+
date: {
|
|
45
|
+
format: string;
|
|
46
|
+
parse: string;
|
|
47
|
+
invalid: string;
|
|
48
|
+
};
|
|
49
|
+
types: {
|
|
50
|
+
string: string;
|
|
51
|
+
method: string;
|
|
52
|
+
array: string;
|
|
53
|
+
object: string;
|
|
54
|
+
number: string;
|
|
55
|
+
date: string;
|
|
56
|
+
boolean: string;
|
|
57
|
+
integer: string;
|
|
58
|
+
float: string;
|
|
59
|
+
regexp: string;
|
|
60
|
+
email: string;
|
|
61
|
+
url: string;
|
|
62
|
+
hex: string;
|
|
63
|
+
};
|
|
64
|
+
string: {
|
|
65
|
+
len: string;
|
|
66
|
+
min: string;
|
|
67
|
+
max: string;
|
|
68
|
+
range: string;
|
|
69
|
+
};
|
|
70
|
+
number: {
|
|
71
|
+
len: string;
|
|
72
|
+
min: string;
|
|
73
|
+
max: string;
|
|
74
|
+
range: string;
|
|
75
|
+
};
|
|
76
|
+
array: {
|
|
77
|
+
len: string;
|
|
78
|
+
min: string;
|
|
79
|
+
max: string;
|
|
80
|
+
range: string;
|
|
81
|
+
};
|
|
82
|
+
pattern: {
|
|
83
|
+
mismatch: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
ImageUploader: {
|
|
88
|
+
uploading: string;
|
|
89
|
+
};
|
|
90
|
+
Mask: {
|
|
91
|
+
name: string;
|
|
92
|
+
};
|
|
93
|
+
Modal: {
|
|
94
|
+
ok: string;
|
|
95
|
+
};
|
|
96
|
+
PullToRefresh: {
|
|
97
|
+
pulling: string;
|
|
98
|
+
canRelease: string;
|
|
99
|
+
complete: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export default faIR;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { mergeLocale } from '../utils/merge-locale';
|
|
2
|
+
import { base } from './base';
|
|
3
|
+
const typeTemplate = '${label} یک ${type} معتبر نیست';
|
|
4
|
+
const faIR = mergeLocale(base, {
|
|
5
|
+
locale: 'fa-IR',
|
|
6
|
+
common: {
|
|
7
|
+
confirm: 'تایید',
|
|
8
|
+
cancel: 'لغو'
|
|
9
|
+
},
|
|
10
|
+
Calendar: {
|
|
11
|
+
markItems: ['شنبه', 'یکشنبه', 'دوشنبه', 'سهشنبه', 'چهارشنبه', 'پنجنشبه', 'جمعه'],
|
|
12
|
+
renderYearAndMonth: (year, month) => `${year}/${month}`
|
|
13
|
+
},
|
|
14
|
+
Cascader: {
|
|
15
|
+
placeholder: 'انتخاب کنید'
|
|
16
|
+
},
|
|
17
|
+
Dialog: {
|
|
18
|
+
ok: 'باشه'
|
|
19
|
+
},
|
|
20
|
+
ErrorBlock: {
|
|
21
|
+
default: {
|
|
22
|
+
title: 'اوه، مشکلی پیش آمد',
|
|
23
|
+
description: 'لطفاً یک دقیقه صبر کنید و دوباره امتحان کنید'
|
|
24
|
+
},
|
|
25
|
+
busy: {
|
|
26
|
+
title: 'اوه، بارگیری نمی شود',
|
|
27
|
+
description: 'سعی کنید صفحه را به روز کنید'
|
|
28
|
+
},
|
|
29
|
+
disconnected: {
|
|
30
|
+
title: 'شبکه مشغول است',
|
|
31
|
+
description: 'سعی کنید صفحه را به روز کنید'
|
|
32
|
+
},
|
|
33
|
+
empty: {
|
|
34
|
+
title: 'هوم، نتونستم پیداش کنم...',
|
|
35
|
+
description: 'آیا می خواهید یک جستجوی جدید را امتحان کنید؟'
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
Form: {
|
|
39
|
+
required: 'اجباری',
|
|
40
|
+
optional: 'اختیاری',
|
|
41
|
+
defaultValidateMessages: {
|
|
42
|
+
default: 'خطای اعتبارسنجی فیلد برای ${label}',
|
|
43
|
+
required: 'لطفا وارد کنید ${label}',
|
|
44
|
+
enum: '${label} باید یکی از [${enum}]',
|
|
45
|
+
whitespace: '${label} نمی تواند یک کاراکتر خالی باشد',
|
|
46
|
+
date: {
|
|
47
|
+
format: '${label} قالب تاریخ نامعتبر است',
|
|
48
|
+
parse: '${label} نمی توان به تاریخ تبدیل کرد',
|
|
49
|
+
invalid: '${label} تاریخ نامعتبر است'
|
|
50
|
+
},
|
|
51
|
+
types: {
|
|
52
|
+
string: typeTemplate,
|
|
53
|
+
method: typeTemplate,
|
|
54
|
+
array: typeTemplate,
|
|
55
|
+
object: typeTemplate,
|
|
56
|
+
number: typeTemplate,
|
|
57
|
+
date: typeTemplate,
|
|
58
|
+
boolean: typeTemplate,
|
|
59
|
+
integer: typeTemplate,
|
|
60
|
+
float: typeTemplate,
|
|
61
|
+
regexp: typeTemplate,
|
|
62
|
+
email: typeTemplate,
|
|
63
|
+
url: typeTemplate,
|
|
64
|
+
hex: typeTemplate
|
|
65
|
+
},
|
|
66
|
+
string: {
|
|
67
|
+
len: 'تعداد کاراکترهای ${label} باید ${len} کاراکتر باشد',
|
|
68
|
+
min: 'حداقل کاراکترهای ${label} باید ${min} کاراکتر باشد',
|
|
69
|
+
max: 'حداکثر کاراکترهای ${label} باید ${max} کاراکتر باشد',
|
|
70
|
+
range: 'تعداد کاراکترهای ${label} باید بین ${min}-${max} کاراکتر باشد'
|
|
71
|
+
},
|
|
72
|
+
number: {
|
|
73
|
+
len: 'تعداد اعداد ${label} باید برابر با ${len} باشد',
|
|
74
|
+
min: 'تعداد اعداد ${label} باید حداقل ${min} باشد',
|
|
75
|
+
max: 'تعداد اعداد ${label} باید حداکثر ${max} باشد',
|
|
76
|
+
range: 'تعداد اعداد ${label} باید بین ${min}-${max} باشد'
|
|
77
|
+
},
|
|
78
|
+
array: {
|
|
79
|
+
len: 'طول آیتمهای ${label} باید برابر با ${len} باشد',
|
|
80
|
+
min: 'آیتمهای ${label} باید حداقل ${min} باشد',
|
|
81
|
+
max: 'آیتمهای ${label} باید حداکثر ${max} باشد',
|
|
82
|
+
range: 'آیتمهای ${label} باید بین ${min}-${max} باشد'
|
|
83
|
+
},
|
|
84
|
+
pattern: {
|
|
85
|
+
mismatch: '${label} با الگوی ${pattern} مطابقت ندارد'
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
ImageUploader: {
|
|
90
|
+
uploading: 'در حال آپلود...'
|
|
91
|
+
},
|
|
92
|
+
Mask: {
|
|
93
|
+
name: 'ماسک'
|
|
94
|
+
},
|
|
95
|
+
Modal: {
|
|
96
|
+
ok: 'باشه'
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
export default faIR;
|
package/es/locales/zh-CN.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
declare const zhCN: {
|
|
2
|
+
locale: string;
|
|
2
3
|
common: {
|
|
3
4
|
confirm: string;
|
|
4
5
|
cancel: string;
|
|
6
|
+
loading: string;
|
|
5
7
|
};
|
|
6
8
|
Calendar: {
|
|
7
9
|
markItems: string[];
|
|
@@ -91,5 +93,10 @@ declare const zhCN: {
|
|
|
91
93
|
Modal: {
|
|
92
94
|
ok: string;
|
|
93
95
|
};
|
|
96
|
+
PullToRefresh: {
|
|
97
|
+
pulling: string;
|
|
98
|
+
canRelease: string;
|
|
99
|
+
complete: string;
|
|
100
|
+
};
|
|
94
101
|
};
|
|
95
102
|
export default zhCN;
|
package/es/locales/zh-CN.js
CHANGED
|
@@ -2,9 +2,11 @@ import { mergeLocale } from '../utils/merge-locale';
|
|
|
2
2
|
import { base } from './base';
|
|
3
3
|
const typeTemplate = '${label}不是一个有效的${type}';
|
|
4
4
|
const zhCN = mergeLocale(base, {
|
|
5
|
+
locale: 'zh-CH',
|
|
5
6
|
common: {
|
|
6
7
|
confirm: '确定',
|
|
7
|
-
cancel: '取消'
|
|
8
|
+
cancel: '取消',
|
|
9
|
+
loading: '加载中……'
|
|
8
10
|
},
|
|
9
11
|
Calendar: {
|
|
10
12
|
markItems: ['一', '二', '三', '四', '五', '六', '日'],
|
|
@@ -93,6 +95,11 @@ const zhCN = mergeLocale(base, {
|
|
|
93
95
|
},
|
|
94
96
|
Modal: {
|
|
95
97
|
ok: '我知道了'
|
|
98
|
+
},
|
|
99
|
+
PullToRefresh: {
|
|
100
|
+
pulling: '下拉刷新',
|
|
101
|
+
canRelease: '释放立即刷新',
|
|
102
|
+
complete: '刷新成功'
|
|
96
103
|
}
|
|
97
104
|
});
|
|
98
105
|
export default zhCN;
|