@everymatrix/helper-pagination 1.32.4 → 1.33.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 (48) hide show
  1. package/dist/cjs/helper-pagination.cjs.entry.js +257 -0
  2. package/dist/cjs/helper-pagination.cjs.js +19 -0
  3. package/dist/cjs/index-7c071a78.js +1185 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader.cjs.js +21 -0
  6. package/dist/collection/collection-manifest.json +12 -0
  7. package/dist/collection/components/helper-pagination/helper-pagination.css +139 -0
  8. package/dist/collection/components/helper-pagination/helper-pagination.js +443 -0
  9. package/dist/collection/index.js +1 -0
  10. package/dist/collection/utils/locale.utils.js +44 -0
  11. package/dist/collection/utils/utils.js +15 -0
  12. package/dist/components/helper-pagination.d.ts +11 -0
  13. package/dist/components/helper-pagination.js +291 -0
  14. package/dist/components/index.d.ts +26 -0
  15. package/dist/components/index.js +1 -0
  16. package/dist/esm/helper-pagination.entry.js +253 -0
  17. package/dist/esm/helper-pagination.js +17 -0
  18. package/dist/esm/index-b281577e.js +1159 -0
  19. package/dist/esm/index.js +1 -0
  20. package/dist/esm/loader.js +17 -0
  21. package/dist/esm/polyfills/core-js.js +11 -0
  22. package/dist/esm/polyfills/css-shim.js +1 -0
  23. package/dist/esm/polyfills/dom.js +79 -0
  24. package/dist/esm/polyfills/es5-html-element.js +1 -0
  25. package/dist/esm/polyfills/index.js +34 -0
  26. package/dist/esm/polyfills/system.js +6 -0
  27. package/dist/helper-pagination/helper-pagination.esm.js +1 -0
  28. package/dist/helper-pagination/index.esm.js +0 -0
  29. package/dist/helper-pagination/p-ea9ded6d.entry.js +1 -0
  30. package/dist/helper-pagination/p-eab215a1.js +1 -0
  31. package/dist/index.cjs.js +1 -0
  32. package/dist/index.js +1 -0
  33. package/dist/stencil.config.js +22 -0
  34. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/helper-pagination/.stencil/packages/helper-pagination/stencil.config.d.ts +2 -0
  35. package/dist/types/components/helper-pagination/helper-pagination.d.ts +96 -0
  36. package/dist/types/components.d.ts +129 -0
  37. package/dist/types/index.d.ts +1 -0
  38. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  39. package/dist/types/utils/locale.utils.d.ts +1 -0
  40. package/dist/types/utils/utils.d.ts +8 -0
  41. package/loader/cdn.js +3 -0
  42. package/loader/index.cjs.js +3 -0
  43. package/loader/index.d.ts +12 -0
  44. package/loader/index.es2017.js +3 -0
  45. package/loader/index.js +4 -0
  46. package/loader/package.json +10 -0
  47. package/package.json +2 -3
  48. package/LICENSE +0 -21
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-7c071a78.js');
6
+
7
+ /*
8
+ Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
9
+ */
10
+ const patchEsm = () => {
11
+ return index.promiseResolve();
12
+ };
13
+
14
+ const defineCustomElements = (win, options) => {
15
+ if (typeof window === 'undefined') return Promise.resolve();
16
+ return patchEsm().then(() => {
17
+ return index.bootstrapLazy([["helper-pagination.cjs",[[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);
18
+ });
19
+ };
20
+
21
+ exports.defineCustomElements = defineCustomElements;
@@ -0,0 +1,12 @@
1
+ {
2
+ "entries": [
3
+ "./components/helper-pagination/helper-pagination.js"
4
+ ],
5
+ "compiler": {
6
+ "name": "@stencil/core",
7
+ "version": "2.15.2",
8
+ "typescriptVersion": "4.5.4"
9
+ },
10
+ "collections": [],
11
+ "bundles": []
12
+ }
@@ -0,0 +1,139 @@
1
+ @import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");
2
+ :host {
3
+ display: block;
4
+ font-family: "Roboto", sans-serif;
5
+ }
6
+
7
+ #PaginationContainer {
8
+ width: 100%;
9
+ margin: 20px 0;
10
+ display: inline-flex;
11
+ justify-content: space-between;
12
+ align-items: center;
13
+ }
14
+
15
+ .LeftItems button:not(:first-child), .RightItems button:not(:last-child) {
16
+ margin: 0 10px;
17
+ }
18
+
19
+ .LeftItems button, .RightItems button {
20
+ padding: 0;
21
+ background-color: #009993;
22
+ border-color: #009993;
23
+ }
24
+
25
+ .PaginationArea {
26
+ display: inline-flex;
27
+ gap: 10px;
28
+ list-style: none;
29
+ }
30
+
31
+ .PaginationArea li {
32
+ margin: 0;
33
+ padding: 0;
34
+ }
35
+
36
+ .PaginationArea li button {
37
+ width: 24px;
38
+ height: 24px;
39
+ display: flex;
40
+ border: 0;
41
+ padding: 0;
42
+ justify-content: center;
43
+ align-items: center;
44
+ background-color: transparent;
45
+ color: #000;
46
+ cursor: pointer;
47
+ pointer-events: all;
48
+ }
49
+
50
+ .PaginationItem.ActiveItem button {
51
+ background: #009993;
52
+ border-color: #009993;
53
+ color: #fff;
54
+ }
55
+
56
+ .PaginationItem.ActiveItem button:disabled {
57
+ pointer-events: none;
58
+ cursor: not-allowed;
59
+ }
60
+
61
+ .PaginationItem button:hover,
62
+ .PaginationItem button:active {
63
+ background: #009993;
64
+ border-color: #009993;
65
+ color: #fff;
66
+ opacity: 0.8;
67
+ }
68
+
69
+ button {
70
+ width: 100px;
71
+ height: 32px;
72
+ border: 1px solid #524e52;
73
+ border-radius: 5px;
74
+ background: #524e52;
75
+ color: #fff;
76
+ font-size: 14px;
77
+ font: inherit;
78
+ cursor: pointer;
79
+ transition: all 0.1s linear;
80
+ text-transform: uppercase;
81
+ text-align: center;
82
+ letter-spacing: 0;
83
+ }
84
+
85
+ button:hover,
86
+ button:active {
87
+ background: #004D4A;
88
+ border-color: #004D4A;
89
+ }
90
+
91
+ button:disabled {
92
+ background-color: #ccc;
93
+ border-color: #ccc;
94
+ color: #fff;
95
+ cursor: not-allowed;
96
+ }
97
+
98
+ @media screen and (max-width: 720px) {
99
+ button {
100
+ width: 90px;
101
+ font-size: 14px;
102
+ }
103
+ }
104
+ @media screen and (max-width: 480px) {
105
+ button {
106
+ width: 70px;
107
+ font-size: 14px;
108
+ }
109
+
110
+ .paginationArea {
111
+ padding: 5px;
112
+ }
113
+ }
114
+ @media screen and (max-width: 320px) {
115
+ button {
116
+ width: 58px;
117
+ font-size: 12px;
118
+ }
119
+
120
+ .paginationArea {
121
+ padding: 5px;
122
+ gap: 5px;
123
+ }
124
+ }
125
+ /* fix for issue on hover/visited for mobile devices */
126
+ @media (hover: none) {
127
+ .paginationItem button:hover {
128
+ background: inherit;
129
+ border-color: inherit;
130
+ color: inherit;
131
+ opacity: 1;
132
+ }
133
+
134
+ .paginationItem.activeItem button:hover {
135
+ background: #009993;
136
+ border-color: #009993;
137
+ color: #fff;
138
+ }
139
+ }
@@ -0,0 +1,443 @@
1
+ import { Component, h, Event, Prop, State } from '@stencil/core';
2
+ import { isMobile } from "../../utils/utils";
3
+ import { translate } from '../../utils/locale.utils';
4
+ export class HelperPagination {
5
+ constructor() {
6
+ /**
7
+ * Next page string value - determines if the next page is disabled or active
8
+ */
9
+ this.nextPage = '';
10
+ /**
11
+ * Previous page string value - determines if the previous page is disabled or active
12
+ */
13
+ this.prevPage = '';
14
+ /**
15
+ * The received offset
16
+ */
17
+ this.offset = 0;
18
+ /**
19
+ * The received limit for the number of pages
20
+ */
21
+ this.limit = 1;
22
+ /**
23
+ * The received total number of pages
24
+ */
25
+ this.total = 1;
26
+ /**
27
+ * Language
28
+ */
29
+ this.language = 'en';
30
+ /**
31
+ * Client custom styling via string
32
+ */
33
+ this.clientStyling = '';
34
+ /**
35
+ * Client custom styling via url content
36
+ */
37
+ this.clientStylingUrlContent = '';
38
+ /**
39
+ * Component working variable for last page
40
+ */
41
+ this.lastPage = false;
42
+ /**
43
+ * Component working variable for prvious page
44
+ */
45
+ this.previousPage = false;
46
+ /**
47
+ * In component working variable for the array of pages
48
+ */
49
+ this.pagesArray = [];
50
+ /**
51
+ * In component working variable for last page
52
+ */
53
+ this.endInt = 0;
54
+ this.userAgent = window.navigator.userAgent;
55
+ this.currentPage = 1;
56
+ this.limitStylingAppends = false;
57
+ /**
58
+ * Navigation logic
59
+ */
60
+ this.navigateTo = (navigationPage) => {
61
+ switch (navigationPage) {
62
+ case 'firstPage':
63
+ this.offsetInt = 0;
64
+ break;
65
+ case 'lastPage':
66
+ this.offsetInt = this.endInt * this.limitInt;
67
+ break;
68
+ case 'previousPage':
69
+ this.offsetInt -= this.limitInt;
70
+ break;
71
+ case 'nextPage':
72
+ this.offsetInt += this.limitInt;
73
+ break;
74
+ case 'fivePagesBack':
75
+ this.offsetInt -= this.limitInt * 5;
76
+ this.offsetInt = this.offsetInt <= 0 ? 0 : this.offsetInt;
77
+ break;
78
+ case 'fivePagesForward':
79
+ this.offsetInt += this.limitInt * 5;
80
+ this.offsetInt = this.offsetInt / this.limitInt >= this.endInt ? this.endInt * this.limitInt : this.offsetInt;
81
+ break;
82
+ }
83
+ this.previousPage = !this.offsetInt ? false : true;
84
+ this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
85
+ };
86
+ /**
87
+ * Handle navigation from here
88
+ */
89
+ this.paginationNavigation = (pageNumber, index) => {
90
+ this.previousPage = true;
91
+ if (!isNaN(pageNumber)) {
92
+ if (pageNumber === 1) {
93
+ this.offsetInt = pageNumber - 1;
94
+ this.previousPage = false;
95
+ }
96
+ else {
97
+ this.offsetInt = (pageNumber - 1) * this.limitInt;
98
+ }
99
+ }
100
+ else {
101
+ if (index === 0 && this.currentPage <= 4) {
102
+ this.navigateTo('firstPage');
103
+ }
104
+ else if (index === 0 && this.currentPage > 4) {
105
+ this.navigateTo('fivePagesBack');
106
+ }
107
+ else if (index === 4 && this.endInt - this.currentPage >= 2) {
108
+ this.navigateTo('fivePagesForward');
109
+ }
110
+ }
111
+ this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
112
+ };
113
+ this.setClientStyling = () => {
114
+ let sheet = document.createElement('style');
115
+ sheet.innerHTML = this.clientStyling;
116
+ this.stylingContainer.prepend(sheet);
117
+ };
118
+ this.setClientStylingURL = () => {
119
+ let cssFile = document.createElement('style');
120
+ setTimeout(() => {
121
+ cssFile.innerHTML = this.clientStylingUrlContent;
122
+ this.stylingContainer.prepend(cssFile);
123
+ }, 1);
124
+ };
125
+ }
126
+ componentWillRender() {
127
+ this.offsetInt = this.offset;
128
+ this.limitInt = this.limit;
129
+ this.currentPage = (this.offsetInt / this.limitInt) + 1;
130
+ this.limitInt = this.limit;
131
+ this.totalInt = this.total;
132
+ this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
133
+ this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
134
+ /**
135
+ * Construct numbered navigation area based on current page position
136
+ */
137
+ if (this.currentPage == 1 || this.currentPage == 2) {
138
+ this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
139
+ this.pagesArray.push('...');
140
+ }
141
+ else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
142
+ this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
143
+ this.pagesArray.push('...');
144
+ this.pagesArray.unshift('...');
145
+ }
146
+ else if ((this.endInt - this.currentPage) < 3) {
147
+ this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
148
+ this.pagesArray.unshift('...');
149
+ }
150
+ }
151
+ componentDidRender() {
152
+ // start custom styling area
153
+ if (!this.limitStylingAppends && this.stylingContainer) {
154
+ if (this.clientStyling)
155
+ this.setClientStyling();
156
+ if (this.clientStylingUrlContent)
157
+ this.setClientStylingURL();
158
+ this.limitStylingAppends = true;
159
+ }
160
+ // end custom styling area
161
+ }
162
+ render() {
163
+ /**
164
+ * Center navigation area
165
+ */
166
+ let navigationArea = h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index) => {
167
+ return (h("li", { class: 'PaginationItem' + (item === this.currentPage ? ' ActiveItem' : ' ') + ' ' + (isMobile(this.userAgent) ? 'MobileButtons' : '') },
168
+ h("button", { disabled: item === this.currentPage ? true : false, onClick: this.paginationNavigation.bind(this, item, index) },
169
+ h("span", null, item))));
170
+ }));
171
+ /**
172
+ * Left navigation area
173
+ */
174
+ let buttonSecondaryLeftSide = h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'firstPage') },
175
+ h("span", { class: "NavigationButton" }, translate('firstPage', this.language)),
176
+ h("span", { class: "NavigationIcon" }));
177
+ let buttonsLeftSide = h("div", { class: "LeftItems" },
178
+ this.secondaryArrowsActive && buttonSecondaryLeftSide,
179
+ h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'previousPage') },
180
+ h("span", { class: "NavigationButton" }, translate('previousPage', this.language)),
181
+ h("span", { class: "NavigationIcon" })));
182
+ if (isMobile(this.userAgent)) {
183
+ buttonsLeftSide =
184
+ h("div", { class: "LeftItems" },
185
+ h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'previousPage') },
186
+ h("span", { class: "NavigationButton" }, translate('previousPage', this.language)),
187
+ h("span", { class: "NavigationIcon" })));
188
+ }
189
+ /**
190
+ * Right navigation area
191
+ */
192
+ let buttonSecondaryRightSide = h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'lastPage') },
193
+ h("span", { class: "NavigationButton" }, translate('lastPage', this.language)),
194
+ h("span", { class: "NavigationIcon" }));
195
+ let buttonsRightSide = h("div", { class: "RightItems" },
196
+ h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'nextPage') },
197
+ h("span", { class: "NavigationButton" }, translate('nextPage', this.language)),
198
+ h("span", { class: "NavigationIcon" })),
199
+ this.secondaryArrowsActive && buttonSecondaryRightSide);
200
+ if (isMobile(this.userAgent)) {
201
+ buttonsRightSide =
202
+ h("div", { class: "RightItems" },
203
+ h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'nextPage') },
204
+ h("span", { class: "NavigationButton" }, translate('nextPage', this.language)),
205
+ h("span", { class: "NavigationIcon" })));
206
+ }
207
+ return (h("div", { id: "PaginationContainer", ref: el => this.stylingContainer = el },
208
+ this.arrowsActive && buttonsLeftSide,
209
+ this.numberedNavActive && navigationArea,
210
+ this.arrowsActive && buttonsRightSide));
211
+ }
212
+ static get is() { return "helper-pagination"; }
213
+ static get encapsulation() { return "shadow"; }
214
+ static get originalStyleUrls() { return {
215
+ "$": ["helper-pagination.scss"]
216
+ }; }
217
+ static get styleUrls() { return {
218
+ "$": ["helper-pagination.css"]
219
+ }; }
220
+ static get properties() { return {
221
+ "nextPage": {
222
+ "type": "string",
223
+ "mutable": true,
224
+ "complexType": {
225
+ "original": "string",
226
+ "resolved": "string",
227
+ "references": {}
228
+ },
229
+ "required": false,
230
+ "optional": false,
231
+ "docs": {
232
+ "tags": [],
233
+ "text": "Next page string value - determines if the next page is disabled or active"
234
+ },
235
+ "attribute": "next-page",
236
+ "reflect": true,
237
+ "defaultValue": "''"
238
+ },
239
+ "prevPage": {
240
+ "type": "string",
241
+ "mutable": true,
242
+ "complexType": {
243
+ "original": "string",
244
+ "resolved": "string",
245
+ "references": {}
246
+ },
247
+ "required": false,
248
+ "optional": false,
249
+ "docs": {
250
+ "tags": [],
251
+ "text": "Previous page string value - determines if the previous page is disabled or active"
252
+ },
253
+ "attribute": "prev-page",
254
+ "reflect": true,
255
+ "defaultValue": "''"
256
+ },
257
+ "offset": {
258
+ "type": "number",
259
+ "mutable": true,
260
+ "complexType": {
261
+ "original": "number",
262
+ "resolved": "number",
263
+ "references": {}
264
+ },
265
+ "required": false,
266
+ "optional": false,
267
+ "docs": {
268
+ "tags": [],
269
+ "text": "The received offset"
270
+ },
271
+ "attribute": "offset",
272
+ "reflect": true,
273
+ "defaultValue": "0"
274
+ },
275
+ "limit": {
276
+ "type": "number",
277
+ "mutable": true,
278
+ "complexType": {
279
+ "original": "number",
280
+ "resolved": "number",
281
+ "references": {}
282
+ },
283
+ "required": false,
284
+ "optional": false,
285
+ "docs": {
286
+ "tags": [],
287
+ "text": "The received limit for the number of pages"
288
+ },
289
+ "attribute": "limit",
290
+ "reflect": true,
291
+ "defaultValue": "1"
292
+ },
293
+ "total": {
294
+ "type": "number",
295
+ "mutable": true,
296
+ "complexType": {
297
+ "original": "number",
298
+ "resolved": "number",
299
+ "references": {}
300
+ },
301
+ "required": false,
302
+ "optional": false,
303
+ "docs": {
304
+ "tags": [],
305
+ "text": "The received total number of pages"
306
+ },
307
+ "attribute": "total",
308
+ "reflect": true,
309
+ "defaultValue": "1"
310
+ },
311
+ "language": {
312
+ "type": "string",
313
+ "mutable": true,
314
+ "complexType": {
315
+ "original": "string",
316
+ "resolved": "string",
317
+ "references": {}
318
+ },
319
+ "required": false,
320
+ "optional": false,
321
+ "docs": {
322
+ "tags": [],
323
+ "text": "Language"
324
+ },
325
+ "attribute": "language",
326
+ "reflect": true,
327
+ "defaultValue": "'en'"
328
+ },
329
+ "clientStyling": {
330
+ "type": "string",
331
+ "mutable": true,
332
+ "complexType": {
333
+ "original": "string",
334
+ "resolved": "string",
335
+ "references": {}
336
+ },
337
+ "required": false,
338
+ "optional": false,
339
+ "docs": {
340
+ "tags": [],
341
+ "text": "Client custom styling via string"
342
+ },
343
+ "attribute": "client-styling",
344
+ "reflect": true,
345
+ "defaultValue": "''"
346
+ },
347
+ "clientStylingUrlContent": {
348
+ "type": "string",
349
+ "mutable": true,
350
+ "complexType": {
351
+ "original": "string",
352
+ "resolved": "string",
353
+ "references": {}
354
+ },
355
+ "required": false,
356
+ "optional": false,
357
+ "docs": {
358
+ "tags": [],
359
+ "text": "Client custom styling via url content"
360
+ },
361
+ "attribute": "client-styling-url-content",
362
+ "reflect": true,
363
+ "defaultValue": "''"
364
+ },
365
+ "arrowsActive": {
366
+ "type": "boolean",
367
+ "mutable": true,
368
+ "complexType": {
369
+ "original": "boolean",
370
+ "resolved": "boolean",
371
+ "references": {}
372
+ },
373
+ "required": false,
374
+ "optional": false,
375
+ "docs": {
376
+ "tags": [],
377
+ "text": "Customize pagination: Activate pagination arrows"
378
+ },
379
+ "attribute": "arrows-active",
380
+ "reflect": true
381
+ },
382
+ "secondaryArrowsActive": {
383
+ "type": "boolean",
384
+ "mutable": true,
385
+ "complexType": {
386
+ "original": "boolean",
387
+ "resolved": "boolean",
388
+ "references": {}
389
+ },
390
+ "required": false,
391
+ "optional": false,
392
+ "docs": {
393
+ "tags": [],
394
+ "text": "Customize pagination: Activate pagination secondary arrows"
395
+ },
396
+ "attribute": "secondary-arrows-active",
397
+ "reflect": true
398
+ },
399
+ "numberedNavActive": {
400
+ "type": "boolean",
401
+ "mutable": true,
402
+ "complexType": {
403
+ "original": "boolean",
404
+ "resolved": "boolean",
405
+ "references": {}
406
+ },
407
+ "required": false,
408
+ "optional": false,
409
+ "docs": {
410
+ "tags": [],
411
+ "text": "Customize pagination: Activate pagination numbered navigation"
412
+ },
413
+ "attribute": "numbered-nav-active",
414
+ "reflect": true
415
+ }
416
+ }; }
417
+ static get states() { return {
418
+ "offsetInt": {},
419
+ "lastPage": {},
420
+ "previousPage": {},
421
+ "limitInt": {},
422
+ "totalInt": {},
423
+ "pagesArray": {},
424
+ "endInt": {},
425
+ "limitStylingAppends": {}
426
+ }; }
427
+ static get events() { return [{
428
+ "method": "hpPageChange",
429
+ "name": "hpPageChange",
430
+ "bubbles": true,
431
+ "cancelable": true,
432
+ "composed": true,
433
+ "docs": {
434
+ "tags": [],
435
+ "text": "Event that handles the navigation, updating the offset, limit and total values"
436
+ },
437
+ "complexType": {
438
+ "original": "any",
439
+ "resolved": "any",
440
+ "references": {}
441
+ }
442
+ }]; }
443
+ }
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,44 @@
1
+ const DEFAULT_LANGUAGE = 'en';
2
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'hu', 'hr'];
3
+ const TRANSLATIONS = {
4
+ en: {
5
+ firstPage: 'First',
6
+ previousPage: 'Previous',
7
+ nextPage: 'Next',
8
+ lastPage: 'Last'
9
+ },
10
+ ro: {
11
+ firstPage: 'Prima',
12
+ previousPage: 'Anterior',
13
+ nextPage: 'Urmatoarea',
14
+ lastPage: 'Ultima'
15
+ },
16
+ fr: {
17
+ firstPage: 'First',
18
+ previousPage: 'Previous',
19
+ nextPage: 'Next',
20
+ lastPage: 'Last'
21
+ },
22
+ ar: {
23
+ firstPage: 'First',
24
+ previousPage: 'Previous',
25
+ nextPage: 'Next',
26
+ lastPage: 'Last'
27
+ },
28
+ hu: {
29
+ firstPage: 'First',
30
+ previousPage: 'Previous',
31
+ nextPage: 'Következő',
32
+ lastPage: 'Last'
33
+ },
34
+ hr: {
35
+ firstPage: 'Prva',
36
+ previousPage: 'Prethodna',
37
+ nextPage: 'Slijedeća',
38
+ lastPage: 'Zadnja'
39
+ }
40
+ };
41
+ export const translate = (key, customLang) => {
42
+ const lang = customLang;
43
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
44
+ };
@@ -0,0 +1,15 @@
1
+ export function format(first, middle, last) {
2
+ return ((first || '') + (middle ? ` ${middle}` : '') + (last ? ` ${last}` : ''));
3
+ }
4
+ /**
5
+ * @name isMobile
6
+ * @description A method that returns if the browser used to access the app is from a mobile device or not
7
+ * @param {String} userAgent window.navigator.userAgent
8
+ * @returns {Boolean} true or false
9
+ */
10
+ export const isMobile = (userAgent) => {
11
+ return !!(userAgent.toLowerCase().match(/android/i) ||
12
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
13
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
14
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
15
+ };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface HelperPagination extends Components.HelperPagination, HTMLElement {}
4
+ export const HelperPagination: {
5
+ prototype: HelperPagination;
6
+ new (): HelperPagination;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;