@dnb/eufemia 10.62.4 → 10.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (892) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/cjs/components/accordion/Accordion.d.ts +1 -125
  3. package/cjs/components/accordion/Accordion.js +0 -1
  4. package/cjs/components/accordion/Accordion.js.map +1 -1
  5. package/cjs/components/autocomplete/Autocomplete.js +3 -2
  6. package/cjs/components/autocomplete/Autocomplete.js.map +1 -1
  7. package/cjs/components/button/Button.d.ts +3 -6
  8. package/cjs/components/button/Button.js +8 -18
  9. package/cjs/components/button/Button.js.map +1 -1
  10. package/cjs/components/button/ButtonDocs.d.ts +2 -0
  11. package/cjs/components/button/ButtonDocs.js +135 -0
  12. package/cjs/components/button/ButtonDocs.js.map +1 -0
  13. package/cjs/components/date-picker/DatePicker.d.ts +4 -0
  14. package/cjs/components/date-picker/DatePicker.js +24 -10
  15. package/cjs/components/date-picker/DatePicker.js.map +1 -1
  16. package/cjs/components/date-picker/DatePickerDocs.js +5 -0
  17. package/cjs/components/date-picker/DatePickerDocs.js.map +1 -1
  18. package/cjs/components/date-picker/DatePickerPortal.d.ts +9 -0
  19. package/cjs/components/date-picker/DatePickerPortal.js +61 -0
  20. package/cjs/components/date-picker/DatePickerPortal.js.map +1 -0
  21. package/cjs/components/date-picker/style/dnb-date-picker.css +64 -55
  22. package/cjs/components/date-picker/style/dnb-date-picker.min.css +1 -1
  23. package/cjs/components/date-picker/style/dnb-date-picker.scss +90 -75
  24. package/cjs/components/form-row/FormRow.js +2 -7
  25. package/cjs/components/form-row/FormRow.js.map +1 -1
  26. package/cjs/components/form-row/style/dnb-form-row.css +3 -3
  27. package/cjs/components/form-row/style/dnb-form-row.min.css +1 -1
  28. package/cjs/components/form-status/FormStatus.js +17 -19
  29. package/cjs/components/form-status/FormStatus.js.map +1 -1
  30. package/cjs/components/height-animation/HeightAnimationInstance.d.ts +1 -0
  31. package/cjs/components/height-animation/HeightAnimationInstance.js +26 -1
  32. package/cjs/components/height-animation/HeightAnimationInstance.js.map +1 -1
  33. package/cjs/components/input-masked/InputMasked.d.ts +1 -1
  34. package/cjs/components/input-masked/InputMasked.js +2 -2
  35. package/cjs/components/input-masked/InputMasked.js.map +1 -1
  36. package/cjs/components/input-masked/InputMaskedDocs.js +1 -1
  37. package/cjs/components/input-masked/InputMaskedDocs.js.map +1 -1
  38. package/cjs/components/input-masked/InputMaskedHooks.js +1 -1
  39. package/cjs/components/input-masked/InputMaskedHooks.js.map +1 -1
  40. package/cjs/components/input-masked/InputMaskedUtils.js +1 -1
  41. package/cjs/components/input-masked/InputMaskedUtils.js.map +1 -1
  42. package/cjs/components/input-masked/style/dnb-input-masked.css +3 -3
  43. package/cjs/components/input-masked/style/dnb-input-masked.min.css +1 -1
  44. package/cjs/components/pagination/Pagination.d.ts +12 -0
  45. package/cjs/components/pagination/Pagination.js +7 -3
  46. package/cjs/components/pagination/Pagination.js.map +1 -1
  47. package/cjs/components/pagination/PaginationBar.d.ts +2 -1
  48. package/cjs/components/pagination/PaginationBar.js +10 -3
  49. package/cjs/components/pagination/PaginationBar.js.map +1 -1
  50. package/cjs/components/radio/style/dnb-radio.css +3 -3
  51. package/cjs/components/radio/style/dnb-radio.min.css +1 -1
  52. package/cjs/components/space/style/dnb-space.css +4 -4
  53. package/cjs/components/space/style/dnb-space.min.css +1 -1
  54. package/cjs/components/space/style/dnb-space.scss +2 -12
  55. package/cjs/components/space/style/space-mixins.scss +21 -0
  56. package/cjs/components/tabs/Tabs.d.ts +1 -1
  57. package/cjs/components/tabs/Tabs.js +4 -12
  58. package/cjs/components/tabs/Tabs.js.map +1 -1
  59. package/cjs/components/toggle-button/ToggleButton.d.ts +9 -5
  60. package/cjs/components/toggle-button/ToggleButton.js +2 -0
  61. package/cjs/components/toggle-button/ToggleButton.js.map +1 -1
  62. package/cjs/components/toggle-button/ToggleButtonDocs.d.ts +2 -0
  63. package/cjs/components/toggle-button/ToggleButtonDocs.js +87 -0
  64. package/cjs/components/toggle-button/ToggleButtonDocs.js.map +1 -0
  65. package/cjs/components/toggle-button/ToggleButtonGroup.d.ts +21 -6
  66. package/cjs/components/toggle-button/ToggleButtonGroupDocs.d.ts +2 -0
  67. package/cjs/components/toggle-button/ToggleButtonGroupDocs.js +90 -0
  68. package/cjs/components/toggle-button/ToggleButtonGroupDocs.js.map +1 -0
  69. package/cjs/components/toggle-button/style/dnb-toggle-button.css +3 -3
  70. package/cjs/components/toggle-button/style/dnb-toggle-button.min.css +1 -1
  71. package/cjs/elements/blockquote/style/blockquote-mixins.scss +5 -3
  72. package/cjs/elements/code/style/code-mixins.scss +2 -3
  73. package/cjs/elements/hr/style/hr-mixins.scss +2 -3
  74. package/cjs/elements/img/style/img-mixins.scss +3 -3
  75. package/cjs/elements/lists/style/lists-mixins.scss +3 -6
  76. package/cjs/elements/typography/style/typography-mixins.scss +2 -3
  77. package/cjs/extensions/forms/DataContext/Context.d.ts +15 -4
  78. package/cjs/extensions/forms/DataContext/Context.js.map +1 -1
  79. package/cjs/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js +1 -1
  80. package/cjs/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js.map +1 -1
  81. package/cjs/extensions/forms/DataContext/Provider/Provider.js +28 -17
  82. package/cjs/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  83. package/cjs/extensions/forms/Field/ArraySelection/ArraySelection.js +3 -3
  84. package/cjs/extensions/forms/Field/ArraySelection/ArraySelection.js.map +1 -1
  85. package/cjs/extensions/forms/Field/Date/Date.js +5 -4
  86. package/cjs/extensions/forms/Field/Date/Date.js.map +1 -1
  87. package/cjs/extensions/forms/Field/Expiry/Expiry.js +4 -3
  88. package/cjs/extensions/forms/Field/Expiry/Expiry.js.map +1 -1
  89. package/cjs/extensions/forms/Field/Indeterminate/useDependencePaths.js +7 -7
  90. package/cjs/extensions/forms/Field/Indeterminate/useDependencePaths.js.map +1 -1
  91. package/cjs/extensions/forms/Field/Number/Number.js +2 -2
  92. package/cjs/extensions/forms/Field/Number/Number.js.map +1 -1
  93. package/cjs/extensions/forms/Field/Option/Option.d.ts +2 -1
  94. package/cjs/extensions/forms/Field/Option/Option.js +2 -14
  95. package/cjs/extensions/forms/Field/Option/Option.js.map +1 -1
  96. package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumber.js +10 -5
  97. package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
  98. package/cjs/extensions/forms/Field/Provider/useFieldProvider.d.ts +4 -3
  99. package/cjs/extensions/forms/Field/SelectCountry/SelectCountry.js +12 -4
  100. package/cjs/extensions/forms/Field/SelectCountry/SelectCountry.js.map +1 -1
  101. package/cjs/extensions/forms/Field/Selection/Selection.d.ts +8 -1
  102. package/cjs/extensions/forms/Field/Selection/Selection.js +19 -12
  103. package/cjs/extensions/forms/Field/Selection/Selection.js.map +1 -1
  104. package/cjs/extensions/forms/Field/Selection/SelectionDocs.js +5 -0
  105. package/cjs/extensions/forms/Field/Selection/SelectionDocs.js.map +1 -1
  106. package/cjs/extensions/forms/Field/Slider/Slider.js +4 -3
  107. package/cjs/extensions/forms/Field/Slider/Slider.js.map +1 -1
  108. package/cjs/extensions/forms/Field/String/String.js +2 -2
  109. package/cjs/extensions/forms/Field/String/String.js.map +1 -1
  110. package/cjs/extensions/forms/Field/Toggle/Toggle.js +14 -4
  111. package/cjs/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
  112. package/cjs/extensions/forms/Field/Upload/Upload.js +21 -21
  113. package/cjs/extensions/forms/Field/Upload/Upload.js.map +1 -1
  114. package/cjs/extensions/forms/FieldBlock/FieldBlock.js +14 -38
  115. package/cjs/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
  116. package/cjs/extensions/forms/FieldBlock/style/dnb-field-block.css +3 -3
  117. package/cjs/extensions/forms/FieldBlock/style/dnb-field-block.min.css +1 -1
  118. package/cjs/extensions/forms/Form/Isolation/Isolation.js +17 -3
  119. package/cjs/extensions/forms/Form/Isolation/Isolation.js.map +1 -1
  120. package/cjs/extensions/forms/Form/MainHeading/MainHeadingDocs.d.ts +2 -0
  121. package/cjs/extensions/forms/Form/MainHeading/MainHeadingDocs.js +27 -0
  122. package/cjs/extensions/forms/Form/MainHeading/MainHeadingDocs.js.map +1 -0
  123. package/cjs/extensions/forms/Form/Section/EditContainer/CancelButton.js +7 -18
  124. package/cjs/extensions/forms/Form/Section/EditContainer/CancelButton.js.map +1 -1
  125. package/cjs/extensions/forms/Form/SubHeading/SubHeadingDocs.d.ts +2 -0
  126. package/cjs/extensions/forms/Form/SubHeading/SubHeadingDocs.js +27 -0
  127. package/cjs/extensions/forms/Form/SubHeading/SubHeadingDocs.js.map +1 -0
  128. package/cjs/extensions/forms/Form/Visibility/Visibility.d.ts +11 -1
  129. package/cjs/extensions/forms/Form/Visibility/Visibility.js +18 -10
  130. package/cjs/extensions/forms/Form/Visibility/Visibility.js.map +1 -1
  131. package/cjs/extensions/forms/Form/Visibility/VisibilityContext.d.ts +2 -0
  132. package/cjs/extensions/forms/Form/Visibility/VisibilityContext.js.map +1 -1
  133. package/cjs/extensions/forms/Form/Visibility/VisibilityDocs.js +1 -1
  134. package/cjs/extensions/forms/Form/Visibility/VisibilityDocs.js.map +1 -1
  135. package/cjs/extensions/forms/Form/Visibility/useVisibility.js +18 -9
  136. package/cjs/extensions/forms/Form/Visibility/useVisibility.js.map +1 -1
  137. package/cjs/extensions/forms/Iterate/Array/Array.js +49 -29
  138. package/cjs/extensions/forms/Iterate/Array/Array.js.map +1 -1
  139. package/cjs/extensions/forms/Iterate/Array/ArrayDocs.js +14 -4
  140. package/cjs/extensions/forms/Iterate/Array/ArrayDocs.js.map +1 -1
  141. package/cjs/extensions/forms/Iterate/Array/types.d.ts +8 -3
  142. package/cjs/extensions/forms/Iterate/Array/types.js.map +1 -1
  143. package/cjs/extensions/forms/Iterate/EditContainer/CancelButton.js +5 -15
  144. package/cjs/extensions/forms/Iterate/EditContainer/CancelButton.js.map +1 -1
  145. package/cjs/extensions/forms/Iterate/EditContainer/DoneButton.js +10 -1
  146. package/cjs/extensions/forms/Iterate/EditContainer/DoneButton.js.map +1 -1
  147. package/cjs/extensions/forms/Iterate/EditContainer/EditContainer.js +1 -3
  148. package/cjs/extensions/forms/Iterate/EditContainer/EditContainer.js.map +1 -1
  149. package/cjs/extensions/forms/Iterate/ItemNo/useIItemNo.d.ts +5 -0
  150. package/cjs/extensions/forms/Iterate/ItemNo/useIItemNo.js +50 -0
  151. package/cjs/extensions/forms/Iterate/ItemNo/useIItemNo.js.map +1 -0
  152. package/cjs/extensions/forms/Iterate/IterateItemContext.d.ts +2 -0
  153. package/cjs/extensions/forms/Iterate/IterateItemContext.js.map +1 -1
  154. package/cjs/extensions/forms/Iterate/PushButton/PushButton.d.ts +1 -0
  155. package/cjs/extensions/forms/Iterate/PushButton/PushButton.js +16 -14
  156. package/cjs/extensions/forms/Iterate/PushButton/PushButton.js.map +1 -1
  157. package/cjs/extensions/forms/Iterate/PushButton/PushButtonDocs.js +5 -0
  158. package/cjs/extensions/forms/Iterate/PushButton/PushButtonDocs.js.map +1 -1
  159. package/cjs/extensions/forms/Iterate/PushContainer/PushContainer.d.ts +17 -1
  160. package/cjs/extensions/forms/Iterate/PushContainer/PushContainer.js +30 -15
  161. package/cjs/extensions/forms/Iterate/PushContainer/PushContainer.js.map +1 -1
  162. package/cjs/extensions/forms/Iterate/PushContainer/PushContainerContext.d.ts +1 -0
  163. package/cjs/extensions/forms/Iterate/PushContainer/PushContainerContext.js.map +1 -1
  164. package/cjs/extensions/forms/Iterate/PushContainer/PushContainerDocs.js +10 -0
  165. package/cjs/extensions/forms/Iterate/PushContainer/PushContainerDocs.js.map +1 -1
  166. package/cjs/extensions/forms/Iterate/RemoveButton/RemoveButton.js +7 -6
  167. package/cjs/extensions/forms/Iterate/RemoveButton/RemoveButton.js.map +1 -1
  168. package/cjs/extensions/forms/Iterate/ViewContainer/EditButton.js +1 -0
  169. package/cjs/extensions/forms/Iterate/ViewContainer/EditButton.js.map +1 -1
  170. package/cjs/extensions/forms/Iterate/Visibility/Visibility.d.ts +7 -0
  171. package/cjs/extensions/forms/Iterate/Visibility/Visibility.js +31 -0
  172. package/cjs/extensions/forms/Iterate/Visibility/Visibility.js.map +1 -0
  173. package/cjs/extensions/forms/Iterate/Visibility/index.d.ts +2 -0
  174. package/cjs/extensions/forms/Iterate/Visibility/index.js +27 -0
  175. package/cjs/extensions/forms/Iterate/Visibility/index.js.map +1 -0
  176. package/cjs/extensions/forms/Iterate/hooks/index.d.ts +1 -0
  177. package/cjs/extensions/forms/Iterate/hooks/index.js +7 -0
  178. package/cjs/extensions/forms/Iterate/hooks/index.js.map +1 -1
  179. package/cjs/extensions/forms/Iterate/hooks/useArrayLimit.d.ts +1 -3
  180. package/cjs/extensions/forms/Iterate/hooks/useArrayLimit.js +1 -4
  181. package/cjs/extensions/forms/Iterate/hooks/useArrayLimit.js.map +1 -1
  182. package/cjs/extensions/forms/Iterate/hooks/useItemPath.d.ts +4 -0
  183. package/cjs/extensions/forms/Iterate/hooks/useItemPath.js +22 -0
  184. package/cjs/extensions/forms/Iterate/hooks/useItemPath.js.map +1 -0
  185. package/cjs/extensions/forms/Iterate/hooks/useSwitchContainerMode.d.ts +1 -3
  186. package/cjs/extensions/forms/Iterate/hooks/useSwitchContainerMode.js +1 -4
  187. package/cjs/extensions/forms/Iterate/hooks/useSwitchContainerMode.js.map +1 -1
  188. package/cjs/extensions/forms/Iterate/index.d.ts +1 -0
  189. package/cjs/extensions/forms/Iterate/index.js +7 -0
  190. package/cjs/extensions/forms/Iterate/index.js.map +1 -1
  191. package/cjs/extensions/forms/Tools/GenerateSchema.js +15 -9
  192. package/cjs/extensions/forms/Tools/GenerateSchema.js.map +1 -1
  193. package/cjs/extensions/forms/Tools/ListAllProps.js +11 -7
  194. package/cjs/extensions/forms/Tools/ListAllProps.js.map +1 -1
  195. package/cjs/extensions/forms/Tools/Log.js +2 -1
  196. package/cjs/extensions/forms/Tools/Log.js.map +1 -1
  197. package/cjs/extensions/forms/Value/ArraySelection/ArraySelection.js +4 -4
  198. package/cjs/extensions/forms/Value/ArraySelection/ArraySelection.js.map +1 -1
  199. package/cjs/extensions/forms/Value/Selection/Selection.js +5 -5
  200. package/cjs/extensions/forms/Value/Selection/Selection.js.map +1 -1
  201. package/cjs/extensions/forms/ValueBlock/ValueBlock.js +25 -7
  202. package/cjs/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
  203. package/cjs/extensions/forms/ValueBlock/style/dnb-value-block.css +6 -1
  204. package/cjs/extensions/forms/ValueBlock/style/dnb-value-block.min.css +1 -1
  205. package/cjs/extensions/forms/ValueBlock/style/dnb-value-block.scss +22 -10
  206. package/cjs/extensions/forms/Wizard/Container/WizardContainer.js +6 -3
  207. package/cjs/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
  208. package/cjs/extensions/forms/Wizard/Container/useHandleLayoutEffect.d.ts +2 -1
  209. package/cjs/extensions/forms/Wizard/Container/useHandleLayoutEffect.js +4 -3
  210. package/cjs/extensions/forms/Wizard/Container/useHandleLayoutEffect.js.map +1 -1
  211. package/cjs/extensions/forms/hooks/DataValueWritePropsDocs.js +9 -9
  212. package/cjs/extensions/forms/hooks/DataValueWritePropsDocs.js.map +1 -1
  213. package/cjs/extensions/forms/hooks/useDataValue.d.ts +2 -2
  214. package/cjs/extensions/forms/hooks/useDataValue.js +5 -9
  215. package/cjs/extensions/forms/hooks/useDataValue.js.map +1 -1
  216. package/cjs/extensions/forms/hooks/useExternalValue.js.map +1 -1
  217. package/cjs/extensions/forms/hooks/useFieldProps.d.ts +8 -2
  218. package/cjs/extensions/forms/hooks/useFieldProps.js +164 -76
  219. package/cjs/extensions/forms/hooks/useFieldProps.js.map +1 -1
  220. package/cjs/extensions/forms/hooks/usePath.js.map +1 -1
  221. package/cjs/extensions/forms/hooks/useValueProps.js +5 -5
  222. package/cjs/extensions/forms/hooks/useValueProps.js.map +1 -1
  223. package/cjs/extensions/forms/style/dnb-forms.css +9 -4
  224. package/cjs/extensions/forms/style/dnb-forms.min.css +1 -1
  225. package/cjs/extensions/forms/types.d.ts +33 -6
  226. package/cjs/extensions/forms/types.js.map +1 -1
  227. package/cjs/extensions/forms/utils/json-pointer/json-pointer.js +8 -0
  228. package/cjs/extensions/forms/utils/json-pointer/json-pointer.js.map +1 -1
  229. package/cjs/extensions/payment-card/PaymentCard.js +3 -12
  230. package/cjs/extensions/payment-card/PaymentCard.js.map +1 -1
  231. package/cjs/fragments/drawer-list/DrawerList.d.ts +4 -2
  232. package/cjs/fragments/drawer-list/DrawerList.js +33 -47
  233. package/cjs/fragments/drawer-list/DrawerList.js.map +1 -1
  234. package/cjs/fragments/drawer-list/DrawerListDocs.js +3 -3
  235. package/cjs/fragments/drawer-list/DrawerListDocs.js.map +1 -1
  236. package/cjs/fragments/drawer-list/style/dnb-drawer-list.scss +1 -1
  237. package/cjs/shared/AlignmentHelper.js +0 -4
  238. package/cjs/shared/AlignmentHelper.js.map +1 -1
  239. package/cjs/shared/Eufemia.d.ts +1 -1
  240. package/cjs/shared/Eufemia.js +2 -2
  241. package/cjs/shared/Eufemia.js.map +1 -1
  242. package/cjs/shared/component-helper.js +2 -1
  243. package/cjs/shared/component-helper.js.map +1 -1
  244. package/cjs/style/core/scopes.scss +1 -1
  245. package/cjs/style/core/utilities.scss +3 -12
  246. package/cjs/style/dnb-ui-basis.css +1 -1
  247. package/cjs/style/dnb-ui-basis.min.css +1 -1
  248. package/cjs/style/dnb-ui-body.css +1 -1
  249. package/cjs/style/dnb-ui-body.min.css +1 -1
  250. package/cjs/style/dnb-ui-components.css +90 -76
  251. package/cjs/style/dnb-ui-components.min.css +4 -4
  252. package/cjs/style/dnb-ui-core.css +1 -1
  253. package/cjs/style/dnb-ui-core.min.css +1 -1
  254. package/cjs/style/dnb-ui-elements.css +151 -31
  255. package/cjs/style/dnb-ui-elements.min.css +1 -1
  256. package/cjs/style/dnb-ui-extensions.css +9 -4
  257. package/cjs/style/dnb-ui-extensions.min.css +1 -1
  258. package/cjs/style/dnb-ui-forms.css +9 -4
  259. package/cjs/style/dnb-ui-forms.min.css +1 -1
  260. package/cjs/style/dnb-ui-fragments.css +1 -1
  261. package/cjs/style/dnb-ui-fragments.min.css +1 -1
  262. package/cjs/style/themes/theme-eiendom/eiendom-theme-basis.css +151 -31
  263. package/cjs/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
  264. package/cjs/style/themes/theme-eiendom/eiendom-theme-components.css +99 -80
  265. package/cjs/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
  266. package/cjs/style/themes/theme-eiendom/eiendom-theme-elements.css +151 -31
  267. package/cjs/style/themes/theme-eiendom/eiendom-theme-elements.min.css +1 -1
  268. package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.css +9 -4
  269. package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
  270. package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.css +9 -4
  271. package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
  272. package/cjs/style/themes/theme-sbanken/sbanken-theme-basis.css +151 -31
  273. package/cjs/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
  274. package/cjs/style/themes/theme-sbanken/sbanken-theme-components.css +99 -80
  275. package/cjs/style/themes/theme-sbanken/sbanken-theme-components.min.css +4 -4
  276. package/cjs/style/themes/theme-sbanken/sbanken-theme-elements.css +151 -31
  277. package/cjs/style/themes/theme-sbanken/sbanken-theme-elements.min.css +1 -1
  278. package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.css +9 -4
  279. package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
  280. package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.css +9 -4
  281. package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
  282. package/cjs/style/themes/theme-ui/ui-theme-basis.css +151 -31
  283. package/cjs/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
  284. package/cjs/style/themes/theme-ui/ui-theme-components.css +99 -80
  285. package/cjs/style/themes/theme-ui/ui-theme-components.min.css +4 -4
  286. package/cjs/style/themes/theme-ui/ui-theme-elements.css +151 -31
  287. package/cjs/style/themes/theme-ui/ui-theme-elements.min.css +1 -1
  288. package/cjs/style/themes/theme-ui/ui-theme-extensions.css +9 -4
  289. package/cjs/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
  290. package/cjs/style/themes/theme-ui/ui-theme-forms.css +9 -4
  291. package/cjs/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
  292. package/cjs/style/themes/theme-ui/ui-theme-tags.css +100 -19
  293. package/cjs/style/themes/theme-ui/ui-theme-tags.min.css +1 -1
  294. package/components/accordion/Accordion.d.ts +1 -125
  295. package/components/accordion/Accordion.js +0 -1
  296. package/components/accordion/Accordion.js.map +1 -1
  297. package/components/autocomplete/Autocomplete.js +3 -2
  298. package/components/autocomplete/Autocomplete.js.map +1 -1
  299. package/components/button/Button.d.ts +3 -6
  300. package/components/button/Button.js +8 -18
  301. package/components/button/Button.js.map +1 -1
  302. package/components/button/ButtonDocs.d.ts +2 -0
  303. package/components/button/ButtonDocs.js +128 -0
  304. package/components/button/ButtonDocs.js.map +1 -0
  305. package/components/date-picker/DatePicker.d.ts +4 -0
  306. package/components/date-picker/DatePicker.js +25 -11
  307. package/components/date-picker/DatePicker.js.map +1 -1
  308. package/components/date-picker/DatePickerDocs.js +5 -0
  309. package/components/date-picker/DatePickerDocs.js.map +1 -1
  310. package/components/date-picker/DatePickerPortal.d.ts +9 -0
  311. package/components/date-picker/DatePickerPortal.js +53 -0
  312. package/components/date-picker/DatePickerPortal.js.map +1 -0
  313. package/components/date-picker/style/dnb-date-picker.css +64 -55
  314. package/components/date-picker/style/dnb-date-picker.min.css +1 -1
  315. package/components/date-picker/style/dnb-date-picker.scss +90 -75
  316. package/components/form-row/FormRow.js +2 -7
  317. package/components/form-row/FormRow.js.map +1 -1
  318. package/components/form-row/style/dnb-form-row.css +3 -3
  319. package/components/form-row/style/dnb-form-row.min.css +1 -1
  320. package/components/form-status/FormStatus.js +17 -19
  321. package/components/form-status/FormStatus.js.map +1 -1
  322. package/components/height-animation/HeightAnimationInstance.d.ts +1 -0
  323. package/components/height-animation/HeightAnimationInstance.js +26 -1
  324. package/components/height-animation/HeightAnimationInstance.js.map +1 -1
  325. package/components/input-masked/InputMasked.d.ts +1 -1
  326. package/components/input-masked/InputMasked.js +2 -2
  327. package/components/input-masked/InputMasked.js.map +1 -1
  328. package/components/input-masked/InputMaskedDocs.js +1 -1
  329. package/components/input-masked/InputMaskedDocs.js.map +1 -1
  330. package/components/input-masked/InputMaskedHooks.js +1 -1
  331. package/components/input-masked/InputMaskedHooks.js.map +1 -1
  332. package/components/input-masked/InputMaskedUtils.js +1 -1
  333. package/components/input-masked/InputMaskedUtils.js.map +1 -1
  334. package/components/input-masked/style/dnb-input-masked.css +3 -3
  335. package/components/input-masked/style/dnb-input-masked.min.css +1 -1
  336. package/components/pagination/Pagination.d.ts +12 -0
  337. package/components/pagination/Pagination.js +7 -3
  338. package/components/pagination/Pagination.js.map +1 -1
  339. package/components/pagination/PaginationBar.d.ts +2 -1
  340. package/components/pagination/PaginationBar.js +10 -3
  341. package/components/pagination/PaginationBar.js.map +1 -1
  342. package/components/radio/style/dnb-radio.css +3 -3
  343. package/components/radio/style/dnb-radio.min.css +1 -1
  344. package/components/space/style/dnb-space.css +4 -4
  345. package/components/space/style/dnb-space.min.css +1 -1
  346. package/components/space/style/dnb-space.scss +2 -12
  347. package/components/space/style/space-mixins.scss +21 -0
  348. package/components/tabs/Tabs.d.ts +1 -1
  349. package/components/tabs/Tabs.js +4 -12
  350. package/components/tabs/Tabs.js.map +1 -1
  351. package/components/toggle-button/ToggleButton.d.ts +9 -5
  352. package/components/toggle-button/ToggleButton.js +2 -0
  353. package/components/toggle-button/ToggleButton.js.map +1 -1
  354. package/components/toggle-button/ToggleButtonDocs.d.ts +2 -0
  355. package/components/toggle-button/ToggleButtonDocs.js +80 -0
  356. package/components/toggle-button/ToggleButtonDocs.js.map +1 -0
  357. package/components/toggle-button/ToggleButtonGroup.d.ts +21 -6
  358. package/components/toggle-button/ToggleButtonGroupDocs.d.ts +2 -0
  359. package/components/toggle-button/ToggleButtonGroupDocs.js +83 -0
  360. package/components/toggle-button/ToggleButtonGroupDocs.js.map +1 -0
  361. package/components/toggle-button/style/dnb-toggle-button.css +3 -3
  362. package/components/toggle-button/style/dnb-toggle-button.min.css +1 -1
  363. package/elements/blockquote/style/blockquote-mixins.scss +5 -3
  364. package/elements/code/style/code-mixins.scss +2 -3
  365. package/elements/hr/style/hr-mixins.scss +2 -3
  366. package/elements/img/style/img-mixins.scss +3 -3
  367. package/elements/lists/style/lists-mixins.scss +3 -6
  368. package/elements/typography/style/typography-mixins.scss +2 -3
  369. package/es/components/accordion/Accordion.d.ts +1 -125
  370. package/es/components/accordion/Accordion.js +0 -1
  371. package/es/components/accordion/Accordion.js.map +1 -1
  372. package/es/components/autocomplete/Autocomplete.js +3 -2
  373. package/es/components/autocomplete/Autocomplete.js.map +1 -1
  374. package/es/components/button/Button.d.ts +3 -6
  375. package/es/components/button/Button.js +8 -18
  376. package/es/components/button/Button.js.map +1 -1
  377. package/es/components/button/ButtonDocs.d.ts +2 -0
  378. package/es/components/button/ButtonDocs.js +128 -0
  379. package/es/components/button/ButtonDocs.js.map +1 -0
  380. package/es/components/date-picker/DatePicker.d.ts +4 -0
  381. package/es/components/date-picker/DatePicker.js +25 -11
  382. package/es/components/date-picker/DatePicker.js.map +1 -1
  383. package/es/components/date-picker/DatePickerDocs.js +5 -0
  384. package/es/components/date-picker/DatePickerDocs.js.map +1 -1
  385. package/es/components/date-picker/DatePickerPortal.d.ts +9 -0
  386. package/es/components/date-picker/DatePickerPortal.js +52 -0
  387. package/es/components/date-picker/DatePickerPortal.js.map +1 -0
  388. package/es/components/date-picker/style/dnb-date-picker.css +64 -55
  389. package/es/components/date-picker/style/dnb-date-picker.min.css +1 -1
  390. package/es/components/date-picker/style/dnb-date-picker.scss +90 -75
  391. package/es/components/form-row/FormRow.js +2 -7
  392. package/es/components/form-row/FormRow.js.map +1 -1
  393. package/es/components/form-row/style/dnb-form-row.css +3 -3
  394. package/es/components/form-row/style/dnb-form-row.min.css +1 -1
  395. package/es/components/form-status/FormStatus.js +17 -19
  396. package/es/components/form-status/FormStatus.js.map +1 -1
  397. package/es/components/height-animation/HeightAnimationInstance.d.ts +1 -0
  398. package/es/components/height-animation/HeightAnimationInstance.js +26 -1
  399. package/es/components/height-animation/HeightAnimationInstance.js.map +1 -1
  400. package/es/components/input-masked/InputMasked.d.ts +1 -1
  401. package/es/components/input-masked/InputMasked.js +2 -2
  402. package/es/components/input-masked/InputMasked.js.map +1 -1
  403. package/es/components/input-masked/InputMaskedDocs.js +1 -1
  404. package/es/components/input-masked/InputMaskedDocs.js.map +1 -1
  405. package/es/components/input-masked/InputMaskedHooks.js +1 -1
  406. package/es/components/input-masked/InputMaskedHooks.js.map +1 -1
  407. package/es/components/input-masked/InputMaskedUtils.js +1 -1
  408. package/es/components/input-masked/InputMaskedUtils.js.map +1 -1
  409. package/es/components/input-masked/style/dnb-input-masked.css +3 -3
  410. package/es/components/input-masked/style/dnb-input-masked.min.css +1 -1
  411. package/es/components/pagination/Pagination.d.ts +12 -0
  412. package/es/components/pagination/Pagination.js +7 -3
  413. package/es/components/pagination/Pagination.js.map +1 -1
  414. package/es/components/pagination/PaginationBar.d.ts +2 -1
  415. package/es/components/pagination/PaginationBar.js +10 -3
  416. package/es/components/pagination/PaginationBar.js.map +1 -1
  417. package/es/components/radio/style/dnb-radio.css +3 -3
  418. package/es/components/radio/style/dnb-radio.min.css +1 -1
  419. package/es/components/space/style/dnb-space.css +4 -4
  420. package/es/components/space/style/dnb-space.min.css +1 -1
  421. package/es/components/space/style/dnb-space.scss +2 -12
  422. package/es/components/space/style/space-mixins.scss +21 -0
  423. package/es/components/tabs/Tabs.d.ts +1 -1
  424. package/es/components/tabs/Tabs.js +4 -12
  425. package/es/components/tabs/Tabs.js.map +1 -1
  426. package/es/components/toggle-button/ToggleButton.d.ts +9 -5
  427. package/es/components/toggle-button/ToggleButton.js +2 -0
  428. package/es/components/toggle-button/ToggleButton.js.map +1 -1
  429. package/es/components/toggle-button/ToggleButtonDocs.d.ts +2 -0
  430. package/es/components/toggle-button/ToggleButtonDocs.js +80 -0
  431. package/es/components/toggle-button/ToggleButtonDocs.js.map +1 -0
  432. package/es/components/toggle-button/ToggleButtonGroup.d.ts +21 -6
  433. package/es/components/toggle-button/ToggleButtonGroupDocs.d.ts +2 -0
  434. package/es/components/toggle-button/ToggleButtonGroupDocs.js +83 -0
  435. package/es/components/toggle-button/ToggleButtonGroupDocs.js.map +1 -0
  436. package/es/components/toggle-button/style/dnb-toggle-button.css +3 -3
  437. package/es/components/toggle-button/style/dnb-toggle-button.min.css +1 -1
  438. package/es/elements/blockquote/style/blockquote-mixins.scss +5 -3
  439. package/es/elements/code/style/code-mixins.scss +2 -3
  440. package/es/elements/hr/style/hr-mixins.scss +2 -3
  441. package/es/elements/img/style/img-mixins.scss +3 -3
  442. package/es/elements/lists/style/lists-mixins.scss +3 -6
  443. package/es/elements/typography/style/typography-mixins.scss +2 -3
  444. package/es/extensions/forms/DataContext/Context.d.ts +15 -4
  445. package/es/extensions/forms/DataContext/Context.js.map +1 -1
  446. package/es/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js +1 -1
  447. package/es/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js.map +1 -1
  448. package/es/extensions/forms/DataContext/Provider/Provider.js +27 -16
  449. package/es/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  450. package/es/extensions/forms/Field/ArraySelection/ArraySelection.js +3 -3
  451. package/es/extensions/forms/Field/ArraySelection/ArraySelection.js.map +1 -1
  452. package/es/extensions/forms/Field/Date/Date.js +5 -4
  453. package/es/extensions/forms/Field/Date/Date.js.map +1 -1
  454. package/es/extensions/forms/Field/Expiry/Expiry.js +4 -3
  455. package/es/extensions/forms/Field/Expiry/Expiry.js.map +1 -1
  456. package/es/extensions/forms/Field/Indeterminate/useDependencePaths.js +7 -7
  457. package/es/extensions/forms/Field/Indeterminate/useDependencePaths.js.map +1 -1
  458. package/es/extensions/forms/Field/Number/Number.js +2 -2
  459. package/es/extensions/forms/Field/Number/Number.js.map +1 -1
  460. package/es/extensions/forms/Field/Option/Option.d.ts +2 -1
  461. package/es/extensions/forms/Field/Option/Option.js +2 -12
  462. package/es/extensions/forms/Field/Option/Option.js.map +1 -1
  463. package/es/extensions/forms/Field/PhoneNumber/PhoneNumber.js +10 -5
  464. package/es/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
  465. package/es/extensions/forms/Field/Provider/useFieldProvider.d.ts +4 -3
  466. package/es/extensions/forms/Field/SelectCountry/SelectCountry.js +12 -4
  467. package/es/extensions/forms/Field/SelectCountry/SelectCountry.js.map +1 -1
  468. package/es/extensions/forms/Field/Selection/Selection.d.ts +8 -1
  469. package/es/extensions/forms/Field/Selection/Selection.js +22 -14
  470. package/es/extensions/forms/Field/Selection/Selection.js.map +1 -1
  471. package/es/extensions/forms/Field/Selection/SelectionDocs.js +5 -0
  472. package/es/extensions/forms/Field/Selection/SelectionDocs.js.map +1 -1
  473. package/es/extensions/forms/Field/Slider/Slider.js +4 -3
  474. package/es/extensions/forms/Field/Slider/Slider.js.map +1 -1
  475. package/es/extensions/forms/Field/String/String.js +2 -2
  476. package/es/extensions/forms/Field/String/String.js.map +1 -1
  477. package/es/extensions/forms/Field/Toggle/Toggle.js +14 -4
  478. package/es/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
  479. package/es/extensions/forms/Field/Upload/Upload.js +21 -20
  480. package/es/extensions/forms/Field/Upload/Upload.js.map +1 -1
  481. package/es/extensions/forms/FieldBlock/FieldBlock.js +14 -38
  482. package/es/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
  483. package/es/extensions/forms/FieldBlock/style/dnb-field-block.css +3 -3
  484. package/es/extensions/forms/FieldBlock/style/dnb-field-block.min.css +1 -1
  485. package/es/extensions/forms/Form/Isolation/Isolation.js +17 -3
  486. package/es/extensions/forms/Form/Isolation/Isolation.js.map +1 -1
  487. package/es/extensions/forms/Form/MainHeading/MainHeadingDocs.d.ts +2 -0
  488. package/es/extensions/forms/Form/MainHeading/MainHeadingDocs.js +20 -0
  489. package/es/extensions/forms/Form/MainHeading/MainHeadingDocs.js.map +1 -0
  490. package/es/extensions/forms/Form/Section/EditContainer/CancelButton.js +7 -18
  491. package/es/extensions/forms/Form/Section/EditContainer/CancelButton.js.map +1 -1
  492. package/es/extensions/forms/Form/SubHeading/SubHeadingDocs.d.ts +2 -0
  493. package/es/extensions/forms/Form/SubHeading/SubHeadingDocs.js +20 -0
  494. package/es/extensions/forms/Form/SubHeading/SubHeadingDocs.js.map +1 -0
  495. package/es/extensions/forms/Form/Visibility/Visibility.d.ts +11 -1
  496. package/es/extensions/forms/Form/Visibility/Visibility.js +20 -11
  497. package/es/extensions/forms/Form/Visibility/Visibility.js.map +1 -1
  498. package/es/extensions/forms/Form/Visibility/VisibilityContext.d.ts +2 -0
  499. package/es/extensions/forms/Form/Visibility/VisibilityContext.js.map +1 -1
  500. package/es/extensions/forms/Form/Visibility/VisibilityDocs.js +1 -1
  501. package/es/extensions/forms/Form/Visibility/VisibilityDocs.js.map +1 -1
  502. package/es/extensions/forms/Form/Visibility/useVisibility.js +18 -9
  503. package/es/extensions/forms/Form/Visibility/useVisibility.js.map +1 -1
  504. package/es/extensions/forms/Iterate/Array/Array.js +47 -28
  505. package/es/extensions/forms/Iterate/Array/Array.js.map +1 -1
  506. package/es/extensions/forms/Iterate/Array/ArrayDocs.js +14 -4
  507. package/es/extensions/forms/Iterate/Array/ArrayDocs.js.map +1 -1
  508. package/es/extensions/forms/Iterate/Array/types.d.ts +8 -3
  509. package/es/extensions/forms/Iterate/Array/types.js.map +1 -1
  510. package/es/extensions/forms/Iterate/EditContainer/CancelButton.js +5 -15
  511. package/es/extensions/forms/Iterate/EditContainer/CancelButton.js.map +1 -1
  512. package/es/extensions/forms/Iterate/EditContainer/DoneButton.js +9 -1
  513. package/es/extensions/forms/Iterate/EditContainer/DoneButton.js.map +1 -1
  514. package/es/extensions/forms/Iterate/EditContainer/EditContainer.js +1 -3
  515. package/es/extensions/forms/Iterate/EditContainer/EditContainer.js.map +1 -1
  516. package/es/extensions/forms/Iterate/ItemNo/useIItemNo.d.ts +5 -0
  517. package/es/extensions/forms/Iterate/ItemNo/useIItemNo.js +41 -0
  518. package/es/extensions/forms/Iterate/ItemNo/useIItemNo.js.map +1 -0
  519. package/es/extensions/forms/Iterate/IterateItemContext.d.ts +2 -0
  520. package/es/extensions/forms/Iterate/IterateItemContext.js.map +1 -1
  521. package/es/extensions/forms/Iterate/PushButton/PushButton.d.ts +1 -0
  522. package/es/extensions/forms/Iterate/PushButton/PushButton.js +17 -15
  523. package/es/extensions/forms/Iterate/PushButton/PushButton.js.map +1 -1
  524. package/es/extensions/forms/Iterate/PushButton/PushButtonDocs.js +5 -0
  525. package/es/extensions/forms/Iterate/PushButton/PushButtonDocs.js.map +1 -1
  526. package/es/extensions/forms/Iterate/PushContainer/PushContainer.d.ts +17 -1
  527. package/es/extensions/forms/Iterate/PushContainer/PushContainer.js +32 -17
  528. package/es/extensions/forms/Iterate/PushContainer/PushContainer.js.map +1 -1
  529. package/es/extensions/forms/Iterate/PushContainer/PushContainerContext.d.ts +1 -0
  530. package/es/extensions/forms/Iterate/PushContainer/PushContainerContext.js.map +1 -1
  531. package/es/extensions/forms/Iterate/PushContainer/PushContainerDocs.js +10 -0
  532. package/es/extensions/forms/Iterate/PushContainer/PushContainerDocs.js.map +1 -1
  533. package/es/extensions/forms/Iterate/RemoveButton/RemoveButton.js +7 -6
  534. package/es/extensions/forms/Iterate/RemoveButton/RemoveButton.js.map +1 -1
  535. package/es/extensions/forms/Iterate/ViewContainer/EditButton.js +1 -0
  536. package/es/extensions/forms/Iterate/ViewContainer/EditButton.js.map +1 -1
  537. package/es/extensions/forms/Iterate/Visibility/Visibility.d.ts +7 -0
  538. package/es/extensions/forms/Iterate/Visibility/Visibility.js +11 -0
  539. package/es/extensions/forms/Iterate/Visibility/Visibility.js.map +1 -0
  540. package/es/extensions/forms/Iterate/Visibility/index.d.ts +2 -0
  541. package/es/extensions/forms/Iterate/Visibility/index.js +3 -0
  542. package/es/extensions/forms/Iterate/Visibility/index.js.map +1 -0
  543. package/es/extensions/forms/Iterate/hooks/index.d.ts +1 -0
  544. package/es/extensions/forms/Iterate/hooks/index.js +1 -0
  545. package/es/extensions/forms/Iterate/hooks/index.js.map +1 -1
  546. package/es/extensions/forms/Iterate/hooks/useArrayLimit.d.ts +1 -3
  547. package/es/extensions/forms/Iterate/hooks/useArrayLimit.js +1 -3
  548. package/es/extensions/forms/Iterate/hooks/useArrayLimit.js.map +1 -1
  549. package/es/extensions/forms/Iterate/hooks/useItemPath.d.ts +4 -0
  550. package/es/extensions/forms/Iterate/hooks/useItemPath.js +16 -0
  551. package/es/extensions/forms/Iterate/hooks/useItemPath.js.map +1 -0
  552. package/es/extensions/forms/Iterate/hooks/useSwitchContainerMode.d.ts +1 -3
  553. package/es/extensions/forms/Iterate/hooks/useSwitchContainerMode.js +1 -3
  554. package/es/extensions/forms/Iterate/hooks/useSwitchContainerMode.js.map +1 -1
  555. package/es/extensions/forms/Iterate/index.d.ts +1 -0
  556. package/es/extensions/forms/Iterate/index.js +1 -0
  557. package/es/extensions/forms/Iterate/index.js.map +1 -1
  558. package/es/extensions/forms/Tools/GenerateSchema.js +12 -6
  559. package/es/extensions/forms/Tools/GenerateSchema.js.map +1 -1
  560. package/es/extensions/forms/Tools/ListAllProps.js +9 -5
  561. package/es/extensions/forms/Tools/ListAllProps.js.map +1 -1
  562. package/es/extensions/forms/Tools/Log.js +2 -1
  563. package/es/extensions/forms/Tools/Log.js.map +1 -1
  564. package/es/extensions/forms/Value/ArraySelection/ArraySelection.js +4 -4
  565. package/es/extensions/forms/Value/ArraySelection/ArraySelection.js.map +1 -1
  566. package/es/extensions/forms/Value/Selection/Selection.js +5 -5
  567. package/es/extensions/forms/Value/Selection/Selection.js.map +1 -1
  568. package/es/extensions/forms/ValueBlock/ValueBlock.js +26 -9
  569. package/es/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
  570. package/es/extensions/forms/ValueBlock/style/dnb-value-block.css +6 -1
  571. package/es/extensions/forms/ValueBlock/style/dnb-value-block.min.css +1 -1
  572. package/es/extensions/forms/ValueBlock/style/dnb-value-block.scss +22 -10
  573. package/es/extensions/forms/Wizard/Container/WizardContainer.js +6 -3
  574. package/es/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
  575. package/es/extensions/forms/Wizard/Container/useHandleLayoutEffect.d.ts +2 -1
  576. package/es/extensions/forms/Wizard/Container/useHandleLayoutEffect.js +4 -3
  577. package/es/extensions/forms/Wizard/Container/useHandleLayoutEffect.js.map +1 -1
  578. package/es/extensions/forms/hooks/DataValueWritePropsDocs.js +9 -9
  579. package/es/extensions/forms/hooks/DataValueWritePropsDocs.js.map +1 -1
  580. package/es/extensions/forms/hooks/useDataValue.d.ts +2 -2
  581. package/es/extensions/forms/hooks/useDataValue.js +4 -8
  582. package/es/extensions/forms/hooks/useDataValue.js.map +1 -1
  583. package/es/extensions/forms/hooks/useExternalValue.js +2 -2
  584. package/es/extensions/forms/hooks/useExternalValue.js.map +1 -1
  585. package/es/extensions/forms/hooks/useFieldProps.d.ts +8 -2
  586. package/es/extensions/forms/hooks/useFieldProps.js +163 -76
  587. package/es/extensions/forms/hooks/useFieldProps.js.map +1 -1
  588. package/es/extensions/forms/hooks/usePath.js +2 -2
  589. package/es/extensions/forms/hooks/usePath.js.map +1 -1
  590. package/es/extensions/forms/hooks/useValueProps.js +5 -5
  591. package/es/extensions/forms/hooks/useValueProps.js.map +1 -1
  592. package/es/extensions/forms/style/dnb-forms.css +9 -4
  593. package/es/extensions/forms/style/dnb-forms.min.css +1 -1
  594. package/es/extensions/forms/types.d.ts +33 -6
  595. package/es/extensions/forms/types.js.map +1 -1
  596. package/es/extensions/forms/utils/json-pointer/json-pointer.js +6 -0
  597. package/es/extensions/forms/utils/json-pointer/json-pointer.js.map +1 -1
  598. package/es/extensions/payment-card/PaymentCard.js +3 -12
  599. package/es/extensions/payment-card/PaymentCard.js.map +1 -1
  600. package/es/fragments/drawer-list/DrawerList.d.ts +4 -2
  601. package/es/fragments/drawer-list/DrawerList.js +33 -47
  602. package/es/fragments/drawer-list/DrawerList.js.map +1 -1
  603. package/es/fragments/drawer-list/DrawerListDocs.js +3 -3
  604. package/es/fragments/drawer-list/DrawerListDocs.js.map +1 -1
  605. package/es/fragments/drawer-list/style/dnb-drawer-list.scss +1 -1
  606. package/es/shared/AlignmentHelper.js +0 -4
  607. package/es/shared/AlignmentHelper.js.map +1 -1
  608. package/es/shared/Eufemia.d.ts +1 -1
  609. package/es/shared/Eufemia.js +2 -2
  610. package/es/shared/Eufemia.js.map +1 -1
  611. package/es/shared/component-helper.js +2 -1
  612. package/es/shared/component-helper.js.map +1 -1
  613. package/es/style/core/scopes.scss +1 -1
  614. package/es/style/core/utilities.scss +3 -12
  615. package/es/style/dnb-ui-basis.css +1 -1
  616. package/es/style/dnb-ui-basis.min.css +1 -1
  617. package/es/style/dnb-ui-body.css +1 -1
  618. package/es/style/dnb-ui-body.min.css +1 -1
  619. package/es/style/dnb-ui-components.css +90 -76
  620. package/es/style/dnb-ui-components.min.css +4 -4
  621. package/es/style/dnb-ui-core.css +1 -1
  622. package/es/style/dnb-ui-core.min.css +1 -1
  623. package/es/style/dnb-ui-elements.css +151 -31
  624. package/es/style/dnb-ui-elements.min.css +1 -1
  625. package/es/style/dnb-ui-extensions.css +9 -4
  626. package/es/style/dnb-ui-extensions.min.css +1 -1
  627. package/es/style/dnb-ui-forms.css +9 -4
  628. package/es/style/dnb-ui-forms.min.css +1 -1
  629. package/es/style/dnb-ui-fragments.css +1 -1
  630. package/es/style/dnb-ui-fragments.min.css +1 -1
  631. package/es/style/themes/theme-eiendom/eiendom-theme-basis.css +151 -31
  632. package/es/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
  633. package/es/style/themes/theme-eiendom/eiendom-theme-components.css +99 -80
  634. package/es/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
  635. package/es/style/themes/theme-eiendom/eiendom-theme-elements.css +151 -31
  636. package/es/style/themes/theme-eiendom/eiendom-theme-elements.min.css +1 -1
  637. package/es/style/themes/theme-eiendom/eiendom-theme-extensions.css +9 -4
  638. package/es/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
  639. package/es/style/themes/theme-eiendom/eiendom-theme-forms.css +9 -4
  640. package/es/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
  641. package/es/style/themes/theme-sbanken/sbanken-theme-basis.css +151 -31
  642. package/es/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
  643. package/es/style/themes/theme-sbanken/sbanken-theme-components.css +99 -80
  644. package/es/style/themes/theme-sbanken/sbanken-theme-components.min.css +4 -4
  645. package/es/style/themes/theme-sbanken/sbanken-theme-elements.css +151 -31
  646. package/es/style/themes/theme-sbanken/sbanken-theme-elements.min.css +1 -1
  647. package/es/style/themes/theme-sbanken/sbanken-theme-extensions.css +9 -4
  648. package/es/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
  649. package/es/style/themes/theme-sbanken/sbanken-theme-forms.css +9 -4
  650. package/es/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
  651. package/es/style/themes/theme-ui/ui-theme-basis.css +151 -31
  652. package/es/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
  653. package/es/style/themes/theme-ui/ui-theme-components.css +99 -80
  654. package/es/style/themes/theme-ui/ui-theme-components.min.css +4 -4
  655. package/es/style/themes/theme-ui/ui-theme-elements.css +151 -31
  656. package/es/style/themes/theme-ui/ui-theme-elements.min.css +1 -1
  657. package/es/style/themes/theme-ui/ui-theme-extensions.css +9 -4
  658. package/es/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
  659. package/es/style/themes/theme-ui/ui-theme-forms.css +9 -4
  660. package/es/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
  661. package/es/style/themes/theme-ui/ui-theme-tags.css +100 -19
  662. package/es/style/themes/theme-ui/ui-theme-tags.min.css +1 -1
  663. package/esm/dnb-ui-basis.min.mjs +1 -1
  664. package/esm/dnb-ui-components.min.mjs +1 -1
  665. package/esm/dnb-ui-elements.min.mjs +1 -1
  666. package/esm/dnb-ui-extensions.min.mjs +5 -5
  667. package/esm/dnb-ui-lib.min.mjs +1 -1
  668. package/extensions/forms/DataContext/Context.d.ts +15 -4
  669. package/extensions/forms/DataContext/Context.js.map +1 -1
  670. package/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js +1 -1
  671. package/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js.map +1 -1
  672. package/extensions/forms/DataContext/Provider/Provider.js +28 -17
  673. package/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  674. package/extensions/forms/Field/ArraySelection/ArraySelection.js +3 -3
  675. package/extensions/forms/Field/ArraySelection/ArraySelection.js.map +1 -1
  676. package/extensions/forms/Field/Date/Date.js +5 -4
  677. package/extensions/forms/Field/Date/Date.js.map +1 -1
  678. package/extensions/forms/Field/Expiry/Expiry.js +4 -3
  679. package/extensions/forms/Field/Expiry/Expiry.js.map +1 -1
  680. package/extensions/forms/Field/Indeterminate/useDependencePaths.js +7 -7
  681. package/extensions/forms/Field/Indeterminate/useDependencePaths.js.map +1 -1
  682. package/extensions/forms/Field/Number/Number.js +2 -2
  683. package/extensions/forms/Field/Number/Number.js.map +1 -1
  684. package/extensions/forms/Field/Option/Option.d.ts +2 -1
  685. package/extensions/forms/Field/Option/Option.js +2 -13
  686. package/extensions/forms/Field/Option/Option.js.map +1 -1
  687. package/extensions/forms/Field/PhoneNumber/PhoneNumber.js +10 -5
  688. package/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
  689. package/extensions/forms/Field/Provider/useFieldProvider.d.ts +4 -3
  690. package/extensions/forms/Field/SelectCountry/SelectCountry.js +12 -4
  691. package/extensions/forms/Field/SelectCountry/SelectCountry.js.map +1 -1
  692. package/extensions/forms/Field/Selection/Selection.d.ts +8 -1
  693. package/extensions/forms/Field/Selection/Selection.js +19 -12
  694. package/extensions/forms/Field/Selection/Selection.js.map +1 -1
  695. package/extensions/forms/Field/Selection/SelectionDocs.js +5 -0
  696. package/extensions/forms/Field/Selection/SelectionDocs.js.map +1 -1
  697. package/extensions/forms/Field/Slider/Slider.js +4 -3
  698. package/extensions/forms/Field/Slider/Slider.js.map +1 -1
  699. package/extensions/forms/Field/String/String.js +2 -2
  700. package/extensions/forms/Field/String/String.js.map +1 -1
  701. package/extensions/forms/Field/Toggle/Toggle.js +14 -4
  702. package/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
  703. package/extensions/forms/Field/Upload/Upload.js +21 -21
  704. package/extensions/forms/Field/Upload/Upload.js.map +1 -1
  705. package/extensions/forms/FieldBlock/FieldBlock.js +14 -38
  706. package/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
  707. package/extensions/forms/FieldBlock/style/dnb-field-block.css +3 -3
  708. package/extensions/forms/FieldBlock/style/dnb-field-block.min.css +1 -1
  709. package/extensions/forms/Form/Isolation/Isolation.js +17 -3
  710. package/extensions/forms/Form/Isolation/Isolation.js.map +1 -1
  711. package/extensions/forms/Form/MainHeading/MainHeadingDocs.d.ts +2 -0
  712. package/extensions/forms/Form/MainHeading/MainHeadingDocs.js +20 -0
  713. package/extensions/forms/Form/MainHeading/MainHeadingDocs.js.map +1 -0
  714. package/extensions/forms/Form/Section/EditContainer/CancelButton.js +7 -18
  715. package/extensions/forms/Form/Section/EditContainer/CancelButton.js.map +1 -1
  716. package/extensions/forms/Form/SubHeading/SubHeadingDocs.d.ts +2 -0
  717. package/extensions/forms/Form/SubHeading/SubHeadingDocs.js +20 -0
  718. package/extensions/forms/Form/SubHeading/SubHeadingDocs.js.map +1 -0
  719. package/extensions/forms/Form/Visibility/Visibility.d.ts +11 -1
  720. package/extensions/forms/Form/Visibility/Visibility.js +20 -11
  721. package/extensions/forms/Form/Visibility/Visibility.js.map +1 -1
  722. package/extensions/forms/Form/Visibility/VisibilityContext.d.ts +2 -0
  723. package/extensions/forms/Form/Visibility/VisibilityContext.js.map +1 -1
  724. package/extensions/forms/Form/Visibility/VisibilityDocs.js +1 -1
  725. package/extensions/forms/Form/Visibility/VisibilityDocs.js.map +1 -1
  726. package/extensions/forms/Form/Visibility/useVisibility.js +18 -9
  727. package/extensions/forms/Form/Visibility/useVisibility.js.map +1 -1
  728. package/extensions/forms/Iterate/Array/Array.js +50 -30
  729. package/extensions/forms/Iterate/Array/Array.js.map +1 -1
  730. package/extensions/forms/Iterate/Array/ArrayDocs.js +14 -4
  731. package/extensions/forms/Iterate/Array/ArrayDocs.js.map +1 -1
  732. package/extensions/forms/Iterate/Array/types.d.ts +8 -3
  733. package/extensions/forms/Iterate/Array/types.js.map +1 -1
  734. package/extensions/forms/Iterate/EditContainer/CancelButton.js +5 -15
  735. package/extensions/forms/Iterate/EditContainer/CancelButton.js.map +1 -1
  736. package/extensions/forms/Iterate/EditContainer/DoneButton.js +9 -1
  737. package/extensions/forms/Iterate/EditContainer/DoneButton.js.map +1 -1
  738. package/extensions/forms/Iterate/EditContainer/EditContainer.js +1 -3
  739. package/extensions/forms/Iterate/EditContainer/EditContainer.js.map +1 -1
  740. package/extensions/forms/Iterate/ItemNo/useIItemNo.d.ts +5 -0
  741. package/extensions/forms/Iterate/ItemNo/useIItemNo.js +42 -0
  742. package/extensions/forms/Iterate/ItemNo/useIItemNo.js.map +1 -0
  743. package/extensions/forms/Iterate/IterateItemContext.d.ts +2 -0
  744. package/extensions/forms/Iterate/IterateItemContext.js.map +1 -1
  745. package/extensions/forms/Iterate/PushButton/PushButton.d.ts +1 -0
  746. package/extensions/forms/Iterate/PushButton/PushButton.js +17 -15
  747. package/extensions/forms/Iterate/PushButton/PushButton.js.map +1 -1
  748. package/extensions/forms/Iterate/PushButton/PushButtonDocs.js +5 -0
  749. package/extensions/forms/Iterate/PushButton/PushButtonDocs.js.map +1 -1
  750. package/extensions/forms/Iterate/PushContainer/PushContainer.d.ts +17 -1
  751. package/extensions/forms/Iterate/PushContainer/PushContainer.js +32 -17
  752. package/extensions/forms/Iterate/PushContainer/PushContainer.js.map +1 -1
  753. package/extensions/forms/Iterate/PushContainer/PushContainerContext.d.ts +1 -0
  754. package/extensions/forms/Iterate/PushContainer/PushContainerContext.js.map +1 -1
  755. package/extensions/forms/Iterate/PushContainer/PushContainerDocs.js +10 -0
  756. package/extensions/forms/Iterate/PushContainer/PushContainerDocs.js.map +1 -1
  757. package/extensions/forms/Iterate/RemoveButton/RemoveButton.js +7 -6
  758. package/extensions/forms/Iterate/RemoveButton/RemoveButton.js.map +1 -1
  759. package/extensions/forms/Iterate/ViewContainer/EditButton.js +1 -0
  760. package/extensions/forms/Iterate/ViewContainer/EditButton.js.map +1 -1
  761. package/extensions/forms/Iterate/Visibility/Visibility.d.ts +7 -0
  762. package/extensions/forms/Iterate/Visibility/Visibility.js +11 -0
  763. package/extensions/forms/Iterate/Visibility/Visibility.js.map +1 -0
  764. package/extensions/forms/Iterate/Visibility/index.d.ts +2 -0
  765. package/extensions/forms/Iterate/Visibility/index.js +3 -0
  766. package/extensions/forms/Iterate/Visibility/index.js.map +1 -0
  767. package/extensions/forms/Iterate/hooks/index.d.ts +1 -0
  768. package/extensions/forms/Iterate/hooks/index.js +1 -0
  769. package/extensions/forms/Iterate/hooks/index.js.map +1 -1
  770. package/extensions/forms/Iterate/hooks/useArrayLimit.d.ts +1 -3
  771. package/extensions/forms/Iterate/hooks/useArrayLimit.js +1 -4
  772. package/extensions/forms/Iterate/hooks/useArrayLimit.js.map +1 -1
  773. package/extensions/forms/Iterate/hooks/useItemPath.d.ts +4 -0
  774. package/extensions/forms/Iterate/hooks/useItemPath.js +16 -0
  775. package/extensions/forms/Iterate/hooks/useItemPath.js.map +1 -0
  776. package/extensions/forms/Iterate/hooks/useSwitchContainerMode.d.ts +1 -3
  777. package/extensions/forms/Iterate/hooks/useSwitchContainerMode.js +1 -4
  778. package/extensions/forms/Iterate/hooks/useSwitchContainerMode.js.map +1 -1
  779. package/extensions/forms/Iterate/index.d.ts +1 -0
  780. package/extensions/forms/Iterate/index.js +1 -0
  781. package/extensions/forms/Iterate/index.js.map +1 -1
  782. package/extensions/forms/Tools/GenerateSchema.js +15 -9
  783. package/extensions/forms/Tools/GenerateSchema.js.map +1 -1
  784. package/extensions/forms/Tools/ListAllProps.js +11 -7
  785. package/extensions/forms/Tools/ListAllProps.js.map +1 -1
  786. package/extensions/forms/Tools/Log.js +2 -1
  787. package/extensions/forms/Tools/Log.js.map +1 -1
  788. package/extensions/forms/Value/ArraySelection/ArraySelection.js +4 -4
  789. package/extensions/forms/Value/ArraySelection/ArraySelection.js.map +1 -1
  790. package/extensions/forms/Value/Selection/Selection.js +5 -5
  791. package/extensions/forms/Value/Selection/Selection.js.map +1 -1
  792. package/extensions/forms/ValueBlock/ValueBlock.js +27 -9
  793. package/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
  794. package/extensions/forms/ValueBlock/style/dnb-value-block.css +6 -1
  795. package/extensions/forms/ValueBlock/style/dnb-value-block.min.css +1 -1
  796. package/extensions/forms/ValueBlock/style/dnb-value-block.scss +22 -10
  797. package/extensions/forms/Wizard/Container/WizardContainer.js +6 -3
  798. package/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
  799. package/extensions/forms/Wizard/Container/useHandleLayoutEffect.d.ts +2 -1
  800. package/extensions/forms/Wizard/Container/useHandleLayoutEffect.js +4 -3
  801. package/extensions/forms/Wizard/Container/useHandleLayoutEffect.js.map +1 -1
  802. package/extensions/forms/hooks/DataValueWritePropsDocs.js +9 -9
  803. package/extensions/forms/hooks/DataValueWritePropsDocs.js.map +1 -1
  804. package/extensions/forms/hooks/useDataValue.d.ts +2 -2
  805. package/extensions/forms/hooks/useDataValue.js +5 -9
  806. package/extensions/forms/hooks/useDataValue.js.map +1 -1
  807. package/extensions/forms/hooks/useExternalValue.js +2 -2
  808. package/extensions/forms/hooks/useExternalValue.js.map +1 -1
  809. package/extensions/forms/hooks/useFieldProps.d.ts +8 -2
  810. package/extensions/forms/hooks/useFieldProps.js +164 -76
  811. package/extensions/forms/hooks/useFieldProps.js.map +1 -1
  812. package/extensions/forms/hooks/usePath.js +2 -2
  813. package/extensions/forms/hooks/usePath.js.map +1 -1
  814. package/extensions/forms/hooks/useValueProps.js +5 -5
  815. package/extensions/forms/hooks/useValueProps.js.map +1 -1
  816. package/extensions/forms/style/dnb-forms.css +9 -4
  817. package/extensions/forms/style/dnb-forms.min.css +1 -1
  818. package/extensions/forms/types.d.ts +33 -6
  819. package/extensions/forms/types.js.map +1 -1
  820. package/extensions/forms/utils/json-pointer/json-pointer.js +6 -0
  821. package/extensions/forms/utils/json-pointer/json-pointer.js.map +1 -1
  822. package/extensions/payment-card/PaymentCard.js +3 -12
  823. package/extensions/payment-card/PaymentCard.js.map +1 -1
  824. package/fragments/drawer-list/DrawerList.d.ts +4 -2
  825. package/fragments/drawer-list/DrawerList.js +33 -47
  826. package/fragments/drawer-list/DrawerList.js.map +1 -1
  827. package/fragments/drawer-list/DrawerListDocs.js +3 -3
  828. package/fragments/drawer-list/DrawerListDocs.js.map +1 -1
  829. package/fragments/drawer-list/style/dnb-drawer-list.scss +1 -1
  830. package/package.json +1 -1
  831. package/shared/AlignmentHelper.js +0 -4
  832. package/shared/AlignmentHelper.js.map +1 -1
  833. package/shared/Eufemia.d.ts +1 -1
  834. package/shared/Eufemia.js +2 -2
  835. package/shared/Eufemia.js.map +1 -1
  836. package/shared/component-helper.js +2 -1
  837. package/shared/component-helper.js.map +1 -1
  838. package/style/core/scopes.scss +1 -1
  839. package/style/core/utilities.scss +3 -12
  840. package/style/dnb-ui-basis.css +1 -1
  841. package/style/dnb-ui-basis.min.css +1 -1
  842. package/style/dnb-ui-body.css +1 -1
  843. package/style/dnb-ui-body.min.css +1 -1
  844. package/style/dnb-ui-components.css +90 -76
  845. package/style/dnb-ui-components.min.css +4 -4
  846. package/style/dnb-ui-core.css +1 -1
  847. package/style/dnb-ui-core.min.css +1 -1
  848. package/style/dnb-ui-elements.css +151 -31
  849. package/style/dnb-ui-elements.min.css +1 -1
  850. package/style/dnb-ui-extensions.css +9 -4
  851. package/style/dnb-ui-extensions.min.css +1 -1
  852. package/style/dnb-ui-forms.css +9 -4
  853. package/style/dnb-ui-forms.min.css +1 -1
  854. package/style/dnb-ui-fragments.css +1 -1
  855. package/style/dnb-ui-fragments.min.css +1 -1
  856. package/style/themes/theme-eiendom/eiendom-theme-basis.css +151 -31
  857. package/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
  858. package/style/themes/theme-eiendom/eiendom-theme-components.css +99 -80
  859. package/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
  860. package/style/themes/theme-eiendom/eiendom-theme-elements.css +151 -31
  861. package/style/themes/theme-eiendom/eiendom-theme-elements.min.css +1 -1
  862. package/style/themes/theme-eiendom/eiendom-theme-extensions.css +9 -4
  863. package/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
  864. package/style/themes/theme-eiendom/eiendom-theme-forms.css +9 -4
  865. package/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
  866. package/style/themes/theme-sbanken/sbanken-theme-basis.css +151 -31
  867. package/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
  868. package/style/themes/theme-sbanken/sbanken-theme-components.css +99 -80
  869. package/style/themes/theme-sbanken/sbanken-theme-components.min.css +4 -4
  870. package/style/themes/theme-sbanken/sbanken-theme-elements.css +151 -31
  871. package/style/themes/theme-sbanken/sbanken-theme-elements.min.css +1 -1
  872. package/style/themes/theme-sbanken/sbanken-theme-extensions.css +9 -4
  873. package/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
  874. package/style/themes/theme-sbanken/sbanken-theme-forms.css +9 -4
  875. package/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
  876. package/style/themes/theme-ui/ui-theme-basis.css +151 -31
  877. package/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
  878. package/style/themes/theme-ui/ui-theme-components.css +99 -80
  879. package/style/themes/theme-ui/ui-theme-components.min.css +4 -4
  880. package/style/themes/theme-ui/ui-theme-elements.css +151 -31
  881. package/style/themes/theme-ui/ui-theme-elements.min.css +1 -1
  882. package/style/themes/theme-ui/ui-theme-extensions.css +9 -4
  883. package/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
  884. package/style/themes/theme-ui/ui-theme-forms.css +9 -4
  885. package/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
  886. package/style/themes/theme-ui/ui-theme-tags.css +100 -19
  887. package/style/themes/theme-ui/ui-theme-tags.min.css +1 -1
  888. package/umd/dnb-ui-basis.min.js +1 -1
  889. package/umd/dnb-ui-components.min.js +1 -1
  890. package/umd/dnb-ui-elements.min.js +1 -1
  891. package/umd/dnb-ui-extensions.min.js +3 -3
  892. package/umd/dnb-ui-lib.min.js +1 -1
