@everymatrix/lottery-game-page 1.43.4 → 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
@@ -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,248 +7,217 @@ 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
17
  const TRANSLATIONS = {
18
- en: {
19
- firstPage: 'First',
20
- previousPage: 'Previous',
21
- nextPage: 'Next',
22
- lastPage: 'Last'
23
- },
24
- ro: {
25
- firstPage: 'Prima',
26
- previousPage: 'Anterior',
27
- nextPage: 'Urmatoarea',
28
- lastPage: 'Ultima'
29
- },
30
- fr: {
31
- firstPage: 'First',
32
- previousPage: 'Previous',
33
- nextPage: 'Next',
34
- lastPage: 'Last'
35
- },
36
- ar: {
37
- firstPage: 'First',
38
- previousPage: 'Previous',
39
- nextPage: 'Next',
40
- lastPage: 'Last'
41
- },
42
- hu: {
43
- firstPage: 'First',
44
- previousPage: 'Previous',
45
- nextPage: 'Következő',
46
- lastPage: 'Last'
47
- },
48
- hr: {
49
- firstPage: 'Prva',
50
- previousPage: 'Prethodna',
51
- nextPage: 'Slijedeća',
52
- lastPage: 'Zadnja'
53
- }
18
+ en: {
19
+ firstPage: 'First',
20
+ previousPage: 'Previous',
21
+ nextPage: 'Next',
22
+ lastPage: 'Last'
23
+ },
24
+ ro: {
25
+ firstPage: 'Prima',
26
+ previousPage: 'Anterior',
27
+ nextPage: 'Urmatoarea',
28
+ lastPage: 'Ultima'
29
+ },
30
+ fr: {
31
+ firstPage: 'First',
32
+ previousPage: 'Previous',
33
+ nextPage: 'Next',
34
+ lastPage: 'Last'
35
+ },
36
+ ar: {
37
+ firstPage: 'First',
38
+ previousPage: 'Previous',
39
+ nextPage: 'Next',
40
+ lastPage: 'Last'
41
+ },
42
+ hu: {
43
+ firstPage: 'First',
44
+ previousPage: 'Previous',
45
+ nextPage: 'Következő',
46
+ lastPage: 'Last'
47
+ },
48
+ hr: {
49
+ firstPage: 'Prva',
50
+ previousPage: 'Prethodna',
51
+ nextPage: 'Slijedeća',
52
+ lastPage: 'Zadnja'
53
+ }
54
54
  };
55
55
  const translate = (key, customLang) => {
56
- const lang = customLang;
57
- return TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
56
+ const lang = customLang;
57
+ return TRANSLATIONS[(lang !== undefined) && (lang in TRANSLATIONS) ? lang : DEFAULT_LANGUAGE][key];
58
58
  };
59
59
 
60
60
  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}}";
61
+ const HelperPaginationStyle0 = helperPaginationCss;
61
62
 
