@unicom-cloud/ui 0.8.55 → 0.8.56

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 (428) hide show
  1. package/Affix.js +36 -36
  2. package/Alert.js +41 -45
  3. package/Anchor.js +1 -1
  4. package/AutoComplete.js +40 -40
  5. package/Avatar.js +36 -36
  6. package/BackTop.js +26 -26
  7. package/Badge.js +43 -43
  8. package/Breadcrumb.js +17 -17
  9. package/Button.js +42 -42
  10. package/Calendar.js +54 -56
  11. package/Card.js +28 -28
  12. package/Carousel.js +42 -43
  13. package/Cascader.js +1 -1
  14. package/Checkbox.js +1 -1
  15. package/Collapse.js +1 -1
  16. package/ColorPicker.js +11 -580
  17. package/Comment.js +14 -14
  18. package/ConfigProvider.js +2 -2
  19. package/Copy.js +26 -26
  20. package/DatePicker.js +661 -670
  21. package/Descriptions.js +53 -53
  22. package/Divider.js +15 -15
  23. package/Draggable.js +16 -16
  24. package/Drawer.js +1 -1
  25. package/Dropdown.js +10 -10
  26. package/Empty.js +3 -3
  27. package/Form.js +10 -1410
  28. package/Grid.js +49 -49
  29. package/Icon.js +10 -10
  30. package/IconHover.js +2 -2
  31. package/Image.js +1 -1
  32. package/Input.js +1 -1
  33. package/InputNumber.js +7 -7
  34. package/InputTag.js +1 -1
  35. package/Layout.js +34 -34
  36. package/Link.js +26 -26
  37. package/List.js +39 -39
  38. package/Mentions.js +17 -17
  39. package/Menu.js +1 -1
  40. package/Message.js +3 -3
  41. package/Modal.js +1 -1
  42. package/Notice.js +4 -10
  43. package/Notification.js +3 -3
  44. package/OverflowEllipsis.js +18 -18
  45. package/PageHeader.js +26 -27
  46. package/Pagination.js +1 -1
  47. package/Picker.js +1 -1
  48. package/Popconfirm.js +15 -15
  49. package/Popover.js +22 -22
  50. package/Progress.js +18 -18
  51. package/Radio.js +2 -2
  52. package/Rate.js +40 -43
  53. package/ResizeBox.js +191 -192
  54. package/Result.js +17 -17
  55. package/Select.js +1 -1
  56. package/SelectView.js +56 -56
  57. package/Skeleton.js +35 -35
  58. package/Slider.js +81 -81
  59. package/Space.js +27 -27
  60. package/SpeechSynthesis.js +29 -32
  61. package/Spin.js +15 -15
  62. package/Statistic.js +54 -54
  63. package/Steps.js +44 -44
  64. package/Switch.js +39 -38
  65. package/Table.js +488 -488
  66. package/Tabs.js +1 -1
  67. package/Tag.js +13 -14
  68. package/TimePicker.js +68 -68
  69. package/Timeline.js +1 -1
  70. package/Tooltip.js +27 -28
  71. package/Transfer.js +29 -30
  72. package/Tree.js +1 -1
  73. package/TreeSelect.js +1 -1
  74. package/Trigger.js +53 -52
  75. package/Typography.js +2 -737
  76. package/Upload.js +1 -1
  77. package/VerificationCode.js +1 -1
  78. package/Version.js +1 -1
  79. package/Watermark.js +1 -1
  80. package/chunk/1mEO29GP.js +23 -0
  81. package/chunk/5pZ3ayqs.js +29 -0
  82. package/chunk/9Gh1afjL.js +23 -0
  83. package/chunk/B1S1OEw6.js +29 -0
  84. package/chunk/{RRWbBHK-.js → B2Bp3i5u.js} +221 -221
  85. package/chunk/B45v5S9k.js +209 -0
  86. package/chunk/B6fn5y_s.js +23 -0
  87. package/chunk/B9PsJar0.js +118 -0
  88. package/chunk/BA02BFUV.js +41 -0
  89. package/chunk/BCk8e9fj.js +29 -0
  90. package/chunk/BHK9zpXn.js +207 -0
  91. package/chunk/BHLTzWzi.js +29 -0
  92. package/chunk/BK1FKNAX.js +41 -0
  93. package/chunk/BM6dpkeM.js +32 -0
  94. package/chunk/{DQ3uFRJD.js → BP7xX86Q.js} +223 -202
  95. package/chunk/BWx1cVT_.js +66 -0
  96. package/chunk/BbI3gqVr.js +23 -0
  97. package/chunk/{CIc4yo9k.js → BbYzi8M0.js} +46 -46
  98. package/chunk/Be7oeWU8.js +34 -0
  99. package/chunk/BeM2hfks.js +88 -0
  100. package/chunk/BkHxm4sv.js +41 -0
  101. package/chunk/{BUQBof6z.js → Bl-ODC57.js} +206 -207
  102. package/chunk/BlKc_pDZ.js +678 -0
  103. package/chunk/{BzqZZHGK.js → Bny52uiG.js} +48 -48
  104. package/chunk/{PuuHmqnW.js → BpwDupra.js} +238 -238
  105. package/chunk/BqxwlITu.js +52 -0
  106. package/chunk/BuEC_zcc.js +278 -0
  107. package/chunk/{CqcZfQQ4.js → Bv8ZRDFt.js} +80 -80
  108. package/chunk/{DZGcv_9A.js → C-w9pFY-.js} +32 -32
  109. package/chunk/C2fspJbE.js +23 -0
  110. package/chunk/C7Okdv4u.js +34 -0
  111. package/chunk/C95ipQ6b.js +41 -0
  112. package/chunk/{BzMYgxgO.js → CF3Telny.js} +26 -26
  113. package/chunk/CPl52AZh.js +206 -0
  114. package/chunk/CXNW5Y2a.js +23 -0
  115. package/chunk/Cb_oWoGj.js +40 -0
  116. package/chunk/CcX2pBUh.js +46 -0
  117. package/chunk/{BdJcAQ0Q.js → CggcswbO.js} +18 -18
  118. package/chunk/CilQ012k.js +1796 -0
  119. package/chunk/CkAOsst1.js +73 -0
  120. package/chunk/CnY8SvgY.js +126 -0
  121. package/chunk/{CTSIr-Pr.js → CwXmtKib.js} +89 -101
  122. package/chunk/{C3I_L73_.js → CwjaGytU.js} +39 -40
  123. package/chunk/{DTgc2wl4.js → D6RTBH4C.js} +36 -36
  124. package/chunk/D6mVoX-C.js +116 -0
  125. package/chunk/D9TqtOhq.js +40 -0
  126. package/chunk/{CZ8iz63Z.js → DBJ8d0o0.js} +210 -217
  127. package/chunk/{RL1SNlng.js → DDda6s72.js} +16 -16
  128. package/chunk/{BH5fVprw.js → DJmWXheU.js} +9 -9
  129. package/chunk/DPvnQJ-H.js +52 -0
  130. package/chunk/DQXq1QT0.js +58 -0
  131. package/chunk/DRJO1GfY.js +855 -0
  132. package/chunk/DUxWiN2U.js +1465 -0
  133. package/chunk/DYZzQ2uT.js +29 -0
  134. package/chunk/{CK0H_Yi4.js → DafaH1Qt.js} +140 -138
  135. package/chunk/{ShWkfsJd.js → DalIRWr7.js} +21 -21
  136. package/chunk/{CzTYWtfa.js → Dg2DmtzA.js} +31 -30
  137. package/chunk/DhLbnw3R.js +29 -0
  138. package/chunk/{BmtF7P8U.js → DkIjpuBZ.js} +170 -170
  139. package/chunk/Do1aMgY3.js +12 -0
  140. package/chunk/Dtnux4qL.js +38 -0
  141. package/chunk/{Niaq_og8.js → Dw4SJ4o1.js} +219 -225
  142. package/chunk/{DbtCtriE.js → DxNRWF67.js} +30 -31
  143. package/chunk/JnyGFb5j.js +284 -0
  144. package/chunk/Lk60-jkf.js +1098 -0
  145. package/chunk/V_IcWDFx.js +49 -0
  146. package/chunk/{DG7VgAhL.js → WkB0MERB.js} +107 -108
  147. package/chunk/bsawGxt8.js +32 -0
  148. package/chunk/cUuQh7L_.js +46 -0
  149. package/chunk/fqgc8r6C.js +29 -0
  150. package/chunk/m_kOQCiU.js +29 -0
  151. package/chunk/sl8s35SK.js +29 -0
  152. package/chunk/{Dki1RB5p.js → t51ig1FZ.js} +154 -155
  153. package/chunk/{BC0PujUD.js → yvbAFxtk.js} +119 -121
  154. package/hooks/index.js +52 -246
  155. package/hooks/useForceUpdate.js +6 -6
  156. package/hooks/useIntersectionObserver.js +12 -10
  157. package/hooks/useKeyboardEvent.js +7 -7
  158. package/hooks/useMedia.js +9 -12
  159. package/hooks/useMergeValue.js +10 -8
  160. package/hooks/useResizeObserver.js +16 -0
  161. package/hooks/useUpdateEffect.js +7 -9
  162. package/hooks/useWindowSize.js +16 -20
  163. package/icons.js +6003 -0
  164. package/index.js +377 -472
  165. package/locale/en-US.js +20 -6
  166. package/locale/ja-JP.js +4 -2
  167. package/locale/ko-KR.js +2 -2
  168. package/locale/pt-BR.js +3 -3
  169. package/locale/pt-PT.js +3 -3
  170. package/locale/tr-TR.js +11 -3
  171. package/locale/zh-CN.js +6 -0
  172. package/locale/zh-HK.js +2 -0
  173. package/locale/zh-TW.js +2 -0
  174. package/package.json +1 -1
  175. package/style.css +1 -1
  176. package/types/anchor/util.d.ts +1 -0
  177. package/types/button/index.d.ts +2 -2
  178. package/types/color-picker/colors.d.ts +1 -1
  179. package/types/date-picker/util.d.ts +1 -1
  180. package/types/hooks/index.d.ts +3 -101
  181. package/types/hooks/useForceUpdate.d.ts +1 -2
  182. package/types/hooks/useIntersectionObserver.d.ts +1 -1
  183. package/types/hooks/useKeyboardEvent.d.ts +2 -2
  184. package/types/hooks/useMergeProps.d.ts +1 -1
  185. package/types/hooks/useResizeObserver.d.ts +5 -0
  186. package/types/hooks/useUpdateEffect.d.ts +2 -3
  187. package/types/hooks/useWindowSize.d.ts +1 -1
  188. package/types/icons.d.ts +4 -0
  189. package/types/index.d.ts +12 -2
  190. package/types/locale/en-US.d.ts +4 -0
  191. package/types/locale/interface.d.ts +2 -0
  192. package/types/locale/ja-JP.d.ts +4 -0
  193. package/types/locale/zh-CN.d.ts +4 -0
  194. package/types/locale/zh-HK.d.ts +4 -0
  195. package/types/locale/zh-TW.d.ts +4 -0
  196. package/types/version/index.d.ts +1 -1
  197. package/utils/CSSTransition.js +1 -1
  198. package/utils/className.js +2 -3
  199. package/utils/contextHolder.js +2 -2
  200. package/utils/copy.js +2 -3
  201. package/utils/is.js +127 -90
  202. package/utils/reactDOM.js +17 -15
  203. package/utils/responsiveObserve.js +16 -16
  204. package/utils/saveAs.js +2 -3
  205. package/utils/scrollIntoView.js +1 -1
  206. package/chunk/BdYAMaw9.js +0 -6
  207. package/chunk/CiZVOdJ3.js +0 -122
  208. package/chunk/DdtfPvgk.js +0 -272
  209. package/chunk/I4RV9SKZ.js +0 -135
  210. package/chunk/TXCrI0jN.js +0 -20
  211. package/chunk/i1A7W8Qt.js +0 -277
  212. package/chunk/xPzFRQJn.js +0 -740
  213. package/hooks/useAsync.js +0 -13
  214. package/hooks/useAsyncFn.js +0 -15
  215. package/hooks/useAsyncRetry.js +0 -17
  216. package/hooks/useAudio.js +0 -5
  217. package/hooks/useBeforeUnload.js +0 -18
  218. package/hooks/useBoolean.js +0 -4
  219. package/hooks/useClickAway.js +0 -22
  220. package/hooks/useCopyToClipboard.js +0 -51
  221. package/hooks/useCounter.js +0 -45
  222. package/hooks/useCreation.js +0 -17
  223. package/hooks/useCustomCompareEffect.js +0 -15
  224. package/hooks/useDebounce.js +0 -9
  225. package/hooks/useDefault.js +0 -10
  226. package/hooks/useDrop.js +0 -44
  227. package/hooks/useDropArea.js +0 -45
  228. package/hooks/useEffectOnce.js +0 -7
  229. package/hooks/useEffectState.js +0 -9
  230. package/hooks/useEnsuredForwardedRef.js +0 -17
  231. package/hooks/useError.js +0 -13
  232. package/hooks/useEvent.js +0 -13
  233. package/hooks/useEventListener.js +0 -39
  234. package/hooks/useFavicon.js +0 -16
  235. package/hooks/useFirstMountState.js +0 -8
  236. package/hooks/useFullscreen.js +0 -39
  237. package/hooks/useGeolocation.js +0 -38
  238. package/hooks/useGetSet.js +0 -18
  239. package/hooks/useGetSetState.js +0 -12
  240. package/hooks/useHash.js +0 -26
  241. package/hooks/useHover.js +0 -16
  242. package/hooks/useHoverDirty.js +0 -17
  243. package/hooks/useIdle.js +0 -34
  244. package/hooks/useIntersection.js +0 -19
  245. package/hooks/useIsomorphicLayoutEffect2.js +0 -6
  246. package/hooks/useKey.js +0 -16
  247. package/hooks/useKeyPress.js +0 -13
  248. package/hooks/useKeyPressEvent.js +0 -11
  249. package/hooks/useLatest.js +0 -8
  250. package/hooks/useLifecycles.js +0 -9
  251. package/hooks/useList.js +0 -67
  252. package/hooks/useLocalStorage.js +0 -42
  253. package/hooks/useLocation.js +0 -51
  254. package/hooks/useLockBodyScroll.js +0 -55
  255. package/hooks/useLogger.js +0 -10
  256. package/hooks/useLongPress.js +0 -24
  257. package/hooks/useMap.js +0 -31
  258. package/hooks/useMeasure.js +0 -34
  259. package/hooks/useMeasureDirty.js +0 -24
  260. package/hooks/useMediaDevices.js +0 -26
  261. package/hooks/useMediatedState.js +0 -14
  262. package/hooks/useMethods.js +0 -14
  263. package/hooks/useMotion.js +0 -56
  264. package/hooks/useMount.js +0 -9
  265. package/hooks/useMountedState.js +0 -10
  266. package/hooks/useMouse.js +0 -44
  267. package/hooks/useMouseHovered.js +0 -9
  268. package/hooks/useMouseWheel.js +0 -14
  269. package/hooks/useMultiStateValidator.js +0 -19
  270. package/hooks/useNetworkState.js +0 -31
  271. package/hooks/useNumber.js +0 -4
  272. package/hooks/useObservable.js +0 -12
  273. package/hooks/useOrientation.js +0 -30
  274. package/hooks/usePageLeave.js +0 -19
  275. package/hooks/usePermission.js +0 -19
  276. package/hooks/usePinchZoom.js +0 -40
  277. package/hooks/usePreviousDistinct.js +0 -10
  278. package/hooks/usePromise.js +0 -19
  279. package/hooks/useQueue.js +0 -25
  280. package/hooks/useRaf.js +0 -24
  281. package/hooks/useRafLoop.js +0 -24
  282. package/hooks/useRafState.js +0 -15
  283. package/hooks/useReactive.js +0 -21
  284. package/hooks/useRendersCount.js +0 -7
  285. package/hooks/useScroll.js +0 -27
  286. package/hooks/useScrolling.js +0 -23
  287. package/hooks/useSearchParam.js +0 -18
  288. package/hooks/useSessionStorage.js +0 -29
  289. package/hooks/useSet.js +0 -15
  290. package/hooks/useSetState.js +0 -16
  291. package/hooks/useSize.js +0 -58
  292. package/hooks/useSlider.js +0 -48
  293. package/hooks/useSpeech.js +0 -45
  294. package/hooks/useStartTyping.js +0 -30
  295. package/hooks/useStateList.js +0 -37
  296. package/hooks/useStateValidator.js +0 -17
  297. package/hooks/useStateWithHistory.js +0 -46
  298. package/hooks/useSyncState.js +0 -14
  299. package/hooks/useThrottle.js +0 -21
  300. package/hooks/useThrottleFn.js +0 -21
  301. package/hooks/useTimeout.js +0 -17
  302. package/hooks/useTimeoutFn.js +0 -16
  303. package/hooks/useTitle.js +0 -18
  304. package/hooks/useToggle.js +0 -5
  305. package/hooks/useTween.js +0 -11
  306. package/hooks/useUnmount.js +0 -9
  307. package/hooks/useUnmountPromise.js +0 -20
  308. package/hooks/useUpdate.js +0 -10
  309. package/hooks/useUpdateTimeout.js +0 -9
  310. package/hooks/useUpsert.js +0 -16
  311. package/hooks/useVibrate.js +0 -21
  312. package/hooks/useVideo.js +0 -5
  313. package/hooks/useWindowScroll.js +0 -29
  314. package/types/hooks/component/UseKey.d.ts +0 -2
  315. package/types/hooks/factory/createBreakpoint.d.ts +0 -4
  316. package/types/hooks/factory/createGlobalState.d.ts +0 -7
  317. package/types/hooks/factory/createHTMLMediaHook.d.ts +0 -33
  318. package/types/hooks/factory/createMemo.d.ts +0 -2
  319. package/types/hooks/factory/createReducer.d.ts +0 -8
  320. package/types/hooks/factory/createReducerContext.d.ts +0 -5
  321. package/types/hooks/factory/createRenderProp.d.ts +0 -1
  322. package/types/hooks/factory/createRouter.d.ts +0 -7
  323. package/types/hooks/factory/createStateContext.d.ts +0 -5
  324. package/types/hooks/misc/hookState.d.ts +0 -8
  325. package/types/hooks/misc/parseTimeRanges.d.ts +0 -4
  326. package/types/hooks/misc/types.d.ts +0 -2
  327. package/types/hooks/misc/util.d.ts +0 -5
  328. package/types/hooks/useAsync.d.ts +0 -20
  329. package/types/hooks/useAsyncFn.d.ts +0 -23
  330. package/types/hooks/useAsyncRetry.d.ts +0 -27
  331. package/types/hooks/useAudio.d.ts +0 -11
  332. package/types/hooks/useBeforeUnload.d.ts +0 -2
  333. package/types/hooks/useBoolean.d.ts +0 -2
  334. package/types/hooks/useClickAway.d.ts +0 -3
  335. package/types/hooks/useCopyToClipboard.d.ts +0 -7
  336. package/types/hooks/useCounter.d.ts +0 -9
  337. package/types/hooks/useCreation.d.ts +0 -2
  338. package/types/hooks/useCustomCompareEffect.d.ts +0 -4
  339. package/types/hooks/useDebounce.d.ts +0 -3
  340. package/types/hooks/useDefault.d.ts +0 -2
  341. package/types/hooks/useDrop.d.ts +0 -17
  342. package/types/hooks/useDropArea.d.ts +0 -18
  343. package/types/hooks/useEffectOnce.d.ts +0 -3
  344. package/types/hooks/useEffectState.d.ts +0 -2
  345. package/types/hooks/useEnsuredForwardedRef.d.ts +0 -3
  346. package/types/hooks/useError.d.ts +0 -2
  347. package/types/hooks/useEvent.d.ts +0 -13
  348. package/types/hooks/useEventListener.d.ts +0 -2
  349. package/types/hooks/useFavicon.d.ts +0 -2
  350. package/types/hooks/useFirstMountState.d.ts +0 -1
  351. package/types/hooks/useFullscreen.d.ts +0 -10
  352. package/types/hooks/useGeolocation.d.ts +0 -21
  353. package/types/hooks/useGetSet.d.ts +0 -3
  354. package/types/hooks/useGetSetState.d.ts +0 -2
  355. package/types/hooks/useHash.d.ts +0 -2
  356. package/types/hooks/useHover.d.ts +0 -4
  357. package/types/hooks/useHoverDirty.d.ts +0 -3
  358. package/types/hooks/useIdle.d.ts +0 -2
  359. package/types/hooks/useIntersection.d.ts +0 -3
  360. package/types/hooks/useIsomorphicLayoutEffect2.d.ts +0 -3
  361. package/types/hooks/useKey.d.ts +0 -12
  362. package/types/hooks/useKeyPress.d.ts +0 -3
  363. package/types/hooks/useKeyPressEvent.d.ts +0 -3
  364. package/types/hooks/useLatest.d.ts +0 -4
  365. package/types/hooks/useLifecycles.d.ts +0 -2
  366. package/types/hooks/useList.d.ts +0 -18
  367. package/types/hooks/useLocalStorage.d.ts +0 -10
  368. package/types/hooks/useLocation.d.ts +0 -16
  369. package/types/hooks/useLockBodyScroll.d.ts +0 -8
  370. package/types/hooks/useLogger.d.ts +0 -2
  371. package/types/hooks/useLongPress.d.ts +0 -12
  372. package/types/hooks/useMap.d.ts +0 -11
  373. package/types/hooks/useMeasure.d.ts +0 -9
  374. package/types/hooks/useMeasureDirty.d.ts +0 -11
  375. package/types/hooks/useMediaDevices.d.ts +0 -2
  376. package/types/hooks/useMediatedState.d.ts +0 -9
  377. package/types/hooks/useMethods.d.ts +0 -8
  378. package/types/hooks/useMotion.d.ts +0 -20
  379. package/types/hooks/useMount.d.ts +0 -2
  380. package/types/hooks/useMountedState.d.ts +0 -1
  381. package/types/hooks/useMouse.d.ts +0 -13
  382. package/types/hooks/useMouseHovered.d.ts +0 -8
  383. package/types/hooks/useMouseWheel.d.ts +0 -2
  384. package/types/hooks/useMultiStateValidator.d.ts +0 -9
  385. package/types/hooks/useNetworkState.d.ts +0 -22
  386. package/types/hooks/useNumber.d.ts +0 -2
  387. package/types/hooks/useObservable.d.ts +0 -8
  388. package/types/hooks/useOrientation.d.ts +0 -6
  389. package/types/hooks/usePageLeave.d.ts +0 -2
  390. package/types/hooks/usePermission.d.ts +0 -16
  391. package/types/hooks/usePinchZoom.d.ts +0 -18
  392. package/types/hooks/usePreviousDistinct.d.ts +0 -2
  393. package/types/hooks/usePromise.d.ts +0 -3
  394. package/types/hooks/useQueue.d.ts +0 -9
  395. package/types/hooks/useRaf.d.ts +0 -2
  396. package/types/hooks/useRafLoop.d.ts +0 -2
  397. package/types/hooks/useRafState.d.ts +0 -3
  398. package/types/hooks/useReactive.d.ts +0 -2
  399. package/types/hooks/useRendersCount.d.ts +0 -1
  400. package/types/hooks/useScroll.d.ts +0 -7
  401. package/types/hooks/useScrolling.d.ts +0 -3
  402. package/types/hooks/useSearchParam.d.ts +0 -3
  403. package/types/hooks/useSessionStorage.d.ts +0 -2
  404. package/types/hooks/useSet.d.ts +0 -11
  405. package/types/hooks/useSetState.d.ts +0 -2
  406. package/types/hooks/useSize.d.ts +0 -8
  407. package/types/hooks/useSlider.d.ts +0 -15
  408. package/types/hooks/useSpeech.d.ts +0 -16
  409. package/types/hooks/useStartTyping.d.ts +0 -2
  410. package/types/hooks/useStateList.d.ts +0 -9
  411. package/types/hooks/useStateValidator.d.ts +0 -8
  412. package/types/hooks/useStateWithHistory.d.ts +0 -18
  413. package/types/hooks/useSyncState.d.ts +0 -3
  414. package/types/hooks/useThrottle.d.ts +0 -2
  415. package/types/hooks/useThrottleFn.d.ts +0 -2
  416. package/types/hooks/useTimeout.d.ts +0 -2
  417. package/types/hooks/useTimeoutFn.d.ts +0 -2
  418. package/types/hooks/useTitle.d.ts +0 -6
  419. package/types/hooks/useToggle.d.ts +0 -2
  420. package/types/hooks/useTween.d.ts +0 -3
  421. package/types/hooks/useUnmount.d.ts +0 -2
  422. package/types/hooks/useUnmountPromise.d.ts +0 -3
  423. package/types/hooks/useUpdate.d.ts +0 -2
  424. package/types/hooks/useUpdateTimeout.d.ts +0 -2
  425. package/types/hooks/useUpsert.d.ts +0 -6
  426. package/types/hooks/useVibrate.d.ts +0 -4
  427. package/types/hooks/useVideo.d.ts +0 -11
  428. package/types/hooks/useWindowScroll.d.ts +0 -6
