@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.
- package/dist/aico-components/aico-components.css +1 -1
- package/dist/aico-components/aico-components.esm.js +1 -1
- package/dist/aico-components/aico-components.esm.js.map +1 -1
- package/dist/aico-components/p-0b6e7469.entry.js +2 -0
- package/dist/aico-components/p-0b6e7469.entry.js.map +1 -0
- package/dist/aico-components/p-19752961.entry.js +2 -0
- package/dist/aico-components/p-19752961.entry.js.map +1 -0
- package/dist/aico-components/p-2677f2ab.js +2 -0
- package/dist/aico-components/p-2677f2ab.js.map +1 -0
- package/dist/aico-components/{p-1c4a07ef.entry.js → p-368503ee.entry.js} +3 -3
- package/dist/aico-components/p-368503ee.entry.js.map +1 -0
- package/dist/aico-components/p-7e0074f7.entry.js +2 -0
- package/dist/aico-components/p-7e0074f7.entry.js.map +1 -0
- package/dist/aico-components/p-9ea26390.entry.js +2 -0
- package/dist/aico-components/p-9ea26390.entry.js.map +1 -0
- package/dist/aico-components/p-bccf08d0.entry.js +2 -0
- package/dist/aico-components/p-bccf08d0.entry.js.map +1 -0
- package/dist/aico-components/p-c9eea1b1.entry.js +2 -0
- package/dist/aico-components/p-c9eea1b1.entry.js.map +1 -0
- package/dist/cjs/aico-album-content_19.cjs.entry.js +76 -53
- package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-article-detail.cjs.entry.js +18 -17
- package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-components.cjs.js +1 -1
- package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +3 -2
- package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-news-list-item.cjs.entry.js +1 -1
- package/dist/cjs/aico-news-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-news-list.cjs.entry.js +4 -3
- package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-no-content_2.cjs.entry.js +5 -3
- package/dist/cjs/aico-no-content_2.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-special-news-carousel.cjs.entry.js +4 -3
- package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-095ed22b.js → utils-c1b7a052.js} +11 -5
- package/dist/cjs/utils-c1b7a052.js.map +1 -0
- package/dist/collection/components/aico-article-detail/aico-article-detail.js +36 -17
- package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
- package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +20 -1
- package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
- package/dist/collection/components/aico-news-list/aico-news-list.js +19 -2
- package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
- package/dist/collection/components/aico-news-list-item/aico-news-list-item.js +1 -1
- package/dist/collection/components/aico-news-list-item/aico-news-list-item.js.map +1 -1
- package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +19 -2
- package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
- package/dist/collection/components/content/aico-asking-content/aico-asking-content.js +22 -3
- package/dist/collection/components/content/aico-asking-content/aico-asking-content.js.map +1 -1
- package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js +16 -0
- package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js +21 -1
- package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js.map +1 -1
- package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js +18 -0
- package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js +25 -5
- package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js.map +1 -1
- package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js +29 -0
- package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js +25 -3
- package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js.map +1 -1
- package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js +35 -3
- package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js +22 -3
- package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js.map +1 -1
- package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js +10 -0
- package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-divider-content/aico-divider-content.js +21 -1
- package/dist/collection/components/content/aico-divider-content/aico-divider-content.js.map +1 -1
- package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js +9 -0
- package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-document-content/aico-document-content.js +22 -3
- package/dist/collection/components/content/aico-document-content/aico-document-content.js.map +1 -1
- package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js +11 -0
- package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-faq-content/aico-faq-content.js +21 -1
- package/dist/collection/components/content/aico-faq-content/aico-faq-content.js.map +1 -1
- package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js +25 -0
- package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-heading-content/aico-heading-content.js +22 -2
- package/dist/collection/components/content/aico-heading-content/aico-heading-content.js.map +1 -1
- package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js +10 -0
- package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-html-content/aico-html-content.js +22 -4
- package/dist/collection/components/content/aico-html-content/aico-html-content.js.map +1 -1
- package/dist/collection/components/content/aico-link-content/aico-link-content.js +22 -3
- package/dist/collection/components/content/aico-link-content/aico-link-content.js.map +1 -1
- package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js +24 -0
- package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-page-content/aico-page-content.js +23 -4
- package/dist/collection/components/content/aico-page-content/aico-page-content.js.map +1 -1
- package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js +11 -0
- package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-table-content/aico-table-content.js +26 -6
- package/dist/collection/components/content/aico-table-content/aico-table-content.js.map +1 -1
- package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js +58 -0
- package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-text-content/aico-text-content.js +25 -9
- package/dist/collection/components/content/aico-text-content/aico-text-content.js.map +1 -1
- package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js +55 -0
- package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-title-content/aico-title-content.js +23 -3
- package/dist/collection/components/content/aico-title-content/aico-title-content.js.map +1 -1
- package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js +12 -1
- package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-upload-content/aico-upload-content.js +22 -2
- package/dist/collection/components/content/aico-upload-content/aico-upload-content.js.map +1 -1
- package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js +8 -0
- package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js.map +1 -1
- package/dist/collection/components/content/aico-video-content/aico-video-content.js +22 -2
- package/dist/collection/components/content/aico-video-content/aico-video-content.js.map +1 -1
- package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js +17 -0
- package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js.map +1 -1
- package/dist/collection/model/article/content/CarouselContent.js.map +1 -1
- package/dist/collection/utils/utils.js +10 -4
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/aico-article-detail2.js +20 -18
- package/dist/components/aico-article-detail2.js.map +1 -1
- package/dist/components/aico-asking-content2.js +6 -4
- package/dist/components/aico-asking-content2.js.map +1 -1
- package/dist/components/aico-block-quote-content2.js +5 -2
- package/dist/components/aico-block-quote-content2.js.map +1 -1
- package/dist/components/aico-bullet-content2.js +9 -6
- package/dist/components/aico-bullet-content2.js.map +1 -1
- package/dist/components/aico-carousel-content2.js +9 -4
- package/dist/components/aico-carousel-content2.js.map +1 -1
- package/dist/components/aico-content-card-content2.js +6 -4
- package/dist/components/aico-content-card-content2.js.map +1 -1
- package/dist/components/aico-divider-content2.js +5 -2
- package/dist/components/aico-divider-content2.js.map +1 -1
- package/dist/components/aico-document-content2.js +6 -4
- package/dist/components/aico-document-content2.js.map +1 -1
- package/dist/components/aico-faq-content2.js +5 -2
- package/dist/components/aico-faq-content2.js.map +1 -1
- package/dist/components/aico-fetch-article-detail.js +3 -1
- package/dist/components/aico-fetch-article-detail.js.map +1 -1
- package/dist/components/aico-heading-content2.js +6 -3
- package/dist/components/aico-heading-content2.js.map +1 -1
- package/dist/components/aico-html-content2.js +7 -12
- package/dist/components/aico-html-content2.js.map +1 -1
- package/dist/components/aico-link-content2.js +6 -4
- package/dist/components/aico-link-content2.js.map +1 -1
- package/dist/components/aico-news-list-item2.js +1 -1
- package/dist/components/aico-news-list-item2.js.map +1 -1
- package/dist/components/aico-news-list.js +4 -2
- package/dist/components/aico-news-list.js.map +1 -1
- package/dist/components/aico-page-content2.js +7 -5
- package/dist/components/aico-page-content2.js.map +1 -1
- package/dist/components/aico-special-news-carousel.js +4 -2
- package/dist/components/aico-special-news-carousel.js.map +1 -1
- package/dist/components/aico-table-content2.js +10 -7
- package/dist/components/aico-table-content2.js.map +1 -1
- package/dist/components/aico-text-content2.js +9 -10
- package/dist/components/aico-text-content2.js.map +1 -1
- package/dist/components/aico-title-content2.js +7 -4
- package/dist/components/aico-title-content2.js.map +1 -1
- package/dist/components/aico-upload-content2.js +6 -3
- package/dist/components/aico-upload-content2.js.map +1 -1
- package/dist/components/aico-video-content2.js +6 -3
- package/dist/components/aico-video-content2.js.map +1 -1
- package/dist/components/utils.js +10 -4
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/aico-album-content_19.entry.js +76 -53
- package/dist/esm/aico-album-content_19.entry.js.map +1 -1
- package/dist/esm/aico-article-detail.entry.js +18 -17
- package/dist/esm/aico-article-detail.entry.js.map +1 -1
- package/dist/esm/aico-components.js +1 -1
- package/dist/esm/aico-fetch-article-detail.entry.js +3 -2
- package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -1
- package/dist/esm/aico-news-list-item.entry.js +1 -1
- package/dist/esm/aico-news-list-item.entry.js.map +1 -1
- package/dist/esm/aico-news-list.entry.js +4 -3
- package/dist/esm/aico-news-list.entry.js.map +1 -1
- package/dist/esm/aico-no-content_2.entry.js +5 -3
- package/dist/esm/aico-no-content_2.entry.js.map +1 -1
- package/dist/esm/aico-special-news-carousel.entry.js +4 -3
- package/dist/esm/aico-special-news-carousel.entry.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-54ffec33.js → utils-b4eec8e9.js} +11 -5
- package/dist/esm/utils-b4eec8e9.js.map +1 -0
- package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +1 -0
- package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +1 -0
- package/dist/types/components/aico-news-list/aico-news-list.d.ts +1 -0
- package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +1 -0
- package/dist/types/components/content/aico-asking-content/aico-asking-content.d.ts +1 -0
- package/dist/types/components/content/aico-block-quote-content/aico-block-quote-content.d.ts +1 -0
- package/dist/types/components/content/aico-bullet-content/aico-bullet-content.d.ts +1 -0
- package/dist/types/components/content/aico-carousel-content/aico-carousel-content.d.ts +1 -0
- package/dist/types/components/content/aico-content-card-content/aico-content-card-content.d.ts +1 -0
- package/dist/types/components/content/aico-divider-content/aico-divider-content.d.ts +1 -0
- package/dist/types/components/content/aico-document-content/aico-document-content.d.ts +1 -0
- package/dist/types/components/content/aico-faq-content/aico-faq-content.d.ts +1 -0
- package/dist/types/components/content/aico-heading-content/aico-heading-content.d.ts +1 -0
- package/dist/types/components/content/aico-html-content/aico-html-content.d.ts +1 -0
- package/dist/types/components/content/aico-link-content/aico-link-content.d.ts +1 -0
- package/dist/types/components/content/aico-page-content/aico-page-content.d.ts +1 -0
- package/dist/types/components/content/aico-table-content/aico-table-content.d.ts +1 -0
- package/dist/types/components/content/aico-text-content/aico-text-content.d.ts +1 -0
- package/dist/types/components/content/aico-title-content/aico-title-content.d.ts +1 -0
- package/dist/types/components/content/aico-upload-content/aico-upload-content.d.ts +1 -0
- package/dist/types/components/content/aico-video-content/aico-video-content.d.ts +1 -0
- package/dist/types/components.d.ts +42 -0
- package/dist/types/model/article/content/CarouselContent.d.ts +4 -2
- package/dist/types/utils/utils.d.ts +2 -2
- package/package.json +3 -2
- package/dist/aico-components/p-0ca1f065.entry.js +0 -2
- package/dist/aico-components/p-0ca1f065.entry.js.map +0 -1
- package/dist/aico-components/p-1c4a07ef.entry.js.map +0 -1
- package/dist/aico-components/p-406fa2e5.entry.js +0 -2
- package/dist/aico-components/p-406fa2e5.entry.js.map +0 -1
- package/dist/aico-components/p-4c0f3325.entry.js +0 -2
- package/dist/aico-components/p-4c0f3325.entry.js.map +0 -1
- package/dist/aico-components/p-5109399b.entry.js +0 -2
- package/dist/aico-components/p-5109399b.entry.js.map +0 -1
- package/dist/aico-components/p-6464810e.entry.js +0 -2
- package/dist/aico-components/p-6464810e.entry.js.map +0 -1
- package/dist/aico-components/p-b1f8308f.entry.js +0 -2
- package/dist/aico-components/p-b1f8308f.entry.js.map +0 -1
- package/dist/aico-components/p-dfd3b0d3.js +0 -2
- package/dist/aico-components/p-dfd3b0d3.js.map +0 -1
- package/dist/cjs/utils-095ed22b.js.map +0 -1
- package/dist/esm/utils-54ffec33.js.map +0 -1
|
@@ -4,6 +4,7 @@ export class AicoArticleDetail {
|
|
|
4
4
|
constructor() {
|
|
5
5
|
this.dateOptions = { day: 'numeric', month: 'long', year: 'numeric' };
|
|
6
6
|
this.article = undefined;
|
|
7
|
+
this.locale = 'de';
|
|
7
8
|
}
|
|
8
9
|
render() {
|
|
9
10
|
const articleDate = new Date(this.article.attributes.publishDate);
|
|
@@ -26,43 +27,43 @@ export class AicoArticleDetail {
|
|
|
26
27
|
case ContentType.ALBUM:
|
|
27
28
|
return h("aico-album-content", { content: content });
|
|
28
29
|
case ContentType.ASKING:
|
|
29
|
-
return h("aico-asking-content", { content: content });
|
|
30
|
+
return h("aico-asking-content", { content: content, locale: this.locale });
|
|
30
31
|
case ContentType.BLOCK_QUOTE:
|
|
31
|
-
return h("aico-block-quote-content", { content: content });
|
|
32
|
+
return h("aico-block-quote-content", { content: content, locale: this.locale });
|
|
32
33
|
case ContentType.BULLET:
|
|
33
|
-
return h("aico-bullet-content", { content: content });
|
|
34
|
+
return h("aico-bullet-content", { content: content, locale: this.locale });
|
|
34
35
|
case ContentType.CAROUSEL:
|
|
35
|
-
return h("aico-carousel-content", { content: content });
|
|
36
|
+
return h("aico-carousel-content", { content: content, locale: this.locale });
|
|
36
37
|
case ContentType.CONTENT_CARD:
|
|
37
|
-
return h("aico-content-card-content", { content: content });
|
|
38
|
+
return h("aico-content-card-content", { content: content, locale: this.locale });
|
|
38
39
|
case ContentType.DIVIDER:
|
|
39
|
-
return h("aico-divider-content", { content: content });
|
|
40
|
+
return h("aico-divider-content", { content: content, locale: this.locale });
|
|
40
41
|
case ContentType.DOCUMENT:
|
|
41
|
-
return h("aico-document-content", { content: content });
|
|
42
|
+
return h("aico-document-content", { content: content, locale: this.locale });
|
|
42
43
|
case ContentType.FAQ:
|
|
43
|
-
return h("aico-faq-content", { content: content });
|
|
44
|
+
return h("aico-faq-content", { content: content, locale: this.locale });
|
|
44
45
|
case ContentType.HEADING:
|
|
45
|
-
return h("aico-heading-content", { content: content });
|
|
46
|
+
return h("aico-heading-content", { content: content, locale: this.locale });
|
|
46
47
|
case ContentType.HTML:
|
|
47
|
-
return h("aico-html-content", { content: content });
|
|
48
|
+
return h("aico-html-content", { content: content, locale: this.locale });
|
|
48
49
|
case ContentType.LINK:
|
|
49
|
-
return h("aico-link-content", { content: content });
|
|
50
|
+
return h("aico-link-content", { content: content, locale: this.locale });
|
|
50
51
|
case ContentType.NEWS:
|
|
51
52
|
return h("aico-news-content", { content: content });
|
|
52
53
|
case ContentType.PAGE:
|
|
53
|
-
return h("aico-page-content", { content: content });
|
|
54
|
+
return h("aico-page-content", { content: content, locale: this.locale });
|
|
54
55
|
case ContentType.TABLE:
|
|
55
|
-
return h("aico-table-content", { content: content });
|
|
56
|
+
return h("aico-table-content", { content: content, locale: this.locale });
|
|
56
57
|
case ContentType.TESTIMONIAL:
|
|
57
58
|
return h("aico-testimonial-content", { content: content });
|
|
58
59
|
case ContentType.TEXT:
|
|
59
|
-
return h("aico-text-content", { content: content });
|
|
60
|
+
return h("aico-text-content", { content: content, locale: this.locale });
|
|
60
61
|
case ContentType.TITLE:
|
|
61
|
-
return h("aico-title-content", { content: content });
|
|
62
|
+
return h("aico-title-content", { content: content, locale: this.locale });
|
|
62
63
|
case ContentType.UPLOAD:
|
|
63
|
-
return h("aico-upload-content", { content: content });
|
|
64
|
+
return h("aico-upload-content", { content: content, locale: this.locale });
|
|
64
65
|
case ContentType.VIDEO:
|
|
65
|
-
return h("aico-video-content", { content: content });
|
|
66
|
+
return h("aico-video-content", { content: content, locale: this.locale });
|
|
66
67
|
case ContentType.PRODUCT:
|
|
67
68
|
case ContentType.AGENDA:
|
|
68
69
|
case ContentType.LIST_ASKING:
|
|
@@ -110,6 +111,24 @@ export class AicoArticleDetail {
|
|
|
110
111
|
"tags": [],
|
|
111
112
|
"text": ""
|
|
112
113
|
}
|
|
114
|
+
},
|
|
115
|
+
"locale": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"mutable": false,
|
|
118
|
+
"complexType": {
|
|
119
|
+
"original": "string",
|
|
120
|
+
"resolved": "string",
|
|
121
|
+
"references": {}
|
|
122
|
+
},
|
|
123
|
+
"required": false,
|
|
124
|
+
"optional": false,
|
|
125
|
+
"docs": {
|
|
126
|
+
"tags": [],
|
|
127
|
+
"text": ""
|
|
128
|
+
},
|
|
129
|
+
"attribute": "locale",
|
|
130
|
+
"reflect": false,
|
|
131
|
+
"defaultValue": "'de'"
|
|
113
132
|
}
|
|
114
133
|
};
|
|
115
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-article-detail.js","sourceRoot":"","sources":["../../../src/components/aico-article-detail/aico-article-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AA4B9D,MAAM,OAAO,iBAAiB;;QAGX,gBAAW,GAA+B,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;;IAE9G,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAClE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAA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nimport { ContentType } from '../../model/article/ContentType';\nimport type { Article, ArticleContent, ArticleContentBuilderColumn, ArticleContentBuilderRow } from '../../model/Article';\nimport type { HtmlContent } from '../../model/article/content/HtmlContent';\nimport type { AlbumContent } from '../../model/article/content/AlbumContent';\nimport type { TitleContent } from '../../model/article/content/TitleContent';\nimport type { BlockQuoteContent } from '../../model/article/content/BlockQuoteContent';\nimport type { BulletContent } from '../../model/article/content/BulletContent';\nimport type { CardContent } from '../../model/article/content/CardContent';\nimport type { CarouselContent } from '../../model/article/content/CarouselContent';\nimport type { DividerContent } from '../../model/article/content/DividerContent';\nimport type { DocumentContent } from '../../model/article/content/DocumentContent';\nimport type { HeadingContent } from '../../model/article/content/HeadingContent';\nimport type { LinkContent } from '../../model/article/content/LinkContent';\nimport type { TableContent } from '../../model/article/content/TableContet';\nimport type { TestimonialContent } from '../../model/article/content/TestimonialContent';\nimport type { TextContent } from '../../model/article/content/TextContent';\nimport type { VideoContent } from '../../model/article/content/VideoContent';\nimport type { AskingContent } from '../../model/article/content/AskingContent';\nimport type { FaqContent } from '../../model/article/content/FaqContent';\nimport type { NewsContent } from '../../model/article/content/NewsContent';\nimport type { PageContent } from '../../model/article/content/PageContent';\nimport type { UploadContent } from '../../model/article/content/UploadContent';\n\n@Component({\n tag: 'aico-article-detail',\n styleUrl: 'aico-article-detail.css',\n scoped: true,\n})\nexport class AicoArticleDetail {\n @Prop() article!: Article;\n\n private readonly dateOptions: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric' };\n\n render() {\n const articleDate = new Date(this.article.attributes.publishDate);\n const content = this.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <figcaption class=\"blockquote-footer\">\n {articleDate.toLocaleDateString('en-US', this.dateOptions)} by <cite title=\"Author\">{this.article.attributes.author}</cite>\n </figcaption>\n </figure>\n <div class=\"content-wrapper\">{content}</div>\n </Host>\n );\n }\n\n private mapRowContent(row: ArticleContentBuilderRow, index: number) {\n const rowContent = row.columns.map((column, columnIndex) => this.mapColumnContent(column, columnIndex));\n return <div class={`content-row content-row-index-${index}`}>{rowContent}</div>;\n }\n\n private mapColumnContent(column: ArticleContentBuilderColumn, index: number) {\n const columnContent = column.contentContainer.contents.sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0)).map((content, contentIndex) => this.mapContent(content, contentIndex));\n return <div class={`content-column content-column-index-${index}`}>{columnContent}</div>;\n }\n\n private mapContent(content: ArticleContent, index: number) {\n return <div class={`content-data-wrapper content-data-wrapper-index-${index}`}>{this.mapContentData(content.type, content.contentData)}</div>;\n }\n\n private mapContentData(contentType: ContentType | undefined, content: object) {\n switch (contentType) {\n case ContentType.ALBUM:\n return <aico-album-content content={content as AlbumContent} />;\n\n case ContentType.ASKING:\n return <aico-asking-content content={content as AskingContent} />;\n\n case ContentType.BLOCK_QUOTE:\n return <aico-block-quote-content content={content as BlockQuoteContent} />;\n\n case ContentType.BULLET:\n return <aico-bullet-content content={content as BulletContent} />;\n\n case ContentType.CAROUSEL:\n return <aico-carousel-content content={content as CarouselContent} />;\n\n case ContentType.CONTENT_CARD:\n return <aico-content-card-content content={content as CardContent} />;\n\n case ContentType.DIVIDER:\n return <aico-divider-content content={content as DividerContent} />;\n\n case ContentType.DOCUMENT:\n return <aico-document-content content={content as DocumentContent} />;\n\n case ContentType.FAQ:\n return <aico-faq-content content={content as FaqContent} />;\n\n case ContentType.HEADING:\n return <aico-heading-content content={content as HeadingContent} />;\n\n case ContentType.HTML:\n return <aico-html-content content={content as HtmlContent} />;\n\n case ContentType.LINK:\n return <aico-link-content content={content as LinkContent} />;\n\n case ContentType.NEWS:\n return <aico-news-content content={content as NewsContent} />;\n\n case ContentType.PAGE:\n return <aico-page-content content={content as PageContent} />;\n\n case ContentType.TABLE:\n return <aico-table-content content={content as TableContent} />;\n\n case ContentType.TESTIMONIAL:\n return <aico-testimonial-content content={content as TestimonialContent} />;\n\n case ContentType.TEXT:\n return <aico-text-content content={content as TextContent} />;\n\n case ContentType.TITLE:\n return <aico-title-content content={content as TitleContent} />;\n\n case ContentType.UPLOAD:\n return <aico-upload-content content={content as UploadContent} />;\n\n case ContentType.VIDEO:\n return <aico-video-content content={content as VideoContent} />;\n\n case ContentType.PRODUCT:\n case ContentType.AGENDA:\n case ContentType.LIST_ASKING:\n case ContentType.LIST_AGENDA:\n case ContentType.CRM:\n case ContentType.B2B:\n case ContentType.FORM_BUILDER:\n case ContentType.COURSE:\n case ContentType.COLLECTION:\n default:\n return <div class=\"content-data content-data-not-handled\">Content type not handled.</div>;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"aico-article-detail.js","sourceRoot":"","sources":["../../../src/components/aico-article-detail/aico-article-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AA4B9D,MAAM,OAAO,iBAAiB;;QAKX,gBAAW,GAA+B,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;sBAFrF,IAAI;;IAI7B,MAAM;QACJ,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAClE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,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AAK,WAAW,CAAC,KAAK;gBACpB,OAAO,0BAAoB,OAAO,EAAE,OAAuB,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,CAAC;YAEvF,KAAK,WAAW,CAAC,OAAO,CAAC;YACzB,KAAK,WAAW,CAAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,WAAW,CAAC;YAC7B,KAAK,WAAW,CAAC,WAAW,CAAC;YAC7B,KAAK,WAAW,CAAC,GAAG,CAAC;YACrB,KAAK,WAAW,CAAC,GAAG,CAAC;YACrB,KAAK,WAAW,CAAC,YAAY,CAAC;YAC9B,KAAK,WAAW,CAAC,MAAM,CAAC;YACxB,KAAK,WAAW,CAAC,UAAU,CAAC;YAC5B;gBACE,OAAO,WAAK,KAAK,EAAC,uCAAuC,gCAAgC,CAAC;SAC7F;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport { ContentType } from '../../model/article/ContentType';\nimport type { Article, ArticleContent, ArticleContentBuilderColumn, ArticleContentBuilderRow } from '../../model/Article';\nimport type { HtmlContent } from '../../model/article/content/HtmlContent';\nimport type { AlbumContent } from '../../model/article/content/AlbumContent';\nimport type { TitleContent } from '../../model/article/content/TitleContent';\nimport type { BlockQuoteContent } from '../../model/article/content/BlockQuoteContent';\nimport type { BulletContent } from '../../model/article/content/BulletContent';\nimport type { CardContent } from '../../model/article/content/CardContent';\nimport type { CarouselContent } from '../../model/article/content/CarouselContent';\nimport type { DividerContent } from '../../model/article/content/DividerContent';\nimport type { DocumentContent } from '../../model/article/content/DocumentContent';\nimport type { HeadingContent } from '../../model/article/content/HeadingContent';\nimport type { LinkContent } from '../../model/article/content/LinkContent';\nimport type { TableContent } from '../../model/article/content/TableContet';\nimport type { TestimonialContent } from '../../model/article/content/TestimonialContent';\nimport type { TextContent } from '../../model/article/content/TextContent';\nimport type { VideoContent } from '../../model/article/content/VideoContent';\nimport type { AskingContent } from '../../model/article/content/AskingContent';\nimport type { FaqContent } from '../../model/article/content/FaqContent';\nimport type { NewsContent } from '../../model/article/content/NewsContent';\nimport type { PageContent } from '../../model/article/content/PageContent';\nimport type { UploadContent } from '../../model/article/content/UploadContent';\n\n@Component({\n tag: 'aico-article-detail',\n styleUrl: 'aico-article-detail.css',\n scoped: true,\n})\nexport class AicoArticleDetail {\n @Prop() article!: Article;\n\n @Prop() locale: string = 'de';\n\n private readonly dateOptions: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric' };\n\n render() {\n const articleDate = new Date(this.article.attributes.publishDate);\n const content = this.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));\n return (\n <Host>\n <figure>\n <blockquote class=\"blockquote\">\n <h2 class=\"text-uppercase\">{this.article.attributes.name}</h2>\n </blockquote>\n <figcaption class=\"blockquote-footer\">\n {articleDate.toLocaleDateString('en-US', this.dateOptions)} by <cite title=\"Author\">{this.article.attributes.author}</cite>\n </figcaption>\n </figure>\n <div class=\"content-wrapper\">{content}</div>\n </Host>\n );\n }\n\n private mapRowContent(row: ArticleContentBuilderRow, index: number) {\n const rowContent = row.columns.map((column, columnIndex) => this.mapColumnContent(column, columnIndex));\n return <div class={`content-row content-row-index-${index}`}>{rowContent}</div>;\n }\n\n private mapColumnContent(column: ArticleContentBuilderColumn, index: number) {\n const columnContent = column.contentContainer.contents.sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0)).map((content, contentIndex) => this.mapContent(content, contentIndex));\n return <div class={`content-column content-column-index-${index}`}>{columnContent}</div>;\n }\n\n private mapContent(content: ArticleContent, index: number) {\n return <div class={`content-data-wrapper content-data-wrapper-index-${index}`}>{this.mapContentData(content.type, content.contentData)}</div>;\n }\n\n private mapContentData(contentType: ContentType | undefined, content: object) {\n switch (contentType) {\n case ContentType.ALBUM:\n return <aico-album-content content={content as AlbumContent} />;\n\n case ContentType.ASKING:\n return <aico-asking-content content={content as AskingContent} locale={this.locale} />;\n\n case ContentType.BLOCK_QUOTE:\n return <aico-block-quote-content content={content as BlockQuoteContent} locale={this.locale} />;\n\n case ContentType.BULLET:\n return <aico-bullet-content content={content as BulletContent} locale={this.locale} />;\n\n case ContentType.CAROUSEL:\n return <aico-carousel-content content={content as CarouselContent} locale={this.locale} />;\n\n case ContentType.CONTENT_CARD:\n return <aico-content-card-content content={content as CardContent} locale={this.locale} />;\n\n case ContentType.DIVIDER:\n return <aico-divider-content content={content as DividerContent} locale={this.locale} />;\n\n case ContentType.DOCUMENT:\n return <aico-document-content content={content as DocumentContent} locale={this.locale} />;\n\n case ContentType.FAQ:\n return <aico-faq-content content={content as FaqContent} locale={this.locale} />;\n\n case ContentType.HEADING:\n return <aico-heading-content content={content as HeadingContent} locale={this.locale} />;\n\n case ContentType.HTML:\n return <aico-html-content content={content as HtmlContent} locale={this.locale} />;\n\n case ContentType.LINK:\n return <aico-link-content content={content as LinkContent} locale={this.locale} />;\n\n case ContentType.NEWS:\n return <aico-news-content content={content as NewsContent} />;\n\n case ContentType.PAGE:\n return <aico-page-content content={content as PageContent} locale={this.locale} />;\n\n case ContentType.TABLE:\n return <aico-table-content content={content as TableContent} locale={this.locale} />;\n\n case ContentType.TESTIMONIAL:\n return <aico-testimonial-content content={content as TestimonialContent} />;\n\n case ContentType.TEXT:\n return <aico-text-content content={content as TextContent} locale={this.locale} />;\n\n case ContentType.TITLE:\n return <aico-title-content content={content as TitleContent} locale={this.locale} />;\n\n case ContentType.UPLOAD:\n return <aico-upload-content content={content as UploadContent} locale={this.locale} />;\n\n case ContentType.VIDEO:\n return <aico-video-content content={content as VideoContent} locale={this.locale} />;\n\n case ContentType.PRODUCT:\n case ContentType.AGENDA:\n case ContentType.LIST_ASKING:\n case ContentType.LIST_AGENDA:\n case ContentType.CRM:\n case ContentType.B2B:\n case ContentType.FORM_BUILDER:\n case ContentType.COURSE:\n case ContentType.COLLECTION:\n default:\n return <div class=\"content-data content-data-not-handled\">Content type not handled.</div>;\n }\n }\n}\n"]}
|
|
@@ -5,6 +5,7 @@ export class AicoFetchArticleDetail {
|
|
|
5
5
|
this.article = undefined;
|
|
6
6
|
this.aicoUrl = undefined;
|
|
7
7
|
this.aicoBearerToken = undefined;
|
|
8
|
+
this.locale = 'de';
|
|
8
9
|
this.articleId = undefined;
|
|
9
10
|
this.articleUrlHandle = undefined;
|
|
10
11
|
}
|
|
@@ -26,7 +27,7 @@ export class AicoFetchArticleDetail {
|
|
|
26
27
|
this.article = await fetchNewsArticle(this.api, this.articleId, this.articleFetchController.signal);
|
|
27
28
|
}
|
|
28
29
|
render() {
|
|
29
|
-
return h("aico-article-detail", { article: this.article });
|
|
30
|
+
return h("aico-article-detail", { article: this.article, locale: this.locale });
|
|
30
31
|
}
|
|
31
32
|
static get is() { return "aico-fetch-article-detail"; }
|
|
32
33
|
static get encapsulation() { return "scoped"; }
|
|
@@ -76,6 +77,24 @@ export class AicoFetchArticleDetail {
|
|
|
76
77
|
"attribute": "aico-bearer-token",
|
|
77
78
|
"reflect": false
|
|
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'"
|
|
97
|
+
},
|
|
79
98
|
"articleId": {
|
|
80
99
|
"type": "string",
|
|
81
100
|
"mutable": false,
|
package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-fetch-article-detail.js","sourceRoot":"","sources":["../../../src/components/aico-fetch-article-detail/aico-fetch-article-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAS/E,MAAM,OAAO,sBAAsB
|
|
1
|
+
{"version":3,"file":"aico-fetch-article-detail.js","sourceRoot":"","sources":["../../../src/components/aico-fetch-article-detail/aico-fetch-article-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAS/E,MAAM,OAAO,sBAAsB;;;;;sBAOR,IAAI;;;;IAqB7B,iBAAiB;QACf,IAAI,CAAC,sBAAsB,GAAG,IAAI,eAAe,EAAE,CAAC;QACpD,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;IAC1E,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,sBAAuB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC7C,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;SAC9E;QAED,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,IAAI,CAAC,OAAO,GAAG,MAAM,wBAAwB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,sBAAuB,CAAC,MAAM,CAAC,CAAC;YACrH,OAAO;SACR;QAED,IAAI,CAAC,OAAO,GAAG,MAAM,gBAAgB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,SAAU,EAAE,IAAI,CAAC,sBAAuB,CAAC,MAAM,CAAC,CAAC;IACzG,CAAC;IAED,MAAM;QACJ,OAAO,2BAAqB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAI,CAAC;IAC7E,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticle, fetchNewsArticleByHandle } from '../../utils/utils';\nimport { Article } from '../../model/Article';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\n\n@Component({\n tag: 'aico-fetch-article-detail',\n styleUrl: 'aico-fetch-article-detail.css',\n scoped: true,\n})\nexport class AicoFetchArticleDetail {\n @State() article!: Article;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() locale: string = 'de';\n\n /**\n * The id will be used to fetch the article.\n *\n * If both the {@link AicoFetchArticleDetail#articleId} and {@link AicoFetchArticleDetail#articleUrlHandle} are\n * provided, the latter will be used. If neither are provided, an error is thrown.\n */\n @Prop() articleId?: string;\n\n /**\n * The url handle will be used to fetch the article.\n *\n * If both the {@link AicoFetchArticleDetail#articleId} and {@link AicoFetchArticleDetail#articleUrlHandle} are\n * provided, the latter will be used. If neither are provided, an error is thrown.\n */\n @Prop() articleUrlHandle?: string;\n\n private api?: AicoApiRequestInfo;\n private articleFetchController?: AbortController;\n\n connectedCallback() {\n this.articleFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.articleFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n if (!this.articleId && !this.articleUrlHandle) {\n throw new Error('Either the article id or the url handle must be provided.');\n }\n\n if (this.articleUrlHandle) {\n this.article = await fetchNewsArticleByHandle(this.api!, this.articleUrlHandle, this.articleFetchController!.signal);\n return;\n }\n\n this.article = await fetchNewsArticle(this.api!, this.articleId!, this.articleFetchController!.signal);\n }\n\n render() {\n return <aico-article-detail article={this.article} locale={this.locale} />;\n }\n}\n"]}
|
|
@@ -7,6 +7,7 @@ export class AicoNewsList {
|
|
|
7
7
|
this.pageNumber = 1;
|
|
8
8
|
this.aicoUrl = undefined;
|
|
9
9
|
this.aicoBearerToken = undefined;
|
|
10
|
+
this.newsChannels = [];
|
|
10
11
|
this.nextButtonText = 'Next';
|
|
11
12
|
this.previousButtonText = 'Previous';
|
|
12
13
|
}
|
|
@@ -19,11 +20,11 @@ export class AicoNewsList {
|
|
|
19
20
|
this.newsListFetchController.abort('disconnected');
|
|
20
21
|
}
|
|
21
22
|
async componentWillLoad() {
|
|
22
|
-
this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal);
|
|
23
|
+
this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels);
|
|
23
24
|
}
|
|
24
25
|
async componentWillUpdate() {
|
|
25
26
|
this.newsListFetchController = new AbortController();
|
|
26
|
-
this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal);
|
|
27
|
+
this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels);
|
|
27
28
|
}
|
|
28
29
|
render() {
|
|
29
30
|
var _a, _b, _c;
|
|
@@ -123,6 +124,22 @@ export class AicoNewsList {
|
|
|
123
124
|
"attribute": "aico-bearer-token",
|
|
124
125
|
"reflect": false
|
|
125
126
|
},
|
|
127
|
+
"newsChannels": {
|
|
128
|
+
"type": "unknown",
|
|
129
|
+
"mutable": false,
|
|
130
|
+
"complexType": {
|
|
131
|
+
"original": "string[]",
|
|
132
|
+
"resolved": "string[]",
|
|
133
|
+
"references": {}
|
|
134
|
+
},
|
|
135
|
+
"required": false,
|
|
136
|
+
"optional": false,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": ""
|
|
140
|
+
},
|
|
141
|
+
"defaultValue": "[]"
|
|
142
|
+
},
|
|
126
143
|
"nextButtonText": {
|
|
127
144
|
"type": "string",
|
|
128
145
|
"mutable": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-news-list.js","sourceRoot":"","sources":["../../../src/components/aico-news-list/aico-news-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAUtD,MAAM,OAAO,YAAY;;QACN,aAAQ,GAAG,EAAE,CAAC;;0BAIT,CAAC;;;8BAMU,MAAM;kCAEF,UAAU;;IAO/C,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QAEpB,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;IAC1E,CAAC;IAED,oBAAoB;QAClB,IAAI,CAAC,uBAAwB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IACtD,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,IAAI,CAAC,YAAY,GAAG,MAAM,iBAAiB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,uBAAwB,CAAC,MAAM,CAAC,CAAC;IAC/H,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,IAAI,CAAC,uBAA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AI,CAAC,CAAC,GAAG,CAAC,EAAE;YAClF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACnB;QAED,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,IAAI,CAAC,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,CAAC,GAAG,CAAC,EAAE;YACnF,KAAK,CAAC,IAAI,CAAC,GAAG,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxD;QAED,OAAO,KAAK,CAAC;IACf,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticles } from '../../utils/utils';\nimport { NewsResponse } from '../../model/NewsResponse';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list',\n styleUrl: 'aico-news-list.css',\n scoped: true,\n})\nexport class AicoNewsList {\n private readonly pageSize = 16;\n\n @State() newsResponse?: NewsResponse;\n\n @State() pageNumber = 1;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() nextButtonText: string = 'Next';\n\n @Prop() previousButtonText: string = 'Previous';\n\n @Event() articleClick?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.pageNumber = 1;\n\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController!.signal);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController.signal);\n }\n\n render() {\n return (\n <Host>\n <div class=\"row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4\">\n {this.newsResponse?.data.map(article => (\n <div class=\"col\">\n <aico-news-list-item\n article={article}\n onArticleClick={e => {\n this.articleClick?.emit(e.detail);\n }}\n />\n </div>\n ))}\n </div>\n <nav class=\"w-100\" aria-label=\"News navigation\">\n <ul class=\"pagination justify-content-center\">\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.prev ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.pageNumber > 1) {\n this.pageNumber -= 1;\n }\n\n return false;\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-left me-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\" />\n </svg>\n {this.previousButtonText}\n </li>\n {this.getViewablePages().map(page => (\n <li\n class={`page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (page !== '...') {\n this.pageNumber = Number(page);\n }\n return false;\n }}\n >\n {page}\n </li>\n ))}\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.next ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.newsResponse?.meta.page.lastPage && this.pageNumber < this.newsResponse?.meta.page.lastPage) {\n this.pageNumber += 1;\n }\n }}\n >\n {this.nextButtonText}\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-right ms-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708\" />\n </svg>\n </li>\n </ul>\n </nav>\n </Host>\n );\n }\n\n private getViewablePages(lookAhead: number = 2) {\n const pages: string[] = [];\n if (this.pageNumber - lookAhead >= 2) {\n pages.push('1');\n }\n\n if (this.pageNumber - lookAhead > 2) {\n pages.push('...');\n }\n\n for (let i = this.pageNumber - lookAhead; i < this.pageNumber; i += 1) {\n if (i >= 1) {\n pages.push(`${i}`);\n }\n }\n\n pages.push(`${this.pageNumber}`);\n for (let i = this.pageNumber + 1; i <= this.pageNumber + lookAhead; i += 1) {\n if (i <= (this.newsResponse?.meta.page.lastPage ?? 0)) {\n pages.push(`${i}`);\n }\n }\n\n if (this.pageNumber + lookAhead < (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push('...');\n }\n\n if (this.pageNumber + lookAhead <= (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push(`${this.newsResponse?.meta.page.lastPage}`);\n }\n\n return pages;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"aico-news-list.js","sourceRoot":"","sources":["../../../src/components/aico-news-list/aico-news-list.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAUtD,MAAM,OAAO,YAAY;;QACN,aAAQ,GAAG,EAAE,CAAC;;0BAIT,CAAC;;;4BAMU,EAAE;8BAEF,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itter, Host, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticles } from '../../utils/utils';\nimport { NewsResponse } from '../../model/NewsResponse';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list',\n styleUrl: 'aico-news-list.css',\n scoped: true,\n})\nexport class AicoNewsList {\n private readonly pageSize = 16;\n\n @State() newsResponse?: NewsResponse;\n\n @State() pageNumber = 1;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() newsChannels: string[] = [];\n\n @Prop() nextButtonText: string = 'Next';\n\n @Prop() previousButtonText: string = 'Previous';\n\n @Event() articleClick?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.pageNumber = 1;\n\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController!.signal, this.newsChannels);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannels);\n }\n\n render() {\n return (\n <Host>\n <div class=\"row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4\">\n {this.newsResponse?.data.map(article => (\n <div class=\"col\">\n <aico-news-list-item\n article={article}\n onArticleClick={e => {\n this.articleClick?.emit(e.detail);\n }}\n />\n </div>\n ))}\n </div>\n <nav class=\"w-100\" aria-label=\"News navigation\">\n <ul class=\"pagination justify-content-center\">\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.prev ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.pageNumber > 1) {\n this.pageNumber -= 1;\n }\n\n return false;\n }}\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-left me-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0\" />\n </svg>\n {this.previousButtonText}\n </li>\n {this.getViewablePages().map(page => (\n <li\n class={`page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (page !== '...') {\n this.pageNumber = Number(page);\n }\n return false;\n }}\n >\n {page}\n </li>\n ))}\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.next ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.newsResponse?.meta.page.lastPage && this.pageNumber < this.newsResponse?.meta.page.lastPage) {\n this.pageNumber += 1;\n }\n }}\n >\n {this.nextButtonText}\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" class=\"bi bi-chevron-right ms-1 fs-4\" style={{ width: '1em', height: '1em' }} viewBox=\"0 0 16 16\">\n <path fill-rule=\"evenodd\" d=\"M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708\" />\n </svg>\n </li>\n </ul>\n </nav>\n </Host>\n );\n }\n\n private getViewablePages(lookAhead: number = 2) {\n const pages: string[] = [];\n if (this.pageNumber - lookAhead >= 2) {\n pages.push('1');\n }\n\n if (this.pageNumber - lookAhead > 2) {\n pages.push('...');\n }\n\n for (let i = this.pageNumber - lookAhead; i < this.pageNumber; i += 1) {\n if (i >= 1) {\n pages.push(`${i}`);\n }\n }\n\n pages.push(`${this.pageNumber}`);\n for (let i = this.pageNumber + 1; i <= this.pageNumber + lookAhead; i += 1) {\n if (i <= (this.newsResponse?.meta.page.lastPage ?? 0)) {\n pages.push(`${i}`);\n }\n }\n\n if (this.pageNumber + lookAhead < (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push('...');\n }\n\n if (this.pageNumber + lookAhead <= (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push(`${this.newsResponse?.meta.page.lastPage}`);\n }\n\n return pages;\n }\n}\n"]}
|
|
@@ -8,7 +8,7 @@ export class AicoNewsListItem {
|
|
|
8
8
|
return (h("div", { class: "card h-100 pe-auto", style: { cursor: 'pointer' }, onClick: () => {
|
|
9
9
|
var _a;
|
|
10
10
|
(_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(this.article);
|
|
11
|
-
} }, h("div", { class: "ratio ratio-
|
|
11
|
+
} }, h("div", { class: "ratio ratio-16x9 overflow-hidden" }, h("img", { class: "object-fit-cover", style: { 'min-height': '15rem' }, alt: "Article image", src: (_b = (_a = this.article.attributes.optimizedListImage) !== null && _a !== void 0 ? _a : this.article.attributes.optimizedImage) !== null && _b !== void 0 ? _b : this.article.attributes.image }), h("div", { class: "card-img-overlay d-flex justify-content-end" })), h("div", { class: "card-body" }, h("h5", { class: "card-title" }, this.article.attributes.name), h("p", { class: "card-text" }, this.article.attributes.excerpt))));
|
|
12
12
|
}
|
|
13
13
|
static get is() { return "aico-news-list-item"; }
|
|
14
14
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-news-list-item.js","sourceRoot":"","sources":["../../../src/components/aico-news-list-item/aico-news-list-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,eAAe,CAAC;AAQxE,MAAM,OAAO,gBAAgB;;;;IAK3B,MAAM;;QACJ,OAAO,CACL,
|
|
1
|
+
{"version":3,"file":"aico-news-list-item.js","sourceRoot":"","sources":["../../../src/components/aico-news-list-item/aico-news-list-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,eAAe,CAAC;AAQxE,MAAM,OAAO,gBAAgB;;;;IAK3B,MAAM;;QACJ,OAAO,CACL,WAAK,KAAK,EAAC,oBAAoB,EAC3B,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAC5B,OAAO,EAAE,GAAG,EAAE;;gBACZ,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACxC,CAAC;YACH,WAAK,KAAK,EAAC,kCAAkC;gBAC3C,WACE,KAAK,EAAC,kBAAkB,EACxB,KAAK,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAChC,GAAG,EAAC,eAAe,EACnB,GAAG,EAAE,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,GAC1H;gBACF,WAAK,KAAK,EAAC,6CAA6C,GAA0C,CAC9F;YACN,WAAK,KAAK,EAAC,WAAW;gBACpB,UAAI,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAM;gBAC1D,SAAG,KAAK,EAAC,WAAW,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAK,CACtD,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list-item',\n styleUrl: 'aico-news-list-item.css',\n scoped: true,\n})\nexport class AicoNewsListItem {\n @Prop() article!: Article;\n\n @Event() articleClick?: EventEmitter<Article>;\n\n render() {\n return (\n <div class=\"card h-100 pe-auto\"\n style={{ cursor: 'pointer' }}\n onClick={() => {\n this.articleClick?.emit(this.article);\n }}>\n <div class=\"ratio ratio-16x9 overflow-hidden\">\n <img\n class=\"object-fit-cover\"\n style={{ 'min-height': '15rem' }}\n alt=\"Article image\"\n src={this.article.attributes.optimizedListImage ?? this.article.attributes.optimizedImage ?? this.article.attributes.image}\n />\n <div class=\"card-img-overlay d-flex justify-content-end\">{/*TODO: set the date top-right?*/}</div>\n </div>\n <div class=\"card-body\">\n <h5 class=\"card-title\">{this.article.attributes.name}</h5>\n <p class=\"card-text\">{this.article.attributes.excerpt}</p>\n </div>\n </div>\n );\n }\n}\n"]}
|
|
@@ -7,6 +7,7 @@ export class AicoSpecialNewsCarousel {
|
|
|
7
7
|
this.newsResponse = undefined;
|
|
8
8
|
this.aicoUrl = undefined;
|
|
9
9
|
this.aicoBearerToken = undefined;
|
|
10
|
+
this.newsChannels = [];
|
|
10
11
|
this.numberOfArticles = 6;
|
|
11
12
|
}
|
|
12
13
|
connectedCallback() {
|
|
@@ -17,11 +18,11 @@ export class AicoSpecialNewsCarousel {
|
|
|
17
18
|
this.newsListFetchController.abort('disconnected');
|
|
18
19
|
}
|
|
19
20
|
async componentWillLoad() {
|
|
20
|
-
this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal);
|
|
21
|
+
this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels);
|
|
21
22
|
}
|
|
22
23
|
async componentWillUpdate() {
|
|
23
24
|
this.newsListFetchController = new AbortController();
|
|
24
|
-
this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal);
|
|
25
|
+
this.newsResponse = await fetchSpecialNewsArticles(this.api, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels);
|
|
25
26
|
}
|
|
26
27
|
componentDidLoad() {
|
|
27
28
|
$('.carousel').slick({
|
|
@@ -92,6 +93,22 @@ export class AicoSpecialNewsCarousel {
|
|
|
92
93
|
"attribute": "aico-bearer-token",
|
|
93
94
|
"reflect": false
|
|
94
95
|
},
|
|
96
|
+
"newsChannels": {
|
|
97
|
+
"type": "unknown",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "string[]",
|
|
101
|
+
"resolved": "string[]",
|
|
102
|
+
"references": {}
|
|
103
|
+
},
|
|
104
|
+
"required": false,
|
|
105
|
+
"optional": false,
|
|
106
|
+
"docs": {
|
|
107
|
+
"tags": [],
|
|
108
|
+
"text": ""
|
|
109
|
+
},
|
|
110
|
+
"defaultValue": "[]"
|
|
111
|
+
},
|
|
95
112
|
"numberOfArticles": {
|
|
96
113
|
"type": "number",
|
|
97
114
|
"mutable": false,
|
package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-special-news-carousel.js","sourceRoot":"","sources":["../../../src/components/aico-special-news-carousel/aico-special-news-carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAI/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAOxB,MAAM,OAAO,uBAAuB;;;;;
|
|
1
|
+
{"version":3,"file":"aico-special-news-carousel.js","sourceRoot":"","sources":["../../../src/components/aico-special-news-carousel/aico-special-news-carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,KAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Prop, State, h } from '@stencil/core';\nimport type { NewsResponse } from '../../model/NewsResponse';\nimport type { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport type { Article } from '../../model/Article';\nimport { fetchSpecialNewsArticles } from '../../utils/utils';\n\nimport $ from 'jquery';\nimport 'slick-carousel';\n\n@Component({\n tag: 'aico-special-news-carousel',\n styleUrl: 'aico-special-news-carousel.css',\n scoped: true,\n})\nexport class AicoSpecialNewsCarousel {\n @State() newsResponse!: NewsResponse;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() newsChannels: string[] = [];\n\n @Prop() numberOfArticles: number = 6;\n\n @Event() articleClicked?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchSpecialNewsArticles(this.api!, 1, this.numberOfArticles, this.newsListFetchController!.signal, this.newsChannels);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchSpecialNewsArticles(this.api!, 1, this.numberOfArticles, this.newsListFetchController.signal, this.newsChannels);\n }\n\n componentDidLoad() {\n $('.carousel').slick({\n autoplay: true,\n autoplaySpeed: 6000,\n dots: true,\n arrows: false,\n pauseOnDotsHover: true,\n });\n }\n\n render() {\n return (\n <div class=\"carousel\">\n {this.newsResponse.data.map(article => {\n const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';\n const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';\n return (\n <div class=\"carousel-item card border-0\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-center text-uppercase\">\n <a\n class=\"text-reset text-decoration-none\"\n href=\"#\"\n onClick={e => {\n e.preventDefault();\n this.articleClicked?.emit(article);\n }}\n >\n {article.attributes.name}\n </a>\n </h5>\n </div>\n <div class=\"ratio ratio-16x9 mx-auto\" style={{ 'max-width': '50%' }}>\n <img\n class=\"card-img-bottom object-fit-cover\"\n style={{ 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }}\n alt=\"News Picture\"\n data-lazy={article.attributes.optimizedImage ?? article.attributes.image}\n />\n </div>\n </div>\n );\n })}\n </div>\n );\n }\n}\n"]}
|
|
@@ -2,11 +2,12 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
export class AicoAskingContent {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.content = undefined;
|
|
5
|
+
this.locale = 'de';
|
|
5
6
|
}
|
|
6
7
|
render() {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
const translation = this.content.asking.translations.
|
|
9
|
-
return (h("div", { class: "card" }, h("div", { class: "card-body" }, h("div", { class: "card-text d-block" }, h("h1", { class: "card-title" }, "Asking"), h("table", { class: "team-table" }, h("tbody", null, h("tr", { class: "agenda-event" }, h("td", null, h("h3", null, this.content.asking.startsAt.toLocaleDateString())), h("td", null, `${this.content.asking.startTime.toLocaleDateString()} - ${(
|
|
8
|
+
var _a, _b, _c;
|
|
9
|
+
const translation = (_a = this.content.asking.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
10
|
+
return (h("div", { class: "card" }, h("div", { class: "card-body" }, h("div", { class: "card-text d-block" }, h("h1", { class: "card-title" }, "Asking"), h("table", { class: "team-table" }, h("tbody", null, h("tr", { class: "agenda-event" }, h("td", null, h("h3", null, this.content.asking.startsAt.toLocaleDateString())), h("td", null, `${this.content.asking.startTime.toLocaleDateString()} - ${(_c = (_b = this.content.asking.endTime) === null || _b === void 0 ? void 0 : _b.toLocaleDateString()) !== null && _c !== void 0 ? _c : 'N/A'}`), h("td", { style: { width: '49%' } }, translation === null || translation === void 0 ? void 0 : translation.title)), h("tr", { class: "event-details" }, h("td", { colSpan: 3, style: { padding: '0' } }, h("table", { class: "more-details-table" }, h("tbody", null, h("tr", null, h("th", null, "Description"), h("td", null, this.content.asking.description)), h("tr", null, h("th", null, "Gathering"), h("td", null, this.content.asking.meetingPoint)), h("tr", null, h("th", null, "Place (Address)"), h("td", null, this.content.asking.location)), h("tr", null, h("th", null, "Asking for"), h("td", { style: { 'white-space': 'pre' } }, this.content.asking.recipents)), h("tr", null, h("th", null, "Clothing / Equipment"), h("td", { style: { 'white-space': 'pre' } }, this.content.asking.clothingEquipment)), h("tr", null, h("th", null, "Provisions"), h("td", null, this.content.asking.catering)), h("tr", null, h("th", null, "Coaching"), h("td", null, this.content.asking.coaching))))))))))));
|
|
10
11
|
}
|
|
11
12
|
static get is() { return "aico-asking-content"; }
|
|
12
13
|
static get encapsulation() { return "scoped"; }
|
|
@@ -42,6 +43,24 @@ export class AicoAskingContent {
|
|
|
42
43
|
"tags": [],
|
|
43
44
|
"text": ""
|
|
44
45
|
}
|
|
46
|
+
},
|
|
47
|
+
"locale": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"mutable": false,
|
|
50
|
+
"complexType": {
|
|
51
|
+
"original": "string",
|
|
52
|
+
"resolved": "string",
|
|
53
|
+
"references": {}
|
|
54
|
+
},
|
|
55
|
+
"required": false,
|
|
56
|
+
"optional": false,
|
|
57
|
+
"docs": {
|
|
58
|
+
"tags": [],
|
|
59
|
+
"text": ""
|
|
60
|
+
},
|
|
61
|
+
"attribute": "locale",
|
|
62
|
+
"reflect": false,
|
|
63
|
+
"defaultValue": "'de'"
|
|
45
64
|
}
|
|
46
65
|
};
|
|
47
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-asking-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-asking-content/aico-asking-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQnD,MAAM,OAAO,iBAAiB
|
|
1
|
+
{"version":3,"file":"aico-asking-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-asking-content/aico-asking-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQnD,MAAM,OAAO,iBAAiB;;;sBAEH,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAErH,OAAO,CACL,WAAK,KAAK,EAAC,MAAM;YACf,WAAK,KAAK,EAAC,WAAW;gBACpB,WAAK,KAAK,EAAC,mBAAmB;oBAC5B,UAAI,KAAK,EAAC,YAAY,aAAY;oBAClC,aAAO,KAAK,EAAC,YAAY;wBACvB;4BACE,UAAI,KAAK,EAAC,cAAc;gCACtB;oCACE,cAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAM,CACzD;gCACL,cAAK,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,kBAAkB,EAAE,MAAM,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,0CAAE,kBAAkB,EAAE,mCAAI,KAAK,EAAE,CAAM;gCAClI,UAAI,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,CAAM,CACnD;4BACL,UAAI,KAAK,EAAC,eAAe;gCACvB,UAAI,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;oCACrC,aAAO,KAAK,EAAC,oBAAoB;wCAC/B;4CACE;gDACE,4BAAoB;gDACpB,cAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAM,CACvC;4CAEL;gDACE,0BAAkB;gDAClB,cAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAM,CACxC;4CAEL;gDACE,gCAAwB;gDACxB,cAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAM,CACpC;4CAEL;gDACE,2BAAmB;gDACnB,UAAI,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,IAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAM,CACtE;4CAEL;gDACE,qCAA6B;gDAC7B,UAAI,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,IAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAM,CAC9E;4CAEL;gDACE,2BAAmB;gDACnB,cAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAM,CACpC;4CAEL;gDACE,yBAAiB;gDACjB,cAAK,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAM,CACpC,CACC,CACF,CACL,CACF,CACC,CACF,CACJ,CACF,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { AskingContent } from '../../../model/article/content/AskingContent';\n\n@Component({\n tag: 'aico-asking-content',\n styleUrl: 'aico-asking-content.css',\n scoped: true,\n})\nexport class AicoAskingContent {\n @Prop() content!: AskingContent;\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.asking.translations.find(translation => translation.locale === this.locale) ?? null;\n\n return (\n <div class=\"card\">\n <div class=\"card-body\">\n <div class=\"card-text d-block\">\n <h1 class=\"card-title\">Asking</h1>\n <table class=\"team-table\">\n <tbody>\n <tr class=\"agenda-event\">\n <td>\n <h3>{this.content.asking.startsAt.toLocaleDateString()}</h3>\n </td>\n <td>{`${this.content.asking.startTime.toLocaleDateString()} - ${this.content.asking.endTime?.toLocaleDateString() ?? 'N/A'}`}</td>\n <td style={{ width: '49%' }}>{translation?.title}</td>\n </tr>\n <tr class=\"event-details\">\n <td colSpan={3} style={{ padding: '0' }}>\n <table class=\"more-details-table\">\n <tbody>\n <tr>\n <th>Description</th>\n <td>{this.content.asking.description}</td>\n </tr>\n\n <tr>\n <th>Gathering</th>\n <td>{this.content.asking.meetingPoint}</td>\n </tr>\n\n <tr>\n <th>Place (Address)</th>\n <td>{this.content.asking.location}</td>\n </tr>\n\n <tr>\n <th>Asking for</th>\n <td style={{ 'white-space': 'pre' }}>{this.content.asking.recipents}</td>\n </tr>\n\n <tr>\n <th>Clothing / Equipment</th>\n <td style={{ 'white-space': 'pre' }}>{this.content.asking.clothingEquipment}</td>\n </tr>\n\n <tr>\n <th>Provisions</th>\n <td>{this.content.asking.catering}</td>\n </tr>\n\n <tr>\n <th>Coaching</th>\n <td>{this.content.asking.coaching}</td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n );\n }\n}\n"]}
|
package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js
CHANGED
|
@@ -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(),
|
|
@@ -18,6 +19,21 @@ export const Example = {
|
|
|
18
19
|
createdAt: new Date(),
|
|
19
20
|
updatedAt: new Date(),
|
|
20
21
|
title: 'Asking title',
|
|
22
|
+
locale: 'de'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: 1234,
|
|
26
|
+
createdAt: new Date(),
|
|
27
|
+
updatedAt: new Date(),
|
|
28
|
+
title: 'Asking title en',
|
|
29
|
+
locale: 'en'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 1234,
|
|
33
|
+
createdAt: new Date(),
|
|
34
|
+
updatedAt: new Date(),
|
|
35
|
+
title: 'Asking title ru',
|
|
36
|
+
locale: 'ru'
|
|
21
37
|
},
|
|
22
38
|
],
|
|
23
39
|
startsAt: new Date(),
|
package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-asking-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-asking-content/aico-asking-content.stories.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAAS;IACjB,SAAS,EAAE,qBAAqB;CACjC,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,MAAM,EAAE;gBACN,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,KAAK,EAAE,cAAc;
|
|
1
|
+
{"version":3,"file":"aico-asking-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-asking-content/aico-asking-content.stories.ts"],"names":[],"mappings":"AAGA,MAAM,IAAI,GAAS;IACjB,SAAS,EAAE,qBAAqB;CACjC,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,MAAM,EAAE;gBACN,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,KAAK,EAAE,cAAc;wBACrB,MAAM,EAAE,IAAI;qBACb;oBACD;wBACE,EAAE,EAAE,IAAI;wBACR,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,KAAK,EAAE,iBAAiB;wBACxB,MAAM,EAAE,IAAI;qBACb;oBACD;wBACE,EAAE,EAAE,IAAI;wBACR,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,KAAK,EAAE,iBAAiB;wBACxB,MAAM,EAAE,IAAI;qBACb;iBACF;gBACD,QAAQ,EAAE,IAAI,IAAI,EAAE;gBACpB,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,OAAO,EAAE,IAAI,IAAI,EAAE;gBACnB,WAAW,EAAE,aAAa;gBAC1B,YAAY,EAAE,eAAe;gBAC7B,QAAQ,EAAE,UAAU;gBACpB,SAAS,EAAE,WAAW;gBACtB,iBAAiB,EAAE,oBAAoB;gBACvC,QAAQ,EAAE,UAAU;gBACpB,QAAQ,EAAE,UAAU;aACrB;SACe;KACnB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { AskingContent } from '../../../model/article/content/AskingContent';\n\nconst meta: Meta = {\n component: 'aico-asking-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 asking: {\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: 'Asking title',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Asking title en',\n locale: 'en'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Asking title ru',\n locale: 'ru'\n },\n ],\n startsAt: new Date(),\n startTime: new Date(),\n endTime: new Date(),\n description: 'Description',\n meetingPoint: 'Meeting point',\n location: 'Location',\n recipents: 'Recipents',\n clothingEquipment: 'Clothing equipment',\n catering: 'Catering',\n coaching: 'Coaching',\n },\n } as AskingContent,\n },\n};\n"]}
|
package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js
CHANGED
|
@@ -3,9 +3,11 @@ import ConditionalRender from "../../../utils/ConditionalRender";
|
|
|
3
3
|
export class AicoBlockQuoteContent {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.content = undefined;
|
|
6
|
+
this.locale = 'de';
|
|
6
7
|
}
|
|
7
8
|
render() {
|
|
8
|
-
|
|
9
|
+
var _a;
|
|
10
|
+
const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
9
11
|
return (h(ConditionalRender, { condition: translation !== null }, h("blockquote", { class: "blockquote", style: { 'background-color': this.content.quotesColor } }, h("p", { class: "mb-2", style: { color: this.content.textColor } }, translation.quoteText), h("footer", { class: "blockquote-footer ms-2", style: { color: this.content.authorColor } }, translation.quoteAuthorLine))));
|
|
10
12
|
}
|
|
11
13
|
static get is() { return "aico-block-quote-content"; }
|
|
@@ -42,6 +44,24 @@ export class AicoBlockQuoteContent {
|
|
|
42
44
|
"tags": [],
|
|
43
45
|
"text": ""
|
|
44
46
|
}
|
|
47
|
+
},
|
|
48
|
+
"locale": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"mutable": false,
|
|
51
|
+
"complexType": {
|
|
52
|
+
"original": "string",
|
|
53
|
+
"resolved": "string",
|
|
54
|
+
"references": {}
|
|
55
|
+
},
|
|
56
|
+
"required": false,
|
|
57
|
+
"optional": false,
|
|
58
|
+
"docs": {
|
|
59
|
+
"tags": [],
|
|
60
|
+
"text": ""
|
|
61
|
+
},
|
|
62
|
+
"attribute": "locale",
|
|
63
|
+
"reflect": false,
|
|
64
|
+
"defaultValue": "'de'"
|
|
45
65
|
}
|
|
46
66
|
};
|
|
47
67
|
}
|
package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-block-quote-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-block-quote-content/aico-block-quote-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MAAM,OAAO,qBAAqB
|
|
1
|
+
{"version":3,"file":"aico-block-quote-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-block-quote-content/aico-block-quote-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MAAM,OAAO,qBAAqB;;;sBAEP,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;QAG9G,OAAO,CACL,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI;YAChD,kBAAY,KAAK,EAAC,YAAY,EAAC,KAAK,EAAE,EAAE,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;gBACpF,SAAG,KAAK,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IACrD,WAAY,CAAC,SAAS,CACrB;gBACJ,cAAQ,KAAK,EAAC,wBAAwB,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,IAC9E,WAAY,CAAC,eAAe,CACtB,CACE,CACK,CACrB,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport type { BlockQuoteContent } from '../../../model/article/content/BlockQuoteContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-block-quote-content',\n styleUrl: 'aico-block-quote-content.css',\n scoped: true,\n})\nexport class AicoBlockQuoteContent {\n @Prop() content!: BlockQuoteContent;\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n\n\n return (\n <ConditionalRender condition={translation !== null}>\n <blockquote class=\"blockquote\" style={{ 'background-color': this.content.quotesColor }}>\n <p class=\"mb-2\" style={{ color: this.content.textColor }}>\n {translation!.quoteText}\n </p>\n <footer class=\"blockquote-footer ms-2\" style={{ color: this.content.authorColor }}>\n {translation!.quoteAuthorLine}\n </footer>\n </blockquote>\n </ConditionalRender>\n );\n }\n}\n"]}
|