@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 @@ 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,23 @@ export const Example = {
|
|
|
15
16
|
updatedAt: new Date(),
|
|
16
17
|
quoteText: 'foo bar baz',
|
|
17
18
|
quoteAuthorLine: 'John Doe',
|
|
19
|
+
locale: 'de'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 1234,
|
|
23
|
+
createdAt: new Date(),
|
|
24
|
+
updatedAt: new Date(),
|
|
25
|
+
quoteText: 'foo bar baz en',
|
|
26
|
+
quoteAuthorLine: 'John Doe en',
|
|
27
|
+
locale: 'en'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 1234,
|
|
31
|
+
createdAt: new Date(),
|
|
32
|
+
updatedAt: new Date(),
|
|
33
|
+
quoteText: 'foo bar baz ru',
|
|
34
|
+
quoteAuthorLine: 'John Doe ru',
|
|
35
|
+
locale: 'ru'
|
|
18
36
|
},
|
|
19
37
|
],
|
|
20
38
|
quotesColor: 'gray',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-block-quote-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-block-quote-content/aico-block-quote-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAoC;IAC5C,SAAS,EAAE,0BAA0B;CACtC,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,SAAS,EAAE,aAAa;oBACxB,eAAe,EAAE,UAAU;
|
|
1
|
+
{"version":3,"file":"aico-block-quote-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-block-quote-content/aico-block-quote-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAoC;IAC5C,SAAS,EAAE,0BAA0B;CACtC,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,SAAS,EAAE,aAAa;oBACxB,eAAe,EAAE,UAAU;oBAC3B,MAAM,EAAE,IAAI;iBACb;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,gBAAgB;oBAC3B,eAAe,EAAE,aAAa;oBAC9B,MAAM,EAAE,IAAI;iBACb;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,gBAAgB;oBAC3B,eAAe,EAAE,aAAa;oBAC9B,MAAM,EAAE,IAAI;iBACb;aACF;YACD,WAAW,EAAE,MAAM;YACnB,SAAS,EAAE,KAAK;YAChB,WAAW,EAAE,MAAM;SACC;KACvB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { BlockQuoteContent } from '../../../model/article/content/BlockQuoteContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoBlockQuoteContent> = {\n component: 'aico-block-quote-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 quoteText: 'foo bar baz',\n quoteAuthorLine: 'John Doe',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n quoteText: 'foo bar baz en',\n quoteAuthorLine: 'John Doe en',\n locale: 'en'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n quoteText: 'foo bar baz ru',\n quoteAuthorLine: 'John Doe ru',\n locale: 'ru'\n },\n ],\n quotesColor: 'gray',\n textColor: 'red',\n authorColor: 'pink',\n } as BlockQuoteContent,\n },\n};\n"]}
|
|
@@ -4,9 +4,11 @@ import ConditionalRender from "../../../utils/ConditionalRender";
|
|
|
4
4
|
export class AicoBulletContent {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.content = undefined;
|
|
7
|
+
this.locale = 'de';
|
|
7
8
|
}
|
|
8
9
|
render() {
|
|
9
|
-
|
|
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 styles = new Map();
|
|
11
13
|
if (this.content.fontSize) {
|
|
12
14
|
styles.set('font-size', this.content.fontSize);
|
|
@@ -14,17 +16,17 @@ export class AicoBulletContent {
|
|
|
14
16
|
if (this.content.fontFamily) {
|
|
15
17
|
styles.set('font-family', this.content.fontFamily);
|
|
16
18
|
}
|
|
17
|
-
return (h("div", { class: "content", style: Object.fromEntries(styles) }, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { content: this.makeTitleContent(translation) })), h("ul", null, this.content.bulletBullets
|
|
19
|
+
return (h("div", { class: "content", style: Object.fromEntries(styles) }, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { content: this.makeTitleContent(translation), locale: this.locale })), h("ul", null, this.content.bulletBullets
|
|
18
20
|
.sort((a, b) => { var _a, _b; return ((_a = a.sort) !== null && _a !== void 0 ? _a : 0) - ((_b = b.sort) !== null && _b !== void 0 ? _b : 0); })
|
|
19
21
|
.map(bullet => {
|
|
20
22
|
if (bullet.translations.length === 0) {
|
|
21
23
|
return null;
|
|
22
24
|
}
|
|
23
|
-
const translation = bullet.translations
|
|
24
|
-
if (strIsNullOrEmptyOrWhitespace(translation.text)) {
|
|
25
|
+
const translation = bullet.translations.find(translation => translation.locale === this.locale);
|
|
26
|
+
if (strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.text)) {
|
|
25
27
|
return null;
|
|
26
28
|
}
|
|
27
|
-
return h("li", null, translation.text);
|
|
29
|
+
return h("li", null, translation === null || translation === void 0 ? void 0 : translation.text);
|
|
28
30
|
}))));
|
|
29
31
|
}
|
|
30
32
|
makeTitleContent(translation) {
|
|
@@ -72,6 +74,24 @@ export class AicoBulletContent {
|
|
|
72
74
|
"tags": [],
|
|
73
75
|
"text": ""
|
|
74
76
|
}
|
|
77
|
+
},
|
|
78
|
+
"locale": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"mutable": false,
|
|
81
|
+
"complexType": {
|
|
82
|
+
"original": "string",
|
|
83
|
+
"resolved": "string",
|
|
84
|
+
"references": {}
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"optional": false,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": ""
|
|
91
|
+
},
|
|
92
|
+
"attribute": "locale",
|
|
93
|
+
"reflect": false,
|
|
94
|
+
"defaultValue": "'de'"
|
|
75
95
|
}
|
|
76
96
|
};
|
|
77
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-bullet-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-bullet-content/aico-bullet-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAGpE,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MAAM,OAAO,iBAAiB
|
|
1
|
+
{"version":3,"file":"aico-bullet-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-bullet-content/aico-bullet-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAGpE,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MAAM,OAAO,iBAAiB;;;sBAEH,IAAI;;IAE7B,MAAM;;QAEJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAE9G,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;QACzC,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;YACzB,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;SAChD;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YAC3B,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,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ACpB,IAAI,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,IAAI;YACpC,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport type { BulletContent } from '../../../model/article/content/BulletContent';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-bullet-content',\n styleUrl: 'aico-bullet-content.css',\n scoped: true,\n})\nexport class AicoBulletContent {\n @Prop() content!: BulletContent;\n @Prop() locale: string = 'de';\n\n render() {\n\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n\n const styles = new Map<string, string>();\n if (this.content.fontSize) {\n styles.set('font-size', this.content.fontSize);\n }\n\n if (this.content.fontFamily) {\n styles.set('font-family', this.content.fontFamily);\n }\n\n return (\n <div class=\"content\" style={Object.fromEntries(styles)}>\n <ConditionalRender condition={translation !== null}>\n <aico-title-content content={this.makeTitleContent(translation!)} locale={this.locale} />\n </ConditionalRender>\n <ul>\n {this.content.bulletBullets\n .sort((a, b) => (a.sort ?? 0) - (b.sort ?? 0))\n .map(bullet => {\n if (bullet.translations.length === 0) {\n return null;\n }\n\n const translation = bullet.translations.find(translation => translation.locale === this.locale);\n if (strIsNullOrEmptyOrWhitespace(translation?.text)) {\n return null;\n }\n\n return <li>{translation?.text}</li>;\n })}\n </ul>\n </div>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: this.content.titleSize ?? 'h1',\n translations: [{ ...translation }],\n };\n }\n}\n"]}
|
package/dist/collection/components/content/aico-bullet-content/aico-bullet-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(),
|
|
@@ -17,6 +18,13 @@ export const Example = {
|
|
|
17
18
|
locale: 'en-GB',
|
|
18
19
|
title: 'Bullet list title',
|
|
19
20
|
},
|
|
21
|
+
{
|
|
22
|
+
id: 1234,
|
|
23
|
+
createdAt: new Date(),
|
|
24
|
+
updatedAt: new Date(),
|
|
25
|
+
locale: 'de',
|
|
26
|
+
title: 'Bullet list title de',
|
|
27
|
+
},
|
|
20
28
|
],
|
|
21
29
|
bulletBullets: [
|
|
22
30
|
{
|
|
@@ -32,6 +40,13 @@ export const Example = {
|
|
|
32
40
|
locale: 'en-GB',
|
|
33
41
|
text: 'bar',
|
|
34
42
|
},
|
|
43
|
+
{
|
|
44
|
+
id: 1234,
|
|
45
|
+
createdAt: new Date(),
|
|
46
|
+
updatedAt: new Date(),
|
|
47
|
+
locale: 'de',
|
|
48
|
+
text: 'bar de',
|
|
49
|
+
},
|
|
35
50
|
],
|
|
36
51
|
},
|
|
37
52
|
{
|
|
@@ -47,6 +62,13 @@ export const Example = {
|
|
|
47
62
|
locale: 'en-GB',
|
|
48
63
|
text: 'foo',
|
|
49
64
|
},
|
|
65
|
+
{
|
|
66
|
+
id: 1234,
|
|
67
|
+
createdAt: new Date(),
|
|
68
|
+
updatedAt: new Date(),
|
|
69
|
+
locale: 'de',
|
|
70
|
+
text: 'foo de',
|
|
71
|
+
},
|
|
50
72
|
],
|
|
51
73
|
},
|
|
52
74
|
{
|
|
@@ -62,6 +84,13 @@ export const Example = {
|
|
|
62
84
|
locale: 'en-GB',
|
|
63
85
|
text: 'baz',
|
|
64
86
|
},
|
|
87
|
+
{
|
|
88
|
+
id: 1234,
|
|
89
|
+
createdAt: new Date(),
|
|
90
|
+
updatedAt: new Date(),
|
|
91
|
+
locale: 'de',
|
|
92
|
+
text: 'baz de',
|
|
93
|
+
},
|
|
65
94
|
],
|
|
66
95
|
},
|
|
67
96
|
],
|
package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-bullet-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-bullet-content/aico-bullet-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAgC;IACxC,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,SAAS,EAAE,IAAI;YACf,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,mBAAmB;iBAC3B;aACF;YACD,aAAa,EAAE;gBACb;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,IAAI,EAAE,CAAC;oBACP,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,IAAI,EAAE,KAAK;yBACZ;qBACF;iBACF;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,IAAI,EAAE,CAAC;oBACP,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,IAAI,EAAE,KAAK;yBACZ;qBACF;iBACF;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,IAAI,EAAE,CAAC;oBACP,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,IAAI,EAAE,KAAK;yBACZ;qBACF;iBACF;aACF;SACe;KACnB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { BulletContent } from '../../../model/article/content/BulletContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoBulletContent> = {\n component: 'aico-bullet-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 titleSize: 'h2',\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'Bullet list title',\n },\n ],\n bulletBullets: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n sort: 2,\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n text: 'bar',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n sort: 1,\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n text: 'foo',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n sort: 3,\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n text: 'baz',\n },\n ],\n },\n ],\n } as BulletContent,\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"aico-bullet-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-bullet-content/aico-bullet-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAgC;IACxC,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,SAAS,EAAE,IAAI;YACf,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,mBAAmB;iBAC3B;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,IAAI;oBACZ,KAAK,EAAE,sBAAsB;iBAC9B;aACF;YACD,aAAa,EAAE;gBACb;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,IAAI,EAAE,CAAC;oBACP,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,IAAI,EAAE,KAAK;yBACZ;wBACD;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,IAAI;4BACZ,IAAI,EAAE,QAAQ;yBACf;qBACF;iBACF;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,IAAI,EAAE,CAAC;oBACP,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,IAAI,EAAE,KAAK;yBACZ;wBACD;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,IAAI;4BACZ,IAAI,EAAE,QAAQ;yBACf;qBACF;iBACF;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,IAAI,EAAE,CAAC;oBACP,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,IAAI,EAAE,KAAK;yBACZ;wBACD;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,IAAI;4BACZ,IAAI,EAAE,QAAQ;yBACf;qBACF;iBACF;aACF;SACe;KACnB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { BulletContent } from '../../../model/article/content/BulletContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoBulletContent> = {\n component: 'aico-bullet-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 titleSize: 'h2',\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'Bullet list title',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n title: 'Bullet list title de',\n },\n ],\n bulletBullets: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n sort: 2,\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n text: 'bar',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n text: 'bar de',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n sort: 1,\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n text: 'foo',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n text: 'foo de',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n sort: 3,\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n text: 'baz',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n text: 'baz de',\n },\n ],\n },\n ],\n } as BulletContent,\n },\n};\n"]}
|
|
@@ -7,6 +7,7 @@ export class AicoCarouselContent {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
this.content = undefined;
|
|
9
9
|
this.hasArrows = true;
|
|
10
|
+
this.locale = 'de';
|
|
10
11
|
}
|
|
11
12
|
componentDidLoad() {
|
|
12
13
|
$('.carousel').slick({
|
|
@@ -19,11 +20,14 @@ export class AicoCarouselContent {
|
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
render() {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
var _a;
|
|
24
|
+
const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
25
|
+
return (h(Host, null, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { content: this.makeTitleContent(translation), locale: this.locale })), h("div", { class: "carousel" }, this.content.contentCarouselImages
|
|
24
26
|
.sort((a, b) => a.order - b.order)
|
|
25
27
|
.map(content => {
|
|
26
|
-
|
|
28
|
+
var _a;
|
|
29
|
+
const translation = (_a = content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
30
|
+
return (h("div", { class: "carousel-item card text-bg-dark text-white" }, h("div", { class: "ratio ratio-16x9 mx-auto", style: { 'max-width': '50%' } }, h("img", { class: "card-img d-block object-fit-cover", alt: "Carousel Picture", "data-lazy": translation === null || translation === void 0 ? void 0 : translation.picture })), h(ConditionalRender, { condition: content.translations.length > 0 && !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.title) }, h("div", { class: "card-img-overlay d-flex align-items-end" }, h("h5", { class: "card-title text-uppercase" }, translation === null || translation === void 0 ? void 0 : translation.title)))));
|
|
27
31
|
}))));
|
|
28
32
|
}
|
|
29
33
|
makeTitleContent(translation) {
|
|
@@ -88,6 +92,24 @@ export class AicoCarouselContent {
|
|
|
88
92
|
"attribute": "has-arrows",
|
|
89
93
|
"reflect": false,
|
|
90
94
|
"defaultValue": "true"
|
|
95
|
+
},
|
|
96
|
+
"locale": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "string",
|
|
101
|
+
"resolved": "string",
|
|
102
|
+
"references": {}
|
|
103
|
+
},
|
|
104
|
+
"required": false,
|
|
105
|
+
"optional": false,
|
|
106
|
+
"docs": {
|
|
107
|
+
"tags": [],
|
|
108
|
+
"text": ""
|
|
109
|
+
},
|
|
110
|
+
"attribute": "locale",
|
|
111
|
+
"reflect": false,
|
|
112
|
+
"defaultValue": "'de'"
|
|
91
113
|
}
|
|
92
114
|
};
|
|
93
115
|
}
|
package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-carousel-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-carousel-content/aico-carousel-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAIpE,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAOxB,MAAM,OAAO,mBAAmB;;;yBAGD,IAAI;;
|
|
1
|
+
{"version":3,"file":"aico-carousel-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-carousel-content/aico-carousel-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAIpE,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAOxB,MAAM,OAAO,mBAAmB;;;yBAGD,IAAI;sBAER,IAAI;;IAE7B,gBAAgB;QACd,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;YACnB,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,IAAI;YACnB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI,CAAC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AAK,KAAK,EAAC,yCAAyC;4BAClD,UAAI,KAAK,EAAC,2BAA2B,IAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,CAAM,CAC3D,CACY,CAChB,CACP,CAAC;YACJ,CAAC,CAAC,CACA,CACD,CACR,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,IAAI;YACV,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport { CarouselContent } from '../../../model/article/content/CarouselContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport { Translation } from '../../../model/article/Translation';\nimport { TitleContent } from '../../../model/article/content/TitleContent';\n\nimport $ from 'jquery';\nimport 'slick-carousel';\n\n@Component({\n tag: 'aico-carousel-content',\n styleUrl: 'aico-carousel-content.css',\n scoped: true,\n})\nexport class AicoCarouselContent {\n @Prop() content!: CarouselContent;\n\n @Prop() hasArrows: boolean = true;\n\n @Prop() locale: string = 'de';\n\n componentDidLoad() {\n $('.carousel').slick({\n autoplay: true,\n autoplaySpeed: 6000,\n fade: true,\n dots: true,\n arrows: this.hasArrows,\n pauseOnDotsHover: true,\n });\n }\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n return (\n <Host>\n <ConditionalRender condition={translation !== null}>\n <aico-title-content content={this.makeTitleContent(translation!)} locale={this.locale} />\n </ConditionalRender>\n <div class=\"carousel\">\n {this.content.contentCarouselImages\n .sort((a, b) => a.order - b.order)\n .map(content => {\n const translation = content.translations.find(translation => translation.locale === this.locale) ?? null;\n\n return (\n <div class=\"carousel-item card text-bg-dark text-white\">\n <div class=\"ratio ratio-16x9 mx-auto\" style={{ 'max-width': '50%' }}>\n <img class=\"card-img d-block object-fit-cover\" alt=\"Carousel Picture\" data-lazy={translation?.picture} />\n </div>\n <ConditionalRender condition={content.translations.length > 0 && !strIsNullOrEmptyOrWhitespace(translation?.title)}>\n <div class=\"card-img-overlay d-flex align-items-end\">\n <h5 class=\"card-title text-uppercase\">{translation?.title}</h5>\n </div>\n </ConditionalRender>\n </div>\n );\n })}\n </div>\n </Host>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: 'h2',\n translations: [{ ...translation }],\n };\n }\n}\n"]}
|
package/dist/collection/components/content/aico-carousel-content/aico-carousel-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(),
|
|
@@ -16,6 +17,13 @@ export const Example = {
|
|
|
16
17
|
locale: 'en-GB',
|
|
17
18
|
title: 'Carusel title',
|
|
18
19
|
},
|
|
20
|
+
{
|
|
21
|
+
id: 1234,
|
|
22
|
+
createdAt: new Date(),
|
|
23
|
+
updatedAt: new Date(),
|
|
24
|
+
locale: 'de',
|
|
25
|
+
title: 'Carusel title de',
|
|
26
|
+
},
|
|
19
27
|
],
|
|
20
28
|
contentCarouselImages: [
|
|
21
29
|
{
|
|
@@ -23,7 +31,6 @@ export const Example = {
|
|
|
23
31
|
createdAt: new Date(),
|
|
24
32
|
updatedAt: new Date(),
|
|
25
33
|
order: 2,
|
|
26
|
-
picture: 'https://source.unsplash.com/random/320x240',
|
|
27
34
|
translations: [
|
|
28
35
|
{
|
|
29
36
|
id: 1234,
|
|
@@ -31,6 +38,15 @@ export const Example = {
|
|
|
31
38
|
updatedAt: new Date(),
|
|
32
39
|
locale: 'en-GB',
|
|
33
40
|
title: 'bar',
|
|
41
|
+
picture: 'https://source.unsplash.com/random/320x240',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 1234,
|
|
45
|
+
createdAt: new Date(),
|
|
46
|
+
updatedAt: new Date(),
|
|
47
|
+
locale: 'de',
|
|
48
|
+
title: 'bar de',
|
|
49
|
+
picture: 'https://source.unsplash.com/random/320x240',
|
|
34
50
|
},
|
|
35
51
|
],
|
|
36
52
|
},
|
|
@@ -39,7 +55,6 @@ export const Example = {
|
|
|
39
55
|
createdAt: new Date(),
|
|
40
56
|
updatedAt: new Date(),
|
|
41
57
|
order: 1,
|
|
42
|
-
picture: 'https://source.unsplash.com/random/320x240',
|
|
43
58
|
translations: [
|
|
44
59
|
{
|
|
45
60
|
id: 1234,
|
|
@@ -47,6 +62,15 @@ export const Example = {
|
|
|
47
62
|
updatedAt: new Date(),
|
|
48
63
|
locale: 'en-GB',
|
|
49
64
|
title: 'foo',
|
|
65
|
+
picture: 'https://source.unsplash.com/random/320x240',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 1234,
|
|
69
|
+
createdAt: new Date(),
|
|
70
|
+
updatedAt: new Date(),
|
|
71
|
+
locale: 'de',
|
|
72
|
+
title: 'foo de',
|
|
73
|
+
picture: 'https://source.unsplash.com/random/320x240',
|
|
50
74
|
},
|
|
51
75
|
],
|
|
52
76
|
},
|
|
@@ -55,7 +79,6 @@ export const Example = {
|
|
|
55
79
|
createdAt: new Date(),
|
|
56
80
|
updatedAt: new Date(),
|
|
57
81
|
order: 3,
|
|
58
|
-
picture: 'https://source.unsplash.com/random/320x240',
|
|
59
82
|
translations: [
|
|
60
83
|
{
|
|
61
84
|
id: 1234,
|
|
@@ -63,6 +86,15 @@ export const Example = {
|
|
|
63
86
|
updatedAt: new Date(),
|
|
64
87
|
locale: 'en-GB',
|
|
65
88
|
title: 'baz',
|
|
89
|
+
picture: 'https://source.unsplash.com/random/320x240',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 1234,
|
|
93
|
+
createdAt: new Date(),
|
|
94
|
+
updatedAt: new Date(),
|
|
95
|
+
locale: 'de',
|
|
96
|
+
title: 'baz de',
|
|
97
|
+
picture: 'https://source.unsplash.com/random/320x240',
|
|
66
98
|
},
|
|
67
99
|
],
|
|
68
100
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-carousel-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-carousel-content/aico-carousel-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAkC;IAC1C,SAAS,EAAE,uBAAuB;CACnC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,MAAM,EAAE,OAAO;oBACf,KAAK,EAAE,eAAe;iBACvB;aACF;YACD,qBAAqB,EAAE;gBACrB;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,CAAC;oBACR,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"aico-carousel-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-carousel-content/aico-carousel-content.stories.ts"],"names":[],"mappings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EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,CAAC;oBACR,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,KAAK,EAAE,KAAK;4BACZ,OAAO,EAAE,4CAA4C;yBACtD;wBACD;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,IAAI;4BACZ,KAAK,EAAE,QAAQ;4BACf,OAAO,EAAE,4CAA4C;yBACtD;qBACF;iBACF;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,CAAC;oBACR,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,KAAK,EAAE,KAAK;4BACZ,OAAO,EAAE,4CAA4C;yBACtD;wBACD;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,IAAI;4BACZ,KAAK,EAAE,QAAQ;4BACf,OAAO,EAAE,4CAA4C;yBACtD;qBACF;iBACF;aACF;SACiB;KACrB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { CarouselContent } from '../../../model/article/content/CarouselContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoCarouselContent> = {\n component: 'aico-carousel-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'Carusel title',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n title: 'Carusel title de',\n },\n ],\n contentCarouselImages: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n order: 2,\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'bar',\n picture: 'https://source.unsplash.com/random/320x240',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n title: 'bar de',\n picture: 'https://source.unsplash.com/random/320x240',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n order: 1,\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'foo',\n picture: 'https://source.unsplash.com/random/320x240',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n title: 'foo de',\n picture: 'https://source.unsplash.com/random/320x240',\n },\n ],\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n order: 3,\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n title: 'baz',\n picture: 'https://source.unsplash.com/random/320x240',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n title: 'baz de',\n picture: 'https://source.unsplash.com/random/320x240',\n },\n ],\n },\n ],\n } as CarouselContent,\n },\n};\n"]}
|
package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js
CHANGED
|
@@ -4,11 +4,12 @@ import ConditionalRender from "../../../utils/ConditionalRender";
|
|
|
4
4
|
export class AicoContentCardContent {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.content = undefined;
|
|
7
|
+
this.locale = 'de';
|
|
7
8
|
}
|
|
8
9
|
render() {
|
|
9
|
-
var _a;
|
|
10
|
-
const translation = this.content.translations.
|
|
11
|
-
return (h("div", { class: "card", style: { width: '18rem' } }, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.picture) }, h("img", { class: "card-img-top", alt: "Card picture", src: this.content.picture })), h("div", { class: "card-body" }, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.title) }, h("aico-title-content", { class: "card-title", content: this.makeTitleContent(translation) })), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.link) }, h("a", { class: "card-link", href: this.content.link, target: "_blank" }, (
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
12
|
+
return (h("div", { class: "card", style: { width: '18rem' } }, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.picture) }, h("img", { class: "card-img-top", alt: "Card picture", src: this.content.picture })), h("div", { class: "card-body" }, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.title) }, h("aico-title-content", { class: "card-title", content: this.makeTitleContent(translation), locale: this.locale })), h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.link) }, h("a", { class: "card-link", href: this.content.link, target: "_blank" }, (_b = translation === null || translation === void 0 ? void 0 : translation.linkText) !== null && _b !== void 0 ? _b : 'link')))));
|
|
12
13
|
}
|
|
13
14
|
makeTitleContent(translation) {
|
|
14
15
|
var _a;
|
|
@@ -55,6 +56,24 @@ export class AicoContentCardContent {
|
|
|
55
56
|
"tags": [],
|
|
56
57
|
"text": ""
|
|
57
58
|
}
|
|
59
|
+
},
|
|
60
|
+
"locale": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"mutable": false,
|
|
63
|
+
"complexType": {
|
|
64
|
+
"original": "string",
|
|
65
|
+
"resolved": "string",
|
|
66
|
+
"references": {}
|
|
67
|
+
},
|
|
68
|
+
"required": false,
|
|
69
|
+
"optional": false,
|
|
70
|
+
"docs": {
|
|
71
|
+
"tags": [],
|
|
72
|
+
"text": ""
|
|
73
|
+
},
|
|
74
|
+
"attribute": "locale",
|
|
75
|
+
"reflect": false,
|
|
76
|
+
"defaultValue": "'de'"
|
|
58
77
|
}
|
|
59
78
|
};
|
|
60
79
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-content-card-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-content-card-content/aico-content-card-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAUjE,MAAM,OAAO,sBAAsB
|
|
1
|
+
{"version":3,"file":"aico-content-card-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-content-card-content/aico-content-card-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAUjE,MAAM,OAAO,sBAAsB;;;sBAGR,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,WAAK,KAAK,EAAC,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,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":["import { Component, Prop, h } from '@stencil/core';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport type { CardContent } from '../../../model/article/content/CardContent';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\n\n@Component({\n tag: 'aico-content-card-content',\n styleUrl: 'aico-content-card-content.css',\n scoped: true,\n})\nexport class AicoContentCardContent {\n @Prop() content!: CardContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n return (\n <div class=\"card\" style={{ width: '18rem' }}>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(this.content.picture)}>\n <img class=\"card-img-top\" alt=\"Card picture\" src={this.content.picture} />\n </ConditionalRender>\n <div class=\"card-body\">\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.title)}>\n <aico-title-content class=\"card-title\" content={this.makeTitleContent(translation!)} locale={this.locale} />\n </ConditionalRender>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(this.content.link)}>\n <a class=\"card-link\" href={this.content.link} target=\"_blank\">\n {translation?.linkText ?? 'link'}\n </a>\n </ConditionalRender>\n </div>\n </div>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: this.content.titleSize ?? 'h1',\n translations: [{ ...translation }],\n };\n }\n}\n"]}
|
|
@@ -4,6 +4,7 @@ const meta = {
|
|
|
4
4
|
export default meta;
|
|
5
5
|
export const Example = {
|
|
6
6
|
args: {
|
|
7
|
+
locale: 'de',
|
|
7
8
|
content: {
|
|
8
9
|
id: 1234,
|
|
9
10
|
createdAt: new Date(),
|
|
@@ -15,6 +16,15 @@ export const Example = {
|
|
|
15
16
|
updatedAt: new Date(),
|
|
16
17
|
title: 'Card content',
|
|
17
18
|
linkText: 'hehe',
|
|
19
|
+
locale: 'en-GB'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 1234,
|
|
23
|
+
createdAt: new Date(),
|
|
24
|
+
updatedAt: new Date(),
|
|
25
|
+
title: 'Card content de',
|
|
26
|
+
linkText: 'hehe de',
|
|
27
|
+
locale: 'de'
|
|
18
28
|
},
|
|
19
29
|
],
|
|
20
30
|
picture: 'https://source.unsplash.com/random/320x240',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-content-card-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-content-card-content/aico-content-card-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAqC;IAC7C,SAAS,EAAE,2BAA2B;CACvC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,cAAc;oBACrB,QAAQ,EAAE,MAAM;
|
|
1
|
+
{"version":3,"file":"aico-content-card-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-content-card-content/aico-content-card-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAqC;IAC7C,SAAS,EAAE,2BAA2B;CACvC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,cAAc;oBACrB,QAAQ,EAAE,MAAM;oBAChB,MAAM,EAAE,OAAO;iBAChB;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,iBAAiB;oBACxB,QAAQ,EAAE,SAAS;oBACnB,MAAM,EAAE,IAAI;iBACb;aACF;YACD,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE,6CAA6C;YACnD,SAAS,EAAE,IAAI;SACD;KACjB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { CardContent } from '../../../model/article/content/CardContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoContentCardContent> = {\n component: 'aico-content-card-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Card content',\n linkText: 'hehe',\n locale: 'en-GB'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Card content de',\n linkText: 'hehe de',\n locale: 'de'\n },\n ],\n picture: 'https://source.unsplash.com/random/320x240',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n titleSize: 'h2',\n } as CardContent,\n },\n};\n"]}
|
|
@@ -2,9 +2,11 @@ import { Host, h } from "@stencil/core";
|
|
|
2
2
|
export class AicoDividerContent {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.content = undefined;
|
|
5
|
+
this.locale = 'de';
|
|
5
6
|
}
|
|
6
7
|
render() {
|
|
7
|
-
|
|
8
|
+
var _a;
|
|
9
|
+
const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
8
10
|
const isOnlyMargin = translation ? translation.isOnlyMargin : this.content.isOnlyMargin;
|
|
9
11
|
return h(Host, null, isOnlyMargin ? h("div", { style: { 'padding-top': '40px' } }) : h("hr", { style: { margin: '5px' } }));
|
|
10
12
|
}
|
|
@@ -42,6 +44,24 @@ export class AicoDividerContent {
|
|
|
42
44
|
"tags": [],
|
|
43
45
|
"text": ""
|
|
44
46
|
}
|
|
47
|
+
},
|
|
48
|
+
"locale": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"mutable": false,
|
|
51
|
+
"complexType": {
|
|
52
|
+
"original": "string",
|
|
53
|
+
"resolved": "string",
|
|
54
|
+
"references": {}
|
|
55
|
+
},
|
|
56
|
+
"required": false,
|
|
57
|
+
"optional": false,
|
|
58
|
+
"docs": {
|
|
59
|
+
"tags": [],
|
|
60
|
+
"text": ""
|
|
61
|
+
},
|
|
62
|
+
"attribute": "locale",
|
|
63
|
+
"reflect": false,
|
|
64
|
+
"defaultValue": "'de'"
|
|
45
65
|
}
|
|
46
66
|
};
|
|
47
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-divider-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-divider-content/aico-divider-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQzD,MAAM,OAAO,kBAAkB
|
|
1
|
+
{"version":3,"file":"aico-divider-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-divider-content/aico-divider-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAQzD,MAAM,OAAO,kBAAkB;;;sBAGJ,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC9G,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QACxF,OAAO,EAAC,IAAI,QAAE,YAAY,CAAC,CAAC,CAAC,WAAK,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,GAAI,CAAC,CAAC,CAAC,UAAI,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAI,CAAQ,CAAC;IACpH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport type { DividerContent } from '../../../model/article/content/DividerContent';\n\n@Component({\n tag: 'aico-divider-content',\n styleUrl: 'aico-divider-content.css',\n scoped: true,\n})\nexport class AicoDividerContent {\n @Prop() content!: DividerContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const isOnlyMargin = translation ? translation.isOnlyMargin : this.content.isOnlyMargin;\n return <Host>{isOnlyMargin ? <div style={{ 'padding-top': '40px' }} /> : <hr style={{ margin: '5px' }} />}</Host>;\n }\n}\n"]}
|
package/dist/collection/components/content/aico-divider-content/aico-divider-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(),
|
|
@@ -14,6 +15,14 @@ export const Example = {
|
|
|
14
15
|
createdAt: new Date(),
|
|
15
16
|
updatedAt: new Date(),
|
|
16
17
|
isOnlyMargin: false,
|
|
18
|
+
locale: 'en-GB'
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: 1234,
|
|
22
|
+
createdAt: new Date(),
|
|
23
|
+
updatedAt: new Date(),
|
|
24
|
+
isOnlyMargin: true,
|
|
25
|
+
locale: 'de'
|
|
17
26
|
},
|
|
18
27
|
],
|
|
19
28
|
isOnlyMargin: false,
|
package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-divider-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-divider-content/aico-divider-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAiC;IACzC,SAAS,EAAE,sBAAsB;CAClC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"aico-divider-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-divider-content/aico-divider-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAiC;IACzC,SAAS,EAAE,sBAAsB;CAClC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE,KAAK;oBACnB,MAAM,EAAE,OAAO;iBAChB;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE,IAAI;oBAClB,MAAM,EAAE,IAAI;iBACb;aACF;YACD,YAAY,EAAE,KAAK;SACF;KACpB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { DividerContent } from '../../../model/article/content/DividerContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoDividerContent> = {\n component: 'aico-divider-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n isOnlyMargin: false,\n locale: 'en-GB'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n isOnlyMargin: true,\n locale: 'de'\n },\n ],\n isOnlyMargin: false,\n } as DividerContent,\n },\n};\n"]}
|