@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
@@ -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
  createdAt: new Date(),
9
10
  updatedAt: new Date(),
@@ -21,6 +22,14 @@ export const Example = {
21
22
  question: 'Foo?',
22
23
  answer: 'Foo!',
23
24
  },
25
+ {
26
+ id: 1234,
27
+ createdAt: new Date(),
28
+ updatedAt: new Date(),
29
+ locale: 'de',
30
+ question: 'Foo de?',
31
+ answer: 'Foo de!',
32
+ },
24
33
  ],
25
34
  },
26
35
  {
@@ -36,6 +45,14 @@ export const Example = {
36
45
  question: 'Bar?',
37
46
  answer: 'Bar!',
38
47
  },
48
+ {
49
+ id: 1234,
50
+ createdAt: new Date(),
51
+ updatedAt: new Date(),
52
+ locale: 'de',
53
+ question: 'Bar de?',
54
+ answer: 'Bar de!',
55
+ },
39
56
  ],
40
57
  },
41
58
  {
@@ -51,6 +68,14 @@ export const Example = {
51
68
  question: 'Baz?',
52
69
  answer: 'Baz!',
53
70
  },
71
+ {
72
+ id: 1234,
73
+ createdAt: new Date(),
74
+ updatedAt: new Date(),
75
+ locale: 'de',
76
+ question: 'Baz de?',
77
+ answer: 'Baz de!',
78
+ },
54
79
  ],
55
80
  },
