@everymatrix/lottery-draw-results 1.44.0 → 1.45.2

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/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-e39715e5.js +1279 -0
  3. package/dist/cjs/loader.cjs.js +6 -12
  4. package/dist/cjs/lottery-bullet_3.cjs.entry.js +436 -516
  5. package/dist/cjs/lottery-draw-results.cjs.js +16 -10
  6. package/dist/collection/collection-manifest.json +3 -3
  7. package/dist/collection/components/lottery-draw-results/index.js +1 -0
  8. package/dist/collection/components/lottery-draw-results/lottery-draw-results.js +484 -608
  9. package/dist/collection/utils/locale.utils.js +87 -87
  10. package/dist/collection/utils/utils.js +1 -1
  11. package/dist/esm/app-globals-0f993ce5.js +3 -0
  12. package/dist/esm/index-cb2f9906.js +1252 -0
  13. package/dist/esm/loader.js +6 -12
  14. package/dist/esm/lottery-bullet_3.entry.js +436 -516
  15. package/dist/esm/lottery-draw-results.js +13 -10
  16. package/dist/lottery-draw-results/lottery-draw-results.esm.js +1 -1
  17. package/dist/lottery-draw-results/p-43abc07f.js +2 -0
  18. package/dist/lottery-draw-results/p-a12b1856.entry.js +1 -0
  19. package/dist/lottery-draw-results/p-e1255160.js +1 -0
  20. package/dist/stencil.config.dev.js +17 -0
  21. package/dist/stencil.config.js +14 -19
  22. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-draw-results/.stencil/packages/stencil/lottery-draw-results/stencil.config.d.ts +2 -0
  23. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/lottery-draw-results/.stencil/packages/stencil/lottery-draw-results/stencil.config.dev.d.ts +2 -0
  24. package/dist/types/components/lottery-draw-results/index.d.ts +1 -0
  25. package/dist/types/components/lottery-draw-results/lottery-draw-results.d.ts +95 -95
  26. package/dist/types/stencil-public-runtime.d.ts +142 -33
  27. package/loader/cdn.js +1 -3
  28. package/loader/index.cjs.js +1 -3
  29. package/loader/index.d.ts +13 -1
  30. package/loader/index.es2017.js +1 -3
  31. package/loader/index.js +1 -3
  32. package/loader/package.json +1 -0
  33. package/package.json +9 -2
  34. package/dist/cjs/index-40e6760b.js +0 -1252
  35. package/dist/components/index.d.ts +0 -26
  36. package/dist/components/index.js +0 -1
  37. package/dist/components/lottery-bullet.js +0 -6
  38. package/dist/components/lottery-bullet2.js +0 -91
  39. package/dist/components/lottery-draw-results.d.ts +0 -11
  40. package/dist/components/lottery-draw-results.js +0 -346
  41. package/dist/components/lottery-grid.js +0 -6
  42. package/dist/components/lottery-grid2.js +0 -245
  43. package/dist/esm/index-3c2823a2.js +0 -1226
  44. package/dist/esm/polyfills/core-js.js +0 -11
  45. package/dist/esm/polyfills/css-shim.js +0 -1
  46. package/dist/esm/polyfills/dom.js +0 -79
  47. package/dist/esm/polyfills/es5-html-element.js +0 -1
  48. package/dist/esm/polyfills/index.js +0 -34
  49. package/dist/esm/polyfills/system.js +0 -6
  50. package/dist/lottery-draw-results/p-0eb80b2e.js +0 -1
  51. package/dist/lottery-draw-results/p-ca18f246.entry.js +0 -1
  52. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/lottery-draw-results/.stencil/packages/lottery-draw-results/stencil.config.d.ts +0 -2
