@everymatrix/lottery-game-page 0.1.26 → 1.0.69

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 (115) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/{helper-filters_2.cjs.entry.js → helper-accordion_13.cjs.entry.js} +13401 -9890
  3. package/dist/cjs/helper-pagination.cjs.entry.js +197 -189
  4. package/dist/cjs/index-f3851683.js +1345 -0
  5. package/dist/cjs/loader.cjs.js +7 -13
  6. package/dist/cjs/lottery-game-page.cjs.js +17 -11
  7. package/dist/collection/collection-manifest.json +4 -10
  8. package/dist/collection/components/lottery-game-page/index.js +1 -0
  9. package/dist/collection/components/lottery-game-page/lottery-game-page.css +11 -2
  10. package/dist/collection/components/lottery-game-page/lottery-game-page.js +579 -594
  11. package/dist/collection/utils/locale.utils.js +118 -95
  12. package/dist/collection/utils/utils.js +4 -4
  13. package/dist/esm/app-globals-0f993ce5.js +3 -0
  14. package/dist/esm/{helper-filters_2.entry.js → helper-accordion_13.entry.js} +13391 -9891
  15. package/dist/esm/helper-pagination.entry.js +197 -189
  16. package/dist/esm/index-8248702b.js +1316 -0
  17. package/dist/esm/loader.js +7 -13
  18. package/dist/esm/lottery-game-page.js +14 -11
  19. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
  20. package/dist/lottery-game-page/p-46aaa562.entry.js +1 -0
  21. package/dist/lottery-game-page/p-8f2c63c7.js +2 -0
  22. package/dist/lottery-game-page/p-bd89bbf0.entry.js +3567 -0
  23. package/dist/lottery-game-page/p-e1255160.js +1 -0
  24. package/dist/stencil.config.dev.js +17 -0
  25. package/dist/stencil.config.js +12 -36
  26. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.d.ts +2 -0
  27. package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.dev.d.ts +2 -0
  28. package/dist/types/components/lottery-game-page/index.d.ts +1 -0
  29. package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +99 -90
  30. package/dist/types/components.d.ts +28 -2
  31. package/dist/types/stencil-public-runtime.d.ts +142 -33
  32. package/loader/cdn.js +1 -3
  33. package/loader/index.cjs.js +1 -3
  34. package/loader/index.d.ts +13 -1
  35. package/loader/index.es2017.js +1 -3
  36. package/loader/index.js +1 -3
  37. package/loader/package.json +1 -0
  38. package/package.json +13 -7
  39. package/dist/cjs/helper-accordion.cjs.entry.js +0 -124
  40. package/dist/cjs/helper-modal.cjs.entry.js +0 -76
  41. package/dist/cjs/helper-tab.cjs.entry.js +0 -68
  42. package/dist/cjs/helper-tabs.cjs.entry.js +0 -74
  43. package/dist/cjs/index-cd44e726.js +0 -1324
  44. package/dist/cjs/lottery-bullet_2.cjs.entry.js +0 -270
  45. package/dist/cjs/lottery-draw-results-history.cjs.entry.js +0 -198
  46. package/dist/cjs/lottery-game-details.cjs.entry.js +0 -51
  47. package/dist/cjs/lottery-game-page.cjs.entry.js +0 -427
  48. package/dist/cjs/lottery-ticket-controller.cjs.entry.js +0 -116
  49. package/dist/cjs/lottery-ticket.cjs.entry.js +0 -201
  50. package/dist/collection/components/lottery-game-page/static/chrono_desktop.png +0 -0
  51. package/dist/collection/components/lottery-game-page/static/chrono_lottery_mobile.png +0 -0
  52. package/dist/components/assets/chrono_desktop.png +0 -0
  53. package/dist/components/assets/chrono_lottery_mobile.png +0 -0
  54. package/dist/components/helper-accordion.js +0 -6
  55. package/dist/components/helper-accordion2.js +0 -151
  56. package/dist/components/helper-filters.js +0 -6
  57. package/dist/components/helper-filters2.js +0 -22394
  58. package/dist/components/helper-modal.js +0 -6
  59. package/dist/components/helper-modal2.js +0 -94
  60. package/dist/components/helper-pagination.js +0 -251
  61. package/dist/components/helper-tab.js +0 -6
  62. package/dist/components/helper-tab2.js +0 -87
  63. package/dist/components/helper-tabs.js +0 -6
  64. package/dist/components/helper-tabs2.js +0 -103
  65. package/dist/components/index.d.ts +0 -26
  66. package/dist/components/index.js +0 -1
  67. package/dist/components/lottery-bullet.js +0 -6
  68. package/dist/components/lottery-bullet2.js +0 -92
  69. package/dist/components/lottery-draw-results-history.js +0 -6
  70. package/dist/components/lottery-draw-results-history2.js +0 -256
  71. package/dist/components/lottery-draw-results.js +0 -6
  72. package/dist/components/lottery-draw-results2.js +0 -335
  73. package/dist/components/lottery-game-details.js +0 -6
  74. package/dist/components/lottery-game-details2.js +0 -85
  75. package/dist/components/lottery-game-page.d.ts +0 -11
  76. package/dist/components/lottery-game-page.js +0 -542
  77. package/dist/components/lottery-grid.js +0 -6
  78. package/dist/components/lottery-grid2.js +0 -237
  79. package/dist/components/lottery-ticket-controller.js +0 -6
  80. package/dist/components/lottery-ticket-controller2.js +0 -168
  81. package/dist/components/lottery-ticket.js +0 -6
  82. package/dist/components/lottery-ticket2.js +0 -244
  83. package/dist/esm/helper-accordion.entry.js +0 -120
  84. package/dist/esm/helper-modal.entry.js +0 -72
  85. package/dist/esm/helper-tab.entry.js +0 -64
  86. package/dist/esm/helper-tabs.entry.js +0 -70
  87. package/dist/esm/index-d1baacd4.js +0 -1296
  88. package/dist/esm/lottery-bullet_2.entry.js +0 -265
  89. package/dist/esm/lottery-draw-results-history.entry.js +0 -194
  90. package/dist/esm/lottery-game-details.entry.js +0 -47
  91. package/dist/esm/lottery-game-page.entry.js +0 -423
  92. package/dist/esm/lottery-ticket-controller.entry.js +0 -112
  93. package/dist/esm/lottery-ticket.entry.js +0 -197
  94. package/dist/esm/polyfills/core-js.js +0 -11
  95. package/dist/esm/polyfills/css-shim.js +0 -1
  96. package/dist/esm/polyfills/dom.js +0 -79
  97. package/dist/esm/polyfills/es5-html-element.js +0 -1
  98. package/dist/esm/polyfills/index.js +0 -34
  99. package/dist/esm/polyfills/system.js +0 -6
  100. package/dist/lottery-game-page/p-023325a2.entry.js +0 -1
  101. package/dist/lottery-game-page/p-04fbc8fd.entry.js +0 -1
  102. package/dist/lottery-game-page/p-256b151c.entry.js +0 -1
  103. package/dist/lottery-game-page/p-381b5507.entry.js +0 -1
  104. package/dist/lottery-game-page/p-3f8b6ad9.entry.js +0 -1
  105. package/dist/lottery-game-page/p-4274053c.entry.js +0 -1
  106. package/dist/lottery-game-page/p-4f81cd37.entry.js +0 -1
  107. package/dist/lottery-game-page/p-5c389034.entry.js +0 -1
  108. package/dist/lottery-game-page/p-7d06371e.entry.js +0 -1
  109. package/dist/lottery-game-page/p-ca8430a0.entry.js +0 -2849
  110. package/dist/lottery-game-page/p-d6f76e8d.entry.js +0 -1
  111. package/dist/lottery-game-page/p-e765c7d9.js +0 -1
  112. package/dist/lottery-game-page/p-f6fcc22c.entry.js +0 -1
  113. package/dist/lottery-game-page/static/chrono_desktop.png +0 -0
  114. package/dist/lottery-game-page/static/chrono_lottery_mobile.png +0 -0
  115. package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +0 -2
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-d1baacd4.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-8248702b.js';
2
2
 
