@aiconomy/aico-components 0.0.57 → 0.0.78

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 (222) hide show
  1. package/dist/aico-components/aico-components.css +1 -1
  2. package/dist/aico-components/aico-components.esm.js +1 -1
  3. package/dist/aico-components/aico-components.esm.js.map +1 -1
  4. package/dist/aico-components/p-0b6e7469.entry.js +2 -0
  5. package/dist/aico-components/p-0b6e7469.entry.js.map +1 -0
  6. package/dist/aico-components/p-19752961.entry.js +2 -0
  7. package/dist/aico-components/p-19752961.entry.js.map +1 -0
  8. package/dist/aico-components/p-2677f2ab.js +2 -0
  9. package/dist/aico-components/p-2677f2ab.js.map +1 -0
  10. package/dist/aico-components/{p-1c4a07ef.entry.js → p-368503ee.entry.js} +3 -3
  11. package/dist/aico-components/p-368503ee.entry.js.map +1 -0
  12. package/dist/aico-components/p-7e0074f7.entry.js +2 -0
  13. package/dist/aico-components/p-7e0074f7.entry.js.map +1 -0
  14. package/dist/aico-components/p-9ea26390.entry.js +2 -0
  15. package/dist/aico-components/p-9ea26390.entry.js.map +1 -0
  16. package/dist/aico-components/p-bccf08d0.entry.js +2 -0
  17. package/dist/aico-components/p-bccf08d0.entry.js.map +1 -0
  18. package/dist/aico-components/p-c9eea1b1.entry.js +2 -0
  19. package/dist/aico-components/p-c9eea1b1.entry.js.map +1 -0
  20. package/dist/cjs/aico-album-content_19.cjs.entry.js +76 -53
  21. package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -1
  22. package/dist/cjs/aico-article-detail.cjs.entry.js +18 -17
  23. package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -1
  24. package/dist/cjs/aico-components.cjs.js +1 -1
  25. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +3 -2
  26. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -1
  27. package/dist/cjs/aico-news-list-item.cjs.entry.js +1 -1
  28. package/dist/cjs/aico-news-list-item.cjs.entry.js.map +1 -1
  29. package/dist/cjs/aico-news-list.cjs.entry.js +4 -3
  30. package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -1
  31. package/dist/cjs/aico-no-content_2.cjs.entry.js +5 -3
  32. package/dist/cjs/aico-no-content_2.cjs.entry.js.map +1 -1
  33. package/dist/cjs/aico-special-news-carousel.cjs.entry.js +4 -3
  34. package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -1
  35. package/dist/cjs/loader.cjs.js +1 -1
  36. package/dist/cjs/{utils-095ed22b.js → utils-c1b7a052.js} +11 -5
  37. package/dist/cjs/utils-c1b7a052.js.map +1 -0
  38. package/dist/collection/components/aico-article-detail/aico-article-detail.js +36 -17
  39. package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
  40. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +20 -1
  41. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
  42. package/dist/collection/components/aico-news-list/aico-news-list.js +19 -2
  43. package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
  44. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js +1 -1
  45. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js.map +1 -1
  46. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +19 -2
  47. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
  48. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js +22 -3
  49. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js.map +1 -1
  50. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js +16 -0
  51. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js.map +1 -1
  52. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js +21 -1
  53. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js.map +1 -1
  54. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js +18 -0
  55. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js.map +1 -1
  56. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js +25 -5
  57. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js.map +1 -1
  58. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js +29 -0
  59. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js.map +1 -1
  60. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js +25 -3
  61. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js.map +1 -1
  62. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js +35 -3
  63. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js.map +1 -1
  64. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js +22 -3
  65. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js.map +1 -1
  66. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js +10 -0
  67. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js.map +1 -1
  68. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js +21 -1
  69. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js.map +1 -1
  70. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js +9 -0
  71. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js.map +1 -1
  72. package/dist/collection/components/content/aico-document-content/aico-document-content.js +22 -3
  73. package/dist/collection/components/content/aico-document-content/aico-document-content.js.map +1 -1
  74. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js +11 -0
  75. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js.map +1 -1
  76. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js +21 -1
  77. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js.map +1 -1
  78. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js +25 -0
  79. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js.map +1 -1
  80. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js +22 -2
  81. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js.map +1 -1
  82. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js +10 -0
  83. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js.map +1 -1
  84. package/dist/collection/components/content/aico-html-content/aico-html-content.js +22 -4
  85. package/dist/collection/components/content/aico-html-content/aico-html-content.js.map +1 -1
  86. package/dist/collection/components/content/aico-link-content/aico-link-content.js +22 -3
  87. package/dist/collection/components/content/aico-link-content/aico-link-content.js.map +1 -1
  88. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js +24 -0
  89. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js.map +1 -1
  90. package/dist/collection/components/content/aico-page-content/aico-page-content.js +23 -4
  91. package/dist/collection/components/content/aico-page-content/aico-page-content.js.map +1 -1
  92. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js +11 -0
  93. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js.map +1 -1
  94. package/dist/collection/components/content/aico-table-content/aico-table-content.js +26 -6
  95. package/dist/collection/components/content/aico-table-content/aico-table-content.js.map +1 -1
  96. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js +58 -0
  97. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js.map +1 -1
  98. package/dist/collection/components/content/aico-text-content/aico-text-content.js +25 -9
  99. package/dist/collection/components/content/aico-text-content/aico-text-content.js.map +1 -1
  100. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js +55 -0
  101. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js.map +1 -1
  102. package/dist/collection/components/content/aico-title-content/aico-title-content.js +23 -3
  103. package/dist/collection/components/content/aico-title-content/aico-title-content.js.map +1 -1
  104. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js +12 -1
  105. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js.map +1 -1
  106. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js +22 -2
  107. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js.map +1 -1
  108. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js +8 -0
  109. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js.map +1 -1
  110. package/dist/collection/components/content/aico-video-content/aico-video-content.js +22 -2
  111. package/dist/collection/components/content/aico-video-content/aico-video-content.js.map +1 -1
  112. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js +17 -0
  113. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js.map +1 -1
  114. package/dist/collection/model/article/content/CarouselContent.js.map +1 -1
  115. package/dist/collection/utils/utils.js +10 -4
  116. package/dist/collection/utils/utils.js.map +1 -1
  117. package/dist/components/aico-article-detail2.js +20 -18
  118. package/dist/components/aico-article-detail2.js.map +1 -1
  119. package/dist/components/aico-asking-content2.js +6 -4
  120. package/dist/components/aico-asking-content2.js.map +1 -1
  121. package/dist/components/aico-block-quote-content2.js +5 -2
  122. package/dist/components/aico-block-quote-content2.js.map +1 -1
  123. package/dist/components/aico-bullet-content2.js +9 -6
  124. package/dist/components/aico-bullet-content2.js.map +1 -1
  125. package/dist/components/aico-carousel-content2.js +9 -4
  126. package/dist/components/aico-carousel-content2.js.map +1 -1
  127. package/dist/components/aico-content-card-content2.js +6 -4
  128. package/dist/components/aico-content-card-content2.js.map +1 -1
  129. package/dist/components/aico-divider-content2.js +5 -2
  130. package/dist/components/aico-divider-content2.js.map +1 -1
  131. package/dist/components/aico-document-content2.js +6 -4
  132. package/dist/components/aico-document-content2.js.map +1 -1
  133. package/dist/components/aico-faq-content2.js +5 -2
  134. package/dist/components/aico-faq-content2.js.map +1 -1
  135. package/dist/components/aico-fetch-article-detail.js +3 -1
  136. package/dist/components/aico-fetch-article-detail.js.map +1 -1
  137. package/dist/components/aico-heading-content2.js +6 -3
  138. package/dist/components/aico-heading-content2.js.map +1 -1
  139. package/dist/components/aico-html-content2.js +7 -12
  140. package/dist/components/aico-html-content2.js.map +1 -1
  141. package/dist/components/aico-link-content2.js +6 -4
  142. package/dist/components/aico-link-content2.js.map +1 -1
  143. package/dist/components/aico-news-list-item2.js +1 -1
  144. package/dist/components/aico-news-list-item2.js.map +1 -1
  145. package/dist/components/aico-news-list.js +4 -2
  146. package/dist/components/aico-news-list.js.map +1 -1
  147. package/dist/components/aico-page-content2.js +7 -5
  148. package/dist/components/aico-page-content2.js.map +1 -1
  149. package/dist/components/aico-special-news-carousel.js +4 -2
  150. package/dist/components/aico-special-news-carousel.js.map +1 -1
  151. package/dist/components/aico-table-content2.js +10 -7
  152. package/dist/components/aico-table-content2.js.map +1 -1
  153. package/dist/components/aico-text-content2.js +9 -10
  154. package/dist/components/aico-text-content2.js.map +1 -1
  155. package/dist/components/aico-title-content2.js +7 -4
  156. package/dist/components/aico-title-content2.js.map +1 -1
  157. package/dist/components/aico-upload-content2.js +6 -3
  158. package/dist/components/aico-upload-content2.js.map +1 -1
  159. package/dist/components/aico-video-content2.js +6 -3
  160. package/dist/components/aico-video-content2.js.map +1 -1
  161. package/dist/components/utils.js +10 -4
  162. package/dist/components/utils.js.map +1 -1
  163. package/dist/esm/aico-album-content_19.entry.js +76 -53
  164. package/dist/esm/aico-album-content_19.entry.js.map +1 -1
  165. package/dist/esm/aico-article-detail.entry.js +18 -17
  166. package/dist/esm/aico-article-detail.entry.js.map +1 -1
  167. package/dist/esm/aico-components.js +1 -1
  168. package/dist/esm/aico-fetch-article-detail.entry.js +3 -2
  169. package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -1
  170. package/dist/esm/aico-news-list-item.entry.js +1 -1
  171. package/dist/esm/aico-news-list-item.entry.js.map +1 -1
  172. package/dist/esm/aico-news-list.entry.js +4 -3
  173. package/dist/esm/aico-news-list.entry.js.map +1 -1
  174. package/dist/esm/aico-no-content_2.entry.js +5 -3
  175. package/dist/esm/aico-no-content_2.entry.js.map +1 -1
  176. package/dist/esm/aico-special-news-carousel.entry.js +4 -3
  177. package/dist/esm/aico-special-news-carousel.entry.js.map +1 -1
  178. package/dist/esm/loader.js +1 -1
  179. package/dist/esm/{utils-54ffec33.js → utils-b4eec8e9.js} +11 -5
  180. package/dist/esm/utils-b4eec8e9.js.map +1 -0
  181. package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +1 -0
  182. package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +1 -0
  183. package/dist/types/components/aico-news-list/aico-news-list.d.ts +1 -0
  184. package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +1 -0
  185. package/dist/types/components/content/aico-asking-content/aico-asking-content.d.ts +1 -0
  186. package/dist/types/components/content/aico-block-quote-content/aico-block-quote-content.d.ts +1 -0
  187. package/dist/types/components/content/aico-bullet-content/aico-bullet-content.d.ts +1 -0
  188. package/dist/types/components/content/aico-carousel-content/aico-carousel-content.d.ts +1 -0
  189. package/dist/types/components/content/aico-content-card-content/aico-content-card-content.d.ts +1 -0
  190. package/dist/types/components/content/aico-divider-content/aico-divider-content.d.ts +1 -0
  191. package/dist/types/components/content/aico-document-content/aico-document-content.d.ts +1 -0
  192. package/dist/types/components/content/aico-faq-content/aico-faq-content.d.ts +1 -0
  193. package/dist/types/components/content/aico-heading-content/aico-heading-content.d.ts +1 -0
  194. package/dist/types/components/content/aico-html-content/aico-html-content.d.ts +1 -0
  195. package/dist/types/components/content/aico-link-content/aico-link-content.d.ts +1 -0
  196. package/dist/types/components/content/aico-page-content/aico-page-content.d.ts +1 -0
  197. package/dist/types/components/content/aico-table-content/aico-table-content.d.ts +1 -0
  198. package/dist/types/components/content/aico-text-content/aico-text-content.d.ts +1 -0
  199. package/dist/types/components/content/aico-title-content/aico-title-content.d.ts +1 -0
  200. package/dist/types/components/content/aico-upload-content/aico-upload-content.d.ts +1 -0
  201. package/dist/types/components/content/aico-video-content/aico-video-content.d.ts +1 -0
  202. package/dist/types/components.d.ts +42 -0
  203. package/dist/types/model/article/content/CarouselContent.d.ts +4 -2
  204. package/dist/types/utils/utils.d.ts +2 -2
  205. package/package.json +3 -2
  206. package/dist/aico-components/p-0ca1f065.entry.js +0 -2
  207. package/dist/aico-components/p-0ca1f065.entry.js.map +0 -1
  208. package/dist/aico-components/p-1c4a07ef.entry.js.map +0 -1
  209. package/dist/aico-components/p-406fa2e5.entry.js +0 -2
  210. package/dist/aico-components/p-406fa2e5.entry.js.map +0 -1
  211. package/dist/aico-components/p-4c0f3325.entry.js +0 -2
  212. package/dist/aico-components/p-4c0f3325.entry.js.map +0 -1
  213. package/dist/aico-components/p-5109399b.entry.js +0 -2
  214. package/dist/aico-components/p-5109399b.entry.js.map +0 -1
  215. package/dist/aico-components/p-6464810e.entry.js +0 -2
  216. package/dist/aico-components/p-6464810e.entry.js.map +0 -1
  217. package/dist/aico-components/p-b1f8308f.entry.js +0 -2
  218. package/dist/aico-components/p-b1f8308f.entry.js.map +0 -1
  219. package/dist/aico-components/p-dfd3b0d3.js +0 -2
  220. package/dist/aico-components/p-dfd3b0d3.js.map +0 -1
  221. package/dist/cjs/utils-095ed22b.js.map +0 -1
  222. package/dist/esm/utils-54ffec33.js.map +0 -1
