@everymatrix/general-footer-template 1.80.5 → 1.80.7
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-footer-template.cjs.entry.js +7 -0
- package/dist/collection/components/general-footer-template/general-footer-template.js +7 -0
- package/dist/esm/general-footer-template.entry.js +7 -0
- package/dist/general-footer-template/general-footer-template.entry.js +1 -1
- package/package.json +1 -1
|
@@ -151,6 +151,13 @@ const GeneralFooterTemplate = class {
|
|
|
151
151
|
}
|
|
152
152
|
else {
|
|
153
153
|
const footerSections = this.sectionsList.map((section, i) => {
|
|
154
|
+
var _a;
|
|
155
|
+
const repeater = (_a = this.footerContent.repeaters) === null || _a === void 0 ? void 0 : _a[section];
|
|
156
|
+
const repeaterContent = repeater === null || repeater === void 0 ? void 0 : repeater.content;
|
|
157
|
+
// filter out empty sections
|
|
158
|
+
if (!Array.isArray(repeaterContent) || (repeaterContent === null || repeaterContent === void 0 ? void 0 : repeaterContent.length) === 0) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
154
161
|
const FooterElement = utils.componentRules[section].component;
|
|
155
162
|
const elementIsRepeater = this.footerContent.repeaters.hasOwnProperty(section);
|
|
156
163
|
const elementIsCustom = this.footerContent.wysiwyg.hasOwnProperty(section);
|
|
@@ -87,6 +87,13 @@ export class GeneralFooterTemplate {
|
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
89
|
const footerSections = this.sectionsList.map((section, i) => {
|
|
90
|
+
var _a;
|
|
91
|
+
const repeater = (_a = this.footerContent.repeaters) === null || _a === void 0 ? void 0 : _a[section];
|
|
92
|
+
const repeaterContent = repeater === null || repeater === void 0 ? void 0 : repeater.content;
|
|
93
|
+
// filter out empty sections
|
|
94
|
+
if (!Array.isArray(repeaterContent) || (repeaterContent === null || repeaterContent === void 0 ? void 0 : repeaterContent.length) === 0) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
90
97
|
const FooterElement = componentRules[section].component;
|
|
91
98
|
const elementIsRepeater = this.footerContent.repeaters.hasOwnProperty(section);
|
|
92
99
|
const elementIsCustom = this.footerContent.wysiwyg.hasOwnProperty(section);
|
|
@@ -147,6 +147,13 @@ const GeneralFooterTemplate = class {
|
|
|
147
147
|
}
|
|
148
148
|
else {
|
|
149
149
|
const footerSections = this.sectionsList.map((section, i) => {
|
|
150
|
+
var _a;
|
|
151
|
+
const repeater = (_a = this.footerContent.repeaters) === null || _a === void 0 ? void 0 : _a[section];
|
|
152
|
+
const repeaterContent = repeater === null || repeater === void 0 ? void 0 : repeater.content;
|
|
153
|
+
// filter out empty sections
|
|
154
|
+
if (!Array.isArray(repeaterContent) || (repeaterContent === null || repeaterContent === void 0 ? void 0 : repeaterContent.length) === 0) {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
150
157
|
const FooterElement = componentRules[section].component;
|
|
151
158
|
const elementIsRepeater = this.footerContent.repeaters.hasOwnProperty(section);
|
|
152
159
|
const elementIsCustom = this.footerContent.wysiwyg.hasOwnProperty(section);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as n,h as e,g as t}from"./index-2051e205.js";import{g as o,n as i,c as r}from"./utils-c4781120.js";function a(n,e){if(n){const t=document.createElement("style");t.innerHTML=e,n.appendChild(t)}}const s=class{constructor(e){n(this,e),this.platform=o(),this.MANDATORY_FIELDS=["endpoint","language","sections"],this.language=void 0,this.sections=void 0,this.endpoint=void 0,this.env="stage",this.userRoles="everyone",this.userid=void 0,this.session=void 0,this.baseUrl=void 0,this.navigateViaEvent="false",this.postMessageEvent="NavigateTo",this.clientStyling="",this.clientStylingUrl="",this.customCss=void 0,this.translationUrl="",this.clockFormat="HH:MM:ss",this.timeZone="",this.mbSource=void 0,this.accordionLinks=!1,this.hasErrors=!1,this.footerContent=void 0}validateMandatoryFields(){this.MANDATORY_FIELDS.forEach((n=>{this[n]||(console.error(`Mandatory parameter ${n} not received`),this.hasErrors=!0)}))}watchLanguage(n,e){n&&e&&n!=e&&this.setFooterData()}setFooterData(){this.sectionsList=this.sections.split(",").map((n=>n.trim()));const n=new URL(`${this.endpoint}/${this.language}/footer-raw-data`);return n.searchParams.append("env",this.env),n.searchParams.append("device",this.platform),n.searchParams.append("userRoles",this.userRoles),this.validateMandatoryFields(),fetch(n.href).then((n=>n.json())).then((n=>{0===Object.keys(n).length?this.hasErrors=!0:this.footerContent=i(n)}))}async componentWillLoad(){await this.setFooterData()}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentDidLoad(){null!=window.emMessageBus?function(n,e){if(window.emMessageBus){const t=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{t.innerHTML=e,n&&n.appendChild(t)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&a(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&function(n,e){const t=new URL(e);fetch(t.href).then((n=>n.text())).then((e=>{const t=document.createElement("style");t.innerHTML=e,n&&n.appendChild(t)})).catch((n=>{console.error("There was an error while trying to load client styling from URL",n)}))}(this.stylingContainer,this.clientStylingUrl),this.customCss=this.footerContent.wysiwyg.customCSS.content,this.customCss&&a(this.hostEl.shadowRoot,this.customCss))}render(){if(this.hasErrors)return e("div",null,"There was an error while bootstraping the widget");{const n=this.sectionsList.map(((n,t)=>{const o=r[n].component,
|
|
1
|
+
import{r as n,h as e,g as t}from"./index-2051e205.js";import{g as o,n as i,c as r}from"./utils-c4781120.js";function a(n,e){if(n){const t=document.createElement("style");t.innerHTML=e,n.appendChild(t)}}const s=class{constructor(e){n(this,e),this.platform=o(),this.MANDATORY_FIELDS=["endpoint","language","sections"],this.language=void 0,this.sections=void 0,this.endpoint=void 0,this.env="stage",this.userRoles="everyone",this.userid=void 0,this.session=void 0,this.baseUrl=void 0,this.navigateViaEvent="false",this.postMessageEvent="NavigateTo",this.clientStyling="",this.clientStylingUrl="",this.customCss=void 0,this.translationUrl="",this.clockFormat="HH:MM:ss",this.timeZone="",this.mbSource=void 0,this.accordionLinks=!1,this.hasErrors=!1,this.footerContent=void 0}validateMandatoryFields(){this.MANDATORY_FIELDS.forEach((n=>{this[n]||(console.error(`Mandatory parameter ${n} not received`),this.hasErrors=!0)}))}watchLanguage(n,e){n&&e&&n!=e&&this.setFooterData()}setFooterData(){this.sectionsList=this.sections.split(",").map((n=>n.trim()));const n=new URL(`${this.endpoint}/${this.language}/footer-raw-data`);return n.searchParams.append("env",this.env),n.searchParams.append("device",this.platform),n.searchParams.append("userRoles",this.userRoles),this.validateMandatoryFields(),fetch(n.href).then((n=>n.json())).then((n=>{0===Object.keys(n).length?this.hasErrors=!0:this.footerContent=i(n)}))}async componentWillLoad(){await this.setFooterData()}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentDidLoad(){null!=window.emMessageBus?function(n,e){if(window.emMessageBus){const t=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{t.innerHTML=e,n&&n.appendChild(t)}))}}(this.stylingContainer,`${this.mbSource}.Style`):(this.clientStyling&&a(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&function(n,e){const t=new URL(e);fetch(t.href).then((n=>n.text())).then((e=>{const t=document.createElement("style");t.innerHTML=e,n&&n.appendChild(t)})).catch((n=>{console.error("There was an error while trying to load client styling from URL",n)}))}(this.stylingContainer,this.clientStylingUrl),this.customCss=this.footerContent.wysiwyg.customCSS.content,this.customCss&&a(this.hostEl.shadowRoot,this.customCss))}render(){if(this.hasErrors)return e("div",null,"There was an error while bootstraping the widget");{const n=this.sectionsList.map(((n,t)=>{var o;const i=null===(o=this.footerContent.repeaters)||void 0===o?void 0:o[n],a=null==i?void 0:i.content;if(!Array.isArray(a)||0===(null==a?void 0:a.length))return null;const s=r[n].component,d=this.footerContent.repeaters.hasOwnProperty(n),c=this.footerContent.wysiwyg.hasOwnProperty(n);return e(s,{class:`${n} FooterSectionContainer FooterSectionContainer${t+1}`,userid:this.userid,session:this.session,"base-url":this.baseUrl,endpoint:this.endpoint,language:this.language,"navigate-via-event":this.navigateViaEvent,"post-message-event":this.postMessageEvent,ruleset:r[n],repeaterContent:d?this.footerContent.repeaters[n]:null,customContent:c?this.footerContent.wysiwyg[n].content:null,"translation-url":this.translationUrl,"clock-format":this.clockFormat,"time-zone":this.timeZone,"accordion-links":this.accordionLinks})}));return e("footer",{class:"FooterContainer",ref:n=>this.stylingContainer=n},e("div",{class:"FooterGrid customStyle"},n))}}get hostEl(){return t(this)}static get watchers(){return{language:["watchLanguage"]}}};s.style=':host {\n display: block;\n}\n\n/* $-background-primary: #14202d; */\n* {\n font-family: sans-serif;\n}\n\nhtml,\nbody {\n margin: 0;\n padding: 0;\n font-family: inherit;\n}\n\n.FooterSectionContainer {\n color: var(--emw--footer-typography, var(--emw--color-thpography, #fff));\n padding: 15px 20px 0;\n}\n\n/* // FOOTER CONTAINER - only serves to be read as a container */\n.FooterContainer {\n container-type: inline-size;\n container-name: footerContainer;\n}\n\n.FooterGrid {\n background-color: var(--emw--footer-color-bg, var(--emw--color-background, #0E1511));\n display: grid;\n grid-template-rows: repeat(9, auto);\n grid-template-areas: "one" "two" "three" "four" "five" "six" "seven";\n}\n\n.FooterSectionContainer1 {\n position: relative;\n grid-area: one;\n}\n\n.FooterSectionContainer2 {\n position: relative;\n grid-area: two;\n}\n\n.FooterSectionContainer3 {\n position: relative;\n grid-area: three;\n}\n\n.FooterSectionContainer4 {\n position: relative;\n grid-area: four;\n}\n\n.FooterSectionContainer5 {\n grid-area: five;\n}\n\n.FooterSectionContainer6 {\n padding-top: 22px;\n grid-area: six;\n}\n\n.FooterSectionContainer7 {\n grid-area: seven;\n}\n\n/* // remove paddings */\n.FooterSectionContainer7 div {\n padding: 0;\n}\n\n@container (max-width: 750px) {\n .FooterSectionContainer3:after,\n .FooterSectionContainer2:after {\n position: absolute;\n content: "";\n height: 1px;\n width: 90%;\n background-color: var(--emw--color-gray-100, #444);\n }\n .FooterSectionContainer5 {\n grid-area: five;\n background-color: var(--emw--color-background-secondary, #060706);\n padding: 30px 0;\n font-size: var(--emw--font-size-medium, 16px);\n min-height: var(--emw--size-medium-plus, 100px);\n justify-self: center;\n }\n}\n/* // STYLES FOR TABLET / DESKTOP */\n@container (min-width: 750px) {\n .FooterGrid {\n background: var(--emw--footer-color-bg, var(--emw--color-background, #0E1511));\n display: grid;\n border-top: 5px solid var(--emw--footer-color-primary, var(--emw--color-primary, #22B04E));\n grid-template-rows: repeat(5, auto);\n grid-template-columns: 1fr 1fr 1fr 1fr;\n grid-template-areas: "one two two two" "one three three three" "one four four four" "one five five five" "one six six six" "seven seven seven seven" "eight eight eight eight" "nine nine nine nine";\n }\n .FooterSectionContainer1 {\n padding: 30px 40px;\n grid-area: one;\n background: var(--emw--color-background, #000000);\n }\n .FooterSectionContainer2 {\n grid-area: two;\n min-height: var(--emw--size-4x-medium, 500px);\n }\n .FooterSectionContainer3 {\n grid-area: three;\n }\n .FooterSectionContainer4 {\n grid-area: four;\n }\n .FooterSectionContainer5 {\n grid-area: five;\n background-color: var(--emw--color-background-secondary, #091217);\n padding: var(--emw--spacing-x-large, 30px) 0;\n font-size: var(--emw--font-size-medium, 16px);\n min-height: var(--emw--size-medium-plus, 100px);\n }\n .FooterSectionContainer6 {\n grid-area: six;\n padding: 0;\n }\n .FooterSectionContainer7 {\n grid-area: seven;\n padding: 0;\n }\n /* // remove paddings */\n .FooterSectionContainer5 .CustomContentSectionWrapper {\n padding: 0;\n }\n .FooterSectionContainer5 .CustomContentSectionWrapper div {\n display: flex;\n flex-direction: left;\n align-items: center;\n padding-left: var(--emw--spacing-large, 20px);\n }\n .FooterSectionContainer5 .CustomContentSectionWrapper div p {\n margin: var(--emw--spacing-2x-small, 5px);\n text-align: center;\n }\n .FooterSectionContainer6 .CustomContentSectionWrapper div p {\n text-align: center;\n }\n .FooterSectionContainer6 .ImageListWrapper {\n padding: 0;\n }\n .FooterSectionContainer6 .ImageListWrapper {\n padding: 0;\n }\n .FooterSectionContainer7 .CustomContentSectionWrapper {\n padding: 0;\n padding-bottom: var(--emw--spacing-large, 22px);\n font-size: var(--emw--font-size-small, 14px);\n }\n}';export{s as general_footer_template}
|