56
81
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"aico-faq-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-faq-content/aico-faq-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA6B;IACrC,SAAS,EAAE,kBAAkB;CAC9B,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,QAAQ,EAAE;gBACR;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,QAAQ,EAAE,MAAM;4BAChB,MAAM,EAAE,MAAM;yBACf;qBACF;iBACF;gBAED;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,QAAQ,EAAE,MAAM;4BAChB,MAAM,EAAE,MAAM;yBACf;qBACF;iBACF;gBAED;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,QAAQ,EAAE,MAAM;4BAChB,MAAM,EAAE,MAAM;yBACf;qBACF;iBACF;aACF;SACY;KAChB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { FaqContent } from '../../../model/article/content/FaqContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoFaqContent> = {\n component: 'aico-faq-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n content: {\n createdAt: new Date(),\n updatedAt: new Date(),\n faqItems: [\n {\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 question: 'Foo?',\n answer: 'Foo!',\n },\n ],\n },\n\n {\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 question: 'Bar?',\n answer: 'Bar!',\n },\n ],\n },\n\n {\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 question: 'Baz?',\n answer: 'Baz!',\n },\n ],\n },\n ],\n } as FaqContent,\n },\n};\n"]}
1
+ {"version":3,"file":"aico-faq-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-faq-content/aico-faq-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA6B;IACrC,SAAS,EAAE,kBAAkB;CAC9B,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,QAAQ,EAAE;gBACR;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,QAAQ,EAAE,MAAM;4BAChB,MAAM,EAAE,MAAM;yBACf;wBACD;4BACE,EAAE,EAAE,I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Meta, StoryObj } from '@storybook/web-components';\nimport type { FaqContent } from '../../../model/article/content/FaqContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoFaqContent> = {\n component: 'aico-faq-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n createdAt: new Date(),\n updatedAt: new Date(),\n faqItems: [\n {\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 question: 'Foo?',\n answer: 'Foo!',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n question: 'Foo de?',\n answer: 'Foo de!',\n },\n ],\n },\n\n {\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 question: 'Bar?',\n answer: 'Bar!',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n question: 'Bar de?',\n answer: 'Bar de!',\n },\n ],\n },\n\n {\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 question: 'Baz?',\n answer: 'Baz!',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n question: 'Baz de?',\n answer: 'Baz de!',\n },\n ],\n },\n ],\n } as FaqContent,\n },\n};\n"]}
@@ -4,9 +4,11 @@ import { strIsNullOrEmptyOrWhitespace } from "../../../utils/utils";
4
4
  export class AicoHeadingContent {
5
5
  constructor() {
6
6
  this.content = undefined;
7
+ this.locale = 'de';
7
8
  }
8
9
  render() {
9
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
10
+ var _a;
11
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
10
12
  const contentStyle = { 'justify-content': this.content.isTextAtMiddleOfImage ? 'center' : 'flex-end' };
11
13
  if (!strIsNullOrEmptyOrWhitespace(this.content.picture)) {
12
14
  contentStyle['min-height'] = this.content.isImageHeightHalfSize ? '400px' : '600px';
@@ -26,7 +28,7 @@ export class AicoHeadingContent {
26
28
  if (!strIsNullOrEmptyOrWhitespace(this.content.textColor)) {
27
29
  descriptionStyle['color'] = this.content.textColor;
28
30
  }
29
- return (h("div", { class: this.content.isHeadingAlignedWithText ? 'content content-align-with-text' : 'content', style: contentStyle }, h(ConditionalRender, { condition: translation !== null }, h("div", { class: "title-wrapper", style: titleWrapperStyle }, h("aico-title-content", { content: this.makeTitleContent(translation) })), h("span", { class: "description", style: descriptionStyle }, translation.description))));
31
+ return (h("div", { class: this.content.isHeadingAlignedWithText ? 'content content-align-with-text' : 'content', style: contentStyle }, h(ConditionalRender, { condition: translation !== null }, h("div", { class: "title-wrapper", style: titleWrapperStyle }, h("aico-title-content", { content: this.makeTitleContent(translation), locale: this.locale })), h("span", { class: "description", style: descriptionStyle }, translation.description))));
30
32
  }
31
33
  makeTitleContent(translation) {
32
34
  var _a;
@@ -74,6 +76,24 @@ export class AicoHeadingContent {
74
76
  "tags": [],
75
77
  "text": ""
76
78
  }
79
+ },
80
+ "locale": {
81
+ "type": "string",
82
+ "mutable": false,
83
+ "complexType": {
84
+ "original": "string",
85
+ "resolved": "string",
86
+ "references": {}
87
+ },
88
+ "required": false,
89
+ "optional": false,
90
+ "docs": {
91
+ "tags": [],
92
+ "text": ""
93
+ },
94
+ "attribute": "locale",
95
+ "reflect": false,
96
+ "defaultValue": "'de'"
77
97
  }
78
98
  };
79
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-heading-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-heading-content/aico-heading-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
1
+ {"version":3,"file":"aico-heading-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-heading-content/aico-heading-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;AAUpE,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,GAA0C,EAAE,iBAAiB,EAAE,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,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,qBAAqB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;YACpF,YAAY,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;YACxF,YAAY,CAAC,kBAAkB,CAAC,GAAG,OAAO,IAAI,CAAC,OAAO,CAAC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ChB,CACP,CAAC;IACJ,CAAC;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;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
@@ -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: 'Heading title',
17
18
  description: 'Heading description',
19
+ locale: 'de',
20
+ },
21
+ {
22
+ id: 1234,
23
+ createdAt: new Date(),
24
+ updatedAt: new Date(),
25
+ title: 'Heading title en',
26
+ description: 'Heading description en',
27
+ locale: 'en',
18
28
  },
19
29
  ],
20
30
  textColor: 'red',
@@ -1 +1 @@
1
- {"version":3,"file":"aico-heading-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-heading-content/aico-heading-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,KAAK,EAAE,eAAe;oBACtB,WAAW,EAAE,qBAAqB;iBACnC;aACF;YACD,SAAS,EAAE,KAAK;YAChB,mBAAmB,EAAE,MAAM;YAC3B,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,4CAA4C;YACrD,QAAQ,EAAE,EAAE;YACZ,wBAAwB,EAAE,IAAI;YAC9B,qBAAqB,EAAE,IAAI;YAC3B,qBAAqB,EAAE,IAAI;SACV;KACpB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { HeadingContent } from '../../../model/article/content/HeadingContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoHeadingContent> = {\n component: 'aico-heading-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: 'Heading title',\n description: 'Heading description',\n },\n ],\n textColor: 'red',\n textBackgroundColor: 'gray',\n titleSize: 'h2',\n picture: 'https://source.unsplash.com/random/320x240',\n fontSize: 69,\n isHeadingAlignedWithText: true,\n isTextAtMiddleOfImage: true,\n isImageHeightHalfSize: true,\n } as HeadingContent,\n },\n};\n"]}
1
+ {"version":3,"file":"aico-heading-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-heading-content/aico-heading-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,KAAK,EAAE,eAAe;oBACtB,WAAW,EAAE,qBAAqB;oBAClC,MAAM,EAAE,IAAI;iBACb;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,kBAAkB;oBACzB,WAAW,EAAE,wBAAwB;oBACrC,MAAM,EAAE,IAAI;iBACb;aACF;YACD,SAAS,EAAE,KAAK;YAChB,mBAAmB,EAAE,MAAM;YAC3B,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,4CAA4C;YACrD,QAAQ,EAAE,EAAE;YACZ,wBAAwB,EAAE,IAAI;YAC9B,qBAAqB,EAAE,IAAI;YAC3B,qBAAqB,EAAE,IAAI;SACV;KACpB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { HeadingContent } from '../../../model/article/content/HeadingContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoHeadingContent> = {\n component: 'aico-heading-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: 'Heading title',\n description: 'Heading description',\n locale: 'de',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Heading title en',\n description: 'Heading description en',\n locale: 'en',\n },\n ],\n textColor: 'red',\n textBackgroundColor: 'gray',\n titleSize: 'h2',\n picture: 'https://source.unsplash.com/random/320x240',\n fontSize: 69,\n isHeadingAlignedWithText: true,\n isTextAtMiddleOfImage: true,\n isImageHeightHalfSize: true,\n } as HeadingContent,\n },\n};\n"]}
@@ -4,12 +4,12 @@ import { strIsNullOrEmptyOrWhitespace } from "../../../utils/utils";
4
4
  export class AicoHtmlContent {
5
5
  constructor() {
6
6
  this.content = undefined;
7
+ this.locale = 'de';
7
8
  }
8
9
  render() {
9
- if (this.content.translations.length === 0) {
10
- return h("aico-no-content", null);
11
- }
12
- return (h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.translations[0].text) }, h("div", { innerHTML: this.content.translations[0].text })));
10
+ var _a;
11
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
12
+ return (h(ConditionalRender, { condition: translation !== null && !strIsNullOrEmptyOrWhitespace(translation.text) }, h("div", { innerHTML: translation.text })));
13
13
  }
