@everymatrix/helper-pagination 1.55.0 → 1.56.0

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 (26) hide show
  1. package/dist/cjs/helper-pagination.cjs.entry.js +135 -41
  2. package/dist/cjs/helper-pagination.cjs.js +3 -3
  3. package/dist/cjs/{index-502d881b.js → index-5d7ac0d5.js} +203 -71
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/collection/collection-manifest.json +1 -1
  6. package/dist/collection/components/helper-pagination/helper-pagination.js +127 -44
  7. package/dist/esm/helper-pagination.entry.js +135 -41
  8. package/dist/esm/helper-pagination.js +4 -4
  9. package/dist/esm/{index-79ce7f1f.js → index-49bd7818.js} +203 -71
  10. package/dist/esm/loader.js +3 -3
  11. package/dist/helper-pagination/helper-pagination.esm.js +1 -1
  12. package/dist/helper-pagination/p-645aa72c.entry.js +1 -0
  13. package/dist/helper-pagination/p-d28f6456.js +2 -0
  14. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/helper-pagination/.stencil/packages/stencil/helper-pagination/stencil.config.d.ts +2 -0
  15. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/helper-pagination/.stencil/packages/stencil/helper-pagination/stencil.config.dev.d.ts +2 -0
  16. package/dist/types/components/helper-pagination/helper-pagination.d.ts +10 -5
  17. package/dist/types/components.d.ts +10 -2
  18. package/package.json +1 -1
  19. package/dist/helper-pagination/p-a3272d7a.entry.js +0 -1
  20. package/dist/helper-pagination/p-ddd49f2d.js +0 -2
  21. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/helper-pagination/.stencil/packages/stencil/helper-pagination/stencil.config.d.ts +0 -2
  22. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/helper-pagination/.stencil/packages/stencil/helper-pagination/stencil.config.dev.d.ts +0 -2
  23. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/helper-pagination/.stencil/tools/plugins/index.d.ts +0 -0
  24. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/helper-pagination/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  25. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/helper-pagination/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  26. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/helper-pagination/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -1,8 +1,57 @@
1
1
  import { h } from "@stencil/core";
2
+ import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
2
3
  import { isMobile } from "../../utils/utils";
3
4
  import { translate } from "../../utils/locale.utils";
