@arcgis/core 4.33.0-next.20250428 → 4.33.0-next.20250430
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/AreaMeasurementAnalysis.js +1 -1
- package/applications/Components/baUtils.js +5 -0
- package/assets/components/assets/icon/mosaicMethodBlend16.json +1 -1
- package/assets/components/assets/icon/mosaicMethodBlend24.json +1 -1
- package/assets/components/assets/icon/mosaicMethodBlend32.json +1 -1
- package/assets/components/assets/icon/mosaicMethodNorthWest32.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{9a1c058d3ecd1db0e996.js → 0c338364cb55afdbd580.js} +1 -1
- package/assets/esri/core/workers/chunks/{4351b3e54b309935faed.js → 173737c60fa54f7d82bb.js} +1 -1
- package/assets/esri/core/workers/chunks/{90dc783a617ff053e862.js → 181ad3cee0b30a72e7c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{6d230c55cde66ee905b3.js → 1a0d4b7de2f98ff9cc01.js} +1 -1
- package/assets/esri/core/workers/chunks/210e057fe5e66abea984.js +1 -0
- package/assets/esri/core/workers/chunks/{9850ff14bd9c7da81c65.js → 23c76963481e38f39653.js} +1 -1
- package/assets/esri/core/workers/chunks/2433b22749a088735262.js +1 -0
- package/assets/esri/core/workers/chunks/278280121528fa1059de.js +1 -0
- package/assets/esri/core/workers/chunks/2ad47c0ba1680f7d5e03.js +1 -0
- package/assets/esri/core/workers/chunks/2c3920ad82b9d86c3f05.js +1 -0
- package/assets/esri/core/workers/chunks/{4da99f058cca83937e9b.js → 2c92f6f268aa2de5432c.js} +1 -1
- package/assets/esri/core/workers/chunks/37619d28b0441199c320.js +1 -0
- package/assets/esri/core/workers/chunks/{92836e3a2c5226296fec.js → 3a205f87f100832ef9f5.js} +1 -1
- package/assets/esri/core/workers/chunks/543eb46b55cacd6e1dbc.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{2fd5b48976cefe7cc0ab.js → 581180668e0229dcdc14.js} +1 -1
- package/assets/esri/core/workers/chunks/{c054198c6438cb57f188.js → 5c2299f22a69e58cc4dd.js} +1 -1
- package/assets/esri/core/workers/chunks/60eb6dd09080da5653a1.js +1 -0
- package/assets/esri/core/workers/chunks/6210346dc9d064ac90af.js +1 -0
- package/assets/esri/core/workers/chunks/{3cf001abca8ad933bccf.js → 670a66617249f2d15a62.js} +2 -2
- package/assets/esri/core/workers/chunks/{3cf001abca8ad933bccf.js.LICENSE.txt → 670a66617249f2d15a62.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/6b9110ec7da0fef1be31.js +1 -0
- package/assets/esri/core/workers/chunks/710e03feaa25e357f17a.js +1 -0
- package/assets/esri/core/workers/chunks/{a6de903f22f76d875005.js → 7496c4c33c2d8f60a434.js} +1 -1
- package/assets/esri/core/workers/chunks/7b4523ab392966624d97.js +2 -0
- package/assets/esri/core/workers/chunks/{30551c1d3e4fa7be86c1.js.LICENSE.txt → 7b4523ab392966624d97.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{50ffb2620cdbcfd75723.js → 81b3351ea9627bb631d4.js} +1 -1
- package/assets/esri/core/workers/chunks/84d7ed2cf5fe23a0888f.js +1 -0
- package/assets/esri/core/workers/chunks/84f972d7851d982701a0.js +319 -0
- package/assets/esri/core/workers/chunks/{f52e597dca4b32a81881.js → 867c6c5b2ee1db977c99.js} +1 -1
- package/assets/esri/core/workers/chunks/{c5d786166a5609b85276.js → 8a87c181b85d0b86b9bb.js} +2 -2
- package/assets/esri/core/workers/chunks/{c5d786166a5609b85276.js.LICENSE.txt → 8a87c181b85d0b86b9bb.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{a0c51c4c30a5f749dfc6.js → 8bf2e2fe5e3e8b4a1fa0.js} +1 -1
- package/assets/esri/core/workers/chunks/8c8d812a7f2d29c29676.js +1 -0
- package/assets/esri/core/workers/chunks/{213adc87c843d627c5d6.js → 8f2e0277c66247bd40b4.js} +1 -1
- package/assets/esri/core/workers/chunks/8fc5b1c17e841362dd15.js +1 -0
- package/assets/esri/core/workers/chunks/9cac00d4bfac14aaae12.js +1 -0
- package/assets/esri/core/workers/chunks/{a600194cfe26aedc21dd.js → 9d32f41f8f69b8a507c3.js} +1 -1
- package/assets/esri/core/workers/chunks/ac9c6779771ec855da79.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{899f197556b6ced6eddf.js → ad9b4e0164706c53b872.js} +2 -2
- package/assets/esri/core/workers/chunks/{9661ee8569ee208e6237.js → ada9694498549f56dff1.js} +1 -1
- package/assets/esri/core/workers/chunks/{1a6d2d090b643a87408a.js → b780c7062b1b18a5ae19.js} +1 -1
- package/assets/esri/core/workers/chunks/{72097a8247101018dcdf.js → ba4aafa8dfa76006c3e7.js} +1 -1
- package/assets/esri/core/workers/chunks/c2594024d72133d3ed7b.js +2 -0
- package/assets/esri/core/workers/chunks/{e524462c63834fae7e01.js.LICENSE.txt → c2594024d72133d3ed7b.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{360c8cff7c3b25d2b2d2.js → c607d618b64d3accecc4.js} +1 -1
- package/assets/esri/core/workers/chunks/{b8b8425e8b1246cdc86d.js → c6b0dda0540c9db12d0e.js} +1 -1
- package/assets/esri/core/workers/chunks/c819535525e9a27bae1f.js +39 -0
- package/assets/esri/core/workers/chunks/{87dcfbbcf290e0fa5c0f.js → cb25b45a6b385e60c68d.js} +315 -378
- package/assets/esri/core/workers/chunks/{577f24923fa4d08360e4.js → ce9de24cb96b56d20562.js} +2 -2
- package/assets/esri/core/workers/chunks/{577f24923fa4d08360e4.js.LICENSE.txt → ce9de24cb96b56d20562.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/d30fae6233d3426615ed.js +1 -0
- package/assets/esri/core/workers/chunks/d8dc922f7466300b668f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/d92ea6b0674f34206ab6.js +1 -0
- package/assets/esri/core/workers/chunks/{345993291540433d3d92.js → e93222c65bd28203ddf7.js} +1 -1
- package/assets/esri/core/workers/chunks/f1222bf7232c4a168312.js +1 -0
- package/assets/esri/themes/base/widgets/_Legend.scss +2 -1
- package/assets/esri/themes/base/widgets/_SelectionList.scss +5 -17
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/chunks/BloomBlur.glsl.js +1 -1
- package/chunks/BloomComposition.glsl.js +2 -2
- package/chunks/ChapmanAtmosphere.glsl.js +1 -1
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ComponentShader.glsl.js +43 -39
- package/chunks/DefaultMaterial.glsl.js +22 -22
- package/chunks/Fog.glsl.js +3 -3
- package/chunks/Haze.glsl.js +1 -1
- package/chunks/Path.glsl.js +22 -18
- package/chunks/RealisticTree.glsl.js +9 -9
- package/chunks/RibbonLine.glsl.js +1 -1
- package/chunks/ShadowCastAccumulate.glsl.js +5 -5
- package/chunks/ShadowHighlight.glsl.js +4 -4
- package/chunks/Terrain.glsl.js +1 -1
- package/chunks/Viewshed.glsl.js +1 -1
- package/core/Collection.js +1 -1
- package/core/CollectionFlattener.js +1 -1
- package/core/MemCache.js +1 -1
- package/geometry/support/PolylineBuilder.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +5 -0
- package/geometry/support/curves/circleUtils.js +5 -0
- package/geometry/support/curves/circularArcUtils.js +5 -0
- package/geometry/support/curves/closestPointOnCurve.js +5 -0
- package/geometry/support/curves/curveUtils.js +5 -0
- package/geometry/support/curves/densifyCurvedGeometry.js +5 -0
- package/geometry/support/curves/ellipticArc4Utils.js +5 -0
- package/geometry/support/curves/ellipticArc7Utils.js +5 -0
- package/geometry/support/curves/mathUtils.js +5 -0
- package/geometry/support/curves/splitCurveAtPoint.js +5 -0
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +485 -20
- package/layers/LinkChartLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/package.json +3 -3
- package/portal/schemas/definitions.js +1 -1
- package/request.js +1 -1
- package/rest/knowledgeGraph/GraphAddNamedTypesResult.js +5 -0
- package/rest/knowledgeGraph/GraphDeleteNamedTypeResult.js +5 -0
- package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +5 -0
- package/rest/knowledgeGraph/wasmInterface/wasmUtils.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/circuits/alterCircuit.js +5 -0
- package/rest/networks/circuits/createCircuit.js +5 -0
- package/rest/networks/circuits/deleteCircuits.js +5 -0
- package/rest/networks/circuits/queryCircuits.js +5 -0
- package/rest/networks/circuits/support/CircuitVerifyResult.js +5 -0
- package/rest/networks/circuits/support/CreateAlterCircuitParameters.js +5 -0
- package/rest/networks/circuits/support/DeleteCircuitsParameters.js +5 -0
- package/rest/networks/circuits/support/QueryCircuitsParameters.js +5 -0
- package/rest/networks/circuits/support/QueryCircuitsResult.js +5 -0
- package/rest/networks/circuits/support/VerifyCircuitsParameters.js +5 -0
- package/rest/networks/circuits/support/VerifyCircuitsResult.js +5 -0
- package/rest/networks/circuits/verifyCircuits.js +5 -0
- package/smartMapping/renderers/support/spikeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMOperators.js +1 -1
- package/symbols/cim/effects/EffectSuppress.js +5 -0
- package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VideoLayerView2D.js +1 -1
- package/views/2d/layers/graphics/GraphicStoreItem.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
- package/views/3d/environment/ChapmanAtmosphereTechniqueConfiguration.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/pipeline/FeatureProcessingContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/IconSymbolLayerRenderer.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/ObjectSymbolLayerRenderer.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/Point3DSymbolRenderer.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/SimpleFeatureRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/UniqueValueFeatureRenderer.js +1 -1
- package/views/3d/layers/graphics/pipeline/symbolization/factoryUtils.js +5 -0
- package/views/3d/layers/graphics/pipeline/symbolization/primitiveObjectUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/AnalyticalSkyModel.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +20 -19
- package/views/3d/webgl-engine/core/shaderLibrary/shading/FoamRendering.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Gamma.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRendering.glsl.js +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +30 -125
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +27 -0
- package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +28 -0
- package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
- package/views/3d/webgl-engine/effects/bloom/BloomRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/HazeTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/effects/weather/SnowCover.glsl.js +12 -0
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +9 -9
- package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ReadShadowMapConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ToneMapping.glsl.js +2 -20
- package/views/VideoView.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/webscene/support/FeatureReference.d.ts +4 -0
- package/webscene/support/FeatureReference.js +5 -0
- package/webscene/support/FeatureReferenceGlobalId.d.ts +4 -0
- package/webscene/support/FeatureReferenceGlobalId.js +5 -0
- package/webscene/support/FeatureReferenceId.d.ts +4 -0
- package/webscene/support/FeatureReferenceId.js +5 -0
- package/webscene/support/FeatureReferenceObjectId.d.ts +4 -0
- package/webscene/support/FeatureReferenceObjectId.js +5 -0
- package/webscene/support/LayerReference.d.ts +4 -0
- package/webscene/support/LayerReference.js +5 -0
- package/webscene/support/SlideElements.js +1 -1
- package/webscene/support/SlidePopupInfo.d.ts +4 -0
- package/webscene/support/SlidePopupInfo.js +5 -0
- package/webscene/support/featureReferenceUtils.js +5 -0
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/FeatureForm/EditableInput.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/widgets/support/SelectionList/FeatureItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/assets/esri/core/workers/chunks/27482132abb939a1cdb7.js +0 -1
- package/assets/esri/core/workers/chunks/2e3019ce49e972a815ca.js +0 -1
- package/assets/esri/core/workers/chunks/30551c1d3e4fa7be86c1.js +0 -2
- package/assets/esri/core/workers/chunks/3293b4041c222299428f.js +0 -1
- package/assets/esri/core/workers/chunks/335b539893569e3d7b82.js +0 -1
- package/assets/esri/core/workers/chunks/53eaad20c4f55dae21e0.js +0 -1
- package/assets/esri/core/workers/chunks/5ac3096139e3eafd0e1d.js +0 -1
- package/assets/esri/core/workers/chunks/626ba3a7dee952308566.js +0 -1
- package/assets/esri/core/workers/chunks/76575d2c1c56e37c1315.js +0 -319
- package/assets/esri/core/workers/chunks/7c4746f60332620f75c5.js +0 -1
- package/assets/esri/core/workers/chunks/8221f2e540abe1e0f048.js +0 -1
- package/assets/esri/core/workers/chunks/ae156b99e60a2bf940e4.js +0 -1
- package/assets/esri/core/workers/chunks/bf4947fe446dcb477031.js +0 -1
- package/assets/esri/core/workers/chunks/c6b08fdc0421258efcf5.js +0 -1
- package/assets/esri/core/workers/chunks/cd2927b922444880566d.js +0 -1
- package/assets/esri/core/workers/chunks/d3a74087e076a3ae76ca.js +0 -1
- package/assets/esri/core/workers/chunks/d44e99b4bb1cec6a922b.js +0 -1
- package/assets/esri/core/workers/chunks/e524462c63834fae7e01.js +0 -2
- package/assets/esri/core/workers/chunks/e64bc4533405af8554ae.js +0 -1
- package/assets/esri/core/workers/chunks/e64e0c3240f8e577a61c.js +0 -39
- package/assets/esri/core/workers/chunks/fd36b7aaf0d8e0c84471.js +0 -1
- package/geometry/support/curveUtils.js +0 -5
- package/geometry/support/densifyUtils.js +0 -5
- package/views/3d/layers/graphics/pipeline/symbolization/Factory.js +0 -5
- package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +0 -5
- package/views/3d/layers/graphics/pipeline/symbolization/TestSymbol.js +0 -5
- package/views/3d/webgl-engine/effects/bloom/BloomCompositionTechniqueConfiguration.js +0 -5
- package/widgets/support/InteractiveAnalysisViewModel.js +0 -5
package/widgets/FeatureForm.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import"../core/has.js";import i from"../core/Logger.js";import{createResolver as o}from"../core/promiseUtils.js";import s from"../core/ReactiveMap.js";import{watch as n,initial as a,whenOnce as r}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as c}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as u,getSubtypesFromLayer as p}from"../layers/support/layerUtils.js";import{isString as m}from"../support/guards.js";import h from"./Widget.js";import{Prompt as v}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as _}from"./Feature/support/featureUtils.js";import{css as g}from"./FeatureForm/css.js";import{isGroupInput as b,isFieldInput as f,isRelationshipInput as y,isTextElementInput as C,isUtilityNetworkAssociationInput as F,flattenInputs as w,isInputInGroupInput as R,isFieldElementWithInputType as k,getErrorMessageForFieldInput as I,getIconForFeature as O,isNumberFieldInput as N,subtypeChangeShouldPrompt as M}from"./FeatureForm/featureFormUtils.js";import L from"./FeatureForm/FeatureFormViewModel.js";import A from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as T}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as x,getIntlOptionsForField as D,numberingSystem as V,prepareISOFieldValueForDateComponents as S,prepareUnixFieldValueForDateComponents as U,normalizeTimeOnlyString as E,getISOFieldValueFromDateComponents as j,getUnixFieldValueFromDateComponents as P}from"./support/dateUtils.js";import{globalCss as $}from"./support/globalCss.js";import{Heading as H,incrementHeadingLevel as W}from"./support/Heading.js";import{setFocus as Z}from"./support/widgetUtils.js";import{messageBundle as G}from"./support/decorators/messageBundle.js";import{vmEvent as B}from"./support/decorators/vmEvent.js";import{tsx as K}from"./support/jsxFactory.js";import{substitute as q}from"../intl/substitute.js";import{formatNumber as z}from"../intl/number.js";const J="data-field-name";let Q=class extends h{constructor(e,t){super(e,t),this._associationsWidgetsMap=new s,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver((e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()}),{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new L,this.visibleElements=new A,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(u(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&_(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n((()=>this.feature),(()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),r((()=>!this.viewModel.updating)).then((()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0}))})),n((()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails]),(([e,t])=>{e&&(e.visibleElements.associationDetails=t)}),a),n((()=>this.groupDisplay),(()=>this._syncGroupInputStates())),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._inputsWithChanges.add(e))),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}})),n((()=>[this.viewModel.activeRelationshipInput,this._listObserverNode]),(()=>this._onObserverChange())),n((()=>this.viewModel.activeAssociationInput),(e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)})),n((()=>this.viewModel.inputs.filter(F)),(async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))}))])}loadDependencies(){return T({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return p(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return"form-field"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return K("div",{class:this.classes(g.base,$.widget,$.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return K("div",null,K("form",{class:g.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderHeader(),this._renderContent()),this._prompt?K(v,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&K(H,{key:"title",level:this.headingLevel},t),s=null!=i&&K("p",{class:g.description,key:"description"},i);return K("div",{class:g.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(t).filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return b(e)?this._renderGroup(e):f(e)?this._renderLabeledField(e):y(e)?this._renderRelationshipInput(e):C(e)?this._renderTextElementInput(e):F(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:K("div",{class:this.classes(g.description),id:t},e)}_renderGroup(e){const{disabled:t,formTemplate:i,headingLevel:o}=this,{description:s,id:n,inputs:a,label:r,open:l}=e,d=a.filter((e=>e.visible)),c=this.viewModel.findField(this._focusedFieldName),u=c?.group===e,p="sequential"===this.groupDisplay;return K("calcite-block",{class:this.classes(g.group,p?g.groupSequential:null,u?g.groupActive:null,t?g.inputDisabled:null),collapsible:!0,"data-group":e,description:s||void 0,disabled:t,heading:r??"",headingLevel:i?.title?W(o):o,id:n,key:n,open:l,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},d.map((e=>this._renderInput(e))))}_getFocusableInput(e,t){const i=w(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(b(t)){const e=t.inputs.find((e=>e.visible));o=e?i.indexOf(e):0}else{let s;if(R(t)&&!t.group.open){const i=t.group.inputs.filter(f);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&f(e))return e}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:o,layer:s,required:n}=e,a={"aria-label":n?q(this.messages.requiredFieldLabel,{name:o}):o,class:g.label,key:`${s.id}-${i.uid}-${e.name}`},r=[K("div",{class:g.labelTextContent,key:"labelTextContainer"},o,n?K("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==t?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===t&&"coded-value"!==e.domain?.type?K("label",{...a},r):K("calcite-label",{...a},r)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?K("calcite-input",{...t,loading:e.updating,type:"textarea",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)}):K("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):K("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=c(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return K("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.type){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,x(i,t.value,{timeZone:this.timeZone,...D(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return K("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[J],key:`${a}-date-input`,max:m(l)?l:void 0,min:m(d)?d:void 0,numberingSystem:V,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return K("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[J],key:`${n}-time-input`,numberingSystem:V,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:V,overlayPositioning:"fixed",readOnly:d,[J]:i,onfocus:this._onComponentFocus},m=S(c,s),h=S(u,s),v=S(a,s);return K("div",{class:g.dateInputContainer,key:`${l}-date-time-container`},K("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),K("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?K("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:V,overlayPositioning:"fixed",readOnly:c,[J]:o,onfocus:this._onComponentFocus},m=U(n,u),h=U(l,u),v=U(d,u);return K("div",{class:g.dateInputContainer,key:`${r}-date-time-container`},K("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?K("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return K("calcite-input",{...i,class:this.classes(g.fieldInput,g.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.arcadeEditType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return K("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,disabled:i.readOnly,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map((e=>e.map((({name:e,value:t})=>K("calcite-combobox-item",{key:`#${t}`,selected:i===t,textLabel:e,value:`${t}`}))))),u=[];d.length>0&&u.push(K("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(K("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(K("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.arcadeEditType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(K("calcite-combobox-item",{key:"empty-option",selected:h,textLabel:e.showNoValueLabel||s.empty,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map((({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i})));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return K("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:g.inputRadioGroup,"data-field-name":i[J],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!k(e.element,"switch")&&i===e.element.input.onValue;return K("calcite-switch",{...t,checked:o,class:g.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return K("calcite-label",{class:g.inputRadioLabel,key:e,layout:"inline"},K("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:g.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?I(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?K("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?K("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const t=this.messages;return K("calcite-list-item",{description:q(t.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:t.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},K("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o}=e,{messages:s,callbacks:n}=this;if(t&&n?.addRelatedRecord&&o)return K("calcite-button",{alignment:"center",appearance:"outline-fill",class:g.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?s.addRecord:s.addFeature)}_renderRelatedRecordListItem(e,t){const{feature:i,description:o,title:s}=e,{feature:n,callbacks:a}=this,{highlightHelper:r}=this.viewModel,l=()=>{r?.removeAll(),a?.editRelatedRecord&&n&&a.editRelatedRecord({parentFeature:n,relationshipId:t,relatedFeature:i})},d=r?()=>r.add(i):void 0,c=r?()=>r.remove(i):void 0;return K("calcite-list-item",{bind:this,description:o,key:`${t}-${i.uid}`,label:s,onclick:l,onmouseenter:d,onmouseleave:c,value:s},K("calcite-icon",{icon:O(i),slot:"content-start"}),K("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled||!e.editable)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return K("calcite-label",{class:this.classes(g.label,g.relatedRecordsLabel),key:`relationship-${t}-container`},K("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return K("calcite-list",{displayMode:"flat",label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map((t=>this._renderCategory(e,t))),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){const{count:i,name:o,value:s}=t,n=z(i);return K("calcite-list-item",{key:`${o}-${s}`,label:o,onCalciteListItemSelect:()=>this._selectCategory(e,t)},K("calcite-chip",{label:n,scale:"s",slot:"content-end"},n),K("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const t=this.messages;return K("calcite-list-item",{description:q(t.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:t.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},K("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return K("div",{class:g.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},K("span",null,e.label),t?K("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t}=e;return K("calcite-list",{class:g.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map((e=>this._renderRelatedRecordListItem(e,t))),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:t}=this,i=e.relatedLayerIsTable?t.noOriginKeyRecord:t.noOriginKeyFeature,o=e.relationship?.keyField,s=this.viewModel.findField(o),n=e.layer?.fieldsIndex.get(o),a=s?.label||n?.alias||o,r=q(i,{relatedLayerName:e.relatedLayer?.title,originKeyField:a});return K("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},K("div",{slot:"message"},r))}_renderNoRelatedRecordsNotice(){return K("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},K("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return K("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:g.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return K("div",{class:g.textElement,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(g.fieldInput,h?g.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[J]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(J))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver((()=>{switch(e.value=void 0,t.field.type){case"date":e.value=U(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=S(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)}));i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);N(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,R(i)&&(i.group.open=!0),Z(e))}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=E(r),l=E(e.value)):l="timestamp-offset"===o?null!=e.value?j({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?P({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&M(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,t){const{value:i,name:s}=e,{messages:n,viewModel:a,messagesCommon:r,_subtypes:l}=this;if(this._updateFieldValue(s,t),!l?.length)return;const d=l.find((e=>e.code===t)),c=l.find((e=>e.code===i))?.name??`${i}`;if(!d)return;const u=o();a.pendingSubtypeChoice=u;let p="update-fields";const m=[{label:n.subtypes.useDefaultValuesOption,value:"update-fields"},{label:n.subtypes.keepCurrentValuesOption,value:"keep-existing"}],h={context:"info",title:n.subtypes.changeWarningTitle,message:q(n.subtypes.changeWarning,{originalType:c,newType:d.name}),radios:m,defaultRadioSelection:"update-fields",onRadioSelection:e=>p=e,actions:{primary:{label:r.apply,action:()=>u.resolve(p),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>u.resolve("undo")}},cancel:()=>u.reject()};try{this.showPrompt(h);switch(await u.promise){case"update-fields":a.applySubtypeDefaults(d),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,i)}}finally{a.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&R(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>null!=t)));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return k(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:o}=e;0===o.length&&t&&"selected"in t?t.selected=!0:i.getLogger(this).warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupToggle(e,t){e.open?(t.open=!0,this._focusedFieldName=this._getFocusableInput("forward",t)?.name||null,this._attemptFocusOnNextRender=!0,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach((e=>{e!==t&&(e.open=!1)}))):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter((e=>e.open));0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach((e=>e.open=!1))}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([l()],Q.prototype,"_listObserverNode",void 0),e([l()],Q.prototype,"_relatedRecordsEnabled",null),e([l()],Q.prototype,"_utilityNetworkAssociationsEnabled",null),e([l()],Q.prototype,"_prompt",void 0),e([l()],Q.prototype,"_subtypes",null),e([l()],Q.prototype,"associationId",null),e([l()],Q.prototype,"associatedLayer",null),e([l()],Q.prototype,"disabled",null),e([l()],Q.prototype,"feature",null),e([l()],Q.prototype,"_featureFormUNAssociationList",void 0),e([l()],Q.prototype,"formTemplate",null),e([l()],Q.prototype,"groupDisplay",void 0),e([l()],Q.prototype,"headingLevel",void 0),e([l()],Q.prototype,"icon",null),e([l()],Q.prototype,"label",null),e([l()],Q.prototype,"layer",null),e([l()],Q.prototype,"map",null),e([l(),G("esri/widgets/FeatureForm/t9n/FeatureForm")],Q.prototype,"messages",void 0),e([l(),G("esri/t9n/common")],Q.prototype,"messagesCommon",void 0),e([l(),G("esri/widgets/Feature/t9n/Feature")],Q.prototype,"messagesFeature",void 0),e([l(),G("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],Q.prototype,"messagesTemplates",void 0),e([l()],Q.prototype,"callbacks",null),e([l()],Q.prototype,"relationshipId",null),e([l()],Q.prototype,"spatialReference",null),e([l()],Q.prototype,"strict",null),e([l()],Q.prototype,"timeZone",null),e([l()],Q.prototype,"showPrompt",null),e([l()],Q.prototype,"clearPrompt",null),e([l(),B(["value-change","submit"])],Q.prototype,"viewModel",void 0),e([l({type:A,nonNullable:!0})],Q.prototype,"visibleElements",void 0),e([l()],Q.prototype,"test",null),Q=e([d("esri.widgets.FeatureForm")],Q);const X=Q;export{X as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import"../core/has.js";import i from"../core/Logger.js";import{createResolver as o}from"../core/promiseUtils.js";import s from"../core/ReactiveMap.js";import{watch as n,initial as a,whenOnce as r}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{isIntegerField as c}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as u,getSubtypesFromLayer as p}from"../layers/support/layerUtils.js";import{isString as m}from"../support/guards.js";import h from"./Widget.js";import{Prompt as v}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as _}from"./Feature/support/featureUtils.js";import{css as g}from"./FeatureForm/css.js";import{isGroupInput as b,isFieldInput as f,isRelationshipInput as y,isTextElementInput as C,isUtilityNetworkAssociationInput as F,flattenInputs as w,isInputInGroupInput as R,isFieldElementWithInputType as k,getErrorMessageForFieldInput as I,getIconForFeature as O,isNumberFieldInput as N,subtypeChangeShouldPrompt as M}from"./FeatureForm/featureFormUtils.js";import L from"./FeatureForm/FeatureFormViewModel.js";import A from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as T}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as x,getIntlOptionsForField as D,numberingSystem as V,prepareISOFieldValueForDateComponents as S,prepareUnixFieldValueForDateComponents as U,normalizeTimeOnlyString as E,getISOFieldValueFromDateComponents as j,getUnixFieldValueFromDateComponents as P}from"./support/dateUtils.js";import{globalCss as $}from"./support/globalCss.js";import{Heading as H,incrementHeadingLevel as W}from"./support/Heading.js";import{setFocus as Z}from"./support/widgetUtils.js";import{messageBundle as G}from"./support/decorators/messageBundle.js";import{vmEvent as B}from"./support/decorators/vmEvent.js";import{tsx as K}from"./support/jsxFactory.js";import{substitute as q}from"../intl/substitute.js";import{formatNumber as z}from"../intl/number.js";const J="data-field-name";let Q=class extends h{constructor(e,t){super(e,t),this._associationsWidgetsMap=new s,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver((e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()}),{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new L,this.visibleElements=new A,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(u(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&_(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n((()=>this.feature),(()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),r((()=>!this.viewModel.updating)).then((()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0}))})),n((()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails]),(([e,t])=>{e&&(e.visibleElements.associationDetails=t)}),a),n((()=>this.groupDisplay),(()=>this._syncGroupInputStates())),this.on("submit",(e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach((e=>this._inputsWithChanges.add(e))),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}})),n((()=>[this.viewModel.activeRelationshipInput,this._listObserverNode]),(()=>this._onObserverChange())),n((()=>this.viewModel.activeAssociationInput),(e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)})),n((()=>this.viewModel.inputs.filter(F)),(async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))}))])}loadDependencies(){return T({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return p(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return"form-field"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return K("div",{class:this.classes(g.base,$.widget,$.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return K("div",null,K("form",{class:g.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderHeader(),this._renderContent()),this._prompt?K(v,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&K(H,{key:"title",level:this.headingLevel},t),s=null!=i&&K("p",{class:g.description,key:"description"},i);return K("div",{class:g.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(t).filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return b(e)?this._renderGroup(e):f(e)?this._renderLabeledField(e):y(e)?this._renderRelationshipInput(e):C(e)?this._renderTextElementInput(e):F(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:K("div",{class:this.classes(g.description),id:t},e)}_renderGroup(e){const{disabled:t,formTemplate:i,headingLevel:o}=this,{description:s,id:n,inputs:a,label:r,open:l}=e,d=a.filter((e=>e.visible)),c=this.viewModel.findField(this._focusedFieldName),u=c?.group===e,p="sequential"===this.groupDisplay;return K("calcite-block",{class:this.classes(g.group,p?g.groupSequential:null,u?g.groupActive:null,t?g.inputDisabled:null),collapsible:!0,"data-group":e,description:s||void 0,disabled:t,heading:r??"",headingLevel:i?.title?W(o):o,id:n,key:n,open:l,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},d.map((e=>this._renderInput(e))))}_getFocusableInput(e,t){const i=w(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(b(t)){const e=t.inputs.find((e=>e.visible));o=e?i.indexOf(e):0}else{let s;if(R(t)&&!t.group.open){const i=t.group.inputs.filter(f);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&f(e))return e}return null}_renderLabeledField(e){const{dataType:t,feature:i,label:o,layer:s,required:n}=e,a={"aria-label":n?q(this.messages.requiredFieldLabel,{name:o}):o,class:g.label,key:`${s.id}-${i.uid}-${e.name}`},r=[K("div",{class:g.labelTextContent,key:"labelTextContainer"},o,n?K("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==t?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===t&&"coded-value"!==e.domain?.type?K("label",{...a},r):K("calcite-label",{...a},r)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?K("calcite-input",{...t,loading:e.updating,type:"textarea",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)}):K("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):K("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=c(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return K("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.type){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,x(i,t.value,{timeZone:this.timeZone,...D(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return K("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[J],key:`${a}-date-input`,max:m(l)?l:void 0,min:m(d)?d:void 0,numberingSystem:V,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return K("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[J],key:`${n}-time-input`,numberingSystem:V,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:V,overlayPositioning:"fixed",readOnly:d,[J]:i,onfocus:this._onComponentFocus},m=S(c,s),h=S(u,s),v=S(a,s);return K("div",{class:g.dateInputContainer,key:`${l}-date-time-container`},K("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),K("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?K("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:V,overlayPositioning:"fixed",readOnly:c,[J]:o,onfocus:this._onComponentFocus},m=U(n,u),h=U(l,u),v=U(d,u);return K("div",{class:g.dateInputContainer,key:`${r}-date-time-container`},K("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?K("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return K("calcite-input",{...i,class:this.classes(g.fieldInput,g.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.editType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return K("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,disabled:i.readOnly,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map((e=>e.map((({name:e,value:t})=>K("calcite-combobox-item",{key:`#${t}`,selected:i===t,textLabel:e,value:`${t}`}))))),u=[];d.length>0&&u.push(K("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(K("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(K("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.editType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(K("calcite-combobox-item",{key:"empty-option",selected:h,textLabel:e.showNoValueLabel||s.empty,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map((({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i})));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return K("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:g.inputRadioGroup,"data-field-name":i[J],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!k(e.element,"switch")&&i===e.element.input.onValue;return K("calcite-switch",{...t,checked:o,class:g.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return K("calcite-label",{class:g.inputRadioLabel,key:e,layout:"inline"},K("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:g.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?I(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?K("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?K("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const t=this.messages;return K("calcite-list-item",{description:q(t.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:t.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},K("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o}=e,{messages:s,callbacks:n}=this;if(t&&n?.addRelatedRecord&&o)return K("calcite-button",{alignment:"center",appearance:"outline-fill",class:g.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?s.addRecord:s.addFeature)}_renderRelatedRecordListItem(e,t){const{feature:i,description:o,title:s}=e,{feature:n,callbacks:a}=this,{highlightHelper:r}=this.viewModel,l=()=>{r?.removeAll(),a?.editRelatedRecord&&n&&a.editRelatedRecord({parentFeature:n,relationshipId:t,relatedFeature:i})},d=r?()=>r.add(i):void 0,c=r?()=>r.remove(i):void 0;return K("calcite-list-item",{bind:this,description:o,key:`${t}-${i.uid}`,label:s,onclick:l,onmouseenter:d,onmouseleave:c,value:s},K("calcite-icon",{icon:O(i),slot:"content-start"}),K("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled||!e.editable)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return K("calcite-label",{class:this.classes(g.label,g.relatedRecordsLabel),key:`relationship-${t}-container`},K("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return K("calcite-list",{displayMode:"flat",label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map((t=>this._renderCategory(e,t))),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){const{count:i,name:o,value:s}=t,n=z(i);return K("calcite-list-item",{key:`${o}-${s}`,label:o,onCalciteListItemSelect:()=>this._selectCategory(e,t)},K("calcite-chip",{label:n,scale:"s",slot:"content-end"},n),K("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const t=this.messages;return K("calcite-list-item",{description:q(t.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:t.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},K("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return K("div",{class:g.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},K("span",null,e.label),t?K("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t}=e;return K("calcite-list",{class:g.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map((e=>this._renderRelatedRecordListItem(e,t))),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:t}=this,i=e.relatedLayerIsTable?t.noOriginKeyRecord:t.noOriginKeyFeature,o=e.relationship?.keyField,s=this.viewModel.findField(o),n=e.layer?.fieldsIndex.get(o),a=s?.label||n?.alias||o,r=q(i,{relatedLayerName:e.relatedLayer?.title,originKeyField:a});return K("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},K("div",{slot:"message"},r))}_renderNoRelatedRecordsNotice(){return K("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},K("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return K("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:g.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return K("div",{class:g.textElement,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(g.fieldInput,h?g.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[J]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(J))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver((()=>{switch(e.value=void 0,t.field.type){case"date":e.value=U(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=S(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)}));i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);N(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,R(i)&&(i.group.open=!0),Z(e))}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=E(r),l=E(e.value)):l="timestamp-offset"===o?null!=e.value?j({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?P({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&M(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,t){const{value:i,name:s}=e,{messages:n,viewModel:a,messagesCommon:r,_subtypes:l}=this;if(this._updateFieldValue(s,t),!l?.length)return;const d=l.find((e=>e.code===t)),c=l.find((e=>e.code===i))?.name??`${i}`;if(!d)return;const u=o();a.pendingSubtypeChoice=u;let p="update-fields";const m=[{label:n.subtypes.useDefaultValuesOption,value:"update-fields"},{label:n.subtypes.keepCurrentValuesOption,value:"keep-existing"}],h={context:"info",title:n.subtypes.changeWarningTitle,message:q(n.subtypes.changeWarning,{originalType:c,newType:d.name}),radios:m,defaultRadioSelection:"update-fields",onRadioSelection:e=>p=e,actions:{primary:{label:r.apply,action:()=>u.resolve(p),type:"positive"},secondary:{label:r.cancel,type:"neutral",action:()=>u.resolve("undo")}},cancel:()=>u.reject()};try{this.showPrompt(h);switch(await u.promise){case"update-fields":a.applySubtypeDefaults(d),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,i)}}finally{a.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&R(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter((([e,t])=>null!=t)));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return k(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:o}=e;0===o.length&&t&&"selected"in t?t.selected=!0:i.getLogger(this).warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupToggle(e,t){e.open?(t.open=!0,this._focusedFieldName=this._getFocusableInput("forward",t)?.name||null,this._attemptFocusOnNextRender=!0,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach((e=>{e!==t&&(e.open=!1)}))):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter((e=>e.open));0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach((e=>e.open=!1))}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([l()],Q.prototype,"_listObserverNode",void 0),e([l()],Q.prototype,"_relatedRecordsEnabled",null),e([l()],Q.prototype,"_utilityNetworkAssociationsEnabled",null),e([l()],Q.prototype,"_prompt",void 0),e([l()],Q.prototype,"_subtypes",null),e([l()],Q.prototype,"associationId",null),e([l()],Q.prototype,"associatedLayer",null),e([l()],Q.prototype,"disabled",null),e([l()],Q.prototype,"feature",null),e([l()],Q.prototype,"_featureFormUNAssociationList",void 0),e([l()],Q.prototype,"formTemplate",null),e([l()],Q.prototype,"groupDisplay",void 0),e([l()],Q.prototype,"headingLevel",void 0),e([l()],Q.prototype,"icon",null),e([l()],Q.prototype,"label",null),e([l()],Q.prototype,"layer",null),e([l()],Q.prototype,"map",null),e([l(),G("esri/widgets/FeatureForm/t9n/FeatureForm")],Q.prototype,"messages",void 0),e([l(),G("esri/t9n/common")],Q.prototype,"messagesCommon",void 0),e([l(),G("esri/widgets/Feature/t9n/Feature")],Q.prototype,"messagesFeature",void 0),e([l(),G("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],Q.prototype,"messagesTemplates",void 0),e([l()],Q.prototype,"callbacks",null),e([l()],Q.prototype,"relationshipId",null),e([l()],Q.prototype,"spatialReference",null),e([l()],Q.prototype,"strict",null),e([l()],Q.prototype,"timeZone",null),e([l()],Q.prototype,"showPrompt",null),e([l()],Q.prototype,"clearPrompt",null),e([l(),B(["value-change","submit"])],Q.prototype,"viewModel",void 0),e([l({type:A,nonNullable:!0})],Q.prototype,"visibleElements",void 0),e([l()],Q.prototype,"test",null),Q=e([d("esri.widgets.FeatureForm")],Q);const X=Q;export{X as default};
|
package/widgets/FeatureTable.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{watch as i,sync as l,initial as o,on as n}from"../core/reactiveUtils.js";import{formatFileSize as s}from"../core/unitFormatUtils.js";import{property as a}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{isLayerFromCatalog as c}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as d,isMapImageLayer as h,isSubtypeGroupLayer as p}from"../layers/support/layerUtils.js";import m from"../tables/AttributeTableTemplate.js";import u from"./Widget.js";import{isSupportedImage as g,getCalciteIconForAttachment as w}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as b,Prompt as v}from"./Editor/components/Prompt.js";import y from"./FeatureTable/ColumnMenuVisibleElements.js";import f from"./FeatureTable/FeatureTableViewModel.js";import _ from"./FeatureTable/VisibleElements.js";import{isGroupColumn as M}from"./FeatureTable/support/columnUtils.js";import{loadFieldColumnComponents as A,isIFeatureTableSupportedLayer as C,isIFeatureTableSupportedLayerWithAttachments as S,getRelationshipIdsToShow as T}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as I}from"./support/globalCss.js";import{getIconForLayer as V}from"./support/iconUtils.js";import{renderingSanitizer as R,storeNode as x,discardNode as k}from"./support/widgetUtils.js";import{messageBundle as D}from"./support/decorators/messageBundle.js";import{vmEvent as P}from"./support/decorators/vmEvent.js";import{tsx as F}from"./support/jsxFactory.js";import{substitute as L}from"../intl/substitute.js";var j;const O="esri-feature-table",z=`${O}__prompt`,$=`${O}__attachments-view`,U={base:O,content:`${O}__content`,menuPopover:`${O}__menu-popover`,layerDropdownMenu:`${O}__layer-switcher-menu`,tableContainer:`${O}__table-container`,tableContainerWithAttachments:`${O}__table-container--attachments`,tableNavigation:`${O}__table-navigation`,attachmentsView:$,attachmentsViewContent:`${$}__content`,attachmentsViewDropArea:`${$}__drop-area`,attachmentsViewIcon:`${$}__icon`,attachmentsViewInformation:`${$}__information`,attachmentsViewList:`${$}__list`,attachmentsViewListFileSize:`${$}__list__filesize`,attachmentsViewListItemDelete:`${$}__list-item--delete`,attachmentsViewListThumbnail:`${$}__list__thumbnail`,expanded:`${O}__expanded`,collapsed:`${O}__collapsed`,promptContainer:z,promptHeader:`${z}__header`,promptHeading:`${z}__header__heading`,promptMessage:`${z}__message`,promptDivider:`${z}__divider`,promptActions:`${z}__actions`},B={attachment:"attachment",chevronDown:"chevron-down",chevronLeft:"chevron-left",chevronRight:"chevron-right",clearSelection:"clear-selection",downloadTo:"download-to",exclamationMarkTriangle:"exclamation-mark-triangle",exportToCSV:"file-csv",folderOpen:"folder-open",delete:"trash",launch:"launch",layers:"layers",moveUp:"move-up",plus:"plus",refresh:"refresh",replaceImage:"replace-image",save:"save",showAll:"selection-x",showColumn:"show-column",showSelected:"selection-filter",upload:"upload",zoomToSelection:"zoom-to-object"};let H=j=class extends u{constructor(e,t){super(e,t),this._attachmentsInput=null,this._columnVisibilityActions=new Map,this.attachmentsList=null,this.description=null,this.disabled=!1,this.menuConfig=null,this.title=null,this.viewModel=new f,this.visibleElements=new _,this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.addHandles([i((()=>[this.isQueryingOrSyncing,this.editingEnabled]),(()=>this.scheduleRender())),i((()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length]),(()=>{this.columns.forEach((e=>e.visibleElements=this._effectiveVisibleElements)),this.refreshCellContent()}),l),i((()=>this._effectiveVisibleElements.selectionColumn),(e=>{this.grid&&(this.grid.selectionColumnEnabled=e)}),o),n((()=>this.viewModel),"show-related-table",(e=>this._onShowRelatedTable(e))),i((()=>this.editingEnabled),(()=>{const{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)}))])}loadDependencies(){return Promise.all([E({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),alert:()=>import("@esri/calcite-components/dist/components/calcite-alert"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),pagination:()=>import("@esri/calcite-components/dist/components/calcite-pagination"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),b(),A()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _effectiveDescription(){const{description:e}=this;return null!=e?R.sanitize("function"==typeof e?e():e):void 0}get _effectiveLayers(){const{layer:e,layers:t}=this,i=t?.length?t.filter(C):[],l=i.length?i:[...this._viewLayers];return e&&!l.includes(e)&&l.push(e),l}get _effectiveTitle(){const{layer:e,messages:t,state:i,highlightIds:l,title:o,size:n}=this;if(o)return R.sanitize("function"==typeof o?o():o);if(!e)return t.noLayer;switch(i){case"disabled":return t.errorLayer;case"ready":case"loading":return t.loading;case"error":return t.errorData}return L(t.header,{title:R.sanitize(e.title),count:n,selected:l.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){const e=this.relatedTables.toArray(),t=1===e.length;return this.allRelatedTablesVisible?e:t?[e[0]]:this._shouldShowAttachmentsView?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return null!=this.attachmentsViewOptions.error}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnsVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||1===this.relatedTables.length&&!this._shouldShowAttachmentsView}get _shouldShowMenu(){const{header:e,menu:t}=this._effectiveVisibleElements;return!(!e||!t||!this._hasDefaultMenuItems&&!this._hasCustomMenuItems)}get _shouldShowAttachmentsView(){return!(null==this.attachmentsViewOptions.objectId&&!this.relatedTables.some((e=>null!=e.attachmentsViewOptions.objectId)))}get _showClearSelectionAction(){return!(!this.highlightIds.length||!this._effectiveVisibleElements.menuItems?.clearSelection||this.relatedTables.length)}get _showColumnsVisibilityAction(){const{header:e,menu:t,menuItems:i}=this._effectiveVisibleElements;return!(!(e&&t&&i?.toggleColumns)||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._shouldShowAttachmentsView)}get _showDeleteSelectionAction(){return!(!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete)||this.relatedTables.length)}get _showExportSelectionToCSVAction(){return!(!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length)||this.relatedTables.length)}get _showLayerDropdown(){return!(!this._effectiveLayers.length||!this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){const e=!!this.relatedTable||this._shouldShowAttachmentsView;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){const e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length)}get _showSelectedRecordsShowAllAction(){return!(!this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle||!this.objectIds.length||this.relatedTables.length)}get _showZoomToSelectionAction(){return!(!this.view||!this.highlightIds.length||this.effectiveTable.layer?.isTable||!this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){const e=this.view?.map;if(!e)return[];const t=new Set,i=e=>{!C(e)||p(e)||t.has(e)||(e.load(),t.add(e))},l=e=>{c(e)||"catalog-footprint"===e.type||(d(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):h(e)?(e.loadAll(),e.sublayers?.forEach(i),e.subtables?.forEach(i)):p(e)?(e.loadAll(),e.sublayers?.forEach(i)):i(e))};return e.allLayers.forEach(l),e.allTables.forEach(l),[...t.values()]}get grid(){return this.viewModel.grid}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return"table"}set icon(e){this._overrideIfSome("icon",e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTables(){return this.viewModel.relatedTables}set relatedTables(e){this.viewModel.relatedTables=e}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleElementsOverride(){const{attachmentsViewOptions:e,relatedTable:t,tableController:i,visibleElements:l}=this,{columnDescriptions:o,columnMenus:n,tooltips:s}=l,a=null!=e.objectId;if(t)return new _({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new y({sortAscending:!1,sortDescending:!1})});if(i){const e=i.relatedTable===this,t=i.allRelatedTablesVisible,r=e&&l.selectionColumn&&!t&&!a,c=e&&!t&&!a;return new _({columnDescriptions:o,columnMenus:n,tooltips:s,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,progress:!1,columnMenuItems:new y({sortAscending:c,sortDescending:c})})}return a?new _({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new y({sortAscending:!1,sortDescending:!1})}):null}clearSelectionFilter(){this.viewModel.clearSelectionFilter()}async deleteAttachments(e,t,i){null!=e&&t?.length&&(i?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}deleteSelection(e){return this.highlightIds.length?e?(this._showDeletePrompt(),this.scheduleRender(),Promise.resolve()):this.viewModel.deleteSelection():Promise.resolve()}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}filterBySelection(){this.viewModel.filterBySelection()}findColumn(e){return this.viewModel.findColumn(e)}goToPage(e){this.viewModel.goToPage(e)}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}zoomToSelection(){this.effectiveTable.viewModel.zoomToSelection()}render(){const{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:i,state:l}=this;return F("div",{bind:this,class:this.classes(U.base,I.widget)},F("calcite-panel",{bind:this,class:U.content,closable:e.close,description:this._effectiveDescription,disabled:this.disabled||"disabled"===l&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,loading:"loading"===l,menuOpen:!!i?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.currentTarget.closed=!1,this.emit("close")}},e.progress?F("calcite-progress",{type:t?"indeterminate":"determinate"}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError()),this._renderColumnVisibilityPopover(),this._renderPrompt())}_renderTables(){const{grid:e,relatedTables:t}=this,i=this.classes(U.tableContainer);if(t.length){const l=this.classes(U.base,this.allRelatedTablesVisible?U.expanded:U.collapsed,this._shouldShowAttachmentsView?U.tableContainerWithAttachments:void 0);return F("div",{class:i},F("calcite-panel",{overlayPositioning:"fixed"},F("div",null,[this._shouldShowGrid?F("div",{class:l},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map((e=>{const i=t.indexOf(e);return F("div",{class:l,key:`related-${i}`},e.render())})),,])))}return null!=this.attachmentsViewOptions.objectId?F("div",{class:i},F("calcite-panel",{overlayPositioning:"fixed"},F("div",null,[F("div",{class:this.classes(U.base,U.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[F("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return F("calcite-pagination",{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>this.goToPage(e.currentTarget.startItem-1)})}_renderError(){const{messages:e}=this;return F("calcite-alert",{autoClose:!0,autoCloseDuration:"fast",icon:B.exclamationMarkTriangle,kind:"danger",label:e.errorOccured,open:this._hasAttachmentsViewError,slot:"alerts",onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},F("span",{slot:"message"},e.errorOccured))}_renderPrompt(){return this.prompt?F(v,{...this.prompt,headingLevel:2}):void 0}_showDeletePrompt(){const{messages:e,messagesCommon:t}=this,i=L(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:i,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:t.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,t){const{messages:i,messagesCommon:l}=this,o=L(i.deleteAttachmentCount,{count:t.length});this.showPrompt({title:o,message:i.deleteAttachmentConfirmation,context:"danger",actions:{primary:{label:l.delete,action:async()=>{try{await this.deleteAttachments(e,t,!1)}finally{this.clearPrompt()}}},secondary:{label:l.cancel,action:()=>this.clearPrompt()}}})}async _onDeleteSelectionClick(){try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:l,text:o,clickFunction:n}=e;if(!i)return F("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:l??void 0,key:o,onclick:()=>n(),slot:"header-menu-actions",text:o,textEnabled:!0,title:o})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{messages:e}=this;return[this._showRefreshDataAction&&{icon:B.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:B.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:B.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:B.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:B.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:B.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:B.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(t).map((e=>e&&this._renderHeaderMenuAction(e)))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map((({disabled:e,hidden:t,icon:i,label:l,clickFunction:o})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:l,disabled:e,clickFunction:e=>o(e)})))??[]}_renderColumnVisibilityAction(){if(!this._showColumnsVisibilityAction)return[];const{_columnVisibilityActions:e,effectiveTable:t,id:i}=this,l=this.messages.toggleColumns;return F("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),appearance:"transparent",bind:this,disabled:t.menuConfig?.disabled,icon:B.showColumn,id:`${i}__toggle-columns-action`,slot:"header-actions-end",text:l},this._effectiveVisibleElements.tooltips?F("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",slot:"tooltip"},l):null)}_renderColumnVisibilityPopover(){if(!this._showColumnsVisibilityAction||this.effectiveTable.menuConfig?.disabled)return;const{effectiveTable:e}=this,t=this.messages.toggleColumns;return F("calcite-popover",{autoClose:!0,class:U.menuPopover,label:t,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:this._columnVisibilityActions.get(this.id)},F("calcite-list",{displayMode:"nested",filterEnabled:!0,filterPlaceholder:t,label:t,selectionMode:"multiple"},e.columns.toArray().map((t=>{const i=M(t)?t.columns?.map((t=>this._renderColumnListItem({column:t,table:e,ignoreSelect:!0}))):void 0;return this._renderColumnListItem({column:t,table:e,items:i})}))))}_renderColumnListItem(e){const{column:t,table:i,items:l,ignoreSelect:o}=e,{effectiveLabel:n,fieldName:s,hidden:a}=t;return F("calcite-list-item",{expanded:!(!l?.length||a)||void 0,key:`toggle-columns__item-${s}`,label:n,selected:!a,value:s,onCalciteListItemSelect:e=>{o&&e.stopPropagation(),i.toggleColumnVisibility(e.currentTarget.value)}},l)}_renderLayerDropdown(){const e=this.messages.selectALayer;return F("div",{class:U.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},F("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start"},F("calcite-action",{icon:B.layers,slot:"trigger",text:e,title:e}),F("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map(((e,t)=>this._renderLayerDropdownItem(e,t)))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return F("calcite-dropdown-item",{iconStart:i?V(e):void 0,key:`dropdown-item-${t}`,label:e.title??"",selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>{this.layer=e}},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){const{editingEnabled:t,effectiveTable:i,paginationEnabled:l,pageSize:o,view:n,viewModel:s}=this,{layer:a,objectId:r,relatedLayer:c,relationshipId:d}=e;await a.load();const h=this.attachmentsEnabled&&S(a),p=new j({layer:a,attachmentsEnabled:h,editingEnabled:t,paginationEnabled:l,pageSize:o,relatedRecordsEnabled:!0,relationshipConfig:{objectId:r,relatedLayer:c,relationshipId:d},relationshipColumnConfigs:T(a,d),tableController:this,tableParent:i,view:n,showRelatedTableCallback:e=>s.emit("show-related-table",e)});this.relatedTables.add(p),this.scheduleRender()}_renderAttachmentsView(){const{attachmentInfos:e,mode:t,objectId:i}=this.attachmentsViewOptions;return"file"!==t&&e.length&&null!=i?this._renderAttachmentsViewList():this._renderAttachmentsViewFilePane()}_renderAttachmentsViewFilePane(){const{attachmentsViewOptions:e,isSyncingAttachments:t,supportsAddAttachments:i,messages:l,messagesUnits:o}=this,{attachmentId:n,attachmentInfos:a,candidates:r,objectId:c}=e,d=a.find((e=>e.id===n)),h=a.length,p=r?.length,m=d?F("calcite-label",{alignment:"center",key:"replace-file-node",scale:"l"},l.replaceFile):void 0,u=p?void 0:F("calcite-label",{alignment:"center",key:"message-node",scale:"m"},i?null==c?l.noFeature:l.dragAndDropToUpload:l.editingRestricted),g=Array.from(r??[]).pop(),w=g?F("calcite-label",{key:"filename-node"},g.name):void 0,b=i&&null!=c,v=b&&p,y=F("input",{afterCreate:x,afterRemoved:k,afterUpdate:x,bind:this,"data-node-ref":"_attachmentsInput",files:r,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),f=b?F("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:B.folderOpen,key:"select-node",loading:!1,onclick:()=>{this._attachmentsInput?.click()},width:"full"},l.selectFile):void 0,_=v?F("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:B.save,key:"save-node",loading:t,onclick:()=>{this.saveAttachmentsViewForm()},width:"full"},d?l.updateAttachment:l.addAttachment):void 0,M=h||p?F("calcite-button",{appearance:"transparent",bind:this,disabled:t,key:"cancel-node",onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value=""),e.reset(),e.attachmentInfos?.length&&(e.mode="list")},width:"full"},this.messagesCommon.cancel):void 0;return[F("div",{class:U.attachmentsView,key:"attachments-view"},F("div",{class:U.attachmentsViewContent,key:"attachments-view-content"},F("div",{bind:this,class:U.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},F("calcite-icon",{class:U.attachmentsViewIcon,icon:B.upload,scale:"l"}),m,u,F("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},F("fieldset",null,w,y,f,_,M)))),null!=c&&null!=d?F("div",{class:U.attachmentsViewInformation,key:"information"},this._renderAttachmentsViewThumbnail(d,200),F("label",{key:"file-label"},l.fileName),F("span",{key:"file-span"},d.name),F("label",{key:"size-label"},l.size),F("span",{key:"size-span"},s(o,d.size??0))):void 0)]}_renderAttachmentsViewList(){const{attachmentsViewOptions:e,isSyncingAttachments:t,messages:i,messagesUnits:l,supportsDeleteAttachments:o,supportsUpdateAttachments:n}=this,{attachmentInfos:a,objectId:r}=e;return F("calcite-list",{afterCreate:x,afterRemoved:k,afterUpdate:x,bind:this,class:U.attachmentsViewList,"data-node-ref":"attachmentsList",key:`attachments-list-${r}`,label:i?.attachments,loading:t,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop,selectionMode:"multiple",onCalciteListChange:()=>this.scheduleRender()},...a?.map((t=>{const{id:a,name:c,size:d,url:h}=t,p=s(l,d??0);return F("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${a}`,label:c,value:a},this._renderAttachmentsViewListThumbnail(t),F("span",{class:U.attachmentsViewListFileSize,slot:"actions-end",title:p},p),F("calcite-action",{appearance:"transparent",icon:B.downloadTo,key:`download-attachment-${a}`,label:`${c}`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(r??-1,a)},slot:"actions-end",text:i.downloadAttachment,title:i.downloadAttachment}),n&&null!=r?F("calcite-action",{appearance:"transparent",disabled:!n,icon:B.replaceImage,key:`replace-attachment-${a}`,label:`${c}`,onclick:()=>{e.mode="file",e.attachmentId=a},slot:"actions-end",text:i.updateAttachment,title:i.updateAttachment}):void 0,F("calcite-action",{appearance:"transparent",icon:B.launch,key:`launch-attachment-${a}`,label:`${c}`,onclick:()=>{h&&window.open(h,"_blank")},slot:"actions-end",text:i.viewAttachment,title:i.viewAttachment}),o&&null!=r?F("calcite-action",{appearance:"transparent",class:U.attachmentsViewListItemDelete,disabled:!o,icon:B.delete,key:`delete-attachment-${a}`,label:`${c}`,onclick:()=>{this.deleteAttachments(r,[a],!0)},slot:"actions-end",text:i.deleteAttachment,title:i.deleteAttachment}):void 0)})))}_renderAttachmentsViewListThumbnail(e){return F("div",{class:U.attachmentsViewListThumbnail,slot:"content-start"},F("a",{href:e.url??"",rel:"noreferrer",target:"_blank"},this._renderAttachmentsViewThumbnail(e)))}_renderAttachmentsViewThumbnail(e,t=64){const{contentType:i,name:l,size:o,url:n}=e,s=`${n}${n?.includes("?")?"&":"?"}w=${t}&s=${o}`;return this.supportsResizeAttachments&&g(i)?F("img",{alt:l,key:`thumbnail-image-${l}`,src:s,title:l}):F("calcite-icon",{icon:w(i),key:`thumbnail-icon-${l}`,scale:"l",textLabel:l,title:l})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&this.attachmentsViewOptions.set({mode:"file",candidates:e.dataTransfer?.files})}_renderNavigationBar(){const{effectiveTable:e,messages:t,messagesCommon:i,relatedTable:l,relatedTables:o}=this;if(!this._shouldShowNavigationBar)return;const{attachmentsList:n,attachmentsViewOptions:s,layer:a,supportsAddAttachments:r,supportsDeleteAttachments:c}=e;if(!a)return;const{attachmentInfos:d,objectId:h}=s,p=null!=h,m=d.length,u=n?.selectedItems?.length??0,g=`${a.objectIdField}: ${h}`,w=L(t.selectedCount,{count:u}),b=L(t.attachmentsCount,{count:m}),v=p?F("calcite-action",{bind:this,icon:B.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(h),text:g,textEnabled:!0,title:g}):void 0,y=p?F("calcite-action",{icon:B.chevronRight,iconFlipRtl:!0,key:"navigation-attachments-label",label:b,onclick:()=>{m>0&&(s.mode="list")},text:b,textEnabled:!0,title:b}):void 0,f=p?F("calcite-chip",{closable:!0,closed:0===u,key:"navigation-chip",kind:"inverse",label:w,selected:!0,title:w,value:"selected",onCalciteChipClose:()=>n?.selectedItems?.forEach((e=>e.selected=!1))},w):void 0,_=l?F("calcite-label",{layout:"inline"},t.showAllTables,F("calcite-switch",{checked:this.allRelatedTablesVisible,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,M=p&&"list"===s.mode&&null!=h&&u&&c?F("calcite-action",{icon:B.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(h,n?.selectedItems?.map((e=>e.value))??[],!0)},text:i.delete,textEnabled:!0,title:L(t.deleteAttachmentCount,{count:u})}):void 0,A=p&&"list"===s.mode&&r?F("calcite-action",{bind:this,icon:B.plus,iconFlipRtl:!0,key:"attachments-add",onclick:()=>{s.attachmentId=null,s.mode="file"},text:t.addAttachment,textEnabled:!0,title:t.addAttachment}):void 0;return F("div",{class:U.tableNavigation,key:"table-nav"},F("calcite-action",{icon:B.moveUp,iconFlipRtl:!0,key:"go-back",onclick:()=>{l&&this.drainRelatedTables(),e.attachmentsViewOptions.objectId=null},text:this.layer?.title??"",textEnabled:!1,title:l?t.exitRelatedRecords:t.exitAttachments}),o.toArray().map(((e,t)=>this._renderRelatedTableNavigationAction(e,t))),v,y,F("div",null,f,_,M,A))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return F("calcite-action",{icon:B.chevronRight,iconFlipRtl:!0,key:t,onclick:()=>this._onRelatedNavigationItemClick(t),text:i,textEnabled:!0,title:e.layer?.title||""})}_getLabelForRelatedTableNavigationAction(e){const t=e.layer?.title;if(!t)return"";const{relatedTables:i}=this;if(i.length<=1)return t;return i.indexOf(e)!==i.length-1&&t.length>20?`${t.slice(0,20)}...`:t}};e([a()],H.prototype,"_attachmentsInput",void 0),e([a()],H.prototype,"_columnVisibilityActions",void 0),e([a()],H.prototype,"_effectiveDescription",null),e([a()],H.prototype,"_effectiveLayers",null),e([a()],H.prototype,"_effectiveTitle",null),e([a()],H.prototype,"_effectiveVisibleElements",null),e([a()],H.prototype,"_filteredTables",null),e([a()],H.prototype,"_hasAttachmentsViewError",null),e([a()],H.prototype,"_hasCustomMenuItems",null),e([a()],H.prototype,"_hasDefaultMenuItems",null),e([a()],H.prototype,"_shouldShowGrid",null),e([a()],H.prototype,"_shouldShowMenu",null),e([a()],H.prototype,"_shouldShowAttachmentsView",null),e([a()],H.prototype,"_showClearSelectionAction",null),e([a()],H.prototype,"_showColumnsVisibilityAction",null),e([a()],H.prototype,"_showDeleteSelectionAction",null),e([a()],H.prototype,"_showExportSelectionToCSVAction",null),e([a()],H.prototype,"_showLayerDropdown",null),e([a()],H.prototype,"_shouldShowNavigationBar",null),e([a()],H.prototype,"_showRefreshDataAction",null),e([a()],H.prototype,"_showSelectedRecordsShowSelectedAction",null),e([a()],H.prototype,"_showSelectedRecordsShowAllAction",null),e([a()],H.prototype,"_showZoomToSelectionAction",null),e([a()],H.prototype,"_viewLayers",null),e([a()],H.prototype,"attachmentsList",void 0),e([a({readOnly:!0})],H.prototype,"grid",null),e([a()],H.prototype,"actionColumnConfig",null),e([a({readOnly:!0})],H.prototype,"activeFilters",null),e([a({readOnly:!0})],H.prototype,"activeSortOrders",null),e([a()],H.prototype,"allColumns",null),e([a({readOnly:!0})],H.prototype,"allRelatedTablesVisible",null),e([a()],H.prototype,"attachmentsEnabled",null),e([a()],H.prototype,"attachmentsViewOptions",null),e([a({type:m})],H.prototype,"attributeTableTemplate",null),e([a()],H.prototype,"autoRefreshEnabled",null),e([a()],H.prototype,"clearPrompt",null),e([a()],H.prototype,"columnPerformanceModeEnabled",null),e([a()],H.prototype,"columnReorderingEnabled",null),e([a({readOnly:!0})],H.prototype,"columns",null),e([a()],H.prototype,"definitionExpression",null),e([a()],H.prototype,"description",void 0),e([a()],H.prototype,"disabled",void 0),e([a()],H.prototype,"editingEnabled",null),e([a()],H.prototype,"effectiveSize",null),e([a()],H.prototype,"effectiveTable",null),e([a()],H.prototype,"filterGeometry",null),e([a()],H.prototype,"filterBySelectionEnabled",null),e([a()],H.prototype,"hiddenFields",null),e([a()],H.prototype,"highlightEnabled",null),e([a()],H.prototype,"highlightIds",null),e([a()],H.prototype,"icon",null),e([a()],H.prototype,"initialSize",null),e([a()],H.prototype,"isQueryingOrSyncing",null),e([a()],H.prototype,"isSyncingAttachments",null),e([a()],H.prototype,"label",null),e([a()],H.prototype,"layer",null),e([a()],H.prototype,"layers",null),e([a()],H.prototype,"layerView",null),e([a()],H.prototype,"maxSize",null),e([a(),D("esri/widgets/FeatureTable/t9n/FeatureTable")],H.prototype,"messages",null),e([a(),D("esri/t9n/common")],H.prototype,"messagesCommon",null),e([a(),D("esri/core/t9n/Units")],H.prototype,"messagesUnits",null),e([a(),D("esri/widgets/support/t9n/uriUtils")],H.prototype,"messagesURIUtils",null),e([a()],H.prototype,"menuConfig",void 0),e([a()],H.prototype,"multipleSelectionEnabled",null),e([a()],H.prototype,"multiSortEnabled",null),e([a()],H.prototype,"multipleSortPriority",null),e([a()],H.prototype,"noDataMessage",null),e([a()],H.prototype,"objectIds",null),e([a()],H.prototype,"outFields",null),e([a()],H.prototype,"pageCount",null),e([a()],H.prototype,"pageIndex",null),e([a()],H.prototype,"pageSize",null),e([a()],H.prototype,"paginationEnabled",null),e([a()],H.prototype,"prompt",null),e([a()],H.prototype,"relatedRecordsEnabled",null),e([a()],H.prototype,"relatedTable",null),e([a()],H.prototype,"relatedTables",null),e([a()],H.prototype,"relationship",null),e([a()],H.prototype,"relationshipColumnConfigs",null),e([a()],H.prototype,"relationshipConfig",null),e([a()],H.prototype,"relationshipInfos",null),e([a()],H.prototype,"returnGeometryEnabled",null),e([a()],H.prototype,"returnMEnabled",null),e([a()],H.prototype,"returnZEnabled",null),e([a()],H.prototype,"rowHighlightIds",null),e([a()],H.prototype,"selectionSource",null),e([a()],H.prototype,"showAllRelatedTables",null),e([a()],H.prototype,"showPrompt",null),e([a()],H.prototype,"showRelatedTableCallback",null),e([a()],H.prototype,"size",null),e([a({readOnly:!0})],H.prototype,"state",null),e([a()],H.prototype,"supportsAddAttachments",null),e([a()],H.prototype,"supportsAttachments",null),e([a()],H.prototype,"supportsDeleteAttachments",null),e([a()],H.prototype,"supportsResizeAttachments",null),e([a()],H.prototype,"supportsUpdateAttachments",null),e([a({constructOnly:!0})],H.prototype,"tableController",null),e([a({constructOnly:!0})],H.prototype,"tableParent",null),e([a()],H.prototype,"tableTemplate",null),e([a()],H.prototype,"tableTemplateOverride",null),e([a()],H.prototype,"title",void 0),e([a()],H.prototype,"timeExtent",null),e([a()],H.prototype,"timeZone",null),e([a()],H.prototype,"view",null),e([a({type:f}),P(["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder","show-related-table"])],H.prototype,"viewModel",void 0),e([a({type:_,nonNullable:!0})],H.prototype,"visibleElements",void 0),e([a({type:_})],H.prototype,"visibleElementsOverride",null),H=j=e([r("esri.widgets.FeatureTable")],H);const N=H;export{N as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{isSome as t}from"../core/arrayUtils.js";import{watch as i,sync as l,initial as o,on as n}from"../core/reactiveUtils.js";import{formatFileSize as s}from"../core/unitFormatUtils.js";import{property as a}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{isLayerFromCatalog as c}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as d,isMapImageLayer as h,isSubtypeGroupLayer as p}from"../layers/support/layerUtils.js";import m from"../tables/AttributeTableTemplate.js";import u from"./Widget.js";import{isSupportedImage as g,getCalciteIconForAttachment as w}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as b,Prompt as v}from"./Editor/components/Prompt.js";import y from"./FeatureTable/ColumnMenuVisibleElements.js";import f from"./FeatureTable/FeatureTableViewModel.js";import _ from"./FeatureTable/VisibleElements.js";import{isGroupColumn as M}from"./FeatureTable/support/columnUtils.js";import{loadFieldColumnComponents as A,isIFeatureTableSupportedLayer as C,isIFeatureTableSupportedLayerWithAttachments as S,getRelationshipIdsToShow as T}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as I}from"./support/globalCss.js";import{getIconForLayer as V}from"./support/iconUtils.js";import{renderingSanitizer as R,storeNode as x,discardNode as k}from"./support/widgetUtils.js";import{messageBundle as D}from"./support/decorators/messageBundle.js";import{vmEvent as P}from"./support/decorators/vmEvent.js";import{tsx as F}from"./support/jsxFactory.js";import{substitute as L}from"../intl/substitute.js";var j;const O="esri-feature-table",z=`${O}__prompt`,$=`${O}__attachments-view`,U={base:O,content:`${O}__content`,menuPopover:`${O}__menu-popover`,layerDropdownMenu:`${O}__layer-switcher-menu`,tableContainer:`${O}__table-container`,tableContainerWithAttachments:`${O}__table-container--attachments`,tableNavigation:`${O}__table-navigation`,attachmentsView:$,attachmentsViewContent:`${$}__content`,attachmentsViewDropArea:`${$}__drop-area`,attachmentsViewIcon:`${$}__icon`,attachmentsViewInformation:`${$}__information`,attachmentsViewList:`${$}__list`,attachmentsViewListFileSize:`${$}__list__filesize`,attachmentsViewListItemDelete:`${$}__list-item--delete`,attachmentsViewListThumbnail:`${$}__list__thumbnail`,expanded:`${O}__expanded`,collapsed:`${O}__collapsed`,promptContainer:z,promptHeader:`${z}__header`,promptHeading:`${z}__header__heading`,promptMessage:`${z}__message`,promptDivider:`${z}__divider`,promptActions:`${z}__actions`},B={attachment:"attachment",chevronDown:"chevron-down",chevronLeft:"chevron-left",chevronRight:"chevron-right",clearSelection:"clear-selection",downloadTo:"download-to",exclamationMarkTriangle:"exclamation-mark-triangle",exportToCSV:"file-csv",folderOpen:"folder-open",delete:"trash",launch:"launch",layers:"layers",moveUp:"move-up",plus:"plus",refresh:"refresh",replaceImage:"replace-image",save:"save",showAll:"selection-x",showColumn:"show-column",showSelected:"selection-filter",upload:"upload",zoomToSelection:"zoom-to-object"};let H=j=class extends u{constructor(e,t){super(e,t),this._attachmentsInput=null,this._columnVisibilityActions=new Map,this.attachmentsList=null,this.description=null,this.disabled=!1,this.menuConfig=null,this.title=null,this.viewModel=new f,this.visibleElements=new _,this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.addHandles([i((()=>[this.isQueryingOrSyncing,this.editingEnabled]),(()=>this.scheduleRender())),i((()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length]),(()=>{this.columns.forEach((e=>e.visibleElements=this._effectiveVisibleElements)),this.refreshCellContent()}),l),i((()=>this._effectiveVisibleElements.selectionColumn),(e=>{this.grid&&(this.grid.selectionColumnEnabled=e)}),o),n((()=>this.viewModel),"show-related-table",(e=>this._onShowRelatedTable(e))),i((()=>this.editingEnabled),(()=>{const{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)}))])}loadDependencies(){return Promise.all([E({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),alert:()=>import("@esri/calcite-components/dist/components/calcite-alert"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),pagination:()=>import("@esri/calcite-components/dist/components/calcite-pagination"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),b(),A()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _effectiveDescription(){const{description:e}=this;return null!=e?R.sanitize("function"==typeof e?e():e):void 0}get _effectiveLayers(){const{layer:e,layers:t}=this,i=t?.length?t.filter(C):[],l=i.length?i:[...this._viewLayers];return e&&!l.includes(e)&&l.push(e),l}get _effectiveTitle(){const{layer:e,messages:t,state:i,highlightIds:l,title:o,size:n}=this;if(o)return R.sanitize("function"==typeof o?o():o);if(!e)return t.noLayer;switch(i){case"disabled":return t.errorLayer;case"ready":case"loading":return t.loading;case"error":return t.errorData}return L(t.header,{title:R.sanitize(e.title),count:n,selected:l.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){const e=this.relatedTables.toArray(),t=1===e.length;return this.allRelatedTablesVisible?e:t?[e[0]]:this._shouldShowAttachmentsView?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return null!=this.attachmentsViewOptions.error}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnsVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||1===this.relatedTables.length&&!this._shouldShowAttachmentsView}get _shouldShowMenu(){const{header:e,menu:t}=this._effectiveVisibleElements;return!(!e||!t||!this._hasDefaultMenuItems&&!this._hasCustomMenuItems)}get _shouldShowAttachmentsView(){return!(null==this.attachmentsViewOptions.objectId&&!this.relatedTables.some((e=>null!=e.attachmentsViewOptions.objectId)))}get _showClearSelectionAction(){return!(!this.highlightIds.length||!this._effectiveVisibleElements.menuItems?.clearSelection||this.relatedTables.length)}get _showColumnsVisibilityAction(){const{header:e,menu:t,menuItems:i}=this._effectiveVisibleElements;return!(!(e&&t&&i?.toggleColumns)||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._shouldShowAttachmentsView)}get _showDeleteSelectionAction(){return!(!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete)||this.relatedTables.length)}get _showExportSelectionToCSVAction(){return!(!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length)||this.relatedTables.length)}get _showLayerDropdown(){return!(!this._effectiveLayers.length||!this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){const e=!!this.relatedTable||this._shouldShowAttachmentsView;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){const e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length)}get _showSelectedRecordsShowAllAction(){return!(!this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle||!this.objectIds.length||this.relatedTables.length)}get _showZoomToSelectionAction(){return!(!this.view||!this.highlightIds.length||this.effectiveTable.layer?.isTable||!this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){const e=this.view?.map;if(!e)return[];const t=new Set,i=e=>{!C(e)||p(e)||t.has(e)||(e.load(),t.add(e))},l=e=>{c(e)||"catalog-footprint"===e.type||(d(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):h(e)?(e.loadAll(),e.sublayers?.forEach(i),e.subtables?.forEach(i)):p(e)?(e.loadAll(),e.sublayers?.forEach(i)):i(e))};return e.allLayers.forEach(l),e.allTables.forEach(l),[...t.values()]}get grid(){return this.viewModel.grid}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return"table"}set icon(e){this._overrideIfSome("icon",e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTables(){return this.viewModel.relatedTables}set relatedTables(e){this.viewModel.relatedTables=e}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleElementsOverride(){const{attachmentsViewOptions:e,relatedTable:t,tableController:i,visibleElements:l}=this,{columnDescriptions:o,columnMenus:n,tooltips:s}=l,a=null!=e.objectId;if(t)return new _({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new y({sortAscending:!1,sortDescending:!1})});if(i){const e=i.relatedTable===this,t=i.allRelatedTablesVisible,r=e&&l.selectionColumn&&!t&&!a,c=e&&!t&&!a;return new _({columnDescriptions:o,columnMenus:n,tooltips:s,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,progress:!1,columnMenuItems:new y({sortAscending:c,sortDescending:c})})}return a?new _({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new y({sortAscending:!1,sortDescending:!1})}):null}clearSelectionFilter(){this.viewModel.clearSelectionFilter()}async deleteAttachments(e,t,i){null!=e&&t?.length&&(i?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}deleteSelection(e){return this.highlightIds.length?e?(this._showDeletePrompt(),this.scheduleRender(),Promise.resolve()):this.viewModel.deleteSelection():Promise.resolve()}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}filterBySelection(){this.viewModel.filterBySelection()}findColumn(e){return this.viewModel.findColumn(e)}goToPage(e){this.viewModel.goToPage(e)}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}zoomToSelection(){this.effectiveTable.viewModel.zoomToSelection()}render(){const{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:i,state:l}=this;return F("div",{bind:this,class:this.classes(U.base,I.widget)},F("calcite-panel",{bind:this,class:U.content,closable:e.close,description:this._effectiveDescription,disabled:this.disabled||"disabled"===l&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,loading:"loading"===l,menuOpen:!!i?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.currentTarget.closed=!1,this.emit("close")}},e.progress?F("calcite-progress",{type:t?"indeterminate":"determinate"}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError()),this._renderColumnVisibilityPopover(),this._renderPrompt())}_renderTables(){const{grid:e,relatedTables:t}=this,i=this.classes(U.tableContainer);if(t.length){const l=this.classes(U.base,this.allRelatedTablesVisible?U.expanded:U.collapsed,this._shouldShowAttachmentsView?U.tableContainerWithAttachments:void 0);return F("div",{class:i},F("calcite-panel",{overlayPositioning:"fixed"},F("div",null,[this._shouldShowGrid?F("div",{class:l},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map((e=>{const i=t.indexOf(e);return F("div",{class:l,key:`related-${i}`},e.render())})),,])))}return null!=this.attachmentsViewOptions.objectId?F("div",{class:i},F("calcite-panel",{overlayPositioning:"fixed"},F("div",null,[F("div",{class:this.classes(U.base,U.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[F("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return F("calcite-pagination",{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>this.goToPage(e.currentTarget.startItem-1)})}_renderError(){const{messages:e}=this;return F("calcite-alert",{autoClose:!0,autoCloseDuration:"fast",icon:B.exclamationMarkTriangle,kind:"danger",label:e.errorOccured,open:this._hasAttachmentsViewError,slot:"alerts",onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},F("span",{slot:"message"},e.errorOccured))}_renderPrompt(){return this.prompt?F(v,{...this.prompt,headingLevel:2}):void 0}_showDeletePrompt(){const{messages:e,messagesCommon:t}=this,i=L(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:i,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:t.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,t){const{messages:i,messagesCommon:l}=this,o=L(i.deleteAttachmentCount,{count:t.length});this.showPrompt({title:o,message:i.deleteAttachmentConfirmation,context:"danger",actions:{primary:{label:l.delete,action:async()=>{try{await this.deleteAttachments(e,t,!1)}finally{this.clearPrompt()}}},secondary:{label:l.cancel,action:()=>this.clearPrompt()}}})}async _onDeleteSelectionClick(){try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:l,text:o,clickFunction:n}=e;if(!i)return F("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:l??void 0,key:o,onclick:()=>n(),slot:"header-menu-actions",text:o,textEnabled:!0,title:o})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{messages:e}=this;return[this._showRefreshDataAction&&{icon:B.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:B.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:B.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:B.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:B.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:B.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:B.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(t).map((e=>e&&this._renderHeaderMenuAction(e)))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map((({disabled:e,hidden:t,icon:i,label:l,clickFunction:o})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:l,disabled:e,clickFunction:e=>o(e)})))??[]}_renderColumnVisibilityAction(){if(!this._showColumnsVisibilityAction)return[];const{_columnVisibilityActions:e,effectiveTable:t,id:i}=this,l=this.messages.toggleColumns;return F("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),appearance:"transparent",bind:this,disabled:t.menuConfig?.disabled,icon:B.showColumn,id:`${i}__toggle-columns-action`,slot:"header-actions-end",text:l},this._effectiveVisibleElements.tooltips?F("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",slot:"tooltip"},l):null)}_renderColumnVisibilityPopover(){if(!this._showColumnsVisibilityAction||this.effectiveTable.menuConfig?.disabled)return;const{effectiveTable:e}=this,t=this.messages.toggleColumns;return F("calcite-popover",{autoClose:!0,class:U.menuPopover,label:t,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:this._columnVisibilityActions.get(this.id)},F("calcite-list",{displayMode:"nested",filterEnabled:!0,filterPlaceholder:t,label:t,selectionMode:"multiple"},e.columns.toArray().map((t=>{const i=M(t)?t.columns?.map((t=>this._renderColumnListItem({column:t,table:e,ignoreSelect:!0}))):void 0;return this._renderColumnListItem({column:t,table:e,items:i})}))))}_renderColumnListItem(e){const{column:t,table:i,items:l,ignoreSelect:o}=e,{effectiveLabel:n,fieldName:s,hidden:a}=t;return F("calcite-list-item",{expanded:!(!l?.length||a)||void 0,key:`toggle-columns__item-${s}`,label:n,selected:!a,value:s,onCalciteListItemSelect:e=>{o&&e.stopPropagation(),i.toggleColumnVisibility(e.currentTarget.value)}},l)}_renderLayerDropdown(){const e=this.messages.selectALayer;return F("div",{class:U.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},F("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start"},F("calcite-action",{icon:B.layers,slot:"trigger",text:e,title:e}),F("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map(((e,t)=>this._renderLayerDropdownItem(e,t)))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return F("calcite-dropdown-item",{iconStart:i?V(e):void 0,key:`dropdown-item-${t}`,label:e.title??"",selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>{this.layer=e}},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){const{editingEnabled:t,effectiveTable:i,paginationEnabled:l,pageSize:o,view:n,viewModel:s}=this,{layer:a,objectId:r,relatedLayer:c,relationshipId:d}=e;await a.load();const h=this.attachmentsEnabled&&S(a),p=new j({layer:a,attachmentsEnabled:h,editingEnabled:t,paginationEnabled:l,pageSize:o,relatedRecordsEnabled:!0,relationshipConfig:{objectId:r,relatedLayer:c,relationshipId:d},relationshipColumnConfigs:T(a,d),tableController:this,tableParent:i,view:n,showRelatedTableCallback:e=>s.emit("show-related-table",e)});this.relatedTables.add(p),this.scheduleRender()}_renderAttachmentsView(){const{attachmentInfos:e,mode:t,objectId:i}=this.attachmentsViewOptions;return"file"!==t&&e.length&&null!=i?this._renderAttachmentsViewList():this._renderAttachmentsViewFilePane()}_renderAttachmentsViewFilePane(){const{attachmentsViewOptions:e,isSyncingAttachments:t,supportsAddAttachments:i,messages:l,messagesUnits:o}=this,{attachmentId:n,attachmentInfos:a,candidates:r,objectId:c}=e,d=a.find((e=>e.id===n)),h=a.length,p=r?.length,m=d?F("calcite-label",{alignment:"center",key:"replace-file-node",scale:"l"},l.replaceFile):void 0,u=p?void 0:F("calcite-label",{alignment:"center",key:"message-node",scale:"m"},i?null==c?l.noFeature:l.dragAndDropToUpload:l.editingRestricted),g=Array.from(r??[]).pop(),w=g?F("calcite-label",{key:"filename-node"},g.name):void 0,b=i&&null!=c,v=b&&p,y=F("input",{afterCreate:x,afterRemoved:k,afterUpdate:x,bind:this,"data-node-ref":"_attachmentsInput",files:r,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),f=b?F("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:B.folderOpen,key:"select-node",loading:!1,onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value="",this._attachmentsInput.click())},width:"full"},l.selectFile):void 0,_=v?F("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:B.save,key:"save-node",loading:t,onclick:()=>{this.saveAttachmentsViewForm()},width:"full"},d?l.updateAttachment:l.addAttachment):void 0,M=h||p?F("calcite-button",{appearance:"transparent",bind:this,disabled:t,key:"cancel-node",onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value=""),e.reset(),e.attachmentInfos?.length&&(e.mode="list")},width:"full"},this.messagesCommon.cancel):void 0;return[F("div",{class:U.attachmentsView,key:"attachments-view"},F("div",{class:U.attachmentsViewContent,key:"attachments-view-content"},F("div",{bind:this,class:U.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},F("calcite-icon",{class:U.attachmentsViewIcon,icon:B.upload,scale:"l"}),m,u,F("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},F("fieldset",null,w,y,f,_,M)))),null!=c&&null!=d?F("div",{class:U.attachmentsViewInformation,key:"information"},this._renderAttachmentsViewThumbnail(d,200),F("label",{key:"file-label"},l.fileName),F("span",{key:"file-span"},d.name),F("label",{key:"size-label"},l.size),F("span",{key:"size-span"},s(o,d.size??0))):void 0)]}_renderAttachmentsViewList(){const{attachmentsViewOptions:e,isSyncingAttachments:t,messages:i,messagesUnits:l,supportsDeleteAttachments:o,supportsUpdateAttachments:n}=this,{attachmentInfos:a,objectId:r}=e;return F("calcite-list",{afterCreate:x,afterRemoved:k,afterUpdate:x,bind:this,class:U.attachmentsViewList,"data-node-ref":"attachmentsList",key:`attachments-list-${r}`,label:i?.attachments,loading:t,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop,selectionMode:"multiple",onCalciteListChange:()=>this.scheduleRender()},...a?.map((t=>{const{id:a,name:c,size:d,url:h}=t,p=s(l,d??0);return F("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${a}`,label:c,value:a},this._renderAttachmentsViewListThumbnail(t),F("span",{class:U.attachmentsViewListFileSize,slot:"actions-end",title:p},p),F("calcite-action",{appearance:"transparent",icon:B.downloadTo,key:`download-attachment-${a}`,label:`${c}`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(r??-1,a)},slot:"actions-end",text:i.downloadAttachment,title:i.downloadAttachment}),n&&null!=r?F("calcite-action",{appearance:"transparent",disabled:!n,icon:B.replaceImage,key:`replace-attachment-${a}`,label:`${c}`,onclick:()=>{e.mode="file",e.attachmentId=a},slot:"actions-end",text:i.updateAttachment,title:i.updateAttachment}):void 0,F("calcite-action",{appearance:"transparent",icon:B.launch,key:`launch-attachment-${a}`,label:`${c}`,onclick:()=>{h&&window.open(h,"_blank")},slot:"actions-end",text:i.viewAttachment,title:i.viewAttachment}),o&&null!=r?F("calcite-action",{appearance:"transparent",class:U.attachmentsViewListItemDelete,disabled:!o,icon:B.delete,key:`delete-attachment-${a}`,label:`${c}`,onclick:()=>{this.deleteAttachments(r,[a],!0)},slot:"actions-end",text:i.deleteAttachment,title:i.deleteAttachment}):void 0)})))}_renderAttachmentsViewListThumbnail(e){return F("div",{class:U.attachmentsViewListThumbnail,slot:"content-start"},F("a",{href:e.url??"",rel:"noreferrer",target:"_blank"},this._renderAttachmentsViewThumbnail(e)))}_renderAttachmentsViewThumbnail(e,t=64){const{contentType:i,name:l,size:o,url:n}=e,s=`${n}${n?.includes("?")?"&":"?"}w=${t}&s=${o}`;return this.supportsResizeAttachments&&g(i)?F("img",{alt:l,key:`thumbnail-image-${l}`,src:s,title:l}):F("calcite-icon",{icon:w(i),key:`thumbnail-icon-${l}`,scale:"l",textLabel:l,title:l})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&this.attachmentsViewOptions.set({mode:"file",candidates:e.dataTransfer?.files})}_renderNavigationBar(){const{effectiveTable:e,messages:t,messagesCommon:i,relatedTable:l,relatedTables:o}=this;if(!this._shouldShowNavigationBar)return;const{attachmentsList:n,attachmentsViewOptions:s,layer:a,supportsAddAttachments:r,supportsDeleteAttachments:c}=e;if(!a)return;const{attachmentInfos:d,objectId:h}=s,p=null!=h,m=d.length,u=n?.selectedItems?.length??0,g=`${a.objectIdField}: ${h}`,w=L(t.selectedCount,{count:u}),b=L(t.attachmentsCount,{count:m}),v=p?F("calcite-action",{bind:this,icon:B.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(h),text:g,textEnabled:!0,title:g}):void 0,y=p?F("calcite-action",{icon:B.chevronRight,iconFlipRtl:!0,key:"navigation-attachments-label",label:b,onclick:()=>{m>0&&(s.mode="list")},text:b,textEnabled:!0,title:b}):void 0,f=p?F("calcite-chip",{closable:!0,closed:0===u,key:"navigation-chip",kind:"inverse",label:w,selected:!0,title:w,value:"selected",onCalciteChipClose:()=>n?.selectedItems?.forEach((e=>e.selected=!1))},w):void 0,_=l?F("calcite-label",{layout:"inline"},t.showAllTables,F("calcite-switch",{checked:this.allRelatedTablesVisible,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,M=p&&"list"===s.mode&&null!=h&&u&&c?F("calcite-action",{icon:B.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(h,n?.selectedItems?.map((e=>e.value))??[],!0)},text:i.delete,textEnabled:!0,title:L(t.deleteAttachmentCount,{count:u})}):void 0,A=p&&"list"===s.mode&&r?F("calcite-action",{bind:this,icon:B.plus,iconFlipRtl:!0,key:"attachments-add",onclick:()=>{s.attachmentId=null,s.mode="file"},text:t.addAttachment,textEnabled:!0,title:t.addAttachment}):void 0;return F("div",{class:U.tableNavigation,key:"table-nav"},F("calcite-action",{icon:B.moveUp,iconFlipRtl:!0,key:"go-back",onclick:()=>{l&&this.drainRelatedTables(),e.attachmentsViewOptions.objectId=null},text:this.layer?.title??"",textEnabled:!1,title:l?t.exitRelatedRecords:t.exitAttachments}),o.toArray().map(((e,t)=>this._renderRelatedTableNavigationAction(e,t))),v,y,F("div",null,f,_,M,A))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return F("calcite-action",{icon:B.chevronRight,iconFlipRtl:!0,key:t,onclick:()=>this._onRelatedNavigationItemClick(t),text:i,textEnabled:!0,title:e.layer?.title||""})}_getLabelForRelatedTableNavigationAction(e){const t=e.layer?.title;if(!t)return"";const{relatedTables:i}=this;if(i.length<=1)return t;return i.indexOf(e)!==i.length-1&&t.length>20?`${t.slice(0,20)}...`:t}};e([a()],H.prototype,"_attachmentsInput",void 0),e([a()],H.prototype,"_columnVisibilityActions",void 0),e([a()],H.prototype,"_effectiveDescription",null),e([a()],H.prototype,"_effectiveLayers",null),e([a()],H.prototype,"_effectiveTitle",null),e([a()],H.prototype,"_effectiveVisibleElements",null),e([a()],H.prototype,"_filteredTables",null),e([a()],H.prototype,"_hasAttachmentsViewError",null),e([a()],H.prototype,"_hasCustomMenuItems",null),e([a()],H.prototype,"_hasDefaultMenuItems",null),e([a()],H.prototype,"_shouldShowGrid",null),e([a()],H.prototype,"_shouldShowMenu",null),e([a()],H.prototype,"_shouldShowAttachmentsView",null),e([a()],H.prototype,"_showClearSelectionAction",null),e([a()],H.prototype,"_showColumnsVisibilityAction",null),e([a()],H.prototype,"_showDeleteSelectionAction",null),e([a()],H.prototype,"_showExportSelectionToCSVAction",null),e([a()],H.prototype,"_showLayerDropdown",null),e([a()],H.prototype,"_shouldShowNavigationBar",null),e([a()],H.prototype,"_showRefreshDataAction",null),e([a()],H.prototype,"_showSelectedRecordsShowSelectedAction",null),e([a()],H.prototype,"_showSelectedRecordsShowAllAction",null),e([a()],H.prototype,"_showZoomToSelectionAction",null),e([a()],H.prototype,"_viewLayers",null),e([a()],H.prototype,"attachmentsList",void 0),e([a({readOnly:!0})],H.prototype,"grid",null),e([a()],H.prototype,"actionColumnConfig",null),e([a({readOnly:!0})],H.prototype,"activeFilters",null),e([a({readOnly:!0})],H.prototype,"activeSortOrders",null),e([a()],H.prototype,"allColumns",null),e([a({readOnly:!0})],H.prototype,"allRelatedTablesVisible",null),e([a()],H.prototype,"attachmentsEnabled",null),e([a()],H.prototype,"attachmentsViewOptions",null),e([a({type:m})],H.prototype,"attributeTableTemplate",null),e([a()],H.prototype,"autoRefreshEnabled",null),e([a()],H.prototype,"clearPrompt",null),e([a()],H.prototype,"columnPerformanceModeEnabled",null),e([a()],H.prototype,"columnReorderingEnabled",null),e([a({readOnly:!0})],H.prototype,"columns",null),e([a()],H.prototype,"definitionExpression",null),e([a()],H.prototype,"description",void 0),e([a()],H.prototype,"disabled",void 0),e([a()],H.prototype,"editingEnabled",null),e([a()],H.prototype,"effectiveSize",null),e([a()],H.prototype,"effectiveTable",null),e([a()],H.prototype,"filterGeometry",null),e([a()],H.prototype,"filterBySelectionEnabled",null),e([a()],H.prototype,"hiddenFields",null),e([a()],H.prototype,"highlightEnabled",null),e([a()],H.prototype,"highlightIds",null),e([a()],H.prototype,"icon",null),e([a()],H.prototype,"initialSize",null),e([a()],H.prototype,"isQueryingOrSyncing",null),e([a()],H.prototype,"isSyncingAttachments",null),e([a()],H.prototype,"label",null),e([a()],H.prototype,"layer",null),e([a()],H.prototype,"layers",null),e([a()],H.prototype,"layerView",null),e([a()],H.prototype,"maxSize",null),e([a(),D("esri/widgets/FeatureTable/t9n/FeatureTable")],H.prototype,"messages",null),e([a(),D("esri/t9n/common")],H.prototype,"messagesCommon",null),e([a(),D("esri/core/t9n/Units")],H.prototype,"messagesUnits",null),e([a(),D("esri/widgets/support/t9n/uriUtils")],H.prototype,"messagesURIUtils",null),e([a()],H.prototype,"menuConfig",void 0),e([a()],H.prototype,"multipleSelectionEnabled",null),e([a()],H.prototype,"multiSortEnabled",null),e([a()],H.prototype,"multipleSortPriority",null),e([a()],H.prototype,"noDataMessage",null),e([a()],H.prototype,"objectIds",null),e([a()],H.prototype,"outFields",null),e([a()],H.prototype,"pageCount",null),e([a()],H.prototype,"pageIndex",null),e([a()],H.prototype,"pageSize",null),e([a()],H.prototype,"paginationEnabled",null),e([a()],H.prototype,"prompt",null),e([a()],H.prototype,"relatedRecordsEnabled",null),e([a()],H.prototype,"relatedTable",null),e([a()],H.prototype,"relatedTables",null),e([a()],H.prototype,"relationship",null),e([a()],H.prototype,"relationshipColumnConfigs",null),e([a()],H.prototype,"relationshipConfig",null),e([a()],H.prototype,"relationshipInfos",null),e([a()],H.prototype,"returnGeometryEnabled",null),e([a()],H.prototype,"returnMEnabled",null),e([a()],H.prototype,"returnZEnabled",null),e([a()],H.prototype,"rowHighlightIds",null),e([a()],H.prototype,"selectionSource",null),e([a()],H.prototype,"showAllRelatedTables",null),e([a()],H.prototype,"showPrompt",null),e([a()],H.prototype,"showRelatedTableCallback",null),e([a()],H.prototype,"size",null),e([a({readOnly:!0})],H.prototype,"state",null),e([a()],H.prototype,"supportsAddAttachments",null),e([a()],H.prototype,"supportsAttachments",null),e([a()],H.prototype,"supportsDeleteAttachments",null),e([a()],H.prototype,"supportsResizeAttachments",null),e([a()],H.prototype,"supportsUpdateAttachments",null),e([a({constructOnly:!0})],H.prototype,"tableController",null),e([a({constructOnly:!0})],H.prototype,"tableParent",null),e([a()],H.prototype,"tableTemplate",null),e([a()],H.prototype,"tableTemplateOverride",null),e([a()],H.prototype,"title",void 0),e([a()],H.prototype,"timeExtent",null),e([a()],H.prototype,"timeZone",null),e([a()],H.prototype,"view",null),e([a({type:f}),P(["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder","show-related-table"])],H.prototype,"viewModel",void 0),e([a({type:_,nonNullable:!0})],H.prototype,"visibleElements",void 0),e([a({type:_})],H.prototype,"visibleElementsOverride",null),H=j=e([r("esri.widgets.FeatureTable")],H);const N=H;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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../Color.js";import{round as l,numDigits as t,percentChange as n}from"../../../renderers/support/numberUtils.js";import{updateReferenceSizeSymbol as i}from"../../../smartMapping/renderers/support/referenceSizeUtils.js";import{updateSpikeSymbol as
|
|
5
|
+
import e from"../../../Color.js";import{round as l,numDigits as t,percentChange as n}from"../../../renderers/support/numberUtils.js";import{updateReferenceSizeSymbol as i}from"../../../smartMapping/renderers/support/referenceSizeUtils.js";import{getSpikeSymbolBaseWidth as o,updateSpikeSymbol as s}from"../../../smartMapping/renderers/support/spikeUtils.js";import r from"../../../symbols/SimpleLineSymbol.js";import a from"../../../symbols/SimpleMarkerSymbol.js";import{applyCIMSymbolColor as u}from"../../../symbols/support/cimSymbolUtils.js";import{isSymbol3D as c}from"../../../symbols/support/typeUtils.js";import{isVolumetricSymbol as m,getSymbolOutlineSize as p}from"../../../symbols/support/utils.js";import{getAuthoringInfoVisualVariableByTheme as f,getSymbolForFlowRenderer as y,createStopLabel as b}from"./utils.js";import"../../support/widgetUtils.js";import{isDarkMode as h}from"../../../support/modeUtils.js";const d=30,g=12,w=24,S=10,z=[255,255,255],v=[200,200,200],k=[128,128,128],j=20,V=5;function x(e){return"esri.symbols.SimpleMarkerSymbol"===e.declaredClass}function I(e){return"esri.symbols.PictureMarkerSymbol"===e.declaredClass}function U(e){return"esri.symbols.SimpleLineSymbol"===e.declaredClass}function M(e){return"esri.symbols.TextSymbol"===e.declaredClass}function D(e,l){const t=e.length-1;return e.map(((e,n)=>b(e,n,t,l)))}async function L(e,t,n,i,s,r,a){const u=t.legendOptions,c=u?.customValues,y=a||await E(e,n),b=t.stops,h=!!y,d=!!c,g=null!=t.minSize&&null!=t.maxSize,z=b&&b.length>1,v=!!t.target;if(!h||!d&&!(g||z&&!v))return;const k=m(y);let j=!1,V=null,x=null;V=k&&!z?l([t.minDataValue,t.maxDataValue]):c??await H(t,y,i,s?.type);const I=e?.authoringInfo,U="univariate-color-size"===I?.type,M=U&&"above-and-below"===I?.univariateTheme,L=!!f(e,"reference-size"),q=!!f(e,"spike");if(!V&&z&&(V=b.map((e=>e.value)),j=b.some((e=>!!e.label)),"flow"===e.type&&(V=l(V)),j&&(x=b.map((e=>e.label)))),k&&null!=V&&V?.length>2&&!M&&(V=[V[0],V[V.length-1]]),!V)return null;U&&5!==V?.length&&(V=O({minSize:V[0],maxSize:V[V.length-1]}));const B=k?C(e,V):null,T=p(y),R=j?null:D(V,r);return(await Promise.all(V.map((async(l,n)=>{let r=k?B[n]:await J(t,y,l,i,s?.type),a=r;L&&(r*=w/t.maxSize||1,a=w),q&&"cim"===y.type&&(a={width:o(y)??S,height:r});return{value:l,symbol:K(y,r,e,n),label:j?x[n]:R[n],size:a,outlineSize:T}})))).reverse()}function C(e,l){const t=e?.authoringInfo,n="univariate-color-size"===t?.type;let i=[g,d];if(n){const e=l[0],t=l[l.length-1],n=g,o=d;i=l.map((l=>n+(l-e)/(t-e)*(o-n)))}return n&&"below"===t?.univariateTheme&&i.reverse(),i}function q(l,t,n,o){const s="class-breaks"===l.type,r=s?l.classBreakInfos?.[0]?.symbol?.clone():l.uniqueValueInfos?.[0]?.symbol?.clone();return r&&"type"in r&&"cim"===r.type?(i(r,{color:o??(s?null:new e(v)),innerDotSize:t*(w/n)||1,outerRingSize:w}),r):null}function B(l,t,n){const i="class-breaks"===l.type,o=i?l.classBreakInfos?.[0]?.symbol?.clone():l.uniqueValueInfos?.[0]?.symbol?.clone();return o&&"type"in o&&"cim"===o.type?(s(o,{color:n??(i?null:new e(v)),height:t}),o):null}function T(e,l){const t=e.classBreakInfos,n=t.length,i=n<2||!(l>=2)?t[0].symbol.clone():t[n-1].symbol.clone(),o=e.visualVariables?.some((e=>"color"===e.type));return o&&(i.type.includes("3d")?P(i):A(i)),i}async function E(l,t){if("flow"===l.type)return y(l,t);if("pie-chart"===l.type)return new a({color:null,outline:l.outline?.width?l.outline:new r});let n=null,o=null;if("simple"===l.type)n=l.symbol;else if("class-breaks"===l.type){const e=l.classBreakInfos;n=e&&e[0]&&e[0].symbol,o=e.length>1}else if("unique-value"===l.type){const e=l.uniqueValueInfos;n=e?.[0]?.symbol,o=null!=e&&e.length>1}return!n||R(n)?null:(n=n.clone(),(t||o)&&(n.type.includes("3d")?P(n):f(l,"reference-size")&&"cim"===n.type?i(n,{color:t??("class-breaks"!==l.type?new e(v):null)}):f(l,"spike")&&"cim"===n.type?s(n,{color:t??("class-breaks"!==l.type?new e(v):null)}):A(n)),n)}function R(e){return c(e)?e.symbolLayers?.some((e=>"fill"===e?.type))??!1:e?.type.includes("fill")??!1}function P(e){"line-3d"===e.type?e.symbolLayers.forEach((e=>{e.material={color:k}})):e.symbolLayers.forEach((e=>{"icon"!==e.type||e.resource?.href?e.material={color:v}:(e.material={color:z},e.outline={color:k,size:1.5})}))}function A(l){const t=h();if("cim"===l.type)u(l,new e(v));else if(l.type.includes("line"))l.color=k;else if(l.color=t?k:z,"simple-marker"===l.type)if(l.outline){const e=l.outline?.color?.toHex();"#ffffff"===e&&(l.outline.color=k)}else l.outline={color:k,width:1.5}}async function H(e,t,n,i){const o=(await import("../../../renderers/visualVariables/support/visualVariableUtils.js")).getSizeRangeAtScale(e,n,i),s=o&&O(o);if(!o||!s)return;let r=s.map((l=>F(l,e,o)));r=l(r);for(let l=1;l<r.length-1;l++){const o=await G(e,t,r[l],r[l-1],n,i);o&&(r[l]=o[0],s[l]=o[1])}return r}function O(e){const l=e.minSize,t=e.maxSize,n=V,i=(t-l)/(n-1),o=[];for(let s=0;s<n;s++)o.push(l+i*s);return o}function F(e,l,t){const n=t.minSize,i=t.maxSize,o=l.minDataValue,s=l.maxDataValue;let r;if(e<=n)r=o;else if(e>=i)r=s;else{r=(e-n)/(i-n)*(s-o)+o}return r}async function G(e,i,o,s,r,a){const u=await J(e,i,o,r,a),c=await J(e,i,s,r,a),m=t(o),p=m.fractional,f=j;let y=m.integer,b=null,h=null;o>0&&o<1&&(b=10**p,y=t(o*=b).integer);for(let t=y-1;t>=0;t--){const s=10**t;let m=Math.floor(o/s)*s,p=Math.ceil(o/s)*s;null!=b&&(m/=b,p/=b);let y=(m+p)/2;[,y]=l([m,y,p],{indexes:[1]});const d=await J(e,i,m,r,a),g=await J(e,i,p,r,a),w=await J(e,i,y,r,a),S=n(u,d,c,null),z=n(u,g,c,null),v=n(u,w,c,null);let k=S.previous<=f,j=z.previous<=f;if(k&&j&&(S.previous<=z.previous?(k=!0,j=!1):(j=!0,k=!1)),k?h=[m,d]:j?h=[p,g]:v.previous<=f&&(h=[y,w]),h)break}return h}async function J(e,l,t,n,i){const{getSize:o}=await import("../../../renderers/visualVariables/support/visualVariableUtils.js");return o(e,t,{scale:n,view:i,shape:"simple-marker"===l.type?l.style:null})}function K(e,l,t,n){"univariate-color-size"===t?.authoringInfo?.type&&"above-and-below"===t?.authoringInfo?.univariateTheme&&"class-breaks"===t.type&&(e=T(t,n));const o=e.clone();if(c(o))m(o)||o.symbolLayers.forEach((e=>{"fill"!==e.type&&(e.size=l)}));else if(x(o))o.size=l;else if(I(o)){const e=o.width,t=o.height;o.height=l,o.width=l*(e/t)}else U(o)?o.width=l:M(o)?o.font&&(o.font.size=l):"cim"===o.type&&f(t,"reference-size")?i(o,{innerDotSize:l,outerRingSize:w}):"cim"===o.type&&f(t,"spike")&&s(o,{height:l});return o}export{L as getRampStops,q as getReferenceSizeSymbol,B as getSpikeSymbol,d as realWorldMaxSize,g as realWorldMinSize};
|
package/widgets/VideoPlayer.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as i}from"../core/deprecate.js";import{clone as t}from"../core/lang.js";import o from"../core/Logger.js";import{watch as s,initial as r}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{deprecateWidget as i}from"../core/deprecate.js";import{clone as t}from"../core/lang.js";import o from"../core/Logger.js";import{watch as s,initial as r}from"../core/reactiveUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{formatDate as l}from"../intl/date.js";import d from"../views/VideoView.js";import c from"./Slider.js";import m from"./Widget.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as u}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as h}from"./support/decorators/messageBundle.js";import{tsx as v}from"./support/jsxFactory.js";import{css as w}from"./VideoPlayer/css.js";import g from"./VideoPlayer/VideoPlayerViewModel.js";import{loadMetadataSectionComponents as f,MetadataSection as y}from"./VideoPlayer/components/MetadataSection.js";import{loadPlayerActionsGroupComponents as V,PlayerActionsGroup as b}from"./VideoPlayer/components/PlayerActionsGroup.js";import{loadPlayerControlsGroupComponents as M,PlayerControlsGroup as j}from"./VideoPlayer/components/PlayerControlsGroup.js";import{defaultSettings as _}from"./VideoPlayer/components/SettingsButton.js";let P=class extends m{constructor(e,s){super(e,s),this._settings=t(_),this._metadataVisible=!1,this._slider=new c({visibleElements:{labels:!1,rangeLabels:!1},min:0,max:100,values:[0],thumbsConstrained:!1}),this.videoView=new d({container:document.createElement("div"),constraints:{rotationEnabled:!1},ui:{components:["zoom"]}}),this.viewModel=new g,i(o.getLogger(this),"Video Player","arcgis-video-player",{version:"4.33"})}initialize(){this.addHandles([s((()=>this.viewModel.layer),(()=>{this.videoView.layer=this.viewModel.layer,this._settings.color=this.viewModel.layer?.telemetryColor}),r),this._slider.on(["thumb-change","thumb-drag"],(({value:e})=>{const i=e*this.viewModel.duration/100;this.viewModel.seekTo(i)}))])}loadDependencies(){return Promise.all([V(),M(),f(),p({progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim")})])}get effect(){return this.videoView.effect}set effect(e){this.videoView.effect=e}get icon(){return"video-web"}set icon(e){this._overrideIfSome("icon",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get rotationEnabled(){return this.videoView.constraints.rotationEnabled}set rotationEnabled(e){this.videoView.constraints.rotationEnabled=e,this.videoView.ui.components=e?[...this.videoView.ui.components,"compass"]:this.videoView.ui.components.filter((e=>"compass"!==e))}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get zoomEnabled(){return this.videoView.navigation.mouseWheelZoomEnabled}set zoomEnabled(e){this.videoView.navigation.mouseWheelZoomEnabled=e,this.videoView.ui.components=e?[...this.videoView.ui.components,"zoom"]:this.videoView.ui.components.filter((e=>"zoom"!==e))}render(){return v("div",{class:this.classes(w.base,u.widget)},v("calcite-panel",{heading:this.layer?.title||"Video Player"},this._renderLoadingScrim(),this._renderBuffering(),this._renderVideoSection(),this._renderActionBar(),this._renderMetadataSection()))}_renderLoadingScrim(){const{state:e}=this.viewModel;return this.videoView.ready?null:v("calcite-scrim",{loading:"error"!==e},"error"===e?this.messages.errorLoadingLayer:null)}_renderBuffering(){const{currentTime:e,buffered:i,duration:t}=this.viewModel,o=i/(t||1),s=e/(t||1);return this.viewModel.ended||o>s?null:v("calcite-progress",{type:"indeterminate"})}_renderVideoSection(){const{buffered:e,currentTime:i,duration:t}=this.viewModel,o=this.videoView.container;if(!o)return null;o.className=w.videoView;const s=e/(t||1),r=i/(t||1);return this._slider.values=[100*r],v("section",{afterCreate:S,bind:o},v("div",{class:w.sliderProgressContainer},v("progress",{class:w.progress,max:"1",value:`${s}`}),v("div",{class:w.slider},this._slider.render())))}_renderActionBar(){return v("div",{class:w.playerToolbar},v(b,{messages:this.messages,viewModel:this.viewModel}),v("div",{class:w.playerTimecode},E(this.viewModel.currentTime)," / ",E(this.viewModel.duration)),v(j,{messages:this.messages,settings:this._settings,toggleMetadata:()=>this._metadataVisible=!this._metadataVisible,viewModel:this.viewModel}))}_renderMetadataSection(){return this._metadataVisible?v(y,{messages:this.messages,viewModel:this.viewModel}):null}};function E(e){return l(1e3*Math.round(e),{minute:"2-digit",second:"2-digit"})}function S(e){const i=this;e.prepend(i)}e([n()],P.prototype,"_settings",void 0),e([n()],P.prototype,"effect",null),e([n()],P.prototype,"icon",null),e([n()],P.prototype,"layer",null),e([n(),h("esri/widgets/VideoPlayer/t9n/VideoPlayer")],P.prototype,"messages",void 0),e([n()],P.prototype,"rotationEnabled",null),e([n()],P.prototype,"videoView",void 0),e([n({type:g})],P.prototype,"viewModel",void 0),e([n()],P.prototype,"view",null),e([n()],P.prototype,"zoomEnabled",null),P=e([a("esri.widgets.VideoPlayer")],P);const z=P;export{z 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}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{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{fetchThumbnail as r}from"../symbolPreviewUtils.js";import o from"./ItemBase.js";let s=class extends o{constructor(t){super(t),this._title=null,this._thumbnail=null,this.graphic=null,this.layer=null,this.thumbnailSize=24}get key(){return`${this.layer.id}:${this.objectId??this.graphic.uid}`}get objectId(){return this.graphic.getObjectId()}get title(){return this._title??this.objectId?.toString()}get thumbnail(){return this._thumbnail??void 0}async fetchThumbnail(){return this._thumbnail=await r(this.graphic,this.layer,{maxSize:this.thumbnailSize})}async sync(t){t.push(this._setFeatureTitle())}async _setFeatureTitle(){const{graphic:t,key:e,layer:i,viewModel:r}=this,o=r.featureTitleMap.get(e)||(i?.getFeatureTitle?await i.getFeatureTitle(t,{fetchMissingFields:!1}):null);o&&r.featureTitleMap.set(e,o),this._title=o}};t([e()],s.prototype,"_title",void 0),t([e()],s.prototype,"_thumbnail",void 0),t([e()],s.prototype,"graphic",void 0),t([e()],s.prototype,"key",null),t([e()],s.prototype,"layer",void 0),t([e()],s.prototype,"objectId",null),t([e()],s.prototype,"title",null),t([e()],s.prototype,"thumbnail",null),t([e()],s.prototype,"thumbnailSize",void 0),s=t([i("esri.widgets.support.SelectionList.FeatureItem")],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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import o from"../../../core/Logger.js";import{removeMaybe as r}from"../../../core/maybe.js";import{ignoreAbortErrors as i,debounce as s}from"../../../core/promiseUtils.js";import{watch as n,on as a}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as p,isSubtypeSublayer as g}from"../../../layers/support/layerUtils.js";import{isSelectableLayer as m}from"../../../views/support/selectionUtils.js";import{goTo as y}from"../goToUtils.js";import u from"./GroupLayerItem.js";import f from"./LayerItem.js";import{computeEffectiveCount as d,isLayerItem as v,isGroupLayerItem as S,getNestedFeatureItems as C}from"./selectionListUtils.js";const I=100;let _=class extends t{constructor(e){super(e),this._groupItemCache=new Map,this._hoverHighlightHandle=null,this._layerItemCache=new Map,this._layerItems=null,this._onChangeAbortController=null,this._updatingHandles=new h,this.featureTitleMap=new Map,this.maxVisibleFeatureCountPerLayer=500,this.selectionManager=null,this._onSelectionChangeController=async()=>{this._cancelOnSelectionChange();const e=new AbortController;this._onChangeAbortController=e,await this._updatingHandles.addPromise(i(this._onSelectionChange(e))),this._onChangeAbortController===e&&(this._onChangeAbortController=null)},this._cancelOnSelectionChange=()=>this._onChangeAbortController?.abort(),this._onSelectionChangeDebounced=s(this._onSelectionChangeController,I)}initialize(){this.addHandles([n((()=>[this.view,this.effectiveSelectionManager]),(()=>this._onSelectionChangeDebounced())),a((()=>this.effectiveSelectionManager?.sources),"change",(()=>this._onSelectionChangeDebounced())),a((()=>this.effectiveSelectionManager),"selection-change",(()=>this._onSelectionChangeDebounced()))])}destroy(){this.removeTemporaryHighlight(),this._updatingHandles.destroy()}get effectiveCount(){return d(this.layerItems)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get isUpdating(){return!(!this._onChangeAbortController&&!this._updatingHandles.updating)}get layerItems(){return this._layerItems??[]}get layerViewMap(){const e=new Map,{view:t}=this;if(!t)return e;for(const o of t.allLayerViews)if(e.set(o.layer.id,o),p(o.layer))for(const t of o.layer.sublayers)e.set(t.id,o);return e}get maxVisibleFeatureCountExceeded(){return this.layerItems.some((e=>e.maxVisibleFeatureCountExceeded))}get selectionSources(){const e=this.effectiveSelectionManager,t=new Set;if(e?.sources)for(const o of e.sources)t.add(o);return t}get selectionsByLayerMap(){const e=this.effectiveSelectionManager,t=new Map;if(!e||"ready"!==this.state)return t;for(const{layer:o,selection:r}of e.selections)t.set(o,r);return t}get state(){const{view:e}=this;return e?e.ready?this.effectiveSelectionManager?"ready":"error":"loading":"disabled"}get totalCount(){return this.effectiveSelectionManager?.count??0}get viewLayersAndTables(){const{view:e}=this;return e?.map?[...e.map.layers.toArray().reverse(),...e.map.tables.toArray().reverse()]:[]}addTemporaryHighlight({graphic:e,layerView:t}){this.removeTemporaryHighlight(),t&&e&&(this._hoverHighlightHandle=t.highlight(e,{name:"temporary"}))}clear(){this.effectiveSelectionManager?.clear()}deselectFeatureItem(e){const t=e.graphic.getObjectId();null!=t&&this.effectiveSelectionManager?.removeFromSelection(e.layer,[t])}deselectGroupItem(e){e.children.forEach((e=>{v(e)?this.deselectLayerItem(e):this.deselectGroupItem(e)}))}deselectLayerItem(e){this.effectiveSelectionManager?.setSelection(e.layer,[])}deselectItem(e){S(e)?this.deselectGroupItem(e):v(e)?this.deselectLayerItem(e):this.deselectFeatureItem(e)}goToItem(e){v(e)||S(e)?this._goTo(C([e]).map((e=>e.graphic))):this._goTo(e.graphic)}layersToItems(e){const{controller:t,layers:o,promises:r}=e,{_groupItemCache:i,_layerItemCache:s,effectiveSelectionManager:n,viewLayersAndTables:a}=this,l=o??a;if(!n)return[];const c=[];for(const h of l)switch(h.type){case"subtype-group":case"group":{const e=i.get(h),o=e??new u({layer:h,viewModel:this});e||i.set(h,o),r.push(o.sync({controller:t,promises:r})),c.push(o)}break;default:if(m(h)||g(h)){const e=h,o=n.getSelection(e);if(!o?.length)continue;const i=s.get(e),a=i??new f({layer:e,viewModel:this});i||s.set(e,a),r.push(a.sync({controller:t,promises:r})),c.push(a)}}return c}removeFromSelection(e){this.effectiveSelectionManager?.removeFromSelection(e.layer,e.objectIds)}removeTemporaryHighlight(){this._hoverHighlightHandle=r(this._hoverHighlightHandle)}selectSingleFeatureItem(e){const t=e.objectId;if(null!=t&&this.effectiveSelectionManager)for(const{layer:o}of this.effectiveSelectionManager.selections)this.setSelection({layer:o,objectIds:o===e.layer?[t]:[]})}selectSingleGroupItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:o}of this.effectiveSelectionManager.selections)this.setSelection({layer:t,objectIds:t.parent===e.layer?o:[]})}selectSingleItem(e){S(e)?this.selectSingleGroupItem(e):v(e)?this.selectSingleLayerItem(e):this.selectSingleFeatureItem(e)}selectSingleLayerItem(e){if(this.effectiveSelectionManager)for(const{layer:t,selection:o}of this.effectiveSelectionManager.selections)this.setSelection({layer:t,objectIds:t===e.layer?o:[]})}setSelection(e){this.effectiveSelectionManager?.setSelection(e.layer,e.objectIds)}async _goTo(e){const{view:t}=this;if(t)try{await y(t,e)}catch(r){"AbortError"!==r.name&&o.getLogger(this).warn("Failed to go to feature(s)",r)}}async _onSelectionChange(e){try{this.removeTemporaryHighlight();const t=[],o=this.layersToItems({controller:e,promises:t});t.length>0&&await Promise.all(t),this._onChangeAbortController===e&&(this._layerItems=o)}catch(t){o.getLogger(this).warn("Failed updating selection",t)}}};e([l()],_.prototype,"_groupItemCache",void 0),e([l()],_.prototype,"_hoverHighlightHandle",void 0),e([l()],_.prototype,"_layerItemCache",void 0),e([l()],_.prototype,"_layerItems",void 0),e([l()],_.prototype,"_onChangeAbortController",void 0),e([l()],_.prototype,"effectiveCount",null),e([l()],_.prototype,"effectiveSelectionManager",null),e([l()],_.prototype,"featureTitleMap",void 0),e([l()],_.prototype,"isUpdating",null),e([l()],_.prototype,"layerItems",null),e([l()],_.prototype,"layerViewMap",null),e([l()],_.prototype,"maxVisibleFeatureCountExceeded",null),e([l()],_.prototype,"maxVisibleFeatureCountPerLayer",void 0),e([l()],_.prototype,"selectionManager",void 0),e([l()],_.prototype,"selectionSources",null),e([l()],_.prototype,"selectionsByLayerMap",null),e([l()],_.prototype,"state",null),e([l()],_.prototype,"totalCount",null),e([l()],_.prototype,"view",void 0),e([l()],_.prototype,"viewLayersAndTables",null),_=e([c("esri.widgets.support.SelectionList.SelectionListViewModel")],_);const M=_;export{M as default};
|