@everymatrix/casino-challenges-container 0.0.14 → 0.0.16
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-challenges-container/casino-challenge-card_5.entry.js +1 -0
- package/dist/casino-challenges-container/casino-challenges-container-677ffb33.js +1 -0
- package/dist/casino-challenges-container/casino-challenges-container.esm.js +1 -1
- package/dist/casino-challenges-container/index-7720ad93.js +2 -0
- package/dist/casino-challenges-container/index.esm.js +1 -1
- package/dist/cjs/casino-challenge-card_5.cjs.entry.js +3108 -0
- package/dist/cjs/{casino-challenges-container-13757ed0.js → casino-challenges-container-50aca824.js} +32 -8
- package/dist/cjs/casino-challenges-container.cjs.js +2 -2
- package/dist/cjs/{index-2d1d2666.js → index-d5f8d1ee.js} +32 -5
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/casino-challenges-container/casino-challenges-container.js +17 -3
- package/dist/collection/utils/locale.utils.js +16 -4
- package/dist/collection/utils/types.js +7 -0
- package/dist/esm/casino-challenge-card_5.entry.js +3101 -0
- package/dist/esm/{casino-challenges-container-e2d42fb0.js → casino-challenges-container-677ffb33.js} +32 -8
- package/dist/esm/casino-challenges-container.js +3 -3
- package/dist/esm/{index-7cb21c9d.js → index-7720ad93.js} +32 -5
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/types/components/casino-challenges-container/casino-challenges-container.d.ts +3 -1
- package/dist/types/utils/types.d.ts +28 -1
- package/package.json +1 -1
- package/dist/casino-challenges-container/casino-challenges-container-e2d42fb0.js +0 -1
- package/dist/casino-challenges-container/casino-challenges-container_3.entry.js +0 -1
- package/dist/casino-challenges-container/index-7cb21c9d.js +0 -2
- package/dist/cjs/casino-challenges-container_3.cjs.entry.js +0 -283
- package/dist/esm/casino-challenges-container_3.entry.js +0 -278
package/dist/cjs/{casino-challenges-container-13757ed0.js → casino-challenges-container-50aca824.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-d5f8d1ee.js');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @name setClientStyling
|
|
@@ -65,10 +65,22 @@ const TRANSLATIONS = {
|
|
|
65
65
|
title: 'Challenges',
|
|
66
66
|
empty: 'No Challenges'
|
|
67
67
|
},
|
|
68
|
-
ro: {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
ro: {
|
|
69
|
+
title: 'Provocări',
|
|
70
|
+
empty: 'Nicio provocare'
|
|
71
|
+
},
|
|
72
|
+
fr: {
|
|
73
|
+
title: 'Défis',
|
|
74
|
+
empty: 'Aucun défi'
|
|
75
|
+
},
|
|
76
|
+
ar: {
|
|
77
|
+
title: 'التحديات',
|
|
78
|
+
empty: 'لا توجد تحديات'
|
|
79
|
+
},
|
|
80
|
+
hr: {
|
|
81
|
+
title: 'Izazovi',
|
|
82
|
+
empty: 'Nema izazova'
|
|
83
|
+
}
|
|
72
84
|
};
|
|
73
85
|
const translate = (key, customLang) => {
|
|
74
86
|
const lang = customLang;
|
|
@@ -120,8 +132,13 @@ const CasinoChallengesContainer = class {
|
|
|
120
132
|
this.onLoadMore = () => {
|
|
121
133
|
this.pageNumber += 1;
|
|
122
134
|
this.getChallenges().then((res) => {
|
|
123
|
-
this.challenges = [...this.challenges, ...res.Data];
|
|
124
135
|
this.total = res.TotalCount;
|
|
136
|
+
if (this.activeTabIndex < 2) {
|
|
137
|
+
this.challenges = [...this.challenges, ...res.Data];
|
|
138
|
+
}
|
|
139
|
+
else if (this.activeTabIndex === 2) {
|
|
140
|
+
this.playerHistory = [...this.playerHistory, ...res.Data];
|
|
141
|
+
}
|
|
125
142
|
});
|
|
126
143
|
};
|
|
127
144
|
this.handleTabClick = (index) => () => {
|
|
@@ -144,6 +161,7 @@ const CasinoChallengesContainer = class {
|
|
|
144
161
|
this.error = '';
|
|
145
162
|
this.hasError = false;
|
|
146
163
|
this.challenges = [];
|
|
164
|
+
this.playerHistory = [];
|
|
147
165
|
this.loading = false;
|
|
148
166
|
this.pageNumber = 0;
|
|
149
167
|
this.total = 0;
|
|
@@ -186,6 +204,12 @@ const CasinoChallengesContainer = class {
|
|
|
186
204
|
if (res === null || res === void 0 ? void 0 : res.Success) {
|
|
187
205
|
this.pageNumber = res.PageNumber;
|
|
188
206
|
this.total = res.TotalCount;
|
|
207
|
+
if (this.activeTabIndex < 2) {
|
|
208
|
+
this.challenges = res.Data;
|
|
209
|
+
}
|
|
210
|
+
else if (this.activeTabIndex === 2) {
|
|
211
|
+
this.playerHistory = res.Data;
|
|
212
|
+
}
|
|
189
213
|
}
|
|
190
214
|
});
|
|
191
215
|
}
|
|
@@ -214,8 +238,8 @@ const CasinoChallengesContainer = class {
|
|
|
214
238
|
}, 10000);
|
|
215
239
|
}
|
|
216
240
|
render() {
|
|
217
|
-
var _a;
|
|
218
|
-
return (index.h("div", { key: '
|
|
241
|
+
var _a, _b;
|
|
242
|
+
return (index.h("div", { key: '4e2191039d59af380aab5d65f865727e04565ad9', ref: (el) => (this.stylingContainer = el) }, index.h("div", { key: '5731ae9a18c13c0ff728512442a24e824fcab485', class: "challenges" }, index.h("div", { key: '391210a6442f95d421a223854b55da4f953a1ec3', class: "challenges__header" }, index.h("h1", { key: '90d93318a2082f4b19e9c2cc3fa341afcb223eb8', class: "challenges__title" }, index.h("img", { key: '167c1ee8869310677e864d0f7107bfb7f9e938cd', src: titleIconSvg, alt: "icon" }), translate('title', this.language)), this.session && (index.h("div", { key: '1479821da7d79a1d2d53de22b67a0d2d17c43a68', class: "challenges__tabs" }, this.tabs.map((label, index$1) => (index.h("div", { class: `challenges__tab ${index$1 === this.activeTabIndex ? 'active' : ''}`, onClick: this.handleTabClick(index$1) }, label, this.showNotification === index$1 && index.h("img", { src: notificationSvg }))))))), this.activeTabIndex < 2 && (index.h("div", { key: 'a0f87282b31054fb2b5c18c6d521530c92540db6', class: "challenges__content" }, this.challenges.length === 0 && !this.loading && (index.h("div", { key: '313b9431d71fe5d93d41c00d64b718159b86bfd3', class: "empty" }, translate('empty', this.language))), index.h("casino-challenges-list", { key: '4756590a375cdd1cd70f538084d0194523fa8c41', challenges: this.challenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, loading: this.loading, hasMore: ((_a = this.challenges) === null || _a === void 0 ? void 0 : _a.length) < this.total, language: this.language, activeTabIndex: this.activeTabIndex }))), this.activeTabIndex === 2 && (index.h("casino-challenges-player-history", { key: 'd1f077837fafb45d5c257541e3a3db5f149b210e', translationUrl: this.translationUrl, language: this.language, loading: this.loading, playerHistory: this.playerHistory, onLoadMore: this.onLoadMore, hasMore: ((_b = this.playerHistory) === null || _b === void 0 ? void 0 : _b.length) < this.total })))));
|
|
219
243
|
}
|
|
220
244
|
static get watchers() { return {
|
|
221
245
|
"clientStyling": ["handleClientStylingChange"],
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-d5f8d1ee.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["casino-
|
|
22
|
+
return index.bootstrapLazy([["casino-challenge-card_5.cjs",[[1,"casino-challenges-container",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"userId":[513,"user-id"],"activeTabIndex":[32],"error":[32],"hasError":[32],"challenges":[32],"playerHistory":[32],"loading":[32],"pageNumber":[32],"total":[32],"pageSize":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenges-list",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"translationUrl":[513,"translation-url"],"challenges":[16],"loading":[516],"hasMore":[516,"has-more"],"activeTabIndex":[514,"active-tab-index"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenges-player-history",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"playerHistory":[16],"loading":[516],"hasMore":[516,"has-more"],"openItems":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"playerHistory":["handlePlayerHistoryChange"]}],[1,"casino-challenge-card",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"challenge":[16],"isUserAuthorized":[516,"is-user-authorized"],"activeTabIndex":[514,"active-tab-index"],"tooltipIndex":[32],"timeLeft":[32],"error":[32],"hasError":[32],"actionLoading":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'casino-challenges-container';
|
|
24
|
-
const BUILD = /* casino-challenges-container */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback:
|
|
24
|
+
const BUILD = /* casino-challenges-container */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
27
|
Stencil Client Platform v4.19.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -71,10 +71,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
71
71
|
}
|
|
72
72
|
switch(bundleId) {
|
|
73
73
|
|
|
74
|
-
case 'casino-
|
|
74
|
+
case 'casino-challenge-card_5.cjs':
|
|
75
75
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
76
76
|
/* webpackMode: "lazy" */
|
|
77
|
-
'./casino-
|
|
77
|
+
'./casino-challenge-card_5.cjs.entry.js')); }).then(processMod, consoleError);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
@@ -405,6 +405,27 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
405
405
|
const newClasses = parseClassList(newValue);
|
|
406
406
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
407
407
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
408
|
+
} else if (memberName === "style") {
|
|
409
|
+
{
|
|
410
|
+
for (const prop in oldValue) {
|
|
411
|
+
if (!newValue || newValue[prop] == null) {
|
|
412
|
+
if (prop.includes("-")) {
|
|
413
|
+
elm.style.removeProperty(prop);
|
|
414
|
+
} else {
|
|
415
|
+
elm.style[prop] = "";
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
for (const prop in newValue) {
|
|
421
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
422
|
+
if (prop.includes("-")) {
|
|
423
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
424
|
+
} else {
|
|
425
|
+
elm.style[prop] = newValue[prop];
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
408
429
|
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
409
430
|
if (newValue) {
|
|
410
431
|
newValue(elm);
|
|
@@ -1010,6 +1031,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1010
1031
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1011
1032
|
}
|
|
1012
1033
|
endNewInstance();
|
|
1034
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1013
1035
|
} else {
|
|
1014
1036
|
Cstr = elm.constructor;
|
|
1015
1037
|
const cmpTag = elm.localName;
|
|
@@ -1037,6 +1059,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1037
1059
|
}
|
|
1038
1060
|
};
|
|
1039
1061
|
var fireConnectedCallback = (instance) => {
|
|
1062
|
+
{
|
|
1063
|
+
safeCall(instance, "connectedCallback");
|
|
1064
|
+
}
|
|
1040
1065
|
};
|
|
1041
1066
|
|
|
1042
1067
|
// src/runtime/connected-callback.ts
|
|
@@ -1069,8 +1094,10 @@ var connectedCallback = (elm) => {
|
|
|
1069
1094
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1070
1095
|
}
|
|
1071
1096
|
} else {
|
|
1072
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$)
|
|
1073
|
-
hostRef.$
|
|
1097
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1098
|
+
fireConnectedCallback(hostRef.$lazyInstance$);
|
|
1099
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1100
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
|
|
1074
1101
|
}
|
|
1075
1102
|
}
|
|
1076
1103
|
endConnected();
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const casinoChallengesContainer = require('./casino-challenges-container-
|
|
6
|
-
require('./index-
|
|
5
|
+
const casinoChallengesContainer = require('./casino-challenges-container-50aca824.js');
|
|
6
|
+
require('./index-d5f8d1ee.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-d5f8d1ee.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|
|
9
9
|
if (typeof window === 'undefined') return undefined;
|
|
10
10
|
await appGlobals.globalScripts();
|
|
11
|
-
return index.bootstrapLazy([["casino-
|
|
11
|
+
return index.bootstrapLazy([["casino-challenge-card_5.cjs",[[1,"casino-challenges-container",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"userId":[513,"user-id"],"activeTabIndex":[32],"error":[32],"hasError":[32],"challenges":[32],"playerHistory":[32],"loading":[32],"pageNumber":[32],"total":[32],"pageSize":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenges-list",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"translationUrl":[513,"translation-url"],"challenges":[16],"loading":[516],"hasMore":[516,"has-more"],"activeTabIndex":[514,"active-tab-index"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"casino-challenges-player-history",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"playerHistory":[16],"loading":[516],"hasMore":[516,"has-more"],"openItems":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"playerHistory":["handlePlayerHistoryChange"]}],[1,"casino-challenge-card",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"endpoint":[513],"domain":[513],"session":[513],"challenge":[16],"isUserAuthorized":[516,"is-user-authorized"],"activeTabIndex":[514,"active-tab-index"],"tooltipIndex":[32],"timeLeft":[32],"error":[32],"hasError":[32],"actionLoading":[32]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[0,"ui-skeleton",{"structure":[1],"width":[1],"height":[1],"borderRadius":[8,"border-radius"],"marginBottom":[8,"margin-bottom"],"marginTop":[8,"margin-top"],"marginLeft":[8,"margin-left"],"marginRight":[8,"margin-right"],"animation":[4],"rows":[2],"size":[1]},null,{"structure":["handleStructureChange"]}]]]], options);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
exports.setNonce = index.setNonce;
|
|
@@ -8,12 +8,24 @@
|
|
|
8
8
|
"typescriptVersion": "5.4.5"
|
|
9
9
|
},
|
|
10
10
|
"collections": [
|
|
11
|
+
{
|
|
12
|
+
"name": "@everymatrix/casino-challenge-card",
|
|
13
|
+
"tags": [
|
|
14
|
+
"casino-challenge-card"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
11
17
|
{
|
|
12
18
|
"name": "@everymatrix/casino-challenges-list",
|
|
13
19
|
"tags": [
|
|
14
20
|
"casino-challenges-list"
|
|
15
21
|
]
|
|
16
22
|
},
|
|
23
|
+
{
|
|
24
|
+
"name": "@everymatrix/casino-challenges-player-history",
|
|
25
|
+
"tags": [
|
|
26
|
+
"casino-challenges-player-history"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
17
29
|
{
|
|
18
30
|
"name": "@everymatrix/ui-skeleton",
|
|
19
31
|
"tags": [
|
package/dist/collection/components/casino-challenges-container/casino-challenges-container.js
CHANGED
|
@@ -4,6 +4,7 @@ import { resolveTranslationUrl, translate } from "../../utils/locale.utils";
|
|
|
4
4
|
import titleIcon from "../../assets/title-icon.svg";
|
|
5
5
|
import notificationIcon from "../../assets/notification.svg";
|
|
6
6
|
import "../../../../../casino-challenges-list/dist/types/index";
|
|
7
|
+
import "../../../../../casino-challenges-player-history/dist/types/index";
|
|
7
8
|
export class CasinoChallengesContainer {
|
|
8
9
|
constructor() {
|
|
9
10
|
this.tabs = ['Active', 'Pending', 'Finished', 'Code'];
|
|
@@ -19,8 +20,13 @@ export class CasinoChallengesContainer {
|
|
|
19
20
|
this.onLoadMore = () => {
|
|
20
21
|
this.pageNumber += 1;
|
|
21
22
|
this.getChallenges().then((res) => {
|
|
22
|
-
this.challenges = [...this.challenges, ...res.Data];
|
|
23
23
|
this.total = res.TotalCount;
|
|
24
|
+
if (this.activeTabIndex < 2) {
|
|
25
|
+
this.challenges = [...this.challenges, ...res.Data];
|
|
26
|
+
}
|
|
27
|
+
else if (this.activeTabIndex === 2) {
|
|
28
|
+
this.playerHistory = [...this.playerHistory, ...res.Data];
|
|
29
|
+
}
|
|
24
30
|
});
|
|
25
31
|
};
|
|
26
32
|
this.handleTabClick = (index) => () => {
|
|
@@ -43,6 +49,7 @@ export class CasinoChallengesContainer {
|
|
|
43
49
|
this.error = '';
|
|
44
50
|
this.hasError = false;
|
|
45
51
|
this.challenges = [];
|
|
52
|
+
this.playerHistory = [];
|
|
46
53
|
this.loading = false;
|
|
47
54
|
this.pageNumber = 0;
|
|
48
55
|
this.total = 0;
|
|
@@ -85,6 +92,12 @@ export class CasinoChallengesContainer {
|
|
|
85
92
|
if (res === null || res === void 0 ? void 0 : res.Success) {
|
|
86
93
|
this.pageNumber = res.PageNumber;
|
|
87
94
|
this.total = res.TotalCount;
|
|
95
|
+
if (this.activeTabIndex < 2) {
|
|
96
|
+
this.challenges = res.Data;
|
|
97
|
+
}
|
|
98
|
+
else if (this.activeTabIndex === 2) {
|
|
99
|
+
this.playerHistory = res.Data;
|
|
100
|
+
}
|
|
88
101
|
}
|
|
89
102
|
});
|
|
90
103
|
}
|
|
@@ -113,8 +126,8 @@ export class CasinoChallengesContainer {
|
|
|
113
126
|
}, 10000);
|
|
114
127
|
}
|
|
115
128
|
render() {
|
|
116
|
-
var _a;
|
|
117
|
-
return (h("div", { key: '
|
|
129
|
+
var _a, _b;
|
|
130
|
+
return (h("div", { key: '4e2191039d59af380aab5d65f865727e04565ad9', ref: (el) => (this.stylingContainer = el) }, h("div", { key: '5731ae9a18c13c0ff728512442a24e824fcab485', class: "challenges" }, h("div", { key: '391210a6442f95d421a223854b55da4f953a1ec3', class: "challenges__header" }, h("h1", { key: '90d93318a2082f4b19e9c2cc3fa341afcb223eb8', class: "challenges__title" }, h("img", { key: '167c1ee8869310677e864d0f7107bfb7f9e938cd', src: titleIcon, alt: "icon" }), translate('title', this.language)), this.session && (h("div", { key: '1479821da7d79a1d2d53de22b67a0d2d17c43a68', class: "challenges__tabs" }, this.tabs.map((label, index) => (h("div", { class: `challenges__tab ${index === this.activeTabIndex ? 'active' : ''}`, onClick: this.handleTabClick(index) }, label, this.showNotification === index && h("img", { src: notificationIcon }))))))), this.activeTabIndex < 2 && (h("div", { key: 'a0f87282b31054fb2b5c18c6d521530c92540db6', class: "challenges__content" }, this.challenges.length === 0 && !this.loading && (h("div", { key: '313b9431d71fe5d93d41c00d64b718159b86bfd3', class: "empty" }, translate('empty', this.language))), h("casino-challenges-list", { key: '4756590a375cdd1cd70f538084d0194523fa8c41', challenges: this.challenges, onLoadMore: this.onLoadMore, onTimerExpired: this.onTimerExpired, loading: this.loading, hasMore: ((_a = this.challenges) === null || _a === void 0 ? void 0 : _a.length) < this.total, language: this.language, activeTabIndex: this.activeTabIndex }))), this.activeTabIndex === 2 && (h("casino-challenges-player-history", { key: 'd1f077837fafb45d5c257541e3a3db5f149b210e', translationUrl: this.translationUrl, language: this.language, loading: this.loading, playerHistory: this.playerHistory, onLoadMore: this.onLoadMore, hasMore: ((_b = this.playerHistory) === null || _b === void 0 ? void 0 : _b.length) < this.total })))));
|
|
118
131
|
}
|
|
119
132
|
static get is() { return "casino-challenges-container"; }
|
|
120
133
|
static get encapsulation() { return "shadow"; }
|
|
@@ -297,6 +310,7 @@ export class CasinoChallengesContainer {
|
|
|
297
310
|
"error": {},
|
|
298
311
|
"hasError": {},
|
|
299
312
|
"challenges": {},
|
|
313
|
+
"playerHistory": {},
|
|
300
314
|
"loading": {},
|
|
301
315
|
"pageNumber": {},
|
|
302
316
|
"total": {},
|
|
@@ -4,10 +4,22 @@ const TRANSLATIONS = {
|
|
|
4
4
|
title: 'Challenges',
|
|
5
5
|
empty: 'No Challenges'
|
|
6
6
|
},
|
|
7
|
-
ro: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
ro: {
|
|
8
|
+
title: 'Provocări',
|
|
9
|
+
empty: 'Nicio provocare'
|
|
10
|
+
},
|
|
11
|
+
fr: {
|
|
12
|
+
title: 'Défis',
|
|
13
|
+
empty: 'Aucun défi'
|
|
14
|
+
},
|
|
15
|
+
ar: {
|
|
16
|
+
title: 'التحديات',
|
|
17
|
+
empty: 'لا توجد تحديات'
|
|
18
|
+
},
|
|
19
|
+
hr: {
|
|
20
|
+
title: 'Izazovi',
|
|
21
|
+
empty: 'Nema izazova'
|
|
22
|
+
}
|
|
11
23
|
};
|
|
12
24
|
export const translate = (key, customLang) => {
|
|
13
25
|
const lang = customLang;
|
|
@@ -38,3 +38,10 @@ export var EChallengeValidityType;
|
|
|
38
38
|
EChallengeValidityType[EChallengeValidityType["Period"] = 0] = "Period";
|
|
39
39
|
EChallengeValidityType[EChallengeValidityType["Date"] = 1] = "Date";
|
|
40
40
|
})(EChallengeValidityType || (EChallengeValidityType = {}));
|
|
41
|
+
export var EHistoryItemLevelStatus;
|
|
42
|
+
(function (EHistoryItemLevelStatus) {
|
|
43
|
+
EHistoryItemLevelStatus[EHistoryItemLevelStatus["Completed"] = 0] = "Completed";
|
|
44
|
+
EHistoryItemLevelStatus[EHistoryItemLevelStatus["Expired"] = 1] = "Expired";
|
|
45
|
+
EHistoryItemLevelStatus[EHistoryItemLevelStatus["Forfeited"] = 2] = "Forfeited";
|
|
46
|
+
})(EHistoryItemLevelStatus || (EHistoryItemLevelStatus = {}));
|
|
47
|
+
export const HistoryItemLevelStatusDictionary = ['Completed', 'Expired', 'Forfeited'];
|