UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 2.15 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.19/LICENSE.txt */ import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{watch as o}from"../../../core/reactiveUtils.js";import{property as i,subclass as s}from"../../../core/accessorSupport/decorators.js";let n=class extends e{constructor(t){super(t),this.attachmentId=null,this.attachmentInfos=[],this.candidates=null,this.dialogId=null,this.error=null,this.form=null,this.mode="list",this.objectId=null}initialize(){this.addHandles([o(()=>this.objectId,()=>this.reset()),o(()=>this.candidates,()=>{this.error=null}),o(()=>this.attachmentInfos.length,t=>{0===t&&(this.mode="file")})])}get attachmentInfo(){const{attachmentId:t}=this;return null==t?null:this.attachmentInfos.find(e=>e.id===t)}get dialogInfo(){const t=this.dialogId;return null==t?null:this.attachmentInfos.find(e=>e.id===t)}get effectiveMode(){const{mode:t}=this;return this.attachmentInfos.length?"details"===t&&null==this.attachmentId?"list":t:"file"}get fileMode(){return this.attachmentInfo?"replace":"upload"}get hasAttachments(){return!!this.attachmentInfos.length}get hasCandidates(){return!!this.candidates?.length}cancel(){this.candidates=null,null!=this.attachmentId?this.mode="details":this.attachmentInfos.length?this.mode="list":this.mode="file"}onEditComplete(){this.attachmentId=null,this.dialogId=null,this.candidates=null,this.mode="list"}reset(){this.attachmentId=null,this.dialogId=null,this.candidates=null,this.error=null}};t([i()],n.prototype,"attachmentId",void 0),t([i()],n.prototype,"attachmentInfo",null),t([i()],n.prototype,"attachmentInfos",void 0),t([i()],n.prototype,"candidates",void 0),t([i()],n.prototype,"dialogId",void 0),t([i()],n.prototype,"dialogInfo",null),t([i()],n.prototype,"effectiveMode",null),t([i()],n.prototype,"error",void 0),t([i()],n.prototype,"fileMode",null),t([i()],n.prototype,"form",void 0),t([i()],n.prototype,"hasAttachments",null),t([i()],n.prototype,"hasCandidates",null),t([i()],n.prototype,"mode",void 0),t([i()],n.prototype,"objectId",void 0),n=t([s("esri.widgets.FeatureTable.support.AttachmentsViewOptions")],n);const l=n;export{l as default};