62
63
  const HelperPagination = class {
63
- constructor(hostRef) {
64
- registerInstance(this, hostRef);
65
- this.hpPageChange = createEvent(this, "hpPageChange", 7);
66
- /**
67
- * Next page string value - determines if the next page is disabled or active
68
- */
69
- this.nextPage = '';
70
- /**
71
- * Previous page string value - determines if the previous page is disabled or active
72
- */
73
- this.prevPage = '';
74
- /**
75
- * The received offset
76
- */
77
- this.offset = 0;
78
- /**
79
- * The received limit for the number of pages
80
- */
81
- this.limit = 1;
82
- /**
83
- * The received total number of pages
84
- */
85
- this.total = 1;
86
- /**
87
- * Language
88
- */
89
- this.language = 'en';
90
- /**
91
- * Client custom styling via string
92
- */
93
- this.clientStyling = '';
94
- /**
95
- * Client custom styling via url content
96
- */
97
- this.clientStylingUrlContent = '';
98
- /**
99
- * Component working variable for last page
100
- */
101
- this.lastPage = false;
102
- /**
103
- * Component working variable for prvious page
104
- */
105
- this.previousPage = false;
106
- /**
107
- * In component working variable for the array of pages
108
- */
109
- this.pagesArray = [];
110
- /**
111
- * In component working variable for last page
112
- */
113
- this.endInt = 0;
114
- this.userAgent = window.navigator.userAgent;
115
- this.currentPage = 1;
116
- this.limitStylingAppends = false;
117
- /**
118
- * Navigation logic
119
- */
120
- this.navigateTo = (navigationPage) => {
121
- switch (navigationPage) {
122
- case 'firstPage':
123
- this.offsetInt = 0;
124
- break;
125
- case 'lastPage':
126
- this.offsetInt = this.endInt * this.limitInt;
127
- break;
128
- case 'previousPage':
129
- this.offsetInt -= this.limitInt;
130
- break;
131
- case 'nextPage':
132
- this.offsetInt += this.limitInt;
133
- break;
134
- case 'fivePagesBack':
135
- this.offsetInt -= this.limitInt * 5;
136
- this.offsetInt = this.offsetInt <= 0 ? 0 : this.offsetInt;
137
- break;
138
- case 'fivePagesForward':
139
- this.offsetInt += this.limitInt * 5;
140
- this.offsetInt = this.offsetInt / this.limitInt >= this.endInt ? this.endInt * this.limitInt : this.offsetInt;
141
- break;
142
- }
143
- this.previousPage = !this.offsetInt ? false : true;
144
- this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
145
- };
146
- /**
147
- * Handle navigation from here
148
- */
149
- this.paginationNavigation = (pageNumber, index) => {
150
- this.previousPage = true;
151
- if (!isNaN(pageNumber)) {
152
- if (pageNumber === 1) {
153
- this.offsetInt = pageNumber - 1;
154
- this.previousPage = false;
155
- }
156
- else {
157
- this.offsetInt = (pageNumber - 1) * this.limitInt;
158
- }
159
- }
160
- else {
161
- if (index === 0 && this.currentPage <= 4) {
162
- this.navigateTo('firstPage');
64
+ constructor(hostRef) {
65
+ registerInstance(this, hostRef);
66
+ this.hpPageChange = createEvent(this, "hpPageChange", 7);
67
+ this.userAgent = window.navigator.userAgent;
68
+ this.currentPage = 1;
69
+ /**
70
+ * Navigation logic
71
+ */
72
+ this.navigateTo = (navigationPage) => {
73
+ switch (navigationPage) {
74
+ case 'firstPage':
75
+ this.offsetInt = 0;
76
+ break;
77
+ case 'lastPage':
78
+ this.offsetInt = this.endInt * this.limitInt;
79
+ break;
80
+ case 'previousPage':
81
+ this.offsetInt -= this.limitInt;
82
+ break;
83
+ case 'nextPage':
84
+ this.offsetInt += this.limitInt;
85
+ break;
86
+ case 'fivePagesBack':
87
+ this.offsetInt -= this.limitInt * 5;
88
+ this.offsetInt = this.offsetInt <= 0 ? 0 : this.offsetInt;
89
+ break;
90
+ case 'fivePagesForward':
91
+ this.offsetInt += this.limitInt * 5;
92
+ this.offsetInt = this.offsetInt / this.limitInt >= this.endInt ? this.endInt * this.limitInt : this.offsetInt;
93
+ break;
94
+ }
95
+ this.previousPage = !this.offsetInt ? false : true;
96
+ this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
97
+ };
98
+ /**
99
+ * Handle navigation from here
100
+ */
101
+ this.paginationNavigation = (pageNumber, index) => {
102
+ this.previousPage = true;
103
+ if (!isNaN(pageNumber)) {
104
+ if (pageNumber === 1) {
105
+ this.offsetInt = pageNumber - 1;
106
+ this.previousPage = false;
107
+ }
108
+ else {
109
+ this.offsetInt = (pageNumber - 1) * this.limitInt;
110
+ }
111
+ }
112
+ else {
113
+ if (index === 0 && this.currentPage <= 4) {
114
+ this.navigateTo('firstPage');
115
+ }
116
+ else if (index === 0 && this.currentPage > 4) {
117
+ this.navigateTo('fivePagesBack');
118
+ }
119
+ else if (index === 4 && this.endInt - this.currentPage >= 2) {
120
+ this.navigateTo('fivePagesForward');
121
+ }
122
+ }
123
+ this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
124
+ };
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;
156
+ }
157
+ componentWillRender() {
158
+ this.offsetInt = this.offset;
159
+ this.limitInt = this.limit;
160
+ this.currentPage = (this.offsetInt / this.limitInt) + 1;
161
+ this.limitInt = this.limit;
162
+ this.totalInt = this.total;
163
+ this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
164
+ this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
165
+ /**
166
+ * Construct numbered navigation area based on current page position
167
+ */
168
+ if (this.currentPage == 1 || this.currentPage == 2) {
169
+ this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
170
+ this.pagesArray.push('...');
163
171
  }
164
- else if (index === 0 && this.currentPage > 4) {
165
- this.navigateTo('fivePagesBack');
172
+ else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
173
+ this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
174
+ this.pagesArray.push('...');
175
+ this.pagesArray.unshift('...');
166
176
  }
167
- else if (index === 4 && this.endInt - this.currentPage >= 2) {
168
- this.navigateTo('fivePagesForward');
177
+ else if ((this.endInt - this.currentPage) < 3) {
178
+ this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
179
+ this.pagesArray.unshift('...');
169
180
  }
170
- }
171
- this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
172
- };
173
- this.setClientStyling = () => {
174
- let sheet = document.createElement('style');
175
- sheet.innerHTML = this.clientStyling;
176
- this.stylingContainer.prepend(sheet);
177
- };
178
- this.setClientStylingURL = () => {
179
- let cssFile = document.createElement('style');
180
- setTimeout(() => {
181
- cssFile.innerHTML = this.clientStylingUrlContent;
182
- this.stylingContainer.prepend(cssFile);
183
- }, 1);
184
- };
185
- }
186
- componentWillRender() {
187
- this.offsetInt = this.offset;
188
- this.limitInt = this.limit;
189
- this.currentPage = (this.offsetInt / this.limitInt) + 1;
190
- this.limitInt = this.limit;
191
- this.totalInt = this.total;
192
- this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
193
- this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
194
- /**
195
- * Construct numbered navigation area based on current page position
196
- */
197
- if (this.currentPage == 1 || this.currentPage == 2) {
198
- this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
199
- this.pagesArray.push('...');
200
- }
201
- else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
202
- this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
203
- this.pagesArray.push('...');
204
- this.pagesArray.unshift('...');
205
- }
206
- else if ((this.endInt - this.currentPage) < 3) {
207
- this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
208
- this.pagesArray.unshift('...');
209
181
  }
210
- }
211
- componentDidRender() {
212
- // start custom styling area
213
- if (!this.limitStylingAppends && this.stylingContainer) {
214
- if (this.clientStyling)
215
- this.setClientStyling();
216
- if (this.clientStylingUrlContent)
217
- this.setClientStylingURL();
218
- this.limitStylingAppends = true;
219
- }
220
- // end custom styling area
221
- }
222
- render() {
223
- /**
224
- * Center navigation area
225
- */
226
- let navigationArea = h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index) => {
227
- 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))));
228
- }));
229
- /**
230
- * Left navigation area
231
- */
232
- 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" }));
233
- 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" })));
234
- if (isMobile(this.userAgent)) {
235
- buttonsLeftSide =
236
- 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" })));
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;
190
+ }
191
+ // end custom styling area
237
192
  }
