@ngx-loading-bar/core
Advanced tools
Comparing version 1.0.0-alpha.1 to 1.0.0-alpha.2
@@ -1,10 +0,17 @@ | ||
import { Component, Injectable, Input, NgModule, Renderer2, ViewChild } from '@angular/core'; | ||
import { Subject } from 'rxjs/Subject'; | ||
import { share } from 'rxjs/operator/share'; | ||
import { CommonModule } from '@angular/common'; | ||
import { Component, Injectable, Input, NgModule } from '@angular/core'; | ||
import { Subject as Subject$1 } from 'rxjs/Subject'; | ||
import { share as share$1 } from 'rxjs/operator/share'; | ||
var LoadingBarService = (function () { | ||
function LoadingBarService() { | ||
this.pending = new Subject(); | ||
this.pending = new Subject$1(); | ||
this._pendingRequests = 0; | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
LoadingBarService.prototype.ngOnDestroy = function () { | ||
this.pending.complete(); | ||
}; | ||
/** | ||
* @param {?=} source$ | ||
@@ -15,3 +22,3 @@ * @return {?} | ||
if (source$) { | ||
share.call(source$).subscribe(this.getLoadingObserver()); | ||
share$1.call(source$).subscribe(this.getLoadingObserver()); | ||
} | ||
@@ -54,14 +61,11 @@ this.pending.next({ | ||
/** | ||
* @param {?} _renderer | ||
* @param {?} loadingBarService | ||
*/ | ||
function LoadingBarComponent(_renderer, loadingBarService) { | ||
function LoadingBarComponent(loadingBarService) { | ||
var _this = this; | ||
this._renderer = _renderer; | ||
this.includeSpinner = true; | ||
this._autoIncrement = true; | ||
this._includeBar = true; | ||
this.started = false; | ||
this.progressWidth = '0'; | ||
this._latencyThreshold = 10; | ||
this._startSize = 0.02; | ||
this._started = false; | ||
this._status = 0; | ||
@@ -76,9 +80,2 @@ loadingBarService.pending.subscribe(function (progress) { | ||
/** | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.ngAfterViewInit = function () { | ||
this.hide(this._loadingBarContainer); | ||
this.hide(this._spinner); | ||
}; | ||
/** | ||
* Inserts the loading bar element into the dom, and sets it to 2% | ||
@@ -92,13 +89,7 @@ * @return {?} | ||
// do not continually broadcast the started event: | ||
if (_this._started) { | ||
if (_this.started) { | ||
return; | ||
} | ||
_this._started = true; | ||
_this.started = true; | ||
_this._status = 0; | ||
if (_this._includeBar) { | ||
_this.show(_this._loadingBarContainer); | ||
} | ||
if (_this.includeSpinner) { | ||
_this.show(_this._spinner); | ||
} | ||
_this.set(_this._startSize); | ||
@@ -115,7 +106,7 @@ }, this._latencyThreshold); | ||
var _this = this; | ||
if (!this._started) { | ||
if (!this.started) { | ||
return; | ||
} | ||
var /** @type {?} */ pct = (n * 100) + '%'; | ||
this.setElementStyle(this._loadingBar, 'width', pct); | ||
this.progressWidth = pct; | ||
this._status = n; | ||
@@ -125,8 +116,4 @@ // increment loadingbar to give the illusion that there is always | ||
// have multiple incs running at the same time. | ||
if (this._autoIncrement) { | ||
clearTimeout(this._incTimeout); | ||
this._incTimeout = setTimeout(function () { | ||
_this.inc(); | ||
}, 250); | ||
} | ||
clearTimeout(this._incTimeout); | ||
this._incTimeout = setTimeout(function () { return _this.inc(); }, 250); | ||
}; | ||
@@ -143,7 +130,3 @@ /** | ||
// Attempt to aggregate any start/complete calls within 500ms: | ||
_this._completeTimeout = setTimeout(function () { | ||
_this._started = false; | ||
_this.hide(_this._loadingBarContainer); | ||
_this.hide(_this._spinner); | ||
}, 500); | ||
_this._completeTimeout = setTimeout(function () { return _this.started = false; }, 500); | ||
}, this._latencyThreshold); | ||
@@ -182,28 +165,4 @@ }; | ||
} | ||
var /** @type {?} */ pct = this._status + rnd; | ||
this.set(pct); | ||
this.set(this._status + rnd); | ||
}; | ||
/** | ||
* @param {?} el | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.show = function (el) { | ||
this.setElementStyle(el, 'display', 'block'); | ||
}; | ||
/** | ||
* @param {?} el | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.hide = function (el) { | ||
this.setElementStyle(el, 'display', 'none'); | ||
}; | ||
/** | ||
* @param {?} el | ||
* @param {?} styleName | ||
* @param {?} styleValue | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.setElementStyle = function (el, styleName, styleValue) { | ||
this._renderer.setStyle(el.nativeElement, styleName, styleValue); | ||
}; | ||
return LoadingBarComponent; | ||
@@ -213,4 +172,4 @@ }()); | ||
{ type: Component, args: [{ | ||
selector: 'ng-loading-bar', | ||
template: "\n <div id=\"loading-bar-spinner\" #loadingBarSpinner><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\" #loadingBarContainer><div class=\"bar\" #loadingBar><div class=\"peg\"></div></div></div>\n ", | ||
selector: 'ng-loading-bar, ngx-loading-bar', | ||
template: "\n <ng-container *ngIf=\"started\">\n <div id=\"loading-bar-spinner\" *ngIf=\"includeSpinner\"><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\"><div class=\"bar\" [style.width]=\"progressWidth\"><div class=\"peg\"></div></div></div>\n </ng-container>\n ", | ||
},] }, | ||
@@ -222,9 +181,5 @@ ]; | ||
LoadingBarComponent.ctorParameters = function () { return [ | ||
{ type: Renderer2, }, | ||
{ type: LoadingBarService, }, | ||
]; }; | ||
LoadingBarComponent.propDecorators = { | ||
'_spinner': [{ type: ViewChild, args: ['loadingBarSpinner',] },], | ||
'_loadingBarContainer': [{ type: ViewChild, args: ['loadingBarContainer',] },], | ||
'_loadingBar': [{ type: ViewChild, args: ['loadingBar',] },], | ||
'includeSpinner': [{ type: Input },], | ||
@@ -239,2 +194,3 @@ }; | ||
{ type: NgModule, args: [{ | ||
imports: [CommonModule], | ||
declarations: [LoadingBarComponent], | ||
@@ -241,0 +197,0 @@ exports: [LoadingBarComponent], |
@@ -1,11 +0,18 @@ | ||
import { Component, Injectable, Input, NgModule, Renderer2, ViewChild } from '@angular/core'; | ||
import { Subject } from 'rxjs/Subject'; | ||
import { share } from 'rxjs/operator/share'; | ||
import { CommonModule } from '@angular/common'; | ||
import { Component, Injectable, Input, NgModule } from '@angular/core'; | ||
import { Subject as Subject$1 } from 'rxjs/Subject'; | ||
import { share as share$1 } from 'rxjs/operator/share'; | ||
class LoadingBarService { | ||
constructor() { | ||
this.pending = new Subject(); | ||
this.pending = new Subject$1(); | ||
this._pendingRequests = 0; | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
ngOnDestroy() { | ||
this.pending.complete(); | ||
} | ||
/** | ||
* @param {?=} source$ | ||
@@ -16,3 +23,3 @@ * @return {?} | ||
if (source$) { | ||
share.call(source$).subscribe(this.getLoadingObserver()); | ||
share$1.call(source$).subscribe(this.getLoadingObserver()); | ||
} | ||
@@ -54,13 +61,10 @@ this.pending.next({ | ||
/** | ||
* @param {?} _renderer | ||
* @param {?} loadingBarService | ||
*/ | ||
constructor(_renderer, loadingBarService) { | ||
this._renderer = _renderer; | ||
constructor(loadingBarService) { | ||
this.includeSpinner = true; | ||
this._autoIncrement = true; | ||
this._includeBar = true; | ||
this.started = false; | ||
this.progressWidth = '0'; | ||
this._latencyThreshold = 10; | ||
this._startSize = 0.02; | ||
this._started = false; | ||
this._status = 0; | ||
@@ -75,9 +79,2 @@ loadingBarService.pending.subscribe((progress) => { | ||
/** | ||
* @return {?} | ||
*/ | ||
ngAfterViewInit() { | ||
this.hide(this._loadingBarContainer); | ||
this.hide(this._spinner); | ||
} | ||
/** | ||
* Inserts the loading bar element into the dom, and sets it to 2% | ||
@@ -90,13 +87,7 @@ * @return {?} | ||
// do not continually broadcast the started event: | ||
if (this._started) { | ||
if (this.started) { | ||
return; | ||
} | ||
this._started = true; | ||
this.started = true; | ||
this._status = 0; | ||
if (this._includeBar) { | ||
this.show(this._loadingBarContainer); | ||
} | ||
if (this.includeSpinner) { | ||
this.show(this._spinner); | ||
} | ||
this.set(this._startSize); | ||
@@ -112,7 +103,7 @@ }, this._latencyThreshold); | ||
set(n) { | ||
if (!this._started) { | ||
if (!this.started) { | ||
return; | ||
} | ||
const /** @type {?} */ pct = (n * 100) + '%'; | ||
this.setElementStyle(this._loadingBar, 'width', pct); | ||
this.progressWidth = pct; | ||
this._status = n; | ||
@@ -122,8 +113,4 @@ // increment loadingbar to give the illusion that there is always | ||
// have multiple incs running at the same time. | ||
if (this._autoIncrement) { | ||
clearTimeout(this._incTimeout); | ||
this._incTimeout = setTimeout(() => { | ||
this.inc(); | ||
}, 250); | ||
} | ||
clearTimeout(this._incTimeout); | ||
this._incTimeout = setTimeout(() => this.inc(), 250); | ||
} | ||
@@ -139,7 +126,3 @@ /** | ||
// Attempt to aggregate any start/complete calls within 500ms: | ||
this._completeTimeout = setTimeout(() => { | ||
this._started = false; | ||
this.hide(this._loadingBarContainer); | ||
this.hide(this._spinner); | ||
}, 500); | ||
this._completeTimeout = setTimeout(() => this.started = false, 500); | ||
}, this._latencyThreshold); | ||
@@ -178,35 +161,13 @@ } | ||
} | ||
let /** @type {?} */ pct = this._status + rnd; | ||
this.set(pct); | ||
this.set(this._status + rnd); | ||
} | ||
/** | ||
* @param {?} el | ||
* @return {?} | ||
*/ | ||
show(el) { | ||
this.setElementStyle(el, 'display', 'block'); | ||
} | ||
/** | ||
* @param {?} el | ||
* @return {?} | ||
*/ | ||
hide(el) { | ||
this.setElementStyle(el, 'display', 'none'); | ||
} | ||
/** | ||
* @param {?} el | ||
* @param {?} styleName | ||
* @param {?} styleValue | ||
* @return {?} | ||
*/ | ||
setElementStyle(el, styleName, styleValue) { | ||
this._renderer.setStyle(el.nativeElement, styleName, styleValue); | ||
} | ||
} | ||
LoadingBarComponent.decorators = [ | ||
{ type: Component, args: [{ | ||
selector: 'ng-loading-bar', | ||
selector: 'ng-loading-bar, ngx-loading-bar', | ||
template: ` | ||
<div id="loading-bar-spinner" #loadingBarSpinner><div class="spinner-icon"></div></div> | ||
<div id="loading-bar" #loadingBarContainer><div class="bar" #loadingBar><div class="peg"></div></div></div> | ||
<ng-container *ngIf="started"> | ||
<div id="loading-bar-spinner" *ngIf="includeSpinner"><div class="spinner-icon"></div></div> | ||
<div id="loading-bar"><div class="bar" [style.width]="progressWidth"><div class="peg"></div></div></div> | ||
</ng-container> | ||
`, | ||
@@ -219,9 +180,5 @@ },] }, | ||
LoadingBarComponent.ctorParameters = () => [ | ||
{ type: Renderer2, }, | ||
{ type: LoadingBarService, }, | ||
]; | ||
LoadingBarComponent.propDecorators = { | ||
'_spinner': [{ type: ViewChild, args: ['loadingBarSpinner',] },], | ||
'_loadingBarContainer': [{ type: ViewChild, args: ['loadingBarContainer',] },], | ||
'_loadingBar': [{ type: ViewChild, args: ['loadingBar',] },], | ||
'includeSpinner': [{ type: Input },], | ||
@@ -234,2 +191,3 @@ }; | ||
{ type: NgModule, args: [{ | ||
imports: [CommonModule], | ||
declarations: [LoadingBarComponent], | ||
@@ -236,0 +194,0 @@ exports: [LoadingBarComponent], |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs/Subject'), require('rxjs/operator/share')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', 'rxjs/Subject', 'rxjs/operator/share'], factory) : | ||
(factory((global.core = {}),global.ng.core,global.Rx,global.Rx.Observable.prototype)); | ||
}(this, (function (exports,_angular_core,rxjs_Subject,rxjs_operator_share) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('rxjs/Subject'), require('rxjs/operator/share')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@angular/common', '@angular/core', 'rxjs/Subject', 'rxjs/operator/share'], factory) : | ||
(factory((global.core = {}),global.ng.common,global.ng.core,global.Rx,global.Rx.Observable.prototype)); | ||
}(this, (function (exports,common,core,Subject,share) { 'use strict'; | ||
var LoadingBarService = (function () { | ||
function LoadingBarService() { | ||
this.pending = new rxjs_Subject.Subject(); | ||
this.pending = new Subject.Subject(); | ||
this._pendingRequests = 0; | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
LoadingBarService.prototype.ngOnDestroy = function () { | ||
this.pending.complete(); | ||
}; | ||
/** | ||
* @param {?=} source$ | ||
@@ -18,3 +24,3 @@ * @return {?} | ||
if (source$) { | ||
rxjs_operator_share.share.call(source$).subscribe(this.getLoadingObserver()); | ||
share.share.call(source$).subscribe(this.getLoadingObserver()); | ||
} | ||
@@ -49,3 +55,3 @@ this.pending.next({ | ||
LoadingBarService.decorators = [ | ||
{ type: _angular_core.Injectable }, | ||
{ type: core.Injectable }, | ||
]; | ||
@@ -58,14 +64,11 @@ /** | ||
/** | ||
* @param {?} _renderer | ||
* @param {?} loadingBarService | ||
*/ | ||
function LoadingBarComponent(_renderer, loadingBarService) { | ||
function LoadingBarComponent(loadingBarService) { | ||
var _this = this; | ||
this._renderer = _renderer; | ||
this.includeSpinner = true; | ||
this._autoIncrement = true; | ||
this._includeBar = true; | ||
this.started = false; | ||
this.progressWidth = '0'; | ||
this._latencyThreshold = 10; | ||
this._startSize = 0.02; | ||
this._started = false; | ||
this._status = 0; | ||
@@ -80,9 +83,2 @@ loadingBarService.pending.subscribe(function (progress) { | ||
/** | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.ngAfterViewInit = function () { | ||
this.hide(this._loadingBarContainer); | ||
this.hide(this._spinner); | ||
}; | ||
/** | ||
* Inserts the loading bar element into the dom, and sets it to 2% | ||
@@ -96,13 +92,7 @@ * @return {?} | ||
// do not continually broadcast the started event: | ||
if (_this._started) { | ||
if (_this.started) { | ||
return; | ||
} | ||
_this._started = true; | ||
_this.started = true; | ||
_this._status = 0; | ||
if (_this._includeBar) { | ||
_this.show(_this._loadingBarContainer); | ||
} | ||
if (_this.includeSpinner) { | ||
_this.show(_this._spinner); | ||
} | ||
_this.set(_this._startSize); | ||
@@ -119,7 +109,7 @@ }, this._latencyThreshold); | ||
var _this = this; | ||
if (!this._started) { | ||
if (!this.started) { | ||
return; | ||
} | ||
var /** @type {?} */ pct = (n * 100) + '%'; | ||
this.setElementStyle(this._loadingBar, 'width', pct); | ||
this.progressWidth = pct; | ||
this._status = n; | ||
@@ -129,8 +119,4 @@ // increment loadingbar to give the illusion that there is always | ||
// have multiple incs running at the same time. | ||
if (this._autoIncrement) { | ||
clearTimeout(this._incTimeout); | ||
this._incTimeout = setTimeout(function () { | ||
_this.inc(); | ||
}, 250); | ||
} | ||
clearTimeout(this._incTimeout); | ||
this._incTimeout = setTimeout(function () { return _this.inc(); }, 250); | ||
}; | ||
@@ -147,7 +133,3 @@ /** | ||
// Attempt to aggregate any start/complete calls within 500ms: | ||
_this._completeTimeout = setTimeout(function () { | ||
_this._started = false; | ||
_this.hide(_this._loadingBarContainer); | ||
_this.hide(_this._spinner); | ||
}, 500); | ||
_this._completeTimeout = setTimeout(function () { return _this.started = false; }, 500); | ||
}, this._latencyThreshold); | ||
@@ -186,34 +168,10 @@ }; | ||
} | ||
var /** @type {?} */ pct = this._status + rnd; | ||
this.set(pct); | ||
this.set(this._status + rnd); | ||
}; | ||
/** | ||
* @param {?} el | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.show = function (el) { | ||
this.setElementStyle(el, 'display', 'block'); | ||
}; | ||
/** | ||
* @param {?} el | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.hide = function (el) { | ||
this.setElementStyle(el, 'display', 'none'); | ||
}; | ||
/** | ||
* @param {?} el | ||
* @param {?} styleName | ||
* @param {?} styleValue | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.setElementStyle = function (el, styleName, styleValue) { | ||
this._renderer.setStyle(el.nativeElement, styleName, styleValue); | ||
}; | ||
return LoadingBarComponent; | ||
}()); | ||
LoadingBarComponent.decorators = [ | ||
{ type: _angular_core.Component, args: [{ | ||
selector: 'ng-loading-bar', | ||
template: "\n <div id=\"loading-bar-spinner\" #loadingBarSpinner><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\" #loadingBarContainer><div class=\"bar\" #loadingBar><div class=\"peg\"></div></div></div>\n ", | ||
{ type: core.Component, args: [{ | ||
selector: 'ng-loading-bar, ngx-loading-bar', | ||
template: "\n <ng-container *ngIf=\"started\">\n <div id=\"loading-bar-spinner\" *ngIf=\"includeSpinner\"><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\"><div class=\"bar\" [style.width]=\"progressWidth\"><div class=\"peg\"></div></div></div>\n </ng-container>\n ", | ||
},] }, | ||
@@ -225,10 +183,6 @@ ]; | ||
LoadingBarComponent.ctorParameters = function () { return [ | ||
{ type: _angular_core.Renderer2, }, | ||
{ type: LoadingBarService, }, | ||
]; }; | ||
LoadingBarComponent.propDecorators = { | ||
'_spinner': [{ type: _angular_core.ViewChild, args: ['loadingBarSpinner',] },], | ||
'_loadingBarContainer': [{ type: _angular_core.ViewChild, args: ['loadingBarContainer',] },], | ||
'_loadingBar': [{ type: _angular_core.ViewChild, args: ['loadingBar',] },], | ||
'includeSpinner': [{ type: _angular_core.Input },], | ||
'includeSpinner': [{ type: core.Input },], | ||
}; | ||
@@ -241,3 +195,4 @@ var LoadingBarModule = (function () { | ||
LoadingBarModule.decorators = [ | ||
{ type: _angular_core.NgModule, args: [{ | ||
{ type: core.NgModule, args: [{ | ||
imports: [common.CommonModule], | ||
declarations: [LoadingBarComponent], | ||
@@ -244,0 +199,0 @@ exports: [LoadingBarComponent], |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":3,"metadata":{"LoadingBarModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","name":"LoadingBarComponent"}],"exports":[{"__symbolic":"reference","name":"LoadingBarComponent"}],"providers":[{"__symbolic":"reference","name":"LoadingBarService"}]}]}],"members":{}},"LoadingBarService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"startLoading":[{"__symbolic":"method"}],"endLoading":[{"__symbolic":"method"}],"getLoadingObserver":[{"__symbolic":"method"}]}},"LoadingBarComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ng-loading-bar","template":"\n <div id=\"loading-bar-spinner\" #loadingBarSpinner><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\" #loadingBarContainer><div class=\"bar\" #loadingBar><div class=\"peg\"></div></div></div>\n "}]}],"members":{"_spinner":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["loadingBarSpinner"]}]}],"_loadingBarContainer":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["loadingBarContainer"]}]}],"_loadingBar":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild"},"arguments":["loadingBar"]}]}],"includeSpinner":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"Renderer2"},{"__symbolic":"reference","name":"LoadingBarService"}]}],"ngAfterViewInit":[{"__symbolic":"method"}],"start":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"complete":[{"__symbolic":"method"}],"inc":[{"__symbolic":"method"}],"show":[{"__symbolic":"method"}],"hide":[{"__symbolic":"method"}],"setElementStyle":[{"__symbolic":"method"}]}}},"origins":{"LoadingBarModule":"./core.module","LoadingBarService":"./loading-bar.service","LoadingBarComponent":"./loading-bar.component"},"importAs":"@ngx-loading-bar/core"} | ||
{"__symbolic":"module","version":3,"metadata":{"LoadingBarModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"}],"declarations":[{"__symbolic":"reference","name":"LoadingBarComponent"}],"exports":[{"__symbolic":"reference","name":"LoadingBarComponent"}],"providers":[{"__symbolic":"reference","name":"LoadingBarService"}]}]}],"members":{}},"LoadingBarService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"ngOnDestroy":[{"__symbolic":"method"}],"startLoading":[{"__symbolic":"method"}],"endLoading":[{"__symbolic":"method"}],"getLoadingObserver":[{"__symbolic":"method"}]}},"LoadingBarComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"ng-loading-bar, ngx-loading-bar","template":"\n <ng-container *ngIf=\"started\">\n <div id=\"loading-bar-spinner\" *ngIf=\"includeSpinner\"><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\"><div class=\"bar\" [style.width]=\"progressWidth\"><div class=\"peg\"></div></div></div>\n </ng-container>\n "}]}],"members":{"includeSpinner":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"LoadingBarService"}]}],"start":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"complete":[{"__symbolic":"method"}],"inc":[{"__symbolic":"method"}]}}},"origins":{"LoadingBarModule":"./core.module","LoadingBarService":"./loading-bar.service","LoadingBarComponent":"./loading-bar.component"},"importAs":"@ngx-loading-bar/core"} |
@@ -1,14 +0,8 @@ | ||
import { Renderer2, AfterViewInit } from '@angular/core'; | ||
import { LoadingBarService } from './loading-bar.service'; | ||
export declare class LoadingBarComponent implements AfterViewInit { | ||
private _renderer; | ||
_spinner: any; | ||
_loadingBarContainer: any; | ||
_loadingBar: any; | ||
export declare class LoadingBarComponent { | ||
includeSpinner: boolean; | ||
private _autoIncrement; | ||
private _includeBar; | ||
started: boolean; | ||
progressWidth: string; | ||
private _latencyThreshold; | ||
private _startSize; | ||
private _started; | ||
private _status; | ||
@@ -18,4 +12,3 @@ private _incTimeout; | ||
private _startTimeout; | ||
constructor(_renderer: Renderer2, loadingBarService: LoadingBarService); | ||
ngAfterViewInit(): void; | ||
constructor(loadingBarService: LoadingBarService); | ||
/** | ||
@@ -37,5 +30,2 @@ * Inserts the loading bar element into the dom, and sets it to 2% | ||
private inc(); | ||
private show(el); | ||
private hide(el); | ||
private setElementStyle(el, styleName, styleValue); | ||
} |
@@ -0,7 +1,14 @@ | ||
import { OnDestroy } from '@angular/core'; | ||
import { Subject } from 'rxjs/Subject'; | ||
import { Observer } from 'rxjs/Observer'; | ||
import { Observable } from 'rxjs/Observable'; | ||
export declare class LoadingBarService { | ||
pending: Subject<{}>; | ||
export interface LoadingBarStatus { | ||
started?: boolean; | ||
completed?: boolean; | ||
pendingRequests: number; | ||
} | ||
export declare class LoadingBarService implements OnDestroy { | ||
pending: Subject<LoadingBarStatus>; | ||
private _pendingRequests; | ||
ngOnDestroy(): void; | ||
startLoading(source$?: Observable<any>): void; | ||
@@ -8,0 +15,0 @@ endLoading(): void; |
{ | ||
"name": "@ngx-loading-bar/core", | ||
"version": "1.0.0-alpha.1", | ||
"version": "1.0.0-alpha.2", | ||
"description": "", | ||
@@ -10,3 +10,3 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@angular/core": "^4.0" | ||
"@angular/common": "^4.0" | ||
}, | ||
@@ -13,0 +13,0 @@ "main": "bundles/core.umd.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62384
742