@everymatrix/lottery-game-page 1.31.2 → 1.32.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/package.json +8 -7
- package/dist/assets/chrono_desktop.png +0 -0
- package/dist/assets/chrono_lottery_mobile.png +0 -0
- package/dist/cjs/helper-accordion.cjs.entry.js +0 -135
- package/dist/cjs/helper-accordion.cjs.entry.js.map +0 -1
- package/dist/cjs/helper-filters_2.cjs.entry.js +0 -23817
- package/dist/cjs/helper-filters_2.cjs.entry.js.map +0 -1
- package/dist/cjs/helper-modal.cjs.entry.js +0 -78
- package/dist/cjs/helper-modal.cjs.entry.js.map +0 -1
- package/dist/cjs/helper-pagination.cjs.entry.js +0 -259
- package/dist/cjs/helper-pagination.cjs.entry.js.map +0 -1
- package/dist/cjs/helper-tab.cjs.entry.js +0 -70
- package/dist/cjs/helper-tab.cjs.entry.js.map +0 -1
- package/dist/cjs/helper-tabs.cjs.entry.js +0 -76
- package/dist/cjs/helper-tabs.cjs.entry.js.map +0 -1
- package/dist/cjs/index-cd44e726.js +0 -1326
- package/dist/cjs/index-cd44e726.js.map +0 -1
- package/dist/cjs/index.cjs.js +0 -4
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js +0 -23
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/lottery-bullet_2.cjs.entry.js +0 -281
- package/dist/cjs/lottery-bullet_2.cjs.entry.js.map +0 -1
- package/dist/cjs/lottery-draw-results-history.cjs.entry.js +0 -240
- package/dist/cjs/lottery-draw-results-history.cjs.entry.js.map +0 -1
- package/dist/cjs/lottery-game-details.cjs.entry.js +0 -53
- package/dist/cjs/lottery-game-details.cjs.entry.js.map +0 -1
- package/dist/cjs/lottery-game-page.cjs.entry.js +0 -456
- package/dist/cjs/lottery-game-page.cjs.entry.js.map +0 -1
- package/dist/cjs/lottery-game-page.cjs.js +0 -21
- package/dist/cjs/lottery-game-page.cjs.js.map +0 -1
- package/dist/cjs/lottery-ticket-controller.cjs.entry.js +0 -132
- package/dist/cjs/lottery-ticket-controller.cjs.entry.js.map +0 -1
- package/dist/cjs/lottery-ticket.cjs.entry.js +0 -233
- package/dist/cjs/lottery-ticket.cjs.entry.js.map +0 -1
- package/dist/collection/collection-manifest.json +0 -92
- package/dist/collection/components/lottery-game-page/lottery-game-page.css +0 -336
- package/dist/collection/components/lottery-game-page/lottery-game-page.js +0 -658
- package/dist/collection/components/lottery-game-page/lottery-game-page.js.map +0 -1
- package/dist/collection/index.js +0 -2
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/utils/locale.utils.js +0 -124
- package/dist/collection/utils/locale.utils.js.map +0 -1
- package/dist/collection/utils/utils.js +0 -13
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/helper-accordion.js +0 -8
- package/dist/components/helper-accordion.js.map +0 -1
- package/dist/components/helper-accordion2.js +0 -162
- package/dist/components/helper-accordion2.js.map +0 -1
- package/dist/components/helper-filters.js +0 -8
- package/dist/components/helper-filters.js.map +0 -1
- package/dist/components/helper-filters2.js +0 -23566
- package/dist/components/helper-filters2.js.map +0 -1
- package/dist/components/helper-modal.js +0 -8
- package/dist/components/helper-modal.js.map +0 -1
- package/dist/components/helper-modal2.js +0 -96
- package/dist/components/helper-modal2.js.map +0 -1
- package/dist/components/helper-pagination.js +0 -294
- package/dist/components/helper-pagination.js.map +0 -1
- package/dist/components/helper-tab.js +0 -8
- package/dist/components/helper-tab.js.map +0 -1
- package/dist/components/helper-tab2.js +0 -89
- package/dist/components/helper-tab2.js.map +0 -1
- package/dist/components/helper-tabs.js +0 -8
- package/dist/components/helper-tabs.js.map +0 -1
- package/dist/components/helper-tabs2.js +0 -105
- package/dist/components/helper-tabs2.js.map +0 -1
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -3
- package/dist/components/index.js.map +0 -1
- package/dist/components/lottery-bullet.js +0 -8
- package/dist/components/lottery-bullet.js.map +0 -1
- package/dist/components/lottery-bullet2.js +0 -94
- package/dist/components/lottery-bullet2.js.map +0 -1
- package/dist/components/lottery-draw-results-history.js +0 -8
- package/dist/components/lottery-draw-results-history.js.map +0 -1
- package/dist/components/lottery-draw-results-history2.js +0 -298
- package/dist/components/lottery-draw-results-history2.js.map +0 -1
- package/dist/components/lottery-draw-results.js +0 -8
- package/dist/components/lottery-draw-results.js.map +0 -1
- package/dist/components/lottery-draw-results2.js +0 -346
- package/dist/components/lottery-draw-results2.js.map +0 -1
- package/dist/components/lottery-game-details.js +0 -8
- package/dist/components/lottery-game-details.js.map +0 -1
- package/dist/components/lottery-game-details2.js +0 -87
- package/dist/components/lottery-game-details2.js.map +0 -1
- package/dist/components/lottery-game-page.d.ts +0 -11
- package/dist/components/lottery-game-page.js +0 -572
- package/dist/components/lottery-game-page.js.map +0 -1
- package/dist/components/lottery-grid.js +0 -8
- package/dist/components/lottery-grid.js.map +0 -1
- package/dist/components/lottery-grid2.js +0 -248
- package/dist/components/lottery-grid2.js.map +0 -1
- package/dist/components/lottery-ticket-controller.js +0 -8
- package/dist/components/lottery-ticket-controller.js.map +0 -1
- package/dist/components/lottery-ticket-controller2.js +0 -185
- package/dist/components/lottery-ticket-controller2.js.map +0 -1
- package/dist/components/lottery-ticket.js +0 -8
- package/dist/components/lottery-ticket.js.map +0 -1
- package/dist/components/lottery-ticket2.js +0 -276
- package/dist/components/lottery-ticket2.js.map +0 -1
- package/dist/esm/helper-accordion.entry.js +0 -131
- package/dist/esm/helper-accordion.entry.js.map +0 -1
- package/dist/esm/helper-filters_2.entry.js +0 -23812
- package/dist/esm/helper-filters_2.entry.js.map +0 -1
- package/dist/esm/helper-modal.entry.js +0 -74
- package/dist/esm/helper-modal.entry.js.map +0 -1
- package/dist/esm/helper-pagination.entry.js +0 -255
- package/dist/esm/helper-pagination.entry.js.map +0 -1
- package/dist/esm/helper-tab.entry.js +0 -66
- package/dist/esm/helper-tab.entry.js.map +0 -1
- package/dist/esm/helper-tabs.entry.js +0 -72
- package/dist/esm/helper-tabs.entry.js.map +0 -1
- package/dist/esm/index-d1baacd4.js +0 -1298
- package/dist/esm/index-d1baacd4.js.map +0 -1
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js +0 -19
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/lottery-bullet_2.entry.js +0 -276
- package/dist/esm/lottery-bullet_2.entry.js.map +0 -1
- package/dist/esm/lottery-draw-results-history.entry.js +0 -236
- package/dist/esm/lottery-draw-results-history.entry.js.map +0 -1
- package/dist/esm/lottery-game-details.entry.js +0 -49
- package/dist/esm/lottery-game-details.entry.js.map +0 -1
- package/dist/esm/lottery-game-page.entry.js +0 -452
- package/dist/esm/lottery-game-page.entry.js.map +0 -1
- package/dist/esm/lottery-game-page.js +0 -19
- package/dist/esm/lottery-game-page.js.map +0 -1
- package/dist/esm/lottery-ticket-controller.entry.js +0 -128
- package/dist/esm/lottery-ticket-controller.entry.js.map +0 -1
- package/dist/esm/lottery-ticket.entry.js +0 -229
- package/dist/esm/lottery-ticket.entry.js.map +0 -1
- 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/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/lottery-game-page/index.esm.js +0 -2
- package/dist/lottery-game-page/index.esm.js.map +0 -1
- package/dist/lottery-game-page/lottery-game-page.esm.js +0 -2
- package/dist/lottery-game-page/lottery-game-page.esm.js.map +0 -1
- package/dist/lottery-game-page/p-12340c50.entry.js +0 -2921
- package/dist/lottery-game-page/p-12340c50.entry.js.map +0 -1
- package/dist/lottery-game-page/p-15309f9a.entry.js +0 -2
- package/dist/lottery-game-page/p-15309f9a.entry.js.map +0 -1
- package/dist/lottery-game-page/p-167c9dbe.entry.js +0 -2
- package/dist/lottery-game-page/p-167c9dbe.entry.js.map +0 -1
- package/dist/lottery-game-page/p-20e0c81c.entry.js +0 -2
- package/dist/lottery-game-page/p-20e0c81c.entry.js.map +0 -1
- package/dist/lottery-game-page/p-662d9dac.entry.js +0 -2
- package/dist/lottery-game-page/p-662d9dac.entry.js.map +0 -1
- package/dist/lottery-game-page/p-66729e9c.entry.js +0 -2
- package/dist/lottery-game-page/p-66729e9c.entry.js.map +0 -1
- package/dist/lottery-game-page/p-76c280ec.entry.js +0 -2
- package/dist/lottery-game-page/p-76c280ec.entry.js.map +0 -1
- package/dist/lottery-game-page/p-b19ff22c.entry.js +0 -2
- package/dist/lottery-game-page/p-b19ff22c.entry.js.map +0 -1
- package/dist/lottery-game-page/p-cba19473.entry.js +0 -2
- package/dist/lottery-game-page/p-cba19473.entry.js.map +0 -1
- package/dist/lottery-game-page/p-cd4aa6a4.entry.js +0 -2
- package/dist/lottery-game-page/p-cd4aa6a4.entry.js.map +0 -1
- package/dist/lottery-game-page/p-e765c7d9.js +0 -2
- package/dist/lottery-game-page/p-e765c7d9.js.map +0 -1
- package/dist/lottery-game-page/p-e86e2389.entry.js +0 -2
- package/dist/lottery-game-page/p-e86e2389.entry.js.map +0 -1
- package/dist/lottery-game-page/p-f399eef1.entry.js +0 -2
- package/dist/lottery-game-page/p-f399eef1.entry.js.map +0 -1
- package/dist/stencil.config.js +0 -50
- package/dist/stencil.config.js.map +0 -1
- package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +0 -2
- package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +0 -102
- package/dist/types/components.d.ts +0 -119
- package/dist/types/index.d.ts +0 -1
- package/dist/types/stencil-public-runtime.d.ts +0 -1565
- package/dist/types/utils/locale.utils.d.ts +0 -1
- package/dist/types/utils/utils.d.ts +0 -7
- package/loader/cdn.js +0 -3
- package/loader/index.cjs.js +0 -3
- package/loader/index.d.ts +0 -12
- package/loader/index.es2017.js +0 -3
- package/loader/index.js +0 -4
- package/loader/package.json +0 -10
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-cd44e726.js');
|
|
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, 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
|
-
|
|
9
|
-
const LotteryBullet = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.bulletEvent = index.createEvent(this, "lotteryBulletSelection", 7);
|
|
13
|
-
/**
|
|
14
|
-
* Value of the bullet
|
|
15
|
-
*/
|
|
16
|
-
this.value = '0';
|
|
17
|
-
/**
|
|
18
|
-
* Marks if the bullet should be selectable
|
|
19
|
-
*/
|
|
20
|
-
this.selectable = true;
|
|
21
|
-
/**
|
|
22
|
-
* Marks if the bullet should be selected
|
|
23
|
-
*/
|
|
24
|
-
this.isSelected = false;
|
|
25
|
-
/**
|
|
26
|
-
* Client custom styling via string
|
|
27
|
-
*/
|
|
28
|
-
this.clientStyling = '';
|
|
29
|
-
/**
|
|
30
|
-
* Client custom styling via url content
|
|
31
|
-
*/
|
|
32
|
-
this.clientStylingUrlContent = '';
|
|
33
|
-
this.limitStylingAppends = false;
|
|
34
|
-
this.select = () => {
|
|
35
|
-
if (this.selectable) {
|
|
36
|
-
this.isSelected = !this.isSelected;
|
|
37
|
-
this.bulletEvent.emit({
|
|
38
|
-
value: this.value,
|
|
39
|
-
selected: this.isSelected
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
this.setClientStyling = () => {
|
|
44
|
-
let sheet = document.createElement('style');
|
|
45
|
-
sheet.innerHTML = this.clientStyling;
|
|
46
|
-
this.stylingContainer.prepend(sheet);
|
|
47
|
-
};
|
|
48
|
-
this.setClientStylingURL = () => {
|
|
49
|
-
let cssFile = document.createElement('style');
|
|
50
|
-
setTimeout(() => {
|
|
51
|
-
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
52
|
-
this.stylingContainer.prepend(cssFile);
|
|
53
|
-
}, 1);
|
|
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;
|
|
64
|
-
}
|
|
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
|
-
};
|
|
71
|
-
LotteryBullet.style = lotteryBulletCss;
|
|
72
|
-
|
|
73
|
-
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}";
|
|
74
|
-
|
|
75
|
-
const LotteryGrid = class {
|
|
76
|
-
constructor(hostRef) {
|
|
77
|
-
index.registerInstance(this, hostRef);
|
|
78
|
-
this.gridFilledEvent = index.createEvent(this, "gridFilled", 7);
|
|
79
|
-
this.gridDirtyEvent = index.createEvent(this, "gridDirty", 7);
|
|
80
|
-
/**
|
|
81
|
-
* Number of bullets of grid
|
|
82
|
-
*/
|
|
83
|
-
this.totalNumbers = 0;
|
|
84
|
-
/**
|
|
85
|
-
* Number of maximum bullets that can be selected
|
|
86
|
-
*/
|
|
87
|
-
this.maximumAllowed = 0;
|
|
88
|
-
/**
|
|
89
|
-
* Minimum allowed of bullets
|
|
90
|
-
*/
|
|
91
|
-
this.minimumAllowed = 1;
|
|
92
|
-
/**
|
|
93
|
-
* Allows the user to select numbers on the grid
|
|
94
|
-
*/
|
|
95
|
-
this.selectable = true;
|
|
96
|
-
/**
|
|
97
|
-
* Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')
|
|
98
|
-
*/
|
|
99
|
-
this.selectedNumbers = '';
|
|
100
|
-
/**
|
|
101
|
-
* Show only selected numbers
|
|
102
|
-
*/
|
|
103
|
-
this.displaySelected = false;
|
|
104
|
-
/**
|
|
105
|
-
* Language
|
|
106
|
-
*/
|
|
107
|
-
this.language = 'en';
|
|
108
|
-
/**
|
|
109
|
-
* Personalize grid for ticket
|
|
110
|
-
*/
|
|
111
|
-
this.gridType = '';
|
|
112
|
-
/**
|
|
113
|
-
* Client custom styling via string
|
|
114
|
-
*/
|
|
115
|
-
this.clientStyling = '';
|
|
116
|
-
/**
|
|
117
|
-
* Client custom styling via url content
|
|
118
|
-
*/
|
|
119
|
-
this.clientStylingUrlContent = '';
|
|
120
|
-
this.numbers = [];
|
|
121
|
-
this.limitStylingAppends = false;
|
|
122
|
-
this.selectedCounter = 0;
|
|
123
|
-
this.setClientStyling = () => {
|
|
124
|
-
let sheet = document.createElement('style');
|
|
125
|
-
sheet.innerHTML = this.clientStyling;
|
|
126
|
-
this.stylingContainer.prepend(sheet);
|
|
127
|
-
};
|
|
128
|
-
this.setClientStylingURL = () => {
|
|
129
|
-
let cssFile = document.createElement('style');
|
|
130
|
-
setTimeout(() => {
|
|
131
|
-
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
132
|
-
this.stylingContainer.prepend(cssFile);
|
|
133
|
-
}, 1);
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
connectedCallback() {
|
|
137
|
-
let selected = [];
|
|
138
|
-
if (this.selectedNumbers.length > 0) {
|
|
139
|
-
selected = this.selectedNumbers.split(',');
|
|
140
|
-
this.selectedCounter = selected.length;
|
|
141
|
-
}
|
|
142
|
-
if (this.displaySelected) {
|
|
143
|
-
selected.forEach((item) => {
|
|
144
|
-
this.numbers.push({
|
|
145
|
-
number: item,
|
|
146
|
-
selected: true,
|
|
147
|
-
selectable: this.selectable
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
[...Array(this.totalNumbers).keys()]
|
|
153
|
-
.map(number => (number + 1).toString())
|
|
154
|
-
.forEach((number) => {
|
|
155
|
-
this.numbers.push({
|
|
156
|
-
number,
|
|
157
|
-
selected: selected.indexOf(number) >= 0 ? true : false,
|
|
158
|
-
selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
componentDidRender() {
|
|
164
|
-
// start custom styling area
|
|
165
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
166
|
-
if (this.clientStyling)
|
|
167
|
-
this.setClientStyling();
|
|
168
|
-
if (this.clientStylingUrlContent)
|
|
169
|
-
this.setClientStylingURL();
|
|
170
|
-
this.limitStylingAppends = true;
|
|
171
|
-
}
|
|
172
|
-
// end custom styling area
|
|
173
|
-
}
|
|
174
|
-
// wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
|
|
175
|
-
shuffleArray(array) {
|
|
176
|
-
const result = [];
|
|
177
|
-
while (array.length > 0) {
|
|
178
|
-
const randomIndex = Math.floor(Math.random() * (array.length));
|
|
179
|
-
result.push(array.splice(randomIndex, 1)[0]);
|
|
180
|
-
}
|
|
181
|
-
return result;
|
|
182
|
-
}
|
|
183
|
-
lotteryBulletSelectionHandler(event) {
|
|
184
|
-
this.numbers = this.numbers.map((item) => {
|
|
185
|
-
if (item.number == event.detail.value) {
|
|
186
|
-
return {
|
|
187
|
-
number: item.number,
|
|
188
|
-
selected: event.detail.selected,
|
|
189
|
-
selectable: item.selectable
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
return {
|
|
193
|
-
number: item.number,
|
|
194
|
-
selected: item.selected,
|
|
195
|
-
selectable: item.selectable
|
|
196
|
-
};
|
|
197
|
-
});
|
|
198
|
-
if (event.detail.selected) {
|
|
199
|
-
this.selectedCounter += 1;
|
|
200
|
-
if (this.selectedCounter == this.maximumAllowed) {
|
|
201
|
-
this.numbers = this.numbers.map((item) => {
|
|
202
|
-
return {
|
|
203
|
-
number: item.number,
|
|
204
|
-
selected: item.selected,
|
|
205
|
-
selectable: item.selected ? true : false
|
|
206
|
-
};
|
|
207
|
-
});
|
|
208
|
-
this.gridFilledEvent.emit({
|
|
209
|
-
id: this.ticketId,
|
|
210
|
-
index: this.gridIndex,
|
|
211
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
if (this.selectedCounter == this.maximumAllowed) {
|
|
217
|
-
this.numbers = this.numbers.map((item) => {
|
|
218
|
-
return {
|
|
219
|
-
number: item.number,
|
|
220
|
-
selected: item.selected,
|
|
221
|
-
selectable: true
|
|
222
|
-
};
|
|
223
|
-
});
|
|
224
|
-
this.gridDirtyEvent.emit({
|
|
225
|
-
id: this.ticketId,
|
|
226
|
-
index: this.gridIndex,
|
|
227
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
this.selectedCounter -= 1;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
async resetSelectionHandler(event) {
|
|
234
|
-
if (event.detail && event.detail == this.ticketId) {
|
|
235
|
-
this.selectedCounter = 0;
|
|
236
|
-
this.numbers = this.numbers.map((item) => {
|
|
237
|
-
return {
|
|
238
|
-
number: item.number,
|
|
239
|
-
selected: false,
|
|
240
|
-
selectable: this.selectable
|
|
241
|
-
};
|
|
242
|
-
});
|
|
243
|
-
this.gridDirtyEvent.emit({
|
|
244
|
-
id: this.ticketId,
|
|
245
|
-
index: this.gridIndex,
|
|
246
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
async autoSelectionHandler(event) {
|
|
251
|
-
if (event.detail && event.detail == this.ticketId) {
|
|
252
|
-
this.resetSelectionHandler(event);
|
|
253
|
-
let array = [...Array(this.totalNumbers).keys()]
|
|
254
|
-
.map(number => number + 1);
|
|
255
|
-
array = this.shuffleArray(array);
|
|
256
|
-
array = array.slice(0, this.minimumAllowed);
|
|
257
|
-
this.numbers = this.numbers.map((item) => {
|
|
258
|
-
return {
|
|
259
|
-
number: item.number,
|
|
260
|
-
selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
261
|
-
selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
262
|
-
};
|
|
263
|
-
});
|
|
264
|
-
this.gridFilledEvent.emit({
|
|
265
|
-
id: this.ticketId,
|
|
266
|
-
index: this.gridIndex,
|
|
267
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
268
|
-
});
|
|
269
|
-
this.selectedCounter = this.maximumAllowed;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
render() {
|
|
273
|
-
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 }))))));
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
LotteryGrid.style = lotteryGridCss;
|
|
277
|
-
|
|
278
|
-
exports.lottery_bullet = LotteryBullet;
|
|
279
|
-
exports.lottery_grid = LotteryGrid;
|
|
280
|
-
|
|
281
|
-
//# sourceMappingURL=lottery-bullet_2.cjs.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"lottery-bullet.lottery-grid.entry.cjs.js","mappings":";;;;;;AAAA,MAAM,gBAAgB,GAAG,i8FAAi8F;;MCC78F,aAAa;EACxB;;;;;;IAIE,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;;;;IAIjB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;;;;IAIvB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;;;;IAIxB,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;;;;IAIxB,IAAI,CAAC,uBAAuB,GAAG,EAAE,CAAC;IAClC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACjC,IAAI,CAAC,MAAM,GAAG;MACZ,IAAI,IAAI,CAAC,UAAU,EAAE;QACnB,I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AAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK;SACzE,CAAC;OACH,CAAC,CAAC;MACH,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;QACxB,EAAE,EAAE,IAAI,CAAC,QAAQ;QACjB,KAAK,EAAE,IAAI,CAAC,SAAS;QACrB,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC;OACzF,CAAC,CAAC;MACH,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC;KAC5C;GACF;EACD,MAAM;IACJ,QAAQA,OAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,EAAE,IAAI,IAAI,CAAC,gBAAgB,GAAG,EAAE,EAAE,EAChFA,OAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,KAAK,QAAQ,GAAG,iBAAiB,GAAG,MAAM,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,KAAKA,OAAC,CAAC,KAAK,EAAE,IAAI,EACnHA,OAAC,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,CAAC,aAAa,EAAE,4BAA4B,EAAE,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;GACnN;;;;;;;","names":["h"],"sources":["../lottery-bullet/dist/collection/components/lottery-bullet/lottery-bullet.css?tag=lottery-bullet&encapsulation=shadow","../lottery-bullet/dist/collection/components/lottery-bullet/lottery-bullet.js","../lottery-grid/dist/collection/components/lottery-grid/lottery-grid.css?tag=lottery-grid&encapsulation=shadow","../lottery-grid/dist/collection/components/lottery-grid/lottery-grid.js"],"sourcesContent":["@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");\n:host {\n display: block;\n font-family: \"Roboto\", sans-serif;\n}\n\n/*** Animation - Show */\n@-webkit-keyframes Circle {\n 0% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n}\n@keyframes Circle {\n 0% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n}\n/*** Animation - Hover */\n@-webkit-keyframes hover-rotate {\n 0% {\n -webkit-transform: scale(1) rotateZ(0);\n transform: scale(1) rotateZ(0);\n }\n 50% {\n -webkit-transform: scale(1.2) rotateZ(180deg);\n transform: scale(1.22) rotateZ(180deg);\n }\n 100% {\n -webkit-transform: scale(1) rotateZ(360deg);\n transform: scale(1) rotateZ(360deg);\n }\n}\n@keyframes hover-rotate {\n 0% {\n -webkit-transform: scale(1) rotateZ(0);\n transform: scale(1) rotateZ(0);\n }\n 50% {\n -webkit-transform: scale(1.2) rotateZ(180deg);\n transform: scale(1.2) rotateZ(180deg);\n }\n 100% {\n -webkit-transform: scale(1) rotateZ(360deg);\n transform: scale(1) rotateZ(360deg);\n }\n}\n/*** Animation - Selected */\n@-webkit-keyframes selected-scaleUp {\n 0% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n }\n 100% {\n -webkit-transform: scale(1.2);\n transform: scale(1.2);\n }\n}\n@keyframes selected-scaleUp {\n 0% {\n -webkit-transform: scale(0.5);\n transform: scale(0.5);\n }\n 100% {\n -webkit-transform: scale(1);\n transform: scale(1);\n }\n}\n.Circle {\n -webkit-animation: Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n animation: Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n cursor: pointer;\n color: #000000;\n display: block;\n height: 30px;\n width: 30px;\n margin: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n justify-content: center;\n align-items: center;\n border: solid 2px #ffffff;\n background: radial-gradient(circle at top, white 0%, white 100%);\n font-weight: bold;\n border-radius: 50%;\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.5);\n user-select: none;\n font-size: 16px;\n line-height: 16px;\n font-weight: 600;\n position: relative;\n}\n.Circle:hover {\n -webkit-animation: hover-rotate 0.4s linear both;\n animation: hover-rotate 0.4s linear both;\n background: radial-gradient(circle at top, white 0%, #f1f1f1 100%);\n}\n.Circle.Selected {\n -webkit-animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n color: #ffffff;\n background: #9EC258;\n background: -webkit-radial-gradient(top, #00958f, #004D4A);\n background: -moz-radial-gradient(top, #00958f, #004D4A);\n background: radial-gradient(to bottom, #00958f, #004D4A);\n border: solid 2px #00958f;\n}\n.Circle.Disabled {\n -webkit-animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n color: #f1f1f1;\n background: #D4D4D4;\n border: solid 2px #D4D4D4;\n cursor: default;\n}\n.Circle.DisabledSelected {\n -webkit-animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n animation: selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;\n color: #f1f1f1;\n background: #9EC258;\n background: -webkit-radial-gradient(top, #00958f, #004D4A);\n background: -moz-radial-gradient(top, #00958f, #004D4A);\n background: radial-gradient(to bottom, #00958f, #004D4A);\n border: solid 2px #D4D4D4;\n cursor: default;\n}","import { Component, h, Prop, Event, State } from '@stencil/core';\nexport class LotteryBullet {\n constructor() {\n /**\n * Value of the bullet\n */\n this.value = '0';\n /**\n * Marks if the bullet should be selectable\n */\n this.selectable = true;\n /**\n * Marks if the bullet should be selected\n */\n this.isSelected = false;\n /**\n * Client custom styling via string\n */\n this.clientStyling = '';\n /**\n * Client custom styling via url content\n */\n this.clientStylingUrlContent = '';\n this.limitStylingAppends = false;\n this.select = () => {\n if (this.selectable) {\n this.isSelected = !this.isSelected;\n this.bulletEvent.emit({\n value: this.value,\n selected: this.isSelected\n });\n }\n };\n this.setClientStyling = () => {\n let sheet = document.createElement('style');\n sheet.innerHTML = this.clientStyling;\n this.stylingContainer.prepend(sheet);\n };\n this.setClientStylingURL = () => {\n let cssFile = document.createElement('style');\n setTimeout(() => {\n cssFile.innerHTML = this.clientStylingUrlContent;\n this.stylingContainer.prepend(cssFile);\n }, 1);\n };\n }\n componentDidRender() {\n // start custom styling area\n if (!this.limitStylingAppends && this.stylingContainer) {\n if (this.clientStyling)\n this.setClientStyling();\n if (this.clientStylingUrlContent)\n this.setClientStylingURL();\n this.limitStylingAppends = true;\n }\n // end custom styling area\n }\n render() {\n return (h(\"div\", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));\n }\n static get is() { return \"lottery-bullet\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"lottery-bullet.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"lottery-bullet.css\"]\n }; }\n static get properties() { return {\n \"value\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Value of the bullet\"\n },\n \"attribute\": \"value\",\n \"reflect\": true,\n \"defaultValue\": \"'0'\"\n },\n \"selectable\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Marks if the bullet should be selectable\"\n },\n \"attribute\": \"selectable\",\n \"reflect\": true,\n \"defaultValue\": \"true\"\n },\n \"isSelected\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Marks if the bullet should be selected\"\n },\n \"attribute\": \"is-selected\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"clientStyling\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via string\"\n },\n \"attribute\": \"client-styling\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"clientStylingUrlContent\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via url content\"\n },\n \"attribute\": \"client-styling-url-content\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n }\n }; }\n static get states() { return {\n \"limitStylingAppends\": {}\n }; }\n static get events() { return [{\n \"method\": \"bulletEvent\",\n \"name\": \"lotteryBulletSelection\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"When a bullet is selected/deselected this event is emmited\"\n },\n \"complexType\": {\n \"original\": \"BulletEvent\",\n \"resolved\": \"BulletEvent\",\n \"references\": {\n \"BulletEvent\": {\n \"location\": \"import\",\n \"path\": \"./lottery-bullet.types\"\n }\n }\n }\n }]; }\n}\n","@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");\n:host {\n display: block;\n font-family: \"Roboto\", sans-serif;\n}\n\n.GridContainer {\n display: flex;\n flex-direction: column;\n max-width: 1200px;\n}\n\n.Grid {\n margin-top: 10px 0 10px 0;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n gap: 20px;\n}\n.Grid.TicketGrid {\n gap: 5px;\n}","import { Component, h, Prop, Listen, State, Event } from '@stencil/core';\n// import { translate } from '../../utils/locale.utils';\nimport '@everymatrix/lottery-bullet';\nexport class LotteryGrid {\n constructor() {\n /**\n * Number of bullets of grid\n */\n this.totalNumbers = 0;\n /**\n * Number of maximum bullets that can be selected\n */\n this.maximumAllowed = 0;\n /**\n * Minimum allowed of bullets\n */\n this.minimumAllowed = 1;\n /**\n * Allows the user to select numbers on the grid\n */\n this.selectable = true;\n /**\n * Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')\n */\n this.selectedNumbers = '';\n /**\n * Show only selected numbers\n */\n this.displaySelected = false;\n /**\n * Language\n */\n this.language = 'en';\n /**\n * Personalize grid for ticket\n */\n this.gridType = '';\n /**\n * Client custom styling via string\n */\n this.clientStyling = '';\n /**\n * Client custom styling via url content\n */\n this.clientStylingUrlContent = '';\n this.numbers = [];\n this.limitStylingAppends = false;\n this.selectedCounter = 0;\n this.setClientStyling = () => {\n let sheet = document.createElement('style');\n sheet.innerHTML = this.clientStyling;\n this.stylingContainer.prepend(sheet);\n };\n this.setClientStylingURL = () => {\n let cssFile = document.createElement('style');\n setTimeout(() => {\n cssFile.innerHTML = this.clientStylingUrlContent;\n this.stylingContainer.prepend(cssFile);\n }, 1);\n };\n }\n connectedCallback() {\n let selected = [];\n if (this.selectedNumbers.length > 0) {\n selected = this.selectedNumbers.split(',');\n this.selectedCounter = selected.length;\n }\n if (this.displaySelected) {\n selected.forEach((item) => {\n this.numbers.push({\n number: item,\n selected: true,\n selectable: this.selectable\n });\n });\n }\n else {\n [...Array(this.totalNumbers).keys()]\n .map(number => (number + 1).toString())\n .forEach((number) => {\n this.numbers.push({\n number,\n selected: selected.indexOf(number) >= 0 ? true : false,\n selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable\n });\n });\n }\n }\n componentDidRender() {\n // start custom styling area\n if (!this.limitStylingAppends && this.stylingContainer) {\n if (this.clientStyling)\n this.setClientStyling();\n if (this.clientStylingUrlContent)\n this.setClientStylingURL();\n this.limitStylingAppends = true;\n }\n // end custom styling area\n }\n // wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices\n shuffleArray(array) {\n const result = [];\n while (array.length > 0) {\n const randomIndex = Math.floor(Math.random() * (array.length));\n result.push(array.splice(randomIndex, 1)[0]);\n }\n return result;\n }\n lotteryBulletSelectionHandler(event) {\n this.numbers = this.numbers.map((item) => {\n if (item.number == event.detail.value) {\n return {\n number: item.number,\n selected: event.detail.selected,\n selectable: item.selectable\n };\n }\n return {\n number: item.number,\n selected: item.selected,\n selectable: item.selectable\n };\n });\n if (event.detail.selected) {\n this.selectedCounter += 1;\n if (this.selectedCounter == this.maximumAllowed) {\n this.numbers = this.numbers.map((item) => {\n return {\n number: item.number,\n selected: item.selected,\n selectable: item.selected ? true : false\n };\n });\n this.gridFilledEvent.emit({\n id: this.ticketId,\n index: this.gridIndex,\n selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)\n });\n }\n }\n else {\n if (this.selectedCounter == this.maximumAllowed) {\n this.numbers = this.numbers.map((item) => {\n return {\n number: item.number,\n selected: item.selected,\n selectable: true\n };\n });\n this.gridDirtyEvent.emit({\n id: this.ticketId,\n index: this.gridIndex,\n selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)\n });\n }\n this.selectedCounter -= 1;\n }\n }\n async resetSelectionHandler(event) {\n if (event.detail && event.detail == this.ticketId) {\n this.selectedCounter = 0;\n this.numbers = this.numbers.map((item) => {\n return {\n number: item.number,\n selected: false,\n selectable: this.selectable\n };\n });\n this.gridDirtyEvent.emit({\n id: this.ticketId,\n index: this.gridIndex,\n selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)\n });\n }\n }\n async autoSelectionHandler(event) {\n if (event.detail && event.detail == this.ticketId) {\n this.resetSelectionHandler(event);\n let array = [...Array(this.totalNumbers).keys()]\n .map(number => number + 1);\n array = this.shuffleArray(array);\n array = array.slice(0, this.minimumAllowed);\n this.numbers = this.numbers.map((item) => {\n return {\n number: item.number,\n selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,\n selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,\n };\n });\n this.gridFilledEvent.emit({\n id: this.ticketId,\n index: this.gridIndex,\n selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)\n });\n this.selectedCounter = this.maximumAllowed;\n }\n }\n render() {\n return (h(\"div\", { class: \"GridContainer\", ref: el => this.stylingContainer = el },\n h(\"div\", { class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => h(\"div\", null,\n h(\"lottery-bullet\", { value: item.number, selectable: item.selectable, \"is-selected\": item.selected, \"client-styling\": this.clientStyling, \"client-styling-url-content\": this.clientStylingUrlContent }))))));\n }\n static get is() { return \"lottery-grid\"; }\n static get encapsulation() { return \"shadow\"; }\n static get originalStyleUrls() { return {\n \"$\": [\"lottery-grid.scss\"]\n }; }\n static get styleUrls() { return {\n \"$\": [\"lottery-grid.css\"]\n }; }\n static get properties() { return {\n \"ticketId\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Identifier for the ticket\"\n },\n \"attribute\": \"ticket-id\",\n \"reflect\": true\n },\n \"totalNumbers\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Number of bullets of grid\"\n },\n \"attribute\": \"total-numbers\",\n \"reflect\": true,\n \"defaultValue\": \"0\"\n },\n \"gameId\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Game ID\"\n },\n \"attribute\": \"game-id\",\n \"reflect\": true\n },\n \"maximumAllowed\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Number of maximum bullets that can be selected\"\n },\n \"attribute\": \"maximum-allowed\",\n \"reflect\": true,\n \"defaultValue\": \"0\"\n },\n \"minimumAllowed\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Minimum allowed of bullets\"\n },\n \"attribute\": \"minimum-allowed\",\n \"reflect\": true,\n \"defaultValue\": \"1\"\n },\n \"selectable\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Allows the user to select numbers on the grid\"\n },\n \"attribute\": \"selectable\",\n \"reflect\": true,\n \"defaultValue\": \"true\"\n },\n \"selectedNumbers\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')\"\n },\n \"attribute\": \"selected-numbers\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"displaySelected\": {\n \"type\": \"boolean\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"boolean\",\n \"resolved\": \"boolean\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Show only selected numbers\"\n },\n \"attribute\": \"display-selected\",\n \"reflect\": true,\n \"defaultValue\": \"false\"\n },\n \"language\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Language\"\n },\n \"attribute\": \"language\",\n \"reflect\": true,\n \"defaultValue\": \"'en'\"\n },\n \"gridIndex\": {\n \"type\": \"number\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"number\",\n \"resolved\": \"number\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"The index of the number\"\n },\n \"attribute\": \"grid-index\",\n \"reflect\": true\n },\n \"gridType\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Personalize grid for ticket\"\n },\n \"attribute\": \"grid-type\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"clientStyling\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via string\"\n },\n \"attribute\": \"client-styling\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n },\n \"clientStylingUrlContent\": {\n \"type\": \"string\",\n \"mutable\": false,\n \"complexType\": {\n \"original\": \"string\",\n \"resolved\": \"string\",\n \"references\": {}\n },\n \"required\": false,\n \"optional\": false,\n \"docs\": {\n \"tags\": [],\n \"text\": \"Client custom styling via url content\"\n },\n \"attribute\": \"client-styling-url-content\",\n \"reflect\": true,\n \"defaultValue\": \"''\"\n }\n }; }\n static get states() { return {\n \"numbers\": {},\n \"limitStylingAppends\": {}\n }; }\n static get events() { return [{\n \"method\": \"gridFilledEvent\",\n \"name\": \"gridFilled\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"When the grid is completed, it emits this event with selected numbers\"\n },\n \"complexType\": {\n \"original\": \"GridEvent\",\n \"resolved\": \"GridEvent\",\n \"references\": {\n \"GridEvent\": {\n \"location\": \"import\",\n \"path\": \"./lottery-grid.types\"\n }\n }\n }\n }, {\n \"method\": \"gridDirtyEvent\",\n \"name\": \"gridDirty\",\n \"bubbles\": true,\n \"cancelable\": true,\n \"composed\": true,\n \"docs\": {\n \"tags\": [],\n \"text\": \"When the grid is uncomplete after being completed once (reset or change), it emits this event\"\n },\n \"complexType\": {\n \"original\": \"GridEvent\",\n \"resolved\": \"GridEvent\",\n \"references\": {\n \"GridEvent\": {\n \"location\": \"import\",\n \"path\": \"./lottery-grid.types\"\n }\n }\n }\n }]; }\n static get listeners() { return [{\n \"name\": \"lotteryBulletSelection\",\n \"method\": \"lotteryBulletSelectionHandler\",\n \"target\": undefined,\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"resetSelection\",\n \"method\": \"resetSelectionHandler\",\n \"target\": \"document\",\n \"capture\": false,\n \"passive\": false\n }, {\n \"name\": \"autoSelection\",\n \"method\": \"autoSelectionHandler\",\n \"target\": \"document\",\n \"capture\": false,\n \"passive\": false\n }]; }\n}\n"],"version":3}
|
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-cd44e726.js');
|
|
6
|
-
|
|
7
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
9
|
-
const TRANSLATIONS = {
|
|
10
|
-
en: {
|
|
11
|
-
drawResultsHeader: 'Draw results history',
|
|
12
|
-
drawId: 'Draw ID',
|
|
13
|
-
drawDate: 'Draw Date',
|
|
14
|
-
drawNumbersGridA: 'Draw numbers Grid A',
|
|
15
|
-
viewAllResults: 'View All',
|
|
16
|
-
lastFiveDraws: 'Last 5 Draws',
|
|
17
|
-
lastTenDraws: 'Last 10 Draws',
|
|
18
|
-
lastFifteenDraws: 'Last 15 Draws',
|
|
19
|
-
allDrawResultsHistory: 'All Draw Results History',
|
|
20
|
-
noResults: 'No results',
|
|
21
|
-
fetchingResults: 'Fetching results'
|
|
22
|
-
},
|
|
23
|
-
ro: {
|
|
24
|
-
drawResultsHeader: 'Istoricul extragerilor',
|
|
25
|
-
drawId: 'ID-ul extragerii',
|
|
26
|
-
drawDate: 'Data extragerii',
|
|
27
|
-
drawNumbersGridA: 'Numerele extrase Grid A',
|
|
28
|
-
viewAllResults: 'Vezi toate rezultatele',
|
|
29
|
-
lastFiveDraws: 'Ultimile 5 extrageri',
|
|
30
|
-
lastTenDraws: 'Ultimile 10 extrageri',
|
|
31
|
-
lastFifteenDraws: 'Ultimile 15 extrageri',
|
|
32
|
-
allDrawResultsHistory: 'Istoricul tuturor extragerilor',
|
|
33
|
-
noResults: 'Niciun rezultat',
|
|
34
|
-
fetchingResults: 'Se obtin rezultatele'
|
|
35
|
-
},
|
|
36
|
-
fr: {
|
|
37
|
-
drawResultsHeader: 'Dessiner l\'historique des résultats',
|
|
38
|
-
drawId: 'ID de tirage',
|
|
39
|
-
drawDate: 'Date du tirage',
|
|
40
|
-
drawNumbersGridA: 'Tirage des numéros Grille',
|
|
41
|
-
viewAllResults: 'Voir tout',
|
|
42
|
-
lastFiveDraws: '5 derniers tirages',
|
|
43
|
-
lastTenDraws: '10 derniers tirages',
|
|
44
|
-
lastFifteenDraws: '15 derniers tirages',
|
|
45
|
-
allDrawResultsHistory: 'Historique des résultats de tous les tirages',
|
|
46
|
-
noResults: 'Aucun résultat',
|
|
47
|
-
fetchingResults: 'Récupération des résultats'
|
|
48
|
-
},
|
|
49
|
-
ar: {
|
|
50
|
-
drawResultsHeader: 'سجل نتائج السحب',
|
|
51
|
-
drawId: 'معرّف السحب',
|
|
52
|
-
drawDate: 'تاريخ السحب',
|
|
53
|
-
drawNumbersGridA: 'شبكة أرقام السحب',
|
|
54
|
-
viewAllResults: 'عرض الكل',
|
|
55
|
-
lastFiveDraws: 'آخر 5 سحوبات',
|
|
56
|
-
lastTenDraws: 'آخر 10 سحوبات',
|
|
57
|
-
lastFifteenDraws: 'آخر 15 سحبًا',
|
|
58
|
-
allDrawResultsHistory: 'سجل نتائج كل السحوبات',
|
|
59
|
-
noResults: 'لا توجد نتائج',
|
|
60
|
-
fetchingResults: 'جلب النتائج'
|
|
61
|
-
},
|
|
62
|
-
hr: {
|
|
63
|
-
drawResultsHeader: 'Povijest rezultata izvlačenja',
|
|
64
|
-
drawId: 'ID izvlačenja',
|
|
65
|
-
drawDate: 'Datum izvlačenja',
|
|
66
|
-
drawNumbersGridA: 'Izvučeni brojevi tablica A',
|
|
67
|
-
viewAllResults: 'Pogledaj sve',
|
|
68
|
-
lastFiveDraws: 'Zadnjih 5 izvlačenja',
|
|
69
|
-
lastTenDraws: 'Zadnjih 10 izvlačenja',
|
|
70
|
-
lastFifteenDraws: 'Zadnjih 15 izvlačenja',
|
|
71
|
-
allDrawResultsHistory: 'Povijest svih rezultata izvlačenja',
|
|
72
|
-
noResults: 'Nema rezultata',
|
|
73
|
-
fetchingResults: 'Dohvaćanje rezultata'
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
const translate = (key, customLang) => {
|
|
77
|
-
const lang = customLang;
|
|
78
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const lotteryDrawResultsHistoryCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #009993;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px;cursor:pointer}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.DrawResultsSection{max-width:600px;margin:0px auto}.HistoryGrid{border-radius:5px}.DrawResultsHeader{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:#009993;padding:10px;text-align:center;color:#fff;padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:#009993;color:#fff;outline:none}.FilterSection{display:flex;justify-content:space-between;padding:25px 15px 10px;gap:10px;margin:0px 15px}.FilterSection .FilterResultsContainer{display:flex;gap:5px;overflow-x:auto}.FilterSection .QuickFilterButton{cursor:pointer;width:max-content;border-radius:4px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .QuickFilterButton:hover{background:#F1F1F1}.FilterSection helper-filters{margin-left:auto}";
|
|
82
|
-
|
|
83
|
-
const LotteryDrawResultsHistory = class {
|
|
84
|
-
constructor(hostRef) {
|
|
85
|
-
index.registerInstance(this, hostRef);
|
|
86
|
-
/**
|
|
87
|
-
* The number of results to be displayed
|
|
88
|
-
*/
|
|
89
|
-
this.numberOfResults = 3;
|
|
90
|
-
/**
|
|
91
|
-
*Language
|
|
92
|
-
*/
|
|
93
|
-
this.language = 'en';
|
|
94
|
-
/**
|
|
95
|
-
* Client custom styling via string
|
|
96
|
-
*/
|
|
97
|
-
this.clientStyling = '';
|
|
98
|
-
/**
|
|
99
|
-
* Client custom styling via url content
|
|
100
|
-
*/
|
|
101
|
-
this.clientStylingUrlContent = '';
|
|
102
|
-
this.drawData = [];
|
|
103
|
-
this.winningDataSetsData = [''];
|
|
104
|
-
this.displayAllDrawsResults = true;
|
|
105
|
-
this.showQuickFilters = true;
|
|
106
|
-
this.dateFiltersFrom = '';
|
|
107
|
-
this.dateFiltersTo = '';
|
|
108
|
-
this.isLoading = false;
|
|
109
|
-
this.noResults = false;
|
|
110
|
-
this.limitStylingAppends = false;
|
|
111
|
-
this.getDrawsData = () => {
|
|
112
|
-
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws`);
|
|
113
|
-
if (this.dateFiltersFrom)
|
|
114
|
-
url.searchParams.append('from', this.dateFiltersFrom);
|
|
115
|
-
if (this.dateFiltersTo)
|
|
116
|
-
url.searchParams.append('to', this.dateFiltersTo);
|
|
117
|
-
fetch(url.href)
|
|
118
|
-
.then((res) => {
|
|
119
|
-
if (res.status >= 300) {
|
|
120
|
-
throw new Error('There was an error while fetching the data');
|
|
121
|
-
}
|
|
122
|
-
return res.json();
|
|
123
|
-
})
|
|
124
|
-
.then((data) => {
|
|
125
|
-
this.winningDataSetsData = data.items.filter(draw => draw.winningNumbers);
|
|
126
|
-
this.drawData = this.winningDataSetsData.map((item) => item);
|
|
127
|
-
})
|
|
128
|
-
.catch((err) => {
|
|
129
|
-
console.log('err', err);
|
|
130
|
-
})
|
|
131
|
-
.finally(() => {
|
|
132
|
-
this.isLoading = false;
|
|
133
|
-
this.noResults = this.drawData.filter(draw => draw.winningNumbers).length == 0 ? true : false;
|
|
134
|
-
});
|
|
135
|
-
};
|
|
136
|
-
this.filterResults = (resultsNumber) => {
|
|
137
|
-
this.numberOfResults = resultsNumber;
|
|
138
|
-
this.displayAllDrawsResults = true;
|
|
139
|
-
};
|
|
140
|
-
this.getDrawResults = (drawID) => {
|
|
141
|
-
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawID}`);
|
|
142
|
-
let drawOptions = {
|
|
143
|
-
method: "GET",
|
|
144
|
-
headers: {
|
|
145
|
-
'Content-Type': "application/json",
|
|
146
|
-
'Accept': 'application/json',
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
fetch(url.href, drawOptions)
|
|
150
|
-
.then((response) => {
|
|
151
|
-
if (response.status == 404)
|
|
152
|
-
this.noResults = true;
|
|
153
|
-
return response.json();
|
|
154
|
-
})
|
|
155
|
-
.then((data) => {
|
|
156
|
-
this.drawData = [data].map((item) => item);
|
|
157
|
-
})
|
|
158
|
-
.catch((err) => {
|
|
159
|
-
console.log('err', err);
|
|
160
|
-
})
|
|
161
|
-
.finally(() => {
|
|
162
|
-
this.isLoading = false;
|
|
163
|
-
});
|
|
164
|
-
};
|
|
165
|
-
this.viewAllResults = () => {
|
|
166
|
-
this.numberOfResults = this.drawData.length;
|
|
167
|
-
this.displayAllDrawsResults = false;
|
|
168
|
-
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
169
|
-
};
|
|
170
|
-
this.setClientStyling = () => {
|
|
171
|
-
let sheet = document.createElement('style');
|
|
172
|
-
sheet.innerHTML = this.clientStyling;
|
|
173
|
-
this.stylingContainer.prepend(sheet);
|
|
174
|
-
};
|
|
175
|
-
this.setClientStylingURL = () => {
|
|
176
|
-
let cssFile = document.createElement('style');
|
|
177
|
-
setTimeout(() => {
|
|
178
|
-
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
179
|
-
this.stylingContainer.prepend(cssFile);
|
|
180
|
-
}, 1);
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
// Filters events
|
|
184
|
-
// @Listen('filterDraw')
|
|
185
|
-
// filtersDrawHandler(event: CustomEvent<any>):void {
|
|
186
|
-
// this.isLoading = true;
|
|
187
|
-
// this.showQuickFilters = false;
|
|
188
|
-
// }
|
|
189
|
-
filtersHandler(event) {
|
|
190
|
-
this.showQuickFilters = false;
|
|
191
|
-
this.isLoading = true;
|
|
192
|
-
if (event.detail.ticketDrawId) {
|
|
193
|
-
this.getDrawResults(event.detail.ticketDrawId);
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
this.dateFiltersFrom = event.detail.filterFromCalendar;
|
|
197
|
-
this.dateFiltersTo = event.detail.filterToCalendar;
|
|
198
|
-
this.getDrawsData();
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
clearFiltersHandler() {
|
|
202
|
-
this.showQuickFilters = true;
|
|
203
|
-
this.dateFiltersFrom = '';
|
|
204
|
-
this.dateFiltersTo = '';
|
|
205
|
-
this.drawData = this.winningDataSetsData;
|
|
206
|
-
this.isLoading = true;
|
|
207
|
-
this.getDrawsData();
|
|
208
|
-
}
|
|
209
|
-
connectedCallback() {
|
|
210
|
-
if (this.showQuickFilters)
|
|
211
|
-
this.getDrawsData();
|
|
212
|
-
}
|
|
213
|
-
disconnectedCallback() {
|
|
214
|
-
clearInterval(this.interval);
|
|
215
|
-
}
|
|
216
|
-
componentDidRender() {
|
|
217
|
-
// start custom styling area
|
|
218
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
219
|
-
if (this.clientStyling)
|
|
220
|
-
this.setClientStyling();
|
|
221
|
-
if (this.clientStylingUrlContent)
|
|
222
|
-
this.setClientStylingURL();
|
|
223
|
-
this.limitStylingAppends = true;
|
|
224
|
-
}
|
|
225
|
-
// end custom styling area
|
|
226
|
-
}
|
|
227
|
-
render() {
|
|
228
|
-
let gridHeader = index.h("div", { class: "DrawResultsHeader" }, this.displayAllDrawsResults ? index.h("h4", null, translate('drawResultsHeader', this.language)) :
|
|
229
|
-
[index.h("div", { class: "DrawResultsHeaderContent" }, index.h("h4", null, translate('allDrawResultsHistory', this.language)), index.h("div", { class: "FilterSection" }, this.showQuickFilters &&
|
|
230
|
-
index.h("div", { class: "FilterResultsContainer" }, index.h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(5) }, translate('lastFiveDraws', this.language)), index.h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(10) }, translate('lastTenDraws', this.language)), index.h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(15) }, translate('lastFifteenDraws', this.language))), index.h("helper-filters", { "show-filter-id": "true", "activate-ticket-search": "false", "game-id": this.gameId, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))),
|
|
231
|
-
]);
|
|
232
|
-
return index.h("section", { class: "GridWrapper", ref: el => this.stylingContainer = el }, index.h("div", { class: "DrawResultsSection" }, index.h("div", { class: "DrawResultsAreaHistory" }, gridHeader, index.h("div", { class: "HistoryGridWrapper" }, index.h("div", { class: "HistoryGrid" }, this.isLoading &&
|
|
233
|
-
index.h("p", null, translate('fetchingResults', this.language)), !this.isLoading && !this.noResults && this.drawData.map((item) => index.h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, "draw-id": item.id, "draw-mode": true, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })).reverse().slice(0, this.numberOfResults), !this.isLoading && this.noResults && (index.h("p", null, translate('noResults', this.language))))), this.displayAllDrawsResults && index.h("button", { class: "ViewAllResults", onClick: this.viewAllResults }, translate('viewAllResults', this.language)))));
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
LotteryDrawResultsHistory.style = lotteryDrawResultsHistoryCss;
|
|
237
|
-
|
|
238
|
-
exports.lottery_draw_results_history = LotteryDrawResultsHistory;
|
|
239
|
-
|
|
240
|
-
//# sourceMappingURL=lottery-draw-results-history.cjs.entry.js.map
|