3
3
  /**
4
4
  * @name isMobile
@@ -7,210 +7,218 @@ import { r as registerInstance, c as createEvent, h } from './index-d1baacd4.js'
7
7
  * @returns {Boolean} true or false
8
8
  */
9
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));
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
14
  };
15
15
 
16
16
  const DEFAULT_LANGUAGE = 'en';
17
- const SUPPORTED_LANGUAGES = ['ro', 'en'];
17
+ const SUPPORTED_LANGUAGES = ['ro', 'en', 'hu', 'hr'];
18
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
- },
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
+ }
31
55
  };
32
56
  const translate = (key, customLang) => {
33
- const lang = customLang;
34
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
57
+ const lang = customLang;
58
+ return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
35
59
  };
36
60
 
37
- 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-top:20px;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:12px}}@media screen and (max-width: 480px){button{width:70px;font-size:10px}.paginationArea{padding:5px}}@media screen and (max-width: 320px){button{width:58px;font-size:10px}.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}}";
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
+ const HelperPaginationStyle0 = helperPaginationCss;
38
63
 
39
64
  const HelperPagination = class {
40
- constructor(hostRef) {
41
- registerInstance(this, hostRef);
42
- this.hpPageChange = createEvent(this, "hpPageChange", 7);
43
- /**
44
- * First page boolean value - determines if the page is disabled or active
45
- */
46
- this.firstPage = false;
47
- /**
48
- * Previous page boolean value - determines if the page is disabled or active
49
- */
50
- this.previousPage = false;
51
- /**
52
- * The received offset
53
- */
54
- this.offset = 0;
55
- /**
56
- * The received limit for the number of pages
57
- */
58
- this.limit = 1;
59
- /**
60
- * The received total number of pages
61
- */
62
- this.total = 1;
63
- /**
64
- * Language
65
- */
66
- this.language = 'en';
67
- /**
68
- * Client custom styling via string
69
- */
70
- this.clientStyling = '';
71
- /**
72
- * Client custom styling via url content
73
- */
74
- this.clientStylingUrlContent = '';
75
- /**
76
- * In component working variable for the array of pages
77
- */
78
- this.pagesArray = [];
79
- /**
80
- * In component working variable for last page
81
- */
82
- this.endInt = 0;
83
- this.userAgent = window.navigator.userAgent;
84
- this.currentPage = 1;
85
- this.limitStylingAppends = false;
86
- /**
87
- * Navigation logic
88
- */
89
- this.navigateTo = (navigationPage) => {
90
- switch (navigationPage) {
91
- case 'firstPage':
92
- this.offsetInt = 0;
93
- break;
94
- case 'lastPage':
95
- this.offsetInt = this.endInt * this.limitInt;
96
- break;
97
- case 'previousPage':
98
- this.offsetInt -= 10;
99
- break;
100
- case 'nextPage':
101
- this.offsetInt += 10;
102
- break;
103
- case 'fivePagesBack':
104
- this.offsetInt -= 30;
105
- this.offsetInt = this.offsetInt < 0 ? 0 : this.offsetInt;
106
- break;
107
- case 'fivePagesForward':
108
- this.offsetInt += 30;
109
- this.offsetInt = this.offsetInt / 10 >= this.endInt ? this.endInt * 10 : this.offsetInt;
110
- break;
111
- }
112
- this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
113
- };
114
- /**
115
- * Handle navigation from here
116
- */
117
- this.paginationNavigation = (pageNumber, index) => {
118
- if (!isNaN(pageNumber)) {
119
- if (pageNumber === 1) {
120
- this.offsetInt = pageNumber - 1;
121
- }
122
- else {
123
- this.offsetInt = (pageNumber - 1) * 10;
124
- }
125
- }
126
- else {
127
- if (index === 0 && this.currentPage <= 4) {
128
- this.navigateTo('firstPage');
65
+ constructor(hostRef) {
66
+ registerInstance(this, hostRef);
67
+ this.hpPageChange = createEvent(this, "hpPageChange", 7);
68
+ this.userAgent = window.navigator.userAgent;
69
+ this.currentPage = 1;
70
+ /**
71
+ * Navigation logic
72
+ */
73
+ this.navigateTo = (navigationPage) => {
74
+ switch (navigationPage) {
75
+ case 'firstPage':
76
+ this.offsetInt = 0;
77
+ break;
78
+ case 'lastPage':
79
+ this.offsetInt = this.endInt * this.limitInt;
80
+ break;
81
+ case 'previousPage':
82
+ this.offsetInt -= this.limitInt;
83
+ break;
84
+ case 'nextPage':
85
+ this.offsetInt += this.limitInt;
86
+ break;
87
+ case 'fivePagesBack':
88
+ this.offsetInt -= this.limitInt * 5;
89
+ this.offsetInt = this.offsetInt <= 0 ? 0 : this.offsetInt;
90
+ break;
91
+ case 'fivePagesForward':
92
+ this.offsetInt += this.limitInt * 5;
93
+ this.offsetInt = this.offsetInt / this.limitInt >= this.endInt ? this.endInt * this.limitInt : this.offsetInt;
94
+ break;
95
+ }
96
+ this.previousPage = !this.offsetInt ? false : true;
97
+ this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
98
+ };
99
+ /**
100
+ * Handle navigation from here
101
+ */
102
+ this.paginationNavigation = (pageNumber, index) => {
103
+ this.previousPage = true;
104
+ if (!isNaN(pageNumber)) {
105
+ if (pageNumber === 1) {
106
+ this.offsetInt = pageNumber - 1;
107
+ this.previousPage = false;
108
+ }
109
+ else {
110
+ this.offsetInt = (pageNumber - 1) * this.limitInt;
111
+ }
112
+ }
113
+ else {
114
+ if (index === 0 && this.currentPage <= 4) {
115
+ this.navigateTo('firstPage');
116
+ }
117
+ else if (index === 0 && this.currentPage > 4) {
118
+ this.navigateTo('fivePagesBack');
119
+ }
120
+ else if (index === 4 && this.endInt - this.currentPage >= 2) {
121
+ this.navigateTo('fivePagesForward');
122
+ }
123
+ }
124
+ this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
125
+ };
126
+ this.setClientStyling = () => {
127
+ let sheet = document.createElement('style');
128
+ sheet.innerHTML = this.clientStyling;
129
+ this.stylingContainer.prepend(sheet);
130
+ };
131
+ this.setClientStylingURL = () => {
132
+ let cssFile = document.createElement('style');
133
+ setTimeout(() => {
134
+ cssFile.innerHTML = this.clientStylingUrlContent;
135
+ this.stylingContainer.prepend(cssFile);
136
+ }, 1);
137
+ };
138
+ this.nextPage = '';
139
+ this.prevPage = '';
140
+ this.offset = 0;
141
+ this.limit = 1;
142
+ this.total = 1;
143
+ this.language = 'en';
144
+ this.clientStyling = '';
145
+ this.clientStylingUrlContent = '';
146
+ this.arrowsActive = undefined;
147
+ this.secondaryArrowsActive = undefined;
148
+ this.numberedNavActive = undefined;
149
+ this.offsetInt = undefined;
150
+ this.lastPage = false;
151
+ this.previousPage = false;
152
+ this.limitInt = undefined;
153
+ this.totalInt = undefined;
154
+ this.pagesArray = [];
155
+ this.endInt = 0;
156
+ this.limitStylingAppends = false;
157
+ }
158
+ componentWillRender() {
159
+ this.offsetInt = this.offset;
160
+ this.limitInt = this.limit;
161
+ this.currentPage = (this.offsetInt / this.limitInt) + 1;
162
+ this.limitInt = this.limit;
163
+ this.totalInt = this.total;
164
+ this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
165
+ this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
166
+ /**
167
+ * Construct numbered navigation area based on current page position
168
+ */
169
+ if (this.currentPage == 1 || this.currentPage == 2) {
170
+ this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
171
+ this.pagesArray.push('...');
129
172
  }
130
- else if (index === 0 && this.currentPage > 4) {
131
- this.navigateTo('fivePagesBack');
173
+ else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
174
+ this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
175
+ this.pagesArray.push('...');
176
+ this.pagesArray.unshift('...');
132
177
  }
133
- else if (index === 4 && this.endInt - this.currentPage >= 2) {
134
- this.navigateTo('fivePagesForward');
178
+ else if ((this.endInt - this.currentPage) < 3) {
179
+ this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
180
+ this.pagesArray.unshift('...');
135
181
  }
136
- }
137
- this.currentPage = this.offsetInt;
138
- this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
139
- };
140
- this.setClientStyling = () => {
141
- let sheet = document.createElement('style');
142
- sheet.innerHTML = this.clientStyling;
143
- this.stylingContainer.prepend(sheet);
144
- };
145
- this.setClientStylingURL = () => {
146
- let cssFile = document.createElement('style');
147
- setTimeout(() => {
148
- cssFile.innerHTML = this.clientStylingUrlContent;
149
- this.stylingContainer.prepend(cssFile);
150
- }, 1);
151
- };
152
- }
153
- componentWillRender() {
154
- this.offsetInt = this.offset;
155
- this.currentPage = this.offsetInt / this.limitInt + 1;
156
- this.limitInt = this.limit;
157
- this.totalInt = this.total;
158
- this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
159
- this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
160
- /**
161
- * Construct numbered navigation area based on current page position
162
- */
163
- if (this.currentPage === 1 || this.currentPage === 2) {
164
- this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
165
- this.pagesArray.push('...');
166
- }
167
- else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
168
- this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
169
- this.pagesArray.push('...');
170
- this.pagesArray.unshift('...');
171
182
  }
172
- else if ((this.endInt - this.currentPage) < 3) {
173
- this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
174
- this.pagesArray.unshift('...');
175
- }
176
- }
177
- componentDidRender() {
178
- // start custom styling area
179
- if (!this.limitStylingAppends && this.stylingContainer) {
180
- if (this.clientStyling)
181
- this.setClientStyling();
182
- if (this.clientStylingUrlContent)
183
- this.setClientStylingURL();
184
- this.limitStylingAppends = true;
185
- }
186
- // end custom styling area
187
- }
188
- render() {
189
- /**
190
- * Center navigation area
191
- */
192
- let navigationArea = h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index) => {
193
- 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))));
194
- }));
195
- /**
196
- * Left navigation area
197
- */
198
- let buttonsLeftSide = h("div", { class: "LeftItems" }, h("button", { disabled: !this.previousPage, onClick: this.navigateTo.bind(this, 'firstPage') }, translate('firstPage', this.language)), h("button", { disabled: !this.previousPage ? true : false, onClick: this.navigateTo.bind(this, 'previousPage') }, translate('previousPage', this.language)));
199
- if (isMobile(this.userAgent)) {
200
- buttonsLeftSide =
201
- h("div", { class: "LeftItems" }, h("button", { disabled: !this.previousPage ? true : false, onClick: this.navigateTo.bind(this, 'previousPage') }, translate('previousPage', this.language)));
183
+ componentDidRender() {
184
+ // start custom styling area
185
+ if (!this.limitStylingAppends && this.stylingContainer) {
186
+ if (this.clientStyling)
187
+ this.setClientStyling();
188
+ if (this.clientStylingUrlContent)
189
+ this.setClientStylingURL();
190
+ this.limitStylingAppends = true;
191
+ }
192
+ // end custom styling area
202
193
  }
203
- /**
204
- * Right navigation area
205
- */
206
- let buttonsRightSide = h("div", { class: "RightItems" }, h("button", { disabled: !this.lastPage ? true : false, onClick: this.navigateTo.bind(this, 'nextPage') }, translate('nextPage', this.language)), h("button", { disabled: !this.lastPage ? true : false, onClick: this.navigateTo.bind(this, 'lastPage') }, translate('lastPage', this.language)));
207
- if (isMobile(this.userAgent)) {
208
- buttonsRightSide =
209
- h("div", { class: "RightItems" }, h("button", { disabled: !this.lastPage ? true : false, onClick: this.navigateTo.bind(this, 'nextPage') }, translate('nextPage', this.language)));
194
+ render() {
195
+ /**
196
+ * Center navigation area
197
+ */
198
+ let navigationArea = h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index) => {
199
+ 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))));
200
+ }));
201
+ /**
202
+ * Left navigation area
203
+ */
204
+ 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" }));
205
+ 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" })));
206
+ if (isMobile(this.userAgent)) {
207
+ buttonsLeftSide =
208
+ 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" })));
209
+ }
210
+ /**
211
+ * Right navigation area
212
+ */
213
+ 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" }));
214
+ 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);
215
+ if (isMobile(this.userAgent)) {
216
+ buttonsRightSide =
217
+ 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" })));
218
+ }
219
+ return (h("div", { id: "PaginationContainer", ref: el => this.stylingContainer = el }, this.arrowsActive && buttonsLeftSide, this.numberedNavActive && navigationArea, this.arrowsActive && buttonsRightSide));
210
220
  }
211
- return (h("div", { id: "PaginationContainer" }, buttonsLeftSide, navigationArea, buttonsRightSide));
212
- }
213
221
  };
214
- HelperPagination.style = helperPaginationCss;
222
+ HelperPagination.style = HelperPaginationStyle0;
215
223
 
216
224
  export { HelperPagination as helper_pagination };