@postnord/pn-marketweb-components 3.5.2 → 3.5.3

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 (400) hide show
  1. package/cjs/alert_exclamation_circle-24f29a5b.js +8 -0
  2. package/cjs/alert_exclamation_circle-24f29a5b.js.map +1 -0
  3. package/cjs/loader.cjs.js +1 -1
  4. package/cjs/pn-address-autofill.cjs.entry.js +47 -72
  5. package/cjs/pn-address-autofill.cjs.entry.js.map +1 -1
  6. package/cjs/pn-dropdown-choice-adds-row.cjs.entry.js +18 -6
  7. package/cjs/pn-dropdown-choice-adds-row.cjs.entry.js.map +1 -1
  8. package/cjs/pn-market-web-components.cjs.js +1 -1
  9. package/cjs/pn-marketweb-input.cjs.entry.js +2 -4
  10. package/cjs/pn-marketweb-input.cjs.entry.js.map +1 -1
  11. package/collection/components/input/pn-address-autofill/pn-address-autofill.css +6 -1
  12. package/collection/components/input/pn-address-autofill/pn-address-autofill.js +58 -68
  13. package/collection/components/input/pn-address-autofill/pn-address-autofill.js.map +1 -1
  14. package/collection/components/input/pn-address-autofill/pn-address-autofill.stories.js +2 -1
  15. package/collection/components/input/pn-address-autofill/translations.js +6 -3
  16. package/collection/components/input/pn-address-autofill/translations.js.map +1 -1
  17. package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.js +18 -6
  18. package/collection/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.js.map +1 -1
  19. package/components/alert_exclamation_circle.js +6 -0
  20. package/components/alert_exclamation_circle.js.map +1 -0
  21. package/components/pn-address-autofill.js +48 -72
  22. package/components/pn-address-autofill.js.map +1 -1
  23. package/components/pn-dropdown-choice-adds-row.js +18 -6
  24. package/components/pn-dropdown-choice-adds-row.js.map +1 -1
  25. package/components/pn-marketweb-input2.js +1 -3
  26. package/components/pn-marketweb-input2.js.map +1 -1
  27. package/esm/alert_exclamation_circle-f0fe7c7b.js +6 -0
  28. package/esm/alert_exclamation_circle-f0fe7c7b.js.map +1 -0
  29. package/esm/loader.js +1 -1
  30. package/esm/pn-address-autofill.entry.js +47 -72
  31. package/esm/pn-address-autofill.entry.js.map +1 -1
  32. package/esm/pn-dropdown-choice-adds-row.entry.js +18 -6
  33. package/esm/pn-dropdown-choice-adds-row.entry.js.map +1 -1
  34. package/esm/pn-market-web-components.js +1 -1
  35. package/esm/pn-marketweb-input.entry.js +1 -3
  36. package/esm/pn-marketweb-input.entry.js.map +1 -1
  37. package/package.json +1 -1
  38. package/pn-market-web-components/p-0ac30ee9.entry.js +2 -0
  39. package/pn-market-web-components/p-0ac30ee9.entry.js.map +1 -0
  40. package/pn-market-web-components/p-15d70aaf.entry.js +2 -0
  41. package/pn-market-web-components/p-15d70aaf.entry.js.map +1 -0
  42. package/pn-market-web-components/p-76c2c01f.js +2 -0
  43. package/pn-market-web-components/p-76c2c01f.js.map +1 -0
  44. package/pn-market-web-components/p-a11fdf9f.entry.js +2 -0
  45. package/pn-market-web-components/p-a11fdf9f.entry.js.map +1 -0
  46. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  47. package/pn-market-web-components/pn-market-web-components.esm.js.map +1 -1
  48. package/types/components/input/pn-address-autofill/pn-address-autofill.d.ts +2 -3
  49. package/types/components/input/pn-address-autofill/translations.d.ts +3 -0
  50. package/types/components.d.ts +2 -0
  51. package/umd/modules/@postnord/web-components/cjs/{angle_down-0b63ebde.js → chevron_down-83e72319.js} +3 -3
  52. package/umd/modules/@postnord/web-components/cjs/chevron_down-83e72319.js.map +1 -0
  53. package/umd/modules/@postnord/web-components/cjs/{angle_right-c8c55b43.js → chevron_right-aeb6aef3.js} +5 -5
  54. package/umd/modules/@postnord/web-components/cjs/chevron_right-aeb6aef3.js.map +1 -0
  55. package/umd/modules/@postnord/web-components/cjs/loader.cjs.js +1 -1
  56. package/umd/modules/@postnord/web-components/cjs/pn-accordion-row.cjs.entry.js +2 -2
  57. package/umd/modules/@postnord/web-components/cjs/pn-accordion-row.cjs.entry.js.map +1 -1
  58. package/umd/modules/@postnord/web-components/cjs/pn-action-menu.cjs.entry.js +42 -12
  59. package/umd/modules/@postnord/web-components/cjs/pn-action-menu.cjs.entry.js.map +1 -1
  60. package/umd/modules/@postnord/web-components/cjs/pn-button_2.cjs.entry.js +1 -1
  61. package/umd/modules/@postnord/web-components/cjs/pn-card.cjs.entry.js +1 -1
  62. package/umd/modules/@postnord/web-components/cjs/pn-checkbox.cjs.entry.js +1 -1
  63. package/umd/modules/@postnord/web-components/cjs/pn-choice-chip.cjs.entry.js +1 -1
  64. package/umd/modules/@postnord/web-components/cjs/pn-counter.cjs.entry.js +1 -1
  65. package/umd/modules/@postnord/web-components/cjs/pn-date-picker.cjs.entry.js +22 -6
  66. package/umd/modules/@postnord/web-components/cjs/pn-date-picker.cjs.entry.js.map +1 -1
  67. package/umd/modules/@postnord/web-components/cjs/pn-fieldset.cjs.entry.js +1 -1
  68. package/umd/modules/@postnord/web-components/cjs/pn-file-upload.cjs.entry.js +1 -1
  69. package/umd/modules/@postnord/web-components/cjs/pn-footer.cjs.entry.js +1 -1
  70. package/umd/modules/@postnord/web-components/cjs/pn-header.cjs.entry.js +1 -1
  71. package/umd/modules/@postnord/web-components/cjs/pn-input.cjs.entry.js +2 -2
  72. package/umd/modules/@postnord/web-components/cjs/pn-modal.cjs.entry.js +21 -7
  73. package/umd/modules/@postnord/web-components/cjs/pn-modal.cjs.entry.js.map +1 -1
  74. package/umd/modules/@postnord/web-components/cjs/pn-multiselect.cjs.entry.js +2 -2
  75. package/umd/modules/@postnord/web-components/cjs/pn-multiselect.cjs.entry.js.map +1 -1
  76. package/umd/modules/@postnord/web-components/cjs/pn-ocr-search.cjs.entry.js +1 -1
  77. package/umd/modules/@postnord/web-components/cjs/pn-page-nav-dropdown-item.cjs.entry.js +1 -1
  78. package/umd/modules/@postnord/web-components/cjs/pn-page-nav-item.cjs.entry.js +1 -1
  79. package/umd/modules/@postnord/web-components/cjs/pn-page-nav.cjs.entry.js +2 -2
  80. package/umd/modules/@postnord/web-components/cjs/pn-page-nav.cjs.entry.js.map +1 -1
  81. package/umd/modules/@postnord/web-components/cjs/pn-pagination.cjs.entry.js +1 -1
  82. package/umd/modules/@postnord/web-components/cjs/pn-progress-bar.cjs.entry.js +1 -1
  83. package/umd/modules/@postnord/web-components/cjs/pn-progress-indicator-step.cjs.entry.js +1 -1
  84. package/umd/modules/@postnord/web-components/cjs/pn-progress-indicator-step.cjs.entry.js.map +1 -1
  85. package/umd/modules/@postnord/web-components/cjs/pn-progress-indicator.cjs.entry.js +1 -1
  86. package/umd/modules/@postnord/web-components/cjs/pn-progress-indicator.cjs.entry.js.map +1 -1
  87. package/umd/modules/@postnord/web-components/cjs/pn-progress-stepper.cjs.entry.js +26 -41
  88. package/umd/modules/@postnord/web-components/cjs/pn-progress-stepper.cjs.entry.js.map +1 -1
  89. package/umd/modules/@postnord/web-components/cjs/pn-radio-button.cjs.entry.js +1 -1
  90. package/umd/modules/@postnord/web-components/cjs/pn-search-field.cjs.entry.js +1 -1
  91. package/umd/modules/@postnord/web-components/cjs/pn-segment.cjs.entry.js +1 -1
  92. package/umd/modules/@postnord/web-components/cjs/pn-segmented-control.cjs.entry.js +1 -1
  93. package/umd/modules/@postnord/web-components/cjs/pn-select.cjs.entry.js +2 -2
  94. package/umd/modules/@postnord/web-components/cjs/pn-select.cjs.entry.js.map +1 -1
  95. package/umd/modules/@postnord/web-components/cjs/pn-tab.cjs.entry.js +1 -1
  96. package/umd/modules/@postnord/web-components/cjs/pn-tablist.cjs.entry.js +2 -2
  97. package/umd/modules/@postnord/web-components/cjs/pn-tablist.cjs.entry.js.map +1 -1
  98. package/umd/modules/@postnord/web-components/cjs/pn-text-link.cjs.entry.js +1 -1
  99. package/umd/modules/@postnord/web-components/cjs/pn-textarea.cjs.entry.js +1 -1
  100. package/umd/modules/@postnord/web-components/cjs/pn-tile.cjs.entry.js +1 -1
  101. package/umd/modules/@postnord/web-components/cjs/pn-toast.cjs.entry.js +25 -16
  102. package/umd/modules/@postnord/web-components/cjs/pn-toast.cjs.entry.js.map +1 -1
  103. package/umd/modules/@postnord/web-components/cjs/pn-toggle-switch.cjs.entry.js +1 -1
  104. package/umd/modules/@postnord/web-components/cjs/pn-tooltip.cjs.entry.js +1 -1
  105. package/umd/modules/@postnord/web-components/cjs/pn-zipcode-search.cjs.entry.js +1 -1
  106. package/umd/modules/@postnord/web-components/cjs/postnord-web-components.cjs.js +1 -1
  107. package/umd/modules/@postnord/web-components/collection/components/buttons/pn-action-menu/pn-action-menu.js +41 -11
  108. package/umd/modules/@postnord/web-components/collection/components/buttons/pn-action-menu/pn-action-menu.js.map +1 -1
  109. package/umd/modules/@postnord/web-components/collection/components/content/pn-accordion/row/pn-accordion-row.js +2 -2
  110. package/umd/modules/@postnord/web-components/collection/components/content/pn-accordion/row/pn-accordion-row.js.map +1 -1
  111. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-modal/pn-modal.css +92 -40
  112. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-modal/pn-modal.js +35 -9
  113. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-modal/pn-modal.js.map +1 -1
  114. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-bar/pn-progress-bar.js +1 -1
  115. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-indicator/pn-progress-indicator-step/pn-progress-indicator-step.js +5 -1
  116. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-indicator/pn-progress-indicator-step/pn-progress-indicator-step.js.map +1 -1
  117. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-indicator/pn-progress-indicator.js +5 -1
  118. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-indicator/pn-progress-indicator.js.map +1 -1
  119. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-stepper/pn-progress-stepper.css +85 -9
  120. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-stepper/pn-progress-stepper.js +100 -97
  121. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-progress-stepper/pn-progress-stepper.js.map +1 -1
  122. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-spinner/pn-spinner.js +1 -1
  123. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-toast/pn-toast.css +0 -1
  124. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-toast/pn-toast.js +24 -15
  125. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-toast/pn-toast.js.map +1 -1
  126. package/umd/modules/@postnord/web-components/collection/components/feedback/pn-tooltip/pn-tooltip.js +1 -1
  127. package/umd/modules/@postnord/web-components/collection/components/input/pn-checkbox/pn-checkbox.js +1 -1
  128. package/umd/modules/@postnord/web-components/collection/components/input/pn-choice-chip/pn-choice-chip.js +1 -1
  129. package/umd/modules/@postnord/web-components/collection/components/input/pn-counter/pn-counter.js +1 -1
  130. package/umd/modules/@postnord/web-components/collection/components/input/pn-date-picker/pn-date-picker.css +2 -3
  131. package/umd/modules/@postnord/web-components/collection/components/input/pn-date-picker/pn-date-picker.js +22 -6
  132. package/umd/modules/@postnord/web-components/collection/components/input/pn-date-picker/pn-date-picker.js.map +1 -1
  133. package/umd/modules/@postnord/web-components/collection/components/input/pn-fieldset/pn-fieldset.js +1 -1
  134. package/umd/modules/@postnord/web-components/collection/components/input/pn-file-upload/pn-file-upload.js +1 -1
  135. package/umd/modules/@postnord/web-components/collection/components/input/pn-input/pn-input.js +2 -2
  136. package/umd/modules/@postnord/web-components/collection/components/input/pn-multiselect/pn-multiselect.js +2 -2
  137. package/umd/modules/@postnord/web-components/collection/components/input/pn-multiselect/pn-multiselect.js.map +1 -1
  138. package/umd/modules/@postnord/web-components/collection/components/input/pn-radio-button/pn-radio-button.js +1 -1
  139. package/umd/modules/@postnord/web-components/collection/components/input/pn-search-field/pn-search-field.js +1 -1
  140. package/umd/modules/@postnord/web-components/collection/components/input/pn-segmented-control/pn-segmented-control.js +1 -1
  141. package/umd/modules/@postnord/web-components/collection/components/input/pn-segmented-control/segment/pn-segment.js +1 -1
  142. package/umd/modules/@postnord/web-components/collection/components/input/pn-select/pn-select.js +2 -2
  143. package/umd/modules/@postnord/web-components/collection/components/input/pn-select/pn-select.js.map +1 -1
  144. package/umd/modules/@postnord/web-components/collection/components/input/pn-textarea/pn-textarea.js +1 -1
  145. package/umd/modules/@postnord/web-components/collection/components/input/pn-toggle-switch/pn-toggle-switch.js +1 -1
  146. package/umd/modules/@postnord/web-components/collection/components/layout/pn-header/pn-header.js +1 -1
  147. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-card/pn-card.js +1 -1
  148. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-footer/pn-footer.js +1 -1
  149. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/dropdown-item/pn-page-nav-dropdown-item.js +1 -1
  150. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/item/pn-page-nav-item.js +1 -1
  151. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/menu/pn-page-nav.js +2 -2
  152. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-page-nav/menu/pn-page-nav.js.map +1 -1
  153. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-pagination/pn-pagination.js +1 -1
  154. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tablist/pn-tablist.js +2 -2
  155. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tablist/pn-tablist.js.map +1 -1
  156. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tablist/tab/pn-tab.js +1 -1
  157. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-text-link/pn-text-link.js +1 -1
  158. package/umd/modules/@postnord/web-components/collection/components/navigation/pn-tile/pn-tile.js +1 -1
  159. package/umd/modules/@postnord/web-components/collection/components/web-components/pn-ocr-search/pn-ocr-search.js +1 -1
  160. package/umd/modules/@postnord/web-components/collection/components/web-components/pn-zipcode-search/pn-zipcode-search.js +1 -1
  161. package/umd/modules/@postnord/web-components/collection/globals/types.js.map +1 -1
  162. package/umd/modules/@postnord/web-components/components/{angle_down.js → chevron_down.js} +3 -3
  163. package/umd/modules/@postnord/web-components/components/chevron_down.js.map +1 -0
  164. package/umd/modules/@postnord/web-components/{esm/angle_right-b52095c9.js → components/chevron_right.js} +4 -4
  165. package/umd/modules/@postnord/web-components/components/chevron_right.js.map +1 -0
  166. package/umd/modules/@postnord/web-components/components/pn-accordion-row.js +2 -2
  167. package/umd/modules/@postnord/web-components/components/pn-accordion-row.js.map +1 -1
  168. package/umd/modules/@postnord/web-components/components/pn-action-menu.js +42 -12
  169. package/umd/modules/@postnord/web-components/components/pn-action-menu.js.map +1 -1
  170. package/umd/modules/@postnord/web-components/components/pn-card.js +1 -1
  171. package/umd/modules/@postnord/web-components/components/pn-checkbox.js +1 -1
  172. package/umd/modules/@postnord/web-components/components/pn-choice-chip.js +1 -1
  173. package/umd/modules/@postnord/web-components/components/pn-counter.js +1 -1
  174. package/umd/modules/@postnord/web-components/components/pn-date-picker.js +23 -7
  175. package/umd/modules/@postnord/web-components/components/pn-date-picker.js.map +1 -1
  176. package/umd/modules/@postnord/web-components/components/pn-fieldset.js +1 -1
  177. package/umd/modules/@postnord/web-components/components/pn-file-upload.js +1 -1
  178. package/umd/modules/@postnord/web-components/components/pn-footer.js +1 -1
  179. package/umd/modules/@postnord/web-components/components/pn-header.js +1 -1
  180. package/umd/modules/@postnord/web-components/components/pn-input.js +2 -2
  181. package/umd/modules/@postnord/web-components/components/pn-modal.js +25 -10
  182. package/umd/modules/@postnord/web-components/components/pn-modal.js.map +1 -1
  183. package/umd/modules/@postnord/web-components/components/pn-multiselect.js +2 -2
  184. package/umd/modules/@postnord/web-components/components/pn-multiselect.js.map +1 -1
  185. package/umd/modules/@postnord/web-components/components/pn-ocr-search.js +1 -1
  186. package/umd/modules/@postnord/web-components/components/pn-page-nav-dropdown-item.js +1 -1
  187. package/umd/modules/@postnord/web-components/components/pn-page-nav-item.js +1 -1
  188. package/umd/modules/@postnord/web-components/components/pn-page-nav.js +2 -2
  189. package/umd/modules/@postnord/web-components/components/pn-page-nav.js.map +1 -1
  190. package/umd/modules/@postnord/web-components/components/pn-pagination.js +1 -1
  191. package/umd/modules/@postnord/web-components/components/pn-progress-bar2.js +1 -1
  192. package/umd/modules/@postnord/web-components/components/pn-progress-indicator-step.js +1 -1
  193. package/umd/modules/@postnord/web-components/components/pn-progress-indicator-step.js.map +1 -1
  194. package/umd/modules/@postnord/web-components/components/pn-progress-indicator.js +1 -1
  195. package/umd/modules/@postnord/web-components/components/pn-progress-indicator.js.map +1 -1
  196. package/umd/modules/@postnord/web-components/components/pn-progress-stepper.js +34 -48
  197. package/umd/modules/@postnord/web-components/components/pn-progress-stepper.js.map +1 -1
  198. package/umd/modules/@postnord/web-components/components/pn-radio-button.js +1 -1
  199. package/umd/modules/@postnord/web-components/components/pn-search-field2.js +1 -1
  200. package/umd/modules/@postnord/web-components/components/pn-segment.js +1 -1
  201. package/umd/modules/@postnord/web-components/components/pn-segmented-control.js +1 -1
  202. package/umd/modules/@postnord/web-components/components/pn-select2.js +2 -2
  203. package/umd/modules/@postnord/web-components/components/pn-select2.js.map +1 -1
  204. package/umd/modules/@postnord/web-components/components/pn-spinner2.js +1 -1
  205. package/umd/modules/@postnord/web-components/components/pn-tab.js +1 -1
  206. package/umd/modules/@postnord/web-components/components/pn-tablist.js +2 -2
  207. package/umd/modules/@postnord/web-components/components/pn-tablist.js.map +1 -1
  208. package/umd/modules/@postnord/web-components/components/pn-text-link2.js +1 -1
  209. package/umd/modules/@postnord/web-components/components/pn-textarea.js +1 -1
  210. package/umd/modules/@postnord/web-components/components/pn-tile.js +1 -1
  211. package/umd/modules/@postnord/web-components/components/pn-toast.js +25 -16
  212. package/umd/modules/@postnord/web-components/components/pn-toast.js.map +1 -1
  213. package/umd/modules/@postnord/web-components/components/pn-toggle-switch.js +1 -1
  214. package/umd/modules/@postnord/web-components/components/pn-tooltip.js +1 -1
  215. package/umd/modules/@postnord/web-components/components/pn-zipcode-search.js +1 -1
  216. package/umd/modules/@postnord/web-components/esm/{angle_down-d788f691.js → chevron_down-6e3fb42f.js} +3 -3
  217. package/umd/modules/@postnord/web-components/esm/chevron_down-6e3fb42f.js.map +1 -0
  218. package/umd/modules/@postnord/web-components/{components/angle_right.js → esm/chevron_right-9d9305e8.js} +4 -4
  219. package/umd/modules/@postnord/web-components/esm/chevron_right-9d9305e8.js.map +1 -0
  220. package/umd/modules/@postnord/web-components/esm/loader.js +1 -1
  221. package/umd/modules/@postnord/web-components/esm/pn-accordion-row.entry.js +2 -2
  222. package/umd/modules/@postnord/web-components/esm/pn-accordion-row.entry.js.map +1 -1
  223. package/umd/modules/@postnord/web-components/esm/pn-action-menu.entry.js +42 -12
  224. package/umd/modules/@postnord/web-components/esm/pn-action-menu.entry.js.map +1 -1
  225. package/umd/modules/@postnord/web-components/esm/pn-button_2.entry.js +1 -1
  226. package/umd/modules/@postnord/web-components/esm/pn-card.entry.js +1 -1
  227. package/umd/modules/@postnord/web-components/esm/pn-checkbox.entry.js +1 -1
  228. package/umd/modules/@postnord/web-components/esm/pn-choice-chip.entry.js +1 -1
  229. package/umd/modules/@postnord/web-components/esm/pn-counter.entry.js +1 -1
  230. package/umd/modules/@postnord/web-components/esm/pn-date-picker.entry.js +23 -7
  231. package/umd/modules/@postnord/web-components/esm/pn-date-picker.entry.js.map +1 -1
  232. package/umd/modules/@postnord/web-components/esm/pn-fieldset.entry.js +1 -1
  233. package/umd/modules/@postnord/web-components/esm/pn-file-upload.entry.js +1 -1
  234. package/umd/modules/@postnord/web-components/esm/pn-footer.entry.js +1 -1
  235. package/umd/modules/@postnord/web-components/esm/pn-header.entry.js +1 -1
  236. package/umd/modules/@postnord/web-components/esm/pn-input.entry.js +2 -2
  237. package/umd/modules/@postnord/web-components/esm/pn-modal.entry.js +22 -8
  238. package/umd/modules/@postnord/web-components/esm/pn-modal.entry.js.map +1 -1
  239. package/umd/modules/@postnord/web-components/esm/pn-multiselect.entry.js +2 -2
  240. package/umd/modules/@postnord/web-components/esm/pn-multiselect.entry.js.map +1 -1
  241. package/umd/modules/@postnord/web-components/esm/pn-ocr-search.entry.js +1 -1
  242. package/umd/modules/@postnord/web-components/esm/pn-page-nav-dropdown-item.entry.js +1 -1
  243. package/umd/modules/@postnord/web-components/esm/pn-page-nav-item.entry.js +1 -1
  244. package/umd/modules/@postnord/web-components/esm/pn-page-nav.entry.js +2 -2
  245. package/umd/modules/@postnord/web-components/esm/pn-page-nav.entry.js.map +1 -1
  246. package/umd/modules/@postnord/web-components/esm/pn-pagination.entry.js +1 -1
  247. package/umd/modules/@postnord/web-components/esm/pn-progress-bar.entry.js +1 -1
  248. package/umd/modules/@postnord/web-components/esm/pn-progress-indicator-step.entry.js +1 -1
  249. package/umd/modules/@postnord/web-components/esm/pn-progress-indicator-step.entry.js.map +1 -1
  250. package/umd/modules/@postnord/web-components/esm/pn-progress-indicator.entry.js +1 -1
  251. package/umd/modules/@postnord/web-components/esm/pn-progress-indicator.entry.js.map +1 -1
  252. package/umd/modules/@postnord/web-components/esm/pn-progress-stepper.entry.js +26 -41
  253. package/umd/modules/@postnord/web-components/esm/pn-progress-stepper.entry.js.map +1 -1
  254. package/umd/modules/@postnord/web-components/esm/pn-radio-button.entry.js +1 -1
  255. package/umd/modules/@postnord/web-components/esm/pn-search-field.entry.js +1 -1
  256. package/umd/modules/@postnord/web-components/esm/pn-segment.entry.js +1 -1
  257. package/umd/modules/@postnord/web-components/esm/pn-segmented-control.entry.js +1 -1
  258. package/umd/modules/@postnord/web-components/esm/pn-select.entry.js +2 -2
  259. package/umd/modules/@postnord/web-components/esm/pn-select.entry.js.map +1 -1
  260. package/umd/modules/@postnord/web-components/esm/pn-tab.entry.js +1 -1
  261. package/umd/modules/@postnord/web-components/esm/pn-tablist.entry.js +2 -2
  262. package/umd/modules/@postnord/web-components/esm/pn-tablist.entry.js.map +1 -1
  263. package/umd/modules/@postnord/web-components/esm/pn-text-link.entry.js +1 -1
  264. package/umd/modules/@postnord/web-components/esm/pn-textarea.entry.js +1 -1
  265. package/umd/modules/@postnord/web-components/esm/pn-tile.entry.js +1 -1
  266. package/umd/modules/@postnord/web-components/esm/pn-toast.entry.js +25 -16
  267. package/umd/modules/@postnord/web-components/esm/pn-toast.entry.js.map +1 -1
  268. package/umd/modules/@postnord/web-components/esm/pn-toggle-switch.entry.js +1 -1
  269. package/umd/modules/@postnord/web-components/esm/pn-tooltip.entry.js +1 -1
  270. package/umd/modules/@postnord/web-components/esm/pn-zipcode-search.entry.js +1 -1
  271. package/umd/modules/@postnord/web-components/esm/postnord-web-components.js +1 -1
  272. package/umd/modules/@postnord/web-components/hydrate/index.js +204 -137
  273. package/umd/modules/@postnord/web-components/hydrate/index.mjs +204 -137
  274. package/umd/modules/@postnord/web-components/package.json +16 -14
  275. package/umd/modules/@postnord/web-components/postnord-web-components/{p-7e88df1f.entry.js → p-01472170.entry.js} +2 -2
  276. package/umd/modules/@postnord/web-components/postnord-web-components/{p-ed4271af.entry.js → p-06c7e91b.entry.js} +2 -2
  277. package/umd/modules/@postnord/web-components/postnord-web-components/p-06c7e91b.entry.js.map +1 -0
  278. package/umd/modules/@postnord/web-components/postnord-web-components/{p-8773152d.entry.js → p-10532427.entry.js} +2 -2
  279. package/umd/modules/@postnord/web-components/postnord-web-components/{p-ffe79fa4.entry.js → p-11ef58ab.entry.js} +2 -2
  280. package/umd/modules/@postnord/web-components/postnord-web-components/p-16fb83d9.entry.js +6 -0
  281. package/umd/modules/@postnord/web-components/postnord-web-components/p-16fb83d9.entry.js.map +1 -0
  282. package/umd/modules/@postnord/web-components/postnord-web-components/{p-d74ccbb2.entry.js → p-1cd57319.entry.js} +2 -2
  283. package/umd/modules/@postnord/web-components/postnord-web-components/{p-adc6404b.entry.js → p-1e7c31ed.entry.js} +2 -2
  284. package/umd/modules/@postnord/web-components/postnord-web-components/p-1e7c31ed.entry.js.map +1 -0
  285. package/umd/modules/@postnord/web-components/postnord-web-components/{p-c2bbbcaa.entry.js → p-1fe6fc61.entry.js} +2 -2
  286. package/umd/modules/@postnord/web-components/postnord-web-components/{p-203ad7de.entry.js → p-23fdc4b6.entry.js} +2 -2
  287. package/umd/modules/@postnord/web-components/postnord-web-components/p-23fdc4b6.entry.js.map +1 -0
  288. package/umd/modules/@postnord/web-components/postnord-web-components/p-240f6613.entry.js +6 -0
  289. package/umd/modules/@postnord/web-components/postnord-web-components/{p-7ae9c053.entry.js.map → p-240f6613.entry.js.map} +1 -1
  290. package/umd/modules/@postnord/web-components/postnord-web-components/{p-4f67fffa.entry.js → p-28357e12.entry.js} +2 -2
  291. package/umd/modules/@postnord/web-components/postnord-web-components/p-28357e12.entry.js.map +1 -0
  292. package/umd/modules/@postnord/web-components/postnord-web-components/{p-c96ff403.js → p-2f7bb5e8.js} +2 -2
  293. package/umd/modules/@postnord/web-components/postnord-web-components/p-2f7bb5e8.js.map +1 -0
  294. package/umd/modules/@postnord/web-components/postnord-web-components/{p-5b0000e9.entry.js → p-363f578a.entry.js} +2 -2
  295. package/umd/modules/@postnord/web-components/postnord-web-components/{p-c0d19737.entry.js → p-37297b9a.entry.js} +2 -2
  296. package/umd/modules/@postnord/web-components/postnord-web-components/p-49a39ea1.entry.js +6 -0
  297. package/umd/modules/@postnord/web-components/postnord-web-components/p-49a39ea1.entry.js.map +1 -0
  298. package/umd/modules/@postnord/web-components/postnord-web-components/{p-bc95d4b0.entry.js → p-49f5fdd2.entry.js} +2 -2
  299. package/umd/modules/@postnord/web-components/postnord-web-components/p-49f5fdd2.entry.js.map +1 -0
  300. package/umd/modules/@postnord/web-components/postnord-web-components/{p-b556b835.entry.js → p-4d371963.entry.js} +2 -2
  301. package/umd/modules/@postnord/web-components/postnord-web-components/{p-ab29b9c0.entry.js → p-4eaab357.entry.js} +2 -2
  302. package/umd/modules/@postnord/web-components/postnord-web-components/{p-da713fc1.entry.js → p-5ed7e9b7.entry.js} +2 -2
  303. package/umd/modules/@postnord/web-components/postnord-web-components/p-617a946d.entry.js +6 -0
  304. package/umd/modules/@postnord/web-components/postnord-web-components/p-617a946d.entry.js.map +1 -0
  305. package/umd/modules/@postnord/web-components/postnord-web-components/{p-e087c5c5.entry.js → p-63aa3911.entry.js} +2 -2
  306. package/umd/modules/@postnord/web-components/postnord-web-components/p-65ae6360.entry.js +6 -0
  307. package/umd/modules/@postnord/web-components/postnord-web-components/p-65ae6360.entry.js.map +1 -0
  308. package/umd/modules/@postnord/web-components/postnord-web-components/{p-bf015c0f.entry.js → p-699b7bde.entry.js} +2 -2
  309. package/umd/modules/@postnord/web-components/postnord-web-components/{p-9bc1d14f.entry.js → p-6f9a21be.entry.js} +2 -2
  310. package/umd/modules/@postnord/web-components/postnord-web-components/p-75c5fb41.entry.js +6 -0
  311. package/umd/modules/@postnord/web-components/postnord-web-components/p-75c5fb41.entry.js.map +1 -0
  312. package/umd/modules/@postnord/web-components/postnord-web-components/{p-bd14cdca.entry.js → p-8e07bc17.entry.js} +2 -2
  313. package/umd/modules/@postnord/web-components/postnord-web-components/{p-7bd6d804.entry.js → p-8eaa2540.entry.js} +2 -2
  314. package/umd/modules/@postnord/web-components/postnord-web-components/{p-bf967b50.js → p-99600bc7.js} +2 -2
  315. package/umd/modules/@postnord/web-components/postnord-web-components/p-99600bc7.js.map +1 -0
  316. package/umd/modules/@postnord/web-components/postnord-web-components/{p-ff068744.entry.js → p-9cecd28d.entry.js} +2 -2
  317. package/umd/modules/@postnord/web-components/postnord-web-components/{p-605d99df.entry.js → p-a440734f.entry.js} +2 -2
  318. package/umd/modules/@postnord/web-components/postnord-web-components/{p-b9a494ae.entry.js → p-ab553e80.entry.js} +2 -2
  319. package/umd/modules/@postnord/web-components/postnord-web-components/{p-936ed2a1.entry.js → p-ae04e001.entry.js} +2 -2
  320. package/umd/modules/@postnord/web-components/postnord-web-components/p-ae04e001.entry.js.map +1 -0
  321. package/umd/modules/@postnord/web-components/postnord-web-components/{p-a4df55c4.entry.js → p-b202a599.entry.js} +2 -2
  322. package/umd/modules/@postnord/web-components/postnord-web-components/p-b83e6373.entry.js +6 -0
  323. package/umd/modules/@postnord/web-components/postnord-web-components/p-b83e6373.entry.js.map +1 -0
  324. package/umd/modules/@postnord/web-components/postnord-web-components/{p-fcd5028f.entry.js → p-bdb9bdc3.entry.js} +2 -2
  325. package/umd/modules/@postnord/web-components/postnord-web-components/{p-81f9f367.entry.js → p-cebe3a25.entry.js} +2 -2
  326. package/umd/modules/@postnord/web-components/postnord-web-components/{p-76b020f0.entry.js → p-d2f7b4a9.entry.js} +2 -2
  327. package/umd/modules/@postnord/web-components/postnord-web-components/{p-c45dc75d.entry.js → p-e8050420.entry.js} +2 -2
  328. package/umd/modules/@postnord/web-components/postnord-web-components/{p-412fc8d6.entry.js → p-eee2d131.entry.js} +2 -2
  329. package/umd/modules/@postnord/web-components/postnord-web-components/{p-d3521b5d.entry.js → p-fb5d6d47.entry.js} +2 -2
  330. package/umd/modules/@postnord/web-components/postnord-web-components/postnord-web-components.esm.js +1 -1
  331. package/umd/modules/@postnord/web-components/postnord-web-components/postnord-web-components.esm.js.map +1 -1
  332. package/umd/modules/@postnord/web-components/types/components/buttons/pn-action-menu/pn-action-menu.d.ts +3 -0
  333. package/umd/modules/@postnord/web-components/types/components/feedback/pn-modal/pn-modal.d.ts +12 -2
  334. package/umd/modules/@postnord/web-components/types/components/feedback/pn-progress-indicator/pn-progress-indicator-step/pn-progress-indicator-step.d.ts +4 -0
  335. package/umd/modules/@postnord/web-components/types/components/feedback/pn-progress-indicator/pn-progress-indicator.d.ts +4 -0
  336. package/umd/modules/@postnord/web-components/types/components/feedback/pn-progress-stepper/pn-progress-stepper.d.ts +27 -22
  337. package/umd/modules/@postnord/web-components/types/components/feedback/pn-toast/pn-toast.d.ts +2 -1
  338. package/umd/modules/@postnord/web-components/types/components.d.ts +60 -12
  339. package/umd/modules/@postnord/web-components/types/globals/types.d.ts +2 -1
  340. package/umd/modules/@postnord/web-components/vscode-data.json +7 -3
  341. package/vscode-data.json +4 -0
  342. package/pn-market-web-components/p-59cb7166.entry.js +0 -2
  343. package/pn-market-web-components/p-59cb7166.entry.js.map +0 -1
  344. package/pn-market-web-components/p-7c3091eb.entry.js +0 -2
  345. package/pn-market-web-components/p-7c3091eb.entry.js.map +0 -1
  346. package/pn-market-web-components/p-94a69959.entry.js +0 -2
  347. package/pn-market-web-components/p-94a69959.entry.js.map +0 -1
  348. package/umd/modules/@postnord/web-components/cjs/angle_down-0b63ebde.js.map +0 -1
  349. package/umd/modules/@postnord/web-components/cjs/angle_right-c8c55b43.js.map +0 -1
  350. package/umd/modules/@postnord/web-components/components/angle_down.js.map +0 -1
  351. package/umd/modules/@postnord/web-components/components/angle_right.js.map +0 -1
  352. package/umd/modules/@postnord/web-components/esm/angle_down-d788f691.js.map +0 -1
  353. package/umd/modules/@postnord/web-components/esm/angle_right-b52095c9.js.map +0 -1
  354. package/umd/modules/@postnord/web-components/postnord-web-components/p-203ad7de.entry.js.map +0 -1
  355. package/umd/modules/@postnord/web-components/postnord-web-components/p-2615282e.entry.js +0 -6
  356. package/umd/modules/@postnord/web-components/postnord-web-components/p-2615282e.entry.js.map +0 -1
  357. package/umd/modules/@postnord/web-components/postnord-web-components/p-3bd59ac8.entry.js +0 -6
  358. package/umd/modules/@postnord/web-components/postnord-web-components/p-3bd59ac8.entry.js.map +0 -1
  359. package/umd/modules/@postnord/web-components/postnord-web-components/p-4f67fffa.entry.js.map +0 -1
  360. package/umd/modules/@postnord/web-components/postnord-web-components/p-514107a5.entry.js +0 -6
  361. package/umd/modules/@postnord/web-components/postnord-web-components/p-514107a5.entry.js.map +0 -1
  362. package/umd/modules/@postnord/web-components/postnord-web-components/p-6a30576b.entry.js +0 -6
  363. package/umd/modules/@postnord/web-components/postnord-web-components/p-6a30576b.entry.js.map +0 -1
  364. package/umd/modules/@postnord/web-components/postnord-web-components/p-7ae9c053.entry.js +0 -6
  365. package/umd/modules/@postnord/web-components/postnord-web-components/p-8bc8f614.entry.js +0 -6
  366. package/umd/modules/@postnord/web-components/postnord-web-components/p-8bc8f614.entry.js.map +0 -1
  367. package/umd/modules/@postnord/web-components/postnord-web-components/p-936ed2a1.entry.js.map +0 -1
  368. package/umd/modules/@postnord/web-components/postnord-web-components/p-adc6404b.entry.js.map +0 -1
  369. package/umd/modules/@postnord/web-components/postnord-web-components/p-bc95d4b0.entry.js.map +0 -1
  370. package/umd/modules/@postnord/web-components/postnord-web-components/p-bf967b50.js.map +0 -1
  371. package/umd/modules/@postnord/web-components/postnord-web-components/p-c96ff403.js.map +0 -1
  372. package/umd/modules/@postnord/web-components/postnord-web-components/p-ed4271af.entry.js.map +0 -1
  373. package/umd/modules/@postnord/web-components/postnord-web-components/p-fc5f9092.entry.js +0 -6
  374. package/umd/modules/@postnord/web-components/postnord-web-components/p-fc5f9092.entry.js.map +0 -1
  375. package/umd/modules/@postnord/web-components/readme.md +0 -32
  376. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-7e88df1f.entry.js.map → p-01472170.entry.js.map} +0 -0
  377. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-8773152d.entry.js.map → p-10532427.entry.js.map} +0 -0
  378. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-ffe79fa4.entry.js.map → p-11ef58ab.entry.js.map} +0 -0
  379. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-d74ccbb2.entry.js.map → p-1cd57319.entry.js.map} +0 -0
  380. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-c2bbbcaa.entry.js.map → p-1fe6fc61.entry.js.map} +0 -0
  381. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-5b0000e9.entry.js.map → p-363f578a.entry.js.map} +0 -0
  382. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-c0d19737.entry.js.map → p-37297b9a.entry.js.map} +0 -0
  383. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-b556b835.entry.js.map → p-4d371963.entry.js.map} +0 -0
  384. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-ab29b9c0.entry.js.map → p-4eaab357.entry.js.map} +0 -0
  385. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-da713fc1.entry.js.map → p-5ed7e9b7.entry.js.map} +0 -0
  386. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-e087c5c5.entry.js.map → p-63aa3911.entry.js.map} +0 -0
  387. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-bf015c0f.entry.js.map → p-699b7bde.entry.js.map} +0 -0
  388. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-9bc1d14f.entry.js.map → p-6f9a21be.entry.js.map} +0 -0
  389. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-bd14cdca.entry.js.map → p-8e07bc17.entry.js.map} +0 -0
  390. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-7bd6d804.entry.js.map → p-8eaa2540.entry.js.map} +0 -0
  391. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-ff068744.entry.js.map → p-9cecd28d.entry.js.map} +0 -0
  392. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-605d99df.entry.js.map → p-a440734f.entry.js.map} +0 -0
  393. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-b9a494ae.entry.js.map → p-ab553e80.entry.js.map} +0 -0
  394. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-a4df55c4.entry.js.map → p-b202a599.entry.js.map} +0 -0
  395. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-fcd5028f.entry.js.map → p-bdb9bdc3.entry.js.map} +0 -0
  396. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-81f9f367.entry.js.map → p-cebe3a25.entry.js.map} +0 -0
  397. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-76b020f0.entry.js.map → p-d2f7b4a9.entry.js.map} +0 -0
  398. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-c45dc75d.entry.js.map → p-e8050420.entry.js.map} +0 -0
  399. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-412fc8d6.entry.js.map → p-eee2d131.entry.js.map} +0 -0
  400. /package/umd/modules/@postnord/web-components/postnord-web-components/{p-d3521b5d.entry.js.map → p-fb5d6d47.entry.js.map} +0 -0
