@aiconomy/aico-components 0.0.53 → 0.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -57
- 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-a58972e9.entry.js → p-368503ee.entry.js} +3 -3
- package/dist/aico-components/p-368503ee.entry.js.map +1 -0
- package/dist/aico-components/{p-b78d7799.entry.js → p-68930822.entry.js} +2 -2
- 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-1a6625c0.entry.js → p-90c2d3dc.entry.js} +2 -2
- 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-ae20e789.js +3 -0
- package/dist/aico-components/{p-2aae1a0e.js.map → p-ae20e789.js.map} +1 -1
- 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 +78 -57
- package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-article-detail.cjs.entry.js +19 -18
- package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-asking-list-content.cjs.entry.js +1 -1
- package/dist/cjs/aico-collection-content.cjs.entry.js +1 -1
- package/dist/cjs/aico-components.cjs.js +2 -2
- package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +12 -3
- package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-news-list-item.cjs.entry.js +6 -3
- package/dist/cjs/aico-news-list-item.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-news-list.cjs.entry.js +9 -8
- package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-no-content_2.cjs.entry.js +6 -4
- package/dist/cjs/aico-no-content_2.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-special-news-carousel.cjs.entry.js +5 -4
- package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-75c0e002.js → index-e52034b7.js} +1 -6
- package/dist/cjs/index-e52034b7.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{utils-406a9df3.js → utils-c1b7a052.js} +20 -5
- package/dist/cjs/utils-c1b7a052.js.map +1 -0
- package/dist/collection/collection-manifest.json +0 -1
- 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 +49 -5
- package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -1
- package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.stories.js +6 -0
- package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.stories.js.map +1 -1
- package/dist/collection/components/aico-news-list/aico-news-list.css +0 -113
- package/dist/collection/components/aico-news-list/aico-news-list.js +23 -6
- package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -1
- package/dist/collection/components/aico-news-list/aico-news-list.stories.js +3 -0
- package/dist/collection/components/aico-news-list/aico-news-list.stories.js.map +1 -1
- package/dist/collection/components/aico-news-list-item/aico-news-list-item.js +6 -3
- 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 +27 -11
- 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 +18 -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 +14 -3
- 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 +5 -2
- package/dist/components/aico-news-list-item2.js.map +1 -1
- package/dist/components/aico-news-list.js +9 -7
- 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 +5 -3
- 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 +10 -13
- 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 +19 -5
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/aico-album-content_19.entry.js +78 -57
- package/dist/esm/aico-album-content_19.entry.js.map +1 -1
- package/dist/esm/aico-article-detail.entry.js +19 -18
- package/dist/esm/aico-article-detail.entry.js.map +1 -1
- package/dist/esm/aico-asking-list-content.entry.js +1 -1
- package/dist/esm/aico-collection-content.entry.js +1 -1
- package/dist/esm/aico-components.js +3 -3
- package/dist/esm/aico-fetch-article-detail.entry.js +12 -3
- package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -1
- package/dist/esm/aico-news-list-item.entry.js +6 -3
- package/dist/esm/aico-news-list-item.entry.js.map +1 -1
- package/dist/esm/aico-news-list.entry.js +9 -8
- package/dist/esm/aico-news-list.entry.js.map +1 -1
- package/dist/esm/aico-no-content_2.entry.js +6 -4
- package/dist/esm/aico-no-content_2.entry.js.map +1 -1
- package/dist/esm/aico-special-news-carousel.entry.js +5 -4
- package/dist/esm/aico-special-news-carousel.entry.js.map +1 -1
- package/dist/esm/{index-f9f11572.js → index-4621a8ba.js} +2 -6
- package/dist/esm/index-4621a8ba.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-2b7ec879.js → utils-b4eec8e9.js} +20 -6
- 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 +15 -1
- package/dist/types/components/aico-news-list/aico-news-list.d.ts +2 -1
- package/dist/types/components/aico-news-list/aico-news-list.stories.d.ts +2 -1
- package/dist/types/components/aico-news-list-item/aico-news-list-item.d.ts +1 -1
- 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 +62 -19
- package/dist/types/model/article/content/CarouselContent.d.ts +4 -2
- package/dist/types/utils/utils.d.ts +3 -2
- package/package.json +3 -2
- package/dist/aico-components/p-2aae1a0e.js +0 -3
- package/dist/aico-components/p-31666f10.js +0 -2
- package/dist/aico-components/p-31666f10.js.map +0 -1
- package/dist/aico-components/p-42b98baf.entry.js +0 -2
- package/dist/aico-components/p-42b98baf.entry.js.map +0 -1
- package/dist/aico-components/p-54708dd0.entry.js +0 -2
- package/dist/aico-components/p-54708dd0.entry.js.map +0 -1
- package/dist/aico-components/p-776352ba.entry.js +0 -2
- package/dist/aico-components/p-776352ba.entry.js.map +0 -1
- package/dist/aico-components/p-7c05cd02.entry.js +0 -2
- package/dist/aico-components/p-7c05cd02.entry.js.map +0 -1
- package/dist/aico-components/p-83655dd4.entry.js +0 -2
- package/dist/aico-components/p-83655dd4.entry.js.map +0 -1
- package/dist/aico-components/p-a58972e9.entry.js.map +0 -1
- package/dist/aico-components/p-b0325a83.entry.js +0 -2
- package/dist/aico-components/p-b0325a83.entry.js.map +0 -1
- package/dist/aico-components/p-c99617a8.entry.js +0 -2
- package/dist/aico-components/p-c99617a8.entry.js.map +0 -1
- package/dist/cjs/bootstrap-slick-test.cjs.entry.js +0 -38
- package/dist/cjs/bootstrap-slick-test.cjs.entry.js.map +0 -1
- package/dist/cjs/index-75c0e002.js.map +0 -1
- package/dist/cjs/utils-406a9df3.js.map +0 -1
- package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.css +0 -6
- package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.js +0 -37
- package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.js.map +0 -1
- package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.stories.js +0 -6
- package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.stories.js.map +0 -1
- package/dist/collection/components/content/content-styles.css +0 -113
- package/dist/components/bootstrap-slick-test.d.ts +0 -11
- package/dist/components/bootstrap-slick-test.js +0 -51
- package/dist/components/bootstrap-slick-test.js.map +0 -1
- package/dist/esm/bootstrap-slick-test.entry.js +0 -34
- package/dist/esm/bootstrap-slick-test.entry.js.map +0 -1
- package/dist/esm/index-f9f11572.js.map +0 -1
- package/dist/esm/utils-2b7ec879.js.map +0 -1
- package/dist/types/components/bootstrap-slick-test/bootstrap-slick-test.d.ts +0 -5
- package/dist/types/components/bootstrap-slick-test/bootstrap-slick-test.stories.d.ts +0 -5
- /package/dist/aico-components/{p-b78d7799.entry.js.map → p-68930822.entry.js.map} +0 -0
- /package/dist/aico-components/{p-1a6625c0.entry.js.map → p-90c2d3dc.entry.js.map} +0 -0
|
@@ -4,6 +4,7 @@ const meta = {
|
|
|
4
4
|
export default meta;
|
|
5
5
|
export const Example = {
|
|
6
6
|
args: {
|
|
7
|
+
locale: 'de',
|
|
7
8
|
content: {
|
|
8
9
|
createdAt: new Date(),
|
|
9
10
|
updatedAt: new Date(),
|
|
@@ -21,6 +22,14 @@ export const Example = {
|
|
|
21
22
|
question: 'Foo?',
|
|
22
23
|
answer: 'Foo!',
|
|
23
24
|
},
|
|
25
|
+
{
|
|
26
|
+
id: 1234,
|
|
27
|
+
createdAt: new Date(),
|
|
28
|
+
updatedAt: new Date(),
|
|
29
|
+
locale: 'de',
|
|
30
|
+
question: 'Foo de?',
|
|
31
|
+
answer: 'Foo de!',
|
|
32
|
+
},
|
|
24
33
|
],
|
|
25
34
|
},
|
|
26
35
|
{
|
|
@@ -36,6 +45,14 @@ export const Example = {
|
|
|
36
45
|
question: 'Bar?',
|
|
37
46
|
answer: 'Bar!',
|
|
38
47
|
},
|
|
48
|
+
{
|
|
49
|
+
id: 1234,
|
|
50
|
+
createdAt: new Date(),
|
|
51
|
+
updatedAt: new Date(),
|
|
52
|
+
locale: 'de',
|
|
53
|
+
question: 'Bar de?',
|
|
54
|
+
answer: 'Bar de!',
|
|
55
|
+
},
|
|
39
56
|
],
|
|
40
57
|
},
|
|
41
58
|
{
|
|
@@ -51,6 +68,14 @@ export const Example = {
|
|
|
51
68
|
question: 'Baz?',
|
|
52
69
|
answer: 'Baz!',
|
|
53
70
|
},
|
|
71
|
+
{
|
|
72
|
+
id: 1234,
|
|
73
|
+
createdAt: new Date(),
|
|
74
|
+
updatedAt: new Date(),
|
|
75
|
+
locale: 'de',
|
|
76
|
+
question: 'Baz de?',
|
|
77
|
+
answer: 'Baz de!',
|
|
78
|
+
},
|
|
54
79
|
],
|
|
55
80
|
},
|
|
56
81
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-faq-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-faq-content/aico-faq-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA6B;IACrC,SAAS,EAAE,kBAAkB;CAC9B,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,QAAQ,EAAE;gBACR;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,QAAQ,EAAE,MAAM;4BAChB,MAAM,EAAE,MAAM;yBACf;qBACF;iBACF;gBAED;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,QAAQ,EAAE,MAAM;4BAChB,MAAM,EAAE,MAAM;yBACf;qBACF;iBACF;gBAED;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,QAAQ,EAAE,MAAM;4BAChB,MAAM,EAAE,MAAM;yBACf;qBACF;iBACF;aACF;SACY;KAChB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { FaqContent } from '../../../model/article/content/FaqContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoFaqContent> = {\n component: 'aico-faq-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n content: {\n createdAt: new Date(),\n updatedAt: new Date(),\n faqItems: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n question: 'Foo?',\n answer: 'Foo!',\n },\n ],\n },\n\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n question: 'Bar?',\n answer: 'Bar!',\n },\n ],\n },\n\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n question: 'Baz?',\n answer: 'Baz!',\n },\n ],\n },\n ],\n } as FaqContent,\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"aico-faq-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-faq-content/aico-faq-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA6B;IACrC,SAAS,EAAE,kBAAkB;CAC9B,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,QAAQ,EAAE;gBACR;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,QAAQ,EAAE,MAAM;4BAChB,MAAM,EAAE,MAAM;yBACf;wBACD;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,IAAI;4BACZ,QAAQ,EAAE,SAAS;4BACnB,MAAM,EAAE,SAAS;yBAClB;qBACF;iBACF;gBAED;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,QAAQ,EAAE,MAAM;4BAChB,MAAM,EAAE,MAAM;yBACf;wBACD;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,IAAI;4BACZ,QAAQ,EAAE,SAAS;4BACnB,MAAM,EAAE,SAAS;yBAClB;qBACF;iBACF;gBAED;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,YAAY,EAAE;wBACZ;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,OAAO;4BACf,QAAQ,EAAE,MAAM;4BAChB,MAAM,EAAE,MAAM;yBACf;wBACD;4BACE,EAAE,EAAE,IAAI;4BACR,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,SAAS,EAAE,IAAI,IAAI,EAAE;4BACrB,MAAM,EAAE,IAAI;4BACZ,QAAQ,EAAE,SAAS;4BACnB,MAAM,EAAE,SAAS;yBAClB;qBACF;iBACF;aACF;SACY;KAChB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { FaqContent } from '../../../model/article/content/FaqContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoFaqContent> = {\n component: 'aico-faq-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n createdAt: new Date(),\n updatedAt: new Date(),\n faqItems: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n question: 'Foo?',\n answer: 'Foo!',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n question: 'Foo de?',\n answer: 'Foo de!',\n },\n ],\n },\n\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n question: 'Bar?',\n answer: 'Bar!',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n question: 'Bar de?',\n answer: 'Bar de!',\n },\n ],\n },\n\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n question: 'Baz?',\n answer: 'Baz!',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n question: 'Baz de?',\n answer: 'Baz de!',\n },\n ],\n },\n ],\n } as FaqContent,\n },\n};\n"]}
|
|
@@ -4,9 +4,11 @@ import { strIsNullOrEmptyOrWhitespace } from "../../../utils/utils";
|
|
|
4
4
|
export class AicoHeadingContent {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.content = undefined;
|
|
7
|
+
this.locale = 'de';
|
|
7
8
|
}
|
|
8
9
|
render() {
|
|
9
|
-
|
|
10
|
+
var _a;
|
|
11
|
+
const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
10
12
|
const contentStyle = { 'justify-content': this.content.isTextAtMiddleOfImage ? 'center' : 'flex-end' };
|
|
11
13
|
if (!strIsNullOrEmptyOrWhitespace(this.content.picture)) {
|
|
12
14
|
contentStyle['min-height'] = this.content.isImageHeightHalfSize ? '400px' : '600px';
|
|
@@ -26,7 +28,7 @@ export class AicoHeadingContent {
|
|
|
26
28
|
if (!strIsNullOrEmptyOrWhitespace(this.content.textColor)) {
|
|
27
29
|
descriptionStyle['color'] = this.content.textColor;
|
|
28
30
|
}
|
|
29
|
-
return (h("div", { class: this.content.isHeadingAlignedWithText ? 'content content-align-with-text' : 'content', style: contentStyle }, h(ConditionalRender, { condition: translation !== null }, h("div", { class: "title-wrapper", style: titleWrapperStyle }, h("aico-title-content", { content: this.makeTitleContent(translation) })), h("span", { class: "description", style: descriptionStyle }, translation.description))));
|
|
31
|
+
return (h("div", { class: this.content.isHeadingAlignedWithText ? 'content content-align-with-text' : 'content', style: contentStyle }, h(ConditionalRender, { condition: translation !== null }, h("div", { class: "title-wrapper", style: titleWrapperStyle }, h("aico-title-content", { content: this.makeTitleContent(translation), locale: this.locale })), h("span", { class: "description", style: descriptionStyle }, translation.description))));
|
|
30
32
|
}
|
|
31
33
|
makeTitleContent(translation) {
|
|
32
34
|
var _a;
|
|
@@ -74,6 +76,24 @@ export class AicoHeadingContent {
|
|
|
74
76
|
"tags": [],
|
|
75
77
|
"text": ""
|
|
76
78
|
}
|
|
79
|
+
},
|
|
80
|
+
"locale": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"mutable": false,
|
|
83
|
+
"complexType": {
|
|
84
|
+
"original": "string",
|
|
85
|
+
"resolved": "string",
|
|
86
|
+
"references": {}
|
|
87
|
+
},
|
|
88
|
+
"required": false,
|
|
89
|
+
"optional": false,
|
|
90
|
+
"docs": {
|
|
91
|
+
"tags": [],
|
|
92
|
+
"text": ""
|
|
93
|
+
},
|
|
94
|
+
"attribute": "locale",
|
|
95
|
+
"reflect": false,
|
|
96
|
+
"defaultValue": "'de'"
|
|
77
97
|
}
|
|
78
98
|
};
|
|
79
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-heading-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-heading-content/aico-heading-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAUpE,MAAM,OAAO,kBAAkB
|
|
1
|
+
{"version":3,"file":"aico-heading-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-heading-content/aico-heading-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAUpE,MAAM,OAAO,kBAAkB;;;sBAGJ,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC9G,MAAM,YAAY,GAA0C,EAAE,iBAAiB,EAAE,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QAC9I,IAAI,CAAC,4BAA4B,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;YACvD,YAAY,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;YACpF,YAAY,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;YACxF,YAAY,CAAC,kBAAkB,CAAC,GAAG,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,CAAC;YAClE,YAAY,CAAC,mBAAmB,CAAC,GAAG,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C/C,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YACnB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,IAAI;YACpC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YAClC,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport type { HeadingContent } from '../../../model/article/content/HeadingContent';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\n\n@Component({\n tag: 'aico-heading-content',\n styleUrl: 'aico-heading-content.css',\n scoped: true,\n})\nexport class AicoHeadingContent {\n @Prop() content!: HeadingContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const contentStyle: { [key: string]: string | undefined } = { 'justify-content': this.content.isTextAtMiddleOfImage ? 'center' : 'flex-end' };\n if (!strIsNullOrEmptyOrWhitespace(this.content.picture)) {\n contentStyle['min-height'] = this.content.isImageHeightHalfSize ? '400px' : '600px';\n contentStyle['background-size'] = this.content.isImageHeightHalfSize ? '100%' : 'cover';\n contentStyle['background-image'] = `url(${this.content.picture})`;\n contentStyle['background-repeat'] = 'no-repeat';\n contentStyle['background-position'] = 'center';\n }\n\n const titleWrapperStyle: { [key: string]: string | undefined } = { 'background-color': this.content.textBackgroundColor };\n if (this.content.fontSize) {\n titleWrapperStyle['font-size'] = `${this.content.fontSize}px`;\n }\n\n if (!strIsNullOrEmptyOrWhitespace(this.content.fontFamily)) {\n titleWrapperStyle['font-family'] = this.content.fontFamily;\n }\n\n const descriptionStyle: { [key: string]: string | undefined } = { 'background-color': this.content.textBackgroundColor };\n if (!strIsNullOrEmptyOrWhitespace(this.content.textColor)) {\n descriptionStyle['color'] = this.content.textColor;\n }\n\n return (\n <div class={this.content.isHeadingAlignedWithText ? 'content content-align-with-text' : 'content'} style={contentStyle}>\n <ConditionalRender condition={translation !== null}>\n <div class=\"title-wrapper\" style={titleWrapperStyle}>\n <aico-title-content content={this.makeTitleContent(translation!)} locale={this.locale} />\n </div>\n <span class=\"description\" style={descriptionStyle}>\n {translation!.description}\n </span>\n </ConditionalRender>\n </div>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: this.content.titleSize ?? 'h1',\n titleColor: this.content.textColor,\n translations: [{ ...translation }],\n };\n }\n}\n"]}
|
package/dist/collection/components/content/aico-heading-content/aico-heading-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(),
|
|
@@ -15,6 +16,15 @@ export const Example = {
|
|
|
15
16
|
updatedAt: new Date(),
|
|
16
17
|
title: 'Heading title',
|
|
17
18
|
description: 'Heading description',
|
|
19
|
+
locale: 'de',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 1234,
|
|
23
|
+
createdAt: new Date(),
|
|
24
|
+
updatedAt: new Date(),
|
|
25
|
+
title: 'Heading title en',
|
|
26
|
+
description: 'Heading description en',
|
|
27
|
+
locale: 'en',
|
|
18
28
|
},
|
|
19
29
|
],
|
|
20
30
|
textColor: 'red',
|
package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-heading-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-heading-content/aico-heading-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAiC;IACzC,SAAS,EAAE,sBAAsB;CAClC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,eAAe;oBACtB,WAAW,EAAE,qBAAqB;
|
|
1
|
+
{"version":3,"file":"aico-heading-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-heading-content/aico-heading-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAAiC;IACzC,SAAS,EAAE,sBAAsB;CAClC,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,eAAe;oBACtB,WAAW,EAAE,qBAAqB;oBAClC,MAAM,EAAE,IAAI;iBACb;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,kBAAkB;oBACzB,WAAW,EAAE,wBAAwB;oBACrC,MAAM,EAAE,IAAI;iBACb;aACF;YACD,SAAS,EAAE,KAAK;YAChB,mBAAmB,EAAE,MAAM;YAC3B,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,4CAA4C;YACrD,QAAQ,EAAE,EAAE;YACZ,wBAAwB,EAAE,IAAI;YAC9B,qBAAqB,EAAE,IAAI;YAC3B,qBAAqB,EAAE,IAAI;SACV;KACpB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { HeadingContent } from '../../../model/article/content/HeadingContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoHeadingContent> = {\n component: 'aico-heading-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const Example: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Heading title',\n description: 'Heading description',\n locale: 'de',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Heading title en',\n description: 'Heading description en',\n locale: 'en',\n },\n ],\n textColor: 'red',\n textBackgroundColor: 'gray',\n titleSize: 'h2',\n picture: 'https://source.unsplash.com/random/320x240',\n fontSize: 69,\n isHeadingAlignedWithText: true,\n isTextAtMiddleOfImage: true,\n isImageHeightHalfSize: true,\n } as HeadingContent,\n },\n};\n"]}
|
|
@@ -4,12 +4,12 @@ import { strIsNullOrEmptyOrWhitespace } from "../../../utils/utils";
|
|
|
4
4
|
export class AicoHtmlContent {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.content = undefined;
|
|
7
|
+
this.locale = 'de';
|
|
7
8
|
}
|
|
8
9
|
render() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
return (h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(this.content.translations[0].text) }, h("div", { innerHTML: this.content.translations[0].text })));
|
|
10
|
+
var _a;
|
|
11
|
+
const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
12
|
+
return (h(ConditionalRender, { condition: translation !== null && !strIsNullOrEmptyOrWhitespace(translation.text) }, h("div", { innerHTML: translation.text })));
|
|
13
13
|
}
|
|
14
14
|
static get is() { return "aico-html-content"; }
|
|
15
15
|
static get encapsulation() { return "scoped"; }
|
|
@@ -45,6 +45,24 @@ export class AicoHtmlContent {
|
|
|
45
45
|
"tags": [],
|
|
46
46
|
"text": ""
|
|
47
47
|
}
|
|
48
|
+
},
|
|
49
|
+
"locale": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"mutable": false,
|
|
52
|
+
"complexType": {
|
|
53
|
+
"original": "string",
|
|
54
|
+
"resolved": "string",
|
|
55
|
+
"references": {}
|
|
56
|
+
},
|
|
57
|
+
"required": false,
|
|
58
|
+
"optional": false,
|
|
59
|
+
"docs": {
|
|
60
|
+
"tags": [],
|
|
61
|
+
"text": ""
|
|
62
|
+
},
|
|
63
|
+
"attribute": "locale",
|
|
64
|
+
"reflect": false,
|
|
65
|
+
"defaultValue": "'de'"
|
|
48
66
|
}
|
|
49
67
|
};
|
|
50
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-html-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-html-content/aico-html-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAOpE,MAAM,OAAO,eAAe
|
|
1
|
+
{"version":3,"file":"aico-html-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-html-content/aico-html-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAOpE,MAAM,OAAO,eAAe;;;sBAGD,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAC9G,OAAO,CACL,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,IAAI,CAAC;YACnG,WAAK,SAAS,EAAE,WAAY,CAAC,IAAK,GAAI,CACpB,CACrB,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport { HtmlContent } from '../../../model/article/content/HtmlContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\n\n@Component({\n tag: 'aico-html-content',\n styleUrl: 'aico-html-content.css',\n scoped: true,\n})\nexport class AicoHtmlContent {\n @Prop() content!: HtmlContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n return (\n <ConditionalRender condition={translation !== null && !strIsNullOrEmptyOrWhitespace(translation.text)}>\n <div innerHTML={translation!.text!} />\n </ConditionalRender>\n );\n }\n}\n"]}
|
|
@@ -4,10 +4,11 @@ import { getImageWidthPrc, strIsNullOrEmptyOrWhitespace } from "../../../utils/u
|
|
|
4
4
|
export class AicoLinkContent {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.content = undefined;
|
|
7
|
+
this.locale = 'de';
|
|
7
8
|
}
|
|
8
9
|
render() {
|
|
9
|
-
var _a, _b;
|
|
10
|
-
const translation = this.content.translations.
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
11
12
|
const buttonLinkStyle = {};
|
|
12
13
|
if (this.content.textButtonColor) {
|
|
13
14
|
buttonLinkStyle['color'] = this.content.textButtonColor;
|
|
@@ -25,7 +26,7 @@ export class AicoLinkContent {
|
|
|
25
26
|
buttonLinkStyle['--hover-button-color'] = this.content.hoverColor;
|
|
26
27
|
}
|
|
27
28
|
return (h(Host, null, h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.title) }, h("label", null, translation === null || translation === void 0 ? void 0 :
|
|
28
|
-
translation.title, ": ")), h(ConditionalRender, { condition: this.content.isImageLink !== undefined && this.content.isImageLink }, h("div", { class: "image-link-wrapper", style: { 'justify-content': this.content.picturePosition } }, h("a", { href: (
|
|
29
|
+
translation.title, ": ")), h(ConditionalRender, { condition: this.content.isImageLink !== undefined && this.content.isImageLink }, h("div", { class: "image-link-wrapper", style: { 'justify-content': this.content.picturePosition } }, h("a", { href: (_b = translation === null || translation === void 0 ? void 0 : translation.link) !== null && _b !== void 0 ? _b : '#', target: "_blank", class: "image-link", style: { width: this.content.isImageFullSize ? '100%' : getImageWidthPrc(this.content.pictureSize) } }, h("img", { src: translation === null || translation === void 0 ? void 0 : translation.imageUrl })))), h(ConditionalRender, { condition: this.content.isImageLink === null || !this.content.isImageLink }, h("a", { href: (_c = translation === null || translation === void 0 ? void 0 : translation.link) !== null && _c !== void 0 ? _c : '#', target: "_blank", class: this.content.isButtonLink ? 'button-link' : '', style: buttonLinkStyle }, h("span", { class: "arrow-button" }, " \u2192")))));
|
|
29
30
|
}
|
|
30
31
|
static get is() { return "aico-link-content"; }
|
|
31
32
|
static get encapsulation() { return "scoped"; }
|
|
@@ -61,6 +62,24 @@ export class AicoLinkContent {
|
|
|
61
62
|
"tags": [],
|
|
62
63
|
"text": ""
|
|
63
64
|
}
|
|
65
|
+
},
|
|
66
|
+
"locale": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"mutable": false,
|
|
69
|
+
"complexType": {
|
|
70
|
+
"original": "string",
|
|
71
|
+
"resolved": "string",
|
|
72
|
+
"references": {}
|
|
73
|
+
},
|
|
74
|
+
"required": false,
|
|
75
|
+
"optional": false,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": ""
|
|
79
|
+
},
|
|
80
|
+
"attribute": "locale",
|
|
81
|
+
"reflect": false,
|
|
82
|
+
"defaultValue": "'de'"
|
|
64
83
|
}
|
|
65
84
|
};
|
|
66
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-link-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-link-content/aico-link-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAQtF,MAAM,OAAO,eAAe
|
|
1
|
+
{"version":3,"file":"aico-link-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-link-content/aico-link-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAQtF,MAAM,OAAO,eAAe;;;sBAGD,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAA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iB,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;oBACxF,SACE,IAAI,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,mCAAI,GAAG,EAC9B,MAAM,EAAC,QAAQ,EACf,KAAK,EAAC,YAAY,EAClB,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;wBAEpG,WAAK,GAAG,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,GAAI,CACjC,CACA,CACY;YACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW;gBAC1F,SAAG,IAAI,EAAE,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAAI,mCAAI,GAAG,EAAE,MAAM,EAAC,QAAQ,EAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,eAAe;oBAC9H,YAAM,KAAK,EAAC,cAAc,cAAgB,CACxC,CACc,CACf,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\nimport ConditionalRender from '../../../utils/ConditionalRender';\nimport { getImageWidthPrc, strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport type { LinkContent } from '../../../model/article/content/LinkContent';\n\n@Component({\n tag: 'aico-link-content',\n styleUrl: 'aico-link-content.css',\n scoped: true,\n})\nexport class AicoLinkContent {\n @Prop() content!: LinkContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n const buttonLinkStyle: { [key: string]: string | undefined } = {};\n if (this.content.textButtonColor) {\n buttonLinkStyle['color'] = this.content.textButtonColor;\n }\n\n if (this.content.textButtonColor) {\n buttonLinkStyle['background-color'] = this.content.textButtonColor;\n }\n\n if (this.content.fontSize) {\n buttonLinkStyle['font-size'] = `${this.content.fontSize}px`;\n }\n\n if (this.content.fontFamily) {\n buttonLinkStyle['font-family'] = this.content.fontFamily;\n }\n\n if (this.content.hoverColor) {\n buttonLinkStyle['--hover-button-color'] = this.content.hoverColor;\n }\n\n return (\n <Host>\n <ConditionalRender condition={!strIsNullOrEmptyOrWhitespace(translation?.title)}>\n <label>{translation?.title}: </label>\n </ConditionalRender>\n <ConditionalRender condition={this.content.isImageLink !== undefined && this.content.isImageLink}>\n <div class=\"image-link-wrapper\" style={{ 'justify-content': this.content.picturePosition }}>\n <a\n href={translation?.link ?? '#'}\n target=\"_blank\"\n class=\"image-link\"\n style={{ width: this.content.isImageFullSize ? '100%' : getImageWidthPrc(this.content.pictureSize) }}\n >\n <img src={translation?.imageUrl} />\n </a>\n </div>\n </ConditionalRender>\n <ConditionalRender condition={this.content.isImageLink === null || !this.content.isImageLink}>\n <a href={translation?.link ?? '#'} target=\"_blank\" class={this.content.isButtonLink ? 'button-link' : ''} style={buttonLinkStyle}>\n <span class=\"arrow-button\"> →</span>\n </a>\n </ConditionalRender>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -4,6 +4,7 @@ const meta = {
|
|
|
4
4
|
export default meta;
|
|
5
5
|
export const ImageLink = {
|
|
6
6
|
args: {
|
|
7
|
+
locale: 'de',
|
|
7
8
|
content: {
|
|
8
9
|
id: 1234,
|
|
9
10
|
createdAt: new Date(),
|
|
@@ -17,6 +18,17 @@ export const ImageLink = {
|
|
|
17
18
|
link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
|
|
18
19
|
linkText: 'Rick :)',
|
|
19
20
|
imageUrl: 'https://source.unsplash.com/random/320x240',
|
|
21
|
+
locale: 'de'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 1234,
|
|
25
|
+
createdAt: new Date(),
|
|
26
|
+
updatedAt: new Date(),
|
|
27
|
+
title: 'Link title en',
|
|
28
|
+
link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
|
|
29
|
+
linkText: 'Rick :)',
|
|
30
|
+
imageUrl: 'https://source.unsplash.com/random/320x240',
|
|
31
|
+
locale: 'en'
|
|
20
32
|
},
|
|
21
33
|
],
|
|
22
34
|
pictureSize: 'medium',
|
|
@@ -31,6 +43,7 @@ export const ImageLink = {
|
|
|
31
43
|
};
|
|
32
44
|
export const ButtonLink = {
|
|
33
45
|
args: {
|
|
46
|
+
locale: 'de',
|
|
34
47
|
content: {
|
|
35
48
|
id: 1234,
|
|
36
49
|
createdAt: new Date(),
|
|
@@ -44,6 +57,17 @@ export const ButtonLink = {
|
|
|
44
57
|
link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
|
|
45
58
|
linkText: 'Rick :)',
|
|
46
59
|
imageUrl: 'https://source.unsplash.com/random/320x240',
|
|
60
|
+
locale: 'de'
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 1234,
|
|
64
|
+
createdAt: new Date(),
|
|
65
|
+
updatedAt: new Date(),
|
|
66
|
+
title: 'Link title en',
|
|
67
|
+
link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',
|
|
68
|
+
linkText: 'Rick :)',
|
|
69
|
+
imageUrl: 'https://source.unsplash.com/random/320x240',
|
|
70
|
+
locale: 'en'
|
|
47
71
|
},
|
|
48
72
|
],
|
|
49
73
|
pictureSize: 'medium',
|
package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-link-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-link-content/aico-link-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA8B;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,YAAY;oBACnB,IAAI,EAAE,6CAA6C;oBACnD,QAAQ,EAAE,SAAS;oBACnB,QAAQ,EAAE,4CAA4C;
|
|
1
|
+
{"version":3,"file":"aico-link-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-link-content/aico-link-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA8B;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,SAAS,GAAU;IAC9B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,YAAY,EAAE;gBACZ;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,KAAK,EAAE,YAAY;oBACnB,IAAI,EAAE,6CAA6C;oBACnD,QAAQ,EAAE,SAAS;oBACnB,QAAQ,EAAE,4CAA4C;oBACtD,MAAM,EAAE,IAAI;iBACb;gBACD;oBACE,EAAE,EAAE,IAAI;oBACR,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACr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cesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { LinkContent } from '../../../model/article/content/LinkContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoLinkContent> = {\n component: 'aico-link-content',\n};\n\nexport default meta;\ntype Story = StoryObj;\n\nexport const ImageLink: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Link title',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n linkText: 'Rick :)',\n imageUrl: 'https://source.unsplash.com/random/320x240',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Link title en',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n linkText: 'Rick :)',\n imageUrl: 'https://source.unsplash.com/random/320x240',\n locale: 'en'\n },\n ],\n\n pictureSize: 'medium',\n\n isButtonLink: true,\n isImageFullSize: false,\n isImageLink: true,\n\n backgroundButtonColor: '#efefef',\n textButtonColor: 'red',\n hoverColor: 'pink',\n } as LinkContent,\n },\n};\n\nexport const ButtonLink: Story = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Link title',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n linkText: 'Rick :)',\n imageUrl: 'https://source.unsplash.com/random/320x240',\n locale: 'de'\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n title: 'Link title en',\n link: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n linkText: 'Rick :)',\n imageUrl: 'https://source.unsplash.com/random/320x240',\n locale: 'en'\n },\n ],\n\n pictureSize: 'medium',\n\n isButtonLink: true,\n isImageFullSize: false,\n isImageLink: false,\n\n backgroundButtonColor: '#efefef',\n textButtonColor: 'red',\n hoverColor: 'pink',\n } as LinkContent,\n },\n};\n"]}
|
|
@@ -4,15 +4,16 @@ import ConditionalRender from "../../../utils/ConditionalRender";
|
|
|
4
4
|
export class AicoPageContent {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.content = undefined;
|
|
7
|
+
this.locale = 'de';
|
|
7
8
|
}
|
|
8
9
|
render() {
|
|
9
|
-
var _a, _b, _c, _d;
|
|
10
|
-
const translation = this.content.landingPage.translations.
|
|
11
|
-
return (h(Host, { style: { 'max-width': '300px' } }, h("div", { class: "card pe-auto" }, h("div", { class: "ratio ratio-4x3" }, h("img", { class: "card-img-top img-fluid object-fit-cover", style: { 'object-position': 'center' }, src: (
|
|
10
|
+
var _a, _b, _c, _d, _e;
|
|
11
|
+
const translation = (_a = this.content.landingPage.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
12
|
+
return (h(Host, { style: { 'max-width': '300px' } }, h("div", { class: "card pe-auto" }, h("div", { class: "ratio ratio-4x3" }, h("img", { class: "card-img-top img-fluid object-fit-cover", style: { 'object-position': 'center' }, src: (_b = this.content.landingPage.image) !== null && _b !== void 0 ? _b : 'https://cdn.shopify.com/s/files/1/0565/2201/4813/files/blank-img.png?v=13432316686103745237%20406w', alt: (_c = translation === null || translation === void 0 ? void 0 : translation.imageAlt) !== null && _c !== void 0 ? _c : 'Landing page image' })), h("div", { class: "card-body", style: { 'min-height': '6rem' } }, h("h5", { class: "card-title" }, translation === null || translation === void 0 ? void 0 : translation.name), h(ConditionalRender, { condition: this.content.openExternalLink && !strIsNullOrEmptyOrWhitespace(this.content.externalLink) }, h("a", { href: this.content.externalLink, class: "card-link" }, (_d = translation === null || translation === void 0 ? void 0 : translation.buttonText) !== null && _d !== void 0 ? _d : 'Navigate to page')), h(ConditionalRender, { condition: !this.content.openExternalLink }, h("a", { href: "#", class: "card-link", onClick: e => {
|
|
12
13
|
var _a;
|
|
13
14
|
e.preventDefault();
|
|
14
15
|
(_a = this.pageClicked) === null || _a === void 0 ? void 0 : _a.emit(this.content);
|
|
15
|
-
} }, (
|
|
16
|
+
} }, (_e = translation === null || translation === void 0 ? void 0 : translation.buttonText) !== null && _e !== void 0 ? _e : 'Navigate to page'))), h(ConditionalRender, { condition: translation !== null && !strIsNullOrEmptyOrWhitespace(translation.excerpt) }, h("div", { class: "card-footer" }, h("small", { class: "text-muted" }, translation === null || translation === void 0 ? void 0 : translation.excerpt))))));
|
|
16
17
|
}
|
|
17
18
|
static get is() { return "aico-page-content"; }
|
|
18
19
|
static get encapsulation() { return "scoped"; }
|
|
@@ -48,6 +49,24 @@ export class AicoPageContent {
|
|
|
48
49
|
"tags": [],
|
|
49
50
|
"text": ""
|
|
50
51
|
}
|
|
52
|
+
},
|
|
53
|
+
"locale": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"mutable": false,
|
|
56
|
+
"complexType": {
|
|
57
|
+
"original": "string",
|
|
58
|
+
"resolved": "string",
|
|
59
|
+
"references": {}
|
|
60
|
+
},
|
|
61
|
+
"required": false,
|
|
62
|
+
"optional": false,
|
|
63
|
+
"docs": {
|
|
64
|
+
"tags": [],
|
|
65
|
+
"text": ""
|
|
66
|
+
},
|
|
67
|
+
"attribute": "locale",
|
|
68
|
+
"reflect": false,
|
|
69
|
+
"defaultValue": "'de'"
|
|
51
70
|
}
|
|
52
71
|
};
|
|
53
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-page-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-page-content/aico-page-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MAAM,OAAO,eAAe
|
|
1
|
+
{"version":3,"file":"aico-page-content.js","sourceRoot":"","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O,CAAC,YAAa,EAAE,KAAK,EAAC,WAAW,IACnD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,mCAAI,kBAAkB,CAC5C,CACc;oBACpB,EAAC,iBAAiB,IAAC,SAAS,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB;wBAC1D,SACE,IAAI,EAAC,GAAG,EACR,KAAK,EAAC,WAAW,EACjB,OAAO,EAAE,CAAC,CAAC,EAAE;;gCACX,CAAC,CAAC,cAAc,EAAE,CAAC;gCACnB,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;4BACvC,CAAC,IAEA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,mCAAI,kBAAkB,CAC5C,CACc,CAChB;gBACN,EAAC,iBAAiB,IAAC,SAAS,EAAE,WAAW,KAAK,IAAI,IAAI,CAAC,4BAA4B,CAAC,WAAW,CAAC,OAAO,CAAC;oBACtG,WAAK,KAAK,EAAC,aAAa;wBACtB,aAAO,KAAK,EAAC,YAAY,IAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAAS,CACpD,CACY,CAChB,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, Host, Prop, h } from '@stencil/core';\nimport type { PageContent } from '../../../model/article/content/PageContent';\nimport { strIsNullOrEmptyOrWhitespace } from '../../../utils/utils';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-page-content',\n styleUrl: 'aico-page-content.css',\n scoped: true,\n})\nexport class AicoPageContent {\n @Prop() content!: PageContent;\n\n @Prop() locale: string = 'de';\n\n @Event() pageClicked?: EventEmitter<PageContent>;\n\n render() {\n const translation = this.content.landingPage.translations.find(translation => translation.locale === this.locale) ?? null;\n return (\n <Host style={{ 'max-width': '300px' }}>\n <div class=\"card pe-auto\">\n <div class=\"ratio ratio-4x3\">\n <img\n class=\"card-img-top img-fluid object-fit-cover\"\n style={{ 'object-position': 'center' }}\n src={this.content.landingPage.image ?? 'https://cdn.shopify.com/s/files/1/0565/2201/4813/files/blank-img.png?v=13432316686103745237%20406w'}\n alt={translation?.imageAlt ?? 'Landing page image'}\n />\n </div>\n <div class=\"card-body\" style={{ 'min-height': '6rem' }}>\n <h5 class=\"card-title\">{translation?.name}</h5>\n <ConditionalRender condition={this.content.openExternalLink && !strIsNullOrEmptyOrWhitespace(this.content.externalLink)}>\n <a href={this.content.externalLink!} class=\"card-link\">\n {translation?.buttonText ?? 'Navigate to page'}\n </a>\n </ConditionalRender>\n <ConditionalRender condition={!this.content.openExternalLink}>\n <a\n href=\"#\"\n class=\"card-link\"\n onClick={e => {\n e.preventDefault();\n this.pageClicked?.emit(this.content);\n }}\n >\n {translation?.buttonText ?? 'Navigate to page'}\n </a>\n </ConditionalRender>\n </div>\n <ConditionalRender condition={translation !== null && !strIsNullOrEmptyOrWhitespace(translation.excerpt)}>\n <div class=\"card-footer\">\n <small class=\"text-muted\">{translation?.excerpt}</small>\n </div>\n </ConditionalRender>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -4,6 +4,7 @@ const meta = {
|
|
|
4
4
|
export default meta;
|
|
5
5
|
export const Exampl = {
|
|
6
6
|
args: {
|
|
7
|
+
locale: 'de',
|
|
7
8
|
content: {
|
|
8
9
|
id: 1234,
|
|
9
10
|
createdAt: new Date(),
|
|
@@ -26,6 +27,16 @@ export const Exampl = {
|
|
|
26
27
|
imageAlt: 'Image alt',
|
|
27
28
|
excerpt: 'Soon',
|
|
28
29
|
},
|
|
30
|
+
{
|
|
31
|
+
id: 1234,
|
|
32
|
+
createdAt: new Date(),
|
|
33
|
+
updatedAt: new Date(),
|
|
34
|
+
locale: 'de',
|
|
35
|
+
name: 'Page name de',
|
|
36
|
+
buttonText: 'See the article de',
|
|
37
|
+
imageAlt: 'Image alt',
|
|
38
|
+
excerpt: 'Soon de',
|
|
39
|
+
},
|
|
29
40
|
],
|
|
30
41
|
isPublic: false,
|
|
31
42
|
isTemplate: false,
|
package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-page-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-page-content/aico-page-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA8B;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,MAAM,MAAM,GAAa;IAC9B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,gBAAgB,EAAE,IAAI;YACtB,YAAY,EAAE,6CAA6C;YAC3D,eAAe,EAAE,KAAK;YACtB,WAAW,EAAE;gBACX,EAAE,EAAE,IAAI;gBACR,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,YAAY,EAAE;oBACZ;wBACE,EAAE,EAAE,IAAI;wBACR,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,MAAM,EAAE,OAAO;wBACf,IAAI,EAAE,WAAW;wBACjB,UAAU,EAAE,iBAAiB;wBAC7B,QAAQ,EAAE,WAAW;wBACrB,OAAO,EAAE,MAAM;qBAChB;iBACF;gBACD,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,KAAK,EAAE,4CAA4C;aACpD;SACa;KACjB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { PageContent } from '../../../model/article/content/PageContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoPageContent> = {\n component: 'aico-page-content',\n};\n\nexport default meta;\n\nexport const Exampl: StoryObj = {\n args: {\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n openExternalLink: true,\n externalLink: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n isImageZoomedIn: false,\n landingPage: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n name: 'Page name',\n buttonText: 'See the article',\n imageAlt: 'Image alt',\n excerpt: 'Soon',\n },\n ],\n isPublic: false,\n isTemplate: false,\n image: 'https://source.unsplash.com/random/320x240',\n },\n } as PageContent,\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"aico-page-content.stories.js","sourceRoot":"","sources":["../../../../src/components/content/aico-page-content/aico-page-content.stories.ts"],"names":[],"mappings":"AAIA,MAAM,IAAI,GAA8B;IACtC,SAAS,EAAE,mBAAmB;CAC/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,MAAM,MAAM,GAAa;IAC9B,IAAI,EAAE;QACJ,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE;YACP,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,gBAAgB,EAAE,IAAI;YACtB,YAAY,EAAE,6CAA6C;YAC3D,eAAe,EAAE,KAAK;YACtB,WAAW,EAAE;gBACX,EAAE,EAAE,IAAI;gBACR,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;gBACrB,YAAY,EAAE;oBACZ;wBACE,EAAE,EAAE,IAAI;wBACR,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,MAAM,EAAE,OAAO;wBACf,IAAI,EAAE,WAAW;wBACjB,UAAU,EAAE,iBAAiB;wBAC7B,QAAQ,EAAE,WAAW;wBACrB,OAAO,EAAE,MAAM;qBAChB;oBACD;wBACE,EAAE,EAAE,IAAI;wBACR,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;wBACrB,MAAM,EAAE,IAAI;wBACZ,IAAI,EAAE,cAAc;wBACpB,UAAU,EAAE,oBAAoB;wBAChC,QAAQ,EAAE,WAAW;wBACrB,OAAO,EAAE,SAAS;qBACnB;iBACF;gBACD,QAAQ,EAAE,KAAK;gBACf,UAAU,EAAE,KAAK;gBACjB,KAAK,EAAE,4CAA4C;aACpD;SACa;KACjB;CACF,CAAC","sourcesContent":["import type { Meta, StoryObj } from '@storybook/web-components';\nimport type { PageContent } from '../../../model/article/content/PageContent';\nimport { JSX } from '../../../components';\n\nconst meta: Meta<JSX.AicoPageContent> = {\n component: 'aico-page-content',\n};\n\nexport default meta;\n\nexport const Exampl: StoryObj = {\n args: {\n locale: 'de',\n content: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n openExternalLink: true,\n externalLink: 'https://www.youtube.com/watch?v=xvFZjo5PgG0',\n isImageZoomedIn: false,\n landingPage: {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n translations: [\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'en-GB',\n name: 'Page name',\n buttonText: 'See the article',\n imageAlt: 'Image alt',\n excerpt: 'Soon',\n },\n {\n id: 1234,\n createdAt: new Date(),\n updatedAt: new Date(),\n locale: 'de',\n name: 'Page name de',\n buttonText: 'See the article de',\n imageAlt: 'Image alt',\n excerpt: 'Soon de',\n },\n ],\n isPublic: false,\n isTemplate: false,\n image: 'https://source.unsplash.com/random/320x240',\n },\n } as PageContent,\n },\n};\n"]}
|
|
@@ -3,17 +3,19 @@ import ConditionalRender from "../../../utils/ConditionalRender";
|
|
|
3
3
|
export class AicoTableContent {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.content = undefined;
|
|
6
|
+
this.locale = 'de';
|
|
6
7
|
}
|
|
7
8
|
render() {
|
|
8
|
-
var _a, _b;
|
|
9
|
-
const translation = this.content.translations.
|
|
10
|
-
const firstBackgroundColor = (
|
|
11
|
-
const secondBackgroundColor = (
|
|
12
|
-
return (h("div", { class: "content-table card" }, h("div", { class: "card-body" }, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { class: "card-title mt-0", content: this.makeTitleContent(translation) }), h("p", { class: "card-text" }, translation.additionalText)), h("table", { class: "table-content" }, this.content.tableRows
|
|
9
|
+
var _a, _b, _c;
|
|
10
|
+
const translation = (_a = this.content.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
11
|
+
const firstBackgroundColor = (_b = this.content.firstColor) !== null && _b !== void 0 ? _b : '#d6dfe1';
|
|
12
|
+
const secondBackgroundColor = (_c = this.content.secondColor) !== null && _c !== void 0 ? _c : '#e6eced';
|
|
13
|
+
return (h("div", { class: "content-table card" }, h("div", { class: "card-body" }, h(ConditionalRender, { condition: translation !== null }, h("aico-title-content", { class: "card-title mt-0", content: this.makeTitleContent(translation), locale: this.locale }), h("p", { class: "card-text" }, translation.additionalText)), h("table", { class: "table-content" }, this.content.tableRows
|
|
13
14
|
.sort((a, b) => a.sort - b.sort)
|
|
14
15
|
.map((row, index) => {
|
|
15
16
|
return (h("tr", { style: { 'font-weight': '400', 'background-color': index % 2 === 0 ? firstBackgroundColor : secondBackgroundColor } }, row.rowColumns.map(col => {
|
|
16
|
-
|
|
17
|
+
var _a;
|
|
18
|
+
const translation = (_a = col.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
17
19
|
if (!translation) {
|
|
18
20
|
return row.isHeading ? h("th", null) : h("td", null);
|
|
19
21
|
}
|
|
@@ -66,6 +68,24 @@ export class AicoTableContent {
|
|
|
66
68
|
"tags": [],
|
|
67
69
|
"text": ""
|
|
68
70
|
}
|
|
71
|
+
},
|
|
72
|
+
"locale": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"mutable": false,
|
|
75
|
+
"complexType": {
|
|
76
|
+
"original": "string",
|
|
77
|
+
"resolved": "string",
|
|
78
|
+
"references": {}
|
|
79
|
+
},
|
|
80
|
+
"required": false,
|
|
81
|
+
"optional": false,
|
|
82
|
+
"docs": {
|
|
83
|
+
"tags": [],
|
|
84
|
+
"text": ""
|
|
85
|
+
},
|
|
86
|
+
"attribute": "locale",
|
|
87
|
+
"reflect": false,
|
|
88
|
+
"defaultValue": "'de'"
|
|
69
89
|
}
|
|
70
90
|
};
|
|
71
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aico-table-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-table-content/aico-table-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAInD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MAAM,OAAO,gBAAgB
|
|
1
|
+
{"version":3,"file":"aico-table-content.js","sourceRoot":"","sources":["../../../../src/components/content/aico-table-content/aico-table-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAInD,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAOjE,MAAM,OAAO,gBAAgB;;;sBAGF,IAAI;;IAE7B,MAAM;;QACJ,MAAM,WAAW,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,mCAAI,IAAI,CAAC;QAE9G,MAAM,oBAAoB,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,mCAAI,SAAS,CAAC;QAClE,MAAM,qBAAqB,GAAG,MAAA,IAAI,CAAC,OAAO,CAAC,WAAW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AAC;oBAC/F,CAAC,CAAC,CACC,CACN,CAAC;gBACJ,CAAC,CAAC,CACE,CACJ,CACF,CACP,CAAC;IACJ,CAAC;IAEO,gBAAgB,CAAC,WAAwB;;QAC/C,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YACnB,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YACjC,aAAa,EAAE,KAAK;YACpB,IAAI,EAAE,MAAA,IAAI,CAAC,OAAO,CAAC,SAAS,mCAAI,IAAI;YACpC,YAAY,EAAE,mBAAM,WAAW,EAAG;SACnC,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Prop, h } from '@stencil/core';\nimport type { TableContent } from '../../../model/article/content/TableContet';\nimport type { Translation } from '../../../model/article/Translation';\nimport type { TitleContent } from '../../../model/article/content/TitleContent';\nimport ConditionalRender from '../../../utils/ConditionalRender';\n\n@Component({\n tag: 'aico-table-content',\n styleUrl: 'aico-table-content.css',\n scoped: true,\n})\nexport class AicoTableContent {\n @Prop() content!: TableContent;\n\n @Prop() locale: string = 'de';\n\n render() {\n const translation = this.content.translations.find(translation => translation.locale === this.locale) ?? null;\n\n const firstBackgroundColor = this.content.firstColor ?? '#d6dfe1';\n const secondBackgroundColor = this.content.secondColor ?? '#e6eced';\n\n return (\n <div class=\"content-table card\">\n <div class=\"card-body\">\n <ConditionalRender condition={translation !== null}>\n <aico-title-content class=\"card-title mt-0\" content={this.makeTitleContent(translation!)} locale={this.locale} />\n <p class=\"card-text\">{translation!.additionalText}</p>\n </ConditionalRender>\n <table class=\"table-content\">\n {this.content.tableRows\n .sort((a, b) => a.sort - b.sort)\n .map((row, index) => {\n return (\n <tr style={{ 'font-weight': '400', 'background-color': index % 2 === 0 ? firstBackgroundColor : secondBackgroundColor }}>\n {row.rowColumns.map(col => {\n const translation = col.translations.find(translation => translation.locale === this.locale) ?? null;\n if (!translation) {\n return row.isHeading ? <th></th> : <td></td>;\n }\n\n return row.isHeading ? <th>{translation.columnData}</th> : <td>{translation.columnData}</td>;\n })}\n </tr>\n );\n })}\n </table>\n </div>\n </div>\n );\n }\n\n private makeTitleContent(translation: Translation): TitleContent {\n return {\n id: this.content.id,\n createdAt: this.content.createdAt,\n updatedAt: this.content.updatedAt,\n hasUnderscore: false,\n size: this.content.titleSize ?? 'h2',\n translations: [{ ...translation }],\n };\n }\n}\n"]}
|