@ngx-loading-bar/core
Advanced tools
Comparing version 1.0.0-alpha.14 to 1.0.0-alpha.15
@@ -6,5 +6,18 @@ import { Component, Injectable, Input, NgModule } from '@angular/core'; | ||
function LoadingBarService() { | ||
this.pending = new Subject$1(); | ||
this.progress$ = new Subject$1(); | ||
this._pending = new Subject$1(); | ||
this._pendingRequests = 0; | ||
this._value = 0; | ||
} | ||
Object.defineProperty(LoadingBarService.prototype, "pending", { | ||
/** | ||
* @return {?} | ||
*/ | ||
get: function () { | ||
console.warn("LoadingBarService: 'pending' is deprecated and will removed in the next version use 'progress$' instead which return a value between 0 and 100."); | ||
return this._pending; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
/** | ||
@@ -14,3 +27,7 @@ * @return {?} | ||
LoadingBarService.prototype.start = function () { | ||
this.pending.next(++this._pendingRequests); | ||
this._pending.next(++this._pendingRequests); | ||
if (this._value === 0 || this._value === 100) { | ||
// Inserts the loading bar element into the dom, and sets it to 2% | ||
this.set(2); | ||
} | ||
}; | ||
@@ -21,6 +38,19 @@ /** | ||
LoadingBarService.prototype.complete = function () { | ||
var _this = this; | ||
if (this._pendingRequests === 0) { | ||
return; | ||
} | ||
this.pending.next(--this._pendingRequests); | ||
this._pending.next(--this._pendingRequests); | ||
if (this._pendingRequests === 0 && this._value !== 100) { | ||
if (this._value > 0) { | ||
this.set(100); | ||
// Attempt to aggregate any start/complete calls within 500ms: | ||
setTimeout(function () { | ||
if (_this._value === 100) { | ||
_this.progress$.next(0); | ||
_this._value = 0; | ||
} | ||
}, 500); | ||
} | ||
} | ||
}; | ||
@@ -31,77 +61,15 @@ /** | ||
LoadingBarService.prototype.ngOnDestroy = function () { | ||
this.pending.complete(); | ||
this._pending.complete(); | ||
this.progress$.complete(); | ||
}; | ||
return LoadingBarService; | ||
}()); | ||
LoadingBarService.decorators = [ | ||
{ type: Injectable }, | ||
]; | ||
/** | ||
* @nocollapse | ||
*/ | ||
LoadingBarService.ctorParameters = function () { return []; }; | ||
var LoadingBarComponent = /** @class */ (function () { | ||
/** | ||
* @param {?} loadingBarService | ||
*/ | ||
function LoadingBarComponent(loadingBarService) { | ||
var _this = this; | ||
this.includeSpinner = true; | ||
this.value = 0; | ||
this.started = false; | ||
this._latencyThreshold = 10; | ||
this._startSize = 0.02; | ||
this._status = 0; | ||
loadingBarService.pending.subscribe(function (pendingRequests) { | ||
if (pendingRequests !== 0 && !_this.started) { | ||
_this.start(); | ||
} | ||
if (pendingRequests === 0) { | ||
_this.complete(); | ||
} | ||
}); | ||
} | ||
/** | ||
* Inserts the loading bar element into the dom, and sets it to 2% | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.start = function () { | ||
var _this = this; | ||
this._startTimeout = setTimeout(function () { | ||
clearTimeout(_this._completeTimeout); | ||
// do not continually broadcast the started event: | ||
if (_this.started) { | ||
return; | ||
} | ||
_this.started = true; | ||
_this._status = 0; | ||
_this.set(_this._startSize); | ||
}, this._latencyThreshold); | ||
}; | ||
/** | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.complete = function () { | ||
var _this = this; | ||
setTimeout(function () { | ||
_this.set(1); | ||
clearTimeout(_this._completeTimeout); | ||
clearTimeout(_this._startTimeout); | ||
// Attempt to aggregate any start/complete calls within 500ms: | ||
_this._completeTimeout = setTimeout(function () { return _this.started = false; }, 500); | ||
}, this._latencyThreshold); | ||
}; | ||
/** | ||
* Set the loading bar's width to a certain percent. | ||
* | ||
* @param {?} n any value between 0 and 1 | ||
* @param {?} n any value between 0 and 100 | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.set = function (n) { | ||
LoadingBarService.prototype.set = function (n) { | ||
var _this = this; | ||
if (!this.started) { | ||
return; | ||
} | ||
this.value = n * 100; | ||
this._status = n; | ||
this._value = n; | ||
this.progress$.next(n); | ||
// increment loadingbar to give the illusion that there is always | ||
@@ -111,3 +79,5 @@ // progress but make sure to cancel the previous timeouts so we don't | ||
clearTimeout(this._incTimeout); | ||
this._incTimeout = setTimeout(function () { return _this.increment(); }, 250); | ||
if (this._value < 100) { | ||
this._incTimeout = setTimeout(function () { return _this.increment(); }, 250); | ||
} | ||
}; | ||
@@ -119,23 +89,20 @@ /** | ||
*/ | ||
LoadingBarComponent.prototype.increment = function () { | ||
if (this._status >= 1) { | ||
return; | ||
} | ||
LoadingBarService.prototype.increment = function () { | ||
var /** @type {?} */ rnd = 0; | ||
var /** @type {?} */ stat = this._status; | ||
if (stat >= 0 && stat < 0.25) { | ||
var /** @type {?} */ stat = this._value; | ||
if (stat >= 0 && stat < 25) { | ||
// Start out between 3 - 6% increments | ||
rnd = (Math.random() * (5 - 3 + 1) + 3) / 100; | ||
rnd = (Math.random() * (5 - 3 + 1) + 3); | ||
} | ||
else if (stat >= 0.25 && stat < 0.65) { | ||
else if (stat >= 25 && stat < 65) { | ||
// increment between 0 - 3% | ||
rnd = (Math.random() * 3) / 100; | ||
rnd = (Math.random() * 3); | ||
} | ||
else if (stat >= 0.65 && stat < 0.9) { | ||
else if (stat >= 65 && stat < 90) { | ||
// increment between 0 - 2% | ||
rnd = (Math.random() * 2) / 100; | ||
rnd = (Math.random() * 2); | ||
} | ||
else if (stat >= 0.9 && stat < 0.99) { | ||
else if (stat >= 90 && stat < 99) { | ||
// finally, increment it .5 % | ||
rnd = 0.005; | ||
rnd = 0.5; | ||
} | ||
@@ -146,4 +113,22 @@ else { | ||
} | ||
this.set(this._status + rnd); | ||
this.set(this._value + rnd); | ||
}; | ||
return LoadingBarService; | ||
}()); | ||
LoadingBarService.decorators = [ | ||
{ type: Injectable }, | ||
]; | ||
/** | ||
* @nocollapse | ||
*/ | ||
LoadingBarService.ctorParameters = function () { return []; }; | ||
var LoadingBarComponent = /** @class */ (function () { | ||
/** | ||
* @param {?} loader | ||
*/ | ||
function LoadingBarComponent(loader) { | ||
this.loader = loader; | ||
this.includeSpinner = true; | ||
this.progress$ = this.loader.progress$; | ||
} | ||
return LoadingBarComponent; | ||
@@ -154,3 +139,3 @@ }()); | ||
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]=\"value + '%'\"><div class=\"peg\"></div></div></div>\n </ng-container>\n ", | ||
template: "\n <ng-container *ngIf=\"(progress$|async) as value\">\n <div id=\"loading-bar-spinner\" *ngIf=\"includeSpinner\"><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\"><div class=\"bar\" [style.width]=\"value + '%'\"><div class=\"peg\"></div></div></div>\n </ng-container>\n ", | ||
},] }, | ||
@@ -157,0 +142,0 @@ ]; |
@@ -7,4 +7,6 @@ import { Component, Injectable, Input, NgModule } from '@angular/core'; | ||
constructor() { | ||
this.pending = new Subject$1(); | ||
this.progress$ = new Subject$1(); | ||
this._pending = new Subject$1(); | ||
this._pendingRequests = 0; | ||
this._value = 0; | ||
} | ||
@@ -14,4 +16,15 @@ /** | ||
*/ | ||
get pending() { | ||
console.warn(`LoadingBarService: 'pending' is deprecated and will removed in the next version use 'progress$' instead which return a value between 0 and 100.`); | ||
return this._pending; | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
start() { | ||
this.pending.next(++this._pendingRequests); | ||
this._pending.next(++this._pendingRequests); | ||
if (this._value === 0 || this._value === 100) { | ||
// Inserts the loading bar element into the dom, and sets it to 2% | ||
this.set(2); | ||
} | ||
} | ||
@@ -25,3 +38,15 @@ /** | ||
} | ||
this.pending.next(--this._pendingRequests); | ||
this._pending.next(--this._pendingRequests); | ||
if (this._pendingRequests === 0 && this._value !== 100) { | ||
if (this._value > 0) { | ||
this.set(100); | ||
// Attempt to aggregate any start/complete calls within 500ms: | ||
setTimeout(() => { | ||
if (this._value === 100) { | ||
this.progress$.next(0); | ||
this._value = 0; | ||
} | ||
}, 500); | ||
} | ||
} | ||
} | ||
@@ -32,73 +57,14 @@ /** | ||
ngOnDestroy() { | ||
this.pending.complete(); | ||
this._pending.complete(); | ||
this.progress$.complete(); | ||
} | ||
} | ||
LoadingBarService.decorators = [ | ||
{ type: Injectable }, | ||
]; | ||
/** | ||
* @nocollapse | ||
*/ | ||
LoadingBarService.ctorParameters = () => []; | ||
class LoadingBarComponent { | ||
/** | ||
* @param {?} loadingBarService | ||
*/ | ||
constructor(loadingBarService) { | ||
this.includeSpinner = true; | ||
this.value = 0; | ||
this.started = false; | ||
this._latencyThreshold = 10; | ||
this._startSize = 0.02; | ||
this._status = 0; | ||
loadingBarService.pending.subscribe((pendingRequests) => { | ||
if (pendingRequests !== 0 && !this.started) { | ||
this.start(); | ||
} | ||
if (pendingRequests === 0) { | ||
this.complete(); | ||
} | ||
}); | ||
} | ||
/** | ||
* Inserts the loading bar element into the dom, and sets it to 2% | ||
* @return {?} | ||
*/ | ||
start() { | ||
this._startTimeout = setTimeout(() => { | ||
clearTimeout(this._completeTimeout); | ||
// do not continually broadcast the started event: | ||
if (this.started) { | ||
return; | ||
} | ||
this.started = true; | ||
this._status = 0; | ||
this.set(this._startSize); | ||
}, this._latencyThreshold); | ||
} | ||
/** | ||
* @return {?} | ||
*/ | ||
complete() { | ||
setTimeout(() => { | ||
this.set(1); | ||
clearTimeout(this._completeTimeout); | ||
clearTimeout(this._startTimeout); | ||
// Attempt to aggregate any start/complete calls within 500ms: | ||
this._completeTimeout = setTimeout(() => this.started = false, 500); | ||
}, this._latencyThreshold); | ||
} | ||
/** | ||
* Set the loading bar's width to a certain percent. | ||
* | ||
* @param {?} n any value between 0 and 1 | ||
* @param {?} n any value between 0 and 100 | ||
* @return {?} | ||
*/ | ||
set(n) { | ||
if (!this.started) { | ||
return; | ||
} | ||
this.value = n * 100; | ||
this._status = n; | ||
this._value = n; | ||
this.progress$.next(n); | ||
// increment loadingbar to give the illusion that there is always | ||
@@ -108,3 +74,5 @@ // progress but make sure to cancel the previous timeouts so we don't | ||
clearTimeout(this._incTimeout); | ||
this._incTimeout = setTimeout(() => this.increment(), 250); | ||
if (this._value < 100) { | ||
this._incTimeout = setTimeout(() => this.increment(), 250); | ||
} | ||
} | ||
@@ -117,22 +85,19 @@ /** | ||
increment() { | ||
if (this._status >= 1) { | ||
return; | ||
} | ||
let /** @type {?} */ rnd = 0; | ||
const /** @type {?} */ stat = this._status; | ||
if (stat >= 0 && stat < 0.25) { | ||
const /** @type {?} */ stat = this._value; | ||
if (stat >= 0 && stat < 25) { | ||
// Start out between 3 - 6% increments | ||
rnd = (Math.random() * (5 - 3 + 1) + 3) / 100; | ||
rnd = (Math.random() * (5 - 3 + 1) + 3); | ||
} | ||
else if (stat >= 0.25 && stat < 0.65) { | ||
else if (stat >= 25 && stat < 65) { | ||
// increment between 0 - 3% | ||
rnd = (Math.random() * 3) / 100; | ||
rnd = (Math.random() * 3); | ||
} | ||
else if (stat >= 0.65 && stat < 0.9) { | ||
else if (stat >= 65 && stat < 90) { | ||
// increment between 0 - 2% | ||
rnd = (Math.random() * 2) / 100; | ||
rnd = (Math.random() * 2); | ||
} | ||
else if (stat >= 0.9 && stat < 0.99) { | ||
else if (stat >= 90 && stat < 99) { | ||
// finally, increment it .5 % | ||
rnd = 0.005; | ||
rnd = 0.5; | ||
} | ||
@@ -143,5 +108,23 @@ else { | ||
} | ||
this.set(this._status + rnd); | ||
this.set(this._value + rnd); | ||
} | ||
} | ||
LoadingBarService.decorators = [ | ||
{ type: Injectable }, | ||
]; | ||
/** | ||
* @nocollapse | ||
*/ | ||
LoadingBarService.ctorParameters = () => []; | ||
class LoadingBarComponent { | ||
/** | ||
* @param {?} loader | ||
*/ | ||
constructor(loader) { | ||
this.loader = loader; | ||
this.includeSpinner = true; | ||
this.progress$ = this.loader.progress$; | ||
} | ||
} | ||
LoadingBarComponent.decorators = [ | ||
@@ -151,3 +134,3 @@ { type: Component, args: [{ | ||
template: ` | ||
<ng-container *ngIf="started"> | ||
<ng-container *ngIf="(progress$|async) as value"> | ||
<div id="loading-bar-spinner" *ngIf="includeSpinner"><div class="spinner-icon"></div></div> | ||
@@ -154,0 +137,0 @@ <div id="loading-bar"><div class="bar" [style.width]="value + '%'"><div class="peg"></div></div></div> |
@@ -9,5 +9,18 @@ (function (global, factory) { | ||
function LoadingBarService() { | ||
this.pending = new Subject.Subject(); | ||
this.progress$ = new Subject.Subject(); | ||
this._pending = new Subject.Subject(); | ||
this._pendingRequests = 0; | ||
this._value = 0; | ||
} | ||
Object.defineProperty(LoadingBarService.prototype, "pending", { | ||
/** | ||
* @return {?} | ||
*/ | ||
get: function () { | ||
console.warn("LoadingBarService: 'pending' is deprecated and will removed in the next version use 'progress$' instead which return a value between 0 and 100."); | ||
return this._pending; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
/** | ||
@@ -17,3 +30,7 @@ * @return {?} | ||
LoadingBarService.prototype.start = function () { | ||
this.pending.next(++this._pendingRequests); | ||
this._pending.next(++this._pendingRequests); | ||
if (this._value === 0 || this._value === 100) { | ||
// Inserts the loading bar element into the dom, and sets it to 2% | ||
this.set(2); | ||
} | ||
}; | ||
@@ -24,6 +41,19 @@ /** | ||
LoadingBarService.prototype.complete = function () { | ||
var _this = this; | ||
if (this._pendingRequests === 0) { | ||
return; | ||
} | ||
this.pending.next(--this._pendingRequests); | ||
this._pending.next(--this._pendingRequests); | ||
if (this._pendingRequests === 0 && this._value !== 100) { | ||
if (this._value > 0) { | ||
this.set(100); | ||
// Attempt to aggregate any start/complete calls within 500ms: | ||
setTimeout(function () { | ||
if (_this._value === 100) { | ||
_this.progress$.next(0); | ||
_this._value = 0; | ||
} | ||
}, 500); | ||
} | ||
} | ||
}; | ||
@@ -34,77 +64,15 @@ /** | ||
LoadingBarService.prototype.ngOnDestroy = function () { | ||
this.pending.complete(); | ||
this._pending.complete(); | ||
this.progress$.complete(); | ||
}; | ||
return LoadingBarService; | ||
}()); | ||
LoadingBarService.decorators = [ | ||
{ type: core.Injectable }, | ||
]; | ||
/** | ||
* @nocollapse | ||
*/ | ||
LoadingBarService.ctorParameters = function () { return []; }; | ||
var LoadingBarComponent = /** @class */ (function () { | ||
/** | ||
* @param {?} loadingBarService | ||
*/ | ||
function LoadingBarComponent(loadingBarService) { | ||
var _this = this; | ||
this.includeSpinner = true; | ||
this.value = 0; | ||
this.started = false; | ||
this._latencyThreshold = 10; | ||
this._startSize = 0.02; | ||
this._status = 0; | ||
loadingBarService.pending.subscribe(function (pendingRequests) { | ||
if (pendingRequests !== 0 && !_this.started) { | ||
_this.start(); | ||
} | ||
if (pendingRequests === 0) { | ||
_this.complete(); | ||
} | ||
}); | ||
} | ||
/** | ||
* Inserts the loading bar element into the dom, and sets it to 2% | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.start = function () { | ||
var _this = this; | ||
this._startTimeout = setTimeout(function () { | ||
clearTimeout(_this._completeTimeout); | ||
// do not continually broadcast the started event: | ||
if (_this.started) { | ||
return; | ||
} | ||
_this.started = true; | ||
_this._status = 0; | ||
_this.set(_this._startSize); | ||
}, this._latencyThreshold); | ||
}; | ||
/** | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.complete = function () { | ||
var _this = this; | ||
setTimeout(function () { | ||
_this.set(1); | ||
clearTimeout(_this._completeTimeout); | ||
clearTimeout(_this._startTimeout); | ||
// Attempt to aggregate any start/complete calls within 500ms: | ||
_this._completeTimeout = setTimeout(function () { return _this.started = false; }, 500); | ||
}, this._latencyThreshold); | ||
}; | ||
/** | ||
* Set the loading bar's width to a certain percent. | ||
* | ||
* @param {?} n any value between 0 and 1 | ||
* @param {?} n any value between 0 and 100 | ||
* @return {?} | ||
*/ | ||
LoadingBarComponent.prototype.set = function (n) { | ||
LoadingBarService.prototype.set = function (n) { | ||
var _this = this; | ||
if (!this.started) { | ||
return; | ||
} | ||
this.value = n * 100; | ||
this._status = n; | ||
this._value = n; | ||
this.progress$.next(n); | ||
// increment loadingbar to give the illusion that there is always | ||
@@ -114,3 +82,5 @@ // progress but make sure to cancel the previous timeouts so we don't | ||
clearTimeout(this._incTimeout); | ||
this._incTimeout = setTimeout(function () { return _this.increment(); }, 250); | ||
if (this._value < 100) { | ||
this._incTimeout = setTimeout(function () { return _this.increment(); }, 250); | ||
} | ||
}; | ||
@@ -122,23 +92,20 @@ /** | ||
*/ | ||
LoadingBarComponent.prototype.increment = function () { | ||
if (this._status >= 1) { | ||
return; | ||
} | ||
LoadingBarService.prototype.increment = function () { | ||
var /** @type {?} */ rnd = 0; | ||
var /** @type {?} */ stat = this._status; | ||
if (stat >= 0 && stat < 0.25) { | ||
var /** @type {?} */ stat = this._value; | ||
if (stat >= 0 && stat < 25) { | ||
// Start out between 3 - 6% increments | ||
rnd = (Math.random() * (5 - 3 + 1) + 3) / 100; | ||
rnd = (Math.random() * (5 - 3 + 1) + 3); | ||
} | ||
else if (stat >= 0.25 && stat < 0.65) { | ||
else if (stat >= 25 && stat < 65) { | ||
// increment between 0 - 3% | ||
rnd = (Math.random() * 3) / 100; | ||
rnd = (Math.random() * 3); | ||
} | ||
else if (stat >= 0.65 && stat < 0.9) { | ||
else if (stat >= 65 && stat < 90) { | ||
// increment between 0 - 2% | ||
rnd = (Math.random() * 2) / 100; | ||
rnd = (Math.random() * 2); | ||
} | ||
else if (stat >= 0.9 && stat < 0.99) { | ||
else if (stat >= 90 && stat < 99) { | ||
// finally, increment it .5 % | ||
rnd = 0.005; | ||
rnd = 0.5; | ||
} | ||
@@ -149,4 +116,22 @@ else { | ||
} | ||
this.set(this._status + rnd); | ||
this.set(this._value + rnd); | ||
}; | ||
return LoadingBarService; | ||
}()); | ||
LoadingBarService.decorators = [ | ||
{ type: core.Injectable }, | ||
]; | ||
/** | ||
* @nocollapse | ||
*/ | ||
LoadingBarService.ctorParameters = function () { return []; }; | ||
var LoadingBarComponent = /** @class */ (function () { | ||
/** | ||
* @param {?} loader | ||
*/ | ||
function LoadingBarComponent(loader) { | ||
this.loader = loader; | ||
this.includeSpinner = true; | ||
this.progress$ = this.loader.progress$; | ||
} | ||
return LoadingBarComponent; | ||
@@ -157,3 +142,3 @@ }()); | ||
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]=\"value + '%'\"><div class=\"peg\"></div></div></div>\n </ng-container>\n ", | ||
template: "\n <ng-container *ngIf=\"(progress$|async) as value\">\n <div id=\"loading-bar-spinner\" *ngIf=\"includeSpinner\"><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\"><div class=\"bar\" [style.width]=\"value + '%'\"><div class=\"peg\"></div></div></div>\n </ng-container>\n ", | ||
},] }, | ||
@@ -160,0 +145,0 @@ ]; |
@@ -1,1 +0,1 @@ | ||
{"__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"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"LoadingBarModule"},"providers":[{"__symbolic":"reference","name":"LoadingBarService"}]}}}},"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]=\"value + '%'\"><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"}],"complete":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"increment":[{"__symbolic":"method"}]}},"LoadingBarService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"start":[{"__symbolic":"method"}],"complete":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}]}}},"origins":{"LoadingBarModule":"./core.module","LoadingBarComponent":"./loading-bar.component","LoadingBarService":"./loading-bar.service"},"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"}]}]}],"members":{},"statics":{"forRoot":{"__symbolic":"function","parameters":[],"value":{"ngModule":{"__symbolic":"reference","name":"LoadingBarModule"},"providers":[{"__symbolic":"reference","name":"LoadingBarService"}]}}}},"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=\"(progress$|async) as value\">\n <div id=\"loading-bar-spinner\" *ngIf=\"includeSpinner\"><div class=\"spinner-icon\"></div></div>\n <div id=\"loading-bar\"><div class=\"bar\" [style.width]=\"value + '%'\"><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"}]}]}},"LoadingBarService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"start":[{"__symbolic":"method"}],"complete":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"increment":[{"__symbolic":"method"}]}}},"origins":{"LoadingBarModule":"./core.module","LoadingBarComponent":"./loading-bar.component","LoadingBarService":"./loading-bar.service"},"importAs":"@ngx-loading-bar/core"} |
import { LoadingBarService } from './loading-bar.service'; | ||
import { Subject } from 'rxjs/Subject'; | ||
export declare class LoadingBarComponent { | ||
private loader; | ||
includeSpinner: boolean; | ||
value: number; | ||
started: boolean; | ||
private _latencyThreshold; | ||
private _startSize; | ||
private _status; | ||
private _incTimeout; | ||
private _completeTimeout; | ||
private _startTimeout; | ||
constructor(loadingBarService: LoadingBarService); | ||
/** | ||
* Inserts the loading bar element into the dom, and sets it to 2% | ||
*/ | ||
private start(); | ||
private complete(); | ||
/** | ||
* Set the loading bar's width to a certain percent. | ||
* | ||
* @param n any value between 0 and 1 | ||
*/ | ||
private set(n); | ||
/** | ||
* Increments the loading bar by a random amount | ||
* but slows down as it progresses | ||
*/ | ||
private increment(); | ||
progress$: Subject<number>; | ||
constructor(loader: LoadingBarService); | ||
} |
import { OnDestroy } from '@angular/core'; | ||
import { Subject } from 'rxjs/Subject'; | ||
export interface LoadingBarStatus { | ||
started?: boolean; | ||
completed?: boolean; | ||
pendingRequests: number; | ||
} | ||
export declare class LoadingBarService implements OnDestroy { | ||
pending: Subject<number>; | ||
readonly progress$: Subject<number>; | ||
private _pending; | ||
private _pendingRequests; | ||
private _value; | ||
private _incTimeout; | ||
readonly pending: Subject<number>; | ||
start(): void; | ||
complete(): void; | ||
ngOnDestroy(): void; | ||
/** | ||
* Set the loading bar's width to a certain percent. | ||
* | ||
* @param n any value between 0 and 100 | ||
*/ | ||
private set(n); | ||
/** | ||
* Increments the loading bar by a random amount | ||
* but slows down as it progresses | ||
*/ | ||
private increment(); | ||
} |
{ | ||
"name": "@ngx-loading-bar/core", | ||
"version": "1.0.0-alpha.14", | ||
"version": "1.0.0-alpha.15", | ||
"description": "Automatic page loading / progress bar for Angular", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
54581
642