antd-mobile 5.39.0 → 5.40.0

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 (284) hide show
  1. package/2x/README.md +8 -1
  2. package/2x/bundle/antd-mobile.cjs.development.js +2351 -1604
  3. package/2x/bundle/antd-mobile.cjs.js +7 -7
  4. package/2x/bundle/antd-mobile.es.development.js +1385 -638
  5. package/2x/bundle/antd-mobile.es.js +6070 -5443
  6. package/2x/bundle/antd-mobile.umd.development.js +2350 -1603
  7. package/2x/bundle/antd-mobile.umd.js +7 -7
  8. package/2x/bundle/style.css +7 -4
  9. package/2x/cjs/components/button/button.d.ts +2 -2
  10. package/2x/cjs/components/button/button.js +1 -0
  11. package/2x/cjs/components/calendar-picker-view/calendar-picker-view.js +3 -0
  12. package/2x/cjs/components/date-picker/date-picker-date-utils.d.ts +1 -1
  13. package/2x/cjs/components/date-picker/date-picker-date-utils.js +23 -8
  14. package/2x/cjs/components/date-picker/date-picker-quarter-utils.d.ts +3 -1
  15. package/2x/cjs/components/date-picker/date-picker-quarter-utils.js +7 -2
  16. package/2x/cjs/components/date-picker/date-picker-week-utils.d.ts +3 -1
  17. package/2x/cjs/components/date-picker/date-picker-week-utils.js +10 -3
  18. package/2x/cjs/components/date-picker-view/date-picker-view.d.ts +5 -3
  19. package/2x/cjs/components/date-picker-view/date-picker-view.js +3 -3
  20. package/2x/cjs/components/date-picker-view/useRenderLabel.js +2 -2
  21. package/2x/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
  22. package/2x/cjs/components/popover/wrapper.d.ts +6 -9
  23. package/2x/cjs/components/popover/wrapper.js +32 -6
  24. package/2x/cjs/components/space/space.css +4 -4
  25. package/2x/cjs/components/virtual-input/virtual-input.css +3 -0
  26. package/2x/cjs/components/virtual-input/virtual-input.js +34 -5
  27. package/2x/cjs/index.d.ts +1 -0
  28. package/2x/cjs/index.js +7 -0
  29. package/2x/cjs/locales/ar-SA.d.ts +1 -0
  30. package/2x/cjs/locales/ar-SA.js +1 -0
  31. package/2x/cjs/locales/base.d.ts +1 -0
  32. package/2x/cjs/locales/base.js +1 -0
  33. package/2x/cjs/locales/cnr-ME.d.ts +1 -0
  34. package/2x/cjs/locales/cnr-ME.js +1 -0
  35. package/2x/cjs/locales/da-DK.d.ts +1 -0
  36. package/2x/cjs/locales/de-DE.d.ts +1 -0
  37. package/2x/cjs/locales/de-DE.js +1 -0
  38. package/2x/cjs/locales/en-US.d.ts +1 -0
  39. package/2x/cjs/locales/es-ES.d.ts +1 -0
  40. package/2x/cjs/locales/fa-IR.d.ts +1 -0
  41. package/2x/cjs/locales/fr-FR.d.ts +1 -0
  42. package/2x/cjs/locales/hr-HR.d.ts +1 -0
  43. package/2x/cjs/locales/hr-HR.js +1 -0
  44. package/2x/cjs/locales/hu-HU.d.ts +1 -0
  45. package/2x/cjs/locales/id-ID.d.ts +1 -0
  46. package/2x/cjs/locales/in-ID.d.ts +1 -0
  47. package/2x/cjs/locales/in-ID.js +1 -0
  48. package/2x/cjs/locales/it-IT.d.ts +1 -0
  49. package/2x/cjs/locales/ja-JP.d.ts +1 -0
  50. package/2x/cjs/locales/kk-KZ.d.ts +1 -0
  51. package/2x/cjs/locales/ko-KR.d.ts +1 -0
  52. package/2x/cjs/locales/ms-MY.d.ts +1 -0
  53. package/2x/cjs/locales/ms-MY.js +1 -0
  54. package/2x/cjs/locales/nb-NO.d.ts +1 -0
  55. package/2x/cjs/locales/nl-NL.d.ts +1 -0
  56. package/2x/cjs/locales/pt-BR.d.ts +1 -0
  57. package/2x/cjs/locales/ru-RU.d.ts +1 -0
  58. package/2x/cjs/locales/ru-RU.js +8 -2
  59. package/2x/cjs/locales/sr-RS.d.ts +1 -0
  60. package/2x/cjs/locales/sr-RS.js +1 -0
  61. package/2x/cjs/locales/th-TH.d.ts +1 -0
  62. package/2x/cjs/locales/th-TH.js +1 -0
  63. package/2x/cjs/locales/tr-TR.d.ts +1 -0
  64. package/2x/cjs/locales/vi-VN.d.ts +1 -0
  65. package/2x/cjs/locales/vi-VN.js +1 -0
  66. package/2x/cjs/locales/zh-CN.js +1 -0
  67. package/2x/cjs/locales/zh-HK.d.ts +1 -0
  68. package/2x/cjs/locales/zh-TW.d.ts +1 -0
  69. package/2x/cjs/utils/render-to-body.d.ts +1 -1
  70. package/2x/cjs/utils/render-to-body.js +2 -9
  71. package/2x/cjs/utils/render.d.ts +1 -9
  72. package/2x/cjs/utils/render.js +10 -68
  73. package/2x/cjs/utils/unstable-render.d.ts +9 -0
  74. package/2x/cjs/utils/unstable-render.js +37 -0
  75. package/2x/es/components/button/button.d.ts +2 -2
  76. package/2x/es/components/button/button.js +1 -0
  77. package/2x/es/components/calendar-picker-view/calendar-picker-view.js +3 -0
  78. package/2x/es/components/date-picker/date-picker-date-utils.d.ts +1 -1
  79. package/2x/es/components/date-picker/date-picker-date-utils.js +23 -8
  80. package/2x/es/components/date-picker/date-picker-quarter-utils.d.ts +3 -1
  81. package/2x/es/components/date-picker/date-picker-quarter-utils.js +7 -2
  82. package/2x/es/components/date-picker/date-picker-week-utils.d.ts +3 -1
  83. package/2x/es/components/date-picker/date-picker-week-utils.js +10 -3
  84. package/2x/es/components/date-picker-view/date-picker-view.d.ts +5 -3
  85. package/2x/es/components/date-picker-view/date-picker-view.js +4 -4
  86. package/2x/es/components/date-picker-view/useRenderLabel.js +2 -2
  87. package/2x/es/components/number-keyboard/number-keyboard.d.ts +1 -1
  88. package/2x/es/components/popover/wrapper.d.ts +6 -9
  89. package/2x/es/components/popover/wrapper.js +30 -5
  90. package/2x/es/components/space/space.css +4 -4
  91. package/2x/es/components/virtual-input/virtual-input.css +3 -0
  92. package/2x/es/components/virtual-input/virtual-input.js +34 -5
  93. package/2x/es/index.d.ts +1 -0
  94. package/2x/es/index.js +3 -1
  95. package/2x/es/locales/ar-SA.d.ts +1 -0
  96. package/2x/es/locales/ar-SA.js +1 -0
  97. package/2x/es/locales/base.d.ts +1 -0
  98. package/2x/es/locales/base.js +1 -0
  99. package/2x/es/locales/cnr-ME.d.ts +1 -0
  100. package/2x/es/locales/cnr-ME.js +1 -0
  101. package/2x/es/locales/da-DK.d.ts +1 -0
  102. package/2x/es/locales/de-DE.d.ts +1 -0
  103. package/2x/es/locales/de-DE.js +1 -0
  104. package/2x/es/locales/en-US.d.ts +1 -0
  105. package/2x/es/locales/es-ES.d.ts +1 -0
  106. package/2x/es/locales/fa-IR.d.ts +1 -0
  107. package/2x/es/locales/fr-FR.d.ts +1 -0
  108. package/2x/es/locales/hr-HR.d.ts +1 -0
  109. package/2x/es/locales/hr-HR.js +1 -0
  110. package/2x/es/locales/hu-HU.d.ts +1 -0
  111. package/2x/es/locales/id-ID.d.ts +1 -0
  112. package/2x/es/locales/in-ID.d.ts +1 -0
  113. package/2x/es/locales/in-ID.js +1 -0
  114. package/2x/es/locales/it-IT.d.ts +1 -0
  115. package/2x/es/locales/ja-JP.d.ts +1 -0
  116. package/2x/es/locales/kk-KZ.d.ts +1 -0
  117. package/2x/es/locales/ko-KR.d.ts +1 -0
  118. package/2x/es/locales/ms-MY.d.ts +1 -0
  119. package/2x/es/locales/ms-MY.js +1 -0
  120. package/2x/es/locales/nb-NO.d.ts +1 -0
  121. package/2x/es/locales/nl-NL.d.ts +1 -0
  122. package/2x/es/locales/pt-BR.d.ts +1 -0
  123. package/2x/es/locales/ru-RU.d.ts +1 -0
  124. package/2x/es/locales/ru-RU.js +8 -2
  125. package/2x/es/locales/sr-RS.d.ts +1 -0
  126. package/2x/es/locales/sr-RS.js +1 -0
  127. package/2x/es/locales/th-TH.d.ts +1 -0
  128. package/2x/es/locales/th-TH.js +1 -0
  129. package/2x/es/locales/tr-TR.d.ts +1 -0
  130. package/2x/es/locales/vi-VN.d.ts +1 -0
  131. package/2x/es/locales/vi-VN.js +1 -0
  132. package/2x/es/locales/zh-CN.js +1 -0
  133. package/2x/es/locales/zh-HK.d.ts +1 -0
  134. package/2x/es/locales/zh-TW.d.ts +1 -0
  135. package/2x/es/utils/render-to-body.d.ts +1 -1
  136. package/2x/es/utils/render-to-body.js +2 -9
  137. package/2x/es/utils/render.d.ts +1 -9
  138. package/2x/es/utils/render.js +1 -65
  139. package/2x/es/utils/unstable-render.d.ts +9 -0
  140. package/2x/es/utils/unstable-render.js +28 -0
  141. package/2x/package.json +2 -2
  142. package/README.md +8 -1
  143. package/bundle/antd-mobile.cjs.development.js +2351 -1604
  144. package/bundle/antd-mobile.cjs.js +7 -7
  145. package/bundle/antd-mobile.compatible.umd.js +1 -1
  146. package/bundle/antd-mobile.es.development.js +1385 -638
  147. package/bundle/antd-mobile.es.js +6070 -5443
  148. package/bundle/antd-mobile.umd.development.js +2350 -1603
  149. package/bundle/antd-mobile.umd.js +7 -7
  150. package/bundle/style.css +1 -1
  151. package/cjs/components/button/button.d.ts +2 -2
  152. package/cjs/components/button/button.js +1 -0
  153. package/cjs/components/calendar-picker-view/calendar-picker-view.js +3 -0
  154. package/cjs/components/date-picker/date-picker-date-utils.d.ts +1 -1
  155. package/cjs/components/date-picker/date-picker-date-utils.js +23 -8
  156. package/cjs/components/date-picker/date-picker-quarter-utils.d.ts +3 -1
  157. package/cjs/components/date-picker/date-picker-quarter-utils.js +7 -2
  158. package/cjs/components/date-picker/date-picker-week-utils.d.ts +3 -1
  159. package/cjs/components/date-picker/date-picker-week-utils.js +10 -3
  160. package/cjs/components/date-picker-view/date-picker-view.d.ts +5 -3
  161. package/cjs/components/date-picker-view/date-picker-view.js +3 -3
  162. package/cjs/components/date-picker-view/useRenderLabel.js +2 -2
  163. package/cjs/components/number-keyboard/number-keyboard.d.ts +1 -1
  164. package/cjs/components/popover/wrapper.d.ts +6 -9
  165. package/cjs/components/popover/wrapper.js +32 -6
  166. package/cjs/components/space/space.css +3 -3
  167. package/cjs/components/virtual-input/virtual-input.css +3 -0
  168. package/cjs/components/virtual-input/virtual-input.js +34 -5
  169. package/cjs/index.d.ts +1 -0
  170. package/cjs/index.js +7 -0
  171. package/cjs/locales/ar-SA.d.ts +1 -0
  172. package/cjs/locales/ar-SA.js +1 -0
  173. package/cjs/locales/base.d.ts +1 -0
  174. package/cjs/locales/base.js +1 -0
  175. package/cjs/locales/cnr-ME.d.ts +1 -0
  176. package/cjs/locales/cnr-ME.js +1 -0
  177. package/cjs/locales/da-DK.d.ts +1 -0
  178. package/cjs/locales/de-DE.d.ts +1 -0
  179. package/cjs/locales/de-DE.js +1 -0
  180. package/cjs/locales/en-US.d.ts +1 -0
  181. package/cjs/locales/es-ES.d.ts +1 -0
  182. package/cjs/locales/fa-IR.d.ts +1 -0
  183. package/cjs/locales/fr-FR.d.ts +1 -0
  184. package/cjs/locales/hr-HR.d.ts +1 -0
  185. package/cjs/locales/hr-HR.js +1 -0
  186. package/cjs/locales/hu-HU.d.ts +1 -0
  187. package/cjs/locales/id-ID.d.ts +1 -0
  188. package/cjs/locales/in-ID.d.ts +1 -0
  189. package/cjs/locales/in-ID.js +1 -0
  190. package/cjs/locales/it-IT.d.ts +1 -0
  191. package/cjs/locales/ja-JP.d.ts +1 -0
  192. package/cjs/locales/kk-KZ.d.ts +1 -0
  193. package/cjs/locales/ko-KR.d.ts +1 -0
  194. package/cjs/locales/ms-MY.d.ts +1 -0
  195. package/cjs/locales/ms-MY.js +1 -0
  196. package/cjs/locales/nb-NO.d.ts +1 -0
  197. package/cjs/locales/nl-NL.d.ts +1 -0
  198. package/cjs/locales/pt-BR.d.ts +1 -0
  199. package/cjs/locales/ru-RU.d.ts +1 -0
  200. package/cjs/locales/ru-RU.js +8 -2
  201. package/cjs/locales/sr-RS.d.ts +1 -0
  202. package/cjs/locales/sr-RS.js +1 -0
  203. package/cjs/locales/th-TH.d.ts +1 -0
  204. package/cjs/locales/th-TH.js +1 -0
  205. package/cjs/locales/tr-TR.d.ts +1 -0
  206. package/cjs/locales/vi-VN.d.ts +1 -0
  207. package/cjs/locales/vi-VN.js +1 -0
  208. package/cjs/locales/zh-CN.js +1 -0
  209. package/cjs/locales/zh-HK.d.ts +1 -0
  210. package/cjs/locales/zh-TW.d.ts +1 -0
  211. package/cjs/utils/render-to-body.d.ts +1 -1
  212. package/cjs/utils/render-to-body.js +2 -9
  213. package/cjs/utils/render.d.ts +1 -9
  214. package/cjs/utils/render.js +10 -68
  215. package/cjs/utils/unstable-render.d.ts +9 -0
  216. package/cjs/utils/unstable-render.js +37 -0
  217. package/es/components/button/button.d.ts +2 -2
  218. package/es/components/button/button.js +1 -0
  219. package/es/components/calendar-picker-view/calendar-picker-view.js +3 -0
  220. package/es/components/date-picker/date-picker-date-utils.d.ts +1 -1
  221. package/es/components/date-picker/date-picker-date-utils.js +23 -8
  222. package/es/components/date-picker/date-picker-quarter-utils.d.ts +3 -1
  223. package/es/components/date-picker/date-picker-quarter-utils.js +7 -2
  224. package/es/components/date-picker/date-picker-week-utils.d.ts +3 -1
  225. package/es/components/date-picker/date-picker-week-utils.js +10 -3
  226. package/es/components/date-picker-view/date-picker-view.d.ts +5 -3
  227. package/es/components/date-picker-view/date-picker-view.js +4 -4
  228. package/es/components/date-picker-view/useRenderLabel.js +2 -2
  229. package/es/components/number-keyboard/number-keyboard.d.ts +1 -1
  230. package/es/components/popover/wrapper.d.ts +6 -9
  231. package/es/components/popover/wrapper.js +30 -5
  232. package/es/components/space/space.css +3 -3
  233. package/es/components/virtual-input/virtual-input.css +3 -0
  234. package/es/components/virtual-input/virtual-input.js +34 -5
  235. package/es/index.d.ts +1 -0
  236. package/es/index.js +3 -1
  237. package/es/locales/ar-SA.d.ts +1 -0
  238. package/es/locales/ar-SA.js +1 -0
  239. package/es/locales/base.d.ts +1 -0
  240. package/es/locales/base.js +1 -0
  241. package/es/locales/cnr-ME.d.ts +1 -0
  242. package/es/locales/cnr-ME.js +1 -0
  243. package/es/locales/da-DK.d.ts +1 -0
  244. package/es/locales/de-DE.d.ts +1 -0
  245. package/es/locales/de-DE.js +1 -0
  246. package/es/locales/en-US.d.ts +1 -0
  247. package/es/locales/es-ES.d.ts +1 -0
  248. package/es/locales/fa-IR.d.ts +1 -0
  249. package/es/locales/fr-FR.d.ts +1 -0
  250. package/es/locales/hr-HR.d.ts +1 -0
  251. package/es/locales/hr-HR.js +1 -0
  252. package/es/locales/hu-HU.d.ts +1 -0
  253. package/es/locales/id-ID.d.ts +1 -0
  254. package/es/locales/in-ID.d.ts +1 -0
  255. package/es/locales/in-ID.js +1 -0
  256. package/es/locales/it-IT.d.ts +1 -0
  257. package/es/locales/ja-JP.d.ts +1 -0
  258. package/es/locales/kk-KZ.d.ts +1 -0
  259. package/es/locales/ko-KR.d.ts +1 -0
  260. package/es/locales/ms-MY.d.ts +1 -0
  261. package/es/locales/ms-MY.js +1 -0
  262. package/es/locales/nb-NO.d.ts +1 -0
  263. package/es/locales/nl-NL.d.ts +1 -0
  264. package/es/locales/pt-BR.d.ts +1 -0
  265. package/es/locales/ru-RU.d.ts +1 -0
  266. package/es/locales/ru-RU.js +8 -2
  267. package/es/locales/sr-RS.d.ts +1 -0
  268. package/es/locales/sr-RS.js +1 -0
  269. package/es/locales/th-TH.d.ts +1 -0
  270. package/es/locales/th-TH.js +1 -0
  271. package/es/locales/tr-TR.d.ts +1 -0
  272. package/es/locales/vi-VN.d.ts +1 -0
  273. package/es/locales/vi-VN.js +1 -0
  274. package/es/locales/zh-CN.js +1 -0
  275. package/es/locales/zh-HK.d.ts +1 -0
  276. package/es/locales/zh-TW.d.ts +1 -0
  277. package/es/utils/render-to-body.d.ts +1 -1
  278. package/es/utils/render-to-body.js +2 -9
  279. package/es/utils/render.d.ts +1 -9
  280. package/es/utils/render.js +1 -65
  281. package/es/utils/unstable-render.d.ts +9 -0
  282. package/es/utils/unstable-render.js +28 -0
  283. package/package.json +2 -2
  284. package/umd/antd-mobile.js +1 -1
