@dnb/eufemia 10.20.0 → 10.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1062) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/cjs/components/aria-live/useAriaLive.d.ts +1 -1
  3. package/cjs/components/breadcrumb/Breadcrumb.d.ts +2 -2
  4. package/cjs/components/breadcrumb/Breadcrumb.js +3 -3
  5. package/cjs/components/breadcrumb/Breadcrumb.js.map +1 -1
  6. package/cjs/components/breadcrumb/style/dnb-breadcrumb.css +7 -2
  7. package/cjs/components/breadcrumb/style/dnb-breadcrumb.min.css +1 -1
  8. package/cjs/components/breadcrumb/style/dnb-breadcrumb.scss +10 -2
  9. package/cjs/components/button/Button.js +2 -2
  10. package/cjs/components/button/Button.js.map +1 -1
  11. package/cjs/components/button/style/themes/dnb-button-theme-sbanken.css +23 -11
  12. package/cjs/components/button/style/themes/dnb-button-theme-sbanken.min.css +3 -3
  13. package/cjs/components/button/style/themes/dnb-button-theme-sbanken.scss +30 -14
  14. package/cjs/components/card/style/dnb-card.css +11 -2
  15. package/cjs/components/card/style/dnb-card.min.css +1 -1
  16. package/cjs/components/card/style/dnb-card.scss +12 -2
  17. package/cjs/components/date-picker/DatePicker.d.ts +10 -1
  18. package/cjs/components/date-picker/DatePicker.js +5 -2
  19. package/cjs/components/date-picker/DatePicker.js.map +1 -1
  20. package/cjs/components/form-label/style/dnb-form-label.css +4 -8
  21. package/cjs/components/form-label/style/dnb-form-label.min.css +1 -1
  22. package/cjs/components/form-label/style/dnb-form-label.scss +5 -8
  23. package/cjs/components/form-status/style/dnb-form-status.css +11 -0
  24. package/cjs/components/form-status/style/dnb-form-status.min.css +1 -1
  25. package/cjs/components/form-status/style/dnb-form-status.scss +11 -0
  26. package/cjs/components/global-status/GlobalStatus.d.ts +1 -1
  27. package/cjs/components/global-status/GlobalStatusProvider.d.ts +1 -1
  28. package/cjs/components/height-animation/HeightAnimationInstance.d.ts +5 -6
  29. package/cjs/components/height-animation/HeightAnimationInstance.js +12 -12
  30. package/cjs/components/height-animation/HeightAnimationInstance.js.map +1 -1
  31. package/cjs/components/height-animation/useHeightAnimation.js +11 -10
  32. package/cjs/components/height-animation/useHeightAnimation.js.map +1 -1
  33. package/cjs/components/info-card/InfoCard.d.ts +6 -0
  34. package/cjs/components/info-card/InfoCard.js +4 -2
  35. package/cjs/components/info-card/InfoCard.js.map +1 -1
  36. package/cjs/components/info-card/style/dnb-info-card.css +3 -1
  37. package/cjs/components/info-card/style/dnb-info-card.min.css +1 -1
  38. package/cjs/components/info-card/style/dnb-info-card.scss +4 -2
  39. package/cjs/components/input/Input.d.ts +9 -9
  40. package/cjs/components/input/InputDocs.d.ts +2 -0
  41. package/cjs/components/input/InputDocs.js +165 -0
  42. package/cjs/components/input/InputDocs.js.map +1 -0
  43. package/cjs/components/input/InputPassword.d.ts +6 -17
  44. package/cjs/components/input/InputPassword.js +4 -85
  45. package/cjs/components/input/InputPassword.js.map +1 -1
  46. package/cjs/components/input-masked/InputMasked.d.ts +6 -93
  47. package/cjs/components/input-masked/InputMasked.js +3 -1
  48. package/cjs/components/input-masked/InputMasked.js.map +1 -1
  49. package/cjs/components/input-masked/InputMaskedDocs.d.ts +2 -0
  50. package/cjs/components/input-masked/InputMaskedDocs.js +85 -0
  51. package/cjs/components/input-masked/InputMaskedDocs.js.map +1 -0
  52. package/cjs/components/input-masked/InputMaskedHooks.js +7 -4
  53. package/cjs/components/input-masked/InputMaskedHooks.js.map +1 -1
  54. package/cjs/components/input-masked/MultiInputMask.js +2 -6
  55. package/cjs/components/input-masked/MultiInputMask.js.map +1 -1
  56. package/cjs/components/input-masked/style/dnb-input-masked.css +3 -0
  57. package/cjs/components/input-masked/style/dnb-input-masked.min.css +1 -1
  58. package/cjs/components/input-masked/style/dnb-input-masked.scss +5 -0
  59. package/cjs/components/number-format/NumberFormat.d.ts +1 -1
  60. package/cjs/components/number-format/NumberUtils.js +22 -14
  61. package/cjs/components/number-format/NumberUtils.js.map +1 -1
  62. package/cjs/components/pagination/InfinityScroller.d.ts +1 -1
  63. package/cjs/components/progress-indicator/ProgressIndicator.js +5 -7
  64. package/cjs/components/progress-indicator/ProgressIndicator.js.map +1 -1
  65. package/cjs/components/progress-indicator/ProgressIndicatorCircular.js +1 -1
  66. package/cjs/components/progress-indicator/ProgressIndicatorCircular.js.map +1 -1
  67. package/cjs/components/progress-indicator/ProgressIndicatorLinear.js +4 -4
  68. package/cjs/components/progress-indicator/ProgressIndicatorLinear.js.map +1 -1
  69. package/cjs/components/progress-indicator/style/dnb-progress-indicator.css +5 -2
  70. package/cjs/components/progress-indicator/style/dnb-progress-indicator.min.css +1 -1
  71. package/cjs/components/progress-indicator/style/dnb-progress-indicator.scss +5 -2
  72. package/cjs/components/slider/Slider.d.ts +1 -0
  73. package/cjs/components/slider/Slider.js +10 -1
  74. package/cjs/components/slider/Slider.js.map +1 -1
  75. package/cjs/components/slider/SliderInstance.js +20 -6
  76. package/cjs/components/slider/SliderInstance.js.map +1 -1
  77. package/cjs/components/slider/SliderMarker.d.ts +7 -0
  78. package/cjs/components/slider/SliderMarker.js +62 -0
  79. package/cjs/components/slider/SliderMarker.js.map +1 -0
  80. package/cjs/components/slider/SliderProvider.js +2 -1
  81. package/cjs/components/slider/SliderProvider.js.map +1 -1
  82. package/cjs/components/slider/style/dnb-slider.css +43 -2
  83. package/cjs/components/slider/style/dnb-slider.min.css +1 -1
  84. package/cjs/components/slider/style/dnb-slider.scss +44 -1
  85. package/cjs/components/slider/style/themes/dnb-slider-theme-sbanken.css +3 -0
  86. package/cjs/components/slider/style/themes/dnb-slider-theme-sbanken.min.css +1 -1
  87. package/cjs/components/slider/style/themes/dnb-slider-theme-sbanken.scss +4 -0
  88. package/cjs/components/slider/style/themes/dnb-slider-theme-ui.css +3 -0
  89. package/cjs/components/slider/style/themes/dnb-slider-theme-ui.min.css +1 -1
  90. package/cjs/components/slider/style/themes/dnb-slider-theme-ui.scss +5 -0
  91. package/cjs/components/slider/types.d.ts +6 -0
  92. package/cjs/components/slider/types.js.map +1 -1
  93. package/cjs/components/space/SpacingHelper.d.ts +5 -5
  94. package/cjs/components/table/Table.js +2 -2
  95. package/cjs/components/table/Table.js.map +1 -1
  96. package/cjs/components/table/TableAccordion.js +42 -58
  97. package/cjs/components/table/TableAccordion.js.map +1 -1
  98. package/cjs/components/table/TableAccordionTd.d.ts +9 -0
  99. package/cjs/components/table/{TableAccordionContent.js → TableAccordionTd.js} +18 -56
  100. package/cjs/components/table/TableAccordionTd.js.map +1 -0
  101. package/cjs/components/table/TableAccordionTr.d.ts +13 -0
  102. package/cjs/components/table/TableAccordionTr.js +61 -0
  103. package/cjs/components/table/TableAccordionTr.js.map +1 -0
  104. package/cjs/components/table/TableContext.d.ts +2 -2
  105. package/cjs/components/table/TableContext.js +4 -3
  106. package/cjs/components/table/TableContext.js.map +1 -1
  107. package/cjs/components/table/TableTd.d.ts +2 -2
  108. package/cjs/components/table/TableTd.js +2 -2
  109. package/cjs/components/table/TableTd.js.map +1 -1
  110. package/cjs/components/table/TableTr.d.ts +6 -1
  111. package/cjs/components/table/TableTr.js +10 -5
  112. package/cjs/components/table/TableTr.js.map +1 -1
  113. package/cjs/components/table/style/dnb-table.css +226 -139
  114. package/cjs/components/table/style/dnb-table.min.css +1 -1
  115. package/cjs/components/table/style/dnb-table.scss +60 -4
  116. package/cjs/components/table/style/table-accordion.scss +83 -98
  117. package/cjs/components/table/style/table-container.scss +9 -9
  118. package/cjs/components/table/style/table-mixins.scss +19 -2
  119. package/cjs/components/table/style/table-td.scss +82 -60
  120. package/cjs/components/table/style/table-th.scss +5 -30
  121. package/cjs/components/table/style/table-tr.scss +0 -20
  122. package/cjs/components/table/style/themes/dnb-table-theme-sbanken.css +34 -7
  123. package/cjs/components/table/style/themes/dnb-table-theme-sbanken.min.css +3 -1
  124. package/cjs/components/table/style/themes/dnb-table-theme-sbanken.scss +29 -10
  125. package/cjs/components/table/style/themes/dnb-table-theme-ui.css +14 -9
  126. package/cjs/components/table/style/themes/dnb-table-theme-ui.min.css +1 -1
  127. package/cjs/components/table/style/themes/dnb-table-theme-ui.scss +12 -22
  128. package/cjs/components/table/useTableAnimationHandler.d.ts +20 -0
  129. package/cjs/components/table/useTableAnimationHandler.js +73 -0
  130. package/cjs/components/table/useTableAnimationHandler.js.map +1 -0
  131. package/cjs/components/textarea/Textarea.d.ts +4 -10
  132. package/cjs/components/textarea/TextareaDocs.d.ts +2 -0
  133. package/cjs/components/textarea/TextareaDocs.js +105 -0
  134. package/cjs/components/textarea/TextareaDocs.js.map +1 -0
  135. package/cjs/components/textarea/style/dnb-textarea.css +1 -0
  136. package/cjs/components/textarea/style/dnb-textarea.min.css +1 -1
  137. package/cjs/components/textarea/style/dnb-textarea.scss +3 -0
  138. package/cjs/components/upload/UploadInfo.js +1 -1
  139. package/cjs/components/upload/UploadInfo.js.map +1 -1
  140. package/cjs/core/jest/jestSetupScreenshots.css +7 -0
  141. package/cjs/elements/blockquote/style/themes/dnb-blockquote-theme-sbanken.scss +1 -0
  142. package/cjs/elements/lib.d.ts +1 -1
  143. package/cjs/elements/lists/Dl.d.ts +5 -1
  144. package/cjs/elements/lists/Dl.js +5 -4
  145. package/cjs/elements/lists/Dl.js.map +1 -1
  146. package/cjs/elements/lists/style/lists-mixins.scss +24 -1
  147. package/cjs/extensions/forms/DataContext/Context.d.ts +1 -2
  148. package/cjs/extensions/forms/DataContext/Context.js.map +1 -1
  149. package/cjs/extensions/forms/DataContext/Provider/Provider.d.ts +1 -2
  150. package/cjs/extensions/forms/DataContext/Provider/Provider.js +54 -40
  151. package/cjs/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  152. package/cjs/extensions/forms/Field/Currency/Currency.js +1 -1
  153. package/cjs/extensions/forms/Field/Currency/Currency.js.map +1 -1
  154. package/cjs/extensions/forms/Field/Expiry/Expiry.js +1 -0
  155. package/cjs/extensions/forms/Field/Expiry/Expiry.js.map +1 -1
  156. package/cjs/extensions/forms/Field/FieldDocs.d.ts +3 -0
  157. package/cjs/extensions/forms/Field/FieldDocs.js +18 -0
  158. package/cjs/extensions/forms/Field/FieldDocs.js.map +1 -0
  159. package/cjs/extensions/forms/Field/Number/Number.d.ts +1 -0
  160. package/cjs/extensions/forms/Field/Number/Number.js +13 -7
  161. package/cjs/extensions/forms/Field/Number/Number.js.map +1 -1
  162. package/cjs/extensions/forms/Field/Number/NumberDocs.d.ts +2 -0
  163. package/cjs/extensions/forms/Field/Number/NumberDocs.js +92 -0
  164. package/cjs/extensions/forms/Field/Number/NumberDocs.js.map +1 -0
  165. package/cjs/extensions/forms/Field/Number/style/dnb-number.css +3 -1
  166. package/cjs/extensions/forms/Field/Number/style/dnb-number.min.css +1 -1
  167. package/cjs/extensions/forms/Field/Number/style/dnb-number.scss +4 -1
  168. package/cjs/extensions/forms/Field/Password/Password.d.ts +45 -0
  169. package/cjs/extensions/forms/Field/Password/Password.js +111 -0
  170. package/cjs/extensions/forms/Field/Password/Password.js.map +1 -0
  171. package/cjs/extensions/forms/Field/Password/index.d.ts +2 -0
  172. package/cjs/extensions/forms/Field/Password/index.js +27 -0
  173. package/cjs/extensions/forms/Field/Password/index.js.map +1 -0
  174. package/cjs/extensions/forms/Field/Password/style/dnb-password.css +6 -0
  175. package/cjs/extensions/forms/Field/Password/style/dnb-password.min.css +1 -0
  176. package/cjs/extensions/forms/Field/Password/style/dnb-password.scss +10 -0
  177. package/cjs/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js +4 -5
  178. package/cjs/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js.map +1 -1
  179. package/cjs/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.css +0 -12
  180. package/cjs/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.min.css +1 -1
  181. package/cjs/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.scss +0 -11
  182. package/cjs/extensions/forms/Field/Selection/Selection.d.ts +0 -1
  183. package/cjs/extensions/forms/Field/Selection/Selection.js +1 -9
  184. package/cjs/extensions/forms/Field/Selection/Selection.js.map +1 -1
  185. package/cjs/extensions/forms/Field/String/String.d.ts +20 -9
  186. package/cjs/extensions/forms/Field/String/String.js +52 -31
  187. package/cjs/extensions/forms/Field/String/String.js.map +1 -1
  188. package/cjs/extensions/forms/Field/String/StringDocs.d.ts +2 -0
  189. package/cjs/extensions/forms/Field/String/StringDocs.js +106 -0
  190. package/cjs/extensions/forms/Field/String/StringDocs.js.map +1 -0
  191. package/cjs/extensions/forms/Field/Toggle/Toggle.js +1 -1
  192. package/cjs/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
  193. package/cjs/extensions/forms/Field/index.d.ts +1 -0
  194. package/cjs/extensions/forms/Field/index.js +7 -0
  195. package/cjs/extensions/forms/Field/index.js.map +1 -1
  196. package/cjs/extensions/forms/FieldBlock/FieldBlock.d.ts +8 -3
  197. package/cjs/extensions/forms/FieldBlock/FieldBlock.js +204 -62
  198. package/cjs/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
  199. package/cjs/extensions/forms/FieldBlock/FieldBlockContext.d.ts +39 -6
  200. package/cjs/extensions/forms/FieldBlock/FieldBlockContext.js.map +1 -1
  201. package/cjs/extensions/forms/FieldBlock/FieldBlockDocs.d.ts +2 -0
  202. package/cjs/extensions/forms/FieldBlock/FieldBlockDocs.js +60 -0
  203. package/cjs/extensions/forms/FieldBlock/FieldBlockDocs.js.map +1 -0
  204. package/cjs/extensions/forms/FieldBlock/style/dnb-field-block.css +29 -2
  205. package/cjs/extensions/forms/FieldBlock/style/dnb-field-block.min.css +1 -1
  206. package/cjs/extensions/forms/FieldBlock/style/dnb-field-block.scss +28 -0
  207. package/cjs/extensions/forms/Form/Appearance/Appearance.d.ts +7 -0
  208. package/cjs/extensions/forms/Form/Appearance/Appearance.js +38 -0
  209. package/cjs/extensions/forms/Form/Appearance/Appearance.js.map +1 -0
  210. package/cjs/extensions/forms/Form/Appearance/AppearanceDocs.d.ts +2 -0
  211. package/cjs/extensions/forms/Form/Appearance/AppearanceDocs.js +15 -0
  212. package/cjs/extensions/forms/Form/Appearance/AppearanceDocs.js.map +1 -0
  213. package/cjs/extensions/forms/Form/Appearance/index.d.ts +2 -0
  214. package/cjs/extensions/forms/Form/Appearance/index.js +27 -0
  215. package/cjs/extensions/forms/Form/Appearance/index.js.map +1 -0
  216. package/cjs/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.css +6 -0
  217. package/cjs/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.min.css +1 -1
  218. package/cjs/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.scss +10 -2
  219. package/cjs/extensions/forms/Form/data-context/useData.d.ts +1 -1
  220. package/cjs/extensions/forms/Form/data-context/useData.js +2 -18
  221. package/cjs/extensions/forms/Form/data-context/useData.js.map +1 -1
  222. package/cjs/extensions/forms/Form/data-context/useError.d.ts +2 -1
  223. package/cjs/extensions/forms/Form/data-context/useError.js +4 -2
  224. package/cjs/extensions/forms/Form/data-context/useError.js.map +1 -1
  225. package/cjs/extensions/forms/Form/index.d.ts +1 -0
  226. package/cjs/extensions/forms/Form/index.js +7 -0
  227. package/cjs/extensions/forms/Form/index.js.map +1 -1
  228. package/cjs/extensions/forms/Value/Currency/Currency.js +2 -2
  229. package/cjs/extensions/forms/Value/Currency/Currency.js.map +1 -1
  230. package/cjs/extensions/forms/Value/Number/Number.d.ts +2 -2
  231. package/cjs/extensions/forms/Value/Number/Number.js +1 -1
  232. package/cjs/extensions/forms/Value/Number/Number.js.map +1 -1
  233. package/cjs/extensions/forms/Value/SummaryList/SummaryList.d.ts +7 -0
  234. package/cjs/extensions/forms/Value/SummaryList/SummaryList.js +35 -0
  235. package/cjs/extensions/forms/Value/SummaryList/SummaryList.js.map +1 -0
  236. package/cjs/extensions/forms/Value/SummaryList/SummaryListContext.d.ts +7 -0
  237. package/cjs/extensions/forms/Value/SummaryList/SummaryListContext.js +12 -0
  238. package/cjs/extensions/forms/Value/SummaryList/SummaryListContext.js.map +1 -0
  239. package/cjs/extensions/forms/Value/SummaryList/index.d.ts +2 -0
  240. package/cjs/extensions/forms/Value/SummaryList/index.js +27 -0
  241. package/cjs/extensions/forms/Value/SummaryList/index.js.map +1 -0
  242. package/cjs/extensions/forms/Value/ValueDocs.d.ts +2 -0
  243. package/cjs/extensions/forms/Value/ValueDocs.js +40 -0
  244. package/cjs/extensions/forms/Value/ValueDocs.js.map +1 -0
  245. package/cjs/extensions/forms/Value/index.d.ts +1 -0
  246. package/cjs/extensions/forms/Value/index.js +7 -0
  247. package/cjs/extensions/forms/Value/index.js.map +1 -1
  248. package/cjs/extensions/forms/ValueBlock/ValueBlock.js +13 -3
  249. package/cjs/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
  250. package/cjs/extensions/forms/hooks/DataValueDocs.d.ts +3 -0
  251. package/cjs/extensions/forms/hooks/DataValueDocs.js +118 -0
  252. package/cjs/extensions/forms/hooks/DataValueDocs.js.map +1 -0
  253. package/cjs/extensions/forms/hooks/useDataValue.d.ts +6 -14
  254. package/cjs/extensions/forms/hooks/useDataValue.js +90 -21
  255. package/cjs/extensions/forms/hooks/useDataValue.js.map +1 -1
  256. package/cjs/extensions/forms/hooks/useId.js +1 -1
  257. package/cjs/extensions/forms/hooks/useId.js.map +1 -1
  258. package/cjs/extensions/forms/hooks/useMountEffect.js +1 -1
  259. package/cjs/extensions/forms/hooks/useMountEffect.js.map +1 -1
  260. package/cjs/extensions/forms/hooks/useMounted.d.ts +2 -0
  261. package/cjs/extensions/forms/hooks/useMounted.js +19 -0
  262. package/cjs/extensions/forms/hooks/useMounted.js.map +1 -0
  263. package/cjs/extensions/forms/hooks/useUnmountEffect.d.ts +4 -0
  264. package/cjs/extensions/forms/hooks/useUnmountEffect.js +14 -0
  265. package/cjs/extensions/forms/hooks/useUnmountEffect.js.map +1 -0
  266. package/cjs/extensions/forms/style/dnb-forms.css +45 -15
  267. package/cjs/extensions/forms/style/dnb-forms.min.css +1 -1
  268. package/cjs/extensions/forms/types.d.ts +6 -4
  269. package/cjs/extensions/forms/types.js.map +1 -1
  270. package/cjs/extensions/payment-card/utils/CardDesigns.d.ts +96 -96
  271. package/cjs/fragments/drawer-list/DrawerListHelpers.d.ts +52 -52
  272. package/cjs/shared/Context.d.ts +2 -0
  273. package/cjs/shared/Context.js.map +1 -1
  274. package/cjs/shared/Eufemia.d.ts +1 -1
  275. package/cjs/shared/Eufemia.js +2 -2
  276. package/cjs/shared/Eufemia.js.map +1 -1
  277. package/cjs/shared/Theme.d.ts +7 -1
  278. package/cjs/shared/Theme.js +20 -7
  279. package/cjs/shared/Theme.js.map +1 -1
  280. package/cjs/shared/component-helper.d.ts +1 -0
  281. package/cjs/shared/component-helper.js +10 -0
  282. package/cjs/shared/component-helper.js.map +1 -1
  283. package/cjs/shared/helpers/debounce.d.ts +37 -0
  284. package/cjs/shared/helpers/debounce.js +92 -0
  285. package/cjs/shared/helpers/debounce.js.map +1 -0
  286. package/cjs/shared/helpers/filterValidProps.d.ts +2 -2
  287. package/cjs/shared/helpers/filterValidProps.js +2 -2
  288. package/cjs/shared/helpers/filterValidProps.js.map +1 -1
  289. package/cjs/shared/helpers/useSharedState.d.ts +1 -0
  290. package/cjs/shared/helpers/useSharedState.js +52 -20
  291. package/cjs/shared/helpers/useSharedState.js.map +1 -1
  292. package/cjs/shared/helpers/withCamelCaseProps.d.ts +14 -1
  293. package/cjs/shared/helpers/withCamelCaseProps.js.map +1 -1
  294. package/cjs/shared/helpers.d.ts +1 -25
  295. package/cjs/shared/helpers.js +15 -37
  296. package/cjs/shared/helpers.js.map +1 -1
  297. package/cjs/shared/locales/en-GB.d.ts +5 -3
  298. package/cjs/shared/locales/en-GB.js +7 -5
  299. package/cjs/shared/locales/en-GB.js.map +1 -1
  300. package/cjs/shared/locales/en-US.d.ts +5 -3
  301. package/cjs/shared/locales/index.d.ts +10 -6
  302. package/cjs/shared/locales/nb-NO.d.ts +5 -3
  303. package/cjs/shared/locales/nb-NO.js +7 -5
  304. package/cjs/shared/locales/nb-NO.js.map +1 -1
  305. package/cjs/shared/types.d.ts +5 -0
  306. package/cjs/shared/types.js.map +1 -1
  307. package/cjs/shared/useTheme.d.ts +1 -0
  308. package/cjs/style/dnb-ui-components.css +359 -171
  309. package/cjs/style/dnb-ui-components.min.css +3 -3
  310. package/cjs/style/dnb-ui-elements.css +25 -5
  311. package/cjs/style/dnb-ui-elements.min.css +1 -1
  312. package/cjs/style/dnb-ui-extensions.css +45 -15
  313. package/cjs/style/dnb-ui-extensions.min.css +1 -1
  314. package/cjs/style/dnb-ui-forms.css +45 -15
  315. package/cjs/style/dnb-ui-forms.min.css +1 -1
  316. package/cjs/style/dnb-ui-forms.scss +1 -0
  317. package/cjs/style/themes/theme-eiendom/eiendom-theme-basis.css +25 -5
  318. package/cjs/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
  319. package/cjs/style/themes/theme-eiendom/eiendom-theme-components.css +421 -195
  320. package/cjs/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
  321. package/cjs/style/themes/theme-eiendom/eiendom-theme-elements.css +25 -5
  322. package/cjs/style/themes/theme-eiendom/eiendom-theme-elements.min.css +1 -1
  323. package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.css +45 -15
  324. package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
  325. package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.css +45 -15
  326. package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
  327. package/cjs/style/themes/theme-sbanken/sbanken-theme-basis.css +26 -5
  328. package/cjs/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
  329. package/cjs/style/themes/theme-sbanken/sbanken-theme-components.css +464 -204
  330. package/cjs/style/themes/theme-sbanken/sbanken-theme-components.min.css +8 -6
  331. package/cjs/style/themes/theme-sbanken/sbanken-theme-elements.css +26 -5
  332. package/cjs/style/themes/theme-sbanken/sbanken-theme-elements.min.css +1 -1
  333. package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.css +45 -15
  334. package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
  335. package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.css +45 -15
  336. package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
  337. package/cjs/style/themes/theme-ui/prism/dnb-prism-theme.d.ts +3 -3
  338. package/cjs/style/themes/theme-ui/ui-theme-basis.css +25 -5
  339. package/cjs/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
  340. package/cjs/style/themes/theme-ui/ui-theme-components.css +421 -195
  341. package/cjs/style/themes/theme-ui/ui-theme-components.min.css +4 -4
  342. package/cjs/style/themes/theme-ui/ui-theme-elements.css +25 -5
  343. package/cjs/style/themes/theme-ui/ui-theme-elements.min.css +1 -1
  344. package/cjs/style/themes/theme-ui/ui-theme-extensions.css +45 -15
  345. package/cjs/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
  346. package/cjs/style/themes/theme-ui/ui-theme-forms.css +45 -15
  347. package/cjs/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
  348. package/cjs/style/themes/theme-ui/ui-theme-tags.css +25 -5
  349. package/cjs/style/themes/theme-ui/ui-theme-tags.min.css +1 -1
  350. package/components/aria-live/useAriaLive.d.ts +1 -1
  351. package/components/breadcrumb/Breadcrumb.d.ts +2 -2
  352. package/components/breadcrumb/Breadcrumb.js +3 -3
  353. package/components/breadcrumb/Breadcrumb.js.map +1 -1
  354. package/components/breadcrumb/style/dnb-breadcrumb.css +7 -2
  355. package/components/breadcrumb/style/dnb-breadcrumb.min.css +1 -1
  356. package/components/breadcrumb/style/dnb-breadcrumb.scss +10 -2
  357. package/components/button/Button.js +2 -2
  358. package/components/button/Button.js.map +1 -1
  359. package/components/button/style/themes/dnb-button-theme-sbanken.css +23 -11
  360. package/components/button/style/themes/dnb-button-theme-sbanken.min.css +3 -3
  361. package/components/button/style/themes/dnb-button-theme-sbanken.scss +30 -14
  362. package/components/card/style/dnb-card.css +11 -2
  363. package/components/card/style/dnb-card.min.css +1 -1
  364. package/components/card/style/dnb-card.scss +12 -2
  365. package/components/date-picker/DatePicker.d.ts +10 -1
  366. package/components/date-picker/DatePicker.js +5 -2
  367. package/components/date-picker/DatePicker.js.map +1 -1
  368. package/components/form-label/style/dnb-form-label.css +4 -8
  369. package/components/form-label/style/dnb-form-label.min.css +1 -1
  370. package/components/form-label/style/dnb-form-label.scss +5 -8
  371. package/components/form-status/style/dnb-form-status.css +11 -0
  372. package/components/form-status/style/dnb-form-status.min.css +1 -1
  373. package/components/form-status/style/dnb-form-status.scss +11 -0
  374. package/components/global-status/GlobalStatus.d.ts +1 -1
  375. package/components/global-status/GlobalStatusProvider.d.ts +1 -1
  376. package/components/height-animation/HeightAnimationInstance.d.ts +5 -6
  377. package/components/height-animation/HeightAnimationInstance.js +12 -12
  378. package/components/height-animation/HeightAnimationInstance.js.map +1 -1
  379. package/components/height-animation/useHeightAnimation.js +11 -10
  380. package/components/height-animation/useHeightAnimation.js.map +1 -1
  381. package/components/info-card/InfoCard.d.ts +6 -0
  382. package/components/info-card/InfoCard.js +4 -2
  383. package/components/info-card/InfoCard.js.map +1 -1
  384. package/components/info-card/style/dnb-info-card.css +3 -1
  385. package/components/info-card/style/dnb-info-card.min.css +1 -1
  386. package/components/info-card/style/dnb-info-card.scss +4 -2
  387. package/components/input/Input.d.ts +9 -9
  388. package/components/input/InputDocs.d.ts +2 -0
  389. package/components/input/InputDocs.js +158 -0
  390. package/components/input/InputDocs.js.map +1 -0
  391. package/components/input/InputPassword.d.ts +6 -17
  392. package/components/input/InputPassword.js +3 -81
  393. package/components/input/InputPassword.js.map +1 -1
  394. package/components/input-masked/InputMasked.d.ts +6 -93
  395. package/components/input-masked/InputMasked.js +3 -1
  396. package/components/input-masked/InputMasked.js.map +1 -1
  397. package/components/input-masked/InputMaskedDocs.d.ts +2 -0
  398. package/components/input-masked/InputMaskedDocs.js +78 -0
  399. package/components/input-masked/InputMaskedDocs.js.map +1 -0
  400. package/components/input-masked/InputMaskedHooks.js +7 -4
  401. package/components/input-masked/InputMaskedHooks.js.map +1 -1
  402. package/components/input-masked/MultiInputMask.js +2 -6
  403. package/components/input-masked/MultiInputMask.js.map +1 -1
  404. package/components/input-masked/style/dnb-input-masked.css +3 -0
  405. package/components/input-masked/style/dnb-input-masked.min.css +1 -1
  406. package/components/input-masked/style/dnb-input-masked.scss +5 -0
  407. package/components/number-format/NumberFormat.d.ts +1 -1
  408. package/components/number-format/NumberUtils.js +22 -14
  409. package/components/number-format/NumberUtils.js.map +1 -1
  410. package/components/pagination/InfinityScroller.d.ts +1 -1
  411. package/components/progress-indicator/ProgressIndicator.js +5 -7
  412. package/components/progress-indicator/ProgressIndicator.js.map +1 -1
  413. package/components/progress-indicator/ProgressIndicatorCircular.js +1 -1
  414. package/components/progress-indicator/ProgressIndicatorCircular.js.map +1 -1
  415. package/components/progress-indicator/ProgressIndicatorLinear.js +4 -4
  416. package/components/progress-indicator/ProgressIndicatorLinear.js.map +1 -1
  417. package/components/progress-indicator/style/dnb-progress-indicator.css +5 -2
  418. package/components/progress-indicator/style/dnb-progress-indicator.min.css +1 -1
  419. package/components/progress-indicator/style/dnb-progress-indicator.scss +5 -2
  420. package/components/slider/Slider.d.ts +1 -0
  421. package/components/slider/Slider.js +1 -0
  422. package/components/slider/Slider.js.map +1 -1
  423. package/components/slider/SliderInstance.js +18 -5
  424. package/components/slider/SliderInstance.js.map +1 -1
  425. package/components/slider/SliderMarker.d.ts +7 -0
  426. package/components/slider/SliderMarker.js +53 -0
  427. package/components/slider/SliderMarker.js.map +1 -0
  428. package/components/slider/SliderProvider.js +2 -1
  429. package/components/slider/SliderProvider.js.map +1 -1
  430. package/components/slider/style/dnb-slider.css +43 -2
  431. package/components/slider/style/dnb-slider.min.css +1 -1
  432. package/components/slider/style/dnb-slider.scss +44 -1
  433. package/components/slider/style/themes/dnb-slider-theme-sbanken.css +3 -0
  434. package/components/slider/style/themes/dnb-slider-theme-sbanken.min.css +1 -1
  435. package/components/slider/style/themes/dnb-slider-theme-sbanken.scss +4 -0
  436. package/components/slider/style/themes/dnb-slider-theme-ui.css +3 -0
  437. package/components/slider/style/themes/dnb-slider-theme-ui.min.css +1 -1
  438. package/components/slider/style/themes/dnb-slider-theme-ui.scss +5 -0
  439. package/components/slider/types.d.ts +6 -0
  440. package/components/slider/types.js.map +1 -1
  441. package/components/space/SpacingHelper.d.ts +5 -5
  442. package/components/table/Table.js +1 -1
  443. package/components/table/Table.js.map +1 -1
  444. package/components/table/TableAccordion.js +40 -54
  445. package/components/table/TableAccordion.js.map +1 -1
  446. package/components/table/TableAccordionTd.d.ts +9 -0
  447. package/{es/components/table/TableAccordionContent.js → components/table/TableAccordionTd.js} +16 -50
  448. package/components/table/TableAccordionTd.js.map +1 -0
  449. package/components/table/TableAccordionTr.d.ts +13 -0
  450. package/components/table/TableAccordionTr.js +51 -0
  451. package/components/table/TableAccordionTr.js.map +1 -0
  452. package/components/table/TableContext.d.ts +2 -2
  453. package/components/table/TableContext.js +2 -2
  454. package/components/table/TableContext.js.map +1 -1
  455. package/components/table/TableTd.d.ts +2 -2
  456. package/components/table/TableTd.js +2 -2
  457. package/components/table/TableTd.js.map +1 -1
  458. package/components/table/TableTr.d.ts +6 -1
  459. package/components/table/TableTr.js +9 -4
  460. package/components/table/TableTr.js.map +1 -1
  461. package/components/table/style/dnb-table.css +226 -139
  462. package/components/table/style/dnb-table.min.css +1 -1
  463. package/components/table/style/dnb-table.scss +60 -4
  464. package/components/table/style/table-accordion.scss +83 -98
  465. package/components/table/style/table-container.scss +9 -9
  466. package/components/table/style/table-mixins.scss +19 -2
  467. package/components/table/style/table-td.scss +82 -60
  468. package/components/table/style/table-th.scss +5 -30
  469. package/components/table/style/table-tr.scss +0 -20
  470. package/components/table/style/themes/dnb-table-theme-sbanken.css +34 -7
  471. package/components/table/style/themes/dnb-table-theme-sbanken.min.css +3 -1
  472. package/components/table/style/themes/dnb-table-theme-sbanken.scss +29 -10
  473. package/components/table/style/themes/dnb-table-theme-ui.css +14 -9
  474. package/components/table/style/themes/dnb-table-theme-ui.min.css +1 -1
  475. package/components/table/style/themes/dnb-table-theme-ui.scss +12 -22
  476. package/components/table/useTableAnimationHandler.d.ts +20 -0
  477. package/components/table/useTableAnimationHandler.js +63 -0
  478. package/components/table/useTableAnimationHandler.js.map +1 -0
  479. package/components/textarea/Textarea.d.ts +4 -10
  480. package/components/textarea/TextareaDocs.d.ts +2 -0
  481. package/components/textarea/TextareaDocs.js +98 -0
  482. package/components/textarea/TextareaDocs.js.map +1 -0
  483. package/components/textarea/style/dnb-textarea.css +1 -0
  484. package/components/textarea/style/dnb-textarea.min.css +1 -1
  485. package/components/textarea/style/dnb-textarea.scss +3 -0
  486. package/components/upload/UploadInfo.js +1 -1
  487. package/components/upload/UploadInfo.js.map +1 -1
  488. package/core/jest/jestSetupScreenshots.css +7 -0
  489. package/elements/blockquote/style/themes/dnb-blockquote-theme-sbanken.scss +1 -0
  490. package/elements/lib.d.ts +1 -1
  491. package/elements/lists/Dl.d.ts +5 -1
  492. package/elements/lists/Dl.js +5 -4
  493. package/elements/lists/Dl.js.map +1 -1
  494. package/elements/lists/style/lists-mixins.scss +24 -1
  495. package/es/components/aria-live/useAriaLive.d.ts +1 -1
  496. package/es/components/breadcrumb/Breadcrumb.d.ts +2 -2
  497. package/es/components/breadcrumb/Breadcrumb.js +3 -3
  498. package/es/components/breadcrumb/Breadcrumb.js.map +1 -1
  499. package/es/components/breadcrumb/style/dnb-breadcrumb.css +7 -2
  500. package/es/components/breadcrumb/style/dnb-breadcrumb.min.css +1 -1
  501. package/es/components/breadcrumb/style/dnb-breadcrumb.scss +10 -2
  502. package/es/components/button/Button.js +2 -2
  503. package/es/components/button/Button.js.map +1 -1
  504. package/es/components/button/style/themes/dnb-button-theme-sbanken.css +23 -11
  505. package/es/components/button/style/themes/dnb-button-theme-sbanken.min.css +3 -3
  506. package/es/components/button/style/themes/dnb-button-theme-sbanken.scss +30 -14
  507. package/es/components/card/style/dnb-card.css +11 -2
  508. package/es/components/card/style/dnb-card.min.css +1 -1
  509. package/es/components/card/style/dnb-card.scss +12 -2
  510. package/es/components/date-picker/DatePicker.d.ts +10 -1
  511. package/es/components/date-picker/DatePicker.js +5 -2
  512. package/es/components/date-picker/DatePicker.js.map +1 -1
  513. package/es/components/form-label/style/dnb-form-label.css +4 -8
  514. package/es/components/form-label/style/dnb-form-label.min.css +1 -1
  515. package/es/components/form-label/style/dnb-form-label.scss +5 -8
  516. package/es/components/form-status/style/dnb-form-status.css +11 -0
  517. package/es/components/form-status/style/dnb-form-status.min.css +1 -1
  518. package/es/components/form-status/style/dnb-form-status.scss +11 -0
  519. package/es/components/global-status/GlobalStatus.d.ts +1 -1
  520. package/es/components/global-status/GlobalStatusProvider.d.ts +1 -1
  521. package/es/components/height-animation/HeightAnimationInstance.d.ts +5 -6
  522. package/es/components/height-animation/HeightAnimationInstance.js +12 -12
  523. package/es/components/height-animation/HeightAnimationInstance.js.map +1 -1
  524. package/es/components/height-animation/useHeightAnimation.js +11 -10
  525. package/es/components/height-animation/useHeightAnimation.js.map +1 -1
  526. package/es/components/info-card/InfoCard.d.ts +6 -0
  527. package/es/components/info-card/InfoCard.js +4 -2
  528. package/es/components/info-card/InfoCard.js.map +1 -1
  529. package/es/components/info-card/style/dnb-info-card.css +3 -1
  530. package/es/components/info-card/style/dnb-info-card.min.css +1 -1
  531. package/es/components/info-card/style/dnb-info-card.scss +4 -2
  532. package/es/components/input/Input.d.ts +9 -9
  533. package/es/components/input/InputDocs.d.ts +2 -0
  534. package/es/components/input/InputDocs.js +158 -0
  535. package/es/components/input/InputDocs.js.map +1 -0
  536. package/es/components/input/InputPassword.d.ts +6 -17
  537. package/es/components/input/InputPassword.js +3 -81
  538. package/es/components/input/InputPassword.js.map +1 -1
  539. package/es/components/input-masked/InputMasked.d.ts +6 -93
  540. package/es/components/input-masked/InputMasked.js +3 -1
  541. package/es/components/input-masked/InputMasked.js.map +1 -1
  542. package/es/components/input-masked/InputMaskedDocs.d.ts +2 -0
  543. package/es/components/input-masked/InputMaskedDocs.js +78 -0
  544. package/es/components/input-masked/InputMaskedDocs.js.map +1 -0
  545. package/es/components/input-masked/InputMaskedHooks.js +7 -4
  546. package/es/components/input-masked/InputMaskedHooks.js.map +1 -1
  547. package/es/components/input-masked/MultiInputMask.js +2 -6
  548. package/es/components/input-masked/MultiInputMask.js.map +1 -1
  549. package/es/components/input-masked/style/dnb-input-masked.css +3 -0
  550. package/es/components/input-masked/style/dnb-input-masked.min.css +1 -1
  551. package/es/components/input-masked/style/dnb-input-masked.scss +5 -0
  552. package/es/components/number-format/NumberFormat.d.ts +1 -1
  553. package/es/components/number-format/NumberUtils.js +23 -14
  554. package/es/components/number-format/NumberUtils.js.map +1 -1
  555. package/es/components/pagination/InfinityScroller.d.ts +1 -1
  556. package/es/components/progress-indicator/ProgressIndicator.js +5 -7
  557. package/es/components/progress-indicator/ProgressIndicator.js.map +1 -1
  558. package/es/components/progress-indicator/ProgressIndicatorCircular.js +1 -1
  559. package/es/components/progress-indicator/ProgressIndicatorCircular.js.map +1 -1
  560. package/es/components/progress-indicator/ProgressIndicatorLinear.js +4 -4
  561. package/es/components/progress-indicator/ProgressIndicatorLinear.js.map +1 -1
  562. package/es/components/progress-indicator/style/dnb-progress-indicator.css +5 -2
  563. package/es/components/progress-indicator/style/dnb-progress-indicator.min.css +1 -1
  564. package/es/components/progress-indicator/style/dnb-progress-indicator.scss +5 -2
  565. package/es/components/slider/Slider.d.ts +1 -0
  566. package/es/components/slider/Slider.js +1 -0
  567. package/es/components/slider/Slider.js.map +1 -1
  568. package/es/components/slider/SliderInstance.js +17 -5
  569. package/es/components/slider/SliderInstance.js.map +1 -1
  570. package/es/components/slider/SliderMarker.d.ts +7 -0
  571. package/es/components/slider/SliderMarker.js +52 -0
  572. package/es/components/slider/SliderMarker.js.map +1 -0
  573. package/es/components/slider/SliderProvider.js +2 -1
  574. package/es/components/slider/SliderProvider.js.map +1 -1
  575. package/es/components/slider/style/dnb-slider.css +43 -2
  576. package/es/components/slider/style/dnb-slider.min.css +1 -1
  577. package/es/components/slider/style/dnb-slider.scss +44 -1
  578. package/es/components/slider/style/themes/dnb-slider-theme-sbanken.css +3 -0
  579. package/es/components/slider/style/themes/dnb-slider-theme-sbanken.min.css +1 -1
  580. package/es/components/slider/style/themes/dnb-slider-theme-sbanken.scss +4 -0
  581. package/es/components/slider/style/themes/dnb-slider-theme-ui.css +3 -0
  582. package/es/components/slider/style/themes/dnb-slider-theme-ui.min.css +1 -1
  583. package/es/components/slider/style/themes/dnb-slider-theme-ui.scss +5 -0
  584. package/es/components/slider/types.d.ts +6 -0
  585. package/es/components/slider/types.js.map +1 -1
  586. package/es/components/space/SpacingHelper.d.ts +5 -5
  587. package/es/components/table/Table.js +1 -1
  588. package/es/components/table/Table.js.map +1 -1
  589. package/es/components/table/TableAccordion.js +40 -55
  590. package/es/components/table/TableAccordion.js.map +1 -1
  591. package/es/components/table/TableAccordionTd.d.ts +9 -0
  592. package/{components/table/TableAccordionContent.js → es/components/table/TableAccordionTd.js} +16 -51
  593. package/es/components/table/TableAccordionTd.js.map +1 -0
  594. package/es/components/table/TableAccordionTr.d.ts +13 -0
  595. package/es/components/table/TableAccordionTr.js +51 -0
  596. package/es/components/table/TableAccordionTr.js.map +1 -0
  597. package/es/components/table/TableContext.d.ts +2 -2
  598. package/es/components/table/TableContext.js +2 -2
  599. package/es/components/table/TableContext.js.map +1 -1
  600. package/es/components/table/TableTd.d.ts +2 -2
  601. package/es/components/table/TableTd.js +2 -2
  602. package/es/components/table/TableTd.js.map +1 -1
  603. package/es/components/table/TableTr.d.ts +6 -1
  604. package/es/components/table/TableTr.js +9 -4
  605. package/es/components/table/TableTr.js.map +1 -1
  606. package/es/components/table/style/dnb-table.css +226 -139
  607. package/es/components/table/style/dnb-table.min.css +1 -1
  608. package/es/components/table/style/dnb-table.scss +60 -4
  609. package/es/components/table/style/table-accordion.scss +83 -98
  610. package/es/components/table/style/table-container.scss +9 -9
  611. package/es/components/table/style/table-mixins.scss +19 -2
  612. package/es/components/table/style/table-td.scss +82 -60
  613. package/es/components/table/style/table-th.scss +5 -30
  614. package/es/components/table/style/table-tr.scss +0 -20
  615. package/es/components/table/style/themes/dnb-table-theme-sbanken.css +34 -7
  616. package/es/components/table/style/themes/dnb-table-theme-sbanken.min.css +3 -1
  617. package/es/components/table/style/themes/dnb-table-theme-sbanken.scss +29 -10
  618. package/es/components/table/style/themes/dnb-table-theme-ui.css +14 -9
  619. package/es/components/table/style/themes/dnb-table-theme-ui.min.css +1 -1
  620. package/es/components/table/style/themes/dnb-table-theme-ui.scss +12 -22
  621. package/es/components/table/useTableAnimationHandler.d.ts +20 -0
  622. package/es/components/table/useTableAnimationHandler.js +62 -0
  623. package/es/components/table/useTableAnimationHandler.js.map +1 -0
  624. package/es/components/textarea/Textarea.d.ts +4 -10
  625. package/es/components/textarea/TextareaDocs.d.ts +2 -0
  626. package/es/components/textarea/TextareaDocs.js +98 -0
  627. package/es/components/textarea/TextareaDocs.js.map +1 -0
  628. package/es/components/textarea/style/dnb-textarea.css +1 -0
  629. package/es/components/textarea/style/dnb-textarea.min.css +1 -1
  630. package/es/components/textarea/style/dnb-textarea.scss +3 -0
  631. package/es/components/upload/UploadInfo.js +1 -1
  632. package/es/components/upload/UploadInfo.js.map +1 -1
  633. package/es/core/jest/jestSetupScreenshots.css +7 -0
  634. package/es/elements/blockquote/style/themes/dnb-blockquote-theme-sbanken.scss +1 -0
  635. package/es/elements/lib.d.ts +1 -1
  636. package/es/elements/lists/Dl.d.ts +5 -1
  637. package/es/elements/lists/Dl.js +5 -4
  638. package/es/elements/lists/Dl.js.map +1 -1
  639. package/es/elements/lists/style/lists-mixins.scss +24 -1
  640. package/es/extensions/forms/DataContext/Context.d.ts +1 -2
  641. package/es/extensions/forms/DataContext/Context.js.map +1 -1
  642. package/es/extensions/forms/DataContext/Provider/Provider.d.ts +1 -2
  643. package/es/extensions/forms/DataContext/Provider/Provider.js +54 -40
  644. package/es/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  645. package/es/extensions/forms/Field/Currency/Currency.js +1 -1
  646. package/es/extensions/forms/Field/Currency/Currency.js.map +1 -1
  647. package/es/extensions/forms/Field/Expiry/Expiry.js +1 -0
  648. package/es/extensions/forms/Field/Expiry/Expiry.js.map +1 -1
  649. package/es/extensions/forms/Field/FieldDocs.d.ts +3 -0
  650. package/es/extensions/forms/Field/FieldDocs.js +8 -0
  651. package/es/extensions/forms/Field/FieldDocs.js.map +1 -0
  652. package/es/extensions/forms/Field/Number/Number.d.ts +1 -0
  653. package/es/extensions/forms/Field/Number/Number.js +13 -7
  654. package/es/extensions/forms/Field/Number/Number.js.map +1 -1
  655. package/es/extensions/forms/Field/Number/NumberDocs.d.ts +2 -0
  656. package/es/extensions/forms/Field/Number/NumberDocs.js +85 -0
  657. package/es/extensions/forms/Field/Number/NumberDocs.js.map +1 -0
  658. package/es/extensions/forms/Field/Number/style/dnb-number.css +3 -1
  659. package/es/extensions/forms/Field/Number/style/dnb-number.min.css +1 -1
  660. package/es/extensions/forms/Field/Number/style/dnb-number.scss +4 -1
  661. package/es/extensions/forms/Field/Password/Password.d.ts +45 -0
  662. package/es/extensions/forms/Field/Password/Password.js +99 -0
  663. package/es/extensions/forms/Field/Password/Password.js.map +1 -0
  664. package/es/extensions/forms/Field/Password/index.d.ts +2 -0
  665. package/es/extensions/forms/Field/Password/index.js +3 -0
  666. package/es/extensions/forms/Field/Password/index.js.map +1 -0
  667. package/es/extensions/forms/Field/Password/style/dnb-password.css +6 -0
  668. package/es/extensions/forms/Field/Password/style/dnb-password.min.css +1 -0
  669. package/es/extensions/forms/Field/Password/style/dnb-password.scss +10 -0
  670. package/es/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js +4 -5
  671. package/es/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js.map +1 -1
  672. package/es/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.css +0 -12
  673. package/es/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.min.css +1 -1
  674. package/es/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.scss +0 -11
  675. package/es/extensions/forms/Field/Selection/Selection.d.ts +0 -1
  676. package/es/extensions/forms/Field/Selection/Selection.js +2 -11
  677. package/es/extensions/forms/Field/Selection/Selection.js.map +1 -1
  678. package/es/extensions/forms/Field/String/String.d.ts +20 -9
  679. package/es/extensions/forms/Field/String/String.js +52 -31
  680. package/es/extensions/forms/Field/String/String.js.map +1 -1
  681. package/es/extensions/forms/Field/String/StringDocs.d.ts +2 -0
  682. package/es/extensions/forms/Field/String/StringDocs.js +99 -0
  683. package/es/extensions/forms/Field/String/StringDocs.js.map +1 -0
  684. package/es/extensions/forms/Field/Toggle/Toggle.js +1 -1
  685. package/es/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
  686. package/es/extensions/forms/Field/index.d.ts +1 -0
  687. package/es/extensions/forms/Field/index.js +1 -0
  688. package/es/extensions/forms/Field/index.js.map +1 -1
  689. package/es/extensions/forms/FieldBlock/FieldBlock.d.ts +8 -3
  690. package/es/extensions/forms/FieldBlock/FieldBlock.js +195 -58
  691. package/es/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
  692. package/es/extensions/forms/FieldBlock/FieldBlockContext.d.ts +39 -6
  693. package/es/extensions/forms/FieldBlock/FieldBlockContext.js.map +1 -1
  694. package/es/extensions/forms/FieldBlock/FieldBlockDocs.d.ts +2 -0
  695. package/es/extensions/forms/FieldBlock/FieldBlockDocs.js +53 -0
  696. package/es/extensions/forms/FieldBlock/FieldBlockDocs.js.map +1 -0
  697. package/es/extensions/forms/FieldBlock/style/dnb-field-block.css +29 -2
  698. package/es/extensions/forms/FieldBlock/style/dnb-field-block.min.css +1 -1
  699. package/es/extensions/forms/FieldBlock/style/dnb-field-block.scss +28 -0
  700. package/es/extensions/forms/Form/Appearance/Appearance.d.ts +7 -0
  701. package/es/extensions/forms/Form/Appearance/Appearance.js +30 -0
  702. package/es/extensions/forms/Form/Appearance/Appearance.js.map +1 -0
  703. package/es/extensions/forms/Form/Appearance/AppearanceDocs.d.ts +2 -0
  704. package/es/extensions/forms/Form/Appearance/AppearanceDocs.js +8 -0
  705. package/es/extensions/forms/Form/Appearance/AppearanceDocs.js.map +1 -0
  706. package/es/extensions/forms/Form/Appearance/index.d.ts +2 -0
  707. package/es/extensions/forms/Form/Appearance/index.js +3 -0
  708. package/es/extensions/forms/Form/Appearance/index.js.map +1 -0
  709. package/es/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.css +6 -0
  710. package/es/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.min.css +1 -1
  711. package/es/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.scss +10 -2
  712. package/es/extensions/forms/Form/data-context/useData.d.ts +1 -1
  713. package/es/extensions/forms/Form/data-context/useData.js +3 -19
  714. package/es/extensions/forms/Form/data-context/useData.js.map +1 -1
  715. package/es/extensions/forms/Form/data-context/useError.d.ts +2 -1
  716. package/es/extensions/forms/Form/data-context/useError.js +4 -2
  717. package/es/extensions/forms/Form/data-context/useError.js.map +1 -1
  718. package/es/extensions/forms/Form/index.d.ts +1 -0
  719. package/es/extensions/forms/Form/index.js +1 -0
  720. package/es/extensions/forms/Form/index.js.map +1 -1
  721. package/es/extensions/forms/Value/Currency/Currency.js +2 -2
  722. package/es/extensions/forms/Value/Currency/Currency.js.map +1 -1
  723. package/es/extensions/forms/Value/Number/Number.d.ts +2 -2
  724. package/es/extensions/forms/Value/Number/Number.js +1 -1
  725. package/es/extensions/forms/Value/Number/Number.js.map +1 -1
  726. package/es/extensions/forms/Value/SummaryList/SummaryList.d.ts +7 -0
  727. package/es/extensions/forms/Value/SummaryList/SummaryList.js +26 -0
  728. package/es/extensions/forms/Value/SummaryList/SummaryList.js.map +1 -0
  729. package/es/extensions/forms/Value/SummaryList/SummaryListContext.d.ts +7 -0
  730. package/es/extensions/forms/Value/SummaryList/SummaryListContext.js +4 -0
  731. package/es/extensions/forms/Value/SummaryList/SummaryListContext.js.map +1 -0
  732. package/es/extensions/forms/Value/SummaryList/index.d.ts +2 -0
  733. package/es/extensions/forms/Value/SummaryList/index.js +3 -0
  734. package/es/extensions/forms/Value/SummaryList/index.js.map +1 -0
  735. package/es/extensions/forms/Value/ValueDocs.d.ts +2 -0
  736. package/es/extensions/forms/Value/ValueDocs.js +33 -0
  737. package/es/extensions/forms/Value/ValueDocs.js.map +1 -0
  738. package/es/extensions/forms/Value/index.d.ts +1 -0
  739. package/es/extensions/forms/Value/index.js +1 -0
  740. package/es/extensions/forms/Value/index.js.map +1 -1
  741. package/es/extensions/forms/ValueBlock/ValueBlock.js +12 -4
  742. package/es/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
  743. package/es/extensions/forms/hooks/DataValueDocs.d.ts +3 -0
  744. package/es/extensions/forms/hooks/DataValueDocs.js +110 -0
  745. package/es/extensions/forms/hooks/DataValueDocs.js.map +1 -0
  746. package/es/extensions/forms/hooks/useDataValue.d.ts +6 -14
  747. package/es/extensions/forms/hooks/useDataValue.js +92 -23
  748. package/es/extensions/forms/hooks/useDataValue.js.map +1 -1
  749. package/es/extensions/forms/hooks/useId.js +1 -1
  750. package/es/extensions/forms/hooks/useId.js.map +1 -1
  751. package/es/extensions/forms/hooks/useMountEffect.js +1 -1
  752. package/es/extensions/forms/hooks/useMountEffect.js.map +1 -1
  753. package/es/extensions/forms/hooks/useMounted.d.ts +2 -0
  754. package/es/extensions/forms/hooks/useMounted.js +14 -0
  755. package/es/extensions/forms/hooks/useMounted.js.map +1 -0
  756. package/es/extensions/forms/hooks/useUnmountEffect.d.ts +4 -0
  757. package/es/extensions/forms/hooks/useUnmountEffect.js +9 -0
  758. package/es/extensions/forms/hooks/useUnmountEffect.js.map +1 -0
  759. package/es/extensions/forms/style/dnb-forms.css +45 -15
  760. package/es/extensions/forms/style/dnb-forms.min.css +1 -1
  761. package/es/extensions/forms/types.d.ts +6 -4
  762. package/es/extensions/forms/types.js.map +1 -1
  763. package/es/extensions/payment-card/utils/CardDesigns.d.ts +96 -96
  764. package/es/fragments/drawer-list/DrawerListHelpers.d.ts +52 -52
  765. package/es/shared/Context.d.ts +2 -0
  766. package/es/shared/Context.js.map +1 -1
  767. package/es/shared/Eufemia.d.ts +1 -1
  768. package/es/shared/Eufemia.js +2 -2
  769. package/es/shared/Eufemia.js.map +1 -1
  770. package/es/shared/Theme.d.ts +7 -1
  771. package/es/shared/Theme.js +20 -7
  772. package/es/shared/Theme.js.map +1 -1
  773. package/es/shared/component-helper.d.ts +1 -0
  774. package/es/shared/component-helper.js +6 -0
  775. package/es/shared/component-helper.js.map +1 -1
  776. package/es/shared/helpers/debounce.d.ts +37 -0
  777. package/es/shared/helpers/debounce.js +76 -0
  778. package/es/shared/helpers/debounce.js.map +1 -0
  779. package/es/shared/helpers/filterValidProps.d.ts +2 -2
  780. package/es/shared/helpers/filterValidProps.js +2 -2
  781. package/es/shared/helpers/filterValidProps.js.map +1 -1
  782. package/es/shared/helpers/useSharedState.d.ts +1 -0
  783. package/es/shared/helpers/useSharedState.js +49 -20
  784. package/es/shared/helpers/useSharedState.js.map +1 -1
  785. package/es/shared/helpers/withCamelCaseProps.d.ts +14 -1
  786. package/es/shared/helpers/withCamelCaseProps.js.map +1 -1
  787. package/es/shared/helpers.d.ts +1 -25
  788. package/es/shared/helpers.js +1 -29
  789. package/es/shared/helpers.js.map +1 -1
  790. package/es/shared/locales/en-GB.d.ts +5 -3
  791. package/es/shared/locales/en-GB.js +7 -5
  792. package/es/shared/locales/en-GB.js.map +1 -1
  793. package/es/shared/locales/en-US.d.ts +5 -3
  794. package/es/shared/locales/index.d.ts +10 -6
  795. package/es/shared/locales/nb-NO.d.ts +5 -3
  796. package/es/shared/locales/nb-NO.js +7 -5
  797. package/es/shared/locales/nb-NO.js.map +1 -1
  798. package/es/shared/types.d.ts +5 -0
  799. package/es/shared/types.js.map +1 -1
  800. package/es/shared/useTheme.d.ts +1 -0
  801. package/es/style/dnb-ui-components.css +359 -171
  802. package/es/style/dnb-ui-components.min.css +3 -3
  803. package/es/style/dnb-ui-elements.css +25 -5
  804. package/es/style/dnb-ui-elements.min.css +1 -1
  805. package/es/style/dnb-ui-extensions.css +45 -15
  806. package/es/style/dnb-ui-extensions.min.css +1 -1
  807. package/es/style/dnb-ui-forms.css +45 -15
  808. package/es/style/dnb-ui-forms.min.css +1 -1
  809. package/es/style/dnb-ui-forms.scss +1 -0
  810. package/es/style/themes/theme-eiendom/eiendom-theme-basis.css +25 -5
  811. package/es/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
  812. package/es/style/themes/theme-eiendom/eiendom-theme-components.css +421 -195
  813. package/es/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
  814. package/es/style/themes/theme-eiendom/eiendom-theme-elements.css +25 -5
  815. package/es/style/themes/theme-eiendom/eiendom-theme-elements.min.css +1 -1
  816. package/es/style/themes/theme-eiendom/eiendom-theme-extensions.css +45 -15
  817. package/es/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
  818. package/es/style/themes/theme-eiendom/eiendom-theme-forms.css +45 -15
  819. package/es/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
  820. package/es/style/themes/theme-sbanken/sbanken-theme-basis.css +26 -5
  821. package/es/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
  822. package/es/style/themes/theme-sbanken/sbanken-theme-components.css +464 -204
  823. package/es/style/themes/theme-sbanken/sbanken-theme-components.min.css +8 -6
  824. package/es/style/themes/theme-sbanken/sbanken-theme-elements.css +26 -5
  825. package/es/style/themes/theme-sbanken/sbanken-theme-elements.min.css +1 -1
  826. package/es/style/themes/theme-sbanken/sbanken-theme-extensions.css +45 -15
  827. package/es/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
  828. package/es/style/themes/theme-sbanken/sbanken-theme-forms.css +45 -15
  829. package/es/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
  830. package/es/style/themes/theme-ui/prism/dnb-prism-theme.d.ts +3 -3
  831. package/es/style/themes/theme-ui/ui-theme-basis.css +25 -5
  832. package/es/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
  833. package/es/style/themes/theme-ui/ui-theme-components.css +421 -195
  834. package/es/style/themes/theme-ui/ui-theme-components.min.css +4 -4
  835. package/es/style/themes/theme-ui/ui-theme-elements.css +25 -5
  836. package/es/style/themes/theme-ui/ui-theme-elements.min.css +1 -1
  837. package/es/style/themes/theme-ui/ui-theme-extensions.css +45 -15
  838. package/es/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
  839. package/es/style/themes/theme-ui/ui-theme-forms.css +45 -15
  840. package/es/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
  841. package/es/style/themes/theme-ui/ui-theme-tags.css +25 -5
  842. package/es/style/themes/theme-ui/ui-theme-tags.min.css +1 -1
  843. package/esm/dnb-ui-basis.min.mjs +1 -1
  844. package/esm/dnb-ui-components.min.mjs +1 -1
  845. package/esm/dnb-ui-elements.min.mjs +1 -1
  846. package/esm/dnb-ui-extensions.min.mjs +3 -3
  847. package/esm/dnb-ui-lib.min.mjs +1 -1
  848. package/extensions/forms/DataContext/Context.d.ts +1 -2
  849. package/extensions/forms/DataContext/Context.js.map +1 -1
  850. package/extensions/forms/DataContext/Provider/Provider.d.ts +1 -2
  851. package/extensions/forms/DataContext/Provider/Provider.js +54 -40
  852. package/extensions/forms/DataContext/Provider/Provider.js.map +1 -1
  853. package/extensions/forms/Field/Currency/Currency.js +1 -1
  854. package/extensions/forms/Field/Currency/Currency.js.map +1 -1
  855. package/extensions/forms/Field/Expiry/Expiry.js +1 -0
  856. package/extensions/forms/Field/Expiry/Expiry.js.map +1 -1
  857. package/extensions/forms/Field/FieldDocs.d.ts +3 -0
  858. package/extensions/forms/Field/FieldDocs.js +8 -0
  859. package/extensions/forms/Field/FieldDocs.js.map +1 -0
  860. package/extensions/forms/Field/Number/Number.d.ts +1 -0
  861. package/extensions/forms/Field/Number/Number.js +13 -7
  862. package/extensions/forms/Field/Number/Number.js.map +1 -1
  863. package/extensions/forms/Field/Number/NumberDocs.d.ts +2 -0
  864. package/extensions/forms/Field/Number/NumberDocs.js +85 -0
  865. package/extensions/forms/Field/Number/NumberDocs.js.map +1 -0
  866. package/extensions/forms/Field/Number/style/dnb-number.css +3 -1
  867. package/extensions/forms/Field/Number/style/dnb-number.min.css +1 -1
  868. package/extensions/forms/Field/Number/style/dnb-number.scss +4 -1
  869. package/extensions/forms/Field/Password/Password.d.ts +45 -0
  870. package/extensions/forms/Field/Password/Password.js +99 -0
  871. package/extensions/forms/Field/Password/Password.js.map +1 -0
  872. package/extensions/forms/Field/Password/index.d.ts +2 -0
  873. package/extensions/forms/Field/Password/index.js +3 -0
  874. package/extensions/forms/Field/Password/index.js.map +1 -0
  875. package/extensions/forms/Field/Password/style/dnb-password.css +6 -0
  876. package/extensions/forms/Field/Password/style/dnb-password.min.css +1 -0
  877. package/extensions/forms/Field/Password/style/dnb-password.scss +10 -0
  878. package/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js +4 -5
  879. package/extensions/forms/Field/PostalCodeAndCity/PostalCodeAndCity.js.map +1 -1
  880. package/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.css +0 -12
  881. package/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.min.css +1 -1
  882. package/extensions/forms/Field/PostalCodeAndCity/style/dnb-postal-code-and-city.scss +0 -11
  883. package/extensions/forms/Field/Selection/Selection.d.ts +0 -1
  884. package/extensions/forms/Field/Selection/Selection.js +2 -11
  885. package/extensions/forms/Field/Selection/Selection.js.map +1 -1
  886. package/extensions/forms/Field/String/String.d.ts +20 -9
  887. package/extensions/forms/Field/String/String.js +52 -31
  888. package/extensions/forms/Field/String/String.js.map +1 -1
  889. package/extensions/forms/Field/String/StringDocs.d.ts +2 -0
  890. package/extensions/forms/Field/String/StringDocs.js +99 -0
  891. package/extensions/forms/Field/String/StringDocs.js.map +1 -0
  892. package/extensions/forms/Field/Toggle/Toggle.js +1 -1
  893. package/extensions/forms/Field/Toggle/Toggle.js.map +1 -1
  894. package/extensions/forms/Field/index.d.ts +1 -0
  895. package/extensions/forms/Field/index.js +1 -0
  896. package/extensions/forms/Field/index.js.map +1 -1
  897. package/extensions/forms/FieldBlock/FieldBlock.d.ts +8 -3
  898. package/extensions/forms/FieldBlock/FieldBlock.js +203 -64
  899. package/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
  900. package/extensions/forms/FieldBlock/FieldBlockContext.d.ts +39 -6
  901. package/extensions/forms/FieldBlock/FieldBlockContext.js.map +1 -1
  902. package/extensions/forms/FieldBlock/FieldBlockDocs.d.ts +2 -0
  903. package/extensions/forms/FieldBlock/FieldBlockDocs.js +53 -0
  904. package/extensions/forms/FieldBlock/FieldBlockDocs.js.map +1 -0
  905. package/extensions/forms/FieldBlock/style/dnb-field-block.css +29 -2
  906. package/extensions/forms/FieldBlock/style/dnb-field-block.min.css +1 -1
  907. package/extensions/forms/FieldBlock/style/dnb-field-block.scss +28 -0
  908. package/extensions/forms/Form/Appearance/Appearance.d.ts +7 -0
  909. package/extensions/forms/Form/Appearance/Appearance.js +30 -0
  910. package/extensions/forms/Form/Appearance/Appearance.js.map +1 -0
  911. package/extensions/forms/Form/Appearance/AppearanceDocs.d.ts +2 -0
  912. package/extensions/forms/Form/Appearance/AppearanceDocs.js +8 -0
  913. package/extensions/forms/Form/Appearance/AppearanceDocs.js.map +1 -0
  914. package/extensions/forms/Form/Appearance/index.d.ts +2 -0
  915. package/extensions/forms/Form/Appearance/index.js +3 -0
  916. package/extensions/forms/Form/Appearance/index.js.map +1 -0
  917. package/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.css +6 -0
  918. package/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.min.css +1 -1
  919. package/extensions/forms/Form/ButtonRow/style/dnb-form-button-row.scss +10 -2
  920. package/extensions/forms/Form/data-context/useData.d.ts +1 -1
  921. package/extensions/forms/Form/data-context/useData.js +3 -19
  922. package/extensions/forms/Form/data-context/useData.js.map +1 -1
  923. package/extensions/forms/Form/data-context/useError.d.ts +2 -1
  924. package/extensions/forms/Form/data-context/useError.js +4 -2
  925. package/extensions/forms/Form/data-context/useError.js.map +1 -1
  926. package/extensions/forms/Form/index.d.ts +1 -0
  927. package/extensions/forms/Form/index.js +1 -0
  928. package/extensions/forms/Form/index.js.map +1 -1
  929. package/extensions/forms/Value/Currency/Currency.js +2 -2
  930. package/extensions/forms/Value/Currency/Currency.js.map +1 -1
  931. package/extensions/forms/Value/Number/Number.d.ts +2 -2
  932. package/extensions/forms/Value/Number/Number.js +1 -1
  933. package/extensions/forms/Value/Number/Number.js.map +1 -1
  934. package/extensions/forms/Value/SummaryList/SummaryList.d.ts +7 -0
  935. package/extensions/forms/Value/SummaryList/SummaryList.js +26 -0
  936. package/extensions/forms/Value/SummaryList/SummaryList.js.map +1 -0
  937. package/extensions/forms/Value/SummaryList/SummaryListContext.d.ts +7 -0
  938. package/extensions/forms/Value/SummaryList/SummaryListContext.js +4 -0
  939. package/extensions/forms/Value/SummaryList/SummaryListContext.js.map +1 -0
  940. package/extensions/forms/Value/SummaryList/index.d.ts +2 -0
  941. package/extensions/forms/Value/SummaryList/index.js +3 -0
  942. package/extensions/forms/Value/SummaryList/index.js.map +1 -0
  943. package/extensions/forms/Value/ValueDocs.d.ts +2 -0
  944. package/extensions/forms/Value/ValueDocs.js +33 -0
  945. package/extensions/forms/Value/ValueDocs.js.map +1 -0
  946. package/extensions/forms/Value/index.d.ts +1 -0
  947. package/extensions/forms/Value/index.js +1 -0
  948. package/extensions/forms/Value/index.js.map +1 -1
  949. package/extensions/forms/ValueBlock/ValueBlock.js +12 -4
  950. package/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
  951. package/extensions/forms/hooks/DataValueDocs.d.ts +3 -0
  952. package/extensions/forms/hooks/DataValueDocs.js +110 -0
  953. package/extensions/forms/hooks/DataValueDocs.js.map +1 -0
  954. package/extensions/forms/hooks/useDataValue.d.ts +6 -14
  955. package/extensions/forms/hooks/useDataValue.js +92 -23
  956. package/extensions/forms/hooks/useDataValue.js.map +1 -1
  957. package/extensions/forms/hooks/useId.js +1 -1
  958. package/extensions/forms/hooks/useId.js.map +1 -1
  959. package/extensions/forms/hooks/useMountEffect.js +1 -1
  960. package/extensions/forms/hooks/useMountEffect.js.map +1 -1
  961. package/extensions/forms/hooks/useMounted.d.ts +2 -0
  962. package/extensions/forms/hooks/useMounted.js +14 -0
  963. package/extensions/forms/hooks/useMounted.js.map +1 -0
  964. package/extensions/forms/hooks/useUnmountEffect.d.ts +4 -0
  965. package/extensions/forms/hooks/useUnmountEffect.js +9 -0
  966. package/extensions/forms/hooks/useUnmountEffect.js.map +1 -0
  967. package/extensions/forms/style/dnb-forms.css +45 -15
  968. package/extensions/forms/style/dnb-forms.min.css +1 -1
  969. package/extensions/forms/types.d.ts +6 -4
  970. package/extensions/forms/types.js.map +1 -1
  971. package/extensions/payment-card/utils/CardDesigns.d.ts +96 -96
  972. package/fragments/drawer-list/DrawerListHelpers.d.ts +52 -52
  973. package/package.json +1 -1
  974. package/shared/Context.d.ts +2 -0
  975. package/shared/Context.js.map +1 -1
  976. package/shared/Eufemia.d.ts +1 -1
  977. package/shared/Eufemia.js +2 -2
  978. package/shared/Eufemia.js.map +1 -1
  979. package/shared/Theme.d.ts +7 -1
  980. package/shared/Theme.js +20 -7
  981. package/shared/Theme.js.map +1 -1
  982. package/shared/component-helper.d.ts +1 -0
  983. package/shared/component-helper.js +9 -0
  984. package/shared/component-helper.js.map +1 -1
  985. package/shared/helpers/debounce.d.ts +37 -0
  986. package/shared/helpers/debounce.js +83 -0
  987. package/shared/helpers/debounce.js.map +1 -0
  988. package/shared/helpers/filterValidProps.d.ts +2 -2
  989. package/shared/helpers/filterValidProps.js +2 -2
  990. package/shared/helpers/filterValidProps.js.map +1 -1
  991. package/shared/helpers/useSharedState.d.ts +1 -0
  992. package/shared/helpers/useSharedState.js +49 -20
  993. package/shared/helpers/useSharedState.js.map +1 -1
  994. package/shared/helpers/withCamelCaseProps.d.ts +14 -1
  995. package/shared/helpers/withCamelCaseProps.js.map +1 -1
  996. package/shared/helpers.d.ts +1 -25
  997. package/shared/helpers.js +3 -36
  998. package/shared/helpers.js.map +1 -1
  999. package/shared/locales/en-GB.d.ts +5 -3
  1000. package/shared/locales/en-GB.js +7 -5
  1001. package/shared/locales/en-GB.js.map +1 -1
  1002. package/shared/locales/en-US.d.ts +5 -3
  1003. package/shared/locales/index.d.ts +10 -6
  1004. package/shared/locales/nb-NO.d.ts +5 -3
  1005. package/shared/locales/nb-NO.js +7 -5
  1006. package/shared/locales/nb-NO.js.map +1 -1
  1007. package/shared/types.d.ts +5 -0
  1008. package/shared/types.js.map +1 -1
  1009. package/shared/useTheme.d.ts +1 -0
  1010. package/style/dnb-ui-components.css +359 -171
  1011. package/style/dnb-ui-components.min.css +3 -3
  1012. package/style/dnb-ui-elements.css +25 -5
  1013. package/style/dnb-ui-elements.min.css +1 -1
  1014. package/style/dnb-ui-extensions.css +45 -15
  1015. package/style/dnb-ui-extensions.min.css +1 -1
  1016. package/style/dnb-ui-forms.css +45 -15
  1017. package/style/dnb-ui-forms.min.css +1 -1
  1018. package/style/dnb-ui-forms.scss +1 -0
  1019. package/style/themes/theme-eiendom/eiendom-theme-basis.css +25 -5
  1020. package/style/themes/theme-eiendom/eiendom-theme-basis.min.css +1 -1
  1021. package/style/themes/theme-eiendom/eiendom-theme-components.css +421 -195
  1022. package/style/themes/theme-eiendom/eiendom-theme-components.min.css +4 -4
  1023. package/style/themes/theme-eiendom/eiendom-theme-elements.css +25 -5
  1024. package/style/themes/theme-eiendom/eiendom-theme-elements.min.css +1 -1
  1025. package/style/themes/theme-eiendom/eiendom-theme-extensions.css +45 -15
  1026. package/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
  1027. package/style/themes/theme-eiendom/eiendom-theme-forms.css +45 -15
  1028. package/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
  1029. package/style/themes/theme-sbanken/sbanken-theme-basis.css +26 -5
  1030. package/style/themes/theme-sbanken/sbanken-theme-basis.min.css +1 -1
  1031. package/style/themes/theme-sbanken/sbanken-theme-components.css +464 -204
  1032. package/style/themes/theme-sbanken/sbanken-theme-components.min.css +8 -6
  1033. package/style/themes/theme-sbanken/sbanken-theme-elements.css +26 -5
  1034. package/style/themes/theme-sbanken/sbanken-theme-elements.min.css +1 -1
  1035. package/style/themes/theme-sbanken/sbanken-theme-extensions.css +45 -15
  1036. package/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
  1037. package/style/themes/theme-sbanken/sbanken-theme-forms.css +45 -15
  1038. package/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
  1039. package/style/themes/theme-ui/prism/dnb-prism-theme.d.ts +3 -3
  1040. package/style/themes/theme-ui/ui-theme-basis.css +25 -5
  1041. package/style/themes/theme-ui/ui-theme-basis.min.css +1 -1
  1042. package/style/themes/theme-ui/ui-theme-components.css +421 -195
  1043. package/style/themes/theme-ui/ui-theme-components.min.css +4 -4
  1044. package/style/themes/theme-ui/ui-theme-elements.css +25 -5
  1045. package/style/themes/theme-ui/ui-theme-elements.min.css +1 -1
  1046. package/style/themes/theme-ui/ui-theme-extensions.css +45 -15
  1047. package/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
  1048. package/style/themes/theme-ui/ui-theme-forms.css +45 -15
  1049. package/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
  1050. package/style/themes/theme-ui/ui-theme-tags.css +25 -5
  1051. package/style/themes/theme-ui/ui-theme-tags.min.css +1 -1
  1052. package/umd/dnb-ui-basis.min.js +1 -1
  1053. package/umd/dnb-ui-components.min.js +1 -1
  1054. package/umd/dnb-ui-elements.min.js +1 -1
  1055. package/umd/dnb-ui-extensions.min.js +3 -3
  1056. package/umd/dnb-ui-lib.min.js +1 -1
  1057. package/cjs/components/table/TableAccordionContent.d.ts +0 -18
  1058. package/cjs/components/table/TableAccordionContent.js.map +0 -1
  1059. package/components/table/TableAccordionContent.d.ts +0 -18
  1060. package/components/table/TableAccordionContent.js.map +0 -1
  1061. package/es/components/table/TableAccordionContent.d.ts +0 -18
  1062. package/es/components/table/TableAccordionContent.js.map +0 -1
