@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,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,EAAE;EACV,CAAC;EACDG,IAAI,EAAE;IACJL,GAAG,EAAE,6CAA6C;IAClDC,IAAI,EAAE,YAAY;IAClBC,MAAM,EAAE;EACV,CAAC;E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ACPlB,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';
@@ -25,6 +27,8 @@ export default function useDataValue(props) {
25
27
  itemPath,
26
28
  emptyValue,
27
29
  required,
30
+ info,
31
+ warning,
28
32
  error: errorProp,
29
33
  errorMessages,
30
34
  onFocus,
@@ -56,7 +60,7 @@ export default function useDataValue(props) {
56
60
  startProcess
57
61
  } = useProcessManager();
58
62
  const id = useId(props.id);
59
- const dataContext = useContext(Context);
63
+ const dataContext = useContext(DataContext);
60
64
  const fieldBlockContext = useContext(FieldBlockContext);
61
65
  const iterateElementContext = useContext(IterateElementContext);
62
66
  const sharedContext = useContext(SharedContext);
@@ -81,8 +85,8 @@ export default function useDataValue(props) {
81
85
  const dataContextError = path ? dataContextErrors === null || dataContextErrors === void 0 ? void 0 : dataContextErrors[path] : undefined;
82
86
  const inFieldBlock = Boolean(fieldBlockContext);
83
87
  const {
84
- setError: setFieldBlockError,
85
- setShowError: setShowFieldBlockError
88
+ setFieldState: setFieldBlockState,
89
+ showFieldError: showFieldBlockError
86
90
  } = fieldBlockContext !== null && fieldBlockContext !== void 0 ? fieldBlockContext : {};
87
91
  const inIterate = Boolean(iterateElementContext);
88
92
  const {
@@ -135,12 +139,12 @@ export default function useDataValue(props) {
135
139
  const schemaValidatorRef = useRef(schema ? (_dataContext$ajvInsta = dataContext.ajvInstance) === null || _dataContext$ajvInsta === void 0 ? void 0 : _dataContext$ajvInsta.compile(schema) : undefined);
136
140
  const showError = useCallback(() => {
137
141
  showErrorRef.current = true;
138
- setShowFieldBlockError === null || setShowFieldBlockError === void 0 ? void 0 : setShowFieldBlockError(path !== null && path !== void 0 ? path : id, true);
139
- }, [path, id, setShowFieldBlockError]);
142
+ showFieldBlockError === null || showFieldBlockError === void 0 ? void 0 : showFieldBlockError(identifier, true);
143
+ }, [showFieldBlockError, identifier]);
140
144
  const hideError = useCallback(() => {
141
145
  showErrorRef.current = false;
142
- setShowFieldBlockError === null || setShowFieldBlockError === void 0 ? void 0 : setShowFieldBlockError(path !== null && path !== void 0 ? path : id, false);
143
- }, [path, id, setShowFieldBlockError]);
146
+ showFieldBlockError === null || showFieldBlockError === void 0 ? void 0 : showFieldBlockError(identifier, false);
147
+ }, [showFieldBlockError, identifier]);
144
148
  const errorMessagesRef = useRef(null);
