@dnb/eufemia 10.73.0 → 10.73.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/cjs/components/autocomplete/Autocomplete.d.ts +4 -0
  3. package/cjs/components/autocomplete/AutocompleteDocs.js +5 -0
  4. package/cjs/components/autocomplete/AutocompleteDocs.js.map +1 -1
  5. package/cjs/components/modal/ModalDocs.js +3 -3
  6. package/cjs/components/modal/ModalDocs.js.map +1 -1
  7. package/cjs/components/upload/UploadFileList.js +7 -4
  8. package/cjs/components/upload/UploadFileList.js.map +1 -1
  9. package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumber.js +9 -5
  10. package/cjs/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
  11. package/cjs/extensions/forms/Field/SelectCountry/SelectCountry.d.ts +2 -2
  12. package/cjs/extensions/forms/Field/SelectCountry/SelectCountry.js +1 -0
  13. package/cjs/extensions/forms/Field/SelectCountry/SelectCountry.js.map +1 -1
  14. package/cjs/extensions/forms/Field/SelectCurrency/SelectCurrency.js +1 -0
  15. package/cjs/extensions/forms/Field/SelectCurrency/SelectCurrency.js.map +1 -1
  16. package/cjs/extensions/forms/Field/Selection/Selection.js +2 -1
  17. package/cjs/extensions/forms/Field/Selection/Selection.js.map +1 -1
  18. package/cjs/extensions/forms/FieldBlock/FieldBlock.js +8 -4
  19. package/cjs/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
  20. package/cjs/extensions/forms/FieldBlock/style/dnb-field-block.css +8 -0
  21. package/cjs/extensions/forms/FieldBlock/style/dnb-field-block.min.css +1 -1
  22. package/cjs/extensions/forms/FieldBlock/style/dnb-field-block.scss +9 -0
  23. package/cjs/extensions/forms/Form/Section/style/dnb-form-section.css +1 -1
  24. package/cjs/extensions/forms/Form/Section/style/dnb-form-section.min.css +1 -1
  25. package/cjs/extensions/forms/Form/Section/style/dnb-form-section.scss +1 -1
  26. package/cjs/extensions/forms/Value/SelectCountry/useCountry.d.ts +1 -1
  27. package/cjs/extensions/forms/ValueBlock/ValueBlock.js +12 -8
  28. package/cjs/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
  29. package/cjs/extensions/forms/ValueBlock/style/dnb-value-block.css +11 -6
  30. package/cjs/extensions/forms/ValueBlock/style/dnb-value-block.min.css +1 -1
  31. package/cjs/extensions/forms/ValueBlock/style/dnb-value-block.scss +8 -4
  32. package/cjs/extensions/forms/style/dnb-forms.css +19 -7
  33. package/cjs/extensions/forms/style/dnb-forms.min.css +1 -1
  34. package/cjs/shared/Eufemia.d.ts +1 -1
  35. package/cjs/shared/Eufemia.js +2 -2
  36. package/cjs/shared/Eufemia.js.map +1 -1
  37. package/cjs/style/core/scopes.scss +1 -1
  38. package/cjs/style/dnb-ui-basis.css +1 -1
  39. package/cjs/style/dnb-ui-basis.min.css +1 -1
  40. package/cjs/style/dnb-ui-body.css +1 -1
  41. package/cjs/style/dnb-ui-body.min.css +1 -1
  42. package/cjs/style/dnb-ui-components.css +18 -7
  43. package/cjs/style/dnb-ui-components.min.css +1 -1
  44. package/cjs/style/dnb-ui-core.css +1 -1
  45. package/cjs/style/dnb-ui-core.min.css +1 -1
  46. package/cjs/style/dnb-ui-extensions.css +19 -7
  47. package/cjs/style/dnb-ui-extensions.min.css +1 -1
  48. package/cjs/style/dnb-ui-forms.css +19 -7
  49. package/cjs/style/dnb-ui-forms.min.css +1 -1
  50. package/cjs/style/themes/theme-eiendom/eiendom-theme-components.css +36 -14
  51. package/cjs/style/themes/theme-eiendom/eiendom-theme-components.min.css +1 -1
  52. package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.css +19 -7
  53. package/cjs/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
  54. package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.css +19 -7
  55. package/cjs/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
  56. package/cjs/style/themes/theme-sbanken/sbanken-theme-components.css +36 -14
  57. package/cjs/style/themes/theme-sbanken/sbanken-theme-components.min.css +1 -1
  58. package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.css +19 -7
  59. package/cjs/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
  60. package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.css +19 -7
  61. package/cjs/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
  62. package/cjs/style/themes/theme-ui/ui-theme-components.css +36 -14
  63. package/cjs/style/themes/theme-ui/ui-theme-components.min.css +1 -1
  64. package/cjs/style/themes/theme-ui/ui-theme-extensions.css +19 -7
  65. package/cjs/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
  66. package/cjs/style/themes/theme-ui/ui-theme-forms.css +19 -7
  67. package/cjs/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
  68. package/components/autocomplete/Autocomplete.d.ts +4 -0
  69. package/components/autocomplete/AutocompleteDocs.js +5 -0
  70. package/components/autocomplete/AutocompleteDocs.js.map +1 -1
  71. package/components/modal/ModalDocs.js +3 -3
  72. package/components/modal/ModalDocs.js.map +1 -1
  73. package/components/upload/UploadFileList.js +7 -4
  74. package/components/upload/UploadFileList.js.map +1 -1
  75. package/es/components/autocomplete/Autocomplete.d.ts +4 -0
  76. package/es/components/autocomplete/AutocompleteDocs.js +5 -0
  77. package/es/components/autocomplete/AutocompleteDocs.js.map +1 -1
  78. package/es/components/modal/ModalDocs.js +3 -3
  79. package/es/components/modal/ModalDocs.js.map +1 -1
  80. package/es/components/upload/UploadFileList.js +7 -4
  81. package/es/components/upload/UploadFileList.js.map +1 -1
  82. package/es/extensions/forms/Field/PhoneNumber/PhoneNumber.js +9 -5
  83. package/es/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
  84. package/es/extensions/forms/Field/SelectCountry/SelectCountry.d.ts +2 -2
  85. package/es/extensions/forms/Field/SelectCountry/SelectCountry.js +1 -0
  86. package/es/extensions/forms/Field/SelectCountry/SelectCountry.js.map +1 -1
  87. package/es/extensions/forms/Field/SelectCurrency/SelectCurrency.js +1 -0
  88. package/es/extensions/forms/Field/SelectCurrency/SelectCurrency.js.map +1 -1
  89. package/es/extensions/forms/Field/Selection/Selection.js +2 -1
  90. package/es/extensions/forms/Field/Selection/Selection.js.map +1 -1
  91. package/es/extensions/forms/FieldBlock/FieldBlock.js +8 -4
  92. package/es/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
  93. package/es/extensions/forms/FieldBlock/style/dnb-field-block.css +8 -0
  94. package/es/extensions/forms/FieldBlock/style/dnb-field-block.min.css +1 -1
  95. package/es/extensions/forms/FieldBlock/style/dnb-field-block.scss +9 -0
  96. package/es/extensions/forms/Form/Section/style/dnb-form-section.css +1 -1
  97. package/es/extensions/forms/Form/Section/style/dnb-form-section.min.css +1 -1
  98. package/es/extensions/forms/Form/Section/style/dnb-form-section.scss +1 -1
  99. package/es/extensions/forms/Value/SelectCountry/useCountry.d.ts +1 -1
  100. package/es/extensions/forms/ValueBlock/ValueBlock.js +12 -8
  101. package/es/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
  102. package/es/extensions/forms/ValueBlock/style/dnb-value-block.css +11 -6
  103. package/es/extensions/forms/ValueBlock/style/dnb-value-block.min.css +1 -1
  104. package/es/extensions/forms/ValueBlock/style/dnb-value-block.scss +8 -4
  105. package/es/extensions/forms/style/dnb-forms.css +19 -7
  106. package/es/extensions/forms/style/dnb-forms.min.css +1 -1
  107. package/es/shared/Eufemia.d.ts +1 -1
  108. package/es/shared/Eufemia.js +2 -2
  109. package/es/shared/Eufemia.js.map +1 -1
  110. package/es/style/core/scopes.scss +1 -1
  111. package/es/style/dnb-ui-basis.css +1 -1
  112. package/es/style/dnb-ui-basis.min.css +1 -1
  113. package/es/style/dnb-ui-body.css +1 -1
  114. package/es/style/dnb-ui-body.min.css +1 -1
  115. package/es/style/dnb-ui-components.css +18 -7
  116. package/es/style/dnb-ui-components.min.css +1 -1
  117. package/es/style/dnb-ui-core.css +1 -1
  118. package/es/style/dnb-ui-core.min.css +1 -1
  119. package/es/style/dnb-ui-extensions.css +19 -7
  120. package/es/style/dnb-ui-extensions.min.css +1 -1
  121. package/es/style/dnb-ui-forms.css +19 -7
  122. package/es/style/dnb-ui-forms.min.css +1 -1
  123. package/es/style/themes/theme-eiendom/eiendom-theme-components.css +36 -14
  124. package/es/style/themes/theme-eiendom/eiendom-theme-components.min.css +1 -1
  125. package/es/style/themes/theme-eiendom/eiendom-theme-extensions.css +19 -7
  126. package/es/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
  127. package/es/style/themes/theme-eiendom/eiendom-theme-forms.css +19 -7
  128. package/es/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
  129. package/es/style/themes/theme-sbanken/sbanken-theme-components.css +36 -14
  130. package/es/style/themes/theme-sbanken/sbanken-theme-components.min.css +1 -1
  131. package/es/style/themes/theme-sbanken/sbanken-theme-extensions.css +19 -7
  132. package/es/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
  133. package/es/style/themes/theme-sbanken/sbanken-theme-forms.css +19 -7
  134. package/es/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
  135. package/es/style/themes/theme-ui/ui-theme-components.css +36 -14
  136. package/es/style/themes/theme-ui/ui-theme-components.min.css +1 -1
  137. package/es/style/themes/theme-ui/ui-theme-extensions.css +19 -7
  138. package/es/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
  139. package/es/style/themes/theme-ui/ui-theme-forms.css +19 -7
  140. package/es/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
  141. package/esm/dnb-ui-basis.min.mjs +1 -1
  142. package/esm/dnb-ui-components.min.mjs +1 -1
  143. package/esm/dnb-ui-elements.min.mjs +1 -1
  144. package/esm/dnb-ui-extensions.min.mjs +1 -1
  145. package/esm/dnb-ui-lib.min.mjs +1 -1
  146. package/extensions/forms/Field/PhoneNumber/PhoneNumber.js +9 -5
  147. package/extensions/forms/Field/PhoneNumber/PhoneNumber.js.map +1 -1
  148. package/extensions/forms/Field/SelectCountry/SelectCountry.d.ts +2 -2
  149. package/extensions/forms/Field/SelectCountry/SelectCountry.js +1 -0
  150. package/extensions/forms/Field/SelectCountry/SelectCountry.js.map +1 -1
  151. package/extensions/forms/Field/SelectCurrency/SelectCurrency.js +1 -0
  152. package/extensions/forms/Field/SelectCurrency/SelectCurrency.js.map +1 -1
  153. package/extensions/forms/Field/Selection/Selection.js +2 -1
  154. package/extensions/forms/Field/Selection/Selection.js.map +1 -1
  155. package/extensions/forms/FieldBlock/FieldBlock.js +8 -4
  156. package/extensions/forms/FieldBlock/FieldBlock.js.map +1 -1
  157. package/extensions/forms/FieldBlock/style/dnb-field-block.css +8 -0
  158. package/extensions/forms/FieldBlock/style/dnb-field-block.min.css +1 -1
  159. package/extensions/forms/FieldBlock/style/dnb-field-block.scss +9 -0
  160. package/extensions/forms/Form/Section/style/dnb-form-section.css +1 -1
  161. package/extensions/forms/Form/Section/style/dnb-form-section.min.css +1 -1
  162. package/extensions/forms/Form/Section/style/dnb-form-section.scss +1 -1
  163. package/extensions/forms/Value/SelectCountry/useCountry.d.ts +1 -1
  164. package/extensions/forms/ValueBlock/ValueBlock.js +12 -8
  165. package/extensions/forms/ValueBlock/ValueBlock.js.map +1 -1
  166. package/extensions/forms/ValueBlock/style/dnb-value-block.css +11 -6
  167. package/extensions/forms/ValueBlock/style/dnb-value-block.min.css +1 -1
  168. package/extensions/forms/ValueBlock/style/dnb-value-block.scss +8 -4
  169. package/extensions/forms/style/dnb-forms.css +19 -7
  170. package/extensions/forms/style/dnb-forms.min.css +1 -1
  171. package/package.json +1 -1
  172. package/shared/Eufemia.d.ts +1 -1
  173. package/shared/Eufemia.js +2 -2
  174. package/shared/Eufemia.js.map +1 -1
  175. package/style/core/scopes.scss +1 -1
  176. package/style/dnb-ui-basis.css +1 -1
  177. package/style/dnb-ui-basis.min.css +1 -1
  178. package/style/dnb-ui-body.css +1 -1
  179. package/style/dnb-ui-body.min.css +1 -1
  180. package/style/dnb-ui-components.css +18 -7
  181. package/style/dnb-ui-components.min.css +1 -1
  182. package/style/dnb-ui-core.css +1 -1
  183. package/style/dnb-ui-core.min.css +1 -1
  184. package/style/dnb-ui-extensions.css +19 -7
  185. package/style/dnb-ui-extensions.min.css +1 -1
  186. package/style/dnb-ui-forms.css +19 -7
  187. package/style/dnb-ui-forms.min.css +1 -1
  188. package/style/themes/theme-eiendom/eiendom-theme-components.css +36 -14
  189. package/style/themes/theme-eiendom/eiendom-theme-components.min.css +1 -1
  190. package/style/themes/theme-eiendom/eiendom-theme-extensions.css +19 -7
  191. package/style/themes/theme-eiendom/eiendom-theme-extensions.min.css +1 -1
  192. package/style/themes/theme-eiendom/eiendom-theme-forms.css +19 -7
  193. package/style/themes/theme-eiendom/eiendom-theme-forms.min.css +1 -1
  194. package/style/themes/theme-sbanken/sbanken-theme-components.css +36 -14
  195. package/style/themes/theme-sbanken/sbanken-theme-components.min.css +1 -1
  196. package/style/themes/theme-sbanken/sbanken-theme-extensions.css +19 -7
  197. package/style/themes/theme-sbanken/sbanken-theme-extensions.min.css +1 -1
  198. package/style/themes/theme-sbanken/sbanken-theme-forms.css +19 -7
  199. package/style/themes/theme-sbanken/sbanken-theme-forms.min.css +1 -1
  200. package/style/themes/theme-ui/ui-theme-components.css +36 -14
  201. package/style/themes/theme-ui/ui-theme-components.min.css +1 -1
  202. package/style/themes/theme-ui/ui-theme-extensions.css +19 -7
  203. package/style/themes/theme-ui/ui-theme-extensions.min.css +1 -1
  204. package/style/themes/theme-ui/ui-theme-forms.css +19 -7
  205. package/style/themes/theme-ui/ui-theme-forms.min.css +1 -1
  206. package/umd/dnb-ui-basis.min.js +1 -1
  207. package/umd/dnb-ui-components.min.js +1 -1
  208. package/umd/dnb-ui-elements.min.js +1 -1
  209. package/umd/dnb-ui-extensions.min.js +1 -1
  210. package/umd/dnb-ui-lib.min.js +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