@@ -0,0 +1,3 @@
1
+ import { PropertiesTableProps } from '../../../shared/types';
2
+ export declare const dataValueProperties: PropertiesTableProps;
3
+ export declare const dataValueEvents: PropertiesTableProps;
@@ -0,0 +1,110 @@
1
+ export const dataValueProperties = {
2
+ value: {
3
+ doc: 'Source data value for the input.',
4
+ type: '{valueType}',
5
+ status: 'optional'
6
+ },
7
+ path: {
8
+ doc: 'JSON Pointer for where the data for this input is located in the source dataset (when using Form.Handler or DataContext). The `path` will also be set as the `name` attribute for the [string](/uilib/extensions/forms/base-fields/String/)-field.',
9
+ type: 'string',
10
+ status: 'optional'
11
+ },
12
+ id: {
13
+ doc: 'Unique id for connecting Form.Handler and helper tools such as Form.useData.',
14
+ type: 'string',
15
+ status: 'optional'
16
+ },
17
+ info: {
18
+ doc: 'Info message shown below / after the input.',
19
+ type: 'React.Node',
20
+ status: 'optional'
21
+ },
22
+ warning: {
23
+ doc: 'Warning message shown below / after the input.',
24
+ type: 'React.Node',
25
+ status: 'optional'
26
+ },
27
+ error: {
28
+ doc: 'Error message shown below / after the input.',
29
+ type: 'Error',
30
+ status: 'optional'
31
+ },
32
+ disabled: {
33
+ doc: 'Set `true` to show the field but without the possibility of changing the value.',
34
+ type: 'boolean',
35
+ status: 'optional'
36
+ },
37
+ emptyValue: {
38
+ doc: 'The value to use (in `onChange` events etc) when emptying the field. Makes it possible for instance to provide `undefined` instead of an empty string when clearing the content of a text input.',
39
+ type: 'any',
40
+ status: 'optional'
41
+ },
42
+ required: {
43
+ doc: 'When set `true`, the input will give an error if the value cannot be empty.',
44
+ type: 'boolean',
45
+ status: 'optional'
46
+ },
47
+ schema: {
48
+ doc: 'Custom JSON Schema for validating the value.',
49
+ type: 'object',
50
+ status: 'optional'
51
+ },
52
+ validateInitially: {
53
+ doc: 'Set `true` to show validation based errors initially (from given value-prop or source data) before the user interacts with the field.',
54
+ type: 'boolean',
55
+ status: 'optional'
56
+ },
57
+ validateUnchanged: {
58
+ doc: 'Set `true` to show validation based errors when the field is touched (like focusing a field and blurring) without having changed the value. Since the user did not introduce a new error, this will apply when the value was initially invalid based on validation.',
59
+ type: 'boolean',
60
+ status: 'optional'
61
+ },
62
+ continuousValidation: {
63
+ doc: 'Set `true` to show validation based errors continuously while writing, not just when blurring the field.',
64
+ type: 'boolean',
65
+ status: 'optional'
66
+ },
67
+ errorMessages: {
68
+ doc: 'Custom error messages for each type of error, overriding default messages.',
69
+ type: 'object',
70
+ status: 'optional'
71
+ },
72
+ validator: {
73
+ doc: 'Custom validator function that will be called for every change done by the user. Can be asynchronous or synchronous.',
74
+ type: 'function',
75
+ status: 'optional'
76
+ },
77
+ onBlurValidator: {
78
+ doc: 'Custom validator function that will be called when the user leaves the field (blurring a text input, closing a dropdown etc). Can be asynchronous or synchronous.',
79
+ type: 'function',
80
+ status: 'optional'
81
+ },
82
+ toInput: {
83
+ doc: 'Derivate called when the received / active value is sent to the input. Can be used for casting, changing syntax etc.',
84
+ type: 'function',
85
+ status: 'optional'
86
+ },
87
+ fromInput: {
88
+ doc: 'Derivate called when changes is made by the user, to cast or change syntax back to the original (opposite of `toInput`).',
89
+ type: 'function',
90
+ status: 'optional'
91
+ }
92
+ };
93
+ export const dataValueEvents = {
94
+ onChange: {
95
+ doc: ' Will be called on value changes made by the user, with the new value as argument.',
96
+ type: 'function',
97
+ status: 'optional'
98
+ },
99
+ onFocus: {
100
+ doc: ' Will be called when the component gets into focus. Like clicking inside a text input or opening a dropdown. Called with active value as argument.',
101
+ type: 'function',
102
+ status: 'optional'
103
+ },
104
+ onBlur: {
105
+ doc: ' Will be called when the component stop being in focus. Like when going to next field, or closing a dropdown. Called with active value as argument.',
106
+ type: 'function',
107
+ status: 'optional'
108
+ }
109
+ };
110
+ //# sourceMappingURL=DataValueDocs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataValueDocs.js","names":["dataValueProperties","value","doc","type","status","path","id","info","warning","error","disabled","emptyValue","required","schema","validateInitially","validateUnchanged","continuousValidation","errorMessages","validator","onBlurValidator","toInput","fromInput","dataValueEvents","onChange","onFocus","onBlur"],"sources":["../../../../../src/extensions/forms/hooks/DataValueDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../../shared/types'\n\nexport const dataValueProperties: PropertiesTableProps = {\n value: {\n doc: 'Source data value for the input.',\n type: '{valueType}',\n status: 'optional',\n },\n path: {\n doc: 'JSON Pointer for where the data for this input is located in the source dataset (when using Form.Handler or DataContext). The `path` will also be set as the `name` attribute for the [string](/uilib/extensions/forms/base-fields/String/)-field.',\n type: 'string',\n status: 'optional',\n },\n id: {\n doc: 'Unique id for connecting Form.Handler and helper tools such as Form.useData.',\n type: 'string',\n status: 'optional',\n },\n info: {\n doc: 'Info message shown below / after the input.',\n type: 'React.Node',\n status: 'optional',\n },\n warning: {\n doc: 'Warning message shown below / after the input.',\n type: 'React.Node',\n status: 'optional',\n },\n error: {\n doc: 'Error message shown below / after the input.',\n type: 'Error',\n status: 'optional',\n },\n disabled: {\n doc: 'Set `true` to show the field but without the possibility of changing the value.',\n type: 'boolean',\n status: 'optional',\n },\n emptyValue: {\n doc: 'The value to use (in `onChange` events etc) when emptying the field. Makes it possible for instance to provide `undefined` instead of an empty string when clearing the content of a text input.',\n type: 'any',\n status: 'optional',\n },\n required: {\n doc: 'When set `true`, the input will give an error if the value cannot be empty.',\n type: 'boolean',\n status: 'optional',\n },\n schema: {\n doc: 'Custom JSON Schema for validating the value.',\n type: 'object',\n status: 'optional',\n },\n validateInitially: {\n doc: 'Set `true` to show validation based errors initially (from given value-prop or source data) before the user interacts with the field.',\n type: 'boolean',\n status: 'optional',\n },\n validateUnchanged: {\n doc: 'Set `true` to show validation based errors when the field is touched (like focusing a field and blurring) without having changed the value. Since the user did not introduce a new error, this will apply when the value was initially invalid based on validation.',\n type: 'boolean',\n status: 'optional',\n },\n continuousValidation: {\n doc: 'Set `true` to show validation based errors continuously while writing, not just when blurring the field.',\n type: 'boolean',\n status: 'optional',\n },\n errorMessages: {\n doc: 'Custom error messages for each type of error, overriding default messages.',\n type: 'object',\n status: 'optional',\n },\n validator: {\n doc: 'Custom validator function that will be called for every change done by the user. Can be asynchronous or synchronous.',\n type: 'function',\n status: 'optional',\n },\n onBlurValidator: {\n doc: 'Custom validator function that will be called when the user leaves the field (blurring a text input, closing a dropdown etc). Can be asynchronous or synchronous.',\n type: 'function',\n status: 'optional',\n },\n toInput: {\n doc: 'Derivate called when the received / active value is sent to the input. Can be used for casting, changing syntax etc.',\n type: 'function',\n status: 'optional',\n },\n fromInput: {\n doc: 'Derivate called when changes is made by the user, to cast or change syntax back to the original (opposite of `toInput`).',\n type: 'function',\n status: 'optional',\n },\n}\n\nexport const dataValueEvents: PropertiesTableProps = {\n onChange: {\n doc: ' Will be called on value changes made by the user, with the new value as argument.',\n type: 'function',\n status: 'optional',\n },\n onFocus: {\n doc: ' Will be called when the component gets into focus. Like clicking inside a text input or opening a dropdown. Called with active value as argument.',\n type: 'function',\n status: 'optional',\n },\n onBlur: {\n doc: ' Will be called when the component stop being in focus. Like when going to next field, or closing a dropdown. Called with active value as argument.',\n type: 'function',\n status: 'optional',\n },\n}\n"],"mappings":"AAEA,OAAO,MAAMA,mBAAyC,GAAG;EACvDC,KAAK,EAAE;IACLC,GAAG,EAAE,kCAAkC;IACvCC,IAAI,EAAE,aAAa;IACnBC,MAAM,EAAE;EACV,CAAC;EACDC,IAAI,EAAE;IACJH,GAAG,EAAE,oPAAoP;IACzPC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDE,EAAE,EAAE;IACFJ,GAAG,EAAE,8EAA8E;IACnFC,IAAI,EAAE,QAAQ;IACdC,MAAM,E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,eAAe,EAAE;IACfjB,GAAG,EAAE,mKAAmK;IACxKC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDgB,OAAO,EAAE;IACPlB,GAAG,EAAE,sHAAsH;IAC3HC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDiB,SAAS,EAAE;IACTnB,GAAG,EAAE,0HAA0H;IAC/HC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AACF,CAAC;AAED,OAAO,MAAMkB,eAAqC,GAAG;EACnDC,QAAQ,EAAE;IACRrB,GAAG,EAAE,oFAAoF;IACzFC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDoB,OAAO,EAAE;IACPtB,GAAG,EAAE,oJAAoJ;IACzJC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDqB,MAAM,EAAE;IACNvB,GAAG,EAAE,qJAAqJ;IAC1JC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AACF,CAAC"}
@@ -1,26 +1,18 @@
1
- import { FormError, FieldProps } from '../types';
1
+ import { AriaAttributes } from 'react';
2
+ import { FieldProps } from '../types';
2
3
  import { ContextState } from '../DataContext';
