antd-mobile 5.27.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 (154) hide show
  1. package/2x/README.md +1 -1
  2. package/2x/bundle/antd-mobile.cjs.development.js +681 -950
  3. package/2x/bundle/antd-mobile.cjs.js +9 -9
  4. package/2x/bundle/antd-mobile.es.development.js +681 -950
  5. package/2x/bundle/antd-mobile.es.js +5047 -5350
  6. package/2x/bundle/antd-mobile.umd.development.js +677 -946
  7. package/2x/bundle/antd-mobile.umd.js +9 -9
  8. package/2x/bundle/css-vars-patch.css +4 -0
  9. package/2x/bundle/style.css +0 -1
  10. package/2x/cjs/components/calendar/calendar.d.ts +1 -0
  11. package/2x/cjs/components/calendar/calendar.js +1 -1
  12. package/2x/cjs/components/cascader/cascader.patch.css +3 -0
  13. package/2x/cjs/components/ellipsis/ellipsis.d.ts +1 -0
  14. package/2x/cjs/components/ellipsis/ellipsis.js +3 -2
  15. package/2x/cjs/components/footer/footer.js +3 -3
  16. package/2x/cjs/components/input/input.js +1 -0
  17. package/2x/cjs/components/nav-bar/nav-bar.d.ts +2 -2
  18. package/2x/cjs/components/popup/popup.js +7 -1
  19. package/2x/cjs/components/steps/steps.css +0 -1
  20. package/2x/cjs/components/swiper/index.d.ts +1 -0
  21. package/2x/cjs/components/swiper/swiper.d.ts +9 -0
  22. package/2x/cjs/components/swiper/swiper.js +24 -5
  23. package/2x/cjs/components/text-area/text-area.js +4 -1
  24. package/2x/cjs/global/css-vars-patch.css +4 -0
  25. package/2x/cjs/locales/base.d.ts +1 -0
  26. package/2x/cjs/locales/base.js +2 -1
  27. package/2x/cjs/locales/en-US.d.ts +1 -0
  28. package/2x/cjs/locales/es-ES.d.ts +1 -0
  29. package/2x/cjs/locales/fa-IR.d.ts +1 -0
  30. package/2x/cjs/locales/fr-FR.d.ts +1 -0
  31. package/2x/cjs/locales/id-ID.d.ts +1 -0
  32. package/2x/cjs/locales/ja-JP.d.ts +1 -0
  33. package/2x/cjs/locales/kk-KZ.d.ts +1 -0
  34. package/2x/cjs/locales/ko-KR.d.ts +1 -0
  35. package/2x/cjs/locales/zh-CN.d.ts +1 -0
  36. package/2x/cjs/locales/zh-CN.js +2 -1
  37. package/2x/cjs/locales/zh-HK.d.ts +1 -0
  38. package/2x/cjs/locales/zh-HK.js +2 -1
  39. package/2x/cjs/locales/zh-TW.d.ts +1 -0
  40. package/2x/cjs/locales/zh-TW.js +2 -1
  41. package/2x/cjs/utils/with-func-props.d.ts +5 -0
  42. package/2x/cjs/utils/with-func-props.js +25 -0
  43. package/2x/es/components/calendar/calendar.d.ts +1 -0
  44. package/2x/es/components/calendar/calendar.js +1 -1
  45. package/2x/es/components/cascader/cascader.patch.css +3 -0
  46. package/2x/es/components/ellipsis/ellipsis.d.ts +1 -0
  47. package/2x/es/components/ellipsis/ellipsis.js +3 -2
  48. package/2x/es/components/footer/footer.js +1 -1
  49. package/2x/es/components/input/input.js +1 -0
  50. package/2x/es/components/nav-bar/nav-bar.d.ts +2 -2
  51. package/2x/es/components/popup/popup.js +7 -1
  52. package/2x/es/components/steps/steps.css +0 -1
  53. package/2x/es/components/swiper/index.d.ts +1 -0
  54. package/2x/es/components/swiper/swiper.d.ts +9 -0
  55. package/2x/es/components/swiper/swiper.js +24 -5
  56. package/2x/es/components/text-area/text-area.js +4 -1
  57. package/2x/es/global/css-vars-patch.css +4 -0
  58. package/2x/es/locales/base.d.ts +1 -0
  59. package/2x/es/locales/base.js +2 -1
  60. package/2x/es/locales/en-US.d.ts +1 -0
  61. package/2x/es/locales/es-ES.d.ts +1 -0
  62. package/2x/es/locales/fa-IR.d.ts +1 -0
  63. package/2x/es/locales/fr-FR.d.ts +1 -0
  64. package/2x/es/locales/id-ID.d.ts +1 -0
  65. package/2x/es/locales/ja-JP.d.ts +1 -0
  66. package/2x/es/locales/kk-KZ.d.ts +1 -0
  67. package/2x/es/locales/ko-KR.d.ts +1 -0
  68. package/2x/es/locales/zh-CN.d.ts +1 -0
  69. package/2x/es/locales/zh-CN.js +2 -1
  70. package/2x/es/locales/zh-HK.d.ts +1 -0
  71. package/2x/es/locales/zh-HK.js +2 -1
  72. package/2x/es/locales/zh-TW.d.ts +1 -0
  73. package/2x/es/locales/zh-TW.js +2 -1
  74. package/2x/es/utils/with-func-props.d.ts +5 -0
  75. package/2x/es/utils/with-func-props.js +19 -0
  76. package/2x/package.json +2 -2
  77. package/README.md +1 -1
  78. package/bundle/antd-mobile.cjs.development.js +681 -950
  79. package/bundle/antd-mobile.cjs.js +9 -9
  80. package/bundle/antd-mobile.compatible.umd.js +1 -1
  81. package/bundle/antd-mobile.es.development.js +681 -950
  82. package/bundle/antd-mobile.es.js +5047 -5350
  83. package/bundle/antd-mobile.umd.development.js +677 -946
  84. package/bundle/antd-mobile.umd.js +9 -9
  85. package/bundle/css-vars-patch.css +3 -0
  86. package/bundle/style.css +1 -1
  87. package/cjs/components/calendar/calendar.d.ts +1 -0
  88. package/cjs/components/calendar/calendar.js +1 -1
  89. package/cjs/components/cascader/cascader.patch.css +3 -0
  90. package/cjs/components/ellipsis/ellipsis.d.ts +1 -0
  91. package/cjs/components/ellipsis/ellipsis.js +3 -2
  92. package/cjs/components/footer/footer.js +3 -3
  93. package/cjs/components/input/input.js +1 -0
  94. package/cjs/components/nav-bar/nav-bar.d.ts +2 -2
  95. package/cjs/components/popup/popup.js +7 -1
  96. package/cjs/components/steps/steps.css +0 -1
  97. package/cjs/components/swiper/index.d.ts +1 -0
  98. package/cjs/components/swiper/swiper.d.ts +9 -0
  99. package/cjs/components/swiper/swiper.js +24 -5
  100. package/cjs/components/text-area/text-area.js +4 -1
  101. package/cjs/global/css-vars-patch.css +3 -0
  102. package/cjs/locales/base.d.ts +1 -0
  103. package/cjs/locales/base.js +2 -1
  104. package/cjs/locales/en-US.d.ts +1 -0
  105. package/cjs/locales/es-ES.d.ts +1 -0
  106. package/cjs/locales/fa-IR.d.ts +1 -0
  107. package/cjs/locales/fr-FR.d.ts +1 -0
  108. package/cjs/locales/id-ID.d.ts +1 -0
  109. package/cjs/locales/ja-JP.d.ts +1 -0
  110. package/cjs/locales/kk-KZ.d.ts +1 -0
  111. package/cjs/locales/ko-KR.d.ts +1 -0
  112. package/cjs/locales/zh-CN.d.ts +1 -0
  113. package/cjs/locales/zh-CN.js +2 -1
  114. package/cjs/locales/zh-HK.d.ts +1 -0
  115. package/cjs/locales/zh-HK.js +2 -1
  116. package/cjs/locales/zh-TW.d.ts +1 -0
  117. package/cjs/locales/zh-TW.js +2 -1
  118. package/cjs/utils/with-func-props.d.ts +5 -0
  119. package/cjs/utils/with-func-props.js +25 -0
  120. package/es/components/calendar/calendar.d.ts +1 -0
  121. package/es/components/calendar/calendar.js +1 -1
  122. package/es/components/cascader/cascader.patch.css +3 -0
  123. package/es/components/ellipsis/ellipsis.d.ts +1 -0
  124. package/es/components/ellipsis/ellipsis.js +3 -2
  125. package/es/components/footer/footer.js +1 -1
  126. package/es/components/input/input.js +1 -0
  127. package/es/components/nav-bar/nav-bar.d.ts +2 -2
  128. package/es/components/popup/popup.js +7 -1
  129. package/es/components/steps/steps.css +0 -1
  130. package/es/components/swiper/index.d.ts +1 -0
  131. package/es/components/swiper/swiper.d.ts +9 -0
  132. package/es/components/swiper/swiper.js +24 -5
  133. package/es/components/text-area/text-area.js +4 -1
  134. package/es/global/css-vars-patch.css +3 -0
  135. package/es/locales/base.d.ts +1 -0
  136. package/es/locales/base.js +2 -1
  137. package/es/locales/en-US.d.ts +1 -0
  138. package/es/locales/es-ES.d.ts +1 -0
  139. package/es/locales/fa-IR.d.ts +1 -0
  140. package/es/locales/fr-FR.d.ts +1 -0
  141. package/es/locales/id-ID.d.ts +1 -0
  142. package/es/locales/ja-JP.d.ts +1 -0
  143. package/es/locales/kk-KZ.d.ts +1 -0
  144. package/es/locales/ko-KR.d.ts +1 -0
  145. package/es/locales/zh-CN.d.ts +1 -0
  146. package/es/locales/zh-CN.js +2 -1
  147. package/es/locales/zh-HK.d.ts +1 -0
  148. package/es/locales/zh-HK.js +2 -1
  149. package/es/locales/zh-TW.d.ts +1 -0
  150. package/es/locales/zh-TW.js +2 -1
  151. package/es/utils/with-func-props.d.ts +5 -0
  152. package/es/utils/with-func-props.js +19 -0
  153. package/package.json +2 -2
  154. package/umd/antd-mobile.js +1 -1
