@everymatrix/player-elevate-card 1.0.69
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/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/general-styling-wrapper_5.cjs.entry.js +3061 -0
- package/dist/cjs/index-b1cf5517.js +1634 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +15 -0
- package/dist/cjs/player-elevate-card.cjs.js +25 -0
- package/dist/collection/collection-manifest.json +22 -0
- package/dist/collection/components/player-elevate-card/index.js +1 -0
- package/dist/collection/components/player-elevate-card/player-elevate-card-items.js +22 -0
- package/dist/collection/components/player-elevate-card/player-elevate-card.css +64 -0
- package/dist/collection/components/player-elevate-card/player-elevate-card.js +279 -0
- package/dist/collection/components/player-elevate-card-data/player-elevate-card-data.css +192 -0
- package/dist/collection/components/player-elevate-card-data/player-elevate-card-data.js +231 -0
- package/dist/collection/components/player-elevate-loyaltycard/player-elevate-loyaltycard.css +68 -0
- package/dist/collection/components/player-elevate-loyaltycard/player-elevate-loyaltycard.js +285 -0
- package/dist/collection/components/player-elevate-pointcard/player-elevate-pointcard.css +70 -0
- package/dist/collection/components/player-elevate-pointcard/player-elevate-pointcard.js +316 -0
- package/dist/collection/components/static/button-default.svg +42 -0
- package/dist/collection/components/static/button-disabled.svg +4 -0
- package/dist/collection/components/static/button-hover.svg +4 -0
- package/dist/collection/components/static/button-level.svg +27 -0
- package/dist/collection/components/static/button-pressed.svg +18 -0
- package/dist/collection/components/static/button-redeem.svg +36 -0
- package/dist/collection/components/static/card-ground-over.png +0 -0
- package/dist/collection/components/static/card-ground-over.svg +903 -0
- package/dist/collection/components/static/card-ground.png +0 -0
- package/dist/collection/components/static/card-ground.svg +34 -0
- package/dist/collection/components/static/info.svg +4 -0
- package/dist/collection/components/static/level-badge.png +0 -0
- package/dist/collection/components/static/level-percent.svg +80 -0
- package/dist/collection/components/static/tips-info.svg +21 -0
- package/dist/collection/components/static/user.svg +3 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/models/player-elevate.js +1 -0
- package/dist/collection/utils/locale.utils.js +144 -0
- package/dist/collection/utils/utils.js +51 -0
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/general-styling-wrapper_5.entry.js +3053 -0
- package/dist/esm/index-cd7a4beb.js +1604 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/player-elevate-card.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/player-elevate-card/index.esm.js +0 -0
- package/dist/player-elevate-card/p-37a424ba.entry.js +1 -0
- package/dist/player-elevate-card/p-ba534fa2.js +2 -0
- package/dist/player-elevate-card/p-e1255160.js +1 -0
- package/dist/player-elevate-card/player-elevate-card.esm.js +1 -0
- package/dist/static/button-default.svg +42 -0
- package/dist/static/button-disabled.svg +4 -0
- package/dist/static/button-hover.svg +4 -0
- package/dist/static/button-level.svg +27 -0
- package/dist/static/button-pressed.svg +18 -0
- package/dist/static/button-redeem.svg +36 -0
- package/dist/static/card-ground-over.png +0 -0
- package/dist/static/card-ground-over.svg +903 -0
- package/dist/static/card-ground.png +0 -0
- package/dist/static/card-ground.svg +34 -0
- package/dist/static/info.svg +4 -0
- package/dist/static/level-badge.png +0 -0
- package/dist/static/level-percent.svg +80 -0
- package/dist/static/tips-info.svg +21 -0
- package/dist/static/user.svg +3 -0
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +17 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/player-elevate-card/.stencil/packages/stencil/player-elevate-card/stencil.config.d.ts +2 -0
- package/dist/types/Users/raul.vasile/workspace/everymatrix/widgets-monorepo/packages/stencil/player-elevate-card/.stencil/packages/stencil/player-elevate-card/stencil.config.dev.d.ts +2 -0
- package/dist/types/components/player-elevate-card/index.d.ts +1 -0
- package/dist/types/components/player-elevate-card/player-elevate-card-items.d.ts +19 -0
- package/dist/types/components/player-elevate-card/player-elevate-card.d.ts +54 -0
- package/dist/types/components/player-elevate-card-data/player-elevate-card-data.d.ts +23 -0
- package/dist/types/components/player-elevate-loyaltycard/player-elevate-loyaltycard.d.ts +54 -0
- package/dist/types/components/player-elevate-pointcard/player-elevate-pointcard.d.ts +67 -0
- package/dist/types/components.d.ts +350 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/player-elevate.d.ts +40 -0
- package/dist/types/stencil-public-runtime.d.ts +1674 -0
- package/dist/types/utils/locale.utils.d.ts +15 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/loader/package.json +11 -0
- package/package.json +26 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { differenceInCalendarDays, differenceInHours, isBefore } from "date-fns";
|
|
2
|
+
import { translateWithParams } from "../../utils/locale.utils";
|
|
3
|
+
import "../../../../../general-styling-wrapper/dist/types/index";
|
|
4
|
+
import { updateProgressSvg } from "../../utils/utils";
|
|
5
|
+
export class PlayerElevateCardData {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.params = undefined;
|
|
8
|
+
this.playerElevateLevel = undefined;
|
|
9
|
+
this.pointExpireString = undefined;
|
|
10
|
+
}
|
|
11
|
+
handleWindowResizs() {
|
|
12
|
+
this.initLevelProgressbar();
|
|
13
|
+
}
|
|
14
|
+
onParamsChanged() {
|
|
15
|
+
this.loadElevateInfo();
|
|
16
|
+
}
|
|
17
|
+
onRedeemClick() {
|
|
18
|
+
window.postMessage({ type: 'BEERedeemClicked' }, window.location.href);
|
|
19
|
+
}
|
|
20
|
+
loadLevels() {
|
|
21
|
+
let url = new URL(`${this.params.endpoint}/v1/elevate/levels?language=${this.params.language}`);
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
return fetch(url.href, {
|
|
24
|
+
method: 'GET',
|
|
25
|
+
})
|
|
26
|
+
.then((res) => res.json())
|
|
27
|
+
.then((res) => {
|
|
28
|
+
this.levels = res.data;
|
|
29
|
+
resolve(true);
|
|
30
|
+
})
|
|
31
|
+
.catch((err) => {
|
|
32
|
+
reject(err);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
calcuatePointsToBeExpired(walletTotalInfo) {
|
|
37
|
+
let pointExpireInfoAsString = '';
|
|
38
|
+
if (!walletTotalInfo || !walletTotalInfo.aboutToExpire ||
|
|
39
|
+
walletTotalInfo.aboutToExpire.length == 0 ||
|
|
40
|
+
walletTotalInfo.aboutToExpire[0].points <= 0) {
|
|
41
|
+
return pointExpireInfoAsString;
|
|
42
|
+
}
|
|
43
|
+
walletTotalInfo.aboutToExpire.sort((expire1, expire2) => {
|
|
44
|
+
return isBefore(new Date(expire1.expireTime), new Date(expire2.expireTime))
|
|
45
|
+
? -1
|
|
46
|
+
: 1;
|
|
47
|
+
});
|
|
48
|
+
const aboutToExpire = walletTotalInfo.aboutToExpire[0];
|
|
49
|
+
const daysToExpried = differenceInCalendarDays(new Date(aboutToExpire.expireTime), new Date());
|
|
50
|
+
let hoursToExpired = 0, expiredTranslationKey = daysToExpried === 0 ? 'pointsToBeExpiredDay' : 'pointsToBeExpired';
|
|
51
|
+
if (daysToExpried == 0) {
|
|
52
|
+
hoursToExpired = differenceInHours(new Date(aboutToExpire.expireTime), new Date());
|
|
53
|
+
expiredTranslationKey = hoursToExpired > 1 ? 'pointsToBeExpiredHours' : 'pointsToBeExpiredHour';
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
}
|
|
57
|
+
pointExpireInfoAsString = translateWithParams(expiredTranslationKey, {
|
|
58
|
+
expirationPoints: aboutToExpire.points,
|
|
59
|
+
expireDay: daysToExpried,
|
|
60
|
+
});
|
|
61
|
+
return pointExpireInfoAsString;
|
|
62
|
+
}
|
|
63
|
+
loadPlayerLevelInfo() {
|
|
64
|
+
let url = new URL(`${this.params.endpoint}/v1/elevate/playerInfo?language=${this.params.language}`);
|
|
65
|
+
return new Promise((resolve, reject) => {
|
|
66
|
+
return fetch(url.href, {
|
|
67
|
+
method: 'GET',
|
|
68
|
+
headers: {
|
|
69
|
+
'X-Sessionid': this.params.session,
|
|
70
|
+
'Content-Type': 'application/json',
|
|
71
|
+
},
|
|
72
|
+
})
|
|
73
|
+
.then((res) => res.json())
|
|
74
|
+
.then((res) => {
|
|
75
|
+
var _a, _b, _c;
|
|
76
|
+
if (!res.success) {
|
|
77
|
+
console.error('Exception when fetch user elevateinfo, ', res.errorCode, res.errorMessage);
|
|
78
|
+
reject(true);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
let playerElevateInfo = res.data;
|
|
82
|
+
this.playerElevateLevel = playerElevateInfo.level;
|
|
83
|
+
this.playerElevateLevel.name = this.playerElevateLevel.presentation.displayName || this.playerElevateLevel.name;
|
|
84
|
+
this.playerElevateLevel.spendablePoints = ((_a = playerElevateInfo.spendableWallet) === null || _a === void 0 ? void 0 : _a.total.points) || 0;
|
|
85
|
+
this.playerElevateLeveLoaded.emit({ elevateLevel: this.playerElevateLevel });
|
|
86
|
+
const spendableTotal = (_b = res.data.spendableWallet) === null || _b === void 0 ? void 0 : _b.total;
|
|
87
|
+
const loyaltyWalletTotal = (_c = res.data.loyaltyWallet) === null || _c === void 0 ? void 0 : _c.total;
|
|
88
|
+
this.playerElevateLeveLoaded.emit({
|
|
89
|
+
elevateLevelWalletTotal: spendableTotal,
|
|
90
|
+
loyaltyWalletTotal
|
|
91
|
+
});
|
|
92
|
+
let spExpireInfoAsString = this.calcuatePointsToBeExpired(spendableTotal);
|
|
93
|
+
let xpExpireInfoAsString = this.calcuatePointsToBeExpired(loyaltyWalletTotal);
|
|
94
|
+
if (spExpireInfoAsString || xpExpireInfoAsString) {
|
|
95
|
+
this.playerElevateLeveLoaded.emit({
|
|
96
|
+
pointExpireString: spExpireInfoAsString,
|
|
97
|
+
xpExpireString: xpExpireInfoAsString
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
resolve(this.playerElevateLevel);
|
|
101
|
+
})
|
|
102
|
+
.catch((err) => {
|
|
103
|
+
console.log('error ', err);
|
|
104
|
+
reject(true);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
setLoyaltyProgress(percent) {
|
|
109
|
+
updateProgressSvg(this.loyaltyProgressEle, percent);
|
|
110
|
+
}
|
|
111
|
+
initLevelProgressbar() {
|
|
112
|
+
setTimeout(() => {
|
|
113
|
+
this.loyaltyProgressEle =
|
|
114
|
+
this.elevateCardRef.parentElement.querySelector('#LevelProgress');
|
|
115
|
+
if (!this.loyaltyProgressEle) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
this.setLoyaltyProgress(!this.playerElevateLevel.nextLevel
|
|
119
|
+
? 1 : (this.playerElevateLevel.loyaltyPoints / this.playerElevateLevel.nextLevel.entryPoints));
|
|
120
|
+
this.params['playerElevateLevel'] = this.playerElevateLevel;
|
|
121
|
+
}, 80);
|
|
122
|
+
}
|
|
123
|
+
componentDidRender() {
|
|
124
|
+
this.initLevelProgressbar();
|
|
125
|
+
}
|
|
126
|
+
loadElevateInfo() {
|
|
127
|
+
if (!this.params.endpoint || !this.params.session) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
const promises = [];
|
|
131
|
+
promises.push(this.loadPlayerLevelInfo());
|
|
132
|
+
if (this.params.calculateLevelFlag) {
|
|
133
|
+
promises.push(this.loadLevels());
|
|
134
|
+
}
|
|
135
|
+
Promise.all(promises).then((res) => {
|
|
136
|
+
console.log('elevate-init', res);
|
|
137
|
+
this.initLevelProgressbar();
|
|
138
|
+
if (!this.levels) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
this.levels.sort((level1, level2) => {
|
|
142
|
+
return level1.firstEntryPoints > level2.firstEntryPoints ? 1 : -1;
|
|
143
|
+
});
|
|
144
|
+
const playerPoints = this.playerElevateLevel.loyaltyPoints;
|
|
145
|
+
let playerLevelNumber = 0;
|
|
146
|
+
this.levels.forEach((elevateLevel, idx) => {
|
|
147
|
+
if (playerPoints > elevateLevel.firstEntryPoints) {
|
|
148
|
+
playerLevelNumber = idx;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
this.playerElevateLeveLoaded.emit({
|
|
152
|
+
calculatedLevelFlag: playerLevelNumber,
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
componentWillLoad() {
|
|
157
|
+
this.loadElevateInfo();
|
|
158
|
+
}
|
|
159
|
+
static get is() { return "player-elevate-card-data"; }
|
|
160
|
+
static get originalStyleUrls() {
|
|
161
|
+
return {
|
|
162
|
+
"$": ["player-elevate-card-data.scss"]
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
static get styleUrls() {
|
|
166
|
+
return {
|
|
167
|
+
"$": ["player-elevate-card-data.css"]
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
static get properties() {
|
|
171
|
+
return {
|
|
172
|
+
"params": {
|
|
173
|
+
"type": "any",
|
|
174
|
+
"mutable": false,
|
|
175
|
+
"complexType": {
|
|
176
|
+
"original": "any",
|
|
177
|
+
"resolved": "any",
|
|
178
|
+
"references": {}
|
|
179
|
+
},
|
|
180
|
+
"required": false,
|
|
181
|
+
"optional": false,
|
|
182
|
+
"docs": {
|
|
183
|
+
"tags": [],
|
|
184
|
+
"text": ""
|
|
185
|
+
},
|
|
186
|
+
"attribute": "params",
|
|
187
|
+
"reflect": false
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
static get states() {
|
|
192
|
+
return {
|
|
193
|
+
"playerElevateLevel": {},
|
|
194
|
+
"pointExpireString": {}
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
static get events() {
|
|
198
|
+
return [{
|
|
199
|
+
"method": "playerElevateLeveLoaded",
|
|
200
|
+
"name": "playerElevateLeveLoaded",
|
|
201
|
+
"bubbles": true,
|
|
202
|
+
"cancelable": true,
|
|
203
|
+
"composed": true,
|
|
204
|
+
"docs": {
|
|
205
|
+
"tags": [],
|
|
206
|
+
"text": ""
|
|
207
|
+
},
|
|
208
|
+
"complexType": {
|
|
209
|
+
"original": "any",
|
|
210
|
+
"resolved": "any",
|
|
211
|
+
"references": {}
|
|
212
|
+
}
|
|
213
|
+
}];
|
|
214
|
+
}
|
|
215
|
+
static get elementRef() { return "elevateCardRef"; }
|
|
216
|
+
static get watchers() {
|
|
217
|
+
return [{
|
|
218
|
+
"propName": "params",
|
|
219
|
+
"methodName": "onParamsChanged"
|
|
220
|
+
}];
|
|
221
|
+
}
|
|
222
|
+
static get listeners() {
|
|
223
|
+
return [{
|
|
224
|
+
"name": "resize",
|
|
225
|
+
"method": "handleWindowResizs",
|
|
226
|
+
"target": "window",
|
|
227
|
+
"capture": false,
|
|
228
|
+
"passive": true
|
|
229
|
+
}];
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@media screen and (min-width: 501px) {
|
|
6
|
+
.LoyaltyCard .Inner .LevelInfo .ElevateLevel {
|
|
7
|
+
flex-wrap: nowrap;
|
|
8
|
+
}
|
|
9
|
+
.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate {
|
|
10
|
+
padding-top: 11px;
|
|
11
|
+
margin-left: 5px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
@media screen and (max-width: 500px) {
|
|
15
|
+
.LoyaltyCard .Inner .LevelInfo .ElevateLevel {
|
|
16
|
+
flex-wrap: wrap;
|
|
17
|
+
}
|
|
18
|
+
.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate {
|
|
19
|
+
padding-top: 0px;
|
|
20
|
+
margin-left: 0px;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
.LoyaltyCard .Inner .LevelProgress {
|
|
24
|
+
margin-left: 0px;
|
|
25
|
+
}
|
|
26
|
+
.LoyaltyCard .Inner .Row .PointsInfo {
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
.LoyaltyCard .Inner .Row .PointsInfo.ExpirationPoints {
|
|
30
|
+
text-align: left;
|
|
31
|
+
color: var(--emfe-w-color-red-50, red);
|
|
32
|
+
}
|
|
33
|
+
.LoyaltyCard .Inner .PlayerAvatar .Avatar {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
.LoyaltyCard .Inner .PlayerAvatar .Badge {
|
|
37
|
+
border-radius: 50%;
|
|
38
|
+
background-size: contain;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
}
|
|
42
|
+
.LoyaltyCard .Inner .LevelInfo .ElevateLevel {
|
|
43
|
+
display: flex;
|
|
44
|
+
flex: 1;
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate {
|
|
48
|
+
position: relative;
|
|
49
|
+
padding-left: 5px;
|
|
50
|
+
}
|
|
51
|
+
.LoyaltyCard .Inner .LevelInfo .ElevateLevel .ExpirationDate .ExpireTime {
|
|
52
|
+
margin-left: 5px;
|
|
53
|
+
}
|
|
54
|
+
.LoyaltyCard .Inner .LevelInfo .ElevateLevel .LevelName {
|
|
55
|
+
padding-left: 0;
|
|
56
|
+
font-size: var(--emfe-w-elevate-fontsize-2xlarge, 21px);
|
|
57
|
+
position: relative;
|
|
58
|
+
width: auto;
|
|
59
|
+
color: var(--emfe-w-elevate-color-levelname, #FFBD2B);
|
|
60
|
+
font-weight: bold;
|
|
61
|
+
}
|
|
62
|
+
.LoyaltyCard .NextLevelTip {
|
|
63
|
+
text-align: right;
|
|
64
|
+
font-size: 11px;
|
|
65
|
+
color: var(--emfe-w-color-black, #000);
|
|
66
|
+
opacity: 0.8;
|
|
67
|
+
font-weight: bold;
|
|
68
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { Fragment, getAssetPath, h } from "@stencil/core";
|
|
2
|
+
import { PlayerAvatar, PlayerElevateLoyaltyLevel, PlayerLoyaltyProcess, PlayerPoints, } from "../player-elevate-card/player-elevate-card-items";
|
|
3
|
+
import { translateWithParams, TRANSLATIONS } from "../../utils/locale.utils";
|
|
4
|
+
export class PlayerElevateLoyaltycard {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.endpoint = undefined;
|
|
7
|
+
this.theme = 'Dark';
|
|
8
|
+
this.session = undefined;
|
|
9
|
+
this.playerAvatarUrl = undefined;
|
|
10
|
+
this.language = 'en';
|
|
11
|
+
this.playerName = undefined;
|
|
12
|
+
this.dateFormat = 'yyyy-MM-dd';
|
|
13
|
+
this.clientStyling = '';
|
|
14
|
+
this.clientStylingUrl = '';
|
|
15
|
+
this.translationUrl = '';
|
|
16
|
+
this.pointExpireString = undefined;
|
|
17
|
+
this.playerElevateLevel = undefined;
|
|
18
|
+
this.elevateWalletTotal = undefined;
|
|
19
|
+
}
|
|
20
|
+
onSessionOrEndpointChange() {
|
|
21
|
+
this.paramProxy = Object.assign(Object.assign({}, this.paramProxy), { session: this.session, endpoint: this.endpoint, language: this.language });
|
|
22
|
+
}
|
|
23
|
+
playerElevateLeveLoadedHandler(event) {
|
|
24
|
+
if (!event.detail) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (event.detail['elevateLevelWalletTotal']) {
|
|
28
|
+
this.elevateWalletTotal = event.detail['elevateLevelWalletTotal'];
|
|
29
|
+
}
|
|
30
|
+
if (event.detail['elevateLevel']) {
|
|
31
|
+
this.playerElevateLevel = event.detail['elevateLevel'];
|
|
32
|
+
}
|
|
33
|
+
if (event.detail['pointExpireString']) {
|
|
34
|
+
this.pointExpireString = event.detail.xpExpireString;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
onRedeemClick() {
|
|
38
|
+
window.postMessage({ type: 'BEERedeemClicked' }, window.location.href);
|
|
39
|
+
}
|
|
40
|
+
componentWillLoad() {
|
|
41
|
+
this.paramProxy = {
|
|
42
|
+
endpoint: this.endpoint,
|
|
43
|
+
session: this.session,
|
|
44
|
+
language: this.language,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
getNextLevelTips() {
|
|
48
|
+
var _a;
|
|
49
|
+
//need xx to reach Diamond
|
|
50
|
+
let nextLevel = (_a = this.playerElevateLevel) === null || _a === void 0 ? void 0 : _a.nextLevel;
|
|
51
|
+
if (this.playerElevateLevel && nextLevel) {
|
|
52
|
+
const pointsToReach = (nextLevel.entryPoints - this.playerElevateLevel.loyaltyPoints).toFixed(2);
|
|
53
|
+
return translateWithParams('tipsForNextLevel', {
|
|
54
|
+
pointsToReach,
|
|
55
|
+
levelName: nextLevel.name,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return '';
|
|
59
|
+
}
|
|
60
|
+
render() {
|
|
61
|
+
const backgroundOuterImagePath = getAssetPath('../static/card-ground.svg');
|
|
62
|
+
const backgroundInnerImagePath = getAssetPath('../static/card-ground-over.svg');
|
|
63
|
+
return (h("div", { key: 'd32d09786bf66e0abef026482e7ea04a53c051b1', class: `ElevateCardWrapper ${this.theme}` }, h("div", { key: 'dd2685eb840341b8823f24db9b72d0f6b7d340ae', class: "LoyaltyCard Outer", style: { 'backgroundImage': `url(${backgroundOuterImagePath}` } }, h("general-styling-wrapper", { key: '3e2a00d1697c89441a8254cb81c6dc72e5b9f534', clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), h("player-elevate-card-data", { key: '56221e6d50df3b09c4269000637818009807c994', params: this.paramProxy }), h("div", { key: 'f11201024b280d6beb2ce1978ebfa7f2c7c59678', class: 'OuterCover Inner', style: { 'backgroundImage': `url(${backgroundInnerImagePath}` } }, h("div", { key: '948a023268fad3945b5069686eb29312111042a2', class: 'Content Row' }, this.playerElevateLevel && (h(Fragment, { key: 'de7c52faa07386949ce1ca728968534922e9d880' }, h("div", { key: '7c1a0c6ea5dbe7ee2375813b3819efa61e283232', class: "PlayerImg" }, h(PlayerAvatar, { key: '70ae13ee168c6de7bf4618f6ab8761462c8812b2', onlyBadge: true, loyaltyIconUrl: this.playerElevateLevel.presentation.asset })), h("div", { key: 'c11f916999b52e43e04ee472b0f54691012409a5', class: `LevelInfo ${this.playerElevateLevel.name}` }, h(PlayerElevateLoyaltyLevel, { key: '6aa61d117b24f9abbee9c5d33e882d6f023f205b', hideInfo: true, level: this.playerElevateLevel.name, expireTime: this.playerElevateLevel.expireTime, dateFormat: this.dateFormat }), h(PlayerPoints, { key: '7cc02e34d4682c25095dbf6a3077b314410d8093', loyaltyPoints: this.playerElevateLevel.loyaltyPoints, language: this.language }), this.pointExpireString && (h("div", { key: '793e388644891e15b32e003ac8914e57e758e86b', class: 'PointsInfo ExpirationPoints' }, this.pointExpireString, " ")), h(PlayerLoyaltyProcess, { key: 'a4f6c3b9f9cd5e8c6a025c26154702f9495bbe5b' }), h("div", { key: 'd91eda0f963ba9ffd481237f4b16bd4ef638d25e', class: "NextLevelTip" }, this.getNextLevelTips())))))))));
|
|
64
|
+
}
|
|
65
|
+
static get is() { return "player-elevate-loyaltycard"; }
|
|
66
|
+
static get encapsulation() { return "shadow"; }
|
|
67
|
+
static get originalStyleUrls() {
|
|
68
|
+
return {
|
|
69
|
+
"$": ["player-elevate-loyaltycard.scss"]
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
static get styleUrls() {
|
|
73
|
+
return {
|
|
74
|
+
"$": ["player-elevate-loyaltycard.css"]
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
static get properties() {
|
|
78
|
+
return {
|
|
79
|
+
"endpoint": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"mutable": false,
|
|
82
|
+
"complexType": {
|
|
83
|
+
"original": "string",
|
|
84
|
+
"resolved": "string",
|
|
85
|
+
"references": {}
|
|
86
|
+
},
|
|
87
|
+
"required": true,
|
|
88
|
+
"optional": false,
|
|
89
|
+
"docs": {
|
|
90
|
+
"tags": [],
|
|
91
|
+
"text": "The NWA endpoint"
|
|
92
|
+
},
|
|
93
|
+
"attribute": "endpoint",
|
|
94
|
+
"reflect": true
|
|
95
|
+
},
|
|
96
|
+
"theme": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "string",
|
|
101
|
+
"resolved": "string",
|
|
102
|
+
"references": {}
|
|
103
|
+
},
|
|
104
|
+
"required": false,
|
|
105
|
+
"optional": false,
|
|
106
|
+
"docs": {
|
|
107
|
+
"tags": [],
|
|
108
|
+
"text": "The style that widget shows,available value: Dark, Light\nDefault: Dark"
|
|
109
|
+
},
|
|
110
|
+
"attribute": "theme",
|
|
111
|
+
"reflect": true,
|
|
112
|
+
"defaultValue": "'Dark'"
|
|
113
|
+
},
|
|
114
|
+
"session": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"mutable": false,
|
|
117
|
+
"complexType": {
|
|
118
|
+
"original": "string",
|
|
119
|
+
"resolved": "string",
|
|
120
|
+
"references": {}
|
|
121
|
+
},
|
|
122
|
+
"required": true,
|
|
123
|
+
"optional": false,
|
|
124
|
+
"docs": {
|
|
125
|
+
"tags": [],
|
|
126
|
+
"text": "The NWA session for the logged-in user"
|
|
127
|
+
},
|
|
128
|
+
"attribute": "session",
|
|
129
|
+
"reflect": true
|
|
130
|
+
},
|
|
131
|
+
"playerAvatarUrl": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "string",
|
|
136
|
+
"resolved": "string",
|
|
137
|
+
"references": {}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": false,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": "Widget, player avatar url"
|
|
144
|
+
},
|
|
145
|
+
"attribute": "player-avatar-url",
|
|
146
|
+
"reflect": true
|
|
147
|
+
},
|
|
148
|
+
"language": {
|
|
149
|
+
"type": "string",
|
|
150
|
+
"mutable": false,
|
|
151
|
+
"complexType": {
|
|
152
|
+
"original": "string",
|
|
153
|
+
"resolved": "string",
|
|
154
|
+
"references": {}
|
|
155
|
+
},
|
|
156
|
+
"required": false,
|
|
157
|
+
"optional": false,
|
|
158
|
+
"docs": {
|
|
159
|
+
"tags": [],
|
|
160
|
+
"text": "Widget Language to show"
|
|
161
|
+
},
|
|
162
|
+
"attribute": "language",
|
|
163
|
+
"reflect": true,
|
|
164
|
+
"defaultValue": "'en'"
|
|
165
|
+
},
|
|
166
|
+
"playerName": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"mutable": false,
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "string",
|
|
171
|
+
"resolved": "string",
|
|
172
|
+
"references": {}
|
|
173
|
+
},
|
|
174
|
+
"required": false,
|
|
175
|
+
"optional": false,
|
|
176
|
+
"docs": {
|
|
177
|
+
"tags": [],
|
|
178
|
+
"text": "The first name"
|
|
179
|
+
},
|
|
180
|
+
"attribute": "player-name",
|
|
181
|
+
"reflect": true
|
|
182
|
+
},
|
|
183
|
+
"dateFormat": {
|
|
184
|
+
"type": "string",
|
|
185
|
+
"mutable": false,
|
|
186
|
+
"complexType": {
|
|
187
|
+
"original": "string",
|
|
188
|
+
"resolved": "string",
|
|
189
|
+
"references": {}
|
|
190
|
+
},
|
|
191
|
+
"required": false,
|
|
192
|
+
"optional": false,
|
|
193
|
+
"docs": {
|
|
194
|
+
"tags": [],
|
|
195
|
+
"text": "datePattern"
|
|
196
|
+
},
|
|
197
|
+
"attribute": "date-format",
|
|
198
|
+
"reflect": true,
|
|
199
|
+
"defaultValue": "'yyyy-MM-dd'"
|
|
200
|
+
},
|
|
201
|
+
"clientStyling": {
|
|
202
|
+
"type": "string",
|
|
203
|
+
"mutable": false,
|
|
204
|
+
"complexType": {
|
|
205
|
+
"original": "string",
|
|
206
|
+
"resolved": "string",
|
|
207
|
+
"references": {}
|
|
208
|
+
},
|
|
209
|
+
"required": false,
|
|
210
|
+
"optional": false,
|
|
211
|
+
"docs": {
|
|
212
|
+
"tags": [],
|
|
213
|
+
"text": "Client custom styling via inline styles"
|
|
214
|
+
},
|
|
215
|
+
"attribute": "client-styling",
|
|
216
|
+
"reflect": true,
|
|
217
|
+
"defaultValue": "''"
|
|
218
|
+
},
|
|
219
|
+
"clientStylingUrl": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"mutable": false,
|
|
222
|
+
"complexType": {
|
|
223
|
+
"original": "string",
|
|
224
|
+
"resolved": "string",
|
|
225
|
+
"references": {}
|
|
226
|
+
},
|
|
227
|
+
"required": false,
|
|
228
|
+
"optional": false,
|
|
229
|
+
"docs": {
|
|
230
|
+
"tags": [],
|
|
231
|
+
"text": "Client custom styling via url"
|
|
232
|
+
},
|
|
233
|
+
"attribute": "client-styling-url",
|
|
234
|
+
"reflect": true,
|
|
235
|
+
"defaultValue": "''"
|
|
236
|
+
},
|
|
237
|
+
"translationUrl": {
|
|
238
|
+
"type": "string",
|
|
239
|
+
"mutable": false,
|
|
240
|
+
"complexType": {
|
|
241
|
+
"original": "string",
|
|
242
|
+
"resolved": "string",
|
|
243
|
+
"references": {}
|
|
244
|
+
},
|
|
245
|
+
"required": false,
|
|
246
|
+
"optional": false,
|
|
247
|
+
"docs": {
|
|
248
|
+
"tags": [],
|
|
249
|
+
"text": "Translation via url"
|
|
250
|
+
},
|
|
251
|
+
"attribute": "translation-url",
|
|
252
|
+
"reflect": true,
|
|
253
|
+
"defaultValue": "''"
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
static get states() {
|
|
258
|
+
return {
|
|
259
|
+
"pointExpireString": {},
|
|
260
|
+
"playerElevateLevel": {},
|
|
261
|
+
"elevateWalletTotal": {}
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
static get watchers() {
|
|
265
|
+
return [{
|
|
266
|
+
"propName": "session",
|
|
267
|
+
"methodName": "onSessionOrEndpointChange"
|
|
268
|
+
}, {
|
|
269
|
+
"propName": "endpoint",
|
|
270
|
+
"methodName": "onSessionOrEndpointChange"
|
|
271
|
+
}, {
|
|
272
|
+
"propName": "language",
|
|
273
|
+
"methodName": "onSessionOrEndpointChange"
|
|
274
|
+
}];
|
|
275
|
+
}
|
|
276
|
+
static get listeners() {
|
|
277
|
+
return [{
|
|
278
|
+
"name": "playerElevateLeveLoaded",
|
|
279
|
+
"method": "playerElevateLeveLoadedHandler",
|
|
280
|
+
"target": undefined,
|
|
281
|
+
"capture": false,
|
|
282
|
+
"passive": false
|
|
283
|
+
}];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.PointsCard .Inner .Row .ExpirationPoints {
|
|
6
|
+
text-align: left;
|
|
7
|
+
}
|
|
8
|
+
.PointsCard .Inner .PlayerAvatar .Avatar {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
.PointsCard .Inner .PlayerAvatar .Badge {
|
|
12
|
+
border-radius: 50%;
|
|
13
|
+
background-size: contain;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
position: inherit;
|
|
17
|
+
}
|
|
18
|
+
.PointsCard .Inner .PointsTxt {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: row;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
}
|
|
23
|
+
.PointsCard .Inner .DetailButton {
|
|
24
|
+
background: linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%), linear-gradient(0deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6));
|
|
25
|
+
border-radius: 5px;
|
|
26
|
+
box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);
|
|
27
|
+
border: 2px solid;
|
|
28
|
+
font-size: 11px;
|
|
29
|
+
width: 108px;
|
|
30
|
+
padding: 4px;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
margin-top: 5px;
|
|
33
|
+
height: 16px;
|
|
34
|
+
min-width: 45px;
|
|
35
|
+
text-align: center;
|
|
36
|
+
}
|
|
37
|
+
.PointsCard .Inner .DetailButton span {
|
|
38
|
+
color: var(--emfe-w-color-gray-150, #6D6D6D);
|
|
39
|
+
}
|
|
40
|
+
.PointsCard .Inner .DetailButton span {
|
|
41
|
+
display: inline-block;
|
|
42
|
+
vertical-align: middle;
|
|
43
|
+
}
|
|
44
|
+
.PointsCard .Inner .DetailButton:hover span {
|
|
45
|
+
color: var(--emfe-w-color-gray-150, #6D6D6D);
|
|
46
|
+
}
|
|
47
|
+
.PointsCard .Inner .LevelInfo {
|
|
48
|
+
gap: 15px;
|
|
49
|
+
width: 70%;
|
|
50
|
+
}
|
|
51
|
+
.PointsCard .Inner .LevelInfo .PointsTxt {
|
|
52
|
+
font-size: 15px;
|
|
53
|
+
}
|
|
54
|
+
.PointsCard .Inner .LevelInfo .PointsTxt.Label {
|
|
55
|
+
display: none;
|
|
56
|
+
}
|
|
57
|
+
.PointsCard .Inner .LevelInfo .PointsTxt.SPPoints {
|
|
58
|
+
padding-top: 15px;
|
|
59
|
+
}
|
|
60
|
+
.PointsCard .Inner .LevelInfo .PointsTxt .TC {
|
|
61
|
+
font-size: x-small;
|
|
62
|
+
color: var(--emw--color-gray-300, #58586B);
|
|
63
|
+
display: flex;
|
|
64
|
+
align-content: center;
|
|
65
|
+
height: 100%;
|
|
66
|
+
flex-wrap: wrap;
|
|
67
|
+
text-decoration: underline;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
display: none;
|
|
70
|
+
}
|