@dnb/eufemia 10.69.0 → 10.69.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/cjs/components/global-error/GlobalError.d.ts +1 -1
  3. package/cjs/components/global-error/GlobalError.js +1 -1
  4. package/cjs/components/global-error/GlobalError.js.map +1 -1
  5. package/cjs/components/global-error/GlobalErrorDocs.d.ts +2 -0
  6. package/cjs/components/global-error/GlobalErrorDocs.js +64 -0
  7. package/cjs/components/global-error/GlobalErrorDocs.js.map +1 -0
  8. package/cjs/components/info-card/InfoCardDocs.d.ts +3 -0
  9. package/cjs/components/info-card/InfoCardDocs.js +101 -0
  10. package/cjs/components/info-card/InfoCardDocs.js.map +1 -0
  11. package/cjs/components/tabs/Tabs.js +2 -2
  12. package/cjs/components/tabs/Tabs.js.map +1 -1
  13. package/cjs/components/upload/UploadFileList.js +2 -3
  14. package/cjs/components/upload/UploadFileList.js.map +1 -1
  15. package/cjs/extensions/forms/DataContext/Context.d.ts +2 -2
  16. package/cjs/extensions/forms/DataContext/Context.js.map +1 -1
  17. package/cjs/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js +4 -4
  18. package/cjs/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js.map +1 -1
  19. package/cjs/extensions/forms/DataContext/Provider/Provider.js +35 -41
  20. package/cjs/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  21. package/cjs/extensions/forms/Field/Provider/useFieldProvider.d.ts +3 -3
  22. package/cjs/extensions/forms/FieldBlock/FieldBlock.js +2 -2
  23. package/cjs/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
  24. package/cjs/extensions/forms/FieldBlock/FieldBlockContext.d.ts +1 -1
  25. package/cjs/extensions/forms/FieldBlock/FieldBlockContext.js.map +1 -1
  26. package/cjs/extensions/forms/Form/Isolation/Isolation.js +3 -4
  27. package/cjs/extensions/forms/Form/Isolation/Isolation.js.map +1 -1
  28. package/cjs/extensions/forms/Form/Visibility/Visibility.d.ts +1 -10
  29. package/cjs/extensions/forms/Form/Visibility/Visibility.js +1 -0
  30. package/cjs/extensions/forms/Form/Visibility/Visibility.js.map +1 -1
  31. package/cjs/extensions/forms/Form/Visibility/VisibilityContext.d.ts +2 -1
  32. package/cjs/extensions/forms/Form/Visibility/VisibilityContext.js.map +1 -1
  33. package/cjs/extensions/forms/Form/Visibility/useVisibility.js +1 -1
  34. package/cjs/extensions/forms/Form/Visibility/useVisibility.js.map +1 -1
  35. package/cjs/extensions/forms/Iterate/Array/ArrayItemArea.d.ts +3 -2
  36. package/cjs/extensions/forms/Iterate/Array/ArrayItemArea.js.map +1 -1
  37. package/cjs/extensions/forms/Iterate/EditContainer/CancelButton.js +5 -2
  38. package/cjs/extensions/forms/Iterate/EditContainer/CancelButton.js.map +1 -1
  39. package/cjs/extensions/forms/Iterate/EditContainer/DoneButton.js +1 -1
  40. package/cjs/extensions/forms/Iterate/EditContainer/DoneButton.js.map +1 -1
  41. package/cjs/extensions/forms/Iterate/EditContainer/EditContainer.d.ts +2 -2
  42. package/cjs/extensions/forms/Iterate/EditContainer/EditContainer.js.map +1 -1
  43. package/cjs/extensions/forms/Iterate/PushContainer/OpenButton.js +1 -1
  44. package/cjs/extensions/forms/Iterate/PushContainer/OpenButton.js.map +1 -1
  45. package/cjs/extensions/forms/Iterate/PushContainer/PushContainer.js +9 -2
  46. package/cjs/extensions/forms/Iterate/PushContainer/PushContainer.js.map +1 -1
  47. package/cjs/extensions/forms/Iterate/ViewContainer/EditButton.js +1 -1
  48. package/cjs/extensions/forms/Iterate/ViewContainer/EditButton.js.map +1 -1
  49. package/cjs/extensions/forms/Iterate/ViewContainer/ViewContainer.d.ts +1 -1
  50. package/cjs/extensions/forms/Iterate/ViewContainer/ViewContainer.js.map +1 -1
  51. package/cjs/extensions/forms/Wizard/Buttons/Buttons.js +2 -2
  52. package/cjs/extensions/forms/Wizard/Buttons/Buttons.js.map +1 -1
  53. package/cjs/extensions/forms/Wizard/Container/DisplaySteps.js +6 -5
  54. package/cjs/extensions/forms/Wizard/Container/DisplaySteps.js.map +1 -1
  55. package/cjs/extensions/forms/Wizard/Container/IterateOverSteps.d.ts +4 -3
  56. package/cjs/extensions/forms/Wizard/Container/IterateOverSteps.js +36 -35
  57. package/cjs/extensions/forms/Wizard/Container/IterateOverSteps.js.map +1 -1
  58. package/cjs/extensions/forms/Wizard/Container/WizardContainer.js +104 -57
  59. package/cjs/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
  60. package/cjs/extensions/forms/Wizard/Container/useCollectStepsData.d.ts +10 -0
  61. package/cjs/extensions/forms/Wizard/Container/useCollectStepsData.js +66 -0
  62. package/cjs/extensions/forms/Wizard/Container/useCollectStepsData.js.map +1 -0
  63. package/cjs/extensions/forms/Wizard/Context/WizardContext.d.ts +17 -4
  64. package/cjs/extensions/forms/Wizard/Context/WizardContext.js.map +1 -1
  65. package/cjs/extensions/forms/Wizard/Context/types.d.ts +9 -6
  66. package/cjs/extensions/forms/Wizard/Context/types.js.map +1 -1
  67. package/cjs/extensions/forms/Wizard/Step/Step.d.ts +1 -1
  68. package/cjs/extensions/forms/Wizard/Step/Step.js +65 -22
  69. package/cjs/extensions/forms/Wizard/Step/Step.js.map +1 -1
  70. package/cjs/extensions/forms/Wizard/Step/StepDocs.js +2 -2
  71. package/cjs/extensions/forms/Wizard/Step/StepDocs.js.map +1 -1
  72. package/cjs/extensions/forms/Wizard/hooks/useStep.js +10 -18
  73. package/cjs/extensions/forms/Wizard/hooks/useStep.js.map +1 -1
  74. package/cjs/extensions/forms/hooks/useFieldProps.js +16 -8
  75. package/cjs/extensions/forms/hooks/useFieldProps.js.map +1 -1
  76. package/cjs/extensions/forms/hooks/useValueProps.js +1 -1
  77. package/cjs/extensions/forms/hooks/useValueProps.js.map +1 -1
  78. package/cjs/shared/Eufemia.d.ts +1 -1
  79. package/cjs/shared/Eufemia.js +2 -2
  80. package/cjs/shared/Eufemia.js.map +1 -1
  81. package/cjs/shared/component-helper.js +1 -1
  82. package/cjs/shared/component-helper.js.map +1 -1
  83. package/cjs/style/core/scopes.scss +1 -1
  84. package/cjs/style/dnb-ui-basis.css +1 -1
  85. package/cjs/style/dnb-ui-basis.min.css +1 -1
  86. package/cjs/style/dnb-ui-body.css +1 -1
  87. package/cjs/style/dnb-ui-body.min.css +1 -1
  88. package/cjs/style/dnb-ui-core.css +1 -1
  89. package/cjs/style/dnb-ui-core.min.css +1 -1
  90. package/components/global-error/GlobalError.d.ts +1 -1
  91. package/components/global-error/GlobalError.js +1 -1
  92. package/components/global-error/GlobalError.js.map +1 -1
  93. package/components/global-error/GlobalErrorDocs.d.ts +2 -0
  94. package/components/global-error/GlobalErrorDocs.js +58 -0
  95. package/components/global-error/GlobalErrorDocs.js.map +1 -0
  96. package/components/info-card/InfoCardDocs.d.ts +3 -0
  97. package/components/info-card/InfoCardDocs.js +95 -0
  98. package/components/info-card/InfoCardDocs.js.map +1 -0
  99. package/components/tabs/Tabs.js +2 -2
  100. package/components/tabs/Tabs.js.map +1 -1
  101. package/components/upload/UploadFileList.js +2 -3
  102. package/components/upload/UploadFileList.js.map +1 -1
  103. package/es/components/global-error/GlobalError.d.ts +1 -1
  104. package/es/components/global-error/GlobalError.js +1 -1
  105. package/es/components/global-error/GlobalError.js.map +1 -1
  106. package/es/components/global-error/GlobalErrorDocs.d.ts +2 -0
  107. package/es/components/global-error/GlobalErrorDocs.js +58 -0
  108. package/es/components/global-error/GlobalErrorDocs.js.map +1 -0
  109. package/es/components/info-card/InfoCardDocs.d.ts +3 -0
  110. package/es/components/info-card/InfoCardDocs.js +95 -0
  111. package/es/components/info-card/InfoCardDocs.js.map +1 -0
  112. package/es/components/tabs/Tabs.js +2 -2
  113. package/es/components/tabs/Tabs.js.map +1 -1
  114. package/es/components/upload/UploadFileList.js +2 -3
  115. package/es/components/upload/UploadFileList.js.map +1 -1
  116. package/es/extensions/forms/DataContext/Context.d.ts +2 -2
  117. package/es/extensions/forms/DataContext/Context.js.map +1 -1
  118. package/es/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js +4 -4
  119. package/es/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js.map +1 -1
  120. package/es/extensions/forms/DataContext/Provider/Provider.js +21 -29
  121. package/es/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  122. package/es/extensions/forms/Field/Provider/useFieldProvider.d.ts +3 -3
  123. package/es/extensions/forms/FieldBlock/FieldBlock.js +2 -2
  124. package/es/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
  125. package/es/extensions/forms/FieldBlock/FieldBlockContext.d.ts +1 -1
  126. package/es/extensions/forms/FieldBlock/FieldBlockContext.js.map +1 -1
  127. package/es/extensions/forms/Form/Isolation/Isolation.js +3 -4
  128. package/es/extensions/forms/Form/Isolation/Isolation.js.map +1 -1
  129. package/es/extensions/forms/Form/Visibility/Visibility.d.ts +1 -10
  130. package/es/extensions/forms/Form/Visibility/Visibility.js +1 -0
  131. package/es/extensions/forms/Form/Visibility/Visibility.js.map +1 -1
  132. package/es/extensions/forms/Form/Visibility/VisibilityContext.d.ts +2 -1
  133. package/es/extensions/forms/Form/Visibility/VisibilityContext.js.map +1 -1
  134. package/es/extensions/forms/Form/Visibility/useVisibility.js +1 -1
  135. package/es/extensions/forms/Form/Visibility/useVisibility.js.map +1 -1
  136. package/es/extensions/forms/Iterate/Array/ArrayItemArea.d.ts +3 -2
  137. package/es/extensions/forms/Iterate/Array/ArrayItemArea.js.map +1 -1
  138. package/es/extensions/forms/Iterate/EditContainer/CancelButton.js +5 -2
  139. package/es/extensions/forms/Iterate/EditContainer/CancelButton.js.map +1 -1
  140. package/es/extensions/forms/Iterate/EditContainer/DoneButton.js +1 -1
  141. package/es/extensions/forms/Iterate/EditContainer/DoneButton.js.map +1 -1
  142. package/es/extensions/forms/Iterate/EditContainer/EditContainer.d.ts +2 -2
  143. package/es/extensions/forms/Iterate/EditContainer/EditContainer.js.map +1 -1
  144. package/es/extensions/forms/Iterate/PushContainer/OpenButton.js +1 -1
  145. package/es/extensions/forms/Iterate/PushContainer/OpenButton.js.map +1 -1
  146. package/es/extensions/forms/Iterate/PushContainer/PushContainer.js +9 -2
  147. package/es/extensions/forms/Iterate/PushContainer/PushContainer.js.map +1 -1
  148. package/es/extensions/forms/Iterate/ViewContainer/EditButton.js +1 -1
  149. package/es/extensions/forms/Iterate/ViewContainer/EditButton.js.map +1 -1
  150. package/es/extensions/forms/Iterate/ViewContainer/ViewContainer.d.ts +1 -1
  151. package/es/extensions/forms/Iterate/ViewContainer/ViewContainer.js.map +1 -1
  152. package/es/extensions/forms/Wizard/Buttons/Buttons.js +2 -2
  153. package/es/extensions/forms/Wizard/Buttons/Buttons.js.map +1 -1
  154. package/es/extensions/forms/Wizard/Container/DisplaySteps.js +6 -5
  155. package/es/extensions/forms/Wizard/Container/DisplaySteps.js.map +1 -1
  156. package/es/extensions/forms/Wizard/Container/IterateOverSteps.d.ts +4 -3
  157. package/es/extensions/forms/Wizard/Container/IterateOverSteps.js +35 -34
  158. package/es/extensions/forms/Wizard/Container/IterateOverSteps.js.map +1 -1
  159. package/es/extensions/forms/Wizard/Container/WizardContainer.js +101 -58
  160. package/es/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
  161. package/es/extensions/forms/Wizard/Container/useCollectStepsData.d.ts +10 -0
  162. package/es/extensions/forms/Wizard/Container/useCollectStepsData.js +59 -0
  163. package/es/extensions/forms/Wizard/Container/useCollectStepsData.js.map +1 -0
  164. package/es/extensions/forms/Wizard/Context/WizardContext.d.ts +17 -4
  165. package/es/extensions/forms/Wizard/Context/WizardContext.js.map +1 -1
  166. package/es/extensions/forms/Wizard/Context/types.d.ts +9 -6
  167. package/es/extensions/forms/Wizard/Context/types.js.map +1 -1
  168. package/es/extensions/forms/Wizard/Step/Step.d.ts +1 -1
  169. package/es/extensions/forms/Wizard/Step/Step.js +64 -22
  170. package/es/extensions/forms/Wizard/Step/Step.js.map +1 -1
  171. package/es/extensions/forms/Wizard/Step/StepDocs.js +2 -2
  172. package/es/extensions/forms/Wizard/Step/StepDocs.js.map +1 -1
  173. package/es/extensions/forms/Wizard/hooks/useStep.js +10 -18
  174. package/es/extensions/forms/Wizard/hooks/useStep.js.map +1 -1
  175. package/es/extensions/forms/hooks/useFieldProps.js +16 -8
  176. package/es/extensions/forms/hooks/useFieldProps.js.map +1 -1
  177. package/es/extensions/forms/hooks/useValueProps.js +1 -1
  178. package/es/extensions/forms/hooks/useValueProps.js.map +1 -1
  179. package/es/shared/Eufemia.d.ts +1 -1
  180. package/es/shared/Eufemia.js +2 -2
  181. package/es/shared/Eufemia.js.map +1 -1
  182. package/es/shared/component-helper.js +1 -1
  183. package/es/shared/component-helper.js.map +1 -1
  184. package/es/style/core/scopes.scss +1 -1
  185. package/es/style/dnb-ui-basis.css +1 -1
  186. package/es/style/dnb-ui-basis.min.css +1 -1
  187. package/es/style/dnb-ui-body.css +1 -1
  188. package/es/style/dnb-ui-body.min.css +1 -1
  189. package/es/style/dnb-ui-core.css +1 -1
  190. package/es/style/dnb-ui-core.min.css +1 -1
  191. package/esm/dnb-ui-basis.min.mjs +1 -1
  192. package/esm/dnb-ui-components.min.mjs +1 -1
  193. package/esm/dnb-ui-elements.min.mjs +1 -1
  194. package/esm/dnb-ui-extensions.min.mjs +1 -1
  195. package/esm/dnb-ui-lib.min.mjs +1 -1
  196. package/extensions/forms/DataContext/Context.d.ts +2 -2
  197. package/extensions/forms/DataContext/Context.js.map +1 -1
  198. package/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js +4 -4
  199. package/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js.map +1 -1
  200. package/extensions/forms/DataContext/Provider/Provider.js +35 -41
  201. package/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  202. package/extensions/forms/Field/Provider/useFieldProvider.d.ts +3 -3
  203. package/extensions/forms/FieldBlock/FieldBlock.js +2 -2
  204. package/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
  205. package/extensions/forms/FieldBlock/FieldBlockContext.d.ts +1 -1
  206. package/extensions/forms/FieldBlock/FieldBlockContext.js.map +1 -1
  207. package/extensions/forms/Form/Isolation/Isolation.js +3 -4
  208. package/extensions/forms/Form/Isolation/Isolation.js.map +1 -1
  209. package/extensions/forms/Form/Visibility/Visibility.d.ts +1 -10
  210. package/extensions/forms/Form/Visibility/Visibility.js +1 -0
  211. package/extensions/forms/Form/Visibility/Visibility.js.map +1 -1
  212. package/extensions/forms/Form/Visibility/VisibilityContext.d.ts +2 -1
  213. package/extensions/forms/Form/Visibility/VisibilityContext.js.map +1 -1
  214. package/extensions/forms/Form/Visibility/useVisibility.js +1 -1
  215. package/extensions/forms/Form/Visibility/useVisibility.js.map +1 -1
  216. package/extensions/forms/Iterate/Array/ArrayItemArea.d.ts +3 -2
  217. package/extensions/forms/Iterate/Array/ArrayItemArea.js.map +1 -1
  218. package/extensions/forms/Iterate/EditContainer/CancelButton.js +5 -2
  219. package/extensions/forms/Iterate/EditContainer/CancelButton.js.map +1 -1
  220. package/extensions/forms/Iterate/EditContainer/DoneButton.js +1 -1
  221. package/extensions/forms/Iterate/EditContainer/DoneButton.js.map +1 -1
  222. package/extensions/forms/Iterate/EditContainer/EditContainer.d.ts +2 -2
  223. package/extensions/forms/Iterate/EditContainer/EditContainer.js.map +1 -1
  224. package/extensions/forms/Iterate/PushContainer/OpenButton.js +1 -1
  225. package/extensions/forms/Iterate/PushContainer/OpenButton.js.map +1 -1
  226. package/extensions/forms/Iterate/PushContainer/PushContainer.js +9 -2
  227. package/extensions/forms/Iterate/PushContainer/PushContainer.js.map +1 -1
  228. package/extensions/forms/Iterate/ViewContainer/EditButton.js +1 -1
  229. package/extensions/forms/Iterate/ViewContainer/EditButton.js.map +1 -1
  230. package/extensions/forms/Iterate/ViewContainer/ViewContainer.d.ts +1 -1
  231. package/extensions/forms/Iterate/ViewContainer/ViewContainer.js.map +1 -1
  232. package/extensions/forms/Wizard/Buttons/Buttons.js +2 -2
  233. package/extensions/forms/Wizard/Buttons/Buttons.js.map +1 -1
  234. package/extensions/forms/Wizard/Container/DisplaySteps.js +6 -5
  235. package/extensions/forms/Wizard/Container/DisplaySteps.js.map +1 -1
  236. package/extensions/forms/Wizard/Container/IterateOverSteps.d.ts +4 -3
  237. package/extensions/forms/Wizard/Container/IterateOverSteps.js +36 -34
  238. package/extensions/forms/Wizard/Container/IterateOverSteps.js.map +1 -1
  239. package/extensions/forms/Wizard/Container/WizardContainer.js +105 -58
  240. package/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
  241. package/extensions/forms/Wizard/Container/useCollectStepsData.d.ts +10 -0
  242. package/extensions/forms/Wizard/Container/useCollectStepsData.js +60 -0
  243. package/extensions/forms/Wizard/Container/useCollectStepsData.js.map +1 -0
  244. package/extensions/forms/Wizard/Context/WizardContext.d.ts +17 -4
  245. package/extensions/forms/Wizard/Context/WizardContext.js.map +1 -1
  246. package/extensions/forms/Wizard/Context/types.d.ts +9 -6
  247. package/extensions/forms/Wizard/Context/types.js.map +1 -1
  248. package/extensions/forms/Wizard/Step/Step.d.ts +1 -1
  249. package/extensions/forms/Wizard/Step/Step.js +66 -22
  250. package/extensions/forms/Wizard/Step/Step.js.map +1 -1
  251. package/extensions/forms/Wizard/Step/StepDocs.js +2 -2
  252. package/extensions/forms/Wizard/Step/StepDocs.js.map +1 -1
  253. package/extensions/forms/Wizard/hooks/useStep.js +10 -18
  254. package/extensions/forms/Wizard/hooks/useStep.js.map +1 -1
  255. package/extensions/forms/hooks/useFieldProps.js +16 -8
  256. package/extensions/forms/hooks/useFieldProps.js.map +1 -1
  257. package/extensions/forms/hooks/useValueProps.js +1 -1
  258. package/extensions/forms/hooks/useValueProps.js.map +1 -1
  259. package/package.json +1 -1
  260. package/shared/Eufemia.d.ts +1 -1
  261. package/shared/Eufemia.js +2 -2
  262. package/shared/Eufemia.js.map +1 -1
  263. package/shared/component-helper.js +1 -1
  264. package/shared/component-helper.js.map +1 -1
  265. package/style/core/scopes.scss +1 -1
  266. package/style/dnb-ui-basis.css +1 -1
  267. package/style/dnb-ui-basis.min.css +1 -1
  268. package/style/dnb-ui-body.css +1 -1
  269. package/style/dnb-ui-body.min.css +1 -1
  270. package/style/dnb-ui-core.css +1 -1
  271. package/style/dnb-ui-core.min.css +1 -1
  272. package/umd/dnb-ui-basis.min.js +1 -1
  273. package/umd/dnb-ui-components.min.js +1 -1
  274. package/umd/dnb-ui-elements.min.js +1 -1
  275. package/umd/dnb-ui-extensions.min.js +1 -1
  276. package/umd/dnb-ui-lib.min.js +1 -1
