-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchunk-KBMMSMMM.js
1 lines (1 loc) · 10.9 KB
/
chunk-KBMMSMMM.js
1
import{i as K,j as X,k as Z,l as tt,m as et,t as nt}from"./chunk-MG7CMGQF.js";import{C as v,E as a,Eb as R,Fb as C,Ga as y,Gb as l,I as j,L as Q,La as L,Mc as H,N as x,Oc as U,P as A,Pb as T,Qc as J,Ub as d,Va as h,Vb as m,Wa as Y,Wb as f,X as _,Y as z,Z as g,a as r,aa as W,cc as M,da as G,f as F,fa as V,ga as k,k as u,l as O,ma as P,n as I,nb as w,p as N,tb as $,u as b,v as B,va as q,vb as S,wb as p}from"./chunk-DXS2GHCC.js";var rt=["progressbar"],ot=["progressbarWrapper"];function ct(i,t){if(i&1&&l(0,"div",7),i&2){let o=T();p("box-shadow","0 0 10px "+o.color+", 0 0 5px "+o.color)}}function at(i,t){if(i&1&&(R(0,"div",8),l(1,"div",9),C()),i&2){let o=T();h(),p("border-top-color",o.color)("border-left-color",o.color)}}var D=class{get snapshot(){return this._state.value}get isStarted(){return this.snapshot.active}constructor(t,o){this._onDestroyCallback=o,this._started=new u,this.started=this._started.pipe(a(()=>!this.isStarted)),this._completed=new u,this.completed=this._completed.pipe(a(()=>this.isStarted)),this._trickling=new u,this._worker=F.EMPTY,this._state=new O({active:!1,value:0}),this._config=new O(t),this.state=this._state.asObservable(),this.config=this._config.asObservable(),this._worker=B([this._trickling,this._config]).pipe(j(([e,n])=>v(e?n.debounceTime:0)),_(([e,n])=>e?this.onTrickling(n):this.onComplete(n))).subscribe()}start(){this._started.next(),this._trickling.next(!0)}complete(){this._trickling.next(!1)}inc(t){let o=this.snapshot.value;this.isStarted?(typeof t!="number"&&(t=this._config.value.trickleFunc(o)),this.set(o+t)):this.start()}set(t){this.setState({value:this.clamp(t),active:!0})}setConfig(t){this._config.next(r(r({},this._config.value),t))}destroy(){this._worker.unsubscribe(),this._trickling.complete(),this._state.complete(),this._config.complete(),this._started.complete(),this._completed.complete(),this._onDestroyCallback()}setState(t){this._state.next(r(r({},this.snapshot),t))}clamp(t){return Math.max(this._config.value.min,Math.min(this._config.value.max,t))}onTrickling(t){return this.isStarted||this.set(this._config.value.min),v(0,t.trickleSpeed).pipe(g(()=>this.inc()))}onComplete(t){return this._completed.next(),this.isStarted?N({}).pipe(g(()=>this.setState({value:100})),x(t.speed*1.7),g(()=>this.setState({active:!1})),x(t.speed),A(()=>this.setState({value:0})),z(this._started)):I}},gt=new G("ngProgressConfig"),it={min:8,max:100,speed:200,debounceTime:0,trickleSpeed:300,fixed:!0,meteor:!0,thick:!1,spinner:!0,ease:"linear",color:"#1B95E0",direction:"ltr+",spinnerPosition:"right",trickleFunc:i=>i>=0&&i<20?10:i>=20&&i<50?4:i>=50&&i<80?2:i>=80&&i<99?.5:0},ht=(()=>{let t=class t{constructor(e){this._instances=new Map,this.config=e?r(r({},it),e):it}ref(e="root",n){if(this._instances.has(e)){let s=this._instances.get(e);return n&&s.setConfig(r(r({},this.config),n)),s}else{let s=new D(r(r({},this.config),n),this.deleteInstance(e));return this._instances.set(e,s).get(e)}}destroyAll(){this._instances.forEach(e=>e.destroy())}deleteInstance(e){return()=>{this._instances.delete(e)}}};t.\u0275fac=function(n){return new(n||t)(V(gt,8))},t.\u0275prov=W({token:t,factory:t.\u0275fac,providedIn:"root"});let i=t;return i})(),E=(()=>{let t=class t{get isStarted(){return this.progressRef?.isStarted}constructor(e){this._ngProgress=e,this.id="root",this.min=this._ngProgress.config.min,this.max=this._ngProgress.config.max,this.ease=this._ngProgress.config.ease,this.color=this._ngProgress.config.color,this.speed=this._ngProgress.config.speed,this.thick=this._ngProgress.config.thick,this.fixed=this._ngProgress.config.fixed,this.meteor=this._ngProgress.config.meteor,this.spinner=this._ngProgress.config.spinner,this.trickleSpeed=this._ngProgress.config.trickleSpeed,this.debounceTime=this._ngProgress.config.debounceTime,this.trickleFunc=this._ngProgress.config.trickleFunc,this.spinnerPosition=this._ngProgress.config.spinnerPosition,this.direction=this._ngProgress.config.direction,this.started=new y,this.completed=new y}ngOnChanges(){this.progressRef?.setConfig({max:this.max>0&&this.max<=100?this.max:100,min:this.min<100&&this.min>=0?this.min:0,speed:this.speed,trickleSpeed:this.trickleSpeed,trickleFunc:this.trickleFunc,debounceTime:this.debounceTime})}ngOnInit(){this.progressRef=this._ngProgress.ref(this.id,{max:this.max,min:this.min,speed:this.speed,trickleSpeed:this.trickleSpeed,debounceTime:this.debounceTime});let e=this.progressElement.nativeElement,n=this.progressWrapperElement.nativeElement;this._state=this.progressRef.state.pipe(g(s=>{e.style.transform=`translate3d(${s.value}%,0,0)`,s.active?(e.style.transition=`all ${this.speed}ms ${this.ease}`,n.setAttribute("active","true")):(e.style.transition="none",n.setAttribute("active","false"))})).subscribe(),this.started.observed&&(this._started=this.progressRef.started.subscribe(()=>this.started.emit())),this.completed.observed&&(this._completed=this.progressRef.completed.subscribe(()=>this.completed.emit()))}ngOnDestroy(){this._state?.unsubscribe(),this._started?.unsubscribe(),this._completed?.unsubscribe(),this.progressRef?.destroy()}start(){this.progressRef.start()}complete(){this.progressRef.complete()}inc(e){this.progressRef.inc(e)}set(e){this.progressRef.set(e)}};t.\u0275fac=function(n){return new(n||t)(Y(ht))},t.\u0275cmp=P({type:t,selectors:[["ng-progress"]],viewQuery:function(n,s){if(n&1&&(d(rt,7),d(ot,7)),n&2){let c;m(c=f())&&(s.progressElement=c.first),m(c=f())&&(s.progressWrapperElement=c.first)}},hostAttrs:["role","progressbar"],hostVars:4,hostBindings:function(n,s){n&2&&$("spinnerPosition",s.spinnerPosition)("direction",s.direction)("thick",s.thick)("fixed",s.fixed)},inputs:{id:"id",min:"min",max:"max",ease:"ease",color:"color",speed:"speed",thick:"thick",fixed:"fixed",meteor:"meteor",spinner:"spinner",trickleSpeed:"trickleSpeed",debounceTime:"debounceTime",trickleFunc:"trickleFunc",spinnerPosition:"spinnerPosition",direction:"direction"},outputs:{started:"started",completed:"completed"},standalone:!0,features:[q,M],decls:7,vars:6,consts:[["progressbarWrapper",""],["progressbar",""],[1,"ng-progress-bar"],[1,"ng-bar-placeholder"],[1,"ng-bar"],["class","ng-meteor",3,"boxShadow",4,"ngIf"],["class","ng-spinner",4,"ngIf"],[1,"ng-meteor"],[1,"ng-spinner"],[1,"ng-spinner-icon"]],template:function(n,s){n&1&&(R(0,"div",2,0)(2,"div",3)(3,"div",4,1),w(5,ct,1,2,"div",5),C()(),w(6,at,2,4,"div",6),C()),n&2&&(p("transition","opacity "+s.speed+"ms "+s.ease),h(3),p("background-color",s.color),h(2),S("ngIf",s.meteor),h(),S("ngIf",s.spinner))},dependencies:[U,H],styles:['[_nghost-%COMP%]{z-index:999999;pointer-events:none}[fixed=true][_nghost-%COMP%] .ng-progress-bar[_ngcontent-%COMP%], [fixed=true][_nghost-%COMP%] .ng-spinner[_ngcontent-%COMP%]{position:fixed}[fixed=true][_nghost-%COMP%] .ng-spinner[_ngcontent-%COMP%]{top:15px}[fixed=true][spinnerPosition=left][_nghost-%COMP%] .ng-spinner[_ngcontent-%COMP%]{left:15px}[fixed=true][spinnerPosition=right][_nghost-%COMP%] .ng-spinner[_ngcontent-%COMP%]{right:15px}[thick=true][_nghost-%COMP%] .ng-spinner-icon[_ngcontent-%COMP%]{width:24px;height:24px;border-width:3px}[thick=true][_nghost-%COMP%] .ng-bar-placeholder[_ngcontent-%COMP%]{height:3px!important}[direction="ltr+"][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction=ltr-][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{transform:rotate(3deg)}[direction="ltr+"][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction=ltr-][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{transform:rotate(4deg)}[direction="ltr+"][_nghost-%COMP%] .ng-bar[_ngcontent-%COMP%], [direction="rtl+"][_nghost-%COMP%] .ng-bar[_ngcontent-%COMP%]{margin-left:-100%}[direction="ltr+"][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction="rtl+"][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{right:0}[direction="ltr+"][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction=rtl-][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{top:-3px}[direction="ltr+"][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction=rtl-][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{top:-4px}[direction=ltr-][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction="rtl+"][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{bottom:-3px}[direction=ltr-][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction="rtl+"][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{bottom:-4px}[direction=ltr-][_nghost-%COMP%] .ng-bar-placeholder[_ngcontent-%COMP%], [direction="rtl+"][_nghost-%COMP%] .ng-bar-placeholder[_ngcontent-%COMP%]{transform:rotate(180deg)}[direction=ltr-][_nghost-%COMP%] .ng-spinner-icon[_ngcontent-%COMP%], [direction="rtl+"][_nghost-%COMP%] .ng-spinner-icon[_ngcontent-%COMP%]{animation-directionection:reverse}[direction="rtl+"][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction=rtl-][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{transform:rotate(-3deg)}[direction="rtl+"][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%], [direction=rtl-][thick=true][_nghost-%COMP%] .ng-meteor[_ngcontent-%COMP%]{transform:rotate(-4deg)}[spinnerPosition=left][_nghost-%COMP%] .ng-spinner[_ngcontent-%COMP%]{left:10px}[spinnerPosition=right][_nghost-%COMP%] .ng-spinner[_ngcontent-%COMP%]{right:10px}.ng-progress-bar[_ngcontent-%COMP%]{position:relative;z-index:999999;top:0;left:0;width:100%;transform:scale(1);filter:alpha(opacity=0);opacity:0}.ng-progress-bar[active=true][_ngcontent-%COMP%]{filter:alpha(opacity=100);opacity:1;transition:none}.ng-bar-placeholder[_ngcontent-%COMP%]{position:absolute;height:2px;width:100%}.ng-bar[_ngcontent-%COMP%]{width:100%;height:100%;transform:translate(-100%,0,0)}.ng-meteor[_ngcontent-%COMP%]{display:block;position:absolute;width:100px;height:100%;opacity:1}.ng-spinner[_ngcontent-%COMP%]{position:absolute;display:block;z-index:1031;top:10px}.ng-spinner-icon[_ngcontent-%COMP%]{width:18px;height:18px;box-sizing:border-box;animation:_ngcontent-%COMP%_spinner-animation .25s linear infinite;border:2px solid transparent;border-radius:50%}@keyframes _ngcontent-%COMP%_spinner-animation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}'],changeDetection:0});let i=t;return i})();var pt=30,jt=(()=>{let t=class t{constructor(){this.router=k(nt),this.isBrowser=J(k(L))}ngOnInit(){this.setupPageNavigationDimming()}setupPageNavigationDimming(){this.isBrowser&&this.router.events.pipe(a(e=>e instanceof K),b(()=>setTimeout(()=>{this.progressBar.start()},pt)),_(e=>this.router.events.pipe(a(n=>n instanceof X||n instanceof Z||n instanceof tt||n instanceof et),Q(1),b(()=>e)))).subscribe(e=>{clearTimeout(e),this.progressBar.complete()})}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=P({type:t,selectors:[["adev-progress-bar"]],viewQuery:function(n,s){if(n&1&&d(E,7),n&2){let c;m(c=f())&&(s.progressBar=c.first)}},standalone:!0,features:[M],decls:1,vars:0,consts:[["aria-label","\u9875\u9762\u52A0\u8F7D\u8FDB\u5EA6"]],template:function(n,s){n&1&&l(0,"ng-progress",0)},dependencies:[E],encapsulation:2,changeDetection:0});let i=t;return i})();export{pt as PROGRESS_BAR_DELAY,jt as ProgressBarComponent};