@oiz/stzh-components 2.11.1 → 2.12.0-beta1

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 (381) hide show
  1. package/dist/cjs/{app-globals-7697372c.js → app-globals-749422d7.js} +8 -4
  2. package/dist/cjs/app-globals-749422d7.js.map +1 -0
  3. package/dist/cjs/index.cjs.js.map +1 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/stzh-accordion.cjs.entry.js +1 -1
  6. package/dist/cjs/stzh-accordion.cjs.entry.js.map +1 -1
  7. package/dist/cjs/stzh-appointments.cjs.entry.js +7 -3
  8. package/dist/cjs/stzh-appointments.cjs.entry.js.map +1 -1
  9. package/dist/cjs/stzh-components.cjs.js +2 -2
  10. package/dist/cjs/stzh-container.cjs.entry.js +1 -1
  11. package/dist/cjs/stzh-container.cjs.entry.js.map +1 -1
  12. package/dist/cjs/stzh-datalist_2.cjs.entry.js +1 -1
  13. package/dist/cjs/stzh-datalist_2.cjs.entry.js.map +1 -1
  14. package/dist/cjs/stzh-datepicker_3.cjs.entry.js +33 -14
  15. package/dist/cjs/stzh-datepicker_3.cjs.entry.js.map +1 -1
  16. package/dist/cjs/stzh-gallery.cjs.entry.js +1 -1
  17. package/dist/cjs/stzh-gallery.cjs.entry.js.map +1 -1
  18. package/dist/cjs/stzh-progressbar-item.cjs.entry.js +2 -1
  19. package/dist/cjs/stzh-progressbar-item.cjs.entry.js.map +1 -1
  20. package/dist/cjs/stzh-progressbar.cjs.entry.js +14 -0
  21. package/dist/cjs/stzh-progressbar.cjs.entry.js.map +1 -1
  22. package/dist/cjs/stzh-sticky.cjs.entry.js +1 -1
  23. package/dist/cjs/stzh-sticky.cjs.entry.js.map +1 -1
  24. package/dist/cjs/stzh-toastbar.cjs.entry.js +8 -1
  25. package/dist/cjs/stzh-toastbar.cjs.entry.js.map +1 -1
  26. package/dist/cjs/stzh-vbz-majorticker.cjs.entry.js +7 -3
  27. package/dist/cjs/stzh-vbz-majorticker.cjs.entry.js.map +1 -1
  28. package/dist/cjs/stzh-vbz-ticker.cjs.entry.js +7 -3
  29. package/dist/cjs/stzh-vbz-ticker.cjs.entry.js.map +1 -1
  30. package/dist/collection/assets/i18n/de.json +12 -0
  31. package/dist/collection/assets/i18n/en.json +12 -0
  32. package/dist/collection/components/stzh-accordion/stzh-accordion.css +3 -2
  33. package/dist/collection/components/stzh-appointments/stzh-appointments.js +9 -3
  34. package/dist/collection/components/stzh-appointments/stzh-appointments.js.map +1 -1
  35. package/dist/collection/components/stzh-button/stzh-button.js +1 -1
  36. package/dist/collection/components/stzh-checkbox/stzh-checkbox.js +1 -1
  37. package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.js +1 -1
  38. package/dist/collection/components/stzh-chip-select/stzh-chip-select.js +1 -1
  39. package/dist/collection/components/stzh-container/stzh-container.css +8 -8
  40. package/dist/collection/components/stzh-datalist/stzh-datalist.css +1 -1
  41. package/dist/collection/components/stzh-datalist-item/stzh-datalist-item.js +1 -1
  42. package/dist/collection/components/stzh-datepicker/stzh-datepicker.js +62 -15
  43. package/dist/collection/components/stzh-datepicker/stzh-datepicker.js.map +1 -1
  44. package/dist/collection/components/stzh-gallery/stzh-gallery.css +0 -4
  45. package/dist/collection/components/stzh-input/stzh-input.js +1 -1
  46. package/dist/collection/components/stzh-link/stzh-link.js +1 -1
  47. package/dist/collection/components/stzh-progressbar/stzh-progressbar.js +35 -0
  48. package/dist/collection/components/stzh-progressbar/stzh-progressbar.js.map +1 -1
  49. package/dist/collection/components/stzh-progressbar-item/stzh-progressbar-item.js +3 -2
  50. package/dist/collection/components/stzh-progressbar-item/stzh-progressbar-item.js.map +1 -1
  51. package/dist/collection/components/stzh-radio/stzh-radio.js +1 -1
  52. package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.js +5 -3
  53. package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.js.map +1 -1
  54. package/dist/collection/components/stzh-richtext/stzh-richtext.js +1 -1
  55. package/dist/collection/components/stzh-sticky/stzh-sticky.css +4 -4
  56. package/dist/collection/components/stzh-timepicker/stzh-timepicker.js +1 -1
  57. package/dist/collection/components/stzh-toastbar/stzh-toastbar.js +8 -1
  58. package/dist/collection/components/stzh-toastbar/stzh-toastbar.js.map +1 -1
  59. package/dist/collection/components/stzh-toggle/stzh-toggle.js +1 -1
  60. package/dist/collection/components/stzh-vbz-majorticker/stzh-vbz-majorticker.js +9 -3
  61. package/dist/collection/components/stzh-vbz-majorticker/stzh-vbz-majorticker.js.map +1 -1
  62. package/dist/collection/components/stzh-vbz-ticker/stzh-vbz-ticker.js +9 -3
  63. package/dist/collection/components/stzh-vbz-ticker/stzh-vbz-ticker.js.map +1 -1
  64. package/dist/collection/global/js/helpers/utils.js +6 -2
  65. package/dist/collection/index.js.map +1 -1
  66. package/dist/collection/utils/translation-utils.js.map +1 -1
  67. package/dist/components/index.js +7 -3
  68. package/dist/components/index.js.map +1 -1
  69. package/dist/components/index2.js.map +1 -1
  70. package/dist/components/stzh-accordion.js +1 -1
  71. package/dist/components/stzh-accordion.js.map +1 -1
  72. package/dist/components/stzh-appointments.js +8 -3
  73. package/dist/components/stzh-appointments.js.map +1 -1
  74. package/dist/components/stzh-container.js +1 -1
  75. package/dist/components/stzh-container.js.map +1 -1
  76. package/dist/components/stzh-datalist2.js +1 -1
  77. package/dist/components/stzh-datalist2.js.map +1 -1
  78. package/dist/components/stzh-datepicker2.js +38 -16
  79. package/dist/components/stzh-datepicker2.js.map +1 -1
  80. package/dist/components/stzh-gallery.js +1 -1
  81. package/dist/components/stzh-gallery.js.map +1 -1
  82. package/dist/components/stzh-progressbar-item2.js +2 -1
  83. package/dist/components/stzh-progressbar-item2.js.map +1 -1
  84. package/dist/components/stzh-progressbar.js +16 -1
  85. package/dist/components/stzh-progressbar.js.map +1 -1
  86. package/dist/components/stzh-radiogroup2.js +1 -1
  87. package/dist/components/stzh-sticky.js +1 -1
  88. package/dist/components/stzh-sticky.js.map +1 -1
  89. package/dist/components/stzh-toastbar.js +8 -1
  90. package/dist/components/stzh-toastbar.js.map +1 -1
  91. package/dist/components/stzh-vbz-majorticker.js +8 -3
  92. package/dist/components/stzh-vbz-majorticker.js.map +1 -1
  93. package/dist/components/stzh-vbz-ticker.js +8 -3
  94. package/dist/components/stzh-vbz-ticker.js.map +1 -1
  95. package/dist/esm/{app-globals-1a77c38b.js → app-globals-5f5be02f.js} +8 -4
  96. package/dist/esm/app-globals-5f5be02f.js.map +1 -0
  97. package/dist/esm/index.js.map +1 -1
  98. package/dist/esm/loader.js +2 -2
  99. package/dist/esm/stzh-accordion.entry.js +1 -1
  100. package/dist/esm/stzh-accordion.entry.js.map +1 -1
  101. package/dist/esm/stzh-appointments.entry.js +7 -3
  102. package/dist/esm/stzh-appointments.entry.js.map +1 -1
  103. package/dist/esm/stzh-components.js +2 -2
  104. package/dist/esm/stzh-container.entry.js +1 -1
  105. package/dist/esm/stzh-container.entry.js.map +1 -1
  106. package/dist/esm/stzh-datalist_2.entry.js +1 -1
  107. package/dist/esm/stzh-datalist_2.entry.js.map +1 -1
  108. package/dist/esm/stzh-datepicker_3.entry.js +34 -15
  109. package/dist/esm/stzh-datepicker_3.entry.js.map +1 -1
  110. package/dist/esm/stzh-gallery.entry.js +1 -1
  111. package/dist/esm/stzh-gallery.entry.js.map +1 -1
  112. package/dist/esm/stzh-progressbar-item.entry.js +2 -1
  113. package/dist/esm/stzh-progressbar-item.entry.js.map +1 -1
  114. package/dist/esm/stzh-progressbar.entry.js +14 -0
  115. package/dist/esm/stzh-progressbar.entry.js.map +1 -1
  116. package/dist/esm/stzh-sticky.entry.js +1 -1
  117. package/dist/esm/stzh-sticky.entry.js.map +1 -1
  118. package/dist/esm/stzh-toastbar.entry.js +8 -1
  119. package/dist/esm/stzh-toastbar.entry.js.map +1 -1
  120. package/dist/esm/stzh-vbz-majorticker.entry.js +7 -3
  121. package/dist/esm/stzh-vbz-majorticker.entry.js.map +1 -1
  122. package/dist/esm/stzh-vbz-ticker.entry.js +7 -3
  123. package/dist/esm/stzh-vbz-ticker.entry.js.map +1 -1
  124. package/dist/esm-es5/{app-globals-1a77c38b.js → app-globals-5f5be02f.js} +2 -2
  125. package/dist/esm-es5/app-globals-5f5be02f.js.map +1 -0
  126. package/dist/esm-es5/index.js.map +1 -1
  127. package/dist/esm-es5/loader.js +1 -1
  128. package/dist/esm-es5/loader.js.map +1 -1
  129. package/dist/esm-es5/stzh-accordion.entry.js +1 -1
  130. package/dist/esm-es5/stzh-accordion.entry.js.map +1 -1
  131. package/dist/esm-es5/stzh-appointments.entry.js +1 -1
  132. package/dist/esm-es5/stzh-appointments.entry.js.map +1 -1
  133. package/dist/esm-es5/stzh-components.js +1 -1
  134. package/dist/esm-es5/stzh-components.js.map +1 -1
  135. package/dist/esm-es5/stzh-container.entry.js +1 -1
  136. package/dist/esm-es5/stzh-container.entry.js.map +1 -1
  137. package/dist/esm-es5/stzh-datalist_2.entry.js +1 -1
  138. package/dist/esm-es5/stzh-datalist_2.entry.js.map +1 -1
  139. package/dist/esm-es5/stzh-datepicker_3.entry.js +1 -1
  140. package/dist/esm-es5/stzh-datepicker_3.entry.js.map +1 -1
  141. package/dist/esm-es5/stzh-gallery.entry.js +1 -1
  142. package/dist/esm-es5/stzh-gallery.entry.js.map +1 -1
  143. package/dist/esm-es5/stzh-progressbar-item.entry.js +1 -1
  144. package/dist/esm-es5/stzh-progressbar-item.entry.js.map +1 -1
  145. package/dist/esm-es5/stzh-progressbar.entry.js +1 -1
  146. package/dist/esm-es5/stzh-progressbar.entry.js.map +1 -1
  147. package/dist/esm-es5/stzh-sticky.entry.js +1 -1
  148. package/dist/esm-es5/stzh-sticky.entry.js.map +1 -1
  149. package/dist/esm-es5/stzh-toastbar.entry.js +1 -1
  150. package/dist/esm-es5/stzh-toastbar.entry.js.map +1 -1
  151. package/dist/esm-es5/stzh-vbz-majorticker.entry.js +1 -1
  152. package/dist/esm-es5/stzh-vbz-majorticker.entry.js.map +1 -1
  153. package/dist/esm-es5/stzh-vbz-ticker.entry.js +1 -1
  154. package/dist/esm-es5/stzh-vbz-ticker.entry.js.map +1 -1
  155. package/dist/stzh-components/assets/i18n/de.json +12 -0
  156. package/dist/stzh-components/assets/i18n/en.json +12 -0
  157. package/dist/stzh-components/index.esm.js.map +1 -1
  158. package/dist/stzh-components/p-0b1b2aa6.system.entry.js +2 -0
  159. package/dist/stzh-components/p-0b1b2aa6.system.entry.js.map +1 -0
  160. package/dist/stzh-components/{p-11784b90.entry.js → p-0ba7ce34.entry.js} +2 -2
  161. package/dist/stzh-components/p-0ba7ce34.entry.js.map +1 -0
  162. package/dist/stzh-components/p-0bb08043.system.js.map +1 -1
  163. package/dist/stzh-components/p-222ba06a.entry.js +2 -0
  164. package/dist/stzh-components/p-222ba06a.entry.js.map +1 -0
  165. package/dist/stzh-components/{p-c658502d.system.entry.js → p-241997a2.system.entry.js} +2 -2
  166. package/dist/stzh-components/p-241997a2.system.entry.js.map +1 -0
  167. package/dist/stzh-components/p-2d88c544.system.entry.js +2 -0
  168. package/dist/stzh-components/p-2d88c544.system.entry.js.map +1 -0
  169. package/dist/stzh-components/p-361996d1.entry.js +2 -0
  170. package/dist/stzh-components/p-361996d1.entry.js.map +1 -0
  171. package/dist/stzh-components/{p-54dbcd0e.system.entry.js → p-383c2c21.system.entry.js} +2 -2
  172. package/dist/stzh-components/{p-54dbcd0e.system.entry.js.map → p-383c2c21.system.entry.js.map} +1 -1
  173. package/dist/stzh-components/{p-15980af0.entry.js → p-534dc28e.entry.js} +2 -2
  174. package/dist/stzh-components/{p-15980af0.entry.js.map → p-534dc28e.entry.js.map} +1 -1
  175. package/dist/stzh-components/{p-5fdf0a8e.entry.js → p-5486402c.entry.js} +2 -2
  176. package/dist/stzh-components/{p-5fdf0a8e.entry.js.map → p-5486402c.entry.js.map} +1 -1
  177. package/dist/stzh-components/p-55d76b46.system.entry.js +2 -0
  178. package/dist/stzh-components/p-55d76b46.system.entry.js.map +1 -0
  179. package/dist/stzh-components/{p-98b60fb7.js → p-5e014c0e.js} +2 -2
  180. package/dist/stzh-components/p-5e014c0e.js.map +1 -0
  181. package/dist/stzh-components/{p-e5c1f04c.system.entry.js → p-628b5b0d.system.entry.js} +2 -2
  182. package/dist/stzh-components/p-628b5b0d.system.entry.js.map +1 -0
  183. package/dist/stzh-components/p-66b0d1f3.entry.js +2 -0
  184. package/dist/stzh-components/p-66b0d1f3.entry.js.map +1 -0
  185. package/dist/stzh-components/{p-8b4cc10d.entry.js → p-761909d5.entry.js} +2 -2
  186. package/dist/stzh-components/p-761909d5.entry.js.map +1 -0
  187. package/dist/stzh-components/{p-50914ed3.system.entry.js → p-87a3758c.system.entry.js} +2 -2
  188. package/dist/stzh-components/p-87a3758c.system.entry.js.map +1 -0
  189. package/dist/stzh-components/p-a1e1261a.entry.js +2 -0
  190. package/dist/stzh-components/p-a1e1261a.entry.js.map +1 -0
  191. package/dist/stzh-components/p-aa9975e6.entry.js +2 -0
  192. package/dist/stzh-components/p-aa9975e6.entry.js.map +1 -0
  193. package/dist/stzh-components/{p-bb2fe16f.system.entry.js → p-b3d76f2a.system.entry.js} +2 -2
  194. package/dist/stzh-components/{p-bb2fe16f.system.entry.js.map → p-b3d76f2a.system.entry.js.map} +1 -1
  195. package/dist/stzh-components/p-bf7316ab.system.js +2 -0
  196. package/dist/stzh-components/{p-bde8bb45.system.js.map → p-bf7316ab.system.js.map} +1 -1
  197. package/dist/stzh-components/{p-aefc1441.entry.js → p-c57402af.entry.js} +2 -2
  198. package/dist/stzh-components/p-c57402af.entry.js.map +1 -0
  199. package/dist/stzh-components/{p-cbcb366a.system.entry.js → p-c60ccc16.system.entry.js} +2 -2
  200. package/dist/stzh-components/p-c60ccc16.system.entry.js.map +1 -0
  201. package/dist/stzh-components/{p-cc260e20.entry.js → p-d5ee8b1a.entry.js} +2 -2
  202. package/dist/stzh-components/{p-cc260e20.entry.js.map → p-d5ee8b1a.entry.js.map} +1 -1
  203. package/dist/stzh-components/{p-d9984b93.system.entry.js → p-dc30c467.system.entry.js} +2 -2
  204. package/dist/stzh-components/p-dc30c467.system.entry.js.map +1 -0
  205. package/dist/stzh-components/{p-9bfe7d0d.system.entry.js → p-e69312e4.system.entry.js} +2 -2
  206. package/dist/stzh-components/p-e69312e4.system.entry.js.map +1 -0
  207. package/dist/stzh-components/{p-84ae2651.system.js → p-ebb38041.system.js} +2 -2
  208. package/dist/stzh-components/p-ebb38041.system.js.map +1 -0
  209. package/dist/stzh-components/p-fa0e39e0.system.entry.js +2 -0
  210. package/dist/stzh-components/p-fa0e39e0.system.entry.js.map +1 -0
  211. package/dist/stzh-components/p-ffb4e717.entry.js +2 -0
  212. package/dist/stzh-components/p-ffb4e717.entry.js.map +1 -0
  213. package/dist/stzh-components/stzh-components.esm.js +1 -1
  214. package/dist/stzh-components/stzh-components.esm.js.map +1 -1
  215. package/dist/stzh-components/stzh-components.js +1 -1
  216. package/dist/types/components.d.ts +14 -2
  217. package/dist/types/utils/translation-utils.d.ts +2 -0
  218. package/dist/vscode-data.json +7523 -0
  219. package/package.json +1 -1
  220. package/dist/cjs/app-globals-7697372c.js.map +0 -1
  221. package/dist/esm/app-globals-1a77c38b.js.map +0 -1
  222. package/dist/esm-es5/app-globals-1a77c38b.js.map +0 -1
  223. package/dist/stzh-components/p-07819ba5.entry.js +0 -2
  224. package/dist/stzh-components/p-07819ba5.entry.js.map +0 -1
  225. package/dist/stzh-components/p-1095d872.system.entry.js +0 -2
  226. package/dist/stzh-components/p-1095d872.system.entry.js.map +0 -1
  227. package/dist/stzh-components/p-11784b90.entry.js.map +0 -1
  228. package/dist/stzh-components/p-446dcea5.entry.js +0 -2
  229. package/dist/stzh-components/p-446dcea5.entry.js.map +0 -1
  230. package/dist/stzh-components/p-50914ed3.system.entry.js.map +0 -1
  231. package/dist/stzh-components/p-7b0da017.entry.js +0 -2
  232. package/dist/stzh-components/p-7b0da017.entry.js.map +0 -1
  233. package/dist/stzh-components/p-7fdd98fe.entry.js +0 -2
  234. package/dist/stzh-components/p-7fdd98fe.entry.js.map +0 -1
  235. package/dist/stzh-components/p-84ae2651.system.js.map +0 -1
  236. package/dist/stzh-components/p-8b4cc10d.entry.js.map +0 -1
  237. package/dist/stzh-components/p-8f98fc45.system.entry.js +0 -2
  238. package/dist/stzh-components/p-8f98fc45.system.entry.js.map +0 -1
  239. package/dist/stzh-components/p-98b60fb7.js.map +0 -1
  240. package/dist/stzh-components/p-9bfe7d0d.system.entry.js.map +0 -1
  241. package/dist/stzh-components/p-aafc8687.entry.js +0 -2
  242. package/dist/stzh-components/p-aafc8687.entry.js.map +0 -1
  243. package/dist/stzh-components/p-aefc1441.entry.js.map +0 -1
  244. package/dist/stzh-components/p-afb2885a.entry.js +0 -2
  245. package/dist/stzh-components/p-afb2885a.entry.js.map +0 -1
  246. package/dist/stzh-components/p-bde8bb45.system.js +0 -2
  247. package/dist/stzh-components/p-c658502d.system.entry.js.map +0 -1
  248. package/dist/stzh-components/p-cbcb366a.system.entry.js.map +0 -1
  249. package/dist/stzh-components/p-d9984b93.system.entry.js.map +0 -1
  250. package/dist/stzh-components/p-e278cda2.system.entry.js +0 -2
  251. package/dist/stzh-components/p-e278cda2.system.entry.js.map +0 -1
  252. package/dist/stzh-components/p-e5c1f04c.system.entry.js.map +0 -1
  253. package/dist/stzh-components/p-ff356dc8.system.entry.js +0 -2
  254. package/dist/stzh-components/p-ff356dc8.system.entry.js.map +0 -1
  255. package/dist/types/components/stzh-accordion/stzh-accordion.d.ts +0 -15
  256. package/dist/types/components/stzh-accordion-item/stzh-accordion-item.d.ts +0 -73
  257. package/dist/types/components/stzh-actions/stzh-actions.d.ts +0 -16
  258. package/dist/types/components/stzh-actionset/stzh-actionset.d.ts +0 -45
  259. package/dist/types/components/stzh-amount/stzh-amount.d.ts +0 -73
  260. package/dist/types/components/stzh-appnav/stzh-appnav.d.ts +0 -23
  261. package/dist/types/components/stzh-appointments/stzh-appointments.d.ts +0 -73
  262. package/dist/types/components/stzh-audio/stzh-audio.d.ts +0 -58
  263. package/dist/types/components/stzh-button/stzh-button.d.ts +0 -105
  264. package/dist/types/components/stzh-buttongroup/stzh-buttongroup.d.ts +0 -7
  265. package/dist/types/components/stzh-calendar/stzh-calendar.d.ts +0 -88
  266. package/dist/types/components/stzh-card/stzh-card.d.ts +0 -127
  267. package/dist/types/components/stzh-card-list/stzh-card-list.d.ts +0 -31
  268. package/dist/types/components/stzh-carousel/stzh-carousel.d.ts +0 -175
  269. package/dist/types/components/stzh-chart/stzh-chart.d.ts +0 -15
  270. package/dist/types/components/stzh-checkbox/stzh-checkbox.d.ts +0 -57
  271. package/dist/types/components/stzh-checkboxgroup/stzh-checkboxgroup.d.ts +0 -64
  272. package/dist/types/components/stzh-chip/stzh-chip.d.ts +0 -74
  273. package/dist/types/components/stzh-chip-select/stzh-chip-select.d.ts +0 -46
  274. package/dist/types/components/stzh-clamp/stzh-clamp.d.ts +0 -49
  275. package/dist/types/components/stzh-contact/stzh-contact.d.ts +0 -54
  276. package/dist/types/components/stzh-datalist/stzh-datalist.d.ts +0 -51
  277. package/dist/types/components/stzh-datalist-item/stzh-datalist-item.d.ts +0 -62
  278. package/dist/types/components/stzh-datamessagelist/stzh-datamessagelist.d.ts +0 -6
  279. package/dist/types/components/stzh-datamessagelist-item/stzh-datamessagelist-item.d.ts +0 -57
  280. package/dist/types/components/stzh-datatable/stzh-datatable.d.ts +0 -103
  281. package/dist/types/components/stzh-datepicker/stzh-datepicker.d.ts +0 -91
  282. package/dist/types/components/stzh-details/stzh-details.d.ts +0 -35
  283. package/dist/types/components/stzh-dialog/stzh-dialog.d.ts +0 -64
  284. package/dist/types/components/stzh-dropdown/stzh-dropdown.d.ts +0 -173
  285. package/dist/types/components/stzh-figure/stzh-figure.d.ts +0 -21
  286. package/dist/types/components/stzh-flyingfocus/stzh-flyingfocus.d.ts +0 -35
  287. package/dist/types/components/stzh-footer/stzh-footer.d.ts +0 -27
  288. package/dist/types/components/stzh-gallery/stzh-gallery.d.ts +0 -54
  289. package/dist/types/components/stzh-ghettobox/stzh-ghettobox.d.ts +0 -50
  290. package/dist/types/components/stzh-header/stzh-header.d.ts +0 -68
  291. package/dist/types/components/stzh-hr/stzh-hr.d.ts +0 -7
  292. package/dist/types/components/stzh-iframe/stzh-iframe.d.ts +0 -60
  293. package/dist/types/components/stzh-imagecomparison/stzh-imagecomparison.d.ts +0 -29
  294. package/dist/types/components/stzh-input/stzh-input.d.ts +0 -104
  295. package/dist/types/components/stzh-invert/stzh-invert.d.ts +0 -7
  296. package/dist/types/components/stzh-langnav/stzh-langnav.d.ts +0 -19
  297. package/dist/types/components/stzh-link/stzh-link.d.ts +0 -88
  298. package/dist/types/components/stzh-list/stzh-list.d.ts +0 -9
  299. package/dist/types/components/stzh-list-item/stzh-list-item.d.ts +0 -7
  300. package/dist/types/components/stzh-loader/stzh-loader.d.ts +0 -13
  301. package/dist/types/components/stzh-loadingbar/stzh-loadingbar.d.ts +0 -12
  302. package/dist/types/components/stzh-logo/stzh-logo.d.ts +0 -9
  303. package/dist/types/components/stzh-menu-item/stzh-menu-item.d.ts +0 -50
  304. package/dist/types/components/stzh-message/stzh-message.d.ts +0 -37
  305. package/dist/types/components/stzh-metanav/stzh-metanav.d.ts +0 -11
  306. package/dist/types/components/stzh-microsite-teaserlist/stzh-microsite-teaserlist.d.ts +0 -33
  307. package/dist/types/components/stzh-monthyearpicker/stzh-monthyearpicker.d.ts +0 -98
  308. package/dist/types/components/stzh-olmap/stzh-olmap.d.ts +0 -124
  309. package/dist/types/components/stzh-overlay/stzh-overlay.d.ts +0 -34
  310. package/dist/types/components/stzh-page-skiplinks/stzh-page-skiplinks.d.ts +0 -11
  311. package/dist/types/components/stzh-pagebottom/stzh-pagebottom.d.ts +0 -29
  312. package/dist/types/components/stzh-pagetitle/stzh-pagetitle.d.ts +0 -15
  313. package/dist/types/components/stzh-pagetitle-hero/stzh-pagetitle-hero.d.ts +0 -25
  314. package/dist/types/components/stzh-pagination/stzh-pagination.d.ts +0 -52
  315. package/dist/types/components/stzh-panorama/stzh-panorama.d.ts +0 -74
  316. package/dist/types/components/stzh-popover/stzh-popover.d.ts +0 -73
  317. package/dist/types/components/stzh-print/stzh-print.d.ts +0 -12
  318. package/dist/types/components/stzh-progressbar/stzh-progressbar.d.ts +0 -49
  319. package/dist/types/components/stzh-progressbar-item/stzh-progressbar-item.d.ts +0 -34
  320. package/dist/types/components/stzh-radio/stzh-radio.d.ts +0 -57
  321. package/dist/types/components/stzh-radiogroup/stzh-radiogroup.d.ts +0 -66
  322. package/dist/types/components/stzh-ratio/stzh-ratio.d.ts +0 -22
  323. package/dist/types/components/stzh-readspeaker/stzh-readspeaker.d.ts +0 -18
  324. package/dist/types/components/stzh-richtext/stzh-richtext.d.ts +0 -22
  325. package/dist/types/components/stzh-saptcha/stzh-saptcha.d.ts +0 -28
  326. package/dist/types/components/stzh-scrollup/stzh-scrollup.d.ts +0 -12
  327. package/dist/types/components/stzh-share/stzh-share.d.ts +0 -21
  328. package/dist/types/components/stzh-show/stzh-show.d.ts +0 -22
  329. package/dist/types/components/stzh-sitemap/stzh-sitemap.d.ts +0 -14
  330. package/dist/types/components/stzh-skiplink/stzh-skiplink.d.ts +0 -38
  331. package/dist/types/components/stzh-sortable/stzh-sortable.d.ts +0 -59
  332. package/dist/types/components/stzh-status/stzh-status.d.ts +0 -14
  333. package/dist/types/components/stzh-sticky/stzh-sticky.d.ts +0 -58
  334. package/dist/types/components/stzh-table/stzh-table.d.ts +0 -43
  335. package/dist/types/components/stzh-textandimage/stzh-textandimage.d.ts +0 -14
  336. package/dist/types/components/stzh-timeline/stzh-timeline.d.ts +0 -23
  337. package/dist/types/components/stzh-timeline-item/stzh-timeline-item.d.ts +0 -78
  338. package/dist/types/components/stzh-timepicker/stzh-timepicker.d.ts +0 -62
  339. package/dist/types/components/stzh-toast/stzh-toast.d.ts +0 -39
  340. package/dist/types/components/stzh-toastbar/stzh-toastbar.d.ts +0 -41
  341. package/dist/types/components/stzh-toggle/stzh-toggle.d.ts +0 -59
  342. package/dist/types/components/stzh-tooltip/stzh-tooltip.d.ts +0 -80
  343. package/dist/types/components/stzh-upload/stzh-upload.d.ts +0 -236
  344. package/dist/types/components/stzh-vbz-carousel/stzh-vbz-carousel.d.ts +0 -14
  345. package/dist/types/components/stzh-vbz-linechip/stzh-vbz-linechip.d.ts +0 -37
  346. package/dist/types/components/stzh-vbz-majorticker/stzh-vbz-majorticker.d.ts +0 -41
  347. package/dist/types/components/stzh-vbz-ticker/stzh-vbz-ticker.d.ts +0 -34
  348. package/dist/types/components/stzh-youtube/stzh-youtube.d.ts +0 -30
  349. package/dist/types/index.d.ts +0 -899
  350. package/dist/types/libraries/tom-select/types/constants.d.ts +0 -12
  351. package/dist/types/libraries/tom-select/types/contrib/highlight.d.ts +0 -13
  352. package/dist/types/libraries/tom-select/types/contrib/microevent.d.ts +0 -20
  353. package/dist/types/libraries/tom-select/types/contrib/microplugin.d.ts +0 -71
  354. package/dist/types/libraries/tom-select/types/defaults.d.ts +0 -51
  355. package/dist/types/libraries/tom-select/types/getSettings.d.ts +0 -3
  356. package/dist/types/libraries/tom-select/types/plugins/caret_position/plugin.d.ts +0 -16
  357. package/dist/types/libraries/tom-select/types/plugins/change_listener/plugin.d.ts +0 -16
  358. package/dist/types/libraries/tom-select/types/plugins/checkbox_options/plugin.d.ts +0 -16
  359. package/dist/types/libraries/tom-select/types/plugins/clear_button/plugin.d.ts +0 -17
  360. package/dist/types/libraries/tom-select/types/plugins/clear_button/types.d.ts +0 -5
  361. package/dist/types/libraries/tom-select/types/plugins/drag_drop/plugin.d.ts +0 -16
  362. package/dist/types/libraries/tom-select/types/plugins/dropdown_header/plugin.d.ts +0 -17
  363. package/dist/types/libraries/tom-select/types/plugins/dropdown_header/types.d.ts +0 -8
  364. package/dist/types/libraries/tom-select/types/plugins/dropdown_input/plugin.d.ts +0 -16
  365. package/dist/types/libraries/tom-select/types/plugins/input_autogrow/plugin.d.ts +0 -15
  366. package/dist/types/libraries/tom-select/types/plugins/no_active_items/plugin.d.ts +0 -15
  367. package/dist/types/libraries/tom-select/types/plugins/no_backspace_delete/plugin.d.ts +0 -15
  368. package/dist/types/libraries/tom-select/types/plugins/optgroup_columns/plugin.d.ts +0 -16
  369. package/dist/types/libraries/tom-select/types/plugins/remove_button/plugin.d.ts +0 -17
  370. package/dist/types/libraries/tom-select/types/plugins/remove_button/types.d.ts +0 -6
  371. package/dist/types/libraries/tom-select/types/plugins/restore_on_backspace/plugin.d.ts +0 -21
  372. package/dist/types/libraries/tom-select/types/plugins/virtual_scroll/plugin.d.ts +0 -16
  373. package/dist/types/libraries/tom-select/types/tom-select.complete.d.ts +0 -2
  374. package/dist/types/libraries/tom-select/types/tom-select.d.ts +0 -596
  375. package/dist/types/libraries/tom-select/types/tom-select.popular.d.ts +0 -2
  376. package/dist/types/libraries/tom-select/types/types/core.d.ts +0 -48
  377. package/dist/types/libraries/tom-select/types/types/index.d.ts +0 -2
  378. package/dist/types/libraries/tom-select/types/types/settings.d.ts +0 -78
  379. package/dist/types/libraries/tom-select/types/utils.d.ts +0 -76
  380. package/dist/types/libraries/tom-select/types/vanilla.d.ts +0 -76
  381. package/dist/types/types/svg.d.ts +0 -4