@@ -1 +1 @@
1
- {"file":"aico-heading-content2.js","mappings":";;;;;;AAAA,MAAM,qBAAqB,GAAG,6jBAA6jB;;MCY9kB,kBAAkB;;;;;;IAG7B,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QAC/F,MAAM,YAAY,GAA0C,EAAE,iBAAiB,EAAE,IAAI,CAAC,OAAO,CAAC,qBAAqB,GAAG,QAAQ,GAAG,UAAU,EAAE,CAAC;QAC9I,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACvD,YAAY,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,qBAA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gBAAgB,CAAC,WAAY,CAAC,GAAI,CAChE,EACN,YAAM,KAAK,EAAC,aAAa,EAAC,KAAK,EAAE,gBAAgB,IAC9C,WAAY,CAAC,WAAW,CACpB,CACW,CAChB,EACN;KACH;IAEO,gBAAgB,CAAC,WAAwB;;QAC/C,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YACnB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,IAAI;YACpC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YAClC,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-heading-content/aico-heading-content.css?tag=aico-heading-content&encapsulation=scoped","src/components/content/aico-heading-content/aico-heading-content.tsx"],"sourcesContent":[".content {\n display: flex;\n flex-flow: column;\n width: 100%;\n margin: 10px auto;\n}\n\n.content-align-with-text {\n align-content: space-between;\n max-width: 1278px;\n display: flex;\n flex-flow: row wrap;\n width: 100%;\n margin: 0 auto;\n}\n\n.title-wrapper {\n width: fit-content;\n border-radius: 10px;\n margin-bottom: 10px;\n margin-left: 0;\n padding: 15px;\n}\n\n.description {\n width: fit-content;\n padding: 10px;\n border-radius: 10px;\n white-space: pre-line;\n}\n\n@media screen and (max-width: 768px) {\n .content {\n min-height: 300px !important;\n }\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport type { HeadingContent } from '../../../model/article/content/HeadingContent';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\n\n@Component({\n tag: 'aico-heading-content',\n styleUrl: 'aico-heading-content.css',\n scoped: true,\n})\nexport class AicoHeadingContent {\n @Prop() content!: HeadingContent;\n\n render() {\n const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;\n const contentStyle: { [key: string]: string | undefined } = { 'justify-content': this.content.isTextAtMiddleOfImage ? 'center' : 'flex-end' };\n if (!strIsNullOrEmptyOrWhitespace(this.content.picture)) {\n contentStyle['min-height'] = this.content.isImageHeightHalfSize ? '400px' : '600px';\n contentStyle['background-size'] = this.content.isImageHeightHalfSize ? '100%' : 'cover';\n contentStyle['background-image'] = `url(${this.content.picture})`;\n contentStyle['background-repeat'] = 'no-repeat';\n contentStyle['background-position'] = 'center';\n }\n\n const titleWrapperStyle: { [key: string]: string | undefined } = { 'background-color': this.content.textBackgroundColor };\n if (this.content.fontSize) {\n titleWrapperStyle['font-size'] = `${this.content.fontSize}px`;\n }\n\n if (!strIsNullOrEmptyOrWhitespace(this.content.fontFamily)) {\n titleWrapperStyle['font-family'] = this.content.fontFamily;\n }\n\n const descriptionStyle: { [key: string]: string | undefined } = { 'background-color': this.content.textBackgroundColor };\n if (!strIsNullOrEmptyOrWhitespace(this.content.textColor)) {\n descriptionStyle['color'] = this.content.textColor;\n }\n\n return (\n <div class={this.content.isHeadingAlignedWithText ? 'content content-align-with-text' : 'content'} style={contentStyle}>\n <ConditionalRender condition={translation !== null}>\n <div class=\"title-wrapper\" style={titleWrapperStyle}>\n <aico-title-content content={this.makeTitleContent(translation!)} />\n </div>\n <span class=\"description\" style={descriptionStyle}>\n {translation!.description}\n </span>\n </ConditionalRender>\n </div>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: this.content.titleSize ?? 'h1',\n titleColor: this.content.textColor,\n translations: [{ ...translation }],\n };\n }\n}\n"],"version":3}
1
+ {"file":"aico-heading-content2.js","mappings":";;;;;;AAAA,MAAM,qBAAqB,GAA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AAE,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,CAAC;QACzH,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;YACzD,gBAAgB,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;SACpD;QAED,QACE,WAAK,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,wBAAwB,GAAG,iCAAiC,GAAG,SAAS,EAAE,KAAK,EAAE,YAAY,IACpH,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI,IAChD,WAAK,KAAK,EAAC,eAAe,EAAC,KAAK,EAAE,iBAAiB,IACjD,0BAAoB,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,WAAY,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,CACrF,EACN,YAAM,KAAK,EAAC,aAAa,EAAC,KAAK,EAAE,gBAAgB,IAC9C,WAAY,CAAC,WAAW,CACpB,CACW,CAChB,EACN;KACH;IAEO,gBAAgB,CAAC,WAAwB;;QAC/C,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YACnB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,IAAI;YACpC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YAClC,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-heading-content/aico-heading-content.css?tag=aico-heading-content&encapsulation=scoped","src/components/content/aico-heading-content/aico-heading-content.tsx"],"sourcesContent":[".content {\n display: flex;\n flex-flow: column;\n width: 100%;\n margin: 10px auto;\n}\n\n.content-align-with-text {\n align-content: space-between;\n max-width: 1278px;\n display: flex;\n flex-flow: row wrap;\n width: 100%;\n margin: 0 auto;\n}\n\n.title-wrapper {\n width: fit-content;\n border-radius: 10px;\n margin-bottom: 10px;\n margin-left: 0;\n padding: 15px;\n}\n\n.description {\n width: fit-content;\n padding: 10px;\n border-radius: 10px;\n white-space: pre-line;\n}\n\n@media screen and (max-width: 768px) {\n .content {\n min-height: 300px !important;\n }\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport type { HeadingContent } from '../../../model/article/content/HeadingContent';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\n\n@Component({\n tag: 'aico-heading-content',\n styleUrl: 'aico-heading-content.css',\n scoped: true,\n})\nexport class AicoHeadingContent {\n @Prop() content!: HeadingContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const contentStyle: { [key: string]: string | undefined } = { 'justify-content': this.content.isTextAtMiddleOfImage ? 'center' : 'flex-end' };\n if (!strIsNullOrEmptyOrWhitespace(this.content.picture)) {\n contentStyle['min-height'] = this.content.isImageHeightHalfSize ? '400px' : '600px';\n contentStyle['background-size'] = this.content.isImageHeightHalfSize ? '100%' : 'cover';\n contentStyle['background-image'] = `url(${this.content.picture})`;\n contentStyle['background-repeat'] = 'no-repeat';\n contentStyle['background-position'] = 'center';\n }\n\n const titleWrapperStyle: { [key: string]: string | undefined } = { 'background-color': this.content.textBackgroundColor };\n if (this.content.fontSize) {\n titleWrapperStyle['font-size'] = `${this.content.fontSize}px`;\n }\n\n if (!strIsNullOrEmptyOrWhitespace(this.content.fontFamily)) {\n titleWrapperStyle['font-family'] = this.content.fontFamily;\n }\n\n const descriptionStyle: { [key: string]: string | undefined } = { 'background-color': this.content.textBackgroundColor };\n if (!strIsNullOrEmptyOrWhitespace(this.content.textColor)) {\n descriptionStyle['color'] = this.content.textColor;\n }\n\n return (\n <div class={this.content.isHeadingAlignedWithText ? 'content content-align-with-text' : 'content'} style={contentStyle}>\n <ConditionalRender condition={translation !== null}>\n <div class=\"title-wrapper\" style={titleWrapperStyle}>\n <aico-title-content content={this.makeTitleContent(translation!)} locale={this.locale} />\n </div>\n <span class=\"description\" style={descriptionStyle}>\n {translation!.description}\n </span>\n </ConditionalRender>\n </div>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: this.content.titleSize ?? 'h1',\n titleColor: this.content.textColor,\n translations: [{ ...translation }],\n };\n }\n}\n"],"version":3}
@@ -1,7 +1,6 @@
1
1
  import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
2
  import { C as ConditionalRender } from './ConditionalRender.js';
3
3
  import { s as strIsNullOrEmptyOrWhitespace } from './utils.js';
4
- import { d as defineCustomElement$1 } from './aico-no-content2.js';
5
4
 
6
5
  const aicoHtmlContentCss = ".sc-aico-html-content-h{display:block}";
7
6
 
@@ -10,33 +9,29 @@ const AicoHtmlContent = /*@__PURE__*/ proxyCustomElement(class AicoHtmlContent e
10
9
  super();
11
10
  this.__registerHost();
12
11
  this.content = undefined;
12
+ this.locale = 'de';
13
13
  }
14
14
  render() {
15
- if (this.content.translations.length === 0) {
16
- return h("aico-no-content", null);
17
- }
18
- return (h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.translations[0].text) }, h("div", { innerHTML: this.content.translations[0].text })));
15
+ var _a;
16
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
17
+ return (h(ConditionalRender, { condition: translation !== null && !strIsNullOrEmptyOrWhitespace(translation.text) }, h("div", { innerHTML: translation.text })));
19
18
  }
20
19
  static get style() { return aicoHtmlContentCss; }
21
20
  }, [2, "aico-html-content", {
22
- "content": [16]
21
+ "content": [16],
22
+ "locale": [1]
23
23
  }]);
24
24
  function defineCustomElement() {
25
25
  if (typeof customElements === "undefined") {
26
26
  return;
27
27
  }
28
- const components = ["aico-html-content", "aico-no-content"];
28
+ const components = ["aico-html-content"];
29
29
  components.forEach(tagName => { switch (tagName) {
30
30
  case "aico-html-content":
31
31
  if (!customElements.get(tagName)) {
32
32
  customElements.define(tagName, AicoHtmlContent);
33
33
  }
34
34
  break;
35
- case "aico-no-content":
36
- if (!customElements.get(tagName)) {
37
- defineCustomElement$1();
38
- }
39
- break;
40
35
  } });
41
36
  }
42
37
 
