holakit
Version:
Yet another design-driven UI component set.
65 lines (64 loc) • 2.34 kB
Plain Text
/*! Built with http://stenciljs.com */
HolakitCore.loadBundle('/**:bundle-id:**/', ['exports'], function (exports) {
var h = window.HolakitCore.h;
var HolaButton = /** @class */ (function () {
function HolaButton() {
this.href = '#';
this.type = 'button';
}
HolaButton.prototype.onClick = function (event) {
var form = this.el.closest('form');
if (form) {
event.preventDefault();
var fakeButton = document.createElement('button');
fakeButton.type = this.type;
fakeButton.style.display = 'none';
form.appendChild(fakeButton);
fakeButton.click();
fakeButton.remove();
}
};
HolaButton.prototype.render = function () {
if (this.href)
h("a", { href: this.href, class: "button" }, h("slot", null));
return h("button", { onClick: this.onClick, class: "button" }, h("slot", null));
};
Object.defineProperty(HolaButton, "is", {
get: function () { return "hola-button"; },
enumerable: true,
configurable: true
});
Object.defineProperty(HolaButton, "encapsulation", {
get: function () { return "shadow"; },
enumerable: true,
configurable: true
});
Object.defineProperty(HolaButton, "properties", {
get: function () {
return {
"el": {
"elementRef": true
},
"href": {
"type": String,
"attr": "href"
},
"type": {
"type": String,
"attr": "type"
}
};
},
enumerable: true,
configurable: true
});
Object.defineProperty(HolaButton, "style", {
get: function () { return "/**style-placeholder:hola-button:**/"; },
enumerable: true,
configurable: true
});
return HolaButton;
}());
exports.HolaButton = HolaButton;
Object.defineProperty(exports, '__esModule', { value: true });
});