antd-mobile 5.11.2 → 5.12.2

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 (194) 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.d.ts +2 -1
  11. package/2x/cjs/components/dialog/dialog.js +2 -2
  12. package/2x/cjs/components/dropdown/dropdown.css +1 -1
  13. package/2x/cjs/components/error-block/images/busy.d.ts +1 -0
  14. package/2x/cjs/components/error-block/images/default.d.ts +1 -0
  15. package/2x/cjs/components/error-block/images/disconnected.d.ts +1 -0
  16. package/2x/cjs/components/error-block/images/empty.d.ts +1 -0
  17. package/2x/cjs/components/form/form-item.d.ts +2 -1
  18. package/2x/cjs/components/form/form-item.js +21 -4
  19. package/2x/cjs/components/form/utils.d.ts +1 -0
  20. package/2x/cjs/components/form/utils.js +20 -0
  21. package/2x/cjs/components/image/image.d.ts +1 -1
  22. package/2x/cjs/components/image-uploader/image-uploader.js +1 -2
  23. package/2x/cjs/components/input/input.d.ts +2 -2
  24. package/2x/cjs/components/input/input.js +1 -0
  25. package/2x/cjs/components/jumbo-tabs/jumbo-tabs.css +1 -0
  26. package/2x/cjs/components/list/list.css +1 -0
  27. package/2x/cjs/components/mask/mask.js +1 -1
  28. package/2x/cjs/components/modal/modal.d.ts +2 -1
  29. package/2x/cjs/components/modal/modal.js +2 -2
  30. package/2x/cjs/components/picker/index.d.ts +44 -3
  31. package/2x/cjs/components/picker/picker.d.ts +32 -2
  32. package/2x/cjs/components/picker/picker.js +43 -16
  33. package/2x/cjs/components/popup/popup.d.ts +2 -1
  34. package/2x/cjs/components/popup/popup.js +1 -1
  35. package/2x/cjs/components/search-bar/search-bar.js +2 -8
  36. package/2x/cjs/components/swipe-action/swipe-action.js +1 -1
  37. package/2x/cjs/components/tabs/tabs.css +5 -3
  38. package/2x/cjs/components/tabs/tabs.d.ts +1 -1
  39. package/2x/cjs/components/text-area/text-area.d.ts +2 -2
  40. package/2x/cjs/components/text-area/text-area.js +4 -1
  41. package/2x/cjs/components/toast/methods.js +3 -7
  42. package/2x/cjs/components/toast/toast.d.ts +2 -1
  43. package/2x/cjs/utils/render-to-body.js +3 -6
  44. package/2x/cjs/utils/render.d.ts +9 -0
  45. package/2x/cjs/utils/render.js +92 -0
  46. package/2x/cjs/utils/use-drag-and-pinch.d.ts +1 -1
  47. package/2x/cjs/utils/use-props-value.d.ts +1 -1
  48. package/2x/es/components/calendar/calendar.d.ts +4 -0
  49. package/2x/es/components/calendar/calendar.js +13 -9
  50. package/2x/es/components/capsule-tabs/capsule-tabs.css +1 -0
  51. package/2x/es/components/cascade-picker/cascade-picker.d.ts +6 -3
  52. package/2x/es/components/cascade-picker/cascade-picker.js +4 -3
  53. package/2x/es/components/cascade-picker/index.d.ts +4 -2
  54. package/2x/es/components/date-picker/date-picker.d.ts +18 -4
  55. package/2x/es/components/date-picker/date-picker.js +6 -5
  56. package/2x/es/components/date-picker/index.d.ts +15 -2
  57. package/2x/es/components/dialog/dialog.d.ts +2 -1
  58. package/2x/es/components/dialog/dialog.js +2 -2
  59. package/2x/es/components/dropdown/dropdown.css +1 -1
  60. package/2x/es/components/error-block/images/busy.d.ts +1 -0
  61. package/2x/es/components/error-block/images/default.d.ts +1 -0
  62. package/2x/es/components/error-block/images/disconnected.d.ts +1 -0
  63. package/2x/es/components/error-block/images/empty.d.ts +1 -0
  64. package/2x/es/components/form/form-item.d.ts +2 -1
  65. package/2x/es/components/form/form-item.js +23 -4
  66. package/2x/es/components/form/utils.d.ts +1 -0
  67. package/2x/es/components/form/utils.js +17 -0
  68. package/2x/es/components/image/image.d.ts +1 -1
  69. package/2x/es/components/image-uploader/image-uploader.js +1 -2
  70. package/2x/es/components/input/input.d.ts +2 -2
  71. package/2x/es/components/input/input.js +1 -0
  72. package/2x/es/components/jumbo-tabs/jumbo-tabs.css +1 -0
  73. package/2x/es/components/list/list.css +1 -0
  74. package/2x/es/components/mask/mask.js +1 -1
  75. package/2x/es/components/modal/modal.d.ts +2 -1
  76. package/2x/es/components/modal/modal.js +2 -2
  77. package/2x/es/components/picker/index.d.ts +44 -3
  78. package/2x/es/components/picker/picker.d.ts +32 -2
  79. package/2x/es/components/picker/picker.js +42 -17
  80. package/2x/es/components/popup/popup.d.ts +2 -1
  81. package/2x/es/components/popup/popup.js +1 -1
  82. package/2x/es/components/search-bar/search-bar.js +2 -8
  83. package/2x/es/components/swipe-action/swipe-action.js +1 -1
  84. package/2x/es/components/tabs/tabs.css +5 -3
  85. package/2x/es/components/tabs/tabs.d.ts +1 -1
  86. package/2x/es/components/text-area/text-area.d.ts +2 -2
  87. package/2x/es/components/text-area/text-area.js +4 -2
  88. package/2x/es/components/toast/methods.js +3 -3
  89. package/2x/es/components/toast/toast.d.ts +2 -1
  90. package/2x/es/utils/render-to-body.js +3 -3
  91. package/2x/es/utils/render.d.ts +9 -0
  92. package/2x/es/utils/render.js +77 -0
  93. package/2x/es/utils/use-drag-and-pinch.d.ts +1 -1
  94. package/2x/es/utils/use-props-value.d.ts +1 -1
  95. package/2x/package.json +9 -14
  96. package/bundle/antd-mobile.cjs.js +5053 -4310
  97. package/bundle/antd-mobile.es.js +5055 -4312
  98. package/bundle/style.css +9 -4
  99. package/cjs/components/calendar/calendar.d.ts +4 -0
  100. package/cjs/components/calendar/calendar.js +13 -9
  101. package/cjs/components/capsule-tabs/capsule-tabs.css +1 -0
  102. package/cjs/components/cascade-picker/cascade-picker.d.ts +6 -3
  103. package/cjs/components/cascade-picker/cascade-picker.js +8 -4
  104. package/cjs/components/cascade-picker/index.d.ts +4 -2
  105. package/cjs/components/date-picker/date-picker.d.ts +18 -4
  106. package/cjs/components/date-picker/date-picker.js +5 -6
  107. package/cjs/components/date-picker/index.d.ts +15 -2
  108. package/cjs/components/dialog/dialog.d.ts +2 -1
  109. package/cjs/components/dialog/dialog.js +2 -2
  110. package/cjs/components/dropdown/dropdown.css +1 -1
  111. package/cjs/components/error-block/images/busy.d.ts +1 -0
  112. package/cjs/components/error-block/images/default.d.ts +1 -0
  113. package/cjs/components/error-block/images/disconnected.d.ts +1 -0
  114. package/cjs/components/error-block/images/empty.d.ts +1 -0
  115. package/cjs/components/form/form-item.d.ts +2 -1
  116. package/cjs/components/form/form-item.js +21 -4
  117. package/cjs/components/form/utils.d.ts +1 -0
  118. package/cjs/components/form/utils.js +20 -0
  119. package/cjs/components/image/image.d.ts +1 -1
  120. package/cjs/components/image-uploader/image-uploader.js +1 -2
  121. package/cjs/components/input/input.d.ts +2 -2
  122. package/cjs/components/input/input.js +1 -0
  123. package/cjs/components/jumbo-tabs/jumbo-tabs.css +1 -0
  124. package/cjs/components/list/list.css +1 -0
  125. package/cjs/components/mask/mask.js +1 -1
  126. package/cjs/components/modal/modal.d.ts +2 -1
  127. package/cjs/components/modal/modal.js +2 -2
  128. package/cjs/components/picker/index.d.ts +44 -3
  129. package/cjs/components/picker/picker.d.ts +32 -2
  130. package/cjs/components/picker/picker.js +43 -16
  131. package/cjs/components/popup/popup.d.ts +2 -1
  132. package/cjs/components/popup/popup.js +1 -1
  133. package/cjs/components/search-bar/search-bar.js +2 -8
  134. package/cjs/components/swipe-action/swipe-action.js +1 -1
  135. package/cjs/components/tabs/tabs.css +5 -3
  136. package/cjs/components/tabs/tabs.d.ts +1 -1
  137. package/cjs/components/text-area/text-area.d.ts +2 -2
  138. package/cjs/components/text-area/text-area.js +4 -1
  139. package/cjs/components/toast/methods.js +3 -7
  140. package/cjs/components/toast/toast.d.ts +2 -1
  141. package/cjs/utils/render-to-body.js +3 -6
  142. package/cjs/utils/render.d.ts +9 -0
  143. package/cjs/utils/render.js +92 -0
  144. package/cjs/utils/use-drag-and-pinch.d.ts +1 -1
  145. package/cjs/utils/use-props-value.d.ts +1 -1
  146. package/es/components/calendar/calendar.d.ts +4 -0
  147. package/es/components/calendar/calendar.js +13 -9
  148. package/es/components/capsule-tabs/capsule-tabs.css +1 -0
  149. package/es/components/cascade-picker/cascade-picker.d.ts +6 -3
  150. package/es/components/cascade-picker/cascade-picker.js +4 -3
  151. package/es/components/cascade-picker/index.d.ts +4 -2
  152. package/es/components/date-picker/date-picker.d.ts +18 -4
  153. package/es/components/date-picker/date-picker.js +6 -5
  154. package/es/components/date-picker/index.d.ts +15 -2
  155. package/es/components/dialog/dialog.d.ts +2 -1
  156. package/es/components/dialog/dialog.js +2 -2
  157. package/es/components/dropdown/dropdown.css +1 -1
  158. package/es/components/error-block/images/busy.d.ts +1 -0
  159. package/es/components/error-block/images/default.d.ts +1 -0
  160. package/es/components/error-block/images/disconnected.d.ts +1 -0
  161. package/es/components/error-block/images/empty.d.ts +1 -0
  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/image.d.ts +1 -1
  167. package/es/components/image-uploader/image-uploader.js +1 -2
  168. package/es/components/input/input.d.ts +2 -2
  169. package/es/components/input/input.js +1 -0
  170. package/es/components/jumbo-tabs/jumbo-tabs.css +1 -0
  171. package/es/components/list/list.css +1 -0
  172. package/es/components/mask/mask.js +1 -1
  173. package/es/components/modal/modal.d.ts +2 -1
  174. package/es/components/modal/modal.js +2 -2
  175. package/es/components/picker/index.d.ts +44 -3
  176. package/es/components/picker/picker.d.ts +32 -2
  177. package/es/components/picker/picker.js +42 -17
  178. package/es/components/popup/popup.d.ts +2 -1
  179. package/es/components/popup/popup.js +1 -1
  180. package/es/components/search-bar/search-bar.js +2 -8
  181. package/es/components/swipe-action/swipe-action.js +1 -1
  182. package/es/components/tabs/tabs.css +5 -3
  183. package/es/components/tabs/tabs.d.ts +1 -1
  184. package/es/components/text-area/text-area.d.ts +2 -2
  185. package/es/components/text-area/text-area.js +4 -2
  186. package/es/components/toast/methods.js +3 -3
  187. package/es/components/toast/toast.d.ts +2 -1
  188. package/es/utils/render-to-body.js +3 -3
  189. package/es/utils/render.d.ts +9 -0
  190. package/es/utils/render.js +77 -0
  191. package/es/utils/use-drag-and-pinch.d.ts +1 -1
  192. package/es/utils/use-props-value.d.ts +1 -1
  193. package/package.json +9 -14
  194. package/umd/antd-mobile.js +1 -1
