@aiconomy/aico-components 0.0.128 → 0.0.136
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 +26 -23
- 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-64d6361b.entry.js → p-de1a4cc0.entry.js} +3 -3
- package/dist/aico-components/p-de1a4cc0.entry.js.map +1 -0
- package/dist/cjs/aico-album-content_26.cjs.entry.js +16 -10
- package/dist/cjs/aico-album-content_26.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-components.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/aico-article-detail/aico-article-detail.js +4 -3
- package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -1
- package/dist/collection/components/aico-news-list/aico-news-list.js +20 -1
- 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 +22 -2
- 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 +22 -2
- package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -1
- package/dist/collection/utils/ConditionalRender.js +1 -1
- package/dist/collection/utils/ConditionalRender.js.map +1 -1
- package/dist/collection/utils/utils.js +1 -1
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/ConditionalRender.js +1 -1
- package/dist/components/ConditionalRender.js.map +1 -1
- package/dist/components/aico-article-detail2.js +4 -3
- package/dist/components/aico-article-detail2.js.map +1 -1
- package/dist/components/aico-news-list-item2.js +6 -3
- package/dist/components/aico-news-list-item2.js.map +1 -1
- package/dist/components/aico-news-list.js +3 -1
- package/dist/components/aico-news-list.js.map +1 -1
- package/dist/components/aico-special-news-carousel.js +5 -2
- package/dist/components/aico-special-news-carousel.js.map +1 -1
- package/dist/components/utils.js +1 -1
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/aico-album-content_26.entry.js +16 -10
- package/dist/esm/aico-album-content_26.entry.js.map +1 -1
- package/dist/esm/aico-components.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/aico-news-list/aico-news-list.d.ts +6 -0
- package/dist/types/components/aico-news-list-item/aico-news-list-item.d.ts +6 -0
- package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +6 -0
- package/dist/types/components.d.ts +24 -0
- package/dist/types/utils/utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/aico-components/p-64d6361b.entry.js.map +0 -1
|
@@ -13763,7 +13763,7 @@ var ContentType;
|
|
|
13763
13763
|
})(ContentType || (ContentType = {}));
|
|
13764
13764
|
|
|
13765
13765
|
const ConditionalRender = ({ condition }, children) => {
|
|
13766
|
-
return condition
|
|
13766
|
+
return condition ? children : [];
|
|
13767
13767
|
};
|
|
13768
13768
|
|
|
13769
13769
|
const getAuthenticatedHeaders = (bearerToken) => {
|
|
@@ -13828,7 +13828,7 @@ async function fetchNewsArticleByHandle(api, urlHandle, signal) {
|
|
|
13828
13828
|
const request = getAuthenticatedRequest(api, 'news', queryParams, signal);
|
|
13829
13829
|
const response = await fetch(request);
|
|
13830
13830
|
const articles = await response.json();
|
|
13831
|
-
return articles.data[0];
|
|
13831
|
+
return articles.data.length === 1 ? articles.data[0] : undefined;
|
|
13832
13832
|
}
|
|
13833
13833
|
function getImageWidthPrc(pictureSize) {
|
|
13834
13834
|
switch (pictureSize) {
|
|
@@ -13880,11 +13880,12 @@ const AicoArticleDetail = class {
|
|
|
13880
13880
|
this.hideCategoryAndTags = false;
|
|
13881
13881
|
}
|
|
13882
13882
|
render() {
|
|
13883
|
-
var _a, _b;
|
|
13884
|
-
const
|
|
13883
|
+
var _a, _b, _c, _d;
|
|
13884
|
+
const translation = (_a = this.article.attributes.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
13885
|
+
const category = (_c = (_b = this.article.attributes.newsCategory) === null || _b === void 0 ? void 0 : _b.translations.find(translation => translation.locale === this.locale)) !== null && _c !== void 0 ? _c : null;
|
|
13885
13886
|
const articleDate = new Date(this.article.attributes.publishDate);
|
|
13886
13887
|
const content = this.article.attributes.contentBuilder.rows.sort((a, b) => a.order - b.order).map((row, index) => this.mapRowContent(row, index));
|
|
13887
|
-
return (index.h(index.Host, null, index.h("figure", null, index.h("blockquote", { class: "blockquote" }, index.h("h2", { class: "text-uppercase" }, this.article.attributes.name)), index.h(ConditionalRender, { condition: !this.hideDateAndAuthor }, index.h("figcaption", { class: "blockquote-footer mb-1" }, articleDate.toLocaleDateString('en-US', this.dateOptions), " by ", index.h("cite", { title: "Author" }, this.article.attributes.author))), index.h(ConditionalRender, { condition: !this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category === null || category === void 0 ? void 0 : category.webName) }, index.h("span", { class: "badge bg-info text-dark" }, category === null || category === void 0 ? void 0 : category.webName))), index.h("div", { class: "content-wrapper" }, content), index.h(ConditionalRender, { condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
|
|
13888
|
+
return (index.h(index.Host, null, index.h("figure", null, index.h("blockquote", { class: "blockquote" }, index.h("h2", { class: "text-uppercase" }, (_d = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _d !== void 0 ? _d : this.article.attributes.name)), index.h(ConditionalRender, { condition: !this.hideDateAndAuthor }, index.h("figcaption", { class: "blockquote-footer mb-1" }, articleDate.toLocaleDateString('en-US', this.dateOptions), " by ", index.h("cite", { title: "Author" }, this.article.attributes.author))), index.h(ConditionalRender, { condition: !this.hideCategoryAndTags && !strIsNullOrEmptyOrWhitespace(category === null || category === void 0 ? void 0 : category.webName) }, index.h("span", { class: "badge bg-info text-dark" }, category === null || category === void 0 ? void 0 : category.webName))), index.h("div", { class: "content-wrapper" }, content), index.h(ConditionalRender, { condition: !this.hideCategoryAndTags }, this.article.attributes.newsTags.map(tag => {
|
|
13888
13889
|
var _a;
|
|
13889
13890
|
const translation = (_a = tag.translations.find(translation => translation.locale === this.locale)) !== null && _a !== void 0 ? _a : null;
|
|
13890
13891
|
return (index.h(ConditionalRender, { condition: !strIsNullOrEmptyOrWhitespace(translation === null || translation === void 0 ? void 0 : translation.webName) }, index.h("span", { class: "badge bg-light text-dark" }, translation.webName)));
|
|
@@ -20621,6 +20622,7 @@ const AicoNewsList = class {
|
|
|
20621
20622
|
this.pageSize = 16;
|
|
20622
20623
|
this.nextButtonText = 'Next';
|
|
20623
20624
|
this.previousButtonText = 'Previous';
|
|
20625
|
+
this.locale = 'de';
|
|
20624
20626
|
}
|
|
20625
20627
|
connectedCallback() {
|
|
20626
20628
|
this.newsListFetchController = new AbortController();
|
|
@@ -20642,7 +20644,7 @@ const AicoNewsList = class {
|
|
|
20642
20644
|
return (index.h(index.Host, null, index.h("div", { class: "row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4" }, (_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.data.map(article => (index.h("div", { class: "col" }, index.h("aico-news-list-item", { article: article, onArticleClick: e => {
|
|
20643
20645
|
var _a;
|
|
20644
20646
|
(_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(e.detail);
|
|
20645
|
-
} }))))), index.h("nav", { class: "w-100", "aria-label": "News navigation" }, index.h("ul", { class: "pagination justify-content-center" }, index.h("li", { class: `page-item page-link user-select-none d-flex align-items-center ${!((_b = this.newsResponse) === null || _b === void 0 ? void 0 : _b.links.prev) ? 'disabled' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
|
|
20647
|
+
}, locale: this.locale }))))), index.h("nav", { class: "w-100", "aria-label": "News navigation" }, index.h("ul", { class: "pagination justify-content-center" }, index.h("li", { class: `page-item page-link user-select-none d-flex align-items-center ${!((_b = this.newsResponse) === null || _b === void 0 ? void 0 : _b.links.prev) ? 'disabled' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
|
|
20646
20648
|
if (this.pageNumber > 1) {
|
|
20647
20649
|
this.pageNumber -= 1;
|
|
20648
20650
|
}
|
|
@@ -20697,13 +20699,15 @@ const AicoNewsListItem = class {
|
|
|
20697
20699
|
index.registerInstance(this, hostRef);
|
|
20698
20700
|
this.articleClick = index.createEvent(this, "articleClick", 7);
|
|
20699
20701
|
this.article = undefined;
|
|
20702
|
+
this.locale = 'de';
|
|
20700
20703
|
}
|
|
20701
20704
|
render() {
|
|
20702
|
-
var _a, _b;
|
|
20705
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
20706
|
+
const translation = this.article.attributes.translations.find(t => t.locale === this.locale);
|
|
20703
20707
|
return (index.h("div", { class: "card h-100 pe-auto", style: { cursor: 'pointer' }, onClick: () => {
|
|
20704
20708
|
var _a;
|
|
20705
20709
|
(_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(this.article);
|
|
20706
|
-
} }, index.h("div", { class: "ratio ratio-16x9 overflow-hidden" }, index.h("img", { class: "object-fit-cover", style: { 'min-height': '15rem' }, alt: "Article image", src: (_b = (_a = this.article.attributes.optimizedListImage) !== null &&
|
|
20710
|
+
} }, index.h("div", { class: "ratio ratio-16x9 overflow-hidden" }, index.h("img", { class: "object-fit-cover", style: { 'min-height': '15rem' }, alt: "Article image", src: (_e = (_d = (_c = (_b = (_a = translation === null || translation === void 0 ? void 0 : translation.optimizedListImage) !== null && _a !== void 0 ? _a : translation === null || translation === void 0 ? void 0 : translation.optimizedImage) !== null && _b !== void 0 ? _b : translation === null || translation === void 0 ? void 0 : translation.image) !== null && _c !== void 0 ? _c : this.article.attributes.optimizedListImage) !== null && _d !== void 0 ? _d : this.article.attributes.optimizedImage) !== null && _e !== void 0 ? _e : this.article.attributes.image }), index.h("div", { class: "card-img-overlay d-flex justify-content-end" })), index.h("div", { class: "card-body" }, index.h("h5", { class: "card-title" }, (_f = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _f !== void 0 ? _f : this.article.attributes.name), index.h("p", { class: "card-text" }, (_g = translation === null || translation === void 0 ? void 0 : translation.excerpt) !== null && _g !== void 0 ? _g : this.article.attributes.excerpt))));
|
|
20707
20711
|
}
|
|
20708
20712
|
};
|
|
20709
20713
|
AicoNewsListItem.style = aicoNewsListItemCss;
|
|
@@ -20755,6 +20759,7 @@ const AicoSpecialNewsCarousel = class {
|
|
|
20755
20759
|
this.newsBrandIds = [];
|
|
20756
20760
|
this.newsLanguageLocales = [];
|
|
20757
20761
|
this.numberOfArticles = 6;
|
|
20762
|
+
this.locale = 'de';
|
|
20758
20763
|
}
|
|
20759
20764
|
connectedCallback() {
|
|
20760
20765
|
this.newsListFetchController = new AbortController();
|
|
@@ -20781,14 +20786,15 @@ const AicoSpecialNewsCarousel = class {
|
|
|
20781
20786
|
}
|
|
20782
20787
|
render() {
|
|
20783
20788
|
return (index.h("div", { class: "carousel" }, this.newsResponse.data.map(article => {
|
|
20784
|
-
var _a;
|
|
20789
|
+
var _a, _b, _c, _d;
|
|
20785
20790
|
const focusX = article.attributes.focusXPercentage ? `${article.attributes.focusXPercentage}%` : 'center';
|
|
20786
20791
|
const focusY = article.attributes.focusYPercentage ? `${article.attributes.focusYPercentage}%` : 'center';
|
|
20792
|
+
const translation = article.attributes.translations.find(t => t.locale === this.locale);
|
|
20787
20793
|
return (index.h("div", { class: "carousel-item card border-0" }, index.h("div", { class: "card-body" }, index.h("h5", { class: "card-title text-center text-uppercase" }, index.h("a", { class: "text-reset text-decoration-none", href: "#", onClick: e => {
|
|
20788
20794
|
var _a;
|
|
20789
20795
|
e.preventDefault();
|
|
20790
20796
|
(_a = this.articleClicked) === null || _a === void 0 ? void 0 : _a.emit(article);
|
|
20791
|
-
} }, article.attributes.name))), index.h("div", { class: "ratio ratio-16x9 mx-auto", style: { 'max-width': '50%' } }, index.h("img", { class: "card-img-bottom object-fit-cover", style: { 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }, alt: "News Picture", "data-lazy": (
|
|
20797
|
+
} }, (_a = translation === null || translation === void 0 ? void 0 : translation.name) !== null && _a !== void 0 ? _a : article.attributes.name))), index.h("div", { class: "ratio ratio-16x9 mx-auto", style: { 'max-width': '50%' } }, index.h("img", { class: "card-img-bottom object-fit-cover", style: { 'object-position': `${focusX} ${focusY}`, 'min-height': '15rem' }, alt: "News Picture", "data-lazy": (_d = (_c = (_b = translation === null || translation === void 0 ? void 0 : translation.optimizedImage) !== null && _b !== void 0 ? _b : translation === null || translation === void 0 ? void 0 : translation.image) !== null && _c !== void 0 ? _c : article.attributes.optimizedImage) !== null && _d !== void 0 ? _d : article.attributes.image }))));
|
|
20792
20798
|
})));
|
|
20793
20799
|
}
|
|
20794
20800
|
};
|