@everymatrix/lottery-draw-results 0.0.3 → 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/{index-03778cb9.js → index-62f030ff.js} +81 -7
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/lottery-bullet_3.cjs.entry.js +383 -0
- package/dist/cjs/lottery-draw-results.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +15 -2
- 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/index.d.ts +5 -1
- package/dist/components/index.js +0 -1
- package/dist/components/lottery-bullet.js +6 -0
- package/dist/components/lottery-bullet2.js +56 -0
- package/dist/components/lottery-draw-results.js +73 -48
- package/dist/components/lottery-grid.js +6 -0
- package/dist/components/lottery-grid2.js +196 -0
- package/dist/esm/{index-17920f23.js → index-98326ddd.js} +81 -8
- package/dist/esm/loader.js +3 -3
- package/dist/esm/lottery-bullet_3.entry.js +377 -0
- package/dist/esm/lottery-draw-results.js +3 -3
- package/dist/lottery-draw-results/lottery-draw-results.esm.js +1 -1
- package/dist/lottery-draw-results/p-bb429486.js +1 -0
- 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/cjs/lottery-draw-results.cjs.entry.js +0 -179
- package/dist/esm/lottery-draw-results.entry.js +0 -175
- package/dist/lottery-draw-results/p-62092f31.js +0 -2
- package/dist/lottery-draw-results/p-c6628b24.entry.js +0 -1
|
@@ -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": {},
|
|
@@ -10,7 +10,13 @@ const TRANSLATIONS = {
|
|
|
10
10
|
drawNumbersGridTicket: 'Draw numbers Grid B',
|
|
11
11
|
ticketResult: 'Ticket result',
|
|
12
12
|
amountWon: 'Amount won',
|
|
13
|
-
numberOfDraws: 'Number of draws'
|
|
13
|
+
numberOfDraws: 'Number of draws',
|
|
14
|
+
multiplier: 'Multiplier:',
|
|
15
|
+
ticketPurchaseDate: 'Ticket Purchase Date',
|
|
16
|
+
ticketStatus: 'Ticket Status',
|
|
17
|
+
ticketId: 'Ticket ID',
|
|
18
|
+
ticketAmount: 'Ticket Amount',
|
|
19
|
+
winUpTo: 'Win up to',
|
|
14
20
|
},
|
|
15
21
|
ro: {
|
|
16
22
|
drawResultsHeader: 'Ultimele rezultate extragere',
|
|
@@ -21,7 +27,13 @@ const TRANSLATIONS = {
|
|
|
21
27
|
drawNumbersGridTicket: 'Numerele extrase Grid B',
|
|
22
28
|
ticketResult: 'Rezultatul biletului',
|
|
23
29
|
amountWon: 'Suma castigata',
|
|
24
|
-
numberOfDraws: 'Numarul de extrageri'
|
|
30
|
+
numberOfDraws: 'Numarul de extrageri',
|
|
31
|
+
multiplier: 'Multiplicator:',
|
|
32
|
+
ticketPurchaseDate: 'Data achizitionarii biletului',
|
|
33
|
+
ticketStatus: 'Statusul biletului',
|
|
34
|
+
ticketId: 'Id biletul',
|
|
35
|
+
ticketAmount: 'Valoarea biletului',
|
|
36
|
+
winUpTo: 'Poti castiga'
|
|
25
37
|
},
|
|
26
38
|
};
|
|
27
39
|
export const translate = (key, customLang) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* LotteryDrawResults custom elements */
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import type { Components, JSX } from "../types/components";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Used to manually set the base path where assets can be found.
|
|
@@ -19,4 +20,7 @@ export interface SetPlatformOptions {
|
|
|
19
20
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
21
|
}
|
|
21
22
|
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
+
|
|
24
|
+
export type { Components, JSX };
|
|
25
|
+
|
|
22
26
|
export * from '../types';
|
package/dist/components/index.js
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
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}";
|
|
4
|
+
|
|
5
|
+
const LotteryBullet = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.bulletEvent = createEvent(this, "lotteryBulletSelection", 7);
|
|
11
|
+
/**
|
|
12
|
+
* Value of the bullet
|
|
13
|
+
*/
|
|
14
|
+
this.value = '0';
|
|
15
|
+
/**
|
|
16
|
+
* Marks if the bullet should be selectable
|
|
17
|
+
*/
|
|
18
|
+
this.selectable = true;
|
|
19
|
+
/**
|
|
20
|
+
* Marks if the bullet should be selected
|
|
21
|
+
*/
|
|
22
|
+
this.isSelected = false;
|
|
23
|
+
this.select = () => {
|
|
24
|
+
if (this.selectable) {
|
|
25
|
+
this.isSelected = !this.isSelected;
|
|
26
|
+
this.bulletEvent.emit({
|
|
27
|
+
value: this.value,
|
|
28
|
+
selected: this.isSelected
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select() }, this.value));
|
|
35
|
+
}
|
|
36
|
+
static get style() { return lotteryBulletCss; }
|
|
37
|
+
}, [1, "lottery-bullet", {
|
|
38
|
+
"value": [1],
|
|
39
|
+
"selectable": [4],
|
|
40
|
+
"isSelected": [4, "is-selected"]
|
|
41
|
+
}]);
|
|
42
|
+
function defineCustomElement() {
|
|
43
|
+
if (typeof customElements === "undefined") {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const components = ["lottery-bullet"];
|
|
47
|
+
components.forEach(tagName => { switch (tagName) {
|
|
48
|
+
case "lottery-bullet":
|
|
49
|
+
if (!customElements.get(tagName)) {
|
|
50
|
+
customElements.define(tagName, LotteryBullet);
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
} });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { LotteryBullet as L, defineCustomElement as d };
|