@everymatrix/lottery-grid 1.44.0 → 1.45.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/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-402a1909.js +1276 -0
- package/dist/cjs/loader.cjs.js +6 -12
- package/dist/cjs/lottery-bullet_2.cjs.entry.js +212 -252
- package/dist/cjs/lottery-grid.cjs.js +16 -10
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/lottery-grid/index.js +1 -0
- package/dist/collection/components/lottery-grid/lottery-grid.js +473 -488
- package/dist/collection/utils/locale.utils.js +22 -22
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-d55f95ff.js +1249 -0
- package/dist/esm/loader.js +6 -12
- package/dist/esm/lottery-bullet_2.entry.js +212 -252
- package/dist/esm/lottery-grid.js +13 -10
- package/dist/lottery-grid/lottery-grid.esm.js +1 -1
- package/dist/lottery-grid/p-205e4975.entry.js +1 -0
- package/dist/lottery-grid/p-2a12d7f8.js +2 -0
- package/dist/lottery-grid/p-e1255160.js +1 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-grid/.stencil/packages/stencil/lottery-grid/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-grid/.stencil/packages/stencil/lottery-grid/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/lottery-grid/index.d.ts +1 -0
- package/dist/types/components/lottery-grid/lottery-grid.d.ts +74 -74
- package/dist/types/components/lottery-grid/lottery-grid.types.d.ts +8 -8
- package/dist/types/components.d.ts +19 -2
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +9 -2
- package/dist/cjs/index-dfe5695c.js +0 -1249
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/lottery-bullet.js +0 -6
- package/dist/components/lottery-bullet2.js +0 -91
- package/dist/components/lottery-grid.d.ts +0 -11
- package/dist/components/lottery-grid.js +0 -248
- package/dist/esm/index-c15ec15f.js +0 -1223
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/lottery-grid/p-6caa0d6c.entry.js +0 -1
- package/dist/lottery-grid/p-8a854495.js +0 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/lottery-grid/.stencil/packages/lottery-grid/stencil.config.d.ts +0 -2
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* LotteryGrid custom elements */
|
|
2
|
-
|
|
3
|
-
import type { Components, JSX } from "../types/components";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Used to manually set the base path where assets can be found.
|
|
7
|
-
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
8
|
-
* such as "setAssetPath(import.meta.url)". Other options include
|
|
9
|
-
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
10
|
-
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
11
|
-
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
12
|
-
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
13
|
-
* will have to ensure the static assets are copied to its build directory.
|
|
14
|
-
*/
|
|
15
|
-
export declare const setAssetPath: (path: string) => void;
|
|
16
|
-
|
|
17
|
-
export interface SetPlatformOptions {
|
|
18
|
-
raf?: (c: FrameRequestCallback) => number;
|
|
19
|
-
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
|
-
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
-
|
|
24
|
-
export type { Components, JSX };
|
|
25
|
-
|
|
26
|
-
export * from '../types';
|
package/dist/components/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
const lotteryBulletCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}@-webkit-keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes Circle{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.22) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@keyframes hover-rotate{0%{-webkit-transform:scale(1) rotateZ(0);transform:scale(1) rotateZ(0)}50%{-webkit-transform:scale(1.2) rotateZ(180deg);transform:scale(1.2) rotateZ(180deg)}100%{-webkit-transform:scale(1) rotateZ(360deg);transform:scale(1) rotateZ(360deg)}}@-webkit-keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1.2);transform:scale(1.2)}}@keyframes selected-scaleUp{0%{-webkit-transform:scale(0.5);transform:scale(0.5)}100%{-webkit-transform:scale(1);transform:scale(1)}}.Circle{-webkit-animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:Circle 0.8s cubic-bezier(0.39, 0.575, 0.565, 1) both;cursor:pointer;color:#000000;display:block;height:30px;width:30px;margin:0;display:flex;align-items:center;justify-content:center;justify-content:center;align-items:center;border:solid 2px #ffffff;background:radial-gradient(circle at top, white 0%, white 100%);font-weight:bold;border-radius:50%;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.5);user-select:none;font-size:16px;line-height:16px;font-weight:600;position:relative}.Circle:hover{-webkit-animation:hover-rotate 0.4s linear both;animation:hover-rotate 0.4s linear both;background:radial-gradient(circle at top, white 0%, #f1f1f1 100%)}.Circle.Selected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#ffffff;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #00958f}.Circle.Disabled{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#D4D4D4;border:solid 2px #D4D4D4;cursor:default}.Circle.DisabledSelected{-webkit-animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;animation:selected-scaleUp 0.4s cubic-bezier(0.39, 0.575, 0.565, 1) both;color:#f1f1f1;background:#9EC258;background:-webkit-radial-gradient(top, #00958f, #004D4A);background:-moz-radial-gradient(top, #00958f, #004D4A);background:radial-gradient(to bottom, #00958f, #004D4A);border:solid 2px #D4D4D4;cursor:default}";
|
|
4
|
-
|
|
5
|
-
const LotteryBullet = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
-
constructor() {
|
|
7
|
-
super();
|
|
8
|
-
this.__registerHost();
|
|
9
|
-
this.__attachShadow();
|
|
10
|
-
this.bulletEvent = createEvent(this, "lotteryBulletSelection", 7);
|
|
11
|
-
/**
|
|
12
|
-
* Value of the bullet
|
|
13
|
-
*/
|
|
14
|
-
this.value = '0';
|
|
15
|
-
/**
|
|
16
|
-
* Marks if the bullet should be selectable
|
|
17
|
-
*/
|
|
18
|
-
this.selectable = true;
|
|
19
|
-
/**
|
|
20
|
-
* Marks if the bullet should be selected
|
|
21
|
-
*/
|
|
22
|
-
this.isSelected = false;
|
|
23
|
-
/**
|
|
24
|
-
* Client custom styling via string
|
|
25
|
-
*/
|
|
26
|
-
this.clientStyling = '';
|
|
27
|
-
/**
|
|
28
|
-
* Client custom styling via url content
|
|
29
|
-
*/
|
|
30
|
-
this.clientStylingUrlContent = '';
|
|
31
|
-
this.limitStylingAppends = false;
|
|
32
|
-
this.select = () => {
|
|
33
|
-
if (this.selectable) {
|
|
34
|
-
this.isSelected = !this.isSelected;
|
|
35
|
-
this.bulletEvent.emit({
|
|
36
|
-
value: this.value,
|
|
37
|
-
selected: this.isSelected
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
this.setClientStyling = () => {
|
|
42
|
-
let sheet = document.createElement('style');
|
|
43
|
-
sheet.innerHTML = this.clientStyling;
|
|
44
|
-
this.stylingContainer.prepend(sheet);
|
|
45
|
-
};
|
|
46
|
-
this.setClientStylingURL = () => {
|
|
47
|
-
let cssFile = document.createElement('style');
|
|
48
|
-
setTimeout(() => {
|
|
49
|
-
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
50
|
-
this.stylingContainer.prepend(cssFile);
|
|
51
|
-
}, 1);
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
componentDidRender() {
|
|
55
|
-
// start custom styling area
|
|
56
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
57
|
-
if (this.clientStyling)
|
|
58
|
-
this.setClientStyling();
|
|
59
|
-
if (this.clientStylingUrlContent)
|
|
60
|
-
this.setClientStylingURL();
|
|
61
|
-
this.limitStylingAppends = true;
|
|
62
|
-
}
|
|
63
|
-
// end custom styling area
|
|
64
|
-
}
|
|
65
|
-
render() {
|
|
66
|
-
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
|
|
67
|
-
}
|
|
68
|
-
static get style() { return lotteryBulletCss; }
|
|
69
|
-
}, [1, "lottery-bullet", {
|
|
70
|
-
"value": [513],
|
|
71
|
-
"selectable": [516],
|
|
72
|
-
"isSelected": [516, "is-selected"],
|
|
73
|
-
"clientStyling": [513, "client-styling"],
|
|
74
|
-
"clientStylingUrlContent": [513, "client-styling-url-content"],
|
|
75
|
-
"limitStylingAppends": [32]
|
|
76
|
-
}]);
|
|
77
|
-
function defineCustomElement() {
|
|
78
|
-
if (typeof customElements === "undefined") {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const components = ["lottery-bullet"];
|
|
82
|
-
components.forEach(tagName => { switch (tagName) {
|
|
83
|
-
case "lottery-bullet":
|
|
84
|
-
if (!customElements.get(tagName)) {
|
|
85
|
-
customElements.define(tagName, LotteryBullet);
|
|
86
|
-
}
|
|
87
|
-
break;
|
|
88
|
-
} });
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export { LotteryBullet as L, defineCustomElement as d };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Components, JSX } from "../types/components";
|
|
2
|
-
|
|
3
|
-
interface LotteryGrid extends Components.LotteryGrid, HTMLElement {}
|
|
4
|
-
export const LotteryGrid: {
|
|
5
|
-
prototype: LotteryGrid;
|
|
6
|
-
new (): LotteryGrid;
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Used to define this component and all nested components recursively.
|
|
10
|
-
*/
|
|
11
|
-
export const defineCustomElement: () => void;
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { d as defineCustomElement$2 } from './lottery-bullet2.js';
|
|
3
|
-
|
|
4
|
-
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}";
|
|
5
|
-
|
|
6
|
-
const LotteryGrid$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.__registerHost();
|
|
10
|
-
this.__attachShadow();
|
|
11
|
-
this.gridFilledEvent = createEvent(this, "gridFilled", 7);
|
|
12
|
-
this.gridDirtyEvent = createEvent(this, "gridDirty", 7);
|
|
13
|
-
/**
|
|
14
|
-
* Number of bullets of grid
|
|
15
|
-
*/
|
|
16
|
-
this.totalNumbers = 0;
|
|
17
|
-
/**
|
|
18
|
-
* Number of maximum bullets that can be selected
|
|
19
|
-
*/
|
|
20
|
-
this.maximumAllowed = 0;
|
|
21
|
-
/**
|
|
22
|
-
* Minimum allowed of bullets
|
|
23
|
-
*/
|
|
24
|
-
this.minimumAllowed = 1;
|
|
25
|
-
/**
|
|
26
|
-
* Allows the user to select numbers on the grid
|
|
27
|
-
*/
|
|
28
|
-
this.selectable = true;
|
|
29
|
-
/**
|
|
30
|
-
* Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')
|
|
31
|
-
*/
|
|
32
|
-
this.selectedNumbers = '';
|
|
33
|
-
/**
|
|
34
|
-
* Show only selected numbers
|
|
35
|
-
*/
|
|
36
|
-
this.displaySelected = false;
|
|
37
|
-
/**
|
|
38
|
-
* Language
|
|
39
|
-
*/
|
|
40
|
-
this.language = 'en';
|
|
41
|
-
/**
|
|
42
|
-
* Personalize grid for ticket
|
|
43
|
-
*/
|
|
44
|
-
this.gridType = '';
|
|
45
|
-
/**
|
|
46
|
-
* Client custom styling via string
|
|
47
|
-
*/
|
|
48
|
-
this.clientStyling = '';
|
|
49
|
-
/**
|
|
50
|
-
* Client custom styling via url content
|
|
51
|
-
*/
|
|
52
|
-
this.clientStylingUrlContent = '';
|
|
53
|
-
this.numbers = [];
|
|
54
|
-
this.limitStylingAppends = false;
|
|
55
|
-
this.selectedCounter = 0;
|
|
56
|
-
this.setClientStyling = () => {
|
|
57
|
-
let sheet = document.createElement('style');
|
|
58
|
-
sheet.innerHTML = this.clientStyling;
|
|
59
|
-
this.stylingContainer.prepend(sheet);
|
|
60
|
-
};
|
|
61
|
-
this.setClientStylingURL = () => {
|
|
62
|
-
let cssFile = document.createElement('style');
|
|
63
|
-
setTimeout(() => {
|
|
64
|
-
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
65
|
-
this.stylingContainer.prepend(cssFile);
|
|
66
|
-
}, 1);
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
connectedCallback() {
|
|
70
|
-
let selected = [];
|
|
71
|
-
if (this.selectedNumbers.length > 0) {
|
|
72
|
-
selected = this.selectedNumbers.split(',');
|
|
73
|
-
this.selectedCounter = selected.length;
|
|
74
|
-
}
|
|
75
|
-
if (this.displaySelected) {
|
|
76
|
-
selected.forEach((item) => {
|
|
77
|
-
this.numbers.push({
|
|
78
|
-
number: item,
|
|
79
|
-
selected: true,
|
|
80
|
-
selectable: this.selectable
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
[...Array(this.totalNumbers).keys()]
|
|
86
|
-
.map(number => (number + 1).toString())
|
|
87
|
-
.forEach((number) => {
|
|
88
|
-
this.numbers.push({
|
|
89
|
-
number,
|
|
90
|
-
selected: selected.indexOf(number) >= 0 ? true : false,
|
|
91
|
-
selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
componentDidRender() {
|
|
97
|
-
// start custom styling area
|
|
98
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
99
|
-
if (this.clientStyling)
|
|
100
|
-
this.setClientStyling();
|
|
101
|
-
if (this.clientStylingUrlContent)
|
|
102
|
-
this.setClientStylingURL();
|
|
103
|
-
this.limitStylingAppends = true;
|
|
104
|
-
}
|
|
105
|
-
// end custom styling area
|
|
106
|
-
}
|
|
107
|
-
// wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
|
|
108
|
-
shuffleArray(array) {
|
|
109
|
-
const result = [];
|
|
110
|
-
while (array.length > 0) {
|
|
111
|
-
const randomIndex = Math.floor(Math.random() * (array.length));
|
|
112
|
-
result.push(array.splice(randomIndex, 1)[0]);
|
|
113
|
-
}
|
|
114
|
-
return result;
|
|
115
|
-
}
|
|
116
|
-
lotteryBulletSelectionHandler(event) {
|
|
117
|
-
this.numbers = this.numbers.map((item) => {
|
|
118
|
-
if (item.number == event.detail.value) {
|
|
119
|
-
return {
|
|
120
|
-
number: item.number,
|
|
121
|
-
selected: event.detail.selected,
|
|
122
|
-
selectable: item.selectable
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
number: item.number,
|
|
127
|
-
selected: item.selected,
|
|
128
|
-
selectable: item.selectable
|
|
129
|
-
};
|
|
130
|
-
});
|
|
131
|
-
if (event.detail.selected) {
|
|
132
|
-
this.selectedCounter += 1;
|
|
133
|
-
if (this.selectedCounter == this.maximumAllowed) {
|
|
134
|
-
this.numbers = this.numbers.map((item) => {
|
|
135
|
-
return {
|
|
136
|
-
number: item.number,
|
|
137
|
-
selected: item.selected,
|
|
138
|
-
selectable: item.selected ? true : false
|
|
139
|
-
};
|
|
140
|
-
});
|
|
141
|
-
this.gridFilledEvent.emit({
|
|
142
|
-
id: this.ticketId,
|
|
143
|
-
index: this.gridIndex,
|
|
144
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
if (this.selectedCounter == this.maximumAllowed) {
|
|
150
|
-
this.numbers = this.numbers.map((item) => {
|
|
151
|
-
return {
|
|
152
|
-
number: item.number,
|
|
153
|
-
selected: item.selected,
|
|
154
|
-
selectable: true
|
|
155
|
-
};
|
|
156
|
-
});
|
|
157
|
-
this.gridDirtyEvent.emit({
|
|
158
|
-
id: this.ticketId,
|
|
159
|
-
index: this.gridIndex,
|
|
160
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
this.selectedCounter -= 1;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
async resetSelectionHandler(event) {
|
|
167
|
-
if (event.detail && event.detail == this.ticketId) {
|
|
168
|
-
this.selectedCounter = 0;
|
|
169
|
-
this.numbers = this.numbers.map((item) => {
|
|
170
|
-
return {
|
|
171
|
-
number: item.number,
|
|
172
|
-
selected: false,
|
|
173
|
-
selectable: this.selectable
|
|
174
|
-
};
|
|
175
|
-
});
|
|
176
|
-
this.gridDirtyEvent.emit({
|
|
177
|
-
id: this.ticketId,
|
|
178
|
-
index: this.gridIndex,
|
|
179
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
async autoSelectionHandler(event) {
|
|
184
|
-
if (event.detail && event.detail == this.ticketId) {
|
|
185
|
-
this.resetSelectionHandler(event);
|
|
186
|
-
let array = [...Array(this.totalNumbers).keys()]
|
|
187
|
-
.map(number => number + 1);
|
|
188
|
-
array = this.shuffleArray(array);
|
|
189
|
-
array = array.slice(0, this.minimumAllowed);
|
|
190
|
-
this.numbers = this.numbers.map((item) => {
|
|
191
|
-
return {
|
|
192
|
-
number: item.number,
|
|
193
|
-
selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
194
|
-
selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
|
|
195
|
-
};
|
|
196
|
-
});
|
|
197
|
-
this.gridFilledEvent.emit({
|
|
198
|
-
id: this.ticketId,
|
|
199
|
-
index: this.gridIndex,
|
|
200
|
-
selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
|
|
201
|
-
});
|
|
202
|
-
this.selectedCounter = this.maximumAllowed;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
render() {
|
|
206
|
-
return (h("div", { class: "GridContainer", ref: el => this.stylingContainer = el }, h("div", { class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => h("div", null, h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))));
|
|
207
|
-
}
|
|
208
|
-
static get style() { return lotteryGridCss; }
|
|
209
|
-
}, [1, "lottery-grid", {
|
|
210
|
-
"ticketId": [514, "ticket-id"],
|
|
211
|
-
"totalNumbers": [514, "total-numbers"],
|
|
212
|
-
"gameId": [513, "game-id"],
|
|
213
|
-
"maximumAllowed": [514, "maximum-allowed"],
|
|
214
|
-
"minimumAllowed": [514, "minimum-allowed"],
|
|
215
|
-
"selectable": [516],
|
|
216
|
-
"selectedNumbers": [513, "selected-numbers"],
|
|
217
|
-
"displaySelected": [516, "display-selected"],
|
|
218
|
-
"language": [513],
|
|
219
|
-
"gridIndex": [514, "grid-index"],
|
|
220
|
-
"gridType": [513, "grid-type"],
|
|
221
|
-
"clientStyling": [513, "client-styling"],
|
|
222
|
-
"clientStylingUrlContent": [513, "client-styling-url-content"],
|
|
223
|
-
"numbers": [32],
|
|
224
|
-
"limitStylingAppends": [32]
|
|
225
|
-
}, [[0, "lotteryBulletSelection", "lotteryBulletSelectionHandler"], [4, "resetSelection", "resetSelectionHandler"], [4, "autoSelection", "autoSelectionHandler"]]]);
|
|
226
|
-
function defineCustomElement$1() {
|
|
227
|
-
if (typeof customElements === "undefined") {
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
const components = ["lottery-grid", "lottery-bullet"];
|
|
231
|
-
components.forEach(tagName => { switch (tagName) {
|
|
232
|
-
case "lottery-grid":
|
|
233
|
-
if (!customElements.get(tagName)) {
|
|
234
|
-
customElements.define(tagName, LotteryGrid$1);
|
|
235
|
-
}
|
|
236
|
-
break;
|
|
237
|
-
case "lottery-bullet":
|
|
238
|
-
if (!customElements.get(tagName)) {
|
|
239
|
-
defineCustomElement$2();
|
|
240
|
-
}
|
|
241
|
-
break;
|
|
242
|
-
} });
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const LotteryGrid = LotteryGrid$1;
|
|
246
|
-
const defineCustomElement = defineCustomElement$1;
|
|
247
|
-
|
|
248
|
-
export { LotteryGrid, defineCustomElement };
|