@@ -0,0 +1,1796 @@
1
+ var lt = Object.defineProperty;
2
+ var ot = (r, e, t) => e in r ? lt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var u = (r, e, t) => ot(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { jsx as p, jsxs as Q, Fragment as qe } from "react/jsx-runtime";
5
+ import { y as at } from "./CnY8SvgY.js";
6
+ import R from "lodash/isPlainObject";
7
+ import Oe from "lodash/merge";
8
+ import K, { createContext as pe, useRef as L, forwardRef as we, useContext as U, useEffect as he, useImperativeHandle as ht, Component as ut, isValidElement as Se, useState as me, useMemo as ke, createElement as xe, cloneElement as Re, useCallback as ne } from "react";
9
+ import { b as De, C as ct } from "./DUxWiN2U.js";
10
+ import dt from "../hooks/useCreate.js";
11
+ import gt from "../hooks/useMergeProps.js";
12
+ import { y as B } from "./Do1aMgY3.js";
13
+ import Ue from "../utils/omit.js";
14
+ import { NOOP as y } from "../utils/constant.js";
15
+ import M from "lodash/get";
16
+ import ze from "lodash/has";
17
+ import S from "lodash/isArray";
18
+ import _ from "lodash/isFunction";
19
+ import mt from "lodash/omit";
20
+ import Ge from "lodash/setWith";
21
+ import { isExist as Ne } from "../utils/is.js";
22
+ import A from "lodash/isObject";
23
+ import Ae from "lodash/isEqual";
24
+ import { G as Y, V as Be, z as ft } from "./BeM2hfks.js";
25
+ import fe from "lodash/isString";
26
+ import { t as pt } from "./V_IcWDFx.js";
27
+ import He from "lodash/isBoolean";
28
+ import Ft from "lodash/isNumber";
29
+ import Je from "lodash/cloneDeepWith";
30
+ import Ze from "lodash/set";
31
+ import { b as bt, c as vt, a as yt, e as Vt } from "./B45v5S9k.js";
32
+ import je from "lodash/isEqualWith";
33
+ import St from "lodash/isNil";
34
+ import oe from "../utils/warning.js";
35
+ import le from "lodash/isUndefined";
36
+ import Ye from "../Grid.js";
37
+ import { P as jt } from "./BP7xX86Q.js";
38
+ import { I as Et } from "./Be7oeWU8.js";
39
+ import wt from "../Tooltip.js";
40
+ import Ct from "../hooks/useForceUpdate.js";
41
+ const It = (r, e) => {
42
+ const t = {};
43
+ return Object.keys(r).forEach((s) => {
44
+ const i = r[s], l = e && e[s];
45
+ t[s] = A(i) ? {
46
+ ...i,
47
+ ...l
48
+ } : l || i;
49
+ }), t;
50
+ }, Mt = (r, e) => {
51
+ const t = e.split(".");
52
+ let s = r;
53
+ for (let i = 0; i < t.length; i++)
54
+ if (s = s && s[t[i]], s === void 0)
55
+ return s;
56
+ return s;
57
+ };
58
+ var $t = Object.defineProperty, Tt = (r, e, t) => e in r ? $t(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, G = (r, e, t) => Tt(r, typeof e != "symbol" ? e + "" : e, t);
59
+ class X {
60
+ constructor(e, t) {
61
+ G(this, "obj"), G(this, "message"), G(this, "type"), G(this, "error"), G(this, "_not"), G(this, "validateMessages"), G(this, "field"), G(this, "getValidateMsg", (s, i = {}) => {
62
+ const l = {
63
+ ...i,
64
+ value: this.obj,
65
+ field: this.field,
66
+ type: this.type
67
+ }, n = Mt(this.validateMessages, s);
68
+ return _(n) ? n(l) : fe(n) ? n.replace(/\#\{.+?\}/g, (o) => {
69
+ const a = o.slice(2, -1);
70
+ if (a in l) {
71
+ if (A(l[a]) || S(l[a]))
72
+ try {
73
+ return JSON.stringify(l[a]);
74
+ } catch {
75
+ return l[a];
76
+ }
77
+ return String(l[a]);
78
+ }
79
+ return o;
80
+ }) : n;
81
+ }), A(t) && fe(e) && t.trim ? this.obj = e.trim() : A(t) && t.ignoreEmptyString && e === "" ? this.obj = void 0 : this.obj = e, this.message = t.message, this.type = t.type, this.error = null, this.field = t.field || t.type, this.validateMessages = It(
82
+ pt,
83
+ t.validateMessages
84
+ );
85
+ }
86
+ get not() {
87
+ return this._not = !this._not, this;
88
+ }
89
+ get isRequired() {
90
+ if (Y(this.obj) || Be(this.obj)) {
91
+ const e = this.getValidateMsg("required");
92
+ this.error = {
93
+ value: this.obj,
94
+ type: this.type,
95
+ requiredError: !0,
96
+ message: this.message || (A(e) ? e : `${this._not ? "[NOT MODE]:" : ""}${e}`)
97
+ };
98
+ }
99
+ return this;
100
+ }
101
+ get end() {
102
+ return this.error;
103
+ }
104
+ addError(e) {
105
+ !this.error && e && (this.error = {
106
+ value: this.obj,
107
+ type: this.type,
108
+ message: this.message || (A(e) ? e : `${this._not ? "[NOT MODE]:" : ""}${e}`)
109
+ });
110
+ }
111
+ validate(e, t) {
112
+ return (this._not ? e : !e) && this.addError(t), this;
113
+ }
114
+ collect(e) {
115
+ e == null || e(this.error);
116
+ }
117
+ }
118
+ class kt extends X {
119
+ constructor(e, t) {
120
+ super(e, {
121
+ ...t,
122
+ type: "array"
123
+ }), this.validate(
124
+ t && t.strict ? S(this.obj) : !0,
125
+ this.getValidateMsg("type.array", { value: this.obj, type: this.type })
126
+ );
127
+ }
128
+ length(e) {
129
+ return this.obj ? this.validate(
130
+ this.obj.length === e,
131
+ this.getValidateMsg("array.length", { value: this.obj, length: e })
132
+ ) : this;
133
+ }
134
+ minLength(e) {
135
+ return this.obj ? this.validate(
136
+ this.obj.length >= e,
137
+ this.getValidateMsg("array.minLength", {
138
+ value: this.obj,
139
+ minLength: e
140
+ })
141
+ ) : this;
142
+ }
143
+ maxLength(e) {
144
+ return this.obj ? this.validate(
145
+ this.obj.length <= e,
146
+ this.getValidateMsg("array.maxLength", {
147
+ value: this.obj,
148
+ maxLength: e
149
+ })
150
+ ) : this;
151
+ }
152
+ includes(e) {
153
+ return this.obj ? this.validate(
154
+ e.every((t) => this.obj.indexOf(t) !== -1),
155
+ this.getValidateMsg("array.includes", {
156
+ value: this.obj,
157
+ includes: e
158
+ })
159
+ ) : this;
160
+ }
161
+ deepEqual(e) {
162
+ return this.obj ? this.validate(
163
+ Ae(this.obj, e),
164
+ this.getValidateMsg("array.deepEqual", {
165
+ value: this.obj,
166
+ deepEqual: e
167
+ })
168
+ ) : this;
169
+ }
170
+ get empty() {
171
+ return this.validate(
172
+ Be(this.obj),
173
+ this.getValidateMsg("array.empty", { value: this.obj })
174
+ );
175
+ }
176
+ }
177
+ let xt = class extends X {
178
+ constructor(e, t) {
179
+ super(e, {
180
+ ...t,
181
+ type: "boolean"
182
+ }), this.validate(
183
+ t && t.strict ? He(this.obj) : !0,
184
+ this.getValidateMsg("type.boolean")
185
+ );
186
+ }
187
+ get true() {
188
+ return this.validate(
189
+ this.obj === !0,
190
+ this.getValidateMsg("boolean.true")
191
+ );
192
+ }
193
+ get false() {
194
+ return this.validate(
195
+ this.obj === !1,
196
+ this.getValidateMsg("boolean.false")
197
+ );
198
+ }
199
+ }, Rt = class extends X {
200
+ constructor(e, t) {
201
+ super(e, {
202
+ ...t,
203
+ type: "custom"
204
+ });
205
+ }
206
+ get validate() {
207
+ const e = this;
208
+ return function(t, s) {
209
+ let i;
210
+ if (t)
211
+ return i = t(e.obj, e.addError.bind(e)), i && i.then ? (s && i.then(
212
+ () => {
213
+ s == null || s(e.error);
214
+ },
215
+ (l) => {
216
+ console.error(l);
217
+ }
218
+ ), [i, e]) : (s == null || s(e.error), e.error);
219
+ };
220
+ }
221
+ }, Nt = class extends X {
222
+ constructor(e, t) {
223
+ super(e, {
224
+ ...t,
225
+ type: "number"
226
+ }), this.validate(
227
+ t && t.strict ? Ft(this.obj) : !0,
228
+ this.getValidateMsg("type.number")
229
+ );
230
+ }
231
+ min(e) {
232
+ return Y(this.obj) ? this : this.validate(
233
+ this.obj >= e,
234
+ this.getValidateMsg("number.min", { min: e })
235
+ );
236
+ }
237
+ max(e) {
238
+ return Y(this.obj) ? this : this.validate(
239
+ this.obj <= e,
240
+ this.getValidateMsg("number.max", { max: e })
241
+ );
242
+ }
243
+ equal(e) {
244
+ return Y(this.obj) ? this : this.validate(
245
+ this.obj === e,
246
+ this.getValidateMsg("number.equal", { equal: e })
247
+ );
248
+ }
249
+ range(e, t) {
250
+ return Y(this.obj) ? this : this.validate(
251
+ this.obj >= e && this.obj <= t,
252
+ this.getValidateMsg("number.range", { min: e, max: t })
253
+ );
254
+ }
255
+ get positive() {
256
+ return Y(this.obj) ? this : this.validate(this.obj > 0, this.getValidateMsg("number.positive"));
257
+ }
258
+ get negative() {
259
+ return Y(this.obj) ? this : this.validate(this.obj < 0, this.getValidateMsg("number.negative"));
260
+ }
261
+ };
262
+ class Pt extends X {
263
+ constructor(e, t) {
264
+ super(e, {
265
+ ...t,
266
+ type: "object"
267
+ }), this.validate(
268
+ t && t.strict ? A(this.obj) : !0,
269
+ this.getValidateMsg("type.object")
270
+ );
271
+ }
272
+ deepEqual(e) {
273
+ return this.obj ? this.validate(
274
+ Ae(this.obj, e),
275
+ this.getValidateMsg("object.deepEqual", { deepEqual: e })
276
+ ) : this;
277
+ }
278
+ hasKeys(e) {
279
+ return this.obj ? this.validate(
280
+ e.every((t) => this.obj[t]),
281
+ this.getValidateMsg("object.hasKeys", { keys: e })
282
+ ) : this;
283
+ }
284
+ get empty() {
285
+ return this.validate(
286
+ ft(this.obj),
287
+ this.getValidateMsg("object.empty")
288
+ );
289
+ }
290
+ }
291
+ class Wt extends X {
292
+ constructor(e, t) {
293
+ super(e, {
294
+ ...t,
295
+ type: "string"
296
+ }), this.validate(
297
+ t && t.strict ? fe(this.obj) : !0,
298
+ this.getValidateMsg("type.string")
299
+ );
300
+ }
301
+ maxLength(e) {
302
+ return this.obj ? this.validate(
303
+ this.obj.length <= e,
304
+ this.getValidateMsg("string.maxLength", { maxLength: e })
305
+ ) : this;
306
+ }
307
+ minLength(e) {
308
+ return this.obj ? this.validate(
309
+ this.obj.length >= e,
310
+ this.getValidateMsg("string.minLength", { minLength: e })
311
+ ) : this;
312
+ }
313
+ length(e) {
314
+ return this.obj ? this.validate(
315
+ this.obj.length === e,
316
+ this.getValidateMsg("string.length", { length: e })
317
+ ) : this;
318
+ }
319
+ match(e) {
320
+ const t = e instanceof RegExp;
321
+ return t && (e.lastIndex = 0), this.validate(
322
+ this.obj === void 0 || t && e.test(this.obj),
323
+ this.getValidateMsg("string.match", { pattern: e })
324
+ );
325
+ }
326
+ get uppercase() {
327
+ return this.obj ? this.validate(
328
+ this.obj.toUpperCase() === this.obj,
329
+ this.getValidateMsg("string.uppercase")
330
+ ) : this;
331
+ }
332
+ get lowercase() {
333
+ return this.obj ? this.validate(
334
+ this.obj.toLowerCase() === this.obj,
335
+ this.getValidateMsg("string.lowercase")
336
+ ) : this;
337
+ }
338
+ }
339
+ const _t = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, Lt = new RegExp(
340
+ "^(?!mailto:)(?:(?:http|https|ftp)://)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$",
341
+ "i"
342
+ ), qt = /^(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})(\.(2(5[0-5]{1}|[0-4]\d{1})|[0-1]?\d{1,2})){3}$/;
343
+ class Ot extends X {
344
+ constructor(e, t) {
345
+ super(e, {
346
+ ...t,
347
+ type: "type"
348
+ });
349
+ }
350
+ get email() {
351
+ return this.type = "email", this.validate(
352
+ this.obj === void 0 || _t.test(this.obj),
353
+ this.getValidateMsg("type.email")
354
+ );
355
+ }
356
+ get url() {
357
+ return this.type = "url", this.validate(
358
+ this.obj === void 0 || Lt.test(this.obj),
359
+ this.getValidateMsg("type.url")
360
+ );
361
+ }
362
+ get ip() {
363
+ return this.type = "ip", this.validate(
364
+ this.obj === void 0 || qt.test(this.obj),
365
+ this.getValidateMsg("type.ip")
366
+ );
367
+ }
368
+ }
369
+ var Dt = Object.defineProperty, Ut = (r, e, t) => e in r ? Dt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, O = (r, e, t) => Ut(r, typeof e != "symbol" ? e + "" : e, t);
370
+ class zt {
371
+ constructor(e, t) {
372
+ O(this, "number"), O(this, "string"), O(this, "array"), O(this, "object"), O(this, "boolean"), O(this, "type"), O(this, "custom"), this.string = new Wt(e, t), this.number = new Nt(e, t), this.array = new kt(e, t), this.object = new Pt(e, t), this.boolean = new xt(e, t), this.type = new Ot(e, t), this.custom = new Rt(e, t);
373
+ }
374
+ }
375
+ class Gt {
376
+ constructor(e, t = {}) {
377
+ O(this, "schema"), O(this, "options"), this.schema = e, this.options = t;
378
+ }
379
+ validate(e, t) {
380
+ if (!A(e))
381
+ return;
382
+ const s = [];
383
+ let i = null;
384
+ function l(n, o) {
385
+ i || (i = {}), (!i[n] || o.requiredError) && (i[n] = o);
386
+ }
387
+ this.schema && Object.keys(this.schema).forEach((n) => {
388
+ if (S(this.schema[n]))
389
+ for (let o = 0; o < this.schema[n].length; o++) {
390
+ const a = this.schema[n][o], c = a.type, h = a.message;
391
+ if (!c && !a.validator)
392
+ throw `You must specify a type to field ${n}!`;
393
+ const d = new zt(e[n], {
394
+ ...this.options,
395
+ message: h,
396
+ field: n
397
+ });
398
+ let g = d.type[c] || null;
399
+ if (!g)
400
+ if (a.validator) {
401
+ g = d.custom.validate(a.validator), S(g) && g[0].then ? s.push({
402
+ function: g[0],
403
+ _this: g[1],
404
+ key: n
405
+ }) : g && l(n, g);
406
+ continue;
407
+ } else
408
+ g = d[c];
409
+ if (Object.keys(a).forEach((m) => {
410
+ a.required && (g = g.isRequired), m !== "message" && g[m] && a[m] && typeof g[m] == "object" && (g = g[m]), g[m] && a[m] !== void 0 && typeof g[m] == "function" && (g = g[m](a[m]));
411
+ }), g.collect((m) => {
412
+ m && l(n, m);
413
+ }), i)
414
+ break;
415
+ }
416
+ }), s.length > 0 ? Promise.all(s.map((n) => n.function)).then(() => {
417
+ s.forEach((n) => {
418
+ n._this.error && l(n.key, n._this.error);
419
+ }), t == null || t(i);
420
+ }) : t == null || t(i);
421
+ }
422
+ }
423
+ const ae = pe({
424
+ layout: "horizontal",
425
+ labelCol: { span: 5, offset: 0 },
426
+ labelAlign: "right",
427
+ wrapperCol: { span: 19, offset: 0 },
428
+ requiredSymbol: !0,
429
+ getFormElementId: () => "pqb-",
430
+ store: {
431
+ clearFields: y,
432
+ getFieldsValue: y,
433
+ getFieldValue: y,
434
+ getFieldError: y,
435
+ getFieldsError: y,
436
+ getTouchedFields: y,
437
+ getFields: y,
438
+ getInitialValues: y,
439
+ setInitialValues: y,
440
+ setInitialValue: y,
441
+ setFieldValue: y,
442
+ setFieldsValue: y,
443
+ setFields: y,
444
+ resetFields: y,
445
+ submit: y,
446
+ validate: y,
447
+ getFieldsState: y,
448
+ scrollToField: y,
449
+ getInnerMethods: () => ({
450
+ registerField: y,
451
+ innerGetStore: y,
452
+ registerStateWatcher: y,
453
+ registerWatcher: y,
454
+ innerGetStoreStatus: y
455
+ })
456
+ }
457
+ }), Ee = pe({}), Ke = pe({}), Qe = pe({}), ye = {
458
+ error: "error",
459
+ success: "success",
460
+ warning: "warning",
461
+ validating: "validating"
462
+ };
463
+ var D = /* @__PURE__ */ ((r) => (r.init = "init", r.error = "error", r.success = "success", r.submitting = "submitting", r))(D || {});
464
+ class At extends Error {
465
+ constructor(t) {
466
+ super("form validate error, get errors by error.errors");
467
+ u(this, "errors", {});
468
+ this.errors = t;
469
+ }
470
+ }
471
+ function Bt(r) {
472
+ return Object.defineProperty(
473
+ (...e) => typeof e[e.length - 1] == "function" ? r.apply(this, e) : new Promise((t, s) => (e[e.length] = (i, l) => {
474
+ if (i) return s(new At(i));
475
+ t(l);
476
+ }, e.length++, r.apply(this, e))),
477
+ "name",
478
+ { value: r.name }
479
+ );
480
+ }
481
+ function ie(r) {
482
+ return Je(r, (e) => {
483
+ if (!R(e) && !S(e))
484
+ return e;
485
+ });
486
+ }
487
+ const Ht = (r, e) => Je(r, (t) => {
488
+ if (_(t))
489
+ return (s) => t(s, e);
490
+ });
491
+ function x(r, e, t) {
492
+ return Ze(r, e, ie(t)), r;
493
+ }
494
+ function Pe(r, e = "") {
495
+ const t = /* @__PURE__ */ new Set(), s = (i, l = "") => i ? t.has(i) ? [] : (t.add(i), Object.keys(i).map((n) => (R(i[n]) || S(i[n])) && Object.keys(i[n]).length && !K.isValidElement(i[n]) ? s(i[n], `${l + n}.`) : l + n).flat()) : [];
496
+ return s(r, e);
497
+ }
498
+ function Xe(r) {
499
+ var e;
500
+ return ((e = r == null ? void 0 : r.constructor) == null ? void 0 : e.name) === "SyntheticEvent" || (r == null ? void 0 : r.nativeEvent) instanceof Event;
501
+ }
502
+ async function We(r, e, t, s) {
503
+ const i = [...t || []];
504
+ let l = 0;
505
+ return new Promise(async (n) => {
506
+ const o = [], a = async (c) => {
507
+ const h = () => l < i.length - 1 ? (l++, a(i[l])) : n({ error: null, warning: o });
508
+ if (!c)
509
+ return h();
510
+ const d = { ...c };
511
+ !d.type && !d.validator && (d.type = "string"), new Gt({ [r]: [d] }, {
512
+ ignoreEmptyString: !0,
513
+ validateMessages: s
514
+ }).validate({ [r]: e }, (m) => {
515
+ if (m)
516
+ if (c.validateLevel === "warning")
517
+ o.push(m[r].message);
518
+ else
519
+ return n({
520
+ error: m,
521
+ warning: o
522
+ });
523
+ return h();
524
+ });
525
+ };
526
+ a(i[l]);
527
+ });
528
+ }
529
+ function ge(r, e) {
530
+ const t = Ge({}, r, void 0, Object);
531
+ return e.some((s) => ze(t, s));
532
+ }
533
+ const Ce = "_input";
534
+ class Jt {
535
+ constructor() {
536
+ // 表示的 Form 的提交状态而非单个字段的提交状态。
537
+ // 只有在触发表单 reset(原生 reset,而非当前的 resetFields) 时,才会回到 init 状态(目前没有支持 form.reset,所以没有这块逻辑)
538
+ u(this, "submitStatus", D.init);
539
+ u(this, "registerFields", []);
540
+ // 所有 form item value 的变动,都会通知这里注册到的 watcher
541
+ u(this, "registerWatchers", []);
542
+ // 所有 form item 内部 errors, validating, touched 状态的变化,都会通知这里注册到的 watcher
543
+ // TODO: 合并 registerWatchers
544
+ u(this, "registerStateWatchers", []);
545
+ // 所有 form 整体 的变动,都会通知这里注册到的 watcher
546
+ u(this, "registerFormWatchers", []);
547
+ // 和formControl 的 touched属性不一样。 只要被改过的字段,这里就会存储。并且不会跟随formControl被卸载而清除。
548
+ // reset 的时候清除
549
+ u(this, "touchedFields", {});
550
+ u(this, "store", {});
551
+ u(this, "initialValues", {});
552
+ u(this, "callbacks", {});
553
+ // 告知 form 状态改变,进行状态收集
554
+ u(this, "innerCollectFormState", () => {
555
+ this.notifyStateWatchers();
556
+ });
557
+ u(this, "innerSetCallbacks", (e) => {
558
+ this.callbacks = e;
559
+ });
560
+ u(this, "registerFormWatcher", (e) => (this.registerFormWatchers.push(e), () => {
561
+ this.registerFormWatchers = this.registerFormWatchers.filter(
562
+ (t) => t !== e
563
+ );
564
+ }));
565
+ u(this, "registerStateWatcher", (e) => (this.registerStateWatchers.push(e), () => {
566
+ this.registerStateWatchers = this.registerStateWatchers.filter(
567
+ (t) => t !== e
568
+ );
569
+ }));
570
+ u(this, "registerWatcher", (e) => (this.registerWatchers.push(e), () => {
571
+ this.registerWatchers = this.registerWatchers.filter((t) => t !== e);
572
+ }));
573
+ // 收集所有control字段,并在组件卸载时移除
574
+ u(this, "registerField", (e) => (this.registerFields.push(e), this.notifyWatchers(), () => {
575
+ this.registerFields = this.registerFields.filter((t) => t !== e), this.notifyWatchers();
576
+ }));
577
+ // hasField为true时,只返回传入field属性的control实例
578
+ // isFormList 目前只在校验时需要包含
579
+ // TODO formlist 实现缺陷,待优化
580
+ u(this, "getRegisteredFields", (e, t) => e ? this.registerFields.filter(
581
+ (s) => {
582
+ var i;
583
+ return s.hasFieldProps() && ((t == null ? void 0 : t.containFormList) || !((i = s.props) != null && i.isFormList));
584
+ }
585
+ ) : this.registerFields);
586
+ // 获取props.field === field 的control组件。
587
+ u(this, "getRegisteredField", (e) => this.registerFields.filter((t) => t.props.field === e)[0]);
588
+ // 通知所有的FormItem进行更新。
589
+ // setFieldValue: 外部调用setFieldsValue (setFieldValue等)方法触发更新
590
+ // innerSetValue: 控件例如Input,通过onChange事件触发的更新
591
+ // reset:重置
592
+ u(this, "notify", (e, t) => {
593
+ (e === "setFieldValue" || e === "innerSetValue" && !t.ignore) && this._pushTouchField(
594
+ t.changeValues ? Pe(t.changeValues) : this._getIterativelyKeysByField(t.field)
595
+ ), this.registerFields.forEach((s) => {
596
+ var i;
597
+ (i = s == null ? void 0 : s.onStoreChange) == null || i.call(s, e, {
598
+ ...t,
599
+ current: this.store
600
+ });
601
+ });
602
+ });
603
+ u(this, "innerSetInitialValues", (e) => {
604
+ e && (this.initialValues = Oe(this.initialValues, ie(e)), Object.keys(e).forEach((t) => {
605
+ x(this.store, t, e[t]);
606
+ }));
607
+ });
608
+ u(this, "innerSetInitialValue", (e, t) => {
609
+ e && (this.initialValues[e] = t, this._inTouchFields(e) || x(this.store, e, M(this.initialValues, e)));
610
+ });
611
+ /**
612
+ *
613
+ * 内部使用,更新value,会同时触发onChange 和 onValuesChange
614
+ * @options.isFormList 强制更新field对应的组件包括其子组件,form
615
+ */
616
+ u(this, "innerSetFieldValue", (e, t, s) => {
617
+ if (!e) return;
618
+ const i = this.getFields();
619
+ x(this.store, e, t), this.triggerValuesChange({
620
+ [e]: t
621
+ }), this.triggerTouchChange({ [e]: t }), this.notify("innerSetValue", {
622
+ prev: i,
623
+ field: e,
624
+ ...s,
625
+ changeValues: { [e]: t }
626
+ });
627
+ });
628
+ // 内部使用
629
+ u(this, "innerGetStore", () => this.store);
630
+ // 目前返回提交状态,后续统一维护 errors,warnings 后,这里可进行拓展
631
+ u(this, "innerGetStoreStatus", () => ({
632
+ submitStatus: this.submitStatus
633
+ }));
634
+ // 内部使用,返回原始对象,注入到组件的 value 都从这里获取值,cloneDeep 后的值每次引用地址是不同的
635
+ u(this, "innerGetFieldValue", (e) => M(this.store, e));
636
+ // 获取所有被操作过的字段
637
+ u(this, "getTouchedFields", () => this.getRegisteredFields(!0).filter((e) => e.isTouched()).map((e) => e.props.field));
638
+ // 外部调用设置表单字段值
639
+ u(this, "setFieldValue", (e, t) => {
640
+ e && this.setFields({
641
+ [e]: { value: t }
642
+ });
643
+ });
644
+ // 外部调用,设置多个表单控件的值
645
+ u(this, "setFieldsValue", (e) => {
646
+ if (R(e)) {
647
+ const t = Object.keys(e), s = {};
648
+ t.forEach((i) => {
649
+ s[i] = {
650
+ value: e[i]
651
+ };
652
+ }), this.setFields(s);
653
+ }
654
+ });
655
+ // 外部调用,设置多个表单控件的值,以及 error,touch 信息。
656
+ u(this, "setFields", (e) => {
657
+ const t = Object.keys(e), s = {};
658
+ t.forEach((i) => {
659
+ const l = e[i], n = this.getFields();
660
+ if (l) {
661
+ const o = {};
662
+ "error" in l && (o.errors = l.error), "warning" in l && (o.warnings = l.warning), "touched" in l && (o.touched = l.touched), "value" in l && (x(this.store, i, l.value), s[i] = l.value), this.notify("setFieldValue", {
663
+ data: o,
664
+ prev: n,
665
+ field: i,
666
+ changeValues: { [i]: l.value }
667
+ });
668
+ }
669
+ }), this.triggerValuesChange(s);
670
+ });
671
+ u(this, "getFieldValue", (e) => ie(M(this.store, e)));
672
+ // 获取单个字段的错误信息。
673
+ u(this, "getFieldError", (e) => {
674
+ const t = this.getRegisteredField(e);
675
+ return t ? t.getErrors() : null;
676
+ });
677
+ // 获取传入字段/全部的错误信息
678
+ u(this, "getFieldsError", (e) => {
679
+ const t = {};
680
+ return S(e) ? e.map((s) => {
681
+ const i = this.getFieldError(s);
682
+ i && (t[s] = i);
683
+ }) : this.getRegisteredFields(!0, { containFormList: !0 }).forEach(
684
+ (s) => {
685
+ s.getErrors() && (t[s.props.field] = s.getErrors());
686
+ }
687
+ ), t;
688
+ });
689
+ u(this, "getFields", () => ie(this.store));
690
+ u(this, "getFieldsValue", (e) => {
691
+ const t = {};
692
+ return S(e) ? (e.forEach((s) => {
693
+ x(t, s, this.getFieldValue(s));
694
+ }), t) : (this.getRegisteredFields(!0).forEach(({ props: { field: s } }) => {
695
+ const i = M(this.store, s);
696
+ x(t, s, i);
697
+ }), t);
698
+ });
699
+ u(this, "getInitialValues", () => this.initialValues);
700
+ u(this, "setInitialValues", (e) => {
701
+ this.innerSetInitialValues(e), this.setFieldsValue(e);
702
+ });
703
+ u(this, "setInitialValue", (e, t) => {
704
+ this.innerSetInitialValue(e, t), this.setFieldValue(e, t);
705
+ });
706
+ u(this, "resetFields", (e) => {
707
+ const t = this.getFields(), s = Ne(e) && !S(e) ? [e] : e;
708
+ let i = {};
709
+ if (s && S(s))
710
+ s.forEach((n) => {
711
+ x(
712
+ this.store,
713
+ n,
714
+ this.initialValues[n]
715
+ ), i[n] = M(this.store, n);
716
+ }), this.triggerValuesChange(i), this.notify("reset", { prev: t, field: s }), this._popTouchField(s);
717
+ else {
718
+ const n = {};
719
+ i = this.getFields(), Object.keys(this.initialValues).forEach((o) => {
720
+ x(n, o, this.initialValues[o]);
721
+ }), this.store = n, this.getRegisteredFields(!0).forEach((o) => {
722
+ const a = o.props.field;
723
+ x(i, a, M(this.store, a));
724
+ }), this.triggerValuesChange(i), this._popTouchField(), this.notify("reset", {
725
+ prev: t,
726
+ field: Object.keys(i)
727
+ });
728
+ }
729
+ const { onReset: l } = this.callbacks;
730
+ l == null || l(i);
731
+ });
732
+ u(this, "validate", Bt(
733
+ (e, t, s) => {
734
+ const i = this.getRegisteredFields(!0, {
735
+ containFormList: !0
736
+ }), l = S(e) && e.length ? i.filter(
737
+ (h) => e.indexOf(h.props.field) > -1
738
+ ) : i, n = R(e) ? e : R(t) ? t : {}, o = _(e) ? e : _(t) ? t : s || (() => {
739
+ }), a = l.map(
740
+ (h) => n != null && n.validateOnly ? h.validateFieldOnly() : h.validateField()
741
+ ), c = (h) => {
742
+ if (!(n != null && n.validateOnly)) {
743
+ const { onValidateFail: d } = this.callbacks;
744
+ d == null || d(h);
745
+ }
746
+ };
747
+ Promise.all(a).then((h) => {
748
+ let d = {};
749
+ const g = {};
750
+ h.map((v) => {
751
+ var F;
752
+ v.error && (d = { ...d, ...v.error });
753
+ const f = this.getRegisteredField(v.field);
754
+ (F = f == null ? void 0 : f.props) != null && F.isFormList || x(g, v.field, v.value);
755
+ });
756
+ let m;
757
+ return Object.keys(d).length ? (c == null || c(d), m = o == null ? void 0 : o(d, ie(g))) : m = o == null ? void 0 : o(null, ie(g)), m;
758
+ });
759
+ }
760
+ ));
761
+ u(this, "toggleSubmitStatus", (e) => {
762
+ this.submitStatus = e, this.innerCollectFormState(), this.notifyFormWatcher();
763
+ });
764
+ u(this, "submit", () => (this.toggleSubmitStatus(D.submitting), this.validate((e, t) => {
765
+ let s;
766
+ const { onSubmit: i, onSubmitFailed: l } = this.callbacks;
767
+ !e && i && (s = i(t)), e && l && (s = l(e)), s && s.then ? s.then((n) => (this.toggleSubmitStatus(D.success), n)).catch((n) => (this.toggleSubmitStatus(D.error), Promise.reject(n))) : this.toggleSubmitStatus(
768
+ e ? D.error : D.success
769
+ );
770
+ })));
771
+ u(this, "getFieldsState", (e) => {
772
+ const t = {}, s = (i) => {
773
+ if (!i)
774
+ return null;
775
+ const l = i.getErrors();
776
+ return {
777
+ errors: l ? [l] : [],
778
+ warnings: i.getWarnings(),
779
+ validateStatus: i.getValidateStatus(),
780
+ isSubmitting: this.submitStatus === D.submitting,
781
+ isTouched: i.isTouched(),
782
+ value: this.getFieldValue(i.props.field)
783
+ };
784
+ };
785
+ return S(e) ? (e.forEach((i) => {
786
+ t[i] = s(this.getRegisteredField(i));
787
+ }), t) : (this.getRegisteredFields(!0).forEach((i) => {
788
+ t[i.props.field] = s(i);
789
+ }), t);
790
+ });
791
+ u(this, "clearFields", (e) => {
792
+ const t = this.getFields(), s = Ne(e) && !S(e) ? [e] : e;
793
+ if (s && S(s)) {
794
+ const i = {};
795
+ s.forEach((l) => {
796
+ x(this.store, l, void 0), i[l] = M(this.store, l);
797
+ }), this.triggerValuesChange(i), this.notify("setFieldValue", {
798
+ prev: t,
799
+ field: s,
800
+ data: {
801
+ errors: null,
802
+ warnings: null
803
+ }
804
+ });
805
+ } else {
806
+ const i = {};
807
+ this.store = {}, this.getRegisteredFields(!0).forEach((l) => {
808
+ const n = l.props.field;
809
+ x(i, n, void 0);
810
+ }), this.triggerValuesChange(i), this.notify("setFieldValue", {
811
+ prev: t,
812
+ field: Object.keys(i),
813
+ data: {
814
+ errors: null,
815
+ warnings: null
816
+ }
817
+ });
818
+ }
819
+ });
820
+ }
821
+ notifyWatchers() {
822
+ this.registerWatchers.forEach((e) => {
823
+ e();
824
+ });
825
+ }
826
+ // 注册监听全局状态的 watcher
827
+ notifyFormWatcher() {
828
+ this.registerFormWatchers.forEach((e) => {
829
+ e();
830
+ });
831
+ }
832
+ notifyStateWatchers() {
833
+ this.registerStateWatchers.forEach((e) => {
834
+ e();
835
+ });
836
+ }
837
+ triggerValuesChange(e) {
838
+ if (e && Object.keys(e).length) {
839
+ const { onValuesChange: t } = this.callbacks;
840
+ t == null || t(e, this.getFields());
841
+ }
842
+ this.notifyWatchers();
843
+ }
844
+ triggerTouchChange(e) {
845
+ if (e && Object.keys(e).length) {
846
+ const { onChange: t } = this.callbacks;
847
+ t == null || t(e, this.getFields());
848
+ }
849
+ }
850
+ _getIterativelyKeysByField(e) {
851
+ if (!e)
852
+ return [];
853
+ const s = [].concat(e).map((i) => Pe(x({}, i, void 0))).reduce((i, l) => i.concat(l), []);
854
+ return [e, ...s];
855
+ }
856
+ _inTouchFields(e) {
857
+ return this._getIterativelyKeysByField(e).some((s) => ze(this.touchedFields, s));
858
+ }
859
+ _popTouchField(e) {
860
+ e === void 0 && (this.touchedFields = {});
861
+ const t = this._getIterativelyKeysByField(e);
862
+ this.touchedFields = mt(this.touchedFields, t);
863
+ }
864
+ _pushTouchField(e) {
865
+ [].concat(e).forEach((t) => {
866
+ Ge(this.touchedFields, t, void 0, Object);
867
+ });
868
+ }
869
+ }
870
+ function Zt() {
871
+ const r = new Jt();
872
+ return {
873
+ getFieldsValue: r.getFieldsValue,
874
+ getFieldValue: r.getFieldValue,
875
+ getFieldError: r.getFieldError,
876
+ getFieldsError: r.getFieldsError,
877
+ getTouchedFields: r.getTouchedFields,
878
+ getFields: r.getFields,
879
+ getInitialValues: r.getInitialValues,
880
+ setInitialValues: r.setInitialValues,
881
+ setInitialValue: r.setInitialValue,
882
+ setFieldValue: r.setFieldValue,
883
+ setFieldsValue: r.setFieldsValue,
884
+ setFields: r.setFields,
885
+ resetFields: r.resetFields,
886
+ clearFields: r.clearFields,
887
+ submit: r.submit,
888
+ validate: r.validate,
889
+ scrollToField: () => {
890
+ },
891
+ getFieldsState: r.getFieldsState,
892
+ getInnerMethods: (e) => {
893
+ const t = {};
894
+ return e && [
895
+ "registerField",
896
+ "registerWatcher",
897
+ "registerStateWatcher",
898
+ "registerFormWatcher",
899
+ "innerSetInitialValues",
900
+ "innerSetInitialValue",
901
+ "innerSetCallbacks",
902
+ "innerSetFieldValue",
903
+ "innerGetStore",
904
+ "innerGetStoreStatus",
905
+ "innerGetFieldValue",
906
+ "innerCollectFormState"
907
+ ].map((s) => {
908
+ t[s] = r[s];
909
+ }), t;
910
+ }
911
+ };
912
+ }
913
+ function et(r) {
914
+ const e = L(r);
915
+ return e.current || (r ? e.current = r : e.current = Zt()), [e.current];
916
+ }
917
+ function Ve(r, e) {
918
+ const t = e.replace(/[[.]/g, "_").replace(/\]/g, "");
919
+ return r ? `${r}-${t}` : `${t}`;
920
+ }
921
+ const Yt = {
922
+ layout: "horizontal",
923
+ labelCol: { span: 5, offset: 0 },
924
+ labelAlign: "right",
925
+ wrapperCol: { span: 19, offset: 0 },
926
+ requiredSymbol: !0,
927
+ wrapper: "form",
928
+ validateTrigger: "onChange"
929
+ }, Kt = (r, e) => {
930
+ var te, Z;
931
+ const t = U(De), s = U(Ke), i = L(null), [l] = et(
932
+ r.form
933
+ ), n = gt(
934
+ r,
935
+ Yt,
936
+ (te = t.componentConfig) == null ? void 0 : te.Form
937
+ ), {
938
+ layout: o,
939
+ labelCol: a,
940
+ wrapperCol: c,
941
+ wrapper: h,
942
+ id: d,
943
+ requiredSymbol: g,
944
+ labelAlign: m,
945
+ disabled: v,
946
+ colon: f,
947
+ className: F,
948
+ validateTrigger: V,
949
+ prefixCls: j,
950
+ validateMessages: w,
951
+ ...$
952
+ } = n, T = j || t.getPrefixCls("form"), ee = t.rtl, ue = "size" in n ? n.size : t.size, ce = l.getInnerMethods(!0);
953
+ dt(() => {
954
+ ce.innerSetInitialValues(n.initialValues);
955
+ }), he(() => {
956
+ let b;
957
+ return s.register && (b = s.register(n.id, l)), b;
958
+ }, [n.id, l]), l.scrollToField = (b, W) => {
959
+ const I = i.current, k = n.id;
960
+ if (!I)
961
+ return;
962
+ let z = I.querySelector(
963
+ `#${Ve(k, b)}`
964
+ );
965
+ z || (z = I.querySelector(
966
+ `#${Ve(k, b)}${Ce}`
967
+ )), z && at(z, {
968
+ behavior: "smooth",
969
+ block: "nearest",
970
+ scrollMode: "if-needed",
971
+ ...W
972
+ });
973
+ }, ce.innerSetCallbacks({
974
+ onValuesChange: (b, W) => {
975
+ var I, k;
976
+ (I = n.onValuesChange) == null || I.call(n, b, W), (k = s.onFormValuesChange) == null || k.call(s, n.id, b);
977
+ },
978
+ onChange: n.onChange,
979
+ onValidateFail: (b) => {
980
+ if (n.scrollToFirstError) {
981
+ const W = R(n.scrollToFirstError) ? n.scrollToFirstError : {};
982
+ l.scrollToField(
983
+ Object.keys(b)[0],
984
+ W
985
+ );
986
+ }
987
+ },
988
+ onSubmitFailed: n.onSubmitFailed,
989
+ onSubmit: (b) => {
990
+ var I, k;
991
+ const W = (I = n.onSubmit) == null ? void 0 : I.call(n, b);
992
+ return (k = s.onFormSubmit) == null || k.call(s, n.id, b), W;
993
+ },
994
+ onReset: (b) => {
995
+ var I, k;
996
+ const W = (I = n.onReset) == null ? void 0 : I.call(n, b);
997
+ return (k = s == null ? void 0 : s.onFormReset) == null || k.call(s, n.id, b), W;
998
+ }
999
+ });
1000
+ const be = {
1001
+ requiredSymbol: g,
1002
+ labelAlign: m,
1003
+ disabled: v,
1004
+ colon: f,
1005
+ labelCol: a,
1006
+ wrapperCol: c,
1007
+ layout: o,
1008
+ store: l,
1009
+ prefixCls: T,
1010
+ validateTrigger: V,
1011
+ validateMessages: Oe(
1012
+ {},
1013
+ (Z = t.locale.Form) == null ? void 0 : Z.validateMessages,
1014
+ w
1015
+ ),
1016
+ getFormElementId: (b) => Ve(d, b)
1017
+ }, de = ae;
1018
+ return ht(e, () => ({
1019
+ ...l,
1020
+ getRootDOMNode() {
1021
+ return i.current;
1022
+ }
1023
+ })), /* @__PURE__ */ p(ct, { ...t, size: ue, children: /* @__PURE__ */ p(de.Provider, { value: be, children: /* @__PURE__ */ p(
1024
+ h,
1025
+ {
1026
+ ref: i,
1027
+ ...Ue($, [
1028
+ "form",
1029
+ "size",
1030
+ "initialValues",
1031
+ "onValuesChange",
1032
+ "onChange",
1033
+ "wrapperProps",
1034
+ "scrollToFirstError",
1035
+ "onSubmit",
1036
+ "onSubmitFailed",
1037
+ "onReset"
1038
+ ]),
1039
+ ...n.wrapperProps,
1040
+ className: B(
1041
+ T,
1042
+ `${T}-${o}`,
1043
+ `${T}-size-${ue}`,
1044
+ { [`${T}-rtl`]: ee },
1045
+ F
1046
+ ),
1047
+ style: n.style,
1048
+ onSubmit: (b) => {
1049
+ b.preventDefault(), b.stopPropagation(), l.submit();
1050
+ },
1051
+ onReset: (b) => {
1052
+ b.preventDefault(), b.stopPropagation(), l.resetFields();
1053
+ },
1054
+ id: d,
1055
+ children: n.children
1056
+ }
1057
+ ) }) });
1058
+ }, tt = we(Kt);
1059
+ tt.displayName = "Form";
1060
+ class H extends ut {
1061
+ constructor(t, s) {
1062
+ var i, l;
1063
+ super(t);
1064
+ u(this, "context");
1065
+ // 校验信息
1066
+ u(this, "errors", null);
1067
+ // 校验 warning 信息
1068
+ u(this, "warnings", null);
1069
+ // undefined => validating => success / error => (validating or undefined)
1070
+ u(this, "validateStatus");
1071
+ // 是否被用户操作过
1072
+ u(this, "touched");
1073
+ u(this, "isDestroyed", !1);
1074
+ // 保存 props.children 或函数类型 props.children() 的返回值
1075
+ u(this, "childrenElement", null);
1076
+ u(this, "removeRegisterField");
1077
+ // 触发 store 进行状态收集
1078
+ // TODO: error, validateStatus ,touched 状态和 UI 组件解耦,统一维护在 store 内部
1079
+ u(this, "triggerStateCollect", () => {
1080
+ const { innerCollectFormState: t } = this.context.store.getInnerMethods(!0);
1081
+ t();
1082
+ });
1083
+ // 切换校验状态
1084
+ u(this, "toggleValidateStatus", (t) => {
1085
+ this.validateStatus = t, this.triggerStateCollect();
1086
+ });
1087
+ // 切换 touch 状态
1088
+ u(this, "toggleTouched", (t) => {
1089
+ this.touched = He(t) ? t : !this.touched, this.triggerStateCollect();
1090
+ });
1091
+ u(this, "setWarnings", (t) => {
1092
+ this.warnings = t, this.triggerStateCollect();
1093
+ });
1094
+ u(this, "setErrors", (t) => {
1095
+ this.errors = t, this.triggerStateCollect();
1096
+ });
1097
+ u(this, "getErrors", () => this.errors);
1098
+ u(this, "getWarnings", () => this.warnings || []);
1099
+ u(this, "isTouched", () => this.touched);
1100
+ u(this, "getValidateStatus", () => this.props.validateStatus ? this.props.validateStatus : this.validateStatus);
1101
+ u(this, "hasFieldProps", () => !!this.props.field);
1102
+ u(this, "clearFormItemError", (t = this.props.field) => {
1103
+ const { updateFormItem: s } = this.context;
1104
+ s == null || s(t, { errors: null, warnings: null });
1105
+ });
1106
+ u(this, "updateFormItem", () => {
1107
+ if (this.isDestroyed) return;
1108
+ this.forceUpdate();
1109
+ const { updateFormItem: t } = this.context;
1110
+ t == null || t(this.props.field, {
1111
+ errors: this.errors,
1112
+ warnings: this.warnings
1113
+ });
1114
+ });
1115
+ u(this, "getFieldValue", () => {
1116
+ const t = this.props.field, s = this.context.store;
1117
+ return t ? s.getInnerMethods(!0).innerGetFieldValue(t) : void 0;
1118
+ });
1119
+ u(this, "onStoreChange", (t, s) => {
1120
+ const i = S(s.field) ? s.field : [s.field], { field: l, shouldUpdate: n, dependencies: o } = this.props, a = (c) => {
1121
+ if (o && n && oe(!0, "`shouldUpdate` of the `Form.Item` will be ignored."), o)
1122
+ (S(o) || o.some(
1123
+ (h) => ge(h, i)
1124
+ )) && this.isTouched() && this.validateField();
1125
+ else if (n) {
1126
+ let h = !1;
1127
+ _(n) ? h = n(s.prev, s.current, {
1128
+ field: s.field,
1129
+ ...c
1130
+ }) : h = !je(s.prev, s.current), h && this.updateFormItem();
1131
+ }
1132
+ };
1133
+ switch (t) {
1134
+ case "reset":
1135
+ this.toggleTouched(!1), this.toggleValidateStatus(void 0), this.setErrors(null), this.setWarnings(null), o || n ? a() : this.updateFormItem();
1136
+ break;
1137
+ case "innerSetValue":
1138
+ if (ge(l, i)) {
1139
+ this.toggleTouched(!0), this.updateFormItem();
1140
+ return;
1141
+ }
1142
+ a({
1143
+ isInner: !0,
1144
+ isFormList: s.isFormList
1145
+ });
1146
+ break;
1147
+ case "setFieldValue":
1148
+ if (ge(l, i)) {
1149
+ this.toggleTouched(!0), s.data && "touched" in s.data && this.toggleTouched(s.data.touched), s.data && "warnings" in s.data && this.setWarnings(
1150
+ St(s.data.warnings) ? [] : [].concat(s.data.warnings)
1151
+ ), s.data && "errors" in s.data ? this.setErrors(s.data.errors) : je(M(s.prev, l), M(s.current, l)) || this.setErrors(null), this.updateFormItem();
1152
+ return;
1153
+ }
1154
+ a();
1155
+ break;
1156
+ }
1157
+ });
1158
+ u(this, "innerSetFieldValue", (t, s) => {
1159
+ var o, a;
1160
+ if (!t) return;
1161
+ const { store: i } = this.context;
1162
+ i.getInnerMethods(!0).innerSetFieldValue(t, s);
1163
+ const n = {};
1164
+ Ze(n, t, s), (a = (o = this.props) == null ? void 0 : o.onValuesChange) == null || a.call(o, n, {
1165
+ ...i.getFieldsValue()
1166
+ });
1167
+ });
1168
+ // 仅仅校验下值,不做任何状态变更
1169
+ u(this, "validateFieldOnly", () => {
1170
+ const { validateMessages: t } = this.context, { field: s, rules: i } = this.props, l = this.getFieldValue();
1171
+ return We(s, l, i, t).then(
1172
+ ({ error: n, warning: o }) => Promise.resolve({ error: n, value: l, warning: o, field: s })
1173
+ );
1174
+ });
1175
+ /**
1176
+ *
1177
+ * @param triggerType the value of validateTrigger.
1178
+ * @returns
1179
+ */
1180
+ u(this, "validateField", (t) => {
1181
+ const { validateTrigger: s, validateMessages: i } = this.context, { field: l, rules: n, validateTrigger: o } = this.props, a = this.getFieldValue(), c = () => {
1182
+ var g;
1183
+ const d = this.errors || ((g = this.warnings) == null ? void 0 : g.length);
1184
+ this.toggleValidateStatus("validating"), this.setErrors(null), this.setWarnings(null), d && this.updateFormItem();
1185
+ }, h = t ? (n || []).filter((d) => [].concat(
1186
+ d.validateTrigger || o || s
1187
+ ).indexOf(t) > -1) : n;
1188
+ return h && h.length && l ? (c(), We(l, a, h, i).then(
1189
+ ({ error: d, warning: g }) => {
1190
+ var m;
1191
+ return this.setErrors(d ? d[l] : null), this.setWarnings(g || null), this.toggleValidateStatus(
1192
+ this.errors ? "error" : (m = this.warnings) != null && m.length ? "warning" : "success"
1193
+ ), this.updateFormItem(), Promise.resolve({ error: d, value: a, field: l });
1194
+ }
1195
+ )) : Promise.resolve({ error: null, value: a, field: l });
1196
+ });
1197
+ // 每次 render 都会作为 onChange 传递给 children,需要保证引用地址不变
1198
+ // 所以 handleTrigger 需要声明在类上,并且直接作为 children.props.onChange
1199
+ u(this, "handleTrigger", (t, ...s) => {
1200
+ const i = this.childrenElement || this.props.children, { store: l } = this.context, { field: n, trigger: o, normalize: a, getValueFromEvent: c } = this.props, h = _(c) ? c(t, ...s) : t;
1201
+ let d = h;
1202
+ if (Xe(h)) {
1203
+ oe(
1204
+ !0,
1205
+ "changed value missed, please check whether extra elements is outta input/select controled by Form.Item"
1206
+ ), h.stopPropagation();
1207
+ return;
1208
+ }
1209
+ typeof a == "function" && (d = a(h, l.getFieldValue(n), {
1210
+ ...l.getFieldsValue()
1211
+ })), this.toggleTouched(!0), this.innerSetFieldValue(n, d), this.validateField(o), Se(i) && i.props && i.props[o] && (this.props.isFormList || i.props[o](d, ...s));
1212
+ });
1213
+ u(this, "getChild", () => {
1214
+ const { children: t } = this.props, { store: s } = this.context;
1215
+ let i = t;
1216
+ return _(t) && (i = t(
1217
+ s.getFields(),
1218
+ {
1219
+ ...s
1220
+ },
1221
+ this.props.isFormList && {
1222
+ value: this.getFieldValue(),
1223
+ onChange: this.handleTrigger
1224
+ }
1225
+ )), this.childrenElement = i, i;
1226
+ });
1227
+ "initialValue" in t && this.hasFieldProps() && ((l = (i = s == null ? void 0 : s.store) == null ? void 0 : i.setInitialValue) == null || l.call(i, t.field, t.initialValue));
1228
+ }
1229
+ componentDidMount() {
1230
+ const { store: t } = this.context ?? {};
1231
+ if (t) {
1232
+ const s = t.getInnerMethods(!0);
1233
+ this.removeRegisterField = s.registerField(this);
1234
+ }
1235
+ this.isDestroyed = !1;
1236
+ }
1237
+ componentDidUpdate(t) {
1238
+ (t.field !== this.props.field && this.props._key && t._key === this.props._key || /* 以下条件判断潘启宝添加于 2023年10月23日 星期一 13时10分43秒 CST */
1239
+ this.props.disabled !== t.disabled && this.props.disabled || this.props.rules !== t.rules && !this.props.rules) && (this.updateFormItem(), this.clearFormItemError(t.field));
1240
+ }
1241
+ componentWillUnmount() {
1242
+ var t;
1243
+ (t = this.removeRegisterField) == null || t.call(this), this.removeRegisterField = null, this.clearFormItemError(), this.isDestroyed = !0;
1244
+ }
1245
+ /**
1246
+ * 收集rules里的validateTrigger字段
1247
+ */
1248
+ getValidateTrigger() {
1249
+ const t = this.props.validateTrigger || this.context.validateTrigger || "onChange", s = this.props.rules || [];
1250
+ let i = [];
1251
+ return s.map((l) => {
1252
+ i = i.concat(l.validateTrigger || t);
1253
+ }), Array.from(new Set(i));
1254
+ }
1255
+ renderControl(t, s) {
1256
+ var f;
1257
+ const {
1258
+ field: i,
1259
+ trigger: l = "onChange",
1260
+ triggerPropName: n = "value",
1261
+ validateStatus: o,
1262
+ formatter: a
1263
+ } = this.props, { store: c, disabled: h } = this.context, d = "disabled" in this.props ? this.props.disabled : h, g = K.Children.only(t), m = {
1264
+ // used by label
1265
+ id: B(((f = g.props) == null ? void 0 : f.id) || { [`${s}${Ce}`]: s })
1266
+ };
1267
+ this.getValidateTrigger().forEach((F) => {
1268
+ m[F] = (V) => {
1269
+ var j, w;
1270
+ this.validateField(F), (w = (j = g.props) == null ? void 0 : j[F]) == null || w.call(j, V);
1271
+ };
1272
+ }), m[l] = this.handleTrigger, d !== void 0 && !("disabled" in g.props) && (m.disabled = d);
1273
+ let v = M(c.getInnerMethods(!0).innerGetStore(), i);
1274
+ return _(a) && (v = a(v)), m[n] = v, !o && this.errors && (m.error = !0), K.cloneElement(g, m);
1275
+ }
1276
+ render() {
1277
+ const { noStyle: t, field: s, isFormList: i, hasFeedback: l } = this.props, n = this.getValidateStatus(), { prefixCls: o, getFormElementId: a } = this.context;
1278
+ let c = this.getChild();
1279
+ const h = this.hasFieldProps() ? a == null ? void 0 : a(s) : void 0;
1280
+ return this.hasFieldProps() && !i && K.Children.count(c) === 1 && (c = this.renderControl(c, h)), t ? c : /* @__PURE__ */ p("div", { className: `${o}-item-control-wrapper`, children: /* @__PURE__ */ p("div", { className: `${o}-item-control`, id: h, children: /* @__PURE__ */ Q("div", { className: `${o}-item-control-children`, children: [
1281
+ c,
1282
+ n && l && /* @__PURE__ */ Q(
1283
+ "div",
1284
+ {
1285
+ className: `${o}-item-feedback ${o}-item-feedback-${n}`,
1286
+ children: [
1287
+ n === "warning" && /* @__PURE__ */ p(bt, {}),
1288
+ n === "success" && /* @__PURE__ */ p(vt, {}),
1289
+ n === "error" && /* @__PURE__ */ p(yt, {}),
1290
+ n === "validating" && /* @__PURE__ */ p(Vt, {})
1291
+ ]
1292
+ }
1293
+ )
1294
+ ] }) }) });
1295
+ }
1296
+ }
1297
+ u(H, "defaultProps", {
1298
+ trigger: "onChange",
1299
+ triggerPropName: "value"
1300
+ }), u(H, "isFormControl", !0), u(H, "contextType", Ee);
1301
+ function Qt(r) {
1302
+ return /* @__PURE__ */ p(
1303
+ "svg",
1304
+ {
1305
+ width: "1em",
1306
+ height: "1em",
1307
+ "aria-hidden": !0,
1308
+ focusable: !1,
1309
+ fill: "currentColor",
1310
+ stroke: "none",
1311
+ viewBox: "0 0 48 48",
1312
+ ...r,
1313
+ children: /* @__PURE__ */ p("path", { d: "M30.841,46.115l5.864,-2.824l-6.841,-14.205l15.371,3.508l1.449,-6.345l-15.372,-3.509l12.327,-9.83l-4.058,-5.088l-12.327,9.83l0,-15.767l-6.508,0l-0,15.767l-12.327,-9.83l-4.058,5.088l12.327,9.83l-15.372,3.509l1.449,6.345l15.371,-3.508l-6.841,14.205l5.864,2.824l6.841,-14.206l6.841,14.206Z" })
1314
+ }
1315
+ );
1316
+ }
1317
+ const Xt = ({
1318
+ htmlFor: r,
1319
+ showColon: e,
1320
+ label: t,
1321
+ requiredSymbol: s,
1322
+ required: i,
1323
+ rules: l,
1324
+ prefix: n,
1325
+ tooltip: o
1326
+ }) => {
1327
+ const a = S(l) && l.some((g) => g && g.required), c = R(s) ? s.position : "end", h = (i || a) && !!s && /* @__PURE__ */ p("strong", { className: `${n}-form-item-symbol`, children: /* @__PURE__ */ p(Qt, {}) }), d = () => {
1328
+ if (!o)
1329
+ return null;
1330
+ const g = `${n}-form-item-tooltip`;
1331
+ let m = {}, v = /* @__PURE__ */ p(Et, { className: g });
1332
+ if (!R(o) || Se(o))
1333
+ m = {
1334
+ content: o
1335
+ };
1336
+ else {
1337
+ const { icon: f, ...F } = o;
1338
+ m = F, f && (v = Se(f) ? K.cloneElement(f, {
1339
+ className: B(
1340
+ g,
1341
+ f.props.className
1342
+ )
1343
+ }) : f);
1344
+ }
1345
+ return /* @__PURE__ */ p(wt, { ...m, children: v });
1346
+ };
1347
+ return t ? /* @__PURE__ */ Q("label", { htmlFor: r && `${r}${Ce}`, children: [
1348
+ c !== "end" && h,
1349
+ " ",
1350
+ t,
1351
+ d(),
1352
+ c === "end" && /* @__PURE__ */ Q(qe, { children: [
1353
+ " ",
1354
+ h
1355
+ ] }),
1356
+ e ? e === !0 ? ":" : e : ""
1357
+ ] }) : null;
1358
+ }, es = Ye.Row, _e = Ye.Col, ts = ({
1359
+ prefixCls: r,
1360
+ help: e,
1361
+ errors: t,
1362
+ warnings: s
1363
+ }) => {
1364
+ const i = t.map((a, c) => {
1365
+ if (a)
1366
+ return /* @__PURE__ */ p("div", { role: "alert", children: a.message }, c);
1367
+ }), l = [];
1368
+ s.map((a, c) => {
1369
+ l.push(
1370
+ /* @__PURE__ */ p("div", { role: "alert", className: `${r}-message-help-warning`, children: a }, c)
1371
+ );
1372
+ });
1373
+ const n = !le(e) || !!l.length, o = n || !!i.length;
1374
+ return o && /* @__PURE__ */ p(
1375
+ jt,
1376
+ {
1377
+ in: o,
1378
+ appear: !0,
1379
+ classNames: "formblink",
1380
+ timeout: 300,
1381
+ unmountOnExit: !0,
1382
+ children: /* @__PURE__ */ p(
1383
+ "div",
1384
+ {
1385
+ className: B(`${r}-message`, {
1386
+ [`${r}-message-help`]: n
1387
+ }),
1388
+ children: le(e) ? /* @__PURE__ */ Q(qe, { children: [
1389
+ i.length > 0 && i,
1390
+ l.length > 0 && l
1391
+ ] }) : e
1392
+ }
1393
+ )
1394
+ }
1395
+ );
1396
+ }, ss = (r, e) => {
1397
+ var Ie, Me, $e;
1398
+ const { getPrefixCls: t, prefixCls: s } = U(De), i = U(Ee), l = U(Qe), [n, o] = me(null), [a, c] = me(null), h = U(ae), d = h.prefixCls || t("form"), g = r.layout || h.layout, m = r.labelAlign || h.labelAlign, v = L(!1), f = (N, E = {}) => {
1399
+ if (v.current)
1400
+ return;
1401
+ const { errors: q, warnings: se } = E || {};
1402
+ o((re) => {
1403
+ const C = { ...re || {} };
1404
+ return q ? C[N] = q : delete C[N], C;
1405
+ }), c((re) => {
1406
+ const C = { ...re || {} };
1407
+ return se && se.length ? C[N] = se : delete C[N], C;
1408
+ });
1409
+ }, F = R(r.noStyle) && r.noStyle.showErrorTip && i.updateFormItem ? i.updateFormItem : f;
1410
+ he(() => (v.current = !1, () => {
1411
+ v.current = !0, o(null), c(null);
1412
+ }), []);
1413
+ const V = {
1414
+ ...h,
1415
+ validateMessages: h.validateMessages && Ht(h.validateMessages, {
1416
+ label: r.label
1417
+ }),
1418
+ prefixCls: d,
1419
+ updateFormItem: F,
1420
+ disabled: "disabled" in r ? r.disabled : h.disabled
1421
+ }, { label: j, extra: w, className: $, style: T, validateStatus: ee, hidden: ue, ...ce } = r, be = B(`${d}-label-item`, {
1422
+ [`${d}-label-item-left`]: m === "left"
1423
+ }), de = n ? Object.values(n) : [], te = a ? Object.values(a).reduce((N, E) => N.concat(E), []) : [], Z = ke(() => {
1424
+ if (ee)
1425
+ return ee;
1426
+ if (de.length)
1427
+ return ye.error;
1428
+ if (te.length)
1429
+ return ye.warning;
1430
+ }, [n, a, ee]), b = ke(() => !le(r.help) || te.length > 0, [r.help, a]), W = B(
1431
+ `${d}-item`,
1432
+ {
1433
+ [`${d}-item-error`]: b || !ee && Z === ye.error,
1434
+ [`${d}-item-status-${Z}`]: Z,
1435
+ [`${d}-item-has-help`]: b,
1436
+ [`${d}-item-hidden`]: ue,
1437
+ [`${d}-item-has-feedback`]: Z && r.hasFeedback
1438
+ },
1439
+ `${d}-layout-${g}`,
1440
+ $
1441
+ ), I = () => {
1442
+ var se, re;
1443
+ const { field: N, children: E } = r, q = "disabled" in r ? r.disabled : h.disabled;
1444
+ if (_(E)) {
1445
+ let { key: C, ...P } = r ?? {};
1446
+ return /* @__PURE__ */ xe(
1447
+ H,
1448
+ {
1449
+ disabled: q,
1450
+ ...P,
1451
+ key: N || C,
1452
+ _key: N || C
1453
+ },
1454
+ (...ve) => E(
1455
+ ...ve
1456
+ )
1457
+ );
1458
+ }
1459
+ if (S(E)) {
1460
+ const C = K.Children.map(E, (P, ve) => {
1461
+ const Te = R(P) && P.key || ve, it = R(P) && "disabled" in P.props, nt = !le(q) && !it ? { key: Te, disabled: q } : { key: Te };
1462
+ return R(P) ? Re(P, nt) : P;
1463
+ });
1464
+ return /* @__PURE__ */ p(H, { ...r, field: void 0, children: C });
1465
+ }
1466
+ if (K.Children.count(E) == 1) {
1467
+ if (N) {
1468
+ const C = ((se = l == null ? void 0 : l.getItemKey) == null ? void 0 : se.call(l, N)) || N;
1469
+ return /* @__PURE__ */ xe(H, { disabled: q, ...r, key: C, _key: C }, E);
1470
+ }
1471
+ if (R(E)) {
1472
+ if ((re = E.type) != null && re.isFormControl)
1473
+ return E;
1474
+ const P = !("disabled" in E.props) && !le(q) ? { disabled: q } : null;
1475
+ return /* @__PURE__ */ p(H, { ...r, field: void 0, children: P ? Re(E, P) : E });
1476
+ }
1477
+ }
1478
+ return E;
1479
+ }, k = Ee, z = {
1480
+ ...h
1481
+ };
1482
+ return r.noStyle || (z.wrapperCol = void 0, z.labelCol = void 0), /* @__PURE__ */ p(ae.Provider, { value: z, children: /* @__PURE__ */ p(k.Provider, { value: V, children: r.noStyle ? I() : /* @__PURE__ */ Q(
1483
+ es,
1484
+ {
1485
+ ref: e,
1486
+ ...Ue(ce, [
1487
+ "tooltip",
1488
+ "children",
1489
+ "prefixCls",
1490
+ "store",
1491
+ "initialValue",
1492
+ "field",
1493
+ "labelCol",
1494
+ "wrapperCol",
1495
+ "colon",
1496
+ "disabled",
1497
+ "rules",
1498
+ "trigger",
1499
+ "triggerPropName",
1500
+ "validateTrigger",
1501
+ "noStyle",
1502
+ "required",
1503
+ "hasFeedback",
1504
+ "help",
1505
+ "normalize",
1506
+ "formatter",
1507
+ "getValueFromEvent",
1508
+ "shouldUpdate",
1509
+ "field",
1510
+ "isInner",
1511
+ "labelAlign",
1512
+ "layout",
1513
+ "requiredSymbol",
1514
+ "isFormList"
1515
+ ]),
1516
+ className: W,
1517
+ div: g !== "horizontal",
1518
+ style: T,
1519
+ children: [
1520
+ j ? /* @__PURE__ */ p(
1521
+ _e,
1522
+ {
1523
+ ...r.labelCol || h.labelCol,
1524
+ className: B(
1525
+ be,
1526
+ (Ie = r.labelCol) == null ? void 0 : Ie.className,
1527
+ (Me = h.labelCol) == null ? void 0 : Me.className,
1528
+ {
1529
+ [`${d}-label-item-flex`]: !r.labelCol && !h.labelCol
1530
+ }
1531
+ ),
1532
+ children: /* @__PURE__ */ p(
1533
+ Xt,
1534
+ {
1535
+ tooltip: r.tooltip,
1536
+ htmlFor: r.field && (($e = h == null ? void 0 : h.getFormElementId) == null ? void 0 : $e.call(h, r.field)),
1537
+ label: j,
1538
+ prefix: s,
1539
+ requiredSymbol: "requiredSymbol" in r ? r.requiredSymbol : h.requiredSymbol,
1540
+ required: r.required,
1541
+ rules: r.rules,
1542
+ showColon: "colon" in r ? r.colon : h.colon
1543
+ }
1544
+ )
1545
+ }
1546
+ ) : null,
1547
+ /* @__PURE__ */ Q(
1548
+ _e,
1549
+ {
1550
+ className: B(`${d}-item-wrapper`, {
1551
+ [`${d}-item-wrapper-flex`]: !r.wrapperCol && !h.wrapperCol
1552
+ }),
1553
+ ...r.wrapperCol || h.wrapperCol,
1554
+ children: [
1555
+ I(),
1556
+ /* @__PURE__ */ p(
1557
+ ts,
1558
+ {
1559
+ prefixCls: d,
1560
+ help: r.help,
1561
+ errors: de,
1562
+ warnings: te
1563
+ }
1564
+ ),
1565
+ w && /* @__PURE__ */ p("div", { className: `${d}-extra`, children: w })
1566
+ ]
1567
+ }
1568
+ )
1569
+ ]
1570
+ }
1571
+ ) }) });
1572
+ }, Fe = we(ss);
1573
+ Fe.defaultProps = {
1574
+ trigger: "onChange",
1575
+ triggerPropName: "value"
1576
+ };
1577
+ Fe.displayName = "FormItem";
1578
+ const Le = (r, e) => !le(r) && r >= 0 && r < e.length, st = (r) => {
1579
+ const { field: e, children: t, initialValue: s } = r, i = L({
1580
+ id: 0,
1581
+ keys: []
1582
+ }), l = "initialValue" in r ? { initialValue: s } : {}, n = i.current.keys;
1583
+ return /* @__PURE__ */ p(
1584
+ Qe.Provider,
1585
+ {
1586
+ value: {
1587
+ getItemKey: (o) => {
1588
+ const a = o == null ? void 0 : o.replace(/\[|\]/g, ".").split("."), c = a.indexOf(e), h = a[c + 1];
1589
+ return `${e}_${n.indexOf(h)}_${a.slice(c + 2).join("_")}`;
1590
+ }
1591
+ },
1592
+ children: /* @__PURE__ */ p(
1593
+ Fe,
1594
+ {
1595
+ field: e,
1596
+ ...l,
1597
+ isFormList: !0,
1598
+ rules: r.rules,
1599
+ wrapperCol: { span: 24 },
1600
+ noStyle: "noStyle" in r ? r.noStyle : !r.rules,
1601
+ shouldUpdate: (o, a, c) => {
1602
+ var h, d;
1603
+ return !!(c && !c.isInner && ge(c.field, [e]) && ((h = M(o, e)) == null ? void 0 : h.length) !== ((d = M(a, e)) == null ? void 0 : d.length));
1604
+ },
1605
+ children: (o, a, { value: c, onChange: h }) => {
1606
+ const d = c || [], g = function(f, F) {
1607
+ var T;
1608
+ if (Xe(f)) {
1609
+ oe(
1610
+ !0,
1611
+ "Form.List: The event object cannot be used as a parameter of the add method"
1612
+ );
1613
+ return;
1614
+ }
1615
+ const V = ((T = a.getInnerMethods(!0)) == null ? void 0 : T.innerGetFieldValue(e)) || [], j = i.current.id;
1616
+ i.current.id += 1;
1617
+ const w = V || [];
1618
+ let $ = w;
1619
+ F !== void 0 && F >= 0 && F <= w.length ? (n.splice(F, 0, j), $ = [
1620
+ ...w.slice(0, F),
1621
+ f,
1622
+ ...w.slice(F)
1623
+ ]) : (n.push(j), $ = [...w, f]), h($, {
1624
+ isFormList: !0,
1625
+ ignore: f === void 0
1626
+ });
1627
+ }, m = function(f) {
1628
+ var j;
1629
+ const V = (((j = a.getInnerMethods(!0)) == null ? void 0 : j.innerGetFieldValue(e)) || []).filter((w, $) => $ !== f);
1630
+ n.splice(f, 1), h([...V], { isFormList: !0 });
1631
+ }, v = function(f, F) {
1632
+ var T;
1633
+ const V = ((T = a.getInnerMethods(!0)) == null ? void 0 : T.innerGetFieldValue(e)) || [];
1634
+ if (f === F || !Le(f, V) || !Le(F, V))
1635
+ return;
1636
+ const j = n[f];
1637
+ n.splice(f, 1), n.splice(F, 0, j);
1638
+ const w = V[f], $ = [...V];
1639
+ $.splice(f, 1), $.splice(F, 0, w), h($, { isFormList: !0 });
1640
+ };
1641
+ return _(t) && t(
1642
+ d.map((f, F) => {
1643
+ let V = n[F];
1644
+ return V === void 0 && (V = i.current.id, n.push(V), i.current.id += 1), {
1645
+ field: `${e}[${F}]`,
1646
+ key: V
1647
+ };
1648
+ }),
1649
+ {
1650
+ add: g,
1651
+ remove: m,
1652
+ move: v
1653
+ }
1654
+ );
1655
+ }
1656
+ }
1657
+ )
1658
+ }
1659
+ );
1660
+ };
1661
+ st.displayName = "FormList";
1662
+ const rs = (r, e) => {
1663
+ const t = L({}), s = ne((o, a) => (o && (t.current[o] = a), () => {
1664
+ delete t.current[o];
1665
+ }), []), i = ne(
1666
+ (o, a) => {
1667
+ var c;
1668
+ (c = r.onFormSubmit) == null || c.call(r, o, a, {
1669
+ forms: t.current
1670
+ });
1671
+ },
1672
+ [r.onFormSubmit]
1673
+ ), l = ne(
1674
+ (o, a) => {
1675
+ var c;
1676
+ (c = r.onFormReset) == null || c.call(r, o, a, {
1677
+ forms: t.current
1678
+ });
1679
+ },
1680
+ [r.onFormReset]
1681
+ ), n = ne(
1682
+ (o, a) => {
1683
+ var c;
1684
+ (c = r.onFormValuesChange) == null || c.call(r, o, a, {
1685
+ forms: t.current
1686
+ });
1687
+ },
1688
+ [r.onFormValuesChange]
1689
+ );
1690
+ return /* @__PURE__ */ p(
1691
+ Ke.Provider,
1692
+ {
1693
+ value: {
1694
+ onFormValuesChange: n,
1695
+ onFormSubmit: i,
1696
+ onFormReset: l,
1697
+ register: s
1698
+ },
1699
+ children: r.children
1700
+ }
1701
+ );
1702
+ }, rt = we(rs);
1703
+ rt.displayName = "FormProvider";
1704
+ const is = () => {
1705
+ const r = U(ae), e = r.store, t = L(!1), s = Ct(), i = ne(() => {
1706
+ var o, a, c;
1707
+ const { submitStatus: l } = ((c = (a = (o = e == null ? void 0 : e.getInnerMethods) == null ? void 0 : o.call(e, !0)) == null ? void 0 : a.innerGetStoreStatus) == null ? void 0 : c.call(a)) ?? {}, n = l === D.submitting;
1708
+ n !== t.current && (t.current = n, s());
1709
+ }, []);
1710
+ return he(() => {
1711
+ var a;
1712
+ if (!e) {
1713
+ oe(!0, "formInstance is not available");
1714
+ return;
1715
+ }
1716
+ const { registerFormWatcher: l } = ((a = e == null ? void 0 : e.getInnerMethods) == null ? void 0 : a.call(e, !0)) ?? {}, n = () => i();
1717
+ n();
1718
+ const o = (l == null ? void 0 : l(n)) ?? {};
1719
+ return () => {
1720
+ o == null || o();
1721
+ };
1722
+ }, []), {
1723
+ form: e,
1724
+ disabled: r.disabled,
1725
+ isSubmitting: t.current
1726
+ };
1727
+ }, ns = (r, e) => {
1728
+ const t = U(ae), s = e || t.store, i = L(r);
1729
+ i.current = r;
1730
+ const l = ne(() => {
1731
+ const c = i.current, h = s.getFieldsState([c]);
1732
+ return h == null ? void 0 : h[c];
1733
+ }, []), [n, o] = me(l), a = L(n);
1734
+ return he(() => {
1735
+ var g;
1736
+ if (!s) {
1737
+ oe(!0, "formInstance is not available");
1738
+ return;
1739
+ }
1740
+ const { registerStateWatcher: c } = ((g = s == null ? void 0 : s.getInnerMethods) == null ? void 0 : g.call(s, !0)) ?? {}, h = () => {
1741
+ const m = l();
1742
+ je(a.current, m) || (o(m), a.current = m);
1743
+ };
1744
+ h();
1745
+ const d = c == null ? void 0 : c(h);
1746
+ return () => {
1747
+ d == null || d();
1748
+ };
1749
+ }, []), n;
1750
+ }, ls = (r, e) => {
1751
+ const t = U(ae), s = e || t.store, [i, l] = me(() => {
1752
+ const a = s == null ? void 0 : s.getFieldsValue([].concat(r));
1753
+ return fe(r) ? M(a, r) : a;
1754
+ }), n = L(r);
1755
+ n.current = r;
1756
+ const o = L(JSON.stringify(i));
1757
+ return he(() => {
1758
+ var d;
1759
+ if (!s) {
1760
+ oe(!0, "formInstance is not available");
1761
+ return;
1762
+ }
1763
+ const { registerWatcher: a } = ((d = s == null ? void 0 : s.getInnerMethods) == null ? void 0 : d.call(s, !0)) ?? {}, c = () => {
1764
+ const g = n.current, m = s.getFieldsValue([].concat(g));
1765
+ let v = m;
1766
+ S(g) || (v = M(m, g));
1767
+ const f = JSON.stringify(v);
1768
+ o.current !== f && (l(v), o.current = f);
1769
+ };
1770
+ c();
1771
+ const h = a == null ? void 0 : a(c);
1772
+ return () => {
1773
+ h == null || h();
1774
+ };
1775
+ }, []), i;
1776
+ }, J = tt;
1777
+ J.Provider = rt;
1778
+ J.Item = Fe;
1779
+ J.List = st;
1780
+ J.Control = H;
1781
+ J.useForm = et;
1782
+ J.useFormContext = is;
1783
+ J.useWatch = ls;
1784
+ J.useFormState = ns;
1785
+ export {
1786
+ H as C,
1787
+ J as F,
1788
+ Fe as I,
1789
+ st as L,
1790
+ Gt as Y,
1791
+ rt as a,
1792
+ is as b,
1793
+ ns as c,
1794
+ ls as d,
1795
+ et as u
1796
+ };