@@ -1 +1 @@
1
- {"file":"aico-html-content2.js","mappings":";;;;;AAAA,MAAM,kBAAkB,GAAG,wCAAwC;;MCUtD,eAAe;;;;;;IAG1B,MAAM;QACJ,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,OAAO,0BAAmB,CAAC;SAC5B;QAED,QACE,EAAC,iBAAiB,IAAC,SAAS,EAAE,CAAC,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAC5F,WAAK,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAK,GAAI,CACpC,EACpB;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-html-content/aico-html-content.css?tag=aico-html-content&encapsulation=scoped","src/components/content/aico-html-content/aico-html-content.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport { HtmlContent } from '../../../model/article/content/HtmlContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\n\n@Component({\n tag: 'aico-html-content',\n styleUrl: 'aico-html-content.css',\n scoped: true,\n})\nexport class AicoHtmlContent {\n @Prop() content!: HtmlContent;\n\n render() {\n if (this.content.translations.length === 0) {\n return <aico-no-content />;\n }\n\n return (\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(this.content.translations[0].text)}>\n <div innerHTML={this.content.translations[0].text!} />\n </ConditionalRender>\n );\n }\n}\n"],"version":3}
1
+ {"file":"aico-html-content2.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,wCAAwC;;MCUtD,eAAe;;;;;sBAGD,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC9G,QACE,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC,IACnG,WAAK,SAAS,EAAE,WAAY,CAAC,IAAK,GAAI,CACpB,EACpB;KACH;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-html-content/aico-html-content.css?tag=aico-html-content&encapsulation=scoped","src/components/content/aico-html-content/aico-html-content.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport { HtmlContent } from '../../../model/article/content/HtmlContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\n\n@Component({\n tag: 'aico-html-content',\n styleUrl: 'aico-html-content.css',\n scoped: true,\n})\nexport class AicoHtmlContent {\n @Prop() content!: HtmlContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n return (\n <ConditionalRender condition={translation !== null && !strIsNullOrEmptyOrWhitespace(translation.text)}>\n <div innerHTML={translation!.text!} />\n </ConditionalRender>\n );\n }\n}\n"],"version":3}
@@ -9,10 +9,11 @@ const AicoLinkContent = /*@__PURE__*/ proxyCustomElement(class AicoLinkContent e
9
9
  super();
10
10
  this.__registerHost();
11
11
  this.content = undefined;
12
+ this.locale = 'de';
12
13
  }
13
14
  render() {
14
- var _a, _b;
15
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
15
+ var _a, _b, _c;
16
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
16
17
  const buttonLinkStyle = {};
17
18
  if (this.content.textButtonColor) {
18
19
  buttonLinkStyle['color'] = this.content.textButtonColor;
@@ -30,11 +31,12 @@ const AicoLinkContent = /*@__PURE__*/ proxyCustomElement(class AicoLinkContent e
30
31
  buttonLinkStyle['--hover-button-color'] = this.content.hoverColor;
31
32
  }
32
33
  return (h(Host, null, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.title) }, h("label", null, translation === null || translation === void 0 ? void 0 :
33
- translation.title, ": ")), h(ConditionalRender, { condition: this.content.isImageLink !== undefined && this.content.isImageLink }, h("div", { class: "image-link-wrapper", style: { 'justify-content': this.content.picturePosition } }, h("a", { href: (_a = translation === null || translation === void 0 ? void 0 : translation.link) !== null && _a !== void 0 ? _a : '#', target: "_blank", class: "image-link", style: { width: this.content.isImageFullSize ? '100%' : getImageWidthPrc(this.content.pictureSize) } }, h("img", { src: translation === null || translation === void 0 ? void 0 : translation.imageUrl })))), h(ConditionalRender, { condition: this.content.isImageLink === null || !this.content.isImageLink }, h("a", { href: (_b = translation === null || translation === void 0 ? void 0 : translation.link) !== null && _b !== void 0 ? _b : '#', target: "_blank", class: this.content.isButtonLink ? 'button-link' : '', style: buttonLinkStyle }, h("span", { class: "arrow-button" }, " \u2192")))));
34
+ translation.title, ": ")), h(ConditionalRender, { condition: this.content.isImageLink !== undefined && this.content.isImageLink }, h("div", { class: "image-link-wrapper", style: { 'justify-content': this.content.picturePosition } }, h("a", { href: (_b = translation === null || translation === void 0 ? void 0 : translation.link) !== null && _b !== void 0 ? _b : '#', target: "_blank", class: "image-link", style: { width: this.content.isImageFullSize ? '100%' : getImageWidthPrc(this.content.pictureSize) } }, h("img", { src: translation === null || translation === void 0 ? void 0 : translation.imageUrl })))), h(ConditionalRender, { condition: this.content.isImageLink === null || !this.content.isImageLink }, h("a", { href: (_c = translation === null || translation === void 0 ? void 0 : translation.link) !== null && _c !== void 0 ? _c : '#', target: "_blank", class: this.content.isButtonLink ? 'button-link' : '', style: buttonLinkStyle }, h("span", { class: "arrow-button" }, " \u2192")))));
34
35
  }
35
36
  static get style() { return aicoLinkContentCss; }
36
37
  }, [2, "aico-link-content", {
37
- "content": [16]
38
+ "content": [16],
39
+ "locale": [1]
38
40
  }]);
39
41
  function defineCustomElement() {
40
42
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"aico-link-content2.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,6rBAA6rB;;MCU3sB,eAAe;;;;;;IAG1B,MAAM;;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QAC/F,MAAM,eAAe,GAA0C,EAAE,CAAC;QAClE,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;YAChC,eAAe,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;SACzD;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;YAChC,eAAe,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;SACpE;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;YACzB,eAAe,CAAC,WAAW,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC;SAC7D;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,U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,EAAC,QAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,GAAG,aAAa,GAAG,EAAE,EAAE,KAAK,EAAE,eAAe,IAC9H,YAAM,KAAK,EAAC,cAAc,cAAgB,CACxC,CACc,CACf,EACP;KACH;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-link-content/aico-link-content.css?tag=aico-link-content&encapsulation=scoped","src/components/content/aico-link-content/aico-link-content.tsx"],"sourcesContent":[":host {\n --hover-button-color: unset;\n}\n\n.image-link-wrapper {\n display: flex;\n}\n\n.image-link {\n display: block;\n text-align: center;\n &:hover {\n opacity: 0.5;\n }\n}\n\n.arrow-button {\n float: right;\n font-size: 30px;\n margin-top: -10px;\n}\n\n.button_link {\n display: block;\n text-decoration: none;\n text-transform: uppercase;\n padding: 12px;\n text-align: center;\n font-weight: 900;\n font-size: 1.5rem;\n line-height: 1;\n letter-spacing: 0.03rem;\n border-radius: 5px;\n &:hover {\n background-color: var(--hover-button-color) !important;\n }\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { getImageWidthPrc, strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport type { LinkContent } from '../../../model/article/content/LinkContent';\n\n@Component({\n tag: 'aico-link-content',\n styleUrl: 'aico-link-content.css',\n scoped: true,\n})\nexport class AicoLinkContent {\n @Prop() content!: LinkContent;\n\n render() {\n const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;\n const buttonLinkStyle: { [key: string]: string | undefined } = {};\n if (this.content.textButtonColor) {\n buttonLinkStyle['color'] = this.content.textButtonColor;\n }\n\n if (this.content.textButtonColor) {\n buttonLinkStyle['background-color'] = this.content.textButtonColor;\n }\n\n if (this.content.fontSize) {\n buttonLinkStyle['font-size'] = `${this.content.fontSize}px`;\n }\n\n if (this.content.fontFamily) {\n buttonLinkStyle['font-family'] = this.content.fontFamily;\n }\n\n if (this.content.hoverColor) {\n buttonLinkStyle['--hover-button-color'] = this.content.hoverColor;\n }\n\n return (\n <Host>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.title)}>\n <label>{translation?.title}: </label>\n </ConditionalRender>\n <ConditionalRender condition={this.content.isImageLink !== undefined && this.content.isImageLink}>\n <div class=\"image-link-wrapper\" style={{ 'justify-content': this.content.picturePosition }}>\n <a\n href={translation?.link ?? '#'}\n target=\"_blank\"\n class=\"image-link\"\n style={{ width: this.content.isImageFullSize ? '100%' : getImageWidthPrc(this.content.pictureSize) }}\n >\n <img src={translation?.imageUrl} />\n </a>\n </div>\n </ConditionalRender>\n <ConditionalRender condition={this.content.isImageLink === null || !this.content.isImageLink}>\n <a href={translation?.link ?? '#'} target=\"_blank\" class={this.content.isButtonLink ? 'button-link' : ''} style={buttonLinkStyle}>\n <span class=\"arrow-button\"> &#8594;</span>\n </a>\n </ConditionalRender>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"aico-link-content2.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,6rBAA6rB;;MCU3sB,eAAe;;;;;sBAGD,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC9G,MAAM,eAAe,GAA0C,EAAE,CAAC;QAClE,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;YAChC,eAAe,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;SACzD;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;YAChC,eAAe,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;SACpE;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;YACzB,eAAe,CAAC,WAAW,CAAC,GA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C1F,SAAG,IAAI,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,mCAAI,GAAG,EAAE,MAAM,EAAC,QAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,GAAG,aAAa,GAAG,EAAE,EAAE,KAAK,EAAE,eAAe,IAC9H,YAAM,KAAK,EAAC,cAAc,cAAgB,CACxC,CACc,CACf,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-link-content/aico-link-content.css?tag=aico-link-content&encapsulation=scoped","src/components/content/aico-link-content/aico-link-content.tsx"],"sourcesContent":[":host {\n --hover-button-color: unset;\n}\n\n.image-link-wrapper {\n display: flex;\n}\n\n.image-link {\n display: block;\n text-align: center;\n &:hover {\n opacity: 0.5;\n }\n}\n\n.arrow-button {\n float: right;\n font-size: 30px;\n margin-top: -10px;\n}\n\n.button_link {\n display: block;\n text-decoration: none;\n text-transform: uppercase;\n padding: 12px;\n text-align: center;\n font-weight: 900;\n font-size: 1.5rem;\n line-height: 1;\n letter-spacing: 0.03rem;\n border-radius: 5px;\n &:hover {\n background-color: var(--hover-button-color) !important;\n }\n}\n","import { Component, Host, Prop, h } from '@stencil/core';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { getImageWidthPrc, strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport type { LinkContent } from '../../../model/article/content/LinkContent';\n\n@Component({\n tag: 'aico-link-content',\n styleUrl: 'aico-link-content.css',\n scoped: true,\n})\nexport class AicoLinkContent {\n @Prop() content!: LinkContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const buttonLinkStyle: { [key: string]: string | undefined } = {};\n if (this.content.textButtonColor) {\n buttonLinkStyle['color'] = this.content.textButtonColor;\n }\n\n if (this.content.textButtonColor) {\n buttonLinkStyle['background-color'] = this.content.textButtonColor;\n }\n\n if (this.content.fontSize) {\n buttonLinkStyle['font-size'] = `${this.content.fontSize}px`;\n }\n\n if (this.content.fontFamily) {\n buttonLinkStyle['font-family'] = this.content.fontFamily;\n }\n\n if (this.content.hoverColor) {\n buttonLinkStyle['--hover-button-color'] = this.content.hoverColor;\n }\n\n return (\n <Host>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.title)}>\n <label>{translation?.title}: </label>\n </ConditionalRender>\n <ConditionalRender condition={this.content.isImageLink !== undefined && this.content.isImageLink}>\n <div class=\"image-link-wrapper\" style={{ 'justify-content': this.content.picturePosition }}>\n <a\n href={translation?.link ?? '#'}\n target=\"_blank\"\n class=\"image-link\"\n style={{ width: this.content.isImageFullSize ? '100%' : getImageWidthPrc(this.content.pictureSize) }}\n >\n <img src={translation?.imageUrl} />\n </a>\n </div>\n </ConditionalRender>\n <ConditionalRender condition={this.content.isImageLink === null || !this.content.isImageLink}>\n <a href={translation?.link ?? '#'} target=\"_blank\" class={this.content.isButtonLink ? 'button-link' : ''} style={buttonLinkStyle}>\n <span class=\"arrow-button\"> &#8594;</span>\n </a>\n </ConditionalRender>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -14,7 +14,7 @@ const AicoNewsListItem = /*@__PURE__*/ proxyCustomElement(class AicoNewsListItem
14
14
  return (h("div", { class: "card h-100 pe-auto", style: { cursor: 'pointer' }, onClick: () => {
15
15
  var _a;
16
16
  (_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(this.article);
17
- } }, h("div", { class: "ratio ratio-4x3 mb-3" }, h("img", { class: "card-img-top w-100 object-fit-cover", style: { 'min-height': '15rem' }, alt: "Article image", src: (_b = (_a = this.article.attributes.optimizedListImage) !== null && _a !== void 0 ? _a : this.article.attributes.optimizedImage) !== null && _b !== void 0 ? _b : this.article.attributes.image })), h("div", { class: "card-img-overlay d-flex justify-content-end" }), h("div", { class: "card-body" }, h("h5", { class: "card-title" }, this.article.attributes.name), h("p", { class: "card-text" }, this.article.attributes.excerpt))));
17
+ } }, h("div", { class: "ratio ratio-16x9 overflow-hidden" }, h("img", { class: "object-fit-cover", style: { 'min-height': '15rem' }, alt: "Article image", src: (_b = (_a = this.article.attributes.optimizedListImage) !== null && _a !== void 0 ? _a : this.article.attributes.optimizedImage) !== null && _b !== void 0 ? _b : this.article.attributes.image }), h("div", { class: "card-img-overlay d-flex justify-content-end" })), h("div", { class: "card-body" }, h("h5", { class: "card-title" }, this.article.attributes.name), h("p", { class: "card-text" }, this.article.attributes.excerpt))));
18
18
  }