14
14
  static get is() { return "aico-html-content"; }
15
15
  static get encapsulation() { return "scoped"; }
@@ -45,6 +45,24 @@ export class AicoHtmlContent {
45
45
  "tags": [],
46
46
  "text": ""
47
47
  }
48
+ },
49
+ "locale": {
50
+ "type": "string",
51
+ "mutable": false,
52
+ "complexType": {
53
+ "original": "string",
54
+ "resolved": "string",
55
+ "references": {}
56
+ },
57
+ "required": false,
58
+ "optional": false,
59
+ "docs": {
60
+ "tags": [],
61
+ "text": ""
62
+ },
63
+ "attribute": "locale",
64
+ "reflect": false,
65
+ "defaultValue": "'de'"
48
66
  }
49
67
  };
50
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-html-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-html-content/aico-html-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAOpE,MAAM,OAAO,eAAe;;;;IAG1B,MAAM;QACJ,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;YAC1C,OAAO,0BAAmB,CAAC;SAC5B;QAED,OAAO,CACL,EAAC,iBAAiB,IAAC,SAAS,EAAE,CAAC,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC5F,WAAK,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAK,GAAI,CACpC,CACrB,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
1
+ {"version":3,"file":"aico-html-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-html-content/aico-html-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAOpE,MAAM,OAAO,eAAe;;;sBAGD,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,OAAO,CACL,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC;YACnG,WAAK,SAAS,EAAE,WAAY,CAAC,IAAK,GAAI,CACpB,CACrB,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
@@ -4,10 +4,11 @@ import { getImageWidthPrc, strIsNullOrEmptyOrWhitespace } from "../../../utils/u
4
4
  export class AicoLinkContent {
5
5
  constructor() {
6
6
  this.content = undefined;
7
+ this.locale = 'de';
7
8
  }
8
9
  render() {
9
- var _a, _b;
10
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
10
+ var _a, _b, _c;
11
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
11
12
  const buttonLinkStyle = {};
12
13
  if (this.content.textButtonColor) {
13
14
  buttonLinkStyle['color'] = this.content.textButtonColor;
@@ -25,7 +26,7 @@ export class AicoLinkContent {
25
26
  buttonLinkStyle['--hover-button-color'] = this.content.hoverColor;
26
27
  }
27
28
  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 :
28
- 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")))));
29
+ 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")))));
29
30
  }
30
31
  static get is() { return "aico-link-content"; }
31
32
  static get encapsulation() { return "scoped"; }
@@ -61,6 +62,24 @@ export class AicoLinkContent {
61
62
  "tags": [],
62
63
  "text": ""
63
64
  }
65
+ },
66
+ "locale": {
67
+ "type": "string",
68
+ "mutable": false,
69
+ "complexType": {
70
+ "original": "string",
71
+ "resolved": "string",
72
+ "references": {}
73
+ },
74
+ "required": false,
75
+ "optional": false,
76
+ "docs": {
77
+ "tags": [],
78
+ "text": ""
79
+ },
80
+ "attribute": "locale",
81
+ "reflect": false,
82
+ "defaultValue": "'de'"
64
83
  }
65
84
  };
66
85
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-link-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-link-content/aico-link-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAQtF,MAAM,OAAO,eAAe;;;;IAG1B,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,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,CA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ACjC,CACA,CACY;YACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW;gBAC1F,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,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,eAAe;oBAC9H,YAAM,KAAK,EAAC,cAAc,cAAgB,CACxC,CACc,CACf,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
1
+ {"version":3,"file":"aico-link-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-link-content/aico-link-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAQtF,MAAM,OAAO,eAAe;;;sBAGD,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,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,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CACY;YACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW;gBAC1F,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,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,eAAe;oBAC9H,YAAM,KAAK,EAAC,cAAc,cAAgB,CACxC,CACc,CACf,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
@@ -4,6 +4,7 @@ const meta = {
4
4
  export default meta;
5
5
  export const ImageLink = {
6
6
  args: {
7
+ locale: 'de',
7
8
  content: {
8
9
  id: 1234,
9
10
  createdAt: new Date(),
@@ -17,6 +18,17 @@ export const ImageLink = {
17
18
  link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
18
19
  linkText: 'Rick :)',
19
20
  imageUrl: 'https://source.unsplash.com/random/320x240',
21
+ locale: 'de'
22
+ },
23
+ {
24
+ id: 1234,
25
+ createdAt: new Date(),
26
+ updatedAt: new Date(),
27
+ title: 'Link title en',
28
+ link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
29
+ linkText: 'Rick :)',
30
+ imageUrl: 'https://source.unsplash.com/random/320x240',
31
+ locale: 'en'
20
32
  },
21
33
  ],
22
34
  pictureSize: 'medium',
@@ -31,6 +43,7 @@ export const ImageLink = {
31
43
  };
32
44
  export const ButtonLink = {
33
45
  args: {
46
+ locale: 'de',
34
47
  content: {
35
48
  id: 1234,
36
49
  createdAt: new Date(),
@@ -44,6 +57,17 @@ export const ButtonLink = {
44
57
  link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
45
58
  linkText: 'Rick :)',
46
59
  imageUrl: 'https://source.unsplash.com/random/320x240',
60
+ locale: 'de'
61
+ },
62
+ {
63
+ id: 1234,
64
+ createdAt: new Date(),
65
+ updatedAt: new Date(),
66
+ title: 'Link title en',
67
+ link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
68
+ linkText: 'Rick :)',
69
+ imageUrl: 'https://source.unsplash.com/random/320x240',
70
+ locale: 'en'
47
71
  },
48
72
  ],
49
73
  pictureSize: 'medium',
@@ -1 +1 @@
1
- {"version":3,"file":"aico-link-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-link-content/aico-link-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA8B;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,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,YAAY;oBACnB,IAAI,EAAE,6CAA6C;oBACnD,QAAQ,EAAE,SAAS;oBACnB,QAAQ,EAAE,4CAA4C;iBACvD;aACF;YAED,WAAW,EAAE,QAAQ;YAErB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,WAAW,EAAE,IAAI;YAEjB,qBAAqB,EAAE,SAAS;YAChC,eAAe,EAAE,KAAK;YACtB,UAAU,EAAE,MAAM;SACJ;KACjB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,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,YAAY;oBACnB,IAAI,EAAE,6CAA6C;oBACnD,QAAQ,EAAE,SAAS;oBACnB,QAAQ,EAAE,4CAA4C;iBACvD;aACF;YAED,WAAW,EAAE,QAAQ;YAErB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,WAAW,EAAE,KAAK;YAElB,qBAAqB,EAAE,SAAS;YAChC,eAAe,EAAE,KAAK;YACtB,UAAU,EAAE,MAAM;SACJ;KACjB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { LinkContent } from '../../../model/article/content/LinkContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoLinkContent> = {\n component: 'aico-link-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const ImageLink: 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: 'Link title',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n linkText: 'Rick :)',\n imageUrl: 'https://source.unsplash.com/random/320x240',\n },\n ],\n\n pictureSize: 'medium',\n\n isButtonLink: true,\n isImageFullSize: false,\n isImageLink: true,\n\n backgroundButtonColor: '#efefef',\n textButtonColor: 'red',\n hoverColor: 'pink',\n } as LinkContent,\n },\n};\n\nexport const ButtonLink: 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: 'Link title',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n linkText: 'Rick :)',\n imageUrl: 'https://source.unsplash.com/random/320x240',\n },\n ],\n\n pictureSize: 'medium',\n\n isButtonLink: true,\n isImageFullSize: false,\n isImageLink: false,\n\n backgroundButtonColor: '#efefef',\n textButtonColor: 'red',\n hoverColor: 'pink',\n } as LinkContent,\n },\n};\n"]}
1
+ {"version":3,"file":"aico-link-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-link-content/aico-link-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA8B;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,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,YAAY;oBACnB,IAAI,EAAE,6CAA6C;oBACnD,QAAQ,EAAE,SAAS;oBACnB,QAAQ,EAAE,4CAA4C;oBACtD,MAAM,EAAE,IAAI;iBACb;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,eAAe;oBACtB,IAAI,EAAE,6CAA6C;oBACnD,QAAQ,EAAE,SAAS;oBACnB,QAAQ,EAAE,4CAA4C;oBACtD,MAAM,EAAE,IAAI;iBACb;aACF;YAED,WAAW,EAAE,QAAQ;YAErB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,WAAW,EAAE,IAAI;YAEjB,qBAAqB,EAAE,SAAS;YAChC,eAAe,EAAE,KAAK;YACtB,UAAU,EAAE,MAAM;SACJ;KACjB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAU;IAC/B,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,YAAY;oBACnB,IAAI,EAAE,6CAA6C;oBACnD,QAAQ,EAAE,SAAS;oBACnB,QAAQ,EAAE,4CAA4C;oBACtD,MAAM,EAAE,IAAI;iBACb;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,eAAe;oBACtB,IAAI,EAAE,6CAA6C;oBACnD,QAAQ,EAAE,SAAS;oBACnB,QAAQ,EAAE,4CAA4C;oBACtD,MAAM,EAAE,IAAI;iBACb;aACF;YAED,WAAW,EAAE,QAAQ;YAErB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,WAAW,EAAE,KAAK;YAElB,qBAAqB,EAAE,SAAS;YAChC,eAAe,EAAE,KAAK;YACtB,UAAU,EAAE,MAAM;SACJ;KACjB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { LinkContent } from '../../../model/article/content/LinkContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoLinkContent> = {\n component: 'aico-link-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const ImageLink: 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: 'Link title',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n linkText: 'Rick :)',\n imageUrl: 'https://source.unsplash.com/random/320x240',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Link title en',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n linkText: 'Rick :)',\n imageUrl: 'https://source.unsplash.com/random/320x240',\n locale: 'en'\n },\n ],\n\n pictureSize: 'medium',\n\n isButtonLink: true,\n isImageFullSize: false,\n isImageLink: true,\n\n backgroundButtonColor: '#efefef',\n textButtonColor: 'red',\n hoverColor: 'pink',\n } as LinkContent,\n },\n};\n\nexport const ButtonLink: 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: 'Link title',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n linkText: 'Rick :)',\n imageUrl: 'https://source.unsplash.com/random/320x240',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Link title en',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n linkText: 'Rick :)',\n imageUrl: 'https://source.unsplash.com/random/320x240',\n locale: 'en'\n },\n ],\n\n pictureSize: 'medium',\n\n isButtonLink: true,\n isImageFullSize: false,\n isImageLink: false,\n\n backgroundButtonColor: '#efefef',\n textButtonColor: 'red',\n hoverColor: 'pink',\n } as LinkContent,\n },\n};\n"]}
@@ -4,15 +4,16 @@ import ConditionalRender from "../../../utils/ConditionalRender";
4
4
  export class AicoPageContent {
5
5
  constructor() {
6
6
  this.content = undefined;
7
+ this.locale = 'de';
7
8
  }
8
9
  render() {
9
- var _a, _b, _c, _d;
10
- const translation = this.content.landingPage.translations.length > 0 ? this.content.landingPage.translations[0] : null;
11
- 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 => {
10
+ var _a, _b, _c, _d, _e;
11
+ const translation = (_a = this.content.landingPage.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
12
+ 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 => {
12
13
  var _a;
13
14
  e.preventDefault();
14
15
  (_a = this.pageClicked) === null || _a === void 0 ? void 0 : _a.emit(this.content);
15
- } }, (_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))))));
16
+ } }, (_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))))));
16
17
  }
