antd-mobile 5.11.1 → 5.12.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 (202) hide show
  1. package/2x/cjs/components/calendar/calendar.d.ts +4 -0
  2. package/2x/cjs/components/calendar/calendar.js +13 -9
  3. package/2x/cjs/components/capsule-tabs/capsule-tabs.css +1 -0
  4. package/2x/cjs/components/cascade-picker/cascade-picker.d.ts +6 -3
  5. package/2x/cjs/components/cascade-picker/cascade-picker.js +8 -4
  6. package/2x/cjs/components/cascade-picker/index.d.ts +4 -2
  7. package/2x/cjs/components/date-picker/date-picker.d.ts +18 -4
  8. package/2x/cjs/components/date-picker/date-picker.js +5 -6
  9. package/2x/cjs/components/date-picker/index.d.ts +15 -2
  10. package/2x/cjs/components/dialog/dialog.js +2 -2
  11. package/2x/cjs/components/form/form-item.d.ts +2 -1
  12. package/2x/cjs/components/form/form-item.js +21 -4
  13. package/2x/cjs/components/form/utils.d.ts +1 -0
  14. package/2x/cjs/components/form/utils.js +20 -0
  15. package/2x/cjs/components/image-uploader/image-uploader.js +10 -4
  16. package/2x/cjs/components/input/input.d.ts +2 -2
  17. package/2x/cjs/components/input/input.js +1 -0
  18. package/2x/cjs/components/jumbo-tabs/jumbo-tabs.css +1 -0
  19. package/2x/cjs/components/list/list-item.js +7 -5
  20. package/2x/cjs/components/list/list.css +1 -0
  21. package/2x/cjs/components/mask/mask.js +1 -1
  22. package/2x/cjs/components/modal/modal.js +2 -2
  23. package/2x/cjs/components/picker/index.d.ts +44 -3
  24. package/2x/cjs/components/picker/picker.d.ts +32 -2
  25. package/2x/cjs/components/picker/picker.js +43 -16
  26. package/2x/cjs/components/popup/popup.js +1 -1
  27. package/2x/cjs/components/swipe-action/swipe-action.js +1 -1
  28. package/2x/cjs/components/tabs/tabs.css +1 -0
  29. package/2x/cjs/components/text-area/text-area.d.ts +2 -2
  30. package/2x/cjs/components/text-area/text-area.js +4 -1
  31. package/2x/cjs/components/toast/methods.js +3 -7
  32. package/2x/cjs/components/virtual-input/virtual-input.js +2 -1
  33. package/2x/cjs/locales/base.d.ts +1 -0
  34. package/2x/cjs/locales/base.js +2 -1
  35. package/2x/cjs/locales/en-US.d.ts +1 -0
  36. package/2x/cjs/locales/es-ES.d.ts +1 -0
  37. package/2x/cjs/locales/fa-IR.d.ts +1 -0
  38. package/2x/cjs/locales/ko-KR.d.ts +1 -0
  39. package/2x/cjs/locales/zh-CN.d.ts +1 -0
  40. package/2x/cjs/locales/zh-CN.js +2 -1
  41. package/2x/cjs/locales/zh-HK.d.ts +1 -0
  42. package/2x/cjs/locales/zh-TW.d.ts +1 -0
  43. package/2x/cjs/utils/is-node-with-content.d.ts +4 -0
  44. package/2x/cjs/utils/is-node-with-content.js +10 -0
  45. package/2x/cjs/utils/render-to-body.js +3 -6
  46. package/2x/cjs/utils/render.d.ts +9 -0
  47. package/2x/cjs/utils/render.js +92 -0
  48. package/2x/cjs/utils/use-drag-and-pinch.d.ts +1 -1
  49. package/2x/cjs/utils/use-props-value.d.ts +1 -1
  50. package/2x/es/components/calendar/calendar.d.ts +4 -0
  51. package/2x/es/components/calendar/calendar.js +13 -9
  52. package/2x/es/components/capsule-tabs/capsule-tabs.css +1 -0
  53. package/2x/es/components/cascade-picker/cascade-picker.d.ts +6 -3
  54. package/2x/es/components/cascade-picker/cascade-picker.js +4 -3
  55. package/2x/es/components/cascade-picker/index.d.ts +4 -2
  56. package/2x/es/components/date-picker/date-picker.d.ts +18 -4
  57. package/2x/es/components/date-picker/date-picker.js +6 -5
  58. package/2x/es/components/date-picker/index.d.ts +15 -2
  59. package/2x/es/components/dialog/dialog.js +2 -2
  60. package/2x/es/components/form/form-item.d.ts +2 -1
  61. package/2x/es/components/form/form-item.js +23 -4
  62. package/2x/es/components/form/utils.d.ts +1 -0
  63. package/2x/es/components/form/utils.js +17 -0
  64. package/2x/es/components/image-uploader/image-uploader.js +9 -4
  65. package/2x/es/components/input/input.d.ts +2 -2
  66. package/2x/es/components/input/input.js +1 -0
  67. package/2x/es/components/jumbo-tabs/jumbo-tabs.css +1 -0
  68. package/2x/es/components/list/list-item.js +6 -5
  69. package/2x/es/components/list/list.css +1 -0
  70. package/2x/es/components/mask/mask.js +1 -1
  71. package/2x/es/components/modal/modal.js +2 -2
  72. package/2x/es/components/picker/index.d.ts +44 -3
  73. package/2x/es/components/picker/picker.d.ts +32 -2
  74. package/2x/es/components/picker/picker.js +42 -17
  75. package/2x/es/components/popup/popup.js +1 -1
  76. package/2x/es/components/swipe-action/swipe-action.js +1 -1
  77. package/2x/es/components/tabs/tabs.css +1 -0
  78. package/2x/es/components/text-area/text-area.d.ts +2 -2
  79. package/2x/es/components/text-area/text-area.js +4 -2
  80. package/2x/es/components/toast/methods.js +3 -3
  81. package/2x/es/components/virtual-input/virtual-input.js +2 -1
  82. package/2x/es/locales/base.d.ts +1 -0
  83. package/2x/es/locales/base.js +2 -1
  84. package/2x/es/locales/en-US.d.ts +1 -0
  85. package/2x/es/locales/es-ES.d.ts +1 -0
  86. package/2x/es/locales/fa-IR.d.ts +1 -0
  87. package/2x/es/locales/ko-KR.d.ts +1 -0
  88. package/2x/es/locales/zh-CN.d.ts +1 -0
  89. package/2x/es/locales/zh-CN.js +2 -1
  90. package/2x/es/locales/zh-HK.d.ts +1 -0
  91. package/2x/es/locales/zh-TW.d.ts +1 -0
  92. package/2x/es/utils/is-node-with-content.d.ts +4 -0
  93. package/2x/es/utils/is-node-with-content.js +3 -0
  94. package/2x/es/utils/render-to-body.js +3 -3
  95. package/2x/es/utils/render.d.ts +9 -0
  96. package/2x/es/utils/render.js +77 -0
  97. package/2x/es/utils/use-drag-and-pinch.d.ts +1 -1
  98. package/2x/es/utils/use-props-value.d.ts +1 -1
  99. package/2x/package.json +8 -8
  100. package/bundle/antd-mobile.cjs.js +5072 -4312
  101. package/bundle/antd-mobile.es.js +5073 -4313
  102. package/bundle/style.css +4 -0
  103. package/cjs/components/calendar/calendar.d.ts +4 -0
  104. package/cjs/components/calendar/calendar.js +13 -9
  105. package/cjs/components/capsule-tabs/capsule-tabs.css +1 -0
  106. package/cjs/components/cascade-picker/cascade-picker.d.ts +6 -3
  107. package/cjs/components/cascade-picker/cascade-picker.js +8 -4
  108. package/cjs/components/cascade-picker/index.d.ts +4 -2
  109. package/cjs/components/date-picker/date-picker.d.ts +18 -4
  110. package/cjs/components/date-picker/date-picker.js +5 -6
  111. package/cjs/components/date-picker/index.d.ts +15 -2
  112. package/cjs/components/dialog/dialog.js +2 -2
  113. package/cjs/components/form/form-item.d.ts +2 -1
  114. package/cjs/components/form/form-item.js +21 -4
  115. package/cjs/components/form/utils.d.ts +1 -0
  116. package/cjs/components/form/utils.js +20 -0
  117. package/cjs/components/image-uploader/image-uploader.js +10 -4
  118. package/cjs/components/input/input.d.ts +2 -2
  119. package/cjs/components/input/input.js +1 -0
  120. package/cjs/components/jumbo-tabs/jumbo-tabs.css +1 -0
  121. package/cjs/components/list/list-item.js +7 -5
  122. package/cjs/components/list/list.css +1 -0
  123. package/cjs/components/mask/mask.js +1 -1
  124. package/cjs/components/modal/modal.js +2 -2
  125. package/cjs/components/picker/index.d.ts +44 -3
  126. package/cjs/components/picker/picker.d.ts +32 -2
  127. package/cjs/components/picker/picker.js +43 -16
  128. package/cjs/components/popup/popup.js +1 -1
  129. package/cjs/components/swipe-action/swipe-action.js +1 -1
  130. package/cjs/components/tabs/tabs.css +1 -0
  131. package/cjs/components/text-area/text-area.d.ts +2 -2
  132. package/cjs/components/text-area/text-area.js +4 -1
  133. package/cjs/components/toast/methods.js +3 -7
  134. package/cjs/components/virtual-input/virtual-input.js +2 -1
  135. package/cjs/locales/base.d.ts +1 -0
  136. package/cjs/locales/base.js +2 -1
  137. package/cjs/locales/en-US.d.ts +1 -0
  138. package/cjs/locales/es-ES.d.ts +1 -0
  139. package/cjs/locales/fa-IR.d.ts +1 -0
  140. package/cjs/locales/ko-KR.d.ts +1 -0
  141. package/cjs/locales/zh-CN.d.ts +1 -0
  142. package/cjs/locales/zh-CN.js +2 -1
  143. package/cjs/locales/zh-HK.d.ts +1 -0
  144. package/cjs/locales/zh-TW.d.ts +1 -0
  145. package/cjs/utils/is-node-with-content.d.ts +4 -0
  146. package/cjs/utils/is-node-with-content.js +10 -0
  147. package/cjs/utils/render-to-body.js +3 -6
  148. package/cjs/utils/render.d.ts +9 -0
  149. package/cjs/utils/render.js +92 -0
  150. package/cjs/utils/use-drag-and-pinch.d.ts +1 -1
  151. package/cjs/utils/use-props-value.d.ts +1 -1
  152. package/es/components/calendar/calendar.d.ts +4 -0
  153. package/es/components/calendar/calendar.js +13 -9
  154. package/es/components/capsule-tabs/capsule-tabs.css +1 -0
  155. package/es/components/cascade-picker/cascade-picker.d.ts +6 -3
  156. package/es/components/cascade-picker/cascade-picker.js +4 -3
  157. package/es/components/cascade-picker/index.d.ts +4 -2
  158. package/es/components/date-picker/date-picker.d.ts +18 -4
  159. package/es/components/date-picker/date-picker.js +6 -5
  160. package/es/components/date-picker/index.d.ts +15 -2
  161. package/es/components/dialog/dialog.js +2 -2
  162. package/es/components/form/form-item.d.ts +2 -1
  163. package/es/components/form/form-item.js +23 -4
  164. package/es/components/form/utils.d.ts +1 -0
  165. package/es/components/form/utils.js +17 -0
  166. package/es/components/image-uploader/image-uploader.js +9 -4
  167. package/es/components/input/input.d.ts +2 -2
  168. package/es/components/input/input.js +1 -0
  169. package/es/components/jumbo-tabs/jumbo-tabs.css +1 -0
  170. package/es/components/list/list-item.js +6 -5
  171. package/es/components/list/list.css +1 -0
  172. package/es/components/mask/mask.js +1 -1
  173. package/es/components/modal/modal.js +2 -2
  174. package/es/components/picker/index.d.ts +44 -3
  175. package/es/components/picker/picker.d.ts +32 -2
  176. package/es/components/picker/picker.js +42 -17
  177. package/es/components/popup/popup.js +1 -1
  178. package/es/components/swipe-action/swipe-action.js +1 -1
  179. package/es/components/tabs/tabs.css +1 -0
  180. package/es/components/text-area/text-area.d.ts +2 -2
  181. package/es/components/text-area/text-area.js +4 -2
  182. package/es/components/toast/methods.js +3 -3
  183. package/es/components/virtual-input/virtual-input.js +2 -1
  184. package/es/locales/base.d.ts +1 -0
  185. package/es/locales/base.js +2 -1
  186. package/es/locales/en-US.d.ts +1 -0
  187. package/es/locales/es-ES.d.ts +1 -0
  188. package/es/locales/fa-IR.d.ts +1 -0
  189. package/es/locales/ko-KR.d.ts +1 -0
  190. package/es/locales/zh-CN.d.ts +1 -0
  191. package/es/locales/zh-CN.js +2 -1
  192. package/es/locales/zh-HK.d.ts +1 -0
  193. package/es/locales/zh-TW.d.ts +1 -0
  194. package/es/utils/is-node-with-content.d.ts +4 -0
  195. package/es/utils/is-node-with-content.js +3 -0
  196. package/es/utils/render-to-body.js +3 -3
  197. package/es/utils/render.d.ts +9 -0
  198. package/es/utils/render.js +77 -0
  199. package/es/utils/use-drag-and-pinch.d.ts +1 -1
  200. package/es/utils/use-props-value.d.ts +1 -1
  201. package/package.json +8 -8
  202. package/umd/antd-mobile.js +1 -1