3
- export default function useDataValue<Value = unknown, Props extends FieldProps<Value> = FieldProps<Value>>(props: Props): Props & ReturnAdditional<Value>;
4
+ export default function useDataValue<Value = unknown, Props extends FieldProps<Value> = FieldProps<Value>>(props: Props): Props & FieldProps<Value> & ReturnAdditional<Value>;
4
5
  interface ReturnAdditional<Value> {
5
- id: string;
6
- name: string;
7
6
  value: Value;
8
- error: Error | FormError | undefined;
9
- autoComplete: HTMLInputElement['autocomplete'];
10
- disabled: boolean;
11
- hasError: boolean;
12
7
  isChanged: boolean;
8
+ ariaAttributes: AriaAttributes;
13
9
  dataContext: ContextState;
14
- ariaAttributes: {
15
- 'aria-invalid'?: 'true' | 'false';
16
- 'aria-required'?: 'true' | 'false';
17
- };
18
10
  setHasFocus: (hasFocus: boolean, valueOverride?: unknown) => void;
19
11
  handleFocus: () => void;
20
12
  handleBlur: () => void;
21
- handleChange: FieldProps<unknown>['onChange'];
13
+ handleChange: FieldProps<Value>['onChange'];
22
14
  updateValue: (value: Value) => void;
23
15
  forceUpdate: () => void;
24
16
  }
