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
@@ -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,
@@ -14,7 +14,6 @@
14
14
  .adm-step .adm-step-indicator .adm-step-icon-container {
15
15
  position: absolute;
16
16
  z-index: 1;
17
- background: var(--adm-color-background);
18
17
  color: var(--icon-color);
19
18
  }
20
19
  .adm-step .adm-step-indicator .adm-step-icon-container > .antd-mobile-icon {
@@ -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/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",