@oiz/stzh-components 3.8.0-beta1 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/dist/cjs/{app-globals-02553278.js → app-globals-0e887dd2.js} +2 -2
  2. package/dist/cjs/{app-globals-02553278.js.map → app-globals-0e887dd2.js.map} +1 -1
  3. package/dist/cjs/{axios-69bcb71f.js → axios-bd44344d.js} +51 -96
  4. package/dist/cjs/axios-bd44344d.js.map +1 -0
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/stzh-accordion_3.cjs.entry.js +2 -7
  7. package/dist/cjs/stzh-accordion_3.cjs.entry.js.map +1 -1
  8. package/dist/cjs/stzh-badge_3.cjs.entry.js +1 -1
  9. package/dist/cjs/stzh-badge_3.cjs.entry.js.map +1 -1
  10. package/dist/cjs/stzh-bathstatus-list.cjs.entry.js +1 -1
  11. package/dist/cjs/stzh-checkboxgroup.cjs.entry.js +12 -11
  12. package/dist/cjs/stzh-checkboxgroup.cjs.entry.js.map +1 -1
  13. package/dist/cjs/stzh-chipselect.cjs.entry.js +1 -1
  14. package/dist/cjs/stzh-chipselect.cjs.entry.js.map +1 -1
  15. package/dist/cjs/stzh-components.cjs.js +2 -2
  16. package/dist/cjs/stzh-contact.cjs.entry.js +2 -8
  17. package/dist/cjs/stzh-contact.cjs.entry.js.map +1 -1
  18. package/dist/cjs/stzh-datalist_2.cjs.entry.js +1 -1
  19. package/dist/cjs/stzh-datalist_2.cjs.entry.js.map +1 -1
  20. package/dist/cjs/stzh-dialog.cjs.entry.js +1 -1
  21. package/dist/cjs/stzh-dialog.cjs.entry.js.map +1 -1
  22. package/dist/cjs/stzh-dropdown.cjs.entry.js +1 -1
  23. package/dist/cjs/stzh-dropdown.cjs.entry.js.map +1 -1
  24. package/dist/cjs/stzh-eventdata.cjs.entry.js +1 -1
  25. package/dist/cjs/stzh-eventdata.cjs.entry.js.map +1 -1
  26. package/dist/cjs/stzh-microsite-teaserlist.cjs.entry.js +3 -2
  27. package/dist/cjs/stzh-microsite-teaserlist.cjs.entry.js.map +1 -1
  28. package/dist/cjs/stzh-poilist.cjs.entry.js +1 -1
  29. package/dist/cjs/stzh-progressbar.cjs.entry.js +23 -0
  30. package/dist/cjs/stzh-progressbar.cjs.entry.js.map +1 -1
  31. package/dist/cjs/stzh-search.cjs.entry.js +2 -2
  32. package/dist/cjs/stzh-search.cjs.entry.js.map +1 -1
  33. package/dist/cjs/stzh-upload.cjs.entry.js +23 -10
  34. package/dist/cjs/stzh-upload.cjs.entry.js.map +1 -1
  35. package/dist/cjs/stzh-vbz-majorticker.cjs.entry.js +1 -1
  36. package/dist/cjs/stzh-vbz-ticker.cjs.entry.js +1 -1
  37. package/dist/collection/assets/i18n/de.json +9 -5
  38. package/dist/collection/assets/i18n/en.json +9 -5
  39. package/dist/collection/components/stzh-accordion/stzh-accordion.e2e.js +1 -0
  40. package/dist/collection/components/stzh-accordion/stzh-accordion.e2e.js.map +1 -1
  41. package/dist/collection/components/stzh-accordion/stzh-accordion.stories.js +86 -0
  42. package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.js +2 -7
  43. package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.js.map +1 -1
  44. package/dist/collection/components/stzh-button/stzh-button.css +13 -4
  45. package/dist/collection/components/stzh-button/stzh-button.e2e.js +6 -3
  46. package/dist/collection/components/stzh-button/stzh-button.e2e.js.map +1 -1
  47. package/dist/collection/components/stzh-button/stzh-button.stories.js +191 -15
  48. package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.js +31 -14
  49. package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.js.map +1 -1
  50. package/dist/collection/components/stzh-chip/stzh-chip.stories.js +11 -0
  51. package/dist/collection/components/stzh-chipselect/stzh-chipselect.css +1 -6
  52. package/dist/collection/components/stzh-contact/stzh-contact.css +11 -0
  53. package/dist/collection/components/stzh-contact/stzh-contact.js +1 -7
  54. package/dist/collection/components/stzh-contact/stzh-contact.js.map +1 -1
  55. package/dist/collection/components/stzh-datalist/stzh-datalist.e2e.js +1 -0
  56. package/dist/collection/components/stzh-datalist/stzh-datalist.e2e.js.map +1 -1
  57. package/dist/collection/components/stzh-datalist/stzh-datalist.stories.js +32 -0
  58. package/dist/collection/components/stzh-datalist-item/stzh-datalist-item.css +2 -1
  59. package/dist/collection/components/stzh-datepicker/stzh-datepicker.stories.js +1 -1
  60. package/dist/collection/components/stzh-dialog/stzh-dialog.css +2 -1
  61. package/dist/collection/components/stzh-dropdown/stzh-dropdown.css +8 -1
  62. package/dist/collection/components/stzh-dropdown/stzh-dropdown.stories.js +107 -5
  63. package/dist/collection/components/stzh-eventdata/stzh-eventdata.css +0 -5
  64. package/dist/collection/components/stzh-input/stzh-input.stories.js +1 -1
  65. package/dist/collection/components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.js +3 -2
  66. package/dist/collection/components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.js.map +1 -1
  67. package/dist/collection/components/stzh-progressbar/stzh-progressbar.js +27 -2
  68. package/dist/collection/components/stzh-progressbar/stzh-progressbar.js.map +1 -1
  69. package/dist/collection/components/stzh-search/stzh-search.js +1 -1
  70. package/dist/collection/components/stzh-search/stzh-search.js.map +1 -1
  71. package/dist/collection/components/stzh-search/stzh-search.stories.js +51 -83
  72. package/dist/collection/components/stzh-skiplink/stzh-skiplink.stories.js +0 -1
  73. package/dist/collection/components/stzh-upload/models/stzh-photographing-url-details.dto.js.map +1 -1
  74. package/dist/collection/components/stzh-upload/stzh-upload.css +5 -0
  75. package/dist/collection/components/stzh-upload/stzh-upload.js +26 -10
  76. package/dist/collection/components/stzh-upload/stzh-upload.js.map +1 -1
  77. package/dist/collection/components/stzh-upload/stzh-upload.localization.js.map +1 -1
  78. package/dist/collection/components/stzh-upload/stzh-upload.stories.js +3 -1
  79. package/dist/components/index.js +1 -1
  80. package/dist/components/{p-ed75de26.js → p-16940157.js} +3 -3
  81. package/dist/components/{p-ed75de26.js.map → p-16940157.js.map} +1 -1
  82. package/dist/components/{p-2fe2c81f.js → p-1d21ac10.js} +3 -3
  83. package/dist/components/{p-2fe2c81f.js.map → p-1d21ac10.js.map} +1 -1
  84. package/dist/components/{p-16892790.js → p-345a1e99.js} +51 -96
  85. package/dist/components/p-345a1e99.js.map +1 -0
  86. package/dist/components/{p-3aefa2e3.js → p-37367a31.js} +5 -5
  87. package/dist/components/{p-3aefa2e3.js.map → p-37367a31.js.map} +1 -1
  88. package/dist/components/{p-74755a90.js → p-408a1562.js} +2 -2
  89. package/dist/components/{p-74755a90.js.map → p-408a1562.js.map} +1 -1
  90. package/dist/components/{p-7e9f4f9f.js → p-497e2db0.js} +2 -2
  91. package/dist/components/{p-7e9f4f9f.js.map → p-497e2db0.js.map} +1 -1
  92. package/dist/components/p-4d000b5b.js +265 -0
  93. package/dist/components/p-4d000b5b.js.map +1 -0
  94. package/dist/components/{p-866cf184.js → p-4e5ccabd.js} +2 -2
  95. package/dist/components/{p-866cf184.js.map → p-4e5ccabd.js.map} +1 -1
  96. package/dist/components/{p-bd7d15a6.js → p-541e8c61.js} +2 -2
  97. package/dist/components/{p-bd7d15a6.js.map → p-541e8c61.js.map} +1 -1
  98. package/dist/components/{p-d4aabf9c.js → p-60b9f94a.js} +3 -3
  99. package/dist/components/p-60b9f94a.js.map +1 -0
  100. package/dist/components/{p-82c163e4.js → p-62e6cd61.js} +3 -3
  101. package/dist/components/{p-82c163e4.js.map → p-62e6cd61.js.map} +1 -1
  102. package/dist/components/{p-13c3319c.js → p-6956beb9.js} +2 -2
  103. package/dist/components/{p-13c3319c.js.map → p-6956beb9.js.map} +1 -1
  104. package/dist/components/{p-2a870524.js → p-6c754f8f.js} +3 -8
  105. package/dist/components/p-6c754f8f.js.map +1 -0
  106. package/dist/components/{p-9b0832ca.js → p-70f62e8e.js} +3 -3
  107. package/dist/components/{p-9b0832ca.js.map → p-70f62e8e.js.map} +1 -1
  108. package/dist/components/{p-c9ddf923.js → p-8ed7a61b.js} +2 -2
  109. package/dist/components/{p-c9ddf923.js.map → p-8ed7a61b.js.map} +1 -1
  110. package/dist/components/{p-3890d846.js → p-96416f66.js} +3 -3
  111. package/dist/components/p-96416f66.js.map +1 -0
  112. package/dist/components/{p-435e0ef4.js → p-c73125e2.js} +3 -3
  113. package/dist/components/{p-435e0ef4.js.map → p-c73125e2.js.map} +1 -1
  114. package/dist/components/{p-d1623b2e.js → p-dd072a49.js} +2 -2
  115. package/dist/components/{p-d1623b2e.js.map → p-dd072a49.js.map} +1 -1
  116. package/dist/components/{p-4039ba55.js → p-e5edc56d.js} +2 -2
  117. package/dist/components/{p-4039ba55.js.map → p-e5edc56d.js.map} +1 -1
  118. package/dist/components/{p-e0e4416e.js → p-ebbe78de.js} +2 -2
  119. package/dist/components/p-ebbe78de.js.map +1 -0
  120. package/dist/components/{p-e197115b.js → p-fa14b406.js} +2 -2
  121. package/dist/components/{p-e197115b.js.map → p-fa14b406.js.map} +1 -1
  122. package/dist/components/stzh-accordion-item.js +1 -1
  123. package/dist/components/stzh-actionset.js +1 -1
  124. package/dist/components/stzh-amount.js +3 -3
  125. package/dist/components/stzh-appointments.js +5 -5
  126. package/dist/components/stzh-archivelist.js +1 -1
  127. package/dist/components/stzh-banner.js +1 -1
  128. package/dist/components/stzh-bathstatus-list.js +1 -1
  129. package/dist/components/stzh-button.js +1 -1
  130. package/dist/components/stzh-calendar.js +1 -1
  131. package/dist/components/stzh-card-searchresult.js +3 -3
  132. package/dist/components/stzh-card-superteaser.js +3 -3
  133. package/dist/components/stzh-card.js +1 -1
  134. package/dist/components/stzh-checkboxgroup.js +13 -12
  135. package/dist/components/stzh-checkboxgroup.js.map +1 -1
  136. package/dist/components/stzh-chipselect.js +1 -1
  137. package/dist/components/stzh-contact.js +2 -8
  138. package/dist/components/stzh-contact.js.map +1 -1
  139. package/dist/components/stzh-datalist-item.js +1 -1
  140. package/dist/components/stzh-datalist.js +1 -1
  141. package/dist/components/stzh-datamessagelist-item.js +1 -1
  142. package/dist/components/stzh-datatable.js +7 -7
  143. package/dist/components/stzh-datepicker.js +1 -1
  144. package/dist/components/stzh-dialog.js +1 -1
  145. package/dist/components/stzh-disturber.js +1 -1
  146. package/dist/components/stzh-dropdown.js +1 -1
  147. package/dist/components/stzh-eventdata.js +1 -1
  148. package/dist/components/stzh-eventdata.js.map +1 -1
  149. package/dist/components/stzh-feedreader.js +2 -2
  150. package/dist/components/stzh-gallery.js +1 -1
  151. package/dist/components/stzh-geo-ref-data.js +6 -6
  152. package/dist/components/stzh-ghettobox.js +1 -1
  153. package/dist/components/stzh-header.js +1 -1
  154. package/dist/components/stzh-http-error.js +1 -1
  155. package/dist/components/stzh-iframe.js +1 -1
  156. package/dist/components/stzh-input.js +1 -1
  157. package/dist/components/stzh-message.js +1 -1
  158. package/dist/components/stzh-microsite-teaserlist.js +7 -6
  159. package/dist/components/stzh-microsite-teaserlist.js.map +1 -1
  160. package/dist/components/stzh-monthyearpicker.js +1 -1
  161. package/dist/components/stzh-offline-indicator.js +3 -3
  162. package/dist/components/stzh-pagebottom.js +2 -2
  163. package/dist/components/stzh-pagination.js +1 -1
  164. package/dist/components/stzh-panorama.js +2 -2
  165. package/dist/components/stzh-poilist.js +4 -4
  166. package/dist/components/stzh-progressbar.js +26 -2
  167. package/dist/components/stzh-progressbar.js.map +1 -1
  168. package/dist/components/stzh-readspeaker.js +1 -1
  169. package/dist/components/stzh-saptcha.js +2 -2
  170. package/dist/components/stzh-search.js +6 -6
  171. package/dist/components/stzh-search.js.map +1 -1
  172. package/dist/components/stzh-share.js +1 -1
  173. package/dist/components/stzh-sitemap.js +3 -3
  174. package/dist/components/stzh-timepicker.js +1 -1
  175. package/dist/components/stzh-toast.js +1 -1
  176. package/dist/components/stzh-toastbar.js +1 -1
  177. package/dist/components/stzh-upload.js +31 -15
  178. package/dist/components/stzh-upload.js.map +1 -1
  179. package/dist/components/stzh-vbz-majorticker.js +3 -3
  180. package/dist/components/stzh-vbz-ticker.js +1 -1
  181. package/dist/components/stzh-youtube.js +2 -2
  182. package/dist/esm/{app-globals-30dc1fec.js → app-globals-1e3146bc.js} +2 -2
  183. package/dist/esm/{app-globals-30dc1fec.js.map → app-globals-1e3146bc.js.map} +1 -1
  184. package/dist/esm/{axios-e0a35239.js → axios-0cc95004.js} +51 -96
  185. package/dist/esm/axios-0cc95004.js.map +1 -0
  186. package/dist/esm/loader.js +2 -2
  187. package/dist/esm/stzh-accordion_3.entry.js +2 -7
  188. package/dist/esm/stzh-accordion_3.entry.js.map +1 -1
  189. package/dist/esm/stzh-badge_3.entry.js +1 -1
  190. package/dist/esm/stzh-badge_3.entry.js.map +1 -1
  191. package/dist/esm/stzh-bathstatus-list.entry.js +1 -1
  192. package/dist/esm/stzh-checkboxgroup.entry.js +12 -11
  193. package/dist/esm/stzh-checkboxgroup.entry.js.map +1 -1
  194. package/dist/esm/stzh-chipselect.entry.js +1 -1
  195. package/dist/esm/stzh-chipselect.entry.js.map +1 -1
  196. package/dist/esm/stzh-components.js +2 -2
  197. package/dist/esm/stzh-contact.entry.js +2 -8
  198. package/dist/esm/stzh-contact.entry.js.map +1 -1
  199. package/dist/esm/stzh-datalist_2.entry.js +1 -1
  200. package/dist/esm/stzh-datalist_2.entry.js.map +1 -1
  201. package/dist/esm/stzh-dialog.entry.js +1 -1
  202. package/dist/esm/stzh-dialog.entry.js.map +1 -1
  203. package/dist/esm/stzh-dropdown.entry.js +1 -1
  204. package/dist/esm/stzh-dropdown.entry.js.map +1 -1
  205. package/dist/esm/stzh-eventdata.entry.js +1 -1
  206. package/dist/esm/stzh-eventdata.entry.js.map +1 -1
  207. package/dist/esm/stzh-microsite-teaserlist.entry.js +3 -2
  208. package/dist/esm/stzh-microsite-teaserlist.entry.js.map +1 -1
  209. package/dist/esm/stzh-poilist.entry.js +1 -1
  210. package/dist/esm/stzh-progressbar.entry.js +24 -1
  211. package/dist/esm/stzh-progressbar.entry.js.map +1 -1
  212. package/dist/esm/stzh-search.entry.js +2 -2
  213. package/dist/esm/stzh-search.entry.js.map +1 -1
  214. package/dist/esm/stzh-upload.entry.js +23 -10
  215. package/dist/esm/stzh-upload.entry.js.map +1 -1
  216. package/dist/esm/stzh-vbz-majorticker.entry.js +1 -1
  217. package/dist/esm/stzh-vbz-ticker.entry.js +1 -1
  218. package/dist/stzh-components/assets/i18n/de.json +9 -5
  219. package/dist/stzh-components/assets/i18n/en.json +9 -5
  220. package/dist/stzh-components/p-129faf7d.entry.js +2 -0
  221. package/dist/stzh-components/p-129faf7d.entry.js.map +1 -0
  222. package/dist/stzh-components/{p-68dee00d.entry.js → p-23678dfc.entry.js} +2 -2
  223. package/dist/stzh-components/{p-68dee00d.entry.js.map → p-23678dfc.entry.js.map} +1 -1
  224. package/dist/stzh-components/p-345a1e99.js +2 -0
  225. package/dist/stzh-components/p-345a1e99.js.map +1 -0
  226. package/dist/stzh-components/{p-e5a451a0.entry.js → p-646958e0.entry.js} +2 -2
  227. package/dist/stzh-components/{p-025a5c2e.entry.js → p-66c866e5.entry.js} +2 -2
  228. package/dist/stzh-components/p-66c866e5.entry.js.map +1 -0
  229. package/dist/stzh-components/{p-232d017c.entry.js → p-6a3db3bd.entry.js} +2 -2
  230. package/dist/stzh-components/p-6a3db3bd.entry.js.map +1 -0
  231. package/dist/stzh-components/{p-ef38e1fe.entry.js → p-6f9626d1.entry.js} +2 -2
  232. package/dist/stzh-components/p-6f9626d1.entry.js.map +1 -0
  233. package/dist/stzh-components/p-75143e35.entry.js +2 -0
  234. package/dist/stzh-components/p-75143e35.entry.js.map +1 -0
  235. package/dist/stzh-components/{p-8aab9098.entry.js → p-7c5e34db.entry.js} +2 -2
  236. package/dist/stzh-components/{p-b2986e24.entry.js → p-809076ff.entry.js} +2 -2
  237. package/dist/stzh-components/p-84cedd61.entry.js +2 -0
  238. package/dist/stzh-components/p-84cedd61.entry.js.map +1 -0
  239. package/dist/stzh-components/{p-5bafa548.entry.js → p-84f8307b.entry.js} +2 -2
  240. package/dist/stzh-components/p-84f8307b.entry.js.map +1 -0
  241. package/dist/stzh-components/{p-7b2bd184.entry.js → p-8856651e.entry.js} +2 -2
  242. package/dist/stzh-components/{p-7b2bd184.entry.js.map → p-8856651e.entry.js.map} +1 -1
  243. package/dist/stzh-components/p-8c5fb0e2.entry.js +2 -0
  244. package/dist/stzh-components/{p-f156650a.entry.js.map → p-8c5fb0e2.entry.js.map} +1 -1
  245. package/dist/stzh-components/p-9f91ca1f.entry.js +2 -0
  246. package/dist/stzh-components/p-9f91ca1f.entry.js.map +1 -0
  247. package/dist/stzh-components/p-d41803d1.js +2 -0
  248. package/dist/stzh-components/{p-64ba89a2.js.map → p-d41803d1.js.map} +1 -1
  249. package/dist/stzh-components/{p-6f0cf6e3.entry.js → p-d97fbf1f.entry.js} +2 -2
  250. package/dist/stzh-components/p-fa4595c8.entry.js +2 -0
  251. package/dist/stzh-components/p-fa4595c8.entry.js.map +1 -0
  252. package/dist/stzh-components/p-fcc75797.entry.js +2 -0
  253. package/dist/stzh-components/p-fcc75797.entry.js.map +1 -0
  254. package/dist/stzh-components/stzh-components.esm.js +1 -1
  255. package/dist/stzh-components/stzh-components.esm.js.map +1 -1
  256. package/dist/types/components/stzh-accordion-item/stzh-accordion-item.d.ts +0 -1
  257. package/dist/types/components/stzh-checkboxgroup/stzh-checkboxgroup.d.ts +3 -3
  258. package/dist/types/components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.d.ts +2 -2
  259. package/dist/types/components/stzh-progressbar/stzh-progressbar.d.ts +4 -0
  260. package/dist/types/components/stzh-upload/models/stzh-photographing-url-details.dto.d.ts +1 -0
  261. package/dist/types/components/stzh-upload/stzh-upload.d.ts +3 -0
  262. package/dist/types/components/stzh-upload/stzh-upload.localization.d.ts +2 -0
  263. package/dist/types/components.d.ts +8 -0
  264. package/dist/vscode-data.json +4 -0
  265. package/package.json +9 -5
  266. package/dist/cjs/axios-69bcb71f.js.map +0 -1
  267. package/dist/components/p-16892790.js.map +0 -1
  268. package/dist/components/p-20c7b76b.js +0 -265
  269. package/dist/components/p-20c7b76b.js.map +0 -1
  270. package/dist/components/p-2a870524.js.map +0 -1
  271. package/dist/components/p-3890d846.js.map +0 -1
  272. package/dist/components/p-d4aabf9c.js.map +0 -1
  273. package/dist/components/p-e0e4416e.js.map +0 -1
  274. package/dist/esm/axios-e0a35239.js.map +0 -1
  275. package/dist/stzh-components/p-025a5c2e.entry.js.map +0 -1
  276. package/dist/stzh-components/p-11abc40a.entry.js +0 -2
  277. package/dist/stzh-components/p-11abc40a.entry.js.map +0 -1
  278. package/dist/stzh-components/p-16892790.js +0 -2
  279. package/dist/stzh-components/p-16892790.js.map +0 -1
  280. package/dist/stzh-components/p-232d017c.entry.js.map +0 -1
  281. package/dist/stzh-components/p-5ac0220a.entry.js +0 -2
  282. package/dist/stzh-components/p-5ac0220a.entry.js.map +0 -1
  283. package/dist/stzh-components/p-5bafa548.entry.js.map +0 -1
  284. package/dist/stzh-components/p-64ba89a2.js +0 -2
  285. package/dist/stzh-components/p-95427be2.entry.js +0 -2
  286. package/dist/stzh-components/p-95427be2.entry.js.map +0 -1
  287. package/dist/stzh-components/p-973c5df2.entry.js +0 -2
  288. package/dist/stzh-components/p-973c5df2.entry.js.map +0 -1
  289. package/dist/stzh-components/p-aff2ca5f.entry.js +0 -2
  290. package/dist/stzh-components/p-aff2ca5f.entry.js.map +0 -1
  291. package/dist/stzh-components/p-da2c88a2.entry.js +0 -2
  292. package/dist/stzh-components/p-da2c88a2.entry.js.map +0 -1
  293. package/dist/stzh-components/p-ef38e1fe.entry.js.map +0 -1
  294. package/dist/stzh-components/p-f156650a.entry.js +0 -2
  295. /package/dist/stzh-components/{p-e5a451a0.entry.js.map → p-646958e0.entry.js.map} +0 -0
  296. /package/dist/stzh-components/{p-8aab9098.entry.js.map → p-7c5e34db.entry.js.map} +0 -0
  297. /package/dist/stzh-components/{p-b2986e24.entry.js.map → p-809076ff.entry.js.map} +0 -0
  298. /package/dist/stzh-components/{p-6f0cf6e3.entry.js.map → p-d97fbf1f.entry.js.map} +0 -0