25
- export declare function omitDataValueProps<OmittedProps extends ReturnAdditional<unknown>>(props: OmittedProps): Omit<OmittedProps, keyof ReturnAdditional<unknown>>;
17
+ export declare function omitDataValueProps<Props extends FieldProps<unknown> & ReturnAdditional<unknown>>(props: Props): Omit<Props, "error" | "info" | "autoComplete" | "name" | "hasError" | "warning" | "forceUpdate" | "isChanged" | "handleChange" | "ariaAttributes" | "dataContext" | "setHasFocus" | "handleFocus" | "handleBlur" | "updateValue">;
26
18
  export {};
@@ -2,7 +2,7 @@
2
2
 
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
4
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
5
- const _excluded = ["name", "error", "hasError", "isChanged", "autoComplete", "ariaAttributes", "dataContext", "setHasFocus", "handleFocus", "handleBlur", "handleChange", "updateValue", "forceUpdate"];
5
+ const _excluded = ["name", "error", "warning", "info", "hasError", "isChanged", "autoComplete", "ariaAttributes", "dataContext", "setHasFocus", "handleFocus", "handleBlur", "handleChange", "updateValue", "forceUpdate"];
6
6
  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; }
7
7
  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; }
8
8
  import { useRef, useEffect, useContext, useCallback, useMemo, useReducer } from 'react';
