@everymatrix/lottery-draw-results 1.44.0 → 1.45.2
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/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-e39715e5.js +1279 -0
- package/dist/cjs/loader.cjs.js +6 -12
- package/dist/cjs/lottery-bullet_3.cjs.entry.js +436 -516
- package/dist/cjs/lottery-draw-results.cjs.js +16 -10
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/lottery-draw-results/index.js +1 -0
- package/dist/collection/components/lottery-draw-results/lottery-draw-results.js +484 -608
- package/dist/collection/utils/locale.utils.js +87 -87
- package/dist/collection/utils/utils.js +1 -1
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-cb2f9906.js +1252 -0
- package/dist/esm/loader.js +6 -12
- package/dist/esm/lottery-bullet_3.entry.js +436 -516
- package/dist/esm/lottery-draw-results.js +13 -10
- package/dist/lottery-draw-results/lottery-draw-results.esm.js +1 -1
- package/dist/lottery-draw-results/p-43abc07f.js +2 -0
- package/dist/lottery-draw-results/p-a12b1856.entry.js +1 -0
- package/dist/lottery-draw-results/p-e1255160.js +1 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-draw-results/.stencil/packages/stencil/lottery-draw-results/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-draw-results/.stencil/packages/stencil/lottery-draw-results/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/lottery-draw-results/index.d.ts +1 -0
- package/dist/types/components/lottery-draw-results/lottery-draw-results.d.ts +95 -95
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +9 -2
- package/dist/cjs/index-40e6760b.js +0 -1252
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/lottery-bullet.js +0 -6
- package/dist/components/lottery-bullet2.js +0 -91
- package/dist/components/lottery-draw-results.d.ts +0 -11
- package/dist/components/lottery-draw-results.js +0 -346
- package/dist/components/lottery-grid.js +0 -6
- package/dist/components/lottery-grid2.js +0 -245
- package/dist/esm/index-3c2823a2.js +0 -1226
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/lottery-draw-results/p-0eb80b2e.js +0 -1
- package/dist/lottery-draw-results/p-ca18f246.entry.js +0 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/lottery-draw-results/.stencil/packages/lottery-draw-results/stencil.config.d.ts +0 -2
|
@@ -2,562 +2,482 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e39715e5.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}@-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,
|
|
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, rgb(255, 255, 255) 0%, rgb(255, 255, 255) 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, rgb(255, 255, 255) 0%, rgb(241, 241, 241) 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
|
+
const LotteryBulletStyle0 = lotteryBulletCss;
|
|
8
9
|
|
|
9
10
|
const LotteryBullet = class {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.isSelected =
|
|
37
|
-
this.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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;
|
|
11
|
+
constructor(hostRef) {
|
|
12
|
+
index.registerInstance(this, hostRef);
|
|
13
|
+
this.bulletEvent = index.createEvent(this, "lotteryBulletSelection", 7);
|
|
14
|
+
this.select = () => {
|
|
15
|
+
if (this.selectable) {
|
|
16
|
+
this.isSelected = !this.isSelected;
|
|
17
|
+
this.bulletEvent.emit({
|
|
18
|
+
value: this.value,
|
|
19
|
+
selected: this.isSelected
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
this.setClientStyling = () => {
|
|
24
|
+
let sheet = document.createElement('style');
|
|
25
|
+
sheet.innerHTML = this.clientStyling;
|
|
26
|
+
this.stylingContainer.prepend(sheet);
|
|
27
|
+
};
|
|
28
|
+
this.setClientStylingURL = () => {
|
|
29
|
+
let cssFile = document.createElement('style');
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
32
|
+
this.stylingContainer.prepend(cssFile);
|
|
33
|
+
}, 1);
|
|
34
|
+
};
|
|
35
|
+
this.value = '0';
|
|
36
|
+
this.selectable = true;
|
|
37
|
+
this.isSelected = false;
|
|
38
|
+
this.clientStyling = '';
|
|
39
|
+
this.clientStylingUrlContent = '';
|
|
40
|
+
this.limitStylingAppends = false;
|
|
41
|
+
}
|
|
42
|
+
componentDidRender() {
|
|
43
|
+
// start custom styling area
|
|
44
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
45
|
+
if (this.clientStyling)
|
|
46
|
+
this.setClientStyling();
|
|
47
|
+
if (this.clientStylingUrlContent)
|
|
48
|
+
this.setClientStylingURL();
|
|
49
|
+
this.limitStylingAppends = true;
|
|
50
|
+
}
|
|
51
|
+
// end custom styling area
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
return (index.h("div", { key: 'af3601684ecf1f39d65fc9461430cba96b9e4b8c', class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
|
|
64
55
|
}
|
|
65
|
-
// end custom styling area
|
|
66
|
-
}
|
|
67
|
-
render() {
|
|
68
|
-
return (index.h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
|
|
69
|
-
}
|
|
70
56
|
};
|
|
71
|
-
LotteryBullet.style =
|
|
57
|
+
LotteryBullet.style = LotteryBulletStyle0;
|
|
72
58
|
|
|
73
59
|
const DEFAULT_LANGUAGE = 'en';
|
|
74
60
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'hr'];
|
|
75
61
|
const TRANSLATIONS = {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
62
|
+
en: {
|
|
63
|
+
drawResultsHeader: 'Last draw results',
|
|
64
|
+
drawId: 'Draw ID',
|
|
65
|
+
drawName: 'Game name',
|
|
66
|
+
drawDate: 'Draw Date',
|
|
67
|
+
drawNumbersGridDraw: 'Draw numbers Grid ',
|
|
68
|
+
drawNumbersGridTicket: 'Draw numbers Grid ',
|
|
69
|
+
ticketResult: 'Ticket result',
|
|
70
|
+
amountWon: 'Amount won',
|
|
71
|
+
numberOfDraws: 'Number of draws',
|
|
72
|
+
multiplier: 'Multiplier:',
|
|
73
|
+
ticketPurchaseDate: 'Ticket Purchase Date',
|
|
74
|
+
ticketStatus: 'Ticket Status',
|
|
75
|
+
ticketId: 'Ticket ID',
|
|
76
|
+
ticketAmount: 'Ticket Amount',
|
|
77
|
+
winUpTo: 'Win up to',
|
|
78
|
+
},
|
|
79
|
+
ro: {
|
|
80
|
+
drawResultsHeader: 'Ultimele rezultate extragere',
|
|
81
|
+
drawId: 'Id extragere',
|
|
82
|
+
drawName: 'Numele jocului',
|
|
83
|
+
drawDate: 'Data extragerii',
|
|
84
|
+
drawNumbersGridDraw: 'Numerele extrase Grid',
|
|
85
|
+
drawNumbersGridTicket: 'Numerele extrase Grid',
|
|
86
|
+
ticketResult: 'Rezultatul biletului',
|
|
87
|
+
amountWon: 'Suma castigata',
|
|
88
|
+
numberOfDraws: 'Numarul de extrageri',
|
|
89
|
+
multiplier: 'Multiplicator:',
|
|
90
|
+
ticketPurchaseDate: 'Data achizitionarii biletului',
|
|
91
|
+
ticketStatus: 'Statusul biletului',
|
|
92
|
+
ticketId: 'Id biletul',
|
|
93
|
+
ticketAmount: 'Valoarea biletului',
|
|
94
|
+
winUpTo: 'Poti castiga'
|
|
95
|
+
},
|
|
96
|
+
fr: {
|
|
97
|
+
drawResultsHeader: 'Résultats du dernier tirage',
|
|
98
|
+
drawId: 'ID de tirage',
|
|
99
|
+
drawName: 'Nom du jeu',
|
|
100
|
+
drawDate: 'Date du tirage',
|
|
101
|
+
drawNumbersGridDraw: 'Tirage des numéros Grille',
|
|
102
|
+
drawNumbersGridTicket: 'Tirage des numéros Grille',
|
|
103
|
+
ticketResult: 'Résultat du ticket',
|
|
104
|
+
amountWon: 'Montant gagné',
|
|
105
|
+
numberOfDraws: 'Nombre de tirages',
|
|
106
|
+
multiplier: 'Multiplicateur',
|
|
107
|
+
ticketPurchaseDate: 'Date d\'achat du billet',
|
|
108
|
+
ticketStatus: 'Statut du ticket',
|
|
109
|
+
ticketId: 'ID de billets',
|
|
110
|
+
ticketAmount: 'Montant du billet',
|
|
111
|
+
winUpTo: 'Gagnez jusqu\'à'
|
|
112
|
+
},
|
|
113
|
+
ar: {
|
|
114
|
+
drawResultsHeader: 'نتائج آخر سحب',
|
|
115
|
+
drawId: 'معرّف السحب',
|
|
116
|
+
drawName: 'اسم اللعبة',
|
|
117
|
+
drawDate: 'تاريخ السحب',
|
|
118
|
+
drawNumbersGridDraw: 'شبكة أرقام السحب',
|
|
119
|
+
drawNumbersGridTicket: 'شبكة أرقام السحب',
|
|
120
|
+
ticketResult: 'نتيجة التذكرة',
|
|
121
|
+
amountWon: 'المبلغ الذي تم ربحه',
|
|
122
|
+
numberOfDraws: 'عدد السحوبات',
|
|
123
|
+
multiplier: 'مضاعف',
|
|
124
|
+
ticketPurchaseDate: 'تاريخ شراء التذكرة',
|
|
125
|
+
ticketStatus: 'حالة التذكرة',
|
|
126
|
+
ticketId: 'معرّف التذكرة',
|
|
127
|
+
ticketAmount: 'مبلغ التذكرة',
|
|
128
|
+
winUpTo: 'ربح يصل إلى'
|
|
129
|
+
},
|
|
130
|
+
hr: {
|
|
131
|
+
drawResultsHeader: 'Rezultati posljednjeg izvlačenja',
|
|
132
|
+
drawId: 'ID izvlačenja',
|
|
133
|
+
drawName: 'Naziv igre',
|
|
134
|
+
drawDate: 'Datum izvlačenja',
|
|
135
|
+
drawNumbersGridDraw: 'Tablica izvučenih brojeva',
|
|
136
|
+
drawNumbersGridTicket: 'Tablica izvučenih brojeva',
|
|
137
|
+
ticketResult: 'Rezultat listića',
|
|
138
|
+
amountWon: 'Osvojeni iznos',
|
|
139
|
+
numberOfDraws: 'Broj izvlačenja',
|
|
140
|
+
multiplier: 'Multiplikator',
|
|
141
|
+
ticketPurchaseDate: 'Datum uplate listića',
|
|
142
|
+
ticketStatus: 'Status listića',
|
|
143
|
+
ticketId: 'ID listića',
|
|
144
|
+
ticketAmount: 'Iznos listića',
|
|
145
|
+
winUpTo: 'Osvoji do'
|
|
146
|
+
},
|
|
161
147
|
};
|
|
162
148
|
const translate = (key, customLang) => {
|
|
163
|
-
|
|
164
|
-
|
|
149
|
+
const lang = customLang;
|
|
150
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
165
151
|
};
|
|
166
152
|
|
|
167
153
|
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{display:flex;flex-direction:column;gap:5px}.DrawNumbersGrid label{display:block;margin-bottom:7px}.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;border:1px solid #ccc;border-radius:5px;background-color:white}.ExpandableBox{border-bottom:1px solid #ccc;transition:height 300ms ease-in-out;overflow:hidden;height:80px}.ExpandableBox:last-child{border-bottom:0}.ExpandableBoxHeader{position:relative;list-style:none;outline:0;cursor:pointer;text-transform:uppercase;transition:color 300ms ease-in-out;margin-bottom:24px;margin-left:5px}.ShowBox>.ExpandableBoxHeader{color:#009993}.ExpandableBoxHeader::-webkit-details-marker{display:none}.ExpandableBoxHeader:before,.ExpandableBoxHeader:after{content:\"\";position:absolute}.ExpandableBoxHeader:before{right:21px;top:50%;height:2px;margin-top:-1px;width:16px;background:#009993}.ExpandableBoxHeader:after{right:28px;top:50%;height:16px;margin-top:-8px;width:2px;margin-left:-1px;background:#009993;transition:all 300ms ease-in-out}.ShowBox .ExpandableBoxHeader:after{opacity:0;transform:translateY(25%)}.ExpandableBoxBody{padding-top:0;font-weight:lighter;margin-left:5px}.ExpandableBox.ShowBox{height:300px}";
|
|
154
|
+
const LotteryDrawResultsStyle0 = lotteryDrawResultsCss;
|
|
168
155
|
|
|
169
156
|
const LotteryDrawResults = class {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
*/
|
|
215
|
-
this.ticketNumbers = '';
|
|
216
|
-
/**
|
|
217
|
-
* The session id
|
|
218
|
-
*/
|
|
219
|
-
this.sessionId = '';
|
|
220
|
-
/**
|
|
221
|
-
* Client custom styling via string
|
|
222
|
-
*/
|
|
223
|
-
this.clientStyling = '';
|
|
224
|
-
/**
|
|
225
|
-
* Client custom styling via url content
|
|
226
|
-
*/
|
|
227
|
-
this.clientStylingUrlContent = '';
|
|
228
|
-
/**
|
|
229
|
-
* Data showing the ticket's draw results details
|
|
230
|
-
*/
|
|
231
|
-
this.ticketDrawData = '';
|
|
232
|
-
this.multiplier = 3;
|
|
233
|
-
this.isLoading = true;
|
|
234
|
-
this.hasErrors = false;
|
|
235
|
-
this.errorText = '';
|
|
236
|
-
this.ticketData = [];
|
|
237
|
-
this.ticketDataLoaded = false;
|
|
238
|
-
this.ticketDraws = [];
|
|
239
|
-
this.toggleDrawer = [false];
|
|
240
|
-
this.limitStylingAppends = false;
|
|
241
|
-
this.ticketDrawDetails = [];
|
|
242
|
-
this.ticketDrawDetailsFlag = true;
|
|
243
|
-
this.setClientStyling = () => {
|
|
244
|
-
let sheet = document.createElement('style');
|
|
245
|
-
sheet.innerHTML = this.clientStyling;
|
|
246
|
-
this.stylingContainer.prepend(sheet);
|
|
247
|
-
};
|
|
248
|
-
this.setClientStylingURL = () => {
|
|
249
|
-
let cssFile = document.createElement('style');
|
|
250
|
-
setTimeout(() => {
|
|
251
|
-
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
252
|
-
this.stylingContainer.prepend(cssFile);
|
|
253
|
-
}, 1);
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
connectedCallback() {
|
|
257
|
-
let promises = [];
|
|
258
|
-
// Split ticket numbers for each grid
|
|
259
|
-
if (this.ticketNumbers) {
|
|
260
|
-
this.gridNumbers = JSON.parse(this.ticketNumbers);
|
|
261
|
-
}
|
|
262
|
-
if (this.drawId) {
|
|
263
|
-
promises.push(this.getDrawData());
|
|
264
|
-
}
|
|
265
|
-
Promise.all(promises)
|
|
266
|
-
.then(() => {
|
|
267
|
-
this.isLoading = false;
|
|
268
|
-
}).catch((err) => {
|
|
269
|
-
console.log('error ', err);
|
|
270
|
-
this.isLoading = false;
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
componentWillRender() {
|
|
274
|
-
if (this.ticketDrawData && this.ticketDrawDetailsFlag) {
|
|
275
|
-
this.ticketDrawDetails = JSON.parse(this.ticketDrawData);
|
|
276
|
-
this.ticketDrawDetails.forEach((drawDetail) => {
|
|
277
|
-
this.getDrawData(drawDetail.drawId).then((drawData) => drawDetail.drawData = drawData);
|
|
278
|
-
});
|
|
279
|
-
this.ticketDrawDetailsFlag = false;
|
|
157
|
+
constructor(hostRef) {
|
|
158
|
+
index.registerInstance(this, hostRef);
|
|
159
|
+
this.ticketDrawDetails = [];
|
|
160
|
+
this.ticketDrawDetailsFlag = true;
|
|
161
|
+
this.setClientStyling = () => {
|
|
162
|
+
let sheet = document.createElement('style');
|
|
163
|
+
sheet.innerHTML = this.clientStyling;
|
|
164
|
+
this.stylingContainer.prepend(sheet);
|
|
165
|
+
};
|
|
166
|
+
this.setClientStylingURL = () => {
|
|
167
|
+
let cssFile = document.createElement('style');
|
|
168
|
+
setTimeout(() => {
|
|
169
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
170
|
+
this.stylingContainer.prepend(cssFile);
|
|
171
|
+
}, 1);
|
|
172
|
+
};
|
|
173
|
+
this.endpoint = undefined;
|
|
174
|
+
this.gameId = undefined;
|
|
175
|
+
this.language = 'en';
|
|
176
|
+
this.playerId = undefined;
|
|
177
|
+
this.drawMode = false;
|
|
178
|
+
this.drawId = '';
|
|
179
|
+
this.gameName = '';
|
|
180
|
+
this.ticketDate = '';
|
|
181
|
+
this.ticketStatus = '';
|
|
182
|
+
this.ticketId = '';
|
|
183
|
+
this.ticketAmount = '';
|
|
184
|
+
this.ticketMultiplier = false;
|
|
185
|
+
this.ticketDrawCount = 0;
|
|
186
|
+
this.ticketNumbers = '';
|
|
187
|
+
this.sessionId = '';
|
|
188
|
+
this.clientStyling = '';
|
|
189
|
+
this.clientStylingUrlContent = '';
|
|
190
|
+
this.ticketDrawData = '';
|
|
191
|
+
this.multiplier = 3;
|
|
192
|
+
this.isLoading = true;
|
|
193
|
+
this.hasErrors = false;
|
|
194
|
+
this.errorText = '';
|
|
195
|
+
this.ticketData = [];
|
|
196
|
+
this.ticketDataLoaded = false;
|
|
197
|
+
this.ticketDraws = [];
|
|
198
|
+
this.toggleDrawer = [false];
|
|
199
|
+
this.limitStylingAppends = false;
|
|
200
|
+
this.drawData = undefined;
|
|
280
201
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
202
|
+
connectedCallback() {
|
|
203
|
+
let promises = [];
|
|
204
|
+
// Split ticket numbers for each grid
|
|
205
|
+
if (this.ticketNumbers) {
|
|
206
|
+
this.gridNumbers = JSON.parse(this.ticketNumbers);
|
|
207
|
+
}
|
|
208
|
+
if (this.drawId) {
|
|
209
|
+
promises.push(this.getDrawData());
|
|
210
|
+
}
|
|
211
|
+
Promise.all(promises)
|
|
212
|
+
.then(() => {
|
|
213
|
+
this.isLoading = false;
|
|
214
|
+
}).catch((err) => {
|
|
215
|
+
console.log('error ', err);
|
|
216
|
+
this.isLoading = false;
|
|
217
|
+
});
|
|
290
218
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
.then((response) => {
|
|
299
|
-
// @TODO EXCEPTIONS
|
|
300
|
-
return response.json();
|
|
301
|
-
})
|
|
302
|
-
.then((data) => {
|
|
303
|
-
if (drawId) {
|
|
304
|
-
resolve(data);
|
|
219
|
+
componentWillRender() {
|
|
220
|
+
if (this.ticketDrawData && this.ticketDrawDetailsFlag) {
|
|
221
|
+
this.ticketDrawDetails = JSON.parse(this.ticketDrawData);
|
|
222
|
+
this.ticketDrawDetails.forEach((drawDetail) => {
|
|
223
|
+
this.getDrawData(drawDetail.drawId).then((drawData) => drawDetail.drawData = drawData);
|
|
224
|
+
});
|
|
225
|
+
this.ticketDrawDetailsFlag = false;
|
|
305
226
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
227
|
+
}
|
|
228
|
+
componentDidRender() {
|
|
229
|
+
// start custom styling area
|
|
230
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
231
|
+
if (this.clientStyling)
|
|
232
|
+
this.setClientStyling();
|
|
233
|
+
if (this.clientStylingUrlContent)
|
|
234
|
+
this.setClientStylingURL();
|
|
235
|
+
this.limitStylingAppends = true;
|
|
309
236
|
}
|
|
310
|
-
|
|
311
|
-
})
|
|
312
|
-
.catch((err) => {
|
|
313
|
-
reject(err);
|
|
314
|
-
this.isLoading = false;
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
drawerToggle(index) {
|
|
319
|
-
this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
|
|
320
|
-
if (itemIndex == index) {
|
|
321
|
-
return !item;
|
|
322
|
-
}
|
|
323
|
-
return item;
|
|
324
|
-
});
|
|
325
|
-
if (index >= this.toggleDrawer.length) {
|
|
326
|
-
this.toggleDrawer.push(true);
|
|
237
|
+
// end custom styling area
|
|
327
238
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
239
|
+
getDrawData(drawId) {
|
|
240
|
+
this.isLoading = true;
|
|
241
|
+
return new Promise((resolve, reject) => {
|
|
242
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawId ? drawId : this.drawId}`);
|
|
243
|
+
fetch(url.href)
|
|
244
|
+
.then((response) => {
|
|
245
|
+
// @TODO EXCEPTIONS
|
|
246
|
+
return response.json();
|
|
247
|
+
})
|
|
248
|
+
.then((data) => {
|
|
249
|
+
if (drawId) {
|
|
250
|
+
resolve(data);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
this.drawData = data;
|
|
254
|
+
resolve(true);
|
|
255
|
+
}
|
|
256
|
+
this.isLoading = false;
|
|
257
|
+
})
|
|
258
|
+
.catch((err) => {
|
|
259
|
+
reject(err);
|
|
260
|
+
this.isLoading = false;
|
|
261
|
+
});
|
|
262
|
+
});
|
|
332
263
|
}
|
|
333
|
-
|
|
334
|
-
|
|
264
|
+
drawerToggle(index) {
|
|
265
|
+
this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
|
|
266
|
+
if (itemIndex == index) {
|
|
267
|
+
return !item;
|
|
268
|
+
}
|
|
269
|
+
return item;
|
|
270
|
+
});
|
|
271
|
+
if (index >= this.toggleDrawer.length) {
|
|
272
|
+
this.toggleDrawer.push(true);
|
|
273
|
+
}
|
|
335
274
|
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
index.h("div", { class: "
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
275
|
+
render() {
|
|
276
|
+
if (this.isLoading) {
|
|
277
|
+
return (index.h("p", null, "Loading, please wait ..."));
|
|
278
|
+
}
|
|
279
|
+
else if (this.hasErrors) {
|
|
280
|
+
index.h("p", null, this.errorText);
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
return (index.h("section", { class: "DrawResultsSection", ref: el => this.stylingContainer = el }, this.drawMode ?
|
|
284
|
+
index.h("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
285
|
+
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", { "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))))))
|
|
286
|
+
:
|
|
287
|
+
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" }, this.gridNumbers.map((grid, index$1) => index.h("div", null, index.h("label", { class: "Label" }, translate('drawNumbersGridTicket', this.language), " ", String.fromCharCode(index$1 + 65), ":"), index.h("div", { class: "BulletContainer" }, index.h("lottery-grid", { "selected-numbers": grid.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.ticketDrawDetails && this.ticketDrawDetails.length > 0 &&
|
|
288
|
+
index.h("div", { class: "ExpandableBoxes" }, this.ticketDrawDetails.map((drawDetail, index$1) => {
|
|
289
|
+
var _a, _b, _c, _d, _e;
|
|
290
|
+
return index.h("div", { class: { 'ExpandableBox': true, 'ShowBox': this.toggleDrawer[index$1] }, onClick: () => this.drawerToggle(index$1) }, index.h("div", { class: "ExpandableBoxHeader" }, index.h("div", { class: "TicketResultContainer" }, index.h("p", null, translate('ticketResult', this.language), ": ", drawDetail.state)), drawDetail.state == 'won' &&
|
|
291
|
+
index.h("div", { class: "AmountWonContainer" }, index.h("p", null, translate('amountWon', this.language), ": ", Number(drawDetail.amount).toLocaleString('en'), " ", drawDetail.currency)), drawDetail.state == 'lost' &&
|
|
292
|
+
index.h("div", { class: "DrawIdContainer" }, index.h("p", null, translate('drawId', this.language), ": ", drawDetail.drawId))), index.h("div", { class: "ExpandableBoxBody" }, index.h("div", { class: "DrawIdContainer" }, index.h("p", null, translate('drawId', this.language), ": ", drawDetail.drawId)), index.h("div", { class: "DrawDateContainer" }, index.h("p", null, translate('drawDate', this.language), ": ", (_a = drawDetail.drawData) === null || _a === void 0 ? void 0 :
|
|
293
|
+
_a.date.slice(0, 10), " | ", (_b = drawDetail.drawData) === null || _b === void 0 ? void 0 :
|
|
294
|
+
_b.date.slice(11, 19))), index.h("div", { class: "DrawNumbersGrid" }, drawDetail.drawData &&
|
|
295
|
+
index.h("div", { class: 'BulletContainer' }, index.h("label", { class: "Label" }, translate('drawNumbersGridDraw', this.language), " ", String.fromCharCode(index$1 + 10), ":"), index.h("lottery-grid", { "selected-numbers": (_d = (_c = drawDetail.drawData) === null || _c === void 0 ? void 0 : _c.winningNumbers) === null || _d === void 0 ? void 0 : _d.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), " ", (_e = drawDetail.drawData) === null || _e === void 0 ? void 0 :
|
|
296
|
+
_e.multiplier))));
|
|
297
|
+
}))))))));
|
|
298
|
+
}
|
|
352
299
|
}
|
|
353
|
-
}
|
|
354
300
|
};
|
|
355
|
-
LotteryDrawResults.style =
|
|
301
|
+
LotteryDrawResults.style = LotteryDrawResultsStyle0;
|
|
356
302
|
|
|
357
303
|
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}";
|
|
304
|
+
const LotteryGridStyle0 = lotteryGridCss;
|
|
358
305
|
|
|
359
306
|
const LotteryGrid = class {
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* Personalize grid for ticket
|
|
394
|
-
*/
|
|
395
|
-
this.gridType = '';
|
|
396
|
-
/**
|
|
397
|
-
* Client custom styling via string
|
|
398
|
-
*/
|
|
399
|
-
this.clientStyling = '';
|
|
400
|
-
/**
|
|
401
|
-
* Client custom styling via url content
|
|
402
|
-
*/
|
|
403
|
-
this.clientStylingUrlContent = '';
|
|
404
|
-
this.numbers = [];
|
|
405
|
-
this.limitStylingAppends = false;
|
|
406
|
-
this.selectedCounter = 0;
|
|
407
|
-
this.setClientStyling = () => {
|
|
408
|
-
let sheet = document.createElement('style');
|
|
409
|
-
sheet.innerHTML = this.clientStyling;
|
|
410
|
-
this.stylingContainer.prepend(sheet);
|
|
411
|
-
};
|
|
412
|
-
this.setClientStylingURL = () => {
|
|
413
|
-
let cssFile = document.createElement('style');
|
|
414
|
-
setTimeout(() => {
|
|
415
|
-
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
416
|
-
this.stylingContainer.prepend(cssFile);
|
|
417
|
-
}, 1);
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
connectedCallback() {
|
|
421
|
-
let selected = [];
|
|
422
|
-
if (this.selectedNumbers.length > 0) {
|
|
423
|
-
selected = this.selectedNumbers.split(',');
|
|
424
|
-
this.selectedCounter = selected.length;
|
|
425
|
-
}
|
|
426
|
-
if (this.displaySelected) {
|
|
427
|
-
selected.forEach((item) => {
|
|
428
|
-
this.numbers.push({
|
|
429
|
-
number: item,
|
|
430
|
-
selected: true,
|
|
431
|
-
selectable: this.selectable
|
|
432
|
-
});
|
|
433
|
-
});
|
|
307
|
+
constructor(hostRef) {
|
|
308
|
+
index.registerInstance(this, hostRef);
|
|
309
|
+
this.gridFilledEvent = index.createEvent(this, "gridFilled", 7);
|
|
310
|
+
this.gridDirtyEvent = index.createEvent(this, "gridDirty", 7);
|
|
311
|
+
this.selectedCounter = 0;
|
|
312
|
+
this.setClientStyling = () => {
|
|
313
|
+
let sheet = document.createElement('style');
|
|
314
|
+
sheet.innerHTML = this.clientStyling;
|
|
315
|
+
this.stylingContainer.prepend(sheet);
|
|
316
|
+
};
|
|
317
|
+
this.setClientStylingURL = () => {
|
|
318
|
+
let cssFile = document.createElement('style');
|
|
319
|
+
setTimeout(() => {
|
|
320
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
321
|
+
this.stylingContainer.prepend(cssFile);
|
|
322
|
+
}, 1);
|
|
323
|
+
};
|
|
324
|
+
this.ticketId = undefined;
|
|
325
|
+
this.totalNumbers = 0;
|
|
326
|
+
this.gameId = undefined;
|
|
327
|
+
this.maximumAllowed = 0;
|
|
328
|
+
this.minimumAllowed = 1;
|
|
329
|
+
this.selectable = true;
|
|
330
|
+
this.selectedNumbers = '';
|
|
331
|
+
this.displaySelected = false;
|
|
332
|
+
this.language = 'en';
|
|
333
|
+
this.gridIndex = undefined;
|
|
334
|
+
this.gridType = '';
|
|
335
|
+
this.clientStyling = '';
|
|
336
|
+
this.clientStylingUrlContent = '';
|
|
337
|
+
this.numbers = [];
|
|
338
|
+
this.limitStylingAppends = false;
|
|
434
339
|
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
340
|
+
connectedCallback() {
|
|
341
|
+
let selected = [];
|
|
342
|
+
if (this.selectedNumbers.length > 0) {
|
|
343
|
+
selected = this.selectedNumbers.split(',');
|
|
344
|
+
this.selectedCounter = selected.length;
|
|
345
|
+
}
|
|
346
|
+
if (this.displaySelected) {
|
|
347
|
+
selected.forEach((item) => {
|
|
348
|
+
this.numbers.push({
|
|
349
|
+
number: item,
|
|
350
|
+
selected: true,
|
|
351
|
+
selectable: this.selectable
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
[...Array(this.totalNumbers).keys()]
|
|
357
|
+
.map(number => (number + 1).toString())
|
|
358
|
+
.forEach((number) => {
|
|
359
|
+
this.numbers.push({
|
|
360
|
+
number,
|
|
361
|
+
selected: selected.indexOf(number) >= 0 ? true : false,
|
|
362
|
+
selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
}
|
|
445
366
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
367
|
+
componentDidRender() {
|
|
368
|
+
// start custom styling area
|
|
369
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
370
|
+
if (this.clientStyling)
|
|
371
|
+
this.setClientStyling();
|
|
372
|
+
if (this.clientStylingUrlContent)
|
|
373
|
+
this.setClientStylingURL();
|
|
374
|
+
this.limitStylingAppends = true;
|
|
375
|
+
}
|
|
376
|
+
// end custom styling area
|
|
455
377
|
}
|
|
456
|
-
//
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
378
|
+
// wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
|
|
379
|
+
shuffleArray(array) {
|
|
380
|
+
const result = [];
|
|
381
|
+
while (array.length > 0) {
|
|
382
|
+
const randomIndex = Math.floor(Math.random() * (array.length));
|
|
383
|
+
result.push(array.splice(randomIndex, 1)[0]);
|
|
384
|
+
}
|
|
385
|
+
return result;
|
|
464
386
|
}
|
|
465
|
-
|
|
466
|
-
}
|
|
467
|
-
lotteryBulletSelectionHandler(event) {
|
|
468
|
-
this.numbers = this.numbers.map((item) => {
|
|
469
|
-
if (item.number == event.detail.value) {
|
|
470
|
-
return {
|
|
471
|
-
number: item.number,
|
|
472
|
-
selected: event.detail.selected,
|
|
473
|
-
selectable: item.selectable
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
return {
|
|
477
|
-
number: item.number,
|
|
478
|
-
selected: item.selected,
|
|
479
|
-
selectable: item.selectable
|
|
480
|
-
};
|
|
481
|
-
});
|
|
482
|
-
if (event.detail.selected) {
|
|
483
|
-
this.selectedCounter += 1;
|
|
484
|
-
if (this.selectedCounter == this.maximumAllowed) {
|
|
387
|
+
lotteryBulletSelectionHandler(event) {
|
|
485
388
|
this.numbers = this.numbers.map((item) => {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
389
|
+
if (item.number == event.detail.value) {
|
|
390
|
+
return {
|
|
391
|
+
number: item.number,
|
|
392
|
+
selected: event.detail.selected,
|
|
393
|
+
selectable: item.selectable
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
return {
|
|
397
|
+
number: item.number,
|
|
398
|
+
selected: item.selected,
|
|
399
|
+
selectable: item.selectable
|
|
400
|
+
};
|
|
491
401
|
});
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
402
|
+
if (event.detail.selected) {
|
|
403
|
+
this.selectedCounter += 1;
|
|
404
|
+
if (this.selectedCounter == this.maximumAllowed) {
|
|
405
|
+
this.numbers = this.numbers.map((item) => {
|
|
406
|
+
return {
|
|
407
|
+
number: item.number,
|
|
408
|
+
selected: item.selected,
|
|
409
|
+
selectable: item.selected ? true : false
|
|
410
|
+
};
|
|
411
|
+
});
|
|
412
|
+
this.gridFilledEvent.emit({
|
|
413
|
+
id: this.ticketId,
|
|
414
|
+
index: this.gridIndex,
|
|
415
|
+
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
if (this.selectedCounter == this.maximumAllowed) {
|
|
421
|
+
this.numbers = this.numbers.map((item) => {
|
|
422
|
+
return {
|
|
423
|
+
number: item.number,
|
|
424
|
+
selected: item.selected,
|
|
425
|
+
selectable: true
|
|
426
|
+
};
|
|
427
|
+
});
|
|
428
|
+
this.gridDirtyEvent.emit({
|
|
429
|
+
id: this.ticketId,
|
|
430
|
+
index: this.gridIndex,
|
|
431
|
+
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
this.selectedCounter -= 1;
|
|
435
|
+
}
|
|
498
436
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
437
|
+
async resetSelectionHandler(event) {
|
|
438
|
+
if (event.detail && event.detail == this.ticketId) {
|
|
439
|
+
this.selectedCounter = 0;
|
|
440
|
+
this.numbers = this.numbers.map((item) => {
|
|
441
|
+
return {
|
|
442
|
+
number: item.number,
|
|
443
|
+
selected: false,
|
|
444
|
+
selectable: this.selectable
|
|
445
|
+
};
|
|
446
|
+
});
|
|
447
|
+
this.gridDirtyEvent.emit({
|
|
448
|
+
id: this.ticketId,
|
|
449
|
+
index: this.gridIndex,
|
|
450
|
+
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
451
|
+
});
|
|
452
|
+
}
|
|
515
453
|
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
454
|
+
async autoSelectionHandler(event) {
|
|
455
|
+
if (event.detail && event.detail == this.ticketId) {
|
|
456
|
+
this.resetSelectionHandler(event);
|
|
457
|
+
let array = [...Array(this.totalNumbers).keys()]
|
|
458
|
+
.map(number => number + 1);
|
|
459
|
+
array = this.shuffleArray(array);
|
|
460
|
+
array = array.slice(0, this.minimumAllowed);
|
|
461
|
+
this.numbers = this.numbers.map((item) => {
|
|
462
|
+
return {
|
|
463
|
+
number: item.number,
|
|
464
|
+
selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
465
|
+
selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
466
|
+
};
|
|
467
|
+
});
|
|
468
|
+
this.gridFilledEvent.emit({
|
|
469
|
+
id: this.ticketId,
|
|
470
|
+
index: this.gridIndex,
|
|
471
|
+
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
472
|
+
});
|
|
473
|
+
this.selectedCounter = this.maximumAllowed;
|
|
474
|
+
}
|
|
532
475
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
if (event.detail && event.detail == this.ticketId) {
|
|
536
|
-
this.resetSelectionHandler(event);
|
|
537
|
-
let array = [...Array(this.totalNumbers).keys()]
|
|
538
|
-
.map(number => number + 1);
|
|
539
|
-
array = this.shuffleArray(array);
|
|
540
|
-
array = array.slice(0, this.minimumAllowed);
|
|
541
|
-
this.numbers = this.numbers.map((item) => {
|
|
542
|
-
return {
|
|
543
|
-
number: item.number,
|
|
544
|
-
selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
545
|
-
selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
546
|
-
};
|
|
547
|
-
});
|
|
548
|
-
this.gridFilledEvent.emit({
|
|
549
|
-
id: this.ticketId,
|
|
550
|
-
index: this.gridIndex,
|
|
551
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
552
|
-
});
|
|
553
|
-
this.selectedCounter = this.maximumAllowed;
|
|
476
|
+
render() {
|
|
477
|
+
return (index.h("div", { key: '54b9187146b5d2625fd5ce7f53f38abf091cd943', class: "GridContainer", ref: el => this.stylingContainer = el }, index.h("div", { key: 'e7e8570557ebaa78edf881cdbc1ed720028cdf6e', 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 }))))));
|
|
554
478
|
}
|
|
555
|
-
}
|
|
556
|
-
render() {
|
|
557
|
-
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 }))))));
|
|
558
|
-
}
|
|
559
479
|
};
|
|
560
|
-
LotteryGrid.style =
|
|
480
|
+
LotteryGrid.style = LotteryGridStyle0;
|
|
561
481
|
|
|
562
482
|
exports.lottery_bullet = LotteryBullet;
|
|
563
483
|
exports.lottery_draw_results = LotteryDrawResults;
|