@aiconomy/aico-components 0.0.53 → 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 (265) hide show
  1. package/README.md +67 -57
  2. package/dist/aico-components/aico-components.css +1 -1
  3. package/dist/aico-components/aico-components.esm.js +1 -1
  4. package/dist/aico-components/aico-components.esm.js.map +1 -1
  5. package/dist/aico-components/p-0b6e7469.entry.js +2 -0
  6. package/dist/aico-components/p-0b6e7469.entry.js.map +1 -0
  7. package/dist/aico-components/p-19752961.entry.js +2 -0
  8. package/dist/aico-components/p-19752961.entry.js.map +1 -0
  9. package/dist/aico-components/p-2677f2ab.js +2 -0
  10. package/dist/aico-components/p-2677f2ab.js.map +1 -0
  11. package/dist/aico-components/{p-a58972e9.entry.js → p-368503ee.entry.js} +3 -3
  12. package/dist/aico-components/p-368503ee.entry.js.map +1 -0
  13. package/dist/aico-components/{p-b78d7799.entry.js → p-68930822.entry.js} +2 -2
  14. package/dist/aico-components/p-7e0074f7.entry.js +2 -0
  15. package/dist/aico-components/p-7e0074f7.entry.js.map +1 -0
  16. package/dist/aico-components/{p-1a6625c0.entry.js → p-90c2d3dc.entry.js} +2 -2
  17. package/dist/aico-components/p-9ea26390.entry.js +2 -0
  18. package/dist/aico-components/p-9ea26390.entry.js.map +1 -0
  19. package/dist/aico-components/p-ae20e789.js +3 -0
  20. package/dist/aico-components/{p-2aae1a0e.js.map → p-ae20e789.js.map} +1 -1
  21. package/dist/aico-components/p-bccf08d0.entry.js +2 -0
  22. package/dist/aico-components/p-bccf08d0.entry.js.map +1 -0
  23. package/dist/aico-components/p-c9eea1b1.entry.js +2 -0
  24. package/dist/aico-components/p-c9eea1b1.entry.js.map +1 -0
  25. package/dist/cjs/aico-album-content_19.cjs.entry.js +78 -57
  26. package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -1
  27. package/dist/cjs/aico-article-detail.cjs.entry.js +19 -18
  28. package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -1
  29. package/dist/cjs/aico-asking-list-content.cjs.entry.js +1 -1
  30. package/dist/cjs/aico-collection-content.cjs.entry.js +1 -1
  31. package/dist/cjs/aico-components.cjs.js +2 -2
  32. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +12 -3
  33. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -1
  34. package/dist/cjs/aico-news-list-item.cjs.entry.js +6 -3
  35. package/dist/cjs/aico-news-list-item.cjs.entry.js.map +1 -1
  36. package/dist/cjs/aico-news-list.cjs.entry.js +9 -8
  37. package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -1
  38. package/dist/cjs/aico-no-content_2.cjs.entry.js +6 -4
  39. package/dist/cjs/aico-no-content_2.cjs.entry.js.map +1 -1
  40. package/dist/cjs/aico-special-news-carousel.cjs.entry.js +5 -4
  41. package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -1
  42. package/dist/cjs/{index-75c0e002.js → index-e52034b7.js} +1 -6
  43. package/dist/cjs/index-e52034b7.js.map +1 -0
  44. package/dist/cjs/loader.cjs.js +2 -2
  45. package/dist/cjs/{utils-406a9df3.js → utils-c1b7a052.js} +20 -5
  46. package/dist/cjs/utils-c1b7a052.js.map +1 -0
  47. package/dist/collection/collection-manifest.json +0 -1
  48. package/dist/collection/components/aico-article-detail/aico-article-detail.js +36 -17
  49. package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
  50. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +49 -5
  51. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
  52. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.stories.js +6 -0
  53. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.stories.js.map +1 -1
  54. package/dist/collection/components/aico-news-list/aico-news-list.css +0 -113
  55. package/dist/collection/components/aico-news-list/aico-news-list.js +23 -6
  56. package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
  57. package/dist/collection/components/aico-news-list/aico-news-list.stories.js +3 -0
  58. package/dist/collection/components/aico-news-list/aico-news-list.stories.js.map +1 -1
  59. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js +6 -3
  60. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js.map +1 -1
  61. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +19 -2
  62. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
  63. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js +22 -3
  64. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js.map +1 -1
  65. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js +16 -0
  66. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js.map +1 -1
  67. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js +21 -1
  68. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js.map +1 -1
  69. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js +18 -0
  70. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js.map +1 -1
  71. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js +25 -5
  72. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js.map +1 -1
  73. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js +29 -0
  74. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js.map +1 -1
  75. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js +25 -3
  76. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js.map +1 -1
  77. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js +35 -3
  78. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js.map +1 -1
  79. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js +22 -3
  80. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js.map +1 -1
  81. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js +10 -0
  82. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js.map +1 -1
  83. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js +21 -1
  84. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js.map +1 -1
  85. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js +9 -0
  86. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js.map +1 -1
  87. package/dist/collection/components/content/aico-document-content/aico-document-content.js +22 -3
  88. package/dist/collection/components/content/aico-document-content/aico-document-content.js.map +1 -1
  89. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js +11 -0
  90. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js.map +1 -1
  91. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js +21 -1
  92. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js.map +1 -1
  93. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js +25 -0
  94. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js.map +1 -1
  95. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js +22 -2
  96. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js.map +1 -1
  97. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js +10 -0
  98. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js.map +1 -1
  99. package/dist/collection/components/content/aico-html-content/aico-html-content.js +22 -4
  100. package/dist/collection/components/content/aico-html-content/aico-html-content.js.map +1 -1
  101. package/dist/collection/components/content/aico-link-content/aico-link-content.js +22 -3
  102. package/dist/collection/components/content/aico-link-content/aico-link-content.js.map +1 -1
  103. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js +24 -0
  104. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js.map +1 -1
  105. package/dist/collection/components/content/aico-page-content/aico-page-content.js +23 -4
  106. package/dist/collection/components/content/aico-page-content/aico-page-content.js.map +1 -1
  107. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js +11 -0
  108. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js.map +1 -1
  109. package/dist/collection/components/content/aico-table-content/aico-table-content.js +26 -6
  110. package/dist/collection/components/content/aico-table-content/aico-table-content.js.map +1 -1
  111. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js +58 -0
  112. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js.map +1 -1
  113. package/dist/collection/components/content/aico-text-content/aico-text-content.js +27 -11
  114. package/dist/collection/components/content/aico-text-content/aico-text-content.js.map +1 -1
  115. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js +55 -0
  116. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js.map +1 -1
  117. package/dist/collection/components/content/aico-title-content/aico-title-content.js +23 -3
  118. package/dist/collection/components/content/aico-title-content/aico-title-content.js.map +1 -1
  119. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js +12 -1
  120. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js.map +1 -1
  121. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js +22 -2
  122. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js.map +1 -1
  123. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js +8 -0
  124. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js.map +1 -1
  125. package/dist/collection/components/content/aico-video-content/aico-video-content.js +22 -2
  126. package/dist/collection/components/content/aico-video-content/aico-video-content.js.map +1 -1
  127. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js +17 -0
  128. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js.map +1 -1
  129. package/dist/collection/model/article/content/CarouselContent.js.map +1 -1
  130. package/dist/collection/utils/utils.js +18 -4
  131. package/dist/collection/utils/utils.js.map +1 -1
  132. package/dist/components/aico-article-detail2.js +20 -18
  133. package/dist/components/aico-article-detail2.js.map +1 -1
  134. package/dist/components/aico-asking-content2.js +6 -4
  135. package/dist/components/aico-asking-content2.js.map +1 -1
  136. package/dist/components/aico-block-quote-content2.js +5 -2
  137. package/dist/components/aico-block-quote-content2.js.map +1 -1
  138. package/dist/components/aico-bullet-content2.js +9 -6
  139. package/dist/components/aico-bullet-content2.js.map +1 -1
  140. package/dist/components/aico-carousel-content2.js +9 -4
  141. package/dist/components/aico-carousel-content2.js.map +1 -1
  142. package/dist/components/aico-content-card-content2.js +6 -4
  143. package/dist/components/aico-content-card-content2.js.map +1 -1
  144. package/dist/components/aico-divider-content2.js +5 -2
  145. package/dist/components/aico-divider-content2.js.map +1 -1
  146. package/dist/components/aico-document-content2.js +6 -4
  147. package/dist/components/aico-document-content2.js.map +1 -1
  148. package/dist/components/aico-faq-content2.js +5 -2
  149. package/dist/components/aico-faq-content2.js.map +1 -1
  150. package/dist/components/aico-fetch-article-detail.js +14 -3
  151. package/dist/components/aico-fetch-article-detail.js.map +1 -1
  152. package/dist/components/aico-heading-content2.js +6 -3
  153. package/dist/components/aico-heading-content2.js.map +1 -1
  154. package/dist/components/aico-html-content2.js +7 -12
  155. package/dist/components/aico-html-content2.js.map +1 -1
  156. package/dist/components/aico-link-content2.js +6 -4
  157. package/dist/components/aico-link-content2.js.map +1 -1
  158. package/dist/components/aico-news-list-item2.js +5 -2
  159. package/dist/components/aico-news-list-item2.js.map +1 -1
  160. package/dist/components/aico-news-list.js +9 -7
  161. package/dist/components/aico-news-list.js.map +1 -1
  162. package/dist/components/aico-page-content2.js +7 -5
  163. package/dist/components/aico-page-content2.js.map +1 -1
  164. package/dist/components/aico-special-news-carousel.js +5 -3
  165. package/dist/components/aico-special-news-carousel.js.map +1 -1
  166. package/dist/components/aico-table-content2.js +10 -7
  167. package/dist/components/aico-table-content2.js.map +1 -1
  168. package/dist/components/aico-text-content2.js +10 -13
  169. package/dist/components/aico-text-content2.js.map +1 -1
  170. package/dist/components/aico-title-content2.js +7 -4
  171. package/dist/components/aico-title-content2.js.map +1 -1
  172. package/dist/components/aico-upload-content2.js +6 -3
  173. package/dist/components/aico-upload-content2.js.map +1 -1
  174. package/dist/components/aico-video-content2.js +6 -3
  175. package/dist/components/aico-video-content2.js.map +1 -1
  176. package/dist/components/utils.js +19 -5
  177. package/dist/components/utils.js.map +1 -1
  178. package/dist/esm/aico-album-content_19.entry.js +78 -57
  179. package/dist/esm/aico-album-content_19.entry.js.map +1 -1
  180. package/dist/esm/aico-article-detail.entry.js +19 -18
  181. package/dist/esm/aico-article-detail.entry.js.map +1 -1
  182. package/dist/esm/aico-asking-list-content.entry.js +1 -1
  183. package/dist/esm/aico-collection-content.entry.js +1 -1
  184. package/dist/esm/aico-components.js +3 -3
  185. package/dist/esm/aico-fetch-article-detail.entry.js +12 -3
  186. package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -1
  187. package/dist/esm/aico-news-list-item.entry.js +6 -3
  188. package/dist/esm/aico-news-list-item.entry.js.map +1 -1
  189. package/dist/esm/aico-news-list.entry.js +9 -8
  190. package/dist/esm/aico-news-list.entry.js.map +1 -1
  191. package/dist/esm/aico-no-content_2.entry.js +6 -4
  192. package/dist/esm/aico-no-content_2.entry.js.map +1 -1
  193. package/dist/esm/aico-special-news-carousel.entry.js +5 -4
  194. package/dist/esm/aico-special-news-carousel.entry.js.map +1 -1
  195. package/dist/esm/{index-f9f11572.js → index-4621a8ba.js} +2 -6
  196. package/dist/esm/index-4621a8ba.js.map +1 -0
  197. package/dist/esm/loader.js +3 -3
  198. package/dist/esm/{utils-2b7ec879.js → utils-b4eec8e9.js} +20 -6
  199. package/dist/esm/utils-b4eec8e9.js.map +1 -0
  200. package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +1 -0
  201. package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +15 -1
  202. package/dist/types/components/aico-news-list/aico-news-list.d.ts +2 -1
  203. package/dist/types/components/aico-news-list/aico-news-list.stories.d.ts +2 -1
  204. package/dist/types/components/aico-news-list-item/aico-news-list-item.d.ts +1 -1
  205. package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +1 -0
  206. package/dist/types/components/content/aico-asking-content/aico-asking-content.d.ts +1 -0
  207. package/dist/types/components/content/aico-block-quote-content/aico-block-quote-content.d.ts +1 -0
  208. package/dist/types/components/content/aico-bullet-content/aico-bullet-content.d.ts +1 -0
  209. package/dist/types/components/content/aico-carousel-content/aico-carousel-content.d.ts +1 -0
  210. package/dist/types/components/content/aico-content-card-content/aico-content-card-content.d.ts +1 -0
  211. package/dist/types/components/content/aico-divider-content/aico-divider-content.d.ts +1 -0
  212. package/dist/types/components/content/aico-document-content/aico-document-content.d.ts +1 -0
  213. package/dist/types/components/content/aico-faq-content/aico-faq-content.d.ts +1 -0
  214. package/dist/types/components/content/aico-heading-content/aico-heading-content.d.ts +1 -0
  215. package/dist/types/components/content/aico-html-content/aico-html-content.d.ts +1 -0
  216. package/dist/types/components/content/aico-link-content/aico-link-content.d.ts +1 -0
  217. package/dist/types/components/content/aico-page-content/aico-page-content.d.ts +1 -0
  218. package/dist/types/components/content/aico-table-content/aico-table-content.d.ts +1 -0
  219. package/dist/types/components/content/aico-text-content/aico-text-content.d.ts +1 -0
  220. package/dist/types/components/content/aico-title-content/aico-title-content.d.ts +1 -0
  221. package/dist/types/components/content/aico-upload-content/aico-upload-content.d.ts +1 -0
  222. package/dist/types/components/content/aico-video-content/aico-video-content.d.ts +1 -0
  223. package/dist/types/components.d.ts +62 -19
  224. package/dist/types/model/article/content/CarouselContent.d.ts +4 -2
  225. package/dist/types/utils/utils.d.ts +3 -2
  226. package/package.json +3 -2
  227. package/dist/aico-components/p-2aae1a0e.js +0 -3
  228. package/dist/aico-components/p-31666f10.js +0 -2
  229. package/dist/aico-components/p-31666f10.js.map +0 -1
  230. package/dist/aico-components/p-42b98baf.entry.js +0 -2
  231. package/dist/aico-components/p-42b98baf.entry.js.map +0 -1
  232. package/dist/aico-components/p-54708dd0.entry.js +0 -2
  233. package/dist/aico-components/p-54708dd0.entry.js.map +0 -1
  234. package/dist/aico-components/p-776352ba.entry.js +0 -2
  235. package/dist/aico-components/p-776352ba.entry.js.map +0 -1
  236. package/dist/aico-components/p-7c05cd02.entry.js +0 -2
  237. package/dist/aico-components/p-7c05cd02.entry.js.map +0 -1
  238. package/dist/aico-components/p-83655dd4.entry.js +0 -2
  239. package/dist/aico-components/p-83655dd4.entry.js.map +0 -1
  240. package/dist/aico-components/p-a58972e9.entry.js.map +0 -1
  241. package/dist/aico-components/p-b0325a83.entry.js +0 -2
  242. package/dist/aico-components/p-b0325a83.entry.js.map +0 -1
  243. package/dist/aico-components/p-c99617a8.entry.js +0 -2
  244. package/dist/aico-components/p-c99617a8.entry.js.map +0 -1
  245. package/dist/cjs/bootstrap-slick-test.cjs.entry.js +0 -38
  246. package/dist/cjs/bootstrap-slick-test.cjs.entry.js.map +0 -1
  247. package/dist/cjs/index-75c0e002.js.map +0 -1
  248. package/dist/cjs/utils-406a9df3.js.map +0 -1
  249. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.css +0 -6
  250. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.js +0 -37
  251. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.js.map +0 -1
  252. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.stories.js +0 -6
  253. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.stories.js.map +0 -1
  254. package/dist/collection/components/content/content-styles.css +0 -113
  255. package/dist/components/bootstrap-slick-test.d.ts +0 -11
  256. package/dist/components/bootstrap-slick-test.js +0 -51
  257. package/dist/components/bootstrap-slick-test.js.map +0 -1
  258. package/dist/esm/bootstrap-slick-test.entry.js +0 -34
  259. package/dist/esm/bootstrap-slick-test.entry.js.map +0 -1
  260. package/dist/esm/index-f9f11572.js.map +0 -1
  261. package/dist/esm/utils-2b7ec879.js.map +0 -1
  262. package/dist/types/components/bootstrap-slick-test/bootstrap-slick-test.d.ts +0 -5
  263. package/dist/types/components/bootstrap-slick-test/bootstrap-slick-test.stories.d.ts +0 -5
  264. /package/dist/aico-components/{p-b78d7799.entry.js.map → p-68930822.entry.js.map} +0 -0
  265. /package/dist/aico-components/{p-1a6625c0.entry.js.map → p-90c2d3dc.entry.js.map} +0 -0
