@dnb/eufemia 10.64.1 → 10.65.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/cjs/components/date-picker/DatePicker.d.ts +3 -1
  3. package/cjs/components/date-picker/DatePicker.js +4 -6
  4. package/cjs/components/date-picker/DatePicker.js.map +1 -1
  5. package/cjs/components/date-picker/DatePickerAddon.js +8 -1
  6. package/cjs/components/date-picker/DatePickerAddon.js.map +1 -1
  7. package/cjs/components/date-picker/DatePickerInput.js +2 -2
  8. package/cjs/components/date-picker/DatePickerInput.js.map +1 -1
  9. package/cjs/components/input-masked/MultiInputMask.d.ts +2 -1
  10. package/cjs/components/input-masked/MultiInputMask.js.map +1 -1
  11. package/cjs/components/radio/RadioGroup.d.ts +1 -1
  12. package/cjs/components/skeleton/style/themes/dnb-skeleton-theme-sbanken.css +4 -7
  13. package/cjs/components/skeleton/style/themes/dnb-skeleton-theme-sbanken.min.css +1 -0
  14. package/cjs/components/skeleton/style/themes/dnb-skeleton-theme-sbanken.scss +5 -7
  15. package/cjs/components/skeleton/style/themes/dnb-skeleton-theme-ui.css +4 -7
  16. package/cjs/components/skeleton/style/themes/dnb-skeleton-theme-ui.min.css +1 -0
  17. package/cjs/components/skeleton/style/themes/dnb-skeleton-theme-ui.scss +5 -7
  18. package/cjs/components/toggle-button/ToggleButtonGroup.d.ts +2 -0
  19. package/cjs/components/toggle-button/ToggleButtonGroup.js +5 -1
  20. package/cjs/components/toggle-button/ToggleButtonGroup.js.map +1 -1
  21. package/cjs/extensions/forms/DataContext/Context.d.ts +1 -1
  22. package/cjs/extensions/forms/DataContext/Context.js.map +1 -1
  23. package/cjs/extensions/forms/DataContext/FieldBoundary/FieldBoundaryContext.d.ts +1 -1
  24. package/cjs/extensions/forms/DataContext/FieldBoundary/FieldBoundaryContext.js.map +1 -1
  25. package/cjs/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js +2 -2
  26. package/cjs/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js.map +1 -1
  27. package/cjs/extensions/forms/DataContext/Provider/Provider.js +2 -2
  28. package/cjs/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  29. package/cjs/extensions/forms/Field/ArraySelection/ArraySelection.d.ts +8 -1
  30. package/cjs/extensions/forms/Field/ArraySelection/ArraySelection.js +9 -2
  31. package/cjs/extensions/forms/Field/ArraySelection/ArraySelection.js.map +1 -1
  32. package/cjs/extensions/forms/Field/ArraySelection/ArraySelectionDocs.js +5 -0
  33. package/cjs/extensions/forms/Field/ArraySelection/ArraySelectionDocs.js.map +1 -1
  34. package/cjs/extensions/forms/Field/BankAccountNumber/BankAccountNumber.d.ts +2 -2
  35. package/cjs/extensions/forms/Field/BankAccountNumber/BankAccountNumber.js.map +1 -1
  36. package/cjs/extensions/forms/Field/Boolean/Boolean.d.ts +1 -0
  37. package/cjs/extensions/forms/Field/Boolean/Boolean.js.map +1 -1
  38. package/cjs/extensions/forms/Field/Boolean/BooleanDocs.js +3 -1
  39. package/cjs/extensions/forms/Field/Boolean/BooleanDocs.js.map +1 -1
  40. package/cjs/extensions/forms/Field/Date/Date.d.ts +5 -4
  41. package/cjs/extensions/forms/Field/Date/Date.js +123 -11
  42. package/cjs/extensions/forms/Field/Date/Date.js.map +1 -1
  43. package/cjs/extensions/forms/Field/Date/DateDocs.js +13 -4
  44. package/cjs/extensions/forms/Field/Date/DateDocs.js.map +1 -1
  45. package/cjs/extensions/forms/Field/Expiry/Expiry.d.ts +7 -1
  46. package/cjs/extensions/forms/Field/Expiry/Expiry.js +2 -0
  47. package/cjs/extensions/forms/Field/Expiry/Expiry.js.map +1 -1
  48. package/cjs/extensions/forms/Field/Expiry/ExpiryDocs.d.ts +2 -0
  49. package/cjs/extensions/forms/Field/Expiry/ExpiryDocs.js +19 -0
  50. package/cjs/extensions/forms/Field/Expiry/ExpiryDocs.js.map +1 -0
  51. package/cjs/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.d.ts +2 -2
  52. package/cjs/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.js.map +1 -1
  53. package/cjs/extensions/forms/Field/Number/NumberDocs.js +8 -1
  54. package/cjs/extensions/forms/Field/Number/NumberDocs.js.map +1 -1
  55. package/cjs/extensions/forms/Field/OrganizationNumber/OrganizationNumber.d.ts +2 -2
  56. package/cjs/extensions/forms/Field/OrganizationNumber/OrganizationNumber.js.map +1 -1
  57. package/cjs/extensions/forms/Field/Password/PasswordDocs.js +1 -1
  58. package/cjs/extensions/forms/Field/Password/PasswordDocs.js.map +1 -1
  59. package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumber.d.ts +1 -1
  60. package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumber.js +5 -2
  61. package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
  62. package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.js +2 -0
  63. package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.js.map +1 -1
  64. package/cjs/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.d.ts +1 -1
  65. package/cjs/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js +6 -2
  66. package/cjs/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js.map +1 -1
  67. package/cjs/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCityDocs.js +3 -1
  68. package/cjs/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCityDocs.js.map +1 -1
  69. package/cjs/extensions/forms/Field/SelectCountry/SelectCountry.d.ts +5 -0
  70. package/cjs/extensions/forms/Field/SelectCountry/SelectCountry.js +2 -0
  71. package/cjs/extensions/forms/Field/SelectCountry/SelectCountry.js.map +1 -1
  72. package/cjs/extensions/forms/Field/SelectCountry/SelectCountryDocs.js +10 -1
  73. package/cjs/extensions/forms/Field/SelectCountry/SelectCountryDocs.js.map +1 -1
  74. package/cjs/extensions/forms/Field/Selection/Selection.d.ts +9 -0
  75. package/cjs/extensions/forms/Field/Selection/Selection.js +14 -6
  76. package/cjs/extensions/forms/Field/Selection/Selection.js.map +1 -1
  77. package/cjs/extensions/forms/Field/Selection/SelectionDocs.js +5 -0
  78. package/cjs/extensions/forms/Field/Selection/SelectionDocs.js.map +1 -1
  79. package/cjs/extensions/forms/Field/String/StringDocs.js +8 -1
  80. package/cjs/extensions/forms/Field/String/StringDocs.js.map +1 -1
  81. package/cjs/extensions/forms/Field/Toggle/Toggle.d.ts +3 -0
  82. package/cjs/extensions/forms/Field/Toggle/Toggle.js +6 -1
  83. package/cjs/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
  84. package/cjs/extensions/forms/Field/Toggle/ToggleDocs.js +5 -0
  85. package/cjs/extensions/forms/Field/Toggle/ToggleDocs.js.map +1 -1
  86. package/cjs/extensions/forms/Form/Visibility/Visibility.d.ts +1 -1
  87. package/cjs/extensions/forms/Form/Visibility/Visibility.js.map +1 -1
  88. package/cjs/extensions/forms/Form/Visibility/VisibilityDocs.js +1 -1
  89. package/cjs/extensions/forms/Form/Visibility/VisibilityDocs.js.map +1 -1
  90. package/cjs/extensions/forms/Iterate/PushContainer/PushContainer.js +7 -2
  91. package/cjs/extensions/forms/Iterate/PushContainer/PushContainer.js.map +1 -1
  92. package/cjs/extensions/forms/Value/Date/Date.d.ts +3 -2
  93. package/cjs/extensions/forms/Value/Date/Date.js.map +1 -1
  94. package/cjs/extensions/forms/Wizard/Container/WizardContainer.js +20 -8
  95. package/cjs/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
  96. package/cjs/extensions/forms/Wizard/Context/WizardContext.d.ts +1 -0
  97. package/cjs/extensions/forms/Wizard/Context/WizardContext.js.map +1 -1
  98. package/cjs/extensions/forms/Wizard/Step/Step.d.ts +16 -1
  99. package/cjs/extensions/forms/Wizard/Step/Step.js +32 -10
  100. package/cjs/extensions/forms/Wizard/Step/Step.js.map +1 -1
  101. package/cjs/extensions/forms/Wizard/Step/StepDocs.js +18 -3
  102. package/cjs/extensions/forms/Wizard/Step/StepDocs.js.map +1 -1
  103. package/cjs/extensions/forms/constants/locales/en-GB.d.ts +6 -0
  104. package/cjs/extensions/forms/constants/locales/en-GB.js +7 -1
  105. package/cjs/extensions/forms/constants/locales/en-GB.js.map +1 -1
  106. package/cjs/extensions/forms/constants/locales/en-US.d.ts +6 -0
  107. package/cjs/extensions/forms/constants/locales/index.d.ts +12 -0
  108. package/cjs/extensions/forms/constants/locales/nb-NO.d.ts +6 -0
  109. package/cjs/extensions/forms/constants/locales/nb-NO.js +7 -1
  110. package/cjs/extensions/forms/constants/locales/nb-NO.js.map +1 -1
  111. package/cjs/extensions/forms/hooks/useFieldProps.js +8 -8
  112. package/cjs/extensions/forms/hooks/useFieldProps.js.map +1 -1
  113. package/cjs/extensions/forms/types.d.ts +1 -0
  114. package/cjs/extensions/forms/types.js.map +1 -1
  115. package/cjs/fragments/drawer-list/DrawerList.d.ts +6 -1
  116. package/cjs/shared/Eufemia.d.ts +1 -1
  117. package/cjs/shared/Eufemia.js +2 -2
  118. package/cjs/shared/Eufemia.js.map +1 -1
  119. package/cjs/style/core/scopes.scss +1 -1
  120. package/cjs/style/dnb-ui-basis.css +1 -1
  121. package/cjs/style/dnb-ui-basis.min.css +1 -1
  122. package/cjs/style/dnb-ui-body.css +1 -1
  123. package/cjs/style/dnb-ui-body.min.css +1 -1
  124. package/cjs/style/dnb-ui-core.css +1 -1
  125. package/cjs/style/dnb-ui-core.min.css +1 -1
  126. package/cjs/style/themes/theme-eiendom/eiendom-theme-basis.css +0 -2
  127. package/cjs/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
  128. package/cjs/style/themes/theme-eiendom/eiendom-theme-components.css +5 -7
  129. package/cjs/style/themes/theme-eiendom/eiendom-theme-components.min.css +1 -1
  130. package/cjs/style/themes/theme-sbanken/globals.scss +0 -4
  131. package/cjs/style/themes/theme-sbanken/sbanken-theme-basis.css +0 -2
  132. package/cjs/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
  133. package/cjs/style/themes/theme-sbanken/sbanken-theme-components.css +5 -7
  134. package/cjs/style/themes/theme-sbanken/sbanken-theme-components.min.css +1 -1
  135. package/cjs/style/themes/theme-ui/globals.scss +0 -4
  136. package/cjs/style/themes/theme-ui/ui-theme-basis.css +0 -2
  137. package/cjs/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
  138. package/cjs/style/themes/theme-ui/ui-theme-components.css +5 -7
  139. package/cjs/style/themes/theme-ui/ui-theme-components.min.css +1 -1
  140. package/components/date-picker/DatePicker.d.ts +3 -1
  141. package/components/date-picker/DatePicker.js +4 -6
  142. package/components/date-picker/DatePicker.js.map +1 -1
  143. package/components/date-picker/DatePickerAddon.js +6 -1
  144. package/components/date-picker/DatePickerAddon.js.map +1 -1
  145. package/components/date-picker/DatePickerInput.js +2 -2
  146. package/components/date-picker/DatePickerInput.js.map +1 -1
  147. package/components/input-masked/MultiInputMask.d.ts +2 -1
  148. package/components/input-masked/MultiInputMask.js.map +1 -1
  149. package/components/radio/RadioGroup.d.ts +1 -1
  150. package/components/skeleton/style/themes/dnb-skeleton-theme-sbanken.css +4 -7
  151. package/components/skeleton/style/themes/dnb-skeleton-theme-sbanken.min.css +1 -0
  152. package/components/skeleton/style/themes/dnb-skeleton-theme-sbanken.scss +5 -7
  153. package/components/skeleton/style/themes/dnb-skeleton-theme-ui.css +4 -7
  154. package/components/skeleton/style/themes/dnb-skeleton-theme-ui.min.css +1 -0
  155. package/components/skeleton/style/themes/dnb-skeleton-theme-ui.scss +5 -7
  156. package/components/toggle-button/ToggleButtonGroup.d.ts +2 -0
  157. package/components/toggle-button/ToggleButtonGroup.js +5 -1
  158. package/components/toggle-button/ToggleButtonGroup.js.map +1 -1
  159. package/es/components/date-picker/DatePicker.d.ts +3 -1
  160. package/es/components/date-picker/DatePicker.js +4 -6
  161. package/es/components/date-picker/DatePicker.js.map +1 -1
  162. package/es/components/date-picker/DatePickerAddon.js +6 -1
  163. package/es/components/date-picker/DatePickerAddon.js.map +1 -1
  164. package/es/components/date-picker/DatePickerInput.js +2 -2
  165. package/es/components/date-picker/DatePickerInput.js.map +1 -1
  166. package/es/components/input-masked/MultiInputMask.d.ts +2 -1
  167. package/es/components/input-masked/MultiInputMask.js.map +1 -1
  168. package/es/components/radio/RadioGroup.d.ts +1 -1
  169. package/es/components/skeleton/style/themes/dnb-skeleton-theme-sbanken.css +4 -7
  170. package/es/components/skeleton/style/themes/dnb-skeleton-theme-sbanken.min.css +1 -0
  171. package/es/components/skeleton/style/themes/dnb-skeleton-theme-sbanken.scss +5 -7
  172. package/es/components/skeleton/style/themes/dnb-skeleton-theme-ui.css +4 -7
  173. package/es/components/skeleton/style/themes/dnb-skeleton-theme-ui.min.css +1 -0
  174. package/es/components/skeleton/style/themes/dnb-skeleton-theme-ui.scss +5 -7
  175. package/es/components/toggle-button/ToggleButtonGroup.d.ts +2 -0
  176. package/es/components/toggle-button/ToggleButtonGroup.js +5 -1
  177. package/es/components/toggle-button/ToggleButtonGroup.js.map +1 -1
  178. package/es/extensions/forms/DataContext/Context.d.ts +1 -1
  179. package/es/extensions/forms/DataContext/Context.js.map +1 -1
  180. package/es/extensions/forms/DataContext/FieldBoundary/FieldBoundaryContext.d.ts +1 -1
  181. package/es/extensions/forms/DataContext/FieldBoundary/FieldBoundaryContext.js.map +1 -1
  182. package/es/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js +2 -2
  183. package/es/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js.map +1 -1
  184. package/es/extensions/forms/DataContext/Provider/Provider.js +2 -2
  185. package/es/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  186. package/es/extensions/forms/Field/ArraySelection/ArraySelection.d.ts +8 -1
  187. package/es/extensions/forms/Field/ArraySelection/ArraySelection.js +9 -2
  188. package/es/extensions/forms/Field/ArraySelection/ArraySelection.js.map +1 -1
  189. package/es/extensions/forms/Field/ArraySelection/ArraySelectionDocs.js +5 -0
  190. package/es/extensions/forms/Field/ArraySelection/ArraySelectionDocs.js.map +1 -1
  191. package/es/extensions/forms/Field/BankAccountNumber/BankAccountNumber.d.ts +2 -2
  192. package/es/extensions/forms/Field/BankAccountNumber/BankAccountNumber.js.map +1 -1
  193. package/es/extensions/forms/Field/Boolean/Boolean.d.ts +1 -0
  194. package/es/extensions/forms/Field/Boolean/Boolean.js.map +1 -1
  195. package/es/extensions/forms/Field/Boolean/BooleanDocs.js +3 -1
  196. package/es/extensions/forms/Field/Boolean/BooleanDocs.js.map +1 -1
  197. package/es/extensions/forms/Field/Date/Date.d.ts +5 -4
  198. package/es/extensions/forms/Field/Date/Date.js +124 -12
  199. package/es/extensions/forms/Field/Date/Date.js.map +1 -1
  200. package/es/extensions/forms/Field/Date/DateDocs.js +13 -4
  201. package/es/extensions/forms/Field/Date/DateDocs.js.map +1 -1
  202. package/es/extensions/forms/Field/Expiry/Expiry.d.ts +7 -1
  203. package/es/extensions/forms/Field/Expiry/Expiry.js +2 -0
  204. package/es/extensions/forms/Field/Expiry/Expiry.js.map +1 -1
  205. package/es/extensions/forms/Field/Expiry/ExpiryDocs.d.ts +2 -0
  206. package/es/extensions/forms/Field/Expiry/ExpiryDocs.js +10 -0
  207. package/es/extensions/forms/Field/Expiry/ExpiryDocs.js.map +1 -0
  208. package/es/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.d.ts +2 -2
  209. package/es/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.js.map +1 -1
  210. package/es/extensions/forms/Field/Number/NumberDocs.js +6 -1
  211. package/es/extensions/forms/Field/Number/NumberDocs.js.map +1 -1
  212. package/es/extensions/forms/Field/OrganizationNumber/OrganizationNumber.d.ts +2 -2
  213. package/es/extensions/forms/Field/OrganizationNumber/OrganizationNumber.js.map +1 -1
  214. package/es/extensions/forms/Field/Password/PasswordDocs.js +1 -1
  215. package/es/extensions/forms/Field/Password/PasswordDocs.js.map +1 -1
  216. package/es/extensions/forms/Field/PhoneNumber/PhoneNumber.d.ts +1 -1
  217. package/es/extensions/forms/Field/PhoneNumber/PhoneNumber.js +5 -2
  218. package/es/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
  219. package/es/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.js +2 -0
  220. package/es/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.js.map +1 -1
  221. package/es/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.d.ts +1 -1
  222. package/es/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js +6 -2
  223. package/es/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js.map +1 -1
  224. package/es/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCityDocs.js +3 -1
  225. package/es/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCityDocs.js.map +1 -1
  226. package/es/extensions/forms/Field/SelectCountry/SelectCountry.d.ts +5 -0
  227. package/es/extensions/forms/Field/SelectCountry/SelectCountry.js +2 -0
  228. package/es/extensions/forms/Field/SelectCountry/SelectCountry.js.map +1 -1
  229. package/es/extensions/forms/Field/SelectCountry/SelectCountryDocs.js +8 -1
  230. package/es/extensions/forms/Field/SelectCountry/SelectCountryDocs.js.map +1 -1
  231. package/es/extensions/forms/Field/Selection/Selection.d.ts +9 -0
  232. package/es/extensions/forms/Field/Selection/Selection.js +14 -6
  233. package/es/extensions/forms/Field/Selection/Selection.js.map +1 -1
  234. package/es/extensions/forms/Field/Selection/SelectionDocs.js +5 -0
  235. package/es/extensions/forms/Field/Selection/SelectionDocs.js.map +1 -1
  236. package/es/extensions/forms/Field/String/StringDocs.js +6 -1
  237. package/es/extensions/forms/Field/String/StringDocs.js.map +1 -1
  238. package/es/extensions/forms/Field/Toggle/Toggle.d.ts +3 -0
  239. package/es/extensions/forms/Field/Toggle/Toggle.js +6 -1
  240. package/es/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
  241. package/es/extensions/forms/Field/Toggle/ToggleDocs.js +5 -0
  242. package/es/extensions/forms/Field/Toggle/ToggleDocs.js.map +1 -1
  243. package/es/extensions/forms/Form/Visibility/Visibility.d.ts +1 -1
  244. package/es/extensions/forms/Form/Visibility/Visibility.js.map +1 -1
  245. package/es/extensions/forms/Form/Visibility/VisibilityDocs.js +1 -1
  246. package/es/extensions/forms/Form/Visibility/VisibilityDocs.js.map +1 -1
  247. package/es/extensions/forms/Iterate/PushContainer/PushContainer.js +7 -2
  248. package/es/extensions/forms/Iterate/PushContainer/PushContainer.js.map +1 -1
  249. package/es/extensions/forms/Value/Date/Date.d.ts +3 -2
  250. package/es/extensions/forms/Value/Date/Date.js.map +1 -1
  251. package/es/extensions/forms/Wizard/Container/WizardContainer.js +20 -8
  252. package/es/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
  253. package/es/extensions/forms/Wizard/Context/WizardContext.d.ts +1 -0
  254. package/es/extensions/forms/Wizard/Context/WizardContext.js.map +1 -1
  255. package/es/extensions/forms/Wizard/Step/Step.d.ts +16 -1
  256. package/es/extensions/forms/Wizard/Step/Step.js +29 -10
  257. package/es/extensions/forms/Wizard/Step/Step.js.map +1 -1
  258. package/es/extensions/forms/Wizard/Step/StepDocs.js +18 -3
  259. package/es/extensions/forms/Wizard/Step/StepDocs.js.map +1 -1
  260. package/es/extensions/forms/constants/locales/en-GB.d.ts +6 -0
  261. package/es/extensions/forms/constants/locales/en-GB.js +7 -1
  262. package/es/extensions/forms/constants/locales/en-GB.js.map +1 -1
  263. package/es/extensions/forms/constants/locales/en-US.d.ts +6 -0
  264. package/es/extensions/forms/constants/locales/index.d.ts +12 -0
  265. package/es/extensions/forms/constants/locales/nb-NO.d.ts +6 -0
  266. package/es/extensions/forms/constants/locales/nb-NO.js +7 -1
  267. package/es/extensions/forms/constants/locales/nb-NO.js.map +1 -1
  268. package/es/extensions/forms/hooks/useFieldProps.js +8 -8
  269. package/es/extensions/forms/hooks/useFieldProps.js.map +1 -1
  270. package/es/extensions/forms/types.d.ts +1 -0
  271. package/es/extensions/forms/types.js.map +1 -1
  272. package/es/fragments/drawer-list/DrawerList.d.ts +6 -1
  273. package/es/shared/Eufemia.d.ts +1 -1
  274. package/es/shared/Eufemia.js +2 -2
  275. package/es/shared/Eufemia.js.map +1 -1
  276. package/es/style/core/scopes.scss +1 -1
  277. package/es/style/dnb-ui-basis.css +1 -1
  278. package/es/style/dnb-ui-basis.min.css +1 -1
  279. package/es/style/dnb-ui-body.css +1 -1
  280. package/es/style/dnb-ui-body.min.css +1 -1
  281. package/es/style/dnb-ui-core.css +1 -1
  282. package/es/style/dnb-ui-core.min.css +1 -1
  283. package/es/style/themes/theme-eiendom/eiendom-theme-basis.css +0 -2
  284. package/es/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
  285. package/es/style/themes/theme-eiendom/eiendom-theme-components.css +5 -7
  286. package/es/style/themes/theme-eiendom/eiendom-theme-components.min.css +1 -1
  287. package/es/style/themes/theme-sbanken/globals.scss +0 -4
  288. package/es/style/themes/theme-sbanken/sbanken-theme-basis.css +0 -2
  289. package/es/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
  290. package/es/style/themes/theme-sbanken/sbanken-theme-components.css +5 -7
  291. package/es/style/themes/theme-sbanken/sbanken-theme-components.min.css +1 -1
  292. package/es/style/themes/theme-ui/globals.scss +0 -4
  293. package/es/style/themes/theme-ui/ui-theme-basis.css +0 -2
  294. package/es/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
  295. package/es/style/themes/theme-ui/ui-theme-components.css +5 -7
  296. package/es/style/themes/theme-ui/ui-theme-components.min.css +1 -1
  297. package/esm/dnb-ui-basis.min.mjs +1 -1
  298. package/esm/dnb-ui-components.min.mjs +1 -1
  299. package/esm/dnb-ui-elements.min.mjs +1 -1
  300. package/esm/dnb-ui-extensions.min.mjs +3 -3
  301. package/esm/dnb-ui-lib.min.mjs +1 -1
  302. package/extensions/forms/DataContext/Context.d.ts +1 -1
  303. package/extensions/forms/DataContext/Context.js.map +1 -1
  304. package/extensions/forms/DataContext/FieldBoundary/FieldBoundaryContext.d.ts +1 -1
  305. package/extensions/forms/DataContext/FieldBoundary/FieldBoundaryContext.js.map +1 -1
  306. package/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js +2 -2
  307. package/extensions/forms/DataContext/FieldBoundary/FieldBoundaryProvider.js.map +1 -1
  308. package/extensions/forms/DataContext/Provider/Provider.js +2 -2
  309. package/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  310. package/extensions/forms/Field/ArraySelection/ArraySelection.d.ts +8 -1
  311. package/extensions/forms/Field/ArraySelection/ArraySelection.js +9 -2
  312. package/extensions/forms/Field/ArraySelection/ArraySelection.js.map +1 -1
  313. package/extensions/forms/Field/ArraySelection/ArraySelectionDocs.js +5 -0
  314. package/extensions/forms/Field/ArraySelection/ArraySelectionDocs.js.map +1 -1
  315. package/extensions/forms/Field/BankAccountNumber/BankAccountNumber.d.ts +2 -2
  316. package/extensions/forms/Field/BankAccountNumber/BankAccountNumber.js.map +1 -1
  317. package/extensions/forms/Field/Boolean/Boolean.d.ts +1 -0
  318. package/extensions/forms/Field/Boolean/Boolean.js.map +1 -1
  319. package/extensions/forms/Field/Boolean/BooleanDocs.js +3 -1
  320. package/extensions/forms/Field/Boolean/BooleanDocs.js.map +1 -1
  321. package/extensions/forms/Field/Date/Date.d.ts +5 -4
  322. package/extensions/forms/Field/Date/Date.js +124 -12
  323. package/extensions/forms/Field/Date/Date.js.map +1 -1
  324. package/extensions/forms/Field/Date/DateDocs.js +13 -4
  325. package/extensions/forms/Field/Date/DateDocs.js.map +1 -1
  326. package/extensions/forms/Field/Expiry/Expiry.d.ts +7 -1
  327. package/extensions/forms/Field/Expiry/Expiry.js +2 -0
  328. package/extensions/forms/Field/Expiry/Expiry.js.map +1 -1
  329. package/extensions/forms/Field/Expiry/ExpiryDocs.d.ts +2 -0
  330. package/extensions/forms/Field/Expiry/ExpiryDocs.js +10 -0
  331. package/extensions/forms/Field/Expiry/ExpiryDocs.js.map +1 -0
  332. package/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.d.ts +2 -2
  333. package/extensions/forms/Field/NationalIdentityNumber/NationalIdentityNumber.js.map +1 -1
  334. package/extensions/forms/Field/Number/NumberDocs.js +6 -1
  335. package/extensions/forms/Field/Number/NumberDocs.js.map +1 -1
  336. package/extensions/forms/Field/OrganizationNumber/OrganizationNumber.d.ts +2 -2
  337. package/extensions/forms/Field/OrganizationNumber/OrganizationNumber.js.map +1 -1
  338. package/extensions/forms/Field/Password/PasswordDocs.js +1 -1
  339. package/extensions/forms/Field/Password/PasswordDocs.js.map +1 -1
  340. package/extensions/forms/Field/PhoneNumber/PhoneNumber.d.ts +1 -1
  341. package/extensions/forms/Field/PhoneNumber/PhoneNumber.js +5 -2
  342. package/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
  343. package/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.js +2 -0
  344. package/extensions/forms/Field/PhoneNumber/PhoneNumberDocs.js.map +1 -1
  345. package/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.d.ts +1 -1
  346. package/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js +6 -2
  347. package/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js.map +1 -1
  348. package/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCityDocs.js +3 -1
  349. package/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCityDocs.js.map +1 -1
  350. package/extensions/forms/Field/SelectCountry/SelectCountry.d.ts +5 -0
  351. package/extensions/forms/Field/SelectCountry/SelectCountry.js +2 -0
  352. package/extensions/forms/Field/SelectCountry/SelectCountry.js.map +1 -1
  353. package/extensions/forms/Field/SelectCountry/SelectCountryDocs.js +8 -1
  354. package/extensions/forms/Field/SelectCountry/SelectCountryDocs.js.map +1 -1
  355. package/extensions/forms/Field/Selection/Selection.d.ts +9 -0
  356. package/extensions/forms/Field/Selection/Selection.js +14 -6
  357. package/extensions/forms/Field/Selection/Selection.js.map +1 -1
  358. package/extensions/forms/Field/Selection/SelectionDocs.js +5 -0
  359. package/extensions/forms/Field/Selection/SelectionDocs.js.map +1 -1
  360. package/extensions/forms/Field/String/StringDocs.js +6 -1
  361. package/extensions/forms/Field/String/StringDocs.js.map +1 -1
  362. package/extensions/forms/Field/Toggle/Toggle.d.ts +3 -0
  363. package/extensions/forms/Field/Toggle/Toggle.js +6 -1
  364. package/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
  365. package/extensions/forms/Field/Toggle/ToggleDocs.js +5 -0
  366. package/extensions/forms/Field/Toggle/ToggleDocs.js.map +1 -1
  367. package/extensions/forms/Form/Visibility/Visibility.d.ts +1 -1
  368. package/extensions/forms/Form/Visibility/Visibility.js.map +1 -1
  369. package/extensions/forms/Form/Visibility/VisibilityDocs.js +1 -1
  370. package/extensions/forms/Form/Visibility/VisibilityDocs.js.map +1 -1
  371. package/extensions/forms/Iterate/PushContainer/PushContainer.js +7 -2
  372. package/extensions/forms/Iterate/PushContainer/PushContainer.js.map +1 -1
  373. package/extensions/forms/Value/Date/Date.d.ts +3 -2
  374. package/extensions/forms/Value/Date/Date.js.map +1 -1
  375. package/extensions/forms/Wizard/Container/WizardContainer.js +20 -8
  376. package/extensions/forms/Wizard/Container/WizardContainer.js.map +1 -1
  377. package/extensions/forms/Wizard/Context/WizardContext.d.ts +1 -0
  378. package/extensions/forms/Wizard/Context/WizardContext.js.map +1 -1
  379. package/extensions/forms/Wizard/Step/Step.d.ts +16 -1
  380. package/extensions/forms/Wizard/Step/Step.js +29 -10
  381. package/extensions/forms/Wizard/Step/Step.js.map +1 -1
  382. package/extensions/forms/Wizard/Step/StepDocs.js +18 -3
  383. package/extensions/forms/Wizard/Step/StepDocs.js.map +1 -1
  384. package/extensions/forms/constants/locales/en-GB.d.ts +6 -0
  385. package/extensions/forms/constants/locales/en-GB.js +7 -1
  386. package/extensions/forms/constants/locales/en-GB.js.map +1 -1
  387. package/extensions/forms/constants/locales/en-US.d.ts +6 -0
  388. package/extensions/forms/constants/locales/index.d.ts +12 -0
  389. package/extensions/forms/constants/locales/nb-NO.d.ts +6 -0
  390. package/extensions/forms/constants/locales/nb-NO.js +7 -1
  391. package/extensions/forms/constants/locales/nb-NO.js.map +1 -1
  392. package/extensions/forms/hooks/useFieldProps.js +8 -8
  393. package/extensions/forms/hooks/useFieldProps.js.map +1 -1
  394. package/extensions/forms/types.d.ts +1 -0
  395. package/extensions/forms/types.js.map +1 -1
  396. package/fragments/drawer-list/DrawerList.d.ts +6 -1
  397. package/package.json +1 -1
  398. package/shared/Eufemia.d.ts +1 -1
  399. package/shared/Eufemia.js +2 -2
  400. package/shared/Eufemia.js.map +1 -1
  401. package/style/core/scopes.scss +1 -1
  402. package/style/dnb-ui-basis.css +1 -1
  403. package/style/dnb-ui-basis.min.css +1 -1
  404. package/style/dnb-ui-body.css +1 -1
  405. package/style/dnb-ui-body.min.css +1 -1
  406. package/style/dnb-ui-core.css +1 -1
  407. package/style/dnb-ui-core.min.css +1 -1
  408. package/style/themes/theme-eiendom/eiendom-theme-basis.css +0 -2
  409. package/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
  410. package/style/themes/theme-eiendom/eiendom-theme-components.css +5 -7
  411. package/style/themes/theme-eiendom/eiendom-theme-components.min.css +1 -1
  412. package/style/themes/theme-sbanken/globals.scss +0 -4
  413. package/style/themes/theme-sbanken/sbanken-theme-basis.css +0 -2
  414. package/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
  415. package/style/themes/theme-sbanken/sbanken-theme-components.css +5 -7
  416. package/style/themes/theme-sbanken/sbanken-theme-components.min.css +1 -1
  417. package/style/themes/theme-ui/globals.scss +0 -4
  418. package/style/themes/theme-ui/ui-theme-basis.css +0 -2
  419. package/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
  420. package/style/themes/theme-ui/ui-theme-components.css +5 -7
  421. package/style/themes/theme-ui/ui-theme-components.min.css +1 -1
  422. package/umd/dnb-ui-basis.min.js +1 -1
  423. package/umd/dnb-ui-components.min.js +1 -1
  424. package/umd/dnb-ui-elements.min.js +1 -1
  425. package/umd/dnb-ui-extensions.min.js +3 -3
  426. package/umd/dnb-ui-lib.min.js +1 -1