@@ -17,10 +17,16 @@ var _stagedComponents = require("staged-components");
17
17
  var _useRefState = require("../../utils/use-ref-state");
18
18
  var _bound = require("../../utils/bound");
19
19
  var _ahooks = require("ahooks");
20
+ var _withFuncProps = require("../../utils/with-func-props");
20
21
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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
  const classPrefix = `adm-swiper`;
25
+ const eventToPropRecord = {
26
+ 'mousedown': 'onMouseDown',
27
+ 'mousemove': 'onMouseMove',
28
+ 'mouseup': 'onMouseUp'
29
+ };
24
30
  const defaultProps = {
25
31
  defaultIndex: 0,
26
32
  allowTouchMove: true,
@@ -31,7 +37,8 @@ const defaultProps = {
31
37
  slideSize: 100,
32
38
  trackOffset: 0,
33
39
  stuckAtBoundary: true,
34
- rubberband: true
40
+ rubberband: true,
41
+ stopPropagation: []
35
42
  };
36
43
  let currentUid;
37
44
  const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) => {
@@ -205,11 +212,14 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
205
212
  } = props;
206
213
  (0, _react.useEffect)(() => {
207
214
  if (!autoplay || dragging) return;
208
- const interval = window.setInterval(() => {
215
+ let interval;
216
+ function tick() {
217
+ interval = window.setTimeout(tick, autoplayInterval);
209
218
  swipeNext();
210
- }, autoplayInterval);
219
+ }
220
+ interval = window.setTimeout(tick, autoplayInterval);
211
221
  return () => {
212
- window.clearInterval(interval);
222
+ if (interval) window.clearTimeout(interval);
213
223
  };
214
224
  }, [autoplay, autoplayInterval, dragging, count]);