@@ -7,6 +7,7 @@ export class AicoCarouselContent {
7
7
  constructor() {
8
8
  this.content = undefined;
9
9
  this.hasArrows = true;
10
+ this.locale = 'de';
10
11
  }
11
12
  componentDidLoad() {
12
13
  $('.carousel').slick({
@@ -19,11 +20,14 @@ export class AicoCarouselContent {
19
20
  });
20
21
  }
21
22
  render() {
22
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
23
- return (h(Host, null, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { content: this.makeTitleContent(translation) })), h("div", { class: "carousel" }, this.content.contentCarouselImages
23
+ var _a;
24
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
25
+ return (h(Host, null, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { content: this.makeTitleContent(translation), locale: this.locale })), h("div", { class: "carousel" }, this.content.contentCarouselImages
24
26
  .sort((a, b) => a.order - b.order)
25
27
  .map(content => {
26
- return (h("div", { class: "carousel-item card text-bg-dark text-white" }, h("div", { class: "ratio ratio-16x9 mx-auto", style: { 'max-width': '50%' } }, h("img", { class: "card-img d-block object-fit-cover", alt: "Carousel Picture", "data-lazy": content.picture })), h(ConditionalRender, { condition: content.translations.length > 0 && !strIsNullOrEmptyOrWhitespace(content.translations[0].title) }, h("div", { class: "card-img-overlay d-flex align-items-end" }, h("h5", { class: "card-title text-uppercase" }, content.translations[0].title)))));
28
+ var _a;
29
+ const translation = (_a = content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
30
+ return (h("div", { class: "carousel-item card text-bg-dark text-white" }, h("div", { class: "ratio ratio-16x9 mx-auto", style: { 'max-width': '50%' } }, h("img", { class: "card-img d-block object-fit-cover", alt: "Carousel Picture", "data-lazy": translation === null || translation === void 0 ? void 0 : translation.picture })), h(ConditionalRender, { condition: content.translations.length > 0 && !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.title) }, h("div", { class: "card-img-overlay d-flex align-items-end" }, h("h5", { class: "card-title text-uppercase" }, translation === null || translation === void 0 ? void 0 : translation.title)))));
27
31
  }))));
28
32
  }
29
33
  makeTitleContent(translation) {
@@ -88,6 +92,24 @@ export class AicoCarouselContent {
88
92
  "attribute": "has-arrows",
89
93
  "reflect": false,
90
94
  "defaultValue": "true"
95
+ },
96
+ "locale": {
97
+ "type": "string",
98
+ "mutable": false,
99
+ "complexType": {
100
+ "original": "string",
101
+ "resolved": "string",
102
+ "references": {}
103
+ },
104
+ "required": false,
105
+ "optional": false,
106
+ "docs": {
107
+ "tags": [],
108
+ "text": ""
109
+ },
110
+ "attribute": "locale",
111
+ "reflect": false,
112
+ "defaultValue": "'de'"
91
113
  }
92
114
  };
93
115
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-carousel-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-carousel-content/aico-carousel-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAIpE,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAOxB,MAAM,OAAO,mBAAmB;;;yBAGD,IAAI;;IAEjC,gBAAgB;QACd,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;YACnB,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,IAAI;YACnB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI,CAAC,SAAS;YACtB,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED,MAAM;QAC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B,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,IAAI;YACV,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport { CarouselContent } from '../../../model/article/content/CarouselContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport { Translation } from '../../../model/article/Translation';\nimport { TitleContent } from '../../../model/article/content/TitleContent';\n\nimport $ from 'jquery';\nimport 'slick-carousel';\n\n@Component({\n tag: 'aico-carousel-content',\n styleUrl: 'aico-carousel-content.css',\n scoped: true,\n})\nexport class AicoCarouselContent {\n @Prop() content!: CarouselContent;\n\n @Prop() hasArrows: boolean = true;\n\n componentDidLoad() {\n $('.carousel').slick({\n autoplay: true,\n autoplaySpeed: 6000,\n fade: true,\n dots: true,\n arrows: this.hasArrows,\n pauseOnDotsHover: true,\n });\n }\n\n render() {\n const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;\n\n return (\n <Host>\n <ConditionalRender condition={translation !== null}>\n <aico-title-content content={this.makeTitleContent(translation!)} />\n </ConditionalRender>\n <div class=\"carousel\">\n {this.content.contentCarouselImages\n .sort((a, b) => a.order - b.order)\n .map(content => {\n return (\n <div class=\"carousel-item card text-bg-dark text-white\">\n <div class=\"ratio ratio-16x9 mx-auto\" style={{ 'max-width': '50%' }}>\n <img class=\"card-img d-block object-fit-cover\" alt=\"Carousel Picture\" data-lazy={content.picture} />\n </div>\n <ConditionalRender condition={content.translations.length > 0 && !strIsNullOrEmptyOrWhitespace(content.translations[0].title)}>\n <div class=\"card-img-overlay d-flex align-items-end\">\n <h5 class=\"card-title text-uppercase\">{content.translations[0].title}</h5>\n </div>\n </ConditionalRender>\n </div>\n );\n })}\n </div>\n </Host>\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: 'h2',\n translations: [{ ...translation }],\n };\n }\n}\n"]}
1
+ {"version":3,"file":"aico-carousel-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-carousel-content/aico-carousel-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAIpE,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAOxB,MAAM,OAAO,mBAAmB;;;yBAGD,IAAI;sBAER,IAAI;;IAE7B,gBAAgB;QACd,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;YACnB,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,IAAI;YACnB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI,CAAC,SAAS;YACtB,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IAED,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC9G,OAAO,CACL,EAAC,IAAI;YACH,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI;gBAChD,0BAAoB,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,WAAY,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM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YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport { CarouselContent } from '../../../model/article/content/CarouselContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport { Translation } from '../../../model/article/Translation';\nimport { TitleContent } from '../../../model/article/content/TitleContent';\n\nimport $ from 'jquery';\nimport 'slick-carousel';\n\n@Component({\n tag: 'aico-carousel-content',\n styleUrl: 'aico-carousel-content.css',\n scoped: true,\n})\nexport class AicoCarouselContent {\n @Prop() content!: CarouselContent;\n\n @Prop() hasArrows: boolean = true;\n\n @Prop() locale: string = 'de';\n\n componentDidLoad() {\n $('.carousel').slick({\n autoplay: true,\n autoplaySpeed: 6000,\n fade: true,\n dots: true,\n arrows: this.hasArrows,\n pauseOnDotsHover: true,\n });\n }\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n return (\n <Host>\n <ConditionalRender condition={translation !== null}>\n <aico-title-content content={this.makeTitleContent(translation!)} locale={this.locale} />\n </ConditionalRender>\n <div class=\"carousel\">\n {this.content.contentCarouselImages\n .sort((a, b) => a.order - b.order)\n .map(content => {\n const translation = content.translations.find(translation => translation.locale === this.locale) ?? null;\n\n return (\n <div class=\"carousel-item card text-bg-dark text-white\">\n <div class=\"ratio ratio-16x9 mx-auto\" style={{ 'max-width': '50%' }}>\n <img class=\"card-img d-block object-fit-cover\" alt=\"Carousel Picture\" data-lazy={translation?.picture} />\n </div>\n <ConditionalRender condition={content.translations.length > 0 && !strIsNullOrEmptyOrWhitespace(translation?.title)}>\n <div class=\"card-img-overlay d-flex align-items-end\">\n <h5 class=\"card-title text-uppercase\">{translation?.title}</h5>\n </div>\n </ConditionalRender>\n </div>\n );\n })}\n </div>\n </Host>\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: 'h2',\n translations: [{ ...translation }],\n };\n }\n}\n"]}
@@ -4,6 +4,7 @@ const meta = {
4
4
  export default meta;
5
5
  export const Example = {
6
6
  args: {
7
+ locale: 'de',
7
8
  content: {
8
9
  id: 1234,
9
10
  createdAt: new Date(),
@@ -16,6 +17,13 @@ export const Example = {
16
17
  locale: 'en-GB',
17
18
  title: 'Carusel title',
18
19
  },
20
+ {
21
+ id: 1234,
22
+ createdAt: new Date(),
23
+ updatedAt: new Date(),
24
+ locale: 'de',
25
+ title: 'Carusel title de',
26
+ },
19
27
  ],
20
28
  contentCarouselImages: [
21
29
  {
@@ -23,7 +31,6 @@ export const Example = {
23
31
  createdAt: new Date(),
24
32
  updatedAt: new Date(),
25
33
  order: 2,
26
- picture: 'https://source.unsplash.com/random/320x240',
27
34
  translations: [
28
35
  {
29
36
  id: 1234,
@@ -31,6 +38,15 @@ export const Example = {
31
38
  updatedAt: new Date(),
32
39
  locale: 'en-GB',
33
40
  title: 'bar',
41
+ picture: 'https://source.unsplash.com/random/320x240',
42
+ },
43
+ {
44
+ id: 1234,
45
+ createdAt: new Date(),
46
+ updatedAt: new Date(),
47
+ locale: 'de',
48
+ title: 'bar de',
49
+ picture: 'https://source.unsplash.com/random/320x240',
34
50
  },
35
51
  ],
36
52
  },
@@ -39,7 +55,6 @@ export const Example = {
39
55
  createdAt: new Date(),
40
56
  updatedAt: new Date(),
41
57
  order: 1,
42
- picture: 'https://source.unsplash.com/random/320x240',
43
58
  translations: [
44
59
  {
45
60
  id: 1234,
@@ -47,6 +62,15 @@ export const Example = {
47
62
  updatedAt: new Date(),
48
63
  locale: 'en-GB',
49
64
  title: 'foo',
65
+ picture: 'https://source.unsplash.com/random/320x240',
66
+ },
67
+ {
68
+ id: 1234,
69
+ createdAt: new Date(),
70
+ updatedAt: new Date(),
71
+ locale: 'de',
72
+ title: 'foo de',
73
+ picture: 'https://source.unsplash.com/random/320x240',
50
74
  },
51
75
  ],
52
76
  },
@@ -55,7 +79,6 @@ export const Example = {
55
79
  createdAt: new Date(),
56
80
  updatedAt: new Date(),
57
81
  order: 3,
58
- picture: 'https://source.unsplash.com/random/320x240',
59
82
  translations: [
60
83
  {
61
84
  id: 1234,
@@ -63,6 +86,15 @@ export const Example = {
63
86
  updatedAt: new Date(),
64
87
  locale: 'en-GB',
65
88
  title: 'baz',
89
+ picture: 'https://source.unsplash.com/random/320x240',
90
+ },
91
+ {
92
+ id: 1234,
93
+ createdAt: new Date(),
94
+ updatedAt: new Date(),
95
+ locale: 'de',
96
+ title: 'baz de',
97
+ picture: 'https://source.unsplash.com/random/320x240',
66
98
  },
67
99
  ],
68
100
  },
@@ -1 +1 @@
1
- {"version":3,"file":"aico-carousel-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-carousel-content/aico-carousel-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAkC;IAC1C,SAAS,EAAE,uBAAuB;CACnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,eAAe;iBACvB;aACF;YACD,qBAAqB,EAAE;gBACrB;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,CAAC;oBACR,OAAO,EAAE,4CAA4C;oBACrD,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,KAAK,EAAE,KAAK;yBACb;qBACF;iBACF;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,CAAC;oBACR,OAAO,EAAE,4CAA4C;oBACrD,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,KAAK,EAAE,KAAK;yBACb;qBACF;iBACF;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,CAAC;oBACR,OAAO,EAAE,4CAA4C;oBACrD,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,KAAK,EAAE,KAAK;yBACb;qBACF;iBACF;aACF;SACiB;KACrB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { CarouselContent } from '../../../model/article/content/CarouselContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoCarouselContent> = {\n component: 'aico-carousel-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'Carusel title',\n },\n ],\n contentCarouselImages: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n order: 2,\n picture: 'https://source.unsplash.com/random/320x240',\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'bar',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n order: 1,\n picture: 'https://source.unsplash.com/random/320x240',\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'foo',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n order: 3,\n picture: 'https://source.unsplash.com/random/320x240',\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'baz',\n },\n ],\n },\n ],\n } as CarouselContent,\n },\n};\n"]}
1
+ {"version":3,"file":"aico-carousel-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-carousel-content/aico-carousel-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAkC;IAC1C,SAAS,EAAE,uBAAuB;CACnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,eAAe;iBACvB;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE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,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,CAAC;oBACR,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,KAAK,EAAE,KAAK;4BACZ,OAAO,EAAE,4CAA4C;yBACtD;wBACD;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,IAAI;4BACZ,KAAK,EAAE,QAAQ;4BACf,OAAO,EAAE,4CAA4C;yBACtD;qBACF;iBACF;aACF;SACiB;KACrB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { CarouselContent } from '../../../model/article/content/CarouselContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoCarouselContent> = {\n component: 'aico-carousel-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'Carusel title',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n title: 'Carusel title de',\n },\n ],\n contentCarouselImages: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n order: 2,\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'bar',\n picture: 'https://source.unsplash.com/random/320x240',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n title: 'bar de',\n picture: 'https://source.unsplash.com/random/320x240',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n order: 1,\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'foo',\n picture: 'https://source.unsplash.com/random/320x240',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n title: 'foo de',\n picture: 'https://source.unsplash.com/random/320x240',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n order: 3,\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'baz',\n picture: 'https://source.unsplash.com/random/320x240',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n title: 'baz de',\n picture: 'https://source.unsplash.com/random/320x240',\n },\n ],\n },\n ],\n } as CarouselContent,\n },\n};\n"]}
@@ -4,11 +4,12 @@ import ConditionalRender from "../../../utils/ConditionalRender";
4
4
  export class AicoContentCardContent {
5
5
  constructor() {
6
6
  this.content = undefined;
7
+ this.locale = 'de';
7
8
  }
8
9
  render() {
9
- var _a;
10
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
11
- return (h("div", { class: "card", style: { width: '18rem' } }, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.picture) }, h("img", { class: "card-img-top", alt: "Card picture", src: this.content.picture })), h("div", { class: "card-body" }, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.title) }, h("aico-title-content", { class: "card-title", content: this.makeTitleContent(translation) })), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.link) }, h("a", { class: "card-link", href: this.content.link, target: "_blank" }, (_a = translation === null || translation === void 0 ? void 0 : translation.linkText) !== null && _a !== void 0 ? _a : 'link')))));
10
+ var _a, _b;
11
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
12
+ return (h("div", { class: "card", style: { width: '18rem' } }, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.picture) }, h("img", { class: "card-img-top", alt: "Card picture", src: this.content.picture })), h("div", { class: "card-body" }, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.title) }, h("aico-title-content", { class: "card-title", content: this.makeTitleContent(translation), locale: this.locale })), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.link) }, h("a", { class: "card-link", href: this.content.link, target: "_blank" }, (_b = translation === null || translation === void 0 ? void 0 : translation.linkText) !== null && _b !== void 0 ? _b : 'link')))));
12
13
  }
