@everymatrix/helper-tabs 1.55.0 → 1.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/helper-tab_2.cjs.entry.js +159 -65
- package/dist/cjs/helper-tabs.cjs.js +3 -3
- package/dist/cjs/{index-d8f4ee8c.js → index-08bd9c7c.js} +207 -75
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/helper-tab/helper-tab.js +95 -38
- package/dist/collection/components/helper-tabs/helper-tabs.js +111 -37
- package/dist/esm/helper-tab_2.entry.js +159 -65
- package/dist/esm/helper-tabs.js +4 -4
- package/dist/esm/{index-55376e55.js → index-c5727b52.js} +207 -75
- package/dist/esm/loader.js +3 -3
- package/dist/helper-tabs/helper-tabs.esm.js +1 -1
- package/dist/helper-tabs/p-c6fec16e.entry.js +1 -0
- package/dist/helper-tabs/p-d8d96e22.js +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/helper-tabs/.stencil/packages/stencil/helper-tabs/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/helper-tabs/.stencil/packages/stencil/helper-tabs/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/helper-tab/helper-tab.d.ts +10 -5
- package/dist/types/components/helper-tabs/helper-tabs.d.ts +10 -5
- package/dist/types/components.d.ts +20 -4
- package/package.json +1 -1
- package/dist/helper-tabs/p-47fcd693.js +0 -2
- package/dist/helper-tabs/p-7f43459b.entry.js +0 -1
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/helper-tabs/.stencil/packages/stencil/helper-tabs/stencil.config.d.ts +0 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/helper-tabs/.stencil/packages/stencil/helper-tabs/stencil.config.dev.d.ts +0 -2
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/helper-tabs/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/helper-tabs/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/helper-tabs/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/helper-tabs/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index-c5727b52.js';
|
|
2
2
|
|
|
3
3
|
const DEFAULT_LANGUAGE = 'en';
|
|
4
4
|
const SUPPORTED_LANGUAGES = ['en'];
|
|
@@ -72,53 +72,119 @@ const getTranslations = (data) => {
|
|
|
72
72
|
});
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* @name setClientStyling
|
|
77
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content received
|
|
78
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
79
|
+
* @param {string} clientStyling The style content
|
|
80
|
+
*/
|
|
81
|
+
function setClientStyling(stylingContainer, clientStyling) {
|
|
82
|
+
if (stylingContainer) {
|
|
83
|
+
const sheet = document.createElement('style');
|
|
84
|
+
sheet.innerHTML = clientStyling;
|
|
85
|
+
stylingContainer.appendChild(sheet);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @name setClientStylingURL
|
|
91
|
+
* @description Method used to create and append to the passed element of the widget a style element with the content fetched from a given URL
|
|
92
|
+
* @param {HTMLElement} stylingContainer The reference element of the widget
|
|
93
|
+
* @param {string} clientStylingUrl The URL of the style content
|
|
94
|
+
*/
|
|
95
|
+
function setClientStylingURL(stylingContainer, clientStylingUrl) {
|
|
96
|
+
const url = new URL(clientStylingUrl);
|
|
97
|
+
|
|
98
|
+
fetch(url.href)
|
|
99
|
+
.then((res) => res.text())
|
|
100
|
+
.then((data) => {
|
|
101
|
+
const cssFile = document.createElement('style');
|
|
102
|
+
cssFile.innerHTML = data;
|
|
103
|
+
if (stylingContainer) {
|
|
104
|
+
stylingContainer.appendChild(cssFile);
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
.catch((err) => {
|
|
108
|
+
console.error('There was an error while trying to load client styling from URL', err);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* @name setStreamLibrary
|
|
114
|
+
* @description Method used to create and append to the passed element of the widget a style element with content fetched from the MessageBus
|
|
115
|
+
* @param {HTMLElement} stylingContainer The highest element of the widget
|
|
116
|
+
* @param {string} domain The domain from where the content should be fetched (e.g. 'Casino.Style', 'App.Style', 'casino-footer.style', etc.)
|
|
117
|
+
* @param {ref} subscription A reference to a variable where the subscription should be saved for unsubscribing when no longer needed
|
|
118
|
+
*/
|
|
119
|
+
function setStreamStyling(stylingContainer, domain, subscription) {
|
|
120
|
+
if (window.emMessageBus) {
|
|
121
|
+
const sheet = document.createElement('style');
|
|
122
|
+
|
|
123
|
+
window.emMessageBus.subscribe(domain, (data) => {
|
|
124
|
+
sheet.innerHTML = data;
|
|
125
|
+
if (stylingContainer) {
|
|
126
|
+
stylingContainer.appendChild(sheet);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
75
132
|
const helperTabCss = ":host{display:block}.TabContent{font-size:14px;color:var(--emw--button-text-color, #000);font-weight:normal}";
|
|
76
133
|
const HelperTabStyle0 = helperTabCss;
|
|
77
134
|
|
|
78
135
|
const HelperTab = class {
|
|
79
136
|
constructor(hostRef) {
|
|
80
137
|
registerInstance(this, hostRef);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this.stylingContainer.prepend(sheet);
|
|
85
|
-
};
|
|
86
|
-
this.setClientStylingURL = () => {
|
|
87
|
-
let cssFile = document.createElement('style');
|
|
88
|
-
setTimeout(() => {
|
|
89
|
-
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
90
|
-
this.stylingContainer.prepend(cssFile);
|
|
91
|
-
}, 1);
|
|
92
|
-
};
|
|
138
|
+
/**
|
|
139
|
+
* Selected index
|
|
140
|
+
*/
|
|
93
141
|
this.selectedIndex = 0;
|
|
94
|
-
|
|
142
|
+
/**
|
|
143
|
+
* Client custom styling via string
|
|
144
|
+
*/
|
|
95
145
|
this.clientStyling = '';
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
this.
|
|
100
|
-
|
|
146
|
+
/**
|
|
147
|
+
* Client custom styling via url content
|
|
148
|
+
*/
|
|
149
|
+
this.clientStylingUrl = '';
|
|
150
|
+
/**
|
|
151
|
+
* Language of the widget
|
|
152
|
+
*/
|
|
101
153
|
this.language = 'en';
|
|
102
|
-
this.translationUrl = undefined;
|
|
103
154
|
this.tabContent = '';
|
|
104
|
-
|
|
155
|
+
}
|
|
156
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
157
|
+
if (newValue != oldValue) {
|
|
158
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
handleClientStylingChangeURL(newValue, oldValue) {
|
|
162
|
+
if (newValue != oldValue) {
|
|
163
|
+
if (this.clientStylingUrl)
|
|
164
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
componentDidLoad() {
|
|
168
|
+
if (this.stylingContainer) {
|
|
169
|
+
if (window.emMessageBus != undefined) {
|
|
170
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
if (this.clientStyling)
|
|
174
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
175
|
+
if (this.clientStylingUrl)
|
|
176
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
disconnectedCallback() {
|
|
181
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
105
182
|
}
|
|
106
183
|
componentWillLoad() {
|
|
107
184
|
if (this.translationUrl) {
|
|
108
185
|
getTranslations(JSON.parse(this.translationUrl));
|
|
109
186
|
}
|
|
110
187
|
}
|
|
111
|
-
componentDidRender() {
|
|
112
|
-
// start custom styling area
|
|
113
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
114
|
-
if (this.clientStyling)
|
|
115
|
-
this.setClientStyling();
|
|
116
|
-
if (this.clientStylingUrlContent)
|
|
117
|
-
this.setClientStylingURL();
|
|
118
|
-
this.limitStylingAppends = true;
|
|
119
|
-
}
|
|
120
|
-
// end custom styling area
|
|
121
|
-
}
|
|
122
188
|
getHowToPlay() {
|
|
123
189
|
if (this.lowNumber && this.highNumber && this.maxinumAllowed && this.minimumAllowed) {
|
|
124
190
|
return translateWithParams('howToPlay', {
|
|
@@ -132,15 +198,19 @@ const HelperTab = class {
|
|
|
132
198
|
return '';
|
|
133
199
|
}
|
|
134
200
|
render() {
|
|
135
|
-
this.tabContent = h("div", { key: '
|
|
201
|
+
this.tabContent = h("div", { key: '92877a17361066f68fce6299cb8f65901f6abc60', class: "TabContent", ref: el => this.stylingContainer = el }, this.getHowToPlay());
|
|
136
202
|
if (this.selectedIndex + 1 == 2) {
|
|
137
|
-
this.tabContent = h("div", { key: '
|
|
203
|
+
this.tabContent = h("div", { key: '9876b9250371034ef40dab0f5fc3fe1a5631a370', class: "TabContent", ref: el => this.stylingContainer = el }, h("ol", { key: 'ef2097eb54aeb640f06871277d8cafd2f4455109' }, h("li", { key: 'e9a0237e1fdead445abcd9240174276ffef81a67' }, translate('register', this.language)), h("li", { key: '2bdfaffdc9f1a7ae021913cb0ba346132140dcfd' }, translate('butTickets', this.language)), h("li", { key: 'bff38eaeabeaece83dc8ed1697e5b052802753f6' }, translate('reviewPurchase', this.language))));
|
|
138
204
|
}
|
|
139
205
|
else if (this.selectedIndex + 1 == 3) {
|
|
140
|
-
this.tabContent = h("div", { key: '
|
|
206
|
+
this.tabContent = h("div", { key: '49a7fb3435fb50b54572ec38d1e632e2eacf56fb', class: "TabContent", ref: el => this.stylingContainer = el }, h("ul", { key: '7f642625f35a1ed1eae7655144c0b8b1bfe25f55' }, h("li", { key: '037a5913be57dd1e2dcde5a061e9c64e70365e8d' }, translate('odds', this.language)), h("li", { key: '8775a1b2e8eda285e2c248b8d7235f06ac593fc6' }, translate('winGame', this.language)), h("li", { key: '5297fc5e757c29a1349049f1fe294e926255d518' }, translate('claimPrize', this.language))));
|
|
141
207
|
}
|
|
142
208
|
return (this.tabContent);
|
|
143
209
|
}
|
|
210
|
+
static get watchers() { return {
|
|
211
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
212
|
+
"clientStylingUrl": ["handleClientStylingChangeURL"]
|
|
213
|
+
}; }
|
|
144
214
|
};
|
|
145
215
|
HelperTab.style = HelperTabStyle0;
|
|
146
216
|
|
|
@@ -150,52 +220,76 @@ const HelperTabsStyle0 = helperTabsCss;
|
|
|
150
220
|
const HelperTabs = class {
|
|
151
221
|
constructor(hostRef) {
|
|
152
222
|
registerInstance(this, hostRef);
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
this.stylingContainer.prepend(sheet);
|
|
157
|
-
};
|
|
158
|
-
this.setClientStylingURL = () => {
|
|
159
|
-
let cssFile = document.createElement('style');
|
|
160
|
-
setTimeout(() => {
|
|
161
|
-
cssFile.innerHTML = this.clientStylingUrlContent;
|
|
162
|
-
this.stylingContainer.prepend(cssFile);
|
|
163
|
-
}, 1);
|
|
164
|
-
};
|
|
223
|
+
/**
|
|
224
|
+
* Tell me if it is disabled
|
|
225
|
+
*/
|
|
165
226
|
this.disabled = false;
|
|
166
|
-
|
|
227
|
+
/**
|
|
228
|
+
* Tell me what tab is selected
|
|
229
|
+
*/
|
|
167
230
|
this.selected = false;
|
|
168
|
-
|
|
231
|
+
/**
|
|
232
|
+
* Default selected index
|
|
233
|
+
*/
|
|
169
234
|
this.selectedIndex = 0;
|
|
235
|
+
/**
|
|
236
|
+
* Tabs details
|
|
237
|
+
*/
|
|
170
238
|
this.tabs = [{ label: 'How to Play' }, { label: 'About' }, { label: 'FAQs' }];
|
|
239
|
+
/**
|
|
240
|
+
* Client custom styling via string
|
|
241
|
+
*/
|
|
171
242
|
this.clientStyling = '';
|
|
243
|
+
/**
|
|
244
|
+
* Client custom styling via url
|
|
245
|
+
*/
|
|
172
246
|
this.clientStylingurl = '';
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
this.
|
|
177
|
-
|
|
247
|
+
/**
|
|
248
|
+
* Client custom styling via url content
|
|
249
|
+
*/
|
|
250
|
+
this.clientStylingUrl = '';
|
|
251
|
+
/**
|
|
252
|
+
* Language
|
|
253
|
+
*/
|
|
178
254
|
this.language = 'en';
|
|
179
|
-
this.translationUrl = undefined;
|
|
180
|
-
this.limitStylingAppends = false;
|
|
181
255
|
}
|
|
182
256
|
connectedCallback() {
|
|
183
257
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
258
|
+
handleClientStylingChange(newValue, oldValue) {
|
|
259
|
+
if (newValue != oldValue) {
|
|
260
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
handleClientStylingChangeURL(newValue, oldValue) {
|
|
264
|
+
if (newValue != oldValue) {
|
|
265
|
+
if (this.clientStylingUrl)
|
|
266
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
componentDidLoad() {
|
|
270
|
+
if (this.stylingContainer) {
|
|
271
|
+
if (window.emMessageBus != undefined) {
|
|
272
|
+
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
if (this.clientStyling)
|
|
276
|
+
setClientStyling(this.stylingContainer, this.clientStyling);
|
|
277
|
+
if (this.clientStylingUrl)
|
|
278
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
190
279
|
}
|
|
191
|
-
this.limitStylingAppends = true;
|
|
192
280
|
}
|
|
193
|
-
|
|
281
|
+
}
|
|
282
|
+
disconnectedCallback() {
|
|
283
|
+
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
194
284
|
}
|
|
195
285
|
render() {
|
|
196
|
-
return (h("div", { key: '
|
|
286
|
+
return (h("div", { key: '173c4774748482dc56fcffb4bac4e1666fa9170f', ref: el => this.stylingContainer = el }, h("div", { key: '680b65218e4b00f134b354f593c0c20fb5882dca', class: "Tabs" }, this.tabs.map((tab, index) => h("button", { class: 'TabButton' + (this.selectedIndex == index ? ' Active' : ''), onClick: () => this.selectedIndex = index }, tab.label))), h("div", { key: '67aa26c92fb416c5d0934988fb071481f805685b' }, h("helper-tab", { key: '63c8dfc253d4fc12b0310a2585a44b90807e1a9f', "low-number": this.lowNumber, "high-number": this.highNumber, "minimum-allowed": this.minimumAllowed, "maxinum-allowed": this.maxinumAllowed, selectedIndex: this.selectedIndex, "client-styling": this.clientStyling, language: this.language, "translation-url": this.translationUrl, "client-stylingurl": this.clientStylingurl, "client-styling-url-content": this.clientStylingUrl, "mb-source": this.mbSource }))));
|
|
197
287
|
}
|
|
198
288
|
get host() { return getElement(this); }
|
|
289
|
+
static get watchers() { return {
|
|
290
|
+
"clientStyling": ["handleClientStylingChange"],
|
|
291
|
+
"clientStylingUrl": ["handleClientStylingChangeURL"]
|
|
292
|
+
}; }
|
|
199
293
|
};
|
|
200
294
|
HelperTabs.style = HelperTabsStyle0;
|
|
201
295
|
|
package/dist/esm/helper-tabs.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-c5727b52.js';
|
|
2
|
+
export { s as setNonce } from './index-c5727b52.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v4.
|
|
6
|
+
Stencil Client Patch Browser v4.26.0 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
var patchBrowser = () => {
|
|
9
9
|
const importMeta = import.meta.url;
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["helper-tab_2",[[1,"helper-tabs",{"disabled":[516],"label":[513],"selected":[516],"cmsEndpoint":[513,"cms-endpoint"],"selectedIndex":[1538,"selected-index"],"tabs":[16],"clientStyling":[513,"client-styling"],"clientStylingurl":[513,"client-stylingurl"],"
|
|
19
|
+
return bootstrapLazy([["helper-tab_2",[[1,"helper-tabs",{"disabled":[516],"label":[513],"selected":[516],"cmsEndpoint":[513,"cms-endpoint"],"selectedIndex":[1538,"selected-index"],"tabs":[16],"clientStyling":[513,"client-styling"],"mbSource":[1,"mb-source"],"clientStylingurl":[513,"client-stylingurl"],"clientStylingUrl":[513,"client-styling-url"],"lowNumber":[514,"low-number"],"highNumber":[514,"high-number"],"minimumAllowed":[514,"minimum-allowed"],"maxinumAllowed":[514,"maxinum-allowed"],"language":[513],"translationUrl":[520,"translation-url"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}],[1,"helper-tab",{"selectedIndex":[514,"selected-index"],"cmsEndpoint":[513,"cms-endpoint"],"mbSource":[1,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"lowNumber":[514,"low-number"],"highNumber":[514,"high-number"],"minimumAllowed":[514,"minimum-allowed"],"maxinumAllowed":[514,"maxinum-allowed"],"language":[513],"translationUrl":[520,"translation-url"],"tabContent":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingChangeURL"]}]]]], options);
|
|
20
20
|
});
|