@everymatrix/lottery-ticket-controller 0.1.7 → 0.1.20
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/helper-accordion_5.cjs.entry.js +171 -24
- package/dist/cjs/{index-95915aab.js → index-dd94b8db.js} +17 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/lottery-ticket-controller.cjs.js +2 -2
- package/dist/collection/components/lottery-ticket-controller/lottery-ticket-controller.js +76 -4
- package/dist/collection/utils/locale.utils.js +14 -0
- package/dist/components/helper-accordion2.js +38 -3
- package/dist/components/lottery-bullet2.js +37 -2
- package/dist/components/lottery-grid2.js +43 -3
- package/dist/components/lottery-ticket-controller.js +52 -2
- package/dist/esm/helper-accordion_5.entry.js +171 -24
- package/dist/esm/{index-e3877ca0.js → index-74cef6d4.js} +17 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/lottery-ticket-controller.js +2 -2
- package/dist/lottery-ticket-controller/lottery-ticket-controller.esm.js +1 -1
- package/dist/lottery-ticket-controller/p-72e48800.js +1 -0
- package/dist/lottery-ticket-controller/p-88036907.entry.js +1 -0
- package/dist/types/components/lottery-ticket-controller/lottery-ticket-controller.d.ts +13 -0
- package/dist/types/components.d.ts +16 -0
- package/dist/types/utils/locale.utils.d.ts +1 -0
- package/package.json +5 -1
- package/dist/lottery-ticket-controller/p-3971b8e6.js +0 -1
- package/dist/lottery-ticket-controller/p-95406ad0.entry.js +0 -1
|
@@ -20,6 +20,15 @@ const LotteryBullet = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
20
20
|
* Marks if the bullet should be selected
|
|
21
21
|
*/
|
|
22
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;
|
|
23
32
|
this.select = () => {
|
|
24
33
|
if (this.selectable) {
|
|
25
34
|
this.isSelected = !this.isSelected;
|
|
@@ -29,15 +38,41 @@ const LotteryBullet = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
29
38
|
});
|
|
30
39
|
}
|
|
31
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
|
|
32
64
|
}
|
|
33
65
|
render() {
|
|
34
|
-
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select() }, this.value));
|
|
66
|
+
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
|
|
35
67
|
}
|
|
36
68
|
static get style() { return lotteryBulletCss; }
|
|
37
69
|
}, [1, "lottery-bullet", {
|
|
38
70
|
"value": [1],
|
|
39
71
|
"selectable": [4],
|
|
40
|
-
"isSelected": [4, "is-selected"]
|
|
72
|
+
"isSelected": [4, "is-selected"],
|
|
73
|
+
"clientStyling": [1, "client-styling"],
|
|
74
|
+
"clientStylingUrlContent": [1, "client-styling-url-content"],
|
|
75
|
+
"limitStylingAppends": [32]
|
|
41
76
|
}]);
|
|
42
77
|
function defineCustomElement() {
|
|
43
78
|
if (typeof customElements === "undefined") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$1 } from './lottery-bullet2.js';
|
|
3
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:
|
|
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
5
|
|
|
6
6
|
const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
7
|
constructor() {
|
|
@@ -38,8 +38,33 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
38
38
|
* Language
|
|
39
39
|
*/
|
|
40
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 = '';
|
|
41
53
|
this.numbers = [];
|
|
54
|
+
this.limitStylingAppends = false;
|
|
42
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
|
+
};
|
|
43
68
|
}
|
|
44
69
|
connectedCallback() {
|
|
45
70
|
let selected = [];
|
|
@@ -68,6 +93,17 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
68
93
|
});
|
|
69
94
|
}
|
|
70
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
|
+
}
|
|
71
107
|
lotteryBulletSelectionHandler(event) {
|
|
72
108
|
this.numbers = this.numbers.map((item) => {
|
|
73
109
|
if (item.number == event.detail.value) {
|
|
@@ -158,7 +194,7 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
158
194
|
}
|
|
159
195
|
}
|
|
160
196
|
render() {
|
|
161
|
-
return (h("div", { class: "GridContainer" }, h("div", { class:
|
|
197
|
+
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 }))))));
|
|
162
198
|
}
|
|
163
199
|
static get style() { return lotteryGridCss; }
|
|
164
200
|
}, [1, "lottery-grid", {
|
|
@@ -172,7 +208,11 @@ const LotteryGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
172
208
|
"displaySelected": [4, "display-selected"],
|
|
173
209
|
"language": [1],
|
|
174
210
|
"gridIndex": [2, "grid-index"],
|
|
175
|
-
"
|
|
211
|
+
"gridType": [1, "grid-type"],
|
|
212
|
+
"clientStyling": [1, "client-styling"],
|
|
213
|
+
"clientStylingUrlContent": [1, "client-styling-url-content"],
|
|
214
|
+
"numbers": [32],
|
|
215
|
+
"limitStylingAppends": [32]
|
|
176
216
|
}, [[0, "lotteryBulletSelection", "lotteryBulletSelectionHandler"], [4, "resetSelection", "resetSelectionHandler"], [4, "autoSelection", "autoSelectionHandler"]]]);
|
|
177
217
|
function defineCustomElement() {
|
|
178
218
|
if (typeof customElements === "undefined") {
|
|
@@ -4,6 +4,21 @@ import { d as defineCustomElement$4 } from './lottery-bullet2.js';
|
|
|
4
4
|
import { d as defineCustomElement$3 } from './lottery-grid2.js';
|
|
5
5
|
import { d as defineCustomElement$2 } from './lottery-ticket2.js';
|
|
6
6
|
|
|
7
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
9
|
+
const TRANSLATIONS = {
|
|
10
|
+
en: {
|
|
11
|
+
ticket: 'Ticket',
|
|
12
|
+
},
|
|
13
|
+
ro: {
|
|
14
|
+
ticket: 'Bilet',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
const translate = (key, customLang) => {
|
|
18
|
+
const lang = customLang;
|
|
19
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
20
|
+
};
|
|
21
|
+
|
|
7
22
|
const lotteryTicketControllerCss = ":host{display:block}";
|
|
8
23
|
|
|
9
24
|
const LotteryTicketController$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -52,6 +67,27 @@ const LotteryTicketController$1 = /*@__PURE__*/ proxyCustomElement(class extends
|
|
|
52
67
|
* Shows the reset button
|
|
53
68
|
*/
|
|
54
69
|
this.resetButton = false;
|
|
70
|
+
/**
|
|
71
|
+
* Client custom styling via string
|
|
72
|
+
*/
|
|
73
|
+
this.clientStyling = '';
|
|
74
|
+
/**
|
|
75
|
+
* Client custom styling via url content
|
|
76
|
+
*/
|
|
77
|
+
this.clientStylingUrlContent = '';
|
|
78
|
+
this.limitStylingAppends = false;
|
|
79
|
+
this.setClientStyling = () => {
|
|
80
|
+
let sheet = document.createElement('style');
|
|
81
|
+
sheet.innerHTML = this.clientStyling;
|
|
82
|
+
this.stylingContainer.prepend(sheet);
|
|
83
|
+
};
|
|
84
|
+
this.setClientStylingURL = () => {
|
|
85
|
+
let cssFile = document.createElement('style');
|
|
86
|
+
setTimeout(() => {
|
|
87
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
88
|
+
this.stylingContainer.prepend(cssFile);
|
|
89
|
+
}, 1);
|
|
90
|
+
};
|
|
55
91
|
}
|
|
56
92
|
// @TODO fix the `any` type
|
|
57
93
|
helperAccordionActionHandler() {
|
|
@@ -62,8 +98,19 @@ const LotteryTicketController$1 = /*@__PURE__*/ proxyCustomElement(class extends
|
|
|
62
98
|
ticketId: this.ticketId
|
|
63
99
|
});
|
|
64
100
|
}
|
|
101
|
+
componentDidRender() {
|
|
102
|
+
// start custom styling area
|
|
103
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
104
|
+
if (this.clientStyling)
|
|
105
|
+
this.setClientStyling();
|
|
106
|
+
if (this.clientStylingUrlContent)
|
|
107
|
+
this.setClientStylingURL();
|
|
108
|
+
this.limitStylingAppends = true;
|
|
109
|
+
}
|
|
110
|
+
// end custom styling area
|
|
111
|
+
}
|
|
65
112
|
render() {
|
|
66
|
-
return (h("div",
|
|
113
|
+
return (h("div", { class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, h("helper-accordion", { "header-title": `${translate('ticket', this.language)} ${this.ticketId}`, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": true, collapsed: !this.last || this.collapsed, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("div", { slot: "accordionContent" }, h("lottery-ticket", { endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
|
|
67
114
|
}
|
|
68
115
|
static get style() { return lotteryTicketControllerCss; }
|
|
69
116
|
}, [1, "lottery-ticket-controller", {
|
|
@@ -78,7 +125,10 @@ const LotteryTicketController$1 = /*@__PURE__*/ proxyCustomElement(class extends
|
|
|
78
125
|
"last": [4],
|
|
79
126
|
"language": [1],
|
|
80
127
|
"autoPick": [4, "auto-pick"],
|
|
81
|
-
"resetButton": [4, "reset-button"]
|
|
128
|
+
"resetButton": [4, "reset-button"],
|
|
129
|
+
"clientStyling": [1, "client-styling"],
|
|
130
|
+
"clientStylingUrlContent": [1, "client-styling-url-content"],
|
|
131
|
+
"limitStylingAppends": [32]
|
|
82
132
|
}, [[0, "helperAccordionAction", "helperAccordionActionHandler"]]]);
|
|
83
133
|
function defineCustomElement$1() {
|
|
84
134
|
if (typeof customElements === "undefined") {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-74cef6d4.js';
|
|
2
2
|
|
|
3
|
-
const DEFAULT_LANGUAGE$
|
|
4
|
-
const SUPPORTED_LANGUAGES$
|
|
5
|
-
const TRANSLATIONS$
|
|
3
|
+
const DEFAULT_LANGUAGE$2 = 'en';
|
|
4
|
+
const SUPPORTED_LANGUAGES$2 = ['ro', 'en'];
|
|
5
|
+
const TRANSLATIONS$2 = {
|
|
6
6
|
en: {
|
|
7
7
|
deleteTicket: 'Delete ticket'
|
|
8
8
|
},
|
|
@@ -10,12 +10,12 @@ const TRANSLATIONS$1 = {
|
|
|
10
10
|
deleteTicket: 'Sterge biletul'
|
|
11
11
|
},
|
|
12
12
|
};
|
|
13
|
-
const translate$
|
|
13
|
+
const translate$2 = (key, customLang) => {
|
|
14
14
|
const lang = customLang;
|
|
15
|
-
return TRANSLATIONS$
|
|
15
|
+
return TRANSLATIONS$2[lang !== undefined && SUPPORTED_LANGUAGES$2.includes(lang) ? lang : DEFAULT_LANGUAGE$2][key];
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:
|
|
18
|
+
const helperAccordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.Header{border-radius:5px;background:#009993;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:1px}.Header:hover{background:#00ABA4}.Header .Title,.Header .Subtitle,.Header .Description{margin:0;font-size:14px;color:#fff;text-transform:capitalize}.Header .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.HeaderTicketHistory{border-radius:4px;background:#F1F1F1;display:flex;gap:30px;border:1px solid #009993;padding:8px 10px;user-select:none;margin-bottom:5px}.HeaderTicketHistory:hover{background:#00ABA4}.HeaderTicketHistory .Title,.HeaderTicketHistory .Subtitle,.HeaderTicketHistory .Description{margin:0;font-size:14px;color:#000}.HeaderTicketHistory .Expand{margin-left:auto;color:#FFF;width:17px;height:17px;cursor:pointer;text-align:center;transform:rotate(90deg);font-size:20px;user-select:none}.Content{border-radius:0 0 4px 4px;background:#fff;border:1px solid #009993;padding:10px 15px;user-select:none;color:#000;margin-bottom:10px}.ActionButton{cursor:pointer;display:inline-block;border-radius:4px;margin:20px 0 10px;text-transform:uppercase;font-size:12px;text-align:center;padding:8px 20px;min-width:80px;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ActionButton:hover{background:#FF6536;border:1px solid #FF3D00}";
|
|
19
19
|
|
|
20
20
|
const Accordion = class {
|
|
21
21
|
constructor(hostRef) {
|
|
@@ -61,11 +61,43 @@ const Accordion = class {
|
|
|
61
61
|
* Language
|
|
62
62
|
*/
|
|
63
63
|
this.language = 'en';
|
|
64
|
+
/**
|
|
65
|
+
* Client custom styling via string
|
|
66
|
+
*/
|
|
67
|
+
this.clientStyling = '';
|
|
68
|
+
/**
|
|
69
|
+
* Client custom styling via url content
|
|
70
|
+
*/
|
|
71
|
+
this.clientStylingUrlContent = '';
|
|
72
|
+
this.limitStylingAppends = false;
|
|
73
|
+
this.setClientStyling = () => {
|
|
74
|
+
let sheet = document.createElement('style');
|
|
75
|
+
sheet.innerHTML = this.clientStyling;
|
|
76
|
+
this.stylingContainer.prepend(sheet);
|
|
77
|
+
};
|
|
78
|
+
this.setClientStylingURL = () => {
|
|
79
|
+
let cssFile = document.createElement('style');
|
|
80
|
+
setTimeout(() => {
|
|
81
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
82
|
+
this.stylingContainer.prepend(cssFile);
|
|
83
|
+
}, 1);
|
|
84
|
+
};
|
|
64
85
|
}
|
|
65
86
|
// @TODO fix the `any` type :)
|
|
66
87
|
connectedCallback() {
|
|
67
88
|
this.showContent = !this.collapsed;
|
|
68
89
|
}
|
|
90
|
+
componentDidRender() {
|
|
91
|
+
// start custom styling area
|
|
92
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
93
|
+
if (this.clientStyling)
|
|
94
|
+
this.setClientStyling();
|
|
95
|
+
if (this.clientStylingUrlContent)
|
|
96
|
+
this.setClientStylingURL();
|
|
97
|
+
this.limitStylingAppends = true;
|
|
98
|
+
}
|
|
99
|
+
// end custom styling area
|
|
100
|
+
}
|
|
69
101
|
toggleContent() {
|
|
70
102
|
this.showContent = !this.showContent;
|
|
71
103
|
}
|
|
@@ -77,10 +109,10 @@ const Accordion = class {
|
|
|
77
109
|
this.accordionEvent.emit();
|
|
78
110
|
}
|
|
79
111
|
render() {
|
|
80
|
-
return (h("div", { class: "Wrapper" }, h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header' }, h("p", { class: "Title" }, this.headerTitle), h("p", { class: "Subtitle" }, this.headerSubtitle), h("p", { class: "Subtitle" }, this.description), h("span", { class: "Expand", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')), this.showContent &&
|
|
112
|
+
return (h("div", { class: "Wrapper", ref: el => this.stylingContainer = el }, h("div", { class: this.ticketHistoryFlag === true ? 'HeaderTicketHistory' : 'Header' }, h("p", { class: "Title" }, this.headerTitle), h("p", { class: "Subtitle" }, this.headerSubtitle), h("p", { class: "Subtitle Description" }, this.description), h("span", { class: "Expand", onClick: () => this.toggleContent() }, this.showContent ? '<' : '>')), this.showContent &&
|
|
81
113
|
h("div", null, h("div", { class: "Content" }, h("slot", { name: 'accordionContent' }), this.footer && this.showContent &&
|
|
82
114
|
h("div", null, this.deleteTab &&
|
|
83
|
-
h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate$
|
|
115
|
+
h("span", { class: "ActionButton", onClick: () => this.deleteAction() }, translate$2('deleteTicket', this.language)))))));
|
|
84
116
|
}
|
|
85
117
|
};
|
|
86
118
|
Accordion.style = helperAccordionCss;
|
|
@@ -103,6 +135,15 @@ const LotteryBullet = class {
|
|
|
103
135
|
* Marks if the bullet should be selected
|
|
104
136
|
*/
|
|
105
137
|
this.isSelected = false;
|
|
138
|
+
/**
|
|
139
|
+
* Client custom styling via string
|
|
140
|
+
*/
|
|
141
|
+
this.clientStyling = '';
|
|
142
|
+
/**
|
|
143
|
+
* Client custom styling via url content
|
|
144
|
+
*/
|
|
145
|
+
this.clientStylingUrlContent = '';
|
|
146
|
+
this.limitStylingAppends = false;
|
|
106
147
|
this.select = () => {
|
|
107
148
|
if (this.selectable) {
|
|
108
149
|
this.isSelected = !this.isSelected;
|
|
@@ -112,14 +153,37 @@ const LotteryBullet = class {
|
|
|
112
153
|
});
|
|
113
154
|
}
|
|
114
155
|
};
|
|
156
|
+
this.setClientStyling = () => {
|
|
157
|
+
let sheet = document.createElement('style');
|
|
158
|
+
sheet.innerHTML = this.clientStyling;
|
|
159
|
+
this.stylingContainer.prepend(sheet);
|
|
160
|
+
};
|
|
161
|
+
this.setClientStylingURL = () => {
|
|
162
|
+
let cssFile = document.createElement('style');
|
|
163
|
+
setTimeout(() => {
|
|
164
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
165
|
+
this.stylingContainer.prepend(cssFile);
|
|
166
|
+
}, 1);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
componentDidRender() {
|
|
170
|
+
// start custom styling area
|
|
171
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
172
|
+
if (this.clientStyling)
|
|
173
|
+
this.setClientStyling();
|
|
174
|
+
if (this.clientStylingUrlContent)
|
|
175
|
+
this.setClientStylingURL();
|
|
176
|
+
this.limitStylingAppends = true;
|
|
177
|
+
}
|
|
178
|
+
// end custom styling area
|
|
115
179
|
}
|
|
116
180
|
render() {
|
|
117
|
-
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select() }, this.value));
|
|
181
|
+
return (h("div", { class: 'Circle ' + (this.selectable ? '' : 'Disabled') + (this.isSelected ? 'Selected' : ''), onClick: () => this.select(), ref: el => this.stylingContainer = el }, this.value));
|
|
118
182
|
}
|
|
119
183
|
};
|
|
120
184
|
LotteryBullet.style = lotteryBulletCss;
|
|
121
185
|
|
|
122
|
-
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:
|
|
186
|
+
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}";
|
|
123
187
|
|
|
124
188
|
const LotteryGrid = class {
|
|
125
189
|
constructor(hostRef) {
|
|
@@ -154,8 +218,33 @@ const LotteryGrid = class {
|
|
|
154
218
|
* Language
|
|
155
219
|
*/
|
|
156
220
|
this.language = 'en';
|
|
221
|
+
/**
|
|
222
|
+
* Personalize grid for ticket
|
|
223
|
+
*/
|
|
224
|
+
this.gridType = '';
|
|
225
|
+
/**
|
|
226
|
+
* Client custom styling via string
|
|
227
|
+
*/
|
|
228
|
+
this.clientStyling = '';
|
|
229
|
+
/**
|
|
230
|
+
* Client custom styling via url content
|
|
231
|
+
*/
|
|
232
|
+
this.clientStylingUrlContent = '';
|
|
157
233
|
this.numbers = [];
|
|
234
|
+
this.limitStylingAppends = false;
|
|
158
235
|
this.selectedCounter = 0;
|
|
236
|
+
this.setClientStyling = () => {
|
|
237
|
+
let sheet = document.createElement('style');
|
|
238
|
+
sheet.innerHTML = this.clientStyling;
|
|
239
|
+
this.stylingContainer.prepend(sheet);
|
|
240
|
+
};
|
|
241
|
+
this.setClientStylingURL = () => {
|
|
242
|
+
let cssFile = document.createElement('style');
|
|
243
|
+
setTimeout(() => {
|
|
244
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
245
|
+
this.stylingContainer.prepend(cssFile);
|
|
246
|
+
}, 1);
|
|
247
|
+
};
|
|
159
248
|
}
|
|
160
249
|
connectedCallback() {
|
|
161
250
|
let selected = [];
|
|
@@ -184,6 +273,17 @@ const LotteryGrid = class {
|
|
|
184
273
|
});
|
|
185
274
|
}
|
|
186
275
|
}
|
|
276
|
+
componentDidRender() {
|
|
277
|
+
// start custom styling area
|
|
278
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
279
|
+
if (this.clientStyling)
|
|
280
|
+
this.setClientStyling();
|
|
281
|
+
if (this.clientStylingUrlContent)
|
|
282
|
+
this.setClientStylingURL();
|
|
283
|
+
this.limitStylingAppends = true;
|
|
284
|
+
}
|
|
285
|
+
// end custom styling area
|
|
286
|
+
}
|
|
187
287
|
lotteryBulletSelectionHandler(event) {
|
|
188
288
|
this.numbers = this.numbers.map((item) => {
|
|
189
289
|
if (item.number == event.detail.value) {
|
|
@@ -274,14 +374,14 @@ const LotteryGrid = class {
|
|
|
274
374
|
}
|
|
275
375
|
}
|
|
276
376
|
render() {
|
|
277
|
-
return (h("div", { class: "GridContainer" }, h("div", { class:
|
|
377
|
+
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 }))))));
|
|
278
378
|
}
|
|
279
379
|
};
|
|
280
380
|
LotteryGrid.style = lotteryGridCss;
|
|
281
381
|
|
|
282
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
283
|
-
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
284
|
-
const TRANSLATIONS = {
|
|
382
|
+
const DEFAULT_LANGUAGE$1 = 'en';
|
|
383
|
+
const SUPPORTED_LANGUAGES$1 = ['ro', 'en'];
|
|
384
|
+
const TRANSLATIONS$1 = {
|
|
285
385
|
en: {
|
|
286
386
|
loading: 'Loading, please wait ...',
|
|
287
387
|
error: 'It was an error while trying to fetch the data',
|
|
@@ -303,9 +403,9 @@ const TRANSLATIONS = {
|
|
|
303
403
|
autoButton: 'Ma simt norocos'
|
|
304
404
|
},
|
|
305
405
|
};
|
|
306
|
-
const translate = (key, customLang) => {
|
|
406
|
+
const translate$1 = (key, customLang) => {
|
|
307
407
|
const lang = customLang;
|
|
308
|
-
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
408
|
+
return TRANSLATIONS$1[lang !== undefined && SUPPORTED_LANGUAGES$1.includes(lang) ? lang : DEFAULT_LANGUAGE$1][key];
|
|
309
409
|
};
|
|
310
410
|
|
|
311
411
|
const lotteryTicketCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketTitle{font-size:16px;font-weight:bold}.ButtonContainer{display:flex;justify-content:flex-end}.Toggle{cursor:pointer;margin-top:20px;display:inline-block}.ToggleSwitch{display:inline-block;background:#707070;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%, #F1F1F1 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:#00ABA4}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px;font-size:14px;font-weight:lighter;color:#000}input[type=number]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}.NumberInput,.WagerInput{margin-top:10px;display:inline-flex;align-items:center}.NumberInput,.NumberInput *{box-sizing:border-box}.NumberInput button{cursor:pointer;outline:none;-webkit-appearance:none;border:none;align-items:center;justify-content:center;height:20px;position:relative}.NumberInput button:after{display:inline-block;position:absolute;transform:translate(-50%, -50%) rotate(180deg);align-items:center;text-align:center}.NumberInput button.Plus:after{transform:translate(-50%, -50%) rotate(0deg);width:30px;display:inline-flex;align-items:center;text-align:center}.NumberInput input[type=number],.WagerInput input[type=number]{max-width:50px;display:inline-flex;align-items:center;padding:4px 10px;text-align:center}.NumberInput input[type=number] .WagerInputTitle,.WagerInput input[type=number] .WagerInputTitle{font-size:14px;color:#000;padding:10px}.InputDefault{background-color:#F1F1F1;border-radius:4px;padding:5px;border:solid 1px #D4D4D4;color:#707070}.AutoButton{cursor:pointer;display:inline-block;border-radius:4px;padding:8px 20px;width:max-content;margin:5px 0;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.AutoButton:active{background:#00958f;color:#FFF}.ResetButton{cursor:pointer;display:inline-block;border-radius:4px;padding:8px 20px;width:max-content;margin:5px 0;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.ResetButton:hover{background:#FF6536;border:1px solid #FF3D00}.TicketGridBullets{background:#f1f1f1;border-radius:4px;padding:20px;margin-top:5px}.TicketGridBullets .TicketGridTitle{margin-top:0px}.Minus{border-radius:4px;width:30px;height:24px !important;margin-right:10px;color:#FFF;background:#009993}.Plus{border-radius:4px;width:30px;height:24px !important;margin-left:10px;color:#FFF;background:#009993}.SelectWrapper{width:auto;padding:5px;margin:0 auto;border:1px solid #ccc;border-radius:5px;position:relative}.SelectButton,.SelectOptions li{display:flex;align-items:center;cursor:pointer}.SelectButton{display:flex;padding:0 5px;border-radius:7px;align-items:center;justify-content:space-between;font-size:14px}.SelectButton span:first-child{padding-right:10px}.SelectExpand{transition:transform 0.3s linear;font-size:12px}.SelectActive .SelectExpand{transform:rotate(180deg)}.SelectContent{display:none;padding:5px;border-radius:7px}.SelectWrapper.SelectActive .SelectContent{width:100%;display:block;position:absolute;left:0;top:32px;padding:0;border:1px solid #ccc;overflow:hidden;background:#fff}.SelectContent .SelectOptions{max-height:100px;margin:0;overflow-y:auto;padding:0}.SelectContent .SelectOptions .SelectedValue{background-color:#009993;color:#fff}.SelectOptions::-webkit-scrollbar{width:7px}.SelectOptions::-webkit-scrollbar-track{background:#f1f1f1;border-radius:25px}.SelectOptions::-webkit-scrollbar-thumb{background:#ccc;border-radius:25px}.SelectOptions li{height:20px;padding:0 13px;font-size:14px}.SelectOptions li:hover{background:#f2f2f2}";
|
|
@@ -418,19 +518,19 @@ const LotteryTicket = class {
|
|
|
418
518
|
}
|
|
419
519
|
render() {
|
|
420
520
|
if (this.isLoading) {
|
|
421
|
-
return (h("div", null, h("p", null, translate('loading', this.language))));
|
|
521
|
+
return (h("div", null, h("p", null, translate$1('loading', this.language))));
|
|
422
522
|
}
|
|
423
523
|
else {
|
|
424
524
|
if (this.hasErrors) {
|
|
425
|
-
return (h("div", null, h("p", null, translate('error', this.language))));
|
|
525
|
+
return (h("div", null, h("p", null, translate$1('error', this.language))));
|
|
426
526
|
}
|
|
427
527
|
else {
|
|
428
528
|
const { rules } = this.gameData;
|
|
429
529
|
return (h("div", { class: "TicketContainer" }, h("p", { class: "TicketTitle" }, this.gameData.name), this.resetButton && this.ticketDone &&
|
|
430
|
-
h("div", { class: "ButtonContainer" }, h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate('resetButton', this.language))), this.autoPick && !this.ticketDone &&
|
|
431
|
-
h("div", { class: "ButtonContainer" }, h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate('autoButton', this.language))), this.grids.map((item, index) => h("div", { class: "TicketGridBullets" }, h("p", { class: "TicketGridTitle" }, translate('grid', this.language), " ", item), h("lottery-grid", { "grid-index": index, "maximum-allowed": rules.boards[index].maximumAllowed, "minimum-allowed": rules.boards[index].minimumAllowed, "total-numbers": rules.boards[index].totalNumbers, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language }))), rules.multiplier &&
|
|
432
|
-
h("div", null, h("label", { class: "Toggle" }, h("label", { class: "Label" }, translate('multiplier', this.language), ": "), h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
|
|
433
|
-
h("div", { class: "TicketDraws" }, h("label", { class: "Label" }, translate('numberOfDraws', this.language), ": "), h("div", { class: "NumberInput" }, h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), h("div", null, h("label", { class: "Label" }, translate('wagerPerDraw', this.language), ": "), h("div", { class: "WagerInput" }, rules.stakes.length > 1 ?
|
|
530
|
+
h("div", { class: "ButtonContainer" }, h("a", { class: "ResetButton", onClick: () => this.toggleResetSelection() }, translate$1('resetButton', this.language))), this.autoPick && !this.ticketDone &&
|
|
531
|
+
h("div", { class: "ButtonContainer" }, h("a", { class: "AutoButton", onClick: () => this.toggleAutoSelection() }, translate$1('autoButton', this.language))), this.grids.map((item, index) => h("div", { class: "TicketGridBullets" }, h("p", { class: "TicketGridTitle" }, translate$1('grid', this.language), " ", item), h("lottery-grid", { "grid-index": index, "maximum-allowed": rules.boards[index].maximumAllowed, "minimum-allowed": rules.boards[index].minimumAllowed, "total-numbers": rules.boards[index].totalNumbers, selectable: true, "reset-button": true, "auto-pick": true, "game-id": this.gameId, "ticket-id": this.ticketId, language: this.language }))), rules.multiplier &&
|
|
532
|
+
h("div", null, h("label", { class: "Toggle" }, h("label", { class: "Label" }, translate$1('multiplier', this.language), ": "), h("input", { class: "ToggleCheckbox", type: "checkbox", onInput: (e) => this.multiplierChangeHandler(e) }), h("div", { class: "ToggleSwitch" }))), this.multipleDraws &&
|
|
533
|
+
h("div", { class: "TicketDraws" }, h("label", { class: "Label" }, translate$1('numberOfDraws', this.language), ": "), h("div", { class: "NumberInput" }, h("button", { onClick: () => this.numberOfDraws > 1 ? this.numberOfDraws-- : this.numberOfDraws = 1, class: "Minus" }, "-"), h("input", { class: "InputDefault", min: "1", value: this.numberOfDraws, type: "number" }), h("button", { onClick: () => this.numberOfDraws++, class: "Plus" }, "+"))), h("div", null, h("label", { class: "Label" }, translate$1('wagerPerDraw', this.language), ": "), h("div", { class: "WagerInput" }, rules.stakes.length > 1 ?
|
|
434
534
|
(h("div", { "data-cluster": "SelectComponent", class: this.isCustomSelect ? "SelectWrapper SelectActive" : "SelectWrapper" }, h("div", { "data-cluster": "SelectComponent", class: "SelectButton", onClick: () => this.toggleClass() }, h("span", { "data-cluster": "SelectComponent" }, this.amountInfo.amount, " ", this.amountInfo.currency), h("span", { "data-cluster": "SelectComponent", class: "SelectExpand" }, "\u25BC")), h("div", { "data-cluster": "SelectComponent", class: "SelectContent" }, h("ul", { "data-cluster": "SelectComponent", class: "SelectOptions" }, rules.stakes.map((item) => h("li", { "data-cluster": "SelectComponent", class: this.amountInfo.amount == item.amount ? 'SelectedValue' : '', value: item.amount, onClick: () => this.setDropdownItem(item) }, item.amount, " ", item.currency)))))) : (h("div", null, h("input", { min: "1", value: rules.stakes[0].amount, type: "number", disabled: true }), h("p", { class: "WagerInputTitle" }, rules.stakes[0].currency)))))));
|
|
435
535
|
}
|
|
436
536
|
}
|
|
@@ -441,6 +541,21 @@ const LotteryTicket = class {
|
|
|
441
541
|
};
|
|
442
542
|
LotteryTicket.style = lotteryTicketCss;
|
|
443
543
|
|
|
544
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
545
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
546
|
+
const TRANSLATIONS = {
|
|
547
|
+
en: {
|
|
548
|
+
ticket: 'Ticket',
|
|
549
|
+
},
|
|
550
|
+
ro: {
|
|
551
|
+
ticket: 'Bilet',
|
|
552
|
+
},
|
|
553
|
+
};
|
|
554
|
+
const translate = (key, customLang) => {
|
|
555
|
+
const lang = customLang;
|
|
556
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
557
|
+
};
|
|
558
|
+
|
|
444
559
|
const lotteryTicketControllerCss = ":host{display:block}";
|
|
445
560
|
|
|
446
561
|
const LotteryTicketController = class {
|
|
@@ -487,6 +602,27 @@ const LotteryTicketController = class {
|
|
|
487
602
|
* Shows the reset button
|
|
488
603
|
*/
|
|
489
604
|
this.resetButton = false;
|
|
605
|
+
/**
|
|
606
|
+
* Client custom styling via string
|
|
607
|
+
*/
|
|
608
|
+
this.clientStyling = '';
|
|
609
|
+
/**
|
|
610
|
+
* Client custom styling via url content
|
|
611
|
+
*/
|
|
612
|
+
this.clientStylingUrlContent = '';
|
|
613
|
+
this.limitStylingAppends = false;
|
|
614
|
+
this.setClientStyling = () => {
|
|
615
|
+
let sheet = document.createElement('style');
|
|
616
|
+
sheet.innerHTML = this.clientStyling;
|
|
617
|
+
this.stylingContainer.prepend(sheet);
|
|
618
|
+
};
|
|
619
|
+
this.setClientStylingURL = () => {
|
|
620
|
+
let cssFile = document.createElement('style');
|
|
621
|
+
setTimeout(() => {
|
|
622
|
+
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
623
|
+
this.stylingContainer.prepend(cssFile);
|
|
624
|
+
}, 1);
|
|
625
|
+
};
|
|
490
626
|
}
|
|
491
627
|
// @TODO fix the `any` type
|
|
492
628
|
helperAccordionActionHandler() {
|
|
@@ -497,8 +633,19 @@ const LotteryTicketController = class {
|
|
|
497
633
|
ticketId: this.ticketId
|
|
498
634
|
});
|
|
499
635
|
}
|
|
636
|
+
componentDidRender() {
|
|
637
|
+
// start custom styling area
|
|
638
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
639
|
+
if (this.clientStyling)
|
|
640
|
+
this.setClientStyling();
|
|
641
|
+
if (this.clientStylingUrlContent)
|
|
642
|
+
this.setClientStylingURL();
|
|
643
|
+
this.limitStylingAppends = true;
|
|
644
|
+
}
|
|
645
|
+
// end custom styling area
|
|
646
|
+
}
|
|
500
647
|
render() {
|
|
501
|
-
return (h("div",
|
|
648
|
+
return (h("div", { class: "LotteryTicketControllerContainer", ref: el => this.stylingContainer = el }, h("helper-accordion", { "header-title": `${translate('ticket', this.language)} ${this.ticketId}`, "header-subtitle": this.ticketDescription, footer: true, "delete-tab": true, collapsed: !this.last || this.collapsed, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("div", { slot: "accordionContent" }, h("lottery-ticket", { endpoint: this.endpoint, "game-id": this.gameId, "ticket-id": this.ticketId, "number-of-grids": this.numberOfGrids, language: this.language, "reset-button": this.resetButton, "auto-pick": this.autoPick, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })))));
|
|
502
649
|
}
|
|
503
650
|
};
|
|
504
651
|
LotteryTicketController.style = lotteryTicketControllerCss;
|
|
@@ -248,6 +248,12 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
248
248
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
249
249
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
250
250
|
}
|
|
251
|
+
else if (memberName === 'ref') {
|
|
252
|
+
// minifier will clean this up
|
|
253
|
+
if (newValue) {
|
|
254
|
+
newValue(elm);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
251
257
|
else if ((!isProp ) &&
|
|
252
258
|
memberName[0] === 'o' &&
|
|
253
259
|
memberName[1] === 'n') {
|
|
@@ -404,6 +410,7 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
404
410
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
405
411
|
if ((vnode = vnodes[startIdx])) {
|
|
406
412
|
elm = vnode.$elm$;
|
|
413
|
+
callNodeRefs(vnode);
|
|
407
414
|
// remove the vnode's element from the dom
|
|
408
415
|
elm.remove();
|
|
409
416
|
}
|
|
@@ -525,6 +532,12 @@ const patch = (oldVNode, newVNode) => {
|
|
|
525
532
|
elm.data = text;
|
|
526
533
|
}
|
|
527
534
|
};
|
|
535
|
+
const callNodeRefs = (vNode) => {
|
|
536
|
+
{
|
|
537
|
+
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
538
|
+
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
539
|
+
}
|
|
540
|
+
};
|
|
528
541
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
529
542
|
const hostElm = hostRef.$hostElement$;
|
|
530
543
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
@@ -666,7 +679,11 @@ const postUpdateComponent = (hostRef) => {
|
|
|
666
679
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
667
680
|
const elm = hostRef.$hostElement$;
|
|
668
681
|
const endPostUpdate = createTime('postUpdate', tagName);
|
|
682
|
+
const instance = hostRef.$lazyInstance$ ;
|
|
669
683
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
684
|
+
{
|
|
685
|
+
safeCall(instance, 'componentDidRender');
|
|
686
|
+
}
|
|
670
687
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
671
688
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
672
689
|
{
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-74cef6d4.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["helper-accordion_5",[[1,"lottery-ticket-controller",{"endpoint":[1],"ticketId":[2,"ticket-id"],"ticketDescription":[1,"ticket-description"],"gameId":[1,"game-id"],"postMessage":[4,"post-message"],"eventName":[1,"event-name"],"collapsed":[4],"numberOfGrids":[2,"number-of-grids"],"last":[4],"language":[1],"autoPick":[4,"auto-pick"],"resetButton":[4,"reset-button"]},[[0,"helperAccordionAction","helperAccordionActionHandler"]]],[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32],"isCustomSelect":[32],"amountInfo":[32]},[[8,"click","checkForClickOutside"],[0,"gridFilled","gridFilledHandler"]]],[1,"helper-accordion",{"ticketHistoryFlag":[4,"ticket-history-flag"],"headerTitle":[1,"header-title"],"headerSubtitle":[1,"header-subtitle"],"description":[1],"footer":[4],"deleteTab":[4,"delete-tab"],"postMessage":[4,"post-message"],"eventName":[1,"event-name"],"collapsed":[4],"language":[1],"showContent":[32]}],[1,"lottery-grid",{"ticketId":[2,"ticket-id"],"totalNumbers":[2,"total-numbers"],"gameId":[1,"game-id"],"maximumAllowed":[2,"maximum-allowed"],"minimumAllowed":[2,"minimum-allowed"],"selectable":[4],"selectedNumbers":[1,"selected-numbers"],"displaySelected":[4,"display-selected"],"language":[1],"gridIndex":[2,"grid-index"],"numbers":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[1],"selectable":[4],"isSelected":[4,"is-selected"]}]]]], options);
|
|
13
|
+
return bootstrapLazy([["helper-accordion_5",[[1,"lottery-ticket-controller",{"endpoint":[1],"ticketId":[2,"ticket-id"],"ticketDescription":[1,"ticket-description"],"gameId":[1,"game-id"],"postMessage":[4,"post-message"],"eventName":[1,"event-name"],"collapsed":[4],"numberOfGrids":[2,"number-of-grids"],"last":[4],"language":[1],"autoPick":[4,"auto-pick"],"resetButton":[4,"reset-button"],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"limitStylingAppends":[32]},[[0,"helperAccordionAction","helperAccordionActionHandler"]]],[1,"lottery-ticket",{"endpoint":[1],"gameId":[1,"game-id"],"numberOfGrids":[2,"number-of-grids"],"multipleDraws":[4,"multiple-draws"],"ticketId":[2,"ticket-id"],"resetButton":[4,"reset-button"],"autoPick":[4,"auto-pick"],"language":[1],"multiplier":[32],"numberOfDraws":[32],"isLoading":[32],"hasErrors":[32],"ticketDone":[32],"isCustomSelect":[32],"amountInfo":[32]},[[8,"click","checkForClickOutside"],[0,"gridFilled","gridFilledHandler"]]],[1,"helper-accordion",{"ticketHistoryFlag":[4,"ticket-history-flag"],"headerTitle":[1,"header-title"],"headerSubtitle":[1,"header-subtitle"],"description":[1],"footer":[4],"deleteTab":[4,"delete-tab"],"postMessage":[4,"post-message"],"eventName":[1,"event-name"],"collapsed":[4],"language":[1],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"showContent":[32],"limitStylingAppends":[32]}],[1,"lottery-grid",{"ticketId":[2,"ticket-id"],"totalNumbers":[2,"total-numbers"],"gameId":[1,"game-id"],"maximumAllowed":[2,"maximum-allowed"],"minimumAllowed":[2,"minimum-allowed"],"selectable":[4],"selectedNumbers":[1,"selected-numbers"],"displaySelected":[4,"display-selected"],"language":[1],"gridIndex":[2,"grid-index"],"gridType":[1,"grid-type"],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"numbers":[32],"limitStylingAppends":[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{"value":[1],"selectable":[4],"isSelected":[4,"is-selected"],"clientStyling":[1,"client-styling"],"clientStylingUrlContent":[1,"client-styling-url-content"],"limitStylingAppends":[32]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|