@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
|
@@ -43,13 +43,75 @@ export class LotteryDrawResults {
|
|
|
43
43
|
* The ticket draw count
|
|
44
44
|
*/
|
|
45
45
|
this.ticketDrawCount = 0;
|
|
46
|
+
/**
|
|
47
|
+
* The ticket winning numbers
|
|
48
|
+
*/
|
|
49
|
+
this.ticketNumbers = '';
|
|
50
|
+
/**
|
|
51
|
+
* The session id
|
|
52
|
+
*/
|
|
53
|
+
this.sessionId = '';
|
|
54
|
+
/**
|
|
55
|
+
* Client custom styling via string
|
|
56
|
+
*/
|
|
57
|
+
this.clientStyling = '';
|
|
58
|
+
/**
|
|
59
|
+
* Client custom styling via url content
|
|
60
|
+
*/
|
|
61
|
+
this.clientStylingUrlContent = '';
|
|
46
62
|
this.multiplier = 3;
|
|
47
63
|
this.isLoading = true;
|
|
48
|
-
this.drawResults = [];
|
|
49
64
|
this.rules = {};
|
|
50
65
|
this.toggleDrawer = [false];
|
|
51
66
|
this.hasErrors = false;
|
|
52
67
|
this.errorText = '';
|
|
68
|
+
this.ticketData = [];
|
|
69
|
+
this.ticketDataLoaded = false;
|
|
70
|
+
this.ticketDraws = [];
|
|
71
|
+
this.hasDrawNumbers = false;
|
|
72
|
+
this.limitStylingAppends = false;
|
|
73
|
+
this.getTicketsData = () => {
|
|
74
|
+
let url = new URL(`${this.endpoint}/tickets`);
|
|
75
|
+
let drawOptions = {
|
|
76
|
+
method: "GET",
|
|
77
|
+
headers: {
|
|
78
|
+
'Content-Type': "application/json",
|
|
79
|
+
'Accept': 'application/json',
|
|
80
|
+
'Authorization': `Bearer ${this.sessionId}`
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
fetch(url.href, drawOptions)
|
|
84
|
+
.then((response) => {
|
|
85
|
+
return response.json();
|
|
86
|
+
})
|
|
87
|
+
.then((data) => {
|
|
88
|
+
if (data) {
|
|
89
|
+
this.ticketData = data;
|
|
90
|
+
this.ticketDataLoaded = true;
|
|
91
|
+
}
|
|
92
|
+
return this.ticketData;
|
|
93
|
+
}).then((response) => {
|
|
94
|
+
response.forEach(ticket => {
|
|
95
|
+
if (ticket.drawResults.length) {
|
|
96
|
+
ticket.drawResults.forEach(draw => {
|
|
97
|
+
fetch(`${this.endpoint}/games/${this.gameId}/draws/${draw.drawId}`)
|
|
98
|
+
.then((response) => {
|
|
99
|
+
return response.json();
|
|
100
|
+
})
|
|
101
|
+
.then((data) => {
|
|
102
|
+
// check if draw id is unique
|
|
103
|
+
if (!this.ticketDraws.some(el => el.drawId === draw.drawId)) {
|
|
104
|
+
this.ticketDraws.push({ drawId: draw.drawId, drawNumbers: data.winningNumbers });
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return this.ticketDraws;
|
|
110
|
+
});
|
|
111
|
+
}).then(() => {
|
|
112
|
+
this.hasDrawNumbers = true;
|
|
113
|
+
});
|
|
114
|
+
};
|
|
53
115
|
this.changeBox = (index) => {
|
|
54
116
|
this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
|
|
55
117
|
if (itemIndex == index) {
|
|
@@ -61,6 +123,18 @@ export class LotteryDrawResults {
|
|
|
61
123
|
this.toggleDrawer.push(true);
|
|
62
124
|
}
|
|
63
125
|
};
|
|
126
|
+
this.setClientStyling = () => {
|
|
127
|
+
let sheet = document.createElement('style');
|
|
128
|
+
sheet.innerHTML = this.clientStyling;
|
|
129
|
+
this.stylingContainer.prepend(sheet);
|
|
130
|
+
};
|
|
131
|
+
this.setClientStylingURL = () => {
|
|
132
|
+
let cssFile = document.createElement('style');
|
|
133
|
+
setTimeout(() => {
|
|
134
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
135
|
+
this.stylingContainer.prepend(cssFile);
|
|
136
|
+
}, 1);
|
|
137
|
+
};
|
|
64
138
|
}
|
|
65
139
|
connectedCallback() {
|
|
66
140
|
let promises = [];
|
|
@@ -68,14 +142,28 @@ export class LotteryDrawResults {
|
|
|
68
142
|
if (this.drawId) {
|
|
69
143
|
promises.push(this.getDrawData());
|
|
70
144
|
}
|
|
145
|
+
if (!this.drawMode) {
|
|
146
|
+
this.getTicketsData();
|
|
147
|
+
}
|
|
71
148
|
Promise.all(promises)
|
|
72
149
|
.then(() => {
|
|
73
150
|
this.isLoading = false;
|
|
74
151
|
});
|
|
75
152
|
}
|
|
76
|
-
|
|
153
|
+
componentDidRender() {
|
|
154
|
+
// start custom styling area
|
|
155
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
156
|
+
if (this.clientStyling)
|
|
157
|
+
this.setClientStyling();
|
|
158
|
+
if (this.clientStylingUrlContent)
|
|
159
|
+
this.setClientStylingURL();
|
|
160
|
+
this.limitStylingAppends = true;
|
|
161
|
+
}
|
|
162
|
+
// end custom styling area
|
|
163
|
+
}
|
|
164
|
+
getDrawData(drawID) {
|
|
77
165
|
return new Promise((resolve, reject) => {
|
|
78
|
-
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${this.drawId}`);
|
|
166
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawID ? drawID : this.drawId}`);
|
|
79
167
|
fetch(url.href)
|
|
80
168
|
.then((response) => {
|
|
81
169
|
// @TODO EXCEPTIONS
|
|
@@ -85,6 +173,9 @@ export class LotteryDrawResults {
|
|
|
85
173
|
this.drawData = data;
|
|
86
174
|
resolve(true);
|
|
87
175
|
this.isLoading = false;
|
|
176
|
+
if (drawID) {
|
|
177
|
+
return this.drawData.winningNumbers;
|
|
178
|
+
}
|
|
88
179
|
})
|
|
89
180
|
.catch((err) => {
|
|
90
181
|
reject(err);
|
|
@@ -124,105 +215,99 @@ export class LotteryDrawResults {
|
|
|
124
215
|
h("p", null, this.errorText);
|
|
125
216
|
}
|
|
126
217
|
else {
|
|
127
|
-
return (h("section", { class: "DrawResultsSection" },
|
|
128
|
-
h("div", { class: "DrawResultsArea" },
|
|
129
|
-
h("div",
|
|
130
|
-
h("div", { class: "
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
h("span", null, this.ticketDate.slice(0, 10))),
|
|
138
|
-
h("div", { class: "TicketStatus" },
|
|
139
|
-
translate('ticketStatus', this.language),
|
|
140
|
-
": ",
|
|
141
|
-
h("span", null, this.ticketStatus))),
|
|
142
|
-
h("div", { class: "DrawResultsBody" },
|
|
143
|
-
h("div", { class: "TicketIdContainer" },
|
|
144
|
-
h("p", null,
|
|
145
|
-
translate('ticketId', this.language),
|
|
218
|
+
return (h("section", { class: "DrawResultsSection", ref: el => this.stylingContainer = el }, this.drawMode ?
|
|
219
|
+
h("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
220
|
+
h("div", null,
|
|
221
|
+
h("div", { class: "DrawResultsHeader" },
|
|
222
|
+
h("span", null,
|
|
223
|
+
translate('drawId', this.language),
|
|
224
|
+
": ",
|
|
225
|
+
this.drawData.id),
|
|
226
|
+
h("span", null,
|
|
227
|
+
translate('drawDate', this.language),
|
|
146
228
|
": ",
|
|
147
|
-
|
|
148
|
-
h("div", { class: "
|
|
149
|
-
h("
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
229
|
+
this.drawData.date.slice(0, 10))),
|
|
230
|
+
h("div", { class: "DrawResultsBody" },
|
|
231
|
+
h("div", { class: "DrawNumbersGrid" },
|
|
232
|
+
h("p", null,
|
|
233
|
+
translate('drawNumbersGridDraw', this.language),
|
|
234
|
+
"0:"),
|
|
235
|
+
h("div", { class: "BulletContainer" },
|
|
236
|
+
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 })),
|
|
237
|
+
h("div", { class: "DrawMultipler" },
|
|
238
|
+
h("label", { class: "Label" },
|
|
239
|
+
translate('multiplier', this.language),
|
|
240
|
+
" ",
|
|
241
|
+
this.multiplier))))))
|
|
242
|
+
:
|
|
243
|
+
h("div", { class: "DrawResultsArea TicketDraws" },
|
|
244
|
+
h("div", { class: "DrawResultsBody" },
|
|
245
|
+
h("div", { class: "TicketIdContainer" },
|
|
246
|
+
h("label", { class: "Label" },
|
|
247
|
+
translate('ticketId', this.language),
|
|
248
|
+
": ",
|
|
249
|
+
h("span", null, this.ticketId))),
|
|
250
|
+
h("div", { class: "TicketAmountContainer" },
|
|
251
|
+
h("label", { class: "Label" },
|
|
252
|
+
translate('ticketAmount', this.language),
|
|
253
|
+
" ",
|
|
254
|
+
h("span", null, this.ticketAmount))),
|
|
255
|
+
h("div", { class: "DrawNumbersGrid" },
|
|
256
|
+
h("label", { class: "Label" },
|
|
257
|
+
translate('drawNumbersGridTicket', this.language),
|
|
258
|
+
"0:"),
|
|
259
|
+
h("div", { class: "BulletContainer" },
|
|
260
|
+
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 }))),
|
|
261
|
+
h("div", { class: "DrawMultipler" },
|
|
262
|
+
h("label", { class: "Label" },
|
|
263
|
+
translate('multiplier', this.language),
|
|
264
|
+
" ",
|
|
265
|
+
JSON.stringify(this.ticketMultiplier))),
|
|
266
|
+
h("div", { class: "NumberOfDrawsContainer" },
|
|
267
|
+
h("label", { class: "Label" },
|
|
268
|
+
translate('numberOfDraws', this.language),
|
|
269
|
+
": ",
|
|
270
|
+
this.ticketDrawCount),
|
|
271
|
+
h("div", { class: "DrawTicketsContainer" }, this.ticketData.map((ticket) => h("div", { class: "ExpandableBoxes" }, ticket.drawResults.length ?
|
|
272
|
+
h("div", null, ticket.id == this.ticketId && ticket.drawResults.map((item, index) => h("div", { class: this.toggleDrawer[index] ? 'ExpandableBox ShowBox' : 'ExpandableBox', onClick: () => this.changeBox(index) },
|
|
273
|
+
h("div", { class: "TicketResultContainer" },
|
|
274
|
+
h("p", null,
|
|
275
|
+
translate('ticketResult', this.language),
|
|
276
|
+
": ",
|
|
277
|
+
item.state)),
|
|
278
|
+
item.state == 'won' &&
|
|
279
|
+
h("div", { class: "AmountWonContainer" },
|
|
280
|
+
h("p", null,
|
|
281
|
+
translate('amountWon', this.language),
|
|
282
|
+
": ",
|
|
283
|
+
Number(item.amount).toLocaleString('en'),
|
|
284
|
+
" ",
|
|
285
|
+
item.currency)),
|
|
286
|
+
h("div", { class: "DrawIdContainer" },
|
|
287
|
+
h("p", null,
|
|
288
|
+
translate('drawId', this.language),
|
|
289
|
+
": ",
|
|
290
|
+
item.drawId)),
|
|
291
|
+
h("div", { class: "DrawDateContainer" },
|
|
178
292
|
h("p", null,
|
|
179
|
-
translate('
|
|
293
|
+
translate('drawDate', this.language),
|
|
180
294
|
": ",
|
|
181
|
-
|
|
295
|
+
item.updatedAt.slice(0, 10),
|
|
296
|
+
" | ",
|
|
297
|
+
item.updatedAt.slice(11, 19))),
|
|
298
|
+
h("div", { class: "DrawNumbersGrid" }, this.hasDrawNumbers && this.ticketDraws.map((ticketDraw) => item.drawId && item.drawId === ticketDraw.drawId &&
|
|
299
|
+
h("div", null,
|
|
300
|
+
h("label", { class: "Label" },
|
|
301
|
+
translate('drawNumbersGridDraw', this.language),
|
|
302
|
+
"A:"),
|
|
303
|
+
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 })))),
|
|
304
|
+
h("div", { class: "DrawMultipler" },
|
|
305
|
+
h("label", { class: "Label" },
|
|
306
|
+
translate('multiplier', this.language),
|
|
182
307
|
" ",
|
|
183
|
-
item.
|
|
184
|
-
|
|
185
|
-
h("
|
|
186
|
-
translate('drawId', this.language),
|
|
187
|
-
": ",
|
|
188
|
-
item.drawId)),
|
|
189
|
-
h("div", { class: "DrawDateContainer" },
|
|
190
|
-
h("p", null,
|
|
191
|
-
translate('drawDate', this.language),
|
|
192
|
-
": ",
|
|
193
|
-
item.updatedAt.slice(0, 10),
|
|
194
|
-
" | ",
|
|
195
|
-
item.updatedAt.slice(11, 19))),
|
|
196
|
-
h("div", { class: "DrawNumbersGrid" }),
|
|
197
|
-
h("div", { class: "DrawMultipler" },
|
|
198
|
-
h("label", { class: "Label" },
|
|
199
|
-
translate('winUpTo', this.language),
|
|
200
|
-
" ",
|
|
201
|
-
item.multiplier)))))))))
|
|
202
|
-
:
|
|
203
|
-
h("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
204
|
-
h("div", null,
|
|
205
|
-
h("div", { class: "DrawResultsHeader" },
|
|
206
|
-
h("span", null,
|
|
207
|
-
translate('drawId', this.language),
|
|
208
|
-
": ",
|
|
209
|
-
this.drawData.id),
|
|
210
|
-
h("span", null,
|
|
211
|
-
translate('drawDate', this.language),
|
|
212
|
-
": ",
|
|
213
|
-
this.drawData.date.slice(0, 10))),
|
|
214
|
-
h("div", { class: "DrawResultsBody" },
|
|
215
|
-
h("div", { class: "DrawNumbersGrid" },
|
|
216
|
-
h("p", null,
|
|
217
|
-
translate('drawNumbersGridDraw', this.language),
|
|
218
|
-
":"),
|
|
219
|
-
h("div", { class: "BulletContainer" },
|
|
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 })),
|
|
221
|
-
h("div", { class: "DrawMultipler" },
|
|
222
|
-
h("label", { class: "Label" },
|
|
223
|
-
translate('multiplier', this.language),
|
|
224
|
-
" ",
|
|
225
|
-
this.multiplier))))))));
|
|
308
|
+
item.multiplier)))))
|
|
309
|
+
:
|
|
310
|
+
h("span", null)))))))));
|
|
226
311
|
}
|
|
227
312
|
}
|
|
228
313
|
static get is() { return "lottery-draw-results"; }
|
|
@@ -464,15 +549,91 @@ export class LotteryDrawResults {
|
|
|
464
549
|
"attribute": "ticket-draw-count",
|
|
465
550
|
"reflect": false,
|
|
466
551
|
"defaultValue": "0"
|
|
552
|
+
},
|
|
553
|
+
"ticketNumbers": {
|
|
554
|
+
"type": "string",
|
|
555
|
+
"mutable": false,
|
|
556
|
+
"complexType": {
|
|
557
|
+
"original": "string",
|
|
558
|
+
"resolved": "string",
|
|
559
|
+
"references": {}
|
|
560
|
+
},
|
|
561
|
+
"required": false,
|
|
562
|
+
"optional": false,
|
|
563
|
+
"docs": {
|
|
564
|
+
"tags": [],
|
|
565
|
+
"text": "The ticket winning numbers"
|
|
566
|
+
},
|
|
567
|
+
"attribute": "ticket-numbers",
|
|
568
|
+
"reflect": false,
|
|
569
|
+
"defaultValue": "''"
|
|
570
|
+
},
|
|
571
|
+
"sessionId": {
|
|
572
|
+
"type": "string",
|
|
573
|
+
"mutable": false,
|
|
574
|
+
"complexType": {
|
|
575
|
+
"original": "string",
|
|
576
|
+
"resolved": "string",
|
|
577
|
+
"references": {}
|
|
578
|
+
},
|
|
579
|
+
"required": false,
|
|
580
|
+
"optional": false,
|
|
581
|
+
"docs": {
|
|
582
|
+
"tags": [],
|
|
583
|
+
"text": "The session id"
|
|
584
|
+
},
|
|
585
|
+
"attribute": "session-id",
|
|
586
|
+
"reflect": false,
|
|
587
|
+
"defaultValue": "''"
|
|
588
|
+
},
|
|
589
|
+
"clientStyling": {
|
|
590
|
+
"type": "string",
|
|
591
|
+
"mutable": false,
|
|
592
|
+
"complexType": {
|
|
593
|
+
"original": "string",
|
|
594
|
+
"resolved": "string",
|
|
595
|
+
"references": {}
|
|
596
|
+
},
|
|
597
|
+
"required": false,
|
|
598
|
+
"optional": false,
|
|
599
|
+
"docs": {
|
|
600
|
+
"tags": [],
|
|
601
|
+
"text": "Client custom styling via string"
|
|
602
|
+
},
|
|
603
|
+
"attribute": "client-styling",
|
|
604
|
+
"reflect": false,
|
|
605
|
+
"defaultValue": "''"
|
|
606
|
+
},
|
|
607
|
+
"clientStylingUrlContent": {
|
|
608
|
+
"type": "string",
|
|
609
|
+
"mutable": false,
|
|
610
|
+
"complexType": {
|
|
611
|
+
"original": "string",
|
|
612
|
+
"resolved": "string",
|
|
613
|
+
"references": {}
|
|
614
|
+
},
|
|
615
|
+
"required": false,
|
|
616
|
+
"optional": false,
|
|
617
|
+
"docs": {
|
|
618
|
+
"tags": [],
|
|
619
|
+
"text": "Client custom styling via url content"
|
|
620
|
+
},
|
|
621
|
+
"attribute": "client-styling-url-content",
|
|
622
|
+
"reflect": false,
|
|
623
|
+
"defaultValue": "''"
|
|
467
624
|
}
|
|
468
625
|
}; }
|
|
469
626
|
static get states() { return {
|
|
470
627
|
"multiplier": {},
|
|
471
628
|
"isLoading": {},
|
|
472
|
-
"drawResults": {},
|
|
473
629
|
"rules": {},
|
|
474
630
|
"toggleDrawer": {},
|
|
475
631
|
"hasErrors": {},
|
|
476
|
-
"errorText": {}
|
|
632
|
+
"errorText": {},
|
|
633
|
+
"ticketData": {},
|
|
634
|
+
"ticketDataLoaded": {},
|
|
635
|
+
"ticketDraws": {},
|
|
636
|
+
"hasDrawNumbers": {},
|
|
637
|
+
"limitStylingAppends": {}
|
|
477
638
|
}; }
|
|
478
639
|
}
|
|
@@ -6,8 +6,8 @@ const TRANSLATIONS = {
|
|
|
6
6
|
drawId: 'Draw ID',
|
|
7
7
|
drawName: 'Game name',
|
|
8
8
|
drawDate: 'Draw Date',
|
|
9
|
-
drawNumbersGridDraw: 'Draw numbers Grid
|
|
10
|
-
drawNumbersGridTicket: 'Draw numbers Grid
|
|
9
|
+
drawNumbersGridDraw: 'Draw numbers Grid ',
|
|
10
|
+
drawNumbersGridTicket: 'Draw numbers Grid ',
|
|
11
11
|
ticketResult: 'Ticket result',
|
|
12
12
|
amountWon: 'Amount won',
|
|
13
13
|
numberOfDraws: 'Number of draws',
|
|
@@ -23,8 +23,8 @@ const TRANSLATIONS = {
|
|
|
23
23
|
drawId: 'Id extragere',
|
|
24
24
|
drawName: 'Numele jocului',
|
|
25
25
|
drawDate: 'Data extragerii',
|
|
26
|
-
drawNumbersGridDraw: 'Numerele extrase Grid
|
|
27
|
-
drawNumbersGridTicket: 'Numerele extrase Grid
|
|
26
|
+
drawNumbersGridDraw: 'Numerele extrase Grid',
|
|
27
|
+
drawNumbersGridTicket: 'Numerele extrase Grid',
|
|
28
28
|
ticketResult: 'Rezultatul biletului',
|
|
29
29
|
amountWon: 'Suma castigata',
|
|
30
30
|
numberOfDraws: 'Numarul de extrageri',
|
|
@@ -35,6 +35,40 @@ const TRANSLATIONS = {
|
|
|
35
35
|
ticketAmount: 'Valoarea biletului',
|
|
36
36
|
winUpTo: 'Poti castiga'
|
|
37
37
|
},
|
|
38
|
+
fr: {
|
|
39
|
+
drawResultsHeader: 'Résultats du dernier tirage',
|
|
40
|
+
drawId: 'ID de tirage',
|
|
41
|
+
drawName: 'Nom du jeu',
|
|
42
|
+
drawDate: 'Date du tirage',
|
|
43
|
+
drawNumbersGridDraw: 'Tirage des numéros Grille',
|
|
44
|
+
drawNumbersGridTicket: 'Tirage des numéros Grille',
|
|
45
|
+
ticketResult: 'Résultat du ticket',
|
|
46
|
+
amountWon: 'Montant gagné',
|
|
47
|
+
numberOfDraws: 'Nombre de tirages',
|
|
48
|
+
multiplier: 'Multiplicateur',
|
|
49
|
+
ticketPurchaseDate: 'Date d\'achat du billet',
|
|
50
|
+
ticketStatus: 'Statut du ticket',
|
|
51
|
+
ticketId: 'ID de billets',
|
|
52
|
+
ticketAmount: 'Montant du billet',
|
|
53
|
+
winUpTo: 'Gagnez jusqu\'à'
|
|
54
|
+
},
|
|
55
|
+
ar: {
|
|
56
|
+
drawResultsHeader: 'نتائج آخر سحب',
|
|
57
|
+
drawId: 'معرّف السحب',
|
|
58
|
+
drawName: 'اسم اللعبة',
|
|
59
|
+
drawDate: 'تاريخ السحب',
|
|
60
|
+
drawNumbersGridDraw: 'شبكة أرقام السحب',
|
|
61
|
+
drawNumbersGridTicket: 'شبكة أرقام السحب',
|
|
62
|
+
ticketResult: 'نتيجة التذكرة',
|
|
63
|
+
amountWon: 'المبلغ الذي تم ربحه',
|
|
64
|
+
numberOfDraws: 'عدد السحوبات',
|
|
65
|
+
multiplier: 'مضاعف',
|
|
66
|
+
ticketPurchaseDate: 'تاريخ شراء التذكرة',
|
|
67
|
+
ticketStatus: 'حالة التذكرة',
|
|
68
|
+
ticketId: 'معرّف التذكرة',
|
|
69
|
+
ticketAmount: 'مبلغ التذكرة',
|
|
70
|
+
winUpTo: 'ربح يصل إلى'
|
|
71
|
+
}
|
|
38
72
|
};
|
|
39
73
|
export const translate = (key, customLang) => {
|
|
40
74
|
const lang = customLang;
|
|
@@ -20,6 +20,15 @@ const LotteryBullet = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
20
20
|
* Marks if the bullet should be selected
|
|
21
21
|
*/
|
|
22
22
|
this.isSelected = false;
|
|
23
|
+
/**
|
|
24
|
+
* Client custom styling via string
|
|
25
|
+
*/
|
|
26
|
+
this.clientStyling = '';
|
|
27
|
+
/**
|
|
28
|
+
* Client custom styling via url content
|
|
29
|
+
*/
|
|
30
|
+
this.clientStylingUrlContent = '';
|
|
31
|
+
this.limitStylingAppends = false;
|
|
23
32
|
this.select = () => {
|
|
24
33
|
if (this.selectable) {
|
|
25
34
|
this.isSelected = !this.isSelected;
|
|
@@ -29,15 +38,41 @@ const LotteryBullet = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
29
38
|
});
|
|
30
39
|
}
|
|
31
40
|
};
|
|
41
|
+
this.setClientStyling = () => {
|
|
42
|
+
let sheet = document.createElement('style');
|
|
43
|
+
sheet.innerHTML = this.clientStyling;
|
|
44
|
+
this.stylingContainer.prepend(sheet);
|
|
45
|
+
};
|
|
46
|
+
this.setClientStylingURL = () => {
|
|
47
|
+
let cssFile = document.createElement('style');
|
|
48
|
+
setTimeout(() => {
|
|
49
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
50
|
+
this.stylingContainer.prepend(cssFile);
|
|
51
|
+
}, 1);
|
|
52
|
+
};
|
|
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
|
|
32
64
|
}
|
|
33
65
|
render() {
|
|
34
|
-
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select() }, this.value));
|
|
66
|
+
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
|
|
35
67
|
}
|
|
36
68
|
static get style() { return lotteryBulletCss; }
|
|
37
69
|
}, [1, "lottery-bullet", {
|
|
38
70
|
"value": [1],
|
|
39
71
|
"selectable": [4],
|
|
40
|
-
"isSelected": [4, "is-selected"]
|
|
72
|
+
"isSelected": [4, "is-selected"],
|
|
73
|
+
"clientStyling": [1, "client-styling"],
|
|
74
|
+
"clientStylingUrlContent": [1, "client-styling-url-content"],
|
|
75
|
+
"limitStylingAppends": [32]
|
|
41
76
|
}]);
|
|
42
77
|
function defineCustomElement() {
|
|
43
78
|
if (typeof customElements === "undefined") {
|