17
18
  static get is() { return "aico-page-content"; }
18
19
  static get encapsulation() { return "scoped"; }
@@ -48,6 +49,24 @@ export class AicoPageContent {
48
49
  "tags": [],
49
50
  "text": ""
50
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'"
51
70
  }
52
71
  };
53
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-page-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-page-content/aico-page-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MAAM,OAAO,eAAe;;;;IAK1B,MA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C,EAAE;;gCACX,CAAC,CAAC,cAAc,EAAE,CAAC;gCACnB,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;4BACvC,CAAC,IAEA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,mCAAI,kBAAkB,CAC5C,CACc,CAChB;gBACN,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC;oBACtG,WAAK,KAAK,EAAC,aAAa;wBACtB,aAAO,KAAK,EAAC,YAAY,IAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAAS,CACpD,CACY,CAChB,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
1
+ {"version":3,"file":"aico-page-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-page-content/aico-page-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MAAM,OAAO,eAAe;;;sBAGD,IAAI;;IAI7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC1H,OAAO,CACL,EAAC,IAAI,IAAC,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE;YACnC,WAAK,KAAK,EAAC,cAAc;gBACvB,WAAK,KAAK,EAAC,iBAAiB;oBAC1B,WACE,KAAK,EAAC,yCAAyC,EAC/C,KAAK,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE,EACtC,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AAE,OAAO,CAAS,CACpD,CACY,CAChB,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}
@@ -4,6 +4,7 @@ const meta = {
4
4
  export default meta;
5
5
  export const Exampl = {
6
6
  args: {
7
+ locale: 'de',
7
8
  content: {
8
9
  id: 1234,
9
10
  createdAt: new Date(),
@@ -26,6 +27,16 @@ export const Exampl = {
26
27
  imageAlt: 'Image alt',
27
28
  excerpt: 'Soon',
28
29
  },
30
+ {
31
+ id: 1234,
32
+ createdAt: new Date(),
33
+ updatedAt: new Date(),
34
+ locale: 'de',
35
+ name: 'Page name de',
36
+ buttonText: 'See the article de',
37
+ imageAlt: 'Image alt',
38
+ excerpt: 'Soon de',
39
+ },
29
40
  ],
30
41
  isPublic: false,
31
42
  isTemplate: false,
@@ -1 +1 @@
1
- {"version":3,"file":"aico-page-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-page-content/aico-page-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA8B;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,MAAM,MAAM,GAAa;IAC9B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,gBAAgB,EAAE,IAAI;YACtB,YAAY,EAAE,6CAA6C;YAC3D,eAAe,EAAE,KAAK;YACtB,WAAW,EAAE;gBACX,EAAE,EAAE,IAAI;gBACR,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,YAAY,EAAE;oBACZ;wBACE,EAAE,EAAE,IAAI;wBACR,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,MAAM,EAAE,OAAO;wBACf,IAAI,EAAE,WAAW;wBACjB,UAAU,EAAE,iBAAiB;wBAC7B,QAAQ,EAAE,WAAW;wBACrB,OAAO,EAAE,MAAM;qBAChB;iBACF;gBACD,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,KAAK,EAAE,4CAA4C;aACpD;SACa;KACjB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { PageContent } from '../../../model/article/content/PageContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoPageContent> = {\n component: 'aico-page-content',\n};\n\nexport default meta;\n\nexport const Exampl: StoryObj = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n openExternalLink: true,\n externalLink: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n isImageZoomedIn: false,\n landingPage: {\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 name: 'Page name',\n buttonText: 'See the article',\n imageAlt: 'Image alt',\n excerpt: 'Soon',\n },\n ],\n isPublic: false,\n isTemplate: false,\n image: 'https://source.unsplash.com/random/320x240',\n },\n } as PageContent,\n },\n};\n"]}
1
+ {"version":3,"file":"aico-page-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-page-content/aico-page-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA8B;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,MAAM,MAAM,GAAa;IAC9B,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,gBAAgB,EAAE,IAAI;YACtB,YAAY,EAAE,6CAA6C;YAC3D,eAAe,EAAE,KAAK;YACtB,WAAW,EAAE;gBACX,EAAE,EAAE,IAAI;gBACR,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,YAAY,EAAE;oBACZ;wBACE,EAAE,EAAE,IAAI;wBACR,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,MAAM,EAAE,OAAO;wBACf,IAAI,EAAE,WAAW;wBACjB,UAAU,EAAE,iBAAiB;wBAC7B,QAAQ,EAAE,WAAW;wBACrB,OAAO,EAAE,MAAM;qBAChB;oBACD;wBACE,EAAE,EAAE,IAAI;wBACR,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,MAAM,EAAE,IAAI;wBACZ,IAAI,EAAE,cAAc;wBACpB,UAAU,EAAE,oBAAoB;wBAChC,QAAQ,EAAE,WAAW;wBACrB,OAAO,EAAE,SAAS;qBACnB;iBACF;gBACD,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,KAAK,EAAE,4CAA4C;aACpD;SACa;KACjB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { PageContent } from '../../../model/article/content/PageContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoPageContent> = {\n component: 'aico-page-content',\n};\n\nexport default meta;\n\nexport const Exampl: StoryObj = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n openExternalLink: true,\n externalLink: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n isImageZoomedIn: false,\n landingPage: {\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 name: 'Page name',\n buttonText: 'See the article',\n imageAlt: 'Image alt',\n excerpt: 'Soon',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n name: 'Page name de',\n buttonText: 'See the article de',\n imageAlt: 'Image alt',\n excerpt: 'Soon de',\n },\n ],\n isPublic: false,\n isTemplate: false,\n image: 'https://source.unsplash.com/random/320x240',\n },\n } as PageContent,\n },\n};\n"]}
@@ -3,17 +3,19 @@ import ConditionalRender from "../../../utils/ConditionalRender";
3
3
  export class AicoTableContent {
4
4
  constructor() {
5
5
  this.content = undefined;
6
+ this.locale = 'de';
6
7
  }
7
8
  render() {
8
- var _a, _b;
9
- const translation = this.content.translations.length > 0 ? this.content.translations[0] : null;
10
- const firstBackgroundColor = (_a = this.content.firstColor) !== null && _a !== void 0 ? _a : '#d6dfe1';
11
- const secondBackgroundColor = (_b = this.content.secondColor) !== null && _b !== void 0 ? _b : '#e6eced';
12
- 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
9
+ var _a, _b, _c;
10
+ const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
11
+ const firstBackgroundColor = (_b = this.content.firstColor) !== null && _b !== void 0 ? _b : '#d6dfe1';
12
+ const secondBackgroundColor = (_c = this.content.secondColor) !== null && _c !== void 0 ? _c : '#e6eced';
13
+ 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
13
14
  .sort((a, b) => a.sort - b.sort)
14
15
  .map((row, index) => {
15
16
  return (h("tr", { style: { 'font-weight': '400', 'background-color': index % 2 === 0 ? firstBackgroundColor : secondBackgroundColor } }, row.rowColumns.map(col => {
16
- const translation = col.translations.length > 0 ? col.translations[0] : null;
17
+ var _a;
18
+ const translation = (_a = col.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
17
19
  if (!translation) {
18
20
  return row.isHeading ? h("th", null) : h("td", null);
19
21
  }
@@ -66,6 +68,24 @@ export class AicoTableContent {
66
68
  "tags": [],
67
69
  "text": ""
68
70
  }
71
+ },
72
+ "locale": {
73
+ "type": "string",
74
+ "mutable": false,
75
+ "complexType": {
76
+ "original": "string",
77
+ "resolved": "string",
78
+ "references": {}
79
+ },
80
+ "required": false,
81
+ "optional": false,
82
+ "docs": {
83
+ "tags": [],
84
+ "text": ""
85
+ },
86
+ "attribute": "locale",
87
+ "reflect": false,
88
+ "defaultValue": "'de'"
69
89
  }
70
90
  };
71
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aico-table-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-table-content/aico-table-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAInD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MAAM,OAAO,gBAAgB;;;;IAG3B,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;QAE/F,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,OAAO,CACL,WAAK,KAAK,EAAC,oBAAoB;YAC7B,WAAK,KAAK,EAAC,WAAW;gBACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI;oBAChD,0BAAoB,KAAK,EAAC,iBAAiB,EAAC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ACjC,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 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"]}
1
+ {"version":3,"file":"aico-table-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-table-content/aico-table-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAInD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MAAM,OAAO,gBAAgB;;;sBAGF,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;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,OAAO,CACL,WAAK,KAAK,EAAC,oBAAoB;YAC7B,WAAK,KAAK,EAAC,WAAW;gBACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI;oBAChD,0BAAoB,KAAK,EAAC,iBAAiB,EAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,WAAY,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI;oBACjH,SAAG,KAAK,EAAC,WAAW,IAAE,WAAY,CAAC,cAAc,CAAK,CACpC;gBACpB,aAAO,KAAK,EAAC,eAAe,IACzB,IAAI,CAAC,OAAO,CAAC,SAAS;qBACpB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC;qBAC/B,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;oBAClB,OAAO,CACL,UAAI,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,qBAAqB,EAAE,IACpH,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;;wBACxB,MAAM,WAAW,GAAG,MAAA,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;wBACrG,IAAI,CAAC,WAAW,EAAE;4BAChB,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,aAAS,CAAC,CAAC,CAAC,aAAS,CAAC;yBAC9C;wBAED,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,cAAK,WAAW,CAAC,UAAU,CAAM,CAAC,CAAC,CAAC,cAAK,WAAW,CAAC,UAAU,CAAM,CAAC;oBAC/F,CAAC,CAAC,CACC,CACN,CAAC;gBACJ,CAAC,CAAC,CACE,CACJ,CACF,CACP,CAAC;IACJ,CAAC;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;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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"]}