@aiconomy/aico-components 0.0.191 → 0.0.202

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.
@@ -13795,15 +13795,16 @@ function setArrayFilter(queryParams, key, values) {
13795
13795
  queryParams.append(key, value);
13796
13796
  }
13797
13797
  }
13798
- async function fetchNewsArticles(api, page, size, signal, newsChannels = [], newsSellerIds = [], newsBrandIds = [], newsLanguageLocales = [], hideTopArticles = false, hideSpecialArticles = false, latestNews = false) {
13798
+ async function fetchNewsArticles(api, page, size, signal, newsChannels = [], newsSellerIds = [], newsBrandIds = [], newsLanguageLocales = [], hideTopArticles = false, hideSpecialArticles = false, latestNews = false, allBrands = false) {
13799
13799
  const url = api.bearerToken
13800
13800
  ? 'news'
13801
13801
  : api.accessToken
13802
13802
  ? latestNews
13803
- ? 'aico-shops/1/latest-news-resource'
13803
+ ? `aico-shops/1/latest-news-resource`
13804
13804
  : 'aico-shops/1/news-resource'
13805
13805
  : '';
13806
13806
  const queryParams = new URLSearchParams();
13807
+ queryParams.set('allBrands', `${allBrands}`);
13807
13808
  queryParams.set('page[number]', String(page));
13808
13809
  queryParams.set('page[size]', String(size));
13809
13810
  if (api.bearerToken) {
@@ -20705,6 +20706,7 @@ const AicoNewsList = class {
20705
20706
  this.hideTopArticles = true;
20706
20707
  this.hideSpecialArticles = false;
20707
20708
  this.latestNews = false;
20709
+ this.allBrands = false;
20708
20710
  this.pageSize = 16;
20709
20711
  this.nextButtonText = 'Next';
20710
20712
  this.previousButtonText = 'Previous';
@@ -20723,37 +20725,37 @@ const AicoNewsList = class {
20723
20725
  this.newsListFetchController.abort('disconnected');
20724
20726
  }
20725
20727
  async componentWillLoad() {
20726
- 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);
20728
+ 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);
20727
20729
  }
20728
20730
  async componentWillUpdate() {
20729
20731
  this.newsListFetchController = new AbortController();
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);
20732
+ 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
20733
  }
20732
20734
  render() {
20733
20735
  var _a, _b, _c;
20734
- return (h(Host, { key: 'e1667c954dd75052b26f824431174b7e734b484c' }, h("div", { key: '93ebe550604322a061fc082390592445491877a6', class: "newslist-grid-container mb-4" }, (_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.data.map((article, articleIndex) => {
20736
+ return (h(Host, { key: '3b912506f1bc1027ec80907b453870e493e8d881' }, h("div", { key: 'aaafdcf6528bcd7d0536a91fc1001273facf37ac', class: "newslist-grid-container mb-4" }, (_a = this.newsResponse) === null || _a === void 0 ? void 0 : _a.data.map((article, articleIndex) => {
20735
20737
  return (h("div", { key: article.id, class: "col" }, h("aico-news-list-item", { article: article, articleIndex: articleIndex, onArticleClick: e => {
20736
20738
  var _a;
20737
20739
  (_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(e.detail);
20738
20740
  e.stopPropagation();
20739
20741
  }, locale: this.locale })));
20740
20742
  })), !this.latestNews &&
20741
- h("nav", { key: 'd6aabfea2c744fa2f28a7189b94941b646a9c556', class: "w-100", "aria-label": "News navigation" }, h("ul", { key: '466c5ee092a339faab8b4948a7f4c9aae5176320', class: "pagination justify-content-center" }, h("li", { key: '19817579487de9a680246c18bfc5e0b8d5b2bfa8', 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: () => {
20743
+ h("nav", { key: '2783b8efc0ae58d2f87184e736179cf9d2d4bc25', class: "w-100", "aria-label": "News navigation" }, h("ul", { key: 'f869acec5918679998dfbe027f5a10337b98bef8', class: "pagination justify-content-center" }, 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: () => {
20742
20744
  if (this.pageNumber > 1) {
20743
20745
  this.pageNumber -= 1;
20744
20746
  }
20745
20747
  return false;
20746
- } }, h("svg", { key: 'a29d589719823124f5aa506e622b46daa8e0f407', 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" }, h("path", { key: 'c801d1858c179806a5d5814c5eb29927438a484a', "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 => (h("li", { class: `page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
20748
+ } }, 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" }, 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 => (h("li", { class: `page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`, style: { cursor: 'pointer' }, onClick: () => {
20747
20749
  if (page !== '...') {
20748
20750
  this.pageNumber = Number(page);
20749
20751
  }
20750
20752
  return false;
20751
- } }, page))), h("li", { key: '512c4c5e69c10e907b483ba789e981dac566ede9', 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: () => {
20753
+ } }, page))), 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: () => {
20752
20754
  var _a, _b;
20753
20755
  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)) {
20754
20756
  this.pageNumber += 1;
20755
20757
  }
20756
- } }, this.nextButtonText, h("svg", { key: 'eb4538e30017ec9d2f2ed90054beb65519a21b4c', 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" }, h("path", { key: '2dee699c259f973ce0f397cc3a501614e6058692', "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" })))))));
20758
+ } }, this.nextButtonText, 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" }, 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" })))))));
20757
20759
  }
20758
20760
  getViewablePages(lookAhead = 2) {
20759
20761
  var _a, _b, _c, _d, _e, _f, _g;