13
14
  makeTitleContent(translation) {
14
15
  var _a;
@@ -55,6 +56,24 @@ export class AicoContentCardContent {
55
56
  "tags": [],
56
57
  "text": ""
57
58
  }
59
+ },
60
+ "locale": {
61
+ "type": "string",
62
+ "mutable": false,
63
+ "complexType": {
64
+ "original": "string",
65
+ "resolved": "string",
66
+ "references": {}
67
+ },
68
+ "required": false,
69
+ "optional": false,
70
+ "docs": {
71
+ "tags": [],
72
+ "text": ""
73
+ },
74
+ "attribute": "locale",
75
+ "reflect": false,
76
+ "defaultValue": "'de'"
58
77
  }
59
78
  };
60
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-content-card-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-content-card-content/aico-content-card-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAUjE,MAAM,OAAO,sBAAsB;;;;IAGjC,MAAM;;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CA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J,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport type { CardContent } from '../../../model/article/content/CardContent';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\n\n@Component({\n tag: 'aico-content-card-content',\n styleUrl: 'aico-content-card-content.css',\n scoped: true,\n})\nexport class AicoContentCardContent {\n @Prop() content!: CardContent;\n\n render() {\n const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;\n\n return (\n <div class=\"card\" style={{ width: '18rem' }}>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(this.content.picture)}>\n <img class=\"card-img-top\" alt=\"Card picture\" src={this.content.picture} />\n </ConditionalRender>\n <div class=\"card-body\">\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.title)}>\n <aico-title-content class=\"card-title\" content={this.makeTitleContent(translation!)} />\n </ConditionalRender>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(this.content.link)}>\n <a class=\"card-link\" href={this.content.link} target=\"_blank\">\n {translation?.linkText ?? 'link'}\n </a>\n </ConditionalRender>\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 ?? 'h1',\n translations: [{ ...translation }],\n };\n }\n}\n"]}
1
+ {"version":3,"file":"aico-content-card-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-content-card-content/aico-content-card-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,iBAAiB,MAAM,kC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ACnB,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;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport type { CardContent } from '../../../model/article/content/CardContent';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\n\n@Component({\n tag: 'aico-content-card-content',\n styleUrl: 'aico-content-card-content.css',\n scoped: true,\n})\nexport class AicoContentCardContent {\n @Prop() content!: CardContent;\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 <div class=\"card\" style={{ width: '18rem' }}>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(this.content.picture)}>\n <img class=\"card-img-top\" alt=\"Card picture\" src={this.content.picture} />\n </ConditionalRender>\n <div class=\"card-body\">\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.title)}>\n <aico-title-content class=\"card-title\" content={this.makeTitleContent(translation!)} locale={this.locale} />\n </ConditionalRender>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(this.content.link)}>\n <a class=\"card-link\" href={this.content.link} target=\"_blank\">\n {translation?.linkText ?? 'link'}\n </a>\n </ConditionalRender>\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 ?? 'h1',\n translations: [{ ...translation }],\n };\n }\n}\n"]}
@@ -4,6 +4,7 @@ const meta = {
4
4
  export default meta;
5
5
  export const Example = {
6
6
  args: {
7
+ locale: 'de',
7
8
  content: {
8
9
  id: 1234,
9
10
  createdAt: new Date(),
@@ -15,6 +16,15 @@ export const Example = {
15
16
  updatedAt: new Date(),
16
17
  title: 'Card content',
17
18
  linkText: 'hehe',
19
+ locale: 'en-GB'
20
+ },
21
+ {
22
+ id: 1234,
23
+ createdAt: new Date(),
24
+ updatedAt: new Date(),
25
+ title: 'Card content de',
26
+ linkText: 'hehe de',
27
+ locale: 'de'
18
28
  },
19
29
  ],
20
30
  picture: 'https://source.unsplash.com/random/320x240',
@@ -1 +1 @@
1
- {"version":3,"file":"aico-content-card-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-content-card-content/aico-content-card-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAqC;IAC7C,SAAS,EAAE,2BAA2B;CACvC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,cAAc;oBACrB,QAAQ,EAAE,MAAM;iBACjB;aACF;YACD,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,6CAA6C;YACnD,SAAS,EAAE,IAAI;SACD;KACjB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { CardContent } from '../../../model/article/content/CardContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoContentCardContent> = {\n component: 'aico-content-card-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Card content',\n linkText: 'hehe',\n },\n ],\n picture: 'https://source.unsplash.com/random/320x240',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n titleSize: 'h2',\n } as CardContent,\n },\n};\n"]}
1
+ {"version":3,"file":"aico-content-card-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-content-card-content/aico-content-card-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAqC;IAC7C,SAAS,EAAE,2BAA2B;CACvC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,cAAc;oBACrB,QAAQ,EAAE,MAAM;oBAChB,MAAM,EAAE,OAAO;iBAChB;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,iBAAiB;oBACxB,QAAQ,EAAE,SAAS;oBACnB,MAAM,EAAE,IAAI;iBACb;aACF;YACD,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,6CAA6C;YACnD,SAAS,EAAE,IAAI;SACD;KACjB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { CardContent } from '../../../model/article/content/CardContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoContentCardContent> = {\n component: 'aico-content-card-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Card content',\n linkText: 'hehe',\n locale: 'en-GB'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Card content de',\n linkText: 'hehe de',\n locale: 'de'\n },\n ],\n picture: 'https://source.unsplash.com/random/320x240',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n titleSize: 'h2',\n } as CardContent,\n },\n};\n"]}
@@ -2,9 +2,11 @@ import { Host, h } from "@stencil/core";
2
2
  export class AicoDividerContent {
3
3
  constructor() {
4
4
  this.content = undefined;
5
+ this.locale = 'de';
5
6
  }
6
7
  render() {
7
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
8
+ var _a;
9
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
8
10
  const isOnlyMargin = translation ? translation.isOnlyMargin : this.content.isOnlyMargin;
9
11
  return h(Host, null, isOnlyMargin ? h("div", { style: { 'padding-top': '40px' } }) : h("hr", { style: { margin: '5px' } }));
10
12
  }
@@ -42,6 +44,24 @@ export class AicoDividerContent {
42
44
  "tags": [],
43
45
  "text": ""
44
46
  }
47
+ },
48
+ "locale": {
49
+ "type": "string",
50
+ "mutable": false,
51
+ "complexType": {
52
+ "original": "string",
53
+ "resolved": "string",
54
+ "references": {}
55
+ },
56
+ "required": false,
57
+ "optional": false,
58
+ "docs": {
59
+ "tags": [],
60
+ "text": ""
61
+ },
62
+ "attribute": "locale",
63
+ "reflect": false,
64
+ "defaultValue": "'de'"
45
65
  }
46
66
  };