@@ -1 +1 @@
1
- {"version":3,"names":["stzhVbzMajortickerCss","StzhVbzMajorticker","this","disturbance","onGhettoboxOpen","_this","ghettoboxShown","onGhettoboxClose","class_1","prototype","getGhettoboxShown","getDisturbance","apiWatcher","newValue","apiUrl","api","replace","localization","$locale","includes","Date","now","axios","get","data","_c","sent","dataWatcher","_data","JSON","parse","bigDisturbance","_b","_a","Message","find","message","category","VBZ","DISTURBANCE_INFORMATION","baseType","BASE_TYPE_GLOBAL","urls","channel","filter","name","CHANNEL_TICKER","url","map","reduce","a","b","concat","infoUrl","indexOf","CHANNEL_INFO_URL_FILTER","id","head","text","createParagraphsFromBrs","startDate","sDate","sTime","endDate","eDate","eTime","altStart","altEnd","stzhDisturbanceFetched","emit","component","componentWillLoad","window","stzhComponents","utils","fetchTranslations","element","_d","dateAdapter","createFormatParseAdapter","$formats","$globals","render","classes","h","Host","hidden","class","onStzhOpen","onStzhClose","hideClose","closeTimeKey","ghettoboxCloseTimeKey","mainTitle","publishDate","innerHTML","slot","href","target","moreInfoLink","moreInfo"],"sources":["src/components/stzh-vbz-majorticker/stzh-vbz-majorticker.scss?tag=stzh-vbz-majorticker&encapsulation=scoped","src/components/stzh-vbz-majorticker/stzh-vbz-majorticker.tsx"],"sourcesContent":[":host {\n}\n\n.stzh-vbz-majorticker {\n &__ghettobox {\n // --stzh-base-invert-color: #{$colorBlack};\n // --stzh-base-invert-color72: #{$colorBlack72};\n // --stzh-base-invert-color32: #{$colorBlack32};\n // --stzh-base-invert-color16: #{$colorBlack16};\n\n --stzh-base-invert-color-rgb: #{$colorBlackRgb};\n --color: #{$colorBlack};\n --background-color: #{$colorCoral};\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n State,\n Watch,\n Element,\n Event,\n EventEmitter,\n Method\n} from \"@stencil/core\";\n\nimport axios from \"axios\";\n\nimport { createParagraphsFromBrs } from \"../../utils/string-utils\";\nimport { StzhLocaleAdapter } from \"../../utils/date-adapter\";\n\nimport { StzhVbzMajortickerLocalizedText } from \"./stzh-vbz-majorticker.localization\";\n\nimport {\n VBZ,\n StzhVbzMajortickerDisturbanceFetchedEvent,\n StzhVbzMajortickerDisturbance,\n VbzTickerInfoUrl\n} from \"../../index\";\n\n/**\n */\n@Component({\n tag: \"stzh-vbz-majorticker\",\n styleUrl: \"stzh-vbz-majorticker.scss\",\n scoped: true\n})\nexport class StzhVbzMajorticker {\n /** API URL (`{lang}` is replaced in the URL) */\n @Prop() api: string = \"https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}\";\n\n /** Data to pass in directly (alternative for API call) */\n @Prop() data: any = \"\";\n private _data: any;\n\n /** More info link (`{lang}` and `{id}` are replaced in the URL) */\n @Prop() moreInfoLink: string = \"https://zvv.ch/zvv/{lang}/fahrplan/vl.html?himIds={id}\";\n\n /**\n * Date adapter, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n */\n @Prop() dateAdapter: StzhLocaleAdapter;\n\n /** Translation strings. */\n @Prop() localization: StzhVbzMajortickerLocalizedText;\n\n /** Overwrite ghettobox close time cookie option if needed */\n @Prop() ghettoboxCloseTimeKey: string;\n\n /** Whether ghettobox is shown (if has not been closed before) */\n @State() ghettoboxShown: boolean = true;\n\n @Element() element: HTMLStzhVbzMajortickerElement;\n\n /** Event when major disturbance was fetched */\n @Event() stzhDisturbanceFetched: EventEmitter<StzhVbzMajortickerDisturbanceFetchedEvent>;\n\n /** Return whether ghettobox is shown (if has not been closed before) */\n @Method()\n async getGhettoboxShown() {\n return this.ghettoboxShown;\n }\n\n /** Return fetched disturbance */\n @Method()\n async getDisturbance() {\n return this.disturbance;\n }\n\n @Watch(\"api\")\n async apiWatcher(newValue: string) {\n if (!newValue) {\n return;\n }\n\n let apiUrl = this.api.replace(/\\{lang\\}/, this.localization.$locale)\n apiUrl = apiUrl + (apiUrl.includes(\"?\") ? \"&\" : \"?\") + Date.now();\n\n // load data from API\n const { data } = await axios.get(apiUrl);\n\n this.data = data;\n }\n\n @Watch(\"data\")\n async dataWatcher(newValue: any) {\n if (typeof newValue === \"string\") {\n this._data = JSON.parse(newValue);\n } else {\n this._data = newValue;\n }\n\n const bigDisturbance = this._data?.Message\n ?.find(message => message.category === VBZ.DISTURBANCE_INFORMATION && message.baseType === VBZ.BASE_TYPE_GLOBAL);\n\n if (bigDisturbance) {\n const urls: VbzTickerInfoUrl[] = bigDisturbance.channel\n .filter(channel => channel.name === VBZ.CHANNEL_TICKER && channel.url)\n .map(channel => channel.url)\n .reduce((a, b) => a.concat(b), []);\n\n const infoUrl = urls\n .find(url => url.url.indexOf(VBZ.CHANNEL_INFO_URL_FILTER) !== -1);\n\n this.disturbance = {\n id: bigDisturbance.id,\n head: bigDisturbance.head,\n text: createParagraphsFromBrs(bigDisturbance.text),\n startDate: new Date(`${bigDisturbance.sDate}T${bigDisturbance.sTime}+02:00`),\n endDate: new Date(`${bigDisturbance.eDate}T${bigDisturbance.eTime}+02:00`),\n altStart: bigDisturbance.altStart,\n altEnd: bigDisturbance.altEnd,\n infoUrl: infoUrl\n };\n }\n\n this.stzhDisturbanceFetched.emit({\n component: \"stzh-vbz-majorticker\",\n disturbance: this.disturbance\n })\n }\n\n private disturbance: StzhVbzMajortickerDisturbance = null;\n\n private onGhettoboxOpen = () => {\n this.ghettoboxShown = true;\n }\n\n private onGhettoboxClose = () => {\n this.ghettoboxShown = false;\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"vbz-majorticker\");\n }\n\n if (!this.dateAdapter) {\n this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formats,\n this.localization.$globals\n );\n }\n\n if (this.data) {\n await this.dataWatcher(this.data);\n } else {\n await this.apiWatcher(this.api);\n }\n }\n\n render() {\n const classes = {\n \"stzh-vbz-majorticker\": true\n };\n\n return (\n <Host hidden={!this.disturbance || !this.ghettoboxShown}>\n <div class={classes}>\n {this.disturbance &&\n <stzh-ghettobox\n onStzhOpen={this.onGhettoboxOpen}\n onStzhClose={this.onGhettoboxClose}\n class=\"stzh-vbz-majorticker__ghettobox\"\n hideClose={true}\n closeTimeKey={this.ghettoboxCloseTimeKey}\n mainTitle={this.disturbance.head}\n publishDate={this.disturbance.startDate}\n >\n <stzh-richtext innerHTML={this.disturbance.text}></stzh-richtext>\n {this.disturbance.infoUrl ?\n <stzh-button\n slot=\"button\"\n href={this.disturbance.infoUrl.url}\n >\n {this.disturbance.infoUrl.name}\n </stzh-button>\n :\n <stzh-button\n slot=\"button\"\n target=\"_blank\"\n href={this.moreInfoLink\n .replace(/\\{lang\\}/, this.localization.$locale)\n .replace(/\\{id\\}/, this.disturbance.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AM,kCACNG,UAAW,KACXC,aAAczF,KAAK0F,sBACnBC,UAAW3F,KAAKC,YAAYsD,KAC5BqC,YAAa5F,KAAKC,YAAYyD,WAE9BwB,EAAA,iBAAeW,UAAW7F,KAAKC,YAAYuD,OAC1CxD,KAAKC,YAAYkD,QAChB+B,EAAA,eACEY,KAAK,SACLC,KAAM/F,KAAKC,YAAYkD,QAAQN,KAE9B7C,KAAKC,YAAYkD,QAAQR,MAG5BuC,EAAA,eACEY,KAAK,SACLE,OAAO,SACPD,KAAM/F,KAAKiG,aACRnF,QAAQ,WAAYd,KAAKe,aAAaC,SACtCF,QAAQ,SAAUd,KAAKC,YAAYqD,KAErCtD,KAAKe,aAAamF,Y,8QAhKN,G"}
1
+ {"version":3,"names":["stzhVbzMajortickerCss","StzhVbzMajorticker","this","disturbance","onGhettoboxOpen","_this","ghettoboxShown","onGhettoboxClose","class_1","prototype","getGhettoboxShown","getDisturbance","apiWatcher","newValue","apiUrl","api","replace","localization","$locale","includes","Date","now","axios","get","data","_c","sent","dateAdapterWatcher","dateAdapter","window","stzhComponents","utils","createFormatParseAdapter","$formats","$globals","dataWatcher","_data","JSON","parse","bigDisturbance","_b","_a","Message","find","message","category","VBZ","DISTURBANCE_INFORMATION","baseType","BASE_TYPE_GLOBAL","urls","channel","filter","name","CHANNEL_TICKER","url","map","reduce","a","b","concat","infoUrl","indexOf","CHANNEL_INFO_URL_FILTER","id","head","text","createParagraphsFromBrs","startDate","sDate","sTime","endDate","eDate","eTime","altStart","altEnd","stzhDisturbanceFetched","emit","component","componentWillLoad","fetchTranslations","element","_d","render","classes","h","Host","hidden","class","onStzhOpen","onStzhClose","hideClose","closeTimeKey","ghettoboxCloseTimeKey","mainTitle","publishDate","innerHTML","slot","href","target","moreInfoLink","moreInfo"],"sources":["src/components/stzh-vbz-majorticker/stzh-vbz-majorticker.scss?tag=stzh-vbz-majorticker&encapsulation=scoped","src/components/stzh-vbz-majorticker/stzh-vbz-majorticker.tsx"],"sourcesContent":[":host {\n}\n\n.stzh-vbz-majorticker {\n &__ghettobox {\n // --stzh-base-invert-color: #{$colorBlack};\n // --stzh-base-invert-color72: #{$colorBlack72};\n // --stzh-base-invert-color32: #{$colorBlack32};\n // --stzh-base-invert-color16: #{$colorBlack16};\n\n --stzh-base-invert-color-rgb: #{$colorBlackRgb};\n --color: #{$colorBlack};\n --background-color: #{$colorCoral};\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n State,\n Watch,\n Element,\n Event,\n EventEmitter,\n Method\n} from \"@stencil/core\";\n\nimport axios from \"axios\";\n\nimport { createParagraphsFromBrs } from \"../../utils/string-utils\";\nimport { StzhLocaleAdapter } from \"../../utils/date-adapter\";\n\nimport { StzhVbzMajortickerLocalizedText } from \"./stzh-vbz-majorticker.localization\";\n\nimport {\n VBZ,\n StzhVbzMajortickerDisturbanceFetchedEvent,\n StzhVbzMajortickerDisturbance,\n VbzTickerInfoUrl\n} from \"../../index\";\n\n/**\n */\n@Component({\n tag: \"stzh-vbz-majorticker\",\n styleUrl: \"stzh-vbz-majorticker.scss\",\n scoped: true\n})\nexport class StzhVbzMajorticker {\n /** API URL (`{lang}` is replaced in the URL) */\n @Prop() api: string = \"https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}\";\n\n /** Data to pass in directly (alternative for API call) */\n @Prop() data: any = \"\";\n private _data: any;\n\n /** More info link (`{lang}` and `{id}` are replaced in the URL) */\n @Prop() moreInfoLink: string = \"https://zvv.ch/zvv/{lang}/fahrplan/vl.html?himIds={id}\";\n\n /**\n * Date adapter, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n */\n @Prop() dateAdapter: StzhLocaleAdapter;\n\n /** Translation strings. */\n @Prop() localization: StzhVbzMajortickerLocalizedText;\n\n /** Overwrite ghettobox close time cookie option if needed */\n @Prop() ghettoboxCloseTimeKey: string;\n\n /** Whether ghettobox is shown (if has not been closed before) */\n @State() ghettoboxShown: boolean = true;\n\n @Element() element: HTMLStzhVbzMajortickerElement;\n\n /** Event when major disturbance was fetched */\n @Event() stzhDisturbanceFetched: EventEmitter<StzhVbzMajortickerDisturbanceFetchedEvent>;\n\n /** Return whether ghettobox is shown (if has not been closed before) */\n @Method()\n async getGhettoboxShown() {\n return this.ghettoboxShown;\n }\n\n /** Return fetched disturbance */\n @Method()\n async getDisturbance() {\n return this.disturbance;\n }\n\n @Watch(\"api\")\n async apiWatcher(newValue: string) {\n if (!newValue) {\n return;\n }\n\n let apiUrl = this.api.replace(/\\{lang\\}/, this.localization.$locale)\n apiUrl = apiUrl + (apiUrl.includes(\"?\") ? \"&\" : \"?\") + Date.now();\n\n // load data from API\n const { data } = await axios.get(apiUrl);\n\n this.data = data;\n }\n\n @Watch(\"dateAdapter\")\n dateAdapterWatcher(newValue: StzhLocaleAdapter) {\n if (!newValue) {\n this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formats,\n this.localization.$globals\n );\n }\n }\n\n @Watch(\"data\")\n async dataWatcher(newValue: any) {\n if (typeof newValue === \"string\") {\n this._data = JSON.parse(newValue);\n } else {\n this._data = newValue;\n }\n\n const bigDisturbance = this._data?.Message\n ?.find(message => message.category === VBZ.DISTURBANCE_INFORMATION && message.baseType === VBZ.BASE_TYPE_GLOBAL);\n\n if (bigDisturbance) {\n const urls: VbzTickerInfoUrl[] = bigDisturbance.channel\n .filter(channel => channel.name === VBZ.CHANNEL_TICKER && channel.url)\n .map(channel => channel.url)\n .reduce((a, b) => a.concat(b), []);\n\n const infoUrl = urls\n .find(url => url.url.indexOf(VBZ.CHANNEL_INFO_URL_FILTER) !== -1);\n\n this.disturbance = {\n id: bigDisturbance.id,\n head: bigDisturbance.head,\n text: createParagraphsFromBrs(bigDisturbance.text),\n startDate: new Date(`${bigDisturbance.sDate}T${bigDisturbance.sTime}+02:00`),\n endDate: new Date(`${bigDisturbance.eDate}T${bigDisturbance.eTime}+02:00`),\n altStart: bigDisturbance.altStart,\n altEnd: bigDisturbance.altEnd,\n infoUrl: infoUrl\n };\n }\n\n this.stzhDisturbanceFetched.emit({\n component: \"stzh-vbz-majorticker\",\n disturbance: this.disturbance\n })\n }\n\n private disturbance: StzhVbzMajortickerDisturbance = null;\n\n private onGhettoboxOpen = () => {\n this.ghettoboxShown = true;\n }\n\n private onGhettoboxClose = () => {\n this.ghettoboxShown = false;\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"vbz-majorticker\");\n }\n\n this.dateAdapterWatcher(this.dateAdapter);\n\n if (this.data) {\n await this.dataWatcher(this.data);\n } else {\n await this.apiWatcher(this.api);\n }\n }\n\n render() {\n const classes = {\n \"stzh-vbz-majorticker\": true\n };\n\n return (\n <Host hidden={!this.disturbance || !this.ghettoboxShown}>\n <div class={classes}>\n {this.disturbance &&\n <stzh-ghettobox\n onStzhOpen={this.onGhettoboxOpen}\n onStzhClose={this.onGhettoboxClose}\n class=\"stzh-vbz-majorticker__ghettobox\"\n hideClose={true}\n closeTimeKey={this.ghettoboxCloseTimeKey}\n mainTitle={this.disturbance.head}\n publishDate={this.disturbance.startDate}\n >\n <stzh-richtext innerHTML={this.disturbance.text}></stzh-richtext>\n {this.disturbance.infoUrl ?\n <stzh-button\n slot=\"button\"\n href={this.disturbance.infoUrl.url}\n >\n {this.disturbance.infoUrl.name}\n </stzh-button>\n :\n <stzh-button\n slot=\"button\"\n target=\"_blank\"\n href={this.moreInfoLink\n .replace(/\\{lang\\}/, this.localization.$locale)\n .replace(/\\{id\\}/, this.disturbance.id)}\n >\n {this.localization.moreInfo}\n </stzh-button>\n }\n </stzh-ghettobox>\n }\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"+rDAAA,IAAMA,sBAAwB,0rC,ICkCjBC,mBAAkB,W,2HA2GrBC,KAAAC,YAA6C,KAE7CD,KAAAE,gBAAkB,WACx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AeW,UAAW9F,KAAKC,YAAY+D,OAC1ChE,KAAKC,YAAY0D,QAChBwB,EAAA,eACEY,KAAK,SACLC,KAAMhG,KAAKC,YAAY0D,QAAQN,KAE9BrD,KAAKC,YAAY0D,QAAQR,MAG5BgC,EAAA,eACEY,KAAK,SACLE,OAAO,SACPD,KAAMhG,KAAKkG,aACRpF,QAAQ,WAAYd,KAAKe,aAAaC,SACtCF,QAAQ,SAAUd,KAAKC,YAAY6D,KAErC9D,KAAKe,aAAaoF,Y,iTArKN,G"}
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,s){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function n(t){try{o(s.next(t))}catch(t){a(t)}}function c(t){try{o(s["throw"](t))}catch(t){a(t)}}function o(t){t.done?i(t.value):r(t.value).then(n,c)}o((s=s.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,r,a,n;return n={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function c(t){return function(e){return o([t,e])}}function o(c){if(s)throw new TypeError("Generator is already executing.");while(n&&(n=0,c[0]&&(i=0)),i)try{if(s=1,r&&(a=c[0]&2?r["return"]:c[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,c[1])).done)return a;if(r=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;r=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){i.label=c[1];break}if(c[0]===6&&i.label<a[1]){i.label=a[1];a=c;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(c);break}if(a[2])i.ops.pop();i.trys.pop();continue}c=e.call(t,i)}catch(t){c=[6,t];r=0}finally{s=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{r as registerInstance,h,F as Fragment,a as Host,g as getElement}from"./index-bfb5b569.js";import{a as axios}from"./axios-85a0baad.js";import{VBZ}from"./index.js";var stzhVbzTickerCss=".sc-stzh-vbz-ticker-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:var(--stzh-font-style-regular);color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-vbz-ticker-h{display:none}.sc-stzh-vbz-ticker-h *.sc-stzh-vbz-ticker,.sc-stzh-vbz-ticker-h *.sc-stzh-vbz-ticker::before,.sc-stzh-vbz-ticker-h *.sc-stzh-vbz-ticker::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}.sc-stzh-vbz-ticker-h .has-focus.sc-stzh-vbz-ticker{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.3125rem}.sc-stzh-vbz-ticker-h .stzh-fylingfocus-focused.sc-stzh-vbz-ticker{outline-style:none !important}.sc-stzh-vbz-ticker-h .stzh-fylingfocus-focused.sc-stzh-vbz-ticker::-moz-focus-inner{border:0 !important}.stzh-vbz-ticker.sc-stzh-vbz-ticker{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}@media screen and (min-width: 1024px){.stzh-vbz-ticker.sc-stzh-vbz-ticker{-ms-flex-direction:row;flex-direction:row;-ms-flex-align:start;align-items:flex-start}}.stzh-vbz-ticker__icon.sc-stzh-vbz-ticker{--size:var(--stzh-icon-size-small);margin-right:var(--stzh-space-xsmall)}.stzh-vbz-ticker__title.sc-stzh-vbz-ticker{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);font-size:var(--stzh-font-curve-p1-default-font-size, var(--stzh-font-milli-font-size));line-height:var(--stzh-font-curve-p1-default-text-line-height, var(--stzh-font-milli-text-line-height));letter-spacing:var(--stzh-font-curve-p1-default-text-letter-spacing);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}@media screen and (min-width: 1024px){.stzh-vbz-ticker__title.sc-stzh-vbz-ticker{font-size:var(--stzh-font-curve-p1-medium-font-size, var(--stzh-font-centi-font-size));line-height:var(--stzh-font-curve-p1-medium-text-line-height, var(--stzh-font-centi-text-line-height));letter-spacing:var(--stzh-font-curve-p1-medium-text-letter-spacing)}}.stzh-vbz-ticker__title-parts.sc-stzh-vbz-ticker{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:calc(var(--stzh-space-xxxsmall) / -1) 0}.stzh-vbz-ticker__title-part.sc-stzh-vbz-ticker{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;white-space:nowrap;margin:var(--stzh-space-xxxsmall) 0}.stzh-vbz-ticker__title-part.sc-stzh-vbz-ticker:not(:last-child){margin-right:var(--stzh-space-large)}.stzh-vbz-ticker__title-part--no-disturbances.sc-stzh-vbz-ticker{color:var(--stzh-color-truegreen)}.stzh-vbz-ticker__title-part--major-events.sc-stzh-vbz-ticker{color:var(--stzh-color-coral)}.stzh-vbz-ticker__title-part--disturbances.sc-stzh-vbz-ticker{color:var(--stzh-color-error)}.stzh-vbz-ticker__link.sc-stzh-vbz-ticker{margin-top:var(--stzh-space-small)}@media screen and (min-width: 1024px){.stzh-vbz-ticker__link.sc-stzh-vbz-ticker{position:absolute;top:0;right:0;margin-top:0}}.stzh-vbz-ticker__chips.sc-stzh-vbz-ticker{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.stzh-vbz-ticker__chips.sc-stzh-vbz-ticker:not(:empty){margin:calc(var(--stzh-space-xxsmall) * -1);margin-top:calc(var(--stzh-space-medium) - var(--stzh-space-xxsmall))}.stzh-vbz-ticker__chip.sc-stzh-vbz-ticker{margin:var(--stzh-space-xxsmall)}.stzh-vbz-ticker__tooltip.sc-stzh-vbz-ticker{--width:20.875rem}.stzh-vbz-ticker__disturbance.sc-stzh-vbz-ticker{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.stzh-vbz-ticker__disturbance.sc-stzh-vbz-ticker:not(:first-child){margin-top:var(--stzh-space-small)}.stzh-vbz-ticker__disturbance--type0.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker,.stzh-vbz-ticker__disturbance--type0.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-icon.sc-stzh-vbz-ticker,.stzh-vbz-ticker__disturbance--type2.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker,.stzh-vbz-ticker__disturbance--type2.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-icon.sc-stzh-vbz-ticker{color:var(--stzh-color-error)}.stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);display:-ms-flexbox;display:flex}.stzh-vbz-ticker__disturbance--type0.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker,.stzh-vbz-ticker__disturbance--type2.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-vbz-ticker__disturbance-icon.sc-stzh-vbz-ticker{--size:var(--stzh-icon-size-xsmall);margin-top:var(--stzh-space-xxxsmall);margin-right:var(--stzh-space-xsmall)}.stzh-vbz-ticker__disturbance-link.sc-stzh-vbz-ticker{margin-top:var(--stzh-space-xsmall)}";var StzhVbzTicker=function(){function t(t){var e;registerInstance(this,t);this.globalDisturbances=[];this.lines=[];this.counter=(e={},e["".concat(VBZ.DISTURBANCE_GLOBAL)]=0,e["".concat(VBZ.DISTURBANCE_INFORMATION)]=0,e["".concat(VBZ.DISTURBANCE_CONSTRUCTION)]=0,e["".concat(VBZ.DISTURBANCE_NORMAL)]=0,e["".concat(VBZ.DISTURBANCE_EVENT)]=0,e["".concat(VBZ.DISTURBANCE_BUS)]=0,e);this.api="https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}";this.data="";this.moreInfoLink="https://zvv.ch/zvv/{lang}/fahrplan/vl.html?himIds={id}";this.dateAdapter=undefined;this.localization=undefined}t.prototype.localizationWatcher=function(){this.collator=new Intl.Collator(this.localization.$locale,{numeric:true})};t.prototype.apiWatcher=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(s){switch(s.label){case 0:if(!t){return[2]}e=this.api.replace(/\{lang\}/,this.localization.$locale);e=e+(e.includes("?")?"&":"?")+Date.now();return[4,axios.get(e)];case 1:i=s.sent().data;this.data=i;return[2]}}))}))};t.prototype.dataWatcher=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,s;var r=this;return __generator(this,(function(a){if(typeof t==="string"){this._data=JSON.parse(t)}else{this._data=t}s={};(i=(e=this._data)===null||e===void 0?void 0:e.Message)===null||i===void 0?void 0:i.forEach((function(t){var e=t.channel.filter((function(t){return t.name===VBZ.CHANNEL_TICKER&&t.url})).map((function(t){return t.url})).reduce((function(t,e){return t.concat(e)}),[]);var i=e.find((function(t){return t.url.indexOf(VBZ.CHANNEL_INFO_URL_FILTER)!==-1}));if(t.baseType===VBZ.BASE_TYPE_GLOBAL){r.counter[VBZ.DISTURBANCE_GLOBAL]++;r.globalDisturbances.push({id:t.id,head:t.head,category:t.category,baseType:t.baseType,startDate:new Date("".concat(t.sDate,"T").concat(t.sTime,"+02:00")),endDate:new Date("".concat(t.eDate,"T").concat(t.eTime,"+02:00")),altStart:t.altStart,altEnd:t.altEnd,infoUrl:i})}else{r.counter[t.category]++}if(t.affectedProduct&&t.category!==VBZ.DISTURBANCE_INFORMATION&&t.baseType!==VBZ.BASE_TYPE_GLOBAL){var a=[];t.affectedProduct.forEach((function(e){if(typeof s[e.lineId]==="undefined"){s[e.lineId]={line:e.line,name:e.name,category:e.cls,disturbances:[],alert:false}}if(t.category===VBZ.DISTURBANCE_NORMAL){s[e.lineId].alert=true}if(!a.includes(e.lineId)){a.push(e.lineId);s[e.lineId].disturbances.push({id:t.id,head:t.head,category:t.category,baseType:t.baseType,startDate:new Date("".concat(t.sDate,"T").concat(t.sTime,"+02:00")),endDate:new Date("".concat(t.eDate,"T").concat(t.eTime,"+02:00")),altStart:t.altStart,altEnd:t.altEnd,infoUrl:i})}}))}}));this.lines=Object.keys(s).map((function(t){return s[t]}));this.lines.sort((function(t,e){return r.collator.compare(t.line,e.line)}));return[2]}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:if(!!this.localization)return[3,2];t=this;return[4,window.stzhComponents.utils.fetchTranslations(this.element,"vbz-ticker")];case 1:t.localization=e.sent();this.localizationWatcher();e.label=2;case 2:if(!this.dateAdapter){this.dateAdapter=window.stzhComponents.utils.createFormatParseAdapter(this.localization.$formats,this.localization.$globals)}if(!this.data)return[3,4];return[4,this.dataWatcher(this.data)];case 3:e.sent();return[3,6];case 4:return[4,this.apiWatcher(this.api)];case 5:e.sent();e.label=6;case 6:return[2]}}))}))};t.prototype.renderDisturbance=function(t){var e;return h("div",{class:(e={"stzh-vbz-ticker__disturbance":true},e["stzh-vbz-ticker__disturbance--type".concat(t.category)]=!!t.category,e)},t.category===VBZ.DISTURBANCE_NORMAL||t.baseType===VBZ.BASE_TYPE_GLOBAL?h("stzh-icon",{name:"warning-big",class:"stzh-vbz-ticker__disturbance-icon"}):h("stzh-icon",{name:"construction",class:"stzh-vbz-ticker__disturbance-icon"}),h("div",{class:"stzh-vbz-ticker__disturbance-text"},h("div",{class:"stzh-vbz-ticker__disturbance-title"},t.head),h("div",{class:"stzh-vbz-ticker__disturbance-date"},this.dateAdapter.formatSpan(t.altStart||t.startDate,t.altEnd||t.endDate,"date")),t.infoUrl?h("stzh-link",{class:"stzh-vbz-ticker__disturbance-link",size:"small",href:t.infoUrl.url},this.localization.moreInfo):h("stzh-link",{class:"stzh-vbz-ticker__disturbance-link",size:"small",target:"_blank",icon:"external-link",href:this.moreInfoLink.replace(/\{lang\}/,this.localization.$locale).replace(/\{id\}/,t.id)},this.localization.moreInfo)))};t.prototype.render=function(){var t=this;var e={"stzh-vbz-ticker":true};return h(Host,null,h("div",{class:e},h("div",{class:"stzh-vbz-ticker__text"},h("div",{class:"stzh-vbz-ticker__title"},h("div",{class:"stzh-vbz-ticker__title-parts"},this.lines.length===0&&this.counter[VBZ.DISTURBANCE_GLOBAL]===0&&h("div",{class:"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--no-disturbances"},h("stzh-icon",{class:"stzh-vbz-ticker__icon",name:"checkmark-circle"}),this.localization.noDisturbances),this.counter[VBZ.DISTURBANCE_NORMAL]>0&&h("div",{class:"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--disturbances"},h("stzh-icon",{class:"stzh-vbz-ticker__icon",name:"warning"}),this.counter[VBZ.DISTURBANCE_GLOBAL]>0?this.localization.furtherDisturbanceTitle:this.localization.disturbanceTitle),(this.counter[VBZ.DISTURBANCE_CONSTRUCTION]>0||this.counter[VBZ.DISTURBANCE_EVENT]>0||this.counter[VBZ.DISTURBANCE_BUS]>0)&&h("div",{class:"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--others"},h("stzh-icon",{class:"stzh-vbz-ticker__icon",name:"construction"}),this.localization.constructionsTitle))),(this.lines.length>0||this.counter[VBZ.DISTURBANCE_GLOBAL]>0)&&h(Fragment,null,h("div",{class:"stzh-vbz-ticker__chips",role:"list"},this.lines.map((function(e){return h("div",{class:"stzh-vbz-ticker__chip",role:"listitem"},h("stzh-tooltip",{class:"stzh-vbz-ticker__tooltip"},h("stzh-vbz-linechip",{line:e.line,alert:e.alert}),h("div",{class:"stzh-vbz-ticker__tooltip-content",slot:"content"},e.disturbances.map((function(e){return t.renderDisturbance(e)})))))}))))),h("div",{class:"stzh-vbz-ticker__link"},h("slot",{name:"link"}))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{localization:["localizationWatcher"],api:["apiWatcher"],data:["dataWatcher"]}},enumerable:false,configurable:true});return t}();StzhVbzTicker.style=stzhVbzTickerCss;export{StzhVbzTicker as stzh_vbz_ticker};
1
+ var __awaiter=this&&this.__awaiter||function(t,e,i,s){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function n(t){try{o(s.next(t))}catch(t){a(t)}}function c(t){try{o(s["throw"](t))}catch(t){a(t)}}function o(t){t.done?i(t.value):r(t.value).then(n,c)}o((s=s.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,r,a,n;return n={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function c(t){return function(e){return o([t,e])}}function o(c){if(s)throw new TypeError("Generator is already executing.");while(n&&(n=0,c[0]&&(i=0)),i)try{if(s=1,r&&(a=c[0]&2?r["return"]:c[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,c[1])).done)return a;if(r=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;r=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){i.label=c[1];break}if(c[0]===6&&i.label<a[1]){i.label=a[1];a=c;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(c);break}if(a[2])i.ops.pop();i.trys.pop();continue}c=e.call(t,i)}catch(t){c=[6,t];r=0}finally{s=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{r as registerInstance,h,F as Fragment,a as Host,g as getElement}from"./index-bfb5b569.js";import{a as axios}from"./axios-85a0baad.js";import{VBZ}from"./index.js";var stzhVbzTickerCss=".sc-stzh-vbz-ticker-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:var(--stzh-font-style-regular);color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-vbz-ticker-h{display:none}.sc-stzh-vbz-ticker-h *.sc-stzh-vbz-ticker,.sc-stzh-vbz-ticker-h *.sc-stzh-vbz-ticker::before,.sc-stzh-vbz-ticker-h *.sc-stzh-vbz-ticker::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}.sc-stzh-vbz-ticker-h .has-focus.sc-stzh-vbz-ticker{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.3125rem}.sc-stzh-vbz-ticker-h .stzh-fylingfocus-focused.sc-stzh-vbz-ticker{outline-style:none !important}.sc-stzh-vbz-ticker-h .stzh-fylingfocus-focused.sc-stzh-vbz-ticker::-moz-focus-inner{border:0 !important}.stzh-vbz-ticker.sc-stzh-vbz-ticker{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}@media screen and (min-width: 1024px){.stzh-vbz-ticker.sc-stzh-vbz-ticker{-ms-flex-direction:row;flex-direction:row;-ms-flex-align:start;align-items:flex-start}}.stzh-vbz-ticker__icon.sc-stzh-vbz-ticker{--size:var(--stzh-icon-size-small);margin-right:var(--stzh-space-xsmall)}.stzh-vbz-ticker__title.sc-stzh-vbz-ticker{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);font-size:var(--stzh-font-curve-p1-default-font-size, var(--stzh-font-milli-font-size));line-height:var(--stzh-font-curve-p1-default-text-line-height, var(--stzh-font-milli-text-line-height));letter-spacing:var(--stzh-font-curve-p1-default-text-letter-spacing);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}@media screen and (min-width: 1024px){.stzh-vbz-ticker__title.sc-stzh-vbz-ticker{font-size:var(--stzh-font-curve-p1-medium-font-size, var(--stzh-font-centi-font-size));line-height:var(--stzh-font-curve-p1-medium-text-line-height, var(--stzh-font-centi-text-line-height));letter-spacing:var(--stzh-font-curve-p1-medium-text-letter-spacing)}}.stzh-vbz-ticker__title-parts.sc-stzh-vbz-ticker{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:calc(var(--stzh-space-xxxsmall) / -1) 0}.stzh-vbz-ticker__title-part.sc-stzh-vbz-ticker{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;white-space:nowrap;margin:var(--stzh-space-xxxsmall) 0}.stzh-vbz-ticker__title-part.sc-stzh-vbz-ticker:not(:last-child){margin-right:var(--stzh-space-large)}.stzh-vbz-ticker__title-part--no-disturbances.sc-stzh-vbz-ticker{color:var(--stzh-color-truegreen)}.stzh-vbz-ticker__title-part--major-events.sc-stzh-vbz-ticker{color:var(--stzh-color-coral)}.stzh-vbz-ticker__title-part--disturbances.sc-stzh-vbz-ticker{color:var(--stzh-color-error)}.stzh-vbz-ticker__link.sc-stzh-vbz-ticker{margin-top:var(--stzh-space-small)}@media screen and (min-width: 1024px){.stzh-vbz-ticker__link.sc-stzh-vbz-ticker{position:absolute;top:0;right:0;margin-top:0}}.stzh-vbz-ticker__chips.sc-stzh-vbz-ticker{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.stzh-vbz-ticker__chips.sc-stzh-vbz-ticker:not(:empty){margin:calc(var(--stzh-space-xxsmall) * -1);margin-top:calc(var(--stzh-space-medium) - var(--stzh-space-xxsmall))}.stzh-vbz-ticker__chip.sc-stzh-vbz-ticker{margin:var(--stzh-space-xxsmall)}.stzh-vbz-ticker__tooltip.sc-stzh-vbz-ticker{--width:20.875rem}.stzh-vbz-ticker__disturbance.sc-stzh-vbz-ticker{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.stzh-vbz-ticker__disturbance.sc-stzh-vbz-ticker:not(:first-child){margin-top:var(--stzh-space-small)}.stzh-vbz-ticker__disturbance--type0.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker,.stzh-vbz-ticker__disturbance--type0.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-icon.sc-stzh-vbz-ticker,.stzh-vbz-ticker__disturbance--type2.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker,.stzh-vbz-ticker__disturbance--type2.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-icon.sc-stzh-vbz-ticker{color:var(--stzh-color-error)}.stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);display:-ms-flexbox;display:flex}.stzh-vbz-ticker__disturbance--type0.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker,.stzh-vbz-ticker__disturbance--type2.sc-stzh-vbz-ticker .stzh-vbz-ticker__disturbance-title.sc-stzh-vbz-ticker{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-vbz-ticker__disturbance-icon.sc-stzh-vbz-ticker{--size:var(--stzh-icon-size-xsmall);margin-top:var(--stzh-space-xxxsmall);margin-right:var(--stzh-space-xsmall)}.stzh-vbz-ticker__disturbance-link.sc-stzh-vbz-ticker{margin-top:var(--stzh-space-xsmall)}";var StzhVbzTicker=function(){function t(t){var e;registerInstance(this,t);this.globalDisturbances=[];this.lines=[];this.counter=(e={},e["".concat(VBZ.DISTURBANCE_GLOBAL)]=0,e["".concat(VBZ.DISTURBANCE_INFORMATION)]=0,e["".concat(VBZ.DISTURBANCE_CONSTRUCTION)]=0,e["".concat(VBZ.DISTURBANCE_NORMAL)]=0,e["".concat(VBZ.DISTURBANCE_EVENT)]=0,e["".concat(VBZ.DISTURBANCE_BUS)]=0,e);this.api="https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}";this.data="";this.moreInfoLink="https://zvv.ch/zvv/{lang}/fahrplan/vl.html?himIds={id}";this.dateAdapter=undefined;this.localization=undefined}t.prototype.localizationWatcher=function(){this.collator=new Intl.Collator(this.localization.$locale,{numeric:true})};t.prototype.apiWatcher=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i;return __generator(this,(function(s){switch(s.label){case 0:if(!t){return[2]}e=this.api.replace(/\{lang\}/,this.localization.$locale);e=e+(e.includes("?")?"&":"?")+Date.now();return[4,axios.get(e)];case 1:i=s.sent().data;this.data=i;return[2]}}))}))};t.prototype.dateAdapterWatcher=function(t){if(!t){this.dateAdapter=window.stzhComponents.utils.createFormatParseAdapter(this.localization.$formats,this.localization.$globals)}};t.prototype.dataWatcher=function(t){return __awaiter(this,void 0,void 0,(function(){var e,i,s;var r=this;return __generator(this,(function(a){if(typeof t==="string"){this._data=JSON.parse(t)}else{this._data=t}s={};(i=(e=this._data)===null||e===void 0?void 0:e.Message)===null||i===void 0?void 0:i.forEach((function(t){var e=t.channel.filter((function(t){return t.name===VBZ.CHANNEL_TICKER&&t.url})).map((function(t){return t.url})).reduce((function(t,e){return t.concat(e)}),[]);var i=e.find((function(t){return t.url.indexOf(VBZ.CHANNEL_INFO_URL_FILTER)!==-1}));if(t.baseType===VBZ.BASE_TYPE_GLOBAL){r.counter[VBZ.DISTURBANCE_GLOBAL]++;r.globalDisturbances.push({id:t.id,head:t.head,category:t.category,baseType:t.baseType,startDate:new Date("".concat(t.sDate,"T").concat(t.sTime,"+02:00")),endDate:new Date("".concat(t.eDate,"T").concat(t.eTime,"+02:00")),altStart:t.altStart,altEnd:t.altEnd,infoUrl:i})}else{r.counter[t.category]++}if(t.affectedProduct&&t.category!==VBZ.DISTURBANCE_INFORMATION&&t.baseType!==VBZ.BASE_TYPE_GLOBAL){var a=[];t.affectedProduct.forEach((function(e){if(typeof s[e.lineId]==="undefined"){s[e.lineId]={line:e.line,name:e.name,category:e.cls,disturbances:[],alert:false}}if(t.category===VBZ.DISTURBANCE_NORMAL){s[e.lineId].alert=true}if(!a.includes(e.lineId)){a.push(e.lineId);s[e.lineId].disturbances.push({id:t.id,head:t.head,category:t.category,baseType:t.baseType,startDate:new Date("".concat(t.sDate,"T").concat(t.sTime,"+02:00")),endDate:new Date("".concat(t.eDate,"T").concat(t.eTime,"+02:00")),altStart:t.altStart,altEnd:t.altEnd,infoUrl:i})}}))}}));this.lines=Object.keys(s).map((function(t){return s[t]}));this.lines.sort((function(t,e){return r.collator.compare(t.line,e.line)}));return[2]}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:if(!!this.localization)return[3,2];t=this;return[4,window.stzhComponents.utils.fetchTranslations(this.element,"vbz-ticker")];case 1:t.localization=e.sent();this.localizationWatcher();e.label=2;case 2:this.dateAdapterWatcher(this.dateAdapter);if(!this.data)return[3,4];return[4,this.dataWatcher(this.data)];case 3:e.sent();return[3,6];case 4:return[4,this.apiWatcher(this.api)];case 5:e.sent();e.label=6;case 6:return[2]}}))}))};t.prototype.renderDisturbance=function(t){var e;return h("div",{class:(e={"stzh-vbz-ticker__disturbance":true},e["stzh-vbz-ticker__disturbance--type".concat(t.category)]=!!t.category,e)},t.category===VBZ.DISTURBANCE_NORMAL||t.baseType===VBZ.BASE_TYPE_GLOBAL?h("stzh-icon",{name:"warning-big",class:"stzh-vbz-ticker__disturbance-icon"}):h("stzh-icon",{name:"construction",class:"stzh-vbz-ticker__disturbance-icon"}),h("div",{class:"stzh-vbz-ticker__disturbance-text"},h("div",{class:"stzh-vbz-ticker__disturbance-title"},t.head),h("div",{class:"stzh-vbz-ticker__disturbance-date"},this.dateAdapter.formatSpan(t.altStart||t.startDate,t.altEnd||t.endDate,"date")),t.infoUrl?h("stzh-link",{class:"stzh-vbz-ticker__disturbance-link",size:"small",href:t.infoUrl.url},this.localization.moreInfo):h("stzh-link",{class:"stzh-vbz-ticker__disturbance-link",size:"small",target:"_blank",icon:"external-link",href:this.moreInfoLink.replace(/\{lang\}/,this.localization.$locale).replace(/\{id\}/,t.id)},this.localization.moreInfo)))};t.prototype.render=function(){var t=this;var e={"stzh-vbz-ticker":true};return h(Host,null,h("div",{class:e},h("div",{class:"stzh-vbz-ticker__text"},h("div",{class:"stzh-vbz-ticker__title"},h("div",{class:"stzh-vbz-ticker__title-parts"},this.lines.length===0&&this.counter[VBZ.DISTURBANCE_GLOBAL]===0&&h("div",{class:"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--no-disturbances"},h("stzh-icon",{class:"stzh-vbz-ticker__icon",name:"checkmark-circle"}),this.localization.noDisturbances),this.counter[VBZ.DISTURBANCE_NORMAL]>0&&h("div",{class:"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--disturbances"},h("stzh-icon",{class:"stzh-vbz-ticker__icon",name:"warning"}),this.counter[VBZ.DISTURBANCE_GLOBAL]>0?this.localization.furtherDisturbanceTitle:this.localization.disturbanceTitle),(this.counter[VBZ.DISTURBANCE_CONSTRUCTION]>0||this.counter[VBZ.DISTURBANCE_EVENT]>0||this.counter[VBZ.DISTURBANCE_BUS]>0)&&h("div",{class:"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--others"},h("stzh-icon",{class:"stzh-vbz-ticker__icon",name:"construction"}),this.localization.constructionsTitle))),(this.lines.length>0||this.counter[VBZ.DISTURBANCE_GLOBAL]>0)&&h(Fragment,null,h("div",{class:"stzh-vbz-ticker__chips",role:"list"},this.lines.map((function(e){return h("div",{class:"stzh-vbz-ticker__chip",role:"listitem"},h("stzh-tooltip",{class:"stzh-vbz-ticker__tooltip"},h("stzh-vbz-linechip",{line:e.line,alert:e.alert}),h("div",{class:"stzh-vbz-ticker__tooltip-content",slot:"content"},e.disturbances.map((function(e){return t.renderDisturbance(e)})))))}))))),h("div",{class:"stzh-vbz-ticker__link"},h("slot",{name:"link"}))))};Object.defineProperty(t.prototype,"element",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{localization:["localizationWatcher"],api:["apiWatcher"],dateAdapter:["dateAdapterWatcher"],data:["dataWatcher"]}},enumerable:false,configurable:true});return t}();StzhVbzTicker.style=stzhVbzTickerCss;export{StzhVbzTicker as stzh_vbz_ticker};
2
2
  //# sourceMappingURL=stzh-vbz-ticker.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["stzhVbzTickerCss","StzhVbzTicker","this","globalDisturbances","lines","counter","_c","concat","VBZ","DISTURBANCE_GLOBAL","DISTURBANCE_INFORMATION","DISTURBANCE_CONSTRUCTION","DISTURBANCE_NORMAL","DISTURBANCE_EVENT","DISTURBANCE_BUS","class_1","prototype","localizationWatcher","collator","Intl","Collator","localization","$locale","numeric","apiWatcher","newValue","apiUrl","api","replace","includes","Date","now","axios","get","data","sent","dataWatcher","_data","JSON","parse","_b","_a","Message","forEach","message","urls","channel","filter","name","CHANNEL_TICKER","url","map","reduce","a","b","infoUrl","find","indexOf","CHANNEL_INFO_URL_FILTER","baseType","BASE_TYPE_GLOBAL","_this","push","id","head","category","startDate","sDate","sTime","endDate","eDate","eTime","altStart","altEnd","affectedProduct","affectedLines_1","product","lineId","line","cls","disturbances","alert","Object","keys","key","sort","compare","componentWillLoad","window","stzhComponents","utils","fetchTranslations","element","_d","dateAdapter","createFormatParseAdapter","$formats","$globals","renderDisturbance","disturbance","h","class","formatSpan","size","href","moreInfo","target","icon","moreInfoLink","render","classes","Host","length","noDisturbances","furtherDisturbanceTitle","disturbanceTitle","constructionsTitle","Fragment","role","slot"],"sources":["src/components/stzh-vbz-ticker/stzh-vbz-ticker.scss?tag=stzh-vbz-ticker&encapsulation=scoped","src/components/stzh-vbz-ticker/stzh-vbz-ticker.tsx"],"sourcesContent":[":host {\n}\n\n.stzh-vbz-ticker {\n display: flex;\n flex-direction: column;\n position: relative;\n\n @include mq($from: medium) {\n flex-direction: row;\n align-items: flex-start;\n }\n\n &__icon {\n --size: #{iconSize('small')};\n margin-right: space('xsmall');\n }\n\n &__title {\n @include font('medium');\n @include fontCurve('p1');\n display: flex;\n flex-wrap: wrap;\n }\n\n &__title-parts {\n display: flex;\n flex-wrap: wrap;\n margin: calc(#{space('xxxsmall')} / -1) 0;\n }\n\n &__title-part {\n display: flex;\n align-items: center;\n white-space: nowrap;\n margin: space('xxxsmall') 0;\n\n &:not(:last-child) {\n margin-right: space('large');\n }\n\n &--no-disturbances {\n color: $colorTruegreen;\n }\n\n &--major-events {\n color: $colorCoral;\n }\n\n &--disturbances {\n color: $colorError;\n }\n }\n\n // &__description {\n // @include fontSize('micro');\n // @include spaceCurve('margin-top', 'tiny');\n // }\n\n &__link {\n margin-top: space('small');\n\n @include mq($from: medium) {\n position: absolute;\n top: 0;\n right: 0;\n margin-top: 0;\n }\n }\n\n &__chips {\n display: flex;\n flex-wrap: wrap;\n\n &:not(:empty) {\n margin: calc(#{space('xxsmall')} * -1);\n margin-top: calc(#{space('medium')} - #{space('xxsmall')});\n }\n }\n\n &__chip {\n margin: space('xxsmall');\n }\n\n &__tooltip {\n --width: 334px;\n }\n\n &__disturbance {\n display: flex;\n align-items: flex-start;\n\n &:not(:first-child) {\n margin-top: space('small');\n }\n }\n\n &__disturbance--type0 &__disturbance-title,\n &__disturbance--type0 &__disturbance-icon,\n &__disturbance--type2 &__disturbance-title,\n &__disturbance--type2 &__disturbance-icon {\n color: $colorError;\n }\n\n &__disturbance-title {\n @include font('medium');\n display: flex;\n }\n\n &__disturbance--type0 &__disturbance-title,\n &__disturbance--type2 &__disturbance-title {\n @include font('heavy');\n }\n\n &__disturbance-icon {\n --size: #{iconSize('xsmall')};\n margin-top: space('xxxsmall');\n margin-right: space('xsmall');\n }\n\n &__disturbance-link {\n margin-top: space('xsmall');\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Watch,\n Element,\n Fragment\n} from \"@stencil/core\";\n\nimport axios from 'axios';\n\nimport { StzhLocaleAdapter } from \"../../utils/date-adapter\";\n\nimport {\n VBZ,\n VbzTickerInfoUrl,\n VbzTickerDisturbance,\n VbzTickerLine\n} from \"../../index\";\n\nimport { StzhVbzTickerLocalizedText } from \"./stzh-vbz-ticker.localization\";\n\n/**\n * @slot link - Optional link to traffic situation\n */\n@Component({\n tag: \"stzh-vbz-ticker\",\n styleUrl: \"stzh-vbz-ticker.scss\",\n scoped: true\n})\nexport class StzhVbzTicker {\n /** API URL (`{lang}` is replaced in the URL) */\n @Prop() api: string = \"https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}\";\n\n /** Data to pass in directly (alternative for API call) */\n @Prop() data: any = \"\";\n private _data: any;\n\n /** More info link (`{lang}` and `{id}` are replaced in the URL) */\n @Prop() moreInfoLink: string = \"https://zvv.ch/zvv/{lang}/fahrplan/vl.html?himIds={id}\";\n\n /**\n * Date adapter, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n */\n @Prop() dateAdapter: StzhLocaleAdapter;\n\n /** Translation strings. */\n @Prop() localization: StzhVbzTickerLocalizedText;\n\n @Element() element: HTMLStzhVbzTickerElement;\n\n private globalDisturbances: VbzTickerDisturbance[] = [];\n private lines: VbzTickerLine[] = [];\n private collator: Intl.Collator;\n\n private counter = {\n [`${VBZ.DISTURBANCE_GLOBAL}`]: 0,\n [`${VBZ.DISTURBANCE_INFORMATION}`]: 0,\n [`${VBZ.DISTURBANCE_CONSTRUCTION}`]: 0,\n [`${VBZ.DISTURBANCE_NORMAL}`]: 0,\n [`${VBZ.DISTURBANCE_EVENT}`]: 0,\n [`${VBZ.DISTURBANCE_BUS}`]: 0\n };\n\n @Watch(\"localization\")\n localizationWatcher() {\n this.collator = new Intl.Collator(this.localization.$locale, {\n numeric: true\n });\n }\n\n @Watch(\"api\")\n async apiWatcher(newValue: string) {\n if (!newValue) {\n return;\n }\n\n let apiUrl = this.api.replace(/\\{lang\\}/, this.localization.$locale)\n apiUrl = apiUrl + (apiUrl.includes(\"?\") ? \"&\" : \"?\") + Date.now();\n\n // load data from API\n const { data } = await axios.get(apiUrl);\n\n this.data = data;\n }\n\n @Watch(\"data\")\n async dataWatcher(newValue: any) {\n if (typeof newValue === \"string\") {\n this._data = JSON.parse(newValue);\n } else {\n this._data = newValue;\n }\n\n const lines: { [key: string]: VbzTickerLine } = {};\n\n this._data?.Message?.forEach(message => {\n const urls: VbzTickerInfoUrl[] = message.channel\n .filter(channel => channel.name === VBZ.CHANNEL_TICKER && channel.url)\n .map(channel => channel.url)\n .reduce((a, b) => a.concat(b), []);\n\n const infoUrl = urls\n .find(url => url.url.indexOf(VBZ.CHANNEL_INFO_URL_FILTER) !== -1);\n\n if (message.baseType === VBZ.BASE_TYPE_GLOBAL) {\n this.counter[VBZ.DISTURBANCE_GLOBAL]++;\n\n this.globalDisturbances.push({\n id: message.id,\n head: message.head,\n category: message.category,\n baseType: message.baseType,\n startDate: new Date(`${message.sDate}T${message.sTime}+02:00`),\n endDate: new Date(`${message.eDate}T${message.eTime}+02:00`),\n altStart: message.altStart,\n altEnd: message.altEnd,\n infoUrl: infoUrl\n });\n } else {\n this.counter[message.category]++;\n }\n\n // don't add to lines if no line/product has been linked to\n // or if it is a information disturbance or global\n if (\n message.affectedProduct\n && message.category !== VBZ.DISTURBANCE_INFORMATION\n && message.baseType !== VBZ.BASE_TYPE_GLOBAL\n ) {\n const affectedLines = [];\n\n message.affectedProduct.forEach(product => {\n if (typeof lines[product.lineId] === \"undefined\") {\n lines[product.lineId] = {\n line: product.line,\n name: product.name,\n category: product.cls,\n disturbances: [],\n alert: false\n }\n }\n\n if (message.category === VBZ.DISTURBANCE_NORMAL) {\n lines[product.lineId].alert = true;\n }\n\n // only add disturbance message to line if it was not already added (avoiding same message twice)\n if (!affectedLines.includes(product.lineId)) {\n affectedLines.push(product.lineId);\n\n lines[product.lineId].disturbances.push({\n id: message.id,\n head: message.head,\n category: message.category,\n baseType: message.baseType,\n startDate: new Date(`${message.sDate}T${message.sTime}+02:00`),\n endDate: new Date(`${message.eDate}T${message.eTime}+02:00`),\n altStart: message.altStart,\n altEnd: message.altEnd,\n infoUrl: infoUrl\n })\n }\n })\n }\n });\n\n this.lines = Object.keys(lines)\n .map(key => lines[key]);\n\n // sort by line name\n this.lines.sort((a, b) => this.collator\n .compare(a.line, b.line));\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"vbz-ticker\");\n this.localizationWatcher();\n }\n\n if (!this.dateAdapter) {\n this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formats,\n this.localization.$globals\n );\n }\n\n if (this.data) {\n await this.dataWatcher(this.data);\n } else {\n await this.apiWatcher(this.api);\n }\n }\n\n renderDisturbance(disturbance: VbzTickerDisturbance) {\n return (\n <div class={{\n \"stzh-vbz-ticker__disturbance\": true,\n [`stzh-vbz-ticker__disturbance--type${disturbance.category}`]: !!disturbance.category\n }}>\n {disturbance.category === VBZ.DISTURBANCE_NORMAL\n || disturbance.baseType === VBZ.BASE_TYPE_GLOBAL\n ?\n <stzh-icon name=\"warning-big\" class=\"stzh-vbz-ticker__disturbance-icon\"></stzh-icon>\n :\n <stzh-icon name=\"construction\" class=\"stzh-vbz-ticker__disturbance-icon\"></stzh-icon>\n }\n\n <div class=\"stzh-vbz-ticker__disturbance-text\">\n <div class=\"stzh-vbz-ticker__disturbance-title\">\n {disturbance.head}\n </div>\n\n <div class=\"stzh-vbz-ticker__disturbance-date\">\n {this.dateAdapter.formatSpan(\n disturbance.altStart || disturbance.startDate,\n disturbance.altEnd || disturbance.endDate,\n \"date\"\n )}\n </div>\n\n {disturbance.infoUrl ?\n <stzh-link\n class=\"stzh-vbz-ticker__disturbance-link\"\n size=\"small\"\n href={disturbance.infoUrl.url}\n >\n {this.localization.moreInfo}\n </stzh-link>\n :\n <stzh-link\n class=\"stzh-vbz-ticker__disturbance-link\"\n size=\"small\"\n target=\"_blank\"\n icon=\"external-link\"\n href={this.moreInfoLink\n .replace(/\\{lang\\}/, this.localization.$locale)\n .replace(/\\{id\\}/, disturbance.id)}\n >\n {this.localization.moreInfo}\n </stzh-link>\n }\n </div>\n </div>\n );\n }\n\n render() {\n const classes = {\n \"stzh-vbz-ticker\": true\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-vbz-ticker__text\">\n <div class=\"stzh-vbz-ticker__title\">\n <div class=\"stzh-vbz-ticker__title-parts\">\n {this.lines.length === 0 && this.counter[VBZ.DISTURBANCE_GLOBAL] === 0 &&\n <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--no-disturbances\">\n <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"checkmark-circle\"></stzh-icon>\n {this.localization.noDisturbances}\n </div>}\n\n {/* {this.counter[DISTURBANCE_GLOBAL] > 0 &&\n <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--major-events\">\n <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"important-warning\"></stzh-icon>\n {this.localization.majorEventTitle}\n </div>} */}\n\n {this.counter[VBZ.DISTURBANCE_NORMAL] > 0 &&\n <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--disturbances\">\n <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"warning\"></stzh-icon>\n {this.counter[VBZ.DISTURBANCE_GLOBAL] > 0 ?\n this.localization.furtherDisturbanceTitle : this.localization.disturbanceTitle}\n </div>}\n\n {(this.counter[VBZ.DISTURBANCE_CONSTRUCTION] > 0\n || this.counter[VBZ.DISTURBANCE_EVENT] > 0\n || this.counter[VBZ.DISTURBANCE_BUS] > 0) &&\n <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--others\">\n <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"construction\"></stzh-icon>\n {this.localization.constructionsTitle}\n </div>}\n </div>\n </div>\n\n {(this.lines.length > 0 || this.counter[VBZ.DISTURBANCE_GLOBAL] > 0) &&\n <Fragment>\n {/* <div class=\"stzh-vbz-ticker__description\">\n {this.counter[VBZ.DISTURBANCE_GLOBAL] > 0\n ? this.localization.globalDisturbance\n : this.localization.affectedLines}\n </div> */}\n <div class=\"stzh-vbz-ticker__chips\" role=\"list\">\n {/* {this.counter[VBZ.DISTURBANCE_GLOBAL] > 0 &&\n <div class=\"stzh-vbz-ticker__chip\" role=\"listitem\">\n <stzh-tooltip class=\"stzh-vbz-ticker__tooltip\">\n <stzh-vbz-linechip global></stzh-vbz-linechip>\n <div class=\"stzh-vbz-ticker__tooltip-content\" slot=\"content\">\n {this.globalDisturbances.map((disturbance) => this.renderDisturbance(disturbance))}\n </div>\n </stzh-tooltip>\n </div>} */}\n\n {this.lines.map((line) =>\n <div class=\"stzh-vbz-ticker__chip\" role=\"listitem\">\n <stzh-tooltip class=\"stzh-vbz-ticker__tooltip\">\n <stzh-vbz-linechip line={line.line} alert={line.alert}></stzh-vbz-linechip>\n <div class=\"stzh-vbz-ticker__tooltip-content\" slot=\"content\">\n {line.disturbances.map((disturbance) => this.renderDisturbance(disturbance))}\n </div>\n </stzh-tooltip>\n </div>\n )}\n </div>\n </Fragment>}\n </div>\n\n <div class=\"stzh-vbz-ticker__link\">\n <slot name=\"link\"></slot>\n </div>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AKG,QAAQG,IAAIK,mBAAqB,GACtCX,KAAKG,QAAQG,IAAIM,iBAAmB,IACvCsF,EAAA,OAAKC,MAAM,mEACTD,EAAA,aAAWC,MAAM,wBAAwBrD,KAAK,iBAC7C9C,KAAKmB,aAAa+F,uBAKzBlH,KAAKE,MAAM4G,OAAS,GAAK9G,KAAKG,QAAQG,IAAIC,oBAAsB,IAChE2F,EAACiB,SAAQ,KAMPjB,EAAA,OAAKC,MAAM,yBAAyBiB,KAAK,QAWtCpH,KAAKE,MAAM+C,KAAI,SAAC2B,GACf,OAAAsB,EAAA,OAAKC,MAAM,wBAAwBiB,KAAK,YACtClB,EAAA,gBAAcC,MAAM,4BAClBD,EAAA,qBAAmBtB,KAAMA,EAAKA,KAAMG,MAAOH,EAAKG,QAChDmB,EAAA,OAAKC,MAAM,mCAAmCkB,KAAK,WAChDzC,EAAKE,aAAa7B,KAAI,SAACgD,GAAgB,OAAAtC,EAAKqC,kBAAkBC,EAAvB,MAJ9C,OAaVC,EAAA,OAAKC,MAAM,yBACTD,EAAA,QAAMpD,KAAK,W,mTArSG,G"}