@@ -1 +1 @@
1
- .dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal) .dnb-dt,.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not([class*=dnb-space])>.dnb-dd>.dnb-dl,.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal)>.dnb-dd>.dnb-dl{margin:0}.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not(.dnb-dl__layout--grid)>.dnb-dd{margin-bottom:var(--spacing-medium)}.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not(.dnb-dl__layout--grid)>.dnb-dd:last-of-type{margin-bottom:0}.dnb-forms-value-block{display:block;font-size:var(--font-size-basis)}.dnb-forms-value-block--inline:not([class*=__composition]){display:inline-block;font-size:inherit}.dnb-forms-value-block__label,.dnb-forms-value-block__label strong{font-weight:var(--font-weight-medium)}.dnb-forms-value-block__placeholder{color:var(--color-black-80)}.dnb-forms-value-block--max-width-stretch{width:100%}@media screen and (min-width:25.00625em){.dnb-forms-value-block--max-width-small{max-width:var(--forms-field-width--small)}.dnb-forms-value-block--max-width-medium{max-width:var(--forms-field-width--medium)}.dnb-forms-value-block--max-width-large{max-width:var(--forms-field-width--large)}}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content{-moz-column-gap:var(--column-gap,0);column-gap:var(--column-gap,0);display:flex;flex-flow:row;row-gap:var(--row-gap,var(--spacing-medium))}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-none{--column-gap:0}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-xx-small{--column-gap:var(--spacing-xx-small)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-x-small{--column-gap:var(--spacing-x-small)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-small{--column-gap:var(--spacing-small)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-medium{--column-gap:var(--spacing-medium)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-large{--column-gap:var(--spacing-large)}@media screen and (min-width:25.00625em){.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content{align-items:flex-start}}@media screen and (max-width:25em){.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content{flex-flow:column}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content:not(:has(.dnb-forms-value-block__label)){--row-gap:var(--spacing-x-small)}}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content:not([class*=dnb-space])>.dnb-dl,.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dd,.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dl,.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dt{margin:0}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dl>.dnb-dd{margin-bottom:0}
1
+ .dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal) .dnb-dt,.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not([class*=dnb-space])>.dnb-dd>.dnb-dl,.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal)>.dnb-dd>.dnb-dl{margin:0}.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal) .dnb-dd:empty,.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal) .dnb-dt:empty{display:none}.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not(.dnb-dl__layout--grid)>.dnb-dd{margin-bottom:var(--spacing-medium);transition:margin-bottom .3s var(--easing-default)}.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not(.dnb-dl__layout--grid)>.dnb-dd:has(~.dnb-dt:empty~.dnb-dd:empty),.dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal):not(.dnb-dl__layout--grid)>.dnb-dd:last-of-type{margin-bottom:0}.dnb-forms-value-block{display:block;font-size:var(--font-size-basis)}.dnb-forms-value-block--inline:not([class*=__composition]){display:inline-block;font-size:inherit}.dnb-forms-value-block__label,.dnb-forms-value-block__label strong{font-weight:var(--font-weight-medium)}.dnb-forms-value-block__placeholder{color:var(--color-black-80)}.dnb-forms-value-block--max-width-stretch{width:100%}@media screen and (min-width:25.00625em){.dnb-forms-value-block--max-width-small{max-width:var(--forms-field-width--small)}.dnb-forms-value-block--max-width-medium{max-width:var(--forms-field-width--medium)}.dnb-forms-value-block--max-width-large{max-width:var(--forms-field-width--large)}}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content{-moz-column-gap:var(--column-gap,0);column-gap:var(--column-gap,0);display:flex;flex-flow:row;row-gap:var(--row-gap,var(--spacing-medium))}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-none{--column-gap:0}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-xx-small{--column-gap:var(--spacing-xx-small)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-x-small{--column-gap:var(--spacing-x-small)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-small{--column-gap:var(--spacing-small)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-medium{--column-gap:var(--spacing-medium)}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content--gap-large{--column-gap:var(--spacing-large)}@media screen and (min-width:25.00625em){.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content{align-items:flex-start}}@media screen and (max-width:25em){.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content{flex-flow:column}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content:not(:has(.dnb-forms-value-block__label)){--row-gap:var(--spacing-x-small)}}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content:not([class*=dnb-space])>.dnb-dl,.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dd,.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dl,.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dt{margin:0}.dnb-forms-value-block__composition--horizontal .dnb-forms-value-block__content>.dnb-dl>.dnb-dd{margin-bottom:0}
@@ -1,16 +1,28 @@
1
1
  @import '../../../../style/core/utilities.scss';
2
2
 
3
- .dnb-forms-summary-list.dnb-dl:not(.dnb-dl__layout--horizontal) {
4
- & .dnb-dt,
5
- & > .dnb-dd > .dnb-dl,
6
- &:not([class*='dnb-space']) > .dnb-dd > .dnb-dl {
7
- margin: 0;
8
- }
3
+ .dnb-forms-summary-list.dnb-dl {
4
+ &:not(.dnb-dl__layout--horizontal) {
5
+ & .dnb-dt,
6
+ & > .dnb-dd > .dnb-dl,
7
+ &:not([class*='dnb-space']) > .dnb-dd > .dnb-dl {
8
+ margin: 0;
9
+ }
9
10
 
10
- &:not(.dnb-dl__layout--grid) > .dnb-dd {
11
- margin-bottom: var(--spacing-medium);
12
- &:last-of-type {
13
- margin-bottom: 0;
11
+ .dnb-dt:empty,
12
+ .dnb-dd:empty {
13
+ display: none;
14
+ }
15
+
16
+ &:not(.dnb-dl__layout--grid) > .dnb-dd {
17
+ margin-bottom: var(--spacing-medium);
18
+
19
+ // Add support for using animated Form.Visibility in a SummaryList (VisibilityWrapper).
20
+ transition: margin-bottom 300ms var(--easing-default);
21
+
22
+ &:last-of-type,
23
+ &:has(~ .dnb-dt:empty ~ .dnb-dd:empty) {
24
+ margin-bottom: 0;
25
+ }
14
26
  }
15
27
  }
16
28
  }
@@ -53,6 +53,7 @@ function WizardContainer(props) {
53
53
  const activeIndexRef = useRef(initialActiveIndex);
54
54
  const totalStepsRef = useRef(NaN);
55
55
  const errorOnStepRef = useRef({});
56
+ const elementRef = useRef();
56
57
  const stepElementRef = useRef();
57
58
  const preventNextStepRef = useRef(false);
58
59
  const stepsRef = useRef({});
@@ -98,6 +99,7 @@ function WizardContainer(props) {
98
99
  scrollToTop,
99
100
  isInteractionRef
100
101
  } = useHandleLayoutEffect({
102
+ elementRef,
101
103
  stepElementRef
102
104
  });
103
105
  const executeLayoutAnimationRef = useRef();
@@ -240,7 +242,8 @@ function WizardContainer(props) {
240
242
  return React.createElement(WizardContext.Provider, {
241
243
  value: providerValue
242
244
  }, React.createElement(Space, _extends({
243
- className: classnames(`dnb-forms-wizard-layout dnb-forms-wizard-layout--${variant}`, className)
245
+ className: classnames(`dnb-forms-wizard-layout dnb-forms-wizard-layout--${variant}`, className),
246
+ innerRef: elementRef
244
247
  }, rest), React.createElement(DisplaySteps, {
245
248
  mode: mode,
246
249
  variant: variant,
@@ -378,13 +381,13 @@ function PrerenderFieldPropsProvider({
378
381
  }) {
379
382
  const {
380
383
  data,
381
- setFieldProps,
384
+ setFieldInternals,
382
385
  updateDataValue
383
386
  } = useContext(DataContext);
384
387
  return React.createElement(DataContext.Provider, {
385
388
  value: _objectSpread(_objectSpread({}, defaultContextState), {}, {
386
389
  data,
387
- setFieldProps,
390
+ setFieldInternals,
388
391
  updateDataValue,
389
392
  prerenderFieldProps: true,
390
393
  hasContext: true
@@ -1 +1 @@
1
- {"version":3,"file":"WizardContainer.js","names":["React","useContext","useCallback","useRef","useReducer","useMemo","ReactDOM","classnames","Space","StepIndicator","convertJsxToString","warn","isAsync","useId","Step","WizardContext","DataContext","defaultContextState","Handler","createReferenceKey","useSharedState","useHandleLayoutEffect","useStepAnimation","useVisibility","useLayoutEffect","window","useEffect","WizardContainer","props","_dataContext$setHandl","className","id","idProp","mode","initialActiveIndex","omitScrollManagement","omitFocusManagement","onStepChange","children","noAnimation","prerenderFieldProps","variant","sidebarId","rest","_objectWithoutProperties","_excluded","dataContext","hasContext","setFormState","handleSubmitCall","setShowAllErrors","showAllErrors","setSubmitState","forceUpdate","activeIndexRef","totalStepsRef","NaN","errorOnStepRef","stepElementRef","preventNextStepRef","stepsRef","tmpStepsRef","updateTitlesRef","prerenderFieldPropsRef","sharedStateRef","current","undefined","preventNavigation","shouldPrevent","getStepChangeOptions","index","_stepsRef$current$ind","previousIndex","options","previousStep","_stepsRef$current$pre","previousId","Object","assign","callOnStepChange","setFocus","scrollToTop","isInteractionRef","executeLayoutAnimationRef","handleLayoutEffect","handleStepChange","skipErrorCheck","skipStepChangeCall","skipStepChangeCallBeforeMounted","skipStepChangeCallFromHook","skipFieldValidation","enableAsyncBehavior","onSubmit","_sharedStateRef$curre","_sharedStateRef$curre2","_sharedStateRef$curre3","data","call","result","Error","setActiveIndex","_objectSpread","handlePrevious","handleNext","handleChange","current_step","setFormError","error","handleSubmit","preventSubmit","setHandleSubmit","check","activeIndex","providerValue","extend","_updateTitlesRef$curr","stepsLengthDidChange","count","keys","length","tmpCount","_executeLayoutAnimati","createElement","_extends","Provider","value","DisplaySteps","IterateOverSteps","PrerenderFieldPropsOfOtherSteps","sidebar_id","Sidebar","bottom","values","map","title","no_animation","on_change","incrementIndex","childrenArray","Children","child","isValidElement","_child","_child2","step","type","_step","apply","active","activeWhen","visibleWhen","key","clone","cloneElement","document","hasRenderedRef","WizardPortal","PrerenderFieldPropsProvider","hidden","Fn","i","createPortal","body","setFieldProps","updateDataValue","_supportsSpacingProps"],"sources":["../../../../../../src/extensions/forms/Wizard/Container/WizardContainer.tsx"],"sourcesContent":["import React, {\n useContext,\n useCallback,\n useRef,\n useReducer,\n useMemo,\n} from 'react'\nimport ReactDOM from 'react-dom'\nimport classnames from 'classnames'\nimport { Space, StepIndicator } from '../../../../components'\nimport {\n convertJsxToString,\n warn,\n} from '../../../../shared/component-helper'\nimport { isAsync } from '../../../../shared/helpers/isAsync'\nimport useId from '../../../../shared/helpers/useId'\nimport Step, { Props as StepProps } from '../Step'\nimport WizardContext, {\n OnStepChange,\n OnStepChangeOptions,\n OnStepsChangeMode,\n SetActiveIndexOptions,\n StepIndex,\n Steps,\n WizardContextState,\n} from '../Context/WizardContext'\nimport DataContext, {\n defaultContextState,\n} from '../../DataContext/Context'\nimport Handler from '../../Form/Handler/Handler'\nimport {\n SharedStateReturn,\n createReferenceKey,\n useSharedState,\n} from '../../../../shared/helpers/useSharedState'\nimport useHandleLayoutEffect from './useHandleLayoutEffect'\nimport useStepAnimation from './useStepAnimation'\nimport { ComponentProps } from '../../types'\nimport useVisibility from '../../Form/Visibility/useVisibility'\n\n// SSR warning fix: https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\nconst useLayoutEffect =\n typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect\n\nexport type Props = ComponentProps & {\n id?: string\n\n /**\n * The mode of the wizard.\n */\n mode?: 'static' | 'strict' | 'loose'\n\n /**\n * If set to `true`, the wizard will not scroll to the first step when the user clicks on the next button.\n */\n omitScrollManagement?: boolean\n\n /**\n * If set to `true`, the wizard will not focus on the next step when the user clicks on the next button.\n */\n omitFocusManagement?: boolean\n\n /**\n * The index of the first step to be rendered.\n */\n initialActiveIndex?: StepIndex\n\n /**\n * The callback function that will be called when the user clicks on the next button.\n */\n onStepChange?: OnStepChange\n\n /**\n * The sidebar variant.\n */\n variant?: 'sidebar' | 'drawer'\n sidebarId?: string\n\n /**\n * If set to `true`, the wizard will not animate the steps.\n */\n noAnimation?: boolean\n\n /**\n * If set to `true`, the wizard pre-render all steps so the props of each field is available in the data context.\n * Defaults to `true`.\n */\n prerenderFieldProps?: boolean\n\n /**\n * The children of the wizard container.\n */\n children: React.ReactNode\n\n /**\n * @deprecated Is enabled by default. You can disable it with \"omitScrollManagement\"\n */\n scrollTopOnStepChange?: boolean\n}\n\nfunction WizardContainer(props: Props) {\n const {\n className,\n id: idProp,\n mode = 'strict',\n initialActiveIndex = 0,\n omitScrollManagement,\n omitFocusManagement,\n onStepChange,\n children,\n noAnimation = true,\n prerenderFieldProps = true,\n variant = 'sidebar',\n sidebarId,\n ...rest\n } = props\n\n const dataContext = useContext(DataContext)\n const {\n hasContext,\n setFormState,\n handleSubmitCall,\n setShowAllErrors,\n showAllErrors,\n setSubmitState,\n } = dataContext\n\n const id = useId(idProp)\n const [, forceUpdate] = useReducer(() => ({}), {})\n const activeIndexRef = useRef<StepIndex>(initialActiveIndex)\n const totalStepsRef = useRef<number>(NaN)\n const errorOnStepRef = useRef<Record<StepIndex, boolean>>({})\n const stepElementRef = useRef<HTMLElement>()\n const preventNextStepRef = useRef(false)\n const stepsRef = useRef<Steps>({})\n const tmpStepsRef = useRef<Steps>({})\n const updateTitlesRef = useRef<() => void>()\n const prerenderFieldPropsRef = useRef<\n Record<string, () => React.ReactElement>\n >({})\n\n // - Handle shared state\n const sharedStateRef =\n useRef<\n SharedStateReturn<\n WizardContextState & { onStepChange?: OnStepChange }\n >\n >()\n sharedStateRef.current = useSharedState<WizardContextState>(\n hasContext && id ? createReferenceKey(id, 'wizard') : undefined\n )\n\n // Store the current state of showAllErrors\n errorOnStepRef.current[activeIndexRef.current] = showAllErrors\n\n const preventNavigation = useCallback((shouldPrevent = true) => {\n preventNextStepRef.current = shouldPrevent\n }, [])\n\n const getStepChangeOptions: (index: StepIndex) => OnStepChangeOptions =\n useCallback(\n (index) => {\n const previousIndex = activeIndexRef.current\n const options = {\n preventNavigation,\n previousStep: { index: previousIndex },\n }\n\n const id = stepsRef.current[index]?.id\n if (id) {\n const previousId = stepsRef.current[previousIndex]?.id\n Object.assign(options, { id })\n Object.assign(options.previousStep, { id: previousId })\n }\n\n return options\n },\n [preventNavigation]\n )\n\n const callOnStepChange = useCallback(\n async (index: StepIndex, mode: OnStepsChangeMode) => {\n if (isAsync(onStepChange)) {\n return await onStepChange(index, mode, getStepChangeOptions(index))\n }\n\n return onStepChange?.(index, mode, getStepChangeOptions(index))\n },\n [getStepChangeOptions, onStepChange]\n )\n\n const { setFocus, scrollToTop, isInteractionRef } =\n useHandleLayoutEffect({\n stepElementRef,\n })\n\n const executeLayoutAnimationRef = useRef<() => void>()\n useStepAnimation({\n activeIndexRef,\n stepElementRef,\n executeLayoutAnimationRef,\n })\n\n const handleLayoutEffect = useCallback(() => {\n if (!omitFocusManagement) {\n setFocus()\n }\n if (!omitScrollManagement) {\n scrollToTop()\n }\n }, [omitScrollManagement, omitFocusManagement, setFocus, scrollToTop])\n\n const handleStepChange = useCallback(\n ({\n index,\n skipErrorCheck,\n skipStepChangeCall,\n skipStepChangeCallBeforeMounted,\n skipStepChangeCallFromHook,\n mode,\n }: {\n index: StepIndex\n mode: OnStepsChangeMode\n } & SetActiveIndexOptions) => {\n handleSubmitCall({\n skipErrorCheck,\n skipFieldValidation: skipErrorCheck,\n enableAsyncBehavior: isAsync(onStepChange),\n onSubmit: async () => {\n if (!skipStepChangeCallFromHook) {\n sharedStateRef.current?.data?.onStepChange?.(\n index,\n mode,\n getStepChangeOptions(index)\n )\n }\n\n let result = undefined\n\n if (\n !skipStepChangeCall &&\n !(skipStepChangeCallBeforeMounted && !isInteractionRef.current)\n ) {\n result = await callOnStepChange(index, mode)\n }\n\n // Hide async indicator\n setFormState('abort')\n\n if (!skipErrorCheck) {\n // Set the showAllErrors to the step we got to\n setShowAllErrors(errorOnStepRef.current[index])\n }\n\n if (!preventNextStepRef.current && !(result instanceof Error)) {\n handleLayoutEffect()\n\n activeIndexRef.current = index\n forceUpdate()\n }\n\n preventNextStepRef.current = false\n\n return result\n },\n })\n },\n [\n callOnStepChange,\n getStepChangeOptions,\n handleLayoutEffect,\n handleSubmitCall,\n isInteractionRef,\n onStepChange,\n setFormState,\n setShowAllErrors,\n ]\n )\n\n const setActiveIndex = useCallback(\n (index: StepIndex, options?: SetActiveIndexOptions) => {\n if (index === activeIndexRef.current) {\n return\n }\n\n const mode = index > activeIndexRef.current ? 'next' : 'previous'\n\n handleStepChange({\n index,\n skipErrorCheck: mode === 'previous',\n mode,\n ...options,\n })\n },\n [handleStepChange]\n )\n\n const handlePrevious = useCallback(() => {\n setActiveIndex(activeIndexRef.current - 1)\n }, [setActiveIndex])\n\n const handleNext = useCallback(() => {\n setActiveIndex(activeIndexRef.current + 1)\n }, [setActiveIndex])\n\n const handleChange = useCallback(\n ({ current_step }) => {\n setActiveIndex(current_step, { skipErrorCheck: true })\n },\n [setActiveIndex]\n )\n\n const setFormError = useCallback(\n (error: Error) => {\n setSubmitState?.({ error })\n },\n [setSubmitState]\n )\n\n const handleSubmit = useCallback(\n ({ preventSubmit }) => {\n if (activeIndexRef.current + 1 < totalStepsRef.current) {\n handleNext()\n preventSubmit()\n }\n },\n [handleNext]\n )\n dataContext.setHandleSubmit?.(handleSubmit)\n\n const { check } = useVisibility()\n\n const activeIndex = activeIndexRef.current\n const providerValue = useMemo<WizardContextState>(() => {\n return {\n id,\n activeIndex,\n stepElementRef,\n stepsRef,\n updateTitlesRef,\n activeIndexRef,\n totalStepsRef,\n prerenderFieldProps,\n prerenderFieldPropsRef,\n check,\n setActiveIndex,\n handlePrevious,\n handleNext,\n setFormError,\n }\n }, [\n activeIndex,\n handleNext,\n handlePrevious,\n id,\n prerenderFieldProps,\n check,\n setActiveIndex,\n setFormError,\n ])\n\n // - Handle shared state\n useLayoutEffect(() => {\n if (id && hasContext) {\n sharedStateRef.current.extend(providerValue)\n }\n }, [hasContext, id, providerValue])\n\n useLayoutEffect(() => {\n updateTitlesRef.current?.()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [stepsRef.current])\n\n const stepsLengthDidChange = useCallback(() => {\n const count = Object.keys(stepsRef.current).length\n const tmpCount = Object.keys(tmpStepsRef.current).length\n return count !== 0 && tmpCount !== 0 && count !== tmpCount\n }, [])\n\n // - Call onStepChange when step gets replaced or added (e.g. via activeWhen)\n useLayoutEffect(() => {\n if (stepsLengthDidChange()) {\n callOnStepChange(activeIndexRef.current, 'stepListModified')\n executeLayoutAnimationRef.current?.()\n }\n tmpStepsRef.current = stepsRef.current\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [stepsRef.current, callOnStepChange, stepsLengthDidChange])\n\n if (!hasContext) {\n warn('You may wrap Wizard.Container in Form.Handler')\n return (\n <Handler>\n <WizardContainer {...props} id={id} />\n </Handler>\n )\n }\n\n return (\n <WizardContext.Provider value={providerValue}>\n <Space\n className={classnames(\n 'dnb-forms-wizard-layout',\n `dnb-forms-wizard-layout--${variant}`,\n className\n )}\n {...rest}\n >\n <DisplaySteps\n mode={mode}\n variant={variant}\n noAnimation={noAnimation}\n handleChange={handleChange}\n sidebarId={sidebarId}\n />\n\n <div className=\"dnb-forms-wizard-layout__contents\">\n <IterateOverSteps>{children}</IterateOverSteps>\n </div>\n </Space>\n\n {prerenderFieldProps && (\n <PrerenderFieldPropsOfOtherSteps\n prerenderFieldPropsRef={prerenderFieldPropsRef}\n />\n )}\n </WizardContext.Provider>\n )\n}\n\nfunction DisplaySteps({\n mode,\n variant,\n noAnimation,\n handleChange,\n sidebarId,\n}) {\n const [, forceUpdate] = useReducer(() => ({}), {})\n const { id, activeIndexRef, stepsRef, updateTitlesRef } =\n useContext(WizardContext) || {}\n updateTitlesRef.current = () => {\n forceUpdate()\n }\n\n const sidebar_id =\n variant === 'drawer' && !sidebarId ? undefined : sidebarId ?? id\n\n return (\n <aside className=\"dnb-forms-wizard-layout__indicator\">\n <StepIndicator.Sidebar sidebar_id={sidebar_id} />\n <StepIndicator\n bottom\n current_step={activeIndexRef.current}\n data={Object.values(stepsRef.current).map(({ title }) => title)}\n mode={mode}\n no_animation={noAnimation}\n on_change={handleChange}\n sidebar_id={sidebar_id}\n />\n </aside>\n )\n}\n\nfunction IterateOverSteps({ children }) {\n const {\n check,\n stepsRef,\n activeIndexRef,\n totalStepsRef,\n prerenderFieldProps,\n prerenderFieldPropsRef,\n } = useContext(WizardContext)\n\n stepsRef.current = {}\n let incrementIndex = -1\n\n const childrenArray = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n let step = child\n\n if (child?.type !== Step && typeof child.type === 'function') {\n step = child.type.apply(child.type, [\n child.props,\n ]) as React.ReactElement\n\n if (step?.type === Step) {\n child = step\n }\n }\n\n if (child?.type === Step) {\n if (child.props.active === false) {\n return null\n }\n\n if (\n child.props.activeWhen &&\n !check({ visibleWhen: child.props.activeWhen })\n ) {\n return null\n }\n\n incrementIndex++\n const index = incrementIndex\n\n stepsRef.current[index] = {\n id: child.props.id,\n title:\n child.props.title !== undefined\n ? convertJsxToString(child.props.title)\n : 'Title missing',\n }\n const key = `${index}-${activeIndexRef.current}`\n const clone = (props) =>\n React.cloneElement(child as React.ReactElement<StepProps>, props)\n\n if (\n prerenderFieldProps &&\n typeof document !== 'undefined' &&\n index !== activeIndexRef.current &&\n typeof prerenderFieldPropsRef.current['step-' + index] ===\n 'undefined'\n ) {\n prerenderFieldPropsRef.current['step-' + index] = () =>\n clone({\n key,\n index,\n prerenderFieldProps: true,\n })\n }\n\n return clone({\n key,\n index,\n })\n }\n }\n\n return child\n })\n\n // Ensure we never have a higher index than the available children\n // else we get a white screen\n if (childrenArray?.length === 0) {\n activeIndexRef.current = 0\n } else if (childrenArray?.length < activeIndexRef.current + 1) {\n activeIndexRef.current = childrenArray.length - 1\n }\n\n totalStepsRef.current = childrenArray?.length\n\n return childrenArray\n}\n\nfunction PrerenderFieldPropsOfOtherSteps({\n prerenderFieldPropsRef,\n}: {\n prerenderFieldPropsRef: WizardContextState['prerenderFieldPropsRef']\n}) {\n const hasRenderedRef = useRef(true)\n if (!hasRenderedRef.current) {\n return null\n }\n hasRenderedRef.current = false\n\n return (\n <WizardPortal>\n <PrerenderFieldPropsProvider>\n <iframe title=\"Wizard Prerender\" hidden>\n {Object.values(prerenderFieldPropsRef.current).map((Fn, i) => (\n <Fn key={i} />\n ))}\n </iframe>\n </PrerenderFieldPropsProvider>\n </WizardPortal>\n )\n}\n\nfunction WizardPortal({ children }) {\n if (typeof document !== 'undefined') {\n return ReactDOM.createPortal(children, document.body)\n }\n}\n\nfunction PrerenderFieldPropsProvider({ children }) {\n const { data, setFieldProps, updateDataValue } = useContext(DataContext)\n\n return (\n <DataContext.Provider\n value={{\n ...defaultContextState,\n\n // Only update the props and the data value\n data,\n setFieldProps,\n updateDataValue,\n prerenderFieldProps: true,\n hasContext: true,\n }}\n >\n <WizardContext.Provider value={{ prerenderFieldProps: true }}>\n {children}\n </WizardContext.Provider>\n </DataContext.Provider>\n )\n}\n\nWizardContainer._supportsSpacingProps = true\n\nexport default WizardContainer\n"],"mappings":";;;;;;;;AAAA,OAAOA,KAAK,IACVC,UAAU,EACVC,WAAW,EACXC,MAAM,EACNC,UAAU,EACVC,OAAO,QACF,OAAO;AACd,OAAOC,QAAQ,MAAM,WAAW;AAChC,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,KAAK,EAAEC,aAAa,QAAQ,wBAAwB;AAC7D,SACEC,kBAAkB,EAClBC,IAAI,QACC,qCAAqC;AAC5C,SAASC,OAAO,QAAQ,oCAAoC;AAC5D,OAAOC,KAAK,MAAM,kCAAkC;AACpD,OAAOC,IAAI,MAA8B,SAAS;AAClD,OAAOC,aAAa,MAQb,0BAA0B;AACjC,OAAOC,WAAW,IA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AASL,2BAA2BA,CAAC;EAAEvH;AAAS,CAAC,EAAE;EACjD,MAAM;IAAE0D,IAAI;IAAEmE,aAAa;IAAEC;EAAgB,CAAC,GAAGnK,UAAU,CAACe,WAAW,CAAC;EAExE,OACEhB,KAAA,CAAA0H,aAAA,CAAC1G,WAAW,CAAC4G,QAAQ;IACnBC,KAAK,EAAAxB,aAAA,CAAAA,aAAA,KACApF,mBAAmB;MAGtB+E,IAAI;MACJmE,aAAa;MACbC,eAAe;MACf5H,mBAAmB,EAAE,IAAI;MACzBO,UAAU,EAAE;IAAI;EAChB,GAEF/C,KAAA,CAAA0H,aAAA,CAAC3G,aAAa,CAAC6G,QAAQ;IAACC,KAAK,EAAE;MAAErF,mBAAmB,EAAE;IAAK;EAAE,GAC1DF,QACqB,CACJ,CAAC;AAE3B;AAEAX,eAAe,CAAC0I,qBAAqB,GAAG,IAAI;AAE5C,eAAe1I,eAAe"}
1
+ {"version":3,"file":"WizardContainer.js","names":["React","useContext","useCallback","useRef","useReducer","useMemo","ReactDOM","classnames","Space","StepIndicator","convertJsxToString","warn","isAsync","useId","Step","WizardContext","DataContext","defaultContextState","Handler","createReferenceKey","useSharedState","useHandleLayoutEffect","useStepAnimation","useVisibility","useLayoutEffect","window","useEffect","WizardContainer","props","_dataContext$setHandl","className","id","idProp","mode","initialActiveIndex","omitScrollManagement","omitFocusManagement","onStepChange","children","noAnimation","prerenderFieldProps","variant","sidebarId","rest","_objectWithoutProperties","_excluded","dataContext","hasContext","setFormState","handleSubmitCall","setShowAllErrors","showAllErrors","setSubmitState","forceUpdate","activeIndexRef","totalStepsRef","NaN","errorOnStepRef","elementRef","stepElementRef","preventNextStepRef","stepsRef","tmpStepsRef","updateTitlesRef","prerenderFieldPropsRef","sharedStateRef","current","undefined","preventNavigation","shouldPrevent","getStepChangeOptions","index","_stepsRef$current$ind","previousIndex","options","previousStep","_stepsRef$current$pre","previousId","Object","assign","callOnStepChange","setFocus","scrollToTop","isInteractionRef","executeLayoutAnimationRef","handleLayoutEffect","handleStepChange","skipErrorCheck","skipStepChangeCall","skipStepChangeCallBeforeMounted","skipStepChangeCallFromHook","skipFieldValidation","enableAsyncBehavior","onSubmit","_sharedStateRef$curre","_sharedStateRef$curre2","_sharedStateRef$curre3","data","call","result","Error","setActiveIndex","_objectSpread","handlePrevious","handleNext","handleChange","current_step","setFormError","error","handleSubmit","preventSubmit","setHandleSubmit","check","activeIndex","providerValue","extend","_updateTitlesRef$curr","stepsLengthDidChange","count","keys","length","tmpCount","_executeLayoutAnimati","createElement","_extends","Provider","value","innerRef","DisplaySteps","IterateOverSteps","PrerenderFieldPropsOfOtherSteps","sidebar_id","Sidebar","bottom","values","map","title","no_animation","on_change","incrementIndex","childrenArray","Children","child","isValidElement","_child","_child2","step","type","_step","apply","active","activeWhen","visibleWhen","key","clone","cloneElement","document","hasRenderedRef","WizardPortal","PrerenderFieldPropsProvider","hidden","Fn","i","createPortal","body","setFieldInternals","updateDataValue","_supportsSpacingProps"],"sources":["../../../../../../src/extensions/forms/Wizard/Container/WizardContainer.tsx"],"sourcesContent":["import React, {\n useContext,\n useCallback,\n useRef,\n useReducer,\n useMemo,\n} from 'react'\nimport ReactDOM from 'react-dom'\nimport classnames from 'classnames'\nimport { Space, StepIndicator } from '../../../../components'\nimport {\n convertJsxToString,\n warn,\n} from '../../../../shared/component-helper'\nimport { isAsync } from '../../../../shared/helpers/isAsync'\nimport useId from '../../../../shared/helpers/useId'\nimport Step, { Props as StepProps } from '../Step'\nimport WizardContext, {\n OnStepChange,\n OnStepChangeOptions,\n OnStepsChangeMode,\n SetActiveIndexOptions,\n StepIndex,\n Steps,\n WizardContextState,\n} from '../Context/WizardContext'\nimport DataContext, {\n defaultContextState,\n} from '../../DataContext/Context'\nimport Handler from '../../Form/Handler/Handler'\nimport {\n SharedStateReturn,\n createReferenceKey,\n useSharedState,\n} from '../../../../shared/helpers/useSharedState'\nimport useHandleLayoutEffect from './useHandleLayoutEffect'\nimport useStepAnimation from './useStepAnimation'\nimport { ComponentProps } from '../../types'\nimport useVisibility from '../../Form/Visibility/useVisibility'\n\n// SSR warning fix: https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\nconst useLayoutEffect =\n typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect\n\nexport type Props = ComponentProps & {\n id?: string\n\n /**\n * The mode of the wizard.\n */\n mode?: 'static' | 'strict' | 'loose'\n\n /**\n * If set to `true`, the wizard will not scroll to the first step when the user clicks on the next button.\n */\n omitScrollManagement?: boolean\n\n /**\n * If set to `true`, the wizard will not focus on the next step when the user clicks on the next button.\n */\n omitFocusManagement?: boolean\n\n /**\n * The index of the first step to be rendered.\n */\n initialActiveIndex?: StepIndex\n\n /**\n * The callback function that will be called when the user clicks on the next button.\n */\n onStepChange?: OnStepChange\n\n /**\n * The sidebar variant.\n */\n variant?: 'sidebar' | 'drawer'\n sidebarId?: string\n\n /**\n * If set to `true`, the wizard will not animate the steps.\n */\n noAnimation?: boolean\n\n /**\n * If set to `true`, the wizard pre-render all steps so the props of each field is available in the data context.\n * Defaults to `true`.\n */\n prerenderFieldProps?: boolean\n\n /**\n * The children of the wizard container.\n */\n children: React.ReactNode\n\n /**\n * @deprecated Is enabled by default. You can disable it with \"omitScrollManagement\"\n */\n scrollTopOnStepChange?: boolean\n}\n\nfunction WizardContainer(props: Props) {\n const {\n className,\n id: idProp,\n mode = 'strict',\n initialActiveIndex = 0,\n omitScrollManagement,\n omitFocusManagement,\n onStepChange,\n children,\n noAnimation = true,\n prerenderFieldProps = true,\n variant = 'sidebar',\n sidebarId,\n ...rest\n } = props\n\n const dataContext = useContext(DataContext)\n const {\n hasContext,\n setFormState,\n handleSubmitCall,\n setShowAllErrors,\n showAllErrors,\n setSubmitState,\n } = dataContext\n\n const id = useId(idProp)\n const [, forceUpdate] = useReducer(() => ({}), {})\n const activeIndexRef = useRef<StepIndex>(initialActiveIndex)\n const totalStepsRef = useRef<number>(NaN)\n const errorOnStepRef = useRef<Record<StepIndex, boolean>>({})\n const elementRef = useRef<HTMLElement>()\n const stepElementRef = useRef<HTMLElement>()\n const preventNextStepRef = useRef(false)\n const stepsRef = useRef<Steps>({})\n const tmpStepsRef = useRef<Steps>({})\n const updateTitlesRef = useRef<() => void>()\n const prerenderFieldPropsRef = useRef<\n Record<string, () => React.ReactElement>\n >({})\n\n // - Handle shared state\n const sharedStateRef =\n useRef<\n SharedStateReturn<\n WizardContextState & { onStepChange?: OnStepChange }\n >\n >()\n sharedStateRef.current = useSharedState<WizardContextState>(\n hasContext && id ? createReferenceKey(id, 'wizard') : undefined\n )\n\n // Store the current state of showAllErrors\n errorOnStepRef.current[activeIndexRef.current] = showAllErrors\n\n const preventNavigation = useCallback((shouldPrevent = true) => {\n preventNextStepRef.current = shouldPrevent\n }, [])\n\n const getStepChangeOptions: (index: StepIndex) => OnStepChangeOptions =\n useCallback(\n (index) => {\n const previousIndex = activeIndexRef.current\n const options = {\n preventNavigation,\n previousStep: { index: previousIndex },\n }\n\n const id = stepsRef.current[index]?.id\n if (id) {\n const previousId = stepsRef.current[previousIndex]?.id\n Object.assign(options, { id })\n Object.assign(options.previousStep, { id: previousId })\n }\n\n return options\n },\n [preventNavigation]\n )\n\n const callOnStepChange = useCallback(\n async (index: StepIndex, mode: OnStepsChangeMode) => {\n if (isAsync(onStepChange)) {\n return await onStepChange(index, mode, getStepChangeOptions(index))\n }\n\n return onStepChange?.(index, mode, getStepChangeOptions(index))\n },\n [getStepChangeOptions, onStepChange]\n )\n\n const { setFocus, scrollToTop, isInteractionRef } =\n useHandleLayoutEffect({ elementRef, stepElementRef })\n\n const executeLayoutAnimationRef = useRef<() => void>()\n useStepAnimation({\n activeIndexRef,\n stepElementRef,\n executeLayoutAnimationRef,\n })\n\n const handleLayoutEffect = useCallback(() => {\n if (!omitFocusManagement) {\n setFocus()\n }\n if (!omitScrollManagement) {\n scrollToTop()\n }\n }, [omitScrollManagement, omitFocusManagement, setFocus, scrollToTop])\n\n const handleStepChange = useCallback(\n ({\n index,\n skipErrorCheck,\n skipStepChangeCall,\n skipStepChangeCallBeforeMounted,\n skipStepChangeCallFromHook,\n mode,\n }: {\n index: StepIndex\n mode: OnStepsChangeMode\n } & SetActiveIndexOptions) => {\n handleSubmitCall({\n skipErrorCheck,\n skipFieldValidation: skipErrorCheck,\n enableAsyncBehavior: isAsync(onStepChange),\n onSubmit: async () => {\n if (!skipStepChangeCallFromHook) {\n sharedStateRef.current?.data?.onStepChange?.(\n index,\n mode,\n getStepChangeOptions(index)\n )\n }\n\n let result = undefined\n\n if (\n !skipStepChangeCall &&\n !(skipStepChangeCallBeforeMounted && !isInteractionRef.current)\n ) {\n result = await callOnStepChange(index, mode)\n }\n\n // Hide async indicator\n setFormState('abort')\n\n if (!skipErrorCheck) {\n // Set the showAllErrors to the step we got to\n setShowAllErrors(errorOnStepRef.current[index])\n }\n\n if (!preventNextStepRef.current && !(result instanceof Error)) {\n handleLayoutEffect()\n\n activeIndexRef.current = index\n forceUpdate()\n }\n\n preventNextStepRef.current = false\n\n return result\n },\n })\n },\n [\n callOnStepChange,\n getStepChangeOptions,\n handleLayoutEffect,\n handleSubmitCall,\n isInteractionRef,\n onStepChange,\n setFormState,\n setShowAllErrors,\n ]\n )\n\n const setActiveIndex = useCallback(\n (index: StepIndex, options?: SetActiveIndexOptions) => {\n if (index === activeIndexRef.current) {\n return\n }\n\n const mode = index > activeIndexRef.current ? 'next' : 'previous'\n\n handleStepChange({\n index,\n skipErrorCheck: mode === 'previous',\n mode,\n ...options,\n })\n },\n [handleStepChange]\n )\n\n const handlePrevious = useCallback(() => {\n setActiveIndex(activeIndexRef.current - 1)\n }, [setActiveIndex])\n\n const handleNext = useCallback(() => {\n setActiveIndex(activeIndexRef.current + 1)\n }, [setActiveIndex])\n\n const handleChange = useCallback(\n ({ current_step }) => {\n setActiveIndex(current_step, { skipErrorCheck: true })\n },\n [setActiveIndex]\n )\n\n const setFormError = useCallback(\n (error: Error) => {\n setSubmitState?.({ error })\n },\n [setSubmitState]\n )\n\n const handleSubmit = useCallback(\n ({ preventSubmit }) => {\n if (activeIndexRef.current + 1 < totalStepsRef.current) {\n handleNext()\n preventSubmit()\n }\n },\n [handleNext]\n )\n dataContext.setHandleSubmit?.(handleSubmit)\n\n const { check } = useVisibility()\n\n const activeIndex = activeIndexRef.current\n const providerValue = useMemo<WizardContextState>(() => {\n return {\n id,\n activeIndex,\n stepElementRef,\n stepsRef,\n updateTitlesRef,\n activeIndexRef,\n totalStepsRef,\n prerenderFieldProps,\n prerenderFieldPropsRef,\n check,\n setActiveIndex,\n handlePrevious,\n handleNext,\n setFormError,\n }\n }, [\n activeIndex,\n handleNext,\n handlePrevious,\n id,\n prerenderFieldProps,\n check,\n setActiveIndex,\n setFormError,\n ])\n\n // - Handle shared state\n useLayoutEffect(() => {\n if (id && hasContext) {\n sharedStateRef.current.extend(providerValue)\n }\n }, [hasContext, id, providerValue])\n\n useLayoutEffect(() => {\n updateTitlesRef.current?.()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [stepsRef.current])\n\n const stepsLengthDidChange = useCallback(() => {\n const count = Object.keys(stepsRef.current).length\n const tmpCount = Object.keys(tmpStepsRef.current).length\n return count !== 0 && tmpCount !== 0 && count !== tmpCount\n }, [])\n\n // - Call onStepChange when step gets replaced or added (e.g. via activeWhen)\n useLayoutEffect(() => {\n if (stepsLengthDidChange()) {\n callOnStepChange(activeIndexRef.current, 'stepListModified')\n executeLayoutAnimationRef.current?.()\n }\n tmpStepsRef.current = stepsRef.current\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [stepsRef.current, callOnStepChange, stepsLengthDidChange])\n\n if (!hasContext) {\n warn('You may wrap Wizard.Container in Form.Handler')\n return (\n <Handler>\n <WizardContainer {...props} id={id} />\n </Handler>\n )\n }\n\n return (\n <WizardContext.Provider value={providerValue}>\n <Space\n className={classnames(\n 'dnb-forms-wizard-layout',\n `dnb-forms-wizard-layout--${variant}`,\n className\n )}\n innerRef={elementRef}\n {...rest}\n >\n <DisplaySteps\n mode={mode}\n variant={variant}\n noAnimation={noAnimation}\n handleChange={handleChange}\n sidebarId={sidebarId}\n />\n\n <div className=\"dnb-forms-wizard-layout__contents\">\n <IterateOverSteps>{children}</IterateOverSteps>\n </div>\n </Space>\n\n {prerenderFieldProps && (\n <PrerenderFieldPropsOfOtherSteps\n prerenderFieldPropsRef={prerenderFieldPropsRef}\n />\n )}\n </WizardContext.Provider>\n )\n}\n\nfunction DisplaySteps({\n mode,\n variant,\n noAnimation,\n handleChange,\n sidebarId,\n}) {\n const [, forceUpdate] = useReducer(() => ({}), {})\n const { id, activeIndexRef, stepsRef, updateTitlesRef } =\n useContext(WizardContext) || {}\n updateTitlesRef.current = () => {\n forceUpdate()\n }\n\n const sidebar_id =\n variant === 'drawer' && !sidebarId ? undefined : sidebarId ?? id\n\n return (\n <aside className=\"dnb-forms-wizard-layout__indicator\">\n <StepIndicator.Sidebar sidebar_id={sidebar_id} />\n <StepIndicator\n bottom\n current_step={activeIndexRef.current}\n data={Object.values(stepsRef.current).map(({ title }) => title)}\n mode={mode}\n no_animation={noAnimation}\n on_change={handleChange}\n sidebar_id={sidebar_id}\n />\n </aside>\n )\n}\n\nfunction IterateOverSteps({ children }) {\n const {\n check,\n stepsRef,\n activeIndexRef,\n totalStepsRef,\n prerenderFieldProps,\n prerenderFieldPropsRef,\n } = useContext(WizardContext)\n\n stepsRef.current = {}\n let incrementIndex = -1\n\n const childrenArray = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n let step = child\n\n if (child?.type !== Step && typeof child.type === 'function') {\n step = child.type.apply(child.type, [\n child.props,\n ]) as React.ReactElement\n\n if (step?.type === Step) {\n child = step\n }\n }\n\n if (child?.type === Step) {\n if (child.props.active === false) {\n return null\n }\n\n if (\n child.props.activeWhen &&\n !check({ visibleWhen: child.props.activeWhen })\n ) {\n return null\n }\n\n incrementIndex++\n const index = incrementIndex\n\n stepsRef.current[index] = {\n id: child.props.id,\n title:\n child.props.title !== undefined\n ? convertJsxToString(child.props.title)\n : 'Title missing',\n }\n const key = `${index}-${activeIndexRef.current}`\n const clone = (props) =>\n React.cloneElement(child as React.ReactElement<StepProps>, props)\n\n if (\n prerenderFieldProps &&\n typeof document !== 'undefined' &&\n index !== activeIndexRef.current &&\n typeof prerenderFieldPropsRef.current['step-' + index] ===\n 'undefined'\n ) {\n prerenderFieldPropsRef.current['step-' + index] = () =>\n clone({\n key,\n index,\n prerenderFieldProps: true,\n })\n }\n\n return clone({\n key,\n index,\n })\n }\n }\n\n return child\n })\n\n // Ensure we never have a higher index than the available children\n // else we get a white screen\n if (childrenArray?.length === 0) {\n activeIndexRef.current = 0\n } else if (childrenArray?.length < activeIndexRef.current + 1) {\n activeIndexRef.current = childrenArray.length - 1\n }\n\n totalStepsRef.current = childrenArray?.length\n\n return childrenArray\n}\n\nfunction PrerenderFieldPropsOfOtherSteps({\n prerenderFieldPropsRef,\n}: {\n prerenderFieldPropsRef: WizardContextState['prerenderFieldPropsRef']\n}) {\n const hasRenderedRef = useRef(true)\n if (!hasRenderedRef.current) {\n return null\n }\n hasRenderedRef.current = false\n\n return (\n <WizardPortal>\n <PrerenderFieldPropsProvider>\n <iframe title=\"Wizard Prerender\" hidden>\n {Object.values(prerenderFieldPropsRef.current).map((Fn, i) => (\n <Fn key={i} />\n ))}\n </iframe>\n </PrerenderFieldPropsProvider>\n </WizardPortal>\n )\n}\n\nfunction WizardPortal({ children }) {\n if (typeof document !== 'undefined') {\n return ReactDOM.createPortal(children, document.body)\n }\n}\n\nfunction PrerenderFieldPropsProvider({ children }) {\n const { data, setFieldInternals, updateDataValue } =\n useContext(DataContext)\n\n return (\n <DataContext.Provider\n value={{\n ...defaultContextState,\n\n // Only update the props and the data value\n data,\n setFieldInternals,\n updateDataValue,\n prerenderFieldProps: true,\n hasContext: true,\n }}\n >\n <WizardContext.Provider value={{ prerenderFieldProps: true }}>\n {children}\n </WizardContext.Provider>\n </DataContext.Provider>\n )\n}\n\nWizardContainer._supportsSpacingProps = true\n\nexport default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CAAA2H,aAAA,CAACoC,2BAA2B,QAC1B/J,KAAA,CAAA2H,aAAA;IAAQa,KAAK,EAAC,kBAAkB;IAACwB,MAAM;EAAA,GACpClF,MAAM,CAACwD,MAAM,CAACtE,sBAAsB,CAACE,OAAO,CAAC,CAACqE,GAAG,CAAC,CAAC0B,EAAE,EAAEC,CAAC,KACvDlK,KAAA,CAAA2H,aAAA,CAACsC,EAAE;IAACR,GAAG,EAAES;EAAE,CAAE,CACd,CACK,CACmB,CACjB,CAAC;AAEnB;AAEA,SAASJ,YAAYA,CAAC;EAAExH;AAAS,CAAC,EAAE;EAClC,IAAI,OAAOsH,QAAQ,KAAK,WAAW,EAAE;IACnC,OAAOtJ,QAAQ,CAAC6J,YAAY,CAAC7H,QAAQ,EAAEsH,QAAQ,CAACQ,IAAI,CAAC;EACvD;AACF;AAEA,SAASL,2BAA2BA,CAAC;EAAEzH;AAAS,CAAC,EAAE;EACjD,MAAM;IAAE2D,IAAI;IAAEoE,iBAAiB;IAAEC;EAAgB,CAAC,GAChDrK,UAAU,CAACe,WAAW,CAAC;EAEzB,OACEhB,KAAA,CAAA2H,aAAA,CAAC3G,WAAW,CAAC6G,QAAQ;IACnBC,KAAK,EAAAxB,aAAA,CAAAA,aAAA,KACArF,mBAAmB;MAGtBgF,IAAI;MACJoE,iBAAiB;MACjBC,eAAe;MACf9H,mBAAmB,EAAE,IAAI;MACzBO,UAAU,EAAE;IAAI;EAChB,GAEF/C,KAAA,CAAA2H,aAAA,CAAC5G,aAAa,CAAC8G,QAAQ;IAACC,KAAK,EAAE;MAAEtF,mBAAmB,EAAE;IAAK;EAAE,GAC1DF,QACqB,CACJ,CAAC;AAE3B;AAEAX,eAAe,CAAC4I,qBAAqB,GAAG,IAAI;AAE5C,eAAe5I,eAAe"}
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- export default function useHandleLayoutEffect({ stepElementRef }: {
2
+ export default function useHandleLayoutEffect({ elementRef, stepElementRef, }: {
3
+ elementRef: any;
3
4
  stepElementRef: any;
4
5
  }): {
5
6
  setFocus: () => void;
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { useCallback, useEffect, useRef } from 'react';
4
4
  export default function useHandleLayoutEffect({
5
+ elementRef,
5
6
  stepElementRef
6
7
  }) {
7
8
  const isInteractionRef = useRef(false);
@@ -27,10 +28,10 @@ export default function useHandleLayoutEffect({
27
28
  }, [action, stepElementRef]);
28
29
  const scrollToTop = useCallback(() => {
29
30
  action(() => {
30
- var _stepElementRef$curre3, _stepElementRef$curre4;
31
- (_stepElementRef$curre3 = stepElementRef.current) === null || _stepElementRef$curre3 === void 0 ? void 0 : (_stepElementRef$curre4 = _stepElementRef$curre3.scrollIntoView) === null || _stepElementRef$curre4 === void 0 ? void 0 : _stepElementRef$curre4.call(_stepElementRef$curre3);
31
+ var _elementRef$current, _elementRef$current$s;
32
+ (_elementRef$current = elementRef.current) === null || _elementRef$current === void 0 ? void 0 : (_elementRef$current$s = _elementRef$current.scrollIntoView) === null || _elementRef$current$s === void 0 ? void 0 : _elementRef$current$s.call(_elementRef$current);
32
33
  });
33
- }, [action, stepElementRef]);
34
+ }, [action, elementRef]);
34
35
  return {
35
36
  setFocus,
36
37
  scrollToTop,
@@ -1 +1 @@
1
- {"version":3,"file":"useHandleLayoutEffect.js","names":["useCallback","useEffect","useRef","useHandleLayoutEffect","stepElementRef","isInteractionRef","delay","process","env","NODE_ENV","timeout","setTimeout","current","clearTimeout","action","fn","window","requestAnimationFrame","setFocus","_stepElementRef$curre","_stepElementRef$curre2","focus","call","preventScroll","scrollToTop","_stepElementRef$curre3","_stepElementRef$curre4","scrollIntoView"],"sources":["../../../../../../src/extensions/forms/Wizard/Container/useHandleLayoutEffect.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport default function useHandleLayoutEffect({ stepElementRef }) {\n const isInteractionRef = useRef(false)\n\n useEffect(() => {\n // Ensure we delay the mounting before layout effect is handled\n const delay = process.env.NODE_ENV === 'test' ? 8 : 100\n const timeout = setTimeout(() => {\n isInteractionRef.current = true\n }, delay)\n return () => clearTimeout(timeout)\n })\n\n const action = useCallback((fn: () => void) => {\n // Wait for the next render cycle\n window.requestAnimationFrame(() =>\n // Wait for the new stepElementRef to be set\n window.requestAnimationFrame(() => {\n isInteractionRef.current && fn()\n })\n )\n }, [])\n\n const setFocus = useCallback(() => {\n action(() => {\n stepElementRef.current?.focus?.({\n preventScroll: true,\n })\n })\n }, [action, stepElementRef])\n\n const scrollToTop = useCallback(() => {\n action(() => {\n stepElementRef.current?.scrollIntoView?.()\n })\n }, [action, stepElementRef])\n\n return { setFocus, scrollToTop, isInteractionRef }\n}\n"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEtD,eAAe,SAASC,qBAAqBA,CAAC;EAAEC;AAAe,CAAC,EAAE;EAChE,MAAMC,gBAAgB,GAAGH,MAAM,CAAC,KAAK,CAAC;EAEtCD,SAAS,CAAC,MAAM;IAEd,MAAMK,KAAK,GAAGC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,MAAM,GAAG,CAAC,GAAG,GAAG;IACvD,MAAMC,OAAO,GAAGC,UAAU,CAAC,MAAM;MAC/BN,gBAAgB,CAACO,OAAO,GAAG,IAAI;IACjC,CAAC,EAAEN,KAAK,CAAC;IACT,OAAO,MAAMO,YAAY,CAACH,OAAO,CAAC;EACpC,CAAC,CAAC;EAEF,MAAMI,MAAM,GAAGd,WAAW,CAAEe,EAAc,IAAK;IAE7CC,MAAM,CAACC,qBAAqB,CAAC,MAE3BD,MAAM,CAACC,qBAAqB,CAAC,MAAM;MACjCZ,gBAAgB,CAACO,OAAO,IAAIG,EAAE,CAAC,CAAC;IAClC,CAAC,CACH,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMG,QAAQ,GAAGlB,WAAW,CAAC,MAAM;IACjCc,MAAM,CAAC,MAAM;MAAA,IAAAK,qBAAA,EAAAC,sBAAA;MACX,CAAAD,qBAAA,GAAAf,cAAc,CAACQ,OAAO,cAAAO,qBAAA,wBAAAC,sBAAA,GAAtBD,qBAAA,CAAwBE,KAAK,cAAAD,sBAAA,uBAA7BA,sBAAA,CAAAE,IAAA,CAAAH,qBAAA,EAAgC;QAC9BI,aAAa,EAAE;MACjB,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,EAAE,CAACT,MAAM,EAAEV,cAAc,CAAC,CAAC;EAE5B,MAAMoB,WAAW,GAAGxB,WAAW,CAAC,MAAM;IACpCc,MAAM,CAAC,MAAM;MAAA,IAAAW,sBAAA,EAAAC,sBAAA;MACX,CAAAD,sBAAA,GAAArB,cAAc,CAACQ,OAAO,cAAAa,sBAAA,wBAAAC,sBAAA,GAAtBD,sBAAA,CAAwBE,cAAc,cAAAD,sBAAA,uBAAtCA,sBAAA,CAAAJ,IAAA,CAAAG,sBAAyC,CAAC;IAC5C,CAAC,CAAC;EACJ,CAAC,EAAE,CAACX,MAAM,EAAEV,cAAc,CAAC,CAAC;EAE5B,OAAO;IAAEc,QAAQ;IAAEM,WAAW;IAAEnB;EAAiB,CAAC;AACpD"}
1
+ {"version":3,"file":"useHandleLayoutEffect.js","names":["useCallback","useEffect","useRef","useHandleLayoutEffect","elementRef","stepElementRef","isInteractionRef","delay","process","env","NODE_ENV","timeout","setTimeout","current","clearTimeout","action","fn","window","requestAnimationFrame","setFocus","_stepElementRef$curre","_stepElementRef$curre2","focus","call","preventScroll","scrollToTop","_elementRef$current","_elementRef$current$s","scrollIntoView"],"sources":["../../../../../../src/extensions/forms/Wizard/Container/useHandleLayoutEffect.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react'\n\nexport default function useHandleLayoutEffect({\n elementRef,\n stepElementRef,\n}) {\n const isInteractionRef = useRef(false)\n\n useEffect(() => {\n // Ensure we delay the mounting before layout effect is handled\n const delay = process.env.NODE_ENV === 'test' ? 8 : 100\n const timeout = setTimeout(() => {\n isInteractionRef.current = true\n }, delay)\n return () => clearTimeout(timeout)\n })\n\n const action = useCallback((fn: () => void) => {\n // Wait for the next render cycle\n window.requestAnimationFrame(() =>\n // Wait for the new stepElementRef to be set\n window.requestAnimationFrame(() => {\n isInteractionRef.current && fn()\n })\n )\n }, [])\n\n const setFocus = useCallback(() => {\n action(() => {\n stepElementRef.current?.focus?.({\n preventScroll: true,\n })\n })\n }, [action, stepElementRef])\n\n const scrollToTop = useCallback(() => {\n action(() => {\n elementRef.current?.scrollIntoView?.()\n })\n }, [action, elementRef])\n\n return { setFocus, scrollToTop, isInteractionRef }\n}\n"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEtD,eAAe,SAASC,qBAAqBA,CAAC;EAC5CC,UAAU;EACVC;AACF,CAAC,EAAE;EACD,MAAMC,gBAAgB,GAAGJ,MAAM,CAAC,KAAK,CAAC;EAEtCD,SAAS,CAAC,MAAM;IAEd,MAAMM,KAAK,GAAGC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,MAAM,GAAG,CAAC,GAAG,GAAG;IACvD,MAAMC,OAAO,GAAGC,UAAU,CAAC,MAAM;MAC/BN,gBAAgB,CAACO,OAAO,GAAG,IAAI;IACjC,CAAC,EAAEN,KAAK,CAAC;IACT,OAAO,MAAMO,YAAY,CAACH,OAAO,CAAC;EACpC,CAAC,CAAC;EAEF,MAAMI,MAAM,GAAGf,WAAW,CAAEgB,EAAc,IAAK;IAE7CC,MAAM,CAACC,qBAAqB,CAAC,MAE3BD,MAAM,CAACC,qBAAqB,CAAC,MAAM;MACjCZ,gBAAgB,CAACO,OAAO,IAAIG,EAAE,CAAC,CAAC;IAClC,CAAC,CACH,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMG,QAAQ,GAAGnB,WAAW,CAAC,MAAM;IACjCe,MAAM,CAAC,MAAM;MAAA,IAAAK,qBAAA,EAAAC,sBAAA;MACX,CAAAD,qBAAA,GAAAf,cAAc,CAACQ,OAAO,cAAAO,qBAAA,wBAAAC,sBAAA,GAAtBD,qBAAA,CAAwBE,KAAK,cAAAD,sBAAA,uBAA7BA,sBAAA,CAAAE,IAAA,CAAAH,qBAAA,EAAgC;QAC9BI,aAAa,EAAE;MACjB,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,EAAE,CAACT,MAAM,EAAEV,cAAc,CAAC,CAAC;EAE5B,MAAMoB,WAAW,GAAGzB,WAAW,CAAC,MAAM;IACpCe,MAAM,CAAC,MAAM;MAAA,IAAAW,mBAAA,EAAAC,qBAAA;MACX,CAAAD,mBAAA,GAAAtB,UAAU,CAACS,OAAO,cAAAa,mBAAA,wBAAAC,qBAAA,GAAlBD,mBAAA,CAAoBE,cAAc,cAAAD,qBAAA,uBAAlCA,qBAAA,CAAAJ,IAAA,CAAAG,mBAAqC,CAAC;IACxC,CAAC,CAAC;EACJ,CAAC,EAAE,CAACX,MAAM,EAAEX,UAAU,CAAC,CAAC;EAExB,OAAO;IAAEe,QAAQ;IAAEM,WAAW;IAAEnB;EAAiB,CAAC;AACpD"}
@@ -15,18 +15,18 @@ export const DataValueWritePropsProperties = {
15
15
  status: 'optional'
16
16
  },
17
17
  info: {
18
- doc: 'Info message shown below / after the field.',
19
- type: ['React.Node', 'Array<React.Node>'],
18
+ doc: "Info message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with `{ conditionally, getValueByPath, getFieldByPath }`. To show the message first after the user has interacted with the field, you can call and return `conditionally` function with a callback and with options: `conditionally(() => 'Your message', { showInitially: true })`",
19
+ type: ['React.Node', 'Array<React.Node>', 'function'],
20
20
  status: 'optional'
21
21
  },
22
22
  warning: {
23
- doc: 'Warning message shown below / after the field.',
24
- type: ['React.Node', 'Array<React.Node>'],
23
+ doc: "Warning message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with `{ conditionally, getValueByPath, getFieldByPath }`. To show the message first after the user has interacted with the field, you can call and return `conditionally` function with a callback and with options: `conditionally(() => 'Your message', { showInitially: true })`",
24
+ type: ['React.Node', 'Array<React.Node>', 'function'],
25
25
  status: 'optional'
26
26
  },
27
27
  error: {
28
- doc: 'Error message shown below / after the field.',
29
- type: ['Error', 'FormError', 'Array<Error | FormError>'],
28
+ doc: "Error message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with `{ conditionally, getValueByPath, getFieldByPath }`. To show the message first after the user has interacted with the field, you can call and return `conditionally` function with a callback and with options: `conditionally(() => 'Your message', { showInitially: true })`",
29
+ type: ['Error', 'FormError', 'Array<Error | FormError>', 'function'],
30
30
  status: 'optional'
31
31
  },
32
32
  disabled: {
@@ -64,7 +64,7 @@ export const DataValueWritePropsProperties = {
64
64
  type: 'boolean',
65
65
  status: 'optional'
66
66
  },
67
- continuousValidation: {
67
+ validateContinuously: {
68
68
  doc: 'Set to `true` to show validation based errors continuously while writing, not just when blurring the field.',
69
69
  type: 'boolean',
70
70
  status: 'optional'
@@ -75,12 +75,12 @@ export const DataValueWritePropsProperties = {
75
75
  status: 'optional'
76
76
  },
77
77
  onChangeValidator: {
78
- doc: 'Custom validator function that is triggered on every change done by the user. The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.',
78
+ doc: 'Custom validator function where you can return `undefined`, `Error`, `FormError` or an Array with either several other validators or several `Error` or `FormError`. It is triggered on every change done by the user. The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.',
79
79
  type: 'function',
80
80
  status: 'optional'
81
81
  },
82
82
  onBlurValidator: {
83
- doc: 'Custom validator function that is triggered when the user leaves a field (e.g., blurring a text input or closing a dropdown). The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.',
83
+ doc: 'Custom validator function where you can return `undefined`, `Error`, `FormError` or an Array with either several other validators or several `Error` or `FormError`. It is triggered when the user leaves a field (e.g., blurring a text input or closing a dropdown). The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.',
84
84
  type: 'function',
85
85
  status: 'optional'
86
86
  },
@@ -1 +1 @@
1
- {"version":3,"file":"DataValueWritePropsDocs.js","names":["DataValueWritePropsProperties","value","doc","type","status","defaultValue","path","info","warning","error","disabled","emptyValue","required","labelSuffix","schema","validateInitially","validateUnchanged","continuousValidation","errorMessages","onChangeValidator","onBlurValidator","transformIn","transformOut","DataValueWritePropsEvents","onChange","onFocus","onBlur"],"sources":["../../../../../src/extensions/forms/hooks/DataValueWritePropsDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../../shared/types'\n\nexport const DataValueWritePropsProperties: PropertiesTableProps = {\n value: {\n doc: 'Source data value for the field. Will take precedence over the path value given in the data context.',\n type: '{valueType}',\n status: 'optional',\n },\n defaultValue: {\n doc: 'Default source data value for the field. Will not take precedence over the path value given in the data context.',\n type: '{valueType}',\n status: 'optional',\n },\n path: {\n doc: 'JSON Pointer for where the data for the field is located in the source dataset (when using Form.Handler or DataContext). The `path` will also be set as the `name` attribute for the [string](/uilib/extensions/forms/base-fields/String/)-field.',\n type: 'string',\n status: 'optional',\n },\n info: {\n doc: 'Info message shown below / after the field.',\n type: ['React.Node', 'Array<React.Node>'],\n status: 'optional',\n },\n warning: {\n doc: 'Warning message shown below / after the field.',\n type: ['React.Node', 'Array<React.Node>'],\n status: 'optional',\n },\n error: {\n doc: 'Error message shown below / after the field.',\n type: ['Error', 'FormError', 'Array<Error | FormError>'],\n status: 'optional',\n },\n disabled: {\n doc: 'Set `true` to show the field but without the possibility of changing the value.',\n type: 'boolean',\n status: 'optional',\n },\n emptyValue: {\n doc: 'The value to use (in `onChange` events etc) when emptying the field. Makes it possible for instance to provide `undefined` instead of an empty string when clearing the content of a text input.',\n type: ['{valueType}', 'undefined'],\n status: 'optional',\n },\n required: {\n doc: 'When set to `true`, the field will give an error if the value fails the required validation. When set to `false`, the field will not be required, but will add a \"(optional)\" suffix to the label.',\n type: 'boolean',\n status: 'optional',\n },\n labelSuffix: {\n doc: 'Will append an additional text to the label, like \"(optional)\". When using `inheritLabel`, the suffix will not be inherited. NB: The visual appearance of the `labelSuffix` may change in the future.',\n type: 'React.Node',\n status: 'optional',\n },\n schema: {\n doc: 'Custom JSON Schema for validating the value.',\n type: 'object',\n status: 'optional',\n },\n validateInitially: {\n doc: 'Set to `true` to show validation based errors initially (from given value-prop or source data) before the user interacts with the field.',\n type: 'boolean',\n status: 'optional',\n },\n validateUnchanged: {\n doc: 'Set to `true` to show validation based errors when the field is touched (like focusing a field and blurring) without having changed the value. Since the user did not introduce a new error, this will apply when the value was initially invalid based on validation.',\n type: 'boolean',\n status: 'optional',\n },\n continuousValidation: {\n doc: 'Set to `true` to show validation based errors continuously while writing, not just when blurring the field.',\n type: 'boolean',\n status: 'optional',\n },\n errorMessages: {\n doc: 'Custom error messages for each type of error, overriding default messages.',\n type: 'object',\n status: 'optional',\n },\n onChangeValidator: {\n doc: 'Custom validator function that is triggered on every change done by the user. The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.',\n type: 'function',\n status: 'optional',\n },\n onBlurValidator: {\n doc: 'Custom validator function that is triggered when the user leaves a field (e.g., blurring a text input or closing a dropdown). The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.',\n type: 'function',\n status: 'optional',\n },\n transformIn: {\n doc: 'Transforms the `value` before its displayed in the field (e.g. input).',\n type: 'function',\n status: 'optional',\n },\n transformOut: {\n doc: 'Transforms the value before it gets forwarded to the form data object (context) or returned as the `onChange` value parameter. The first parameter is the internal value. Some fields to support a second parameter, like the SelectCountry, where the country object is given.',\n type: 'function',\n status: 'optional',\n },\n}\n\nexport const DataValueWritePropsEvents: PropertiesTableProps = {\n onChange: {\n doc: \"Will be called on value changes made by the user, with the new value as argument. When an `async` function is used, the corresponding [FieldBlock](/uilib/extensions/forms/create-component/FieldBlock/) will show an indicator on the field label. You can return `{ success: 'saved' } as const` to show a success symbol, or an error or an object with these keys `{ info: 'Info message', warning: 'Warning message', error: Error('My error') } as const`.\",\n type: '(value) => void',\n status: 'optional',\n },\n onFocus: {\n doc: 'Will be called when the component gets into focus. Like clicking inside a text input or opening a dropdown. Called with active value as argument.',\n type: '(value) => void',\n status: 'optional',\n },\n onBlur: {\n doc: 'Will be called when the component stop being in focus. Like when going to next field, or closing a dropdown. Called with active value as argument.',\n type: '(value) => void',\n status: 'optional',\n },\n}\n"],"mappings":"AAEA,OAAO,MAAMA,6BAAmD,GAAG;EACjEC,KAAK,EAAE;IACLC,GAAG,EAAE,sGAAsG;IAC3GC,IAAI,EAAE,aAAa;IACnBC,MAAM,EAAE;EACV,CAAC;EACDC,YAAY,EAAE;IACZH,GAAG,EAAE,kHAAkH;IACvHC,IAAI,EAAE,aAAa;IACnBC,MAAM,EAAE;EACV,CAAC;EACDE,IAAI,EAAE;IACJJ,GAAG,EAAE,mPAAmP;IACxPC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDG,IAAI,EAAE;IACJL,GAAG,EAAE,6CAA6C;IAClDC,IAAI,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;IACzCC,MAAM,EAAE;EACV,CAAC;EACDI,OAAO,EAAE;IACPN,GAAG,EAAE,gDAAgD;IACrDC,IAAI,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;IACzCC,MAAM,EAAE;EACV,CAAC;EACDK,KAAK,EAAE;IACLP,GAAG,EAAE,8CAA8C;IACnDC,IAAI,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,0BAA0B,CAAC;IACxDC,MAAM,EAAE;EACV,CAAC;EACDM,QAAQ,EAAE;IACRR,GAAG,EAAE,iFAAiF;IACtFC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDO,UAAU,EAAE;IACVT,GAAG,EAAE,kMAAkM;IACvMC,IAAI,EAAE,CAAC,aAAa,EAAE,WAAW,C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AG,EAAE,kcAAkc;IACvcC,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE;EACV,CAAC;EACDqB,OAAO,EAAE;IACPvB,GAAG,EAAE,mJAAmJ;IACxJC,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE;EACV,CAAC;EACDsB,MAAM,EAAE;IACNxB,GAAG,EAAE,oJAAoJ;IACzJC,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE;EACV;AACF,CAAC"}
1
+ {"version":3,"file":"DataValueWritePropsDocs.js","names":["DataValueWritePropsProperties","value","doc","type","status","defaultValue","path","info","warning","error","disabled","emptyValue","required","labelSuffix","schema","validateInitially","validateUnchanged","validateContinuously","errorMessages","onChangeValidator","onBlurValidator","transformIn","transformOut","DataValueWritePropsEvents","onChange","onFocus","onBlur"],"sources":["../../../../../src/extensions/forms/hooks/DataValueWritePropsDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../../shared/types'\n\nexport const DataValueWritePropsProperties: PropertiesTableProps = {\n value: {\n doc: 'Source data value for the field. Will take precedence over the path value given in the data context.',\n type: '{valueType}',\n status: 'optional',\n },\n defaultValue: {\n doc: 'Default source data value for the field. Will not take precedence over the path value given in the data context.',\n type: '{valueType}',\n status: 'optional',\n },\n path: {\n doc: 'JSON Pointer for where the data for the field is located in the source dataset (when using Form.Handler or DataContext). The `path` will also be set as the `name` attribute for the [string](/uilib/extensions/forms/base-fields/String/)-field.',\n type: 'string',\n status: 'optional',\n },\n info: {\n doc: \"Info message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with `{ conditionally, getValueByPath, getFieldByPath }`. To show the message first after the user has interacted with the field, you can call and return `conditionally` function with a callback and with options: `conditionally(() => 'Your message', { showInitially: true })`\",\n type: ['React.Node', 'Array<React.Node>', 'function'],\n status: 'optional',\n },\n warning: {\n doc: \"Warning message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with `{ conditionally, getValueByPath, getFieldByPath }`. To show the message first after the user has interacted with the field, you can call and return `conditionally` function with a callback and with options: `conditionally(() => 'Your message', { showInitially: true })`\",\n type: ['React.Node', 'Array<React.Node>', 'function'],\n status: 'optional',\n },\n error: {\n doc: \"Error message shown below / after the field. When provided as a function, the function will be called with the current value as argument. The second parameter is an object with `{ conditionally, getValueByPath, getFieldByPath }`. To show the message first after the user has interacted with the field, you can call and return `conditionally` function with a callback and with options: `conditionally(() => 'Your message', { showInitially: true })`\",\n type: ['Error', 'FormError', 'Array<Error | FormError>', 'function'],\n status: 'optional',\n },\n disabled: {\n doc: 'Set `true` to show the field but without the possibility of changing the value.',\n type: 'boolean',\n status: 'optional',\n },\n emptyValue: {\n doc: 'The value to use (in `onChange` events etc) when emptying the field. Makes it possible for instance to provide `undefined` instead of an empty string when clearing the content of a text input.',\n type: ['{valueType}', 'undefined'],\n status: 'optional',\n },\n required: {\n doc: 'When set to `true`, the field will give an error if the value fails the required validation. When set to `false`, the field will not be required, but will add a \"(optional)\" suffix to the label.',\n type: 'boolean',\n status: 'optional',\n },\n labelSuffix: {\n doc: 'Will append an additional text to the label, like \"(optional)\". When using `inheritLabel`, the suffix will not be inherited. NB: The visual appearance of the `labelSuffix` may change in the future.',\n type: 'React.Node',\n status: 'optional',\n },\n schema: {\n doc: 'Custom JSON Schema for validating the value.',\n type: 'object',\n status: 'optional',\n },\n validateInitially: {\n doc: 'Set to `true` to show validation based errors initially (from given value-prop or source data) before the user interacts with the field.',\n type: 'boolean',\n status: 'optional',\n },\n validateUnchanged: {\n doc: 'Set to `true` to show validation based errors when the field is touched (like focusing a field and blurring) without having changed the value. Since the user did not introduce a new error, this will apply when the value was initially invalid based on validation.',\n type: 'boolean',\n status: 'optional',\n },\n validateContinuously: {\n doc: 'Set to `true` to show validation based errors continuously while writing, not just when blurring the field.',\n type: 'boolean',\n status: 'optional',\n },\n errorMessages: {\n doc: 'Custom error messages for each type of error, overriding default messages.',\n type: 'object',\n status: 'optional',\n },\n onChangeValidator: {\n doc: 'Custom validator function where you can return `undefined`, `Error`, `FormError` or an Array with either several other validators or several `Error` or `FormError`. It is triggered on every change done by the user. The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.',\n type: 'function',\n status: 'optional',\n },\n onBlurValidator: {\n doc: 'Custom validator function where you can return `undefined`, `Error`, `FormError` or an Array with either several other validators or several `Error` or `FormError`. It is triggered when the user leaves a field (e.g., blurring a text input or closing a dropdown). The function can be either asynchronous or synchronous. The first parameter is the value, and the second parameter returns an object containing { errorMessages, connectWithPath, validators }.',\n type: 'function',\n status: 'optional',\n },\n transformIn: {\n doc: 'Transforms the `value` before its displayed in the field (e.g. input).',\n type: 'function',\n status: 'optional',\n },\n transformOut: {\n doc: 'Transforms the value before it gets forwarded to the form data object (context) or returned as the `onChange` value parameter. The first parameter is the internal value. Some fields to support a second parameter, like the SelectCountry, where the country object is given.',\n type: 'function',\n status: 'optional',\n },\n}\n\nexport const DataValueWritePropsEvents: PropertiesTableProps = {\n onChange: {\n doc: \"Will be called on value changes made by the user, with the new value as argument. When an `async` function is used, the corresponding [FieldBlock](/uilib/extensions/forms/create-component/FieldBlock/) will show an indicator on the field label. You can return `{ success: 'saved' } as const` to show a success symbol, or an error or an object with these keys `{ info: 'Info message', warning: 'Warning message', error: Error('My error') } as const`.\",\n type: '(value) => void',\n status: 'optional',\n },\n onFocus: {\n doc: 'Will be called when the component gets into focus. Like clicking inside a text input or opening a dropdown. Called with active value as argument.',\n type: '(value) => void',\n status: 'optional',\n },\n onBlur: {\n doc: 'Will be called when the component stop being in focus. Like when going to next field, or closing a dropdown. Called with active value as argument.',\n type: '(value) => void',\n status: 'optional',\n },\n}\n"],"mappings":"AAEA,OAAO,MAAMA,6BAAmD,GAAG;EACjEC,KAAK,EAAE;IACLC,GAAG,EAAE,sGAAsG;IAC3GC,IAAI,EAAE,aAAa;IACnBC,MAAM,EAAE;EACV,CAAC;EACDC,YAAY,EAAE;IACZH,GAAG,EAAE,kHAAkH;IACvHC,IA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AG,EAAE,wQAAwQ;IAC7QC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDa,oBAAoB,EAAE;IACpBf,GAAG,EAAE,6GAA6G;IAClHC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDc,aAAa,EAAE;IACbhB,GAAG,EAAE,4EAA4E;IACjFC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDe,iBAAiB,EAAE;IACjBjB,GAAG,EAAE,wZAAwZ;IAC7ZC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDgB,eAAe,EAAE;IACflB,GAAG,EAAE,wcAAwc;IAC7cC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDiB,WAAW,EAAE;IACXnB,GAAG,EAAE,wEAAwE;IAC7EC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDkB,YAAY,EAAE;IACZpB,GAAG,EAAE,iRAAiR;IACtRC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AACF,CAAC;AAED,OAAO,MAAMmB,yBAA+C,GAAG;EAC7DC,QAAQ,EAAE;IACRtB,GAAG,EAAE,kcAAkc;IACvcC,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE;EACV,CAAC;EACDqB,OAAO,EAAE;IACPvB,GAAG,EAAE,mJAAmJ;IACxJC,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE;EACV,CAAC;EACDsB,MAAM,EAAE;IACNxB,GAAG,EAAE,oJAAoJ;IACzJC,IAAI,EAAE,iBAAiB;IACvBC,MAAM,EAAE;EACV;AACF,CAAC"}
@@ -4,11 +4,11 @@ export type Props<Value> = {
4
4
  value?: Value;
5
5
  };
6
6
  export type GetValueByPath<Value = unknown> = <T = Value>(path: Path) => T;
7
- export default function useDataValue<Value>({ path: pathProp, value, }?: Props<Value>): {
7
+ export default function useDataValue<Value>(pathProp?: Path | undefined, value?: Value): {
8
8
  getSourceValue: (source: Path | Value) => any;
9
9
  getValueByPath: (path: Path) => any;
10
10
  getValueByIteratePath: (path: Path) => any;
11
- moveValueToPath: <T>(path: Path, value: T) => T;
11
+ moveValueToPath: <T>(path: Path, value: T, object?: {}) => T;
12
12
  getData: (path: Path, options?: {
13
13
  includeCurrentPath?: boolean;
14
14
  }) => any;
@@ -5,10 +5,7 @@ import pointer from '../utils/json-pointer';
5
5
  import DataContext from '../DataContext/Context';
6
6
  import IterateItemContext from '../Iterate/IterateItemContext';
7
7
  import usePath from './usePath';
8
- export default function useDataValue({
9
- path: pathProp,
10
- value
11
- } = {}) {
8
+ export default function useDataValue(pathProp, value) {
12
9
  const dataContextRef = useRef();
13
10
  dataContextRef.current = useContext(DataContext);
14
11
  const iterateItemContext = useContext(IterateItemContext);
@@ -34,11 +31,10 @@ export default function useDataValue({
34
31
  return get(makeIteratePath(path));
35
32
  }
36
33
  }, [get, makeIteratePath]);
37
- const moveValueToPath = useCallback((path, value) => {
34
+ const moveValueToPath = useCallback((path, value, object = {}) => {
38
35
  if (path !== '/' && isPath(path)) {
39
- const obj = {};
40
- pointer.set(obj, path, value);
41
- return obj;
36
+ pointer.set(object, path, value);
37
+ return object;
42
38
  }
43
39
  return value;
44
40
  }, []);
@@ -1 +1 @@
1
- {"version":3,"file":"useDataValue.js","names":["useCallback","useContext","useRef","pointer","DataContext","IterateItemContext","usePath","useDataValue","path","pathProp","value","dataContextRef","current","iterateItemContext","makePath","makeIteratePath","get","selector","_dataContextRef$curre","_dataContextRef$curre2","data","internalDataRef","has","undefined","getValueByPath","isPath","getValueByIteratePath","moveValueToPath","obj","set","getData","options","includeCurrentPath","getSourceValue","source","startsWith"],"sources":["../../../../../src/extensions/forms/hooks/useDataValue.ts"],"sourcesContent":["import { useCallback, useContext, useRef } from 'react'\nimport pointer from '../utils/json-pointer'\nimport { Path } from '../types'\nimport DataContext, { ContextState } from '../DataContext/Context'\nimport IterateItemContext from '../Iterate/IterateItemContext'\nimport usePath from './usePath'\n\nexport type Props<Value> = {\n path?: Path | undefined\n value?: Value\n}\n\nexport type GetValueByPath<Value = unknown> = <T = Value>(path: Path) => T\n\nexport default function useDataValue<Value>({\n path: pathProp,\n value,\n}: Props<Value> = {}) {\n const dataContextRef = useRef<ContextState>()\n dataContextRef.current = useContext(DataContext)\n const iterateItemContext = useContext(IterateItemContext)\n\n const { makePath, makeIteratePath } = usePath()\n\n const get = useCallback((selector: Path) => {\n const data = dataContextRef.current?.internalDataRef?.current\n if (selector === '/') {\n return data\n }\n return pointer.has(data, selector)\n ? pointer.get(data, selector)\n : undefined\n }, [])\n\n const getValueByPath = useCallback(\n (path: Path) => {\n if (isPath(path)) {\n return get(makePath(path))\n }\n },\n [get, makePath]\n )\n\n const getValueByIteratePath = useCallback(\n (path: Path) => {\n if (isPath(path)) {\n return get(makeIteratePath(path))\n }\n },\n [get, makeIteratePath]\n )\n\n const moveValueToPath = useCallback(<T>(path: Path, value: T): T => {\n if (path !== '/' && isPath(path)) {\n const obj = {}\n pointer.set(obj, path, value)\n return obj as T\n }\n\n return value\n }, [])\n\n const getData = useCallback(\n (path: Path, options?: { includeCurrentPath?: boolean }) => {\n if (isPath(path)) {\n const value = getValueByPath(path)\n\n if (options?.includeCurrentPath && path !== '/') {\n return moveValueToPath(path, value)\n }\n\n return value\n }\n },\n [getValueByPath, moveValueToPath]\n )\n\n const getSourceValue = useCallback(\n (source: Path | Value) => {\n if (typeof source === 'string' && isPath(source)) {\n if (iterateItemContext) {\n return getValueByIteratePath(source)\n }\n\n return getValueByPath(source)\n }\n\n return source\n },\n [getValueByIteratePath, getValueByPath, iterateItemContext]\n )\n\n if (pathProp) {\n value = getSourceValue(pathProp)\n }\n\n return {\n getSourceValue,\n getValueByPath,\n getValueByIteratePath,\n moveValueToPath,\n getData,\n value,\n }\n}\n\nfunction isPath(path: Path | unknown) {\n return typeof path === 'string' && path.startsWith('/')\n}\n"],"mappings":";;AAAA,SAASA,WAAW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AACR,qBAAqB,EAAEF,cAAc,EAAEX,kBAAkB,CAC5D,CAAC;EAED,IAAIJ,QAAQ,EAAE;IACZC,KAAK,GAAGuB,cAAc,CAACxB,QAAQ,CAAC;EAClC;EAEA,OAAO;IACLwB,cAAc;IACdT,cAAc;IACdE,qBAAqB;IACrBC,eAAe;IACfG,OAAO;IACPpB;EACF,CAAC;AACH;AAEA,SAASe,MAAMA,CAACjB,IAAoB,EAAE;EACpC,OAAO,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,CAAC2B,UAAU,CAAC,GAAG,CAAC;AACzD"}
1
+ {"version":3,"file":"useDataValue.js","names":["useCallback","useContext","useRef","pointer","DataContext","IterateItemContext","usePath","useDataValue","pathProp","value","dataContextRef","current","iterateItemContext","makePath","makeIteratePath","get","selector","_dataContextRef$curre","_dataContextRef$curre2","data","internalDataRef","has","undefined","getValueByPath","path","isPath","getValueByIteratePath","moveValueToPath","object","set","getData","options","includeCurrentPath","getSourceValue","source","startsWith"],"sources":["../../../../../src/extensions/forms/hooks/useDataValue.ts"],"sourcesContent":["import { useCallback, useContext, useRef } from 'react'\nimport pointer from '../utils/json-pointer'\nimport { Path } from '../types'\nimport DataContext, { ContextState } from '../DataContext/Context'\nimport IterateItemContext from '../Iterate/IterateItemContext'\nimport usePath from './usePath'\n\nexport type Props<Value> = {\n path?: Path | undefined\n value?: Value\n}\n\nexport type GetValueByPath<Value = unknown> = <T = Value>(path: Path) => T\n\nexport default function useDataValue<Value>(\n pathProp?: Path | undefined,\n value?: Value\n) {\n const dataContextRef = useRef<ContextState>()\n dataContextRef.current = useContext(DataContext)\n const iterateItemContext = useContext(IterateItemContext)\n\n const { makePath, makeIteratePath } = usePath()\n\n const get = useCallback((selector: Path) => {\n const data = dataContextRef.current?.internalDataRef?.current\n if (selector === '/') {\n return data\n }\n return pointer.has(data, selector)\n ? pointer.get(data, selector)\n : undefined\n }, [])\n\n const getValueByPath = useCallback(\n (path: Path) => {\n if (isPath(path)) {\n return get(makePath(path))\n }\n },\n [get, makePath]\n )\n\n const getValueByIteratePath = useCallback(\n (path: Path) => {\n if (isPath(path)) {\n return get(makeIteratePath(path))\n }\n },\n [get, makeIteratePath]\n )\n\n const moveValueToPath = useCallback(\n <T>(path: Path, value: T, object = {}): T => {\n if (path !== '/' && isPath(path)) {\n pointer.set(object, path, value)\n return object as T\n }\n\n return value\n },\n []\n )\n\n const getData = useCallback(\n (path: Path, options?: { includeCurrentPath?: boolean }) => {\n if (isPath(path)) {\n const value = getValueByPath(path)\n\n if (options?.includeCurrentPath && path !== '/') {\n return moveValueToPath(path, value)\n }\n\n return value\n }\n },\n [getValueByPath, moveValueToPath]\n )\n\n const getSourceValue = useCallback(\n (source: Path | Value) => {\n if (typeof source === 'string' && isPath(source)) {\n if (iterateItemContext) {\n return getValueByIteratePath(source)\n }\n\n return getValueByPath(source)\n }\n\n return source\n },\n [getValueByIteratePath, getValueByPath, iterateItemContext]\n )\n\n if (pathProp) {\n value = getSourceValue(pathProp)\n }\n\n return {\n getSourceValue,\n getValueByPath,\n getValueByIteratePath,\n moveValueToPath,\n getData,\n value,\n }\n}\n\nfunction isPath(path: Path | unknown) {\n return typeof path === 'string' && path.startsWith('/')\n}\n"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,UAAU,EAAEC,MAAM,QAAQ,OAAO;AACvD,OAAOC,OAAO,MAAM,uBAAuB;AAE3C,OAAOC,WAAW,MAAwB,wBAAwB;AAClE,OAAOC,kBAAkB,MAAM,+BAA+B;AAC9D,OAAOC,OAAO,MAAM,WAAW;AAS/B,eAAe,SAASC,YAAYA,CAClCC,QAA2B,EAC3BC,KAAa,EACb;EACA,MAAMC,cAAc,GAAGR,MAAM,CAAe,CAAC;EAC7CQ,cAAc,CAACC,OAAO,GAAGV,UAAU,CAACG,WAAW,CAAC;EAChD,MAAMQ,kBAAkB,GAAGX,UAAU,CAACI,kBAAkB,CAAC;EAEzD,MAAM;IAAEQ,QAAQ;IAAEC;EAAgB,CAAC,GAAGR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ACd,CAAC,EACD,EACF,CAAC;EAED,MAAMqB,OAAO,GAAG9B,WAAW,CACzB,CAACwB,IAAU,EAAEO,OAA0C,KAAK;IAC1D,IAAIN,MAAM,CAACD,IAAI,CAAC,EAAE;MAChB,MAAMf,KAAK,GAAGc,cAAc,CAACC,IAAI,CAAC;MAElC,IAAIO,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEC,kBAAkB,IAAIR,IAAI,KAAK,GAAG,EAAE;QAC/C,OAAOG,eAAe,CAACH,IAAI,EAAEf,KAAK,CAAC;MACrC;MAEA,OAAOA,KAAK;IACd;EACF,CAAC,EACD,CAACc,cAAc,EAAEI,eAAe,CAClC,CAAC;EAED,MAAMM,cAAc,GAAGjC,WAAW,CAC/BkC,MAAoB,IAAK;IACxB,IAAI,OAAOA,MAAM,KAAK,QAAQ,IAAIT,MAAM,CAACS,MAAM,CAAC,EAAE;MAChD,IAAItB,kBAAkB,EAAE;QACtB,OAAOc,qBAAqB,CAACQ,MAAM,CAAC;MACtC;MAEA,OAAOX,cAAc,CAACW,MAAM,CAAC;IAC/B;IAEA,OAAOA,MAAM;EACf,CAAC,EACD,CAACR,qBAAqB,EAAEH,cAAc,EAAEX,kBAAkB,CAC5D,CAAC;EAED,IAAIJ,QAAQ,EAAE;IACZC,KAAK,GAAGwB,cAAc,CAACzB,QAAQ,CAAC;EAClC;EAEA,OAAO;IACLyB,cAAc;IACdV,cAAc;IACdG,qBAAqB;IACrBC,eAAe;IACfG,OAAO;IACPrB;EACF,CAAC;AACH;AAEA,SAASgB,MAAMA,CAACD,IAAoB,EAAE;EACpC,OAAO,OAAOA,IAAI,KAAK,QAAQ,IAAIA,IAAI,CAACW,UAAU,CAAC,GAAG,CAAC;AACzD"}
@@ -3,7 +3,7 @@
3
3
  import { useContext, useMemo } from 'react';
4
4
  import pointer from '../utils/json-pointer';
5
5
  import DataContext from '../DataContext/Context';
6
- import IterateElementContext from '../Iterate/IterateItemContext';
6
+ import IterateItemContext from '../Iterate/IterateItemContext';
7
7
  export default function useExternalValue(props) {
8
8
  const {
9
9
  path,
@@ -15,7 +15,7 @@ export default function useExternalValue(props) {
15
15
  const {
16
16
  data
17
17
  } = useContext(DataContext) || {};
18
- const iterateItemContext = useContext(IterateElementContext);
18
+ const iterateItemContext = useContext(IterateItemContext);
19
19
  const inIterate = Boolean(iterateItemContext);
20
20
  const {
21
21
  value: iterateElementValue
@@ -1 +1 @@
1
- {"version":3,"file":"useExternalValue.js","names":["useContext","useMemo","pointer","DataContext","IterateElementContext","useExternalValue","props","path","itemPath","value","transformers","emptyValue","undefined","data","iterateItemContext","inIterate","Boolean","iterateElementValue","_transformers$current","_transformers$current2","_transformers$current3","current","fromExternal","call","_transformers$current4","_transformers$current5","_transformers$current6","has","_transformers$current7","_transformers$current8","_transformers$current9","get","_transformers$current10","_transformers$current11","_transformers$current12","_transformers$current13","_transformers$current14","_transformers$current15"],"sources":["../../../../../src/extensions/forms/hooks/useExternalValue.ts"],"sourcesContent":["import { useContext, useMemo } from 'react'\nimport pointer from '../utils/json-pointer'\nimport { FieldProps, Path } from '../types'\nimport DataContext from '../DataContext/Context'\nimport IterateElementContext from '../Iterate/IterateItemContext'\n\nexport type Props<Value> = {\n path?: Path | undefined\n itemPath?: Path\n value?: Value\n transformers?: React.MutableRefObject<{\n fromExternal: FieldProps<Value>['fromExternal']\n }>\n emptyValue?: FieldProps<Value>['emptyValue']\n}\n\nexport default function useExternalValue<Value>(props: Props<Value>) {\n const {\n path,\n itemPath,\n value,\n transformers,\n emptyValue = undefined,\n } = props\n const { data } = useContext(DataContext) || {}\n const iterateItemContext = useContext(IterateElementContext)\n const inIterate = Boolean(iterateItemContext)\n const { value: iterateElementValue } = iterateItemContext || {}\n\n return useMemo(() => {\n if (value !== emptyValue) {\n // Value-prop sent directly to the field has highest priority, overriding any surrounding source\n return transformers?.current?.fromExternal?.(value) ?? emptyValue\n }\n\n if (inIterate && itemPath) {\n // This field is inside an iterate, and has a pointer from the base of the element being iterated\n if (itemPath === '/') {\n return (\n transformers?.current?.fromExternal?.(\n iterateElementValue as Value\n ) ?? emptyValue\n )\n }\n\n if (pointer.has(iterateElementValue, itemPath)) {\n return (\n transformers?.current?.fromExternal?.(\n pointer.get(iterateElementValue, itemPath) as Value\n ) ?? emptyValue\n )\n }\n }\n\n if (data && path) {\n // There is a surrounding data context and a path for where in the source to find the data\n if (path === '/') {\n return transformers?.current?.fromExternal?.(data) ?? emptyValue\n }\n\n if (pointer.has(data, path)) {\n return (\n transformers?.current?.fromExternal?.(pointer.get(data, path)) ??\n emptyValue\n )\n }\n }\n\n return emptyValue\n }, [\n data,\n emptyValue,\n inIterate,\n itemPath,\n iterateElementValue,\n path,\n transformers,\n value,\n ])\n}\n"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,OAAOC,OAAO,MAAM,uBAAuB;AAE3C,OAAOC,WAAW,MAAM,wBAAwB;AAChD,OAAOC,qBAAqB,MAAM,+BAA+B;AAYjE,eAAe,SAASC,gBAAgBA,CAAQC,KAAmB,EAAE;EACnE,MAAM;IACJC,IAAI;IACJC,QAAQ;IACRC,KAAK;IACLC,YAAY;IACZC,UAAU,GAAGC;EACf,CAAC,GAAGN,KAAK;EACT,MAAM;IAAEO;EAAK,CAAC,GAAGb,UAAU,CAACG,WAAW,CAAC,IAAI,CAAC,CAAC;EAC9C,MAAMW,kBAAkB,GAAGd,UAAU,CAACI,qBAAqB,CAAC;EAC5D,MAAMW,SAAS,GAAGC,OAAO,CAACF,kBAAkB,CAAC;EAC7C,MAAM;IAAEL,KAAK,EAAEQ;EAAoB,CAAC,GAAGH,kBAAkB,IAAI,CAAC,CAAC;EAE/D,OAAOb,OAAO,CAAC,MAAM;IACnB,IAAIQ,KAAK,KAAKE,UAAU,EAAE;MAAA,IAAAO,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA;MAExB,QAAAF,qBAAA,GAAOR,YAAY,aAAZA,YAAY,wBAAAS,sBAAA,GAAZT,YAAY,C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AY,wBAAAuB,uBAAA,GAAZvB,YAAY,CAAEW,OAAO,cAAAY,uBAAA,wBAAAC,uBAAA,GAArBD,uBAAA,CAAuBX,YAAY,cAAAY,uBAAA,uBAAnCA,uBAAA,CAAAX,IAAA,CAAAU,uBAAA,EAAsCpB,IAAI,CAAC,cAAAmB,uBAAA,cAAAA,uBAAA,GAAIrB,UAAU;MAClE;MAEA,IAAIT,OAAO,CAACyB,GAAG,CAACd,IAAI,EAAEN,IAAI,CAAC,EAAE;QAAA,IAAA4B,uBAAA,EAAAC,uBAAA,EAAAC,uBAAA;QAC3B,QAAAF,uBAAA,GACEzB,YAAY,aAAZA,YAAY,wBAAA0B,uBAAA,GAAZ1B,YAAY,CAAEW,OAAO,cAAAe,uBAAA,wBAAAC,uBAAA,GAArBD,uBAAA,CAAuBd,YAAY,cAAAe,uBAAA,uBAAnCA,uBAAA,CAAAd,IAAA,CAAAa,uBAAA,EAAsClC,OAAO,CAAC6B,GAAG,CAAClB,IAAI,EAAEN,IAAI,CAAC,CAAC,cAAA4B,uBAAA,cAAAA,uBAAA,GAC9DxB,UAAU;MAEd;IACF;IAEA,OAAOA,UAAU;EACnB,CAAC,EAAE,CACDE,IAAI,EACJF,UAAU,EACVI,SAAS,EACTP,QAAQ,EACRS,mBAAmB,EACnBV,IAAI,EACJG,YAAY,EACZD,KAAK,CACN,CAAC;AACJ"}
1
+ {"version":3,"file":"useExternalValue.js","names":["useContext","useMemo","pointer","DataContext","IterateItemContext","useExternalValue","props","path","itemPath","value","transformers","emptyValue","undefined","data","iterateItemContext","inIterate","Boolean","iterateElementValue","_transformers$current","_transformers$current2","_transformers$current3","current","fromExternal","call","_transformers$current4","_transformers$current5","_transformers$current6","has","_transformers$current7","_transformers$current8","_transformers$current9","get","_transformers$current10","_transformers$current11","_transformers$current12","_transformers$current13","_transformers$current14","_transformers$current15"],"sources":["../../../../../src/extensions/forms/hooks/useExternalValue.ts"],"sourcesContent":["import { useContext, useMemo } from 'react'\nimport pointer from '../utils/json-pointer'\nimport { FieldProps, Path } from '../types'\nimport DataContext from '../DataContext/Context'\nimport IterateItemContext from '../Iterate/IterateItemContext'\n\nexport type Props<Value> = {\n path?: Path | undefined\n itemPath?: Path\n value?: Value\n transformers?: React.MutableRefObject<{\n fromExternal: FieldProps<Value>['fromExternal']\n }>\n emptyValue?: FieldProps<Value>['emptyValue']\n}\n\nexport default function useExternalValue<Value>(props: Props<Value>) {\n const {\n path,\n itemPath,\n value,\n transformers,\n emptyValue = undefined,\n } = props\n const { data } = useContext(DataContext) || {}\n const iterateItemContext = useContext(IterateItemContext)\n const inIterate = Boolean(iterateItemContext)\n const { value: iterateElementValue } = iterateItemContext || {}\n\n return useMemo(() => {\n if (value !== emptyValue) {\n // Value-prop sent directly to the field has highest priority, overriding any surrounding source\n return transformers?.current?.fromExternal?.(value) ?? emptyValue\n }\n\n if (inIterate && itemPath) {\n // This field is inside an iterate, and has a pointer from the base of the element being iterated\n if (itemPath === '/') {\n return (\n transformers?.current?.fromExternal?.(\n iterateElementValue as Value\n ) ?? emptyValue\n )\n }\n\n if (pointer.has(iterateElementValue, itemPath)) {\n return (\n transformers?.current?.fromExternal?.(\n pointer.get(iterateElementValue, itemPath) as Value\n ) ?? emptyValue\n )\n }\n }\n\n if (data && path) {\n // There is a surrounding data context and a path for where in the source to find the data\n if (path === '/') {\n return transformers?.current?.fromExternal?.(data) ?? emptyValue\n }\n\n if (pointer.has(data, path)) {\n return (\n transformers?.current?.fromExternal?.(pointer.get(data, path)) ??\n emptyValue\n )\n }\n }\n\n return emptyValue\n }, [\n data,\n emptyValue,\n inIterate,\n itemPath,\n iterateElementValue,\n path,\n transformers,\n value,\n ])\n}\n"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAC3C,OAAOC,OAAO,MAAM,uBAAuB;AAE3C,OAAOC,WAAW,MAAM,wBAAwB;AAChD,OAAOC,kBAAkB,MAAM,+BAA+B;AAY9D,eAAe,SAASC,gBAAgBA,CAA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A4B,uBAAA,cAAAA,uBAAA,GAC9DxB,UAAU;MAEd;IACF;IAEA,OAAOA,UAAU;EACnB,CAAC,EAAE,CACDE,IAAI,EACJF,UAAU,EACVI,SAAS,EACTP,QAAQ,EACRS,mBAAmB,EACnBV,IAAI,EACJG,YAAY,EACZD,KAAK,CACN,CAAC;AACJ"}
@@ -4,11 +4,17 @@ import { ContextState } from '../DataContext';
4
4
  export type DataAttributes = {
5
5
  [property: `data-${string}`]: string | boolean | number;
6
6
  };
7
- export default function useFieldProps<Value, EmptyValue, Props>(localProps: Props & FieldPropsGeneric<Value, EmptyValue>, { executeOnChangeRegardlessOfError, updateContextDataInSync, omitMultiplePathWarning, forceUpdateWhenContextDataIsSet, }?: {
7
+ export default function useFieldProps<Value, EmptyValue, Props>(localProps: Props & FieldPropsGeneric<Value, EmptyValue>, { executeOnChangeRegardlessOfError, updateContextDataInSync, omitMultiplePathWarning, forceUpdateWhenContextDataIsSet,
8
+ /**
9
+ * When set to true, errors will always be reported downwards to FieldBlock.
10
+ * This is useful for when not dealing with blur/focus, like in Iterate.Array.
11
+ */
12
+ alwaysRevealError, }?: {
8
13
  executeOnChangeRegardlessOfError?: boolean;
9
14
  updateContextDataInSync?: boolean;
10
15
  omitMultiplePathWarning?: boolean;
11
16
  forceUpdateWhenContextDataIsSet?: boolean;
17
+ alwaysRevealError?: boolean;
12
18
  }): typeof localProps & ReturnAdditional<Value>;
13
19
  export interface ReturnAdditional<Value> {
14
20
  /** Documented APIs */
@@ -21,7 +27,7 @@ export interface ReturnAdditional<Value> {
21
27
  handleChange: (value: Value | unknown, additionalArgs?: AdditionalEventArgs) => void;
22
28
  updateValue: (value: Value) => void;
23
29
  setChanged: (state: boolean) => void;
24
- setDisplayValue: (path: Identifier, value: React.ReactNode) => void;
30
+ setDisplayValue: (value: React.ReactNode, path?: Identifier) => void;
25
31
  forceUpdate: () => void;
26
32
  hasError?: boolean;
27
33
  /** Internal */