@everymatrix/lottery-game-page 1.44.0 → 1.45.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 (194) 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} +3329 -1000
  3. package/dist/cjs/helper-pagination.cjs.entry.js +195 -226
  4. package/dist/cjs/index-f3851683.js +1345 -0
  5. package/dist/cjs/index.cjs.js +0 -2
  6. package/dist/cjs/loader.cjs.js +7 -15
  7. package/dist/cjs/lottery-game-page.cjs.js +16 -12
  8. package/dist/collection/collection-manifest.json +4 -10
  9. package/dist/collection/components/lottery-game-page/index.js +1 -0
  10. package/dist/collection/components/lottery-game-page/lottery-game-page.css +1 -1
  11. package/dist/collection/components/lottery-game-page/lottery-game-page.js +580 -646
  12. package/dist/collection/index.js +0 -1
  13. package/dist/collection/utils/locale.utils.js +117 -118
  14. package/dist/collection/utils/utils.js +4 -5
  15. package/dist/esm/app-globals-0f993ce5.js +3 -0
  16. package/dist/esm/{helper-filters_2.entry.js → helper-accordion_13.entry.js} +3319 -1001
  17. package/dist/esm/helper-pagination.entry.js +195 -226
  18. package/dist/esm/index-8248702b.js +1316 -0
  19. package/dist/esm/index.js +0 -2
  20. package/dist/esm/loader.js +8 -16
  21. package/dist/esm/lottery-game-page.js +14 -13
  22. package/dist/lottery-game-page/index.esm.js +0 -2
  23. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -2
  24. package/dist/lottery-game-page/p-4254ae78.entry.js +3567 -0
  25. package/dist/lottery-game-page/p-89956c67.entry.js +1 -0
  26. package/dist/lottery-game-page/p-8f2c63c7.js +2 -0
  27. package/dist/lottery-game-page/p-e1255160.js +1 -0
  28. package/dist/stencil.config.dev.js +17 -0
  29. package/dist/stencil.config.js +12 -45
  30. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.d.ts +2 -0
  31. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-game-page/.stencil/packages/stencil/lottery-game-page/stencil.config.dev.d.ts +2 -0
  32. package/dist/types/components/lottery-game-page/index.d.ts +1 -0
  33. package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +98 -98
  34. package/dist/types/components.d.ts +18 -2
  35. package/dist/types/stencil-public-runtime.d.ts +142 -33
  36. package/loader/cdn.js +1 -3
  37. package/loader/index.cjs.js +1 -3
  38. package/loader/index.d.ts +13 -1
  39. package/loader/index.es2017.js +1 -3
  40. package/loader/index.js +1 -3
  41. package/loader/package.json +1 -0
  42. package/package.json +13 -7
  43. package/dist/assets/chrono_desktop.png +0 -0
  44. package/dist/assets/chrono_lottery_mobile.png +0 -0
  45. package/dist/cjs/helper-accordion.cjs.entry.js +0 -134
  46. package/dist/cjs/helper-accordion.cjs.entry.js.map +0 -1
  47. package/dist/cjs/helper-filters_2.cjs.entry.js.map +0 -1
  48. package/dist/cjs/helper-modal.cjs.entry.js +0 -78
  49. package/dist/cjs/helper-modal.cjs.entry.js.map +0 -1
  50. package/dist/cjs/helper-pagination.cjs.entry.js.map +0 -1
  51. package/dist/cjs/helper-tab.cjs.entry.js +0 -70
  52. package/dist/cjs/helper-tab.cjs.entry.js.map +0 -1
  53. package/dist/cjs/helper-tabs.cjs.entry.js +0 -76
  54. package/dist/cjs/helper-tabs.cjs.entry.js.map +0 -1
  55. package/dist/cjs/index-cd44e726.js +0 -1326
  56. package/dist/cjs/index-cd44e726.js.map +0 -1
  57. package/dist/cjs/index.cjs.js.map +0 -1
  58. package/dist/cjs/loader.cjs.js.map +0 -1
  59. package/dist/cjs/lottery-bullet_2.cjs.entry.js +0 -281
  60. package/dist/cjs/lottery-bullet_2.cjs.entry.js.map +0 -1
  61. package/dist/cjs/lottery-draw-results-history.cjs.entry.js +0 -240
  62. package/dist/cjs/lottery-draw-results-history.cjs.entry.js.map +0 -1
  63. package/dist/cjs/lottery-game-details.cjs.entry.js +0 -53
  64. package/dist/cjs/lottery-game-details.cjs.entry.js.map +0 -1
  65. package/dist/cjs/lottery-game-page.cjs.entry.js +0 -456
  66. package/dist/cjs/lottery-game-page.cjs.entry.js.map +0 -1
  67. package/dist/cjs/lottery-game-page.cjs.js.map +0 -1
  68. package/dist/cjs/lottery-ticket-controller.cjs.entry.js +0 -132
  69. package/dist/cjs/lottery-ticket-controller.cjs.entry.js.map +0 -1
  70. package/dist/cjs/lottery-ticket.cjs.entry.js +0 -233
  71. package/dist/cjs/lottery-ticket.cjs.entry.js.map +0 -1
  72. package/dist/collection/components/lottery-game-page/lottery-game-page.js.map +0 -1
  73. package/dist/collection/index.js.map +0 -1
  74. package/dist/collection/utils/locale.utils.js.map +0 -1
  75. package/dist/collection/utils/utils.js.map +0 -1
  76. package/dist/components/helper-accordion.js +0 -8
  77. package/dist/components/helper-accordion.js.map +0 -1
  78. package/dist/components/helper-accordion2.js +0 -161
  79. package/dist/components/helper-accordion2.js.map +0 -1
  80. package/dist/components/helper-filters.js +0 -8
  81. package/dist/components/helper-filters.js.map +0 -1
  82. package/dist/components/helper-filters2.js +0 -23566
  83. package/dist/components/helper-filters2.js.map +0 -1
  84. package/dist/components/helper-modal.js +0 -8
  85. package/dist/components/helper-modal.js.map +0 -1
  86. package/dist/components/helper-modal2.js +0 -96
  87. package/dist/components/helper-modal2.js.map +0 -1
  88. package/dist/components/helper-pagination.js +0 -293
  89. package/dist/components/helper-pagination.js.map +0 -1
  90. package/dist/components/helper-tab.js +0 -8
  91. package/dist/components/helper-tab.js.map +0 -1
  92. package/dist/components/helper-tab2.js +0 -89
  93. package/dist/components/helper-tab2.js.map +0 -1
  94. package/dist/components/helper-tabs.js +0 -8
  95. package/dist/components/helper-tabs.js.map +0 -1
  96. package/dist/components/helper-tabs2.js +0 -105
  97. package/dist/components/helper-tabs2.js.map +0 -1
  98. package/dist/components/index.d.ts +0 -26
  99. package/dist/components/index.js +0 -3
  100. package/dist/components/index.js.map +0 -1
  101. package/dist/components/lottery-bullet.js +0 -8
  102. package/dist/components/lottery-bullet.js.map +0 -1
  103. package/dist/components/lottery-bullet2.js +0 -94
  104. package/dist/components/lottery-bullet2.js.map +0 -1
  105. package/dist/components/lottery-draw-results-history.js +0 -8
  106. package/dist/components/lottery-draw-results-history.js.map +0 -1
  107. package/dist/components/lottery-draw-results-history2.js +0 -298
  108. package/dist/components/lottery-draw-results-history2.js.map +0 -1
  109. package/dist/components/lottery-draw-results.js +0 -8
  110. package/dist/components/lottery-draw-results.js.map +0 -1
  111. package/dist/components/lottery-draw-results2.js +0 -346
  112. package/dist/components/lottery-draw-results2.js.map +0 -1
  113. package/dist/components/lottery-game-details.js +0 -8
  114. package/dist/components/lottery-game-details.js.map +0 -1
  115. package/dist/components/lottery-game-details2.js +0 -87
  116. package/dist/components/lottery-game-details2.js.map +0 -1
  117. package/dist/components/lottery-game-page.d.ts +0 -11
  118. package/dist/components/lottery-game-page.js +0 -572
  119. package/dist/components/lottery-game-page.js.map +0 -1
  120. package/dist/components/lottery-grid.js +0 -8
  121. package/dist/components/lottery-grid.js.map +0 -1
  122. package/dist/components/lottery-grid2.js +0 -248
  123. package/dist/components/lottery-grid2.js.map +0 -1
  124. package/dist/components/lottery-ticket-controller.js +0 -8
  125. package/dist/components/lottery-ticket-controller.js.map +0 -1
  126. package/dist/components/lottery-ticket-controller2.js +0 -185
  127. package/dist/components/lottery-ticket-controller2.js.map +0 -1
  128. package/dist/components/lottery-ticket.js +0 -8
  129. package/dist/components/lottery-ticket.js.map +0 -1
  130. package/dist/components/lottery-ticket2.js +0 -276
  131. package/dist/components/lottery-ticket2.js.map +0 -1
  132. package/dist/esm/helper-accordion.entry.js +0 -130
  133. package/dist/esm/helper-accordion.entry.js.map +0 -1
  134. package/dist/esm/helper-filters_2.entry.js.map +0 -1
  135. package/dist/esm/helper-modal.entry.js +0 -74
  136. package/dist/esm/helper-modal.entry.js.map +0 -1
  137. package/dist/esm/helper-pagination.entry.js.map +0 -1
  138. package/dist/esm/helper-tab.entry.js +0 -66
  139. package/dist/esm/helper-tab.entry.js.map +0 -1
  140. package/dist/esm/helper-tabs.entry.js +0 -72
  141. package/dist/esm/helper-tabs.entry.js.map +0 -1
  142. package/dist/esm/index-d1baacd4.js +0 -1298
  143. package/dist/esm/index-d1baacd4.js.map +0 -1
  144. package/dist/esm/index.js.map +0 -1
  145. package/dist/esm/loader.js.map +0 -1
  146. package/dist/esm/lottery-bullet_2.entry.js +0 -276
  147. package/dist/esm/lottery-bullet_2.entry.js.map +0 -1
  148. package/dist/esm/lottery-draw-results-history.entry.js +0 -236
  149. package/dist/esm/lottery-draw-results-history.entry.js.map +0 -1
  150. package/dist/esm/lottery-game-details.entry.js +0 -49
  151. package/dist/esm/lottery-game-details.entry.js.map +0 -1
  152. package/dist/esm/lottery-game-page.entry.js +0 -452
  153. package/dist/esm/lottery-game-page.entry.js.map +0 -1
  154. package/dist/esm/lottery-game-page.js.map +0 -1
  155. package/dist/esm/lottery-ticket-controller.entry.js +0 -128
  156. package/dist/esm/lottery-ticket-controller.entry.js.map +0 -1
  157. package/dist/esm/lottery-ticket.entry.js +0 -229
  158. package/dist/esm/lottery-ticket.entry.js.map +0 -1
  159. package/dist/esm/polyfills/core-js.js +0 -11
  160. package/dist/esm/polyfills/css-shim.js +0 -1
  161. package/dist/esm/polyfills/dom.js +0 -79
  162. package/dist/esm/polyfills/es5-html-element.js +0 -1
  163. package/dist/esm/polyfills/index.js +0 -34
  164. package/dist/esm/polyfills/system.js +0 -6
  165. package/dist/lottery-game-page/index.esm.js.map +0 -1
  166. package/dist/lottery-game-page/lottery-game-page.esm.js.map +0 -1
  167. package/dist/lottery-game-page/p-12340c50.entry.js +0 -2921
  168. package/dist/lottery-game-page/p-12340c50.entry.js.map +0 -1
  169. package/dist/lottery-game-page/p-15309f9a.entry.js +0 -2
  170. package/dist/lottery-game-page/p-15309f9a.entry.js.map +0 -1
  171. package/dist/lottery-game-page/p-167c9dbe.entry.js +0 -2
  172. package/dist/lottery-game-page/p-167c9dbe.entry.js.map +0 -1
  173. package/dist/lottery-game-page/p-20e0c81c.entry.js +0 -2
  174. package/dist/lottery-game-page/p-20e0c81c.entry.js.map +0 -1
  175. package/dist/lottery-game-page/p-59a96854.entry.js +0 -2
  176. package/dist/lottery-game-page/p-59a96854.entry.js.map +0 -1
  177. package/dist/lottery-game-page/p-662d9dac.entry.js +0 -2
  178. package/dist/lottery-game-page/p-662d9dac.entry.js.map +0 -1
  179. package/dist/lottery-game-page/p-66729e9c.entry.js +0 -2
  180. package/dist/lottery-game-page/p-66729e9c.entry.js.map +0 -1
  181. package/dist/lottery-game-page/p-721345a7.entry.js +0 -2
  182. package/dist/lottery-game-page/p-721345a7.entry.js.map +0 -1
  183. package/dist/lottery-game-page/p-76c280ec.entry.js +0 -2
  184. package/dist/lottery-game-page/p-76c280ec.entry.js.map +0 -1
  185. package/dist/lottery-game-page/p-cd4aa6a4.entry.js +0 -2
  186. package/dist/lottery-game-page/p-cd4aa6a4.entry.js.map +0 -1
  187. package/dist/lottery-game-page/p-e765c7d9.js +0 -2
  188. package/dist/lottery-game-page/p-e765c7d9.js.map +0 -1
  189. package/dist/lottery-game-page/p-e86e2389.entry.js +0 -2
  190. package/dist/lottery-game-page/p-e86e2389.entry.js.map +0 -1
  191. package/dist/lottery-game-page/p-f399eef1.entry.js +0 -2
  192. package/dist/lottery-game-page/p-f399eef1.entry.js.map +0 -1
  193. package/dist/stencil.config.js.map +0 -1
  194. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +0 -2
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-cd44e726.js');
5
+ const index = require('./index-f3851683.js');
6
6
 