1
+ {"version":3,"names":["stzhVbzTickerCss","StzhVbzTicker","this","globalDisturbances","lines","counter","_c","concat","VBZ","DISTURBANCE_GLOBAL","DISTURBANCE_INFORMATION","DISTURBANCE_CONSTRUCTION","DISTURBANCE_NORMAL","DISTURBANCE_EVENT","DISTURBANCE_BUS","class_1","prototype","localizationWatcher","collator","Intl","Collator","localization","$locale","numeric","apiWatcher","newValue","apiUrl","api","replace","includes","Date","now","axios","get","data","sent","dateAdapterWatcher","dateAdapter","window","stzhComponents","utils","createFormatParseAdapter","$formats","$globals","dataWatcher","_data","JSON","parse","_b","_a","Message","forEach","message","urls","channel","filter","name","CHANNEL_TICKER","url","map","reduce","a","b","infoUrl","find","indexOf","CHANNEL_INFO_URL_FILTER","baseType","BASE_TYPE_GLOBAL","_this","push","id","head","category","startDate","sDate","sTime","endDate","eDate","eTime","altStart","altEnd","affectedProduct","affectedLines_1","product","lineId","line","cls","disturbances","alert","Object","keys","key","sort","compare","componentWillLoad","fetchTranslations","element","_d","renderDisturbance","disturbance","h","class","formatSpan","size","href","moreInfo","target","icon","moreInfoLink","render","classes","Host","length","noDisturbances","furtherDisturbanceTitle","disturbanceTitle","constructionsTitle","Fragment","role","slot"],"sources":["src/components/stzh-vbz-ticker/stzh-vbz-ticker.scss?tag=stzh-vbz-ticker&encapsulation=scoped","src/components/stzh-vbz-ticker/stzh-vbz-ticker.tsx"],"sourcesContent":[":host {\n}\n\n.stzh-vbz-ticker {\n display: flex;\n flex-direction: column;\n position: relative;\n\n @include mq($from: medium) {\n flex-direction: row;\n align-items: flex-start;\n }\n\n &__icon {\n --size: #{iconSize('small')};\n margin-right: space('xsmall');\n }\n\n &__title {\n @include font('medium');\n @include fontCurve('p1');\n display: flex;\n flex-wrap: wrap;\n }\n\n &__title-parts {\n display: flex;\n flex-wrap: wrap;\n margin: calc(#{space('xxxsmall')} / -1) 0;\n }\n\n &__title-part {\n display: flex;\n align-items: center;\n white-space: nowrap;\n margin: space('xxxsmall') 0;\n\n &:not(:last-child) {\n margin-right: space('large');\n }\n\n &--no-disturbances {\n color: $colorTruegreen;\n }\n\n &--major-events {\n color: $colorCoral;\n }\n\n &--disturbances {\n color: $colorError;\n }\n }\n\n // &__description {\n // @include fontSize('micro');\n // @include spaceCurve('margin-top', 'tiny');\n // }\n\n &__link {\n margin-top: space('small');\n\n @include mq($from: medium) {\n position: absolute;\n top: 0;\n right: 0;\n margin-top: 0;\n }\n }\n\n &__chips {\n display: flex;\n flex-wrap: wrap;\n\n &:not(:empty) {\n margin: calc(#{space('xxsmall')} * -1);\n margin-top: calc(#{space('medium')} - #{space('xxsmall')});\n }\n }\n\n &__chip {\n margin: space('xxsmall');\n }\n\n &__tooltip {\n --width: 334px;\n }\n\n &__disturbance {\n display: flex;\n align-items: flex-start;\n\n &:not(:first-child) {\n margin-top: space('small');\n }\n }\n\n &__disturbance--type0 &__disturbance-title,\n &__disturbance--type0 &__disturbance-icon,\n &__disturbance--type2 &__disturbance-title,\n &__disturbance--type2 &__disturbance-icon {\n color: $colorError;\n }\n\n &__disturbance-title {\n @include font('medium');\n display: flex;\n }\n\n &__disturbance--type0 &__disturbance-title,\n &__disturbance--type2 &__disturbance-title {\n @include font('heavy');\n }\n\n &__disturbance-icon {\n --size: #{iconSize('xsmall')};\n margin-top: space('xxxsmall');\n margin-right: space('xsmall');\n }\n\n &__disturbance-link {\n margin-top: space('xsmall');\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n Watch,\n Element,\n Fragment\n} from \"@stencil/core\";\n\nimport axios from 'axios';\n\nimport { StzhLocaleAdapter } from \"../../utils/date-adapter\";\n\nimport {\n VBZ,\n VbzTickerInfoUrl,\n VbzTickerDisturbance,\n VbzTickerLine\n} from \"../../index\";\n\nimport { StzhVbzTickerLocalizedText } from \"./stzh-vbz-ticker.localization\";\n\n/**\n * @slot link - Optional link to traffic situation\n */\n@Component({\n tag: \"stzh-vbz-ticker\",\n styleUrl: \"stzh-vbz-ticker.scss\",\n scoped: true\n})\nexport class StzhVbzTicker {\n /** API URL (`{lang}` is replaced in the URL) */\n @Prop() api: string = \"https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}\";\n\n /** Data to pass in directly (alternative for API call) */\n @Prop() data: any = \"\";\n private _data: any;\n\n /** More info link (`{lang}` and `{id}` are replaced in the URL) */\n @Prop() moreInfoLink: string = \"https://zvv.ch/zvv/{lang}/fahrplan/vl.html?himIds={id}\";\n\n /**\n * Date adapter, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n */\n @Prop() dateAdapter: StzhLocaleAdapter;\n\n /** Translation strings. */\n @Prop() localization: StzhVbzTickerLocalizedText;\n\n @Element() element: HTMLStzhVbzTickerElement;\n\n private globalDisturbances: VbzTickerDisturbance[] = [];\n private lines: VbzTickerLine[] = [];\n private collator: Intl.Collator;\n\n private counter = {\n [`${VBZ.DISTURBANCE_GLOBAL}`]: 0,\n [`${VBZ.DISTURBANCE_INFORMATION}`]: 0,\n [`${VBZ.DISTURBANCE_CONSTRUCTION}`]: 0,\n [`${VBZ.DISTURBANCE_NORMAL}`]: 0,\n [`${VBZ.DISTURBANCE_EVENT}`]: 0,\n [`${VBZ.DISTURBANCE_BUS}`]: 0\n };\n\n @Watch(\"localization\")\n localizationWatcher() {\n this.collator = new Intl.Collator(this.localization.$locale, {\n numeric: true\n });\n }\n\n @Watch(\"api\")\n async apiWatcher(newValue: string) {\n if (!newValue) {\n return;\n }\n\n let apiUrl = this.api.replace(/\\{lang\\}/, this.localization.$locale)\n apiUrl = apiUrl + (apiUrl.includes(\"?\") ? \"&\" : \"?\") + Date.now();\n\n // load data from API\n const { data } = await axios.get(apiUrl);\n\n this.data = data;\n }\n\n @Watch(\"dateAdapter\")\n dateAdapterWatcher(newValue: StzhLocaleAdapter) {\n if (!newValue) {\n this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formats,\n this.localization.$globals\n );\n }\n }\n\n @Watch(\"data\")\n async dataWatcher(newValue: any) {\n if (typeof newValue === \"string\") {\n this._data = JSON.parse(newValue);\n } else {\n this._data = newValue;\n }\n\n const lines: { [key: string]: VbzTickerLine } = {};\n\n this._data?.Message?.forEach(message => {\n const urls: VbzTickerInfoUrl[] = message.channel\n .filter(channel => channel.name === VBZ.CHANNEL_TICKER && channel.url)\n .map(channel => channel.url)\n .reduce((a, b) => a.concat(b), []);\n\n const infoUrl = urls\n .find(url => url.url.indexOf(VBZ.CHANNEL_INFO_URL_FILTER) !== -1);\n\n if (message.baseType === VBZ.BASE_TYPE_GLOBAL) {\n this.counter[VBZ.DISTURBANCE_GLOBAL]++;\n\n this.globalDisturbances.push({\n id: message.id,\n head: message.head,\n category: message.category,\n baseType: message.baseType,\n startDate: new Date(`${message.sDate}T${message.sTime}+02:00`),\n endDate: new Date(`${message.eDate}T${message.eTime}+02:00`),\n altStart: message.altStart,\n altEnd: message.altEnd,\n infoUrl: infoUrl\n });\n } else {\n this.counter[message.category]++;\n }\n\n // don't add to lines if no line/product has been linked to\n // or if it is a information disturbance or global\n if (\n message.affectedProduct\n && message.category !== VBZ.DISTURBANCE_INFORMATION\n && message.baseType !== VBZ.BASE_TYPE_GLOBAL\n ) {\n const affectedLines = [];\n\n message.affectedProduct.forEach(product => {\n if (typeof lines[product.lineId] === \"undefined\") {\n lines[product.lineId] = {\n line: product.line,\n name: product.name,\n category: product.cls,\n disturbances: [],\n alert: false\n }\n }\n\n if (message.category === VBZ.DISTURBANCE_NORMAL) {\n lines[product.lineId].alert = true;\n }\n\n // only add disturbance message to line if it was not already added (avoiding same message twice)\n if (!affectedLines.includes(product.lineId)) {\n affectedLines.push(product.lineId);\n\n lines[product.lineId].disturbances.push({\n id: message.id,\n head: message.head,\n category: message.category,\n baseType: message.baseType,\n startDate: new Date(`${message.sDate}T${message.sTime}+02:00`),\n endDate: new Date(`${message.eDate}T${message.eTime}+02:00`),\n altStart: message.altStart,\n altEnd: message.altEnd,\n infoUrl: infoUrl\n })\n }\n })\n }\n });\n\n this.lines = Object.keys(lines)\n .map(key => lines[key]);\n\n // sort by line name\n this.lines.sort((a, b) => this.collator\n .compare(a.line, b.line));\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"vbz-ticker\");\n this.localizationWatcher();\n }\n\n this.dateAdapterWatcher(this.dateAdapter);\n\n if (this.data) {\n await this.dataWatcher(this.data);\n } else {\n await this.apiWatcher(this.api);\n }\n }\n\n renderDisturbance(disturbance: VbzTickerDisturbance) {\n return (\n <div class={{\n \"stzh-vbz-ticker__disturbance\": true,\n [`stzh-vbz-ticker__disturbance--type${disturbance.category}`]: !!disturbance.category\n }}>\n {disturbance.category === VBZ.DISTURBANCE_NORMAL\n || disturbance.baseType === VBZ.BASE_TYPE_GLOBAL\n ?\n <stzh-icon name=\"warning-big\" class=\"stzh-vbz-ticker__disturbance-icon\"></stzh-icon>\n :\n <stzh-icon name=\"construction\" class=\"stzh-vbz-ticker__disturbance-icon\"></stzh-icon>\n }\n\n <div class=\"stzh-vbz-ticker__disturbance-text\">\n <div class=\"stzh-vbz-ticker__disturbance-title\">\n {disturbance.head}\n </div>\n\n <div class=\"stzh-vbz-ticker__disturbance-date\">\n {this.dateAdapter.formatSpan(\n disturbance.altStart || disturbance.startDate,\n disturbance.altEnd || disturbance.endDate,\n \"date\"\n )}\n </div>\n\n {disturbance.infoUrl ?\n <stzh-link\n class=\"stzh-vbz-ticker__disturbance-link\"\n size=\"small\"\n href={disturbance.infoUrl.url}\n >\n {this.localization.moreInfo}\n </stzh-link>\n :\n <stzh-link\n class=\"stzh-vbz-ticker__disturbance-link\"\n size=\"small\"\n target=\"_blank\"\n icon=\"external-link\"\n href={this.moreInfoLink\n .replace(/\\{lang\\}/, this.localization.$locale)\n .replace(/\\{id\\}/, disturbance.id)}\n >\n {this.localization.moreInfo}\n </stzh-link>\n }\n </div>\n </div>\n );\n }\n\n render() {\n const classes = {\n \"stzh-vbz-ticker\": true\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-vbz-ticker__text\">\n <div class=\"stzh-vbz-ticker__title\">\n <div class=\"stzh-vbz-ticker__title-parts\">\n {this.lines.length === 0 && this.counter[VBZ.DISTURBANCE_GLOBAL] === 0 &&\n <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--no-disturbances\">\n <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"checkmark-circle\"></stzh-icon>\n {this.localization.noDisturbances}\n </div>}\n\n {/* {this.counter[DISTURBANCE_GLOBAL] > 0 &&\n <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--major-events\">\n <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"important-warning\"></stzh-icon>\n {this.localization.majorEventTitle}\n </div>} */}\n\n {this.counter[VBZ.DISTURBANCE_NORMAL] > 0 &&\n <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--disturbances\">\n <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"warning\"></stzh-icon>\n {this.counter[VBZ.DISTURBANCE_GLOBAL] > 0 ?\n this.localization.furtherDisturbanceTitle : this.localization.disturbanceTitle}\n </div>}\n\n {(this.counter[VBZ.DISTURBANCE_CONSTRUCTION] > 0\n || this.counter[VBZ.DISTURBANCE_EVENT] > 0\n || this.counter[VBZ.DISTURBANCE_BUS] > 0) &&\n <div class=\"stzh-vbz-ticker__title-part stzh-vbz-ticker__title-part--others\">\n <stzh-icon class=\"stzh-vbz-ticker__icon\" name=\"construction\"></stzh-icon>\n {this.localization.constructionsTitle}\n </div>}\n </div>\n </div>\n\n {(this.lines.length > 0 || this.counter[VBZ.DISTURBANCE_GLOBAL] > 0) &&\n <Fragment>\n {/* <div class=\"stzh-vbz-ticker__description\">\n {this.counter[VBZ.DISTURBANCE_GLOBAL] > 0\n ? this.localization.globalDisturbance\n : this.localization.affectedLines}\n </div> */}\n <div class=\"stzh-vbz-ticker__chips\" role=\"list\">\n {/* {this.counter[VBZ.DISTURBANCE_GLOBAL] > 0 &&\n <div class=\"stzh-vbz-ticker__chip\" role=\"listitem\">\n <stzh-tooltip class=\"stzh-vbz-ticker__tooltip\">\n <stzh-vbz-linechip global></stzh-vbz-linechip>\n <div class=\"stzh-vbz-ticker__tooltip-content\" slot=\"content\">\n {this.globalDisturbances.map((disturbance) => this.renderDisturbance(disturbance))}\n </div>\n </stzh-tooltip>\n </div>} */}\n\n {this.lines.map((line) =>\n <div class=\"stzh-vbz-ticker__chip\" role=\"listitem\">\n <stzh-tooltip class=\"stzh-vbz-ticker__tooltip\">\n <stzh-vbz-linechip line={line.line} alert={line.alert}></stzh-vbz-linechip>\n <div class=\"stzh-vbz-ticker__tooltip-content\" slot=\"content\">\n {line.disturbances.map((disturbance) => this.renderDisturbance(disturbance))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D,EAAA,aAAWC,MAAM,wBAAwB9C,KAAK,YAC7CtD,KAAKG,QAAQG,IAAIC,oBAAsB,EACtCP,KAAKmB,aAAa8F,wBAA0BjH,KAAKmB,aAAa+F,mBAGlElH,KAAKG,QAAQG,IAAIG,0BAA4B,GAC1CT,KAAKG,QAAQG,IAAIK,mBAAqB,GACtCX,KAAKG,QAAQG,IAAIM,iBAAmB,IACvCuF,EAAA,OAAKC,MAAM,mEACTD,EAAA,aAAWC,MAAM,wBAAwB9C,KAAK,iBAC7CtD,KAAKmB,aAAagG,uBAKzBnH,KAAKE,MAAM6G,OAAS,GAAK/G,KAAKG,QAAQG,IAAIC,oBAAsB,IAChE4F,EAACiB,SAAQ,KAMPjB,EAAA,OAAKC,MAAM,yBAAyBiB,KAAK,QAWtCrH,KAAKE,MAAMuD,KAAI,SAAC2B,GACf,OAAAe,EAAA,OAAKC,MAAM,wBAAwBiB,KAAK,YACtClB,EAAA,gBAAcC,MAAM,4BAClBD,EAAA,qBAAmBf,KAAMA,EAAKA,KAAMG,MAAOH,EAAKG,QAChDY,EAAA,OAAKC,MAAM,mCAAmCkB,KAAK,WAChDlC,EAAKE,aAAa7B,KAAI,SAACyC,GAAgB,OAAA/B,EAAK8B,kBAAkBC,EAAvB,MAJ9C,OAaVC,EAAA,OAAKC,MAAM,yBACTD,EAAA,QAAM7C,KAAK,W,sVA1SG,G"}
@@ -34,6 +34,18 @@
34
34
  "parse": "^(?<H>\\d{1,2})\\.(?<i>\\d{1,2})$"
35
35
  }
