ca-web-components
Version:
web components for Clínica Alemana
62 lines (60 loc) • 2.17 kB
JavaScript
import{r as c,i as o,x as t}from"../assets/unsafe-html-DS3AO1W7.js";class l extends c{static get properties(){return{urlAction:{type:String},disabledLeft:{type:String},disabledRight:{type:String}}}constructor(){super()}static get styles(){return o`
:host {
display: block;
}
.container {
display: flex;
justify-content: end;
gap: 12px;
}
.btn {
background-color: #4DBFB8;
width: 40px;
height: 40px;
border-radius: 100px;
border: none;
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
}
.btn.disabled {
pointer-events: none;
background-color: #E9EBEC;
color: #909AA1;
}
.btn-action {
height: 44px;
padding: 0 16px;
display: flex;
align-items: center;
justify-content: center;
background: #FFFFFF;
border: 1px solid currentColor;
border-radius: 100px;
color: currentColor;
text-decoration: none;
}
(min-width: 769px) {
.container {
justify-content: center;
}
.btn {
display: none;
}
}
`}handleLeft(){this.dispatchEvent(new CustomEvent("clickLeft"))}handleRight(){this.dispatchEvent(new CustomEvent("clickRight"))}render(){const{disabledLeft:e,disabledRight:n}=this,i=e==="true",a=n==="true",s=i?"btn disabled":"btn",r=a?"btn disabled":"btn";return t`
<div class="container">
<button class="${s}" ="${this.handleLeft}" aria-label="Navegación Anterior">
<cas-icon name="flat-arrowLeft" size="20"></cas-icon>
</button>
<button class="${r}" ="${this.handleRight}" aria-label="Navegación Siguiente">
<cas-icon name="flat-arrowRight" size="20"></cas-icon>
</button>
${this.urlAction?t`
<a class="btn-action" href="${this.urlAction}" target="_blank" aria-label="Ver todas">
<cas-text variant="caption1">Ver todas</cas-text>
</a>
`:""}
</div>
`}}customElements.define("ca-nav",l);