7
7
  /**
8
8
  * @name isMobile
@@ -11,248 +11,217 @@ const index = require('./index-cd44e726.js');
11
11
  * @returns {Boolean} true or false
12
12
  */
13
13
  const isMobile = (userAgent) => {
14
- return !!(userAgent.toLowerCase().match(/android/i) ||
15
- userAgent.toLowerCase().match(/blackberry|bb/i) ||
16
- userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
17
- userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
14
+ return !!(userAgent.toLowerCase().match(/android/i) ||
15
+ userAgent.toLowerCase().match(/blackberry|bb/i) ||
16
+ userAgent.toLowerCase().match(/iphone|ipad|ipod/i) ||
17
+ userAgent.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i));
18
18
  };
19
19
 
20
20
  const DEFAULT_LANGUAGE = 'en';
21
21
  const TRANSLATIONS = {
22
- en: {
23
- firstPage: 'First',
24
- previousPage: 'Previous',
25
- nextPage: 'Next',
26
- lastPage: 'Last'
27
- },
28
- ro: {
29
- firstPage: 'Prima',
30
- previousPage: 'Anterior',
31
- nextPage: 'Urmatoarea',
32
- lastPage: 'Ultima'
33
- },
34
- fr: {
35
- firstPage: 'First',
36
- previousPage: 'Previous',
37
- nextPage: 'Next',
38
- lastPage: 'Last'
39
- },
40
- ar: {
41
- firstPage: 'First',
42
- previousPage: 'Previous',
43
- nextPage: 'Next',
44
- lastPage: 'Last'
45
- },
46
- hu: {
47
- firstPage: 'First',
48
- previousPage: 'Previous',
49
- nextPage: 'Következő',
50
- lastPage: 'Last'
51
- },
52
- hr: {
53
- firstPage: 'Prva',
54
- previousPage: 'Prethodna',
55
- nextPage: 'Slijedeća',
56
- lastPage: 'Zadnja'
57
- }
22
+ en: {
23
+ firstPage: 'First',
24
+ previousPage: 'Previous',
25
+ nextPage: 'Next',
26
+ lastPage: 'Last'
27
+ },
28
+ ro: {
29
+ firstPage: 'Prima',
30
+ previousPage: 'Anterior',
31
+ nextPage: 'Urmatoarea',
32
+ lastPage: 'Ultima'
33
+ },
34
+ fr: {
35
+ firstPage: 'First',
36
+ previousPage: 'Previous',
37
+ nextPage: 'Next',
38
+ lastPage: 'Last'
39
+ },
40
+ ar: {
41
+ firstPage: 'First',
42
+ previousPage: 'Previous',
43
+ nextPage: 'Next',
44
+ lastPage: 'Last'
45
+ },
46
+ hu: {
47
+ firstPage: 'First',
48
+ previousPage: 'Previous',
49
+ nextPage: 'Következő',
50
+ lastPage: 'Last'
51
+ },
52
+ hr: {
53
+ firstPage: 'Prva',
54
+ previousPage: 'Prethodna',
55
+ nextPage: 'Slijedeća',
56
+ lastPage: 'Zadnja'
57
+ }
58
58
  };
