UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

3 lines (2 loc) 3.31 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{ignoreAbortErrors as s,debounce as i,isAbortError as l}from"../../../core/promiseUtils.js";import{pausable as r}from"../../../core/reactiveUtils.js";import{property as o,subclass as a}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as n}from"../../../core/support/UpdatingHandles.js";let d=class extends t{constructor(e){super(e),this._debouncedMeasure=null,this._pausableWatch=null,this._inputWatch=null,this._lastSeenValue=void 0,this._getContext=null,this._updatingHandles=new n,this.field=null,this.appliesToHandlesWithRole=null,this.appliesToHandlesWithName=null,this.displayGroup=null}get name(){return this.field.name}get displayOrder(){return this.field.displayOrder}set displayOrder(e){this.field.displayOrder=e}get readOnly(){return this.field.readOnly}set readonly(e){this.field.readOnly=e}get lockable(){return this.field.lockable}set lockable(e){this.field.lockable=e}get unlockOnVertexPlacement(){return this.field.unlockOnVertexPlacement}set unlockOnVertexPlacement(e){this.field.unlockOnVertexPlacement=e}get parse(){return this.field.parse}set parse(e){this.field.parse=e}get format(){return this.field.format}set format(e){this.field.format=e}get formatForInputMode(){return this.field.formatForInputMode}set formatForInputMode(e){this.field.formatForInputMode=e}get suffix(){return this.field.suffix}set suffix(e){this.field.suffix=e}get enabled(){return this._get("enabled")}set enabled(e){this._set("enabled",e),e?(this._pausableWatch?.resume(),this._debouncedMeasure&&this._updatingHandles.addPromise(s(this._debouncedMeasure(this._inputWatch?.(),this._getContext?.(),this._lastSeenValue)))):this._pausableWatch?.pause()}get updating(){return this._updatingHandles.updating}setActual(e){this.field.setActual(e)}getCommitted(){return this.field.committed}getActual(){return this.field.actual}getInput(){return this.field.inputValue}registerMeasurement(e,t,o){this._inputWatch=e,this._getContext=o;const a=(e,s,i)=>t(e,s,i).then(e=>(this.setActual(e),e)).catch(e=>{if(!l(e))return this.setActual(null),null});this._debouncedMeasure=i(a);const n=this._pausableWatch=r(e,(e,t)=>{this._lastSeenValue=e;o()&&this._debouncedMeasure&&this._updatingHandles.addPromise(s(this._debouncedMeasure(e,o(),t)))});if(this.enabled){const t=e();this._updatingHandles.addPromise(s(this._debouncedMeasure(t,o(),void 0)))}else n.pause();this.addHandles(n)}show(){this.field.visible=!0}hide(){this.field.visible=!1}};e([o({constructOnly:!0})],d.prototype,"field",void 0),e([o()],d.prototype,"name",null),e([o()],d.prototype,"displayOrder",null),e([o()],d.prototype,"readOnly",null),e([o()],d.prototype,"lockable",null),e([o()],d.prototype,"unlockOnVertexPlacement",null),e([o()],d.prototype,"parse",null),e([o()],d.prototype,"format",null),e([o()],d.prototype,"formatForInputMode",null),e([o()],d.prototype,"suffix",null),e([o()],d.prototype,"appliesToHandlesWithRole",void 0),e([o()],d.prototype,"appliesToHandlesWithName",void 0),e([o()],d.prototype,"enabled",null),e([o()],d.prototype,"displayGroup",void 0),e([o()],d.prototype,"updating",null),d=e([a("esri.views.draw.support.ManagedTooltipField")],d);export{d as ManagedTooltipField};