@aiconomy/aico-components 0.0.187 → 0.0.197

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.
@@ -13799,12 +13799,12 @@ function setArrayFilter(queryParams, key, values) {
13799
13799
  queryParams.append(key, value);
13800
13800
  }
13801
13801
  }
13802
- async function fetchNewsArticles(api, page, size, signal, newsChannels = [], newsSellerIds = [], newsBrandIds = [], newsLanguageLocales = [], hideTopArticles = false, hideSpecialArticles = false, latestNews = false) {
13802
+ async function fetchNewsArticles(api, page, size, signal, newsChannels = [], newsSellerIds = [], newsBrandIds = [], newsLanguageLocales = [], hideTopArticles = false, hideSpecialArticles = false, latestNews = false, allBrands = false) {
13803
13803
  const url = api.bearerToken
13804
13804
  ? 'news'
13805
13805
  : api.accessToken
13806
13806
  ? latestNews
13807
- ? 'aico-shops/1/latest-news-resource'
13807
+ ? `aico-shops/1/latest-news-resource?allBrands=${allBrands}`
13808
13808
  : 'aico-shops/1/news-resource'
13809
13809
  : '';
13810
13810
  const queryParams = new URLSearchParams();
@@ -20709,6 +20709,7 @@ const AicoNewsList = class {
20709
20709
  this.hideTopArticles = true;
20710
20710
  this.hideSpecialArticles = false;
20711
20711
  this.latestNews = false;
20712
+ this.allBrands = false;
20712
20713
  this.pageSize = 16;
20713
20714
  this.nextButtonText = 'Next';
20714
20715
  this.previousButtonText = 'Previous';
@@ -20727,37 +20728,37 @@ const AicoNewsList = class {
20727
20728
  this.newsListFetchController.abort('disconnected');
20728
20729
  }
20729
20730
  async componentWillLoad() {
20730
- this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannelsArr, this.newsSellerIdsArr, this.newsBrandIdsArr, this.newsLanguageLocalesArr, this.hideTopArticles, this.hideSpecialArticles, this.latestNews);
20731
+ this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannelsArr, this.newsSellerIdsArr, this.newsBrandIdsArr, this.newsLanguageLocalesArr, this.hideTopArticles, this.hideSpecialArticles, this.latestNews, this.allBrands);
20731
20732
  }
20732
20733
  async componentWillUpdate() {
20733
20734
  this.newsListFetchController = new AbortController();
20734
- this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannelsArr, this.newsSellerIdsArr, this.newsBrandIdsArr, this.newsLanguageLocalesArr, this.hideTopArticles, this.hideSpecialArticles, this.latestNews);
20735
+ this.newsResponse = await fetchNewsArticles(this.api, this.pageNumber, this.pageSize, this.newsListFetchController.signal, this.newsChannelsArr, this.newsSellerIdsArr, this.newsBrandIdsArr, this.newsLanguageLocalesArr, this.hideTopArticles, this.hideSpecialArticles, this.latestNews, this.allBrands);
20735
20736
  }