47
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-divider-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-divider-content/aico-divider-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQzD,MAAM,OAAO,kBAAkB;;;;IAG7B,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/F,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QACxF,OAAO,EAAC,IAAI,QAAE,YAAY,CAAC,CAAC,CAAC,WAAK,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,GAAI,CAAC,CAAC,CAAC,UAAI,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAI,CAAQ,CAAC;IACpH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport type { DividerContent } from '../../../model/article/content/DividerContent';\n\n@Component({\n tag: 'aico-divider-content',\n styleUrl: 'aico-divider-content.css',\n scoped: true,\n})\nexport class AicoDividerContent {\n @Prop() content!: DividerContent;\n\n render() {\n const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;\n const isOnlyMargin = translation ? translation.isOnlyMargin : this.content.isOnlyMargin;\n return <Host>{isOnlyMargin ? <div style={{ 'padding-top': '40px' }} /> : <hr style={{ margin: '5px' }} />}</Host>;\n }\n}\n"]}
1
+ {"version":3,"file":"aico-divider-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-divider-content/aico-divider-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQzD,MAAM,OAAO,kBAAkB;;;sBAGJ,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC9G,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QACxF,OAAO,EAAC,IAAI,QAAE,YAAY,CAAC,CAAC,CAAC,WAAK,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,GAAI,CAAC,CAAC,CAAC,UAAI,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAI,CAAQ,CAAC;IACpH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport type { DividerContent } from '../../../model/article/content/DividerContent';\n\n@Component({\n tag: 'aico-divider-content',\n styleUrl: 'aico-divider-content.css',\n scoped: true,\n})\nexport class AicoDividerContent {\n @Prop() content!: DividerContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const isOnlyMargin = translation ? translation.isOnlyMargin : this.content.isOnlyMargin;\n return <Host>{isOnlyMargin ? <div style={{ 'padding-top': '40px' }} /> : <hr style={{ margin: '5px' }} />}</Host>;\n }\n}\n"]}
@@ -4,6 +4,7 @@ const meta = {
4
4
  export default meta;
5
5
  export const Example = {
6
6
  args: {
7
+ locale: 'de',
7
8
  content: {
8
9
  id: 1234,
9
10
  createdAt: new Date(),
@@ -14,6 +15,14 @@ export const Example = {
14
15
  createdAt: new Date(),
15
16
  updatedAt: new Date(),
16
17
  isOnlyMargin: false,
18
+ locale: 'en-GB'
19
+ },
20
+ {
21
+ id: 1234,
22
+ createdAt: new Date(),
23
+ updatedAt: new Date(),
24
+ isOnlyMargin: true,
25
+ locale: 'de'
17
26
  },
18
27
  ],
19
28
  isOnlyMargin: false,
@@ -1 +1 @@
1
- {"version":3,"file":"aico-divider-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-divider-content/aico-divider-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAiC;IACzC,SAAS,EAAE,sBAAsB;CAClC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE,KAAK;iBACpB;aACF;YACD,YAAY,EAAE,KAAK;SACF;KACpB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { DividerContent } from '../../../model/article/content/DividerContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoDividerContent> = {\n component: 'aico-divider-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n isOnlyMargin: false,\n },\n ],\n isOnlyMargin: false,\n } as DividerContent,\n },\n};\n"]}
1
+ {"version":3,"file":"aico-divider-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-divider-content/aico-divider-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAiC;IACzC,SAAS,EAAE,sBAAsB;CAClC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE,KAAK;oBACnB,MAAM,EAAE,OAAO;iBAChB;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE,IAAI;oBAClB,MAAM,EAAE,IAAI;iBACb;aACF;YACD,YAAY,EAAE,KAAK;SACF;KACpB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { DividerContent } from '../../../model/article/content/DividerContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoDividerContent> = {\n component: 'aico-divider-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n isOnlyMargin: false,\n locale: 'en-GB'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n isOnlyMargin: true,\n locale: 'de'\n },\n ],\n isOnlyMargin: false,\n } as DividerContent,\n },\n};\n"]}
@@ -4,10 +4,11 @@ import { strIsNullOrEmptyOrWhitespace } from "../../../utils/utils";
4
4
  export class AicoDocumentContent {
5
5
  constructor() {
6
6
  this.content = undefined;
7
+ this.locale = 'de';
7
8
  }
8
9
  render() {
9
- var _a;
10
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
10
+ var _a, _b;
11
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
11
12
  const linkStyles = {};
12
13
  const buttonStyles = {};
13
14
  if (this.content.fontSize) {
@@ -30,7 +31,7 @@ export class AicoDocumentContent {
30
31
  if (this.content.isDocumentDisplayedAsButton && this.content.buttonHoverColor) {
31
32
  buttonStyles['--hover-button-color'] = this.content.buttonHoverColor;
32
33
  }
33
- return (h("div", { class: "card" }, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.picture) }, h("img", { class: "card-img-top", alt: "image", src: translation.picture })), h("div", { class: "card-body" }, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.link) }, h("a", { class: "card-link", style: linkStyles, href: this.content.link }, this.content.link)), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.document) }, h("a", { href: translation.document, target: "_blank", style: buttonStyles, class: `card-link align-middle ${this.content.isDocumentDisplayedAsButton ? 'btn button-link' : ''}` }, h("i", null, h("svg", { xmlns: "http://www.w3.org/2000/svg", x: "0px", y: "0px", width: "24", height: "24", viewBox: "0 0 50 50" }, h("path", { d: "M 7 2 L 7 48 L 43 48 L 43 14.59375 L 42.71875 14.28125 L 30.71875 2.28125 L 30.40625 2 Z M 9 4 L 29 4 L 29 16 L 41 16 L 41 46 L 9 46 Z M 31 5.4375 L 39.5625 14 L 31 14 Z" }))), (_a = translation.title) !== null && _a !== void 0 ? _a : 'File')))));
34
+ return (h("div", { class: "card" }, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.picture) }, h("img", { class: "card-img-top", alt: "image", src: translation.picture })), h("div", { class: "card-body" }, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.link) }, h("a", { class: "card-link", style: linkStyles, href: this.content.link }, this.content.link)), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.document) }, h("a", { href: translation.document, target: "_blank", style: buttonStyles, class: `card-link align-middle ${this.content.isDocumentDisplayedAsButton ? 'btn button-link' : ''}` }, h("i", null, h("svg", { xmlns: "http://www.w3.org/2000/svg", x: "0px", y: "0px", width: "24", height: "24", viewBox: "0 0 50 50" }, h("path", { d: "M 7 2 L 7 48 L 43 48 L 43 14.59375 L 42.71875 14.28125 L 30.71875 2.28125 L 30.40625 2 Z M 9 4 L 29 4 L 29 16 L 41 16 L 41 46 L 9 46 Z M 31 5.4375 L 39.5625 14 L 31 14 Z" }))), (_b = translation.title) !== null && _b !== void 0 ? _b : 'File')))));
34
35
  }