@@ -1,26 +0,0 @@
1
- /* LotteryDrawResults 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 LotteryDrawResults extends Components.LotteryDrawResults, HTMLElement {}
4
- export const LotteryDrawResults: {
5
- prototype: LotteryDrawResults;
6
- new (): LotteryDrawResults;
7
- };
8
- /**
9
- * Used to define this component and all nested components recursively.
10
- */
11
- export const defineCustomElement: () => void;
@@ -1,346 +0,0 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$3 } from './lottery-bullet2.js';
3
- import { d as defineCustomElement$2 } from './lottery-grid2.js';
4
-
5
- const DEFAULT_LANGUAGE = 'en';
6
- const SUPPORTED_LANGUAGES = ['ro', 'en', 'hr'];
7
- const TRANSLATIONS = {
8
- en: {
9
- drawResultsHeader: 'Last draw results',
10
- drawId: 'Draw ID',
11
- drawName: 'Game name',
12
- drawDate: 'Draw Date',
13
- drawNumbersGridDraw: 'Draw numbers Grid ',
14
- drawNumbersGridTicket: 'Draw numbers Grid ',
15
- ticketResult: 'Ticket result',
16
- amountWon: 'Amount won',
17
- numberOfDraws: 'Number of draws',
18
- multiplier: 'Multiplier:',
19
- ticketPurchaseDate: 'Ticket Purchase Date',
20
- ticketStatus: 'Ticket Status',
21
- ticketId: 'Ticket ID',
22
- ticketAmount: 'Ticket Amount',
23
- winUpTo: 'Win up to',
24
- },
25
- ro: {
26
- drawResultsHeader: 'Ultimele rezultate extragere',
27
- drawId: 'Id extragere',
28
- drawName: 'Numele jocului',
29
- drawDate: 'Data extragerii',
30
- drawNumbersGridDraw: 'Numerele extrase Grid',
31
- drawNumbersGridTicket: 'Numerele extrase Grid',
32
- ticketResult: 'Rezultatul biletului',
33
- amountWon: 'Suma castigata',
34
- numberOfDraws: 'Numarul de extrageri',
35
- multiplier: 'Multiplicator:',
36
- ticketPurchaseDate: 'Data achizitionarii biletului',
37
- ticketStatus: 'Statusul biletului',
38
- ticketId: 'Id biletul',
39
- ticketAmount: 'Valoarea biletului',
40
- winUpTo: 'Poti castiga'
41
- },
42
- fr: {
43
- drawResultsHeader: 'Résultats du dernier tirage',
44
- drawId: 'ID de tirage',
45
- drawName: 'Nom du jeu',
46
- drawDate: 'Date du tirage',
47
- drawNumbersGridDraw: 'Tirage des numéros Grille',
48
- drawNumbersGridTicket: 'Tirage des numéros Grille',
49
- ticketResult: 'Résultat du ticket',
50
- amountWon: 'Montant gagné',
51
- numberOfDraws: 'Nombre de tirages',
52
- multiplier: 'Multiplicateur',
53
- ticketPurchaseDate: 'Date d\'achat du billet',
54
- ticketStatus: 'Statut du ticket',
55
- ticketId: 'ID de billets',
56
- ticketAmount: 'Montant du billet',
57
- winUpTo: 'Gagnez jusqu\'à'
58
- },
59
- ar: {
60
- drawResultsHeader: 'نتائج آخر سحب',
61
- drawId: 'معرّف السحب',
62
- drawName: 'اسم اللعبة',
63
- drawDate: 'تاريخ السحب',
64
- drawNumbersGridDraw: 'شبكة أرقام السحب',
65
- drawNumbersGridTicket: 'شبكة أرقام السحب',
66
- ticketResult: 'نتيجة التذكرة',
67
- amountWon: 'المبلغ الذي تم ربحه',
68
- numberOfDraws: 'عدد السحوبات',
69
- multiplier: 'مضاعف',
70
- ticketPurchaseDate: 'تاريخ شراء التذكرة',
71
- ticketStatus: 'حالة التذكرة',
72
- ticketId: 'معرّف التذكرة',
73
- ticketAmount: 'مبلغ التذكرة',
74
- winUpTo: 'ربح يصل إلى'
75
- },
76
- hr: {
77
- drawResultsHeader: 'Rezultati posljednjeg izvlačenja',
78
- drawId: 'ID izvlačenja',
79
- drawName: 'Naziv igre',
80
- drawDate: 'Datum izvlačenja',
81
- drawNumbersGridDraw: 'Tablica izvučenih brojeva',
82
- drawNumbersGridTicket: 'Tablica izvučenih brojeva',
83
- ticketResult: 'Rezultat listića',
84
- amountWon: 'Osvojeni iznos',
85
- numberOfDraws: 'Broj izvlačenja',
86
- multiplier: 'Multiplikator',
87
- ticketPurchaseDate: 'Datum uplate listića',
88
- ticketStatus: 'Status listića',
89
- ticketId: 'ID listića',
90
- ticketAmount: 'Iznos listića',
91
- winUpTo: 'Osvoji do'
92
- },
93
- };
94
- const translate = (key, customLang) => {
95
- const lang = customLang;
96
- return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
97
- };
98
-
99
- const lotteryDrawResultsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsArea{margin-top:15px}.DrawResultsArea.TicketDraws .Content{padding:0;border:0}.DrawResultsArea.TicketDraws .DrawResultsBody{padding:0;margin-bottom:5px;border-radius:0;border:0}.DrawResultsSection{max-width:600px;margin:0px auto;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:#009993;color:#fff;font-size:14px;border-radius:4px 4px 0 0}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0;padding-top:15px}.DrawResultsBody{padding:20px;margin-bottom:5px;border-radius:0 0 4px 4px;border:1px solid #009993}.DrawResultsBody>div{margin:10px 0}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.DrawNumbersGrid{display:flex;flex-direction:column;gap:5px}.DrawNumbersGrid label{display:block;margin-bottom:7px}.Toggle{cursor:pointer;display:inline-block}.ToggleSwitch{display:inline-block;background:#ccc;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #eee 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#56c080}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{position:relative}.DrawTicketsContainer{display:flex;flex-direction:column;margin:20px auto 0}.DrawMultipler{margin-top:15px}.ExpandableBoxes{position:relative;display:flex;flex-direction:column;border:1px solid #ccc;border-radius:5px;background-color:white}.ExpandableBox{border-bottom:1px solid #ccc;transition:height 300ms ease-in-out;overflow:hidden;height:80px}.ExpandableBox:last-child{border-bottom:0}.ExpandableBoxHeader{position:relative;list-style:none;outline:0;cursor:pointer;text-transform:uppercase;transition:color 300ms ease-in-out;margin-bottom:24px;margin-left:5px}.ShowBox>.ExpandableBoxHeader{color:#009993}.ExpandableBoxHeader::-webkit-details-marker{display:none}.ExpandableBoxHeader:before,.ExpandableBoxHeader:after{content:\"\";position:absolute}.ExpandableBoxHeader:before{right:21px;top:50%;height:2px;margin-top:-1px;width:16px;background:#009993}.ExpandableBoxHeader:after{right:28px;top:50%;height:16px;margin-top:-8px;width:2px;margin-left:-1px;background:#009993;transition:all 300ms ease-in-out}.ShowBox .ExpandableBoxHeader:after{opacity:0;transform:translateY(25%)}.ExpandableBoxBody{padding-top:0;font-weight:lighter;margin-left:5px}.ExpandableBox.ShowBox{height:300px}";
100
-
101
- const LotteryDrawResults$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
102
- constructor() {
103
- super();
104
- this.__registerHost();
105
- this.__attachShadow();
106
- /**
107
- * Language of the widget
108
- */
109
- this.language = 'en';
110
- /**
111
- * Shows only the last draw
112
- */
113
- this.drawMode = false;
114
- /**
115
- * The drawID (option)
116
- */
117
- this.drawId = '';
118
- /**
119
- * The game name
120
- */
121
- this.gameName = '';
122
- /**
123
- * The ticket submission date
124
- */
125
- this.ticketDate = '';
126
- /**
127
- * The ticket status
128
- */
129
- this.ticketStatus = '';
130
- /**
131
- * The ticket id
132
- */
133
- this.ticketId = '';
134
- /**
135
- * The ticket amount
136
- */
137
- this.ticketAmount = '';
138
- /**
139
- * The ticket multiplier
140
- */
141
- this.ticketMultiplier = false;
142
- /**
143
- * The ticket draw count
144
- */
145
- this.ticketDrawCount = 0;
146
- /**
147
- * The ticket winning numbers
148
- */
149
- this.ticketNumbers = '';
150
- /**
151
- * The session id
152
- */
153
- this.sessionId = '';
154
- /**
155
- * Client custom styling via string
156
- */
157
- this.clientStyling = '';
158
- /**
159
- * Client custom styling via url content
160
- */
161
- this.clientStylingUrlContent = '';
162
- /**
163
- * Data showing the ticket's draw results details
164
- */
165
- this.ticketDrawData = '';
166
- this.multiplier = 3;
167
- this.isLoading = true;
168
- this.hasErrors = false;
169
- this.errorText = '';
170
- this.ticketData = [];
171
- this.ticketDataLoaded = false;
172
- this.ticketDraws = [];
173
- this.toggleDrawer = [false];
174
- this.limitStylingAppends = false;
175
- this.ticketDrawDetails = [];
176
- this.ticketDrawDetailsFlag = true;
177
- this.setClientStyling = () => {
178
- let sheet = document.createElement('style');
179
- sheet.innerHTML = this.clientStyling;
180
- this.stylingContainer.prepend(sheet);
181
- };
182
- this.setClientStylingURL = () => {
183
- let cssFile = document.createElement('style');
184
- setTimeout(() => {
185
- cssFile.innerHTML = this.clientStylingUrlContent;
186
- this.stylingContainer.prepend(cssFile);
187
- }, 1);
188
- };
189
- }
190
- connectedCallback() {
191
- let promises = [];
192
- // Split ticket numbers for each grid
193
- if (this.ticketNumbers) {
194
- this.gridNumbers = JSON.parse(this.ticketNumbers);
195
- }
196
- if (this.drawId) {
197
- promises.push(this.getDrawData());
198
- }
199
- Promise.all(promises)
200
- .then(() => {
201
- this.isLoading = false;
202
- }).catch((err) => {
203
- console.log('error ', err);
204
- this.isLoading = false;
205
- });
206
- }
207
- componentWillRender() {
208
- if (this.ticketDrawData && this.ticketDrawDetailsFlag) {
209
- this.ticketDrawDetails = JSON.parse(this.ticketDrawData);
210
- this.ticketDrawDetails.forEach((drawDetail) => {
211
- this.getDrawData(drawDetail.drawId).then((drawData) => drawDetail.drawData = drawData);
212
- });
213
- this.ticketDrawDetailsFlag = false;
214
- }
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
- getDrawData(drawId) {
228
- this.isLoading = true;
229
- return new Promise((resolve, reject) => {
230
- let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawId ? drawId : this.drawId}`);
231
- fetch(url.href)
232
- .then((response) => {
233
- // @TODO EXCEPTIONS
234
- return response.json();
235
- })
236
- .then((data) => {
237
- if (drawId) {
238
- resolve(data);
239
- }
240
- else {
241
- this.drawData = data;
242
- resolve(true);
243
- }
244
- this.isLoading = false;
245
- })
246
- .catch((err) => {
247
- reject(err);
248
- this.isLoading = false;
249
- });
250
- });
251
- }
252
- drawerToggle(index) {
253
- this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
254
- if (itemIndex == index) {
255
- return !item;
256
- }
257
- return item;
258
- });
259
- if (index >= this.toggleDrawer.length) {
260
- this.toggleDrawer.push(true);
261
- }
262
- }
263
- render() {
264
- if (this.isLoading) {
265
- return (h("p", null, "Loading, please wait ..."));
266
- }
267
- else if (this.hasErrors) {
268
- h("p", null, this.errorText);
269
- }
270
- else {
271
- return (h("section", { class: "DrawResultsSection", ref: el => this.stylingContainer = el }, this.drawMode ?
272
- h("div", { class: "DrawResultsArea" }, this.drawData &&
273
- h("div", null, h("div", { class: "DrawResultsHeader" }, h("span", null, translate('drawId', this.language), ": ", this.drawData.id), h("span", null, translate('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), h("div", { class: "DrawResultsBody" }, h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridDraw', this.language), "0:"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "selected-numbers": this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language, "grid-type": 'ticket', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('multiplier', this.language), " ", this.multiplier))))))
274
- :
275
- h("div", { class: "DrawResultsArea TicketDraws" }, h("div", { class: "DrawResultsBody" }, h("div", { class: "TicketIdContainer" }, h("label", { class: "Label" }, translate('ticketId', this.language), ": ", h("span", null, this.ticketId))), h("div", { class: "TicketAmountContainer" }, h("label", { class: "Label" }, translate('ticketAmount', this.language), " ", h("span", null, this.ticketAmount))), h("div", { class: "DrawNumbersGrid" }, this.gridNumbers.map((grid, index) => h("div", null, h("label", { class: "Label" }, translate('drawNumbersGridTicket', this.language), " ", String.fromCharCode(index + 65), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "selected-numbers": grid.join(','), selectable: false, "display-selected": true, language: this.language, "grid-type": 'ticket', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))))), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('multiplier', this.language), " ", JSON.stringify(this.ticketMultiplier))), h("div", { class: "NumberOfDrawsContainer" }, h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": ", this.ticketDrawCount), h("div", { class: "DrawTicketsContainer" }, this.ticketDrawDetails && this.ticketDrawDetails.length > 0 &&
276
- h("div", { class: "ExpandableBoxes" }, this.ticketDrawDetails.map((drawDetail, index) => {
277
- var _a, _b, _c, _d, _e;
278
- return h("div", { class: { 'ExpandableBox': true, 'ShowBox': this.toggleDrawer[index] }, onClick: () => this.drawerToggle(index) }, h("div", { class: "ExpandableBoxHeader" }, h("div", { class: "TicketResultContainer" }, h("p", null, translate('ticketResult', this.language), ": ", drawDetail.state)), drawDetail.state == 'won' &&
279
- h("div", { class: "AmountWonContainer" }, h("p", null, translate('amountWon', this.language), ": ", Number(drawDetail.amount).toLocaleString('en'), " ", drawDetail.currency)), drawDetail.state == 'lost' &&
280
- h("div", { class: "DrawIdContainer" }, h("p", null, translate('drawId', this.language), ": ", drawDetail.drawId))), h("div", { class: "ExpandableBoxBody" }, h("div", { class: "DrawIdContainer" }, h("p", null, translate('drawId', this.language), ": ", drawDetail.drawId)), h("div", { class: "DrawDateContainer" }, h("p", null, translate('drawDate', this.language), ": ", (_a = drawDetail.drawData) === null || _a === void 0 ? void 0 :
281
- _a.date.slice(0, 10), " | ", (_b = drawDetail.drawData) === null || _b === void 0 ? void 0 :
282
- _b.date.slice(11, 19))), h("div", { class: "DrawNumbersGrid" }, drawDetail.drawData &&
283
- h("div", { class: 'BulletContainer' }, h("label", { class: "Label" }, translate('drawNumbersGridDraw', this.language), " ", String.fromCharCode(index + 10), ":"), h("lottery-grid", { "selected-numbers": (_d = (_c = drawDetail.drawData) === null || _c === void 0 ? void 0 : _c.winningNumbers) === null || _d === void 0 ? void 0 : _d.join(','), selectable: false, "display-selected": true, language: this.language, "grid-type": 'ticket', "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }))), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, translate('multiplier', this.language), " ", (_e = drawDetail.drawData) === null || _e === void 0 ? void 0 :
284
- _e.multiplier))));
285
- }))))))));
286
- }
287
- }
288
- static get style() { return lotteryDrawResultsCss; }
289
- }, [1, "lottery-draw-results", {
290
- "endpoint": [513],
291
- "gameId": [513, "game-id"],
292
- "language": [513],
293
- "playerId": [513, "player-id"],
294
- "drawMode": [516, "draw-mode"],
295
- "drawId": [513, "draw-id"],
296
- "gameName": [513, "game-name"],
297
- "ticketDate": [513, "ticket-date"],
298
- "ticketStatus": [513, "ticket-status"],
299
- "ticketId": [513, "ticket-id"],
300
- "ticketAmount": [513, "ticket-amount"],
301
- "ticketMultiplier": [516, "ticket-multiplier"],
302
- "ticketDrawCount": [514, "ticket-draw-count"],
303
- "ticketNumbers": [513, "ticket-numbers"],
304
- "sessionId": [513, "session-id"],
305
- "clientStyling": [513, "client-styling"],
306
- "clientStylingUrlContent": [513, "client-styling-url-content"],
307
- "ticketDrawData": [513, "ticket-draw-data"],
308
- "multiplier": [32],
309
- "isLoading": [32],
310
- "hasErrors": [32],
311
- "errorText": [32],
312
- "ticketData": [32],
313
- "ticketDataLoaded": [32],
314
- "ticketDraws": [32],
315
- "toggleDrawer": [32],
316
- "limitStylingAppends": [32],
317
- "drawData": [32]
318
- }]);
319
- function defineCustomElement$1() {
320
- if (typeof customElements === "undefined") {
321
- return;
322
- }
323
- const components = ["lottery-draw-results", "lottery-bullet", "lottery-grid"];
324
- components.forEach(tagName => { switch (tagName) {
325
- case "lottery-draw-results":
326
- if (!customElements.get(tagName)) {
327
- customElements.define(tagName, LotteryDrawResults$1);
328
- }
329
- break;
330
- case "lottery-bullet":
331
- if (!customElements.get(tagName)) {
332
- defineCustomElement$3();
333
- }
334
- break;
335
- case "lottery-grid":
336
- if (!customElements.get(tagName)) {
337
- defineCustomElement$2();
338
- }
339
- break;
340
- } });
341
- }
342
-
343
- const LotteryDrawResults = LotteryDrawResults$1;
344
- const defineCustomElement = defineCustomElement$1;
345
-
346
- export { LotteryDrawResults, defineCustomElement };
@@ -1,6 +0,0 @@
1
- import { L as LotteryGrid$1, d as defineCustomElement$1 } from './lottery-grid2.js';
2
-
3
- const LotteryGrid = LotteryGrid$1;
4
- const defineCustomElement = defineCustomElement$1;
5
-
6
- export { LotteryGrid, defineCustomElement };