@everymatrix/lottery-tipping-ticket-controller 1.94.4 → 1.94.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/{general-tooltip_7.cjs.entry.js → general-tooltip_8.cjs.entry.js} +185 -322
- package/dist/cjs/index-b8586f2f.js +2 -2
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{lottery-tipping-ticket-controller-2ef33643.js → lottery-tipping-ticket-controller-3b1e9667.js} +9075 -8987
- package/dist/cjs/lottery-tipping-ticket-controller.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +6 -0
- package/dist/collection/components/lottery-tipping-ticket-controller/lottery-tipping-ticket-controller.css +8 -0
- package/dist/collection/components/lottery-tipping-ticket-controller/lottery-tipping-ticket-controller.js +48 -7
- package/dist/collection/utils/locale.utils.js +1 -0
- package/dist/esm/{general-tooltip_7.entry.js → general-tooltip_8.entry.js} +186 -324
- package/dist/esm/index-84443a76.js +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{lottery-tipping-ticket-controller-d4128bfe.js → lottery-tipping-ticket-controller-2d4fe12d.js} +9075 -8986
- package/dist/esm/lottery-tipping-ticket-controller.js +1 -1
- package/dist/lottery-tipping-ticket-controller/general-tooltip_8.entry.js +1 -0
- package/dist/lottery-tipping-ticket-controller/index.esm.js +1 -1
- package/dist/lottery-tipping-ticket-controller/{lottery-tipping-ticket-controller-d4128bfe.js → lottery-tipping-ticket-controller-2d4fe12d.js} +241 -241
- package/dist/lottery-tipping-ticket-controller/lottery-tipping-ticket-controller.esm.js +1 -1
- package/dist/types/components/lottery-tipping-ticket-controller/lottery-tipping-ticket-controller.d.ts +3 -1
- package/package.json +1 -1
- package/dist/lottery-tipping-ticket-controller/general-tooltip_7.entry.js +0 -1
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["general-
|
|
22
|
+
return index.bootstrapLazy([["general-tooltip_8.cjs",[[1,"lottery-tipping-ticket-controller",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"sessionId":[513,"session-id"],"gameId":[513,"game-id"],"playerId":[513,"player-id"],"drawId":[513,"draw-id"],"isLoading":[32],"bettingTypeOptions":[32],"playingModeOptions":[32],"selectedBettingType":[32],"selectedPlayingMode":[32],"hasSelectBullet":[32],"hasSelectAllBullet":[32],"totalLineCombination":[32],"submitLoading":[32],"isSalesActive":[32],"drawSubmitAvailable":[32],"rawData":[32],"saleStatisticsInfo":[32],"currentStake":[32],"dialogConfig":[32],"gameUnavailable":[32]},[[0,"lotteryTippingBulletBetSelect","lotteryTippingBulletGroupSelectionHandler"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"lottery-tipping-ticket-bet",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"sessionId":[513,"session-id"],"endpoint":[513],"gameId":[513,"game-id"],"drawId":[513,"draw-id"],"totalPages":[1538,"total-pages"],"minTotalPages":[514,"min-total-pages"],"maxTotalPages":[514,"max-total-pages"],"mode":[513],"readPretty":[516,"read-pretty"],"defaultBulletConfigLineGroup":[513,"default-bullet-config-line-group"],"translationData":[32],"clientStylingUrlContent":[32],"bulletConfigLineGroup":[32],"currentPage":[32],"isLoading":[32],"hasErrors":[32],"dialogConfig":[32],"ticketDataSource":[32],"resetBulletConfig":[64],"getData":[64]},[[0,"lotteryTippingBulletGroupToggle","lotteryTippingBulletGroupSelectionHandler"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"gameId":["fetchMatchData"],"sessionId":["fetchMatchData"],"drawId":["fetchMatchData"],"defaultBulletConfigLineGroup":["fetchMatchData"],"currentPage":["handleCurrentPageChange"]}],[1,"lottery-banner",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"logoUrl":[513,"logo-url"],"stopTime":[1,"stop-time"],"startTime":[1,"start-time"],"bannerTitle":[1,"banner-title"],"turnover":[1],"layout":[1],"isWagerStarted":[32],"formattedStopTime":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"startTime":["handleTimeChange"],"stopTime":["handleTimeChange"]}],[1,"lottery-button",{"variant":[513],"size":[513],"color":[513],"disabled":[516],"loading":[516],"text":[513],"mbSource":[513,"mb-source"],"language":[513],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"ripples":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"lottery-tipping-bullet-group",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"positionIdx":[513,"position-idx"],"theme":[513],"mode":[513],"bulletConfigContent":[513,"bullet-config-content"]},[[0,"lotteryTippingBulletToggle","lotteryTippingBulletSelectionHandler"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"general-tooltip",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"position":[1],"delay":[2],"isVisible":[32],"_tooltipId":[32]},[[1,"mouseenter","handleMouseEnterOrFocus"],[0,"focusin","handleMouseEnterOrFocus"],[1,"mouseleave","handleMouseLeaveOrBlur"],[0,"focusout","handleMouseLeaveOrBlur"],[0,"keydown","handleKeyDown"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"helper-count-down",{"value":[520],"format":[513],"prefix":[513],"suffix":[513],"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"endTime":[32],"timeObj":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"value":["handleValueChange"]}],[1,"lottery-tipping-bullet",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"positionIdx":[514,"position-idx"],"theme":[513],"value":[513],"disabled":[516],"isSelected":[516,"is-selected"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -223,4 +223,12 @@
|
|
|
223
223
|
50% {
|
|
224
224
|
transform: scale(1.2);
|
|
225
225
|
}
|
|
226
|
+
}
|
|
227
|
+
.noActiveDraw {
|
|
228
|
+
margin: 30% auto 0px;
|
|
229
|
+
padding: 24px;
|
|
230
|
+
border: 2px solid var(--emw--color-primary, #fed275);
|
|
231
|
+
border-radius: 4px;
|
|
232
|
+
width: 280px;
|
|
233
|
+
color: var(--emw--color-typography, #000);
|
|
226
234
|
}
|
|
@@ -2,6 +2,7 @@ import "../../../../../lottery-banner/dist/types/index";
|
|
|
2
2
|
import "../../../../../lottery-button/dist/types/index";
|
|
3
3
|
import "../../../../../lottery-tipping-ticket-bet/dist/types/index";
|
|
4
4
|
import { h } from "@stencil/core";
|
|
5
|
+
import { isAfter, isBefore, parseISO } from "date-fns";
|
|
5
6
|
import "../../../../../../../libs/vaadin-facade/index";
|
|
6
7
|
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
7
8
|
import { BettingTypeEnum, PlayModeEnum } from "../../models";
|
|
@@ -33,12 +34,14 @@ export class LotteryTippingTicketController {
|
|
|
33
34
|
this.hasSelectBullet = undefined;
|
|
34
35
|
this.hasSelectAllBullet = undefined;
|
|
35
36
|
this.totalLineCombination = 0;
|
|
36
|
-
this.submitLoading =
|
|
37
|
+
this.submitLoading = false;
|
|
38
|
+
this.isSalesActive = false;
|
|
37
39
|
this.drawSubmitAvailable = false;
|
|
38
40
|
this.rawData = {};
|
|
39
41
|
this.saleStatisticsInfo = {};
|
|
40
42
|
this.currentStake = undefined;
|
|
41
43
|
this.dialogConfig = { visible: false };
|
|
44
|
+
this.gameUnavailable = false;
|
|
42
45
|
}
|
|
43
46
|
async getLotteryTippingBulletResults() {
|
|
44
47
|
return await this.childRef.getData();
|
|
@@ -205,9 +208,6 @@ export class LotteryTippingTicketController {
|
|
|
205
208
|
setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`, this.stylingSubscription);
|
|
206
209
|
}
|
|
207
210
|
}
|
|
208
|
-
handleTimerStop() {
|
|
209
|
-
this.drawSubmitAvailable = true;
|
|
210
|
-
}
|
|
211
211
|
componentWillLoad() {
|
|
212
212
|
if (this.translationUrl) {
|
|
213
213
|
resolveTranslationUrl(this.translationUrl);
|
|
@@ -226,6 +226,33 @@ export class LotteryTippingTicketController {
|
|
|
226
226
|
disconnectedCallback() {
|
|
227
227
|
this.stylingSubscription && this.stylingSubscription.unsubscribe();
|
|
228
228
|
}
|
|
229
|
+
updateDrawSalesStatus() {
|
|
230
|
+
var _a;
|
|
231
|
+
const currentDraw = (_a = this.rawData) === null || _a === void 0 ? void 0 : _a.currentDraw;
|
|
232
|
+
if (!currentDraw) {
|
|
233
|
+
this.gameUnavailable = true;
|
|
234
|
+
this.isSalesActive = false;
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
const now = new Date();
|
|
238
|
+
const wagerStartTime = currentDraw.wagerStartTime ? parseISO(currentDraw.wagerStartTime) : null;
|
|
239
|
+
const wagerCloseTime = currentDraw.wagerCloseTime ? parseISO(currentDraw.wagerCloseTime) : null;
|
|
240
|
+
// Rule 1: If the current time < the opening - sale time → display "Start in" countDown and disable the button.
|
|
241
|
+
if (wagerStartTime && isBefore(now, wagerStartTime)) {
|
|
242
|
+
this.isSalesActive = false;
|
|
243
|
+
this.gameUnavailable = false;
|
|
244
|
+
}
|
|
245
|
+
// Rule 2: If the opening-sale time < the current time < the closing time → display "Stop at xx time" to remind the player.
|
|
246
|
+
else if (wagerStartTime && wagerCloseTime && isAfter(now, wagerStartTime) && isBefore(now, wagerCloseTime)) {
|
|
247
|
+
this.isSalesActive = true;
|
|
248
|
+
this.gameUnavailable = false;
|
|
249
|
+
}
|
|
250
|
+
// Rule 3: If the current time > the closing time → the game is unavailable.
|
|
251
|
+
else {
|
|
252
|
+
this.gameUnavailable = true;
|
|
253
|
+
this.isSalesActive = false;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
229
256
|
connectedCallback() {
|
|
230
257
|
const fetchData = () => {
|
|
231
258
|
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
@@ -246,6 +273,7 @@ export class LotteryTippingTicketController {
|
|
|
246
273
|
});
|
|
247
274
|
this.handleBettingTypeChange(bettingType);
|
|
248
275
|
this.selectedPlayingMode = playMode;
|
|
276
|
+
this.updateDrawSalesStatus();
|
|
249
277
|
return this.updateSaleStatistics();
|
|
250
278
|
})
|
|
251
279
|
.catch((err) => {
|
|
@@ -268,6 +296,14 @@ export class LotteryTippingTicketController {
|
|
|
268
296
|
});
|
|
269
297
|
}
|
|
270
298
|
async handleSubmit() {
|
|
299
|
+
this.updateDrawSalesStatus();
|
|
300
|
+
if (!this.isSalesActive) {
|
|
301
|
+
showNotification({
|
|
302
|
+
message: 'Sales for this period have closed.',
|
|
303
|
+
theme: 'error'
|
|
304
|
+
});
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
271
307
|
const rawResults = await this.getLotteryTippingBulletResults();
|
|
272
308
|
const { betTypeId, betType } = getPlayTypeConfig({
|
|
273
309
|
rawData: this.rawData,
|
|
@@ -333,11 +369,14 @@ export class LotteryTippingTicketController {
|
|
|
333
369
|
return (h("div", { class: "LotteryTippingTicketController__main--right order-summary" }, h("h3", { class: "order-summary__title" }, translate('orderSummaryTitle', this.language)), h("div", { class: "order-summary__ticket-info" }, h("div", { class: "order-summary__ticket" }, translate('orderSummaryTickets', this.language), ":"), h("div", { class: "order-summary__details" }, h("span", { class: "order-summary__line-count" }, this.lineCountRender), h("div", null, this.currentStake && h("span", { class: "order-summary__multiplier" }, "x"), h("span", { class: "order-summary__stake" }, this.currentStakeFormatted)), this.isBothBettingType && (h("div", null, h("span", { class: "order-summary__multiplier" }, "x"), h("span", { class: "order-summary__stake" }, this.bothBettingTypeMultiplier))))), h("hr", { class: "order-summary__divider" }), h("div", { class: "order-summary__ticket-info" }, h("div", { class: "order-summary__ticket" }, translate('orderSummaryTotal', this.language), ":"), h("span", { class: "order-summary__details" }, this.totalAmountFormatted)), h("div", { class: "order-summary__button-wrapper" }, h("lottery-button", { onClick: this.handleSubmit.bind(this), loading: this.submitLoading, disabled: !this.hasSelectAllBullet ||
|
|
334
370
|
this.submitLoading ||
|
|
335
371
|
((_a = this.currentStake) === null || _a === void 0 ? void 0 : _a.value) === undefined ||
|
|
336
|
-
!this.
|
|
372
|
+
!this.isSalesActive, text: translate('orderSummarySubmit', this.language) }))));
|
|
337
373
|
}
|
|
338
374
|
render() {
|
|
339
375
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
340
|
-
|
|
376
|
+
if (this.gameUnavailable) {
|
|
377
|
+
return (h("div", { class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, h("div", { class: "noActiveDraw" }, translate('gameNotAvailable', this.language))));
|
|
378
|
+
}
|
|
379
|
+
return (h("div", { class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, h("lottery-banner", { "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl, stopTime: (_b = (_a = this.rawData) === null || _a === void 0 ? void 0 : _a.currentDraw) === null || _b === void 0 ? void 0 : _b.wagerCloseTime, startTime: (_d = (_c = this.rawData) === null || _c === void 0 ? void 0 : _c.currentDraw) === null || _d === void 0 ? void 0 : _d.wagerStartTime, "banner-title": formattedWeekName((_f = (_e = this.rawData) === null || _e === void 0 ? void 0 : _e.currentDraw) === null || _f === void 0 ? void 0 : _f.date), turnover: formattedTurnover((_h = (_g = this.saleStatisticsInfo) === null || _g === void 0 ? void 0 : _g.wagerSegment) === null || _h === void 0 ? void 0 : _h.totalSalesCrossDraw), language: this.language, onLotteryBannerWagerStarted: () => this.updateDrawSalesStatus(), "translation-url": this.translationUrl }), this.renderBettingControls(), h("div", { class: "flex flex-wrap LotteryTippingTicketController__main" }, h("div", { class: "LotteryTippingTicketController__main--left" }, h("lottery-tipping-ticket-bet", { ref: (el) => (this.childRef = el), endpoint: this.endpoint, "session-id": this.sessionId, "game-id": (_j = this.rawData) === null || _j === void 0 ? void 0 : _j.type, "draw-id": this.drawId, language: this.language, "translation-url": this.translationUrl, "max-total-pages": this.lineNumberRange.maxLineNumber, "min-total-pages": this.lineNumberRange.minLineNumber, "total-pages": this.lineNumberRange.defaultBoards, mode: this.selectedPlayingMode === PlayModeEnum.SingleBet ? 'single' : 'multi', "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl })), this.renderOrderSummary()), this.dialogConfig.visible && (h("vaadin-confirm-dialog", { rejectButtonVisible: true, rejectText: translate('cancel', this.language), confirmText: translate('confirm', this.language), opened: (_k = this.dialogConfig) === null || _k === void 0 ? void 0 : _k.visible, onConfirm: this.dialogConfig.onConfirm, onReject: this.dialogConfig.onCancel }, (_l = this.dialogConfig) === null || _l === void 0 ? void 0 : _l.content))));
|
|
341
380
|
}
|
|
342
381
|
static get is() { return "lottery-tipping-ticket-controller"; }
|
|
343
382
|
static get encapsulation() { return "shadow"; }
|
|
@@ -541,11 +580,13 @@ export class LotteryTippingTicketController {
|
|
|
541
580
|
"hasSelectAllBullet": {},
|
|
542
581
|
"totalLineCombination": {},
|
|
543
582
|
"submitLoading": {},
|
|
583
|
+
"isSalesActive": {},
|
|
544
584
|
"drawSubmitAvailable": {},
|
|
545
585
|
"rawData": {},
|
|
546
586
|
"saleStatisticsInfo": {},
|
|
547
587
|
"currentStake": {},
|
|
548
|
-
"dialogConfig": {}
|
|
588
|
+
"dialogConfig": {},
|
|
589
|
+
"gameUnavailable": {}
|
|
549
590
|
};
|
|
550
591
|
}
|
|
551
592
|
static get events() {
|