antd-mobile 5.9.5 → 5.10.2
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/capsule-tabs/capsule-tabs.js +3 -3
- package/2x/cjs/components/collapse/collapse.js +3 -3
- package/2x/cjs/components/divider/divider.css +19 -8
- package/2x/cjs/components/divider/divider.d.ts +1 -0
- package/2x/cjs/components/divider/divider.js +3 -2
- package/2x/cjs/components/form/form.js +3 -2
- package/2x/cjs/components/image-uploader/image-uploader.d.ts +2 -0
- package/2x/cjs/components/image-uploader/image-uploader.js +6 -2
- package/2x/cjs/components/image-uploader/preview-item.d.ts +2 -0
- package/2x/cjs/components/image-uploader/preview-item.js +3 -2
- package/2x/cjs/components/index-bar/index-bar.js +3 -3
- package/2x/cjs/components/jumbo-tabs/jumbo-tabs.js +3 -3
- package/2x/cjs/components/mask/mask.css +1 -0
- package/2x/cjs/components/mask/mask.js +8 -1
- package/2x/cjs/components/picker-view/picker-view.d.ts +1 -0
- package/2x/cjs/components/picker-view/wheel.js +3 -1
- package/2x/cjs/components/popover/popover-menu.js +2 -1
- package/2x/cjs/components/safe-area/safe-area.css +2 -2
- package/2x/cjs/components/side-bar/side-bar.js +3 -3
- package/2x/cjs/components/stepper/stepper.js +16 -9
- package/2x/cjs/components/swiper/swiper.js +1 -0
- package/2x/cjs/components/tab-bar/tab-bar.js +3 -3
- package/2x/cjs/components/tabs/tabs.js +3 -3
- package/2x/cjs/components/tree-select/multiple.js +2 -1
- package/2x/cjs/global/global.css +1 -0
- package/2x/cjs/global/theme.css +1 -0
- package/2x/cjs/locales/ko-KR.d.ts +102 -0
- package/2x/cjs/locales/ko-KR.js +115 -0
- package/2x/cjs/locales/zh-HK.js +56 -0
- package/2x/cjs/locales/zh-TW.js +56 -0
- package/2x/cjs/utils/traverse-react-node.d.ts +2 -0
- package/2x/cjs/utils/traverse-react-node.js +29 -0
- package/2x/es/components/capsule-tabs/capsule-tabs.js +2 -1
- package/2x/es/components/collapse/collapse.js +2 -1
- package/2x/es/components/divider/divider.css +19 -8
- package/2x/es/components/divider/divider.d.ts +1 -0
- package/2x/es/components/divider/divider.js +3 -2
- package/2x/es/components/form/form.js +2 -1
- package/2x/es/components/image-uploader/image-uploader.d.ts +2 -0
- package/2x/es/components/image-uploader/image-uploader.js +6 -2
- package/2x/es/components/image-uploader/preview-item.d.ts +2 -0
- package/2x/es/components/image-uploader/preview-item.js +3 -2
- package/2x/es/components/index-bar/index-bar.js +2 -1
- package/2x/es/components/jumbo-tabs/jumbo-tabs.js +2 -1
- package/2x/es/components/mask/mask.css +1 -0
- package/2x/es/components/mask/mask.js +8 -1
- package/2x/es/components/picker-view/picker-view.d.ts +1 -0
- package/2x/es/components/picker-view/wheel.js +3 -1
- package/2x/es/components/popover/popover-menu.js +2 -1
- package/2x/es/components/safe-area/safe-area.css +2 -2
- package/2x/es/components/side-bar/side-bar.js +2 -1
- package/2x/es/components/stepper/stepper.js +15 -9
- package/2x/es/components/swiper/swiper.js +1 -0
- package/2x/es/components/tab-bar/tab-bar.js +2 -1
- package/2x/es/components/tabs/tabs.js +2 -1
- package/2x/es/components/tree-select/multiple.js +2 -1
- package/2x/es/global/global.css +1 -0
- package/2x/es/global/theme.css +1 -0
- package/2x/es/locales/ko-KR.d.ts +102 -0
- package/2x/es/locales/ko-KR.js +105 -0
- package/2x/es/locales/zh-HK.js +56 -0
- package/2x/es/locales/zh-TW.js +56 -0
- package/2x/es/utils/traverse-react-node.d.ts +2 -0
- package/2x/es/utils/traverse-react-node.js +18 -0
- package/2x/package.json +5 -1
- package/bundle/antd-mobile.cjs.js +60 -25
- package/bundle/antd-mobile.es.js +59 -25
- package/bundle/style.css +22 -10
- package/cjs/components/capsule-tabs/capsule-tabs.js +3 -3
- package/cjs/components/collapse/collapse.js +3 -3
- package/cjs/components/divider/divider.css +18 -8
- package/cjs/components/divider/divider.d.ts +1 -0
- package/cjs/components/divider/divider.js +3 -2
- package/cjs/components/form/form.js +3 -2
- package/cjs/components/image-uploader/image-uploader.d.ts +2 -0
- package/cjs/components/image-uploader/image-uploader.js +6 -2
- package/cjs/components/image-uploader/preview-item.d.ts +2 -0
- package/cjs/components/image-uploader/preview-item.js +3 -2
- package/cjs/components/index-bar/index-bar.js +3 -3
- package/cjs/components/jumbo-tabs/jumbo-tabs.js +3 -3
- package/cjs/components/mask/mask.css +1 -0
- package/cjs/components/mask/mask.js +8 -1
- package/cjs/components/picker-view/picker-view.d.ts +1 -0
- package/cjs/components/picker-view/wheel.js +3 -1
- package/cjs/components/popover/popover-menu.js +2 -1
- package/cjs/components/safe-area/safe-area.css +2 -2
- package/cjs/components/side-bar/side-bar.js +3 -3
- package/cjs/components/stepper/stepper.js +16 -9
- package/cjs/components/swiper/swiper.js +1 -0
- package/cjs/components/tab-bar/tab-bar.js +3 -3
- package/cjs/components/tabs/tabs.js +3 -3
- package/cjs/components/tree-select/multiple.js +2 -1
- package/cjs/global/global.css +1 -0
- package/cjs/global/theme.css +1 -0
- package/cjs/locales/ko-KR.d.ts +102 -0
- package/cjs/locales/ko-KR.js +115 -0
- package/cjs/locales/zh-HK.js +56 -0
- package/cjs/locales/zh-TW.js +56 -0
- package/cjs/utils/traverse-react-node.d.ts +2 -0
- package/cjs/utils/traverse-react-node.js +29 -0
- package/es/components/capsule-tabs/capsule-tabs.js +2 -1
- package/es/components/collapse/collapse.js +2 -1
- package/es/components/divider/divider.css +18 -8
- package/es/components/divider/divider.d.ts +1 -0
- package/es/components/divider/divider.js +3 -2
- package/es/components/form/form.js +2 -1
- package/es/components/image-uploader/image-uploader.d.ts +2 -0
- package/es/components/image-uploader/image-uploader.js +6 -2
- package/es/components/image-uploader/preview-item.d.ts +2 -0
- package/es/components/image-uploader/preview-item.js +3 -2
- package/es/components/index-bar/index-bar.js +2 -1
- package/es/components/jumbo-tabs/jumbo-tabs.js +2 -1
- package/es/components/mask/mask.css +1 -0
- package/es/components/mask/mask.js +8 -1
- package/es/components/picker-view/picker-view.d.ts +1 -0
- package/es/components/picker-view/wheel.js +3 -1
- package/es/components/popover/popover-menu.js +2 -1
- package/es/components/safe-area/safe-area.css +2 -2
- package/es/components/side-bar/side-bar.js +2 -1
- package/es/components/stepper/stepper.js +15 -9
- package/es/components/swiper/swiper.js +1 -0
- package/es/components/tab-bar/tab-bar.js +2 -1
- package/es/components/tabs/tabs.js +2 -1
- package/es/components/tree-select/multiple.js +2 -1
- package/es/global/global.css +1 -0
- package/es/global/theme.css +1 -0
- package/es/locales/ko-KR.d.ts +102 -0
- package/es/locales/ko-KR.js +105 -0
- package/es/locales/zh-HK.js +56 -0
- package/es/locales/zh-TW.js +56 -0
- package/es/utils/traverse-react-node.d.ts +2 -0
- package/es/utils/traverse-react-node.js +18 -0
- package/package.json +5 -1
- package/umd/antd-mobile.js +1 -1
- package/umd/antd-mobile.js.LICENSE.txt +9 -0
|
@@ -9,6 +9,7 @@ export declare type PickerValueExtend = {
|
|
|
9
9
|
export declare type PickerColumnItem = {
|
|
10
10
|
label: ReactNode;
|
|
11
11
|
value: string;
|
|
12
|
+
key?: string | number;
|
|
12
13
|
};
|
|
13
14
|
export declare type PickerColumn = (string | PickerColumnItem)[];
|
|
14
15
|
export declare type PickerViewProps = {
|
|
@@ -140,6 +140,8 @@ export const Wheel = memo(props => {
|
|
|
140
140
|
className: `${classPrefix}-column-wheel`,
|
|
141
141
|
"aria-hidden": true
|
|
142
142
|
}, column.map((item, index) => {
|
|
143
|
+
var _a;
|
|
144
|
+
|
|
143
145
|
const selected = props.value === item.value;
|
|
144
146
|
if (selected) selectedIndex = index;
|
|
145
147
|
|
|
@@ -149,7 +151,7 @@ export const Wheel = memo(props => {
|
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
return React.createElement("div", {
|
|
152
|
-
key: item.value,
|
|
154
|
+
key: (_a = item.key) !== null && _a !== void 0 ? _a : item.value,
|
|
153
155
|
"data-selected": item.value === value,
|
|
154
156
|
className: `${classPrefix}-column-item`,
|
|
155
157
|
onClick: handleClick,
|
|
@@ -3,7 +3,8 @@ import classNames from 'classnames';
|
|
|
3
3
|
import { Popover } from './popover';
|
|
4
4
|
const classPrefix = `adm-popover-menu`;
|
|
5
5
|
export const PopoverMenu = forwardRef((props, ref) => {
|
|
6
|
-
const innerRef = useRef(null);
|
|
6
|
+
const innerRef = useRef(null); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
7
|
+
|
|
7
8
|
useImperativeHandle(ref, () => innerRef.current, []);
|
|
8
9
|
const onClick = useCallback(e => {
|
|
9
10
|
var _a;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.adm-safe-area-position-top {
|
|
7
|
-
padding-top: env(safe-area-inset-top);
|
|
7
|
+
padding-top: calc(env(safe-area-inset-top) * var(--adm-hd));
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.adm-safe-area-position-bottom {
|
|
11
|
-
padding-bottom: env(safe-area-inset-bottom);
|
|
11
|
+
padding-bottom: calc(env(safe-area-inset-bottom) * var(--adm-hd));
|
|
12
12
|
}
|
|
@@ -4,6 +4,7 @@ import Badge from '../badge';
|
|
|
4
4
|
import { withNativeProps } from '../../utils/native-props';
|
|
5
5
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
6
6
|
import { Corner } from './corner';
|
|
7
|
+
import { traverseReactNode } from '../../utils/traverse-react-node';
|
|
7
8
|
const classPrefix = `adm-side-bar`;
|
|
8
9
|
export const SideBarItem = () => {
|
|
9
10
|
return null;
|
|
@@ -13,7 +14,7 @@ export const SideBar = props => {
|
|
|
13
14
|
|
|
14
15
|
let firstActiveKey = null;
|
|
15
16
|
const items = [];
|
|
16
|
-
|
|
17
|
+
traverseReactNode(props.children, (child, index) => {
|
|
17
18
|
if (!React.isValidElement(child)) return;
|
|
18
19
|
const key = child.key;
|
|
19
20
|
if (typeof key !== 'string') return;
|
|
@@ -7,6 +7,7 @@ import { mergeProps } from '../../utils/with-default-props';
|
|
|
7
7
|
import { bound } from '../../utils/bound';
|
|
8
8
|
import Input from '../input';
|
|
9
9
|
import Button from '../button';
|
|
10
|
+
import Big from 'big.js';
|
|
10
11
|
const classPrefix = `adm-stepper`;
|
|
11
12
|
const defaultProps = {
|
|
12
13
|
defaultValue: 0,
|
|
@@ -24,13 +25,13 @@ export const Stepper = p => {
|
|
|
24
25
|
inputReadOnly
|
|
25
26
|
} = props;
|
|
26
27
|
const [value, setValue] = usePropsValue(props);
|
|
27
|
-
const [inputValue, setInputValue] = useState(() => convertValueToText(value));
|
|
28
|
+
const [inputValue, setInputValue] = useState(() => convertValueToText(value, props.digits));
|
|
28
29
|
|
|
29
30
|
function setValueWithCheck(v) {
|
|
30
31
|
if (isNaN(v)) return;
|
|
31
32
|
let target = bound(v, props.min, props.max);
|
|
32
33
|
|
|
33
|
-
if (props.digits
|
|
34
|
+
if (props.digits !== undefined) {
|
|
34
35
|
target = parseFloat(target.toFixed(props.digits));
|
|
35
36
|
}
|
|
36
37
|
|
|
@@ -40,14 +41,14 @@ export const Stepper = p => {
|
|
|
40
41
|
const [hasFocus, setHasFocus] = useState(false);
|
|
41
42
|
useEffect(() => {
|
|
42
43
|
if (!hasFocus) {
|
|
43
|
-
setInputValue(convertValueToText(value));
|
|
44
|
+
setInputValue(convertValueToText(value, props.digits));
|
|
44
45
|
}
|
|
45
46
|
}, [hasFocus]);
|
|
46
47
|
useEffect(() => {
|
|
47
48
|
if (!hasFocus) {
|
|
48
|
-
setInputValue(convertValueToText(value));
|
|
49
|
+
setInputValue(convertValueToText(value, props.digits));
|
|
49
50
|
}
|
|
50
|
-
}, [value]);
|
|
51
|
+
}, [value, props.digits]);
|
|
51
52
|
|
|
52
53
|
const handleInputChange = v => {
|
|
53
54
|
setInputValue(v);
|
|
@@ -65,11 +66,11 @@ export const Stepper = p => {
|
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
const handleMinus = () => {
|
|
68
|
-
setValueWithCheck((value !== null && value !== void 0 ? value : 0)
|
|
69
|
+
setValueWithCheck(Big(value !== null && value !== void 0 ? value : 0).minus(step).toNumber());
|
|
69
70
|
};
|
|
70
71
|
|
|
71
72
|
const handlePlus = () => {
|
|
72
|
-
setValueWithCheck((value !== null && value !== void 0 ? value : 0)
|
|
73
|
+
setValueWithCheck(Big(value !== null && value !== void 0 ? value : 0).add(step).toNumber());
|
|
73
74
|
};
|
|
74
75
|
|
|
75
76
|
const minusDisabled = () => {
|
|
@@ -137,9 +138,14 @@ export const Stepper = p => {
|
|
|
137
138
|
}, React.createElement(AddOutline, null))));
|
|
138
139
|
};
|
|
139
140
|
|
|
140
|
-
function convertValueToText(value) {
|
|
141
|
+
function convertValueToText(value, digits) {
|
|
141
142
|
if (value === null) return '';
|
|
142
|
-
|
|
143
|
+
|
|
144
|
+
if (digits !== undefined) {
|
|
145
|
+
return value.toFixed(digits);
|
|
146
|
+
} else {
|
|
147
|
+
return value.toString();
|
|
148
|
+
}
|
|
143
149
|
}
|
|
144
150
|
|
|
145
151
|
function convertTextToValue(text) {
|
|
@@ -101,6 +101,7 @@ export const Swiper = forwardRef(staged((p, ref) => {
|
|
|
101
101
|
},
|
|
102
102
|
onRest: () => {
|
|
103
103
|
if (draggingRef.current) return;
|
|
104
|
+
if (!loop) return;
|
|
104
105
|
const rawX = position.get();
|
|
105
106
|
const totalWidth = 100 * count;
|
|
106
107
|
const standardPosition = modulus(rawX, totalWidth);
|
|
@@ -5,6 +5,7 @@ import { mergeProps } from '../../utils/with-default-props';
|
|
|
5
5
|
import Badge from '../badge';
|
|
6
6
|
import SafeArea from '../safe-area';
|
|
7
7
|
import { usePropsValue } from '../../utils/use-props-value';
|
|
8
|
+
import { traverseReactNode } from '../../utils/traverse-react-node';
|
|
8
9
|
export const TabBarItem = () => {
|
|
9
10
|
return null;
|
|
10
11
|
};
|
|
@@ -18,7 +19,7 @@ export const TabBar = p => {
|
|
|
18
19
|
const props = mergeProps(defaultProps, p);
|
|
19
20
|
let firstActiveKey = null;
|
|
20
21
|
const items = [];
|
|
21
|
-
|
|
22
|
+
traverseReactNode(props.children, (child, index) => {
|
|
22
23
|
if (!React.isValidElement(child)) return;
|
|
23
24
|
const key = child.key;
|
|
24
25
|
if (typeof key !== 'string') return;
|
|
@@ -10,6 +10,7 @@ import { useResizeEffect } from '../../utils/use-resize-effect';
|
|
|
10
10
|
import { mergeProps } from '../../utils/with-default-props';
|
|
11
11
|
import { useIsomorphicUpdateLayoutEffect } from '../../utils/use-isomorphic-update-layout-effect';
|
|
12
12
|
import { ShouldRender } from '../../utils/should-render';
|
|
13
|
+
import { traverseReactNode } from '../../utils/traverse-react-node';
|
|
13
14
|
const classPrefix = `adm-tabs`;
|
|
14
15
|
export const Tab = () => {
|
|
15
16
|
return null;
|
|
@@ -27,7 +28,7 @@ export const Tabs = p => {
|
|
|
27
28
|
const keyToIndexRecord = {};
|
|
28
29
|
let firstActiveKey = null;
|
|
29
30
|
const panes = [];
|
|
30
|
-
|
|
31
|
+
traverseReactNode(props.children, (child, index) => {
|
|
31
32
|
if (!React.isValidElement(child)) return;
|
|
32
33
|
const key = child.key;
|
|
33
34
|
if (typeof key !== 'string') return;
|
|
@@ -137,7 +137,8 @@ export const Multiple = p => {
|
|
|
137
137
|
walker(groupKeys);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
groupKeys = groupKeys.filter(i => !unusedKeys.includes(i));
|
|
140
|
+
groupKeys = groupKeys.filter(i => !unusedKeys.includes(i)); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
141
|
+
|
|
141
142
|
const groupOptions = groupKeys.map(i => optionsMap.get(i));
|
|
142
143
|
setValue(groupKeys);
|
|
143
144
|
(_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, groupKeys, groupOptions);
|
package/2x/es/global/global.css
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
--adm-border-color: #eeeeee;
|
|
10
10
|
--adm-font-size-main: 26px;
|
|
11
11
|
--adm-color-text: #333333;
|
|
12
|
+
--adm-hd: 2;
|
|
12
13
|
--adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
|
|
13
14
|
helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',
|
|
14
15
|
'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
|
package/2x/es/global/theme.css
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
--adm-border-color: #eeeeee;
|
|
10
10
|
--adm-font-size-main: 26px;
|
|
11
11
|
--adm-color-text: #333333;
|
|
12
|
+
--adm-hd: 2;
|
|
12
13
|
--adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',
|
|
13
14
|
helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',
|
|
14
15
|
'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
declare const koKR: {
|
|
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 koKR;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { mergeLocale } from '../utils/merge-locale';
|
|
2
|
+
import { base } from './base';
|
|
3
|
+
const typeTemplate = '${label} 유효하지 않은 ${type} 입니다';
|
|
4
|
+
const koKR = mergeLocale(base, {
|
|
5
|
+
locale: 'ko-KR',
|
|
6
|
+
common: {
|
|
7
|
+
confirm: '확인',
|
|
8
|
+
cancel: '취소',
|
|
9
|
+
loading: '로딩중...'
|
|
10
|
+
},
|
|
11
|
+
Calendar: {
|
|
12
|
+
markItems: ['월', '화', '수', '목', '금', '토', '일'],
|
|
13
|
+
renderYearAndMonth: (year, month) => `${year}년${month}일`
|
|
14
|
+
},
|
|
15
|
+
Cascader: {
|
|
16
|
+
placeholder: '선택됨'
|
|
17
|
+
},
|
|
18
|
+
Dialog: {
|
|
19
|
+
ok: '확인'
|
|
20
|
+
},
|
|
21
|
+
ErrorBlock: {
|
|
22
|
+
default: {
|
|
23
|
+
title: '문제가 발생했습니다',
|
|
24
|
+
description: '잠시 후 다시 시도해주세요'
|
|
25
|
+
},
|
|
26
|
+
busy: {
|
|
27
|
+
title: '로딩 되지 않았습니다.',
|
|
28
|
+
description: '페이지를 새로고침 해주세요'
|
|
29
|
+
},
|
|
30
|
+
disconnected: {
|
|
31
|
+
title: '네트워크를 사용 중 입니다',
|
|
32
|
+
description: '페이지를 새로고침 해주세요'
|
|
33
|
+
},
|
|
34
|
+
empty: {
|
|
35
|
+
title: '정보를 찾을 수 없습니다',
|
|
36
|
+
description: '정확한 검색어인가요?'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
Form: {
|
|
40
|
+
required: '필수',
|
|
41
|
+
optional: '선택',
|
|
42
|
+
defaultValidateMessages: {
|
|
43
|
+
default: '필드 유효성 검사 오류 ${label}',
|
|
44
|
+
required: '${label} 입력해 주세요',
|
|
45
|
+
enum: '${label} [${enum}] 중에 하나여야 합니다',
|
|
46
|
+
whitespace: '${label} 비워둘 수 없습니다',
|
|
47
|
+
date: {
|
|
48
|
+
format: '${label} 유효하지 않은 날짜 형식입니다',
|
|
49
|
+
parse: '${label} 날짜 형식으로 변환될 수 없습니다',
|
|
50
|
+
invalid: '${label} 유효하지 않은 날짜입니다'
|
|
51
|
+
},
|
|
52
|
+
types: {
|
|
53
|
+
string: typeTemplate,
|
|
54
|
+
method: typeTemplate,
|
|
55
|
+
array: typeTemplate,
|
|
56
|
+
object: typeTemplate,
|
|
57
|
+
number: typeTemplate,
|
|
58
|
+
date: typeTemplate,
|
|
59
|
+
boolean: typeTemplate,
|
|
60
|
+
integer: typeTemplate,
|
|
61
|
+
float: typeTemplate,
|
|
62
|
+
regexp: typeTemplate,
|
|
63
|
+
email: typeTemplate,
|
|
64
|
+
url: typeTemplate,
|
|
65
|
+
hex: typeTemplate
|
|
66
|
+
},
|
|
67
|
+
string: {
|
|
68
|
+
len: '${label} ${len}글자여야 합니다',
|
|
69
|
+
min: '${label} 적어도 ${min}글자 이상이어야 합니다',
|
|
70
|
+
max: '${label} ${max}글자 이하여야 합니다',
|
|
71
|
+
range: '${label} ${min}-${max}글자 사이어야 합니다'
|
|
72
|
+
},
|
|
73
|
+
number: {
|
|
74
|
+
len: '${label} 값은 ${len}이어야 합니다',
|
|
75
|
+
min: '${label} 최솟값은 ${min}입니다',
|
|
76
|
+
max: '${label} 최댓값은 ${max}입니다',
|
|
77
|
+
range: '${label} 값은 ${min}-${max} 사이어야 합니다'
|
|
78
|
+
},
|
|
79
|
+
array: {
|
|
80
|
+
len: '${len}이어야 합니다 ${label}',
|
|
81
|
+
min: '최소 ${min}이어야 합니다 ${label}',
|
|
82
|
+
max: '최대 ${max}이어야 합니다 ${label}',
|
|
83
|
+
range: '${label} ${min}-${max} 사이어야 합니다'
|
|
84
|
+
},
|
|
85
|
+
pattern: {
|
|
86
|
+
mismatch: '${label} ${pattern} 패턴과 일치하지 않습니다'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
ImageUploader: {
|
|
91
|
+
uploading: '업로드 중...'
|
|
92
|
+
},
|
|
93
|
+
Mask: {
|
|
94
|
+
name: '마스크'
|
|
95
|
+
},
|
|
96
|
+
Modal: {
|
|
97
|
+
ok: '확인'
|
|
98
|
+
},
|
|
99
|
+
PullToRefresh: {
|
|
100
|
+
pulling: '스크롤을 당겨서 새로고침하십시오',
|
|
101
|
+
canRelease: '새로고침 하려면 놓으십시오',
|
|
102
|
+
complete: '새로고침 완료'
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
export default koKR;
|
package/2x/es/locales/zh-HK.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mergeLocale } from '../utils/merge-locale';
|
|
2
2
|
import { base } from './base';
|
|
3
|
+
const typeTemplate = '${label}不是一個有效的${type}';
|
|
3
4
|
const zhHK = mergeLocale(base, {
|
|
4
5
|
locale: 'zh-HK',
|
|
5
6
|
common: {
|
|
@@ -7,6 +8,10 @@ const zhHK = mergeLocale(base, {
|
|
|
7
8
|
cancel: '取消',
|
|
8
9
|
loading: '加載中……'
|
|
9
10
|
},
|
|
11
|
+
Calendar: {
|
|
12
|
+
markItems: ['一', '二', '三', '四', '五', '六', '日'],
|
|
13
|
+
renderYearAndMonth: (year, month) => `${year}年${month}月`
|
|
14
|
+
},
|
|
10
15
|
Cascader: {
|
|
11
16
|
placeholder: '請選擇'
|
|
12
17
|
},
|
|
@@ -31,6 +36,57 @@ const zhHK = mergeLocale(base, {
|
|
|
31
36
|
description: '找找其他的吧'
|
|
32
37
|
}
|
|
33
38
|
},
|
|
39
|
+
Form: {
|
|
40
|
+
required: '必填',
|
|
41
|
+
optional: '選填',
|
|
42
|
+
defaultValidateMessages: {
|
|
43
|
+
default: '字段驗證錯誤${label}',
|
|
44
|
+
required: '請輸入${label}',
|
|
45
|
+
enum: '${label}必須是其中一個[${enum}]',
|
|
46
|
+
whitespace: '${label}不能為空字符',
|
|
47
|
+
date: {
|
|
48
|
+
format: '${label}日期格式無效',
|
|
49
|
+
parse: '${label}不能轉換為日期',
|
|
50
|
+
invalid: '${label}是一個無效日期'
|
|
51
|
+
},
|
|
52
|
+
types: {
|
|
53
|
+
string: typeTemplate,
|
|
54
|
+
method: typeTemplate,
|
|
55
|
+
array: typeTemplate,
|
|
56
|
+
object: typeTemplate,
|
|
57
|
+
number: typeTemplate,
|
|
58
|
+
date: typeTemplate,
|
|
59
|
+
boolean: typeTemplate,
|
|
60
|
+
integer: typeTemplate,
|
|
61
|
+
float: typeTemplate,
|
|
62
|
+
regexp: typeTemplate,
|
|
63
|
+
email: typeTemplate,
|
|
64
|
+
url: typeTemplate,
|
|
65
|
+
hex: typeTemplate
|
|
66
|
+
},
|
|
67
|
+
string: {
|
|
68
|
+
len: '${label}須為${len}個字符',
|
|
69
|
+
min: '${label}最少${min}個字符',
|
|
70
|
+
max: '${label}最多${max}個字符',
|
|
71
|
+
range: '${label}須在${min}-${max}字符之間'
|
|
72
|
+
},
|
|
73
|
+
number: {
|
|
74
|
+
len: '${label}必須等於${len}',
|
|
75
|
+
min: '${label}最小值為${min}',
|
|
76
|
+
max: '${label}最大值為${max}',
|
|
77
|
+
range: '${label}須在${min}-${max}之間'
|
|
78
|
+
},
|
|
79
|
+
array: {
|
|
80
|
+
len: '須為${len}個${label}',
|
|
81
|
+
min: '最少${min}個${label}',
|
|
82
|
+
max: '最多${max}個${label}',
|
|
83
|
+
range: '${label}数量須在${min}-${max}之間'
|
|
84
|
+
},
|
|
85
|
+
pattern: {
|
|
86
|
+
mismatch: '${label}與模式不匹配${pattern}'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
34
90
|
ImageUploader: {
|
|
35
91
|
uploading: '上傳中...'
|
|
36
92
|
},
|
package/2x/es/locales/zh-TW.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mergeLocale } from '../utils/merge-locale';
|
|
2
2
|
import { base } from './base';
|
|
3
|
+
const typeTemplate = '${label}不是一個有效的${type}';
|
|
3
4
|
const zhTW = mergeLocale(base, {
|
|
4
5
|
locale: 'zh-TW',
|
|
5
6
|
common: {
|
|
@@ -7,6 +8,10 @@ const zhTW = mergeLocale(base, {
|
|
|
7
8
|
cancel: '取消',
|
|
8
9
|
loading: '加載中……'
|
|
9
10
|
},
|
|
11
|
+
Calendar: {
|
|
12
|
+
markItems: ['一', '二', '三', '四', '五', '六', '日'],
|
|
13
|
+
renderYearAndMonth: (year, month) => `${year}年${month}月`
|
|
14
|
+
},
|
|
10
15
|
Cascader: {
|
|
11
16
|
placeholder: '請選擇'
|
|
12
17
|
},
|
|
@@ -31,6 +36,57 @@ const zhTW = mergeLocale(base, {
|
|
|
31
36
|
description: '找找其他的吧'
|
|
32
37
|
}
|
|
33
38
|
},
|
|
39
|
+
Form: {
|
|
40
|
+
required: '必填',
|
|
41
|
+
optional: '選填',
|
|
42
|
+
defaultValidateMessages: {
|
|
43
|
+
default: '字段驗證錯誤${label}',
|
|
44
|
+
required: '請輸入${label}',
|
|
45
|
+
enum: '${label}必須是其中一個[${enum}]',
|
|
46
|
+
whitespace: '${label}不能為空字符',
|
|
47
|
+
date: {
|
|
48
|
+
format: '${label}日期格式無效',
|
|
49
|
+
parse: '${label}不能轉換為日期',
|
|
50
|
+
invalid: '${label}是一個無效日期'
|
|
51
|
+
},
|
|
52
|
+
types: {
|
|
53
|
+
string: typeTemplate,
|
|
54
|
+
method: typeTemplate,
|
|
55
|
+
array: typeTemplate,
|
|
56
|
+
object: typeTemplate,
|
|
57
|
+
number: typeTemplate,
|
|
58
|
+
date: typeTemplate,
|
|
59
|
+
boolean: typeTemplate,
|
|
60
|
+
integer: typeTemplate,
|
|
61
|
+
float: typeTemplate,
|
|
62
|
+
regexp: typeTemplate,
|
|
63
|
+
email: typeTemplate,
|
|
64
|
+
url: typeTemplate,
|
|
65
|
+
hex: typeTemplate
|
|
66
|
+
},
|
|
67
|
+
string: {
|
|
68
|
+
len: '${label}須為${len}個字符',
|
|
69
|
+
min: '${label}最少${min}個字符',
|
|
70
|
+
max: '${label}最多${max}個字符',
|
|
71
|
+
range: '${label}須在${min}-${max}字符之間'
|
|
72
|
+
},
|
|
73
|
+
number: {
|
|
74
|
+
len: '${label}必須等於${len}',
|
|
75
|
+
min: '${label}最小值為${min}',
|
|
76
|
+
max: '${label}最大值為${max}',
|
|
77
|
+
range: '${label}須在${min}-${max}之間'
|
|
78
|
+
},
|
|
79
|
+
array: {
|
|
80
|
+
len: '須為${len}個${label}',
|
|
81
|
+
min: '最少${min}個${label}',
|
|
82
|
+
max: '最多${max}個${label}',
|
|
83
|
+
range: '${label}数量須在${min}-${max}之間'
|
|
84
|
+
},
|
|
85
|
+
pattern: {
|
|
86
|
+
mismatch: '${label}與模式不匹配${pattern}'
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
34
90
|
ImageUploader: {
|
|
35
91
|
uploading: '上傳中...'
|
|
36
92
|
},
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { isFragment } from 'react-is';
|
|
3
|
+
export function traverseReactNode(children, fn) {
|
|
4
|
+
let i = 0;
|
|
5
|
+
|
|
6
|
+
function handle(target) {
|
|
7
|
+
React.Children.forEach(target, child => {
|
|
8
|
+
if (!isFragment(child)) {
|
|
9
|
+
fn(child, i);
|
|
10
|
+
i += 1;
|
|
11
|
+
} else {
|
|
12
|
+
handle(child.props.children);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
handle(children);
|
|
18
|
+
}
|
package/2x/package.json
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-mobile",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.10.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@floating-ui/dom": "^0.4.2",
|
|
6
6
|
"@react-spring/web": "^9.4.4",
|
|
7
|
+
"@types/big.js": "^6.1.3",
|
|
8
|
+
"@types/react-is": "^17.0.3",
|
|
7
9
|
"@types/resize-observer-browser": "^0.1.7",
|
|
8
10
|
"@use-gesture/react": "^10.2.10",
|
|
9
11
|
"ahooks": "^3.1.14",
|
|
10
12
|
"antd-mobile-icons": "^0.2.2",
|
|
11
13
|
"antd-mobile-v5-count": "^1.0.1",
|
|
14
|
+
"big.js": "^6.1.1",
|
|
12
15
|
"classnames": "^2.3.1",
|
|
13
16
|
"dayjs": "^1.11.0",
|
|
14
17
|
"lodash": "^4.17.21",
|
|
15
18
|
"rc-field-form": "^1.24.0",
|
|
19
|
+
"react-is": "^17.0.2",
|
|
16
20
|
"staged-components": "^1.1.2",
|
|
17
21
|
"tslib": "^2.3.1"
|
|
18
22
|
},
|