@everymatrix/blog-articles-grid 1.34.2 → 1.34.3

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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +1 -1
  3. package/dist/blog-articles-grid/blog-articles-grid.esm.js +0 -1
  4. package/dist/blog-articles-grid/index.esm.js +0 -0
  5. package/dist/blog-articles-grid/p-13642dde.js +0 -1
  6. package/dist/blog-articles-grid/p-430e371b.entry.js +0 -1
  7. package/dist/cjs/blog-articles-grid.cjs.js +0 -19
  8. package/dist/cjs/blog-articles-grid_2.cjs.entry.js +0 -681
  9. package/dist/cjs/index-a88a1a42.js +0 -1352
  10. package/dist/cjs/index.cjs.js +0 -2
  11. package/dist/cjs/loader.cjs.js +0 -21
  12. package/dist/collection/collection-manifest.json +0 -19
  13. package/dist/collection/components/blog-articles-grid/blog-articles-grid.css +0 -167
  14. package/dist/collection/components/blog-articles-grid/blog-articles-grid.js +0 -773
  15. package/dist/collection/index.js +0 -1
  16. package/dist/collection/utils/locale.utils.js +0 -40
  17. package/dist/collection/utils/utils.js +0 -67
  18. package/dist/components/blog-articles-grid.d.ts +0 -11
  19. package/dist/components/blog-articles-grid.js +0 -482
  20. package/dist/components/helper-pagination.js +0 -6
  21. package/dist/components/helper-pagination2.js +0 -288
  22. package/dist/components/index.d.ts +0 -26
  23. package/dist/components/index.js +0 -1
  24. package/dist/esm/blog-articles-grid.js +0 -17
  25. package/dist/esm/blog-articles-grid_2.entry.js +0 -676
  26. package/dist/esm/index-3600ba1b.js +0 -1326
  27. package/dist/esm/index.js +0 -1
  28. package/dist/esm/loader.js +0 -17
  29. package/dist/esm/polyfills/core-js.js +0 -11
  30. package/dist/esm/polyfills/css-shim.js +0 -1
  31. package/dist/esm/polyfills/dom.js +0 -79
  32. package/dist/esm/polyfills/es5-html-element.js +0 -1
  33. package/dist/esm/polyfills/index.js +0 -34
  34. package/dist/esm/polyfills/system.js +0 -6
  35. package/dist/index.cjs.js +0 -1
  36. package/dist/index.js +0 -1
  37. package/dist/stencil.config.js +0 -22
  38. package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/blog-articles-grid/.stencil/packages/blog-articles-grid/stencil.config.d.ts +0 -2
  39. package/dist/types/components/blog-articles-grid/blog-articles-grid.d.ts +0 -116
  40. package/dist/types/components.d.ts +0 -198
  41. package/dist/types/index.d.ts +0 -1
  42. package/dist/types/stencil-public-runtime.d.ts +0 -1565
  43. package/dist/types/utils/locale.utils.d.ts +0 -1
  44. package/dist/types/utils/utils.d.ts +0 -4
  45. package/loader/cdn.js +0 -3
  46. package/loader/index.cjs.js +0 -3
  47. package/loader/index.d.ts +0 -12
  48. package/loader/index.es2017.js +0 -3
  49. package/loader/index.js +0 -4
  50. package/loader/package.json +0 -10
