@ngx-loading-bar/core
Advanced tools
Comparing version 5.0.2 to 5.1.0
@@ -222,4 +222,6 @@ (function (global, factory) { | ||
var LoadingBarState = /** @class */ (function () { | ||
function LoadingBarState() { | ||
function LoadingBarState(config) { | ||
var _this = this; | ||
if (config === void 0) { config = {}; } | ||
this.config = config; | ||
this.state = { | ||
@@ -240,6 +242,7 @@ action: null, | ||
case 'set': { | ||
if (s.action === 'start' && _this.config.latencyThreshold === 0 && s.value === 0) { | ||
s.value = s.initialValue; | ||
} | ||
if (_this.requests > 0) { | ||
state$ = rxjs.timer(0, 250).pipe(operators.map(function (t) { | ||
return t === 0 ? __assign(__assign({}, s), { value: _this.state.value || s.initialValue }) : __assign(__assign({}, s), { value: _this._increment() }); | ||
})); | ||
state$ = rxjs.timer(_this.config.latencyThreshold, 250).pipe(operators.map(function (t) { return (__assign(__assign({}, s), { value: t === 0 ? _this.state.value || s.initialValue : _this._increment() })); })); | ||
} | ||
@@ -260,2 +263,3 @@ break; | ||
}; | ||
this.config = __assign({ latencyThreshold: 0 }, config); | ||
} | ||
@@ -353,6 +357,10 @@ Object.defineProperty(LoadingBarState.prototype, "value$", { | ||
var LOADING_BAR_CONFIG = new core.InjectionToken('LOADING_BAR_CONFIG'); | ||
var LoadingBarService = /** @class */ (function () { | ||
function LoadingBarService(platformId) { | ||
function LoadingBarService(platformId, config) { | ||
var _this = this; | ||
if (config === void 0) { config = {}; } | ||
this.platformId = platformId; | ||
this.config = config; | ||
this.refs = {}; | ||
@@ -394,3 +402,3 @@ this.streams$ = new rxjs.Subject(); | ||
if (!this.refs[id]) { | ||
this.refs[id] = new LoadingBarState(); | ||
this.refs[id] = new LoadingBarState(this.config); | ||
this.streams$.next(); | ||
@@ -404,9 +412,11 @@ if (!common.isPlatformBrowser(this.platformId)) { | ||
LoadingBarService.ctorParameters = function () { return [ | ||
{ type: Object, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] }] } | ||
{ type: Object, decorators: [{ type: core.Inject, args: [core.PLATFORM_ID,] }] }, | ||
{ type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [LOADING_BAR_CONFIG,] }] } | ||
]; }; | ||
LoadingBarService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function LoadingBarService_Factory() { return new LoadingBarService(core["ɵɵinject"](core.PLATFORM_ID)); }, token: LoadingBarService, providedIn: "root" }); | ||
LoadingBarService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function LoadingBarService_Factory() { return new LoadingBarService(core["ɵɵinject"](core.PLATFORM_ID), core["ɵɵinject"](LOADING_BAR_CONFIG, 8)); }, token: LoadingBarService, providedIn: "root" }); | ||
LoadingBarService = __decorate([ | ||
core.Injectable({ providedIn: 'root' }), | ||
__param(0, core.Inject(core.PLATFORM_ID)), | ||
__metadata("design:paramtypes", [Object]) | ||
__param(1, core.Optional()), __param(1, core.Inject(LOADING_BAR_CONFIG)), | ||
__metadata("design:paramtypes", [Object, Object]) | ||
], LoadingBarService); | ||
@@ -497,2 +507,3 @@ return LoadingBarService; | ||
exports.LOADING_BAR_CONFIG = LOADING_BAR_CONFIG; | ||
exports.LoadingBarComponent = LoadingBarComponent; | ||
@@ -499,0 +510,0 @@ exports.LoadingBarModule = LoadingBarModule; |
@@ -15,3 +15,3 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("@ngx-loading-bar/core",["exports","@angular/core","@angular/common","rxjs","rxjs/operators"],e):e(((t=t||self)["ngx-loading-bar"]=t["ngx-loading-bar"]||{},t["ngx-loading-bar"].core={}),t.ng.core,t.ng.common,t.rxjs,t.rxjs.operators)}(this,(function(t,e,n,r,i){"use strict"; | ||
and limitations under the License. | ||
***************************************************************************** */var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function a(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function u(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function p(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t}var c=function(){function t(){var t=this;this.state={action:null,value:0,initialValue:0},this.requests=null,this.disabled=!1,this.stream$=new r.Subject,this._value$=null,this.timer$=function(e){var n=r.of(e);switch(e.action){case"start":case"increment":case"set":t.requests>0&&(n=r.timer(0,250).pipe(i.map((function(n){return o(o({},e),0===n?{value:t.state.value||e.initialValue}:{value:t._increment()})}))));break;case"complete":case"stop":n=0===e.value?r.of(o({},e)):r.timer(0,500).pipe(i.take(2),i.map((function(t){return{value:0===t?100:0}})))}return n.pipe(i.map((function(t){return o(o({},t),{action:"set"})})),i.tap((function(e){return t.next(e,!1)})))}}return Object.defineProperty(t.prototype,"value$",{get:function(){var t=this;return this._value$?this._value$:this._value$=this.stream$.asObservable().pipe(i.startWith(this.state),i.switchMap((function(e){return t.timer$(e)})),i.shareReplay(),i.map((function(t){return t.value})))},enumerable:!0,configurable:!0}),t.prototype.start=function(t){void 0===t&&(t=2),this.disabled||this.next({action:"start",initialValue:t})},t.prototype.stop=function(){this.next({action:"stop"})},t.prototype.complete=function(){this.next({action:"complete"})},t.prototype.disable=function(){this.disabled=!0},t.prototype.set=function(t){this.next({action:"set",value:t})},t.prototype.increment=function(t){void 0===t&&(t=0),this.next({action:"increment",value:t})},t.prototype.next=function(t,e){switch(void 0===e&&(e=!0),t.action){case"start":this.requests=(this.requests||0)+1;break;case"complete":if(this.requests=(this.requests||1)-1,this.requests>0)return;break;case"stop":this.requests=0;break;case"increment":t.value=this._increment(t.value)}this.state=o(o(o({},this.state),{action:null}),t),e&&this.stream$.next(this.state)},t.prototype._increment=function(t){void 0===t&&(t=0);var e=this.state.value;return e>=99&&(t=0),0===t&&(t=e>=0&&e<25?3*Math.random()+3:e>=25&&e<65?3*Math.random():e>=65&&e<90?2*Math.random():e>=90&&e<99?.5:0),t+e},t}(),l=function(){function t(t){var e=this;this.platformId=t,this.refs={},this.streams$=new r.Subject,this.value$=this.streams$.asObservable().pipe(i.startWith(null),i.switchMap((function(){return r.combineLatest.apply(void 0,p(Object.keys(e.refs).map((function(t){return e.refs[t].value$}))))})),i.map((function(t){return Math.max.apply(Math,p([0],t))})))}var o,u;return Object.defineProperty(t.prototype,"progress$",{get:function(){return this.value$},enumerable:!0,configurable:!0}),t.prototype.start=function(t){void 0===t&&(t=2),this.useRef().start(t)},t.prototype.set=function(t){this.useRef().set(t)},t.prototype.increment=function(t){this.useRef().increment(t)},t.prototype.complete=function(){this.useRef().complete()},t.prototype.stop=function(){this.useRef().stop()},t.prototype.useRef=function(t){return void 0===t&&(t="default"),this.refs[t]||(this.refs[t]=new c,this.streams$.next(),n.isPlatformBrowser(this.platformId)||this.refs[t].disable()),this.refs[t]},t.ctorParameters=function(){return[{type:Object,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](e.PLATFORM_ID))},token:t,providedIn:"root"}),t=s([e.Injectable({providedIn:"root"}),(o=0,u=e.Inject(e.PLATFORM_ID),function(t,e){u(t,e,o)}),a("design:paramtypes",[Object])],t)}(),f=function(){function t(t){this.loader=t,this.includeSpinner=!0,this.includeBar=!0,this.fixed=!0,this.color="#29d"}return Object.defineProperty(t.prototype,"value$",{get:function(){return this.ref?this.loader.useRef(this.ref).value$:this.loader.value$},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:l}]},s([e.Input(),a("design:type",Object)],t.prototype,"includeSpinner",void 0),s([e.Input(),a("design:type",Object)],t.prototype,"includeBar",void 0),s([e.Input(),a("design:type",Object)],t.prototype,"fixed",void 0),s([e.Input(),a("design:type",Object)],t.prototype,"color",void 0),s([e.Input(),a("design:type",Number)],t.prototype,"value",void 0),s([e.Input(),a("design:type",String)],t.prototype,"ref",void 0),s([e.Input(),a("design:type",String)],t.prototype,"height",void 0),s([e.Input(),a("design:type",String)],t.prototype,"diameter",void 0),t=s([e.Component({selector:"ngx-loading-bar",template:'\n <ng-container *ngIf="value != null ? value : (value$ | async) as progress">\n <div *ngIf="includeSpinner" class="ngx-spinner">\n <div [style.width]="diameter" [style.height]="diameter" class="ngx-spinner-icon"></div>\n </div>\n <div\n *ngIf="includeBar"\n class="ngx-bar"\n [style.background]="color"\n [style.height]="height"\n [style.width]="progress + \'%\'"\n ></div>\n </ng-container>\n ',preserveWhitespaces:!1,changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.Emulated,host:{"[attr.fixed]":"fixed","[style.color]":"color"},styles:[":host{position:relative;display:block;pointer-events:none}:host .ngx-spinner{transition:350ms linear;display:block;position:absolute;top:5px;left:0}:host .ngx-spinner .ngx-spinner-icon{width:14px;height:14px;border:2px solid transparent;border-top-color:inherit;border-left-color:inherit;border-radius:50%;-webkit-animation:.4s linear infinite loading-bar-spinner;animation:.4s linear infinite loading-bar-spinner}:host .ngx-bar{transition:width 350ms;position:absolute;top:0;left:0;width:100%;height:2px;border-bottom-right-radius:1px;border-top-right-radius:1px}[dir=rtl] :host .ngx-bar{right:0;left:unset}:host[fixed=true]{z-index:10002}:host[fixed=true] .ngx-bar{position:fixed}:host[fixed=true] .ngx-spinner{position:fixed;top:10px;left:10px}[dir=rtl] :host[fixed=true] .ngx-spinner{right:10px;left:unset}@-webkit-keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}"]}),a("design:paramtypes",[l])],t)}(),d=function(){function t(){}return t=s([e.NgModule({imports:[n.CommonModule],declarations:[f],exports:[f]})],t)}();t.LoadingBarComponent=f,t.LoadingBarModule=d,t.LoadingBarService=l,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
***************************************************************************** */var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function a(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function p(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function u(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}var l=function(){function t(t){var e=this;void 0===t&&(t={}),this.config=t,this.state={action:null,value:0,initialValue:0},this.requests=null,this.disabled=!1,this.stream$=new r.Subject,this._value$=null,this.timer$=function(t){var n=r.of(t);switch(t.action){case"start":case"increment":case"set":"start"===t.action&&0===e.config.latencyThreshold&&0===t.value&&(t.value=t.initialValue),e.requests>0&&(n=r.timer(e.config.latencyThreshold,250).pipe(i.map((function(n){return o(o({},t),{value:0===n?e.state.value||t.initialValue:e._increment()})}))));break;case"complete":case"stop":n=0===t.value?r.of(o({},t)):r.timer(0,500).pipe(i.take(2),i.map((function(t){return{value:0===t?100:0}})))}return n.pipe(i.map((function(t){return o(o({},t),{action:"set"})})),i.tap((function(t){return e.next(t,!1)})))},this.config=o({latencyThreshold:0},t)}return Object.defineProperty(t.prototype,"value$",{get:function(){var t=this;return this._value$?this._value$:this._value$=this.stream$.asObservable().pipe(i.startWith(this.state),i.switchMap((function(e){return t.timer$(e)})),i.shareReplay(),i.map((function(t){return t.value})))},enumerable:!0,configurable:!0}),t.prototype.start=function(t){void 0===t&&(t=2),this.disabled||this.next({action:"start",initialValue:t})},t.prototype.stop=function(){this.next({action:"stop"})},t.prototype.complete=function(){this.next({action:"complete"})},t.prototype.disable=function(){this.disabled=!0},t.prototype.set=function(t){this.next({action:"set",value:t})},t.prototype.increment=function(t){void 0===t&&(t=0),this.next({action:"increment",value:t})},t.prototype.next=function(t,e){switch(void 0===e&&(e=!0),t.action){case"start":this.requests=(this.requests||0)+1;break;case"complete":if(this.requests=(this.requests||1)-1,this.requests>0)return;break;case"stop":this.requests=0;break;case"increment":t.value=this._increment(t.value)}this.state=o(o(o({},this.state),{action:null}),t),e&&this.stream$.next(this.state)},t.prototype._increment=function(t){void 0===t&&(t=0);var e=this.state.value;return e>=99&&(t=0),0===t&&(t=e>=0&&e<25?3*Math.random()+3:e>=25&&e<65?3*Math.random():e>=65&&e<90?2*Math.random():e>=90&&e<99?.5:0),t+e},t}(),f=new e.InjectionToken("LOADING_BAR_CONFIG"),d=function(){function t(t,e){var n=this;void 0===e&&(e={}),this.platformId=t,this.config=e,this.refs={},this.streams$=new r.Subject,this.value$=this.streams$.asObservable().pipe(i.startWith(null),i.switchMap((function(){return r.combineLatest.apply(void 0,u(Object.keys(n.refs).map((function(t){return n.refs[t].value$}))))})),i.map((function(t){return Math.max.apply(Math,u([0],t))})))}return Object.defineProperty(t.prototype,"progress$",{get:function(){return this.value$},enumerable:!0,configurable:!0}),t.prototype.start=function(t){void 0===t&&(t=2),this.useRef().start(t)},t.prototype.set=function(t){this.useRef().set(t)},t.prototype.increment=function(t){this.useRef().increment(t)},t.prototype.complete=function(){this.useRef().complete()},t.prototype.stop=function(){this.useRef().stop()},t.prototype.useRef=function(t){return void 0===t&&(t="default"),this.refs[t]||(this.refs[t]=new l(this.config),this.streams$.next(),n.isPlatformBrowser(this.platformId)||this.refs[t].disable()),this.refs[t]},t.ctorParameters=function(){return[{type:Object,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[f]}]}]},t.ɵprov=e["ɵɵdefineInjectable"]({factory:function(){return new t(e["ɵɵinject"](e.PLATFORM_ID),e["ɵɵinject"](f,8))},token:t,providedIn:"root"}),t=s([e.Injectable({providedIn:"root"}),a(0,e.Inject(e.PLATFORM_ID)),a(1,e.Optional()),a(1,e.Inject(f)),c("design:paramtypes",[Object,Object])],t)}(),h=function(){function t(t){this.loader=t,this.includeSpinner=!0,this.includeBar=!0,this.fixed=!0,this.color="#29d"}return Object.defineProperty(t.prototype,"value$",{get:function(){return this.ref?this.loader.useRef(this.ref).value$:this.loader.value$},enumerable:!0,configurable:!0}),t.ctorParameters=function(){return[{type:d}]},s([e.Input(),c("design:type",Object)],t.prototype,"includeSpinner",void 0),s([e.Input(),c("design:type",Object)],t.prototype,"includeBar",void 0),s([e.Input(),c("design:type",Object)],t.prototype,"fixed",void 0),s([e.Input(),c("design:type",Object)],t.prototype,"color",void 0),s([e.Input(),c("design:type",Number)],t.prototype,"value",void 0),s([e.Input(),c("design:type",String)],t.prototype,"ref",void 0),s([e.Input(),c("design:type",String)],t.prototype,"height",void 0),s([e.Input(),c("design:type",String)],t.prototype,"diameter",void 0),t=s([e.Component({selector:"ngx-loading-bar",template:'\n <ng-container *ngIf="value != null ? value : (value$ | async) as progress">\n <div *ngIf="includeSpinner" class="ngx-spinner">\n <div [style.width]="diameter" [style.height]="diameter" class="ngx-spinner-icon"></div>\n </div>\n <div\n *ngIf="includeBar"\n class="ngx-bar"\n [style.background]="color"\n [style.height]="height"\n [style.width]="progress + \'%\'"\n ></div>\n </ng-container>\n ',preserveWhitespaces:!1,changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.Emulated,host:{"[attr.fixed]":"fixed","[style.color]":"color"},styles:[":host{position:relative;display:block;pointer-events:none}:host .ngx-spinner{transition:350ms linear;display:block;position:absolute;top:5px;left:0}:host .ngx-spinner .ngx-spinner-icon{width:14px;height:14px;border:2px solid transparent;border-top-color:inherit;border-left-color:inherit;border-radius:50%;-webkit-animation:.4s linear infinite loading-bar-spinner;animation:.4s linear infinite loading-bar-spinner}:host .ngx-bar{transition:width 350ms;position:absolute;top:0;left:0;width:100%;height:2px;border-bottom-right-radius:1px;border-top-right-radius:1px}[dir=rtl] :host .ngx-bar{right:0;left:unset}:host[fixed=true]{z-index:10002}:host[fixed=true] .ngx-bar{position:fixed}:host[fixed=true] .ngx-spinner{position:fixed;top:10px;left:10px}[dir=rtl] :host[fixed=true] .ngx-spinner{right:10px;left:unset}@-webkit-keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}"]}),c("design:paramtypes",[d])],t)}(),g=function(){function t(){}return t=s([e.NgModule({imports:[n.CommonModule],declarations:[h],exports:[h]})],t)}();t.LOADING_BAR_CONFIG=f,t.LoadingBarComponent=h,t.LoadingBarModule=g,t.LoadingBarService=d,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=ngx-loading-bar-core.umd.min.js.map |
import { __decorate, __metadata, __param } from "tslib"; | ||
import { Injectable } from '@angular/core'; | ||
import { Injectable, Optional } from '@angular/core'; | ||
import { PLATFORM_ID, Inject } from '@angular/core'; | ||
@@ -8,6 +8,9 @@ import { isPlatformBrowser } from '@angular/common'; | ||
import { switchMap, map, startWith } from 'rxjs/operators'; | ||
import { LOADING_BAR_CONFIG } from './loading-bar.config'; | ||
import * as i0 from "@angular/core"; | ||
import * as i1 from "./loading-bar.config"; | ||
let LoadingBarService = class LoadingBarService { | ||
constructor(platformId) { | ||
constructor(platformId, config = {}) { | ||
this.platformId = platformId; | ||
this.config = config; | ||
this.refs = {}; | ||
@@ -43,3 +46,3 @@ this.streams$ = new Subject(); | ||
if (!this.refs[id]) { | ||
this.refs[id] = new LoadingBarState(); | ||
this.refs[id] = new LoadingBarState(this.config); | ||
this.streams$.next(); | ||
@@ -54,11 +57,13 @@ if (!isPlatformBrowser(this.platformId)) { | ||
LoadingBarService.ctorParameters = () => [ | ||
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] } | ||
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [LOADING_BAR_CONFIG,] }] } | ||
]; | ||
LoadingBarService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LoadingBarService_Factory() { return new LoadingBarService(i0.ɵɵinject(i0.PLATFORM_ID)); }, token: LoadingBarService, providedIn: "root" }); | ||
LoadingBarService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LoadingBarService_Factory() { return new LoadingBarService(i0.ɵɵinject(i0.PLATFORM_ID), i0.ɵɵinject(i1.LOADING_BAR_CONFIG, 8)); }, token: LoadingBarService, providedIn: "root" }); | ||
LoadingBarService = __decorate([ | ||
Injectable({ providedIn: 'root' }), | ||
__param(0, Inject(PLATFORM_ID)), | ||
__metadata("design:paramtypes", [Object]) | ||
__param(1, Optional()), __param(1, Inject(LOADING_BAR_CONFIG)), | ||
__metadata("design:paramtypes", [Object, Object]) | ||
], LoadingBarService); | ||
export { LoadingBarService }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLC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fVxufVxuIl19 |
import { Subject, timer, of } from 'rxjs'; | ||
import { map, switchMap, take, tap, startWith, shareReplay } from 'rxjs/operators'; | ||
export class LoadingBarState { | ||
constructor() { | ||
constructor(config = {}) { | ||
this.config = config; | ||
this.state = { | ||
@@ -20,4 +21,7 @@ action: null, | ||
case 'set': { | ||
if (s.action === 'start' && this.config.latencyThreshold === 0 && s.value === 0) { | ||
s.value = s.initialValue; | ||
} | ||
if (this.requests > 0) { | ||
state$ = timer(0, 250).pipe(map((t) => t === 0 ? Object.assign(Object.assign({}, s), { value: this.state.value || s.initialValue }) : Object.assign(Object.assign({}, s), { value: this._increment() }))); | ||
state$ = timer(this.config.latencyThreshold, 250).pipe(map((t) => (Object.assign(Object.assign({}, s), { value: t === 0 ? this.state.value || s.initialValue : this._increment() })))); | ||
} | ||
@@ -38,2 +42,3 @@ break; | ||
}; | ||
this.config = Object.assign({ latencyThreshold: 0 }, config); | ||
} | ||
@@ -120,2 +125,2 @@ get value$() { | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZGluZy1iYXIuc3RhdGUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Abmd4LWxvYWRpbmctYmFyL2NvcmUvIiwic291cmNlcyI6WyJsb2FkaW5nLWJhci5zdGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsT0FBTyxFQUFFLEtBQUssRUFBRSxFQUFFLEVBQWMsTUFBTSxNQUFNLENBQUM7QUFDdEQsT0FBTyxFQUFFLEdBQUcsRUFBRSxTQUFTLEVBQUUsSUFBSSxFQUFFLEdBQUcsRUFBRSxTQUFTLEVBQUUsV0FBVyxFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFRbkYsTUFBTSxPQUFPLGVBQWU7SUFBNUI7UUFDVSxVQUFLLEdBQXFCO1lBQ2hDLE1BQU0sRUFBRSxJQUFJO1lBQ1osS0FBSyxFQUF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AgIGlmIChzdGF0ID49IDAgJiYgc3RhdCA8IDI1KSB7XG4gICAgICAgIC8vIFN0YXJ0IG91dCBiZXR3ZWVuIDMgLSA2JSBpbmNyZW1lbnRzXG4gICAgICAgIHJuZCA9IE1hdGgucmFuZG9tKCkgKiAoNSAtIDMgKyAxKSArIDM7XG4gICAgICB9IGVsc2UgaWYgKHN0YXQgPj0gMjUgJiYgc3RhdCA8IDY1KSB7XG4gICAgICAgIC8vIGluY3JlbWVudCBiZXR3ZWVuIDAgLSAzJVxuICAgICAgICBybmQgPSBNYXRoLnJhbmRvbSgpICogMztcbiAgICAgIH0gZWxzZSBpZiAoc3RhdCA+PSA2NSAmJiBzdGF0IDwgOTApIHtcbiAgICAgICAgLy8gaW5jcmVtZW50IGJldHdlZW4gMCAtIDIlXG4gICAgICAgIHJuZCA9IE1hdGgucmFuZG9tKCkgKiAyO1xuICAgICAgfSBlbHNlIGlmIChzdGF0ID49IDkwICYmIHN0YXQgPCA5OSkge1xuICAgICAgICAvLyBmaW5hbGx5LCBpbmNyZW1lbnQgaXQgLjUgJVxuICAgICAgICBybmQgPSAwLjU7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvLyBhZnRlciA5OSUsIGRvbid0IGluY3JlbWVudDpcbiAgICAgICAgcm5kID0gMDtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gcm5kICsgc3RhdDtcbiAgfVxufVxuIl19 |
export { LoadingBarModule } from './core.module'; | ||
export { LoadingBarComponent } from './loading-bar.component'; | ||
export { LoadingBarService } from './loading-bar.service'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ3gtbG9hZGluZy1iYXIvY29yZS8iLCJzb3VyY2VzIjpbInB1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ2pELE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzlELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHVCQUF1QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgTG9hZGluZ0Jhck1vZHVsZSB9IGZyb20gJy4vY29yZS5tb2R1bGUnO1xuZXhwb3J0IHsgTG9hZGluZ0JhckNvbXBvbmVudCB9IGZyb20gJy4vbG9hZGluZy1iYXIuY29tcG9uZW50JztcbmV4cG9ydCB7IExvYWRpbmdCYXJTZXJ2aWNlIH0gZnJvbSAnLi9sb2FkaW5nLWJhci5zZXJ2aWNlJztcbiJdfQ== | ||
export { LOADING_BAR_CONFIG } from './loading-bar.config'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ3gtbG9hZGluZy1iYXIvY29yZS8iLCJzb3VyY2VzIjpbInB1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ2pELE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzlELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQzFELE9BQU8sRUFBRSxrQkFBa0IsRUFBb0IsTUFBTSxzQkFBc0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IExvYWRpbmdCYXJNb2R1bGUgfSBmcm9tICcuL2NvcmUubW9kdWxlJztcbmV4cG9ydCB7IExvYWRpbmdCYXJDb21wb25lbnQgfSBmcm9tICcuL2xvYWRpbmctYmFyLmNvbXBvbmVudCc7XG5leHBvcnQgeyBMb2FkaW5nQmFyU2VydmljZSB9IGZyb20gJy4vbG9hZGluZy1iYXIuc2VydmljZSc7XG5leHBvcnQgeyBMT0FESU5HX0JBUl9DT05GSUcsIExvYWRpbmdCYXJDb25maWcgfSBmcm9tICcuL2xvYWRpbmctYmFyLmNvbmZpZyc7XG4iXX0= |
import { __decorate, __metadata, __param, __read, __spread } from "tslib"; | ||
import { Injectable } from '@angular/core'; | ||
import { Injectable, Optional } from '@angular/core'; | ||
import { PLATFORM_ID, Inject } from '@angular/core'; | ||
@@ -8,7 +8,11 @@ import { isPlatformBrowser } from '@angular/common'; | ||
import { switchMap, map, startWith } from 'rxjs/operators'; | ||
import { LOADING_BAR_CONFIG } from './loading-bar.config'; | ||
import * as i0 from "@angular/core"; | ||
import * as i1 from "./loading-bar.config"; | ||
var LoadingBarService = /** @class */ (function () { | ||
function LoadingBarService(platformId) { | ||
function LoadingBarService(platformId, config) { | ||
var _this = this; | ||
if (config === void 0) { config = {}; } | ||
this.platformId = platformId; | ||
this.config = config; | ||
this.refs = {}; | ||
@@ -50,3 +54,3 @@ this.streams$ = new Subject(); | ||
if (!this.refs[id]) { | ||
this.refs[id] = new LoadingBarState(); | ||
this.refs[id] = new LoadingBarState(this.config); | ||
this.streams$.next(); | ||
@@ -60,9 +64,11 @@ if (!isPlatformBrowser(this.platformId)) { | ||
LoadingBarService.ctorParameters = function () { return [ | ||
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] } | ||
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [LOADING_BAR_CONFIG,] }] } | ||
]; }; | ||
LoadingBarService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LoadingBarService_Factory() { return new LoadingBarService(i0.ɵɵinject(i0.PLATFORM_ID)); }, token: LoadingBarService, providedIn: "root" }); | ||
LoadingBarService.ɵprov = i0.ɵɵdefineInjectable({ factory: function LoadingBarService_Factory() { return new LoadingBarService(i0.ɵɵinject(i0.PLATFORM_ID), i0.ɵɵinject(i1.LOADING_BAR_CONFIG, 8)); }, token: LoadingBarService, providedIn: "root" }); | ||
LoadingBarService = __decorate([ | ||
Injectable({ providedIn: 'root' }), | ||
__param(0, Inject(PLATFORM_ID)), | ||
__metadata("design:paramtypes", [Object]) | ||
__param(1, Optional()), __param(1, Inject(LOADING_BAR_CONFIG)), | ||
__metadata("design:paramtypes", [Object, Object]) | ||
], LoadingBarService); | ||
@@ -72,2 +78,2 @@ return LoadingBarService; | ||
export { LoadingBarService }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZGluZy1iYXIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ3gtbG9hZGluZy1iYXIvY29yZS8iLCJzb3VyY2VzIjpbImxvYWRpbmctYmFyLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDcEQsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDcEQsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3RELE9BQU8sRUFBRSxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQzlDLE9BQU8sRUFBRSxTQUFTLEVBQUUsR0FBRyxFQUFFLFNBQVMsRUFBRSxNQUFNLGdCQUFnQixDQUFDOztBQUczRDtJQWNFLDJCQUF5QyxVQUFrQjtRQUEzRCxpQkFBK0Q7UUFBdEIsZUFBVSxHQUFWLFVBQVUsQ0FBUTtRQWJuRCxTQUFJLEdBQXNDLEVBQUUsQ0FBQztRQUM3QyxhQUFRLEdBQUc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IGluc3RlYWQuICovXG4gIGNvbXBsZXRlKCkge1xuICAgIHRoaXMudXNlUmVmKCkuY29tcGxldGUoKTtcbiAgfVxuXG4gIC8qKiBAZGVwcmVjYXRlZCB1c2UgYHVzZVJlZmAgaW5zdGVhZC4gKi9cbiAgc3RvcCgpIHtcbiAgICB0aGlzLnVzZVJlZigpLnN0b3AoKTtcbiAgfVxuXG4gIHVzZVJlZihpZDogc3RyaW5nID0gJ2RlZmF1bHQnKTogTG9hZGluZ0JhclN0YXRlIHtcbiAgICBpZiAoIXRoaXMucmVmc1tpZF0pIHtcbiAgICAgIHRoaXMucmVmc1tpZF0gPSBuZXcgTG9hZGluZ0JhclN0YXRlKHRoaXMuY29uZmlnKTtcbiAgICAgIHRoaXMuc3RyZWFtcyQubmV4dCgpO1xuXG4gICAgICBpZiAoIWlzUGxhdGZvcm1Ccm93c2VyKHRoaXMucGxhdGZvcm1JZCkpIHtcbiAgICAgICAgdGhpcy5yZWZzW2lkXS5kaXNhYmxlKCk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHRoaXMucmVmc1tpZF07XG4gIH1cbn1cbiJdfQ== |
@@ -5,4 +5,6 @@ import { __assign } from "tslib"; | ||
var LoadingBarState = /** @class */ (function () { | ||
function LoadingBarState() { | ||
function LoadingBarState(config) { | ||
var _this = this; | ||
if (config === void 0) { config = {}; } | ||
this.config = config; | ||
this.state = { | ||
@@ -23,6 +25,7 @@ action: null, | ||
case 'set': { | ||
if (s.action === 'start' && _this.config.latencyThreshold === 0 && s.value === 0) { | ||
s.value = s.initialValue; | ||
} | ||
if (_this.requests > 0) { | ||
state$ = timer(0, 250).pipe(map(function (t) { | ||
return t === 0 ? __assign(__assign({}, s), { value: _this.state.value || s.initialValue }) : __assign(__assign({}, s), { value: _this._increment() }); | ||
})); | ||
state$ = timer(_this.config.latencyThreshold, 250).pipe(map(function (t) { return (__assign(__assign({}, s), { value: t === 0 ? _this.state.value || s.initialValue : _this._increment() })); })); | ||
} | ||
@@ -43,2 +46,3 @@ break; | ||
}; | ||
this.config = __assign({ latencyThreshold: 0 }, config); | ||
} | ||
@@ -136,2 +140,2 @@ Object.defineProperty(LoadingBarState.prototype, "value$", { | ||
export { LoadingBarState }; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZGluZy1iYXIuc3RhdGUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Abmd4LWxvYWRpbmctYmFyL2NvcmUvIiwic291cmNlcyI6WyJsb2FkaW5nLWJhci5zdGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxLQUFLLEVBQUUsRUFBRSxFQUFjLE1BQU0sTUFBTSxDQUFDO0FBQ3RELE9BQU8sRUFBRSxHQUFHLEVBQUUsU0FBUyxFQUFFLElBQUksRUFBRSxHQUFHLEVBQUUsU0FBUyxFQUFFLFdBQVcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBUW5GO0lBQUE7UUFBQSxpQkEySUM7UUExSVMsVUFBSyxHQUFxQjtZQUNoQyxNQUFNLEVBQUUsSUFBSTtZQUNaLEtBQUssRUFBRSxDQUFDO1lBQ1IsWUFBWSxFQUFFLENBQUM7U0FDaEIsQ0FBQztRQUNNLGFBQVEsR0FBRyxJQUFJLENBQUM7UUFDaEIsYUFBUSxHQUFHLEtBQUssQ0FBQztRQUNqQixZQUFPLEdBQUcsSUFBSSxPQUFPLEVBQW9CLENBQUM7UUFDMUMsWUFBTyxHQUFHLElBQUksQ0FBQztRQW9FZixXQUFNLEdBQUcsVUFBQyxDQUFtQjtZQUNuQyxJQUFJLE1BQU0sR0FBMEMsRUFBRSxDQUFDLENBQUMsQ0FBQyxDQUFDO1lBQzFELFFBQVEsQ0FBQyxDQUFDLE1BQU0sRUFBRTtnQkFDaEIsS0FBSyxPQUFPLENBQUM7Z0JBQ2IsS0FBSyxXQUFXLENBQUM7Z0JB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Ckge1xuICAgIGNvbnN0IHN0YXQgPSB0aGlzLnN0YXRlLnZhbHVlO1xuICAgIGlmIChzdGF0ID49IDk5KSB7XG4gICAgICBybmQgPSAwO1xuICAgIH1cblxuICAgIGlmIChybmQgPT09IDApIHtcbiAgICAgIGlmIChzdGF0ID49IDAgJiYgc3RhdCA8IDI1KSB7XG4gICAgICAgIC8vIFN0YXJ0IG91dCBiZXR3ZWVuIDMgLSA2JSBpbmNyZW1lbnRzXG4gICAgICAgIHJuZCA9IE1hdGgucmFuZG9tKCkgKiAoNSAtIDMgKyAxKSArIDM7XG4gICAgICB9IGVsc2UgaWYgKHN0YXQgPj0gMjUgJiYgc3RhdCA8IDY1KSB7XG4gICAgICAgIC8vIGluY3JlbWVudCBiZXR3ZWVuIDAgLSAzJVxuICAgICAgICBybmQgPSBNYXRoLnJhbmRvbSgpICogMztcbiAgICAgIH0gZWxzZSBpZiAoc3RhdCA+PSA2NSAmJiBzdGF0IDwgOTApIHtcbiAgICAgICAgLy8gaW5jcmVtZW50IGJldHdlZW4gMCAtIDIlXG4gICAgICAgIHJuZCA9IE1hdGgucmFuZG9tKCkgKiAyO1xuICAgICAgfSBlbHNlIGlmIChzdGF0ID49IDkwICYmIHN0YXQgPCA5OSkge1xuICAgICAgICAvLyBmaW5hbGx5LCBpbmNyZW1lbnQgaXQgLjUgJVxuICAgICAgICBybmQgPSAwLjU7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvLyBhZnRlciA5OSUsIGRvbid0IGluY3JlbWVudDpcbiAgICAgICAgcm5kID0gMDtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gcm5kICsgc3RhdDtcbiAgfVxufVxuIl19 |
export { LoadingBarModule } from './core.module'; | ||
export { LoadingBarComponent } from './loading-bar.component'; | ||
export { LoadingBarService } from './loading-bar.service'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ3gtbG9hZGluZy1iYXIvY29yZS8iLCJzb3VyY2VzIjpbInB1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ2pELE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzlELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHVCQUF1QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHsgTG9hZGluZ0Jhck1vZHVsZSB9IGZyb20gJy4vY29yZS5tb2R1bGUnO1xuZXhwb3J0IHsgTG9hZGluZ0JhckNvbXBvbmVudCB9IGZyb20gJy4vbG9hZGluZy1iYXIuY29tcG9uZW50JztcbmV4cG9ydCB7IExvYWRpbmdCYXJTZXJ2aWNlIH0gZnJvbSAnLi9sb2FkaW5nLWJhci5zZXJ2aWNlJztcbiJdfQ== | ||
export { LOADING_BAR_CONFIG } from './loading-bar.config'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZ3gtbG9hZGluZy1iYXIvY29yZS8iLCJzb3VyY2VzIjpbInB1YmxpY19hcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ2pELE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzlELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQzFELE9BQU8sRUFBRSxrQkFBa0IsRUFBb0IsTUFBTSxzQkFBc0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IExvYWRpbmdCYXJNb2R1bGUgfSBmcm9tICcuL2NvcmUubW9kdWxlJztcbmV4cG9ydCB7IExvYWRpbmdCYXJDb21wb25lbnQgfSBmcm9tICcuL2xvYWRpbmctYmFyLmNvbXBvbmVudCc7XG5leHBvcnQgeyBMb2FkaW5nQmFyU2VydmljZSB9IGZyb20gJy4vbG9hZGluZy1iYXIuc2VydmljZSc7XG5leHBvcnQgeyBMT0FESU5HX0JBUl9DT05GSUcsIExvYWRpbmdCYXJDb25maWcgfSBmcm9tICcuL2xvYWRpbmctYmFyLmNvbmZpZyc7XG4iXX0= |
import { __decorate, __param, __metadata } from 'tslib'; | ||
import { Inject, PLATFORM_ID, ɵɵdefineInjectable, ɵɵinject, Injectable, Input, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core'; | ||
import { InjectionToken, Inject, PLATFORM_ID, Optional, ɵɵdefineInjectable, ɵɵinject, Injectable, Input, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core'; | ||
import { isPlatformBrowser, CommonModule } from '@angular/common'; | ||
@@ -8,3 +8,4 @@ import { Subject, of, timer, combineLatest } from 'rxjs'; | ||
class LoadingBarState { | ||
constructor() { | ||
constructor(config = {}) { | ||
this.config = config; | ||
this.state = { | ||
@@ -25,4 +26,7 @@ action: null, | ||
case 'set': { | ||
if (s.action === 'start' && this.config.latencyThreshold === 0 && s.value === 0) { | ||
s.value = s.initialValue; | ||
} | ||
if (this.requests > 0) { | ||
state$ = timer(0, 250).pipe(map((t) => t === 0 ? Object.assign(Object.assign({}, s), { value: this.state.value || s.initialValue }) : Object.assign(Object.assign({}, s), { value: this._increment() }))); | ||
state$ = timer(this.config.latencyThreshold, 250).pipe(map((t) => (Object.assign(Object.assign({}, s), { value: t === 0 ? this.state.value || s.initialValue : this._increment() })))); | ||
} | ||
@@ -43,2 +47,3 @@ break; | ||
}; | ||
this.config = Object.assign({ latencyThreshold: 0 }, config); | ||
} | ||
@@ -126,5 +131,8 @@ get value$() { | ||
const LOADING_BAR_CONFIG = new InjectionToken('LOADING_BAR_CONFIG'); | ||
let LoadingBarService = class LoadingBarService { | ||
constructor(platformId) { | ||
constructor(platformId, config = {}) { | ||
this.platformId = platformId; | ||
this.config = config; | ||
this.refs = {}; | ||
@@ -160,3 +168,3 @@ this.streams$ = new Subject(); | ||
if (!this.refs[id]) { | ||
this.refs[id] = new LoadingBarState(); | ||
this.refs[id] = new LoadingBarState(this.config); | ||
this.streams$.next(); | ||
@@ -171,9 +179,11 @@ if (!isPlatformBrowser(this.platformId)) { | ||
LoadingBarService.ctorParameters = () => [ | ||
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] } | ||
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [LOADING_BAR_CONFIG,] }] } | ||
]; | ||
LoadingBarService.ɵprov = ɵɵdefineInjectable({ factory: function LoadingBarService_Factory() { return new LoadingBarService(ɵɵinject(PLATFORM_ID)); }, token: LoadingBarService, providedIn: "root" }); | ||
LoadingBarService.ɵprov = ɵɵdefineInjectable({ factory: function LoadingBarService_Factory() { return new LoadingBarService(ɵɵinject(PLATFORM_ID), ɵɵinject(LOADING_BAR_CONFIG, 8)); }, token: LoadingBarService, providedIn: "root" }); | ||
LoadingBarService = __decorate([ | ||
Injectable({ providedIn: 'root' }), | ||
__param(0, Inject(PLATFORM_ID)), | ||
__metadata("design:paramtypes", [Object]) | ||
__param(1, Optional()), __param(1, Inject(LOADING_BAR_CONFIG)), | ||
__metadata("design:paramtypes", [Object, Object]) | ||
], LoadingBarService); | ||
@@ -271,3 +281,3 @@ | ||
export { LoadingBarComponent, LoadingBarModule, LoadingBarService }; | ||
export { LOADING_BAR_CONFIG, LoadingBarComponent, LoadingBarModule, LoadingBarService }; | ||
//# sourceMappingURL=ngx-loading-bar-core.js.map |
import { __assign, __spread, __decorate, __param, __metadata } from 'tslib'; | ||
import { Inject, PLATFORM_ID, ɵɵdefineInjectable, ɵɵinject, Injectable, Input, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core'; | ||
import { InjectionToken, Inject, PLATFORM_ID, Optional, ɵɵdefineInjectable, ɵɵinject, Injectable, Input, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule } from '@angular/core'; | ||
import { isPlatformBrowser, CommonModule } from '@angular/common'; | ||
@@ -8,4 +8,6 @@ import { Subject, of, timer, combineLatest } from 'rxjs'; | ||
var LoadingBarState = /** @class */ (function () { | ||
function LoadingBarState() { | ||
function LoadingBarState(config) { | ||
var _this = this; | ||
if (config === void 0) { config = {}; } | ||
this.config = config; | ||
this.state = { | ||
@@ -26,6 +28,7 @@ action: null, | ||
case 'set': { | ||
if (s.action === 'start' && _this.config.latencyThreshold === 0 && s.value === 0) { | ||
s.value = s.initialValue; | ||
} | ||
if (_this.requests > 0) { | ||
state$ = timer(0, 250).pipe(map(function (t) { | ||
return t === 0 ? __assign(__assign({}, s), { value: _this.state.value || s.initialValue }) : __assign(__assign({}, s), { value: _this._increment() }); | ||
})); | ||
state$ = timer(_this.config.latencyThreshold, 250).pipe(map(function (t) { return (__assign(__assign({}, s), { value: t === 0 ? _this.state.value || s.initialValue : _this._increment() })); })); | ||
} | ||
@@ -46,2 +49,3 @@ break; | ||
}; | ||
this.config = __assign({ latencyThreshold: 0 }, config); | ||
} | ||
@@ -139,6 +143,10 @@ Object.defineProperty(LoadingBarState.prototype, "value$", { | ||
var LOADING_BAR_CONFIG = new InjectionToken('LOADING_BAR_CONFIG'); | ||
var LoadingBarService = /** @class */ (function () { | ||
function LoadingBarService(platformId) { | ||
function LoadingBarService(platformId, config) { | ||
var _this = this; | ||
if (config === void 0) { config = {}; } | ||
this.platformId = platformId; | ||
this.config = config; | ||
this.refs = {}; | ||
@@ -180,3 +188,3 @@ this.streams$ = new Subject(); | ||
if (!this.refs[id]) { | ||
this.refs[id] = new LoadingBarState(); | ||
this.refs[id] = new LoadingBarState(this.config); | ||
this.streams$.next(); | ||
@@ -190,9 +198,11 @@ if (!isPlatformBrowser(this.platformId)) { | ||
LoadingBarService.ctorParameters = function () { return [ | ||
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] } | ||
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }, | ||
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [LOADING_BAR_CONFIG,] }] } | ||
]; }; | ||
LoadingBarService.ɵprov = ɵɵdefineInjectable({ factory: function LoadingBarService_Factory() { return new LoadingBarService(ɵɵinject(PLATFORM_ID)); }, token: LoadingBarService, providedIn: "root" }); | ||
LoadingBarService.ɵprov = ɵɵdefineInjectable({ factory: function LoadingBarService_Factory() { return new LoadingBarService(ɵɵinject(PLATFORM_ID), ɵɵinject(LOADING_BAR_CONFIG, 8)); }, token: LoadingBarService, providedIn: "root" }); | ||
LoadingBarService = __decorate([ | ||
Injectable({ providedIn: 'root' }), | ||
__param(0, Inject(PLATFORM_ID)), | ||
__metadata("design:paramtypes", [Object]) | ||
__param(1, Optional()), __param(1, Inject(LOADING_BAR_CONFIG)), | ||
__metadata("design:paramtypes", [Object, Object]) | ||
], LoadingBarService); | ||
@@ -287,3 +297,3 @@ return LoadingBarService; | ||
export { LoadingBarComponent, LoadingBarModule, LoadingBarService }; | ||
export { LOADING_BAR_CONFIG, LoadingBarComponent, LoadingBarModule, LoadingBarService }; | ||
//# sourceMappingURL=ngx-loading-bar-core.js.map |
import { LoadingBarState } from './loading-bar.state'; | ||
import { LoadingBarConfig } from './loading-bar.config'; | ||
export declare class LoadingBarService { | ||
private platformId; | ||
private config; | ||
private refs; | ||
@@ -9,3 +11,3 @@ private streams$; | ||
get progress$(): import("rxjs").Observable<number>; | ||
constructor(platformId: Object); | ||
constructor(platformId: Object, config?: LoadingBarConfig); | ||
/** @deprecated use `useRef` instead. */ | ||
@@ -12,0 +14,0 @@ start(initialValue?: number): void; |
@@ -0,2 +1,4 @@ | ||
import { LoadingBarConfig } from './loading-bar.config'; | ||
export declare class LoadingBarState { | ||
private config; | ||
private state; | ||
@@ -7,2 +9,3 @@ private requests; | ||
private _value$; | ||
constructor(config?: LoadingBarConfig); | ||
get value$(): any; | ||
@@ -9,0 +12,0 @@ start(initialValue?: number): void; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"LoadingBarModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":5,"character":12}],"declarations":[{"__symbolic":"reference","name":"LoadingBarComponent"}],"exports":[{"__symbolic":"reference","name":"LoadingBarComponent"}]}]}],"members":{}},"LoadingBarComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"ngx-loading-bar","template":"\n <ng-container *ngIf=\"value != null ? value : (value$ | async) as progress\">\n <div *ngIf=\"includeSpinner\" class=\"ngx-spinner\">\n <div [style.width]=\"diameter\" [style.height]=\"diameter\" class=\"ngx-spinner-icon\"></div>\n </div>\n <div\n *ngIf=\"includeBar\"\n class=\"ngx-bar\"\n [style.background]=\"color\"\n [style.height]=\"height\"\n [style.width]=\"progress + '%'\"\n ></div>\n </ng-container>\n ","preserveWhitespaces":false,"changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":20,"character":19},"member":"OnPush"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":21,"character":17},"member":"Emulated"},"host":{"[attr.fixed]":"fixed","[style.color]":"color","$quoted$":["[attr.fixed]","[style.color]"]},"styles":[":host{position:relative;display:block;pointer-events:none}:host .ngx-spinner{transition:350ms linear;display:block;position:absolute;top:5px;left:0}:host .ngx-spinner .ngx-spinner-icon{width:14px;height:14px;border:2px solid transparent;border-top-color:inherit;border-left-color:inherit;border-radius:50%;-webkit-animation:.4s linear infinite loading-bar-spinner;animation:.4s linear infinite loading-bar-spinner}:host .ngx-bar{transition:width 350ms;position:absolute;top:0;left:0;width:100%;height:2px;border-bottom-right-radius:1px;border-top-right-radius:1px}[dir=rtl] :host .ngx-bar{right:0;left:unset}:host[fixed=true]{z-index:10002}:host[fixed=true] .ngx-bar{position:fixed}:host[fixed=true] .ngx-spinner{position:fixed;top:10px;left:10px}[dir=rtl] :host[fixed=true] .ngx-spinner{right:10px;left:unset}@-webkit-keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}"]}]}],"members":{"includeSpinner":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}}]}],"includeBar":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":3}}]}],"fixed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":3}}]}],"color":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":3}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":3}}]}],"ref":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"height":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"diameter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"LoadingBarService"}]}]}},"LoadingBarService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":7,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":22,"character":15},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":22,"character":22}]}]],"parameters":[{"__symbolic":"reference","name":"Object"}]}],"start":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"increment":[{"__symbolic":"method"}],"complete":[{"__symbolic":"method"}],"stop":[{"__symbolic":"method"}],"useRef":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}}},"origins":{"LoadingBarModule":"./core.module","LoadingBarComponent":"./loading-bar.component","LoadingBarService":"./loading-bar.service"},"importAs":"@ngx-loading-bar/core"} | ||
{"__symbolic":"module","version":4,"metadata":{"LoadingBarModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":5,"character":12}],"declarations":[{"__symbolic":"reference","name":"LoadingBarComponent"}],"exports":[{"__symbolic":"reference","name":"LoadingBarComponent"}]}]}],"members":{}},"LoadingBarComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":3,"character":1},"arguments":[{"selector":"ngx-loading-bar","template":"\n <ng-container *ngIf=\"value != null ? value : (value$ | async) as progress\">\n <div *ngIf=\"includeSpinner\" class=\"ngx-spinner\">\n <div [style.width]=\"diameter\" [style.height]=\"diameter\" class=\"ngx-spinner-icon\"></div>\n </div>\n <div\n *ngIf=\"includeBar\"\n class=\"ngx-bar\"\n [style.background]=\"color\"\n [style.height]=\"height\"\n [style.width]=\"progress + '%'\"\n ></div>\n </ng-container>\n ","preserveWhitespaces":false,"changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":20,"character":19},"member":"OnPush"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":21,"character":17},"member":"Emulated"},"host":{"[attr.fixed]":"fixed","[style.color]":"color","$quoted$":["[attr.fixed]","[style.color]"]},"styles":[":host{position:relative;display:block;pointer-events:none}:host .ngx-spinner{transition:350ms linear;display:block;position:absolute;top:5px;left:0}:host .ngx-spinner .ngx-spinner-icon{width:14px;height:14px;border:2px solid transparent;border-top-color:inherit;border-left-color:inherit;border-radius:50%;-webkit-animation:.4s linear infinite loading-bar-spinner;animation:.4s linear infinite loading-bar-spinner}:host .ngx-bar{transition:width 350ms;position:absolute;top:0;left:0;width:100%;height:2px;border-bottom-right-radius:1px;border-top-right-radius:1px}[dir=rtl] :host .ngx-bar{right:0;left:unset}:host[fixed=true]{z-index:10002}:host[fixed=true] .ngx-bar{position:fixed}:host[fixed=true] .ngx-spinner{position:fixed;top:10px;left:10px}[dir=rtl] :host[fixed=true] .ngx-spinner{right:10px;left:unset}@-webkit-keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes loading-bar-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}"]}]}],"members":{"includeSpinner":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}}]}],"includeBar":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":3}}]}],"fixed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":3}}]}],"color":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":3}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":3}}]}],"ref":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"height":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}}]}],"diameter":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"LoadingBarService"}]}]}},"LoadingBarService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":8,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":24,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"PLATFORM_ID","line":24,"character":12}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":25,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":25,"character":17},"arguments":[{"__symbolic":"reference","name":"LOADING_BAR_CONFIG"}]}]],"parameters":[{"__symbolic":"reference","name":"Object"},{"__symbolic":"reference","name":"LoadingBarConfig"}]}],"start":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"increment":[{"__symbolic":"method"}],"complete":[{"__symbolic":"method"}],"stop":[{"__symbolic":"method"}],"useRef":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}},"LOADING_BAR_CONFIG":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":38},"arguments":["LOADING_BAR_CONFIG"]},"LoadingBarConfig":{"__symbolic":"interface"}},"origins":{"LoadingBarModule":"./core.module","LoadingBarComponent":"./loading-bar.component","LoadingBarService":"./loading-bar.service","LOADING_BAR_CONFIG":"./loading-bar.config","LoadingBarConfig":"./loading-bar.config"},"importAs":"@ngx-loading-bar/core"} |
{ | ||
"name": "@ngx-loading-bar/core", | ||
"version": "5.0.2", | ||
"version": "5.1.0", | ||
"description": "Automatic page loading / progress bar for Angular", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
export { LoadingBarModule } from './core.module'; | ||
export { LoadingBarComponent } from './loading-bar.component'; | ||
export { LoadingBarService } from './loading-bar.service'; | ||
export { LOADING_BAR_CONFIG, LoadingBarConfig } from './loading-bar.config'; |
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
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
237468
32
1763