19
19
  static get style() { return aicoNewsListItemCss; }
20
20
  }, [2, "aico-news-list-item", {
@@ -1 +1 @@
1
- {"file":"aico-news-list-item2.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,EAAE;;MCQjB,gBAAgB;;;;;;;IAK3B,MAAM;;QACJ,QACE,WACE,KAAK,EAAC,oBAAoB,EAC1B,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAC5B,OAAO,EAAE;;gBACP,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACvC,IAED,WAAK,KAAK,EAAC,sBAAsB,IAC/B,WACE,KAAK,EAAC,qCAAqC,EAC3C,KAAK,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAChC,GAAG,EAAC,eAAe,EACnB,GAAG,EAAE,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,GAC1H,CACE,EACN,WAAK,KAAK,EAAC,6CAA6C,GAA0C,EAClG,WAAK,KAAK,EAAC,WAAW,IACpB,UAAI,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAM,EAC1D,SAAG,KAAK,EAAC,WAAW,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAK,CACtD,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/aico-news-list-item/aico-news-list-item.css?tag=aico-news-list-item&encapsulation=scoped","src/components/aico-news-list-item/aico-news-list-item.tsx"],"sourcesContent":["","import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list-item',\n styleUrl: 'aico-news-list-item.css',\n scoped: true,\n})\nexport class AicoNewsListItem {\n @Prop() article!: Article;\n\n @Event() articleClick?: EventEmitter<Article>;\n\n render() {\n return (\n <div\n class=\"card h-100 pe-auto\"\n style={{ cursor: 'pointer' }}\n onClick={() => {\n this.articleClick?.emit(this.article);\n }}\n >\n <div class=\"ratio ratio-4x3 mb-3\">\n <img\n class=\"card-img-top w-100 object-fit-cover\"\n style={{ 'min-height': '15rem' }}\n alt=\"Article image\"\n src={this.article.attributes.optimizedListImage ?? this.article.attributes.optimizedImage ?? this.article.attributes.image}\n />\n </div>\n <div class=\"card-img-overlay d-flex justify-content-end\">{/*TODO: set the date top-right?*/}</div>\n <div class=\"card-body\">\n <h5 class=\"card-title\">{this.article.attributes.name}</h5>\n <p class=\"card-text\">{this.article.attributes.excerpt}</p>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"aico-news-list-item2.js","mappings":";;AAAA,MAAM,mBAAmB,GAAG,EAAE;;MCQjB,gBAAgB;;;;;;;IAK3B,MAAM;;QACJ,QACE,WAAK,KAAK,EAAC,oBAAoB,EAC3B,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAC5B,OAAO,EAAE;;gBACP,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACvC,IACH,WAAK,KAAK,EAAC,kCAAkC,IAC3C,WACE,KAAK,EAAC,kBAAkB,EACxB,KAAK,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAChC,GAAG,EAAC,eAAe,EACnB,GAAG,EAAE,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,GAC1H,EACF,WAAK,KAAK,EAAC,6CAA6C,GAA0C,CAC9F,EACN,WAAK,KAAK,EAAC,WAAW,IACpB,UAAI,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAM,EAC1D,SAAG,KAAK,EAAC,WAAW,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAK,CACtD,CACF,EACN;KACH;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/aico-news-list-item/aico-news-list-item.css?tag=aico-news-list-item&encapsulation=scoped","src/components/aico-news-list-item/aico-news-list-item.tsx"],"sourcesContent":["","import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list-item',\n styleUrl: 'aico-news-list-item.css',\n scoped: true,\n})\nexport class AicoNewsListItem {\n @Prop() article!: Article;\n\n @Event() articleClick?: EventEmitter<Article>;\n\n render() {\n return (\n <div class=\"card h-100 pe-auto\"\n style={{ cursor: 'pointer' }}\n onClick={() => {\n this.articleClick?.emit(this.article);\n }}>\n <div class=\"ratio ratio-16x9 overflow-hidden\">\n <img\n class=\"object-fit-cover\"\n style={{ 'min-height': '15rem' }}\n alt=\"Article image\"\n src={this.article.attributes.optimizedListImage ?? this.article.attributes.optimizedImage ?? this.article.attributes.image}\n />\n <div class=\"card-img-overlay d-flex justify-content-end\">{/*TODO: set the date top-right?*/}</div>\n </div>\n <div class=\"card-body\">\n <h5 class=\"card-title\">{this.article.attributes.name}</h5>\n <p class=\"card-text\">{this.article.attributes.excerpt}</p>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
@@ -14,6 +14,7 @@ const AicoNewsList$1 = /*@__PURE__*/ proxyCustomElement(class AicoNewsList exten
14
14
  this.pageNumber = 1;
15
15
  this.aicoUrl = undefined;
16
16
  this.aicoBearerToken = undefined;
17
+ this.newsChannels = [];
17
18
  this.nextButtonText = 'Next';
18
19
  this.previousButtonText = 'Previous';
19
20
  }
@@ -26,11 +27,11 @@ const AicoNewsList$1 = /*@__PURE__*/ proxyCustomElement(class AicoNewsList exten
26
27
  this.newsListFetchController.abort('disconnected');
27
28
  }
28
29
  async componentWillLoad() {
29
- this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal);
30
+ this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels);
30
31
  }
31
32
  async componentWillUpdate() {
32
33
  this.newsListFetchController = new AbortController();
33
- this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal);
34
+ this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels);
34
35
  }