@@ -1,288 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
-
3
- /**
4
- * @name isMobile
5
- * @description A method that returns if the browser used to access the app is from a mobile device or not
6
- * @param {String} userAgent window.navigator.userAgent
7
- * @returns {Boolean} true or false
8
- */
9
- const isMobile = (userAgent) => {
10
- return !!(userAgent.toLowerCase().match(/android/i) ||
11
- userAgent.toLowerCase().match(/blackberry|bb/i) ||
12
- userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
13
- userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
14
- };
15
-
16
- const DEFAULT_LANGUAGE = 'en';
17
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'hu', 'hr'];
18
- const TRANSLATIONS = {
19
- en: {
20
- firstPage: 'First',
21
- previousPage: 'Previous',
22
- nextPage: 'Next',
23
- lastPage: 'Last'
24
- },
25
- ro: {
26
- firstPage: 'Prima',
27
- previousPage: 'Anterior',
28
- nextPage: 'Urmatoarea',
29
- lastPage: 'Ultima'
30
- },
31
- fr: {
32
- firstPage: 'First',
33
- previousPage: 'Previous',
34
- nextPage: 'Next',
35
- lastPage: 'Last'
36
- },
37
- ar: {
38
- firstPage: 'First',
39
- previousPage: 'Previous',
40
- nextPage: 'Next',
41
- lastPage: 'Last'
42
- },
43
- hu: {
44
- firstPage: 'First',
45
- previousPage: 'Previous',
46
- nextPage: 'Következő',
47
- lastPage: 'Last'
48
- },
49
- hr: {
50
- firstPage: 'Prva',
51
- previousPage: 'Prethodna',
52
- nextPage: 'Slijedeća',
53
- lastPage: 'Zadnja'
54
- }
55
- };
56
- const translate = (key, customLang) => {
57
- const lang = customLang;
58
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
59
- };
60
-
61
- const helperPaginationCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}#PaginationContainer{width:100%;margin:20px 0;display:inline-flex;justify-content:space-between;align-items:center}.LeftItems button:not(:first-child),.RightItems button:not(:last-child){margin:0 10px}.LeftItems button,.RightItems button{padding:0;background-color:#009993;border-color:#009993}.PaginationArea{display:inline-flex;gap:10px;list-style:none}.PaginationArea li{margin:0;padding:0}.PaginationArea li button{width:24px;height:24px;display:flex;border:0;padding:0;justify-content:center;align-items:center;background-color:transparent;color:#000;cursor:pointer;pointer-events:all}.PaginationItem.ActiveItem button{background:#009993;border-color:#009993;color:#fff}.PaginationItem.ActiveItem button:disabled{pointer-events:none;cursor:not-allowed}.PaginationItem button:hover,.PaginationItem button:active{background:#009993;border-color:#009993;color:#fff;opacity:0.8}button{width:100px;height:32px;border:1px solid #524e52;border-radius:5px;background:#524e52;color:#fff;font-size:14px;font:inherit;cursor:pointer;transition:all 0.1s linear;text-transform:uppercase;text-align:center;letter-spacing:0}button:hover,button:active{background:#004D4A;border-color:#004D4A}button:disabled{background-color:#ccc;border-color:#ccc;color:#fff;cursor:not-allowed}@media screen and (max-width: 720px){button{width:90px;font-size:14px}}@media screen and (max-width: 480px){button{width:70px;font-size:14px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){button{width:58px;font-size:12px}.paginationArea{padding:5px;gap:5px}}@media (hover: none){.paginationItem button:hover{background:inherit;border-color:inherit;color:inherit;opacity:1}.paginationItem.activeItem button:hover{background:#009993;border-color:#009993;color:#fff}}";
62
-
63
- const HelperPagination = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
64
- constructor() {
65
- super();
66
- this.__registerHost();
67
- this.__attachShadow();
68
- this.hpPageChange = createEvent(this, "hpPageChange", 7);
69
- /**
70
- * Next page string value - determines if the next page is disabled or active
71
- */
72
- this.nextPage = '';
73
- /**
74
- * Previous page string value - determines if the previous page is disabled or active
75
- */
76
- this.prevPage = '';
77
- /**
78
- * The received offset
79
- */
80
- this.offset = 0;
81
- /**
82
- * The received limit for the number of pages
83
- */
84
- this.limit = 1;
85
- /**
86
- * The received total number of pages
87
- */
88
- this.total = 1;
89
- /**
90
- * Language
91
- */
92
- this.language = 'en';
93
- /**
94
- * Client custom styling via string
95
- */
96
- this.clientStyling = '';
97
- /**
98
- * Client custom styling via url content
99
- */
100
- this.clientStylingUrlContent = '';
101
- /**
102
- * Component working variable for last page
103
- */
104
- this.lastPage = false;
105
- /**
106
- * Component working variable for prvious page
107
- */
108
- this.previousPage = false;
109
- /**
110
- * In component working variable for the array of pages
111
- */
112
- this.pagesArray = [];
113
- /**
114
- * In component working variable for last page
115
- */
116
- this.endInt = 0;
117
- this.userAgent = window.navigator.userAgent;
118
- this.currentPage = 1;
119
- this.limitStylingAppends = false;
120
- /**
121
- * Navigation logic
122
- */
123
- this.navigateTo = (navigationPage) => {
124
- switch (navigationPage) {
125
- case 'firstPage':
126
- this.offsetInt = 0;
127
- break;
128
- case 'lastPage':
129
- this.offsetInt = this.endInt * this.limitInt;
130
- break;
131
- case 'previousPage':
132
- this.offsetInt -= this.limitInt;
133
- break;
134
- case 'nextPage':
135
- this.offsetInt += this.limitInt;
136
- break;
137
- case 'fivePagesBack':
138
- this.offsetInt -= this.limitInt * 5;
139
- this.offsetInt = this.offsetInt <= 0 ? 0 : this.offsetInt;
140
- break;
141
- case 'fivePagesForward':
142
- this.offsetInt += this.limitInt * 5;
143
- this.offsetInt = this.offsetInt / this.limitInt >= this.endInt ? this.endInt * this.limitInt : this.offsetInt;
144
- break;
145
- }
146
- this.previousPage = !this.offsetInt ? false : true;
147
- this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
148
- };
149
- /**
150
- * Handle navigation from here
151
- */
152
- this.paginationNavigation = (pageNumber, index) => {
153
- this.previousPage = true;
154
- if (!isNaN(pageNumber)) {
155
- if (pageNumber === 1) {
156
- this.offsetInt = pageNumber - 1;
157
- this.previousPage = false;
158
- }
159
- else {
160
- this.offsetInt = (pageNumber - 1) * this.limitInt;
161
- }
162
- }
163
- else {
164
- if (index === 0 && this.currentPage <= 4) {
165
- this.navigateTo('firstPage');
166
- }
167
- else if (index === 0 && this.currentPage > 4) {
168
- this.navigateTo('fivePagesBack');
169
- }
170
- else if (index === 4 && this.endInt - this.currentPage >= 2) {
171
- this.navigateTo('fivePagesForward');
172
- }
173
- }
174
- this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
175
- };
176
- this.setClientStyling = () => {
177
- let sheet = document.createElement('style');
178
- sheet.innerHTML = this.clientStyling;
179
- this.stylingContainer.prepend(sheet);
180
- };
181
- this.setClientStylingURL = () => {
182
- let cssFile = document.createElement('style');
183
- setTimeout(() => {
184
- cssFile.innerHTML = this.clientStylingUrlContent;
185
- this.stylingContainer.prepend(cssFile);
186
- }, 1);
187
- };
188
- }
189
- componentWillRender() {
190
- this.offsetInt = this.offset;
191
- this.limitInt = this.limit;
192
- this.currentPage = (this.offsetInt / this.limitInt) + 1;
193
- this.limitInt = this.limit;
194
- this.totalInt = this.total;
195
- this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
196
- this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
197
- /**
198
- * Construct numbered navigation area based on current page position
199
- */
200
- if (this.currentPage == 1 || this.currentPage == 2) {
201
- this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
202
- this.pagesArray.push('...');
203
- }
204
- else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
205
- this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
206
- this.pagesArray.push('...');
207
- this.pagesArray.unshift('...');
208
- }
209
- else if ((this.endInt - this.currentPage) < 3) {
210
- this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
211
- this.pagesArray.unshift('...');
212
- }
213
- }
214
- componentDidRender() {
215
- // start custom styling area
216
- if (!this.limitStylingAppends && this.stylingContainer) {
217
- if (this.clientStyling)
218
- this.setClientStyling();
219
- if (this.clientStylingUrlContent)
220
- this.setClientStylingURL();
221
- this.limitStylingAppends = true;
222
- }
223
- // end custom styling area
224
- }
225
- render() {
226
- /**
227
- * Center navigation area
228
- */
229
- let navigationArea = h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index) => {
230
- return (h("li", { class: 'PaginationItem' + (item === this.currentPage ? ' ActiveItem' : ' ') + ' ' + (isMobile(this.userAgent) ? 'MobileButtons' : '') }, h("button", { disabled: item === this.currentPage ? true : false, onClick: this.paginationNavigation.bind(this, item, index) }, h("span", null, item))));
231
- }));
232
- /**
233
- * Left navigation area
234
- */
235
- let buttonSecondaryLeftSide = h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'firstPage') }, h("span", { class: "NavigationButton" }, translate('firstPage', this.language)), h("span", { class: "NavigationIcon" }));
236
- let buttonsLeftSide = h("div", { class: "LeftItems" }, this.secondaryArrowsActive && buttonSecondaryLeftSide, h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'previousPage') }, h("span", { class: "NavigationButton" }, translate('previousPage', this.language)), h("span", { class: "NavigationIcon" })));
237
- if (isMobile(this.userAgent)) {
238
- buttonsLeftSide =
239
- h("div", { class: "LeftItems" }, h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'previousPage') }, h("span", { class: "NavigationButton" }, translate('previousPage', this.language)), h("span", { class: "NavigationIcon" })));
240
- }
241
- /**
242
- * Right navigation area
243
- */
244
- let buttonSecondaryRightSide = h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'lastPage') }, h("span", { class: "NavigationButton" }, translate('lastPage', this.language)), h("span", { class: "NavigationIcon" }));
245
- let buttonsRightSide = h("div", { class: "RightItems" }, h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'nextPage') }, h("span", { class: "NavigationButton" }, translate('nextPage', this.language)), h("span", { class: "NavigationIcon" })), this.secondaryArrowsActive && buttonSecondaryRightSide);
246
- if (isMobile(this.userAgent)) {
247
- buttonsRightSide =
248
- h("div", { class: "RightItems" }, h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'nextPage') }, h("span", { class: "NavigationButton" }, translate('nextPage', this.language)), h("span", { class: "NavigationIcon" })));
249
- }
250
- return (h("div", { id: "PaginationContainer", ref: el => this.stylingContainer = el }, this.arrowsActive && buttonsLeftSide, this.numberedNavActive && navigationArea, this.arrowsActive && buttonsRightSide));
251
- }
252
- static get style() { return helperPaginationCss; }
253
- }, [1, "helper-pagination", {
254
- "nextPage": [1537, "next-page"],
255
- "prevPage": [1537, "prev-page"],
256
- "offset": [1538],
257
- "limit": [1538],
258
- "total": [1538],
259
- "language": [1537],
260
- "clientStyling": [1537, "client-styling"],
261
- "clientStylingUrlContent": [1537, "client-styling-url-content"],
262
- "arrowsActive": [1540, "arrows-active"],
263
- "secondaryArrowsActive": [1540, "secondary-arrows-active"],
264
- "numberedNavActive": [1540, "numbered-nav-active"],
265
- "offsetInt": [32],
266
- "lastPage": [32],
267
- "previousPage": [32],
268
- "limitInt": [32],
269
- "totalInt": [32],
270
- "pagesArray": [32],
271
- "endInt": [32],
272
- "limitStylingAppends": [32]
273
- }]);
274
- function defineCustomElement() {
275
- if (typeof customElements === "undefined") {
276
- return;
277
- }
278
- const components = ["helper-pagination"];
279
- components.forEach(tagName => { switch (tagName) {
280
- case "helper-pagination":
281
- if (!customElements.get(tagName)) {
282
- customElements.define(tagName, HelperPagination);
283
- }
284
- break;
285
- } });
286
- }
287
-
288
- export { HelperPagination as H, defineCustomElement as d };
@@ -1,26 +0,0 @@
1
- /* BlogArticlesGrid custom elements */
2
-
3
- import type { Components, JSX } from "../types/components";
4
-
5
- /**
6
- * Used to manually set the base path where assets can be found.
7
- * If the script is used as "module", it's recommended to use "import.meta.url",
8
- * such as "setAssetPath(import.meta.url)". Other options include
9
- * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
10
- * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
11
- * But do note that this configuration depends on how your script is bundled, or lack of
12
- * bundling, and where your assets can be loaded from. Additionally custom bundling
13
- * will have to ensure the static assets are copied to its build directory.
14
- */
15
- export declare const setAssetPath: (path: string) => void;
16
-
17
- export interface SetPlatformOptions {
18
- raf?: (c: FrameRequestCallback) => number;
19
- ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
20
- rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
21
- }
22
- export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
23
-
24
- export type { Components, JSX };
25
-
26
- export * from '../types';
@@ -1 +0,0 @@
1
- export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
@@ -1,17 +0,0 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-3600ba1b.js';
2
-
3
- /*
4
- Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
5
- */
6
- const patchBrowser = () => {
7
- const importMeta = import.meta.url;
8
- const opts = {};
9
- if (importMeta !== '') {
10
- opts.resourcesUrl = new URL('.', importMeta).href;
11
- }
12
- return promiseResolve(opts);
13
- };
14
-
15
- patchBrowser().then(options => {
16
- return bootstrapLazy([["blog-articles-grid_2",[[1,"blog-articles-grid",{"cmsEndpoint":[513,"cms-endpoint"],"language":[513],"userRoles":[513,"user-roles"],"cmsEnv":[513,"cms-env"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"showPublishingDate":[516,"show-publishing-date"],"showImage":[516,"show-image"],"showTitle":[516,"show-title"],"showContent":[516,"show-content"],"showButton":[516,"show-button"],"usePostmessage":[516,"use-postmessage"],"postMessageEvent":[513,"post-message-event"],"blogsLimit":[513,"blogs-limit"],"paginationActive":[516,"pagination-active"],"arrowsActive":[516,"arrows-active"],"secondaryArrowsActive":[516,"secondary-arrows-active"],"numberedNavActive":[516,"numbered-nav-active"],"intlDateTimeFormat":[513,"intl-date-time-format"],"page":[513],"paginationBlogList":[32],"currentPage":[32],"hasErrors":[32],"limitStylingAppends":[32],"isLoading":[32],"bannerMatrixReady":[32],"nextPage":[32],"previousPage":[32],"device":[32],"blogData":[32],"totalBlogs":[32]},[[8,"BannerMatrixReady","handleBannerReady"],[0,"hpPageChange","hpPageChange"]]],[1,"helper-pagination",{"nextPage":[1537,"next-page"],"prevPage":[1537,"prev-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1537],"clientStyling":[1537,"client-styling"],"clientStylingUrlContent":[1537,"client-styling-url-content"],"arrowsActive":[1540,"arrows-active"],"secondaryArrowsActive":[1540,"secondary-arrows-active"],"numberedNavActive":[1540,"numbered-nav-active"],"offsetInt":[32],"lastPage":[32],"previousPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32],"limitStylingAppends":[32]}]]]], options);
17
- });