@aiconomy/aico-components 0.0.53 → 0.0.57
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.esm.js +1 -1
- package/dist/aico-components/aico-components.esm.js.map +1 -1
- package/dist/aico-components/p-0ca1f065.entry.js +2 -0
- package/dist/aico-components/p-0ca1f065.entry.js.map +1 -0
- package/dist/aico-components/{p-a58972e9.entry.js → p-1c4a07ef.entry.js} +3 -3
- package/dist/aico-components/p-1c4a07ef.entry.js.map +1 -0
- package/dist/aico-components/p-406fa2e5.entry.js +2 -0
- package/dist/aico-components/p-406fa2e5.entry.js.map +1 -0
- package/dist/aico-components/{p-42b98baf.entry.js → p-4c0f3325.entry.js} +2 -2
- package/dist/aico-components/{p-776352ba.entry.js → p-5109399b.entry.js} +2 -2
- package/dist/aico-components/{p-b0325a83.entry.js → p-6464810e.entry.js} +2 -2
- package/dist/aico-components/{p-b78d7799.entry.js → p-68930822.entry.js} +2 -2
- package/dist/aico-components/{p-1a6625c0.entry.js → p-90c2d3dc.entry.js} +2 -2
- 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-b1f8308f.entry.js +2 -0
- package/dist/aico-components/p-b1f8308f.entry.js.map +1 -0
- package/dist/aico-components/p-dfd3b0d3.js +2 -0
- package/dist/aico-components/p-dfd3b0d3.js.map +1 -0
- package/dist/cjs/aico-album-content_19.cjs.entry.js +3 -5
- package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-article-detail.cjs.entry.js +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 +11 -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 +6 -6
- package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -1
- package/dist/cjs/aico-no-content_2.cjs.entry.js +1 -1
- package/dist/cjs/aico-special-news-carousel.cjs.entry.js +2 -2
- 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-095ed22b.js} +10 -1
- package/dist/cjs/utils-095ed22b.js.map +1 -0
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +32 -7
- 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 +4 -4
- 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/content/aico-text-content/aico-text-content.js +2 -2
- package/dist/collection/components/content/aico-text-content/aico-text-content.js.map +1 -1
- package/dist/collection/utils/utils.js +8 -0
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/components/aico-fetch-article-detail.js +12 -3
- package/dist/components/aico-fetch-article-detail.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 +5 -5
- package/dist/components/aico-news-list.js.map +1 -1
- package/dist/components/aico-special-news-carousel.js +1 -1
- package/dist/components/aico-text-content2.js +1 -3
- package/dist/components/aico-text-content2.js.map +1 -1
- package/dist/components/utils.js +9 -1
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/aico-album-content_19.entry.js +3 -5
- package/dist/esm/aico-album-content_19.entry.js.map +1 -1
- package/dist/esm/aico-article-detail.entry.js +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 +11 -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 +6 -6
- package/dist/esm/aico-news-list.entry.js.map +1 -1
- package/dist/esm/aico-no-content_2.entry.js +1 -1
- package/dist/esm/aico-special-news-carousel.entry.js +2 -2
- 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-54ffec33.js} +10 -2
- package/dist/esm/utils-54ffec33.js.map +1 -0
- package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +14 -1
- package/dist/types/components/aico-news-list/aico-news-list.d.ts +1 -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.d.ts +20 -19
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +1 -1
- 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-54708dd0.entry.js +0 -2
- package/dist/aico-components/p-54708dd0.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-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-42b98baf.entry.js.map → p-4c0f3325.entry.js.map} +0 -0
- /package/dist/aico-components/{p-776352ba.entry.js.map → p-5109399b.entry.js.map} +0 -0
- /package/dist/aico-components/{p-b0325a83.entry.js.map → p-6464810e.entry.js.map} +0 -0
- /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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e52034b7.js');
|
|
6
6
|
|
|
7
7
|
const aicoAskingListContentCss = ".card.sc-aico-asking-list-content{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0, 0, 0, 0.125);border-radius:0.25rem}.so-tab.sc-aico-asking-list-content{position:relative;width:100%;overflow:hidden;margin:10px 0}.so-tab.sc-aico-asking-list-content label.sc-aico-asking-list-content{position:relative;display:block;padding:0 25px 0 0;line-height:normal;cursor:pointer}.so-tab.sc-aico-asking-list-content input.sc-aico-asking-list-content{position:absolute;opacity:0;z-index:-1}.so-tab-content.sc-aico-asking-list-content{max-height:0;overflow:hidden;transition:max-height 0.35s;line-height:1.2;font-size:15px}.so-tab.sc-aico-asking-list-content input.sc-aico-asking-list-content:checked~.so-tab-content.sc-aico-asking-list-content{max-height:none}.so-tab.sc-aico-asking-list-content label.sc-aico-asking-list-content::before{position:absolute;top:0;left:0;display:inline-block;-webkit-transition:all 0.35s;-o-transition:all 0.35s;transition:all 0.35s}.so-tab.sc-aico-asking-list-content label.sc-aico-asking-list-content{font-size:15px}.so-tab.sc-aico-asking-list-content input[type='checkbox'].sc-aico-asking-list-content+label.sc-aico-asking-list-content::before{content:'+ ';font-size:18px;font-weight:bold;line-height:0.3}.so-tab.sc-aico-asking-list-content input[type='radio'].sc-aico-asking-list-content+label.sc-aico-asking-list-content::before{content:'\\25B3'}.so-tab.sc-aico-asking-list-content input[type='checkbox'].sc-aico-asking-list-content:checked+label.sc-aico-asking-list-content::before{transform:rotate(315deg)}.so-tab.sc-aico-asking-list-content input[type='radio'].sc-aico-asking-list-content:checked+label.sc-aico-asking-list-content::before{transform:rotateX(180deg)}";
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e52034b7.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Browser v4.9.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -17,7 +17,7 @@ const patchBrowser = () => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(options => {
|
|
20
|
-
return index.bootstrapLazy([["aico-fetch-article-detail.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"articleId":[1,"article-id"],"article":[32]}]]],["aico-news-list.cjs",[[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"nextButtonText":[1,"next-button-text"],"previousButtonText":[1,"previous-button-text"],"newsResponse":[32],"pageNumber":[32]}]]],["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-special-news-carousel.cjs",[[2,"aico-special-news-carousel",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"numberOfArticles":[2,"number-of-articles"],"newsResponse":[32]}]]],["
|
|
20
|
+
return index.bootstrapLazy([["aico-fetch-article-detail.cjs",[[2,"aico-fetch-article-detail",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"articleId":[1,"article-id"],"articleUrlHandle":[1,"article-url-handle"],"article":[32]}]]],["aico-news-list.cjs",[[2,"aico-news-list",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"nextButtonText":[1,"next-button-text"],"previousButtonText":[1,"previous-button-text"],"newsResponse":[32],"pageNumber":[32]}]]],["aico-asking-list-content.cjs",[[6,"aico-asking-list-content"]]],["aico-collection-content.cjs",[[6,"aico-collection-content"]]],["aico-special-news-carousel.cjs",[[2,"aico-special-news-carousel",{"aicoUrl":[1,"aico-url"],"aicoBearerToken":[1,"aico-bearer-token"],"numberOfArticles":[2,"number-of-articles"],"newsResponse":[32]}]]],["aico-no-content_2.cjs",[[2,"aico-title-content",{"content":[16]}],[2,"aico-no-content"]]],["aico-album-content_19.cjs",[[2,"aico-bullet-content",{"content":[16]}],[2,"aico-carousel-content",{"content":[16],"hasArrows":[4,"has-arrows"]}],[2,"aico-content-card-content",{"content":[16]}],[2,"aico-heading-content",{"content":[16]}],[2,"aico-table-content",{"content":[16]}],[2,"aico-text-content",{"content":[16]}],[2,"aico-upload-content",{"content":[16]}],[2,"aico-video-content",{"content":[16]}],[2,"aico-html-content",{"content":[16]}],[2,"aico-album-content",{"content":[16]}],[2,"aico-asking-content",{"content":[16]}],[2,"aico-block-quote-content",{"content":[16]}],[2,"aico-divider-content",{"content":[16]}],[2,"aico-document-content",{"content":[16]}],[2,"aico-faq-content",{"content":[16]}],[2,"aico-link-content",{"content":[16]}],[2,"aico-news-content",{"content":[16]}],[2,"aico-page-content",{"content":[16]}],[2,"aico-testimonial-content",{"content":[16]}]]],["aico-article-detail.cjs",[[2,"aico-article-detail",{"article":[16]}]]],["aico-news-list-item.cjs",[[2,"aico-news-list-item",{"article":[16]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
exports.setNonce = index.setNonce;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const utils = require('./utils-
|
|
5
|
+
const index = require('./index-e52034b7.js');
|
|
6
|
+
const utils = require('./utils-095ed22b.js');
|
|
7
7
|
|
|
8
8
|
const aicoFetchArticleDetailCss = "";
|
|
9
9
|
|
|
@@ -14,6 +14,7 @@ const AicoFetchArticleDetail = class {
|
|
|
14
14
|
this.aicoUrl = undefined;
|
|
15
15
|
this.aicoBearerToken = undefined;
|
|
16
16
|
this.articleId = undefined;
|
|
17
|
+
this.articleUrlHandle = undefined;
|
|
17
18
|
}
|
|
18
19
|
connectedCallback() {
|
|
19
20
|
this.articleFetchController = new AbortController();
|
|
@@ -23,10 +24,17 @@ const AicoFetchArticleDetail = class {
|
|
|
23
24
|
this.articleFetchController.abort('disconnected');
|
|
24
25
|
}
|
|
25
26
|
async componentWillLoad() {
|
|
27
|
+
if (!this.articleId && !this.articleUrlHandle) {
|
|
28
|
+
throw new Error('Either the article id or the url handle must be provided.');
|
|
29
|
+
}
|
|
30
|
+
if (this.articleUrlHandle) {
|
|
31
|
+
this.article = await utils.fetchNewsArticleByHandle(this.api, this.articleUrlHandle, this.articleFetchController.signal);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
26
34
|
this.article = await utils.fetchNewsArticle(this.api, this.articleId, this.articleFetchController.signal);
|
|
27
35
|
}
|
|
28
36
|
render() {
|
|
29
|
-
return
|
|
37
|
+
return index.h("aico-article-detail", { article: this.article });
|
|
30
38
|
}
|
|
31
39
|
};
|
|
32
40
|
AicoFetchArticleDetail.style = aicoFetchArticleDetailCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"aico-fetch-article-detail.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,yBAAyB,GAAG,EAAE;;MCUvB,sBAAsB
|
|
1
|
+
{"file":"aico-fetch-article-detail.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,yBAAyB,GAAG,EAAE;;MCUvB,sBAAsB;;;;;;;;;IA0BjC,iBAAiB;QACf,IAAI,CAAC,sBAAsB,GAAG,IAAI,eAAe,EAAE,CAAC;QACpD,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;KACzE;IAED,oBAAoB;QAClB,IAAI,CAAC,sBAAuB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;KACpD;IAED,MAAM,iBAAiB;QACrB,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;YAC7C,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;SAC9E;QAED,IAAI,IAAI,CAAC,gBAAgB,EAAE;YACzB,IAAI,CAAC,OAAO,GAAG,MAAMA,8BAAwB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,sBAAuB,CAAC,MAAM,CAAC,CAAC;YACrH,OAAO;SACR;QAED,IAAI,CAAC,OAAO,GAAG,MAAMC,sBAAgB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,SAAU,EAAE,IAAI,CAAC,sBAAuB,CAAC,MAAM,CAAC,CAAC;KACxG;IAED,MAAM;QACJ,OAAOC,iCAAqB,OAAO,EAAE,IAAI,CAAC,OAAO,GAAI,CAAC;KACvD;;;;;;","names":["fetchNewsArticleByHandle","fetchNewsArticle","h"],"sources":["src/components/aico-fetch-article-detail/aico-fetch-article-detail.css?tag=aico-fetch-article-detail&encapsulation=scoped","src/components/aico-fetch-article-detail/aico-fetch-article-detail.tsx"],"sourcesContent":["","import { Component, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticle, fetchNewsArticleByHandle } from '../../utils/utils';\nimport { Article } from '../../model/Article';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\n\n@Component({\n tag: 'aico-fetch-article-detail',\n styleUrl: 'aico-fetch-article-detail.css',\n scoped: true,\n})\nexport class AicoFetchArticleDetail {\n @State() article!: Article;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n /**\n * The id will be used to fetch the article.\n *\n * If both the {@link AicoFetchArticleDetail#articleId} and {@link AicoFetchArticleDetail#articleUrlHandle} are\n * provided, the latter will be used. If neither are provided, an error is thrown.\n */\n @Prop() articleId?: string;\n\n /**\n * The url handle will be used to fetch the article.\n *\n * If both the {@link AicoFetchArticleDetail#articleId} and {@link AicoFetchArticleDetail#articleUrlHandle} are\n * provided, the latter will be used. If neither are provided, an error is thrown.\n */\n @Prop() articleUrlHandle?: string;\n\n private api?: AicoApiRequestInfo;\n private articleFetchController?: AbortController;\n\n connectedCallback() {\n this.articleFetchController = new AbortController();\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.articleFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n if (!this.articleId && !this.articleUrlHandle) {\n throw new Error('Either the article id or the url handle must be provided.');\n }\n\n if (this.articleUrlHandle) {\n this.article = await fetchNewsArticleByHandle(this.api!, this.articleUrlHandle, this.articleFetchController!.signal);\n return;\n }\n\n this.article = await fetchNewsArticle(this.api!, this.articleId!, this.articleFetchController!.signal);\n }\n\n render() {\n return <aico-article-detail article={this.article} />;\n }\n}\n"],"version":3}
|
|
@@ -2,19 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e52034b7.js');
|
|
6
6
|
|
|
7
7
|
const aicoNewsListItemCss = "";
|
|
8
8
|
|
|
9
9
|
const AicoNewsListItem = class {
|
|
10
10
|
constructor(hostRef) {
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
|
-
this.
|
|
12
|
+
this.articleClick = index.createEvent(this, "articleClick", 7);
|
|
13
13
|
this.article = undefined;
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
16
|
var _a, _b;
|
|
17
|
-
return (index.h("div", { class: "card h-100
|
|
17
|
+
return (index.h("div", { class: "card h-100 pe-auto", style: { cursor: 'pointer' }, onClick: () => {
|
|
18
|
+
var _a;
|
|
19
|
+
(_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(this.article);
|
|
20
|
+
} }, index.h("div", { class: "ratio ratio-4x3 mb-3" }, index.h("img", { class: "card-img-top w-100 object-fit-cover", style: { 'min-height': '15rem' }, alt: "Article image", src: (_b = (_a = this.article.attributes.optimizedListImage) !== null && _a !== void 0 ? _a : this.article.attributes.optimizedImage) !== null && _b !== void 0 ? _b : 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" }, this.article.attributes.name), index.h("p", { class: "card-text" }, this.article.attributes.excerpt))));
|
|
18
21
|
}
|
|
19
22
|
};
|
|
20
23
|
AicoNewsListItem.style = aicoNewsListItemCss;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"aico-news-list-item.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,EAAE;;MCQjB,gBAAgB;;;;;;IAK3B,MAAM;;QACJ,QACEA,
|
|
1
|
+
{"file":"aico-news-list-item.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,mBAAmB,GAAG,EAAE;;MCQjB,gBAAgB;;;;;;IAK3B,MAAM;;QACJ,QACEA,iBACE,KAAK,EAAC,oBAAoB,EAC1B,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAC5B,OAAO,EAAE;;gBACP,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aACvC,IAEDA,iBAAK,KAAK,EAAC,sBAAsB,IAC/BA,iBACE,KAAK,EAAC,qCAAqC,EAC3C,KAAK,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,EAChC,GAAG,EAAC,eAAe,EACnB,GAAG,EAAE,MAAA,MAAA,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,mCAAI,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,GAC1H,CACE,EACNA,iBAAK,KAAK,EAAC,6CAA6C,GAA0C,EAClGA,iBAAK,KAAK,EAAC,WAAW,IACpBA,gBAAI,KAAK,EAAC,YAAY,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAM,EAC1DA,eAAG,KAAK,EAAC,WAAW,IAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAK,CACtD,CACF,EACN;KACH;;;;;;","names":["h"],"sources":["src/components/aico-news-list-item/aico-news-list-item.css?tag=aico-news-list-item&encapsulation=scoped","src/components/aico-news-list-item/aico-news-list-item.tsx"],"sourcesContent":["","import { Component, Prop, Event, EventEmitter, h } from '@stencil/core';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list-item',\n styleUrl: 'aico-news-list-item.css',\n scoped: true,\n})\nexport class AicoNewsListItem {\n @Prop() article!: Article;\n\n @Event() articleClick?: EventEmitter<Article>;\n\n render() {\n return (\n <div\n class=\"card h-100 pe-auto\"\n style={{ cursor: 'pointer' }}\n onClick={() => {\n this.articleClick?.emit(this.article);\n }}\n >\n <div class=\"ratio ratio-4x3 mb-3\">\n <img\n class=\"card-img-top w-100 object-fit-cover\"\n style={{ 'min-height': '15rem' }}\n alt=\"Article image\"\n src={this.article.attributes.optimizedListImage ?? this.article.attributes.optimizedImage ?? this.article.attributes.image}\n />\n </div>\n <div class=\"card-img-overlay d-flex justify-content-end\">{/*TODO: set the date top-right?*/}</div>\n <div class=\"card-body\">\n <h5 class=\"card-title\">{this.article.attributes.name}</h5>\n <p class=\"card-text\">{this.article.attributes.excerpt}</p>\n </div>\n </div>\n );\n }\n}\n"],"version":3}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const utils = require('./utils-
|
|
5
|
+
const index = require('./index-e52034b7.js');
|
|
6
|
+
const utils = require('./utils-095ed22b.js');
|
|
7
7
|
|
|
8
|
-
const aicoNewsListCss = "
|
|
8
|
+
const aicoNewsListCss = "";
|
|
9
9
|
|
|
10
10
|
const AicoNewsList = class {
|
|
11
11
|
constructor(hostRef) {
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
|
-
this.
|
|
13
|
+
this.articleClick = index.createEvent(this, "articleClick", 7);
|
|
14
14
|
this.pageSize = 16;
|
|
15
15
|
this.newsResponse = undefined;
|
|
16
16
|
this.pageNumber = 1;
|
|
@@ -36,9 +36,9 @@ const AicoNewsList = class {
|
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
38
|
var _a, _b, _c;
|
|
39
|
-
return (index.h(index.Host, null, index.h("div", { class: "
|
|
39
|
+
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 => {
|
|
40
40
|
var _a;
|
|
41
|
-
(_a = this.
|
|
41
|
+
(_a = this.articleClick) === null || _a === void 0 ? void 0 : _a.emit(e.detail);
|
|
42
42
|
} }))))), 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: () => {
|
|
43
43
|
if (this.pageNumber > 1) {
|
|
44
44
|
this.pageNumber -= 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"aico-news-list.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,eAAe,GAAG,qBAAqB;;MCWhC,YAAY;;;;QACN,aAAQ,GAAG,EAA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AAC,UAAU,GAAG,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE;YAC1E,IAAI,CAAC,KAAK,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,CAAC,EAAE;gBACrD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;aACpB;SACF;QAED,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,GAAG,CAAC,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,IAAI,CAAC,EAAE;YAClF,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACnB;QAED,IAAI,IAAI,CAAC,UAAU,GAAG,SAAS,IAAI,CAAC,MAAA,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,mCAAI,CAAC,IAAI,CAAC,EAAE;YACnF,KAAK,CAAC,IAAI,CAAC,GAAG,MAAA,IAAI,CAAC,YAAY,0CAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SACxD;QAED,OAAO,KAAK,CAAC;KACd;;;;;;","names":["fetchNewsArticles","h","Host"],"sources":["src/components/aico-news-list/aico-news-list.css?tag=aico-news-list&encapsulation=scoped","src/components/aico-news-list/aico-news-list.tsx"],"sourcesContent":["/* :host { */\n/* display: block; */\n/* } */\n/**/\n/* .grid-wrapper { */\n/* display: grid; */\n/* height: 100%; */\n/* width: 100%; */\n/* justify-items: center; */\n/* align-items: stretch; */\n/* grid-template-columns: repeat(4, minmax(auto, 1fr)); */\n/* grid-auto-rows: minmax(0, 1fr); */\n/* grid-gap: 10px; */\n/* } */\n/**/\n/* .navigation-wrapper { */\n/* display: flex; */\n/* justify-content: space-around; */\n/* justify-items: center; */\n/* align-content: center; */\n/* } */\n/**/\n/* .navigation-button { */\n/* display: inline-block; */\n/* outline: none; */\n/* cursor: pointer; */\n/* font-size: 14px; */\n/* padding: 0 12px; */\n/* line-height: 20px; */\n/* height: 30px; */\n/* max-height: 30px; */\n/* background: none; */\n/* font-weight: 700; */\n/* border: 0; */\n/* border-radius: 0; */\n/* color: #9ca3af; */\n/* transition-timing-function: ease-in-out; */\n/* transition-property: background; */\n/* transition-duration: 150ms; */\n/* box-shadow: none; */\n/* &:enabled &:hover { */\n/* color: #374151; */\n/* } */\n/* } */\n/**/\n/* .navigation-pages { */\n/* display: inline-flex; */\n/* list-style-type: none; */\n/* margin: 0; */\n/* padding: 0; */\n/* margin-left: -1px; */\n/* font-size: 14px; */\n/* line-height: 20px; */\n/* } */\n/**/\n/* .navigation-pages > li { */\n/* display: flex; */\n/* padding-left: 12px; */\n/* padding-right: 12px; */\n/* justify-content: center; */\n/* align-items: center; */\n/* border-width: 1px; */\n/* border-color: #d1d5db; */\n/* border-radius: 8px; */\n/* height: 2rem; */\n/* line-height: 1.25; */\n/* color: #6b7280; */\n/* background-color: #ffffff; */\n/* } */\n/**/\n/* .navigation-pages > li.page-number { */\n/* cursor: pointer; */\n/* &:hover { */\n/* color: #374151; */\n/* background-color: #f3f4f6; */\n/* } */\n/* } */\n/**/\n/* .navigation-pages > li.page-selected { */\n/* display: flex; */\n/* padding-left: 12px; */\n/* padding-right: 12px; */\n/* justify-content: center; */\n/* align-items: center; */\n/* border-width: 1px; */\n/* border-color: #d1d5db; */\n/* border-radius: 8px; */\n/* height: 2rem; */\n/* color: #2563eb; */\n/* background-color: #eff6ff; */\n/**/\n/* &:hover { */\n/* color: #1d4ed8; */\n/* background-color: #dbeafe; */\n/* } */\n/* } */\n/**/\n/* /* Tablet */ */\n/* @media only screen and (min-width: 768px) and (max-width: 1023px) { */\n/* .grid-wrapper { */\n/* grid-template-columns: repeat(2, minmax(auto, 1fr)); */\n/* } */\n/* } */\n/**/\n/* /* Mobile */ */\n/* @media only screen and (max-width: 767px) { */\n/* .grid-wrapper { */\n/* grid-template-columns: minmax(auto, 1fr); */\n/* } */\n/* .navigation-pages { */\n/* display: none; */\n/* } */\n/* } */\n","import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticles } from '../../utils/utils';\nimport { NewsResponse } from '../../model/NewsResponse';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list',\n styleUrl: 'aico-news-list.css',\n scoped: true,\n})\nexport class AicoNewsList {\n private readonly pageSize = 16;\n\n @State() newsResponse?: NewsResponse;\n\n @State() pageNumber = 1;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() nextButtonText: string = 'Next';\n\n @Prop() previousButtonText: string = 'Previous';\n\n @Event() articleClicked?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.pageNumber = 1;\n\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController!.signal);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController.signal);\n }\n\n render() {\n return (\n <Host>\n <div class=\"axaxa row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4\">\n {this.newsResponse?.data.map(article => (\n <div class=\"col\">\n <aico-news-list-item\n article={article}\n onArticleClicked={e => {\n this.articleClicked?.emit(e.detail);\n }}\n />\n </div>\n ))}\n </div>\n <nav class=\"w-100\" aria-label=\"News navigation\">\n <ul class=\"pagination justify-content-center\">\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.prev ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.pageNumber > 1) {\n this.pageNumber -= 1;\n }\n\n return false;\n }}\n >\n <svg 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\">\n <path 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\" />\n </svg>\n {this.previousButtonText}\n </li>\n {this.getViewablePages().map(page => (\n <li\n class={`page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (page !== '...') {\n this.pageNumber = Number(page);\n }\n return false;\n }}\n >\n {page}\n </li>\n ))}\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.next ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.newsResponse?.meta.page.lastPage && this.pageNumber < this.newsResponse?.meta.page.lastPage) {\n this.pageNumber += 1;\n }\n }}\n >\n {this.nextButtonText}\n <svg 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\">\n <path 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\" />\n </svg>\n </li>\n </ul>\n </nav>\n </Host>\n );\n }\n\n private getViewablePages(lookAhead: number = 2) {\n const pages: string[] = [];\n if (this.pageNumber - lookAhead >= 2) {\n pages.push('1');\n }\n\n if (this.pageNumber - lookAhead > 2) {\n pages.push('...');\n }\n\n for (let i = this.pageNumber - lookAhead; i < this.pageNumber; i += 1) {\n if (i >= 1) {\n pages.push(`${i}`);\n }\n }\n\n pages.push(`${this.pageNumber}`);\n for (let i = this.pageNumber + 1; i <= this.pageNumber + lookAhead; i += 1) {\n if (i <= (this.newsResponse?.meta.page.lastPage ?? 0)) {\n pages.push(`${i}`);\n }\n }\n\n if (this.pageNumber + lookAhead < (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push('...');\n }\n\n if (this.pageNumber + lookAhead <= (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push(`${this.newsResponse?.meta.page.lastPage}`);\n }\n\n return pages;\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"aico-news-list.entry.cjs.js","mappings":";;;;;;;AAAA,MAAM,eAAe,GAAG,EAAE;;MCWb,YAAY;;;;QACN,aAAQ,GAAG,EAAE,CAAC;;0BAIT,CAAC;;;8BAMU,MAAM;kCAEF,UAAU;;IAO/C,iBAAiB;QACf,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QAEpB,IAAI,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC;KACzE;IAED,oBAAoB;QAClB,IAAI,CAAC,uBAAwB,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;KACrD;IAED,MAAM,iBAAiB;QACrB,IAAI,CAAC,YAAY,GAAG,MAAMA,uBAAiB,CAAC,IAAI,CAAC,GAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,uBAAwB,CAAC,MAAM,CAAC,CAAC;KAC9H;IAED,MAAM,mBAAmB;QACvB,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAe,EAAE,CAAC;QACrD,IAAI,CAAC,YAAY,GAAG,MAAMA,uBAAiB,CAAC,IAAI,CAAC,GAAI,E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CAAC;SACxD;QAED,OAAO,KAAK,CAAC;KACd;;;;;;","names":["fetchNewsArticles","h","Host"],"sources":["src/components/aico-news-list/aico-news-list.css?tag=aico-news-list&encapsulation=scoped","src/components/aico-news-list/aico-news-list.tsx"],"sourcesContent":["","import { Component, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core';\nimport { fetchNewsArticles } from '../../utils/utils';\nimport { NewsResponse } from '../../model/NewsResponse';\nimport { AicoApiRequestInfo } from '../../model/AicoApiRequestInfo';\nimport { Article } from '../../model/Article';\n\n@Component({\n tag: 'aico-news-list',\n styleUrl: 'aico-news-list.css',\n scoped: true,\n})\nexport class AicoNewsList {\n private readonly pageSize = 16;\n\n @State() newsResponse?: NewsResponse;\n\n @State() pageNumber = 1;\n\n @Prop() aicoUrl!: string;\n\n @Prop() aicoBearerToken!: string;\n\n @Prop() nextButtonText: string = 'Next';\n\n @Prop() previousButtonText: string = 'Previous';\n\n @Event() articleClick?: EventEmitter<Article>;\n\n private api?: AicoApiRequestInfo;\n private newsListFetchController?: AbortController;\n\n connectedCallback() {\n this.newsListFetchController = new AbortController();\n this.pageNumber = 1;\n\n this.api = { baseApi: this.aicoUrl, bearerToken: this.aicoBearerToken };\n }\n\n disconnectedCallback() {\n this.newsListFetchController!.abort('disconnected');\n }\n\n async componentWillLoad(): Promise<void> {\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController!.signal);\n }\n\n async componentWillUpdate(): Promise<void> {\n this.newsListFetchController = new AbortController();\n this.newsResponse = await fetchNewsArticles(this.api!, this.pageNumber, this.pageSize, this.newsListFetchController.signal);\n }\n\n render() {\n return (\n <Host>\n <div class=\"row row-cols-1 row-cols-sm-2 row-cols-lg-4 g-4 mb-4\">\n {this.newsResponse?.data.map(article => (\n <div class=\"col\">\n <aico-news-list-item\n article={article}\n onArticleClick={e => {\n this.articleClick?.emit(e.detail);\n }}\n />\n </div>\n ))}\n </div>\n <nav class=\"w-100\" aria-label=\"News navigation\">\n <ul class=\"pagination justify-content-center\">\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.prev ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.pageNumber > 1) {\n this.pageNumber -= 1;\n }\n\n return false;\n }}\n >\n <svg 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\">\n <path 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\" />\n </svg>\n {this.previousButtonText}\n </li>\n {this.getViewablePages().map(page => (\n <li\n class={`page-item page-link user-select-none ${page === '...' ? 'disabled' : Number(page) === this.pageNumber ? 'active' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (page !== '...') {\n this.pageNumber = Number(page);\n }\n return false;\n }}\n >\n {page}\n </li>\n ))}\n <li\n class={`page-item page-link user-select-none d-flex align-items-center ${!this.newsResponse?.links.next ? 'disabled' : ''}`}\n style={{ cursor: 'pointer' }}\n onClick={() => {\n if (this.newsResponse?.meta.page.lastPage && this.pageNumber < this.newsResponse?.meta.page.lastPage) {\n this.pageNumber += 1;\n }\n }}\n >\n {this.nextButtonText}\n <svg 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\">\n <path 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\" />\n </svg>\n </li>\n </ul>\n </nav>\n </Host>\n );\n }\n\n private getViewablePages(lookAhead: number = 2) {\n const pages: string[] = [];\n if (this.pageNumber - lookAhead >= 2) {\n pages.push('1');\n }\n\n if (this.pageNumber - lookAhead > 2) {\n pages.push('...');\n }\n\n for (let i = this.pageNumber - lookAhead; i < this.pageNumber; i += 1) {\n if (i >= 1) {\n pages.push(`${i}`);\n }\n }\n\n pages.push(`${this.pageNumber}`);\n for (let i = this.pageNumber + 1; i <= this.pageNumber + lookAhead; i += 1) {\n if (i <= (this.newsResponse?.meta.page.lastPage ?? 0)) {\n pages.push(`${i}`);\n }\n }\n\n if (this.pageNumber + lookAhead < (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push('...');\n }\n\n if (this.pageNumber + lookAhead <= (this.newsResponse?.meta.page.lastPage ?? 0) - 1) {\n pages.push(`${this.newsResponse?.meta.page.lastPage}`);\n }\n\n return pages;\n }\n}\n"],"version":3}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const utils = require('./utils-
|
|
5
|
+
const index = require('./index-e52034b7.js');
|
|
6
|
+
const utils = require('./utils-095ed22b.js');
|
|
7
7
|
const slick = require('./slick-d0dfbd94.js');
|
|
8
8
|
|
|
9
9
|
const aicoSpecialNewsCarouselCss = ".slick-slide.sc-aico-special-news-carousel>div.sc-aico-special-news-carousel{height:100% !important}";
|
|
@@ -39,10 +39,6 @@ let checkSlotFallbackVisibility = false;
|
|
|
39
39
|
let checkSlotRelocate = false;
|
|
40
40
|
let isSvgMode = false;
|
|
41
41
|
let queuePending = false;
|
|
42
|
-
const getAssetPath = (path) => {
|
|
43
|
-
const assetUrl = new URL(path, plt.$resourcesUrl$);
|
|
44
|
-
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
45
|
-
};
|
|
46
42
|
const createTime = (fnName, tagName = '') => {
|
|
47
43
|
{
|
|
48
44
|
return () => {
|
|
@@ -2271,10 +2267,9 @@ exports.Fragment = Fragment;
|
|
|
2271
2267
|
exports.Host = Host;
|
|
2272
2268
|
exports.bootstrapLazy = bootstrapLazy;
|
|
2273
2269
|
exports.createEvent = createEvent;
|
|
2274
|
-
exports.getAssetPath = getAssetPath;
|
|
2275
2270
|
exports.h = h;
|
|
2276
2271
|
exports.promiseResolve = promiseResolve;
|
|
2277
2272
|
exports.registerInstance = registerInstance;
|
|
2278
2273
|
exports.setNonce = setNonce;
|
|
2279
2274
|
|
|
2280
|
-
//# sourceMappingURL=index-
|
|
2275
|
+
//# sourceMappingURL=index-e52034b7.js.map
|