cas-ds-web-components 1.2.127 → 1.2.128
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(F,x1){typeof exports=="object"&&typeof module<"u"?x1(exports):typeof define=="function"&&define.amd?define(["exports"],x1):(F=typeof globalThis<"u"?globalThis:F||self,x1(F["all-components"]={}))})(this,function(F){"use strict";var uH=Object.defineProperty;var MH=(F,x1,J2)=>x1 in F?uH(F,x1,{enumerable:!0,configurable:!0,writable:!0,value:J2}):F[x1]=J2;var H=(F,x1,J2)=>(MH(F,typeof x1!="symbol"?x1+"":x1,J2),J2);var o6,io;(()=>{const e=document.createElement("link");e.setAttribute("href","https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap"),e.setAttribute("rel","stylesheet"),document.head.appendChild(e)})();const T4={name:"@eloisa-ds/all-components",version:"1.0.
|
|
1
|
+
(function(F,x1){typeof exports=="object"&&typeof module<"u"?x1(exports):typeof define=="function"&&define.amd?define(["exports"],x1):(F=typeof globalThis<"u"?globalThis:F||self,x1(F["all-components"]={}))})(this,function(F){"use strict";var uH=Object.defineProperty;var MH=(F,x1,J2)=>x1 in F?uH(F,x1,{enumerable:!0,configurable:!0,writable:!0,value:J2}):F[x1]=J2;var H=(F,x1,J2)=>(MH(F,typeof x1!="symbol"?x1+"":x1,J2),J2);var o6,io;(()=>{const e=document.createElement("link");e.setAttribute("href","https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap"),e.setAttribute("rel","stylesheet"),document.head.appendChild(e)})();const T4={name:"@eloisa-ds/all-components",version:"1.0.130",dependencies:{},main:"./index.js",module:"./index.mjs",typings:"./index.d.ts",private:!0};/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -12677,7 +12677,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
12677
12677
|
// img {
|
|
12678
12678
|
// filter: none;
|
|
12679
12679
|
// }
|
|
12680
|
-
`,C==null||C.appendChild(t)}else{const t=document.querySelector('[data-name="eloisa-ds-dark-mode"]');t==null||t.remove()}}handleEvents(){const C=o=>{this.setAttribute("darkMode",o.detail.isDark)},t=()=>{this.handleTheme({theme:"dark"})},i=()=>{this.handleTheme({theme:"light"})};document.addEventListener("themeChange",C),document.addEventListener("onDarkMode",t),document.addEventListener("onLightMode",i),setTimeout(()=>{const o=this.disableMode==="true";this.darkMode==="true"&&!o&&t(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(l){!localStorage.getItem("theme")&&!o&&(l.matches?t():i())})},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 i=JSON.parse(t.data);if((i==null?void 0:i.type)==="getAlert"){const{showAlert:o,alert:a}=i;if(o){if(console.log(a),!a||!a.enabled)return!1;let l=new Date,r=new Date(a==null?void 0:a.startDate),n=new Date(a==null?void 0:a.endDate);if(l>r&&l<n)this.showAlert
|
|
12680
|
+
`,C==null||C.appendChild(t)}else{const t=document.querySelector('[data-name="eloisa-ds-dark-mode"]');t==null||t.remove()}}handleEvents(){const C=o=>{this.setAttribute("darkMode",o.detail.isDark)},t=()=>{this.handleTheme({theme:"dark"})},i=()=>{this.handleTheme({theme:"light"})};document.addEventListener("themeChange",C),document.addEventListener("onDarkMode",t),document.addEventListener("onLightMode",i),setTimeout(()=>{const o=this.disableMode==="true";this.darkMode==="true"&&!o&&t(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(l){!localStorage.getItem("theme")&&!o&&(l.matches?t():i())})},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 i=JSON.parse(t.data);if((i==null?void 0:i.type)==="getAlert"){const{showAlert:o,alert:a}=i;if(o){if(console.log(a),!a||!a.enabled)return!1;let l=new Date,r=new Date(a==null?void 0:a.startDate),n=new Date(a==null?void 0:a.endDate);if(l>r&&l<n){let h=sessionStorage.getItem("hideAlert");this.showAlert=!h&&o,this.alert={title:a==null?void 0:a.Titulo,text:a==null?void 0:a.Contenido,active:a==null?void 0:a.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 a,l,r;const C=this.shadowRoot.querySelector("cas-header-taxonomy"),t=(a=this.shadowRoot.querySelector("cas-header-head"))==null?void 0:a.getClientRects()[0].height,i=(l=this.shadowRoot.querySelector("cas-header-pre-head"))==null?void 0:l.getClientRects()[0].height,o=(r=this.shadowRoot.querySelector("cas-header-taxonomy"))==null?void 0:r.getClientRects()[0].height;if(this.showAlert){const n=this.shadowRoot.querySelector("cas-alert");n==null||n.addEventListener("close",()=>{sessionStorage.setItem("hideAlert","true"),this.showAlert=!1,this.spaceHeight=t+i+o,C.style.top=`${t+i}px`,this.requestUpdate()});const h=n==null?void 0:n.getClientRects()[0].height;this.type!==A1.HOME?this.spaceHeight=t+h:(this.spaceHeight=t+i+o+h,C.style.top=`${t+i+h}px`)}else this.type!==A1.HOME?this.spaceHeight=t:(this.spaceHeight=t+i+o,C.style.top=`${t+i}px`);this.requestUpdate()}async firstUpdated(){const C=this.disableMode==="true",{theme:t}=uu(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:i,theme:o}=this,a=i==="true";return w`
|
|
12681
12681
|
<header class="container ${this.type}" data-theme=${o} style="height: ${this.spaceHeight}px">
|
|
12682
12682
|
${this.showAlert?w`<cas-alert
|
|
12683
12683
|
showCloseButton
|
package/build/cas-header.js
CHANGED
|
@@ -12677,7 +12677,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
12677
12677
|
// img {
|
|
12678
12678
|
// filter: none;
|
|
12679
12679
|
// }
|
|
12680
|
-
`,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
|
|
12680
|
+
`,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){let r=sessionStorage.getItem("hideAlert");this.showAlert=!r&&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",()=>{sessionStorage.setItem("hideAlert","true"),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!==q.HOME?this.spaceHeight=t+r:(this.spaceHeight=t+e+i+r,C.style.top=`${t+e+r}px`)}else this.type!==q.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`
|
|
12681
12681
|
<header class="container ${this.type}" data-theme=${i} style="height: ${this.spaceHeight}px">
|
|
12682
12682
|
${this.showAlert?u`<cas-alert
|
|
12683
12683
|
showCloseButton
|