@@ -10,11 +10,13 @@ import pointer from 'json-pointer';
10
10
  import { errorChanged } from '../utils';
11
11
  import { ajvErrorsToOneFormError } from '../utils/ajv';
12
12
  import { FormError } from '../types';
13
- import { Context } from '../DataContext';
13
+ import { Context as DataContext } from '../DataContext';
14
+ import { combineDescribedBy } from '../../../shared/component-helper';
14
15
  import SharedContext from '../../../shared/Context';
15
16
  import FieldBlockContext from '../FieldBlock/FieldBlockContext';
16
17
  import IterateElementContext from '../Iterate/IterateElementContext';
17
18
  import useMountEffect from './useMountEffect';
19
+ import useUnmountEffect from './useUnmountEffect';
18
20
  import useUpdateEffect from './useUpdateEffect';
19
21
  import useProcessManager from './useProcessManager';
20
22
  import useId from './useId';
@@ -30,6 +32,8 @@ export default function useDataValue(props) {
30
32
  itemPath,
31
33
  emptyValue,
32
34
  required,
35
+ info,
36
+ warning,
33
37
  error: errorProp,
34
38
  errorMessages,
35
39
  onFocus,
@@ -62,7 +66,7 @@ export default function useDataValue(props) {
62
66
  startProcess
63
67
  } = useProcessManager();
64
68
  const id = useId(props.id);
65
- const dataContext = useContext(Context);
69
+ const dataContext = useContext(DataContext);
66
70
  const fieldBlockContext = useContext(FieldBlockContext);
67
71
  const iterateElementContext = useContext(IterateElementContext);
68
72
  const sharedContext = useContext(SharedContext);
@@ -87,8 +91,8 @@ export default function useDataValue(props) {
87
91
  const dataContextError = path ? dataContextErrors === null || dataContextErrors === void 0 ? void 0 : dataContextErrors[path] : undefined;
88
92
  const inFieldBlock = Boolean(fieldBlockContext);
89
93
  const {
90
- setError: setFieldBlockError,
91
- setShowError: setShowFieldBlockError
94
+ setFieldState: setFieldBlockState,
95
+ showFieldError: showFieldBlockError
92
96
  } = fieldBlockContext !== null && fieldBlockContext !== void 0 ? fieldBlockContext : {};
93
97
  const inIterate = Boolean(iterateElementContext);
94
98
  const {
@@ -141,12 +145,12 @@ export default function useDataValue(props) {
141
145
  const schemaValidatorRef = useRef(schema ? (_dataContext$ajvInsta = dataContext.ajvInstance) === null || _dataContext$ajvInsta === void 0 ? void 0 : _dataContext$ajvInsta.compile(schema) : undefined);
142
146
  const showError = useCallback(() => {
143
147
  showErrorRef.current = true;
144
- setShowFieldBlockError === null || setShowFieldBlockError === void 0 ? void 0 : setShowFieldBlockError(path !== null && path !== void 0 ? path : id, true);
145
- }, [path, id, setShowFieldBlockError]);
148
+ showFieldBlockError === null || showFieldBlockError === void 0 ? void 0 : showFieldBlockError(identifier, true);
149
+ }, [showFieldBlockError, identifier]);
146
150
  const hideError = useCallback(() => {
147
151
  showErrorRef.current = false;
148
- setShowFieldBlockError === null || setShowFieldBlockError === void 0 ? void 0 : setShowFieldBlockError(path !== null && path !== void 0 ? path : id, false);
149
- }, [path, id, setShowFieldBlockError]);
152
+ showFieldBlockError === null || showFieldBlockError === void 0 ? void 0 : showFieldBlockError(identifier, false);
153
+ }, [showFieldBlockError, identifier]);
150
154
  const errorMessagesRef = useRef(null);
