@unicom-cloud/ui 0.8.65 → 0.8.67

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 (358) hide show
  1. package/Affix.js +79 -79
  2. package/Alert.js +46 -46
  3. package/Anchor.js +1 -1
  4. package/AutoComplete.js +74 -74
  5. package/Avatar.js +36 -36
  6. package/BackTop.js +35 -35
  7. package/Badge.js +55 -55
  8. package/Breadcrumb.js +42 -42
  9. package/Button.js +24 -24
  10. package/Calendar.js +230 -230
  11. package/Card.js +18 -18
  12. package/Carousel.js +165 -165
  13. package/Cascader.js +1 -1
  14. package/Checkbox.js +1 -1
  15. package/Collapse.js +1 -1
  16. package/ColorPicker.js +26 -26
  17. package/Comment.js +18 -18
  18. package/ConfigProvider.js +2 -2
  19. package/Copy.js +28 -27
  20. package/DatePicker.js +872 -871
  21. package/Descriptions.js +34 -34
  22. package/Divider.js +19 -19
  23. package/Draggable.js +27 -26
  24. package/Drawer.js +1 -1
  25. package/Dropdown.js +110 -110
  26. package/Empty.js +3 -3
  27. package/Form.js +984 -945
  28. package/Grid.js +34 -34
  29. package/Icon.js +16 -16
  30. package/IconHover.js +2 -2
  31. package/Image.js +2 -2
  32. package/Input.js +7 -6
  33. package/InputNumber.js +6 -6
  34. package/InputTag.js +1 -1
  35. package/Layout.js +24 -24
  36. package/Link.js +30 -30
  37. package/List.js +95 -95
  38. package/Mentions.js +85 -84
  39. package/Menu.js +2 -2
  40. package/Message.js +7 -6
  41. package/Modal.js +1 -1
  42. package/Notice.js +14 -3
  43. package/Notification.js +9 -7
  44. package/OverflowEllipsis.js +64 -62
  45. package/PageHeader.js +73 -73
  46. package/Pagination.js +1 -1
  47. package/Picker.js +1 -1
  48. package/Popconfirm.js +60 -60
  49. package/Popover.js +31 -31
  50. package/Portal.js +23 -31
  51. package/Progress.js +22 -22
  52. package/Radio.js +2 -2
  53. package/Rate.js +24 -24
  54. package/ResizeBox.js +274 -271
  55. package/Result.js +3 -3
  56. package/Select.js +4 -4
  57. package/SelectView.js +257 -237
  58. package/Skeleton.js +46 -46
  59. package/Slider.js +286 -283
  60. package/Space.js +28 -28
  61. package/SpeechSynthesis.js +62 -55
  62. package/Spin.js +23 -23
  63. package/Statistic.js +80 -80
  64. package/Steps.js +67 -67
  65. package/Switch.js +47 -47
  66. package/Table.js +1463 -1395
  67. package/Tabs.js +5 -5
  68. package/Tag.js +45 -45
  69. package/TimePicker.js +154 -154
  70. package/Timeline.js +2 -2
  71. package/Tooltip.js +80 -79
  72. package/Transfer.js +103 -102
  73. package/Tree.js +3 -2
  74. package/TreeSelect.js +2 -2
  75. package/Trigger.js +699 -772
  76. package/Typography.js +756 -6
  77. package/Upload.js +2 -2
  78. package/VerificationCode.js +1 -1
  79. package/Version.js +1 -1
  80. package/VirtualList.js +1 -1
  81. package/Watermark.js +1 -1
  82. package/chunk/{DIx0qmCq.js → -UuKKT0Z.js} +29 -29
  83. package/chunk/{B8QV6E2b.js → AwZqeapI.js} +5 -5
  84. package/chunk/B5gK1Idp.js +19 -0
  85. package/chunk/B7FlazNB.js +24 -0
  86. package/chunk/{DXZEpA3t.js → BBvWDeuZ.js} +67 -67
  87. package/chunk/BCftTxEy.js +626 -0
  88. package/chunk/{CsbCHnFk.js → BGny4zSb.js} +60 -60
  89. package/chunk/BHF15Dog.js +98 -0
  90. package/chunk/BJQ5UNa-.js +1585 -0
  91. package/chunk/BP9sYyk9.js +8 -0
  92. package/chunk/BUdtVdnv.js +38 -0
  93. package/chunk/BVQlOzTS.js +11 -0
  94. package/chunk/B__a_gb_.js +519 -0
  95. package/chunk/BbEYToV1.js +10 -0
  96. package/chunk/BbdDQAnm.js +15 -0
  97. package/chunk/BdUcgWdu.js +11 -0
  98. package/chunk/BfbXSG70.js +26 -0
  99. package/chunk/BndfNLK4.js +186 -0
  100. package/chunk/BoMCZV6K.js +1098 -0
  101. package/chunk/Br0B6y1T.js +18 -0
  102. package/chunk/BrOW642m.js +130 -0
  103. package/chunk/BxUs8_Cr.js +9 -0
  104. package/chunk/{DK4KcodH.js → C42LIMP9.js} +244 -242
  105. package/chunk/C4YkFMzC.js +778 -0
  106. package/chunk/{CF6p9R93.js → C9Wcraj7.js} +21 -21
  107. package/chunk/{4-gvEY5y.js → CANgSlh3.js} +10 -10
  108. package/chunk/CJ_o9tZM.js +5 -0
  109. package/chunk/{Bqk6yh16.js → CK5m7rLl.js} +36 -36
  110. package/chunk/{CANaGbGR.js → CKNyIitu.js} +57 -56
  111. package/chunk/CLiqJm_T.js +10 -0
  112. package/chunk/{DjtWv6Wn.js → CNmmhbCn.js} +32 -32
  113. package/chunk/{BUCEs557.js → CP0odX99.js} +51 -51
  114. package/chunk/CPT-OZH2.js +14 -0
  115. package/chunk/CVSF8p0O.js +698 -0
  116. package/chunk/C_agcwLN.js +31 -0
  117. package/chunk/{DTjcKyDN.js → C_gJWGGh.js} +201 -201
  118. package/chunk/{CPcm9Cm5.js → CaasmWg_.js} +11 -11
  119. package/chunk/Ce1j9KTi.js +6 -0
  120. package/chunk/{D_-UD4vO.js → Cf5QNhkG.js} +18 -18
  121. package/chunk/CkNSv2U7.js +56 -0
  122. package/chunk/Cp2f70gB.js +9 -0
  123. package/chunk/CpegYjdC.js +16 -0
  124. package/chunk/CucI3KZr.js +20 -0
  125. package/chunk/CwoFBTYz.js +11 -0
  126. package/chunk/D2KPqPhV.js +17 -0
  127. package/chunk/D7NyvE5f.js +17 -0
  128. package/chunk/D8oTPQ2H.js +384 -0
  129. package/chunk/{CLBavO5c.js → DC1iHEiy.js} +87 -87
  130. package/chunk/{Dnycc1qJ.js → DFrfrmfK.js} +120 -119
  131. package/chunk/DGTIZ_0O.js +6 -0
  132. package/chunk/DJfpiZn_.js +25 -0
  133. package/chunk/DKr2_PYd.js +34 -0
  134. package/chunk/DNUz6zgo.js +11 -0
  135. package/chunk/DRtM649q.js +11 -0
  136. package/chunk/DS_mUWn6.js +41 -0
  137. package/chunk/DU6bs_19.js +10 -0
  138. package/chunk/DWdbwz22.js +10 -0
  139. package/chunk/DcveZuqd.js +6 -0
  140. package/chunk/DdVFknul.js +24 -0
  141. package/chunk/DgRfikwe.js +16 -0
  142. package/chunk/{DG-epQqF.js → DkyR2EfG.js} +66 -66
  143. package/chunk/{DUeHQKtx.js → DleQ5HwG.js} +42 -42
  144. package/chunk/DnrZEnQ_.js +27 -0
  145. package/chunk/DsRSHWtX.js +1025 -0
  146. package/chunk/Dz5BdmXo.js +270 -0
  147. package/chunk/EANe01DF.js +1030 -0
  148. package/chunk/{CwhPMMWy.js → Ey4YJCkX.js} +7 -7
  149. package/chunk/GoNx5R4F.js +873 -0
  150. package/chunk/HDUQku8d.js +20 -0
  151. package/chunk/HrAP__Hi.js +25 -0
  152. package/chunk/JPPo5nY_.js +9 -0
  153. package/chunk/{CIlGCedk.js → SLWP34OR.js} +90 -85
  154. package/chunk/VVKtwaGf.js +278 -0
  155. package/chunk/WPNpLxSI.js +16 -0
  156. package/chunk/{DLvMA1OW.js → WpO_DsK4.js} +49 -48
  157. package/chunk/fdU3ang6.js +14 -0
  158. package/chunk/{DqFhzTWC.js → fkclKOAL.js} +298 -292
  159. package/chunk/flvYlqx3.js +22 -0
  160. package/chunk/kTDayEpF.js +288 -0
  161. package/chunk/{DQDkV47j.js → pZoNQ75H.js} +31 -31
  162. package/chunk/qFf1w_Jq.js +8 -0
  163. package/chunk/{CH1UUxsg.js → w-kM1L5W.js} +155 -155
  164. package/hooks/index.js +53 -49
  165. package/hooks/useComputedState.js +2 -10
  166. package/hooks/useCreate.js +2 -7
  167. package/hooks/useForceUpdate.js +2 -7
  168. package/hooks/useId.js +2 -10
  169. package/hooks/useInView.js +2 -30
  170. package/hooks/useIntersectionObserver.js +2 -23
  171. package/hooks/useInterval.js +2 -17
  172. package/hooks/useIsFirstRender.js +2 -9
  173. package/hooks/useIsomorphicLayoutEffect.js +2 -5
  174. package/hooks/useKeyboardEvent.js +2 -16
  175. package/hooks/useMedia.js +2 -15
  176. package/hooks/useMergeProps.js +2 -18
  177. package/hooks/useMergeValue.js +2 -19
  178. package/hooks/useOnlineStatus.js +4 -0
  179. package/hooks/useOverflowHidden.js +2 -25
  180. package/hooks/useOverrideRef.js +2 -13
  181. package/hooks/usePersistCallback.js +2 -13
  182. package/hooks/usePrefersColorSchemeDark.js +4 -0
  183. package/hooks/usePrevious.js +2 -9
  184. package/hooks/useRefs.js +2 -9
  185. package/hooks/useResizeObserver.js +2 -15
  186. package/hooks/useStateCallback.js +2 -15
  187. package/hooks/useStateWithPromise.js +2 -24
  188. package/hooks/useUpdateEffect.js +2 -9
  189. package/hooks/useVerificationCode.js +73 -0
  190. package/hooks/useWatch.js +2 -10
  191. package/hooks/{use-watermark.js → useWatermark.js} +27 -26
  192. package/hooks/useWindowSize.js +2 -20
  193. package/index.js +571 -584
  194. package/locale/en-US.js +4 -2
  195. package/locale/interface.js +1 -4
  196. package/locale/ja-JP.js +3 -1
  197. package/locale/tr-TR.js +1 -1
  198. package/locale/zh-CN.js +3 -1
  199. package/locale/zh-HK.js +3 -1
  200. package/locale/zh-TW.js +3 -1
  201. package/package.json +1 -1
  202. package/style.css +1 -1
  203. package/types/anchor/util.d.ts +1 -1
  204. package/types/button/index.d.ts +2 -2
  205. package/types/color-picker/hooks/useColorPicker.d.ts +2 -2
  206. package/types/form/Control-old.d.ts +56 -0
  207. package/types/form/Control.d.ts +6 -54
  208. package/types/form/FormItem.d.ts +1 -1
  209. package/types/form/store.d.ts +0 -1
  210. package/types/hooks/index.d.ts +2 -0
  211. package/types/hooks/useComputedState.d.ts +1 -4
  212. package/types/hooks/useCreate.d.ts +1 -2
  213. package/types/hooks/useForceUpdate.d.ts +1 -2
  214. package/types/hooks/useId.d.ts +1 -2
  215. package/types/hooks/useInView.d.ts +1 -11
  216. package/types/hooks/useIntersectionObserver.d.ts +1 -7
  217. package/types/hooks/useInterval.d.ts +1 -2
  218. package/types/hooks/useIsFirstRender.d.ts +1 -2
  219. package/types/hooks/useIsomorphicLayoutEffect.d.ts +1 -3
  220. package/types/hooks/useKeyboardEvent.d.ts +1 -8
  221. package/types/hooks/useMedia.d.ts +1 -2
  222. package/types/hooks/useMergeProps.d.ts +1 -5
  223. package/types/hooks/useMergeValue.d.ts +1 -6
  224. package/types/hooks/useOnlineStatus.d.ts +1 -0
  225. package/types/hooks/useOverflowHidden.d.ts +1 -5
  226. package/types/hooks/useOverrideRef.d.ts +1 -6
  227. package/types/hooks/usePersistCallback.d.ts +1 -2
  228. package/types/hooks/usePrefersColorSchemeDark.d.ts +1 -0
  229. package/types/hooks/usePrevious.d.ts +1 -3
  230. package/types/hooks/useRefs.d.ts +1 -2
  231. package/types/hooks/useResizeObserver.d.ts +1 -6
  232. package/types/hooks/useStateCallback.d.ts +1 -5
  233. package/types/hooks/useStateWithPromise.d.ts +1 -2
  234. package/types/hooks/useUpdateEffect.d.ts +1 -3
  235. package/types/hooks/useWatch.d.ts +1 -3
  236. package/types/hooks/useWindowSize.d.ts +1 -5
  237. package/types/image/interface.d.ts +1 -0
  238. package/types/index.d.ts +157 -86
  239. package/types/input/Input.d.ts +1 -1
  240. package/types/input/Textarea.d.ts +2 -2
  241. package/types/locale/en-US.d.ts +2 -0
  242. package/types/locale/interface.d.ts +1 -2
  243. package/types/locale/ja-JP.d.ts +2 -0
  244. package/types/locale/zh-CN.d.ts +2 -0
  245. package/types/locale/zh-HK.d.ts +2 -0
  246. package/types/locale/zh-TW.d.ts +2 -0
  247. package/types/menu/context.d.ts +1 -1
  248. package/types/message/index.d.ts +14 -14
  249. package/types/message/interface.d.ts +2 -0
  250. package/types/modal/config.d.ts +0 -1
  251. package/types/modal/interface.d.ts +0 -1
  252. package/types/notice/index.d.ts +2 -27
  253. package/types/notification/index.d.ts +15 -16
  254. package/types/notification/interface.d.ts +2 -0
  255. package/types/notification/withNotification.d.ts +2 -0
  256. package/types/select/util.d.ts +1 -2
  257. package/types/select-view/interface.d.ts +2 -1
  258. package/types/speech-synthesis/index.d.ts +1 -1
  259. package/types/table/constant.d.ts +2 -0
  260. package/types/table/hook/useThResizable.d.ts +7 -0
  261. package/types/table/index.d.ts +10 -1
  262. package/types/table/style/index.d.ts +1 -0
  263. package/types/table/th-resizable/index.d.ts +2 -0
  264. package/types/table/thead/Column.d.ts +1 -2
  265. package/types/tree/Tree.d.ts +12 -67
  266. package/types/tree-select/Select.d.ts +2 -2
  267. package/types/trigger/index.d.ts +2 -120
  268. package/types/trigger/interface.d.ts +2 -1
  269. package/types/utils/CSSTransition.d.ts +2 -3
  270. package/types/utils/caseName.d.ts +1 -1
  271. package/types/utils/className.d.ts +1 -1
  272. package/types/utils/constant.d.ts +2 -2
  273. package/types/utils/copy.d.ts +1 -1
  274. package/types/utils/dayjs.d.ts +1 -21
  275. package/types/utils/dom.d.ts +1 -6
  276. package/types/utils/fileToURL.d.ts +1 -1
  277. package/types/utils/fillNBSP.d.ts +1 -1
  278. package/types/utils/getHighlightText.d.ts +1 -5
  279. package/types/utils/getHotkeyHandler.d.ts +1 -8
  280. package/types/utils/getStringLength.d.ts +1 -1
  281. package/types/utils/include.d.ts +1 -1
  282. package/types/utils/index.d.ts +3 -4
  283. package/types/utils/is.d.ts +1 -16
  284. package/types/utils/keyboardCode.d.ts +3 -0
  285. package/types/utils/lodash.d.ts +1 -17
  286. package/types/utils/mergeProps.d.ts +1 -1
  287. package/types/utils/mergedToString.d.ts +1 -1
  288. package/types/utils/omit.d.ts +1 -1
  289. package/types/utils/pad.d.ts +1 -2
  290. package/types/utils/pick.d.ts +2 -4
  291. package/types/utils/reactDOM.d.ts +1 -7
  292. package/types/utils/resizeObserverEffect.d.ts +2 -0
  293. package/types/utils/saveAs.d.ts +1 -1
  294. package/types/utils/screenfull.d.ts +2 -0
  295. package/types/utils/scrollIntoView.d.ts +1 -2
  296. package/types/utils/style.d.ts +1 -3
  297. package/types/utils/throttleByRaf.d.ts +1 -5
  298. package/types/utils/throttleByRaf2.d.ts +1 -0
  299. package/types/utils/warning.d.ts +1 -2
  300. package/types/version/index.d.ts +1 -1
  301. package/utils/CSSTransition.js +2 -6
  302. package/utils/className.js +2 -2
  303. package/utils/constant.js +8 -9
  304. package/utils/contextHolder.js +1 -1
  305. package/utils/copy.js +1 -1
  306. package/utils/dayjs.js +14 -173
  307. package/utils/dom.js +33 -29
  308. package/utils/fillNBSP.js +2 -4
  309. package/utils/getHighlightText.js +2 -38
  310. package/utils/getHotkeyHandler.js +2 -25
  311. package/utils/getStringLength.js +2 -7
  312. package/utils/include.js +2 -7
  313. package/utils/index.js +237 -240
  314. package/utils/is.js +116 -156
  315. package/utils/keyboardCode.js +27 -0
  316. package/utils/mergeProps.js +2 -9
  317. package/utils/mergedToString.js +2 -13
  318. package/utils/omit.js +2 -9
  319. package/utils/pad.js +12 -12
  320. package/utils/pick.js +4 -15
  321. package/utils/reactDOM.js +3 -54
  322. package/utils/resizeObserverEffect.js +4 -0
  323. package/utils/saveAs.js +1 -1
  324. package/utils/screenfull.js +4 -0
  325. package/utils/scrollIntoView.js +2 -21
  326. package/utils/style.js +12 -11
  327. package/utils/throttleByRaf.js +13 -12
  328. package/utils/throttleByRaf2.js +5 -0
  329. package/utils/warning.js +5 -4
  330. package/NotificationBase.js +0 -53
  331. package/chunk/1GQdnTJp.js +0 -284
  332. package/chunk/BAWsPQBM.js +0 -11
  333. package/chunk/BS09tn7B.js +0 -638
  334. package/chunk/BqGtwxTi.js +0 -777
  335. package/chunk/BqufsN8i.js +0 -376
  336. package/chunk/BtlvlGQN.js +0 -278
  337. package/chunk/C2lIz2F9.js +0 -60
  338. package/chunk/CGZ0In1p.js +0 -776
  339. package/chunk/CWgltRVL.js +0 -698
  340. package/chunk/D3NFxdmG.js +0 -518
  341. package/chunk/DApXtulb.js +0 -1102
  342. package/chunk/DlLL5JQo.js +0 -1501
  343. package/chunk/Dv_xRzvR.js +0 -269
  344. package/chunk/Ek8U5CTN.js +0 -1032
  345. package/chunk/ewRDIDUz.js +0 -995
  346. package/chunk/l0sNRNKZ.js +0 -1
  347. package/chunk/tYXLFPVI.js +0 -871
  348. package/hooks/use-verification-code.js +0 -73
  349. package/types/notification-base/index.d.ts +0 -15
  350. package/types/notification-base/style/index.d.ts +0 -2
  351. package/types/trigger/Portal.d.ts +0 -7
  352. package/types/utils/keyCode.d.ts +0 -45
  353. package/types/utils/raf.d.ts +0 -3
  354. package/types/utils/throttleByRafV2.d.ts +0 -5
  355. package/utils/keyCode.js +0 -12
  356. package/utils/raf.js +0 -19
  357. package/utils/throttleByRafV2.js +0 -16
  358. /package/style/{variable.less → variables.less} +0 -0
