You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7 lines
2.0 KiB
7 lines
2.0 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
define("../chunks/tslib.es6 ../core/promiseUtils ../core/reactiveUtils ../core/accessorSupport/decorators/property ../core/has ../core/Logger ../core/RandomLCG ../core/accessorSupport/decorators/subclass ./Widget ./Spinner/SpinnerViewModel ./support/widgetUtils ./support/jsxFactory".split(" "),function(d,h,k,f,c,p,q,l,m,g,r,n){c=class extends m{constructor(a,b){super(a,b);this._animationDelay=500;this._animationPromise=null;this.viewModel=new g}initialize(){this.addHandles(k.watch(()=>this.visible, |
|
a=>this._visibleChange(a)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(a){this.viewModel.location=a}get view(){return this.viewModel.view}set view(a){this.viewModel.view=a}get visible(){return this.viewModel.visible}set visible(a){this.viewModel.visible=a}show(a){const {location:b,promise:e}=a??{};b&&(this.viewModel.location=b);this.visible=!0;a=()=>this.hide();e&&e.catch(()=>{}).then(a)}hide(){this.visible=!1}render(){var {visible:a}=this,{screenLocation:b}= |
|
this.viewModel;b=!!b;a={["esri-spinner--start"]:a&&b,["esri-spinner--finish"]:!a&&b};b=this._getPositionStyles();return n.tsx("div",{class:this.classes("esri-spinner",a),styles:b})}_visibleChange(a){if(a)this.viewModel.screenLocationEnabled=!0;else{var b=h.after(this._animationDelay);this._animationPromise=b;b.catch(()=>{}).then(()=>{this._animationPromise===b&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}}_getPositionStyles(){const {screenLocation:a,view:b}=this.viewModel; |
|
if(null==b||null==a)return{};const {padding:e}=b;return{left:`${a.x-e.left}px`,top:`${a.y-e.top}px`}}};d.__decorate([f.property()],c.prototype,"location",null);d.__decorate([f.property()],c.prototype,"view",null);d.__decorate([f.property({type:g})],c.prototype,"viewModel",void 0);d.__decorate([f.property()],c.prototype,"visible",null);return c=d.__decorate([l.subclass("esri.widgets.Spinner")],c)}); |