UNPKG

@arcgis/core

Version:

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

3 lines (2 loc) 1.91 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{property as r,subclass as o}from"../../core/accessorSupport/decorators.js";import{hasCircularArc as s,isCurvedGeometry as i}from"../../geometry/support/curves/curveUtils.js";import a from"../../views/interactive/sketch/SketchOptions.js";import p from"./UpdateRecordWorkflowData.js";import{whenEditorLayerView as u}from"./workflowUtils.js";var n;let l=n=class extends p{constructor(e){super(e),this.sketchOptions=null,this.snappingManager=null}get curveResizeDisabled(){return this.hasCurves&&s(this.edits.feature?.geometry)&&!this.editorItem.supportedCurveTypes.includes("elliptic-arc")}get curveUpdatesDisabled(){return this.hasCurves&&!this.editorItem.capabilities.supportsTrueCurveUpdate}get hasCurves(){const e=this.edits.feature;return!(!e?.geometry||!i(e.geometry))}get supportsSplitFeatureWorkflow(){const e=this.edits.feature,t=this.editorItem;return!(!e?.geometry||!t)&&(!(i(e.geometry)&&!t.capabilities.supportsTrueCurveUpdate)&&t.supportsSplitFeatureWorkflow)}static async create(e){const{feature:r,snappingManager:o,viewModel:s}=e,i=e.sketchOptions??new a,{view:p}=s;if(!p)throw new t("editor:cannot-create-workflow-data","The provided EditorViewModel does not have an associated view");const l=await u(p,r.layer??r.sourceLayer);return new n({...n._makeConstructorProps(e),layerView:l,sketchOptions:i,snappingManager:o})}};e([r()],l.prototype,"curveResizeDisabled",null),e([r()],l.prototype,"curveUpdatesDisabled",null),e([r()],l.prototype,"hasCurves",null),e([r()],l.prototype,"layerView",void 0),e([r({constructOnly:!0})],l.prototype,"sketchOptions",void 0),e([r()],l.prototype,"snappingManager",void 0),e([r()],l.prototype,"supportsSplitFeatureWorkflow",null),l=n=e([o("esri.widgets.Editor.UpdateFeatureWorkflowData")],l);const c=l;export{c as default};