@arcgis/core 4.34.0-next.20 → 4.34.0-next.21
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/analysis/VolumeMeasurement/CutFillOptions.js +5 -0
- package/analysis/VolumeMeasurement/volumeMeasurementUtils.js +5 -0
- package/analysis/VolumeMeasurementAnalysis.d.ts +4 -0
- package/analysis/VolumeMeasurementAnalysis.js +5 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/06c3725d6cc21e7e4bcf.js +1 -0
- package/assets/esri/core/workers/chunks/{28b525963420f022fb0a.js → 1cc30073f8200b67cff6.js} +1 -1
- package/assets/esri/core/workers/chunks/{9432a5466eec397710a4.js → 273ff53a68714e4daad5.js} +1 -1
- package/assets/esri/core/workers/chunks/32756905bcf11699b3f7.js +1 -0
- package/assets/esri/core/workers/chunks/41f487713c6278d389a1.js +1 -0
- package/assets/esri/core/workers/chunks/5b276962c46c57155166.js +1 -0
- package/assets/esri/core/workers/chunks/5ce62d9fff80d014d186.js +1 -0
- package/assets/esri/core/workers/chunks/5e805c9e9012dd39ec86.js +1 -0
- package/assets/esri/core/workers/chunks/66757fc16316a5c50e1e.js +1 -0
- package/assets/esri/core/workers/chunks/6a0fbc54638f7de138c1.js +1 -0
- package/assets/esri/core/workers/chunks/871fae52d2fddc9e7794.js +1 -0
- package/assets/esri/core/workers/chunks/8b19fe829a9dc26fb3fe.js +1 -0
- package/assets/esri/core/workers/chunks/8eea6251aa09725e654e.js +1 -0
- package/assets/esri/core/workers/chunks/916691122d7fb38497d6.js +1 -0
- package/assets/esri/core/workers/chunks/919d2fd7ebc0c840a759.js +1 -0
- package/assets/esri/core/workers/chunks/97324f030738fc0d456b.js +1 -0
- package/assets/esri/core/workers/chunks/9c510df592befb9ff892.js +1 -0
- package/assets/esri/core/workers/chunks/9d2cb559dd9af4e1727c.js +1 -0
- package/assets/esri/core/workers/chunks/{2e54be3094e41fd3026d.js → 9eb1a171f5ef1fef42ed.js} +1 -1
- package/assets/esri/core/workers/chunks/aba520714efc01bead36.js +1 -0
- package/assets/esri/core/workers/chunks/accff253af360c34e8a8.js +1 -0
- package/assets/esri/core/workers/chunks/ad3871f497ecea1a08c9.js +1 -0
- package/assets/esri/core/workers/chunks/ae6eed26fc932bc08356.js +1 -0
- package/assets/esri/core/workers/chunks/c317819ab0544c50c078.js +1 -0
- package/assets/esri/core/workers/chunks/fc8bbc571216edd9ef5a.js +1 -0
- package/config.js +1 -1
- package/core/libs/rbush/PooledRBush.js +1 -1
- package/core/scheduling.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/float16.js +1 -1
- package/interfaces.d.ts +1040 -146
- package/kernel.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/mixins/ArcGISMapService.js +1 -1
- package/layers/save/mapImageLayerUtils.js +1 -1
- package/layers/support/TilemapCache.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/arcgisLayerUrl.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/package.json +1 -1
- package/rest/knowledgeGraph/GraphAddFieldIndexResult.d.ts +4 -0
- package/rest/knowledgeGraph/GraphAddPropertyResult.d.ts +4 -0
- package/rest/knowledgeGraph/GraphDataModelOperationResult.d.ts +4 -0
- package/rest/knowledgeGraph/GraphDeleteFieldIndexResult.d.ts +4 -0
- package/rest/knowledgeGraph/GraphDeletePropertyResult.d.ts +4 -0
- package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.d.ts +4 -0
- package/rest/knowledgeGraph/GraphUpdatePropertyResult.d.ts +4 -0
- package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.d.ts +4 -0
- package/rest/knowledgeGraphService.d.ts +7 -0
- package/support/requestUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/ManagedCanvas.js +1 -1
- package/views/2d/engine/ParentChildStage.js +5 -0
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/webgl/OverlayContainer.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/VideoScreenRenderer.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueType.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +5 -0
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/Processor.js +1 -1
- package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/mapViewDeps.js +1 -1
- package/views/3d/analysis/AnalysisViewManager3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +4 -0
- package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +5 -0
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/DeconflictAABR.js +1 -1
- package/views/3d/layers/graphics/ExtentSet.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/i3s/I3SAsyncElevationUpdater.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SLodHandling.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileDescriptor.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
- package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/StreamDataLoader.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/core/FBOPool.js +1 -1
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/Viewport2DBaseMixin.js +5 -0
- package/views/Viewport2DMixin.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/support/Scheduler.js +1 -1
- package/views/video/VideoOperationalDataView.js +5 -0
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.d.ts +4 -0
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/EditableInput.d.ts +4 -0
- package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +4 -0
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/GroupInput.d.ts +4 -0
- package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.d.ts +4 -0
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/FeatureForm/EditableInput.d.ts +2 -2
- package/widgets/FeatureForm/FieldInput.d.ts +2 -2
- package/widgets/FeatureForm/GroupInput.d.ts +2 -2
- package/widgets/FeatureForm/InputBase.d.ts +2 -2
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.js +1 -1
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/assets/esri/core/workers/chunks/034950f7d0596e77a7dd.js +0 -1
- package/assets/esri/core/workers/chunks/0808b7b2a18331ac0cf6.js +0 -1
- package/assets/esri/core/workers/chunks/093938edee5f0532d7da.js +0 -1
- package/assets/esri/core/workers/chunks/116bbff428cc2dc1832e.js +0 -1
- package/assets/esri/core/workers/chunks/1646699188ed0cd4ce24.js +0 -1
- package/assets/esri/core/workers/chunks/2999ae2a7d4d1ad6447b.js +0 -1
- package/assets/esri/core/workers/chunks/3541714d448958c9bc38.js +0 -1
- package/assets/esri/core/workers/chunks/629a257509b148ff38c0.js +0 -1
- package/assets/esri/core/workers/chunks/6b5fc9da8ae34c889b83.js +0 -1
- package/assets/esri/core/workers/chunks/707b34e15937c4f7902f.js +0 -1
- package/assets/esri/core/workers/chunks/770e609a6bd3533ceda9.js +0 -1
- package/assets/esri/core/workers/chunks/851baab753d9c8e967bd.js +0 -1
- package/assets/esri/core/workers/chunks/aa6c37f116c07ddca5fb.js +0 -1
- package/assets/esri/core/workers/chunks/bc0c3b5a5ab3fcb8f77a.js +0 -1
- package/assets/esri/core/workers/chunks/cac281604a41af9b1759.js +0 -1
- package/assets/esri/core/workers/chunks/d25c8c30ce4058937d4f.js +0 -1
- package/assets/esri/core/workers/chunks/d638ae7814acf6c0fb8e.js +0 -1
- package/assets/esri/core/workers/chunks/d6ce99a713afdb03e332.js +0 -1
- package/assets/esri/core/workers/chunks/dc3816eef53d17074eab.js +0 -1
- package/assets/esri/core/workers/chunks/dd70b060ea4f632c2430.js +0 -1
- package/assets/esri/core/workers/chunks/e2e5e8bd3406609d8996.js +0 -1
- package/assets/esri/core/workers/chunks/f6c815f7d3ca072172ce.js +0 -1
package/views/VideoView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import r from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import n from"../core/Promise.js";import{watch as a,initial as m,whenOnce as p,syncAndInitial as l}from"../core/reactiveUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import{cast as c}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import j from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import u from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as w}from"../layers/support/MediaElementView.js";import b from"../layers/support/TileInfo.js";import v from"../layers/support/VideoElement.js";import{DOMContainer as M}from"./DOMContainer.js";import{Viewport2DMixin as _}from"./Viewport2DMixin.js";import C from"./2d/AnimationManager.js";import x from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/scheduling.js";import"../core/Logger.js";import"../core/colorUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../symbols/cim/enums.js";import"../core/floatRGBA.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"./2d/engine/webgl/definitions.js";import"./2d/engine/webgl/animations/instructions.js";import"../core/mathUtils.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/Axis.js";import"../geometry/support/spatialReferenceUtils.js";import"../geometry/support/TileClipper.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectSuppress.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../symbols/cim/constants.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/alignmentUtils.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import{Container as G}from"./2d/engine/Container.js";import"./2d/engine/webgl/enums.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/checkWebGLError.js";import"./2d/engine/webgl/DefaultVertexAttributeLayouts.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./webgl/FBOAttachmentType.js";import"./2d/engine/vectorTiles/style/StyleDefinition.js";import"./2d/engine/vectorTiles/enums.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueType.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/animated/attributes.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/constants.js";import"./2d/engine/webgl/mesh/templates/templateUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../arcade/ArcadeDate.js";import"../intl/locale.js";import"luxon";import"../core/sql/UnknownTimeZone.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"./2d/engine/transitions/FadeTransition.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtilsCommon.js";import"../geometry/support/Ellipsoid.js";import"../kernel.js";import"./2d/layers/support/util.js";import E from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/unitUtils.js";import"../geometry/ellipsoidUtils.js";import"../chunks/pe.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import{ViewStateManager as S}from"./2d/ViewStateManager.js";import P from"./2d/engine/webgl/Overlay.js";import q from"./2d/engine/webgl/OverlayContainer.js";import V from"./navigation/Navigation.js";import R from"./ui/DefaultUI.js";import T from"./ui/video/DefaultUIVideo.js";const O=new t("#000");let W;async function z(){const[,{Stage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);W=e}const A=.01;let U=class extends s{};U=e([h("esri.views.VideoView.Base")],U);let k=class extends(_(M(r.EventedMixin(n.EsriPromiseMixin(U))))){constructor(e){super(e),this._isValid=!1,this.stage=null,this.layer=null,this.navigation=new V,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new S({constraints:new x({view:this,minScale:1,maxScale:A})}),this.type="2d",this.ui=new T,this.view2dType="video",this.addHandles([a(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),a(()=>this.layer,()=>this.addResolvingPromise(p(()=>this.ready)),m),a(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),a(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},l)])}initialize(){this.addResolvingPromise(z().then(()=>(this._isValid=!0,p(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference),this.stage=new W(this.surface,{renderingOptions:this.renderingOptions,backgroundColor:O}),this._prepareStage(this.stage);const t=new C({view:this});this._set("animationManager",t);const i=new E({view:this,animationManager:t});this._set("mapViewNavigation",i),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear()}_getViewpoint(){return new i({targetGeometry:new j({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([a(()=>this.stationary,t=>e.stationary=t,l),a(()=>this.state.id,()=>e.state=this.state,l),a(()=>this.renderingOptions,t=>e.renderingOptions=t,l)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new w({element:new v({video:this.layer?.videoElement,georeference:new u({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new P(this._videoElementView);this._overlayContainer=new q,this._overlayContainer.addChild(t),this._effectsContainer=new G,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>A;r/=2)i.push(r);i.push(A);const{lods:s}=b.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([d()],k.prototype,"_overlayContainer",void 0),e([d()],k.prototype,"_isValid",void 0),e([d()],k.prototype,"_effectsContainer",void 0),e([d()],k.prototype,"constraintsInfo",null),e([d()],k.prototype,"layer",void 0),e([d({type:V,nonNullable:!0})],k.prototype,"navigation",void 0),e([d({readOnly:!0})],k.prototype,"preconditionsReady",null),e([d({readOnly:!0})],k.prototype,"ready",void 0),e([d({readOnly:!0})],k.prototype,"rendering",null),e([d()],k.prototype,"scale",null),e([d()],k.prototype,"spatialReference",void 0),e([d()],k.prototype,"stateManager",void 0),e([d()],k.prototype,"type",void 0),e([d(),c(e=>e instanceof R?e:g(T,e))],k.prototype,"ui",void 0),e([d({readOnly:!0})],k.prototype,"videoSize",null),e([d({readOnly:!0})],k.prototype,"view2dType",void 0),k=e([h("esri.views.VideoView")],k);const D=k;export{D as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import r from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import n from"../core/Promise.js";import{watch as a,initial as l,whenOnce as p,syncAndInitial as m}from"../core/reactiveUtils.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import j from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import{load as u,execute as w}from"../geometry/operators/projectOperator.js";import b from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as v}from"../layers/support/MediaElementView.js";import M from"../layers/support/TileInfo.js";import _ from"../layers/support/VideoElement.js";import{DOMContainer as C}from"./DOMContainer.js";import{Viewport2DBaseMixin as S}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as x}from"./Viewport2DMixin.js";import P from"./2d/AnimationManager.js";import V from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/scheduling.js";import"../core/Logger.js";import"../core/colorUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../symbols/cim/enums.js";import"../core/floatRGBA.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"./2d/engine/webgl/definitions.js";import"./2d/engine/webgl/animations/instructions.js";import"../core/mathUtils.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/Axis.js";import"../geometry/support/spatialReferenceUtils.js";import"../geometry/support/TileClipper.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectSuppress.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../symbols/cim/constants.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"./2d/engine/webgl/alignmentUtils.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import{Container as G}from"./2d/engine/Container.js";import"./2d/engine/webgl/enums.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/checkWebGLError.js";import"./2d/engine/webgl/DefaultVertexAttributeLayouts.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./webgl/FBOAttachmentType.js";import"./2d/engine/vectorTiles/style/StyleDefinition.js";import"./2d/engine/vectorTiles/enums.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueType.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/animated/attributes.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/constants.js";import"./2d/engine/webgl/mesh/templates/templateUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../arcade/ArcadeDate.js";import"../intl/locale.js";import"luxon";import"../core/sql/UnknownTimeZone.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import{ManagedCanvas as E}from"./2d/engine/ManagedCanvas.js";import"./2d/engine/transitions/FadeTransition.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtilsCommon.js";import"../geometry/support/Ellipsoid.js";import"../kernel.js";import"./2d/layers/support/util.js";import q from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/unitUtils.js";import"../geometry/ellipsoidUtils.js";import"../chunks/pe.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import{ViewStateManager as R}from"./2d/ViewStateManager.js";import D from"./2d/engine/webgl/Overlay.js";import T from"./2d/engine/webgl/OverlayContainer.js";import O from"./navigation/Navigation.js";import z from"./ui/DefaultUI.js";import W from"./ui/video/DefaultUIVideo.js";const A=new t("#000");let U;async function k(){const[,{ParentStage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);U=e}const F=.01,H=["feature","geojson","csv","stream","ogc-feature","catalog","wfs","parquet","graphics"];let L=class extends s{};L=e([c("esri.views.VideoView.Base")],L);let B=class extends(x(S(C(r.EventedMixin(n.EsriPromiseMixin(L)))))){constructor(e){super(e),this._isValid=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!0,this.layer=null,this.map=null,this.navigation=new O,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new R({constraints:new V({view:this,minScale:1,maxScale:F})}),this.type="2d",this.ui=new W,this.view2dType="video",this.addHandles([a(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),a(()=>this.layer,()=>this.addResolvingPromise(p(()=>this.ready)),l),a(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),a(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},m),a(()=>[this.childStage,this.operationalDataVisible],()=>{this.childStage&&(this.childStage.visible=this.operationalDataVisible)},m)])}initialize(){this.addResolvingPromise(k().then(()=>(this._isValid=!0,p(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}async hitTest(e,t){return this._operationalDataView&&this._operationalDataView.ready?this._operationalDataView.hitTest(e,t):{screenPoint:e,results:[]}}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);const t={renderingOptions:this.renderingOptions,backgroundColor:A,groundControlPoints:()=>this.layer?.groundControlPoints},i=new U(this.surface,t,new E(this.surface));this.stage=i,this._prepareStage(this.stage),this.childStage=i.childStage,this._prepareChildStage(this.childStage);const s=new P({view:this});this._set("animationManager",s);const r=new q({view:this,animationManager:s});this._set("mapViewNavigation",r),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear()}_getViewpoint(){return new i({targetGeometry:new j({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([a(()=>this.stationary,t=>e.stationary=t,m),a(()=>this.state.id,()=>e.state=this.state,m),a(()=>this.renderingOptions,t=>e.renderingOptions=t,m)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new v({element:new _({video:this.layer?.videoElement,georeference:new b({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new D(this._videoElementView);this._overlayContainer=new T,this._overlayContainer.addChild(t),this._effectsContainer=new G,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_prepareChildStage(e){this.addHandles([a(()=>this.map,async t=>{if(this.ready&&t!==this.map)return;const{default:i}=await import("./video/VideoOperationalDataView.js");this._operationalDataView=new i({stage:e,layerViewFilter:e=>new Set(H).has(e.type),videoWidth:this.videoSize[0],videoHeight:this.videoSize[1],map:t})},m),a(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints)return;const t=this.layer.groundControlPoints,i=t?.length;if(!i)return;await u();const s=new Array(i),r=e.state.spatialReference;for(let e=0;e<i;e++){const{lat:i,lon:o}=t[e];s[e]=w(new j(o,i),r)}let o=1/0,n=1/0,a=-1/0,l=-1/0;for(const e of s)o=Math.min(o,e.x),n=Math.min(n,e.y),a=Math.max(a,e.x),l=Math.max(l,e.y);const p=f.fromJSON({xmin:o,ymin:n,xmax:a,ymax:l,spatialReference:r});await(this._operationalDataView?.goTo(p,{animate:!1}).catch(()=>{}))},m)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>F;r/=2)i.push(r);i.push(F);const{lods:s}=M.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([h()],B.prototype,"_overlayContainer",void 0),e([h()],B.prototype,"_isValid",void 0),e([h()],B.prototype,"_effectsContainer",void 0),e([h()],B.prototype,"constraintsInfo",null),e([h()],B.prototype,"operationalDataVisible",void 0),e([h()],B.prototype,"layer",void 0),e([h()],B.prototype,"map",void 0),e([h({type:O,nonNullable:!0})],B.prototype,"navigation",void 0),e([h({readOnly:!0})],B.prototype,"preconditionsReady",null),e([h({readOnly:!0})],B.prototype,"ready",void 0),e([h({readOnly:!0})],B.prototype,"rendering",null),e([h()],B.prototype,"scale",null),e([h()],B.prototype,"spatialReference",void 0),e([h()],B.prototype,"stateManager",void 0),e([h()],B.prototype,"type",void 0),e([h(),d(e=>e instanceof z?e:g(W,e))],B.prototype,"ui",void 0),e([h({readOnly:!0})],B.prototype,"videoSize",null),e([h({readOnly:!0})],B.prototype,"view2dType",void 0),B=e([c("esri.views.VideoView")],B);const I=B;export{I as default};
|
package/views/View2D.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{initialize as p}from"../core/workers/workers.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import u from"../geometry/Polygon.js";import{isLoadedOrLoadFor as m}from"../geometry/projectionUtils.js";import y from"../layers/support/TileInfo.js";import{BreakpointsOwner as f}from"./BreakpointsOwner.js";import{DOMContainer as w}from"./DOMContainer.js";import{PopupView as V}from"./PopupView.js";import b from"./View.js";import{Viewport2DMixin as M}from"./Viewport2DMixin.js";import v from"./2d/AnimationManager.js";import{layerView2DImporter as _}from"./2d/layerViewModuleImportUtils.js";import j from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as S}from"./2d/viewpointUtils.js";import L from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as R}from"./2d/layers/support/util.js";import{clipContainsPoint as O}from"./2d/support/clippingUtils.js";import{getDefaultHighlightOptions as T,setDefaultHighlightOptions as k}from"./2d/support/highlightOptionsUtils.js";import{hitTest as C}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as x,takeScreenshot as D}from"./2d/support/screenshotUtils.js";import{Timeline as E}from"./2d/support/Timeline.js";import P from"./navigation/Navigation.js";import G from"./navigation/NavigationActionMap.js";import U from"./support/HighlightOptions.js";import{check as q}from"./support/WebGLRequirements.js";import z from"./ui/DefaultUI.js";import A from"./ui/2d/DefaultUI2D.js";import{isWebMap as I}from"../webmap/utils.js";import N from"../webmap/background/ColorBackground.js";let W,$,F,H,B,Z,J;async function K(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);$=e,F=t,H=i,B=r,Z=s,J=a,W=n}let Q=class extends(M(f(V(w(b))))){constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.labelManager=null,this.navigation=new P({actionMap:new G({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.floors=new i,this.grid=null,this.map=null,this.spatialReferenceLocked=!1,this.timeline=new E,this.type="2d",this.view2dType=null,this.ui=new A,this.test={takeScreenshot:async e=>x(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},p()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new L(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return m(t.spatialReference,i)}get background(){return I(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get highlightOptions(){return T(this)}set highlightOptions(e){k(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resolution(){return this.stateManager.resolution??0}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some(e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating}),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get visibleArea(){const e=this.stateManager.visibleArea;return e?new u({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return C(this,e,t)}async takeScreenshot(e){return D(this._getScreenshotView(e),e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return I(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return I(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(e){return _.hasLayerViewModule(e)}importLayerView(e){return _.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter(i=>i.clips.every(i=>O(this,i,e,t))).reverse(),s=new globalThis.Map(r.map(e=>[e.layer.uid,e])),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=q(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e){a.getLogger(this).warn("#validate()",e.message);const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const s=document.createElement("a");throw s.innerHTML="https://esriurl.com/systemRequirements",s.target="_blank",s.setAttribute("style","font-size: 18px;"),s.href="https://esriurl.com/systemRequirements",t.appendChild(i),t.appendChild(r),t.appendChild(s),this.surface.appendChild(t),e}}loadAsyncDependencies(){return K()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,d=l?.rotation??0,g=l?.scale||p&&S(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),c=o.center??h,u=o.rotation??d,m=o.scale??g;return c&&m?new t({targetGeometry:c,scale:m,rotation:u}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new W(this.surface,{canvas:this.renderCanvas,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline});this.stage=t,this._magnifierView=new Z,this._magnifierView.magnifier=this.magnifier,this._gridView=new J;const i=new H({view:this});this._set("labelManager",i);const r=new v({view:this});this._set("animationManager",r);const s=new B({view:this,animationManager:r});this._set("mapViewNavigation",s),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),t.on("webgl-error",e=>this.fatalError=e.error),o(()=>this.stationary,e=>t.stationary=e,l),o(()=>this.background,e=>{t.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},l),o(()=>this.magnifier,e=>this._magnifierView.magnifier=e,l),o(()=>this.grid,e=>this._gridView.grid=e,l),o(()=>this.renderingOptions,e=>t.renderingOptions=e,l),o(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{t.highlightGradient=R(t.highlightGradient,this.highlights.items)},l),o(()=>this.state.id,()=>t.state=this.state,l)],"map-view"),this._updateStageChildren();const a=this._resolveWhenReady;this._resolveWhenReady=[],a.forEach(e=>e(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new j(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new $({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new F(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([h({constructOnly:!0})],Q.prototype,"deactivatedWebGLExtensions",void 0),e([h({constructOnly:!0})],Q.prototype,"debugWebGLExtensions",void 0),e([h({readOnly:!0})],Q.prototype,"featuresTilingScheme",void 0),e([h({readOnly:!0})],Q.prototype,"graphicsTileStore",null),e([h()],Q.prototype,"graphicsView",void 0),e([h()],Q.prototype,"constraintsInfo",null),e([h()],Q.prototype,"initialExtentRequired",null),e([h()],Q.prototype,"labelManager",void 0),e([h({type:P,nonNullable:!0})],Q.prototype,"navigation",void 0),e([h({constructOnly:!0})],Q.prototype,"renderCanvas",void 0),e([h()],Q.prototype,"renderingOptions",void 0),e([h({constructOnly:!0})],Q.prototype,"supersampleScreenshotsEnabled",void 0),e([h({readOnly:!0})],Q.prototype,"supportsGround",void 0),e([h()],Q.prototype,"defaultsFromMapSettings",null),e([h({readOnly:!0})],Q.prototype,"typeSpecificPreconditionsReady",null),e([h({type:N})],Q.prototype,"background",null),e([h()],Q.prototype,"center",null),e([h({type:i})],Q.prototype,"floors",void 0),e([h()],Q.prototype,"grid",void 0),e([h({type:U})],Q.prototype,"highlightOptions",null),e([h()],Q.prototype,"map",void 0),e([h()],Q.prototype,"padding",null),e([h({readOnly:!0})],Q.prototype,"rendering",null),e([h({readOnly:!0})],Q.prototype,"resolution",null),e([h()],Q.prototype,"scale",null),e([h({constructOnly:!0})],Q.prototype,"spatialReferenceLocked",void 0),e([h({readOnly:!0})],Q.prototype,"tileInfo",null),e([h({type:E,readOnly:!0})],Q.prototype,"timeline",void 0),e([h({readOnly:!0})],Q.prototype,"type",void 0),e([h({readOnly:!0})],Q.prototype,"updating",null),e([h({readOnly:!0})],Q.prototype,"view2dType",void 0),e([h({readOnly:!0})],Q.prototype,"visibleArea",null),e([h()],Q.prototype,"zoom",null),e([h({readOnly:!0})],Q.prototype,"navigating",null),e([h(),d(e=>e instanceof z?e:c(A,e))],Q.prototype,"ui",void 0),Q=e([g("esri.views.View2D")],Q);const X=Q;export{X as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Viewpoint.js";import i from"../core/Collection.js";import r from"../core/CollectionFlattener.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{destroyMaybe as n}from"../core/maybe.js";import{watch as o,syncAndInitial as l}from"../core/reactiveUtils.js";import{initialize as p}from"../core/workers/workers.js";import{property as h}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{ensureClass as c}from"../core/accessorSupport/ensureType.js";import u from"../geometry/Polygon.js";import{isLoadedOrLoadFor as m}from"../geometry/projectionUtils.js";import y from"../layers/support/TileInfo.js";import{BreakpointsOwner as f}from"./BreakpointsOwner.js";import{DOMContainer as w}from"./DOMContainer.js";import{PopupView as V}from"./PopupView.js";import M from"./View.js";import{Viewport2DBaseMixin as b}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as v}from"./Viewport2DMixin.js";import _ from"./2d/AnimationManager.js";import{layerView2DImporter as j}from"./2d/layerViewModuleImportUtils.js";import S from"./2d/tiling/TileInfoView.js";import"./2d/tiling/TileKey.js";import"./2d/tiling/TileQueue.js";import"./2d/tiling/TileStrategy.js";import{extentToScale as L}from"./2d/viewpointUtils.js";import{ManagedCanvas as R}from"./2d/engine/ManagedCanvas.js";import O from"./2d/layers/features/support/TileStore.js";import{createOrReuseHighlightGradient as T}from"./2d/layers/support/util.js";import{clipContainsPoint as C}from"./2d/support/clippingUtils.js";import{getDefaultHighlightOptions as k,setDefaultHighlightOptions as x}from"./2d/support/highlightOptionsUtils.js";import{hitTest as D}from"./2d/support/hitTestUtils.js";import{takeRawScreenshot as E,takeScreenshot as P}from"./2d/support/screenshotUtils.js";import{Timeline as G}from"./2d/support/Timeline.js";import U from"./navigation/Navigation.js";import q from"./navigation/NavigationActionMap.js";import z from"./support/HighlightOptions.js";import{check as A}from"./support/WebGLRequirements.js";import I from"./ui/DefaultUI.js";import N from"./ui/2d/DefaultUI2D.js";import{isWebMap as W}from"../webmap/utils.js";import $ from"../webmap/background/ColorBackground.js";let F,H,B,Z,J,K,Q;async function X(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:r,MagnifierView2D:s,GridView2D:a,Stage:n}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);H=e,B=t,Z=i,J=r,K=s,Q=a,F=n}let Y=class extends(v(b(f(V(w(M)))))){constructor(e){super(e),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new r({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.labelManager=null,this.navigation=new U({actionMap:new q({dragTertiary:"none"})}),this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.floors=new i,this.grid=null,this.map=null,this.spatialReferenceLocked=!1,this.timeline=new G,this.type="2d",this.view2dType=null,this.ui=new N,this.test={takeScreenshot:async e=>E(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},p()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=n(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new O(this.featuresTilingScheme)}get constraintsInfo(){const e=this.defaultsFromMap?.tileInfo,t=this.spatialReference;return{lods:e?.spatialReference?.equals(t)?e.lods:null,spatialReference:t}}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:e,constraints:t,center:i,viewpoint:r,extent:s}=this;let a=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&(!s&&(t?.effectiveLODs||(a=-1),(!i||0===e&&-1===a)&&(null==r?.targetGeometry||"extent"!==r.targetGeometry.type&&!r.scale)))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return m(t.spatialReference,i)}get background(){return W(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){return this.stateManager?.center??null}set center(e){this.stateManager.center=e}get highlightOptions(){return k(this)}set highlightOptions(e){x(this,e)}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get rendering(){return this.stage?.renderRequested??!1}get resolution(){return this.stateManager.resolution??0}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const e=!(!this.magnifier.visible||null===this.magnifier.position||!this._magnifierView?.updatingHandles.updating),t=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||!0===this.layerViewManager.updating||!0===this.labelManager.updating||!0===this.graphicsView.updating||this.allLayerViews.some(e=>!e.destroyed&&!("layerViews"in e)&&!0===e.updating)||e);if(has("esri-2d-log-updating")){const i=this.allLayerViews.reduce((e,t)=>({...e,[`${t.layer.id}(${t.layer.type})`]:!t.destroyed&&!("layerViews"in t)&&t.updating}),{});console.log(`Updating MapView: ${t}\n-> Null LayerViewManager: ${!this.layerViewManager}\n-> Null LabelManager: ${!this.labelManager}\n-> Null GraphicsView: ${!this.graphicsView}\n-> layerViewManager.updating: ${this.layerViewManager?.updating}\n-> labelManager.updating: ${this.labelManager?.updating}\n-> graphicsView.updating: ${this.graphicsView?.updating}\n-> allLayerViews: ${JSON.stringify(i)}\n-> updatingMagnifier: ${e}\n`)}return t}get visibleArea(){const e=this.stateManager.visibleArea;return e?new u({rings:[e.map(e=>[e[0],e[1]])],spatialReference:this.spatialReference}):e}get zoom(){return this.stateManager.zoom??-1}set zoom(e){this.stateManager.zoom=e}get navigating(){return this.mapViewNavigation?.interacting??!1}async hitTest(e,t){return D(this,e,t)}async takeScreenshot(e){return P(this._getScreenshotView(e),e)}toScreen(e,t){return this.stateManager.toScreen(e,t)}whenLayerView(e){return super.whenLayerView(e)}graphicChanged(e){if(this.graphicsView){this.graphicsView.graphicUpdateHandler(e)}}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties.spatialReference||this.defaultsFromMap?.spatialReference||null}getDefaultTimeZone(){return W(this.map)?this.map.initialViewProperties.timeZone:null}getDefaultTimeExtent(){return W(this.map)?this.map.initialViewProperties.timeExtent:null}hasLayerViewModule(e){return j.hasLayerViewModule(e)}importLayerView(e){return j.importLayerView(e)}pixelSizeAt(){return this.ready?this.resolution:(a.getLogger(this).error("#pixelSizeAt()","Map view cannot be used before it is ready"),null)}async popupHitTest(e){const t=this.toMap(e),i=await this.hitTest(e),r=this.allLayerViews.toArray().filter(i=>i.clips.every(i=>C(this,i,e,t))).reverse(),s=new globalThis.Map(r.map(e=>[e.layer.uid,e])),a=[];let n=0,o=0;for(;n<i.results.length||o<r.length;){const e=i.results.at(n);if(e&&"graphic"!==e.type){++n;continue}const l=s.get((e?.layer??e?.graphic.layer)?.uid);if((!e||l)&&o<r.length&&r.at(o)!==l){const e=r.at(o);"fetchPopupFeaturesAtLocation"in e&&a.push({mapPoint:t,layerView:e}),++o}else e&&(a.push({graphic:e.graphic,layerView:l}),++n)}return{hits:a,location:t}}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}async validate(){let e=A(this.type);if(has("safari")&&has("safari")<9&&(e=new s("mapview:browser-not-supported","This browser is not supported by MapView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:has("safari")})),null!=e){a.getLogger(this).warn("#validate()",e.message);const t=document.createElement("div");t.setAttribute("style","display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 100%; justify-content: center; color: black; background: white; font-family: sans-serif;");const i=document.createElement("div");i.innerHTML="Unable to display map. WebGL2 support is required.",i.setAttribute("style","font-size: 24px; font-weight: bold;");const r=document.createElement("div");r.innerHTML="Ensure that your browser and hardware meet the minimum requirements.",r.setAttribute("style","font-size: 18px;");const s=document.createElement("a");throw s.innerHTML="https://esriurl.com/systemRequirements",s.target="_blank",s.setAttribute("style","font-size: 18px;"),s.href="https://esriurl.com/systemRequirements",t.appendChild(i),t.appendChild(r),t.appendChild(s),this.surface.appendChild(t),e}}loadAsyncDependencies(){return X()}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:r,padding:s,size:a}=this;if(!e)return null;const n=r&&"initialViewProperties"in r?r.initialViewProperties:void 0,o=this.stateManager.getUserStartupOptions(this.size),l=n?.viewpoint,p=l?.targetGeometry?.extent??i,h=p?.center,d=l?.rotation??0,g=l?.scale||p&&L(p,[a[0]-s.left-s.right,a[1]-s.top-s.bottom]),c=o.center??h,u=o.rotation??d,m=o.scale??g;return c&&m?new t({targetGeometry:c,scale:m,rotation:u}):null}_startup(){this.timeline.begin("MapView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new R(this.surface),i=new F(this.surface,{canvas:this.renderCanvas,contextOptions:{disabledExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions},renderingOptions:this.renderingOptions,timeline:this.timeline},t);this.stage=i,this._magnifierView=new K,this._magnifierView.magnifier=this.magnifier,this._gridView=new Q;const r=new Z({view:this});this._set("labelManager",r);const s=new _({view:this});this._set("animationManager",s);const a=new J({view:this,animationManager:s});this._set("mapViewNavigation",a),this._setupSpatialReferenceDependentProperties(),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),i.on("webgl-error",e=>this.fatalError=e.error),o(()=>this.stationary,e=>i.stationary=e,l),o(()=>this.background,e=>{i.backgroundColor=e?.color,this._magnifierView.backgroundColor=e?.color},l),o(()=>this.magnifier,e=>this._magnifierView.magnifier=e,l),o(()=>this.grid,e=>this._gridView.grid=e,l),o(()=>this.renderingOptions,e=>i.renderingOptions=e,l),o(()=>this.highlights.items.map(e=>({name:e.name,options:{fillColor:e.color,haloColor:e.haloColor,fillOpacity:e.fillOpacity,haloOpacity:e.haloOpacity,haloWidth:e.haloWidth,haloBlur:e.haloBlur}})),()=>{i.highlightGradient=T(i.highlightGradient,this.highlights.items)},l),o(()=>this.state.id,()=>i.state=this.state,l)],"map-view"),this._updateStageChildren();const n=this._resolveWhenReady;this._resolveWhenReady=[],n.forEach(e=>e(this)),this.timeline.end("MapView Startup"),this.frameTask.start(),this._set("ready",!0)}_teardown(){this._destroySpatialReferenceDependentProperties(),this.removeHandles("map-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.labelManager.destroy(),this._magnifierView.destroy(),this._gridView.destroy(),this.stage.destroy(),this.stage=null,this._set("graphicsView",null),this._magnifierView=null,this._gridView=null,this._set("labelManager",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container),this.stage.addChild(this._magnifierView),this.stage.addChild(this._gridView)}_setupSpatialReferenceDependentProperties(){const e=new S(y.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",e);const t=new H({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new B(e)});this._set("graphicsView",t)}_destroySpatialReferenceDependentProperties(){const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null)}_getScreenshotView(e){const{allLayerViews:t,padding:i,size:r,stage:s}=this;return{allLayerViews:t,backgroundColor:e?.ignoreBackground?null:this.background?.color,padding:i,size:r,stage:s}}_spatialReferenceChanged(e){if(this.ready){this.frameTask.stop();for(const e of this.allLayerViews)e.processDetach();this._destroySpatialReferenceDependentProperties(),this.stateManager.changeSpatialReference(e),this.stage.state=this.state,this._setupSpatialReferenceDependentProperties();for(const e of this.allLayerViews)e.processAttach();this.frameTask.requestFrame(),this.frameTask.start(),this._updateStageChildren()}}static{this.type="2d"}};e([h({constructOnly:!0})],Y.prototype,"deactivatedWebGLExtensions",void 0),e([h({constructOnly:!0})],Y.prototype,"debugWebGLExtensions",void 0),e([h({readOnly:!0})],Y.prototype,"featuresTilingScheme",void 0),e([h({readOnly:!0})],Y.prototype,"graphicsTileStore",null),e([h()],Y.prototype,"graphicsView",void 0),e([h()],Y.prototype,"constraintsInfo",null),e([h()],Y.prototype,"initialExtentRequired",null),e([h()],Y.prototype,"labelManager",void 0),e([h({type:U,nonNullable:!0})],Y.prototype,"navigation",void 0),e([h({constructOnly:!0})],Y.prototype,"renderCanvas",void 0),e([h()],Y.prototype,"renderingOptions",void 0),e([h({constructOnly:!0})],Y.prototype,"supersampleScreenshotsEnabled",void 0),e([h({readOnly:!0})],Y.prototype,"supportsGround",void 0),e([h()],Y.prototype,"defaultsFromMapSettings",null),e([h({readOnly:!0})],Y.prototype,"typeSpecificPreconditionsReady",null),e([h({type:$})],Y.prototype,"background",null),e([h()],Y.prototype,"center",null),e([h({type:i})],Y.prototype,"floors",void 0),e([h()],Y.prototype,"grid",void 0),e([h({type:z})],Y.prototype,"highlightOptions",null),e([h()],Y.prototype,"map",void 0),e([h()],Y.prototype,"padding",null),e([h({readOnly:!0})],Y.prototype,"rendering",null),e([h({readOnly:!0})],Y.prototype,"resolution",null),e([h()],Y.prototype,"scale",null),e([h({constructOnly:!0})],Y.prototype,"spatialReferenceLocked",void 0),e([h({readOnly:!0})],Y.prototype,"tileInfo",null),e([h({type:G,readOnly:!0})],Y.prototype,"timeline",void 0),e([h({readOnly:!0})],Y.prototype,"type",void 0),e([h({readOnly:!0})],Y.prototype,"updating",null),e([h({readOnly:!0})],Y.prototype,"view2dType",void 0),e([h({readOnly:!0})],Y.prototype,"visibleArea",null),e([h()],Y.prototype,"zoom",null),e([h({readOnly:!0})],Y.prototype,"navigating",null),e([h(),d(e=>e instanceof I?e:c(N,e))],Y.prototype,"ui",void 0),Y=e([g("esri.views.View2D")],Y);const ee=Y;export{ee as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import e from"../Viewpoint.js";import{watch as i,sync as n}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import r from"./2d/FrameTask.js";import o from"./2d/MapViewConstraints.js";import{ViewStateManager as p}from"./2d/ViewStateManager.js";import{StationaryManager as l}from"./2d/support/StationaryManager.js";import{ViewEvents as g}from"./input/ViewEvents.js";const d=d=>{let h=class extends d{constructor(...t){super(...t),this.fullOpacity=1,this.stateManager=new p({constraints:new o({view:this})}),this.stationaryManager=new l,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!1,labelsAnimationTime:0,labelCollisionsEnabled:!1},this.frameTask=new r(this),this.viewEvents=new g(this),this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([i(()=>this.viewpoint,()=>this.stationaryManager.flip(),n)])}get constraintsInfo(){return{lods:null,spatialReference:null}}get extent(){return this.stateManager?.extent??null}set extent(t){this.stateManager.extent=t}get state(){return this.stateManager.state}get interacting(){return!1}get stationary(){return!this.animation&&this.stationaryManager.stationary}set animation(t){const e=this._get("animation");if(t===e)return;if(e&&e.stop(),t!==this.animationManager.animation&&this.animationManager.stop(),!t||t.isFulfilled())return void this._set("animation",null);this._set("animation",t);const i=()=>{this.destroyed||t===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame())};t.when(i,i)}get constraints(){return this.stateManager?.constraints}set constraints(t){t.view=this;const e=this.stateManager.constraints;this.stateManager.constraints=t,e?.destroy()}get padding(){return this.stateManager?.padding}set padding(t){this.stateManager&&(this.stateManager.padding=t)}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(t){this.stateManager.resizeAlign=t}get rotation(){return this.stateManager.rotation??0}set rotation(t){const{rotationEnabled:e}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=t,this.constraints.rotationEnabled=e}get viewpoint(){return this.stateManager.viewpoint??null}set viewpoint(t){this.stateManager.viewpoint=t,this.frameTask.requestFrame()}};return t([a({readOnly:!0})],h.prototype,"animationManager",void 0),t([a({readOnly:!0})],h.prototype,"fullOpacity",void 0),t([a()],h.prototype,"stateManager",void 0),t([a()],h.prototype,"constraintsInfo",null),t([a()],h.prototype,"extent",null),t([a({readOnly:!0})],h.prototype,"state",null),t([a({readOnly:!0})],h.prototype,"mapViewNavigation",void 0),t([a()],h.prototype,"renderingOptions",void 0),t([a({readOnly:!0})],h.prototype,"interacting",null),t([a()],h.prototype,"stationary",null),t([a()],h.prototype,"animation",null),t([a({type:o})],h.prototype,"constraints",null),t([a()],h.prototype,"padding",null),t([a()],h.prototype,"resizeAlign",null),t([a()],h.prototype,"rotation",null),t([a({readOnly:!0})],h.prototype,"viewEvents",void 0),t([a({type:e})],h.prototype,"viewpoint",null),h=t([s("esri.views.Viewport2DBaseMixin")],h),h};export{d as Viewport2DBaseMixin};
|
package/views/Viewport2DMixin.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as e}from"../core/accessorSupport/decorators/subclass.js";import{GoToManager as s}from"./2d/GoToManager.js";import o from"./2d/input/MapViewInputManager.js";import{isSupportedScreenPointEvent as i,createScreenPointFromSupportedEvent as n}from"./support/screenUtils.js";const a=a=>{let p=class extends a{constructor(...t){super(...t),this.goToManager=new s({view:this}),this.inputManager=new o({view:this}),this.addHandles([this.on("resize",t=>this.stateManager.resize(t.width,t.height))])}get interacting(){return this.navigating}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}on(t,r,e,s){const o=this.inputManager&&this.viewEvents.on(t,r,e,s);return o||super.on(t,r)}hasEventListener(t){return super.hasEventListener(t)||this.viewEvents.hasHandler(t)}goTo(t,r){return this.goToManager.goTo(t,r)}toMap(t){if(!this.ready)return null;const r=i(t)?n(this,t):t;return this.stateManager.toMap(r)}};return t([r()],p.prototype,"goToManager",void 0),t([r({readOnly:!0})],p.prototype,"interacting",null),t([r()],p.prototype,"stationary",null),t([r({readOnly:!0})],p.prototype,"inputManager",void 0),p=t([e("esri.views.Viewport2DMixin")],p),p};export{a as Viewport2DMixin};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as r}from"../../core/promiseUtils.js";import{watch as i,on as l,syncAndInitial as s}from"../../core/reactiveUtils.js";import{sqlAnd as o}from"../../core/sql.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as a}from"../../core/accessorSupport/decorators/subclass.js";import{getFeatureIdInfoFieldNames as u}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as d}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as p}from"../../layers/support/displayFilterUtils.js";import f from"../../layers/support/FeatureEffect.js";import y from"../../layers/support/FeatureFilter.js";import{getSignedInUser as m}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as h,loadFeaturePopupArcadeModules as c}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as F,unpackFieldNames as g,collectLabelingFields as I,collectElevationFields as b,collectFilterFields as w,collectFeatureReductionFields as E,collectOrderByInfos as v,collectFields as x,collectTrackInfoFields as q,collectDisplayFilterFields as R,collectField as j,featureHasFields as _}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as C}from"../../layers/support/floorFilterUtils.js";import{getUtilityNetworkFields as O}from"../../networks/support/networkFieldUtils.js";import k from"../../rest/support/Query.js";import{createFeatureIdInfo as U}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import{getRequiredFields as P,getFetchPopupTemplate as T}from"./support/popupUtils.js";import{WhereClauseVisitor as L}from"./support/WhereClauseVisitor.js";const S=S=>{let N=class extends S{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([i(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&O(t,e),e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode,"parquet"===e?.type&&e.popupTemplate]},()=>this._handleChange(),s),l(()=>this.view?.floors,"change",()=>this._handleChange()),l(()=>this.layer.displayFilterInfo?.filters,"change",()=>this._handleChange()),l(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:r}=this;return"outFields"in e&&e.outFields?F(t,[...g(t,e.outFields),...r]):F(t,r)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?p(e.displayFilterInfo,this.view):null}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?m(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new k(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=o(t.where,C(this))),this.displayFilterEnabled&&(t.where=o(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new k(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){const r=await this._createPopupQuery(e.map(e=>e.origin?.layer??e.layer),t);return await h(this.layer,e,r,{getPopupTemplate:e=>e&&"popupEnabled"in e&&e.popupEnabled?T(e,t):null,hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then(()=>{});return this._set("_updatingRequiredPromise",e),e.then(()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,r=new L(e.fieldsIndex);if(r.visitFilter(this.filter),"featureReduction"in e&&r.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&r.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&r.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(r.visitFilter(this.featureEffect?.filter),r.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&r.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)r.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await r.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(i){t.getLogger(this).error(i)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:r,layer:{fieldsIndex:i}}=this,l="renderer"in r&&r.renderer,s="orderBy"in r&&r.orderBy,o="featureReduction"in r?r.featureReduction:null,n=new Set,a=[l?l.collectRequiredFields(n,i):null,I(n,r),e&&"elevationInfo"in r?b(n,r):null,null!=this.filter?w(n,r,this.filter):null,e||null==this.featureEffect?null:w(n,r,this.featureEffect.filter),!e&&o?E(n,r,o):null,!e&&s?v(n,r,s):null];if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&x(n,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"timeInfo"in r&&r.timeInfo&&"trackInfo"in r&&r.trackInfo){const{trackInfo:e}=r;x(n,r.fieldsIndex,[r.timeInfo.trackIdField]),"feature"!==r.type&&"startTimeField"!==e.timeField||x(n,r.fieldsIndex,[r.timeInfo.startField]),"endTimeField"===e.timeField&&x(n,r.fieldsIndex,[r.timeInfo.endField]),await q(n,r)}if("floorInfo"in r&&r.floorInfo&&x(n,r.fieldsIndex,[r.floorInfo.floorField]),"featureTitleFields"in r&&this.view?.requiredFieldsOptions?.featureTitleFields&&r.featureTitleFields&&x(n,r.fieldsIndex,r.featureTitleFields),"feature"===r.type&&r.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&x(n,r.fieldsIndex,[r.globalIdField]),this.displayFilterEnabled&&a.push(R(n,r,r.displayFilterInfo)),"feature"===r.type&&e&&null!=r.infoFor3D&&(null==r.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),x(n,r.fieldsIndex,[r.globalIdField])),"subtype-group"===r.type){j(n,i,r.subtypeField);const e=r.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(n,i),I(n,e)]));a.push(Promise.all(e))}if("catalog-footprint"===r.type&&r.parent){const e=r.parent;x(n,i,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===r.type&&"link-chart"===r.parentCompositeLayer.type&&j(n,i,d),"parquet"===r.type&&a.push(P(r,r.popupTemplate).then(e=>{for(const t of e)n.add(t)}));const p=await Promise.allSettled(a);if(e)j(n,i,r.objectIdField);else for(const t of u(U(r)))j(n,i,t);e&&"displayField"in r&&r.displayField&&j(n,i,r.displayField);for(const u of p)"rejected"===u.status&&t.getLogger(this).error(u.reason);const f=Array.from(n).sort();this._set("requiredFields",f)}_popupFeatureHasRequiredFields(e,t){return _(e,t)}async _createPopupQuery(e,t){const i=this.layer.createQuery(),l=new Set;let s=!1;const n=e??[this.layer];for(const o of n){if(!("popupEnabled"in o))continue;const e=T(o,t);if(null==e)continue;const i=await c(e);r(t);const n=i&&i.arcadeUtils.hasGeometryOperations(e);s=!("point"!==this.layer.geometryType&&!n);const a=await P(this.layer,e);r(t);for(const t of a)l.add(t)}return i.returnGeometry=s,i.returnZ=s,i.returnM=s,i.outFields=Array.from(l),i.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(i.where=o(i.where,C(this))),i}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([n()],N.prototype,"_updatingRequiredPromise",void 0),e([n({readOnly:!0})],N.prototype,"availableFields",null),e([n({readOnly:!0})],N.prototype,"displayFilterEnabled",null),e([n({readOnly:!0})],N.prototype,"effectiveDisplayFilter",null),e([n({type:f})],N.prototype,"featureEffect",null),e([n({type:y})],N.prototype,"filter",void 0),e([n()],N.prototype,"layer",void 0),e([n({type:Number})],N.prototype,"maximumNumberOfFeatures",null),e([n({readOnly:!0,type:Boolean})],N.prototype,"maximumNumberOfFeaturesExceeded",null),e([n()],N.prototype,"requiresCurrentUser",void 0),e([n({readOnly:!0})],N.prototype,"requiredFields",void 0),e([n({readOnly:!0})],N.prototype,"signedInUser",null),e([n()],N.prototype,"suspended",void 0),e([n()],N.prototype,"view",void 0),N=e([a("esri.views.layers.FeatureLayerView")],N),N};export{S as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../core/has.js";import t from"../../core/Logger.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{watch as r,on as l,syncAndInitial as s}from"../../core/reactiveUtils.js";import{sqlOr as o,sqlIn as n,sqlAnd as a}from"../../core/sql.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{getFeatureIdInfoFieldNames as d}from"../../layers/graphics/data/FeatureIdInfo.js";import{systemIsSpatialFieldName as f}from"../../layers/knowledgeGraph/constants.js";import{getEffectiveDisplayFilter as y}from"../../layers/support/displayFilterUtils.js";import h from"../../layers/support/FeatureEffect.js";import m from"../../layers/support/FeatureFilter.js";import{getSignedInUser as c}from"../../layers/support/featureLayerUtils.js";import{fetchFeaturePopupFeatures as F,loadFeaturePopupArcadeModules as g}from"../../layers/support/featurePopupQueryUtils.js";import{fixFields as I,unpackFieldNames as b,collectLabelingFields as w,collectElevationFields as v,collectFilterFields as E,collectFeatureReductionFields as x,collectOrderByInfos as q,collectFields as R,collectTrackInfoFields as j,collectDisplayFilterFields as _,collectField as C,featureHasFields as O}from"../../layers/support/fieldUtils.js";import{getFloorFilterClause as k}from"../../layers/support/floorFilterUtils.js";import{getUtilityNetworkFields as U}from"../../networks/support/networkFieldUtils.js";import P from"../../rest/support/Query.js";import{createFeatureIdInfo as T}from"../2d/layers/features/layerAdapters/featureServiceUtils.js";import{getRequiredFields as L,getFetchPopupTemplate as S}from"./support/popupUtils.js";import{WhereClauseVisitor as D}from"./support/WhereClauseVisitor.js";const N=N=>{let Q=class extends N{constructor(...e){super(...e),this._updatingRequiredPromise=null,this.filter=null,this.layer=null,this.requiresCurrentUser=!1,this.requiredFields=[],this.view=null}initialize(){this.addHandles([r(()=>{const e=this.layer,t=this.view;return[e&&"elevationInfo"in e?e.elevationInfo?.featureExpressionInfo:null,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,t?.requiredFieldsOptions?.featureTitleFields&&e&&"featureTitleFields"in e&&e.featureTitleFields,t?.requiredFieldsOptions?.utilityNetworkFields&&U(t,e),e.displayFilterInfo,this.displayFilterEnabled,this.filter,this.featureEffect,this.timeExtent,"knowledge-graph-sublayer"===e?.type&&"link-chart"===e.parentCompositeLayer.type&&e.parentCompositeLayer.linkChart?.linkChartProperties.nonspatialDataDisplay?.mode,"parquet"===e?.type&&e.popupTemplate]},()=>this._handleChange(),s),l(()=>this.view?.floors,"change",()=>this._handleChange()),l(()=>this.layer.displayFilterInfo?.filters,"change",()=>this._handleChange()),l(()=>this.layer&&"sublayers"in this.layer?this.layer.sublayers:null,"change",()=>this._handleChange())])}get availableFields(){if(!this.layer)return[];const{layer:e,layer:{fieldsIndex:t},requiredFields:i}=this;return"outFields"in e&&e.outFields?I(t,[...b(t,e.outFields),...i]):I(t,i)}get displayFilterEnabled(){return(this.view?.displayFilterEnabled??!0)&&(!("displayFilterEnabled"in this.layer)||(this.layer?.displayFilterEnabled??!0))}get effectiveDisplayFilter(){const e=this.layer;return this.displayFilterEnabled&&e.displayFilterInfo?y(e.displayFilterInfo,this.view):null}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?o(e,n(this.layer.objectIdField,this.highlightIds)):e}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){t.getLogger(this).error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}get signedInUser(){return this.layer?.url?c(this.layer.url):Promise.resolve(null)}highlight(e,t){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},t=null!=this.filter?this.filter.createQuery(e):new P(e);return"floorInfo"in this.layer&&this.layer.floorInfo&&(t.where=a(t.where,k(this))),this.displayFilterEnabled&&(t.where=a(t.where,this.effectiveDisplayFilter?.where)),null!=this.timeExtent&&(t.timeExtent=null!=t.timeExtent?t.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),t}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new P(e)}queryFeatures(e,t){throw new Error("missing implementation")}queryObjectIds(e,t){throw new Error("missing implementation")}queryFeatureCount(e,t){throw new Error("missing implementation")}queryExtent(e,t){throw new Error("missing implementation")}async fetchPopupFeaturesFromGraphics(e,t){const i=await this._createPopupQuery(e.map(e=>e.origin?.layer??e.layer),t);return await F(this.layer,e,i,{getPopupTemplate:e=>e&&"popupEnabled"in e&&e.popupEnabled?S(e,t):null,hasRequiredFields:(e,t)=>this._popupFeatureHasRequiredFields(e,t),...t})}_handleChange(){const e=Promise.all([this._updateRequiredFields(),this._updateClientWhereClauseRequirements()]).then(()=>{});return this._set("_updatingRequiredPromise",e),e.then(()=>{this._updatingRequiredPromise===e&&this._set("_updatingRequiredPromise",null)}),e}async _updateClientWhereClauseRequirements(){if(!this.layer||!this.view)return;const{layer:e}=this,i=new D(e.fieldsIndex);if(i.visitFilter(this.filter),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction),"labelingInfo"in e&&i.visitLabelingInfo(e.labelsVisible,e.labelingInfo),"trackInfo"in e&&i.visitTrackInfo(e.trackInfo),"2d"===this.view.type&&(i.visitFilter(this.featureEffect?.filter),i.visitDisplayFilter(this.displayFilterEnabled,e.displayFilterInfo),"featureReduction"in e&&i.visitFeatureReduction(e.featureReduction)),"subtype-group"===e.type)for(const t of e.sublayers)i.visitLabelingInfo(t.labelsVisible,t.labelingInfo);try{const e=await i.finish();this._set("requiresCurrentUser",e.requiresCurrentUser)}catch(r){t.getLogger(this).error(r)}}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e="3d"===this.view.type,{layer:i,layer:{fieldsIndex:r}}=this,l="renderer"in i&&i.renderer,s="orderBy"in i&&i.orderBy,o="featureReduction"in i?i.featureReduction:null,n=new Set,a=[l?l.collectRequiredFields(n,r):null,w(n,i),e&&"elevationInfo"in i?v(n,i):null,null!=this.filter?E(n,i,this.filter):null,e||null==this.featureEffect?null:E(n,i,this.featureEffect.filter),!e&&o?x(n,i,o):null,!e&&s?q(n,i,s):null];if("timeInfo"in i&&i.timeInfo&&this.timeExtent&&R(n,i.fieldsIndex,[i.timeInfo.startField,i.timeInfo.endField]),"timeInfo"in i&&i.timeInfo&&"trackInfo"in i&&i.trackInfo){const{trackInfo:e}=i;R(n,i.fieldsIndex,[i.timeInfo.trackIdField]),"feature"!==i.type&&"startTimeField"!==e.timeField||R(n,i.fieldsIndex,[i.timeInfo.startField]),"endTimeField"===e.timeField&&R(n,i.fieldsIndex,[i.timeInfo.endField]),await j(n,i)}if("floorInfo"in i&&i.floorInfo&&R(n,i.fieldsIndex,[i.floorInfo.floorField]),"featureTitleFields"in i&&this.view?.requiredFieldsOptions?.featureTitleFields&&i.featureTitleFields&&R(n,i.fieldsIndex,i.featureTitleFields),"feature"===i.type&&i.globalIdField&&this.view?.requiredFieldsOptions?.globalIdField&&R(n,i.fieldsIndex,[i.globalIdField]),this.displayFilterEnabled&&a.push(_(n,i,i.displayFilterInfo)),"feature"===i.type&&e&&null!=i.infoFor3D&&(null==i.globalIdField&&t.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),R(n,i.fieldsIndex,[i.globalIdField])),"subtype-group"===i.type){C(n,r,i.subtypeField);const e=i.sublayers.map(e=>Promise.all([e.renderer?.collectRequiredFields(n,r),w(n,e)]));a.push(Promise.all(e))}if("catalog-footprint"===i.type&&i.parent){const e=i.parent;R(n,r,[e.itemNameField,e.itemSourceField,e.itemTypeField,e.maxScaleField,e.minScaleField])}"knowledge-graph-sublayer"===i.type&&"link-chart"===i.parentCompositeLayer.type&&C(n,r,f),"parquet"===i.type&&a.push(L(i,i.popupTemplate).then(e=>{for(const t of e)n.add(t)}));const u=await Promise.allSettled(a);if(e)C(n,r,i.objectIdField);else for(const t of d(T(i)))C(n,r,t);e&&"displayField"in i&&i.displayField&&C(n,r,i.displayField);for(const d of u)"rejected"===d.status&&t.getLogger(this).error(d.reason);const p=Array.from(n).sort();this._set("requiredFields",p)}_popupFeatureHasRequiredFields(e,t){return O(e,t)}async _createPopupQuery(e,t){const r=this.layer.createQuery(),l=new Set;let s=!1;const o=e??[this.layer];for(const n of o){if(!("popupEnabled"in n))continue;const e=S(n,t);if(null==e)continue;const r=await g(e);i(t);const o=r&&r.arcadeUtils.hasGeometryOperations(e);s=!("point"!==this.layer.geometryType&&!o);const a=await L(this.layer,e);i(t);for(const t of a)l.add(t)}return r.returnGeometry=s,r.returnZ=s,r.returnM=s,r.outFields=Array.from(l),r.outSpatialReference=this.view.spatialReference,"floorInfo"in this.layer&&this.layer.floorInfo&&(r.where=a(r.where,k(this))),r}canResume(){return!!super.canResume()&&(null==this.timeExtent||!this.timeExtent.isEmpty)}getTest(){}get test(){}};return e([u()],Q.prototype,"_updatingRequiredPromise",void 0),e([u({readOnly:!0})],Q.prototype,"availableFields",null),e([u({readOnly:!0})],Q.prototype,"displayFilterEnabled",null),e([u({readOnly:!0})],Q.prototype,"effectiveDisplayFilter",null),e([u({readOnly:!0})],Q.prototype,"effectiveDisplayFilterClause",null),e([u({type:h})],Q.prototype,"featureEffect",null),e([u({type:m})],Q.prototype,"filter",void 0),e([u()],Q.prototype,"layer",void 0),e([u({type:Number})],Q.prototype,"maximumNumberOfFeatures",null),e([u({readOnly:!0,type:Boolean})],Q.prototype,"maximumNumberOfFeaturesExceeded",null),e([u()],Q.prototype,"requiresCurrentUser",void 0),e([u({readOnly:!0})],Q.prototype,"requiredFields",void 0),e([u({readOnly:!0})],Q.prototype,"signedInUser",null),e([u()],Q.prototype,"suspended",void 0),e([u()],Q.prototype,"view",void 0),Q=e([p("esri.views.layers.FeatureLayerView")],Q),Q};export{N as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Handles.js";import"../../core/has.js";import t from"../../core/Logger.js";import{removeMaybe as s}from"../../core/maybe.js";import r from"../../core/PerformanceSampler.js";import i from"../../core/PooledArray.js";import{isAborted as a,createAbortError as n,when as _}from"../../core/promiseUtils.js";import{watch as u,initial as h,when as o}from"../../core/reactiveUtils.js";import{signal as d}from"../../core/signal.js";import{Milliseconds as E}from"../../core/time.js";import{PromiseQueue as l}from"../../layers/support/PromiseQueue.js";import T from"./debugFlags.js";import{RenderState as m}from"./RenderState.js";import{Yield as c}from"./Yield.js";function I(){return new U.Scheduler}var g;!function(e){e.RESOURCE_CONTROLLER_IMMEDIATE="immediate",e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.LOD_RENDERER="LoD renderer",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.OVERLAY_RENDERER="overlay renderer",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="clouds generator",e.MAPVIEW_FETCH_QUEUE="mapview fetch queue",e.MAPVIEW_LAYERVIEW_UPDATE="mapview layerview update",e.MAPVIEW_VECTOR_TILE_PARSING_QUEUE="mapview vector tile parsing queue",e[e.NONE=0]="NONE",e[e.TEST_PRIO=1]="TEST_PRIO"}(g||(g={}));const R=0,p=new Map([[g.RESOURCE_CONTROLLER_IMMEDIATE,R],[g.RESOURCE_CONTROLLER,4],[g.SLIDE,R],[g.STREAM_DATA_LOADER,R],[g.ELEVATION_QUERY,R],[g.TERRAIN_SURFACE,1],[g.SURFACE_GEOMETRY_UPDATES,1],[g.LOD_RENDERER,2],[g.GRAPHICS_CORE,2],[g.I3S_CONTROLLER,2],[g.POINT_CLOUD_LAYER,2],[g.FEATURE_TILE_FETCHER,2],[g.CLOUDS_GENERATOR,2],[g.OVERLAY,4],[g.OVERLAY_RENDERER,4],[g.STAGE,4],[g.GRAPHICS_DECONFLICTOR,4],[g.FILTER_VISIBILITY,4],[g.SCALE_VISIBILITY,4],[g.FRUSTUM_VISIBILITY,4],[g.POINT_OF_INTEREST_FREQUENT,6],[g.POINT_OF_INTEREST_INFREQUENT,30],[g.LABELER,8],[g.FEATURE_QUERY_ENGINE,8],[g.FEATURE_TILE_TREE,16],[g.FEATURE_TILE_TREE_ACTIVE,R],[g.ELEVATION_ALIGNMENT,12],[g.ELEVATION_ALIGNMENT_SCENE,14],[g.TEXT_TEXTURE_ATLAS,12],[g.TEXTURE_UNLOAD,12],[g.LINE_OF_SIGHT_TOOL,16],[g.LINE_OF_SIGHT_TOOL_INTERACTIVE,R],[g.SNAPPING,R],[g.SHADOW_ACCUMULATOR,30],[g.MAPVIEW_FETCH_QUEUE,R],[g.MAPVIEW_LAYERVIEW_UPDATE,2],[g.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,R]]);function A(e){return p.has(e)?p.get(e):"number"==typeof e?e:1}const f=E(6.5),L=E(1),N=E(30),O=E(1e3/30),S=E(100),b=.9;var U,k;!function(a){class n{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=d(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new r("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new I,this._state=m.INTERACTING,this._tasks=new i,this._runQueue=new i,this._load=0,this._idleStateCallbacks=new i,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=u(()=>T.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,h);for(const e of Object.keys(g))this.performanceInfo.tasks.set(g[e],new r(g[e]))}destroy(){this._tasks.toArray().forEach(e=>e.remove()),this._tasks.clear(),s(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this._runFrame())}))}registerTask(e,t){const s=new _(this,e,t);return this._tasks.push(s),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new r(e)),s}registerIdleStateCallbacks(e,t){const s={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(s),this.state===m.IDLE&&this._idleUpdatesStartFired&&s.idleBegin();const r=this;return{remove:()=>this._removeIdleStateCallbacks(s),set idleBegin(e){r._idleUpdatesStartFired&&(s.idleEnd(),r._state===m.IDLE&&e()),s.idleBegin=e},set idleEnd(e){s.idleEnd=e}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==m.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(e=>e.idleEnd())))}get state(){return this._state}frame(e){this._startFrameTaskTimes();const t=this._updateBudget(e);if(t){const e=this._budget.now();this._runFrame(),this._recordFrameTaskTimes(this._budget.now()-e)}else this._recordFrameTaskTimes(0);return t}_updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let t=f,s=e.frameDuration,r=L;switch(this.state){case m.IDLE:t=E(0),s=E(Math.max(S,e.frameDuration)),r=N;break;case m.INTERACTING:s=E(Math.max(O,e.frameDuration));case m.ANIMATING:}return s=E(s-e.elapsedFrameTime-t),this.state!==m.IDLE&&s<L&&!this._forceTask?(this._forceTask=!0,!1):(s=E(Math.max(s,r)),this._budget.reset(s),this._updateLoad(),this._schedule())}_runFrame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case m.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll(e=>e.idleBegin())),this._runIdle();break;case m.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(E(0)),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll(t=>{t.name===e&&t.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return k.SCHEDULED;let t=k.IDLE;return this._tasks.forAll(s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t=k.READY:t!==k.READY&&(t=k.WAITING))}),t}_getRuntime(e){let t=0;return this._tasks.forAll(s=>{s.name===e&&(t+=s.runtime)}),t}_resetRuntimes(){this._tasks.forAll(e=>e.runtime=0)}_getRunning(){const e=new Map;if(this._tasks.forAll(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),0===e.size)return null;let t="";return e.forEach((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`}),t}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce((e,t)=>t.needsUpdate?++e:e,0);this._load=this._load*b+e*(1-b)}_schedule(){for(this._runQueue.filterInPlace(e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1)),this._tasks.forAll(e=>{e.basePriority===R&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll(s=>{if(s.needsUpdate&&0!==s.schedulePriority&&s.basePriority!==R&&s.blockFrame!==this._frameNumber)if(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority)s.schedulePriority=0,this._runQueue.push(s);else--s.schedulePriority}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){do{for(;this._runQueue.length>0;){const s=this._budget.now(),r=this._runQueue.pop();this._budget.resetProgress();try{r.task.runTask(this._budget)===c&&(r.blockFrame=this._frameNumber)}catch(e){t.getLogger("esri.views.support.Scheduler").error(`Exception in task "${r.name}"`,e),r.blockFrame=this._frameNumber}!this._budget.hasProgressed&&r.blockFrame!==this._frameNumber&&r.needsUpdate&&(r.name,g.I3S_CONTROLLER,r.blockFrame=this._frameNumber),r.schedulePriority=r.basePriority;const i=this._budget.now()-s;if(r.runtime+=i,this._frameTaskTimes.set(r.priority,this._frameTaskTimes.get(r.priority)+i),this._budget.remaining<=0)return void this._updatingChanged()}}while(this._schedule());this._updatingChanged()}_startFrameTaskTimes(){for(const e of Object.keys(g))this._frameTaskTimes.set(g[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((e,t)=>this.performanceInfo.tasks.get(t).push(e)),this.performanceInfo.total.push(e)}get test(){return this._test}}a.Scheduler=n;class _{get task(){return this._task.value}get updating(){return this._queue.running}constructor(t,s,r){this._scheduler=t,this.name=s,this.blockFrame=0,this.runtime=0,this._queue=new l,this._handles=new e,this._basePriority=A(s),this.schedulePriority=this._basePriority,this._task=d(null!=r?r:this._queue),this._handles.add(o(()=>this.task.running,e=>t.taskRunningChanged(e)))}remove(){this.processQueue(C),this._scheduler.removeTask(this),this.schedule=D.schedule,this.reschedule=D.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const t=A(e);this._basePriority!==R&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}processQueue(e){return this._queue.runTask(e)}}class I{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}a.Budget=I}(U||(U={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(k||(k={}));const C=new U.Budget;function P(e){const t=new U.Budget;return t.reset(e),t}C.enabled=!1;class F{remove(){}processQueue(){}schedule(e,t,s){try{if(a(t)){const e=n();return s?Promise.resolve(s(e)):Promise.reject(e)}return _(e(C))}catch(r){return Promise.reject(r)}}reschedule(e,t,s){return this.schedule(e,t,s)}}const D=new F;export{D as ImmediateTask,g as TaskPriority,k as TaskState,A as getTaskPriority,P as makeBudget,I as newScheduler,C as noBudget,p as taskPriorities};
|
|
5
|
+
import e from"../../core/Handles.js";import"../../core/has.js";import t from"../../core/Logger.js";import{removeMaybe as s}from"../../core/maybe.js";import r from"../../core/PerformanceSampler.js";import i from"../../core/PooledArray.js";import{isAborted as a,createAbortError as n,when as _}from"../../core/promiseUtils.js";import{watch as u,initial as h,when as o}from"../../core/reactiveUtils.js";import{signal as d}from"../../core/signal.js";import{Milliseconds as E}from"../../core/time.js";import{PromiseQueue as l}from"../../layers/support/PromiseQueue.js";import T from"./debugFlags.js";import{RenderState as m}from"./RenderState.js";import{Yield as c}from"./Yield.js";function I(){return new U.Scheduler}var g;!function(e){e.RESOURCE_CONTROLLER_IMMEDIATE="immediate",e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.LOD_RENDERER="LoD renderer",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.OVERLAY_RENDERER="overlay renderer",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="clouds generator",e.MAPVIEW_FETCH_QUEUE="mapview fetch queue",e.MAPVIEW_LAYERVIEW_UPDATE="mapview layerview update",e.MAPVIEW_VECTOR_TILE_PARSING_QUEUE="mapview vector tile parsing queue",e[e.NONE=0]="NONE",e[e.TEST_PRIO=1]="TEST_PRIO"}(g||(g={}));const R=0,p=new Map([[g.RESOURCE_CONTROLLER_IMMEDIATE,R],[g.RESOURCE_CONTROLLER,4],[g.SLIDE,R],[g.STREAM_DATA_LOADER,R],[g.ELEVATION_QUERY,R],[g.TERRAIN_SURFACE,1],[g.SURFACE_GEOMETRY_UPDATES,1],[g.LOD_RENDERER,2],[g.GRAPHICS_CORE,2],[g.I3S_CONTROLLER,2],[g.POINT_CLOUD_LAYER,2],[g.FEATURE_TILE_FETCHER,2],[g.CLOUDS_GENERATOR,2],[g.OVERLAY,4],[g.OVERLAY_RENDERER,4],[g.STAGE,4],[g.GRAPHICS_DECONFLICTOR,4],[g.FILTER_VISIBILITY,4],[g.SCALE_VISIBILITY,4],[g.FRUSTUM_VISIBILITY,4],[g.POINT_OF_INTEREST_FREQUENT,6],[g.POINT_OF_INTEREST_INFREQUENT,30],[g.LABELER,8],[g.FEATURE_QUERY_ENGINE,8],[g.FEATURE_TILE_TREE,16],[g.FEATURE_TILE_TREE_ACTIVE,R],[g.ELEVATION_ALIGNMENT,12],[g.ELEVATION_ALIGNMENT_SCENE,14],[g.TEXT_TEXTURE_ATLAS,12],[g.TEXTURE_UNLOAD,12],[g.LINE_OF_SIGHT_TOOL,16],[g.LINE_OF_SIGHT_TOOL_INTERACTIVE,R],[g.SNAPPING,R],[g.SHADOW_ACCUMULATOR,30],[g.MAPVIEW_FETCH_QUEUE,R],[g.MAPVIEW_LAYERVIEW_UPDATE,2],[g.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,R]]);function A(e){return p.has(e)?p.get(e):"number"==typeof e?e:1}const f=E(6.5),L=E(1),N=E(30),O=E(1e3/30),S=E(100),b=.9;var U,k;!function(a){class n{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=d(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new r("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new I,this._state=m.INTERACTING,this._tasks=new i,this._runQueue=new i,this._load=0,this._idleStateCallbacks=new i,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=u(()=>T.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,h);for(const e of Object.keys(g))this.performanceInfo.tasks.set(g[e],new r(g[e]))}destroy(){this._tasks.toArray().forEach(e=>e.remove()),this._tasks.prune(),this._idleStateCallbacks.prune(),this._runQueue.prune(),s(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this._runFrame())}))}registerTask(e,t){const s=new _(this,e,t);return this._tasks.push(s),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new r(e)),s}registerIdleStateCallbacks(e,t){const s={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(s),this.state===m.IDLE&&this._idleUpdatesStartFired&&s.idleBegin();const r=this;return{remove:()=>this._removeIdleStateCallbacks(s),set idleBegin(e){r._idleUpdatesStartFired&&(s.idleEnd(),r._state===m.IDLE&&e()),s.idleBegin=e},set idleEnd(e){s.idleEnd=e}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==m.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(e=>e.idleEnd())))}get state(){return this._state}frame(e){this._startFrameTaskTimes();const t=this._updateBudget(e);if(t){const e=this._budget.now();this._runFrame(),this._recordFrameTaskTimes(this._budget.now()-e)}else this._recordFrameTaskTimes(0);return t}_updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let t=f,s=e.frameDuration,r=L;switch(this.state){case m.IDLE:t=E(0),s=E(Math.max(S,e.frameDuration)),r=N;break;case m.INTERACTING:s=E(Math.max(O,e.frameDuration));case m.ANIMATING:}return s=E(s-e.elapsedFrameTime-t),this.state!==m.IDLE&&s<L&&!this._forceTask?(this._forceTask=!0,!1):(s=E(Math.max(s,r)),this._budget.reset(s),this._updateLoad(),this._schedule())}_runFrame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case m.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll(e=>e.idleBegin())),this._runIdle();break;case m.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(E(0)),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll(t=>{t.name===e&&t.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return k.SCHEDULED;let t=k.IDLE;return this._tasks.forAll(s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t=k.READY:t!==k.READY&&(t=k.WAITING))}),t}_getRuntime(e){let t=0;return this._tasks.forAll(s=>{s.name===e&&(t+=s.runtime)}),t}_resetRuntimes(){this._tasks.forAll(e=>e.runtime=0)}_getRunning(){const e=new Map;if(this._tasks.forAll(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),0===e.size)return null;let t="";return e.forEach((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`}),t}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce((e,t)=>t.needsUpdate?++e:e,0);this._load=this._load*b+e*(1-b)}_schedule(){for(this._runQueue.filterInPlace(e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1)),this._tasks.forAll(e=>{e.basePriority===R&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll(s=>{if(s.needsUpdate&&0!==s.schedulePriority&&s.basePriority!==R&&s.blockFrame!==this._frameNumber)if(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority)s.schedulePriority=0,this._runQueue.push(s);else--s.schedulePriority}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){do{for(;this._runQueue.length>0;){const s=this._budget.now(),r=this._runQueue.pop();this._budget.resetProgress();try{r.task.runTask(this._budget)===c&&(r.blockFrame=this._frameNumber)}catch(e){t.getLogger("esri.views.support.Scheduler").error(`Exception in task "${r.name}"`,e),r.blockFrame=this._frameNumber}!this._budget.hasProgressed&&r.blockFrame!==this._frameNumber&&r.needsUpdate&&(r.name,g.I3S_CONTROLLER,r.blockFrame=this._frameNumber),r.schedulePriority=r.basePriority;const i=this._budget.now()-s;if(r.runtime+=i,this._frameTaskTimes.set(r.priority,this._frameTaskTimes.get(r.priority)+i),this._budget.remaining<=0)return void this._updatingChanged()}}while(this._schedule());this._updatingChanged()}_startFrameTaskTimes(){for(const e of Object.keys(g))this._frameTaskTimes.set(g[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((e,t)=>this.performanceInfo.tasks.get(t).push(e)),this.performanceInfo.total.push(e)}get test(){return this._test}}a.Scheduler=n;class _{get task(){return this._task.value}get updating(){return this._queue.running}constructor(t,s,r){this._scheduler=t,this.name=s,this.blockFrame=0,this.runtime=0,this._queue=new l,this._handles=new e,this._basePriority=A(s),this.schedulePriority=this._basePriority,this._task=d(null!=r?r:this._queue),this._handles.add(o(()=>this.task.running,e=>t.taskRunningChanged(e)))}remove(){this.processQueue(C),this._scheduler.removeTask(this),this.schedule=D.schedule,this.reschedule=D.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const t=A(e);this._basePriority!==R&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}processQueue(e){return this._queue.runTask(e)}}class I{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}a.Budget=I}(U||(U={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(k||(k={}));const C=new U.Budget;function P(e){const t=new U.Budget;return t.reset(e),t}C.enabled=!1;class F{remove(){}processQueue(){}schedule(e,t,s){try{if(a(t)){const e=n();return s?Promise.resolve(s(e)):Promise.reject(e)}return _(e(C))}catch(r){return Promise.reject(r)}}reschedule(e,t,s){return this.schedule(e,t,s)}}const D=new F;export{D as ImmediateTask,g as TaskPriority,k as TaskState,A as getTaskPriority,P as makeBudget,I as newScheduler,C as noBudget,p as taskPriorities};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Viewpoint.js";import i from"../../core/CollectionFlattener.js";import{destroyMaybe as s}from"../../core/maybe.js";import{whenOnce as r,watch as a,syncAndInitial as o}from"../../core/reactiveUtils.js";import{initialize as n}from"../../core/workers/workers.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{isLoadedOrLoadFor as l}from"../../geometry/projectionUtils.js";import d from"../../layers/support/TileInfo.js";import g from"../View.js";import{Viewport2DBaseMixin as c}from"../Viewport2DBaseMixin.js";import m from"../2d/AnimationManager.js";import{GoToManager as u}from"../2d/GoToManager.js";import{layerView2DImporter as w}from"../2d/layerViewModuleImportUtils.js";import y from"../2d/tiling/TileInfoView.js";import"../2d/tiling/TileKey.js";import"../2d/tiling/TileQueue.js";import"../2d/tiling/TileStrategy.js";import{extentToScale as f}from"../2d/viewpointUtils.js";import v from"../2d/layers/features/support/TileStore.js";import{hitTest as V}from"../2d/support/hitTestUtils.js";import{Timeline as j}from"../2d/support/Timeline.js";let M,T,_,S;async function b(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:s}]=await Promise.all([import("../2d/webglDeps.js"),import("../2d/mapViewDeps.js")]);M=e,T=t,_=i,S=s}let C=class extends(c(g)){constructor(e){super(e),this.stage=null,this.rootLayerViews=new i({getCollections:()=>[this.layerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.graphicsView=null,this.timeline=new j,this.goToManager=new u({view:this}),this.labelManager=null,this.map=null,this.videoWidth=0,this.videoHeight=0,this.surface=null,this.padding={top:0,right:0,bottom:0,left:0},n()}initialize(){this._set("width",this.videoWidth),this._set("height",this.videoHeight),this.addResolvingPromise(r(()=>this.ready))}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=s(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy()}get graphicsTileStore(){return new v(this.featuresTilingScheme)}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=e.targetGeometry,i=this.spatialReference;return l(t.spatialReference,i)}async hitTest(e,t){return V(this,e,t)}goTo(e,t){return this.goToManager.goTo(e,t)}toMap(e){return this.stateManager.toMap(e)}requestUpdate(){this.ready&&this.frameTask.requestUpdate()}loadAsyncDependencies(){return b()}hasLayerViewModule(e){return w.hasLayerViewModule(e)}importLayerView(e){return w.importLayerView(e)}_getDefaultViewpoint(){const{constraints:e,initialExtent:i,map:s,padding:r,size:a}=this;if(!e)return null;const o=s&&"initialViewProperties"in s?s.initialViewProperties:void 0,n=this.stateManager.getUserStartupOptions(this.size),p=o?.viewpoint,h=p?.targetGeometry?.extent??i,l=h?.center,d=p?.rotation??0,g=p?.scale||h&&f(h,[a[0]-r.left-r.right,a[1]-r.top-r.bottom]),c=n.center??l,m=n.rotation??d,u=n.scale??g;return c&&u?new t({targetGeometry:c,scale:u,rotation:m}):null}_updateStageChildren(){this.stage.removeAllChildren(),this.rootLayerViews.forEach(e=>{this.stage.addChild(e.container)});const e=this.graphicsView;this.stage.addChild(e.container)}_startup(){this.timeline.begin("VideoOperationalDataView Startup");const e=this._getDefaultViewpoint();this.stateManager.startup(e,this.size,this.spatialReference,this.defaultsFromMap.extent?.center),this.graphics.owner=this;const t=new _({view:this});this._set("labelManager",t);const i=new m({view:this});this._set("animationManager",i);const s=new S({view:this,animationManager:i});this._set("mapViewNavigation",s);const r=new y(d.create({spatialReference:this.spatialReference,size:512,numLODs:36}));this._set("featuresTilingScheme",r);const n=new M({view:this,graphics:this.graphics,requestUpdateCallback:()=>this.requestUpdate(),container:new T(r)});this._set("graphicsView",n),this.addHandles([this.rootLayerViews.on("change",()=>this._updateStageChildren()),this.stage.on("webgl-error",e=>this.fatalError=e.error),a(()=>this.stationary,e=>this.stage.stationary=e,o),a(()=>this.state.id,()=>this.stage.state=this.state,o)],"video-graphics-view"),this._updateStageChildren(),this.timeline.end("VideoOperationalDataView Startup"),this.frameTask.start(),this.stage.viewIsReady=!0,this._set("ready",!0)}_teardown(){this.removeHandles("video-graphics-view"),this.mapViewNavigation.destroy(),this._set("mapViewNavigation",null),this.animation=null,this.animationManager.destroy(),this._set("animationManager",null),this.layerViewManager.clear(),this.stage.destroy(),this.stage=null;const e=this.graphicsView;this._set("graphicsView",null),e.destroy(),this._set("featuresTilingScheme",null),this._set("mapViewNavigation",null),this.graphics.owner=null,this.frameTask.stop(),this.stationaryManager.clear(),this._set("ready",!1),this.stateManager.teardown()}};e([p()],C.prototype,"stage",void 0),e([p({readOnly:!0})],C.prototype,"featuresTilingScheme",void 0),e([p({readOnly:!0})],C.prototype,"graphicsTileStore",null),e([p()],C.prototype,"graphicsView",void 0),e([p({type:j,readOnly:!0})],C.prototype,"timeline",void 0),e([p()],C.prototype,"goToManager",void 0),e([p()],C.prototype,"labelManager",void 0),e([p()],C.prototype,"map",void 0),e([p()],C.prototype,"videoWidth",void 0),e([p()],C.prototype,"videoHeight",void 0),e([p({readOnly:!0})],C.prototype,"typeSpecificPreconditionsReady",null),e([p({readOnly:!0})],C.prototype,"surface",void 0),C=e([h("esri.views.video.VideoOperationalDataView")],C);const D=C;export{D as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{createTask as t}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import r from"../../core/Error.js";import i from"../../core/Evented.js";import o from"../../core/Logger.js";import{abortMaybe as a}from"../../core/maybe.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as u,watch as l,sync as h,whenOnce as m}from"../../core/reactiveUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../core/support/UpdatingHandles.js";import f from"../../geometry/SpatialReference.js";import{system as _}from"../../time/constants.js";import{createReactiveGraphic as g}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as v}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as F}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as I}from"./expressions/ExpressionsModel.js";import{BatchFormInputs as x}from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as E}from"./inputs/support/createBatchFormInputs.js";import{NoVisibleElementCodes as w,InputVisibilityCode as M,isGroupInput as A,isFieldInput as T}from"./inputs/support/inputUtils.js";import b from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as k}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as C}from"./templates/support/createBatchFormTemplate.js";let V=class extends i.EventedAccessor{constructor(e){super(e),this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new s,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCountWithComplexForms=50,this.maximumFeatureCount=2e3,this.map=null,this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this._arcadeExecutorProvider=new v,this._activeFormInputsByElementId=new Map,this._emptyForm=new x({inputs:[]}),this._emptyFormTemplate=new b({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new y,this._layerTemplateMap=new p,this._layerContingentValuesMap=new p,this._workingFeatures=new s,this._expressionsManager=new F({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:_}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([u(()=>this.features,"after-changes",()=>this._prepare(),{sync:!0}),l(()=>[this.features,this.map,this.timeZone,this.editType],()=>{this._prepare()},h),l(()=>this.activeForm,()=>this._activeFormInputsByElementId.clear(),h)]),this._prepare()}destroy(){this._prepareTask=a(this._prepareTask),this._workingFeatures.destroyAll(),this._expressionsManager&&this._expressionsManager.abort(),this._reactiveGraphicLookup=new p,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get _effectiveTimeZone(){return this.timeZone??"system"}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return w.noElements;const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case M.HIDDEN_NOT_IN_ALL_LAYERS:case M.HIDDEN_NO_DOMAIN_IN_COMMON:e.add(w.noElementsInCommon);break;case M.HIDDEN_FIELD_DEFINITION:case M.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:case M.HIDDEN_VISIBILITY_EXPRESSION_ALL:e.add(w.allElementsHidden);break;case M.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:case M.HIDDEN_VISIBILITY_EXPRESSION_SOME:return w.elementsHiddenInSome}return e.has(w.allElementsHidden)?w.allElementsHidden:w.noElementsInCommon}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid}get layers(){const e=new Set;return this.features.forEach(t=>{const s=t.sourceLayer??t.layer;e.add(s)}),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{})}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(A(e)){const t=e.inputs.find(e=>!e.valid);if(t)return{input:t,groupInput:e}}if(T(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new r("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:t})}setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new r("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);this.setFieldInputValue(s,t)}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await m(()=>!1===this.calculating);const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?E(t,new s([e]),this._expressionsManager):this._emptyForm}async _prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=a(this._prepareTask),this._updateWorkingFeatures(),a(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new F({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??f.WebMercator,map:this.map,timeZone:this._effectiveTimeZone}});const{layers:e}=this;if(0===e.length)return;const s=t(async t=>{try{n(t);const s=new Map;for(const t of e){const e=await k(t);if(e){const s=e.fieldGroups.flatMap(e=>e.fields);this._layerContingentValuesMap.set(t,new Set(s))}else this._layerContingentValuesMap.set(t,new Set);const r=await C(t,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone});this._layerTemplateMap.set(t,r);const i=r.getExpressionExecutorsForLayer(t);if(this._expressionsManager.layerExpressionsModelMap.set(t,new I({preserveFieldValuesWhenHidden:r.preserveFieldValuesWhenHidden,executorMap:i})),!this._hasAsyncArcadeExpressions)for(const t of i.keys()){const e=i.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of r.elements){const{elementId:e}=t;s.has(e)?s.get(e).foldIn(t):s.set(e,t.clone())}}if(this.hasTooManyComplexFeatures)throw new r("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new r("too-many-features","There are too many features to load into the form.");const i=new b({elements:Array.from(s.values())});this.sharedFormTemplate=i,this.sharedForm=E(i,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw o.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.addPromise(s.promise),this._prepareTask=s}_updateWorkingFeatures(){this._workingFeatures.destroyAll();const{features:e}=this;if(this._reactiveGraphicLookup=new p,0!==e.length){this._workingFeatures.addMany(e.map(g));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}};e([c()],V.prototype,"_effectiveTimeZone",null),e([c({readOnly:!0})],V.prototype,"activeFeature",null),e([c()],V.prototype,"activeFeatureIndex",void 0),e([c({readOnly:!0})],V.prototype,"activeForm",null),e([c()],V.prototype,"disabled",void 0),e([c()],V.prototype,"calculating",null),e([c()],V.prototype,"editType",void 0),e([c()],V.prototype,"features",void 0),e([c()],V.prototype,"expressionEvaluationFailed",null),e([c()],V.prototype,"hasNonActiveInvalidFeatures",null),e([c()],V.prototype,"hasAsyncArcadeExpressions",null),e([c()],V.prototype,"_hasAsyncArcadeExpressions",void 0),e([c()],V.prototype,"invalidFeatures",null),e([c()],V.prototype,"hasVisibleInputs",null),e([c()],V.prototype,"hasLayersWithContingentValues",null),e([c()],V.prototype,"maximumFeatureCountWithComplexForms",void 0),e([c()],V.prototype,"maximumFeatureCount",void 0),e([c()],V.prototype,"visibleInputs",null),e([c()],V.prototype,"map",void 0),e([c()],V.prototype,"noVisibleElementsReason",null),e([c()],V.prototype,"readOnly",void 0),e([c()],V.prototype,"spatialReference",void 0),e([c()],V.prototype,"submitHasBeenAttempted",void 0),e([c()],V.prototype,"timeZone",void 0),e([c()],V.prototype,"updating",null),e([c()],V.prototype,"valid",null),e([c()],V.prototype,"layers",null),e([c()],V.prototype,"mode",null),e([c()],V.prototype,"sharedForm",void 0),e([c()],V.prototype,"sharedFormTemplate",void 0),e([c()],V.prototype,"userHasChangedValues",void 0),e([c()],V.prototype,"_arcadeExecutorProvider",void 0),e([c()],V.prototype,"_prepareTask",void 0),e([c()],V.prototype,"_reactiveGraphicLookup",void 0),e([c()],V.prototype,"_layerTemplateMap",void 0),e([c()],V.prototype,"_layerContingentValuesMap",void 0),e([c()],V.prototype,"_workingFeatures",void 0),e([c()],V.prototype,"_expressionsManager",void 0),V=e([d("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],V);const L=V;export{L as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{createTask as t}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import r from"../../core/Error.js";import i from"../../core/Evented.js";import o from"../../core/Logger.js";import{abortMaybe as a}from"../../core/maybe.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as u,watch as l,sync as h,whenOnce as m}from"../../core/reactiveUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../core/support/UpdatingHandles.js";import f from"../../geometry/SpatialReference.js";import{system as _}from"../../time/constants.js";import{createReactiveGraphic as g}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as v}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as F}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as I}from"./expressions/ExpressionsModel.js";import x from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as E}from"./inputs/support/createBatchFormInputs.js";import{NoVisibleElementCodes as w,InputVisibilityCode as M,isGroupInput as A,isFieldInput as T}from"./inputs/support/inputUtils.js";import b from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as k}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as C}from"./templates/support/createBatchFormTemplate.js";let V=class extends i.EventedAccessor{constructor(e){super(e),this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new s,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCountWithComplexForms=50,this.maximumFeatureCount=2e3,this.map=null,this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this._arcadeExecutorProvider=new v,this._activeFormInputsByElementId=new Map,this._emptyForm=new x({inputs:[]}),this._emptyFormTemplate=new b({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new y,this._layerTemplateMap=new p,this._layerContingentValuesMap=new p,this._workingFeatures=new s,this._expressionsManager=new F({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:_}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([u(()=>this.features,"after-changes",()=>this._prepare(),{sync:!0}),l(()=>[this.features,this.map,this.timeZone,this.editType],()=>{this._prepare()},h),l(()=>this.activeForm,()=>this._activeFormInputsByElementId.clear(),h)]),this._prepare()}destroy(){this._prepareTask=a(this._prepareTask),this._workingFeatures.destroyAll(),this._expressionsManager&&this._expressionsManager.abort(),this._reactiveGraphicLookup=new p,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get _effectiveTimeZone(){return this.timeZone??"system"}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return w.noElements;const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case M.HIDDEN_NOT_IN_ALL_LAYERS:case M.HIDDEN_NO_DOMAIN_IN_COMMON:e.add(w.noElementsInCommon);break;case M.HIDDEN_FIELD_DEFINITION:case M.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:case M.HIDDEN_VISIBILITY_EXPRESSION_ALL:e.add(w.allElementsHidden);break;case M.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:case M.HIDDEN_VISIBILITY_EXPRESSION_SOME:return w.elementsHiddenInSome}return e.has(w.allElementsHidden)?w.allElementsHidden:w.noElementsInCommon}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid}get layers(){const e=new Set;return this.features.forEach(t=>{const s=t.sourceLayer??t.layer;e.add(s)}),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{})}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(A(e)){const t=e.inputs.find(e=>!e.valid);if(t)return{input:t,groupInput:e}}if(T(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new r("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:t})}setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new r("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);this.setFieldInputValue(s,t)}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await m(()=>!1===this.calculating);const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?E(t,new s([e]),this._expressionsManager):this._emptyForm}async _prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=a(this._prepareTask),this._updateWorkingFeatures(),a(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new F({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??f.WebMercator,map:this.map,timeZone:this._effectiveTimeZone}});const{layers:e}=this;if(0===e.length)return;const s=t(async t=>{try{n(t);const s=new Map;for(const t of e){const e=await k(t);if(e){const s=e.fieldGroups.flatMap(e=>e.fields);this._layerContingentValuesMap.set(t,new Set(s))}else this._layerContingentValuesMap.set(t,new Set);const r=await C(t,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone});this._layerTemplateMap.set(t,r);const i=r.getExpressionExecutorsForLayer(t);if(this._expressionsManager.layerExpressionsModelMap.set(t,new I({preserveFieldValuesWhenHidden:r.preserveFieldValuesWhenHidden,executorMap:i})),!this._hasAsyncArcadeExpressions)for(const t of i.keys()){const e=i.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of r.elements){const{elementId:e}=t;s.has(e)?s.get(e).foldIn(t):s.set(e,t.clone())}}if(this.hasTooManyComplexFeatures)throw new r("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new r("too-many-features","There are too many features to load into the form.");const i=new b({elements:Array.from(s.values())});this.sharedFormTemplate=i,this.sharedForm=E(i,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw o.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.addPromise(s.promise),this._prepareTask=s}_updateWorkingFeatures(){this._workingFeatures.destroyAll();const{features:e}=this;if(this._reactiveGraphicLookup=new p,0!==e.length){this._workingFeatures.addMany(e.map(g));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}};e([c()],V.prototype,"_effectiveTimeZone",null),e([c({readOnly:!0})],V.prototype,"activeFeature",null),e([c()],V.prototype,"activeFeatureIndex",void 0),e([c({readOnly:!0})],V.prototype,"activeForm",null),e([c()],V.prototype,"disabled",void 0),e([c()],V.prototype,"calculating",null),e([c()],V.prototype,"editType",void 0),e([c()],V.prototype,"features",void 0),e([c()],V.prototype,"expressionEvaluationFailed",null),e([c()],V.prototype,"hasNonActiveInvalidFeatures",null),e([c()],V.prototype,"hasAsyncArcadeExpressions",null),e([c()],V.prototype,"_hasAsyncArcadeExpressions",void 0),e([c()],V.prototype,"invalidFeatures",null),e([c()],V.prototype,"hasVisibleInputs",null),e([c()],V.prototype,"hasLayersWithContingentValues",null),e([c()],V.prototype,"maximumFeatureCountWithComplexForms",void 0),e([c()],V.prototype,"maximumFeatureCount",void 0),e([c()],V.prototype,"visibleInputs",null),e([c()],V.prototype,"map",void 0),e([c()],V.prototype,"noVisibleElementsReason",null),e([c()],V.prototype,"readOnly",void 0),e([c()],V.prototype,"spatialReference",void 0),e([c()],V.prototype,"submitHasBeenAttempted",void 0),e([c()],V.prototype,"timeZone",void 0),e([c()],V.prototype,"updating",null),e([c()],V.prototype,"valid",null),e([c()],V.prototype,"layers",null),e([c()],V.prototype,"mode",null),e([c()],V.prototype,"sharedForm",void 0),e([c()],V.prototype,"sharedFormTemplate",void 0),e([c()],V.prototype,"userHasChangedValues",void 0),e([c()],V.prototype,"_arcadeExecutorProvider",void 0),e([c()],V.prototype,"_prepareTask",void 0),e([c()],V.prototype,"_reactiveGraphicLookup",void 0),e([c()],V.prototype,"_layerTemplateMap",void 0),e([c()],V.prototype,"_layerContingentValuesMap",void 0),e([c()],V.prototype,"_workingFeatures",void 0),e([c()],V.prototype,"_expressionsManager",void 0),V=e([d("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],V);const L=V;export{L as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{isFieldInput as i,isGroupInput as o}from"./support/inputUtils.js";let l=class extends e{constructor(t){super(t),this.inputs=[],this.template=null}get allFieldInputs(){const t=[];for(const e of this.inputs)i(e)?t.push(e):o(e)&&t.push(...e.inputs.filter(i));return t}get description(){return this.template?.description??null}get hasInvalidHiddenInputs(){return this.invalidHiddenInputs.length>0}get invalidFeatures(){return Array.from(new Set(this.allFieldInputs.flatMap(t=>t.invalidFeatures)))}get invalidHiddenInputs(){return this.allFieldInputs.filter(t=>!t.valid&&!t.effectiveVisible)}get title(){return this.template?.title??null}get valid(){return this.allFieldInputs.every(t=>t.valid)}};t([r()],l.prototype,"allFieldInputs",null),t([r()],l.prototype,"description",null),t([r()],l.prototype,"inputs",void 0),t([r()],l.prototype,"hasInvalidHiddenInputs",null),t([r()],l.prototype,"invalidFeatures",null),t([r()],l.prototype,"invalidHiddenInputs",null),t([r()],l.prototype,"template",void 0),t([r()],l.prototype,"title",null),t([r()],l.prototype,"valid",null),l=t([s("esri.widgets.BatchAttributeForm.inputs.BatchFormInputs")],l);const p=l;export{p as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{InputBase as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{InputBase as o}from"./InputBase.js";let r=class extends o{constructor(){super(...arguments),this.editType="NA"}get editable(){return this._evaluatedEditableExpression??!0}get _evaluatedEditableExpression(){let e=!0,t=!0;for(const s of this.features){if(null==this.template.getExpressionExecutorsForLayer(s.layer)?.editableExpression){e=e&&!0;continue}t=!1;const o=this._lookupEvaluatedExpression(s,"editable");"success"===o?.status?e=e&&!0===o.result:e=!1}return t?null:e}};e([t()],r.prototype,"editable",null),e([t()],r.prototype,"editType",void 0),e([t()],r.prototype,"_evaluatedEditableExpression",null),r=e([s("esri.widgets.BatchAttributeForm.inputs.EditableInput")],r);const i=r;export{i as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import{isSome as t}from"../../../core/arrayUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{CodedValue as n}from"../../../layers/support/CodedValue.js";import a from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import s from"../../../layers/support/RangeDomain.js";import{getDomainRange as l,dateTimeFieldValuesToNumericRange as o,isDomainValidForField as u}from"../../../layers/support/domainUtils.js";import{isNumericField as m,isStringField as p,isTimeOnlyField as d,getFieldRange as f,isDateOnlyField as h,isTimestampOffsetField as c}from"../../../layers/support/fieldUtils.js";import{isAnyDateField as y}from"../../../smartMapping/support/utils.js";import{isNumber as g}from"../../../support/guards.js";import{unknown as _,utc as x}from"../../../time/constants.js";import{EditableInput as V}from"./EditableInput.js";import{MultiFeatureError as b,visibilityCodeToBoolean as v,InputVisibilityCode as E,isFieldInputWithShowNoValueOptionInput as D,differentValuesString as F}from"./support/inputUtils.js";import{FieldInputDataTypes as I,getMaxLength as M,getMinLength as N,isEmptyValue as T,dateIsValid as w,validateFormValue as R}from"../../support/forms/formUtils.js";let S=class extends V{constructor(e){super(e),this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return b.DIFFERENT_ERRORS;const t=e[0];for(const i of e)if(i.error!==t.error)return b.DIFFERENT_ERRORS;return t.error}get dataType(){const{field:e}=this;return m(e)?I.Number:p(e)?I.Text:y(e)||d(e)?I.Date:I.Unsupported}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get effectiveVisible(){return v(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if(e!==E.VISIBLE)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return i===E.HIDDEN_VISIBILITY_EXPRESSION_ALL?E.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:i===E.HIDDEN_VISIBILITY_EXPRESSION_SOME?E.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>i.getAttribute(e)===t)}get field(){return this.template.field}get fieldName(){return this.field.name}get invalidFeatures(){return this.errors.map(e=>e.feature)}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this.template;return!this.required&&(!D(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this.template;return D(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return this.dataType===I.Date&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.template.input;return!e||"datetimeoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return M({dataType:this.dataType,field:this.field,input:this.template.input})}get minLength(){return N({dataType:this.dataType,field:this.field,input:this.template.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=l(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?f(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){return(!this.required||!this.distinctValues.some(e=>T(e)))&&!!this.valid}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:F}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?E.HIDDEN_NO_DOMAIN_IN_COMMON:this._baseVisibilityCode:E.HIDDEN_FIELD_DEFINITION}get effectiveTimeZone(){const e=this.template;let t=e.formTimeZone??"system";return e.layerTimeZone?e.layerTimeZone===_?t=x:e.formTimeZone===_&&(t=e.layerTimeZone):e.formTimeZone===_&&(t=x),t}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const e=this.codedValueDomainOptions,{value:t}=this,i=null==t||t===F||e.some(e=>e.value===t)?[]:[{name:`${t}`,value:t}];return[e,i]}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const r of this.features){if(null==i.getExpressionExecutorsForLayer(r.layer)?.requiredExpression)continue;t=!1;const n=this._lookupEvaluatedExpression(r,"required");"success"===n?.status?e=e||!0===n.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const e=this.template.input;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"datetimeoffset-picker"!==t||(i=o(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:r}=e;i={max:null!=t&&w(t)?t.getTime():null,min:null!=r&&w(r)?r.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:r}=this;if("date"!==this.dataType)return{};if(!r)return this._fieldShouldHaveDomain?{}:e;const n=l(i,r);if(!n)return e;const{max:a,min:s,rawMax:o,rawMin:u}=e,{type:m}=t.field;if("date"===m){const{max:e,min:t}=n;return{max:g(a)&&(null===e||null!=e&&a<=e)?a:e??null,min:g(s)&&(null===t||null!=t&&s>=t)?s:t??null}}if("date-only"===m||"time-only"===m||"timestamp-offset"===m){const{max:e,min:t,rawMax:i,rawMin:r}=n,l=g(a)&&o&&(null==e||a<e),m=g(s)&&u&&(null==t||s>t);return{max:l?a:e,min:m?s:t,rawMax:l?o:i,rawMin:m?u:r}}return{}}async setValueFromUser(e){this.userHasChangedValue=!0;const t=[],i=this.fieldName;for(const r of this.features)r.getAttribute(i)!==e&&t.push(r);this._setValue(e),await this.expressionsManager.valueChanged(i,t)}_setValue(e){const{fieldName:t}=this;for(const i of this.features)i.setAttribute(t,e)}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:r,range:n}=this,a=[];for(const s of this.features){const{layer:l}=s,o=l.getField(t)??this.field,u=l.getFieldDomain(t,{feature:s.plainGraphic}),m=this.calculateDomain([u]),p=this._requiredForFeature(s),d=s.getAttribute(t),f=R(d,{dataType:e,domain:m,field:o,maxLength:i,minLength:r,range:n,required:p});f&&a.push({error:f,feature:s.source})}return a}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&u(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let r=null;switch(t?.type){case"range":r=this._intersectRangeDomains(e);break;case"coded-value":r=this._intersectCodedValueDomains(e)}return r}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const n of e)for(const[e,i]of t){n.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let r=t;if(i){r=new Map;for(const[e,n]of i)t.has(e)&&r.set(e,n)}const s=Array.from(r.entries()).map(([e,t])=>new n({code:e,name:t}));return s.length?new a({codedValues:s}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let r=1;r<e.length;r++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[r])}if(t&&!u(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof s){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:r}=this;return h(r)||d(r)||c(r)?o(r,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new s,r=this._getMinMaxFromRangeDomain(e),n=this._getMinMaxFromRangeDomain(t),{field:a}=this,l=this._getValidRangeValue(r.min,-1/0),o=this._getValidRangeValue(r.max,1/0),u=this._getValidRangeValue(n.min,-1/0),m=this._getValidRangeValue(n.max,1/0);return i.minValue=Math.max(l,u),i.maxValue=Math.min(o,m),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((h(a)||d(a)||c(a))&&(i.minValue=Number(r.min)>Number(n.min)?r.rawMin:n.rawMin,i.maxValue=Number(r.max)<Number(n.max)?r.rawMax:n.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return g(e)?e:t}};e([i()],S.prototype,"dataType",null),e([i()],S.prototype,"domain",null),e([i()],S.prototype,"distinctValues",null),e([i()],S.prototype,"editable",null),e([i()],S.prototype,"effectiveVisible",null),e([i()],S.prototype,"effectiveVisibilityCode",null),e([i()],S.prototype,"errors",null),e([i()],S.prototype,"featuresHaveSameValue",null),e([i()],S.prototype,"field",null),e([i()],S.prototype,"fieldName",null),e([i()],S.prototype,"group",void 0),e([i()],S.prototype,"invalidFeatures",null),e([i()],S.prototype,"isSubtypeField",null),e([i()],S.prototype,"showNoValueOptionEnabled",null),e([i()],S.prototype,"includeTime",null),e([i()],S.prototype,"includeTimeOffset",null),e([i()],S.prototype,"maxLength",null),e([i()],S.prototype,"minLength",null),e([i()],S.prototype,"range",null),e([i()],S.prototype,"required",null),e([i()],S.prototype,"submittable",null),e([i({readOnly:!0})],S.prototype,"type",void 0),e([i()],S.prototype,"userHasChangedValue",void 0),e([i()],S.prototype,"valid",null),e([i()],S.prototype,"value",null),e([i()],S.prototype,"visibilityCode",null),e([i()],S.prototype,"effectiveTimeZone",null),e([i()],S.prototype,"_evaluatedRequiredExpression",null),e([i()],S.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([i()],S.prototype,"_allDomains",null),e([i()],S.prototype,"_fieldShouldHaveDomain",null),e([i()],S.prototype,"_dateFormRange",null),e([i()],S.prototype,"_dateRange",null),S=e([r("esri.widgets.BatchAttributeForm.inputs.FieldInput")],S);export{S as FieldInput};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import{isSome as t}from"../../../core/arrayUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{CodedValue as n}from"../../../layers/support/CodedValue.js";import a from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import s from"../../../layers/support/RangeDomain.js";import{getDomainRange as l,dateTimeFieldValuesToNumericRange as o,isDomainValidForField as u}from"../../../layers/support/domainUtils.js";import{isNumericField as m,isStringField as p,isTimeOnlyField as d,getFieldRange as f,isDateOnlyField as h,isTimestampOffsetField as c}from"../../../layers/support/fieldUtils.js";import{isAnyDateField as y}from"../../../smartMapping/support/utils.js";import{isNumber as g}from"../../../support/guards.js";import{unknown as _,utc as V}from"../../../time/constants.js";import b from"./EditableInput.js";import{MultiFeatureError as x,visibilityCodeToBoolean as v,InputVisibilityCode as E,isFieldInputWithShowNoValueOptionInput as D,differentValuesString as F}from"./support/inputUtils.js";import{FieldInputDataTypes as I,getMaxLength as M,getMinLength as N,isEmptyValue as T,dateIsValid as w,validateFormValue as R}from"../../support/forms/formUtils.js";let S=class extends b{constructor(e){super(e),this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return x.DIFFERENT_ERRORS;const t=e[0];for(const i of e)if(i.error!==t.error)return x.DIFFERENT_ERRORS;return t.error}get dataType(){const{field:e}=this;return m(e)?I.Number:p(e)?I.Text:y(e)||d(e)?I.Date:I.Unsupported}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get effectiveVisible(){return v(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if(e!==E.VISIBLE)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return i===E.HIDDEN_VISIBILITY_EXPRESSION_ALL?E.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:i===E.HIDDEN_VISIBILITY_EXPRESSION_SOME?E.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>i.getAttribute(e)===t)}get field(){return this.template.field}get fieldName(){return this.field.name}get invalidFeatures(){return this.errors.map(e=>e.feature)}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this.template;return!this.required&&(!D(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this.template;return D(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return this.dataType===I.Date&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.template.input;return!e||"datetimeoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return M({dataType:this.dataType,field:this.field,input:this.template.input})}get minLength(){return N({dataType:this.dataType,field:this.field,input:this.template.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=l(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?f(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){return(!this.required||!this.distinctValues.some(e=>T(e)))&&!!this.valid}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:F}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?E.HIDDEN_NO_DOMAIN_IN_COMMON:this._baseVisibilityCode:E.HIDDEN_FIELD_DEFINITION}get effectiveTimeZone(){const e=this.template;let t=e.formTimeZone??"system";return e.layerTimeZone?e.layerTimeZone===_?t=V:e.formTimeZone===_&&(t=e.layerTimeZone):e.formTimeZone===_&&(t=V),t}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const e=this.codedValueDomainOptions,{value:t}=this,i=null==t||t===F||e.some(e=>e.value===t)?[]:[{name:`${t}`,value:t}];return[e,i]}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const r of this.features){if(null==i.getExpressionExecutorsForLayer(r.layer)?.requiredExpression)continue;t=!1;const n=this._lookupEvaluatedExpression(r,"required");"success"===n?.status?e=e||!0===n.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const e=this.template.input;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"datetimeoffset-picker"!==t||(i=o(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:r}=e;i={max:null!=t&&w(t)?t.getTime():null,min:null!=r&&w(r)?r.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:r}=this;if("date"!==this.dataType)return{};if(!r)return this._fieldShouldHaveDomain?{}:e;const n=l(i,r);if(!n)return e;const{max:a,min:s,rawMax:o,rawMin:u}=e,{type:m}=t.field;if("date"===m){const{max:e,min:t}=n;return{max:g(a)&&(null===e||null!=e&&a<=e)?a:e??null,min:g(s)&&(null===t||null!=t&&s>=t)?s:t??null}}if("date-only"===m||"time-only"===m||"timestamp-offset"===m){const{max:e,min:t,rawMax:i,rawMin:r}=n,l=g(a)&&o&&(null==e||a<e),m=g(s)&&u&&(null==t||s>t);return{max:l?a:e,min:m?s:t,rawMax:l?o:i,rawMin:m?u:r}}return{}}async setValueFromUser(e){this.userHasChangedValue=!0;const t=[],i=this.fieldName;for(const r of this.features)r.getAttribute(i)!==e&&t.push(r);this._setValue(e),await this.expressionsManager.valueChanged(i,t)}_setValue(e){const{fieldName:t}=this;for(const i of this.features)i.setAttribute(t,e)}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:r,range:n}=this,a=[];for(const s of this.features){const{layer:l}=s,o=l.getField(t)??this.field,u=l.getFieldDomain(t,{feature:s.plainGraphic}),m=this.calculateDomain([u]),p=this._requiredForFeature(s),d=s.getAttribute(t),f=R(d,{dataType:e,domain:m,field:o,maxLength:i,minLength:r,range:n,required:p});f&&a.push({error:f,feature:s.source})}return a}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&u(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let r=null;switch(t?.type){case"range":r=this._intersectRangeDomains(e);break;case"coded-value":r=this._intersectCodedValueDomains(e)}return r}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const n of e)for(const[e,i]of t){n.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let r=t;if(i){r=new Map;for(const[e,n]of i)t.has(e)&&r.set(e,n)}const s=Array.from(r.entries()).map(([e,t])=>new n({code:e,name:t}));return s.length?new a({codedValues:s}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let r=1;r<e.length;r++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[r])}if(t&&!u(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof s){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:r}=this;return h(r)||d(r)||c(r)?o(r,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new s,r=this._getMinMaxFromRangeDomain(e),n=this._getMinMaxFromRangeDomain(t),{field:a}=this,l=this._getValidRangeValue(r.min,-1/0),o=this._getValidRangeValue(r.max,1/0),u=this._getValidRangeValue(n.min,-1/0),m=this._getValidRangeValue(n.max,1/0);return i.minValue=Math.max(l,u),i.maxValue=Math.min(o,m),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((h(a)||d(a)||c(a))&&(i.minValue=Number(r.min)>Number(n.min)?r.rawMin:n.rawMin,i.maxValue=Number(r.max)<Number(n.max)?r.rawMax:n.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return g(e)?e:t}};e([i()],S.prototype,"dataType",null),e([i()],S.prototype,"domain",null),e([i()],S.prototype,"distinctValues",null),e([i()],S.prototype,"editable",null),e([i()],S.prototype,"effectiveVisible",null),e([i()],S.prototype,"effectiveVisibilityCode",null),e([i()],S.prototype,"errors",null),e([i()],S.prototype,"featuresHaveSameValue",null),e([i()],S.prototype,"field",null),e([i()],S.prototype,"fieldName",null),e([i()],S.prototype,"group",void 0),e([i()],S.prototype,"invalidFeatures",null),e([i()],S.prototype,"isSubtypeField",null),e([i()],S.prototype,"showNoValueOptionEnabled",null),e([i()],S.prototype,"showNoValueLabel",null),e([i()],S.prototype,"includeTime",null),e([i()],S.prototype,"includeTimeOffset",null),e([i()],S.prototype,"maxLength",null),e([i()],S.prototype,"minLength",null),e([i()],S.prototype,"range",null),e([i()],S.prototype,"required",null),e([i()],S.prototype,"submittable",null),e([i({readOnly:!0})],S.prototype,"type",void 0),e([i()],S.prototype,"userHasChangedValue",void 0),e([i()],S.prototype,"valid",null),e([i()],S.prototype,"value",null),e([i()],S.prototype,"visibilityCode",null),e([i()],S.prototype,"effectiveTimeZone",null),e([i()],S.prototype,"_evaluatedRequiredExpression",null),e([i()],S.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([i()],S.prototype,"_allDomains",null),e([i()],S.prototype,"_fieldShouldHaveDomain",null),e([i()],S.prototype,"_dateFormRange",null),e([i()],S.prototype,"_dateRange",null),S=e([r("esri.widgets.BatchAttributeForm.inputs.FieldInput")],S);const L=S;export{L as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{InputBase as o}from"./InputBase.js";import{visibilityCodeToBoolean as r}from"./support/inputUtils.js";let i=class extends o{constructor(t){super(t),this.inputs=[],this.type="group"}initialize(){for(const t of this.inputs)t.group=this}get open(){return"expanded"===this.template.initialState}set open(t){this._override("open",t)}get visible(){return r(this.visibilityCode)&&this.inputs.some(t=>t.visible)}visibleForFeature(t){if(null==this.template.getExpressionExecutorsForLayer(t.layer)?.visibilityExpression)return!0;const s=this._lookupEvaluatedExpression(t,"visibility");return"success"===s?.status&&!0===s.result}};t([s()],i.prototype,"inputs",void 0),t([s({readOnly:!0})],i.prototype,"type",void 0),t([s()],i.prototype,"open",null),t([s()],i.prototype,"visible",null),i=t([e("esri.widgets.BatchAttributeForm.inputs.GroupInput")],i);export{
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{InputBase as o}from"./InputBase.js";import{visibilityCodeToBoolean as r}from"./support/inputUtils.js";let i=class extends o{constructor(t){super(t),this.inputs=[],this.type="group"}initialize(){for(const t of this.inputs)t.group=this}get open(){return"expanded"===this.template.initialState}set open(t){this._override("open",t)}get visible(){return r(this.visibilityCode)&&this.inputs.some(t=>t.visible)}visibleForFeature(t){if(null==this.template.getExpressionExecutorsForLayer(t.layer)?.visibilityExpression)return!0;const s=this._lookupEvaluatedExpression(t,"visibility");return"success"===s?.status&&!0===s.result}};t([s()],i.prototype,"inputs",void 0),t([s({readOnly:!0})],i.prototype,"type",void 0),t([s()],i.prototype,"open",null),t([s()],i.prototype,"visible",null),i=t([e("esri.widgets.BatchAttributeForm.inputs.GroupInput")],i);const p=i;export{p as default};
|