cas-ds-web-components 1.2.82 → 1.2.83
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/build/cas-ds-web-components.js +103 -103
- package/build/cas-header.js +1 -1
- package/package.json +1 -1
package/build/cas-header.js
CHANGED
|
@@ -11888,7 +11888,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
11888
11888
|
// img {
|
|
11889
11889
|
// filter: none;
|
|
11890
11890
|
// }
|
|
11891
|
-
`,C==null||C.appendChild(t)}else{const t=document.querySelector('[data-name="eloisa-ds-dark-mode"]');t==null||t.remove()}}handleEvents(){const C=i=>{this.setAttribute("darkMode",i.detail.isDark)},t=()=>{this.handleTheme({theme:"dark"})},e=()=>{this.handleTheme({theme:"light"})};document.addEventListener("themeChange",C),document.addEventListener("onDarkMode",t),document.addEventListener("onLightMode",e),setTimeout(()=>{const i=this.disableMode==="true";this.darkMode==="true"&&!i&&t(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(a){!localStorage.getItem("theme")&&!i&&(a.matches?t():e())})},1e3)}async handleAlert(){const C=
|
|
11891
|
+
`,C==null||C.appendChild(t)}else{const t=document.querySelector('[data-name="eloisa-ds-dark-mode"]');t==null||t.remove()}}handleEvents(){const C=i=>{this.setAttribute("darkMode",i.detail.isDark)},t=()=>{this.handleTheme({theme:"dark"})},e=()=>{this.handleTheme({theme:"light"})};document.addEventListener("themeChange",C),document.addEventListener("onDarkMode",t),document.addEventListener("onLightMode",e),setTimeout(()=>{const i=this.disableMode==="true";this.darkMode==="true"&&!i&&t(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(a){!localStorage.getItem("theme")&&!i&&(a.matches?t():e())})},1e3)}async handleAlert(){const C=new WebSocket("wss://sjm3jibuni.execute-api.us-east-1.amazonaws.com/prod");C.onopen=function(){C.send(JSON.stringify({action:"getAlert"}))},C.onmessage=t=>{const e=JSON.parse(t.data);if((e==null?void 0:e.type)==="getAlert"){const{showAlert:i,alert:l}=e;if(i){if(console.log(l),!l||!l.enabled)return!1;let a=new Date,n=new Date(l==null?void 0:l.startDate),h=new Date(l==null?void 0:l.endDate);if(a>n&&a<h)this.showAlert=i,this.alert={title:l==null?void 0:l.Titulo,text:l==null?void 0:l.Contenido,active:l==null?void 0:l.enabled},console.log("Alerta activa"),this.delay(200).then(()=>this.handleSpaces());else return!1;this.requestUpdate()}}}}async delay(C){return new Promise(t=>setTimeout(t,C))}async handleSpaces(){var l,a,n;const C=this.shadowRoot.querySelector("cas-header-taxonomy"),t=(l=this.shadowRoot.querySelector("cas-header-head"))==null?void 0:l.getClientRects()[0].height,e=(a=this.shadowRoot.querySelector("cas-header-pre-head"))==null?void 0:a.getClientRects()[0].height,i=(n=this.shadowRoot.querySelector("cas-header-taxonomy"))==null?void 0:n.getClientRects()[0].height;if(this.showAlert){const h=this.shadowRoot.querySelector("cas-alert");h==null||h.addEventListener("close",()=>{this.showAlert=!1,this.spaceHeight=t+e+i,C.style.top=`${t+e}px`,this.requestUpdate()});const r=h==null?void 0:h.getClientRects()[0].height;this.type!==G.HOME?this.spaceHeight=t+r:(this.spaceHeight=t+e+i+r,C.style.top=`${t+e+r}px`)}else this.type!==G.HOME?this.spaceHeight=t:(this.spaceHeight=t+e+i,C.style.top=`${t+e}px`);this.requestUpdate()}async firstUpdated(){const C=this.disableMode==="true",{theme:t}=jc(this.darkMode);this.theme=C?"light":t,this.defaultDarkMode(),this.handleEvents(),await this.handleAlert(),await this.delay(200),this.handleSpaces()}render(){const{alert:C,type:t,bookingBox:e,theme:i}=this,l=e==="true";return u`
|
|
11892
11892
|
<header class="container ${this.type}" data-theme=${i} style="height: ${this.spaceHeight}px">
|
|
11893
11893
|
${this.showAlert?u`<cas-alert
|
|
11894
11894
|
showCloseButton
|