3
3
  All notable changes to @dnb/eufemia will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.73.1](https://github.com/dnbexperience/eufemia/compare/v10.73.0...v10.73.1) (2025-05-09)
7
+
8
+
9
+ ### :memo: Documentation
10
+
11
+ * **Drawer, Dialog:** display Modal translations in properties docs ([#5083](https://github.com/dnbexperience/eufemia/issues/5083)) ([ab3fae7](https://github.com/dnbexperience/eufemia/commit/ab3fae7053fc084e6fa13b7b08499c936c210a64))
12
+ * **Modal:** `closeTitle`, `hideCloseButton`, `spacing` is not deprecated ([#5082](https://github.com/dnbexperience/eufemia/issues/5082)) ([4753910](https://github.com/dnbexperience/eufemia/commit/47539103a9ed8e375d0aeb0c24d3a45206d38466)), closes [/github.com/dnbexperience/eufemia/commit/ebe8e6a597c87885c081fcdfd76339780e90befc#diff-f1c94bc3bf35a0cb7181e56dab45c760dfa612539ab3fcd8c903e3c76b6b9f6](https://github.com/dnbexperience//github.com/dnbexperience/eufemia/commit/ebe8e6a597c87885c081fcdfd76339780e90befc/issues/diff-f1c94bc3bf35a0cb7181e56dab45c760dfa612539ab3fcd8c903e3c76b6b9f6)
13
+
14
+
15
+ ### :bug: Bug Fixes
16
+
17
+ * **Field.PhoneNumber:** list country code beneath country name ([#5097](https://github.com/dnbexperience/eufemia/issues/5097)) ([070c9ce](https://github.com/dnbexperience/eufemia/commit/070c9ce6d3f00c8534d46a2e8db9841e0fc64026))
18
+ * **Field.PhoneNumber:** select country code input value on single click ([#5086](https://github.com/dnbexperience/eufemia/issues/5086)) ([4027fc1](https://github.com/dnbexperience/eufemia/commit/4027fc1b9c4292d41765e62e10200d8b00b1df62))
19
+ * **Field.PhoneNumber:** validate field as required even if country code was given ([#5088](https://github.com/dnbexperience/eufemia/issues/5088)) ([a8bbd45](https://github.com/dnbexperience/eufemia/commit/a8bbd453115d682972858ab23e17378135ea7bf7))
20
+ * **Field.SelectCountry:** select country input value on single click ([#5094](https://github.com/dnbexperience/eufemia/issues/5094)) ([6462f8c](https://github.com/dnbexperience/eufemia/commit/6462f8cc603f1792e5a16ee942198f0458830696))
21
+ * **Field.SelectCurrency:** select currency input value on single click ([#5093](https://github.com/dnbexperience/eufemia/issues/5093)) ([fa66807](https://github.com/dnbexperience/eufemia/commit/fa66807bff9c5b996bad249f90967cd5a825a43a))
22
+ * **Field.Selection:** select input value on single click ([#5095](https://github.com/dnbexperience/eufemia/issues/5095)) ([d6181fc](https://github.com/dnbexperience/eufemia/commit/d6181fc0f56cf22bc22d842629e8f9354caa9a2d))
23
+ * **Forms:** don't show red border on errors when EditContainer or PushContainer use the `basic` variant ([#5092](https://github.com/dnbexperience/eufemia/issues/5092)) ([c3362e6](https://github.com/dnbexperience/eufemia/commit/c3362e6ccc9dd1151f8fdb7e64f4de9cac7a1f78)), closes [#4985](https://github.com/dnbexperience/eufemia/issues/4985) [/github.com/dnbexperience/eufemia/issues/4985#issuecomment-2862757367](https://github.com/dnbexperience//github.com/dnbexperience/eufemia/issues/4985/issues/issuecomment-2862757367) [#5051](https://github.com/dnbexperience/eufemia/issues/5051)
24
+ * **Forms:** help button on Field.* components should not wrap alone ([#5096](https://github.com/dnbexperience/eufemia/issues/5096)) ([e07b8e6](https://github.com/dnbexperience/eufemia/commit/e07b8e609f385a1e6d1fbbf2eb706fec955106c6))
25
+ * **Forms:** help button on Value.* components should not wrap alone ([#5091](https://github.com/dnbexperience/eufemia/issues/5091)) ([7d342c3](https://github.com/dnbexperience/eufemia/commit/7d342c3687d94f7bd0199440949cbad317b6d46d))
26
+ * **Upload:** remove file by id or file equality ([#5087](https://github.com/dnbexperience/eufemia/issues/5087)) ([eb051a1](https://github.com/dnbexperience/eufemia/commit/eb051a18f237b02dc2c8598a821e6368e2842cd9))
27
+ * **Value.SummaryList:** support `maxWidth` in nested Value.* components ([#5068](https://github.com/dnbexperience/eufemia/issues/5068)) ([dbc3be6](https://github.com/dnbexperience/eufemia/commit/dbc3be6e03939b8155cdba774641304ae69e4ed5))
28
+
6
29
  ## [10.73.0](https://github.com/dnbexperience/eufemia/compare/v10.72.3...v10.73.0) (2025-05-08)
7
30
 
8
31
 
@@ -77,6 +77,10 @@ export interface AutocompleteProps {
77
77
  * Only for screen readers (VoiceOver). The label used to announce the selected item. Defaults to `Valgt:`.
78
78
  */
79
79
  selected_sr?: string;
80
+ /**
81
+ * If set to `true`, then the whole input value gets selected on the entry focus. A second click will place the cursor on the wanted position.
82
+ */
83
+ selectall?: boolean;
80
84
  /**
81
85
  * Title on submit button. Defaults to `Vis alternativer`.
82
86
  */
@@ -150,6 +150,11 @@ const autocompleteProperties = exports.autocompleteProperties = {
150
150
  type: 'string',
151
151
  status: 'optional'
152
152
  },
153
+ selectall: {
154
+ doc: 'If set to `true`, then the whole input value gets selected on the entry focus. A second click will place the cursor on the wanted position.',
155
+ type: 'boolean',
156
+ status: 'optional'
157
+ },
153
158
  submit_button_title: {
154
159
  doc: 'Title on submit button. Defaults to `Vis alternativer`.',
155
160
  type: 'React.Node',
@@ -1 +1 @@
1
- {"version":3,"file":"AutocompleteDocs.js","names":["autocompleteProperties","exports","mode","doc","type","status","input_value","placeholder","title","disable_filter","disable_highlighting","disable_reorder","search_numbers","search_in_word_index","keep_value","keep_selection","keep_value_and_selection","prevent_selection","show_clear_button","icon","icon_size","icon_position","input_icon","triangle_position","size","drawer_class","show_submit_button","align_autocomplete","no_options","aria_live_options","show_all","indicator_label","show_options_sr","selected_sr","submit_button_title","submit_button_icon","submit_element","opened","open_on_focus","stretch","skip_portal","status_state","status_props","globalStatus","label","label_direction","label_sr_only","suffix","skeleton","input_ref","input_element","AutocompleteEvents","on_type","on_focus","on_blur","on_change","on_select","on_show","on_hide"],"sources":["../../../../src/components/autocomplete/AutocompleteDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\n\nexport const autocompleteProperties: PropertiesTableProps = {\n mode: {\n doc: 'If set to `async`, it prevents showing the \"no options\" message during typing / filtering. Defaults to `sync`.',\n type: 'string',\n status: 'optional',\n },\n input_value: {\n doc: 'Lets you define a custom input value.',\n type: 'string',\n status: 'optional',\n },\n placeholder: {\n doc: 'Use this to define the pre-filled placeholder text in the input. Defaults to `title=\"Skriv og velg\"`.',\n type: 'string',\n status: 'optional',\n },\n title: {\n doc: 'Give a title to let the user know what they have to do. Defaults to `Skriv og få alternativer`.',\n type: 'React.Node',\n status: 'optional',\n },\n disable_filter: {\n doc: 'If set to `true`, word highlighting will still be active, but no options will be filtered out. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n disable_highlighting: {\n doc: 'If set to `true`, word highlighting will be disabled, but the options will still get filtered. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n disable_reorder: {\n doc: 'If set to `true`, reordering of search results will be disabled. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n search_numbers: {\n doc: 'If set to `true` and `search_in_word_index` is not set, the user will be able to more easily search and filter e.g. bank account numbers. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n search_in_word_index: {\n doc: 'This gives you the possibility to change the threshold number, which defines from what word on we search \"inside words\". Defaults to `3`.',\n type: 'boolean',\n status: 'optional',\n },\n keep_value: {\n doc: 'Use `true` to not remove the typed value on input blur, if it is invalid. By default, the typed value will disappear / replaced by a selected value from the data list during the input field blur. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n keep_selection: {\n doc: 'Use `true` to not remove selected item on input blur, when the input value is empty. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n keep_value_and_selection: {\n doc: 'Like `keep_value` – but would not reset to the selected value during input field blur. Also, the selected value would still be kept. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n prevent_selection: {\n doc: 'If set to `true`, no permanent selection will be made. Also, the typed value will not disappear on input blur (like `keep_value`). Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n show_clear_button: {\n doc: 'If set to `true`, a clear button is shown inside the input field. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n icon: {\n doc: 'To be included in the autocomplete input.',\n type: ['string', 'React.Node'],\n status: 'optional',\n },\n icon_size: {\n doc: 'Change the size of the icon pragmatically.',\n type: 'string',\n status: 'optional',\n },\n icon_position: {\n doc: 'Position of the icon inside the autocomplete. Set to `left` or `right`. Defaults to `left`.',\n type: 'string',\n status: 'optional',\n },\n input_icon: {\n doc: 'Same as `icon`.',\n type: ['string', 'React.Node'],\n status: 'optional',\n },\n triangle_position: {\n doc: 'Position of icon arrow / triangle the drawer. Set to `left` or `right`. Defaults to `left`.',\n type: 'string',\n status: 'optional',\n },\n size: {\n doc: 'Define the height of the Autocomplete. Can be set to `small`, `default`, `medium` and `large`. Defaults to `default`.',\n type: 'string',\n status: 'optional',\n },\n drawer_class: {\n doc: 'Define a custom class for the internal drawer-list. This makes it possible more easily customize the drawer-list style with styled-components and the `css` style method. Defaults to `null`.',\n type: 'string',\n status: 'optional',\n },\n show_submit_button: {\n doc: 'Use `true` to show a Autocomplete button to toggle the [DrawerList](/uilib/components/fragments/drawer-list). Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n align_autocomplete: {\n doc: 'Use `right` to change the options alignment direction. Defaults to `left`.',\n type: 'string',\n status: 'optional',\n },\n no_options: {\n doc: 'Text show in the \"no options\" item. Defaults to `Ingen alternativer`.',\n type: 'boolean',\n status: 'optional',\n },\n aria_live_options: {\n doc: 'Text read out by screen readers. This way users with screen readers know how many options they got during typing. Defaults to `%s alternativer`.',\n type: 'React.Node',\n status: 'optional',\n },\n show_all: {\n doc: 'Text that lets a user unravel all the available options. Defaults to `Vis alt`.',\n type: 'boolean',\n status: 'optional',\n },\n indicator_label: {\n doc: 'Text show on indicator \"options\" item. Defaults to `Henter data ...`.',\n type: 'React.Node',\n status: 'optional',\n },\n show_options_sr: {\n doc: 'Only for screen readers. Title of the button to show the suggestions / options. It is always present and when activating, it opens the DrawerList and sets the focus on it. Defaults to `Bla gjennom alternativer`.',\n type: 'string',\n status: 'optional',\n },\n selected_sr: {\n doc: 'Only for screen readers (VoiceOver). The label used to announce the selected item. Defaults to `Valgt:`.',\n type: 'string',\n status: 'optional',\n },\n submit_button_title: {\n doc: 'Title on submit button. Defaults to `Vis alternativer`.',\n type: 'React.Node',\n status: 'optional',\n },\n submit_button_icon: {\n doc: 'The icon used in the submit button. Defaults to `chevron_down`.',\n type: ['string', 'React.Element'],\n status: 'optional',\n },\n submit_element: {\n doc: 'Replace the dropdown / submit button with a custom React element. Defaults to the input SubmitButton `import { SubmitButton } from '@dnb/eufemia/components/input/Input'`.',\n type: 'React.Node',\n status: 'optional',\n },\n opened: {\n doc: 'If set to `true`, the Autocomplete will be rendered initially with a visible and accessible data list / options.',\n type: 'boolean',\n status: 'optional',\n },\n open_on_focus: {\n doc: 'Use `true` to auto open the list once the user is entering the input field with the keyboard.',\n type: 'boolean',\n status: 'optional',\n },\n stretch: {\n doc: 'If set to `true`, then the autocomplete will be 100% in available `width`.',\n type: 'boolean',\n status: 'optional',\n },\n skip_portal: {\n doc: 'Set to `true` to disable the React Portal behavior. Defaults to `false`.',\n type: 'string',\n status: 'optional',\n },\n status: {\n doc: 'Text with a status message. The style defaults to an error message. You can use `true` to only get the status color, without a message.',\n type: ['error', 'info', 'boolean'],\n status: 'optional',\n },\n status_state: {\n doc: 'Defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`.',\n type: ['error', 'info'],\n status: 'optional',\n },\n status_props: {\n doc: 'Use an object to define additional FormStatus properties.',\n type: 'object',\n status: 'optional',\n },\n globalStatus: {\n doc: 'The [configuration](/uilib/components/global-status/properties/#configuration-object) used for the target [GlobalStatus](/uilib/components/global-status).',\n type: 'object',\n status: 'optional',\n },\n label: {\n doc: 'Prepends the Form Label component. If no ID is provided, a random ID is created.',\n type: 'React.Node',\n status: 'optional',\n },\n label_direction: {\n doc: 'Use `label_direction=\"vertical\"` to change the label layout direction. Defaults to `horizontal`.',\n type: 'React.Node',\n status: 'optional',\n },\n label_sr_only: {\n doc: 'Use `true` to make the label only readable by screen readers.',\n type: 'boolean',\n status: 'optional',\n },\n suffix: {\n doc: 'Text describing the content of the Autocomplete more than the label. You can also send in a React component, so it gets wrapped inside the Autocomplete component.',\n type: 'React.Node',\n status: 'optional',\n },\n skeleton: {\n doc: 'If set to `true`, an overlaying skeleton with animation will be shown.',\n type: 'boolean',\n status: 'optional',\n },\n input_ref: {\n doc: 'Use a React.Ref to get access to the `input` DOM element.',\n type: 'React.RefObject',\n status: 'optional',\n },\n input_element: {\n doc: 'Lets you provide a custom React element as the input HTML element.',\n type: ['string', 'React.Element'],\n status: 'optional',\n },\n '[DrawerList](/uilib/components/fragments/drawer-list/properties)': {\n doc: 'all DrawerList properties.',\n type: 'Various',\n status: 'optional',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n}\n\nexport const AutocompleteEvents: PropertiesTableProps = {\n on_type: {\n doc: 'Will be called for every key change the users makes. Returns an object with the input `value` inside `{ value, event, attributes }` including [these methods](/uilib/components/autocomplete/events#dynamically-change-data)',\n type: 'function',\n status: 'optional',\n },\n on_focus: {\n doc: 'Will be called on user generated focus action. Returns an object with the input `value` inside `{ value, event, attributes }` including [these methods](/uilib/components/autocomplete/events#dynamically-change-data).',\n type: 'function',\n status: 'optional',\n },\n on_blur: {\n doc: 'Will be called on user generated blur action. Returns an object with the input `value` inside `{ value, event, attributes }` including [these methods](/uilib/components/autocomplete/events#dynamically-change-data).',\n type: 'function',\n status: 'optional',\n },\n on_change: {\n doc: 'Will be called on state changes made by the user. Returns an object with the new selected `data` item `{ data, event, attributes, value }` including [these methods](/uilib/components/autocomplete/events#dynamically-change-data).',\n type: 'function',\n status: 'optional',\n },\n on_select: {\n doc: 'Will be called once the users focuses or selects an item by a click or keyboard navigation. Returns an object with the new selected `data` item `{ data, event, attributes, value, active_item }` including [these methods](/uilib/components/autocomplete/events#dynamically-change-data). The \"active_item\" property is the currently selected item by keyboard navigation',\n type: 'function',\n status: 'optional',\n },\n on_show: {\n doc: 'Will be called once the user presses the autocomplete. Returns the data item `{ data, attributes }`.',\n type: 'function',\n status: 'optional',\n },\n on_hide: {\n doc: 'Will be called once the user presses the autocomplete again, or clicks somewhere else. Returns the data item `{ data, attributes }`.',\n type: 'function',\n status: 'optional',\n },\n}\n"],"mappings":";;;;;;AAEO,MAAMA,sBAA4C,GAAAC,OAAA,CAAAD,sBAAA,GAAG;EAC1DE,IAAI,EAAE;IACJC,GAAG,EAAE,gHAAgH;IACrHC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDC,WAAW,EAAE;IACXH,GAAG,EAAE,uCAAuC;IAC5CC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDE,WAAW,EAAE;IACXJ,GAAG,EAAE,uGAAuG;IAC5GC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDG,KAAK,EAAE;IACLL,GAAG,EAAE,iGAAiG;IACtGC,IAAI,EAAE,YAAY;IAClBC,MAAM,EAAE;EACV,CAAC;EACDI,cAAc,EAAE;IACdN,GAAG,EAAE,qHAAqH;IAC1HC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDK,oBAAoB,EAAE;IACpBP,GAAG,EAAE,qHAAqH;IAC1HC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDM,eAAe,EAAE;IACfR,GAAG,EAAE,uFAAuF;IAC5FC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDO,cAAc,EAAE;IACdT,GAAG,EAAE,gKAAgK;IACrKC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDQ,oBAAoB,EAAE;IACpBV,GAAG,EAAE,2IAA2I;IAChJC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACDS,UAAU,EAAE;IACVX,GAAG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;IAChBC,MAAM,EAAE;EACV,CAAC;EACDqD,OAAO,EAAE;IACPvD,GAAG,EAAE,sIAAsI;IAC3IC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"AutocompleteDocs.js","names":["autocompleteProperties","exports","mode","doc","type","status","input_value","placeholder","title","disable_filter","disable_highlighting","disable_reorder","search_numbers","search_in_word_index","keep_value","keep_selection","keep_value_and_selection","prevent_selection","show_clear_button","icon","icon_size","icon_position","input_icon","triangle_position","size","drawer_class","show_submit_button","align_autocomplete","no_options","aria_live_options","show_all","indicator_label","show_options_sr","selected_sr","selectall","submit_button_title","submit_button_icon","submit_element","opened","open_on_focus","stretch","skip_portal","status_state","status_props","globalStatus","label","label_direction","label_sr_only","suffix","skeleton","input_ref","input_element","AutocompleteEvents","on_type","on_focus","on_blur","on_change","on_select","on_show","on_hide"],"sources":["../../../../src/components/autocomplete/AutocompleteDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\n\nexport const autocompleteProperties: PropertiesTableProps = {\n mode: {\n doc: 'If set to `async`, it prevents showing the \"no options\" message during typing / filtering. Defaults to `sync`.',\n type: 'string',\n status: 'optional',\n },\n input_value: {\n doc: 'Lets you define a custom input value.',\n type: 'string',\n status: 'optional',\n },\n placeholder: {\n doc: 'Use this to define the pre-filled placeholder text in the input. Defaults to `title=\"Skriv og velg\"`.',\n type: 'string',\n status: 'optional',\n },\n title: {\n doc: 'Give a title to let the user know what they have to do. Defaults to `Skriv og få alternativer`.',\n type: 'React.Node',\n status: 'optional',\n },\n disable_filter: {\n doc: 'If set to `true`, word highlighting will still be active, but no options will be filtered out. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n disable_highlighting: {\n doc: 'If set to `true`, word highlighting will be disabled, but the options will still get filtered. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n disable_reorder: {\n doc: 'If set to `true`, reordering of search results will be disabled. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n search_numbers: {\n doc: 'If set to `true` and `search_in_word_index` is not set, the user will be able to more easily search and filter e.g. bank account numbers. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n search_in_word_index: {\n doc: 'This gives you the possibility to change the threshold number, which defines from what word on we search \"inside words\". Defaults to `3`.',\n type: 'boolean',\n status: 'optional',\n },\n keep_value: {\n doc: 'Use `true` to not remove the typed value on input blur, if it is invalid. By default, the typed value will disappear / replaced by a selected value from the data list during the input field blur. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n keep_selection: {\n doc: 'Use `true` to not remove selected item on input blur, when the input value is empty. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n keep_value_and_selection: {\n doc: 'Like `keep_value` – but would not reset to the selected value during input field blur. Also, the selected value would still be kept. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n prevent_selection: {\n doc: 'If set to `true`, no permanent selection will be made. Also, the typed value will not disappear on input blur (like `keep_value`). Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n show_clear_button: {\n doc: 'If set to `true`, a clear button is shown inside the input field. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n icon: {\n doc: 'To be included in the autocomplete input.',\n type: ['string', 'React.Node'],\n status: 'optional',\n },\n icon_size: {\n doc: 'Change the size of the icon pragmatically.',\n type: 'string',\n status: 'optional',\n },\n icon_position: {\n doc: 'Position of the icon inside the autocomplete. Set to `left` or `right`. Defaults to `left`.',\n type: 'string',\n status: 'optional',\n },\n input_icon: {\n doc: 'Same as `icon`.',\n type: ['string', 'React.Node'],\n status: 'optional',\n },\n triangle_position: {\n doc: 'Position of icon arrow / triangle the drawer. Set to `left` or `right`. Defaults to `left`.',\n type: 'string',\n status: 'optional',\n },\n size: {\n doc: 'Define the height of the Autocomplete. Can be set to `small`, `default`, `medium` and `large`. Defaults to `default`.',\n type: 'string',\n status: 'optional',\n },\n drawer_class: {\n doc: 'Define a custom class for the internal drawer-list. This makes it possible more easily customize the drawer-list style with styled-components and the `css` style method. Defaults to `null`.',\n type: 'string',\n status: 'optional',\n },\n show_submit_button: {\n doc: 'Use `true` to show a Autocomplete button to toggle the [DrawerList](/uilib/components/fragments/drawer-list). Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n align_autocomplete: {\n doc: 'Use `right` to change the options alignment direction. Defaults to `left`.',\n type: 'string',\n status: 'optional',\n },\n no_options: {\n doc: 'Text show in the \"no options\" item. Defaults to `Ingen alternativer`.',\n type: 'boolean',\n status: 'optional',\n },\n aria_live_options: {\n doc: 'Text read out by screen readers. This way users with screen readers know how many options they got during typing. Defaults to `%s alternativer`.',\n type: 'React.Node',\n status: 'optional',\n },\n show_all: {\n doc: 'Text that lets a user unravel all the available options. Defaults to `Vis alt`.',\n type: 'boolean',\n status: 'optional',\n },\n indicator_label: {\n doc: 'Text show on indicator \"options\" item. Defaults to `Henter data ...`.',\n type: 'React.Node',\n status: 'optional',\n },\n show_options_sr: {\n doc: 'Only for screen readers. Title of the button to show the suggestions / options. It is always present and when activating, it opens the DrawerList and sets the focus on it. Defaults to `Bla gjennom alternativer`.',\n type: 'string',\n status: 'optional',\n },\n selected_sr: {\n doc: 'Only for screen readers (VoiceOver). The label used to announce the selected item. Defaults to `Valgt:`.',\n type: 'string',\n status: 'optional',\n },\n selectall: {\n doc: 'If set to `true`, then the whole input value gets selected on the entry focus. A second click will place the cursor on the wanted position.',\n type: 'boolean',\n status: 'optional',\n },\n submit_button_title: {\n doc: 'Title on submit button. Defaults to `Vis alternativer`.',\n type: 'React.Node',\n status: 'optional',\n },\n submit_button_icon: {\n doc: 'The icon used in the submit button. Defaults to `chevron_down`.',\n type: ['string', 'React.Element'],\n status: 'optional',\n },\n submit_element: {\n doc: 'Replace the dropdown / submit button with a custom React element. Defaults to the input SubmitButton `import { SubmitButton } from '@dnb/eufemia/components/input/Input'`.',\n type: 'React.Node',\n status: 'optional',\n },\n opened: {\n doc: 'If set to `true`, the Autocomplete will be rendered initially with a visible and accessible data list / options.',\n type: 'boolean',\n status: 'optional',\n },\n open_on_focus: {\n doc: 'Use `true` to auto open the list once the user is entering the input field with the keyboard.',\n type: 'boolean',\n status: 'optional',\n },\n stretch: {\n doc: 'If set to `true`, then the autocomplete will be 100% in available `width`.',\n type: 'boolean',\n status: 'optional',\n },\n skip_portal: {\n doc: 'Set to `true` to disable the React Portal behavior. Defaults to `false`.',\n type: 'string',\n status: 'optional',\n },\n status: {\n doc: 'Text with a status message. The style defaults to an error message. You can use `true` to only get the status color, without a message.',\n type: ['error', 'info', 'boolean'],\n status: 'optional',\n },\n status_state: {\n doc: 'Defines the state of the status. Currently, there are two statuses `[error, info]`. Defaults to `error`.',\n type: ['error', 'info'],\n status: 'optional',\n },\n status_props: {\n doc: 'Use an object to define additional FormStatus properties.',\n type: 'object',\n status: 'optional',\n },\n globalStatus: {\n doc: 'The [configuration](/uilib/components/global-status/properties/#configuration-object) used for the target [GlobalStatus](/uilib/components/global-status).',\n type: 'object',\n status: 'optional',\n },\n label: {\n doc: 'Prepends the Form Label component. If no ID is provided, a random ID is created.',\n type: 'React.Node',\n status: 'optional',\n },\n label_direction: {\n doc: 'Use `label_direction=\"vertical\"` to change the label layout direction. Defaults to `horizontal`.',\n type: 'React.Node',\n status: 'optional',\n },\n label_sr_only: {\n doc: 'Use `true` to make the label only readable by screen readers.',\n type: 'boolean',\n status: 'optional',\n },\n suffix: {\n doc: 'Text describing the content of the Autocomplete more than the label. You can also send in a React component, so it gets wrapped inside the Autocomplete component.',\n type: 'React.Node',\n status: 'optional',\n },\n skeleton: {\n doc: 'If set to `true`, an overlaying skeleton with animation will be shown.',\n type: 'boolean',\n status: 'optional',\n },\n input_ref: {\n doc: 'Use a React.Ref to get access to the `input` DOM element.',\n type: 'React.RefObject',\n status: 'optional',\n },\n input_element: {\n doc: 'Lets you provide a custom React element as the input HTML element.',\n type: ['string', 'React.Element'],\n status: 'optional',\n },\n '[DrawerList](/uilib/components/fragments/drawer-list/properties)': {\n doc: 'all DrawerList properties.',\n type: 'Various',\n status: 'optional',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n}\n\nexport const AutocompleteEvents: PropertiesTableProps = {\n on_type: {\n doc: 'Will be called for every key change the users makes. Returns an object with the input `value` inside `{ value, event, attributes }` including [these methods](/uilib/components/autocomplete/events#dynamically-change-data)',\n type: 'function',\n status: 'optional',\n },\n on_focus: {\n doc: 'Will be called on user generated focus action. Returns an object with the input `value` inside `{ value, event, attributes }` including [these methods](/uilib/components/autocomplete/events#dynamically-change-data).',\n type: 'function',\n status: 'optional',\n },\n on_blur: {\n doc: 'Will be called on user generated blur action. Returns an object with the input `value` inside `{ value, event, attributes }` including [these methods](/uilib/components/autocomplete/events#dynamically-change-data).',\n type: 'function',\n status: 'optional',\n },\n on_change: {\n doc: 'Will be called on state changes made by the user. Returns an object with the new selected `data` item `{ data, event, attributes, value }` including [these methods](/uilib/components/autocomplete/events#dynamically-change-data).',\n type: 'function',\n status: 'optional',\n },\n on_select: {\n doc: 'Will be called once the users focuses or selects an item by a click or keyboard navigation. Returns an object with the new selected `data` item `{ data, event, attributes, value, active_item }` including [these methods](/uilib/components/autocomplete/events#dynamically-change-data). The \"active_item\" property is the currently selected item by keyboard navigation',\n type: 'function',\n status: 'optional',\n },\n on_show: {\n doc: 'Will be called once the user presses the autocomplete. Returns the data item `{ data, attributes }`.',\n type: 'function',\n status: 'optional',\n },\n on_hide: {\n doc: 'Will be called once the user presses the autocomplete again, or clicks somewhere else. Returns the data item `{ data, attributes }`.',\n type: 'function',\n status: 'optional',\n },\n}\n"],"mappings":";;;;;;AAEO,MAAMA,sBAA4C,GAAAC,OAAA,CAAAD,sBAAA,GAAG;EAC1DE,IAAI,EAAE;IACJC,GAAG,EAAE,gHAAgH;IACrHC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDC,WAAW,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eAAe,CAAC;IACjCC,MAAM,EAAE;EACV,CAAC;EACD,kEAAkE,EAAE;IAClEF,GAAG,EAAE,4BAA4B;IACjCC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC;EACD,yCAAyC,EAAE;IACzCF,GAAG,EAAE,0DAA0D;IAC/DC,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC1BC,MAAM,EAAE;EACV;AACF,CAAC;AAEM,MAAM+C,kBAAwC,GAAAnD,OAAA,CAAAmD,kBAAA,GAAG;EACtDC,OAAO,EAAE;IACPlD,GAAG,EAAE,8NAA8N;IACnOC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDiD,QAAQ,EAAE;IACRnD,GAAG,EAAE,yNAAyN;IAC9NC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDkD,OAAO,EAAE;IACPpD,GAAG,EAAE,wNAAwN;IAC7NC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDmD,SAAS,EAAE;IACTrD,GAAG,EAAE,sOAAsO;IAC3OC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDoD,SAAS,EAAE;IACTtD,GAAG,EAAE,8WAA8W;IACnXC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDqD,OAAO,EAAE;IACPvD,GAAG,EAAE,sGAAsG;IAC3GC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDsD,OAAO,EAAE;IACPxD,GAAG,EAAE,sIAAsI;IAC3IC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AACF,CAAC","ignoreList":[]}
@@ -156,17 +156,17 @@ const ModalProperties = exports.ModalProperties = {
156
156
  spacing: {
157
157
  doc: 'if set to `false` then the modal content will be shown without any spacing. Defaults to `true`.',
158
158
  type: 'boolean',
159
- status: 'deprecated'
159
+ status: 'optional'
160
160
  },
161
161
  closeTitle: {
162
162
  doc: 'the title of the close button. Defaults to _Lukk_.',
163
163
  type: 'string',
164
- status: 'deprecated'
164
+ status: 'optional'
165
165
  },
166
166
  hideCloseButton: {
167
167
  doc: 'if true, the close button will not be shown.',
168
168
  type: 'boolean',
169
- status: 'deprecated'
169
+ status: 'optional'
170
170
  },
171
171
  class: {
172
172
  doc: 'give the inner content wrapper a class name (maps to `dnb-modal__content__inner`).',
@@ -1 +1 @@
1
- {"version":3,"file":"ModalDocs.js","names":["_componentHelper","require","transformPropertyNamesWithSnakeCase","properties","Object","fromEntries","entries","map","_ref","key","value","toLowerCase","toSnakeCase","ModalProperties","exports","id","doc","type","status","rootId","contentId","labelledBy","children","fullscreen","openState","openDelay","disabled","noAnimation","noAnimationOnMobile","animationDuration","preventClose","preventOverlayClose","openModal","closeModal","focusSelector","overlayClass","contentClass","omitTriggerButton","trigger","triggerAttributes","dialogTitle","directDomReturn","bypassInvalidationSelectors","scrollRef","contentRef","spacing","closeTitle","hideCloseButton","class","className","ModalPropertiesWithSnakeCase","ModalEvents","onOpen","onClose","onClosePrevent","ModalEventsWithSnakeCase"],"sources":["../../../../src/components/modal/ModalDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\nimport { toSnakeCase } from '../../shared/component-helper'\n\nconst transformPropertyNamesWithSnakeCase = (\n properties: PropertiesTableProps\n) => {\n return Object.fromEntries(\n Object.entries(properties).map(([key, value]) => [\n key !== key.toLowerCase() ? `${key} / ${toSnakeCase(key)}` : key,\n value,\n ])\n )\n}\n\nexport const ModalProperties: PropertiesTableProps = {\n id: {\n doc: 'The id used internal for the trigger button and Modal component.',\n type: 'string',\n status: 'optional',\n },\n rootId: {\n doc: 'The id used internal in the modal root element. Defaults to `root`, so the element id will be `dnb-modal-root`.',\n type: 'string',\n status: 'optional',\n },\n contentId: {\n doc: 'Defines an unique identifier to a modal. Use it in case you have to refer in some way to the modal content.',\n type: 'string',\n status: 'optional',\n },\n labelledBy: {\n doc: 'The ID of the trigger component, describing the modal content. Defaults to the internal `trigger`, so make sure you define the `title` in `triggerAttributes`.',\n type: 'string',\n status: 'optional',\n },\n children: {\n doc: 'the content which will appear when triggering open the modal. If a function is given, you get a close method `() => ({ close })` in the arguments.',\n type: ['React.ReactNode', 'function'],\n status: 'optional',\n },\n fullscreen: {\n doc: 'If set to `true` then the modal content will be shown as fullscreen, without showing the original content behind. Can be set to `false` to omit the auto fullscreen. Defaults to `auto`.',\n type: 'boolean',\n status: 'optional',\n },\n openState: {\n doc: 'use this property to control the open/close state by setting either: `opened` / `closed` or `true` / `false`.',\n type: ['boolean', 'opened', 'closed'],\n status: 'optional',\n },\n openDelay: {\n doc: 'forces the modal to delay the opening. The delay is given in `ms`.',\n type: ['number', 'string'],\n status: 'optional',\n },\n disabled: {\n doc: 'Will disable the trigger button.',\n type: 'boolean',\n status: 'optional',\n },\n noAnimation: {\n doc: 'if set to `true`, no open/close animation will be shown. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n noAnimationOnMobile: {\n doc: 'same as `noAnimation`, but gets triggered only if the viewport width is less than `40em`. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n animationDuration: {\n doc: 'Duration of animation open/close in ms. Defaults to 300ms.',\n type: ['number', 'string'],\n status: 'optional',\n },\n preventClose: {\n doc: \"if set to `true` (boolean or string), then the user can't close the modal.\",\n type: 'boolean',\n status: 'optional',\n },\n preventOverlayClose: {\n doc: 'Disable clicking the background overlay to close the modal. PS! Pressing `esc` key will still close the modal.',\n type: 'boolean',\n status: 'optional',\n },\n openModal: {\n doc: 'set a function to call the callback function, once the modal should open: `openModal={(open) => open()}`.',\n type: 'function',\n status: 'optional',\n },\n closeModal: {\n doc: 'set a function to call the callback function, once the modal should close: `closeModal={(close) => close()}`.',\n type: 'function',\n status: 'optional',\n },\n focusSelector: {\n doc: 'The Modal handles the first focus – automatically. However, you can define a custom focus selector the will be used instead `focusSelector=\".css-selector\"`.',\n type: 'string',\n status: 'optional',\n },\n overlayClass: {\n doc: 'give the page overlay a custom class name (maps to `dnb-modal__overlay`).',\n type: 'string',\n status: 'optional',\n },\n contentClass: {\n doc: 'give the content wrapper a custom class name (maps to `dnb-modal__content`).',\n type: 'string',\n status: 'optional',\n },\n omitTriggerButton: {\n doc: 'omits default showing trigger button.',\n type: 'boolean',\n status: 'optional',\n },\n trigger: {\n doc: 'provide a custom trigger component. Like `trigger={<Anchor href=\"/\" />}`. It will set the focus on it when the modal gets closed.',\n type: ['React.ReactNode', 'function'],\n status: 'optional',\n },\n triggerAttributes: {\n doc: 'send along with custom HTML attributes or properties to the trigger button.',\n type: 'Various',\n status: 'optional',\n },\n dialogTitle: {\n doc: 'The aria label of the dialog when no labelledBy and no title is given. Defaults to `Vindu`.',\n type: 'string',\n status: 'optional',\n },\n directDomReturn: {\n doc: 'If true, the modal will not open in a new DOM but directly in current DOM. Defaults to `false`. Be aware of the side effects of setting this property to `true`.',\n type: 'boolean',\n status: 'optional',\n },\n bypassInvalidationSelectors: {\n doc: \"Define an array with HTML class selectors (`['.element-selector']`) which should not get invalidated when the modal opens/closes. Use this in order to let some parts of your site still be accessible by screen readers.\",\n type: 'boolean',\n status: 'optional',\n },\n scrollRef: {\n doc: 'To get the scroll Element, pass in your own React ref.',\n type: 'React.RefObject',\n status: 'optional',\n },\n contentRef: {\n doc: 'To get the inner content Element, pass in your own React ref.',\n type: 'React.RefObject',\n status: 'optional',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n spacing: {\n doc: 'if set to `false` then the modal content will be shown without any spacing. Defaults to `true`.',\n type: 'boolean',\n status: 'deprecated',\n },\n closeTitle: {\n doc: 'the title of the close button. Defaults to _Lukk_.',\n type: 'string',\n status: 'deprecated',\n },\n hideCloseButton: {\n doc: 'if true, the close button will not be shown.',\n type: 'boolean',\n status: 'deprecated',\n },\n class: {\n doc: 'give the inner content wrapper a class name (maps to `dnb-modal__content__inner`).',\n type: 'string',\n status: 'optional',\n },\n className: {\n doc: 'give the inner content wrapper a class name (maps to `dnb-modal__content__inner`).',\n type: 'string',\n status: 'optional',\n },\n}\n\nexport const ModalPropertiesWithSnakeCase: PropertiesTableProps =\n transformPropertyNamesWithSnakeCase(ModalProperties)\n\nexport const ModalEvents: PropertiesTableProps = {\n onOpen: {\n doc: 'This event gets triggered once the modal shows up. Returns the modal id: `{ id }`.',\n type: 'function',\n status: 'optional',\n },\n onClose: {\n doc: 'This event gets triggered once the modal gets closed. Returns the modal id: `{ id, event, triggeredBy }`.',\n type: 'function',\n status: 'optional',\n },\n onClosePrevent: {\n doc: 'This event gets triggered once the user tries to close the modal, but `preventClose` is set to **true**. Returns a callback `close` you can call to trigger the close mechanism. More details below. Returns the modal id: `{ id, event, close: Method, triggeredBy }`.',\n type: 'function',\n status: 'optional',\n },\n}\n\nexport const ModalEventsWithSnakeCase: PropertiesTableProps =\n transformPropertyNamesWithSnakeCase(ModalEvents)\n"],"mappings":";;;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,MAAMC,mCAAmC,GACvCC,UAAgC,IAC7B;EACH,OAAOC,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAACH,UAAU,CAAC,CAACI,GAAG,CAACC,IAAA;IAAA,IAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAAF,IAAA;IAAA,OAAK,CAC/CC,GAAG,KAAKA,GAAG,CAACE,WAAW,CAAC,CAAC,GAAG,GAAGF,GAAG,MAAM,IAAAG,4BAAW,EAACH,GAAG,CAAC,EAAE,GAAGA,GAAG,EAChEC,KAAK,CACN;EAAA,EACH,CAAC;AACH,CAAC;AAEM,MAAMG,eAAqC,GAAAC,OAAA,CAAAD,eAAA,GAAG;EACnDE,EAAE,EAAE;IACFC,GAAG,EAAE,kEAAkE;IACvEC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDC,MAAM,EAAE;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,GAAG,EAAE,2GAA2G;IAChHC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDoC,cAAc,EAAE;IACdtC,GAAG,EAAE,yQAAyQ;IAC9QC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AACF,CAAC;AAEM,MAAMqC,wBAA8C,GAAAzC,OAAA,CAAAyC,wBAAA,GACzDrD,mCAAmC,CAACiD,WAAW,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"ModalDocs.js","names":["_componentHelper","require","transformPropertyNamesWithSnakeCase","properties","Object","fromEntries","entries","map","_ref","key","value","toLowerCase","toSnakeCase","ModalProperties","exports","id","doc","type","status","rootId","contentId","labelledBy","children","fullscreen","openState","openDelay","disabled","noAnimation","noAnimationOnMobile","animationDuration","preventClose","preventOverlayClose","openModal","closeModal","focusSelector","overlayClass","contentClass","omitTriggerButton","trigger","triggerAttributes","dialogTitle","directDomReturn","bypassInvalidationSelectors","scrollRef","contentRef","spacing","closeTitle","hideCloseButton","class","className","ModalPropertiesWithSnakeCase","ModalEvents","onOpen","onClose","onClosePrevent","ModalEventsWithSnakeCase"],"sources":["../../../../src/components/modal/ModalDocs.ts"],"sourcesContent":["import { PropertiesTableProps } from '../../shared/types'\nimport { toSnakeCase } from '../../shared/component-helper'\n\nconst transformPropertyNamesWithSnakeCase = (\n properties: PropertiesTableProps\n) => {\n return Object.fromEntries(\n Object.entries(properties).map(([key, value]) => [\n key !== key.toLowerCase() ? `${key} / ${toSnakeCase(key)}` : key,\n value,\n ])\n )\n}\n\nexport const ModalProperties: PropertiesTableProps = {\n id: {\n doc: 'The id used internal for the trigger button and Modal component.',\n type: 'string',\n status: 'optional',\n },\n rootId: {\n doc: 'The id used internal in the modal root element. Defaults to `root`, so the element id will be `dnb-modal-root`.',\n type: 'string',\n status: 'optional',\n },\n contentId: {\n doc: 'Defines an unique identifier to a modal. Use it in case you have to refer in some way to the modal content.',\n type: 'string',\n status: 'optional',\n },\n labelledBy: {\n doc: 'The ID of the trigger component, describing the modal content. Defaults to the internal `trigger`, so make sure you define the `title` in `triggerAttributes`.',\n type: 'string',\n status: 'optional',\n },\n children: {\n doc: 'the content which will appear when triggering open the modal. If a function is given, you get a close method `() => ({ close })` in the arguments.',\n type: ['React.ReactNode', 'function'],\n status: 'optional',\n },\n fullscreen: {\n doc: 'If set to `true` then the modal content will be shown as fullscreen, without showing the original content behind. Can be set to `false` to omit the auto fullscreen. Defaults to `auto`.',\n type: 'boolean',\n status: 'optional',\n },\n openState: {\n doc: 'use this property to control the open/close state by setting either: `opened` / `closed` or `true` / `false`.',\n type: ['boolean', 'opened', 'closed'],\n status: 'optional',\n },\n openDelay: {\n doc: 'forces the modal to delay the opening. The delay is given in `ms`.',\n type: ['number', 'string'],\n status: 'optional',\n },\n disabled: {\n doc: 'Will disable the trigger button.',\n type: 'boolean',\n status: 'optional',\n },\n noAnimation: {\n doc: 'if set to `true`, no open/close animation will be shown. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n noAnimationOnMobile: {\n doc: 'same as `noAnimation`, but gets triggered only if the viewport width is less than `40em`. Defaults to `false`.',\n type: 'boolean',\n status: 'optional',\n },\n animationDuration: {\n doc: 'Duration of animation open/close in ms. Defaults to 300ms.',\n type: ['number', 'string'],\n status: 'optional',\n },\n preventClose: {\n doc: \"if set to `true` (boolean or string), then the user can't close the modal.\",\n type: 'boolean',\n status: 'optional',\n },\n preventOverlayClose: {\n doc: 'Disable clicking the background overlay to close the modal. PS! Pressing `esc` key will still close the modal.',\n type: 'boolean',\n status: 'optional',\n },\n openModal: {\n doc: 'set a function to call the callback function, once the modal should open: `openModal={(open) => open()}`.',\n type: 'function',\n status: 'optional',\n },\n closeModal: {\n doc: 'set a function to call the callback function, once the modal should close: `closeModal={(close) => close()}`.',\n type: 'function',\n status: 'optional',\n },\n focusSelector: {\n doc: 'The Modal handles the first focus – automatically. However, you can define a custom focus selector the will be used instead `focusSelector=\".css-selector\"`.',\n type: 'string',\n status: 'optional',\n },\n overlayClass: {\n doc: 'give the page overlay a custom class name (maps to `dnb-modal__overlay`).',\n type: 'string',\n status: 'optional',\n },\n contentClass: {\n doc: 'give the content wrapper a custom class name (maps to `dnb-modal__content`).',\n type: 'string',\n status: 'optional',\n },\n omitTriggerButton: {\n doc: 'omits default showing trigger button.',\n type: 'boolean',\n status: 'optional',\n },\n trigger: {\n doc: 'provide a custom trigger component. Like `trigger={<Anchor href=\"/\" />}`. It will set the focus on it when the modal gets closed.',\n type: ['React.ReactNode', 'function'],\n status: 'optional',\n },\n triggerAttributes: {\n doc: 'send along with custom HTML attributes or properties to the trigger button.',\n type: 'Various',\n status: 'optional',\n },\n dialogTitle: {\n doc: 'The aria label of the dialog when no labelledBy and no title is given. Defaults to `Vindu`.',\n type: 'string',\n status: 'optional',\n },\n directDomReturn: {\n doc: 'If true, the modal will not open in a new DOM but directly in current DOM. Defaults to `false`. Be aware of the side effects of setting this property to `true`.',\n type: 'boolean',\n status: 'optional',\n },\n bypassInvalidationSelectors: {\n doc: \"Define an array with HTML class selectors (`['.element-selector']`) which should not get invalidated when the modal opens/closes. Use this in order to let some parts of your site still be accessible by screen readers.\",\n type: 'boolean',\n status: 'optional',\n },\n scrollRef: {\n doc: 'To get the scroll Element, pass in your own React ref.',\n type: 'React.RefObject',\n status: 'optional',\n },\n contentRef: {\n doc: 'To get the inner content Element, pass in your own React ref.',\n type: 'React.RefObject',\n status: 'optional',\n },\n '[Space](/uilib/layout/space/properties)': {\n doc: 'Spacing properties like `top` or `bottom` are supported.',\n type: ['string', 'object'],\n status: 'optional',\n },\n spacing: {\n doc: 'if set to `false` then the modal content will be shown without any spacing. Defaults to `true`.',\n type: 'boolean',\n status: 'optional',\n },\n closeTitle: {\n doc: 'the title of the close button. Defaults to _Lukk_.',\n type: 'string',\n status: 'optional',\n },\n hideCloseButton: {\n doc: 'if true, the close button will not be shown.',\n type: 'boolean',\n status: 'optional',\n },\n class: {\n doc: 'give the inner content wrapper a class name (maps to `dnb-modal__content__inner`).',\n type: 'string',\n status: 'optional',\n },\n className: {\n doc: 'give the inner content wrapper a class name (maps to `dnb-modal__content__inner`).',\n type: 'string',\n status: 'optional',\n },\n}\n\nexport const ModalPropertiesWithSnakeCase: PropertiesTableProps =\n transformPropertyNamesWithSnakeCase(ModalProperties)\n\nexport const ModalEvents: PropertiesTableProps = {\n onOpen: {\n doc: 'This event gets triggered once the modal shows up. Returns the modal id: `{ id }`.',\n type: 'function',\n status: 'optional',\n },\n onClose: {\n doc: 'This event gets triggered once the modal gets closed. Returns the modal id: `{ id, event, triggeredBy }`.',\n type: 'function',\n status: 'optional',\n },\n onClosePrevent: {\n doc: 'This event gets triggered once the user tries to close the modal, but `preventClose` is set to **true**. Returns a callback `close` you can call to trigger the close mechanism. More details below. Returns the modal id: `{ id, event, close: Method, triggeredBy }`.',\n type: 'function',\n status: 'optional',\n },\n}\n\nexport const ModalEventsWithSnakeCase: PropertiesTableProps =\n transformPropertyNamesWithSnakeCase(ModalEvents)\n"],"mappings":";;;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,MAAMC,mCAAmC,GACvCC,UAAgC,IAC7B;EACH,OAAOC,MAAM,CAACC,WAAW,CACvBD,MAAM,CAACE,OAAO,CAACH,UAAU,CAAC,CAACI,GAAG,CAACC,IAAA;IAAA,IAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,GAAAF,IAAA;IAAA,OAAK,CAC/CC,GAAG,KAAKA,GAAG,CAACE,WAAW,CAAC,CAAC,GAAG,GAAGF,GAAG,MAAM,IAAAG,4BAAW,EAACH,GAAG,CAAC,EAAE,GAAGA,GAAG,EAChEC,KAAK,CACN;EAAA,EACH,CAAC;AACH,CAAC;AAEM,MAAMG,eAAqC,GAAAC,OAAA,CAAAD,eAAA,GAAG;EACnDE,EAAE,EAAE;IACFC,GAAG,EAAE,kEAAkE;IACvEC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE;EACV,CAAC;EACDC,MAAM,EAAE;IACNH,GAAG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E,2GAA2G;IAChHC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV,CAAC;EACDoC,cAAc,EAAE;IACdtC,GAAG,EAAE,yQAAyQ;IAC9QC,IAAI,EAAE,UAAU;IAChBC,MAAM,EAAE;EACV;AACF,CAAC;AAEM,MAAMqC,wBAA8C,GAAAzC,OAAA,CAAAyC,wBAAA,GACzDrD,mCAAmC,CAACiD,WAAW,CAAC","ignoreList":[]}
@@ -45,13 +45,16 @@ function UploadFileList() {
45
45
  return null;
46
46
  }
47
47
  const removeFile = fileToBeRemoved => {
48
- return filesRef.current.filter(fileListElement => fileListElement.file != fileToBeRemoved.file);
48
+ return filesRef.current.filter(fileListElement => !fileIsSame(fileListElement, fileToBeRemoved));
49
+ };
50
+ const fileIsSame = (fileA, fileB) => {
51
+ const idIsSame = fileA.id && fileA.id === fileB.id;
52
+ const fileIsSame = fileA.file && fileA.file === fileB.file;
53
+ return idIsSame || fileIsSame;
49
54
  };
50
55
  const updateFile = (fileToBeUpdated, props) => {
51
56
  return filesRef.current.map(fileListElement => {
52
- const idIsSame = fileListElement.id && fileListElement.id === fileToBeUpdated.id;
53
- const fileIsSame = fileListElement.file && fileListElement.file === fileToBeUpdated.file;
54
- return idIsSame || fileIsSame ? _objectSpread(_objectSpread({}, fileListElement), props) : fileListElement;
57
+ return fileIsSame(fileListElement, fileToBeUpdated) ? _objectSpread(_objectSpread({}, fileListElement), props) : fileListElement;
55
58
  });
56
59
  };
57
60
  const updateFiles = updatedFiles => {
@@ -1 +1 @@
1
- {"version":3,"file":"UploadFileList.js","names":["_react","_interopRequireWildcard","require","_UploadContext","_UploadFileListCell","_interopRequireDefault","_useUpload","_isAsync","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","UploadFileList","context","React","useContext","UploadContext","id","fileListAriaLabel","deleteButton","download","allowDuplicates","loadingText","onFileDelete","onFileClick","onChange","files","setFiles","setInternalFiles","useUpload","filesRef","useRef","useEffect","current","removeFile","fileToBeRemoved","fileListElement","file","updateFile","fileToBeUpdated","props","map","idIsSame","fileIsSame","updateFiles","updatedFiles","handleDeleteAsync","uploadFile","isLoading","errorMessage","fileItem","error","message","handleFileClickAsync","createElement","className","index","onDeleteHandler","isAsync","onFileClickHandler","key","onDelete","onClick","deleteButtonText","_default","exports"],"sources":["../../../../src/components/upload/UploadFileList.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react'\nimport { UploadFile } from './types'\nimport { UploadContext } from './UploadContext'\nimport UploadFileListCell from './UploadFileListCell'\nimport useUpload from './useUpload'\nimport { isAsync } from '../../shared/helpers/isAsync'\n\nfunction UploadFileList() {\n const context = React.useContext(UploadContext)\n\n const {\n id,\n fileListAriaLabel,\n deleteButton,\n download,\n allowDuplicates,\n loadingText,\n onFileDelete,\n onFileClick,\n onChange,\n } = context\n\n const { files, setFiles, setInternalFiles } = useUpload(id)\n\n const filesRef = useRef(null)\n\n useEffect(() => {\n filesRef.current = files\n }, [files])\n\n if (files === null || files.length < 1) {\n return null\n }\n\n const removeFile = (fileToBeRemoved: UploadFile) => {\n return filesRef.current.filter(\n (fileListElement) => fileListElement.file != fileToBeRemoved.file\n )\n }\n\n const updateFile = (\n fileToBeUpdated: UploadFile,\n props: Partial<UploadFile>\n ) => {\n return filesRef.current.map((fileListElement: UploadFile) => {\n const idIsSame =\n fileListElement.id && fileListElement.id === fileToBeUpdated.id\n\n const fileIsSame =\n fileListElement.file &&\n fileListElement.file === fileToBeUpdated.file\n\n return idIsSame || fileIsSame\n ? {\n ...fileListElement,\n ...props,\n }\n : fileListElement\n })\n }\n\n const updateFiles = (updatedFiles: UploadFile[]) => {\n setFiles(updatedFiles)\n setInternalFiles(updatedFiles)\n\n if (typeof onChange === 'function') {\n onChange({ files: updatedFiles })\n }\n }\n\n const handleDeleteAsync = async (uploadFile: UploadFile) => {\n updateFiles(\n updateFile(uploadFile, {\n isLoading: true,\n errorMessage: null,\n })\n )\n\n try {\n await onFileDelete({ fileItem: uploadFile })\n updateFiles(removeFile(uploadFile))\n } catch (error) {\n updateFiles(\n updateFile(uploadFile, {\n isLoading: false,\n errorMessage: error.message,\n })\n )\n }\n }\n\n const handleFileClickAsync = async (uploadFile: UploadFile) => {\n updateFiles(\n updateFile(uploadFile, {\n isLoading: true,\n })\n )\n\n await onFileClick({ fileItem: uploadFile })\n updateFiles(\n updateFile(uploadFile, {\n isLoading: false,\n })\n )\n }\n\n return (\n <ul className=\"dnb-upload__file-list\" aria-label={fileListAriaLabel}>\n {files.map((uploadFile: UploadFile, index: number) => {\n const onDeleteHandler = async () => {\n if (typeof onFileDelete === 'function') {\n if (isAsync(onFileDelete)) {\n handleDeleteAsync(uploadFile)\n } else {\n onFileDelete({ fileItem: uploadFile })\n updateFiles(removeFile(uploadFile))\n }\n } else {\n updateFiles(removeFile(uploadFile))\n }\n }\n\n const onFileClickHandler = async () => {\n if (typeof onFileClick === 'function') {\n if (isAsync(onFileClick)) {\n handleFileClickAsync(uploadFile)\n } else {\n onFileClick({ fileItem: uploadFile })\n }\n }\n }\n\n return (\n <UploadFileListCell\n key={index}\n id={id}\n uploadFile={uploadFile}\n onDelete={onDeleteHandler}\n onClick={onFileClick && onFileClickHandler}\n deleteButtonText={deleteButton}\n loadingText={loadingText}\n download={download}\n allowDuplicates={allowDuplicates}\n />\n )\n })}\n </ul>\n )\n}\n\nexport default UploadFileList\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAD,sBAAA,CAAAH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B,UAAU,EAAEA,UAAW;MACvBc,QAAQ,EAAEJ,eAAgB;MAC1BK,OAAO,EAAEtC,WAAW,IAAImC,kBAAmB;MAC3CI,gBAAgB,EAAE5C,YAAa;MAC/BG,WAAW,EAAEA,WAAY;MACzBF,QAAQ,EAAEA,QAAS;MACnBC,eAAe,EAAEA;IAAgB,CAClC,CAAC;EAEN,CAAC,CACC,CAAC;AAET;AAAC,IAAA2C,QAAA,GAAAC,OAAA,CAAAhG,OAAA,GAEc2C,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"UploadFileList.js","names":["_react","_interopRequireWildcard","require","_UploadContext","_UploadFileListCell","_interopRequireDefault","_useUpload","_isAsync","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","UploadFileList","context","React","useContext","UploadContext","id","fileListAriaLabel","deleteButton","download","allowDuplicates","loadingText","onFileDelete","onFileClick","onChange","files","setFiles","setInternalFiles","useUpload","filesRef","useRef","useEffect","current","removeFile","fileToBeRemoved","fileListElement","fileIsSame","fileA","fileB","idIsSame","file","updateFile","fileToBeUpdated","props","map","updateFiles","updatedFiles","handleDeleteAsync","uploadFile","isLoading","errorMessage","fileItem","error","message","handleFileClickAsync","createElement","className","index","onDeleteHandler","isAsync","onFileClickHandler","key","onDelete","onClick","deleteButtonText","_default","exports"],"sources":["../../../../src/components/upload/UploadFileList.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react'\nimport { UploadFile } from './types'\nimport { UploadContext } from './UploadContext'\nimport UploadFileListCell from './UploadFileListCell'\nimport useUpload from './useUpload'\nimport { isAsync } from '../../shared/helpers/isAsync'\n\nfunction UploadFileList() {\n const context = React.useContext(UploadContext)\n\n const {\n id,\n fileListAriaLabel,\n deleteButton,\n download,\n allowDuplicates,\n loadingText,\n onFileDelete,\n onFileClick,\n onChange,\n } = context\n\n const { files, setFiles, setInternalFiles } = useUpload(id)\n\n const filesRef = useRef(null)\n\n useEffect(() => {\n filesRef.current = files\n }, [files])\n\n if (files === null || files.length < 1) {\n return null\n }\n\n const removeFile = (fileToBeRemoved: UploadFile) => {\n return filesRef.current.filter(\n (fileListElement) => !fileIsSame(fileListElement, fileToBeRemoved)\n )\n }\n\n const fileIsSame = (fileA: UploadFile, fileB: UploadFile) => {\n const idIsSame = fileA.id && fileA.id === fileB.id\n const fileIsSame = fileA.file && fileA.file === fileB.file\n\n return idIsSame || fileIsSame\n }\n\n const updateFile = (\n fileToBeUpdated: UploadFile,\n props: Partial<UploadFile>\n ) => {\n return filesRef.current.map((fileListElement: UploadFile) => {\n return fileIsSame(fileListElement, fileToBeUpdated)\n ? {\n ...fileListElement,\n ...props,\n }\n : fileListElement\n })\n }\n\n const updateFiles = (updatedFiles: UploadFile[]) => {\n setFiles(updatedFiles)\n setInternalFiles(updatedFiles)\n\n if (typeof onChange === 'function') {\n onChange({ files: updatedFiles })\n }\n }\n\n const handleDeleteAsync = async (uploadFile: UploadFile) => {\n updateFiles(\n updateFile(uploadFile, {\n isLoading: true,\n errorMessage: null,\n })\n )\n\n try {\n await onFileDelete({ fileItem: uploadFile })\n updateFiles(removeFile(uploadFile))\n } catch (error) {\n updateFiles(\n updateFile(uploadFile, {\n isLoading: false,\n errorMessage: error.message,\n })\n )\n }\n }\n\n const handleFileClickAsync = async (uploadFile: UploadFile) => {\n updateFiles(\n updateFile(uploadFile, {\n isLoading: true,\n })\n )\n\n await onFileClick({ fileItem: uploadFile })\n updateFiles(\n updateFile(uploadFile, {\n isLoading: false,\n })\n )\n }\n\n return (\n <ul className=\"dnb-upload__file-list\" aria-label={fileListAriaLabel}>\n {files.map((uploadFile: UploadFile, index: number) => {\n const onDeleteHandler = async () => {\n if (typeof onFileDelete === 'function') {\n if (isAsync(onFileDelete)) {\n handleDeleteAsync(uploadFile)\n } else {\n onFileDelete({ fileItem: uploadFile })\n updateFiles(removeFile(uploadFile))\n }\n } else {\n updateFiles(removeFile(uploadFile))\n }\n }\n\n const onFileClickHandler = async () => {\n if (typeof onFileClick === 'function') {\n if (isAsync(onFileClick)) {\n handleFileClickAsync(uploadFile)\n } else {\n onFileClick({ fileItem: uploadFile })\n }\n }\n }\n\n return (\n <UploadFileListCell\n key={index}\n id={id}\n uploadFile={uploadFile}\n onDelete={onDeleteHandler}\n onClick={onFileClick && onFileClickHandler}\n deleteButtonText={deleteButton}\n loadingText={loadingText}\n download={download}\n allowDuplicates={allowDuplicates}\n />\n )\n })}\n </ul>\n )\n}\n\nexport default UploadFileList\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAAsD,SAAAG,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IA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C,eAAe,GAAG,MAAAA,CAAA,KAAY;MAClC,IAAI,OAAOpC,YAAY,KAAK,UAAU,EAAE;QACtC,IAAI,IAAAqC,gBAAO,EAACrC,YAAY,CAAC,EAAE;UACzByB,iBAAiB,CAACC,UAAU,CAAC;QAC/B,CAAC,MAAM;UACL1B,YAAY,CAAC;YAAE6B,QAAQ,EAAEH;UAAW,CAAC,CAAC;UACtCH,WAAW,CAACZ,UAAU,CAACe,UAAU,CAAC,CAAC;QACrC;MACF,CAAC,MAAM;QACLH,WAAW,CAACZ,UAAU,CAACe,UAAU,CAAC,CAAC;MACrC;IACF,CAAC;IAED,MAAMY,kBAAkB,GAAG,MAAAA,CAAA,KAAY;MACrC,IAAI,OAAOrC,WAAW,KAAK,UAAU,EAAE;QACrC,IAAI,IAAAoC,gBAAO,EAACpC,WAAW,CAAC,EAAE;UACxB+B,oBAAoB,CAACN,UAAU,CAAC;QAClC,CAAC,MAAM;UACLzB,WAAW,CAAC;YAAE4B,QAAQ,EAAEH;UAAW,CAAC,CAAC;QACvC;MACF;IACF,CAAC;IAED,OACE1F,MAAA,CAAAU,OAAA,CAAAuF,aAAA,CAAC7F,mBAAA,CAAAM,OAAkB;MACjB6F,GAAG,EAAEJ,KAAM;MACXzC,EAAE,EAAEA,EAAG;MACPgC,UAAU,EAAEA,UAAW;MACvBc,QAAQ,EAAEJ,eAAgB;MAC1BK,OAAO,EAAExC,WAAW,IAAIqC,kBAAmB;MAC3CI,gBAAgB,EAAE9C,YAAa;MAC/BG,WAAW,EAAEA,WAAY;MACzBF,QAAQ,EAAEA,QAAS;MACnBC,eAAe,EAAEA;IAAgB,CAClC,CAAC;EAEN,CAAC,CACC,CAAC;AAET;AAAC,IAAA6C,QAAA,GAAAC,OAAA,CAAAlG,OAAA,GAEc2C,cAAc","ignoreList":[]}
@@ -70,8 +70,8 @@ function PhoneNumber(props) {
70
70
  return undefined;
71
71
  }, []);
72
72
  const fromExternal = (0, _react.useCallback)(external => {
73
- const [, phoneNumber] = splitValue(external);
74
- if (!phoneNumber && !props.omitCountryCodeField) {
73
+ const [countryCode, phoneNumber] = splitValue(external);
74
+ if (!countryCode && !phoneNumber && !props.omitCountryCodeField) {
75
75
  return countryCodeRef.current;
76
76
  }
77
77
  return external;
@@ -286,6 +286,7 @@ function PhoneNumber(props) {
286
286
  independent_width: true,
287
287
  search_numbers: true,
288
288
  keep_selection: true,
289
+ selectall: true,
289
290
  autoComplete: "tel-country-code",
290
291
  no_animation: props.noAnimation,
291
292
  size: size
@@ -323,10 +324,13 @@ function PhoneNumber(props) {
323
324
  }
324
325
  function makeObject(country, lang) {
325
326
  var _country$i18n$lang;
327
+ const name = (_country$i18n$lang = country.i18n[lang]) !== null && _country$i18n$lang !== void 0 ? _country$i18n$lang : country.i18n.en;
328
+ const code = formatCountryCode(country.cdc);
326
329
  return {
327
- selectedKey: formatCountryCode(country.cdc),
328
- selected_value: `${country.iso} (${formatCountryCode(country.cdc)})`,
329
- content: `${formatCountryCode(country.cdc)} ${(_country$i18n$lang = country.i18n[lang]) !== null && _country$i18n$lang !== void 0 ? _country$i18n$lang : country.i18n.en}`,
330
+ selectedKey: code,
331
+ selected_value: `${country.iso} (${code})`,
332
+ search_content: [code, name],
333
+ content: [name, code],
330
334
  country
331
335
  };
332
336
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PhoneNumber.js","names":["_react","_interopRequireWildcard","require","_components","_classnames","_interopRequireDefault","_countries","_String","_Composition","_hooks","_utils","_Context","_SelectCountry","_useTranslation","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","defaultCountryCode","defaultPlaceholder","defaultMask","PhoneNumber","props","_sharedContext$locale","_props$inputRef","_countryCodeRef$curre","sharedContext","useContext","SharedContext","label","defaultLabel","countryCodeLabel","defaultCountryCodeLabel","errorRequired","useTranslation","lang","locale","split","countryCodeRef","useRef","emptyValue","prevCountryCodeRef","current","numberRef","dataRef","langRef","wasFilled","currentCountryRef","errorMessages","useMemo","validateRequired","useCallback","_ref","required","isChanged","error","countryCode","phoneNumber","splitValue","undefined","fromExternal","external","omitCountryCodeField","toEvent","schema","_props$schema","type","pattern","defaultProps","ref","preparedProps","inputRef","id","path","itemPath","className","countryCodeFieldClassName","numberFieldClassName","countryCodePlaceholder","placeholder","numberMask","countries","ccFilter","info","warning","size","hasError","disabled","width","help","validateInitially","continuousValidation","validateContinuously","validateUnchanged","setHasFocus","handleChange","setDisplayValue","onCountryCodeChange","onNumberChange","filterCountries","useFieldProps","useEffect","_inputRef$current","number","joinValue","country","countryFilter","updateCurrentDataSet","getCountryData","formatCountryCode","cdc","sort","makeObject","prepareEventValues","_currentCountryRef$cu","cdcVal","replace","item","find","_item$country","iso","callOnChange","data","eventValues","callOnBlurOrFocus","hasFocus","handleCountryCodeChange","_ref2","_data$selectedKey","selectedKey","trim","handleNumberChange","handleOnBlur","handleOnFocus","handleCountryCodeFocus","_ref3","updateData","onTypeHandler","_ref4","_event$nativeEvent","revalidateInputValue","event","nativeEvent","test","_ref5","window","requestAnimationFrame","isDefault","includes","fieldBlockProps","classnames","pickSpacingProps","createElement","Autocomplete","mode","label_direction","status","on_focus","on_blur","on_change","on_type","independent_width","search_numbers","keep_selection","autoComplete","no_animation","noAnimation","layout","mask","Array","fill","onFocus","onBlur","onChange","innerRef","breakout","outset","inputMode","_country$i18n$lang","selected_value","content","i18n","en","match","slice","array","Boolean","join","_supportsSpacingProps","_default","exports"],"sources":["../../../../../../src/extensions/forms/Field/PhoneNumber/PhoneNumber.tsx"],"sourcesContent":["import React, {\n useMemo,\n useContext,\n useCallback,\n useEffect,\n useRef,\n} from 'react'\nimport { Autocomplete } from '../../../../components'\nimport { InputMaskedProps } from '../../../../components/InputMasked'\nimport classnames from 'classnames'\nimport countries, {\n CountryISO,\n type CountryLang,\n type CountryType,\n} from '../../constants/countries'\nimport StringField, { Props as StringFieldProps } from '../String'\nimport { Props as FieldBlockProps } from '../../FieldBlock'\nimport CompositionField from '../Composition'\nimport { useFieldProps } from '../../hooks'\nimport {\n FieldPropsWithExtraValue,\n AllJSONSchemaVersions,\n} from '../../types'\nimport { pickSpacingProps } from '../../../../components/flex/utils'\nimport SharedContext from '../../../../shared/Context'\nimport {\n countryFilter,\n CountryFilterSet,\n getCountryData,\n} from '../SelectCountry'\nimport useTranslation from '../../hooks/useTranslation'\nimport { DrawerListDataArrayItem } from '../../../../fragments/DrawerList'\n\nexport type AdditionalArgs = {\n phoneNumber: string\n countryCode: string\n iso: string\n}\n\nexport type Props = Omit<\n FieldPropsWithExtraValue<string, AdditionalArgs, undefined | string>,\n 'layout' | 'layoutOptions'\n> & {\n countryCodeFieldClassName?: string\n numberFieldClassName?: string\n countryCodePlaceholder?: string\n countryCodeLabel?: string\n numberMask?: InputMaskedProps['mask']\n pattern?: StringFieldProps['pattern']\n width?: 'large' | 'stretch'\n inputRef?: React.RefObject<HTMLInputElement>\n omitCountryCodeField?: boolean\n onCountryCodeChange?: (value: string | undefined) => void\n onNumberChange?: (value: string | undefined) => void\n\n /**\n * Defines the countries to filter. Can be `Scandinavia`, `Nordic`, `Europe` or `Prioritized`.\n * Defaults to `Prioritized`.\n */\n countries?: CountryFilterSet\n\n /**\n * Use this prop to filter out certain countries. The function receives the country object and should return a boolean. Returning `false` will omit the country.\n */\n filterCountries?: (country: CountryType) => boolean\n\n /**\n * For internal testing purposes\n */\n noAnimation?: boolean\n} & Pick<StringFieldProps, 'size'>\n\n// Important for the default value to be defined here, and not after the useFieldProps call, to avoid the UI jumping\n// back to +47 once the user empty the field so handleChange send out undefined.\nconst defaultCountryCode = '+47'\nconst defaultPlaceholder = '00 00 00 00'\nconst defaultMask = [\n /\\d/,\n /\\d/,\n ' ',\n /\\d/,\n /\\d/,\n ' ',\n /\\d/,\n /\\d/,\n ' ',\n /\\d/,\n /\\d/,\n]\n\ntype EventValues = {\n countryCode?: string\n phoneNumber?: string\n}\n\nfunction PhoneNumber(props: Props) {\n const sharedContext = useContext(SharedContext)\n const {\n label: defaultLabel,\n countryCodeLabel: defaultCountryCodeLabel,\n errorRequired,\n } = useTranslation().PhoneNumber\n const lang = sharedContext.locale?.split('-')[0] as CountryLang\n\n const countryCodeRef = useRef<Props['value']>(props?.emptyValue)\n const prevCountryCodeRef = useRef(countryCodeRef.current)\n const numberRef = useRef<Props['value']>(props?.emptyValue)\n const dataRef = useRef<Array<DrawerListDataArrayItem>>(null)\n const langRef = useRef<string>(lang)\n const wasFilled = useRef<boolean>(false)\n const currentCountryRef = useRef<CountryType>()\n\n const errorMessages = useMemo(\n () => ({\n 'Field.errorRequired': errorRequired,\n 'Field.errorPattern': errorRequired,\n ...props.errorMessages,\n }),\n [errorRequired, props.errorMessages]\n )\n\n const validateRequired = useCallback(\n (value: string, { required, isChanged, error }) => {\n if (required) {\n const [countryCode, phoneNumber] = splitValue(value)\n\n if (countryCode !== prevCountryCodeRef.current) {\n if (countryCode) {\n prevCountryCodeRef.current = countryCode\n }\n return undefined\n }\n\n if (isChanged && !phoneNumber) {\n return error\n }\n }\n\n return undefined\n },\n []\n )\n\n const fromExternal = useCallback(\n (external: string) => {\n const [, phoneNumber] = splitValue(external)\n if (!phoneNumber && !props.omitCountryCodeField) {\n return countryCodeRef.current\n }\n return external\n },\n [props.omitCountryCodeField]\n )\n\n const toEvent = useCallback(\n (value: string) => {\n const [, phoneNumber] = splitValue(value)\n if (!phoneNumber) {\n return props.emptyValue\n }\n return value\n },\n [props.emptyValue]\n )\n\n const schema = useMemo<AllJSONSchemaVersions>(\n () =>\n props.schema ?? {\n type: 'string',\n pattern: props.pattern,\n },\n [props.schema, props.pattern]\n )\n const defaultProps: Partial<Props> = {\n schema,\n errorMessages,\n }\n const ref = useRef<HTMLInputElement>()\n const preparedProps: Props = {\n ...props,\n ...defaultProps,\n validateRequired,\n fromExternal,\n toEvent,\n inputRef: props.inputRef ?? ref,\n }\n\n const {\n id,\n path,\n itemPath,\n value,\n className,\n inputRef,\n countryCodeFieldClassName,\n numberFieldClassName,\n countryCodePlaceholder,\n placeholder,\n countryCodeLabel,\n label = defaultLabel,\n numberMask,\n countries: ccFilter = 'Prioritized',\n emptyValue,\n info,\n warning,\n size,\n error,\n hasError,\n disabled,\n width = props.omitCountryCodeField ? 'medium' : 'large',\n help,\n required,\n validateInitially,\n continuousValidation,\n validateContinuously,\n validateUnchanged,\n omitCountryCodeField,\n setHasFocus,\n handleChange,\n setDisplayValue,\n onCountryCodeChange,\n onNumberChange,\n filterCountries,\n } = useFieldProps(preparedProps)\n\n useEffect(() => {\n if (path || itemPath) {\n const number = inputRef.current?.value\n setDisplayValue(\n number?.length > 0\n ? joinValue([countryCodeRef.current, number])\n : undefined\n )\n }\n }, [inputRef, itemPath, path, setDisplayValue, value])\n\n const filter = useCallback(\n (country: CountryType) => {\n return countryFilter(country, filterCountries, ccFilter)\n },\n [ccFilter, filterCountries]\n )\n\n const updateCurrentDataSet = useCallback(() => {\n dataRef.current = getCountryData({\n lang,\n filter:\n // Make sure the whole cc list is displayed when cc filter is set to specific region\n ccFilter === 'Prioritized' && !wasFilled.current\n ? (country) =>\n `${formatCountryCode(country.cdc)}` ===\n countryCodeRef.current\n : filter,\n sort: ccFilter as Extract<CountryFilterSet, 'Prioritized'>,\n makeObject,\n })\n }, [lang, filter, ccFilter])\n\n const prepareEventValues = useCallback(\n ({\n countryCode = countryCodeRef.current || emptyValue,\n phoneNumber = numberRef.current || emptyValue,\n }: EventValues = {}) => {\n if (!currentCountryRef.current) {\n type Item = DrawerListDataArrayItem & { country: CountryType }\n\n const cdcVal = countryCode?.replace(/^\\+/, '')\n const item = dataRef.current.find((item: Item) => {\n const cdc = item?.country?.cdc\n return cdc === cdcVal\n }) as Item\n\n currentCountryRef.current = item?.country\n }\n\n return {\n ...(!omitCountryCodeField ? { countryCode } : {}),\n phoneNumber,\n iso: currentCountryRef.current?.iso as CountryISO,\n }\n },\n [emptyValue, omitCountryCodeField]\n )\n\n const callOnChange = useCallback(\n (data: EventValues) => {\n const eventValues = prepareEventValues(data)\n handleChange(\n joinValue([eventValues.countryCode, eventValues.phoneNumber]),\n eventValues\n )\n },\n [prepareEventValues, handleChange]\n )\n\n const callOnBlurOrFocus = useCallback(\n (hasFocus: boolean) => {\n setHasFocus(hasFocus, undefined, prepareEventValues())\n },\n [prepareEventValues, setHasFocus]\n )\n\n /**\n * We do not process the whole country list at the first render.\n * Only when the Autocomplete opens (focus).\n * To achieve this, we use memo instead of effect to update refs in sync.\n *\n * We set or update the data list depending on if the countrycode changes or lang changes.\n * We then update countryCode and phoneNumber when value changes.\n */\n useMemo(() => {\n const [countryCode, phoneNumber] = splitValue(props.value || value)\n numberRef.current = phoneNumber\n\n if (lang !== langRef.current || !wasFilled.current) {\n if (!countryCodeRef.current || countryCode) {\n countryCodeRef.current = countryCode || defaultCountryCode\n }\n langRef.current = lang\n\n updateCurrentDataSet()\n }\n }, [value, props.value, lang, updateCurrentDataSet])\n\n const handleCountryCodeChange = useCallback(\n ({\n data,\n }: {\n data: { selectedKey: string; country: CountryType }\n }) => {\n const countryCode = (countryCodeRef.current =\n data?.selectedKey?.trim() || emptyValue)\n currentCountryRef.current = data?.country\n\n callOnChange({ countryCode })\n onCountryCodeChange?.(countryCode)\n },\n [emptyValue, callOnChange, onCountryCodeChange]\n )\n\n const handleNumberChange = useCallback(\n (value: string) => {\n const phoneNumber = (numberRef.current = value || emptyValue)\n\n callOnChange({ phoneNumber })\n onNumberChange?.(phoneNumber)\n },\n [emptyValue, callOnChange, onNumberChange]\n )\n\n const handleOnBlur = useCallback(() => {\n callOnBlurOrFocus(false)\n }, [callOnBlurOrFocus])\n\n const handleOnFocus = useCallback(() => {\n callOnBlurOrFocus(true)\n }, [callOnBlurOrFocus])\n\n const handleCountryCodeFocus = useCallback(\n ({ updateData }) => {\n if (!wasFilled.current) {\n wasFilled.current = true\n updateCurrentDataSet()\n updateData(dataRef.current)\n }\n handleOnFocus()\n },\n [handleOnFocus, updateCurrentDataSet]\n )\n\n const onTypeHandler = useCallback(\n ({ value, updateData, revalidateInputValue, event }) => {\n // Handle browser autofill/autocomplete\n if (typeof event?.nativeEvent?.data === 'undefined') {\n const cdcVal = /\\+\\d{1,3}\\s{1}\\d+/.test(value)\n ? splitValue(value)[0]\n : value\n const country = countries.find(({ cdc }) => cdc === cdcVal)\n if (country?.cdc) {\n const countryCode = (countryCodeRef.current = formatCountryCode(\n country.cdc\n ))\n\n updateCurrentDataSet()\n updateData(dataRef.current)\n callOnChange({ countryCode })\n\n // To ensure correct input value,\n // regardless if there is changed data before or not.\n window.requestAnimationFrame(() => {\n revalidateInputValue()\n })\n }\n }\n },\n [callOnChange, updateCurrentDataSet]\n )\n\n const isDefault = countryCodeRef.current?.includes(defaultCountryCode)\n\n const fieldBlockProps: FieldBlockProps = {\n id,\n className: classnames('dnb-forms-field-phone-number', className),\n width,\n label: undefined,\n help: undefined,\n ...pickSpacingProps(props),\n }\n\n return (\n <CompositionField {...fieldBlockProps}>\n {!omitCountryCodeField && (\n <Autocomplete\n className={classnames(\n 'dnb-forms-field-phone-number__country-code',\n countryCodeFieldClassName\n )}\n mode=\"async\"\n placeholder={countryCodePlaceholder}\n label_direction=\"vertical\"\n label={countryCodeLabel ?? defaultCountryCodeLabel}\n data={dataRef.current}\n value={countryCodeRef.current}\n status={hasError ? 'error' : undefined}\n disabled={disabled}\n on_focus={handleCountryCodeFocus}\n on_blur={handleOnBlur}\n on_change={handleCountryCodeChange}\n on_type={onTypeHandler}\n independent_width\n search_numbers\n keep_selection\n autoComplete=\"tel-country-code\"\n no_animation={props.noAnimation}\n size={size}\n />\n )}\n <StringField\n className={classnames(\n 'dnb-forms-field-phone-number__number',\n numberFieldClassName\n )}\n type=\"tel\"\n autoComplete=\"tel-national\"\n emptyValue={emptyValue}\n layout=\"vertical\"\n label={label}\n placeholder={\n placeholder ?? (isDefault ? defaultPlaceholder : undefined)\n }\n mask={\n numberMask ?? (isDefault ? defaultMask : Array(12).fill(/\\d/))\n }\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n onChange={handleNumberChange}\n value={numberRef.current}\n innerRef={inputRef}\n info={info}\n warning={warning}\n error={error}\n disabled={disabled}\n width=\"stretch\"\n help={{ ...help, breakout: false, outset: false }}\n required={required}\n errorMessages={errorMessages}\n validateInitially={validateInitially}\n validateContinuously={continuousValidation || validateContinuously}\n validateUnchanged={validateUnchanged}\n inputMode=\"tel\"\n size={size}\n />\n </CompositionField>\n )\n}\n\nfunction makeObject(country: CountryType, lang: string) {\n return {\n selectedKey: formatCountryCode(country.cdc),\n selected_value: `${country.iso} (${formatCountryCode(country.cdc)})`,\n content: `${formatCountryCode(country.cdc)} ${\n country.i18n[lang] ?? country.i18n.en\n }`,\n country,\n }\n}\n\nfunction formatCountryCode(value: string) {\n return `+${value}`\n}\n\nfunction splitValue(value: string) {\n return (\n typeof value === 'string'\n ? value.match(/^(\\+[^ ]+)? ?(.*)$/)\n : [undefined, '', '']\n ).slice(1)\n}\n\nfunction joinValue(array: Array<string>) {\n return array.filter(Boolean).join(' ')\n}\n\nPhoneNumber._supportsSpacingProps = true\nexport default PhoneNumber\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAOA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAD,sBAAA,CAAAH,OAAA;AAKA,IAAAK,OAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,YAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA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","ignoreList":[]}
1
+ {"version":3,"file":"PhoneNumber.js","names":["_react","_interopRequireWildcard","require","_components","_classnames","_interopRequireDefault","_countries","_String","_Composition","_hooks","_utils","_Context","_SelectCountry","_useTranslation","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","defaultCountryCode","defaultPlaceholder","defaultMask","PhoneNumber","props","_sharedContext$locale","_props$inputRef","_countryCodeRef$curre","sharedContext","useContext","SharedContext","label","defaultLabel","countryCodeLabel","defaultCountryCodeLabel","errorRequired","useTranslation","lang","locale","split","countryCodeRef","useRef","emptyValue","prevCountryCodeRef","current","numberRef","dataRef","langRef","wasFilled","currentCountryRef","errorMessages","useMemo","validateRequired","useCallback","_ref","required","isChanged","error","countryCode","phoneNumber","splitValue","undefined","fromExternal","external","omitCountryCodeField","toEvent","schema","_props$schema","type","pattern","defaultProps","ref","preparedProps","inputRef","id","path","itemPath","className","countryCodeFieldClassName","numberFieldClassName","countryCodePlaceholder","placeholder","numberMask","countries","ccFilter","info","warning","size","hasError","disabled","width","help","validateInitially","continuousValidation","validateContinuously","validateUnchanged","setHasFocus","handleChange","setDisplayValue","onCountryCodeChange","onNumberChange","filterCountries","useFieldProps","useEffect","_inputRef$current","number","joinValue","country","countryFilter","updateCurrentDataSet","getCountryData","formatCountryCode","cdc","sort","makeObject","prepareEventValues","_currentCountryRef$cu","cdcVal","replace","item","find","_item$country","iso","callOnChange","data","eventValues","callOnBlurOrFocus","hasFocus","handleCountryCodeChange","_ref2","_data$selectedKey","selectedKey","trim","handleNumberChange","handleOnBlur","handleOnFocus","handleCountryCodeFocus","_ref3","updateData","onTypeHandler","_ref4","_event$nativeEvent","revalidateInputValue","event","nativeEvent","test","_ref5","window","requestAnimationFrame","isDefault","includes","fieldBlockProps","classnames","pickSpacingProps","createElement","Autocomplete","mode","label_direction","status","on_focus","on_blur","on_change","on_type","independent_width","search_numbers","keep_selection","selectall","autoComplete","no_animation","noAnimation","layout","mask","Array","fill","onFocus","onBlur","onChange","innerRef","breakout","outset","inputMode","_country$i18n$lang","name","i18n","en","code","selected_value","search_content","content","match","slice","array","Boolean","join","_supportsSpacingProps","_default","exports"],"sources":["../../../../../../src/extensions/forms/Field/PhoneNumber/PhoneNumber.tsx"],"sourcesContent":["import React, {\n useMemo,\n useContext,\n useCallback,\n useEffect,\n useRef,\n} from 'react'\nimport { Autocomplete } from '../../../../components'\nimport { InputMaskedProps } from '../../../../components/InputMasked'\nimport classnames from 'classnames'\nimport countries, {\n CountryISO,\n type CountryLang,\n type CountryType,\n} from '../../constants/countries'\nimport StringField, { Props as StringFieldProps } from '../String'\nimport { Props as FieldBlockProps } from '../../FieldBlock'\nimport CompositionField from '../Composition'\nimport { useFieldProps } from '../../hooks'\nimport {\n FieldPropsWithExtraValue,\n AllJSONSchemaVersions,\n} from '../../types'\nimport { pickSpacingProps } from '../../../../components/flex/utils'\nimport SharedContext from '../../../../shared/Context'\nimport {\n countryFilter,\n CountryFilterSet,\n getCountryData,\n} from '../SelectCountry'\nimport useTranslation from '../../hooks/useTranslation'\nimport { DrawerListDataArrayItem } from '../../../../fragments/DrawerList'\n\nexport type AdditionalArgs = {\n phoneNumber: string\n countryCode: string\n iso: string\n}\n\nexport type Props = Omit<\n FieldPropsWithExtraValue<string, AdditionalArgs, undefined | string>,\n 'layout' | 'layoutOptions'\n> & {\n countryCodeFieldClassName?: string\n numberFieldClassName?: string\n countryCodePlaceholder?: string\n countryCodeLabel?: string\n numberMask?: InputMaskedProps['mask']\n pattern?: StringFieldProps['pattern']\n width?: 'large' | 'stretch'\n inputRef?: React.RefObject<HTMLInputElement>\n omitCountryCodeField?: boolean\n onCountryCodeChange?: (value: string | undefined) => void\n onNumberChange?: (value: string | undefined) => void\n\n /**\n * Defines the countries to filter. Can be `Scandinavia`, `Nordic`, `Europe` or `Prioritized`.\n * Defaults to `Prioritized`.\n */\n countries?: CountryFilterSet\n\n /**\n * Use this prop to filter out certain countries. The function receives the country object and should return a boolean. Returning `false` will omit the country.\n */\n filterCountries?: (country: CountryType) => boolean\n\n /**\n * For internal testing purposes\n */\n noAnimation?: boolean\n} & Pick<StringFieldProps, 'size'>\n\n// Important for the default value to be defined here, and not after the useFieldProps call, to avoid the UI jumping\n// back to +47 once the user empty the field so handleChange send out undefined.\nconst defaultCountryCode = '+47'\nconst defaultPlaceholder = '00 00 00 00'\nconst defaultMask = [\n /\\d/,\n /\\d/,\n ' ',\n /\\d/,\n /\\d/,\n ' ',\n /\\d/,\n /\\d/,\n ' ',\n /\\d/,\n /\\d/,\n]\n\ntype EventValues = {\n countryCode?: string\n phoneNumber?: string\n}\n\nfunction PhoneNumber(props: Props) {\n const sharedContext = useContext(SharedContext)\n const {\n label: defaultLabel,\n countryCodeLabel: defaultCountryCodeLabel,\n errorRequired,\n } = useTranslation().PhoneNumber\n const lang = sharedContext.locale?.split('-')[0] as CountryLang\n\n const countryCodeRef = useRef<Props['value']>(props?.emptyValue)\n const prevCountryCodeRef = useRef(countryCodeRef.current)\n const numberRef = useRef<Props['value']>(props?.emptyValue)\n const dataRef = useRef<Array<DrawerListDataArrayItem>>(null)\n const langRef = useRef<string>(lang)\n const wasFilled = useRef<boolean>(false)\n const currentCountryRef = useRef<CountryType>()\n\n const errorMessages = useMemo(\n () => ({\n 'Field.errorRequired': errorRequired,\n 'Field.errorPattern': errorRequired,\n ...props.errorMessages,\n }),\n [errorRequired, props.errorMessages]\n )\n\n const validateRequired = useCallback(\n (value: string, { required, isChanged, error }) => {\n if (required) {\n const [countryCode, phoneNumber] = splitValue(value)\n\n if (countryCode !== prevCountryCodeRef.current) {\n if (countryCode) {\n prevCountryCodeRef.current = countryCode\n }\n return undefined\n }\n\n if (isChanged && !phoneNumber) {\n return error\n }\n }\n\n return undefined\n },\n []\n )\n\n const fromExternal = useCallback(\n (external: string) => {\n const [countryCode, phoneNumber] = splitValue(external)\n if (!countryCode && !phoneNumber && !props.omitCountryCodeField) {\n return countryCodeRef.current\n }\n return external\n },\n [props.omitCountryCodeField]\n )\n\n const toEvent = useCallback(\n (value: string) => {\n const [, phoneNumber] = splitValue(value)\n if (!phoneNumber) {\n return props.emptyValue\n }\n return value\n },\n [props.emptyValue]\n )\n\n const schema = useMemo<AllJSONSchemaVersions>(\n () =>\n props.schema ?? {\n type: 'string',\n pattern: props.pattern,\n },\n [props.schema, props.pattern]\n )\n const defaultProps: Partial<Props> = {\n schema,\n errorMessages,\n }\n const ref = useRef<HTMLInputElement>()\n const preparedProps: Props = {\n ...props,\n ...defaultProps,\n validateRequired,\n fromExternal,\n toEvent,\n inputRef: props.inputRef ?? ref,\n }\n\n const {\n id,\n path,\n itemPath,\n value,\n className,\n inputRef,\n countryCodeFieldClassName,\n numberFieldClassName,\n countryCodePlaceholder,\n placeholder,\n countryCodeLabel,\n label = defaultLabel,\n numberMask,\n countries: ccFilter = 'Prioritized',\n emptyValue,\n info,\n warning,\n size,\n error,\n hasError,\n disabled,\n width = props.omitCountryCodeField ? 'medium' : 'large',\n help,\n required,\n validateInitially,\n continuousValidation,\n validateContinuously,\n validateUnchanged,\n omitCountryCodeField,\n setHasFocus,\n handleChange,\n setDisplayValue,\n onCountryCodeChange,\n onNumberChange,\n filterCountries,\n } = useFieldProps(preparedProps)\n\n useEffect(() => {\n if (path || itemPath) {\n const number = inputRef.current?.value\n setDisplayValue(\n number?.length > 0\n ? joinValue([countryCodeRef.current, number])\n : undefined\n )\n }\n }, [inputRef, itemPath, path, setDisplayValue, value])\n\n const filter = useCallback(\n (country: CountryType) => {\n return countryFilter(country, filterCountries, ccFilter)\n },\n [ccFilter, filterCountries]\n )\n\n const updateCurrentDataSet = useCallback(() => {\n dataRef.current = getCountryData({\n lang,\n filter:\n // Make sure the whole cc list is displayed when cc filter is set to specific region\n ccFilter === 'Prioritized' && !wasFilled.current\n ? (country) =>\n `${formatCountryCode(country.cdc)}` ===\n countryCodeRef.current\n : filter,\n sort: ccFilter as Extract<CountryFilterSet, 'Prioritized'>,\n makeObject,\n })\n }, [lang, filter, ccFilter])\n\n const prepareEventValues = useCallback(\n ({\n countryCode = countryCodeRef.current || emptyValue,\n phoneNumber = numberRef.current || emptyValue,\n }: EventValues = {}) => {\n if (!currentCountryRef.current) {\n type Item = DrawerListDataArrayItem & { country: CountryType }\n\n const cdcVal = countryCode?.replace(/^\\+/, '')\n const item = dataRef.current.find((item: Item) => {\n const cdc = item?.country?.cdc\n return cdc === cdcVal\n }) as Item\n\n currentCountryRef.current = item?.country\n }\n\n return {\n ...(!omitCountryCodeField ? { countryCode } : {}),\n phoneNumber,\n iso: currentCountryRef.current?.iso as CountryISO,\n }\n },\n [emptyValue, omitCountryCodeField]\n )\n\n const callOnChange = useCallback(\n (data: EventValues) => {\n const eventValues = prepareEventValues(data)\n handleChange(\n joinValue([eventValues.countryCode, eventValues.phoneNumber]),\n eventValues\n )\n },\n [prepareEventValues, handleChange]\n )\n\n const callOnBlurOrFocus = useCallback(\n (hasFocus: boolean) => {\n setHasFocus(hasFocus, undefined, prepareEventValues())\n },\n [prepareEventValues, setHasFocus]\n )\n\n /**\n * We do not process the whole country list at the first render.\n * Only when the Autocomplete opens (focus).\n * To achieve this, we use memo instead of effect to update refs in sync.\n *\n * We set or update the data list depending on if the countrycode changes or lang changes.\n * We then update countryCode and phoneNumber when value changes.\n */\n useMemo(() => {\n const [countryCode, phoneNumber] = splitValue(props.value || value)\n numberRef.current = phoneNumber\n\n if (lang !== langRef.current || !wasFilled.current) {\n if (!countryCodeRef.current || countryCode) {\n countryCodeRef.current = countryCode || defaultCountryCode\n }\n langRef.current = lang\n\n updateCurrentDataSet()\n }\n }, [value, props.value, lang, updateCurrentDataSet])\n\n const handleCountryCodeChange = useCallback(\n ({\n data,\n }: {\n data: { selectedKey: string; country: CountryType }\n }) => {\n const countryCode = (countryCodeRef.current =\n data?.selectedKey?.trim() || emptyValue)\n currentCountryRef.current = data?.country\n\n callOnChange({ countryCode })\n onCountryCodeChange?.(countryCode)\n },\n [emptyValue, callOnChange, onCountryCodeChange]\n )\n\n const handleNumberChange = useCallback(\n (value: string) => {\n const phoneNumber = (numberRef.current = value || emptyValue)\n\n callOnChange({ phoneNumber })\n onNumberChange?.(phoneNumber)\n },\n [emptyValue, callOnChange, onNumberChange]\n )\n\n const handleOnBlur = useCallback(() => {\n callOnBlurOrFocus(false)\n }, [callOnBlurOrFocus])\n\n const handleOnFocus = useCallback(() => {\n callOnBlurOrFocus(true)\n }, [callOnBlurOrFocus])\n\n const handleCountryCodeFocus = useCallback(\n ({ updateData }) => {\n if (!wasFilled.current) {\n wasFilled.current = true\n updateCurrentDataSet()\n updateData(dataRef.current)\n }\n handleOnFocus()\n },\n [handleOnFocus, updateCurrentDataSet]\n )\n\n const onTypeHandler = useCallback(\n ({ value, updateData, revalidateInputValue, event }) => {\n // Handle browser autofill/autocomplete\n if (typeof event?.nativeEvent?.data === 'undefined') {\n const cdcVal = /\\+\\d{1,3}\\s{1}\\d+/.test(value)\n ? splitValue(value)[0]\n : value\n const country = countries.find(({ cdc }) => cdc === cdcVal)\n if (country?.cdc) {\n const countryCode = (countryCodeRef.current = formatCountryCode(\n country.cdc\n ))\n\n updateCurrentDataSet()\n updateData(dataRef.current)\n callOnChange({ countryCode })\n\n // To ensure correct input value,\n // regardless if there is changed data before or not.\n window.requestAnimationFrame(() => {\n revalidateInputValue()\n })\n }\n }\n },\n [callOnChange, updateCurrentDataSet]\n )\n\n const isDefault = countryCodeRef.current?.includes(defaultCountryCode)\n\n const fieldBlockProps: FieldBlockProps = {\n id,\n className: classnames('dnb-forms-field-phone-number', className),\n width,\n label: undefined,\n help: undefined,\n ...pickSpacingProps(props),\n }\n\n return (\n <CompositionField {...fieldBlockProps}>\n {!omitCountryCodeField && (\n <Autocomplete\n className={classnames(\n 'dnb-forms-field-phone-number__country-code',\n countryCodeFieldClassName\n )}\n mode=\"async\"\n placeholder={countryCodePlaceholder}\n label_direction=\"vertical\"\n label={countryCodeLabel ?? defaultCountryCodeLabel}\n data={dataRef.current}\n value={countryCodeRef.current}\n status={hasError ? 'error' : undefined}\n disabled={disabled}\n on_focus={handleCountryCodeFocus}\n on_blur={handleOnBlur}\n on_change={handleCountryCodeChange}\n on_type={onTypeHandler}\n independent_width\n search_numbers\n keep_selection\n selectall\n autoComplete=\"tel-country-code\"\n no_animation={props.noAnimation}\n size={size}\n />\n )}\n <StringField\n className={classnames(\n 'dnb-forms-field-phone-number__number',\n numberFieldClassName\n )}\n type=\"tel\"\n autoComplete=\"tel-national\"\n emptyValue={emptyValue}\n layout=\"vertical\"\n label={label}\n placeholder={\n placeholder ?? (isDefault ? defaultPlaceholder : undefined)\n }\n mask={\n numberMask ?? (isDefault ? defaultMask : Array(12).fill(/\\d/))\n }\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n onChange={handleNumberChange}\n value={numberRef.current}\n innerRef={inputRef}\n info={info}\n warning={warning}\n error={error}\n disabled={disabled}\n width=\"stretch\"\n help={{ ...help, breakout: false, outset: false }}\n required={required}\n errorMessages={errorMessages}\n validateInitially={validateInitially}\n validateContinuously={continuousValidation || validateContinuously}\n validateUnchanged={validateUnchanged}\n inputMode=\"tel\"\n size={size}\n />\n </CompositionField>\n )\n}\n\nfunction makeObject(country: CountryType, lang: string) {\n const name = country.i18n[lang] ?? country.i18n.en\n const code = formatCountryCode(country.cdc)\n return {\n selectedKey: code,\n selected_value: `${country.iso} (${code})`,\n search_content: [code, name],\n content: [name, code],\n country,\n }\n}\n\nfunction formatCountryCode(value: string) {\n return `+${value}`\n}\n\nfunction splitValue(value: string) {\n return (\n typeof value === 'string'\n ? value.match(/^(\\+[^ ]+)? ?(.*)$/)\n : [undefined, '', '']\n ).slice(1)\n}\n\nfunction joinValue(array: Array<string>) {\n return array.filter(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E;EACF,CAAC;AACH;AAEA,SAASI,iBAAiBA,CAACpG,KAAa,EAAE;EACxC,OAAO,IAAIA,KAAK,EAAE;AACpB;AAEA,SAASiD,UAAUA,CAACjD,KAAa,EAAE;EACjC,OAAO,CACL,OAAOA,KAAK,KAAK,QAAQ,GACrBA,KAAK,CAACkL,KAAK,CAAC,oBAAoB,CAAC,GACjC,CAAChI,SAAS,EAAE,EAAE,EAAE,EAAE,CAAC,EACvBiI,KAAK,CAAC,CAAC,CAAC;AACZ;AAEA,SAASpF,SAASA,CAACqF,KAAoB,EAAE;EACvC,OAAOA,KAAK,CAAChM,MAAM,CAACiM,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;AACxC;AAEA1K,WAAW,CAAC2K,qBAAqB,GAAG,IAAI;AAAA,IAAAC,QAAA,GAAAC,OAAA,CAAA3N,OAAA,GACzB8C,WAAW","ignoreList":[]}
@@ -37,12 +37,12 @@ type GetCountryData = {
37
37
  sort?: Extract<CountryFilterSet, 'Prioritized'>;
38
38
  makeObject?: (country: CountryType, lang: string) => {
39
39
  selectedKey: string;
40
- content: string;
40
+ content: string | Array<string>;
41
41
  };
42
42
  };
43
43
  export declare function getCountryData({ lang, filter, sort, makeObject, }?: GetCountryData): {
44
44
  selectedKey: string;
45
- content: string;
45
+ content: string | string[];
46
46
  }[];
47
47
  export declare function countryFilter(country: CountryType, filterCountries: (country: CountryType) => boolean, ccFilter: CountryFilterSet): boolean;
48
48
  export declare function makeCountryFilterSet(ccFilter: CountryFilterSet): (country: CountryType) => boolean;
@@ -190,6 +190,7 @@ function SelectCountry(props) {
190
190
  on_change: handleCountryChange,
191
191
  on_type: onTypeHandler,
192
192
  stretch: true,
193
+ selectall: true,
193
194
  status: hasError ? 'error' : undefined,
194
195
  show_submit_button: true,
195
196
  keep_selection: true,