@aiconomy/aico-components 0.0.57 → 0.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/dist/aico-components/aico-components.css +1 -1
  2. package/dist/aico-components/aico-components.esm.js +1 -1
  3. package/dist/aico-components/aico-components.esm.js.map +1 -1
  4. package/dist/aico-components/p-0b6e7469.entry.js +2 -0
  5. package/dist/aico-components/p-0b6e7469.entry.js.map +1 -0
  6. package/dist/aico-components/p-19752961.entry.js +2 -0
  7. package/dist/aico-components/p-19752961.entry.js.map +1 -0
  8. package/dist/aico-components/p-2677f2ab.js +2 -0
  9. package/dist/aico-components/p-2677f2ab.js.map +1 -0
  10. package/dist/aico-components/{p-1c4a07ef.entry.js → p-368503ee.entry.js} +3 -3
  11. package/dist/aico-components/p-368503ee.entry.js.map +1 -0
  12. package/dist/aico-components/p-7e0074f7.entry.js +2 -0
  13. package/dist/aico-components/p-7e0074f7.entry.js.map +1 -0
  14. package/dist/aico-components/p-9ea26390.entry.js +2 -0
  15. package/dist/aico-components/p-9ea26390.entry.js.map +1 -0
  16. package/dist/aico-components/p-bccf08d0.entry.js +2 -0
  17. package/dist/aico-components/p-bccf08d0.entry.js.map +1 -0
  18. package/dist/aico-components/p-c9eea1b1.entry.js +2 -0
  19. package/dist/aico-components/p-c9eea1b1.entry.js.map +1 -0
  20. package/dist/cjs/aico-album-content_19.cjs.entry.js +76 -53
  21. package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -1
  22. package/dist/cjs/aico-article-detail.cjs.entry.js +18 -17
  23. package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -1
  24. package/dist/cjs/aico-components.cjs.js +1 -1
  25. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +3 -2
  26. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -1
  27. package/dist/cjs/aico-news-list-item.cjs.entry.js +1 -1
  28. package/dist/cjs/aico-news-list-item.cjs.entry.js.map +1 -1
  29. package/dist/cjs/aico-news-list.cjs.entry.js +4 -3
  30. package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -1
  31. package/dist/cjs/aico-no-content_2.cjs.entry.js +5 -3
  32. package/dist/cjs/aico-no-content_2.cjs.entry.js.map +1 -1
  33. package/dist/cjs/aico-special-news-carousel.cjs.entry.js +4 -3
  34. package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -1
  35. package/dist/cjs/loader.cjs.js +1 -1
  36. package/dist/cjs/{utils-095ed22b.js → utils-c1b7a052.js} +11 -5
  37. package/dist/cjs/utils-c1b7a052.js.map +1 -0
  38. package/dist/collection/components/aico-article-detail/aico-article-detail.js +36 -17
  39. package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
  40. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +20 -1
  41. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
  42. package/dist/collection/components/aico-news-list/aico-news-list.js +19 -2
  43. package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
  44. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js +1 -1
  45. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js.map +1 -1
  46. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +19 -2
  47. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
  48. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js +22 -3
  49. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js.map +1 -1
  50. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js +16 -0
  51. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js.map +1 -1
  52. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js +21 -1
  53. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js.map +1 -1
  54. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js +18 -0
  55. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js.map +1 -1
  56. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js +25 -5
  57. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js.map +1 -1
  58. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js +29 -0
  59. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js.map +1 -1
  60. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js +25 -3
  61. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js.map +1 -1
  62. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js +35 -3
  63. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js.map +1 -1
  64. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js +22 -3
  65. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js.map +1 -1
  66. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js +10 -0
  67. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js.map +1 -1
  68. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js +21 -1
  69. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js.map +1 -1
  70. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js +9 -0
  71. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js.map +1 -1
  72. package/dist/collection/components/content/aico-document-content/aico-document-content.js +22 -3
  73. package/dist/collection/components/content/aico-document-content/aico-document-content.js.map +1 -1
  74. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js +11 -0
  75. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js.map +1 -1
  76. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js +21 -1
  77. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js.map +1 -1
  78. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js +25 -0
  79. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js.map +1 -1
  80. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js +22 -2
  81. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js.map +1 -1
  82. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js +10 -0
  83. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js.map +1 -1
  84. package/dist/collection/components/content/aico-html-content/aico-html-content.js +22 -4
  85. package/dist/collection/components/content/aico-html-content/aico-html-content.js.map +1 -1
  86. package/dist/collection/components/content/aico-link-content/aico-link-content.js +22 -3
  87. package/dist/collection/components/content/aico-link-content/aico-link-content.js.map +1 -1
  88. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js +24 -0
  89. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js.map +1 -1
  90. package/dist/collection/components/content/aico-page-content/aico-page-content.js +23 -4
  91. package/dist/collection/components/content/aico-page-content/aico-page-content.js.map +1 -1
  92. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js +11 -0
  93. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js.map +1 -1
  94. package/dist/collection/components/content/aico-table-content/aico-table-content.js +26 -6
  95. package/dist/collection/components/content/aico-table-content/aico-table-content.js.map +1 -1
  96. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js +58 -0
  97. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js.map +1 -1
  98. package/dist/collection/components/content/aico-text-content/aico-text-content.js +25 -9
  99. package/dist/collection/components/content/aico-text-content/aico-text-content.js.map +1 -1
  100. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js +55 -0
  101. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js.map +1 -1
  102. package/dist/collection/components/content/aico-title-content/aico-title-content.js +23 -3
  103. package/dist/collection/components/content/aico-title-content/aico-title-content.js.map +1 -1
  104. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js +12 -1
  105. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js.map +1 -1
  106. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js +22 -2
  107. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js.map +1 -1
  108. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js +8 -0
  109. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js.map +1 -1
  110. package/dist/collection/components/content/aico-video-content/aico-video-content.js +22 -2
  111. package/dist/collection/components/content/aico-video-content/aico-video-content.js.map +1 -1
  112. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js +17 -0
  113. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js.map +1 -1
  114. package/dist/collection/model/article/content/CarouselContent.js.map +1 -1
  115. package/dist/collection/utils/utils.js +10 -4
  116. package/dist/collection/utils/utils.js.map +1 -1
  117. package/dist/components/aico-article-detail2.js +20 -18
  118. package/dist/components/aico-article-detail2.js.map +1 -1
  119. package/dist/components/aico-asking-content2.js +6 -4
  120. package/dist/components/aico-asking-content2.js.map +1 -1
  121. package/dist/components/aico-block-quote-content2.js +5 -2
  122. package/dist/components/aico-block-quote-content2.js.map +1 -1
  123. package/dist/components/aico-bullet-content2.js +9 -6
  124. package/dist/components/aico-bullet-content2.js.map +1 -1
  125. package/dist/components/aico-carousel-content2.js +9 -4
  126. package/dist/components/aico-carousel-content2.js.map +1 -1
  127. package/dist/components/aico-content-card-content2.js +6 -4
  128. package/dist/components/aico-content-card-content2.js.map +1 -1
  129. package/dist/components/aico-divider-content2.js +5 -2
  130. package/dist/components/aico-divider-content2.js.map +1 -1
  131. package/dist/components/aico-document-content2.js +6 -4
  132. package/dist/components/aico-document-content2.js.map +1 -1
  133. package/dist/components/aico-faq-content2.js +5 -2
  134. package/dist/components/aico-faq-content2.js.map +1 -1
  135. package/dist/components/aico-fetch-article-detail.js +3 -1
  136. package/dist/components/aico-fetch-article-detail.js.map +1 -1
  137. package/dist/components/aico-heading-content2.js +6 -3
  138. package/dist/components/aico-heading-content2.js.map +1 -1
  139. package/dist/components/aico-html-content2.js +7 -12
  140. package/dist/components/aico-html-content2.js.map +1 -1
  141. package/dist/components/aico-link-content2.js +6 -4
  142. package/dist/components/aico-link-content2.js.map +1 -1
  143. package/dist/components/aico-news-list-item2.js +1 -1
  144. package/dist/components/aico-news-list-item2.js.map +1 -1
  145. package/dist/components/aico-news-list.js +4 -2
  146. package/dist/components/aico-news-list.js.map +1 -1
  147. package/dist/components/aico-page-content2.js +7 -5
  148. package/dist/components/aico-page-content2.js.map +1 -1
  149. package/dist/components/aico-special-news-carousel.js +4 -2
  150. package/dist/components/aico-special-news-carousel.js.map +1 -1
  151. package/dist/components/aico-table-content2.js +10 -7
  152. package/dist/components/aico-table-content2.js.map +1 -1
  153. package/dist/components/aico-text-content2.js +9 -10
  154. package/dist/components/aico-text-content2.js.map +1 -1
  155. package/dist/components/aico-title-content2.js +7 -4
  156. package/dist/components/aico-title-content2.js.map +1 -1
  157. package/dist/components/aico-upload-content2.js +6 -3
  158. package/dist/components/aico-upload-content2.js.map +1 -1
  159. package/dist/components/aico-video-content2.js +6 -3
  160. package/dist/components/aico-video-content2.js.map +1 -1
  161. package/dist/components/utils.js +10 -4
  162. package/dist/components/utils.js.map +1 -1
  163. package/dist/esm/aico-album-content_19.entry.js +76 -53
  164. package/dist/esm/aico-album-content_19.entry.js.map +1 -1
  165. package/dist/esm/aico-article-detail.entry.js +18 -17
  166. package/dist/esm/aico-article-detail.entry.js.map +1 -1
  167. package/dist/esm/aico-components.js +1 -1
  168. package/dist/esm/aico-fetch-article-detail.entry.js +3 -2
  169. package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -1
  170. package/dist/esm/aico-news-list-item.entry.js +1 -1
  171. package/dist/esm/aico-news-list-item.entry.js.map +1 -1
  172. package/dist/esm/aico-news-list.entry.js +4 -3
  173. package/dist/esm/aico-news-list.entry.js.map +1 -1
  174. package/dist/esm/aico-no-content_2.entry.js +5 -3
  175. package/dist/esm/aico-no-content_2.entry.js.map +1 -1
  176. package/dist/esm/aico-special-news-carousel.entry.js +4 -3
  177. package/dist/esm/aico-special-news-carousel.entry.js.map +1 -1
  178. package/dist/esm/loader.js +1 -1
  179. package/dist/esm/{utils-54ffec33.js → utils-b4eec8e9.js} +11 -5
  180. package/dist/esm/utils-b4eec8e9.js.map +1 -0
  181. package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +1 -0
  182. package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +1 -0
  183. package/dist/types/components/aico-news-list/aico-news-list.d.ts +1 -0
  184. package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +1 -0
  185. package/dist/types/components/content/aico-asking-content/aico-asking-content.d.ts +1 -0
  186. package/dist/types/components/content/aico-block-quote-content/aico-block-quote-content.d.ts +1 -0
  187. package/dist/types/components/content/aico-bullet-content/aico-bullet-content.d.ts +1 -0
  188. package/dist/types/components/content/aico-carousel-content/aico-carousel-content.d.ts +1 -0
  189. package/dist/types/components/content/aico-content-card-content/aico-content-card-content.d.ts +1 -0
  190. package/dist/types/components/content/aico-divider-content/aico-divider-content.d.ts +1 -0
  191. package/dist/types/components/content/aico-document-content/aico-document-content.d.ts +1 -0
  192. package/dist/types/components/content/aico-faq-content/aico-faq-content.d.ts +1 -0
  193. package/dist/types/components/content/aico-heading-content/aico-heading-content.d.ts +1 -0
  194. package/dist/types/components/content/aico-html-content/aico-html-content.d.ts +1 -0
  195. package/dist/types/components/content/aico-link-content/aico-link-content.d.ts +1 -0
  196. package/dist/types/components/content/aico-page-content/aico-page-content.d.ts +1 -0
  197. package/dist/types/components/content/aico-table-content/aico-table-content.d.ts +1 -0
  198. package/dist/types/components/content/aico-text-content/aico-text-content.d.ts +1 -0
  199. package/dist/types/components/content/aico-title-content/aico-title-content.d.ts +1 -0
  200. package/dist/types/components/content/aico-upload-content/aico-upload-content.d.ts +1 -0
  201. package/dist/types/components/content/aico-video-content/aico-video-content.d.ts +1 -0
  202. package/dist/types/components.d.ts +42 -0
  203. package/dist/types/model/article/content/CarouselContent.d.ts +4 -2
  204. package/dist/types/utils/utils.d.ts +2 -2
  205. package/package.json +3 -2
  206. package/dist/aico-components/p-0ca1f065.entry.js +0 -2
  207. package/dist/aico-components/p-0ca1f065.entry.js.map +0 -1
  208. package/dist/aico-components/p-1c4a07ef.entry.js.map +0 -1
  209. package/dist/aico-components/p-406fa2e5.entry.js +0 -2
  210. package/dist/aico-components/p-406fa2e5.entry.js.map +0 -1
  211. package/dist/aico-components/p-4c0f3325.entry.js +0 -2
  212. package/dist/aico-components/p-4c0f3325.entry.js.map +0 -1
  213. package/dist/aico-components/p-5109399b.entry.js +0 -2
  214. package/dist/aico-components/p-5109399b.entry.js.map +0 -1
  215. package/dist/aico-components/p-6464810e.entry.js +0 -2
  216. package/dist/aico-components/p-6464810e.entry.js.map +0 -1
  217. package/dist/aico-components/p-b1f8308f.entry.js +0 -2
  218. package/dist/aico-components/p-b1f8308f.entry.js.map +0 -1
  219. package/dist/aico-components/p-dfd3b0d3.js +0 -2
  220. package/dist/aico-components/p-dfd3b0d3.js.map +0 -1
  221. package/dist/cjs/utils-095ed22b.js.map +0 -1
  222. package/dist/esm/utils-54ffec33.js.map +0 -1
