@oiz/stzh-components 3.0.0-beta1 → 3.0.0-beta2

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 (187) hide show
  1. package/dist/cjs/{app-globals-d508a3bc.js → app-globals-4968ae1c.js} +2 -2
  2. package/dist/cjs/{app-globals-d508a3bc.js.map → app-globals-4968ae1c.js.map} +1 -1
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/stzh-badge_3.cjs.entry.js +1 -1
  5. package/dist/cjs/stzh-badge_3.cjs.entry.js.map +1 -1
  6. package/dist/cjs/stzh-components.cjs.js +2 -2
  7. package/dist/cjs/stzh-cspace.cjs.entry.js +1 -1
  8. package/dist/cjs/stzh-cspace.cjs.entry.js.map +1 -1
  9. package/dist/cjs/stzh-cta.cjs.entry.js +1 -1
  10. package/dist/cjs/stzh-cta.cjs.entry.js.map +1 -1
  11. package/dist/cjs/stzh-gallery.cjs.entry.js +13 -10
  12. package/dist/cjs/stzh-gallery.cjs.entry.js.map +1 -1
  13. package/dist/cjs/stzh-header.cjs.entry.js +1 -1
  14. package/dist/cjs/stzh-header.cjs.entry.js.map +1 -1
  15. package/dist/cjs/stzh-pagebottom.cjs.entry.js +15 -9
  16. package/dist/cjs/stzh-pagebottom.cjs.entry.js.map +1 -1
  17. package/dist/cjs/{stzh-share.cjs.entry.js → stzh-print_2.cjs.entry.js} +53 -11
  18. package/dist/cjs/stzh-print_2.cjs.entry.js.map +1 -0
  19. package/dist/cjs/stzh-skin-portal-mitwirken.cjs.entry.js +1 -1
  20. package/dist/cjs/stzh-skin-portal-mitwirken.cjs.entry.js.map +1 -1
  21. package/dist/cjs/stzh-sticky-actions.cjs.entry.js +15 -9
  22. package/dist/cjs/stzh-sticky-actions.cjs.entry.js.map +1 -1
  23. package/dist/cjs/stzh-sticky.cjs.entry.js +13 -4
  24. package/dist/cjs/stzh-sticky.cjs.entry.js.map +1 -1
  25. package/dist/cjs/stzh-tooltip.cjs.entry.js +2 -1
  26. package/dist/cjs/stzh-tooltip.cjs.entry.js.map +1 -1
  27. package/dist/collection/assets/i18n/de.json +3 -0
  28. package/dist/collection/assets/i18n/en.json +3 -0
  29. package/dist/collection/assets/media/icons/mono/facebook.svg +1 -1
  30. package/dist/collection/assets/media/icons/mono/linkedin.svg +1 -1
  31. package/dist/collection/assets/media/icons/mono/mail.svg +1 -1
  32. package/dist/collection/assets/media/icons/mono/xing.svg +1 -1
  33. package/dist/collection/assets/meta/icons-preview.html +4 -4
  34. package/dist/collection/components/stzh-button/stzh-button.css +1 -1
  35. package/dist/collection/components/stzh-cspace/stzh-cspace.css +11 -0
  36. package/dist/collection/components/stzh-cta/stzh-cta.css +1 -1
  37. package/dist/collection/components/stzh-cta/stzh-cta.js +1 -1
  38. package/dist/collection/components/stzh-cta/stzh-cta.js.map +1 -1
  39. package/dist/collection/components/stzh-gallery/stzh-gallery.e2e.js +1 -0
  40. package/dist/collection/components/stzh-gallery/stzh-gallery.e2e.js.map +1 -1
  41. package/dist/collection/components/stzh-gallery/stzh-gallery.js +32 -9
  42. package/dist/collection/components/stzh-gallery/stzh-gallery.js.map +1 -1
  43. package/dist/collection/components/stzh-gallery/stzh-gallery.stories.js +9 -0
  44. package/dist/collection/components/stzh-header/stzh-header.js +1 -1
  45. package/dist/collection/components/stzh-header/stzh-header.js.map +1 -1
  46. package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.css +54 -13
  47. package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.e2e.js +2 -1
  48. package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.e2e.js.map +1 -1
  49. package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.js +56 -12
  50. package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.js.map +1 -1
  51. package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.localization.js +2 -0
  52. package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.localization.js.map +1 -0
  53. package/dist/collection/components/stzh-pagebottom/stzh-pagebottom.stories.js +87 -9
  54. package/dist/collection/components/stzh-scrollup/stzh-scrollup.stories.js +20 -18
  55. package/dist/collection/components/stzh-share/stzh-share.css +1 -43
  56. package/dist/collection/components/stzh-share/stzh-share.js +10 -10
  57. package/dist/collection/components/stzh-share/stzh-share.js.map +1 -1
  58. package/dist/collection/components/stzh-skin-portal-mitwirken/stzh-skin-portal-mitwirken.css +10 -0
  59. package/dist/collection/components/stzh-sticky/stzh-sticky.css +1 -1
  60. package/dist/collection/components/stzh-sticky/stzh-sticky.js +13 -4
  61. package/dist/collection/components/stzh-sticky/stzh-sticky.js.map +1 -1
  62. package/dist/collection/components/stzh-sticky-actions/stzh-sticky-actions.js +15 -9
  63. package/dist/collection/components/stzh-sticky-actions/stzh-sticky-actions.js.map +1 -1
  64. package/dist/collection/components/stzh-sticky-actions/stzh-sticky-actions.stories.js +20 -18
  65. package/dist/collection/components/stzh-tooltip/stzh-tooltip.css +3 -0
  66. package/dist/collection/components/stzh-tooltip/stzh-tooltip.js +19 -0
  67. package/dist/collection/components/stzh-tooltip/stzh-tooltip.js.map +1 -1
  68. package/dist/components/index.js +1 -1
  69. package/dist/components/stzh-button2.js +1 -1
  70. package/dist/components/stzh-button2.js.map +1 -1
  71. package/dist/components/stzh-cspace.js +1 -1
  72. package/dist/components/stzh-cspace.js.map +1 -1
  73. package/dist/components/stzh-cta.js +1 -1
  74. package/dist/components/stzh-cta.js.map +1 -1
  75. package/dist/components/stzh-gallery.js +16 -11
  76. package/dist/components/stzh-gallery.js.map +1 -1
  77. package/dist/components/stzh-header.js +1 -1
  78. package/dist/components/stzh-header.js.map +1 -1
  79. package/dist/components/stzh-pagebottom.js +39 -12
  80. package/dist/components/stzh-pagebottom.js.map +1 -1
  81. package/dist/components/stzh-print.js +1 -58
  82. package/dist/components/stzh-print.js.map +1 -1
  83. package/dist/{esm/stzh-print.entry.js → components/stzh-print2.js} +25 -11
  84. package/dist/components/stzh-print2.js.map +1 -0
  85. package/dist/components/stzh-share2.js +23 -11
  86. package/dist/components/stzh-share2.js.map +1 -1
  87. package/dist/components/stzh-skin-portal-mitwirken.js +1 -1
  88. package/dist/components/stzh-skin-portal-mitwirken.js.map +1 -1
  89. package/dist/components/stzh-sticky-actions.js +15 -9
  90. package/dist/components/stzh-sticky-actions.js.map +1 -1
  91. package/dist/components/stzh-sticky2.js +13 -4
  92. package/dist/components/stzh-sticky2.js.map +1 -1
  93. package/dist/components/stzh-tooltip2.js +3 -1
  94. package/dist/components/stzh-tooltip2.js.map +1 -1
  95. package/dist/esm/{app-globals-984d1c64.js → app-globals-924beb17.js} +2 -2
  96. package/dist/esm/{app-globals-984d1c64.js.map → app-globals-924beb17.js.map} +1 -1
  97. package/dist/esm/loader.js +2 -2
  98. package/dist/esm/stzh-badge_3.entry.js +1 -1
  99. package/dist/esm/stzh-badge_3.entry.js.map +1 -1
  100. package/dist/esm/stzh-components.js +2 -2
  101. package/dist/esm/stzh-cspace.entry.js +1 -1
  102. package/dist/esm/stzh-cspace.entry.js.map +1 -1
  103. package/dist/esm/stzh-cta.entry.js +1 -1
  104. package/dist/esm/stzh-cta.entry.js.map +1 -1
  105. package/dist/esm/stzh-gallery.entry.js +13 -10
  106. package/dist/esm/stzh-gallery.entry.js.map +1 -1
  107. package/dist/esm/stzh-header.entry.js +1 -1
  108. package/dist/esm/stzh-header.entry.js.map +1 -1
  109. package/dist/esm/stzh-pagebottom.entry.js +15 -9
  110. package/dist/esm/stzh-pagebottom.entry.js.map +1 -1
  111. package/dist/esm/{stzh-share.entry.js → stzh-print_2.entry.js} +54 -13
  112. package/dist/esm/stzh-print_2.entry.js.map +1 -0
  113. package/dist/esm/stzh-skin-portal-mitwirken.entry.js +1 -1
  114. package/dist/esm/stzh-skin-portal-mitwirken.entry.js.map +1 -1
  115. package/dist/esm/stzh-sticky-actions.entry.js +15 -9
  116. package/dist/esm/stzh-sticky-actions.entry.js.map +1 -1
  117. package/dist/esm/stzh-sticky.entry.js +13 -4
  118. package/dist/esm/stzh-sticky.entry.js.map +1 -1
  119. package/dist/esm/stzh-tooltip.entry.js +2 -1
  120. package/dist/esm/stzh-tooltip.entry.js.map +1 -1
  121. package/dist/stzh-components/assets/i18n/de.json +3 -0
  122. package/dist/stzh-components/assets/i18n/en.json +3 -0
  123. package/dist/stzh-components/assets/media/icons/mono/facebook.svg +1 -1
  124. package/dist/stzh-components/assets/media/icons/mono/linkedin.svg +1 -1
  125. package/dist/stzh-components/assets/media/icons/mono/mail.svg +1 -1
  126. package/dist/stzh-components/assets/media/icons/mono/xing.svg +1 -1
  127. package/dist/stzh-components/assets/meta/icons-preview.html +4 -4
  128. package/dist/stzh-components/p-2e713d1e.entry.js +2 -0
  129. package/dist/stzh-components/p-2e713d1e.entry.js.map +1 -0
  130. package/dist/stzh-components/p-31a45529.entry.js +2 -0
  131. package/dist/stzh-components/p-31a45529.entry.js.map +1 -0
  132. package/dist/stzh-components/p-33b46d08.entry.js +2 -0
  133. package/dist/stzh-components/{p-a2656f84.entry.js.map → p-33b46d08.entry.js.map} +1 -1
  134. package/dist/stzh-components/{p-52078c0b.entry.js → p-3641eb0c.entry.js} +2 -2
  135. package/dist/stzh-components/p-3641eb0c.entry.js.map +1 -0
  136. package/dist/stzh-components/p-475fc161.entry.js +2 -0
  137. package/dist/stzh-components/p-475fc161.entry.js.map +1 -0
  138. package/dist/stzh-components/{p-83978293.entry.js → p-5511087f.entry.js} +2 -2
  139. package/dist/stzh-components/p-5511087f.entry.js.map +1 -0
  140. package/dist/stzh-components/p-705d5931.entry.js +2 -0
  141. package/dist/stzh-components/{p-35b78231.entry.js.map → p-705d5931.entry.js.map} +1 -1
  142. package/dist/stzh-components/{p-e2485377.js → p-862a98f9.js} +2 -2
  143. package/dist/stzh-components/{p-879795a9.entry.js → p-bf79dbd0.entry.js} +2 -2
  144. package/dist/stzh-components/{p-879795a9.entry.js.map → p-bf79dbd0.entry.js.map} +1 -1
  145. package/dist/stzh-components/p-d2f7c020.entry.js +2 -0
  146. package/dist/stzh-components/p-d2f7c020.entry.js.map +1 -0
  147. package/dist/stzh-components/p-fa82219c.entry.js +2 -0
  148. package/dist/stzh-components/p-fa82219c.entry.js.map +1 -0
  149. package/dist/stzh-components/{p-fa3c5519.entry.js → p-fb9cc8a7.entry.js} +2 -2
  150. package/dist/stzh-components/p-fb9cc8a7.entry.js.map +1 -0
  151. package/dist/stzh-components/stzh-components.css +1 -1
  152. package/dist/stzh-components/stzh-components.esm.js +1 -1
  153. package/dist/stzh-components/stzh-components.esm.js.map +1 -1
  154. package/dist/types/components/stzh-cta/stzh-cta.d.ts +1 -1
  155. package/dist/types/components/stzh-gallery/stzh-gallery.d.ts +5 -0
  156. package/dist/types/components/stzh-pagebottom/stzh-pagebottom.d.ts +11 -1
  157. package/dist/types/components/stzh-pagebottom/stzh-pagebottom.localization.d.ts +4 -0
  158. package/dist/types/components/stzh-sticky-actions/stzh-sticky-actions.d.ts +2 -2
  159. package/dist/types/components/stzh-tooltip/stzh-tooltip.d.ts +2 -0
  160. package/dist/types/components.d.ts +40 -6
  161. package/dist/vscode-data.json +25 -5
  162. package/package.json +1 -1
  163. package/dist/cjs/stzh-print.cjs.entry.js +0 -52
  164. package/dist/cjs/stzh-print.cjs.entry.js.map +0 -1
  165. package/dist/cjs/stzh-share.cjs.entry.js.map +0 -1
  166. package/dist/collection/patterns/print/print.e2e.js +0 -18
  167. package/dist/collection/patterns/print/print.e2e.js.map +0 -1
  168. package/dist/esm/stzh-print.entry.js.map +0 -1
  169. package/dist/esm/stzh-share.entry.js.map +0 -1
  170. package/dist/stzh-components/p-2676b9db.entry.js +0 -2
  171. package/dist/stzh-components/p-2676b9db.entry.js.map +0 -1
  172. package/dist/stzh-components/p-2afe2028.entry.js +0 -2
  173. package/dist/stzh-components/p-2afe2028.entry.js.map +0 -1
  174. package/dist/stzh-components/p-35b78231.entry.js +0 -2
  175. package/dist/stzh-components/p-51be8f59.entry.js +0 -2
  176. package/dist/stzh-components/p-51be8f59.entry.js.map +0 -1
  177. package/dist/stzh-components/p-52078c0b.entry.js.map +0 -1
  178. package/dist/stzh-components/p-83978293.entry.js.map +0 -1
  179. package/dist/stzh-components/p-89de4375.entry.js +0 -2
  180. package/dist/stzh-components/p-89de4375.entry.js.map +0 -1
  181. package/dist/stzh-components/p-a2656f84.entry.js +0 -2
  182. package/dist/stzh-components/p-c67dcd7a.entry.js +0 -2
  183. package/dist/stzh-components/p-c67dcd7a.entry.js.map +0 -1
  184. package/dist/stzh-components/p-e142e3e5.entry.js +0 -2
  185. package/dist/stzh-components/p-e142e3e5.entry.js.map +0 -1
  186. package/dist/stzh-components/p-fa3c5519.entry.js.map +0 -1
  187. /package/dist/stzh-components/{p-e2485377.js.map → p-862a98f9.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"stzh-pagebottom.entry.cjs.js","mappings":";;;;;;;;AAAA,MAAM,iBAAiB,GAAG,gsEAAgsE;;MCmB7sE,cAAc;;;sBAEI,EAAE;;;yBAYE,KAAK;;;oBASX,8BAA8B;;;EAWzD,MAAM;IACJ,MAAM,QAAQ,GAAYA,aAAO,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAExD,MAAM,OAAO,GAAG;MACd,iBAAiB,EAAE,IAAI;KACxB,CAAC;IAEF,QACEC,QAACC,UAAI,QACHD,iBAAK,KAAK,EAAE,OAAO,IAChB,CAAC,IAAI,CAAC,aAAa;MAClBA,iBAAK,KAAK,EAAC,gCAAgC,IACxC,IAAI,CAAC,UAAU;QACdA,iBAAK,KAAK,EAAC,8BAA8B,IAAE,IAAI,CAAC,UAAU,CAAO,EAEnEA,wBACE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAClB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAC5B,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAClC,QAAQ,EAAE,IAAI,CAAC,aAAa,GAChB,CACV,EAGP,QAAQ;MACPA,iBAAK,KAAK,EAAC,uBAAuB,IAChCA,eACE,IAAI,EAAE,IAAI,CAAC,QAAQ,EACnB,KAAK,EAAC,4BAA4B,iBACrB,IAAI,CAAC,eAAe,IAAI,aAAa,IAElDA,kBAAM,IAAI,EAAC,MAAM,GAAQ,CACvB,CACA,CAEJ,CACD,EACP;GACH;;;;;;;","names":["hasSlot","h","Host"],"sources":["src/components/stzh-pagebottom/stzh-pagebottom.scss?tag=stzh-pagebottom&encapsulation=scoped","src/components/stzh-pagebottom/stzh-pagebottom.tsx"],"sourcesContent":[":host {\n @media print {\n display: none;\n }\n\n ::slotted([slot=\"logo\"]) {\n height: 38px;\n }\n}\n\n.stzh-pagebottom {\n display: flex;\n flex-direction: column;\n\n @include mq($from: small) {\n flex-direction: row;\n }\n\n &__share-title {\n @include fontCurve('caption');\n\t\tmargin-bottom: space('small');\n }\n\n &__logo {\n @include mq($from: small) {\n margin-left: auto;\n }\n }\n\n &__logo-link {\n &:not(:empty) {\n display: block;\n margin-top: space('xlarge');\n\n @include mq($from: small) {\n margin-top: 0;\n margin-left: space('xlarge');\n }\n }\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n} from \"@stencil/core\";\n\nimport { ShareService } from \"../../index\";\nimport { hasSlot } from \"../../utils/utils\";\n\n/**\n * @slot logo - Slot for a logo image\n */\n@Component({\n tag: \"stzh-pagebottom\",\n styleUrl: \"stzh-pagebottom.scss\",\n scoped: true\n})\nexport class StzhPagebottom {\n /** Share Title */\n @Prop() shareTitle: string = \"\";\n\n /** URL of current site (uses full URL by default) */\n @Prop() shareUrl: string;\n\n /**\n * Array of enabled share buttons.\n * Possible services: `facebook` / `twitter` / `linkedin` / `xing` / `mail`\n */\n @Prop() shareServices: ShareService[] | string;\n\n /** Whether to show share */\n @Prop() shareDisabled: boolean = false;\n\n /** Overwrite share mail subject translation */\n @Prop() shareMailSubject: string;\n\n /** Overwrite share mail body translation */\n @Prop() shareMailBody: string;\n\n /** Logo href */\n @Prop() logoHref: string = \"https://www.stadt-zuerich.ch\";\n\n /**\n * For Adobe Analytics.\n * Will be rendered as value of `s-object-id` attribute to the logo link element.\n * Default value will be \"Footer Logo\"\n */\n @Prop() logoAnalyticsId: string;\n\n @Element() element: HTMLStzhPagebottomElement;\n\n render() {\n const logoUsed: boolean = hasSlot(this.element, \"logo\");\n\n const classes = {\n \"stzh-pagebottom\": true\n };\n\n return (\n <Host>\n <div class={classes}>\n {!this.shareDisabled &&\n <div class=\"stzh-pagebottom__share-wrapper\">\n {this.shareTitle &&\n <div class=\"stzh-pagebottom__share-title\">{this.shareTitle}</div>\n }\n <stzh-share\n url={this.shareUrl}\n services={this.shareServices}\n mailSubject={this.shareMailSubject}\n mailBody={this.shareMailBody}\n ></stzh-share>\n </div>\n }\n\n {logoUsed &&\n <div class=\"stzh-pagebottom__logo\">\n <a\n href={this.logoHref}\n class=\"stzh-pagebottom__logo-link\"\n s-object-id={this.logoAnalyticsId || \"Footer Logo\"}\n >\n <slot name=\"logo\"></slot>\n </a>\n </div>\n }\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"stzh-pagebottom.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,iBAAiB,GAAG,m/GAAm/G;;MCqBhgH,cAAc;;;;sBAKI,EAAE;;;;;;oBAqBJ,8BAA8B;;;;EAoBzD,MAAM,iBAAiB;IACrB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;MACtB,IAAI,CAAC,YAAY,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;KACrG;GACF;EAED,MAAM;;;IAIJ,MAAM,OAAO,GAAG;MACd,iBAAiB,EAAE,IAAI;KACxB,CAAC;IAEF,QACEA,QAACC,UAAI,QACHD,iBAAK,KAAK,EAAE,OAAO,IACjBA,iBAAK,KAAK,EAAC,0BAA0B,IACnCA,iBAAK,KAAK,EAAC,uBAAuB,IAC/B,IAAI,CAAC,SAAS;MACbA,iBAAK,KAAK,EAAC,wBAAwB,IACjCA,4BACEA,yBACE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,EACnC,OAAO,EAAC,gBAAgB,EACxB,IAAI,EAAC,OAAO,EACZ,aAAa,EAAE,IAAI,EACnB,cAAc,EAAE,IAAI,EACpB,WAAW,EAAE,IAAI,CAAC,gBAAgB,GACrB,CACJ,CACT,EAGP,CAAC,IAAI,CAAC,aAAa;MAClBA,iBAAK,KAAK,EAAC,gCAAgC,IACxC,IAAI,CAAC,UAAU;QACdA,iBAAK,KAAK,EAAC,8BAA8B,IAAE,IAAI,CAAC,UAAU,CAAO,EAEnEA,wBACE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAClB,QAAQ,EAAE,IAAI,CAAC,aAAa,EAC5B,WAAW,EAAE,IAAI,CAAC,gBAAgB,EAClC,QAAQ,EAAE,IAAI,CAAC,aAAa,GAChB,CACV,CAEJ,EAENA,iBAAK,KAAK,EAAC,iCAAiC,IAC1CA,kBAAM,IAAI,EAAC,gBAAgB,GAAQ,CAC/B,CACF,CAaF,CACD,EACP;GACH;;;;;;;","names":["h","Host"],"sources":["src/components/stzh-pagebottom/stzh-pagebottom.scss?tag=stzh-pagebottom&encapsulation=scoped","src/components/stzh-pagebottom/stzh-pagebottom.tsx"],"sourcesContent":[":host {\n @media print {\n display: none;\n }\n\n // ::slotted([slot=\"logo\"]) {\n // height: 38px;\n // }\n}\n\n.stzh-pagebottom {\n &__wrapper {\n display: grid;\n }\n\n &__left {\n display: flex;\n flex-direction: column;\n flex-wrap: wrap;\n row-gap: space('xsmall');\n\n @include mq($from: small) {\n flex-direction: row;\n }\n }\n\n &__share-title {\n @include fontCurve('caption');\n\t\tmargin-bottom: space('small');\n }\n\n &__sticky-actions {\n margin-left: auto;\n margin-top: space('medium');\n\n --stzh-button-white-space: nowrap;\n\n @include mq($from: small) {\n margin-top: 0;\n }\n }\n\n &__print,\n &__share-wrapper {\n flex-shrink: 0;\n }\n\n &__share-wrapper {\n margin-left: -10px;\n\n @include mq($from: small) {\n margin-left: 0;\n }\n }\n\n &__print {\n @include mq($from: small) {\n margin-right: space('xxlarge');\n }\n\n @include mq($from: medium) {\n @include spaceCurve('margin-right', 'big');\n }\n }\n\n // &__logo {\n // @include mq($from: small) {\n // margin-left: auto;\n // }\n // }\n\n // &__logo-link {\n // &:not(:empty) {\n // display: block;\n // margin-top: space('xlarge');\n\n // @include mq($from: small) {\n // margin-top: 0;\n // margin-left: space('xlarge');\n // }\n // }\n // }\n\n &:has(#{&}__sticky-actions:not(:empty)) &__wrapper {\n grid-template-columns: auto;\n\n @include mq($from: small) {\n grid-template-columns: minmax(0, 1fr) calc(110px + 44px + #{space('small')} + #{space('medium')});\n }\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n} from \"@stencil/core\";\n\nimport { ShareService } from \"../../index\";\n// import { hasSlot } from \"../../utils/utils\";\n\nimport { StzhPagebottomLocalizedText } from \"./stzh-pagebottom.localization\";\n\n/**\n * @slot logo - Slot for a logo image\n */\n@Component({\n tag: \"stzh-pagebottom\",\n styleUrl: \"stzh-pagebottom.scss\",\n scoped: true\n})\nexport class StzhPagebottom {\n /** Translation strings. */\n @Prop() localization: StzhPagebottomLocalizedText;\n\n /** Share Title */\n @Prop() shareTitle: string = \"\";\n\n /** URL of current site (uses full URL by default) */\n @Prop() shareUrl: string;\n\n /**\n * Array of enabled share buttons.\n * Possible services: `facebook` / `twitter` / `linkedin` / `xing` / `mail`\n */\n @Prop() shareServices: ShareService[] | string;\n\n /** Whether to show share */\n @Prop({ reflect: true }) shareDisabled: boolean;\n\n /** Overwrite share mail subject translation */\n @Prop() shareMailSubject: string;\n\n /** Overwrite share mail body translation */\n @Prop() shareMailBody: string;\n\n /** Logo href */\n @Prop() logoHref: string = \"https://www.stadt-zuerich.ch\";\n\n /** Whether to show print button */\n @Prop({ reflect: true }) withPrint: boolean;\n\n /**\n * For Adobe Analytics.\n * Will be rendered as value of `s-object-id` attribute of the print button element.\n */\n @Prop() printAnalyticsId: string;\n\n /**\n * For Adobe Analytics.\n * Will be rendered as value of `s-object-id` attribute to the logo link element.\n * Default value will be \"Footer Logo\"\n */\n // @Prop() logoAnalyticsId: string;\n\n @Element() element: HTMLStzhPagebottomElement;\n\n async componentWillLoad() {\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"pagebottom\");\n }\n }\n\n render() {\n // const printUsed: boolean = hasSlot(this.element, \"print\");\n // const logoUsed: boolean = hasSlot(this.element, \"logo\");\n\n const classes = {\n \"stzh-pagebottom\": true\n };\n\n return (\n <Host>\n <div class={classes}>\n <div class=\"stzh-pagebottom__wrapper\">\n <div class=\"stzh-pagebottom__left\">\n {this.withPrint &&\n <div class=\"stzh-pagebottom__print\">\n <stzh-print>\n <stzh-button\n label={this.localization.printLabel}\n variant=\"tertiary-plain\"\n size=\"small\"\n noPaddingLeft={true}\n noPaddingRight={true}\n analyticsId={this.printAnalyticsId}\n ></stzh-button>\n </stzh-print>\n </div>\n }\n\n {!this.shareDisabled &&\n <div class=\"stzh-pagebottom__share-wrapper\">\n {this.shareTitle &&\n <div class=\"stzh-pagebottom__share-title\">{this.shareTitle}</div>\n }\n <stzh-share\n url={this.shareUrl}\n services={this.shareServices}\n mailSubject={this.shareMailSubject}\n mailBody={this.shareMailBody}\n ></stzh-share>\n </div>\n }\n </div>\n\n <div class=\"stzh-pagebottom__sticky-actions\">\n <slot name=\"sticky-actions\"></slot>\n </div>\n </div>\n\n {/* {logoUsed &&\n <div class=\"stzh-pagebottom__logo\">\n <a\n href={this.logoHref}\n class=\"stzh-pagebottom__logo-link\"\n s-object-id={this.logoAnalyticsId || \"Footer Logo\"}\n >\n <slot name=\"logo\"></slot>\n </a>\n </div>\n } */}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -6,7 +6,48 @@ const index = require('./index-92254d32.js');
6
6
  const utils = require('./utils-d0fff87f.js');
7
7
  const stringUtils = require('./string-utils-5dd70320.js');
8
8
 
9
- const stzhShareCss = ".sc-stzh-share-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-share-h{display:none}.sc-stzh-share-h *.sc-stzh-share,.sc-stzh-share-h *.sc-stzh-share::before,.sc-stzh-share-h *.sc-stzh-share::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-share-h .has-focus.sc-stzh-share{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-share-h .stzh-fylingfocus-focused.sc-stzh-share{outline-style:none !important}.sc-stzh-share-h .stzh-fylingfocus-focused.sc-stzh-share::-moz-focus-inner{border:0 !important}.stzh-share__list.sc-stzh-share{list-style:none;margin:0;padding:0;display:flex}.stzh-share__item.sc-stzh-share:not(:last-child){margin-right:var(--stzh-space-small)}.stzh-share__icon.sc-stzh-share{--size:var(--stzh-icon-size-xsmall)}.stzh-share__button.sc-stzh-share{color:var(--stzh-color-white);border-radius:var(--stzh-button-border-radius);display:grid;place-items:center;width:2.875rem;height:1.625rem;transition:background-color var(--stzh-base-transition-animation-speed)}.stzh-share__button.is-facebook.sc-stzh-share{background-color:#3b5998}.stzh-share__button.is-facebook.sc-stzh-share:hover{background-color:#23355B}.stzh-share__button.is-twitter.sc-stzh-share{background-color:#000000}.stzh-share__button.is-twitter.sc-stzh-share:hover{background-color:#404040}.stzh-share__button.is-linkedin.sc-stzh-share{background-color:#1485BD}.stzh-share__button.is-linkedin.sc-stzh-share:hover{background-color:#0C4F71}.stzh-share__button.is-xing.sc-stzh-share{background-color:#0E7574}.stzh-share__button.is-xing.sc-stzh-share:hover{background-color:#084645}.stzh-share__button.is-mail.sc-stzh-share{background-color:var(--stzh-color-primary)}.stzh-share__button.is-mail.sc-stzh-share:hover{background-color:var(--stzh-color-primary-hover)}";
9
+ const stzhPrintCss = ":host{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block;}:host[hidden]{display:none}:host *,:host *::before,:host *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}:host{display:contents}@media print{:host{display:none}}.stzh-print{display:contents}";
10
+
11
+ const StzhPrint = class {
12
+ constructor(hostRef) {
13
+ index.registerInstance(this, hostRef);
14
+ this.handleLinkClick = () => {
15
+ window.print();
16
+ };
17
+ this.init = () => {
18
+ const links = this.element.querySelectorAll("stzh-link, stzh-button");
19
+ links.forEach((link) => {
20
+ link.addEventListener('click', this.handleLinkClick);
21
+ utils.setPropsIfNull(link, {
22
+ icon: "print"
23
+ });
24
+ });
25
+ };
26
+ }
27
+ connectedCallback() {
28
+ this.init();
29
+ this.observer = new MutationObserver(this.init);
30
+ this.observer.observe(this.element, {
31
+ childList: true,
32
+ subtree: true
33
+ });
34
+ }
35
+ disconnectedCallback() {
36
+ if (this.observer) {
37
+ this.observer.disconnect();
38
+ }
39
+ }
40
+ render() {
41
+ const classes = {
42
+ "stzh-print": true
43
+ };
44
+ return (index.h(index.Host, null, index.h("div", { class: classes }, index.h("slot", null))));
45
+ }
46
+ get element() { return index.getElement(this); }
47
+ };
48
+ StzhPrint.style = stzhPrintCss;
49
+
50
+ const stzhShareCss = ".sc-stzh-share-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-share-h{display:none}.sc-stzh-share-h *.sc-stzh-share,.sc-stzh-share-h *.sc-stzh-share::before,.sc-stzh-share-h *.sc-stzh-share::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-share-h .has-focus.sc-stzh-share{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-share-h .stzh-fylingfocus-focused.sc-stzh-share{outline-style:none !important}.sc-stzh-share-h .stzh-fylingfocus-focused.sc-stzh-share::-moz-focus-inner{border:0 !important}.stzh-share__list.sc-stzh-share{list-style:none;margin:0;padding:0;display:flex}.stzh-share__item.sc-stzh-share:not(:last-child){margin-right:var(--stzh-space-xxsmall)}";
10
51
 
11
52
  // 280 - URL (always 24) = 256
12
53
  const MAX_TWEET_LENGTH = 256;
@@ -23,7 +64,7 @@ const StzhShare = class {
23
64
  this.mailSubject = undefined;
24
65
  this.mailBody = undefined;
25
66
  this.services = [
26
- "facebook", "twitter", "linkedin", "xing", "mail"
67
+ "mail", "facebook", "twitter", "linkedin", "xing"
27
68
  ];
28
69
  }
29
70
  servicesWatcher(newValue) {
@@ -52,6 +93,13 @@ const StzhShare = class {
52
93
  const twitterTitle = encodeURIComponent(stringUtils.abbreviateText(title, MAX_TWEET_LENGTH));
53
94
  const description = encodeURIComponent(utils.getMeta("description"));
54
95
  const serviceData = {
96
+ "mail": {
97
+ popup: false,
98
+ blank: false,
99
+ url: `mailto:?subject=${mailSubject}&body=${mailBody}`,
100
+ text: this.localization.shareMail,
101
+ icon: "mail"
102
+ },
55
103
  "facebook": {
56
104
  popup: true,
57
105
  blank: true,
@@ -79,16 +127,9 @@ const StzhShare = class {
79
127
  url: `https://www.xing.com/spi/shares/new?url=${shareUrl}`,
80
128
  text: this.localization.shareXing,
81
129
  icon: "xing"
82
- },
83
- "mail": {
84
- popup: false,
85
- blank: false,
86
- url: `mailto:?subject=${mailSubject}&body=${mailBody}`,
87
- text: this.localization.shareMail,
88
- icon: "mail"
89
130
  }
90
131
  };
91
- return (index.h(index.Host, null, index.h("div", { class: classes }, index.h("ul", { class: "stzh-share__list" }, this._services.map((service) => index.h("li", { class: "stzh-share__item" }, index.h("stzh-tooltip", { content: serviceData[service].text }, index.h("a", { class: `stzh-share__button is-${service}`, href: serviceData[service].url, "aria-label": serviceData[service].text, rel: serviceData[service].blank ? "nofollow noopener noreferrer" : "nofollow", target: serviceData[service].blank ? "_blank" : "_self", onClick: serviceData[service].popup ? (e) => this.openPopup(serviceData[service].url, e) : null, "s-object-id": serviceData[service].text }, index.h("stzh-icon", { class: "stzh-share__icon", name: serviceData[service].icon })))))))));
132
+ return (index.h(index.Host, null, index.h("div", { class: classes }, index.h("ul", { class: "stzh-share__list" }, this._services.map((service) => index.h("li", { class: "stzh-share__item" }, index.h("stzh-tooltip", { content: serviceData[service].text, size: "small" }, index.h("stzh-button", { class: `stzh-share__button is-${service}`, size: "small", variant: "tertiary", iconOnly: true, href: serviceData[service].url, rel: serviceData[service].blank ? "nofollow noopener noreferrer" : "nofollow", target: serviceData[service].blank ? "_blank" : "_self", onClick: serviceData[service].popup ? (e) => this.openPopup(serviceData[service].url, e) : null, analyticsId: serviceData[service].text, icon: serviceData[service].icon }))))))));
92
133
  }
93
134
  get element() { return index.getElement(this); }
94
135
  static get watchers() { return {
@@ -97,6 +138,7 @@ const StzhShare = class {
97
138
  };
98
139
  StzhShare.style = stzhShareCss;
99
140
 
141
+ exports.stzh_print = StzhPrint;
100
142
  exports.stzh_share = StzhShare;
101
143
 
102
- //# sourceMappingURL=stzh-share.cjs.entry.js.map
144
+ //# sourceMappingURL=stzh-print_2.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"stzh-print.stzh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,CAAC,CAAC,OAAO,KAC1BA,gBAAI,KAAK,EAAC,kBAAkB,IAC1BA,0BACE,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,EAClC,IAAI,EAAC,OAAO,IAEZA,yBACE,KAAK,EAAE,yBAAyB,OAAO,EAAE,EACzC,IAAI,EAAC,OAAO,EACZ,OAAO,EAAC,UAAU,EAClB,QAAQ,EAAE,IAAI,EACd,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,EAC9B,GAAG,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,GAAG,8BAA8B,GAAG,UAAU,EAC7E,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,GAAG,QAAQ,GAAG,OAAO,EACvD,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,EAC/F,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,EACtC,IAAI,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,GAClB,CACF,CACZ,CACN,CACE,CACD,CACD,EACP;GACH;;;;;;;;;;;","names":["setPropsIfNull","h","Host","abbreviateText","getMeta"],"sources":["src/components/stzh-print/stzh-print.scss?tag=stzh-print&encapsulation=shadow","src/components/stzh-print/stzh-print.tsx","src/components/stzh-share/stzh-share.scss?tag=stzh-share&encapsulation=scoped","src/components/stzh-share/stzh-share.tsx"],"sourcesContent":[":host {\n display: contents;\n\n @media print {\n display: none;\n }\n}\n\n.stzh-print {\n display: contents;\n}\n","import {\n Component,\n Host,\n h,\n Element,\n} from \"@stencil/core\";\n\nimport { setPropsIfNull } from \"../../utils/utils\";\n\n/**\n * @slot - Slot for label\n */\n@Component({\n tag: \"stzh-print\",\n styleUrl: \"stzh-print.scss\",\n shadow: true\n})\nexport class StzhPrint {\n @Element() element: HTMLStzhPrintElement;\n\n private observer: MutationObserver;\n\n private handleLinkClick = () => {\n window.print();\n }\n\n private init = () => {\n const links = this.element.querySelectorAll(\"stzh-link, stzh-button\");\n\n links.forEach((link) => {\n link.addEventListener('click', this.handleLinkClick);\n\n setPropsIfNull(link, {\n icon: \"print\"\n } as HTMLStzhLinkElement | HTMLStzhButtonElement)\n });\n }\n\n connectedCallback() {\n this.init();\n\n this.observer = new MutationObserver(this.init);\n this.observer.observe(this.element, {\n childList: true,\n subtree: true\n });\n }\n\n disconnectedCallback() {\n if (this.observer) {\n this.observer.disconnect();\n }\n }\n\n render() {\n const classes = {\n \"stzh-print\": true\n };\n\n return (\n <Host>\n <div class={classes}>\n <slot></slot>\n </div>\n </Host>\n );\n }\n}\n",":host {\n}\n\n.stzh-share {\n &__list {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n }\n\n &__item {\n &:not(:last-child) {\n margin-right: space('xxsmall');\n }\n }\n}\n","import {\n Component,\n Host,\n h,\n Element,\n Prop,\n Watch\n} from \"@stencil/core\";\n\nimport { ShareService } from \"../../index\";\nimport { StzhShareLocalizedText } from \"./stzh-share.localization\"\nimport { getMeta } from '../../utils/utils';\nimport { abbreviateText } from '../../utils/string-utils';\n\n// 280 - URL (always 24) = 256\nconst MAX_TWEET_LENGTH = 256;\n\n/**\n */\n@Component({\n tag: \"stzh-share\",\n styleUrl: \"stzh-share.scss\",\n scoped: true\n})\nexport class StzhShare {\n /** Translation strings */\n @Prop() localization: StzhShareLocalizedText;\n\n /** URL of current site (uses full URL by default) */\n @Prop() url: string = window.location.href;\n\n /** Overwrite mail subject translation */\n @Prop() mailSubject: string;\n\n /** Overwrite mail body translation */\n @Prop() mailBody: string;\n\n /**\n * Array of enabled share buttons.\n * Possible services: `facebook` / `twitter` / `linkedin` / `xing` / `mail`\n */\n @Prop() services: ShareService[] | string = [\n \"mail\", \"facebook\", \"twitter\", \"linkedin\", \"xing\"\n ];\n\n private _services: ShareService[] = [];\n\n @Watch(\"services\")\n servicesWatcher(newValue: ShareService[] | string) {\n if (typeof newValue === \"string\") {\n this._services = JSON.parse(newValue);\n } else {\n this._services = newValue;\n }\n }\n\n @Element() element: HTMLStzhShareElement;\n\n private openPopup = (url, event) => {\n event.preventDefault();\n window.open(url, \"_blank\", \"width=600,height=460\");\n }\n\n async componentWillLoad() {\n this.servicesWatcher(this.services);\n\n if (!this.localization) {\n this.localization = await window.stzhComponents.utils.fetchTranslations(this.element, \"share\");\n }\n }\n\n render() {\n const classes = {\n \"stzh-share\": true\n };\n\n const shareUrl = encodeURIComponent(this.url);\n const mailSubject = encodeURIComponent(this.mailSubject || this.localization.mailSubject);\n const mailBody = encodeURIComponent(\n (this.mailBody || this.localization.mailBody)?.replace(/\\{shareUrl\\}/gi, this.url)\n );\n\n const title = encodeURIComponent(document.title);\n const twitterTitle = encodeURIComponent(abbreviateText(title, MAX_TWEET_LENGTH));\n const description = encodeURIComponent(getMeta(\"description\"));\n\n const serviceData = {\n \"mail\": {\n popup: false,\n blank: false,\n url: `mailto:?subject=${mailSubject}&body=${mailBody}`,\n text: this.localization.shareMail,\n icon: \"mail\"\n },\n \"facebook\": {\n popup: true,\n blank: true,\n url: `https://www.facebook.com/sharer/sharer.php?u=${shareUrl}`,\n text: this.localization.shareFacebook,\n icon: \"facebook\"\n },\n \"twitter\": {\n popup: true,\n blank: true,\n url: `https://twitter.com/intent/tweet?text=${twitterTitle}&url=${shareUrl}`,\n text: this.localization.shareTwitter,\n icon: \"twitter\"\n },\n \"linkedin\": {\n popup: true,\n blank: true,\n url: `https://www.linkedin.com/shareArticle?mini=true&summary=${description}&title=${title}&url=${shareUrl}`,\n text: this.localization.shareLinkedin,\n icon: \"linkedin\"\n },\n \"xing\": {\n popup: true,\n blank: true,\n url: `https://www.xing.com/spi/shares/new?url=${shareUrl}`,\n text: this.localization.shareXing,\n icon: \"xing\"\n }\n };\n\n return (\n <Host>\n <div class={classes}>\n <ul class=\"stzh-share__list\">\n {this._services.map((service) =>\n <li class=\"stzh-share__item\">\n <stzh-tooltip\n content={serviceData[service].text}\n size=\"small\"\n >\n <stzh-button\n class={`stzh-share__button is-${service}`}\n size=\"small\"\n variant=\"tertiary\"\n iconOnly={true}\n href={serviceData[service].url}\n rel={serviceData[service].blank ? \"nofollow noopener noreferrer\" : \"nofollow\"}\n target={serviceData[service].blank ? \"_blank\" : \"_self\"}\n onClick={serviceData[service].popup ? (e) => this.openPopup(serviceData[service].url, e) : null}\n analyticsId={serviceData[service].text}\n icon={serviceData[service].icon}\n ></stzh-button>\n </stzh-tooltip>\n </li>\n )}\n </ul>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}