@@ -52,7 +52,7 @@ export const SearchBar = forwardRef((p, ref) => {
52
52
  }));
53
53
 
54
54
  const renderCancelButton = () => {
55
- let isShowCancel = false;
55
+ let isShowCancel;
56
56
 
57
57
  if (typeof props.showCancelButton === 'function') {
58
58
  isShowCancel = props.showCancelButton(hasFocus, value);
@@ -61,13 +61,7 @@ export const SearchBar = forwardRef((p, ref) => {
61
61
  }
62
62
 
63
63
  return isShowCancel && React.createElement("div", {
64
- className: `${classPrefix}-suffix`,
65
- onMouseDown: e => {
66
- e.preventDefault();
67
- },
68
- onTouchStart: e => {
69
- e.preventDefault();
70
- }
64
+ className: `${classPrefix}-suffix`
71
65
  }, React.createElement(Button, {
72
66
  fill: 'none',
73
67
  className: `${classPrefix}-cancel-button`,
@@ -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',
@@ -3,7 +3,10 @@
3
3
  --content-padding: 12px;
4
4
  --active-line-height: 2px;
5
5
  --active-line-border-radius: var(--active-line-height);
6
+ --active-line-color: var(--adm-color-primary);
7
+ --active-title-color: var(--adm-color-primary);
6
8
  position: relative;
9
+ min-width: 0;
7
10
  }
8
11
  .adm-tabs-header {
9
12
  position: relative;
@@ -37,7 +40,7 @@
37
40
  cursor: pointer;
38
41
  }
39
42
  .adm-tabs-tab-active {
40
- color: var(--adm-color-primary);
43
+ color: var(--active-title-color);
41
44
  }
42
45
  .adm-tabs-tab-disabled {
43
46
  opacity: 0.5;
@@ -47,8 +50,7 @@
47
50
  position: absolute;
48
51
  bottom: 0;
49
52
  height: var(--active-line-height);
50
- color: var(--adm-color-primary);
51
- background: var(--adm-color-primary);
53
+ background: var(--active-line-color);
52
54
  border-radius: var(--active-line-border-radius);
53
55
  }
54
56
  .adm-tabs-content {
@@ -15,5 +15,5 @@ export declare type TabsProps = {
15
15
  stretch?: boolean;
16
16
  onChange?: (key: string) => void;
17
17
  children?: React.ReactNode;
18
- } & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding'>;
18
+ } & NativeProps<'--fixed-active-line-width' | '--active-line-height' | '--active-line-border-radius' | '--title-font-size' | '--content-padding' | '--active-title-color' | '--active-line-color'>;
19
19
  export declare const Tabs: FC<TabsProps>;
@@ -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, useLayoutEffect, 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
- useLayoutEffect(() => {
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 {
@@ -1,9 +1,10 @@
1
1
  import React, { ReactNode } from 'react';
2
+ import type { MaskProps } from '../mask';
2
3
  import { PropagationEvent } from '../../utils/with-stop-propagation';
3
4
  import { GetContainer } from '../../utils/render-to-container';
4
5
  export interface ToastProps {
5
6
  afterClose?: () => void;
6
- maskStyle?: React.CSSProperties;
7
+ maskStyle?: MaskProps['style'];
7
8
  maskClassName?: string;
8
9
  maskClickable?: boolean;
9
10
  content?: ReactNode;
@@ -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,24 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "5.11.2",
3
+ "version": "5.12.2",
4
4
  "dependencies": {
5
- "@floating-ui/dom": "^0.4.2",
6
- "@react-spring/web": "^9.4.4",
7
- "@types/big.js": "^6.1.3",
8
- "@types/react-is": "^17.0.3",
9
- "@types/react-virtualized": "^9.21.21",
10
- "@types/resize-observer-browser": "^0.1.7",
11
- "@use-gesture/react": "^10.2.10",
12
- "ahooks": "^3.1.14",
5
+ "@floating-ui/dom": "^0.4.5",
6
+ "@react-spring/web": "^9.4.5",
7
+ "@use-gesture/react": "^10.2.12",
8
+ "ahooks": "^3.3.10",
13
9
  "antd-mobile-icons": "^0.2.2",
14
10
  "antd-mobile-v5-count": "^1.0.1",
15
11
  "big.js": "^6.1.1",
16
12
  "classnames": "^2.3.1",
17
- "dayjs": "^1.11.0",
13
+ "dayjs": "^1.11.2",
18
14
  "lodash": "^4.17.21",
19
- "rc-field-form": "^1.26.2",
15
+ "rc-field-form": "^1.26.4",
20
16
  "react-is": "^17.0.2",
21
17
  "staged-components": "^1.1.2",
22
18
  "tslib": "^2.3.1"
23
19
  },
24
20
  "peerDependencies": {
25
- "react": "^16.8.0 || ^17.0.0"
21
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
26
22
  },
27
23
  "main": "./cjs/index.js",
28
24
  "module": "./es/index.js",
@@ -43,6 +39,5 @@
43
39
  "url": "git+https://github.com/ant-design/ant-design-mobile.git",
44
40
  "branch": "master",
45
41
  "platform": "github"
46
- },
47
- "packageManager": "yarn@3.2.0"
42
+ }
48
43
  }