holakit
Version:
Yet another design-driven UI component set.
2 lines • 1.16 kB
Plain Text
/*! Built with http://stenciljs.com */
import{h}from"../holakitcore.core.js";var HolaButton=function(){function t(){this.href="#",this.type="button",this.submit=!1}return t.prototype.onClick=function(t){var e=this.el.closest("form");if(e){if(t.preventDefault(),this.submit)return e.submit();var n=document.createElement("button");n.type=this.type,n.style.display="none",e.appendChild(n),n.click(),n.remove()}},t.prototype.render=function(){return this.href&&h("a",{href:this.href,class:"button"},h("slot",null)),h("button",{onClick:this.onClick,type:this.type,class:"button"},h("slot",null))},Object.defineProperty(t,"is",{get:function(){return"hola-button"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"encapsulation",{get:function(){return"shadow"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"properties",{get:function(){return{el:{elementRef:!0},href:{type:String,attr:"href"},submit:{type:Boolean,attr:"submit"},type:{type:String,attr:"type"}}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return"/**style-placeholder:hola-button:**/"},enumerable:!0,configurable:!0}),t}();export{HolaButton};