@everymatrix/casino-engagement-suite-bar 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.
- package/dist/casino-engagement-suite-bar/casino-engagement-suite-bar.esm.js +1 -1
- package/dist/casino-engagement-suite-bar/p-0a29e254.entry.js +1 -0
- package/dist/casino-engagement-suite-bar/p-e1255160.js +1 -0
- package/dist/casino-engagement-suite-bar/p-e3622c4f.js +2 -0
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/casino-engagement-suite-bar.cjs.entry.js +104 -126
- package/dist/cjs/casino-engagement-suite-bar.cjs.js +16 -10
- package/dist/cjs/index-650e78a1.js +1181 -0
- package/dist/cjs/loader.cjs.js +6 -12
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/casino-engagement-suite-bar/casino-engagement-suite-bar.css +20 -20
- package/dist/collection/components/casino-engagement-suite-bar/casino-engagement-suite-bar.js +374 -411
- package/dist/collection/components/casino-engagement-suite-bar/index.js +1 -0
- package/dist/collection/utils/index.js +3 -3
- package/dist/collection/utils/locale.utils.js +5 -5
- package/dist/collection/utils/utils.js +3 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/casino-engagement-suite-bar.entry.js +104 -126
- package/dist/esm/casino-engagement-suite-bar.js +13 -10
- package/dist/esm/index-6a254eea.js +1155 -0
- package/dist/esm/loader.js +6 -12
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-bar/.stencil/packages/stencil/casino-engagement-suite-bar/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-bar/.stencil/packages/stencil/casino-engagement-suite-bar/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/casino-engagement-suite-bar/casino-engagement-suite-bar.d.ts +68 -68
- package/dist/types/components/casino-engagement-suite-bar/index.d.ts +1 -0
- package/dist/types/components.d.ts +1 -0
- package/dist/types/models/index.d.ts +11 -11
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +9 -2
- package/dist/casino-engagement-suite-bar/p-09703adc.js +0 -1
- package/dist/casino-engagement-suite-bar/p-6a92c0ec.entry.js +0 -1
- package/dist/cjs/index-baea8059.js +0 -1163
- package/dist/components/casino-engagement-suite-bar.d.ts +0 -11
- package/dist/components/casino-engagement-suite-bar.js +0 -178
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/esm/index-965162c9.js +0 -1138
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-bar/.stencil/packages/casino-engagement-suite-bar/stencil.config.d.ts +0 -2
package/dist/collection/components/casino-engagement-suite-bar/casino-engagement-suite-bar.js
CHANGED
|
@@ -1,416 +1,379 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { formatBalance } from
|
|
3
|
-
import { translate } from
|
|
1
|
+
import { h } from "@stencil/core";
|
|
2
|
+
import { formatBalance } from "../../utils";
|
|
3
|
+
import { translate } from "../../utils/locale.utils";
|
|
4
4
|
export class CasinoEngagementSuiteBar {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
this.activeWidget = application;
|
|
49
|
-
if (application === 'Jackpots') {
|
|
50
|
-
this.activeJackpot = ev.target.getAttribute('data-type');
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
this.setClientStyling = () => {
|
|
54
|
-
let sheet = document.createElement('style');
|
|
55
|
-
sheet.innerHTML = this.clientStyling;
|
|
56
|
-
this.engagementSuiteBar.prepend(sheet);
|
|
57
|
-
};
|
|
58
|
-
this.setClientStylingURL = () => {
|
|
59
|
-
let url = new URL(this.clientStylingUrl);
|
|
60
|
-
let cssFile = document.createElement('style');
|
|
61
|
-
fetch(url.href)
|
|
62
|
-
.then((res) => res.text())
|
|
63
|
-
.then((data) => {
|
|
64
|
-
cssFile.innerHTML = data;
|
|
65
|
-
setTimeout(() => { this.engagementSuiteBar.prepend(cssFile); }, 1);
|
|
66
|
-
})
|
|
67
|
-
.catch((err) => {
|
|
68
|
-
console.log('Error ', err);
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
componentDidRender() {
|
|
73
|
-
// start custom styling area
|
|
74
|
-
if (!this.limitStylingAppends && this.engagementSuiteBar) {
|
|
75
|
-
if (this.clientStyling)
|
|
76
|
-
this.setClientStyling();
|
|
77
|
-
if (this.clientStylingUrl)
|
|
78
|
-
this.setClientStylingURL();
|
|
79
|
-
this.limitStylingAppends = true;
|
|
5
|
+
constructor() {
|
|
6
|
+
this.handleTileClick = (ev) => {
|
|
7
|
+
const application = ev.target.getAttribute('data-app');
|
|
8
|
+
window.postMessage({ type: `Bar${application}Click` });
|
|
9
|
+
this.activeWidget = application;
|
|
10
|
+
if (application === 'Jackpots') {
|
|
11
|
+
this.activeJackpot = ev.target.getAttribute('data-type');
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
this.setClientStyling = () => {
|
|
15
|
+
let sheet = document.createElement('style');
|
|
16
|
+
sheet.innerHTML = this.clientStyling;
|
|
17
|
+
this.engagementSuiteBar.prepend(sheet);
|
|
18
|
+
};
|
|
19
|
+
this.setClientStylingURL = () => {
|
|
20
|
+
let url = new URL(this.clientStylingUrl);
|
|
21
|
+
let cssFile = document.createElement('style');
|
|
22
|
+
fetch(url.href)
|
|
23
|
+
.then((res) => res.text())
|
|
24
|
+
.then((data) => {
|
|
25
|
+
cssFile.innerHTML = data;
|
|
26
|
+
setTimeout(() => { this.engagementSuiteBar.prepend(cssFile); }, 1);
|
|
27
|
+
})
|
|
28
|
+
.catch((err) => {
|
|
29
|
+
console.log('Error ', err);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
this.activeWidget = undefined;
|
|
33
|
+
this.challengePercent = undefined;
|
|
34
|
+
this.highlightChallenge = false;
|
|
35
|
+
this.clientStyling = '';
|
|
36
|
+
this.clientStylingUrl = '';
|
|
37
|
+
this.orientation = 'Landscape';
|
|
38
|
+
this.device = 'Mobile';
|
|
39
|
+
this.isChallengeLabel = false;
|
|
40
|
+
this.isForfeitedChallengeLabel = false;
|
|
41
|
+
this.isSpinForfeitedLabel = false;
|
|
42
|
+
this.language = 'en';
|
|
43
|
+
this.jackpots = [];
|
|
44
|
+
this.remainingFreeSpins = undefined;
|
|
45
|
+
this.leaderboards = undefined;
|
|
46
|
+
this.limitStylingAppends = false;
|
|
47
|
+
this.activeJackpot = '';
|
|
80
48
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
h("div", { class: `ForfeitLabel ${this.isForfeitedChallengeLabel ? 'ShowForfeitChallengeLabel' : ''}` }));
|
|
90
|
-
}
|
|
91
|
-
getFreeSpinsTile() {
|
|
92
|
-
return (h("button", { class: `Tile Reward FreeSpins ${this.activeWidget === 'FreeSpins' ? 'Active' : ''}`, "data-app": "FreeSpins", onClick: this.handleTileClick },
|
|
93
|
-
h("div", { class: "RewardIcon" }),
|
|
94
|
-
h("span", null, this.remainingFreeSpins),
|
|
95
|
-
h("div", { class: `ForfeitLabel ${this.isSpinForfeitedLabel ? 'ShowForfeitLabel' : ''}` },
|
|
96
|
-
h("span", null))));
|
|
97
|
-
}
|
|
98
|
-
getJackpotClasses(jackpot) {
|
|
99
|
-
return {
|
|
100
|
-
Tile: true,
|
|
101
|
-
Jackpot: true,
|
|
102
|
-
Enabled: jackpot.Enabled,
|
|
103
|
-
Active: this.activeWidget === 'Jackpots' && this.activeJackpot === jackpot.Type,
|
|
104
|
-
[jackpot.Type.charAt(0).toUpperCase() + jackpot.Type.slice(1)]: true
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
getJackpotsTemplate() {
|
|
108
|
-
return this.jackpots.map((jackpot) => {
|
|
109
|
-
const jackpotBalance = formatBalance(jackpot.Balance, jackpot.Currency);
|
|
110
|
-
return h("div", { class: this.getJackpotClasses(jackpot), "data-app": "Jackpots", "data-type": jackpot.Type, onClick: this.handleTileClick },
|
|
111
|
-
h("div", { class: "JackpotType" }, jackpot.Type),
|
|
112
|
-
h("span", { class: "JackpotBalance" }, jackpotBalance));
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
getLeaderboardsTile() {
|
|
116
|
-
return (h("button", { class: `Tile Reward Leaderboard ${this.activeWidget === 'Leaderboards' ? 'Active' : ''}`, "data-app": "Leaderboards", onClick: this.handleTileClick },
|
|
117
|
-
h("div", { class: "RewardIcon" }),
|
|
118
|
-
h("span", null, "-")));
|
|
119
|
-
}
|
|
120
|
-
displayTilesInOneRow() {
|
|
121
|
-
const jackpotsLength = this.jackpots.length;
|
|
122
|
-
const boostersLength = [this.leaderboards, this.challengePercent, this.remainingFreeSpins].filter(obj => !!obj).length;
|
|
123
|
-
return jackpotsLength + boostersLength < 4;
|
|
124
|
-
}
|
|
125
|
-
getTilesTemplate() {
|
|
126
|
-
return this.displayTilesInOneRow()
|
|
127
|
-
? h("div", { class: "EngagementSuiteContainer" },
|
|
128
|
-
!!this.jackpots.length && this.getJackpotsTemplate(),
|
|
129
|
-
this.leaderboards && this.getLeaderboardsTile(),
|
|
130
|
-
this.challengePercent && this.getChallengeTile(),
|
|
131
|
-
this.remainingFreeSpins && this.getFreeSpinsTile())
|
|
132
|
-
: h("div", { class: "EngagementSuiteContainer" },
|
|
133
|
-
h("div", { class: "Jackpots" }, !!this.jackpots.length && this.getJackpotsTemplate()),
|
|
134
|
-
h("div", { class: "Rewards" },
|
|
135
|
-
this.leaderboards && this.getLeaderboardsTile(),
|
|
136
|
-
this.challengePercent && this.getChallengeTile(),
|
|
137
|
-
this.remainingFreeSpins && this.getFreeSpinsTile()));
|
|
138
|
-
}
|
|
139
|
-
render() {
|
|
140
|
-
return h("div", { class: `CasinoEngagementSuiteBar ${this.orientation} ${this.device}`, ref: (el) => (this.engagementSuiteBar = el) }, this.getTilesTemplate());
|
|
141
|
-
}
|
|
142
|
-
static get is() { return "casino-engagement-suite-bar"; }
|
|
143
|
-
static get encapsulation() { return "shadow"; }
|
|
144
|
-
static get originalStyleUrls() { return {
|
|
145
|
-
"$": ["casino-engagement-suite-bar.scss"]
|
|
146
|
-
}; }
|
|
147
|
-
static get styleUrls() { return {
|
|
148
|
-
"$": ["casino-engagement-suite-bar.css"]
|
|
149
|
-
}; }
|
|
150
|
-
static get properties() { return {
|
|
151
|
-
"activeWidget": {
|
|
152
|
-
"type": "string",
|
|
153
|
-
"mutable": true,
|
|
154
|
-
"complexType": {
|
|
155
|
-
"original": "string",
|
|
156
|
-
"resolved": "string",
|
|
157
|
-
"references": {}
|
|
158
|
-
},
|
|
159
|
-
"required": false,
|
|
160
|
-
"optional": false,
|
|
161
|
-
"docs": {
|
|
162
|
-
"tags": [],
|
|
163
|
-
"text": "Highlight active widget"
|
|
164
|
-
},
|
|
165
|
-
"attribute": "active-widget",
|
|
166
|
-
"reflect": true
|
|
167
|
-
},
|
|
168
|
-
"challengePercent": {
|
|
169
|
-
"type": "string",
|
|
170
|
-
"mutable": false,
|
|
171
|
-
"complexType": {
|
|
172
|
-
"original": "string",
|
|
173
|
-
"resolved": "string",
|
|
174
|
-
"references": {}
|
|
175
|
-
},
|
|
176
|
-
"required": false,
|
|
177
|
-
"optional": false,
|
|
178
|
-
"docs": {
|
|
179
|
-
"tags": [],
|
|
180
|
-
"text": "The Challenge Percent"
|
|
181
|
-
},
|
|
182
|
-
"attribute": "challenge-percent",
|
|
183
|
-
"reflect": false
|
|
184
|
-
},
|
|
185
|
-
"highlightChallenge": {
|
|
186
|
-
"type": "boolean",
|
|
187
|
-
"mutable": false,
|
|
188
|
-
"complexType": {
|
|
189
|
-
"original": "boolean",
|
|
190
|
-
"resolved": "boolean",
|
|
191
|
-
"references": {}
|
|
192
|
-
},
|
|
193
|
-
"required": false,
|
|
194
|
-
"optional": false,
|
|
195
|
-
"docs": {
|
|
196
|
-
"tags": [],
|
|
197
|
-
"text": "Highlight Challenge tile"
|
|
198
|
-
},
|
|
199
|
-
"attribute": "highlight-challenge",
|
|
200
|
-
"reflect": false,
|
|
201
|
-
"defaultValue": "false"
|
|
202
|
-
},
|
|
203
|
-
"clientStyling": {
|
|
204
|
-
"type": "string",
|
|
205
|
-
"mutable": false,
|
|
206
|
-
"complexType": {
|
|
207
|
-
"original": "string",
|
|
208
|
-
"resolved": "string",
|
|
209
|
-
"references": {}
|
|
210
|
-
},
|
|
211
|
-
"required": false,
|
|
212
|
-
"optional": false,
|
|
213
|
-
"docs": {
|
|
214
|
-
"tags": [],
|
|
215
|
-
"text": "Client custom styling via string"
|
|
216
|
-
},
|
|
217
|
-
"attribute": "client-styling",
|
|
218
|
-
"reflect": true,
|
|
219
|
-
"defaultValue": "''"
|
|
220
|
-
},
|
|
221
|
-
"clientStylingUrl": {
|
|
222
|
-
"type": "string",
|
|
223
|
-
"mutable": false,
|
|
224
|
-
"complexType": {
|
|
225
|
-
"original": "string",
|
|
226
|
-
"resolved": "string",
|
|
227
|
-
"references": {}
|
|
228
|
-
},
|
|
229
|
-
"required": false,
|
|
230
|
-
"optional": false,
|
|
231
|
-
"docs": {
|
|
232
|
-
"tags": [],
|
|
233
|
-
"text": "Client custom styling via url"
|
|
234
|
-
},
|
|
235
|
-
"attribute": "client-styling-url",
|
|
236
|
-
"reflect": true,
|
|
237
|
-
"defaultValue": "''"
|
|
238
|
-
},
|
|
239
|
-
"orientation": {
|
|
240
|
-
"type": "string",
|
|
241
|
-
"mutable": false,
|
|
242
|
-
"complexType": {
|
|
243
|
-
"original": "\"Landscape\" | \"Portrait\"",
|
|
244
|
-
"resolved": "\"Landscape\" | \"Portrait\"",
|
|
245
|
-
"references": {}
|
|
246
|
-
},
|
|
247
|
-
"required": false,
|
|
248
|
-
"optional": false,
|
|
249
|
-
"docs": {
|
|
250
|
-
"tags": [],
|
|
251
|
-
"text": "Orientation of the widget"
|
|
252
|
-
},
|
|
253
|
-
"attribute": "orientation",
|
|
254
|
-
"reflect": false,
|
|
255
|
-
"defaultValue": "'Landscape' as 'Landscape' | 'Portrait'"
|
|
256
|
-
},
|
|
257
|
-
"device": {
|
|
258
|
-
"type": "string",
|
|
259
|
-
"mutable": false,
|
|
260
|
-
"complexType": {
|
|
261
|
-
"original": "\"Mobile\" | \"Tablet\" | \"Desktop\"",
|
|
262
|
-
"resolved": "\"Desktop\" | \"Mobile\" | \"Tablet\"",
|
|
263
|
-
"references": {}
|
|
264
|
-
},
|
|
265
|
-
"required": false,
|
|
266
|
-
"optional": false,
|
|
267
|
-
"docs": {
|
|
268
|
-
"tags": [],
|
|
269
|
-
"text": "User's device type"
|
|
270
|
-
},
|
|
271
|
-
"attribute": "device",
|
|
272
|
-
"reflect": false,
|
|
273
|
-
"defaultValue": "'Mobile' as 'Mobile' | 'Tablet' | 'Desktop'"
|
|
274
|
-
},
|
|
275
|
-
"isChallengeLabel": {
|
|
276
|
-
"type": "boolean",
|
|
277
|
-
"mutable": false,
|
|
278
|
-
"complexType": {
|
|
279
|
-
"original": "boolean",
|
|
280
|
-
"resolved": "boolean",
|
|
281
|
-
"references": {}
|
|
282
|
-
},
|
|
283
|
-
"required": false,
|
|
284
|
-
"optional": false,
|
|
285
|
-
"docs": {
|
|
286
|
-
"tags": [],
|
|
287
|
-
"text": "Show challenge label"
|
|
288
|
-
},
|
|
289
|
-
"attribute": "is-challenge-label",
|
|
290
|
-
"reflect": false,
|
|
291
|
-
"defaultValue": "false"
|
|
292
|
-
},
|
|
293
|
-
"isForfeitedChallengeLabel": {
|
|
294
|
-
"type": "boolean",
|
|
295
|
-
"mutable": false,
|
|
296
|
-
"complexType": {
|
|
297
|
-
"original": "boolean",
|
|
298
|
-
"resolved": "boolean",
|
|
299
|
-
"references": {}
|
|
300
|
-
},
|
|
301
|
-
"required": false,
|
|
302
|
-
"optional": false,
|
|
303
|
-
"docs": {
|
|
304
|
-
"tags": [],
|
|
305
|
-
"text": "Show forfeited challenge label"
|
|
306
|
-
},
|
|
307
|
-
"attribute": "is-forfeited-challenge-label",
|
|
308
|
-
"reflect": false,
|
|
309
|
-
"defaultValue": "false"
|
|
310
|
-
},
|
|
311
|
-
"isSpinForfeitedLabel": {
|
|
312
|
-
"type": "boolean",
|
|
313
|
-
"mutable": true,
|
|
314
|
-
"complexType": {
|
|
315
|
-
"original": "boolean",
|
|
316
|
-
"resolved": "boolean",
|
|
317
|
-
"references": {}
|
|
318
|
-
},
|
|
319
|
-
"required": false,
|
|
320
|
-
"optional": false,
|
|
321
|
-
"docs": {
|
|
322
|
-
"tags": [],
|
|
323
|
-
"text": "Show spins forfeited label"
|
|
324
|
-
},
|
|
325
|
-
"attribute": "is-spin-forfeited-label",
|
|
326
|
-
"reflect": false,
|
|
327
|
-
"defaultValue": "false"
|
|
328
|
-
},
|
|
329
|
-
"language": {
|
|
330
|
-
"type": "string",
|
|
331
|
-
"mutable": false,
|
|
332
|
-
"complexType": {
|
|
333
|
-
"original": "string",
|
|
334
|
-
"resolved": "string",
|
|
335
|
-
"references": {}
|
|
336
|
-
},
|
|
337
|
-
"required": false,
|
|
338
|
-
"optional": false,
|
|
339
|
-
"docs": {
|
|
340
|
-
"tags": [],
|
|
341
|
-
"text": "Language of the widget"
|
|
342
|
-
},
|
|
343
|
-
"attribute": "language",
|
|
344
|
-
"reflect": false,
|
|
345
|
-
"defaultValue": "'en'"
|
|
346
|
-
},
|
|
347
|
-
"jackpots": {
|
|
348
|
-
"type": "unknown",
|
|
349
|
-
"mutable": false,
|
|
350
|
-
"complexType": {
|
|
351
|
-
"original": "Jackpot[]",
|
|
352
|
-
"resolved": "Jackpot[]",
|
|
353
|
-
"references": {
|
|
354
|
-
"Array": {
|
|
355
|
-
"location": "global"
|
|
356
|
-
},
|
|
357
|
-
"Jackpot": {
|
|
358
|
-
"location": "import",
|
|
359
|
-
"path": "../../models"
|
|
360
|
-
}
|
|
49
|
+
componentDidRender() {
|
|
50
|
+
// start custom styling area
|
|
51
|
+
if (!this.limitStylingAppends && this.engagementSuiteBar) {
|
|
52
|
+
if (this.clientStyling)
|
|
53
|
+
this.setClientStyling();
|
|
54
|
+
if (this.clientStylingUrl)
|
|
55
|
+
this.setClientStylingURL();
|
|
56
|
+
this.limitStylingAppends = true;
|
|
361
57
|
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
"
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
58
|
+
// end custom styling area
|
|
59
|
+
}
|
|
60
|
+
getChallengeTile() {
|
|
61
|
+
return h("button", { class: `Tile Reward Challenges ${this.activeWidget === 'Challenges' || this.highlightChallenge ? 'Active' : ''}`, "data-app": "Challenges", onClick: this.handleTileClick }, h("div", { class: "RewardIcon" }), h("span", null, this.challengePercent), h("div", { class: `ChallengeLabel ${(this.isChallengeLabel && !this.isForfeitedChallengeLabel) ? 'ShowChallengeLabel' : ''}` }, h("span", null, translate('new', this.language))), h("div", { class: `ForfeitLabel ${this.isForfeitedChallengeLabel ? 'ShowForfeitChallengeLabel' : ''}` }));
|
|
62
|
+
}
|
|
63
|
+
getFreeSpinsTile() {
|
|
64
|
+
return (h("button", { class: `Tile Reward FreeSpins ${this.activeWidget === 'FreeSpins' ? 'Active' : ''}`, "data-app": "FreeSpins", onClick: this.handleTileClick }, h("div", { class: "RewardIcon" }), h("span", null, this.remainingFreeSpins), h("div", { class: `ForfeitLabel ${this.isSpinForfeitedLabel ? 'ShowForfeitLabel' : ''}` }, h("span", null))));
|
|
65
|
+
}
|
|
66
|
+
getJackpotClasses(jackpot) {
|
|
67
|
+
return {
|
|
68
|
+
Tile: true,
|
|
69
|
+
Jackpot: true,
|
|
70
|
+
Enabled: jackpot.Enabled,
|
|
71
|
+
Active: this.activeWidget === 'Jackpots' && this.activeJackpot === jackpot.Type,
|
|
72
|
+
[jackpot.Type.charAt(0).toUpperCase() + jackpot.Type.slice(1)]: true
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
getJackpotsTemplate() {
|
|
76
|
+
return this.jackpots.map((jackpot) => {
|
|
77
|
+
const jackpotBalance = formatBalance(jackpot.Balance, jackpot.Currency);
|
|
78
|
+
return h("div", { class: this.getJackpotClasses(jackpot), "data-app": "Jackpots", "data-type": jackpot.Type, onClick: this.handleTileClick }, h("div", { class: "JackpotType" }, jackpot.Type), h("span", { class: "JackpotBalance" }, jackpotBalance));
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
getLeaderboardsTile() {
|
|
82
|
+
return (h("button", { class: `Tile Reward Leaderboard ${this.activeWidget === 'Leaderboards' ? 'Active' : ''}`, "data-app": "Leaderboards", onClick: this.handleTileClick }, h("div", { class: "RewardIcon" }), h("span", null, "-")));
|
|
83
|
+
}
|
|
84
|
+
displayTilesInOneRow() {
|
|
85
|
+
const jackpotsLength = this.jackpots.length;
|
|
86
|
+
const boostersLength = [this.leaderboards, this.challengePercent, this.remainingFreeSpins].filter(obj => !!obj).length;
|
|
87
|
+
return jackpotsLength + boostersLength < 4;
|
|
88
|
+
}
|
|
89
|
+
getTilesTemplate() {
|
|
90
|
+
return this.displayTilesInOneRow()
|
|
91
|
+
? h("div", { class: "EngagementSuiteContainer" }, !!this.jackpots.length && this.getJackpotsTemplate(), this.leaderboards && this.getLeaderboardsTile(), this.challengePercent && this.getChallengeTile(), this.remainingFreeSpins && this.getFreeSpinsTile())
|
|
92
|
+
: h("div", { class: "EngagementSuiteContainer" }, h("div", { class: "Jackpots" }, !!this.jackpots.length && this.getJackpotsTemplate()), h("div", { class: "Rewards" }, this.leaderboards && this.getLeaderboardsTile(), this.challengePercent && this.getChallengeTile(), this.remainingFreeSpins && this.getFreeSpinsTile()));
|
|
93
|
+
}
|
|
94
|
+
render() {
|
|
95
|
+
return h("div", { key: 'f90aab0bf55c9016600be3ab90199de6c31874ee', class: `CasinoEngagementSuiteBar ${this.orientation} ${this.device}`, ref: (el) => (this.engagementSuiteBar = el) }, this.getTilesTemplate());
|
|
96
|
+
}
|
|
97
|
+
static get is() { return "casino-engagement-suite-bar"; }
|
|
98
|
+
static get encapsulation() { return "shadow"; }
|
|
99
|
+
static get originalStyleUrls() {
|
|
100
|
+
return {
|
|
101
|
+
"$": ["casino-engagement-suite-bar.scss"]
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
static get styleUrls() {
|
|
105
|
+
return {
|
|
106
|
+
"$": ["casino-engagement-suite-bar.css"]
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
static get properties() {
|
|
110
|
+
return {
|
|
111
|
+
"activeWidget": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"mutable": true,
|
|
114
|
+
"complexType": {
|
|
115
|
+
"original": "string",
|
|
116
|
+
"resolved": "string",
|
|
117
|
+
"references": {}
|
|
118
|
+
},
|
|
119
|
+
"required": false,
|
|
120
|
+
"optional": false,
|
|
121
|
+
"docs": {
|
|
122
|
+
"tags": [],
|
|
123
|
+
"text": "Highlight active widget"
|
|
124
|
+
},
|
|
125
|
+
"attribute": "active-widget",
|
|
126
|
+
"reflect": true
|
|
127
|
+
},
|
|
128
|
+
"challengePercent": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"mutable": false,
|
|
131
|
+
"complexType": {
|
|
132
|
+
"original": "string",
|
|
133
|
+
"resolved": "string",
|
|
134
|
+
"references": {}
|
|
135
|
+
},
|
|
136
|
+
"required": false,
|
|
137
|
+
"optional": false,
|
|
138
|
+
"docs": {
|
|
139
|
+
"tags": [],
|
|
140
|
+
"text": "The Challenge Percent"
|
|
141
|
+
},
|
|
142
|
+
"attribute": "challenge-percent",
|
|
143
|
+
"reflect": false
|
|
144
|
+
},
|
|
145
|
+
"highlightChallenge": {
|
|
146
|
+
"type": "boolean",
|
|
147
|
+
"mutable": false,
|
|
148
|
+
"complexType": {
|
|
149
|
+
"original": "boolean",
|
|
150
|
+
"resolved": "boolean",
|
|
151
|
+
"references": {}
|
|
152
|
+
},
|
|
153
|
+
"required": false,
|
|
154
|
+
"optional": false,
|
|
155
|
+
"docs": {
|
|
156
|
+
"tags": [],
|
|
157
|
+
"text": "Highlight Challenge tile"
|
|
158
|
+
},
|
|
159
|
+
"attribute": "highlight-challenge",
|
|
160
|
+
"reflect": false,
|
|
161
|
+
"defaultValue": "false"
|
|
162
|
+
},
|
|
163
|
+
"clientStyling": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"mutable": false,
|
|
166
|
+
"complexType": {
|
|
167
|
+
"original": "string",
|
|
168
|
+
"resolved": "string",
|
|
169
|
+
"references": {}
|
|
170
|
+
},
|
|
171
|
+
"required": false,
|
|
172
|
+
"optional": false,
|
|
173
|
+
"docs": {
|
|
174
|
+
"tags": [],
|
|
175
|
+
"text": "Client custom styling via string"
|
|
176
|
+
},
|
|
177
|
+
"attribute": "client-styling",
|
|
178
|
+
"reflect": true,
|
|
179
|
+
"defaultValue": "''"
|
|
180
|
+
},
|
|
181
|
+
"clientStylingUrl": {
|
|
182
|
+
"type": "string",
|
|
183
|
+
"mutable": false,
|
|
184
|
+
"complexType": {
|
|
185
|
+
"original": "string",
|
|
186
|
+
"resolved": "string",
|
|
187
|
+
"references": {}
|
|
188
|
+
},
|
|
189
|
+
"required": false,
|
|
190
|
+
"optional": false,
|
|
191
|
+
"docs": {
|
|
192
|
+
"tags": [],
|
|
193
|
+
"text": "Client custom styling via url"
|
|
194
|
+
},
|
|
195
|
+
"attribute": "client-styling-url",
|
|
196
|
+
"reflect": true,
|
|
197
|
+
"defaultValue": "''"
|
|
198
|
+
},
|
|
199
|
+
"orientation": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"mutable": false,
|
|
202
|
+
"complexType": {
|
|
203
|
+
"original": "\"Landscape\" | \"Portrait\"",
|
|
204
|
+
"resolved": "\"Landscape\" | \"Portrait\"",
|
|
205
|
+
"references": {}
|
|
206
|
+
},
|
|
207
|
+
"required": false,
|
|
208
|
+
"optional": false,
|
|
209
|
+
"docs": {
|
|
210
|
+
"tags": [],
|
|
211
|
+
"text": "Orientation of the widget"
|
|
212
|
+
},
|
|
213
|
+
"attribute": "orientation",
|
|
214
|
+
"reflect": false,
|
|
215
|
+
"defaultValue": "'Landscape' as 'Landscape' | 'Portrait'"
|
|
216
|
+
},
|
|
217
|
+
"device": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"mutable": false,
|
|
220
|
+
"complexType": {
|
|
221
|
+
"original": "\"Mobile\" | \"Tablet\" | \"Desktop\"",
|
|
222
|
+
"resolved": "\"Desktop\" | \"Mobile\" | \"Tablet\"",
|
|
223
|
+
"references": {}
|
|
224
|
+
},
|
|
225
|
+
"required": false,
|
|
226
|
+
"optional": false,
|
|
227
|
+
"docs": {
|
|
228
|
+
"tags": [],
|
|
229
|
+
"text": "User's device type"
|
|
230
|
+
},
|
|
231
|
+
"attribute": "device",
|
|
232
|
+
"reflect": false,
|
|
233
|
+
"defaultValue": "'Mobile' as 'Mobile' | 'Tablet' | 'Desktop'"
|
|
234
|
+
},
|
|
235
|
+
"isChallengeLabel": {
|
|
236
|
+
"type": "boolean",
|
|
237
|
+
"mutable": false,
|
|
238
|
+
"complexType": {
|
|
239
|
+
"original": "boolean",
|
|
240
|
+
"resolved": "boolean",
|
|
241
|
+
"references": {}
|
|
242
|
+
},
|
|
243
|
+
"required": false,
|
|
244
|
+
"optional": false,
|
|
245
|
+
"docs": {
|
|
246
|
+
"tags": [],
|
|
247
|
+
"text": "Show challenge label"
|
|
248
|
+
},
|
|
249
|
+
"attribute": "is-challenge-label",
|
|
250
|
+
"reflect": false,
|
|
251
|
+
"defaultValue": "false"
|
|
252
|
+
},
|
|
253
|
+
"isForfeitedChallengeLabel": {
|
|
254
|
+
"type": "boolean",
|
|
255
|
+
"mutable": false,
|
|
256
|
+
"complexType": {
|
|
257
|
+
"original": "boolean",
|
|
258
|
+
"resolved": "boolean",
|
|
259
|
+
"references": {}
|
|
260
|
+
},
|
|
261
|
+
"required": false,
|
|
262
|
+
"optional": false,
|
|
263
|
+
"docs": {
|
|
264
|
+
"tags": [],
|
|
265
|
+
"text": "Show forfeited challenge label"
|
|
266
|
+
},
|
|
267
|
+
"attribute": "is-forfeited-challenge-label",
|
|
268
|
+
"reflect": false,
|
|
269
|
+
"defaultValue": "false"
|
|
270
|
+
},
|
|
271
|
+
"isSpinForfeitedLabel": {
|
|
272
|
+
"type": "boolean",
|
|
273
|
+
"mutable": true,
|
|
274
|
+
"complexType": {
|
|
275
|
+
"original": "boolean",
|
|
276
|
+
"resolved": "boolean",
|
|
277
|
+
"references": {}
|
|
278
|
+
},
|
|
279
|
+
"required": false,
|
|
280
|
+
"optional": false,
|
|
281
|
+
"docs": {
|
|
282
|
+
"tags": [],
|
|
283
|
+
"text": "Show spins forfeited label"
|
|
284
|
+
},
|
|
285
|
+
"attribute": "is-spin-forfeited-label",
|
|
286
|
+
"reflect": false,
|
|
287
|
+
"defaultValue": "false"
|
|
288
|
+
},
|
|
289
|
+
"language": {
|
|
290
|
+
"type": "string",
|
|
291
|
+
"mutable": false,
|
|
292
|
+
"complexType": {
|
|
293
|
+
"original": "string",
|
|
294
|
+
"resolved": "string",
|
|
295
|
+
"references": {}
|
|
296
|
+
},
|
|
297
|
+
"required": false,
|
|
298
|
+
"optional": false,
|
|
299
|
+
"docs": {
|
|
300
|
+
"tags": [],
|
|
301
|
+
"text": "Language of the widget"
|
|
302
|
+
},
|
|
303
|
+
"attribute": "language",
|
|
304
|
+
"reflect": false,
|
|
305
|
+
"defaultValue": "'en'"
|
|
306
|
+
},
|
|
307
|
+
"jackpots": {
|
|
308
|
+
"type": "unknown",
|
|
309
|
+
"mutable": false,
|
|
310
|
+
"complexType": {
|
|
311
|
+
"original": "Jackpot[]",
|
|
312
|
+
"resolved": "Jackpot[]",
|
|
313
|
+
"references": {
|
|
314
|
+
"Jackpot": {
|
|
315
|
+
"location": "import",
|
|
316
|
+
"path": "../../models",
|
|
317
|
+
"id": "../../../../packages/stencil/casino-engagement-suite-bar/src/models/index.ts::Jackpot"
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"required": false,
|
|
322
|
+
"optional": false,
|
|
323
|
+
"docs": {
|
|
324
|
+
"tags": [],
|
|
325
|
+
"text": ""
|
|
326
|
+
},
|
|
327
|
+
"defaultValue": "[] as Array<Jackpot>"
|
|
328
|
+
},
|
|
329
|
+
"remainingFreeSpins": {
|
|
330
|
+
"type": "string",
|
|
331
|
+
"mutable": false,
|
|
332
|
+
"complexType": {
|
|
333
|
+
"original": "string",
|
|
334
|
+
"resolved": "string",
|
|
335
|
+
"references": {}
|
|
336
|
+
},
|
|
337
|
+
"required": false,
|
|
338
|
+
"optional": false,
|
|
339
|
+
"docs": {
|
|
340
|
+
"tags": [],
|
|
341
|
+
"text": ""
|
|
342
|
+
},
|
|
343
|
+
"attribute": "remaining-free-spins",
|
|
344
|
+
"reflect": false
|
|
345
|
+
},
|
|
346
|
+
"leaderboards": {
|
|
347
|
+
"type": "unknown",
|
|
348
|
+
"mutable": false,
|
|
349
|
+
"complexType": {
|
|
350
|
+
"original": "Array<Tournament>",
|
|
351
|
+
"resolved": "Tournament[]",
|
|
352
|
+
"references": {
|
|
353
|
+
"Array": {
|
|
354
|
+
"location": "global",
|
|
355
|
+
"id": "global::Array"
|
|
356
|
+
},
|
|
357
|
+
"Tournament": {
|
|
358
|
+
"location": "import",
|
|
359
|
+
"path": "../../models",
|
|
360
|
+
"id": "../../../../packages/stencil/casino-engagement-suite-bar/src/models/index.ts::Tournament"
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
"required": false,
|
|
365
|
+
"optional": false,
|
|
366
|
+
"docs": {
|
|
367
|
+
"tags": [],
|
|
368
|
+
"text": ""
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
static get states() {
|
|
374
|
+
return {
|
|
375
|
+
"limitStylingAppends": {},
|
|
376
|
+
"activeJackpot": {}
|
|
377
|
+
};
|
|
410
378
|
}
|
|
411
|
-
}; }
|
|
412
|
-
static get states() { return {
|
|
413
|
-
"limitStylingAppends": {},
|
|
414
|
-
"activeJackpot": {}
|
|
415
|
-
}; }
|
|
416
379
|
}
|