59
59
  const translate = (key, customLang) => {
60
- const lang = customLang;
61
- return TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
60
+ const lang = customLang;
61
+ return TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
62
62
  };
63
63
 
64
64
  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}}";
65
+ const HelperPaginationStyle0 = helperPaginationCss;
65
66
 
66
67
  const HelperPagination = class {
67
- constructor(hostRef) {
68
- index.registerInstance(this, hostRef);
69
- this.hpPageChange = index.createEvent(this, "hpPageChange", 7);
70
- /**
71
- * Next page string value - determines if the next page is disabled or active
72
- */
73
- this.nextPage = '';
74
- /**
75
- * Previous page string value - determines if the previous page is disabled or active
76
- */
77
- this.prevPage = '';
78
- /**
79
- * The received offset
80
- */
81
- this.offset = 0;
82
- /**
83
- * The received limit for the number of pages
84
- */
85
- this.limit = 1;
86
- /**
87
- * The received total number of pages
88
- */
89
- this.total = 1;
90
- /**
91
- * Language
92
- */
93
- this.language = 'en';
94
- /**
95
- * Client custom styling via string
96
- */
97
- this.clientStyling = '';
98
- /**
99
- * Client custom styling via url content
100
- */
101
- this.clientStylingUrlContent = '';
102
- /**
103
- * Component working variable for last page
104
- */
105
- this.lastPage = false;
106
- /**
107
- * Component working variable for prvious page
108
- */
109
- this.previousPage = false;
110
- /**
111
- * In component working variable for the array of pages
112
- */
113
- this.pagesArray = [];
114
- /**
115
- * In component working variable for last page
116
- */
117
- this.endInt = 0;
118
- this.userAgent = window.navigator.userAgent;
119
- this.currentPage = 1;
120
- this.limitStylingAppends = false;
121
- /**
122
- * Navigation logic
123
- */
124
- this.navigateTo = (navigationPage) => {
125
- switch (navigationPage) {
126
- case 'firstPage':
127
- this.offsetInt = 0;
128
- break;
129
- case 'lastPage':
130
- this.offsetInt = this.endInt * this.limitInt;
131
- break;
132
- case 'previousPage':
133
- this.offsetInt -= this.limitInt;
134
- break;
135
- case 'nextPage':
136
- this.offsetInt += this.limitInt;
137
- break;
138
- case 'fivePagesBack':
139
- this.offsetInt -= this.limitInt * 5;
140
- this.offsetInt = this.offsetInt <= 0 ? 0 : this.offsetInt;
141
- break;
142
- case 'fivePagesForward':
143
- this.offsetInt += this.limitInt * 5;
144
- this.offsetInt = this.offsetInt / this.limitInt >= this.endInt ? this.endInt * this.limitInt : this.offsetInt;
145
- break;
146
- }
147
- this.previousPage = !this.offsetInt ? false : true;
148
- this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
149
- };
150
- /**
151
- * Handle navigation from here
152
- */
153
- this.paginationNavigation = (pageNumber, index) => {
154
- this.previousPage = true;
155
- if (!isNaN(pageNumber)) {
156
- if (pageNumber === 1) {
157
- this.offsetInt = pageNumber - 1;
158
- this.previousPage = false;
159
- }
160
- else {
161
- this.offsetInt = (pageNumber - 1) * this.limitInt;
162
- }
163
- }
164
- else {
165
- if (index === 0 && this.currentPage <= 4) {
166
- this.navigateTo('firstPage');
68
+ constructor(hostRef) {
69
+ index.registerInstance(this, hostRef);
70
+ this.hpPageChange = index.createEvent(this, "hpPageChange", 7);
71
+ this.userAgent = window.navigator.userAgent;
72
+ this.currentPage = 1;
73
+ /**
74
+ * Navigation logic
75
+ */
76
+ this.navigateTo = (navigationPage) => {
77
+ switch (navigationPage) {
78
+ case 'firstPage':
79
+ this.offsetInt = 0;
80
+ break;
81
+ case 'lastPage':
82
+ this.offsetInt = this.endInt * this.limitInt;
83
+ break;
84
+ case 'previousPage':
85
+ this.offsetInt -= this.limitInt;
86
+ break;
87
+ case 'nextPage':
88
+ this.offsetInt += this.limitInt;
89
+ break;
90
+ case 'fivePagesBack':
91
+ this.offsetInt -= this.limitInt * 5;
92
+ this.offsetInt = this.offsetInt <= 0 ? 0 : this.offsetInt;
93
+ break;
94
+ case 'fivePagesForward':
95
+ this.offsetInt += this.limitInt * 5;
96
+ this.offsetInt = this.offsetInt / this.limitInt >= this.endInt ? this.endInt * this.limitInt : this.offsetInt;
97
+ break;
98
+ }
99
+ this.previousPage = !this.offsetInt ? false : true;
100
+ this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
101
+ };
102
+ /**
103
+ * Handle navigation from here
104
+ */
105
+ this.paginationNavigation = (pageNumber, index) => {
106
+ this.previousPage = true;
107
+ if (!isNaN(pageNumber)) {
108
+ if (pageNumber === 1) {
109
+ this.offsetInt = pageNumber - 1;
110
+ this.previousPage = false;
111
+ }
112
+ else {
113
+ this.offsetInt = (pageNumber - 1) * this.limitInt;
114
+ }
115
+ }
116
+ else {
117
+ if (index === 0 && this.currentPage <= 4) {
118
+ this.navigateTo('firstPage');
119
+ }
120
+ else if (index === 0 && this.currentPage > 4) {
121
+ this.navigateTo('fivePagesBack');
122
+ }
123
+ else if (index === 4 && this.endInt - this.currentPage >= 2) {
124
+ this.navigateTo('fivePagesForward');
125
+ }
126
+ }
127
+ this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
128
+ };
129
+ this.setClientStyling = () => {
130
+ let sheet = document.createElement('style');
131
+ sheet.innerHTML = this.clientStyling;
132
+ this.stylingContainer.prepend(sheet);
133
+ };
134
+ this.setClientStylingURL = () => {
135
+ let cssFile = document.createElement('style');
136
+ setTimeout(() => {
137
+ cssFile.innerHTML = this.clientStylingUrlContent;
138
+ this.stylingContainer.prepend(cssFile);
139
+ }, 1);
140
+ };
141
+ this.nextPage = '';
142
+ this.prevPage = '';
143
+ this.offset = 0;
144
+ this.limit = 1;
145
+ this.total = 1;
146
+ this.language = 'en';
147
+ this.clientStyling = '';
148
+ this.clientStylingUrlContent = '';
149
+ this.arrowsActive = undefined;
150
+ this.secondaryArrowsActive = undefined;
151
+ this.numberedNavActive = undefined;
152
+ this.offsetInt = undefined;
153
+ this.lastPage = false;
154
+ this.previousPage = false;
155
+ this.limitInt = undefined;
156
+ this.totalInt = undefined;
157
+ this.pagesArray = [];
158
+ this.endInt = 0;
159
+ this.limitStylingAppends = false;
160
+ }
161
+ componentWillRender() {
162
+ this.offsetInt = this.offset;
163
+ this.limitInt = this.limit;
164
+ this.currentPage = (this.offsetInt / this.limitInt) + 1;
165
+ this.limitInt = this.limit;
166
+ this.totalInt = this.total;
167
+ this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
168
+ this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
169
+ /**
170
+ * Construct numbered navigation area based on current page position
171
+ */
172
+ if (this.currentPage == 1 || this.currentPage == 2) {
173
+ this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
174
+ this.pagesArray.push('...');
167
175
  }
168
- else if (index === 0 && this.currentPage > 4) {
169
- this.navigateTo('fivePagesBack');
176
+ else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
177
+ this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
178
+ this.pagesArray.push('...');
179
+ this.pagesArray.unshift('...');
170
180
  }
171
- else if (index === 4 && this.endInt - this.currentPage >= 2) {
172
- this.navigateTo('fivePagesForward');
181
+ else if ((this.endInt - this.currentPage) < 3) {
182
+ this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
183
+ this.pagesArray.unshift('...');
173
184
  }
174
- }
175
- this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
176
- };
177
- this.setClientStyling = () => {
178
- let sheet = document.createElement('style');
179
- sheet.innerHTML = this.clientStyling;
180
- this.stylingContainer.prepend(sheet);
181
- };
182
- this.setClientStylingURL = () => {
183
- let cssFile = document.createElement('style');
184
- setTimeout(() => {
185
- cssFile.innerHTML = this.clientStylingUrlContent;
186
- this.stylingContainer.prepend(cssFile);
187
- }, 1);
188
- };
189
- }
190
- componentWillRender() {
191
- this.offsetInt = this.offset;
192
- this.limitInt = this.limit;
193
- this.currentPage = (this.offsetInt / this.limitInt) + 1;
194
- this.limitInt = this.limit;
195
- this.totalInt = this.total;
196
- this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
197
- this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
198
- /**
199
- * Construct numbered navigation area based on current page position
200
- */
201
- if (this.currentPage == 1 || this.currentPage == 2) {
202
- this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
203
- this.pagesArray.push('...');
204
- }
205
- else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
206
- this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
207
- this.pagesArray.push('...');
208
- this.pagesArray.unshift('...');
209
- }
210
- else if ((this.endInt - this.currentPage) < 3) {
211
- this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
212
- this.pagesArray.unshift('...');
213
185
  }
214
- }
215
- componentDidRender() {
216
- // start custom styling area
217
- if (!this.limitStylingAppends && this.stylingContainer) {
218
- if (this.clientStyling)
219
- this.setClientStyling();
220
- if (this.clientStylingUrlContent)
221
- this.setClientStylingURL();
222
- this.limitStylingAppends = true;
223
- }
224
- // end custom styling area
225
- }
226
- render() {
227
- /**
228
- * Center navigation area
229
- */
230
- let navigationArea = index.h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index$1) => {
231
- return (index.h("li", { class: 'PaginationItem' + (item === this.currentPage ? ' ActiveItem' : ' ') + ' ' + (isMobile(this.userAgent) ? 'MobileButtons' : '') }, index.h("button", { disabled: item === this.currentPage ? true : false, onClick: this.paginationNavigation.bind(this, item, index$1) }, index.h("span", null, item))));
232
- }));
233
- /**
234
- * Left navigation area
235
- */
236
- let buttonSecondaryLeftSide = index.h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'firstPage') }, index.h("span", { class: "NavigationButton" }, translate('firstPage', this.language)), index.h("span", { class: "NavigationIcon" }));
237
- let buttonsLeftSide = index.h("div", { class: "LeftItems" }, this.secondaryArrowsActive && buttonSecondaryLeftSide, index.h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'previousPage') }, index.h("span", { class: "NavigationButton" }, translate('previousPage', this.language)), index.h("span", { class: "NavigationIcon" })));
238
- if (isMobile(this.userAgent)) {
239
- buttonsLeftSide =
240
- index.h("div", { class: "LeftItems" }, index.h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'previousPage') }, index.h("span", { class: "NavigationButton" }, translate('previousPage', this.language)), index.h("span", { class: "NavigationIcon" })));
186
+ componentDidRender() {
187
+ // start custom styling area
188
+ if (!this.limitStylingAppends && this.stylingContainer) {
189
+ if (this.clientStyling)
190
+ this.setClientStyling();
191
+ if (this.clientStylingUrlContent)
192
+ this.setClientStylingURL();
193
+ this.limitStylingAppends = true;
194
+ }
195
+ // end custom styling area
241
196
  }