4
5
  export class HelperPagination {
5
6
  constructor() {
7
+ /**
8
+ * Next page string value - determines if the next page is disabled or active
9
+ */
10
+ this.nextPage = '';
11
+ /**
12
+ * Previous page string value - determines if the previous page is disabled or active
13
+ */
14
+ this.prevPage = '';
15
+ /**
16
+ * The received offset
17
+ */
18
+ this.offset = 0;
19
+ /**
20
+ * The received limit for the number of pages
21
+ */
22
+ this.limit = 1;
23
+ /**
24
+ * The received total number of pages
25
+ */
26
+ this.total = 1;
27
+ /**
28
+ * Language
29
+ */
30
+ this.language = 'en';
31
+ /**
32
+ * Client custom styling via string
33
+ */
34
+ this.clientStyling = '';
35
+ /**
36
+ * Client custom styling via url content
37
+ */
38
+ this.clientStylingUrl = '';
39
+ /**
40
+ * Component working variable for last page
41
+ */
42
+ this.lastPage = false;
43
+ /**
44
+ * Component working variable for prvious page
45
+ */
46
+ this.previousPage = false;
47
+ /**
48
+ * In component working variable for the array of pages
49
+ */
50
+ this.pagesArray = [];
51
+ /**
52
+ * In component working variable for last page
53
+ */
54
+ this.endInt = 0;
6
55
  this.userAgent = window.navigator.userAgent;
7
56
  this.currentPage = 1;
8
57
  /**
@@ -61,37 +110,17 @@ export class HelperPagination {
61
110
  }
62
111
  this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
63
112
  };
64
- this.setClientStyling = () => {
65
- let sheet = document.createElement('style');
66
- sheet.innerHTML = this.clientStyling;
67
- this.stylingContainer.prepend(sheet);
68
- };
69
- this.setClientStylingURL = () => {
70
- let cssFile = document.createElement('style');
71
- setTimeout(() => {
72
- cssFile.innerHTML = this.clientStylingUrlContent;
73
- this.stylingContainer.prepend(cssFile);
74
- }, 1);
75
- };
76
- this.nextPage = '';
77
- this.prevPage = '';
78
- this.offset = 0;
79
- this.limit = 1;
80
- this.total = 1;
81
- this.language = 'en';
82
- this.clientStyling = '';
83
- this.clientStylingUrlContent = '';
84
- this.arrowsActive = undefined;
85
- this.secondaryArrowsActive = undefined;
86
- this.numberedNavActive = undefined;
87
- this.offsetInt = undefined;
88
- this.lastPage = false;
89
- this.previousPage = false;
90
- this.limitInt = undefined;
91
- this.totalInt = undefined;
92
- this.pagesArray = [];
93
- this.endInt = 0;
94
- this.limitStylingAppends = false;
113
+ }
114
+ handleClientStylingChange(newValue, oldValue) {
115
+ if (newValue != oldValue) {
116
+ setClientStyling(this.stylingContainer, this.clientStyling);
117
+ }
118
+ }
119
+ handleClientStylingChangeURL(newValue, oldValue) {
120
+ if (newValue != oldValue) {
121
+ if (this.clientStylingUrl)
122
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
123
+ }
95
124
  }
96
125
  componentWillRender() {
97
126
  this.offsetInt = this.offset;
@@ -118,16 +147,21 @@ export class HelperPagination {
118
147
  this.pagesArray.unshift('...');
119
148
  }
120
149
  }
121
- componentDidRender() {
122
- // start custom styling area
123
- if (!this.limitStylingAppends && this.stylingContainer) {
124
- if (this.clientStyling)
125
- this.setClientStyling();
126
- if (this.clientStylingUrlContent)
127
- this.setClientStylingURL();
128
- this.limitStylingAppends = true;
150
+ componentDidLoad() {
151
+ if (this.stylingContainer) {
152
+ if (window.emMessageBus != undefined) {
153
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
154
+ }
155
+ else {
156
+ if (this.clientStyling)
157
+ setClientStyling(this.stylingContainer, this.clientStyling);
158
+ if (this.clientStylingUrl)
159
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
160
+ }
129
161
  }
130
- // end custom styling area
162
+ }
163
+ disconnectedCallback() {
164
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
131
165
  }
132
166
  render() {
133
167
  /**
@@ -184,6 +218,8 @@ export class HelperPagination {
184
218
  "tags": [],
185
219
  "text": "Next page string value - determines if the next page is disabled or active"
186
220
  },
221
+ "getter": false,
222
+ "setter": false,
187
223
  "attribute": "next-page",
188
224
  "reflect": true,
189
225
  "defaultValue": "''"
@@ -202,6 +238,8 @@ export class HelperPagination {
202
238
  "tags": [],
203
239
  "text": "Previous page string value - determines if the previous page is disabled or active"
204
240
  },
241
+ "getter": false,
242
+ "setter": false,
205
243
  "attribute": "prev-page",
206
244
  "reflect": true,
207
245
  "defaultValue": "''"
@@ -220,6 +258,8 @@ export class HelperPagination {
220
258
  "tags": [],
221
259
  "text": "The received offset"
222
260
  },
261
+ "getter": false,
262
+ "setter": false,
223
263
  "attribute": "offset",
224
264
  "reflect": true,
225
265
  "defaultValue": "0"
@@ -238,6 +278,8 @@ export class HelperPagination {
238
278
  "tags": [],
239
279
  "text": "The received limit for the number of pages"
240
280
  },
281
+ "getter": false,
282
+ "setter": false,
241
283
  "attribute": "limit",
242
284
  "reflect": true,
243
285
  "defaultValue": "1"
@@ -256,6 +298,8 @@ export class HelperPagination {
256
298
  "tags": [],
257
299
  "text": "The received total number of pages"
258
300
  },
301
+ "getter": false,
302
+ "setter": false,
259
303
  "attribute": "total",
260
304
  "reflect": true,
261
305
  "defaultValue": "1"
@@ -274,10 +318,31 @@ export class HelperPagination {
274
318
  "tags": [],
275
319
  "text": "Language"
276
320
  },
321
+ "getter": false,
322
+ "setter": false,
277
323
  "attribute": "language",
278
324
  "reflect": true,
279
325
  "defaultValue": "'en'"
280
326
  },
327
+ "mbSource": {
328
+ "type": "string",
329
+ "mutable": false,
330
+ "complexType": {
331
+ "original": "string",
332
+ "resolved": "string",
333
+ "references": {}
334
+ },
335
+ "required": false,
336
+ "optional": false,
337
+ "docs": {
338
+ "tags": [],
339
+ "text": "Client custom styling via streamStyling"
340
+ },
341
+ "getter": false,
342
+ "setter": false,
343
+ "attribute": "mb-source",
344
+ "reflect": false
345
+ },
281
346
  "clientStyling": {
282
347
  "type": "string",
283
348
  "mutable": true,
@@ -292,11 +357,13 @@ export class HelperPagination {
292
357
  "tags": [],
293
358
  "text": "Client custom styling via string"
294
359
  },
360
+ "getter": false,
361
+ "setter": false,
295
362
  "attribute": "client-styling",
296
363
  "reflect": true,
297
364
  "defaultValue": "''"
298
365
  },
299
- "clientStylingUrlContent": {
366
+ "clientStylingUrl": {
300
367
  "type": "string",
301
368
  "mutable": true,
302
369
  "complexType": {
@@ -310,7 +377,9 @@ export class HelperPagination {
310
377
  "tags": [],
311
378
  "text": "Client custom styling via url content"
312
379
  },
313
- "attribute": "client-styling-url-content",
380
+ "getter": false,
381
+ "setter": false,
382
+ "attribute": "client-styling-url",
314
383
  "reflect": true,
315
384
  "defaultValue": "''"
316
385
  },
@@ -328,6 +397,8 @@ export class HelperPagination {
328
397
  "tags": [],
329
398
  "text": "Customize pagination: Activate pagination arrows"
330
399
  },
400
+ "getter": false,
401
+ "setter": false,
331
402
  "attribute": "arrows-active",
332
403
  "reflect": true
333
404
  },
@@ -345,6 +416,8 @@ export class HelperPagination {
345
416
  "tags": [],
346
417
  "text": "Customize pagination: Activate pagination secondary arrows"
347
418
  },
419
+ "getter": false,
420
+ "setter": false,
348
421
  "attribute": "secondary-arrows-active",
349
422
  "reflect": true
350
423
  },
@@ -362,6 +435,8 @@ export class HelperPagination {
362
435
  "tags": [],
363
436
  "text": "Customize pagination: Activate pagination numbered navigation"
364
437
  },
438
+ "getter": false,
439
+ "setter": false,
365
440
  "attribute": "numbered-nav-active",
366
441
  "reflect": true
367
442
  }
@@ -375,8 +450,7 @@ export class HelperPagination {
375
450
  "limitInt": {},
376
451
  "totalInt": {},
377
452
  "pagesArray": {},
378
- "endInt": {},
379
- "limitStylingAppends": {}
453
+ "endInt": {}
380
454
  };
381
455
  }
382
456
  static get events() {
@@ -397,4 +471,13 @@ export class HelperPagination {
397
471
  }
398
472
  }];
399
473
  }
474
+ static get watchers() {
475
+ return [{
476
+ "propName": "clientStyling",
477
+ "methodName": "handleClientStylingChange"
478
+ }, {
479
+ "propName": "clientStylingUrl",
480
+ "methodName": "handleClientStylingChangeURL"
481
+ }];
482
+ }
400
483
  }
@@ -1,4 +1,61 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-79ce7f1f.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-49bd7818.js';
2
+
3
+ /**
4
+ * @name setClientStyling
5
+ * @description Method used to create and append to the passed element of the widget a style element with the content received
6
+ * @param {HTMLElement} stylingContainer The reference element of the widget
7
+ * @param {string} clientStyling The style content
8
+ */
9
+ function setClientStyling(stylingContainer, clientStyling) {
10
+ if (stylingContainer) {
11
+ const sheet = document.createElement('style');
12
+ sheet.innerHTML = clientStyling;
13
+ stylingContainer.appendChild(sheet);
14
+ }
15
+ }
16
+
17
+ /**
18
+ * @name setClientStylingURL
19
+ * @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
20
+ * @param {HTMLElement} stylingContainer The reference element of the widget
21
+ * @param {string} clientStylingUrl The URL of the style content
22
+ */
23
+ function setClientStylingURL(stylingContainer, clientStylingUrl) {
24
+ const url = new URL(clientStylingUrl);
25
+
26
+ fetch(url.href)
27
+ .then((res) => res.text())
28
+ .then((data) => {
29
+ const cssFile = document.createElement('style');
30
+ cssFile.innerHTML = data;
31
+ if (stylingContainer) {
32
+ stylingContainer.appendChild(cssFile);
33
+ }
34
+ })
35
+ .catch((err) => {
36
+ console.error('There was an error while trying to load client styling from URL', err);
37
+ });
38
+ }
39
+
40
+ /**
41
+ * @name setStreamLibrary
42
+ * @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
43
+ * @param {HTMLElement} stylingContainer The highest element of the widget
44
+ * @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
45
+ * @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
46
+ */
47
+ function setStreamStyling(stylingContainer, domain, subscription) {
48
+ if (window.emMessageBus) {
49
+ const sheet = document.createElement('style');
50
+
51
+ window.emMessageBus.subscribe(domain, (data) => {
52
+ sheet.innerHTML = data;
53
+ if (stylingContainer) {
54
+ stylingContainer.appendChild(sheet);
55
+ }
56
+ });
57
+ }
58
+ }
2
59
 
3
60
  /**
4
61
  * @name isMobile
@@ -64,6 +121,54 @@ const HelperPagination = class {
64
121
  constructor(hostRef) {
65
122
  registerInstance(this, hostRef);
66
123
  this.hpPageChange = createEvent(this, "hpPageChange", 7);
124
+ /**
125
+ * Next page string value - determines if the next page is disabled or active
126
+ */
127
+ this.nextPage = '';
128
+ /**
129
+ * Previous page string value - determines if the previous page is disabled or active
130
+ */
131
+ this.prevPage = '';
132
+ /**
133
+ * The received offset
134
+ */
135
+ this.offset = 0;
136
+ /**
137
+ * The received limit for the number of pages
138
+ */
139
+ this.limit = 1;
140
+ /**
141
+ * The received total number of pages
142
+ */
143
+ this.total = 1;
144
+ /**
145
+ * Language
146
+ */
147
+ this.language = 'en';
148
+ /**
149
+ * Client custom styling via string
150
+ */
151
+ this.clientStyling = '';
152
+ /**
153
+ * Client custom styling via url content
154
+ */
155
+ this.clientStylingUrl = '';
156
+ /**
157
+ * Component working variable for last page
158
+ */
159
+ this.lastPage = false;
160
+ /**
161
+ * Component working variable for prvious page
162
+ */
163
+ this.previousPage = false;
164
+ /**
165
+ * In component working variable for the array of pages
166
+ */
167
+ this.pagesArray = [];
168
+ /**
169
+ * In component working variable for last page
170
+ */
171
+ this.endInt = 0;
67
172
  this.userAgent = window.navigator.userAgent;
68
173
  this.currentPage = 1;
69
174
  /**
@@ -122,37 +227,17 @@ const HelperPagination = class {
122
227
  }
123
228
  this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
124
229
  };
125
- this.setClientStyling = () => {
126
- let sheet = document.createElement('style');
127
- sheet.innerHTML = this.clientStyling;
128
- this.stylingContainer.prepend(sheet);
129
- };
130
- this.setClientStylingURL = () => {
131
- let cssFile = document.createElement('style');
132
- setTimeout(() => {
133
- cssFile.innerHTML = this.clientStylingUrlContent;
134
- this.stylingContainer.prepend(cssFile);
135
- }, 1);
136
- };
137
- this.nextPage = '';
138
- this.prevPage = '';
139
- this.offset = 0;
140
- this.limit = 1;
141
- this.total = 1;
142
- this.language = 'en';
143
- this.clientStyling = '';
144
- this.clientStylingUrlContent = '';
145
- this.arrowsActive = undefined;
146
- this.secondaryArrowsActive = undefined;
147
- this.numberedNavActive = undefined;
148
- this.offsetInt = undefined;
149
- this.lastPage = false;
150
- this.previousPage = false;
151
- this.limitInt = undefined;
152
- this.totalInt = undefined;
153
- this.pagesArray = [];
154
- this.endInt = 0;
155
- this.limitStylingAppends = false;
230
+ }
231
+ handleClientStylingChange(newValue, oldValue) {
232
+ if (newValue != oldValue) {
233
+ setClientStyling(this.stylingContainer, this.clientStyling);
234
+ }
235
+ }
236
+ handleClientStylingChangeURL(newValue, oldValue) {
237
+ if (newValue != oldValue) {
238
+ if (this.clientStylingUrl)
239
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
240
+ }
156
241
  }
157
242
  componentWillRender() {
158
243
  this.offsetInt = this.offset;
@@ -179,16 +264,21 @@ const HelperPagination = class {
179
264
  this.pagesArray.unshift('...');
180
265
  }
181
266
  }
182
- componentDidRender() {
183
- // start custom styling area
184
- if (!this.limitStylingAppends && this.stylingContainer) {
185
- if (this.clientStyling)
186
- this.setClientStyling();
187
- if (this.clientStylingUrlContent)
188
- this.setClientStylingURL();
189
- this.limitStylingAppends = true;
267
+ componentDidLoad() {
268
+ if (this.stylingContainer) {
269
+ if (window.emMessageBus != undefined) {
270
+ setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
271
+ }
272
+ else {
273
+ if (this.clientStyling)
274
+ setClientStyling(this.stylingContainer, this.clientStyling);
275
+ if (this.clientStylingUrl)
276
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
277
+ }
190
278
  }
191
- // end custom styling area
279
+ }
280
+ disconnectedCallback() {
281
+ this.stylingSubscription && this.stylingSubscription.unsubscribe();
192
282
  }
193
283
  render() {
194
284
  /**
@@ -217,6 +307,10 @@ const HelperPagination = class {
217
307
  }
218
308
  return (h("div", { id: "PaginationContainer", ref: el => this.stylingContainer = el }, this.arrowsActive && buttonsLeftSide, this.numberedNavActive && navigationArea, this.arrowsActive && buttonsRightSide));
219
309
  }
310
+ static get watchers() { return {
311
+ "clientStyling": ["handleClientStylingChange"],
312
+ "clientStylingUrl": ["handleClientStylingChangeURL"]
313
+ }; }
220
314
  };
221
315
  HelperPagination.style = HelperPaginationStyle0;
222
316
 
@@ -1,9 +1,9 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-79ce7f1f.js';
2
- export { s as setNonce } from './index-79ce7f1f.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-49bd7818.js';
2
+ export { s as setNonce } from './index-49bd7818.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.26.0 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
  var patchBrowser = () => {
9
9
  const importMeta = import.meta.url;
@@ -16,5 +16,5 @@ var patchBrowser = () => {
16
16
 
17
17
  patchBrowser().then(async (options) => {
18
18
  await globalScripts();
19
- return bootstrapLazy([["helper-pagination",[[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);
19
+ return bootstrapLazy([["helper-pagination",[[1,"helper-pagination",{"nextPage":[1537,"next-page"],"prevPage":[1537,"prev-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1537],"mbSource":[1,"mb-source"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[1537,"client-styling-url"],"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]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
20
20
  });