@arcgis/core 6.0.0-next.49 → 6.0.0-next.50
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/WebEditor/sketchUtils.js +1 -1
- package/arcade/treeAnalysis.js +1 -1
- package/arcgisGlobal.d.ts +0 -6
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/08dd03bc068862160cb2.js +1 -0
- package/assets/esri/core/workers/chunks/38a5be53c3a11adc82e2.js +1 -0
- package/assets/esri/core/workers/chunks/5f12213ccda1f222f244.js +1 -0
- package/assets/esri/core/workers/chunks/aa6f8ee1e1734488ff10.js +1 -0
- package/assets/esri/core/workers/chunks/d781b7e6f9f9f399cf03.js +1 -0
- package/assets/esri/core/workers/chunks/fb4fe32b0b53d8e57f92.js +1 -0
- package/chunks/Pattern.glsl.js +31 -42
- package/config.js +1 -1
- package/interfaces.d.ts +0 -36
- package/kernel.js +1 -1
- package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +8 -8
- package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
- package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
- package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
- package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
- package/layers/geospatialPDF/parseAttachmentUtils.js +2 -0
- package/layers/geospatialPDF/sharedUtils.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/raster/datasets/TIFFRaster.js +1 -1
- package/layers/raster/formats/TiffDecoder.js +1 -1
- package/layers/raster/formats/tiffParser.js +1 -1
- package/package.json +3 -3
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +2 -2
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +2 -2
- package/views/2d/analysis/DistanceMeasurementAnalysisView2D.js +1 -1
- package/views/3d/analysis/Dimension/LengthDimensionLineRenderObject.js +2 -0
- package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
- package/views/3d/interactive/BufferManipulator3D.js +2 -0
- package/views/3d/interactive/BufferRenderObject.js +2 -0
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/Manipulator3DBase.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/LinkChartView.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/interactive/Tooltip.js +1 -1
- package/views/interactive/options/InteractiveToolOptions.js +1 -1
- package/views/interactive/options/ViewOptions.d.ts +5 -1
- package/views/interactive/options/bindViewToolOptions.js +1 -1
- package/views/interactive/sketch/SketchOptions.d.ts +1 -26
- package/views/interactive/sketch/SketchOptions.js +1 -1
- package/views/interactive/snapping/FeatureSnappingLayerSource.d.ts +4 -4
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.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/TooltipContentDrawMesh.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/TooltipContentElevation.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/TooltipContentMovePoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentReshapeEdgeOffset.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentSelectedVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformMesh.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTransformPoint.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslate.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateVertex.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateXY.js +1 -1
- package/views/interactive/tooltip/content/TooltipContentTranslateZ.js +1 -1
- package/views/interactive/tooltip/fields/TooltipField.js +1 -1
- package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
- package/views/interactive/tooltip/infos/SketchTooltipInfo.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +8 -8
- package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
- package/widgets/AreaMeasurement2D.d.ts +8 -8
- package/widgets/AreaMeasurement2D.js +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.d.ts +7 -0
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +18 -0
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +8 -8
- package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
- package/widgets/DistanceMeasurement2D.d.ts +8 -8
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +23 -23
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor.d.ts +24 -24
- package/widgets/Editor.js +1 -1
- package/widgets/Sketch/SketchViewModel.d.ts +25 -25
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.d.ts +24 -24
- package/widgets/Sketch.js +1 -1
- package/widgets/UtilityNetworkTrace/support/GraphicHandler.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.d.ts +3 -3
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/widgets/support/GridControls.d.ts +4 -4
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/SnappingControls/SnappingControlsViewModel.d.ts +5 -5
- package/widgets/support/SnappingControls/SnappingControlsViewModel.js +1 -1
- package/widgets/support/SnappingControls/VisibleElements.d.ts +3 -3
- package/widgets/support/SnappingControls.d.ts +7 -7
- package/widgets/support/SnappingControls.js +1 -1
- package/assets/esri/core/workers/chunks/0fd5ff5b6037c89257ec.js +0 -1
- package/assets/esri/core/workers/chunks/27a91b52d1bee92b6f20.js +0 -1
- package/assets/esri/core/workers/chunks/3ce7120056040af3bab1.js +0 -1
- package/assets/esri/core/workers/chunks/630a36c4817f33f4cad2.js +0 -1
- package/assets/esri/core/workers/chunks/a0e2a1c6f37454547193.js +0 -1
- package/assets/esri/core/workers/chunks/c4974a4dc081e23899ba.js +0 -1
- package/views/interactive/sketch/SketchLabelOptions.d.ts +0 -72
- package/views/interactive/sketch/SketchLabelOptions.js +0 -2
- package/views/interactive/sketch/SketchTooltipElevationOptions.js +0 -2
- package/views/interactive/sketch/SketchTooltipOptions.d.ts +0 -87
- package/views/interactive/sketch/SketchTooltipOptions.js +0 -2
- package/views/interactive/sketch/SketchTooltipVisibleElements.d.ts +0 -19
- package/views/interactive/sketch/SketchTooltipVisibleElements.js +0 -2
- package/views/interactive/sketch/SketchValueOptions.d.ts +0 -27
- package/views/interactive/sketch/SketchValueOptions.js +0 -2
- package/views/interactive/sketch/Units.d.ts +0 -20
- package/views/interactive/sketch/Units.js +0 -2
- package/views/interactive/snapping/SnappingOptions.d.ts +0 -75
- package/views/interactive/snapping/SnappingOptions.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{DrawHeaderActions as n}from"../components/DrawHeaderActions.js";import{Fields as r}from"./Fields.js";import{TooltipContent as i}from"./TooltipContent.js";import{tsx as a}from"../../../../widgets/support/widget.js";let o=class extends i{_renderContent(){let{fieldContext:e,info:t,mode:n}=this,{xyMode:i,
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{DrawHeaderActions as n}from"../components/DrawHeaderActions.js";import{Fields as r}from"./Fields.js";import{TooltipContent as i}from"./TooltipContent.js";import{tsx as a}from"../../../../widgets/support/widget.js";let o=class extends i{_renderContent(){let{fieldContext:e,info:t,mode:n}=this,{xyMode:i,toolOptions:o}=t;return a(r,{context:e,fields:[...i===`direction-distance`?[o.isTooltipFieldVisible(`direction`)?t.direction:void 0,o.isTooltipFieldVisible(`distance`)?t.distance:void 0]:[o.isTooltipFieldVisible(`coordinates`)?t.effectiveX:void 0,o.isTooltipFieldVisible(`coordinates`)?t.effectiveY:void 0],o.isTooltipFieldVisible(`elevation`)?t.elevation:void 0,o.isTooltipFieldVisible(`area`)?t.area:void 0],mode:n})}_renderActions(){let{xyMode:e,toolOptions:t}=this.info;return a(n,{toolOptions:t,visibleElements:{direction:e===`direction-distance`}})}};o=e([t(`esri.views.interactive.tooltip.content.TooltipContentDrawPolygon`)],o);export{o as TooltipContentDrawPolygon};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{DrawHeaderActions as n}from"../components/DrawHeaderActions.js";import{Fields as r}from"./Fields.js";import{TooltipContent as i}from"./TooltipContent.js";import{tsx as a}from"../../../../widgets/support/widget.js";let o=class extends i{_renderContent(){let{fieldContext:e,info:t,mode:n}=this,{xyMode:i,
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{DrawHeaderActions as n}from"../components/DrawHeaderActions.js";import{Fields as r}from"./Fields.js";import{TooltipContent as i}from"./TooltipContent.js";import{tsx as a}from"../../../../widgets/support/widget.js";let o=class extends i{_renderContent(){let{fieldContext:e,info:t,mode:n}=this,{xyMode:i,toolOptions:o}=t;return a(r,{context:e,fields:[...i===`direction-distance`?[o.isTooltipFieldVisible(`direction`)?t.direction:void 0,o.isTooltipFieldVisible(`distance`)?t.distance:void 0]:[o.isTooltipFieldVisible(`coordinates`)?t.effectiveX:void 0,o.isTooltipFieldVisible(`coordinates`)?t.effectiveY:void 0],o.isTooltipFieldVisible(`elevation`)?t.elevation:void 0,o.isTooltipFieldVisible(`totalLength`)?t.totalLength:void 0],mode:n})}_renderActions(){let{xyMode:e,toolOptions:t}=this.info;return a(n,{toolOptions:t,visibleElements:{direction:e===`direction-distance`}})}};o=e([t(`esri.views.interactive.tooltip.content.TooltipContentDrawPolyline`)],o);export{o as TooltipContentDrawPolyline};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{ValueByValue as r}from"../components/ValueByValue.js";import{TooltipContent as i}from"./TooltipContent.js";import{tsx as a,tsxFragment as o}from"../../../../widgets/support/widget.js";let s=class extends i{_renderContent(){let{area:e,xSize:t,ySize:i,
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{ValueByValue as r}from"../components/ValueByValue.js";import{TooltipContent as i}from"./TooltipContent.js";import{tsx as a,tsxFragment as o}from"../../../../widgets/support/widget.js";let s=class extends i{_renderContent(){let{area:e,xSize:t,ySize:i,toolOptions:s}=this.info,c=this._messagesTooltip.sketch,l=this._formatters;return a(o,null,s.isTooltipFieldVisible(`size`)&&t!=null&&i!=null?a(n,{title:c.size,value:a(r,{left:l.length(t),right:l.length(i)})}):null,s.isTooltipFieldVisible(`area`)?a(n,{title:c.area,value:l.area(e)}):null)}};s=e([t(`esri.views.interactive.tooltip.content.TooltipContentDrawRectangle`)],s);export{s as TooltipContentDrawRectangle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{Fields as n}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let a=class extends r{_renderContent(){let{fieldContext:e,info:t,mode:r}=this,{
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{Fields as n}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let a=class extends r{_renderContent(){let{fieldContext:e,info:t,mode:r}=this,{toolOptions:a}=t;return i(n,{context:e,fields:[a.isTooltipFieldVisible(`elevation`)?t.elevation:void 0],mode:r})}};a=e([t(`esri.views.interactive.tooltip.content.TooltipContentElevation`)],a);export{a as TooltipContentElevation};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i,tsxFragment as a}from"../../../../widgets/support/widget.js";let o=class extends r{_renderContent(){let{angle:e,
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i,tsxFragment as a}from"../../../../widgets/support/widget.js";let o=class extends r{_renderContent(){let{angle:e,toolOptions:t}=this.info,r=this._messagesTooltip.sketch;return i(a,null,t.isTooltipFieldVisible(`rotation`)?i(n,{title:r.rotation,value:this._formatters.angleRelative(e)}):null)}};o=e([t(`esri.views.interactive.tooltip.content.TooltipContentExtentRotate`)],o);export{o as TooltipContentExtentRotate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{ValueByValue as r}from"../components/ValueByValue.js";import{TooltipContent as i}from"./TooltipContent.js";import{tsx as a,tsxFragment as o}from"../../../../widgets/support/widget.js";let s=class extends i{_renderContent(){let e=this.info,{
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{ValueByValue as r}from"../components/ValueByValue.js";import{TooltipContent as i}from"./TooltipContent.js";import{tsx as a,tsxFragment as o}from"../../../../widgets/support/widget.js";let s=class extends i{_renderContent(){let e=this.info,{toolOptions:t}=e,i=this._messagesTooltip.sketch,s=this._formatters;return a(o,null,t.isTooltipFieldVisible(`size`)?a(n,{title:i.size,value:a(r,{left:s.length(e.xSize),right:s.length(e.ySize)})}):null,t.isTooltipFieldVisible(`scale`)?a(n,{title:i.scale,value:a(r,{left:s.scale(e.xScale),right:s.scale(e.yScale)})}):null)}};s=e([t(`esri.views.interactive.tooltip.content.TooltipContentExtentScale`)],s);export{s as TooltipContentExtentScale};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{Fields as n}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let a=class extends r{_renderContent(){let{fieldContext:e,info:t,mode:r}=this,{
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{Fields as n}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let a=class extends r{_renderContent(){let{fieldContext:e,info:t,mode:r}=this,{toolOptions:a}=t;return i(n,{context:e,fields:[a.isTooltipFieldVisible(`coordinates`)?t.effectiveX:void 0,a.isTooltipFieldVisible(`coordinates`)?t.effectiveY:void 0,a.isTooltipFieldVisible(`elevation`)?t.elevation:void 0],mode:r})}};a=e([t(`esri.views.interactive.tooltip.content.TooltipContentMovePoint`)],a);export{a as TooltipContentMovePoint};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{Fields as n}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let a=class extends r{_renderContent(){let{fieldContext:e,info:t,mode:r}=this,{
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{Fields as n}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let a=class extends r{_renderContent(){let{fieldContext:e,info:t,mode:r}=this,{toolOptions:a}=t;return i(n,{context:e,fields:[a.isTooltipFieldVisible(`distance`)?t.distance:void 0,a.isTooltipFieldVisible(`area`)?t.area:void 0,a.isTooltipFieldVisible(`totalLength`)?t.totalLength:void 0],mode:r})}};a=e([t(`esri.views.interactive.tooltip.content.TooltipContentReshapeEdgeOffset`)],a);export{a as TooltipContentReshapeEdgeOffset};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{Fields as n}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let a=class extends r{_renderContent(){let{fieldContext:e,info:t,mode:r}=this,{
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{Fields as n}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let a=class extends r{_renderContent(){let{fieldContext:e,info:t,mode:r}=this,{toolOptions:a}=t;return i(n,{context:e,fields:[a.isTooltipFieldVisible(`coordinates`)?t.effectiveX:void 0,a.isTooltipFieldVisible(`coordinates`)?t.effectiveY:void 0,a.isTooltipFieldVisible(`elevation`)?t.elevation:void 0,a.isTooltipFieldVisible(`area`)&&t.geometryType===`polygon`?t.area:null,a.isTooltipFieldVisible(`totalLength`)&&t.geometryType===`polyline`?t.totalLength:null],mode:r})}};a=e([t(`esri.views.interactive.tooltip.content.TooltipContentSelectedVertex`)],a);export{a as TooltipContentSelectedVertex};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{Fields as n}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let a=class extends r{_renderContent(){let{fieldContext:e,info:t,mode:r}=this,{
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{Fields as n}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let a=class extends r{_renderContent(){let{fieldContext:e,info:t,mode:r}=this,{toolOptions:a}=t;return i(n,{context:e,fields:[a.isTooltipFieldVisible(`coordinates`)?t.effectiveX:void 0,a.isTooltipFieldVisible(`coordinates`)?t.effectiveY:void 0,a.isTooltipFieldVisible(`elevation`)?t.elevation:void 0,a.isTooltipFieldVisible(`orientation`)?t.orientation:void 0,a.isTooltipFieldVisible(`scale`)?t.scale:void 0],mode:r})}};a=e([t(`esri.views.interactive.tooltip.content.TooltipContentTransformMesh`)],a);export{a as TooltipContentTransformMesh};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{Fields as n}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let a=class extends r{_renderContent(){let{fieldContext:e,info:t,mode:r}=this,{
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{Fields as n}from"./Fields.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i}from"../../../../widgets/support/widget.js";let a=class extends r{_renderContent(){let{fieldContext:e,info:t,mode:r}=this,{toolOptions:a}=t;return i(n,{context:e,fields:[a.isTooltipFieldVisible(`coordinates`)?t.effectiveX:void 0,a.isTooltipFieldVisible(`coordinates`)?t.effectiveY:void 0,a.isTooltipFieldVisible(`elevation`)?t.elevation:void 0,a.isTooltipFieldVisible(`orientation`)?t.orientation:void 0,a.isTooltipFieldVisible(`size`)?t.size:void 0],mode:r})}};a=e([t(`esri.views.interactive.tooltip.content.TooltipContentTransformPoint`)],a);export{a as TooltipContentTransformPoint};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i,tsxFragment as a}from"../../../../widgets/support/widget.js";let o=class extends r{_renderContent(){let{info:e}=this,{
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i,tsxFragment as a}from"../../../../widgets/support/widget.js";let o=class extends r{_renderContent(){let{info:e}=this,{toolOptions:t}=e,r=this._messagesTooltip.sketch,o=this._formatters;return i(a,null,t.isTooltipFieldVisible(`distance`)?i(n,{title:r.distance,value:o.length(e.distance)}):null)}};o=e([t(`esri.views.interactive.tooltip.content.TooltipContentTranslate`)],o);export{o as TooltipContentTranslate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i,tsxFragment as a}from"../../../../widgets/support/widget.js";let o=class extends r{_renderContent(){let{distance:e,elevation:t,area:r,totalLength:o,
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i,tsxFragment as a}from"../../../../widgets/support/widget.js";let o=class extends r{_renderContent(){let{distance:e,elevation:t,area:r,totalLength:o,toolOptions:s}=this.info,c=this._messagesTooltip.sketch,l=this._formatters;return i(a,null,s.isTooltipFieldVisible(`distance`)?i(n,{title:c.distance,value:l.length(e)}):null,s.isTooltipFieldVisible(`elevation`)&&t?.actual!=null?i(n,{title:c.elevation,value:l.verticalLength(t.actual)}):null,s.isTooltipFieldVisible(`area`)&&r!=null?i(n,{title:c.area,value:l.area(r)}):null,s.isTooltipFieldVisible(`totalLength`)&&o!=null?i(n,{title:c.totalLength,value:l.length(o)}):null)}};o=e([t(`esri.views.interactive.tooltip.content.TooltipContentTranslateVertex`)],o);export{o as TooltipContentTranslateVertex};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i,tsxFragment as a}from"../../../../widgets/support/widget.js";let o=class extends r{_renderContent(){let{info:e}=this,{
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i,tsxFragment as a}from"../../../../widgets/support/widget.js";let o=class extends r{_renderContent(){let{info:e}=this,{toolOptions:t}=e,r=this._messagesTooltip.sketch,o=this._formatters;return i(a,null,t.isTooltipFieldVisible(`distance`)?i(n,{title:r.distance,value:o.length(e.distance)}):null)}};o=e([t(`esri.views.interactive.tooltip.content.TooltipContentTranslateXY`)],o);export{o as TooltipContentTranslateXY};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i,tsxFragment as a}from"../../../../widgets/support/widget.js";let o=class extends r{_renderContent(){let{info:e}=this,{
|
|
2
|
+
import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{TooltipField as n}from"../components/TooltipField.js";import{TooltipContent as r}from"./TooltipContent.js";import{tsx as i,tsxFragment as a}from"../../../../widgets/support/widget.js";let o=class extends r{_renderContent(){let{info:e}=this,{toolOptions:t}=e,r=this._messagesTooltip.sketch;return i(a,null,t.isTooltipFieldVisible(`distance`)?i(n,{title:r.distance,value:this._formatters.verticalLengthRelative(e.distance)}):null)}};o=e([t(`esri.views.interactive.tooltip.content.TooltipContentTranslateZ`)],o);export{o as TooltipContentTranslateZ};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{generateUUID as n}from"../../../../core/uuid.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";let a=class extends t{constructor(e){super(e),this.actual=null,this.lockable=!0,this.id=n(),this.inputValue=null,this.name=null,this.readOnly=!1,this.suffix=null,this.visible=!0,this.invalid=!1,this.unlockOnVertexPlacement=!0,this.displayOrder=0}get committed(){return this.lockable?this._get(`committed`):null}set committed(e){this.lockable&&this._set(`committed`,e)}get dirty(){return this.inputValue!=null}get lockDisabled(){return this.actual==null&&!this.dirty&&!this.locked}get locked(){return this.lockable&&this.committed!=null}onInput(e){this.inputValue=e,this.invalid=!1}onCommit(e,t,n){this.lockable?this._onCommitLockable(e,n):this._onCommitNonLockable(n),this.invalid&&e===`commit-and-exit`||n.onCommit(t,e)}_onCommitLockable(e,t){let{inputValue:n,locked:r}=this;r&&o(n)?this.unlock():(e===`commit-and-exit`&&!r||n!=null)&&this._parseInputAndLock(t)}_onCommitNonLockable(e){let{inputValue:t}=this;o(t)?this.lockable?this.setActual(null):this.clearInputValue():t!=null&&this._parseInputAndSetActual(e)}applyValue(e){this.lockable?this.lock(e):this.setActual(e)}clearInputValue(){this.inputValue=null,this.invalid=!1}setActual(e){this.actual=e,this.clearInputValue()}lock(e){this.lockable&&(this.committed=e??this.actual,this.clearInputValue())}unlock(){this.lockable&&(this.committed=null,this.clearInputValue())}toggleLock(e){this.lockable&&(this.locked?this.unlock():this._parseInputAndLock(e))}getSuffix(e){let{suffix:t}=this;return typeof t==`function`?t(e):t}getFormattedValue(e){let{actual:t,committed:n,format:r}=this;return n==null?t==null?null:r(t,e):r(n,e)}getRawDisplayValue(e){let{actual:t,committed:n,inputValue:r}=this;return r??(this.lockable&&n!=null?this.formatForInputMode(n,e):t==null?null:this.formatForInputMode(t,e))}_parseInputAndSetActual(e){let{inputValue:t}=this;if(t==null||o(t))return this.setActual(null);let n=this.parse(t,e);n==null?this.invalid=!0:this.setActual(n)}_parseInputAndLock(e){let{inputValue:t,actual:n}=this;if(o(t))return this.unlock();if(t==null)return this.lock(n);let r=this.parse(t,e);r==null?this.invalid=!0:this.lock(r)}};e([r()],a.prototype,`actual`,void 0),e([r()],a.prototype,`committed`,null),e([r()],a.prototype,`dirty`,null),e([r()],a.prototype,`lockDisabled`,null),e([r()],a.prototype,`format`,void 0),e([r()],a.prototype,`formatForInputMode`,void 0),e([r()],a.prototype,`lockable`,void 0),e([r()],a.prototype,`locked`,null),e([r()],a.prototype,`id`,void 0),e([r()],a.prototype,`inputValue`,void 0),e([r()],a.prototype,`name`,void 0),e([r()],a.prototype,`parse`,void 0),e([r()],a.prototype,`readOnly`,void 0),e([r()],a.prototype,`suffix`,void 0),e([r()],a.prototype,`title`,void 0),e([r()],a.prototype,`visible`,void 0),e([r()],a.prototype,`invalid`,void 0),e([r()],a.prototype,`unlockOnVertexPlacement`,void 0),e([r()],a.prototype,`displayOrder`,void 0),a=e([i(`esri.views.interactive.tooltip.fields.TooltipField`)],a);function o(e){return e!=null&&e.trim()===``}export{a as TooltipField};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{generateUUID as n}from"../../../../core/uuid.js";import{property as r,subclass as i}from"../../../../core/accessorSupport/decorators.js";let a=class extends t{constructor(e){super(e),this.actual=null,this.lockable=!0,this.id=n(),this.inputValue=null,this.name=null,this.readOnly=!1,this.suffix=null,this.visible=!0,this.invalid=!1,this.unlockOnVertexPlacement=!0,this.displayOrder=0}get committed(){return this.lockable?this._get(`committed`):null}set committed(e){this.lockable&&this._set(`committed`,e)}get dirty(){return this.inputValue!=null}get lockDisabled(){return this.actual==null&&!this.dirty&&!this.locked}get locked(){return this.lockable&&this.committed!=null}onInput(e){this.inputValue=e,this.invalid=!1}onCommit(e,t,n){n.toolOptions.isTooltipFieldVisible(this.name)?(this.lockable?this._onCommitLockable(e,n):this._onCommitNonLockable(n),this.invalid&&e===`commit-and-exit`||n.onCommit(t,e)):this.clearInputValue()}_onCommitLockable(e,t){let{inputValue:n,locked:r}=this;r&&o(n)?this.unlock():(e===`commit-and-exit`&&!r||n!=null)&&this._parseInputAndLock(t)}_onCommitNonLockable(e){let{inputValue:t}=this;o(t)?this.lockable?this.setActual(null):this.clearInputValue():t!=null&&this._parseInputAndSetActual(e)}applyValue(e){this.lockable?this.lock(e):this.setActual(e)}clearInputValue(){this.inputValue=null,this.invalid=!1}setActual(e){this.actual=e,this.clearInputValue()}lock(e){this.lockable&&(this.committed=e??this.actual,this.clearInputValue())}unlock(){this.lockable&&(this.committed=null,this.clearInputValue())}toggleLock(e){this.lockable&&(this.locked?this.unlock():this._parseInputAndLock(e))}getSuffix(e){let{suffix:t}=this;return typeof t==`function`?t(e):t}getFormattedValue(e){let{actual:t,committed:n,format:r}=this;return n==null?t==null?null:r(t,e):r(n,e)}getRawDisplayValue(e){let{actual:t,committed:n,inputValue:r}=this;return r??(this.lockable&&n!=null?this.formatForInputMode(n,e):t==null?null:this.formatForInputMode(t,e))}_parseInputAndSetActual(e){let{inputValue:t}=this;if(t==null||o(t))return this.setActual(null);let n=this.parse(t,e);n==null?this.invalid=!0:this.setActual(n)}_parseInputAndLock(e){let{inputValue:t,actual:n}=this;if(o(t))return this.unlock();if(t==null)return this.lock(n);let r=this.parse(t,e);r==null?this.invalid=!0:this.lock(r)}};e([r()],a.prototype,`actual`,void 0),e([r()],a.prototype,`committed`,null),e([r()],a.prototype,`dirty`,null),e([r()],a.prototype,`lockDisabled`,null),e([r()],a.prototype,`format`,void 0),e([r()],a.prototype,`formatForInputMode`,void 0),e([r()],a.prototype,`lockable`,void 0),e([r()],a.prototype,`locked`,null),e([r()],a.prototype,`id`,void 0),e([r()],a.prototype,`inputValue`,void 0),e([r()],a.prototype,`name`,void 0),e([r()],a.prototype,`parse`,void 0),e([r()],a.prototype,`readOnly`,void 0),e([r()],a.prototype,`suffix`,void 0),e([r()],a.prototype,`title`,void 0),e([r()],a.prototype,`visible`,void 0),e([r()],a.prototype,`invalid`,void 0),e([r()],a.prototype,`unlockOnVertexPlacement`,void 0),e([r()],a.prototype,`displayOrder`,void 0),a=e([i(`esri.views.interactive.tooltip.fields.TooltipField`)],a);function o(e){return e!=null&&e.trim()===``}export{a as TooltipField};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{SketchTooltipInfo as i}from"./SketchTooltipInfo.js";let a=class extends i{constructor(e){super(e),this.type=`dynamic`,this.renderContext=null,this.helpMessage=void 0,this._isVisibleField=e=>
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as t}from"../../../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{SketchTooltipInfo as i}from"./SketchTooltipInfo.js";let a=class extends i{constructor(e){super(e),this.type=`dynamic`,this.renderContext=null,this.helpMessage=void 0,this._isVisibleField=e=>e.visible&&this.toolOptions.isTooltipFieldVisible(e.name)}initialize(){this.addHandles(t(()=>this.getHelpMessageKey?.(),e=>this.helpMessage=e??void 0))}get availableFields(){return this.getAllFields?.()?.map(e=>e.field)??[]}get availableFieldsForCurrentHandle(){let e=this.getAllFields?.(),t=this.getActiveHandle?.();return l(e??[],t)}get allManagedFields(){let{availableFieldsForCurrentHandle:e}=this,t=this.getActiveHandle?.(),n=this._getXyMode(t);return(this._useCoordinateDisplay(t,n)?e.filter(e=>s(e.field)):this._useDirectionDistanceDisplay(t,n)?e.filter(e=>c(e.field)):e).filter(({field:e})=>this._isVisibleField(e)).sort((e,t)=>o(e.field,t.field))}get fieldsGroupedForDisplay(){let e=this.allManagedFields,t=new Map,n=[];for(let n of e){let e=n.displayGroup;t.has(e)||t.set(e,[]),t.get(e)?.push(n)}for(let[e,r]of t.entries())if(r.length!==2||!e)n.push(...r.map(e=>e.field));else{let e=r.toSorted((e,t)=>o(e.field,t.field));n.push({left:e[0].field,right:e[1].field})}return n}get xyMode(){return this._getXyMode(this.getActiveHandle?.())}get allFields(){return this.allManagedFields.map(e=>e.field)}getConstraintFieldsForHandle(e){let t=this.getAllFields?.(),n=this._getXyMode(e),r=l(t??[],e).map(e=>e.field).filter(u);return(this._useCoordinateDisplay(e,n)?r.filter(s):this._useDirectionDistanceDisplay(e,n)?r.filter(c):r).filter(this._isVisibleField)}getConstraintFieldByName(e,t){return this.getConstraintFieldsForHandle(e).find(e=>e.name===t)}isEffectiveVisibleField(e){let{allFields:t,renderContext:n}=this;return e.visible&&!!n&&t.includes(e)}_getXyMode(e){let t=this.toolOptions.tooltips.xyMode,n=e?.editSession?.endVertex?.leftSegment?.leftVertex&&e?.role===`primary`?`direction-distance`:`coordinates`;return t===`auto`?n:t}_useCoordinateDisplay(e,t){let{availableFields:n}=this;return(t===`coordinates`||e?.role===`secondary`)&&n.some(e=>e.name===`x`)&&n.some(e=>e.name===`y`)}_useDirectionDistanceDisplay(e,t){let{availableFields:n}=this;return t===`direction-distance`&&e?.role===`primary`&&n.some(e=>e.name===`distance`)&&n.some(e=>e.name===`direction`)}};e([n()],a.prototype,`type`,void 0),e([n()],a.prototype,`getAllFields`,void 0),e([n()],a.prototype,`getActiveHandle`,void 0),e([n()],a.prototype,`getHelpMessageKey`,void 0),e([n()],a.prototype,`availableFields`,null),e([n()],a.prototype,`availableFieldsForCurrentHandle`,null),e([n()],a.prototype,`allManagedFields`,null),e([n()],a.prototype,`fieldsGroupedForDisplay`,null),e([n()],a.prototype,`xyMode`,null),e([n()],a.prototype,`allFields`,null),e([n()],a.prototype,`renderContext`,void 0),e([n()],a.prototype,`helpMessage`,void 0),a=e([r(`esri.views.interactive.tooltip.infos.DynamicTooltipInfo`)],a);function o(e,t){return e.displayOrder-t.displayOrder}function s(e){return e.name!==`direction`&&e.name!==`distance`}function c(e){return e.name!==`x`&&e.name!==`y`}function l(e,t){let{name:n,role:r}=t??{};return e?.filter(e=>(e.appliesToHandlesWithName==null||e.appliesToHandlesWithName===n)&&(e.appliesToHandlesWithRole==null||e.appliesToHandlesWithRole===r))??[]}function u(e){switch(e.name){case`direction`:case`distance`:case`elevation`:case`x`:case`y`:return!0;default:return!1}}export{a as DynamicTooltipInfo,l as filterFieldsForHandle,u as isKnownConstraintField};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";let i=class extends t{constructor(e){super(e),this.helpMessage=void 0,this.viewType=void 0,this.elevationModeContext=null}get
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";let i=class extends t{constructor(e){super(e),this.helpMessage=void 0,this.viewType=void 0,this.elevationModeContext=null}get allFields(){return[]}get editableFields(){return this.allFields.filter(({visible:e,readOnly:t,name:n})=>e&&!t&&this.toolOptions.isTooltipFieldVisible(n))}get inputModeAvailable(){return this.toolOptions.tooltips.inputEnabled&&this.editableFields.some(e=>{let{name:t}=e;return(t===`x`||t===`y`)&&`effectiveX`in this&&`effectiveY`in this?e===this.effectiveX||e===this.effectiveY:!0})}clearInputValues(){this.allFields.forEach(e=>e.clearInputValue())}};e([n()],i.prototype,`toolOptions`,void 0),e([n()],i.prototype,`helpMessage`,void 0),e([n()],i.prototype,`viewType`,void 0),e([n()],i.prototype,`elevationModeContext`,void 0),e([n()],i.prototype,`allFields`,null),e([n()],i.prototype,`editableFields`,null),e([n()],i.prototype,`inputModeAvailable`,null),i=e([r(`esri.views.interactive.tooltip.infos.SketchTooltipInfo`)],i);export{i as SketchTooltipInfo};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{createTask as e}from"../../../core/asyncUtils.js";import{handlesGroup as t,makeHandle as n}from"../../../core/handleUtils.js";import{floatEqualUlp as r}from"../../../core/mathUtils.js";import{createAngle as i,createScalar as a,valueInUnit as o}from"../../../core/quantity.js";import{watch as s}from"../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as c}from"../../../core/units.js";import{scale as l,equals as u,negate as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as f,ONES as p,create as m,UNIT_Z as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as g,load as _}from"../../../geometry/coordinateFormatter.js";import v from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as y}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as x}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as S}from"../keybindings.js";import C from"../Tooltip.js";import{parseLatitudeLongitude as w,parseXY as T}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as E,getDegreesGeographic as D}from"../../support/angularMeasurementUtils.js";function O(e){let t=new C(e());return t.addHandles(s(()=>e(),({view:e,options:n,info:r})=>{t.view=e,n!==void 0&&(t.options=n),r!==void 0&&(t.info=r)})),t}function k(e,t){let n=y(t.vertexSpace),{scale:r,orientation:o}=e,{transform:s}=t,c=I(s);n&&c!=null?(o.actual=i(c,`degrees`,`arithmetic`),o.visible=!0):(o.actual=null,o.visible=!1),n?(r.actual=a(z(s)),r.visible=!0):(r.actual=null,r.visible=!1)}function A(e,t,n){if(!t||!y(t.vertexSpace))return;let r=t.transform??=new v;j(e,r,n),M(e,r,n)}function j(e,t,n){let i=E(e.orientation.actual),a=L(t.rotationAxis);if(i==null||a==null)return;let o=i-90,s=t.rotationAngle,c=o*a,l=c-s;r(s,c)||(n?.onRotateStart(0),t.rotationAngle=c,n?.onRotate(l),n?.onRotateStop(l))}function M(e,t,n){let r=e.scale.actual?.value,i=z(t);if(r==null||r===i)return;let{scale:a}=t,o;if(i===0)o=f(p);else{let e=r/i;o=l(m(),a,e)}n?.onScaleStart(a[0],a[1],a[2]),t.scale=o,n?.onScale(o[0],o[1],o[2]),n?.onScaleStop(o[0],o[1],o[2])}function N(e,t){let{x:n,y:i,z:a}=t,{x:o,y:s,z:c}=P(e,t.spatialReference);return{dx:o!=null&&!r(o,n)?o-n:0,dy:s!=null&&!r(s,i)?s-i:0,dz:c!=null&&a!=null&&!r(c,a)?c-a:0}}function P(e,t){let n,r;e.geographic?(n=D(e.longitude.actual),r=D(e.latitude.actual),b(t)&&(n!=null&&r!=null?[n,r]=x(n,r,F):n==null?r!=null&&(r=x(0,r,F)[1]):n=x(n,0,F)[0])):(n=e.x.actual?.value,r=e.y.actual?.value);let i=e.elevation.actual,a=c(t),s=a!=null&&i!=null?o(i,a):void 0;return{x:n,y:r,z:s}}const F=[0,0];function I(e){if(!e)return 90;let t=L(e.rotationAxis)??1;return t==null?null:90+t*e.rotationAngle}function L(e){return u(e,h)?1:u(e,R)?-1:null}const R=d(m(),h);function z(e){return e?Math.max(...e.scale):1}function B(e,t){return e.type===`key-down`&&e.key===S.enterInputMode&&t&&V(t.info)?(t.enterInputMode(),e.preventDefault(),e.stopPropagation(),!0):!1}function V(e){
|
|
2
|
+
import{createTask as e}from"../../../core/asyncUtils.js";import{handlesGroup as t,makeHandle as n}from"../../../core/handleUtils.js";import{floatEqualUlp as r}from"../../../core/mathUtils.js";import{createAngle as i,createScalar as a,valueInUnit as o}from"../../../core/quantity.js";import{watch as s}from"../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as c}from"../../../core/units.js";import{scale as l,equals as u,negate as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{clone as f,ONES as p,create as m,UNIT_Z as h}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as g,load as _}from"../../../geometry/coordinateFormatter.js";import v from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as y}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as x}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as S}from"../keybindings.js";import C from"../Tooltip.js";import{parseLatitudeLongitude as w,parseXY as T}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as E,getDegreesGeographic as D}from"../../support/angularMeasurementUtils.js";function O(e){let t=new C(e());return t.addHandles(s(()=>e(),({view:e,options:n,info:r})=>{t.view=e,n!==void 0&&(t.options=n),r!==void 0&&(t.info=r)})),t}function k(e,t){let n=y(t.vertexSpace),{scale:r,orientation:o}=e,{transform:s}=t,c=I(s);n&&c!=null?(o.actual=i(c,`degrees`,`arithmetic`),o.visible=!0):(o.actual=null,o.visible=!1),n?(r.actual=a(z(s)),r.visible=!0):(r.actual=null,r.visible=!1)}function A(e,t,n){if(!t||!y(t.vertexSpace))return;let r=t.transform??=new v;j(e,r,n),M(e,r,n)}function j(e,t,n){let i=E(e.orientation.actual),a=L(t.rotationAxis);if(i==null||a==null)return;let o=i-90,s=t.rotationAngle,c=o*a,l=c-s;r(s,c)||(n?.onRotateStart(0),t.rotationAngle=c,n?.onRotate(l),n?.onRotateStop(l))}function M(e,t,n){let r=e.scale.actual?.value,i=z(t);if(r==null||r===i)return;let{scale:a}=t,o;if(i===0)o=f(p);else{let e=r/i;o=l(m(),a,e)}n?.onScaleStart(a[0],a[1],a[2]),t.scale=o,n?.onScale(o[0],o[1],o[2]),n?.onScaleStop(o[0],o[1],o[2])}function N(e,t){let{x:n,y:i,z:a}=t,{x:o,y:s,z:c}=P(e,t.spatialReference);return{dx:o!=null&&!r(o,n)?o-n:0,dy:s!=null&&!r(s,i)?s-i:0,dz:c!=null&&a!=null&&!r(c,a)?c-a:0}}function P(e,t){let n,r;e.geographic?(n=D(e.longitude.actual),r=D(e.latitude.actual),b(t)&&(n!=null&&r!=null?[n,r]=x(n,r,F):n==null?r!=null&&(r=x(0,r,F)[1]):n=x(n,0,F)[0])):(n=e.x.actual?.value,r=e.y.actual?.value);let i=e.elevation.actual,a=c(t),s=a!=null&&i!=null?o(i,a):void 0;return{x:n,y:r,z:s}}const F=[0,0];function I(e){if(!e)return 90;let t=L(e.rotationAxis)??1;return t==null?null:90+t*e.rotationAngle}function L(e){return u(e,h)?1:u(e,R)?-1:null}const R=d(m(),h);function z(e){return e?Math.max(...e.scale):1}function B(e,t){return e.type===`key-down`&&e.key===S.enterInputMode&&t&&V(t.info)?(t.enterInputMode(),e.preventDefault(),e.stopPropagation(),!0):!1}function V(e){return e?.inputModeAvailable===!0}function H(r,i){let a=null;return t([r.on(`paste`,t=>{a?.abort(),a=e(async()=>{g()||await _(),U(t,r.info,i)})}),e(()=>_()),n(()=>a?.abort())])}function U(e,t,n){if(!t||!(`geographic`in t)||!t.toolOptions.isTooltipFieldVisible(`coordinates`))return;let r=e.clipboardData?.getData(`text`);if(!r)return;let i=t=>{e.stopPropagation(),e.preventDefault(),n?.onBeforePaste(),t(),n?.onAfterPaste()};if(t.geographic){let e=w(r);e&&i(()=>{t.longitude.applyValue(e.longitude),t.latitude.applyValue(e.latitude)})}else{let e=T(r);e&&i(()=>{t.x.applyValue(e.x),t.y.applyValue(e.y)})}}export{H as connectPasteEvent,B as enterInputModeIfAvailable,N as getXYZDeltasFromTooltipInfo,V as isInputModeAvailable,O as makeTooltip,U as pasteLocation,A as updateMeshTransformFromTooltipInfo,k as updateTooltipInfoFromMeshTransform};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type Accessor from "../../core/Accessor.js";
|
|
2
2
|
import type MapView from "../../views/MapView.js";
|
|
3
|
-
import type SnappingOptions from "../../views/interactive/
|
|
3
|
+
import type SnappingOptions from "../../views/interactive/options/SnappingOptions.js";
|
|
4
4
|
import type { SystemOrAreaUnit } from "../../core/units.js";
|
|
5
5
|
import type { AreaMeasurement, AreaMeasurementLabel, MeasurementState } from "../types.js";
|
|
6
|
-
import type { SnappingOptionsProperties } from "../../views/interactive/
|
|
6
|
+
import type { SnappingOptionsProperties } from "../../views/interactive/options/SnappingOptions.js";
|
|
7
7
|
|
|
8
8
|
/** @deprecated since 5.2. Use the [Area Measurement 2D component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-area-measurement-2d/) directly or [AreaMeasurementAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/AreaMeasurementAnalysis/) instead. */
|
|
9
9
|
export interface AreaMeasurement2DViewModelProperties extends Partial<Pick<AreaMeasurement2DViewModel, "view">> {
|
|
10
10
|
/**
|
|
11
|
-
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
12
|
-
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
13
|
-
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
11
|
+
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/) for sketching.
|
|
12
|
+
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#selfEnabled) and
|
|
13
|
+
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#featureEnabled) snapping.
|
|
14
14
|
*
|
|
15
15
|
* @since 4.32
|
|
16
16
|
*/
|
|
@@ -105,9 +105,9 @@ export default class AreaMeasurement2DViewModel extends Accessor {
|
|
|
105
105
|
*/
|
|
106
106
|
get measurementLabel(): AreaMeasurementLabel | null | undefined;
|
|
107
107
|
/**
|
|
108
|
-
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
109
|
-
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
110
|
-
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
108
|
+
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/) for sketching.
|
|
109
|
+
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#selfEnabled) and
|
|
110
|
+
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#featureEnabled) snapping.
|
|
111
111
|
*
|
|
112
112
|
* @since 4.32
|
|
113
113
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as a,initial as o,syncAndInitial as s,whenOnce as c}from"../../core/reactiveUtils.js";import{measurementAreaUnits as l}from"../../core/units.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{defaultUnitPropertyMetadata as f}from"../../properties/defaultUnit.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as a,initial as o,syncAndInitial as s,whenOnce as c}from"../../core/reactiveUtils.js";import{measurementAreaUnits as l}from"../../core/units.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{defaultUnitPropertyMetadata as f}from"../../properties/defaultUnit.js";import p from"../../views/interactive/options/SnappingOptions.js";import{SnappingManager as m}from"../../views/interactive/snapping/SnappingManager.js";import{isSupported as h,loadGeometryOperators as g,AreaMeasurement2DTool as _}from"./AreaMeasurement2DTool.js";import{InteractiveToolViewModelMixin as v}from"../support/InteractiveToolViewModelMixin.js";let y=class extends v(t){constructor(e){let{suppressDeprecationWarning:t,...i}=e??{};super(i),this.supportedViewType=`2d`,this.unsupportedErrorMessage=`AreaMeasurement2DViewModel is only supported in 2D views.`,this._snappingManager=null,this.snappingOptions=new p,t||n(r.getLogger(this),`Area Measurement 2D`,`arcgis-area-measurement-2d`,{version:`5.2`})}initialize(){this.addHandles([a(()=>this.view?.spatialReference,()=>this.clear()),a(()=>this.unit,e=>{this.tool!=null&&(this.tool.unit=e)},o),a(()=>this.view,e=>{this._snappingManager=i(this._snappingManager),e&&(this._snappingManager=new m({view:e,options:this.snappingOptions}))},s),a(()=>this.snappingOptions,e=>{this._snappingManager&&e&&(this._snappingManager.options=e)})])}destroy(){this._snappingManager=i(this._snappingManager)}get measurement(){return this.tool?.measurement??null}get measurementLabel(){return this.tool?.measurementLabel??null}get state(){return this.disabled||this.view==null||!h(this.view.spatialReference)?`disabled`:this.tool?.measurement?this.tool.active?`measuring`:`measured`:`ready`}get unit(){return this._validateUnit(this.defaultUnit)}set unit(e){this._overrideIfSome(`unit`,this._validateUnit(e))}get unitOptions(){return l}set unitOptions(e){this._overrideIfSome(`unitOptions`,this._validateUnits(e))}get view(){return super.view}set view(e){super.view=e}async start(){let{view:e}=this;e&&(await c(()=>e.ready),await g(e.spatialReference)),this.createTool({interactive:!0})}clear(){this.removeTool()}constructTool(){return new _({snappingManager:this._snappingManager,unit:this.unit,view:this.view,visible:this.visible})}_validateUnit(e){let{unitOptions:t,defaultUnit:n}=this;return e!=null&&t.includes(e)?e:t.includes(n)?n:t.length>0?t[0]:n}_validateUnits(e){if(e==null)return[];let t=e.filter(e=>l.includes(e));return t.length===0?l.slice():t}};e([u()],y.prototype,`_snappingManager`,void 0),e([u(f)],y.prototype,`defaultUnit`,void 0),e([u({readOnly:!0})],y.prototype,`measurement`,null),e([u({readOnly:!0})],y.prototype,`measurementLabel`,null),e([u({type:p,nonNullable:!0})],y.prototype,`snappingOptions`,void 0),e([u({readOnly:!0})],y.prototype,`state`,null),e([u({type:String})],y.prototype,`unit`,null),e([u({type:[String]})],y.prototype,`unitOptions`,null),y=e([d(`esri.widgets.AreaMeasurement2D.AreaMeasurement2DViewModel`)],y);const b=y;export{b as default};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type MapView from "../views/MapView.js";
|
|
2
|
-
import type SnappingOptions from "../views/interactive/
|
|
2
|
+
import type SnappingOptions from "../views/interactive/options/SnappingOptions.js";
|
|
3
3
|
import type Widget from "./Widget.js";
|
|
4
4
|
import type AreaMeasurement2DViewModel from "./AreaMeasurement2D/AreaMeasurement2DViewModel.js";
|
|
5
5
|
import type { Icon } from "@esri/calcite-components/components/calcite-icon";
|
|
6
6
|
import type { SystemOrAreaUnit } from "../core/units.js";
|
|
7
7
|
import type { WidgetProperties } from "./Widget.js";
|
|
8
|
-
import type { SnappingOptionsProperties } from "../views/interactive/
|
|
8
|
+
import type { SnappingOptionsProperties } from "../views/interactive/options/SnappingOptions.js";
|
|
9
9
|
import type { AreaMeasurement2DViewModelProperties } from "./AreaMeasurement2D/AreaMeasurement2DViewModel.js";
|
|
10
10
|
|
|
11
11
|
export interface AreaMeasurement2DProperties extends WidgetProperties, Partial<Pick<AreaMeasurement2D, "view">> {
|
|
@@ -26,9 +26,9 @@ export interface AreaMeasurement2DProperties extends WidgetProperties, Partial<P
|
|
|
26
26
|
*/
|
|
27
27
|
label?: string | null;
|
|
28
28
|
/**
|
|
29
|
-
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
30
|
-
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
31
|
-
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
29
|
+
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/) for sketching.
|
|
30
|
+
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#selfEnabled) and
|
|
31
|
+
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#featureEnabled) snapping.
|
|
32
32
|
*
|
|
33
33
|
* @since 4.32
|
|
34
34
|
*/
|
|
@@ -147,9 +147,9 @@ export default class AreaMeasurement2D extends Widget<AreaMeasurement2DPropertie
|
|
|
147
147
|
get label(): string;
|
|
148
148
|
set label(value: string | null | undefined);
|
|
149
149
|
/**
|
|
150
|
-
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
151
|
-
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
152
|
-
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
150
|
+
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/) for sketching.
|
|
151
|
+
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#selfEnabled) and
|
|
152
|
+
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#featureEnabled) snapping.
|
|
153
153
|
*
|
|
154
154
|
* @since 4.32
|
|
155
155
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import n from"../core/Logger.js";import{ignoreAbortErrors as r}from"../core/promiseUtils.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import o from"../views/interactive/
|
|
2
|
+
import{__decorate as e}from"tslib";import{deprecateWidget as t}from"../core/deprecate.js";import n from"../core/Logger.js";import{ignoreAbortErrors as r}from"../core/promiseUtils.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import o from"../views/interactive/options/SnappingOptions.js";import s from"./Widget.js";import c from"./AreaMeasurement2D/AreaMeasurement2DViewModel.js";import{globalCss as l}from"./support/globalCss.js";import{MeasurementWidgetContent as u}from"./support/MeasurementWidgetContent.js";import{messageBundle as d,tsx as f}from"./support/widget.js";const p=`esri-area-measurement-2d`,m={base:p,newMeasurementButton:`${p}__clear-button`};let h=class extends s{constructor(e){super(e),this.messages=null,this.messagesUnits=null,this.messagesCommon=null,this.viewModel=new c({suppressDeprecationWarning:!0}),t(n.getLogger(this),`Area Measurement 2D`,`arcgis-area-measurement-2d`,{version:`5.0`})}get active(){return this.viewModel.active}get icon(){return`measure-area`}set icon(e){this._overrideIfSome(`icon`,e)}get label(){return this.messages?.widgetLabel??``}set label(e){this._overrideIfSome(`label`,e)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){let{messages:e,messagesCommon:t,messagesUnits:n,unit:i,unitOptions:a,viewModel:o,visible:s}=this,{active:c,measurementLabel:d,state:p,supported:h}=o;return f(`div`,{"aria-label":e.widgetLabel,class:this.classes(m.base,l.widget,l.panel),key:this,role:`region`},s?f(u,{active:c,measurementItems:[{key:`area`,title:n?.measures.area,value:d?.area},{key:`perimeter`,title:e.perimeter,value:d?.perimeter}],messages:{...e,notApplicable:t.notApplicable},newMeasurementButtonClass:m.newMeasurementButton,state:p,supported:h,unit:i,unitOptions:a,onNewMeasurementClick:()=>{r(o.start())},onUnitChange:e=>{this.unit=e}}):null)}};e([i({readOnly:!0})],h.prototype,`active`,null),e([i()],h.prototype,`icon`,null),e([i()],h.prototype,`label`,null),e([i(),d(`esri/widgets/AreaMeasurement2D/t9n/AreaMeasurement2D`)],h.prototype,`messages`,void 0),e([i(),d(`esri/core/t9n/Units`)],h.prototype,`messagesUnits`,void 0),e([i(),d(`esri/t9n/common`)],h.prototype,`messagesCommon`,void 0),e([i({type:o})],h.prototype,`snappingOptions`,null),e([i()],h.prototype,`uiStrings`,void 0),e([i()],h.prototype,`unit`,null),e([i()],h.prototype,`unitOptions`,null),e([i()],h.prototype,`view`,null),e([i({type:c})],h.prototype,`viewModel`,void 0),e([i({type:Boolean})],h.prototype,`visible`,null),h=e([a(`esri.widgets.AreaMeasurement2D`)],h);const g=h;export{g as default};
|
|
@@ -10,6 +10,13 @@ export function getAttachmentFilenameParts(name: string | null | undefined): {
|
|
|
10
10
|
extension: string;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Attachment input types that support the capture input method.
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export type CaptureMediaType = "audio" | "image" | "video";
|
|
19
|
+
|
|
13
20
|
/**
|
|
14
21
|
* @param file - The Blob or File whose duration should be read.
|
|
15
22
|
* @param mediaType - The media element type to create.
|
|
@@ -3,6 +3,7 @@ import type AttachmentInfo from "../../../rest/query/support/AttachmentInfo.js";
|
|
|
3
3
|
import type EditableInput from "./EditableInput.js";
|
|
4
4
|
import type GroupInput from "./GroupInput.js";
|
|
5
5
|
import type { AttachmentInputUnion } from "../../../form/elements/inputs/attachments/types.js";
|
|
6
|
+
import type { CaptureMediaType } from "../attachmentUtils.js";
|
|
6
7
|
import type { AttributeFormSupportedLayerUnion, PendingAttachmentEdits } from "../types.js";
|
|
7
8
|
import type { ArcadeBatchFormCalculationContextInfo } from "../expressions/types.js";
|
|
8
9
|
import type { EditableInputProperties } from "./EditableInput.js";
|
|
@@ -39,6 +40,8 @@ export default class AttachmentElementInput extends EditableInput<any> {
|
|
|
39
40
|
/** @internal */
|
|
40
41
|
get canUploadFiles(): boolean;
|
|
41
42
|
/** @internal */
|
|
43
|
+
get captureMediaType(): CaptureMediaType | null;
|
|
44
|
+
/** @internal */
|
|
42
45
|
get categories(): ReadonlySet<AttachmentTypeCategory>;
|
|
43
46
|
/**
|
|
44
47
|
* The attachments visible on the default page before showing the full attachments list action.
|
|
@@ -67,6 +70,16 @@ export default class AttachmentElementInput extends EditableInput<any> {
|
|
|
67
70
|
/** The group containing the attachment element input. */
|
|
68
71
|
get group(): GroupInput | null;
|
|
69
72
|
/** @internal */
|
|
73
|
+
get hasAttachmentChanges(): boolean;
|
|
74
|
+
/** @internal */
|
|
75
|
+
get hasCaptureInputs(): boolean;
|
|
76
|
+
/** @internal */
|
|
77
|
+
get hasExceededAttachmentLimit(): boolean;
|
|
78
|
+
/** @internal */
|
|
79
|
+
get hasMinimumAttachmentCountNotMet(): boolean;
|
|
80
|
+
/** @internal */
|
|
81
|
+
get hasReachedAttachmentLimit(): boolean;
|
|
82
|
+
/** @internal */
|
|
70
83
|
get hasUnsupportedFileTypeValidationError(): boolean;
|
|
71
84
|
/** The configured attachment input for this element. */
|
|
72
85
|
get input(): AttachmentInputUnion | null | undefined;
|
|
@@ -140,6 +153,11 @@ export default class AttachmentElementInput extends EditableInput<any> {
|
|
|
140
153
|
* @internal
|
|
141
154
|
*/
|
|
142
155
|
getAttachmentPreviewUrl(attachment: AttachmentInfo, thumbnailSize?: number): string | null;
|
|
156
|
+
/**
|
|
157
|
+
* @param attachment - Attachment whose duplicate-name identifier should be resolved.
|
|
158
|
+
* @internal
|
|
159
|
+
*/
|
|
160
|
+
getDuplicateNameIdentifier(attachment: AttachmentInfo): number;
|
|
143
161
|
/**
|
|
144
162
|
* @param key - The validation criterion key to read.
|
|
145
163
|
* @internal
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../request.js";import n from"../../../core/Collection.js";import r from"../../../core/Error.js";import i from"../../../core/Logger.js";import{isAbortError as a}from"../../../core/promiseUtils.js";import o from"../../../core/ReactiveMap.js";import s from"../../../core/ReactiveSet.js";import{generateBracedUUID as c}from"../../../core/uuid.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{getEffectiveLayerCapabilities as d}from"../../../layers/support/layerUtils.js";import f from"../../../rest/query/support/AttachmentInfo.js";import{getAttachmentCategoryForFile as p}from"../../Attachments/support/attachmentUtils.js";import{getAttachmentKey as m,getAttachmentUrl as h,preserveAttachmentFilenameExtension as g,attachmentValidationUtils as _}from"../attachmentUtils.js";import v from"./EditableInput.js";import y from"./SingleFeatureInputAdapter.js";import{visibilityCodeToBoolean as b}from"./support/inputUtils.js";let x=-1;const S=[`maximum-audio-length`,`maximum-file-size`,`maximum-image-size`,`minimum-number-of-files`,`maximum-number-of-files`,`maximum-video-length`];let C=class extends v{constructor(e){super(e),this.attachments=[],this.displayCount=3,this.group=null,this.single=new y({input:this}),this.touched=!1,this.type=`attachment`,this._initialAttachments=[],this._stagedAdds=new n,this._stagedDeletes=new s,this._stagedUpdates=new o,this._failedStagedUpdateHydrations=new s,this._pendingStagedUpdateHydrations=new o,this._temporaryAttachmentUrls=new o,this._validationCriterionStates=new o,this._hasUnsupportedFileTypeValidationError=!1}get allowUserRename(){return this.template.allowUserRename}get addDisabled(){let e=this.maxAttachmentCount,t=this.effectiveAttachmentCount;return!this.editable||e!=null&&t>=e}get effectiveAttachmentCount(){return this._initialAttachments.length-this._stagedDeletes.size+this._stagedAdds.length}get effectiveVisible(){return b(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){let{visibilityCode:e}=this;if(e!==`visible`)return e;let{group:t}=this;if(t==null)return e;let n=t.visibilityCode;return n===`hidden:visibility-expression:all-features`?`hidden:group-visibility-expression:all-features`:n===`hidden:visibility-expression:some-features`?`hidden:group-visibility-expression:some-features`:e}get accept(){let{categories:e}=this;if(!e.size)return;let t=[];return e.has(`image`)&&t.push(`image/*`),e.has(`audio`)&&t.push(`audio/*`),e.has(`video`)&&t.push(`video/*`),e.has(`document`)&&t.push(`text/*`,`application/*`,`model/*`),t.length>0?t.join(`,`):void 0}get categories(){let e=new Set;for(let t of this._nestableInputs)T(e,t.type);return e}get _nestableInputs(){let{input:e}=this;return e==null?[]:e.type===`attachment`?e.inputTypes??[]:[e]}get attachmentKeyword(){return this.template.attachmentKeyword?.trim()}get displayFilename(){return this.template.displayFilename}get allAttachmentsVisibleOnDefaultPage(){return this.defaultPageAttachments.length===this.attachments.length}get canUploadFiles(){let e=this._nestableInputs;return!e.length||e.some(O)}get hasCaptureInputs(){return this._nestableInputs.some(D)}get captureMediaType(){let e=new Set;for(let t of this._nestableInputs)if(D(t))switch(t.type){case`audio`:e.add(`audio`);break;case`video`:e.add(`video`);break;case`image`:case`signature`:e.add(`image`)}return e.size===1?Array.from(e)[0]:null}get isCaptureOnly(){let e=this._nestableInputs;return!!e.length&&e.every(E)}get defaultPageAttachments(){return this.attachments.slice(0,this.displayCount)}get feature(){return this.single.feature}get hasAttachmentChanges(){return this._stagedAdds.length>0||this._stagedUpdates.size>0||this._stagedDeletes.size>0}get hasInvalidAttachmentName(){return this.allowUserRename?this.attachments.some(e=>e.name.trim().length===0):!1}get attachmentCount(){return this.attachments.length}get hasMinimumAttachmentCountNotMet(){let e=this.minAttachmentCount;return e==null||!this.effectiveVisible?!1:this.effectiveAttachmentCount<e&&!this.isCaptureOnly}get hasReachedAttachmentLimit(){let e=this.maxAttachmentCount,t=this.effectiveAttachmentCount;return e!=null&&t===e}get hasExceededAttachmentLimit(){let e=this.maxAttachmentCount;return e==null||!this.effectiveVisible?!1:this.effectiveAttachmentCount>e}get hasPendingAttachmentUpdateData(){return this._pendingStagedUpdateHydrations.size>0}get input(){return this.template.input}get layer(){return this.single.layer}get maxAttachmentCount(){return this.template.maxAttachmentCount}get minAttachmentCount(){return this.template.minAttachmentCount}get supportsResize(){let{layer:e}=this;if(!e)return!1;let t=d(e);return t?`attachment`in t&&!!t.attachment?.supportsResize:!1}get useOriginalFilename(){return this.template.useOriginalFilename}get valid(){return!(this._failedStagedUpdateHydrations.size>0||this.hasInvalidAttachmentName||this.hasExceededAttachmentLimit||this.hasMinimumAttachmentCountNotMet)}get _expressionLayer(){let e=this.layer;if(e){if(e.type===`scene`&&`associatedLayer`in e&&e.associatedLayer!=null)return e.associatedLayer;if(e.type===`feature`)return e}}destroy(){this._clearTemporaryAttachmentUrls()}applyFetchedAttachments(e){for(let t of e)this._normalizeAttachmentName(t);this._initialAttachments=e,this._failedStagedUpdateHydrations.clear(),this._recomputeAttachments()}applyStashedEdits(e){let{adds:t,deletes:n,updates:r}=e;for(let e of t){let t=this._getAttachmentKey(e.info);this._stagedAdds.add({data:e.data,globalId:e.globalId??c(),info:e.info,key:t}),this._setTemporaryAttachmentUrl(t,e.data)}for(let e of r){let t=this._getAttachmentKey(e.info);this._stagedUpdates.set(t,{contentType:e.contentType,data:e.data,info:e.info,key:t,name:e.name,size:k(e)}),this._setTemporaryAttachmentUrl(t,e.data)}for(let e of n){let t=this._getAttachmentKey(e.info);this._stagedDeletes.add(t)}this._recomputeAttachments()}clearAttachmentChanges(){this.clearValidationCriteriaState(),this._clearTemporaryAttachmentUrls(),this._stagedAdds.removeAll(),this._stagedUpdates.clear(),this._stagedDeletes.clear(),this._failedStagedUpdateHydrations.clear(),this._pendingStagedUpdateHydrations.clear(),this._recomputeAttachments()}clearValidationCriteriaState(){this._validationCriterionStates.clear(),this._hasUnsupportedFileTypeValidationError=!1}get hasInvalidValidationCriteria(){for(let e of this._validationCriterionStates.values())if(e===`danger`)return!0;return!1}get hasUnsupportedFileTypeValidationError(){return this._hasUnsupportedFileTypeValidationError}get validationCriterionStates(){return this._validationCriterionStates}getValidationCriterionState(e){return this._validationCriterionStates.get(e)??null}stageAddAttachment(e){if(!this._assertEditable())throw new r(`batch-attribute-form:not-editable`,`Cannot modify attachments when editableExpression is false.`);let{contentType:t,data:n,name:i}=e,a=e.globalId??c(),o=n instanceof Blob?n.size:void 0,s=i.trim(),l=new f({contentType:t??void 0,globalId:a,id:x--,keywords:this.attachmentKeyword??void 0,name:s,size:o});return this._setTemporaryAttachmentUrl(a,n),this._stagedAdds.add({key:a,globalId:a,info:l,data:n}),this._recomputeAttachments(),l}async stageAddAttachments(e,t){if(this.clearValidationCriteriaState(),!this._assertEditable())return[];let n=e.filter(e=>this.isFileAllowed(e));if(this._setUnsupportedFileTypeValidationError(n.length!==e.length),n.length===0)return[];let r=[],i=new Map,a=Date.now(),o={},s=this.effectiveAttachmentCount,c=s+n.length;if(this.minAttachmentCount!=null&&this.minAttachmentCount>0&&this._setValidationCriterionState(o,`minimum-number-of-files`,c>=this.minAttachmentCount?`success`:`danger`),this.maxAttachmentCount!=null){let e=c<=this.maxAttachmentCount;if(this._setValidationCriterionState(o,`maximum-number-of-files`,e?`success`:`danger`),!e)return this._setValidationCriteriaState(o),[]}let l=!0;for(let e=0;e<n.length;e++){let t=n[e];await this._validateAttachmentFile(t,s+e+1,o)||(l=!1)}if(!l)return this._setValidationCriteriaState(o),[];for(let e=0;e<n.length;e++){let o=n[e],s=o instanceof File?o.name:`attachment-${a}_${e+1}`,c=await this._resolveAttachmentFilename(s,t),l=this._makeUniqueFilenameForOperation(i,c);r.push(this.stageAddAttachment({contentType:o.type,data:o,name:l}))}return this._setValidationCriteriaState(o),r}findAttachment(e){if(e)return this.attachments.find(t=>m(t)===e)}getAttachmentEditState(e){let t=this._getAttachmentKey(e),n=(t?this._initialAttachments.find(e=>this._getAttachmentKey(e)===t):void 0)?.name??null,r=t?this._stagedUpdates.get(t):void 0,i=r?.name??e.name??null;return{initialName:n,isDeleted:!!t&&this._stagedDeletes.has(t),isRenamed:i!=null&&n!=null&&i!==n,isReplaced:r?.isReplacement===!0}}getAttachmentPreviewUrl(e,t){let n=this._getAttachmentKey(e);return(n?this._temporaryAttachmentUrls.get(n):void 0)??h({attachment:e,supportsResizeAttachments:this.supportsResize,layer:this.layer,thumbnailSize:t})}async ensureStagedUpdateData(e){let t=this._getAttachmentKey(e);if(!t)return!1;let n=this._stagedUpdates.get(t);if(!n||n.data||this._stagedDeletes.has(t))return this._failedStagedUpdateHydrations.delete(t),!1;let r=this._pendingStagedUpdateHydrations.get(t);if(r)return await r;let i=this._hydrateStagedUpdateData(e);this._pendingStagedUpdateHydrations.set(t,i);try{return await i}finally{this._pendingStagedUpdateHydrations.get(t)===i&&this._pendingStagedUpdateHydrations.delete(t)}}async waitForPendingAttachmentUpdateData(){await Promise.allSettled(Array.from(this._pendingStagedUpdateHydrations.values()))}discardStagedEdits(e){if(!this._assertEditable())return;let t=this._getAttachmentKey(e);if(!t)return;let n=this._stagedAdds.findIndex(e=>e.key===t);n>-1?(this._clearTemporaryAttachmentUrl(t),this._stagedAdds.removeAt(n),this._failedStagedUpdateHydrations.delete(t),this._pendingStagedUpdateHydrations.delete(t),this._recomputeAttachments()):(this._clearTemporaryAttachmentUrl(t),this._stagedDeletes.delete(t),this._clearStagedUpdateTracking(t),this._recomputeAttachments())}isFileAllowed(e){let{categories:t}=this;if(!t.size)return!0;let n=p(e);return n!=null&&t.has(n)}isStagedAttachmentAddition(e){return typeof e.id==`number`&&e.id<0}stageDeleteAttachment(e){if(!this._assertEditable())return;let t=this._getAttachmentKey(e);if(!t)return;let n=this._stagedAdds.findIndex(e=>e.key===t);n>-1?(this._clearTemporaryAttachmentUrl(t),this._stagedAdds.removeAt(n),this._failedStagedUpdateHydrations.delete(t),this._pendingStagedUpdateHydrations.delete(t),this._recomputeAttachments()):(this._clearTemporaryAttachmentUrl(t),this._stagedDeletes.add(t),this._clearStagedUpdateTracking(t),this._recomputeAttachments())}stageRenameAttachment(e,t){if(!this._assertEditable())return;let n=this._getAttachmentKey(e);if(!n)return;let r=this._stagedAdds.find(e=>e.key===n);if(r){let n=g(e.name,t);r.info.name=n,this._recomputeAttachments();return}let i=this._stagedUpdates.get(n),a=this._getInitialAttachment(n)?.name??null,o=e.name.trim().length===0?a??e.name:e.name,s=i?.isReplacement===!0&&a!=null&&t===a,c=g(o,s?A(a).base:t),l=a!=null&&c===a;if(l&&i?.isReplacement!==!0){this._stagedUpdates.delete(n),this._failedStagedUpdateHydrations.delete(n),this._pendingStagedUpdateHydrations.delete(n),this._recomputeAttachments();return}let u={key:n,...i,info:e};l?delete u.name:u.name=c,this._stagedUpdates.set(n,u),this._recomputeAttachments(),this.ensureStagedUpdateData(e)}async stageReplaceAttachment(e,t,n){if(this.clearValidationCriteriaState(),!this._assertEditable())return!1;if(!this.isFileAllowed(t))return this._setUnsupportedFileTypeValidationError(!0),!1;let r={},i=await this._validateAttachmentFile(t,void 0,r);if(this._setValidationCriteriaState(r),!i)return!1;let a=t instanceof File?t.name:e.name,o=await this._resolveAttachmentFilename(a,n);return this._stageReplaceAttachment(e,t,o),!0}toSubmitEdits(){let e=[],t=[],n=[],r=this.feature?.plainGraphic;if(!r||this._stagedAdds.length===0&&this._stagedUpdates.size===0&&this._stagedDeletes.size===0)return null;let i=this.attachmentKeyword;for(let t of this._stagedAdds)t.data!=null&&e.push({feature:r,contentType:t.info.contentType,data:t.data,info:t.info,globalId:t.info.globalId,keywords:i,name:t.info.name});for(let e of this._stagedUpdates.values()){let n=e.name==null||e.name.trim().length>0;if(e.data==null||!n)continue;let a=e.name??this._getInitialAttachment(e.key)?.name??e.info.name;t.push({feature:r,contentType:e.contentType,data:e.data,globalId:e.info.globalId,id:e.info.id,info:e.info,keywords:i,name:a})}for(let e of this._stagedDeletes.values()){let t=this._getInitialAttachment(e);t&&n.push({feature:r,contentType:t.contentType,globalId:t.globalId,id:t.id,info:t,keywords:i,name:t.name})}return e.length===0&&t.length===0&&n.length===0?null:{label:this.template.label,keywords:i,adds:e,deletes:n,updates:t}}touch(){this.touched=!0}_assertEditable(){return this.editable?!0:(i.getLogger(this).error(`batch-attribute-form:not-editable`,`Cannot modify attachments when editableExpression is false.`),!1)}_recomputeAttachments(){let e=Array.from(this._stagedAdds,e=>e.info);for(let t of this._initialAttachments){let n=this._getAttachmentKey(t);if(n&&this._stagedUpdates.has(n)){let r=this._stagedUpdates.get(n),i=t.clone();r.name!=null&&(i.name=r.name),r.contentType!=null&&(i.contentType=r.contentType),r.size!=null&&(i.size=r.size),e.push(i)}else e.push(t)}this.attachments=e}async _computeAttachmentFilename(e,t){let n=this.template.filenameExpressionExecutor;if(!n)return e;let r=this.single.feature,o=r?.plainGraphic,s=this._expressionLayer,{attachmentKeyword:c,description:l,label:u}=this.template,d={$originalfeature:r?.original,$editcontext:{editType:t.editType},$layer:s,$featureset:s,$datastore:s?.url,$feature:o,$map:t.map,$formElement:{attachmentKeyword:c,description:l,label:u}},f={rawOutput:!0,spatialReference:t.spatialReference,timeZone:t.timeZone};try{let t=n.isAsync?await n.executeAsync(d,f):n.execute(d,f);if(typeof t==`string`&&t.trim().length>0){let{extension:n}=A(e);return j(t.trim(),n)}}catch(e){a(e)||i.getLogger(this).error(`Failed evaluating attachment filename expression`,e)}return e}async _resolveAttachmentFilename(e,t){return this.useOriginalFilename===!1?await this._computeAttachmentFilename(e,t):e}_makeUniqueFilenameForOperation(e,t){let n=t.toLowerCase(),r=e.get(n)??0;if(e.set(n,r+1),r===0)return t;let{base:i,extension:a}=A(t);return j(`${i}_${r}`,a)}_setValidationCriteriaState(e){this._validationCriterionStates.clear();for(let t of S){let n=e[t];n&&this._validationCriterionStates.set(t,n)}}_setUnsupportedFileTypeValidationError(e){this._hasUnsupportedFileTypeValidationError!==e&&(this._hasUnsupportedFileTypeValidationError=e)}_setValidationCriterionState(e,t,n){e[t]!==`danger`&&(e[t]=n)}async _validateAttachmentFile(e,t,n){let r=!0,i=p(e);for(let t of this._nestableInputs){let a=_.getAttachmentCategoryForInputType(t.type);if(i==null||a===i){if(t.type===`document`&&t.maxFileSize!=null){let i=e.size<=t.maxFileSize*1048576;this._setValidationCriterionState(n,`maximum-file-size`,i?`success`:`danger`),r&&=i}if((t.type===`audio`||t.type===`video`)&&t.maxDuration!=null){let i=await _.getMediaDurationInSeconds(e,t.type),a=i!=null&&i<=t.maxDuration;this._setValidationCriterionState(n,t.type===`audio`?`maximum-audio-length`:`maximum-video-length`,a?`success`:`danger`),r&&=a}if(t.type===`image`&&t.maxImageSize!=null){let i=await _.getImageDimensionsInPixels(e),a=i?Math.max(i.width,i.height):null,o=a==null||a<=t.maxImageSize;this._setValidationCriterionState(n,`maximum-image-size`,o?`success`:`danger`),r&&=o}}}if(t!=null&&this.maxAttachmentCount!=null){let e=t<=this.maxAttachmentCount;this._setValidationCriterionState(n,`maximum-number-of-files`,e?`success`:`danger`),r&&=e}return r}_stageReplaceAttachment(e,t,n){let r=this._getAttachmentKey(e);if(!r)return;let i=this._stagedAdds.find(e=>e.key===r);if(i){i.data=t,i.info.name=n,i.info.contentType=t.type,i.info.size=t.size,this._setTemporaryAttachmentUrl(r,t),this._recomputeAttachments();return}let a=this._stagedUpdates.get(r);this._setTemporaryAttachmentUrl(r,t),this._failedStagedUpdateHydrations.delete(r),this._pendingStagedUpdateHydrations.delete(r),this._stagedUpdates.set(r,{...a,key:r,info:e,isReplacement:!0,contentType:t.type||a?.contentType||e.contentType,data:t,name:n,size:t.size}),this._recomputeAttachments()}_getInitialAttachment(e){return this._initialAttachments.find(t=>this._getAttachmentKey(t)===e)}_normalizeAttachmentName(e){let{name:t}=e;typeof t==`string`&&(e.name=t.trim())}_getAttachmentKey(e){return m(e)}_clearStagedUpdateTracking(e){this._stagedUpdates.delete(e),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e)}async _hydrateStagedUpdateData(e){let n=this._getAttachmentKey(e),r=e.url;if(!n||!r)return!1;try{let{data:i}=await t(r,{responseType:`blob`});this._failedStagedUpdateHydrations.delete(n);let a=this._stagedUpdates.get(n);return!a||a.data||this._stagedDeletes.has(n)?!1:(this._stagedUpdates.set(n,{...a,info:e,isReplacement:a.isReplacement??!1,contentType:a.contentType??e.contentType??i.type,data:i}),!0)}catch(e){let t=this._stagedUpdates.get(n);return t&&!t.data&&!this._stagedDeletes.has(n)&&this._failedStagedUpdateHydrations.add(n),a(e)||i.getLogger(this).error(`Failed to fetch attachment data for staged update`,e),!1}}_setTemporaryAttachmentUrl(e,t){if(this._clearTemporaryAttachmentUrl(e),!(t instanceof Blob))return;let n=URL.createObjectURL(t);return this._temporaryAttachmentUrls.set(e,n),n}_clearTemporaryAttachmentUrl(e){let t=this._temporaryAttachmentUrls.get(e);t&&(URL.revokeObjectURL(t),this._temporaryAttachmentUrls.delete(e))}_clearTemporaryAttachmentUrls(){for(let e of this._temporaryAttachmentUrls.values())URL.revokeObjectURL(e);this._temporaryAttachmentUrls.clear()}};e([l()],C.prototype,`allowUserRename`,null),e([l()],C.prototype,`addDisabled`,null),e([l()],C.prototype,`effectiveAttachmentCount`,null),e([l()],C.prototype,`effectiveVisible`,null),e([l()],C.prototype,`effectiveVisibilityCode`,null),e([l()],C.prototype,`accept`,null),e([l()],C.prototype,`categories`,null),e([l()],C.prototype,`attachmentKeyword`,null),e([l()],C.prototype,`attachments`,void 0),e([l()],C.prototype,`displayFilename`,null),e([l({readOnly:!0})],C.prototype,`allAttachmentsVisibleOnDefaultPage`,null),e([l()],C.prototype,`canUploadFiles`,null),e([l()],C.prototype,`hasCaptureInputs`,null),e([l()],C.prototype,`captureMediaType`,null),e([l()],C.prototype,`isCaptureOnly`,null),e([l({readOnly:!0})],C.prototype,`defaultPageAttachments`,null),e([l()],C.prototype,`displayCount`,void 0),e([l()],C.prototype,`feature`,null),e([l()],C.prototype,`group`,void 0),e([l()],C.prototype,`hasAttachmentChanges`,null),e([l()],C.prototype,`hasInvalidAttachmentName`,null),e([l()],C.prototype,`attachmentCount`,null),e([l()],C.prototype,`hasMinimumAttachmentCountNotMet`,null),e([l()],C.prototype,`hasReachedAttachmentLimit`,null),e([l()],C.prototype,`hasExceededAttachmentLimit`,null),e([l({readOnly:!0})],C.prototype,`hasPendingAttachmentUpdateData`,null),e([l()],C.prototype,`input`,null),e([l()],C.prototype,`layer`,null),e([l()],C.prototype,`maxAttachmentCount`,null),e([l()],C.prototype,`minAttachmentCount`,null),e([l({readOnly:!0})],C.prototype,`single`,void 0),e([l()],C.prototype,`touched`,void 0),e([l({readOnly:!0})],C.prototype,`type`,void 0),e([l({readOnly:!0})],C.prototype,`supportsResize`,null),e([l()],C.prototype,`useOriginalFilename`,null),e([l({readOnly:!0})],C.prototype,`valid`,null),e([l()],C.prototype,`_initialAttachments`,void 0),e([l()],C.prototype,`_expressionLayer`,null),e([l()],C.prototype,`_stagedAdds`,void 0),e([l()],C.prototype,`_stagedDeletes`,void 0),e([l()],C.prototype,`_stagedUpdates`,void 0),e([l()],C.prototype,`_failedStagedUpdateHydrations`,void 0),e([l()],C.prototype,`_pendingStagedUpdateHydrations`,void 0),e([l()],C.prototype,`_temporaryAttachmentUrls`,void 0),e([l()],C.prototype,`_hasUnsupportedFileTypeValidationError`,void 0),e([l()],C.prototype,`hasInvalidValidationCriteria`,null),e([l()],C.prototype,`hasUnsupportedFileTypeValidationError`,null),e([l()],C.prototype,`validationCriterionStates`,null),C=e([u(`esri.widgets.BatchAttributeForm.inputs.AttachmentElementInput`)],C);const w=C;function T(e,t){switch(t){case`audio`:e.add(`audio`);break;case`document`:e.add(`document`);break;case`image`:case`signature`:e.add(`image`);break;case`video`:e.add(`video`)}}function E(e){return e.type!==`document`&&e.inputMethod===`capture`}function D(e){return E(e)}function O(e){return e.type===`document`||e.inputMethod!==`capture`}function k(e){return e.data&&typeof e.data!=`string`?e.data.size:e.info.size}function A(e){let t=e.lastIndexOf(`.`);return t===-1?{base:e,extension:null}:{base:e.slice(0,t),extension:e.slice(t+1)}}function j(e,t){return t?`${e}.${t}`:e}export{w as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../request.js";import n from"../../../core/Collection.js";import r from"../../../core/Error.js";import i from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import s from"../../../core/ReactiveMap.js";import c from"../../../core/ReactiveSet.js";import{generateBracedUUID as l}from"../../../core/uuid.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import{getEffectiveLayerCapabilities as f}from"../../../layers/support/layerUtils.js";import p from"../../../rest/query/support/AttachmentInfo.js";import{getAttachmentCategoryForFile as m}from"../../Attachments/support/attachmentUtils.js";import{getAttachmentKey as h,getAttachmentUrl as g,preserveAttachmentFilenameExtension as _,attachmentValidationUtils as v}from"../attachmentUtils.js";import y from"./EditableInput.js";import b from"./SingleFeatureInputAdapter.js";import{visibilityCodeToBoolean as x}from"./support/inputUtils.js";let S=-1;const C=[`maximum-audio-length`,`maximum-file-size`,`maximum-image-size`,`minimum-number-of-files`,`maximum-number-of-files`,`maximum-video-length`];let w=class extends y{constructor(e){super(e),this.attachments=[],this.displayCount=3,this.group=null,this.single=new b({input:this}),this.touched=!1,this.type=`attachment`,this._initialAttachments=[],this._duplicateNameIdentifiers=new Map,this._stagedAdds=new n,this._stagedDeletes=new c,this._stagedUpdates=new s,this._failedStagedUpdateHydrations=new c,this._pendingStagedUpdateHydrations=new s,this._temporaryAttachmentUrls=new s,this._validationCriterionStates=new s,this._hasUnsupportedFileTypeValidationError=!1}get allowUserRename(){return this.template.allowUserRename}get addDisabled(){let e=this.maxAttachmentCount,t=this.effectiveAttachmentCount;return!this.editable||e!=null&&t>=e}get effectiveAttachmentCount(){return this._initialAttachments.length-this._stagedDeletes.size+this._stagedAdds.length}get effectiveVisible(){return x(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){let{visibilityCode:e}=this;if(e!==`visible`)return e;let{group:t}=this;if(t==null)return e;let n=t.visibilityCode;return n===`hidden:visibility-expression:all-features`?`hidden:group-visibility-expression:all-features`:n===`hidden:visibility-expression:some-features`?`hidden:group-visibility-expression:some-features`:e}get accept(){let{categories:e}=this;if(!e.size)return;let t=[];return e.has(`image`)&&t.push(`image/*`),e.has(`audio`)&&t.push(`audio/*`),e.has(`video`)&&t.push(`video/*`),e.has(`document`)&&t.push(`text/*`,`application/*`,`model/*`),t.length>0?t.join(`,`):void 0}get categories(){let e=new Set;for(let t of this._nestableInputs)E(e,t.type);return e}get _nestableInputs(){let{input:e}=this;return e==null?[]:e.type===`attachment`?e.inputTypes??[]:[e]}get attachmentKeyword(){return this.template.attachmentKeyword?.trim()}get displayFilename(){return this.template.displayFilename}get allAttachmentsVisibleOnDefaultPage(){return this.defaultPageAttachments.length===this.attachments.length}get canUploadFiles(){let e=this._nestableInputs;return!e.length||e.some(k)}get hasCaptureInputs(){return this._nestableInputs.some(O)}get captureMediaType(){let e=new Set;for(let t of this._nestableInputs)if(O(t))switch(t.type){case`audio`:e.add(`audio`);break;case`video`:e.add(`video`);break;case`image`:case`signature`:e.add(`image`)}return e.size===1?Array.from(e)[0]:null}get isCaptureOnly(){let e=this._nestableInputs;return!!e.length&&e.every(D)}get defaultPageAttachments(){return this.attachments.slice(0,this.displayCount)}get feature(){return this.single.feature}get hasAttachmentChanges(){return this._stagedAdds.length>0||this._stagedUpdates.size>0||this._stagedDeletes.size>0}get hasInvalidAttachmentName(){return this.allowUserRename?this.attachments.some(e=>e.name.trim().length===0):!1}get attachmentCount(){return this.attachments.length}get hasMinimumAttachmentCountNotMet(){let e=this.minAttachmentCount;return e==null||!this.effectiveVisible?!1:this.effectiveAttachmentCount<e&&!this.isCaptureOnly}get hasReachedAttachmentLimit(){let e=this.maxAttachmentCount,t=this.effectiveAttachmentCount;return e!=null&&t===e}get hasExceededAttachmentLimit(){let e=this.maxAttachmentCount;return e==null||!this.effectiveVisible?!1:this.effectiveAttachmentCount>e}get hasPendingAttachmentUpdateData(){return this._pendingStagedUpdateHydrations.size>0}get input(){return this.template.input}get layer(){return this.single.layer}get maxAttachmentCount(){return this.template.maxAttachmentCount}get minAttachmentCount(){return this.template.minAttachmentCount}get supportsResize(){let{layer:e}=this;if(!e)return!1;let t=f(e);return t?`attachment`in t&&!!t.attachment?.supportsResize:!1}get useOriginalFilename(){return this.template.useOriginalFilename}get valid(){return!(this._failedStagedUpdateHydrations.size>0||this.hasInvalidAttachmentName||this.hasExceededAttachmentLimit||this.hasMinimumAttachmentCountNotMet)}get _expressionLayer(){let e=this.layer;if(e){if(e.type===`scene`&&`associatedLayer`in e&&e.associatedLayer!=null)return e.associatedLayer;if(e.type===`feature`)return e}}destroy(){this._clearTemporaryAttachmentUrls(),this._duplicateNameIdentifiers.clear()}applyFetchedAttachments(e){for(let t of e)this._normalizeAttachmentName(t);this._initialAttachments=e,this._failedStagedUpdateHydrations.clear(),this._recomputeAttachments()}applyStashedEdits(e){let{adds:t,deletes:n,updates:r}=e;for(let e of t){let t=this._getAttachmentKey(e.info);this._stagedAdds.add({data:e.data,globalId:e.globalId??l(),info:e.info,key:t}),this._setTemporaryAttachmentUrl(t,e.data)}for(let e of r){let t=this._getAttachmentKey(e.info);this._stagedUpdates.set(t,{contentType:e.contentType,data:e.data,info:e.info,key:t,name:e.name,size:A(e)}),this._setTemporaryAttachmentUrl(t,e.data)}for(let e of n){let t=this._getAttachmentKey(e.info);this._stagedDeletes.add(t)}this._recomputeAttachments()}clearAttachmentChanges(){this.clearValidationCriteriaState(),this._clearTemporaryAttachmentUrls(),this._stagedAdds.removeAll(),this._stagedUpdates.clear(),this._stagedDeletes.clear(),this._failedStagedUpdateHydrations.clear(),this._pendingStagedUpdateHydrations.clear(),this._recomputeAttachments()}clearValidationCriteriaState(){this._validationCriterionStates.clear(),this._hasUnsupportedFileTypeValidationError=!1}get hasInvalidValidationCriteria(){for(let e of this._validationCriterionStates.values())if(e===`danger`)return!0;return!1}get hasUnsupportedFileTypeValidationError(){return this._hasUnsupportedFileTypeValidationError}get validationCriterionStates(){return this._validationCriterionStates}getValidationCriterionState(e){return this._validationCriterionStates.get(e)??null}stageAddAttachment(e){if(!this._assertEditable())throw new r(`batch-attribute-form:not-editable`,`Cannot modify attachments when editableExpression is false.`);let{contentType:t,data:n,name:i}=e,a=e.globalId??l(),o=n instanceof Blob?n.size:void 0,s=i.trim(),c=new p({contentType:t??void 0,globalId:a,id:S--,keywords:this.attachmentKeyword??void 0,name:s,size:o});return this._setTemporaryAttachmentUrl(a,n),this._stagedAdds.add({key:a,globalId:a,info:c,data:n}),this._recomputeAttachments(),c}async stageAddAttachments(e,t){if(this.clearValidationCriteriaState(),!this._assertEditable())return[];let n=e.filter(e=>this.isFileAllowed(e));if(this._setUnsupportedFileTypeValidationError(n.length!==e.length),n.length===0)return[];let r=[],i=new Map,a=Date.now(),o={},s=this.effectiveAttachmentCount,c=s+n.length;if(this.minAttachmentCount!=null&&this.minAttachmentCount>0&&this._setValidationCriterionState(o,`minimum-number-of-files`,c>=this.minAttachmentCount?`success`:`danger`),this.maxAttachmentCount!=null){let e=c<=this.maxAttachmentCount;if(this._setValidationCriterionState(o,`maximum-number-of-files`,e?`success`:`danger`),!e)return this._setValidationCriteriaState(o),[]}let l=!0;for(let e=0;e<n.length;e++){let t=n[e];await this._validateAttachmentFile(t,s+e+1,o)||(l=!1)}if(!l)return this._setValidationCriteriaState(o),[];for(let e=0;e<n.length;e++){let o=n[e],s=o instanceof File?o.name:`attachment-${a}_${e+1}`,c=await this._resolveAttachmentFilename(s,t),l=this._makeUniqueFilenameForOperation(i,c);r.push(this.stageAddAttachment({contentType:o.type,data:o,name:l}))}return this._setValidationCriteriaState(o),r}findAttachment(e){if(e)return this.attachments.find(t=>h(t)===e)}getAttachmentEditState(e){let t=this._getAttachmentKey(e),n=(t?this._initialAttachments.find(e=>this._getAttachmentKey(e)===t):void 0)?.name??null,r=t?this._stagedUpdates.get(t):void 0,i=r?.name??e.name??null;return{initialName:n,isDeleted:!!t&&this._stagedDeletes.has(t),isRenamed:i!=null&&n!=null&&i!==n,isReplaced:r?.isReplacement===!0}}getDuplicateNameIdentifier(e){return this._duplicateNameIdentifiers.get(e)??0}getAttachmentPreviewUrl(e,t){let n=this._getAttachmentKey(e);return(n?this._temporaryAttachmentUrls.get(n):void 0)??g({attachment:e,supportsResizeAttachments:this.supportsResize,layer:this.layer,thumbnailSize:t})}async ensureStagedUpdateData(e){let t=this._getAttachmentKey(e);if(!t)return!1;let n=this._stagedUpdates.get(t);if(!n||n.data||this._stagedDeletes.has(t))return this._failedStagedUpdateHydrations.delete(t),!1;let r=this._pendingStagedUpdateHydrations.get(t);if(r)return await r;let i=this._hydrateStagedUpdateData(e);this._pendingStagedUpdateHydrations.set(t,i);try{return await i}finally{this._pendingStagedUpdateHydrations.get(t)===i&&this._pendingStagedUpdateHydrations.delete(t)}}async waitForPendingAttachmentUpdateData(){await Promise.allSettled(Array.from(this._pendingStagedUpdateHydrations.values()))}discardStagedEdits(e){if(!this._assertEditable())return;let t=this._getAttachmentKey(e);if(!t)return;let n=this._stagedAdds.findIndex(e=>e.key===t);n>-1?(this._clearTemporaryAttachmentUrl(t),this._stagedAdds.removeAt(n),this._failedStagedUpdateHydrations.delete(t),this._pendingStagedUpdateHydrations.delete(t),this._recomputeAttachments()):(this._clearTemporaryAttachmentUrl(t),this._stagedDeletes.delete(t),this._clearStagedUpdateTracking(t),this._recomputeAttachments())}isFileAllowed(e){let{categories:t}=this;if(!t.size)return!0;let n=m(e);return n!=null&&t.has(n)}isStagedAttachmentAddition(e){return typeof e.id==`number`&&e.id<0}stageDeleteAttachment(e){if(!this._assertEditable())return;let t=this._getAttachmentKey(e);if(!t)return;let n=this._stagedAdds.findIndex(e=>e.key===t);n>-1?(this._clearTemporaryAttachmentUrl(t),this._stagedAdds.removeAt(n),this._failedStagedUpdateHydrations.delete(t),this._pendingStagedUpdateHydrations.delete(t),this._recomputeAttachments()):(this._clearTemporaryAttachmentUrl(t),this._stagedDeletes.add(t),this._clearStagedUpdateTracking(t),this._recomputeAttachments())}stageRenameAttachment(e,t){if(!this._assertEditable())return;let n=this._getAttachmentKey(e);if(!n)return;let r=this._stagedAdds.find(e=>e.key===n);if(r){let n=_(e.name,t);r.info.name=n,this._recomputeAttachments();return}let i=this._stagedUpdates.get(n),a=this._getInitialAttachment(n)?.name??null,o=e.name.trim().length===0?a??e.name:e.name,s=i?.isReplacement===!0&&a!=null&&t===a,c=_(o,s?j(a).base:t),l=a!=null&&c===a;if(l&&i?.isReplacement!==!0){this._stagedUpdates.delete(n),this._failedStagedUpdateHydrations.delete(n),this._pendingStagedUpdateHydrations.delete(n),this._recomputeAttachments();return}let u={key:n,...i,info:e};l?delete u.name:u.name=c,this._stagedUpdates.set(n,u),this._recomputeAttachments(),this.ensureStagedUpdateData(e)}async stageReplaceAttachment(e,t,n){if(this.clearValidationCriteriaState(),!this._assertEditable())return!1;if(!this.isFileAllowed(t))return this._setUnsupportedFileTypeValidationError(!0),!1;let r={},i=await this._validateAttachmentFile(t,void 0,r);if(this._setValidationCriteriaState(r),!i)return!1;let a=t instanceof File?t.name:e.name,o=await this._resolveAttachmentFilename(a,n);return this._stageReplaceAttachment(e,t,o),!0}toSubmitEdits(){let e=[],t=[],n=[],r=this.feature?.plainGraphic;if(!r||this._stagedAdds.length===0&&this._stagedUpdates.size===0&&this._stagedDeletes.size===0)return null;let i=this.attachmentKeyword;for(let t of this._stagedAdds)t.data!=null&&e.push({feature:r,contentType:t.info.contentType,data:t.data,info:t.info,globalId:t.info.globalId,keywords:i,name:t.info.name});for(let e of this._stagedUpdates.values()){let n=e.name==null||e.name.trim().length>0;if(e.data==null||!n)continue;let a=e.name??this._getInitialAttachment(e.key)?.name??e.info.name;t.push({feature:r,contentType:e.contentType,data:e.data,globalId:e.info.globalId,id:e.info.id,info:e.info,keywords:i,name:a})}for(let e of this._stagedDeletes.values()){let t=this._getInitialAttachment(e);t&&n.push({feature:r,contentType:t.contentType,globalId:t.globalId,id:t.id,info:t,keywords:i,name:t.name})}return e.length===0&&t.length===0&&n.length===0?null:{label:this.template.label,keywords:i,adds:e,deletes:n,updates:t}}touch(){this.touched=!0}_assertEditable(){return this.editable?!0:(i.getLogger(this).error(`batch-attribute-form:not-editable`,`Cannot modify attachments when editableExpression is false.`),!1)}_recomputeAttachments(){let e=[],t=new Map;this._duplicateNameIdentifiers.clear();for(let t of this._stagedAdds)e.push(t.info);for(let n of this._initialAttachments){let r=this._getAttachmentKey(n);if(r&&this._stagedUpdates.has(r)){let i=this._stagedUpdates.get(r),a=n.clone();i.name!=null&&(a.name=i.name),i.contentType!=null&&(a.contentType=i.contentType),i.size!=null&&(a.size=i.size),this._assignDuplicateNameIdentifier(a,t),e.push(a)}else this._assignDuplicateNameIdentifier(n,t),e.push(n)}for(let e of this._stagedAdds)this._assignDuplicateNameIdentifier(e.info,t);this.attachments=e}_assignDuplicateNameIdentifier(e,t){let n=a(t,e.name,()=>0);this._duplicateNameIdentifiers.set(e,n),t.set(e.name,n+1)}async _computeAttachmentFilename(e,t){let n=this.template.filenameExpressionExecutor;if(!n)return e;let r=this.single.feature,a=r?.plainGraphic,s=this._expressionLayer,{attachmentKeyword:c,description:l,label:u}=this.template,d={$originalfeature:r?.original,$editcontext:{editType:t.editType},$layer:s,$featureset:s,$datastore:s?.url,$feature:a,$map:t.map,$formElement:{attachmentKeyword:c,description:l,label:u}},f={rawOutput:!0,spatialReference:t.spatialReference,timeZone:t.timeZone};try{let t=n.isAsync?await n.executeAsync(d,f):n.execute(d,f);if(typeof t==`string`&&t.trim().length>0){let{extension:n}=j(e);return M(t.trim(),n)}}catch(e){o(e)||i.getLogger(this).error(`Failed evaluating attachment filename expression`,e)}return e}async _resolveAttachmentFilename(e,t){return this.useOriginalFilename===!1?await this._computeAttachmentFilename(e,t):e}_makeUniqueFilenameForOperation(e,t){let n=t.toLowerCase(),r=e.get(n)??0;if(e.set(n,r+1),r===0)return t;let{base:i,extension:a}=j(t);return M(`${i}_${r}`,a)}_setValidationCriteriaState(e){this._validationCriterionStates.clear();for(let t of C){let n=e[t];n&&this._validationCriterionStates.set(t,n)}}_setUnsupportedFileTypeValidationError(e){this._hasUnsupportedFileTypeValidationError!==e&&(this._hasUnsupportedFileTypeValidationError=e)}_setValidationCriterionState(e,t,n){e[t]!==`danger`&&(e[t]=n)}async _validateAttachmentFile(e,t,n){let r=!0,i=m(e);for(let t of this._nestableInputs){let a=v.getAttachmentCategoryForInputType(t.type);if(i==null||a===i){if(t.type===`document`&&t.maxFileSize!=null){let i=e.size<=t.maxFileSize*1048576;this._setValidationCriterionState(n,`maximum-file-size`,i?`success`:`danger`),r&&=i}if((t.type===`audio`||t.type===`video`)&&t.maxDuration!=null){let i=await v.getMediaDurationInSeconds(e,t.type),a=i!=null&&i<=t.maxDuration;this._setValidationCriterionState(n,t.type===`audio`?`maximum-audio-length`:`maximum-video-length`,a?`success`:`danger`),r&&=a}if(t.type===`image`&&t.maxImageSize!=null){let i=await v.getImageDimensionsInPixels(e),a=i?Math.max(i.width,i.height):null,o=a==null||a<=t.maxImageSize;this._setValidationCriterionState(n,`maximum-image-size`,o?`success`:`danger`),r&&=o}}}if(t!=null&&this.maxAttachmentCount!=null){let e=t<=this.maxAttachmentCount;this._setValidationCriterionState(n,`maximum-number-of-files`,e?`success`:`danger`),r&&=e}return r}_stageReplaceAttachment(e,t,n){let r=this._getAttachmentKey(e);if(!r)return;let i=this._stagedAdds.find(e=>e.key===r);if(i){i.data=t,i.info.name=n,i.info.contentType=t.type,i.info.size=t.size,this._setTemporaryAttachmentUrl(r,t),this._recomputeAttachments();return}let a=this._stagedUpdates.get(r);this._setTemporaryAttachmentUrl(r,t),this._failedStagedUpdateHydrations.delete(r),this._pendingStagedUpdateHydrations.delete(r),this._stagedUpdates.set(r,{...a,key:r,info:e,isReplacement:!0,contentType:t.type||a?.contentType||e.contentType,data:t,name:n,size:t.size}),this._recomputeAttachments()}_getInitialAttachment(e){return this._initialAttachments.find(t=>this._getAttachmentKey(t)===e)}_normalizeAttachmentName(e){let{name:t}=e;typeof t==`string`&&(e.name=t.trim())}_getAttachmentKey(e){return h(e)}_clearStagedUpdateTracking(e){this._stagedUpdates.delete(e),this._failedStagedUpdateHydrations.delete(e),this._pendingStagedUpdateHydrations.delete(e)}async _hydrateStagedUpdateData(e){let n=this._getAttachmentKey(e),r=e.url;if(!n||!r)return!1;try{let{data:i}=await t(r,{responseType:`blob`});this._failedStagedUpdateHydrations.delete(n);let a=this._stagedUpdates.get(n);return!a||a.data||this._stagedDeletes.has(n)?!1:(this._stagedUpdates.set(n,{...a,info:e,isReplacement:a.isReplacement??!1,contentType:a.contentType??e.contentType??i.type,data:i}),!0)}catch(e){let t=this._stagedUpdates.get(n);return t&&!t.data&&!this._stagedDeletes.has(n)&&this._failedStagedUpdateHydrations.add(n),o(e)||i.getLogger(this).error(`Failed to fetch attachment data for staged update`,e),!1}}_setTemporaryAttachmentUrl(e,t){if(this._clearTemporaryAttachmentUrl(e),!(t instanceof Blob))return;let n=URL.createObjectURL(t);return this._temporaryAttachmentUrls.set(e,n),n}_clearTemporaryAttachmentUrl(e){let t=this._temporaryAttachmentUrls.get(e);t&&(URL.revokeObjectURL(t),this._temporaryAttachmentUrls.delete(e))}_clearTemporaryAttachmentUrls(){for(let e of this._temporaryAttachmentUrls.values())URL.revokeObjectURL(e);this._temporaryAttachmentUrls.clear()}};e([u()],w.prototype,`allowUserRename`,null),e([u()],w.prototype,`addDisabled`,null),e([u()],w.prototype,`effectiveAttachmentCount`,null),e([u()],w.prototype,`effectiveVisible`,null),e([u()],w.prototype,`effectiveVisibilityCode`,null),e([u()],w.prototype,`accept`,null),e([u()],w.prototype,`categories`,null),e([u()],w.prototype,`attachmentKeyword`,null),e([u()],w.prototype,`attachments`,void 0),e([u()],w.prototype,`displayFilename`,null),e([u({readOnly:!0})],w.prototype,`allAttachmentsVisibleOnDefaultPage`,null),e([u()],w.prototype,`canUploadFiles`,null),e([u()],w.prototype,`hasCaptureInputs`,null),e([u()],w.prototype,`captureMediaType`,null),e([u()],w.prototype,`isCaptureOnly`,null),e([u({readOnly:!0})],w.prototype,`defaultPageAttachments`,null),e([u()],w.prototype,`displayCount`,void 0),e([u()],w.prototype,`feature`,null),e([u()],w.prototype,`group`,void 0),e([u()],w.prototype,`hasAttachmentChanges`,null),e([u()],w.prototype,`hasInvalidAttachmentName`,null),e([u()],w.prototype,`attachmentCount`,null),e([u()],w.prototype,`hasMinimumAttachmentCountNotMet`,null),e([u()],w.prototype,`hasReachedAttachmentLimit`,null),e([u()],w.prototype,`hasExceededAttachmentLimit`,null),e([u({readOnly:!0})],w.prototype,`hasPendingAttachmentUpdateData`,null),e([u()],w.prototype,`input`,null),e([u()],w.prototype,`layer`,null),e([u()],w.prototype,`maxAttachmentCount`,null),e([u()],w.prototype,`minAttachmentCount`,null),e([u({readOnly:!0})],w.prototype,`single`,void 0),e([u()],w.prototype,`touched`,void 0),e([u({readOnly:!0})],w.prototype,`type`,void 0),e([u({readOnly:!0})],w.prototype,`supportsResize`,null),e([u()],w.prototype,`useOriginalFilename`,null),e([u({readOnly:!0})],w.prototype,`valid`,null),e([u()],w.prototype,`_initialAttachments`,void 0),e([u()],w.prototype,`_expressionLayer`,null),e([u()],w.prototype,`_stagedAdds`,void 0),e([u()],w.prototype,`_stagedDeletes`,void 0),e([u()],w.prototype,`_stagedUpdates`,void 0),e([u()],w.prototype,`_failedStagedUpdateHydrations`,void 0),e([u()],w.prototype,`_pendingStagedUpdateHydrations`,void 0),e([u()],w.prototype,`_temporaryAttachmentUrls`,void 0),e([u()],w.prototype,`_hasUnsupportedFileTypeValidationError`,void 0),e([u()],w.prototype,`hasInvalidValidationCriteria`,null),e([u()],w.prototype,`hasUnsupportedFileTypeValidationError`,null),e([u()],w.prototype,`validationCriterionStates`,null),w=e([d(`esri.widgets.BatchAttributeForm.inputs.AttachmentElementInput`)],w);const T=w;function E(e,t){switch(t){case`audio`:e.add(`audio`);break;case`document`:e.add(`document`);break;case`image`:case`signature`:e.add(`image`);break;case`video`:e.add(`video`)}}function D(e){return e.type!==`document`&&e.inputMethod===`capture`}function O(e){return D(e)}function k(e){return e.type===`document`||e.inputMethod!==`capture`}function A(e){return e.data&&typeof e.data!=`string`?e.data.size:e.info.size}function j(e){let t=e.lastIndexOf(`.`);return t===-1?{base:e,extension:null}:{base:e.slice(0,t),extension:e.slice(t+1)}}function M(e,t){return t?`${e}.${t}`:e}export{T as default};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type Accessor from "../../core/Accessor.js";
|
|
2
2
|
import type MapView from "../../views/MapView.js";
|
|
3
|
-
import type SnappingOptions from "../../views/interactive/
|
|
3
|
+
import type SnappingOptions from "../../views/interactive/options/SnappingOptions.js";
|
|
4
4
|
import type { SystemOrLengthUnit } from "../../core/units.js";
|
|
5
5
|
import type { LinearMeasurement, MeasurementState } from "../types.js";
|
|
6
|
-
import type { SnappingOptionsProperties } from "../../views/interactive/
|
|
6
|
+
import type { SnappingOptionsProperties } from "../../views/interactive/options/SnappingOptions.js";
|
|
7
7
|
|
|
8
8
|
/** @deprecated since 5.2. Use the [Distance Measurement 2D component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-distance-measurement-2d/) directly or [DistanceMeasurementAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/DistanceMeasurementAnalysis/) instead. */
|
|
9
9
|
export interface DistanceMeasurement2DViewModelProperties extends Partial<Pick<DistanceMeasurement2DViewModel, "view">> {
|
|
10
10
|
/**
|
|
11
|
-
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
12
|
-
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
13
|
-
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
11
|
+
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/) for sketching.
|
|
12
|
+
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#selfEnabled) and
|
|
13
|
+
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#featureEnabled) snapping.
|
|
14
14
|
*
|
|
15
15
|
* @since 4.32
|
|
16
16
|
*/
|
|
@@ -100,9 +100,9 @@ export default class DistanceMeasurement2DViewModel extends Accessor {
|
|
|
100
100
|
*/
|
|
101
101
|
get measurementLabel(): string | null | undefined;
|
|
102
102
|
/**
|
|
103
|
-
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
104
|
-
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
105
|
-
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/
|
|
103
|
+
* The [SnappingOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/) for sketching.
|
|
104
|
+
* It supports [self](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#selfEnabled) and
|
|
105
|
+
* [feature](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/SnappingOptions/#featureEnabled) snapping.
|
|
106
106
|
*
|
|
107
107
|
* @since 4.32
|
|
108
108
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as a,initial as o,syncAndInitial as s,whenOnce as c}from"../../core/reactiveUtils.js";import{measurementLengthUnits as l}from"../../core/units.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{defaultUnitPropertyMetadata as f}from"../../properties/defaultUnit.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as a,initial as o,syncAndInitial as s,whenOnce as c}from"../../core/reactiveUtils.js";import{measurementLengthUnits as l}from"../../core/units.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{defaultUnitPropertyMetadata as f}from"../../properties/defaultUnit.js";import p from"../../views/interactive/options/SnappingOptions.js";import{SnappingManager as m}from"../../views/interactive/snapping/SnappingManager.js";import{isSupported as h,loadGeometryOperators as g,DistanceMeasurement2DTool as _}from"./DistanceMeasurement2DTool.js";import{InteractiveToolViewModelMixin as v}from"../support/InteractiveToolViewModelMixin.js";let y=class extends v(t){constructor(e){let{suppressDeprecationWarning:t,...i}=e??{};super(i),this.supportedViewType=`2d`,this.unsupportedErrorMessage=`DistanceMeasurement2DViewModel is only supported in 2D views.`,this._snappingManager=null,this.snappingOptions=new p,t||n(r.getLogger(this),`Distance Measurement 2D`,`arcgis-distance-measurement-2d`,{version:`5.2`})}initialize(){this.addHandles([a(()=>this.view?.spatialReference,()=>this.clear()),a(()=>this.unit,e=>{this.tool&&(this.tool.unit=e)},o),a(()=>this.view,e=>{this._snappingManager=i(this._snappingManager),e&&(this._snappingManager=new m({view:e,options:this.snappingOptions}))},s),a(()=>this.snappingOptions,e=>{this._snappingManager&&e&&(this._snappingManager.options=e)})])}destroy(){this._snappingManager=i(this._snappingManager)}get measurement(){return this.tool?.measurement??null}get measurementLabel(){return this.tool?.measurementLabel??null}get state(){return this.disabled||this.view==null||!h(this.view?.spatialReference)?`disabled`:this.tool!=null&&this.measurement?this.tool.active?`measuring`:`measured`:`ready`}get unit(){return this._validateUnit(this.defaultUnit)}set unit(e){this._overrideIfSome(`unit`,this._validateUnit(e))}get unitOptions(){return l}set unitOptions(e){this._overrideIfSome(`unitOptions`,this._validateUnits(e))}get view(){return super.view}set view(e){super.view=e}async start(){let{view:e}=this;e&&(await c(()=>e.ready),await g(e.spatialReference)),this.createTool({interactive:!0})}clear(){this.removeTool()}constructTool(){return new _({snappingManager:this._snappingManager,unit:this.unit,view:this.view,visible:this.visible})}_validateUnit(e){let{unitOptions:t,defaultUnit:n}=this;return e!=null&&t.includes(e)?e:t.includes(n)?n:t.length>0?t[0]:n}_validateUnits(e){if(e==null)return[];let t=e.filter(e=>l.includes(e));return t.length===0?l.slice():t}};e([u()],y.prototype,`_snappingManager`,void 0),e([u(f)],y.prototype,`defaultUnit`,void 0),e([u({readOnly:!0})],y.prototype,`measurement`,null),e([u({readOnly:!0})],y.prototype,`measurementLabel`,null),e([u({type:p,nonNullable:!0})],y.prototype,`snappingOptions`,void 0),e([u({readOnly:!0})],y.prototype,`state`,null),e([u({type:String})],y.prototype,`unit`,null),e([u({type:[String]})],y.prototype,`unitOptions`,null),y=e([d(`esri.widgets.DistanceMeasurement2D.DistanceMeasurement2DViewModel`)],y);const b=y;export{b as default};
|