242
- /**
243
- * Right navigation area
244
- */
245
- let buttonSecondaryRightSide = index.h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'lastPage') }, index.h("span", { class: "NavigationButton" }, translate('lastPage', this.language)), index.h("span", { class: "NavigationIcon" }));
246
- let buttonsRightSide = index.h("div", { class: "RightItems" }, index.h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'nextPage') }, index.h("span", { class: "NavigationButton" }, translate('nextPage', this.language)), index.h("span", { class: "NavigationIcon" })), this.secondaryArrowsActive && buttonSecondaryRightSide);
247
- if (isMobile(this.userAgent)) {
248
- buttonsRightSide =
249
- index.h("div", { class: "RightItems" }, index.h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'nextPage') }, index.h("span", { class: "NavigationButton" }, translate('nextPage', this.language)), index.h("span", { class: "NavigationIcon" })));
197
+ render() {
198
+ /**
199
+ * Center navigation area
200
+ */
201
+ let navigationArea = index.h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index$1) => {
202
+ return (index.h("li", { class: 'PaginationItem' + (item === this.currentPage ? ' ActiveItem' : ' ') + ' ' + (isMobile(this.userAgent) ? 'MobileButtons' : '') }, index.h("button", { disabled: item === this.currentPage ? true : false, onClick: this.paginationNavigation.bind(this, item, index$1) }, index.h("span", null, item))));
203
+ }));
204
+ /**
205
+ * Left navigation area
206
+ */
207
+ let buttonSecondaryLeftSide = index.h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'firstPage') }, index.h("span", { class: "NavigationButton" }, translate('firstPage', this.language)), index.h("span", { class: "NavigationIcon" }));
208
+ let buttonsLeftSide = index.h("div", { class: "LeftItems" }, this.secondaryArrowsActive && buttonSecondaryLeftSide, index.h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'previousPage') }, index.h("span", { class: "NavigationButton" }, translate('previousPage', this.language)), index.h("span", { class: "NavigationIcon" })));
209
+ if (isMobile(this.userAgent)) {
210
+ buttonsLeftSide =
211
+ index.h("div", { class: "LeftItems" }, index.h("button", { disabled: this.prevPage ? false : true, onClick: this.navigateTo.bind(this, 'previousPage') }, index.h("span", { class: "NavigationButton" }, translate('previousPage', this.language)), index.h("span", { class: "NavigationIcon" })));
212
+ }
213
+ /**
214
+ * Right navigation area
215
+ */
216
+ let buttonSecondaryRightSide = index.h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'lastPage') }, index.h("span", { class: "NavigationButton" }, translate('lastPage', this.language)), index.h("span", { class: "NavigationIcon" }));
217
+ let buttonsRightSide = index.h("div", { class: "RightItems" }, index.h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'nextPage') }, index.h("span", { class: "NavigationButton" }, translate('nextPage', this.language)), index.h("span", { class: "NavigationIcon" })), this.secondaryArrowsActive && buttonSecondaryRightSide);
218
+ if (isMobile(this.userAgent)) {
219
+ buttonsRightSide =
220
+ index.h("div", { class: "RightItems" }, index.h("button", { disabled: this.nextPage ? false : true, onClick: this.navigateTo.bind(this, 'nextPage') }, index.h("span", { class: "NavigationButton" }, translate('nextPage', this.language)), index.h("span", { class: "NavigationIcon" })));
221
+ }
222
+ return (index.h("div", { id: "PaginationContainer", ref: el => this.stylingContainer = el }, this.arrowsActive && buttonsLeftSide, this.numberedNavActive && navigationArea, this.arrowsActive && buttonsRightSide));
250
223
  }
251
- return (index.h("div", { id: "PaginationContainer", ref: el => this.stylingContainer = el }, this.arrowsActive && buttonsLeftSide, this.numberedNavActive && navigationArea, this.arrowsActive && buttonsRightSide));
252
- }
253
224
  };
254
- HelperPagination.style = helperPaginationCss;
225
+ HelperPagination.style = HelperPaginationStyle0;
255
226
 
256
227
  exports.helper_pagination = HelperPagination;
257
-
258
- //# sourceMappingURL=helper-pagination.cjs.entry.js.map