@@ -0,0 +1,6 @@
1
+ const icon = '<svg class="pn-icon-svg" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#000" fill-rule="evenodd" d="M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0m8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m1.4 5.497-.334 5.005a1.069 1.069 0 0 1-2.133 0L10.6 7.497a1.403 1.403 0 1 1 2.8 0M12 18a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3" clip-rule="evenodd"/></svg>';
2
+ const alert_exclamation_circle = icon;
3
+
4
+ export { alert_exclamation_circle as a };
5
+
6
+ //# sourceMappingURL=alert_exclamation_circle.js.map
@@ -0,0 +1 @@
1
+ {"file":"alert_exclamation_circle.js","mappings":"AAAA,MAAM,IAAI,GAAG,yYAAyY,CAAC;AAC3Y,MAAC,wBAAwB,GAAG;;;;","names":[],"sources":["node_modules/pn-design-assets/pn-assets/icons/alert_exclamation_circle.js"],"sourcesContent":["const icon = '<svg class=\"pn-icon-svg\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"#000\" fill-rule=\"evenodd\" d=\"M4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0m8-10C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m1.4 5.497-.334 5.005a1.069 1.069 0 0 1-2.133 0L10.6 7.497a1.403 1.403 0 1 1 2.8 0M12 18a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3\" clip-rule=\"evenodd\"/></svg>';\nexport const alert_exclamation_circle = icon;\nexport const alertExclamationCircle = icon;\n"],"version":3}
@@ -1,22 +1,26 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
2
  import { F as FetchHelper, M as MarketWebContextService } from './FetchHelper.js';
3
3
  import { d as debounce } from './index2.js';
4
+ import { a as alert_exclamation_circle } from './alert_exclamation_circle.js';
4
5
 
5
6
  const translations = {
6
7
  'sv': {
7
8
  errorEmpty: 'Får inte vara tom',
8
9
  errorPostalCode: 'Kan inte hitta postkoden',
9
- required: 'obligatoriskt'
10
+ required: 'obligatoriskt',
11
+ addressNotFound: 'Adressen hittades inte'
10
12
  },
11
13
  'en': {
12
14
  errorEmpty: 'Cannot be empty',
13
15
  errorPostalCode: 'Could not find postalcode',
14
- required: 'required'
16
+ required: 'required',
17
+ addressNotFound: 'Address not found'
15
18
  },
16
19
  'da': {
17
20
  errorEmpty: 'Kan ikke være tom',
18
21
  errorPostalCode: 'Kunne ikke finde postnummeret',
19
- required: 'påkrævet'
22
+ required: 'påkrævet',
23
+ addressNotFound: 'Adressen blev ikke fundet'
20
24
  },
21
25
  'no': {
22
26
  errorEmpty: 'Cannot be empty',
@@ -69,7 +73,7 @@ const translations = {
69
73
  },
70
74
  };
71
75
 
72
- const pnAddressAutofillCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}pn-address-autofill pn-marketweb-input{width:50%}pn-address-autofill .input-container-row{display:flex;gap:1rem;margin-bottom:1rem}pn-address-autofill .label-container{color:#5e554a;font-size:0.875em;display:flex;justify-content:space-between;align-items:flex-end}pn-address-autofill .autocomplete-items{position:absolute;border-radius:0.8rem;border:0.1rem solid #5e554a;width:100%;max-height:30rem;overflow-y:auto}pn-address-autofill .autocomplete-items:hover,pn-address-autofill .autocomplete-items :focus{border:0.1rem solid #00a0d6}pn-address-autofill .autocomplete-items div{padding:1.6rem;cursor:pointer;background-color:#fff;border:0.1rem solid transparent}pn-address-autofill .autocomplete-items div:first-child{border-radius:0.8rem 0.8rem 0 0}pn-address-autofill .autocomplete-items div:last-child{border-radius:0 0 0.8rem 0.8rem}pn-address-autofill .autocomplete-items div:hover{background-color:#e0f8ff}pn-address-autofill .autocomplete-items .autocomplete-active{background-color:#e0f8ff}pn-address-autofill .autocomplete-items:empty{display:none}pn-address-autofill pn-input{max-width:25rem;width:100%}";
76
+ const pnAddressAutofillCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}pn-address-autofill{display:flex;flex-direction:column;width:50rem}pn-address-autofill pn-input{width:50%}pn-address-autofill .input-container-row{display:flex;gap:1rem;margin-bottom:1rem}pn-address-autofill .label-container{color:#5e554a;font-size:0.875em;display:flex;justify-content:space-between;align-items:flex-end}pn-address-autofill .autocomplete-items{position:absolute;border-radius:0.8rem;border:0.1rem solid #5e554a;width:100%;max-height:30rem;overflow-y:auto}pn-address-autofill .autocomplete-items:hover,pn-address-autofill .autocomplete-items :focus{border:0.1rem solid #00a0d6}pn-address-autofill .autocomplete-items div{padding:1.6rem;cursor:pointer;background-color:#fff;border:0.1rem solid transparent}pn-address-autofill .autocomplete-items div:first-child{border-radius:0.8rem 0.8rem 0 0}pn-address-autofill .autocomplete-items div:last-child{border-radius:0 0 0.8rem 0.8rem}pn-address-autofill .autocomplete-items div:hover{background-color:#e0f8ff}pn-address-autofill .autocomplete-items .autocomplete-active{background-color:#e0f8ff}pn-address-autofill .autocomplete-items:empty{display:none}pn-address-autofill pn-input{max-width:25rem;width:100%}";
73
77
  const PnAddressAutofillStyle0 = pnAddressAutofillCss;
74
78
 
75
79
  const PnAddressAutofill$1 = /*@__PURE__*/ proxyCustomElement(class PnAddressAutofill extends HTMLElement {
@@ -87,11 +91,12 @@ const PnAddressAutofill$1 = /*@__PURE__*/ proxyCustomElement(class PnAddressAuto
87
91
  this.cityProps = null;
88
92
  this.streetAddressProps = null;
89
93
  this.streetNumberProps = null;
94
+ this.addressNotFoundError = null;
90
95
  this.postalCode = null;
91
96
  this.city = null;
92
97
  this.streetAddress = null;
93
98
  this.streetNumber = null;
94
- this.validAddress = false;
99
+ this.validAddress = true;
95
100
  this.translation = undefined;
96
101
  this.postalCodeRequiredLabel = null;
97
102
  this.streetRequiredLabel = null;
@@ -108,7 +113,6 @@ const PnAddressAutofill$1 = /*@__PURE__*/ proxyCustomElement(class PnAddressAuto
108
113
  streetNumberInputField = null;
109
114
  pnInputHiddenValue = null;
110
115
  endpointPath = '/api/location/get-by-postalcode';
111
- locationEndpointPath = '/api/location/get-by-location';
112
116
  _postalCodeProps = null;
113
117
  _cityProps = null;
114
118
  _streetAddressProps = null;
@@ -170,15 +174,15 @@ const PnAddressAutofill$1 = /*@__PURE__*/ proxyCustomElement(class PnAddressAuto
170
174
  }
171
175
  addEventHandlers() {
172
176
  let debounceTimeout;
173
- this.postalCodeInputField.addEventListener('keyup', (e) => {
177
+ this.postalCodeInputField.addEventListener('input', (e) => {
174
178
  this.isLoading = true;
175
179
  clearTimeout(debounceTimeout);
176
180
  debounceTimeout = window.setTimeout(() => {
177
181
  this.fetchPostalCodeData(e);
178
182
  }, 300);
179
183
  });
180
- this.streetAddressInputField.addEventListener('blur', this.handleAddressDropdown.bind(this));
181
- this.streetNumberInputField.addEventListener('blur', this.handleAddressDropdown.bind(this));
184
+ this.streetNumberInputField.addEventListener('input', debounce(this.fetchAddress.bind(this), 300));
185
+ this.streetAddressInputField.addEventListener('keydown', () => { this.streetNumberInputField.value = ''; });
182
186
  this.addFormFieldEvent();
183
187
  }
184
188
  addFormFieldEvent() {
@@ -218,6 +222,11 @@ const PnAddressAutofill$1 = /*@__PURE__*/ proxyCustomElement(class PnAddressAuto
218
222
  this.resetFields();
219
223
  this.postalCode = postalCode;
220
224
  var data = (await this.fetchPostalCode(postalCode));
225
+ if (!data || !data.addresses) {
226
+ this.city = null;
227
+ this.isLoading = true;
228
+ return;
229
+ }
221
230
  const cityInfo = data.addresses?.find(addr => addr.postalCode === postalCode);
222
231
  this.city = cityInfo?.city || null;
223
232
  this.isLoading = false;
@@ -241,24 +250,6 @@ const PnAddressAutofill$1 = /*@__PURE__*/ proxyCustomElement(class PnAddressAuto
241
250
  return null;
242
251
  }
243
252
  }
244
- async fetchAddress() {
245
- const endpointBase = this.endpoint.endsWith('/')
246
- ? this.endpoint.slice(0, -1)
247
- : this.endpoint;
248
- //merge street and number
249
- var locationSearch = this.streetAddress + ' ' + this.streetNumber;
250
- //this is Air search api which will return the address, without postcode, postalcode verification is done in handleAddressDropdown
251
- const fetchUrl = `${endpointBase}${this.locationEndpointPath}?countryCode=${this.countryCode}&query=${locationSearch}`;
252
- try {
253
- const data = await this.fetchHelper.fetchJson(fetchUrl, { mode: 'cors' }, this.cache);
254
- return data;
255
- }
256
- catch (error) {
257
- console.error("Error fetching address data:", error);
258
- this.isLoading = true;
259
- return null;
260
- }
261
- }
262
253
  resetFields() {
263
254
  this.streetAddressInputField.value = '';
264
255
  this.streetNumberInputField.value = '';
@@ -271,61 +262,45 @@ const PnAddressAutofill$1 = /*@__PURE__*/ proxyCustomElement(class PnAddressAuto
271
262
  element.removeAttribute('error');
272
263
  });
273
264
  }
274
- async handleAddressDropdown(e) {
275
- const streetAddress = this.streetAddressInputField.value;
276
- const streetNumber = this.streetNumberInputField.value;
277
- //no data fetching if both the inputs are empty
278
- if (!streetAddress && !streetNumber) {
265
+ async fetchAddress() {
266
+ const streetAddress = this.streetAddressInputField.value.trim();
267
+ const streetNumber = this.streetNumberInputField.value.trim();
268
+ if (!streetAddress || !streetNumber) {
269
+ this.validAddress = false;
279
270
  return;
280
271
  }
281
- //skip the data fetch if there is no change in input
272
+ const endpointBase = this.endpoint.endsWith('/')
273
+ ? this.endpoint.slice(0, -1)
274
+ : this.endpoint;
275
+ const fetchUrl = `${endpointBase}${this.endpointPath}?countryCode=${this.countryCode}&postalCode=${this.postalCodeInputField.value}&address=${streetAddress + " " + streetNumber}`;
276
+ try {
277
+ const data = await this.fetchHelper.fetchJson(fetchUrl, { mode: 'cors' }, this.cache);
278
+ if (!data?.addresses?.length) {
279
+ this.validAddress = false;
280
+ }
281
+ else {
282
+ const inputStreetAddress = this.normalizeChar(streetAddress);
283
+ const inputStreetNumber = this.normalizeChar(streetNumber);
284
+ const addressFound = data.addresses.some(addr => this.normalizeChar(addr.street) === inputStreetAddress &&
285
+ this.normalizeChar(addr.houseNumber) === inputStreetNumber &&
286
+ addr.postalCode === this.postalCodeInputField.value);
287
+ this.validAddress = addressFound;
288
+ }
289
+ }
290
+ catch (error) {
291
+ console.error("Error fetching address data:", error);
292
+ this.isLoading = true;
293
+ this.validAddress = false;
294
+ }
282
295
  if (this.streetAddress === streetAddress && this.streetNumber === streetNumber) {
283
296
  return;
284
297
  }
285
- //set the values
286
298
  if (streetAddress) {
287
299
  this.streetAddress = streetAddress;
288
300
  }
289
301
  if (streetNumber) {
290
302
  this.streetNumber = streetNumber;
291
303
  }
292
- //fetch data
293
- var data = await this.fetchAddress();
294
- //verify the error
295
- var showStreetAddressError = false;
296
- var showStreetNumberError = false;
297
- if (!data?.addresses?.length) {
298
- if (e.target === this.streetAddressInputField) {
299
- showStreetAddressError = true;
300
- }
301
- if (e.target === this.streetNumberInputField) {
302
- showStreetNumberError = true;
303
- }
304
- }
305
- else {
306
- if (this.streetAddress && !data.addresses.find(addr => this.normalizeChar(addr.street) === this.normalizeChar(this.streetAddress) && addr.postalCode === this.postalCode)) {
307
- showStreetAddressError = true;
308
- }
309
- if (this.streetNumber && !data.addresses.find(addr => addr.houseNumber.toLowerCase() === this.streetNumber.toLowerCase() && addr.postalCode === this.postalCode)) {
310
- showStreetNumberError = true;
311
- }
312
- }
313
- //helpertext changes are temp fix to show the error text, this can be removed once the upgrade is done and fixes this issue.
314
- this.pnInputStreetAddress.removeAttribute('error');
315
- this.pnInputStreetAddress.setAttribute('helpertext', this._streetAddressProps.streetAddressInputHelpertext);
316
- this.pnInputStreetNumber.removeAttribute('error');
317
- this.pnInputStreetNumber.setAttribute('helpertext', this._streetNumberProps.streetNumberInputHelpertext);
318
- this.validAddress = true;
319
- if (showStreetAddressError) {
320
- this.pnInputStreetAddress.setAttribute('error', this._streetAddressProps.streetAddressInputError);
321
- this.pnInputStreetAddress.setAttribute('helpertext', this._streetAddressProps.streetAddressInputError);
322
- this.validAddress = false;
323
- }
324
- if (showStreetNumberError) {
325
- this.pnInputStreetNumber.setAttribute('error', this._streetNumberProps.streetNumberInputError);
326
- this.pnInputStreetNumber.setAttribute('helpertext', this._streetNumberProps.streetNumberInputError);
327
- this.validAddress = false;
328
- }
329
304
  }
330
305
  //this function is added to compare the street input values if entered without special characters like é, ø ect
331
306
  normalizeChar(str) {
@@ -342,7 +317,7 @@ const PnAddressAutofill$1 = /*@__PURE__*/ proxyCustomElement(class PnAddressAuto
342
317
  return str1;
343
318
  }
344
319
  render() {
345
- return (h(Host, { key: '144d390d30ab4ed791c6e1c89753cf185ec22528', class: "pn-address-autofill" }, this._postalCodeProps?.postalCodeCityLabel ? (h("div", { class: "label-container" }, h("label", null, `${this._postalCodeProps.postalCodeCityLabel + ' ' + this.postalCodeRequiredLabel}`))) : null, h("div", { key: 'f50c6de42b8c582769e6c6f03736106462e1023d', class: "input-container-row" }, h("pn-input", { key: 'c777d9f11e090940d8fad9471027200116c79fec', type: "number", name: this._postalCodeProps?.postalCodeInputName, required: this._postalCodeProps?.postalCodeInputRequired, placeholder: this._postalCodeProps?.postalCodeInputPlaceholder, ref: el => (this.pnInputPostalCode = el), autocomplete: "off", helpertext: this._postalCodeProps?.postalCodeInputHelpertext }), h("pn-input", { key: '317888fa29d61168e8fac41f58adf3bab7a5d16c', type: "text", name: this._cityProps?.cityInputName, disabled: true, value: this.city, placeholder: this._cityProps?.cityInputPlaceholder, autocomplete: "off", helpertext: this._cityProps?.cityInputHelpertext })), this._streetAddressProps?.streetAddressNumberLabel ? (h("div", { class: "label-container" }, h("label", null, `${this._streetAddressProps.streetAddressNumberLabel + ' ' + this.streetRequiredLabel}`))) : null, h("div", { key: 'df079570278fe8910dd5e6bccf8f04585ad14243', class: "input-container-row" }, h("pn-input", { key: '3ebdce3b0a90fba067c023c80d5c6d2374885082', type: "text", name: this._streetAddressProps?.streetAddressInputName, required: this._streetAddressProps?.streetAddressInputRequired, value: this.streetAddress, placeholder: this._streetAddressProps?.streetAddressInputPlaceholder, ref: el => (this.pnInputStreetAddress = el), autocomplete: "off", helpertext: this._streetAddressProps?.streetAddressInputHelpertext, disabled: this.isLoading }), h("pn-input", { key: 'd48f305425656296711248b2c808b5a259e9730e', type: "text", name: this._streetNumberProps?.streetNumberInputName, required: this._streetNumberProps?.streetNumberInputRequired, value: this.streetNumber, placeholder: this._streetNumberProps?.streetNumberInputPlaceholder, ref: el => (this.pnInputStreetNumber = el), autocomplete: "off", helpertext: this._streetNumberProps?.streetNumberInputHelpertext, disabled: this.isLoading }))));
320
+ return (h(Host, { key: '6e09c78bcd1117bbcdbcec1fc65444772636036d', class: "pn-address-autofill" }, this._postalCodeProps?.postalCodeCityLabel ? (h("div", { class: "label-container" }, h("label", null, `${this._postalCodeProps.postalCodeCityLabel + ' ' + this.postalCodeRequiredLabel}`))) : null, h("div", { key: '8f5a0760096e3618436b7554a6a5c89c1b0bab0a', class: "input-container-row" }, h("pn-input", { key: '2490a7c926f9c693cf67dabbd60e56297aee44aa', type: "number", name: this._postalCodeProps?.postalCodeInputName, required: this._postalCodeProps?.postalCodeInputRequired, placeholder: this._postalCodeProps?.postalCodeInputPlaceholder, ref: el => (this.pnInputPostalCode = el), autocomplete: "off", helpertext: this._postalCodeProps?.postalCodeInputHelpertext }), h("pn-input", { key: '49bc2fdedb78d9ce11c973bd0d2ab127603ab148', type: "text", name: this._cityProps?.cityInputName, disabled: true, value: this.city, placeholder: this._cityProps?.cityInputPlaceholder, autocomplete: "off", helpertext: this._cityProps?.cityInputHelpertext })), this._streetAddressProps?.streetAddressNumberLabel ? (h("div", { class: "label-container" }, h("label", null, `${this._streetAddressProps.streetAddressNumberLabel + ' ' + this.streetRequiredLabel}`))) : null, h("div", { key: 'fed64c4457c27593bf6a22dea066f029fcd4a53d', class: "input-container-row" }, h("pn-input", { key: '7d7667465f4cad869cf8274158611aa32b7a8975', type: "text", name: this._streetAddressProps?.streetAddressInputName, required: this._streetAddressProps?.streetAddressInputRequired, value: this.streetAddress, placeholder: this._streetAddressProps?.streetAddressInputPlaceholder, ref: el => (this.pnInputStreetAddress = el), autocomplete: "off", helpertext: this._streetAddressProps?.streetAddressInputHelpertext, disabled: this.isLoading }), h("pn-input", { key: '8bc6498685c92de3e53034dcf4fe7078e171e41f', type: "text", name: this._streetNumberProps?.streetNumberInputName, required: this._streetNumberProps?.streetNumberInputRequired, value: this.streetNumber, placeholder: this._streetNumberProps?.streetNumberInputPlaceholder, ref: el => (this.pnInputStreetNumber = el), autocomplete: "off", helpertext: this._streetNumberProps?.streetNumberInputHelpertext, disabled: this.isLoading })), (!this.validAddress && this.streetAddressInputField.value && this.streetNumberInputField.value) ? (h("div", { class: "toast-container" }, h("pn-toast", { text: this.addressNotFoundError ?? this.translation.addressNotFound, appearance: "warning", icon: alert_exclamation_circle }))) : null));
346
321
  }
347
322
  static get style() { return PnAddressAutofillStyle0; }
348
323
  }, [0, "pn-address-autofill", {
@@ -356,6 +331,7 @@ const PnAddressAutofill$1 = /*@__PURE__*/ proxyCustomElement(class PnAddressAuto
356
331
  "cityProps": [1, "city-props"],
357
332
  "streetAddressProps": [1, "street-address-props"],
358
333
  "streetNumberProps": [1, "street-number-props"],
334
+ "addressNotFoundError": [1, "address-not-found-error"],
359
335
  "postalCode": [32],
360
336
  "city": [32],
361
337
  "streetAddress": [32],
@@ -1 +1 @@
1
- {"file":"pn-address-autofill.js","mappings":";;;;AAAO,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE;QACJ,UAAU,EAAE,mBAAmB;QAC/B,eAAe,EAAE,0BAA0B;QAC3C,QAAQ,EAAE,eAAe;KAC1B;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,iBAAiB;QAC7B,eAAe,EAAE,2BAA2B;QAC5C,QAAQ,EAAE,UAAU;KAErB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,mBAAmB;QAC/B,eAAe,EAAE,+BAA+B;QAChD,QAAQ,EAAE,UAAU;KACrB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE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-address-autofill/translations.ts","src/components/input/pn-address-autofill/pn-address-autofill.scss?tag=pn-address-autofill","src/components/input/pn-address-autofill/pn-address-autofill.tsx"],"sourcesContent":["export const translations = {\n 'sv': {\n errorEmpty: 'Får inte vara tom',\n errorPostalCode: 'Kan inte hitta postkoden',\n required: 'obligatoriskt'\n },\n 'en': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n required: 'required'\n\n },\n 'da': {\n errorEmpty: 'Kan ikke være tom',\n errorPostalCode: 'Kunne ikke finde postnummeret',\n required: 'påkrævet'\n },\n 'no': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'fi': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n required: 'pakollinen'\n },\n 'de': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'zh': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'fr': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'es': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'nl': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'it': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'tr': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'pl': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'pt': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'pt-BR': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n};\n","@import '../../../globals/main.scss';\n\npn-address-autofill {\n pn-marketweb-input {\n width: 50%;\n }\n\n .input-container-row {\n display: flex;\n //flex-grow: 1;\n gap: 1rem;\n margin-bottom: 1rem;\n }\n\n .label-container {\n color: $gray700;\n font-size: 0.875em;\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n }\n\n .autocomplete-items {\n position: absolute;\n border-radius: 0.8rem;\n border: 0.1rem solid $gray700;\n width: 100%;\n max-height: 30rem;\n overflow-y: auto;\n\n &:hover,\n :focus {\n border: 0.1rem solid $blue400;\n }\n\n div {\n padding: 1.6rem;\n cursor: pointer;\n background-color: #fff;\n border: 0.1rem solid transparent;\n\n &:first-child {\n border-radius: 0.8rem 0.8rem 0 0;\n }\n\n &:last-child {\n border-radius: 0 0 0.8rem 0.8rem;\n }\n\n &:hover {\n background-color: #e0f8ff;\n }\n }\n\n .autocomplete-active {\n background-color: #e0f8ff;\n }\n }\n \n .autocomplete-items:empty {\n display: none;\n }\n\n pn-input {\n max-width: 25rem;\n width: 100%;\n }\n}\n","import { Component, Prop, h, Element, State, Host, EventEmitter, Event } from '@stencil/core';\nimport { MarketWebContextService } from '../../../globals/MarketWebContextService';\nimport { FetchHelper } from '../../../globals/FetchHelper';\nimport { Root, PostalCodeProps, CityProps, StreetAddressProps, StreetNumberProps } from './types';\nimport debounce from 'debounce';\nimport { translations } from './translations';\n\n@Component({\n tag: 'pn-address-autofill',\n styleUrl: 'pn-address-autofill.scss',\n})\nexport class PnAddressAutofill {\n @Element() hostElement: Element;\n pnInputPostalCode: HTMLElement = null;\n pnInputCity: HTMLElement = null;\n pnInputStreetAddress: HTMLElement = null;\n pnInputStreetNumber: HTMLElement = null;\n postalCodeInputField: HTMLInputElement = null;\n streetAddressInputField: HTMLInputElement = null;\n streetNumberInputField: HTMLInputElement = null;\n pnInputHiddenValue: HTMLElement = null;\n endpointPath = '/api/location/get-by-postalcode';\n locationEndpointPath = '/api/location/get-by-location';\n private _postalCodeProps: PostalCodeProps = null;\n private _cityProps: CityProps = null;\n private _streetAddressProps: StreetAddressProps = null;\n private _streetNumberProps: StreetNumberProps = null;\n\n /** Specifies which market we want to show (se,dk,fi,no,com) */\n @Prop({ mutable: true, reflect: true }) market: string = null; //se\n /** Specifies which environment we're fetching data from. (production, preproduction, integration, localhost) */\n @Prop({ mutable: true, reflect: true }) environment: string = null; //sv\n @Prop() endpoint: string = null;\n @Prop() cache: boolean = true;\n @Prop() countryCode: string = null;\n @Prop() language: string = null;\n\n @Prop() postalCodeProps: string | PostalCodeProps = null;\n @Prop() cityProps: string | CityProps = null;\n @Prop() streetAddressProps: string | StreetAddressProps = null;\n @Prop() streetNumberProps: string | StreetNumberProps = null;\n\n @State() postalCode: string = null;\n @State() city: string = null;\n @State() streetAddress: string = null;\n @State() streetNumber: string = null;\n @State() validAddress: boolean = false;\n @State() translation: any;\n @State() postalCodeRequiredLabel: string = null;\n @State() streetRequiredLabel: string = null;\n\n @State() fullAddress: string = null;\n @State() isLoading: boolean = true;\n\n @Event() addresscomplete: EventEmitter<string>;\n\n fetchHelper = new FetchHelper('PostalCodeCityAutofill');\n\n componentWillLoad() {\n this.setInitialValues();\n this._postalCodeProps = this.setProps(this.postalCodeProps);\n this._cityProps = this.setProps(this.cityProps);\n this._streetAddressProps = this.setProps(this.streetAddressProps);\n this._streetNumberProps = this.setProps(this.streetNumberProps);\n }\n\n setProps(props) {\n if (typeof props === 'string') {\n return JSON.parse(props);\n } else {\n return props;\n }\n }\n\n componentDidLoad() {\n this.postalCodeInputField = this.pnInputPostalCode.querySelector('input');\n this.streetAddressInputField = this.pnInputStreetAddress.querySelector('input');\n this.streetNumberInputField = this.pnInputStreetNumber.querySelector('input');\n\n this.addEventHandlers();\n }\n\n async setInitialValues(href = window.location.href) {\n const marketWebContextService = new MarketWebContextService(href);\n\n if (!this.environment) {\n this.environment = await marketWebContextService.getEnvironmentName();\n }\n\n if (!this.endpoint && this.environment?.indexOf('local') === -1) {\n this.endpoint = await marketWebContextService.getEndpoint(this.environment, this.market);\n }\n\n if (!this.endpoint) {\n this.endpoint = '';\n }\n\n if (!this.language) {\n this.language = await marketWebContextService.getLanguage();\n }\n\n this.setTranslations()\n\n this.postalCodeRequiredLabel = \"\";\n this.streetRequiredLabel = \"\";\n\n if(this._postalCodeProps.postalCodeInputRequired === true) {\n this.postalCodeRequiredLabel = \" (\" + this.translation.required + \")\"; \n }\n\n if(this._streetAddressProps.streetAddressInputRequired === true) {\n this.streetRequiredLabel = \" (\" + this.translation.required + \")\"; \n }\n }\n\n setTranslations() {\n if (this.language === 'nb') {\n this.language = 'no';\n }\n if (this.language && translations[this.language]) {\n this.translation = translations[this.language];\n }\n }\n\n addEventHandlers() {\n let debounceTimeout: number | undefined;\n\n this.postalCodeInputField.addEventListener('keyup', (e) => {\n this.isLoading = true;\n clearTimeout(debounceTimeout);\n debounceTimeout = window.setTimeout(() => {\n this.fetchPostalCodeData(e);\n }, 300);\n });\n\n this.streetAddressInputField.addEventListener('blur', this.handleAddressDropdown.bind(this));\n this.streetNumberInputField.addEventListener('blur', this.handleAddressDropdown.bind(this));\n this.addFormFieldEvent();\n }\n\n addFormFieldEvent() {\n const allInputs = this.hostElement.querySelectorAll('input');\n allInputs.forEach(element => {\n ['keyup', 'change', 'blur'].forEach(eventName => {\n const debounceUpdate = debounce(this.updateHiddenValue.bind(this), 1000);\n element.addEventListener(eventName, debounceUpdate);\n });\n });\n }\n\n updateHiddenValue(e) {\n if (e.target === this.streetNumberInputField) {\n this.streetNumber = this.streetNumberInputField.value;\n }\n\n if (this.validAddress && this.postalCode && this.city && this.streetAddress && this.streetNumber) {\n this.fullAddress = `${this.streetAddress} ${this.streetNumber}, ${this.city} ${this.postalCode}`;\n } else {\n this.fullAddress = '';\n }\n\n this.addresscomplete.emit(this.fullAddress);\n }\n\n async fetchPostalCodeData(e: Event) {\n if (!e) {\n return;\n }\n const postalCode = this.postalCodeInputField.value;\n\n var postalCodeLength = 4;\n\n if (postalCode.length < postalCodeLength) {\n this.resetFields();\n return;\n }\n\n if (this.postalCode === postalCode) {\n return;\n }\n\n this.resetFields();\n this.postalCode = postalCode;\n\n var data = (await this.fetchPostalCode(postalCode));\n\n const cityInfo = data.addresses?.find(addr => addr.postalCode === postalCode);\n this.city = cityInfo?.city || null;\n\n this.isLoading = false;\n }\n\n\n async fetchPostalCode(postalCode) {\n const endpointBase = this.endpoint.endsWith('/')\n ? this.endpoint.slice(0, -1)\n : this.endpoint;\n\n const fetchUrl = `${endpointBase}${this.endpointPath}?countryCode=${this.countryCode}&postalCode=${postalCode}`;\n\n try {\n const data = await this.fetchHelper.fetchJson(fetchUrl, { mode: 'cors' }, this.cache) as Root;\n\n if (!data?.addresses?.length) {\n this.pnInputPostalCode.setAttribute('error', this._postalCodeProps.postalCodeInputError);\n return;\n }\n return data;\n }\n catch (error) {\n console.error(\"Error fetching address data:\", error);\n this.isLoading = true;\n return null;\n }\n }\n\n\n async fetchAddress() {\n const endpointBase = this.endpoint.endsWith('/')\n ? this.endpoint.slice(0, -1)\n : this.endpoint;\n\n //merge street and number\n var locationSearch = this.streetAddress + ' ' + this.streetNumber;\n\n //this is Air search api which will return the address, without postcode, postalcode verification is done in handleAddressDropdown\n const fetchUrl = `${endpointBase}${this.locationEndpointPath}?countryCode=${this.countryCode}&query=${locationSearch}`;\n\n try {\n const data = await this.fetchHelper.fetchJson(fetchUrl, { mode: 'cors' }, this.cache) as Root;\n return data;\n }\n catch (error) {\n console.error(\"Error fetching address data:\", error);\n this.isLoading = true;\n return null;\n }\n\n }\n\n private resetFields() {\n this.streetAddressInputField.value = '';\n this.streetNumberInputField.value = '';\n this.city = null;\n this.streetAddress = null;\n this.streetNumber = null;\n this.validAddress = false;\n\n let inputs = document.getElementsByTagName('pn-input');\n\n Array.from(inputs).forEach(element => {\n element.removeAttribute('error');\n });\n }\n\n async handleAddressDropdown(e: Event) {\n const streetAddress = this.streetAddressInputField.value;\n const streetNumber = this.streetNumberInputField.value;\n\n //no data fetching if both the inputs are empty\n if (!streetAddress && !streetNumber) {\n return;\n }\n\n //skip the data fetch if there is no change in input\n if (this.streetAddress === streetAddress && this.streetNumber === streetNumber) {\n return;\n }\n\n //set the values\n if (streetAddress) {\n this.streetAddress = streetAddress;\n }\n if (streetNumber) {\n this.streetNumber = streetNumber;\n }\n\n //fetch data\n var data = await this.fetchAddress();\n\n //verify the error\n var showStreetAddressError = false;\n var showStreetNumberError = false;\n\n if (!data?.addresses?.length) {\n if (e.target === this.streetAddressInputField) {\n showStreetAddressError = true;\n }\n if (e.target === this.streetNumberInputField) {\n showStreetNumberError = true;\n }\n } else {\n if (this.streetAddress && !data.addresses.find(addr => this.normalizeChar(addr.street) === this.normalizeChar(this.streetAddress) && addr.postalCode === this.postalCode)) {\n showStreetAddressError = true;\n }\n if (this.streetNumber && !data.addresses.find(addr => addr.houseNumber.toLowerCase() === this.streetNumber.toLowerCase() && addr.postalCode === this.postalCode)) {\n showStreetNumberError = true;\n }\n }\n\n //helpertext changes are temp fix to show the error text, this can be removed once the upgrade is done and fixes this issue.\n this.pnInputStreetAddress.removeAttribute('error');\n this.pnInputStreetAddress.setAttribute('helpertext', this._streetAddressProps.streetAddressInputHelpertext);\n\n this.pnInputStreetNumber.removeAttribute('error');\n this.pnInputStreetNumber.setAttribute('helpertext', this._streetNumberProps.streetNumberInputHelpertext);\n\n this.validAddress = true;\n\n if (showStreetAddressError) {\n this.pnInputStreetAddress.setAttribute('error', this._streetAddressProps.streetAddressInputError);\n this.pnInputStreetAddress.setAttribute('helpertext', this._streetAddressProps.streetAddressInputError);\n this.validAddress = false;\n }\n if (showStreetNumberError) {\n this.pnInputStreetNumber.setAttribute('error', this._streetNumberProps.streetNumberInputError);\n this.pnInputStreetNumber.setAttribute('helpertext', this._streetNumberProps.streetNumberInputError);\n this.validAddress = false;\n }\n }\n\n //this function is added to compare the street input values if entered without special characters like é, ø ect\n normalizeChar(str) {\n\n const specialCharMap = {\n 'ø': 'o',\n 'Ø': 'o',\n 'æ': 'ae',\n 'Æ': 'ae',\n // Add more as needed\n };\n\n var str1 = str.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\")\n .split('').map(char => specialCharMap[char] || char)\n .join('').toLowerCase()\n return str1;\n }\n\n render() {\n return (\n <Host class=\"pn-address-autofill\">\n {this._postalCodeProps?.postalCodeCityLabel ? (\n <div class=\"label-container\">\n <label>{`${this._postalCodeProps.postalCodeCityLabel + ' ' + this.postalCodeRequiredLabel}`}</label>\n </div>\n ) : null}\n <div class=\"input-container-row\">\n <pn-input\n type=\"number\"\n name={this._postalCodeProps?.postalCodeInputName}\n required={this._postalCodeProps?.postalCodeInputRequired}\n placeholder={this._postalCodeProps?.postalCodeInputPlaceholder}\n ref={el => (this.pnInputPostalCode = el as HTMLElement)}\n autocomplete=\"off\"\n helpertext={this._postalCodeProps?.postalCodeInputHelpertext}\n ></pn-input>\n\n <pn-input\n type=\"text\"\n name={this._cityProps?.cityInputName}\n disabled\n value={this.city}\n placeholder={this._cityProps?.cityInputPlaceholder}\n autocomplete=\"off\"\n helpertext={this._cityProps?.cityInputHelpertext}\n ></pn-input>\n </div>\n\n {this._streetAddressProps?.streetAddressNumberLabel ? (\n <div class=\"label-container\">\n <label>{`${this._streetAddressProps.streetAddressNumberLabel + ' ' + this.streetRequiredLabel}`}</label>\n </div>\n ) : null}\n <div class=\"input-container-row\">\n <pn-input\n type=\"text\"\n name={this._streetAddressProps?.streetAddressInputName}\n required={this._streetAddressProps?.streetAddressInputRequired}\n value={this.streetAddress}\n placeholder={this._streetAddressProps?.streetAddressInputPlaceholder}\n ref={el => (this.pnInputStreetAddress = el as HTMLElement)}\n autocomplete=\"off\"\n helpertext={this._streetAddressProps?.streetAddressInputHelpertext}\n disabled={this.isLoading}\n ></pn-input>\n\n <pn-input\n type=\"text\"\n name={this._streetNumberProps?.streetNumberInputName}\n required={this._streetNumberProps?.streetNumberInputRequired}\n value={this.streetNumber}\n placeholder={this._streetNumberProps?.streetNumberInputPlaceholder}\n ref={el => (this.pnInputStreetNumber = el as HTMLElement)}\n autocomplete=\"off\"\n helpertext={this._streetNumberProps?.streetNumberInputHelpertext}\n disabled={this.isLoading}\n ></pn-input>\n </div>\n </Host>\n );\n }\n}\n"],"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,QAAQ,EAAE,IAAI,CAAC,SAAS,GACd,EAEZ,iEACE,IAAI,EAAC,MAAM,EACX,IAAI,EAAE,IAAI,CAAC,kBAAkB,EAAE,qBAAqB,EACpD,QAAQ,EAAE,IAAI,CAAC,kBAAkB,EAAE,yBAAyB,EAC5D,KAAK,EAAE,IAAI,CAAC,YAAY,EACxB,WAAW,EAAE,IAAI,CAAC,kBAAkB,EAAE,4BAA4B,EAClE,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,mBAAmB,GAAG,EAAiB,CAAC,EACzD,YAAY,EAAC,KAAK,EAClB,UAAU,EAAE,IAAI,CAAC,kBAAkB,EAAE,2BAA2B,EAChE,QAAQ,EAAE,IAAI,CAAC,SAAS,GACd,CACR,EACL,CAAC,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,uBAAuB,CAAC,KAAK,IAAI,IAAI,CAAC,sBAAsB,CAAC,KAAK,KAC7F,WAAK,KAAK,EAAC,iBAAiB,IAC1B,gBAAU,IAAI,EAAE,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,UAAU,EAAC,SAAS,EAAC,IAAI,EAAE,wBAAwB,GAAa,CAC3I,IACJ,IAAI,CACH,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["PnAddressAutofill"],"sources":["src/components/input/pn-address-autofill/translations.ts","src/components/input/pn-address-autofill/pn-address-autofill.scss?tag=pn-address-autofill","src/components/input/pn-address-autofill/pn-address-autofill.tsx"],"sourcesContent":["export const translations = {\n 'sv': {\n errorEmpty: 'Får inte vara tom',\n errorPostalCode: 'Kan inte hitta postkoden',\n required: 'obligatoriskt',\n addressNotFound: 'Adressen hittades inte'\n },\n 'en': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n required: 'required',\n addressNotFound: 'Address not found'\n },\n 'da': {\n errorEmpty: 'Kan ikke være tom',\n errorPostalCode: 'Kunne ikke finde postnummeret',\n required: 'påkrævet',\n addressNotFound: 'Adressen blev ikke fundet'\n },\n 'no': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'fi': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n required: 'pakollinen'\n },\n 'de': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'zh': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'fr': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'es': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'nl': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'it': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'tr': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'pl': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'pt': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n 'pt-BR': {\n errorEmpty: 'Cannot be empty',\n errorPostalCode: 'Could not find postalcode',\n },\n};\n","@import '../../../globals/main.scss';\n\npn-address-autofill {\n display: flex;\n flex-direction: column;\n width: 50rem;\n\n pn-input {\n width: 50%;\n }\n\n .input-container-row {\n display: flex;\n gap: 1rem;\n margin-bottom: 1rem;\n }\n\n .label-container {\n color: $gray700;\n font-size: 0.875em;\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n }\n\n .autocomplete-items {\n position: absolute;\n border-radius: 0.8rem;\n border: 0.1rem solid $gray700;\n width: 100%;\n max-height: 30rem;\n overflow-y: auto;\n\n &:hover,\n :focus {\n border: 0.1rem solid $blue400;\n }\n\n div {\n padding: 1.6rem;\n cursor: pointer;\n background-color: #fff;\n border: 0.1rem solid transparent;\n\n &:first-child {\n border-radius: 0.8rem 0.8rem 0 0;\n }\n\n &:last-child {\n border-radius: 0 0 0.8rem 0.8rem;\n }\n\n &:hover {\n background-color: #e0f8ff;\n }\n }\n\n .autocomplete-active {\n background-color: #e0f8ff;\n }\n }\n\n .autocomplete-items:empty {\n display: none;\n }\n\n pn-input {\n max-width: 25rem;\n width: 100%;\n }\n}","import { Component, Prop, h, Element, State, Host, EventEmitter, Event } from '@stencil/core';\nimport { MarketWebContextService } from '../../../globals/MarketWebContextService';\nimport { FetchHelper } from '../../../globals/FetchHelper';\nimport { Root, PostalCodeProps, CityProps, StreetAddressProps, StreetNumberProps } from './types';\nimport debounce from 'debounce';\nimport { translations } from './translations';\nimport { alert_exclamation_circle } from 'pn-design-assets/pn-assets/icons';\n\n@Component({\n tag: 'pn-address-autofill',\n styleUrl: 'pn-address-autofill.scss',\n})\nexport class PnAddressAutofill {\n @Element() hostElement: Element;\n pnInputPostalCode: HTMLElement = null;\n pnInputCity: HTMLElement = null;\n pnInputStreetAddress: HTMLElement = null;\n pnInputStreetNumber: HTMLElement = null;\n postalCodeInputField: HTMLInputElement = null;\n streetAddressInputField: HTMLInputElement = null;\n streetNumberInputField: HTMLInputElement = null;\n pnInputHiddenValue: HTMLElement = null;\n endpointPath = '/api/location/get-by-postalcode';\n private _postalCodeProps: PostalCodeProps = null;\n private _cityProps: CityProps = null;\n private _streetAddressProps: StreetAddressProps = null;\n private _streetNumberProps: StreetNumberProps = null;\n\n /** Specifies which market we want to show (se,dk,fi,no,com) */\n @Prop({ mutable: true, reflect: true }) market: string = null; //se\n /** Specifies which environment we're fetching data from. (production, preproduction, integration, localhost) */\n @Prop({ mutable: true, reflect: true }) environment: string = null; //sv\n @Prop() endpoint: string = null;\n @Prop() cache: boolean = true;\n @Prop() countryCode: string = null;\n @Prop() language: string = null;\n\n @Prop() postalCodeProps: string | PostalCodeProps = null;\n @Prop() cityProps: string | CityProps = null;\n @Prop() streetAddressProps: string | StreetAddressProps = null;\n @Prop() streetNumberProps: string | StreetNumberProps = null;\n @Prop() addressNotFoundError: string = null;\n\n @State() postalCode: string = null;\n @State() city: string = null;\n @State() streetAddress: string = null;\n @State() streetNumber: string = null;\n @State() validAddress: boolean = true;\n @State() translation: any;\n @State() postalCodeRequiredLabel: string = null;\n @State() streetRequiredLabel: string = null;\n\n @State() fullAddress: string = null;\n @State() isLoading: boolean = true;\n\n @Event() addresscomplete: EventEmitter<string>;\n\n fetchHelper = new FetchHelper('PostalCodeCityAutofill');\n\n componentWillLoad() {\n this.setInitialValues();\n this._postalCodeProps = this.setProps(this.postalCodeProps);\n this._cityProps = this.setProps(this.cityProps);\n this._streetAddressProps = this.setProps(this.streetAddressProps);\n this._streetNumberProps = this.setProps(this.streetNumberProps);\n }\n\n setProps(props) {\n if (typeof props === 'string') {\n return JSON.parse(props);\n } else {\n return props;\n }\n }\n\n componentDidLoad() {\n this.postalCodeInputField = this.pnInputPostalCode.querySelector('input');\n this.streetAddressInputField = this.pnInputStreetAddress.querySelector('input');\n this.streetNumberInputField = this.pnInputStreetNumber.querySelector('input');\n\n this.addEventHandlers();\n }\n\n async setInitialValues(href = window.location.href) {\n const marketWebContextService = new MarketWebContextService(href);\n\n if (!this.environment) {\n this.environment = await marketWebContextService.getEnvironmentName();\n }\n\n if (!this.endpoint && this.environment?.indexOf('local') === -1) {\n this.endpoint = await marketWebContextService.getEndpoint(this.environment, this.market);\n }\n\n if (!this.endpoint) {\n this.endpoint = '';\n }\n\n if (!this.language) {\n this.language = await marketWebContextService.getLanguage();\n }\n\n this.setTranslations()\n\n this.postalCodeRequiredLabel = \"\";\n this.streetRequiredLabel = \"\";\n\n if (this._postalCodeProps.postalCodeInputRequired === true) {\n this.postalCodeRequiredLabel = \" (\" + this.translation.required + \")\";\n }\n\n if (this._streetAddressProps.streetAddressInputRequired === true) {\n this.streetRequiredLabel = \" (\" + this.translation.required + \")\";\n }\n }\n\n setTranslations() {\n if (this.language === 'nb') {\n this.language = 'no';\n }\n if (this.language && translations[this.language]) {\n this.translation = translations[this.language];\n }\n }\n\n addEventHandlers() {\n let debounceTimeout: number | undefined;\n\n this.postalCodeInputField.addEventListener('input', (e) => {\n this.isLoading = true;\n clearTimeout(debounceTimeout);\n debounceTimeout = window.setTimeout(() => {\n this.fetchPostalCodeData(e);\n }, 300);\n });\n\n this.streetNumberInputField.addEventListener('input', debounce(this.fetchAddress.bind(this), 300));\n this.streetAddressInputField.addEventListener('keydown', () => { this.streetNumberInputField.value = '' });\n this.addFormFieldEvent();\n }\n\n addFormFieldEvent() {\n const allInputs = this.hostElement.querySelectorAll('input');\n allInputs.forEach(element => {\n ['keyup', 'change', 'blur'].forEach(eventName => {\n const debounceUpdate = debounce(this.updateHiddenValue.bind(this), 1000);\n element.addEventListener(eventName, debounceUpdate);\n });\n });\n }\n\n updateHiddenValue(e) {\n if (e.target === this.streetNumberInputField) {\n this.streetNumber = this.streetNumberInputField.value;\n }\n\n if (this.validAddress && this.postalCode && this.city && this.streetAddress && this.streetNumber) {\n this.fullAddress = `${this.streetAddress} ${this.streetNumber}, ${this.city} ${this.postalCode}`;\n } else {\n this.fullAddress = '';\n }\n\n this.addresscomplete.emit(this.fullAddress);\n }\n\n async fetchPostalCodeData(e: Event) {\n if (!e) {\n return;\n }\n const postalCode = this.postalCodeInputField.value;\n\n var postalCodeLength = 4;\n\n if (postalCode.length < postalCodeLength) {\n this.resetFields();\n return;\n }\n\n if (this.postalCode === postalCode) {\n return;\n }\n\n this.resetFields();\n this.postalCode = postalCode;\n\n var data = (await this.fetchPostalCode(postalCode));\n\n if (!data || !data.addresses) {\n this.city = null;\n this.isLoading = true;\n return;\n }\n\n const cityInfo = data.addresses?.find(addr => addr.postalCode === postalCode);\n this.city = cityInfo?.city || null;\n\n this.isLoading = false;\n }\n\n\n async fetchPostalCode(postalCode) {\n const endpointBase = this.endpoint.endsWith('/')\n ? this.endpoint.slice(0, -1)\n : this.endpoint;\n\n const fetchUrl = `${endpointBase}${this.endpointPath}?countryCode=${this.countryCode}&postalCode=${postalCode}`;\n\n try {\n const data = await this.fetchHelper.fetchJson(fetchUrl, { mode: 'cors' }, this.cache) as Root;\n\n if (!data?.addresses?.length) {\n this.pnInputPostalCode.setAttribute('error', this._postalCodeProps.postalCodeInputError);\n return;\n }\n return data;\n }\n catch (error) {\n console.error(\"Error fetching address data:\", error);\n this.isLoading = true;\n return null;\n }\n }\n\n private resetFields() {\n this.streetAddressInputField.value = '';\n this.streetNumberInputField.value = '';\n this.city = null;\n this.streetAddress = null;\n this.streetNumber = null;\n this.validAddress = false;\n\n let inputs = document.getElementsByTagName('pn-input');\n\n Array.from(inputs).forEach(element => {\n element.removeAttribute('error');\n });\n }\n\n async fetchAddress() {\n const streetAddress = this.streetAddressInputField.value.trim();\n const streetNumber = this.streetNumberInputField.value.trim();\n\n if (!streetAddress || !streetNumber) {\n this.validAddress = false;\n return;\n }\n\n const endpointBase = this.endpoint.endsWith('/')\n ? this.endpoint.slice(0, -1)\n : this.endpoint;\n\n const fetchUrl = `${endpointBase}${this.endpointPath}?countryCode=${this.countryCode}&postalCode=${this.postalCodeInputField.value}&address=${streetAddress + \" \" + streetNumber}`;\n\n try {\n const data = await this.fetchHelper.fetchJson(fetchUrl, { mode: 'cors' }, this.cache) as Root;\n\n if (!data?.addresses?.length) {\n this.validAddress = false;\n } else {\n const inputStreetAddress = this.normalizeChar(streetAddress);\n const inputStreetNumber = this.normalizeChar(streetNumber);\n\n const addressFound = data.addresses.some(addr =>\n this.normalizeChar(addr.street) === inputStreetAddress &&\n this.normalizeChar(addr.houseNumber) === inputStreetNumber &&\n addr.postalCode === this.postalCodeInputField.value\n );\n\n this.validAddress = addressFound;\n }\n } catch (error) {\n console.error(\"Error fetching address data:\", error);\n this.isLoading = true;\n this.validAddress = false;\n }\n\n if (this.streetAddress === streetAddress && this.streetNumber === streetNumber) {\n return;\n }\n\n if (streetAddress) {\n this.streetAddress = streetAddress;\n }\n if (streetNumber) {\n this.streetNumber = streetNumber;\n }\n }\n //this function is added to compare the street input values if entered without special characters like é, ø ect\n normalizeChar(str) {\n\n const specialCharMap = {\n 'ø': 'o',\n 'Ø': 'o',\n 'æ': 'ae',\n 'Æ': 'ae',\n // Add more as needed\n };\n\n var str1 = str.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\")\n .split('').map(char => specialCharMap[char] || char)\n .join('').toLowerCase()\n return str1;\n }\n\n render() {\n return (\n <Host class=\"pn-address-autofill\">\n {this._postalCodeProps?.postalCodeCityLabel ? (\n <div class=\"label-container\">\n <label>{`${this._postalCodeProps.postalCodeCityLabel + ' ' + this.postalCodeRequiredLabel}`}</label>\n </div>\n ) : null}\n <div class=\"input-container-row\">\n <pn-input\n type=\"number\"\n name={this._postalCodeProps?.postalCodeInputName}\n required={this._postalCodeProps?.postalCodeInputRequired}\n placeholder={this._postalCodeProps?.postalCodeInputPlaceholder}\n ref={el => (this.pnInputPostalCode = el as HTMLElement)}\n autocomplete=\"off\"\n helpertext={this._postalCodeProps?.postalCodeInputHelpertext}\n ></pn-input>\n\n <pn-input\n type=\"text\"\n name={this._cityProps?.cityInputName}\n disabled\n value={this.city}\n placeholder={this._cityProps?.cityInputPlaceholder}\n autocomplete=\"off\"\n helpertext={this._cityProps?.cityInputHelpertext}\n ></pn-input>\n </div>\n\n {this._streetAddressProps?.streetAddressNumberLabel ? (\n <div class=\"label-container\">\n <label>{`${this._streetAddressProps.streetAddressNumberLabel + ' ' + this.streetRequiredLabel}`}</label>\n </div>\n ) : null}\n <div class=\"input-container-row\">\n <pn-input\n type=\"text\"\n name={this._streetAddressProps?.streetAddressInputName}\n required={this._streetAddressProps?.streetAddressInputRequired}\n value={this.streetAddress}\n placeholder={this._streetAddressProps?.streetAddressInputPlaceholder}\n ref={el => (this.pnInputStreetAddress = el as HTMLElement)}\n autocomplete=\"off\"\n helpertext={this._streetAddressProps?.streetAddressInputHelpertext}\n disabled={this.isLoading}\n ></pn-input>\n\n <pn-input\n type=\"text\"\n name={this._streetNumberProps?.streetNumberInputName}\n required={this._streetNumberProps?.streetNumberInputRequired}\n value={this.streetNumber}\n placeholder={this._streetNumberProps?.streetNumberInputPlaceholder}\n ref={el => (this.pnInputStreetNumber = el as HTMLElement)}\n autocomplete=\"off\"\n helpertext={this._streetNumberProps?.streetNumberInputHelpertext}\n disabled={this.isLoading}\n ></pn-input>\n </div>\n {(!this.validAddress && this.streetAddressInputField.value && this.streetNumberInputField.value) ? (\n <div class=\"toast-container\">\n <pn-toast text={this.addressNotFoundError ?? this.translation.addressNotFound} appearance=\"warning\" icon={alert_exclamation_circle}></pn-toast>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -89,12 +89,14 @@ const pnDropdownChoiceAddsRow = /*@__PURE__*/ proxyCustomElement(class pnDropdow
89
89
  this.rowvalues.emit('');
90
90
  return;
91
91
  }
92
+ let allRowsValid = true;
92
93
  const formValues = allRows.map(row => {
93
94
  const nameElm = row.querySelector('.tr-name');
94
95
  const dropdownElm = row.querySelector('.tr-dropdown');
95
96
  const inputElm = row.querySelector('.tr-input');
96
97
  if (!nameElm || !inputElm) {
97
- throw new Error('Required elements missing from row');
98
+ allRowsValid = false;
99
+ return null;
98
100
  }
99
101
  const rowData = {
100
102
  row: [
@@ -104,11 +106,14 @@ const pnDropdownChoiceAddsRow = /*@__PURE__*/ proxyCustomElement(class pnDropdow
104
106
  }
105
107
  ]
106
108
  };
107
- if (dropdownElm) {
109
+ if (dropdownElm && dropdownElm.querySelector('pn-select')) {
108
110
  const pnSelect = dropdownElm.querySelector('pn-select');
109
111
  const nativeSelect = pnSelect?.querySelector('select');
110
112
  const dropdownSelection = nativeSelect?.value || '';
111
- if (dropdownSelection) {
113
+ if (!dropdownSelection) {
114
+ allRowsValid = false;
115
+ }
116
+ else {
112
117
  rowData.row.push({
113
118
  name: this.rowDropdownLabel,
114
119
  value: dropdownSelection
@@ -123,16 +128,22 @@ const pnDropdownChoiceAddsRow = /*@__PURE__*/ proxyCustomElement(class pnDropdow
123
128
  value: inputValue.toString()
124
129
  });
125
130
  }
131
+ else {
132
+ allRowsValid = false;
133
+ }
126
134
  return rowData;
127
135
  });
128
- if (!formValues.length || formValues.length !== allRows.length) {
136
+ if (!allRowsValid || !formValues.length || formValues.includes(null)) {
129
137
  this.formValue = '';
138
+ this.rowvalues.emit('');
130
139
  return;
131
140
  }
132
141
  this.formValue = `PN-JSON|${JSON.stringify(formValues)}`;
133
142
  if (this.validateInputs()) {
134
143
  this.rowvalues.emit(this.formValue);
135
- return;
144
+ }
145
+ else {
146
+ this.rowvalues.emit('');
136
147
  }
137
148
  }
138
149
  catch (error) {
@@ -180,6 +191,7 @@ const pnDropdownChoiceAddsRow = /*@__PURE__*/ proxyCustomElement(class pnDropdow
180
191
  this.tableBody.appendChild(newRow);
181
192
  this.updateRowSelectDropdown();
182
193
  this.nextRowIndex++;
194
+ selectedElement.value = '';
183
195
  }
184
196
  getCurrentRow(selectedValue) {
185
197
  return this.hostElement.querySelectorAll(`.tr-name[data-name='${selectedValue}'`);
@@ -318,7 +330,7 @@ const pnDropdownChoiceAddsRow = /*@__PURE__*/ proxyCustomElement(class pnDropdow
318
330
  return true;
319
331
  }
320
332
  render() {
321
- return (h(Host, { key: 'fd91d96d714f89cab04d27588c78c933e4758a29' }, h("div", { key: '3c8c900cc143afe7331b5717649d0ceef3fb1b97', class: "dropdown-choice-form-row" }, h("pn-select", { key: '42cf006bfd234c61e115bb3fd90d8fa5bc9b937f', ref: el => (this.pnRowSelectDropdown = el), name: this.addRowDropdownName, label: this.addRowDropdownLabel, class: "pn-row-select-dropdown", language: this.languageCode }, h("option", { key: 'aa923ce23c5e94ac3ee98701b33a83461cdd40d9', value: "", selected: true, disabled: true }, this.addRowDropdownPlaceholder), this.rowSelectDropdownArr?.map((value) => h("option", { label: value, value: value }, value)))), h("div", { key: '41cd6fc5cca7544033bbb7e811da28a92f631f44', class: "dropdown-choice-form-row" }, h("div", { key: 'a76149b35b83be8964ac9e0177d5677f7bdb9c39', class: "pn-dropdown-choice-table" }, h("div", { key: '417b71529a5491b4e8900b800bbbf89fe2ef0c6d', ref: el => (this.tableHead = el) }, this.nextRowIndex === 0 ? null : (h("div", { class: "table-header" }, h("div", { class: "table-header-name" }, h("label", null, this.rowNameLabel)), h("div", { class: "table-header-dropdown" }, h("label", null, this.rowDropdownLabel)), h("div", { class: "table-header-input" }, h("label", null, this.rowInputLabel)), h("div", { class: "table-header-delete" })))), h("div", { key: '7ff98dc256a4aa7a613ac06474b18fc7f9458aeb', ref: el => (this.tableBody = el), class: "pn-dropdown-choice-table-slot" }, h("slot", { key: '659095efebf6f2b123b4586b2d2913431b1cc6c2' }))))));
333
+ return (h(Host, { key: '4d75a1a804885406d9bf70647ee031b283001316' }, h("div", { key: '4db2eab15b25d322bd8081f22fa0dfb4e40ff1d8', class: "dropdown-choice-form-row" }, h("pn-select", { key: '34479df6fd80391a95628b34a9d3d4007a43700a', ref: el => (this.pnRowSelectDropdown = el), name: this.addRowDropdownName, label: this.addRowDropdownLabel, class: "pn-row-select-dropdown", language: this.languageCode }, h("option", { key: 'c445488973b9c7127a55f0f83cfb46276f3a165e', value: "", selected: true, disabled: true }, this.addRowDropdownPlaceholder), this.rowSelectDropdownArr?.map((value) => h("option", { label: value, value: value }, value)))), h("div", { key: '15abdc5dae3056d3e81069c01e67245aacba5c59', class: "dropdown-choice-form-row" }, h("div", { key: '2386cfc37b14b5769e095596f191054b2fb3e0af', class: "pn-dropdown-choice-table" }, h("div", { key: '123b39e0fc0dba53aa35da0dea41178f77633c76', ref: el => (this.tableHead = el) }, this.nextRowIndex === 0 ? null : (h("div", { class: "table-header" }, h("div", { class: "table-header-name" }, h("label", null, this.rowNameLabel)), h("div", { class: "table-header-dropdown" }, h("label", null, this.rowDropdownLabel)), h("div", { class: "table-header-input" }, h("label", null, this.rowInputLabel)), h("div", { class: "table-header-delete" })))), h("div", { key: '8d6e932979cd2065cbf77a70e74e30d087351b24', ref: el => (this.tableBody = el), class: "pn-dropdown-choice-table-slot" }, h("slot", { key: '8957b9b3b30d090c51bc993ff4676f91a2846a15' }))))));
322
334
  }
323
335
  static get watchers() { return {
324
336
  "dropdownData": ["dropdownDataWatcher"]
@@ -1 +1 @@
1
- {"file":"pn-dropdown-choice-adds-row.js","mappings":";;;AAAA,MAAM,0BAA0B,GAAG,ytFAAytF,CAAC;AAC7vF,sCAAe,0BAA0B;;MCO5B,uBAAuB;;;;;4BAOM,IAAI;4BACb,IAAI;kCACE,EAAE;yCACK,EAAE;mCACR,EAAE;4BACT,EAAE;8BACC,IAAI;gCACH,EAAE;sCACI,EAAE;6BACX,EAAE;mCACI,EAAE;+BACN,CAAC;iCACC,IAAI;iCACJ,IAAI;oCACD,IAAI;4BAEX,IAAI;oCACM,IAAI;yBACjB,IAAI;;;IAvBjC,mBAAmB,GAAgB,IAAI,CAAC;IACxC,SAAS,GAAgB,IAAI,CAAC;IAC9B,SAAS,GAAgB,IAAI,CAAC;IACtB,aAAa,CAAS;IAsBrB,SAAS,CAAuB;IAGzC,mBAAmB;QACjB,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,QAAQ,EAAE;YACzC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACpD;aAAM;YACL,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC;SACxC;KACF;IAED,iBAAiB;QACf,IAAI,CAAC,mBAAmB,EAAE,CAAC;KAC5B;IAED,gBAAgB;QACd,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,gBAAgB,EAAE,CAAC;KACzB;IAED,gBAAgB;QACd,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;KACnG;IAED,gBAAgB;QACd,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,C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F,8DAAa,CACT,CACF,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.scss?tag=pn-dropdown-choice-adds-row","src/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\npn-dropdown-choice-adds-row {\n display: block;\n width: 80rem;\n\n .pn-row-select-dropdown {\n width: 50%;\n margin-bottom: 1rem;\n }\n\n @media only screen and (max-width: 640px) {\n .pn-row-select-dropdown {\n width: 100%;\n }\n }\n\n .pn-dropdown-choice-table {\n width: 100%;\n border-spacing: 0rem;\n border: none !important;\n\n thead {\n th {\n text-align: left;\n padding: 1rem 0.5rem;\n\n label {\n color: $gray700;\n font-size: 1.4rem;\n font-weight: 400;\n }\n }\n }\n \n .generated-table-row {\n display: flex;\n margin-bottom: 2rem;\n }\n\n .table-header {\n display: flex;\n margin: 2rem 0 3rem 0;\n font-weight: 500;\n }\n\n .table-header, .tr {\n &-dropdown, &-column, &-name {\n padding-right: 0.5rem;\n width: 35%;\n\n pn-select {\n width: 95%;\n }\n }\n\n &-input {\n width: 15%;\n\n pn-input {\n width: 100%;\n }\n }\n\n &-delete {\n margin: 1rem;\n width: 15%;\n }\n }\n\n tbody {\n td {\n padding: 0.5rem;\n }\n\n tr:nth-child(even) {\n background-color: #effbff;\n }\n\n .tr-delete {\n text-align: center;\n }\n }\n\n tfoot {\n td {\n small {\n color: $warning;\n vertical-align: middle;\n }\n\n pn-icon {\n margin-right: 0.25em;\n vertical-align: middle;\n }\n }\n }\n }\n}\n","import { Component, Prop, h, Element, State, Host, Watch, Event, EventEmitter } from '@stencil/core';\nimport { FormValue, RowValue, Root } from './types';\nimport debounce from 'debounce';\n\n@Component({\n tag: 'pn-dropdown-choice-adds-row',\n styleUrl: 'pn-dropdown-choice-adds-row.scss',\n})\nexport class pnDropdownChoiceAddsRow {\n @Element() hostElement: Element;\n pnRowSelectDropdown: HTMLElement = null;\n tableHead: HTMLElement = null;\n tableBody: HTMLElement = null;\n private _dropdownData: Root[];\n\n @Prop() dropdownData: string | Root[] = null;\n @Prop() languageCode: string = null;\n @Prop() addRowDropdownName: string = '';\n @Prop() addRowDropdownPlaceholder: string = '';\n @Prop() addRowDropdownLabel: string = '';\n @Prop() rowNameLabel: string = '';\n @Prop() rowHasDropdown: boolean = true;\n @Prop() rowDropdownLabel: string = '';\n @Prop() rowDropdownPlaceholder: string = '';\n @Prop() rowInputLabel: string = '';\n @Prop() rowDeleteButtonText: string = '';\n @Prop() totalInputLimit: number = 0;\n @Prop() inputLimitWarning: string = null;\n @Prop() inputEmptyWarning: string = null;\n @Prop() dropdownEmptyWarning: string = null;\n\n @State() nextRowIndex: number = null;\n @State() rowSelectDropdownArr: string[] = null;\n @State() formValue: string = null;\n\n @Event() rowvalues: EventEmitter<string>;\n\n @Watch('dropdownData')\n dropdownDataWatcher() {\n if (typeof this.dropdownData === 'string') {\n this._dropdownData = JSON.parse(this.dropdownData);\n } else {\n this._dropdownData = this.dropdownData;\n }\n }\n\n componentWillLoad() {\n this.dropdownDataWatcher();\n }\n\n componentDidLoad() {\n this.setInitialValues();\n this.addEventHandlers();\n }\n\n addEventHandlers() {\n this.pnRowSelectDropdown.addEventListener('change', debounce(this.addRowElement.bind(this), 500));\n }\n\n setInitialValues() {\n this.nextRowIndex = 0;\n this.setRowSelectDropdownArr();\n }\n\n setRowSelectDropdownArr() {\n this.rowSelectDropdownArr = [];\n this._dropdownData.forEach(element => {\n this.rowSelectDropdownArr.push(element.label);\n });\n }\n\n formRowEvent = e => {\n const debouncedAddValue = debounce(this.updateHiddenFieldValue.bind(this), 500);\n\n if (e.target.matches('input')) {\n ['change', 'keyup'].forEach(eventName => {\n e.target.addEventListener(eventName, debouncedAddValue);\n });\n } else {\n const rowDropdown = e.target.closest('.generated-table-row')?.querySelector('pn-select') as HTMLElement;\n if (rowDropdown) {\n rowDropdown.addEventListener('change', debouncedAddValue);\n }\n }\n };\n\n updateHiddenFieldValue() {\n try {\n const allRows = [...this.tableBody.querySelectorAll('.generated-table-row')];\n const mainDropdown = this.hostElement.querySelector('.pn-row-select-dropdown');\n\n if (!mainDropdown) {\n return;\n }\n\n if (!allRows.length) {\n mainDropdown.setAttribute('error', `${this.dropdownEmptyWarning || \"This field cannot be empty\"}`);\n this.formValue = '';\n this.rowvalues.emit('');\n return;\n }\n\n const formValues = allRows.map(row => {\n const nameElm = row.querySelector('.tr-name');\n const dropdownElm = row.querySelector('.tr-dropdown');\n const inputElm = row.querySelector('.tr-input');\n\n if (!nameElm || !inputElm) {\n throw new Error('Required elements missing from row');\n }\n\n const rowData = {\n row: [\n {\n name: this.rowNameLabel,\n value: nameElm.innerHTML\n }\n ]\n };\n\n if (dropdownElm) {\n const pnSelect = dropdownElm.querySelector('pn-select');\n const nativeSelect = pnSelect?.querySelector('select');\n const dropdownSelection = nativeSelect?.value || '';\n if (dropdownSelection) {\n rowData.row.push({\n name: this.rowDropdownLabel,\n value: dropdownSelection\n });\n }\n }\n\n const input = inputElm.querySelector('input');\n const inputValue = parseInt(input?.value || '0', 10);\n if (inputValue > 0) {\n rowData.row.push({\n name: this.rowInputLabel,\n value: inputValue.toString()\n });\n }\n return rowData;\n });\n\n if (!formValues.length || formValues.length !== allRows.length) {\n this.formValue = '';\n return;\n }\n\n this.formValue = `PN-JSON|${JSON.stringify(formValues)}`;\n\n if (this.validateInputs()) {\n this.rowvalues.emit(this.formValue);\n return;\n }\n\n } catch (error) {\n console.error('Error updating field value: ', error);\n this.formValue = '';\n }\n }\n\n addRowElement(e: CustomEvent) {\n const selectedElement = e.target as HTMLSelectElement;\n const selectedValue = selectedElement?.value;\n\n if (!selectedValue) {\n return;\n }\n\n const mainDropdown = this.hostElement.querySelector('.pn-row-select-dropdown');\n mainDropdown?.removeAttribute('error');\n\n if (!this.tableBody) {\n console.error('tableBody is not defined.');\n return;\n }\n\n const newRow = document.createElement('div');\n newRow.setAttribute('index', `${this.nextRowIndex}`);\n newRow.className = 'generated-table-row';\n newRow.onclick = e => this.formRowEvent(e);\n\n const rowNameColumn = document.createElement('div');\n rowNameColumn.className = 'tr-name';\n rowNameColumn.innerHTML = selectedValue;\n rowNameColumn.dataset.name = selectedValue;\n newRow.appendChild(rowNameColumn);\n\n const selectedR = this._dropdownData?.find(item => item.label === selectedValue);\n\n if (selectedR?.values?.length) {\n this.rowHasDropdown = true;\n const dropdownCol = this.createDropdownColumn(selectedValue);\n newRow.appendChild(dropdownCol);\n } else {\n this.rowHasDropdown = false;\n const emptyDropdownCol = document.createElement('div');\n emptyDropdownCol.className = 'tr-column';\n newRow.appendChild(emptyDropdownCol);\n }\n\n const rowInputColumn = this.createInputColumn(selectedValue);\n newRow.appendChild(rowInputColumn);\n\n const deleteButton = this.createDeleteButtonColumn();\n newRow.appendChild(deleteButton);\n\n this.tableBody.appendChild(newRow);\n\n this.updateRowSelectDropdown();\n this.nextRowIndex++;\n }\n\n getCurrentRow(selectedValue: string) {\n return this.hostElement.querySelectorAll(`.tr-name[data-name='${selectedValue}'`);\n }\n\n createDropdownColumn(selectedValue: string) {\n const dropdownColumn = document.createElement('div');\n dropdownColumn.setAttribute('class', 'tr-dropdown');\n const selectedItem = this._dropdownData.find(arr => arr.label === selectedValue);\n const selectedOptionValues = [];\n const currentRow = this.getCurrentRow(selectedValue);\n\n currentRow.forEach(row => {\n selectedOptionValues.push(row.parentElement?.querySelector('.tr-dropdown [aria-selected=true]')?.textContent);\n });\n\n if (selectedItem.values.length) {\n const dropdown = document.createElement('pn-select');\n dropdown.setAttribute('name', `${selectedValue}-dropdown`);\n dropdown.setAttribute('placeholder', this.rowDropdownPlaceholder);\n dropdown.setAttribute('required', 'true');\n dropdown.setAttribute('error', '');\n\n const placeholder = document.createElement('option');\n placeholder.setAttribute(\"value\", \"\");\n placeholder.textContent = this.rowDropdownPlaceholder;\n placeholder.selected = true;\n placeholder.disabled = true;\n dropdown.appendChild(placeholder);\n\n selectedItem.values.forEach(childItem => {\n const childOption = document.createElement('option');\n childOption.setAttribute(\"label\", childItem.label);\n childOption.setAttribute(\"value\", childItem.label);\n childOption.textContent = childItem.label;\n dropdown.appendChild(childOption);\n });\n\n dropdownColumn.appendChild(dropdown);\n }\n\n return dropdownColumn;\n }\n\n createInputColumn(selectedValue: string) {\n const inputColumn = document.createElement('div');\n inputColumn.setAttribute('class', 'tr-input');\n const inputElm = document.createElement('pn-input');\n inputElm.setAttribute('type', 'number');\n inputElm.setAttribute('name', `${selectedValue}-input`);\n inputElm.setAttribute('placeholder', '0');\n if (this.totalInputLimit > 0) {\n inputElm.setAttribute('max', `${this.totalInputLimit}`);\n }\n inputElm.setAttribute('min', '0');\n inputElm.setAttribute('error', '');\n inputColumn.appendChild(inputElm);\n return inputColumn;\n }\n\n createDeleteButtonColumn() {\n const buttonColumn = document.createElement('div');\n buttonColumn.setAttribute('class', 'tr-delete');\n const buttonElm = document.createElement('pn-button');\n buttonElm.onclick = e => this.deleteRow(e);\n buttonElm.setAttribute('appearance', 'warning');\n buttonElm.setAttribute('small', 'true');\n buttonElm.appendChild(document.createTextNode(this.rowDeleteButtonText));\n buttonColumn.appendChild(buttonElm);\n return buttonColumn;\n }\n\n updateRowSelectDropdown() {\n type Row = { rowName: string; selectedValue: string; placeholder: string };\n\n const rows: Row[] = [].map.call(this.tableBody.querySelectorAll('.tr-name'), el => {\n const dropdownColumn = el?.parentElement?.querySelector('.tr-dropdown');\n const dropdownPlaceholder = dropdownColumn?.querySelector('.pn-select-content span')?.textContent;\n const row: Row = {\n rowName: el?.innerHTML,\n selectedValue: dropdownColumn?.querySelector('[aria-selected=true]')?.textContent,\n placeholder: dropdownPlaceholder,\n };\n return row;\n });\n\n const selectOptions = this.pnRowSelectDropdown.querySelectorAll('option');\n selectOptions.forEach(elm => {\n elm.removeAttribute('selected');\n });\n }\n\n deleteRow(e: Event) {\n e.preventDefault();\n this.nextRowIndex--;\n const targetElm = e.currentTarget as HTMLButtonElement;\n const targetRow = targetElm.closest('.generated-table-row');\n targetRow.remove();\n const allRows = [...this.tableBody.querySelectorAll('.generated-table-row')];\n\n allRows.map((elm, index) => {\n elm.setAttribute('index', `${index}`);\n });\n this.updateHiddenFieldValue()\n this.updateRowSelectDropdown();\n }\n\n validateInputs() {\n const dropdownSelections = this.tableBody.querySelectorAll('pn-select');\n const numberInputs = this.tableBody.querySelectorAll('pn-input');\n let selectionEmpty = false;\n let showWarning = false;\n\n if (dropdownSelections) {\n dropdownSelections.forEach(dropdownElem => {\n if (!dropdownElem) {\n return;\n }\n\n const selection = dropdownElem.querySelector('select');\n const dropdownVal = selection?.value || '';\n\n if (dropdownVal === null || dropdownVal === \"\") {\n dropdownElem.setAttribute('error', `${this.dropdownEmptyWarning || \"This field cannot be empty\"}`);\n selectionEmpty = true;\n } else {\n dropdownElem.setAttribute('error', '');\n }\n });\n }\n\n if (numberInputs) {\n numberInputs.forEach(inputElem => {\n if (inputElem) {\n const currentNumber = inputElem.querySelector(\"input\");\n let currentValue = parseInt(currentNumber.value);\n\n if (this.totalInputLimit < currentValue && inputElem.hasAttribute('max')) {\n inputElem.setAttribute('error', `${this.inputLimitWarning || \"Amount too high\"}`);\n showWarning = true;\n } else if (currentValue <= 0 || isNaN(currentValue)) {\n inputElem.setAttribute('error', `${this.inputEmptyWarning || \"This field cannot be empty\"}`);\n showWarning = true;\n } else {\n inputElem.setAttribute('error', '');\n showWarning = false;\n }\n }\n });\n }\n\n if (selectionEmpty || showWarning) {\n return false;\n }\n\n return true;\n }\n\n render() {\n return (\n <Host>\n <div class=\"dropdown-choice-form-row\">\n <pn-select\n ref={el => (this.pnRowSelectDropdown = el as HTMLElement)}\n name={this.addRowDropdownName}\n label={this.addRowDropdownLabel}\n class=\"pn-row-select-dropdown\"\n language={this.languageCode}>\n <option value=\"\" selected disabled>{this.addRowDropdownPlaceholder}</option>\n {this.rowSelectDropdownArr?.map((value: string) => <option label={value} value={value}>{value}</option>)}\n </pn-select>\n </div>\n <div class=\"dropdown-choice-form-row\">\n <div class=\"pn-dropdown-choice-table\">\n <div ref={el => (this.tableHead = el as HTMLElement)}>\n {this.nextRowIndex === 0 ? null : (\n <div class=\"table-header\">\n <div class=\"table-header-name\">\n <label>{this.rowNameLabel}</label>\n </div>\n <div class=\"table-header-dropdown\">\n <label>{this.rowDropdownLabel}</label>\n </div>\n <div class=\"table-header-input\">\n <label>{this.rowInputLabel}</label>\n </div>\n <div class=\"table-header-delete\"></div>\n </div>\n )}\n </div>\n <div ref={el => (this.tableBody = el as HTMLElement)} class=\"pn-dropdown-choice-table-slot\">\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pn-dropdown-choice-adds-row.js","mappings":";;;AAAA,MAAM,0BAA0B,GAAG,ytFAAytF,CAAC;AAC7vF,sCAAe,0BAA0B;;MCO5B,uBAAuB;;;;;4BAOM,IAAI;4BACb,IAAI;kCACE,EAAE;yCACK,EAAE;mCACR,EAAE;4BACT,EAAE;8BACC,IAAI;gCACH,EAAE;sCACI,EAAE;6BACX,EAAE;mCACI,EAAE;+BACN,CAAC;iCACC,IAAI;iCACJ,IAAI;oCACD,IAAI;4BAEX,IAAI;oCACM,IAAI;yBACjB,IAAI;;;IAvBjC,mBAAmB,GAAgB,IAAI,CAAC;IACxC,SAAS,GAAgB,IAAI,CAAC;IAC9B,SAAS,GAAgB,IAAI,CAAC;IACtB,aAAa,CAAS;IAsBrB,SAAS,CAAuB;IAGzC,mBAAmB;QACjB,IAAI,OAAO,IAAI,CAAC,YAAY,KAAK,QAAQ,EAAE;YACzC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACpD;aAAM;YACL,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC;SACxC;KACF;IAED,iBAAiB;QACf,IAAI,CAAC,mBAAmB,EAAE,CAAC;KAC5B;IAED,gB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E,KAAK,EAAE,KAAK,EAAE,KAAK,IAAG,KAAK,CAAU,CAAC,CAC9F,CACR,EACN,4DAAK,KAAK,EAAC,0BAA0B,IACnC,4DAAK,KAAK,EAAC,0BAA0B,IACnC,4DAAK,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,SAAS,GAAG,EAAiB,CAAC,IACjD,IAAI,CAAC,YAAY,KAAK,CAAC,GAAG,IAAI,IAC7B,WAAK,KAAK,EAAC,cAAc,IACvB,WAAK,KAAK,EAAC,mBAAmB,IAC5B,iBAAQ,IAAI,CAAC,YAAY,CAAS,CAC9B,EACN,WAAK,KAAK,EAAC,uBAAuB,IAChC,iBAAQ,IAAI,CAAC,gBAAgB,CAAS,CAClC,EACN,WAAK,KAAK,EAAC,oBAAoB,IAC7B,iBAAQ,IAAI,CAAC,aAAa,CAAS,CAC/B,EACN,WAAK,KAAK,EAAC,qBAAqB,GAAO,CACnC,CACP,CACG,EACN,4DAAK,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,SAAS,GAAG,EAAiB,CAAC,EAAE,KAAK,EAAC,+BAA+B,IACzF,8DAAa,CACT,CACF,CACF,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.scss?tag=pn-dropdown-choice-adds-row","src/components/input/pn-dropdown-choice-adds-row/pn-dropdown-choice-adds-row.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n\npn-dropdown-choice-adds-row {\n display: block;\n width: 80rem;\n\n .pn-row-select-dropdown {\n width: 50%;\n margin-bottom: 1rem;\n }\n\n @media only screen and (max-width: 640px) {\n .pn-row-select-dropdown {\n width: 100%;\n }\n }\n\n .pn-dropdown-choice-table {\n width: 100%;\n border-spacing: 0rem;\n border: none !important;\n\n thead {\n th {\n text-align: left;\n padding: 1rem 0.5rem;\n\n label {\n color: $gray700;\n font-size: 1.4rem;\n font-weight: 400;\n }\n }\n }\n \n .generated-table-row {\n display: flex;\n margin-bottom: 2rem;\n }\n\n .table-header {\n display: flex;\n margin: 2rem 0 3rem 0;\n font-weight: 500;\n }\n\n .table-header, .tr {\n &-dropdown, &-column, &-name {\n padding-right: 0.5rem;\n width: 35%;\n\n pn-select {\n width: 95%;\n }\n }\n\n &-input {\n width: 15%;\n\n pn-input {\n width: 100%;\n }\n }\n\n &-delete {\n margin: 1rem;\n width: 15%;\n }\n }\n\n tbody {\n td {\n padding: 0.5rem;\n }\n\n tr:nth-child(even) {\n background-color: #effbff;\n }\n\n .tr-delete {\n text-align: center;\n }\n }\n\n tfoot {\n td {\n small {\n color: $warning;\n vertical-align: middle;\n }\n\n pn-icon {\n margin-right: 0.25em;\n vertical-align: middle;\n }\n }\n }\n }\n}\n","import { Component, Prop, h, Element, State, Host, Watch, Event, EventEmitter } from '@stencil/core';\nimport { FormValue, RowValue, Root } from './types';\nimport debounce from 'debounce';\n\n@Component({\n tag: 'pn-dropdown-choice-adds-row',\n styleUrl: 'pn-dropdown-choice-adds-row.scss',\n})\nexport class pnDropdownChoiceAddsRow {\n @Element() hostElement: Element;\n pnRowSelectDropdown: HTMLElement = null;\n tableHead: HTMLElement = null;\n tableBody: HTMLElement = null;\n private _dropdownData: Root[];\n\n @Prop() dropdownData: string | Root[] = null;\n @Prop() languageCode: string = null;\n @Prop() addRowDropdownName: string = '';\n @Prop() addRowDropdownPlaceholder: string = '';\n @Prop() addRowDropdownLabel: string = '';\n @Prop() rowNameLabel: string = '';\n @Prop() rowHasDropdown: boolean = true;\n @Prop() rowDropdownLabel: string = '';\n @Prop() rowDropdownPlaceholder: string = '';\n @Prop() rowInputLabel: string = '';\n @Prop() rowDeleteButtonText: string = '';\n @Prop() totalInputLimit: number = 0;\n @Prop() inputLimitWarning: string = null;\n @Prop() inputEmptyWarning: string = null;\n @Prop() dropdownEmptyWarning: string = null;\n\n @State() nextRowIndex: number = null;\n @State() rowSelectDropdownArr: string[] = null;\n @State() formValue: string = null;\n\n @Event() rowvalues: EventEmitter<string>;\n\n @Watch('dropdownData')\n dropdownDataWatcher() {\n if (typeof this.dropdownData === 'string') {\n this._dropdownData = JSON.parse(this.dropdownData);\n } else {\n this._dropdownData = this.dropdownData;\n }\n }\n\n componentWillLoad() {\n this.dropdownDataWatcher();\n }\n\n componentDidLoad() {\n this.setInitialValues();\n this.addEventHandlers();\n }\n\n addEventHandlers() {\n this.pnRowSelectDropdown.addEventListener('change', debounce(this.addRowElement.bind(this), 500));\n }\n\n setInitialValues() {\n this.nextRowIndex = 0;\n this.setRowSelectDropdownArr();\n }\n\n setRowSelectDropdownArr() {\n this.rowSelectDropdownArr = [];\n this._dropdownData.forEach(element => {\n this.rowSelectDropdownArr.push(element.label);\n });\n }\n\n formRowEvent = e => {\n const debouncedAddValue = debounce(this.updateHiddenFieldValue.bind(this), 500);\n\n if (e.target.matches('input')) {\n ['change', 'keyup'].forEach(eventName => {\n e.target.addEventListener(eventName, debouncedAddValue);\n });\n } else {\n const rowDropdown = e.target.closest('.generated-table-row')?.querySelector('pn-select') as HTMLElement;\n if (rowDropdown) {\n rowDropdown.addEventListener('change', debouncedAddValue);\n }\n }\n };\n\n updateHiddenFieldValue() {\n try {\n const allRows = [...this.tableBody.querySelectorAll('.generated-table-row')];\n const mainDropdown = this.hostElement.querySelector('.pn-row-select-dropdown');\n\n if (!mainDropdown) {\n return;\n }\n\n if (!allRows.length) {\n mainDropdown.setAttribute('error', `${this.dropdownEmptyWarning || \"This field cannot be empty\"}`);\n this.formValue = '';\n this.rowvalues.emit('');\n return;\n }\n\n let allRowsValid = true;\n const formValues = allRows.map(row => {\n const nameElm = row.querySelector('.tr-name');\n const dropdownElm = row.querySelector('.tr-dropdown');\n const inputElm = row.querySelector('.tr-input');\n\n if (!nameElm || !inputElm) {\n allRowsValid = false;\n return null;\n }\n\n const rowData = {\n row: [\n {\n name: this.rowNameLabel,\n value: nameElm.innerHTML\n }\n ]\n };\n\n if (dropdownElm && dropdownElm.querySelector('pn-select')) {\n const pnSelect = dropdownElm.querySelector('pn-select');\n const nativeSelect = pnSelect?.querySelector('select');\n const dropdownSelection = nativeSelect?.value || '';\n if (!dropdownSelection) {\n allRowsValid = false;\n } else {\n rowData.row.push({\n name: this.rowDropdownLabel,\n value: dropdownSelection\n });\n }\n }\n\n const input = inputElm.querySelector('input');\n const inputValue = parseInt(input?.value || '0', 10);\n if (inputValue > 0) {\n rowData.row.push({\n name: this.rowInputLabel,\n value: inputValue.toString()\n });\n } else {\n allRowsValid = false;\n }\n return rowData;\n });\n\n if (!allRowsValid || !formValues.length || formValues.includes(null)) {\n this.formValue = '';\n this.rowvalues.emit('');\n return;\n }\n\n this.formValue = `PN-JSON|${JSON.stringify(formValues)}`;\n \n if (this.validateInputs()) {\n this.rowvalues.emit(this.formValue);\n } else {\n this.rowvalues.emit('');\n }\n\n } catch (error) {\n console.error('Error updating field value: ', error);\n this.formValue = '';\n }\n }\n\n addRowElement(e: CustomEvent) {\n const selectedElement = e.target as HTMLSelectElement;\n const selectedValue = selectedElement?.value;\n\n if (!selectedValue) {\n return;\n }\n\n const mainDropdown = this.hostElement.querySelector('.pn-row-select-dropdown');\n mainDropdown?.removeAttribute('error');\n\n if (!this.tableBody) {\n console.error('tableBody is not defined.');\n return;\n }\n\n const newRow = document.createElement('div');\n newRow.setAttribute('index', `${this.nextRowIndex}`);\n newRow.className = 'generated-table-row';\n newRow.onclick = e => this.formRowEvent(e);\n\n const rowNameColumn = document.createElement('div');\n rowNameColumn.className = 'tr-name';\n rowNameColumn.innerHTML = selectedValue;\n rowNameColumn.dataset.name = selectedValue;\n newRow.appendChild(rowNameColumn);\n\n const selectedR = this._dropdownData?.find(item => item.label === selectedValue);\n\n if (selectedR?.values?.length) {\n this.rowHasDropdown = true;\n const dropdownCol = this.createDropdownColumn(selectedValue);\n newRow.appendChild(dropdownCol);\n } else {\n this.rowHasDropdown = false;\n const emptyDropdownCol = document.createElement('div');\n emptyDropdownCol.className = 'tr-column';\n newRow.appendChild(emptyDropdownCol);\n }\n\n const rowInputColumn = this.createInputColumn(selectedValue);\n newRow.appendChild(rowInputColumn);\n\n const deleteButton = this.createDeleteButtonColumn();\n newRow.appendChild(deleteButton);\n\n this.tableBody.appendChild(newRow);\n\n this.updateRowSelectDropdown();\n this.nextRowIndex++;\n selectedElement.value = '';\n }\n\n getCurrentRow(selectedValue: string) {\n return this.hostElement.querySelectorAll(`.tr-name[data-name='${selectedValue}'`);\n }\n\n createDropdownColumn(selectedValue: string) {\n const dropdownColumn = document.createElement('div');\n dropdownColumn.setAttribute('class', 'tr-dropdown');\n const selectedItem = this._dropdownData.find(arr => arr.label === selectedValue);\n const selectedOptionValues = [];\n const currentRow = this.getCurrentRow(selectedValue);\n\n currentRow.forEach(row => {\n selectedOptionValues.push(row.parentElement?.querySelector('.tr-dropdown [aria-selected=true]')?.textContent);\n });\n\n if (selectedItem.values.length) {\n const dropdown = document.createElement('pn-select');\n dropdown.setAttribute('name', `${selectedValue}-dropdown`);\n dropdown.setAttribute('placeholder', this.rowDropdownPlaceholder);\n dropdown.setAttribute('required', 'true');\n dropdown.setAttribute('error', '');\n\n const placeholder = document.createElement('option');\n placeholder.setAttribute(\"value\", \"\");\n placeholder.textContent = this.rowDropdownPlaceholder;\n placeholder.selected = true;\n placeholder.disabled = true;\n dropdown.appendChild(placeholder);\n\n selectedItem.values.forEach(childItem => {\n const childOption = document.createElement('option');\n childOption.setAttribute(\"label\", childItem.label);\n childOption.setAttribute(\"value\", childItem.label);\n childOption.textContent = childItem.label;\n dropdown.appendChild(childOption);\n });\n\n dropdownColumn.appendChild(dropdown);\n }\n\n return dropdownColumn;\n }\n\n createInputColumn(selectedValue: string) {\n const inputColumn = document.createElement('div');\n inputColumn.setAttribute('class', 'tr-input');\n const inputElm = document.createElement('pn-input');\n inputElm.setAttribute('type', 'number');\n inputElm.setAttribute('name', `${selectedValue}-input`);\n inputElm.setAttribute('placeholder', '0');\n if (this.totalInputLimit > 0) {\n inputElm.setAttribute('max', `${this.totalInputLimit}`);\n }\n inputElm.setAttribute('min', '0');\n inputElm.setAttribute('error', '');\n inputColumn.appendChild(inputElm);\n return inputColumn;\n }\n\n createDeleteButtonColumn() {\n const buttonColumn = document.createElement('div');\n buttonColumn.setAttribute('class', 'tr-delete');\n const buttonElm = document.createElement('pn-button');\n buttonElm.onclick = e => this.deleteRow(e);\n buttonElm.setAttribute('appearance', 'warning');\n buttonElm.setAttribute('small', 'true');\n buttonElm.appendChild(document.createTextNode(this.rowDeleteButtonText));\n buttonColumn.appendChild(buttonElm);\n return buttonColumn;\n }\n\n updateRowSelectDropdown() {\n type Row = { rowName: string; selectedValue: string; placeholder: string };\n\n const rows: Row[] = [].map.call(this.tableBody.querySelectorAll('.tr-name'), el => {\n const dropdownColumn = el?.parentElement?.querySelector('.tr-dropdown');\n const dropdownPlaceholder = dropdownColumn?.querySelector('.pn-select-content span')?.textContent;\n const row: Row = {\n rowName: el?.innerHTML,\n selectedValue: dropdownColumn?.querySelector('[aria-selected=true]')?.textContent,\n placeholder: dropdownPlaceholder,\n };\n return row;\n });\n\n const selectOptions = this.pnRowSelectDropdown.querySelectorAll('option');\n selectOptions.forEach(elm => {\n elm.removeAttribute('selected');\n });\n }\n\n deleteRow(e: Event) {\n e.preventDefault();\n this.nextRowIndex--;\n const targetElm = e.currentTarget as HTMLButtonElement;\n const targetRow = targetElm.closest('.generated-table-row');\n targetRow.remove();\n const allRows = [...this.tableBody.querySelectorAll('.generated-table-row')];\n\n allRows.map((elm, index) => {\n elm.setAttribute('index', `${index}`);\n });\n this.updateHiddenFieldValue()\n this.updateRowSelectDropdown();\n }\n\n validateInputs() {\n const dropdownSelections = this.tableBody.querySelectorAll('pn-select');\n const numberInputs = this.tableBody.querySelectorAll('pn-input');\n let selectionEmpty = false;\n let showWarning = false;\n\n if (dropdownSelections) {\n dropdownSelections.forEach(dropdownElem => {\n if (!dropdownElem) {\n return;\n }\n\n const selection = dropdownElem.querySelector('select');\n const dropdownVal = selection?.value || '';\n\n if (dropdownVal === null || dropdownVal === \"\") {\n dropdownElem.setAttribute('error', `${this.dropdownEmptyWarning || \"This field cannot be empty\"}`);\n selectionEmpty = true;\n } else {\n dropdownElem.setAttribute('error', '');\n }\n });\n }\n\n if (numberInputs) {\n numberInputs.forEach(inputElem => {\n if (inputElem) {\n const currentNumber = inputElem.querySelector(\"input\");\n let currentValue = parseInt(currentNumber.value);\n\n if (this.totalInputLimit < currentValue && inputElem.hasAttribute('max')) {\n inputElem.setAttribute('error', `${this.inputLimitWarning || \"Amount too high\"}`);\n showWarning = true;\n } else if (currentValue <= 0 || isNaN(currentValue)) {\n inputElem.setAttribute('error', `${this.inputEmptyWarning || \"This field cannot be empty\"}`);\n showWarning = true;\n } else {\n inputElem.setAttribute('error', '');\n showWarning = false;\n }\n }\n });\n }\n\n if (selectionEmpty || showWarning) {\n return false;\n }\n\n return true;\n }\n\n render() {\n return (\n <Host>\n <div class=\"dropdown-choice-form-row\">\n <pn-select\n ref={el => (this.pnRowSelectDropdown = el as HTMLElement)}\n name={this.addRowDropdownName}\n label={this.addRowDropdownLabel}\n class=\"pn-row-select-dropdown\"\n language={this.languageCode}>\n <option value=\"\" selected disabled>{this.addRowDropdownPlaceholder}</option>\n {this.rowSelectDropdownArr?.map((value: string) => <option label={value} value={value}>{value}</option>)}\n </pn-select>\n </div>\n <div class=\"dropdown-choice-form-row\">\n <div class=\"pn-dropdown-choice-table\">\n <div ref={el => (this.tableHead = el as HTMLElement)}>\n {this.nextRowIndex === 0 ? null : (\n <div class=\"table-header\">\n <div class=\"table-header-name\">\n <label>{this.rowNameLabel}</label>\n </div>\n <div class=\"table-header-dropdown\">\n <label>{this.rowDropdownLabel}</label>\n </div>\n <div class=\"table-header-input\">\n <label>{this.rowInputLabel}</label>\n </div>\n <div class=\"table-header-delete\"></div>\n </div>\n )}\n </div>\n <div ref={el => (this.tableBody = el as HTMLElement)} class=\"pn-dropdown-choice-table-slot\">\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}