@@ -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","elementRef","stepElementRef","preventNextStepRef","stepsRef","tmpStepsRef","updateTitlesRef","prerenderFieldPropsRef","sharedStateRef","current","undefined","preventNavigation","shouldPrevent","arguments","length","getStepChangeOptions","index","_stepsRef$current$ind","previousIndex","options","previousStep","_stepsRef$current$pre","previousId","Object","assign","callOnStepChange","setFocus","scrollToTop","isInteractionRef","executeLayoutAnimationRef","handleLayoutEffect","handleStepChange","_ref","skipErrorCheck","skipStepChangeCall","skipStepChangeCallBeforeMounted","skipStepChangeCallFromHook","skipFieldValidation","enableAsyncBehavior","onSubmit","_sharedStateRef$curre","_sharedStateRef$curre2","_sharedStateRef$curre3","data","call","result","Boolean","Error","setActiveIndex","_objectSpread","handlePrevious","handleNext","handleChange","_ref2","current_step","setFormError","error","handleSubmit","_ref3","preventSubmit","setHandleSubmit","check","activeIndex","providerValue","extend","_updateTitlesRef$curr","stepsLengthDidChange","count","keys","tmpCount","_executeLayoutAnimati","createElement","_extends","Provider","value","innerRef","DisplaySteps","IterateOverSteps","PrerenderFieldPropsOfOtherSteps","_ref4","sidebar_id","Sidebar","bottom","values","map","_ref5","title","no_animation","on_change","_ref6","incrementIndex","childrenArray","Children","child","isValidElement","_child","_child2","step","type","_step","apply","active","activeWhen","visibleWhen","key","clone","cloneElement","document","_ref7","hasRenderedRef","WizardPortal","PrerenderFieldPropsProvider","hidden","Fn","i","_ref8","createPortal","body","_ref9","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 | number>>({})\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(Boolean(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 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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emo","ReactDOM","classnames","Space","StepIndicator","convertJsxToString","warn","isAsync","useId","Step","handleDeprecatedProps","handleDeprecatedStepProps","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","arguments","length","getStepChangeOptions","index","_stepsRef$current$ind","previousIndex","options","previousStep","_stepsRef$current$pre","previousId","Object","assign","callOnStepChange","setFocus","scrollToTop","isInteractionRef","executeLayoutAnimationRef","handleLayoutEffect","handleStepChange","_ref","skipErrorCheck","skipStepChangeCall","skipStepChangeCallBeforeMounted","skipStepChangeCallFromHook","skipFieldValidation","enableAsyncBehavior","onSubmit","_sharedStateRef$curre","_sharedStateRef$curre2","_sharedStateRef$curre3","data","call","result","Boolean","Error","setActiveIndex","_objectSpread","handlePrevious","handleNext","handleChange","_ref2","current_step","setFormError","error","handleSubmit","_ref3","preventSubmit","setHandleSubmit","check","activeIndex","providerValue","extend","_updateTitlesRef$curr","stepsLengthDidChange","count","keys","tmpCount","_executeLayoutAnimati","createElement","_extends","Provider","value","innerRef","DisplaySteps","IterateOverSteps","PrerenderFieldPropsOfOtherSteps","_ref4","sidebar_id","Sidebar","bottom","values","map","_ref5","title","inactive","no_animation","on_change","_ref6","incrementIndex","childrenArray","Children","child","isValidElement","_child","_child2","step","type","_step","apply","include","includeWhen","visibleWhen","key","clone","cloneElement","document","_ref7","hasRenderedRef","WizardPortal","PrerenderFieldPropsProvider","hidden","Fn","i","_ref8","createPortal","body","_ref9","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, {\n Props as StepProps,\n handleDeprecatedProps as handleDeprecatedStepProps,\n} 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 | number>>({})\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(Boolean(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 includeWhen)\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(\n ({ title, inactive }) => ({ title, inactive })\n )}\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 const { title, inactive, include, includeWhen, id } =\n handleDeprecatedStepProps(child.props)\n\n if (include === false) {\n return null\n }\n\n if (\n includeWhen &&\n !check({\n visibleWhen: includeWhen,\n })\n ) {\n return null\n }\n\n incrementIndex++\n const index = incrementIndex\n\n stepsRef.current[index] = {\n id,\n title:\n title !== undefined\n ? convertJsxToString(title)\n : 'Title missing',\n inactive,\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 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,IAETC,qBAAqB,IAAIC,yBAAyB,QAC7C,SAAS;AAChB,OAAOC,aAAa,MAQb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A;IAAQe,KAAK,EAAC,kBAAkB;IAAC2B,MAAM;EAAA,GACpC1F,MAAM,CAAC4D,MAAM,CAAC5E,sBAAsB,CAACE,OAAO,CAAC,CAAC2E,GAAG,CAAC,CAAC8B,EAAE,EAAEC,CAAC,KACvD9K,KAAA,CAAAkI,aAAA,CAAC2C,EAAE;IAACT,GAAG,EAAEU;EAAE,CAAE,CACd,CACK,CACmB,CACjB,CAAC;AAEnB;AAEA,SAASJ,YAAYA,CAAAK,KAAA,EAAe;EAAA,IAAd;IAAEvI;EAAS,CAAC,GAAAuI,KAAA;EAChC,IAAI,OAAOR,QAAQ,KAAK,WAAW,EAAE;IACnC,OAAOjK,QAAQ,CAAC0K,YAAY,CAACxI,QAAQ,EAAE+H,QAAQ,CAACU,IAAI,CAAC;EACvD;AACF;AAEA,SAASN,2BAA2BA,CAAAO,KAAA,EAAe;EAAA,IAAd;IAAE1I;EAAS,CAAC,GAAA0I,KAAA;EAC/C,MAAM;IAAE5E,IAAI;IAAE6E,iBAAiB;IAAEC;EAAgB,CAAC,GAChDnL,UAAU,CAACiB,WAAW,CAAC;EAEzB,OACElB,KAAA,CAAAkI,aAAA,CAAChH,WAAW,CAACkH,QAAQ;IACnBC,KAAK,EAAAzB,aAAA,CAAAA,aAAA,KACAzF,mBAAmB;MAGtBmF,IAAI;MACJ6E,iBAAiB;MACjBC,eAAe;MACf1I,mBAAmB,EAAE,IAAI;MACzBO,UAAU,EAAE;IAAI;EAChB,GAEFjD,KAAA,CAAAkI,aAAA,CAACjH,aAAa,CAACmH,QAAQ;IAACC,KAAK,EAAE;MAAE3F,mBAAmB,EAAE;IAAK;EAAE,GAC1DF,QACqB,CACJ,CAAC;AAE3B;AAEAX,eAAe,CAACwJ,qBAAqB,GAAG,IAAI;AAE5C,eAAexJ,eAAe"}
@@ -15,6 +15,7 @@ export type StepIndex = number;
15
15
  export type Steps = Record<string, {
16
16
  title: string;
17
17
  id: string;
18
+ inactive?: boolean;
18
19
  }>;
19
20
  export type SetActiveIndexOptions = {
20
21
  skipStepChangeCall?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"WizardContext.js","names":["React","WizardContext","createContext","undefined"],"sources":["../../../../../../src/extensions/forms/Wizard/Context/WizardContext.ts"],"sourcesContent":["import React from 'react'\nimport { EventReturnWithStateObject } from '../../types'\nimport { VisibleWhen } from '../../Form/Visibility'\n\nexport type OnStepsChangeMode = 'previous' | 'next' | 'stepListModified'\nexport type OnStepChangeOptions = {\n preventNavigation: (shouldPrevent?: boolean) => void\n id?: string\n previousStep: {\n index: StepIndex\n id?: string\n }\n}\nexport type OnStepChange = (\n index: StepIndex,\n mode: OnStepsChangeMode,\n options: OnStepChangeOptions\n) =>\n | EventReturnWithStateObject\n | void\n | Promise<EventReturnWithStateObject | void>\n\nexport type StepIndex = number\nexport type Steps = Record<string, { title: string; id: string }>\nexport type SetActiveIndexOptions = {\n skipStepChangeCall?: boolean\n skipStepChangeCallBeforeMounted?: boolean\n skipStepChangeCallFromHook?: boolean\n skipErrorCheck?: boolean\n}\nexport interface WizardContextState {\n id?: string\n totalSteps?: number\n activeIndex?: StepIndex\n stepElementRef?: React.MutableRefObject<HTMLElement>\n stepsRef?: React.MutableRefObject<Steps>\n updateTitlesRef?: React.MutableRefObject<() => void>\n activeIndexRef?: React.MutableRefObject<StepIndex>\n totalStepsRef?: React.MutableRefObject<number>\n prerenderFieldPropsRef?: React.MutableRefObject<\n Record<string, () => React.ReactElement>\n >\n prerenderFieldProps?: boolean\n handlePrevious?: () => void\n handleNext?: () => void\n setActiveIndex?: (\n index: StepIndex,\n {\n skipStepChangeCall,\n skipStepChangeCallBeforeMounted,\n skipStepChangeCallFromHook,\n }?: SetActiveIndexOptions\n ) => void\n setFormError?: (error: Error) => void\n check?: ({ visibleWhen }: { visibleWhen: VisibleWhen }) => boolean\n}\n\nconst WizardContext = React.createContext<WizardContextState | undefined>(\n undefined\n)\n\nexport default WizardContext\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAyDzB,MAAMC,aAAa,GAAGD,KAAK,CAACE,aAAa,CACvCC,SACF,CAAC;AAED,eAAeF,aAAa"}
1
+ {"version":3,"file":"WizardContext.js","names":["React","WizardContext","createContext","undefined"],"sources":["../../../../../../src/extensions/forms/Wizard/Context/WizardContext.ts"],"sourcesContent":["import React from 'react'\nimport { EventReturnWithStateObject } from '../../types'\nimport { VisibleWhen } from '../../Form/Visibility'\n\nexport type OnStepsChangeMode = 'previous' | 'next' | 'stepListModified'\nexport type OnStepChangeOptions = {\n preventNavigation: (shouldPrevent?: boolean) => void\n id?: string\n previousStep: {\n index: StepIndex\n id?: string\n }\n}\nexport type OnStepChange = (\n index: StepIndex,\n mode: OnStepsChangeMode,\n options: OnStepChangeOptions\n) =>\n | EventReturnWithStateObject\n | void\n | Promise<EventReturnWithStateObject | void>\n\nexport type StepIndex = number\nexport type Steps = Record<\n string,\n { title: string; id: string; inactive?: boolean }\n>\nexport type SetActiveIndexOptions = {\n skipStepChangeCall?: boolean\n skipStepChangeCallBeforeMounted?: boolean\n skipStepChangeCallFromHook?: boolean\n skipErrorCheck?: boolean\n}\nexport interface WizardContextState {\n id?: string\n totalSteps?: number\n activeIndex?: StepIndex\n stepElementRef?: React.MutableRefObject<HTMLElement>\n stepsRef?: React.MutableRefObject<Steps>\n updateTitlesRef?: React.MutableRefObject<() => void>\n activeIndexRef?: React.MutableRefObject<StepIndex>\n totalStepsRef?: React.MutableRefObject<number>\n prerenderFieldPropsRef?: React.MutableRefObject<\n Record<string, () => React.ReactElement>\n >\n prerenderFieldProps?: boolean\n handlePrevious?: () => void\n handleNext?: () => void\n setActiveIndex?: (\n index: StepIndex,\n {\n skipStepChangeCall,\n skipStepChangeCallBeforeMounted,\n skipStepChangeCallFromHook,\n }?: SetActiveIndexOptions\n ) => void\n setFormError?: (error: Error) => void\n check?: ({ visibleWhen }: { visibleWhen: VisibleWhen }) => boolean\n}\n\nconst WizardContext = React.createContext<WizardContextState | undefined>(\n undefined\n)\n\nexport default WizardContext\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AA4DzB,MAAMC,aAAa,GAAGD,KAAK,CAACE,aAAa,CACvCC,SACF,CAAC;AAED,eAAeF,aAAa"}
@@ -7,6 +7,10 @@ export type Props = ComponentProps & FlexContainerProps & {
7
7
  * A title that will be displayed in the indicator.
8
8
  */
9
9
  title?: React.ReactNode;
10
+ /**
11
+ * Will treat the step as non-navigable if set to `true`.
12
+ */
13
+ inactive?: boolean;
10
14
  /**
11
15
  * To determine if the step should be rendered.
12
16
  * Used internally by the WizardContainer.
@@ -18,18 +22,29 @@ export type Props = ComponentProps & FlexContainerProps & {
18
22
  required?: boolean;
19
23
  /**
20
24
  * If set to `false`, the step will not be rendered.
25
+ * @deprecated use `include` instead
21
26
  */
22
27
  active?: boolean;
23
28
  /**
24
- * Provide a `path` and a `hasValue` property with the excepted value in order to enable the step. You can alternatively provide a `hasValue` function that returns a boolean. The first parameter is the value of the path.
29
+ * Provide a `path` and a `hasValue` property with the expected value in order to enable the step. You can alternatively provide a `hasValue` function that returns a boolean. The first parameter is the value of the path.
30
+ * @deprecated use `includeWhen` instead
25
31
  */
26
32
  activeWhen?: VisibleWhen;
33
+ /**
34
+ * If set to `false`, the step will not be rendered.
35
+ */
36
+ include?: boolean;
37
+ /**
38
+ * Provide a `path` and a `hasValue` property with the expected value in order to enable the step. You can alternatively provide a `hasValue` function that returns a boolean. The first parameter is the value of the path.
39
+ */
40
+ includeWhen?: VisibleWhen;
27
41
  /**
28
42
  * If set to `true`, the step will always be rendered.
29
43
  * For internal use only.
30
44
  */
31
45
  prerenderFieldProps?: boolean;
32
46
  };
47
+ export declare function handleDeprecatedProps({ active, activeWhen, include, includeWhen, ...rest }: Props): Omit<Props, 'active' | 'activeWhen'>;
33
48
  declare function Step(props: Props): JSX.Element;
34
49
  declare namespace Step {
35
50
  var _supportsSpacingProps: boolean;
@@ -1,8 +1,12 @@
1
1
  "use client";
2
2
 
3
3
  import _extends from "@babel/runtime/helpers/esm/extends";
4
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
4
5
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- const _excluded = ["className", "title", "index", "active", "activeWhen", "required", "prerenderFieldProps", "children"];
6
+ const _excluded = ["active", "activeWhen", "include", "includeWhen"],
7
+ _excluded2 = ["className", "title", "inactive", "index", "include", "includeWhen", "required", "prerenderFieldProps", "children"];
8
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
9
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
10
  import React, { useContext, useMemo, useRef } from 'react';
7
11
  import classnames from 'classnames';
8
12
  import WizardContext from '../Context/WizardContext';
@@ -10,18 +14,33 @@ import Flex from '../../../../components/flex/Flex';
10
14
  import { convertJsxToString } from '../../../../shared/component-helper';
11
15
  import FieldProvider from '../../Field/Provider';
12
16
  const useLayoutEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;
17
+ export function handleDeprecatedProps(_ref) {
18
+ let {
19
+ active,
20
+ activeWhen,
21
+ include,
22
+ includeWhen
23
+ } = _ref,
24
+ rest = _objectWithoutProperties(_ref, _excluded);
25
+ return _objectSpread({
26
+ include: include !== null && include !== void 0 ? include : active,
27
+ includeWhen: includeWhen !== null && includeWhen !== void 0 ? includeWhen : activeWhen
28
+ }, rest);
29
+ }
13
30
  function Step(props) {
14
- const {
31
+ const _handleDeprecatedProp = handleDeprecatedProps(props),
32
+ {
15
33
  className,
16
34
  title,
35
+ inactive,
17
36
  index,
18
- active = true,
19
- activeWhen,
37
+ include = true,
38
+ includeWhen,
20
39
  required,
21
40
  prerenderFieldProps,
22
41
  children
23
- } = props,
24
- restProps = _objectWithoutProperties(props, _excluded);
42
+ } = _handleDeprecatedProp,
43
+ restProps = _objectWithoutProperties(_handleDeprecatedProp, _excluded2);
25
44
  const {
26
45
  check,
27
46
  activeIndex,
@@ -29,8 +48,8 @@ function Step(props) {
29
48
  stepElementRef
30
49
  } = useContext(WizardContext) || {};
31
50
  const ariaLabel = useMemo(() => {
32
- var _ref, _stepsRef$current, _stepsRef$current$ind, _stepsRef$current2;
33
- return (_ref = !prerenderFieldProps && ((stepsRef === null || stepsRef === void 0 ? void 0 : (_stepsRef$current = stepsRef.current) === null || _stepsRef$current === void 0 ? void 0 : (_stepsRef$current$ind = _stepsRef$current[index]) === null || _stepsRef$current$ind === void 0 ? void 0 : _stepsRef$current$ind.title) || (stepsRef === null || stepsRef === void 0 ? void 0 : (_stepsRef$current2 = stepsRef.current) === null || _stepsRef$current2 === void 0 ? void 0 : _stepsRef$current2[index]))) !== null && _ref !== void 0 ? _ref : convertJsxToString(title);
51
+ var _ref2, _stepsRef$current, _stepsRef$current$ind, _stepsRef$current2;
52
+ return (_ref2 = !prerenderFieldProps && ((stepsRef === null || stepsRef === void 0 ? void 0 : (_stepsRef$current = stepsRef.current) === null || _stepsRef$current === void 0 ? void 0 : (_stepsRef$current$ind = _stepsRef$current[index]) === null || _stepsRef$current$ind === void 0 ? void 0 : _stepsRef$current$ind.title) || (stepsRef === null || stepsRef === void 0 ? void 0 : (_stepsRef$current2 = stepsRef.current) === null || _stepsRef$current2 === void 0 ? void 0 : _stepsRef$current2[index]))) !== null && _ref2 !== void 0 ? _ref2 : convertJsxToString(title);
34
53
  }, [index, prerenderFieldProps, title, stepsRef]);
35
54
  const currentElementRef = useRef();
36
55
  useLayoutEffect(() => {
@@ -46,8 +65,8 @@ function Step(props) {
46
65
  if (prerenderFieldProps) {
47
66
  return children;
48
67
  }
49
- if (activeIndex !== index || active === false || activeWhen && !check({
50
- visibleWhen: activeWhen
68
+ if (activeIndex !== index || include === false || includeWhen && !check({
69
+ visibleWhen: includeWhen
51
70
  })) {
52
71
  return React.createElement(React.Fragment, null);
53
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Step.js","names":["React","useContext","useMemo","useRef","classnames","WizardContext","Flex","convertJsxToString","FieldProvider","useLayoutEffect","window","useEffect","Step","props","className","title","index","active","activeWhen","required","prerenderFieldProps","children","restProps","_objectWithoutProperties","_excluded","check","activeIndex","stepsRef","stepElementRef","ariaLabel","_ref","_stepsRef$current","_stepsRef$current$ind","_stepsRef$current2","current","currentElementRef","visibleWhen","createElement","Fragment","fieldProps","undefined","Stack","_extends","element","innerRef","tabIndex","_supportsSpacingProps"],"sources":["../../../../../../src/extensions/forms/Wizard/Step/Step.tsx"],"sourcesContent":["import React, { useContext, useMemo, useRef } from 'react'\nimport classnames from 'classnames'\nimport { ComponentProps } from '../../types'\nimport { Props as FlexContainerProps } from '../../../../components/flex/Container'\nimport WizardContext from '../Context/WizardContext'\nimport Flex from '../../../../components/flex/Flex'\nimport { convertJsxToString } from '../../../../shared/component-helper'\nimport FieldProvider from '../../Field/Provider'\nimport type { VisibleWhen } from '../../Form/Visibility'\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 FlexContainerProps & {\n /**\n * A title that will be displayed in the indicator.\n */\n title?: React.ReactNode\n\n /**\n * To determine if the step should be rendered.\n * Used internally by the WizardContainer.\n */\n index?: number\n\n /**\n * Will make all the fields inside the step to be required.\n */\n required?: boolean\n\n /**\n * If set to `false`, the step will not be rendered.\n */\n active?: boolean\n\n /**\n * Provide a `path` and a `hasValue` property with the excepted value in order to enable the step. You can alternatively provide a `hasValue` function that returns a boolean. The first parameter is the value of the path.\n */\n activeWhen?: VisibleWhen\n\n /**\n * If set to `true`, the step will always be rendered.\n * For internal use only.\n */\n prerenderFieldProps?: boolean\n }\n\nfunction Step(props: Props): JSX.Element {\n const {\n className,\n title,\n index,\n active = true,\n activeWhen,\n required,\n prerenderFieldProps,\n children,\n ...restProps\n } = props\n const { check, activeIndex, stepsRef, stepElementRef } =\n useContext(WizardContext) || {}\n\n const ariaLabel = useMemo(() => {\n return (\n (!prerenderFieldProps &&\n (stepsRef?.current?.[index]?.title ||\n stepsRef?.current?.[index])) ??\n convertJsxToString(title)\n )\n }, [index, prerenderFieldProps, title, stepsRef])\n\n const currentElementRef = useRef<HTMLElement>()\n useLayoutEffect(() => {\n if (!prerenderFieldProps && typeof stepElementRef !== 'undefined') {\n if (currentElementRef.current) {\n stepElementRef.current = currentElementRef.current\n }\n return () => {\n stepElementRef.current = null\n }\n }\n }, [prerenderFieldProps, stepElementRef])\n\n if (prerenderFieldProps) {\n return children as JSX.Element\n }\n\n if (\n activeIndex !== index ||\n active === false ||\n (activeWhen && !check({ visibleWhen: activeWhen }))\n ) {\n // Another step is active\n return <></>\n }\n\n const fieldProps =\n typeof required === 'boolean' ? { required } : undefined\n\n return (\n <Flex.Stack\n className={classnames('dnb-forms-step', className)}\n element=\"section\"\n aria-label={ariaLabel}\n innerRef={currentElementRef}\n tabIndex={-1}\n {...restProps}\n >\n {fieldProps ? (\n <FieldProvider {...fieldProps}>{children}</FieldProvider>\n ) : (\n children\n )}\n </Flex.Stack>\n )\n}\n\nStep._supportsSpacingProps = true\nexport default Step\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC1D,OAAOC,UAAU,MAAM,YAAY;AAGnC,OAAOC,aAAa,MAAM,0BAA0B;AACpD,OAAOC,IAAI,MAAM,kCAAkC;AACnD,SAASC,kBAAkB,QAA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AAI,OAAOQ,cAAc,KAAK,WAAW,EAAE;MACjE,IAAIO,iBAAiB,CAACD,OAAO,EAAE;QAC7BN,cAAc,CAACM,OAAO,GAAGC,iBAAiB,CAACD,OAAO;MACpD;MACA,OAAO,MAAM;QACXN,cAAc,CAACM,OAAO,GAAG,IAAI;MAC/B,CAAC;IACH;EACF,CAAC,EAAE,CAACd,mBAAmB,EAAEQ,cAAc,CAAC,CAAC;EAEzC,IAAIR,mBAAmB,EAAE;IACvB,OAAOC,QAAQ;EACjB;EAEA,IACEK,WAAW,KAAKV,KAAK,IACrBC,MAAM,KAAK,KAAK,IACfC,UAAU,IAAI,CAACO,KAAK,CAAC;IAAEW,WAAW,EAAElB;EAAW,CAAC,CAAE,EACnD;IAEA,OAAOlB,KAAA,CAAAqC,aAAA,CAAArC,KAAA,CAAAsC,QAAA,MAAI,CAAC;EACd;EAEA,MAAMC,UAAU,GACd,OAAOpB,QAAQ,KAAK,SAAS,GAAG;IAAEA;EAAS,CAAC,GAAGqB,SAAS;EAE1D,OACExC,KAAA,CAAAqC,aAAA,CAAC/B,IAAI,CAACmC,KAAK,EAAAC,QAAA;IACT5B,SAAS,EAAEV,UAAU,CAAC,gBAAgB,EAAEU,SAAS,CAAE;IACnD6B,OAAO,EAAC,SAAS;IACjB,cAAYd,SAAU;IACtBe,QAAQ,EAAET,iBAAkB;IAC5BU,QAAQ,EAAE,CAAC;EAAE,GACTvB,SAAS,GAEZiB,UAAU,GACTvC,KAAA,CAAAqC,aAAA,CAAC7B,aAAa,EAAK+B,UAAU,EAAGlB,QAAwB,CAAC,GAEzDA,QAEQ,CAAC;AAEjB;AAEAT,IAAI,CAACkC,qBAAqB,GAAG,IAAI;AACjC,eAAelC,IAAI"}
1
+ {"version":3,"file":"Step.js","names":["React","useContext","useMemo","useRef","classnames","WizardContext","Flex","convertJsxToString","FieldProvider","useLayoutEffect","window","useEffect","handleDeprecatedProps","_ref","active","activeWhen","include","includeWhen","rest","_objectWithoutProperties","_excluded","_objectSpread","Step","props","_handleDeprecatedProp","className","title","inactive","index","required","prerenderFieldProps","children","restProps","_excluded2","check","activeIndex","stepsRef","stepElementRef","ariaLabel","_ref2","_stepsRef$current","_stepsRef$current$ind","_stepsRef$current2","current","currentElementRef","visibleWhen","createElement","Fragment","fieldProps","undefined","Stack","_extends","element","innerRef","tabIndex","_supportsSpacingProps"],"sources":["../../../../../../src/extensions/forms/Wizard/Step/Step.tsx"],"sourcesContent":["import React, { useContext, useMemo, useRef } from 'react'\nimport classnames from 'classnames'\nimport { ComponentProps } from '../../types'\nimport { Props as FlexContainerProps } from '../../../../components/flex/Container'\nimport WizardContext from '../Context/WizardContext'\nimport Flex from '../../../../components/flex/Flex'\nimport { convertJsxToString } from '../../../../shared/component-helper'\nimport FieldProvider from '../../Field/Provider'\nimport type { VisibleWhen } from '../../Form/Visibility'\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 FlexContainerProps & {\n /**\n * A title that will be displayed in the indicator.\n */\n title?: React.ReactNode\n /**\n * Will treat the step as non-navigable if set to `true`.\n */\n inactive?: boolean\n\n /**\n * To determine if the step should be rendered.\n * Used internally by the WizardContainer.\n */\n index?: number\n\n /**\n * Will make all the fields inside the step to be required.\n */\n required?: boolean\n\n /**\n * If set to `false`, the step will not be rendered.\n * @deprecated use `include` instead\n */\n active?: boolean\n\n /**\n * Provide a `path` and a `hasValue` property with the expected value in order to enable the step. You can alternatively provide a `hasValue` function that returns a boolean. The first parameter is the value of the path.\n * @deprecated use `includeWhen` instead\n */\n activeWhen?: VisibleWhen\n\n /**\n * If set to `false`, the step will not be rendered.\n */\n\n include?: boolean\n /**\n * Provide a `path` and a `hasValue` property with the expected value in order to enable the step. You can alternatively provide a `hasValue` function that returns a boolean. The first parameter is the value of the path.\n */\n includeWhen?: VisibleWhen\n\n /**\n * If set to `true`, the step will always be rendered.\n * For internal use only.\n */\n prerenderFieldProps?: boolean\n }\n\nexport function handleDeprecatedProps({\n active,\n activeWhen,\n include,\n includeWhen,\n ...rest\n}: Props): Omit<Props, 'active' | 'activeWhen'> {\n return {\n include: include ?? active,\n includeWhen: includeWhen ?? activeWhen,\n ...rest,\n }\n}\nfunction Step(props: Props): JSX.Element {\n const {\n className,\n title,\n inactive,\n index,\n include = true,\n includeWhen,\n required,\n prerenderFieldProps,\n children,\n ...restProps\n } = handleDeprecatedProps(props)\n const { check, activeIndex, stepsRef, stepElementRef } =\n useContext(WizardContext) || {}\n\n const ariaLabel = useMemo(() => {\n return (\n (!prerenderFieldProps &&\n (stepsRef?.current?.[index]?.title ||\n stepsRef?.current?.[index])) ??\n convertJsxToString(title)\n )\n }, [index, prerenderFieldProps, title, stepsRef])\n\n const currentElementRef = useRef<HTMLElement>()\n useLayoutEffect(() => {\n if (!prerenderFieldProps && typeof stepElementRef !== 'undefined') {\n if (currentElementRef.current) {\n stepElementRef.current = currentElementRef.current\n }\n return () => {\n stepElementRef.current = null\n }\n }\n }, [prerenderFieldProps, stepElementRef])\n\n if (prerenderFieldProps) {\n return children as JSX.Element\n }\n\n if (\n activeIndex !== index ||\n include === false ||\n (includeWhen && !check({ visibleWhen: includeWhen }))\n ) {\n // Another step is active\n return <></>\n }\n\n const fieldProps =\n typeof required === 'boolean' ? { required } : undefined\n\n return (\n <Flex.Stack\n className={classnames('dnb-forms-step', className)}\n element=\"section\"\n aria-label={ariaLabel}\n innerRef={currentElementRef}\n tabIndex={-1}\n {...restProps}\n >\n {fieldProps ? (\n <FieldProvider {...fieldProps}>{children}</FieldProvider>\n ) : (\n children\n )}\n </Flex.Stack>\n )\n}\n\nStep._supportsSpacingProps = true\nexport default Step\n"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AAC1D,OAAOC,UAAU,MAAM,YAAY;AAGnC,OAAOC,aAAa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AAC,gBAAgB,EAAEqB,SAAS,CAAE;IACnD2B,OAAO,EAAC,SAAS;IACjB,cAAYd,SAAU;IACtBe,QAAQ,EAAET,iBAAkB;IAC5BU,QAAQ,EAAE,CAAC;EAAE,GACTtB,SAAS,GAEZgB,UAAU,GACThD,KAAA,CAAA8C,aAAA,CAACtC,aAAa,EAAKwC,UAAU,EAAGjB,QAAwB,CAAC,GAEzDA,QAEQ,CAAC;AAEjB;AAEAT,IAAI,CAACiC,qBAAqB,GAAG,IAAI;AACjC,eAAejC,IAAI"}
@@ -4,18 +4,23 @@ export const StepProperties = {
4
4
  type: 'React.Node',
5
5
  status: 'optional'
6
6
  },
7
+ inactive: {
8
+ doc: 'Will treat the step as non-navigable if set to `true`.',
9
+ type: 'boolean',
10
+ status: 'optional'
11
+ },
7
12
  required: {
8
13
  doc: 'Will make all nested form fields required.',
9
14
  type: 'boolean',
10
15
  status: 'optional'
11
16
  },
12
- active: {
17
+ include: {
13
18
  doc: 'If set to `false`, the step will not be rendered.',
14
19
  type: 'boolean',
15
20
  status: 'optional'
16
21
  },
17
- activeWhen: {
18
- doc: 'Provide a `path` and a `hasValue` property with the excepted value in order to enable the step. You can alternatively provide a `hasValue` function that returns a boolean. The first parameter is the value of the path.',
22
+ includeWhen: {
23
+ doc: 'Provide a `path` and a `hasValue` property with the expected value in order to enable the step. You can alternatively provide a `hasValue` function that returns a boolean. The first parameter is the value of the path.',
19
24
  type: 'object',
20
25
  status: 'optional'
21
26
  },
@@ -33,6 +38,16 @@ export const StepProperties = {
33
38
  doc: 'Spacing properties like `top` or `bottom` are supported.',
34
39
  type: ['string', 'object'],
35
40
  status: 'optional'
41
+ },
42
+ active: {
43
+ doc: 'Deprecated, use `include`. Old docs: If set to `false`, the step will not be rendered.',
44
+ type: 'boolean',
45
+ status: 'deprecated'
46
+ },
47
+ activeWhen: {
48
+ doc: 'Deprecated, use `includeWhen`. Old docs: Provide a `path` and a `hasValue` property with the expected value in order to enable the step. You can alternatively provide a `hasValue` function that returns a boolean. The first parameter is the value of the path.',
49
+ type: 'object',
50
+ status: 'deprecated'
36
51
  }
37
52
  };
38
53
  export const StepEvents = {};
@@ -1 +1 @@
1
- {"version":3,"file":"StepDocs.js","names":["StepProperties","title","doc","type","status","required","active","activeWhen","children","StepEvents"],"sources":["../../../../../../src/extensions/forms/Wizard/Step/StepDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../../../shared/types'\n\nexport const StepProperties: PropertiesTableProps = {\n title: {\n doc: 'Title of the step.',\n type: 'React.Node',\n status: 'optional',\n },\n required: {\n doc: 'Will make all nested form fields required.',\n type: 'boolean',\n status: 'optional',\n },\n active: {\n doc: 'If set to `false`, the step will not be rendered.',\n type: 'boolean',\n status: 'optional',\n },\n activeWhen: {\n doc: 'Provide a `path` and a `hasValue` property with the excepted value in order to enable the step. You can alternatively provide a `hasValue` function that returns a boolean. The first parameter is the value of the path.',\n type: 'object',\n status: 'optional',\n },\n children: {\n doc: 'Contents.',\n type: 'React.Node',\n status: 'required',\n },\n '[Flex.Container](/uilib/layout/flex/container/properties)': {\n doc: 'Flex.Container properties.',\n type: 'Various',\n status: 'optional',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n}\n\nexport const StepEvents: PropertiesTableProps = {}\n"],"mappings":"AAEA,OAAO,MAAMA,cAAoC,GAAG;EAClDC,KAAK,EAAE;IACLC,GAAG,EAAE,oBAAoB;IACzBC,IAAI,EAAE,YAAY;IAClBC,MAAM,EAAE;EACV,CAAC;EACDC,QAAQ,EAAE;IACRH,GAAG,EAAE,4CAA4C;IACjDC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDE,MAAM,EAAE;IACNJ,GAAG,EAAE,mDAAmD;IACxDC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDG,UAAU,EAAE;IACVL,GAAG,EAAE,2NAA2N;IAChOC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDI,QAAQ,EAAE;IACRN,GAAG,EAAE,WAAW;IAChBC,IAAI,EAAE,YAAY;IAClBC,MAAM,EAAE;EACV,CAAC;EACD,2DAA2D,EAAE;IAC3DF,GAAG,EAAE,4BAA4B;IACjCC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACD,yCAAyC,EAAE;IACzCF,GAAG,EAAE,0DAA0D;IAC/DC,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC1BC,MAAM,EAAE;EACV;AACF,CAAC;AAED,OAAO,MAAMK,UAAgC,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"StepDocs.js","names":["StepProperties","title","doc","type","status","inactive","required","include","includeWhen","children","active","activeWhen","StepEvents"],"sources":["../../../../../../src/extensions/forms/Wizard/Step/StepDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../../../shared/types'\n\nexport const StepProperties: PropertiesTableProps = {\n title: {\n doc: 'Title of the step.',\n type: 'React.Node',\n status: 'optional',\n },\n inactive: {\n doc: 'Will treat the step as non-navigable if set to `true`.',\n type: 'boolean',\n status: 'optional',\n },\n required: {\n doc: 'Will make all nested form fields required.',\n type: 'boolean',\n status: 'optional',\n },\n include: {\n doc: 'If set to `false`, the step will not be rendered.',\n type: 'boolean',\n status: 'optional',\n },\n includeWhen: {\n doc: 'Provide a `path` and a `hasValue` property with the expected value in order to enable the step. You can alternatively provide a `hasValue` function that returns a boolean. The first parameter is the value of the path.',\n type: 'object',\n status: 'optional',\n },\n children: {\n doc: 'Contents.',\n type: 'React.Node',\n status: 'required',\n },\n '[Flex.Container](/uilib/layout/flex/container/properties)': {\n doc: 'Flex.Container properties.',\n type: 'Various',\n status: 'optional',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n active: {\n doc: 'Deprecated, use `include`. Old docs: If set to `false`, the step will not be rendered.',\n type: 'boolean',\n status: 'deprecated',\n },\n activeWhen: {\n doc: 'Deprecated, use `includeWhen`. Old docs: Provide a `path` and a `hasValue` property with the expected value in order to enable the step. You can alternatively provide a `hasValue` function that returns a boolean. The first parameter is the value of the path.',\n type: 'object',\n status: 'deprecated',\n },\n}\n\nexport const StepEvents: PropertiesTableProps = {}\n"],"mappings":"AAEA,OAAO,MAAMA,cAAoC,GAAG;EAClDC,KAAK,EAAE;IACLC,GAAG,EAAE,oBAAoB;IACzBC,IAAI,EAAE,YAAY;IAClBC,MAAM,EAAE;EACV,CAAC;EACDC,QAAQ,EAAE;IACRH,GAAG,EAAE,wDAAwD;IAC7DC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDE,QAAQ,EAAE;IACRJ,GAAG,EAAE,4CAA4C;IACjDC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDG,OAAO,EAAE;IACPL,GAAG,EAAE,mDAAmD;IACxDC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDI,WAAW,EAAE;IACXN,GAAG,EAAE,2NAA2N;IAChOC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDK,QAAQ,EAAE;IACRP,GAAG,EAAE,WAAW;IAChBC,IAAI,EAAE,YAAY;IAClBC,MAAM,EAAE;EACV,CAAC;EACD,2DAA2D,EAAE;IAC3DF,GAAG,EAAE,4BAA4B;IACjCC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACD,yCAAyC,EAAE;IACzCF,GAAG,EAAE,0DAA0D;IAC/DC,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC1BC,MAAM,EAAE;EACV,CAAC;EACDM,MAAM,EAAE;IACNR,GAAG,EAAE,wFAAwF;IAC7FC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDO,UAAU,EAAE;IACVT,GAAG,EAAE,oQAAoQ;IACzQC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV;AACF,CAAC;AAED,OAAO,MAAMQ,UAAgC,GAAG,CAAC,CAAC"}
@@ -109,6 +109,12 @@ declare const _default: {
109
109
  Date: {
110
110
  label: string;
111
111
  errorRequired: string;
112
+ errorMinDate: string;
113
+ errorMaxDate: string;
114
+ errorStartDateMinDate: string;
115
+ errorStartDateMaxDate: string;
116
+ errorEndDateMinDate: string;
117
+ errorEndDateMaxDate: string;
112
118
  };
113
119
  Expiry: {
114
120
  label: string;
@@ -99,7 +99,13 @@ export default {
99
99
  },
100
100
  Date: {
101
101
  label: 'Date',
102
- errorRequired: 'You must provide a valid date.'
102
+ errorRequired: 'You must provide a valid date.',
103
+ errorMinDate: 'Chosen date cannot be before {date}.',
104
+ errorMaxDate: 'Chosen date cannot be after {date}.',
105
+ errorStartDateMinDate: 'Start date cannot be before {date}.',
106
+ errorStartDateMaxDate: 'Start date cannot be after {date}.',
107
+ errorEndDateMinDate: 'End date cannot be before {date}.',
108
+ errorEndDateMaxDate: 'End date cannot be after {date}.'
103
109
  },
104
110
  Expiry: {
105
111
  label: 'Expiry date',
@@ -1 +1 @@
1
- {"version":3,"file":"en-GB.js","names":["Field","errorSummaryTitle","stateSummary","errorSummary","errorRequired","errorPattern","optionalLabelSuffix","SubmitButton","text","sendText","SubmitIndicator","label","Isolation","commitButtonText","Step","summaryTitle","WizardEditButton","WizardPreviousButton","WizardNextButton","RemoveButton","confirmRemoveText","InfoOverlaySuccess","title","description","buttonText","InfoOverlayError","cancelButton","retryButton","retryingText","SectionViewContainer","editButton","SectionEditContainer","doneButton","errorInSection","IterateViewContainer","removeButton","IterateEditContainer","errorInContainer","IteratePushContainer","createButton","itemsLimitReached","StringField","errorMinLength","errorMaxLength","NumberField","errorMinimum","errorMaximum","errorExclusiveMinimum","errorExclusiveMaximum","errorMultipleOf","BooleanField","yes","no","ToggleField","PostalAddress","StreetAddress","Date","Expiry","errorMonth","errorYear","Email","FirstName","LastName","CompanyName","NationalIdentityNumber","errorFnr","errorFnrLength","errorDnr","errorDnrLength","errorMinimumAgeValidator","errorMinimumAgeValidatorLength","OrganizationNumber","errorOrgNo","errorOrgNoLength","BankAccountNumber","errorBankAccountNumber","errorBankAccountNumberLength","PhoneNumber","countryCodeLabel","warningRequired","PostalCodeAndCity","invalidCode","PostalCode","City","SelectCountry","placeholder","Password","ariaLabelShow","ariaLabelHide","Upload","errorInvalidFiles"],"sources":["../../../../../../src/extensions/forms/constants/locales/en-GB.ts"],"sourcesContent":["import nb from './nb-NO'\nexport default {\n 'en-GB': {\n /**\n * General\n */\n Field: {\n errorSummaryTitle: 'Please correct the following errors',\n stateSummary: 'Summary:',\n errorSummary: 'Please correct the following errors:',\n errorRequired: 'This field is required.',\n errorPattern: 'The value is invalid.',\n optionalLabelSuffix: '(optional)',\n },\n SubmitButton: {\n text: 'Send',\n sendText: 'Send',\n },\n SubmitIndicator: {\n label: 'Please wait',\n },\n Isolation: {\n commitButtonText: 'Add',\n },\n Step: {\n summaryTitle: 'Summary',\n },\n WizardEditButton: {\n text: 'Edit',\n },\n WizardPreviousButton: {\n text: 'Back',\n },\n WizardNextButton: {\n text: 'Next',\n },\n RemoveButton: {\n text: 'Remove',\n confirmRemoveText: 'Are you sure you want to delete this?',\n },\n InfoOverlaySuccess: {\n title: 'Thank you',\n description: 'We have received your information.',\n buttonText: 'Back to homepage',\n },\n InfoOverlayError: {\n title: 'Sorry, something went wrong',\n description: 'Please try again or contact us.',\n cancelButton: 'Back',\n retryButton: 'Try again',\n retryingText: 'Retrying...',\n },\n SectionViewContainer: {\n editButton: 'Edit',\n },\n SectionEditContainer: {\n doneButton: 'Done',\n cancelButton: 'Cancel',\n errorInSection: 'Please correct the errors above.',\n },\n IterateViewContainer: {\n removeButton: 'Remove',\n editButton: 'Edit',\n },\n IterateEditContainer: {\n removeButton: 'Remove',\n doneButton: 'Done',\n cancelButton: 'Cancel',\n errorInContainer: 'Please correct the errors above.',\n },\n IteratePushContainer: {\n createButton: 'Add',\n itemsLimitReached: 'You have reached the limit of: {limit}',\n },\n\n /**\n * Base fields\n */\n StringField: {\n errorMinLength:\n 'The value cannot be shorter than {minLength} characters.',\n errorMaxLength:\n 'The value cannot be longer than {maxLength} characters.',\n },\n NumberField: {\n errorMinimum: 'The value must be at least {minimum}.',\n errorMaximum: 'The value must be a maximum of {maximum}.',\n errorExclusiveMinimum:\n 'The value must be greater than {exclusiveMinimum}.',\n errorExclusiveMaximum:\n 'The value must be less than {exclusiveMaximum}.',\n errorMultipleOf: 'The value must be a multiple of {multipleOf}.',\n },\n BooleanField: {\n yes: 'Yes',\n no: 'No',\n },\n ToggleField: {\n yes: 'Yes',\n no: 'No',\n },\n\n /**\n * Feature fields\n */\n PostalAddress: {\n label: 'Postal address',\n errorRequired: 'You must enter a postal address.',\n errorPattern:\n 'Invalid postal address. Enter a valid postal address.',\n },\n StreetAddress: {\n label: 'Street address',\n errorRequired: 'You must enter a street address.',\n errorPattern:\n 'Invalid street address. Enter a valid street address.',\n },\n Date: {\n label: 'Date',\n errorRequired: 'You must provide a valid date.',\n },\n Expiry: {\n label: 'Expiry date',\n errorMonth: '{month} is not a valid month.',\n errorYear: '{year} is not a valid year.',\n },\n Email: {\n label: 'Email address',\n errorRequired: 'You must enter a Email address.',\n errorPattern: 'Invalid Email address. Enter a valid Email address.',\n },\n FirstName: {\n label: 'Given name',\n errorRequired: 'You must enter a given name (first name).',\n errorPattern:\n 'Enter a given name (first name) using only letters and characters such as hyphens and spaces.',\n },\n LastName: {\n label: 'Surname',\n errorRequired: 'You must enter a surname (last name).',\n errorPattern:\n 'Enter a surname (last name) using only letters and characters such as hyphens and spaces.',\n },\n CompanyName: {\n label: 'Company name',\n errorRequired: 'You must enter a company name.',\n },\n NationalIdentityNumber: {\n label: 'National identity number (11 digits)',\n errorRequired: 'You must enter a national identity number.',\n errorFnr: 'Invalid national identity number.',\n errorFnrLength:\n 'Invalid national identity number. Enter a valid national identity number with 11 digits.',\n errorDnr: 'Invalid D number.',\n errorDnrLength:\n 'Invalid D number. Enter a valid d-number with 11 digits.',\n errorMinimumAgeValidator: 'Must be at least {age} years of age.',\n errorMinimumAgeValidatorLength:\n 'Invalid birth of date. Enter a valid birth of date (incl. century digit) with 7 digits.',\n },\n OrganizationNumber: {\n label: 'Organisation number',\n errorRequired: 'You must enter an organisation number.',\n errorOrgNo: 'Invalid organisation number.',\n errorOrgNoLength:\n 'Invalid organisation number. Enter a valid organisation number with 9 digits.',\n },\n BankAccountNumber: {\n label: 'Bank account',\n errorRequired: 'You must enter an account number.',\n errorBankAccountNumber: 'Invalid account number.',\n errorBankAccountNumberLength:\n 'Invalid account number. Enter a valid organisation number with 11 digits.',\n },\n PhoneNumber: {\n label: 'Mobile number',\n countryCodeLabel: 'Country code',\n errorRequired:\n 'Mobile number must be filled in. If you don’t have a mobile number, you can enter another phone number.',\n warningRequired:\n 'You have not entered a mobile number. You can still use this number if it is correct.',\n },\n PostalCodeAndCity: {\n label: 'Postcode and city', // Use British English\n invalidCode: 'Invalid postal code.',\n },\n PostalCode: {\n label: 'Postc.',\n errorRequired: 'You must enter a postal code.',\n errorPattern: 'This is not a valid postal code (four-digits).',\n },\n City: {\n label: 'City',\n errorRequired: 'You must enter a city name.',\n errorPattern:\n 'City names can only contain letters and valid characters such as hyphens and spaces.',\n },\n SelectCountry: {\n label: 'Country',\n placeholder: 'Select country',\n errorRequired: 'You must select a country from the list.',\n },\n Password: {\n label: 'Password',\n ariaLabelShow: 'Show password',\n ariaLabelHide: 'Hide password',\n },\n Upload: {\n errorRequired: 'You must upload a file.',\n errorInvalidFiles: 'Remove all files that have errors.',\n },\n } satisfies (typeof nb)['nb-NO'],\n}\n"],"mappings":"AACA,eAAe;EACb,OAAO,EAAE;IAIPA,KAAK,EAAE;MACLC,iBAAiB,EAAE,qCAAqC;MACxDC,YAAY,EAAE,UAAU;MACxBC,YAAY,EAAE,sCAAsC;MACpDC,aAAa,E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itle","stateSummary","errorSummary","errorRequired","errorPattern","optionalLabelSuffix","SubmitButton","text","sendText","SubmitIndicator","label","Isolation","commitButtonText","Step","summaryTitle","WizardEditButton","WizardPreviousButton","WizardNextButton","RemoveButton","confirmRemoveText","InfoOverlaySuccess","title","description","buttonText","InfoOverlayError","cancelButton","retryButton","retryingText","SectionViewContainer","editButton","SectionEditContainer","doneButton","errorInSection","IterateViewContainer","removeButton","IterateEditContainer","errorInContainer","IteratePushContainer","createButton","itemsLimitReached","StringField","errorMinLength","errorMaxLength","NumberField","errorMinimum","errorMaximum","errorExclusiveMinimum","errorExclusiveMaximum","errorMultipleOf","BooleanField","yes","no","ToggleField","PostalAddress","StreetAddress","Date","errorMinDate","errorMaxDate","errorStartDateMinDate","errorStartDateMaxDate","errorEndDateMinDate","errorEndDateMaxDate","Expiry","errorMonth","errorYear","Email","FirstName","LastName","CompanyName","NationalIdentityNumber","errorFnr","errorFnrLength","errorDnr","errorDnrLength","errorMinimumAgeValidator","errorMinimumAgeValidatorLength","OrganizationNumber","errorOrgNo","errorOrgNoLength","BankAccountNumber","errorBankAccountNumber","errorBankAccountNumberLength","PhoneNumber","countryCodeLabel","warningRequired","PostalCodeAndCity","invalidCode","PostalCode","City","SelectCountry","placeholder","Password","ariaLabelShow","ariaLabelHide","Upload","errorInvalidFiles"],"sources":["../../../../../../src/extensions/forms/constants/locales/en-GB.ts"],"sourcesContent":["import nb from './nb-NO'\nexport default {\n 'en-GB': {\n /**\n * General\n */\n Field: {\n errorSummaryTitle: 'Please correct the following errors',\n stateSummary: 'Summary:',\n errorSummary: 'Please correct the following errors:',\n errorRequired: 'This field is required.',\n errorPattern: 'The value is invalid.',\n optionalLabelSuffix: '(optional)',\n },\n SubmitButton: {\n text: 'Send',\n sendText: 'Send',\n },\n SubmitIndicator: {\n label: 'Please wait',\n },\n Isolation: {\n commitButtonText: 'Add',\n },\n Step: {\n summaryTitle: 'Summary',\n },\n WizardEditButton: {\n text: 'Edit',\n },\n WizardPreviousButton: {\n text: 'Back',\n },\n WizardNextButton: {\n text: 'Next',\n },\n RemoveButton: {\n text: 'Remove',\n confirmRemoveText: 'Are you sure you want to delete this?',\n },\n InfoOverlaySuccess: {\n title: 'Thank you',\n description: 'We have received your information.',\n buttonText: 'Back to homepage',\n },\n InfoOverlayError: {\n title: 'Sorry, something went wrong',\n description: 'Please try again or contact us.',\n cancelButton: 'Back',\n retryButton: 'Try again',\n retryingText: 'Retrying...',\n },\n SectionViewContainer: {\n editButton: 'Edit',\n },\n SectionEditContainer: {\n doneButton: 'Done',\n cancelButton: 'Cancel',\n errorInSection: 'Please correct the errors above.',\n },\n IterateViewContainer: {\n removeButton: 'Remove',\n editButton: 'Edit',\n },\n IterateEditContainer: {\n removeButton: 'Remove',\n doneButton: 'Done',\n cancelButton: 'Cancel',\n errorInContainer: 'Please correct the errors above.',\n },\n IteratePushContainer: {\n createButton: 'Add',\n itemsLimitReached: 'You have reached the limit of: {limit}',\n },\n\n /**\n * Base fields\n */\n StringField: {\n errorMinLength:\n 'The value cannot be shorter than {minLength} characters.',\n errorMaxLength:\n 'The value cannot be longer than {maxLength} characters.',\n },\n NumberField: {\n errorMinimum: 'The value must be at least {minimum}.',\n errorMaximum: 'The value must be a maximum of {maximum}.',\n errorExclusiveMinimum:\n 'The value must be greater than {exclusiveMinimum}.',\n errorExclusiveMaximum:\n 'The value must be less than {exclusiveMaximum}.',\n errorMultipleOf: 'The value must be a multiple of {multipleOf}.',\n },\n BooleanField: {\n yes: 'Yes',\n no: 'No',\n },\n ToggleField: {\n yes: 'Yes',\n no: 'No',\n },\n\n /**\n * Feature fields\n */\n PostalAddress: {\n label: 'Postal address',\n errorRequired: 'You must enter a postal address.',\n errorPattern:\n 'Invalid postal address. Enter a valid postal address.',\n },\n StreetAddress: {\n label: 'Street address',\n errorRequired: 'You must enter a street address.',\n errorPattern:\n 'Invalid street address. Enter a valid street address.',\n },\n Date: {\n label: 'Date',\n errorRequired: 'You must provide a valid date.',\n errorMinDate: 'Chosen date cannot be before {date}.',\n errorMaxDate: 'Chosen date cannot be after {date}.',\n errorStartDateMinDate: 'Start date cannot be before {date}.',\n errorStartDateMaxDate: 'Start date cannot be after {date}.',\n errorEndDateMinDate: 'End date cannot be before {date}.',\n errorEndDateMaxDate: 'End date cannot be after {date}.',\n },\n Expiry: {\n label: 'Expiry date',\n errorMonth: '{month} is not a valid month.',\n errorYear: '{year} is not a valid year.',\n },\n Email: {\n label: 'Email address',\n errorRequired: 'You must enter a Email address.',\n errorPattern: 'Invalid Email address. Enter a valid Email address.',\n },\n FirstName: {\n label: 'Given name',\n errorRequired: 'You must enter a given name (first name).',\n errorPattern:\n 'Enter a given name (first name) using only letters and characters such as hyphens and spaces.',\n },\n LastName: {\n label: 'Surname',\n errorRequired: 'You must enter a surname (last name).',\n errorPattern:\n 'Enter a surname (last name) using only letters and characters such as hyphens and spaces.',\n },\n CompanyName: {\n label: 'Company name',\n errorRequired: 'You must enter a company name.',\n },\n NationalIdentityNumber: {\n label: 'National identity number (11 digits)',\n errorRequired: 'You must enter a national identity number.',\n errorFnr: 'Invalid national identity number.',\n errorFnrLength:\n 'Invalid national identity number. Enter a valid national identity number with 11 digits.',\n errorDnr: 'Invalid D number.',\n errorDnrLength:\n 'Invalid D number. Enter a valid d-number with 11 digits.',\n errorMinimumAgeValidator: 'Must be at least {age} years of age.',\n errorMinimumAgeValidatorLength:\n 'Invalid birth of date. Enter a valid birth of date (incl. century digit) with 7 digits.',\n },\n OrganizationNumber: {\n label: 'Organisation number',\n errorRequired: 'You must enter an organisation number.',\n errorOrgNo: 'Invalid organisation number.',\n errorOrgNoLength:\n 'Invalid organisation number. Enter a valid organisation number with 9 digits.',\n },\n BankAccountNumber: {\n label: 'Bank account',\n errorRequired: 'You must enter an account number.',\n errorBankAccountNumber: 'Invalid account number.',\n errorBankAccountNumberLength:\n 'Invalid account number. Enter a valid organisation number with 11 digits.',\n },\n PhoneNumber: {\n label: 'Mobile number',\n countryCodeLabel: 'Country code',\n errorRequired:\n 'Mobile number must be filled in. If you don’t have a mobile number, you can enter another phone number.',\n warningRequired:\n 'You have not entered a mobile number. You can still use this number if it is correct.',\n },\n PostalCodeAndCity: {\n label: 'Postcode and city', // Use British English\n invalidCode: 'Invalid postal code.',\n },\n PostalCode: {\n label: 'Postc.',\n errorRequired: 'You must enter a postal code.',\n errorPattern: 'This is not a valid postal code (four-digits).',\n },\n City: {\n label: 'City',\n errorRequired: 'You must enter a city name.',\n errorPattern:\n 'City names can only contain letters and valid characters such as hyphens and spaces.',\n },\n SelectCountry: {\n label: 'Country',\n placeholder: 'Select country',\n errorRequired: 'You must select a country from the list.',\n },\n Password: {\n label: 'Password',\n ariaLabelShow: 'Show password',\n ariaLabelHide: 'Hide password',\n },\n Upload: {\n errorRequired: 'You must upload a file.',\n errorInvalidFiles: 'Remove all files that have errors.',\n },\n } satisfies (typeof nb)['nb-NO'],\n}\n"],"mappings":"AACA,eAAe;EACb,OAAO,EAAE;IAIPA,KAAK,EAAE;MACLC,iBAAiB,EAAE,qCAAqC;MACxDC,YAAY,EAAE,UAAU;MACxBC,YAAY,EAAE,sCAAsC;MACpDC,aAAa,EAAE,yBAAyB;MACxCC,YAAY,EAAE,uBAAuB;MACrCC,mBAAmB,EAAE;IACvB,CAAC;IACDC,YAAY,EAAE;MACZC,IAAI,EAAE,MAAM;MACZC,QAAQ,EAAE;IACZ,CAAC;IACDC,eAAe,EAAE;MACfC,KAAK,EAAE;IACT,CAAC;IACDC,SAAS,EAAE;MACTC,gBAAgB,EAAE;IACpB,CAAC;IACDC,IAAI,EAAE;MACJC,YAAY,EAAE;IAChB,CAAC;IACDC,gBAAgB,EAAE;MAChBR,IAAI,EAAE;IACR,CAAC;IACDS,oBAAoB,EAAE;MACpBT,IAAI,EAAE;IACR,CAAC;IACDU,gBAAgB,EAAE;MAChBV,IAAI,EAAE;IACR,CAAC;IACDW,YAAY,EAAE;MACZX,IAAI,EAAE,QAAQ;MACdY,iBAAiB,EAAE;IACrB,CAAC;IACD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;MACjBrE,KAAK,EAAE,cAAc;MACrBP,aAAa,EAAE,mCAAmC;MAClD6E,sBAAsB,EAAE,yBAAyB;MACjDC,4BAA4B,EAC1B;IACJ,CAAC;IACDC,WAAW,EAAE;MACXxE,KAAK,EAAE,eAAe;MACtByE,gBAAgB,EAAE,cAAc;MAChChF,aAAa,EACX,yGAAyG;MAC3GiF,eAAe,EACb;IACJ,CAAC;IACDC,iBAAiB,EAAE;MACjB3E,KAAK,EAAE,mBAAmB;MAC1B4E,WAAW,EAAE;IACf,CAAC;IACDC,UAAU,EAAE;MACV7E,KAAK,EAAE,QAAQ;MACfP,aAAa,EAAE,+BAA+B;MAC9CC,YAAY,EAAE;IAChB,CAAC;IACDoF,IAAI,EAAE;MACJ9E,KAAK,EAAE,MAAM;MACbP,aAAa,EAAE,6BAA6B;MAC5CC,YAAY,EACV;IACJ,CAAC;IACDqF,aAAa,EAAE;MACb/E,KAAK,EAAE,SAAS;MAChBgF,WAAW,EAAE,gBAAgB;MAC7BvF,aAAa,EAAE;IACjB,CAAC;IACDwF,QAAQ,EAAE;MACRjF,KAAK,EAAE,UAAU;MACjBkF,aAAa,EAAE,eAAe;MAC9BC,aAAa,EAAE;IACjB,CAAC;IACDC,MAAM,EAAE;MACN3F,aAAa,EAAE,yBAAyB;MACxC4F,iBAAiB,EAAE;IACrB;EACF;AACF,CAAC"}
@@ -106,6 +106,12 @@ declare const _default: {
106
106
  Date: {
107
107
  label: string;
108
108
  errorRequired: string;
109
+ errorMinDate: string;
110
+ errorMaxDate: string;
111
+ errorStartDateMinDate: string;
112
+ errorStartDateMaxDate: string;
113
+ errorEndDateMinDate: string;
114
+ errorEndDateMaxDate: string;
109
115
  };
110
116
  Expiry: {
111
117
  label: string;
@@ -100,6 +100,12 @@ declare const locales: {
100
100
  Date: {
101
101
  label: string;
102
102
  errorRequired: string;
103
+ errorMinDate: string;
104
+ errorMaxDate: string;
105
+ errorStartDateMinDate: string;
106
+ errorStartDateMaxDate: string;
107
+ errorEndDateMinDate: string;
108
+ errorEndDateMaxDate: string;
103
109
  };
104
110
  Expiry: {
105
111
  label: string;
@@ -283,6 +289,12 @@ declare const locales: {
283
289
  Date: {
284
290
  label: string;
285
291
  errorRequired: string;
292
+ errorMinDate: string;
293
+ errorMaxDate: string;
294
+ errorStartDateMinDate: string;
295
+ errorStartDateMaxDate: string;
296
+ errorEndDateMinDate: string;
297
+ errorEndDateMaxDate: string;
286
298
  };
287
299
  Expiry: {
288
300
  label: string;
@@ -109,6 +109,12 @@ declare const _default: {
109
109
  Date: {
110
110
  label: string;
111
111
  errorRequired: string;
112
+ errorMinDate: string;
113
+ errorMaxDate: string;
114
+ errorStartDateMinDate: string;
115
+ errorStartDateMaxDate: string;
116
+ errorEndDateMinDate: string;
117
+ errorEndDateMaxDate: string;
112
118
  };
113
119
  Expiry: {
114
120
  label: string;
@@ -99,7 +99,13 @@ export default {
99
99
  },
100
100
  Date: {
101
101
  label: 'Dato',
102
- errorRequired: 'Du må angi en gyldig dato.'
102
+ errorRequired: 'Du må angi en gyldig dato.',
103
+ errorMinDate: 'Valgt dato kan ikke være før {date}.',
104
+ errorMaxDate: 'Valgt dato kan ikke være etter {date}.',
105
+ errorStartDateMinDate: 'Startdato kan ikke være før {date}.',
106
+ errorStartDateMaxDate: 'Startdato kan ikke være etter {date}.',
107
+ errorEndDateMinDate: 'Sluttdato kan ikke være før {date}.',
108
+ errorEndDateMaxDate: 'Sluttdato kan ikke være etter {date}.'
103
109
  },
104
110
  Expiry: {
105
111
  label: 'Utløpsdato',