UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 3.02 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import o from"../../core/Collection.js";import r from"../../core/Logger.js";import i from"../../core/ReactiveMap.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{isSharedTemplateOrMetadata as a}from"../../editing/templateUtils.js";import l from"./Edits.js";const p=()=>r.getLogger("esri.widgets.Editor.CreateFeaturesWorkflowData");let d=class extends t{constructor(e){super(e),this.creationInfo=null,this.editorItem=null,this.fullTemplate=null,this.parent=null,this.temporaryHighlightFeature=null,this.sketchOptions=null,this.snappingManager=null,this.templateExecutorInfo=null,this.viewModel=null,this.upload=null,this._pendingEdits=new i}get isSharedTemplateWorkflow(){return!!this.fullTemplate&&a(this.fullTemplate)}get pendingFeatures(){return new o([...this._pendingEdits.keys()])}set selectedPendingFeature(e){this._set("selectedPendingFeature",e),this.temporaryHighlightFeature=null}set timeZone(e){this._set("timeZone",e),this._pendingEdits.forEach((t=>{t.timeZone=e}))}isSubmittable(e){const t=this._pendingEdits.get(e);return!!t?.submittable||!!t?.isAssociation}isDisplayable(e){return!this._pendingEdits.get(e)?.isAssociation}addPendingFeature(e,t=e,o={isAssociation:!1}){this.temporaryHighlightFeature=null;const{_pendingEdits:r}=this;if(r.has(e))return r.get(e);e.sourceLayer||p().warn("source-layer-not-set","A feature added to `pendingFeatures` did not have `sourceLayer` set. This may cause problems throughout `CreateFeaturesWorkflow`.");const i=new l({feature:e,isAssociation:o.isAssociation});return i.trackChanges(t),r.set(e,i),i}getEditsForPendingFeature(e){return this._pendingEdits.get(e)}removePendingFeature(e){this.temporaryHighlightFeature=null;const{_pendingEdits:t}=this,o=t.get(e);o&&(o.destroy(),t.delete(e)),this.selectedPendingFeature===e&&(this.selectedPendingFeature=null)}getFeatureTitle(e){return this._pendingEdits.get(e)?.displayTitle}};e([s()],d.prototype,"creationInfo",void 0),e([s()],d.prototype,"editorItem",void 0),e([s()],d.prototype,"fullTemplate",void 0),e([s()],d.prototype,"isSharedTemplateWorkflow",null),e([s()],d.prototype,"parent",void 0),e([s()],d.prototype,"pendingFeatures",null),e([s()],d.prototype,"selectedPendingFeature",null),e([s()],d.prototype,"temporaryHighlightFeature",void 0),e([s({constructOnly:!0})],d.prototype,"sketchOptions",void 0),e([s()],d.prototype,"snappingManager",void 0),e([s()],d.prototype,"templateExecutorInfo",void 0),e([s()],d.prototype,"viewModel",void 0),e([s()],d.prototype,"upload",void 0),e([s()],d.prototype,"timeZone",null),d=e([n("esri.widgets.Editor.CreateFeaturesWorkflowData")],d);const u=d;export{u as default};