@@ -3,12 +3,18 @@ import { withActions } from '@storybook/addon-actions/decorator';
3
3
  import readme from './readme.md?raw';
4
4
  import { getFigmaLink } from '../../../figma';
5
5
  import { fullwidthCentered } from '../../utils/decorators';
6
+ import { userEvent, waitFor } from "@storybook/testing-library";
7
+ import { expect } from '@storybook/jest';
8
+ import { getComponentByTestId, expectIsVisuallyHidden } from "../../../.storybook/utils/component-test-utils";
6
9
 
7
10
  const COMPONENT_NAME = 'stzh-button';
8
11
  const story = createComponentStory(COMPONENT_NAME);
9
12
 
13
+ const BUTTON_TEST_ID = 'BUTTON_TEST_ID';
14
+ let stzhButtonEl;
15
+
10
16
  const TEMPLATE = `
11
- <stzh-button></stzh-button>
17
+ <stzh-button data-testid="${BUTTON_TEST_ID}"></stzh-button>
12
18
  `;
13
19
 
14
20
  export default {
@@ -39,55 +45,225 @@ export const Default = {
39
45
  render: (args) => story(args, TEMPLATE),
40
46
  args: {
41
47
  label: 'Button Text',
48
+ name: 'buttonName',
49
+ id: 'buttonId'
50
+ },
51
+ play: async ({ canvasElement, step }) => {
52
+
53
+ let eventDetail;
54
+
55
+ await step('Assert properties', async () => {
56
+ stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
57
+
58
+ expect(stzhButtonEl).toHaveAttribute('label', 'Button Text');
59
+ expect(stzhButtonEl).toHaveAttribute('name', 'buttonName');
60
+ expect(stzhButtonEl).toHaveAttribute('id', 'buttonId');
61
+ expect(stzhButtonEl).toHaveAttribute('variant', 'default');
62
+ expect(stzhButtonEl).toHaveAttribute('text-align', 'default');
63
+ expect(stzhButtonEl).toHaveAttribute('size', 'default');
64
+ expect(stzhButtonEl).toHaveAttribute('tabindex', '-1');
65
+ expect(stzhButtonEl).not.toHaveAttribute('active');
66
+ expect(stzhButtonEl).not.toHaveAttribute('effect');
67
+ expect(stzhButtonEl).not.toHaveAttribute('disabled');
68
+ expect(stzhButtonEl).not.toHaveAttribute('href');
69
+ expect(stzhButtonEl).not.toHaveAttribute('rounded');
70
+ });
71
+
72
+ await step('Assert stzhClick event details', async () => {
73
+ stzhButtonEl.addEventListener('stzhClick', (ev) => {
74
+ eventDetail = ev.detail;
75
+ });
76
+
77
+ const buttonEl = stzhButtonEl.querySelector('button');
78
+ await userEvent.click(buttonEl);
79
+ // component is stzh-button
80
+ expect(eventDetail).toHaveProperty('component', 'stzh-button');
81
+ // href is empty
82
+ expect(eventDetail).toHaveProperty('href', '');
83
+ // originalEvent is PointerEvent
84
+ expect(eventDetail.originalEvent).toHaveProperty('type', 'click');
85
+ });
42
86
  },
43
87
  };
44
88
 
45
- export const DisableOnClick = {
89
+ export const SecondaryWithIcon = {
46
90
  render: (args) => story(args, TEMPLATE),
47
91
  args: {
48
92
  label: 'Button Text',
49
- 'disable-on-click': true,
93
+ icon: 'filtering',
94
+ variant: 'secondary',
95
+ },
96
+ play: async ({ canvasElement, step }) => {
97
+ await step('Assert properties', async () => {
98
+ stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
99
+
100
+ expect(stzhButtonEl).toHaveAttribute('variant', 'secondary');
101
+ expect(stzhButtonEl).toHaveAttribute('icon', 'filtering');
102
+ expect(stzhButtonEl).toHaveAttribute('icon-position', 'left');
103
+ });
104
+
105
+ await step('Child component stzh-icon exists and is visible', async () => {
106
+ const stzhIconEl = stzhButtonEl.querySelector('stzh-icon');
107
+ expect(stzhIconEl).not.toBeNull();
108
+ expect(window.getComputedStyle(stzhIconEl).display).not.toBe('none');
109
+ });
50
110
  },
51
111
  };
52
112
 
53
- export const AsLink = {
113
+ export const IconOnly = {
54
114
  render: (args) => story(args, TEMPLATE),
55
115
  args: {
56
- label: 'Button Text',
57
- href: 'https://www.stadt-zuerich.ch/',
58
- target: '_blank',
116
+ 'icon-only': true,
117
+ icon: 'filtering',
118
+ label: 'Icon Button'
119
+ },
120
+ play: async ({ canvasElement, step }) => {
121
+
122
+ stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
123
+
124
+ await step('Assert properties', async () => {
125
+ expect(stzhButtonEl).toHaveProperty('label', 'Icon Button');
126
+ expect(stzhButtonEl).toHaveAttribute('icon-position', 'left');
127
+ expect(stzhButtonEl).toHaveAttribute('icon-only', 'true');
128
+ expect(stzhButtonEl).toHaveAttribute('icon', 'filtering');
129
+ });
130
+
131
+ await step('Label is visually hidden', async () => {
132
+ stzhButtonEl = canvasElement.querySelector(`[data-testid=${BUTTON_TEST_ID}]`);
133
+
134
+ const labelContainer = stzhButtonEl.querySelector('div.stzh-button__text');
135
+ await expect(labelContainer).not.toBeNull();
136
+ expectIsVisuallyHidden(labelContainer);
137
+ });
59
138
  },
60
139
  };
61
140
 
62
- export const WithIcon = {
141
+ export const Tertiary = {
63
142
  render: (args) => story(args, TEMPLATE),
64
143
  args: {
65
- label: 'Button Text',
66
- icon: 'filtering',
144
+ label: 'Tertiary Button',
145
+ variant: 'tertiary',
67
146
  },
68
147
  };
69
148
 
70
- export const JustIcon = {
149
+ export const TertiaryPlain = {
71
150
  render: (args) => story(args, TEMPLATE),
72
151
  args: {
73
- 'icon-only': true,
74
- icon: 'filtering',
152
+ label: 'Tertiary Plain Button',
153
+ variant: 'tertiary-plain',
154
+ active: true,
155
+ },
156
+
157
+ play: async ({ canvasElement, step }) => {
158
+
159
+ stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
160
+
161
+ await step('Assert properties', async () => {
162
+ expect(stzhButtonEl).toHaveAttribute('variant', 'tertiary-plain');
163
+ expect(stzhButtonEl).toHaveAttribute('active');
164
+ expect(stzhButtonEl).not.toHaveAttribute('active', 'false');
165
+ });
166
+
167
+ await step('Background is transparent', async () => {
168
+ const buttonEl = stzhButtonEl.querySelector('button');
169
+ const computedStyle = window.getComputedStyle(buttonEl);
170
+ const backgroundColor = computedStyle.backgroundColor;
171
+ expect(backgroundColor).toBe('rgba(0, 0, 0, 0)');
172
+ });
75
173
  },
174
+
76
175
  };
77
176
 
78
- export const CTA = {
177
+ export const AsLink = {
79
178
  render: (args) => story(args, TEMPLATE),
80
179
  args: {
81
180
  label: 'Button Text',
181
+ href: 'https://www.stadt-zuerich.ch/',
182
+ target: '_blank',
183
+ },
184
+ play: async ({ canvasElement, step }) => {
185
+
186
+ stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
187
+
188
+ await step('Assert properties', async () => {
189
+ expect(stzhButtonEl).toHaveAttribute('href', 'https://www.stadt-zuerich.ch/');
190
+ expect(stzhButtonEl).toHaveAttribute('target', '_blank');
191
+ });
192
+
193
+ await step('Instead of button, there is an a element with href and target attributes', async () => {
194
+ const aEl = stzhButtonEl.querySelector('a.stzh-button');
195
+ const buttonEl = stzhButtonEl.querySelector('button.stzh-button');
196
+ expect(buttonEl).toBe(null);
197
+ expect(aEl).toHaveAttribute('href', 'https://www.stadt-zuerich.ch/');
198
+ expect(aEl).toHaveAttribute('target', '_blank');
199
+ });
200
+ },
201
+ };
202
+
203
+ export const CTA = {
204
+ render: (args) => story(args, TEMPLATE),
205
+ args: {
206
+ label: 'Call-To-Action Button',
82
207
  effect: 'cta',
83
208
  icon: 'arrow-right',
84
209
  'icon-position': 'right',
85
210
  },
211
+ play: async ({ canvasElement, step }) => {
212
+
213
+ stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
214
+
215
+ await step('Assert properties', async () => {
216
+ expect(stzhButtonEl).toHaveAttribute('effect', 'cta');
217
+ expect(stzhButtonEl).toHaveAttribute('icon-position', 'right');
218
+ });
219
+ },
220
+ };
221
+
222
+ export const DisableOnClick = {
223
+ render: (args) => story(args, TEMPLATE),
224
+ args: {
225
+ label: 'Button Text',
226
+ 'disable-on-click': true,
227
+ },
228
+ play: async ({ canvasElement, step }) => {
229
+
230
+ stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
231
+ let eventDetail;
232
+
233
+ await step('Assert properties', async () => {
234
+ expect(stzhButtonEl).toHaveAttribute('disable-on-click', 'true');
235
+ });
236
+
237
+ await step('Click sets disabled property', async () => {
238
+ stzhButtonEl.addEventListener('stzhClick', (ev) => {
239
+ eventDetail = ev.detail;
240
+ });
241
+
242
+ expect(stzhButtonEl).not.toHaveAttribute('disabled');
243
+
244
+ const buttonEl = stzhButtonEl.querySelector('button');
245
+ await userEvent.click(buttonEl);
246
+
247
+ await waitFor(() => expect(stzhButtonEl).toHaveAttribute('disabled'), {
248
+ timeout: 1000,
249
+ });
250
+ });
251
+ },
86
252
  };
87
253
 
88
- export const LongText = {
254
+ export const RoundedLongText = {
89
255
  render: (args) => story(args, TEMPLATE),
90
256
  args: {
257
+ rounded: true,
91
258
  label: 'Laboris laborum aute id laboris culpa esse aliquip nisi anim velit',
92
259
  },
260
+ play: async ({ canvasElement, step }) => {
261
+
262
+ stzhButtonEl = await getComponentByTestId(canvasElement, BUTTON_TEST_ID);
263
+
264
+ await step('Assert properties', async () => {
265
+ expect(stzhButtonEl).toHaveAttribute('rounded');
266
+ expect(stzhButtonEl).toHaveAttribute('label', 'Laboris laborum aute id laboris culpa esse aliquip nisi anim velit');
267
+ });
268
+ },
93
269
  };
@@ -1,4 +1,4 @@
1
- import { Host, h, } from "@stencil/core";
1
+ import { h, Host } from "@stencil/core";
2
2
  import { hasSlot } from "../../utils/utils";
3
3
  import { camelCase } from "../../utils/string-utils";
4
4
  import { StzhInputDescription } from "../stzh-input/stzh-input-description";
@@ -20,12 +20,12 @@ export class StzhCheckboxgroup {
20
20
  this.init = () => {
21
21
  // update checkboxes
22
22
  this.checkboxes = Array.from(this.element.querySelectorAll("stzh-checkbox"));
23
+ this.updateCheckboxesProperty("hide-optional", true);
23
24
  this.updateCheckboxesProperty("a11y-describedby", `${this.checkboxgroupId}-description`);
24
25
  this.updateCheckboxesProperty("invalid", this.invalid || this.errorUsed);
25
26
  this.watchValue(this.value);
26
27
  this.watchName(this.name);
27
28
  this.watchDisabled(this.disabled);
28
- this.watchHideOptional(this.hideOptional);
29
29
  };
30
30
  this.localization = undefined;
31
31
  this.disabled = false;
@@ -33,6 +33,7 @@ export class StzhCheckboxgroup {
33
33
  this.legend = undefined;
34
34
  this.hideLegend = false;
35
35
  this.invalid = false;
36
+ this.required = false;
36
37
  this.hideOptional = false;
37
38
  this.value = "";
38
39
  this.defaultValue = [];
@@ -50,9 +51,6 @@ export class StzhCheckboxgroup {
50
51
  watchDisabled(newValue) {
51
52
  this.updateCheckboxesProperty("disabled", newValue);
52
53
  }
53
- watchHideOptional(newValue) {
54
- this.updateCheckboxesProperty("hideOptional", newValue);
55
- }
56
54
  watchValue(newValue) {
57
55
  if (typeof newValue === "string") {
58
56
  this._value = JSON.parse(newValue);
@@ -114,13 +112,13 @@ export class StzhCheckboxgroup {
114
112
  this.value = this._value;
115
113
  this.stzhChange.emit({
116
114
  component: "stzh-checkboxgroup",
117
- value: this._value,
115
+ value: this._value
118
116
  });
119
117
  }
120
118
  }
121
119
  get errorUsed() {
122
120
  var _a;
123
- return hasSlot(this.element, 'error') || ((_a = this._error) === null || _a === void 0 ? void 0 : _a.length) > 0;
121
+ return hasSlot(this.element, "error") || ((_a = this._error) === null || _a === void 0 ? void 0 : _a.length) > 0;
124
122
  }
125
123
  updateCheckboxesProperty(prop, value) {
126
124
  this.checkboxes.forEach((checkbox) => {
@@ -144,7 +142,7 @@ export class StzhCheckboxgroup {
144
142
  this.errorWatcher(this.error);
145
143
  this.preventUpdatePropertiesWatcher(this.preventUpdateProperties);
146
144
  if (!this.localization) {
147
- this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, 'checkboxgroup');
145
+ this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, "checkboxgroup");
148
146
  }
149
147
  }
150
148
  componentShouldUpdate(_newValue, _oldValue, prop) {
@@ -176,8 +174,8 @@ export class StzhCheckboxgroup {
176
174
  }
177
175
  }
178
176
  render() {
179
- const descriptionUsed = hasSlot(this.element, 'description') || !!this.description;
180
- const descriptionLongUsed = hasSlot(this.element, 'description-long') || !!this.descriptionLong;
177
+ const descriptionUsed = hasSlot(this.element, "description") || !!this.description;
178
+ const descriptionLongUsed = hasSlot(this.element, "description-long") || !!this.descriptionLong;
181
179
  const classes = {
182
180
  "stzh-checkboxgroup": true,
183
181
  "stzh-checkboxgroup--has-description": descriptionUsed,
@@ -189,7 +187,11 @@ export class StzhCheckboxgroup {
189
187
  [`stzh-checkboxgroup--direction-${this.direction}`]: !!this.direction
190
188
  };
191
189
  return (h(Host, { "is-invalid": this.invalid || this.errorUsed }, h("fieldset", { class: classes }, this.legend &&
192
- h("legend", { class: "stzh-checkboxgroup__legend" }, this.legend), h("div", { class: "stzh-checkboxgroup__fields" }, h("slot", null)), h(StzhInputDescription, { classPrefix: "stzh-checkboxgroup", id: `${this.checkboxgroupId}-description`, error: this._error, description: this.description, descriptionLong: this.descriptionLong, descriptionLongTitle: this.descriptionLongTitle, descriptionLongUsed: descriptionLongUsed, moreInfoButtonLabel: this.localization.$globals.moreInfoButtonLabel }))));
190
+ h("legend", { class: "stzh-checkboxgroup__legend" }, this.legend, !this.hideOptional && (h("span", { class: "stzh-checkboxgroup__marker" }, h("span", { class: "stzh-checkboxgroup__marker-symbol", "aria-hidden": "true" }, this.required
191
+ ? this.localization.$globals.requiredFieldMarker
192
+ : this.localization.$globals.optionalFieldMarker), h("span", { class: "stzh-checkboxgroup__marker-text" }, this.required
193
+ ? this.localization.$globals.requiredFieldText
194
+ : this.localization.$globals.optionalFieldText)))), h("div", { class: "stzh-checkboxgroup__fields" }, h("slot", null)), h(StzhInputDescription, { classPrefix: "stzh-checkboxgroup", id: `${this.checkboxgroupId}-description`, error: this._error, description: this.description, descriptionLong: this.descriptionLong, descriptionLongTitle: this.descriptionLongTitle, descriptionLongUsed: descriptionLongUsed, moreInfoButtonLabel: this.localization.$globals.moreInfoButtonLabel }))));
193
195
  }
194
196
  static get is() { return "stzh-checkboxgroup"; }
195
197
  static get encapsulation() { return "scoped"; }
@@ -314,6 +316,24 @@ export class StzhCheckboxgroup {
314
316
  "reflect": true,
315
317
  "defaultValue": "false"
316
318
  },
319
+ "required": {
320
+ "type": "boolean",
321
+ "mutable": false,
322
+ "complexType": {
323
+ "original": "boolean",
324
+ "resolved": "boolean",
325
+ "references": {}
326
+ },
327
+ "required": false,
328
+ "optional": false,
329
+ "docs": {
330
+ "tags": [],
331
+ "text": "Required status"
332
+ },
333
+ "attribute": "required",
334
+ "reflect": true,
335
+ "defaultValue": "false"
336
+ },
317
337
  "hideOptional": {
318
338
  "type": "boolean",
319
339
  "mutable": false,
@@ -525,9 +545,6 @@ export class StzhCheckboxgroup {
525
545
  }, {
526
546
  "propName": "disabled",
527
547
  "methodName": "watchDisabled"
528
- }, {
529
- "propName": "hideOptional",
530
- "methodName": "watchHideOptional"
531
548
  }, {
532
549
  "propName": "value",
533
550
  "methodName": "watchValue"
@@ -1 +1 @@
1
- {"version":3,"file":"stzh-checkboxgroup.js","sourceRoot":"","sources":["../../../../src/components/stzh-checkboxgroup/stzh-checkboxgroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,OAAO,EACP,KAAK,EACL,KAAK,EACL,CAAC,EACD,MAAM,GAEP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,IAAI,oBAAoB,GAAG,CAAC,CAAC;AAE7B;;;;;;GAMG;AAMH,MAAM,OAAO,iBAAiB;;IAwBpB,WAAM,GAAa,EAAE,CAAC;IA0BtB,6BAAwB,GAAa,EAAE,CAAC;IAwHxC,gBAAW,GAAG,KAAK,IAAI,EAAE;MAC/B,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC,CAAA;IAEO,SAAI,GAAG,GAAG,EAAE;MAClB,oBAAoB;MACpB,IA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EF,OAAO,CACL,EAAC,IAAI,kBAAa,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,SAAS;MAC9C,gBAAU,KAAK,EAAE,OAAO;QACrB,IAAI,CAAC,MAAM;UACV,cAAQ,KAAK,EAAC,4BAA4B,IACvC,IAAI,CAAC,MAAM,CACL;QAEX,WAAK,KAAK,EAAC,4BAA4B;UACrC,eAAa,CACT;QACN,EAAC,oBAAoB,IACnB,WAAW,EAAC,oBAAoB,EAChC,EAAE,EAAE,GAAG,IAAI,CAAC,eAAe,cAAc,EACzC,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAC/C,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mBAAmB,GACnE,CACO,CACN,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import {\n Host,\n Component,\n Prop,\n Element,\n Watch,\n Event,\n h,\n Listen,\n EventEmitter,\n} from \"@stencil/core\";\n\nimport { hasSlot } from \"../../utils/utils\";\n\nimport { StzhCheckboxChangeEvent, StzhCheckboxgroupChangeEvent } from \"../../index\";\nimport { camelCase } from \"../../utils/string-utils\";\nimport { StzhLocaleComponent } from \"../../index\";\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nlet checkboxgroupCounter = 0;\n\n/**\n * @slot - Slot for `stzh-checkbox` elements\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot description-long-title - Slot for long description title (in popover) / instead of descriptionLongTitle or description property\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-checkboxgroup\",\n styleUrl: \"stzh-checkboxgroup.scss\",\n scoped: true\n})\nexport class StzhCheckboxgroup {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Whether the element is disabled or not */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** The name of the input checkbox elements */\n @Prop({ reflect: true }) name: string;\n\n /** The legend */\n @Prop() legend: string;\n\n /** Hide legend to show only for screenreaders */\n @Prop({ reflect: true }) hideLegend: boolean = false;\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Hide `(optional)` label */\n @Prop({ reflect: true }) hideOptional: boolean = false;\n\n /** The selected values of the checkboxgroup */\n @Prop({ mutable: true }) value: string[] | string = \"\";\n private _value: string[] = [];\n\n /** Default value (used by reset) */\n @Prop({ mutable: true }) defaultValue: string[] = [];\n\n /** Direction */\n @Prop({ reflect: true }) direction: \"vertical\" | \"horizontal\" = \"vertical\";\n\n /** Description message (use description slot as alternative) */\n @Prop() description: string;\n\n /** Long description message appearing in a popover (use description-long slot as alternative) */\n @Prop() descriptionLong: string;\n\n /** Long description title appearing in a popover (use description-long-title slot as or description property alternative) */\n @Prop() descriptionLongTitle: string;\n\n /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n private _error: string[];\n\n /** Current checked checkbox elements (readonly) */\n @Prop() checkedCheckbox: HTMLStzhCheckboxElement[] | null = null;\n\n /** Prevent updating certain properties of radio elements (possible values inside array: disabled, invalid) */\n @Prop() preventUpdateProperties: string[] | string = [];\n private _preventUpdateProperties: string[] = [];\n\n /** Host element */\n @Element() element: HTMLElement;\n\n @Watch(\"name\")\n watchName(newValue: string) {\n this.updateCheckboxesProperty(\"name\", newValue);\n }\n\n @Watch(\"disabled\")\n watchDisabled(newValue: boolean) {\n this.updateCheckboxesProperty(\"disabled\", newValue);\n }\n\n @Watch(\"hideOptional\")\n watchHideOptional(newValue: boolean) {\n this.updateCheckboxesProperty(\"hideOptional\", newValue)\n }\n\n @Watch(\"value\")\n watchValue(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._value = JSON.parse(newValue);\n } else {\n this._value = newValue;\n }\n\n if (JSON.stringify(this._value) !== JSON.stringify(this.value)) {\n this.value = this._value;\n }\n\n this.updateCheckedCheckboxByValue(this._value);\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n }\n\n @Watch(\"preventUpdateProperties\")\n preventUpdatePropertiesWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._preventUpdateProperties = JSON.parse(newValue);\n } else {\n this._preventUpdateProperties = newValue;\n }\n }\n\n /** Change event */\n @Event() stzhChange: EventEmitter<StzhCheckboxgroupChangeEvent>;\n\n @Listen(\"reset\", { target: \"document\" })\n resetListener(event: Event) {\n if ((event.target as HTMLElement).contains(this.element)) {\n requestAnimationFrame(() => {\n this.handleReset();\n });\n }\n }\n\n @Listen(\"stzhChange\", {capture: true})\n onChange(event: CustomEvent<StzhCheckboxChangeEvent>) {\n if (event.detail.component === \"stzh-checkbox\") {\n if (event.detail.checked) {\n this._value.push(event.detail.value);\n } else {\n this._value = this._value.filter(value => value !== event.detail.value);\n }\n // stop propagating checkbox change event otherwise angular control value accessor won't work\n event.stopPropagation();\n this.value = this._value;\n this.stzhChange.emit({\n component: \"stzh-checkboxgroup\",\n value: this._value,\n });\n }\n }\n\n private get errorUsed() {\n return hasSlot(this.element, 'error') || this._error?.length > 0;\n }\n\n /** Checkbox elements */\n private checkboxes: HTMLStzhCheckboxElement[];\n private checkboxgroupId: string;\n private observer: MutationObserver;\n\n private updateCheckboxesProperty(prop: string, value: any) {\n this.checkboxes.forEach((checkbox: HTMLStzhCheckboxElement) => {\n if (prop === \"disabled\") {\n // Only set the disabled if the checkbox is not already disabled\n if (!checkbox.disabled) {\n checkbox.disabled = value;\n }\n } else if (prop === \"name\" || (this._preventUpdateProperties.indexOf(prop) === -1)) {\n checkbox[camelCase(prop)] = value;\n }\n });\n }\n\n private updateCheckedCheckboxByValue(value: string[]) {\n this.checkedCheckbox = this.checkboxes.filter(checkbox => value.indexOf(checkbox.value) > -1);\n this.checkboxes.forEach(checkbox => checkbox.checked = value.indexOf(checkbox.value) > -1);\n }\n\n private handleReset = async () => {\n this.value = [...this.defaultValue];\n }\n\n private init = () => {\n // update checkboxes\n this.checkboxes = Array.from(this.element.querySelectorAll(\"stzh-checkbox\"));\n this.updateCheckboxesProperty(\"a11y-describedby\", `${this.checkboxgroupId}-description`);\n this.updateCheckboxesProperty(\"invalid\", this.invalid || this.errorUsed);\n\n this.watchValue(this.value);\n this.watchName(this.name);\n this.watchDisabled(this.disabled);\n this.watchHideOptional(this.hideOptional);\n }\n\n async componentWillLoad() {\n this.checkboxgroupId = `stzh-checkboxgroup-${checkboxgroupCounter++}`;\n this.errorWatcher(this.error);\n this.preventUpdatePropertiesWatcher(this.preventUpdateProperties);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, 'checkboxgroup');\n }\n }\n\n componentShouldUpdate(_newValue, _oldValue, prop: string) {\n return prop !== \"checkedCheckbox\";\n }\n\n componentDidRender() {\n this.init();\n }\n\n componentDidLoad() {\n this.defaultValue = this.defaultValue.length > 0 ? this.defaultValue : [...this._value];\n }\n\n connectedCallback() {\n if (!this.value.length) {\n this.checkboxes = Array.from(this.element.querySelectorAll(\"stzh-checkbox\"));\n\n // try to find checkboxes that might have checked set to true\n this.value = this.checkboxes\n .filter(checkbox => checkbox.checked)\n .map(checkbox => checkbox.value);\n }\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true\n });\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n render() {\n const descriptionUsed = hasSlot(this.element, 'description') || !!this.description;\n const descriptionLongUsed = hasSlot(this.element, 'description-long') || !!this.descriptionLong;\n\n const classes = {\n \"stzh-checkboxgroup\": true,\n \"stzh-checkboxgroup--has-description\": descriptionUsed,\n \"stzh-checkboxgroup--has-description-long\": descriptionLongUsed,\n \"stzh-checkboxgroup--has-error\": this.errorUsed,\n \"stzh-checkboxgroup--is-disabled\": this.disabled,\n \"stzh-checkboxgroup--is-invalid\": this.invalid || this.errorUsed,\n \"stzh-checkboxgroup--hide-legend\": this.hideLegend,\n [`stzh-checkboxgroup--direction-${this.direction}`]: !!this.direction\n };\n\n return (\n <Host is-invalid={this.invalid || this.errorUsed}>\n <fieldset class={classes}>\n {this.legend &&\n <legend class=\"stzh-checkboxgroup__legend\">\n {this.legend}\n </legend>\n }\n <div class=\"stzh-checkboxgroup__fields\">\n <slot></slot>\n </div>\n <StzhInputDescription\n classPrefix=\"stzh-checkboxgroup\"\n id={`${this.checkboxgroupId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongTitle={this.descriptionLongTitle}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n </fieldset>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"stzh-checkboxgroup.js","sourceRoot":"","sources":["../../../../src/components/stzh-checkboxgroup/stzh-checkboxgroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAA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EAAE,EAAE,GAAG,IAAI,CAAC,eAAe,cAAc,EACzC,KAAK,EAAE,IAAI,CAAC,MAAM,EAClB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,eAAe,EAAE,IAAI,CAAC,eAAe,EACrC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,EAC/C,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,mBAAmB,GACnE,CACO,CACN,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Listen, Prop, Watch } from \"@stencil/core\";\n\nimport { hasSlot } from \"../../utils/utils\";\n\nimport { StzhCheckboxChangeEvent, StzhCheckboxgroupChangeEvent, StzhLocaleComponent } from \"../../index\";\nimport { camelCase } from \"../../utils/string-utils\";\n\nimport { StzhInputDescription } from \"../stzh-input/stzh-input-description\";\n\nlet checkboxgroupCounter = 0;\n\n/**\n * @slot - Slot for `stzh-checkbox` elements\n * @slot description - Slot for description\n * @slot description-long - Slot for long description (in popover)\n * @slot description-long-title - Slot for long description title (in popover) / instead of descriptionLongTitle or description property\n * @slot error - Slot for error\n */\n@Component({\n tag: \"stzh-checkboxgroup\",\n styleUrl: \"stzh-checkboxgroup.scss\",\n scoped: true\n})\nexport class StzhCheckboxgroup {\n /** Translation strings */\n @Prop() localization: StzhLocaleComponent;\n\n /** Whether the element is disabled or not */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /** The name of the input checkbox elements */\n @Prop({ reflect: true }) name: string;\n\n /** The legend */\n @Prop() legend: string;\n\n /** Hide legend to show only for screenreaders */\n @Prop({ reflect: true }) hideLegend: boolean = false;\n\n /** Invalid status */\n @Prop({ reflect: true }) invalid: boolean = false;\n\n /** Required status */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Hide `(optional)` label */\n @Prop({ reflect: true }) hideOptional: boolean = false;\n\n /** The selected values of the checkboxgroup */\n @Prop({ mutable: true }) value: string[] | string = \"\";\n private _value: string[] = [];\n\n /** Default value (used by reset) */\n @Prop({ mutable: true }) defaultValue: string[] = [];\n\n /** Direction */\n @Prop({ reflect: true }) direction: \"vertical\" | \"horizontal\" = \"vertical\";\n\n /** Description message (use description slot as alternative) */\n @Prop() description: string;\n\n /** Long description message appearing in a popover (use description-long slot as alternative) */\n @Prop() descriptionLong: string;\n\n /** Long description title appearing in a popover (use description-long-title slot as or description property alternative) */\n @Prop() descriptionLongTitle: string;\n\n /** One or multiple error message (use error slot as alternative) */\n @Prop() error: string | string[];\n private _error: string[];\n\n /** Current checked checkbox elements (readonly) */\n @Prop() checkedCheckbox: HTMLStzhCheckboxElement[] | null = null;\n\n /** Prevent updating certain properties of radio elements (possible values inside array: disabled, invalid) */\n @Prop() preventUpdateProperties: string[] | string = [];\n private _preventUpdateProperties: string[] = [];\n\n /** Host element */\n @Element() element: HTMLElement;\n\n @Watch(\"name\")\n watchName(newValue: string) {\n this.updateCheckboxesProperty(\"name\", newValue);\n }\n\n @Watch(\"disabled\")\n watchDisabled(newValue: boolean) {\n this.updateCheckboxesProperty(\"disabled\", newValue);\n }\n\n @Watch(\"value\")\n watchValue(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._value = JSON.parse(newValue);\n } else {\n this._value = newValue;\n }\n\n if (JSON.stringify(this._value) !== JSON.stringify(this.value)) {\n this.value = this._value;\n }\n\n this.updateCheckedCheckboxByValue(this._value);\n }\n\n @Watch(\"error\")\n errorWatcher(newValue: string | string[]) {\n if (typeof newValue === \"string\") {\n try {\n this._error = JSON.parse(newValue);\n } catch (e) {\n if (newValue) {\n this._error = [newValue];\n } else {\n this._error = [];\n }\n }\n } else if (newValue) {\n this._error = newValue;\n } else {\n this._error = [];\n }\n }\n\n @Watch(\"preventUpdateProperties\")\n preventUpdatePropertiesWatcher(newValue: string[] | string) {\n if (typeof newValue === \"string\") {\n this._preventUpdateProperties = JSON.parse(newValue);\n } else {\n this._preventUpdateProperties = newValue;\n }\n }\n\n /** Change event */\n @Event() stzhChange: EventEmitter<StzhCheckboxgroupChangeEvent>;\n\n @Listen(\"reset\", { target: \"document\" })\n resetListener(event: Event) {\n if ((event.target as HTMLElement).contains(this.element)) {\n requestAnimationFrame(() => {\n this.handleReset();\n });\n }\n }\n\n @Listen(\"stzhChange\", { capture: true })\n onChange(event: CustomEvent<StzhCheckboxChangeEvent>) {\n if (event.detail.component === \"stzh-checkbox\") {\n if (event.detail.checked) {\n this._value.push(event.detail.value);\n } else {\n this._value = this._value.filter(value => value !== event.detail.value);\n }\n // stop propagating checkbox change event otherwise angular control value accessor won't work\n event.stopPropagation();\n this.value = this._value;\n this.stzhChange.emit({\n component: \"stzh-checkboxgroup\",\n value: this._value\n });\n }\n }\n\n private get errorUsed() {\n return hasSlot(this.element, \"error\") || this._error?.length > 0;\n }\n\n /** Checkbox elements */\n private checkboxes: HTMLStzhCheckboxElement[];\n private checkboxgroupId: string;\n private observer: MutationObserver;\n\n private updateCheckboxesProperty(prop: string, value: any) {\n this.checkboxes.forEach((checkbox: HTMLStzhCheckboxElement) => {\n if (prop === \"disabled\") {\n // Only set the disabled if the checkbox is not already disabled\n if (!checkbox.disabled) {\n checkbox.disabled = value;\n }\n } else if (prop === \"name\" || (this._preventUpdateProperties.indexOf(prop) === -1)) {\n checkbox[camelCase(prop)] = value;\n }\n });\n }\n\n private updateCheckedCheckboxByValue(value: string[]) {\n this.checkedCheckbox = this.checkboxes.filter(checkbox => value.indexOf(checkbox.value) > -1);\n this.checkboxes.forEach(checkbox => checkbox.checked = value.indexOf(checkbox.value) > -1);\n }\n\n private handleReset = async () => {\n this.value = [...this.defaultValue];\n };\n\n private init = () => {\n // update checkboxes\n this.checkboxes = Array.from(this.element.querySelectorAll(\"stzh-checkbox\"));\n\n this.updateCheckboxesProperty(\"hide-optional\", true);\n this.updateCheckboxesProperty(\"a11y-describedby\", `${this.checkboxgroupId}-description`);\n this.updateCheckboxesProperty(\"invalid\", this.invalid || this.errorUsed);\n\n this.watchValue(this.value);\n this.watchName(this.name);\n this.watchDisabled(this.disabled);\n };\n\n async componentWillLoad() {\n this.checkboxgroupId = `stzh-checkboxgroup-${checkboxgroupCounter++}`;\n this.errorWatcher(this.error);\n this.preventUpdatePropertiesWatcher(this.preventUpdateProperties);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"checkboxgroup\");\n }\n }\n\n componentShouldUpdate(_newValue, _oldValue, prop: string) {\n return prop !== \"checkedCheckbox\";\n }\n\n componentDidRender() {\n this.init();\n }\n\n componentDidLoad() {\n this.defaultValue = this.defaultValue.length > 0 ? this.defaultValue : [...this._value];\n }\n\n connectedCallback() {\n if (!this.value.length) {\n this.checkboxes = Array.from(this.element.querySelectorAll(\"stzh-checkbox\"));\n\n // try to find checkboxes that might have checked set to true\n this.value = this.checkboxes\n .filter(checkbox => checkbox.checked)\n .map(checkbox => checkbox.value);\n }\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true\n });\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n render() {\n const descriptionUsed = hasSlot(this.element, \"description\") || !!this.description;\n const descriptionLongUsed = hasSlot(this.element, \"description-long\") || !!this.descriptionLong;\n\n const classes = {\n \"stzh-checkboxgroup\": true,\n \"stzh-checkboxgroup--has-description\": descriptionUsed,\n \"stzh-checkboxgroup--has-description-long\": descriptionLongUsed,\n \"stzh-checkboxgroup--has-error\": this.errorUsed,\n \"stzh-checkboxgroup--is-disabled\": this.disabled,\n \"stzh-checkboxgroup--is-invalid\": this.invalid || this.errorUsed,\n \"stzh-checkboxgroup--hide-legend\": this.hideLegend,\n [`stzh-checkboxgroup--direction-${this.direction}`]: !!this.direction\n };\n\n return (\n <Host is-invalid={this.invalid || this.errorUsed}>\n <fieldset class={classes}>\n {this.legend &&\n <legend class=\"stzh-checkboxgroup__legend\">\n {this.legend}\n {!this.hideOptional && (\n <span class=\"stzh-checkboxgroup__marker\">\n <span class=\"stzh-checkboxgroup__marker-symbol\" aria-hidden=\"true\">\n {this.required\n ? this.localization.$globals.requiredFieldMarker\n : this.localization.$globals.optionalFieldMarker}\n </span>\n <span class=\"stzh-checkboxgroup__marker-text\">\n {this.required\n ? this.localization.$globals.requiredFieldText\n : this.localization.$globals.optionalFieldText}\n </span>\n </span>\n )}\n </legend>\n }\n <div class=\"stzh-checkboxgroup__fields\">\n <slot></slot>\n </div>\n <StzhInputDescription\n classPrefix=\"stzh-checkboxgroup\"\n id={`${this.checkboxgroupId}-description`}\n error={this._error}\n description={this.description}\n descriptionLong={this.descriptionLong}\n descriptionLongTitle={this.descriptionLongTitle}\n descriptionLongUsed={descriptionLongUsed}\n moreInfoButtonLabel={this.localization.$globals.moreInfoButtonLabel}\n />\n </fieldset>\n </Host>\n );\n }\n}\n"]}
@@ -45,6 +45,17 @@ export const Filter = {
45
45
  },
46
46
  };
47
47
 
48
+ export const FilterLarge = {
49
+ render: (args) => story(args, TEMPLATE),
50
+ args: {
51
+ variant: 'filter',
52
+ label: 'Topic Tag',
53
+ size: 'large',
54
+ counter: '00',
55
+ icon: 'bulleted-list',
56
+ },
57
+ };
58
+
48
59
  export const Tag = {
49
60
  render: (args) => story(args, TEMPLATE),
50
61
  args: {
@@ -264,12 +264,7 @@
264
264
  align-items: center;
265
265
  flex-wrap: wrap;
266
266
  border-radius: var(--stzh-button-border-radius);
267
- column-gap: var(--stzh-space-medium);
268
- }
269
- @media screen and (min-width: 900px) {
270
- .stzh-chipselect__chips {
271
- row-gap: var(--stzh-space-medium);
272
- }
267
+ gap: var(--stzh-space-medium);
273
268
  }
274
269
  .stzh-chipselect__chips:focus-within .is-focused[active] {
275
270
  --background-color: var(--stzh-color-primary90);
@@ -196,6 +196,14 @@
196
196
  height: 100%;
197
197
  object-fit: cover;
198
198
  }
199
+ @media screen and (min-width: 900px) {
200
+ :host[has-availability=false] {
201
+ --grid-template-areas: var(
202
+ --stzh-contact-grid-template-areas,
203
+ "heading heading heading heading heading heading heading heading" "image image image image . . . ." "info info info info info info info info" "additional additional additional additional additional additional additional additional"
204
+ );
205
+ }
206
+ }
199
207
 
200
208
  :host[image-position=left] {
201
209
  --grid-template-areas: var(
@@ -299,6 +307,9 @@
299
307
  .stzh-contact__heading:not(:empty):not(:last-child), .stzh-contact__name:not(:empty):not(:last-child), .stzh-contact__address:not(:empty):not(:last-child), .stzh-contact__numbers:not(:empty):not(:last-child), .stzh-contact__emails:not(:empty):not(:last-child), .stzh-contact__pobox:not(:empty):not(:last-child), .stzh-contact__availability-title:not(:empty):not(:last-child) {
300
308
  margin-bottom: var(--stzh-space-xsmall);
301
309
  }
310
+ .stzh-contact__numbers {
311
+ white-space: nowrap;
312
+ }
302
313
  .stzh-contact__number, .stzh-contact__email {
303
314
  display: flex;
304
315
  align-items: center;
@@ -49,12 +49,6 @@ export class StzhContact {
49
49
  else {
50
50
  this._availability = newValue;
51
51
  }
52
- // if (this._availability) {
53
- // this._availabilityDataItems = this._availability.map((item) => ({
54
- // value: item.hours.join(' | '),
55
- // label: item.weekday
56
- // }));
57
- // }
58
52
  }
59
53
  numbersWatcher(newValue) {
60
54
  if (typeof newValue === "string") {
@@ -121,7 +115,7 @@ export class StzhContact {
121
115
  const HeadingLevel = `h${this.headingLevel}`;
122
116
  const NameHeadingLevel = this.nameHeadingLevel ? `h${this.nameHeadingLevel}` : "div";
123
117
  const AvailabilityTitleElement = `h${this.availabilityTitleLevel}`;
124
- return (h(Host, { "image-position": this.imagePosition }, h("div", { class: classes, itemscope: true, itemtype: `http://schema.org/${this.type}` }, h("div", { class: "stzh-contact__main-heading", itemprop: (this.type === "Organization" && !this.heading) || (this.type === "Person" && !this.name) ? "name" : null }, this.mainHeading ? (h("stzh-heading", { level: this.mainHeadingLevel }, this.mainHeading)) : (h("slot", { name: "main-heading" }))), h("div", { class: "stzh-contact__image-wrapper" }, h("div", { class: "stzh-contact__image" }, h("slot", { name: "image" }))), h("div", { class: "stzh-contact__info" }, this.heading && (h(HeadingLevel, { class: "stzh-contact__heading", itemprop: this.type === "Organization" || !this.name ? "name" : null, innerHTML: this.heading })), this.name && (h(NameHeadingLevel, { class: {
118
+ return (h(Host, { "image-position": this.imagePosition, "has-availability": !!this.availability ? 'true' : 'false' }, h("div", { class: classes, itemscope: true, itemtype: `http://schema.org/${this.type}` }, h("div", { class: "stzh-contact__main-heading", itemprop: (this.type === "Organization" && !this.heading) || (this.type === "Person" && !this.name) ? "name" : null }, this.mainHeading ? (h("stzh-heading", { level: this.mainHeadingLevel }, this.mainHeading)) : (h("slot", { name: "main-heading" }))), h("div", { class: "stzh-contact__image-wrapper" }, h("div", { class: "stzh-contact__image" }, h("slot", { name: "image" }))), h("div", { class: "stzh-contact__info" }, this.heading && (h(HeadingLevel, { class: "stzh-contact__heading", itemprop: this.type === "Organization" || !this.name ? "name" : null, innerHTML: this.heading })), this.name && (h(NameHeadingLevel, { class: {
125
119
  "stzh-contact__name": true,
126
120
  "is-heading": this.nameHeadingLevel !== "",
127
121
  }, itemprop: this.type === "Person" ? "name" : null }, this.name)), h("div", { class: "stzh-contact__address", itemprop: "address", itemscope: true, itemtype: "http://schema.org/PostalAddress", innerHTML: this.address }, !this.address && (h(Fragment, null, this._street.length > 0 && (h("div", { class: "stzh-contact__street", itemprop: "streetAddress" }, this._street.map((street) => (h(Fragment, null, street, h("br", null)))), this._streetInfo.length > 0 && (h(Fragment, null, h("br", null), " ", this._streetInfo.map((streetInfo) => (h(Fragment, null, streetInfo, h("br", null)))))))), this.postalCode && (h("span", { class: "stzh-contact__postal-code", itemprop: "postalCode" }, this.postalCode, "\u00A0")), this.location && (h("span", { class: "stzh-contact__locality", itemprop: "addressLocality" }, this.location)), h("slot", { name: "address" })))), this._numbers.length > 0 && (h("div", { class: "stzh-contact__numbers" }, this._numbers.map(number => (h("div", { class: "stzh-contact__number" }, h("span", null, number.label, "\u00A0"), h("stzh-link", { size: "inherit", height: "auto", class: "stzh-contact__number-link", href: `${number.type}:${formatTel(number.number)}`, analyticsId: number.analyticsId || `${number.label} ${number.number}`, itemprop: number.type === "fax" ? "faxNumber" : "telephone" }, number.number)))))), this._emails.length > 0 && (h("div", { class: "stzh-contact__emails" }, this._emails.map(email => (h("div", { class: "stzh-contact__email" }, h("span", null, email.label, "\u00A0"), email.href ? (h("stzh-link", { size: "inherit", height: "auto", class: "stzh-container__email-link", href: `mailto:${email.href}`, analyticsId: email.analyticsId || `${email.label} ${email.text}`, itemprop: "email" }, email.text)) : (h("span", { class: "stzh-container__email-link", itemprop: "email" }, email.text))))))), h("div", { class: "stzh-contact__pobox", innerHTML: this.pobox }, !this.pobox && (h(Fragment, null, this.poboxHeading && h("div", { class: "stzh-contact__pobox-heading" }, this.poboxHeading), this.poboxTitle && h("div", { class: "stzh-contact__pobox-title" }, this.poboxTitle), this.poboxPostalCode && (h("span", { class: "stzh-contact__pobox-postal-code" }, this.poboxPostalCode, "\u00A0")), this.poboxLocation && h("span", { class: "stzh-contact__pobox-locality" }, this.poboxLocation), h("slot", { name: "pobox" }))))), this.availability && (h("div", { class: "stzh-contact__availability" }, this.availabilityTitle && (h(AvailabilityTitleElement, { class: "stzh-contact__availability-title" }, this.availabilityTitle)), this._availability.length > 0 && (h("ul", { class: "stzh-contact__availability-list" }, this._availability.map(item => (h("li", { class: "stzh-contact__availability-list-item" }, h("div", { class: "stzh-contact__availability-weekday" }, item.weekday), item.hours.length > 0 && (h("div", { class: "stzh-contact__availability-hours" }, item.hours.map((hour, index) => (h(Fragment, null, h("div", { class: "stzh-contact__availability-hour" }, hour), index < item.hours.length - 1 && (h("div", { class: "stzh-contact__availability-hours-separator" })))))))))))))), h("div", { class: "stzh-contact__additional" }, h("slot", null)))));