36
36
  },
37
+ "$formatsIso": {
38
+ "dateInput": {
39
+ "format": "{Y}.{m}.{d}",
40
+ "parse": "^(?<Y>\\d{4}).(?<m>\\d{1,2}).(?<d>\\d{1,2})$"
41
+ }
42
+ },
43
+ "$formatsLegacy": {
44
+ "dateInput": {
45
+ "format": "{d}.{m}.{Y}",
46
+ "parse": "^(?<d>\\d{1,2}).(?<m>\\d{1,2}).(?<Y>\\d{4})$"
47
+ }
48
+ },
37
49
  "$globals": {
38
50
  "dateRange": " – ",
39
51
  "timeRange": "–",
@@ -34,6 +34,18 @@
34
34
  "parse": "^(?<H>\\d{1,2})\\.(?<i>\\d{1,2})$"
35
35
  }
36
36
  },
37
+ "$formatsIso": {
38
+ "dateInput": {
39
+ "format": "{Y}.{m}.{d}",
40
+ "parse": "^(?<Y>\\d{4}).(?<m>\\d{1,2}).(?<d>\\d{1,2})$"
41
+ }
42
+ },
43
+ "$formatsLegacy": {
44
+ "dateInput": {
45
+ "format": "{d}.{m}.{Y}",
46
+ "parse": "^(?<d>\\d{1,2}).(?<m>\\d{1,2}).(?<Y>\\d{4})$"
47
+ }
48
+ },
37
49
  "$globals": {
38
50
  "dateRange": " – ",
39
51
  "timeRange": "–",
@@ -1 +1 @@
1
- {"version":3,"names":["VBZ","BASE_TYPE_GLOBAL","CHANNEL_TICKER","CHANNEL_INFO_URL_FILTER","DISTURBANCE_GLOBAL","DISTURBANCE_INFORMATION","DISTURBANCE_CONSTRUCTION","DISTURBANCE_NORMAL","DISTURBANCE_EVENT","DISTURBANCE_BUS"],"sources":["src/index.ts"],"sourcesContent":["// ---\n// Global window types\n// ---\n\nimport { StzhLocaleAdapter } from './utils/date-adapter';\n\nimport {\n StzhLocaleComponent,\n StzhLocaleFormats,\n StzhLocaleGlobals,\n} from './utils/translation-utils';\n\nexport type WindowStzhComponents = {\n version: string\n supportedLocales: string[]\n defaultLocale: string\n translations: null | StzhLocaleComponent\n translationsLoading: Promise<StzhLocaleComponent>\n pathMedia: string\n pathTranslations: string\n cacheTranslations: boolean\n formats: StzhLocaleFormats\n labels: \"flyout\" | \"fixed\"\n utils: {\n getLocale: (element: HTMLElement) => string\n fetchTranslations: (host: HTMLElement, component: string) => Promise<StzhLocaleComponent & any>\n\n format: (date: Date, type: string) => string\n parse:(string: string, type: string) => Date\n formatSpan: (date: Date | string, date2: Date | string, type: string) => string\n parseSpan: (string: string, type: string) => [Date, Date, string]\n createFormatParseAdapter: (formats: StzhLocaleFormats, globals: StzhLocaleGlobals) => StzhLocaleAdapter\n }\n}\n\ndeclare global {\n interface Window {\n stzhComponents: WindowStzhComponents\n pannellum: any\n Dropzone: any\n // readspeaker lib APIs\n ReadSpeaker: any\n rspkr: any\n proj4: any\n }\n}\n\n// ---\n// Event Types\n// ---\n\n/* Sortable */\n\nexport type StzhSortableUpdateEvent = {\n component: \"stzh-sortable\"\n data: string[]\n item: HTMLElement\n newIndex: number\n oldIndex: number\n}\n\nexport type StzhSortableDisableEvent = {\n component: \"stzh-sortable\"\n disabled: boolean\n}\n\n/* Panorama */\n\nexport type PanoramaScene = {\n sceneId: string\n imageSrc: string\n imageTitle: string\n\n imageAuthor?: string\n imageType?: \"equirectangular\" | \"cubemap\" | \"multires\"\n caption?: string\n copyright?: string\n\n pitch?: number\n yaw?: number\n hfov?: number\n\n hotspots: PanoramaSceneHotSpot[]\n}\n\nexport type PanoramaScenesLibrary = {\n [sceneKey: string]: {\n title: string\n author: string\n panorama: string\n type?: \"equirectangular\" | \"cubemap\" | \"multires\"\n\n pitch?: number\n yaw?: number\n hfov?: number\n\n hotSpots: PanoramaSceneHotSpot[]\n }\n}\n\nexport type PanoramaSceneHotSpot = {\n pitch: number\n yaw: number\n type: string\n text: string\n url?: string\n id?: string,\n sceneId?: string\n targetPitch?: number\n targetYaw?: number\n\n cssClass?: string\n createTooltipFunc?: Function\n createTooltipArgs?: any\n}\n\nexport type StzhPanoramaLoadEvent = {\n component: \"stzh-panorama\"\n}\n\nexport type StzhPanoramaChangeEvent = {\n component: \"stzh-panorama\"\n value: { pitch: number, yaw: number, hfov: number }\n}\n\nexport type StzhPanoramaFullscreenChangeEvent = {\n component: \"stzh-panorama\"\n value: boolean\n}\n\nexport type StzhPanoramaSceneChangeEvent = {\n component: \"stzh-panorama\"\n value: string\n}\n\nexport type StzhPanoramaZoomChangeEvent = {\n component: \"stzh-panorama\"\n value: number\n}\n\n/* Iframe */\n\nexport type StzhIframeView =\n | \"iframe\"\n | \"cookiewall\"\n | \"preview\";\n\nexport type StzhIframeViewChangeEvent = {\n component: \"stzh-iframe\"\n value: StzhIframeView\n}\n\nexport type StzhIframePreviewSkipEvent = {\n component: \"stzh-iframe\"\n}\n\n/* Olmap */\n\nexport type OlmapLayer = {\n title?: string,\n thumbnailUrl: string,\n options: {\n url: string,\n layer: string,\n matrixSet: string,\n origin: number[],\n extent: number[]\n }\n}\n\nexport type StzhOlmapInitializedEvent = {\n component: \"stzh-olmap\"\n}\n\nexport type StzhOlmapPostRenderEvent = {\n component: \"stzh-olmap\"\n}\n\nexport type StzhOlmapMoveStartEvent = {\n component: \"stzh-olmap\"\n}\n\nexport type StzhOlmapMoveEndEvent = {\n component: \"stzh-olmap\"\n}\n\n/* Sticky */\n\nexport type StzhStickyStuckTopEvent = {\n component: \"stzh-sticky\"\n sticky: boolean\n}\n\nexport type StzhStickyStuckBottomEvent = {\n component: \"stzh-sticky\"\n sticky: boolean\n}\n\n/* Table */\n\nexport type StzhDatatableRowClickEvent = {\n component: \"stzh-datatable\"\n row: any\n originalEvent: MouseEvent\n}\n\nexport type StzhDatatableCellClickEvent = {\n component: \"stzh-datatable\"\n row: any\n column: any\n cellIndex: number\n rowIndex: number\n originalEvent: MouseEvent\n}\n\nexport type StzhDatatableHeadingCellClickEvent = {\n component: \"stzh-datatable\"\n column: any\n index: number\n originalEvent: MouseEvent\n}\n\nexport type StzhDatatableSortClickEvent = {\n component: \"stzh-datatable\"\n column: any\n originalEvent: MouseEvent\n}\n\nexport type StzhDatatableSortByChangeEvent = {\n component: \"stzh-datatable\"\n value: string\n oldValue: string\n}\n\nexport type StzhDatatableSortDirectionChangeEvent = {\n component: \"stzh-datatable\"\n value: \"asc\" | \"desc\"\n oldValue: \"asc\" | \"desc\"\n}\n\n/* Anchornav */\n\nexport type StzhAnchornavItem = {\n label: string\n href?: string\n icon?: string\n}\n\nexport type StzhAnchornavItemClickEvent = {\n component: \"stzh-anchornav\"\n item: StzhAnchornavItem\n originalEvent: MouseEvent\n}\n\n/* Actionset */\n\nexport type StzhActionsetItem = {\n id: string\n label?: string\n icon?: string\n iconPosition?: \"left\" | \"right\"\n iconOnly?: boolean\n badge?: string\n badgeEmpty?: boolean\n badgeType?: \"default\" | \"success\" | \"warning\" | \"error\" | \"info\"\n variant?: \"default\" | \"secondary\" | \"input\" | \"tertiary\"\n size?: \"default\" | \"small\" | \"tiny\"\n badgePosition?: \"icon\" | \"button\"\n tooltipContent?: string\n}\n\nexport type StzhActionsetItemClickEvent = {\n component: \"stzh-actionset\"\n action: StzhActionsetItem\n originalEvent: MouseEvent\n}\n\n/* Audio */\n\nexport type StzhAudioPlayEvent = {\n component: \"stzh-audio\"\n}\n\nexport type StzhAudioPlayingEvent = {\n component: \"stzh-audio\"\n}\n\nexport type StzhAudioPauseEvent = {\n component: \"stzh-audio\"\n}\n\nexport type StzhAudioReplayEvent = {\n component: \"stzh-audio\"\n}\n\nexport type StzhAudioEndEvent = {\n component: \"stzh-audio\"\n}\n\nexport type StzhAudioEndedEvent = {\n component: \"stzh-audio\"\n}\n\nexport type StzhAudioErrorEvent = {\n component: \"stzh-audio\"\n originalEvent: ErrorEvent\n}\n\n/* Share */\n\nexport type ShareService = \"facebook\" | \"twitter\" | \"linkedin\" | \"xing\" | \"mail\";\n\n/* Card */\n\nexport type StzhCardHeaderAction = {\n id: string\n label?: string\n icon?: string\n badge?: string\n badgeEmpty?: boolean\n badgeType?: \"default\" | \"success\" | \"warning\" | \"error\" | \"info\"\n onlyCollapseText?: boolean\n}\n\nexport type StzhCardSubtitleClickEvent = {\n component: \"stzh-card\"\n}\n\nexport type StzhCardCollapseEvent = {\n component: \"stzh-card\"\n collapsed: boolean\n}\n\nexport type StzhCardClickEvent = {\n component: \"stzh-card\"\n originalEvent: MouseEvent\n}\n\nexport type StzhCardStarClickEvent = {\n component: \"stzh-card\"\n starred: boolean\n}\n\nexport type StzhCardHeaderActionClickEvent = {\n component: \"stzh-card\"\n action: StzhCardHeaderAction\n}\n\n/* Microsite Teaserlist */\n\nexport type StzhMicrositeTeaserlistTag = {\n id: string\n name: string\n}\n\nexport type StzhMicrositeTeaserlistItem = {\n title?: string\n description?: string\n image?: string\n link: string\n tags: string[]\n teaserid: string\n}\n\n/* Card List */\n\nexport type StzhCardListCollapseAllEvent = {\n component: \"stzh-card-list\"\n allCollapsed: boolean\n}\n\n/* Calendar */\n\nexport type StzhCalendarChangeEvent = {\n component: \"stzh-calendar\"\n valueAsDate: Date\n value: string\n}\n\n/* Datepicker */\n\nexport type StzhDatepickerChangeEvent = {\n component: \"stzh-datepicker\"\n value: string,\n valueAsDate: Date\n}\n\n/* Pagination */\n\nexport type StzhPaginationChangeEvent = {\n component: \"stzh-pagination\"\n page: number\n}\n\n/* Timepicker */\n\nexport type StzhTimepickerChangeEvent = {\n component: \"stzh-timepicker\"\n value: string\n}\n\n/* Monthyearpicker */\n\nexport type StzhMonthyearpickerChangeEvent = {\n component: \"stzh-monthyearpicker\"\n value: string\n valueMonth: string\n valueYear: string\n}\n\n/* Amount */\n\nexport type StzhAmountChangeEvent = {\n component: \"stzh-amount\"\n value: string\n}\n\n/* Appointments */\n\nexport type StzhAppointmentsChangeEvent = {\n component: \"stzh-appointments\"\n value: string\n}\n\n/* Skiplink */\n\nexport type StzhSkiplinkFocusEvent = {\n component: \"stzh-skiplink\"\n originalEvent: FocusEvent\n}\n\nexport type StzhSkiplinkBlurEvent = {\n component: \"stzh-skiplink\"\n originalEvent: FocusEvent\n}\n\n/* Checkbox */\n\nexport type StzhCheckboxChangeEvent = {\n component: \"stzh-checkbox\"\n originalEvent: InputEvent\n value: string\n checked: boolean\n}\n\nexport type StzhCheckboxFocusEvent = {\n component: \"stzh-checkbox\"\n originalEvent: FocusEvent\n}\n\nexport type StzhCheckboxBlurEvent = {\n component: \"stzh-checkbox\"\n originalEvent: FocusEvent\n}\n\n/* Toggle */\n\nexport type StzhToggleChangeEvent = {\n component: \"stzh-toggle\"\n originalEvent: InputEvent\n value: string\n checked: boolean\n}\n\nexport type StzhToggleFocusEvent = {\n component: \"stzh-toggle\"\n originalEvent: FocusEvent\n}\n\nexport type StzhToggleBlurEvent = {\n component: \"stzh-toggle\"\n originalEvent: FocusEvent\n}\n\n/* Button */\n\nexport type StzhButtonFocusEvent = {\n component: \"stzh-button\"\n originalEvent: FocusEvent\n}\n\nexport type StzhButtonBlurEvent = {\n component: \"stzh-button\"\n originalEvent: FocusEvent\n}\n\nexport type StzhButtonChangeEvent = {\n component: \"stzh-button\"\n originalEvent: InputEvent\n value: string\n checked: boolean\n}\n\n/* Link */\n\nexport type StzhLinkFocusEvent = {\n component: \"stzh-link\"\n originalEvent: FocusEvent\n}\n\nexport type StzhLinkBlurEvent = {\n component: \"stzh-link\"\n originalEvent: FocusEvent\n}\n\n/* Menu Item */\n\nexport type StzhMenuItemFocusEvent = {\n component: \"stzh-menu-item\"\n originalEvent: FocusEvent\n}\n\nexport type StzhMenuItemBlurEvent = {\n component: \"stzh-menu-item\"\n originalEvent: FocusEvent\n}\n\n/* Carousel */\n\nexport type StzhCarouselSlideStartEvent = {\n component: \"stzh-carousel\"\n index: number\n}\n\nexport type StzhCarouselSlidePassedEvent = {\n component: \"stzh-carousel\"\n index: number\n}\n\nexport type StzhCarouselSlideEndEvent = {\n component: \"stzh-carousel\"\n index: number\n}\n\n/* Chip Select */\n\nexport type StzhChipSelectChangeEvent = {\n component: \"stzh-chip-select\"\n value: string\n}\n\n/* Gallery */\n\nexport type StzhGalleryItem = {\n width: number\n height: number\n src: string\n srcLightbox?: string\n srcsetLightbox?: string\n alt?: string\n copyright?: string\n heading?: string\n headingLightbox?: string\n caption?: string\n captionLightbox?: string\n lightboxHtml?: string\n hideCounter?: boolean\n}\n\n/* Datalist */\n\nexport type StzhDatalistItemEntry = {\n value: string\n leadingIcon?: string\n label?: string\n meta?: string\n icon?: string\n iconLabel?: string\n iconTooltip?: string\n statusLabel?: string\n statusType?: \"default\" | \"success\" | \"warning\" | \"error\" | \"info\"\n href?: string\n rel?: string\n target?: string\n items?: StzhDatalistItemEntry[]\n}\n\nexport type StzhDatalistDirectionChangeEvent = {\n component: \"stzh-datalist\"\n value: \"vertical\" | \"horizontal\"\n}\n\nexport type StzhDatalistHideBorderChangeEvent = {\n component: \"stzh-datalist\"\n value: boolean\n}\n\n/* Datalist Item */\n\nexport type StzhDatalistItemActionClickEvent = {\n component: \"stzh-datalist-item\"\n originalEvent: MouseEvent\n}\n\n/* Datamessagelist */\n\nexport type StzhDatamessagelistItemEntryMeta = {\n label: string\n value: string\n}\n\nexport type StzhDatamessagelistItemEntryAction = {\n id: string | number\n icon: string\n label: string,\n badge?: string\n}\n\nexport type StzhDatamessagelistItemEntryTag = {\n icon: string\n label: string\n type: \"default\" | \"important\"\n}\n\nexport type StzhDatamessagelistItemEntryLoadingStatus = {\n percent: number\n label: string\n type: \"default\" | \"success\" | \"warning\" | \"error\"\n}\n\nexport type StzhDatamessagelistItemClickEvent = {\n component: \"stzh-datamessagelist-item\",\n originalEvent: MouseEvent\n}\n\nexport type StzhDatamessagelistItemActionClickEvent = {\n component: \"stzh-datamessagelist-item\",\n action: StzhDatamessagelistItemEntryAction,\n originalEvent: MouseEvent\n}\n\n/* Chip */\n\nexport type StzhChipSelectItem = {\n label: string\n value: string\n disabled?: boolean\n variant?: \"tag\" | \"filter\" | \"input\"\n type?: \"default\" | \"secondary\"\n counter?: string\n icon?: string\n size?: \"default\" | \"small\"\n}\n\nexport type StzhChipClickEvent = {\n component: \"stzh-chip\",\n originalEvent: MouseEvent\n}\n\nexport type StzhChipRemoveEvent = {\n component: \"stzh-chip\",\n originalEvent: MouseEvent\n}\n\nexport type StzhChipFocusEvent = {\n component: \"stzh-chip\"\n originalEvent: FocusEvent\n}\n\nexport type StzhChipBlurEvent = {\n component: \"stzh-chip\"\n originalEvent: FocusEvent\n}\n\n/* VBZ Major Ticker */\n\nexport type StzhVbzMajortickerDisturbance = {\n id: string\n head: string\n text: string\n startDate: Date\n endDate: Date\n altStart: string\n altEnd: string\n infoUrl?: VbzTickerInfoUrl\n};\n\nexport type StzhVbzMajortickerDisturbanceFetchedEvent = {\n component: \"stzh-vbz-majorticker\"\n disturbance: StzhVbzMajortickerDisturbance | null\n}\n\n/* VBZ Ticker */\n\nexport type VbzTickerInfoUrl = {\n name: string\n url: string\n};\n\nexport type VbzTickerDisturbance = {\n id: string\n head: string\n startDate: Date\n endDate: Date\n altStart: string\n altEnd: string\n baseType?: string\n infoUrl?: VbzTickerInfoUrl\n category:\n | typeof VBZ.DISTURBANCE_INFORMATION\n | typeof VBZ.DISTURBANCE_CONSTRUCTION\n | typeof VBZ.DISTURBANCE_NORMAL\n | typeof VBZ.DISTURBANCE_EVENT\n | typeof VBZ.DISTURBANCE_BUS\n};\n\nexport type VbzTickerLine = {\n line: VBZ.Lines\n name: string\n disturbances: VbzTickerDisturbance[]\n // whether normal or big disturbance for this line exist\n alert: boolean\n // 2 = Fernverkehr / 16 = Schiff / 32 = S-Bahn/Reg / 64 = Bus / 128 = Bergbahn / 256 = Nachtnetz / 512 = Tram\n category: \"2\" | \"16\" | \"32\" | \"64\" | \"128\" | \"256\" | \"512\"\n};\n\n/* VBZ Line Chip */\n\nexport type StzhVbzLinechipLine = {\n color: string\n background: string\n comment?: string\n}\n\nexport type StzhVbzLinechipFocusEvent = {\n component: \"stzh-vbz-linechip\"\n originalEvent: FocusEvent\n}\n\nexport type StzhVbzLinechipBlurEvent = {\n component: \"stzh-vbz-linechip\"\n originalEvent: FocusEvent\n}\n\n/* Clamp */\n\nexport type StzhClampClampEvent = {\n component: \"stzh-clamp\"\n clamped: boolean\n}\n\nexport type StzhClampExpandEvent = {\n component: \"stzh-clamp\"\n expanded: boolean\n}\n\n/* Image Comparison */\n\nexport type StzhImagecomparisonChangeEvent = {\n component: \"stzh-imagecomparison\"\n originalEvent: InputEvent\n value: number\n}\n\n/* Dialog */\n\nexport type StzhDialogOpenEvent = {\n component: \"stzh-dialog\"\n}\n\nexport type StzhDialogCloseEvent = {\n component: \"stzh-dialog\"\n}\n\n/* Contact */\n\nexport type ContactNumber = {\n type: \"tel\" | \"fax\"\n label: string\n number: string\n analyticsId?: string\n}\n\nexport type StzhContactAvailabilityItem = {\n weekday: string\n hours: string[]\n}\n\n/* Overlay */\n\nexport type StzhOverlayOpenEvent = {\n component: \"stzh-overlay\"\n}\n\nexport type StzhOverlayCloseEvent = {\n component: \"stzh-overlay\"\n}\n\n/* Message */\n\nexport type StzhMessageOpenEvent = {\n component: \"stzh-message\"\n}\n\nexport type StzhMessageCloseEvent = {\n component: \"stzh-message\"\n}\n\n/* Toastbar */\n\nexport type StzhToastbarInitialToast = {\n label: string\n type?: StzhToastType\n link?: HTMLStzhLinkElement | {\n href: string,\n label: string\n },\n cookie?: string\n cookieExpires?: number\n}\n\n/* Toast */\n\nexport type StzhToastType = \"info\" | \"success\" | \"warning\" | \"error\";\n\nexport type StzhToastOpenEvent = {\n component: \"stzh-toast\"\n}\n\nexport type StzhToastCloseEvent = {\n component: \"stzh-toast\"\n}\n\nexport type StzhToastOpenedEvent = {\n component: \"stzh-toast\"\n}\n\nexport type StzhToastClosedEvent = {\n component: \"stzh-toast\"\n}\n\n/* Ghettobox */\n\nexport type StzhGhettoboxOpenEvent = {\n component: \"stzh-ghettobox\"\n}\n\nexport type StzhGhettoboxCloseEvent = {\n component: \"stzh-ghettobox\"\n}\n\n/* Input */\n\nexport type StzhInputChangeEvent = {\n component: \"stzh-input\"\n originalEvent: InputEvent | MouseEvent\n value: string\n}\n\nexport type StzhInputChangedEvent = {\n component: \"stzh-input\"\n originalEvent: InputEvent | MouseEvent\n value: string\n}\n\nexport type StzhInputFocusEvent = {\n component: \"stzh-input\"\n originalEvent: FocusEvent\n}\n\nexport type StzhInputBlurEvent = {\n component: \"stzh-input\"\n originalEvent: FocusEvent\n}\n\n/* Popover */\n\nexport type StzhPopoverOpenEvent = {\n component: \"stzh-popover\"\n}\n\nexport type StzhPopoverOpenedEvent = {\n component: \"stzh-popover\"\n}\n\nexport type StzhPopoverCloseEvent = {\n component: \"stzh-popover\"\n}\n\nexport type StzhPopoverClosedEvent = {\n component: \"stzh-popover\"\n}\n\n/* Timeline */\n\nexport type StzhTimelineFoldableChangeEvent = {\n component: \"stzh-timeline\"\n value: boolean\n}\n\n/* TimelineItem */\n\nexport type StzhTimelineItemOpenEvent = {\n component: \"stzh-timeline-item\"\n}\n\nexport type StzhTimelineItemOpenedEvent = {\n component: \"stzh-timeline-item\"\n}\n\nexport type StzhTimelineItemCloseEvent = {\n component: \"stzh-timeline-item\"\n}\n\nexport type StzhTimelineItemClosedEvent = {\n component: \"stzh-timeline-item\"\n}\n\nexport type StzhTimelineItemFocusEvent = {\n component: \"stzh-timeline-item\"\n originalEvent: FocusEvent\n}\n\nexport type StzhTimelineItemBlurEvent = {\n component: \"stzh-timeline-item\"\n originalEvent: FocusEvent\n}\n\n/* Accordion */\n\nexport type StzhAccordionItemOpenEvent = {\n component: \"stzh-accordion-item\"\n}\n\nexport type StzhAccordionItemOpenedEvent = {\n component: \"stzh-accordion-item\"\n}\n\nexport type StzhAccordionItemCloseEvent = {\n component: \"stzh-accordion-item\"\n}\n\nexport type StzhAccordionItemClosedEvent = {\n component: \"stzh-accordion-item\"\n}\n\nexport type StzhAccordionItemFocusEvent = {\n component: \"stzh-accordion-item\"\n originalEvent: FocusEvent\n}\n\nexport type StzhAccordionItemBlurEvent = {\n component: \"stzh-accordion-item\"\n originalEvent: FocusEvent\n}\n\n/* Tooltip */\n\nexport type StzhTooltipOpenEvent = {\n component: \"stzh-tooltip\"\n}\n\nexport type StzhTooltipOpenedEvent = {\n component: \"stzh-tooltip\"\n}\n\nexport type StzhTooltipCloseEvent = {\n component: \"stzh-tooltip\"\n}\n\nexport type StzhTooltipClosedEvent = {\n component: \"stzh-tooltip\"\n}\n\n/* Radio */\n\nexport type StzhRadioChangeEvent = {\n component: \"stzh-radio\"\n originalEvent: InputEvent\n value: string\n checked: boolean\n}\n\nexport type StzhRadioFocusEvent = {\n component: \"stzh-radio\"\n originalEvent: FocusEvent\n}\n\nexport type StzhRadioBlurEvent = {\n component: \"stzh-radio\"\n originalEvent: FocusEvent\n}\n\n/* Langnav */\n\nexport type StzhLangnavChangeEvent = {\n component: \"stzh-langnav\",\n value: string\n}\n\n/* Dropdown */\n\nexport type StzhDropdownOption = {\n text: string,\n value: string\n}\n\nexport type StzhDropdownChangeEvent = {\n component: \"stzh-dropdown\",\n value: string\n}\n\nexport type StzhDropdownItemAddEvent = {\n component: \"stzh-dropdown\",\n value: string\n}\n\nexport type StzhDropdownItemRemoveEvent = {\n component: \"stzh-dropdown\",\n value: string\n}\n\nexport type StzhDropdownOptionAddEvent = {\n component: \"stzh-dropdown\",\n value: string\n}\n\nexport type StzhDropdownOptionRemoveEvent = {\n component: \"stzh-dropdown\",\n value: string\n}\n\nexport type StzhDropdownOpenEvent = {\n component: \"stzh-dropdown\"\n}\n\nexport type StzhDropdowCloseEvent = {\n component: \"stzh-dropdown\"\n}\n\nexport type StzhDropdownFocusEvent = {\n component: \"stzh-dropdown\"\n originalEvent: {\n target: Element\n }\n}\n\nexport type StzhDropdownBlurEvent = {\n component: \"stzh-dropdown\"\n}\n\nexport type StzhDropdowInitEvent = {\n component: \"stzh-dropdown\"\n}\n\n/** Progressbar */\n\nexport type StzhProgressbarDataItem = {\n label: string\n icon?: string\n disabled?: boolean\n analyticsId?: string\n}\n\n/* Progressbar Item */\n\nexport type StzhProgressbarItemClickEvent = {\n component: \"stzh-progressbar-item\",\n originalEvent: MouseEvent,\n index: number\n}\n\nexport type StzhProgressbarItemDottedClickEvent = {\n component: \"stzh-progressbar-item\",\n originalEvent: MouseEvent\n}\n\n/* Upload */\n\nexport type StzhUploadFilesItem = {\n name: string\n size: number\n [key: string]: any\n}\n\nexport type StzhUploadFile = File & {\n xhr: XMLHttpRequest,\n status: string\n upload: any\n accepted: boolean\n previewElement: HTMLElement\n}\n\nexport type StzhUploadFileAddedEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile\n}\n\nexport type StzhUploadFilesAddedEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[]\n}\n\nexport type StzhUploadFileRemoveEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile\n}\n\nexport type StzhUploadFileRemovedEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile\n force: boolean\n}\n\nexport type StzhUploadSendingEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile,\n xhr: XMLHttpRequest,\n formData: FormData\n}\n\nexport type StzhUploadSendingMultipleEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[],\n xhr: XMLHttpRequest,\n formData: FormData\n}\n\nexport type StzhUploadProcessingEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile\n}\n\nexport type StzhUploadProcessingMultipleEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[]\n}\n\nexport type StzhUploadProgressEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile,\n progress: number,\n bytesSent: number\n}\n\nexport type StzhUploadProgressTotalEvent = {\n component: \"stzh-upload\",\n totalUploadProgress: number,\n totalBytes: number,\n totalBytesSent: number\n}\n\nexport type StzhUploadErrorEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile,\n message: string,\n xhr: XMLHttpRequest\n}\n\nexport type StzhUploadErrorMultipleEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[],\n message: string,\n xhr: XMLHttpRequest\n}\n\nexport type StzhUploadSuccessEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile,\n responseText: string,\n event: ProgressEvent\n}\n\nexport type StzhUploadSuccessMultipleEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[],\n responseText: string,\n event: ProgressEvent\n}\n\nexport type StzhUploadCanceledEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile\n}\n\nexport type StzhUploadCanceledMultipleEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[]\n}\n\nexport type StzhUploadCompleteEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile\n}\n\nexport type StzhUploadCompleteMultipleEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[]\n}\n\n// Merged Types\n\nexport type StzhFocusEvent =\n | StzhAccordionItemFocusEvent\n | StzhButtonFocusEvent\n | StzhCheckboxFocusEvent\n | StzhChipFocusEvent\n | StzhDropdownFocusEvent\n | StzhInputFocusEvent\n | StzhLinkFocusEvent\n | StzhMenuItemFocusEvent\n | StzhRadioFocusEvent\n | StzhToggleFocusEvent\n | StzhVbzLinechipFocusEvent\n | StzhSkiplinkFocusEvent\n\n// ---\n// Prop Types\n// ---\n\nexport type StzhCalendarDateDisabledPredicate = (date: Date) => boolean\n\n\nexport namespace Layout {\n export type Ratio = \"16:9\" | \"1:1\" | \"5:4\" | \"4:3\" | \"3:2\" | \"2:1\" | \"21:9\";\n\n export type Justify =\n | \"start\"\n | \"end\"\n | \"center\"\n | \"between\"\n | \"around\"\n | \"evenly\";\n\n export type Items =\n | \"start\"\n | \"end\"\n | \"center\"\n | \"baseline\"\n | \"stretch\";\n\n export type JustifySelf =\n | \"auto\"\n | Justify;\n\n export type AlignSelf =\n | \"auto\"\n | Items;\n}\n\nexport namespace Space {\n export type Sizes =\n | \"xxxsmall\"\n | \"xxsmall\"\n | \"xsmall\"\n | \"small\"\n | \"medium\"\n | \"large\"\n | \"xlarge\"\n | \"xxlarge\"\n | \"xxxlarge\"\n | \"xxxxlarge\"\n | \"big\"\n | \"xbig\"\n | \"huge\"\n | \"xhuge\"\n | \"none\"\n | \"inherit\";\n\n export type Curves =\n | \"tiny\"\n | \"small\"\n | \"regular\"\n | \"medium\"\n | \"large\"\n | \"big\"\n | \"huge\"\n | \"none\";\n}\n\nexport namespace Font {\n export type Fonts =\n | \"light\"\n | \"regular\"\n | \"medium\"\n | \"heavy\"\n | \"default\";\n\n export type Sizes =\n | \"pico\"\n | \"nano\"\n | \"micro\"\n | \"milli\"\n | \"centi\"\n | \"deci\"\n | \"regular\"\n | \"deca\"\n | \"hecto\"\n | \"kilo\"\n | \"mega\"\n | \"giga\"\n | \"hero\"\n | \"inherit\";\n\n export type Curves =\n | \"p1\"\n | \"p2\"\n | \"caption\"\n | \"h4\"\n | \"h3\"\n | \"h2\"\n | \"h1\"\n | \"hero\"\n | \"default\"\n | \"none\";\n}\n\nexport namespace VBZ {\n export const BASE_TYPE_GLOBAL = \"GLOBAL\";\n\n export const CHANNEL_TICKER = \"ticker\";\n export const CHANNEL_INFO_URL_FILTER = \"stadt-zuerich.ch/vbz\";\n\n export const DISTURBANCE_GLOBAL = \"__global__\";\n export const DISTURBANCE_INFORMATION = \"0\";\n export const DISTURBANCE_CONSTRUCTION = \"1\";\n export const DISTURBANCE_NORMAL = \"2\";\n export const DISTURBANCE_EVENT = \"4\";\n export const DISTURBANCE_BUS = \"5\";\n\n export type Lines =\n | \"2\"\n | \"3\"\n | \"4\"\n | \"5\"\n | \"6\"\n | \"7\"\n | \"8\"\n | \"9\"\n | \"10\"\n | \"11\"\n | \"12\"\n | \"13\"\n | \"14\"\n | \"15\"\n | \"16\"\n | \"17\"\n | \"19\"\n | \"20\"\n | \"21\"\n | \"23\"\n | \"24\"\n | \"25\"\n | \"29\"\n | \"31\"\n | \"32\"\n | \"33\"\n | \"34\"\n | \"35\"\n | \"36\"\n | \"37\"\n | \"38\"\n | \"39\"\n | \"40\"\n | \"45\"\n | \"46\"\n | \"54\"\n | \"61\"\n | \"62\"\n | \"63\"\n | \"64\"\n | \"66\"\n | \"67\"\n | \"69\"\n | \"70\"\n | \"72\"\n | \"73\"\n | \"75\"\n | \"76\"\n | \"77\"\n | \"78\"\n | \"79\"\n | \"80\"\n | \"83\"\n | \"89\"\n | \"91\"\n | \"94\"\n | \"95\"\n | \"99\"\n | \"151\"\n | \"152\"\n | \"153\"\n | \"156\"\n | \"161\"\n | \"162\"\n | \"163\"\n | \"165\"\n | \"184\"\n | \"185\"\n | \"200\"\n | \"201\"\n | \"215\"\n | \"220\"\n | \"235\"\n | \"236\"\n | \"245\"\n | \"301\"\n | \"302\"\n | \"303\"\n | \"304\"\n | \"305\"\n | \"306\"\n | \"307\"\n | \"308\"\n | \"309\"\n | \"311\"\n | \"314\"\n | \"315\"\n | \"317\"\n | \"321\"\n | \"323\"\n | \"325\"\n | \"350\"\n | \"444\"\n | \"445\"\n | \"701\"\n | \"702\"\n | \"703\"\n | \"704\"\n | \"705\"\n | \"720\"\n | \"721\"\n | \"725\"\n | \"726\"\n | \"727\"\n | \"742\"\n | \"743\"\n | \"744\"\n | \"745\"\n | \"747\"\n | \"748\"\n | \"751\"\n | \"752\"\n | \"753\"\n | \"754\"\n | \"759\"\n | \"760\"\n | \"765\"\n | \"768\"\n | \"781\"\n | \"786\"\n | \"787\"\n | \"910\"\n | \"912\"\n | \"916\"\n | \"917\"\n | \"918\"\n | \"919\"\n | \"E\"\n | \"N\"\n | \"N1\"\n | \"N2\"\n | \"N4\"\n | \"N5\"\n | \"N6\"\n | \"N7\"\n | \"N8\"\n | \"N9\"\n | \"N10\"\n | \"N11\"\n | \"N12\"\n | \"N13\"\n | \"N14\"\n | \"N15\"\n | \"N16\"\n | \"N17\"\n | \"N18\"\n | \"N19\"\n | \"N30\"\n | \"N31\"\n | \"N32\"\n | \"N33\"\n | \"N34\"\n | \"N45\"\n | \"N72\"\n | \"N78\"\n | \"SN1\"\n | \"SN4\"\n | \"SN5\"\n | \"SN6\"\n | \"SN7\"\n | \"SN8\"\n | \"SN9\"\n | \"S2\"\n | \"S3\"\n | \"S4\"\n | \"S5\"\n | \"S6\"\n | \"S7\"\n | \"S8\"\n | \"S9\"\n | \"S10\"\n | \"S11\"\n | \"S14\"\n | \"S15\"\n | \"S16\"\n | \"S18\"\n | \"S19\"\n | \"S20\"\n | \"S21\"\n | \"S23\"\n | \"S24\"\n | \"S25\"\n}\n\n// ---\n// Stencil component types\n// ---\n\nexport * from './components';\n"],"mappings":"IA2xCiBA,GAAjB,SAAiBA,GACFA,EAAAC,iBAAmB,SAEnBD,EAAAE,eAAiB,SACjBF,EAAAG,wBAA0B,uBAE1BH,EAAAI,mBAAqB,aACrBJ,EAAAK,wBAA0B,IAC1BL,EAAAM,yBAA2B,IAC3BN,EAAAO,mBAAqB,IACrBP,EAAAQ,kBAAoB,IACpBR,EAAAS,gBAAkB,GAyLhC,EApMD,CAAiBT,MAAG,Y"}
1
+ {"version":3,"names":["VBZ","BASE_TYPE_GLOBAL","CHANNEL_TICKER","CHANNEL_INFO_URL_FILTER","DISTURBANCE_GLOBAL","DISTURBANCE_INFORMATION","DISTURBANCE_CONSTRUCTION","DISTURBANCE_NORMAL","DISTURBANCE_EVENT","DISTURBANCE_BUS"],"sources":["src/index.ts"],"sourcesContent":["// ---\n// Global window types\n// ---\n\nimport { StzhLocaleAdapter } from './utils/date-adapter';\n\nimport {\n StzhLocaleComponent,\n StzhLocaleFormats,\n StzhLocaleGlobals,\n} from './utils/translation-utils';\n\nexport type WindowStzhComponents = {\n version: string\n supportedLocales: string[]\n defaultLocale: string\n translations: null | StzhLocaleComponent\n translationsLoading: Promise<StzhLocaleComponent>\n pathMedia: string\n pathTranslations: string\n cacheTranslations: boolean\n formats: StzhLocaleFormats\n labels: \"flyout\" | \"fixed\"\n utils: {\n getLocale: (element: HTMLElement) => string\n fetchTranslations: (host: HTMLElement, component: string) => Promise<StzhLocaleComponent & any>\n\n format: (date: Date, type: string) => string\n parse:(string: string, type: string) => Date\n formatSpan: (date: Date | string, date2: Date | string, type: string) => string\n parseSpan: (string: string, type: string) => [Date, Date, string]\n createFormatParseAdapter: (formats: StzhLocaleFormats, globals: StzhLocaleGlobals) => StzhLocaleAdapter\n }\n}\n\ndeclare global {\n interface Window {\n stzhComponents: WindowStzhComponents\n pannellum: any\n Dropzone: any\n // readspeaker lib APIs\n ReadSpeaker: any\n rspkr: any\n proj4: any\n }\n}\n\n// ---\n// Event Types\n// ---\n\n/* Sortable */\n\nexport type StzhSortableUpdateEvent = {\n component: \"stzh-sortable\"\n data: string[]\n item: HTMLElement\n newIndex: number\n oldIndex: number\n}\n\nexport type StzhSortableDisableEvent = {\n component: \"stzh-sortable\"\n disabled: boolean\n}\n\n/* Panorama */\n\nexport type PanoramaScene = {\n sceneId: string\n imageSrc: string\n imageTitle: string\n\n imageAuthor?: string\n imageType?: \"equirectangular\" | \"cubemap\" | \"multires\"\n caption?: string\n copyright?: string\n\n pitch?: number\n yaw?: number\n hfov?: number\n\n hotspots: PanoramaSceneHotSpot[]\n}\n\nexport type PanoramaScenesLibrary = {\n [sceneKey: string]: {\n title: string\n author: string\n panorama: string\n type?: \"equirectangular\" | \"cubemap\" | \"multires\"\n\n pitch?: number\n yaw?: number\n hfov?: number\n\n hotSpots: PanoramaSceneHotSpot[]\n }\n}\n\nexport type PanoramaSceneHotSpot = {\n pitch: number\n yaw: number\n type: string\n text: string\n url?: string\n id?: string,\n sceneId?: string\n targetPitch?: number\n targetYaw?: number\n\n cssClass?: string\n createTooltipFunc?: Function\n createTooltipArgs?: any\n}\n\nexport type StzhPanoramaLoadEvent = {\n component: \"stzh-panorama\"\n}\n\nexport type StzhPanoramaChangeEvent = {\n component: \"stzh-panorama\"\n value: { pitch: number, yaw: number, hfov: number }\n}\n\nexport type StzhPanoramaFullscreenChangeEvent = {\n component: \"stzh-panorama\"\n value: boolean\n}\n\nexport type StzhPanoramaSceneChangeEvent = {\n component: \"stzh-panorama\"\n value: string\n}\n\nexport type StzhPanoramaZoomChangeEvent = {\n component: \"stzh-panorama\"\n value: number\n}\n\n/* Iframe */\n\nexport type StzhIframeView =\n | \"iframe\"\n | \"cookiewall\"\n | \"preview\";\n\nexport type StzhIframeViewChangeEvent = {\n component: \"stzh-iframe\"\n value: StzhIframeView\n}\n\nexport type StzhIframePreviewSkipEvent = {\n component: \"stzh-iframe\"\n}\n\n/* Olmap */\n\nexport type OlmapLayer = {\n title?: string,\n thumbnailUrl: string,\n options: {\n url: string,\n layer: string,\n matrixSet: string,\n origin: number[],\n extent: number[]\n }\n}\n\nexport type StzhOlmapInitializedEvent = {\n component: \"stzh-olmap\"\n}\n\nexport type StzhOlmapPostRenderEvent = {\n component: \"stzh-olmap\"\n}\n\nexport type StzhOlmapMoveStartEvent = {\n component: \"stzh-olmap\"\n}\n\nexport type StzhOlmapMoveEndEvent = {\n component: \"stzh-olmap\"\n}\n\n/* Sticky */\n\nexport type StzhStickyStuckTopEvent = {\n component: \"stzh-sticky\"\n sticky: boolean\n}\n\nexport type StzhStickyStuckBottomEvent = {\n component: \"stzh-sticky\"\n sticky: boolean\n}\n\n/* Table */\n\nexport type StzhDatatableRowClickEvent = {\n component: \"stzh-datatable\"\n row: any\n originalEvent: MouseEvent\n}\n\nexport type StzhDatatableCellClickEvent = {\n component: \"stzh-datatable\"\n row: any\n column: any\n cellIndex: number\n rowIndex: number\n originalEvent: MouseEvent\n}\n\nexport type StzhDatatableHeadingCellClickEvent = {\n component: \"stzh-datatable\"\n column: any\n index: number\n originalEvent: MouseEvent\n}\n\nexport type StzhDatatableSortClickEvent = {\n component: \"stzh-datatable\"\n column: any\n originalEvent: MouseEvent\n}\n\nexport type StzhDatatableSortByChangeEvent = {\n component: \"stzh-datatable\"\n value: string\n oldValue: string\n}\n\nexport type StzhDatatableSortDirectionChangeEvent = {\n component: \"stzh-datatable\"\n value: \"asc\" | \"desc\"\n oldValue: \"asc\" | \"desc\"\n}\n\n/* Anchornav */\n\nexport type StzhAnchornavItem = {\n label: string\n href?: string\n icon?: string\n}\n\nexport type StzhAnchornavItemClickEvent = {\n component: \"stzh-anchornav\"\n item: StzhAnchornavItem\n originalEvent: MouseEvent\n}\n\n/* Actionset */\n\nexport type StzhActionsetItem = {\n id: string\n label?: string\n icon?: string\n iconPosition?: \"left\" | \"right\"\n iconOnly?: boolean\n badge?: string\n badgeEmpty?: boolean\n badgeType?: \"default\" | \"success\" | \"warning\" | \"error\" | \"info\"\n variant?: \"default\" | \"secondary\" | \"input\" | \"tertiary\"\n size?: \"default\" | \"small\" | \"tiny\"\n badgePosition?: \"icon\" | \"button\"\n tooltipContent?: string\n}\n\nexport type StzhActionsetItemClickEvent = {\n component: \"stzh-actionset\"\n action: StzhActionsetItem\n originalEvent: MouseEvent\n}\n\n/* Audio */\n\nexport type StzhAudioPlayEvent = {\n component: \"stzh-audio\"\n}\n\nexport type StzhAudioPlayingEvent = {\n component: \"stzh-audio\"\n}\n\nexport type StzhAudioPauseEvent = {\n component: \"stzh-audio\"\n}\n\nexport type StzhAudioReplayEvent = {\n component: \"stzh-audio\"\n}\n\nexport type StzhAudioEndEvent = {\n component: \"stzh-audio\"\n}\n\nexport type StzhAudioEndedEvent = {\n component: \"stzh-audio\"\n}\n\nexport type StzhAudioErrorEvent = {\n component: \"stzh-audio\"\n originalEvent: ErrorEvent\n}\n\n/* Share */\n\nexport type ShareService = \"facebook\" | \"twitter\" | \"linkedin\" | \"xing\" | \"mail\";\n\n/* Card */\n\nexport type StzhCardHeaderAction = {\n id: string\n label?: string\n icon?: string\n badge?: string\n badgeEmpty?: boolean\n badgeType?: \"default\" | \"success\" | \"warning\" | \"error\" | \"info\"\n onlyCollapseText?: boolean\n}\n\nexport type StzhCardSubtitleClickEvent = {\n component: \"stzh-card\"\n}\n\nexport type StzhCardCollapseEvent = {\n component: \"stzh-card\"\n collapsed: boolean\n}\n\nexport type StzhCardClickEvent = {\n component: \"stzh-card\"\n originalEvent: MouseEvent\n}\n\nexport type StzhCardStarClickEvent = {\n component: \"stzh-card\"\n starred: boolean\n}\n\nexport type StzhCardHeaderActionClickEvent = {\n component: \"stzh-card\"\n action: StzhCardHeaderAction\n}\n\n/* Microsite Teaserlist */\n\nexport type StzhMicrositeTeaserlistTag = {\n id: string\n name: string\n}\n\nexport type StzhMicrositeTeaserlistItem = {\n title?: string\n description?: string\n image?: string\n link: string\n tags: string[]\n teaserid: string\n}\n\n/* Card List */\n\nexport type StzhCardListCollapseAllEvent = {\n component: \"stzh-card-list\"\n allCollapsed: boolean\n}\n\n/* Calendar */\n\nexport type StzhCalendarChangeEvent = {\n component: \"stzh-calendar\"\n valueAsDate: Date\n value: string\n}\n\n/* Datepicker */\n\nexport type StzhDatepickerChangeEvent = {\n component: \"stzh-datepicker\"\n value: string,\n valueAsDate: Date\n}\n\n/* Pagination */\n\nexport type StzhPaginationChangeEvent = {\n component: \"stzh-pagination\"\n page: number\n}\n\n/* Timepicker */\n\nexport type StzhTimepickerChangeEvent = {\n component: \"stzh-timepicker\"\n value: string\n}\n\n/* Monthyearpicker */\n\nexport type StzhMonthyearpickerChangeEvent = {\n component: \"stzh-monthyearpicker\"\n value: string\n valueMonth: string\n valueYear: string\n}\n\n/* Amount */\n\nexport type StzhAmountChangeEvent = {\n component: \"stzh-amount\"\n value: string\n}\n\n/* Appointments */\n\nexport type StzhAppointmentsChangeEvent = {\n component: \"stzh-appointments\"\n value: string\n}\n\n/* Skiplink */\n\nexport type StzhSkiplinkFocusEvent = {\n component: \"stzh-skiplink\"\n originalEvent: FocusEvent\n}\n\nexport type StzhSkiplinkBlurEvent = {\n component: \"stzh-skiplink\"\n originalEvent: FocusEvent\n}\n\n/* Checkbox */\n\nexport type StzhCheckboxChangeEvent = {\n component: \"stzh-checkbox\"\n originalEvent: InputEvent\n value: string\n checked: boolean\n}\n\nexport type StzhCheckboxFocusEvent = {\n component: \"stzh-checkbox\"\n originalEvent: FocusEvent\n}\n\nexport type StzhCheckboxBlurEvent = {\n component: \"stzh-checkbox\"\n originalEvent: FocusEvent\n}\n\n/* Toggle */\n\nexport type StzhToggleChangeEvent = {\n component: \"stzh-toggle\"\n originalEvent: InputEvent\n value: string\n checked: boolean\n}\n\nexport type StzhToggleFocusEvent = {\n component: \"stzh-toggle\"\n originalEvent: FocusEvent\n}\n\nexport type StzhToggleBlurEvent = {\n component: \"stzh-toggle\"\n originalEvent: FocusEvent\n}\n\n/* Button */\n\nexport type StzhButtonFocusEvent = {\n component: \"stzh-button\"\n originalEvent: FocusEvent\n}\n\nexport type StzhButtonBlurEvent = {\n component: \"stzh-button\"\n originalEvent: FocusEvent\n}\n\nexport type StzhButtonChangeEvent = {\n component: \"stzh-button\"\n originalEvent: InputEvent\n value: string\n checked: boolean\n}\n\n/* Link */\n\nexport type StzhLinkFocusEvent = {\n component: \"stzh-link\"\n originalEvent: FocusEvent\n}\n\nexport type StzhLinkBlurEvent = {\n component: \"stzh-link\"\n originalEvent: FocusEvent\n}\n\n/* Menu Item */\n\nexport type StzhMenuItemFocusEvent = {\n component: \"stzh-menu-item\"\n originalEvent: FocusEvent\n}\n\nexport type StzhMenuItemBlurEvent = {\n component: \"stzh-menu-item\"\n originalEvent: FocusEvent\n}\n\n/* Carousel */\n\nexport type StzhCarouselSlideStartEvent = {\n component: \"stzh-carousel\"\n index: number\n}\n\nexport type StzhCarouselSlidePassedEvent = {\n component: \"stzh-carousel\"\n index: number\n}\n\nexport type StzhCarouselSlideEndEvent = {\n component: \"stzh-carousel\"\n index: number\n}\n\n/* Chip Select */\n\nexport type StzhChipSelectChangeEvent = {\n component: \"stzh-chip-select\"\n value: string\n}\n\n/* Gallery */\n\nexport type StzhGalleryItem = {\n width: number\n height: number\n src: string\n srcLightbox?: string\n srcsetLightbox?: string\n alt?: string\n copyright?: string\n heading?: string\n headingLightbox?: string\n caption?: string\n captionLightbox?: string\n lightboxHtml?: string\n hideCounter?: boolean\n}\n\n/* Datalist */\n\nexport type StzhDatalistItemEntry = {\n value: string\n leadingIcon?: string\n label?: string\n meta?: string\n icon?: string\n iconLabel?: string\n iconTooltip?: string\n statusLabel?: string\n statusType?: \"default\" | \"success\" | \"warning\" | \"error\" | \"info\"\n href?: string\n rel?: string\n target?: string\n items?: StzhDatalistItemEntry[]\n}\n\nexport type StzhDatalistDirectionChangeEvent = {\n component: \"stzh-datalist\"\n value: \"vertical\" | \"horizontal\"\n}\n\nexport type StzhDatalistHideBorderChangeEvent = {\n component: \"stzh-datalist\"\n value: boolean\n}\n\n/* Datalist Item */\n\nexport type StzhDatalistItemActionClickEvent = {\n component: \"stzh-datalist-item\"\n originalEvent: MouseEvent\n}\n\n/* Datamessagelist */\n\nexport type StzhDatamessagelistItemEntryMeta = {\n label: string\n value: string\n}\n\nexport type StzhDatamessagelistItemEntryAction = {\n id: string | number\n icon: string\n label: string,\n badge?: string\n}\n\nexport type StzhDatamessagelistItemEntryTag = {\n icon: string\n label: string\n type: \"default\" | \"important\"\n}\n\nexport type StzhDatamessagelistItemEntryLoadingStatus = {\n percent: number\n label: string\n type: \"default\" | \"success\" | \"warning\" | \"error\"\n}\n\nexport type StzhDatamessagelistItemClickEvent = {\n component: \"stzh-datamessagelist-item\",\n originalEvent: MouseEvent\n}\n\nexport type StzhDatamessagelistItemActionClickEvent = {\n component: \"stzh-datamessagelist-item\",\n action: StzhDatamessagelistItemEntryAction,\n originalEvent: MouseEvent\n}\n\n/* Chip */\n\nexport type StzhChipSelectItem = {\n label: string\n value: string\n disabled?: boolean\n variant?: \"tag\" | \"filter\" | \"input\"\n type?: \"default\" | \"secondary\"\n counter?: string\n icon?: string\n size?: \"default\" | \"small\"\n}\n\nexport type StzhChipClickEvent = {\n component: \"stzh-chip\",\n originalEvent: MouseEvent\n}\n\nexport type StzhChipRemoveEvent = {\n component: \"stzh-chip\",\n originalEvent: MouseEvent\n}\n\nexport type StzhChipFocusEvent = {\n component: \"stzh-chip\"\n originalEvent: FocusEvent\n}\n\nexport type StzhChipBlurEvent = {\n component: \"stzh-chip\"\n originalEvent: FocusEvent\n}\n\n/* VBZ Major Ticker */\n\nexport type StzhVbzMajortickerDisturbance = {\n id: string\n head: string\n text: string\n startDate: Date\n endDate: Date\n altStart: string\n altEnd: string\n infoUrl?: VbzTickerInfoUrl\n};\n\nexport type StzhVbzMajortickerDisturbanceFetchedEvent = {\n component: \"stzh-vbz-majorticker\"\n disturbance: StzhVbzMajortickerDisturbance | null\n}\n\n/* VBZ Ticker */\n\nexport type VbzTickerInfoUrl = {\n name: string\n url: string\n};\n\nexport type VbzTickerDisturbance = {\n id: string\n head: string\n startDate: Date\n endDate: Date\n altStart: string\n altEnd: string\n baseType?: string\n infoUrl?: VbzTickerInfoUrl\n category:\n | typeof VBZ.DISTURBANCE_INFORMATION\n | typeof VBZ.DISTURBANCE_CONSTRUCTION\n | typeof VBZ.DISTURBANCE_NORMAL\n | typeof VBZ.DISTURBANCE_EVENT\n | typeof VBZ.DISTURBANCE_BUS\n};\n\nexport type VbzTickerLine = {\n line: VBZ.Lines\n name: string\n disturbances: VbzTickerDisturbance[]\n // whether normal or big disturbance for this line exist\n alert: boolean\n // 2 = Fernverkehr / 16 = Schiff / 32 = S-Bahn/Reg / 64 = Bus / 128 = Bergbahn / 256 = Nachtnetz / 512 = Tram\n category: \"2\" | \"16\" | \"32\" | \"64\" | \"128\" | \"256\" | \"512\"\n};\n\n/* VBZ Line Chip */\n\nexport type StzhVbzLinechipLine = {\n color: string\n background: string\n comment?: string\n}\n\nexport type StzhVbzLinechipFocusEvent = {\n component: \"stzh-vbz-linechip\"\n originalEvent: FocusEvent\n}\n\nexport type StzhVbzLinechipBlurEvent = {\n component: \"stzh-vbz-linechip\"\n originalEvent: FocusEvent\n}\n\n/* Clamp */\n\nexport type StzhClampClampEvent = {\n component: \"stzh-clamp\"\n clamped: boolean\n}\n\nexport type StzhClampExpandEvent = {\n component: \"stzh-clamp\"\n expanded: boolean\n}\n\n/* Image Comparison */\n\nexport type StzhImagecomparisonChangeEvent = {\n component: \"stzh-imagecomparison\"\n originalEvent: InputEvent\n value: number\n}\n\n/* Dialog */\n\nexport type StzhDialogOpenEvent = {\n component: \"stzh-dialog\"\n}\n\nexport type StzhDialogCloseEvent = {\n component: \"stzh-dialog\"\n}\n\n/* Contact */\n\nexport type ContactNumber = {\n type: \"tel\" | \"fax\"\n label: string\n number: string\n analyticsId?: string\n}\n\nexport type StzhContactAvailabilityItem = {\n weekday: string\n hours: string[]\n}\n\n/* Overlay */\n\nexport type StzhOverlayOpenEvent = {\n component: \"stzh-overlay\"\n}\n\nexport type StzhOverlayCloseEvent = {\n component: \"stzh-overlay\"\n}\n\n/* Message */\n\nexport type StzhMessageOpenEvent = {\n component: \"stzh-message\"\n}\n\nexport type StzhMessageCloseEvent = {\n component: \"stzh-message\"\n}\n\n/* Toastbar */\n\nexport type StzhToastbarInitialToast = {\n label: string\n type?: StzhToastType\n link?: HTMLStzhLinkElement | {\n href: string,\n label: string\n },\n cookie?: string\n cookieExpires?: number\n}\n\n/* Toast */\n\nexport type StzhToastType = \"info\" | \"success\" | \"warning\" | \"error\";\n\nexport type StzhToastOpenEvent = {\n component: \"stzh-toast\"\n}\n\nexport type StzhToastCloseEvent = {\n component: \"stzh-toast\"\n}\n\nexport type StzhToastOpenedEvent = {\n component: \"stzh-toast\"\n}\n\nexport type StzhToastClosedEvent = {\n component: \"stzh-toast\"\n}\n\n/* Ghettobox */\n\nexport type StzhGhettoboxOpenEvent = {\n component: \"stzh-ghettobox\"\n}\n\nexport type StzhGhettoboxCloseEvent = {\n component: \"stzh-ghettobox\"\n}\n\n/* Input */\n\nexport type StzhInputChangeEvent = {\n component: \"stzh-input\"\n originalEvent: InputEvent | MouseEvent\n value: string\n}\n\nexport type StzhInputChangedEvent = {\n component: \"stzh-input\"\n originalEvent: InputEvent | MouseEvent\n value: string\n}\n\nexport type StzhInputFocusEvent = {\n component: \"stzh-input\"\n originalEvent: FocusEvent\n}\n\nexport type StzhInputBlurEvent = {\n component: \"stzh-input\"\n originalEvent: FocusEvent\n}\n\n/* Popover */\n\nexport type StzhPopoverOpenEvent = {\n component: \"stzh-popover\"\n}\n\nexport type StzhPopoverOpenedEvent = {\n component: \"stzh-popover\"\n}\n\nexport type StzhPopoverCloseEvent = {\n component: \"stzh-popover\"\n}\n\nexport type StzhPopoverClosedEvent = {\n component: \"stzh-popover\"\n}\n\n/* Timeline */\n\nexport type StzhTimelineFoldableChangeEvent = {\n component: \"stzh-timeline\"\n value: boolean\n}\n\n/* TimelineItem */\n\nexport type StzhTimelineItemOpenEvent = {\n component: \"stzh-timeline-item\"\n}\n\nexport type StzhTimelineItemOpenedEvent = {\n component: \"stzh-timeline-item\"\n}\n\nexport type StzhTimelineItemCloseEvent = {\n component: \"stzh-timeline-item\"\n}\n\nexport type StzhTimelineItemClosedEvent = {\n component: \"stzh-timeline-item\"\n}\n\nexport type StzhTimelineItemFocusEvent = {\n component: \"stzh-timeline-item\"\n originalEvent: FocusEvent\n}\n\nexport type StzhTimelineItemBlurEvent = {\n component: \"stzh-timeline-item\"\n originalEvent: FocusEvent\n}\n\n/* Accordion */\n\nexport type StzhAccordionItemOpenEvent = {\n component: \"stzh-accordion-item\"\n}\n\nexport type StzhAccordionItemOpenedEvent = {\n component: \"stzh-accordion-item\"\n}\n\nexport type StzhAccordionItemCloseEvent = {\n component: \"stzh-accordion-item\"\n}\n\nexport type StzhAccordionItemClosedEvent = {\n component: \"stzh-accordion-item\"\n}\n\nexport type StzhAccordionItemFocusEvent = {\n component: \"stzh-accordion-item\"\n originalEvent: FocusEvent\n}\n\nexport type StzhAccordionItemBlurEvent = {\n component: \"stzh-accordion-item\"\n originalEvent: FocusEvent\n}\n\n/* Tooltip */\n\nexport type StzhTooltipOpenEvent = {\n component: \"stzh-tooltip\"\n}\n\nexport type StzhTooltipOpenedEvent = {\n component: \"stzh-tooltip\"\n}\n\nexport type StzhTooltipCloseEvent = {\n component: \"stzh-tooltip\"\n}\n\nexport type StzhTooltipClosedEvent = {\n component: \"stzh-tooltip\"\n}\n\n/* Radio */\n\nexport type StzhRadioChangeEvent = {\n component: \"stzh-radio\"\n originalEvent: InputEvent\n value: string\n checked: boolean\n}\n\nexport type StzhRadioFocusEvent = {\n component: \"stzh-radio\"\n originalEvent: FocusEvent\n}\n\nexport type StzhRadioBlurEvent = {\n component: \"stzh-radio\"\n originalEvent: FocusEvent\n}\n\n/* Langnav */\n\nexport type StzhLangnavChangeEvent = {\n component: \"stzh-langnav\",\n value: string\n}\n\n/* Dropdown */\n\nexport type StzhDropdownOption = {\n text: string,\n value: string\n}\n\nexport type StzhDropdownChangeEvent = {\n component: \"stzh-dropdown\",\n value: string\n}\n\nexport type StzhDropdownItemAddEvent = {\n component: \"stzh-dropdown\",\n value: string\n}\n\nexport type StzhDropdownItemRemoveEvent = {\n component: \"stzh-dropdown\",\n value: string\n}\n\nexport type StzhDropdownOptionAddEvent = {\n component: \"stzh-dropdown\",\n value: string\n}\n\nexport type StzhDropdownOptionRemoveEvent = {\n component: \"stzh-dropdown\",\n value: string\n}\n\nexport type StzhDropdownOpenEvent = {\n component: \"stzh-dropdown\"\n}\n\nexport type StzhDropdowCloseEvent = {\n component: \"stzh-dropdown\"\n}\n\nexport type StzhDropdownFocusEvent = {\n component: \"stzh-dropdown\"\n originalEvent: {\n target: Element\n }\n}\n\nexport type StzhDropdownBlurEvent = {\n component: \"stzh-dropdown\"\n}\n\nexport type StzhDropdowInitEvent = {\n component: \"stzh-dropdown\"\n}\n\n/** Progressbar */\n\nexport type StzhProgressbarDataItem = {\n label: string\n icon?: string\n disabled?: boolean\n analyticsId?: string\n}\n\n/* Progressbar Item */\n\nexport type StzhProgressbarItemClickEvent = {\n component: \"stzh-progressbar-item\"\n originalEvent: MouseEvent\n index: number\n}\n\nexport type StzhProgressbarItemDottedClickEvent = {\n component: \"stzh-progressbar-item\"\n originalEvent: MouseEvent\n index: number\n}\n\n/* Upload */\n\nexport type StzhUploadFilesItem = {\n name: string\n size: number\n [key: string]: any\n}\n\nexport type StzhUploadFile = File & {\n xhr: XMLHttpRequest,\n status: string\n upload: any\n accepted: boolean\n previewElement: HTMLElement\n}\n\nexport type StzhUploadFileAddedEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile\n}\n\nexport type StzhUploadFilesAddedEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[]\n}\n\nexport type StzhUploadFileRemoveEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile\n}\n\nexport type StzhUploadFileRemovedEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile\n force: boolean\n}\n\nexport type StzhUploadSendingEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile,\n xhr: XMLHttpRequest,\n formData: FormData\n}\n\nexport type StzhUploadSendingMultipleEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[],\n xhr: XMLHttpRequest,\n formData: FormData\n}\n\nexport type StzhUploadProcessingEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile\n}\n\nexport type StzhUploadProcessingMultipleEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[]\n}\n\nexport type StzhUploadProgressEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile,\n progress: number,\n bytesSent: number\n}\n\nexport type StzhUploadProgressTotalEvent = {\n component: \"stzh-upload\",\n totalUploadProgress: number,\n totalBytes: number,\n totalBytesSent: number\n}\n\nexport type StzhUploadErrorEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile,\n message: string,\n xhr: XMLHttpRequest\n}\n\nexport type StzhUploadErrorMultipleEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[],\n message: string,\n xhr: XMLHttpRequest\n}\n\nexport type StzhUploadSuccessEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile,\n responseText: string,\n event: ProgressEvent\n}\n\nexport type StzhUploadSuccessMultipleEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[],\n responseText: string,\n event: ProgressEvent\n}\n\nexport type StzhUploadCanceledEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile\n}\n\nexport type StzhUploadCanceledMultipleEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[]\n}\n\nexport type StzhUploadCompleteEvent = {\n component: \"stzh-upload\",\n file: StzhUploadFile\n}\n\nexport type StzhUploadCompleteMultipleEvent = {\n component: \"stzh-upload\",\n files: StzhUploadFile[]\n}\n\n// Merged Types\n\nexport type StzhFocusEvent =\n | StzhAccordionItemFocusEvent\n | StzhButtonFocusEvent\n | StzhCheckboxFocusEvent\n | StzhChipFocusEvent\n | StzhDropdownFocusEvent\n | StzhInputFocusEvent\n | StzhLinkFocusEvent\n | StzhMenuItemFocusEvent\n | StzhRadioFocusEvent\n | StzhToggleFocusEvent\n | StzhVbzLinechipFocusEvent\n | StzhSkiplinkFocusEvent\n\n// ---\n// Prop Types\n// ---\n\nexport type StzhCalendarDateDisabledPredicate = (date: Date) => boolean\n\n\nexport namespace Layout {\n export type Ratio = \"16:9\" | \"1:1\" | \"5:4\" | \"4:3\" | \"3:2\" | \"2:1\" | \"21:9\";\n\n export type Justify =\n | \"start\"\n | \"end\"\n | \"center\"\n | \"between\"\n | \"around\"\n | \"evenly\";\n\n export type Items =\n | \"start\"\n | \"end\"\n | \"center\"\n | \"baseline\"\n | \"stretch\";\n\n export type JustifySelf =\n | \"auto\"\n | Justify;\n\n export type AlignSelf =\n | \"auto\"\n | Items;\n}\n\nexport namespace Space {\n export type Sizes =\n | \"xxxsmall\"\n | \"xxsmall\"\n | \"xsmall\"\n | \"small\"\n | \"medium\"\n | \"large\"\n | \"xlarge\"\n | \"xxlarge\"\n | \"xxxlarge\"\n | \"xxxxlarge\"\n | \"big\"\n | \"xbig\"\n | \"huge\"\n | \"xhuge\"\n | \"none\"\n | \"inherit\";\n\n export type Curves =\n | \"tiny\"\n | \"small\"\n | \"regular\"\n | \"medium\"\n | \"large\"\n | \"big\"\n | \"huge\"\n | \"none\";\n}\n\nexport namespace Font {\n export type Fonts =\n | \"light\"\n | \"regular\"\n | \"medium\"\n | \"heavy\"\n | \"default\";\n\n export type Sizes =\n | \"pico\"\n | \"nano\"\n | \"micro\"\n | \"milli\"\n | \"centi\"\n | \"deci\"\n | \"regular\"\n | \"deca\"\n | \"hecto\"\n | \"kilo\"\n | \"mega\"\n | \"giga\"\n | \"hero\"\n | \"inherit\";\n\n export type Curves =\n | \"p1\"\n | \"p2\"\n | \"caption\"\n | \"h4\"\n | \"h3\"\n | \"h2\"\n | \"h1\"\n | \"hero\"\n | \"default\"\n | \"none\";\n}\n\nexport namespace VBZ {\n export const BASE_TYPE_GLOBAL = \"GLOBAL\";\n\n export const CHANNEL_TICKER = \"ticker\";\n export const CHANNEL_INFO_URL_FILTER = \"stadt-zuerich.ch/vbz\";\n\n export const DISTURBANCE_GLOBAL = \"__global__\";\n export const DISTURBANCE_INFORMATION = \"0\";\n export const DISTURBANCE_CONSTRUCTION = \"1\";\n export const DISTURBANCE_NORMAL = \"2\";\n export const DISTURBANCE_EVENT = \"4\";\n export const DISTURBANCE_BUS = \"5\";\n\n export type Lines =\n | \"2\"\n | \"3\"\n | \"4\"\n | \"5\"\n | \"6\"\n | \"7\"\n | \"8\"\n | \"9\"\n | \"10\"\n | \"11\"\n | \"12\"\n | \"13\"\n | \"14\"\n | \"15\"\n | \"16\"\n | \"17\"\n | \"19\"\n | \"20\"\n | \"21\"\n | \"23\"\n | \"24\"\n | \"25\"\n | \"29\"\n | \"31\"\n | \"32\"\n | \"33\"\n | \"34\"\n | \"35\"\n | \"36\"\n | \"37\"\n | \"38\"\n | \"39\"\n | \"40\"\n | \"45\"\n | \"46\"\n | \"54\"\n | \"61\"\n | \"62\"\n | \"63\"\n | \"64\"\n | \"66\"\n | \"67\"\n | \"69\"\n | \"70\"\n | \"72\"\n | \"73\"\n | \"75\"\n | \"76\"\n | \"77\"\n | \"78\"\n | \"79\"\n | \"80\"\n | \"83\"\n | \"89\"\n | \"91\"\n | \"94\"\n | \"95\"\n | \"99\"\n | \"151\"\n | \"152\"\n | \"153\"\n | \"156\"\n | \"161\"\n | \"162\"\n | \"163\"\n | \"165\"\n | \"184\"\n | \"185\"\n | \"200\"\n | \"201\"\n | \"215\"\n | \"220\"\n | \"235\"\n | \"236\"\n | \"245\"\n | \"301\"\n | \"302\"\n | \"303\"\n | \"304\"\n | \"305\"\n | \"306\"\n | \"307\"\n | \"308\"\n | \"309\"\n | \"311\"\n | \"314\"\n | \"315\"\n | \"317\"\n | \"321\"\n | \"323\"\n | \"325\"\n | \"350\"\n | \"444\"\n | \"445\"\n | \"701\"\n | \"702\"\n | \"703\"\n | \"704\"\n | \"705\"\n | \"720\"\n | \"721\"\n | \"725\"\n | \"726\"\n | \"727\"\n | \"742\"\n | \"743\"\n | \"744\"\n | \"745\"\n | \"747\"\n | \"748\"\n | \"751\"\n | \"752\"\n | \"753\"\n | \"754\"\n | \"759\"\n | \"760\"\n | \"765\"\n | \"768\"\n | \"781\"\n | \"786\"\n | \"787\"\n | \"910\"\n | \"912\"\n | \"916\"\n | \"917\"\n | \"918\"\n | \"919\"\n | \"E\"\n | \"N\"\n | \"N1\"\n | \"N2\"\n | \"N4\"\n | \"N5\"\n | \"N6\"\n | \"N7\"\n | \"N8\"\n | \"N9\"\n | \"N10\"\n | \"N11\"\n | \"N12\"\n | \"N13\"\n | \"N14\"\n | \"N15\"\n | \"N16\"\n | \"N17\"\n | \"N18\"\n | \"N19\"\n | \"N30\"\n | \"N31\"\n | \"N32\"\n | \"N33\"\n | \"N34\"\n | \"N45\"\n | \"N72\"\n | \"N78\"\n | \"SN1\"\n | \"SN4\"\n | \"SN5\"\n | \"SN6\"\n | \"SN7\"\n | \"SN8\"\n | \"SN9\"\n | \"S2\"\n | \"S3\"\n | \"S4\"\n | \"S5\"\n | \"S6\"\n | \"S7\"\n | \"S8\"\n | \"S9\"\n | \"S10\"\n | \"S11\"\n | \"S14\"\n | \"S15\"\n | \"S16\"\n | \"S18\"\n | \"S19\"\n | \"S20\"\n | \"S21\"\n | \"S23\"\n | \"S24\"\n | \"S25\"\n}\n\n// ---\n// Stencil component types\n// ---\n\nexport * from './components';\n"],"mappings":"IA4xCiBA,GAAjB,SAAiBA,GACFA,EAAAC,iBAAmB,SAEnBD,EAAAE,eAAiB,SACjBF,EAAAG,wBAA0B,uBAE1BH,EAAAI,mBAAqB,aACrBJ,EAAAK,wBAA0B,IAC1BL,EAAAM,yBAA2B,IAC3BN,EAAAO,mBAAqB,IACrBP,EAAAQ,kBAAoB,IACpBR,EAAAS,gBAAkB,GAyLhC,EApMD,CAAiBT,MAAG,Y"}
@@ -0,0 +1,2 @@
1
+ System.register(["./p-290fcb28.system.js","./p-f9cb0fcd.system.js","./p-774595ba.system.js"],(function(t){"use strict";var s,i,e,o,c,n,r;return{setters:[function(t){s=t.r;i=t.c;e=t.h;o=t.a;c=t.g},function(t){n=t.a;r=t.o},function(){}],execute:function(){var h='.sc-stzh-sticky-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:var(--stzh-font-style-regular);color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-sticky-h{display:none}.sc-stzh-sticky-h *.sc-stzh-sticky,.sc-stzh-sticky-h *.sc-stzh-sticky::before,.sc-stzh-sticky-h *.sc-stzh-sticky::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}.sc-stzh-sticky-h .has-focus.sc-stzh-sticky{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.3125rem}.sc-stzh-sticky-h .stzh-fylingfocus-focused.sc-stzh-sticky{outline-style:none !important}.sc-stzh-sticky-h .stzh-fylingfocus-focused.sc-stzh-sticky::-moz-focus-inner{border:0 !important}.sc-stzh-sticky-h{--padding:var(--stzh-space-large) 0;display:contents}@media print{.sc-stzh-sticky-h{display:none}}.stzh-sticky.sc-stzh-sticky{display:contents}.stzh-sticky__sticky.sc-stzh-sticky{position:-webkit-sticky;position:sticky;top:-0.0625rem;bottom:-0.0625rem;z-index:var(--stzh-z-index-sticky)}.stzh-sticky__content.sc-stzh-sticky{position:relative;padding:var(--padding)}.stzh-sticky__content.sc-stzh-sticky::before,.stzh-sticky__content.sc-stzh-sticky::after{content:"";pointer-events:none;display:block;position:absolute;left:0;width:100%;height:var(--stzh-space-xxlarge);opacity:0;-webkit-transition:opacity var(--stzh-base-transition-animation-speed);transition:opacity var(--stzh-base-transition-animation-speed)}.stzh-sticky__content.sc-stzh-sticky::before{background:-webkit-gradient(linear, left bottom, left top, from(#FFFFFF), to(rgba(255, 255, 255, 0)));background:linear-gradient(0deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);top:0;-webkit-transform:translateY(-100%);transform:translateY(-100%)}.stzh-sticky__content.sc-stzh-sticky::after{background:-webkit-gradient(linear, left bottom, left top, from(rgba(255, 255, 255, 0)), to(#FFFFFF));background:linear-gradient(0deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 100%);bottom:0;-webkit-transform:translateY(100%);transform:translateY(100%)}.stzh-sticky__spacer.sc-stzh-sticky{display:none}.stzh-sticky--is-disabled-sticky-top.sc-stzh-sticky .stzh-sticky__sticky.sc-stzh-sticky{top:auto}.stzh-sticky--is-disabled-sticky-bottom.sc-stzh-sticky .stzh-sticky__sticky.sc-stzh-sticky{bottom:auto}.stzh-sticky--is-stuck.sc-stzh-sticky .stzh-sticky__content.sc-stzh-sticky{background-color:var(--stzh-color-white)}.stzh-sticky--is-stuck-bottom.sc-stzh-sticky .stzh-sticky__content.sc-stzh-sticky::before{opacity:1}.stzh-sticky--is-stuck-top.sc-stzh-sticky .stzh-sticky__content.sc-stzh-sticky::after{opacity:1}.stzh-sticky--is-breakout.sc-stzh-sticky .stzh-sticky__content.sc-stzh-sticky{position:relative;left:50%;right:50%;margin-left:calc(-50vw + var(--stzh-scrollbar-width) / 2);margin-right:calc(-50vw + var(--stzh-scrollbar-width) / 2);width:calc(100vw - var(--stzh-scrollbar-width));max-width:calc(100vw - var(--stzh-scrollbar-width))}';var a=t("stzh_sticky",function(){function t(t){var e=this;s(this,t);this.stzhStuckTop=i(this,"stzhStuckTop",7);this.stzhStuckBottom=i(this,"stzhStuckBottom",7);this.fixedHeight=0;this.fixedWidth=0;this.fixedLimit=null;this.handleScroll=function(){if(e.debounceScroll){window.cancelAnimationFrame(e.debounceScroll)}e.debounceScroll=requestAnimationFrame(e.updateFixedByScroll)};this.handleResize=function(){if(e.debounceResize){window.cancelAnimationFrame(e.debounceResize)}e.debounceResize=requestAnimationFrame(e.updateFixedByResize)};this.updateFixedByScroll=function(){if(!n(e.stickyElement)){return}e.scrollX=window.scrollX;e.scrollY=window.scrollY;e.fixedLimit=e.getFixedLimit();if(e.isStuckTop||e.isStuckBottom){var t=r(e.spacerElement);e.fixedTop=t.top;e.fixedLeft=t.left}else{var t=r(e.stickyElement);e.fixedTop=t.top;e.fixedLeft=t.left}e.isStuckBottom=!e.disableStickyBottom&&e.scrollY+e.windowHeight<=e.fixedTop+e.fixedHeight;e.isStuckTop=!e.disableStickyTop&&e.scrollY>=e.fixedTop;e.hasReachedTopLimit=e.fixedLimit&&e.scrollY+e.windowHeight-e.fixedHeight<=e.fixedLimit.top;e.hasReachedBottomLimit=e.fixedLimit&&e.scrollY>=e.fixedLimit.bottom-e.fixedHeight;if(e.isStuckTop||e.isStuckBottom){e.setFixed()}else{e.setUnfixed()}};this.updateFixedByResize=function(){e.setUnfixed();e.stickyElement.style.position="static";e.isStuckTop=false;e.isStuckBottom=false;if(n(e.stickyElement)){e.windowHeight=window.innerHeight;e.fixedHeight=e.stickyElement.offsetHeight;e.fixedWidth=e.stickyElement.offsetWidth;e.spacerElement.style.height="".concat(e.fixedHeight,"px");e.updateFixedByScroll()}};this.observe=function(){e.updateStuck()};this.disableStickyTop=false;this.disableStickyBottom=false;this.breakout=false;this.position="sticky";this.isStuckTop=false;this.isStuckBottom=false;this.hasReachedTopLimit=false;this.hasReachedBottomLimit=false}t.prototype.disableStickyWatcher=function(){var t=this;requestAnimationFrame((function(){requestAnimationFrame((function(){if(t.position==="fixed"){t.updateFixedByResize()}else{t.updateStuck()}}))}))};t.prototype.isStuckTopWatcher=function(t){this.stzhStuckTop.emit({component:"stzh-sticky",sticky:t})};t.prototype.isStuckBottomWatcher=function(t){this.stzhStuckBottom.emit({component:"stzh-sticky",sticky:t})};t.prototype.positionWatcher=function(t){if(t==="fixed"){if(this.observer){this.observer.disconnect()}window.addEventListener("scroll",this.handleScroll,{passive:true});window.addEventListener("resize",this.handleResize);this.updateFixedByResize()}else{window.removeEventListener("scroll",this.handleScroll);window.removeEventListener("resize",this.handleResize);this.setUnfixed();this.observer=new IntersectionObserver(this.observe,{threshold:[1]});this.observer.observe(this.stickyElement);this.updateStuck()}};t.prototype.updateStuck=function(){var t=parseInt(getComputedStyle(this.stickyElement).top,10);var s=parseInt(getComputedStyle(this.stickyElement).bottom,10);var i=this.stickyElement.getBoundingClientRect();if(t){this.isStuckTop=i.top<0}else{this.isStuckTop=false}if(s){this.isStuckBottom=document.documentElement.clientHeight<i.bottom}else{this.isStuckBottom=false}};t.prototype.getFixedLimit=function(){var t=this.element.closest("[data-stzh-sticky-container]");if(!t){return null}var s=r(t);return{top:s.top,bottom:s.top+t.scrollHeight}};t.prototype.setUnfixed=function(){Object.assign(this.stickyElement.style,{position:null,top:null,bottom:null,left:null,width:null});Object.assign(this.spacerElement.style,{display:"none"})};t.prototype.setFixed=function(){var t=this.hasReachedTopLimit||this.hasReachedBottomLimit?"absolute":"fixed";Object.assign(this.stickyElement.style,{position:t,top:t==="absolute"?"".concat(this.isStuckTop?this.fixedLimit.bottom-this.fixedHeight:this.fixedLimit.top,"px"):this.isStuckTop?"0px":"auto",bottom:this.isStuckTop||t==="absolute"?"auto":"0px",left:"".concat(this.fixedLeft+(t==="fixed"?this.scrollX:0),"px"),width:"".concat(this.fixedWidth,"px")});Object.assign(this.spacerElement.style,{display:"block"})};t.prototype.componentDidLoad=function(){this.positionWatcher(this.position)};t.prototype.disconnectedCallback=function(){if(this.observer){this.observer.disconnect()}window.removeEventListener("scroll",this.handleScroll);window.removeEventListener("resize",this.handleResize)};t.prototype.render=function(){var t;var s=this;var i=this.isStuckTop||this.isStuckBottom;var c=(t={"stzh-sticky":true,"stzh-sticky--is-stuck":i,"stzh-sticky--is-stuck-top":this.isStuckTop,"stzh-sticky--is-stuck-bottom":this.isStuckBottom,"stzh-sticky--is-breakout":this.breakout,"stzh-sticky--is-disabled-sticky-top":this.disableStickyTop,"stzh-sticky--is-disabled-sticky-bottom":this.disableStickyBottom},t["stzh-sticky--position-".concat(this.position)]=!!this.position,t);return e(o,{"is-stuck":this.isStuckTop||this.isStuckBottom,"is-stuck-top":this.isStuckTop,"is-stuck-bottom":this.isStuckBottom},e("div",{class:c},e("div",{ref:function(t){return s.spacerElement=t},class:"stzh-sticky__spacer"}),e("div",{ref:function(t){return s.stickyElement=t},class:"stzh-sticky__sticky"},e("div",{class:"stzh-sticky__content"},e("slot",null)))))};Object.defineProperty(t.prototype,"element",{get:function(){return c(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disableStickyTop:["disableStickyWatcher"],disableStickyBottom:["disableStickyWatcher"],isStuckTop:["isStuckTopWatcher"],isStuckBottom:["isStuckBottomWatcher"],position:["positionWatcher"]}},enumerable:false,configurable:true});return t}());a.style=h}}}));
2
+ //# sourceMappingURL=p-0b1b2aa6.system.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stzhStickyCss","StzhSticky","exports","this","fixedHeight","fixedWidth","fixedLimit","handleScroll","_this","debounceScroll","window","cancelAnimationFrame","requestAnimationFrame","updateFixedByScroll","handleResize","debounceResize","updateFixedByResize","isVisible","stickyElement","scrollX","scrollY","getFixedLimit","isStuckTop","isStuckBottom","off","offset","spacerElement","fixedTop","top","fixedLeft","left","disableStickyBottom","windowHeight","disableStickyTop","hasReachedTopLimit","hasReachedBottomLimit","bottom","setFixed","setUnfixed","style","position","innerHeight","offsetHeight","offsetWidth","height","concat","observe","updateStuck","class_1","prototype","disableStickyWatcher","isStuckTopWatcher","newValue","stzhStuckTop","emit","component","sticky","isStuckBottomWatcher","stzhStuckBottom","positionWatcher","observer","disconnect","addEventListener","passive","removeEventListener","IntersectionObserver","threshold","topCss","parseInt","getComputedStyle","bottomCss","rect","getBoundingClientRect","document","documentElement","clientHeight","stickyContainer","element","closest","scrollHeight","Object","assign","width","display","componentDidLoad","disconnectedCallback","render","isStuck","classes","_a","breakout","h","Host","class","ref","el"],"sources":["src/components/stzh-sticky/stzh-sticky.scss?tag=stzh-sticky&encapsulation=scoped","src/components/stzh-sticky/stzh-sticky.tsx"],"sourcesContent":["/**\n * @prop --padding: Padding of sticky element\n */\n\n:host {\n --padding: #{space('large')} 0;\n\n display: contents;\n\n @media print {\n display: none;\n }\n}\n\n.stzh-sticky {\n display: contents;\n\n &__sticky {\n position: sticky;\n top: -1px;\n bottom: -1px;\n z-index: $zIndexSticky;\n }\n\n &__content {\n position: relative;\n padding: var(--padding);\n\n &::before,\n &::after {\n content: '';\n pointer-events: none;\n display: block;\n position: absolute;\n left: 0;\n width: 100%;\n height: space('xxlarge');\n opacity: 0;\n transition: opacity $baseTransitionAnimationSpeed;\n }\n\n &::before {\n background: linear-gradient(0deg, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%);\n top: 0;\n transform: translateY(-100%);\n }\n\n &::after {\n background: linear-gradient(0deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 100%);\n bottom: 0;\n transform: translateY(100%);\n }\n }\n\n &__spacer {\n display: none;\n }\n\n &--is-disabled-sticky-top &__sticky {\n top: auto;\n }\n\n &--is-disabled-sticky-bottom &__sticky {\n bottom: auto;\n }\n\n &--is-stuck &__content {\n background-color: $colorWhite;\n }\n\n &--is-stuck-bottom &__content {\n &::before {\n opacity: 1;\n }\n }\n\n &--is-stuck-top &__content {\n &::after {\n opacity: 1;\n }\n }\n\n /* Position sticky variant */\n\n &--is-breakout &__content {\n position: relative;\n left: 50%;\n right: 50%;\n margin-left: calc(-50vw + var(--stzh-scrollbar-width) / 2);\n margin-right: calc(-50vw + var(--stzh-scrollbar-width) / 2);\n width: calc(100vw - var(--stzh-scrollbar-width));\n max-width: calc(100vw - var(--stzh-scrollbar-width));\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n State,\n Watch,\n Event,\n EventEmitter\n} from \"@stencil/core\";\n\nimport {\n StzhStickyStuckTopEvent,\n StzhStickyStuckBottomEvent\n} from \"../../index\";\n\nimport { isVisible, offset } from \"../../utils/utils\";\n\n/**\n *\n */\n@Component({\n tag: \"stzh-sticky\",\n styleUrl: \"stzh-sticky.scss\",\n scoped: true\n})\nexport class StzhSticky {\n /** Whether to disable sticking to top */\n @Prop({ reflect: true }) disableStickyTop: boolean = false;\n\n /** Whether to disable sticking to bottom */\n @Prop({ reflect: true }) disableStickyBottom: boolean = false;\n\n /** Whether to breakout container */\n @Prop({ reflect: true }) breakout: boolean = false;\n\n /**\n * Position type used.\n *\n * - sticky: used only css position sticky\n * - fixed: uses position fixed with js for positioning (`data-stzh-sticky-container` can be used on a container element to limit sticky position)\n */\n @Prop({ reflect: true }) position: \"sticky\" | \"fixed\" = \"sticky\";\n\n @Watch(\"disableStickyTop\")\n @Watch(\"disableStickyBottom\")\n disableStickyWatcher() {\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n if (this.position === \"fixed\") {\n this.updateFixedByResize();\n } else {\n this.updateStuck();\n }\n });\n });\n }\n\n @Element() element: HTMLStzhStickyElement;\n\n @State() isStuckTop: boolean = false;\n @State() isStuckBottom: boolean = false;\n\n @State() hasReachedTopLimit: boolean = false;\n @State() hasReachedBottomLimit: boolean = false;\n\n @Watch(\"isStuckTop\")\n isStuckTopWatcher(newValue: boolean) {\n this.stzhStuckTop.emit({\n component: \"stzh-sticky\",\n sticky: newValue\n });\n }\n\n @Watch(\"isStuckBottom\")\n isStuckBottomWatcher(newValue: boolean) {\n this.stzhStuckBottom.emit({\n component: \"stzh-sticky\",\n sticky: newValue\n });\n }\n\n @Watch(\"position\")\n positionWatcher(newValue: string) {\n if (newValue === \"fixed\") {\n if (this.observer) {\n this.observer.disconnect();\n }\n\n window.addEventListener(\"scroll\", this.handleScroll, { passive: true });\n window.addEventListener(\"resize\", this.handleResize);\n\n this.updateFixedByResize();\n } else {\n window.removeEventListener(\"scroll\", this.handleScroll);\n window.removeEventListener(\"resize\", this.handleResize);\n this.setUnfixed();\n\n this.observer = new IntersectionObserver(this.observe, { threshold: [1] });\n this.observer.observe(this.stickyElement);\n\n this.updateStuck();\n }\n }\n\n /** Sticky stuck top event */\n @Event() stzhStuckTop: EventEmitter<StzhStickyStuckTopEvent>;\n\n /** Sticky stuck bottom event */\n @Event() stzhStuckBottom: EventEmitter<StzhStickyStuckBottomEvent>;\n\n private observer: IntersectionObserver;\n private debounceScroll: number;\n private debounceResize: number;\n private stickyElement: HTMLElement;\n private spacerElement: HTMLElement;\n\n private windowHeight: number;\n private scrollX: number;\n private scrollY: number;\n private fixedTop: number;\n private fixedLeft: number;\n private fixedHeight: number = 0;\n private fixedWidth: number = 0;\n private fixedLimit: { top: number, bottom: number } | null = null;\n\n private updateStuck() {\n const topCss = parseInt(getComputedStyle(this.stickyElement).top, 10);\n const bottomCss = parseInt(getComputedStyle(this.stickyElement).bottom, 10);\n const rect = this.stickyElement.getBoundingClientRect();\n\n if (topCss) {\n this.isStuckTop = rect.top < 0;\n } else {\n this.isStuckTop = false;\n }\n\n if (bottomCss) {\n this.isStuckBottom = document.documentElement.clientHeight < rect.bottom;\n } else {\n this.isStuckBottom = false;\n }\n }\n\n private getFixedLimit(): { top: number, bottom: number } | null {\n const stickyContainer = this.element.closest(\"[data-stzh-sticky-container]\");\n\n if (!stickyContainer) {\n return null;\n }\n\n const off = offset(stickyContainer);\n\n return {\n top: off.top,\n bottom: off.top + stickyContainer.scrollHeight,\n };\n }\n\n private setUnfixed() {\n Object.assign(this.stickyElement.style, {\n position: null,\n top: null,\n bottom: null,\n left: null,\n width: null,\n });\n\n Object.assign(this.spacerElement.style, {\n display: \"none\",\n });\n }\n\n private setFixed() {\n const position = (this.hasReachedTopLimit || this.hasReachedBottomLimit)\n ? \"absolute\"\n : \"fixed\";\n\n Object.assign(this.stickyElement.style, {\n position,\n top: position === \"absolute\"\n ? `${this.isStuckTop ? this.fixedLimit.bottom - this.fixedHeight : this.fixedLimit.top}px`\n : this.isStuckTop ? \"0px\" : \"auto\",\n bottom: this.isStuckTop || position === \"absolute\"\n ? \"auto\" : \"0px\",\n left: `${this.fixedLeft + (position === \"fixed\" ? this.scrollX : 0)}px`,\n width: `${this.fixedWidth}px`,\n });\n\n Object.assign(this.spacerElement.style, {\n display: \"block\",\n });\n }\n\n private handleScroll = () => {\n if (this.debounceScroll) {\n window.cancelAnimationFrame(this.debounceScroll);\n }\n\n this.debounceScroll = requestAnimationFrame(this.updateFixedByScroll);\n }\n\n private handleResize = () => {\n if (this.debounceResize) {\n window.cancelAnimationFrame(this.debounceResize);\n }\n\n this.debounceResize = requestAnimationFrame(this.updateFixedByResize);\n }\n\n private updateFixedByScroll = () => {\n if (!isVisible(this.stickyElement)) {\n return;\n }\n\n this.scrollX = window.scrollX;\n this.scrollY = window.scrollY;\n this.fixedLimit = this.getFixedLimit();\n\n if (this.isStuckTop || this.isStuckBottom) {\n const off = offset(this.spacerElement);\n\n this.fixedTop = off.top;\n this.fixedLeft = off.left;\n } else {\n const off = offset(this.stickyElement);\n\n this.fixedTop = off.top;\n this.fixedLeft = off.left;\n }\n\n // console.log(\n // this.scrollX,\n // this.scrollY,\n // this.windowHeight, \n // this.fixedTop,\n // this.fixedLeft,\n // this.fixedHeight,\n // this.fixedLimit,\n // );\n\n this.isStuckBottom = !this.disableStickyBottom\n && this.scrollY + this.windowHeight <= this.fixedTop + this.fixedHeight;\n this.isStuckTop = !this.disableStickyTop\n && this.scrollY >= this.fixedTop;\n\n this.hasReachedTopLimit = this.fixedLimit \n && this.scrollY + this.windowHeight - this.fixedHeight <= this.fixedLimit.top;\n this.hasReachedBottomLimit = this.fixedLimit \n && this.scrollY >= this.fixedLimit.bottom - this.fixedHeight;\n\n // console.log(\n // this.isStuckBottom,\n // this.isStuckTop,\n // this.hasReachedBottomLimit,\n // this.hasReachedTopLimit,\n // );\n\n if (this.isStuckTop || this.isStuckBottom) {\n this.setFixed();\n } else {\n this.setUnfixed();\n }\n }\n\n private updateFixedByResize = () => {\n // reset sticky so we can read current offsets\n this.setUnfixed();\n this.stickyElement.style.position = \"static\";\n this.isStuckTop = false;\n this.isStuckBottom = false;\n\n if (isVisible(this.stickyElement)) {\n this.windowHeight = window.innerHeight;\n this.fixedHeight = this.stickyElement.offsetHeight; \n this.fixedWidth = this.stickyElement.offsetWidth;\n this.spacerElement.style.height = `${this.fixedHeight}px`;\n\n this.updateFixedByScroll();\n }\n }\n\n private observe = () => {\n this.updateStuck();\n };\n\n componentDidLoad() {\n this.positionWatcher(this.position);\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n\n window.removeEventListener(\"scroll\", this.handleScroll);\n window.removeEventListener(\"resize\", this.handleResize);\n }\n\n render() {\n const isStuck = this.isStuckTop || this.isStuckBottom;\n\n const classes = {\n \"stzh-sticky\": true,\n \"stzh-sticky--is-stuck\": isStuck,\n \"stzh-sticky--is-stuck-top\": this.isStuckTop,\n \"stzh-sticky--is-stuck-bottom\": this.isStuckBottom,\n \"stzh-sticky--is-breakout\": this.breakout,\n \"stzh-sticky--is-disabled-sticky-top\": this.disableStickyTop,\n \"stzh-sticky--is-disabled-sticky-bottom\": this.disableStickyBottom,\n [`stzh-sticky--position-${this.position}`]: !!this.position,\n };\n\n return (\n <Host\n is-stuck={this.isStuckTop || this.isStuckBottom}\n is-stuck-top={this.isStuckTop}\n is-stuck-bottom={this.isStuckBottom}\n >\n <div class={classes}>\n <div\n ref={(el) => (this.spacerElement = el as HTMLDivElement)}\n class=\"stzh-sticky__spacer\"\n ></div>\n <div\n ref={(el) => (this.stickyElement = el as HTMLDivElement)}\n class=\"stzh-sticky__sticky\"\n >\n <div class=\"stzh-sticky__content\">\n <slot></slot>\n </div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"8PAAA,IAAMA,EAAgB,4hG,IC2BTC,EAAUC,EAAA,yB,+HAgGbC,KAAAC,YAAsB,EACtBD,KAAAE,WAAqB,EACrBF,KAAAG,WAAqD,KAsErDH,KAAAI,aAAe,WACrB,GAAIC,EAAKC,eAAgB,CACvBC,OAAOC,qBAAqBH,EAAKC,e,CAGnCD,EAAKC,eAAiBG,sBAAsBJ,EAAKK,oB,EAG3CV,KAAAW,aAAe,WACrB,GAAIN,EAAKO,eAAgB,CACvBL,OAAOC,qBAAqBH,EAAKO,e,CAGnCP,EAAKO,eAAiBH,sBAAsBJ,EAAKQ,oB,EAG3Cb,KAAAU,oBAAsB,WAC5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KAAKW,a,EAG5CkC,EAAAC,UAAAqC,OAAA,W,MAAA,IAAA9E,EAAAL,KACE,IAAMoF,EAAUpF,KAAKmB,YAAcnB,KAAKoB,cAExC,IAAMiE,GAAOC,EAAA,CACX,cAAe,KACf,wBAAyBF,EACzB,4BAA6BpF,KAAKmB,WAClC,+BAAgCnB,KAAKoB,cACrC,2BAA4BpB,KAAKuF,SACjC,sCAAuCvF,KAAK8B,iBAC5C,yCAA0C9B,KAAK4B,qBAC/C0D,EAAC,yBAAA5C,OAAyB1C,KAAKqC,aAAerC,KAAKqC,S,GAGrD,OACEmD,EAACC,EAAI,YACOzF,KAAKmB,YAAcnB,KAAKoB,cAAa,eACjCpB,KAAKmB,WAAU,kBACZnB,KAAKoB,eAEtBoE,EAAA,OAAKE,MAAOL,GACVG,EAAA,OACEG,IAAK,SAACC,GAAE,OAAMvF,EAAKkB,cAAgBqE,CAA3B,EACRF,MAAM,wBAERF,EAAA,OACEG,IAAK,SAACC,GAAE,OAAMvF,EAAKU,cAAgB6E,CAA3B,EACRF,MAAM,uBAENF,EAAA,OAAKE,MAAM,wBACTF,EAAA,gB,yZA/SS,I"}
@@ -1,2 +1,2 @@
1
- import{r as t,c as s,h as i,a as e,g as r}from"./p-c92165bd.js";import{a as o}from"./p-876d7e8d.js";import{a as h}from"./p-9b063923.js";import{VBZ as a}from"./index.esm.js";const n=".sc-stzh-vbz-majorticker-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:var(--stzh-font-style-regular);color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-vbz-majorticker-h{display:none}.sc-stzh-vbz-majorticker-h *.sc-stzh-vbz-majorticker,.sc-stzh-vbz-majorticker-h *.sc-stzh-vbz-majorticker::before,.sc-stzh-vbz-majorticker-h *.sc-stzh-vbz-majorticker::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}.sc-stzh-vbz-majorticker-h .has-focus.sc-stzh-vbz-majorticker{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.3125rem}.sc-stzh-vbz-majorticker-h .stzh-fylingfocus-focused.sc-stzh-vbz-majorticker{outline-style:none !important}.sc-stzh-vbz-majorticker-h .stzh-fylingfocus-focused.sc-stzh-vbz-majorticker::-moz-focus-inner{border:0 !important}.stzh-vbz-majorticker__ghettobox.sc-stzh-vbz-majorticker{--stzh-base-invert-color-rgb:var(--stzh-color-black-rgb);--color:var(--stzh-color-black);--background-color:var(--stzh-color-coral)}";const c=class{constructor(i){t(this,i);this.stzhDisturbanceFetched=s(this,"stzhDisturbanceFetched",7);this.disturbance=null;this.onGhettoboxOpen=()=>{this.ghettoboxShown=true};this.onGhettoboxClose=()=>{this.ghettoboxShown=false};this.api="https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}";this.data="";this.moreInfoLink="https://zvv.ch/zvv/{lang}/fahrplan/vl.html?himIds={id}";this.dateAdapter=undefined;this.localization=undefined;this.ghettoboxCloseTimeKey=undefined;this.ghettoboxShown=true}async getGhettoboxShown(){return this.ghettoboxShown}async getDisturbance(){return this.disturbance}async apiWatcher(t){if(!t){return}let s=this.api.replace(/\{lang\}/,this.localization.$locale);s=s+(s.includes("?")?"&":"?")+Date.now();const{data:i}=await o.get(s);this.data=i}async dataWatcher(t){var s,i;if(typeof t==="string"){this._data=JSON.parse(t)}else{this._data=t}const e=(i=(s=this._data)===null||s===void 0?void 0:s.Message)===null||i===void 0?void 0:i.find((t=>t.category===a.DISTURBANCE_INFORMATION&&t.baseType===a.BASE_TYPE_GLOBAL));if(e){const t=e.channel.filter((t=>t.name===a.CHANNEL_TICKER&&t.url)).map((t=>t.url)).reduce(((t,s)=>t.concat(s)),[]);const s=t.find((t=>t.url.indexOf(a.CHANNEL_INFO_URL_FILTER)!==-1));this.disturbance={id:e.id,head:e.head,text:h(e.text),startDate:new Date(`${e.sDate}T${e.sTime}+02:00`),endDate:new Date(`${e.eDate}T${e.eTime}+02:00`),altStart:e.altStart,altEnd:e.altEnd,infoUrl:s}}this.stzhDisturbanceFetched.emit({component:"stzh-vbz-majorticker",disturbance:this.disturbance})}async componentWillLoad(){if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"vbz-majorticker")}if(!this.dateAdapter){this.dateAdapter=window.stzhComponents.utils.createFormatParseAdapter(this.localization.$formats,this.localization.$globals)}if(this.data){await this.dataWatcher(this.data)}else{await this.apiWatcher(this.api)}}render(){const t={"stzh-vbz-majorticker":true};return i(e,{hidden:!this.disturbance||!this.ghettoboxShown},i("div",{class:t},this.disturbance&&i("stzh-ghettobox",{onStzhOpen:this.onGhettoboxOpen,onStzhClose:this.onGhettoboxClose,class:"stzh-vbz-majorticker__ghettobox",hideClose:true,closeTimeKey:this.ghettoboxCloseTimeKey,mainTitle:this.disturbance.head,publishDate:this.disturbance.startDate},i("stzh-richtext",{innerHTML:this.disturbance.text}),this.disturbance.infoUrl?i("stzh-button",{slot:"button",href:this.disturbance.infoUrl.url},this.disturbance.infoUrl.name):i("stzh-button",{slot:"button",target:"_blank",href:this.moreInfoLink.replace(/\{lang\}/,this.localization.$locale).replace(/\{id\}/,this.disturbance.id)},this.localization.moreInfo))))}get element(){return r(this)}static get watchers(){return{api:["apiWatcher"],data:["dataWatcher"]}}};c.style=n;export{c as stzh_vbz_majorticker};
2
- //# sourceMappingURL=p-11784b90.entry.js.map
1
+ import{r as t,c as s,h as i,a as e,g as r}from"./p-c92165bd.js";import{a as o}from"./p-876d7e8d.js";import{a as h}from"./p-9b063923.js";import{VBZ as a}from"./index.esm.js";const n=".sc-stzh-vbz-majorticker-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:var(--stzh-font-style-regular);color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-vbz-majorticker-h{display:none}.sc-stzh-vbz-majorticker-h *.sc-stzh-vbz-majorticker,.sc-stzh-vbz-majorticker-h *.sc-stzh-vbz-majorticker::before,.sc-stzh-vbz-majorticker-h *.sc-stzh-vbz-majorticker::after{-webkit-box-sizing:border-box;box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness)}.sc-stzh-vbz-majorticker-h .has-focus.sc-stzh-vbz-majorticker{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.3125rem}.sc-stzh-vbz-majorticker-h .stzh-fylingfocus-focused.sc-stzh-vbz-majorticker{outline-style:none !important}.sc-stzh-vbz-majorticker-h .stzh-fylingfocus-focused.sc-stzh-vbz-majorticker::-moz-focus-inner{border:0 !important}.stzh-vbz-majorticker__ghettobox.sc-stzh-vbz-majorticker{--stzh-base-invert-color-rgb:var(--stzh-color-black-rgb);--color:var(--stzh-color-black);--background-color:var(--stzh-color-coral)}";const c=class{constructor(i){t(this,i);this.stzhDisturbanceFetched=s(this,"stzhDisturbanceFetched",7);this.disturbance=null;this.onGhettoboxOpen=()=>{this.ghettoboxShown=true};this.onGhettoboxClose=()=>{this.ghettoboxShown=false};this.api="https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}";this.data="";this.moreInfoLink="https://zvv.ch/zvv/{lang}/fahrplan/vl.html?himIds={id}";this.dateAdapter=undefined;this.localization=undefined;this.ghettoboxCloseTimeKey=undefined;this.ghettoboxShown=true}async getGhettoboxShown(){return this.ghettoboxShown}async getDisturbance(){return this.disturbance}async apiWatcher(t){if(!t){return}let s=this.api.replace(/\{lang\}/,this.localization.$locale);s=s+(s.includes("?")?"&":"?")+Date.now();const{data:i}=await o.get(s);this.data=i}dateAdapterWatcher(t){if(!t){this.dateAdapter=window.stzhComponents.utils.createFormatParseAdapter(this.localization.$formats,this.localization.$globals)}}async dataWatcher(t){var s,i;if(typeof t==="string"){this._data=JSON.parse(t)}else{this._data=t}const e=(i=(s=this._data)===null||s===void 0?void 0:s.Message)===null||i===void 0?void 0:i.find((t=>t.category===a.DISTURBANCE_INFORMATION&&t.baseType===a.BASE_TYPE_GLOBAL));if(e){const t=e.channel.filter((t=>t.name===a.CHANNEL_TICKER&&t.url)).map((t=>t.url)).reduce(((t,s)=>t.concat(s)),[]);const s=t.find((t=>t.url.indexOf(a.CHANNEL_INFO_URL_FILTER)!==-1));this.disturbance={id:e.id,head:e.head,text:h(e.text),startDate:new Date(`${e.sDate}T${e.sTime}+02:00`),endDate:new Date(`${e.eDate}T${e.eTime}+02:00`),altStart:e.altStart,altEnd:e.altEnd,infoUrl:s}}this.stzhDisturbanceFetched.emit({component:"stzh-vbz-majorticker",disturbance:this.disturbance})}async componentWillLoad(){if(!this.localization){this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"vbz-majorticker")}this.dateAdapterWatcher(this.dateAdapter);if(this.data){await this.dataWatcher(this.data)}else{await this.apiWatcher(this.api)}}render(){const t={"stzh-vbz-majorticker":true};return i(e,{hidden:!this.disturbance||!this.ghettoboxShown},i("div",{class:t},this.disturbance&&i("stzh-ghettobox",{onStzhOpen:this.onGhettoboxOpen,onStzhClose:this.onGhettoboxClose,class:"stzh-vbz-majorticker__ghettobox",hideClose:true,closeTimeKey:this.ghettoboxCloseTimeKey,mainTitle:this.disturbance.head,publishDate:this.disturbance.startDate},i("stzh-richtext",{innerHTML:this.disturbance.text}),this.disturbance.infoUrl?i("stzh-button",{slot:"button",href:this.disturbance.infoUrl.url},this.disturbance.infoUrl.name):i("stzh-button",{slot:"button",target:"_blank",href:this.moreInfoLink.replace(/\{lang\}/,this.localization.$locale).replace(/\{id\}/,this.disturbance.id)},this.localization.moreInfo))))}get element(){return r(this)}static get watchers(){return{api:["apiWatcher"],dateAdapter:["dateAdapterWatcher"],data:["dataWatcher"]}}};c.style=n;export{c as stzh_vbz_majorticker};
2
+ //# sourceMappingURL=p-0ba7ce34.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["stzhVbzMajortickerCss","StzhVbzMajorticker","this","disturbance","onGhettoboxOpen","ghettoboxShown","onGhettoboxClose","getGhettoboxShown","getDisturbance","apiWatcher","newValue","apiUrl","api","replace","localization","$locale","includes","Date","now","data","axios","get","dateAdapterWatcher","dateAdapter","window","stzhComponents","utils","createFormatParseAdapter","$formats","$globals","dataWatcher","_data","JSON","parse","bigDisturbance","_b","_a","Message","find","message","category","VBZ","DISTURBANCE_INFORMATION","baseType","BASE_TYPE_GLOBAL","urls","channel","filter","name","CHANNEL_TICKER","url","map","reduce","a","b","concat","infoUrl","indexOf","CHANNEL_INFO_URL_FILTER","id","head","text","createParagraphsFromBrs","startDate","sDate","sTime","endDate","eDate","eTime","altStart","altEnd","stzhDisturbanceFetched","emit","component","componentWillLoad","fetchTranslations","element","render","classes","h","Host","hidden","class","onStzhOpen","onStzhClose","hideClose","closeTimeKey","ghettoboxCloseTimeKey","mainTitle","publishDate","innerHTML","slot","href","target","moreInfoLink","moreInfo"],"sources":["src/components/stzh-vbz-majorticker/stzh-vbz-majorticker.scss?tag=stzh-vbz-majorticker&encapsulation=scoped","src/components/stzh-vbz-majorticker/stzh-vbz-majorticker.tsx"],"sourcesContent":[":host {\n}\n\n.stzh-vbz-majorticker {\n &__ghettobox {\n // --stzh-base-invert-color: #{$colorBlack};\n // --stzh-base-invert-color72: #{$colorBlack72};\n // --stzh-base-invert-color32: #{$colorBlack32};\n // --stzh-base-invert-color16: #{$colorBlack16};\n\n --stzh-base-invert-color-rgb: #{$colorBlackRgb};\n --color: #{$colorBlack};\n --background-color: #{$colorCoral};\n }\n}\n","import {\n Component,\n Host,\n h,\n Prop,\n State,\n Watch,\n Element,\n Event,\n EventEmitter,\n Method\n} from \"@stencil/core\";\n\nimport axios from \"axios\";\n\nimport { createParagraphsFromBrs } from \"../../utils/string-utils\";\nimport { StzhLocaleAdapter } from \"../../utils/date-adapter\";\n\nimport { StzhVbzMajortickerLocalizedText } from \"./stzh-vbz-majorticker.localization\";\n\nimport {\n VBZ,\n StzhVbzMajortickerDisturbanceFetchedEvent,\n StzhVbzMajortickerDisturbance,\n VbzTickerInfoUrl\n} from \"../../index\";\n\n/**\n */\n@Component({\n tag: \"stzh-vbz-majorticker\",\n styleUrl: \"stzh-vbz-majorticker.scss\",\n scoped: true\n})\nexport class StzhVbzMajorticker {\n /** API URL (`{lang}` is replaced in the URL) */\n @Prop() api: string = \"https://fpbe.zvv.ch/restproxy/himsearch?format=json&accessId=unic&channels=ticker&additionalfields=tickers:VBZ&orderBy=LMOD_DESC&lang={lang}\";\n\n /** Data to pass in directly (alternative for API call) */\n @Prop() data: any = \"\";\n private _data: any;\n\n /** More info link (`{lang}` and `{id}` are replaced in the URL) */\n @Prop() moreInfoLink: string = \"https://zvv.ch/zvv/{lang}/fahrplan/vl.html?himIds={id}\";\n\n /**\n * Date adapter, for custom parsing/formatting.\n * Must be object with a `parse` function which accepts a `string` and returns a `Date`,\n * and a `format` function which accepts a `Date` and returns a `string`.\n */\n @Prop() dateAdapter: StzhLocaleAdapter;\n\n /** Translation strings. */\n @Prop() localization: StzhVbzMajortickerLocalizedText;\n\n /** Overwrite ghettobox close time cookie option if needed */\n @Prop() ghettoboxCloseTimeKey: string;\n\n /** Whether ghettobox is shown (if has not been closed before) */\n @State() ghettoboxShown: boolean = true;\n\n @Element() element: HTMLStzhVbzMajortickerElement;\n\n /** Event when major disturbance was fetched */\n @Event() stzhDisturbanceFetched: EventEmitter<StzhVbzMajortickerDisturbanceFetchedEvent>;\n\n /** Return whether ghettobox is shown (if has not been closed before) */\n @Method()\n async getGhettoboxShown() {\n return this.ghettoboxShown;\n }\n\n /** Return fetched disturbance */\n @Method()\n async getDisturbance() {\n return this.disturbance;\n }\n\n @Watch(\"api\")\n async apiWatcher(newValue: string) {\n if (!newValue) {\n return;\n }\n\n let apiUrl = this.api.replace(/\\{lang\\}/, this.localization.$locale)\n apiUrl = apiUrl + (apiUrl.includes(\"?\") ? \"&\" : \"?\") + Date.now();\n\n // load data from API\n const { data } = await axios.get(apiUrl);\n\n this.data = data;\n }\n\n @Watch(\"dateAdapter\")\n dateAdapterWatcher(newValue: StzhLocaleAdapter) {\n if (!newValue) {\n this.dateAdapter = window.stzhComponents.utils.createFormatParseAdapter(\n this.localization.$formats,\n this.localization.$globals\n );\n }\n }\n\n @Watch(\"data\")\n async dataWatcher(newValue: any) {\n if (typeof newValue === \"string\") {\n this._data = JSON.parse(newValue);\n } else {\n this._data = newValue;\n }\n\n const bigDisturbance = this._data?.Message\n ?.find(message => message.category === VBZ.DISTURBANCE_INFORMATION && message.baseType === VBZ.BASE_TYPE_GLOBAL);\n\n if (bigDisturbance) {\n const urls: VbzTickerInfoUrl[] = bigDisturbance.channel\n .filter(channel => channel.name === VBZ.CHANNEL_TICKER && channel.url)\n .map(channel => channel.url)\n .reduce((a, b) => a.concat(b), []);\n\n const infoUrl = urls\n .find(url => url.url.indexOf(VBZ.CHANNEL_INFO_URL_FILTER) !== -1);\n\n this.disturbance = {\n id: bigDisturbance.id,\n head: bigDisturbance.head,\n text: createParagraphsFromBrs(bigDisturbance.text),\n startDate: new Date(`${bigDisturbance.sDate}T${bigDisturbance.sTime}+02:00`),\n endDate: new Date(`${bigDisturbance.eDate}T${bigDisturbance.eTime}+02:00`),\n altStart: bigDisturbance.altStart,\n altEnd: bigDisturbance.altEnd,\n infoUrl: infoUrl\n };\n }\n\n this.stzhDisturbanceFetched.emit({\n component: \"stzh-vbz-majorticker\",\n disturbance: this.disturbance\n })\n }\n\n private disturbance: StzhVbzMajortickerDisturbance = null;\n\n private onGhettoboxOpen = () => {\n this.ghettoboxShown = true;\n }\n\n private onGhettoboxClose = () => {\n this.ghettoboxShown = false;\n }\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"vbz-majorticker\");\n }\n\n this.dateAdapterWatcher(this.dateAdapter);\n\n if (this.data) {\n await this.dataWatcher(this.data);\n } else {\n await this.apiWatcher(this.api);\n }\n }\n\n render() {\n const classes = {\n \"stzh-vbz-majorticker\": true\n };\n\n return (\n <Host hidden={!this.disturbance || !this.ghettoboxShown}>\n <div class={classes}>\n {this.disturbance &&\n <stzh-ghettobox\n onStzhOpen={this.onGhettoboxOpen}\n onStzhClose={this.onGhettoboxClose}\n class=\"stzh-vbz-majorticker__ghettobox\"\n hideClose={true}\n closeTimeKey={this.ghettoboxCloseTimeKey}\n mainTitle={this.disturbance.head}\n publishDate={this.disturbance.startDate}\n >\n <stzh-richtext innerHTML={this.disturbance.text}></stzh-richtext>\n {this.disturbance.infoUrl ?\n <stzh-button\n slot=\"button\"\n href={this.disturbance.infoUrl.url}\n >\n {this.disturbance.infoUrl.name}\n </stzh-button>\n :\n <stzh-button\n slot=\"button\"\n target=\"_blank\"\n href={this.moreInfoLink\n .replace(/\\{lang\\}/, this.localization.$locale)\n .replace(/\\{id\\}/, this.disturbance.id)}\n >\n {this.localization.moreInfo}\n </stzh-button>\n }\n </stzh-ghettobox>\n }\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"6KAAA,MAAMA,EAAwB,0rC,MCkCjBC,EAAkB,M,wFA2GrBC,KAAAC,YAA6C,KAE7CD,KAAAE,gBAAkB,KACxBF,KAAKG,eAAiB,IAAI,EAGpBH,KAAAI,iBAAmB,KACzBJ,KAAKG,eAAiB,KAAK,E,SAhHP,+I,UAGF,G,kBAIW,yD,gHAgBI,I,CASnC,uBAAME,GACJ,OAAOL,KAAKG,c,CAKd,oBAAMG,GACJ,OAAON,KAAKC,W,CAId,gBAAMM,CAAWC,GACf,IAAKA,EAAU,CACb,M,CAGF,IAAIC,EAAST,KAAKU,IAAIC,QAAQ,WAAYX,KAAKY,aAAaC,SAC5DJ,EAASA,GAAUA,EAAOK,SAAS,KAAO,IAAM,KAAOC,KAAKC,MAG5D,MAAMC,KAAEA,SAAeC,EAAMC,IAAIV,GAEjCT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