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.
Files changed (110) hide show
  1. package/2x/bundle/antd-mobile.cjs.development.js +235 -200
  2. package/2x/bundle/antd-mobile.cjs.js +9 -9
  3. package/2x/bundle/antd-mobile.es.development.js +235 -200
  4. package/2x/bundle/antd-mobile.es.js +5086 -5066
  5. package/2x/bundle/antd-mobile.umd.development.js +235 -200
  6. package/2x/bundle/antd-mobile.umd.js +9 -9
  7. package/2x/bundle/style.css +0 -1
  8. package/2x/cjs/components/ellipsis/ellipsis.d.ts +1 -0
  9. package/2x/cjs/components/ellipsis/ellipsis.js +3 -2
  10. package/2x/cjs/components/nav-bar/nav-bar.d.ts +2 -2
  11. package/2x/cjs/components/popup/popup.js +7 -1
  12. package/2x/cjs/components/steps/steps.css +0 -1
  13. package/2x/cjs/components/swiper/swiper.js +6 -3
  14. package/2x/cjs/components/text-area/text-area.js +4 -1
  15. package/2x/cjs/locales/base.d.ts +1 -0
  16. package/2x/cjs/locales/base.js +2 -1
  17. package/2x/cjs/locales/en-US.d.ts +1 -0
  18. package/2x/cjs/locales/es-ES.d.ts +1 -0
  19. package/2x/cjs/locales/fa-IR.d.ts +1 -0
  20. package/2x/cjs/locales/fr-FR.d.ts +1 -0
  21. package/2x/cjs/locales/id-ID.d.ts +1 -0
  22. package/2x/cjs/locales/ja-JP.d.ts +1 -0
  23. package/2x/cjs/locales/kk-KZ.d.ts +1 -0
  24. package/2x/cjs/locales/ko-KR.d.ts +1 -0
  25. package/2x/cjs/locales/zh-CN.d.ts +1 -0
  26. package/2x/cjs/locales/zh-CN.js +2 -1
  27. package/2x/cjs/locales/zh-HK.d.ts +1 -0
  28. package/2x/cjs/locales/zh-HK.js +2 -1
  29. package/2x/cjs/locales/zh-TW.d.ts +1 -0
  30. package/2x/cjs/locales/zh-TW.js +2 -1
  31. package/2x/es/components/ellipsis/ellipsis.d.ts +1 -0
  32. package/2x/es/components/ellipsis/ellipsis.js +3 -2
  33. package/2x/es/components/nav-bar/nav-bar.d.ts +2 -2
  34. package/2x/es/components/popup/popup.js +7 -1
  35. package/2x/es/components/steps/steps.css +0 -1
  36. package/2x/es/components/swiper/swiper.js +6 -3
  37. package/2x/es/components/text-area/text-area.js +4 -1
  38. package/2x/es/locales/base.d.ts +1 -0
  39. package/2x/es/locales/base.js +2 -1
  40. package/2x/es/locales/en-US.d.ts +1 -0
  41. package/2x/es/locales/es-ES.d.ts +1 -0
  42. package/2x/es/locales/fa-IR.d.ts +1 -0
  43. package/2x/es/locales/fr-FR.d.ts +1 -0
  44. package/2x/es/locales/id-ID.d.ts +1 -0
  45. package/2x/es/locales/ja-JP.d.ts +1 -0
  46. package/2x/es/locales/kk-KZ.d.ts +1 -0
  47. package/2x/es/locales/ko-KR.d.ts +1 -0
  48. package/2x/es/locales/zh-CN.d.ts +1 -0
  49. package/2x/es/locales/zh-CN.js +2 -1
  50. package/2x/es/locales/zh-HK.d.ts +1 -0
  51. package/2x/es/locales/zh-HK.js +2 -1
  52. package/2x/es/locales/zh-TW.d.ts +1 -0
  53. package/2x/es/locales/zh-TW.js +2 -1
  54. package/2x/package.json +2 -2
  55. package/bundle/antd-mobile.cjs.development.js +235 -200
  56. package/bundle/antd-mobile.cjs.js +9 -9
  57. package/bundle/antd-mobile.compatible.umd.js +1 -1
  58. package/bundle/antd-mobile.es.development.js +235 -200
  59. package/bundle/antd-mobile.es.js +5086 -5066
  60. package/bundle/antd-mobile.umd.development.js +235 -200
  61. package/bundle/antd-mobile.umd.js +9 -9
  62. package/bundle/style.css +1 -1
  63. package/cjs/components/ellipsis/ellipsis.d.ts +1 -0
  64. package/cjs/components/ellipsis/ellipsis.js +3 -2
  65. package/cjs/components/nav-bar/nav-bar.d.ts +2 -2
  66. package/cjs/components/popup/popup.js +7 -1
  67. package/cjs/components/steps/steps.css +0 -1
  68. package/cjs/components/swiper/swiper.js +6 -3
  69. package/cjs/components/text-area/text-area.js +4 -1
  70. package/cjs/locales/base.d.ts +1 -0
  71. package/cjs/locales/base.js +2 -1
  72. package/cjs/locales/en-US.d.ts +1 -0
  73. package/cjs/locales/es-ES.d.ts +1 -0
  74. package/cjs/locales/fa-IR.d.ts +1 -0
  75. package/cjs/locales/fr-FR.d.ts +1 -0
  76. package/cjs/locales/id-ID.d.ts +1 -0
  77. package/cjs/locales/ja-JP.d.ts +1 -0
  78. package/cjs/locales/kk-KZ.d.ts +1 -0
  79. package/cjs/locales/ko-KR.d.ts +1 -0
  80. package/cjs/locales/zh-CN.d.ts +1 -0
  81. package/cjs/locales/zh-CN.js +2 -1
  82. package/cjs/locales/zh-HK.d.ts +1 -0
  83. package/cjs/locales/zh-HK.js +2 -1
  84. package/cjs/locales/zh-TW.d.ts +1 -0
  85. package/cjs/locales/zh-TW.js +2 -1
  86. package/es/components/ellipsis/ellipsis.d.ts +1 -0
  87. package/es/components/ellipsis/ellipsis.js +3 -2
  88. package/es/components/nav-bar/nav-bar.d.ts +2 -2
  89. package/es/components/popup/popup.js +7 -1
  90. package/es/components/steps/steps.css +0 -1
  91. package/es/components/swiper/swiper.js +6 -3
  92. package/es/components/text-area/text-area.js +4 -1
  93. package/es/locales/base.d.ts +1 -0
  94. package/es/locales/base.js +2 -1
  95. package/es/locales/en-US.d.ts +1 -0
  96. package/es/locales/es-ES.d.ts +1 -0
  97. package/es/locales/fa-IR.d.ts +1 -0
  98. package/es/locales/fr-FR.d.ts +1 -0
  99. package/es/locales/id-ID.d.ts +1 -0
  100. package/es/locales/ja-JP.d.ts +1 -0
  101. package/es/locales/kk-KZ.d.ts +1 -0
  102. package/es/locales/ko-KR.d.ts +1 -0
  103. package/es/locales/zh-CN.d.ts +1 -0
  104. package/es/locales/zh-CN.js +2 -1
  105. package/es/locales/zh-HK.d.ts +1 -0
  106. package/es/locales/zh-HK.js +2 -1
  107. package/es/locales/zh-TW.d.ts +1 -0
  108. package/es/locales/zh-TW.js +2 -1
  109. package/package.json +2 -2
  110. package/umd/antd-mobile.js +1 -1