215
225
  function renderTrackInner() {
@@ -248,6 +258,15 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
248
258
  '--slide-size': `${props.slideSize}%`,
249
259
  '--track-offset': `${props.trackOffset}%`
250
260
  };
261
+ const dragProps = Object.assign({}, props.allowTouchMove ? bind() : {});
262
+ const stopPropagationProps = {};
263
+ for (const key of props.stopPropagation) {
264
+ const prop = eventToPropRecord[key];
265
+ stopPropagationProps[prop] = function (e) {
266
+ e.stopPropagation();
267
+ };
268
+ }
269
+ const mergedProps = (0, _withFuncProps.mergeFuncProps)(dragProps, stopPropagationProps);
251
270
  return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
252
271
  className: (0, _classnames.default)(classPrefix, `${classPrefix}-${props.direction}`),
253
272
  style: style
@@ -262,7 +281,7 @@ const Swiper = (0, _react.forwardRef)((0, _stagedComponents.staged)((p, ref) =>
262
281
  }
263
282
  forceCancelDrag();
264
283
  }
265
- }, props.allowTouchMove ? bind() : {}), renderTrackInner()), props.indicator === undefined ? _react.default.createElement("div", {
284
+ }, mergedProps), renderTrackInner()), props.indicator === undefined ? _react.default.createElement("div", {
266
285
  className: `${classPrefix}-indicator`
267
286
  }, _react.default.createElement(_pageIndicator.default, Object.assign({}, props.indicatorProps, {
268
287
  total: count,
@@ -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);
@@ -85,6 +85,9 @@
85
85
  .adm-button.adm-button-shape-rectangular {
86
86
  border-radius: 0;
87
87
  }
88
+ .adm-cascader .adm-cascader-view-content {
89
+ height: 310px;
90
+ }
88
91
  .adm-center-popup {
89
92
  z-index: 1000;
90
93
  }
@@ -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: ['一', '二', '三', '四', '五', '六', '日'],
@@ -0,0 +1,5 @@
1
+ declare type Merge<T, P> = {
2
+ [K in keyof T & keyof P]: P[K] | T[K];
3
+ };
4
+ export declare function mergeFuncProps<T extends Record<string, any>, P extends Record<string, any>>(p1: T, p2: P): Merge<T, P>;
5
+ export {};
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.mergeFuncProps = mergeFuncProps;
7
+ function mergeFuncProps(p1, p2) {
8
+ const p1Keys = Object.keys(p1);
9
+ const p2Keys = Object.keys(p2);
10
+ const keys = new Set([...p1Keys, ...p2Keys]);
11
+ const res = {};
12
+ keys.forEach(key => {
13
+ const p1Value = p1[key];
14
+ const p2Value = p2[key];
15
+ if (typeof p1Value === 'function' && typeof p2Value === 'function') {
16
+ res[key] = function (...args) {
17
+ p1Value(...args);
18
+ p2Value(...args);
19
+ };
20
+ } else {
21
+ res[key] = p1Value || p2Value;
22
+ }
23
+ });
24
+ return res;
25
+ }
@@ -13,6 +13,7 @@ export declare type CalendarProps = {
13
13
  onPageChange?: (year: number, month: number) => void;
14
14
  weekStartsOn?: 'Monday' | 'Sunday';
15
15
  renderLabel?: (date: Date) => React.ReactNode;
16
+ renderDate?: (date: Date) => React.ReactNode;
16
17
  allowClear?: boolean;
17
18
  max?: Date;
18
19
  min?: Date;
@@ -188,7 +188,7 @@ export const Calendar = forwardRef((p, ref) => {
188
188
  }
189
189
  }, React.createElement("div", {
190
190
  className: `${classPrefix}-cell-top`
191
- }, d.date()), React.createElement("div", {
191
+ }, props.renderDate ? props.renderDate(d.toDate()) : d.date()), React.createElement("div", {
192
192
  className: `${classPrefix}-cell-bottom`
193
193
  }, (_a = props.renderLabel) === null || _a === void 0 ? void 0 : _a.call(props, d.toDate()))));
194
194
  iterator = iterator.add(1, 'day');
@@ -0,0 +1,3 @@
1
+ .adm-cascader .adm-cascader-view-content {
2
+ height: 310px;
3
+ }
@@ -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) {
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { withNativeProps } from '../../utils/native-props';
4
4
  import { mergeProps } from '../../utils/with-default-props';
5
- import { Divider } from '../divider/divider';
5
+ import Divider from '../divider';
6
6
  const classPrefix = `adm-footer`;
7
7
  const defaultProps = {
8
8
  label: '',
@@ -120,6 +120,7 @@ export const Input = forwardRef((p, ref) => {
120
120
  (_a = props.onCompositionEnd) === null || _a === void 0 ? void 0 : _a.call(props, e);
121
121
  },
122
122
  onClick: props.onClick,
123
+ step: props.step,
123
124
  role: props.role,
124
125
  "aria-valuenow": props['aria-valuenow'],
125
126
  "aria-valuemax": props['aria-valuemax'],
@@ -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 {
@@ -14,6 +14,7 @@ declare const _default: import("react").ForwardRefExoticComponent<{
14
14
  trackOffset?: number | undefined;
15
15
  stuckAtBoundary?: boolean | undefined;
16
16
  rubberband?: boolean | undefined;
17
+ stopPropagation?: ("mousedown" | "mousemove" | "mouseup")[] | undefined;
17
18
  children?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | undefined;
18
19
  } & {
19
20
  className?: string | undefined;
@@ -1,6 +1,12 @@
1
1
  import React, { ReactElement, ReactNode } from 'react';
2
2
  import { NativeProps } from '../../utils/native-props';
3
3
  import { PageIndicatorProps } from '../page-indicator';
4
+ declare const eventToPropRecord: {
5
+ readonly mousedown: "onMouseDown";
6
+ readonly mousemove: "onMouseMove";
7
+ readonly mouseup: "onMouseUp";
8
+ };
9
+ declare type PropagationEvent = keyof typeof eventToPropRecord;
4
10
  export declare type SwiperRef = {
5
11
  swipeTo: (index: number) => void;
6
12
  swipeNext: () => void;
@@ -20,6 +26,7 @@ export declare type SwiperProps = {
20
26
  trackOffset?: number;
21
27
  stuckAtBoundary?: boolean;
22
28
  rubberband?: boolean;
29
+ stopPropagation?: PropagationEvent[];
23
30
  children?: ReactElement | ReactElement[];
24
31
  } & NativeProps<'--height' | '--width' | '--border-radius' | '--track-padding'>;
25
32
  export declare const Swiper: React.ForwardRefExoticComponent<{
@@ -36,9 +43,11 @@ export declare const Swiper: React.ForwardRefExoticComponent<{
36
43
  trackOffset?: number | undefined;
37
44
  stuckAtBoundary?: boolean | undefined;
38
45
  rubberband?: boolean | undefined;
46
+ stopPropagation?: ("mousedown" | "mousemove" | "mouseup")[] | undefined;
39
47
  children?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
40
48
  } & {
41
49
  className?: string | undefined;
42
50
  style?: (React.CSSProperties & Partial<Record<"--width" | "--height" | "--border-radius" | "--track-padding", string>>) | undefined;
43
51
  tabIndex?: number | undefined;
44
52
  } & React.AriaAttributes & React.RefAttributes<SwiperRef>>;
53
+ export {};
@@ -11,7 +11,13 @@ import { staged } from 'staged-components';
11
11
  import { useRefState } from '../../utils/use-ref-state';
12
12
  import { bound } from '../../utils/bound';
13
13
  import { useIsomorphicLayoutEffect, useUpdateEffect } from 'ahooks';
14
+ import { mergeFuncProps } from '../../utils/with-func-props';
14
15
  const classPrefix = `adm-swiper`;
16
+ const eventToPropRecord = {
17
+ 'mousedown': 'onMouseDown',
18
+ 'mousemove': 'onMouseMove',
19
+ 'mouseup': 'onMouseUp'
20
+ };
15
21
  const defaultProps = {
16
22
  defaultIndex: 0,
17
23
  allowTouchMove: true,
@@ -22,7 +28,8 @@ const defaultProps = {
22
28
  slideSize: 100,
23
29
  trackOffset: 0,
24
30
  stuckAtBoundary: true,
25
- rubberband: true
31
+ rubberband: true,
32
+ stopPropagation: []
26
33
  };
27
34
  let currentUid;
28
35
  export const Swiper = forwardRef(staged((p, ref) => {
@@ -196,11 +203,14 @@ export const Swiper = forwardRef(staged((p, ref) => {
196
203
  } = props;
197
204
  useEffect(() => {
198
205
  if (!autoplay || dragging) return;
199
- const interval = window.setInterval(() => {
206
+ let interval;
207
+ function tick() {
208
+ interval = window.setTimeout(tick, autoplayInterval);
200
209
  swipeNext();
201
- }, autoplayInterval);
210
+ }
211
+ interval = window.setTimeout(tick, autoplayInterval);
202
212
  return () => {
203
- window.clearInterval(interval);
213
+ if (interval) window.clearTimeout(interval);
204
214
  };
205
215
  }, [autoplay, autoplayInterval, dragging, count]);
206
216
  function renderTrackInner() {
@@ -239,6 +249,15 @@ export const Swiper = forwardRef(staged((p, ref) => {
239
249
  '--slide-size': `${props.slideSize}%`,
240
250
  '--track-offset': `${props.trackOffset}%`
241
251
  };
252
+ const dragProps = Object.assign({}, props.allowTouchMove ? bind() : {});
253
+ const stopPropagationProps = {};
254
+ for (const key of props.stopPropagation) {
255
+ const prop = eventToPropRecord[key];
256
+ stopPropagationProps[prop] = function (e) {
257
+ e.stopPropagation();
258
+ };
259
+ }
260
+ const mergedProps = mergeFuncProps(dragProps, stopPropagationProps);
242
261
  return withNativeProps(props, React.createElement("div", {
243
262
  className: classNames(classPrefix, `${classPrefix}-${props.direction}`),
244
263
  style: style
@@ -253,7 +272,7 @@ export const Swiper = forwardRef(staged((p, ref) => {
253
272
  }
254
273
  forceCancelDrag();
255
274
  }
256
- }, props.allowTouchMove ? bind() : {}), renderTrackInner()), props.indicator === undefined ? React.createElement("div", {
275
+ }, mergedProps), renderTrackInner()), props.indicator === undefined ? React.createElement("div", {
257
276
  className: `${classPrefix}-indicator`
258
277
  }, React.createElement(PageIndicator, Object.assign({}, props.indicatorProps, {
259
278
  total: count,
@@ -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);
@@ -85,6 +85,9 @@
85
85
  .adm-button.adm-button-shape-rectangular {
86
86
  border-radius: 0;
87
87
  }
88
+ .adm-cascader .adm-cascader-view-content {
89
+ height: 310px;
90
+ }
88
91
  .adm-center-popup {
89
92
  z-index: 1000;
90
93
  }
@@ -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[];