151
155
  errorMessagesRef.current = useMemo(() => {
152
156
  return _objectSpread({
@@ -178,6 +182,7 @@ export default function useDataValue(props) {
178
182
  }
179
183
  return error;
180
184
  }, []);
185
+ const stateId = useId();
181
186
  const persistErrorState = useCallback(errorArg => {
182
187
  const error = prepareError(errorArg);
183
188
  if (!errorChanged(error, localErrorRef.current)) {
@@ -185,9 +190,15 @@ export default function useDataValue(props) {
185
190
  }
186
191
  localErrorRef.current = error;
187
192
  dataContextSetValueWithError === null || dataContextSetValueWithError === void 0 ? void 0 : dataContextSetValueWithError(identifier, Boolean(error));
188
- setFieldBlockError === null || setFieldBlockError === void 0 ? void 0 : setFieldBlockError(path !== null && path !== void 0 ? path : id, error);
193
+ setFieldBlockState === null || setFieldBlockState === void 0 ? void 0 : setFieldBlockState({
194
+ stateId,
195
+ identifier,
196
+ type: 'error',
197
+ state: error,
198
+ showInitially: Boolean(inFieldBlock && validateInitially)
199
+ });
189
200
  forceUpdate();
190
- }, [path, identifier, id, prepareError, dataContextSetValueWithError, setFieldBlockError, forceUpdate]);
201
+ }, [stateId, prepareError, dataContextSetValueWithError, identifier, setFieldBlockState, inFieldBlock, validateInitially]);
191
202
  const clearErrorState = useCallback(() => persistErrorState(undefined), [persistErrorState]);
192
203
  const validateValue = useCallback(async () => {
193
204
  const isProcessActive = startProcess();
@@ -326,30 +337,86 @@ export default function useDataValue(props) {
326
337
  useMountEffect(() => {
327
338
  dataContext === null || dataContext === void 0 ? void 0 : dataContext.handleMountField(identifier);
328
339
  validateValue();
329
- if (showErrorInitially) {
330
- showError();
340
+ });
341
+ useUnmountEffect(() => {
342
+ dataContext === null || dataContext === void 0 ? void 0 : dataContext.handleUnMountField(identifier);
343
+ });
344
+ useMountEffect(() => {
345
+ if (inFieldBlock) {
346
+ if (errorProp) {
347
+ setFieldBlockState === null || setFieldBlockState === void 0 ? void 0 : setFieldBlockState({
348
+ identifier,
349
+ type: 'error',
350
+ state: errorProp,
351
+ showInitially: true,
352
+ show: true
353
+ });
354
+ }
355
+ if (warning) {
356
+ setFieldBlockState === null || setFieldBlockState === void 0 ? void 0 : setFieldBlockState({
357
+ identifier,
358
+ type: 'warning',
359
+ state: warning,
360
+ showInitially: true,
361
+ show: true
362
+ });
363
+ }
364
+ if (info) {
365
+ setFieldBlockState === null || setFieldBlockState === void 0 ? void 0 : setFieldBlockState({
366
+ identifier,
367
+ type: 'info',
368
+ state: info,
369
+ showInitially: true,
370
+ show: true
371
+ });
372
+ }
373
+ return () => {
374
+ if (fieldBlockContext.mountedFieldsRef) {
375
+ fieldBlockContext.mountedFieldsRef.current[identifier] = true;
376
+ }
377
+ };
331
378
  }
332
- return () => {
333
- dataContext === null || dataContext === void 0 ? void 0 : dataContext.handleUnMountField(identifier);
334
- };
335
379
  });
336
380
  const error = showErrorRef.current ? (_ref3 = errorProp !== null && errorProp !== void 0 ? errorProp : localErrorRef.current) !== null && _ref3 !== void 0 ? _ref3 : contextErrorRef.current : undefined;
337
- const ariaAttributes = {};
381
+ const hasError = Boolean(error) || inFieldBlock && fieldBlockContext.hasErrorProp;
382
+ const ariaAttributes = useMemo(() => {
383
+ return Object.keys(props).reduce((acc, cur) => {
384
+ if (!cur.startsWith('aria-')) {
385
+ return acc;
386
+ }
387
+ acc[cur] = props[cur];
388
+ return acc;
389
+ }, {});
390
+ }, [props]);
338
391
  if (error) {
339
- ariaAttributes['aria-invalid'] = String(Boolean(error));
392
+ ariaAttributes['aria-invalid'] = error ? 'true' : 'false';
340
393
  }
341
394
  if (required) {
342
- ariaAttributes['aria-required'] = String(required);
395
+ ariaAttributes['aria-required'] = required ? 'true' : 'false';
396
+ }
397
+ if (inFieldBlock) {
398
+ var _fieldBlockContext$fi;
399
+ if (fieldBlockContext.mountedFieldsRef) {
400
+ fieldBlockContext.mountedFieldsRef.current[identifier] = true;
401
+ }
402
+ const stateIds = (_fieldBlockContext$fi = fieldBlockContext.fieldStateIdsRef) === null || _fieldBlockContext$fi === void 0 ? void 0 : _fieldBlockContext$fi.current;
403
+ if (stateIds) {
404
+ ariaAttributes['aria-describedby'] = combineDescribedBy(props, [error && stateIds.error, warning && stateIds.warning, info && stateIds.info].filter(Boolean));
405
+ }
406
+ } else {
407
+ ariaAttributes['aria-describedby'] = combineDescribedBy(props, [(error || errorProp) && `${id}-form-status--error`, warning && `${id}-form-status--warning`, info && `${id}-form-status--info`].filter(Boolean));
343
408
  }
344
409
  return _objectSpread(_objectSpread({}, props), {}, {
345
410
  id,
346
411
  name: props.name || ((_props$path = props.path) === null || _props$path === void 0 ? void 0 : _props$path.replace('/', '')) || id,
347
412
  value: transformers.current.toInput(valueRef.current),
413
+ info: !inFieldBlock ? info : undefined,
414
+ warning: !inFieldBlock ? warning : undefined,
348
415
  error: !inFieldBlock ? error : undefined,
349
- hasError: Boolean(error),
350
- isChanged: changedRef.current,
351
- autoComplete: (_props$autoComplete = props.autoComplete) !== null && _props$autoComplete !== void 0 ? _props$autoComplete : dataContext.autoComplete === true ? 'on' : 'off',
416
+ hasError,
352
417
  disabled,
418
+ autoComplete: (_props$autoComplete = props.autoComplete) !== null && _props$autoComplete !== void 0 ? _props$autoComplete : dataContext.autoComplete === true ? 'on' : 'off',
419
+ isChanged: changedRef.current,
353
420
  ariaAttributes,
354
421
  dataContext,
355
422
  setHasFocus,
@@ -364,6 +431,8 @@ export function omitDataValueProps(props) {
364
431
  const {
365
432
  name,
366
433
  error,
434
+ warning,
435
+ info,
367
436
  hasError,
368
437
  isChanged,
369
438
  autoComplete,
@@ -377,6 +446,6 @@ export function omitDataValueProps(props) {
377
446
  forceUpdate
378
447
  } = props,
379
448
  restProps = _objectWithoutProperties(props, _excluded);
380
- return Object.freeze(restProps);
449
+ return restProps;
381
450
  }
382
451
  //# sourceMappingURL=useDataValue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDataValue.js","names":["useRef","useEffect","useContext","useCallback","useMemo","useReducer","pointer","errorChanged","ajvErrorsToOneFormError","FormError","Context","SharedContext","FieldBlockContext","IterateElementContext","useMountEffect","useUpdateEffect","useProcessManager","useId","useDataValue","props","_props$disabled","_dataContext$ajvInsta","_this","_ref3","_props$path","_props$autoComplete","path","itemPath","emptyValue","required","error","errorProp","errorMessages","onFocus","onBlur","onChange","onBlurValidator","validator","schema","validateInitially","validateUnchanged","continuousValidation","toInput","value","fromInput","toEvent","transformValue","fromExternal","validateRequired","_ref","res","undefined","disabled","readOnly","forceUpdate","startProcess","id","dataContext","fieldBlockContext","iterateElementContext","sharedContext","tr","translation","Forms","transformers","handlePathChange","dataContextHandlePathChange","updateDataValue","dataContextUpdateDataValue","validateData","dataContextValidateData","setValueWithError","dataContextSetValueWithError","setProps","dataContextSetProps","errors","dataContextErrors","contextErrorMessages","dataContextError","inFieldBlock","Boolean","setError","setFieldBlockError","setShowError","setShowFieldBlockError","inIterate","index","iterateElementIndex","iterateElementValue","handleChange","handleIterateElementChange","substring","Error","identifier","externalValue","current","has","get","data","valueRef","changedRef","hasFocusRef","showErrorInitially","localErrorRef","contextErrorRef","showErrorRef","validatorRef","schemaValidatorRef","ajvInstance","compile","showError","hideError","errorMessagesRef","_objectSpread","fieldErrorRequired","prepareError","_error$messageValues","message","validationRule","_errorMessagesRef$cur","fieldMessage","messageWithValues","Object","entries","messageValues","reduce","_ref2","key","replace","persistErrorState","errorArg","clearErrorState","validateValue","isProcessActive","requiredError","isChanged","_validatorRef$current","call","_dataContext$ajvInsta2","showAllErrors","hasValue","existingValue","handleError","setHasFocus","hasFocus","valueOverride","Promise","resolve","then","updateValue","newValue","argFromInput","additionalArgs","arguments","length","currentValue","apply","iterateValuePath","handleFocus","handleBlur","handleMountField","handleUnMountField","ariaAttributes","String","name","hasError","autoComplete","omitDataValueProps","restProps","_objectWithoutProperties","_excluded","freeze"],"sources":["../../../../../src/extensions/forms/hooks/useDataValue.ts"],"sourcesContent":["import {\n useRef,\n useEffect,\n useContext,\n useCallback,\n useMemo,\n useReducer,\n} from 'react'\nimport pointer from 'json-pointer'\nimport { ValidateFunction } from 'ajv/dist/2020'\nimport { errorChanged } from '../utils'\nimport { ajvErrorsToOneFormError } from '../utils/ajv'\nimport { FormError, FieldProps, AdditionalEventArgs } from '../types'\nimport { Context, ContextState } from '../DataContext'\nimport SharedContext from '../../../shared/Context'\nimport FieldBlockContext from '../FieldBlock/FieldBlockContext'\nimport IterateElementContext from '../Iterate/IterateElementContext'\nimport useMountEffect from './useMountEffect'\nimport useUpdateEffect from './useUpdateEffect'\nimport useProcessManager from './useProcessManager'\nimport useId from './useId'\n\nexport default function useDataValue<\n Value = unknown,\n Props extends FieldProps<Value> = FieldProps<Value>,\n>(props: Props): Props & ReturnAdditional<Value> {\n const {\n path,\n itemPath,\n emptyValue,\n required,\n error: errorProp,\n errorMessages,\n onFocus,\n onBlur,\n onChange,\n onBlurValidator,\n validator,\n schema,\n validateInitially,\n validateUnchanged,\n continuousValidation,\n toInput = (value: Value) => value,\n fromInput = (value: Value) => value,\n toEvent = (value: Value) => value,\n transformValue = (value: Value) => value,\n fromExternal = (value: Value) => value,\n validateRequired = (value: Value, { emptyValue, required, error }) => {\n const res =\n required &&\n (value === emptyValue ||\n (typeof emptyValue === 'undefined' && value === ''))\n ? error\n : undefined\n return res\n },\n } = props\n\n const disabled = props.disabled ?? props.readOnly\n\n const [, forceUpdate] = useReducer(() => ({}), {})\n const { startProcess } = useProcessManager()\n const id = useId(props.id)\n const dataContext = useContext(Context)\n const fieldBlockContext = useContext(FieldBlockContext)\n const iterateElementContext = useContext(IterateElementContext)\n const sharedContext = useContext(SharedContext)\n const tr = sharedContext?.translation.Forms\n\n const transformers = useRef({\n toInput,\n fromInput,\n toEvent,\n fromExternal,\n transformValue,\n validateRequired,\n })\n\n const {\n handlePathChange: dataContextHandlePathChange,\n updateDataValue: dataContextUpdateDataValue,\n validateData: dataContextValidateData,\n setValueWithError: dataContextSetValueWithError,\n setProps: dataContextSetProps,\n errors: dataContextErrors,\n contextErrorMessages,\n } = dataContext ?? {}\n\n const dataContextError = path ? dataContextErrors?.[path] : undefined\n const inFieldBlock = Boolean(fieldBlockContext)\n const {\n setError: setFieldBlockError,\n setShowError: setShowFieldBlockError,\n } = fieldBlockContext ?? {}\n const inIterate = Boolean(iterateElementContext)\n const {\n index: iterateElementIndex,\n value: iterateElementValue,\n handleChange: handleIterateElementChange,\n } = iterateElementContext ?? {}\n\n if (path && path.substring(0, 1) !== '/') {\n throw new Error(\n 'Invalid path. Data value path JSON Pointers must be from root (starting with a /).'\n )\n }\n if (itemPath && itemPath.substring(0, 1) !== '/') {\n throw new Error(\n 'Invalid itemPath. Item pathJSON Pointers must be from root of iterate element (starting with a /).'\n )\n }\n if (itemPath && !iterateElementContext) {\n throw new Error(\n 'itemPath cannot be used when not inside an iterate element context. Wrap the component in an Iterate.Loop.'\n )\n }\n\n const identifier = useMemo(() => {\n // Identifier is used is registries of multiple fields, like in the DataContext keeping track of errors\n return path ?? id\n }, [path, id])\n\n const externalValue = useMemo(() => {\n if (props.value !== undefined) {\n // Value-prop sent directly to the field has highest priority, overriding any surrounding source\n return transformers.current.fromExternal(props.value)\n }\n\n if (inIterate && itemPath) {\n // This field is inside an iterate, and has a pointer from the base of the element being iterated\n if (itemPath === '/') {\n return iterateElementValue\n }\n\n return pointer.has(iterateElementValue, itemPath)\n ? pointer.get(iterateElementValue, itemPath)\n : undefined\n }\n\n if (dataContext.data && path) {\n // There is a surrounding data context and a path for where in the source to find the data\n if (path === '/') {\n return dataContext.data\n }\n\n return pointer.has(dataContext.data, path)\n ? pointer.get(dataContext.data, path)\n : undefined\n }\n return undefined\n }, [\n props.value,\n inIterate,\n itemPath,\n dataContext.data,\n path,\n iterateElementValue,\n ])\n\n // Many variables are kept in refs to avoid triggering unnecessary update loops because updates using\n // useEffect depend on them (like the external `value`)\n\n // Hold an internal copy of the input value in case the input component is used uncontrolled,\n // and to handle errors in Eufemia on components that does not take updated callback functions into account.\n const valueRef = useRef<Value>(externalValue)\n const changedRef = useRef<boolean>(false)\n const hasFocusRef = useRef<boolean>(false)\n\n // Error handling\n // - Should errors received through validation be shown initially. Assume that providing a direct prop to\n // the component means it is supposed to be shown initially.\n const showErrorInitially = validateInitially || errorProp\n // - Local errors are errors based on validation instructions received by\n const localErrorRef = useRef<Error | FormError | undefined>()\n // - Context errors are from outer contexts, like validation for this field as part of the whole data set\n const contextErrorRef = useRef<Error | FormError | undefined>(\n dataContextError\n )\n\n // Put props into the surrounding data context\n dataContextSetProps?.(identifier, props)\n\n const showErrorRef = useRef<boolean>(Boolean(showErrorInitially))\n const validatorRef = useRef(validator)\n useUpdateEffect(() => {\n validatorRef.current = validator\n }, [validator])\n\n const schemaValidatorRef = useRef<ValidateFunction>(\n schema ? dataContext.ajvInstance?.compile(schema) : undefined\n )\n\n const showError = useCallback(() => {\n showErrorRef.current = true\n setShowFieldBlockError?.(path ?? id, true)\n }, [path, id, setShowFieldBlockError])\n\n const hideError = useCallback(() => {\n showErrorRef.current = false\n setShowFieldBlockError?.(path ?? id, false)\n }, [path, id, setShowFieldBlockError])\n\n const errorMessagesRef = useRef(null)\n errorMessagesRef.current = useMemo(() => {\n return {\n required: tr.fieldErrorRequired,\n ...errorMessages,\n }\n }, [errorMessages, tr.fieldErrorRequired])\n\n /**\n * Prepare error from validation logic with correct error messages based on props\n */\n const prepareError = useCallback(\n (error: Error | FormError | undefined): FormError | undefined => {\n if (error === undefined) {\n return\n }\n\n if (error instanceof FormError) {\n let message = error.message\n\n const { validationRule } = error\n if (typeof validationRule === 'string') {\n const fieldMessage = errorMessagesRef.current?.[validationRule]\n if (fieldMessage) {\n message = fieldMessage\n }\n }\n\n const messageWithValues = Object.entries(\n error.messageValues ?? {}\n ).reduce((message, [key, value]) => {\n return message.replace(`{${key}}`, value)\n }, message)\n\n return new FormError(messageWithValues)\n }\n\n return error\n },\n []\n )\n\n /**\n * Based on validation, update error state, locally and relevant surrounding contexts\n */\n const persistErrorState = useCallback(\n (errorArg: FormError | undefined) => {\n const error = prepareError(errorArg)\n\n if (!errorChanged(error, localErrorRef.current)) {\n // In case different triggers lead to validation with no changes in the result (like still no error, or the same error),\n // avoid unnecessary re-renders by letting the old error object stay in the state and skip re-rendering.\n return\n }\n\n localErrorRef.current = error\n\n // Tell the data context about the error, so it can stop the user from submitting the form until the error has been fixed\n dataContextSetValueWithError?.(identifier, Boolean(error))\n\n setFieldBlockError?.(path ?? id, error)\n forceUpdate()\n },\n [\n path,\n identifier,\n id,\n prepareError,\n dataContextSetValueWithError,\n setFieldBlockError,\n forceUpdate,\n ]\n )\n\n const clearErrorState = useCallback(\n () => persistErrorState(undefined),\n [persistErrorState]\n )\n\n /**\n * Validate the current state value by provided validator instructions\n */\n const validateValue = useCallback(async () => {\n const isProcessActive = startProcess()\n\n if (disabled) {\n if (isProcessActive()) {\n clearErrorState()\n }\n hideError()\n return\n }\n\n try {\n // Validate required\n const requiredError = transformers.current.validateRequired(\n valueRef.current,\n {\n emptyValue,\n required,\n isChanged: changedRef.current,\n error: new FormError('The value is required', {\n validationRule: 'required',\n }),\n }\n )\n if (requiredError instanceof Error) {\n throw requiredError\n }\n\n // Validate by provided JSON Schema for this value\n if (\n schemaValidatorRef.current &&\n valueRef.current !== undefined &&\n !schemaValidatorRef.current(valueRef.current)\n ) {\n const error = ajvErrorsToOneFormError(\n schemaValidatorRef.current.errors\n )\n throw error\n }\n\n // Validate by provided derivative validator\n if (validatorRef.current) {\n const res = await validatorRef.current?.(valueRef.current, {\n ...contextErrorMessages,\n ...errorMessagesRef.current,\n })\n if (res instanceof Error) {\n throw res\n }\n }\n\n if (isProcessActive()) {\n clearErrorState()\n }\n } catch (error: unknown) {\n if (isProcessActive()) {\n persistErrorState(error as Error)\n }\n }\n }, [\n startProcess,\n disabled,\n hideError,\n clearErrorState,\n emptyValue,\n required,\n contextErrorMessages,\n persistErrorState,\n ])\n\n useUpdateEffect(() => {\n schemaValidatorRef.current = schema\n ? dataContext.ajvInstance?.compile(schema)\n : undefined\n validateValue()\n }, [schema, validateValue])\n\n useUpdateEffect(() => {\n // Error or removed error for this field from the surrounding data context (by path)\n valueRef.current = externalValue\n validateValue()\n forceUpdate()\n }, [externalValue, validateValue])\n\n useEffect(() => {\n const error = prepareError(dataContextError)\n if (errorChanged(error, contextErrorRef.current)) {\n contextErrorRef.current = error\n forceUpdate()\n }\n }, [dataContextError, prepareError])\n\n useEffect(() => {\n if (dataContext.showAllErrors) {\n // If showError on a surrounding data context was changed and set to true, it is because the user clicked next, submit or\n // something else that should lead to showing the user all errors.\n showError()\n forceUpdate()\n }\n }, [dataContext.showAllErrors, showError])\n\n useEffect(() => {\n if (path) {\n const hasValue = pointer.has(dataContext.data, path)\n const existingValue = hasValue\n ? pointer.get(dataContext.data, path)\n : undefined\n\n if (\n !hasValue ||\n (props.value !== existingValue &&\n // Prevents an infinite loop by skipping the update if the value hasn't changed\n valueRef.current !== existingValue)\n ) {\n // Update the data context when a pointer not exists,\n // but was given initially.\n dataContextUpdateDataValue?.(path, props.value, { disabled })\n dataContextValidateData?.()\n }\n }\n }, [\n dataContext.data,\n dataContextUpdateDataValue,\n dataContextValidateData,\n disabled,\n path,\n props.value,\n ])\n\n const handleError = useCallback(() => {\n if (\n continuousValidation ||\n (continuousValidation !== false && !hasFocusRef.current)\n ) {\n // When there is a change to the value without there having been any focus callback beforehand, it is likely\n // to believe that the blur callback will not be called either, which would trigger the display of the error.\n // The error is therefore displayed immediately (unless instructed not to with continuousValidation set to false).\n showError()\n } else {\n // When changing the value, hide errors to avoid annoying the user before they are finished filling in that value\n hideError()\n }\n }, [continuousValidation, hideError, showError])\n\n const setHasFocus = useCallback(\n (hasFocus: boolean, valueOverride?: Value) => {\n if (hasFocus) {\n // Field was put in focus (like when clicking in a text field or opening a dropdown menu)\n hasFocusRef.current = true\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onFocus'\n )\n onFocus?.(value)\n } else {\n // Field was removed from focus (like when tabbing out of a text field or closing a dropdown menu)\n hasFocusRef.current = false\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onBlur'\n )\n onBlur?.(value)\n\n if (!changedRef.current && !validateUnchanged) {\n // Avoid showing errors when blurring without having changed the value, so tabbing through several\n // fields does not make errors pop up all over the place\n return\n }\n\n // External blur validators makes it possible to validate values but not on every character change in case of\n // expensive validation calling external services etc.\n if (typeof onBlurValidator === 'function') {\n // Since the validator can return either a synchronous result or an asynchronous\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onBlurValidator'\n )\n Promise.resolve(onBlurValidator(value)).then(persistErrorState)\n }\n\n // Since the user left the field, show error (if any)\n showError()\n forceUpdate()\n }\n },\n [\n onBlur,\n onBlurValidator,\n onFocus,\n persistErrorState,\n showError,\n validateUnchanged,\n ]\n )\n\n const updateValue = useCallback(\n (newValue: Value) => {\n if (newValue === valueRef.current) {\n // Avoid triggering a change if the value was not actually changed. This may be caused by rendering components\n // calling onChange even if the actual value did not change.\n return\n }\n\n valueRef.current = newValue\n\n // Always validate the value immediately when it is changed\n validateValue()\n\n handleError()\n\n if (path) {\n // setTimeout(() => {\n dataContextHandlePathChange?.(path, newValue)\n // forceUpdate()\n // }, 1e3)\n }\n\n forceUpdate()\n },\n [dataContextHandlePathChange, handleError, path, validateValue]\n )\n\n const handleChange = useCallback(\n (\n argFromInput: Value,\n additionalArgs: AdditionalEventArgs = undefined\n ) => {\n const currentValue = valueRef.current\n let newValue = transformers.current.fromInput(argFromInput)\n\n if (newValue === currentValue) {\n // Avoid triggering a change if the value was not actually changed. This may be caused by rendering components\n // calling onChange even if the actual value did not change.\n return\n }\n\n newValue = transformers.current.transformValue(\n newValue,\n currentValue\n )\n\n updateValue(newValue)\n\n changedRef.current = true\n\n const value = transformers.current.toEvent(newValue, 'onChange')\n onChange?.apply(\n this,\n typeof additionalArgs !== 'undefined'\n ? [value, additionalArgs]\n : [value]\n )\n\n if (itemPath) {\n const iterateValuePath = `/${iterateElementIndex}${\n itemPath && itemPath !== '/' ? itemPath : ''\n }`\n handleIterateElementChange?.(iterateValuePath, newValue)\n }\n },\n [\n updateValue,\n onChange,\n itemPath,\n iterateElementIndex,\n handleIterateElementChange,\n ]\n )\n\n const handleFocus = useCallback(() => setHasFocus(true), [setHasFocus])\n\n const handleBlur = useCallback(() => setHasFocus(false), [setHasFocus])\n\n useMountEffect(() => {\n dataContext?.handleMountField(identifier)\n\n validateValue()\n\n if (showErrorInitially) {\n showError()\n }\n\n return () => {\n // Unmount procedure\n dataContext?.handleUnMountField(identifier)\n }\n })\n\n const error = showErrorRef.current\n ? errorProp ?? localErrorRef.current ?? contextErrorRef.current\n : undefined\n\n const ariaAttributes = {}\n if (error) {\n ariaAttributes['aria-invalid'] = String(Boolean(error))\n }\n if (required) {\n ariaAttributes['aria-required'] = String(required)\n }\n\n return {\n ...props,\n id,\n name: props.name || props.path?.replace('/', '') || id,\n value: transformers.current.toInput(valueRef.current),\n error: !inFieldBlock ? error : undefined,\n hasError: Boolean(error),\n isChanged: changedRef.current,\n autoComplete:\n props.autoComplete ??\n (dataContext.autoComplete === true ? 'on' : 'off'),\n disabled,\n ariaAttributes,\n dataContext,\n setHasFocus,\n handleFocus,\n handleBlur,\n handleChange,\n updateValue,\n forceUpdate,\n }\n}\n\ninterface ReturnAdditional<Value> {\n id: string\n name: string\n value: Value\n error: Error | FormError | undefined\n autoComplete: HTMLInputElement['autocomplete']\n disabled: boolean\n hasError: boolean\n isChanged: boolean\n dataContext: ContextState\n ariaAttributes: {\n 'aria-invalid'?: 'true' | 'false'\n 'aria-required'?: 'true' | 'false'\n }\n setHasFocus: (hasFocus: boolean, valueOverride?: unknown) => void\n handleFocus: () => void\n handleBlur: () => void\n handleChange: FieldProps<unknown>['onChange']\n updateValue: (value: Value) => void\n forceUpdate: () => void\n}\n\nexport function omitDataValueProps<\n OmittedProps extends ReturnAdditional<unknown>,\n>(props: OmittedProps) {\n // Do not include typical HTML attributes\n const {\n name,\n error,\n hasError,\n isChanged,\n autoComplete,\n ariaAttributes,\n dataContext,\n setHasFocus,\n handleFocus,\n handleBlur,\n handleChange,\n updateValue,\n forceUpdate,\n ...restProps\n } = props\n return Object.freeze(restProps) as Omit<\n OmittedProps,\n keyof ReturnAdditional<unknown>\n >\n}\n"],"mappings":";;;;;;;AAAA,SACEA,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,WAAW,EACXC,OAAO,EACPC,UAAU,QACL,OAAO;AACd,OAAOC,OAAO,MAAM,cAAc;AAElC,SAASC,YAAY,QAAQ,UAAU;AACvC,SAASC,uBAAuB,QAAQ,cAAc;AACtD,SAASC,SAAS,QAAyC,UAAU;AACrE,SAASC,OAAO,QAAsB,gBAAgB;AACtD,OAAOC,aAAa,MAAM,yBAAyB;AACnD,OAAOC,iBAAiB,MAAM,iCAAiC;AAC/D,OAAOC,qBAAqB,MAAM,kCAAkC;AACpE,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,eAAe,MAAM,mBAAmB;AAC/C,OAAOC,iBAAiB,MAAM,qBAAqB;AACn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WAAA,uBAAVA,WAAA,CAAYwG,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,KAAIxE,EAAE;IACtDb,KAAK,EAAEqB,YAAY,CAAC+B,OAAO,CAACrD,OAAO,CAACyD,QAAQ,CAACJ,OAAO,CAAC;IACrDjE,KAAK,EAAE,CAACiD,YAAY,GAAGjD,KAAK,GAAGqB,SAAS;IACxCkH,QAAQ,EAAErF,OAAO,CAAClD,KAAK,CAAC;IACxByG,SAAS,EAAEnC,UAAU,CAACL,OAAO;IAC7BuE,YAAY,GAAA7I,mBAAA,GACVN,KAAK,CAACmJ,YAAY,cAAA7I,mBAAA,cAAAA,mBAAA,GACjBgC,WAAW,CAAC6G,YAAY,KAAK,IAAI,GAAG,IAAI,GAAG,KAAM;IACpDlH,QAAQ;IACR8G,cAAc;IACdzG,WAAW;IACXsF,WAAW;IACXe,WAAW;IACXC,UAAU;IACVtE,YAAY;IACZ4D,WAAW;IACX/F;EAAW;AAEf;AAwBA,OAAO,SAASiH,kBAAkBA,CAEhCpJ,KAAmB,EAAE;EAErB,MAAM;MACJiJ,IAAI;MACJtI,KAAK;MACLuI,QAAQ;MACR9B,SAAS;MACT+B,YAAY;MACZJ,cAAc;MACdzG,WAAW;MACXsF,WAAW;MACXe,WAAW;MACXC,UAAU;MACVtE,YAAY;MACZ4D,WAAW;MACX/F;IAEF,CAAC,GAAGnC,KAAK;IADJqJ,SAAS,GAAAC,wBAAA,CACVtJ,KAAK,EAAAuJ,SAAA;EACT,OAAOhD,MAAM,CAACiD,MAAM,CAACH,SAAS,CAAC;AAIjC"}
1
+ {"version":3,"file":"useDataValue.js","names":["useRef","useEffect","useContext","useCallback","useMemo","useReducer","pointer","errorChanged","ajvErrorsToOneFormError","FormError","Context","DataContext","combineDescribedBy","SharedContext","FieldBlockContext","IterateElementContext","useMountEffect","useUnmountEffect","useUpdateEffect","useProcessManager","useId","useDataValue","props","_props$disabled","_dataContext$ajvInsta","_this","_ref3","_props$path","_props$autoComplete","path","itemPath","emptyValue","required","info","warning","error","errorProp","errorMessages","onFocus","onBlur","onChange","onBlurValidator","validator","schema","validateInitially","validateUnchanged","continuousValidation","toInput","value","fromInput","toEvent","transformValue","fromExternal","validateRequired","_ref","res","undefined","disabled","readOnly","forceUpdate","startProcess","id","dataContext","fieldBlockContext","iterateElementContext","sharedContext","tr","translation","Forms","transformers","handlePathChange","dataContextHandlePathChange","updateDataValue","dataContextUpdateDataValue","validateData","dataContextValidateData","setValueWithError","dataContextSetValueWithError","setProps","dataContextSetProps","errors","dataContextErrors","contextErrorMessages","dataContextError","inFieldBlock","Boolean","setFieldState","setFieldBlockState","showFieldError","showFieldBlockError","inIterate","index","iterateElementIndex","iterateElementValue","handleChange","handleIterateElementChange","substring","Error","identifier","externalValue","current","has","get","data","valueRef","changedRef","hasFocusRef","showErrorInitially","localErrorRef","contextErrorRef","showErrorRef","validatorRef","schemaValidatorRef","ajvInstance","compile","showError","hideError","errorMessagesRef","_objectSpread","fieldErrorRequired","prepareError","_error$messageValues","message","validationRule","_errorMessagesRef$cur","fieldMessage","messageWithValues","Object","entries","messageValues","reduce","_ref2","key","replace","stateId","persistErrorState","errorArg","type","state","showInitially","clearErrorState","validateValue","isProcessActive","requiredError","isChanged","_validatorRef$current","call","_dataContext$ajvInsta2","showAllErrors","hasValue","existingValue","handleError","setHasFocus","hasFocus","valueOverride","Promise","resolve","then","updateValue","newValue","argFromInput","additionalArgs","arguments","length","currentValue","apply","iterateValuePath","handleFocus","handleBlur","handleMountField","handleUnMountField","show","mountedFieldsRef","hasError","hasErrorProp","ariaAttributes","keys","acc","cur","startsWith","_fieldBlockContext$fi","stateIds","fieldStateIdsRef","filter","name","autoComplete","omitDataValueProps","restProps","_objectWithoutProperties","_excluded"],"sources":["../../../../../src/extensions/forms/hooks/useDataValue.ts"],"sourcesContent":["import {\n useRef,\n useEffect,\n useContext,\n useCallback,\n useMemo,\n useReducer,\n AriaAttributes,\n} from 'react'\nimport pointer from 'json-pointer'\nimport { ValidateFunction } from 'ajv/dist/2020'\nimport { errorChanged } from '../utils'\nimport { ajvErrorsToOneFormError } from '../utils/ajv'\nimport { FormError, FieldProps, AdditionalEventArgs } from '../types'\nimport { Context as DataContext, ContextState } from '../DataContext'\nimport { combineDescribedBy } from '../../../shared/component-helper'\nimport SharedContext from '../../../shared/Context'\nimport FieldBlockContext from '../FieldBlock/FieldBlockContext'\nimport IterateElementContext from '../Iterate/IterateElementContext'\nimport useMountEffect from './useMountEffect'\nimport useUnmountEffect from './useUnmountEffect'\nimport useUpdateEffect from './useUpdateEffect'\nimport useProcessManager from './useProcessManager'\nimport useId from './useId'\n\nexport default function useDataValue<\n Value = unknown,\n Props extends FieldProps<Value> = FieldProps<Value>,\n>(props: Props): Props & FieldProps<Value> & ReturnAdditional<Value> {\n const {\n path,\n itemPath,\n emptyValue,\n required,\n info,\n warning,\n error: errorProp,\n errorMessages,\n onFocus,\n onBlur,\n onChange,\n onBlurValidator,\n validator,\n schema,\n validateInitially,\n validateUnchanged,\n continuousValidation,\n toInput = (value: Value) => value,\n fromInput = (value: Value) => value,\n toEvent = (value: Value) => value,\n transformValue = (value: Value) => value,\n fromExternal = (value: Value) => value,\n validateRequired = (value: Value, { emptyValue, required, error }) => {\n const res =\n required &&\n (value === emptyValue ||\n (typeof emptyValue === 'undefined' && value === ''))\n ? error\n : undefined\n return res\n },\n } = props\n\n const disabled = props.disabled ?? props.readOnly\n\n const [, forceUpdate] = useReducer(() => ({}), {})\n const { startProcess } = useProcessManager()\n const id = useId(props.id)\n const dataContext = useContext(DataContext)\n const fieldBlockContext = useContext(FieldBlockContext)\n const iterateElementContext = useContext(IterateElementContext)\n const sharedContext = useContext(SharedContext)\n const tr = sharedContext?.translation.Forms\n\n const transformers = useRef({\n toInput,\n fromInput,\n toEvent,\n fromExternal,\n transformValue,\n validateRequired,\n })\n\n const {\n handlePathChange: dataContextHandlePathChange,\n updateDataValue: dataContextUpdateDataValue,\n validateData: dataContextValidateData,\n setValueWithError: dataContextSetValueWithError,\n setProps: dataContextSetProps,\n errors: dataContextErrors,\n contextErrorMessages,\n } = dataContext ?? {}\n\n const dataContextError = path ? dataContextErrors?.[path] : undefined\n const inFieldBlock = Boolean(fieldBlockContext)\n const {\n setFieldState: setFieldBlockState,\n showFieldError: showFieldBlockError,\n } = fieldBlockContext ?? {}\n const inIterate = Boolean(iterateElementContext)\n const {\n index: iterateElementIndex,\n value: iterateElementValue,\n handleChange: handleIterateElementChange,\n } = iterateElementContext ?? {}\n\n if (path && path.substring(0, 1) !== '/') {\n throw new Error(\n 'Invalid path. Data value path JSON Pointers must be from root (starting with a /).'\n )\n }\n if (itemPath && itemPath.substring(0, 1) !== '/') {\n throw new Error(\n 'Invalid itemPath. Item pathJSON Pointers must be from root of iterate element (starting with a /).'\n )\n }\n if (itemPath && !iterateElementContext) {\n throw new Error(\n 'itemPath cannot be used when not inside an iterate element context. Wrap the component in an Iterate.Loop.'\n )\n }\n\n const identifier = useMemo(() => {\n // Identifier is used is registries of multiple fields, like in the DataContext keeping track of errors\n return path ?? id\n }, [path, id])\n\n const externalValue = useMemo(() => {\n if (props.value !== undefined) {\n // Value-prop sent directly to the field has highest priority, overriding any surrounding source\n return transformers.current.fromExternal(props.value)\n }\n\n if (inIterate && itemPath) {\n // This field is inside an iterate, and has a pointer from the base of the element being iterated\n if (itemPath === '/') {\n return iterateElementValue\n }\n\n return pointer.has(iterateElementValue, itemPath)\n ? pointer.get(iterateElementValue, itemPath)\n : undefined\n }\n\n if (dataContext.data && path) {\n // There is a surrounding data context and a path for where in the source to find the data\n if (path === '/') {\n return dataContext.data\n }\n\n return pointer.has(dataContext.data, path)\n ? pointer.get(dataContext.data, path)\n : undefined\n }\n return undefined\n }, [\n props.value,\n inIterate,\n itemPath,\n dataContext.data,\n path,\n iterateElementValue,\n ])\n\n // Many variables are kept in refs to avoid triggering unnecessary update loops because updates using\n // useEffect depend on them (like the external `value`)\n\n // Hold an internal copy of the input value in case the input component is used uncontrolled,\n // and to handle errors in Eufemia on components that does not take updated callback functions into account.\n const valueRef = useRef<Value>(externalValue)\n const changedRef = useRef<boolean>(false)\n const hasFocusRef = useRef<boolean>(false)\n\n // Error handling\n // - Should errors received through validation be shown initially. Assume that providing a direct prop to\n // the component means it is supposed to be shown initially.\n const showErrorInitially = validateInitially || errorProp\n // - Local errors are errors based on validation instructions received by\n const localErrorRef = useRef<Error | FormError | undefined>()\n // - Context errors are from outer contexts, like validation for this field as part of the whole data set\n const contextErrorRef = useRef<Error | FormError | undefined>(\n dataContextError\n )\n\n // Put props into the surrounding data context\n dataContextSetProps?.(identifier, props)\n\n const showErrorRef = useRef<boolean>(Boolean(showErrorInitially))\n const validatorRef = useRef(validator)\n useUpdateEffect(() => {\n validatorRef.current = validator\n }, [validator])\n\n const schemaValidatorRef = useRef<ValidateFunction>(\n schema ? dataContext.ajvInstance?.compile(schema) : undefined\n )\n\n const showError = useCallback(() => {\n showErrorRef.current = true\n showFieldBlockError?.(identifier, true)\n }, [showFieldBlockError, identifier])\n\n const hideError = useCallback(() => {\n showErrorRef.current = false\n showFieldBlockError?.(identifier, false)\n }, [showFieldBlockError, identifier])\n\n const errorMessagesRef = useRef(null)\n errorMessagesRef.current = useMemo(() => {\n return {\n required: tr.fieldErrorRequired,\n ...errorMessages,\n }\n }, [errorMessages, tr.fieldErrorRequired])\n\n /**\n * Prepare error from validation logic with correct error messages based on props\n */\n const prepareError = useCallback(\n (error: Error | FormError | undefined): FormError | undefined => {\n if (error === undefined) {\n return\n }\n\n if (error instanceof FormError) {\n let message = error.message\n\n const { validationRule } = error\n if (typeof validationRule === 'string') {\n const fieldMessage = errorMessagesRef.current?.[validationRule]\n if (fieldMessage) {\n message = fieldMessage\n }\n }\n\n const messageWithValues = Object.entries(\n error.messageValues ?? {}\n ).reduce((message, [key, value]) => {\n return message.replace(`{${key}}`, value)\n }, message)\n\n return new FormError(messageWithValues)\n }\n\n return error\n },\n []\n )\n\n /**\n * Based on validation, update error state, locally and relevant surrounding contexts\n */\n const stateId = useId()\n const persistErrorState = useCallback(\n (errorArg: FormError | undefined) => {\n const error = prepareError(errorArg)\n\n if (!errorChanged(error, localErrorRef.current)) {\n // In case different triggers lead to validation with no changes in the result (like still no error, or the same error),\n // avoid unnecessary re-renders by letting the old error object stay in the state and skip re-rendering.\n return\n }\n\n localErrorRef.current = error\n\n // Tell the data context about the error, so it can stop the user from submitting the form until the error has been fixed\n dataContextSetValueWithError?.(identifier, Boolean(error))\n\n setFieldBlockState?.({\n stateId,\n identifier,\n type: 'error',\n state: error,\n showInitially: Boolean(inFieldBlock && validateInitially),\n })\n\n forceUpdate()\n },\n [\n stateId,\n prepareError,\n dataContextSetValueWithError,\n identifier,\n setFieldBlockState,\n inFieldBlock,\n validateInitially,\n ]\n )\n\n const clearErrorState = useCallback(\n () => persistErrorState(undefined),\n [persistErrorState]\n )\n\n /**\n * Validate the current state value by provided validator instructions\n */\n const validateValue = useCallback(async () => {\n const isProcessActive = startProcess()\n\n if (disabled) {\n if (isProcessActive()) {\n clearErrorState()\n }\n hideError()\n return\n }\n\n try {\n // Validate required\n const requiredError = transformers.current.validateRequired(\n valueRef.current,\n {\n emptyValue,\n required,\n isChanged: changedRef.current,\n error: new FormError('The value is required', {\n validationRule: 'required',\n }),\n }\n )\n if (requiredError instanceof Error) {\n throw requiredError\n }\n\n // Validate by provided JSON Schema for this value\n if (\n schemaValidatorRef.current &&\n valueRef.current !== undefined &&\n !schemaValidatorRef.current(valueRef.current)\n ) {\n const error = ajvErrorsToOneFormError(\n schemaValidatorRef.current.errors\n )\n throw error\n }\n\n // Validate by provided derivative validator\n if (validatorRef.current) {\n const res = await validatorRef.current?.(valueRef.current, {\n ...contextErrorMessages,\n ...errorMessagesRef.current,\n })\n if (res instanceof Error) {\n throw res\n }\n }\n\n if (isProcessActive()) {\n clearErrorState()\n }\n } catch (error: unknown) {\n if (isProcessActive()) {\n persistErrorState(error as Error)\n }\n }\n }, [\n startProcess,\n disabled,\n hideError,\n clearErrorState,\n emptyValue,\n required,\n contextErrorMessages,\n persistErrorState,\n ])\n\n useUpdateEffect(() => {\n schemaValidatorRef.current = schema\n ? dataContext.ajvInstance?.compile(schema)\n : undefined\n validateValue()\n }, [schema, validateValue])\n\n useUpdateEffect(() => {\n // Error or removed error for this field from the surrounding data context (by path)\n valueRef.current = externalValue\n validateValue()\n forceUpdate()\n }, [externalValue, validateValue])\n\n useEffect(() => {\n const error = prepareError(dataContextError)\n if (errorChanged(error, contextErrorRef.current)) {\n contextErrorRef.current = error\n forceUpdate()\n }\n }, [dataContextError, prepareError])\n\n useEffect(() => {\n if (dataContext.showAllErrors) {\n // If showError on a surrounding data context was changed and set to true, it is because the user clicked next, submit or\n // something else that should lead to showing the user all errors.\n showError()\n forceUpdate()\n }\n }, [dataContext.showAllErrors, showError])\n\n useEffect(() => {\n if (path) {\n const hasValue = pointer.has(dataContext.data, path)\n const existingValue = hasValue\n ? pointer.get(dataContext.data, path)\n : undefined\n\n if (\n !hasValue ||\n (props.value !== existingValue &&\n // Prevents an infinite loop by skipping the update if the value hasn't changed\n valueRef.current !== existingValue)\n ) {\n // Update the data context when a pointer not exists,\n // but was given initially.\n dataContextUpdateDataValue?.(path, props.value, { disabled })\n dataContextValidateData?.()\n }\n }\n }, [\n dataContext.data,\n dataContextUpdateDataValue,\n dataContextValidateData,\n disabled,\n path,\n props.value,\n ])\n\n const handleError = useCallback(() => {\n if (\n continuousValidation ||\n (continuousValidation !== false && !hasFocusRef.current)\n ) {\n // When there is a change to the value without there having been any focus callback beforehand, it is likely\n // to believe that the blur callback will not be called either, which would trigger the display of the error.\n // The error is therefore displayed immediately (unless instructed not to with continuousValidation set to false).\n showError()\n } else {\n // When changing the value, hide errors to avoid annoying the user before they are finished filling in that value\n hideError()\n }\n }, [continuousValidation, hideError, showError])\n\n const setHasFocus = useCallback(\n (hasFocus: boolean, valueOverride?: Value) => {\n if (hasFocus) {\n // Field was put in focus (like when clicking in a text field or opening a dropdown menu)\n hasFocusRef.current = true\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onFocus'\n )\n onFocus?.(value)\n } else {\n // Field was removed from focus (like when tabbing out of a text field or closing a dropdown menu)\n hasFocusRef.current = false\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onBlur'\n )\n onBlur?.(value)\n\n if (!changedRef.current && !validateUnchanged) {\n // Avoid showing errors when blurring without having changed the value, so tabbing through several\n // fields does not make errors pop up all over the place\n return\n }\n\n // External blur validators makes it possible to validate values but not on every character change in case of\n // expensive validation calling external services etc.\n if (typeof onBlurValidator === 'function') {\n // Since the validator can return either a synchronous result or an asynchronous\n const value = transformers.current.toEvent(\n valueOverride ?? valueRef.current,\n 'onBlurValidator'\n )\n Promise.resolve(onBlurValidator(value)).then(persistErrorState)\n }\n\n // Since the user left the field, show error (if any)\n showError()\n forceUpdate()\n }\n },\n [\n onBlur,\n onBlurValidator,\n onFocus,\n persistErrorState,\n showError,\n validateUnchanged,\n ]\n )\n\n const updateValue = useCallback(\n (newValue: Value) => {\n if (newValue === valueRef.current) {\n // Avoid triggering a change if the value was not actually changed. This may be caused by rendering components\n // calling onChange even if the actual value did not change.\n return\n }\n\n valueRef.current = newValue\n\n // Always validate the value immediately when it is changed\n validateValue()\n\n handleError()\n\n if (path) {\n dataContextHandlePathChange?.(path, newValue)\n }\n\n forceUpdate()\n },\n [dataContextHandlePathChange, handleError, path, validateValue]\n )\n\n const handleChange = useCallback(\n (\n argFromInput: Value,\n additionalArgs: AdditionalEventArgs = undefined\n ) => {\n const currentValue = valueRef.current\n let newValue = transformers.current.fromInput(argFromInput)\n\n if (newValue === currentValue) {\n // Avoid triggering a change if the value was not actually changed. This may be caused by rendering components\n // calling onChange even if the actual value did not change.\n return\n }\n\n newValue = transformers.current.transformValue(\n newValue,\n currentValue\n )\n\n updateValue(newValue)\n\n changedRef.current = true\n\n const value = transformers.current.toEvent(newValue, 'onChange')\n onChange?.apply(\n this,\n typeof additionalArgs !== 'undefined'\n ? [value, additionalArgs]\n : [value]\n )\n\n if (itemPath) {\n const iterateValuePath = `/${iterateElementIndex}${\n itemPath && itemPath !== '/' ? itemPath : ''\n }`\n handleIterateElementChange?.(iterateValuePath, newValue)\n }\n },\n [\n updateValue,\n onChange,\n itemPath,\n iterateElementIndex,\n handleIterateElementChange,\n ]\n )\n\n const handleFocus = useCallback(() => setHasFocus(true), [setHasFocus])\n const handleBlur = useCallback(() => setHasFocus(false), [setHasFocus])\n\n useMountEffect(() => {\n dataContext?.handleMountField(identifier)\n\n validateValue()\n })\n useUnmountEffect(() => {\n dataContext?.handleUnMountField(identifier)\n })\n\n // Set the error in the field block context if this field is inside a field block\n useMountEffect(() => {\n if (inFieldBlock) {\n if (errorProp) {\n setFieldBlockState?.({\n identifier,\n type: 'error',\n state: errorProp,\n showInitially: true,\n show: true,\n })\n }\n if (warning) {\n setFieldBlockState?.({\n identifier,\n type: 'warning',\n state: warning,\n showInitially: true,\n show: true,\n })\n }\n if (info) {\n setFieldBlockState?.({\n identifier,\n type: 'info',\n state: info,\n showInitially: true,\n show: true,\n })\n }\n\n return () => {\n // Unmount procedure\n if (fieldBlockContext.mountedFieldsRef) {\n fieldBlockContext.mountedFieldsRef.current[identifier] = true\n }\n }\n }\n })\n\n const error = showErrorRef.current\n ? errorProp ?? localErrorRef.current ?? contextErrorRef.current\n : undefined\n\n const hasError =\n Boolean(error) || (inFieldBlock && fieldBlockContext.hasErrorProp)\n\n // - Handle ariaAttributes\n const ariaAttributes = useMemo(() => {\n return Object.keys(props).reduce<AriaAttributes>((acc, cur) => {\n if (!cur.startsWith('aria-')) {\n return acc\n }\n acc[cur] = props[cur]\n return acc\n }, {})\n }, [props])\n if (error) {\n ariaAttributes['aria-invalid'] = error ? 'true' : 'false'\n }\n if (required) {\n ariaAttributes['aria-required'] = required ? 'true' : 'false'\n }\n if (inFieldBlock) {\n // Mount the field in the field block context\n if (fieldBlockContext.mountedFieldsRef) {\n fieldBlockContext.mountedFieldsRef.current[identifier] = true\n }\n\n // Check if there are any state IDs to be added to the aria-describedby attribute\n const stateIds = fieldBlockContext.fieldStateIdsRef?.current\n\n if (stateIds) {\n ariaAttributes['aria-describedby'] = combineDescribedBy(\n props,\n [\n error && stateIds.error,\n warning && stateIds.warning,\n info && stateIds.info,\n ].filter(Boolean)\n )\n }\n } else {\n ariaAttributes['aria-describedby'] = combineDescribedBy(\n props,\n [\n (error || errorProp) && `${id}-form-status--error`,\n warning && `${id}-form-status--warning`,\n info && `${id}-form-status--info`,\n ].filter(Boolean)\n )\n }\n\n return {\n ...props,\n id,\n name: props.name || props.path?.replace('/', '') || id,\n value: transformers.current.toInput(valueRef.current),\n info: !inFieldBlock ? info : undefined,\n warning: !inFieldBlock ? warning : undefined,\n error: !inFieldBlock ? error : undefined,\n hasError,\n disabled,\n autoComplete:\n props.autoComplete ??\n (dataContext.autoComplete === true ? 'on' : 'off'),\n\n // Return additional hook related props (ReturnAdditional)\n isChanged: changedRef.current,\n ariaAttributes,\n dataContext,\n setHasFocus,\n handleFocus,\n handleBlur,\n handleChange,\n updateValue,\n forceUpdate,\n }\n}\n\ninterface ReturnAdditional<Value> {\n value: Value\n isChanged: boolean\n ariaAttributes: AriaAttributes\n dataContext: ContextState\n setHasFocus: (hasFocus: boolean, valueOverride?: unknown) => void\n handleFocus: () => void\n handleBlur: () => void\n handleChange: FieldProps<Value>['onChange']\n updateValue: (value: Value) => void\n forceUpdate: () => void\n}\n\nexport function omitDataValueProps<\n Props extends FieldProps<unknown> & ReturnAdditional<unknown>,\n>(props: Props) {\n // Do not include typical HTML attributes\n const {\n name, // eslint-disable-line\n error, // eslint-disable-line\n warning, // eslint-disable-line\n info, // eslint-disable-line\n hasError, // eslint-disable-line\n isChanged, // eslint-disable-line\n autoComplete, // eslint-disable-line\n ariaAttributes, // eslint-disable-line\n dataContext, // eslint-disable-line\n setHasFocus, // eslint-disable-line\n handleFocus, // eslint-disable-line\n handleBlur, // eslint-disable-line\n handleChange, // eslint-disable-line\n updateValue, // eslint-disable-line\n forceUpdate, // eslint-disable-line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1E,YAAY;MACZgE,WAAW;MACXnG;IAEF,CAAC,GAAGrC,KAAK;IADJqK,SAAS,GAAAC,wBAAA,CACVtK,KAAK,EAAAuK,SAAA;EAET,OAAOF,SAAS;AAClB"}
@@ -5,7 +5,7 @@ export default function useId(customId) {
5
5
  const id = React === null || React === void 0 ? void 0 : (_React$useId = React.useId) === null || _React$useId === void 0 ? void 0 : _React$useId.call(React);
6
6
  return React.useMemo(() => {
7
7
  var _ref;
8
- return (_ref = customId !== null && customId !== void 0 ? customId : id) !== null && _ref !== void 0 ? _ref : makeUniqueId();
8
+ return (_ref = customId !== null && customId !== void 0 ? customId : id === null || id === void 0 ? void 0 : id.replace(/:/, 'id-').replace(/:/, '')) !== null && _ref !== void 0 ? _ref : makeUniqueId();
9
9
  }, [customId, id]);
10
10
  }
11
11
  //# sourceMappingURL=useId.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useId.js","names":["React","makeUniqueId","useId","customId","_React$useId","id","call","useMemo","_ref"],"sources":["../../../../../src/extensions/forms/hooks/useId.ts"],"sourcesContent":["import React from 'react'\nimport { makeUniqueId } from '../../../shared/component-helper'\n\nexport default function useId(customId?: string) {\n const id = React?.useId?.()\n return React.useMemo(\n () => customId ?? id ?? makeUniqueId(),\n [customId, id]\n )\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,kCAAkC;AAE/D,eAAe,SAASC,KAAKA,CAACC,QAAiB,EAAE;EAAA,IAAAC,YAAA;EAC/C,MAAMC,EAAE,GAAGL,KAAK,aAALA,KAAK,wBAAAI,YAAA,GAALJ,KAAK,CAAEE,KAAK,cAAAE,YAAA,uBAAZA,YAAA,CAAAE,IAAA,CAAAN,KAAe,CAAC;EAC3B,OAAOA,KAAK,CAACO,OAAO,CAClB;IAAA,IAAAC,IAAA;IAAA,QAAAA,IAAA,GAAML,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAIE,EAAE,cAAAG,IAAA,cAAAA,IAAA,GAAIP,YAAY,CAAC,CAAC;EAAA,GACtC,CAACE,QAAQ,EAAEE,EAAE,CACf,CAAC;AACH"}
1
+ {"version":3,"file":"useId.js","names":["React","makeUniqueId","useId","customId","_React$useId","id","call","useMemo","_ref","replace"],"sources":["../../../../../src/extensions/forms/hooks/useId.ts"],"sourcesContent":["import React from 'react'\nimport { makeUniqueId } from '../../../shared/component-helper'\n\nexport default function useId(customId?: string) {\n const id = React?.useId?.()\n return React.useMemo(\n () =>\n customId ??\n id?.replace(/:/, 'id-').replace(/:/, '') ??\n makeUniqueId(),\n [customId, id]\n )\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,kCAAkC;AAE/D,eAAe,SAASC,KAAKA,CAACC,QAAiB,EAAE;EAAA,IAAAC,YAAA;EAC/C,MAAMC,EAAE,GAAGL,KAAK,aAALA,KAAK,wBAAAI,YAAA,GAALJ,KAAK,CAAEE,KAAK,cAAAE,YAAA,uBAAZA,YAAA,CAAAE,IAAA,CAAAN,KAAe,CAAC;EAC3B,OAAOA,KAAK,CAACO,OAAO,CAClB;IAAA,IAAAC,IAAA;IAAA,QAAAA,IAAA,GACEL,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GACRE,EAAE,aAAFA,EAAE,uBAAFA,EAAE,CAAEI,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAACA,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,cAAAD,IAAA,cAAAA,IAAA,GACxCP,YAAY,CAAC,CAAC;EAAA,GAChB,CAACE,QAAQ,EAAEE,EAAE,CACf,CAAC;AACH"}
@@ -3,7 +3,7 @@
3
3
  import { useEffect } from 'react';
4
4
  export default function useMountEffect(callback) {
5
5
  useEffect(function () {
6
- callback(...arguments);
6
+ return callback(...arguments);
7
7
  }, []);
8
8
  }
9
9
  //# sourceMappingURL=useMountEffect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMountEffect.js","names":["useEffect","useMountEffect","callback","arguments"],"sources":["../../../../../src/extensions/forms/hooks/useMountEffect.ts"],"sourcesContent":["import { useEffect, EffectCallback } from 'react'\n\n/**\n * UseEffect that only run on the initial mount\n */\nexport default function useMountEffect(callback: EffectCallback) {\n useEffect((...args) => {\n callback(...args)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n}\n"],"mappings":";;AAAA,SAASA,SAAS,QAAwB,OAAO;AAKjD,eAAe,SAASC,cAAcA,CAACC,QAAwB,EAAE;EAC/DF,SAAS,CAAC,YAAa;IACrBE,QAAQ,CAAC,GAAAC,SAAO,CAAC;EAEnB,CAAC,EAAE,EAAE,CAAC;AACR"}
1
+ {"version":3,"file":"useMountEffect.js","names":["useEffect","useMountEffect","callback","arguments"],"sources":["../../../../../src/extensions/forms/hooks/useMountEffect.ts"],"sourcesContent":["import { useEffect, EffectCallback } from 'react'\n\n/**\n * UseEffect that only run on the initial mount\n */\nexport default function useMountEffect(callback: EffectCallback) {\n useEffect((...args) => {\n return callback(...args)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n}\n"],"mappings":";;AAAA,SAASA,SAAS,QAAwB,OAAO;AAKjD,eAAe,SAASC,cAAcA,CAACC,QAAwB,EAAE;EAC/DF,SAAS,CAAC,YAAa;IACrB,OAAOE,QAAQ,CAAC,GAAAC,SAAO,CAAC;EAE1B,CAAC,EAAE,EAAE,CAAC;AACR"}
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function useMounted(): import("react").MutableRefObject<boolean>;
@@ -0,0 +1,14 @@
1
+ "use client";
2
+
3
+ import { useEffect, useRef } from 'react';
4
+ export default function useMounted() {
5
+ const mounted = useRef(false);
6
+ useEffect(() => {
7
+ mounted.current = true;
8
+ return () => {
9
+ mounted.current = false;
10
+ };
11
+ }, []);
12
+ return mounted;
13
+ }
14
+ //# sourceMappingURL=useMounted.js.map