@@ -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,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,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,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AAC,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 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,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC;SAC1D;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAC3B,UAAU,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;YACpD,YAAY,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;SACvD;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,2BAA2B,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;YAC5E,YAAY,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;SACtD;QAED,IAAI,IAAI,CAAC,OAAO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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"]}
@@ -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;QAC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B,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,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,IAAI;4BACZ,QAAQ,EAAE,SAAS;4BACnB,MAAM,EAAE,SAAS;yBAClB;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 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,eAAe,CAAC;AACnD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAUpE,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,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,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CAAC,WAAW,CACpB,CACW,CAChB,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 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,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AK,EAAE,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,YAAY;YACpH,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI;gBAChD,WAAK,KAAK,EAAC,eAAe,EAAC,KAAK,EAAE,iBAAiB;oBACjD,0BAAoB,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,WAAY,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,CACrF;gBACN,YAAM,KAAK,EAAC,aAAa,EAAC,KAAK,EAAE,gBAAgB,IAC9C,WAAY,CAAC,WAAW,CACpB,CACW,CAChB,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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AAE,EAAE,iBAAiB,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;oBACxF,SACE,IAAI,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,mCAAI,GAAG,EAC9B,MAAM,EAAC,QAAQ,EACf,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;wBAEpG,WAAK,GAAG,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,GAAI,CACjC,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,MAA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,iBAAiB,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;oBACxF,SACE,IAAI,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,mCAAI,GAAG,EAC9B,MAAM,EAAC,QAAQ,EACf,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;wBAEpG,WAAK,GAAG,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,GAAI,CACjC,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 @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,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AqB,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"]}