package/Form.js CHANGED
@@ -1,44 +1,47 @@
1
- var Ze = Object.defineProperty;
2
- var Ye = (s, e, t) => e in s ? Ze(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var u = (s, e, t) => Ye(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { jsx as f, jsxs as J, Fragment as Ne } from "react/jsx-runtime";
5
- import { p as Ke } from "./chunk/CANaGbGR.js";
6
- import M from "lodash/isPlainObject";
7
- import Me from "lodash/merge";
8
- import H, { createContext as ue, useRef as L, forwardRef as Ve, useContext as O, useEffect as ie, useImperativeHandle as et, Component as tt, isValidElement as fe, useState as ce, useMemo as we, createElement as Ee, cloneElement as Te, useCallback as ee } from "react";
9
- import { d as xe, a as rt } from "./chunk/DlLL5JQo.js";
10
- import { useCreate as st } from "./hooks/useCreate.js";
11
- import { useMergeProps as it } from "./hooks/useMergeProps.js";
12
- import { y as G } from "./chunk/BAWsPQBM.js";
13
- import _e from "./utils/omit.js";
14
- import { NOOP as b } from "./utils/constant.js";
15
- import $ from "lodash/get";
16
- import Le from "lodash/has";
17
- import T from "lodash/isArray";
18
- import j from "lodash/isFunction";
19
- import nt from "lodash/omit";
20
- import De from "lodash/setWith";
21
- import { isExist as $e } from "./utils/is.js";
22
- import { P as lt } from "./chunk/DUeHQKtx.js";
23
- import Ue from "lodash/cloneDeepWith";
24
- import ot from "lodash/flatten";
25
- import Oe from "lodash/set";
26
- import at from "@unicom-cloud/icons/IconUiCheckCircleFill";
27
- import ct from "@unicom-cloud/icons/IconUiCloseCircleFill";
28
- import ut from "@unicom-cloud/icons/IconUiExclamationCircleFill";
29
- import dt from "@unicom-cloud/icons/IconUiLoading";
30
- import ht from "lodash/isBoolean";
31
- import pe from "lodash/isEqualWith";
32
- import gt from "lodash/isNil";
33
- import re from "./utils/warning.js";
34
- import te from "lodash/isUndefined";
35
- import je from "./Grid.js";
36
- import { P as mt } from "./chunk/CLBavO5c.js";
37
- import Ft from "@unicom-cloud/icons/IconUiQuestionCircleFill";
38
- import ft from "./Tooltip.js";
39
- import { useForceUpdate as pt } from "./hooks/useForceUpdate.js";
40
- import St from "lodash/isString";
41
- const se = ue({
1
+ var It = Object.defineProperty;
2
+ var wt = (r, e, t) => e in r ? It(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var g = (r, e, t) => wt(r, typeof e != "symbol" ? e + "" : e, t);
4
+ import { jsx as V, jsxs as be, Fragment as lt } from "react/jsx-runtime";
5
+ import { p as Et } from "./chunk/CKNyIitu.js";
6
+ import X from "lodash/isPlainObject";
7
+ import ot from "lodash/merge";
8
+ import Ve, { createContext as Me, useRef as R, forwardRef as _e, useContext as re, useEffect as Se, useImperativeHandle as at, isValidElement as De, useLayoutEffect as $t, useState as Re, useMemo as Ye, createElement as Ke, cloneElement as et, useCallback as ve } from "react";
9
+ import { a as qe, b as Tt } from "./chunk/BJQ5UNa-.js";
10
+ import { f as kt } from "./chunk/qFf1w_Jq.js";
11
+ import { c as ze } from "./chunk/B5gK1Idp.js";
12
+ import { m as ge } from "./chunk/JPPo5nY_.js";
13
+ import { c as ut } from "./chunk/BdUcgWdu.js";
14
+ import { o as w } from "./chunk/CJ_o9tZM.js";
15
+ import z from "lodash/get";
16
+ import ct from "lodash/has";
17
+ import G from "lodash/isArray";
18
+ import ue from "lodash/isFunction";
19
+ import Nt from "lodash/omit";
20
+ import dt from "lodash/setWith";
21
+ import { F as tt } from "./chunk/CkNSv2U7.js";
22
+ import "./chunk/CSC_V_25.js";
23
+ import Pt from "lodash/isFunction.js";
24
+ import { P as Wt } from "./chunk/DleQ5HwG.js";
25
+ import ht from "lodash/cloneDeepWith";
26
+ import Rt from "lodash/flatten";
27
+ import gt from "lodash/set";
28
+ import Mt from "@unicom-cloud/icons/IconUiCheckCircleFill";
29
+ import _t from "@unicom-cloud/icons/IconUiCloseCircleFill";
30
+ import Lt from "@unicom-cloud/icons/IconUiExclamationCircleFill";
31
+ import xt from "@unicom-cloud/icons/IconUiLoading";
32
+ import Ut from "lodash/isBoolean";
33
+ import Ge from "lodash/isEqualWith";
34
+ import jt from "lodash/isNil";
35
+ import { c as mt } from "./chunk/BP9sYyk9.js";
36
+ import { u as Dt } from "./chunk/CLiqJm_T.js";
37
+ import Ie from "./utils/warning.js";
38
+ import Ce from "lodash/isUndefined";
39
+ import ft from "./Grid.js";
40
+ import { N as Gt } from "./chunk/DC1iHEiy.js";
41
+ import Ot from "@unicom-cloud/icons/IconUiQuestionCircleFill";
42
+ import qt from "./Tooltip.js";
43
+ import zt from "lodash/isString";
44
+ const we = Me({
42
45
  layout: "horizontal",
43
46
  labelCol: { span: 5, offset: 0 },
44
47
  labelAlign: "right",
@@ -46,390 +49,401 @@ const se = ue({
46
49
  requiredSymbol: !0,
47
50
  getFormElementId: () => "pqb-",
48
51
  store: {
49
- clearFields: b,
50
- getFieldsValue: b,
51
- getFieldValue: b,
52
- getFieldError: b,
53
- getFieldsError: b,
54
- getTouchedFields: b,
55
- getFields: b,
56
- getInitialValues: b,
57
- setInitialValues: b,
58
- setInitialValue: b,
59
- setFieldValue: b,
60
- setFieldsValue: b,
61
- setFields: b,
62
- resetFields: b,
63
- submit: b,
64
- validate: b,
65
- getFieldsState: b,
66
- scrollToField: b,
52
+ clearFields: w,
53
+ getFieldsValue: w,
54
+ getFieldValue: w,
55
+ getFieldError: w,
56
+ getFieldsError: w,
57
+ getTouchedFields: w,
58
+ getFields: w,
59
+ getInitialValues: w,
60
+ setInitialValues: w,
61
+ setInitialValue: w,
62
+ setFieldValue: w,
63
+ setFieldsValue: w,
64
+ setFields: w,
65
+ resetFields: w,
66
+ submit: w,
67
+ validate: w,
68
+ getFieldsState: w,
69
+ scrollToField: w,
67
70
  getInnerMethods: () => ({
68
- registerField: b,
69
- innerGetStore: b,
70
- registerStateWatcher: b,
71
- registerWatcher: b,
72
- innerGetStoreStatus: b
71
+ registerField: w,
72
+ innerGetStore: w,
73
+ registerStateWatcher: w,
74
+ registerWatcher: w,
75
+ innerGetStoreStatus: w
73
76
  })
74
77
  }
75
- }), Se = ue({}), qe = ue({}), Ge = ue({}), me = {
78
+ }), Oe = Me({}), Ft = Me({}), pt = Me({}), Ue = {
76
79
  error: "error",
77
- success: "success",
78
- warning: "warning",
79
- validating: "validating"
80
+ warning: "warning"
80
81
  };
81
- var U = /* @__PURE__ */ ((s) => (s.init = "init", s.error = "error", s.success = "success", s.submitting = "submitting", s))(U || {});
82
- class Vt extends Error {
82
+ var ae = /* @__PURE__ */ ((r) => (r.init = "init", r.error = "error", r.success = "success", r.submitting = "submitting", r))(ae || {});
83
+ class At extends Error {
83
84
  constructor(t) {
84
85
  super("form validate error, get errors by error.errors");
85
- u(this, "errors", {});
86
+ g(this, "errors", {});
86
87
  this.errors = t;
87
88
  }
88
89
  }
89
- function bt(s) {
90
- return Object.defineProperty(
91
- (...e) => typeof e[e.length - 1] == "function" ? s.apply(this, e) : new Promise((t, r) => (e[e.length] = (i, l) => {
92
- if (i) return r(new Vt(i));
93
- t(l);
94
- }, e.length++, s.apply(this, e))),
95
- "name",
96
- { value: s.name }
97
- );
90
+ function Bt(r) {
91
+ return Object.defineProperty((...t) => {
92
+ if (Pt(t[t.length - 1]))
93
+ return r.apply(this, t);
94
+ {
95
+ const s = (n, o) => {
96
+ const i = (a, c) => {
97
+ if (a)
98
+ return o(new At(a));
99
+ n(c);
100
+ };
101
+ return t[t.length] = i, t.length++, r.apply(this, t);
102
+ };
103
+ return new Promise(s);
104
+ }
105
+ }, "name", { value: r.name });
98
106
  }
99
- function K(s) {
100
- return Ue(s, (e) => {
101
- if (!M(e) && !T(e))
107
+ function ye(r) {
108
+ return ht(r, (e) => {
109
+ if (!X(e) && !G(e))
102
110
  return e;
103
111
  });
104
112
  }
105
- const vt = (s, e) => Ue(s, (t) => {
106
- if (j(t))
107
- return (r) => t(r, e);
113
+ const Ht = (r, e) => ht(r, (t) => {
114
+ if (ue(t))
115
+ return (s) => t(s, e);
108
116
  });
109
- function N(s, e, t) {
110
- return Oe(s, e, K(t)), s;
117
+ function Q(r, e, t) {
118
+ return gt(r, e, ye(t)), r;
111
119
  }
112
- function ke(s, e = "") {
113
- const t = /* @__PURE__ */ new Set(), r = (i, l = "") => i ? t.has(i) ? [] : (t.add(i), ot(
114
- Object.keys(i).map((n) => (M(i[n]) || T(i[n])) && Object.keys(i[n]).length && !H.isValidElement(i[n]) ? r(i[n], `${l + n}.`) : l + n)
120
+ function rt(r, e = "") {
121
+ const t = /* @__PURE__ */ new Set(), s = (n, o = "") => n ? t.has(n) ? [] : (t.add(n), Rt(
122
+ Object.keys(n).map((i) => (X(n[i]) || G(n[i])) && Object.keys(n[i]).length && !Ve.isValidElement(n[i]) ? s(n[i], `${o + i}.`) : o + i)
115
123
  )) : [];
116
- return r(s, e);
124
+ return s(r, e);
117
125
  }
118
- function ze(s) {
126
+ function Vt(r) {
119
127
  var e;
120
- return ((e = s == null ? void 0 : s.constructor) == null ? void 0 : e.name) === "SyntheticEvent" || (s == null ? void 0 : s.nativeEvent) instanceof Event;
128
+ return ((e = r == null ? void 0 : r.constructor) == null ? void 0 : e.name) === "SyntheticEvent" || (r == null ? void 0 : r.nativeEvent) instanceof Event;
121
129
  }
122
- async function Re(s, e, t, r) {
123
- const i = [...t || []];
124
- let l = 0;
125
- return new Promise(async (n) => {
126
- const o = [], a = async (d) => {
127
- const c = () => l < i.length - 1 ? (l++, a(i[l])) : n({ error: null, warning: o });
128
- if (!d)
129
- return c();
130
- const h = { ...d };
131
- !h.type && !h.validator && (h.type = "string"), new lt({ [s]: [h] }, {
130
+ async function st(r, e, t, s) {
131
+ const n = [...t || []];
132
+ let o = 0;
133
+ return new Promise(async (i) => {
134
+ const a = [], c = async (l) => {
135
+ const m = () => o < n.length - 1 ? (o++, c(n[o])) : i({ error: null, warning: a });
136
+ if (!l)
137
+ return m();
138
+ const d = { ...l };
139
+ !d.type && !d.validator && (d.type = "string"), new Wt({ [r]: [d] }, {
132
140
  ignoreEmptyString: !0,
133
- validateMessages: r
134
- }).validate({ [s]: e }, (F) => {
135
- if (F)
136
- if (d.validateLevel === "warning")
137
- o.push(F[s].message);
141
+ validateMessages: s
142
+ }).validate({ [r]: e }, (S) => {
143
+ if (S)
144
+ if (l.validateLevel === "warning")
145
+ a.push(S[r].message);
138
146
  else
139
- return n({
140
- error: F,
141
- warning: o
147
+ return i({
148
+ error: S,
149
+ warning: a
142
150
  });
143
- return c();
151
+ return m();
144
152
  });
145
153
  };
146
- a(i[l]);
154
+ c(n[o]);
147
155
  });
148
156
  }
149
- function ae(s, e) {
150
- const t = De({}, s, void 0, Object);
151
- return e.some((r) => Le(t, r));
157
+ function We(r, e) {
158
+ const t = dt({}, r, void 0, Object);
159
+ return e.some((s) => ct(t, s));
152
160
  }
153
- const be = "_input";
154
- class yt {
161
+ const Ae = "_input";
162
+ class Jt {
155
163
  constructor() {
156
164
  // 表示的 Form 的提交状态而非单个字段的提交状态。
157
165
  // 只有在触发表单 reset(原生 reset,而非当前的 resetFields) 时,才会回到 init 状态(目前没有支持 form.reset,所以没有这块逻辑)
158
- u(this, "submitStatus", U.init);
159
- u(this, "registerFields", []);
166
+ g(this, "submitStatus", ae.init);
167
+ g(this, "registerFields", []);
160
168
  // 所有 form item value 的变动,都会通知这里注册到的 watcher
161
- u(this, "registerWatchers", []);
169
+ g(this, "registerWatchers", []);
162
170
  // 所有 form item 内部 errors, validating, touched 状态的变化,都会通知这里注册到的 watcher
163
171
  // TODO: 合并 registerWatchers
164
- u(this, "registerStateWatchers", []);
172
+ g(this, "registerStateWatchers", []);
165
173
  // 所有 form 整体 的变动,都会通知这里注册到的 watcher
166
- u(this, "registerFormWatchers", []);
174
+ g(this, "registerFormWatchers", []);
167
175
  // 和formControl 的 touched属性不一样。 只要被改过的字段,这里就会存储。并且不会跟随formControl被卸载而清除。
168
176
  // reset 的时候清除
169
- u(this, "touchedFields", {});
170
- u(this, "store", {});
171
- u(this, "initialValues", {});
172
- u(this, "callbacks", {});
177
+ g(this, "touchedFields", {});
178
+ g(this, "store", {});
179
+ g(this, "initialValues", {});
180
+ g(this, "callbacks", {});
173
181
  // 告知 form 状态改变,进行状态收集
174
- u(this, "innerCollectFormState", () => {
182
+ g(this, "innerCollectFormState", () => {
175
183
  this.notifyStateWatchers();
176
184
  });
177
- u(this, "innerSetCallbacks", (e) => {
185
+ g(this, "innerSetCallbacks", (e) => {
178
186
  this.callbacks = e;
179
187
  });
180
- u(this, "registerFormWatcher", (e) => (this.registerFormWatchers.push(e), () => {
188
+ g(this, "registerFormWatcher", (e) => (this.registerFormWatchers.push(e), () => {
181
189
  this.registerFormWatchers = this.registerFormWatchers.filter(
182
190
  (t) => t !== e
183
191
  );
184
192
  }));
185
- u(this, "registerStateWatcher", (e) => (this.registerStateWatchers.push(e), () => {
193
+ g(this, "registerStateWatcher", (e) => (this.registerStateWatchers.push(e), () => {
186
194
  this.registerStateWatchers = this.registerStateWatchers.filter(
187
195
  (t) => t !== e
188
196
  );
189
197
  }));
190
- u(this, "registerWatcher", (e) => (this.registerWatchers.push(e), () => {
198
+ g(this, "registerWatcher", (e) => (this.registerWatchers.push(e), () => {
191
199
  this.registerWatchers = this.registerWatchers.filter((t) => t !== e);
192
200
  }));
193
201
  // 收集所有control字段,并在组件卸载时移除
194
- u(this, "registerField", (e) => (this.registerFields.push(e), this.notifyWatchers(), () => {
202
+ g(this, "registerField", (e) => (this.registerFields.push(e), this.notifyWatchers(), () => {
195
203
  this.registerFields = this.registerFields.filter((t) => t !== e), this.notifyWatchers();
196
204
  }));
197
205
  // hasField为true时,只返回传入field属性的control实例
198
206
  // isFormList 目前只在校验时需要包含
199
207
  // TODO formlist 实现缺陷,待优化
200
- u(this, "getRegisteredFields", (e, t) => e ? this.registerFields.filter(
201
- (r) => {
202
- var i;
203
- return r.hasFieldProps() && ((t == null ? void 0 : t.containFormList) || !((i = r.props) != null && i.isFormList));
208
+ g(this, "getRegisteredFields", (e, t) => e ? this.registerFields.filter(
209
+ (s) => {
210
+ var n;
211
+ return s.hasFieldProps() && ((t == null ? void 0 : t.containFormList) || !((n = s.props) != null && n.isFormList));
204
212
  }
205
213
  ) : this.registerFields);
206
214
  // 获取props.field === field 的control组件。
207
- u(this, "getRegisteredField", (e) => this.registerFields.filter((t) => t.props.field === e)[0]);
215
+ g(this, "getRegisteredField", (e) => this.registerFields.filter((t) => t.props.field === e)[0]);
208
216
  // 通知所有的FormItem进行更新。
209
217
  // setFieldValue: 外部调用setFieldsValue (setFieldValue等)方法触发更新
210
218
  // innerSetValue: 控件例如Input,通过onChange事件触发的更新
211
219
  // reset:重置
212
- u(this, "notify", (e, t) => {
220
+ g(this, "notify", (e, t) => {
213
221
  (e === "setFieldValue" || e === "innerSetValue" && !t.ignore) && this._pushTouchField(
214
- t.changeValues ? ke(t.changeValues) : this._getIterativelyKeysByField(t.field)
215
- ), this.registerFields.forEach((r) => {
216
- var i;
217
- (i = r == null ? void 0 : r.onStoreChange) == null || i.call(r, e, {
222
+ t.changeValues ? rt(t.changeValues) : this._getIterativelyKeysByField(t.field)
223
+ ), this.registerFields.forEach((s) => {
224
+ var n;
225
+ (n = s == null ? void 0 : s.onStoreChange) == null || n.call(s, e, {
218
226
  ...t,
219
227
  current: this.store
220
228
  });
221
229
  });
222
230
  });
223
- u(this, "innerSetInitialValues", (e) => {
224
- e && (this.initialValues = Me(this.initialValues, K(e)), Object.keys(e).forEach((t) => {
225
- N(this.store, t, e[t]);
231
+ g(this, "innerSetInitialValues", (e) => {
232
+ e && (this.initialValues = ot(this.initialValues, ye(e)), Object.keys(e).forEach((t) => {
233
+ Q(this.store, t, e[t]);
226
234
  }));
227
235
  });
228
- u(this, "innerSetInitialValue", (e, t) => {
229
- e && (this.initialValues[e] = t, this._inTouchFields(e) || N(this.store, e, $(this.initialValues, e)));
236
+ g(this, "innerSetInitialValue", (e, t) => {
237
+ e && (this.initialValues[e] = t, this._inTouchFields(e) || Q(this.store, e, z(this.initialValues, e)));
230
238
  });
231
239
  /**
232
240
  *
233
241
  * 内部使用,更新value,会同时触发onChange 和 onValuesChange
234
242
  * @options.isFormList 强制更新field对应的组件包括其子组件,form
235
243
  */
236
- u(this, "innerSetFieldValue", (e, t, r) => {
237
- if (!e) return;
238
- const i = this.getFields();
239
- N(this.store, e, t), this.triggerValuesChange({
244
+ g(this, "innerSetFieldValue", (e, t, s) => {
245
+ if (!e)
246
+ return;
247
+ const n = this.getFields();
248
+ Q(this.store, e, t), this.triggerValuesChange({
240
249
  [e]: t
241
250
  }), this.triggerTouchChange({ [e]: t }), this.notify("innerSetValue", {
242
- prev: i,
251
+ prev: n,
243
252
  field: e,
244
- ...r,
253
+ ...s,
245
254
  changeValues: { [e]: t }
246
255
  });
247
256
  });
248
257
  // 内部使用
249
- u(this, "innerGetStore", () => this.store);
258
+ g(this, "innerGetStore", () => this.store);
250
259
  // 目前返回提交状态,后续统一维护 errors,warnings 后,这里可进行拓展
251
- u(this, "innerGetStoreStatus", () => ({
260
+ g(this, "innerGetStoreStatus", () => ({
252
261
  submitStatus: this.submitStatus
253
262
  }));
254
263
  // 内部使用,返回原始对象,注入到组件的 value 都从这里获取值,cloneDeep 后的值每次引用地址是不同的
255
- u(this, "innerGetFieldValue", (e) => $(this.store, e));
264
+ g(this, "innerGetFieldValue", (e) => z(this.store, e));
256
265
  // 获取所有被操作过的字段
257
- u(this, "getTouchedFields", () => this.getRegisteredFields(!0).filter((e) => e.isTouched()).map((e) => e.props.field));
266
+ g(this, "getTouchedFields", () => this.getRegisteredFields(!0).filter((e) => e.isTouched()).map((e) => e.props.field));
258
267
  // 外部调用设置表单字段值
259
- u(this, "setFieldValue", (e, t) => {
268
+ g(this, "setFieldValue", (e, t) => {
260
269
  e && this.setFields({
261
270
  [e]: { value: t }
262
271
  });
263
272
  });
264
273
  // 外部调用,设置多个表单控件的值
265
- u(this, "setFieldsValue", (e) => {
266
- if (M(e)) {
267
- const t = Object.keys(e), r = {};
268
- t.forEach((i) => {
269
- r[i] = {
270
- value: e[i]
274
+ g(this, "setFieldsValue", (e) => {
275
+ if (X(e)) {
276
+ const t = Object.keys(e), s = {};
277
+ t.forEach((n) => {
278
+ s[n] = {
279
+ value: e[n]
271
280
  };
272
- }), this.setFields(r);
281
+ }), this.setFields(s);
273
282
  }
274
283
  });
275
284
  // 外部调用,设置多个表单控件的值,以及 error,touch 信息。
276
- u(this, "setFields", (e) => {
277
- const t = Object.keys(e), r = {};
278
- t.forEach((i) => {
279
- const l = e[i], n = this.getFields();
280
- if (l) {
281
- const o = {};
282
- "error" in l && (o.errors = l.error), "warning" in l && (o.warnings = l.warning), "touched" in l && (o.touched = l.touched), "value" in l && (N(this.store, i, l.value), r[i] = l.value), this.notify("setFieldValue", {
283
- data: o,
284
- prev: n,
285
- field: i,
286
- changeValues: { [i]: l.value }
285
+ g(this, "setFields", (e) => {
286
+ const t = Object.keys(e), s = {};
287
+ t.forEach((n) => {
288
+ const o = e[n], i = this.getFields();
289
+ if (o) {
290
+ const a = {};
291
+ "error" in o && (a.errors = o.error), "warning" in o && (a.warnings = o.warning), "touched" in o && (a.touched = o.touched), "value" in o && (Q(this.store, n, o.value), s[n] = o.value), this.notify("setFieldValue", {
292
+ data: a,
293
+ prev: i,
294
+ field: n,
295
+ changeValues: { [n]: o.value }
287
296
  });
288
297
  }
289
- }), this.triggerValuesChange(r);
298
+ }), this.triggerValuesChange(s);
290
299
  });
291
- u(this, "getFieldValue", (e) => K($(this.store, e)));
300
+ g(this, "getFieldValue", (e) => ye(z(this.store, e)));
292
301
  // 获取单个字段的错误信息。
293
- u(this, "getFieldError", (e) => {
302
+ g(this, "getFieldError", (e) => {
294
303
  const t = this.getRegisteredField(e);
295
304
  return t ? t.getErrors() : null;
296
305
  });
297
306
  // 获取传入字段/全部的错误信息
298
- u(this, "getFieldsError", (e) => {
307
+ g(this, "getFieldsError", (e) => {
299
308
  const t = {};
300
- return T(e) ? e.map((r) => {
301
- const i = this.getFieldError(r);
302
- i && (t[r] = i);
309
+ return G(e) ? e.map((s) => {
310
+ const n = this.getFieldError(s);
311
+ n && (t[s] = n);
303
312
  }) : this.getRegisteredFields(!0, { containFormList: !0 }).forEach(
304
- (r) => {
305
- r.getErrors() && (t[r.props.field] = r.getErrors());
313
+ (s) => {
314
+ s.getErrors() && (t[s.props.field] = s.getErrors());
306
315
  }
307
316
  ), t;
308
317
  });
309
- u(this, "getFields", () => K(this.store));
310
- u(this, "getFieldsValue", (e) => {
318
+ g(this, "getFields", () => ye(this.store));
319
+ g(this, "getFieldsValue", (e) => {
311
320
  const t = {};
312
- return T(e) ? (e.forEach((r) => {
313
- N(t, r, this.getFieldValue(r));
314
- }), t) : (this.getRegisteredFields(!0).forEach(({ props: { field: r } }) => {
315
- const i = $(this.store, r);
316
- N(t, r, i);
321
+ return G(e) ? (e.forEach((s) => {
322
+ Q(t, s, this.getFieldValue(s));
323
+ }), t) : (this.getRegisteredFields(!0).forEach(({ props: { field: s } }) => {
324
+ const n = z(this.store, s);
325
+ Q(t, s, n);
317
326
  }), t);
318
327
  });
319
- u(this, "getInitialValues", () => this.initialValues);
320
- u(this, "setInitialValues", (e) => {
328
+ g(this, "getInitialValues", () => this.initialValues);
329
+ g(this, "setInitialValues", (e) => {
321
330
  this.innerSetInitialValues(e), this.setFieldsValue(e);
322
331
  });
323
- u(this, "setInitialValue", (e, t) => {
332
+ g(this, "setInitialValue", (e, t) => {
324
333
  this.innerSetInitialValue(e, t), this.setFieldValue(e, t);
325
334
  });
326
- u(this, "resetFields", (e) => {
327
- const t = this.getFields(), r = $e(e) && !T(e) ? [e] : e;
328
- let i = {};
329
- if (r && T(r))
330
- r.forEach((n) => {
331
- N(
335
+ g(this, "resetFields", (e) => {
336
+ const t = this.getFields(), s = tt(e) && !G(e) ? [e] : e;
337
+ let n = {};
338
+ if (s && G(s))
339
+ s.forEach((i) => {
340
+ Q(
332
341
  this.store,
333
- n,
334
- this.initialValues[n]
335
- ), i[n] = $(this.store, n);
336
- }), this.triggerValuesChange(i), this.notify("reset", { prev: t, field: r }), this._popTouchField(r);
342
+ i,
343
+ this.initialValues[i]
344
+ ), n[i] = z(this.store, i);
345
+ }), this.triggerValuesChange(n), this.notify("reset", { prev: t, field: s }), this._popTouchField(s);
337
346
  else {
338
- const n = {};
339
- i = this.getFields(), Object.keys(this.initialValues).forEach((o) => {
340
- N(n, o, this.initialValues[o]);
341
- }), this.store = n, this.getRegisteredFields(!0).forEach((o) => {
342
- const a = o.props.field;
343
- N(i, a, $(this.store, a));
344
- }), this.triggerValuesChange(i), this._popTouchField(), this.notify("reset", {
347
+ const i = {};
348
+ n = this.getFields(), Object.keys(this.initialValues).forEach((a) => {
349
+ Q(i, a, this.initialValues[a]);
350
+ }), this.store = i, this.getRegisteredFields(!0).forEach((a) => {
351
+ const c = a.props.field;
352
+ Q(n, c, z(this.store, c));
353
+ }), this.triggerValuesChange(n), this._popTouchField(), this.notify("reset", {
345
354
  prev: t,
346
- field: Object.keys(i)
355
+ field: Object.keys(n)
347
356
  });
348
357
  }
349
- const { onReset: l } = this.callbacks;
350
- l == null || l(i);
358
+ const { onReset: o } = this.callbacks;
359
+ o == null || o(n);
351
360
  });
352
- u(this, "validate", bt(
353
- (e, t, r) => {
354
- const i = this.getRegisteredFields(!0, {
361
+ g(this, "validate", Bt(
362
+ (e, t, s) => {
363
+ const n = this.getRegisteredFields(!0, {
355
364
  containFormList: !0
356
- }), l = T(e) && e.length ? i.filter(
357
- (c) => e.indexOf(c.props.field) > -1
358
- ) : i, n = M(e) ? e : M(t) ? t : {}, o = j(e) ? e : j(t) ? t : r || (() => {
359
- }), a = l.map(
360
- (c) => n != null && n.validateOnly ? c.validateFieldOnly() : c.validateField()
361
- ), d = (c) => {
362
- if (!(n != null && n.validateOnly)) {
363
- const { onValidateFail: h } = this.callbacks;
364
- h == null || h(c);
365
+ }), o = G(e) && e.length ? n.filter(
366
+ (m) => e.indexOf(m.props.field) > -1
367
+ ) : n, i = X(e) ? e : X(t) ? t : {}, a = ue(e) ? e : ue(t) ? t : s || (() => {
368
+ }), c = o.map(
369
+ (m) => i != null && i.validateOnly ? m.validateFieldOnly() : m.validateField()
370
+ ), l = (m) => {
371
+ if (!(i != null && i.validateOnly)) {
372
+ const { onValidateFail: d } = this.callbacks;
373
+ d == null || d(m);
365
374
  }
366
375
  };
367
- Promise.all(a).then((c) => {
368
- let h = {};
369
- const m = {};
370
- c.map((V) => {
371
- var p;
372
- V.error && (h = { ...h, ...V.error });
373
- const g = this.getRegisteredField(V.field);
374
- (p = g == null ? void 0 : g.props) != null && p.isFormList || N(m, V.field, V.value);
376
+ return Promise.all(c).then((m) => {
377
+ let d = {};
378
+ const f = {};
379
+ m.map((T) => {
380
+ var F;
381
+ T.error && (d = { ...d, ...T.error });
382
+ const C = this.getRegisteredField(T.field);
383
+ (F = C == null ? void 0 : C.props) != null && F.isFormList || Q(f, T.field, T.value);
375
384
  });
376
- let F;
377
- return Object.keys(h).length ? (d == null || d(h), F = o == null ? void 0 : o(h, K(m))) : F = o == null ? void 0 : o(null, K(m)), F;
385
+ let S;
386
+ return Object.keys(d).length ? (l == null || l(d), S = a == null ? void 0 : a(d, ye(f))) : S = a == null ? void 0 : a(null, ye(f)), S;
387
+ }).catch((m) => m).finally(() => {
378
388
  });
379
389
  }
380
390
  ));
381
- u(this, "toggleSubmitStatus", (e) => {
391
+ g(this, "toggleSubmitStatus", (e) => {
382
392
  this.submitStatus = e, this.innerCollectFormState(), this.notifyFormWatcher();
383
393
  });
384
- u(this, "submit", () => (this.toggleSubmitStatus(U.submitting), this.validate((e, t) => {
385
- let r;
386
- const { onSubmit: i, onSubmitFailed: l } = this.callbacks;
387
- !e && i && (r = i(t)), e && l && (r = l(e)), r && r.then ? r.then((n) => (this.toggleSubmitStatus(U.success), n)).catch((n) => (this.toggleSubmitStatus(U.error), Promise.reject(n))) : this.toggleSubmitStatus(
388
- e ? U.error : U.success
389
- );
390
- })));
391
- u(this, "getFieldsState", (e) => {
392
- const t = {}, r = (i) => {
393
- if (!i)
394
+ g(this, "submit", () => {
395
+ this.toggleSubmitStatus(ae.submitting);
396
+ const e = (t, s) => {
397
+ let n;
398
+ const { onSubmit: o, onSubmitFailed: i } = this.callbacks;
399
+ return !t && o && (n = o(s)), t && i && (n = i(t)), n && n.then ? n.then((a) => (this.toggleSubmitStatus(ae.success), a)).catch((a) => (this.toggleSubmitStatus(ae.error), Promise.reject(a))) : this.toggleSubmitStatus(
400
+ t ? ae.error : ae.success
401
+ ), n;
402
+ };
403
+ return this.validate(e);
404
+ });
405
+ g(this, "getFieldsState", (e) => {
406
+ const t = {}, s = (n) => {
407
+ if (!n)
394
408
  return null;
395
- const l = i.getErrors();
409
+ const o = n.getErrors();
396
410
  return {
397
- errors: l ? [l] : [],
398
- warnings: i.getWarnings(),
399
- validateStatus: i.getValidateStatus(),
400
- isSubmitting: this.submitStatus === U.submitting,
401
- isTouched: i.isTouched(),
402
- value: this.getFieldValue(i.props.field)
411
+ errors: o ? [o] : [],
412
+ warnings: n.getWarnings(),
413
+ validateStatus: n.getValidateStatus(),
414
+ isSubmitting: this.submitStatus === ae.submitting,
415
+ isTouched: n.isTouched(),
416
+ value: this.getFieldValue(n.props.field)
403
417
  };
404
418
  };
405
- return T(e) ? (e.forEach((i) => {
406
- t[i] = r(this.getRegisteredField(i));
407
- }), t) : (this.getRegisteredFields(!0).forEach((i) => {
408
- t[i.props.field] = r(i);
419
+ return G(e) ? (e.forEach((n) => {
420
+ t[n] = s(this.getRegisteredField(n));
421
+ }), t) : (this.getRegisteredFields(!0).forEach((n) => {
422
+ t[n.props.field] = s(n);
409
423
  }), t);
410
424
  });
411
- u(this, "clearFields", (e) => {
412
- const t = this.getFields(), r = $e(e) && !T(e) ? [e] : e;
413
- if (r && T(r)) {
414
- const i = {};
415
- r.forEach((l) => {
416
- N(this.store, l, void 0), i[l] = $(this.store, l);
417
- }), this.triggerValuesChange(i), this.notify("setFieldValue", {
425
+ g(this, "clearFields", (e) => {
426
+ const t = this.getFields(), s = tt(e) && !G(e) ? [e] : e;
427
+ if (s && G(s)) {
428
+ const n = {};
429
+ s.forEach((o) => {
430
+ Q(this.store, o, void 0), n[o] = z(this.store, o);
431
+ }), this.triggerValuesChange(n), this.notify("setFieldValue", {
418
432
  prev: t,
419
- field: r,
433
+ field: s,
420
434
  data: {
421
435
  errors: null,
422
436
  warnings: null
423
437
  }
424
438
  });
425
439
  } else {
426
- const i = {};
427
- this.store = {}, this.getRegisteredFields(!0).forEach((l) => {
428
- const n = l.props.field;
429
- N(i, n, void 0);
430
- }), this.triggerValuesChange(i), this.notify("setFieldValue", {
440
+ const n = {};
441
+ this.store = {}, this.getRegisteredFields(!0).forEach((o) => {
442
+ const i = o.props.field;
443
+ Q(n, i, void 0);
444
+ }), this.triggerValuesChange(n), this.notify("setFieldValue", {
431
445
  prev: t,
432
- field: Object.keys(i),
446
+ field: Object.keys(n),
433
447
  data: {
434
448
  errors: null,
435
449
  warnings: null
@@ -470,45 +484,45 @@ class yt {
470
484
  _getIterativelyKeysByField(e) {
471
485
  if (!e)
472
486
  return [];
473
- const r = [].concat(e).map((i) => ke(N({}, i, void 0))).reduce((i, l) => i.concat(l), []);
474
- return [e, ...r];
487
+ const s = [].concat(e).map((n) => rt(Q({}, n, void 0))).reduce((n, o) => n.concat(o), []);
488
+ return [e, ...s];
475
489
  }
476
490
  _inTouchFields(e) {
477
- return this._getIterativelyKeysByField(e).some((r) => Le(this.touchedFields, r));
491
+ return this._getIterativelyKeysByField(e).some((s) => ct(this.touchedFields, s));
478
492
  }
479
493
  _popTouchField(e) {
480
494
  e === void 0 && (this.touchedFields = {});
481
495
  const t = this._getIterativelyKeysByField(e);
482
- this.touchedFields = nt(this.touchedFields, t);
496
+ this.touchedFields = Nt(this.touchedFields, t);
483
497
  }
484
498
  _pushTouchField(e) {
485
499
  [].concat(e).forEach((t) => {
486
- De(this.touchedFields, t, void 0, Object);
500
+ dt(this.touchedFields, t, void 0, Object);
487
501
  });
488
502
  }
489
503
  }
490
- function Ct() {
491
- const s = new yt();
504
+ function Qt() {
505
+ const r = new Jt();
492
506
  return {
493
- getFieldsValue: s.getFieldsValue,
494
- getFieldValue: s.getFieldValue,
495
- getFieldError: s.getFieldError,
496
- getFieldsError: s.getFieldsError,
497
- getTouchedFields: s.getTouchedFields,
498
- getFields: s.getFields,
499
- getInitialValues: s.getInitialValues,
500
- setInitialValues: s.setInitialValues,
501
- setInitialValue: s.setInitialValue,
502
- setFieldValue: s.setFieldValue,
503
- setFieldsValue: s.setFieldsValue,
504
- setFields: s.setFields,
505
- resetFields: s.resetFields,
506
- clearFields: s.clearFields,
507
- submit: s.submit,
508
- validate: s.validate,
507
+ getFieldsValue: r.getFieldsValue,
508
+ getFieldValue: r.getFieldValue,
509
+ getFieldError: r.getFieldError,
510
+ getFieldsError: r.getFieldsError,
511
+ getTouchedFields: r.getTouchedFields,
512
+ getFields: r.getFields,
513
+ getInitialValues: r.getInitialValues,
514
+ setInitialValues: r.setInitialValues,
515
+ setInitialValue: r.setInitialValue,
516
+ setFieldValue: r.setFieldValue,
517
+ setFieldsValue: r.setFieldsValue,
518
+ setFields: r.setFields,
519
+ resetFields: r.resetFields,
520
+ clearFields: r.clearFields,
521
+ submit: r.submit,
522
+ validate: r.validate,
509
523
  scrollToField: () => {
510
524
  },
511
- getFieldsState: s.getFieldsState,
525
+ getFieldsState: r.getFieldsState,
512
526
  getInnerMethods: (e) => {
513
527
  const t = {};
514
528
  return e && [
@@ -524,21 +538,21 @@ function Ct() {
524
538
  "innerGetStoreStatus",
525
539
  "innerGetFieldValue",
526
540
  "innerCollectFormState"
527
- ].map((r) => {
528
- t[r] = s[r];
541
+ ].map((s) => {
542
+ t[s] = r[s];
529
543
  }), t;
530
544
  }
531
545
  };
532
546
  }
533
- function Ae(s) {
534
- const e = L(s);
535
- return e.current || (s ? e.current = s : e.current = Ct()), [e.current];
547
+ function bt(r) {
548
+ const e = R(r);
549
+ return e.current || (r ? e.current = r : e.current = Qt()), [e.current];
536
550
  }
537
- function Fe(s, e) {
551
+ function je(r, e) {
538
552
  const t = e.replace(/[[.]/g, "_").replace(/\]/g, "");
539
- return s ? `${s}-${t}` : `${t}`;
553
+ return r ? `${r}-${t}` : `${t}`;
540
554
  }
541
- const It = {
555
+ const Xt = {
542
556
  layout: "horizontal",
543
557
  labelCol: { span: 5, offset: 0 },
544
558
  labelAlign: "right",
@@ -546,106 +560,106 @@ const It = {
546
560
  requiredSymbol: !0,
547
561
  wrapper: "form",
548
562
  validateTrigger: "onChange"
549
- }, wt = (s, e) => {
550
- var X, B;
551
- const t = O(xe), r = O(qe), i = L(null), [l] = Ae(
552
- s.form
553
- ), n = it(
554
- s,
555
- It,
556
- (X = t.componentConfig) == null ? void 0 : X.Form
563
+ }, Zt = (r, e) => {
564
+ var K, B;
565
+ const t = re(qe), s = re(Ft), n = R(null), [o] = bt(
566
+ r.form
567
+ ), i = ze(
568
+ r,
569
+ Xt,
570
+ (K = t.componentConfig) == null ? void 0 : K.Form
557
571
  ), {
558
- layout: o,
559
- labelCol: a,
560
- wrapperCol: d,
561
- wrapper: c,
562
- id: h,
563
- requiredSymbol: m,
564
- labelAlign: F,
565
- disabled: V,
566
- colon: g,
567
- className: p,
568
- validateTrigger: v,
569
- prefixCls: y,
570
- validateMessages: w,
571
- ...k
572
- } = n, R = y || t.getPrefixCls("form"), Q = t.rtl, ne = "size" in n ? n.size : t.size, le = l.getInnerMethods(!0);
573
- st(() => {
574
- le.innerSetInitialValues(n.initialValues);
575
- }), ie(() => {
576
- let S;
577
- return r.register && (S = r.register(n.id, l)), S;
578
- }, [n.id, l]), l.scrollToField = (S, W) => {
579
- const C = i.current, P = n.id;
580
- if (!C)
572
+ layout: a,
573
+ labelCol: c,
574
+ wrapperCol: l,
575
+ wrapper: m,
576
+ id: d,
577
+ requiredSymbol: f,
578
+ labelAlign: S,
579
+ disabled: T,
580
+ colon: C,
581
+ className: F,
582
+ validateTrigger: I,
583
+ prefixCls: _,
584
+ validateMessages: N,
585
+ ...E
586
+ } = i, $ = _ || t.getPrefixCls("form"), A = t.rtl, Y = "size" in i ? i.size : t.size, se = o.getInnerMethods(!0);
587
+ kt(() => {
588
+ se.innerSetInitialValues(i.initialValues);
589
+ }), Se(() => {
590
+ let p;
591
+ return s.register && (p = s.register(i.id, o)), p;
592
+ }, [i.id, o]), o.scrollToField = (p, x) => {
593
+ const P = n.current, L = i.id;
594
+ if (!P)
581
595
  return;
582
- let q = C.querySelector(
583
- `#${Fe(P, S)}`
596
+ let ee = P.querySelector(
597
+ `#${je(L, p)}`
584
598
  );
585
- q || (q = C.querySelector(
586
- `#${Fe(P, S)}${be}`
587
- )), q && Ke(q, {
599
+ ee || (ee = P.querySelector(
600
+ `#${je(L, p)}${Ae}`
601
+ )), ee && Et(ee, {
588
602
  behavior: "smooth",
589
603
  block: "nearest",
590
604
  scrollMode: "if-needed",
591
- ...W
605
+ ...x
592
606
  });
593
- }, le.innerSetCallbacks({
594
- onValuesChange: (S, W) => {
595
- var C, P;
596
- (C = n.onValuesChange) == null || C.call(n, S, W), (P = r.onFormValuesChange) == null || P.call(r, n.id, S);
607
+ }, se.innerSetCallbacks({
608
+ onValuesChange: (p, x) => {
609
+ var P, L;
610
+ (P = i.onValuesChange) == null || P.call(i, p, x), (L = s.onFormValuesChange) == null || L.call(s, i.id, p);
597
611
  },
598
- onChange: n.onChange,
599
- onValidateFail: (S) => {
600
- const W = n.scrollToFirstError;
601
- if (W) {
602
- const C = M(W) ? W : {};
603
- l.scrollToField(
604
- Object.keys(S)[0],
605
- C
612
+ onChange: i.onChange,
613
+ onValidateFail: (p) => {
614
+ const x = i.scrollToFirstError;
615
+ if (x) {
616
+ const P = X(x) ? x : {};
617
+ o.scrollToField(
618
+ Object.keys(p)[0],
619
+ P
606
620
  );
607
621
  }
608
622
  },
609
- onSubmitFailed: n.onSubmitFailed,
610
- onSubmit: (S) => {
611
- var C, P;
612
- const W = (C = n.onSubmit) == null ? void 0 : C.call(n, S);
613
- return (P = r.onFormSubmit) == null || P.call(r, n.id, S), W;
623
+ onSubmitFailed: i.onSubmitFailed,
624
+ onSubmit: (p) => {
625
+ var P, L;
626
+ const x = (P = i.onSubmit) == null ? void 0 : P.call(i, p);
627
+ return (L = s.onFormSubmit) == null || L.call(s, i.id, p), x;
614
628
  },
615
- onReset: (S) => {
616
- var C, P;
617
- const W = (C = n.onReset) == null ? void 0 : C.call(n, S);
618
- return (P = r == null ? void 0 : r.onFormReset) == null || P.call(r, n.id, S), W;
629
+ onReset: (p) => {
630
+ var P, L;
631
+ const x = (P = i.onReset) == null ? void 0 : P.call(i, p);
632
+ return (L = s == null ? void 0 : s.onFormReset) == null || L.call(s, i.id, p), x;
619
633
  }
620
634
  });
621
- const he = {
622
- requiredSymbol: m,
623
- labelAlign: F,
624
- disabled: V,
625
- colon: g,
626
- labelCol: a,
627
- wrapperCol: d,
628
- layout: o,
629
- store: l,
630
- prefixCls: R,
631
- validateTrigger: v,
632
- validateMessages: Me(
635
+ const ce = {
636
+ requiredSymbol: f,
637
+ labelAlign: S,
638
+ disabled: T,
639
+ colon: C,
640
+ labelCol: c,
641
+ wrapperCol: l,
642
+ layout: a,
643
+ store: o,
644
+ prefixCls: $,
645
+ validateTrigger: I,
646
+ validateMessages: ot(
633
647
  {},
634
648
  (B = t.locale.Form) == null ? void 0 : B.validateMessages,
635
- w
649
+ N
636
650
  ),
637
- getFormElementId: (S) => Fe(h, S)
638
- }, oe = se;
639
- return et(e, () => ({
640
- ...l,
651
+ getFormElementId: (p) => je(d, p)
652
+ }, ne = we;
653
+ return at(e, () => ({
654
+ ...o,
641
655
  getRootDOMNode() {
642
- return i.current;
656
+ return n.current;
643
657
  }
644
- })), /* @__PURE__ */ f(rt, { ...t, size: ne, children: /* @__PURE__ */ f(oe.Provider, { value: he, children: /* @__PURE__ */ f(
645
- c,
658
+ })), /* @__PURE__ */ V(Tt, { ...t, size: Y, children: /* @__PURE__ */ V(ne.Provider, { value: ce, children: /* @__PURE__ */ V(
659
+ m,
646
660
  {
647
- ref: i,
648
- ..._e(k, [
661
+ ref: n,
662
+ ...ut(E, [
649
663
  "form",
650
664
  "size",
651
665
  "initialValues",
@@ -657,270 +671,294 @@ const It = {
657
671
  "onSubmitFailed",
658
672
  "onReset"
659
673
  ]),
660
- ...n.wrapperProps,
661
- className: G(
662
- R,
663
- `${R}-${o}`,
664
- `${R}-size-${ne}`,
665
- { [`${R}-rtl`]: Q },
666
- p
674
+ ...i.wrapperProps,
675
+ className: ge(
676
+ $,
677
+ `${$}-${a}`,
678
+ `${$}-size-${Y}`,
679
+ { [`${$}-rtl`]: A },
680
+ F
667
681
  ),
668
- style: n.style,
669
- onSubmit: (S) => {
670
- S.preventDefault(), S.stopPropagation(), l.submit();
682
+ style: i.style,
683
+ onSubmit: (p) => {
684
+ p.preventDefault(), p.stopPropagation(), o.submit();
671
685
  },
672
- onReset: (S) => {
673
- S.preventDefault(), S.stopPropagation(), l.resetFields();
686
+ onReset: (p) => {
687
+ p.preventDefault(), p.stopPropagation(), o.resetFields();
674
688
  },
675
- id: h,
676
- children: n.children
689
+ id: d,
690
+ children: i.children
677
691
  }
678
692
  ) }) });
679
- }, Be = Ve(wt);
680
- Be.displayName = "Form";
681
- class z extends tt {
682
- constructor(t, r) {
683
- var i, l;
684
- super(t);
685
- u(this, "context");
686
- // 校验信息
687
- u(this, "errors", null);
688
- // 校验 warning 信息
689
- u(this, "warnings", null);
690
- // undefined => validating => success / error => (validating or undefined)
691
- u(this, "validateStatus");
692
- // 是否被用户操作过
693
- u(this, "touched");
694
- u(this, "isDestroyed", !1);
695
- // 保存 props.children 或函数类型 props.children() 的返回值
696
- u(this, "childrenElement", null);
697
- u(this, "removeRegisterField");
698
- // 触发 store 进行状态收集
699
- // TODO: error, validateStatus ,touched 状态和 UI 组件解耦,统一维护在 store 内部
700
- u(this, "triggerStateCollect", () => {
701
- const { innerCollectFormState: t } = this.context.store.getInnerMethods(!0);
702
- t();
703
- });
704
- // 切换校验状态
705
- u(this, "toggleValidateStatus", (t) => {
706
- this.validateStatus = t, this.triggerStateCollect();
707
- });
708
- // 切换 touch 状态
709
- u(this, "toggleTouched", (t) => {
710
- this.touched = ht(t) ? t : !this.touched, this.triggerStateCollect();
711
- });
712
- u(this, "setWarnings", (t) => {
713
- this.warnings = t, this.triggerStateCollect();
714
- });
715
- u(this, "setErrors", (t) => {
716
- this.errors = t, this.triggerStateCollect();
717
- });
718
- u(this, "getErrors", () => this.errors);
719
- u(this, "getWarnings", () => this.warnings || []);
720
- u(this, "isTouched", () => this.touched);
721
- u(this, "getValidateStatus", () => this.props.validateStatus ? this.props.validateStatus : this.validateStatus);
722
- u(this, "hasFieldProps", () => !!this.props.field);
723
- u(this, "clearFormItemError", (t = this.props.field) => {
724
- const { updateFormItem: r } = this.context;
725
- r == null || r(t, { errors: null, warnings: null });
726
- });
727
- u(this, "updateFormItem", () => {
728
- if (this.isDestroyed) return;
729
- this.forceUpdate();
730
- const { updateFormItem: t } = this.context;
731
- t == null || t(this.props.field, {
732
- errors: this.errors,
733
- warnings: this.warnings
734
- });
735
- });
736
- u(this, "getFieldValue", () => {
737
- const t = this.props.field, r = this.context.store;
738
- return t ? r.getInnerMethods(!0).innerGetFieldValue(t) : void 0;
693
+ }, St = _e(Zt);
694
+ St.displayName = "Form";
695
+ const Yt = {
696
+ trigger: "onChange",
697
+ triggerPropName: "value"
698
+ };
699
+ function Kt(r, e) {
700
+ var Te, ke, He;
701
+ const t = re(Oe), { prefixCls: s, getFormElementId: n, store: o } = t ?? {}, {
702
+ getPrefixCls: i,
703
+ componentConfig: a,
704
+ rtl: c
705
+ } = re(qe), l = ze(
706
+ r,
707
+ Yt,
708
+ a == null ? void 0 : a.FormControl
709
+ ), { noStyle: m, field: d, isFormList: f, hasFeedback: S } = l, T = mt();
710
+ Dt();
711
+ const C = R({
712
+ get props() {
713
+ return l;
714
+ },
715
+ get context() {
716
+ return t;
717
+ },
718
+ get errors() {
719
+ return F.current;
720
+ },
721
+ get warnings() {
722
+ return I.current;
723
+ },
724
+ get touched() {
725
+ return N.current;
726
+ },
727
+ get childrenElement() {
728
+ return A.current;
729
+ },
730
+ triggerStateCollect: se,
731
+ toggleValidateStatus: ce,
732
+ toggleTouched: ne,
733
+ setWarnings: K,
734
+ setErrors: B,
735
+ getErrors: p,
736
+ getWarnings: x,
737
+ isTouched: P,
738
+ getValidateStatus: L,
739
+ hasFieldProps: ee,
740
+ clearFormItemError: fe,
741
+ updateFormItem: te,
742
+ getFieldValue: Fe,
743
+ onStoreChange: Ee,
744
+ innerSetFieldValue: j,
745
+ validateFieldOnly: W,
746
+ validateField: O,
747
+ handleTrigger: ie,
748
+ getChild: D
749
+ }), F = R(null), I = R(null), _ = R(), N = R(!1), E = R(!1), $ = R(!1), A = R(null), Y = R(
750
+ (He = (ke = (Te = o == null ? void 0 : o.getInnerMethods) == null ? void 0 : Te.call(o, !0)) == null ? void 0 : ke.registerField) == null ? void 0 : He.call(ke, C.current)
751
+ );
752
+ function se() {
753
+ var y;
754
+ const { store: h } = t ?? {}, { innerCollectFormState: u } = ((y = h == null ? void 0 : h.getInnerMethods) == null ? void 0 : y.call(h, !0)) ?? {};
755
+ u == null || u();
756
+ }
757
+ function ce(h) {
758
+ _.current = h, se();
759
+ }
760
+ function ne(h) {
761
+ N.current = Ut(h) ? h : !N.current, se();
762
+ }
763
+ function K(h) {
764
+ I.current = h, se();
765
+ }
766
+ function B(h) {
767
+ F.current = h, se();
768
+ }
769
+ function p() {
770
+ return F.current;
771
+ }
772
+ function x() {
773
+ return I.current || [];
774
+ }
775
+ function P() {
776
+ return N.current;
777
+ }
778
+ function L() {
779
+ return l.validateStatus ? l.validateStatus : _.current;
780
+ }
781
+ function ee() {
782
+ return !!l.field;
783
+ }
784
+ function fe(h = l.field) {
785
+ const { updateFormItem: u } = t ?? {};
786
+ u == null || u(h, { errors: null, warnings: null });
787
+ }
788
+ function te() {
789
+ if ($.current)
790
+ return;
791
+ T();
792
+ const { updateFormItem: h } = t ?? {};
793
+ h == null || h(l.field, {
794
+ errors: F.current,
795
+ warnings: I.current
739
796
  });
740
- u(this, "onStoreChange", (t, r) => {
741
- const i = T(r.field) ? r.field : [r.field], { field: l, shouldUpdate: n, dependencies: o } = this.props, a = (d) => {
742
- if (o && n && re(!0, "`shouldUpdate` of the `Form.Item` will be ignored."), o)
743
- (T(o) || o.some(
744
- (c) => ae(c, i)
745
- )) && this.isTouched() && this.validateField();
746
- else if (n) {
747
- let c = !1;
748
- j(n) ? c = n(r.prev, r.current, {
749
- field: r.field,
750
- ...d
751
- }) : c = !pe(r.prev, r.current), c && this.updateFormItem();
752
- }
753
- };
754
- switch (t) {
755
- case "reset":
756
- this.toggleTouched(!1), this.toggleValidateStatus(void 0), this.setErrors(null), this.setWarnings(null), o || n ? a() : this.updateFormItem();
757
- break;
758
- case "innerSetValue":
759
- if (ae(l, i)) {
760
- this.toggleTouched(!0), this.updateFormItem();
761
- return;
762
- }
763
- a({
764
- isInner: !0,
765
- isFormList: r.isFormList
766
- });
767
- break;
768
- case "setFieldValue":
769
- if (ae(l, i)) {
770
- this.toggleTouched(!0), r.data && "touched" in r.data && this.toggleTouched(r.data.touched), r.data && "warnings" in r.data && this.setWarnings(
771
- gt(r.data.warnings) ? [] : [].concat(r.data.warnings)
772
- ), r.data && "errors" in r.data ? this.setErrors(r.data.errors) : pe($(r.prev, l), $(r.current, l)) || this.setErrors(null), this.updateFormItem();
773
- return;
774
- }
775
- a();
776
- break;
797
+ }
798
+ function Fe() {
799
+ var b, v, k;
800
+ const { field: h } = l ?? {}, { store: u } = t ?? {};
801
+ return h ? (k = (v = (b = u == null ? void 0 : u.getInnerMethods) == null ? void 0 : b.call(u, !0)) == null ? void 0 : v.innerGetFieldValue) == null ? void 0 : k.call(v, h) : void 0;
802
+ }
803
+ function Ee(h, u) {
804
+ const y = G(u.field) ? u.field : [u.field], { field: b, shouldUpdate: v, dependencies: k } = l, H = (Z) => {
805
+ if (k && v && Ie(!0, "`shouldUpdate` of the `Form.Item` will be ignored."), k)
806
+ G(k) && k.some((U) => We(U, y)) && P() && O();
807
+ else if (v) {
808
+ let U = !1;
809
+ ue(v) ? U = v(u.prev, u.current, {
810
+ field: u.field,
811
+ ...Z
812
+ }) : U = !Ge(u.prev, u.current), U && te();
777
813
  }
778
- });
779
- u(this, "innerSetFieldValue", (t, r) => {
780
- var o, a;
781
- if (!t) return;
782
- const { store: i } = this.context;
783
- i.getInnerMethods(!0).innerSetFieldValue(t, r);
784
- const n = {};
785
- Oe(n, t, r), (a = (o = this.props) == null ? void 0 : o.onValuesChange) == null || a.call(o, n, {
786
- ...i.getFieldsValue()
787
- });
788
- });
789
- // 仅仅校验下值,不做任何状态变更
790
- u(this, "validateFieldOnly", () => {
791
- const { validateMessages: t } = this.context, { field: r, rules: i } = this.props, l = this.getFieldValue();
792
- return Re(r, l, i, t).then(
793
- ({ error: n, warning: o }) => Promise.resolve({ error: n, value: l, warning: o, field: r })
794
- );
795
- });
796
- /**
797
- *
798
- * @param triggerType the value of validateTrigger.
799
- * @returns
800
- */
801
- u(this, "validateField", (t) => {
802
- const { validateTrigger: r, validateMessages: i } = this.context, { field: l, rules: n, validateTrigger: o } = this.props, a = this.getFieldValue(), d = () => {
803
- var m;
804
- const h = this.errors || ((m = this.warnings) == null ? void 0 : m.length);
805
- this.toggleValidateStatus("validating"), this.setErrors(null), this.setWarnings(null), h && this.updateFormItem();
806
- }, c = t ? (n || []).filter((h) => [].concat(
807
- h.validateTrigger || o || r
808
- ).indexOf(t) > -1) : n;
809
- return c && c.length && l ? (d(), Re(l, a, c, i).then(
810
- ({ error: h, warning: m }) => {
811
- var F;
812
- return this.setErrors(h ? h[l] : null), this.setWarnings(m || null), this.toggleValidateStatus(
813
- this.errors ? "error" : (F = this.warnings) != null && F.length ? "warning" : "success"
814
- ), this.updateFormItem(), Promise.resolve({ error: h, value: a, field: l });
814
+ };
815
+ switch (h) {
816
+ case "reset":
817
+ ne(!1), ce(void 0), B(null), K(null), k || v ? H() : te();
818
+ break;
819
+ case "innerSetValue":
820
+ if (We(b, y)) {
821
+ ne(!0), te();
822
+ return;
815
823
  }
816
- )) : Promise.resolve({ error: null, value: a, field: l });
817
- });
818
- // 每次 render 都会作为 onChange 传递给 children,需要保证引用地址不变
819
- // 所以 handleTrigger 需要声明在类上,并且直接作为 children.props.onChange
820
- u(this, "handleTrigger", (t, ...r) => {
821
- const i = this.childrenElement || this.props.children, { store: l } = this.context, { field: n, trigger: o, normalize: a, getValueFromEvent: d } = this.props, c = j(d) ? d(t, ...r) : t;
822
- let h = c;
823
- if (ze(c)) {
824
- re(
825
- !0,
826
- "changed value missed, please check whether extra elements is outta input/select controled by Form.Item"
827
- ), c.stopPropagation();
828
- return;
829
- }
830
- typeof a == "function" && (h = a(c, l.getFieldValue(n), {
831
- ...l.getFieldsValue()
832
- })), this.toggleTouched(!0), this.innerSetFieldValue(n, h), this.validateField(o), fe(i) && i.props && i.props[o] && (this.props.isFormList || i.props[o](h, ...r));
833
- });
834
- u(this, "getChild", () => {
835
- const { children: t } = this.props, { store: r } = this.context;
836
- let i = t;
837
- return j(t) && (i = t(
838
- r.getFields(),
839
- {
840
- ...r
841
- },
842
- this.props.isFormList && {
843
- value: this.getFieldValue(),
844
- onChange: this.handleTrigger
824
+ H({
825
+ isInner: !0,
826
+ isFormList: u.isFormList
827
+ });
828
+ break;
829
+ case "setFieldValue":
830
+ if (We(b, y)) {
831
+ ne(!0), u.data && "touched" in u.data && ne(u.data.touched), u.data && "warnings" in u.data && K(
832
+ jt(u.data.warnings) ? [] : [].concat(u.data.warnings)
833
+ ), u.data && "errors" in u.data ? B(u.data.errors) : Ge(z(u.prev, b), z(u.current, b)) || B(null), te();
834
+ return;
845
835
  }
846
- )), this.childrenElement = i, i;
836
+ H();
837
+ break;
838
+ }
839
+ }
840
+ function j(h, u) {
841
+ var k;
842
+ if (!h)
843
+ return;
844
+ const { store: y } = t ?? {};
845
+ y.getInnerMethods(!0).innerSetFieldValue(h, u);
846
+ const v = {};
847
+ gt(v, h, u), (k = l.onValuesChange) == null || k.call(l, v, {
848
+ ...y.getFieldsValue()
847
849
  });
848
- "initialValue" in t && this.hasFieldProps() && ((l = (i = r == null ? void 0 : r.store) == null ? void 0 : i.setInitialValue) == null || l.call(i, t.field, t.initialValue));
849
850
  }
850
- componentDidMount() {
851
- const { store: t } = this.context ?? {};
852
- if (t) {
853
- const r = t.getInnerMethods(!0);
854
- this.removeRegisterField = r.registerField(this);
855
- }
856
- this.isDestroyed = !1;
851
+ function W() {
852
+ const { validateMessages: h } = t ?? {}, { field: u, rules: y } = l, b = Fe();
853
+ return st(u, b, y, h).then(
854
+ ({ error: v, warning: k }) => Promise.resolve({ error: v, value: b, warning: k, field: u })
855
+ );
857
856
  }
858
- componentDidUpdate(t) {
859
- (t.field !== this.props.field && this.props._key && t._key === this.props._key || /* 以下条件判断潘启宝添加于 2023年10月23日 星期一 13时10分43秒 CST */
860
- this.props.disabled !== t.disabled && this.props.disabled || this.props.rules !== t.rules && !this.props.rules) && (this.updateFormItem(), this.clearFormItemError(t.field));
857
+ function O(h) {
858
+ const { validateTrigger: u, validateMessages: y } = t ?? {}, { field: b, rules: v, validateTrigger: k } = l, H = Fe(), Z = () => {
859
+ var J;
860
+ const q = F.current || ((J = I.current) == null ? void 0 : J.length);
861
+ ce("validating"), B(null), K(null), q && te();
862
+ }, U = h ? (v || []).filter((q) => [].concat(
863
+ q.validateTrigger || k || u
864
+ ).indexOf(h) > -1) : v;
865
+ return U && U.length && b ? (Z(), st(b, H, U, y).then(
866
+ ({ error: q, warning: J }) => {
867
+ var oe;
868
+ return B(q ? q[b] : null), K(J || null), ce(
869
+ F.current ? "error" : (oe = I.current) != null && oe.length ? "warning" : "success"
870
+ ), te(), Promise.resolve({ error: q, value: H, field: b });
871
+ }
872
+ )) : Promise.resolve({ error: null, value: H, field: b });
861
873
  }
862
- componentWillUnmount() {
863
- var t;
864
- (t = this.removeRegisterField) == null || t.call(this), this.removeRegisterField = null, this.clearFormItemError(), this.isDestroyed = !0;
874
+ function de() {
875
+ const { validateTrigger: h } = t ?? {}, u = l.validateTrigger || h || "onChange", y = l.rules || [];
876
+ let b = [];
877
+ return y.map((v) => {
878
+ b = b.concat(v.validateTrigger || u);
879
+ }), Array.from(new Set(b));
865
880
  }
866
- /**
867
- * 收集rules里的validateTrigger字段
868
- */
869
- getValidateTrigger() {
870
- const t = this.props.validateTrigger || this.context.validateTrigger || "onChange", r = this.props.rules || [];
871
- let i = [];
872
- return r.map((l) => {
873
- i = i.concat(l.validateTrigger || t);
874
- }), Array.from(new Set(i));
881
+ function ie(h, ...u) {
882
+ var J;
883
+ const y = A.current || l.children, { store: b } = t ?? {}, { field: v, trigger: k, normalize: H, getValueFromEvent: Z } = l, U = ue(Z) ? Z(h, ...u) : h;
884
+ let q = U;
885
+ if (Vt(U)) {
886
+ Ie(
887
+ !0,
888
+ "changed value missed, please check whether extra elements is outta input/select controled by Form.Item"
889
+ ), U.stopPropagation();
890
+ return;
891
+ }
892
+ typeof H == "function" && (q = H(U, b.getFieldValue(v), {
893
+ ...b.getFieldsValue()
894
+ })), ne(!0), j(v, q), O(k), De(y) && ((J = y.props) != null && J[k]) && (l.isFormList || y.props[k](q, ...u));
875
895
  }
876
- renderControl(t, r) {
877
- var g;
878
- const {
879
- field: i,
880
- trigger: l = "onChange",
881
- triggerPropName: n = "value",
882
- validateStatus: o,
883
- formatter: a
884
- } = this.props, { store: d, disabled: c } = this.context, h = "disabled" in this.props ? this.props.disabled : c, m = H.Children.only(t), F = {
896
+ function M(h, u) {
897
+ var Je, Qe, Ne, Xe;
898
+ const { field: y, trigger: b, triggerPropName: v, validateStatus: k, formatter: H } = l, { store: Z, disabled: U } = t ?? {}, q = "disabled" in l ? l.disabled : U, J = Ve.Children.only(h), oe = {
885
899
  // used by label
886
- id: G(((g = m.props) == null ? void 0 : g.id) || { [`${r}${be}`]: r })
900
+ id: ge(((Je = J.props) == null ? void 0 : Je.id) || { [`${u}${Ae}`]: u })
887
901
  };
888
- this.getValidateTrigger().forEach((p) => {
889
- F[p] = (v) => {
890
- var y, w;
891
- this.validateField(p), (w = (y = m.props) == null ? void 0 : y[p]) == null || w.call(y, v);
902
+ de().forEach((xe) => {
903
+ oe[xe] = (Ct) => {
904
+ var Pe, Ze;
905
+ O(xe), (Ze = (Pe = J.props) == null ? void 0 : Pe[xe]) == null || Ze.call(Pe, Ct);
892
906
  };
893
- }), F[l] = this.handleTrigger, h !== void 0 && !("disabled" in m.props) && (F.disabled = h);
894
- let V = $(d.getInnerMethods(!0).innerGetStore(), i);
895
- return j(a) && (V = a(V)), F[n] = V, !o && this.errors && (F.error = !0), H.cloneElement(m, F);
907
+ }), oe[b] = ie, q !== void 0 && !("disabled" in J.props) && (oe.disabled = q);
908
+ let Le = z((Xe = (Ne = (Qe = Z == null ? void 0 : Z.getInnerMethods) == null ? void 0 : Qe.call(Z, !0)) == null ? void 0 : Ne.innerGetStore) == null ? void 0 : Xe.call(Ne), y);
909
+ return ue(H) && (Le = H(Le)), oe[v] = Le, !k && F.current && (oe.error = !0), Ve.cloneElement(J, oe);
896
910
  }
897
- render() {
898
- const { noStyle: t, field: r, isFormList: i, hasFeedback: l } = this.props, n = this.getValidateStatus(), { prefixCls: o, getFormElementId: a } = this.context;
899
- let d = this.getChild();
900
- const c = this.hasFieldProps() ? a == null ? void 0 : a(r) : void 0;
901
- return this.hasFieldProps() && !i && H.Children.count(d) === 1 && (d = this.renderControl(d, c)), t ? d : /* @__PURE__ */ f("div", { className: `${o}-item-control-wrapper`, children: /* @__PURE__ */ f("div", { className: `${o}-item-control`, id: c, children: /* @__PURE__ */ J("div", { className: `${o}-item-control-children`, children: [
902
- d,
903
- n && l && /* @__PURE__ */ J(
904
- "div",
905
- {
906
- className: `${o}-item-feedback ${o}-item-feedback-${n}`,
907
- children: [
908
- n === "warning" && /* @__PURE__ */ f(ut, {}),
909
- n === "success" && /* @__PURE__ */ f(at, {}),
910
- n === "error" && /* @__PURE__ */ f(ct, {}),
911
- n === "validating" && /* @__PURE__ */ f(dt, {})
912
- ]
913
- }
914
- )
915
- ] }) }) });
911
+ function D() {
912
+ var b;
913
+ const { children: h } = l, { store: u } = t ?? {};
914
+ let y = h;
915
+ return ue(h) && (y = h(
916
+ (b = u == null ? void 0 : u.getFields) == null ? void 0 : b.call(u),
917
+ {
918
+ ...u
919
+ },
920
+ l.isFormList && {
921
+ value: Fe(),
922
+ onChange: ie
923
+ }
924
+ )), A.current = y, y;
916
925
  }
926
+ if (at(e, () => ({
927
+ ...C.current
928
+ })), $t(() => {
929
+ var h, u;
930
+ return E.current = !0, "initialValue" in l && ee() && ((u = (h = t == null ? void 0 : t.store) == null ? void 0 : h.setInitialValue) == null || u.call(h, l.field, l.initialValue)), T(), () => {
931
+ E.current = !1;
932
+ };
933
+ }, []), Se(() => (te(), fe(l.field), () => {
934
+ }), [l.field, l._key, l.disabled, l.rules]), Se(() => ($.current = !1, () => {
935
+ var h;
936
+ (h = Y.current) == null || h.call(Y), fe(), $.current = !0;
937
+ }), []), !E.current) return;
938
+ const le = L();
939
+ let he = D();
940
+ const $e = ee() ? n == null ? void 0 : n(d) : void 0;
941
+ return ee() && !f && Ve.Children.count(he) === 1 && (he = M(he, $e)), m ? he : /* @__PURE__ */ V("div", { className: `${s}-item-control-wrapper`, children: /* @__PURE__ */ V("div", { className: `${s}-item-control`, id: $e, children: /* @__PURE__ */ be("div", { className: `${s}-item-control-children`, children: [
942
+ he,
943
+ le && S && /* @__PURE__ */ be(
944
+ "div",
945
+ {
946
+ className: `${s}-item-feedback ${s}-item-feedback-${le}`,
947
+ children: [
948
+ le === "warning" && /* @__PURE__ */ V(Lt, {}),
949
+ le === "success" && /* @__PURE__ */ V(Mt, {}),
950
+ le === "error" && /* @__PURE__ */ V(_t, {}),
951
+ le === "validating" && /* @__PURE__ */ V(xt, {})
952
+ ]
953
+ }
954
+ )
955
+ ] }) }) });
917
956
  }
918
- u(z, "defaultProps", {
919
- trigger: "onChange",
920
- triggerPropName: "value"
921
- }), u(z, "isFormControl", !0), u(z, "contextType", Se);
922
- function Et(s) {
923
- return /* @__PURE__ */ f(
957
+ const pe = _e(Kt);
958
+ pe.isFormControl = !0;
959
+ pe.displayName = "Control";
960
+ function er(r) {
961
+ return /* @__PURE__ */ V(
924
962
  "svg",
925
963
  {
926
964
  width: "1em",
@@ -930,181 +968,184 @@ function Et(s) {
930
968
  fill: "currentColor",
931
969
  stroke: "none",
932
970
  viewBox: "0 0 48 48",
933
- ...s,
934
- children: /* @__PURE__ */ f("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" })
971
+ ...r,
972
+ children: /* @__PURE__ */ V("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" })
935
973
  }
936
974
  );
937
975
  }
938
- const Tt = ({
939
- htmlFor: s,
976
+ const tr = ({
977
+ htmlFor: r,
940
978
  showColon: e,
941
979
  label: t,
942
- requiredSymbol: r,
943
- required: i,
944
- rules: l,
945
- prefix: n,
946
- tooltip: o
980
+ requiredSymbol: s,
981
+ required: n,
982
+ rules: o,
983
+ prefix: i,
984
+ tooltip: a
947
985
  }) => {
948
- const a = T(l) && l.some((m) => m && m.required), d = M(r) ? r.position : "end", c = (i || a) && !!r && /* @__PURE__ */ f("strong", { className: `${n}-form-item-symbol`, children: /* @__PURE__ */ f(Et, {}) }), h = () => {
949
- if (!o)
986
+ const c = G(o) && o.some((f) => f && f.required), l = X(s) ? s.position : "end", m = (n || c) && !!s && /* @__PURE__ */ V("strong", { className: `${i}-form-item-symbol`, children: /* @__PURE__ */ V(er, {}) }), d = () => {
987
+ if (!a)
950
988
  return null;
951
- const m = `${n}-form-item-tooltip`;
952
- let F = {}, V = /* @__PURE__ */ f(Ft, { className: m });
953
- if (!M(o) || fe(o))
954
- F = {
955
- content: o
989
+ const f = `${i}-form-item-tooltip`;
990
+ let S = {}, T = /* @__PURE__ */ V(Ot, { className: f });
991
+ if (!X(a) || De(a))
992
+ S = {
993
+ content: a
956
994
  };
957
995
  else {
958
- const { icon: g, ...p } = o;
959
- F = p, g && (V = fe(g) ? H.cloneElement(g, {
960
- className: G(
961
- m,
962
- g.props.className
996
+ const { icon: C, ...F } = a;
997
+ S = F, C && (T = De(C) ? Ve.cloneElement(C, {
998
+ className: ge(
999
+ f,
1000
+ C.props.className
963
1001
  )
964
- }) : g);
1002
+ }) : C);
965
1003
  }
966
- return /* @__PURE__ */ f(ft, { ...F, children: V });
1004
+ return /* @__PURE__ */ V(qt, { ...S, children: T });
967
1005
  };
968
- return t ? /* @__PURE__ */ J("label", { htmlFor: s && `${s}${be}`, children: [
969
- d !== "end" && c,
1006
+ return t ? /* @__PURE__ */ be("label", { htmlFor: r && `${r}${Ae}`, children: [
1007
+ l !== "end" && m,
970
1008
  " ",
971
1009
  t,
972
- h(),
973
- d === "end" && /* @__PURE__ */ J(Ne, { children: [
1010
+ d(),
1011
+ l === "end" && /* @__PURE__ */ be(lt, { children: [
974
1012
  " ",
975
- c
1013
+ m
976
1014
  ] }),
977
1015
  e ? e === !0 ? ":" : e : ""
978
1016
  ] }) : null;
979
- }, $t = je.Row, We = je.Col, kt = ({
980
- prefixCls: s,
1017
+ }, rr = ft.Row, nt = ft.Col, sr = ({
1018
+ prefixCls: r,
981
1019
  help: e,
982
1020
  errors: t,
983
- warnings: r
1021
+ warnings: s
984
1022
  }) => {
985
- const i = t.map((a, d) => {
986
- if (a)
987
- return /* @__PURE__ */ f("div", { role: "alert", children: a.message }, d);
988
- }), l = [];
989
- r.map((a, d) => {
990
- l.push(
991
- /* @__PURE__ */ f("div", { role: "alert", className: `${s}-message-help-warning`, children: a }, d)
1023
+ const n = t.map((c, l) => {
1024
+ if (c)
1025
+ return /* @__PURE__ */ V("div", { role: "alert", children: c.message }, l);
1026
+ }), o = [];
1027
+ s.map((c, l) => {
1028
+ o.push(
1029
+ /* @__PURE__ */ V("div", { role: "alert", className: `${r}-message-help-warning`, children: c }, l)
992
1030
  );
993
1031
  });
994
- const n = !te(e) || !!l.length, o = n || !!i.length;
995
- return o && /* @__PURE__ */ f(
996
- mt,
1032
+ const i = !Ce(e) || !!o.length, a = i || !!n.length;
1033
+ return a && /* @__PURE__ */ V(
1034
+ Gt,
997
1035
  {
998
- in: o,
1036
+ in: a,
999
1037
  appear: !0,
1000
1038
  classNames: "formblink",
1001
1039
  timeout: 300,
1002
1040
  unmountOnExit: !0,
1003
- children: /* @__PURE__ */ f(
1041
+ children: /* @__PURE__ */ V(
1004
1042
  "div",
1005
1043
  {
1006
- className: G(`${s}-message`, {
1007
- [`${s}-message-help`]: n
1044
+ className: ge(`${r}-message`, {
1045
+ [`${r}-message-help`]: i
1008
1046
  }),
1009
- children: te(e) ? /* @__PURE__ */ J(Ne, { children: [
1010
- i.length > 0 && i,
1011
- l.length > 0 && l
1047
+ children: Ce(e) ? /* @__PURE__ */ be(lt, { children: [
1048
+ n.length > 0 && n,
1049
+ o.length > 0 && o
1012
1050
  ] }) : e
1013
1051
  }
1014
1052
  )
1015
1053
  }
1016
1054
  );
1017
- }, Rt = (s, e) => {
1018
- var ve, ye, Ce;
1019
- const { getPrefixCls: t, prefixCls: r } = O(xe), i = O(Se), l = O(Ge), [n, o] = ce(null), [a, d] = ce(null), c = O(se), h = c.prefixCls || t("form"), m = s.layout || c.layout, F = s.labelAlign || c.labelAlign, V = L(!1), g = (x, I = {}) => {
1020
- if (V.current)
1055
+ }, nr = {
1056
+ trigger: "onChange",
1057
+ triggerPropName: "value"
1058
+ }, ir = (r, e) => {
1059
+ var te, Fe, Ee;
1060
+ const t = ze(r, nr), { getPrefixCls: s, prefixCls: n } = re(qe), o = re(Oe), i = re(pt), [a, c] = Re(null), [l, m] = Re(null), d = re(we), f = d.prefixCls || s("form"), S = t.layout || d.layout, T = t.labelAlign || d.labelAlign, C = R(!1), F = (j, W = {}) => {
1061
+ if (C.current)
1021
1062
  return;
1022
- const { errors: D, warnings: Z } = I || {};
1023
- o((Y) => {
1024
- const E = { ...Y || {} };
1025
- return D ? E[x] = D : delete E[x], E;
1026
- }), d((Y) => {
1027
- const E = { ...Y || {} };
1028
- return Z && Z.length ? E[x] = Z : delete E[x], E;
1063
+ const { errors: O, warnings: de } = W || {};
1064
+ c((ie) => {
1065
+ const M = { ...ie || {} };
1066
+ return O ? M[j] = O : delete M[j], M;
1067
+ }), m((ie) => {
1068
+ const M = { ...ie || {} };
1069
+ return de && de.length ? M[j] = de : delete M[j], M;
1029
1070
  });
1030
- }, p = M(s.noStyle) && s.noStyle.showErrorTip && i.updateFormItem ? i.updateFormItem : g;
1031
- ie(() => (V.current = !1, () => {
1032
- V.current = !0, o(null), d(null);
1071
+ }, I = X(t.noStyle) && t.noStyle.showErrorTip && o.updateFormItem ? o.updateFormItem : F;
1072
+ Se(() => (C.current = !1, () => {
1073
+ C.current = !0, c(null), m(null);
1033
1074
  }), []);
1034
- const v = {
1035
- ...c,
1036
- validateMessages: c.validateMessages && vt(c.validateMessages, {
1037
- label: s.label
1075
+ const _ = {
1076
+ ...d,
1077
+ validateMessages: d.validateMessages && Ht(d.validateMessages, {
1078
+ label: t.label
1038
1079
  }),
1039
- prefixCls: h,
1040
- updateFormItem: p,
1041
- disabled: "disabled" in s ? s.disabled : c.disabled
1042
- }, { label: y, extra: w, className: k, style: R, validateStatus: Q, hidden: ne, ...le } = s, he = G(`${h}-label-item`, {
1043
- [`${h}-label-item-left`]: F === "left"
1044
- }), oe = n ? Object.values(n) : [], X = a ? Object.values(a).reduce((x, I) => x.concat(I), []) : [], B = we(() => {
1045
- if (Q)
1046
- return Q;
1047
- if (oe.length)
1048
- return me.error;
1049
- if (X.length)
1050
- return me.warning;
1051
- }, [n, a, Q]), S = we(() => !te(s.help) || X.length > 0, [s.help, a]), W = G(
1052
- `${h}-item`,
1080
+ prefixCls: f,
1081
+ updateFormItem: I,
1082
+ disabled: "disabled" in t ? t.disabled : d.disabled
1083
+ }, { label: N, extra: E, className: $, style: A, validateStatus: Y, hidden: se, ...ce } = t, ne = ge(`${f}-label-item`, {
1084
+ [`${f}-label-item-left`]: T === "left"
1085
+ }), K = a ? Object.values(a) : [], B = l ? Object.values(l).reduce((j, W) => j.concat(W), []) : [], p = Ye(() => {
1086
+ if (Y)
1087
+ return Y;
1088
+ if (K.length)
1089
+ return Ue.error;
1090
+ if (B.length)
1091
+ return Ue.warning;
1092
+ }, [a, l, Y]), x = Ye(() => !Ce(t.help) || B.length > 0, [t.help, l]), P = ge(
1093
+ `${f}-item`,
1053
1094
  {
1054
- [`${h}-item-error`]: S || !Q && B === me.error,
1055
- [`${h}-item-status-${B}`]: B,
1056
- [`${h}-item-has-help`]: S,
1057
- [`${h}-item-hidden`]: ne,
1058
- [`${h}-item-has-feedback`]: B && s.hasFeedback
1095
+ [`${f}-item-error`]: x || !Y && p === Ue.error,
1096
+ [`${f}-item-status-${p}`]: p,
1097
+ [`${f}-item-has-help`]: x,
1098
+ [`${f}-item-hidden`]: se,
1099
+ [`${f}-item-has-feedback`]: p && t.hasFeedback
1059
1100
  },
1060
- `${h}-layout-${m}`,
1061
- k
1062
- ), C = () => {
1063
- var Z, Y;
1064
- const { field: x, children: I } = s, D = "disabled" in s ? s.disabled : c.disabled;
1065
- if (j(I)) {
1066
- const { key: E, ..._ } = s ?? {};
1067
- return /* @__PURE__ */ Ee(
1068
- z,
1101
+ `${f}-layout-${S}`,
1102
+ $
1103
+ ), L = () => {
1104
+ var de, ie;
1105
+ const { field: j, children: W } = t, O = "disabled" in t ? t.disabled : d.disabled;
1106
+ if (ue(W)) {
1107
+ const { key: M, ...D } = t ?? {};
1108
+ return /* @__PURE__ */ Ke(
1109
+ pe,
1069
1110
  {
1070
- disabled: D,
1071
- ..._,
1072
- key: x || E,
1073
- _key: x || E
1111
+ disabled: O,
1112
+ ...D,
1113
+ key: j || M,
1114
+ _key: j || M
1074
1115
  },
1075
- (...ge) => I(
1076
- ...ge
1116
+ (...le) => W(
1117
+ ...le
1077
1118
  )
1078
1119
  );
1079
1120
  }
1080
- if (T(I)) {
1081
- const E = H.Children.map(I, (_, ge) => {
1082
- const Ie = M(_) && _.key || ge, Qe = M(_) && "disabled" in _.props, Xe = !te(D) && !Qe ? { key: Ie, disabled: D } : { key: Ie };
1083
- return M(_) ? Te(_, Xe) : _;
1121
+ if (G(W)) {
1122
+ const M = Ve.Children.map(W, (D, le) => {
1123
+ const he = X(D) && D.key || le, $e = X(D) && "disabled" in D.props, Te = !Ce(O) && !$e ? { key: he, disabled: O } : { key: he };
1124
+ return X(D) ? et(D, Te) : D;
1084
1125
  });
1085
- return /* @__PURE__ */ f(z, { ...s, field: void 0, children: E });
1126
+ return /* @__PURE__ */ V(pe, { ...t, field: void 0, children: M });
1086
1127
  }
1087
- if (H.Children.count(I) == 1) {
1088
- if (x) {
1089
- const E = ((Z = l == null ? void 0 : l.getItemKey) == null ? void 0 : Z.call(l, x)) || x;
1090
- return /* @__PURE__ */ Ee(z, { disabled: D, ...s, key: E, _key: E }, I);
1128
+ if (Ve.Children.count(W) == 1) {
1129
+ if (j) {
1130
+ const M = ((de = i == null ? void 0 : i.getItemKey) == null ? void 0 : de.call(i, j)) || j;
1131
+ return /* @__PURE__ */ Ke(pe, { disabled: O, ...t, key: M, _key: M }, W);
1091
1132
  }
1092
- if (M(I)) {
1093
- if ((Y = I.type) != null && Y.isFormControl)
1094
- return I;
1095
- const _ = !("disabled" in I.props) && !te(D) ? { disabled: D } : null;
1096
- return /* @__PURE__ */ f(z, { ...s, field: void 0, children: _ ? Te(I, _) : I });
1133
+ if (X(W)) {
1134
+ if ((ie = W.type) != null && ie.isFormControl)
1135
+ return W;
1136
+ const D = !("disabled" in W.props) && !Ce(O) ? { disabled: O } : null;
1137
+ return /* @__PURE__ */ V(pe, { ...t, field: void 0, children: D ? et(W, D) : W });
1097
1138
  }
1098
1139
  }
1099
- return I;
1100
- }, P = Se, q = {
1101
- ...c
1140
+ return W;
1141
+ }, ee = Oe, fe = {
1142
+ ...d
1102
1143
  };
1103
- return s.noStyle || (q.wrapperCol = void 0, q.labelCol = void 0), /* @__PURE__ */ f(se.Provider, { value: q, children: /* @__PURE__ */ f(P.Provider, { value: v, children: s.noStyle ? C() : /* @__PURE__ */ J(
1104
- $t,
1144
+ return t.noStyle || (fe.wrapperCol = void 0, fe.labelCol = void 0), /* @__PURE__ */ V(we.Provider, { value: fe, children: /* @__PURE__ */ V(ee.Provider, { value: _, children: t.noStyle ? L() : /* @__PURE__ */ be(
1145
+ rr,
1105
1146
  {
1106
1147
  ref: e,
1107
- ..._e(le, [
1148
+ ...ut(ce, [
1108
1149
  "tooltip",
1109
1150
  "children",
1110
1151
  "prefixCls",
@@ -1134,285 +1175,283 @@ const Tt = ({
1134
1175
  "requiredSymbol",
1135
1176
  "isFormList"
1136
1177
  ]),
1137
- className: W,
1138
- div: m !== "horizontal",
1139
- style: R,
1178
+ className: P,
1179
+ div: S !== "horizontal",
1180
+ style: A,
1140
1181
  children: [
1141
- y ? /* @__PURE__ */ f(
1142
- We,
1182
+ N ? /* @__PURE__ */ V(
1183
+ nt,
1143
1184
  {
1144
- ...s.labelCol || c.labelCol,
1145
- className: G(
1146
- he,
1147
- (ve = s.labelCol) == null ? void 0 : ve.className,
1148
- (ye = c.labelCol) == null ? void 0 : ye.className,
1185
+ ...t.labelCol || d.labelCol,
1186
+ className: ge(
1187
+ ne,
1188
+ (te = t.labelCol) == null ? void 0 : te.className,
1189
+ (Fe = d.labelCol) == null ? void 0 : Fe.className,
1149
1190
  {
1150
- [`${h}-label-item-flex`]: !s.labelCol && !c.labelCol
1191
+ [`${f}-label-item-flex`]: !t.labelCol && !d.labelCol
1151
1192
  }
1152
1193
  ),
1153
- children: /* @__PURE__ */ f(
1154
- Tt,
1194
+ children: /* @__PURE__ */ V(
1195
+ tr,
1155
1196
  {
1156
- tooltip: s.tooltip,
1157
- htmlFor: s.field && ((Ce = c == null ? void 0 : c.getFormElementId) == null ? void 0 : Ce.call(c, s.field)),
1158
- label: y,
1159
- prefix: r,
1160
- requiredSymbol: "requiredSymbol" in s ? s.requiredSymbol : c.requiredSymbol,
1161
- required: s.required,
1162
- rules: s.rules,
1163
- showColon: "colon" in s ? s.colon : c.colon
1197
+ tooltip: t.tooltip,
1198
+ htmlFor: t.field && ((Ee = d == null ? void 0 : d.getFormElementId) == null ? void 0 : Ee.call(d, t.field)),
1199
+ label: N,
1200
+ prefix: n,
1201
+ requiredSymbol: "requiredSymbol" in t ? t.requiredSymbol : d.requiredSymbol,
1202
+ required: t.required,
1203
+ rules: t.rules,
1204
+ showColon: "colon" in t ? t.colon : d.colon
1164
1205
  }
1165
1206
  )
1166
1207
  }
1167
1208
  ) : null,
1168
- /* @__PURE__ */ J(
1169
- We,
1209
+ /* @__PURE__ */ be(
1210
+ nt,
1170
1211
  {
1171
- className: G(`${h}-item-wrapper`, {
1172
- [`${h}-item-wrapper-flex`]: !s.wrapperCol && !c.wrapperCol
1212
+ className: ge(`${f}-item-wrapper`, {
1213
+ [`${f}-item-wrapper-flex`]: !t.wrapperCol && !d.wrapperCol
1173
1214
  }),
1174
- ...s.wrapperCol || c.wrapperCol,
1215
+ ...t.wrapperCol || d.wrapperCol,
1175
1216
  children: [
1176
- C(),
1177
- /* @__PURE__ */ f(
1178
- kt,
1217
+ L(),
1218
+ /* @__PURE__ */ V(
1219
+ sr,
1179
1220
  {
1180
- prefixCls: h,
1181
- help: s.help,
1182
- errors: oe,
1183
- warnings: X
1221
+ prefixCls: f,
1222
+ help: t.help,
1223
+ errors: K,
1224
+ warnings: B
1184
1225
  }
1185
1226
  ),
1186
- w && /* @__PURE__ */ f("div", { className: `${h}-extra`, children: w })
1227
+ E && /* @__PURE__ */ V("div", { className: `${f}-extra`, children: E })
1187
1228
  ]
1188
1229
  }
1189
1230
  )
1190
1231
  ]
1191
1232
  }
1192
1233
  ) }) });
1193
- }, de = Ve(Rt);
1194
- de.defaultProps = {
1195
- trigger: "onChange",
1196
- triggerPropName: "value"
1197
- };
1198
- de.displayName = "FormItem";
1199
- const Pe = (s, e) => !te(s) && s >= 0 && s < e.length, He = (s) => {
1200
- const { field: e, children: t, initialValue: r } = s, i = L({
1234
+ }, Be = _e(ir);
1235
+ Be.displayName = "FormItem";
1236
+ const it = (r, e) => !Ce(r) && r >= 0 && r < e.length, yt = (r) => {
1237
+ const { field: e, children: t, initialValue: s } = r, n = R({
1201
1238
  id: 0,
1202
1239
  keys: []
1203
- }), l = "initialValue" in s ? { initialValue: r } : {}, n = i.current.keys;
1204
- return /* @__PURE__ */ f(
1205
- Ge.Provider,
1240
+ }), o = "initialValue" in r ? { initialValue: s } : {}, i = n.current.keys;
1241
+ return /* @__PURE__ */ V(
1242
+ pt.Provider,
1206
1243
  {
1207
1244
  value: {
1208
- getItemKey: (o) => {
1209
- const a = o == null ? void 0 : o.replace(/\[|\]/g, ".").split("."), d = a.indexOf(e), c = a[d + 1];
1210
- return `${e}_${n.indexOf(c)}_${a.slice(d + 2).join("_")}`;
1245
+ getItemKey: (a) => {
1246
+ const c = a == null ? void 0 : a.replace(/\[|\]/g, ".").split("."), l = c.indexOf(e), m = c[l + 1];
1247
+ return `${e}_${i.indexOf(m)}_${c.slice(l + 2).join("_")}`;
1211
1248
  }
1212
1249
  },
1213
- children: /* @__PURE__ */ f(
1214
- de,
1250
+ children: /* @__PURE__ */ V(
1251
+ Be,
1215
1252
  {
1216
1253
  field: e,
1217
- ...l,
1254
+ ...o,
1218
1255
  isFormList: !0,
1219
- rules: s.rules,
1256
+ rules: r.rules,
1220
1257
  wrapperCol: { span: 24 },
1221
- noStyle: "noStyle" in s ? s.noStyle : !s.rules,
1222
- shouldUpdate: (o, a, d) => {
1223
- var c, h;
1224
- return !!(d && !d.isInner && ae(d.field, [e]) && ((c = $(o, e)) == null ? void 0 : c.length) !== ((h = $(a, e)) == null ? void 0 : h.length));
1258
+ noStyle: "noStyle" in r ? r.noStyle : !r.rules,
1259
+ shouldUpdate: (a, c, l) => {
1260
+ var m, d;
1261
+ return !!(l && !l.isInner && We(l.field, [e]) && ((m = z(a, e)) == null ? void 0 : m.length) !== ((d = z(c, e)) == null ? void 0 : d.length));
1225
1262
  },
1226
- children: (o, a, { value: d, onChange: c }) => {
1227
- const h = d || [], m = function(g, p) {
1228
- var R;
1229
- if (ze(g)) {
1230
- re(
1263
+ children: (a, c, { value: l, onChange: m }) => {
1264
+ const d = l || [], f = function(F, I) {
1265
+ var A;
1266
+ if (Vt(F)) {
1267
+ Ie(
1231
1268
  !0,
1232
1269
  "Form.List: The event object cannot be used as a parameter of the add method"
1233
1270
  );
1234
1271
  return;
1235
1272
  }
1236
- const v = ((R = a.getInnerMethods(!0)) == null ? void 0 : R.innerGetFieldValue(e)) || [], y = i.current.id;
1237
- i.current.id += 1;
1238
- const w = v;
1239
- let k = w;
1240
- p !== void 0 && p >= 0 && p <= w.length ? (n.splice(p, 0, y), k = [
1241
- ...w.slice(0, p),
1242
- g,
1243
- ...w.slice(p)
1244
- ]) : (n.push(y), k = [...w, g]), c(k, {
1273
+ const _ = ((A = c.getInnerMethods(!0)) == null ? void 0 : A.innerGetFieldValue(e)) || [], N = n.current.id;
1274
+ n.current.id += 1;
1275
+ const E = _ || [];
1276
+ let $ = E;
1277
+ I !== void 0 && I >= 0 && I <= E.length ? (i.splice(I, 0, N), $ = [
1278
+ ...E.slice(0, I),
1279
+ F,
1280
+ ...E.slice(I)
1281
+ ]) : (i.push(N), $ = [...E, F]), m($, {
1245
1282
  isFormList: !0,
1246
- ignore: g === void 0
1283
+ ignore: F === void 0
1247
1284
  });
1248
- }, F = function(g) {
1249
- var y;
1250
- const v = (((y = a.getInnerMethods(!0)) == null ? void 0 : y.innerGetFieldValue(e)) || []).filter((w, k) => k !== g);
1251
- n.splice(g, 1), c([...v], { isFormList: !0 });
1252
- }, V = function(g, p) {
1253
- var R;
1254
- const v = ((R = a.getInnerMethods(!0)) == null ? void 0 : R.innerGetFieldValue(e)) || [];
1255
- if (g === p || !Pe(g, v) || !Pe(p, v))
1285
+ }, S = function(F) {
1286
+ var N;
1287
+ const _ = (((N = c.getInnerMethods(!0)) == null ? void 0 : N.innerGetFieldValue(e)) || []).filter((E, $) => $ !== F);
1288
+ i.splice(F, 1), m([..._], { isFormList: !0 });
1289
+ }, T = function(F, I) {
1290
+ var A;
1291
+ const _ = ((A = c.getInnerMethods(!0)) == null ? void 0 : A.innerGetFieldValue(e)) || [];
1292
+ if (F === I || !it(F, _) || !it(I, _))
1256
1293
  return;
1257
- const y = n[g];
1258
- n.splice(g, 1), n.splice(p, 0, y);
1259
- const w = v[g], k = [...v];
1260
- k.splice(g, 1), k.splice(p, 0, w), c(k, { isFormList: !0 });
1294
+ const N = i[F];
1295
+ i.splice(F, 1), i.splice(I, 0, N);
1296
+ const E = _[F], $ = [..._];
1297
+ $.splice(F, 1), $.splice(I, 0, E), m($, { isFormList: !0 });
1261
1298
  };
1262
- return j(t) && t(
1263
- h.map((g, p) => {
1264
- let v = n[p];
1265
- return v === void 0 && (v = i.current.id, n.push(v), i.current.id += 1), {
1266
- ...g,
1299
+ let C;
1300
+ if (ue(t)) {
1301
+ const F = d.map((_, N) => {
1302
+ let E = i[N];
1303
+ return E === void 0 && (E = n.current.id, i.push(E), n.current.id += 1), {
1304
+ ..._,
1267
1305
  // 潘启宝添加 2024年 9月 5日 星期四 17时09分53秒 CST
1268
- field: `${e}[${p}]`,
1269
- key: v
1306
+ field: `${e}[${N}]`,
1307
+ key: E
1270
1308
  };
1271
- }),
1272
- {
1273
- add: m,
1274
- remove: F,
1275
- move: V
1276
- }
1277
- );
1309
+ });
1310
+ C = t(F, {
1311
+ add: f,
1312
+ remove: S,
1313
+ move: T
1314
+ });
1315
+ }
1316
+ return C;
1278
1317
  }
1279
1318
  }
1280
1319
  )
1281
1320
  }
1282
1321
  );
1283
1322
  };
1284
- He.displayName = "FormList";
1285
- const Wt = (s, e) => {
1286
- const t = L({}), r = ee((o, a) => (o && (t.current[o] = a), () => {
1287
- delete t.current[o];
1288
- }), []), i = ee(
1289
- (o, a) => {
1290
- var d;
1291
- (d = s.onFormSubmit) == null || d.call(s, o, a, {
1323
+ yt.displayName = "FormList";
1324
+ const lr = (r, e) => {
1325
+ const t = R({}), s = ve((a, c) => (a && (t.current[a] = c), () => {
1326
+ delete t.current[a];
1327
+ }), []), n = ve(
1328
+ (a, c) => {
1329
+ var l;
1330
+ (l = r.onFormSubmit) == null || l.call(r, a, c, {
1292
1331
  forms: t.current
1293
1332
  });
1294
1333
  },
1295
- [s.onFormSubmit]
1296
- ), l = ee(
1297
- (o, a) => {
1298
- var d;
1299
- (d = s.onFormReset) == null || d.call(s, o, a, {
1334
+ [r.onFormSubmit]
1335
+ ), o = ve(
1336
+ (a, c) => {
1337
+ var l;
1338
+ (l = r.onFormReset) == null || l.call(r, a, c, {
1300
1339
  forms: t.current
1301
1340
  });
1302
1341
  },
1303
- [s.onFormReset]
1304
- ), n = ee(
1305
- (o, a) => {
1306
- var d;
1307
- (d = s.onFormValuesChange) == null || d.call(s, o, a, {
1342
+ [r.onFormReset]
1343
+ ), i = ve(
1344
+ (a, c) => {
1345
+ var l;
1346
+ (l = r.onFormValuesChange) == null || l.call(r, a, c, {
1308
1347
  forms: t.current
1309
1348
  });
1310
1349
  },
1311
- [s.onFormValuesChange]
1350
+ [r.onFormValuesChange]
1312
1351
  );
1313
- return /* @__PURE__ */ f(
1314
- qe.Provider,
1352
+ return /* @__PURE__ */ V(
1353
+ Ft.Provider,
1315
1354
  {
1316
1355
  value: {
1317
- onFormValuesChange: n,
1318
- onFormSubmit: i,
1319
- onFormReset: l,
1320
- register: r
1356
+ onFormValuesChange: i,
1357
+ onFormSubmit: n,
1358
+ onFormReset: o,
1359
+ register: s
1321
1360
  },
1322
- children: s.children
1361
+ children: r.children
1323
1362
  }
1324
1363
  );
1325
- }, Je = Ve(Wt);
1326
- Je.displayName = "FormProvider";
1327
- const Pt = () => {
1328
- const s = O(se), e = s.store, t = L(!1), r = pt(), i = ee(() => {
1329
- var o, a, d;
1330
- const { submitStatus: l } = ((d = (a = (o = e == null ? void 0 : e.getInnerMethods) == null ? void 0 : o.call(e, !0)) == null ? void 0 : a.innerGetStoreStatus) == null ? void 0 : d.call(a)) ?? {}, n = l === U.submitting;
1331
- n !== t.current && (t.current = n, r());
1364
+ }, vt = _e(lr);
1365
+ vt.displayName = "FormProvider";
1366
+ const or = () => {
1367
+ const r = re(we), e = r.store, t = R(!1), s = mt(), n = ve(() => {
1368
+ var a, c, l;
1369
+ const { submitStatus: o } = ((l = (c = (a = e == null ? void 0 : e.getInnerMethods) == null ? void 0 : a.call(e, !0)) == null ? void 0 : c.innerGetStoreStatus) == null ? void 0 : l.call(c)) ?? {}, i = o === ae.submitting;
1370
+ i !== t.current && (t.current = i, s());
1332
1371
  }, []);
1333
- return ie(() => {
1334
- var a;
1372
+ return Se(() => {
1373
+ var c;
1335
1374
  if (!e) {
1336
- re(!0, "formInstance is not available");
1375
+ Ie(!0, "formInstance is not available");
1337
1376
  return;
1338
1377
  }
1339
- const { registerFormWatcher: l } = ((a = e == null ? void 0 : e.getInnerMethods) == null ? void 0 : a.call(e, !0)) ?? {}, n = () => i();
1340
- n();
1341
- const o = (l == null ? void 0 : l(n)) ?? {};
1378
+ const { registerFormWatcher: o } = ((c = e == null ? void 0 : e.getInnerMethods) == null ? void 0 : c.call(e, !0)) ?? {}, i = () => n();
1379
+ i();
1380
+ const a = (o == null ? void 0 : o(i)) ?? {};
1342
1381
  return () => {
1343
- o == null || o();
1382
+ a == null || a();
1344
1383
  };
1345
1384
  }, []), {
1346
1385
  form: e,
1347
- disabled: s.disabled,
1386
+ disabled: r.disabled,
1348
1387
  isSubmitting: t.current
1349
1388
  };
1350
- }, Nt = (s, e) => {
1351
- const t = O(se), r = e || t.store, i = L(s);
1352
- i.current = s;
1353
- const l = ee(() => {
1354
- const d = i.current, c = r.getFieldsState([d]);
1355
- return c == null ? void 0 : c[d];
1356
- }, []), [n, o] = ce(l), a = L(n);
1357
- return ie(() => {
1358
- var m;
1359
- if (!r) {
1360
- re(!0, "formInstance is not available");
1389
+ }, ar = (r, e) => {
1390
+ const t = re(we), s = e || t.store, n = R(r);
1391
+ n.current = r;
1392
+ const o = ve(() => {
1393
+ const l = n.current, m = s.getFieldsState([l]);
1394
+ return m == null ? void 0 : m[l];
1395
+ }, []), [i, a] = Re(o), c = R(i);
1396
+ return Se(() => {
1397
+ var f;
1398
+ if (!s) {
1399
+ Ie(!0, "formInstance is not available");
1361
1400
  return;
1362
1401
  }
1363
- const { registerStateWatcher: d } = ((m = r == null ? void 0 : r.getInnerMethods) == null ? void 0 : m.call(r, !0)) ?? {}, c = () => {
1364
- const F = l();
1365
- pe(a.current, F) || (o(F), a.current = F);
1402
+ const { registerStateWatcher: l } = ((f = s == null ? void 0 : s.getInnerMethods) == null ? void 0 : f.call(s, !0)) ?? {}, m = () => {
1403
+ const S = o();
1404
+ Ge(c.current, S) || (a(S), c.current = S);
1366
1405
  };
1367
- c();
1368
- const h = d == null ? void 0 : d(c);
1406
+ m();
1407
+ const d = l == null ? void 0 : l(m);
1369
1408
  return () => {
1370
- h == null || h();
1409
+ d == null || d();
1371
1410
  };
1372
- }, []), n;
1373
- }, Mt = (s, e) => {
1374
- const t = O(se), r = e || t.store, [i, l] = ce(() => {
1375
- const a = r == null ? void 0 : r.getFieldsValue([].concat(s));
1376
- return St(s) ? $(a, s) : a;
1377
- }), n = L(s);
1378
- n.current = s;
1379
- const o = L(JSON.stringify(i));
1380
- return ie(() => {
1381
- var h;
1382
- if (!r) {
1383
- re(!0, "formInstance is not available");
1411
+ }, []), i;
1412
+ }, ur = (r, e) => {
1413
+ const t = re(we), s = e || t.store, [n, o] = Re(() => {
1414
+ const c = s == null ? void 0 : s.getFieldsValue([].concat(r));
1415
+ return zt(r) ? z(c, r) : c;
1416
+ }), i = R(r);
1417
+ i.current = r;
1418
+ const a = R(JSON.stringify(n));
1419
+ return Se(() => {
1420
+ var d;
1421
+ if (!s) {
1422
+ Ie(!0, "formInstance is not available");
1384
1423
  return;
1385
1424
  }
1386
- const { registerWatcher: a } = ((h = r == null ? void 0 : r.getInnerMethods) == null ? void 0 : h.call(r, !0)) ?? {}, d = () => {
1387
- const m = n.current, F = r.getFieldsValue([].concat(m));
1388
- let V = F;
1389
- T(m) || (V = $(F, m));
1390
- const g = JSON.stringify(V);
1391
- o.current !== g && (l(V), o.current = g);
1425
+ const { registerWatcher: c } = ((d = s == null ? void 0 : s.getInnerMethods) == null ? void 0 : d.call(s, !0)) ?? {}, l = () => {
1426
+ const f = i.current, S = s.getFieldsValue([].concat(f));
1427
+ let T = S;
1428
+ G(f) || (T = z(S, f));
1429
+ const C = JSON.stringify(T);
1430
+ a.current !== C && (o(T), a.current = C);
1392
1431
  };
1393
- d();
1394
- const c = a == null ? void 0 : a(d);
1432
+ l();
1433
+ const m = c == null ? void 0 : c(l);
1395
1434
  return () => {
1396
- c == null || c();
1435
+ m == null || m();
1397
1436
  };
1398
- }, []), i;
1399
- }, A = Be;
1400
- A.Provider = Je;
1401
- A.Item = de;
1402
- A.List = He;
1403
- A.Control = z;
1404
- A.useForm = Ae;
1405
- A.useFormContext = Pt;
1406
- A.useWatch = Mt;
1407
- A.useFormState = Nt;
1437
+ }, []), n;
1438
+ }, me = St;
1439
+ me.Provider = vt;
1440
+ me.Item = Be;
1441
+ me.List = yt;
1442
+ me.Control = pe;
1443
+ me.useForm = bt;
1444
+ me.useFormContext = or;
1445
+ me.useWatch = ur;
1446
+ me.useFormState = ar;
1408
1447
  export {
1409
- z as FormControl,
1410
- de as FormItem,
1411
- He as FormList,
1412
- Je as FormProvider,
1413
- A as default,
1414
- Ae as useForm,
1415
- Pt as useFormContext,
1416
- Nt as useFormState,
1417
- Mt as useWatch
1448
+ pe as FormControl,
1449
+ Be as FormItem,
1450
+ yt as FormList,
1451
+ vt as FormProvider,
1452
+ me as default,
1453
+ bt as useForm,
1454
+ or as useFormContext,
1455
+ ar as useFormState,
1456
+ ur as useWatch
1418
1457
  };