@everymatrix/lottery-game-page 0.1.19 → 0.1.21
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.cjs.entry.js +41 -3
- package/dist/cjs/helper-filters_2.cjs.entry.js +208 -21
- package/dist/cjs/helper-modal.cjs.entry.js +34 -2
- package/dist/cjs/helper-pagination.cjs.entry.js +45 -1
- package/dist/cjs/helper-tab.cjs.entry.js +36 -4
- package/dist/cjs/helper-tabs.cjs.entry.js +38 -2
- package/dist/cjs/{index-5701a895.js → index-7b63209d.js} +13 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/lottery-bullet_2.cjs.entry.js +72 -4
- package/dist/cjs/lottery-draw-results-history.cjs.entry.js +76 -13
- package/dist/cjs/lottery-game-details.cjs.entry.js +34 -2
- package/dist/cjs/lottery-game-page.cjs.entry.js +69 -9
- package/dist/cjs/lottery-game-page.cjs.js +2 -2
- package/dist/cjs/lottery-ticket-controller.cjs.entry.js +55 -2
- package/dist/cjs/lottery-ticket.cjs.entry.js +55 -3
- package/dist/collection/components/lottery-game-page/lottery-game-page.css +6 -4
- package/dist/collection/components/lottery-game-page/lottery-game-page.js +84 -9
- package/dist/collection/utils/locale.utils.js +26 -3
- package/dist/components/helper-accordion2.js +44 -3
- package/dist/components/helper-filters2.js +70 -8
- package/dist/components/helper-modal2.js +37 -2
- package/dist/components/helper-pagination.js +48 -1
- package/dist/components/helper-tab2.js +39 -4
- package/dist/components/helper-tabs2.js +42 -2
- package/dist/components/lottery-bullet2.js +37 -2
- package/dist/components/lottery-draw-results-history2.js +80 -14
- package/dist/components/lottery-draw-results2.js +152 -15
- package/dist/components/lottery-game-details2.js +38 -2
- package/dist/components/lottery-game-page.js +73 -9
- package/dist/components/lottery-grid2.js +43 -3
- package/dist/components/lottery-ticket-controller2.js +58 -2
- package/dist/components/lottery-ticket2.js +58 -3
- package/dist/esm/helper-accordion.entry.js +41 -3
- package/dist/esm/helper-filters_2.entry.js +208 -21
- package/dist/esm/helper-modal.entry.js +34 -2
- package/dist/esm/helper-pagination.entry.js +45 -1
- package/dist/esm/helper-tab.entry.js +36 -4
- package/dist/esm/helper-tabs.entry.js +38 -2
- package/dist/esm/{index-ade3d0ab.js → index-0f8edfd2.js} +13 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/lottery-bullet_2.entry.js +72 -4
- package/dist/esm/lottery-draw-results-history.entry.js +76 -13
- package/dist/esm/lottery-game-details.entry.js +34 -2
- package/dist/esm/lottery-game-page.entry.js +69 -9
- package/dist/esm/lottery-game-page.js +2 -2
- package/dist/esm/lottery-ticket-controller.entry.js +55 -2
- package/dist/esm/lottery-ticket.entry.js +55 -3
- package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
- package/dist/lottery-game-page/p-01132729.entry.js +1 -0
- package/dist/lottery-game-page/p-07f98587.entry.js +1 -0
- package/dist/lottery-game-page/p-4098d6d4.entry.js +1 -0
- package/dist/lottery-game-page/p-75703176.entry.js +1 -0
- package/dist/lottery-game-page/p-800590f3.entry.js +1 -0
- package/dist/lottery-game-page/p-807dda48.entry.js +1 -0
- package/dist/lottery-game-page/p-97048566.entry.js +1 -0
- package/dist/lottery-game-page/p-a21ecd5f.entry.js +1 -0
- package/dist/lottery-game-page/p-b44e49d7.entry.js +1 -0
- package/dist/lottery-game-page/p-b4e2988a.js +1 -0
- package/dist/lottery-game-page/{p-042b777b.entry.js → p-d1d09322.entry.js} +39 -39
- package/dist/lottery-game-page/p-d91fc066.entry.js +1 -0
- package/dist/lottery-game-page/p-e816baee.entry.js +1 -0
- package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/stencil/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +2 -0
- package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +14 -0
- package/dist/types/components.d.ts +16 -0
- package/package.json +1 -1
- package/dist/lottery-game-page/p-07cca45e.entry.js +0 -1
- package/dist/lottery-game-page/p-1196396b.entry.js +0 -1
- package/dist/lottery-game-page/p-2197c8ae.entry.js +0 -1
- package/dist/lottery-game-page/p-2a4e9984.entry.js +0 -1
- package/dist/lottery-game-page/p-4bfd0112.entry.js +0 -1
- package/dist/lottery-game-page/p-5e12dbf9.entry.js +0 -1
- package/dist/lottery-game-page/p-a10368b2.entry.js +0 -1
- package/dist/lottery-game-page/p-a26ebf45.entry.js +0 -1
- package/dist/lottery-game-page/p-b301a9d4.js +0 -1
- package/dist/lottery-game-page/p-d4b6a11a.entry.js +0 -1
- package/dist/lottery-game-page/p-dd63fcc6.entry.js +0 -1
- package/dist/lottery-game-page/p-f59dc9e1.entry.js +0 -1
- package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +0 -2
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-7b63209d.js');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en', 'ar'];
|
|
8
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar'];
|
|
9
9
|
const TRANSLATIONS = {
|
|
10
10
|
en: {
|
|
11
11
|
error: 'Error',
|
|
@@ -53,6 +53,29 @@ const TRANSLATIONS = {
|
|
|
53
53
|
lastDrawResultsTitle: 'Cele mai recente extrageri',
|
|
54
54
|
modalLogin: 'Please login to submit a ticket',
|
|
55
55
|
},
|
|
56
|
+
fr: {
|
|
57
|
+
error: 'Error',
|
|
58
|
+
title: 'Chrono',
|
|
59
|
+
backButton: 'Back',
|
|
60
|
+
lobbyButton: 'Lobby',
|
|
61
|
+
prize: 'Prize',
|
|
62
|
+
winUpTo: 'Win up to',
|
|
63
|
+
nextDraw: 'Next draw in: ',
|
|
64
|
+
buy: 'Buy tickets',
|
|
65
|
+
viewLatest: 'View latest results',
|
|
66
|
+
createTicket: 'Create Ticket',
|
|
67
|
+
modalSuccess: 'Purchase successfully completed!',
|
|
68
|
+
deleteTicketModalTitle: 'Delete Ticket',
|
|
69
|
+
deleteTicketModalText: 'Are you sure you want to delete this ticket?',
|
|
70
|
+
deleteTicketModalCancel: 'Cancel',
|
|
71
|
+
deleteTicketModalConfirm: 'Delete',
|
|
72
|
+
orderSummaryTitle: 'Order Summary',
|
|
73
|
+
orderSummaryTickets: 'Ticket',
|
|
74
|
+
orderSummaryTotal: 'Total',
|
|
75
|
+
orderSummarySubmit: 'Submit',
|
|
76
|
+
lastDrawResultsTitle: 'Résultats du dernier tirage',
|
|
77
|
+
modalLogin: 'Please login to submit a ticket',
|
|
78
|
+
},
|
|
56
79
|
ar: {
|
|
57
80
|
error: 'خطأ',
|
|
58
81
|
title: 'كرونو',
|
|
@@ -73,16 +96,16 @@ const TRANSLATIONS = {
|
|
|
73
96
|
orderSummaryTickets: 'تذكرة',
|
|
74
97
|
orderSummaryTotal: 'المجموع',
|
|
75
98
|
orderSummarySubmit: 'يُقدِّم',
|
|
76
|
-
lastDrawResultsTitle: '
|
|
99
|
+
lastDrawResultsTitle: 'نتائج آخر سحب',
|
|
77
100
|
modalLogin: 'الرجاء تسجيل الدخول لتقديم تذكرة'
|
|
78
|
-
}
|
|
101
|
+
}
|
|
79
102
|
};
|
|
80
103
|
const translate = (key, customLang) => {
|
|
81
104
|
const lang = customLang;
|
|
82
105
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
83
106
|
};
|
|
84
107
|
|
|
85
|
-
const lotteryGamePageCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#000;font-size:18px;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;text-transform:uppercase}.GamePage .TotalWinnings span{font-size:18px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:uppercase;display:flex;justify-content:center;align-items:center;flex-direction:column}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px;text-transform:uppercase;padding:0;margin:15px 0 0 0}.GamePage .NextDraw .BannerCountdown{font-size:22px;color:#00958f;display:flex;gap:20px}.GamePage .Tabs{display:flex;justify-content:center;gap:10px}.GamePage .Tabs .TabButton{border-radius:4px;cursor:pointer;padding:8px 0;width:50%;max-width:200px;border:1px solid #00958f;background:#
|
|
108
|
+
const lotteryGamePageCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#000;font-size:18px;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;text-transform:uppercase}.GamePage .TotalWinnings span{font-size:18px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:uppercase;display:flex;justify-content:center;align-items:center;flex-direction:column}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px;text-transform:uppercase;padding:0;margin:15px 0 0 0}.GamePage .NextDraw .BannerCountdown{font-size:22px;color:#00958f;display:flex;gap:20px}.GamePage .Tabs{display:flex;justify-content:center;gap:10px}.GamePage .Tabs .TabButton{border-radius:4px;cursor:pointer;padding:8px 0;width:50%;max-width:200px;border:1px solid #00958f;background:#00958f;color:#fff;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.GamePage .Tabs .TabButton.Active{color:#00958f;background:#F1F1F1;border:1px solid #F1F1F1}.LastDrawResultsTitle{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px;text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.NextDrawWrapper{padding:10px 15px;background:#F1F1F1;background:linear-gradient(0deg, #f1f1f1 0%, rgba(253, 187, 45, 0) 100%)}.NextDrawWrapper .BannerText{font-size:16px;font-weight:700;text-align:center}.NextDrawWrapper .BannerCountdown{font-size:22px;display:flex;gap:8px;color:#009993;font-weight:bolder;justify-content:center}.GamePageContent{padding:15px;max-width:1200px;margin:0 auto}.GameDetails{padding-bottom:10px;margin-bottom:20px}.CreateNewTicket{background:#004D4A;height:100px;width:100%;display:flex;margin-top:10px;flex-direction:column;justify-content:center;align-items:center}.CreateNewTicket button{cursor:pointer;display:inline-block;border-radius:50%;width:40px;height:40px;margin:5px;border:1px solid #FFF;background:#FFF;color:#004D4A;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.CreateNewTicket button:hover{background:#F1F1F1}.CreateNewTicket span{display:inline-block;font-size:12px;text-align:center;margin:0 auto;color:#FFF}.OrderSummary{min-width:200px;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-top:20px;background:#fff}.OrderSummary .OrderSummaryTitle{font-size:16px;color:#009993;text-transform:uppercase;text-align:center}.OrderSummary .Ticket{display:inline-block;color:#000;font-size:14px;height:50px;border-bottom:solid 1px #D4D4D4;line-height:50px}.OrderSummary .Ticket span{text-align:right}.OrderSummary .Total{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px}.OrderSummary .Total span{text-align:right}.ButtonWrapper{display:flex;align-items:center;justify-content:center}.ButtonWrapper .Button{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#009993;border:1px solid #009993;color:#FFF}.ButtonWrapper .Button:hover{background:#00ABA4}.ButtonWrapper .Button.ButtonDisabled{pointer-events:none;background:#ccc;border:1px solid #ccc}.SubmitModalSuccess{text-align:center;font-size:18px;padding:20px}.DeleteTicketModalWrapper{padding:20px;text-align:center}.DeleteTicketModalWrapper .DeleteTicketModalTitle{font-size:16px;color:#00958f;font-weight:400;text-transform:uppercase;margin:20px 0 40px}.DeleteTicketModalWrapper .DeleteTicketModalText{font-size:14px;color:#000;line-height:22px;margin-bottom:40px}.DeleteTicketModalWrapper .DeleteTicketModalButtons{display:flex;gap:10px;justify-content:center}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm{cursor:pointer;border-radius:4px;padding:8px 25px;width:max-content;margin:5px;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover{background:#FF6536;border:1px solid #FF3D00}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel{cursor:pointer;width:max-content;border-radius:4px;padding:10px 25px;margin:5px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover{background:#F1F1F1}@media (min-width: 1200px){.GamePageContent .TicketsWrapper{float:left;width:49%}.GamePageContent .GameDetails{float:right;width:49%}.GamePageContent .OrderSummary{float:right;width:49%}}";
|
|
86
109
|
|
|
87
110
|
const LotteryGamePage = class {
|
|
88
111
|
constructor(hostRef) {
|
|
@@ -99,6 +122,15 @@ const LotteryGamePage = class {
|
|
|
99
122
|
* Shows the reset button
|
|
100
123
|
*/
|
|
101
124
|
this.resetButton = false;
|
|
125
|
+
/**
|
|
126
|
+
* Client custom styling via string
|
|
127
|
+
*/
|
|
128
|
+
this.clientStyling = '';
|
|
129
|
+
/**
|
|
130
|
+
* Client custom styling via url
|
|
131
|
+
*/
|
|
132
|
+
this.clientStylingurl = '';
|
|
133
|
+
this.clientStylingUrlContent = '';
|
|
102
134
|
this.tickets = [];
|
|
103
135
|
this.tabIndex = 0;
|
|
104
136
|
this.hasErrors = false;
|
|
@@ -109,8 +141,25 @@ const LotteryGamePage = class {
|
|
|
109
141
|
this.totalWinningsAmount = 0;
|
|
110
142
|
this.isLoggedIn = false;
|
|
111
143
|
this.loginModalVisible = false;
|
|
144
|
+
this.limitStylingAppends = false;
|
|
112
145
|
this.multiplier = false;
|
|
113
146
|
this.quickPick = false;
|
|
147
|
+
this.setClientStyling = () => {
|
|
148
|
+
let sheet = document.createElement('style');
|
|
149
|
+
sheet.innerHTML = this.clientStyling;
|
|
150
|
+
this.stylingContainer.prepend(sheet);
|
|
151
|
+
};
|
|
152
|
+
this.setClientStylingURL = () => {
|
|
153
|
+
let url = new URL(this.clientStylingurl);
|
|
154
|
+
let cssFile = document.createElement('style');
|
|
155
|
+
fetch(url.href)
|
|
156
|
+
.then((res) => res.text())
|
|
157
|
+
.then((data) => {
|
|
158
|
+
this.clientStylingUrlContent = data;
|
|
159
|
+
cssFile.innerHTML = data;
|
|
160
|
+
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
161
|
+
});
|
|
162
|
+
};
|
|
114
163
|
}
|
|
115
164
|
// @TODO fix `any` type later, I'm lazy now
|
|
116
165
|
connectedCallback() {
|
|
@@ -121,6 +170,17 @@ const LotteryGamePage = class {
|
|
|
121
170
|
this.isLoggedIn = true;
|
|
122
171
|
}
|
|
123
172
|
}
|
|
173
|
+
componentDidRender() {
|
|
174
|
+
// start custom styling area
|
|
175
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
176
|
+
if (this.clientStyling)
|
|
177
|
+
this.setClientStyling();
|
|
178
|
+
if (this.clientStylingurl)
|
|
179
|
+
this.setClientStylingURL();
|
|
180
|
+
this.limitStylingAppends = true;
|
|
181
|
+
}
|
|
182
|
+
// end custom styling area
|
|
183
|
+
}
|
|
124
184
|
countdownLogic(date) {
|
|
125
185
|
this.interval = setInterval(() => {
|
|
126
186
|
this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
|
|
@@ -322,11 +382,11 @@ const LotteryGamePage = class {
|
|
|
322
382
|
}
|
|
323
383
|
return (
|
|
324
384
|
/* Game details */
|
|
325
|
-
index.h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr' }, index.h("div", { class: "GridBanner" }, index.h("div", { class: "BannerButtonsWrapper" }, index.h("button", { class: "BannerBackButton" }, index.h("span", { class: "BannerBackButtonArrow" }, "\u1438 "), translate('backButton', this.language)), index.h("button", { class: "BannerLobbyButton" }, translate('lobbyButton', this.language))), index.h("div", { class: "Tabs" }, index.h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate('buy', this.language)), index.h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate('viewLatest', this.language)))), index.h("div", { class: "NextDrawWrapper" }, index.h("div", { class: "TotalWinnings" }, translate('winUpTo', this.language), ": ", index.h("span", null, "$", this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))), index.h("div", { class: "NextDraw" }, index.h("p", { class: "BannerText" }, translate('nextDraw', this.language)), index.h("div", { class: "BannerCountdown" }, index.h("span", { class: "CountdownDays" }, this.daysRemaining, "D"), index.h("span", { class: "CountdownHours" }, this.hoursRemaining, "H"), index.h("span", { class: "CountdownMinutes" }, this.minutesRemaining, "M"), index.h("span", { class: "CountdownSeconds" }, this.secondsRemaining, "S")))), this.tabIndex == 0 &&
|
|
326
|
-
index.h("div", { class: "GamePageContent" }, index.h("div", { class: "GameDetails" }, index.h("lottery-game-details",
|
|
385
|
+
index.h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr', ref: el => this.stylingContainer = el }, index.h("div", { class: "GridBanner" }, index.h("div", { class: "BannerButtonsWrapper" }, index.h("button", { class: "BannerBackButton" }, index.h("span", { class: "BannerBackButtonArrow" }, "\u1438 "), translate('backButton', this.language)), index.h("button", { class: "BannerLobbyButton" }, translate('lobbyButton', this.language))), index.h("div", { class: "Tabs" }, index.h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate('buy', this.language)), index.h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate('viewLatest', this.language)))), index.h("div", { class: "NextDrawWrapper" }, index.h("div", { class: "TotalWinnings" }, translate('winUpTo', this.language), ": ", index.h("span", null, "$", this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))), index.h("div", { class: "NextDraw" }, index.h("p", { class: "BannerText" }, translate('nextDraw', this.language)), index.h("div", { class: "BannerCountdown" }, index.h("span", { class: "CountdownDays" }, this.daysRemaining, "D"), index.h("span", { class: "CountdownHours" }, this.hoursRemaining, "H"), index.h("span", { class: "CountdownMinutes" }, this.minutesRemaining, "M"), index.h("span", { class: "CountdownSeconds" }, this.secondsRemaining, "S")))), this.tabIndex == 0 &&
|
|
386
|
+
index.h("div", { class: "GamePageContent" }, index.h("div", { class: "GameDetails" }, index.h("lottery-game-details", { "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), index.h("div", { class: "TicketsWrapper" }, this.tickets.map((item) => index.h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": this.autoPick, "reset-button": this.resetButton, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), index.h("div", { class: "CreateNewTicket" }, index.h("button", { onClick: () => this.createNewTicket() }, "+"), index.h("span", null, translate('createTicket', this.language)))), index.h("div", { class: "OrderSummary" }, index.h("h3", { class: "OrderSummaryTitle" }, translate('orderSummaryTitle', this.language)), index.h("div", { class: "Ticket" }, translate('orderSummaryTickets', this.language), ": ", index.h("span", null, this.tickets.length)), index.h("div", { class: "Total" }, translate('orderSummaryTotal', this.language), ": ", index.h("span", null, this.totalAmount, " ", this.currency)), index.h("div", { class: "ButtonWrapper" }, this.isLoggedIn &&
|
|
327
387
|
index.h("span", { class: "Button", onClick: () => this.submitTickets() }, translate('orderSummarySubmit', this.language)), !this.isLoggedIn &&
|
|
328
|
-
index.h("div", null, index.h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)), index.h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible }, index.h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))), this.tabIndex == 1 &&
|
|
329
|
-
index.h("div", null, index.h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)), index.h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true }), index.h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language })), index.h("helper-modal", { "title-modal": "Success", visible: this.successVisible }, index.h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))), index.h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible }, index.h("div", { class: "DeleteTicketModalWrapper" }, index.h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)), index.h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)), index.h("div", { class: "DeleteTicketModalButtons" }, index.h("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate('deleteTicketModalCancel', this.language)), index.h("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate('deleteTicketModalConfirm', this.language)))))));
|
|
388
|
+
index.h("div", null, index.h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)), index.h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, index.h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))), this.tabIndex == 1 &&
|
|
389
|
+
index.h("div", null, index.h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)), index.h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }), index.h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), index.h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, index.h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))), index.h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, index.h("div", { class: "DeleteTicketModalWrapper" }, index.h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)), index.h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)), index.h("div", { class: "DeleteTicketModalButtons" }, index.h("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate('deleteTicketModalCancel', this.language)), index.h("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate('deleteTicketModalConfirm', this.language)))))));
|
|
330
390
|
}
|
|
331
391
|
static get assetsDirs() { return ["static"]; }
|
|
332
392
|
get element() { return index.getElement(this); }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-7b63209d.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["lottery-game-page.cjs",[[1,"lottery-game-page",{"endpoint":[1],"gameId":[1,"game-id"],"playerId":[2,"player-id"],"sessionId":[1,"session-id"],"language":[1],"autoPick":[4,"auto-pick"],"resetButton":[4,"reset-button"],"tickets":[32],"tabIndex":[32],"hasErrors":[32],"totalAmount":[32],"successVisible":[32],"deleteVisible":[32],"deleteEventData":[32],"daysRemaining":[32],"hoursRemaining":[32],"minutesRemaining":[32],"secondsRemaining":[32],"latestDraw":[32],"totalWinningsAmount":[32],"nextDate":[32],"isLoggedIn":[32],"loginModalVisible":[32]},[[0,"ticketCompleted","gridFilledHandler"],[0,"gridDirty","gridDirtyHandler"],[0,"deleteTicket","deleteTicketHandler"],[0,"modalCloseEvent","modalCloseEvent"],[0,"stakeChange","stakeChangeHandler"],[0,"multiplierChange","multiplierChangeHandler"]]]]],["helper-pagination.cjs",[[1,"helper-pagination",{"firstPage":[1540,"first-page"],"previousPage":[1540,"previous-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1],"offsetInt":[32],"lastPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32]}]]],["lottery-bullet_2.cjs",[[1,"lottery-grid",{"ticketId":[2,"ticket-id"],"totalNumbers":[2,"total-numbers"],"gameId":[1,"game-id"],"maximumAllowed":[2,"maximum-allowed"],"minimumAllowed":[2,"minimum-allowed"],"selectable":[4],"selectedNumbers":[1,"selected-numbers"],"displaySelected":[4,"display-selected"],"language":[1],"gridIndex":[2,"grid-index"],"numbers":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[1],"selectable":[4],"isSelected":[4,"is-selected"]}]]],["helper-filters_2.cjs",[[1,"lottery-draw-results",{"endpoint":[1],"gameId":[1,"game-id"],"language":[1],"playerId":[1,"player-id"],"drawMode":[4,"draw-mode"],"drawId":[1,"draw-id"],"gameName":[1,"game-name"],"ticketDate":[1,"ticket-date"],"ticketStatus":[1,"ticket-status"],"ticketId":[1,"ticket-id"],"ticketAmount":[1,"ticket-amount"],"ticketMultiplier":[4,"ticket-multiplier"],"ticketDrawCount":[2,"ticket-draw-count"],"
|
|
18
|
+
return index.bootstrapLazy([["lottery-game-page.cjs",[[1,"lottery-game-page",{"endpoint":[1],"gameId":[1,"game-id"],"playerId":[2,"player-id"],"sessionId":[1,"session-id"],"language":[1],"autoPick":[4,"auto-pick"],"resetButton":[4,"reset-button"],"clientStyling":[1,"client-styling"],"clientStylingurl":[1,"client-stylingurl"],"clientStylingUrlContent":[32],"tickets":[32],"tabIndex":[32],"hasErrors":[32],"totalAmount":[32],"successVisible":[32],"deleteVisible":[32],"deleteEventData":[32],"daysRemaining":[32],"hoursRemaining":[32],"minutesRemaining":[32],"secondsRemaining":[32],"latestDraw":[32],"totalWinningsAmount":[32],"nextDate":[32],"isLoggedIn":[32],"loginModalVisible":[32],"limitStylingAppends":[32]},[[0,"ticketCompleted","gridFilledHandler"],[0,"gridDirty","gridDirtyHandler"],[0,"deleteTicket","deleteTicketHandler"],[0,"modalCloseEvent","modalCloseEvent"],[0,"stakeChange","stakeChangeHandler"],[0,"multiplierChange","multiplierChangeHandler"]]]]],["helper-pagination.cjs",[[1,"helper-pagination",{"firstPage":[1540,"first-page"],"previousPage":[1540,"previous-page"],"offset":[1538],"limit":[1538],"total":[1538],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"offsetInt":[32],"lastPage":[32],"limitInt":[32],"totalInt":[32],"pagesArray":[32],"endInt":[32],"limitStylingAppends":[32]}]]],["lottery-bullet_2.cjs",[[1,"lottery-grid",{"ticketId":[2,"ticket-id"],"totalNumbers":[2,"total-numbers"],"gameId":[1,"game-id"],"maximumAllowed":[2,"maximum-allowed"],"minimumAllowed":[2,"minimum-allowed"],"selectable":[4],"selectedNumbers":[1,"selected-numbers"],"displaySelected":[4,"display-selected"],"language":[1],"gridIndex":[2,"grid-index"],"gridType":[1,"grid-type"],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"numbers":[32],"limitStylingAppends":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[1],"selectable":[4],"isSelected":[4,"is-selected"],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"limitStylingAppends":[32]}]]],["helper-filters_2.cjs",[[1,"lottery-draw-results",{"endpoint":[1],"gameId":[1,"game-id"],"language":[1],"playerId":[1,"player-id"],"drawMode":[4,"draw-mode"],"drawId":[1,"draw-id"],"gameName":[1,"game-name"],"ticketDate":[1,"ticket-date"],"ticketStatus":[1,"ticket-status"],"ticketId":[1,"ticket-id"],"ticketAmount":[1,"ticket-amount"],"ticketMultiplier":[4,"ticket-multiplier"],"ticketDrawCount":[2,"ticket-draw-count"],"ticketNumbers":[1,"ticket-numbers"],"sessionId":[1,"session-id"],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"multiplier":[32],"isLoading":[32],"rules":[32],"toggleDrawer":[32],"hasErrors":[32],"errorText":[32],"ticketData":[32],"ticketDataLoaded":[32],"ticketDraws":[32],"hasDrawNumbers":[32],"limitStylingAppends":[32]}],[1,"helper-filters",{"showFilterId":[4,"show-filter-id"],"activateTicketSearch":[4,"activate-ticket-search"],"gameId":[1,"game-id"],"playerId":[1,"player-id"],"session":[1],"postMessage":[4,"post-message"],"language":[1],"quickFiltersActive":[4,"quick-filters-active"],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"showFilterModal":[32],"showClearButton":[32],"filterData":[32],"filterDataReset":[32],"limitStylingAppends":[32]},[[0,"modalCloseEvent","modalCloseEvent"]]]]],["lottery-draw-results-history.cjs",[[1,"lottery-draw-results-history",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfResults":[2,"number-of-results"],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"drawData":[32],"displayAllDrawsResults":[32],"showQuickFilters":[32],"winningDataSetsData":[32],"dateFiltersFrom":[32],"dateFiltersTo":[32],"isLoading":[32],"noResults":[32],"limitStylingAppends":[32]},[[0,"filterSelection","filtersHandler"],[0,"filterSelectionReset","clearFiltersHandler"]]]]],["lottery-ticket.cjs",[[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32],"isCustomSelect":[32],"amountInfo":[32],"limitStylingAppends":[32]},[[8,"click","checkForClickOutside"],[0,"gridFilled","gridFilledHandler"]]]]],["lottery-ticket-controller.cjs",[[1,"lottery-ticket-controller",{"endpoint":[1],"ticketId":[2,"ticket-id"],"ticketDescription":[1,"ticket-description"],"gameId":[1,"game-id"],"postMessage":[4,"post-message"],"eventName":[1,"event-name"],"collapsed":[4],"numberOfGrids":[2,"number-of-grids"],"last":[4],"language":[1],"autoPick":[4,"auto-pick"],"resetButton":[4,"reset-button"],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"limitStylingAppends":[32]},[[0,"helperAccordionAction","helperAccordionActionHandler"]]]]],["helper-tabs.cjs",[[1,"helper-tabs",{"disabled":[4],"label":[1],"selected":[4],"cmsEndpoint":[1,"cms-endpoint"],"selectedIndex":[1538,"selected-index"],"tabs":[16],"clientStyling":[1,"client-styling"],"clientStylingurl":[1,"client-stylingurl"],"clientStylingUrlContent":[1,"client-styling-url-content"],"limitStylingAppends":[32]}]]],["helper-accordion.cjs",[[1,"helper-accordion",{"ticketHistoryFlag":[4,"ticket-history-flag"],"headerTitle":[1,"header-title"],"headerSubtitle":[1,"header-subtitle"],"description":[1],"footer":[4],"deleteTab":[4,"delete-tab"],"postMessage":[4,"post-message"],"eventName":[1,"event-name"],"collapsed":[4],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"showContent":[32],"limitStylingAppends":[32]}]]],["helper-tab.cjs",[[1,"helper-tab",{"selectedIndex":[2,"selected-index"],"cmsEndpoint":[1,"cms-endpoint"],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"tabContent":[32],"limitStylingAppends":[32]}]]],["lottery-game-details.cjs",[[1,"lottery-game-details",{"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"limitStylingAppends":[32]}]]],["helper-modal.cjs",[[1,"helper-modal",{"titleModal":[1,"title-modal"],"visible":[1540],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"limitStylingAppends":[32]}]]]], options);
|
|
19
19
|
});
|
|
@@ -2,7 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-7b63209d.js');
|
|
6
|
+
|
|
7
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar'];
|
|
9
|
+
const TRANSLATIONS = {
|
|
10
|
+
en: {
|
|
11
|
+
ticket: 'Ticket',
|
|
12
|
+
},
|
|
13
|
+
ro: {
|
|
14
|
+
ticket: 'Bilet',
|
|
15
|
+
},
|
|
16
|
+
fr: {
|
|
17
|
+
ticket: 'Billet'
|
|
18
|
+
},
|
|
19
|
+
ar: {
|
|
20
|
+
ticket: 'تذكرة',
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const translate = (key, customLang) => {
|
|
24
|
+
const lang = customLang;
|
|
25
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
26
|
+
};
|
|
6
27
|
|
|
7
28
|
const lotteryTicketControllerCss = ":host{display:block}";
|
|
8
29
|
|
|
@@ -50,6 +71,27 @@ const LotteryTicketController = class {
|
|
|
50
71
|
* Shows the reset button
|
|
51
72
|
*/
|
|
52
73
|
this.resetButton = false;
|
|
74
|
+
/**
|
|
75
|
+
* Client custom styling via string
|
|
76
|
+
*/
|
|
77
|
+
this.clientStyling = '';
|
|
78
|
+
/**
|
|
79
|
+
* Client custom styling via url content
|
|
80
|
+
*/
|
|
81
|
+
this.clientStylingUrlContent = '';
|
|
82
|
+
this.limitStylingAppends = false;
|
|
83
|
+
this.setClientStyling = () => {
|
|
84
|
+
let sheet = document.createElement('style');
|
|
85
|
+
sheet.innerHTML = this.clientStyling;
|
|
86
|
+
this.stylingContainer.prepend(sheet);
|
|
87
|
+
};
|
|
88
|
+
this.setClientStylingURL = () => {
|
|
89
|
+
let cssFile = document.createElement('style');
|
|
90
|
+
setTimeout(() => {
|
|
91
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
92
|
+
this.stylingContainer.prepend(cssFile);
|
|
93
|
+
}, 1);
|
|
94
|
+
};
|
|
53
95
|
}
|
|
54
96
|
// @TODO fix the `any` type
|
|
55
97
|
helperAccordionActionHandler() {
|
|
@@ -60,8 +102,19 @@ const LotteryTicketController = class {
|
|
|
60
102
|
ticketId: this.ticketId
|
|
61
103
|
});
|
|
62
104
|
}
|
|
105
|
+
componentDidRender() {
|
|
106
|
+
// start custom styling area
|
|
107
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
108
|
+
if (this.clientStyling)
|
|
109
|
+
this.setClientStyling();
|
|
110
|
+
if (this.clientStylingUrlContent)
|
|
111
|
+
this.setClientStylingURL();
|
|
112
|
+
this.limitStylingAppends = true;
|
|
113
|
+
}
|
|
114
|
+
// end custom styling area
|
|
115
|
+
}
|
|
63
116
|
render() {
|
|
64
|
-
return (index.h("div",
|
|
117
|
+
return (index.h("div", { class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, index.h("helper-accordion", { "header-title": `${translate('ticket', this.language)} ${this.ticketId}`, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": true, collapsed: !this.last || this.collapsed, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, index.h("div", { slot: "accordionContent" }, index.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, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
|
|
65
118
|
}
|
|
66
119
|
};
|
|
67
120
|
LotteryTicketController.style = lotteryTicketControllerCss;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-7b63209d.js');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_LANGUAGE = 'en';
|
|
8
8
|
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
@@ -27,6 +27,26 @@ const TRANSLATIONS = {
|
|
|
27
27
|
resetButton: 'Reseteaza',
|
|
28
28
|
autoButton: 'Ma simt norocos'
|
|
29
29
|
},
|
|
30
|
+
fr: {
|
|
31
|
+
loading: 'Loading, please wait ...',
|
|
32
|
+
error: 'It was an error while trying to fetch the data',
|
|
33
|
+
grid: 'Grid',
|
|
34
|
+
multiplier: 'Multiplier',
|
|
35
|
+
numberOfDraws: 'Number of draws',
|
|
36
|
+
wagerPerDraw: 'Wager per draw',
|
|
37
|
+
resetButton: 'Reset',
|
|
38
|
+
autoButton: 'I feel lucky'
|
|
39
|
+
},
|
|
40
|
+
ar: {
|
|
41
|
+
loading: 'Loading, please wait ...',
|
|
42
|
+
error: 'It was an error while trying to fetch the data',
|
|
43
|
+
grid: 'Grid',
|
|
44
|
+
multiplier: 'Multiplier',
|
|
45
|
+
numberOfDraws: 'Number of draws',
|
|
46
|
+
wagerPerDraw: 'Wager per draw',
|
|
47
|
+
resetButton: 'Reset',
|
|
48
|
+
autoButton: 'I feel lucky'
|
|
49
|
+
}
|
|
30
50
|
};
|
|
31
51
|
const translate = (key, customLang) => {
|
|
32
52
|
const lang = customLang;
|
|
@@ -63,6 +83,14 @@ const LotteryTicket = class {
|
|
|
63
83
|
* Language
|
|
64
84
|
*/
|
|
65
85
|
this.language = 'en';
|
|
86
|
+
/**
|
|
87
|
+
* Client custom styling via string
|
|
88
|
+
*/
|
|
89
|
+
this.clientStyling = '';
|
|
90
|
+
/**
|
|
91
|
+
* Client custom styling via url content
|
|
92
|
+
*/
|
|
93
|
+
this.clientStylingUrlContent = '';
|
|
66
94
|
this.multiplier = false;
|
|
67
95
|
this.numberOfDraws = 1;
|
|
68
96
|
this.isLoading = true;
|
|
@@ -70,6 +98,19 @@ const LotteryTicket = class {
|
|
|
70
98
|
this.ticketDone = false;
|
|
71
99
|
this.isCustomSelect = false;
|
|
72
100
|
this.amountInfo = {};
|
|
101
|
+
this.limitStylingAppends = false;
|
|
102
|
+
this.setClientStyling = () => {
|
|
103
|
+
let sheet = document.createElement('style');
|
|
104
|
+
sheet.innerHTML = this.clientStyling;
|
|
105
|
+
this.stylingContainer.prepend(sheet);
|
|
106
|
+
};
|
|
107
|
+
this.setClientStylingURL = () => {
|
|
108
|
+
let cssFile = document.createElement('style');
|
|
109
|
+
setTimeout(() => {
|
|
110
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
111
|
+
this.stylingContainer.prepend(cssFile);
|
|
112
|
+
}, 1);
|
|
113
|
+
};
|
|
73
114
|
}
|
|
74
115
|
/**
|
|
75
116
|
* @TODO find a better way to implement click outside the custom select, so that we don't have to use the 'data-cluster' attribute on each element
|
|
@@ -103,6 +144,17 @@ const LotteryTicket = class {
|
|
|
103
144
|
console.error('Error!', err);
|
|
104
145
|
});
|
|
105
146
|
}
|
|
147
|
+
componentDidRender() {
|
|
148
|
+
// start custom styling area
|
|
149
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
150
|
+
if (this.clientStyling)
|
|
151
|
+
this.setClientStyling();
|
|
152
|
+
if (this.clientStylingUrlContent)
|
|
153
|
+
this.setClientStylingURL();
|
|
154
|
+
this.limitStylingAppends = true;
|
|
155
|
+
}
|
|
156
|
+
// end custom styling area
|
|
157
|
+
}
|
|
106
158
|
multiplierChangeHandler(e) {
|
|
107
159
|
this.multiplier = e.target ? e.target.checked : false;
|
|
108
160
|
this.multiplierChange.emit(this.multiplier);
|
|
@@ -151,9 +203,9 @@ const LotteryTicket = class {
|
|
|
151
203
|
}
|
|
152
204
|
else {
|
|
153
205
|
const { rules } = this.gameData;
|
|
154
|
-
return (index.h("div", { class: "TicketContainer" }, index.h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
|
|
206
|
+
return (index.h("div", { class: "TicketContainer", ref: el => this.stylingContainer = el }, index.h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
|
|
155
207
|
index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language))), this.autoPick && !this.ticketDone &&
|
|
156
|
-
index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language))), this.grids.map((item, index$1) => index.h("div", { class: "TicketGridBullets" }, index.h("p", { class: "TicketGridTitle" }, translate('grid', this.language), " ", item), index.h("lottery-grid", { "grid-index": index$1, "maximum-allowed": rules.boards[index$1].maximumAllowed, "minimum-allowed": rules.boards[index$1].minimumAllowed, "total-numbers": rules.boards[index$1].totalNumbers, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language }))), rules.multiplier &&
|
|
208
|
+
index.h("div", { class: "ButtonContainer" }, index.h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language))), this.grids.map((item, index$1) => index.h("div", { class: "TicketGridBullets" }, index.h("p", { class: "TicketGridTitle" }, translate('grid', this.language), " ", item), index.h("lottery-grid", { "grid-index": index$1, "maximum-allowed": rules.boards[index$1].maximumAllowed, "minimum-allowed": rules.boards[index$1].minimumAllowed, "total-numbers": rules.boards[index$1].totalNumbers, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))), rules.multiplier &&
|
|
157
209
|
index.h("div", null, index.h("label", { class: "Toggle" }, index.h("label", { class: "Label" }, translate('multiplier', this.language), ": "), index.h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), index.h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
|
|
158
210
|
index.h("div", { class: "TicketDraws" }, index.h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": "), index.h("div", { class: "NumberInput" }, index.h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), index.h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), index.h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), index.h("div", null, index.h("label", { class: "Label" }, translate('wagerPerDraw', this.language), ": "), index.h("div", { class: "WagerInput" }, rules.stakes.length > 1 ?
|
|
159
211
|
(index.h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, index.h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, index.h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.amount, " ", this.amountInfo.currency), index.h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), index.h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, index.h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, rules.stakes.map((item) => index.h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.amount == item.amount ? 'SelectedValue' : '', value: item.amount, onClick: () => this.setDropdownItem(item) }, item.amount, " ", item.currency)))))) : (index.h("div", null, index.h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), index.h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))))));
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
width: 50%;
|
|
87
87
|
max-width: 200px;
|
|
88
88
|
border: 1px solid #00958f;
|
|
89
|
-
background: #
|
|
90
|
-
color: #
|
|
89
|
+
background: #00958f;
|
|
90
|
+
color: #fff;
|
|
91
91
|
font-size: 12px;
|
|
92
92
|
transition: all 0.2s linear;
|
|
93
93
|
text-transform: uppercase;
|
|
@@ -95,8 +95,9 @@
|
|
|
95
95
|
letter-spacing: 0;
|
|
96
96
|
}
|
|
97
97
|
.GamePage .Tabs .TabButton.Active {
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
color: #00958f;
|
|
99
|
+
background: #F1F1F1;
|
|
100
|
+
border: 1px solid #F1F1F1;
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
.LastDrawResultsTitle {
|
|
@@ -145,6 +146,7 @@
|
|
|
145
146
|
height: 100px;
|
|
146
147
|
width: 100%;
|
|
147
148
|
display: flex;
|
|
149
|
+
margin-top: 10px;
|
|
148
150
|
flex-direction: column;
|
|
149
151
|
justify-content: center;
|
|
150
152
|
align-items: center;
|
|
@@ -20,6 +20,15 @@ export class LotteryGamePage {
|
|
|
20
20
|
* Shows the reset button
|
|
21
21
|
*/
|
|
22
22
|
this.resetButton = false;
|
|
23
|
+
/**
|
|
24
|
+
* Client custom styling via string
|
|
25
|
+
*/
|
|
26
|
+
this.clientStyling = '';
|
|
27
|
+
/**
|
|
28
|
+
* Client custom styling via url
|
|
29
|
+
*/
|
|
30
|
+
this.clientStylingurl = '';
|
|
31
|
+
this.clientStylingUrlContent = '';
|
|
23
32
|
this.tickets = [];
|
|
24
33
|
this.tabIndex = 0;
|
|
25
34
|
this.hasErrors = false;
|
|
@@ -30,8 +39,25 @@ export class LotteryGamePage {
|
|
|
30
39
|
this.totalWinningsAmount = 0;
|
|
31
40
|
this.isLoggedIn = false;
|
|
32
41
|
this.loginModalVisible = false;
|
|
42
|
+
this.limitStylingAppends = false;
|
|
33
43
|
this.multiplier = false;
|
|
34
44
|
this.quickPick = false;
|
|
45
|
+
this.setClientStyling = () => {
|
|
46
|
+
let sheet = document.createElement('style');
|
|
47
|
+
sheet.innerHTML = this.clientStyling;
|
|
48
|
+
this.stylingContainer.prepend(sheet);
|
|
49
|
+
};
|
|
50
|
+
this.setClientStylingURL = () => {
|
|
51
|
+
let url = new URL(this.clientStylingurl);
|
|
52
|
+
let cssFile = document.createElement('style');
|
|
53
|
+
fetch(url.href)
|
|
54
|
+
.then((res) => res.text())
|
|
55
|
+
.then((data) => {
|
|
56
|
+
this.clientStylingUrlContent = data;
|
|
57
|
+
cssFile.innerHTML = data;
|
|
58
|
+
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
59
|
+
});
|
|
60
|
+
};
|
|
35
61
|
}
|
|
36
62
|
// @TODO fix `any` type later, I'm lazy now
|
|
37
63
|
connectedCallback() {
|
|
@@ -42,6 +68,17 @@ export class LotteryGamePage {
|
|
|
42
68
|
this.isLoggedIn = true;
|
|
43
69
|
}
|
|
44
70
|
}
|
|
71
|
+
componentDidRender() {
|
|
72
|
+
// start custom styling area
|
|
73
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
74
|
+
if (this.clientStyling)
|
|
75
|
+
this.setClientStyling();
|
|
76
|
+
if (this.clientStylingurl)
|
|
77
|
+
this.setClientStylingURL();
|
|
78
|
+
this.limitStylingAppends = true;
|
|
79
|
+
}
|
|
80
|
+
// end custom styling area
|
|
81
|
+
}
|
|
45
82
|
countdownLogic(date) {
|
|
46
83
|
this.interval = setInterval(() => {
|
|
47
84
|
this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
|
|
@@ -244,7 +281,7 @@ export class LotteryGamePage {
|
|
|
244
281
|
}
|
|
245
282
|
return (
|
|
246
283
|
/* Game details */
|
|
247
|
-
h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr' },
|
|
284
|
+
h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr', ref: el => this.stylingContainer = el },
|
|
248
285
|
h("div", { class: "GridBanner" },
|
|
249
286
|
h("div", { class: "BannerButtonsWrapper" },
|
|
250
287
|
h("button", { class: "BannerBackButton" },
|
|
@@ -279,9 +316,9 @@ export class LotteryGamePage {
|
|
|
279
316
|
this.tabIndex == 0 &&
|
|
280
317
|
h("div", { class: "GamePageContent" },
|
|
281
318
|
h("div", { class: "GameDetails" },
|
|
282
|
-
h("lottery-game-details",
|
|
319
|
+
h("lottery-game-details", { "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })),
|
|
283
320
|
h("div", { class: "TicketsWrapper" },
|
|
284
|
-
this.tickets.map((item) => h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": this.autoPick, "reset-button": this.resetButton })),
|
|
321
|
+
this.tickets.map((item) => h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": this.autoPick, "reset-button": this.resetButton, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })),
|
|
285
322
|
h("div", { class: "CreateNewTicket" },
|
|
286
323
|
h("button", { onClick: () => this.createNewTicket() }, "+"),
|
|
287
324
|
h("span", null, translate('createTicket', this.language)))),
|
|
@@ -304,16 +341,16 @@ export class LotteryGamePage {
|
|
|
304
341
|
!this.isLoggedIn &&
|
|
305
342
|
h("div", null,
|
|
306
343
|
h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)),
|
|
307
|
-
h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible },
|
|
344
|
+
h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent },
|
|
308
345
|
h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))),
|
|
309
346
|
this.tabIndex == 1 &&
|
|
310
347
|
h("div", null,
|
|
311
348
|
h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)),
|
|
312
|
-
h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true }),
|
|
313
|
-
h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language })),
|
|
314
|
-
h("helper-modal", { "title-modal": "Success", visible: this.successVisible },
|
|
349
|
+
h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }),
|
|
350
|
+
h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })),
|
|
351
|
+
h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent },
|
|
315
352
|
h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))),
|
|
316
|
-
h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible },
|
|
353
|
+
h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent },
|
|
317
354
|
h("div", { class: "DeleteTicketModalWrapper" },
|
|
318
355
|
h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)),
|
|
319
356
|
h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)),
|
|
@@ -452,9 +489,46 @@ export class LotteryGamePage {
|
|
|
452
489
|
"attribute": "reset-button",
|
|
453
490
|
"reflect": false,
|
|
454
491
|
"defaultValue": "false"
|
|
492
|
+
},
|
|
493
|
+
"clientStyling": {
|
|
494
|
+
"type": "string",
|
|
495
|
+
"mutable": false,
|
|
496
|
+
"complexType": {
|
|
497
|
+
"original": "string",
|
|
498
|
+
"resolved": "string",
|
|
499
|
+
"references": {}
|
|
500
|
+
},
|
|
501
|
+
"required": false,
|
|
502
|
+
"optional": false,
|
|
503
|
+
"docs": {
|
|
504
|
+
"tags": [],
|
|
505
|
+
"text": "Client custom styling via string"
|
|
506
|
+
},
|
|
507
|
+
"attribute": "client-styling",
|
|
508
|
+
"reflect": false,
|
|
509
|
+
"defaultValue": "''"
|
|
510
|
+
},
|
|
511
|
+
"clientStylingurl": {
|
|
512
|
+
"type": "string",
|
|
513
|
+
"mutable": false,
|
|
514
|
+
"complexType": {
|
|
515
|
+
"original": "string",
|
|
516
|
+
"resolved": "string",
|
|
517
|
+
"references": {}
|
|
518
|
+
},
|
|
519
|
+
"required": false,
|
|
520
|
+
"optional": false,
|
|
521
|
+
"docs": {
|
|
522
|
+
"tags": [],
|
|
523
|
+
"text": "Client custom styling via url"
|
|
524
|
+
},
|
|
525
|
+
"attribute": "client-stylingurl",
|
|
526
|
+
"reflect": false,
|
|
527
|
+
"defaultValue": "''"
|
|
455
528
|
}
|
|
456
529
|
}; }
|
|
457
530
|
static get states() { return {
|
|
531
|
+
"clientStylingUrlContent": {},
|
|
458
532
|
"tickets": {},
|
|
459
533
|
"tabIndex": {},
|
|
460
534
|
"hasErrors": {},
|
|
@@ -470,7 +544,8 @@ export class LotteryGamePage {
|
|
|
470
544
|
"totalWinningsAmount": {},
|
|
471
545
|
"nextDate": {},
|
|
472
546
|
"isLoggedIn": {},
|
|
473
|
-
"loginModalVisible": {}
|
|
547
|
+
"loginModalVisible": {},
|
|
548
|
+
"limitStylingAppends": {}
|
|
474
549
|
}; }
|
|
475
550
|
static get elementRef() { return "element"; }
|
|
476
551
|
static get listeners() { return [{
|