@@ -13,7 +13,7 @@ export type MountState = {
13
13
  };
14
14
  export type EventListenerCall = {
15
15
  path?: Path;
16
- type?: 'onSubmit' | 'onPathChange' | 'onMount';
16
+ type?: 'onSubmit' | 'onSubmitRequest' | 'onPathChange' | 'onMount';
17
17
  callback: (params?: {
18
18
  value: unknown;
19
19
  }) => void | Promise<void | Error>;
@@ -126,7 +126,7 @@ export interface ContextState {
126
126
  fieldInternalsRef?: React.MutableRefObject<FieldInternalsRef>;
127
127
  valueInternalsRef?: React.MutableRefObject<ValueInternalsRef>;
128
128
  fieldConnectionsRef?: React.RefObject<Record<Path, FieldConnections>>;
129
- mountedFieldsRef?: React.MutableRefObject<Record<Path, MountState>>;
129
+ mountedFieldsRef?: React.MutableRefObject<Map<Path, MountState>>;
130
130
  snapshotsRef?: React.MutableRefObject<Map<SnapshotName, Map<Path, unknown>>>;
131
131
  existingFieldsRef?: React.MutableRefObject<Map<Path, boolean>>;
132
132
  formElementRef?: React.MutableRefObject<HTMLFormElement>;
@@ -1 +1 @@
1
- {"version":3,"file":"Context.js","names":["React","makeAjvInstance","defaultContextState","hasContext","data","undefined","schema","submitState","handlePathChange","handlePathChangeUnvalidated","updateDataValue","setData","validateData","handleSubmit","scrollToTop","showAllErrors","hasVisibleError","formState","setFormState","setSubmitState","handleSubmitCall","setShowAllErrors","setMountedFieldState","hasErrors","hasFieldState","hasFieldError","ajvInstance","contextErrorMessages","props","Context","createContext"],"sources":["../../../../../src/extensions/forms/DataContext/Context.ts"],"sourcesContent":["import React from 'react'\nimport { Ajv, FormError, JsonObject, makeAjvInstance } from '../utils'\nimport {\n AllJSONSchemaVersions,\n GlobalErrorMessagesWithPaths,\n SubmitState,\n Path,\n EventStateObject,\n EventReturnWithStateObject,\n FieldProps,\n ValueProps,\n OnChange,\n OnSubmitParams,\n CountryCode,\n} from '../types'\nimport { Props as ProviderProps } from './Provider'\nimport { SnapshotName } from '../Form/Snapshot'\nimport { SharedStateId } from '../../../shared/helpers/useSharedState'\n\nexport type MountState = {\n isPreMounted?: boolean\n isMounted?: boolean\n isVisible?: boolean\n isFocused?: boolean\n wasStepChange?: boolean\n}\n\nexport type EventListenerCall = {\n path?: Path\n type?: 'onSubmit' | 'onPathChange' | 'onMount'\n callback: (params?: { value: unknown }) => void | Promise<void | Error>\n}\n\nexport type VisibleDataHandler<Data> = (\n data?: Data,\n options?: VisibleDataOptions\n) => Partial<Data>\nexport type VisibleDataOptions = {\n keepPaths?: Array<Path>\n removePaths?: Array<Path>\n}\nexport type MutateDataHandler<Data> = (\n data: Data,\n mutate: TransformData\n) => Partial<Data>\nexport type FilterDataHandler<Data> = (\n data: Data,\n filter: FilterData\n) => Partial<Data>\nexport type FilterDataHandlerCallback<R> = (\n parameters: FilterDataHandlerParameters\n) => R\nexport type FilterDataHandlerParameters = DataPathHandlerParameters & {\n path: Path\n}\nexport type DataPathHandler<Data = unknown> = (\n parameters: DataPathHandlerParameters<Data>\n) => boolean | undefined\nexport type DataPathHandlerParameters<Data = unknown> = {\n path: Path\n value: unknown\n displayValue: undefined | React.ReactNode | Array<React.ReactNode>\n label: React.ReactNode\n props: FieldProps\n error: Error | undefined\n\n /**\n * Used in the \"filterData\" given by the \"useData\" hook.\n */\n data: Data\n\n /** @deprecated – can be removed in v11 */\n internal: {\n error: Error | undefined\n }\n}\nexport type FilterDataPathObject<Data> = Record<\n Path,\n DataPathHandler<Data> | boolean | undefined\n>\nexport type FilterData<Data = unknown> =\n | FilterDataPathObject<Data>\n | FilterDataHandlerCallback<boolean | undefined>\nexport type VisibleData<Data = unknown> = Partial<Data>\nexport type TransformData = FilterDataHandlerCallback<unknown>\nexport type HandleSubmitCallback = ({\n preventSubmit,\n}: {\n preventSubmit: () => void\n}) => void\nexport type FieldConnections = {\n setEventResult?: (status: EventStateObject) => void\n}\nexport type FieldInternalsRefProps =\n | (FieldProps & { children: unknown })\n | undefined\nexport type FieldInternalsRef = Record<\n Path,\n {\n props: FieldInternalsRefProps\n id: string | undefined\n }\n>\nexport type ValueInternalsRef = Record<\n Path,\n { props: ValueProps | undefined }\n>\n\nexport interface ContextState {\n id?: SharedStateId\n hasContext: boolean\n /** The dataset for the form / form wizard */\n data: any\n internalDataRef?: React.MutableRefObject<any>\n /** Should the form validate data before submitting? */\n errors?: Record<Path, Error>\n /** Will set autoComplete=\"on\" on each nested Field.String and Field.Number */\n autoComplete?: boolean\n handlePathChange: (\n path: Path,\n value?: any\n ) =>\n | EventReturnWithStateObject\n | unknown\n | Promise<EventReturnWithStateObject | unknown>\n handlePathChangeUnvalidated: (path: Path, value: any) => void\n updateDataValue: (\n path: Path,\n value: any,\n options?: { preventUpdate?: boolean }\n ) => void\n setData: (data: any) => void\n clearData?: () => void\n mutateDataHandler?: MutateDataHandler<unknown>\n filterDataHandler?: FilterDataHandler<unknown>\n visibleDataHandler?: VisibleDataHandler<unknown>\n validateData: () => void\n handleSubmit: () => Promise<EventStateObject | undefined>\n scrollToTop: () => void\n setShowAllErrors: (showAllErrors: boolean) => void\n hasErrors: () => boolean\n hasFieldState: (state: SubmitState) => boolean\n hasFieldError: (path: Path) => boolean\n setFieldState?: (path: Path, fieldState: SubmitState) => void\n setFieldError?: (path: Path, error: Error | FormError) => void\n setMountedFieldState: (path: Path, options: MountState) => void\n setFormState?: (\n state: SubmitState,\n options?: { keepPending?: boolean }\n ) => void\n setSubmitState?: (state: EventStateObject) => void\n addOnChangeHandler?: (callback: OnChange) => void\n handleSubmitCall: ({\n onSubmit,\n enableAsyncBehavior,\n skipFieldValidation,\n skipErrorCheck,\n }: {\n onSubmit: () =>\n | EventReturnWithStateObject\n | void\n | Promise<EventReturnWithStateObject | void>\n enableAsyncBehavior: boolean\n skipFieldValidation?: boolean\n skipErrorCheck?: boolean\n }) => Promise<EventStateObject | undefined>\n getSubmitData?: () => unknown\n getSubmitParams?: () => OnSubmitParams\n setFieldEventListener?: (\n path: EventListenerCall['path'],\n type: EventListenerCall['type'],\n callback: EventListenerCall['callback']\n ) => void\n revealError?: (path: Path, hasError: boolean) => void\n setFieldInternals?: (path: Path, props: unknown, id?: string) => void\n setValueInternals?: (path: Path, props: unknown) => void\n setHandleSubmit?: (\n callback: HandleSubmitCallback,\n params?: { remove?: boolean }\n ) => void\n setFieldConnection?: (path: Path, connections: FieldConnections) => void\n isEmptyDataRef?: React.MutableRefObject<boolean>\n addSetShowAllErrorsRef?: React.MutableRefObject<\n Array<(showAllErrors: boolean) => void>\n >\n fieldDisplayValueRef?: React.MutableRefObject<\n Record<Path, { type: 'field'; value?: React.ReactNode }>\n >\n fieldInternalsRef?: React.MutableRefObject<FieldInternalsRef>\n valueInternalsRef?: React.MutableRefObject<ValueInternalsRef>\n fieldConnectionsRef?: React.RefObject<Record<Path, FieldConnections>>\n mountedFieldsRef?: React.MutableRefObject<Record<Path, MountState>>\n snapshotsRef?: React.MutableRefObject<\n Map<SnapshotName, Map<Path, unknown>>\n >\n existingFieldsRef?: React.MutableRefObject<Map<Path, boolean>>\n formElementRef?: React.MutableRefObject<HTMLFormElement>\n fieldErrorRef?: React.MutableRefObject<Record<Path, Error>>\n showAllErrors: boolean | number\n hasVisibleError: boolean\n formState: SubmitState\n ajvInstance: Ajv\n contextErrorMessages: GlobalErrorMessagesWithPaths\n schema: AllJSONSchemaVersions\n path?: Path\n disabled?: boolean\n required?: boolean\n countryCode?: CountryCode\n submitState: Partial<EventStateObject>\n prerenderFieldProps?: boolean\n decoupleForm?: boolean\n hasElementRef?: React.MutableRefObject<boolean>\n restHandlerProps?: Record<string, unknown>\n props: ProviderProps<JsonObject>\n}\n\nexport const defaultContextState: ContextState = {\n hasContext: false,\n data: undefined,\n schema: undefined,\n submitState: undefined,\n handlePathChange: () => null,\n handlePathChangeUnvalidated: () => null,\n updateDataValue: () => null,\n setData: () => null,\n validateData: () => null,\n handleSubmit: () => null,\n scrollToTop: () => null,\n showAllErrors: false,\n hasVisibleError: false,\n formState: undefined,\n setFormState: () => null,\n setSubmitState: () => null,\n handleSubmitCall: () => null,\n setShowAllErrors: () => null,\n setMountedFieldState: () => null,\n hasErrors: () => false,\n hasFieldState: () => false,\n hasFieldError: () => false,\n ajvInstance: makeAjvInstance(),\n contextErrorMessages: undefined,\n props: null,\n}\n\nconst Context = React.createContext<ContextState>(defaultContextState)\n\nexport default Context\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAqCC,eAAe,QAAQ,UAAU;AAuNtE,OAAO,MAAMC,mBAAiC,GAAG;EAC/CC,UAAU,EAAE,KAAK;EACjBC,IAAI,EAAEC,SAAS;EACfC,MAAM,EAAED,SAAS;EACjBE,WAAW,EAAEF,SAAS;EACtBG,gBAAgB,EAAEA,CAAA,KAAM,IAAI;EAC5BC,2BAA2B,EAAEA,CAAA,KAAM,IAAI;EACvCC,eAAe,EAAEA,CAAA,KAAM,IAAI;EAC3BC,OAAO,EAAEA,CAAA,KAAM,IAAI;EACnBC,YAAY,EAAEA,CAAA,KAAM,IAAI;EACxBC,YAAY,EAAEA,CAAA,KAAM,IAAI;EACxBC,WAAW,EAAEA,CAAA,KAAM,IAAI;EACvBC,aAAa,EAAE,KAAK;EACpBC,eAAe,EAAE,KAAK;EACtBC,SAAS,EAAEZ,SAAS;EACpBa,YAAY,EAAEA,CAAA,KAAM,IAAI;EACxBC,cAAc,EAAEA,CAAA,KAAM,IAAI;EAC1BC,gBAAgB,EAAEA,CAAA,KAAM,IAAI;EAC5BC,gBAAgB,EAAEA,CAAA,KAAM,IAAI;EAC5BC,oBAAoB,EAAEA,CAAA,KAAM,IAAI;EAChCC,SAAS,EAAEA,CAAA,KAAM,KAAK;EACtBC,aAAa,EAAEA,CAAA,KAAM,KAAK;EAC1BC,aAAa,EAAEA,CAAA,KAAM,KAAK;EAC1BC,WAAW,EAAEzB,eAAe,CAAC,CAAC;EAC9B0B,oBAAoB,EAAEtB,SAAS;EAC/BuB,KAAK,EAAE;AACT,CAAC;AAED,MAAMC,OAAO,GAAG7B,KAAK,CAAC8B,aAAa,CAAe5B,mBAAmB,CAAC;AAEtE,eAAe2B,OAAO","ignoreList":[]}
1
+ {"version":3,"file":"Context.js","names":["React","makeAjvInstance","defaultContextState","hasContext","data","undefined","schema","submitState","handlePathChange","handlePathChangeUnvalidated","updateDataValue","setData","validateData","handleSubmit","scrollToTop","showAllErrors","hasVisibleError","formState","setFormState","setSubmitState","handleSubmitCall","setShowAllErrors","setMountedFieldState","hasErrors","hasFieldState","hasFieldError","ajvInstance","contextErrorMessages","props","Context","createContext"],"sources":["../../../../../src/extensions/forms/DataContext/Context.ts"],"sourcesContent":["import React from 'react'\nimport { Ajv, FormError, JsonObject, makeAjvInstance } from '../utils'\nimport {\n AllJSONSchemaVersions,\n GlobalErrorMessagesWithPaths,\n SubmitState,\n Path,\n EventStateObject,\n EventReturnWithStateObject,\n FieldProps,\n ValueProps,\n OnChange,\n OnSubmitParams,\n CountryCode,\n} from '../types'\nimport { Props as ProviderProps } from './Provider'\nimport { SnapshotName } from '../Form/Snapshot'\nimport { SharedStateId } from '../../../shared/helpers/useSharedState'\n\nexport type MountState = {\n isPreMounted?: boolean\n isMounted?: boolean\n isVisible?: boolean\n isFocused?: boolean\n wasStepChange?: boolean\n}\n\nexport type EventListenerCall = {\n path?: Path\n type?: 'onSubmit' | 'onSubmitRequest' | 'onPathChange' | 'onMount'\n callback: (params?: { value: unknown }) => void | Promise<void | Error>\n}\n\nexport type VisibleDataHandler<Data> = (\n data?: Data,\n options?: VisibleDataOptions\n) => Partial<Data>\nexport type VisibleDataOptions = {\n keepPaths?: Array<Path>\n removePaths?: Array<Path>\n}\nexport type MutateDataHandler<Data> = (\n data: Data,\n mutate: TransformData\n) => Partial<Data>\nexport type FilterDataHandler<Data> = (\n data: Data,\n filter: FilterData\n) => Partial<Data>\nexport type FilterDataHandlerCallback<R> = (\n parameters: FilterDataHandlerParameters\n) => R\nexport type FilterDataHandlerParameters = DataPathHandlerParameters & {\n path: Path\n}\nexport type DataPathHandler<Data = unknown> = (\n parameters: DataPathHandlerParameters<Data>\n) => boolean | undefined\nexport type DataPathHandlerParameters<Data = unknown> = {\n path: Path\n value: unknown\n displayValue: undefined | React.ReactNode | Array<React.ReactNode>\n label: React.ReactNode\n props: FieldProps\n error: Error | undefined\n\n /**\n * Used in the \"filterData\" given by the \"useData\" hook.\n */\n data: Data\n\n /** @deprecated – can be removed in v11 */\n internal: {\n error: Error | undefined\n }\n}\nexport type FilterDataPathObject<Data> = Record<\n Path,\n DataPathHandler<Data> | boolean | undefined\n>\nexport type FilterData<Data = unknown> =\n | FilterDataPathObject<Data>\n | FilterDataHandlerCallback<boolean | undefined>\nexport type VisibleData<Data = unknown> = Partial<Data>\nexport type TransformData = FilterDataHandlerCallback<unknown>\nexport type HandleSubmitCallback = ({\n preventSubmit,\n}: {\n preventSubmit: () => void\n}) => void\nexport type FieldConnections = {\n setEventResult?: (status: EventStateObject) => void\n}\nexport type FieldInternalsRefProps =\n | (FieldProps & { children: unknown })\n | undefined\nexport type FieldInternalsRef = Record<\n Path,\n {\n props: FieldInternalsRefProps\n id: string | undefined\n }\n>\nexport type ValueInternalsRef = Record<\n Path,\n { props: ValueProps | undefined }\n>\n\nexport interface ContextState {\n id?: SharedStateId\n hasContext: boolean\n /** The dataset for the form / form wizard */\n data: any\n internalDataRef?: React.MutableRefObject<any>\n /** Should the form validate data before submitting? */\n errors?: Record<Path, Error>\n /** Will set autoComplete=\"on\" on each nested Field.String and Field.Number */\n autoComplete?: boolean\n handlePathChange: (\n path: Path,\n value?: any\n ) =>\n | EventReturnWithStateObject\n | unknown\n | Promise<EventReturnWithStateObject | unknown>\n handlePathChangeUnvalidated: (path: Path, value: any) => void\n updateDataValue: (\n path: Path,\n value: any,\n options?: { preventUpdate?: boolean }\n ) => void\n setData: (data: any) => void\n clearData?: () => void\n mutateDataHandler?: MutateDataHandler<unknown>\n filterDataHandler?: FilterDataHandler<unknown>\n visibleDataHandler?: VisibleDataHandler<unknown>\n validateData: () => void\n handleSubmit: () => Promise<EventStateObject | undefined>\n scrollToTop: () => void\n setShowAllErrors: (showAllErrors: boolean) => void\n hasErrors: () => boolean\n hasFieldState: (state: SubmitState) => boolean\n hasFieldError: (path: Path) => boolean\n setFieldState?: (path: Path, fieldState: SubmitState) => void\n setFieldError?: (path: Path, error: Error | FormError) => void\n setMountedFieldState: (path: Path, options: MountState) => void\n setFormState?: (\n state: SubmitState,\n options?: { keepPending?: boolean }\n ) => void\n setSubmitState?: (state: EventStateObject) => void\n addOnChangeHandler?: (callback: OnChange) => void\n handleSubmitCall: ({\n onSubmit,\n enableAsyncBehavior,\n skipFieldValidation,\n skipErrorCheck,\n }: {\n onSubmit: () =>\n | EventReturnWithStateObject\n | void\n | Promise<EventReturnWithStateObject | void>\n enableAsyncBehavior: boolean\n skipFieldValidation?: boolean\n skipErrorCheck?: boolean\n }) => Promise<EventStateObject | undefined>\n getSubmitData?: () => unknown\n getSubmitParams?: () => OnSubmitParams\n setFieldEventListener?: (\n path: EventListenerCall['path'],\n type: EventListenerCall['type'],\n callback: EventListenerCall['callback']\n ) => void\n revealError?: (path: Path, hasError: boolean) => void\n setFieldInternals?: (path: Path, props: unknown, id?: string) => void\n setValueInternals?: (path: Path, props: unknown) => void\n setHandleSubmit?: (\n callback: HandleSubmitCallback,\n params?: { remove?: boolean }\n ) => void\n setFieldConnection?: (path: Path, connections: FieldConnections) => void\n isEmptyDataRef?: React.MutableRefObject<boolean>\n addSetShowAllErrorsRef?: React.MutableRefObject<\n Array<(showAllErrors: boolean) => void>\n >\n fieldDisplayValueRef?: React.MutableRefObject<\n Record<Path, { type: 'field'; value?: React.ReactNode }>\n >\n fieldInternalsRef?: React.MutableRefObject<FieldInternalsRef>\n valueInternalsRef?: React.MutableRefObject<ValueInternalsRef>\n fieldConnectionsRef?: React.RefObject<Record<Path, FieldConnections>>\n mountedFieldsRef?: React.MutableRefObject<Map<Path, MountState>>\n snapshotsRef?: React.MutableRefObject<\n Map<SnapshotName, Map<Path, unknown>>\n >\n existingFieldsRef?: React.MutableRefObject<Map<Path, boolean>>\n formElementRef?: React.MutableRefObject<HTMLFormElement>\n fieldErrorRef?: React.MutableRefObject<Record<Path, Error>>\n showAllErrors: boolean | number\n hasVisibleError: boolean\n formState: SubmitState\n ajvInstance: Ajv\n contextErrorMessages: GlobalErrorMessagesWithPaths\n schema: AllJSONSchemaVersions\n path?: Path\n disabled?: boolean\n required?: boolean\n countryCode?: CountryCode\n submitState: Partial<EventStateObject>\n prerenderFieldProps?: boolean\n decoupleForm?: boolean\n hasElementRef?: React.MutableRefObject<boolean>\n restHandlerProps?: Record<string, unknown>\n props: ProviderProps<JsonObject>\n}\n\nexport const defaultContextState: ContextState = {\n hasContext: false,\n data: undefined,\n schema: undefined,\n submitState: undefined,\n handlePathChange: () => null,\n handlePathChangeUnvalidated: () => null,\n updateDataValue: () => null,\n setData: () => null,\n validateData: () => null,\n handleSubmit: () => null,\n scrollToTop: () => null,\n showAllErrors: false,\n hasVisibleError: false,\n formState: undefined,\n setFormState: () => null,\n setSubmitState: () => null,\n handleSubmitCall: () => null,\n setShowAllErrors: () => null,\n setMountedFieldState: () => null,\n hasErrors: () => false,\n hasFieldState: () => false,\n hasFieldError: () => false,\n ajvInstance: makeAjvInstance(),\n contextErrorMessages: undefined,\n props: null,\n}\n\nconst Context = React.createContext<ContextState>(defaultContextState)\n\nexport default Context\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAqCC,eAAe,QAAQ,UAAU;AAuNtE,OAAO,MAAMC,mBAAiC,GAAG;EAC/CC,UAAU,EAAE,KAAK;EACjBC,IAAI,EAAEC,SAAS;EACfC,MAAM,EAAED,SAAS;EACjBE,WAAW,EAAEF,SAAS;EACtBG,gBAAgB,EAAEA,CAAA,KAAM,IAAI;EAC5BC,2BAA2B,EAAEA,CAAA,KAAM,IAAI;EACvCC,eAAe,EAAEA,CAAA,KAAM,IAAI;EAC3BC,OAAO,EAAEA,CAAA,KAAM,IAAI;EACnBC,YAAY,EAAEA,CAAA,KAAM,IAAI;EACxBC,YAAY,EAAEA,CAAA,KAAM,IAAI;EACxBC,WAAW,EAAEA,CAAA,KAAM,IAAI;EACvBC,aAAa,EAAE,KAAK;EACpBC,eAAe,EAAE,KAAK;EACtBC,SAAS,EAAEZ,SAAS;EACpBa,YAAY,EAAEA,CAAA,KAAM,IAAI;EACxBC,cAAc,EAAEA,CAAA,KAAM,IAAI;EAC1BC,gBAAgB,EAAEA,CAAA,KAAM,IAAI;EAC5BC,gBAAgB,EAAEA,CAAA,KAAM,IAAI;EAC5BC,oBAAoB,EAAEA,CAAA,KAAM,IAAI;EAChCC,SAAS,EAAEA,CAAA,KAAM,KAAK;EACtBC,aAAa,EAAEA,CAAA,KAAM,KAAK;EAC1BC,aAAa,EAAEA,CAAA,KAAM,KAAK;EAC1BC,WAAW,EAAEzB,eAAe,CAAC,CAAC;EAC9B0B,oBAAoB,EAAEtB,SAAS;EAC/BuB,KAAK,EAAE;AACT,CAAC;AAED,MAAMC,OAAO,GAAG7B,KAAK,CAAC8B,aAAa,CAAe5B,mBAAmB,CAAC;AAEtE,eAAe2B,OAAO","ignoreList":[]}
@@ -31,12 +31,12 @@ export default function FieldBoundaryProvider(props) {
31
31
  forceUpdate();
32
32
  (_onPathErrorRef$curre = onPathErrorRef.current) === null || _onPathErrorRef$curre === void 0 ? void 0 : _onPathErrorRef$curre.call(onPathErrorRef, path, error);
33
33
  }, []);
34
- const hasVisibleErrorRef = useRef({});
34
+ const hasVisibleErrorRef = useRef(new Map());
35
35
  const revealError = useCallback((path, hasError) => {
36
36
  if (hasError) {
37
- hasVisibleErrorRef.current[path] = hasError;
37
+ hasVisibleErrorRef.current.set(path, hasError);
38
38
  } else {
39
- delete hasVisibleErrorRef.current[path];
39
+ hasVisibleErrorRef.current.delete(path);
40
40
  }
41
41
  forceUpdate();
42
42
  }, []);
@@ -47,7 +47,7 @@ export default function FieldBoundaryProvider(props) {
47
47
  const context = {
48
48
  hasError,
49
49
  hasSubmitError,
50
- hasVisibleError: Object.keys(hasVisibleErrorRef.current).length > 0,
50
+ hasVisibleError: hasVisibleErrorRef.current.size > 0,
51
51
  errorsRef,
52
52
  showBoundaryErrors: showBoundaryErrorsRef.current,
53
53
  setShowBoundaryErrors,
@@ -1 +1 @@
1
- {"version":3,"file":"FieldBoundaryProvider.js","names":["React","useCallback","useContext","useReducer","useRef","FieldBoundaryContext","DataContext","FieldBoundaryProvider","props","showErrors","undefined","onPathError","children","forceUpdate","showAllErrors","onPathErrorRef","current","errorsRef","showBoundaryErrorsRef","hasError","Object","keys","length","hasSubmitError","setFieldError","path","error","_onPathErrorRef$curre","_errorsRef$current","call","hasVisibleErrorRef","revealError","setShowBoundaryErrors","showBoundaryErrors","Date","now","context","hasVisibleError","createElement","Provider","value"],"sources":["../../../../../../src/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.tsx"],"sourcesContent":["import React, { useCallback, useContext, useReducer, useRef } from 'react'\nimport FieldBoundaryContext, {\n FieldBoundaryContextState,\n} from './FieldBoundaryContext'\nimport DataContext from '../Context'\nimport { Path } from '../../types'\n\nexport type Props = {\n showErrors?: boolean\n onPathError?: (path: Path, error: Error) => void\n children: React.ReactNode\n}\n\nexport default function FieldBoundaryProvider(props: Props) {\n const { showErrors = undefined, onPathError = null, children } = props\n const [, forceUpdate] = useReducer(() => ({}), {})\n const { showAllErrors } = useContext(DataContext)\n\n const onPathErrorRef = useRef(onPathError)\n onPathErrorRef.current = onPathError\n const errorsRef = useRef<Record<Path, boolean>>({})\n const showBoundaryErrorsRef =\n useRef<FieldBoundaryContextState['showBoundaryErrors']>(showErrors)\n const hasError = Object.keys(errorsRef.current).length > 0\n const hasSubmitError = showAllErrors && hasError\n\n const setFieldError = useCallback((path: Path, error: Error) => {\n if (error) {\n errorsRef.current[path] = !!error\n } else {\n delete errorsRef.current?.[path]\n }\n forceUpdate()\n onPathErrorRef.current?.(path, error)\n }, [])\n\n const hasVisibleErrorRef = useRef<Record<Path, boolean>>({})\n const revealError = useCallback((path: Path, hasError: boolean) => {\n if (hasError) {\n hasVisibleErrorRef.current[path] = hasError\n } else {\n delete hasVisibleErrorRef.current[path]\n }\n forceUpdate()\n }, [])\n\n const setShowBoundaryErrors: FieldBoundaryContextState['setShowBoundaryErrors'] =\n useCallback((showBoundaryErrors) => {\n showBoundaryErrorsRef.current = showBoundaryErrors\n ? Date.now() // in order to renew the internal dependency \"showBoundaryErrors\"\n : false\n forceUpdate()\n }, [])\n\n const context: FieldBoundaryContextState = {\n hasError,\n hasSubmitError,\n hasVisibleError: Object.keys(hasVisibleErrorRef.current).length > 0,\n errorsRef,\n showBoundaryErrors: showBoundaryErrorsRef.current,\n setShowBoundaryErrors,\n setFieldError,\n revealError,\n }\n\n return (\n <FieldBoundaryContext.Provider value={context}>\n {children}\n </FieldBoundaryContext.Provider>\n )\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,UAAU,EAAEC,UAAU,EAAEC,MAAM,QAAQ,OAAO;AAC1E,OAAOC,oBAAoB,MAEpB,wBAAwB;AAC/B,OAAOC,WAAW,MAAM,YAAY;AASpC,eAAe,SAASC,qBAAqBA,CAACC,KAAY,EAAE;EAC1D,MAAM;IAAEC,UAAU,GAAGC,SAAS;IAAEC,WAAW,GAAG,IAAI;IAAEC;EAAS,CAAC,GAAGJ,KAAK;EACtE,MAAM,GAAGK,WAAW,CAAC,GAAGV,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAClD,MAAM;IAAEW;EAAc,CAAC,GAAGZ,UAAU,CAACI,WAAW,CAAC;EAEjD,MAAMS,cAAc,GAAGX,MAAM,CAACO,WAAW,CAAC;EAC1CI,cAAc,CAACC,OAAO,GAAGL,WAAW;EACpC,MAAMM,SAAS,GAAGb,MAAM,CAAwB,CAAC,CAAC,CAAC;EACnD,MAAMc,qBAAqB,GACzBd,MAAM,CAAkDK,UAAU,CAAC;EACrE,MAAMU,QAAQ,GAAGC,MAAM,CAACC,IAAI,CAACJ,SAAS,CAACD,OAAO,CAAC,CAACM,MAAM,GAAG,CAAC;EAC1D,MAAMC,cAAc,GAAGT,aAAa,IAAIK,QAAQ;EAEhD,MAAMK,aAAa,GAAGvB,WAAW,CAAC,CAACwB,IAAU,EAAEC,KAAY,KAAK;IAAA,IAAAC,qBAAA;IAC9D,IAAID,KAAK,EAAE;MACTT,SAAS,CAACD,OAAO,CAACS,IAAI,CAAC,GAAG,CAAC,CAACC,KAAK;IACnC,CAAC,MAAM;MAAA,IAAAE,kBAAA;MACL,CAAAA,kBAAA,GAAOX,SAAS,CAACD,OAAO,cAAAY,kBAAA,qBAAxB,OAAOA,kBAAA,CAAoBH,IAAI,CAAC;IAClC;IACAZ,WAAW,CAAC,CAAC;IACb,CAAAc,qBAAA,GAAAZ,cAAc,CAACC,OAAO,cAAAW,qBAAA,uBAAtBA,qBAAA,CAAAE,IAAA,CAAAd,cAAc,EAAWU,IAAI,EAAEC,KAAK,CAAC;EACvC,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMI,kBAAkB,GAAG1B,MAAM,CAAwB,CAAC,CAAC,CAAC;EAC5D,MAAM2B,WAAW,GAAG9B,WAAW,CAAC,CAACwB,IAAU,EAAEN,QAAiB,KAAK;IACjE,IAAIA,QAAQ,EAAE;MACZW,kBAAkB,CAACd,OAAO,CAACS,IAAI,CAAC,GAAGN,QAAQ;IAC7C,CAAC,MAAM;MACL,OAAOW,kBAAkB,CAACd,OAAO,CAACS,IAAI,CAAC;IACzC;IACAZ,WAAW,CAAC,CAAC;EACf,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMmB,qBAAyE,GAC7E/B,WAAW,CAAEgC,kBAAkB,IAAK;IAClCf,qBAAqB,CAACF,OAAO,GAAGiB,kBAAkB,GAC9CC,IAAI,CAACC,GAAG,CAAC,CAAC,GACV,KAAK;IACTtB,WAAW,CAAC,CAAC;EACf,CAAC,EAAE,EAAE,CAAC;EAER,MAAMuB,OAAkC,GAAG;IACzCjB,QAAQ;IACRI,cAAc;IACdc,eAAe,EAAEjB,MAAM,CAACC,IAAI,CAACS,kBAAkB,CAACd,OAAO,CAAC,CAACM,MAAM,GAAG,CAAC;IACnEL,SAAS;IACTgB,kBAAkB,EAAEf,qBAAqB,CAACF,OAAO;IACjDgB,qBAAqB;IACrBR,aAAa;IACbO;EACF,CAAC;EAED,OACE/B,KAAA,CAAAsC,aAAA,CAACjC,oBAAoB,CAACkC,QAAQ;IAACC,KAAK,EAAEJ;EAAQ,GAC3CxB,QAC4B,CAAC;AAEpC","ignoreList":[]}
1
+ {"version":3,"file":"FieldBoundaryProvider.js","names":["React","useCallback","useContext","useReducer","useRef","FieldBoundaryContext","DataContext","FieldBoundaryProvider","props","showErrors","undefined","onPathError","children","forceUpdate","showAllErrors","onPathErrorRef","current","errorsRef","showBoundaryErrorsRef","hasError","Object","keys","length","hasSubmitError","setFieldError","path","error","_onPathErrorRef$curre","_errorsRef$current","call","hasVisibleErrorRef","Map","revealError","set","delete","setShowBoundaryErrors","showBoundaryErrors","Date","now","context","hasVisibleError","size","createElement","Provider","value"],"sources":["../../../../../../src/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.tsx"],"sourcesContent":["import React, { useCallback, useContext, useReducer, useRef } from 'react'\nimport FieldBoundaryContext, {\n FieldBoundaryContextState,\n} from './FieldBoundaryContext'\nimport DataContext from '../Context'\nimport { Path } from '../../types'\n\nexport type Props = {\n showErrors?: boolean\n onPathError?: (path: Path, error: Error) => void\n children: React.ReactNode\n}\n\nexport default function FieldBoundaryProvider(props: Props) {\n const { showErrors = undefined, onPathError = null, children } = props\n const [, forceUpdate] = useReducer(() => ({}), {})\n const { showAllErrors } = useContext(DataContext)\n\n const onPathErrorRef = useRef(onPathError)\n onPathErrorRef.current = onPathError\n const errorsRef = useRef<Record<Path, boolean>>({})\n const showBoundaryErrorsRef =\n useRef<FieldBoundaryContextState['showBoundaryErrors']>(showErrors)\n const hasError = Object.keys(errorsRef.current).length > 0\n const hasSubmitError = showAllErrors && hasError\n\n const setFieldError = useCallback((path: Path, error: Error) => {\n if (error) {\n errorsRef.current[path] = !!error\n } else {\n delete errorsRef.current?.[path]\n }\n forceUpdate()\n onPathErrorRef.current?.(path, error)\n }, [])\n\n const hasVisibleErrorRef = useRef<Map<Path, boolean>>(new Map())\n const revealError = useCallback((path: Path, hasError: boolean) => {\n if (hasError) {\n hasVisibleErrorRef.current.set(path, hasError)\n } else {\n hasVisibleErrorRef.current.delete(path)\n }\n forceUpdate()\n }, [])\n\n const setShowBoundaryErrors: FieldBoundaryContextState['setShowBoundaryErrors'] =\n useCallback((showBoundaryErrors) => {\n showBoundaryErrorsRef.current = showBoundaryErrors\n ? Date.now() // in order to renew the internal dependency \"showBoundaryErrors\"\n : false\n forceUpdate()\n }, [])\n\n const context: FieldBoundaryContextState = {\n hasError,\n hasSubmitError,\n hasVisibleError: hasVisibleErrorRef.current.size > 0,\n errorsRef,\n showBoundaryErrors: showBoundaryErrorsRef.current,\n setShowBoundaryErrors,\n setFieldError,\n revealError,\n }\n\n return (\n <FieldBoundaryContext.Provider value={context}>\n {children}\n </FieldBoundaryContext.Provider>\n )\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,UAAU,EAAEC,UAAU,EAAEC,MAAM,QAAQ,OAAO;AAC1E,OAAOC,oBAAoB,MAEpB,wBAAwB;AAC/B,OAAOC,WAAW,MAAM,YAAY;AASpC,eAAe,SAASC,qBAAqBA,CAACC,KAAY,EAAE;EAC1D,MAAM;IAAEC,UAAU,GAAGC,SAAS;IAAEC,WAAW,GAAG,IAAI;IAAEC;EAAS,CAAC,GAAGJ,KAAK;EACtE,MAAM,GAAGK,WAAW,CAAC,GAAGV,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAClD,MAAM;IAAEW;EAAc,CAAC,GAAGZ,UAAU,CAACI,WAAW,CAAC;EAEjD,MAAMS,cAAc,GAAGX,MAAM,CAACO,WAAW,CAAC;EAC1CI,cAAc,CAACC,OAAO,GAAGL,WAAW;EACpC,MAAMM,SAAS,GAAGb,MAAM,CAAwB,CAAC,CAAC,CAAC;EACnD,MAAMc,qBAAqB,GACzBd,MAAM,CAAkDK,UAAU,CAAC;EACrE,MAAMU,QAAQ,GAAGC,MAAM,CAACC,IAAI,CAACJ,SAAS,CAACD,OAAO,CAAC,CAACM,MAAM,GAAG,CAAC;EAC1D,MAAMC,cAAc,GAAGT,aAAa,IAAIK,QAAQ;EAEhD,MAAMK,aAAa,GAAGvB,WAAW,CAAC,CAACwB,IAAU,EAAEC,KAAY,KAAK;IAAA,IAAAC,qBAAA;IAC9D,IAAID,KAAK,EAAE;MACTT,SAAS,CAACD,OAAO,CAACS,IAAI,CAAC,GAAG,CAAC,CAACC,KAAK;IACnC,CAAC,MAAM;MAAA,IAAAE,kBAAA;MACL,CAAAA,kBAAA,GAAOX,SAAS,CAACD,OAAO,cAAAY,kBAAA,qBAAxB,OAAOA,kBAAA,CAAoBH,IAAI,CAAC;IAClC;IACAZ,WAAW,CAAC,CAAC;IACb,CAAAc,qBAAA,GAAAZ,cAAc,CAACC,OAAO,cAAAW,qBAAA,uBAAtBA,qBAAA,CAAAE,IAAA,CAAAd,cAAc,EAAWU,IAAI,EAAEC,KAAK,CAAC;EACvC,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMI,kBAAkB,GAAG1B,MAAM,CAAqB,IAAI2B,GAAG,CAAC,CAAC,CAAC;EAChE,MAAMC,WAAW,GAAG/B,WAAW,CAAC,CAACwB,IAAU,EAAEN,QAAiB,KAAK;IACjE,IAAIA,QAAQ,EAAE;MACZW,kBAAkB,CAACd,OAAO,CAACiB,GAAG,CAACR,IAAI,EAAEN,QAAQ,CAAC;IAChD,CAAC,MAAM;MACLW,kBAAkB,CAACd,OAAO,CAACkB,MAAM,CAACT,IAAI,CAAC;IACzC;IACAZ,WAAW,CAAC,CAAC;EACf,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMsB,qBAAyE,GAC7ElC,WAAW,CAAEmC,kBAAkB,IAAK;IAClClB,qBAAqB,CAACF,OAAO,GAAGoB,kBAAkB,GAC9CC,IAAI,CAACC,GAAG,CAAC,CAAC,GACV,KAAK;IACTzB,WAAW,CAAC,CAAC;EACf,CAAC,EAAE,EAAE,CAAC;EAER,MAAM0B,OAAkC,GAAG;IACzCpB,QAAQ;IACRI,cAAc;IACdiB,eAAe,EAAEV,kBAAkB,CAACd,OAAO,CAACyB,IAAI,GAAG,CAAC;IACpDxB,SAAS;IACTmB,kBAAkB,EAAElB,qBAAqB,CAACF,OAAO;IACjDmB,qBAAqB;IACrBX,aAAa;IACbQ;EACF,CAAC;EAED,OACEhC,KAAA,CAAA0C,aAAA,CAACrC,oBAAoB,CAACsC,QAAQ;IAACC,KAAK,EAAEL;EAAQ,GAC3C3B,QAC4B,CAAC;AAEpC","ignoreList":[]}
@@ -69,10 +69,10 @@ export default function Provider(props) {
69
69
  } = useContext(SharedContext) || {};
70
70
  const translation = useTranslation().Field;
71
71
  const ajvRef = useRef(makeAjvInstance(ajvInstance));
72
- const mountedFieldsRef = useRef({});
72
+ const mountedFieldsRef = useRef(new Map());
73
73
  const snapshotsRef = useRef(new Map());
74
74
  const existingFieldsRef = useRef(new Map());
75
- const hasVisibleErrorRef = useRef({});
75
+ const hasVisibleErrorRef = useRef(new Map());
76
76
  const errorsRef = useRef();
77
77
  const addSetShowAllErrorsRef = useRef([]);
78
78
  const showAllErrorsRef = useRef(false);
@@ -83,9 +83,9 @@ export default function Provider(props) {
83
83
  }, []);
84
84
  const revealError = useCallback((path, hasError) => {
85
85
  if (hasError) {
86
- hasVisibleErrorRef.current[path] = hasError;
86
+ hasVisibleErrorRef.current.set(path, hasError);
87
87
  } else {
88
- delete hasVisibleErrorRef.current[path];
88
+ hasVisibleErrorRef.current.delete(path);
89
89
  }
90
90
  forceUpdate();
91
91
  }, []);
@@ -142,22 +142,16 @@ export default function Provider(props) {
142
142
  return Boolean(state === 'error' ? ((_errorsRef$current = errorsRef.current) === null || _errorsRef$current === void 0 ? void 0 : _errorsRef$current[path]) instanceof Error || fieldErrorRef.current[path] instanceof Error : fieldStateRef.current[path] === state);
143
143
  }, []);
144
144
  const hasFieldState = useCallback(state => {
145
- for (const path in mountedFieldsRef.current) {
146
- const item = mountedFieldsRef.current[path];
147
- if (item.isMounted && checkFieldStateFor(path, state)) {
148
- return true;
149
- }
150
- }
151
- return false;
145
+ return Array.from(mountedFieldsRef.current.entries()).some(_ref => {
146
+ let [path, item] = _ref;
147
+ return item.isMounted && checkFieldStateFor(path, state);
148
+ });
152
149
  }, [checkFieldStateFor]);
153
150
  const hasFieldError = useCallback(path => {
154
- for (const p in mountedFieldsRef.current) {
155
- const item = mountedFieldsRef.current[path];
156
- if (item.isMounted && p === path && checkFieldStateFor(path, 'error')) {
157
- return true;
158
- }
159
- }
160
- return false;
151
+ return Array.from(mountedFieldsRef.current.entries()).some(_ref2 => {
152
+ let [p, item] = _ref2;
153
+ return item.isMounted && p === path && checkFieldStateFor(path, 'error');
154
+ });
161
155
  }, [checkFieldStateFor]);
162
156
  const hasErrors = useCallback(() => {
163
157
  return hasFieldState('error');
@@ -238,11 +232,11 @@ export default function Provider(props) {
238
232
  }
239
233
  return data;
240
234
  } else if (handler) {
241
- const runFilter = _ref => {
235
+ const runFilter = _ref3 => {
242
236
  let {
243
237
  path,
244
238
  condition
245
- } = _ref;
239
+ } = _ref3;
246
240
  const exists = pointer.has(data, path);
247
241
  if (exists) {
248
242
  const result = typeof condition === 'function' ? condition(getDataPathHandlerParameters(path, data)) : condition;
@@ -250,8 +244,8 @@ export default function Provider(props) {
250
244
  }
251
245
  };
252
246
  const wildcardPaths = [];
253
- Object.entries(handler).forEach(_ref2 => {
254
- let [path, condition] = _ref2;
247
+ Object.entries(handler).forEach(_ref4 => {
248
+ let [path, condition] = _ref4;
255
249
  if (path.includes('*')) {
256
250
  const parts = path.split(/\/\*/g);
257
251
  const exists = pointer.has(data, parts[0]);
@@ -292,12 +286,11 @@ export default function Provider(props) {
292
286
  removePaths
293
287
  } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
294
288
  const visibleData = {};
295
- for (const path in mountedFieldsRef.current) {
296
- const item = mountedFieldsRef.current[path];
289
+ mountedFieldsRef.current.forEach((item, path) => {
297
290
  if (item && item.isVisible !== false && (item.isPreMounted !== false || item.wasStepChange === true) && (removePaths ? !removePaths.includes(path) : true) && pointer.has(data, path)) {
298
291
  pointer.set(visibleData, path, pointer.get(data, path));
299
292
  }
300
- }
293
+ });
301
294
  if (keepPaths) {
302
295
  keepPaths.forEach(path => {
303
296
  if (pointer.has(data, path)) {
@@ -340,7 +333,7 @@ export default function Provider(props) {
340
333
  const hasFieldWithAsyncValidator = useCallback(() => {
341
334
  for (const path in fieldInternalsRef.current) {
342
335
  var _mountedFieldsRef$cur;
343
- if ((_mountedFieldsRef$cur = mountedFieldsRef.current[path]) !== null && _mountedFieldsRef$cur !== void 0 && _mountedFieldsRef$cur.isMounted) {
336
+ if ((_mountedFieldsRef$cur = mountedFieldsRef.current.get(path)) !== null && _mountedFieldsRef$cur !== void 0 && _mountedFieldsRef$cur.isMounted) {
344
337
  var _fieldInternalsRef$cu2;
345
338
  const props = (_fieldInternalsRef$cu2 = fieldInternalsRef.current[path]) === null || _fieldInternalsRef$cu2 === void 0 ? void 0 : _fieldInternalsRef$cu2.props;
346
339
  if (isAsync(props === null || props === void 0 ? void 0 : props.onChangeValidator) || isAsync(props === null || props === void 0 ? void 0 : props.onBlurValidator)) {
@@ -388,9 +381,9 @@ export default function Provider(props) {
388
381
  }, [id, initialData, sharedData, data]);
389
382
  internalDataRef.current = props.path && pointer.has(internalData, props.path) ? pointer.get(internalData, props.path) : internalData;
390
383
  const clearData = useCallback(() => {
391
- var _ref3, _requestAnimationFram;
384
+ var _ref5, _requestAnimationFram;
392
385
  isEmptyDataRef.current = true;
393
- internalDataRef.current = (_ref3 = typeof emptyData === 'function' ? emptyData(internalDataRef.current) : emptyData) !== null && _ref3 !== void 0 ? _ref3 : Array.isArray(internalDataRef.current) ? [] : clearedData;
386
+ internalDataRef.current = (_ref5 = typeof emptyData === 'function' ? emptyData(internalDataRef.current) : emptyData) !== null && _ref5 !== void 0 ? _ref5 : Array.isArray(internalDataRef.current) ? [] : clearedData;
394
387
  if (id) {
395
388
  setSharedData(internalDataRef.current);
396
389
  }
@@ -514,11 +507,7 @@ export default function Provider(props) {
514
507
  }
515
508
  }, []);
516
509
  const setMountedFieldState = useCallback((path, state) => {
517
- if (!mountedFieldsRef.current[path]) {
518
- mountedFieldsRef.current[path] = _objectSpread({}, state);
519
- } else {
520
- Object.assign(mountedFieldsRef.current[path], state);
521
- }
510
+ mountedFieldsRef.current.set(path, _objectSpread(_objectSpread({}, mountedFieldsRef.current.get(path)), state));
522
511
  for (const itm of fieldEventListenersRef.current) {
523
512
  if (itm.type === 'onMount' && itm.path === path) {
524
513
  const {
@@ -560,7 +549,7 @@ export default function Provider(props) {
560
549
  type,
561
550
  callback
562
551
  } = item;
563
- if (type === 'onSubmit' && (_mountedFieldsRef$cur2 = mountedFieldsRef.current[path]) !== null && _mountedFieldsRef$cur2 !== void 0 && _mountedFieldsRef$cur2.isMounted) {
552
+ if (type === 'onSubmit' && (_mountedFieldsRef$cur2 = mountedFieldsRef.current.get(path)) !== null && _mountedFieldsRef$cur2 !== void 0 && _mountedFieldsRef$cur2.isMounted) {
564
553
  if (asyncBehaviorIsEnabled) {
565
554
  await callback();
566
555
  } else {
@@ -624,13 +613,18 @@ export default function Provider(props) {
624
613
  onSubmitRequest === null || onSubmitRequest === void 0 ? void 0 : onSubmitRequest({
625
614
  getErrors: () => Object.keys(fieldErrorRef.current).map(path => {
626
615
  return getDataPathHandlerParameters(path);
627
- }).filter(_ref4 => {
616
+ }).filter(_ref6 => {
628
617
  let {
629
618
  error
630
- } = _ref4;
619
+ } = _ref6;
631
620
  return error;
632
621
  })
633
622
  });
623
+ for (const itm of fieldEventListenersRef.current) {
624
+ if (itm.type === 'onSubmitRequest') {
625
+ itm.callback();
626
+ }
627
+ }
634
628
  }
635
629
  return result;
636
630
  }, [clearData, getDataPathHandlerParameters, hasErrors, hasFieldState, hasFieldWithAsyncValidator, isolate, onCommit, onSubmitRequest, setFormState, setShowAllErrors, setSubmitState]);
@@ -669,10 +663,10 @@ export default function Provider(props) {
669
663
  const transformData = (data, handler) => {
670
664
  return mutateDataHandler(data, handler, {
671
665
  mutate: false,
672
- fireHandlerWhen: _ref5 => {
666
+ fireHandlerWhen: _ref7 => {
673
667
  let {
674
668
  type
675
- } = _ref5;
669
+ } = _ref7;
676
670
  return type === 'field';
677
671
  }
678
672
  });
@@ -724,12 +718,12 @@ export default function Provider(props) {
724
718
  }, [getSubmitData, getSubmitParams, handleSubmitCall, handleSubmitListeners, onSubmit, onSubmitComplete, scrollToTop, scrollTopOnSubmit]);
725
719
  const fieldEventListenersRef = useRef([]);
726
720
  const setFieldEventListener = useCallback((path, type, callback) => {
727
- fieldEventListenersRef.current = fieldEventListenersRef.current.filter(_ref6 => {
721
+ fieldEventListenersRef.current = fieldEventListenersRef.current.filter(_ref8 => {
728
722
  let {
729
723
  path: p,
730
724
  type: t,
731
725
  callback: c
732
- } = _ref6;
726
+ } = _ref8;
733
727
  return !(p === path && t === type && c === callback);
734
728
  });
735
729
  fieldEventListenersRef.current.push({
@@ -858,7 +852,7 @@ export default function Provider(props) {
858
852
  hasContext: true,
859
853
  errors: errorsRef.current,
860
854
  showAllErrors: showAllErrorsRef.current,
861
- hasVisibleError: Object.keys(hasVisibleErrorRef.current).length > 0,
855
+ hasVisibleError: hasVisibleErrorRef.current.size > 0,
862
856
  addSetShowAllErrorsRef,
863
857
  fieldConnectionsRef,
864
858
  fieldDisplayValueRef,