@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
|
@@ -13,7 +13,7 @@ import { d as defineCustomElement$3 } from './lottery-ticket2.js';
|
|
|
13
13
|
import { d as defineCustomElement$2 } from './lottery-ticket-controller2.js';
|
|
14
14
|
|
|
15
15
|
const DEFAULT_LANGUAGE = 'en';
|
|
16
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en', 'ar'];
|
|
16
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar'];
|
|
17
17
|
const TRANSLATIONS = {
|
|
18
18
|
en: {
|
|
19
19
|
error: 'Error',
|
|
@@ -61,6 +61,29 @@ const TRANSLATIONS = {
|
|
|
61
61
|
lastDrawResultsTitle: 'Cele mai recente extrageri',
|
|
62
62
|
modalLogin: 'Please login to submit a ticket',
|
|
63
63
|
},
|
|
64
|
+
fr: {
|
|
65
|
+
error: 'Error',
|
|
66
|
+
title: 'Chrono',
|
|
67
|
+
backButton: 'Back',
|
|
68
|
+
lobbyButton: 'Lobby',
|
|
69
|
+
prize: 'Prize',
|
|
70
|
+
winUpTo: 'Win up to',
|
|
71
|
+
nextDraw: 'Next draw in: ',
|
|
72
|
+
buy: 'Buy tickets',
|
|
73
|
+
viewLatest: 'View latest results',
|
|
74
|
+
createTicket: 'Create Ticket',
|
|
75
|
+
modalSuccess: 'Purchase successfully completed!',
|
|
76
|
+
deleteTicketModalTitle: 'Delete Ticket',
|
|
77
|
+
deleteTicketModalText: 'Are you sure you want to delete this ticket?',
|
|
78
|
+
deleteTicketModalCancel: 'Cancel',
|
|
79
|
+
deleteTicketModalConfirm: 'Delete',
|
|
80
|
+
orderSummaryTitle: 'Order Summary',
|
|
81
|
+
orderSummaryTickets: 'Ticket',
|
|
82
|
+
orderSummaryTotal: 'Total',
|
|
83
|
+
orderSummarySubmit: 'Submit',
|
|
84
|
+
lastDrawResultsTitle: 'Résultats du dernier tirage',
|
|
85
|
+
modalLogin: 'Please login to submit a ticket',
|
|
86
|
+
},
|
|
64
87
|
ar: {
|
|
65
88
|
error: 'خطأ',
|
|
66
89
|
title: 'كرونو',
|
|
@@ -81,16 +104,16 @@ const TRANSLATIONS = {
|
|
|
81
104
|
orderSummaryTickets: 'تذكرة',
|
|
82
105
|
orderSummaryTotal: 'المجموع',
|
|
83
106
|
orderSummarySubmit: 'يُقدِّم',
|
|
84
|
-
lastDrawResultsTitle: '
|
|
107
|
+
lastDrawResultsTitle: 'نتائج آخر سحب',
|
|
85
108
|
modalLogin: 'الرجاء تسجيل الدخول لتقديم تذكرة'
|
|
86
|
-
}
|
|
109
|
+
}
|
|
87
110
|
};
|
|
88
111
|
const translate = (key, customLang) => {
|
|
89
112
|
const lang = customLang;
|
|
90
113
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
91
114
|
};
|
|
92
115
|
|
|
93
|
-
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:#
|
|
116
|
+
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%}}";
|
|
94
117
|
|
|
95
118
|
const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
96
119
|
constructor() {
|
|
@@ -109,6 +132,15 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
109
132
|
* Shows the reset button
|
|
110
133
|
*/
|
|
111
134
|
this.resetButton = false;
|
|
135
|
+
/**
|
|
136
|
+
* Client custom styling via string
|
|
137
|
+
*/
|
|
138
|
+
this.clientStyling = '';
|
|
139
|
+
/**
|
|
140
|
+
* Client custom styling via url
|
|
141
|
+
*/
|
|
142
|
+
this.clientStylingurl = '';
|
|
143
|
+
this.clientStylingUrlContent = '';
|
|
112
144
|
this.tickets = [];
|
|
113
145
|
this.tabIndex = 0;
|
|
114
146
|
this.hasErrors = false;
|
|
@@ -119,8 +151,25 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
119
151
|
this.totalWinningsAmount = 0;
|
|
120
152
|
this.isLoggedIn = false;
|
|
121
153
|
this.loginModalVisible = false;
|
|
154
|
+
this.limitStylingAppends = false;
|
|
122
155
|
this.multiplier = false;
|
|
123
156
|
this.quickPick = false;
|
|
157
|
+
this.setClientStyling = () => {
|
|
158
|
+
let sheet = document.createElement('style');
|
|
159
|
+
sheet.innerHTML = this.clientStyling;
|
|
160
|
+
this.stylingContainer.prepend(sheet);
|
|
161
|
+
};
|
|
162
|
+
this.setClientStylingURL = () => {
|
|
163
|
+
let url = new URL(this.clientStylingurl);
|
|
164
|
+
let cssFile = document.createElement('style');
|
|
165
|
+
fetch(url.href)
|
|
166
|
+
.then((res) => res.text())
|
|
167
|
+
.then((data) => {
|
|
168
|
+
this.clientStylingUrlContent = data;
|
|
169
|
+
cssFile.innerHTML = data;
|
|
170
|
+
setTimeout(() => { this.stylingContainer.prepend(cssFile); }, 1);
|
|
171
|
+
});
|
|
172
|
+
};
|
|
124
173
|
}
|
|
125
174
|
// @TODO fix `any` type later, I'm lazy now
|
|
126
175
|
connectedCallback() {
|
|
@@ -131,6 +180,17 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
131
180
|
this.isLoggedIn = true;
|
|
132
181
|
}
|
|
133
182
|
}
|
|
183
|
+
componentDidRender() {
|
|
184
|
+
// start custom styling area
|
|
185
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
186
|
+
if (this.clientStyling)
|
|
187
|
+
this.setClientStyling();
|
|
188
|
+
if (this.clientStylingurl)
|
|
189
|
+
this.setClientStylingURL();
|
|
190
|
+
this.limitStylingAppends = true;
|
|
191
|
+
}
|
|
192
|
+
// end custom styling area
|
|
193
|
+
}
|
|
134
194
|
countdownLogic(date) {
|
|
135
195
|
this.interval = setInterval(() => {
|
|
136
196
|
this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
|
|
@@ -332,11 +392,11 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
332
392
|
}
|
|
333
393
|
return (
|
|
334
394
|
/* Game details */
|
|
335
|
-
h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr' }, h("div", { class: "GridBanner" }, h("div", { class: "BannerButtonsWrapper" }, h("button", { class: "BannerBackButton" }, h("span", { class: "BannerBackButtonArrow" }, "\u1438 "), translate('backButton', this.language)), h("button", { class: "BannerLobbyButton" }, translate('lobbyButton', this.language))), h("div", { class: "Tabs" }, h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate('buy', this.language)), h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate('viewLatest', this.language)))), h("div", { class: "NextDrawWrapper" }, h("div", { class: "TotalWinnings" }, translate('winUpTo', this.language), ": ", h("span", null, "$", this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))), h("div", { class: "NextDraw" }, h("p", { class: "BannerText" }, translate('nextDraw', this.language)), h("div", { class: "BannerCountdown" }, h("span", { class: "CountdownDays" }, this.daysRemaining, "D"), h("span", { class: "CountdownHours" }, this.hoursRemaining, "H"), h("span", { class: "CountdownMinutes" }, this.minutesRemaining, "M"), h("span", { class: "CountdownSeconds" }, this.secondsRemaining, "S")))), this.tabIndex == 0 &&
|
|
336
|
-
h("div", { class: "GamePageContent" }, h("div", { class: "GameDetails" }, h("lottery-game-details",
|
|
395
|
+
h("div", { class: "GamePage", dir: this.language == 'ar' ? 'rtl' : 'ltr', ref: el => this.stylingContainer = el }, h("div", { class: "GridBanner" }, h("div", { class: "BannerButtonsWrapper" }, h("button", { class: "BannerBackButton" }, h("span", { class: "BannerBackButtonArrow" }, "\u1438 "), translate('backButton', this.language)), h("button", { class: "BannerLobbyButton" }, translate('lobbyButton', this.language))), h("div", { class: "Tabs" }, h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate('buy', this.language)), h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate('viewLatest', this.language)))), h("div", { class: "NextDrawWrapper" }, h("div", { class: "TotalWinnings" }, translate('winUpTo', this.language), ": ", h("span", null, "$", this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))), h("div", { class: "NextDraw" }, h("p", { class: "BannerText" }, translate('nextDraw', this.language)), h("div", { class: "BannerCountdown" }, h("span", { class: "CountdownDays" }, this.daysRemaining, "D"), h("span", { class: "CountdownHours" }, this.hoursRemaining, "H"), h("span", { class: "CountdownMinutes" }, this.minutesRemaining, "M"), h("span", { class: "CountdownSeconds" }, this.secondsRemaining, "S")))), this.tabIndex == 0 &&
|
|
396
|
+
h("div", { class: "GamePageContent" }, h("div", { class: "GameDetails" }, h("lottery-game-details", { "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h("div", { class: "TicketsWrapper" }, 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 })), h("div", { class: "CreateNewTicket" }, h("button", { onClick: () => this.createNewTicket() }, "+"), h("span", null, translate('createTicket', this.language)))), h("div", { class: "OrderSummary" }, h("h3", { class: "OrderSummaryTitle" }, translate('orderSummaryTitle', this.language)), h("div", { class: "Ticket" }, translate('orderSummaryTickets', this.language), ": ", h("span", null, this.tickets.length)), h("div", { class: "Total" }, translate('orderSummaryTotal', this.language), ": ", h("span", null, this.totalAmount, " ", this.currency)), h("div", { class: "ButtonWrapper" }, this.isLoggedIn &&
|
|
337
397
|
h("span", { class: "Button", onClick: () => this.submitTickets() }, translate('orderSummarySubmit', this.language)), !this.isLoggedIn &&
|
|
338
|
-
h("div", null, h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)), h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible }, h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))), this.tabIndex == 1 &&
|
|
339
|
-
h("div", null, h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)), h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true }), h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language })), h("helper-modal", { "title-modal": "Success", visible: this.successVisible }, h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))), h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible }, h("div", { class: "DeleteTicketModalWrapper" }, h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)), h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)), h("div", { class: "DeleteTicketModalButtons" }, h("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate('deleteTicketModalCancel', this.language)), h("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate('deleteTicketModalConfirm', this.language)))))));
|
|
398
|
+
h("div", null, h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)), h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))), this.tabIndex == 1 &&
|
|
399
|
+
h("div", null, h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)), 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 }), 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 })), h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))), h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("div", { class: "DeleteTicketModalWrapper" }, h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)), h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)), h("div", { class: "DeleteTicketModalButtons" }, h("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate('deleteTicketModalCancel', this.language)), h("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate('deleteTicketModalConfirm', this.language)))))));
|
|
340
400
|
}
|
|
341
401
|
static get assetsDirs() { return ["static"]; }
|
|
342
402
|
get element() { return this; }
|
|
@@ -349,6 +409,9 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
349
409
|
"language": [1],
|
|
350
410
|
"autoPick": [4, "auto-pick"],
|
|
351
411
|
"resetButton": [4, "reset-button"],
|
|
412
|
+
"clientStyling": [1, "client-styling"],
|
|
413
|
+
"clientStylingurl": [1, "client-stylingurl"],
|
|
414
|
+
"clientStylingUrlContent": [32],
|
|
352
415
|
"tickets": [32],
|
|
353
416
|
"tabIndex": [32],
|
|
354
417
|
"hasErrors": [32],
|
|
@@ -364,7 +427,8 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
364
427
|
"totalWinningsAmount": [32],
|
|
365
428
|
"nextDate": [32],
|
|
366
429
|
"isLoggedIn": [32],
|
|
367
|
-
"loginModalVisible": [32]
|
|
430
|
+
"loginModalVisible": [32],
|
|
431
|
+
"limitStylingAppends": [32]
|
|
368
432
|
}, [[0, "ticketCompleted", "gridFilledHandler"], [0, "gridDirty", "gridDirtyHandler"], [0, "deleteTicket", "deleteTicketHandler"], [0, "modalCloseEvent", "modalCloseEvent"], [0, "stakeChange", "stakeChangeHandler"], [0, "multiplierChange", "multiplierChangeHandler"]]]);
|
|
369
433
|
function defineCustomElement$1() {
|
|
370
434
|
if (typeof customElements === "undefined") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$1 } from './lottery-bullet2.js';
|
|
3
3
|
|
|
4
|
-
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:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:
|
|
4
|
+
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:1200px}.Grid{margin-top:10px 0 10px 0;display:flex;flex-direction:row;flex-wrap:wrap;gap:20px}.Grid.TicketGrid{gap:5px}";
|
|
5
5
|
|
|
6
6
|
const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -38,8 +38,33 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
38
38
|
* Language
|
|
39
39
|
*/
|
|
40
40
|
this.language = 'en';
|
|
41
|
+
/**
|
|
42
|
+
* Personalize grid for ticket
|
|
43
|
+
*/
|
|
44
|
+
this.gridType = '';
|
|
45
|
+
/**
|
|
46
|
+
* Client custom styling via string
|
|
47
|
+
*/
|
|
48
|
+
this.clientStyling = '';
|
|
49
|
+
/**
|
|
50
|
+
* Client custom styling via url content
|
|
51
|
+
*/
|
|
52
|
+
this.clientStylingUrlContent = '';
|
|
41
53
|
this.numbers = [];
|
|
54
|
+
this.limitStylingAppends = false;
|
|
42
55
|
this.selectedCounter = 0;
|
|
56
|
+
this.setClientStyling = () => {
|
|
57
|
+
let sheet = document.createElement('style');
|
|
58
|
+
sheet.innerHTML = this.clientStyling;
|
|
59
|
+
this.stylingContainer.prepend(sheet);
|
|
60
|
+
};
|
|
61
|
+
this.setClientStylingURL = () => {
|
|
62
|
+
let cssFile = document.createElement('style');
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
65
|
+
this.stylingContainer.prepend(cssFile);
|
|
66
|
+
}, 1);
|
|
67
|
+
};
|
|
43
68
|
}
|
|
44
69
|
connectedCallback() {
|
|
45
70
|
let selected = [];
|
|
@@ -68,6 +93,17 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
68
93
|
});
|
|
69
94
|
}
|
|
70
95
|
}
|
|
96
|
+
componentDidRender() {
|
|
97
|
+
// start custom styling area
|
|
98
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
99
|
+
if (this.clientStyling)
|
|
100
|
+
this.setClientStyling();
|
|
101
|
+
if (this.clientStylingUrlContent)
|
|
102
|
+
this.setClientStylingURL();
|
|
103
|
+
this.limitStylingAppends = true;
|
|
104
|
+
}
|
|
105
|
+
// end custom styling area
|
|
106
|
+
}
|
|
71
107
|
lotteryBulletSelectionHandler(event) {
|
|
72
108
|
this.numbers = this.numbers.map((item) => {
|
|
73
109
|
if (item.number == event.detail.value) {
|
|
@@ -158,7 +194,7 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
158
194
|
}
|
|
159
195
|
}
|
|
160
196
|
render() {
|
|
161
|
-
return (h("div", { class: "GridContainer" }, h("div", { class:
|
|
197
|
+
return (h("div", { class: "GridContainer", ref: el => this.stylingContainer = el }, h("div", { class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => h("div", null, h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))));
|
|
162
198
|
}
|
|
163
199
|
static get style() { return lotteryGridCss; }
|
|
164
200
|
}, [1, "lottery-grid", {
|
|
@@ -172,7 +208,11 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
172
208
|
"displaySelected": [4, "display-selected"],
|
|
173
209
|
"language": [1],
|
|
174
210
|
"gridIndex": [2, "grid-index"],
|
|
175
|
-
"
|
|
211
|
+
"gridType": [1, "grid-type"],
|
|
212
|
+
"clientStyling": [1, "client-styling"],
|
|
213
|
+
"clientStylingUrlContent": [1, "client-styling-url-content"],
|
|
214
|
+
"numbers": [32],
|
|
215
|
+
"limitStylingAppends": [32]
|
|
176
216
|
}, [[0, "lotteryBulletSelection", "lotteryBulletSelectionHandler"], [4, "resetSelection", "resetSelectionHandler"], [4, "autoSelection", "autoSelectionHandler"]]]);
|
|
177
217
|
function defineCustomElement() {
|
|
178
218
|
if (typeof customElements === "undefined") {
|
|
@@ -4,6 +4,27 @@ import { d as defineCustomElement$3 } from './lottery-bullet2.js';
|
|
|
4
4
|
import { d as defineCustomElement$2 } from './lottery-grid2.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './lottery-ticket2.js';
|
|
6
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
|
+
};
|
|
27
|
+
|
|
7
28
|
const lotteryTicketControllerCss = ":host{display:block}";
|
|
8
29
|
|
|
9
30
|
const LotteryTicketController = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -52,6 +73,27 @@ const LotteryTicketController = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
52
73
|
* Shows the reset button
|
|
53
74
|
*/
|
|
54
75
|
this.resetButton = false;
|
|
76
|
+
/**
|
|
77
|
+
* Client custom styling via string
|
|
78
|
+
*/
|
|
79
|
+
this.clientStyling = '';
|
|
80
|
+
/**
|
|
81
|
+
* Client custom styling via url content
|
|
82
|
+
*/
|
|
83
|
+
this.clientStylingUrlContent = '';
|
|
84
|
+
this.limitStylingAppends = false;
|
|
85
|
+
this.setClientStyling = () => {
|
|
86
|
+
let sheet = document.createElement('style');
|
|
87
|
+
sheet.innerHTML = this.clientStyling;
|
|
88
|
+
this.stylingContainer.prepend(sheet);
|
|
89
|
+
};
|
|
90
|
+
this.setClientStylingURL = () => {
|
|
91
|
+
let cssFile = document.createElement('style');
|
|
92
|
+
setTimeout(() => {
|
|
93
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
94
|
+
this.stylingContainer.prepend(cssFile);
|
|
95
|
+
}, 1);
|
|
96
|
+
};
|
|
55
97
|
}
|
|
56
98
|
// @TODO fix the `any` type
|
|
57
99
|
helperAccordionActionHandler() {
|
|
@@ -62,8 +104,19 @@ const LotteryTicketController = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
62
104
|
ticketId: this.ticketId
|
|
63
105
|
});
|
|
64
106
|
}
|
|
107
|
+
componentDidRender() {
|
|
108
|
+
// start custom styling area
|
|
109
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
110
|
+
if (this.clientStyling)
|
|
111
|
+
this.setClientStyling();
|
|
112
|
+
if (this.clientStylingUrlContent)
|
|
113
|
+
this.setClientStylingURL();
|
|
114
|
+
this.limitStylingAppends = true;
|
|
115
|
+
}
|
|
116
|
+
// end custom styling area
|
|
117
|
+
}
|
|
65
118
|
render() {
|
|
66
|
-
return (h("div",
|
|
119
|
+
return (h("div", { class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, 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 }, 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, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
|
|
67
120
|
}
|
|
68
121
|
static get style() { return lotteryTicketControllerCss; }
|
|
69
122
|
}, [1, "lottery-ticket-controller", {
|
|
@@ -78,7 +131,10 @@ const LotteryTicketController = /*@__PURE__*/ proxyCustomElement(class extends H
|
|
|
78
131
|
"last": [4],
|
|
79
132
|
"language": [1],
|
|
80
133
|
"autoPick": [4, "auto-pick"],
|
|
81
|
-
"resetButton": [4, "reset-button"]
|
|
134
|
+
"resetButton": [4, "reset-button"],
|
|
135
|
+
"clientStyling": [1, "client-styling"],
|
|
136
|
+
"clientStylingUrlContent": [1, "client-styling-url-content"],
|
|
137
|
+
"limitStylingAppends": [32]
|
|
82
138
|
}, [[0, "helperAccordionAction", "helperAccordionActionHandler"]]]);
|
|
83
139
|
function defineCustomElement() {
|
|
84
140
|
if (typeof customElements === "undefined") {
|
|
@@ -25,6 +25,26 @@ const TRANSLATIONS = {
|
|
|
25
25
|
resetButton: 'Reseteaza',
|
|
26
26
|
autoButton: 'Ma simt norocos'
|
|
27
27
|
},
|
|
28
|
+
fr: {
|
|
29
|
+
loading: 'Loading, please wait ...',
|
|
30
|
+
error: 'It was an error while trying to fetch the data',
|
|
31
|
+
grid: 'Grid',
|
|
32
|
+
multiplier: 'Multiplier',
|
|
33
|
+
numberOfDraws: 'Number of draws',
|
|
34
|
+
wagerPerDraw: 'Wager per draw',
|
|
35
|
+
resetButton: 'Reset',
|
|
36
|
+
autoButton: 'I feel lucky'
|
|
37
|
+
},
|
|
38
|
+
ar: {
|
|
39
|
+
loading: 'Loading, please wait ...',
|
|
40
|
+
error: 'It was an error while trying to fetch the data',
|
|
41
|
+
grid: 'Grid',
|
|
42
|
+
multiplier: 'Multiplier',
|
|
43
|
+
numberOfDraws: 'Number of draws',
|
|
44
|
+
wagerPerDraw: 'Wager per draw',
|
|
45
|
+
resetButton: 'Reset',
|
|
46
|
+
autoButton: 'I feel lucky'
|
|
47
|
+
}
|
|
28
48
|
};
|
|
29
49
|
const translate = (key, customLang) => {
|
|
30
50
|
const lang = customLang;
|
|
@@ -63,6 +83,14 @@ const LotteryTicket = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
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 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
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 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
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 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
151
203
|
}
|
|
152
204
|
else {
|
|
153
205
|
const { rules } = this.gameData;
|
|
154
|
-
return (h("div", { class: "TicketContainer" }, h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
|
|
206
|
+
return (h("div", { class: "TicketContainer", ref: el => this.stylingContainer = el }, h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
|
|
155
207
|
h("div", { class: "ButtonContainer" }, h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language))), this.autoPick && !this.ticketDone &&
|
|
156
|
-
h("div", { class: "ButtonContainer" }, h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language))), this.grids.map((item, index) => h("div", { class: "TicketGridBullets" }, h("p", { class: "TicketGridTitle" }, translate('grid', this.language), " ", item), h("lottery-grid", { "grid-index": index, "maximum-allowed": rules.boards[index].maximumAllowed, "minimum-allowed": rules.boards[index].minimumAllowed, "total-numbers": rules.boards[index].totalNumbers, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language }))), rules.multiplier &&
|
|
208
|
+
h("div", { class: "ButtonContainer" }, h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language))), this.grids.map((item, index) => h("div", { class: "TicketGridBullets" }, h("p", { class: "TicketGridTitle" }, translate('grid', this.language), " ", item), h("lottery-grid", { "grid-index": index, "maximum-allowed": rules.boards[index].maximumAllowed, "minimum-allowed": rules.boards[index].minimumAllowed, "total-numbers": rules.boards[index].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
|
h("div", null, h("label", { class: "Toggle" }, h("label", { class: "Label" }, translate('multiplier', this.language), ": "), h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
|
|
158
210
|
h("div", { class: "TicketDraws" }, h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": "), h("div", { class: "NumberInput" }, h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), h("div", null, h("label", { class: "Label" }, translate('wagerPerDraw', this.language), ": "), h("div", { class: "WagerInput" }, rules.stakes.length > 1 ?
|
|
159
211
|
(h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.amount, " ", this.amountInfo.currency), h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, rules.stakes.map((item) => h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.amount == item.amount ? 'SelectedValue' : '', value: item.amount, onClick: () => this.setDropdownItem(item) }, item.amount, " ", item.currency)))))) : (h("div", null, h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))))));
|
|
@@ -173,13 +225,16 @@ const LotteryTicket = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
173
225
|
"resetButton": [4, "reset-button"],
|
|
174
226
|
"autoPick": [4, "auto-pick"],
|
|
175
227
|
"language": [1],
|
|
228
|
+
"clientStyling": [1, "client-styling"],
|
|
229
|
+
"clientStylingUrlContent": [1, "client-styling-url-content"],
|
|
176
230
|
"multiplier": [32],
|
|
177
231
|
"numberOfDraws": [32],
|
|
178
232
|
"isLoading": [32],
|
|
179
233
|
"hasErrors": [32],
|
|
180
234
|
"ticketDone": [32],
|
|
181
235
|
"isCustomSelect": [32],
|
|
182
|
-
"amountInfo": [32]
|
|
236
|
+
"amountInfo": [32],
|
|
237
|
+
"limitStylingAppends": [32]
|
|
183
238
|
}, [[8, "click", "checkForClickOutside"], [0, "gridFilled", "gridFilledHandler"]]]);
|
|
184
239
|
function defineCustomElement() {
|
|
185
240
|
if (typeof customElements === "undefined") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-0f8edfd2.js';
|
|
2
2
|
|
|
3
3
|
const DEFAULT_LANGUAGE = 'en';
|
|
4
4
|
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
@@ -9,13 +9,19 @@ const TRANSLATIONS = {
|
|
|
9
9
|
ro: {
|
|
10
10
|
deleteTicket: 'Sterge biletul'
|
|
11
11
|
},
|
|
12
|
+
fr: {
|
|
13
|
+
deleteTicket: 'Supprimer le billet'
|
|
14
|
+
},
|
|
15
|
+
ar: {
|
|
16
|
+
deleteTicket: 'حذف التذكرة'
|
|
17
|
+
}
|
|
12
18
|
};
|
|
13
19
|
const translate = (key, customLang) => {
|
|
14
20
|
const lang = customLang;
|
|
15
21
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
16
22
|
};
|
|
17
23
|
|
|
18
|
-
const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:
|
|
24
|
+
const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:5px;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:1px}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff;text-transform:capitalize}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:#F1F1F1;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:5px}.HeaderTicketHistory:hover{background:#00ABA4}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:#000}.HeaderTicketHistory .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:4px;margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}";
|
|
19
25
|
|
|
20
26
|
const Accordion = class {
|
|
21
27
|
constructor(hostRef) {
|
|
@@ -61,11 +67,43 @@ const Accordion = class {
|
|
|
61
67
|
* Language
|
|
62
68
|
*/
|
|
63
69
|
this.language = 'en';
|
|
70
|
+
/**
|
|
71
|
+
* Client custom styling via string
|
|
72
|
+
*/
|
|
73
|
+
this.clientStyling = '';
|
|
74
|
+
/**
|
|
75
|
+
* Client custom styling via url content
|
|
76
|
+
*/
|
|
77
|
+
this.clientStylingUrlContent = '';
|
|
78
|
+
this.limitStylingAppends = false;
|
|
79
|
+
this.setClientStyling = () => {
|
|
80
|
+
let sheet = document.createElement('style');
|
|
81
|
+
sheet.innerHTML = this.clientStyling;
|
|
82
|
+
this.stylingContainer.prepend(sheet);
|
|
83
|
+
};
|
|
84
|
+
this.setClientStylingURL = () => {
|
|
85
|
+
let cssFile = document.createElement('style');
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
88
|
+
this.stylingContainer.prepend(cssFile);
|
|
89
|
+
}, 1);
|
|
90
|
+
};
|
|
64
91
|
}
|
|
65
92
|
// @TODO fix the `any` type :)
|
|
66
93
|
connectedCallback() {
|
|
67
94
|
this.showContent = !this.collapsed;
|
|
68
95
|
}
|
|
96
|
+
componentDidRender() {
|
|
97
|
+
// start custom styling area
|
|
98
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
99
|
+
if (this.clientStyling)
|
|
100
|
+
this.setClientStyling();
|
|
101
|
+
if (this.clientStylingUrlContent)
|
|
102
|
+
this.setClientStylingURL();
|
|
103
|
+
this.limitStylingAppends = true;
|
|
104
|
+
}
|
|
105
|
+
// end custom styling area
|
|
106
|
+
}
|
|
69
107
|
toggleContent() {
|
|
70
108
|
this.showContent = !this.showContent;
|
|
71
109
|
}
|
|
@@ -77,7 +115,7 @@ const Accordion = class {
|
|
|
77
115
|
this.accordionEvent.emit();
|
|
78
116
|
}
|
|
79
117
|
render() {
|
|
80
|
-
return (h("div", { class: "Wrapper" }, h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header' }, h("p", { class: "Title" }, this.headerTitle), h("p", { class: "Subtitle" }, this.headerSubtitle), h("p", { class: "Subtitle" }, this.description), h("span", { class: "Expand", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')), this.showContent &&
|
|
118
|
+
return (h("div", { class: "Wrapper", ref: el => this.stylingContainer = el }, h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header' }, h("p", { class: "Title" }, this.headerTitle), h("p", { class: "Subtitle" }, this.headerSubtitle), h("p", { class: "Subtitle Description" }, this.description), h("span", { class: "Expand", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')), this.showContent &&
|
|
81
119
|
h("div", null, h("div", { class: "Content" }, h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
|
|
82
120
|
h("div", null, this.deleteTab &&
|
|
83
121
|
h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate('deleteTicket', this.language)))))));
|