@everymatrix/lottery-grid 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.
Files changed (52) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +4 -3
  3. package/dist/cjs/index-dfe5695c.js +0 -1249
  4. package/dist/cjs/index.cjs.js +0 -2
  5. package/dist/cjs/loader.cjs.js +0 -21
  6. package/dist/cjs/lottery-bullet_2.cjs.entry.js +0 -279
  7. package/dist/cjs/lottery-grid.cjs.js +0 -19
  8. package/dist/collection/collection-manifest.json +0 -19
  9. package/dist/collection/components/lottery-grid/lottery-grid.css +0 -22
  10. package/dist/collection/components/lottery-grid/lottery-grid.js +0 -508
  11. package/dist/collection/components/lottery-grid/lottery-grid.types.js +0 -1
  12. package/dist/collection/index.js +0 -1
  13. package/dist/collection/utils/locale.utils.js +0 -28
  14. package/dist/collection/utils/utils.js +0 -0
  15. package/dist/components/index.d.ts +0 -26
  16. package/dist/components/index.js +0 -1
  17. package/dist/components/lottery-bullet.js +0 -6
  18. package/dist/components/lottery-bullet2.js +0 -91
  19. package/dist/components/lottery-grid.d.ts +0 -11
  20. package/dist/components/lottery-grid.js +0 -248
  21. package/dist/esm/index-c15ec15f.js +0 -1223
  22. package/dist/esm/index.js +0 -1
  23. package/dist/esm/loader.js +0 -17
  24. package/dist/esm/lottery-bullet_2.entry.js +0 -274
  25. package/dist/esm/lottery-grid.js +0 -17
  26. package/dist/esm/polyfills/core-js.js +0 -11
  27. package/dist/esm/polyfills/css-shim.js +0 -1
  28. package/dist/esm/polyfills/dom.js +0 -79
  29. package/dist/esm/polyfills/es5-html-element.js +0 -1
  30. package/dist/esm/polyfills/index.js +0 -34
  31. package/dist/esm/polyfills/system.js +0 -6
  32. package/dist/index.cjs.js +0 -1
  33. package/dist/index.js +0 -1
  34. package/dist/lottery-grid/index.esm.js +0 -0
  35. package/dist/lottery-grid/lottery-grid.esm.js +0 -1
  36. package/dist/lottery-grid/p-6caa0d6c.entry.js +0 -1
  37. package/dist/lottery-grid/p-8a854495.js +0 -1
  38. package/dist/stencil.config.js +0 -22
  39. package/dist/types/Users/dragos.bodea/Documents/everymatrix-prjs/emfe-widgets/widgets-stencil/packages/lottery-grid/.stencil/packages/lottery-grid/stencil.config.d.ts +0 -2
  40. package/dist/types/components/lottery-grid/lottery-grid.d.ts +0 -78
  41. package/dist/types/components/lottery-grid/lottery-grid.types.d.ts +0 -14
  42. package/dist/types/components.d.ts +0 -150
  43. package/dist/types/index.d.ts +0 -1
  44. package/dist/types/stencil-public-runtime.d.ts +0 -1565
  45. package/dist/types/utils/locale.utils.d.ts +0 -1
  46. package/dist/types/utils/utils.d.ts +0 -0
  47. package/loader/cdn.js +0 -3
  48. package/loader/index.cjs.js +0 -3
  49. package/loader/index.d.ts +0 -12
  50. package/loader/index.es2017.js +0 -3
  51. package/loader/index.js +0 -4
  52. package/loader/package.json +0 -10
