@arcgis/core 4.26.0-next.20230121 → 4.26.0-next.20230123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/006af87392d7136fb8c7.js +1 -0
- package/assets/esri/core/workers/chunks/5c8fd7842bdfe912eef2.js +1 -0
- package/assets/esri/core/workers/chunks/{d75f1c8f8dcabdf32021.js → c49510a48cdf64a0d9fc.js} +1 -1
- package/assets/esri/themes/base/widgets/_Tooltip.scss +29 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_en.json +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/voxel/VoxelIsosurface.js +1 -1
- package/package.json +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectStates.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/SceneLayerViewRequiredFields.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/webgl-engine/lib/AppleAmdDriverHelper.js +5 -0
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/draw/DrawGraphicTool.js +1 -1
- package/views/interactive/sketch/SketchTooltipVisibleElements.js +1 -1
- package/views/interactive/tooltip/DrawTooltipInfos.js +1 -1
- package/views/interactive/tooltip/SketchTooltipInfo.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawCircle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolygon.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawPolyline.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentDrawRectangle.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentRotate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentExtentScale.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformAbsolute.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformRotate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformScale.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateGraphic.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateGraphicXY.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateGraphicZ.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertexXY.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertexZ.js +1 -1
- package/views/interactive/tooltip/css.js +1 -1
- package/views/interactive/tooltip/support/TooltipContentWithHelpMessage.js +5 -0
- package/views/webgl/WebGLDriverTest.js +1 -1
- package/views/webgl/testAppleAmdDrawArrays.js +5 -0
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/assets/esri/core/workers/chunks/1363e647f3b0bca07e09.js +0 -1
- package/assets/esri/core/workers/chunks/fa52b97a76b2b4170c5d.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import{makeHandle as r}from"../../core/handleUtils.js";import{destroyMaybe as n,isSome as l,isNone as a,unwrap as s,applySome as p,unwrapOr as c}from"../../core/maybe.js";import{createLength as h,zeroMeters as u,zeroSquareMeters as d}from"../../core/quantityUtils.js";import{watch as m,syncAndInitial as y}from"../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as g}from"../../core/unitUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import _ from"../../layers/GraphicsLayer.js";import{getConvertedElevation as w}from"../../support/elevationInfoUtils.js";import{createSquare as O,createRectangle as T,createCircle as x,createEllipse as G,createPolygon as V,createPolyline as S,createMultipoint as b}from"./support/createUtils.js";import{createViewAlignedCoordinateSystem as I}from"./support/surfaceCoordinateSystems.js";import{InteractiveToolBase as j}from"../interactive/InteractiveToolBase.js";import C from"../interactive/sketch/SketchLabelOptions.js";import z from"../interactive/sketch/SketchTooltipOptions.js";import{DrawPointTooltipInfo as U,DrawPolylineTooltipInfo as M,DrawPolygonTooltipInfo as k,DrawRectangleTooltipInfo as P,DrawCircleTooltipInfo as A}from"../interactive/tooltip/DrawTooltipInfos.js";import{Tooltip as R}from"../interactive/tooltip/Tooltip.js";import{autoAreaByElevationMode as E}from"../support/automaticAreaMeasurementUtils.js";import{autoLengthByElevationMode as L,autoHorizontalDistanceByElevationModeBetweenPoints as D}from"../support/automaticLengthMeasurementUtils.js";let Z=class extends(o(i.EventedMixin(j))){constructor(e){super(e),this._graphic=null,this._createOperationGeometry=null,this.defaultZ=0,this.geometryType=null,this.hasZ=!0,this.labelOptions=new C,this.mode=null,this.snappingManager=null,this.snapToScene=!1,this.tooltip=null,this.tooltipOptions=new z}initialize(){this.internalGraphicsLayer=new _({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer),this.drawOperation=this.makeDrawOperation(),this.handles.add([this.drawOperation.on("vertex-add",(e=>this.onVertexAdd(e))),this.drawOperation.on("vertex-remove",(e=>this.onVertexRemove(e))),this.drawOperation.on("vertex-update",(e=>this.onVertexUpdate(e))),this.drawOperation.on("cursor-update",(e=>this.onCursorUpdate(e))),this.drawOperation.on("complete",(e=>this.onComplete(e))),m((()=>this.tooltipOptions.enabled),(e=>{this.tooltip=e?new R({view:this.view,info:this._tooltipInfo}):n(this.tooltip)}),y),m((()=>this._tooltipInfo),(e=>{l(this.tooltip)&&(this.tooltip.info=e)}),y)]),this.finishToolCreation()}destroy(){this.drawOperation=n(this.drawOperation),this.tooltip=n(this.tooltip),this._destroyAllVisualisations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=n(this.internalGraphicsLayer),this._set("view",null)}get _defaultElevation(){return h(this.defaultZ,"meters")}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),l(this._graphic)&&(this._graphic.symbol=e)}get updating(){return this.drawOperation?.updating??!1}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}_createGraphic(e){this._graphic=new t({...this.graphicProperties,geometry:e,symbol:this.graphicSymbol}),this.internalGraphicsLayer.add(this._graphic),this.handles.add(this.initializeGraphic(this._graphic)),this.notifyChange("graphic"),this.handles.add(r((()=>{l(this._graphic)&&(this.internalGraphicsLayer.remove(this._graphic),this._graphic=n(this._graphic))})),H)}_destroyAllVisualisations(){this.handles.remove(N.outline),this.handles.remove(N.regularVertices),this.handles.remove(N.activeVertex),this.handles.remove(H)}_getCreateOperationGeometry(e={operationComplete:!1}){if(null==this.drawOperation||0===this.drawOperation.numVertices)return null;const t=this.drawOperation.stagedVertex,i=this.drawOperation.committedVertices,o=i.slice();l(t)&&o.push(this.drawOperation.coordinateHelper.pointToArray(t));const r=l(t)?this.drawOperation.coordinateHelper.pointToArray(t):i.splice(-1)[0],n={regularVertices:null,activeVertex:null,full:null,outline:null,circle:null,rectangle:null},a=o.length,s=this.view.spatialReference,p="3d"===this.view.type&&"global"===this.view.viewingMode;switch(this.geometryType){case"point":n.regularVertices=i,n.activeVertex=r,n.full=this.drawOperation.coordinateHelper.arrayToPoint(o[0]);break;case"multipoint":n.regularVertices=i,n.activeVertex=r,a>0&&(n.full=b(o,s));break;case"polyline":n.regularVertices=i,n.activeVertex=r,a>0&&(n.full=S([o],s,p));break;case"polygon":n.regularVertices=i,n.activeVertex=r,a>0&&(n.full=V([o],s,p,!0));break;case"circle":if(a>0){const t=I(this.view,o[0]);if(1===a&&e.operationComplete){const e=o[0],i=t.makeMapPoint(e[0]+B*this.view.resolution,e[1]);n.circle=x([e,i],t,!0),n.full=l(n.circle)?n.circle.geometry:null}else 2===a&&(this.forceUniformSize?(n.circle=x(o,t,this.centered),n.full=l(n.circle)?n.circle.geometry:null):(n.rectangle=G(o,t,this.centered),n.full=n.rectangle.geometry))}break;case"rectangle":if(a>0){const t=I(this.view,o[0]);if(1===a&&e.operationComplete){const e=o[0],i=t.makeMapPoint(e[0]+B*this.view.resolution,e[1]);n.rectangle=O([e,i],t,!0),n.full=n.rectangle.geometry}else 2===a&&(n.rectangle=this.forceUniformSize?O(o,t,this.centered):T(o,t,this.centered),n.full=n.rectangle.geometry)}break;default:return null}switch(this.geometryType){case"point":case"multipoint":break;case"polyline":case"polygon":a>1&&(n.outline=S([o],s,p));break;case"circle":case"rectangle":l(n.full)&&"polygon"===n.full.type&&(n.outline=V(n.full.rings,s,p))}return n}initializeGraphic(e){return null}onComplete(e){this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const e=this._getCreateOperationGeometry({operationComplete:!0});l(e)&&(a(this._graphic)?this._createGraphic(e.full):this._graphic.geometry=e.full,t=s(this._graphic).clone())}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}onVertexAdd(e){this._updateGraphic(),this.emit("vertex-add",e)}onVertexRemove(e){this._updateGraphic(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,a(e)?this._destroyAllVisualisations():(l(e.outline)?this.handles.add(this.onOutlineChanged(e.outline),N.outline):this.handles.remove(N.outline),l(e.regularVertices)?this.handles.add(this.onRegularVerticesChanged(e.regularVertices),N.regularVertices):this.handles.remove(N.regularVertices),l(e.activeVertex)?this.handles.add(this.onActiveVertexChanged(e.activeVertex),N.activeVertex):this.handles.remove(N.activeVertex),l(e.full)?a(this._graphic)?this._createGraphic(e.full):this._graphic.geometry=e.full:this.handles.remove(H))}get _tooltipInfo(){const{drawOperation:e}=this;if(!e)return null;switch(this.geometryType){case"point":return this._drawPointTooltipInfo;case"polyline":return this._drawPolylineTooltipInfo;case"polygon":return this._drawPolygonTooltipInfo;case"rectangle":return this._drawRectangleTooltipInfo;case"circle":return this._drawCircleTooltipInfo;default:return null}}get _drawPointTooltipInfo(){const e=p(this.graphic,(e=>e.geometry));return a(e)||"point"!==e.type||"2d"===this.view.type&&0===this.defaultZ?null:new U({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail})}get _drawPolylineTooltipInfo(){const e=this._createOperationGeometry,t=l(e)?e.full:null;if(a(t)||"polyline"!==t.type)return null;const i=L(t,this._elevationMode);return new M({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,totalLength:c(i,u),viewType:this.view.type})}get _drawPolygonTooltipInfo(){const e=this._createOperationGeometry,t=l(e)?e.full:null;if(a(t)||"polygon"!==t.type)return null;const i=E(t,this._elevationMode);return new k({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,area:c(i,d),viewType:this.view.type})}get _drawRectangleTooltipInfo(){return a(this.drawOperation)?null:new P({tooltipOptions:this.tooltipOptions,xSize:c(this._xSize,u),ySize:c(this._ySize,u),area:c(this._fullGeometryArea,d)})}get _drawCircleTooltipInfo(){if(a(this.drawOperation))return null;const e=this.forceUniformSize;return new A({tooltipOptions:this.tooltipOptions,radius:e?c(this._circleRadius,u):null,xSize:e?null:c(this._xSize,u),ySize:e?null:c(this._ySize,u),area:c(this._fullGeometryArea,d)})}get _circleRadius(){const e=this._createOperationGeometry;return l(e)&&l(e.circle)&&l(e.circle.center)&&l(e.circle.edge)?D(e.circle.center,e.circle.edge,this._elevationMode):null}get _xSize(){const e=this._createOperationGeometry;if(a(e)||a(e.rectangle))return null;const{midpoints:t}=e.rectangle;return l(t)?D(t.left,t.right,this._elevationMode):null}get _ySize(){const e=this._createOperationGeometry;if(a(e)||a(e.rectangle))return null;const{midpoints:t}=e.rectangle;return l(t)?D(t.top,t.bottom,this._elevationMode):null}get _fullGeometryArea(){const e=this._createOperationGeometry,t=l(e)?e.full:null;return a(t)||"polygon"!==t.type?null:E(t,this._elevationMode)}get _elevationTooltipDetail(){return{mode:this.drawOperation.elevationInfo.mode,...this._vertexTooltipElevation}}get _vertexTooltipElevation(){const{tooltipOptions:e,view:t,drawOperation:i}=this;if(a(i))return this._defaultElevation;const o=i.stagedVertex??i.lastVertex;if(a(o)||"2d"===t.type)return this._defaultElevation;const r={mode:e.elevation.mode,offset:0},n=(w(t,o,i.elevationInfo,r)??0)*g(o.spatialReference);return h(n,"meters")}get _elevationMode(){return this.drawOperation.isDraped?"on-the-ground":"absolute-height"}};e([v()],Z.prototype,"_createOperationGeometry",void 0),e([v()],Z.prototype,"_defaultElevation",null),e([v({value:!0})],Z.prototype,"centered",null),e([v({nonNullable:!0})],Z.prototype,"defaultZ",void 0),e([v()],Z.prototype,"drawOperation",void 0),e([v({value:!0})],Z.prototype,"enabled",null),e([v({value:!0})],Z.prototype,"forceUniformSize",null),e([v({constructOnly:!0})],Z.prototype,"geometryType",void 0),e([v()],Z.prototype,"graphic",null),e([v({constructOnly:!0})],Z.prototype,"graphicProperties",void 0),e([v()],Z.prototype,"graphicSymbol",null),e([v({constructOnly:!0})],Z.prototype,"hasZ",void 0),e([v({constructOnly:!0,type:C})],Z.prototype,"labelOptions",void 0),e([v({constructOnly:!0})],Z.prototype,"mode",void 0),e([v()],Z.prototype,"snappingManager",void 0),e([v()],Z.prototype,"snapToScene",void 0),e([v()],Z.prototype,"tooltip",void 0),e([v({constructOnly:!0,type:z})],Z.prototype,"tooltipOptions",void 0),e([v({readOnly:!0})],Z.prototype,"type",void 0),e([v({readOnly:!0})],Z.prototype,"updating",null),e([v({constructOnly:!0,nonNullable:!0})],Z.prototype,"view",void 0),e([v()],Z.prototype,"_tooltipInfo",null),e([v()],Z.prototype,"_drawPointTooltipInfo",null),e([v()],Z.prototype,"_drawPolylineTooltipInfo",null),e([v()],Z.prototype,"_drawPolygonTooltipInfo",null),e([v()],Z.prototype,"_drawRectangleTooltipInfo",null),e([v()],Z.prototype,"_drawCircleTooltipInfo",null),e([v()],Z.prototype,"_circleRadius",null),e([v()],Z.prototype,"_xSize",null),e([v()],Z.prototype,"_ySize",null),e([v()],Z.prototype,"_fullGeometryArea",null),e([v()],Z.prototype,"_elevationTooltipDetail",null),e([v()],Z.prototype,"_vertexTooltipElevation",null),e([v()],Z.prototype,"_elevationMode",null),Z=e([f("esri.views.draw.DrawGraphicTool")],Z);const H="create-operation-graphic",N={outline:"outline-visual",regularVertices:"regular-vertices-visual",activeVertex:"active-vertex-visual"};function q(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment"}}const B=48;export{Z as DrawGraphicTool,q as geometryTypeToDrawOperationGeometryType};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import{makeHandle as r}from"../../core/handleUtils.js";import{destroyMaybe as n,isSome as l,isNone as a,unwrap as s,applySome as p,unwrapOr as c}from"../../core/maybe.js";import{createLength as h,zeroMeters as u,zeroSquareMeters as d}from"../../core/quantityUtils.js";import{watch as m,syncAndInitial as y}from"../../core/reactiveUtils.js";import{getMetersPerVerticalUnitForSR as g}from"../../core/unitUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import _ from"../../layers/GraphicsLayer.js";import{getConvertedElevation as w}from"../../support/elevationInfoUtils.js";import{createSquare as O,createRectangle as T,createCircle as x,createEllipse as G,createPolygon as V,createPolyline as S,createMultipoint as b}from"./support/createUtils.js";import{createViewAlignedCoordinateSystem as I}from"./support/surfaceCoordinateSystems.js";import{InteractiveToolBase as C}from"../interactive/InteractiveToolBase.js";import j from"../interactive/sketch/SketchLabelOptions.js";import k from"../interactive/sketch/SketchTooltipOptions.js";import{DrawPointTooltipInfo as z,DrawPolylineTooltipInfo as U,DrawPolygonTooltipInfo as M,DrawRectangleTooltipInfo as P,DrawCircleTooltipInfo as A}from"../interactive/tooltip/DrawTooltipInfos.js";import{Tooltip as R}from"../interactive/tooltip/Tooltip.js";import{autoAreaByElevationMode as E}from"../support/automaticAreaMeasurementUtils.js";import{autoLengthByElevationMode as L,autoHorizontalDistanceByElevationModeBetweenPoints as D}from"../support/automaticLengthMeasurementUtils.js";let Z=class extends(o(i.EventedMixin(C))){constructor(e){super(e),this._graphic=null,this._createOperationGeometry=null,this.defaultZ=0,this.geometryType=null,this.hasZ=!0,this.labelOptions=new j,this.mode=null,this.snappingManager=null,this.snapToScene=!1,this.tooltip=null,this.tooltipOptions=new k}initialize(){this.internalGraphicsLayer=new _({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer),this.drawOperation=this.makeDrawOperation(),this.handles.add([this.drawOperation.on("vertex-add",(e=>this.onVertexAdd(e))),this.drawOperation.on("vertex-remove",(e=>this.onVertexRemove(e))),this.drawOperation.on("vertex-update",(e=>this.onVertexUpdate(e))),this.drawOperation.on("cursor-update",(e=>this.onCursorUpdate(e))),this.drawOperation.on("complete",(e=>this.onComplete(e))),m((()=>this.tooltipOptions.enabled),(e=>{this.tooltip=e?new R({view:this.view,info:this._tooltipInfo}):n(this.tooltip)}),y),m((()=>this._tooltipInfo),(e=>{l(this.tooltip)&&(this.tooltip.info=e)}),y)]),this.finishToolCreation()}destroy(){this.drawOperation=n(this.drawOperation),this.tooltip=n(this.tooltip),this._destroyAllVisualisations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=n(this.internalGraphicsLayer),this._set("view",null)}get _defaultElevation(){return h(this.defaultZ,"meters")}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),l(this._graphic)&&(this._graphic.symbol=e)}get updating(){return this.drawOperation?.updating??!1}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}_createGraphic(e){this._graphic=new t({...this.graphicProperties,geometry:e,symbol:this.graphicSymbol}),this.internalGraphicsLayer.add(this._graphic),this.handles.add(this.initializeGraphic(this._graphic)),this.notifyChange("graphic"),this.handles.add(r((()=>{l(this._graphic)&&(this.internalGraphicsLayer.remove(this._graphic),this._graphic=n(this._graphic))})),H)}_destroyAllVisualisations(){this.handles.remove(N.outline),this.handles.remove(N.regularVertices),this.handles.remove(N.activeVertex),this.handles.remove(H)}_getCreateOperationGeometry(e={operationComplete:!1}){if(null==this.drawOperation||0===this.drawOperation.numVertices)return null;const t=this.drawOperation.stagedVertex,i=this.drawOperation.committedVertices,o=i.slice();l(t)&&o.push(this.drawOperation.coordinateHelper.pointToArray(t));const r=l(t)?this.drawOperation.coordinateHelper.pointToArray(t):i.splice(-1)[0],n={regularVertices:null,activeVertex:null,full:null,outline:null,circle:null,rectangle:null},a=o.length,s=this.view.spatialReference,p="3d"===this.view.type&&"global"===this.view.viewingMode;switch(this.geometryType){case"point":n.regularVertices=i,n.activeVertex=r,n.full=this.drawOperation.coordinateHelper.arrayToPoint(o[0]);break;case"multipoint":n.regularVertices=i,n.activeVertex=r,a>0&&(n.full=b(o,s));break;case"polyline":n.regularVertices=i,n.activeVertex=r,a>0&&(n.full=S([o],s,p));break;case"polygon":n.regularVertices=i,n.activeVertex=r,a>0&&(n.full=V([o],s,p,!0));break;case"circle":if(a>0){const t=I(this.view,o[0]);if(1===a&&e.operationComplete){const e=o[0],i=t.makeMapPoint(e[0]+B*this.view.resolution,e[1]);n.circle=x([e,i],t,!0),n.full=l(n.circle)?n.circle.geometry:null}else 2===a&&(this.forceUniformSize?(n.circle=x(o,t,this.centered),n.full=l(n.circle)?n.circle.geometry:null):(n.rectangle=G(o,t,this.centered),n.full=n.rectangle.geometry))}break;case"rectangle":if(a>0){const t=I(this.view,o[0]);if(1===a&&e.operationComplete){const e=o[0],i=t.makeMapPoint(e[0]+B*this.view.resolution,e[1]);n.rectangle=O([e,i],t,!0),n.full=n.rectangle.geometry}else 2===a&&(n.rectangle=this.forceUniformSize?O(o,t,this.centered):T(o,t,this.centered),n.full=n.rectangle.geometry)}break;default:return null}switch(this.geometryType){case"point":case"multipoint":break;case"polyline":case"polygon":a>1&&(n.outline=S([o],s,p));break;case"circle":case"rectangle":l(n.full)&&"polygon"===n.full.type&&(n.outline=V(n.full.rings,s,p))}return n}initializeGraphic(e){return null}onComplete(e){this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const e=this._getCreateOperationGeometry({operationComplete:!0});l(e)&&(a(this._graphic)?this._createGraphic(e.full):this._graphic.geometry=e.full,t=s(this._graphic).clone())}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}onVertexAdd(e){this._updateGraphic(),this.emit("vertex-add",e)}onVertexRemove(e){this._updateGraphic(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,a(e)?this._destroyAllVisualisations():(l(e.outline)?this.handles.add(this.onOutlineChanged(e.outline),N.outline):this.handles.remove(N.outline),l(e.regularVertices)?this.handles.add(this.onRegularVerticesChanged(e.regularVertices),N.regularVertices):this.handles.remove(N.regularVertices),l(e.activeVertex)?this.handles.add(this.onActiveVertexChanged(e.activeVertex),N.activeVertex):this.handles.remove(N.activeVertex),l(e.full)?a(this._graphic)?this._createGraphic(e.full):this._graphic.geometry=e.full:this.handles.remove(H))}get _tooltipInfo(){const{drawOperation:e}=this;if(!e)return null;switch(this.geometryType){case"point":return this._drawPointTooltipInfo;case"polyline":return this._drawPolylineTooltipInfo;case"polygon":return this._drawPolygonTooltipInfo;case"rectangle":return this._drawRectangleTooltipInfo;case"circle":return this._drawCircleTooltipInfo;default:return null}}get _drawPointTooltipInfo(){const e=p(this.graphic,(e=>e.geometry));return a(e)||"point"!==e.type||"2d"===this.view.type&&0===this.defaultZ?null:new z({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail})}get _drawPolylineTooltipInfo(){const e=this._createOperationGeometry,t=l(e)?e.full:null;if(a(t)||"polyline"!==t.type)return null;const i=L(t,this._elevationMode),o=t.paths.length>0?t.paths[0]:null;let r;return r=o?o.length>1?"clickToContinue":"clickToAddPoint":"clickToStart",new U({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,totalLength:c(i,u),viewType:this.view.type,helpMessage:r})}get _drawPolygonTooltipInfo(){const e=this._createOperationGeometry,t=l(e)?e.full:null;if(a(t)||"polygon"!==t.type)return null;const i=E(t,this._elevationMode),o=t.rings.length>0?t.rings[0]:null;let r;return r=o?o.length>2?"clickToContinue":"clickToAddPoint":"clickToStart",new M({tooltipOptions:this.tooltipOptions,elevation:this._elevationTooltipDetail,area:c(i,d),viewType:this.view.type,helpMessage:r})}get _drawRectangleTooltipInfo(){return a(this.drawOperation)?null:new P({tooltipOptions:this.tooltipOptions,xSize:c(this._xSize,u),ySize:c(this._ySize,u),area:c(this._fullGeometryArea,d)})}get _drawCircleTooltipInfo(){if(a(this.drawOperation))return null;const e=this.forceUniformSize;return new A({tooltipOptions:this.tooltipOptions,radius:e?c(this._circleRadius,u):null,xSize:e?null:c(this._xSize,u),ySize:e?null:c(this._ySize,u),area:c(this._fullGeometryArea,d)})}get _circleRadius(){const e=this._createOperationGeometry;return l(e)&&l(e.circle)&&l(e.circle.center)&&l(e.circle.edge)?D(e.circle.center,e.circle.edge,this._elevationMode):null}get _xSize(){const e=this._createOperationGeometry;if(a(e)||a(e.rectangle))return null;const{midpoints:t}=e.rectangle;return l(t)?D(t.left,t.right,this._elevationMode):null}get _ySize(){const e=this._createOperationGeometry;if(a(e)||a(e.rectangle))return null;const{midpoints:t}=e.rectangle;return l(t)?D(t.top,t.bottom,this._elevationMode):null}get _fullGeometryArea(){const e=this._createOperationGeometry,t=l(e)?e.full:null;return a(t)||"polygon"!==t.type?null:E(t,this._elevationMode)}get _elevationTooltipDetail(){return{mode:this.drawOperation.elevationInfo.mode,...this._vertexTooltipElevation}}get _vertexTooltipElevation(){const{tooltipOptions:e,view:t,drawOperation:i}=this;if(a(i))return this._defaultElevation;const o=i.stagedVertex??i.lastVertex;if(a(o)||"2d"===t.type)return this._defaultElevation;const r={mode:e.elevation.mode,offset:0},n=(w(t,o,i.elevationInfo,r)??0)*g(o.spatialReference);return h(n,"meters")}get _elevationMode(){return this.drawOperation.isDraped?"on-the-ground":"absolute-height"}};e([v()],Z.prototype,"_createOperationGeometry",void 0),e([v()],Z.prototype,"_defaultElevation",null),e([v({value:!0})],Z.prototype,"centered",null),e([v({nonNullable:!0})],Z.prototype,"defaultZ",void 0),e([v()],Z.prototype,"drawOperation",void 0),e([v({value:!0})],Z.prototype,"enabled",null),e([v({value:!0})],Z.prototype,"forceUniformSize",null),e([v({constructOnly:!0})],Z.prototype,"geometryType",void 0),e([v()],Z.prototype,"graphic",null),e([v({constructOnly:!0})],Z.prototype,"graphicProperties",void 0),e([v()],Z.prototype,"graphicSymbol",null),e([v({constructOnly:!0})],Z.prototype,"hasZ",void 0),e([v({constructOnly:!0,type:j})],Z.prototype,"labelOptions",void 0),e([v({constructOnly:!0})],Z.prototype,"mode",void 0),e([v()],Z.prototype,"snappingManager",void 0),e([v()],Z.prototype,"snapToScene",void 0),e([v()],Z.prototype,"tooltip",void 0),e([v({constructOnly:!0,type:k})],Z.prototype,"tooltipOptions",void 0),e([v({readOnly:!0})],Z.prototype,"type",void 0),e([v({readOnly:!0})],Z.prototype,"updating",null),e([v({constructOnly:!0,nonNullable:!0})],Z.prototype,"view",void 0),e([v()],Z.prototype,"_tooltipInfo",null),e([v()],Z.prototype,"_drawPointTooltipInfo",null),e([v()],Z.prototype,"_drawPolylineTooltipInfo",null),e([v()],Z.prototype,"_drawPolygonTooltipInfo",null),e([v()],Z.prototype,"_drawRectangleTooltipInfo",null),e([v()],Z.prototype,"_drawCircleTooltipInfo",null),e([v()],Z.prototype,"_circleRadius",null),e([v()],Z.prototype,"_xSize",null),e([v()],Z.prototype,"_ySize",null),e([v()],Z.prototype,"_fullGeometryArea",null),e([v()],Z.prototype,"_elevationTooltipDetail",null),e([v()],Z.prototype,"_vertexTooltipElevation",null),e([v()],Z.prototype,"_elevationMode",null),Z=e([f("esri.views.draw.DrawGraphicTool")],Z);const H="create-operation-graphic",N={outline:"outline-visual",regularVertices:"regular-vertices-visual",activeVertex:"active-vertex-visual"};function q(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment"}}const B=48;export{Z as DrawGraphicTool,q as geometryTypeToDrawOperationGeometryType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";let i=class extends t{constructor(){super(...arguments),this.distance=!0,this.elevation=!0,this.size=!0,this.scale=!0,this.rotation=!0,this.orientation=!0,this.totalLength=!0,this.area=!0,this.radius=!0}toJSON(){return{distance:this.distance,size:this.size,scale:this.scale,rotation:this.rotation,orientation:this.orientation,totalLength:this.totalLength,area:this.area,radius:this.radius}}};o([e({type:Boolean,nonNullable:!0})],i.prototype,"distance",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"elevation",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"size",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"scale",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"rotation",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"orientation",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"totalLength",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"area",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"radius",void 0),i=o([s("esri.widgets.Sketch.SketchTooltipOptions.VisibleElements")],i);export{i as SketchTooltipVisibleElements};
|
|
5
|
+
import{_ as o}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";let i=class extends t{constructor(){super(...arguments),this.distance=!0,this.elevation=!0,this.size=!0,this.scale=!0,this.rotation=!0,this.orientation=!0,this.totalLength=!0,this.area=!0,this.radius=!0,this.helpMessage=!0}toJSON(){return{distance:this.distance,size:this.size,scale:this.scale,rotation:this.rotation,orientation:this.orientation,totalLength:this.totalLength,area:this.area,radius:this.radius}}};o([e({type:Boolean,nonNullable:!0})],i.prototype,"distance",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"elevation",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"size",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"scale",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"rotation",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"orientation",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"totalLength",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"area",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"radius",void 0),o([e({type:Boolean,nonNullable:!0})],i.prototype,"helpMessage",void 0),i=o([s("esri.widgets.Sketch.SketchTooltipOptions.VisibleElements")],i);export{i as SketchTooltipVisibleElements};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as o}from"../../../chunks/tslib.es6.js";import{zeroMeters as t,zeroSquareMeters as e}from"../../../core/quantityUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{SketchTooltipInfo as p}from"./SketchTooltipInfo.js";let s=class extends p{constructor(o){super(o),this.type="draw-point"}};o([i()],s.prototype,"type",void 0),o([i()],s.prototype,"elevation",void 0),s=o([r("esri.views.interactive.tooltip.DrawPointTooltipInfo")],s);let a=class extends p{constructor(o){super(o),this.type="draw-polyline",this.helpMessage=void 0}};o([i()],a.prototype,"type",void 0),o([i()],a.prototype,"elevation",void 0),o([i()],a.prototype,"totalLength",void 0),o([i()],a.prototype,"viewType",void 0),o([i()],a.prototype,"helpMessage",void 0),a=o([r("esri.views.interactive.tooltip.DrawPolylineTooltipInfo")],a);let l=class extends p{constructor(o){super(o),this.type="draw-polygon",this.helpMessage=void 0}};o([i()],l.prototype,"type",void 0),o([i()],l.prototype,"elevation",void 0),o([i()],l.prototype,"area",void 0),o([i()],l.prototype,"viewType",void 0),o([i()],l.prototype,"helpMessage",void 0),l=o([r("esri.views.interactive.tooltip.DrawPolygonTooltipInfo")],l);let y=class extends p{constructor(o){super(o),this.type="draw-rectangle",this.xSize=t,this.ySize=t,this.area=e}};o([i()],y.prototype,"type",void 0),o([i()],y.prototype,"xSize",void 0),o([i()],y.prototype,"ySize",void 0),o([i()],y.prototype,"area",void 0),y=o([r("esri.views.interactive.tooltip.DrawRectangleTooltipInfo")],y);let n=class extends p{constructor(o){super(o),this.type="draw-circle",this.radius=null,this.xSize=null,this.ySize=null,this.area=e}};o([i()],n.prototype,"type",void 0),o([i()],n.prototype,"radius",void 0),o([i()],n.prototype,"xSize",void 0),o([i()],n.prototype,"ySize",void 0),o([i()],n.prototype,"area",void 0),n=o([r("esri.views.interactive.tooltip.DrawCircleTooltipInfo")],n);export{n as DrawCircleTooltipInfo,s as DrawPointTooltipInfo,l as DrawPolygonTooltipInfo,a as DrawPolylineTooltipInfo,y as DrawRectangleTooltipInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as
|
|
5
|
+
import{_ as o}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";let t=class extends r{constructor(o){super(o),this.helpMessage=void 0}};o([s()],t.prototype,"tooltipOptions",void 0),o([s()],t.prototype,"helpMessage",void 0),t=o([e("esri.views.interactive.tooltip.SketchTooltipInfo")],t);export{t as SketchTooltipInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../intl.js";import{unwrapOr as e}from"../../../../core/maybe.js";import{formatLength as s,formatRelativeLength as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../intl.js";import{unwrapOr as e}from"../../../../core/maybe.js";import{formatLength as s,formatRelativeLength as i,formatVerticalLength as r,formatRelativeVerticalLength as o,formatArea as n}from"../../../../core/quantityFormatUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as m}from"../../../../support/getDefaultUnitForView.js";import l from"../../../../widgets/Widget.js";import"../../../../widgets/support/widgetUtils.js";import{messageBundle as g}from"../../../../widgets/support/decorators/messageBundle.js";import{formatNumber as c}from"../../../../intl/number.js";let u=class extends l{get _units(){const t=m(this.tooltip.view);return{length:t,verticalLength:t,area:t}}_getHelpMessage(t){const{info:e}=this,{tooltipOptions:s}=e,i=t??e.helpMessage,r=s?.visibleElements?.helpMessage;return r&&i?this._messagesTooltip?.sketch?.helpMessages?.[i]:void 0}_formatScale(t){return c(t,{style:"percent",maximumFractionDigits:0})}_formatRelativeOrientation(t){return c(t,{maximumFractionDigits:2,minimumFractionDigits:2,signDisplay:"exceptZero"})}_formatLength(t,i,r){return s(this._messagesUnits,t,e(i,this._units.length),r)}_formatRelativeLength(t){return i(this._messagesUnits,t,this._units.length)}_formatVerticalLength(t){return r(this._messagesUnits,t,this._units.verticalLength)}_formatRelativeVerticalLength(t){return o(this._messagesUnits,t,this._units.verticalLength)}_formatTotalLength(t){return s(this._messagesUnits,t,this._units.length)}_formatArea(t){return n(this._messagesUnits,t,this._units.area)}_formatPercentage(t){return c(t.value,{style:"percent"})}};t([a()],u.prototype,"info",void 0),t([a()],u.prototype,"tooltip",void 0),t([a()],u.prototype,"_units",null),t([g("esri/core/t9n/Units"),a()],u.prototype,"_messagesUnits",void 0),t([g("esri/views/interactive/tooltip/t9n/Tooltip"),a()],u.prototype,"_messagesTooltip",void 0),u=t([p("esri.views.interactive.tooltip.content.TooltipContent")],u);export{u as TooltipContent};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as r}from"../css.js";import{TooltipContent as o}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as i}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as a}from"../support/TooltipField.js";import{ValueByValue as p}from"../support/ValueByValue.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as m}from"../../../../widgets/support/jsxFactory.js";const l={base:`${r} ${`${r}--draw-rectangle`}`};let c=class extends o{render(){const{area:t,radius:s,xSize:r,ySize:o,tooltipOptions:c}=this.info,{visibleElements:n}=c,u=this._messagesTooltip.sketch;return m(i,{className:l.base,helpMessage:this._getHelpMessage()},n.radius&&e(s)&&m(a,{title:u.radius,value:this._formatLength(s)}),n.size&&e(r)&&e(o)&&m(a,{title:u.size,value:m(p,{left:this._formatLength(r),right:this._formatLength(o)})}),n.area&&m(a,{title:u.area,value:this._formatArea(t)}))}};c=t([s("esri.views.interactive.tooltip.content.TooltipContentDrawCircle")],c);export{c as TooltipContentDrawCircle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as s}from"../css.js";import{TooltipContent as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as s}from"../css.js";import{TooltipContent as e}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as r}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const a={base:`${s}--draw-point`};let l=class extends e{render(){const{elevation:t,tooltipOptions:o}=this.info,{visibleElements:s}=o,e=this._messagesTooltip.sketch;return p(r,{className:a.base,helpMessage:this._getHelpMessage("clickToAddFeature")},s.elevation&&p(i,{title:e.elevation,value:this._formatVerticalLength(t)}))}};l=t([o("esri.views.interactive.tooltip.content.TooltipContentDrawPoint")],l);export{l as TooltipContentDrawPoint};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as e}from"../css.js";import{TooltipContent as s}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as r}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const a={base:`${e} ${`${e}--draw-polygon`}`};let l=class extends s{render(){const{area:t,elevation:o,tooltipOptions:e,viewType:s}=this.info,{visibleElements:l}=e,m=this._messagesTooltip.sketch;return p(r,{className:a.base,helpMessage:this._getHelpMessage()},l.elevation&&"2d"!==s&&p(i,{title:m.elevation,value:this._formatVerticalLength(o)}),l.area&&p(i,{title:m.area,value:this._formatArea(t)}))}};l=t([o("esri.views.interactive.tooltip.content.TooltipContentDrawPolygon")],l);export{l as TooltipContentDrawPolygon};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as o}from"../css.js";import{TooltipContent as s}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as r}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const l={base:`${o} ${`${o}--draw-polyline`}`};let a=class extends s{render(){const{elevation:t,totalLength:e,tooltipOptions:o,viewType:s}=this.info,{visibleElements:a}=o,n=this._messagesTooltip.sketch;return p(r,{className:l.base,helpMessage:this._getHelpMessage()},a.elevation&&"2d"!==s&&p(i,{title:n.elevation,value:this._formatVerticalLength(t)}),a.totalLength&&p(i,{title:n.totalLength,value:this._formatLength(e)}))}};a=t([e("esri.views.interactive.tooltip.content.TooltipContentDrawPolyline")],a);export{a as TooltipContentDrawPolyline};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as o}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as i}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as p}from"../support/TooltipField.js";import{ValueByValue as a}from"../support/ValueByValue.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as m}from"../../../../widgets/support/jsxFactory.js";const l={base:`${o} ${`${o}--draw-rectangle`}`};let c=class extends r{render(){const{area:t,xSize:s,ySize:o,tooltipOptions:r}=this.info,{visibleElements:c}=r,n=this._messagesTooltip.sketch;return m(i,{className:l.base,helpMessage:this._getHelpMessage()},c.size&&e(s)&&e(o)&&m(p,{title:n.size,value:m(a,{left:this._formatLength(s),right:this._formatLength(o)})}),c.area&&m(p,{title:n.area,value:this._formatArea(t)}))}};c=t([s("esri.views.interactive.tooltip.content.TooltipContentDrawRectangle")],c);export{c as TooltipContentDrawRectangle};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as s}from"../css.js";import{TooltipContent as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as s}from"../css.js";import{TooltipContent as e}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as r}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const a={base:`${s} ${`${s}--extent-rotate`}`};let n=class extends e{render(){const{angle:t,tooltipOptions:o}=this.info,{visibleElements:s}=o,e=this._messagesTooltip.sketch;return p(r,{className:a.base,helpMessage:this._getHelpMessage()},s.rotation&&p(i,{title:e.rotation,value:this._formatRelativeOrientation(t)}))}};n=t([o("esri.views.interactive.tooltip.content.TooltipContentExtentRotate")],n);export{n as TooltipContentExtentRotate};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as e}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as s}from"../css.js";import{TooltipContent as o}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as r}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as i}from"../support/TooltipField.js";import{ValueByValue as p}from"../support/ValueByValue.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as l}from"../../../../widgets/support/jsxFactory.js";const a={base:`${s} ${`${s}--extent-scale`}`};let c=class extends o{render(){const t=this.info,{visibleElements:e}=t.tooltipOptions,s=this._messagesTooltip.sketch;return l(r,{className:a.base,helpMessage:this._getHelpMessage()},e.size&&l(i,{title:s.size,value:l(p,{left:this._formatLength(t.xSize),right:this._formatLength(t.ySize)})}),e.scale&&l(i,{title:s.scale,value:l(p,{left:this._formatScale(t.xScale),right:this._formatScale(t.yScale)})}))}};c=t([e("esri.views.interactive.tooltip.content.TooltipContentExtentScale")],c);export{c as TooltipContentExtentScale};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as o}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as o}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as i}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as a}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const l={base:`${o} ${`${o}--reshape-edge-offset`}`};let m=class extends r{render(){const{area:t,distance:s,totalLength:o,tooltipOptions:r}=this.info,{visibleElements:m}=r,n=this._messagesTooltip.sketch;return p(i,{className:l.base,helpMessage:this._getHelpMessage()},m.distance&&p(a,{title:n.distance,value:this._formatRelativeLength(s)}),m.area&&e(t)&&p(a,{title:n.area,value:this._formatArea(t)}),m.totalLength&&e(o)&&p(a,{title:n.totalLength,value:this._formatLength(o)}))}};m=t([s("esri.views.interactive.tooltip.content.TooltipContentReshapeEdgeOffset")],m);export{m as TooltipContentReshapeEdgeOffset};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{formatAngle as o}from"../../../../core/quantityFormatUtils.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{formatAngle as o}from"../../../../core/quantityFormatUtils.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as e}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as i}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as p}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as n}from"../../../../widgets/support/jsxFactory.js";const a={base:`${e} ${`${e}--transform-absolute`}`};let l=class extends r{render(){const{info:t}=this,{visibleElements:s}=t.tooltipOptions,e=this._messagesTooltip.sketch;return n(i,{className:a.base,helpMessage:this._getHelpMessage()},s.orientation&&t.orientationEnabled&&n(p,{title:e.orientation,value:o(t.orientation,t.rotationType,t.orientationPrecision)}),s.size&&t.sizeEnabled&&n(p,{title:e.size,value:this._formatLength(t.size,t.sizeUnit,t.sizePrecision)}))}};l=t([s("esri.views.interactive.tooltip.content.TooltipContentTransformAbsolute")],l);export{l as TooltipContentTransformAbsolute};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{formatAngle as o,formatRelativeAngle as r}from"../../../../core/quantityFormatUtils.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as e}from"../css.js";import{TooltipContent as i}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as p}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as n}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as a}from"../../../../widgets/support/jsxFactory.js";const m={base:`${e} ${`${e}--transform-rotate`}`};let c=class extends i{render(){const{info:t}=this,{visibleElements:s}=t.tooltipOptions,e=this._messagesTooltip.sketch;return a(p,{className:m.base,helpMessage:this._getHelpMessage()},s.rotation&&a(n,{title:e.rotation,value:r(t.rotation,t.rotationType,t.rotationPrecision)}),s.orientation&&a(n,{title:e.orientation,value:o(t.orientation,t.rotationType,t.orientationPrecision)}))}};c=t([s("esri.views.interactive.tooltip.content.TooltipContentTransformRotate")],c);export{c as TooltipContentTransformRotate};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as s}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as
|
|
5
|
+
import{_ as s}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as e}from"../css.js";import{TooltipContent as o}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as r}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const a={base:`${e} ${`${e}--transform-scale`}`};let c=class extends o{render(){const{scale:s,size:t,sizePrecision:e,sizeUnit:o,tooltipOptions:c}=this.info,{visibleElements:l}=c,m=this._messagesTooltip.sketch;return p(r,{className:a.base,helpMessage:this._getHelpMessage()},l.scale&&p(i,{title:m.scale,value:this._formatPercentage(s)}),l.size&&p(i,{title:m.size,value:this._formatLength(t,o,e)}))}};c=s([t("esri.views.interactive.tooltip.content.TooltipContentTransformScale")],c);export{c as TooltipContentTransformScale};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as s}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as t}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as o}from"../css.js";import{TooltipContent as e}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as r}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const a={base:`${o} ${`${o}--translate-graphic`}`};let c=class extends e{render(){const{info:s}=this,{visibleElements:t}=s.tooltipOptions,o=this._messagesTooltip.sketch;return p(r,{className:a.base,helpMessage:this._getHelpMessage()},t.distance&&p(i,{title:o.distance,value:this._formatLength(s.distance)}))}};c=s([t("esri.views.interactive.tooltip.content.TooltipContentTranslateGraphic")],c);export{c as TooltipContentTranslateGraphic};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as o}from"../css.js";import{TooltipContent as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as o}from"../css.js";import{TooltipContent as e}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as r}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const a={base:`${o} ${`${o}--translate-graphic-xy`}`};let c=class extends e{render(){const{info:t}=this,{visibleElements:s}=t.tooltipOptions,o=this._messagesTooltip.sketch;return p(r,{className:a.base,helpMessage:this._getHelpMessage()},s.distance&&p(i,{title:o.distance,value:this._formatRelativeLength(t.distance)}))}};c=t([s("esri.views.interactive.tooltip.content.TooltipContentTranslateGraphicXY")],c);export{c as TooltipContentTranslateGraphicXY};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as e}from"../css.js";import{TooltipContent as o}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as r}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as i}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const a={base:`${e} ${`${e}--translate-graphic-z`}`};let c=class extends o{render(){const{info:t}=this,{visibleElements:s}=t.tooltipOptions,e=this._messagesTooltip.sketch;return p(r,{className:a.base,helpMessage:this._getHelpMessage()},s.distance&&p(i,{title:e.distance,value:this._formatRelativeVerticalLength(t.distance)}))}};c=t([s("esri.views.interactive.tooltip.content.TooltipContentTranslateGraphicZ")],c);export{c as TooltipContentTranslateGraphicZ};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as s}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as s}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as i}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as a}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const l={base:`${s} ${`${s}--translate-vertex`}`};let n=class extends r{render(){const{distance:t,elevation:o,area:s,totalLength:r,tooltipOptions:n}=this.info,{visibleElements:m}=n,c=this._messagesTooltip.sketch;return p(i,{className:l.base,helpMessage:this._getHelpMessage()},m.distance&&p(a,{title:c.distance,value:this._formatLength(t)}),m.elevation&&e(o)&&p(a,{title:c.elevation,value:this._formatVerticalLength(o)}),m.area&&e(s)&&p(a,{title:c.area,value:this._formatArea(s)}),m.totalLength&&e(r)&&p(a,{title:c.totalLength,value:this._formatLength(r)}))}};n=t([o("esri.views.interactive.tooltip.content.TooltipContentTranslateVertex")],n);export{n as TooltipContentTranslateVertex};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as s}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as s}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as i}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as a}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as p}from"../../../../widgets/support/jsxFactory.js";const l={base:`${s} ${`${s}--translate-vertex`}`};let n=class extends r{render(){const{area:t,distance:o,elevation:s,totalLength:r,tooltipOptions:n}=this.info,{visibleElements:m}=n,c=this._messagesTooltip.sketch;return p(i,{className:l.base,helpMessage:this._getHelpMessage()},m.distance&&p(a,{title:c.distance,value:this._formatRelativeLength(o)}),m.elevation&&e(s)&&p(a,{title:c.elevation,value:this._formatVerticalLength(s)}),m.area&&e(t)&&p(a,{title:c.area,value:this._formatArea(t)}),m.totalLength&&e(r)&&p(a,{title:c.totalLength,value:this._formatLength(r)}))}};n=t([o("esri.views.interactive.tooltip.content.TooltipContentTranslateVertexXY")],n);export{n as TooltipContentTranslateVertexXY};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import{isSome as e}from"../../../../core/maybe.js";import"../../../../core/Logger.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/Error.js";import"../../../../core/has.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{CONTENT as o}from"../css.js";import{TooltipContent as r}from"./TooltipContent.js";import{TooltipContentWithHelpMessage as i}from"../support/TooltipContentWithHelpMessage.js";import{TooltipField as p}from"../support/TooltipField.js";import"../../../../widgets/support/widgetUtils.js";import{tsx as a}from"../../../../widgets/support/jsxFactory.js";const l={base:`${o} ${`${o}--translate-vertex`}`};let n=class extends r{render(){const{distance:t,elevation:s,tooltipOptions:o}=this.info,{visibleElements:r}=o,n=this._messagesTooltip.sketch;return a(i,{className:l.base,helpMessage:this._getHelpMessage()},r.distance&&a(p,{title:n.distance,value:this._formatRelativeVerticalLength(t)}),r.elevation&&e(s)&&a(p,{title:n.elevation,value:this._formatVerticalLength(s)}))}};n=t([s("esri.views.interactive.tooltip.content.TooltipContentTranslateVertexZ")],n);export{n as TooltipContentTranslateVertexZ};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const e="esri-tooltip",t=`${e}-content`,o=`${e}-table`,s=`${e}-help-message`;export{e as BASE,t as CONTENT,s as HELP_MESSAGE,o as TABLE};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{HELP_MESSAGE as s,TABLE as t,CONTENT as e}from"../css.js";import{classes as l}from"../../../../widgets/support/widgetUtils.js";import{tsx as r}from"../../../../widgets/support/jsxFactory.js";function i({className:i,helpMessage:o},...p){const a=p.filter((s=>!!s));return r("div",{class:l(i,e)},a.length>0?r("div",{class:t},...a):null,o?r("div",{key:"help-message",class:s},o):null)}export{i as TooltipContentWithHelpMessage};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{DoublePrecisionRequiresObfuscation as s}from"./testDoublePrecisionArithmetic.js";import{FloatBufferBlend as
|
|
5
|
+
import{DrawArraysRequiresIndicesTypeReset as e}from"./testAppleAmdDrawArrays.js";import{DoublePrecisionRequiresObfuscation as s}from"./testDoublePrecisionArithmetic.js";import{FloatBufferBlend as i}from"./testFloatBufferBlend.js";import{IgnoresSamplerPrecision as r}from"./testSamplerPrecision.js";import{SVGPremultipliedAlpha as t}from"./testSVGPremultipliedAlpha.js";class o{constructor(o){this.rctx=o,this.floatBufferBlend=new i(o),this.svgPremultipliesAlpha=new t(o),this.doublePrecisionRequiresObfuscation=new s(o),this.ignoresSamplerPrecision=new r(o),this.drawArraysRequiresIndicesTypeReset=new e(o)}dispose(){this.ignoresSamplerPrecision.dispose(),this.doublePrecisionRequiresObfuscation.dispose(),this.svgPremultipliesAlpha.dispose(),this.floatBufferBlend.dispose(),this.drawArraysRequiresIndicesTypeReset.dispose()}}export{o as WebGLDriverTest};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import has from"../../core/has.js";import{glsl as r}from"../3d/webgl-engine/core/shaderModules/interfaces.js";import{BufferObject as e}from"./BufferObject.js";import{ContextType as t}from"./context-util.js";import{TargetType as o,DepthStencilTargetType as n,TextureType as i,TextureWrapMode as a,PixelFormat as s,PixelType as m,TextureSamplingMode as c,Usage as l,BufferType as p,PrimitiveType as g,DataType as d}from"./enums.js";import{FramebufferObject as _}from"./FramebufferObject.js";import{WebGLDriverTestModule as f}from"./WebGLDriverTestModule.js";class u extends f{constructor(r){super(),this._rctx=r,this._dummyProgram=null,this._rctx.type===t.WEBGL2&&has("mac")&&has("chrome")&&(this._program=this._prepareProgram(),this._dummyProgram=this._prepareDummyProgram())}dispose(){super.dispose(),this._dummyProgram?.dispose(),this._dummyProgram=null}_test(r){const t=this._rctx;t.resetState();const f=new _(t,{colorTarget:o.TEXTURE,depthStencilTarget:n.NONE},{target:i.TEXTURE_2D,wrapMode:a.CLAMP_TO_EDGE,pixelFormat:s.RGBA,dataType:m.UNSIGNED_BYTE,samplingMode:c.NEAREST,width:1,height:1}),u=e.createIndex(this._rctx,l.STATIC_DRAW,new Uint8Array([0]));t.bindFramebuffer(f),t.setViewport(0,0,1,1),t.useProgram(this._dummyProgram),t.bindBuffer(u,p.ELEMENT_ARRAY_BUFFER),t.drawElements(g.POINTS,1,d.UNSIGNED_BYTE,0),t.useProgram(r),t.bindVAO(null),t.drawArrays(g.TRIANGLES,0,258);const h=new Uint8Array(4);return f.readPixels(0,0,1,1,s.RGBA,m.UNSIGNED_BYTE,h),f.dispose(),u.dispose(),255===h[0]}_prepareProgram(){const e=85,t=`\n precision highp float;\n\n varying float triangleId;\n\n const vec3 triangleVertices[3] = vec3[3](vec3(-0.5, -0.5, 0.0), vec3(0.5, -0.5, 0.0), vec3(0.0, 0.5, 0.0));\n\n void main(void) {\n triangleId = floor(float(gl_VertexID)/3.0);\n\n vec3 position = triangleVertices[gl_VertexID % 3];\n float offset = triangleId / ${r.float(e)};\n position.z = 0.5 - offset;\n\n gl_Position = vec4(position, 1.0);\n }\n `,o=`\n precision highp float;\n\n varying float triangleId;\n\n void main(void) {\n gl_FragColor = triangleId == ${r.float(e)} ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);\n }\n \n `;return this._rctx.programCache.acquire(t,o,new Map([]))}_prepareDummyProgram(){const r="\n void main(void) {\n gl_Position = vec4(0.0, 0.0, float(gl_VertexID)-2.0, 1.0);\n }",e="\n void main(void) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }";return this._rctx.programCache.acquire(r,e,new Map([]))}}export{u as DrawArraysRequiresIndicesTypeReset};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import{deprecated as a}from"../../core/deprecate.js";import r from"../../core/Error.js";import o from"../../core/Evented.js";import{HandleOwnerMixin as i}from"../../core/HandleOwner.js";import s from"../../core/Logger.js";import{on as n,when as l,watch as d,whenOnce as p,initial as c}from"../../core/reactiveUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as w}from"../../core/accessorSupport/decorators/subclass.js";import f from"../../layers/GraphicsLayer.js";import h from"../Attachments/AttachmentsViewModel.js";import m from"./CreateFeaturesWorkflow.js";import y from"./CreateWorkflow.js";import{workflowDeprecation as k}from"./deprecationUtils.js";import g from"./UpdateWorkflow.js";import W from"../FeatureForm/FeatureFormViewModel.js";import v from"../FeatureTemplates/FeatureTemplatesViewModel.js";import _ from"../Sketch/SketchViewModel.js";import b from"../Spinner/SpinnerViewModel.js";const F="esri.widgets.Editor.EditorViewModel",C=s.getLogger(F),E=["create","create-features","update"];function O(e,t,a){C.error(new r(e,t,a))}function U(e,t){return e?e.find((e=>e.layer===t)):void 0}let A=class extends(i(o.EventedAccessor)){constructor(e){super(e),this._sketchGraphicsLayer=new f({listMode:"hide",internal:!0}),this.activeWorkflow=null,this._activityQueue=[],this.failures=[],this.attachmentsViewModel=new h({abilities:{editing:!0}}),this.featureFormViewModel=new W,this.featureTemplatesViewModel=new v,this.sketchViewModel=new _({layer:this._sketchGraphicsLayer}),this.spinnerViewModel=new b,this.pageStack=[]}initialize(){this.handles.add([n((()=>this.activeWorkflow),"cancel",(()=>this.emit("workflow-cancel"))),n((()=>this.activeWorkflow),"commit",(()=>this.emit("workflow-commit"))),l((()=>this.view?.map),(e=>{e.add(this._sketchGraphicsLayer)}),c),d((()=>this.editableItems.toArray()),(()=>{const{activeWorkflow:e}=this;if(this.refreshCreationTemplates(),!e)return;const{stepId:t}=e;"create"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdate||"awaiting-update-feature-candidate"===t&&!e.data.candidates.some((e=>{const t=this.editableItems.find((t=>t.layer===e.layer));return t&&t.supports.includes("update")})))&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()})),d((()=>this.page),((e,t)=>{const a=this.pageStack.slice(),r=a.indexOf(e);-1===r&&t?a.push(t):a.splice(r),this.pageStack=a}))])}destroy(){this._cancelWorkflow().then((()=>{this.view?.map&&this.view.map.remove(this._sketchGraphicsLayer),this.view=null}))}get allowedWorkflows(){return this._get("allowedWorkflows")}set allowedWorkflows(e){e&&0!==e.length||(e=[...E]),this._set("allowedWorkflows",e)}get canCreate(){return this.editableItems.some((e=>e.supports.includes("create")))}get canUpdate(){return this.editableItems.some((e=>e.supports.includes("update")||e.supports.includes("delete")||e.attachmentsOnUpdateEnabled))}get editableItems(){const e=this.view?.allLayerViews;if(!e)return new t;const a=this.view?.map?.editableLayers,r=new Set(a),o=a?.filter((e=>e.visible&&e.capabilities.operations.supportsAdd&&!e.capabilities.operations.supportsQuery)),i=e.filter((e=>r.has(e.layer))).map((({layer:e,suspended:t})=>this._getEditableItemFromLayer(e,t))).reverse();return o?.forEach((e=>i.push(this._getEditableItemFromLayer(e,!1)))),i}get labelOptions(){return this.sketchViewModel.labelOptions}set labelOptions(e){this.sketchViewModel.labelOptions=e}set layerInfos(e){e?.some((e=>("allowAttachments"in e&&a(C,"Property: layerInfo.allowAttachments",{replacement:"layerInfo.attachmentsOnCreateEnabled or layerInfo.attachmentsOnUpdateEnabled",version:"4.26"}),!0))),this._set("layerInfos",e)}get snappingOptions(){return this.sketchViewModel.snappingOptions}set snappingOptions(e){this.sketchViewModel.snappingOptions=e}get state(){if(!this.get("view.ready")||0===this.editableItems.length)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this;return t?t.stepId:"ready"}get syncing(){return this._activityQueue.length>0}get tooltipOptions(){return this.sketchViewModel.tooltipOptions}set tooltipOptions(e){this.sketchViewModel.tooltipOptions=e}set view(e){this.sketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}get page(){const{activeWorkflow:e,state:t}=this;return"awaiting-feature-to-update"===t||"awaiting-feature-to-create"===t||"create-features"===e?.type&&0===e.pendingFeatures.length?"ready":t??"disabled"}get selectedTemplateItem(){const{activeWorkflow:e}=this;if("create-features"===e?.type&&0===e.pendingFeatures.length){const{template:t}=e.data.creationInfo;for(const e of this.featureTemplatesViewModel.items)if("findByTemplate"in e){const a=e.findByTemplate(t);if(a)return a}else if(e.template===t)return e}}get featureFormDisabled(){const{state:e,activeWorkflow:t}=this;return"editing-existing-feature"===e&&"update"===t?.type&&!1===t?.data.editableItem.attributeUpdatesEnabled}async startCreateWorkflowAtFeatureTypeSelection(){if(k(C,"startCreateWorkflowAtFeatureTypeSelection","startCreateFeaturesWorkflowAtFeatureTypeSelection"),!this.canCreate)return void O("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createCreateWorkflow();await e.start(),this._set("activeWorkflow",e)}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateWorkflowAtFeatureCreation(e){if(k(C,"startCreateWorkflowAtFeatureCreation","startCreateFeaturesWorkflowAtFeatureCreation"),!this.canCreate)return void O("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createCreateWorkflow("awaiting-feature-to-create");t.data.creationInfo=e,await t.start(),this._set("activeWorkflow",t)}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(!this.canCreate)throw new r("editing:unsupported-workflow","Creating features is unsupported or disabled.");await this._cancelWorkflow();const a=this._createCreateFeaturesWorkflow(e,t);await a.start(),this._set("activeWorkflow",a)}async startCreateWorkflowAtFeatureEdit(e){if(k(C,"startCreateWorkflowAtFeatureEdit"),!this.canCreate)return void O("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createCreateWorkflow("editing-new-feature");t.data.edits.feature=e,await t.start(),this._set("activeWorkflow",t)}async startUpdateWorkflowAtFeatureSelection(){if(!this.canUpdate)return void O("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createUpdateWorkflow();await e.start(),this._set("activeWorkflow",e)}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(!this.canUpdate)return void O("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,await t.start(),this._set("activeWorkflow",t)}async startUpdateWorkflowAtFeatureEdit(e){if(!this.canUpdate)return void O("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createUpdateWorkflow("editing-existing-feature");t.data.edits.feature=e,await t.start(),this._set("activeWorkflow",t)}async deleteFeatureFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?(await this._delete(e.data.edits.feature),await e.reset()):O("editing:unsupported-workflow","Deleting requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warn:!0,...e})}refreshCreationTemplates(){const e=[];for(const{layer:t,supports:a}of this.editableItems)t.loaded&&a.includes("create")&&e.push(t);this.featureTemplatesViewModel.layers=e}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e&&e.warn&&O("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force)return this.emit("workflow-cancel"),this._set("activeWorkflow",null),void await t.cancel(e);await t.cancel(e),this._set("activeWorkflow",null)}_createCreateFeaturesWorkflow(e,t){return m.create(this,e,t,((e,t,a)=>this._applyEdits(e,t,a)),((e,t)=>this._addAttachments(e,t)))}_createCreateWorkflow(e){return y.create(this,e,((e,t,a)=>this._applyEdits(e,t,a)))}_createUpdateWorkflow(e){return g.create(this,e,((e,t)=>this._applyEdits(e,t)))}async _delete(e){const t=e?.sourceLayer;t&&"applyEdits"in t&&await this._applyEdits(t,{deleteFeatures:[e]})}_addAttachments(e,t){const a=[];return t?.forEach((t=>a.push(this._addAttachment(e,t.feature,t.attachment)))),Promise.all(a)}async _addAttachment(e,t,a){let r=null;return await this._queueOperation((async()=>(r=await(e.addAttachment?.(t,a).catch((e=>{throw e?.error||e})))??null,r))),r}async _applyEdits(e,t,a){let r=null;return await this._queueOperation((async()=>{if(e.capabilities.operations.supportsQuery){const o=await this.view.whenLayerView(e);return r=await e.applyEdits(t,a),await p((()=>!o.updating)),r}return r=await e.applyEdits(t,a),r})),r}_queueOperation(e){this._activityQueue.push(e),this.notifyChange("syncing");const t=(e,t)=>{const a=t.indexOf(e);a>-1&&t.splice(a,1)};return e().then((e=>{if("error"in e&&e.error)throw e.error;if("addFeatureResults"in e){const{addFeatureResults:t,deleteFeatureResults:a,updateFeatureResults:r}=e,o=t.find((e=>!!e.error))||r.find((e=>!!e.error))||a.find((e=>!!e.error));if(o)throw o.error}return e})).catch((a=>{O("editing:operation-error","An error occurred.",{error:a});const r={error:a,retry:()=>(t(r,this.failures),this._queueOperation(e)),cancel:()=>{t(r,this.failures)}};this._set("failures",[...this.failures,r])})).then((()=>{t(e,this._activityQueue),this.notifyChange("syncing")}))}_getEditableItemFromLayer(e,t=!0){const{data:a,editing:{supportsGeometryUpdate:r},operations:o}=e.capabilities,i=U(this.layerInfos,e),s=this.allowedWorkflows,n=[];o.supportsAdd&&(s.includes("create")||s.includes("create-features"))&&(!i||!1!==i.enabled&&!1!==i.addEnabled)&&n.push("create");const l=o.supportsUpdate&&s.includes("update")&&(!i||!1!==i.enabled&&!1!==i.updateEnabled);l&&n.push("update"),o.supportsDelete&&s.includes("update")&&(!i||!1!==i.enabled&&!1!==i.deleteEnabled)&&n.push("delete");const d=l&&(!i||!1!==i.attributeUpdatesEnabled),p=l&&r&&(!i||!1!==i.geometryUpdatesEnabled),c=!!a.supportsAttachment&&(n.includes("create")||n.includes("update"))&&(!i||!1!==i.allowAttachments);return{layer:e,supports:t?[]:n,attributeUpdatesEnabled:d,geometryUpdatesEnabled:p,hasAttachments:c,attachmentsOnCreateEnabled:c&&(s.includes("create")||s.includes("create-features"))&&(!i||!1!==i.attachmentsOnCreateEnabled),attachmentsOnUpdateEnabled:c&&s.includes("update")&&(!i||!1!==i.attachmentsOnUpdateEnabled)}}};e([u({readOnly:!0})],A.prototype,"activeWorkflow",void 0),e([u({readOnly:!0})],A.prototype,"_activityQueue",void 0),e([u({value:[...E]})],A.prototype,"allowedWorkflows",null),e([u({readOnly:!0})],A.prototype,"canCreate",null),e([u({readOnly:!0})],A.prototype,"canUpdate",null),e([u({readOnly:!0})],A.prototype,"editableItems",null),e([u({readOnly:!0})],A.prototype,"failures",void 0),e([u()],A.prototype,"attachmentsViewModel",void 0),e([u()],A.prototype,"featureFormViewModel",void 0),e([u()],A.prototype,"featureTemplatesViewModel",void 0),e([u()],A.prototype,"labelOptions",null),e([u()],A.prototype,"layerInfos",null),e([u()],A.prototype,"sketchViewModel",void 0),e([u()],A.prototype,"snappingOptions",null),e([u()],A.prototype,"spinnerViewModel",void 0),e([u()],A.prototype,"state",null),e([u({readOnly:!0})],A.prototype,"syncing",null),e([u()],A.prototype,"tooltipOptions",null),e([u()],A.prototype,"view",null),e([u()],A.prototype,"pageStack",void 0),e([u()],A.prototype,"page",null),e([u()],A.prototype,"selectedTemplateItem",null),e([u()],A.prototype,"featureFormDisabled",null),A=e([w(F)],A);const M=A;export{M as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import{deprecated as a}from"../../core/deprecate.js";import r from"../../core/Error.js";import i from"../../core/Evented.js";import{HandleOwnerMixin as o}from"../../core/HandleOwner.js";import s from"../../core/Logger.js";import{isSome as n}from"../../core/maybe.js";import{on as l,when as d,watch as c,whenOnce as p,initial as u}from"../../core/reactiveUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as w}from"../../core/accessorSupport/decorators/subclass.js";import f from"../../layers/GraphicsLayer.js";import m from"../Attachments/AttachmentsViewModel.js";import y from"./CreateFeaturesWorkflow.js";import k from"./CreateWorkflow.js";import{workflowDeprecation as g}from"./deprecationUtils.js";import v from"./UpdateWorkflow.js";import W from"../FeatureForm/FeatureFormViewModel.js";import b from"../FeatureTemplates/FeatureTemplatesViewModel.js";import _ from"../Sketch/SketchViewModel.js";import C from"../Spinner/SpinnerViewModel.js";const F="esri.widgets.Editor.EditorViewModel",E=s.getLogger(F),O=["create","create-features","update"];function A(e,t,a){E.error(new r(e,t,a))}function U(e,t){return e?e.find((e=>e.layer===t)):void 0}let I=class extends(o(i.EventedAccessor)){constructor(e){super(e),this._sketchGraphicsLayer=new f({listMode:"hide",internal:!0}),this.activeWorkflow=null,this._activityQueue=[],this.failures=[],this.attachmentsViewModel=new m({abilities:{editing:!0}}),this.featureFormViewModel=new W,this.featureTemplatesViewModel=new b,this.sketchViewModel=new _({layer:this._sketchGraphicsLayer}),this.spinnerViewModel=new C,this.pageStack=[],this.showDiscardPrompt=()=>Promise.resolve(),this._candidateCommitted=!1,this.back=async()=>{const e=this.activeWorkflow;if(!e||!this.canGoBack)return;if("create"===e.type||"create-features"===e.type&&e.numPendingFeatures>0||"editing-existing-feature"===e.stepId&&e.data.edits.modified)try{await this.showDiscardPrompt()}catch(t){return}e.hasPreviousStep?await e.previous({cancelCurrentStep:!0}):await this.cancelWorkflow({force:!0})},this.save=()=>{const{featureFormViewModel:e}=this;e.submit(),!e.submittable||e.validateContingencyConstraints(e.getValues(),{includeIncompleteViolations:!0}).length>0||this.activeWorkflow?.commit()},this.selectFeature=(e,t=!1)=>{const a=this.activeWorkflow;this._candidateCommitted||"update"!==a?.type||(a.data.edits.feature=e,t&&(a.next(),this._candidateCommitted=!0))}}initialize(){this.handles.add([l((()=>this.activeWorkflow),"cancel",(()=>this.emit("workflow-cancel"))),l((()=>this.activeWorkflow),"commit",(()=>this.emit("workflow-commit"))),d((()=>this.view?.map),(e=>{e.add(this._sketchGraphicsLayer)}),u),c((()=>this.editableItems.toArray()),(()=>{const{activeWorkflow:e}=this;if(this.refreshCreationTemplates(),!e)return;const{stepId:t}=e;"create"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdate||"awaiting-update-feature-candidate"===t&&!e.data.candidates.some((e=>{const t=this.editableItems.find((t=>t.layer===e.layer));return t&&t.supports.includes("update")})))&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()})),c((()=>this.page),((e,t)=>{const a=this.pageStack.slice(),r=a.indexOf(e);-1===r&&t?a.push(t):a.splice(r),this.pageStack=a})),d((()=>"awaiting-update-feature-candidate"===this.state),(()=>this._candidateCommitted=!1))])}destroy(){this._cancelWorkflow().then((()=>{this.view?.map&&this.view.map.remove(this._sketchGraphicsLayer),this.view=null}))}get allowedWorkflows(){return this._get("allowedWorkflows")}set allowedWorkflows(e){e&&0!==e.length||(e=[...O]),this._set("allowedWorkflows",e)}get canCreate(){return this.editableItems.some((e=>e.supports.includes("create")))}get canUpdate(){return this.editableItems.some((e=>e.supports.includes("update")||e.supports.includes("delete")||e.attachmentsOnUpdateEnabled))}get editableItems(){const e=this.view?.allLayerViews;if(!e)return new t;const a=this.view?.map?.editableLayers,r=new Set(a),i=a?.filter((e=>e.visible&&e.capabilities.operations.supportsAdd&&!e.capabilities.operations.supportsQuery)),o=e.filter((e=>r.has(e.layer))).map((({layer:e,suspended:t})=>this._getEditableItemFromLayer(e,t))).reverse();return i?.forEach((e=>o.push(this._getEditableItemFromLayer(e,!1)))),o}get labelOptions(){return this.sketchViewModel.labelOptions}set labelOptions(e){this.sketchViewModel.labelOptions=e}set layerInfos(e){e?.some((e=>("allowAttachments"in e&&a(E,"Property: layerInfo.allowAttachments",{replacement:"layerInfo.attachmentsOnCreateEnabled or layerInfo.attachmentsOnUpdateEnabled",version:"4.26"}),!0))),this._set("layerInfos",e)}get snappingOptions(){return this.sketchViewModel.snappingOptions}set snappingOptions(e){this.sketchViewModel.snappingOptions=e}get state(){if(!this.get("view.ready")||0===this.editableItems.length)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this;return t?t.stepId:"ready"}get syncing(){return this._activityQueue.length>0}get tooltipOptions(){return this.sketchViewModel.tooltipOptions}set tooltipOptions(e){this.sketchViewModel.tooltipOptions=e}set view(e){this.sketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}get page(){const{activeWorkflow:e,state:t}=this;return"awaiting-feature-to-update"===t||"awaiting-feature-to-create"===t||"create-features"===e?.type&&0===e.pendingFeatures.length?"ready":t??"disabled"}get selectedTemplateItem(){const{activeWorkflow:e}=this;if("create-features"===e?.type&&0===e.pendingFeatures.length){const{template:t}=e.data.creationInfo;for(const e of this.featureTemplatesViewModel.items)if("findByTemplate"in e){const a=e.findByTemplate(t);if(a)return a}else if(e.template===t)return e}}get featureFormDisabled(){const{state:e,activeWorkflow:t}=this;return"editing-existing-feature"===e&&"update"===t?.type&&!1===t?.data.editableItem.attributeUpdatesEnabled}get canGoBack(){return n(this.activeWorkflow)&&!this.syncing}get shouldShowDeleteButton(){const{activeWorkflow:e}=this;return!!e&&"update"===e.type&&e.data.editableItem.supports.includes("delete")}get shouldShowAttachments(){const e=this.activeWorkflow;if(!e)return!1;if("update"===e.type)return e.data.editableItem.attachmentsOnUpdateEnabled;const t=e.data.creationInfo;if(!t)return!1;const{layerInfos:a}=this,{layer:r}=t,i=this.editableItems.find((e=>e.layer===r));if(i)return i.attachmentsOnCreateEnabled;const{data:o}=r.capabilities,s=a&&a.find((e=>e.layer===r));return"supportsAttachment"in o&&o.supportsAttachment&&(!s||!1!==s.allowAttachments&&!1!==s.attachmentsOnUpdateEnabled)}async startCreateWorkflowAtFeatureTypeSelection(){if(g(E,"startCreateWorkflowAtFeatureTypeSelection","startCreateFeaturesWorkflowAtFeatureTypeSelection"),!this.canCreate)return void A("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createCreateWorkflow();await e.start(),this._set("activeWorkflow",e)}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateWorkflowAtFeatureCreation(e){if(g(E,"startCreateWorkflowAtFeatureCreation","startCreateFeaturesWorkflowAtFeatureCreation"),!this.canCreate)return void A("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createCreateWorkflow("awaiting-feature-to-create");t.data.creationInfo=e,await t.start(),this._set("activeWorkflow",t)}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(!this.canCreate)throw new r("editing:unsupported-workflow","Creating features is unsupported or disabled.");await this._cancelWorkflow();const a=this._createCreateFeaturesWorkflow(e,t);await a.start(),this._set("activeWorkflow",a)}async startCreateWorkflowAtFeatureEdit(e){if(g(E,"startCreateWorkflowAtFeatureEdit"),!this.canCreate)return void A("editing:unsupported-workflow","Create workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createCreateWorkflow("editing-new-feature");t.data.edits.feature=e,await t.start(),this._set("activeWorkflow",t)}async startUpdateWorkflowAtFeatureSelection(){if(!this.canUpdate)return void A("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const e=this._createUpdateWorkflow();await e.start(),this._set("activeWorkflow",e)}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(!this.canUpdate)return void A("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,await t.start(),this._set("activeWorkflow",t)}async startUpdateWorkflowAtFeatureEdit(e){if(!this.canUpdate)return void A("editing:unsupported-workflow","Update workflow is unsupported or disabled.");await this._cancelWorkflow();const t=this._createUpdateWorkflow("editing-existing-feature");t.data.edits.feature=e,await t.start(),this._set("activeWorkflow",t)}async deleteFeatureFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?(await this._delete(e.data.edits.feature),await e.reset()):A("editing:unsupported-workflow","Deleting requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warn:!0,...e})}refreshCreationTemplates(){const e=[];for(const{layer:t,supports:a}of this.editableItems)t.loaded&&a.includes("create")&&e.push(t);this.featureTemplatesViewModel.layers=e}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e&&e.warn&&A("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force)return this.emit("workflow-cancel"),this._set("activeWorkflow",null),void await t.cancel(e);await t.cancel(e),this._set("activeWorkflow",null)}_createCreateFeaturesWorkflow(e,t){return y.create(this,e,t,((e,t,a)=>this._applyEdits(e,t,a)),((e,t)=>this._addAttachments(e,t)))}_createCreateWorkflow(e){return k.create(this,e,((e,t,a)=>this._applyEdits(e,t,a)))}_createUpdateWorkflow(e){return v.create(this,e,((e,t)=>this._applyEdits(e,t)))}async _delete(e){const t=e?.sourceLayer;t&&"applyEdits"in t&&await this._applyEdits(t,{deleteFeatures:[e]})}_addAttachments(e,t){const a=[];return t?.forEach((t=>a.push(this._addAttachment(e,t.feature,t.attachment)))),Promise.all(a)}async _addAttachment(e,t,a){let r=null;return await this._queueOperation((async()=>(r=await(e.addAttachment?.(t,a).catch((e=>{throw e?.error||e})))??null,r))),r}async _applyEdits(e,t,a){let r=null;return await this._queueOperation((async()=>{if(e.capabilities.operations.supportsQuery){const i=await this.view.whenLayerView(e);return r=await e.applyEdits(t,a),await p((()=>!i.updating)),r}return r=await e.applyEdits(t,a),r})),r}_queueOperation(e){this._activityQueue.push(e),this.notifyChange("syncing");const t=(e,t)=>{const a=t.indexOf(e);a>-1&&t.splice(a,1)};return e().then((e=>{if("error"in e&&e.error)throw e.error;if("addFeatureResults"in e){const{addFeatureResults:t,deleteFeatureResults:a,updateFeatureResults:r}=e,i=t.find((e=>!!e.error))||r.find((e=>!!e.error))||a.find((e=>!!e.error));if(i)throw i.error}return e})).catch((a=>{A("editing:operation-error","An error occurred.",{error:a});const r={error:a,retry:()=>(t(r,this.failures),this._queueOperation(e)),cancel:()=>{t(r,this.failures)}};this._set("failures",[...this.failures,r])})).then((()=>{t(e,this._activityQueue),this.notifyChange("syncing")}))}_getEditableItemFromLayer(e,t=!0){const{data:a,editing:{supportsGeometryUpdate:r},operations:i}=e.capabilities,o=U(this.layerInfos,e),s=this.allowedWorkflows,n=[];i.supportsAdd&&(s.includes("create")||s.includes("create-features"))&&(!o||!1!==o.enabled&&!1!==o.addEnabled)&&n.push("create");const l=i.supportsUpdate&&s.includes("update")&&(!o||!1!==o.enabled&&!1!==o.updateEnabled);l&&n.push("update"),i.supportsDelete&&s.includes("update")&&(!o||!1!==o.enabled&&!1!==o.deleteEnabled)&&n.push("delete");const d=l&&(!o||!1!==o.attributeUpdatesEnabled),c=l&&r&&(!o||!1!==o.geometryUpdatesEnabled),p=!!a.supportsAttachment&&(n.includes("create")||n.includes("update"))&&(!o||!1!==o.allowAttachments);return{layer:e,supports:t?[]:n,attributeUpdatesEnabled:d,geometryUpdatesEnabled:c,hasAttachments:p,attachmentsOnCreateEnabled:p&&(s.includes("create")||s.includes("create-features"))&&(!o||!1!==o.attachmentsOnCreateEnabled),attachmentsOnUpdateEnabled:p&&s.includes("update")&&(!o||!1!==o.attachmentsOnUpdateEnabled)}}};e([h({readOnly:!0})],I.prototype,"activeWorkflow",void 0),e([h({readOnly:!0})],I.prototype,"_activityQueue",void 0),e([h({value:[...O]})],I.prototype,"allowedWorkflows",null),e([h({readOnly:!0})],I.prototype,"canCreate",null),e([h({readOnly:!0})],I.prototype,"canUpdate",null),e([h({readOnly:!0})],I.prototype,"editableItems",null),e([h({readOnly:!0})],I.prototype,"failures",void 0),e([h()],I.prototype,"attachmentsViewModel",void 0),e([h()],I.prototype,"featureFormViewModel",void 0),e([h()],I.prototype,"featureTemplatesViewModel",void 0),e([h()],I.prototype,"labelOptions",null),e([h()],I.prototype,"layerInfos",null),e([h()],I.prototype,"sketchViewModel",void 0),e([h()],I.prototype,"snappingOptions",null),e([h()],I.prototype,"spinnerViewModel",void 0),e([h()],I.prototype,"state",null),e([h({readOnly:!0})],I.prototype,"syncing",null),e([h()],I.prototype,"tooltipOptions",null),e([h()],I.prototype,"view",null),e([h()],I.prototype,"pageStack",void 0),e([h()],I.prototype,"showDiscardPrompt",void 0),e([h()],I.prototype,"_candidateCommitted",void 0),e([h()],I.prototype,"page",null),e([h()],I.prototype,"selectedTemplateItem",null),e([h()],I.prototype,"featureFormDisabled",null),e([h()],I.prototype,"canGoBack",null),e([h()],I.prototype,"shouldShowDeleteButton",null),e([h()],I.prototype,"shouldShowAttachments",null),I=e([w(F)],I);const V=I;export{V as default};
|