@everymatrix/lottery-game-page 0.0.16 → 0.1.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 (77) hide show
  1. package/dist/cjs/helper-accordion_2.cjs.entry.js +124 -0
  2. package/dist/cjs/helper-modal.cjs.entry.js +1 -1
  3. package/dist/cjs/helper-tab.cjs.entry.js +11 -8
  4. package/dist/cjs/{index-81cb3b3b.js → index-614098f4.js} +5 -47
  5. package/dist/cjs/loader.cjs.js +3 -3
  6. package/dist/cjs/lottery-game-details.cjs.entry.js +1 -1
  7. package/dist/cjs/lottery-game-page.cjs.entry.js +53 -13
  8. package/dist/cjs/lottery-game-page.cjs.js +3 -3
  9. package/dist/collection/collection-manifest.json +1 -49
  10. package/dist/collection/components/lottery-game-page/lottery-game-page.css +27 -7
  11. package/dist/collection/components/lottery-game-page/lottery-game-page.js +22 -5
  12. package/dist/collection/utils/locale.utils.js +33 -6
  13. package/dist/components/helper-accordion2.js +7 -2
  14. package/dist/components/helper-tab2.js +12 -8
  15. package/dist/components/helper-tabs2.js +1 -1
  16. package/dist/components/index.d.ts +5 -1
  17. package/dist/components/index.js +0 -14
  18. package/dist/components/lottery-game-page.js +65 -65
  19. package/dist/esm/helper-accordion_2.entry.js +119 -0
  20. package/dist/esm/helper-modal.entry.js +1 -1
  21. package/dist/esm/helper-tab.entry.js +11 -8
  22. package/dist/esm/{index-be84da79.js → index-0fa076cd.js} +5 -47
  23. package/dist/esm/loader.js +3 -3
  24. package/dist/esm/lottery-game-details.entry.js +1 -1
  25. package/dist/esm/lottery-game-page.entry.js +53 -13
  26. package/dist/esm/lottery-game-page.js +3 -3
  27. package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
  28. package/dist/lottery-game-page/p-2d7ccc96.js +1 -0
  29. package/dist/lottery-game-page/{p-88f81126.entry.js → p-6183a920.entry.js} +1 -1
  30. package/dist/lottery-game-page/p-74eea5ec.entry.js +1 -0
  31. package/dist/lottery-game-page/p-75f13007.entry.js +1 -0
  32. package/dist/lottery-game-page/p-97d1602e.entry.js +1 -0
  33. package/dist/lottery-game-page/{p-a1dd3eb2.entry.js → p-d04141f7.entry.js} +1 -1
  34. package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +3 -0
  35. package/package.json +1 -1
  36. package/dist/cjs/helper-accordion.cjs.entry.js +0 -88
  37. package/dist/cjs/helper-filters_2.cjs.entry.js +0 -22490
  38. package/dist/cjs/helper-pagination.cjs.entry.js +0 -188
  39. package/dist/cjs/helper-tabs.cjs.entry.js +0 -38
  40. package/dist/cjs/lottery-bullet_2.cjs.entry.js +0 -202
  41. package/dist/cjs/lottery-draw-results-history.cjs.entry.js +0 -124
  42. package/dist/cjs/lottery-ticket-controller.cjs.entry.js +0 -69
  43. package/dist/cjs/lottery-ticket.cjs.entry.js +0 -146
  44. package/dist/components/helper-filters.js +0 -6
  45. package/dist/components/helper-filters2.js +0 -22348
  46. package/dist/components/helper-pagination.js +0 -216
  47. package/dist/components/lottery-bullet.js +0 -6
  48. package/dist/components/lottery-bullet2.js +0 -57
  49. package/dist/components/lottery-draw-results-history.js +0 -6
  50. package/dist/components/lottery-draw-results-history2.js +0 -175
  51. package/dist/components/lottery-draw-results.js +0 -6
  52. package/dist/components/lottery-draw-results2.js +0 -218
  53. package/dist/components/lottery-grid.js +0 -6
  54. package/dist/components/lottery-grid2.js +0 -197
  55. package/dist/components/lottery-ticket-controller.js +0 -6
  56. package/dist/components/lottery-ticket-controller2.js +0 -118
  57. package/dist/components/lottery-ticket.js +0 -6
  58. package/dist/components/lottery-ticket2.js +0 -184
  59. package/dist/esm/helper-accordion.entry.js +0 -84
  60. package/dist/esm/helper-filters_2.entry.js +0 -22485
  61. package/dist/esm/helper-pagination.entry.js +0 -184
  62. package/dist/esm/helper-tabs.entry.js +0 -34
  63. package/dist/esm/lottery-bullet_2.entry.js +0 -197
  64. package/dist/esm/lottery-draw-results-history.entry.js +0 -120
  65. package/dist/esm/lottery-ticket-controller.entry.js +0 -65
  66. package/dist/esm/lottery-ticket.entry.js +0 -142
  67. package/dist/lottery-game-page/p-010895a3.entry.js +0 -1
  68. package/dist/lottery-game-page/p-08581ede.entry.js +0 -1
  69. package/dist/lottery-game-page/p-09f983c6.entry.js +0 -1
  70. package/dist/lottery-game-page/p-0c7ada78.entry.js +0 -1
  71. package/dist/lottery-game-page/p-2932d2a7.entry.js +0 -1
  72. package/dist/lottery-game-page/p-48831184.entry.js +0 -1
  73. package/dist/lottery-game-page/p-50298d2c.entry.js +0 -1
  74. package/dist/lottery-game-page/p-6736fa79.entry.js +0 -1
  75. package/dist/lottery-game-page/p-91420518.js +0 -2
  76. package/dist/lottery-game-page/p-95b37270.entry.js +0 -2849
  77. package/dist/lottery-game-page/p-caf09eaf.entry.js +0 -1
