@everymatrix/lottery-draw-results 0.1.24 → 1.15.0
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-43800d3c.js → index-40e6760b.js} +14 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/lottery-bullet_3.cjs.entry.js +64 -108
- package/dist/cjs/lottery-draw-results.cjs.js +2 -2
- package/dist/collection/components/lottery-draw-results/lottery-draw-results.css +59 -34
- package/dist/collection/components/lottery-draw-results/lottery-draw-results.js +134 -164
- package/dist/components/lottery-bullet2.js +5 -5
- package/dist/components/lottery-draw-results.js +73 -126
- package/dist/components/lottery-grid2.js +24 -15
- package/dist/esm/{index-9547eb6c.js → index-3c2823a2.js} +14 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/lottery-bullet_3.entry.js +64 -108
- package/dist/esm/lottery-draw-results.js +2 -2
- package/dist/lottery-draw-results/lottery-draw-results.esm.js +1 -1
- package/dist/lottery-draw-results/p-0eb80b2e.js +1 -0
- package/dist/lottery-draw-results/p-55ca5871.entry.js +1 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/lottery-draw-results/.stencil/packages/lottery-draw-results/stencil.config.d.ts +2 -0
- package/dist/types/components/lottery-draw-results/lottery-draw-results.d.ts +11 -7
- package/dist/types/components.d.ts +8 -0
- package/package.json +2 -2
- package/dist/lottery-draw-results/p-954ea9de.entry.js +0 -1
- package/dist/lottery-draw-results/p-e1cb3144.js +0 -1
- package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/stencil/widgets-stencil/packages/lottery-draw-results/.stencil/packages/lottery-draw-results/stencil.config.d.ts +0 -2
|
@@ -557,9 +557,14 @@ const callNodeRefs = (vNode) => {
|
|
|
557
557
|
};
|
|
558
558
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
559
559
|
const hostElm = hostRef.$hostElement$;
|
|
560
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
560
561
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
561
562
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
562
563
|
hostTagName = hostElm.tagName;
|
|
564
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
565
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
566
|
+
cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
|
|
567
|
+
}
|
|
563
568
|
rootVnode.$tag$ = null;
|
|
564
569
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
565
570
|
hostRef.$vnode$ = rootVnode;
|
|
@@ -629,6 +634,9 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
629
634
|
}
|
|
630
635
|
}
|
|
631
636
|
}
|
|
637
|
+
{
|
|
638
|
+
promise = then(promise, () => safeCall(instance, 'componentWillRender'));
|
|
639
|
+
}
|
|
632
640
|
endSchedule();
|
|
633
641
|
return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
634
642
|
};
|
|
@@ -914,6 +922,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
914
922
|
.map(([propName, m]) => {
|
|
915
923
|
const attrName = m[1] || propName;
|
|
916
924
|
attrNameToPropName.set(attrName, propName);
|
|
925
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
926
|
+
cmpMeta.$attrsToReflect$.push([propName, attrName]);
|
|
927
|
+
}
|
|
917
928
|
return attrName;
|
|
918
929
|
});
|
|
919
930
|
}
|
|
@@ -1082,6 +1093,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1082
1093
|
{
|
|
1083
1094
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
1084
1095
|
}
|
|
1096
|
+
{
|
|
1097
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1098
|
+
}
|
|
1085
1099
|
const tagName = cmpMeta.$tagName$;
|
|
1086
1100
|
const HostElement = class extends HTMLElement {
|
|
1087
1101
|
// StencilLazyHost
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-40e6760b.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["lottery-bullet_3.cjs",[[1,"lottery-draw-results",{"endpoint":[
|
|
17
|
+
return index.bootstrapLazy([["lottery-bullet_3.cjs",[[1,"lottery-draw-results",{"endpoint":[513],"gameId":[513,"game-id"],"language":[513],"playerId":[513,"player-id"],"drawMode":[516,"draw-mode"],"drawId":[513,"draw-id"],"gameName":[513,"game-name"],"ticketDate":[513,"ticket-date"],"ticketStatus":[513,"ticket-status"],"ticketId":[513,"ticket-id"],"ticketAmount":[513,"ticket-amount"],"ticketMultiplier":[516,"ticket-multiplier"],"ticketDrawCount":[514,"ticket-draw-count"],"ticketNumbers":[513,"ticket-numbers"],"sessionId":[513,"session-id"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"ticketDrawData":[513,"ticket-draw-data"],"multiplier":[32],"isLoading":[32],"hasErrors":[32],"errorText":[32],"ticketData":[32],"ticketDataLoaded":[32],"ticketDraws":[32],"toggleDrawer":[32],"limitStylingAppends":[32],"drawData":[32]}],[1,"lottery-grid",{"ticketId":[514,"ticket-id"],"totalNumbers":[514,"total-numbers"],"gameId":[513,"game-id"],"maximumAllowed":[514,"maximum-allowed"],"minimumAllowed":[514,"minimum-allowed"],"selectable":[516],"selectedNumbers":[513,"selected-numbers"],"displaySelected":[516,"display-selected"],"language":[513],"gridIndex":[514,"grid-index"],"gridType":[513,"grid-type"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"numbers":[32],"limitStylingAppends":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[513],"selectable":[516],"isSelected":[516,"is-selected"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"limitStylingAppends":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-40e6760b.js');
|
|
6
6
|
|
|
7
7
|
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, white 0%, white 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, white 0%, #f1f1f1 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}";
|
|
8
8
|
|
|
@@ -147,7 +147,7 @@ const translate = (key, customLang) => {
|
|
|
147
147
|
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
148
148
|
};
|
|
149
149
|
|
|
150
|
-
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{
|
|
150
|
+
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}";
|
|
151
151
|
|
|
152
152
|
const LotteryDrawResults = class {
|
|
153
153
|
constructor(hostRef) {
|
|
@@ -208,78 +208,21 @@ const LotteryDrawResults = class {
|
|
|
208
208
|
* Client custom styling via url content
|
|
209
209
|
*/
|
|
210
210
|
this.clientStylingUrlContent = '';
|
|
211
|
+
/**
|
|
212
|
+
* Data showing the ticket's draw results details
|
|
213
|
+
*/
|
|
214
|
+
this.ticketDrawData = '';
|
|
211
215
|
this.multiplier = 3;
|
|
212
216
|
this.isLoading = true;
|
|
213
|
-
this.rules = {};
|
|
214
|
-
this.toggleDrawer = [false];
|
|
215
217
|
this.hasErrors = false;
|
|
216
218
|
this.errorText = '';
|
|
217
219
|
this.ticketData = [];
|
|
218
220
|
this.ticketDataLoaded = false;
|
|
219
221
|
this.ticketDraws = [];
|
|
220
|
-
this.
|
|
222
|
+
this.toggleDrawer = [false];
|
|
221
223
|
this.limitStylingAppends = false;
|
|
222
|
-
this.
|
|
223
|
-
|
|
224
|
-
let drawOptions = {
|
|
225
|
-
method: "GET",
|
|
226
|
-
headers: {
|
|
227
|
-
'Content-Type': "application/json",
|
|
228
|
-
'Accept': 'application/json',
|
|
229
|
-
'Authorization': `Bearer ${this.sessionId}`
|
|
230
|
-
},
|
|
231
|
-
};
|
|
232
|
-
fetch(url.href, drawOptions)
|
|
233
|
-
.then((response) => {
|
|
234
|
-
return response.json();
|
|
235
|
-
})
|
|
236
|
-
.then((data) => {
|
|
237
|
-
if (data) {
|
|
238
|
-
this.ticketData = data;
|
|
239
|
-
this.ticketDataLoaded = true;
|
|
240
|
-
}
|
|
241
|
-
return this.ticketData;
|
|
242
|
-
})
|
|
243
|
-
.then((response) => {
|
|
244
|
-
response.forEach(ticket => {
|
|
245
|
-
if (ticket.drawResults.length) {
|
|
246
|
-
ticket.drawResults.forEach(draw => {
|
|
247
|
-
fetch(`${this.endpoint}/games/${this.gameId}/draws/${draw.drawId}`)
|
|
248
|
-
.then((response) => {
|
|
249
|
-
return response.json();
|
|
250
|
-
})
|
|
251
|
-
.then((data) => {
|
|
252
|
-
// check if draw id is unique
|
|
253
|
-
if (!this.ticketDraws.some(el => el.drawId === draw.drawId)) {
|
|
254
|
-
this.ticketDraws.push({ drawId: draw.drawId, drawNumbers: data.winningNumbers });
|
|
255
|
-
}
|
|
256
|
-
})
|
|
257
|
-
.catch((err) => {
|
|
258
|
-
console.log('error ', err);
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
return this.ticketDraws;
|
|
263
|
-
});
|
|
264
|
-
})
|
|
265
|
-
.then(() => {
|
|
266
|
-
this.hasDrawNumbers = true;
|
|
267
|
-
})
|
|
268
|
-
.catch((err) => {
|
|
269
|
-
console.log('error ', err);
|
|
270
|
-
});
|
|
271
|
-
};
|
|
272
|
-
this.changeBox = (index) => {
|
|
273
|
-
this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
|
|
274
|
-
if (itemIndex == index) {
|
|
275
|
-
return !item;
|
|
276
|
-
}
|
|
277
|
-
return item;
|
|
278
|
-
});
|
|
279
|
-
if (index >= this.toggleDrawer.length) {
|
|
280
|
-
this.toggleDrawer.push(true);
|
|
281
|
-
}
|
|
282
|
-
};
|
|
224
|
+
this.ticketDrawDetails = [];
|
|
225
|
+
this.ticketDrawDetailsFlag = true;
|
|
283
226
|
this.setClientStyling = () => {
|
|
284
227
|
let sheet = document.createElement('style');
|
|
285
228
|
sheet.innerHTML = this.clientStyling;
|
|
@@ -295,13 +238,13 @@ const LotteryDrawResults = class {
|
|
|
295
238
|
}
|
|
296
239
|
connectedCallback() {
|
|
297
240
|
let promises = [];
|
|
298
|
-
|
|
241
|
+
// Split ticket numbers for each grid
|
|
242
|
+
if (this.ticketNumbers) {
|
|
243
|
+
this.gridNumbers = JSON.parse(this.ticketNumbers);
|
|
244
|
+
}
|
|
299
245
|
if (this.drawId) {
|
|
300
246
|
promises.push(this.getDrawData());
|
|
301
247
|
}
|
|
302
|
-
if (!this.drawMode) {
|
|
303
|
-
this.getTicketsData();
|
|
304
|
-
}
|
|
305
248
|
Promise.all(promises)
|
|
306
249
|
.then(() => {
|
|
307
250
|
this.isLoading = false;
|
|
@@ -310,6 +253,15 @@ const LotteryDrawResults = class {
|
|
|
310
253
|
this.isLoading = false;
|
|
311
254
|
});
|
|
312
255
|
}
|
|
256
|
+
componentWillRender() {
|
|
257
|
+
if (this.ticketDrawData && this.ticketDrawDetailsFlag) {
|
|
258
|
+
this.ticketDrawDetails = JSON.parse(this.ticketDrawData);
|
|
259
|
+
this.ticketDrawDetails.forEach((drawDetail) => {
|
|
260
|
+
this.getDrawData(drawDetail.drawId).then((drawData) => drawDetail.drawData = drawData);
|
|
261
|
+
});
|
|
262
|
+
this.ticketDrawDetailsFlag = false;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
313
265
|
componentDidRender() {
|
|
314
266
|
// start custom styling area
|
|
315
267
|
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
@@ -321,21 +273,24 @@ const LotteryDrawResults = class {
|
|
|
321
273
|
}
|
|
322
274
|
// end custom styling area
|
|
323
275
|
}
|
|
324
|
-
getDrawData(
|
|
276
|
+
getDrawData(drawId) {
|
|
277
|
+
this.isLoading = true;
|
|
325
278
|
return new Promise((resolve, reject) => {
|
|
326
|
-
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${
|
|
279
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawId ? drawId : this.drawId}`);
|
|
327
280
|
fetch(url.href)
|
|
328
281
|
.then((response) => {
|
|
329
282
|
// @TODO EXCEPTIONS
|
|
330
283
|
return response.json();
|
|
331
284
|
})
|
|
332
285
|
.then((data) => {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
286
|
+
if (drawId) {
|
|
287
|
+
resolve(data);
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
this.drawData = data;
|
|
291
|
+
resolve(true);
|
|
338
292
|
}
|
|
293
|
+
this.isLoading = false;
|
|
339
294
|
})
|
|
340
295
|
.catch((err) => {
|
|
341
296
|
reject(err);
|
|
@@ -343,29 +298,16 @@ const LotteryDrawResults = class {
|
|
|
343
298
|
});
|
|
344
299
|
});
|
|
345
300
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
})
|
|
353
|
-
.then((data) => {
|
|
354
|
-
this.rules = {
|
|
355
|
-
maximumAllowed: data.rules.boards[0].maximumAllowed,
|
|
356
|
-
totalNumbers: data.rules.boards[0].totalNumbers
|
|
357
|
-
};
|
|
358
|
-
resolve(true);
|
|
359
|
-
this.isLoading = false;
|
|
360
|
-
this.hasErrors = false;
|
|
361
|
-
})
|
|
362
|
-
.catch((err) => {
|
|
363
|
-
this.isLoading = false;
|
|
364
|
-
this.hasErrors = true;
|
|
365
|
-
this.errorText = err;
|
|
366
|
-
reject(err);
|
|
367
|
-
});
|
|
301
|
+
drawerToggle(index) {
|
|
302
|
+
this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
|
|
303
|
+
if (itemIndex == index) {
|
|
304
|
+
return !item;
|
|
305
|
+
}
|
|
306
|
+
return item;
|
|
368
307
|
});
|
|
308
|
+
if (index >= this.toggleDrawer.length) {
|
|
309
|
+
this.toggleDrawer.push(true);
|
|
310
|
+
}
|
|
369
311
|
}
|
|
370
312
|
render() {
|
|
371
313
|
if (this.isLoading) {
|
|
@@ -377,14 +319,19 @@ const LotteryDrawResults = class {
|
|
|
377
319
|
else {
|
|
378
320
|
return (index.h("section", { class: "DrawResultsSection", ref: el => this.stylingContainer = el }, this.drawMode ?
|
|
379
321
|
index.h("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
380
|
-
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", { "
|
|
322
|
+
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))))))
|
|
381
323
|
:
|
|
382
|
-
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" }, index.h("label", { class: "Label" }, translate('drawNumbersGridTicket', this.language), "
|
|
383
|
-
index.h("div",
|
|
384
|
-
|
|
385
|
-
index.h("div",
|
|
386
|
-
|
|
387
|
-
|
|
324
|
+
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 &&
|
|
325
|
+
index.h("div", { class: "ExpandableBoxes" }, this.ticketDrawDetails.map((drawDetail, index$1) => {
|
|
326
|
+
var _a, _b, _c, _d, _e;
|
|
327
|
+
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' &&
|
|
328
|
+
index.h("div", { class: "AmountWonContainer" }, index.h("p", null, translate('amountWon', this.language), ": ", Number(drawDetail.amount).toLocaleString('en'), " ", drawDetail.currency)), drawDetail.state == 'lost' &&
|
|
329
|
+
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 :
|
|
330
|
+
_a.date.slice(0, 10), " | ", (_b = drawDetail.drawData) === null || _b === void 0 ? void 0 :
|
|
331
|
+
_b.date.slice(11, 19))), index.h("div", { class: "DrawNumbersGrid" }, drawDetail.drawData &&
|
|
332
|
+
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 :
|
|
333
|
+
_e.multiplier))));
|
|
334
|
+
}))))))));
|
|
388
335
|
}
|
|
389
336
|
}
|
|
390
337
|
};
|
|
@@ -491,6 +438,15 @@ const LotteryGrid = class {
|
|
|
491
438
|
}
|
|
492
439
|
// end custom styling area
|
|
493
440
|
}
|
|
441
|
+
// wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
|
|
442
|
+
shuffleArray(array) {
|
|
443
|
+
const result = [];
|
|
444
|
+
while (array.length > 0) {
|
|
445
|
+
const randomIndex = Math.floor(Math.random() * (array.length));
|
|
446
|
+
result.push(array.splice(randomIndex, 1)[0]);
|
|
447
|
+
}
|
|
448
|
+
return result;
|
|
449
|
+
}
|
|
494
450
|
lotteryBulletSelectionHandler(event) {
|
|
495
451
|
this.numbers = this.numbers.map((item) => {
|
|
496
452
|
if (item.number == event.detail.value) {
|
|
@@ -562,8 +518,8 @@ const LotteryGrid = class {
|
|
|
562
518
|
if (event.detail && event.detail == this.ticketId) {
|
|
563
519
|
this.resetSelectionHandler(event);
|
|
564
520
|
let array = [...Array(this.totalNumbers).keys()]
|
|
565
|
-
.map(number => number + 1)
|
|
566
|
-
|
|
521
|
+
.map(number => number + 1);
|
|
522
|
+
array = this.shuffleArray(array);
|
|
567
523
|
array = array.slice(0, this.minimumAllowed);
|
|
568
524
|
this.numbers = this.numbers.map((item) => {
|
|
569
525
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-40e6760b.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-bullet_3.cjs",[[1,"lottery-draw-results",{"endpoint":[
|
|
18
|
+
return index.bootstrapLazy([["lottery-bullet_3.cjs",[[1,"lottery-draw-results",{"endpoint":[513],"gameId":[513,"game-id"],"language":[513],"playerId":[513,"player-id"],"drawMode":[516,"draw-mode"],"drawId":[513,"draw-id"],"gameName":[513,"game-name"],"ticketDate":[513,"ticket-date"],"ticketStatus":[513,"ticket-status"],"ticketId":[513,"ticket-id"],"ticketAmount":[513,"ticket-amount"],"ticketMultiplier":[516,"ticket-multiplier"],"ticketDrawCount":[514,"ticket-draw-count"],"ticketNumbers":[513,"ticket-numbers"],"sessionId":[513,"session-id"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"ticketDrawData":[513,"ticket-draw-data"],"multiplier":[32],"isLoading":[32],"hasErrors":[32],"errorText":[32],"ticketData":[32],"ticketDataLoaded":[32],"ticketDraws":[32],"toggleDrawer":[32],"limitStylingAppends":[32],"drawData":[32]}],[1,"lottery-grid",{"ticketId":[514,"ticket-id"],"totalNumbers":[514,"total-numbers"],"gameId":[513,"game-id"],"maximumAllowed":[514,"maximum-allowed"],"minimumAllowed":[514,"minimum-allowed"],"selectable":[516],"selectedNumbers":[513,"selected-numbers"],"displaySelected":[516,"display-selected"],"language":[513],"gridIndex":[514,"grid-index"],"gridType":[513,"grid-type"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"numbers":[32],"limitStylingAppends":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[513],"selectable":[516],"isSelected":[516,"is-selected"],"clientStyling":[513,"client-styling"],"clientStylingUrlContent":[513,"client-styling-url-content"],"limitStylingAppends":[32]}]]]], options);
|
|
19
19
|
});
|
|
@@ -65,11 +65,13 @@
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.DrawNumbersGrid {
|
|
68
|
-
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
gap: 5px;
|
|
69
71
|
}
|
|
70
72
|
.DrawNumbersGrid label {
|
|
71
73
|
display: block;
|
|
72
|
-
margin-bottom:
|
|
74
|
+
margin-bottom: 7px;
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
.Toggle {
|
|
@@ -139,44 +141,67 @@
|
|
|
139
141
|
position: relative;
|
|
140
142
|
display: flex;
|
|
141
143
|
flex-direction: column;
|
|
144
|
+
border: 1px solid #ccc;
|
|
145
|
+
border-radius: 5px;
|
|
146
|
+
background-color: white;
|
|
142
147
|
}
|
|
143
148
|
|
|
144
149
|
.ExpandableBox {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
width: 100%;
|
|
148
|
-
height: 100%;
|
|
149
|
-
max-height: 80px;
|
|
150
|
-
float: left;
|
|
151
|
-
margin: 0 0 20px 0;
|
|
152
|
-
border: 1px solid #009993;
|
|
153
|
-
background: #fff;
|
|
154
|
-
border-radius: 4px;
|
|
155
|
-
padding: 10px;
|
|
156
|
-
box-sizing: border-box;
|
|
157
|
-
-webkit-transition: all 0.6s ease-in-out;
|
|
158
|
-
-moz-transition: all 0.6s ease-in-out;
|
|
159
|
-
-o-transition: all 0.6s ease-in-out;
|
|
160
|
-
-ms-transition: all 0.6s ease-in-out;
|
|
161
|
-
transition: all 0.6s ease-in-out;
|
|
150
|
+
border-bottom: 1px solid #ccc;
|
|
151
|
+
transition: height 300ms ease-in-out;
|
|
162
152
|
overflow: hidden;
|
|
163
|
-
|
|
153
|
+
height: 80px;
|
|
164
154
|
}
|
|
165
|
-
.ExpandableBox:last-
|
|
166
|
-
|
|
155
|
+
.ExpandableBox:last-child {
|
|
156
|
+
border-bottom: 0;
|
|
167
157
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
158
|
+
.ExpandableBoxHeader {
|
|
159
|
+
position: relative;
|
|
160
|
+
list-style: none;
|
|
161
|
+
outline: 0;
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
text-transform: uppercase;
|
|
164
|
+
transition: color 300ms ease-in-out;
|
|
165
|
+
margin-bottom: 24px;
|
|
166
|
+
margin-left: 5px;
|
|
172
167
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
168
|
+
.ShowBox > .ExpandableBoxHeader {
|
|
169
|
+
color: #009993;
|
|
170
|
+
}
|
|
171
|
+
.ExpandableBoxHeader::-webkit-details-marker {
|
|
172
|
+
display: none;
|
|
173
|
+
}
|
|
174
|
+
.ExpandableBoxHeader:before, .ExpandableBoxHeader:after {
|
|
175
|
+
content: "";
|
|
176
|
+
position: absolute;
|
|
177
|
+
}
|
|
178
|
+
.ExpandableBoxHeader:before {
|
|
179
|
+
right: 21px;
|
|
180
|
+
top: 50%;
|
|
181
|
+
height: 2px;
|
|
182
|
+
margin-top: -1px;
|
|
183
|
+
width: 16px;
|
|
184
|
+
background: #009993;
|
|
185
|
+
}
|
|
186
|
+
.ExpandableBoxHeader:after {
|
|
187
|
+
right: 28px;
|
|
188
|
+
top: 50%;
|
|
189
|
+
height: 16px;
|
|
190
|
+
margin-top: -8px;
|
|
191
|
+
width: 2px;
|
|
192
|
+
margin-left: -1px;
|
|
193
|
+
background: #009993;
|
|
194
|
+
transition: all 300ms ease-in-out;
|
|
195
|
+
}
|
|
196
|
+
.ShowBox .ExpandableBoxHeader:after {
|
|
181
197
|
opacity: 0;
|
|
198
|
+
transform: translateY(25%);
|
|
199
|
+
}
|
|
200
|
+
.ExpandableBoxBody {
|
|
201
|
+
padding-top: 0;
|
|
202
|
+
font-weight: lighter;
|
|
203
|
+
margin-left: 5px;
|
|
204
|
+
}
|
|
205
|
+
.ExpandableBox.ShowBox {
|
|
206
|
+
height: 300px;
|
|
182
207
|
}
|