@everymatrix/lottery-draw-results 0.1.6 → 0.1.20

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.
Files changed (28) hide show
  1. package/dist/cjs/{index-33a98fae.js → index-43800d3c.js} +90 -1
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/lottery-bullet_3.cjs.entry.js +478 -0
  4. package/dist/cjs/lottery-draw-results.cjs.js +2 -2
  5. package/dist/collection/collection-manifest.json +12 -5
  6. package/dist/collection/components/lottery-draw-results/lottery-draw-results.css +36 -13
  7. package/dist/collection/components/lottery-draw-results/lottery-draw-results.js +261 -100
  8. package/dist/collection/utils/locale.utils.js +4 -4
  9. package/dist/components/lottery-bullet.js +6 -0
  10. package/dist/components/lottery-bullet2.js +56 -0
  11. package/dist/components/lottery-draw-results.js +131 -18
  12. package/dist/components/lottery-grid.js +6 -0
  13. package/dist/components/lottery-grid2.js +196 -0
  14. package/dist/esm/{index-c6e6b7f8.js → index-9547eb6c.js} +90 -2
  15. package/dist/esm/loader.js +2 -2
  16. package/dist/esm/lottery-bullet_3.entry.js +472 -0
  17. package/dist/esm/lottery-draw-results.js +2 -2
  18. package/dist/lottery-draw-results/lottery-draw-results.esm.js +1 -1
  19. package/dist/lottery-draw-results/p-9678a673.entry.js +1 -0
  20. package/dist/lottery-draw-results/p-e1cb3144.js +1 -0
  21. package/dist/stencil.config.js +0 -3
  22. package/dist/types/components/lottery-draw-results/lottery-draw-results.d.ts +27 -3
  23. package/dist/types/components.d.ts +32 -0
  24. package/package.json +5 -2
  25. package/dist/cjs/lottery-draw-results.cjs.entry.js +0 -188
  26. package/dist/esm/lottery-draw-results.entry.js +0 -184
  27. package/dist/lottery-draw-results/p-31e0953f.js +0 -1
  28. package/dist/lottery-draw-results/p-d7361a7b.entry.js +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-33a98fae.js');
3
+ const index = require('./index-43800d3c.js');
4
4
 
