@oiz/stzh-components 2.4.0-beta → 2.5.0-alpha-carousel

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 (427) hide show
  1. package/dist/cjs/{_commonjsHelpers-dcc4cf71.js → _commonjsHelpers-bcc1208a.js} +0 -16
  2. package/dist/cjs/app-globals-d7bd37fe.js +889 -0
  3. package/dist/cjs/{js.cookie-226c94ed.js → js.cookie-9c263d23.js} +1 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/stzh-actions.cjs.entry.js +3 -1
  6. package/dist/cjs/stzh-actionset.cjs.entry.js +11 -6
  7. package/dist/cjs/stzh-appnav.cjs.entry.js +3 -1
  8. package/dist/cjs/stzh-badge_3.cjs.entry.js +20 -8
  9. package/dist/cjs/stzh-calendar.cjs.entry.js +1 -1
  10. package/dist/cjs/stzh-card_3.cjs.entry.js +36 -29
  11. package/dist/cjs/stzh-carousel.cjs.entry.js +522 -0
  12. package/dist/cjs/stzh-chart.cjs.entry.js +5998 -5171
  13. package/dist/cjs/stzh-checkboxgroup.cjs.entry.js +3 -1
  14. package/dist/cjs/stzh-chip_2.cjs.entry.js +82 -5
  15. package/dist/cjs/stzh-components.cjs.js +2 -2
  16. package/dist/cjs/stzh-cspace.cjs.entry.js +1 -1
  17. package/dist/cjs/stzh-datalist_2.cjs.entry.js +10 -3
  18. package/dist/cjs/stzh-datamessagelist-item.cjs.entry.js +1 -1
  19. package/dist/cjs/stzh-datatable.cjs.entry.js +16 -4
  20. package/dist/cjs/stzh-datepicker_3.cjs.entry.js +3 -1
  21. package/dist/cjs/stzh-dialog.cjs.entry.js +16 -13
  22. package/dist/cjs/stzh-dropdown.cjs.entry.js +2 -2
  23. package/dist/cjs/stzh-footer.cjs.entry.js +3 -1
  24. package/dist/cjs/stzh-ghettobox_2.cjs.entry.js +17 -4
  25. package/dist/cjs/stzh-header.cjs.entry.js +32 -27
  26. package/dist/cjs/stzh-hspace.cjs.entry.js +1 -1
  27. package/dist/cjs/stzh-input.cjs.entry.js +1 -1
  28. package/dist/cjs/stzh-invert.cjs.entry.js +1 -1
  29. package/dist/cjs/stzh-link.cjs.entry.js +15 -4
  30. package/dist/cjs/stzh-loader.cjs.entry.js +1 -1
  31. package/dist/cjs/stzh-menu_2.cjs.entry.js +2 -2
  32. package/dist/cjs/stzh-message.cjs.entry.js +2 -2
  33. package/dist/cjs/stzh-metanav.cjs.entry.js +3 -1
  34. package/dist/cjs/stzh-microsite-teaserlist.cjs.entry.js +1 -1
  35. package/dist/cjs/stzh-olmap.cjs.entry.js +1 -1
  36. package/dist/cjs/stzh-page-skiplinks.cjs.entry.js +3 -1
  37. package/dist/cjs/stzh-pagetitle-hero.cjs.entry.js +4 -2
  38. package/dist/cjs/stzh-pagetitle.cjs.entry.js +3 -1
  39. package/dist/cjs/stzh-popover.cjs.entry.js +1 -1
  40. package/dist/cjs/stzh-portal-mitwirken.cjs.entry.js +1 -1
  41. package/dist/cjs/stzh-readspeaker.cjs.entry.js +3 -1
  42. package/dist/cjs/stzh-sortable.cjs.entry.js +4 -2
  43. package/dist/cjs/stzh-space.cjs.entry.js +1 -1
  44. package/dist/cjs/stzh-sticky.cjs.entry.js +3 -1
  45. package/dist/cjs/stzh-table.cjs.entry.js +14 -4
  46. package/dist/cjs/stzh-upload.cjs.entry.js +1 -1
  47. package/dist/cjs/stzh-vbz-linechip.cjs.entry.js +1 -1
  48. package/dist/cjs/stzh-vbz-ticker.cjs.entry.js +16 -11
  49. package/dist/cjs/stzh-vspace.cjs.entry.js +1 -1
  50. package/dist/collection/assets/i18n/de.json +10 -0
  51. package/dist/collection/assets/i18n/en.json +11 -1
  52. package/dist/collection/collection-manifest.json +1 -0
  53. package/dist/collection/components/stzh-actions/stzh-actions.js +3 -1
  54. package/dist/collection/components/stzh-actionset/stzh-actionset.js +11 -33
  55. package/dist/collection/components/stzh-appnav/stzh-appnav.js +3 -1
  56. package/dist/collection/components/stzh-button/stzh-button.css +16 -1
  57. package/dist/collection/components/stzh-button/stzh-button.js +73 -7
  58. package/dist/collection/components/stzh-calendar/stzh-calendar.css +1 -1
  59. package/dist/collection/components/stzh-card/stzh-card.css +34 -9
  60. package/dist/collection/components/stzh-card/stzh-card.js +52 -54
  61. package/dist/collection/components/stzh-carousel/stzh-carousel.css +253 -0
  62. package/dist/collection/components/stzh-carousel/stzh-carousel.js +966 -0
  63. package/dist/collection/components/stzh-carousel/stzh-carousel.localization.js +1 -0
  64. package/dist/collection/components/stzh-carousel/stzh-carousel.stories.js +138 -0
  65. package/dist/collection/components/stzh-chart/stzh-chart.css +101 -54
  66. package/dist/collection/components/stzh-chart/stzh-chart.stories.js +1 -0
  67. package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.js +3 -1
  68. package/dist/collection/components/stzh-chip/stzh-chip.css +19 -17
  69. package/dist/collection/components/stzh-chip/stzh-chip.js +2 -1
  70. package/dist/collection/components/stzh-chip-select/stzh-chip-select.css +1 -1
  71. package/dist/collection/components/stzh-clamp/stzh-clamp.css +46 -160
  72. package/dist/collection/components/stzh-clamp/stzh-clamp.js +218 -8
  73. package/dist/collection/components/stzh-clamp/stzh-clamp.localization.js +1 -0
  74. package/dist/collection/components/stzh-clamp/stzh-clamp.stories.js +1 -1
  75. package/dist/collection/components/stzh-cspace/stzh-cspace.css +36 -0
  76. package/dist/collection/components/stzh-datalist/stzh-datalist.js +18 -18
  77. package/dist/collection/components/stzh-datalist-item/stzh-datalist-item.css +11 -0
  78. package/dist/collection/components/stzh-datalist-item/stzh-datalist-item.js +28 -1
  79. package/dist/collection/components/stzh-datamessagelist-item/stzh-datamessagelist-item.css +10 -0
  80. package/dist/collection/components/stzh-datatable/stzh-datatable.js +15 -12
  81. package/dist/collection/components/stzh-dialog/stzh-dialog.css +2 -2
  82. package/dist/collection/components/stzh-dialog/stzh-dialog.js +15 -12
  83. package/dist/collection/components/stzh-dropdown/stzh-dropdown.css +1 -1
  84. package/dist/collection/components/stzh-footer/stzh-footer.js +3 -1
  85. package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.js +3 -1
  86. package/dist/collection/components/stzh-header/stzh-header.js +32 -45
  87. package/dist/collection/components/stzh-hspace/stzh-hspace.css +4 -0
  88. package/dist/collection/components/stzh-input/stzh-input.css +1 -1
  89. package/dist/collection/components/stzh-input/stzh-input.stories.js +12 -12
  90. package/dist/collection/components/stzh-invert/stzh-invert.css +4 -4
  91. package/dist/collection/components/stzh-link/stzh-link.css +11 -0
  92. package/dist/collection/components/stzh-link/stzh-link.js +68 -3
  93. package/dist/collection/components/stzh-loader/stzh-loader.css +4 -4
  94. package/dist/collection/components/stzh-menu-item/stzh-menu-item.js +27 -27
  95. package/dist/collection/components/stzh-metanav/stzh-metanav.js +3 -1
  96. package/dist/collection/components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.js +1 -1
  97. package/dist/collection/components/stzh-page-skiplinks/stzh-page-skiplinks.js +3 -1
  98. package/dist/collection/components/stzh-pagetitle/stzh-pagetitle.js +3 -1
  99. package/dist/collection/components/stzh-pagetitle-hero/stzh-pagetitle-hero.css +4 -4
  100. package/dist/collection/components/stzh-pagetitle-hero/stzh-pagetitle-hero.js +3 -1
  101. package/dist/collection/components/stzh-popover/stzh-popover.css +3 -3
  102. package/dist/collection/components/stzh-portal-mitwirken/stzh-portal-mitwirken.css +118 -12
  103. package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.js +3 -1
  104. package/dist/collection/components/stzh-readspeaker/stzh-readspeaker.js +3 -1
  105. package/dist/collection/components/stzh-richtext/stzh-richtext.css +14 -3
  106. package/dist/collection/components/stzh-richtext/stzh-richtext.js +32 -0
  107. package/dist/collection/components/stzh-sortable/stzh-sortable.css +1 -1
  108. package/dist/collection/components/stzh-sortable/stzh-sortable.js +3 -1
  109. package/dist/collection/components/stzh-space/stzh-space.css +4 -0
  110. package/dist/collection/components/stzh-sticky/stzh-sticky.js +3 -1
  111. package/dist/collection/components/stzh-table/stzh-table.js +14 -13
  112. package/dist/collection/components/stzh-vbz-ticker/stzh-vbz-ticker.js +16 -11
  113. package/dist/collection/components/stzh-vspace/stzh-vspace.css +4 -0
  114. package/dist/collection/global/js/script.js +2 -0
  115. package/dist/components/_commonjsHelpers.js +1 -16
  116. package/dist/components/index.d.ts +1 -0
  117. package/dist/components/index.js +835 -1
  118. package/dist/components/stzh-actions.js +3 -1
  119. package/dist/components/stzh-actionset2.js +12 -7
  120. package/dist/components/stzh-appnav.js +3 -1
  121. package/dist/components/stzh-button2.js +23 -8
  122. package/dist/components/stzh-calendar2.js +1 -1
  123. package/dist/components/stzh-card2.js +37 -29
  124. package/dist/components/stzh-carousel.d.ts +11 -0
  125. package/dist/components/stzh-carousel.js +568 -0
  126. package/dist/components/stzh-chart.js +5995 -5168
  127. package/dist/components/stzh-checkboxgroup.js +3 -1
  128. package/dist/components/stzh-chip-select2.js +21 -9
  129. package/dist/components/stzh-chip2.js +19 -6
  130. package/dist/components/stzh-clamp2.js +110 -11
  131. package/dist/components/stzh-cspace.js +1 -1
  132. package/dist/components/stzh-datalist-item2.js +10 -2
  133. package/dist/components/stzh-datalist2.js +3 -3
  134. package/dist/components/stzh-datamessagelist-item.js +17 -11
  135. package/dist/components/stzh-datatable.js +16 -4
  136. package/dist/components/stzh-dialog.js +16 -13
  137. package/dist/components/stzh-dropdown2.js +1 -1
  138. package/dist/components/stzh-footer.js +3 -1
  139. package/dist/components/stzh-ghettobox2.js +3 -1
  140. package/dist/components/stzh-header.js +33 -28
  141. package/dist/components/stzh-hspace.js +1 -1
  142. package/dist/components/stzh-input2.js +1 -1
  143. package/dist/components/stzh-invert.js +1 -1
  144. package/dist/components/stzh-link2.js +18 -4
  145. package/dist/components/stzh-loader2.js +1 -1
  146. package/dist/components/stzh-menu-item2.js +4 -4
  147. package/dist/components/stzh-metanav.js +3 -1
  148. package/dist/components/stzh-microsite-teaserlist.js +1 -1
  149. package/dist/components/stzh-page-skiplinks.js +3 -1
  150. package/dist/components/stzh-pagetitle-hero.js +4 -2
  151. package/dist/components/stzh-pagetitle.js +3 -1
  152. package/dist/components/stzh-popover2.js +1 -1
  153. package/dist/components/stzh-portal-mitwirken.js +1 -1
  154. package/dist/components/stzh-radiogroup2.js +3 -1
  155. package/dist/components/stzh-readspeaker.js +3 -1
  156. package/dist/components/stzh-richtext2.js +14 -1
  157. package/dist/components/stzh-sortable2.js +4 -2
  158. package/dist/components/stzh-space.js +1 -1
  159. package/dist/components/stzh-sticky.js +3 -1
  160. package/dist/components/stzh-table.js +15 -5
  161. package/dist/components/stzh-upload.js +1 -1
  162. package/dist/components/stzh-vbz-ticker.js +16 -11
  163. package/dist/components/stzh-vspace.js +1 -1
  164. package/dist/esm/{_commonjsHelpers-f9dc4873.js → _commonjsHelpers-ba3f0406.js} +1 -16
  165. package/dist/esm/app-globals-62e1178d.js +887 -0
  166. package/dist/esm/{js.cookie-53735b72.js → js.cookie-28a40640.js} +1 -1
  167. package/dist/esm/loader.js +2 -2
  168. package/dist/esm/stzh-actions.entry.js +3 -1
  169. package/dist/esm/stzh-actionset.entry.js +11 -6
  170. package/dist/esm/stzh-appnav.entry.js +3 -1
  171. package/dist/esm/stzh-badge_3.entry.js +20 -8
  172. package/dist/esm/stzh-calendar.entry.js +1 -1
  173. package/dist/esm/stzh-card_3.entry.js +36 -29
  174. package/dist/esm/stzh-carousel.entry.js +518 -0
  175. package/dist/esm/stzh-chart.entry.js +5995 -5168
  176. package/dist/esm/stzh-checkboxgroup.entry.js +3 -1
  177. package/dist/esm/stzh-chip_2.entry.js +82 -5
  178. package/dist/esm/stzh-components.js +2 -2
  179. package/dist/esm/stzh-cspace.entry.js +1 -1
  180. package/dist/esm/stzh-datalist_2.entry.js +10 -3
  181. package/dist/esm/stzh-datamessagelist-item.entry.js +1 -1
  182. package/dist/esm/stzh-datatable.entry.js +16 -4
  183. package/dist/esm/stzh-datepicker_3.entry.js +3 -1
  184. package/dist/esm/stzh-dialog.entry.js +16 -13
  185. package/dist/esm/stzh-dropdown.entry.js +2 -2
  186. package/dist/esm/stzh-footer.entry.js +3 -1
  187. package/dist/esm/stzh-ghettobox_2.entry.js +17 -4
  188. package/dist/esm/stzh-header.entry.js +32 -27
  189. package/dist/esm/stzh-hspace.entry.js +1 -1
  190. package/dist/esm/stzh-input.entry.js +1 -1
  191. package/dist/esm/stzh-invert.entry.js +1 -1
  192. package/dist/esm/stzh-link.entry.js +15 -4
  193. package/dist/esm/stzh-loader.entry.js +1 -1
  194. package/dist/esm/stzh-menu_2.entry.js +2 -2
  195. package/dist/esm/stzh-message.entry.js +2 -2
  196. package/dist/esm/stzh-metanav.entry.js +3 -1
  197. package/dist/esm/stzh-microsite-teaserlist.entry.js +1 -1
  198. package/dist/esm/stzh-olmap.entry.js +1 -1
  199. package/dist/esm/stzh-page-skiplinks.entry.js +3 -1
  200. package/dist/esm/stzh-pagetitle-hero.entry.js +4 -2
  201. package/dist/esm/stzh-pagetitle.entry.js +3 -1
  202. package/dist/esm/stzh-popover.entry.js +1 -1
  203. package/dist/esm/stzh-portal-mitwirken.entry.js +1 -1
  204. package/dist/esm/stzh-readspeaker.entry.js +3 -1
  205. package/dist/esm/stzh-sortable.entry.js +4 -2
  206. package/dist/esm/stzh-space.entry.js +1 -1
  207. package/dist/esm/stzh-sticky.entry.js +3 -1
  208. package/dist/esm/stzh-table.entry.js +14 -4
  209. package/dist/esm/stzh-upload.entry.js +1 -1
  210. package/dist/esm/stzh-vbz-linechip.entry.js +1 -1
  211. package/dist/esm/stzh-vbz-ticker.entry.js +16 -11
  212. package/dist/esm/stzh-vspace.entry.js +1 -1
  213. package/dist/esm-es5/_commonjsHelpers-ba3f0406.js +1 -0
  214. package/dist/esm-es5/app-globals-62e1178d.js +1 -0
  215. package/dist/esm-es5/{js.cookie-53735b72.js → js.cookie-28a40640.js} +1 -1
  216. package/dist/esm-es5/loader.js +1 -1
  217. package/dist/esm-es5/stzh-actions.entry.js +1 -1
  218. package/dist/esm-es5/stzh-actionset.entry.js +1 -1
  219. package/dist/esm-es5/stzh-appnav.entry.js +1 -1
  220. package/dist/esm-es5/stzh-badge_3.entry.js +1 -1
  221. package/dist/esm-es5/stzh-calendar.entry.js +1 -1
  222. package/dist/esm-es5/stzh-card_3.entry.js +1 -1
  223. package/dist/esm-es5/stzh-carousel.entry.js +1 -0
  224. package/dist/esm-es5/stzh-chart.entry.js +3 -3
  225. package/dist/esm-es5/stzh-checkboxgroup.entry.js +1 -1
  226. package/dist/esm-es5/stzh-chip_2.entry.js +1 -1
  227. package/dist/esm-es5/stzh-components.js +1 -1
  228. package/dist/esm-es5/stzh-cspace.entry.js +1 -1
  229. package/dist/esm-es5/stzh-datalist_2.entry.js +1 -1
  230. package/dist/esm-es5/stzh-datamessagelist-item.entry.js +1 -1
  231. package/dist/esm-es5/stzh-datatable.entry.js +2 -2
  232. package/dist/esm-es5/stzh-datepicker_3.entry.js +1 -1
  233. package/dist/esm-es5/stzh-dialog.entry.js +1 -1
  234. package/dist/esm-es5/stzh-dropdown.entry.js +2 -2
  235. package/dist/esm-es5/stzh-footer.entry.js +1 -1
  236. package/dist/esm-es5/stzh-ghettobox_2.entry.js +1 -1
  237. package/dist/esm-es5/stzh-header.entry.js +1 -1
  238. package/dist/esm-es5/stzh-hspace.entry.js +1 -1
  239. package/dist/esm-es5/stzh-input.entry.js +1 -1
  240. package/dist/esm-es5/stzh-invert.entry.js +1 -1
  241. package/dist/esm-es5/stzh-link.entry.js +1 -1
  242. package/dist/esm-es5/stzh-loader.entry.js +1 -1
  243. package/dist/esm-es5/stzh-menu_2.entry.js +1 -1
  244. package/dist/esm-es5/stzh-message.entry.js +1 -1
  245. package/dist/esm-es5/stzh-metanav.entry.js +1 -1
  246. package/dist/esm-es5/stzh-microsite-teaserlist.entry.js +1 -1
  247. package/dist/esm-es5/stzh-olmap.entry.js +1 -1
  248. package/dist/esm-es5/stzh-page-skiplinks.entry.js +1 -1
  249. package/dist/esm-es5/stzh-pagetitle-hero.entry.js +1 -1
  250. package/dist/esm-es5/stzh-pagetitle.entry.js +1 -1
  251. package/dist/esm-es5/stzh-popover.entry.js +1 -1
  252. package/dist/esm-es5/stzh-portal-mitwirken.entry.js +1 -1
  253. package/dist/esm-es5/stzh-readspeaker.entry.js +1 -1
  254. package/dist/esm-es5/stzh-sortable.entry.js +2 -2
  255. package/dist/esm-es5/stzh-space.entry.js +1 -1
  256. package/dist/esm-es5/stzh-sticky.entry.js +1 -1
  257. package/dist/esm-es5/stzh-table.entry.js +1 -1
  258. package/dist/esm-es5/stzh-upload.entry.js +1 -1
  259. package/dist/esm-es5/stzh-vbz-linechip.entry.js +1 -1
  260. package/dist/esm-es5/stzh-vbz-ticker.entry.js +1 -1
  261. package/dist/esm-es5/stzh-vspace.entry.js +1 -1
  262. package/dist/stzh-components/assets/i18n/de.json +10 -0
  263. package/dist/stzh-components/assets/i18n/en.json +11 -1
  264. package/dist/stzh-components/p-0a408348.entry.js +1 -0
  265. package/dist/stzh-components/{p-ff328114.system.entry.js → p-0c779613.system.entry.js} +1 -1
  266. package/dist/stzh-components/{p-55752bd5.system.entry.js → p-0e690e3e.system.entry.js} +1 -1
  267. package/dist/stzh-components/p-10b4fedd.system.entry.js +1 -0
  268. package/dist/stzh-components/p-14729939.entry.js +1 -0
  269. package/dist/stzh-components/p-1494b502.entry.js +1 -0
  270. package/dist/stzh-components/p-14d5a56d.entry.js +1 -0
  271. package/dist/stzh-components/p-205f5111.system.entry.js +1 -0
  272. package/dist/stzh-components/{p-c8cc2563.system.entry.js → p-263fd0bb.system.entry.js} +1 -1
  273. package/dist/stzh-components/p-2ed20db5.entry.js +1 -0
  274. package/dist/stzh-components/p-322e74e9.system.entry.js +1 -0
  275. package/dist/stzh-components/p-353294ce.entry.js +1 -0
  276. package/dist/stzh-components/p-396697db.system.entry.js +1 -0
  277. package/dist/stzh-components/p-3a73b8b5.system.js +1 -0
  278. package/dist/stzh-components/p-3af95b5d.entry.js +1 -0
  279. package/dist/stzh-components/p-3e8ff66b.js +1 -0
  280. package/dist/stzh-components/p-3f80ce87.entry.js +1 -0
  281. package/dist/stzh-components/{p-c2f909c1.system.entry.js → p-3fc51ad1.system.entry.js} +1 -1
  282. package/dist/stzh-components/p-4453449f.entry.js +1 -0
  283. package/dist/stzh-components/{p-6a94e520.system.entry.js → p-454e50f8.system.entry.js} +1 -1
  284. package/dist/stzh-components/{p-d54ff4d4.system.entry.js → p-47175c6f.system.entry.js} +1 -1
  285. package/dist/stzh-components/p-48d40c7c.system.entry.js +1 -0
  286. package/dist/stzh-components/{p-5c72664e.system.entry.js → p-4acb6752.system.entry.js} +1 -1
  287. package/dist/stzh-components/{p-b1ffc2a9.system.entry.js → p-4b995fe4.system.entry.js} +1 -1
  288. package/dist/stzh-components/{p-be97cb22.entry.js → p-4da7ebff.entry.js} +1 -1
  289. package/dist/stzh-components/p-4f8085e5.entry.js +1 -0
  290. package/dist/stzh-components/{p-2f4448c9.system.entry.js → p-558f336d.system.entry.js} +1 -1
  291. package/dist/stzh-components/p-5a4aef52.entry.js +1 -0
  292. package/dist/stzh-components/{p-484a366f.system.js → p-5db542ae.system.js} +1 -1
  293. package/dist/stzh-components/{p-72a62d0d.system.entry.js → p-6659b6f6.system.entry.js} +1 -1
  294. package/dist/stzh-components/{p-f3276ca5.system.entry.js → p-6a109ce9.system.entry.js} +1 -1
  295. package/dist/stzh-components/{p-1a98470f.system.entry.js → p-6a26c9eb.system.entry.js} +1 -1
  296. package/dist/stzh-components/p-6bc7f44a.entry.js +1 -0
  297. package/dist/stzh-components/{p-02d51685.entry.js → p-6ee87986.entry.js} +1 -1
  298. package/dist/stzh-components/p-7ff1640c.entry.js +1 -0
  299. package/dist/stzh-components/{p-26889a91.entry.js → p-814e5ae7.entry.js} +2 -2
  300. package/dist/stzh-components/p-821ca4af.system.entry.js +1 -0
  301. package/dist/stzh-components/{p-2b67b0b3.system.entry.js → p-884793dd.system.entry.js} +2 -2
  302. package/dist/stzh-components/{p-a32ae73a.system.entry.js → p-88fbb2fc.system.entry.js} +2 -2
  303. package/dist/stzh-components/p-8b16550d.entry.js +1 -0
  304. package/dist/stzh-components/{p-963a7526.system.entry.js → p-8c371d1d.system.entry.js} +1 -1
  305. package/dist/stzh-components/p-8eda017e.entry.js +1 -0
  306. package/dist/stzh-components/p-949f7885.system.js +1 -0
  307. package/dist/stzh-components/{p-6adc5f0c.system.entry.js → p-95bfbf67.system.entry.js} +1 -1
  308. package/dist/stzh-components/p-99d85a97.entry.js +1 -0
  309. package/dist/stzh-components/p-9a94b249.system.entry.js +1 -0
  310. package/dist/stzh-components/{p-32a03d1c.entry.js → p-9ed30a9f.entry.js} +1 -1
  311. package/dist/stzh-components/{p-febba79b.entry.js → p-9f29e6c3.entry.js} +1 -1
  312. package/dist/stzh-components/{p-67816aa4.entry.js → p-a0b2739a.entry.js} +1 -1
  313. package/dist/stzh-components/p-a2121744.system.entry.js +1 -0
  314. package/dist/stzh-components/p-a22ac109.entry.js +1 -0
  315. package/dist/stzh-components/p-a3bf419d.entry.js +1 -0
  316. package/dist/stzh-components/{p-c9c7d88a.entry.js → p-a47e205f.entry.js} +1 -1
  317. package/dist/stzh-components/p-aa2c81e6.system.entry.js +3 -0
  318. package/dist/stzh-components/{p-088b16c6.system.entry.js → p-abf13db9.system.entry.js} +1 -1
  319. package/dist/stzh-components/p-ad96eb50.entry.js +1 -0
  320. package/dist/stzh-components/p-ae7255f6.entry.js +1 -0
  321. package/dist/stzh-components/p-af05718d.system.entry.js +1 -0
  322. package/dist/stzh-components/p-af9aac53.entry.js +3 -0
  323. package/dist/stzh-components/{p-24b8df26.js → p-b10682ee.js} +1 -1
  324. package/dist/stzh-components/p-b4c28bf5.entry.js +1 -0
  325. package/dist/stzh-components/p-b4db3558.js +1 -0
  326. package/dist/stzh-components/p-b61f7404.entry.js +1 -0
  327. package/dist/stzh-components/p-b9adebdc.entry.js +1 -0
  328. package/dist/stzh-components/{p-c4c620fa.system.entry.js → p-b9bd42e6.system.entry.js} +1 -1
  329. package/dist/stzh-components/p-b9f784e4.system.entry.js +1 -0
  330. package/dist/stzh-components/{p-b92734db.entry.js → p-bcfba21f.entry.js} +1 -1
  331. package/dist/stzh-components/p-bd1a5d6d.system.entry.js +1 -0
  332. package/dist/stzh-components/p-c457dad2.system.entry.js +1 -0
  333. package/dist/stzh-components/{p-f8feb07b.entry.js → p-c80a9d50.entry.js} +1 -1
  334. package/dist/stzh-components/p-c9940c35.entry.js +1 -0
  335. package/dist/stzh-components/p-cab1a192.entry.js +1 -0
  336. package/dist/stzh-components/p-cd59cead.system.js +1 -0
  337. package/dist/stzh-components/{p-102e2bcd.system.entry.js → p-cd979ce9.system.entry.js} +1 -1
  338. package/dist/stzh-components/{p-512c38b3.system.entry.js → p-ce5db779.system.entry.js} +1 -1
  339. package/dist/stzh-components/p-d29fd401.entry.js +1 -0
  340. package/dist/stzh-components/{p-7e4261ce.system.entry.js → p-d5514e5b.system.entry.js} +1 -1
  341. package/dist/stzh-components/{p-51b3a560.system.entry.js → p-d585e8fd.system.entry.js} +1 -1
  342. package/dist/stzh-components/p-d5994419.system.entry.js +1 -0
  343. package/dist/stzh-components/p-d6e5f396.system.entry.js +1 -0
  344. package/dist/stzh-components/{p-444b2baf.entry.js → p-e085a0a0.entry.js} +1 -1
  345. package/dist/stzh-components/p-e1501622.system.entry.js +1 -0
  346. package/dist/stzh-components/p-e2d80ee3.entry.js +1 -0
  347. package/dist/stzh-components/p-e4aa12ba.system.entry.js +1 -0
  348. package/dist/stzh-components/p-e54f66ea.system.entry.js +1 -0
  349. package/dist/stzh-components/{p-d9ae09b5.entry.js → p-eb16ad0d.entry.js} +2 -2
  350. package/dist/stzh-components/p-eb1ea7f0.entry.js +1 -0
  351. package/dist/stzh-components/{p-e1b2785b.entry.js → p-ec87506f.entry.js} +1 -1
  352. package/dist/stzh-components/{p-309fc559.system.entry.js → p-ee20b95b.system.entry.js} +1 -1
  353. package/dist/stzh-components/p-f122e15d.system.entry.js +1 -0
  354. package/dist/stzh-components/{p-809ed955.system.entry.js → p-f27d1a06.system.entry.js} +1 -1
  355. package/dist/stzh-components/p-f449f909.entry.js +1 -0
  356. package/dist/stzh-components/{p-af67ea5e.entry.js → p-f4c0d928.entry.js} +1 -1
  357. package/dist/stzh-components/p-f725921a.entry.js +1 -0
  358. package/dist/stzh-components/p-fe1c8047.system.entry.js +1 -0
  359. package/dist/stzh-components/stzh-components.css +1 -1
  360. package/dist/stzh-components/stzh-components.esm.js +1 -1
  361. package/dist/stzh-components/stzh-components.js +1 -1
  362. package/dist/types/components/stzh-carousel/stzh-carousel.localization.d.ts +5 -0
  363. package/dist/types/components/stzh-clamp/stzh-clamp.localization.d.ts +5 -0
  364. package/dist/types/components.d.ts +250 -2
  365. package/dist/types/index.d.ts +20 -0
  366. package/dist/types/utils/translation-utils.d.ts +2 -0
  367. package/dist/vscode-data.json +106 -17
  368. package/package.json +6 -4
  369. package/dist/cjs/app-globals-57922fc2.js +0 -56
  370. package/dist/esm/app-globals-b848652e.js +0 -54
  371. package/dist/esm-es5/_commonjsHelpers-f9dc4873.js +0 -1
  372. package/dist/esm-es5/app-globals-b848652e.js +0 -1
  373. package/dist/stzh-components/p-07dc23a3.system.entry.js +0 -1
  374. package/dist/stzh-components/p-0ba944ab.entry.js +0 -1
  375. package/dist/stzh-components/p-12856e02.system.entry.js +0 -1
  376. package/dist/stzh-components/p-16c0b9ae.entry.js +0 -3
  377. package/dist/stzh-components/p-18e20038.entry.js +0 -1
  378. package/dist/stzh-components/p-1bcda13d.system.entry.js +0 -1
  379. package/dist/stzh-components/p-1d435dd8.system.entry.js +0 -1
  380. package/dist/stzh-components/p-1f74846f.entry.js +0 -1
  381. package/dist/stzh-components/p-29e9ad9f.system.entry.js +0 -1
  382. package/dist/stzh-components/p-30a9de85.system.entry.js +0 -1
  383. package/dist/stzh-components/p-37920e74.system.entry.js +0 -1
  384. package/dist/stzh-components/p-4633b93d.entry.js +0 -1
  385. package/dist/stzh-components/p-4c60da30.entry.js +0 -1
  386. package/dist/stzh-components/p-4eee30ea.system.entry.js +0 -1
  387. package/dist/stzh-components/p-532b4218.entry.js +0 -1
  388. package/dist/stzh-components/p-5d55a672.system.entry.js +0 -1
  389. package/dist/stzh-components/p-64cdef2f.entry.js +0 -1
  390. package/dist/stzh-components/p-65918f6f.system.js +0 -1
  391. package/dist/stzh-components/p-761ee059.entry.js +0 -1
  392. package/dist/stzh-components/p-798ac79c.entry.js +0 -1
  393. package/dist/stzh-components/p-7f857e56.entry.js +0 -1
  394. package/dist/stzh-components/p-84a6e023.system.entry.js +0 -1
  395. package/dist/stzh-components/p-89bd0d46.entry.js +0 -1
  396. package/dist/stzh-components/p-8caafed2.system.entry.js +0 -1
  397. package/dist/stzh-components/p-923dffc7.entry.js +0 -1
  398. package/dist/stzh-components/p-94662bed.system.js +0 -1
  399. package/dist/stzh-components/p-951b04ab.entry.js +0 -1
  400. package/dist/stzh-components/p-990f395b.entry.js +0 -1
  401. package/dist/stzh-components/p-99b82949.entry.js +0 -1
  402. package/dist/stzh-components/p-9be21c72.entry.js +0 -1
  403. package/dist/stzh-components/p-9c35c9cd.entry.js +0 -1
  404. package/dist/stzh-components/p-9c90535a.system.js +0 -1
  405. package/dist/stzh-components/p-9de8b25b.entry.js +0 -1
  406. package/dist/stzh-components/p-a11ef2d6.system.entry.js +0 -1
  407. package/dist/stzh-components/p-a691fe87.js +0 -1
  408. package/dist/stzh-components/p-a6be6aca.system.entry.js +0 -1
  409. package/dist/stzh-components/p-a6d4a8b1.js +0 -1
  410. package/dist/stzh-components/p-a7eb3e02.system.entry.js +0 -1
  411. package/dist/stzh-components/p-ae38f1d2.entry.js +0 -1
  412. package/dist/stzh-components/p-b04a9d0f.system.entry.js +0 -1
  413. package/dist/stzh-components/p-b422041d.entry.js +0 -1
  414. package/dist/stzh-components/p-b9372a2a.entry.js +0 -1
  415. package/dist/stzh-components/p-bb698e26.entry.js +0 -1
  416. package/dist/stzh-components/p-bc545121.entry.js +0 -1
  417. package/dist/stzh-components/p-c2a22eb8.entry.js +0 -1
  418. package/dist/stzh-components/p-cc722b35.system.entry.js +0 -3
  419. package/dist/stzh-components/p-d1cfe06b.entry.js +0 -1
  420. package/dist/stzh-components/p-d943e02c.system.entry.js +0 -1
  421. package/dist/stzh-components/p-db306e24.entry.js +0 -1
  422. package/dist/stzh-components/p-e4a8f1bc.system.entry.js +0 -1
  423. package/dist/stzh-components/p-ed783154.system.entry.js +0 -1
  424. package/dist/stzh-components/p-ee4b939a.entry.js +0 -1
  425. package/dist/stzh-components/p-f0e2a32d.entry.js +0 -1
  426. package/dist/stzh-components/p-fd15cc86.entry.js +0 -1
  427. package/dist/types/components/stzh-clamp/stzh-clamp.d.ts +0 -16
