@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h as h$2 } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h as h$2 } from './index-0f8edfd2.js';
|
|
2
2
|
|
|
3
3
|
const DEFAULT_LANGUAGE$1 = 'en';
|
|
4
4
|
const SUPPORTED_LANGUAGES$1 = ['ro', 'en'];
|
|
@@ -27,6 +27,32 @@ const TRANSLATIONS$1 = {
|
|
|
27
27
|
filterModalButton: 'Cauta',
|
|
28
28
|
filterOrDate: 'sau cauta dupa data'
|
|
29
29
|
},
|
|
30
|
+
fr: {
|
|
31
|
+
filterOpen: 'Filter',
|
|
32
|
+
filterClear: 'Clear',
|
|
33
|
+
filterModalTicketTitle: 'Ticket Results',
|
|
34
|
+
filterModalDrawTitle: 'Draws Results History',
|
|
35
|
+
filterTicketPlaceholder: 'Search for a ticket ID',
|
|
36
|
+
filterDrawPlaceholder: 'Search for a draw ID',
|
|
37
|
+
filterDateRangePlaceholder: 'Date Range',
|
|
38
|
+
filterModalButton: 'Search',
|
|
39
|
+
filterFromCalendar: 'From',
|
|
40
|
+
filterToCalendar: 'To',
|
|
41
|
+
filterOrDate: 'or search by date'
|
|
42
|
+
},
|
|
43
|
+
ar: {
|
|
44
|
+
filterOpen: 'Filter',
|
|
45
|
+
filterClear: 'Clear',
|
|
46
|
+
filterModalTicketTitle: 'Ticket Results',
|
|
47
|
+
filterModalDrawTitle: 'Draws Results History',
|
|
48
|
+
filterTicketPlaceholder: 'Search for a ticket ID',
|
|
49
|
+
filterDrawPlaceholder: 'Search for a draw ID',
|
|
50
|
+
filterDateRangePlaceholder: 'Date Range',
|
|
51
|
+
filterModalButton: 'Search',
|
|
52
|
+
filterFromCalendar: 'From',
|
|
53
|
+
filterToCalendar: 'To',
|
|
54
|
+
filterOrDate: 'or search by date'
|
|
55
|
+
}
|
|
30
56
|
};
|
|
31
57
|
const translate$2 = (key, customLang) => {
|
|
32
58
|
const lang = customLang;
|
|
@@ -22261,26 +22287,55 @@ const HelperFilters = class {
|
|
|
22261
22287
|
* Language
|
|
22262
22288
|
*/
|
|
22263
22289
|
this.language = 'en';
|
|
22290
|
+
/**
|
|
22291
|
+
* Notifies if the quick filters from tickets are active
|
|
22292
|
+
*/
|
|
22293
|
+
this.quickFiltersActive = false;
|
|
22294
|
+
/**
|
|
22295
|
+
* Client custom styling via string
|
|
22296
|
+
*/
|
|
22297
|
+
this.clientStyling = '';
|
|
22298
|
+
/**
|
|
22299
|
+
* Client custom styling via url content
|
|
22300
|
+
*/
|
|
22301
|
+
this.clientStylingUrlContent = '';
|
|
22264
22302
|
this.showFilterModal = false;
|
|
22265
22303
|
this.showClearButton = false;
|
|
22266
22304
|
this.filterData = {};
|
|
22267
22305
|
this.filterDataReset = { ticketDrawId: '', filterFromCalendar: '', filterToCalendar: '' };
|
|
22306
|
+
this.limitStylingAppends = false;
|
|
22307
|
+
this.setClientStyling = () => {
|
|
22308
|
+
let sheet = document.createElement('style');
|
|
22309
|
+
sheet.innerHTML = this.clientStyling;
|
|
22310
|
+
this.stylingContainer.prepend(sheet);
|
|
22311
|
+
};
|
|
22312
|
+
this.setClientStylingURL = () => {
|
|
22313
|
+
let cssFile = document.createElement('style');
|
|
22314
|
+
setTimeout(() => {
|
|
22315
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
22316
|
+
this.stylingContainer.prepend(cssFile);
|
|
22317
|
+
}, 1);
|
|
22318
|
+
};
|
|
22268
22319
|
}
|
|
22269
22320
|
// reset field values each time the filter modal opens
|
|
22270
22321
|
componentDidRender() {
|
|
22271
|
-
this.filterData.ticketDrawId = null;
|
|
22272
|
-
this.filterData.filterFromCalendar = null;
|
|
22273
|
-
this.filterData.filterToCalendar = null;
|
|
22274
22322
|
// @TODO: to way binding?
|
|
22275
22323
|
if (document.getElementById('#FilterById'))
|
|
22276
22324
|
document.getElementById('#FilterById').value = '';
|
|
22325
|
+
// start custom styling area
|
|
22326
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
22327
|
+
if (this.clientStyling)
|
|
22328
|
+
this.setClientStyling();
|
|
22329
|
+
if (this.clientStylingUrlContent)
|
|
22330
|
+
this.setClientStylingURL();
|
|
22331
|
+
this.limitStylingAppends = true;
|
|
22332
|
+
}
|
|
22333
|
+
// end custom styling area
|
|
22277
22334
|
}
|
|
22278
22335
|
filterSelectionHandler(event) {
|
|
22279
22336
|
if (this.postMessage)
|
|
22280
22337
|
window.postMessage({ type: 'filterSelection', event }, window.location.href);
|
|
22281
|
-
if (this.filterData.ticketDrawId)
|
|
22282
|
-
this.filterDraw.emit(event);
|
|
22283
|
-
if (this.filterData.filterFromCalendar || this.filterData.filterToCalendar)
|
|
22338
|
+
if (this.filterData.ticketDrawId || this.filterData.filterFromCalendar || this.filterData.filterToCalendar)
|
|
22284
22339
|
this.filterSelection.emit(event);
|
|
22285
22340
|
}
|
|
22286
22341
|
filterSelectionResetHandler(event) {
|
|
@@ -22316,7 +22371,10 @@ const HelperFilters = class {
|
|
|
22316
22371
|
this.filterData.filterToCalendar = new Date(event.target.value).toISOString();
|
|
22317
22372
|
}
|
|
22318
22373
|
render() {
|
|
22319
|
-
return (h$2("div", { class: "HelperFilters"
|
|
22374
|
+
return (h$2("div", { class: "HelperFilters", ref: el => this.stylingContainer = el }, h$2("div", { class: "FilterButtonsWrapper" }, h$2("button", { class: "FilterOpen", onClick: () => this.toggleFilterModal() }, translate$2('filterOpen', this.language)), (this.showClearButton || this.quickFiltersActive) ?
|
|
22375
|
+
h$2("button", { class: "FilterClear", onClick: () => this.resetSearch() }, translate$2('filterClear', this.language))
|
|
22376
|
+
:
|
|
22377
|
+
null), h$2("helper-modal", { "title-modal": "Filter Modal", visible: this.showFilterModal, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h$2("div", { class: "FilterModalHeader" }, h$2("h3", { class: "FilterModalTitle" }, this.activateTicketSearch ? translate$2('filterModalTicketTitle', this.language) : translate$2('filterModalDrawTitle', this.language))), h$2("div", { class: "FilterModalBody" }, h$2("input", { id: "FilterById", type: "text", value: this.filterData.ticketDrawId, onInput: (event) => this.handleTicketDrawId(event), class: "FilterModalSearch", placeholder: this.activateTicketSearch ? translate$2('filterTicketPlaceholder', this.language) : translate$2('filterDrawPlaceholder', this.language) }), h$2("p", null, translate$2('filterOrDate', this.language)), h$2("div", { class: "FilterCalendarWrapper" }, h$2("vaadin-date-picker", { value: this.filterData.filterFromCalendar, onChange: (event) => this.handleFilterFrom(event), placeholder: translate$2('filterFromCalendar', this.language), class: "VaadinDatePicker" }), h$2("vaadin-date-picker", { value: this.filterData.filterToCalendar, onChange: (event) => this.handleFilterTo(event), placeholder: translate$2('filterToCalendar', this.language), class: "VaadinDatePicker" }))), h$2("div", { class: "FilterModalFooter" }, h$2("button", { class: "FilterModalButton", onClick: () => this.filterSearch() }, translate$2('filterModalButton', this.language))))));
|
|
22320
22378
|
}
|
|
22321
22379
|
};
|
|
22322
22380
|
HelperFilters.style = helperFiltersCss;
|
|
@@ -22329,8 +22387,8 @@ const TRANSLATIONS = {
|
|
|
22329
22387
|
drawId: 'Draw ID',
|
|
22330
22388
|
drawName: 'Game name',
|
|
22331
22389
|
drawDate: 'Draw Date',
|
|
22332
|
-
drawNumbersGridDraw: 'Draw numbers Grid
|
|
22333
|
-
drawNumbersGridTicket: 'Draw numbers Grid
|
|
22390
|
+
drawNumbersGridDraw: 'Draw numbers Grid ',
|
|
22391
|
+
drawNumbersGridTicket: 'Draw numbers Grid ',
|
|
22334
22392
|
ticketResult: 'Ticket result',
|
|
22335
22393
|
amountWon: 'Amount won',
|
|
22336
22394
|
numberOfDraws: 'Number of draws',
|
|
@@ -22346,8 +22404,8 @@ const TRANSLATIONS = {
|
|
|
22346
22404
|
drawId: 'Id extragere',
|
|
22347
22405
|
drawName: 'Numele jocului',
|
|
22348
22406
|
drawDate: 'Data extragerii',
|
|
22349
|
-
drawNumbersGridDraw: 'Numerele extrase Grid
|
|
22350
|
-
drawNumbersGridTicket: 'Numerele extrase Grid
|
|
22407
|
+
drawNumbersGridDraw: 'Numerele extrase Grid',
|
|
22408
|
+
drawNumbersGridTicket: 'Numerele extrase Grid',
|
|
22351
22409
|
ticketResult: 'Rezultatul biletului',
|
|
22352
22410
|
amountWon: 'Suma castigata',
|
|
22353
22411
|
numberOfDraws: 'Numarul de extrageri',
|
|
@@ -22358,13 +22416,47 @@ const TRANSLATIONS = {
|
|
|
22358
22416
|
ticketAmount: 'Valoarea biletului',
|
|
22359
22417
|
winUpTo: 'Poti castiga'
|
|
22360
22418
|
},
|
|
22419
|
+
fr: {
|
|
22420
|
+
drawResultsHeader: 'Résultats du dernier tirage',
|
|
22421
|
+
drawId: 'ID de tirage',
|
|
22422
|
+
drawName: 'Nom du jeu',
|
|
22423
|
+
drawDate: 'Date du tirage',
|
|
22424
|
+
drawNumbersGridDraw: 'Tirage des numéros Grille',
|
|
22425
|
+
drawNumbersGridTicket: 'Tirage des numéros Grille',
|
|
22426
|
+
ticketResult: 'Résultat du ticket',
|
|
22427
|
+
amountWon: 'Montant gagné',
|
|
22428
|
+
numberOfDraws: 'Nombre de tirages',
|
|
22429
|
+
multiplier: 'Multiplicateur',
|
|
22430
|
+
ticketPurchaseDate: 'Date d\'achat du billet',
|
|
22431
|
+
ticketStatus: 'Statut du ticket',
|
|
22432
|
+
ticketId: 'ID de billets',
|
|
22433
|
+
ticketAmount: 'Montant du billet',
|
|
22434
|
+
winUpTo: 'Gagnez jusqu\'à'
|
|
22435
|
+
},
|
|
22436
|
+
ar: {
|
|
22437
|
+
drawResultsHeader: 'نتائج آخر سحب',
|
|
22438
|
+
drawId: 'معرّف السحب',
|
|
22439
|
+
drawName: 'اسم اللعبة',
|
|
22440
|
+
drawDate: 'تاريخ السحب',
|
|
22441
|
+
drawNumbersGridDraw: 'شبكة أرقام السحب',
|
|
22442
|
+
drawNumbersGridTicket: 'شبكة أرقام السحب',
|
|
22443
|
+
ticketResult: 'نتيجة التذكرة',
|
|
22444
|
+
amountWon: 'المبلغ الذي تم ربحه',
|
|
22445
|
+
numberOfDraws: 'عدد السحوبات',
|
|
22446
|
+
multiplier: 'مضاعف',
|
|
22447
|
+
ticketPurchaseDate: 'تاريخ شراء التذكرة',
|
|
22448
|
+
ticketStatus: 'حالة التذكرة',
|
|
22449
|
+
ticketId: 'معرّف التذكرة',
|
|
22450
|
+
ticketAmount: 'مبلغ التذكرة',
|
|
22451
|
+
winUpTo: 'ربح يصل إلى'
|
|
22452
|
+
}
|
|
22361
22453
|
};
|
|
22362
22454
|
const translate = (key, customLang) => {
|
|
22363
22455
|
const lang = customLang;
|
|
22364
22456
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
22365
22457
|
};
|
|
22366
22458
|
|
|
22367
|
-
const lotteryDrawResultsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsArea{margin-top:15px}.DrawResultsSection{max-width:600px;margin:0px auto;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:#009993;color:#fff;font-size:14px;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0;padding-top:15px}.
|
|
22459
|
+
const lotteryDrawResultsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsArea{margin-top:15px}.DrawResultsArea.TicketDraws .Content{padding:0;border:0}.DrawResultsArea.TicketDraws .DrawResultsBody{padding:0;margin-bottom:5px;border-radius:0;border:0}.DrawResultsSection{max-width:600px;margin:0px auto;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:#009993;color:#fff;font-size:14px;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0;padding-top:15px}.DrawResultsBody{padding:20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid #009993}.DrawResultsBody>div{margin:10px 0}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.DrawNumbersGrid{margin-bottom:15px}.DrawNumbersGrid label{display:block;margin-bottom:10px}.Toggle{cursor:pointer;display:inline-block}.ToggleSwitch{display:inline-block;background:#ccc;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #eee 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#56c080}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{position:relative}.DrawTicketsContainer{display:flex;flex-direction:column;margin:20px auto 0}.DrawMultipler{margin-top:15px}.ExpandableBoxes{position:relative;display:flex;flex-direction:column}.ExpandableBox{line-height:12px;font-weight:lighter;width:100%;height:100%;max-height:80px;float:left;margin:0 0 20px 0;border:1px solid #009993;background:#fff;border-radius:4px;padding:10px;box-sizing:border-box;-webkit-transition:all 0.6s ease-in-out;-moz-transition:all 0.6s ease-in-out;-o-transition:all 0.6s ease-in-out;-ms-transition:all 0.6s ease-in-out;transition:all 0.6s ease-in-out;overflow:hidden;box-shadow:rgba(99, 99, 99, 0.2) 0px 2px 8px 0px}.ExpandableBox:last-of-type{margin-bottom:0}.ExpandableBox.ShowBox{max-height:400px;margin:0px 0px 20p 0px}.ExpandableBox.HideBox{width:0;height:0;overflow:hidden;border:none;padding:0;margin:0;opacity:0}";
|
|
22368
22460
|
|
|
22369
22461
|
const LotteryDrawResults = class {
|
|
22370
22462
|
constructor(hostRef) {
|
|
@@ -22409,13 +22501,75 @@ const LotteryDrawResults = class {
|
|
|
22409
22501
|
* The ticket draw count
|
|
22410
22502
|
*/
|
|
22411
22503
|
this.ticketDrawCount = 0;
|
|
22504
|
+
/**
|
|
22505
|
+
* The ticket winning numbers
|
|
22506
|
+
*/
|
|
22507
|
+
this.ticketNumbers = '';
|
|
22508
|
+
/**
|
|
22509
|
+
* The session id
|
|
22510
|
+
*/
|
|
22511
|
+
this.sessionId = '';
|
|
22512
|
+
/**
|
|
22513
|
+
* Client custom styling via string
|
|
22514
|
+
*/
|
|
22515
|
+
this.clientStyling = '';
|
|
22516
|
+
/**
|
|
22517
|
+
* Client custom styling via url content
|
|
22518
|
+
*/
|
|
22519
|
+
this.clientStylingUrlContent = '';
|
|
22412
22520
|
this.multiplier = 3;
|
|
22413
22521
|
this.isLoading = true;
|
|
22414
|
-
this.drawResults = [];
|
|
22415
22522
|
this.rules = {};
|
|
22416
22523
|
this.toggleDrawer = [false];
|
|
22417
22524
|
this.hasErrors = false;
|
|
22418
22525
|
this.errorText = '';
|
|
22526
|
+
this.ticketData = [];
|
|
22527
|
+
this.ticketDataLoaded = false;
|
|
22528
|
+
this.ticketDraws = [];
|
|
22529
|
+
this.hasDrawNumbers = false;
|
|
22530
|
+
this.limitStylingAppends = false;
|
|
22531
|
+
this.getTicketsData = () => {
|
|
22532
|
+
let url = new URL(`${this.endpoint}/tickets`);
|
|
22533
|
+
let drawOptions = {
|
|
22534
|
+
method: "GET",
|
|
22535
|
+
headers: {
|
|
22536
|
+
'Content-Type': "application/json",
|
|
22537
|
+
'Accept': 'application/json',
|
|
22538
|
+
'Authorization': `Bearer ${this.sessionId}`
|
|
22539
|
+
},
|
|
22540
|
+
};
|
|
22541
|
+
fetch(url.href, drawOptions)
|
|
22542
|
+
.then((response) => {
|
|
22543
|
+
return response.json();
|
|
22544
|
+
})
|
|
22545
|
+
.then((data) => {
|
|
22546
|
+
if (data) {
|
|
22547
|
+
this.ticketData = data;
|
|
22548
|
+
this.ticketDataLoaded = true;
|
|
22549
|
+
}
|
|
22550
|
+
return this.ticketData;
|
|
22551
|
+
}).then((response) => {
|
|
22552
|
+
response.forEach(ticket => {
|
|
22553
|
+
if (ticket.drawResults.length) {
|
|
22554
|
+
ticket.drawResults.forEach(draw => {
|
|
22555
|
+
fetch(`${this.endpoint}/games/${this.gameId}/draws/${draw.drawId}`)
|
|
22556
|
+
.then((response) => {
|
|
22557
|
+
return response.json();
|
|
22558
|
+
})
|
|
22559
|
+
.then((data) => {
|
|
22560
|
+
// check if draw id is unique
|
|
22561
|
+
if (!this.ticketDraws.some(el => el.drawId === draw.drawId)) {
|
|
22562
|
+
this.ticketDraws.push({ drawId: draw.drawId, drawNumbers: data.winningNumbers });
|
|
22563
|
+
}
|
|
22564
|
+
});
|
|
22565
|
+
});
|
|
22566
|
+
}
|
|
22567
|
+
return this.ticketDraws;
|
|
22568
|
+
});
|
|
22569
|
+
}).then(() => {
|
|
22570
|
+
this.hasDrawNumbers = true;
|
|
22571
|
+
});
|
|
22572
|
+
};
|
|
22419
22573
|
this.changeBox = (index) => {
|
|
22420
22574
|
this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
|
|
22421
22575
|
if (itemIndex == index) {
|
|
@@ -22427,6 +22581,18 @@ const LotteryDrawResults = class {
|
|
|
22427
22581
|
this.toggleDrawer.push(true);
|
|
22428
22582
|
}
|
|
22429
22583
|
};
|
|
22584
|
+
this.setClientStyling = () => {
|
|
22585
|
+
let sheet = document.createElement('style');
|
|
22586
|
+
sheet.innerHTML = this.clientStyling;
|
|
22587
|
+
this.stylingContainer.prepend(sheet);
|
|
22588
|
+
};
|
|
22589
|
+
this.setClientStylingURL = () => {
|
|
22590
|
+
let cssFile = document.createElement('style');
|
|
22591
|
+
setTimeout(() => {
|
|
22592
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
22593
|
+
this.stylingContainer.prepend(cssFile);
|
|
22594
|
+
}, 1);
|
|
22595
|
+
};
|
|
22430
22596
|
}
|
|
22431
22597
|
connectedCallback() {
|
|
22432
22598
|
let promises = [];
|
|
@@ -22434,14 +22600,28 @@ const LotteryDrawResults = class {
|
|
|
22434
22600
|
if (this.drawId) {
|
|
22435
22601
|
promises.push(this.getDrawData());
|
|
22436
22602
|
}
|
|
22603
|
+
if (!this.drawMode) {
|
|
22604
|
+
this.getTicketsData();
|
|
22605
|
+
}
|
|
22437
22606
|
Promise.all(promises)
|
|
22438
22607
|
.then(() => {
|
|
22439
22608
|
this.isLoading = false;
|
|
22440
22609
|
});
|
|
22441
22610
|
}
|
|
22442
|
-
|
|
22611
|
+
componentDidRender() {
|
|
22612
|
+
// start custom styling area
|
|
22613
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
22614
|
+
if (this.clientStyling)
|
|
22615
|
+
this.setClientStyling();
|
|
22616
|
+
if (this.clientStylingUrlContent)
|
|
22617
|
+
this.setClientStylingURL();
|
|
22618
|
+
this.limitStylingAppends = true;
|
|
22619
|
+
}
|
|
22620
|
+
// end custom styling area
|
|
22621
|
+
}
|
|
22622
|
+
getDrawData(drawID) {
|
|
22443
22623
|
return new Promise((resolve, reject) => {
|
|
22444
|
-
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${this.drawId}`);
|
|
22624
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawID ? drawID : this.drawId}`);
|
|
22445
22625
|
fetch(url.href)
|
|
22446
22626
|
.then((response) => {
|
|
22447
22627
|
// @TODO EXCEPTIONS
|
|
@@ -22451,6 +22631,9 @@ const LotteryDrawResults = class {
|
|
|
22451
22631
|
this.drawData = data;
|
|
22452
22632
|
resolve(true);
|
|
22453
22633
|
this.isLoading = false;
|
|
22634
|
+
if (drawID) {
|
|
22635
|
+
return this.drawData.winningNumbers;
|
|
22636
|
+
}
|
|
22454
22637
|
})
|
|
22455
22638
|
.catch((err) => {
|
|
22456
22639
|
reject(err);
|
|
@@ -22490,12 +22673,16 @@ const LotteryDrawResults = class {
|
|
|
22490
22673
|
h$2("p", null, this.errorText);
|
|
22491
22674
|
}
|
|
22492
22675
|
else {
|
|
22493
|
-
return (h$2("section", { class: "DrawResultsSection" },
|
|
22494
|
-
h$2("div", { class: "DrawResultsArea" },
|
|
22495
|
-
h$2("div", { class: "
|
|
22676
|
+
return (h$2("section", { class: "DrawResultsSection", ref: el => this.stylingContainer = el }, this.drawMode ?
|
|
22677
|
+
h$2("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
22678
|
+
h$2("div", null, h$2("div", { class: "DrawResultsHeader" }, h$2("span", null, translate('drawId', this.language), ": ", this.drawData.id), h$2("span", null, translate('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), h$2("div", { class: "DrawResultsBody" }, h$2("div", { class: "DrawNumbersGrid" }, h$2("p", null, translate('drawNumbersGridDraw', this.language), "0:"), h$2("div", { class: "BulletContainer" }, h$2("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, "selected-numbers": this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language, "grid-type": 'ticket', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h$2("div", { class: "DrawMultipler" }, h$2("label", { class: "Label" }, translate('multiplier', this.language), " ", this.multiplier))))))
|
|
22496
22679
|
:
|
|
22497
|
-
h$2("div", { class: "DrawResultsArea" }, this.
|
|
22498
|
-
h$2("div", null,
|
|
22680
|
+
h$2("div", { class: "DrawResultsArea TicketDraws" }, h$2("div", { class: "DrawResultsBody" }, h$2("div", { class: "TicketIdContainer" }, h$2("label", { class: "Label" }, translate('ticketId', this.language), ": ", h$2("span", null, this.ticketId))), h$2("div", { class: "TicketAmountContainer" }, h$2("label", { class: "Label" }, translate('ticketAmount', this.language), " ", h$2("span", null, this.ticketAmount))), h$2("div", { class: "DrawNumbersGrid" }, h$2("label", { class: "Label" }, translate('drawNumbersGridTicket', this.language), "0:"), h$2("div", { class: "BulletContainer" }, h$2("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, "selected-numbers": JSON.parse(this.ticketNumbers).join(','), selectable: false, "display-selected": true, language: this.language, "grid-type": 'ticket', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))), h$2("div", { class: "DrawMultipler" }, h$2("label", { class: "Label" }, translate('multiplier', this.language), " ", JSON.stringify(this.ticketMultiplier))), h$2("div", { class: "NumberOfDrawsContainer" }, h$2("label", { class: "Label" }, translate('numberOfDraws', this.language), ": ", this.ticketDrawCount), h$2("div", { class: "DrawTicketsContainer" }, this.ticketData.map((ticket) => h$2("div", { class: "ExpandableBoxes" }, ticket.drawResults.length ?
|
|
22681
|
+
h$2("div", null, ticket.id == this.ticketId && ticket.drawResults.map((item, index) => h$2("div", { class: this.toggleDrawer[index] ? 'ExpandableBox ShowBox' : 'ExpandableBox', onClick: () => this.changeBox(index) }, h$2("div", { class: "TicketResultContainer" }, h$2("p", null, translate('ticketResult', this.language), ": ", item.state)), item.state == 'won' &&
|
|
22682
|
+
h$2("div", { class: "AmountWonContainer" }, h$2("p", null, translate('amountWon', this.language), ": ", Number(item.amount).toLocaleString('en'), " ", item.currency)), h$2("div", { class: "DrawIdContainer" }, h$2("p", null, translate('drawId', this.language), ": ", item.drawId)), h$2("div", { class: "DrawDateContainer" }, h$2("p", null, translate('drawDate', this.language), ": ", item.updatedAt.slice(0, 10), " | ", item.updatedAt.slice(11, 19))), h$2("div", { class: "DrawNumbersGrid" }, this.hasDrawNumbers && this.ticketDraws.map((ticketDraw) => item.drawId && item.drawId === ticketDraw.drawId &&
|
|
22683
|
+
h$2("div", null, h$2("label", { class: "Label" }, translate('drawNumbersGridDraw', this.language), "A:"), h$2("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, "selected-numbers": ticketDraw.drawNumbers.join(','), selectable: false, "display-selected": true, language: this.language, "grid-type": 'ticket', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))), h$2("div", { class: "DrawMultipler" }, h$2("label", { class: "Label" }, translate('multiplier', this.language), " ", item.multiplier)))))
|
|
22684
|
+
:
|
|
22685
|
+
h$2("span", null)))))))));
|
|
22499
22686
|
}
|
|
22500
22687
|
}
|
|
22501
22688
|
};
|
|
@@ -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
|
/**
|
|
4
4
|
* @name isMobile
|
|
@@ -23,16 +23,48 @@ const HelperModal = class {
|
|
|
23
23
|
* Toggles if the helper is visible or not
|
|
24
24
|
*/
|
|
25
25
|
this.visible = true;
|
|
26
|
+
/**
|
|
27
|
+
* Client custom styling via string
|
|
28
|
+
*/
|
|
29
|
+
this.clientStyling = '';
|
|
30
|
+
/**
|
|
31
|
+
* Client custom styling via url content
|
|
32
|
+
*/
|
|
33
|
+
this.clientStylingUrlContent = '';
|
|
34
|
+
this.limitStylingAppends = false;
|
|
26
35
|
this.userAgent = window.navigator.userAgent;
|
|
36
|
+
this.setClientStyling = () => {
|
|
37
|
+
let sheet = document.createElement('style');
|
|
38
|
+
sheet.innerHTML = this.clientStyling;
|
|
39
|
+
this.stylingContainer.prepend(sheet);
|
|
40
|
+
};
|
|
41
|
+
this.setClientStylingURL = () => {
|
|
42
|
+
let cssFile = document.createElement('style');
|
|
43
|
+
setTimeout(() => {
|
|
44
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
45
|
+
this.stylingContainer.prepend(cssFile);
|
|
46
|
+
}, 1);
|
|
47
|
+
};
|
|
27
48
|
}
|
|
28
49
|
handleHelperModalClose() {
|
|
29
50
|
this.visible = false;
|
|
30
51
|
this.cancel.emit();
|
|
31
52
|
}
|
|
32
53
|
;
|
|
54
|
+
componentDidRender() {
|
|
55
|
+
// start custom styling area
|
|
56
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
57
|
+
if (this.clientStyling)
|
|
58
|
+
this.setClientStyling();
|
|
59
|
+
if (this.clientStylingUrlContent)
|
|
60
|
+
this.setClientStylingURL();
|
|
61
|
+
this.limitStylingAppends = true;
|
|
62
|
+
}
|
|
63
|
+
// end custom styling area
|
|
64
|
+
}
|
|
33
65
|
render() {
|
|
34
66
|
return ((this.visible &&
|
|
35
|
-
h("div", { class: this.visible ? "HelperModalWrapper HelperModalVisible" : "HelperModalWrapper" }, h("div", { class: "HelperModalWrapper HelperModalVisible" }, h("div", { class: "HelperModalContent" + (isMobile(this.userAgent) ? ' HelperModalMobileContent' : '') }, h("span", { class: "HelperModalClose" + (isMobile(this.userAgent) ? ' HelperModalMobileClose' : ''), onClick: this.handleHelperModalClose.bind(this) }, "X"), h("slot", null))))));
|
|
67
|
+
h("div", { class: this.visible ? "HelperModalWrapper HelperModalVisible" : "HelperModalWrapper", ref: el => this.stylingContainer = el }, h("div", { class: "HelperModalWrapper HelperModalVisible" }, h("div", { class: "HelperModalContent" + (isMobile(this.userAgent) ? ' HelperModalMobileContent' : '') }, h("span", { class: "HelperModalClose" + (isMobile(this.userAgent) ? ' HelperModalMobileClose' : ''), onClick: this.handleHelperModalClose.bind(this) }, "X"), h("slot", null))))));
|
|
36
68
|
}
|
|
37
69
|
};
|
|
38
70
|
HelperModal.style = helperModalCss;
|
|
@@ -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
|
/**
|
|
4
4
|
* @name isMobile
|
|
@@ -28,6 +28,18 @@ const TRANSLATIONS = {
|
|
|
28
28
|
nextPage: 'Urmatoarea',
|
|
29
29
|
lastPage: 'Ultima'
|
|
30
30
|
},
|
|
31
|
+
fr: {
|
|
32
|
+
firstPage: 'First',
|
|
33
|
+
previousPage: 'Previous',
|
|
34
|
+
nextPage: 'Next',
|
|
35
|
+
lastPage: 'Last'
|
|
36
|
+
},
|
|
37
|
+
ar: {
|
|
38
|
+
firstPage: 'First',
|
|
39
|
+
previousPage: 'Previous',
|
|
40
|
+
nextPage: 'Next',
|
|
41
|
+
lastPage: 'Last'
|
|
42
|
+
}
|
|
31
43
|
};
|
|
32
44
|
const translate = (key, customLang) => {
|
|
33
45
|
const lang = customLang;
|
|
@@ -64,6 +76,14 @@ const HelperPagination = class {
|
|
|
64
76
|
* Language
|
|
65
77
|
*/
|
|
66
78
|
this.language = 'en';
|
|
79
|
+
/**
|
|
80
|
+
* Client custom styling via string
|
|
81
|
+
*/
|
|
82
|
+
this.clientStyling = '';
|
|
83
|
+
/**
|
|
84
|
+
* Client custom styling via url content
|
|
85
|
+
*/
|
|
86
|
+
this.clientStylingUrlContent = '';
|
|
67
87
|
/**
|
|
68
88
|
* In component working variable for the array of pages
|
|
69
89
|
*/
|
|
@@ -74,6 +94,7 @@ const HelperPagination = class {
|
|
|
74
94
|
this.endInt = 0;
|
|
75
95
|
this.userAgent = window.navigator.userAgent;
|
|
76
96
|
this.currentPage = 1;
|
|
97
|
+
this.limitStylingAppends = false;
|
|
77
98
|
/**
|
|
78
99
|
* Navigation logic
|
|
79
100
|
*/
|
|
@@ -128,6 +149,18 @@ const HelperPagination = class {
|
|
|
128
149
|
this.currentPage = this.offsetInt;
|
|
129
150
|
this.hpPageChange.emit({ offset: this.offsetInt, limit: this.limitInt, total: this.totalInt });
|
|
130
151
|
};
|
|
152
|
+
this.setClientStyling = () => {
|
|
153
|
+
let sheet = document.createElement('style');
|
|
154
|
+
sheet.innerHTML = this.clientStyling;
|
|
155
|
+
this.stylingContainer.prepend(sheet);
|
|
156
|
+
};
|
|
157
|
+
this.setClientStylingURL = () => {
|
|
158
|
+
let cssFile = document.createElement('style');
|
|
159
|
+
setTimeout(() => {
|
|
160
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
161
|
+
this.stylingContainer.prepend(cssFile);
|
|
162
|
+
}, 1);
|
|
163
|
+
};
|
|
131
164
|
}
|
|
132
165
|
componentWillRender() {
|
|
133
166
|
this.offsetInt = this.offset;
|
|
@@ -153,6 +186,17 @@ const HelperPagination = class {
|
|
|
153
186
|
this.pagesArray.unshift('...');
|
|
154
187
|
}
|
|
155
188
|
}
|
|
189
|
+
componentDidRender() {
|
|
190
|
+
// start custom styling area
|
|
191
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
192
|
+
if (this.clientStyling)
|
|
193
|
+
this.setClientStyling();
|
|
194
|
+
if (this.clientStylingUrlContent)
|
|
195
|
+
this.setClientStylingURL();
|
|
196
|
+
this.limitStylingAppends = true;
|
|
197
|
+
}
|
|
198
|
+
// end custom styling area
|
|
199
|
+
}
|
|
156
200
|
render() {
|
|
157
201
|
/**
|
|
158
202
|
* Center navigation area
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-0f8edfd2.js';
|
|
2
2
|
|
|
3
3
|
const helperTabCss = ":host{display:block}.TabContent{font-size:14px;color:#000;font-weight:normal}";
|
|
4
4
|
|
|
@@ -9,20 +9,52 @@ const HelperTab = class {
|
|
|
9
9
|
* Selected index
|
|
10
10
|
*/
|
|
11
11
|
this.selectedIndex = 0;
|
|
12
|
+
/**
|
|
13
|
+
* Client custom styling via string
|
|
14
|
+
*/
|
|
15
|
+
this.clientStyling = '';
|
|
16
|
+
/**
|
|
17
|
+
* Client custom styling via url content
|
|
18
|
+
*/
|
|
19
|
+
this.clientStylingUrlContent = '';
|
|
12
20
|
this.tabContent = '';
|
|
21
|
+
this.limitStylingAppends = false;
|
|
22
|
+
this.setClientStyling = () => {
|
|
23
|
+
let sheet = document.createElement('style');
|
|
24
|
+
sheet.innerHTML = this.clientStyling;
|
|
25
|
+
this.stylingContainer.prepend(sheet);
|
|
26
|
+
};
|
|
27
|
+
this.setClientStylingURL = () => {
|
|
28
|
+
let cssFile = document.createElement('style');
|
|
29
|
+
setTimeout(() => {
|
|
30
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
31
|
+
this.stylingContainer.prepend(cssFile);
|
|
32
|
+
}, 1);
|
|
33
|
+
};
|
|
13
34
|
}
|
|
14
35
|
connectedCallback() {
|
|
15
36
|
/**
|
|
16
37
|
* fetch(cmsEndpoint + / + / + selectedIndex)
|
|
17
38
|
*/
|
|
18
39
|
}
|
|
40
|
+
componentDidRender() {
|
|
41
|
+
// start custom styling area
|
|
42
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
43
|
+
if (this.clientStyling)
|
|
44
|
+
this.setClientStyling();
|
|
45
|
+
if (this.clientStylingUrlContent)
|
|
46
|
+
this.setClientStylingURL();
|
|
47
|
+
this.limitStylingAppends = true;
|
|
48
|
+
}
|
|
49
|
+
// end custom styling area
|
|
50
|
+
}
|
|
19
51
|
render() {
|
|
20
|
-
this.tabContent = h("div", { class: "TabContent" }, "Each play includes one set of numbers from 1 to 21 with a selectable number of 8 and a second, 4-digit set of numbers, with a minimum selection of 1. Draws are held every 5 minutes and the winnings are automatically credited to your account.");
|
|
52
|
+
this.tabContent = h("div", { class: "TabContent", ref: el => this.stylingContainer = el }, "Each play includes one set of numbers from 1 to 21 with a selectable number of 8 and a second, 4-digit set of numbers, with a minimum selection of 1. Draws are held every 5 minutes and the winnings are automatically credited to your account.");
|
|
21
53
|
if (this.selectedIndex + 1 == 2) {
|
|
22
|
-
this.tabContent = h("div", { class: "TabContent" }, h("ol", null, h("li", null, "Register or Login"), h("li", null, "Buy tickets. Select 'Buy Tickets' to pick your numbers. Want us to automatically generate random numbers for you? Choose \u201CI feel lucky\u201D."), h("li", null, "Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!")));
|
|
54
|
+
this.tabContent = h("div", { class: "TabContent", ref: el => this.stylingContainer = el }, h("ol", null, h("li", null, "Register or Login"), h("li", null, "Buy tickets. Select 'Buy Tickets' to pick your numbers. Want us to automatically generate random numbers for you? Choose \u201CI feel lucky\u201D."), h("li", null, "Review and Complete your purchase. Once you've chosen your total number of plays, and confirmed your number of selections, review your ticket details and complete your purchase!")));
|
|
23
55
|
}
|
|
24
56
|
else if (this.selectedIndex + 1 == 3) {
|
|
25
|
-
this.tabContent = h("div", { class: "TabContent" }, h("ul", null, h("li", null, "What are my odds of winning?"), h("li", null, "How can I find out if I\u2019ve won a draw game?"), h("li", null, "How do I claim my prize?")));
|
|
57
|
+
this.tabContent = h("div", { class: "TabContent", ref: el => this.stylingContainer = el }, h("ul", null, h("li", null, "What are my odds of winning?"), h("li", null, "How can I find out if I\u2019ve won a draw game?"), h("li", null, "How do I claim my prize?")));
|
|
26
58
|
}
|
|
27
59
|
return (this.tabContent);
|
|
28
60
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index-0f8edfd2.js';
|
|
2
2
|
|
|
3
3
|
const helperTabsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Tabs{display:flex;gap:10px;overflow-x:auto}.TabButton{cursor:pointer;width:auto;border-radius:4px;padding:8px 15px;margin:5px 0 10px;border:1px solid #009993;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0;white-space:nowrap}.TabButton:hover{background:#F1F1F1}.TabButton.Active{background:#009993;color:#FFF}";
|
|
4
4
|
|
|
@@ -21,11 +21,47 @@ const HelperTabs = class {
|
|
|
21
21
|
* Tabs details
|
|
22
22
|
*/
|
|
23
23
|
this.tabs = [{ label: 'How to Play' }, { label: 'About' }, { label: 'FAQs' }];
|
|
24
|
+
/**
|
|
25
|
+
* Client custom styling via string
|
|
26
|
+
*/
|
|
27
|
+
this.clientStyling = '';
|
|
28
|
+
/**
|
|
29
|
+
* Client custom styling via url
|
|
30
|
+
*/
|
|
31
|
+
this.clientStylingurl = '';
|
|
32
|
+
/**
|
|
33
|
+
* Client custom styling via url content
|
|
34
|
+
*/
|
|
35
|
+
this.clientStylingUrlContent = '';
|
|
36
|
+
this.limitStylingAppends = false;
|
|
37
|
+
this.setClientStyling = () => {
|
|
38
|
+
let sheet = document.createElement('style');
|
|
39
|
+
sheet.innerHTML = this.clientStyling;
|
|
40
|
+
this.stylingContainer.prepend(sheet);
|
|
41
|
+
};
|
|
42
|
+
this.setClientStylingURL = () => {
|
|
43
|
+
let cssFile = document.createElement('style');
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
46
|
+
this.stylingContainer.prepend(cssFile);
|
|
47
|
+
}, 1);
|
|
48
|
+
};
|
|
24
49
|
}
|
|
25
50
|
connectedCallback() {
|
|
26
51
|
}
|
|
52
|
+
componentDidRender() {
|
|
53
|
+
// start custom styling area
|
|
54
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
55
|
+
this.setClientStyling();
|
|
56
|
+
if (this.clientStylingUrlContent) {
|
|
57
|
+
this.setClientStylingURL();
|
|
58
|
+
}
|
|
59
|
+
this.limitStylingAppends = true;
|
|
60
|
+
}
|
|
61
|
+
// end custom styling area
|
|
62
|
+
}
|
|
27
63
|
render() {
|
|
28
|
-
return (h("div",
|
|
64
|
+
return (h("div", { ref: el => this.stylingContainer = el }, h("div", { class: "Tabs" }, this.tabs.map((tab, index) => h("button", { class: 'TabButton' + (this.selectedIndex == index ? ' Active' : ''), onClick: () => this.selectedIndex = index }, tab.label))), h("div", null, h("helper-tab", { selectedIndex: this.selectedIndex, "client-styling": this.clientStyling, "client-stylingurl": this.clientStylingurl, "client-styling-url-content": this.clientStylingUrlContent }))));
|
|
29
65
|
}
|
|
30
66
|
get host() { return getElement(this); }
|
|
31
67
|
};
|