@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 1.76 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import o from"../../core/Error.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import a from"./Edits.js";import{findEditorItemForLayer as s}from"./workflowUtils.js";var l;let d=l=class extends e{constructor(t){super(t),this.association=null,this.editorItem=null,this.edits=null,this.featureFormCallbacks=null,this.parent=null,this.readOnly=!1,this.viewModel=null}get attachmentsCapabilities(){const t=this.editorItem.capabilities.update.attachments.enabled;return{editing:!0,operations:{add:t,update:t,delete:t}}}get formTemplate(){return this.editorItem.formTemplate}static async create(t){const e=l._makeConstructorProps(t);return new l(e)}stageDelete(){this.edits.stageDelete()}static _makeConstructorProps(t){const{association:e,feature:r,parent:i,featureFormCallbacks:l,viewModel:d,readOnly:n}=t,p=s(d.editorItems,r.sourceLayer);if(!p)throw new o("no-editorItem-found","The EditorViewModel provided did not have an EditorItem associated with the specified Graphic's layer");return{association:e,editorItem:p,edits:new a({feature:r}),parent:i,featureFormCallbacks:l,viewModel:d,readOnly:n??!1}}};t([r()],d.prototype,"association",void 0),t([r()],d.prototype,"attachmentsCapabilities",null),t([r({constructOnly:!0})],d.prototype,"editorItem",void 0),t([r()],d.prototype,"edits",void 0),t([r()],d.prototype,"featureFormCallbacks",void 0),t([r()],d.prototype,"formTemplate",null),t([r()],d.prototype,"parent",void 0),t([r()],d.prototype,"readOnly",void 0),t([r()],d.prototype,"viewModel",void 0),d=l=t([i("esri.widgets.Editor.UpdateRecordWorkflowData")],d);const n=d;export{n as default};