@@ -1,216 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
-
3
- /**
4
- * @name isMobile
5
- * @description A method that returns if the browser used to access the app is from a mobile device or not
6
- * @param {String} userAgent window.navigator.userAgent
7
- * @returns {Boolean} true or false
8
- */
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));
14
- };
15
-
16
- const DEFAULT_LANGUAGE = 'en';
17
- const SUPPORTED_LANGUAGES = ['ro', 'en'];
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
- },
31
- };
32
- const translate = (key, customLang) => {
33
- const lang = customLang;
34
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
35
- };
36
-
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}}";
38
-
39
- const HelperPagination$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
40
- constructor() {
41
- super();
42
- this.__registerHost();
43
- this.__attachShadow();
44
- this.hpPageChange = createEvent(this, "hpPageChange", 7);
45
- /**
46
- * First page boolean value - determines if the page is disabled or active
47
- */
48
- this.firstPage = false;
49
- /**
50
- * Previous page boolean value - determines if the page is disabled or active
51
- */
52
- this.previousPage = false;
53
- /**
54
- * The received offset
55
- */
56
- this.offset = 0;
57
- /**
58
- * The received limit for the number of pages
59
- */
60
- this.limit = 1;
61
- /**
62
- * The received total number of pages
63
- */
64
- this.total = 1;
65
- /**
66
- * Language
67
- */
68
- this.language = 'en';
69
- /**
70
- * In component working variable for the array of pages
71
- */
72
- this.pagesArray = [];
73
- /**
74
- * In component working variable for last page
75
- */
76
- this.endInt = 0;
77
- this.userAgent = window.navigator.userAgent;
78
- this.currentPage = 1;
79
- /**
80
- * Navigation logic
81
- */
82
- this.navigateTo = (navigationPage) => {
83
- switch (navigationPage) {
84
- case 'firstPage':
85
- this.offsetInt = 0;
86
- break;
87
- case 'lastPage':
88
- this.offsetInt = this.endInt * this.limitInt;
89
- break;
90
- case 'previousPage':
91
- this.offsetInt -= 10;
92
- break;
93
- case 'nextPage':
94
- this.offsetInt += 10;
95
- break;
96
- case 'fivePagesBack':
97
- this.offsetInt -= 30;
98
- this.offsetInt = this.offsetInt < 0 ? 0 : this.offsetInt;
99
- break;
100
- case 'fivePagesForward':
101
- this.offsetInt += 30;
102
- this.offsetInt = this.offsetInt / 10 >= this.endInt ? this.endInt * 10 : this.offsetInt;
103
- break;
104
- }
105
- this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
106
- };
107
- /**
108
- * Handle navigation from here
109
- */
110
- this.paginationNavigation = (pageNumber, index) => {
111
- if (!isNaN(pageNumber)) {
112
- if (pageNumber === 1) {
113
- this.offsetInt = pageNumber - 1;
114
- }
115
- else {
116
- this.offsetInt = (pageNumber - 1) * 10;
117
- }
118
- }
119
- else {
120
- if (index === 0 && this.currentPage <= 4) {
121
- this.navigateTo('firstPage');
122
- }
123
- else if (index === 0 && this.currentPage > 4) {
124
- this.navigateTo('fivePagesBack');
125
- }
126
- else if (index === 4 && this.endInt - this.currentPage >= 2) {
127
- this.navigateTo('fivePagesForward');
128
- }
129
- }
130
- this.currentPage = this.offsetInt;
131
- this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
132
- };
133
- }
134
- componentWillRender() {
135
- this.offsetInt = this.offset;
136
- this.currentPage = this.offsetInt / this.limitInt + 1;
137
- this.limitInt = this.limit;
138
- this.totalInt = this.total;
139
- this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
140
- this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
141
- /**
142
- * Construct numbered navigation area based on current page position
143
- */
144
- if (this.currentPage === 1 || this.currentPage === 2) {
145
- this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
146
- this.pagesArray.push('...');
147
- }
148
- else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
149
- this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
150
- this.pagesArray.push('...');
151
- this.pagesArray.unshift('...');
152
- }
153
- else if ((this.endInt - this.currentPage) < 3) {
154
- this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
155
- this.pagesArray.unshift('...');
156
- }
157
- }
158
- render() {
159
- /**
160
- * Center navigation area
161
- */
162
- let navigationArea = h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index) => {
163
- 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))));
164
- }));
165
- /**
166
- * Left navigation area
167
- */
168
- 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)));
169
- if (isMobile(this.userAgent)) {
170
- buttonsLeftSide =
171
- h("div", { class: "LeftItems" }, h("button", { disabled: !this.previousPage ? true : false, onClick: this.navigateTo.bind(this, 'previousPage') }, translate('previousPage', this.language)));
172
- }
173
- /**
174
- * Right navigation area
175
- */
176
- 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)));
177
- if (isMobile(this.userAgent)) {
178
- buttonsRightSide =
179
- h("div", { class: "RightItems" }, h("button", { disabled: !this.lastPage ? true : false, onClick: this.navigateTo.bind(this, 'nextPage') }, translate('nextPage', this.language)));
180
- }
181
- return (h("div", { id: "PaginationContainer" }, buttonsLeftSide, navigationArea, buttonsRightSide));
182
- }
183
- static get style() { return helperPaginationCss; }
184
- }, [1, "helper-pagination", {
185
- "firstPage": [1540, "first-page"],
186
- "previousPage": [1540, "previous-page"],
187
- "offset": [1538],
188
- "limit": [1538],
189
- "total": [1538],
190
- "language": [1],
191
- "offsetInt": [32],
192
- "lastPage": [32],
193
- "limitInt": [32],
194
- "totalInt": [32],
195
- "pagesArray": [32],
196
- "endInt": [32]
197
- }]);
198
- function defineCustomElement$1() {
199
- if (typeof customElements === "undefined") {
200
- return;
201
- }
202
- const components = ["helper-pagination"];
203
- components.forEach(tagName => { switch (tagName) {
204
- case "helper-pagination":
205
- if (!customElements.get(tagName)) {
206
- customElements.define(tagName, HelperPagination$1);
207
- }
208
- break;
209
- } });
210
- }
211
- defineCustomElement$1();
212
-
213
- const HelperPagination = HelperPagination$1;
214
- const defineCustomElement = defineCustomElement$1;
215
-
216
- export { HelperPagination, defineCustomElement };
@@ -1,6 +0,0 @@
1
- import { L as LotteryBullet$1, d as defineCustomElement$1 } from './lottery-bullet2.js';
2
-
3
- const LotteryBullet = LotteryBullet$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { LotteryBullet, defineCustomElement };
@@ -1,57 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
-
3
- const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Circle{cursor:pointer;color:#000000;display:block;background:#FFF;border:solid 2px #00958f;height:20px;width:20px;border-radius:50%;margin:0;display:flex;align-items:center;justify-content:center;user-select:none;font-size:12px;font-weight:600;position:relative}.Circle:hover{background:#aee4e2}.Circle.Selected{color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{color:#707070;background:#D4D4D4;border:solid 2px #707070;cursor:default}.Circle.DisabledSelected{color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #707070;cursor:default}";
4
-
5
- const LotteryBullet = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
- constructor() {
7
- super();
8
- this.__registerHost();
9
- this.__attachShadow();
10
- this.bulletEvent = createEvent(this, "lotteryBulletSelection", 7);
11
- /**
12
- * Value of the bullet
13
- */
14
- this.value = '0';
15
- /**
16
- * Marks if the bullet should be selectable
17
- */
18
- this.selectable = true;
19
- /**
20
- * Marks if the bullet should be selected
21
- */
22
- this.isSelected = false;
23
- this.select = () => {
24
- if (this.selectable) {
25
- this.isSelected = !this.isSelected;
26
- this.bulletEvent.emit({
27
- value: this.value,
28
- selected: this.isSelected
29
- });
30
- }
31
- };
32
- }
33
- render() {
34
- return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select() }, this.value));
35
- }
36
- static get style() { return lotteryBulletCss; }
37
- }, [1, "lottery-bullet", {
38
- "value": [1],
39
- "selectable": [4],
40
- "isSelected": [4, "is-selected"]
41
- }]);
42
- function defineCustomElement() {
43
- if (typeof customElements === "undefined") {
44
- return;
45
- }
46
- const components = ["lottery-bullet"];
47
- components.forEach(tagName => { switch (tagName) {
48
- case "lottery-bullet":
49
- if (!customElements.get(tagName)) {
50
- customElements.define(tagName, LotteryBullet);
51
- }
52
- break;
53
- } });
54
- }
55
- defineCustomElement();
56
-
57
- export { LotteryBullet as L, defineCustomElement as d };
@@ -1,6 +0,0 @@
1
- import { L as LotteryDrawResultsHistory$1, d as defineCustomElement$1 } from './lottery-draw-results-history2.js';
2
-
3
- const LotteryDrawResultsHistory = LotteryDrawResultsHistory$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { LotteryDrawResultsHistory, defineCustomElement };
@@ -1,175 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$5 } from './helper-filters2.js';
3
- import { d as defineCustomElement$4 } from './helper-modal2.js';
4
- import { d as defineCustomElement$3 } from './lottery-bullet2.js';
5
- import { d as defineCustomElement$2 } from './lottery-draw-results2.js';
6
- import { d as defineCustomElement$1 } from './lottery-grid2.js';
7
-
8
- const DEFAULT_LANGUAGE = 'en';
9
- const SUPPORTED_LANGUAGES = ['ro', 'en'];
10
- const TRANSLATIONS = {
11
- en: {
12
- drawResultsHeader: 'Draw results history',
13
- drawId: 'Draw ID',
14
- drawDate: 'Draw Date',
15
- drawNumbersGridA: 'Draw numbers Grid A',
16
- viewAllResults: 'View All',
17
- lastFiveDraws: 'Last 5 Draws',
18
- lastTenDraws: 'Last 10 Draws',
19
- lastFifteenDraws: 'Last 15 Draws'
20
- },
21
- ro: {
22
- drawResultsHeader: 'Draw results history',
23
- drawId: 'Draw ID',
24
- drawDate: 'Draw Date',
25
- drawNumbersGridA: 'Draw numbers Grid A',
26
- viewAllResults: 'View All',
27
- lastFiveDraws: 'Last 5 Draws',
28
- lastTenDraws: 'Last 10 Draws',
29
- lastFifteenDraws: 'Last 15 Draws'
30
- },
31
- };
32
- const translate = (key, customLang) => {
33
- const lang = customLang;
34
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
35
- };
36
-
37
- const lotteryDrawResultsHistoryCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #009993;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.DrawResultsSection{max-width:500px;margin:0 auto}.HistoryGridWrapper{padding:0 15px}.HistoryGrid{border:1px solid #009993;border-radius:5px}.DrawResultsHeader{color:#009993;padding:15px;text-align:center}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:#009993;padding:10px;text-align:center;color:#fff;padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:#009993;color:#fff;outline:none}.FilterSection{display:flex;justify-content:space-between;padding:10px 0 25px}.FilterSection .FilterResultsContainer{display:flex;gap:5px}.FilterSection .QuickFilterButton{cursor:pointer;width:max-content;border-radius:4px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .QuickFilterButton:hover{background:#F1F1F1}.FilterSection helper-filters{margin-left:auto}";
38
-
39
- const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
40
- constructor() {
41
- super();
42
- this.__registerHost();
43
- this.__attachShadow();
44
- /**
45
- * The number of results to be displayed
46
- */
47
- this.numberOfResults = 3;
48
- /**
49
- *Language
50
- */
51
- this.language = 'en';
52
- this.drawData = [];
53
- this.displayAllDrawsResults = true;
54
- this.showQuickFilters = true;
55
- this.winningDataSetsData = [''];
56
- this.getDrawsData = () => {
57
- let url = new URL(`${this.endpoint}/games/${this.gameId}`);
58
- fetch(url.href)
59
- .then((res) => {
60
- if (res.status >= 300) {
61
- throw new Error('There was an error while fetching the data');
62
- }
63
- return res.json();
64
- })
65
- .then((data) => {
66
- console.log("getDrawsData ", data);
67
- // filter out incomplete data sets for draws
68
- this.winningDataSetsData = data.draws.filter(draw => draw.winningNumbers);
69
- this.drawData = this.winningDataSetsData;
70
- console.log('this.drawData', this.drawData);
71
- });
72
- };
73
- this.filterResults = (resultsNumber) => {
74
- this.numberOfResults = resultsNumber;
75
- this.displayAllDrawsResults = true;
76
- };
77
- this.getDrawResults = (drawID) => {
78
- let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawID}`);
79
- let drawOptions = {
80
- method: "GET",
81
- headers: {
82
- 'Content-Type': "application/json",
83
- 'Accept': 'application/json',
84
- },
85
- };
86
- fetch(url.href, drawOptions)
87
- .then((response) => {
88
- return response.json();
89
- })
90
- .then((data) => {
91
- console.log("getDrawResults ", data);
92
- this.drawData = [data];
93
- });
94
- };
95
- this.viewAllResults = () => {
96
- this.numberOfResults = this.drawData.length;
97
- this.displayAllDrawsResults = false;
98
- window.scrollTo({ top: 0, behavior: 'smooth' });
99
- };
100
- }
101
- // Filters events
102
- filtersHandler(event) {
103
- var _a;
104
- this.getDrawResults((_a = event.detail) === null || _a === void 0 ? void 0 : _a.drawTicketId);
105
- this.showQuickFilters = false;
106
- }
107
- clearFiltersHandler() {
108
- this.drawData = this.winningDataSetsData;
109
- this.showQuickFilters = true;
110
- }
111
- connectedCallback() {
112
- this.getDrawsData();
113
- }
114
- disconnectedCallback() {
115
- clearInterval(this.interval);
116
- }
117
- render() {
118
- let gridHeader = h("div", { class: "DrawResultsHeader" }, this.displayAllDrawsResults ? h("h4", null, translate('drawResultsHeader', this.language)) :
119
- h("div", { class: "DrawResultsHeaderContent" }, h("div", { class: "FilterSection" }, this.showQuickFilters &&
120
- h("div", { class: "FilterResultsContainer" }, h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(5) }, translate('lastFiveDraws', this.language)), h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(10) }, translate('lastTenDraws', this.language)), h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(15) }, translate('lastFifteenDraws', this.language))), h("helper-filters", { "show-filter-id": "true", "activate-ticket-search": "false", "game-id": "3797", "player-id": "2323" })), h("h4", null, "All draws results history")));
121
- let gridContent = h("div", { class: "HistoryGridWrapper" }, h("div", { class: "HistoryGrid" }, this.drawData.map((item) => h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, "draw-id": item.id, "draw-mode": true })).reverse().slice(0, this.numberOfResults)));
122
- return h("section", { class: "GridWrapper" }, h("div", { class: "DrawResultsSection" }, h("div", { class: "DrawResultsArea" }, gridHeader, gridContent, this.displayAllDrawsResults && h("button", { class: "ViewAllResults", onClick: this.viewAllResults }, "View All"))));
123
- }
124
- static get style() { return lotteryDrawResultsHistoryCss; }
125
- }, [1, "lottery-draw-results-history", {
126
- "endpoint": [1],
127
- "gameId": [1, "game-id"],
128
- "numberOfResults": [2, "number-of-results"],
129
- "language": [1],
130
- "drawData": [32],
131
- "displayAllDrawsResults": [32],
132
- "showQuickFilters": [32],
133
- "winningDataSetsData": [32]
134
- }, [[0, "filterSelection", "filtersHandler"], [0, "filterSelectionReset", "clearFiltersHandler"]]]);
135
- function defineCustomElement() {
136
- if (typeof customElements === "undefined") {
137
- return;
138
- }
139
- const components = ["lottery-draw-results-history", "helper-filters", "helper-modal", "lottery-bullet", "lottery-draw-results", "lottery-grid"];
140
- components.forEach(tagName => { switch (tagName) {
141
- case "lottery-draw-results-history":
142
- if (!customElements.get(tagName)) {
143
- customElements.define(tagName, LotteryDrawResultsHistory);
144
- }
145
- break;
146
- case "helper-filters":
147
- if (!customElements.get(tagName)) {
148
- defineCustomElement$5();
149
- }
150
- break;
151
- case "helper-modal":
152
- if (!customElements.get(tagName)) {
153
- defineCustomElement$4();
154
- }
155
- break;
156
- case "lottery-bullet":
157
- if (!customElements.get(tagName)) {
158
- defineCustomElement$3();
159
- }
160
- break;
161
- case "lottery-draw-results":
162
- if (!customElements.get(tagName)) {
163
- defineCustomElement$2();
164
- }
165
- break;
166
- case "lottery-grid":
167
- if (!customElements.get(tagName)) {
168
- defineCustomElement$1();
169
- }
170
- break;
171
- } });
172
- }
173
- defineCustomElement();
174
-
175
- export { LotteryDrawResultsHistory as L, defineCustomElement as d };
@@ -1,6 +0,0 @@
1
- import { L as LotteryDrawResults$1, d as defineCustomElement$1 } from './lottery-draw-results2.js';
2
-
3
- const LotteryDrawResults = LotteryDrawResults$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { LotteryDrawResults, defineCustomElement };