@@ -0,0 +1,966 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { isStzhElement } from "../../utils/utils";
3
+ import { fetchTranslations } from "../../utils/translation-utils";
4
+ import { media, addMediaChangeListener, removeMediaChangeListener } from '../../utils/media-utils';
5
+ const reducedMotionMedia = window.matchMedia("(prefers-reduced-motion: reduce)");
6
+ let carouselCounter = 0;
7
+ /*
8
+ * Inspired by:
9
+ *
10
+ * - https://github.com/barthy-koeln/scroll-snap-slider
11
+ * - https://tannerhodges.github.io/snap-slider/
12
+ * - https://www.w3.org/WAI/ARIA/apg/patterns/carousel/examples/carousel-1-prev-next/
13
+ * - https://dev.to/jasonwebb/how-to-build-a-more-accessible-carousel-or-slider-35lp
14
+ * - http://web-accessibility.carnegiemuseums.org/code/carousels/
15
+ */
16
+ /**
17
+ * @slot - Slot any element
18
+ */
19
+ export class StzhCarousel {
20
+ constructor() {
21
+ /** Current scroll position */
22
+ this.slideScrollLeft = 0;
23
+ /** Flag whether scrolling was done by user or not */
24
+ this.scrolledByAutoplay = false;
25
+ /** Timeout ID used to catch the end of scroll events */
26
+ this.scrollTimeoutId = null;
27
+ /** Last drag event position */
28
+ this.lastX = null;
29
+ /** Where the dragging started */
30
+ this.startX = null;
31
+ /** Where the dragging started scroll position */
32
+ this.startScrollLeft = null;
33
+ /** Timeout ID for a smooth drag release */
34
+ this.disableTimeoutId = null;
35
+ /** Whether user has just stopped dragging */
36
+ this.stoppedDragging = false;
37
+ this.onReducedMotionMediaChange = () => {
38
+ this.autoplayDisabledByMotionMedia = reducedMotionMedia.matches;
39
+ };
40
+ this.onMouseenter = () => {
41
+ this.autoplayDisabledByMouse = true;
42
+ };
43
+ this.onMouseleave = () => {
44
+ this.autoplayDisabledByMouse = false;
45
+ };
46
+ this.onFocusin = () => {
47
+ this.autoplayDisabledByFocus = true;
48
+ };
49
+ this.onFocusout = () => {
50
+ this.autoplayDisabledByFocus = false;
51
+ };
52
+ this.onPreviousClick = () => {
53
+ this.scrollToPreviousSnapPoint();
54
+ };
55
+ this.onNextClick = () => {
56
+ this.scrollToNextSnapPoint();
57
+ };
58
+ this.onSlideResize = () => {
59
+ if (this.scrollElement) {
60
+ this.itemSize = this.sizingMethod();
61
+ }
62
+ };
63
+ this.onMutation = () => {
64
+ if (!this.scrollElement) {
65
+ return;
66
+ }
67
+ this.slideElements = Array.from(this.scrollElement.children);
68
+ this.slideElements.forEach((slide, index) => {
69
+ slide.setAttribute("role", "group");
70
+ slide.setAttribute("aria-roledescription", "slide");
71
+ slide.setAttribute("aria-label", this.localization.slideLabel
72
+ .replace(/\{current\}/gi, (index + 1).toString())
73
+ .replace(/\{total\}/gi, this.slideElements.length.toString()));
74
+ });
75
+ this.previousElements = Array.from(this.element.querySelectorAll("[data-stzh-carousel-previous]"));
76
+ this.nextElements = Array.from(this.element.querySelectorAll("[data-stzh-carousel-next]"));
77
+ this.navigationTextElements = Array.from(this.element.querySelectorAll("[data-stzh-carousel-navigation-text]"));
78
+ };
79
+ this.onScroll = () => {
80
+ if (this.scrollTimeoutId === null) {
81
+ const direction = (this.scrollElement.scrollLeft > this.slideScrollLeft) ? 1 : -1;
82
+ this.scrolling = true;
83
+ if (!this.scrolledByAutoplay) {
84
+ this.autoplay = false;
85
+ }
86
+ this.stzhSlideStart.emit({
87
+ component: "stzh-carousel",
88
+ index: this.slide + direction
89
+ });
90
+ }
91
+ if (this.slide !== this.calculateSlide()) {
92
+ this.update();
93
+ this.stzhSlidePassed.emit({
94
+ component: "stzh-carousel",
95
+ index: this.slide
96
+ });
97
+ }
98
+ this.scrollTimeoutId && window.clearTimeout(this.scrollTimeoutId);
99
+ this.scrollTimeoutId = window.setTimeout(this.onScrollEnd, this.scrollTimeout);
100
+ };
101
+ this.onScrollEnd = () => {
102
+ this.scrollTimeoutId = null;
103
+ this.update();
104
+ this.scrolling = false;
105
+ this.scrolledByAutoplay = false;
106
+ if (this.stoppedDragging) {
107
+ this.stoppedDragging = false;
108
+ this.scrollElement.style.removeProperty("scroll-behavior");
109
+ this.scrollElement.style.removeProperty("scroll-snap-type");
110
+ }
111
+ if (this.tabThrough || this.variant === "cards") {
112
+ this.ariaLive = "";
113
+ }
114
+ else {
115
+ this.ariaLive = (this.currentSlides > 1 ? this.localization.slidesLabel : this.localization.slideLabel)
116
+ .replace(/\{(current|from)\}/gi, (this.slide + 1).toString())
117
+ .replace(/\{to\}/gi, (this.slide + this.currentSlides).toString())
118
+ .replace(/\{total\}/gi, this.slideElements.length.toString());
119
+ }
120
+ this.stzhSlideEnd.emit({
121
+ component: "stzh-carousel",
122
+ index: this.slide
123
+ });
124
+ };
125
+ this.onMediaChange = () => {
126
+ const ultra = media("ultra").matches;
127
+ const large = media("large").matches;
128
+ const medium = media("medium").matches;
129
+ const small = media("small").matches;
130
+ if (ultra && this.slidesUltra !== 0) {
131
+ this.currentSlides = this.slidesUltra;
132
+ }
133
+ else if (large && this.slidesLarge !== 0) {
134
+ this.currentSlides = this.slidesLarge;
135
+ }
136
+ else if (medium && this.slidesMedium !== 0) {
137
+ this.currentSlides = this.slidesMedium;
138
+ }
139
+ else if (small && this.slidesSmall !== 0) {
140
+ this.currentSlides = this.slidesSmall;
141
+ }
142
+ else {
143
+ this.currentSlides = this.slides;
144
+ }
145
+ // if (ultra && this.swipeSlidesUltra !== 0) {
146
+ // this.currentSwipeSlides = this.swipeSlidesUltra;
147
+ // } else if (large && this.swipeSlidesLarge !== 0) {
148
+ // this.currentSwipeSlides = this.swipeSlidesLarge;
149
+ // } else if (medium && this.swipeSlidesMedium !== 0) {
150
+ // this.currentSwipeSlides = this.swipeSlidesMedium;
151
+ // } else if (small && this.swipeSlidesSmall !== 0) {
152
+ // this.currentSwipeSlides = this.swipeSlidesSmall;
153
+ // } else {
154
+ // this.currentSwipeSlides = this.swipeSlides;
155
+ // }
156
+ this.currentSwipeSlides = this.currentSlides;
157
+ };
158
+ /** Scroll the slider the appropriate amount of pixels and update the last event position */
159
+ this.mouseMove = (event) => {
160
+ const distance = this.lastX - event.clientX;
161
+ this.lastX = event.clientX;
162
+ this.scrollElement.scrollLeft += distance;
163
+ };
164
+ /** Clear disable timeout, set up variables and styles and attach the listener. */
165
+ this.startDragging = (event) => {
166
+ event.preventDefault();
167
+ this.disableTimeoutId && window.clearTimeout(this.disableTimeoutId);
168
+ this.disableTimeoutId = null;
169
+ this.startX = this.lastX = event.clientX;
170
+ this.startScrollLeft = this.scrollElement.scrollLeft;
171
+ this.scrollElement.style.setProperty("scroll-behavior", "auto");
172
+ this.scrollElement.style.setProperty("scroll-snap-type", "unset");
173
+ this.dragging = true;
174
+ this.autoplay = false;
175
+ window.addEventListener("mousemove", this.mouseMove);
176
+ window.addEventListener("mouseup", this.stopDragging, { capture: true });
177
+ window.addEventListener("click", this.checkClick, { capture: true });
178
+ };
179
+ /** User stopped dragging */
180
+ this.stopDragging = (event) => {
181
+ event.preventDefault();
182
+ const distance = Math.abs(this.startX - this.lastX);
183
+ const minimumReached = distance > this.distanceQuickSwipe;
184
+ const direction = (this.lastX > this.startX) ? 1 : -1;
185
+ this.dragging = false;
186
+ const endDraddingLeft = this.scrollElement.scrollLeft;
187
+ this.scrollElement.style.removeProperty("scroll-snap-type");
188
+ const finalLeft = this.scrollElement.scrollLeft;
189
+ this.scrollElement.style.setProperty("scroll-snap-type", "unset");
190
+ this.scrollElement.scrollTo({ left: endDraddingLeft, behavior: "auto" });
191
+ if (finalLeft !== this.startScrollLeft || !minimumReached) {
192
+ this.scrollElement.scrollTo({ left: finalLeft, behavior: reducedMotionMedia.matches ? "auto" : "smooth" });
193
+ }
194
+ else if (direction === 1) {
195
+ this.slideToPrevious();
196
+ }
197
+ else {
198
+ this.slideToNext();
199
+ }
200
+ window.removeEventListener("mousemove", this.mouseMove);
201
+ window.removeEventListener("mouseup", this.stopDragging, { capture: true });
202
+ this.stoppedDragging = true;
203
+ };
204
+ this.checkClick = (event) => {
205
+ const distance = Math.abs(this.startX - this.lastX);
206
+ const minimumReached = distance > this.distancePreventClick;
207
+ if (minimumReached) {
208
+ event.preventDefault();
209
+ }
210
+ this.lastX = null;
211
+ window.removeEventListener("click", this.checkClick, { capture: true });
212
+ };
213
+ this.autoplayInterval = () => {
214
+ this.scrolledByAutoplay = true;
215
+ if (this.hasReachedLastSlide()) {
216
+ this.slideTo(0);
217
+ }
218
+ else {
219
+ this.slideToNext();
220
+ }
221
+ };
222
+ this.localization = undefined;
223
+ this.variant = "default";
224
+ this.disabled = false;
225
+ this.slides = 1;
226
+ this.slidesSmall = 0;
227
+ this.slidesMedium = 0;
228
+ this.slidesLarge = 0;
229
+ this.slidesUltra = 0;
230
+ this.slide = 0;
231
+ this.autoplay = false;
232
+ this.tabThrough = false;
233
+ this.preventMouseDrag = false;
234
+ this.scrollTimeout = 100;
235
+ this.autoplayTimeout = 3000;
236
+ this.distanceQuickSwipe = 40;
237
+ this.distancePreventClick = 6;
238
+ this.autoplayRunning = false;
239
+ this.autoplayDisabledByMotionMedia = false;
240
+ this.autoplayDisabledByMouse = false;
241
+ this.autoplayDisabledByFocus = false;
242
+ this.dragging = false;
243
+ this.scrolling = false;
244
+ this.ariaLive = "";
245
+ this.currentSlides = 1;
246
+ this.currentSwipeSlides = 1;
247
+ this.slideElements = [];
248
+ this.previousElements = [];
249
+ this.nextElements = [];
250
+ this.navigationTextElements = [];
251
+ }
252
+ /** Scroll to a slide by index */
253
+ async slideTo(index, behaviour = "smooth") {
254
+ this.scrollToSlide(index, behaviour);
255
+ }
256
+ /** Scroll to previous snap point */
257
+ async slideToPrevious(behaviour = "smooth") {
258
+ this.scrollToPreviousSnapPoint(behaviour);
259
+ }
260
+ /** Scroll to next snap point */
261
+ async slideToNext(behaviour = "smooth") {
262
+ this.scrollToNextSnapPoint(behaviour);
263
+ }
264
+ disabledWatcher() {
265
+ if (this.disabled) {
266
+ this.scrollElement && this.scrollElement.removeEventListener("scroll", this.onScroll);
267
+ this.scrollTimeoutId && window.clearTimeout(this.scrollTimeoutId);
268
+ this.scrollTimeoutId = null;
269
+ this.element.removeEventListener("mouseenter", this.onMouseenter);
270
+ this.element.removeEventListener("mouseleave", this.onMouseleave);
271
+ this.element.removeEventListener("focusin", this.onFocusin);
272
+ this.element.removeEventListener("focusout", this.onFocusout);
273
+ this.onReducedMotionMediaChange();
274
+ reducedMotionMedia && reducedMotionMedia.removeEventListener("change", this.onReducedMotionMediaChange);
275
+ }
276
+ else {
277
+ this.scrollElement && this.scrollElement.addEventListener("scroll", this.onScroll, { passive: true });
278
+ this.element.addEventListener("mouseenter", this.onMouseenter);
279
+ this.element.addEventListener("mouseleave", this.onMouseleave);
280
+ this.element.addEventListener("focusin", this.onFocusin);
281
+ this.element.addEventListener("focusout", this.onFocusout);
282
+ reducedMotionMedia && reducedMotionMedia.addEventListener("change", this.onReducedMotionMediaChange);
283
+ }
284
+ }
285
+ preventMouseDragWatcher() {
286
+ if (this.preventMouseDrag || this.disabled) {
287
+ this.disableTimeoutId && window.clearTimeout(this.disableTimeoutId);
288
+ this.disableTimeoutId = null;
289
+ this.scrollElement && this.scrollElement.removeEventListener("mousedown", this.startDragging);
290
+ this.lastX = null;
291
+ }
292
+ else {
293
+ this.scrollElement && this.scrollElement.addEventListener("mousedown", this.startDragging);
294
+ }
295
+ }
296
+ autoplayRunningWatcher() {
297
+ if (!this.autoplay
298
+ || this.disabled
299
+ || this.autoplayDisabledByMotionMedia
300
+ || this.autoplayDisabledByMouse
301
+ || this.autoplayDisabledByFocus) {
302
+ this.autoplayIntervalId && window.clearInterval(this.autoplayIntervalId);
303
+ this.autoplayIntervalId = null;
304
+ this.autoplayRunning = false;
305
+ }
306
+ else {
307
+ this.autoplayIntervalId && window.clearInterval(this.autoplayIntervalId);
308
+ this.autoplayIntervalId = window.setInterval(this.autoplayInterval, this.autoplayTimeout);
309
+ this.autoplayRunning = true;
310
+ }
311
+ }
312
+ snapAlignWatcher() {
313
+ this.slideElements.forEach((slide, index) => {
314
+ const shouldSnap = (index - this.currentSwipeSlides) % this.currentSwipeSlides === 0;
315
+ if (shouldSnap) {
316
+ slide.style.removeProperty("scroll-snap-align");
317
+ }
318
+ else {
319
+ slide.style.setProperty("scroll-snap-align", "none");
320
+ }
321
+ });
322
+ }
323
+ inertWatcher() {
324
+ this.slideElements.forEach((slide, index) => {
325
+ const isActive = this.tabThrough
326
+ || this.variant === "cards"
327
+ || index >= this.slide && index < this.slide + this.currentSlides;
328
+ slide.inert = !isActive;
329
+ if (isActive) {
330
+ slide.removeAttribute("aria-hidden");
331
+ }
332
+ else {
333
+ slide.setAttribute("aria-hidden", isActive ? "false" : "true");
334
+ }
335
+ });
336
+ }
337
+ prevNextNavigationWatcher() {
338
+ const tabThrough = this.tabThrough || this.variant === "cards";
339
+ const setAriaAttributes = (element) => {
340
+ const isStzh = isStzhElement(element);
341
+ if (tabThrough) {
342
+ element.setAttribute("aria-hidden", "true");
343
+ element.setAttribute(isStzh ? "a11y-tabindex" : "tabindex", "-1");
344
+ }
345
+ else {
346
+ element.removeAttribute("aria-hidden");
347
+ element.removeAttribute(isStzh ? "a11y-tabindex" : "tabindex");
348
+ }
349
+ };
350
+ this.nextElements.forEach(setAriaAttributes);
351
+ this.previousElements.forEach(setAriaAttributes);
352
+ }
353
+ prevNextHiddenWatcher() {
354
+ const hideElements = this.slideElements.length <= this.currentSlides;
355
+ const setHiddenAttribute = (element) => {
356
+ if (hideElements) {
357
+ element.setAttribute("hidden", "");
358
+ }
359
+ else {
360
+ element.removeAttribute("hidden");
361
+ }
362
+ };
363
+ this.navigationTextElements.forEach(setHiddenAttribute);
364
+ this.nextElements.forEach(setHiddenAttribute);
365
+ this.previousElements.forEach(setHiddenAttribute);
366
+ }
367
+ nextPrevDisabledWatcher() {
368
+ if (!this.scrollElement) {
369
+ return;
370
+ }
371
+ const reachedFirstSlide = this.slide === 0;
372
+ const reachedLastSlide = this.hasReachedLastSlide();
373
+ this.nextElements.forEach((element) => {
374
+ const isStzh = isStzhElement(element);
375
+ element.setAttribute(isStzh ? "a11y-disabled" : "aria-disabled", reachedLastSlide ? "true" : "false");
376
+ });
377
+ this.previousElements.forEach((element) => {
378
+ const isStzh = isStzhElement(element);
379
+ element.setAttribute(isStzh ? "a11y-disabled" : "aria-disabled", reachedFirstSlide ? "true" : "false");
380
+ });
381
+ }
382
+ nextElementsWatcher() {
383
+ this.nextElements.forEach((nextElement) => {
384
+ const isStzh = isStzhElement(nextElement);
385
+ nextElement.addEventListener("click", this.onNextClick);
386
+ nextElement.setAttribute(isStzh ? "a11y-controls" : "aria-controls", `${this.carouselId}-scroll`);
387
+ });
388
+ }
389
+ previousElementsWatcher() {
390
+ this.previousElements.forEach((previousElement) => {
391
+ const isStzh = isStzhElement(previousElement);
392
+ previousElement.addEventListener("click", this.onPreviousClick);
393
+ previousElement.setAttribute(isStzh ? "a11y-controls" : "aria-controls", `${this.carouselId}-scroll`);
394
+ });
395
+ }
396
+ scrollToSlide(index, behaviour = "smooth") {
397
+ if (this.disabled) {
398
+ return;
399
+ }
400
+ this.scrollElement.scrollTo({
401
+ left: index * this.itemSize,
402
+ behavior: reducedMotionMedia.matches ? "auto" : behaviour
403
+ });
404
+ }
405
+ /** Width of a slide */
406
+ sizingMethod() {
407
+ const css = window.getComputedStyle(this.scrollElement);
408
+ return this.scrollElement.firstElementChild.offsetWidth
409
+ + parseInt(css.getPropertyValue("column-gap"), 10);
410
+ }
411
+ /**
412
+ * Calculates the active slide.
413
+ * The scroll-snap-type property makes sure that the container snaps perfectly to integer multiples.
414
+ */
415
+ calculateSlide() {
416
+ // Math.round: Dispatch 'stzhSlidePassed' events around the center of each slide
417
+ // Math.ceil: Dispatch 'stzhSlidePassed' events as soon as the next one is visible
418
+ // Math.floor: Dispatch 'stzhSlidePassed' events only when the next one is fully visible
419
+ return Math.floor(this.scrollElement.scrollLeft / this.itemSize);
420
+ }
421
+ scrollToPreviousSnapPoint(behaviour = "smooth") {
422
+ if (this.disabled) {
423
+ return;
424
+ }
425
+ let previousIndex = this.slide;
426
+ let canSnap = false;
427
+ while (!canSnap && previousIndex > 0) {
428
+ previousIndex = previousIndex - 1;
429
+ canSnap = (previousIndex - this.currentSwipeSlides) % this.currentSwipeSlides === 0;
430
+ }
431
+ this.slideTo(previousIndex, behaviour);
432
+ }
433
+ scrollToNextSnapPoint(behaviour = "smooth") {
434
+ if (this.disabled) {
435
+ return;
436
+ }
437
+ this.slideTo(this.slide + this.currentSwipeSlides, behaviour);
438
+ }
439
+ update() {
440
+ this.slide = this.calculateSlide();
441
+ this.slideScrollLeft = this.slide * this.itemSize;
442
+ this.onMutation();
443
+ }
444
+ hasReachedLastSlide() {
445
+ const { scrollLeft, offsetWidth, scrollWidth } = this.scrollElement;
446
+ return Math.ceil(scrollLeft + offsetWidth) >= scrollWidth;
447
+ }
448
+ async componentWillLoad() {
449
+ this.carouselId = `stzh-carousel-${carouselCounter++}`;
450
+ this.onMediaChange();
451
+ if (!this.localization) {
452
+ this.localization = await fetchTranslations(this.element, "carousel");
453
+ }
454
+ }
455
+ componentDidLoad() {
456
+ this.itemSize = this.sizingMethod();
457
+ this.update();
458
+ this.disabledWatcher();
459
+ this.preventMouseDragWatcher();
460
+ this.autoplayRunningWatcher();
461
+ }
462
+ connectedCallback() {
463
+ addMediaChangeListener(this.onMediaChange);
464
+ this.resizeObserver = new ResizeObserver(this.onSlideResize);
465
+ this.resizeObserver.observe(this.element);
466
+ this.mutationObserver = new MutationObserver(this.onMutation);
467
+ this.mutationObserver.observe(this.element, {
468
+ childList: true,
469
+ subtree: true
470
+ });
471
+ }
472
+ disconnectedCallback() {
473
+ this.scrollTimeoutId && window.clearTimeout(this.scrollTimeoutId);
474
+ this.scrollTimeoutId = null;
475
+ this.disabled = true;
476
+ removeMediaChangeListener(this.onMediaChange);
477
+ if (this.resizeObserver) {
478
+ this.resizeObserver.disconnect();
479
+ }
480
+ if (this.mutationObserver) {
481
+ this.mutationObserver.disconnect();
482
+ }
483
+ }
484
+ render() {
485
+ const classes = {
486
+ "stzh-carousel": true,
487
+ "stzh-carousel--is-disabled": this.disabled,
488
+ "stzh-carousel--is-draggable": !this.preventMouseDrag,
489
+ "stzh-carousel--is-dragging": this.dragging,
490
+ "stzh-carousel--is-scrolling": this.scrolling,
491
+ "stzh-carousel--has-autoplay": this.autoplay,
492
+ "stzh-carousel--is-autoplay-running": this.autoplayRunning,
493
+ "stzh-carousel--is-autoplay-disabled-by-motion-media": this.autoplayDisabledByMotionMedia,
494
+ "stzh-carousel--is-autoplay-disabled-by-mouse": this.autoplayDisabledByMouse,
495
+ "stzh-carousel--is-autoplay-disabled-by-focus": this.autoplayDisabledByFocus
496
+ };
497
+ return (h(Host, { "aria-roledescription": "carousel", style: {
498
+ '--slides': this.currentSlides.toString()
499
+ } }, h("div", { class: classes }, h("slot", { name: "actions" }), h("div", { class: "stzh-carousel__vhidden", "aria-live": this.autoplayDisabledByFocus || this.autoplayDisabledByMouse ? "polite" : "off" }, this.ariaLive), h("div", { ref: (el) => (this.scrollElement = el), id: `${this.carouselId}-scroll`, class: "stzh-carousel__scroll" }, h("slot", null)))));
500
+ }
501
+ static get is() { return "stzh-carousel"; }
502
+ static get encapsulation() { return "scoped"; }
503
+ static get originalStyleUrls() {
504
+ return {
505
+ "$": ["stzh-carousel.scss"]
506
+ };
507
+ }
508
+ static get styleUrls() {
509
+ return {
510
+ "$": ["stzh-carousel.css"]
511
+ };
512
+ }
513
+ static get properties() {
514
+ return {
515
+ "localization": {
516
+ "type": "unknown",
517
+ "mutable": false,
518
+ "complexType": {
519
+ "original": "StzhCarouselLocalizedText",
520
+ "resolved": "StzhLocaleComponent & { slideLabel: string; slidesLabel: string; }",
521
+ "references": {
522
+ "StzhCarouselLocalizedText": {
523
+ "location": "import",
524
+ "path": "./stzh-carousel.localization"
525
+ }
526
+ }
527
+ },
528
+ "required": false,
529
+ "optional": false,
530
+ "docs": {
531
+ "tags": [],
532
+ "text": "Translation strings"
533
+ }
534
+ },
535
+ "variant": {
536
+ "type": "string",
537
+ "mutable": false,
538
+ "complexType": {
539
+ "original": "\"default\" | \"cards\"",
540
+ "resolved": "\"cards\" | \"default\"",
541
+ "references": {}
542
+ },
543
+ "required": false,
544
+ "optional": false,
545
+ "docs": {
546
+ "tags": [],
547
+ "text": "Carousel variant"
548
+ },
549
+ "attribute": "variant",
550
+ "reflect": true,
551
+ "defaultValue": "\"default\""
552
+ },
553
+ "disabled": {
554
+ "type": "boolean",
555
+ "mutable": false,
556
+ "complexType": {
557
+ "original": "boolean",
558
+ "resolved": "boolean",
559
+ "references": {}
560
+ },
561
+ "required": false,
562
+ "optional": false,
563
+ "docs": {
564
+ "tags": [],
565
+ "text": "Whether carousel is disabled"
566
+ },
567
+ "attribute": "disabled",
568
+ "reflect": true,
569
+ "defaultValue": "false"
570
+ },
571
+ "slides": {
572
+ "type": "number",
573
+ "mutable": false,
574
+ "complexType": {
575
+ "original": "number",
576
+ "resolved": "number",
577
+ "references": {}
578
+ },
579
+ "required": false,
580
+ "optional": false,
581
+ "docs": {
582
+ "tags": [],
583
+ "text": "Slides number"
584
+ },
585
+ "attribute": "slides",
586
+ "reflect": false,
587
+ "defaultValue": "1"
588
+ },
589
+ "slidesSmall": {
590
+ "type": "number",
591
+ "mutable": false,
592
+ "complexType": {
593
+ "original": "number",
594
+ "resolved": "number",
595
+ "references": {}
596
+ },
597
+ "required": false,
598
+ "optional": false,
599
+ "docs": {
600
+ "tags": [],
601
+ "text": "Slides number above small breakpoint"
602
+ },
603
+ "attribute": "slides-small",
604
+ "reflect": false,
605
+ "defaultValue": "0"
606
+ },
607
+ "slidesMedium": {
608
+ "type": "number",
609
+ "mutable": false,
610
+ "complexType": {
611
+ "original": "number",
612
+ "resolved": "number",
613
+ "references": {}
614
+ },
615
+ "required": false,
616
+ "optional": false,
617
+ "docs": {
618
+ "tags": [],
619
+ "text": "Slides number above medium breakpoint"
620
+ },
621
+ "attribute": "slides-medium",
622
+ "reflect": false,
623
+ "defaultValue": "0"
624
+ },
625
+ "slidesLarge": {
626
+ "type": "number",
627
+ "mutable": false,
628
+ "complexType": {
629
+ "original": "number",
630
+ "resolved": "number",
631
+ "references": {}
632
+ },
633
+ "required": false,
634
+ "optional": false,
635
+ "docs": {
636
+ "tags": [],
637
+ "text": "Slides number above large breakpoint"
638
+ },
639
+ "attribute": "slides-large",
640
+ "reflect": false,
641
+ "defaultValue": "0"
642
+ },
643
+ "slidesUltra": {
644
+ "type": "number",
645
+ "mutable": false,
646
+ "complexType": {
647
+ "original": "number",
648
+ "resolved": "number",
649
+ "references": {}
650
+ },
651
+ "required": false,
652
+ "optional": false,
653
+ "docs": {
654
+ "tags": [],
655
+ "text": "Slides number above ultra breakpoint"
656
+ },
657
+ "attribute": "slides-ultra",
658
+ "reflect": false,
659
+ "defaultValue": "0"
660
+ },
661
+ "slide": {
662
+ "type": "number",
663
+ "mutable": false,
664
+ "complexType": {
665
+ "original": "number",
666
+ "resolved": "number",
667
+ "references": {}
668
+ },
669
+ "required": false,
670
+ "optional": false,
671
+ "docs": {
672
+ "tags": [],
673
+ "text": "Active slide (readonly)"
674
+ },
675
+ "attribute": "slide",
676
+ "reflect": false,
677
+ "defaultValue": "0"
678
+ },
679
+ "autoplay": {
680
+ "type": "boolean",
681
+ "mutable": true,
682
+ "complexType": {
683
+ "original": "boolean",
684
+ "resolved": "boolean",
685
+ "references": {}
686
+ },
687
+ "required": false,
688
+ "optional": false,
689
+ "docs": {
690
+ "tags": [],
691
+ "text": "Whether autoplay is enabled.\nGets paused, when user has focus inside carousel element or hovers over it.\nAlso when reduced motion media query is active or carousel is set disabled.\nGets disabled permanently, when user interacts with carousel manually (clicks prev/next, scrolls or drags)"
692
+ },
693
+ "attribute": "autoplay",
694
+ "reflect": false,
695
+ "defaultValue": "false"
696
+ },
697
+ "tabThrough": {
698
+ "type": "boolean",
699
+ "mutable": false,
700
+ "complexType": {
701
+ "original": "boolean",
702
+ "resolved": "boolean",
703
+ "references": {}
704
+ },
705
+ "required": false,
706
+ "optional": false,
707
+ "docs": {
708
+ "tags": [],
709
+ "text": "Enable all slides to be tabbable (will disable prev/next arrows from being tabbable).\nBy default only the visible slides will be tabbable and the prev/next can be used to change slides\n(enabled when `variant` is set to `cards`)."
710
+ },
711
+ "attribute": "tab-through",
712
+ "reflect": false,
713
+ "defaultValue": "false"
714
+ }
715
+ };
716
+ }
717
+ static get states() {
718
+ return {
719
+ "preventMouseDrag": {},
720
+ "scrollTimeout": {},
721
+ "autoplayTimeout": {},
722
+ "distanceQuickSwipe": {},
723
+ "distancePreventClick": {},
724
+ "autoplayRunning": {},
725
+ "autoplayDisabledByMotionMedia": {},
726
+ "autoplayDisabledByMouse": {},
727
+ "autoplayDisabledByFocus": {},
728
+ "dragging": {},
729
+ "scrolling": {},
730
+ "ariaLive": {},
731
+ "currentSlides": {},
732
+ "currentSwipeSlides": {},
733
+ "slideElements": {},
734
+ "previousElements": {},
735
+ "nextElements": {},
736
+ "navigationTextElements": {}
737
+ };
738
+ }
739
+ static get events() {
740
+ return [{
741
+ "method": "stzhSlideStart",
742
+ "name": "stzhSlideStart",
743
+ "bubbles": true,
744
+ "cancelable": true,
745
+ "composed": true,
746
+ "docs": {
747
+ "tags": [],
748
+ "text": "Slide start event"
749
+ },
750
+ "complexType": {
751
+ "original": "StzhCarouselSlideStartEvent",
752
+ "resolved": "{ component: \"stzh-carousel\"; index: number; }",
753
+ "references": {
754
+ "StzhCarouselSlideStartEvent": {
755
+ "location": "import",
756
+ "path": "../../index"
757
+ }
758
+ }
759
+ }
760
+ }, {
761
+ "method": "stzhSlidePassed",
762
+ "name": "stzhSlidePassed",
763
+ "bubbles": true,
764
+ "cancelable": true,
765
+ "composed": true,
766
+ "docs": {
767
+ "tags": [],
768
+ "text": "Slide passed event"
769
+ },
770
+ "complexType": {
771
+ "original": "StzhCarouselSlidePassedEvent",
772
+ "resolved": "{ component: \"stzh-carousel\"; index: number; }",
773
+ "references": {
774
+ "StzhCarouselSlidePassedEvent": {
775
+ "location": "import",
776
+ "path": "../../index"
777
+ }
778
+ }
779
+ }
780
+ }, {
781
+ "method": "stzhSlideEnd",
782
+ "name": "stzhSlideEnd",
783
+ "bubbles": true,
784
+ "cancelable": true,
785
+ "composed": true,
786
+ "docs": {
787
+ "tags": [],
788
+ "text": "Slide end event"
789
+ },
790
+ "complexType": {
791
+ "original": "StzhCarouselSlideEndEvent",
792
+ "resolved": "{ component: \"stzh-carousel\"; index: number; }",
793
+ "references": {
794
+ "StzhCarouselSlideEndEvent": {
795
+ "location": "import",
796
+ "path": "../../index"
797
+ }
798
+ }
799
+ }
800
+ }];
801
+ }
802
+ static get methods() {
803
+ return {
804
+ "slideTo": {
805
+ "complexType": {
806
+ "signature": "(index: any, behaviour?: \"auto\" | \"smooth\") => Promise<void>",
807
+ "parameters": [{
808
+ "tags": [],
809
+ "text": ""
810
+ }, {
811
+ "tags": [],
812
+ "text": ""
813
+ }],
814
+ "references": {
815
+ "Promise": {
816
+ "location": "global"
817
+ }
818
+ },
819
+ "return": "Promise<void>"
820
+ },
821
+ "docs": {
822
+ "text": "Scroll to a slide by index",
823
+ "tags": []
824
+ }
825
+ },
826
+ "slideToPrevious": {
827
+ "complexType": {
828
+ "signature": "(behaviour?: \"auto\" | \"smooth\") => Promise<void>",
829
+ "parameters": [{
830
+ "tags": [],
831
+ "text": ""
832
+ }],
833
+ "references": {
834
+ "Promise": {
835
+ "location": "global"
836
+ }
837
+ },
838
+ "return": "Promise<void>"
839
+ },
840
+ "docs": {
841
+ "text": "Scroll to previous snap point",
842
+ "tags": []
843
+ }
844
+ },
845
+ "slideToNext": {
846
+ "complexType": {
847
+ "signature": "(behaviour?: \"auto\" | \"smooth\") => Promise<void>",
848
+ "parameters": [{
849
+ "tags": [],
850
+ "text": ""
851
+ }],
852
+ "references": {
853
+ "Promise": {
854
+ "location": "global"
855
+ }
856
+ },
857
+ "return": "Promise<void>"
858
+ },
859
+ "docs": {
860
+ "text": "Scroll to next snap point",
861
+ "tags": []
862
+ }
863
+ }
864
+ };
865
+ }
866
+ static get elementRef() { return "element"; }
867
+ static get watchers() {
868
+ return [{
869
+ "propName": "disabled",
870
+ "methodName": "disabledWatcher"
871
+ }, {
872
+ "propName": "disabled",
873
+ "methodName": "preventMouseDragWatcher"
874
+ }, {
875
+ "propName": "preventMouseDrag",
876
+ "methodName": "preventMouseDragWatcher"
877
+ }, {
878
+ "propName": "autoplay",
879
+ "methodName": "autoplayRunningWatcher"
880
+ }, {
881
+ "propName": "autoplayDisabledByMotionMedia",
882
+ "methodName": "autoplayRunningWatcher"
883
+ }, {
884
+ "propName": "autoplayDisabledByMouse",
885
+ "methodName": "autoplayRunningWatcher"
886
+ }, {
887
+ "propName": "autoplayDisabledByFocus",
888
+ "methodName": "autoplayRunningWatcher"
889
+ }, {
890
+ "propName": "autoplayTimeout",
891
+ "methodName": "autoplayRunningWatcher"
892
+ }, {
893
+ "propName": "disabled",
894
+ "methodName": "autoplayRunningWatcher"
895
+ }, {
896
+ "propName": "slideElements",
897
+ "methodName": "snapAlignWatcher"
898
+ }, {
899
+ "propName": "currentSwipeSlides",
900
+ "methodName": "snapAlignWatcher"
901
+ }, {
902
+ "propName": "slide",
903
+ "methodName": "inertWatcher"
904
+ }, {
905
+ "propName": "variant",
906
+ "methodName": "inertWatcher"
907
+ }, {
908
+ "propName": "slideElements",
909
+ "methodName": "inertWatcher"
910
+ }, {
911
+ "propName": "currentSlides",
912
+ "methodName": "inertWatcher"
913
+ }, {
914
+ "propName": "tabThrough",
915
+ "methodName": "inertWatcher"
916
+ }, {
917
+ "propName": "variant",
918
+ "methodName": "prevNextNavigationWatcher"
919
+ }, {
920
+ "propName": "tabThrough",
921
+ "methodName": "prevNextNavigationWatcher"
922
+ }, {
923
+ "propName": "nextElements",
924
+ "methodName": "prevNextNavigationWatcher"
925
+ }, {
926
+ "propName": "previousElements",
927
+ "methodName": "prevNextNavigationWatcher"
928
+ }, {
929
+ "propName": "currentSlides",
930
+ "methodName": "prevNextHiddenWatcher"
931
+ }, {
932
+ "propName": "slideElements",
933
+ "methodName": "prevNextHiddenWatcher"
934
+ }, {
935
+ "propName": "nextElements",
936
+ "methodName": "prevNextHiddenWatcher"
937
+ }, {
938
+ "propName": "previousElements",
939
+ "methodName": "prevNextHiddenWatcher"
940
+ }, {
941
+ "propName": "navigationTextElements",
942
+ "methodName": "prevNextHiddenWatcher"
943
+ }, {
944
+ "propName": "slide",
945
+ "methodName": "nextPrevDisabledWatcher"
946
+ }, {
947
+ "propName": "currentSlides",
948
+ "methodName": "nextPrevDisabledWatcher"
949
+ }, {
950
+ "propName": "slideElements",
951
+ "methodName": "nextPrevDisabledWatcher"
952
+ }, {
953
+ "propName": "nextElements",
954
+ "methodName": "nextPrevDisabledWatcher"
955
+ }, {
956
+ "propName": "previousElements",
957
+ "methodName": "nextPrevDisabledWatcher"
958
+ }, {
959
+ "propName": "nextElements",
960
+ "methodName": "nextElementsWatcher"
961
+ }, {
962
+ "propName": "previousElements",
963
+ "methodName": "previousElementsWatcher"
964
+ }];
965
+ }
966
+ }