@@ -55,7 +55,7 @@ export const Popup = p => {
55
55
  className: classPrefix,
56
56
  onClick: props.onClick,
57
57
  style: {
58
- display: active ? 'unset' : 'none'
58
+ display: active ? undefined : 'none'
59
59
  }
60
60
  }, props.mask && React.createElement(Mask, {
61
61
  visible: props.visible,
@@ -185,7 +185,7 @@ export const SwipeAction = forwardRef((p, ref) => {
185
185
  }
186
186
  }, React.createElement(animated.div, {
187
187
  style: {
188
- pointerEvents: x.to(v => v !== 0 && x.goal !== 0 ? 'none' : 'unset')
188
+ pointerEvents: x.to(v => v !== 0 && x.goal !== 0 ? 'none' : 'auto')
189
189
  }
190
190
  }, props.children)), withStopPropagation(props.stopPropagation, React.createElement("div", {
191
191
  className: 'adm-swipe-action-actions adm-swipe-action-actions-right',
@@ -4,6 +4,7 @@
4
4
  --active-line-height: 2px;
5
5
  --active-line-border-radius: var(--active-line-height);
6
6
  position: relative;
7
+ min-width: 0;
7
8
  }
8
9
  .adm-tabs-header {
9
10
  position: relative;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { ReactNode } from 'react';
3
3
  import { NativeProps } from '../../utils/native-props';
4
- export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | 'disabled' | 'readOnly' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick'> & {
4
+ export declare type TextAreaProps = Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | 'disabled' | 'readOnly' | 'name' | 'onFocus' | 'onBlur' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick'> & {
5
5
  onChange?: (val: string) => void;
6
6
  value?: string;
7
7
  defaultValue?: string;
@@ -20,7 +20,7 @@ export declare type TextAreaRef = {
20
20
  focus: () => void;
21
21
  blur: () => void;
22
22
  };
23
- export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
23
+ export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "onClick" | "disabled" | "name" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "autoComplete" | "autoFocus" | "readOnly"> & {
24
24
  onChange?: ((val: string) => void) | undefined;
25
25
  value?: string | undefined;
26
26
  defaultValue?: string | undefined;
@@ -1,4 +1,5 @@
1
- import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
1
+ import React, { forwardRef, useImperativeHandle, useRef } from 'react';
2
+ import { useIsomorphicLayoutEffect } from 'ahooks';
2
3
  import { withNativeProps } from '../../utils/native-props';
3
4
  import { usePropsValue } from '../../utils/use-props-value';
4
5
  import { mergeProps } from '../../utils/with-default-props';
@@ -41,7 +42,7 @@ export const TextArea = forwardRef((p, ref) => {
41
42
  (_a = nativeTextAreaRef.current) === null || _a === void 0 ? void 0 : _a.blur();
42
43
  }
43
44
  }));
44
- useEffect(() => {
45
+ useIsomorphicLayoutEffect(() => {
45
46
  if (!autoSize) return;
46
47
  const textArea = nativeTextAreaRef.current;
47
48
  if (!textArea) return;
@@ -114,6 +115,7 @@ export const TextArea = forwardRef((p, ref) => {
114
115
  autoFocus: props.autoFocus,
115
116
  disabled: props.disabled,
116
117
  readOnly: props.readOnly,
118
+ name: props.name,
117
119
  onFocus: props.onFocus,
118
120
  onBlur: props.onBlur,
119
121
  onClick: props.onClick
@@ -1,12 +1,12 @@
1
1
  import React, { createRef, forwardRef, useEffect, useImperativeHandle, useState } from 'react';
2
2
  import { resolveContainer } from '../../utils/get-container';
3
- import ReactDOM from 'react-dom';
4
3
  import { InternalToast } from './toast';
5
4
  import { mergeProps } from '../../utils/with-default-props';
5
+ import { render, unmount as reactUnmount } from '../../utils/render';
6
6
  const containers = [];
7
7
 
8
8
  function unmount(container) {
9
- const unmountResult = ReactDOM.unmountComponentAtNode(container);
9
+ const unmountResult = reactUnmount(container);
10
10
 
11
11
  if (unmountResult && container.parentNode) {
12
12
  container.parentNode.removeChild(container);
@@ -64,7 +64,7 @@ export function show(p) {
64
64
  }));
65
65
  });
66
66
  const ref = createRef();
67
- ReactDOM.render(React.createElement(TempToast, {
67
+ render(React.createElement(TempToast, {
68
68
  ref: ref
69
69
  }), container);
70
70
  return {
@@ -84,7 +84,8 @@ export const VirtualInput = forwardRef((p, ref) => {
84
84
 
85
85
  (_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.blur();
86
86
  (_c = (_b = keyboard.props).onClose) === null || _c === void 0 ? void 0 : _c.call(_b);
87
- }
87
+ },
88
+ getContainer: null
88
89
  });
89
90
  return withNativeProps(props, React.createElement("div", {
90
91
  ref: rootRef,
@@ -86,6 +86,7 @@ export declare const base: {
86
86
  };
87
87
  ImageUploader: {
88
88
  uploading: string;
89
+ upload: string;
89
90
  };
90
91
  InfiniteScroll: {
91
92
  noMore: string;
@@ -86,7 +86,8 @@ export const base = {
86
86
  }
87
87
  },
88
88
  ImageUploader: {
89
- uploading: 'Uploading...'
89
+ uploading: 'Uploading...',
90
+ upload: 'Upload'
90
91
  },
91
92
  InfiniteScroll: {
92
93
  noMore: 'No more'
@@ -86,6 +86,7 @@ declare const enUS: {
86
86
  };
87
87
  ImageUploader: {
88
88
  uploading: string;
89
+ upload: string;
89
90
  };
90
91
  InfiniteScroll: {
91
92
  noMore: string;
@@ -86,6 +86,7 @@ declare const esES: {
86
86
  };
87
87
  ImageUploader: {
88
88
  uploading: string;
89
+ upload: string;
89
90
  };
90
91
  InfiniteScroll: {
91
92
  noMore: string;
@@ -86,6 +86,7 @@ declare const faIR: {
86
86
  };
87
87
  ImageUploader: {
88
88
  uploading: string;
89
+ upload: string;
89
90
  };
90
91
  InfiniteScroll: {
91
92
  noMore: string;
@@ -86,6 +86,7 @@ declare const koKR: {
86
86
  };
87
87
  ImageUploader: {
88
88
  uploading: string;
89
+ upload: string;
89
90
  };
90
91
  InfiniteScroll: {
91
92
  noMore: string;
@@ -86,6 +86,7 @@ declare const zhCN: {
86
86
  };
87
87
  ImageUploader: {
88
88
  uploading: string;
89
+ upload: string;
89
90
  };
90
91
  InfiniteScroll: {
91
92
  noMore: string;
@@ -88,7 +88,8 @@ const zhCN = mergeLocale(base, {
88
88
  }
89
89
  },
90
90
  ImageUploader: {
91
- uploading: '上传中...'
91
+ uploading: '上传中...',
92
+ upload: '上传'
92
93
  },
93
94
  InfiniteScroll: {
94
95
  noMore: '没有更多了'
@@ -86,6 +86,7 @@ declare const zhHK: {
86
86
  };
87
87
  ImageUploader: {
88
88
  uploading: string;
89
+ upload: string;
89
90
  };
90
91
  InfiniteScroll: {
91
92
  noMore: string;
@@ -86,6 +86,7 @@ declare const zhTW: {
86
86
  };
87
87
  ImageUploader: {
88
88
  uploading: string;
89
+ upload: string;
89
90
  };
90
91
  InfiniteScroll: {
91
92
  noMore: string;
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+ declare type Regulated<T> = T extends null | undefined | false ? never : T;
3
+ export declare function isNodeWithContent(node: ReactNode): node is Regulated<ReactNode>;
4
+ export {};
@@ -0,0 +1,3 @@
1
+ export function isNodeWithContent(node) {
2
+ return node !== undefined && node !== null && node !== false;
3
+ }
@@ -1,16 +1,16 @@
1
- import ReactDOM from 'react-dom';
1
+ import { render, unmount as reactUnmount } from './render';
2
2
  export function renderToBody(element) {
3
3
  const container = document.createElement('div');
4
4
  document.body.appendChild(container);
5
5
 
6
6
  function unmount() {
7
- const unmountResult = ReactDOM.unmountComponentAtNode(container);
7
+ const unmountResult = reactUnmount(container);
8
8
 
9
9
  if (unmountResult && container.parentNode) {
10
10
  container.parentNode.removeChild(container);
11
11
  }
12
12
  }
13
13
 
14
- ReactDOM.render(element, container);
14
+ render(element, container);
15
15
  return unmount;
16
16
  }
@@ -0,0 +1,9 @@
1
+ import { ReactElement } from 'react';
2
+ import type { Root } from 'react-dom/client';
3
+ declare const MARK = "__antd_mobile_root__";
4
+ declare type ContainerType = (Element | DocumentFragment) & {
5
+ [MARK]?: Root;
6
+ };
7
+ export declare function render(node: ReactElement, container: ContainerType): void;
8
+ export declare function unmount(container: ContainerType): boolean | Promise<void>;
9
+ export {};
@@ -0,0 +1,77 @@
1
+ import { __awaiter } from "tslib";
2
+ import * as ReactDOM from 'react-dom'; // Let compiler not to search module usage
3
+
4
+ const fullClone = Object.assign({}, ReactDOM);
5
+ const {
6
+ version,
7
+ render: reactRender,
8
+ unmountComponentAtNode
9
+ } = fullClone;
10
+ let createRoot;
11
+
12
+ try {
13
+ const mainVersion = Number((version || '').split('.')[0]);
14
+
15
+ if (mainVersion >= 18 && fullClone.createRoot) {
16
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
17
+ createRoot = fullClone.createRoot;
18
+ }
19
+ } catch (e) {// Do nothing;
20
+ }
21
+
22
+ function toggleWarning(skip) {
23
+ const {
24
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
25
+ } = fullClone;
26
+
27
+ if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === 'object') {
28
+ __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
29
+ }
30
+ }
31
+
32
+ const MARK = '__antd_mobile_root__';
33
+
34
+ function legacyRender(node, container) {
35
+ reactRender(node, container);
36
+ }
37
+
38
+ function concurrentRender(node, container) {
39
+ toggleWarning(true);
40
+ const root = container[MARK] || createRoot(container);
41
+ toggleWarning(false);
42
+ root.render(node);
43
+ container[MARK] = root;
44
+ }
45
+
46
+ export function render(node, container) {
47
+ if (createRoot) {
48
+ concurrentRender(node, container);
49
+ return;
50
+ }
51
+
52
+ legacyRender(node, container);
53
+ } // ========================== Unmount =========================
54
+
55
+ function legacyUnmount(container) {
56
+ return unmountComponentAtNode(container);
57
+ }
58
+
59
+ function concurrentUnmount(container) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ // Delay to unmount to avoid React 18 sync warning
62
+ return Promise.resolve().then(() => {
63
+ var _a;
64
+
65
+ (_a = container[MARK]) === null || _a === void 0 ? void 0 : _a.unmount();
66
+ delete container[MARK];
67
+ });
68
+ });
69
+ }
70
+
71
+ export function unmount(container) {
72
+ if (createRoot) {
73
+ return concurrentUnmount(container);
74
+ }
75
+
76
+ return legacyUnmount(container);
77
+ }
@@ -1 +1 @@
1
- export declare const useDragAndPinch: <Config extends import("@use-gesture/react").UserGestureConfig = import("@use-gesture/react").UserGestureConfig>(_handlers: Partial<import("@use-gesture/react").NativeHandlers<import("@use-gesture/react").EventTypes> & import("@use-gesture/react").UserHandlers<import("@use-gesture/react").EventTypes>>, _config?: {} | Config | undefined) => Config["target"] extends object ? void : (...args: any[]) => import("@use-gesture/react").ReactDOMAttributes;
1
+ export declare const useDragAndPinch: <Config extends import("@use-gesture/react").UserGestureConfig = import("@use-gesture/react").UserGestureConfig>(_handlers: Partial<import("@use-gesture/react").NativeHandlers<import("@use-gesture/react").EventTypes> & import("@use-gesture/react").UserHandlers<import("@use-gesture/react").EventTypes>>, _config?: Config | undefined) => Config["target"] extends object ? void : (...args: any[]) => import("@use-gesture/react").ReactDOMAttributes;
@@ -4,5 +4,5 @@ declare type Options<T> = {
4
4
  defaultValue: T;
5
5
  onChange?: (v: T) => void;
6
6
  };
7
- export declare function usePropsValue<T>(options: Options<T>): readonly [T, (this: unknown, v: SetStateAction<T>) => void];
7
+ export declare function usePropsValue<T>(options: Options<T>): readonly [T, (v: SetStateAction<T>) => void];
8
8
  export {};
package/package.json CHANGED
@@ -1,28 +1,28 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "5.11.1",
3
+ "version": "5.12.1",
4
4
  "dependencies": {
5
- "@floating-ui/dom": "^0.4.2",
6
- "@react-spring/web": "^9.4.4",
5
+ "@floating-ui/dom": "^0.4.5",
6
+ "@react-spring/web": "^9.4.5",
7
7
  "@types/big.js": "^6.1.3",
8
8
  "@types/react-is": "^17.0.3",
9
9
  "@types/react-virtualized": "^9.21.21",
10
10
  "@types/resize-observer-browser": "^0.1.7",
11
- "@use-gesture/react": "^10.2.10",
12
- "ahooks": "^3.1.14",
11
+ "@use-gesture/react": "^10.2.12",
12
+ "ahooks": "^3.3.10",
13
13
  "antd-mobile-icons": "^0.2.2",
14
14
  "antd-mobile-v5-count": "^1.0.1",
15
15
  "big.js": "^6.1.1",
16
16
  "classnames": "^2.3.1",
17
- "dayjs": "^1.11.0",
17
+ "dayjs": "^1.11.2",
18
18
  "lodash": "^4.17.21",
19
- "rc-field-form": "^1.26.2",
19
+ "rc-field-form": "^1.26.4",
20
20
  "react-is": "^17.0.2",
21
21
  "staged-components": "^1.1.2",
22
22
  "tslib": "^2.3.1"
23
23
  },
24
24
  "peerDependencies": {
25
- "react": "^16.8.0 || ^17.0.0"
25
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
26
26
  },
27
27
  "main": "./cjs/index.js",
28
28
  "module": "./es/index.js",