35
36
  static get is() { return "aico-document-content"; }
36
37
  static get encapsulation() { return "scoped"; }
@@ -66,6 +67,24 @@ export class AicoDocumentContent {
66
67
  "tags": [],
67
68
  "text": ""
68
69
  }
70
+ },
71
+ "locale": {
72
+ "type": "string",
73
+ "mutable": false,
74
+ "complexType": {
75
+ "original": "string",
76
+ "resolved": "string",
77
+ "references": {}
78
+ },
79
+ "required": false,
80
+ "optional": false,
81
+ "docs": {
82
+ "tags": [],
83
+ "text": ""
84
+ },
85
+ "attribute": "locale",
86
+ "reflect": false,
87
+ "defaultValue": "'de'"
69
88
  }
70
89
  };
71
90
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-document-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-document-content/aico-document-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAQpE,MAAM,OAAO,mBAAmB;;;;IAG9B,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MAAM,CAC3B,CACc,CAChB,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport type { DocumentContent } from '../../../model/article/content/DocumentContent';\n\n@Component({\n tag: 'aico-document-content',\n styleUrl: 'aico-document-content.css',\n scoped: true,\n})\nexport class AicoDocumentContent {\n @Prop() content!: DocumentContent;\n\n render() {\n const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;\n const linkStyles: { [key: string]: string | undefined } = {};\n const buttonStyles: { [key: string]: string | undefined } = {};\n\n if (this.content.fontSize) {\n linkStyles['font-size'] = `${this.content.fontSize}px`;\n buttonStyles['font-size'] = `${this.content.fontSize}px`;\n }\n\n if (this.content.fontFamily) {\n linkStyles['font-family'] = this.content.fontFamily;\n buttonStyles['font-family'] = this.content.fontFamily;\n }\n\n if (this.content.isDocumentDisplayedAsButton && this.content.buttonTextColor) {\n buttonStyles['color'] = this.content.buttonTextColor;\n }\n\n if (this.content.isDocumentDisplayedAsButton && this.content.buttonBackgroundColor) {\n buttonStyles['background-color'] = this.content.buttonBackgroundColor;\n }\n\n if (this.content.isDocumentDisplayedAsButton && this.content.buttonBorderColor) {\n buttonStyles['border-color'] = this.content.buttonBorderColor;\n }\n\n if (this.content.isDocumentDisplayedAsButton && this.content.buttonHoverColor) {\n buttonStyles['--hover-button-color'] = this.content.buttonHoverColor;\n }\n\n return (\n <div class=\"card\">\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.picture)}>\n <img class=\"card-img-top\" alt=\"image\" src={translation!.picture} />\n </ConditionalRender>\n <div class=\"card-body\">\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(this.content.link)}>\n <a class=\"card-link\" style={linkStyles} href={this.content.link}>\n {this.content.link}\n </a>\n </ConditionalRender>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.document)}>\n <a\n href={translation!.document}\n target=\"_blank\"\n style={buttonStyles}\n class={`card-link align-middle ${this.content.isDocumentDisplayedAsButton ? 'btn button-link' : ''}`}\n >\n <i>\n <svg xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\" width=\"24\" height=\"24\" viewBox=\"0 0 50 50\">\n <path d=\"M 7 2 L 7 48 L 43 48 L 43 14.59375 L 42.71875 14.28125 L 30.71875 2.28125 L 30.40625 2 Z M 9 4 L 29 4 L 29 16 L 41 16 L 41 46 L 9 46 Z M 31 5.4375 L 39.5625 14 L 31 14 Z\"></path>\n </svg>\n </i>\n {translation!.title ?? 'File'}\n </a>\n </ConditionalRender>\n </div>\n </div>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"aico-document-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-document-content/aico-document-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAQpE,MAAM,OAAO,mBAAmB;;;sBAGL,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC9G,MAAM,UAAU,GAA0C,EAAE,CAAC;QAC7D,MAAM,YAAY,GAA0C,EAAE,CAAC;QAE/D,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;YACzB,UAAU,CAAC,WAAW,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC;YACvD,YAAY,CAAC,WAAW,CAAC,GAAG,GAAG,IAAI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SAAS,EAAE,CAAC,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;oBAC5E,SAAG,KAAK,EAAC,WAAW,EAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,IAC5D,IAAI,CAAC,OAAO,CAAC,IAAI,CAChB,CACc;gBACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,CAAC,4BAA4B,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,CAAC;oBAChF,SACE,IAAI,EAAE,WAAY,CAAC,QAAQ,EAC3B,MAAM,EAAC,QAAQ,EACf,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,0BAA0B,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE;wBAEpG;4BACE,WAAK,KAAK,EAAC,4BAA4B,EAAC,CAAC,EAAC,KAAK,EAAC,CAAC,EAAC,KAAK,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW;gCAChG,YAAM,CAAC,EAAC,2KAA2K,GAAQ,CACvL,CACJ,EACH,MAAA,WAAY,CAAC,KAAK,mCAAI,MAAM,CAC3B,CACc,CAChB,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport type { DocumentContent } from '../../../model/article/content/DocumentContent';\n\n@Component({\n tag: 'aico-document-content',\n styleUrl: 'aico-document-content.css',\n scoped: true,\n})\nexport class AicoDocumentContent {\n @Prop() content!: DocumentContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const linkStyles: { [key: string]: string | undefined } = {};\n const buttonStyles: { [key: string]: string | undefined } = {};\n\n if (this.content.fontSize) {\n linkStyles['font-size'] = `${this.content.fontSize}px`;\n buttonStyles['font-size'] = `${this.content.fontSize}px`;\n }\n\n if (this.content.fontFamily) {\n linkStyles['font-family'] = this.content.fontFamily;\n buttonStyles['font-family'] = this.content.fontFamily;\n }\n\n if (this.content.isDocumentDisplayedAsButton && this.content.buttonTextColor) {\n buttonStyles['color'] = this.content.buttonTextColor;\n }\n\n if (this.content.isDocumentDisplayedAsButton && this.content.buttonBackgroundColor) {\n buttonStyles['background-color'] = this.content.buttonBackgroundColor;\n }\n\n if (this.content.isDocumentDisplayedAsButton && this.content.buttonBorderColor) {\n buttonStyles['border-color'] = this.content.buttonBorderColor;\n }\n\n if (this.content.isDocumentDisplayedAsButton && this.content.buttonHoverColor) {\n buttonStyles['--hover-button-color'] = this.content.buttonHoverColor;\n }\n\n return (\n <div class=\"card\">\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.picture)}>\n <img class=\"card-img-top\" alt=\"image\" src={translation!.picture} />\n </ConditionalRender>\n <div class=\"card-body\">\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(this.content.link)}>\n <a class=\"card-link\" style={linkStyles} href={this.content.link}>\n {this.content.link}\n </a>\n </ConditionalRender>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.document)}>\n <a\n href={translation!.document}\n target=\"_blank\"\n style={buttonStyles}\n class={`card-link align-middle ${this.content.isDocumentDisplayedAsButton ? 'btn button-link' : ''}`}\n >\n <i>\n <svg xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\" width=\"24\" height=\"24\" viewBox=\"0 0 50 50\">\n <path d=\"M 7 2 L 7 48 L 43 48 L 43 14.59375 L 42.71875 14.28125 L 30.71875 2.28125 L 30.40625 2 Z M 9 4 L 29 4 L 29 16 L 41 16 L 41 46 L 9 46 Z M 31 5.4375 L 39.5625 14 L 31 14 Z\"></path>\n </svg>\n </i>\n {translation!.title ?? 'File'}\n </a>\n </ConditionalRender>\n </div>\n </div>\n );\n }\n}\n"]}
@@ -4,6 +4,7 @@ const meta = {
4
4
  export default meta;
5
5
  export const Example = {
6
6
  args: {
7
+ locale: 'de',
7
8
  content: {
8
9
  id: 1234,
9
10
  createdAt: new Date(),
@@ -16,6 +17,16 @@ export const Example = {
16
17
  title: 'Document title',
17
18
  picture: 'https://source.unsplash.com/random/320x240',
18
19
  document: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
20
+ locale: 'de'
21
+ },
22
+ {
23
+ id: 1234,
24
+ createdAt: new Date(),
25
+ updatedAt: new Date(),
26
+ title: 'Document title en',
27
+ picture: 'https://source.unsplash.com/random/320x240',
28
+ document: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
29
+ locale: 'en'
19
30
  },
20
31
  ],
21
32
  link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
@@ -1 +1 @@
1
- {"version":3,"file":"aico-document-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-document-content/aico-document-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAkC;IAC1C,SAAS,EAAE,uBAAuB;CACnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,gBAAgB;oBACvB,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,6CAA6C;iBACxD;aACF;YACD,IAAI,EAAE,6CAA6C;YACnD,2BAA2B,EAAE,IAAI;YACjC,iBAAiB,EAAE,KAAK;YACxB,qBAAqB,EAAE,MAAM;YAC7B,eAAe,EAAE,OAAO;YACxB,gBAAgB,EAAE,MAAM;SACN;KACrB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { DocumentContent } from '../../../model/article/content/DocumentContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoDocumentContent> = {\n component: 'aico-document-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Document title',\n picture: 'https://source.unsplash.com/random/320x240',\n document: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n },\n ],\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n isDocumentDisplayedAsButton: true,\n buttonBorderColor: 'red',\n buttonBackgroundColor: 'gray',\n buttonTextColor: 'green',\n buttonHoverColor: 'pink',\n } as DocumentContent,\n },\n};\n"]}
1
+ {"version":3,"file":"aico-document-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-document-content/aico-document-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAkC;IAC1C,SAAS,EAAE,uBAAuB;CACnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,gBAAgB;oBACvB,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,6CAA6C;oBACvD,MAAM,EAAE,IAAI;iBACb;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,mBAAmB;oBAC1B,OAAO,EAAE,4CAA4C;oBACrD,QAAQ,EAAE,6CAA6C;oBACvD,MAAM,EAAE,IAAI;iBACb;aACF;YACD,IAAI,EAAE,6CAA6C;YACnD,2BAA2B,EAAE,IAAI;YACjC,iBAAiB,EAAE,KAAK;YACxB,qBAAqB,EAAE,MAAM;YAC7B,eAAe,EAAE,OAAO;YACxB,gBAAgB,EAAE,MAAM;SACN;KACrB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { DocumentContent } from '../../../model/article/content/DocumentContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoDocumentContent> = {\n component: 'aico-document-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Document title',\n picture: 'https://source.unsplash.com/random/320x240',\n document: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Document title en',\n picture: 'https://source.unsplash.com/random/320x240',\n document: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n locale: 'en'\n },\n ],\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n isDocumentDisplayedAsButton: true,\n buttonBorderColor: 'red',\n buttonBackgroundColor: 'gray',\n buttonTextColor: 'green',\n buttonHoverColor: 'pink',\n } as DocumentContent,\n },\n};\n"]}
@@ -3,10 +3,12 @@ import "bootstrap";
3
3
  export class AicoFaqContent {
4
4
  constructor() {
5
5
  this.content = undefined;
6
+ this.locale = 'de';
6
7
  }
7
8
  render() {
8
9
  return (h(Host, null, h("h2", { class: "card-title mb-2" }, "FAQ"), h("div", { class: "accordion", id: "aico-faq-accordion" }, this.content.faqItems.map((faqItem, index) => {
9
- const translation = faqItem.translations.length > 0 ? faqItem.translations[0] : null;
10
+ var _a;
11
+ const translation = (_a = faqItem.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
10
12
  if (!translation) {
11
13
  return null;
12
14
  }
@@ -47,6 +49,24 @@ export class AicoFaqContent {
47
49
  "tags": [],
48
50
  "text": ""
49
51
  }
52
+ },
53
+ "locale": {
54
+ "type": "string",
55
+ "mutable": false,
56
+ "complexType": {
57
+ "original": "string",
58
+ "resolved": "string",
59
+ "references": {}
60
+ },
61
+ "required": false,
62
+ "optional": false,
63
+ "docs": {
64
+ "tags": [],
65
+ "text": ""
66
+ },
67
+ "attribute": "locale",
68
+ "reflect": false,
69
+ "defaultValue": "'de'"
50
70
  }
51
71
  };
52
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-faq-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-faq-content/aico-faq-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,WAAW,CAAC;AAOnB,MAAM,OAAO,cAAc;;;;IAGzB,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,UAAI,KAAK,EAAC,iBAAiB,UAAS;YACpC,WAAK,KAAK,EAAC,WAAW,EAAC,EAAE,EAAC,oBAAoB,IAC3C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;gBAC5C,MAAM,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;gBACrF,IAAI,CAAC,WAAW,EAAE;oBAChB,OAAO,IAAI,CAAC;iBACb;gBAED,OAAO,CACL,WAAK,KAAK,EAAC,gBAAgB;oBACzB,UAAI,KAAK,EAAC,kBAAkB,EAAC,EAAE,EAAE,WAAW,KAAK,EAAE;wBACjD,cACE,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,QAAQ,oBACE,UAAU,oBACT,aAAa,KAAK,EAAE,mBACtB,OAAO,mBACN,YAAY,KAAK,EAAE,IAEjC,WAAW,CAAC,QAAQ,CACd,CACN;oBACL,WAAK,EAAE,EAAE,YAAY,KAAK,EAAE,EAAE,KAAK,EAAC,6BAA6B,qBAAkB,WAAW,KAAK,EAAE,oBAAiB,qBAAqB;wBACzI,WAAK,KAAK,EAAC,gBAAgB,IAAE,WAAW,CAAC,MAAM,CAAO,CAClD,CACF,CACP,CAAC;YACJ,CAAC,CAAC,CACE,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport type { FaqContent } from '../../../model/article/content/FaqContent';\nimport 'bootstrap';\n\n@Component({\n tag: 'aico-faq-content',\n styleUrl: 'aico-faq-content.css',\n scoped: true,\n})\nexport class AicoFaqContent {\n @Prop() content!: FaqContent;\n\n render() {\n return (\n <Host>\n <h2 class=\"card-title mb-2\">FAQ</h2>\n <div class=\"accordion\" id=\"aico-faq-accordion\">\n {this.content.faqItems.map((faqItem, index) => {\n const translation = faqItem.translations.length > 0 ? faqItem.translations[0] : null;\n if (!translation) {\n return null;\n }\n\n return (\n <div class=\"accordion-item\">\n <h2 class=\"accordion-header\" id={`heading-${index}`}>\n <button\n class=\"accordion-button collapsed\"\n type=\"button\"\n data-bs-toggle=\"collapse\"\n data-bs-target={`#collapse-${index}`}\n aria-expanded=\"false\"\n aria-controls={`collapse-${index}`}\n >\n {translation.question}\n </button>\n </h2>\n <div id={`collapse-${index}`} class=\"accordion-collapse collapse\" aria-labelledby={`heading-${index}`} data-bs-parent=\"#aico-faq-accordion\">\n <div class=\"accordion-body\">{translation.answer}</div>\n </div>\n </div>\n );\n })}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"aico-faq-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-faq-content/aico-faq-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,WAAW,CAAC;AAOnB,MAAM,OAAO,cAAc;;;sBAGA,IAAI;;IAE7B,MAAM;QACJ,OAAO,CACL,EAAC,IAAI;YACH,UAAI,KAAK,EAAC,iBAAiB,UAAS;YACpC,WAAK,KAAK,EAAC,WAAW,EAAC,EAAE,EAAC,oBAAoB,IAC3C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;;gBAC5C,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;gBACzG,IAAI,CAAC,WAAW,EAAE;oBAChB,OAAO,IAAI,CAAC;iBACb;gBAED,OAAO,CACL,WAAK,KAAK,EAAC,gBAAgB;oBACzB,UAAI,KAAK,EAAC,kBAAkB,EAAC,EAAE,EAAE,WAAW,KAAK,EAAE;wBACjD,cACE,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,QAAQ,oBACE,UAAU,oBACT,aAAa,KAAK,EAAE,mBACtB,OAAO,mBACN,YAAY,KAAK,EAAE,IAEjC,WAAW,CAAC,QAAQ,CACd,CACN;oBACL,WAAK,EAAE,EAAE,YAAY,KAAK,EAAE,EAAE,KAAK,EAAC,6BAA6B,qBAAkB,WAAW,KAAK,EAAE,oBAAiB,qBAAqB;wBACzI,WAAK,KAAK,EAAC,gBAAgB,IAAE,WAAW,CAAC,MAAM,CAAO,CAClD,CACF,CACP,CAAC;YACJ,CAAC,CAAC,CACE,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport type { FaqContent } from '../../../model/article/content/FaqContent';\nimport 'bootstrap';\n\n@Component({\n tag: 'aico-faq-content',\n styleUrl: 'aico-faq-content.css',\n scoped: true,\n})\nexport class AicoFaqContent {\n @Prop() content!: FaqContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n return (\n <Host>\n <h2 class=\"card-title mb-2\">FAQ</h2>\n <div class=\"accordion\" id=\"aico-faq-accordion\">\n {this.content.faqItems.map((faqItem, index) => {\n const translation = faqItem.translations.find(translation => translation.locale === this.locale) ?? null;\n if (!translation) {\n return null;\n }\n\n return (\n <div class=\"accordion-item\">\n <h2 class=\"accordion-header\" id={`heading-${index}`}>\n <button\n class=\"accordion-button collapsed\"\n type=\"button\"\n data-bs-toggle=\"collapse\"\n data-bs-target={`#collapse-${index}`}\n aria-expanded=\"false\"\n aria-controls={`collapse-${index}`}\n >\n {translation.question}\n </button>\n </h2>\n <div id={`collapse-${index}`} class=\"accordion-collapse collapse\" aria-labelledby={`heading-${index}`} data-bs-parent=\"#aico-faq-accordion\">\n <div class=\"accordion-body\">{translation.answer}</div>\n </div>\n </div>\n );\n })}\n </div>\n </Host>\n );\n }\n}\n"]}