@everymatrix/lottery-game-page 0.0.17 → 0.1.1
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-modal.cjs.entry.js +1 -1
- package/dist/cjs/{index-81cb3b3b.js → index-614098f4.js} +5 -47
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/lottery-draw-results.cjs.entry.js +188 -0
- 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 -62
- 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/index.d.ts +5 -1
- package/dist/components/index.js +0 -14
- package/dist/components/lottery-draw-results2.js +62 -59
- package/dist/components/lottery-game-page.js +59 -77
- package/dist/esm/helper-modal.entry.js +1 -1
- package/dist/esm/{index-be84da79.js → index-0fa076cd.js} +5 -47
- package/dist/esm/loader.js +3 -3
- package/dist/esm/lottery-draw-results.entry.js +184 -0
- 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-9ca649d9.entry.js +1 -0
- package/dist/lottery-game-page/p-e98ee83a.entry.js +1 -0
- 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-tab.cjs.entry.js +0 -33
- 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-game-details.cjs.entry.js +0 -19
- 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-accordion.js +0 -6
- package/dist/components/helper-accordion2.js +0 -111
- 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/helper-tab.js +0 -6
- package/dist/components/helper-tab2.js +0 -48
- package/dist/components/helper-tabs.js +0 -6
- package/dist/components/helper-tabs2.js +0 -63
- 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-game-details.js +0 -6
- package/dist/components/lottery-game-details2.js +0 -49
- 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-tab.entry.js +0 -29
- 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-game-details.entry.js +0 -15
- 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-a1dd3eb2.entry.js +0 -1
- package/dist/lottery-game-page/p-caf09eaf.entry.js +0 -1
|
@@ -4,82 +4,21 @@
|
|
|
4
4
|
],
|
|
5
5
|
"compiler": {
|
|
6
6
|
"name": "@stencil/core",
|
|
7
|
-
"version": "2.
|
|
7
|
+
"version": "2.15.2",
|
|
8
8
|
"typescriptVersion": "4.5.4"
|
|
9
9
|
},
|
|
10
10
|
"collections": [
|
|
11
|
-
{
|
|
12
|
-
"name": "@everymatrix/helper-accordion",
|
|
13
|
-
"tags": [
|
|
14
|
-
"helper-accordion"
|
|
15
|
-
]
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"name": "@everymatrix/helper-filters",
|
|
19
|
-
"tags": [
|
|
20
|
-
"helper-filters"
|
|
21
|
-
]
|
|
22
|
-
},
|
|
23
11
|
{
|
|
24
12
|
"name": "@everymatrix/helper-modal",
|
|
25
13
|
"tags": [
|
|
26
14
|
"helper-modal"
|
|
27
15
|
]
|
|
28
16
|
},
|
|
29
|
-
{
|
|
30
|
-
"name": "@everymatrix/helper-pagination",
|
|
31
|
-
"tags": [
|
|
32
|
-
"helper-pagination"
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"name": "@everymatrix/helper-tabs",
|
|
37
|
-
"tags": [
|
|
38
|
-
"helper-tab",
|
|
39
|
-
"helper-tabs"
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"name": "@everymatrix/lottery-bullet",
|
|
44
|
-
"tags": [
|
|
45
|
-
"lottery-bullet"
|
|
46
|
-
]
|
|
47
|
-
},
|
|
48
17
|
{
|
|
49
18
|
"name": "@everymatrix/lottery-draw-results",
|
|
50
19
|
"tags": [
|
|
51
20
|
"lottery-draw-results"
|
|
52
21
|
]
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"name": "@everymatrix/lottery-draw-results-history",
|
|
56
|
-
"tags": [
|
|
57
|
-
"lottery-draw-results-history"
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"name": "@everymatrix/lottery-game-details",
|
|
62
|
-
"tags": [
|
|
63
|
-
"lottery-game-details"
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"name": "@everymatrix/lottery-grid",
|
|
68
|
-
"tags": [
|
|
69
|
-
"lottery-grid"
|
|
70
|
-
]
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"name": "@everymatrix/lottery-ticket",
|
|
74
|
-
"tags": [
|
|
75
|
-
"lottery-ticket"
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"name": "@everymatrix/lottery-ticket-controller",
|
|
80
|
-
"tags": [
|
|
81
|
-
"lottery-ticket-controller"
|
|
82
|
-
]
|
|
83
22
|
}
|
|
84
23
|
],
|
|
85
24
|
"bundles": [
|
|
@@ -36,16 +36,17 @@
|
|
|
36
36
|
align-items: center;
|
|
37
37
|
}
|
|
38
38
|
.GamePage .TotalWinnings {
|
|
39
|
-
color: #
|
|
39
|
+
color: #000;
|
|
40
40
|
font-size: 18px;
|
|
41
41
|
display: flex;
|
|
42
|
-
flex-direction:
|
|
42
|
+
flex-direction: row;
|
|
43
43
|
justify-content: center;
|
|
44
44
|
align-items: center;
|
|
45
45
|
gap: 10px;
|
|
46
|
+
text-transform: uppercase;
|
|
46
47
|
}
|
|
47
48
|
.GamePage .TotalWinnings span {
|
|
48
|
-
font-size:
|
|
49
|
+
font-size: 18px;
|
|
49
50
|
font-weight: 700;
|
|
50
51
|
}
|
|
51
52
|
.GamePage .NextDraw {
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
font-weight: 600;
|
|
55
56
|
margin: 0 auto;
|
|
56
57
|
text-align: center;
|
|
57
|
-
text-transform:
|
|
58
|
+
text-transform: uppercase;
|
|
58
59
|
display: flex;
|
|
59
60
|
justify-content: center;
|
|
60
61
|
align-items: center;
|
|
@@ -63,6 +64,9 @@
|
|
|
63
64
|
.GamePage .NextDraw .BannerText {
|
|
64
65
|
font-weight: 400;
|
|
65
66
|
font-size: 18px;
|
|
67
|
+
text-transform: uppercase;
|
|
68
|
+
padding: 0;
|
|
69
|
+
margin: 15px 0 0 0;
|
|
66
70
|
}
|
|
67
71
|
.GamePage .NextDraw .BannerCountdown {
|
|
68
72
|
font-size: 22px;
|
|
@@ -95,9 +99,21 @@
|
|
|
95
99
|
color: #FFF;
|
|
96
100
|
}
|
|
97
101
|
|
|
102
|
+
.LastDrawResultsTitle {
|
|
103
|
+
color: #009993;
|
|
104
|
+
padding: 25px 0 10px 0;
|
|
105
|
+
text-align: center;
|
|
106
|
+
border-radius: 4px;
|
|
107
|
+
text-transform: uppercase;
|
|
108
|
+
font-size: 16px;
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
margin: 0;
|
|
111
|
+
}
|
|
112
|
+
|
|
98
113
|
.NextDrawWrapper {
|
|
99
114
|
padding: 10px 15px;
|
|
100
|
-
background: #
|
|
115
|
+
background: #F1F1F1;
|
|
116
|
+
background: linear-gradient(0deg, #f1f1f1 0%, rgba(253, 187, 45, 0) 100%);
|
|
101
117
|
}
|
|
102
118
|
.NextDrawWrapper .BannerText {
|
|
103
119
|
font-size: 16px;
|
|
@@ -114,7 +130,7 @@
|
|
|
114
130
|
}
|
|
115
131
|
|
|
116
132
|
.GamePageContent {
|
|
117
|
-
padding:
|
|
133
|
+
padding: 15px;
|
|
118
134
|
max-width: 1200px;
|
|
119
135
|
margin: 0 auto;
|
|
120
136
|
}
|
|
@@ -122,7 +138,6 @@
|
|
|
122
138
|
.GameDetails {
|
|
123
139
|
padding-bottom: 10px;
|
|
124
140
|
margin-bottom: 20px;
|
|
125
|
-
border-bottom: 1px solid #e9e9e9;
|
|
126
141
|
}
|
|
127
142
|
|
|
128
143
|
.CreateNewTicket {
|
|
@@ -221,6 +236,11 @@
|
|
|
221
236
|
.ButtonWrapper .Button:hover {
|
|
222
237
|
background: #00ABA4;
|
|
223
238
|
}
|
|
239
|
+
.ButtonWrapper .Button.ButtonDisabled {
|
|
240
|
+
pointer-events: none;
|
|
241
|
+
background: #ccc;
|
|
242
|
+
border: 1px solid #ccc;
|
|
243
|
+
}
|
|
224
244
|
|
|
225
245
|
.SubmitModalSuccess {
|
|
226
246
|
text-align: center;
|
|
@@ -28,6 +28,8 @@ export class LotteryGamePage {
|
|
|
28
28
|
this.deleteVisible = false;
|
|
29
29
|
this.latestDraw = {};
|
|
30
30
|
this.totalWinningsAmount = 0;
|
|
31
|
+
this.isLoggedIn = false;
|
|
32
|
+
this.loginModalVisible = false;
|
|
31
33
|
this.multiplier = false;
|
|
32
34
|
this.quickPick = false;
|
|
33
35
|
}
|
|
@@ -35,6 +37,10 @@ export class LotteryGamePage {
|
|
|
35
37
|
connectedCallback() {
|
|
36
38
|
this.getGameDetails();
|
|
37
39
|
this.getDraws();
|
|
40
|
+
console.log(this.language);
|
|
41
|
+
if (this.sessionId) {
|
|
42
|
+
this.isLoggedIn = true;
|
|
43
|
+
}
|
|
38
44
|
}
|
|
39
45
|
countdownLogic(date) {
|
|
40
46
|
this.interval = setInterval(() => {
|
|
@@ -61,7 +67,6 @@ export class LotteryGamePage {
|
|
|
61
67
|
this.gameData = data;
|
|
62
68
|
this.basicStake = this.gameData.rules.stakes[0].amount;
|
|
63
69
|
let draws = this.gameData.draws.filter((item) => !item.winningNumbers);
|
|
64
|
-
console.log('draws', draws);
|
|
65
70
|
this.nextDraw = draws[0].id;
|
|
66
71
|
this.createNewTicket();
|
|
67
72
|
})
|
|
@@ -124,6 +129,7 @@ export class LotteryGamePage {
|
|
|
124
129
|
}
|
|
125
130
|
modalCloseEvent() {
|
|
126
131
|
this.deleteVisible = false;
|
|
132
|
+
this.loginModalVisible = false;
|
|
127
133
|
}
|
|
128
134
|
stakeChangeHandler(event) {
|
|
129
135
|
const { ticketId, stake } = event.detail;
|
|
@@ -185,6 +191,9 @@ export class LotteryGamePage {
|
|
|
185
191
|
{ gameId: this.gameId, ticketId: this.tickets.length + 1, completed: false, amount: 1, stake: this.basicStake, grids: [] }
|
|
186
192
|
];
|
|
187
193
|
}
|
|
194
|
+
showLoginModal() {
|
|
195
|
+
this.loginModalVisible = true;
|
|
196
|
+
}
|
|
188
197
|
submitTickets() {
|
|
189
198
|
let url = new URL(`${this.endpoint}/tickets`);
|
|
190
199
|
// @TODO Body TS type
|
|
@@ -192,7 +201,6 @@ export class LotteryGamePage {
|
|
|
192
201
|
gameId: this.gameId,
|
|
193
202
|
tickets: []
|
|
194
203
|
};
|
|
195
|
-
console.log('body', body);
|
|
196
204
|
this.tickets.forEach((item) => {
|
|
197
205
|
body.tickets.push({
|
|
198
206
|
startingDrawId: this.nextDraw,
|
|
@@ -236,7 +244,7 @@ export class LotteryGamePage {
|
|
|
236
244
|
}
|
|
237
245
|
return (
|
|
238
246
|
/* Game details */
|
|
239
|
-
h("div", { class: "GamePage" },
|
|
247
|
+
h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr' },
|
|
240
248
|
h("div", { class: "GridBanner" },
|
|
241
249
|
h("div", { class: "BannerButtonsWrapper" },
|
|
242
250
|
h("button", { class: "BannerBackButton" },
|
|
@@ -291,9 +299,16 @@ export class LotteryGamePage {
|
|
|
291
299
|
" ",
|
|
292
300
|
this.currency)),
|
|
293
301
|
h("div", { class: "ButtonWrapper" },
|
|
294
|
-
|
|
302
|
+
this.isLoggedIn &&
|
|
303
|
+
h("span", { class: "Button", onClick: () => this.submitTickets() }, translate('orderSummarySubmit', this.language)),
|
|
304
|
+
!this.isLoggedIn &&
|
|
305
|
+
h("div", null,
|
|
306
|
+
h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)),
|
|
307
|
+
h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible },
|
|
308
|
+
h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))),
|
|
295
309
|
this.tabIndex == 1 &&
|
|
296
310
|
h("div", null,
|
|
311
|
+
h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)),
|
|
297
312
|
h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true }),
|
|
298
313
|
h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language })),
|
|
299
314
|
h("helper-modal", { "title-modal": "Success", visible: this.successVisible },
|
|
@@ -453,7 +468,9 @@ export class LotteryGamePage {
|
|
|
453
468
|
"secondsRemaining": {},
|
|
454
469
|
"latestDraw": {},
|
|
455
470
|
"totalWinningsAmount": {},
|
|
456
|
-
"nextDate": {}
|
|
471
|
+
"nextDate": {},
|
|
472
|
+
"isLoggedIn": {},
|
|
473
|
+
"loginModalVisible": {}
|
|
457
474
|
}; }
|
|
458
475
|
static get elementRef() { return "element"; }
|
|
459
476
|
static get listeners() { return [{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const DEFAULT_LANGUAGE = 'en';
|
|
2
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
2
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'ar'];
|
|
3
3
|
const TRANSLATIONS = {
|
|
4
4
|
en: {
|
|
5
5
|
error: 'Error',
|
|
@@ -12,7 +12,7 @@ const TRANSLATIONS = {
|
|
|
12
12
|
buy: 'Buy tickets',
|
|
13
13
|
viewLatest: 'View latest results',
|
|
14
14
|
createTicket: 'Create Ticket',
|
|
15
|
-
modalSuccess: 'Purchase
|
|
15
|
+
modalSuccess: 'Purchase successfully completed!',
|
|
16
16
|
deleteTicketModalTitle: 'Delete Ticket',
|
|
17
17
|
deleteTicketModalText: 'Are you sure you want to delete this ticket?',
|
|
18
18
|
deleteTicketModalCancel: 'Cancel',
|
|
@@ -20,7 +20,9 @@ const TRANSLATIONS = {
|
|
|
20
20
|
orderSummaryTitle: 'Order Summary',
|
|
21
21
|
orderSummaryTickets: 'Ticket',
|
|
22
22
|
orderSummaryTotal: 'Total',
|
|
23
|
-
orderSummarySubmit: 'Submit'
|
|
23
|
+
orderSummarySubmit: 'Submit',
|
|
24
|
+
lastDrawResultsTitle: 'Last Draw Results',
|
|
25
|
+
modalLogin: 'Please login to submit a ticket',
|
|
24
26
|
},
|
|
25
27
|
ro: {
|
|
26
28
|
error: 'Eroare',
|
|
@@ -29,11 +31,11 @@ const TRANSLATIONS = {
|
|
|
29
31
|
lobbyButton: 'Lobby',
|
|
30
32
|
prize: 'MARELE JACKPOT OMG',
|
|
31
33
|
winUpTo: 'Castiga pana la',
|
|
32
|
-
nextDraw: '
|
|
34
|
+
nextDraw: 'Urmatoarea extragere:',
|
|
33
35
|
buy: 'Cumpara bilet',
|
|
34
36
|
viewLatest: 'Ultimile extrageri',
|
|
35
37
|
createTicket: 'Creeaza bilet',
|
|
36
|
-
modalSuccess: '
|
|
38
|
+
modalSuccess: 'Achizitie efectuata cu succes',
|
|
37
39
|
deleteTicketModalTitle: 'Sterge biletul',
|
|
38
40
|
deleteTicketModalText: 'Esti sigur ca vrei sa stergi acest bilet?',
|
|
39
41
|
deleteTicketModalCancel: 'Anuleaza',
|
|
@@ -41,7 +43,32 @@ const TRANSLATIONS = {
|
|
|
41
43
|
orderSummaryTitle: 'Rezumat comanda',
|
|
42
44
|
orderSummaryTickets: 'Bilet',
|
|
43
45
|
orderSummaryTotal: 'Total',
|
|
44
|
-
orderSummarySubmit: 'Trimite'
|
|
46
|
+
orderSummarySubmit: 'Trimite',
|
|
47
|
+
lastDrawResultsTitle: 'Cele mai recente extrageri',
|
|
48
|
+
modalLogin: 'Please login to submit a ticket',
|
|
49
|
+
},
|
|
50
|
+
ar: {
|
|
51
|
+
error: 'خطأ',
|
|
52
|
+
title: 'كرونو',
|
|
53
|
+
backButton: 'خلف',
|
|
54
|
+
lobbyButton: 'ردهة',
|
|
55
|
+
prize: 'جائزة',
|
|
56
|
+
winUpTo: 'الفوز بما يصل الى',
|
|
57
|
+
nextDraw: 'السحب التالي:',
|
|
58
|
+
buy: 'اشتري تذاكر',
|
|
59
|
+
viewLatest: 'عرض أحدث النتائج',
|
|
60
|
+
createTicket: 'إنشاء تذكرة',
|
|
61
|
+
modalSuccess: '!سيتم الشراء بنجاح قريبًا',
|
|
62
|
+
deleteTicketModalTitle: 'حذف التذكرة',
|
|
63
|
+
deleteTicketModalText: 'هل أنت متأكد أنك تريد حذف هذه التذكرة؟',
|
|
64
|
+
deleteTicketModalCancel: 'يلغي',
|
|
65
|
+
deleteTicketModalConfirm: 'حذف',
|
|
66
|
+
orderSummaryTitle: 'ملخص الطلب',
|
|
67
|
+
orderSummaryTickets: 'تذكرة',
|
|
68
|
+
orderSummaryTotal: 'المجموع',
|
|
69
|
+
orderSummarySubmit: 'يُقدِّم',
|
|
70
|
+
lastDrawResultsTitle: 'Cele mai recente extrageri',
|
|
71
|
+
modalLogin: 'الرجاء تسجيل الدخول لتقديم تذكرة'
|
|
45
72
|
},
|
|
46
73
|
};
|
|
47
74
|
export const translate = (key, customLang) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* LotteryGamePage custom elements */
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import type { Components, JSX } from "../types/components";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Used to manually set the base path where assets can be found.
|
|
@@ -19,4 +20,7 @@ export interface SetPlatformOptions {
|
|
|
19
20
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
21
|
}
|
|
21
22
|
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
+
|
|
24
|
+
export type { Components, JSX };
|
|
25
|
+
|
|
22
26
|
export * from '../types';
|
package/dist/components/index.js
CHANGED
|
@@ -1,15 +1 @@
|
|
|
1
1
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
-
export { HelperAccordion, defineCustomElement as defineCustomElementHelperAccordion } from './helper-accordion.js';
|
|
3
|
-
export { HelperFilters, defineCustomElement as defineCustomElementHelperFilters } from './helper-filters.js';
|
|
4
|
-
export { HelperModal, defineCustomElement as defineCustomElementHelperModal } from './helper-modal.js';
|
|
5
|
-
export { HelperPagination, defineCustomElement as defineCustomElementHelperPagination } from './helper-pagination.js';
|
|
6
|
-
export { HelperTab, defineCustomElement as defineCustomElementHelperTab } from './helper-tab.js';
|
|
7
|
-
export { HelperTabs, defineCustomElement as defineCustomElementHelperTabs } from './helper-tabs.js';
|
|
8
|
-
export { LotteryBullet, defineCustomElement as defineCustomElementLotteryBullet } from './lottery-bullet.js';
|
|
9
|
-
export { LotteryDrawResults, defineCustomElement as defineCustomElementLotteryDrawResults } from './lottery-draw-results.js';
|
|
10
|
-
export { LotteryDrawResultsHistory, defineCustomElement as defineCustomElementLotteryDrawResultsHistory } from './lottery-draw-results-history.js';
|
|
11
|
-
export { LotteryGameDetails, defineCustomElement as defineCustomElementLotteryGameDetails } from './lottery-game-details.js';
|
|
12
|
-
export { LotteryGamePage, defineCustomElement as defineCustomElementLotteryGamePage } from './lottery-game-page.js';
|
|
13
|
-
export { LotteryGrid, defineCustomElement as defineCustomElementLotteryGrid } from './lottery-grid.js';
|
|
14
|
-
export { LotteryTicket, defineCustomElement as defineCustomElementLotteryTicket } from './lottery-ticket.js';
|
|
15
|
-
export { LotteryTicketController, defineCustomElement as defineCustomElementLotteryTicketController } from './lottery-ticket-controller.js';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
import
|
|
3
|
-
import { d as defineCustomElement$1 } from './lottery-grid2.js';
|
|
2
|
+
import '@everymatrix/lottery-grid';
|
|
4
3
|
|
|
5
4
|
const DEFAULT_LANGUAGE = 'en';
|
|
6
5
|
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
@@ -14,7 +13,13 @@ const TRANSLATIONS = {
|
|
|
14
13
|
drawNumbersGridTicket: 'Draw numbers Grid B',
|
|
15
14
|
ticketResult: 'Ticket result',
|
|
16
15
|
amountWon: 'Amount won',
|
|
17
|
-
numberOfDraws: 'Number of draws'
|
|
16
|
+
numberOfDraws: 'Number of draws',
|
|
17
|
+
multiplier: 'Multiplier:',
|
|
18
|
+
ticketPurchaseDate: 'Ticket Purchase Date',
|
|
19
|
+
ticketStatus: 'Ticket Status',
|
|
20
|
+
ticketId: 'Ticket ID',
|
|
21
|
+
ticketAmount: 'Ticket Amount',
|
|
22
|
+
winUpTo: 'Win up to',
|
|
18
23
|
},
|
|
19
24
|
ro: {
|
|
20
25
|
drawResultsHeader: 'Ultimele rezultate extragere',
|
|
@@ -25,7 +30,13 @@ const TRANSLATIONS = {
|
|
|
25
30
|
drawNumbersGridTicket: 'Numerele extrase Grid B',
|
|
26
31
|
ticketResult: 'Rezultatul biletului',
|
|
27
32
|
amountWon: 'Suma castigata',
|
|
28
|
-
numberOfDraws: 'Numarul de extrageri'
|
|
33
|
+
numberOfDraws: 'Numarul de extrageri',
|
|
34
|
+
multiplier: 'Multiplicator:',
|
|
35
|
+
ticketPurchaseDate: 'Data achizitionarii biletului',
|
|
36
|
+
ticketStatus: 'Statusul biletului',
|
|
37
|
+
ticketId: 'Id biletul',
|
|
38
|
+
ticketAmount: 'Valoarea biletului',
|
|
39
|
+
winUpTo: 'Poti castiga'
|
|
29
40
|
},
|
|
30
41
|
};
|
|
31
42
|
const translate = (key, customLang) => {
|
|
@@ -33,22 +44,8 @@ const translate = (key, customLang) => {
|
|
|
33
44
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
34
45
|
};
|
|
35
46
|
|
|
36
|
-
const lotteryDrawResultsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsSection{max-width:
|
|
47
|
+
const lotteryDrawResultsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsArea{margin-top:15px}.DrawResultsSection{max-width:600px;margin:0px auto;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:#009993;color:#fff;font-size:14px;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0;padding-top:15px}.DrawMultipler label{display:block;margin:15px 0}.DrawResultsBody{padding:0px 20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid #009993}.DrawResultsBody .DrawNumbersGrid{font-size:14px}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.Toggle{cursor:pointer;display:inline-block}.ToggleSwitch{display:inline-block;background:#ccc;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #eee 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#56c080}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px}.DrawTicketsContainer{margin:30px auto}.ExpandableBoxes{position:relative}.ExpandableBox{line-height:12px;font-weight:lighter;width:100%;height:100%;max-height:70px;float:left;margin:0 0 20px 0;border:1px solid #f1f1f1;background:#fff;border-radius:4px;padding:10px;-webkit-transition:all 0.6s ease-in-out;-moz-transition:all 0.6s ease-in-out;-o-transition:all 0.6s ease-in-out;-ms-transition:all 0.6s ease-in-out;transition:all 0.6s ease-in-out;overflow:hidden;box-shadow:rgba(99, 99, 99, 0.2) 0px 2px 8px 0px}.ExpandableBox.ShowBox{max-height:400px;margin:0px 0px 20p 0px}.ExpandableBox.HideBox{width:0;height:0;overflow:hidden;border:none;padding:0;margin:0;opacity:0}";
|
|
37
48
|
|
|
38
|
-
const DEFAULT_VALUES = {
|
|
39
|
-
gamename: 'Chrono',
|
|
40
|
-
gamedate: '24/09/2022',
|
|
41
|
-
state: 'Processing',
|
|
42
|
-
amount: 304444,
|
|
43
|
-
ticketid: '6963444',
|
|
44
|
-
selection: '[5, 6, 7, 8, 9]',
|
|
45
|
-
multiplier: 4.5,
|
|
46
|
-
resultstatus: 'Processing',
|
|
47
|
-
drawstatus: 'Won',
|
|
48
|
-
drawamount: 1022,
|
|
49
|
-
drawid: '54545555',
|
|
50
|
-
drawdate: '24/09/2032'
|
|
51
|
-
};
|
|
52
49
|
const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
53
50
|
constructor() {
|
|
54
51
|
super();
|
|
@@ -62,9 +59,39 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
62
59
|
* Shows only the last draw
|
|
63
60
|
*/
|
|
64
61
|
this.drawMode = false;
|
|
62
|
+
/**
|
|
63
|
+
* The drawID (option)
|
|
64
|
+
*/
|
|
65
|
+
this.drawId = '';
|
|
66
|
+
/**
|
|
67
|
+
* The game name
|
|
68
|
+
*/
|
|
65
69
|
this.gameName = '';
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
/**
|
|
71
|
+
* The ticket submission date
|
|
72
|
+
*/
|
|
73
|
+
this.ticketDate = '';
|
|
74
|
+
/**
|
|
75
|
+
* The ticket status
|
|
76
|
+
*/
|
|
77
|
+
this.ticketStatus = '';
|
|
78
|
+
/**
|
|
79
|
+
* The ticket id
|
|
80
|
+
*/
|
|
81
|
+
this.ticketId = '';
|
|
82
|
+
/**
|
|
83
|
+
* The ticket amount
|
|
84
|
+
*/
|
|
85
|
+
this.ticketAmount = '';
|
|
86
|
+
/**
|
|
87
|
+
* The ticket multiplier
|
|
88
|
+
*/
|
|
89
|
+
this.ticketMultiplier = false;
|
|
90
|
+
/**
|
|
91
|
+
* The ticket draw count
|
|
92
|
+
*/
|
|
93
|
+
this.ticketDrawCount = 0;
|
|
94
|
+
this.multiplier = 3;
|
|
68
95
|
this.isLoading = true;
|
|
69
96
|
this.drawResults = [];
|
|
70
97
|
this.rules = {};
|
|
@@ -86,9 +113,6 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
86
113
|
connectedCallback() {
|
|
87
114
|
let promises = [];
|
|
88
115
|
promises.push(this.getGameData());
|
|
89
|
-
if (this.playerId) {
|
|
90
|
-
promises.push(this.getTicketData());
|
|
91
|
-
}
|
|
92
116
|
if (this.drawId) {
|
|
93
117
|
promises.push(this.getDrawData());
|
|
94
118
|
}
|
|
@@ -108,9 +132,11 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
108
132
|
.then((data) => {
|
|
109
133
|
this.drawData = data;
|
|
110
134
|
resolve(true);
|
|
135
|
+
this.isLoading = false;
|
|
111
136
|
})
|
|
112
137
|
.catch((err) => {
|
|
113
138
|
reject(err);
|
|
139
|
+
this.isLoading = false;
|
|
114
140
|
});
|
|
115
141
|
});
|
|
116
142
|
}
|
|
@@ -127,6 +153,8 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
127
153
|
totalNumbers: data.rules.boards[0].totalNumbers
|
|
128
154
|
};
|
|
129
155
|
resolve(true);
|
|
156
|
+
this.isLoading = false;
|
|
157
|
+
this.hasErrors = false;
|
|
130
158
|
})
|
|
131
159
|
.catch((err) => {
|
|
132
160
|
this.isLoading = false;
|
|
@@ -136,26 +164,7 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
136
164
|
});
|
|
137
165
|
});
|
|
138
166
|
}
|
|
139
|
-
getTicketData() {
|
|
140
|
-
return new Promise((resolve, reject) => {
|
|
141
|
-
let url = new URL(`${this.endpoint}/tickets/player/${this.playerId}`);
|
|
142
|
-
fetch(url.href)
|
|
143
|
-
.then((response) => {
|
|
144
|
-
return response.json();
|
|
145
|
-
})
|
|
146
|
-
.then((data) => {
|
|
147
|
-
this.ticketData = data.length === 0 ? DEFAULT_VALUES : data[1];
|
|
148
|
-
this.drawResults = this.ticketData.drawResults.map((item) => item);
|
|
149
|
-
this.selection = this.ticketData.selection[0].join(',');
|
|
150
|
-
resolve(true);
|
|
151
|
-
})
|
|
152
|
-
.catch((err) => {
|
|
153
|
-
reject(err);
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
167
|
render() {
|
|
158
|
-
var _a, _b, _c, _d, _e, _f;
|
|
159
168
|
if (this.isLoading) {
|
|
160
169
|
return (h("p", null, "Loading, please wait ..."));
|
|
161
170
|
}
|
|
@@ -164,12 +173,11 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
164
173
|
}
|
|
165
174
|
else {
|
|
166
175
|
return (h("section", { class: "DrawResultsSection" }, !this.drawMode ?
|
|
167
|
-
h("div", { class: "DrawResultsArea" }, h("div", { class: "TicketInfo" }, h("div", { class: "TicketGameName" }, translate('drawName', this.language), ": ", h("span", null, this.gameName)), h("div", { class: "TicketDate" },
|
|
168
|
-
|
|
169
|
-
h("div", { class: "AmountWonContainer" }, h("p", null, translate('amountWon', this.language), ": ", Number(item.amount).toLocaleString('en'), " ", item.currency)), h("div", { class: "DrawIdContainer" }, h("p", null, translate('drawId', this.language), ": ", item.drawId)), h("div", { class: "DrawDateContainer" }, h("p", null, translate('drawDate', this.language), ": ", item.updatedAt.slice(0, 10), " | ", item.updatedAt.slice(11, 19))), h("div", { class: "DrawNumbersGrid" }), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, "Multiplier: ", item.multiplier)))))))))
|
|
176
|
+
h("div", { class: "DrawResultsArea" }, h("div", { class: "TicketInfo" }, h("div", { class: "TicketGameName" }, translate('drawName', this.language), ": ", h("span", null, this.gameName)), h("div", { class: "TicketDate" }, translate('ticketPurchaseDate', this.language), ": ", h("span", null, this.ticketDate.slice(0, 10))), h("div", { class: "TicketStatus" }, translate('ticketStatus', this.language), ": ", h("span", null, this.ticketStatus))), h("div", { class: "DrawResultsBody" }, h("div", { class: "TicketIdContainer" }, h("p", null, translate('ticketId', this.language), ": ", h("span", null, this.ticketId))), h("div", { class: "TicketAmountContainer" }, h("p", null, translate('ticketAmount', this.language), " ", h("span", null, this.ticketAmount))), h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridTicket', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, "selected-numbers": this.selection, selectable: false, "display-selected": true, language: this.language }))), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('winUpTo', this.language), " ", h("span", null, JSON.stringify(this.ticketMultiplier)))), h("div", { class: "NumberOfDrawsContainer" }, h("p", null, translate('numberOfDraws', this.language), ": ", this.ticketDrawCount), h("div", { class: "DrawTicketsContainer" }, this.drawResults.map((item, index) => h("div", { class: "ExpandableBoxes" }, h("div", { class: this.toggleDrawer[index] ? 'ExpandableBox ShowBox' : 'ExpandableBox', onClick: () => this.changeBox(index) }, h("div", { class: "TicketResultContainer" }, h("p", null, translate('ticketResult', this.language), ": ", item.status)), item.state == 'won' &&
|
|
177
|
+
h("div", { class: "AmountWonContainer" }, h("p", null, translate('amountWon', this.language), ": ", Number(item.amount).toLocaleString('en'), " ", item.currency)), h("div", { class: "DrawIdContainer" }, h("p", null, translate('drawId', this.language), ": ", item.drawId)), h("div", { class: "DrawDateContainer" }, h("p", null, translate('drawDate', this.language), ": ", item.updatedAt.slice(0, 10), " | ", item.updatedAt.slice(11, 19))), h("div", { class: "DrawNumbersGrid" }), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('winUpTo', this.language), " ", item.multiplier)))))))))
|
|
170
178
|
:
|
|
171
179
|
h("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
172
|
-
h("div", null, h("div", { class: "DrawResultsHeader" }, h("span", null, translate('drawId', this.language), ": ", this.drawData.id), h("span", null, translate('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), h("div", { class: "DrawResultsBody" }, h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridDraw', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, selectedNumbers: this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language })), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, "
|
|
180
|
+
h("div", null, h("div", { class: "DrawResultsHeader" }, h("span", null, translate('drawId', this.language), ": ", this.drawData.id), h("span", null, translate('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), h("div", { class: "DrawResultsBody" }, h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridDraw', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, selectedNumbers: this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language })), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('multiplier', this.language), " ", this.multiplier))))))));
|
|
173
181
|
}
|
|
174
182
|
}
|
|
175
183
|
static get style() { return lotteryDrawResultsCss; }
|
|
@@ -181,8 +189,13 @@ const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLEl
|
|
|
181
189
|
"drawMode": [4, "draw-mode"],
|
|
182
190
|
"drawId": [1, "draw-id"],
|
|
183
191
|
"gameName": [1, "game-name"],
|
|
192
|
+
"ticketDate": [1, "ticket-date"],
|
|
193
|
+
"ticketStatus": [1, "ticket-status"],
|
|
194
|
+
"ticketId": [1, "ticket-id"],
|
|
195
|
+
"ticketAmount": [1, "ticket-amount"],
|
|
196
|
+
"ticketMultiplier": [4, "ticket-multiplier"],
|
|
197
|
+
"ticketDrawCount": [2, "ticket-draw-count"],
|
|
184
198
|
"multiplier": [32],
|
|
185
|
-
"ticketData": [32],
|
|
186
199
|
"isLoading": [32],
|
|
187
200
|
"drawResults": [32],
|
|
188
201
|
"rules": [32],
|
|
@@ -194,23 +207,13 @@ function defineCustomElement() {
|
|
|
194
207
|
if (typeof customElements === "undefined") {
|
|
195
208
|
return;
|
|
196
209
|
}
|
|
197
|
-
const components = ["lottery-draw-results"
|
|
210
|
+
const components = ["lottery-draw-results"];
|
|
198
211
|
components.forEach(tagName => { switch (tagName) {
|
|
199
212
|
case "lottery-draw-results":
|
|
200
213
|
if (!customElements.get(tagName)) {
|
|
201
214
|
customElements.define(tagName, LotteryDrawResults);
|
|
202
215
|
}
|
|
203
216
|
break;
|
|
204
|
-
case "lottery-bullet":
|
|
205
|
-
if (!customElements.get(tagName)) {
|
|
206
|
-
defineCustomElement$2();
|
|
207
|
-
}
|
|
208
|
-
break;
|
|
209
|
-
case "lottery-grid":
|
|
210
|
-
if (!customElements.get(tagName)) {
|
|
211
|
-
defineCustomElement$1();
|
|
212
|
-
}
|
|
213
|
-
break;
|
|
214
217
|
} });
|
|
215
218
|
}
|
|
216
219
|
defineCustomElement();
|