20736
20737
  render() {
20737
20738
  var _a, _b, _c;
20738
- return (index.h(index.Host, { key: 'e1667c954dd75052b26f824431174b7e734b484c' }, index.h("div", { key: '93ebe550604322a061fc082390592445491877a6', class: "newslist-grid-container mb-4" }, (_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.data.filter(article => this.latestNews || !article.attributes.isTopNews).map((article, articleIndex) => {
20739
+ return (index.h(index.Host, { key: '3b912506f1bc1027ec80907b453870e493e8d881' }, index.h("div", { key: 'aaafdcf6528bcd7d0536a91fc1001273facf37ac', class: "newslist-grid-container mb-4" }, (_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.data.map((article, articleIndex) => {
20739
20740
  return (index.h("div", { key: article.id, class: "col" }, index.h("aico-news-list-item", { article: article, articleIndex: articleIndex, onArticleClick: e => {
20740
20741
  var _a;
20741
20742
  (_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(e.detail);
20742
20743
  e.stopPropagation();
20743
20744
  }, locale: this.locale })));
20744
20745
  })), !this.latestNews &&
20745
- index.h("nav", { key: 'b4e081968bf0de39ca6deb53f46e51149ba90c96', class: "w-100", "aria-label": "News navigation" }, index.h("ul", { key: '306919fae60915ef97b0f8b499105252cffa7355', class: "pagination justify-content-center" }, index.h("li", { key: '2004858d91a1d36f344947003e16276c06d012e4', 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: () => {
20746
+ index.h("nav", { key: '2783b8efc0ae58d2f87184e736179cf9d2d4bc25', class: "w-100", "aria-label": "News navigation" }, index.h("ul", { key: 'f869acec5918679998dfbe027f5a10337b98bef8', class: "pagination justify-content-center" }, index.h("li", { key: 'b36ddbf236adff317c6be81f1ae7a4d21168d7ca', 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: () => {
20746
20747
  if (this.pageNumber > 1) {
20747
20748
  this.pageNumber -= 1;
20748
20749
  }
20749
20750
  return false;
20750
- } }, index.h("svg", { key: '794bc0a90223b0bfb469732e64c8ecdc33cbf95f', xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", class: "bi bi-chevron-left me-1 fs-4", style: { width: '1em', height: '1em' }, viewBox: "0 0 16 16" }, index.h("path", { key: 'c114c34774e564ee68e70a72f02a53acc7d7403f', "fill-rule": "evenodd", d: "M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0" })), this.previousButtonText), this.getViewablePages().map(page => (index.h("li", { class: `page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
20751
+ } }, index.h("svg", { key: 'e0e326fa075bfd3e1543dedbf85bee8ce979ff6e', xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", class: "bi bi-chevron-left me-1 fs-4", style: { width: '1em', height: '1em' }, viewBox: "0 0 16 16" }, index.h("path", { key: 'aa1d02c300b89d34165584c759b2158800c93e59', "fill-rule": "evenodd", d: "M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0" })), this.previousButtonText), this.getViewablePages().map(page => (index.h("li", { class: `page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
20751
20752
  if (page !== '...') {
20752
20753
  this.pageNumber = Number(page);
20753
20754
  }
20754
20755
  return false;
20755
- } }, page))), index.h("li", { key: 'a3b8aa8f9d69ad837e90b17f683fbcb97e70dd56', class: `page-item page-link user-select-none d-flex align-items-center ${!((_c = this.newsResponse) === null || _c === void 0 ? void 0 : _c.links.next) ? 'disabled' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
20756
+ } }, page))), index.h("li", { key: 'f220799fc4f1d1fb64a8f6d8acf580930d37cd1a', class: `page-item page-link user-select-none d-flex align-items-center ${!((_c = this.newsResponse) === null || _c === void 0 ? void 0 : _c.links.next) ? 'disabled' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
20756
20757
  var _a, _b;
20757
20758
  if (((_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.meta.page.lastPage) && this.pageNumber < ((_b = this.newsResponse) === null || _b === void 0 ? void 0 : _b.meta.page.lastPage)) {
20758
20759
  this.pageNumber += 1;
20759
20760
  }
20760
- } }, this.nextButtonText, index.h("svg", { key: '46589c53b68ba1f8a87a893a63469e460d01b25e', xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", class: "bi bi-chevron-right ms-1 fs-4", style: { width: '1em', height: '1em' }, viewBox: "0 0 16 16" }, index.h("path", { key: '5ea164fd74b2138274adcba33e0e54a42e52be4e', "fill-rule": "evenodd", d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708" })))))));
20761
+ } }, this.nextButtonText, index.h("svg", { key: '761c3fe193dd759e3ebe305badf11b26c82bed45', xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", class: "bi bi-chevron-right ms-1 fs-4", style: { width: '1em', height: '1em' }, viewBox: "0 0 16 16" }, index.h("path", { key: '9d4653443f049401d368fd785704f8ac0edbe78f', "fill-rule": "evenodd", d: "M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708" })))))));
20761
20762
  }
20762
20763
  getViewablePages(lookAhead = 2) {
20763
20764
  var _a, _b, _c, _d, _e, _f, _g;