@@ -1,508 +0,0 @@
1
- import { Component, h, Prop, Listen, State, Event } from '@stencil/core';
2
- // import { translate } from '../../utils/locale.utils';
3
- import '@everymatrix/lottery-bullet';
4
- export class LotteryGrid {
5
- constructor() {
6
- /**
7
- * Number of bullets of grid
8
- */
9
- this.totalNumbers = 0;
10
- /**
11
- * Number of maximum bullets that can be selected
12
- */
13
- this.maximumAllowed = 0;
14
- /**
15
- * Minimum allowed of bullets
16
- */
17
- this.minimumAllowed = 1;
18
- /**
19
- * Allows the user to select numbers on the grid
20
- */
21
- this.selectable = true;
22
- /**
23
- * Numbers that should be showed as selected on the grid (as a string of those numbers e.g. '1,2,3,4,5,6')
24
- */
25
- this.selectedNumbers = '';
26
- /**
27
- * Show only selected numbers
28
- */
29
- this.displaySelected = false;
30
- /**
31
- * Language
32
- */
33
- this.language = 'en';
34
- /**
35
- * Personalize grid for ticket
36
- */
37
- this.gridType = '';
38
- /**
39
- * Client custom styling via string
40
- */
41
- this.clientStyling = '';
42
- /**
43
- * Client custom styling via url content
44
- */
45
- this.clientStylingUrlContent = '';
46
- this.numbers = [];
47
- this.limitStylingAppends = false;
48
- this.selectedCounter = 0;
49
- this.setClientStyling = () => {
50
- let sheet = document.createElement('style');
51
- sheet.innerHTML = this.clientStyling;
52
- this.stylingContainer.prepend(sheet);
53
- };
54
- this.setClientStylingURL = () => {
55
- let cssFile = document.createElement('style');
56
- setTimeout(() => {
57
- cssFile.innerHTML = this.clientStylingUrlContent;
58
- this.stylingContainer.prepend(cssFile);
59
- }, 1);
60
- };
61
- }
62
- connectedCallback() {
63
- let selected = [];
64
- if (this.selectedNumbers.length > 0) {
65
- selected = this.selectedNumbers.split(',');
66
- this.selectedCounter = selected.length;
67
- }
68
- if (this.displaySelected) {
69
- selected.forEach((item) => {
70
- this.numbers.push({
71
- number: item,
72
- selected: true,
73
- selectable: this.selectable
74
- });
75
- });
76
- }
77
- else {
78
- [...Array(this.totalNumbers).keys()]
79
- .map(number => (number + 1).toString())
80
- .forEach((number) => {
81
- this.numbers.push({
82
- number,
83
- selected: selected.indexOf(number) >= 0 ? true : false,
84
- selectable: this.selectedCounter == this.maximumAllowed ? false : this.selectable
85
- });
86
- });
87
- }
88
- }
89
- componentDidRender() {
90
- // start custom styling area
91
- if (!this.limitStylingAppends && this.stylingContainer) {
92
- if (this.clientStyling)
93
- this.setClientStyling();
94
- if (this.clientStylingUrlContent)
95
- this.setClientStylingURL();
96
- this.limitStylingAppends = true;
97
- }
98
- // end custom styling area
99
- }
100
- // wrote this because the classic .sort(() => 0.5 - Math.random()) method yielded low entropy shuffles for some reason on certain devices
101
- shuffleArray(array) {
102
- const result = [];
103
- while (array.length > 0) {
104
- const randomIndex = Math.floor(Math.random() * (array.length));
105
- result.push(array.splice(randomIndex, 1)[0]);
106
- }
107
- return result;
108
- }
109
- lotteryBulletSelectionHandler(event) {
110
- this.numbers = this.numbers.map((item) => {
111
- if (item.number == event.detail.value) {
112
- return {
113
- number: item.number,
114
- selected: event.detail.selected,
115
- selectable: item.selectable
116
- };
117
- }
118
- return {
119
- number: item.number,
120
- selected: item.selected,
121
- selectable: item.selectable
122
- };
123
- });
124
- if (event.detail.selected) {
125
- this.selectedCounter += 1;
126
- if (this.selectedCounter == this.maximumAllowed) {
127
- this.numbers = this.numbers.map((item) => {
128
- return {
129
- number: item.number,
130
- selected: item.selected,
131
- selectable: item.selected ? true : false
132
- };
133
- });
134
- this.gridFilledEvent.emit({
135
- id: this.ticketId,
136
- index: this.gridIndex,
137
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
138
- });
139
- }
140
- }
141
- else {
142
- if (this.selectedCounter == this.maximumAllowed) {
143
- this.numbers = this.numbers.map((item) => {
144
- return {
145
- number: item.number,
146
- selected: item.selected,
147
- selectable: true
148
- };
149
- });
150
- this.gridDirtyEvent.emit({
151
- id: this.ticketId,
152
- index: this.gridIndex,
153
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
154
- });
155
- }
156
- this.selectedCounter -= 1;
157
- }
158
- }
159
- async resetSelectionHandler(event) {
160
- if (event.detail && event.detail == this.ticketId) {
161
- this.selectedCounter = 0;
162
- this.numbers = this.numbers.map((item) => {
163
- return {
164
- number: item.number,
165
- selected: false,
166
- selectable: this.selectable
167
- };
168
- });
169
- this.gridDirtyEvent.emit({
170
- id: this.ticketId,
171
- index: this.gridIndex,
172
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
173
- });
174
- }
175
- }
176
- async autoSelectionHandler(event) {
177
- if (event.detail && event.detail == this.ticketId) {
178
- this.resetSelectionHandler(event);
179
- let array = [...Array(this.totalNumbers).keys()]
180
- .map(number => number + 1);
181
- array = this.shuffleArray(array);
182
- array = array.slice(0, this.minimumAllowed);
183
- this.numbers = this.numbers.map((item) => {
184
- return {
185
- number: item.number,
186
- selected: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
187
- selectable: array.indexOf(parseInt(item.number, 10)) >= 0 ? true : false,
188
- };
189
- });
190
- this.gridFilledEvent.emit({
191
- id: this.ticketId,
192
- index: this.gridIndex,
193
- selectedNumbers: this.numbers.filter((item) => item.selected).map((item) => item.number)
194
- });
195
- this.selectedCounter = this.maximumAllowed;
196
- }
197
- }
198
- render() {
199
- return (h("div", { class: "GridContainer", ref: el => this.stylingContainer = el },
200
- h("div", { class: this.gridType === 'ticket' ? 'Grid TicketGrid' : 'Grid' }, this.numbers.map((item) => h("div", null,
201
- h("lottery-bullet", { value: item.number, selectable: item.selectable, "is-selected": item.selected, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))));
202
- }
203
- static get is() { return "lottery-grid"; }
204
- static get encapsulation() { return "shadow"; }
205
- static get originalStyleUrls() { return {
206
- "$": ["lottery-grid.scss"]
207
- }; }
208
- static get styleUrls() { return {
209
- "$": ["lottery-grid.css"]
210
- }; }
211
- static get properties() { return {
212
- "ticketId": {
213
- "type": "number",
214
- "mutable": false,
215
- "complexType": {
216
- "original": "number",
217
- "resolved": "number",
218
- "references": {}
219
- },
220
- "required": false,
221
- "optional": false,
222
- "docs": {
223
- "tags": [],
224
- "text": "Identifier for the ticket"
225
- },
226
- "attribute": "ticket-id",
227
- "reflect": true
228
- },
229
- "totalNumbers": {
230
- "type": "number",
231
- "mutable": false,
232
- "complexType": {
233
- "original": "number",
234
- "resolved": "number",
235
- "references": {}
236
- },
237
- "required": false,
238
- "optional": false,
239
- "docs": {
240
- "tags": [],
241
- "text": "Number of bullets of grid"
242
- },
243
- "attribute": "total-numbers",
244
- "reflect": true,
245
- "defaultValue": "0"
246
- },
247
- "gameId": {
248
- "type": "string",
249
- "mutable": false,
250
- "complexType": {
251
- "original": "string",
252
- "resolved": "string",
253
- "references": {}
254
- },
255
- "required": false,
256
- "optional": false,
257
- "docs": {
258
- "tags": [],
259
- "text": "Game ID"
260
- },
261
- "attribute": "game-id",
262
- "reflect": true
263
- },
264
- "maximumAllowed": {
265
- "type": "number",
266
- "mutable": false,
267
- "complexType": {
268
- "original": "number",
269
- "resolved": "number",
270
- "references": {}
271
- },
272
- "required": false,
273
- "optional": false,
274
- "docs": {
275
- "tags": [],
276
- "text": "Number of maximum bullets that can be selected"
277
- },
278
- "attribute": "maximum-allowed",
279
- "reflect": true,
280
- "defaultValue": "0"
281
- },
282
- "minimumAllowed": {
283
- "type": "number",
284
- "mutable": false,
285
- "complexType": {
286
- "original": "number",
287
- "resolved": "number",
288
- "references": {}
289
- },
290
- "required": false,
291
- "optional": false,
292
- "docs": {
293
- "tags": [],
294
- "text": "Minimum allowed of bullets"
295
- },
296
- "attribute": "minimum-allowed",
297
- "reflect": true,
298
- "defaultValue": "1"
299
- },
300
- "selectable": {
301
- "type": "boolean",
302
- "mutable": false,
303
- "complexType": {
304
- "original": "boolean",
305
- "resolved": "boolean",
306
- "references": {}
307
- },
308
- "required": false,
309
- "optional": false,
310
- "docs": {
311
- "tags": [],
312
- "text": "Allows the user to select numbers on the grid"
313
- },
314
- "attribute": "selectable",
315
- "reflect": true,
316
- "defaultValue": "true"
317
- },
318
- "selectedNumbers": {
319
- "type": "string",
320
- "mutable": false,
321
- "complexType": {
322
- "original": "string",
323
- "resolved": "string",
324
- "references": {}
325
- },
326
- "required": false,
327
- "optional": false,
328
- "docs": {
329
- "tags": [],
330
- "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')"
331
- },
332
- "attribute": "selected-numbers",
333
- "reflect": true,
334
- "defaultValue": "''"
335
- },
336
- "displaySelected": {
337
- "type": "boolean",
338
- "mutable": false,
339
- "complexType": {
340
- "original": "boolean",
341
- "resolved": "boolean",
342
- "references": {}
343
- },
344
- "required": false,
345
- "optional": false,
346
- "docs": {
347
- "tags": [],
348
- "text": "Show only selected numbers"
349
- },
350
- "attribute": "display-selected",
351
- "reflect": true,
352
- "defaultValue": "false"
353
- },
354
- "language": {
355
- "type": "string",
356
- "mutable": false,
357
- "complexType": {
358
- "original": "string",
359
- "resolved": "string",
360
- "references": {}
361
- },
362
- "required": false,
363
- "optional": false,
364
- "docs": {
365
- "tags": [],
366
- "text": "Language"
367
- },
368
- "attribute": "language",
369
- "reflect": true,
370
- "defaultValue": "'en'"
371
- },
372
- "gridIndex": {
373
- "type": "number",
374
- "mutable": false,
375
- "complexType": {
376
- "original": "number",
377
- "resolved": "number",
378
- "references": {}
379
- },
380
- "required": false,
381
- "optional": false,
382
- "docs": {
383
- "tags": [],
384
- "text": "The index of the number"
385
- },
386
- "attribute": "grid-index",
387
- "reflect": true
388
- },
389
- "gridType": {
390
- "type": "string",
391
- "mutable": false,
392
- "complexType": {
393
- "original": "string",
394
- "resolved": "string",
395
- "references": {}
396
- },
397
- "required": false,
398
- "optional": false,
399
- "docs": {
400
- "tags": [],
401
- "text": "Personalize grid for ticket"
402
- },
403
- "attribute": "grid-type",
404
- "reflect": true,
405
- "defaultValue": "''"
406
- },
407
- "clientStyling": {
408
- "type": "string",
409
- "mutable": false,
410
- "complexType": {
411
- "original": "string",
412
- "resolved": "string",
413
- "references": {}
414
- },
415
- "required": false,
416
- "optional": false,
417
- "docs": {
418
- "tags": [],
419
- "text": "Client custom styling via string"
420
- },
421
- "attribute": "client-styling",
422
- "reflect": true,
423
- "defaultValue": "''"
424
- },
425
- "clientStylingUrlContent": {
426
- "type": "string",
427
- "mutable": false,
428
- "complexType": {
429
- "original": "string",
430
- "resolved": "string",
431
- "references": {}
432
- },
433
- "required": false,
434
- "optional": false,
435
- "docs": {
436
- "tags": [],
437
- "text": "Client custom styling via url content"
438
- },
439
- "attribute": "client-styling-url-content",
440
- "reflect": true,
441
- "defaultValue": "''"
442
- }
443
- }; }
444
- static get states() { return {
445
- "numbers": {},
446
- "limitStylingAppends": {}
447
- }; }
448
- static get events() { return [{
449
- "method": "gridFilledEvent",
450
- "name": "gridFilled",
451
- "bubbles": true,
452
- "cancelable": true,
453
- "composed": true,
454
- "docs": {
455
- "tags": [],
456
- "text": "When the grid is completed, it emits this event with selected numbers"
457
- },
458
- "complexType": {
459
- "original": "GridEvent",
460
- "resolved": "GridEvent",
461
- "references": {
462
- "GridEvent": {
463
- "location": "import",
464
- "path": "./lottery-grid.types"
465
- }
466
- }
467
- }
468
- }, {
469
- "method": "gridDirtyEvent",
470
- "name": "gridDirty",
471
- "bubbles": true,
472
- "cancelable": true,
473
- "composed": true,
474
- "docs": {
475
- "tags": [],
476
- "text": "When the grid is uncomplete after being completed once (reset or change), it emits this event"
477
- },
478
- "complexType": {
479
- "original": "GridEvent",
480
- "resolved": "GridEvent",
481
- "references": {
482
- "GridEvent": {
483
- "location": "import",
484
- "path": "./lottery-grid.types"
485
- }
486
- }
487
- }
488
- }]; }
489
- static get listeners() { return [{
490
- "name": "lotteryBulletSelection",
491
- "method": "lotteryBulletSelectionHandler",
492
- "target": undefined,
493
- "capture": false,
494
- "passive": false
495
- }, {
496
- "name": "resetSelection",
497
- "method": "resetSelectionHandler",
498
- "target": "document",
499
- "capture": false,
500
- "passive": false
501
- }, {
502
- "name": "autoSelection",
503
- "method": "autoSelectionHandler",
504
- "target": "document",
505
- "capture": false,
506
- "passive": false
507
- }]; }
508
- }
@@ -1 +0,0 @@
1
- export * from './components';
@@ -1,28 +0,0 @@
1
- const DEFAULT_LANGUAGE = 'en';
2
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'hr'];
3
- const TRANSLATIONS = {
4
- en: {
5
- resetButton: 'Reset',
6
- autoButton: 'I feel lucky'
7
- },
8
- ro: {
9
- resetButton: 'Reseteaza',
10
- autoButton: 'Ma simt norocos'
11
- },
12
- fr: {
13
- resetButton: 'Reset',
14
- autoButton: 'I feel lucky'
15
- },
16
- ar: {
17
- resetButton: 'Reset',
18
- autoButton: 'I feel lucky'
19
- },
20
- hr: {
21
- resetButton: 'Resetiraj',
22
- autoButton: 'Osjećam se sretno'
23
- }
24
- };
25
- export const translate = (key, customLang) => {
26
- const lang = customLang;
27
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
28
- };
File without changes
@@ -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';
@@ -1 +0,0 @@
1
- export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
@@ -1,6 +0,0 @@
1
- import { L as LotteryBullet$1, d as defineCustomElement$1 } from './lottery-bullet2.js';
2
-
3
- const LotteryBullet = LotteryBullet$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { LotteryBullet, defineCustomElement };
@@ -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;