@everymatrix/lottery-draw-results 0.1.7 → 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/{index-62f030ff.js → index-43800d3c.js} +17 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/lottery-bullet_3.cjs.entry.js +214 -17
- package/dist/cjs/lottery-draw-results.cjs.js +2 -2
- package/dist/collection/components/lottery-draw-results/lottery-draw-results.css +36 -13
- package/dist/collection/components/lottery-draw-results/lottery-draw-results.js +261 -100
- package/dist/collection/utils/locale.utils.js +38 -4
- package/dist/components/lottery-bullet2.js +37 -2
- package/dist/components/lottery-draw-results.js +152 -15
- package/dist/components/lottery-grid2.js +43 -3
- package/dist/esm/{index-98326ddd.js → index-9547eb6c.js} +17 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/lottery-bullet_3.entry.js +214 -17
- package/dist/esm/lottery-draw-results.js +2 -2
- package/dist/lottery-draw-results/lottery-draw-results.esm.js +1 -1
- package/dist/lottery-draw-results/p-ca51c2b4.entry.js +1 -0
- package/dist/lottery-draw-results/p-e1cb3144.js +1 -0
- package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/stencil/widgets-stencil/packages/lottery-draw-results/.stencil/packages/lottery-draw-results/stencil.config.d.ts +2 -0
- package/dist/types/components/lottery-draw-results/lottery-draw-results.d.ts +27 -3
- package/dist/types/components.d.ts +32 -0
- package/package.json +4 -1
- package/dist/lottery-draw-results/p-bb429486.js +0 -1
- package/dist/lottery-draw-results/p-d653e278.entry.js +0 -1
- package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/lottery-draw-results/.stencil/packages/lottery-draw-results/stencil.config.d.ts +0 -2
|
@@ -268,6 +268,12 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
268
268
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
269
269
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
270
270
|
}
|
|
271
|
+
else if (memberName === 'ref') {
|
|
272
|
+
// minifier will clean this up
|
|
273
|
+
if (newValue) {
|
|
274
|
+
newValue(elm);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
271
277
|
else if ((!isProp ) &&
|
|
272
278
|
memberName[0] === 'o' &&
|
|
273
279
|
memberName[1] === 'n') {
|
|
@@ -424,6 +430,7 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
424
430
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
425
431
|
if ((vnode = vnodes[startIdx])) {
|
|
426
432
|
elm = vnode.$elm$;
|
|
433
|
+
callNodeRefs(vnode);
|
|
427
434
|
// remove the vnode's element from the dom
|
|
428
435
|
elm.remove();
|
|
429
436
|
}
|
|
@@ -542,6 +549,12 @@ const patch = (oldVNode, newVNode) => {
|
|
|
542
549
|
elm.data = text;
|
|
543
550
|
}
|
|
544
551
|
};
|
|
552
|
+
const callNodeRefs = (vNode) => {
|
|
553
|
+
{
|
|
554
|
+
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
555
|
+
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
556
|
+
}
|
|
557
|
+
};
|
|
545
558
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
546
559
|
const hostElm = hostRef.$hostElement$;
|
|
547
560
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
@@ -683,7 +696,11 @@ const postUpdateComponent = (hostRef) => {
|
|
|
683
696
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
684
697
|
const elm = hostRef.$hostElement$;
|
|
685
698
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
699
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
686
700
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
701
|
+
{
|
|
702
|
+
safeCall(instance, 'componentDidRender');
|
|
703
|
+
}
|
|
687
704
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
688
705
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
689
706
|
{
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -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-43800d3c.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["lottery-bullet_3.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"],"
|
|
17
|
+
return index.bootstrapLazy([["lottery-bullet_3.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,"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]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -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-43800d3c.js');
|
|
6
6
|
|
|
7
7
|
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, white 0%, white 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, white 0%, #f1f1f1 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}";
|
|
8
8
|
|
|
@@ -22,6 +22,15 @@ const LotteryBullet = class {
|
|
|
22
22
|
* Marks if the bullet should be selected
|
|
23
23
|
*/
|
|
24
24
|
this.isSelected = false;
|
|
25
|
+
/**
|
|
26
|
+
* Client custom styling via string
|
|
27
|
+
*/
|
|
28
|
+
this.clientStyling = '';
|
|
29
|
+
/**
|
|
30
|
+
* Client custom styling via url content
|
|
31
|
+
*/
|
|
32
|
+
this.clientStylingUrlContent = '';
|
|
33
|
+
this.limitStylingAppends = false;
|
|
25
34
|
this.select = () => {
|
|
26
35
|
if (this.selectable) {
|
|
27
36
|
this.isSelected = !this.isSelected;
|
|
@@ -31,9 +40,32 @@ const LotteryBullet = class {
|
|
|
31
40
|
});
|
|
32
41
|
}
|
|
33
42
|
};
|
|
43
|
+
this.setClientStyling = () => {
|
|
44
|
+
let sheet = document.createElement('style');
|
|
45
|
+
sheet.innerHTML = this.clientStyling;
|
|
46
|
+
this.stylingContainer.prepend(sheet);
|
|
47
|
+
};
|
|
48
|
+
this.setClientStylingURL = () => {
|
|
49
|
+
let cssFile = document.createElement('style');
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
52
|
+
this.stylingContainer.prepend(cssFile);
|
|
53
|
+
}, 1);
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
componentDidRender() {
|
|
57
|
+
// start custom styling area
|
|
58
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
59
|
+
if (this.clientStyling)
|
|
60
|
+
this.setClientStyling();
|
|
61
|
+
if (this.clientStylingUrlContent)
|
|
62
|
+
this.setClientStylingURL();
|
|
63
|
+
this.limitStylingAppends = true;
|
|
64
|
+
}
|
|
65
|
+
// end custom styling area
|
|
34
66
|
}
|
|
35
67
|
render() {
|
|
36
|
-
return (index.h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select() }, this.value));
|
|
68
|
+
return (index.h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
|
|
37
69
|
}
|
|
38
70
|
};
|
|
39
71
|
LotteryBullet.style = lotteryBulletCss;
|
|
@@ -46,8 +78,8 @@ const TRANSLATIONS = {
|
|
|
46
78
|
drawId: 'Draw ID',
|
|
47
79
|
drawName: 'Game name',
|
|
48
80
|
drawDate: 'Draw Date',
|
|
49
|
-
drawNumbersGridDraw: 'Draw numbers Grid
|
|
50
|
-
drawNumbersGridTicket: 'Draw numbers Grid
|
|
81
|
+
drawNumbersGridDraw: 'Draw numbers Grid ',
|
|
82
|
+
drawNumbersGridTicket: 'Draw numbers Grid ',
|
|
51
83
|
ticketResult: 'Ticket result',
|
|
52
84
|
amountWon: 'Amount won',
|
|
53
85
|
numberOfDraws: 'Number of draws',
|
|
@@ -63,8 +95,8 @@ const TRANSLATIONS = {
|
|
|
63
95
|
drawId: 'Id extragere',
|
|
64
96
|
drawName: 'Numele jocului',
|
|
65
97
|
drawDate: 'Data extragerii',
|
|
66
|
-
drawNumbersGridDraw: 'Numerele extrase Grid
|
|
67
|
-
drawNumbersGridTicket: 'Numerele extrase Grid
|
|
98
|
+
drawNumbersGridDraw: 'Numerele extrase Grid',
|
|
99
|
+
drawNumbersGridTicket: 'Numerele extrase Grid',
|
|
68
100
|
ticketResult: 'Rezultatul biletului',
|
|
69
101
|
amountWon: 'Suma castigata',
|
|
70
102
|
numberOfDraws: 'Numarul de extrageri',
|
|
@@ -75,13 +107,47 @@ const TRANSLATIONS = {
|
|
|
75
107
|
ticketAmount: 'Valoarea biletului',
|
|
76
108
|
winUpTo: 'Poti castiga'
|
|
77
109
|
},
|
|
110
|
+
fr: {
|
|
111
|
+
drawResultsHeader: 'Résultats du dernier tirage',
|
|
112
|
+
drawId: 'ID de tirage',
|
|
113
|
+
drawName: 'Nom du jeu',
|
|
114
|
+
drawDate: 'Date du tirage',
|
|
115
|
+
drawNumbersGridDraw: 'Tirage des numéros Grille',
|
|
116
|
+
drawNumbersGridTicket: 'Tirage des numéros Grille',
|
|
117
|
+
ticketResult: 'Résultat du ticket',
|
|
118
|
+
amountWon: 'Montant gagné',
|
|
119
|
+
numberOfDraws: 'Nombre de tirages',
|
|
120
|
+
multiplier: 'Multiplicateur',
|
|
121
|
+
ticketPurchaseDate: 'Date d\'achat du billet',
|
|
122
|
+
ticketStatus: 'Statut du ticket',
|
|
123
|
+
ticketId: 'ID de billets',
|
|
124
|
+
ticketAmount: 'Montant du billet',
|
|
125
|
+
winUpTo: 'Gagnez jusqu\'à'
|
|
126
|
+
},
|
|
127
|
+
ar: {
|
|
128
|
+
drawResultsHeader: 'نتائج آخر سحب',
|
|
129
|
+
drawId: 'معرّف السحب',
|
|
130
|
+
drawName: 'اسم اللعبة',
|
|
131
|
+
drawDate: 'تاريخ السحب',
|
|
132
|
+
drawNumbersGridDraw: 'شبكة أرقام السحب',
|
|
133
|
+
drawNumbersGridTicket: 'شبكة أرقام السحب',
|
|
134
|
+
ticketResult: 'نتيجة التذكرة',
|
|
135
|
+
amountWon: 'المبلغ الذي تم ربحه',
|
|
136
|
+
numberOfDraws: 'عدد السحوبات',
|
|
137
|
+
multiplier: 'مضاعف',
|
|
138
|
+
ticketPurchaseDate: 'تاريخ شراء التذكرة',
|
|
139
|
+
ticketStatus: 'حالة التذكرة',
|
|
140
|
+
ticketId: 'معرّف التذكرة',
|
|
141
|
+
ticketAmount: 'مبلغ التذكرة',
|
|
142
|
+
winUpTo: 'ربح يصل إلى'
|
|
143
|
+
}
|
|
78
144
|
};
|
|
79
145
|
const translate = (key, customLang) => {
|
|
80
146
|
const lang = customLang;
|
|
81
147
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
82
148
|
};
|
|
83
149
|
|
|
84
|
-
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}.
|
|
150
|
+
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}";
|
|
85
151
|
|
|
86
152
|
const LotteryDrawResults = class {
|
|
87
153
|
constructor(hostRef) {
|
|
@@ -126,13 +192,75 @@ const LotteryDrawResults = class {
|
|
|
126
192
|
* The ticket draw count
|
|
127
193
|
*/
|
|
128
194
|
this.ticketDrawCount = 0;
|
|
195
|
+
/**
|
|
196
|
+
* The ticket winning numbers
|
|
197
|
+
*/
|
|
198
|
+
this.ticketNumbers = '';
|
|
199
|
+
/**
|
|
200
|
+
* The session id
|
|
201
|
+
*/
|
|
202
|
+
this.sessionId = '';
|
|
203
|
+
/**
|
|
204
|
+
* Client custom styling via string
|
|
205
|
+
*/
|
|
206
|
+
this.clientStyling = '';
|
|
207
|
+
/**
|
|
208
|
+
* Client custom styling via url content
|
|
209
|
+
*/
|
|
210
|
+
this.clientStylingUrlContent = '';
|
|
129
211
|
this.multiplier = 3;
|
|
130
212
|
this.isLoading = true;
|
|
131
|
-
this.drawResults = [];
|
|
132
213
|
this.rules = {};
|
|
133
214
|
this.toggleDrawer = [false];
|
|
134
215
|
this.hasErrors = false;
|
|
135
216
|
this.errorText = '';
|
|
217
|
+
this.ticketData = [];
|
|
218
|
+
this.ticketDataLoaded = false;
|
|
219
|
+
this.ticketDraws = [];
|
|
220
|
+
this.hasDrawNumbers = false;
|
|
221
|
+
this.limitStylingAppends = false;
|
|
222
|
+
this.getTicketsData = () => {
|
|
223
|
+
let url = new URL(`${this.endpoint}/tickets`);
|
|
224
|
+
let drawOptions = {
|
|
225
|
+
method: "GET",
|
|
226
|
+
headers: {
|
|
227
|
+
'Content-Type': "application/json",
|
|
228
|
+
'Accept': 'application/json',
|
|
229
|
+
'Authorization': `Bearer ${this.sessionId}`
|
|
230
|
+
},
|
|
231
|
+
};
|
|
232
|
+
fetch(url.href, drawOptions)
|
|
233
|
+
.then((response) => {
|
|
234
|
+
return response.json();
|
|
235
|
+
})
|
|
236
|
+
.then((data) => {
|
|
237
|
+
if (data) {
|
|
238
|
+
this.ticketData = data;
|
|
239
|
+
this.ticketDataLoaded = true;
|
|
240
|
+
}
|
|
241
|
+
return this.ticketData;
|
|
242
|
+
}).then((response) => {
|
|
243
|
+
response.forEach(ticket => {
|
|
244
|
+
if (ticket.drawResults.length) {
|
|
245
|
+
ticket.drawResults.forEach(draw => {
|
|
246
|
+
fetch(`${this.endpoint}/games/${this.gameId}/draws/${draw.drawId}`)
|
|
247
|
+
.then((response) => {
|
|
248
|
+
return response.json();
|
|
249
|
+
})
|
|
250
|
+
.then((data) => {
|
|
251
|
+
// check if draw id is unique
|
|
252
|
+
if (!this.ticketDraws.some(el => el.drawId === draw.drawId)) {
|
|
253
|
+
this.ticketDraws.push({ drawId: draw.drawId, drawNumbers: data.winningNumbers });
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
return this.ticketDraws;
|
|
259
|
+
});
|
|
260
|
+
}).then(() => {
|
|
261
|
+
this.hasDrawNumbers = true;
|
|
262
|
+
});
|
|
263
|
+
};
|
|
136
264
|
this.changeBox = (index) => {
|
|
137
265
|
this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
|
|
138
266
|
if (itemIndex == index) {
|
|
@@ -144,6 +272,18 @@ const LotteryDrawResults = class {
|
|
|
144
272
|
this.toggleDrawer.push(true);
|
|
145
273
|
}
|
|
146
274
|
};
|
|
275
|
+
this.setClientStyling = () => {
|
|
276
|
+
let sheet = document.createElement('style');
|
|
277
|
+
sheet.innerHTML = this.clientStyling;
|
|
278
|
+
this.stylingContainer.prepend(sheet);
|
|
279
|
+
};
|
|
280
|
+
this.setClientStylingURL = () => {
|
|
281
|
+
let cssFile = document.createElement('style');
|
|
282
|
+
setTimeout(() => {
|
|
283
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
284
|
+
this.stylingContainer.prepend(cssFile);
|
|
285
|
+
}, 1);
|
|
286
|
+
};
|
|
147
287
|
}
|
|
148
288
|
connectedCallback() {
|
|
149
289
|
let promises = [];
|
|
@@ -151,14 +291,28 @@ const LotteryDrawResults = class {
|
|
|
151
291
|
if (this.drawId) {
|
|
152
292
|
promises.push(this.getDrawData());
|
|
153
293
|
}
|
|
294
|
+
if (!this.drawMode) {
|
|
295
|
+
this.getTicketsData();
|
|
296
|
+
}
|
|
154
297
|
Promise.all(promises)
|
|
155
298
|
.then(() => {
|
|
156
299
|
this.isLoading = false;
|
|
157
300
|
});
|
|
158
301
|
}
|
|
159
|
-
|
|
302
|
+
componentDidRender() {
|
|
303
|
+
// start custom styling area
|
|
304
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
305
|
+
if (this.clientStyling)
|
|
306
|
+
this.setClientStyling();
|
|
307
|
+
if (this.clientStylingUrlContent)
|
|
308
|
+
this.setClientStylingURL();
|
|
309
|
+
this.limitStylingAppends = true;
|
|
310
|
+
}
|
|
311
|
+
// end custom styling area
|
|
312
|
+
}
|
|
313
|
+
getDrawData(drawID) {
|
|
160
314
|
return new Promise((resolve, reject) => {
|
|
161
|
-
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${this.drawId}`);
|
|
315
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawID ? drawID : this.drawId}`);
|
|
162
316
|
fetch(url.href)
|
|
163
317
|
.then((response) => {
|
|
164
318
|
// @TODO EXCEPTIONS
|
|
@@ -168,6 +322,9 @@ const LotteryDrawResults = class {
|
|
|
168
322
|
this.drawData = data;
|
|
169
323
|
resolve(true);
|
|
170
324
|
this.isLoading = false;
|
|
325
|
+
if (drawID) {
|
|
326
|
+
return this.drawData.winningNumbers;
|
|
327
|
+
}
|
|
171
328
|
})
|
|
172
329
|
.catch((err) => {
|
|
173
330
|
reject(err);
|
|
@@ -207,18 +364,22 @@ const LotteryDrawResults = class {
|
|
|
207
364
|
index.h("p", null, this.errorText);
|
|
208
365
|
}
|
|
209
366
|
else {
|
|
210
|
-
return (index.h("section", { class: "DrawResultsSection" },
|
|
211
|
-
index.h("div", { class: "DrawResultsArea" },
|
|
212
|
-
index.h("div", { class: "
|
|
367
|
+
return (index.h("section", { class: "DrawResultsSection", ref: el => this.stylingContainer = el }, this.drawMode ?
|
|
368
|
+
index.h("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
369
|
+
index.h("div", null, index.h("div", { class: "DrawResultsHeader" }, index.h("span", null, translate('drawId', this.language), ": ", this.drawData.id), index.h("span", null, translate('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), index.h("div", { class: "DrawResultsBody" }, index.h("div", { class: "DrawNumbersGrid" }, index.h("p", null, translate('drawNumbersGridDraw', this.language), "0:"), index.h("div", { class: "BulletContainer" }, index.h("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 })), index.h("div", { class: "DrawMultipler" }, index.h("label", { class: "Label" }, translate('multiplier', this.language), " ", this.multiplier))))))
|
|
213
370
|
:
|
|
214
|
-
index.h("div", { class: "DrawResultsArea" }, this.
|
|
215
|
-
index.h("div", null,
|
|
371
|
+
index.h("div", { class: "DrawResultsArea TicketDraws" }, index.h("div", { class: "DrawResultsBody" }, index.h("div", { class: "TicketIdContainer" }, index.h("label", { class: "Label" }, translate('ticketId', this.language), ": ", index.h("span", null, this.ticketId))), index.h("div", { class: "TicketAmountContainer" }, index.h("label", { class: "Label" }, translate('ticketAmount', this.language), " ", index.h("span", null, this.ticketAmount))), index.h("div", { class: "DrawNumbersGrid" }, index.h("label", { class: "Label" }, translate('drawNumbersGridTicket', this.language), "0:"), index.h("div", { class: "BulletContainer" }, index.h("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 }))), index.h("div", { class: "DrawMultipler" }, index.h("label", { class: "Label" }, translate('multiplier', this.language), " ", JSON.stringify(this.ticketMultiplier))), index.h("div", { class: "NumberOfDrawsContainer" }, index.h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": ", this.ticketDrawCount), index.h("div", { class: "DrawTicketsContainer" }, this.ticketData.map((ticket) => index.h("div", { class: "ExpandableBoxes" }, ticket.drawResults.length ?
|
|
372
|
+
index.h("div", null, ticket.id == this.ticketId && ticket.drawResults.map((item, index$1) => index.h("div", { class: this.toggleDrawer[index$1] ? 'ExpandableBox ShowBox' : 'ExpandableBox', onClick: () => this.changeBox(index$1) }, index.h("div", { class: "TicketResultContainer" }, index.h("p", null, translate('ticketResult', this.language), ": ", item.state)), item.state == 'won' &&
|
|
373
|
+
index.h("div", { class: "AmountWonContainer" }, index.h("p", null, translate('amountWon', this.language), ": ", Number(item.amount).toLocaleString('en'), " ", item.currency)), index.h("div", { class: "DrawIdContainer" }, index.h("p", null, translate('drawId', this.language), ": ", item.drawId)), index.h("div", { class: "DrawDateContainer" }, index.h("p", null, translate('drawDate', this.language), ": ", item.updatedAt.slice(0, 10), " | ", item.updatedAt.slice(11, 19))), index.h("div", { class: "DrawNumbersGrid" }, this.hasDrawNumbers && this.ticketDraws.map((ticketDraw) => item.drawId && item.drawId === ticketDraw.drawId &&
|
|
374
|
+
index.h("div", null, index.h("label", { class: "Label" }, translate('drawNumbersGridDraw', this.language), "A:"), index.h("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 })))), index.h("div", { class: "DrawMultipler" }, index.h("label", { class: "Label" }, translate('multiplier', this.language), " ", item.multiplier)))))
|
|
375
|
+
:
|
|
376
|
+
index.h("span", null)))))))));
|
|
216
377
|
}
|
|
217
378
|
}
|
|
218
379
|
};
|
|
219
380
|
LotteryDrawResults.style = lotteryDrawResultsCss;
|
|
220
381
|
|
|
221
|
-
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:
|
|
382
|
+
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}";
|
|
222
383
|
|
|
223
384
|
const LotteryGrid = class {
|
|
224
385
|
constructor(hostRef) {
|
|
@@ -253,8 +414,33 @@ const LotteryGrid = class {
|
|
|
253
414
|
* Language
|
|
254
415
|
*/
|
|
255
416
|
this.language = 'en';
|
|
417
|
+
/**
|
|
418
|
+
* Personalize grid for ticket
|
|
419
|
+
*/
|
|
420
|
+
this.gridType = '';
|
|
421
|
+
/**
|
|
422
|
+
* Client custom styling via string
|
|
423
|
+
*/
|
|
424
|
+
this.clientStyling = '';
|
|
425
|
+
/**
|
|
426
|
+
* Client custom styling via url content
|
|
427
|
+
*/
|
|
428
|
+
this.clientStylingUrlContent = '';
|
|
256
429
|
this.numbers = [];
|
|
430
|
+
this.limitStylingAppends = false;
|
|
257
431
|
this.selectedCounter = 0;
|
|
432
|
+
this.setClientStyling = () => {
|
|
433
|
+
let sheet = document.createElement('style');
|
|
434
|
+
sheet.innerHTML = this.clientStyling;
|
|
435
|
+
this.stylingContainer.prepend(sheet);
|
|
436
|
+
};
|
|
437
|
+
this.setClientStylingURL = () => {
|
|
438
|
+
let cssFile = document.createElement('style');
|
|
439
|
+
setTimeout(() => {
|
|
440
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
441
|
+
this.stylingContainer.prepend(cssFile);
|
|
442
|
+
}, 1);
|
|
443
|
+
};
|
|
258
444
|
}
|
|
259
445
|
connectedCallback() {
|
|
260
446
|
let selected = [];
|
|
@@ -283,6 +469,17 @@ const LotteryGrid = class {
|
|
|
283
469
|
});
|
|
284
470
|
}
|
|
285
471
|
}
|
|
472
|
+
componentDidRender() {
|
|
473
|
+
// start custom styling area
|
|
474
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
475
|
+
if (this.clientStyling)
|
|
476
|
+
this.setClientStyling();
|
|
477
|
+
if (this.clientStylingUrlContent)
|
|
478
|
+
this.setClientStylingURL();
|
|
479
|
+
this.limitStylingAppends = true;
|
|
480
|
+
}
|
|
481
|
+
// end custom styling area
|
|
482
|
+
}
|
|
286
483
|
lotteryBulletSelectionHandler(event) {
|
|
287
484
|
this.numbers = this.numbers.map((item) => {
|
|
288
485
|
if (item.number == event.detail.value) {
|
|
@@ -373,7 +570,7 @@ const LotteryGrid = class {
|
|
|
373
570
|
}
|
|
374
571
|
}
|
|
375
572
|
render() {
|
|
376
|
-
return (index.h("div", { class: "GridContainer" }, index.h("div", { class:
|
|
573
|
+
return (index.h("div", { class: "GridContainer", ref: el => this.stylingContainer = el }, index.h("div", { class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => index.h("div", null, index.h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))));
|
|
377
574
|
}
|
|
378
575
|
};
|
|
379
576
|
LotteryGrid.style = lotteryGridCss;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-43800d3c.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-bullet_3.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-bullet_3.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,"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]}]]]], options);
|
|
19
19
|
});
|
|
@@ -17,6 +17,16 @@
|
|
|
17
17
|
.DrawResultsArea {
|
|
18
18
|
margin-top: 15px;
|
|
19
19
|
}
|
|
20
|
+
.DrawResultsArea.TicketDraws .Content {
|
|
21
|
+
padding: 0;
|
|
22
|
+
border: 0;
|
|
23
|
+
}
|
|
24
|
+
.DrawResultsArea.TicketDraws .DrawResultsBody {
|
|
25
|
+
padding: 0;
|
|
26
|
+
margin-bottom: 5px;
|
|
27
|
+
border-radius: 0;
|
|
28
|
+
border: 0;
|
|
29
|
+
}
|
|
20
30
|
|
|
21
31
|
.DrawResultsSection {
|
|
22
32
|
max-width: 600px;
|
|
@@ -40,25 +50,28 @@
|
|
|
40
50
|
padding-top: 15px;
|
|
41
51
|
}
|
|
42
52
|
|
|
43
|
-
.DrawMultipler label {
|
|
44
|
-
display: block;
|
|
45
|
-
margin: 15px 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
53
|
.DrawResultsBody {
|
|
49
|
-
padding:
|
|
54
|
+
padding: 20px;
|
|
50
55
|
margin-bottom: 5px;
|
|
51
56
|
border-radius: 0 0 4px 4px;
|
|
52
57
|
border: 1px solid #009993;
|
|
53
58
|
}
|
|
54
|
-
.DrawResultsBody
|
|
55
|
-
|
|
59
|
+
.DrawResultsBody > div {
|
|
60
|
+
margin: 10px 0;
|
|
56
61
|
}
|
|
57
62
|
.DrawResultsBody .NumberOfDrawsContainer {
|
|
58
63
|
display: table;
|
|
59
64
|
width: 100%;
|
|
60
65
|
}
|
|
61
66
|
|
|
67
|
+
.DrawNumbersGrid {
|
|
68
|
+
margin-bottom: 15px;
|
|
69
|
+
}
|
|
70
|
+
.DrawNumbersGrid label {
|
|
71
|
+
display: block;
|
|
72
|
+
margin-bottom: 10px;
|
|
73
|
+
}
|
|
74
|
+
|
|
62
75
|
.Toggle {
|
|
63
76
|
cursor: pointer;
|
|
64
77
|
display: inline-block;
|
|
@@ -109,17 +122,23 @@
|
|
|
109
122
|
}
|
|
110
123
|
|
|
111
124
|
.Label {
|
|
112
|
-
margin-right: 5px;
|
|
113
125
|
position: relative;
|
|
114
|
-
top: 2px;
|
|
115
126
|
}
|
|
116
127
|
|
|
117
128
|
.DrawTicketsContainer {
|
|
118
|
-
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-direction: column;
|
|
131
|
+
margin: 20px auto 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.DrawMultipler {
|
|
135
|
+
margin-top: 15px;
|
|
119
136
|
}
|
|
120
137
|
|
|
121
138
|
.ExpandableBoxes {
|
|
122
139
|
position: relative;
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
123
142
|
}
|
|
124
143
|
|
|
125
144
|
.ExpandableBox {
|
|
@@ -127,13 +146,14 @@
|
|
|
127
146
|
font-weight: lighter;
|
|
128
147
|
width: 100%;
|
|
129
148
|
height: 100%;
|
|
130
|
-
max-height:
|
|
149
|
+
max-height: 80px;
|
|
131
150
|
float: left;
|
|
132
151
|
margin: 0 0 20px 0;
|
|
133
|
-
border: 1px solid #
|
|
152
|
+
border: 1px solid #009993;
|
|
134
153
|
background: #fff;
|
|
135
154
|
border-radius: 4px;
|
|
136
155
|
padding: 10px;
|
|
156
|
+
box-sizing: border-box;
|
|
137
157
|
-webkit-transition: all 0.6s ease-in-out;
|
|
138
158
|
-moz-transition: all 0.6s ease-in-out;
|
|
139
159
|
-o-transition: all 0.6s ease-in-out;
|
|
@@ -142,6 +162,9 @@
|
|
|
142
162
|
overflow: hidden;
|
|
143
163
|
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
|
|
144
164
|
}
|
|
165
|
+
.ExpandableBox:last-of-type {
|
|
166
|
+
margin-bottom: 0;
|
|
167
|
+
}
|
|
145
168
|
|
|
146
169
|
.ExpandableBox.ShowBox {
|
|
147
170
|
max-height: 400px;
|