35
36
  render() {
36
37
  var _a, _b, _c;
@@ -86,6 +87,7 @@ const AicoNewsList$1 = /*@__PURE__*/ proxyCustomElement(class AicoNewsList exten
86
87
  }, [2, "aico-news-list", {
87
88
  "aicoUrl": [1, "aico-url"],
88
89
  "aicoBearerToken": [1, "aico-bearer-token"],
90
+ "newsChannels": [16],
89
91
  "nextButtonText": [1, "next-button-text"],
90
92
  "previousButtonText": [1, "previous-button-text"],
91
93
  "newsResponse": [32],
@@ -1 +1 @@
1
- {"file":"aico-news-list.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,EAAE;;MCWbA,cAAY;;;;;QACN,aAAQ,GAAG,EAAE,CAAC;;0BAIT,CAAC;;;8BAMU,MAAM;kCAEF,UAAU;;IAO/C,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QAEpB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AAG,CAAC,EAAE,CAAC,CAAC;aACpB;SACF;QAED,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,GAAG,CAAC,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,IAAI,CAAC,EAAE;YAClF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACnB;QAED,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,IAAI,CAAC,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,IAAI,CAAC,EAAE;YACnF,KAAK,CAAC,IAAI,CAAC,GAAG,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxD;QAED,OAAO,KAAK,CAAC;KACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["AicoNewsList"],"sources":["src/components/aico-news-list/aico-news-list.css?tag=aico-news-list&encapsulation=scoped","src/components/aico-news-list/aico-news-list.tsx"],"sourcesContent":["","import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticles } from '../../utils/utils';\nimport { NewsResponse } from '../../model/NewsResponse';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list',\n styleUrl: 'aico-news-list.css',\n scoped: true,\n})\nexport class AicoNewsList {\n private readonly pageSize = 16;\n\n @State() newsResponse?: NewsResponse;\n\n @State() pageNumber = 1;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() nextButtonText: string = 'Next';\n\n @Prop() previousButtonText: string = 'Previous';\n\n @Event() articleClick?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.pageNumber = 1;\n\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController!.signal);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController.signal);\n }\n\n render() {\n return (\n <Host>\n <div class=\"row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4\">\n {this.newsResponse?.data.map(article => (\n <div class=\"col\">\n <aico-news-list-item\n article={article}\n onArticleClick={e => {\n this.articleClick?.emit(e.detail);\n }}\n />\n </div>\n ))}\n </div>\n <nav class=\"w-100\" aria-label=\"News navigation\">\n <ul class=\"pagination justify-content-center\">\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.prev ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.pageNumber > 1) {\n this.pageNumber -= 1;\n }\n\n return false;\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-left me-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\" />\n </svg>\n {this.previousButtonText}\n </li>\n {this.getViewablePages().map(page => (\n <li\n class={`page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (page !== '...') {\n this.pageNumber = Number(page);\n }\n return false;\n }}\n >\n {page}\n </li>\n ))}\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.next ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.newsResponse?.meta.page.lastPage && this.pageNumber < this.newsResponse?.meta.page.lastPage) {\n this.pageNumber += 1;\n }\n }}\n >\n {this.nextButtonText}\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-right ms-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708\" />\n </svg>\n </li>\n </ul>\n </nav>\n </Host>\n );\n }\n\n private getViewablePages(lookAhead: number = 2) {\n const pages: string[] = [];\n if (this.pageNumber - lookAhead >= 2) {\n pages.push('1');\n }\n\n if (this.pageNumber - lookAhead > 2) {\n pages.push('...');\n }\n\n for (let i = this.pageNumber - lookAhead; i < this.pageNumber; i += 1) {\n if (i >= 1) {\n pages.push(`${i}`);\n }\n }\n\n pages.push(`${this.pageNumber}`);\n for (let i = this.pageNumber + 1; i <= this.pageNumber + lookAhead; i += 1) {\n if (i <= (this.newsResponse?.meta.page.lastPage ?? 0)) {\n pages.push(`${i}`);\n }\n }\n\n if (this.pageNumber + lookAhead < (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push('...');\n }\n\n if (this.pageNumber + lookAhead <= (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push(`${this.newsResponse?.meta.page.lastPage}`);\n }\n\n return pages;\n }\n}\n"],"version":3}
1
+ {"file":"aico-news-list.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,EAAE;;MCWbA,cAAY;;;;;QACN,aAAQ,GAAG,EAAE,CAAC;;0BAIT,CAAC;;;4BAMU,EAAE;8BAEF,MAAM;kCAEF,UAAU;;IAO/C,iBAAiB;QACf,IAA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AAI,CAAC,KAAK,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,CAAC,EAAE;gBACrD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;aACpB;SACF;QAED,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,GAAG,CAAC,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,IAAI,CAAC,EAAE;YAClF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACnB;QAED,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,IAAI,CAAC,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,IAAI,CAAC,EAAE;YACnF,KAAK,CAAC,IAAI,CAAC,GAAG,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxD;QAED,OAAO,KAAK,CAAC;KACd;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["AicoNewsList"],"sources":["src/components/aico-news-list/aico-news-list.css?tag=aico-news-list&encapsulation=scoped","src/components/aico-news-list/aico-news-list.tsx"],"sourcesContent":["","import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticles } from '../../utils/utils';\nimport { NewsResponse } from '../../model/NewsResponse';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list',\n styleUrl: 'aico-news-list.css',\n scoped: true,\n})\nexport class AicoNewsList {\n private readonly pageSize = 16;\n\n @State() newsResponse?: NewsResponse;\n\n @State() pageNumber = 1;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() newsChannels: string[] = [];\n\n @Prop() nextButtonText: string = 'Next';\n\n @Prop() previousButtonText: string = 'Previous';\n\n @Event() articleClick?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.pageNumber = 1;\n\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController!.signal, this.newsChannels);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels);\n }\n\n render() {\n return (\n <Host>\n <div class=\"row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4\">\n {this.newsResponse?.data.map(article => (\n <div class=\"col\">\n <aico-news-list-item\n article={article}\n onArticleClick={e => {\n this.articleClick?.emit(e.detail);\n }}\n />\n </div>\n ))}\n </div>\n <nav class=\"w-100\" aria-label=\"News navigation\">\n <ul class=\"pagination justify-content-center\">\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.prev ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.pageNumber > 1) {\n this.pageNumber -= 1;\n }\n\n return false;\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-left me-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\" />\n </svg>\n {this.previousButtonText}\n </li>\n {this.getViewablePages().map(page => (\n <li\n class={`page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (page !== '...') {\n this.pageNumber = Number(page);\n }\n return false;\n }}\n >\n {page}\n </li>\n ))}\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.next ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.newsResponse?.meta.page.lastPage && this.pageNumber < this.newsResponse?.meta.page.lastPage) {\n this.pageNumber += 1;\n }\n }}\n >\n {this.nextButtonText}\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-right ms-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708\" />\n </svg>\n </li>\n </ul>\n </nav>\n </Host>\n );\n }\n\n private getViewablePages(lookAhead: number = 2) {\n const pages: string[] = [];\n if (this.pageNumber - lookAhead >= 2) {\n pages.push('1');\n }\n\n if (this.pageNumber - lookAhead > 2) {\n pages.push('...');\n }\n\n for (let i = this.pageNumber - lookAhead; i < this.pageNumber; i += 1) {\n if (i >= 1) {\n pages.push(`${i}`);\n }\n }\n\n pages.push(`${this.pageNumber}`);\n for (let i = this.pageNumber + 1; i <= this.pageNumber + lookAhead; i += 1) {\n if (i <= (this.newsResponse?.meta.page.lastPage ?? 0)) {\n pages.push(`${i}`);\n }\n }\n\n if (this.pageNumber + lookAhead < (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push('...');\n }\n\n if (this.pageNumber + lookAhead <= (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push(`${this.newsResponse?.meta.page.lastPage}`);\n }\n\n return pages;\n }\n}\n"],"version":3}
@@ -10,19 +10,21 @@ const AicoPageContent = /*@__PURE__*/ proxyCustomElement(class AicoPageContent e
10
10
  this.__registerHost();
11
11
  this.pageClicked = createEvent(this, "pageClicked", 7);
12
12
  this.content = undefined;
13
+ this.locale = 'de';
13
14
  }
14
15
  render() {
15
- var _a, _b, _c, _d;
16
- const translation = this.content.landingPage.translations.length > 0 ? this.content.landingPage.translations[0] : null;
17
- return (h(Host, { style: { 'max-width': '300px' } }, h("div", { class: "card pe-auto" }, h("div", { class: "ratio ratio-4x3" }, h("img", { class: "card-img-top img-fluid object-fit-cover", style: { 'object-position': 'center' }, src: (_a = this.content.landingPage.image) !== null && _a !== void 0 ? _a : 'https://cdn.shopify.com/s/files/1/0565/2201/4813/files/blank-img.png?v=13432316686103745237%20406w', alt: (_b = translation === null || translation === void 0 ? void 0 : translation.imageAlt) !== null && _b !== void 0 ? _b : 'Landing page image' })), h("div", { class: "card-body", style: { 'min-height': '6rem' } }, h("h5", { class: "card-title" }, translation === null || translation === void 0 ? void 0 : translation.name), h(ConditionalRender, { condition: this.content.openExternalLink && !strIsNullOrEmptyOrWhitespace(this.content.externalLink) }, h("a", { href: this.content.externalLink, class: "card-link" }, (_c = translation === null || translation === void 0 ? void 0 : translation.buttonText) !== null && _c !== void 0 ? _c : 'Navigate to page')), h(ConditionalRender, { condition: !this.content.openExternalLink }, h("a", { href: "#", class: "card-link", onClick: e => {
16
+ var _a, _b, _c, _d, _e;
17
+ const translation = (_a = this.content.landingPage.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
18
+ return (h(Host, { style: { 'max-width': '300px' } }, h("div", { class: "card pe-auto" }, h("div", { class: "ratio ratio-4x3" }, h("img", { class: "card-img-top img-fluid object-fit-cover", style: { 'object-position': 'center' }, src: (_b = this.content.landingPage.image) !== null && _b !== void 0 ? _b : 'https://cdn.shopify.com/s/files/1/0565/2201/4813/files/blank-img.png?v=13432316686103745237%20406w', alt: (_c = translation === null || translation === void 0 ? void 0 : translation.imageAlt) !== null && _c !== void 0 ? _c : 'Landing page image' })), h("div", { class: "card-body", style: { 'min-height': '6rem' } }, h("h5", { class: "card-title" }, translation === null || translation === void 0 ? void 0 : translation.name), h(ConditionalRender, { condition: this.content.openExternalLink && !strIsNullOrEmptyOrWhitespace(this.content.externalLink) }, h("a", { href: this.content.externalLink, class: "card-link" }, (_d = translation === null || translation === void 0 ? void 0 : translation.buttonText) !== null && _d !== void 0 ? _d : 'Navigate to page')), h(ConditionalRender, { condition: !this.content.openExternalLink }, h("a", { href: "#", class: "card-link", onClick: e => {
18
19
  var _a;
19
20
  e.preventDefault();
20
21
  (_a = this.pageClicked) === null || _a === void 0 ? void 0 : _a.emit(this.content);
21
- } }, (_d = translation === null || translation === void 0 ? void 0 : translation.buttonText) !== null && _d !== void 0 ? _d : 'Navigate to page'))), h(ConditionalRender, { condition: translation !== null && !strIsNullOrEmptyOrWhitespace(translation.excerpt) }, h("div", { class: "card-footer" }, h("small", { class: "text-muted" }, translation === null || translation === void 0 ? void 0 : translation.excerpt))))));
22
+ } }, (_e = translation === null || translation === void 0 ? void 0 : translation.buttonText) !== null && _e !== void 0 ? _e : 'Navigate to page'))), h(ConditionalRender, { condition: translation !== null && !strIsNullOrEmptyOrWhitespace(translation.excerpt) }, h("div", { class: "card-footer" }, h("small", { class: "text-muted" }, translation === null || translation === void 0 ? void 0 : translation.excerpt))))));
22
23
  }
23
24
  static get style() { return aicoPageContentCss; }
24
25
  }, [2, "aico-page-content", {
25
- "content": [16]
26
+ "content": [16],
27
+ "locale": [1]
26
28
  }]);
27
29
  function defineCustomElement() {
28
30
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"aico-page-content2.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,wCAAwC;;MCUtD,eAAe;;;;;;;IAK1B,MAAM;;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,O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AX,WAAW,CAAE,UAAU,mCAAI,kBAAkB,CAC5C,CACc,CAChB,EACN,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,IACtG,WAAK,KAAK,EAAC,aAAa,IACtB,aAAO,KAAK,EAAC,YAAY,IAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAAS,CACpD,CACY,CAChB,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-page-content/aico-page-content.css?tag=aico-page-content&encapsulation=scoped","src/components/content/aico-page-content/aico-page-content.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport type { PageContent } from '../../../model/article/content/PageContent';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-page-content',\n styleUrl: 'aico-page-content.css',\n scoped: true,\n})\nexport class AicoPageContent {\n @Prop() content!: PageContent;\n\n @Event() pageClicked?: EventEmitter<PageContent>;\n\n render() {\n const translation = this.content.landingPage.translations.length > 0 ? this.content.landingPage.translations[0] : null;\n return (\n <Host style={{ 'max-width': '300px' }}>\n <div class=\"card pe-auto\">\n <div class=\"ratio ratio-4x3\">\n <img\n class=\"card-img-top img-fluid object-fit-cover\"\n style={{ 'object-position': 'center' }}\n src={this.content.landingPage.image ?? 'https://cdn.shopify.com/s/files/1/0565/2201/4813/files/blank-img.png?v=13432316686103745237%20406w'}\n alt={translation?.imageAlt ?? 'Landing page image'}\n />\n </div>\n <div class=\"card-body\" style={{ 'min-height': '6rem' }}>\n <h5 class=\"card-title\">{translation?.name}</h5>\n <ConditionalRender condition={this.content.openExternalLink && !strIsNullOrEmptyOrWhitespace(this.content.externalLink)}>\n <a href={this.content.externalLink!} class=\"card-link\">\n {translation?.buttonText ?? 'Navigate to page'}\n </a>\n </ConditionalRender>\n <ConditionalRender condition={!this.content.openExternalLink}>\n <a\n href=\"#\"\n class=\"card-link\"\n onClick={e => {\n e.preventDefault();\n this.pageClicked?.emit(this.content);\n }}\n >\n {translation?.buttonText ?? 'Navigate to page'}\n </a>\n </ConditionalRender>\n </div>\n <ConditionalRender condition={translation !== null && !strIsNullOrEmptyOrWhitespace(translation.excerpt)}>\n <div class=\"card-footer\">\n <small class=\"text-muted\">{translation?.excerpt}</small>\n </div>\n </ConditionalRender>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"aico-page-content2.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,wCAAwC;;MCUtD,eAAe;;;;;;sBAGD,IAAI;;IAI7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC1H,QACE,EAAC,IAAI,IAAC,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,IACnC,WAAK,KAAK,EAAC,cAAc,IACvB,WAAK,KAAK,EAAC,iBAAiB,IAC1B,WACE,KAAK,EAAC,yCAAyC,EAC/C,KAAK,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EACtC,GAAG,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,mCAAI,oGAAoG,EAC3I,GAAG,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,mCAAI,oBAAoB,GAClD,CACE,EACN,WAAK,KAAK,EAAC,WAAW,EAAC,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,IACpD,UAAI,KAAK,EAAC,YAAY,IAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,CAAM,EAC/C,EAAC,iBAAiB,IAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IACrH,SAAG,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,YAAa,EAAE,KAAK,EAAC,WAAW,IACnD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,mCAAI,kBAAkB,CAC5C,CACc,EACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,IAC1D,SACE,IAAI,EAAC,GAAG,EACR,KAAK,EAAC,WAAW,EACjB,OAAO,EAAE,CAAC;;gBACR,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACtC,IAEA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,mCAAI,kBAAkB,CAC5C,CACc,CAChB,EACN,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,IACtG,WAAK,KAAK,EAAC,aAAa,IACtB,aAAO,KAAK,EAAC,YAAY,IAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAAS,CACpD,CACY,CAChB,CACD,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-page-content/aico-page-content.css?tag=aico-page-content&encapsulation=scoped","src/components/content/aico-page-content/aico-page-content.tsx"],"sourcesContent":[":host {\n display: block;\n}\n","import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport type { PageContent } from '../../../model/article/content/PageContent';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-page-content',\n styleUrl: 'aico-page-content.css',\n scoped: true,\n})\nexport class AicoPageContent {\n @Prop() content!: PageContent;\n\n @Prop() locale: string = 'de';\n\n @Event() pageClicked?: EventEmitter<PageContent>;\n\n render() {\n const translation = this.content.landingPage.translations.find(translation => translation.locale === this.locale) ?? null;\n return (\n <Host style={{ 'max-width': '300px' }}>\n <div class=\"card pe-auto\">\n <div class=\"ratio ratio-4x3\">\n <img\n class=\"card-img-top img-fluid object-fit-cover\"\n style={{ 'object-position': 'center' }}\n src={this.content.landingPage.image ?? 'https://cdn.shopify.com/s/files/1/0565/2201/4813/files/blank-img.png?v=13432316686103745237%20406w'}\n alt={translation?.imageAlt ?? 'Landing page image'}\n />\n </div>\n <div class=\"card-body\" style={{ 'min-height': '6rem' }}>\n <h5 class=\"card-title\">{translation?.name}</h5>\n <ConditionalRender condition={this.content.openExternalLink && !strIsNullOrEmptyOrWhitespace(this.content.externalLink)}>\n <a href={this.content.externalLink!} class=\"card-link\">\n {translation?.buttonText ?? 'Navigate to page'}\n </a>\n </ConditionalRender>\n <ConditionalRender condition={!this.content.openExternalLink}>\n <a\n href=\"#\"\n class=\"card-link\"\n onClick={e => {\n e.preventDefault();\n this.pageClicked?.emit(this.content);\n }}\n >\n {translation?.buttonText ?? 'Navigate to page'}\n </a>\n </ConditionalRender>\n </div>\n <ConditionalRender condition={translation !== null && !strIsNullOrEmptyOrWhitespace(translation.excerpt)}>\n <div class=\"card-footer\">\n <small class=\"text-muted\">{translation?.excerpt}</small>\n </div>\n </ConditionalRender>\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -12,6 +12,7 @@ const AicoSpecialNewsCarousel$1 = /*@__PURE__*/ proxyCustomElement(class AicoSpe
12
12
  this.newsResponse = undefined;
13
13
  this.aicoUrl = undefined;
14
14
  this.aicoBearerToken = undefined;
15
+ this.newsChannels = [];
15
16
  this.numberOfArticles = 6;
16
17
  }
17
18
  connectedCallback() {
@@ -22,11 +23,11 @@ const AicoSpecialNewsCarousel$1 = /*@__PURE__*/ proxyCustomElement(class AicoSpe
22
23
  this.newsListFetchController.abort('disconnected');
23
24
  }
24
25
  async componentWillLoad() {
25
- this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal);
26
+ this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels);
26
27
  }
27
28
  async componentWillUpdate() {
28
29
  this.newsListFetchController = new AbortController();
29
- this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal);
30
+ this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels);
30
31
  }
