@everymatrix/lottery-tipping-entrance 1.83.4 → 1.83.6
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/{draw-selection_17.cjs.entry.js → draw-selection_18.cjs.entry.js} +245 -73
- package/dist/cjs/index-440d090f.js +2 -2
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{lottery-tipping-entrance-e50e77ae.js → lottery-tipping-entrance-2f5e8ecd.js} +61 -9
- package/dist/cjs/lottery-tipping-entrance.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/draw-selection/draw-selection.css +3 -0
- package/dist/collection/components/draw-selection/draw-selection.js +23 -3
- package/dist/collection/components/lottery-tipping-entrance/lottery-tipping-entrance.js +85 -16
- package/dist/collection/utils/api.js +9 -0
- package/dist/collection/utils/locale.utils.js +1 -0
- package/dist/collection/utils/utils.js +12 -0
- package/dist/esm/{draw-selection_17.entry.js → draw-selection_18.entry.js} +247 -76
- package/dist/esm/index-a57b04e7.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{lottery-tipping-entrance-ded99035.js → lottery-tipping-entrance-76aac39c.js} +61 -9
- package/dist/esm/lottery-tipping-entrance.js +1 -1
- package/dist/lottery-tipping-entrance/draw-selection_18.entry.js +1 -0
- package/dist/lottery-tipping-entrance/index.esm.js +1 -1
- package/dist/lottery-tipping-entrance/{lottery-tipping-entrance-ded99035.js → lottery-tipping-entrance-76aac39c.js} +34 -34
- package/dist/lottery-tipping-entrance/lottery-tipping-entrance.esm.js +1 -1
- package/dist/types/components/draw-selection/draw-selection.d.ts +1 -0
- package/dist/types/components/lottery-tipping-entrance/lottery-tipping-entrance.d.ts +8 -2
- package/dist/types/components.d.ts +5 -0
- package/dist/types/models/index.d.ts +16 -0
- package/dist/types/utils/api.d.ts +6 -1
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +1 -1
- package/dist/lottery-tipping-entrance/draw-selection_17.entry.js +0 -1
|
@@ -3,8 +3,9 @@ import "../../../../../lottery-tipping-page/dist/types/index";
|
|
|
3
3
|
import { h } from "@stencil/core";
|
|
4
4
|
import "../../../../../../../libs/vaadin-facade/index";
|
|
5
5
|
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
6
|
-
import { fetchGameInfo } from "../../utils/api";
|
|
6
|
+
import { fetchGameInfo, fetchSaleStatistics } from "../../utils/api";
|
|
7
7
|
import { getTranslations, translate } from "../../utils/locale.utils";
|
|
8
|
+
import { thousandSeparator } from "../../utils/utils";
|
|
8
9
|
export class LotteryTippingEntrance {
|
|
9
10
|
constructor() {
|
|
10
11
|
this.mbSource = undefined;
|
|
@@ -13,6 +14,7 @@ export class LotteryTippingEntrance {
|
|
|
13
14
|
this.translationUrl = '';
|
|
14
15
|
this.language = 'en';
|
|
15
16
|
this.endpoint = undefined;
|
|
17
|
+
this.endpointLotteryBe = undefined;
|
|
16
18
|
this.endpointTicket = undefined;
|
|
17
19
|
this.gameId = undefined;
|
|
18
20
|
this.playerId = undefined;
|
|
@@ -25,6 +27,8 @@ export class LotteryTippingEntrance {
|
|
|
25
27
|
this.isLoading = false;
|
|
26
28
|
this.selectedTabIndex = 0;
|
|
27
29
|
this.showSelectDrawPage = true;
|
|
30
|
+
this.gameInfo = {};
|
|
31
|
+
this.saleStatisticsInfo = {};
|
|
28
32
|
}
|
|
29
33
|
handleClientStylingChange(newValue, oldValue) {
|
|
30
34
|
if (newValue != oldValue) {
|
|
@@ -41,6 +45,9 @@ export class LotteryTippingEntrance {
|
|
|
41
45
|
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
42
46
|
}
|
|
43
47
|
}
|
|
48
|
+
async onPropsChange() {
|
|
49
|
+
this.getGameById();
|
|
50
|
+
}
|
|
44
51
|
componentWillLoad() {
|
|
45
52
|
this.getGameById();
|
|
46
53
|
if (this.translationUrl) {
|
|
@@ -58,14 +65,18 @@ export class LotteryTippingEntrance {
|
|
|
58
65
|
}
|
|
59
66
|
}
|
|
60
67
|
async getGameById() {
|
|
61
|
-
var _a, _b, _c, _d;
|
|
68
|
+
var _a, _b, _c, _d, _e, _f;
|
|
62
69
|
try {
|
|
70
|
+
if (!(this.endpoint && this.gameId))
|
|
71
|
+
return;
|
|
63
72
|
this.isLoading = true;
|
|
64
73
|
const gameInfo = await fetchGameInfo(this.endpoint, this.gameId);
|
|
65
|
-
this.
|
|
66
|
-
this.
|
|
67
|
-
this.
|
|
68
|
-
this.
|
|
74
|
+
this.gameInfo = gameInfo || {};
|
|
75
|
+
this.date = (_a = gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.currentDraw) === null || _a === void 0 ? void 0 : _a.date;
|
|
76
|
+
this.drawId = (_b = gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.currentDraw) === null || _b === void 0 ? void 0 : _b.id;
|
|
77
|
+
this.playTypes = (_d = (_c = gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.rules) === null || _c === void 0 ? void 0 : _c.poolGame) === null || _d === void 0 ? void 0 : _d.playTypes;
|
|
78
|
+
this.bettingTypes = (_f = (_e = gameInfo === null || gameInfo === void 0 ? void 0 : gameInfo.rules) === null || _e === void 0 ? void 0 : _e.poolGame) === null || _f === void 0 ? void 0 : _f.bettingTypes;
|
|
79
|
+
this.fetchSaleStatisticsHandler();
|
|
69
80
|
}
|
|
70
81
|
catch (e) {
|
|
71
82
|
console.log(e);
|
|
@@ -74,19 +85,37 @@ export class LotteryTippingEntrance {
|
|
|
74
85
|
this.isLoading = false;
|
|
75
86
|
}
|
|
76
87
|
}
|
|
88
|
+
get formattedTurnover() {
|
|
89
|
+
var _a, _b;
|
|
90
|
+
const turnover = (_b = (_a = this.saleStatisticsInfo) === null || _a === void 0 ? void 0 : _a.wagerSegment) === null || _b === void 0 ? void 0 : _b.totalSalesCrossDraw;
|
|
91
|
+
const unit = '€';
|
|
92
|
+
if (turnover === null || turnover === undefined)
|
|
93
|
+
return '';
|
|
94
|
+
return `${unit}${turnover ? thousandSeparator(turnover) : 0}`;
|
|
95
|
+
}
|
|
77
96
|
disconnectedCallback() {
|
|
78
97
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
79
98
|
}
|
|
80
99
|
handleSelectDraw() {
|
|
81
100
|
this.showSelectDrawPage = false;
|
|
82
101
|
}
|
|
83
|
-
|
|
102
|
+
async fetchSaleStatisticsHandler() {
|
|
103
|
+
var _a;
|
|
104
|
+
this.saleStatisticsInfo = await fetchSaleStatistics({
|
|
105
|
+
endpoint: this.endpointLotteryBe,
|
|
106
|
+
gameId: (_a = this.gameInfo) === null || _a === void 0 ? void 0 : _a.type,
|
|
107
|
+
drawId: this.drawId
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
async handleClosePoolGamePage() {
|
|
84
111
|
this.showSelectDrawPage = true;
|
|
112
|
+
// refresh data
|
|
113
|
+
this.fetchSaleStatisticsHandler();
|
|
85
114
|
}
|
|
86
115
|
render() {
|
|
87
|
-
return (h("div", { key: '
|
|
116
|
+
return (h("div", { key: '1e7f56ec3ac87c977967336379c32ebb5924d2b5', class: "lottery-tipping-entrance", ref: (el) => (this.stylingContainer = el) }, this.showSelectDrawPage && (h("div", { key: '8434458fc307e34b2e153ce2a812b1b551011a7c', class: "select-draw-page" }, h("div", { key: '7ecebea05d9f60c54ca25222834f634b795993c6', class: "lottery-tipping-entrance__header" }, h("div", { key: 'c9323636edee6538a2963c46a91419dad5215121', class: "header" }, h("div", { key: 'd3093cb65c291f30f1da29df53cfea9577099d8e', class: "header-logo" }, this.logoUrl && h("img", { key: '21ade9ed843e8368c603db5a69744d561fd632fd', class: "logo", src: this.logoUrl })), h("div", { key: '0019ff7a1e93d8ee59849e0568bd114bbb3ff6ee', class: "header-btns" }, h("div", { key: '8c81411cdec022e6e50ada845773facf820608de', class: "header-btns--left" }, h("slot", { key: '72ea0d0849652d8ff14f2215b78785a983752044', name: "backGameSelectionBtn" })), h("div", { key: '524477221d37fb83e423fa63fb22466c5687b5ee', class: "header-btns--right" }, h("slot", { key: '6fa12400b787246843fbf32d1bee85eef856e397', name: "themeBtn" }), h("slot", { key: '02e019644a014fcbda7c132047391566a6b5c338', name: "logoutBtn" })))), h("div", { key: '4c84195953e3c52d3a27d9b4ef09b02b734a2a59', class: "tabs-wrap" }, h("vaadin-tabs", { key: '5651126d167a51de1c10abf0ad24d2a942713948', theme: "equal-width-tabs", selected: this.selectedTabIndex, "on-selected-changed": (e) => {
|
|
88
117
|
this.selectedTabIndex = e.detail.value;
|
|
89
|
-
} }, h("vaadin-tab", { key: '
|
|
118
|
+
} }, h("vaadin-tab", { key: '4b55f75ea95afefa41f9dbb8c427759bad0fc6e4', value: "0" }, translate('draws', this.language)), h("vaadin-tab", { key: '9da0765e66af92e8b805952ead084cbabda309e6', value: "1" }, translate('latestResults', this.language)), h("vaadin-tab", { key: 'ee9d410e283f5c38644493a6ad5e471d4ce30c36', value: "2" }, translate('instruction', this.language))))), h("div", { key: 'ac7c848f56cf04a7864a0dcc4ac964ae62e249e2', class: "tabs-content" }, this.selectedTabIndex === 0 && (h("draw-selection", { key: '7175c2b8a31ae442f2751c3510a4239ac7f7ac74', date: this.date, turnover: this.formattedTurnover, "is-loading": this.isLoading, language: this.language, "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl, "mb-source": this.mbSource, "translation-url": this.translationUrl })), this.selectedTabIndex === 1 && (h("lottery-tipping-latest-result", { key: '64591b31563dee4eee5c93595e8e7a440cbc12b7', endpoint: this.endpoint, "endpoint-ticket": this.endpointTicket, "game-id": this.gameId, "player-id": this.playerId, "session-id": this.sessionId, language: this.language, "translation-url": this.translationUrl })), this.selectedTabIndex === 2 && (h("div", { key: '824cf05dc9bc88920ef9a7f537228e96580c8644', class: "instruction-content-wrapper" }, translate('instructionContent', this.language)))))), !this.showSelectDrawPage && (h("lottery-tipping-page", { key: '4225d04badd4e2a4121352f0f65437f8a29bde75', endpoint: this.endpoint, "endpoint-ticket": this.endpointTicket, "endpoint-lottery-be": this.endpointLotteryBe, "game-id": this.gameId, "player-id": this.playerId, "session-id": this.sessionId, "draw-id": this.drawId, playTypes: this.playTypes, bettingTypes: this.bettingTypes, "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl, "mb-source": this.mbSource, "translation-url": this.translationUrl, language: this.language, "logo-url": this.logoUrl }, h("slot", { key: '45108757d6855dc3e62b1e437c012570a179ca61', name: "backBtn", slot: "backBtn" }), h("slot", { key: 'a11825879c69265fa35e593c8faf3eab81c0ccbc', name: "themeBtn", slot: "themeBtn" }), h("slot", { key: '907e6b5bac44f30ff57f9b27b641d44ac0a4701e', name: "logoutBtn", slot: "logoutBtn" })))));
|
|
90
119
|
}
|
|
91
120
|
static get is() { return "lottery-tipping-entrance"; }
|
|
92
121
|
static get encapsulation() { return "shadow"; }
|
|
@@ -207,6 +236,23 @@ export class LotteryTippingEntrance {
|
|
|
207
236
|
"attribute": "endpoint",
|
|
208
237
|
"reflect": true
|
|
209
238
|
},
|
|
239
|
+
"endpointLotteryBe": {
|
|
240
|
+
"type": "string",
|
|
241
|
+
"mutable": false,
|
|
242
|
+
"complexType": {
|
|
243
|
+
"original": "string",
|
|
244
|
+
"resolved": "string",
|
|
245
|
+
"references": {}
|
|
246
|
+
},
|
|
247
|
+
"required": false,
|
|
248
|
+
"optional": false,
|
|
249
|
+
"docs": {
|
|
250
|
+
"tags": [],
|
|
251
|
+
"text": ""
|
|
252
|
+
},
|
|
253
|
+
"attribute": "endpoint-lottery-be",
|
|
254
|
+
"reflect": true
|
|
255
|
+
},
|
|
210
256
|
"endpointTicket": {
|
|
211
257
|
"type": "string",
|
|
212
258
|
"mutable": false,
|
|
@@ -302,7 +348,30 @@ export class LotteryTippingEntrance {
|
|
|
302
348
|
"bettingTypes": {},
|
|
303
349
|
"isLoading": {},
|
|
304
350
|
"selectedTabIndex": {},
|
|
305
|
-
"showSelectDrawPage": {}
|
|
351
|
+
"showSelectDrawPage": {},
|
|
352
|
+
"gameInfo": {},
|
|
353
|
+
"saleStatisticsInfo": {}
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
static get methods() {
|
|
357
|
+
return {
|
|
358
|
+
"handleClosePoolGamePage": {
|
|
359
|
+
"complexType": {
|
|
360
|
+
"signature": "() => Promise<void>",
|
|
361
|
+
"parameters": [],
|
|
362
|
+
"references": {
|
|
363
|
+
"Promise": {
|
|
364
|
+
"location": "global",
|
|
365
|
+
"id": "global::Promise"
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
"return": "Promise<void>"
|
|
369
|
+
},
|
|
370
|
+
"docs": {
|
|
371
|
+
"text": "",
|
|
372
|
+
"tags": []
|
|
373
|
+
}
|
|
374
|
+
}
|
|
306
375
|
};
|
|
307
376
|
}
|
|
308
377
|
static get watchers() {
|
|
@@ -315,6 +384,12 @@ export class LotteryTippingEntrance {
|
|
|
315
384
|
}, {
|
|
316
385
|
"propName": "mbSource",
|
|
317
386
|
"methodName": "handleMbSourceChange"
|
|
387
|
+
}, {
|
|
388
|
+
"propName": "endpoint",
|
|
389
|
+
"methodName": "onPropsChange"
|
|
390
|
+
}, {
|
|
391
|
+
"propName": "gameId",
|
|
392
|
+
"methodName": "onPropsChange"
|
|
318
393
|
}];
|
|
319
394
|
}
|
|
320
395
|
static get listeners() {
|
|
@@ -324,12 +399,6 @@ export class LotteryTippingEntrance {
|
|
|
324
399
|
"target": undefined,
|
|
325
400
|
"capture": false,
|
|
326
401
|
"passive": false
|
|
327
|
-
}, {
|
|
328
|
-
"name": "closePoolGamePage",
|
|
329
|
-
"method": "handleClosePoolGamePage",
|
|
330
|
-
"target": undefined,
|
|
331
|
-
"capture": false,
|
|
332
|
-
"passive": false
|
|
333
402
|
}];
|
|
334
403
|
}
|
|
335
404
|
}
|
|
@@ -9,3 +9,12 @@ export async function fetchGameInfo(endpoint, gameId) {
|
|
|
9
9
|
throw new Error('The game is currently not available. Please try again later.');
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
export async function fetchSaleStatistics({ endpoint, gameId, drawId }) {
|
|
13
|
+
try {
|
|
14
|
+
const res = await fetchRequest(`${endpoint}/api/v1/lottery/core/widget/games/${gameId}/draws/${drawId}/saleStatistics`);
|
|
15
|
+
return res;
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
return Promise.reject(error);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -8,6 +8,7 @@ const TRANSLATIONS = {
|
|
|
8
8
|
instruction: 'INSTRUCTION',
|
|
9
9
|
howToWin: 'HOW TO WIN',
|
|
10
10
|
selectDraws: 'Select Draws from the following bars:',
|
|
11
|
+
turnover: 'Turnover: ',
|
|
11
12
|
gameNotAvailable: 'Sorry. The Game is not available now.',
|
|
12
13
|
instructionContent: 'Instruction content goes here.'
|
|
13
14
|
},
|
|
@@ -90,3 +90,15 @@ export function getDayWithSuffixLocal(isoString) {
|
|
|
90
90
|
const month = _format(date, 'LLLL');
|
|
91
91
|
return `${day}${suffix} ${month}`;
|
|
92
92
|
}
|
|
93
|
+
export function thousandSeparator(value) {
|
|
94
|
+
if (value === 0) {
|
|
95
|
+
return '0';
|
|
96
|
+
}
|
|
97
|
+
if (!value) {
|
|
98
|
+
return '';
|
|
99
|
+
}
|
|
100
|
+
value = value.toString();
|
|
101
|
+
const parts = value.split('.');
|
|
102
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
103
|
+
return parts.join('.');
|
|
104
|
+
}
|