145
149
  errorMessagesRef.current = useMemo(() => {
146
150
  return _objectSpread({
@@ -171,6 +175,7 @@ export default function useDataValue(props) {
171
175
  }
172
176
  return error;
173
177
  }, []);
178
+ const stateId = useId();
174
179
  const persistErrorState = useCallback(errorArg => {
175
180
  const error = prepareError(errorArg);
176
181
  if (!errorChanged(error, localErrorRef.current)) {
@@ -178,9 +183,15 @@ export default function useDataValue(props) {
178
183
  }
179
184
  localErrorRef.current = error;
180
185
  dataContextSetValueWithError === null || dataContextSetValueWithError === void 0 ? void 0 : dataContextSetValueWithError(identifier, Boolean(error));
181
- setFieldBlockError === null || setFieldBlockError === void 0 ? void 0 : setFieldBlockError(path !== null && path !== void 0 ? path : id, error);
186
+ setFieldBlockState === null || setFieldBlockState === void 0 ? void 0 : setFieldBlockState({
187
+ stateId,
188
+ identifier,
189
+ type: 'error',
190
+ state: error,
191
+ showInitially: Boolean(inFieldBlock && validateInitially)
192
+ });
182
193
  forceUpdate();
183
- }, [path, identifier, id, prepareError, dataContextSetValueWithError, setFieldBlockError, forceUpdate]);
194
+ }, [stateId, prepareError, dataContextSetValueWithError, identifier, setFieldBlockState, inFieldBlock, validateInitially]);
184
195
  const clearErrorState = useCallback(() => persistErrorState(undefined), [persistErrorState]);
185
196
  const validateValue = useCallback(async () => {
186
197
  const isProcessActive = startProcess();
@@ -318,30 +329,86 @@ export default function useDataValue(props) {
318
329
  useMountEffect(() => {
319
330
  dataContext === null || dataContext === void 0 ? void 0 : dataContext.handleMountField(identifier);
320
331
  validateValue();
321
- if (showErrorInitially) {
322
- showError();
332
+ });
333
+ useUnmountEffect(() => {
334
+ dataContext === null || dataContext === void 0 ? void 0 : dataContext.handleUnMountField(identifier);
335
+ });
336
+ useMountEffect(() => {
337
+ if (inFieldBlock) {
338
+ if (errorProp) {
339
+ setFieldBlockState === null || setFieldBlockState === void 0 ? void 0 : setFieldBlockState({
340
+ identifier,
341
+ type: 'error',
342
+ state: errorProp,
343
+ showInitially: true,
344
+ show: true
345
+ });
346
+ }
347
+ if (warning) {
348
+ setFieldBlockState === null || setFieldBlockState === void 0 ? void 0 : setFieldBlockState({
349
+ identifier,
350
+ type: 'warning',
351
+ state: warning,
352
+ showInitially: true,
353
+ show: true
354
+ });
355
+ }
356
+ if (info) {
357
+ setFieldBlockState === null || setFieldBlockState === void 0 ? void 0 : setFieldBlockState({
358
+ identifier,
359
+ type: 'info',
360
+ state: info,
361
+ showInitially: true,
362
+ show: true
363
+ });
364
+ }
365
+ return () => {
366
+ if (fieldBlockContext.mountedFieldsRef) {
367
+ fieldBlockContext.mountedFieldsRef.current[identifier] = true;
368
+ }
369
+ };
323
370
  }
324
- return () => {
325
- dataContext === null || dataContext === void 0 ? void 0 : dataContext.handleUnMountField(identifier);
326
- };
327
371
  });
328
372
  const error = showErrorRef.current ? (_ref = errorProp !== null && errorProp !== void 0 ? errorProp : localErrorRef.current) !== null && _ref !== void 0 ? _ref : contextErrorRef.current : undefined;
329
- const ariaAttributes = {};
373
+ const hasError = Boolean(error) || inFieldBlock && fieldBlockContext.hasErrorProp;
374
+ const ariaAttributes = useMemo(() => {
375
+ return Object.keys(props).reduce((acc, cur) => {
376
+ if (!cur.startsWith('aria-')) {
377
+ return acc;
378
+ }
379
+ acc[cur] = props[cur];
380
+ return acc;
381
+ }, {});
382
+ }, [props]);
330
383
  if (error) {
331
- ariaAttributes['aria-invalid'] = String(Boolean(error));
384
+ ariaAttributes['aria-invalid'] = error ? 'true' : 'false';
332
385
  }
333
386
  if (required) {
334
- ariaAttributes['aria-required'] = String(required);
387
+ ariaAttributes['aria-required'] = required ? 'true' : 'false';
388
+ }
389
+ if (inFieldBlock) {
390
+ var _fieldBlockContext$fi;
391
+ if (fieldBlockContext.mountedFieldsRef) {
392
+ fieldBlockContext.mountedFieldsRef.current[identifier] = true;
393
+ }
394
+ const stateIds = (_fieldBlockContext$fi = fieldBlockContext.fieldStateIdsRef) === null || _fieldBlockContext$fi === void 0 ? void 0 : _fieldBlockContext$fi.current;
395
+ if (stateIds) {
396
+ ariaAttributes['aria-describedby'] = combineDescribedBy(props, [error && stateIds.error, warning && stateIds.warning, info && stateIds.info].filter(Boolean));
397
+ }
398
+ } else {
399
+ ariaAttributes['aria-describedby'] = combineDescribedBy(props, [(error || errorProp) && `${id}-form-status--error`, warning && `${id}-form-status--warning`, info && `${id}-form-status--info`].filter(Boolean));
335
400
  }
336
401
  return _objectSpread(_objectSpread({}, props), {}, {
337
402
  id,
338
403
  name: props.name || ((_props$path = props.path) === null || _props$path === void 0 ? void 0 : _props$path.replace('/', '')) || id,
339
404
  value: transformers.current.toInput(valueRef.current),
405
+ info: !inFieldBlock ? info : undefined,
406
+ warning: !inFieldBlock ? warning : undefined,
340
407
  error: !inFieldBlock ? error : undefined,
341
- hasError: Boolean(error),
342
- isChanged: changedRef.current,
343
- autoComplete: (_props$autoComplete = props.autoComplete) !== null && _props$autoComplete !== void 0 ? _props$autoComplete : dataContext.autoComplete === true ? 'on' : 'off',
408
+ hasError,
344
409
  disabled,
410
+ autoComplete: (_props$autoComplete = props.autoComplete) !== null && _props$autoComplete !== void 0 ? _props$autoComplete : dataContext.autoComplete === true ? 'on' : 'off',
411
+ isChanged: changedRef.current,
345
412
  ariaAttributes,
346
413
  dataContext,
347
414
  setHasFocus,
@@ -356,6 +423,8 @@ export function omitDataValueProps(props) {
356
423
  const {
357
424
  name,
358
425
  error,
426
+ warning,
427
+ info,
359
428
  hasError,
360
429
  isChanged,
361
430
  autoComplete,
@@ -369,6 +438,6 @@ export function omitDataValueProps(props) {
369
438
  forceUpdate
370
439
  } = props,
371
440
  restProps = _objectWithoutProperties(props, _excluded);
372
- return Object.freeze(restProps);
441
+ return restProps;
373
442
  }
374
443
  //# 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","_ref","_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","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","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","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;AACnD,OAAOC,KAAK,MAAM,SAAS;AAE3B,eAAe,SAASC,YAAYA,CAGlCC,KAAY,EAAmC;EAAA,IAAAC,eAAA,EAAAC,qBAAA,EAAAC,IAAA,EAAAC,WAAA,EAAAC,mBA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AO;IAC7BoE,YAAY,GAAAzI,mBAAA,GACVL,KAAK,CAAC8I,YAAY,cAAAzI,mBAAA,cAAAA,mBAAA,GACjB+B,WAAW,CAAC0G,YAAY,KAAK,IAAI,GAAG,IAAI,GAAG,KAAM;IACpD/G,QAAQ;IACR2G,cAAc;IACdtG,WAAW;IACXqF,WAAW;IACXa,WAAW;IACXC,UAAU;IACVnE,YAAY;IACZ2D,WAAW;IACX9F;EAAW;AAEf;AAwBA,OAAO,SAAS8G,kBAAkBA,CAEhC/I,KAAmB,EAAE;EAErB,MAAM;MACJ4I,IAAI;MACJlI,KAAK;MACLmI,QAAQ;MACR5B,SAAS;MACT6B,YAAY;MACZJ,cAAc;MACdtG,WAAW;MACXqF,WAAW;MACXa,WAAW;MACXC,UAAU;MACVnE,YAAY;MACZ2D,WAAW;MACX9F;IAEF,CAAC,GAAGjC,KAAK;IADJgJ,SAAS,GAAAC,wBAAA,CACVjJ,KAAK,EAAAkJ,SAAA;EACT,OAAO7C,MAAM,CAAC8C,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","_ref","_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","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","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","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\n ...restProps\n } = props\n\n return restProps\n}\n"],"mappings":";;;;;;;AAAA,SACEA,MAAM,EACNC,SAAS,EACTC,UAAU,EACVC,WAAW,EACXC,OAAO,EACPC,UAAU,QAEL,OAAO;AACd,OAAOC,OAAO,MAAM,cAAc;AAElC,SAASC,YAAY,QAAQ,UAAU;AACvC,SAASC,uBAAuB,QAAQ,cAAc;AACtD,SAASC,SAAS,QAAyC,UAAU;AACrE,SAASC,OAAO,IAAIC,WAAW,QAAsB,gBAAgB;AACrE,SAASC,kBAAkB,QAAQ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lE,IAAI,EAAE,CAACkD,YAAY,GAAGlD,IAAI,GAAGsB,SAAS;IACtCrB,OAAO,EAAE,CAACiD,YAAY,GAAGjD,OAAO,GAAGqB,SAAS;IAC5CpB,KAAK,EAAE,CAACgD,YAAY,GAAGhD,KAAK,GAAGoB,SAAS;IACxCkH,QAAQ;IACRjH,QAAQ;IACR6H,YAAY,GAAAzJ,mBAAA,GACVL,KAAK,CAAC8J,YAAY,cAAAzJ,mBAAA,cAAAA,mBAAA,GACjBiC,WAAW,CAACwH,YAAY,KAAK,IAAI,GAAG,IAAI,GAAG,KAAM;IAGpDvC,SAAS,EAAEtC,UAAU,CAACL,OAAO;IAC7BwE,cAAc;IACd9G,WAAW;IACXyF,WAAW;IACXa,WAAW;IACXC,UAAU;IACVvE,YAAY;IACZ+D,WAAW;IACXlG;EAAW;AAEf;AAeA,OAAO,SAAS4H,kBAAkBA,CAEhC/J,KAAY,EAAE;EAEd,MAAM;MACJ6J,IAAI;MACJjJ,KAAK;MACLD,OAAO;MACPD,IAAI;MACJwI,QAAQ;MACR3B,SAAS;MACTuC,YAAY;MACZV,cAAc;MACd9G,WAAW;MACXyF,WAAW;MACXa,WAAW;MACXC,UAAU;MACVvE,YAAY;MACZ+D,WAAW;MACXlG;IAEF,CAAC,GAAGnC,KAAK;IADJgK,SAAS,GAAAC,wBAAA,CACVjK,KAAK,EAAAkK,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((...args) => {
6
- callback(...args);
6
+ return callback(...args);
7
7
  }, []);
8
8
  }
9
9
  //# sourceMappingURL=useMountEffect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useMountEffect.js","names":["useEffect","useMountEffect","callback","args"],"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,CAAC,GAAGG,IAAI,KAAK;IACrBD,QAAQ,CAAC,GAAGC,IAAI,CAAC;EAEnB,CAAC,EAAE,EAAE,CAAC;AACR"}
1
+ {"version":3,"file":"useMountEffect.js","names":["useEffect","useMountEffect","callback","args"],"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,CAAC,GAAGG,IAAI,KAAK;IACrB,OAAOD,QAAQ,CAAC,GAAGC,IAAI,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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMounted.js","names":["useEffect","useRef","useMounted","mounted","current"],"sources":["../../../../../src/extensions/forms/hooks/useMounted.ts"],"sourcesContent":["import { useEffect, useRef } from 'react'\n\nexport default function useMounted() {\n const mounted = useRef(false)\n\n useEffect(() => {\n mounted.current = true\n return () => {\n mounted.current = false\n }\n }, [])\n\n return mounted\n}\n"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzC,eAAe,SAASC,UAAUA,CAAA,EAAG;EACnC,MAAMC,OAAO,GAAGF,MAAM,CAAC,KAAK,CAAC;EAE7BD,SAAS,CAAC,MAAM;IACdG,OAAO,CAACC,OAAO,GAAG,IAAI;IACtB,OAAO,MAAM;MACXD,OAAO,CAACC,OAAO,GAAG,KAAK;IACzB,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOD,OAAO;AAChB"}