5
5
  /*
6
6
  Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["lottery-draw-results.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]}]]]], options);
18
+ return index.bootstrapLazy([["lottery-bullet_3.cjs",[[1,"lottery-draw-results",{"endpoint":[1],"gameId":[1,"game-id"],"language":[1],"playerId":[1,"player-id"],"drawMode":[4,"draw-mode"],"drawId":[1,"draw-id"],"gameName":[1,"game-name"],"ticketDate":[1,"ticket-date"],"ticketStatus":[1,"ticket-status"],"ticketId":[1,"ticket-id"],"ticketAmount":[1,"ticket-amount"],"ticketMultiplier":[4,"ticket-multiplier"],"ticketDrawCount":[2,"ticket-draw-count"],"ticketNumbers":[1,"ticket-numbers"],"sessionId":[1,"session-id"],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"multiplier":[32],"isLoading":[32],"rules":[32],"toggleDrawer":[32],"hasErrors":[32],"errorText":[32],"ticketData":[32],"ticketDataLoaded":[32],"ticketDraws":[32],"hasDrawNumbers":[32],"limitStylingAppends":[32]}],[1,"lottery-grid",{"ticketId":[2,"ticket-id"],"totalNumbers":[2,"total-numbers"],"gameId":[1,"game-id"],"maximumAllowed":[2,"maximum-allowed"],"minimumAllowed":[2,"minimum-allowed"],"selectable":[4],"selectedNumbers":[1,"selected-numbers"],"displaySelected":[4,"display-selected"],"language":[1],"gridIndex":[2,"grid-index"],"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
  });
@@ -7,12 +7,19 @@
7
7
  "version": "2.15.2",
8
8
  "typescriptVersion": "4.5.4"
9
9
  },
10
- "collections": [],
11
- "bundles": [
10
+ "collections": [
12
11
  {
13
- "components": [
14
- "lottery-draw-results"
12
+ "name": "@everymatrix/lottery-bullet",
13
+ "tags": [
14
+ "lottery-bullet"
15
+ ]
16
+ },
17
+ {
18
+ "name": "@everymatrix/lottery-grid",
19
+ "tags": [
20
+ "lottery-grid"
15
21
  ]
16
22
  }
17
- ]
23
+ ],
24
+ "bundles": []
18
25
  }
@@ -17,6 +17,16 @@
17
17
  .DrawResultsArea {
18
18
  margin-top: 15px;
19
19
  }
20
+ .DrawResultsArea.TicketDraws .Content {
21
+ padding: 0;
22
+ border: 0;
23
+ }
24
+ .DrawResultsArea.TicketDraws .DrawResultsBody {
25
+ padding: 0;
26
+ margin-bottom: 5px;
27
+ border-radius: 0;
28
+ border: 0;
29
+ }
20
30
 
21
31
  .DrawResultsSection {
22
32
  max-width: 600px;
@@ -40,25 +50,28 @@
40
50
  padding-top: 15px;
41
51
  }
42
52
 
43
- .DrawMultipler label {
44
- display: block;
45
- margin: 15px 0;
46
- }
47
-
48
53
  .DrawResultsBody {
49
- padding: 0px 20px;
54
+ padding: 20px;
50
55
  margin-bottom: 5px;
51
56
  border-radius: 0 0 4px 4px;
52
57
  border: 1px solid #009993;
53
58
  }
54
- .DrawResultsBody .DrawNumbersGrid {
55
- font-size: 14px;
59
+ .DrawResultsBody > div {
60
+ margin: 10px 0;
56
61
  }
57
62
  .DrawResultsBody .NumberOfDrawsContainer {
58
63
  display: table;
59
64
  width: 100%;
60
65
  }
61
66
 
67
+ .DrawNumbersGrid {
68
+ margin-bottom: 15px;
69
+ }
70
+ .DrawNumbersGrid label {
71
+ display: block;
72
+ margin-bottom: 10px;
73
+ }
74
+
62
75
  .Toggle {
63
76
  cursor: pointer;
64
77
  display: inline-block;
@@ -109,17 +122,23 @@
109
122
  }
110
123
 
111
124
  .Label {
112
- margin-right: 5px;
113
125
  position: relative;
114
- top: 2px;
115
126
  }
116
127
 
117
128
  .DrawTicketsContainer {
118
- margin: 30px auto;
129
+ display: flex;
130
+ flex-direction: column;
131
+ margin: 20px auto 0;
132
+ }
133
+
134
+ .DrawMultipler {
135
+ margin-top: 15px;
119
136
  }
120
137
 
121
138
  .ExpandableBoxes {
122
139
  position: relative;
140
+ display: flex;
141
+ flex-direction: column;
123
142
  }
124
143
 
125
144
  .ExpandableBox {
@@ -127,13 +146,14 @@
127
146
  font-weight: lighter;
128
147
  width: 100%;
129
148
  height: 100%;
130
- max-height: 70px;
149
+ max-height: 80px;
131
150
  float: left;
132
151
  margin: 0 0 20px 0;
133
- border: 1px solid #f1f1f1;
152
+ border: 1px solid #009993;
134
153
  background: #fff;
135
154
  border-radius: 4px;
136
155
  padding: 10px;
156
+ box-sizing: border-box;
137
157
  -webkit-transition: all 0.6s ease-in-out;
138
158
  -moz-transition: all 0.6s ease-in-out;
139
159
  -o-transition: all 0.6s ease-in-out;
@@ -142,6 +162,9 @@
142
162
  overflow: hidden;
143
163
  box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
144
164
  }
165
+ .ExpandableBox:last-of-type {
166
+ margin-bottom: 0;
167
+ }
145
168
 
146
169
  .ExpandableBox.ShowBox {
147
170
  max-height: 400px;
@@ -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
- getDrawData() {
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" }, !this.drawMode ?
128
- h("div", { class: "DrawResultsArea" },
129
- h("div", { class: "TicketInfo" },
130
- h("div", { class: "TicketGameName" },
131
- translate('drawName', this.language),
132
- ": ",
133
- h("span", null, this.gameName)),
134
- h("div", { class: "TicketDate" },
135
- translate('ticketPurchaseDate', this.language),
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
- h("span", null, this.ticketId))),
148
- h("div", { class: "TicketAmountContainer" },
149
- h("p", null,
150
- translate('ticketAmount', this.language),
151
- " ",
152
- h("span", null, this.ticketAmount))),
153
- h("div", { class: "DrawNumbersGrid" },
154
- h("p", null,
155
- translate('drawNumbersGridTicket', this.language),
156
- ":"),
157
- h("div", { class: "BulletContainer" },
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 }))),
159
- h("div", { class: "DrawMultipler" },
160
- h("label", { class: "Label" },
161
- translate('winUpTo', this.language),
162
- " ",
163
- h("span", null, JSON.stringify(this.ticketMultiplier)))),
164
- h("div", { class: "NumberOfDrawsContainer" },
165
- h("p", null,
166
- translate('numberOfDraws', this.language),
167
- ": ",
168
- this.ticketDrawCount),
169
- h("div", { class: "DrawTicketsContainer" }, this.drawResults.map((item, index) => h("div", { class: "ExpandableBoxes" },
170
- h("div", { class: this.toggleDrawer[index] ? 'ExpandableBox ShowBox' : 'ExpandableBox', onClick: () => this.changeBox(index) },
171
- h("div", { class: "TicketResultContainer" },
172
- h("p", null,
173
- translate('ticketResult', this.language),
174
- ": ",
175
- item.status)),
176
- item.state == 'won' &&
177
- h("div", { class: "AmountWonContainer" },
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('amountWon', this.language),
293
+ translate('drawDate', this.language),
180
294
  ": ",
181
- Number(item.amount).toLocaleString('en'),
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.currency)),
184
- h("div", { class: "DrawIdContainer" },
185
- h("p", null,
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 A',
10
- drawNumbersGridTicket: 'Draw numbers Grid B',
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 A',
27
- drawNumbersGridTicket: 'Numerele extrase Grid B',
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',
@@ -0,0 +1,6 @@
1
+ import { L as LotteryBullet$1, d as defineCustomElement$1 } from './lottery-bullet2.js';
2
+
3
+ const LotteryBullet = LotteryBullet$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { LotteryBullet, defineCustomElement };
@@ -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 };