@@ -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)(false);
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 React, { FC, ReactNode } from 'react';
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?: React.ReactNode;
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,
@@ -17,7 +17,6 @@
17
17
  .adm-step .adm-step-indicator .adm-step-icon-container {
18
18
  position: absolute;
19
19
  z-index: 1;
20
- background: var(--adm-color-background);
21
20
  color: var(--icon-color);
22
21
  }
23
22
 
@@ -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
- const interval = window.setInterval(() => {
215
+ let interval;
216
+ function tick() {
217
+ interval = window.setTimeout(tick, autoplayInterval);
216
218
  swipeNext();
217
- }, autoplayInterval);
219
+ }
220
+ interval = window.setTimeout(tick, autoplayInterval);
218
221
  return () => {
219
- window.clearInterval(interval);
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 = 'auto';
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);
@@ -4,6 +4,7 @@ export declare const base: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -10,7 +10,8 @@ const base = {
10
10
  common: {
11
11
  confirm: 'Confirm',
12
12
  cancel: 'Cancel',
13
- loading: 'Loading'
13
+ loading: 'Loading',
14
+ close: 'Close'
14
15
  },
15
16
  Calendar: {
16
17
  markItems: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
@@ -4,6 +4,7 @@ declare const enUS: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const esES: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const faIR: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const frFR: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const idID: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const jaJP: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const kkKZ: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const koKR: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const zhCN: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -12,7 +12,8 @@ const zhCN = (0, _mergeLocale.mergeLocale)(_base.base, {
12
12
  common: {
13
13
  confirm: '确定',
14
14
  cancel: '取消',
15
- loading: '加载中'
15
+ loading: '加载中',
16
+ close: '关闭'
16
17
  },
17
18
  Calendar: {
18
19
  markItems: ['一', '二', '三', '四', '五', '六', '日'],
@@ -4,6 +4,7 @@ declare const zhHK: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -12,7 +12,8 @@ const zhHK = (0, _mergeLocale.mergeLocale)(_base.base, {
12
12
  common: {
13
13
  confirm: '確定',
14
14
  cancel: '取消',
15
- loading: '加載中'
15
+ loading: '加載中',
16
+ close: '關閉'
16
17
  },
17
18
  Calendar: {
18
19
  markItems: ['一', '二', '三', '四', '五', '六', '日'],
@@ -4,6 +4,7 @@ declare const zhTW: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -12,7 +12,8 @@ const zhTW = (0, _mergeLocale.mergeLocale)(_base.base, {
12
12
  common: {
13
13
  confirm: '確定',
14
14
  cancel: '取消',
15
- loading: '加載中'
15
+ loading: '加載中',
16
+ close: '關閉'
16
17
  },
17
18
  Calendar: {
18
19
  markItems: ['一', '二', '三', '四', '五', '六', '日'],
@@ -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(false);
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 React, { FC, ReactNode } from 'react';
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?: React.ReactNode;
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,
@@ -17,7 +17,6 @@
17
17
  .adm-step .adm-step-indicator .adm-step-icon-container {
18
18
  position: absolute;
19
19
  z-index: 1;
20
- background: var(--adm-color-background);
21
20
  color: var(--icon-color);
22
21
  }
23
22
 
@@ -203,11 +203,14 @@ export const Swiper = forwardRef(staged((p, ref) => {
203
203
  } = props;
204
204
  useEffect(() => {
205
205
  if (!autoplay || dragging) return;
206
- const interval = window.setInterval(() => {
206
+ let interval;
207
+ function tick() {
208
+ interval = window.setTimeout(tick, autoplayInterval);
207
209
  swipeNext();
208
- }, autoplayInterval);
210
+ }
211
+ interval = window.setTimeout(tick, autoplayInterval);
209
212
  return () => {
210
- window.clearInterval(interval);
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 = 'auto';
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);
@@ -4,6 +4,7 @@ export declare const base: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,7 +4,8 @@ export const base = {
4
4
  common: {
5
5
  confirm: 'Confirm',
6
6
  cancel: 'Cancel',
7
- loading: 'Loading'
7
+ loading: 'Loading',
8
+ close: 'Close'
8
9
  },
9
10
  Calendar: {
10
11
  markItems: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
@@ -4,6 +4,7 @@ declare const enUS: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const esES: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const faIR: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const frFR: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const idID: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const jaJP: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const kkKZ: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const koKR: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -4,6 +4,7 @@ declare const zhCN: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -6,7 +6,8 @@ const zhCN = mergeLocale(base, {
6
6
  common: {
7
7
  confirm: '确定',
8
8
  cancel: '取消',
9
- loading: '加载中'
9
+ loading: '加载中',
10
+ close: '关闭'
10
11
  },
11
12
  Calendar: {
12
13
  markItems: ['一', '二', '三', '四', '五', '六', '日'],
@@ -4,6 +4,7 @@ declare const zhHK: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -6,7 +6,8 @@ const zhHK = mergeLocale(base, {
6
6
  common: {
7
7
  confirm: '確定',
8
8
  cancel: '取消',
9
- loading: '加載中'
9
+ loading: '加載中',
10
+ close: '關閉'
10
11
  },
11
12
  Calendar: {
12
13
  markItems: ['一', '二', '三', '四', '五', '六', '日'],
@@ -4,6 +4,7 @@ declare const zhTW: {
4
4
  confirm: string;
5
5
  cancel: string;
6
6
  loading: string;
7
+ close: string;
7
8
  };
8
9
  Calendar: {
9
10
  markItems: string[];
@@ -6,7 +6,8 @@ const zhTW = mergeLocale(base, {
6
6
  common: {
7
7
  confirm: '確定',
8
8
  cancel: '取消',
9
- loading: '加載中'
9
+ loading: '加載中',
10
+ close: '關閉'
10
11
  },
11
12
  Calendar: {
12
13
  markItems: ['一', '二', '三', '四', '五', '六', '日'],
package/2x/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "5.28.0",
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": "^9.5.5",
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",