UNPKG

ngx-loading

Version:

A customisable loading spinner for Angular applications.

503 lines (471 loc) 43.5 kB
import * as i0 from '@angular/core'; import { Injectable, Optional, Inject, Component, Input, NgModule } from '@angular/core'; import * as i2 from '@angular/common'; import { CommonModule } from '@angular/common'; class NgxLoadingConfig { constructor(config = {}) { this.backdropBorderRadius = config.backdropBorderRadius; this.backdropBackgroundColour = config.backdropBackgroundColour; this.fullScreenBackdrop = config.fullScreenBackdrop; this.animationType = config.animationType; this.primaryColour = config.primaryColour; this.secondaryColour = config.secondaryColour; this.tertiaryColour = config.tertiaryColour; } } const ngxLoadingAnimationTypes = { chasingDots: 'chasing-dots', circle: 'sk-circle', circleSwish: 'circleSwish', cubeGrid: 'sk-cube-grid', doubleBounce: 'double-bounce', none: 'none', pulse: 'pulse', rectangleBounce: 'rectangle-bounce', rotatingPlane: 'rotating-plane', threeBounce: 'three-bounce', wanderingCubes: 'wandering-cubes', }; class NgxLoadingService { constructor(config) { this.config = config; this.loadingConfig = this.config || new NgxLoadingConfig(); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: NgxLoadingService, deps: [{ token: 'loadingConfig', optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); } static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: NgxLoadingService, providedIn: 'root' }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: NgxLoadingService, decorators: [{ type: Injectable, args: [{ providedIn: 'root', }] }], ctorParameters: () => [{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: ['loadingConfig'] }] }] }); class NgxLoadingComponent { constructor(LoadingService) { this.LoadingService = LoadingService; this.show = false; this.config = new NgxLoadingConfig(); this.defaultConfig = { animationType: ngxLoadingAnimationTypes.threeBounce, backdropBackgroundColour: 'rgba(0, 0, 0, 0.3)', backdropBorderRadius: '0px', fullScreenBackdrop: false, primaryColour: '#ffffff', secondaryColour: '#ffffff', tertiaryColour: '#ffffff', }; this.ngxLoadingAnimationTypes = ngxLoadingAnimationTypes; } ngOnInit() { this.setupConfig(); } setupConfig() { for (const option in this.defaultConfig) { if (this.config[option] != null) { continue; } this.config[option] = this.LoadingService.loadingConfig[option] != null ? this.LoadingService.loadingConfig[option] : this.defaultConfig[option]; } } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: NgxLoadingComponent, deps: [{ token: NgxLoadingService }], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.0", type: NgxLoadingComponent, selector: "ngx-loading", inputs: { show: "show", config: "config", template: "template" }, ngImport: i0, template: ` <div *ngIf="show"> <div class="backdrop" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" [ngStyle]="{ 'border-radius': config.backdropBorderRadius, 'background-color': config.backdropBackgroundColour }" ></div> <div [ngSwitch]="config.animationType"> <div class="spinner-circle" *ngSwitchCase="ngxLoadingAnimationTypes.circle" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" [ngStyle]="{ 'border-top-color': config.secondaryColour, 'border-right-color': config.secondaryColour, 'border-bottom-color': config.secondaryColour, 'border-left-color': config.primaryColour }" ></div> <div *ngSwitchCase="ngxLoadingAnimationTypes.cubeGrid" class="sk-cube-grid" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" > <div class="sk-cube sk-cube1" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube2" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube3" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube4" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube5" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube6" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube7" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube8" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube9" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> </div> <div class="spinner-sk-rotateplane" *ngSwitchCase="ngxLoadingAnimationTypes.rotatingPlane" [ngStyle]="{ 'background-color': config.primaryColour }" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" ></div> <div class="spinner-rectangle-bounce" *ngSwitchCase="ngxLoadingAnimationTypes.rectangleBounce" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" > <div class="rect1" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="rect2" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="rect3" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="rect4" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="rect5" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> </div> <div class="spinner-wandering-cubes" *ngSwitchCase="ngxLoadingAnimationTypes.wanderingCubes" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" > <div class="cube1" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="cube2" [ngStyle]="{ 'background-color': config.secondaryColour }" ></div> </div> <div class="spinner-double-bounce" *ngSwitchCase="ngxLoadingAnimationTypes.doubleBounce" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" > <div class="double-bounce1" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="double-bounce2" [ngStyle]="{ 'background-color': config.secondaryColour }" ></div> </div> <div class="spinner-pulse" *ngSwitchCase="ngxLoadingAnimationTypes.pulse" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="spinner-chasing-dots" *ngSwitchCase="ngxLoadingAnimationTypes.chasingDots" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" > <div class="dot1" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="dot2" [ngStyle]="{ 'background-color': config.secondaryColour }" ></div> </div> <div class="spinner-circle-swish" *ngSwitchCase="ngxLoadingAnimationTypes.circleSwish" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" [ngStyle]="{ color: config.primaryColour }" ></div> <div *ngSwitchCase="ngxLoadingAnimationTypes.none" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" ></div> <div *ngSwitchDefault class="spinner-three-bounce" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" > <div class="bounce1" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="bounce2" [ngStyle]="{ 'background-color': config.secondaryColour }" ></div> <div class="bounce3" [ngStyle]="{ 'background-color': config.tertiaryColour }" ></div> </div> <ng-container *ngIf="template"> <ng-container *ngTemplateOutlet="template"></ng-container> </ng-container> </div> </div> `, isInline: true, styles: [".backdrop{z-index:1999;position:absolute;inset:0;background-color:#0000004d}.spinner-circle,.spinner-circle:after{border-radius:50%;width:10em;height:10em}.spinner-circle{font-size:6px;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;position:absolute;inset:0;margin:auto;z-index:2000;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s infinite linear;animation:load8 1.1s infinite linear}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-circle-swish{font-size:60px;overflow:hidden;width:1em;height:1em;border-radius:50%;position:absolute;inset:0;margin:auto;z-index:2000;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load6 1.7s infinite ease;animation:load6 1.7s infinite ease}@-webkit-keyframes load6{0%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em;-webkit-transform:rotate(0deg)}5%,95%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em}10%,59%{box-shadow:0 -.83em 0 -.4em,-.087em -.825em 0 -.42em,-.173em -.812em 0 -.44em,-.256em -.789em 0 -.46em,-.297em -.775em 0 -.477em}20%{box-shadow:0 -.83em 0 -.4em,-.338em -.758em 0 -.42em,-.555em -.617em 0 -.44em,-.671em -.488em 0 -.46em,-.749em -.34em 0 -.477em}38%{box-shadow:0 -.83em 0 -.4em,-.377em -.74em 0 -.42em,-.645em -.522em 0 -.44em,-.775em -.297em 0 -.46em,-.82em -.09em 0 -.477em}to{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em;-webkit-transform:rotate(360deg)}}@keyframes load6{0%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em;transform:rotate(0)}5%,95%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em}10%,59%{box-shadow:0 -.83em 0 -.4em,-.087em -.825em 0 -.42em,-.173em -.812em 0 -.44em,-.256em -.789em 0 -.46em,-.297em -.775em 0 -.477em}20%{box-shadow:0 -.83em 0 -.4em,-.338em -.758em 0 -.42em,-.555em -.617em 0 -.44em,-.671em -.488em 0 -.46em,-.749em -.34em 0 -.477em}38%{box-shadow:0 -.83em 0 -.4em,-.377em -.74em 0 -.42em,-.645em -.522em 0 -.44em,-.775em -.297em 0 -.46em,-.82em -.09em 0 -.477em}to{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em;transform:rotate(360deg)}}.sk-cube-grid{width:40px;height:40px;position:absolute;inset:0;margin:auto;z-index:2000}.sk-cube-grid .sk-cube{width:33%;height:33%;background-color:#333;float:left;-webkit-animation:sk-cubeGridScaleDelay 1.3s infinite ease-in-out;animation:sk-cubeGridScaleDelay 1.3s infinite ease-in-out}.sk-cube-grid .sk-cube1{-webkit-animation-delay:.2s;animation-delay:.2s}.sk-cube-grid .sk-cube2{-webkit-animation-delay:.3s;animation-delay:.3s}.sk-cube-grid .sk-cube3{-webkit-animation-delay:.4s;animation-delay:.4s}.sk-cube-grid .sk-cube4{-webkit-animation-delay:.1s;animation-delay:.1s}.sk-cube-grid .sk-cube5{-webkit-animation-delay:.2s;animation-delay:.2s}.sk-cube-grid .sk-cube6{-webkit-animation-delay:.3s;animation-delay:.3s}.sk-cube-grid .sk-cube7{-webkit-animation-delay:0s;animation-delay:0s}.sk-cube-grid .sk-cube8{-webkit-animation-delay:.1s;animation-delay:.1s}.sk-cube-grid .sk-cube9{-webkit-animation-delay:.2s;animation-delay:.2s}@-webkit-keyframes sk-cubeGridScaleDelay{0%,70%,to{-webkit-transform:scale3D(1,1,1);transform:scaleZ(1)}35%{-webkit-transform:scale3D(0,0,1);transform:scale3D(0,0,1)}}@keyframes sk-cubeGridScaleDelay{0%,70%,to{-webkit-transform:scale3D(1,1,1);transform:scaleZ(1)}35%{-webkit-transform:scale3D(0,0,1);transform:scale3D(0,0,1)}}.spinner-double-bounce{width:40px;height:40px;position:absolute;inset:0;margin:auto;z-index:2000}.double-bounce1,.double-bounce2{width:100%;height:100%;border-radius:50%;background-color:#333;opacity:.6;position:absolute;top:0;left:0;-webkit-animation:sk-bounce 2s infinite ease-in-out;animation:sk-bounce 2s infinite ease-in-out}.double-bounce2{-webkit-animation-delay:-1s;animation-delay:-1s}.spinner-pulse{width:40px;height:40px;background-color:#333;position:absolute;inset:0;margin:auto;z-index:2000;border-radius:100%;-webkit-animation:sk-scaleout 1s infinite ease-in-out;animation:sk-scaleout 1s infinite ease-in-out}@-webkit-keyframes sk-scaleout{0%{-webkit-transform:scale(0)}to{-webkit-transform:scale(1);opacity:0}}@keyframes sk-scaleout{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.spinner-three-bounce{width:70px;text-align:center;position:absolute;inset:0;height:20px;margin:auto;z-index:2000}.spinner-three-bounce>div{width:18px;height:18px;background-color:#fff;border-radius:100%;display:inline-block;-webkit-animation:sk-bouncedelay 1.4s infinite ease-in-out both;animation:sk-bouncedelay 1.4s infinite ease-in-out both}.spinner-three-bounce .bounce1{-webkit-animation-delay:-.32s;animation-delay:-.32s}.spinner-three-bounce .bounce2{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes sk-bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes sk-bouncedelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}.spinner-sk-rotateplane{width:40px;height:40px;background-color:#fff;text-align:center;position:absolute;inset:0;margin:auto;z-index:2000;-webkit-animation:sk-rotateplane 1.2s infinite ease-in-out;animation:sk-rotateplane 1.2s infinite ease-in-out}@-webkit-keyframes sk-rotateplane{0%{-webkit-transform:perspective(120px)}50%{-webkit-transform:perspective(120px) rotateY(180deg)}to{-webkit-transform:perspective(120px) rotateY(180deg) rotateX(180deg)}}@keyframes sk-rotateplane{0%{transform:perspective(120px) rotateX(0) rotateY(0);-webkit-transform:perspective(120px) rotateX(0deg) rotateY(0deg)}50%{transform:perspective(120px) rotateX(-180.1deg) rotateY(0);-webkit-transform:perspective(120px) rotateX(-180.1deg) rotateY(0deg)}to{transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg);-webkit-transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg)}}.spinner-rectangle-bounce{width:50px;height:40px;font-size:10px;text-align:center;position:absolute;inset:0;margin:auto;z-index:2000}.spinner-rectangle-bounce>div{background-color:#fff;height:100%;width:6px;display:inline-block;-webkit-animation:sk-stretchdelay 1.2s infinite ease-in-out;animation:sk-stretchdelay 1.2s infinite ease-in-out}.spinner-rectangle-bounce .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.spinner-rectangle-bounce .rect3{-webkit-animation-delay:-1s;animation-delay:-1s}.spinner-rectangle-bounce .rect4{-webkit-animation-delay:-.9s;animation-delay:-.9s}.spinner-rectangle-bounce .rect5{-webkit-animation-delay:-.8s;animation-delay:-.8s}@-webkit-keyframes sk-stretchdelay{0%,40%,to{-webkit-transform:scaleY(.4)}20%{-webkit-transform:scaleY(1)}}@keyframes sk-stretchdelay{0%,40%,to{transform:scaleY(.4);-webkit-transform:scaleY(.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}.spinner-wandering-cubes{width:60px;height:58px;font-size:10px;text-align:center;position:absolute;inset:0;margin:auto;z-index:2000}.cube1,.cube2{background-color:#fff;width:15px;height:15px;position:absolute;top:0;left:0;-webkit-animation:sk-cubemove 1.8s infinite ease-in-out;animation:sk-cubemove 1.8s infinite ease-in-out}.cube2{-webkit-animation-delay:-.9s;animation-delay:-.9s}@-webkit-keyframes sk-cubemove{25%{-webkit-transform:translateX(42px) rotate(-90deg) scale(.5)}50%{-webkit-transform:translateX(42px) translateY(42px) rotate(-180deg)}75%{-webkit-transform:translateX(0px) translateY(42px) rotate(-270deg) scale(.5)}to{-webkit-transform:rotate(-360deg)}}@keyframes sk-cubemove{25%{transform:translate(42px) rotate(-90deg) scale(.5);-webkit-transform:translateX(42px) rotate(-90deg) scale(.5)}50%{transform:translate(42px) translateY(42px) rotate(-179deg);-webkit-transform:translateX(42px) translateY(42px) rotate(-179deg)}50.1%{transform:translate(42px) translateY(42px) rotate(-180deg);-webkit-transform:translateX(42px) translateY(42px) rotate(-180deg)}75%{transform:translate(0) translateY(42px) rotate(-270deg) scale(.5);-webkit-transform:translateX(0px) translateY(42px) rotate(-270deg) scale(.5)}to{transform:rotate(-360deg);-webkit-transform:rotate(-360deg)}}.sk-circle{width:40px;height:40px;position:absolute;inset:0;margin:auto;z-index:2000}.sk-circle .sk-child{width:100%;height:100%;position:absolute;left:0;top:0}.sk-circle .sk-child:before{content:\"\";display:block;margin:0 auto;width:15%;height:15%;background-color:#333;border-radius:100%;-webkit-animation:sk-circleBounceDelay 1.2s infinite ease-in-out both;animation:sk-circleBounceDelay 1.2s infinite ease-in-out both}.sk-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-circle .sk-circle4:before{-webkit-animation-delay:-.9s;animation-delay:-.9s}.sk-circle .sk-circle5:before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.sk-circle .sk-circle6:before{-webkit-animation-delay:-.7s;animation-delay:-.7s}.sk-circle .sk-circle7:before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.sk-circle .sk-circle8:before{-webkit-animation-delay:-.5s;animation-delay:-.5s}.sk-circle .sk-circle9:before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sk-circle .sk-circle10:before{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sk-circle .sk-circle11:before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sk-circle .sk-circle12:before{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-circleBounceDelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes sk-circleBounceDelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}.spinner-chasing-dots{width:40px;height:40px;position:absolute;inset:0;margin:auto;z-index:2000;text-align:center;-webkit-animation:sk-rotate 2s infinite linear;animation:sk-rotate 2s infinite linear}.dot1,.dot2{width:60%;height:60%;display:inline-block;position:absolute;top:0;background-color:#333;border-radius:100%;-webkit-animation:sk-bounce 2s infinite ease-in-out;animation:sk-bounce 2s infinite ease-in-out}.dot2{top:auto;bottom:0;-webkit-animation-delay:-1s;animation-delay:-1s}@-webkit-keyframes sk-rotate{to{-webkit-transform:rotate(360deg)}}@keyframes sk-rotate{to{transform:rotate(360deg);-webkit-transform:rotate(360deg)}}@-webkit-keyframes sk-bounce{0%,to{-webkit-transform:scale(0)}50%{-webkit-transform:scale(1)}}@keyframes sk-bounce{0%,to{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}}.full-screen{position:fixed;position:-ms-page}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: NgxLoadingComponent, decorators: [{ type: Component, args: [{ selector: 'ngx-loading', template: ` <div *ngIf="show"> <div class="backdrop" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" [ngStyle]="{ 'border-radius': config.backdropBorderRadius, 'background-color': config.backdropBackgroundColour }" ></div> <div [ngSwitch]="config.animationType"> <div class="spinner-circle" *ngSwitchCase="ngxLoadingAnimationTypes.circle" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" [ngStyle]="{ 'border-top-color': config.secondaryColour, 'border-right-color': config.secondaryColour, 'border-bottom-color': config.secondaryColour, 'border-left-color': config.primaryColour }" ></div> <div *ngSwitchCase="ngxLoadingAnimationTypes.cubeGrid" class="sk-cube-grid" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" > <div class="sk-cube sk-cube1" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube2" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube3" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube4" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube5" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube6" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube7" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube8" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="sk-cube sk-cube9" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> </div> <div class="spinner-sk-rotateplane" *ngSwitchCase="ngxLoadingAnimationTypes.rotatingPlane" [ngStyle]="{ 'background-color': config.primaryColour }" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" ></div> <div class="spinner-rectangle-bounce" *ngSwitchCase="ngxLoadingAnimationTypes.rectangleBounce" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" > <div class="rect1" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="rect2" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="rect3" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="rect4" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="rect5" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> </div> <div class="spinner-wandering-cubes" *ngSwitchCase="ngxLoadingAnimationTypes.wanderingCubes" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" > <div class="cube1" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="cube2" [ngStyle]="{ 'background-color': config.secondaryColour }" ></div> </div> <div class="spinner-double-bounce" *ngSwitchCase="ngxLoadingAnimationTypes.doubleBounce" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" > <div class="double-bounce1" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="double-bounce2" [ngStyle]="{ 'background-color': config.secondaryColour }" ></div> </div> <div class="spinner-pulse" *ngSwitchCase="ngxLoadingAnimationTypes.pulse" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="spinner-chasing-dots" *ngSwitchCase="ngxLoadingAnimationTypes.chasingDots" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" > <div class="dot1" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="dot2" [ngStyle]="{ 'background-color': config.secondaryColour }" ></div> </div> <div class="spinner-circle-swish" *ngSwitchCase="ngxLoadingAnimationTypes.circleSwish" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" [ngStyle]="{ color: config.primaryColour }" ></div> <div *ngSwitchCase="ngxLoadingAnimationTypes.none" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" ></div> <div *ngSwitchDefault class="spinner-three-bounce" [ngClass]="{ 'full-screen': config.fullScreenBackdrop === true }" > <div class="bounce1" [ngStyle]="{ 'background-color': config.primaryColour }" ></div> <div class="bounce2" [ngStyle]="{ 'background-color': config.secondaryColour }" ></div> <div class="bounce3" [ngStyle]="{ 'background-color': config.tertiaryColour }" ></div> </div> <ng-container *ngIf="template"> <ng-container *ngTemplateOutlet="template"></ng-container> </ng-container> </div> </div> `, styles: [".backdrop{z-index:1999;position:absolute;inset:0;background-color:#0000004d}.spinner-circle,.spinner-circle:after{border-radius:50%;width:10em;height:10em}.spinner-circle{font-size:6px;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;position:absolute;inset:0;margin:auto;z-index:2000;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s infinite linear;animation:load8 1.1s infinite linear}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-circle-swish{font-size:60px;overflow:hidden;width:1em;height:1em;border-radius:50%;position:absolute;inset:0;margin:auto;z-index:2000;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load6 1.7s infinite ease;animation:load6 1.7s infinite ease}@-webkit-keyframes load6{0%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em;-webkit-transform:rotate(0deg)}5%,95%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em}10%,59%{box-shadow:0 -.83em 0 -.4em,-.087em -.825em 0 -.42em,-.173em -.812em 0 -.44em,-.256em -.789em 0 -.46em,-.297em -.775em 0 -.477em}20%{box-shadow:0 -.83em 0 -.4em,-.338em -.758em 0 -.42em,-.555em -.617em 0 -.44em,-.671em -.488em 0 -.46em,-.749em -.34em 0 -.477em}38%{box-shadow:0 -.83em 0 -.4em,-.377em -.74em 0 -.42em,-.645em -.522em 0 -.44em,-.775em -.297em 0 -.46em,-.82em -.09em 0 -.477em}to{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em;-webkit-transform:rotate(360deg)}}@keyframes load6{0%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em;transform:rotate(0)}5%,95%{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em}10%,59%{box-shadow:0 -.83em 0 -.4em,-.087em -.825em 0 -.42em,-.173em -.812em 0 -.44em,-.256em -.789em 0 -.46em,-.297em -.775em 0 -.477em}20%{box-shadow:0 -.83em 0 -.4em,-.338em -.758em 0 -.42em,-.555em -.617em 0 -.44em,-.671em -.488em 0 -.46em,-.749em -.34em 0 -.477em}38%{box-shadow:0 -.83em 0 -.4em,-.377em -.74em 0 -.42em,-.645em -.522em 0 -.44em,-.775em -.297em 0 -.46em,-.82em -.09em 0 -.477em}to{box-shadow:0 -.83em 0 -.4em,0 -.83em 0 -.42em,0 -.83em 0 -.44em,0 -.83em 0 -.46em,0 -.83em 0 -.477em;transform:rotate(360deg)}}.sk-cube-grid{width:40px;height:40px;position:absolute;inset:0;margin:auto;z-index:2000}.sk-cube-grid .sk-cube{width:33%;height:33%;background-color:#333;float:left;-webkit-animation:sk-cubeGridScaleDelay 1.3s infinite ease-in-out;animation:sk-cubeGridScaleDelay 1.3s infinite ease-in-out}.sk-cube-grid .sk-cube1{-webkit-animation-delay:.2s;animation-delay:.2s}.sk-cube-grid .sk-cube2{-webkit-animation-delay:.3s;animation-delay:.3s}.sk-cube-grid .sk-cube3{-webkit-animation-delay:.4s;animation-delay:.4s}.sk-cube-grid .sk-cube4{-webkit-animation-delay:.1s;animation-delay:.1s}.sk-cube-grid .sk-cube5{-webkit-animation-delay:.2s;animation-delay:.2s}.sk-cube-grid .sk-cube6{-webkit-animation-delay:.3s;animation-delay:.3s}.sk-cube-grid .sk-cube7{-webkit-animation-delay:0s;animation-delay:0s}.sk-cube-grid .sk-cube8{-webkit-animation-delay:.1s;animation-delay:.1s}.sk-cube-grid .sk-cube9{-webkit-animation-delay:.2s;animation-delay:.2s}@-webkit-keyframes sk-cubeGridScaleDelay{0%,70%,to{-webkit-transform:scale3D(1,1,1);transform:scaleZ(1)}35%{-webkit-transform:scale3D(0,0,1);transform:scale3D(0,0,1)}}@keyframes sk-cubeGridScaleDelay{0%,70%,to{-webkit-transform:scale3D(1,1,1);transform:scaleZ(1)}35%{-webkit-transform:scale3D(0,0,1);transform:scale3D(0,0,1)}}.spinner-double-bounce{width:40px;height:40px;position:absolute;inset:0;margin:auto;z-index:2000}.double-bounce1,.double-bounce2{width:100%;height:100%;border-radius:50%;background-color:#333;opacity:.6;position:absolute;top:0;left:0;-webkit-animation:sk-bounce 2s infinite ease-in-out;animation:sk-bounce 2s infinite ease-in-out}.double-bounce2{-webkit-animation-delay:-1s;animation-delay:-1s}.spinner-pulse{width:40px;height:40px;background-color:#333;position:absolute;inset:0;margin:auto;z-index:2000;border-radius:100%;-webkit-animation:sk-scaleout 1s infinite ease-in-out;animation:sk-scaleout 1s infinite ease-in-out}@-webkit-keyframes sk-scaleout{0%{-webkit-transform:scale(0)}to{-webkit-transform:scale(1);opacity:0}}@keyframes sk-scaleout{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1);opacity:0}}.spinner-three-bounce{width:70px;text-align:center;position:absolute;inset:0;height:20px;margin:auto;z-index:2000}.spinner-three-bounce>div{width:18px;height:18px;background-color:#fff;border-radius:100%;display:inline-block;-webkit-animation:sk-bouncedelay 1.4s infinite ease-in-out both;animation:sk-bouncedelay 1.4s infinite ease-in-out both}.spinner-three-bounce .bounce1{-webkit-animation-delay:-.32s;animation-delay:-.32s}.spinner-three-bounce .bounce2{-webkit-animation-delay:-.16s;animation-delay:-.16s}@-webkit-keyframes sk-bouncedelay{0%,80%,to{-webkit-transform:scale(0)}40%{-webkit-transform:scale(1)}}@keyframes sk-bouncedelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}.spinner-sk-rotateplane{width:40px;height:40px;background-color:#fff;text-align:center;position:absolute;inset:0;margin:auto;z-index:2000;-webkit-animation:sk-rotateplane 1.2s infinite ease-in-out;animation:sk-rotateplane 1.2s infinite ease-in-out}@-webkit-keyframes sk-rotateplane{0%{-webkit-transform:perspective(120px)}50%{-webkit-transform:perspective(120px) rotateY(180deg)}to{-webkit-transform:perspective(120px) rotateY(180deg) rotateX(180deg)}}@keyframes sk-rotateplane{0%{transform:perspective(120px) rotateX(0) rotateY(0);-webkit-transform:perspective(120px) rotateX(0deg) rotateY(0deg)}50%{transform:perspective(120px) rotateX(-180.1deg) rotateY(0);-webkit-transform:perspective(120px) rotateX(-180.1deg) rotateY(0deg)}to{transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg);-webkit-transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg)}}.spinner-rectangle-bounce{width:50px;height:40px;font-size:10px;text-align:center;position:absolute;inset:0;margin:auto;z-index:2000}.spinner-rectangle-bounce>div{background-color:#fff;height:100%;width:6px;display:inline-block;-webkit-animation:sk-stretchdelay 1.2s infinite ease-in-out;animation:sk-stretchdelay 1.2s infinite ease-in-out}.spinner-rectangle-bounce .rect2{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.spinner-rectangle-bounce .rect3{-webkit-animation-delay:-1s;animation-delay:-1s}.spinner-rectangle-bounce .rect4{-webkit-animation-delay:-.9s;animation-delay:-.9s}.spinner-rectangle-bounce .rect5{-webkit-animation-delay:-.8s;animation-delay:-.8s}@-webkit-keyframes sk-stretchdelay{0%,40%,to{-webkit-transform:scaleY(.4)}20%{-webkit-transform:scaleY(1)}}@keyframes sk-stretchdelay{0%,40%,to{transform:scaleY(.4);-webkit-transform:scaleY(.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}.spinner-wandering-cubes{width:60px;height:58px;font-size:10px;text-align:center;position:absolute;inset:0;margin:auto;z-index:2000}.cube1,.cube2{background-color:#fff;width:15px;height:15px;position:absolute;top:0;left:0;-webkit-animation:sk-cubemove 1.8s infinite ease-in-out;animation:sk-cubemove 1.8s infinite ease-in-out}.cube2{-webkit-animation-delay:-.9s;animation-delay:-.9s}@-webkit-keyframes sk-cubemove{25%{-webkit-transform:translateX(42px) rotate(-90deg) scale(.5)}50%{-webkit-transform:translateX(42px) translateY(42px) rotate(-180deg)}75%{-webkit-transform:translateX(0px) translateY(42px) rotate(-270deg) scale(.5)}to{-webkit-transform:rotate(-360deg)}}@keyframes sk-cubemove{25%{transform:translate(42px) rotate(-90deg) scale(.5);-webkit-transform:translateX(42px) rotate(-90deg) scale(.5)}50%{transform:translate(42px) translateY(42px) rotate(-179deg);-webkit-transform:translateX(42px) translateY(42px) rotate(-179deg)}50.1%{transform:translate(42px) translateY(42px) rotate(-180deg);-webkit-transform:translateX(42px) translateY(42px) rotate(-180deg)}75%{transform:translate(0) translateY(42px) rotate(-270deg) scale(.5);-webkit-transform:translateX(0px) translateY(42px) rotate(-270deg) scale(.5)}to{transform:rotate(-360deg);-webkit-transform:rotate(-360deg)}}.sk-circle{width:40px;height:40px;position:absolute;inset:0;margin:auto;z-index:2000}.sk-circle .sk-child{width:100%;height:100%;position:absolute;left:0;top:0}.sk-circle .sk-child:before{content:\"\";display:block;margin:0 auto;width:15%;height:15%;background-color:#333;border-radius:100%;-webkit-animation:sk-circleBounceDelay 1.2s infinite ease-in-out both;animation:sk-circleBounceDelay 1.2s infinite ease-in-out both}.sk-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-circle .sk-circle4:before{-webkit-animation-delay:-.9s;animation-delay:-.9s}.sk-circle .sk-circle5:before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.sk-circle .sk-circle6:before{-webkit-animation-delay:-.7s;animation-delay:-.7s}.sk-circle .sk-circle7:before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.sk-circle .sk-circle8:before{-webkit-animation-delay:-.5s;animation-delay:-.5s}.sk-circle .sk-circle9:before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sk-circle .sk-circle10:before{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sk-circle .sk-circle11:before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sk-circle .sk-circle12:before{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-circleBounceDelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes sk-circleBounceDelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}.spinner-chasing-dots{width:40px;height:40px;position:absolute;inset:0;margin:auto;z-index:2000;text-align:center;-webkit-animation:sk-rotate 2s infinite linear;animation:sk-rotate 2s infinite linear}.dot1,.dot2{width:60%;height:60%;display:inline-block;position:absolute;top:0;background-color:#333;border-radius:100%;-webkit-animation:sk-bounce 2s infinite ease-in-out;animation:sk-bounce 2s infinite ease-in-out}.dot2{top:auto;bottom:0;-webkit-animation-delay:-1s;animation-delay:-1s}@-webkit-keyframes sk-rotate{to{-webkit-transform:rotate(360deg)}}@keyframes sk-rotate{to{transform:rotate(360deg);-webkit-transform:rotate(360deg)}}@-webkit-keyframes sk-bounce{0%,to{-webkit-transform:scale(0)}50%{-webkit-transform:scale(1)}}@keyframes sk-bounce{0%,to{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}}.full-screen{position:fixed;position:-ms-page}\n"] }] }], ctorParameters: () => [{ type: NgxLoadingService }], propDecorators: { show: [{ type: Input }], config: [{ type: Input }], template: [{ type: Input }] } }); class NgxLoadingModule { static forRoot(loadingConfig) { return { ngModule: NgxLoadingModule, providers: [{ provide: 'loadingConfig', useValue: loadingConfig }], }; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: NgxLoadingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.0", ngImport: i0, type: NgxLoadingModule, declarations: [NgxLoadingComponent], imports: [CommonModule], exports: [NgxLoadingComponent] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: NgxLoadingModule, imports: [CommonModule] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0", ngImport: i0, type: NgxLoadingModule, decorators: [{ type: NgModule, args: [{ declarations: [NgxLoadingComponent], imports: [CommonModule], exports: [NgxLoadingComponent], }] }] }); /* * Public API Surface of ngx-loading */ /** * Generated bundle index. Do not edit. */ export { NgxLoadingComponent, NgxLoadingConfig, NgxLoadingModule, NgxLoadingService, ngxLoadingAnimationTypes }; //# sourceMappingURL=ngx-loading.mjs.map