antd-mobile 5.28.0 → 5.28.1
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 +235 -200
- package/2x/bundle/antd-mobile.cjs.js +9 -9
- package/2x/bundle/antd-mobile.es.development.js +235 -200
- package/2x/bundle/antd-mobile.es.js +5086 -5066
- package/2x/bundle/antd-mobile.umd.development.js +235 -200
- package/2x/bundle/antd-mobile.umd.js +9 -9
- package/2x/bundle/style.css +0 -1
- package/2x/cjs/components/ellipsis/ellipsis.d.ts +1 -0
- package/2x/cjs/components/ellipsis/ellipsis.js +3 -2
- package/2x/cjs/components/nav-bar/nav-bar.d.ts +2 -2
- package/2x/cjs/components/popup/popup.js +7 -1
- package/2x/cjs/components/steps/steps.css +0 -1
- package/2x/cjs/components/swiper/swiper.js +6 -3
- package/2x/cjs/components/text-area/text-area.js +4 -1
- package/2x/cjs/locales/base.d.ts +1 -0
- package/2x/cjs/locales/base.js +2 -1
- package/2x/cjs/locales/en-US.d.ts +1 -0
- package/2x/cjs/locales/es-ES.d.ts +1 -0
- package/2x/cjs/locales/fa-IR.d.ts +1 -0
- package/2x/cjs/locales/fr-FR.d.ts +1 -0
- package/2x/cjs/locales/id-ID.d.ts +1 -0
- package/2x/cjs/locales/ja-JP.d.ts +1 -0
- package/2x/cjs/locales/kk-KZ.d.ts +1 -0
- package/2x/cjs/locales/ko-KR.d.ts +1 -0
- package/2x/cjs/locales/zh-CN.d.ts +1 -0
- package/2x/cjs/locales/zh-CN.js +2 -1
- package/2x/cjs/locales/zh-HK.d.ts +1 -0
- package/2x/cjs/locales/zh-HK.js +2 -1
- package/2x/cjs/locales/zh-TW.d.ts +1 -0
- package/2x/cjs/locales/zh-TW.js +2 -1
- package/2x/es/components/ellipsis/ellipsis.d.ts +1 -0
- package/2x/es/components/ellipsis/ellipsis.js +3 -2
- package/2x/es/components/nav-bar/nav-bar.d.ts +2 -2
- package/2x/es/components/popup/popup.js +7 -1
- package/2x/es/components/steps/steps.css +0 -1
- package/2x/es/components/swiper/swiper.js +6 -3
- package/2x/es/components/text-area/text-area.js +4 -1
- package/2x/es/locales/base.d.ts +1 -0
- package/2x/es/locales/base.js +2 -1
- package/2x/es/locales/en-US.d.ts +1 -0
- package/2x/es/locales/es-ES.d.ts +1 -0
- package/2x/es/locales/fa-IR.d.ts +1 -0
- package/2x/es/locales/fr-FR.d.ts +1 -0
- package/2x/es/locales/id-ID.d.ts +1 -0
- package/2x/es/locales/ja-JP.d.ts +1 -0
- package/2x/es/locales/kk-KZ.d.ts +1 -0
- package/2x/es/locales/ko-KR.d.ts +1 -0
- package/2x/es/locales/zh-CN.d.ts +1 -0
- package/2x/es/locales/zh-CN.js +2 -1
- package/2x/es/locales/zh-HK.d.ts +1 -0
- package/2x/es/locales/zh-HK.js +2 -1
- package/2x/es/locales/zh-TW.d.ts +1 -0
- package/2x/es/locales/zh-TW.js +2 -1
- package/2x/package.json +2 -2
- package/bundle/antd-mobile.cjs.development.js +235 -200
- package/bundle/antd-mobile.cjs.js +9 -9
- package/bundle/antd-mobile.compatible.umd.js +1 -1
- package/bundle/antd-mobile.es.development.js +235 -200
- package/bundle/antd-mobile.es.js +5086 -5066
- package/bundle/antd-mobile.umd.development.js +235 -200
- package/bundle/antd-mobile.umd.js +9 -9
- package/bundle/style.css +1 -1
- package/cjs/components/ellipsis/ellipsis.d.ts +1 -0
- package/cjs/components/ellipsis/ellipsis.js +3 -2
- package/cjs/components/nav-bar/nav-bar.d.ts +2 -2
- package/cjs/components/popup/popup.js +7 -1
- package/cjs/components/steps/steps.css +0 -1
- package/cjs/components/swiper/swiper.js +6 -3
- package/cjs/components/text-area/text-area.js +4 -1
- package/cjs/locales/base.d.ts +1 -0
- package/cjs/locales/base.js +2 -1
- package/cjs/locales/en-US.d.ts +1 -0
- package/cjs/locales/es-ES.d.ts +1 -0
- package/cjs/locales/fa-IR.d.ts +1 -0
- package/cjs/locales/fr-FR.d.ts +1 -0
- package/cjs/locales/id-ID.d.ts +1 -0
- package/cjs/locales/ja-JP.d.ts +1 -0
- package/cjs/locales/kk-KZ.d.ts +1 -0
- package/cjs/locales/ko-KR.d.ts +1 -0
- package/cjs/locales/zh-CN.d.ts +1 -0
- package/cjs/locales/zh-CN.js +2 -1
- package/cjs/locales/zh-HK.d.ts +1 -0
- package/cjs/locales/zh-HK.js +2 -1
- package/cjs/locales/zh-TW.d.ts +1 -0
- package/cjs/locales/zh-TW.js +2 -1
- package/es/components/ellipsis/ellipsis.d.ts +1 -0
- package/es/components/ellipsis/ellipsis.js +3 -2
- package/es/components/nav-bar/nav-bar.d.ts +2 -2
- package/es/components/popup/popup.js +7 -1
- package/es/components/steps/steps.css +0 -1
- package/es/components/swiper/swiper.js +6 -3
- package/es/components/text-area/text-area.js +4 -1
- package/es/locales/base.d.ts +1 -0
- package/es/locales/base.js +2 -1
- package/es/locales/en-US.d.ts +1 -0
- package/es/locales/es-ES.d.ts +1 -0
- package/es/locales/fa-IR.d.ts +1 -0
- package/es/locales/fr-FR.d.ts +1 -0
- package/es/locales/id-ID.d.ts +1 -0
- package/es/locales/ja-JP.d.ts +1 -0
- package/es/locales/kk-KZ.d.ts +1 -0
- package/es/locales/ko-KR.d.ts +1 -0
- package/es/locales/zh-CN.d.ts +1 -0
- package/es/locales/zh-CN.js +2 -1
- package/es/locales/zh-HK.d.ts +1 -0
- package/es/locales/zh-HK.js +2 -1
- package/es/locales/zh-TW.d.ts +1 -0
- package/es/locales/zh-TW.js +2 -1
- package/package.json +2 -2
- package/umd/antd-mobile.js +1 -1
package/2x/bundle/style.css
CHANGED
|
@@ -4213,7 +4213,6 @@ a.adm-list-item:active:not(.adm-list-item-disabled):after {
|
|
|
4213
4213
|
.adm-step .adm-step-indicator .adm-step-icon-container {
|
|
4214
4214
|
position: absolute;
|
|
4215
4215
|
z-index: 1;
|
|
4216
|
-
background: var(--adm-color-background);
|
|
4217
4216
|
color: var(--icon-color);
|
|
4218
4217
|
}
|
|
4219
4218
|
|
|
@@ -9,5 +9,6 @@ export declare type EllipsisProps = {
|
|
|
9
9
|
collapseText?: string;
|
|
10
10
|
stopPropagationForActionButtons?: PropagationEvent[];
|
|
11
11
|
onContentClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
12
|
+
defaultExpanded?: boolean;
|
|
12
13
|
} & NativeProps;
|
|
13
14
|
export declare const Ellipsis: FC<EllipsisProps>;
|
|
@@ -22,13 +22,14 @@ const defaultProps = {
|
|
|
22
22
|
content: '',
|
|
23
23
|
collapseText: '',
|
|
24
24
|
stopPropagationForActionButtons: [],
|
|
25
|
-
onContentClick: () => {}
|
|
25
|
+
onContentClick: () => {},
|
|
26
|
+
defaultExpanded: false
|
|
26
27
|
};
|
|
27
28
|
const Ellipsis = p => {
|
|
28
29
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
29
30
|
const rootRef = (0, _react.useRef)(null);
|
|
30
31
|
const [ellipsised, setEllipsised] = (0, _react.useState)({});
|
|
31
|
-
const [expanded, setExpanded] = (0, _react.useState)(
|
|
32
|
+
const [expanded, setExpanded] = (0, _react.useState)(props.defaultExpanded);
|
|
32
33
|
const [exceeded, setExceeded] = (0, _react.useState)(false);
|
|
33
34
|
const chars = (0, _react.useMemo)(() => (0, _runes.default)(props.content), [props.content]);
|
|
34
35
|
function getSubString(start, end) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type NavBarProps = {
|
|
4
4
|
back?: ReactNode;
|
|
@@ -6,6 +6,6 @@ export declare type NavBarProps = {
|
|
|
6
6
|
left?: ReactNode;
|
|
7
7
|
right?: ReactNode;
|
|
8
8
|
onBack?: () => void;
|
|
9
|
-
children?:
|
|
9
|
+
children?: ReactNode;
|
|
10
10
|
} & NativeProps<'--height' | '--border-bottom'>;
|
|
11
11
|
export declare const NavBar: FC<NavBarProps>;
|
|
@@ -18,6 +18,7 @@ var _shouldRender = require("../../utils/should-render");
|
|
|
18
18
|
var _antdMobileIcons = require("antd-mobile-icons");
|
|
19
19
|
var _popupBaseProps = require("./popup-base-props");
|
|
20
20
|
var _useInnerVisible = require("../../utils/use-inner-visible");
|
|
21
|
+
var _configProvider = require("../config-provider");
|
|
21
22
|
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); }
|
|
22
23
|
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; }
|
|
23
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -27,6 +28,9 @@ const defaultProps = Object.assign(Object.assign({}, _popupBaseProps.defaultPopu
|
|
|
27
28
|
});
|
|
28
29
|
const Popup = p => {
|
|
29
30
|
const props = (0, _withDefaultProps.mergeProps)(defaultProps, p);
|
|
31
|
+
const {
|
|
32
|
+
locale
|
|
33
|
+
} = (0, _configProvider.useConfig)();
|
|
30
34
|
const bodyCls = (0, _classnames.default)(`${classPrefix}-body`, props.bodyClassName, `${classPrefix}-body-position-${props.position}`);
|
|
31
35
|
const [active, setActive] = (0, _react.useState)(props.visible);
|
|
32
36
|
(0, _ahooks.useIsomorphicLayoutEffect)(() => {
|
|
@@ -105,7 +109,9 @@ const Popup = p => {
|
|
|
105
109
|
onClick: () => {
|
|
106
110
|
var _a;
|
|
107
111
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
108
|
-
}
|
|
112
|
+
},
|
|
113
|
+
role: 'button',
|
|
114
|
+
"aria-label": locale.common.close
|
|
109
115
|
}, _react.default.createElement(_antdMobileIcons.CloseOutline, null)), props.children))));
|
|
110
116
|
return _react.default.createElement(_shouldRender.ShouldRender, {
|
|
111
117
|
active: active,
|
|
@@ -212,11 +212,14 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
|
|
|
212
212
|
} = props;
|
|
213
213
|
(0, _react.useEffect)(() => {
|
|
214
214
|
if (!autoplay || dragging) return;
|
|
215
|
-
|
|
215
|
+
let interval;
|
|
216
|
+
function tick() {
|
|
217
|
+
interval = window.setTimeout(tick, autoplayInterval);
|
|
216
218
|
swipeNext();
|
|
217
|
-
}
|
|
219
|
+
}
|
|
220
|
+
interval = window.setTimeout(tick, autoplayInterval);
|
|
218
221
|
return () => {
|
|
219
|
-
window.
|
|
222
|
+
if (interval) window.clearTimeout(interval);
|
|
220
223
|
};
|
|
221
224
|
}, [autoplay, autoplayInterval, dragging, count]);
|
|
222
225
|
function renderTrackInner() {
|
|
@@ -33,6 +33,8 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
33
33
|
(0, _devLog.devError)('TextArea', '`value` prop on `TextArea` should not be `null`. Consider using an empty string to clear the component.');
|
|
34
34
|
}
|
|
35
35
|
const nativeTextAreaRef = (0, _react.useRef)(null);
|
|
36
|
+
// https://github.com/ant-design/ant-design-mobile/issues/5961
|
|
37
|
+
const heightRef = (0, _react.useRef)('auto');
|
|
36
38
|
(0, _react.useImperativeHandle)(ref, () => ({
|
|
37
39
|
clear: () => {
|
|
38
40
|
setValue('');
|
|
@@ -53,7 +55,7 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
53
55
|
if (!autoSize) return;
|
|
54
56
|
const textArea = nativeTextAreaRef.current;
|
|
55
57
|
if (!textArea) return;
|
|
56
|
-
textArea.style.height =
|
|
58
|
+
textArea.style.height = heightRef.current;
|
|
57
59
|
let height = textArea.scrollHeight;
|
|
58
60
|
if (typeof autoSize === 'object') {
|
|
59
61
|
const computedStyle = window.getComputedStyle(textArea);
|
|
@@ -65,6 +67,7 @@ const TextArea = (0, _react.forwardRef)((p, ref) => {
|
|
|
65
67
|
height = Math.min(height, autoSize.maxRows * lineHeight);
|
|
66
68
|
}
|
|
67
69
|
}
|
|
70
|
+
heightRef.current = `${height}px`;
|
|
68
71
|
textArea.style.height = `${height}px`;
|
|
69
72
|
}, [value, autoSize]);
|
|
70
73
|
const compositingRef = (0, _react.useRef)(false);
|
package/2x/cjs/locales/base.d.ts
CHANGED
package/2x/cjs/locales/base.js
CHANGED
package/2x/cjs/locales/zh-CN.js
CHANGED
package/2x/cjs/locales/zh-HK.js
CHANGED
package/2x/cjs/locales/zh-TW.js
CHANGED
|
@@ -9,5 +9,6 @@ export declare type EllipsisProps = {
|
|
|
9
9
|
collapseText?: string;
|
|
10
10
|
stopPropagationForActionButtons?: PropagationEvent[];
|
|
11
11
|
onContentClick?: (e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
12
|
+
defaultExpanded?: boolean;
|
|
12
13
|
} & NativeProps;
|
|
13
14
|
export declare const Ellipsis: FC<EllipsisProps>;
|
|
@@ -13,13 +13,14 @@ const defaultProps = {
|
|
|
13
13
|
content: '',
|
|
14
14
|
collapseText: '',
|
|
15
15
|
stopPropagationForActionButtons: [],
|
|
16
|
-
onContentClick: () => {}
|
|
16
|
+
onContentClick: () => {},
|
|
17
|
+
defaultExpanded: false
|
|
17
18
|
};
|
|
18
19
|
export const Ellipsis = p => {
|
|
19
20
|
const props = mergeProps(defaultProps, p);
|
|
20
21
|
const rootRef = useRef(null);
|
|
21
22
|
const [ellipsised, setEllipsised] = useState({});
|
|
22
|
-
const [expanded, setExpanded] = useState(
|
|
23
|
+
const [expanded, setExpanded] = useState(props.defaultExpanded);
|
|
23
24
|
const [exceeded, setExceeded] = useState(false);
|
|
24
25
|
const chars = useMemo(() => runes(props.content), [props.content]);
|
|
25
26
|
function getSubString(start, end) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
import { NativeProps } from '../../utils/native-props';
|
|
3
3
|
export declare type NavBarProps = {
|
|
4
4
|
back?: ReactNode;
|
|
@@ -6,6 +6,6 @@ export declare type NavBarProps = {
|
|
|
6
6
|
left?: ReactNode;
|
|
7
7
|
right?: ReactNode;
|
|
8
8
|
onBack?: () => void;
|
|
9
|
-
children?:
|
|
9
|
+
children?: ReactNode;
|
|
10
10
|
} & NativeProps<'--height' | '--border-bottom'>;
|
|
11
11
|
export declare const NavBar: FC<NavBarProps>;
|
|
@@ -12,12 +12,16 @@ import { ShouldRender } from '../../utils/should-render';
|
|
|
12
12
|
import { CloseOutline } from 'antd-mobile-icons';
|
|
13
13
|
import { defaultPopupBaseProps } from './popup-base-props';
|
|
14
14
|
import { useInnerVisible } from '../../utils/use-inner-visible';
|
|
15
|
+
import { useConfig } from '../config-provider';
|
|
15
16
|
const classPrefix = `adm-popup`;
|
|
16
17
|
const defaultProps = Object.assign(Object.assign({}, defaultPopupBaseProps), {
|
|
17
18
|
position: 'bottom'
|
|
18
19
|
});
|
|
19
20
|
export const Popup = p => {
|
|
20
21
|
const props = mergeProps(defaultProps, p);
|
|
22
|
+
const {
|
|
23
|
+
locale
|
|
24
|
+
} = useConfig();
|
|
21
25
|
const bodyCls = classNames(`${classPrefix}-body`, props.bodyClassName, `${classPrefix}-body-position-${props.position}`);
|
|
22
26
|
const [active, setActive] = useState(props.visible);
|
|
23
27
|
useIsomorphicLayoutEffect(() => {
|
|
@@ -96,7 +100,9 @@ export const Popup = p => {
|
|
|
96
100
|
onClick: () => {
|
|
97
101
|
var _a;
|
|
98
102
|
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
99
|
-
}
|
|
103
|
+
},
|
|
104
|
+
role: 'button',
|
|
105
|
+
"aria-label": locale.common.close
|
|
100
106
|
}, React.createElement(CloseOutline, null)), props.children))));
|
|
101
107
|
return React.createElement(ShouldRender, {
|
|
102
108
|
active: active,
|
|
@@ -203,11 +203,14 @@ export const Swiper = forwardRef(staged((p, ref) => {
|
|
|
203
203
|
} = props;
|
|
204
204
|
useEffect(() => {
|
|
205
205
|
if (!autoplay || dragging) return;
|
|
206
|
-
|
|
206
|
+
let interval;
|
|
207
|
+
function tick() {
|
|
208
|
+
interval = window.setTimeout(tick, autoplayInterval);
|
|
207
209
|
swipeNext();
|
|
208
|
-
}
|
|
210
|
+
}
|
|
211
|
+
interval = window.setTimeout(tick, autoplayInterval);
|
|
209
212
|
return () => {
|
|
210
|
-
window.
|
|
213
|
+
if (interval) window.clearTimeout(interval);
|
|
211
214
|
};
|
|
212
215
|
}, [autoplay, autoplayInterval, dragging, count]);
|
|
213
216
|
function renderTrackInner() {
|
|
@@ -25,6 +25,8 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
25
25
|
devError('TextArea', '`value` prop on `TextArea` should not be `null`. Consider using an empty string to clear the component.');
|
|
26
26
|
}
|
|
27
27
|
const nativeTextAreaRef = useRef(null);
|
|
28
|
+
// https://github.com/ant-design/ant-design-mobile/issues/5961
|
|
29
|
+
const heightRef = useRef('auto');
|
|
28
30
|
useImperativeHandle(ref, () => ({
|
|
29
31
|
clear: () => {
|
|
30
32
|
setValue('');
|
|
@@ -45,7 +47,7 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
45
47
|
if (!autoSize) return;
|
|
46
48
|
const textArea = nativeTextAreaRef.current;
|
|
47
49
|
if (!textArea) return;
|
|
48
|
-
textArea.style.height =
|
|
50
|
+
textArea.style.height = heightRef.current;
|
|
49
51
|
let height = textArea.scrollHeight;
|
|
50
52
|
if (typeof autoSize === 'object') {
|
|
51
53
|
const computedStyle = window.getComputedStyle(textArea);
|
|
@@ -57,6 +59,7 @@ export const TextArea = forwardRef((p, ref) => {
|
|
|
57
59
|
height = Math.min(height, autoSize.maxRows * lineHeight);
|
|
58
60
|
}
|
|
59
61
|
}
|
|
62
|
+
heightRef.current = `${height}px`;
|
|
60
63
|
textArea.style.height = `${height}px`;
|
|
61
64
|
}, [value, autoSize]);
|
|
62
65
|
const compositingRef = useRef(false);
|
package/2x/es/locales/base.d.ts
CHANGED
package/2x/es/locales/base.js
CHANGED
package/2x/es/locales/en-US.d.ts
CHANGED
package/2x/es/locales/es-ES.d.ts
CHANGED
package/2x/es/locales/fa-IR.d.ts
CHANGED
package/2x/es/locales/fr-FR.d.ts
CHANGED
package/2x/es/locales/id-ID.d.ts
CHANGED
package/2x/es/locales/ja-JP.d.ts
CHANGED
package/2x/es/locales/kk-KZ.d.ts
CHANGED
package/2x/es/locales/ko-KR.d.ts
CHANGED
package/2x/es/locales/zh-CN.d.ts
CHANGED
package/2x/es/locales/zh-CN.js
CHANGED
package/2x/es/locales/zh-HK.d.ts
CHANGED
package/2x/es/locales/zh-HK.js
CHANGED
package/2x/es/locales/zh-TW.d.ts
CHANGED
package/2x/es/locales/zh-TW.js
CHANGED
package/2x/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "antd-mobile",
|
|
3
|
-
"version": "5.28.
|
|
3
|
+
"version": "5.28.1",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@floating-ui/dom": "^1.0.6",
|
|
6
6
|
"@rc-component/mini-decimal": "^1.0.1",
|
|
7
|
-
"@react-spring/web": "
|
|
7
|
+
"@react-spring/web": "~9.6.0",
|
|
8
8
|
"@use-gesture/react": "10.2.20",
|
|
9
9
|
"ahooks": "^3.7.2",
|
|
10
10
|
"antd-mobile-icons": "^0.3.0",
|