UNPKG

holakit

Version:

Yet another design-driven UI component set.

2 lines 837 B
/*! Built with http://stenciljs.com */ const{h:t}=window.HolakitCore;class e{constructor(){this.href="#",this.type="button",this.submit=!1}onClick(t){const e=this.el.closest("form");if(e){if(t.preventDefault(),this.submit)return e.submit();const s=document.createElement("button");s.type=this.type,s.style.display="none",e.appendChild(s),s.click(),s.remove()}}render(){return this.href&&t("a",{href:this.href,class:"button"},t("slot",null)),t("button",{onClick:this.onClick,type:this.type,class:"button"},t("slot",null))}static get is(){return"hola-button"}static get encapsulation(){return"shadow"}static get properties(){return{el:{elementRef:!0},href:{type:String,attr:"href"},submit:{type:Boolean,attr:"submit"},type:{type:String,attr:"type"}}}static get style(){return"/**style-placeholder:hola-button:**/"}}export{e as HolaButton};