@@ -12,6 +12,7 @@ const zhCN = {
12
12
  confirm: '确认',
13
13
  start: '开始',
14
14
  end: '结束',
15
+ startAndEnd: '开始/结束',
15
16
  today: '今日',
16
17
  markItems: ['一', '二', '三', '四', '五', '六', '日'],
17
18
  yearAndMonth: '${year}年${month}月'
@@ -11,6 +11,7 @@ declare const zhHK: {
11
11
  confirm: string;
12
12
  start: string;
13
13
  end: string;
14
+ startAndEnd: string;
14
15
  today: string;
15
16
  markItems: string[];
16
17
  yearAndMonth: string;
@@ -11,6 +11,7 @@ declare const zhTW: {
11
11
  confirm: string;
12
12
  start: string;
13
13
  end: string;
14
+ startAndEnd: string;
14
15
  today: string;
15
16
  markItems: string[];
16
17
  yearAndMonth: string;
@@ -1,2 +1,2 @@
1
1
  import type { ReactElement } from 'react';
2
- export declare function renderToBody(element: ReactElement): () => void;
2
+ export declare function renderToBody(element: ReactElement): import("./unstable-render").UnmountType;
@@ -1,13 +1,6 @@
1
- import { render, unmount as reactUnmount } from './render';
1
+ import { unstableSetRender } from './unstable-render';
2
2
  export function renderToBody(element) {
3
3
  const container = document.createElement('div');
4
4
  document.body.appendChild(container);
5
- function unmount() {
6
- const unmountResult = reactUnmount(container);
7
- if (unmountResult && container.parentNode) {
8
- container.parentNode.removeChild(container);
9
- }
10
- }
11
- render(element, container);
12
- return unmount;
5
+ return unstableSetRender()(element, container);
13
6
  }
@@ -1,9 +1 @@
1
- import type { 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 {};
1
+ export * from 'rc-util/lib/React/render';
@@ -1,65 +1 @@
1
- import { __awaiter } from "tslib";
2
- import * as ReactDOM from 'react-dom';
3
- // Let compiler not to search module usage
4
- const fullClone = Object.assign({}, ReactDOM);
5
- const {
6
- version,
7
- render: reactRender,
8
- unmountComponentAtNode
9
- } = fullClone;
10
- let createRoot;
11
- try {
12
- const mainVersion = Number((version || '').split('.')[0]);
13
- if (mainVersion >= 18 && fullClone.createRoot) {
14
- // eslint-disable-next-line @typescript-eslint/no-var-requires
15
- createRoot = fullClone.createRoot;
16
- }
17
- } catch (e) {
18
- // Do nothing;
19
- }
20
- function toggleWarning(skip) {
21
- const {
22
- __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
23
- } = fullClone;
24
- if (__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED && typeof __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === 'object') {
25
- __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skip;
26
- }
27
- }
28
- const MARK = '__antd_mobile_root__';
29
- function legacyRender(node, container) {
30
- reactRender(node, container);
31
- }
32
- function concurrentRender(node, container) {
33
- toggleWarning(true);
34
- const root = container[MARK] || createRoot(container);
35
- toggleWarning(false);
36
- root.render(node);
37
- container[MARK] = root;
38
- }
39
- export function render(node, container) {
40
- if (createRoot) {
41
- concurrentRender(node, container);
42
- return;
43
- }
44
- legacyRender(node, container);
45
- }
46
- // ========================== Unmount =========================
47
- function legacyUnmount(container) {
48
- return unmountComponentAtNode(container);
49
- }
50
- function concurrentUnmount(container) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- // Delay to unmount to avoid React 18 sync warning
53
- return Promise.resolve().then(() => {
54
- var _a;
55
- (_a = container[MARK]) === null || _a === void 0 ? void 0 : _a.unmount();
56
- delete container[MARK];
57
- });
58
- });
59
- }
60
- export function unmount(container) {
61
- if (createRoot) {
62
- return concurrentUnmount(container);
63
- }
64
- return legacyUnmount(container);
65
- }
1
+ export * from 'rc-util/lib/React/render';
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ export declare type UnmountType = () => Promise<void>;
3
+ export declare type RenderType = (node: React.ReactElement, container: Element | DocumentFragment) => UnmountType;
4
+ /**
5
+ * @deprecated Set React render function for compatible usage.
6
+ * This is internal usage only compatible with React 19.
7
+ * And will be removed in next major version.
8
+ */
9
+ export declare function unstableSetRender(render?: RenderType): RenderType;
@@ -0,0 +1,28 @@
1
+ import warningOnce from 'rc-util/lib/warning';
2
+ import * as React from 'react';
3
+ import * as ReactDOM from 'react-dom';
4
+ import { render, unmount } from './render';
5
+ const defaultReactRender = (node, container) => {
6
+ // Warning for React 19
7
+ if (process.env.NODE_ENV !== 'production') {
8
+ const majorVersion = parseInt(React.version.split('.')[0], 10);
9
+ const fullKeys = Object.keys(ReactDOM);
10
+ warningOnce(majorVersion < 19 || fullKeys.includes('createRoot'), `[Compatible] antd-mobile v5 support React is 16 ~ 18. see https://mobile.ant.design/guide/v5-for-19 for compatible.`);
11
+ }
12
+ render(node, container);
13
+ return () => {
14
+ return unmount(container);
15
+ };
16
+ };
17
+ let unstableRender = defaultReactRender;
18
+ /**
19
+ * @deprecated Set React render function for compatible usage.
20
+ * This is internal usage only compatible with React 19.
21
+ * And will be removed in next major version.
22
+ */
23
+ export function unstableSetRender(render) {
24
+ if (render) {
25
+ unstableRender = render;
26
+ }
27
+ return unstableRender;
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antd-mobile",
3
- "version": "5.39.0",
3
+ "version": "5.40.0",
4
4
  "homepage": "https://github.com/ant-design/ant-design-mobile#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/ant-design/ant-design-mobile/issues"
@@ -44,7 +44,7 @@
44
44
  "nano-memoize": "^3.0.16",
45
45
  "rc-field-form": "^1.34.2",
46
46
  "rc-segmented": "~2.4.1",
47
- "rc-util": "^5.38.1",
47
+ "rc-util": "^5.44.4",
48
48
  "react-fast-compare": "^3.2.2",
49
49
  "react-is": "^18.2.0",
50
50
  "runes2": "^1.1.2",