@kelvininc/ui-components
Version:
Kelvin UI Components
22 lines (17 loc) • 1.83 kB
JavaScript
;
var index = require('./index-DpuMIXDY.js');
const loaderCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}:host{--loader-overlay-color:var(--kv-neutral-4, #bebebe);--loader-overlay-opacity:0.4;--loader-background-color:var(--kv-neutral-2, #e5e5e5);--loader-spinner-color:var(--kv-secondary-5, #8358fe);--loader-padding:15px;--loader-border-size:6px;--loader-z-index:1}.loader-container{width:100%;height:100%;position:absolute;top:0;left:0;z-index:var(--loader-z-index)}.loader-container .overlay{width:100%;height:100%;opacity:var(--loader-overlay-opacity);background-color:var(--loader-overlay-color)}.loader-container .loader{height:0;width:0;padding:var(--loader-padding);border:var(--loader-border-size) solid var(--loader-background-color);border-right-color:var(--loader-spinner-color);border-radius:50%;animation:loadrotate 1s infinite linear;position:absolute;top:0;left:0;bottom:0;right:0;margin:auto}@keyframes loadrotate{100%{transform:rotate(360deg)}}";
const KvLoader = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
/** (optional) If `true` the loader is enabled */
this.isLoading = false;
/** (optional) If `true` the loader is overlay */
this.hasOverlay = false;
}
render() {
return (index.h(index.Host, { key: '4f18fb1a2b9ebffd50061acc651b80f9dceb91ca' }, this.isLoading && (index.h("div", { key: '73a15860c750af1854ca0a94abaee615f06eb164', class: "loader-container" }, this.hasOverlay && index.h("div", { key: '97ab947bbe4c61b2982d2f81ebdce6860637d874', class: "overlay" }), index.h("div", { key: '3981c1cd8e180f086c52ffa594dd8ef9a2a411a6', class: "loader" })))));
}
};
KvLoader.style = loaderCss;
exports.kv_loader = KvLoader;