@everymatrix/lottery-draw-results 0.1.2 → 0.1.4
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/loader.cjs.js +1 -1
- package/dist/cjs/lottery-bullet_3.cjs.entry.js +56 -47
- package/dist/cjs/lottery-draw-results.cjs.js +1 -1
- package/dist/collection/components/lottery-draw-results/lottery-draw-results.css +18 -7
- package/dist/collection/components/lottery-draw-results/lottery-draw-results.js +169 -56
- package/dist/collection/utils/locale.utils.js +14 -2
- package/dist/components/lottery-bullet2.js +1 -1
- package/dist/components/lottery-draw-results.js +60 -46
- package/dist/components/lottery-grid2.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/lottery-bullet_3.entry.js +56 -47
- package/dist/esm/lottery-draw-results.js +1 -1
- package/dist/lottery-draw-results/lottery-draw-results.esm.js +1 -1
- package/dist/lottery-draw-results/p-d653e278.entry.js +1 -0
- package/dist/types/components/lottery-draw-results/lottery-draw-results.d.ts +28 -3
- package/dist/types/components.d.ts +56 -2
- package/package.json +1 -1
- package/dist/lottery-draw-results/p-2b8529f6.entry.js +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -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"],"multiplier":[
|
|
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"],"multiplier":[32],"isLoading":[32],"drawResults":[32],"rules":[32],"toggleDrawer":[32],"hasErrors":[32],"errorText":[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"],"numbers":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[1],"selectable":[4],"isSelected":[4,"is-selected"]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-62f030ff.js');
|
|
6
6
|
|
|
7
|
-
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Circle{cursor:pointer;color:#000000;display:block;
|
|
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
|
|
|
9
9
|
const LotteryBullet = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -50,7 +50,13 @@ const TRANSLATIONS = {
|
|
|
50
50
|
drawNumbersGridTicket: 'Draw numbers Grid B',
|
|
51
51
|
ticketResult: 'Ticket result',
|
|
52
52
|
amountWon: 'Amount won',
|
|
53
|
-
numberOfDraws: 'Number of draws'
|
|
53
|
+
numberOfDraws: 'Number of draws',
|
|
54
|
+
multiplier: 'Multiplier:',
|
|
55
|
+
ticketPurchaseDate: 'Ticket Purchase Date',
|
|
56
|
+
ticketStatus: 'Ticket Status',
|
|
57
|
+
ticketId: 'Ticket ID',
|
|
58
|
+
ticketAmount: 'Ticket Amount',
|
|
59
|
+
winUpTo: 'Win up to',
|
|
54
60
|
},
|
|
55
61
|
ro: {
|
|
56
62
|
drawResultsHeader: 'Ultimele rezultate extragere',
|
|
@@ -61,7 +67,13 @@ const TRANSLATIONS = {
|
|
|
61
67
|
drawNumbersGridTicket: 'Numerele extrase Grid B',
|
|
62
68
|
ticketResult: 'Rezultatul biletului',
|
|
63
69
|
amountWon: 'Suma castigata',
|
|
64
|
-
numberOfDraws: 'Numarul de extrageri'
|
|
70
|
+
numberOfDraws: 'Numarul de extrageri',
|
|
71
|
+
multiplier: 'Multiplicator:',
|
|
72
|
+
ticketPurchaseDate: 'Data achizitionarii biletului',
|
|
73
|
+
ticketStatus: 'Statusul biletului',
|
|
74
|
+
ticketId: 'Id biletul',
|
|
75
|
+
ticketAmount: 'Valoarea biletului',
|
|
76
|
+
winUpTo: 'Poti castiga'
|
|
65
77
|
},
|
|
66
78
|
};
|
|
67
79
|
const translate = (key, customLang) => {
|
|
@@ -69,22 +81,8 @@ const translate = (key, customLang) => {
|
|
|
69
81
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
70
82
|
};
|
|
71
83
|
|
|
72
|
-
const lotteryDrawResultsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsSection{max-width:
|
|
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}.DrawMultipler label{display:block;margin:15px 0}.DrawResultsBody{padding:0px 20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid #009993}.DrawResultsBody .DrawNumbersGrid{font-size:14px}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.Toggle{cursor:pointer;display:inline-block}.ToggleSwitch{display:inline-block;background:#ccc;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #eee 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#56c080}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px}.DrawTicketsContainer{margin:30px auto}.ExpandableBoxes{position:relative}.ExpandableBox{line-height:12px;font-weight:lighter;width:100%;height:100%;max-height:70px;float:left;margin:0 0 20px 0;border:1px solid #f1f1f1;background:#fff;border-radius:4px;padding:10px;-webkit-transition:all 0.6s ease-in-out;-moz-transition:all 0.6s ease-in-out;-o-transition:all 0.6s ease-in-out;-ms-transition:all 0.6s ease-in-out;transition:all 0.6s ease-in-out;overflow:hidden;box-shadow:rgba(99, 99, 99, 0.2) 0px 2px 8px 0px}.ExpandableBox.ShowBox{max-height:400px;margin:0px 0px 20p 0px}.ExpandableBox.HideBox{width:0;height:0;overflow:hidden;border:none;padding:0;margin:0;opacity:0}";
|
|
73
85
|
|
|
74
|
-
const DEFAULT_VALUES = {
|
|
75
|
-
gamename: 'Chrono',
|
|
76
|
-
gamedate: '24/09/2022',
|
|
77
|
-
state: 'Processing',
|
|
78
|
-
amount: 304444,
|
|
79
|
-
ticketid: '6963444',
|
|
80
|
-
selection: '[5, 6, 7, 8, 9]',
|
|
81
|
-
multiplier: 4.5,
|
|
82
|
-
resultstatus: 'Processing',
|
|
83
|
-
drawstatus: 'Won',
|
|
84
|
-
drawamount: 1022,
|
|
85
|
-
drawid: '54545555',
|
|
86
|
-
drawdate: '24/09/2032'
|
|
87
|
-
};
|
|
88
86
|
const LotteryDrawResults = class {
|
|
89
87
|
constructor(hostRef) {
|
|
90
88
|
index.registerInstance(this, hostRef);
|
|
@@ -96,9 +94,39 @@ const LotteryDrawResults = class {
|
|
|
96
94
|
* Shows only the last draw
|
|
97
95
|
*/
|
|
98
96
|
this.drawMode = false;
|
|
97
|
+
/**
|
|
98
|
+
* The drawID (option)
|
|
99
|
+
*/
|
|
100
|
+
this.drawId = '';
|
|
101
|
+
/**
|
|
102
|
+
* The game name
|
|
103
|
+
*/
|
|
99
104
|
this.gameName = '';
|
|
100
|
-
|
|
101
|
-
|
|
105
|
+
/**
|
|
106
|
+
* The ticket submission date
|
|
107
|
+
*/
|
|
108
|
+
this.ticketDate = '';
|
|
109
|
+
/**
|
|
110
|
+
* The ticket status
|
|
111
|
+
*/
|
|
112
|
+
this.ticketStatus = '';
|
|
113
|
+
/**
|
|
114
|
+
* The ticket id
|
|
115
|
+
*/
|
|
116
|
+
this.ticketId = '';
|
|
117
|
+
/**
|
|
118
|
+
* The ticket amount
|
|
119
|
+
*/
|
|
120
|
+
this.ticketAmount = '';
|
|
121
|
+
/**
|
|
122
|
+
* The ticket multiplier
|
|
123
|
+
*/
|
|
124
|
+
this.ticketMultiplier = false;
|
|
125
|
+
/**
|
|
126
|
+
* The ticket draw count
|
|
127
|
+
*/
|
|
128
|
+
this.ticketDrawCount = 0;
|
|
129
|
+
this.multiplier = 3;
|
|
102
130
|
this.isLoading = true;
|
|
103
131
|
this.drawResults = [];
|
|
104
132
|
this.rules = {};
|
|
@@ -120,9 +148,6 @@ const LotteryDrawResults = class {
|
|
|
120
148
|
connectedCallback() {
|
|
121
149
|
let promises = [];
|
|
122
150
|
promises.push(this.getGameData());
|
|
123
|
-
if (this.playerId) {
|
|
124
|
-
promises.push(this.getTicketData());
|
|
125
|
-
}
|
|
126
151
|
if (this.drawId) {
|
|
127
152
|
promises.push(this.getDrawData());
|
|
128
153
|
}
|
|
@@ -142,9 +167,11 @@ const LotteryDrawResults = class {
|
|
|
142
167
|
.then((data) => {
|
|
143
168
|
this.drawData = data;
|
|
144
169
|
resolve(true);
|
|
170
|
+
this.isLoading = false;
|
|
145
171
|
})
|
|
146
172
|
.catch((err) => {
|
|
147
173
|
reject(err);
|
|
174
|
+
this.isLoading = false;
|
|
148
175
|
});
|
|
149
176
|
});
|
|
150
177
|
}
|
|
@@ -161,6 +188,8 @@ const LotteryDrawResults = class {
|
|
|
161
188
|
totalNumbers: data.rules.boards[0].totalNumbers
|
|
162
189
|
};
|
|
163
190
|
resolve(true);
|
|
191
|
+
this.isLoading = false;
|
|
192
|
+
this.hasErrors = false;
|
|
164
193
|
})
|
|
165
194
|
.catch((err) => {
|
|
166
195
|
this.isLoading = false;
|
|
@@ -170,26 +199,7 @@ const LotteryDrawResults = class {
|
|
|
170
199
|
});
|
|
171
200
|
});
|
|
172
201
|
}
|
|
173
|
-
getTicketData() {
|
|
174
|
-
return new Promise((resolve, reject) => {
|
|
175
|
-
let url = new URL(`${this.endpoint}/tickets/player/${this.playerId}`);
|
|
176
|
-
fetch(url.href)
|
|
177
|
-
.then((response) => {
|
|
178
|
-
return response.json();
|
|
179
|
-
})
|
|
180
|
-
.then((data) => {
|
|
181
|
-
this.ticketData = data.length === 0 ? DEFAULT_VALUES : data[1];
|
|
182
|
-
this.drawResults = this.ticketData.drawResults.map((item) => item);
|
|
183
|
-
this.selection = this.ticketData.selection[0].join(',');
|
|
184
|
-
resolve(true);
|
|
185
|
-
})
|
|
186
|
-
.catch((err) => {
|
|
187
|
-
reject(err);
|
|
188
|
-
});
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
202
|
render() {
|
|
192
|
-
var _a, _b, _c, _d, _e, _f;
|
|
193
203
|
if (this.isLoading) {
|
|
194
204
|
return (index.h("p", null, "Loading, please wait ..."));
|
|
195
205
|
}
|
|
@@ -198,18 +208,17 @@ const LotteryDrawResults = class {
|
|
|
198
208
|
}
|
|
199
209
|
else {
|
|
200
210
|
return (index.h("section", { class: "DrawResultsSection" }, !this.drawMode ?
|
|
201
|
-
index.h("div", { class: "DrawResultsArea" }, index.h("div", { class: "TicketInfo" }, index.h("div", { class: "TicketGameName" }, translate('drawName', this.language), ": ", index.h("span", null, this.gameName)), index.h("div", { class: "TicketDate" },
|
|
202
|
-
|
|
203
|
-
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" }), index.h("div", { class: "DrawMultipler" }, index.h("label", { class: "Label" }, "Multiplier: ", item.multiplier)))))))))
|
|
211
|
+
index.h("div", { class: "DrawResultsArea" }, index.h("div", { class: "TicketInfo" }, index.h("div", { class: "TicketGameName" }, translate('drawName', this.language), ": ", index.h("span", null, this.gameName)), index.h("div", { class: "TicketDate" }, translate('ticketPurchaseDate', this.language), ": ", index.h("span", null, this.ticketDate.slice(0, 10))), index.h("div", { class: "TicketStatus" }, translate('ticketStatus', this.language), ": ", index.h("span", null, this.ticketStatus))), index.h("div", { class: "DrawResultsBody" }, index.h("div", { class: "TicketIdContainer" }, index.h("p", null, translate('ticketId', this.language), ": ", index.h("span", null, this.ticketId))), index.h("div", { class: "TicketAmountContainer" }, index.h("p", null, translate('ticketAmount', this.language), " ", index.h("span", null, this.ticketAmount))), index.h("div", { class: "DrawNumbersGrid" }, index.h("p", null, translate('drawNumbersGridTicket', this.language), ":"), index.h("div", { class: "BulletContainer" }, index.h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, "selected-numbers": this.selection, selectable: false, "display-selected": true, language: this.language }))), index.h("div", { class: "DrawMultipler" }, index.h("label", { class: "Label" }, translate('winUpTo', this.language), " ", index.h("span", null, JSON.stringify(this.ticketMultiplier)))), index.h("div", { class: "NumberOfDrawsContainer" }, index.h("p", null, translate('numberOfDraws', this.language), ": ", this.ticketDrawCount), index.h("div", { class: "DrawTicketsContainer" }, this.drawResults.map((item, index$1) => index.h("div", { class: "ExpandableBoxes" }, 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.status)), item.state == 'won' &&
|
|
212
|
+
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" }), index.h("div", { class: "DrawMultipler" }, index.h("label", { class: "Label" }, translate('winUpTo', this.language), " ", item.multiplier)))))))))
|
|
204
213
|
:
|
|
205
214
|
index.h("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
206
|
-
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), ":"), index.h("div", { class: "BulletContainer" }, index.h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, selectedNumbers: this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language })), index.h("div", { class: "DrawMultipler" }, index.h("label", { class: "Label" }, "
|
|
215
|
+
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), ":"), index.h("div", { class: "BulletContainer" }, index.h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, selectedNumbers: this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language })), index.h("div", { class: "DrawMultipler" }, index.h("label", { class: "Label" }, translate('multiplier', this.language), " ", this.multiplier))))))));
|
|
207
216
|
}
|
|
208
217
|
}
|
|
209
218
|
};
|
|
210
219
|
LotteryDrawResults.style = lotteryDrawResultsCss;
|
|
211
220
|
|
|
212
|
-
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:
|
|
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:25px}";
|
|
213
222
|
|
|
214
223
|
const LotteryGrid = class {
|
|
215
224
|
constructor(hostRef) {
|
|
@@ -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"],"multiplier":[
|
|
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"],"multiplier":[32],"isLoading":[32],"drawResults":[32],"rules":[32],"toggleDrawer":[32],"hasErrors":[32],"errorText":[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"],"numbers":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[1],"selectable":[4],"isSelected":[4,"is-selected"]}]]]], options);
|
|
19
19
|
});
|
|
@@ -14,10 +14,13 @@
|
|
|
14
14
|
font-size: 14px;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
.DrawResultsArea {
|
|
18
|
+
margin-top: 15px;
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
.DrawResultsSection {
|
|
18
|
-
max-width:
|
|
19
|
-
margin:
|
|
20
|
-
margin: 0px auto 10px;
|
|
22
|
+
max-width: 600px;
|
|
23
|
+
margin: 0px auto;
|
|
21
24
|
border-radius: 4px;
|
|
22
25
|
}
|
|
23
26
|
|
|
@@ -28,11 +31,13 @@
|
|
|
28
31
|
background-color: #009993;
|
|
29
32
|
color: #fff;
|
|
30
33
|
font-size: 14px;
|
|
34
|
+
border-radius: 4px 4px 0 0;
|
|
31
35
|
}
|
|
32
36
|
.DrawResultsHeader h4 {
|
|
33
37
|
text-transform: uppercase;
|
|
34
38
|
font-weight: 400;
|
|
35
39
|
margin: 0;
|
|
40
|
+
padding-top: 15px;
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
.DrawMultipler label {
|
|
@@ -41,7 +46,10 @@
|
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
.DrawResultsBody {
|
|
44
|
-
padding:
|
|
49
|
+
padding: 0px 20px;
|
|
50
|
+
margin-bottom: 5px;
|
|
51
|
+
border-radius: 0 0 4px 4px;
|
|
52
|
+
border: 1px solid #009993;
|
|
45
53
|
}
|
|
46
54
|
.DrawResultsBody .DrawNumbersGrid {
|
|
47
55
|
font-size: 14px;
|
|
@@ -115,21 +123,24 @@
|
|
|
115
123
|
}
|
|
116
124
|
|
|
117
125
|
.ExpandableBox {
|
|
126
|
+
line-height: 12px;
|
|
127
|
+
font-weight: lighter;
|
|
118
128
|
width: 100%;
|
|
119
129
|
height: 100%;
|
|
120
|
-
max-height:
|
|
130
|
+
max-height: 70px;
|
|
121
131
|
float: left;
|
|
122
132
|
margin: 0 0 20px 0;
|
|
123
|
-
border: 1px solid #
|
|
133
|
+
border: 1px solid #f1f1f1;
|
|
134
|
+
background: #fff;
|
|
124
135
|
border-radius: 4px;
|
|
125
136
|
padding: 10px;
|
|
126
|
-
box-sizing: border-box;
|
|
127
137
|
-webkit-transition: all 0.6s ease-in-out;
|
|
128
138
|
-moz-transition: all 0.6s ease-in-out;
|
|
129
139
|
-o-transition: all 0.6s ease-in-out;
|
|
130
140
|
-ms-transition: all 0.6s ease-in-out;
|
|
131
141
|
transition: all 0.6s ease-in-out;
|
|
132
142
|
overflow: hidden;
|
|
143
|
+
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
|
|
133
144
|
}
|
|
134
145
|
|
|
135
146
|
.ExpandableBox.ShowBox {
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import { Component, Prop, h, State } from '@stencil/core';
|
|
2
2
|
import { translate } from '../../utils/locale.utils';
|
|
3
3
|
import '@everymatrix/lottery-grid';
|
|
4
|
-
const DEFAULT_VALUES = {
|
|
5
|
-
gamename: 'Chrono',
|
|
6
|
-
gamedate: '24/09/2022',
|
|
7
|
-
state: 'Processing',
|
|
8
|
-
amount: 304444,
|
|
9
|
-
ticketid: '6963444',
|
|
10
|
-
selection: '[5, 6, 7, 8, 9]',
|
|
11
|
-
multiplier: 4.5,
|
|
12
|
-
resultstatus: 'Processing',
|
|
13
|
-
drawstatus: 'Won',
|
|
14
|
-
drawamount: 1022,
|
|
15
|
-
drawid: '54545555',
|
|
16
|
-
drawdate: '24/09/2032'
|
|
17
|
-
};
|
|
18
4
|
export class LotteryDrawResults {
|
|
19
5
|
constructor() {
|
|
20
6
|
/**
|
|
@@ -25,9 +11,39 @@ export class LotteryDrawResults {
|
|
|
25
11
|
* Shows only the last draw
|
|
26
12
|
*/
|
|
27
13
|
this.drawMode = false;
|
|
14
|
+
/**
|
|
15
|
+
* The drawID (option)
|
|
16
|
+
*/
|
|
17
|
+
this.drawId = '';
|
|
18
|
+
/**
|
|
19
|
+
* The game name
|
|
20
|
+
*/
|
|
28
21
|
this.gameName = '';
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
/**
|
|
23
|
+
* The ticket submission date
|
|
24
|
+
*/
|
|
25
|
+
this.ticketDate = '';
|
|
26
|
+
/**
|
|
27
|
+
* The ticket status
|
|
28
|
+
*/
|
|
29
|
+
this.ticketStatus = '';
|
|
30
|
+
/**
|
|
31
|
+
* The ticket id
|
|
32
|
+
*/
|
|
33
|
+
this.ticketId = '';
|
|
34
|
+
/**
|
|
35
|
+
* The ticket amount
|
|
36
|
+
*/
|
|
37
|
+
this.ticketAmount = '';
|
|
38
|
+
/**
|
|
39
|
+
* The ticket multiplier
|
|
40
|
+
*/
|
|
41
|
+
this.ticketMultiplier = false;
|
|
42
|
+
/**
|
|
43
|
+
* The ticket draw count
|
|
44
|
+
*/
|
|
45
|
+
this.ticketDrawCount = 0;
|
|
46
|
+
this.multiplier = 3;
|
|
31
47
|
this.isLoading = true;
|
|
32
48
|
this.drawResults = [];
|
|
33
49
|
this.rules = {};
|
|
@@ -49,9 +65,6 @@ export class LotteryDrawResults {
|
|
|
49
65
|
connectedCallback() {
|
|
50
66
|
let promises = [];
|
|
51
67
|
promises.push(this.getGameData());
|
|
52
|
-
if (this.playerId) {
|
|
53
|
-
promises.push(this.getTicketData());
|
|
54
|
-
}
|
|
55
68
|
if (this.drawId) {
|
|
56
69
|
promises.push(this.getDrawData());
|
|
57
70
|
}
|
|
@@ -71,9 +84,11 @@ export class LotteryDrawResults {
|
|
|
71
84
|
.then((data) => {
|
|
72
85
|
this.drawData = data;
|
|
73
86
|
resolve(true);
|
|
87
|
+
this.isLoading = false;
|
|
74
88
|
})
|
|
75
89
|
.catch((err) => {
|
|
76
90
|
reject(err);
|
|
91
|
+
this.isLoading = false;
|
|
77
92
|
});
|
|
78
93
|
});
|
|
79
94
|
}
|
|
@@ -90,6 +105,8 @@ export class LotteryDrawResults {
|
|
|
90
105
|
totalNumbers: data.rules.boards[0].totalNumbers
|
|
91
106
|
};
|
|
92
107
|
resolve(true);
|
|
108
|
+
this.isLoading = false;
|
|
109
|
+
this.hasErrors = false;
|
|
93
110
|
})
|
|
94
111
|
.catch((err) => {
|
|
95
112
|
this.isLoading = false;
|
|
@@ -99,26 +116,7 @@ export class LotteryDrawResults {
|
|
|
99
116
|
});
|
|
100
117
|
});
|
|
101
118
|
}
|
|
102
|
-
getTicketData() {
|
|
103
|
-
return new Promise((resolve, reject) => {
|
|
104
|
-
let url = new URL(`${this.endpoint}/tickets/player/${this.playerId}`);
|
|
105
|
-
fetch(url.href)
|
|
106
|
-
.then((response) => {
|
|
107
|
-
return response.json();
|
|
108
|
-
})
|
|
109
|
-
.then((data) => {
|
|
110
|
-
this.ticketData = data.length === 0 ? DEFAULT_VALUES : data[1];
|
|
111
|
-
this.drawResults = this.ticketData.drawResults.map((item) => item);
|
|
112
|
-
this.selection = this.ticketData.selection[0].join(',');
|
|
113
|
-
resolve(true);
|
|
114
|
-
})
|
|
115
|
-
.catch((err) => {
|
|
116
|
-
reject(err);
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
119
|
render() {
|
|
121
|
-
var _a, _b, _c, _d, _e, _f;
|
|
122
120
|
if (this.isLoading) {
|
|
123
121
|
return (h("p", null, "Loading, please wait ..."));
|
|
124
122
|
}
|
|
@@ -134,20 +132,24 @@ export class LotteryDrawResults {
|
|
|
134
132
|
": ",
|
|
135
133
|
h("span", null, this.gameName)),
|
|
136
134
|
h("div", { class: "TicketDate" },
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
translate('ticketPurchaseDate', this.language),
|
|
136
|
+
": ",
|
|
137
|
+
h("span", null, this.ticketDate.slice(0, 10))),
|
|
139
138
|
h("div", { class: "TicketStatus" },
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
translate('ticketStatus', this.language),
|
|
140
|
+
": ",
|
|
141
|
+
h("span", null, this.ticketStatus))),
|
|
142
142
|
h("div", { class: "DrawResultsBody" },
|
|
143
143
|
h("div", { class: "TicketIdContainer" },
|
|
144
144
|
h("p", null,
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
translate('ticketId', this.language),
|
|
146
|
+
": ",
|
|
147
|
+
h("span", null, this.ticketId))),
|
|
147
148
|
h("div", { class: "TicketAmountContainer" },
|
|
148
149
|
h("p", null,
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
translate('ticketAmount', this.language),
|
|
151
|
+
" ",
|
|
152
|
+
h("span", null, this.ticketAmount))),
|
|
151
153
|
h("div", { class: "DrawNumbersGrid" },
|
|
152
154
|
h("p", null,
|
|
153
155
|
translate('drawNumbersGridTicket', this.language),
|
|
@@ -156,13 +158,14 @@ export class LotteryDrawResults {
|
|
|
156
158
|
h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, "selected-numbers": this.selection, selectable: false, "display-selected": true, language: this.language }))),
|
|
157
159
|
h("div", { class: "DrawMultipler" },
|
|
158
160
|
h("label", { class: "Label" },
|
|
159
|
-
|
|
160
|
-
|
|
161
|
+
translate('winUpTo', this.language),
|
|
162
|
+
" ",
|
|
163
|
+
h("span", null, JSON.stringify(this.ticketMultiplier)))),
|
|
161
164
|
h("div", { class: "NumberOfDrawsContainer" },
|
|
162
165
|
h("p", null,
|
|
163
166
|
translate('numberOfDraws', this.language),
|
|
164
|
-
": ",
|
|
165
|
-
|
|
167
|
+
": ",
|
|
168
|
+
this.ticketDrawCount),
|
|
166
169
|
h("div", { class: "DrawTicketsContainer" }, this.drawResults.map((item, index) => h("div", { class: "ExpandableBoxes" },
|
|
167
170
|
h("div", { class: this.toggleDrawer[index] ? 'ExpandableBox ShowBox' : 'ExpandableBox', onClick: () => this.changeBox(index) },
|
|
168
171
|
h("div", { class: "TicketResultContainer" },
|
|
@@ -193,7 +196,8 @@ export class LotteryDrawResults {
|
|
|
193
196
|
h("div", { class: "DrawNumbersGrid" }),
|
|
194
197
|
h("div", { class: "DrawMultipler" },
|
|
195
198
|
h("label", { class: "Label" },
|
|
196
|
-
|
|
199
|
+
translate('winUpTo', this.language),
|
|
200
|
+
" ",
|
|
197
201
|
item.multiplier)))))))))
|
|
198
202
|
:
|
|
199
203
|
h("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
@@ -216,7 +220,8 @@ export class LotteryDrawResults {
|
|
|
216
220
|
h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, selectedNumbers: this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language })),
|
|
217
221
|
h("div", { class: "DrawMultipler" },
|
|
218
222
|
h("label", { class: "Label" },
|
|
219
|
-
|
|
223
|
+
translate('multiplier', this.language),
|
|
224
|
+
" ",
|
|
220
225
|
this.multiplier))))))));
|
|
221
226
|
}
|
|
222
227
|
}
|
|
@@ -328,10 +333,11 @@ export class LotteryDrawResults {
|
|
|
328
333
|
"optional": false,
|
|
329
334
|
"docs": {
|
|
330
335
|
"tags": [],
|
|
331
|
-
"text": "
|
|
336
|
+
"text": "The drawID (option)"
|
|
332
337
|
},
|
|
333
338
|
"attribute": "draw-id",
|
|
334
|
-
"reflect": false
|
|
339
|
+
"reflect": false,
|
|
340
|
+
"defaultValue": "''"
|
|
335
341
|
},
|
|
336
342
|
"gameName": {
|
|
337
343
|
"type": "string",
|
|
@@ -345,16 +351,123 @@ export class LotteryDrawResults {
|
|
|
345
351
|
"optional": false,
|
|
346
352
|
"docs": {
|
|
347
353
|
"tags": [],
|
|
348
|
-
"text": ""
|
|
354
|
+
"text": "The game name"
|
|
349
355
|
},
|
|
350
356
|
"attribute": "game-name",
|
|
351
357
|
"reflect": false,
|
|
352
358
|
"defaultValue": "''"
|
|
359
|
+
},
|
|
360
|
+
"ticketDate": {
|
|
361
|
+
"type": "string",
|
|
362
|
+
"mutable": false,
|
|
363
|
+
"complexType": {
|
|
364
|
+
"original": "string",
|
|
365
|
+
"resolved": "string",
|
|
366
|
+
"references": {}
|
|
367
|
+
},
|
|
368
|
+
"required": false,
|
|
369
|
+
"optional": false,
|
|
370
|
+
"docs": {
|
|
371
|
+
"tags": [],
|
|
372
|
+
"text": "The ticket submission date"
|
|
373
|
+
},
|
|
374
|
+
"attribute": "ticket-date",
|
|
375
|
+
"reflect": false,
|
|
376
|
+
"defaultValue": "''"
|
|
377
|
+
},
|
|
378
|
+
"ticketStatus": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"mutable": false,
|
|
381
|
+
"complexType": {
|
|
382
|
+
"original": "string",
|
|
383
|
+
"resolved": "string",
|
|
384
|
+
"references": {}
|
|
385
|
+
},
|
|
386
|
+
"required": false,
|
|
387
|
+
"optional": false,
|
|
388
|
+
"docs": {
|
|
389
|
+
"tags": [],
|
|
390
|
+
"text": "The ticket status"
|
|
391
|
+
},
|
|
392
|
+
"attribute": "ticket-status",
|
|
393
|
+
"reflect": false,
|
|
394
|
+
"defaultValue": "''"
|
|
395
|
+
},
|
|
396
|
+
"ticketId": {
|
|
397
|
+
"type": "string",
|
|
398
|
+
"mutable": false,
|
|
399
|
+
"complexType": {
|
|
400
|
+
"original": "string",
|
|
401
|
+
"resolved": "string",
|
|
402
|
+
"references": {}
|
|
403
|
+
},
|
|
404
|
+
"required": false,
|
|
405
|
+
"optional": false,
|
|
406
|
+
"docs": {
|
|
407
|
+
"tags": [],
|
|
408
|
+
"text": "The ticket id"
|
|
409
|
+
},
|
|
410
|
+
"attribute": "ticket-id",
|
|
411
|
+
"reflect": false,
|
|
412
|
+
"defaultValue": "''"
|
|
413
|
+
},
|
|
414
|
+
"ticketAmount": {
|
|
415
|
+
"type": "string",
|
|
416
|
+
"mutable": false,
|
|
417
|
+
"complexType": {
|
|
418
|
+
"original": "string",
|
|
419
|
+
"resolved": "string",
|
|
420
|
+
"references": {}
|
|
421
|
+
},
|
|
422
|
+
"required": false,
|
|
423
|
+
"optional": false,
|
|
424
|
+
"docs": {
|
|
425
|
+
"tags": [],
|
|
426
|
+
"text": "The ticket amount"
|
|
427
|
+
},
|
|
428
|
+
"attribute": "ticket-amount",
|
|
429
|
+
"reflect": false,
|
|
430
|
+
"defaultValue": "''"
|
|
431
|
+
},
|
|
432
|
+
"ticketMultiplier": {
|
|
433
|
+
"type": "boolean",
|
|
434
|
+
"mutable": false,
|
|
435
|
+
"complexType": {
|
|
436
|
+
"original": "boolean",
|
|
437
|
+
"resolved": "boolean",
|
|
438
|
+
"references": {}
|
|
439
|
+
},
|
|
440
|
+
"required": false,
|
|
441
|
+
"optional": false,
|
|
442
|
+
"docs": {
|
|
443
|
+
"tags": [],
|
|
444
|
+
"text": "The ticket multiplier"
|
|
445
|
+
},
|
|
446
|
+
"attribute": "ticket-multiplier",
|
|
447
|
+
"reflect": false,
|
|
448
|
+
"defaultValue": "false"
|
|
449
|
+
},
|
|
450
|
+
"ticketDrawCount": {
|
|
451
|
+
"type": "number",
|
|
452
|
+
"mutable": false,
|
|
453
|
+
"complexType": {
|
|
454
|
+
"original": "number",
|
|
455
|
+
"resolved": "number",
|
|
456
|
+
"references": {}
|
|
457
|
+
},
|
|
458
|
+
"required": false,
|
|
459
|
+
"optional": false,
|
|
460
|
+
"docs": {
|
|
461
|
+
"tags": [],
|
|
462
|
+
"text": "The ticket draw count"
|
|
463
|
+
},
|
|
464
|
+
"attribute": "ticket-draw-count",
|
|
465
|
+
"reflect": false,
|
|
466
|
+
"defaultValue": "0"
|
|
353
467
|
}
|
|
354
468
|
}; }
|
|
355
469
|
static get states() { return {
|
|
356
470
|
"multiplier": {},
|
|
357
|
-
"ticketData": {},
|
|
358
471
|
"isLoading": {},
|
|
359
472
|
"drawResults": {},
|
|
360
473
|
"rules": {},
|