@everymatrix/player-elevate-card 1.37.4 → 1.37.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-styling-wrapper_5.cjs.entry.js +50 -18
- package/dist/cjs/{index-234565f1.js → index-b6d0684c.js} +32 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/player-elevate-card.cjs.js +1 -1
- package/dist/collection/components/player-elevate-card/player-elevate-card.js +14 -1
- package/dist/collection/components/player-elevate-card-data/player-elevate-card-data.css +3 -0
- package/dist/collection/components/player-elevate-card-data/player-elevate-card-data.js +13 -8
- package/dist/collection/components/player-elevate-loyaltycard/player-elevate-loyaltycard.js +16 -3
- package/dist/collection/components/player-elevate-pointcard/player-elevate-pointcard.js +14 -1
- package/dist/collection/components/static/level-percent.svg +3 -3
- package/dist/collection/utils/utils.js +8 -4
- package/dist/components/player-elevate-card-data2.js +20 -12
- package/dist/components/player-elevate-card-items.js +3 -3
- package/dist/components/player-elevate-card.js +8 -0
- package/dist/components/player-elevate-loyaltycard.js +10 -2
- package/dist/components/player-elevate-pointcard.js +8 -0
- package/dist/components/static/level-percent.svg +3 -3
- package/dist/esm/general-styling-wrapper_5.entry.js +50 -18
- package/dist/esm/{index-747197fd.js → index-6beb1563.js} +32 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/player-elevate-card.js +1 -1
- package/dist/player-elevate-card/p-523c2803.js +1 -0
- package/dist/player-elevate-card/p-afc6e393.entry.js +1 -0
- package/dist/player-elevate-card/player-elevate-card.esm.js +1 -1
- package/dist/static/level-percent.svg +3 -3
- package/dist/types/components/player-elevate-card/player-elevate-card.d.ts +1 -0
- package/dist/types/components/player-elevate-card-data/player-elevate-card-data.d.ts +2 -1
- package/dist/types/components/player-elevate-loyaltycard/player-elevate-loyaltycard.d.ts +2 -1
- package/dist/types/components/player-elevate-pointcard/player-elevate-pointcard.d.ts +1 -0
- package/package.json +1 -1
- package/dist/player-elevate-card/p-afe7b72e.js +0 -1
- package/dist/player-elevate-card/p-b6a4836b.entry.js +0 -1
- /package/dist/types/Users/{sebastian.strulea/Documents/work → adrian.pripon/Documents/Work}/widgets-stencil/packages/player-elevate-card/.stencil/packages/player-elevate-card/stencil.config.d.ts +0 -0
|
@@ -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-b6d0684c.js');
|
|
6
6
|
|
|
7
7
|
const mergeTranslations = (url, target) => {
|
|
8
8
|
return new Promise((resolve) => {
|
|
@@ -85,9 +85,9 @@ const GeneralStylingWrapper = class {
|
|
|
85
85
|
};
|
|
86
86
|
GeneralStylingWrapper.style = generalStylingWrapperCss;
|
|
87
87
|
|
|
88
|
-
const LoyaltyProgress = `<svg width="100%" height="28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
89
|
-
<rect y="12" width="100%" id="total_level" height="5" rx="2.5" fill="white" fill-opacity="0.5"/>
|
|
90
|
-
<rect y="12" id="current_level" width="64" height="5" rx="2.5" fill="white"/>
|
|
88
|
+
const LoyaltyProgress = `<svg width="100%" height="28" style="opacity: 0" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
89
|
+
<rect y="12" x="2" width="100%" id="total_level" height="5" rx="2.5" fill="white" fill-opacity="0.5"/>
|
|
90
|
+
<rect y="12" x="2" id="current_level" width="64" height="5" rx="2.5" fill="white"/>
|
|
91
91
|
<g filter="url(#filter_current_level)">
|
|
92
92
|
<circle id="circle_current_level" cx="74.5" cy="14.5" r="6.5" fill="white"/>
|
|
93
93
|
</g>
|
|
@@ -2578,6 +2578,9 @@ const PlayerElevateCard = class {
|
|
|
2578
2578
|
this.translationUrl = '';
|
|
2579
2579
|
this.playerLevelFlag = 0;
|
|
2580
2580
|
}
|
|
2581
|
+
onSessionOrEndpointChange() {
|
|
2582
|
+
this.paramProxy = Object.assign(Object.assign({}, this.paramProxy), { session: this.session, endpoint: this.endpoint, language: this.language });
|
|
2583
|
+
}
|
|
2581
2584
|
playerElevateLeveLoadedHandler(event) {
|
|
2582
2585
|
if (!event.detail) {
|
|
2583
2586
|
return;
|
|
@@ -2612,6 +2615,11 @@ const PlayerElevateCard = class {
|
|
|
2612
2615
|
return (index.h("div", { class: `ElevateCardWrapper ${this.theme}` }, index.h("div", { class: "Card Outer", style: { 'backgroundImage': `url(${backgroundOuterImagePath}` } }, index.h("general-styling-wrapper", { clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), index.h("player-elevate-card-data", { params: this.paramProxy }), index.h("div", { class: "OuterCover Inner", style: { 'backgroundImage': `url(${backgroundInnerImagePath}` } }, this.playerElevateLevel && (index.h(index.Fragment, null, index.h("div", { class: 'Content Row' }, index.h("div", { class: "PlayerImg" }, index.h(PlayerAvatar, { playerAvatarUrl: this.playerAvatarUrl, loyaltyIconUrl: this.playerElevateLevel.presentation.asset }), index.h(PlayerPoints, { loyaltyPoints: this.playerElevateLevel.loyaltyPoints, language: this.language })), this.pointExpireString && (index.h("div", { class: 'PointsInfo ExpirationPoints' }, this.pointExpireString, " ")), index.h("div", { class: `LevelInfo Level${this.playerLevelFlag} ${this.playerElevateLevel.presentation.displayName}` }, index.h(PlayerNameDiv, { playerName: this.playerName }), index.h(PlayerElevateLoyaltyLevel, { hideInfo: true, level: this.playerElevateLevel.name, expireTime: this.playerElevateLevel.expireTime, dateFormat: this.dateFormat }), index.h(PlayerLoyaltyProcess, null), index.h(PlayerElevateCardRedeem, { onRedeemClick: this.onRedeemClick, language: this.language })))))))));
|
|
2613
2616
|
}
|
|
2614
2617
|
static get assetsDirs() { return ["../static"]; }
|
|
2618
|
+
static get watchers() { return {
|
|
2619
|
+
"session": ["onSessionOrEndpointChange"],
|
|
2620
|
+
"endpoint": ["onSessionOrEndpointChange"],
|
|
2621
|
+
"language": ["onSessionOrEndpointChange"]
|
|
2622
|
+
}; }
|
|
2615
2623
|
};
|
|
2616
2624
|
PlayerElevateCard.style = playerElevateCardCss;
|
|
2617
2625
|
|
|
@@ -2801,9 +2809,12 @@ function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
|
2801
2809
|
|
|
2802
2810
|
function updateProgressSvg(progressElementRef, percent) {
|
|
2803
2811
|
const svgElement = progressElementRef.querySelector('#total_level');
|
|
2804
|
-
const endLockWidth =
|
|
2812
|
+
const endLockWidth = 17, pointR = 6.5;
|
|
2813
|
+
//Total Widget of the progress
|
|
2805
2814
|
const barWidth = svgElement.getBBox().width;
|
|
2806
|
-
|
|
2815
|
+
//The filled width according to current progress
|
|
2816
|
+
const levelPercent = percent > 1 ? 1 : percent;
|
|
2817
|
+
const widthOnBar = (levelPercent * barWidth - endLockWidth) < 0 ? 0 : levelPercent * barWidth - endLockWidth;
|
|
2807
2818
|
//update bar's width, widthOnBar
|
|
2808
2819
|
const levelBar = progressElementRef.querySelector('#current_level');
|
|
2809
2820
|
//update filters, x = widthOnBar
|
|
@@ -2812,8 +2823,8 @@ function updateProgressSvg(progressElementRef, percent) {
|
|
|
2812
2823
|
const levelCircle = progressElementRef.querySelector('#circle_current_level');
|
|
2813
2824
|
svgElement.setAttribute('viewbox', `0 0 ${widthOnBar} 28`);
|
|
2814
2825
|
levelBar.setAttribute('width', `${widthOnBar}`);
|
|
2815
|
-
levelCircle.setAttribute('cx', `${widthOnBar
|
|
2816
|
-
levelFilter.setAttribute('x', `${widthOnBar -
|
|
2826
|
+
levelCircle.setAttribute('cx', `${(widthOnBar < pointR ? pointR : widthOnBar)}`);
|
|
2827
|
+
levelFilter.setAttribute('x', `${widthOnBar - 8}`);
|
|
2817
2828
|
//update lock location
|
|
2818
2829
|
const endLockElement = progressElementRef.querySelector('#lock');
|
|
2819
2830
|
// wrapper of endLock, include ball and heatfilter1_d_305_23
|
|
@@ -2845,9 +2856,10 @@ function updateProgressSvg(progressElementRef, percent) {
|
|
|
2845
2856
|
filter1.setAttribute('x', `${cxOfEndLockEle - 6 - 2 - 2 - 4}`);
|
|
2846
2857
|
lockBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
|
|
2847
2858
|
heartBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
|
|
2859
|
+
svgElement.parentElement.style.opacity = '1';
|
|
2848
2860
|
}
|
|
2849
2861
|
|
|
2850
|
-
const playerElevateCardDataCss = ":host {\n display: block;\n width: 360px;\n height: 230px;\n}\n\n.ElevateCardWrapper {\n contain: layout inline-size;\n width: 100%;\n height: fit-content;\n min-height: 218px;\n}\n\n.Outer {\n container-type: inline-size;\n font-size: 12px;\n background-size: cover;\n background-repeat: no-repeat;\n line-height: initial;\n width: 100%;\n height: 100%;\n}\n\n.Dark {\n color: var(--emfe-w-color-gray150, #efefef);\n}\n\n.Light {\n color: var(--emfe-w-color-black, #0e0e0e);\n}\n\n@container (min-width: 381px) {\n .Outer {\n background-size: cover;\n }\n .Outer .OuterCover {\n min-height: 190px;\n }\n}\n@container (min-width: 260px) {\n .Outer {\n background-size: contain;\n }\n}\n.OuterCover {\n width: 100%;\n height: 100%;\n content: \"\";\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 15px;\n}\n\n.Inner {\n display: flex;\n flex-direction: column;\n min-height: 158px;\n}\n.Inner .Content {\n padding: 15px;\n flex-wrap: wrap;\n gap: 8px;\n}\n.Inner .Row {\n display: flex;\n flex-direction: row;\n}\n.Inner .CardCell {\n display: flex;\n}\n.Inner .LevelInfo {\n display: flex;\n flex-direction: column;\n}\n.Inner .LevelInfo .ElevateLevel .LevelName {\n height: 28px;\n border-radius: 5px;\n line-height: 28px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.Inner .LevelInfo.Level0 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level0button-shadow, rgba(191, 84, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level0-bg0, #E2792C) 0%, var(--emfe-w-elevate-color-level0-bg1, rgba(242, 151, 99, 0)) 100%);\n}\n.Inner .LevelInfo.Level1 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level1button-shadow, rgba(151, 151, 151, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level1-bg0, #BEBFED) 0%, var(--emfe-w-elevate-color-level1-bg1, rgba(216, 217, 233, 0)) 100%);\n}\n.Inner .LevelInfo.Level2 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level2button-shadow, rgba(191, 120, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level2-bg0, #FCC410) 0%, var(--emfe-w-elevate-color-level2-bg1, rgba(255, 189, 43, 0)) 100%);\n}\n.Inner .LevelInfo.Level3 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level3button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level3-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level3-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo.Level4 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level4button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level4-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level4-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo .ElevateLevel {\n display: flex;\n}\n.Inner .LevelInfo {\n flex: 1;\n flex-grow: 1;\n min-width: 150px;\n}\n.Inner .PlayerImg {\n width: 29%;\n margin: auto;\n max-width: 100px;\n min-width: 30px;\n order: 0;\n}\n.Inner .PlayerAvatar {\n max-width: 100px;\n flex-basis: 100px;\n height: auto;\n margin: auto;\n padding-top: 10px;\n}\n.Inner .PlayerAvatar .Avatar, .Inner .PlayerAvatar .Badge {\n width: 100%;\n height: 100%;\n}\n.Inner .PlayerAvatar .Avatar {\n border-radius: 50%;\n background-size: contain;\n background-repeat: no-repeat;\n}\n.Inner .ElevateLevel .ExpirationDate {\n max-width: 138px;\n min-width: 118px;\n}\n.Inner .PlayerName, .Inner .RedeemButton, .Inner .ElevateLevel {\n text-transform: capitalize;\n width: 100%;\n}\n.Inner .PlayerName {\n font-size: 16px;\n}\n.Inner .Row .PointsInfo {\n display: table;\n font-weight: 600;\n}\n.Inner .Row .Redeem {\n justify-content: flex-end;\n margin-left: auto;\n}\n.Inner .Row .Redeem:hover {\n color: var(--emfe-w-elevate-color-redeem-hover, #00ABA4);\n cursor: pointer;\n}\n.Inner .Row .RedeemButton:hover span {\n color: var(emfe-w-elevate-color-redeem-text-hover, #f1f1f1);\n font-weight: bold;\n}\n.Inner .Row .RedeemButton {\n width: 95px;\n height: 35px;\n display: flex;\n align-items: center;\n border-radius: 10px;\n background: var(--emfe-w-elevate-color-redeem-bg, linear-gradient(0deg, #26CC37, #26CC37)), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);\n box-shadow: 0px 4px 4px 0px #00000040;\n}\n.Inner .Row .RedeemButton span {\n color: var(--emfe-w-color-white, #fff);\n line-height: 18px;\n font-size: 15px;\n text-align: center;\n width: 100%;\n}\n.Inner .Row .Points {\n font-size: large;\n vertical-align: middle;\n}\n.Inner .Row .Points .XP {\n font-size: x-small;\n}\n.Inner .Row .ExpirationPoints {\n font-size: small;\n text-align: right;\n font-weight: bold;\n color: var(--emfe-w-color-red, #9e595f);\n}";
|
|
2862
|
+
const playerElevateCardDataCss = ":host {\n display: block;\n width: 360px;\n height: 230px;\n}\n\n.ElevateCardWrapper {\n contain: layout inline-size;\n width: 100%;\n height: fit-content;\n min-height: 218px;\n}\n\n.Outer {\n container-type: inline-size;\n font-size: 12px;\n background-size: cover;\n background-repeat: no-repeat;\n line-height: initial;\n width: 100%;\n height: 100%;\n}\n\n.Dark {\n color: var(--emfe-w-color-gray150, #efefef);\n}\n\n.Light {\n color: var(--emfe-w-color-black, #0e0e0e);\n}\n\n@container (min-width: 381px) {\n .Outer {\n background-size: cover;\n }\n .Outer .OuterCover {\n min-height: 190px;\n }\n}\n@container (min-width: 260px) {\n .Outer {\n background-size: contain;\n }\n}\n.OuterCover {\n width: 100%;\n height: 100%;\n content: \"\";\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 15px;\n}\n\n.Inner {\n display: flex;\n flex-direction: column;\n min-height: 158px;\n}\n.Inner .Content {\n padding: 15px;\n flex-wrap: wrap;\n gap: 8px;\n}\n.Inner .Row {\n display: flex;\n flex-direction: row;\n}\n.Inner .CardCell {\n display: flex;\n}\n.Inner .LevelProgress svg {\n transition: opacity 0.4s;\n}\n.Inner .LevelInfo {\n display: flex;\n flex-direction: column;\n}\n.Inner .LevelInfo .ElevateLevel .LevelName {\n height: 28px;\n border-radius: 5px;\n line-height: 28px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.Inner .LevelInfo.Level0 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level0button-shadow, rgba(191, 84, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level0-bg0, #E2792C) 0%, var(--emfe-w-elevate-color-level0-bg1, rgba(242, 151, 99, 0)) 100%);\n}\n.Inner .LevelInfo.Level1 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level1button-shadow, rgba(151, 151, 151, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level1-bg0, #BEBFED) 0%, var(--emfe-w-elevate-color-level1-bg1, rgba(216, 217, 233, 0)) 100%);\n}\n.Inner .LevelInfo.Level2 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level2button-shadow, rgba(191, 120, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level2-bg0, #FCC410) 0%, var(--emfe-w-elevate-color-level2-bg1, rgba(255, 189, 43, 0)) 100%);\n}\n.Inner .LevelInfo.Level3 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level3button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level3-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level3-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo.Level4 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level4button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level4-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level4-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo .ElevateLevel {\n display: flex;\n}\n.Inner .LevelInfo {\n flex: 1;\n flex-grow: 1;\n min-width: 150px;\n}\n.Inner .PlayerImg {\n width: 29%;\n margin: auto;\n max-width: 100px;\n min-width: 30px;\n order: 0;\n}\n.Inner .PlayerAvatar {\n max-width: 100px;\n flex-basis: 100px;\n height: auto;\n margin: auto;\n padding-top: 10px;\n}\n.Inner .PlayerAvatar .Avatar, .Inner .PlayerAvatar .Badge {\n width: 100%;\n height: 100%;\n}\n.Inner .PlayerAvatar .Avatar {\n border-radius: 50%;\n background-size: contain;\n background-repeat: no-repeat;\n}\n.Inner .ElevateLevel .ExpirationDate {\n max-width: 138px;\n min-width: 118px;\n}\n.Inner .PlayerName, .Inner .RedeemButton, .Inner .ElevateLevel {\n text-transform: capitalize;\n width: 100%;\n}\n.Inner .PlayerName {\n font-size: 16px;\n}\n.Inner .Row .PointsInfo {\n display: table;\n font-weight: 600;\n}\n.Inner .Row .Redeem {\n justify-content: flex-end;\n margin-left: auto;\n}\n.Inner .Row .Redeem:hover {\n color: var(--emfe-w-elevate-color-redeem-hover, #00ABA4);\n cursor: pointer;\n}\n.Inner .Row .RedeemButton:hover span {\n color: var(emfe-w-elevate-color-redeem-text-hover, #f1f1f1);\n font-weight: bold;\n}\n.Inner .Row .RedeemButton {\n width: 95px;\n height: 35px;\n display: flex;\n align-items: center;\n border-radius: 10px;\n background: var(--emfe-w-elevate-color-redeem-bg, linear-gradient(0deg, #26CC37, #26CC37)), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);\n box-shadow: 0px 4px 4px 0px #00000040;\n}\n.Inner .Row .RedeemButton span {\n color: var(--emfe-w-color-white, #fff);\n line-height: 18px;\n font-size: 15px;\n text-align: center;\n width: 100%;\n}\n.Inner .Row .Points {\n font-size: large;\n vertical-align: middle;\n}\n.Inner .Row .Points .XP {\n font-size: x-small;\n}\n.Inner .Row .ExpirationPoints {\n font-size: small;\n text-align: right;\n font-weight: bold;\n color: var(--emfe-w-color-red, #9e595f);\n}";
|
|
2851
2863
|
|
|
2852
2864
|
const PlayerElevateCardData = class {
|
|
2853
2865
|
constructor(hostRef) {
|
|
@@ -2857,6 +2869,9 @@ const PlayerElevateCardData = class {
|
|
|
2857
2869
|
handleWindowResizs() {
|
|
2858
2870
|
this.initLevelProgressbar();
|
|
2859
2871
|
}
|
|
2872
|
+
onParamsChanged() {
|
|
2873
|
+
this.loadElevateInfo();
|
|
2874
|
+
}
|
|
2860
2875
|
onRedeemClick() {
|
|
2861
2876
|
window.postMessage({ type: 'BEERedeemClicked' }, window.location.href);
|
|
2862
2877
|
}
|
|
@@ -2957,19 +2972,14 @@ const PlayerElevateCardData = class {
|
|
|
2957
2972
|
return;
|
|
2958
2973
|
}
|
|
2959
2974
|
this.setLoyaltyProgress(!this.playerElevateLevel.nextLevel
|
|
2960
|
-
? 1
|
|
2961
|
-
: (this.playerElevateLevel.loyaltyPoints -
|
|
2962
|
-
this.playerElevateLevel.entryPoints) /
|
|
2963
|
-
(this.playerElevateLevel.nextLevel.entryPoints -
|
|
2964
|
-
this.playerElevateLevel.entryPoints));
|
|
2975
|
+
? 1 : (this.playerElevateLevel.loyaltyPoints / this.playerElevateLevel.nextLevel.entryPoints));
|
|
2965
2976
|
this.params['playerElevateLevel'] = this.playerElevateLevel;
|
|
2966
2977
|
}, 80);
|
|
2967
2978
|
}
|
|
2968
|
-
componentWillRender() { }
|
|
2969
2979
|
componentDidRender() {
|
|
2970
2980
|
this.initLevelProgressbar();
|
|
2971
2981
|
}
|
|
2972
|
-
|
|
2982
|
+
loadElevateInfo() {
|
|
2973
2983
|
if (!this.params.endpoint || !this.params.session) {
|
|
2974
2984
|
return;
|
|
2975
2985
|
}
|
|
@@ -2999,7 +3009,13 @@ const PlayerElevateCardData = class {
|
|
|
2999
3009
|
});
|
|
3000
3010
|
});
|
|
3001
3011
|
}
|
|
3012
|
+
componentWillLoad() {
|
|
3013
|
+
this.loadElevateInfo();
|
|
3014
|
+
}
|
|
3002
3015
|
get elevateCardRef() { return index.getElement(this); }
|
|
3016
|
+
static get watchers() { return {
|
|
3017
|
+
"params": ["onParamsChanged"]
|
|
3018
|
+
}; }
|
|
3003
3019
|
};
|
|
3004
3020
|
PlayerElevateCardData.style = playerElevateCardDataCss;
|
|
3005
3021
|
|
|
@@ -3034,6 +3050,9 @@ const PlayerElevateLoyaltycard = class {
|
|
|
3034
3050
|
*/
|
|
3035
3051
|
this.translationUrl = '';
|
|
3036
3052
|
}
|
|
3053
|
+
onSessionOrEndpointChange() {
|
|
3054
|
+
this.paramProxy = Object.assign(Object.assign({}, this.paramProxy), { session: this.session, endpoint: this.endpoint, language: this.language });
|
|
3055
|
+
}
|
|
3037
3056
|
playerElevateLeveLoadedHandler(event) {
|
|
3038
3057
|
if (!event.detail) {
|
|
3039
3058
|
return;
|
|
@@ -3052,7 +3071,7 @@ const PlayerElevateLoyaltycard = class {
|
|
|
3052
3071
|
window.postMessage({ type: 'BEERedeemClicked' }, window.location.href);
|
|
3053
3072
|
}
|
|
3054
3073
|
componentWillLoad() {
|
|
3055
|
-
this.
|
|
3074
|
+
this.paramProxy = {
|
|
3056
3075
|
endpoint: this.endpoint,
|
|
3057
3076
|
session: this.session,
|
|
3058
3077
|
language: this.language,
|
|
@@ -3074,8 +3093,13 @@ const PlayerElevateLoyaltycard = class {
|
|
|
3074
3093
|
render() {
|
|
3075
3094
|
const backgroundOuterImagePath = index.getAssetPath('../static/card-ground.svg');
|
|
3076
3095
|
const backgroundInnerImagePath = index.getAssetPath('../static/card-ground-over.svg');
|
|
3077
|
-
return (index.h("div", { class: `ElevateCardWrapper ${this.theme}` }, index.h("div", { class: "LoyaltyCard Outer", style: { 'backgroundImage': `url(${backgroundOuterImagePath}` } }, index.h("general-styling-wrapper", { clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), index.h("player-elevate-card-data", { params: this.
|
|
3096
|
+
return (index.h("div", { class: `ElevateCardWrapper ${this.theme}` }, index.h("div", { class: "LoyaltyCard Outer", style: { 'backgroundImage': `url(${backgroundOuterImagePath}` } }, index.h("general-styling-wrapper", { clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }), index.h("player-elevate-card-data", { params: this.paramProxy }), index.h("div", { class: 'OuterCover Inner', style: { 'backgroundImage': `url(${backgroundInnerImagePath}` } }, index.h("div", { class: 'Content Row' }, this.playerElevateLevel && (index.h(index.Fragment, null, index.h("div", { class: "PlayerImg" }, index.h(PlayerAvatar, { onlyBadge: true, loyaltyIconUrl: this.playerElevateLevel.presentation.asset })), index.h("div", { class: `LevelInfo ${this.playerElevateLevel.name}` }, index.h(PlayerElevateLoyaltyLevel, { hideInfo: true, level: this.playerElevateLevel.name, expireTime: this.playerElevateLevel.expireTime, dateFormat: this.dateFormat }), index.h(PlayerPoints, { loyaltyPoints: this.playerElevateLevel.loyaltyPoints, language: this.language }), this.pointExpireString && (index.h("div", { class: 'PointsInfo ExpirationPoints' }, this.pointExpireString, " ")), index.h(PlayerLoyaltyProcess, null), index.h("div", { class: "NextLevelTip" }, this.getNextLevelTips())))))))));
|
|
3078
3097
|
}
|
|
3098
|
+
static get watchers() { return {
|
|
3099
|
+
"session": ["onSessionOrEndpointChange"],
|
|
3100
|
+
"endpoint": ["onSessionOrEndpointChange"],
|
|
3101
|
+
"language": ["onSessionOrEndpointChange"]
|
|
3102
|
+
}; }
|
|
3079
3103
|
};
|
|
3080
3104
|
PlayerElevateLoyaltycard.style = playerElevateLoyaltycardCss;
|
|
3081
3105
|
|
|
@@ -3119,6 +3143,9 @@ const PlayerElevatePointcard = class {
|
|
|
3119
3143
|
this.translationUrl = '';
|
|
3120
3144
|
this.isPointDetailCard = this.buttonType === 'earningRule';
|
|
3121
3145
|
}
|
|
3146
|
+
onSessionOrEndpointChange() {
|
|
3147
|
+
this.paramProxy = Object.assign(Object.assign({}, this.paramProxy), { session: this.session, endpoint: this.endpoint, language: this.language });
|
|
3148
|
+
}
|
|
3122
3149
|
playerElevateLeveLoadedHandler(event) {
|
|
3123
3150
|
if (!event.detail) {
|
|
3124
3151
|
return;
|
|
@@ -3152,6 +3179,11 @@ const PlayerElevatePointcard = class {
|
|
|
3152
3179
|
this.onDetailsClick();
|
|
3153
3180
|
} }, translate('termAndConditions', this.language))), this.pointExpireString && (index.h("div", { class: 'ExpirationPoints' }, this.pointExpireString, " "))))))))));
|
|
3154
3181
|
}
|
|
3182
|
+
static get watchers() { return {
|
|
3183
|
+
"session": ["onSessionOrEndpointChange"],
|
|
3184
|
+
"endpoint": ["onSessionOrEndpointChange"],
|
|
3185
|
+
"language": ["onSessionOrEndpointChange"]
|
|
3186
|
+
}; }
|
|
3155
3187
|
};
|
|
3156
3188
|
PlayerElevatePointcard.style = playerElevatePointcardCss;
|
|
3157
3189
|
|
|
@@ -1016,9 +1016,6 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1016
1016
|
promise = safeCall(instance, 'componentWillLoad');
|
|
1017
1017
|
}
|
|
1018
1018
|
}
|
|
1019
|
-
{
|
|
1020
|
-
promise = then(promise, () => safeCall(instance, 'componentWillRender'));
|
|
1021
|
-
}
|
|
1022
1019
|
endSchedule();
|
|
1023
1020
|
return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
1024
1021
|
};
|
|
@@ -1190,6 +1187,7 @@ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propNam
|
|
|
1190
1187
|
const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1191
1188
|
// check our new property value against our internal value
|
|
1192
1189
|
const hostRef = getHostRef(ref);
|
|
1190
|
+
const elm = hostRef.$hostElement$ ;
|
|
1193
1191
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1194
1192
|
const flags = hostRef.$flags$;
|
|
1195
1193
|
const instance = hostRef.$lazyInstance$ ;
|
|
@@ -1202,6 +1200,22 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1202
1200
|
// set our new value!
|
|
1203
1201
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1204
1202
|
if (instance) {
|
|
1203
|
+
// get an array of method names of watch functions to call
|
|
1204
|
+
if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
1205
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1206
|
+
if (watchMethods) {
|
|
1207
|
+
// this instance is watching for when this property changed
|
|
1208
|
+
watchMethods.map((watchMethodName) => {
|
|
1209
|
+
try {
|
|
1210
|
+
// fire off each of the watch methods that are watching this property
|
|
1211
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
1212
|
+
}
|
|
1213
|
+
catch (e) {
|
|
1214
|
+
consoleError(e, elm);
|
|
1215
|
+
}
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1205
1219
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1206
1220
|
// looks like this value actually changed, so we've got work to do!
|
|
1207
1221
|
// but only if we've already rendered, otherwise just chill out
|
|
@@ -1214,6 +1228,9 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1214
1228
|
};
|
|
1215
1229
|
const proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1216
1230
|
if (cmpMeta.$members$) {
|
|
1231
|
+
if (Cstr.watchers) {
|
|
1232
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1233
|
+
}
|
|
1217
1234
|
// It's better to have a const than two Object.entries()
|
|
1218
1235
|
const members = Object.entries(cmpMeta.$members$);
|
|
1219
1236
|
const prototype = Cstr.prototype;
|
|
@@ -1321,6 +1338,12 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1321
1338
|
endLoad();
|
|
1322
1339
|
}
|
|
1323
1340
|
if (!Cstr.isProxied) {
|
|
1341
|
+
// we've never proxied this Constructor before
|
|
1342
|
+
// let's add the getters/setters to its prototype before
|
|
1343
|
+
// the first time we create an instance of the implementation
|
|
1344
|
+
{
|
|
1345
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1346
|
+
}
|
|
1324
1347
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1325
1348
|
Cstr.isProxied = true;
|
|
1326
1349
|
}
|
|
@@ -1344,6 +1367,9 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
|
|
|
1344
1367
|
{
|
|
1345
1368
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1346
1369
|
}
|
|
1370
|
+
{
|
|
1371
|
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1372
|
+
}
|
|
1347
1373
|
endNewInstance();
|
|
1348
1374
|
}
|
|
1349
1375
|
if (Cstr.style) {
|
|
@@ -1481,6 +1507,9 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1481
1507
|
{
|
|
1482
1508
|
cmpMeta.$attrsToReflect$ = [];
|
|
1483
1509
|
}
|
|
1510
|
+
{
|
|
1511
|
+
cmpMeta.$watchers$ = {};
|
|
1512
|
+
}
|
|
1484
1513
|
const tagName = cmpMeta.$tagName$;
|
|
1485
1514
|
const HostElement = class extends HTMLElement {
|
|
1486
1515
|
// StencilLazyHost
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Prop, h, State, Listen, Fragment, getAssetPath } from '@stencil/core';
|
|
1
|
+
import { Component, Prop, h, State, Listen, Fragment, getAssetPath, Watch } from '@stencil/core';
|
|
2
2
|
import { PlayerAvatar, PlayerElevateCardRedeem, PlayerElevateLoyaltyLevel, PlayerLoyaltyProcess, PlayerNameDiv, PlayerPoints, } from './player-elevate-card-items';
|
|
3
3
|
import { TRANSLATIONS } from '../../utils/locale.utils';
|
|
4
4
|
export class PlayerElevateCard {
|
|
@@ -30,6 +30,9 @@ export class PlayerElevateCard {
|
|
|
30
30
|
this.translationUrl = '';
|
|
31
31
|
this.playerLevelFlag = 0;
|
|
32
32
|
}
|
|
33
|
+
onSessionOrEndpointChange() {
|
|
34
|
+
this.paramProxy = Object.assign(Object.assign({}, this.paramProxy), { session: this.session, endpoint: this.endpoint, language: this.language });
|
|
35
|
+
}
|
|
33
36
|
playerElevateLeveLoadedHandler(event) {
|
|
34
37
|
if (!event.detail) {
|
|
35
38
|
return;
|
|
@@ -272,6 +275,16 @@ export class PlayerElevateCard {
|
|
|
272
275
|
"playerElevateLevel": {},
|
|
273
276
|
"elevateWalletTotal": {}
|
|
274
277
|
}; }
|
|
278
|
+
static get watchers() { return [{
|
|
279
|
+
"propName": "session",
|
|
280
|
+
"methodName": "onSessionOrEndpointChange"
|
|
281
|
+
}, {
|
|
282
|
+
"propName": "endpoint",
|
|
283
|
+
"methodName": "onSessionOrEndpointChange"
|
|
284
|
+
}, {
|
|
285
|
+
"propName": "language",
|
|
286
|
+
"methodName": "onSessionOrEndpointChange"
|
|
287
|
+
}]; }
|
|
275
288
|
static get listeners() { return [{
|
|
276
289
|
"name": "playerElevateLeveLoaded",
|
|
277
290
|
"method": "playerElevateLeveLoadedHandler",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Prop, State, Event, Element, Listen, } from '@stencil/core';
|
|
1
|
+
import { Component, Prop, State, Event, Element, Listen, Watch } from '@stencil/core';
|
|
2
2
|
import { differenceInCalendarDays, differenceInHours, isBefore } from 'date-fns';
|
|
3
3
|
import { translateWithParams } from '../../utils/locale.utils';
|
|
4
4
|
import '@everymatrix/general-styling-wrapper';
|
|
@@ -7,6 +7,9 @@ export class PlayerElevateCardData {
|
|
|
7
7
|
handleWindowResizs() {
|
|
8
8
|
this.initLevelProgressbar();
|
|
9
9
|
}
|
|
10
|
+
onParamsChanged() {
|
|
11
|
+
this.loadElevateInfo();
|
|
12
|
+
}
|
|
10
13
|
onRedeemClick() {
|
|
11
14
|
window.postMessage({ type: 'BEERedeemClicked' }, window.location.href);
|
|
12
15
|
}
|
|
@@ -109,19 +112,14 @@ export class PlayerElevateCardData {
|
|
|
109
112
|
return;
|
|
110
113
|
}
|
|
111
114
|
this.setLoyaltyProgress(!this.playerElevateLevel.nextLevel
|
|
112
|
-
? 1
|
|
113
|
-
: (this.playerElevateLevel.loyaltyPoints -
|
|
114
|
-
this.playerElevateLevel.entryPoints) /
|
|
115
|
-
(this.playerElevateLevel.nextLevel.entryPoints -
|
|
116
|
-
this.playerElevateLevel.entryPoints));
|
|
115
|
+
? 1 : (this.playerElevateLevel.loyaltyPoints / this.playerElevateLevel.nextLevel.entryPoints));
|
|
117
116
|
this.params['playerElevateLevel'] = this.playerElevateLevel;
|
|
118
117
|
}, 80);
|
|
119
118
|
}
|
|
120
|
-
componentWillRender() { }
|
|
121
119
|
componentDidRender() {
|
|
122
120
|
this.initLevelProgressbar();
|
|
123
121
|
}
|
|
124
|
-
|
|
122
|
+
loadElevateInfo() {
|
|
125
123
|
if (!this.params.endpoint || !this.params.session) {
|
|
126
124
|
return;
|
|
127
125
|
}
|
|
@@ -151,6 +149,9 @@ export class PlayerElevateCardData {
|
|
|
151
149
|
});
|
|
152
150
|
});
|
|
153
151
|
}
|
|
152
|
+
componentWillLoad() {
|
|
153
|
+
this.loadElevateInfo();
|
|
154
|
+
}
|
|
154
155
|
static get is() { return "player-elevate-card-data"; }
|
|
155
156
|
static get originalStyleUrls() { return {
|
|
156
157
|
"$": ["player-elevate-card-data.scss"]
|
|
@@ -198,6 +199,10 @@ export class PlayerElevateCardData {
|
|
|
198
199
|
}
|
|
199
200
|
}]; }
|
|
200
201
|
static get elementRef() { return "elevateCardRef"; }
|
|
202
|
+
static get watchers() { return [{
|
|
203
|
+
"propName": "params",
|
|
204
|
+
"methodName": "onParamsChanged"
|
|
205
|
+
}]; }
|
|
201
206
|
static get listeners() { return [{
|
|
202
207
|
"name": "resize",
|
|
203
208
|
"method": "handleWindowResizs",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Fragment, getAssetPath, h, Listen, Prop, State } from '@stencil/core';
|
|
1
|
+
import { Component, Fragment, getAssetPath, h, Listen, Prop, State, Watch } from '@stencil/core';
|
|
2
2
|
import { PlayerAvatar, PlayerElevateLoyaltyLevel, PlayerLoyaltyProcess, PlayerPoints, } from '../player-elevate-card/player-elevate-card-items';
|
|
3
3
|
import { translateWithParams, TRANSLATIONS } from '../../utils/locale.utils';
|
|
4
4
|
export class PlayerElevateLoyaltycard {
|
|
@@ -29,6 +29,9 @@ export class PlayerElevateLoyaltycard {
|
|
|
29
29
|
*/
|
|
30
30
|
this.translationUrl = '';
|
|
31
31
|
}
|
|
32
|
+
onSessionOrEndpointChange() {
|
|
33
|
+
this.paramProxy = Object.assign(Object.assign({}, this.paramProxy), { session: this.session, endpoint: this.endpoint, language: this.language });
|
|
34
|
+
}
|
|
32
35
|
playerElevateLeveLoadedHandler(event) {
|
|
33
36
|
if (!event.detail) {
|
|
34
37
|
return;
|
|
@@ -47,7 +50,7 @@ export class PlayerElevateLoyaltycard {
|
|
|
47
50
|
window.postMessage({ type: 'BEERedeemClicked' }, window.location.href);
|
|
48
51
|
}
|
|
49
52
|
componentWillLoad() {
|
|
50
|
-
this.
|
|
53
|
+
this.paramProxy = {
|
|
51
54
|
endpoint: this.endpoint,
|
|
52
55
|
session: this.session,
|
|
53
56
|
language: this.language,
|
|
@@ -72,7 +75,7 @@ export class PlayerElevateLoyaltycard {
|
|
|
72
75
|
return (h("div", { class: `ElevateCardWrapper ${this.theme}` },
|
|
73
76
|
h("div", { class: "LoyaltyCard Outer", style: { 'backgroundImage': `url(${backgroundOuterImagePath}` } },
|
|
74
77
|
h("general-styling-wrapper", { clientStyling: this.clientStyling, clientStylingUrl: this.clientStylingUrl, targetTranslations: TRANSLATIONS, translationUrl: this.translationUrl }),
|
|
75
|
-
h("player-elevate-card-data", { params: this.
|
|
78
|
+
h("player-elevate-card-data", { params: this.paramProxy }),
|
|
76
79
|
h("div", { class: 'OuterCover Inner', style: { 'backgroundImage': `url(${backgroundInnerImagePath}` } },
|
|
77
80
|
h("div", { class: 'Content Row' }, this.playerElevateLevel && (h(Fragment, null,
|
|
78
81
|
h("div", { class: "PlayerImg" },
|
|
@@ -277,6 +280,16 @@ export class PlayerElevateLoyaltycard {
|
|
|
277
280
|
"playerElevateLevel": {},
|
|
278
281
|
"elevateWalletTotal": {}
|
|
279
282
|
}; }
|
|
283
|
+
static get watchers() { return [{
|
|
284
|
+
"propName": "session",
|
|
285
|
+
"methodName": "onSessionOrEndpointChange"
|
|
286
|
+
}, {
|
|
287
|
+
"propName": "endpoint",
|
|
288
|
+
"methodName": "onSessionOrEndpointChange"
|
|
289
|
+
}, {
|
|
290
|
+
"propName": "language",
|
|
291
|
+
"methodName": "onSessionOrEndpointChange"
|
|
292
|
+
}]; }
|
|
280
293
|
static get listeners() { return [{
|
|
281
294
|
"name": "playerElevateLeveLoaded",
|
|
282
295
|
"method": "playerElevateLeveLoadedHandler",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Fragment, getAssetPath, h, Listen, Prop, State } from '@stencil/core';
|
|
1
|
+
import { Component, Fragment, getAssetPath, h, Listen, Prop, State, Watch } from '@stencil/core';
|
|
2
2
|
import { translate, TRANSLATIONS } from '../../utils/locale.utils';
|
|
3
3
|
import { PlayerAvatar, PlayerPoints, } from '../player-elevate-card/player-elevate-card-items';
|
|
4
4
|
export class PlayerElevatePointcard {
|
|
@@ -38,6 +38,9 @@ export class PlayerElevatePointcard {
|
|
|
38
38
|
this.translationUrl = '';
|
|
39
39
|
this.isPointDetailCard = this.buttonType === 'earningRule';
|
|
40
40
|
}
|
|
41
|
+
onSessionOrEndpointChange() {
|
|
42
|
+
this.paramProxy = Object.assign(Object.assign({}, this.paramProxy), { session: this.session, endpoint: this.endpoint, language: this.language });
|
|
43
|
+
}
|
|
41
44
|
playerElevateLeveLoadedHandler(event) {
|
|
42
45
|
if (!event.detail) {
|
|
43
46
|
return;
|
|
@@ -313,6 +316,16 @@ export class PlayerElevatePointcard {
|
|
|
313
316
|
"elevateWalletTotal": {},
|
|
314
317
|
"elevateSPTotal": {}
|
|
315
318
|
}; }
|
|
319
|
+
static get watchers() { return [{
|
|
320
|
+
"propName": "session",
|
|
321
|
+
"methodName": "onSessionOrEndpointChange"
|
|
322
|
+
}, {
|
|
323
|
+
"propName": "endpoint",
|
|
324
|
+
"methodName": "onSessionOrEndpointChange"
|
|
325
|
+
}, {
|
|
326
|
+
"propName": "language",
|
|
327
|
+
"methodName": "onSessionOrEndpointChange"
|
|
328
|
+
}]; }
|
|
316
329
|
static get listeners() { return [{
|
|
317
330
|
"name": "playerElevateLeveLoaded",
|
|
318
331
|
"method": "playerElevateLeveLoadedHandler",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<svg width="100%" height="28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<rect y="12" width="100%" id="total_level" height="5" rx="2.5" fill="white" fill-opacity="0.5"/>
|
|
3
|
-
<rect y="12" id="current_level" width="64" height="5" rx="2.5" fill="white"/>
|
|
1
|
+
<svg width="100%" height="28" style="opacity: 0" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect y="12" x="2" width="100%" id="total_level" height="5" rx="2.5" fill="white" fill-opacity="0.5"/>
|
|
3
|
+
<rect y="12" x="2" id="current_level" width="64" height="5" rx="2.5" fill="white"/>
|
|
4
4
|
<g filter="url(#filter_current_level)">
|
|
5
5
|
<circle id="circle_current_level" cx="74.5" cy="14.5" r="6.5" fill="white"/>
|
|
6
6
|
</g>
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
export function updateProgressSvg(progressElementRef, percent) {
|
|
2
2
|
const svgElement = progressElementRef.querySelector('#total_level');
|
|
3
|
-
const endLockWidth =
|
|
3
|
+
const endLockWidth = 17, pointR = 6.5;
|
|
4
|
+
//Total Widget of the progress
|
|
4
5
|
const barWidth = svgElement.getBBox().width;
|
|
5
|
-
|
|
6
|
+
//The filled width according to current progress
|
|
7
|
+
const levelPercent = percent > 1 ? 1 : percent;
|
|
8
|
+
const widthOnBar = (levelPercent * barWidth - endLockWidth) < 0 ? 0 : levelPercent * barWidth - endLockWidth;
|
|
6
9
|
//update bar's width, widthOnBar
|
|
7
10
|
const levelBar = progressElementRef.querySelector('#current_level');
|
|
8
11
|
//update filters, x = widthOnBar
|
|
@@ -11,8 +14,8 @@ export function updateProgressSvg(progressElementRef, percent) {
|
|
|
11
14
|
const levelCircle = progressElementRef.querySelector('#circle_current_level');
|
|
12
15
|
svgElement.setAttribute('viewbox', `0 0 ${widthOnBar} 28`);
|
|
13
16
|
levelBar.setAttribute('width', `${widthOnBar}`);
|
|
14
|
-
levelCircle.setAttribute('cx', `${widthOnBar
|
|
15
|
-
levelFilter.setAttribute('x', `${widthOnBar -
|
|
17
|
+
levelCircle.setAttribute('cx', `${(widthOnBar < pointR ? pointR : widthOnBar)}`);
|
|
18
|
+
levelFilter.setAttribute('x', `${widthOnBar - 8}`);
|
|
16
19
|
//update lock location
|
|
17
20
|
const endLockElement = progressElementRef.querySelector('#lock');
|
|
18
21
|
// wrapper of endLock, include ball and heatfilter1_d_305_23
|
|
@@ -44,4 +47,5 @@ export function updateProgressSvg(progressElementRef, percent) {
|
|
|
44
47
|
filter1.setAttribute('x', `${cxOfEndLockEle - 6 - 2 - 2 - 4}`);
|
|
45
48
|
lockBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
|
|
46
49
|
heartBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
|
|
50
|
+
svgElement.parentElement.style.opacity = '1';
|
|
47
51
|
}
|
|
@@ -401,9 +401,12 @@ function isBefore(dirtyDate, dirtyDateToCompare) {
|
|
|
401
401
|
|
|
402
402
|
function updateProgressSvg(progressElementRef, percent) {
|
|
403
403
|
const svgElement = progressElementRef.querySelector('#total_level');
|
|
404
|
-
const endLockWidth =
|
|
404
|
+
const endLockWidth = 17, pointR = 6.5;
|
|
405
|
+
//Total Widget of the progress
|
|
405
406
|
const barWidth = svgElement.getBBox().width;
|
|
406
|
-
|
|
407
|
+
//The filled width according to current progress
|
|
408
|
+
const levelPercent = percent > 1 ? 1 : percent;
|
|
409
|
+
const widthOnBar = (levelPercent * barWidth - endLockWidth) < 0 ? 0 : levelPercent * barWidth - endLockWidth;
|
|
407
410
|
//update bar's width, widthOnBar
|
|
408
411
|
const levelBar = progressElementRef.querySelector('#current_level');
|
|
409
412
|
//update filters, x = widthOnBar
|
|
@@ -412,8 +415,8 @@ function updateProgressSvg(progressElementRef, percent) {
|
|
|
412
415
|
const levelCircle = progressElementRef.querySelector('#circle_current_level');
|
|
413
416
|
svgElement.setAttribute('viewbox', `0 0 ${widthOnBar} 28`);
|
|
414
417
|
levelBar.setAttribute('width', `${widthOnBar}`);
|
|
415
|
-
levelCircle.setAttribute('cx', `${widthOnBar
|
|
416
|
-
levelFilter.setAttribute('x', `${widthOnBar -
|
|
418
|
+
levelCircle.setAttribute('cx', `${(widthOnBar < pointR ? pointR : widthOnBar)}`);
|
|
419
|
+
levelFilter.setAttribute('x', `${widthOnBar - 8}`);
|
|
417
420
|
//update lock location
|
|
418
421
|
const endLockElement = progressElementRef.querySelector('#lock');
|
|
419
422
|
// wrapper of endLock, include ball and heatfilter1_d_305_23
|
|
@@ -445,9 +448,10 @@ function updateProgressSvg(progressElementRef, percent) {
|
|
|
445
448
|
filter1.setAttribute('x', `${cxOfEndLockEle - 6 - 2 - 2 - 4}`);
|
|
446
449
|
lockBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
|
|
447
450
|
heartBox.setAttribute('x', `${cxOfEndLockEle - 6}`);
|
|
451
|
+
svgElement.parentElement.style.opacity = '1';
|
|
448
452
|
}
|
|
449
453
|
|
|
450
|
-
const playerElevateCardDataCss = ":host {\n display: block;\n width: 360px;\n height: 230px;\n}\n\n.ElevateCardWrapper {\n contain: layout inline-size;\n width: 100%;\n height: fit-content;\n min-height: 218px;\n}\n\n.Outer {\n container-type: inline-size;\n font-size: 12px;\n background-size: cover;\n background-repeat: no-repeat;\n line-height: initial;\n width: 100%;\n height: 100%;\n}\n\n.Dark {\n color: var(--emfe-w-color-gray150, #efefef);\n}\n\n.Light {\n color: var(--emfe-w-color-black, #0e0e0e);\n}\n\n@container (min-width: 381px) {\n .Outer {\n background-size: cover;\n }\n .Outer .OuterCover {\n min-height: 190px;\n }\n}\n@container (min-width: 260px) {\n .Outer {\n background-size: contain;\n }\n}\n.OuterCover {\n width: 100%;\n height: 100%;\n content: \"\";\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 15px;\n}\n\n.Inner {\n display: flex;\n flex-direction: column;\n min-height: 158px;\n}\n.Inner .Content {\n padding: 15px;\n flex-wrap: wrap;\n gap: 8px;\n}\n.Inner .Row {\n display: flex;\n flex-direction: row;\n}\n.Inner .CardCell {\n display: flex;\n}\n.Inner .LevelInfo {\n display: flex;\n flex-direction: column;\n}\n.Inner .LevelInfo .ElevateLevel .LevelName {\n height: 28px;\n border-radius: 5px;\n line-height: 28px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.Inner .LevelInfo.Level0 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level0button-shadow, rgba(191, 84, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level0-bg0, #E2792C) 0%, var(--emfe-w-elevate-color-level0-bg1, rgba(242, 151, 99, 0)) 100%);\n}\n.Inner .LevelInfo.Level1 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level1button-shadow, rgba(151, 151, 151, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level1-bg0, #BEBFED) 0%, var(--emfe-w-elevate-color-level1-bg1, rgba(216, 217, 233, 0)) 100%);\n}\n.Inner .LevelInfo.Level2 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level2button-shadow, rgba(191, 120, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level2-bg0, #FCC410) 0%, var(--emfe-w-elevate-color-level2-bg1, rgba(255, 189, 43, 0)) 100%);\n}\n.Inner .LevelInfo.Level3 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level3button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level3-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level3-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo.Level4 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level4button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level4-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level4-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo .ElevateLevel {\n display: flex;\n}\n.Inner .LevelInfo {\n flex: 1;\n flex-grow: 1;\n min-width: 150px;\n}\n.Inner .PlayerImg {\n width: 29%;\n margin: auto;\n max-width: 100px;\n min-width: 30px;\n order: 0;\n}\n.Inner .PlayerAvatar {\n max-width: 100px;\n flex-basis: 100px;\n height: auto;\n margin: auto;\n padding-top: 10px;\n}\n.Inner .PlayerAvatar .Avatar, .Inner .PlayerAvatar .Badge {\n width: 100%;\n height: 100%;\n}\n.Inner .PlayerAvatar .Avatar {\n border-radius: 50%;\n background-size: contain;\n background-repeat: no-repeat;\n}\n.Inner .ElevateLevel .ExpirationDate {\n max-width: 138px;\n min-width: 118px;\n}\n.Inner .PlayerName, .Inner .RedeemButton, .Inner .ElevateLevel {\n text-transform: capitalize;\n width: 100%;\n}\n.Inner .PlayerName {\n font-size: 16px;\n}\n.Inner .Row .PointsInfo {\n display: table;\n font-weight: 600;\n}\n.Inner .Row .Redeem {\n justify-content: flex-end;\n margin-left: auto;\n}\n.Inner .Row .Redeem:hover {\n color: var(--emfe-w-elevate-color-redeem-hover, #00ABA4);\n cursor: pointer;\n}\n.Inner .Row .RedeemButton:hover span {\n color: var(emfe-w-elevate-color-redeem-text-hover, #f1f1f1);\n font-weight: bold;\n}\n.Inner .Row .RedeemButton {\n width: 95px;\n height: 35px;\n display: flex;\n align-items: center;\n border-radius: 10px;\n background: var(--emfe-w-elevate-color-redeem-bg, linear-gradient(0deg, #26CC37, #26CC37)), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);\n box-shadow: 0px 4px 4px 0px #00000040;\n}\n.Inner .Row .RedeemButton span {\n color: var(--emfe-w-color-white, #fff);\n line-height: 18px;\n font-size: 15px;\n text-align: center;\n width: 100%;\n}\n.Inner .Row .Points {\n font-size: large;\n vertical-align: middle;\n}\n.Inner .Row .Points .XP {\n font-size: x-small;\n}\n.Inner .Row .ExpirationPoints {\n font-size: small;\n text-align: right;\n font-weight: bold;\n color: var(--emfe-w-color-red, #9e595f);\n}";
|
|
454
|
+
const playerElevateCardDataCss = ":host {\n display: block;\n width: 360px;\n height: 230px;\n}\n\n.ElevateCardWrapper {\n contain: layout inline-size;\n width: 100%;\n height: fit-content;\n min-height: 218px;\n}\n\n.Outer {\n container-type: inline-size;\n font-size: 12px;\n background-size: cover;\n background-repeat: no-repeat;\n line-height: initial;\n width: 100%;\n height: 100%;\n}\n\n.Dark {\n color: var(--emfe-w-color-gray150, #efefef);\n}\n\n.Light {\n color: var(--emfe-w-color-black, #0e0e0e);\n}\n\n@container (min-width: 381px) {\n .Outer {\n background-size: cover;\n }\n .Outer .OuterCover {\n min-height: 190px;\n }\n}\n@container (min-width: 260px) {\n .Outer {\n background-size: contain;\n }\n}\n.OuterCover {\n width: 100%;\n height: 100%;\n content: \"\";\n background-repeat: no-repeat;\n background-size: cover;\n border-radius: 15px;\n}\n\n.Inner {\n display: flex;\n flex-direction: column;\n min-height: 158px;\n}\n.Inner .Content {\n padding: 15px;\n flex-wrap: wrap;\n gap: 8px;\n}\n.Inner .Row {\n display: flex;\n flex-direction: row;\n}\n.Inner .CardCell {\n display: flex;\n}\n.Inner .LevelProgress svg {\n transition: opacity 0.4s;\n}\n.Inner .LevelInfo {\n display: flex;\n flex-direction: column;\n}\n.Inner .LevelInfo .ElevateLevel .LevelName {\n height: 28px;\n border-radius: 5px;\n line-height: 28px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.Inner .LevelInfo.Level0 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level0button-shadow, rgba(191, 84, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level0-bg0, #E2792C) 0%, var(--emfe-w-elevate-color-level0-bg1, rgba(242, 151, 99, 0)) 100%);\n}\n.Inner .LevelInfo.Level1 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level1button-shadow, rgba(151, 151, 151, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level1-bg0, #BEBFED) 0%, var(--emfe-w-elevate-color-level1-bg1, rgba(216, 217, 233, 0)) 100%);\n}\n.Inner .LevelInfo.Level2 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level2button-shadow, rgba(191, 120, 6, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level2-bg0, #FCC410) 0%, var(--emfe-w-elevate-color-level2-bg1, rgba(255, 189, 43, 0)) 100%);\n}\n.Inner .LevelInfo.Level3 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level3button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level3-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level3-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo.Level4 .ElevateLevel .LevelName {\n box-shadow: -2px -2px 7px 0px var(--emfe-w-elevate-color-level4button-shadow, rgba(65, 6, 191, 0.75));\n background: linear-gradient(180deg, var(--emfe-w-elevate-color-level4-bg0, #B1A2DB) 0%, var(--emfe-w-elevate-color-level4-bg1, rgba(203, 202, 245, 0)) 100%);\n}\n.Inner .LevelInfo .ElevateLevel {\n display: flex;\n}\n.Inner .LevelInfo {\n flex: 1;\n flex-grow: 1;\n min-width: 150px;\n}\n.Inner .PlayerImg {\n width: 29%;\n margin: auto;\n max-width: 100px;\n min-width: 30px;\n order: 0;\n}\n.Inner .PlayerAvatar {\n max-width: 100px;\n flex-basis: 100px;\n height: auto;\n margin: auto;\n padding-top: 10px;\n}\n.Inner .PlayerAvatar .Avatar, .Inner .PlayerAvatar .Badge {\n width: 100%;\n height: 100%;\n}\n.Inner .PlayerAvatar .Avatar {\n border-radius: 50%;\n background-size: contain;\n background-repeat: no-repeat;\n}\n.Inner .ElevateLevel .ExpirationDate {\n max-width: 138px;\n min-width: 118px;\n}\n.Inner .PlayerName, .Inner .RedeemButton, .Inner .ElevateLevel {\n text-transform: capitalize;\n width: 100%;\n}\n.Inner .PlayerName {\n font-size: 16px;\n}\n.Inner .Row .PointsInfo {\n display: table;\n font-weight: 600;\n}\n.Inner .Row .Redeem {\n justify-content: flex-end;\n margin-left: auto;\n}\n.Inner .Row .Redeem:hover {\n color: var(--emfe-w-elevate-color-redeem-hover, #00ABA4);\n cursor: pointer;\n}\n.Inner .Row .RedeemButton:hover span {\n color: var(emfe-w-elevate-color-redeem-text-hover, #f1f1f1);\n font-weight: bold;\n}\n.Inner .Row .RedeemButton {\n width: 95px;\n height: 35px;\n display: flex;\n align-items: center;\n border-radius: 10px;\n background: var(--emfe-w-elevate-color-redeem-bg, linear-gradient(0deg, #26CC37, #26CC37)), linear-gradient(117.99deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.89%), linear-gradient(283.85deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 33.47%), linear-gradient(268.18deg, rgba(255, 255, 255, 0.6) -17.36%, rgba(239, 239, 239, 0) 15.78%);\n box-shadow: 0px 4px 4px 0px #00000040;\n}\n.Inner .Row .RedeemButton span {\n color: var(--emfe-w-color-white, #fff);\n line-height: 18px;\n font-size: 15px;\n text-align: center;\n width: 100%;\n}\n.Inner .Row .Points {\n font-size: large;\n vertical-align: middle;\n}\n.Inner .Row .Points .XP {\n font-size: x-small;\n}\n.Inner .Row .ExpirationPoints {\n font-size: small;\n text-align: right;\n font-weight: bold;\n color: var(--emfe-w-color-red, #9e595f);\n}";
|
|
451
455
|
|
|
452
456
|
const PlayerElevateCardData = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
453
457
|
constructor() {
|
|
@@ -458,6 +462,9 @@ const PlayerElevateCardData = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
|
458
462
|
handleWindowResizs() {
|
|
459
463
|
this.initLevelProgressbar();
|
|
460
464
|
}
|
|
465
|
+
onParamsChanged() {
|
|
466
|
+
this.loadElevateInfo();
|
|
467
|
+
}
|
|
461
468
|
onRedeemClick() {
|
|
462
469
|
window.postMessage({ type: 'BEERedeemClicked' }, window.location.href);
|
|
463
470
|
}
|
|
@@ -558,19 +565,14 @@ const PlayerElevateCardData = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
|
558
565
|
return;
|
|
559
566
|
}
|
|
560
567
|
this.setLoyaltyProgress(!this.playerElevateLevel.nextLevel
|
|
561
|
-
? 1
|
|
562
|
-
: (this.playerElevateLevel.loyaltyPoints -
|
|
563
|
-
this.playerElevateLevel.entryPoints) /
|
|
564
|
-
(this.playerElevateLevel.nextLevel.entryPoints -
|
|
565
|
-
this.playerElevateLevel.entryPoints));
|
|
568
|
+
? 1 : (this.playerElevateLevel.loyaltyPoints / this.playerElevateLevel.nextLevel.entryPoints));
|
|
566
569
|
this.params['playerElevateLevel'] = this.playerElevateLevel;
|
|
567
570
|
}, 80);
|
|
568
571
|
}
|
|
569
|
-
componentWillRender() { }
|
|
570
572
|
componentDidRender() {
|
|
571
573
|
this.initLevelProgressbar();
|
|
572
574
|
}
|
|
573
|
-
|
|
575
|
+
loadElevateInfo() {
|
|
574
576
|
if (!this.params.endpoint || !this.params.session) {
|
|
575
577
|
return;
|
|
576
578
|
}
|
|
@@ -600,7 +602,13 @@ const PlayerElevateCardData = /*@__PURE__*/ proxyCustomElement(class extends HTM
|
|
|
600
602
|
});
|
|
601
603
|
});
|
|
602
604
|
}
|
|
605
|
+
componentWillLoad() {
|
|
606
|
+
this.loadElevateInfo();
|
|
607
|
+
}
|
|
603
608
|
get elevateCardRef() { return this; }
|
|
609
|
+
static get watchers() { return {
|
|
610
|
+
"params": ["onParamsChanged"]
|
|
611
|
+
}; }
|
|
604
612
|
static get style() { return playerElevateCardDataCss; }
|
|
605
613
|
}, [0, "player-elevate-card-data", {
|
|
606
614
|
"params": [8],
|