@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.
- package/dist/cjs/helper-accordion_2.cjs.entry.js +124 -0
- package/dist/cjs/helper-modal.cjs.entry.js +1 -1
- package/dist/cjs/helper-tab.cjs.entry.js +11 -8
- package/dist/cjs/{index-81cb3b3b.js → index-614098f4.js} +5 -47
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/lottery-game-details.cjs.entry.js +1 -1
- package/dist/cjs/lottery-game-page.cjs.entry.js +53 -13
- package/dist/cjs/lottery-game-page.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -49
- package/dist/collection/components/lottery-game-page/lottery-game-page.css +27 -7
- package/dist/collection/components/lottery-game-page/lottery-game-page.js +22 -5
- package/dist/collection/utils/locale.utils.js +33 -6
- package/dist/components/helper-accordion2.js +7 -2
- package/dist/components/helper-tab2.js +12 -8
- package/dist/components/helper-tabs2.js +1 -1
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +0 -14
- package/dist/components/lottery-game-page.js +65 -65
- package/dist/esm/helper-accordion_2.entry.js +119 -0
- package/dist/esm/helper-modal.entry.js +1 -1
- package/dist/esm/helper-tab.entry.js +11 -8
- package/dist/esm/{index-be84da79.js → index-0fa076cd.js} +5 -47
- package/dist/esm/loader.js +3 -3
- package/dist/esm/lottery-game-details.entry.js +1 -1
- package/dist/esm/lottery-game-page.entry.js +53 -13
- package/dist/esm/lottery-game-page.js +3 -3
- package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
- package/dist/lottery-game-page/p-2d7ccc96.js +1 -0
- package/dist/lottery-game-page/{p-88f81126.entry.js → p-6183a920.entry.js} +1 -1
- package/dist/lottery-game-page/p-74eea5ec.entry.js +1 -0
- package/dist/lottery-game-page/p-75f13007.entry.js +1 -0
- package/dist/lottery-game-page/p-97d1602e.entry.js +1 -0
- package/dist/lottery-game-page/{p-a1dd3eb2.entry.js → p-d04141f7.entry.js} +1 -1
- package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +3 -0
- package/package.json +1 -1
- package/dist/cjs/helper-accordion.cjs.entry.js +0 -88
- package/dist/cjs/helper-filters_2.cjs.entry.js +0 -22490
- package/dist/cjs/helper-pagination.cjs.entry.js +0 -188
- package/dist/cjs/helper-tabs.cjs.entry.js +0 -38
- package/dist/cjs/lottery-bullet_2.cjs.entry.js +0 -202
- package/dist/cjs/lottery-draw-results-history.cjs.entry.js +0 -124
- package/dist/cjs/lottery-ticket-controller.cjs.entry.js +0 -69
- package/dist/cjs/lottery-ticket.cjs.entry.js +0 -146
- package/dist/components/helper-filters.js +0 -6
- package/dist/components/helper-filters2.js +0 -22348
- package/dist/components/helper-pagination.js +0 -216
- package/dist/components/lottery-bullet.js +0 -6
- package/dist/components/lottery-bullet2.js +0 -57
- package/dist/components/lottery-draw-results-history.js +0 -6
- package/dist/components/lottery-draw-results-history2.js +0 -175
- package/dist/components/lottery-draw-results.js +0 -6
- package/dist/components/lottery-draw-results2.js +0 -218
- package/dist/components/lottery-grid.js +0 -6
- package/dist/components/lottery-grid2.js +0 -197
- package/dist/components/lottery-ticket-controller.js +0 -6
- package/dist/components/lottery-ticket-controller2.js +0 -118
- package/dist/components/lottery-ticket.js +0 -6
- package/dist/components/lottery-ticket2.js +0 -184
- package/dist/esm/helper-accordion.entry.js +0 -84
- package/dist/esm/helper-filters_2.entry.js +0 -22485
- package/dist/esm/helper-pagination.entry.js +0 -184
- package/dist/esm/helper-tabs.entry.js +0 -34
- package/dist/esm/lottery-bullet_2.entry.js +0 -197
- package/dist/esm/lottery-draw-results-history.entry.js +0 -120
- package/dist/esm/lottery-ticket-controller.entry.js +0 -65
- package/dist/esm/lottery-ticket.entry.js +0 -142
- package/dist/lottery-game-page/p-010895a3.entry.js +0 -1
- package/dist/lottery-game-page/p-08581ede.entry.js +0 -1
- package/dist/lottery-game-page/p-09f983c6.entry.js +0 -1
- package/dist/lottery-game-page/p-0c7ada78.entry.js +0 -1
- package/dist/lottery-game-page/p-2932d2a7.entry.js +0 -1
- package/dist/lottery-game-page/p-48831184.entry.js +0 -1
- package/dist/lottery-game-page/p-50298d2c.entry.js +0 -1
- package/dist/lottery-game-page/p-6736fa79.entry.js +0 -1
- package/dist/lottery-game-page/p-91420518.js +0 -2
- package/dist/lottery-game-page/p-95b37270.entry.js +0 -2849
- package/dist/lottery-game-page/p-caf09eaf.entry.js +0 -1
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-be84da79.js';
|
|
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 = class {
|
|
40
|
-
constructor(hostRef) {
|
|
41
|
-
registerInstance(this, hostRef);
|
|
42
|
-
this.hpPageChange = createEvent(this, "hpPageChange", 7);
|
|
43
|
-
/**
|
|
44
|
-
* First page boolean value - determines if the page is disabled or active
|
|
45
|
-
*/
|
|
46
|
-
this.firstPage = false;
|
|
47
|
-
/**
|
|
48
|
-
* Previous page boolean value - determines if the page is disabled or active
|
|
49
|
-
*/
|
|
50
|
-
this.previousPage = false;
|
|
51
|
-
/**
|
|
52
|
-
* The received offset
|
|
53
|
-
*/
|
|
54
|
-
this.offset = 0;
|
|
55
|
-
/**
|
|
56
|
-
* The received limit for the number of pages
|
|
57
|
-
*/
|
|
58
|
-
this.limit = 1;
|
|
59
|
-
/**
|
|
60
|
-
* The received total number of pages
|
|
61
|
-
*/
|
|
62
|
-
this.total = 1;
|
|
63
|
-
/**
|
|
64
|
-
* Language
|
|
65
|
-
*/
|
|
66
|
-
this.language = 'en';
|
|
67
|
-
/**
|
|
68
|
-
* In component working variable for the array of pages
|
|
69
|
-
*/
|
|
70
|
-
this.pagesArray = [];
|
|
71
|
-
/**
|
|
72
|
-
* In component working variable for last page
|
|
73
|
-
*/
|
|
74
|
-
this.endInt = 0;
|
|
75
|
-
this.userAgent = window.navigator.userAgent;
|
|
76
|
-
this.currentPage = 1;
|
|
77
|
-
/**
|
|
78
|
-
* Navigation logic
|
|
79
|
-
*/
|
|
80
|
-
this.navigateTo = (navigationPage) => {
|
|
81
|
-
switch (navigationPage) {
|
|
82
|
-
case 'firstPage':
|
|
83
|
-
this.offsetInt = 0;
|
|
84
|
-
break;
|
|
85
|
-
case 'lastPage':
|
|
86
|
-
this.offsetInt = this.endInt * this.limitInt;
|
|
87
|
-
break;
|
|
88
|
-
case 'previousPage':
|
|
89
|
-
this.offsetInt -= 10;
|
|
90
|
-
break;
|
|
91
|
-
case 'nextPage':
|
|
92
|
-
this.offsetInt += 10;
|
|
93
|
-
break;
|
|
94
|
-
case 'fivePagesBack':
|
|
95
|
-
this.offsetInt -= 30;
|
|
96
|
-
this.offsetInt = this.offsetInt < 0 ? 0 : this.offsetInt;
|
|
97
|
-
break;
|
|
98
|
-
case 'fivePagesForward':
|
|
99
|
-
this.offsetInt += 30;
|
|
100
|
-
this.offsetInt = this.offsetInt / 10 >= this.endInt ? this.endInt * 10 : this.offsetInt;
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Handle navigation from here
|
|
107
|
-
*/
|
|
108
|
-
this.paginationNavigation = (pageNumber, index) => {
|
|
109
|
-
if (!isNaN(pageNumber)) {
|
|
110
|
-
if (pageNumber === 1) {
|
|
111
|
-
this.offsetInt = pageNumber - 1;
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
this.offsetInt = (pageNumber - 1) * 10;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
if (index === 0 && this.currentPage <= 4) {
|
|
119
|
-
this.navigateTo('firstPage');
|
|
120
|
-
}
|
|
121
|
-
else if (index === 0 && this.currentPage > 4) {
|
|
122
|
-
this.navigateTo('fivePagesBack');
|
|
123
|
-
}
|
|
124
|
-
else if (index === 4 && this.endInt - this.currentPage >= 2) {
|
|
125
|
-
this.navigateTo('fivePagesForward');
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
this.currentPage = this.offsetInt;
|
|
129
|
-
this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
componentWillRender() {
|
|
133
|
-
this.offsetInt = this.offset;
|
|
134
|
-
this.currentPage = this.offsetInt / this.limitInt + 1;
|
|
135
|
-
this.limitInt = this.limit;
|
|
136
|
-
this.totalInt = this.total;
|
|
137
|
-
this.endInt = (Math.ceil(this.totalInt / this.limitInt) - 1);
|
|
138
|
-
this.lastPage = (this.offsetInt >= this.endInt * this.limitInt) ? false : true;
|
|
139
|
-
/**
|
|
140
|
-
* Construct numbered navigation area based on current page position
|
|
141
|
-
*/
|
|
142
|
-
if (this.currentPage === 1 || this.currentPage === 2) {
|
|
143
|
-
this.pagesArray = Array.from({ length: 4 }, (_, i) => i + 1);
|
|
144
|
-
this.pagesArray.push('...');
|
|
145
|
-
}
|
|
146
|
-
else if (this.currentPage >= 3 && ((this.endInt - this.currentPage) >= 2)) {
|
|
147
|
-
this.pagesArray = Array.from({ length: 3 }, (_, i) => this.currentPage + i - 1);
|
|
148
|
-
this.pagesArray.push('...');
|
|
149
|
-
this.pagesArray.unshift('...');
|
|
150
|
-
}
|
|
151
|
-
else if ((this.endInt - this.currentPage) < 3) {
|
|
152
|
-
this.pagesArray = Array.from({ length: 4 }, (_, i) => this.endInt - 2 + i);
|
|
153
|
-
this.pagesArray.unshift('...');
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
render() {
|
|
157
|
-
/**
|
|
158
|
-
* Center navigation area
|
|
159
|
-
*/
|
|
160
|
-
let navigationArea = h("ul", { class: "PaginationArea" }, this.pagesArray.map((item, index) => {
|
|
161
|
-
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))));
|
|
162
|
-
}));
|
|
163
|
-
/**
|
|
164
|
-
* Left navigation area
|
|
165
|
-
*/
|
|
166
|
-
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)));
|
|
167
|
-
if (isMobile(this.userAgent)) {
|
|
168
|
-
buttonsLeftSide =
|
|
169
|
-
h("div", { class: "LeftItems" }, h("button", { disabled: !this.previousPage ? true : false, onClick: this.navigateTo.bind(this, 'previousPage') }, translate('previousPage', this.language)));
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Right navigation area
|
|
173
|
-
*/
|
|
174
|
-
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)));
|
|
175
|
-
if (isMobile(this.userAgent)) {
|
|
176
|
-
buttonsRightSide =
|
|
177
|
-
h("div", { class: "RightItems" }, h("button", { disabled: !this.lastPage ? true : false, onClick: this.navigateTo.bind(this, 'nextPage') }, translate('nextPage', this.language)));
|
|
178
|
-
}
|
|
179
|
-
return (h("div", { id: "PaginationContainer" }, buttonsLeftSide, navigationArea, buttonsRightSide));
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
HelperPagination.style = helperPaginationCss;
|
|
183
|
-
|
|
184
|
-
export { HelperPagination as helper_pagination };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-be84da79.js';
|
|
2
|
-
|
|
3
|
-
const helperTabsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Tabs{display:flex;gap:10px;overflow-x:auto}.TabButton{cursor:pointer;width:auto;border-radius:4px;padding:8px 15px;margin:5px 0 10px;border:1px solid #009993;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0;white-space:nowrap}.TabButton:hover{background:#F1F1F1}.TabButton.Active{background:#009993;color:#FFF}";
|
|
4
|
-
|
|
5
|
-
const HelperTabs = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
/**
|
|
9
|
-
* Tell me if it is disabled
|
|
10
|
-
*/
|
|
11
|
-
this.disabled = false;
|
|
12
|
-
/**
|
|
13
|
-
* Tell me what tab is selected
|
|
14
|
-
*/
|
|
15
|
-
this.selected = false;
|
|
16
|
-
/**
|
|
17
|
-
* Default selected index
|
|
18
|
-
*/
|
|
19
|
-
this.selectedIndex = 0;
|
|
20
|
-
/**
|
|
21
|
-
* Tabs details
|
|
22
|
-
*/
|
|
23
|
-
this.tabs = [{ label: 'Draw Details' }, { label: 'Winnings' }, { label: 'How to Play' }, { label: 'Game Odds' }, { label: 'FAQs' }];
|
|
24
|
-
}
|
|
25
|
-
connectedCallback() {
|
|
26
|
-
}
|
|
27
|
-
render() {
|
|
28
|
-
return (h("div", null, h("div", { class: "Tabs" }, this.tabs.map((tab, index) => h("button", { class: 'TabButton' + (this.selectedIndex == index ? ' Active' : ''), onClick: () => this.selectedIndex = index }, tab.label))), h("div", null, h("helper-tab", { selectedIndex: this.selectedIndex }))));
|
|
29
|
-
}
|
|
30
|
-
get host() { return getElement(this); }
|
|
31
|
-
};
|
|
32
|
-
HelperTabs.style = helperTabsCss;
|
|
33
|
-
|
|
34
|
-
export { HelperTabs as helper_tabs };
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-be84da79.js';
|
|
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 = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.bulletEvent = createEvent(this, "lotteryBulletSelection", 7);
|
|
9
|
-
/**
|
|
10
|
-
* Value of the bullet
|
|
11
|
-
*/
|
|
12
|
-
this.value = '0';
|
|
13
|
-
/**
|
|
14
|
-
* Marks if the bullet should be selectable
|
|
15
|
-
*/
|
|
16
|
-
this.selectable = true;
|
|
17
|
-
/**
|
|
18
|
-
* Marks if the bullet should be selected
|
|
19
|
-
*/
|
|
20
|
-
this.isSelected = false;
|
|
21
|
-
this.select = () => {
|
|
22
|
-
if (this.selectable) {
|
|
23
|
-
this.isSelected = !this.isSelected;
|
|
24
|
-
this.bulletEvent.emit({
|
|
25
|
-
value: this.value,
|
|
26
|
-
selected: this.isSelected
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
render() {
|
|
32
|
-
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select() }, this.value));
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
LotteryBullet.style = lotteryBulletCss;
|
|
36
|
-
|
|
37
|
-
const lotteryGridCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridContainer{display:flex;flex-direction:column;max-width:350px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:10px}";
|
|
38
|
-
|
|
39
|
-
const LotteryGrid = class {
|
|
40
|
-
constructor(hostRef) {
|
|
41
|
-
registerInstance(this, hostRef);
|
|
42
|
-
this.gridFilledEvent = createEvent(this, "gridFilled", 7);
|
|
43
|
-
this.gridDirtyEvent = createEvent(this, "gridDirty", 7);
|
|
44
|
-
/**
|
|
45
|
-
* Number of bullets of grid
|
|
46
|
-
*/
|
|
47
|
-
this.totalNumbers = 0;
|
|
48
|
-
/**
|
|
49
|
-
* Number of maximum bullets that can be selected
|
|
50
|
-
*/
|
|
51
|
-
this.maximumAllowed = 0;
|
|
52
|
-
/**
|
|
53
|
-
* Minimum allowed of bullets
|
|
54
|
-
*/
|
|
55
|
-
this.minimumAllowed = 1;
|
|
56
|
-
/**
|
|
57
|
-
* Allows the user to select numbers on the grid
|
|
58
|
-
*/
|
|
59
|
-
this.selectable = true;
|
|
60
|
-
/**
|
|
61
|
-
* Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')
|
|
62
|
-
*/
|
|
63
|
-
this.selectedNumbers = '';
|
|
64
|
-
/**
|
|
65
|
-
* Show only selected numbers
|
|
66
|
-
*/
|
|
67
|
-
this.displaySelected = false;
|
|
68
|
-
/**
|
|
69
|
-
* Language
|
|
70
|
-
*/
|
|
71
|
-
this.language = 'en';
|
|
72
|
-
this.numbers = [];
|
|
73
|
-
this.selectedCounter = 0;
|
|
74
|
-
}
|
|
75
|
-
connectedCallback() {
|
|
76
|
-
let selected = [];
|
|
77
|
-
if (this.selectedNumbers.length > 0) {
|
|
78
|
-
selected = this.selectedNumbers.split(',');
|
|
79
|
-
this.selectedCounter = selected.length;
|
|
80
|
-
}
|
|
81
|
-
if (this.displaySelected) {
|
|
82
|
-
selected.forEach((item) => {
|
|
83
|
-
this.numbers.push({
|
|
84
|
-
number: item,
|
|
85
|
-
selected: true,
|
|
86
|
-
selectable: this.selectable
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
[...Array(this.totalNumbers).keys()]
|
|
92
|
-
.map(number => (number + 1).toString())
|
|
93
|
-
.forEach((number) => {
|
|
94
|
-
this.numbers.push({
|
|
95
|
-
number,
|
|
96
|
-
selected: selected.indexOf(number) >= 0 ? true : false,
|
|
97
|
-
selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
lotteryBulletSelectionHandler(event) {
|
|
103
|
-
this.numbers = this.numbers.map((item) => {
|
|
104
|
-
if (item.number == event.detail.value) {
|
|
105
|
-
return {
|
|
106
|
-
number: item.number,
|
|
107
|
-
selected: event.detail.selected,
|
|
108
|
-
selectable: item.selectable
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
return {
|
|
112
|
-
number: item.number,
|
|
113
|
-
selected: item.selected,
|
|
114
|
-
selectable: item.selectable
|
|
115
|
-
};
|
|
116
|
-
});
|
|
117
|
-
if (event.detail.selected) {
|
|
118
|
-
this.selectedCounter += 1;
|
|
119
|
-
if (this.selectedCounter == this.maximumAllowed) {
|
|
120
|
-
this.numbers = this.numbers.map((item) => {
|
|
121
|
-
return {
|
|
122
|
-
number: item.number,
|
|
123
|
-
selected: item.selected,
|
|
124
|
-
selectable: item.selected ? true : false
|
|
125
|
-
};
|
|
126
|
-
});
|
|
127
|
-
this.gridFilledEvent.emit({
|
|
128
|
-
id: this.ticketId,
|
|
129
|
-
index: this.gridIndex,
|
|
130
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
if (this.selectedCounter == this.maximumAllowed) {
|
|
136
|
-
this.numbers = this.numbers.map((item) => {
|
|
137
|
-
return {
|
|
138
|
-
number: item.number,
|
|
139
|
-
selected: item.selected,
|
|
140
|
-
selectable: true
|
|
141
|
-
};
|
|
142
|
-
});
|
|
143
|
-
this.gridDirtyEvent.emit({
|
|
144
|
-
id: this.ticketId,
|
|
145
|
-
index: this.gridIndex,
|
|
146
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
this.selectedCounter -= 1;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
async resetSelectionHandler(event) {
|
|
153
|
-
if (event.detail && event.detail == this.ticketId) {
|
|
154
|
-
this.selectedCounter = 0;
|
|
155
|
-
this.numbers = this.numbers.map((item) => {
|
|
156
|
-
return {
|
|
157
|
-
number: item.number,
|
|
158
|
-
selected: false,
|
|
159
|
-
selectable: this.selectable
|
|
160
|
-
};
|
|
161
|
-
});
|
|
162
|
-
this.gridDirtyEvent.emit({
|
|
163
|
-
id: this.ticketId,
|
|
164
|
-
index: this.gridIndex,
|
|
165
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
async autoSelectionHandler(event) {
|
|
170
|
-
if (event.detail && event.detail == this.ticketId) {
|
|
171
|
-
this.resetSelectionHandler(event);
|
|
172
|
-
let array = [...Array(this.totalNumbers).keys()]
|
|
173
|
-
.map(number => number + 1)
|
|
174
|
-
.sort(() => 0.5 - Math.random());
|
|
175
|
-
array = array.slice(0, this.minimumAllowed);
|
|
176
|
-
this.numbers = this.numbers.map((item) => {
|
|
177
|
-
return {
|
|
178
|
-
number: item.number,
|
|
179
|
-
selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
180
|
-
selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
181
|
-
};
|
|
182
|
-
});
|
|
183
|
-
this.gridFilledEvent.emit({
|
|
184
|
-
id: this.ticketId,
|
|
185
|
-
index: this.gridIndex,
|
|
186
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
187
|
-
});
|
|
188
|
-
this.selectedCounter = this.maximumAllowed;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
render() {
|
|
192
|
-
return (h("div", { class: "GridContainer" }, h("div", { class: "Grid" }, this.numbers.map((item) => h("div", null, h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected }))))));
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
LotteryGrid.style = lotteryGridCss;
|
|
196
|
-
|
|
197
|
-
export { LotteryBullet as lottery_bullet, LotteryGrid as lottery_grid };
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-be84da79.js';
|
|
2
|
-
|
|
3
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
4
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
5
|
-
const TRANSLATIONS = {
|
|
6
|
-
en: {
|
|
7
|
-
drawResultsHeader: 'Draw results history',
|
|
8
|
-
drawId: 'Draw ID',
|
|
9
|
-
drawDate: 'Draw Date',
|
|
10
|
-
drawNumbersGridA: 'Draw numbers Grid A',
|
|
11
|
-
viewAllResults: 'View All',
|
|
12
|
-
lastFiveDraws: 'Last 5 Draws',
|
|
13
|
-
lastTenDraws: 'Last 10 Draws',
|
|
14
|
-
lastFifteenDraws: 'Last 15 Draws'
|
|
15
|
-
},
|
|
16
|
-
ro: {
|
|
17
|
-
drawResultsHeader: 'Draw results history',
|
|
18
|
-
drawId: 'Draw ID',
|
|
19
|
-
drawDate: 'Draw Date',
|
|
20
|
-
drawNumbersGridA: 'Draw numbers Grid A',
|
|
21
|
-
viewAllResults: 'View All',
|
|
22
|
-
lastFiveDraws: 'Last 5 Draws',
|
|
23
|
-
lastTenDraws: 'Last 10 Draws',
|
|
24
|
-
lastFifteenDraws: 'Last 15 Draws'
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
const translate = (key, customLang) => {
|
|
28
|
-
const lang = customLang;
|
|
29
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
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}";
|
|
33
|
-
|
|
34
|
-
const LotteryDrawResultsHistory = class {
|
|
35
|
-
constructor(hostRef) {
|
|
36
|
-
registerInstance(this, hostRef);
|
|
37
|
-
/**
|
|
38
|
-
* The number of results to be displayed
|
|
39
|
-
*/
|
|
40
|
-
this.numberOfResults = 3;
|
|
41
|
-
/**
|
|
42
|
-
*Language
|
|
43
|
-
*/
|
|
44
|
-
this.language = 'en';
|
|
45
|
-
this.drawData = [];
|
|
46
|
-
this.displayAllDrawsResults = true;
|
|
47
|
-
this.showQuickFilters = true;
|
|
48
|
-
this.winningDataSetsData = [''];
|
|
49
|
-
this.getDrawsData = () => {
|
|
50
|
-
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
51
|
-
fetch(url.href)
|
|
52
|
-
.then((res) => {
|
|
53
|
-
if (res.status >= 300) {
|
|
54
|
-
throw new Error('There was an error while fetching the data');
|
|
55
|
-
}
|
|
56
|
-
return res.json();
|
|
57
|
-
})
|
|
58
|
-
.then((data) => {
|
|
59
|
-
console.log("getDrawsData ", data);
|
|
60
|
-
// filter out incomplete data sets for draws
|
|
61
|
-
this.winningDataSetsData = data.draws.filter(draw => draw.winningNumbers);
|
|
62
|
-
this.drawData = this.winningDataSetsData;
|
|
63
|
-
console.log('this.drawData', this.drawData);
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
this.filterResults = (resultsNumber) => {
|
|
67
|
-
this.numberOfResults = resultsNumber;
|
|
68
|
-
this.displayAllDrawsResults = true;
|
|
69
|
-
};
|
|
70
|
-
this.getDrawResults = (drawID) => {
|
|
71
|
-
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawID}`);
|
|
72
|
-
let drawOptions = {
|
|
73
|
-
method: "GET",
|
|
74
|
-
headers: {
|
|
75
|
-
'Content-Type': "application/json",
|
|
76
|
-
'Accept': 'application/json',
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
fetch(url.href, drawOptions)
|
|
80
|
-
.then((response) => {
|
|
81
|
-
return response.json();
|
|
82
|
-
})
|
|
83
|
-
.then((data) => {
|
|
84
|
-
console.log("getDrawResults ", data);
|
|
85
|
-
this.drawData = [data];
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
this.viewAllResults = () => {
|
|
89
|
-
this.numberOfResults = this.drawData.length;
|
|
90
|
-
this.displayAllDrawsResults = false;
|
|
91
|
-
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
// Filters events
|
|
95
|
-
filtersHandler(event) {
|
|
96
|
-
var _a;
|
|
97
|
-
this.getDrawResults((_a = event.detail) === null || _a === void 0 ? void 0 : _a.drawTicketId);
|
|
98
|
-
this.showQuickFilters = false;
|
|
99
|
-
}
|
|
100
|
-
clearFiltersHandler() {
|
|
101
|
-
this.drawData = this.winningDataSetsData;
|
|
102
|
-
this.showQuickFilters = true;
|
|
103
|
-
}
|
|
104
|
-
connectedCallback() {
|
|
105
|
-
this.getDrawsData();
|
|
106
|
-
}
|
|
107
|
-
disconnectedCallback() {
|
|
108
|
-
clearInterval(this.interval);
|
|
109
|
-
}
|
|
110
|
-
render() {
|
|
111
|
-
let gridHeader = h("div", { class: "DrawResultsHeader" }, this.displayAllDrawsResults ? h("h4", null, translate('drawResultsHeader', this.language)) :
|
|
112
|
-
h("div", { class: "DrawResultsHeaderContent" }, h("div", { class: "FilterSection" }, this.showQuickFilters &&
|
|
113
|
-
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")));
|
|
114
|
-
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)));
|
|
115
|
-
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"))));
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
LotteryDrawResultsHistory.style = lotteryDrawResultsHistoryCss;
|
|
119
|
-
|
|
120
|
-
export { LotteryDrawResultsHistory as lottery_draw_results_history };
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-be84da79.js';
|
|
2
|
-
|
|
3
|
-
const lotteryTicketControllerCss = ":host{display:block}";
|
|
4
|
-
|
|
5
|
-
const LotteryTicketController = class {
|
|
6
|
-
constructor(hostRef) {
|
|
7
|
-
registerInstance(this, hostRef);
|
|
8
|
-
this.deleteTicketEvent = createEvent(this, "deleteTicket", 7);
|
|
9
|
-
/**
|
|
10
|
-
* Endpoint URL for the source of data (NorWAy standard)
|
|
11
|
-
*/
|
|
12
|
-
this.endpoint = '';
|
|
13
|
-
/**
|
|
14
|
-
* Ticket number
|
|
15
|
-
*/
|
|
16
|
-
this.ticketId = 1;
|
|
17
|
-
/**
|
|
18
|
-
* Activates postMessages as events for actions from the widget
|
|
19
|
-
*/
|
|
20
|
-
this.postMessage = false;
|
|
21
|
-
/**
|
|
22
|
-
* Name of the event emitter by the action button
|
|
23
|
-
*/
|
|
24
|
-
this.eventName = 'deleteTicketAction';
|
|
25
|
-
/**
|
|
26
|
-
* Collapsed
|
|
27
|
-
*/
|
|
28
|
-
this.collapsed = true;
|
|
29
|
-
/**
|
|
30
|
-
* Number of grids?
|
|
31
|
-
*/
|
|
32
|
-
this.numberOfGrids = 1;
|
|
33
|
-
/**
|
|
34
|
-
* This toggles if the last ticket added should be expanded or not
|
|
35
|
-
*/
|
|
36
|
-
this.last = false;
|
|
37
|
-
/**
|
|
38
|
-
* Language
|
|
39
|
-
*/
|
|
40
|
-
this.language = 'en';
|
|
41
|
-
/**
|
|
42
|
-
* Shows the auto-pick button
|
|
43
|
-
*/
|
|
44
|
-
this.autoPick = false;
|
|
45
|
-
/**
|
|
46
|
-
* Shows the reset button
|
|
47
|
-
*/
|
|
48
|
-
this.resetButton = false;
|
|
49
|
-
}
|
|
50
|
-
// @TODO fix the `any` type
|
|
51
|
-
helperAccordionActionHandler() {
|
|
52
|
-
if (this.postMessage) {
|
|
53
|
-
window.postMessage({ type: this.eventName }, window.location.href);
|
|
54
|
-
}
|
|
55
|
-
this.deleteTicketEvent.emit({
|
|
56
|
-
ticketId: this.ticketId
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
render() {
|
|
60
|
-
return (h("div", null, h("helper-accordion", { "header-title": 'Ticket ' + this.ticketId, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": true, collapsed: !this.last || this.collapsed, language: this.language }, h("div", { slot: "accordionContent" }, h("lottery-ticket", { endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick })))));
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
LotteryTicketController.style = lotteryTicketControllerCss;
|
|
64
|
-
|
|
65
|
-
export { LotteryTicketController as lottery_ticket_controller };
|