238
- /**
239
- * Right navigation area
240
- */
241
- 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" }));
242
- 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);
243
- if (isMobile(this.userAgent)) {
244
- buttonsRightSide =
245
- 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" })));
193
+ render() {
194
+ /**
195
+ * Center navigation area
196
+ */
197
+ let navigationArea = h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index) => {
198
+ 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))));
199
+ }));
200
+ /**
201
+ * Left navigation area
202
+ */
203
+ 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" }));
204
+ 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" })));
205
+ if (isMobile(this.userAgent)) {
206
+ buttonsLeftSide =
207
+ 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" })));
208
+ }
209
+ /**
210
+ * Right navigation area
211
+ */
212
+ 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" }));
213
+ 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);
214
+ if (isMobile(this.userAgent)) {
215
+ buttonsRightSide =
216
+ 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" })));
217
+ }
218
+ return (h("div", { id: "PaginationContainer", ref: el => this.stylingContainer = el }, this.arrowsActive && buttonsLeftSide, this.numberedNavActive && navigationArea, this.arrowsActive && buttonsRightSide));
246
219
  }
247
- return (h("div", { id: "PaginationContainer", ref: el => this.stylingContainer = el }, this.arrowsActive && buttonsLeftSide, this.numberedNavActive && navigationArea, this.arrowsActive && buttonsRightSide));
248
- }
249
220
  };
250
- HelperPagination.style = helperPaginationCss;
221
+ HelperPagination.style = HelperPaginationStyle0;
251
222
 
252
223
  export { HelperPagination as helper_pagination };
253
-
254
- //# sourceMappingURL=helper-pagination.entry.js.map