31
32
  componentDidLoad() {
32
33
  jquery('.carousel').slick({
@@ -53,6 +54,7 @@ const AicoSpecialNewsCarousel$1 = /*@__PURE__*/ proxyCustomElement(class AicoSpe
53
54
  }, [2, "aico-special-news-carousel", {
54
55
  "aicoUrl": [1, "aico-url"],
55
56
  "aicoBearerToken": [1, "aico-bearer-token"],
57
+ "newsChannels": [16],
56
58
  "numberOfArticles": [2, "number-of-articles"],
57
59
  "newsResponse": [32]
58
60
  }]);
@@ -1 +1 @@
1
- {"file":"aico-special-news-carousel.js","mappings":";;;;AAAA,MAAM,0BAA0B,GAAG,sGAAsG;;MCc5HA,yBAAuB;;;;;;;;gCAOC,CAAC;;IAOpC,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;KACzE;IAED,oBAAoB;QAClB,IAAI,CAAC,uBAAwB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;KACrD;IAED,MAAM,iBAAiB;QACrB,IAAI,CAAC,YAAY,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,GAAI,EAAE,CAAC,EAAE,IAAI,CAA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KAAK,EAAC,0BAA0B,EAAC,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,IACjE,WACE,KAAK,EAAC,kCAAkC,EACxC,KAAK,EAAE,EAAE,iBAAiB,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAC1E,GAAG,EAAC,cAAc,eACP,MAAA,OAAO,CAAC,UAAU,CAAC,cAAc,mCAAI,OAAO,CAAC,UAAU,CAAC,KAAK,GACxE,CACE,CACF,EACN;SACH,CAAC,CACE,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["AicoSpecialNewsCarousel","$"],"sources":["src/components/aico-special-news-carousel/aico-special-news-carousel.css?tag=aico-special-news-carousel&encapsulation=scoped","src/components/aico-special-news-carousel/aico-special-news-carousel.tsx"],"sourcesContent":[".slick-slide > div {\n height: 100% !important;\n}\n","import { Component, Event, EventEmitter, Prop, State, h } from '@stencil/core';\nimport type { NewsResponse } from '../../model/NewsResponse';\nimport type { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport type { Article } from '../../model/Article';\nimport { fetchSpecialNewsArticles } from '../../utils/utils';\n\nimport $ from 'jquery';\nimport 'slick-carousel';\n\n@Component({\n tag: 'aico-special-news-carousel',\n styleUrl: 'aico-special-news-carousel.css',\n scoped: true,\n})\nexport class AicoSpecialNewsCarousel {\n @State() newsResponse!: NewsResponse;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() numberOfArticles: number = 6;\n\n @Event() articleClicked?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchSpecialNewsArticles(this.api!, 1, this.numberOfArticles, this.newsListFetchController!.signal);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchSpecialNewsArticles(this.api!, 1, this.numberOfArticles, this.newsListFetchController.signal);\n }\n\n componentDidLoad() {\n $('.carousel').slick({\n autoplay: true,\n autoplaySpeed: 6000,\n dots: true,\n arrows: false,\n pauseOnDotsHover: true,\n });\n }\n\n render() {\n return (\n <div class=\"carousel\">\n {this.newsResponse.data.map(article => {\n const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';\n const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';\n return (\n <div class=\"carousel-item card border-0\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-center text-uppercase\">\n <a\n class=\"text-reset text-decoration-none\"\n href=\"#\"\n onClick={e => {\n e.preventDefault();\n this.articleClicked?.emit(article);\n }}\n >\n {article.attributes.name}\n </a>\n </h5>\n </div>\n <div class=\"ratio ratio-16x9 mx-auto\" style={{ 'max-width': '50%' }}>\n <img\n class=\"card-img-bottom object-fit-cover\"\n style={{ 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }}\n alt=\"News Picture\"\n data-lazy={article.attributes.optimizedImage ?? article.attributes.image}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n}\n"],"version":3}
1
+ {"file":"aico-special-news-carousel.js","mappings":";;;;AAAA,MAAM,0BAA0B,GAAG,sGAAsG;;MCc5HA,yBAAuB;;;;;;;;4BAOD,EAAE;gCAEA,CAAC;;IAOpC,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;KACzE;IAED,oBAAoB;QAClB,IAAI,CAAC,uBAAwB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;KACrD;IA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AAC,cAAc,EAAE,CAAC;oBACnB,MAAA,IAAI,CAAC,cAAc,0CAAE,IAAI,CAAC,OAAO,CAAC,CAAC;iBACpC,IAEA,OAAO,CAAC,UAAU,CAAC,IAAI,CACtB,CACD,CACD,EACN,WAAK,KAAK,EAAC,0BAA0B,EAAC,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,IACjE,WACE,KAAK,EAAC,kCAAkC,EACxC,KAAK,EAAE,EAAE,iBAAiB,EAAE,GAAG,MAAM,IAAI,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAC1E,GAAG,EAAC,cAAc,eACP,MAAA,OAAO,CAAC,UAAU,CAAC,cAAc,mCAAI,OAAO,CAAC,UAAU,CAAC,KAAK,GACxE,CACE,CACF,EACN;SACH,CAAC,CACE,EACN;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["AicoSpecialNewsCarousel","$"],"sources":["src/components/aico-special-news-carousel/aico-special-news-carousel.css?tag=aico-special-news-carousel&encapsulation=scoped","src/components/aico-special-news-carousel/aico-special-news-carousel.tsx"],"sourcesContent":[".slick-slide > div {\n height: 100% !important;\n}\n","import { Component, Event, EventEmitter, Prop, State, h } from '@stencil/core';\nimport type { NewsResponse } from '../../model/NewsResponse';\nimport type { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport type { Article } from '../../model/Article';\nimport { fetchSpecialNewsArticles } from '../../utils/utils';\n\nimport $ from 'jquery';\nimport 'slick-carousel';\n\n@Component({\n tag: 'aico-special-news-carousel',\n styleUrl: 'aico-special-news-carousel.css',\n scoped: true,\n})\nexport class AicoSpecialNewsCarousel {\n @State() newsResponse!: NewsResponse;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() newsChannels: string[] = [];\n\n @Prop() numberOfArticles: number = 6;\n\n @Event() articleClicked?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchSpecialNewsArticles(this.api!, 1, this.numberOfArticles, this.newsListFetchController!.signal, this.newsChannels);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchSpecialNewsArticles(this.api!, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels);\n }\n\n componentDidLoad() {\n $('.carousel').slick({\n autoplay: true,\n autoplaySpeed: 6000,\n dots: true,\n arrows: false,\n pauseOnDotsHover: true,\n });\n }\n\n render() {\n return (\n <div class=\"carousel\">\n {this.newsResponse.data.map(article => {\n const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';\n const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';\n return (\n <div class=\"carousel-item card border-0\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-center text-uppercase\">\n <a\n class=\"text-reset text-decoration-none\"\n href=\"#\"\n onClick={e => {\n e.preventDefault();\n this.articleClicked?.emit(article);\n }}\n >\n {article.attributes.name}\n </a>\n </h5>\n </div>\n <div class=\"ratio ratio-16x9 mx-auto\" style={{ 'max-width': '50%' }}>\n <img\n class=\"card-img-bottom object-fit-cover\"\n style={{ 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }}\n alt=\"News Picture\"\n data-lazy={article.attributes.optimizedImage ?? article.attributes.image}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n}\n"],"version":3}
@@ -10,17 +10,19 @@ const AicoTableContent = /*@__PURE__*/ proxyCustomElement(class AicoTableContent
10
10
  super();
11
11
  this.__registerHost();
12
12
  this.content = undefined;
13
+ this.locale = 'de';
13
14
  }
14
15
  render() {
15
- var _a, _b;
16
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
17
- const firstBackgroundColor = (_a = this.content.firstColor) !== null && _a !== void 0 ? _a : '#d6dfe1';
18
- const secondBackgroundColor = (_b = this.content.secondColor) !== null && _b !== void 0 ? _b : '#e6eced';
19
- return (h("div", { class: "content-table card" }, h("div", { class: "card-body" }, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { class: "card-title mt-0", content: this.makeTitleContent(translation) }), h("p", { class: "card-text" }, translation.additionalText)), h("table", { class: "table-content" }, this.content.tableRows
16
+ var _a, _b, _c;
17
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
18
+ const firstBackgroundColor = (_b = this.content.firstColor) !== null && _b !== void 0 ? _b : '#d6dfe1';
19
+ const secondBackgroundColor = (_c = this.content.secondColor) !== null && _c !== void 0 ? _c : '#e6eced';
20
+ return (h("div", { class: "content-table card" }, h("div", { class: "card-body" }, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { class: "card-title mt-0", content: this.makeTitleContent(translation), locale: this.locale }), h("p", { class: "card-text" }, translation.additionalText)), h("table", { class: "table-content" }, this.content.tableRows
20
21
  .sort((a, b) => a.sort - b.sort)
21
22
  .map((row, index) => {
22
23
  return (h("tr", { style: { 'font-weight': '400', 'background-color': index % 2 === 0 ? firstBackgroundColor : secondBackgroundColor } }, row.rowColumns.map(col => {
23
- const translation = col.translations.length > 0 ? col.translations[0] : null;
24
+ var _a;
25
+ const translation = (_a = col.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
24
26
  if (!translation) {
25
27
  return row.isHeading ? h("th", null) : h("td", null);
26
28
  }
@@ -41,7 +43,8 @@ const AicoTableContent = /*@__PURE__*/ proxyCustomElement(class AicoTableContent
41
43
  }
42
44
  static get style() { return aicoTableContentCss; }
43
45
  }, [2, "aico-table-content", {
44
- "content": [16]
46
+ "content": [16],
47
+ "locale": [1]
45
48
  }]);
46
49
  function defineCustomElement() {
47
50
  if (typeof customElements === "undefined") {
@@ -1 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AAC;gBAC7E,IAAI,CAAC,WAAW,EAAE;oBAChB,OAAO,GAAG,CAAC,SAAS,GAAG,aAAS,GAAG,aAAS,CAAC;iBAC9C;gBAED,OAAO,GAAG,CAAC,SAAS,GAAG,cAAK,WAAW,CAAC,UAAU,CAAM,GAAG,cAAK,WAAW,CAAC,UAAU,CAAM,CAAC;aAC9F,CAAC,CACC,EACL;SACH,CAAC,CACE,CACJ,CACF,EACN;KACH;IAEO,gBAAgB,CAAC,WAAwB;;QAC/C,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YACnB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,IAAI;YACpC,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-table-content/aico-table-content.css?tag=aico-table-content&encapsulation=scoped","src/components/content/aico-table-content/aico-table-content.tsx"],"sourcesContent":[".table-content {\n width: 100%;\n overflow-x: auto;\n white-space: nowrap;\n text-align: center;\n}\n\n.table-content:not([class]) td,\n.table-content:not([class]) th {\n padding: 10px !important;\n border: none !important;\n}\n\n.table-content th {\n font-weight: 700 !important;\n}\n\n.table-content td,\n.table-content th {\n white-space: pre-line;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport type { TableContent } from '../../../model/article/content/TableContet';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-table-content',\n styleUrl: 'aico-table-content.css',\n scoped: true,\n})\nexport class AicoTableContent {\n @Prop() content!: TableContent;\n\n render() {\n const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;\n\n const firstBackgroundColor = this.content.firstColor ?? '#d6dfe1';\n const secondBackgroundColor = this.content.secondColor ?? '#e6eced';\n\n return (\n <div class=\"content-table card\">\n <div class=\"card-body\">\n <ConditionalRender condition={translation !== null}>\n <aico-title-content class=\"card-title mt-0\" content={this.makeTitleContent(translation!)} />\n <p class=\"card-text\">{translation!.additionalText}</p>\n </ConditionalRender>\n <table class=\"table-content\">\n {this.content.tableRows\n .sort((a, b) => a.sort - b.sort)\n .map((row, index) => {\n return (\n <tr style={{ 'font-weight': '400', 'background-color': index % 2 === 0 ? firstBackgroundColor : secondBackgroundColor }}>\n {row.rowColumns.map(col => {\n const translation = col.translations.length > 0 ? col.translations[0] : null;\n if (!translation) {\n return row.isHeading ? <th></th> : <td></td>;\n }\n\n return row.isHeading ? <th>{translation.columnData}</th> : <td>{translation.columnData}</td>;\n })}\n </tr>\n );\n })}\n </table>\n </div>\n </div>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: this.content.titleSize ?? 'h2',\n translations: [{ ...translation }],\n };\n }\n}\n"],"version":3}
1
+ {"file":"aico-table-content2.js","mappings":";;;;;AAAA,MAAM,mBAAmB,GAAG,shBAAshB;;MCWriB,gBAAgB;;;;;sBAGF,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAE9G,MAAM,oBAAoB,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,mCAAI,SAAS,CAAC;QAClE,MAAM,qBAAqB,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW,mCAAI,SAAS,CAAC;QAEpE,QACE,WAAK,KAAK,EAAC,oBAAoB,IAC7B,WAAK,KA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E,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,IAAI;YACpC,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/content/aico-table-content/aico-table-content.css?tag=aico-table-content&encapsulation=scoped","src/components/content/aico-table-content/aico-table-content.tsx"],"sourcesContent":[".table-content {\n width: 100%;\n overflow-x: auto;\n white-space: nowrap;\n text-align: center;\n}\n\n.table-content:not([class]) td,\n.table-content:not([class]) th {\n padding: 10px !important;\n border: none !important;\n}\n\n.table-content th {\n font-weight: 700 !important;\n}\n\n.table-content td,\n.table-content th {\n white-space: pre-line;\n}\n","import { Component, Prop, h } from '@stencil/core';\nimport type { TableContent } from '../../../model/article/content/TableContet';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-table-content',\n styleUrl: 'aico-table-content.css',\n scoped: true,\n})\nexport class AicoTableContent {\n @Prop() content!: TableContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n\n const firstBackgroundColor = this.content.firstColor ?? '#d6dfe1';\n const secondBackgroundColor = this.content.secondColor ?? '#e6eced';\n\n return (\n <div class=\"content-table card\">\n <div class=\"card-body\">\n <ConditionalRender condition={translation !== null}>\n <aico-title-content class=\"card-title mt-0\" content={this.makeTitleContent(translation!)} locale={this.locale} />\n <p class=\"card-text\">{translation!.additionalText}</p>\n </ConditionalRender>\n <table class=\"table-content\">\n {this.content.tableRows\n .sort((a, b) => a.sort - b.sort)\n .map((row, index) => {\n return (\n <tr style={{ 'font-weight': '400', 'background-color': index % 2 === 0 ? firstBackgroundColor : secondBackgroundColor }}>\n {row.rowColumns.map(col => {\n const translation = col.translations.find(translation => translation.locale === this.locale) ?? null;\n if (!translation) {\n return row.isHeading ? <th></th> : <td></td>;\n }\n\n return row.isHeading ? <th>{translation.columnData}</th> : <td>{translation.columnData}</td>;\n })}\n </tr>\n );\n })}\n </table>\n </div>\n </div>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: this.content.titleSize ?? 'h2',\n translations: [{ ...translation }],\n };\n }\n}\n"],"version":3}
@@ -16,17 +16,15 @@ const AicoTextContent = /*@__PURE__*/ proxyCustomElement(class AicoTextContent e
16
16
  super();
17
17
  this.__registerHost();
18
18
  this.content = undefined;
19
+ this.locale = 'de';
19
20
  }
20
21
  render() {
21
- var _a, _b, _c;
22
- if (this.content.translations.length === 0) {
23
- return h("aico-no-content", null);
24
- }
25
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
22
+ var _a, _b, _c, _d;
23
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
26
24
  const contentStyles = {};
27
25
  if (this.content.hasBackgroundColor) {
28
- contentStyles['background-color'] = (_a = this.content.backgroundColor) !== null && _a !== void 0 ? _a : 'white';
29
- contentStyles['color'] = (_b = this.content.textColor) !== null && _b !== void 0 ? _b : 'black';
26
+ contentStyles['background-color'] = (_b = this.content.backgroundColor) !== null && _b !== void 0 ? _b : 'white';
27
+ contentStyles['color'] = (_c = this.content.textColor) !== null && _c !== void 0 ? _c : 'black';
30
28
  contentStyles['width'] = '100%';
31
29
  contentStyles['padding'] = '15px';
32
30
  contentStyles['margin-top'] = '10px';
@@ -37,9 +35,9 @@ const AicoTextContent = /*@__PURE__*/ proxyCustomElement(class AicoTextContent e
37
35
  }
38
36
  if (this.content.alignmentEnabled) {
39
37
  contentStyles['display'] = 'flex';
40
- contentStyles['align-items'] = (_c = this.content.verticalAlign) !== null && _c !== void 0 ? _c : 'flex-start';
38
+ contentStyles['align-items'] = (_d = this.content.verticalAlign) !== null && _d !== void 0 ? _d : 'flex-start';
41
39
  }
42
- return (h(ConditionalRender, { condition: translation !== null }, h(ConditionalWrap, { condition: !strIsNullOrEmptyOrWhitespace(translation.promptText), wrap: children => (h("div", { class: "accordion", id: "aico-text-content" }, h("div", { class: "accordion-item" }, h("h2", { class: "accordion-header", id: "heading" }, h("button", { class: "accordion-button collapsed", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse", "aria-expanded": "false", "aria-controls": "collapse" }, translation.promptText)), h("div", { id: "collapse", class: "accordion-collapse collapse", "aria-labelledby": "heading", "data-bs-parent": "#aico-text-content" }, h("div", { class: "accordion-body" }, children))))) }, h("div", { class: "card", style: contentStyles }, h("div", { class: "card-body w-100 border-0" }, h("aico-title-content", { class: "card-title", content: this.makeTitleContent(translation) }), h(ConditionalRender, { condition: this.shouldDisplayTextAndPicture(translation) }, h("div", { class: "row g-4" }, h("div", { class: getClass({
40
+ return (h(ConditionalRender, { condition: translation !== null }, h(ConditionalWrap, { condition: !strIsNullOrEmptyOrWhitespace(translation.promptText), wrap: children => (h("div", { class: "accordion", id: "aico-text-content" }, h("div", { class: "accordion-item" }, h("h2", { class: "accordion-header", id: "heading" }, h("button", { class: "accordion-button collapsed", type: "button", "data-bs-toggle": "collapse", "data-bs-target": "#collapse", "aria-expanded": "false", "aria-controls": "collapse" }, translation.promptText)), h("div", { id: "collapse", class: "accordion-collapse collapse", "aria-labelledby": "heading", "data-bs-parent": "#aico-text-content" }, h("div", { class: "accordion-body" }, children))))) }, h("div", { class: "card", style: contentStyles }, h("div", { class: "card-body w-100 border-0" }, h("aico-title-content", { class: "card-title", content: this.makeTitleContent(translation), locale: this.locale }), h(ConditionalRender, { condition: this.shouldDisplayTextAndPicture(translation) }, h("div", { class: "row g-4" }, h("div", { class: getClass({
43
41
  'col-md-8': true,
44
42
  'order-1': this.content.picturePosition === 'right',
45
43
  'order-2': this.content.picturePosition === 'left',
@@ -94,7 +92,8 @@ const AicoTextContent = /*@__PURE__*/ proxyCustomElement(class AicoTextContent e
94
92
  }
95
93
  static get style() { return aicoTextContentCss; }
96
94
  }, [2, "aico-text-content", {
97
- "content": [16]
95
+ "content": [16],
96
+ "locale": [1]
98
97
  }]);
99
98
  function defineCustomElement() {
100
99
  if (typeof customElements === "undefined") {
@@ -1 +1 @@
1
- {"file":"aico-text-content2.js","mappings":";;;;;;;AAOA,MAAM,eAAe,GAA8C,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,QAAQ;IAC/F,OAAO,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;AAC/C,CAAC;;ACTD,MAAM,kBAAkB,GAAG,EAAE;;MCahB,eAAe;;;;;;IAG1B,MAAM;;QACJ,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,OAAO,0BAAmB,CAAC;SAC5B;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;QAC/F,MAAM,aAAa,GAA0C,EAAE,CAAC;QAEhE,IAAI,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE;YACnC,aAAa,CAAC,kBAAkB,CAAC,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,eAAe,mCAAI,OAAO,CAAC;YAC5E,aAAa,CAAC,OAAO,CAAC,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,OAAO,CAAC;YAC3D,aAAa,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;YAChC,aAAa,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;YAClC,aAAa,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;SACtC;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE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BAA4B,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;KAC/K;IAEO,wBAAwB,CAAC,WAAmC;QAClE,OAAO,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;KAC9K;IAEO,qBAAqB,CAAC,WAAmC;QAC/D,OAAO,CAAC,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,4BAA4B,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAC3K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/utils/ConditionalWrap.tsx","src/components/content/aico-text-content/aico-text-content.css?tag=aico-text-content&encapsulation=scoped","src/components/content/aico-text-content/aico-text-content.tsx"],"sourcesContent":["import { FunctionalComponent, VNode } from '@stencil/core';\n\nexport type ConditionalWrapProps = {\n condition: boolean;\n wrap: (children: VNode | VNode[]) => VNode;\n};\n\nconst ConditionalWrap: FunctionalComponent<ConditionalWrapProps> = ({ condition, wrap }, children) => {\n return condition ? wrap(children) : children;\n};\n\nexport default ConditionalWrap;\n","","import { Component, Prop, VNode, h } from '@stencil/core';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport ConditionalWrap from '../../../utils/ConditionalWrap';\nimport type { TextContent, TextContentTranslation } from '../../../model/article/content/TextContent';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport { getClass, strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport 'bootstrap';\n\n@Component({\n tag: 'aico-text-content',\n styleUrl: 'aico-text-content.css',\n scoped: true,\n})\nexport class AicoTextContent {\n @Prop() content!: TextContent;\n\n render() {\n if (this.content.translations.length === 0) {\n return <aico-no-content />;\n }\n\n const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;\n const contentStyles: { [key: string]: string | undefined } = {};\n\n if (this.content.hasBackgroundColor) {\n contentStyles['background-color'] = this.content.backgroundColor ?? 'white';\n contentStyles['color'] = this.content.textColor ?? 'black';\n contentStyles['width'] = '100%';\n contentStyles['padding'] = '15px';\n contentStyles['margin-top'] = '10px';\n }\n\n if (this.content.addBorder) {\n contentStyles['border'] = `3px solid ${this.content.borderColor}`;\n contentStyles['margin-top'] = '-3px';\n }\n\n if (this.content.alignmentEnabled) {\n contentStyles['display'] = 'flex';\n contentStyles['align-items'] = this.content.verticalAlign ?? 'flex-start';\n }\n\n return (\n <ConditionalRender condition={translation !== null}>\n <ConditionalWrap\n condition={!strIsNullOrEmptyOrWhitespace(translation!.promptText)}\n wrap={children => (\n <div class=\"accordion\" id=\"aico-text-content\">\n <div class=\"accordion-item\">\n <h2 class=\"accordion-header\" id=\"heading\">\n <button class=\"accordion-button collapsed\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#collapse\" aria-expanded=\"false\" aria-controls=\"collapse\">\n {translation!.promptText}\n </button>\n </h2>\n <div id=\"collapse\" class=\"accordion-collapse collapse\" aria-labelledby=\"heading\" data-bs-parent=\"#aico-text-content\">\n <div class=\"accordion-body\">{children}</div>\n </div>\n </div>\n </div>\n )}\n >\n <div class=\"card\" style={contentStyles}>\n <div class=\"card-body w-100 border-0\">\n <aico-title-content class=\"card-title\" content={this.makeTitleContent(translation!)} />\n <ConditionalRender condition={this.shouldDisplayTextAndPicture(translation!)}>\n <div class=\"row g-4\">\n <div\n class={getClass({\n 'col-md-8': true,\n 'order-1': this.content.picturePosition === 'right',\n 'order-2': this.content.picturePosition === 'left',\n })}\n >\n {this.getTextComponent(translation!)}\n </div>\n <div\n class={getClass({\n 'col-md-4 justify-content-center': true,\n 'order-2': this.content.picturePosition === 'right',\n 'order-1': this.content.picturePosition === 'left',\n })}\n >\n {this.getImageComponent(translation!)}\n </div>\n </div>\n </ConditionalRender>\n <ConditionalRender condition={this.shouldDisplayOnlyPicture(translation!)}>{this.getImageComponent(translation!)}</ConditionalRender>\n <ConditionalRender condition={this.shouldDisplayOnlyText(translation!)}>{this.getTextComponent(translation!)}</ConditionalRender>\n </div>\n </div>\n </ConditionalWrap>\n </ConditionalRender>\n );\n }\n\n private getImageComponent(translation: TextContentTranslation): VNode {\n const imageStyles: { [key: string]: string | undefined } = {};\n\n if (this.content.focusXPercentage && this.content.focusYCoordinate) {\n imageStyles['object-position'] = `${this.content.focusXPercentage}% ${this.content.focusYPercentage}%`;\n }\n\n return (\n <div class=\"card text-bg-dark text-white\">\n <img class=\"card-img img-fluid object-fit-contain\" src={translation.optimizedPicture ?? translation.picture} />\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation.pictureLabel)}>\n <div class=\"card-img-overlay\">\n <p\n class={getClass({\n 'card-text': true,\n 'text-end': this.content.pictureLabelPosition === 'right',\n 'text-center': this.content.pictureLabelPosition === 'center',\n })}\n >\n {translation.pictureLabel}\n </p>\n </div>\n </ConditionalRender>\n </div>\n );\n }\n\n private getTextComponent(translation: TextContentTranslation): VNode {\n const textStyles: { [key: string]: string | undefined } = { 'line-height': '1.3', 'white-space': 'pre-line' };\n if (this.content.fontSize) {\n textStyles['font-size'] = `${this.content.fontSize}px`;\n }\n\n if (this.content.fontFamily) {\n textStyles['font-family'] = this.content.fontFamily;\n }\n\n if (this.content.shouldJustifyText) {\n textStyles['text-align'] = 'justify';\n textStyles['text-justify'] = 'inner-word';\n }\n\n return (\n <p class=\"card-text\" style={textStyles}>\n {translation.text}\n </p>\n );\n }\n\n private makeTitleContent(translation: TextContentTranslation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: this.content.titleSize ?? 'h1',\n titleColor: this.content.textColor,\n translations: [{ ...translation }],\n };\n }\n\n private shouldDisplayTextAndPicture(translation: TextContentTranslation): boolean {\n return !strIsNullOrEmptyOrWhitespace(translation.text) && (!strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) || !strIsNullOrEmptyOrWhitespace(translation.picture));\n }\n\n private shouldDisplayOnlyPicture(translation: TextContentTranslation): boolean {\n return strIsNullOrEmptyOrWhitespace(translation.text) && (!strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) || !strIsNullOrEmptyOrWhitespace(translation.picture));\n }\n\n private shouldDisplayOnlyText(translation: TextContentTranslation): boolean {\n return !strIsNullOrEmptyOrWhitespace(translation.text) && strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) && strIsNullOrEmptyOrWhitespace(translation.picture);\n }\n}\n"],"version":3}
1
+ {"file":"aico-text-content2.js","mappings":";;;;;;;AAOA,MAAM,eAAe,GAA8C,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,QAAQ;IAC/F,OAAO,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;AAC/C,CAAC;;ACTD,MAAM,kBAAkB,GAAG,EAAE;;MCahB,eAAe;;;;;sBAGD,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC9G,MAAM,aAAa,GAA0C,EAAE,CAAC;QAEhE,IAAI,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE;YACnC,aAAa,CAAC,kBAAkB,CAAC,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,eAAe,mCAAI,OAAO,CAAC;YAC5E,aAAa,CAAC,OAAO,CAAC,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,OAAO,CAAC;YAC3D,aAAa,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;YAChC,aAAa,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;YA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,mBAAM,WAAW,EAAG;SACnC,CAAC;KACH;IAEO,2BAA2B,CAAC,WAAmC;QACrE,OAAO,CAAC,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;KAC/K;IAEO,wBAAwB,CAAC,WAAmC;QAClE,OAAO,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;KAC9K;IAEO,qBAAqB,CAAC,WAAmC;QAC/D,OAAO,CAAC,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,4BAA4B,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;KAC3K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/utils/ConditionalWrap.tsx","src/components/content/aico-text-content/aico-text-content.css?tag=aico-text-content&encapsulation=scoped","src/components/content/aico-text-content/aico-text-content.tsx"],"sourcesContent":["import { FunctionalComponent, VNode } from '@stencil/core';\n\nexport type ConditionalWrapProps = {\n condition: boolean;\n wrap: (children: VNode | VNode[]) => VNode;\n};\n\nconst ConditionalWrap: FunctionalComponent<ConditionalWrapProps> = ({ condition, wrap }, children) => {\n return condition ? wrap(children) : children;\n};\n\nexport default ConditionalWrap;\n","","import { Component, Prop, VNode, h } from '@stencil/core';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport ConditionalWrap from '../../../utils/ConditionalWrap';\nimport type { TextContent, TextContentTranslation } from '../../../model/article/content/TextContent';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport { getClass, strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport 'bootstrap';\n\n@Component({\n tag: 'aico-text-content',\n styleUrl: 'aico-text-content.css',\n scoped: true,\n})\nexport class AicoTextContent {\n @Prop() content!: TextContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const contentStyles: { [key: string]: string | undefined } = {};\n\n if (this.content.hasBackgroundColor) {\n contentStyles['background-color'] = this.content.backgroundColor ?? 'white';\n contentStyles['color'] = this.content.textColor ?? 'black';\n contentStyles['width'] = '100%';\n contentStyles['padding'] = '15px';\n contentStyles['margin-top'] = '10px';\n }\n\n if (this.content.addBorder) {\n contentStyles['border'] = `3px solid ${this.content.borderColor}`;\n contentStyles['margin-top'] = '-3px';\n }\n\n if (this.content.alignmentEnabled) {\n contentStyles['display'] = 'flex';\n contentStyles['align-items'] = this.content.verticalAlign ?? 'flex-start';\n }\n\n return (\n <ConditionalRender condition={translation !== null}>\n <ConditionalWrap\n condition={!strIsNullOrEmptyOrWhitespace(translation!.promptText)}\n wrap={children => (\n <div class=\"accordion\" id=\"aico-text-content\">\n <div class=\"accordion-item\">\n <h2 class=\"accordion-header\" id=\"heading\">\n <button class=\"accordion-button collapsed\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#collapse\" aria-expanded=\"false\" aria-controls=\"collapse\">\n {translation!.promptText}\n </button>\n </h2>\n <div id=\"collapse\" class=\"accordion-collapse collapse\" aria-labelledby=\"heading\" data-bs-parent=\"#aico-text-content\">\n <div class=\"accordion-body\">{children}</div>\n </div>\n </div>\n </div>\n )}\n >\n <div class=\"card\" style={contentStyles}>\n <div class=\"card-body w-100 border-0\">\n <aico-title-content class=\"card-title\" content={this.makeTitleContent(translation!)} locale={this.locale} />\n <ConditionalRender condition={this.shouldDisplayTextAndPicture(translation!)}>\n <div class=\"row g-4\">\n <div\n class={getClass({\n 'col-md-8': true,\n 'order-1': this.content.picturePosition === 'right',\n 'order-2': this.content.picturePosition === 'left',\n })}\n >\n {this.getTextComponent(translation!)}\n </div>\n <div\n class={getClass({\n 'col-md-4 justify-content-center': true,\n 'order-2': this.content.picturePosition === 'right',\n 'order-1': this.content.picturePosition === 'left',\n })}\n >\n {this.getImageComponent(translation!)}\n </div>\n </div>\n </ConditionalRender>\n <ConditionalRender condition={this.shouldDisplayOnlyPicture(translation!)}>{this.getImageComponent(translation!)}</ConditionalRender>\n <ConditionalRender condition={this.shouldDisplayOnlyText(translation!)}>{this.getTextComponent(translation!)}</ConditionalRender>\n </div>\n </div>\n </ConditionalWrap>\n </ConditionalRender>\n );\n }\n\n private getImageComponent(translation: TextContentTranslation): VNode {\n const imageStyles: { [key: string]: string | undefined } = {};\n\n if (this.content.focusXPercentage && this.content.focusYCoordinate) {\n imageStyles['object-position'] = `${this.content.focusXPercentage}% ${this.content.focusYPercentage}%`;\n }\n\n return (\n <div class=\"card text-bg-dark text-white\">\n <img class=\"card-img img-fluid object-fit-contain\" src={translation.optimizedPicture ?? translation.picture} />\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation.pictureLabel)}>\n <div class=\"card-img-overlay\">\n <p\n class={getClass({\n 'card-text': true,\n 'text-end': this.content.pictureLabelPosition === 'right',\n 'text-center': this.content.pictureLabelPosition === 'center',\n })}\n >\n {translation.pictureLabel}\n </p>\n </div>\n </ConditionalRender>\n </div>\n );\n }\n\n private getTextComponent(translation: TextContentTranslation): VNode {\n const textStyles: { [key: string]: string | undefined } = { 'line-height': '1.3', 'white-space': 'pre-line' };\n if (this.content.fontSize) {\n textStyles['font-size'] = `${this.content.fontSize}px`;\n }\n\n if (this.content.fontFamily) {\n textStyles['font-family'] = this.content.fontFamily;\n }\n\n if (this.content.shouldJustifyText) {\n textStyles['text-align'] = 'justify';\n textStyles['text-justify'] = 'inner-word';\n }\n\n return (\n <p class=\"card-text\" style={textStyles}>\n {translation.text}\n </p>\n );\n }\n\n private makeTitleContent(translation: TextContentTranslation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: this.content.titleSize ?? 'h1',\n titleColor: this.content.textColor,\n translations: [{ ...translation }],\n };\n }\n\n private shouldDisplayTextAndPicture(translation: TextContentTranslation): boolean {\n return !strIsNullOrEmptyOrWhitespace(translation.text) && (!strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) || !strIsNullOrEmptyOrWhitespace(translation.picture));\n }\n\n private shouldDisplayOnlyPicture(translation: TextContentTranslation): boolean {\n return strIsNullOrEmptyOrWhitespace(translation.text) && (!strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) || !strIsNullOrEmptyOrWhitespace(translation.picture));\n }\n\n private shouldDisplayOnlyText(translation: TextContentTranslation): boolean {\n return !strIsNullOrEmptyOrWhitespace(translation.text) && strIsNullOrEmptyOrWhitespace(translation.optimizedPicture) && strIsNullOrEmptyOrWhitespace(translation.picture);\n }\n}\n"],"version":3}