@arcgis/core 5.1.0-next.105 → 5.1.0-next.106
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.d.ts +5 -5
- package/analysis/DimensionAnalysis.d.ts +3 -3
- package/analysis/DimensionSimpleStyle.d.ts +2 -2
- package/analysis/DirectLineMeasurementAnalysis.d.ts +4 -4
- package/analysis/DistanceMeasurementAnalysis.d.ts +4 -4
- package/analysis/ElevationProfileAnalysis.d.ts +3 -3
- package/analysis/LengthDimension.d.ts +2 -2
- package/analysis/LineOfSightAnalysis.d.ts +4 -4
- package/analysis/ShadowCast/DiscreteOptions.d.ts +7 -3
- package/analysis/ShadowCast/MinDurationOptions.d.ts +5 -1
- package/analysis/ShadowCast/TotalDurationOptions.d.ts +7 -3
- package/analysis/ShadowCast/types.d.ts +1 -1
- package/analysis/ShadowCastAnalysis.d.ts +11 -6
- package/analysis/SliceAnalysis.d.ts +4 -4
- package/analysis/SlicePlane.d.ts +3 -3
- package/analysis/Viewshed.d.ts +2 -2
- package/analysis/ViewshedAnalysis.d.ts +3 -3
- package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -1
- package/analysis/VolumeMeasurementAnalysis.d.ts +3 -3
- package/applications/Components/imageryUtils.d.ts +24 -0
- package/applications/Components/layerUtils.d.ts +21 -0
- package/applications/Components/layerUtils.js +2 -0
- package/applications/Components/templateUtils.d.ts +11 -1
- package/applications/Components/templateUtils.js +1 -1
- package/arcgisGlobal.d.ts +1 -0
- package/assets/components/assets/icon/buttons16.json +1 -0
- package/assets/components/assets/icon/buttons24.json +1 -0
- package/assets/components/assets/icon/buttons32.json +1 -0
- package/assets/components/assets/icon/entityTypes16.json +1 -0
- package/assets/components/assets/icon/entityTypes24.json +1 -0
- package/assets/components/assets/icon/entityTypes32.json +1 -0
- package/assets/esri/core/t9n/Units_ar.json +1 -1
- package/assets/esri/core/t9n/Units_bg.json +1 -1
- package/assets/esri/core/t9n/Units_bs.json +1 -1
- package/assets/esri/core/t9n/Units_ca.json +1 -1
- package/assets/esri/core/t9n/Units_cs.json +1 -1
- package/assets/esri/core/t9n/Units_da.json +1 -1
- package/assets/esri/core/t9n/Units_de.json +1 -1
- package/assets/esri/core/t9n/Units_el.json +1 -1
- package/assets/esri/core/t9n/Units_es.json +1 -1
- package/assets/esri/core/t9n/Units_et.json +1 -1
- package/assets/esri/core/t9n/Units_fi.json +1 -1
- package/assets/esri/core/t9n/Units_fr.json +1 -1
- package/assets/esri/core/t9n/Units_he.json +1 -1
- package/assets/esri/core/t9n/Units_hr.json +1 -1
- package/assets/esri/core/t9n/Units_hu.json +1 -1
- package/assets/esri/core/t9n/Units_id.json +1 -1
- package/assets/esri/core/t9n/Units_it.json +1 -1
- package/assets/esri/core/t9n/Units_ja.json +1 -1
- package/assets/esri/core/t9n/Units_ko.json +1 -1
- package/assets/esri/core/t9n/Units_lt.json +1 -1
- package/assets/esri/core/t9n/Units_lv.json +1 -1
- package/assets/esri/core/t9n/Units_nl.json +1 -1
- package/assets/esri/core/t9n/Units_no.json +1 -1
- package/assets/esri/core/t9n/Units_pl.json +1 -1
- package/assets/esri/core/t9n/Units_pt-BR.json +1 -1
- package/assets/esri/core/t9n/Units_pt-PT.json +1 -1
- package/assets/esri/core/t9n/Units_ro.json +1 -1
- package/assets/esri/core/t9n/Units_ru.json +1 -1
- package/assets/esri/core/t9n/Units_sk.json +1 -1
- package/assets/esri/core/t9n/Units_sl.json +1 -1
- package/assets/esri/core/t9n/Units_sr.json +1 -1
- package/assets/esri/core/t9n/Units_sv.json +1 -1
- package/assets/esri/core/t9n/Units_th.json +1 -1
- package/assets/esri/core/t9n/Units_tr.json +1 -1
- package/assets/esri/core/t9n/Units_uk.json +1 -1
- package/assets/esri/core/t9n/Units_vi.json +1 -1
- package/assets/esri/core/t9n/Units_zh-CN.json +1 -1
- package/assets/esri/core/t9n/Units_zh-HK.json +1 -1
- package/assets/esri/core/t9n/Units_zh-TW.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{6854b28853f5dd195110.js → 01c70c27aa3a955e2928.js} +1 -1
- package/assets/esri/core/workers/chunks/{2dced41ff2aa1bd86665.js → 065dd2fdc834146423c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{a0e72b107991ba38a9f0.js → 15920af0c4f46773b06e.js} +1 -1
- package/assets/esri/core/workers/chunks/179c9fe4ac83b42e5976.js +1 -0
- package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +2 -0
- package/assets/esri/core/workers/chunks/{24247ee93f43fff5e596.js.LICENSE.txt → 1d1929f98d941179be29.js.LICENSE.txt} +1 -3
- package/assets/esri/core/workers/chunks/1ebb613bbe09fcf274d8.js +1 -0
- package/assets/esri/core/workers/chunks/24b43fb12fc3009fdc30.js +1 -0
- package/assets/esri/core/workers/chunks/2b9661700743d1f9717e.js +1 -0
- package/assets/esri/core/workers/chunks/2f0a3b22fc46d832e240.js +1 -0
- package/assets/esri/core/workers/chunks/340f2c996f62f7f5ceae.js +1 -0
- package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +2 -0
- package/assets/esri/core/workers/chunks/{7485d59d60d61737d662.js → 55b765c72d13b3b911f9.js} +1 -1
- package/assets/esri/core/workers/chunks/5cdf87e7a59ace38df87.js +1 -0
- package/assets/esri/core/workers/chunks/622bdd1b9d5d292ec12b.js +1 -0
- package/assets/esri/core/workers/chunks/{359dbfbfb9acfb18bc6e.js → 63ea4191d441efd2f146.js} +1 -1
- package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +2 -0
- package/assets/esri/core/workers/chunks/6d20d741b8ae1a45b422.js +1 -0
- package/assets/esri/core/workers/chunks/702a3ef9e1b3442cbee7.js +1 -0
- package/assets/esri/core/workers/chunks/762e23466308f22d7076.js +1 -0
- package/assets/esri/core/workers/chunks/{52219561c144e5cb4442.js → 770611659b38066a6228.js} +1 -1
- package/assets/esri/core/workers/chunks/{e90afd914f2ccd4f5374.js → 7ce60331f94ee0a5d674.js} +6 -6
- package/assets/esri/core/workers/chunks/7e02e5c6979090fe3ea7.js +1 -0
- package/assets/esri/core/workers/chunks/825db2ea15308ee6e5dc.js +1 -0
- package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +1 -0
- package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +1 -0
- package/assets/esri/core/workers/chunks/{79dc7045d9a2d43ba8df.js → 890b7a1153b7f65eba9a.js} +1 -1
- package/assets/esri/core/workers/chunks/{44636ef119c6a576470b.js → 94eab215bab3e4e0e5b5.js} +1 -1
- package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +1 -0
- package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +1 -0
- package/assets/esri/core/workers/chunks/{fb415b01f0f1d644832d.js → a8ae00e06f98e04aee8e.js} +1 -1
- package/assets/esri/core/workers/chunks/aaad0d3e82ed917d3886.js +1 -0
- package/assets/esri/core/workers/chunks/b3e8ab68fc38306f13c6.js +1 -0
- package/assets/esri/core/workers/chunks/{39a8e6c9d710d3faea3c.js → b9850fe7dcdaed0c327c.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7e386ece75afb6e4be5.js → bc249bb667f0564ad093.js} +1 -1
- package/assets/esri/core/workers/chunks/{9b89cc85c1b5d561df7c.js → bd59cb5abc67e46f1b2c.js} +2 -2
- package/assets/esri/core/workers/chunks/{a943bd2e6fb7443c2b66.js → be817be7c81fb630122f.js} +1 -1
- package/assets/esri/core/workers/chunks/c4872cf3b71d00f450e1.js +1 -0
- package/assets/esri/core/workers/chunks/c5ab346a226df1894302.js +1 -0
- package/assets/esri/core/workers/chunks/{1e8d5bfc5f8c2664190c.js → d859c046a3ea42530bff.js} +1 -1
- package/assets/esri/core/workers/chunks/da29cf0e64065631a470.js +1 -0
- package/assets/esri/core/workers/chunks/{7617bd0f3a70dfe61637.js → dcba6c766eee8b90381a.js} +1 -1
- package/assets/esri/core/workers/chunks/ddebc1dc10a2d207389f.js +1 -0
- package/assets/esri/core/workers/chunks/e393fd61deb2e7f22ee6.js +1 -0
- package/assets/esri/core/workers/chunks/ea2bf7c543cc536400b7.js +30 -0
- package/assets/esri/core/workers/chunks/ece30bfd5c49b8d99752.js +1 -0
- package/assets/esri/core/workers/chunks/ecf4d07917efc97eb991.js +1 -0
- package/assets/esri/core/workers/chunks/ee56290e600cbeb25a00.js +1 -0
- package/assets/esri/core/workers/chunks/f52c6efc5a2abf5ac845.js +1 -0
- package/assets/esri/core/workers/chunks/f7fe17a22390a24d6df8.js +2 -0
- package/assets/esri/core/workers/chunks/f9324420f2c6ac240f63.js +1 -0
- package/assets/esri/core/workers/chunks/{855bf811cd79b97c169a.js → fae2c8f053927559fff0.js} +1 -1
- package/assets/esri/core/workers/chunks/fc1fe1f58a65a1694c09.js +1 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +84 -1
- 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/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +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/ComponentShader.glsl.js +11 -15
- package/config.js +1 -1
- package/core/generatorUtils.js +2 -0
- package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
- package/core/libs/gl-matrix-2/math/vec2.js +1 -1
- package/core/mathUtils.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/geometry/HeightModelInfo.js +1 -1
- package/geometry/geometryEngine.d.ts +2 -2
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/vcsData.js +1 -1
- package/geometry/support/vcsLookup.js +1 -1
- package/kernel.js +1 -1
- package/layers/DimensionLayer.d.ts +5 -5
- package/layers/FeatureLayer.d.ts +2 -2
- package/layers/GaussianSplatLayer.d.ts +3 -3
- package/layers/LineOfSightLayer.d.ts +5 -5
- package/layers/ParquetLayer.d.ts +6 -4
- package/layers/SubtypeGroupLayer.d.ts +2 -2
- package/layers/ViewshedLayer.d.ts +3 -3
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +2 -0
- package/layers/graphics/sources/parquet/PortalParquetFileProvider.js +2 -0
- package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +2 -0
- package/layers/graphics/sources/parquet/UrlsFileProvider.js +2 -0
- package/layers/graphics/sources/parquet/createFileProvider.js +2 -0
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +1 -1
- package/layers/raster/datasets/pixelReader.js +1 -1
- package/layers/raster/formats/JpgPlus.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/raster/functions/clipUtils.js +1 -1
- package/layers/support/AggregateField.d.ts +2 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/SubtypeSublayer.d.ts +4 -4
- package/layers/support/parquetUtils.d.ts +18 -7
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/rasterFunctionUtils.d.ts +2 -2
- package/layers/video/VideoController.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/linkChart/ChronologicalLayoutSettings.d.ts +1 -1
- package/networks/CircuitManager.d.ts +3 -3
- package/networks/UnitIdentifierManager.d.ts +1 -1
- package/networks/UnitIdentifierManager.js +1 -1
- package/networks/UtilityNetwork.d.ts +2 -2
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/Circuit.d.ts +1 -1
- package/networks/support/CircuitLocation.d.ts +1 -1
- package/networks/support/CircuitSection.d.ts +1 -1
- package/networks/support/Subcircuit.d.ts +1 -1
- package/networks/support/TraceJobInfo.js +1 -1
- package/networks/support/jsonTypes.d.ts +10 -3
- package/package.json +2 -2
- package/popup/FieldInfo.d.ts +4 -2
- package/popup/support/FieldInfoFormat.d.ts +3 -2
- package/rest/featureService/FeatureService.d.ts +1 -1
- package/rest/knowledgeGraph/FieldIndex.d.ts +1 -1
- package/rest/knowledgeGraph/GraphObjectType.d.ts +2 -2
- package/rest/knowledgeGraph/GraphSearch.d.ts +1 -1
- package/rest/knowledgeGraph/GraphSearchStreaming.d.ts +1 -1
- package/rest/networks/circuits/support/ExportCircuitsParameters.d.ts +19 -1
- package/rest/networks/circuits/support/ExportCircuitsResult.js +1 -1
- package/rest/networks/circuits/support/VerifyCircuitsParameters.d.ts +18 -10
- package/rest/networks/circuits/support/VerifyCircuitsParameters.js +1 -1
- package/rest/networks/support/TraceParameters.js +1 -1
- package/rest/networks/support/TraceResult.js +1 -1
- package/rest/networks/trace.js +1 -1
- package/rest/networks/unitIdentifiers/support/QueryUnitIdentifiersParameters.js +1 -1
- package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
- package/rest/support/GeneralizeParameters.d.ts +1 -1
- package/rest/support/Query.d.ts +1 -1
- package/rest/support/RelationParameters.d.ts +1 -1
- package/rest/support/types.d.ts +1 -1
- package/support/revision.js +1 -1
- package/symbols/CIMSymbol.d.ts +1 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +1 -0
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ParquetSnapshotSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ParquetSourceChunk.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.d.ts +1 -0
- package/views/3d/analysis/DimensionAnalysisView3D.d.ts +7 -6
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.d.ts +2 -0
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +2 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +5 -1
- package/views/3d/analysis/SliceAnalysisView3D.d.ts +4 -3
- package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedInteractionVisuals.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedPlacementOperation.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedPlacementRootPlugin.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +2 -0
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool2.js +1 -1
- package/views/3d/analysis/Viewshed/analysisViewRegister.js +1 -1
- package/views/3d/analysis/Viewshed/placementUtils.js +2 -0
- package/views/3d/analysis/Viewshed/toolLifecycleUtils.js +2 -0
- package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +4 -3
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/support/UVWorkspace.js +2 -0
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/layers/support/uvUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
- package/views/3d/support/meshProcessing.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +13 -9
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +63 -49
- package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
- package/views/3d/webgl-engine/materials/PathLayouts.js +2 -0
- 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/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +2 -3
- package/views/PopupView.d.ts +77 -1
- package/views/PopupView.js +1 -1
- package/views/layers/DimensionLayerView.d.ts +2 -1
- package/views/layers/LineOfSightLayerView.d.ts +2 -1
- package/views/layers/ViewshedLayerView.d.ts +2 -1
- package/webscene/Slide.js +1 -1
- package/widgets/Attachments/types.d.ts +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +38 -5
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +2 -0
- package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +11 -0
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +77 -0
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/interfaceUtils.js +2 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/types.d.ts +30 -2
- package/widgets/BatchAttributeForm.d.ts +52 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/Editor.d.ts +1 -1
- package/widgets/FeatureTable/FieldColumn.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/TimeSlider.d.ts +3 -3
- package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +10 -0
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/support/ContingentValuesManager.js +1 -1
- package/widgets/support/forms/formUtils.js +1 -1
- package/assets/esri/core/workers/chunks/11b0d3a825fe50dd1e84.js +0 -1
- package/assets/esri/core/workers/chunks/130851b81f04e6a008cd.js +0 -1
- package/assets/esri/core/workers/chunks/1a3426276dc82a8a80f2.js +0 -1
- package/assets/esri/core/workers/chunks/1c8a21b7b60c0709e6b2.js +0 -1
- package/assets/esri/core/workers/chunks/24247ee93f43fff5e596.js +0 -2
- package/assets/esri/core/workers/chunks/276cb6a1cdd26d0e1444.js +0 -1
- package/assets/esri/core/workers/chunks/2f903bd3a2611e7f0946.js +0 -30
- package/assets/esri/core/workers/chunks/2fda38219d778f0447b5.js +0 -1
- package/assets/esri/core/workers/chunks/38d7430d2370b69334d7.js +0 -1
- package/assets/esri/core/workers/chunks/39d6032d79720935910d.js +0 -1
- package/assets/esri/core/workers/chunks/5dafd35801dca4229aed.js +0 -1
- package/assets/esri/core/workers/chunks/642be1619c0e76355cb6.js +0 -1
- package/assets/esri/core/workers/chunks/6d66dc77af8d112c33c6.js +0 -1
- package/assets/esri/core/workers/chunks/7b3642195d6d3ea9b830.js +0 -1
- package/assets/esri/core/workers/chunks/7b66691d133dabd87ce6.js +0 -1
- package/assets/esri/core/workers/chunks/7e57029ec958f6423d5d.js +0 -2
- package/assets/esri/core/workers/chunks/8042e001545e2782499c.js +0 -1
- package/assets/esri/core/workers/chunks/881234f25c7814de8753.js +0 -1
- package/assets/esri/core/workers/chunks/8a7682071941c35f05c1.js +0 -1
- package/assets/esri/core/workers/chunks/8fdd57e2a0af647f1e3e.js +0 -1
- package/assets/esri/core/workers/chunks/90ea570f6b6ce8ca693b.js +0 -1
- package/assets/esri/core/workers/chunks/9373daa677dc767d7cf0.js +0 -1
- package/assets/esri/core/workers/chunks/95df6d2ebacc43ac5fa3.js +0 -1
- package/assets/esri/core/workers/chunks/a02ebdcb802d128c8eee.js +0 -1
- package/assets/esri/core/workers/chunks/adf72d87f0114aeade0e.js +0 -1
- package/assets/esri/core/workers/chunks/aec4a4cd7044fdbbbe34.js +0 -1
- package/assets/esri/core/workers/chunks/b1a21a4d7d73ad7d0e47.js +0 -1
- package/assets/esri/core/workers/chunks/b262478da29470abb72b.js +0 -2
- package/assets/esri/core/workers/chunks/b75e090a7e935ff870a3.js +0 -1
- package/assets/esri/core/workers/chunks/bacf0c9d5d3e084dea61.js +0 -1
- package/assets/esri/core/workers/chunks/c0e4fd6fa1d765275248.js +0 -2
- package/assets/esri/core/workers/chunks/cfaa6e205bfc0c94a1b1.js +0 -1
- package/assets/esri/core/workers/chunks/d3f08f1a9a250cd8a2c8.js +0 -1
- package/assets/esri/core/workers/chunks/dcb7a3ff59677b1cf0f1.js +0 -1
- /package/assets/esri/core/workers/chunks/{7e57029ec958f6423d5d.js.LICENSE.txt → 549d348ca181d06aefb7.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{b262478da29470abb72b.js.LICENSE.txt → 69c9eb93553b006b640d.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{9b89cc85c1b5d561df7c.js.LICENSE.txt → bd59cb5abc67e46f1b2c.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c0e4fd6fa1d765275248.js.LICENSE.txt → f7fe17a22390a24d6df8.js.LICENSE.txt} +0 -0
package/views/PopupView.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import type Graphic from "../Graphic.js";
|
|
1
2
|
import type Popup from "../widgets/Popup.js";
|
|
3
|
+
import type { AbortOptions } from "../core/promiseUtils.js";
|
|
4
|
+
import type { ScreenPoint } from "../core/types.js";
|
|
5
|
+
import type { PointerType } from "./input/types.js";
|
|
2
6
|
import type { PopupProperties } from "../widgets/Popup.js";
|
|
3
7
|
import type { PopupOpenOptions } from "../widgets/Popup/types.js";
|
|
4
8
|
|
|
@@ -114,6 +118,62 @@ export abstract class PopupView {
|
|
|
114
118
|
* }
|
|
115
119
|
*/
|
|
116
120
|
closePopup(): void;
|
|
121
|
+
/**
|
|
122
|
+
* Use this method to query for features at a given screen location.
|
|
123
|
+
* These features come from origins (layers and sublayers) configured with a [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/)
|
|
124
|
+
* and have its [FeatureLayer.popupEnabled](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#popupEnabled) set.
|
|
125
|
+
*
|
|
126
|
+
* One example could be a custom side panel that displays feature-specific information based on
|
|
127
|
+
* an end user's click location. This method allows a developer to
|
|
128
|
+
* control how the input location is handled, and then subsequently, what to do with the results.
|
|
129
|
+
*
|
|
130
|
+
* @param screenPoint
|
|
131
|
+
* @param options
|
|
132
|
+
* @returns An async generator of features ready to be displayed by the popup,
|
|
133
|
+
* with the attributes and geometry required by their popup template.
|
|
134
|
+
* Generator yields features as soon as they are available in the top to bottom order.
|
|
135
|
+
* @since 5.1
|
|
136
|
+
* @example
|
|
137
|
+
* // Consume features from the generator as soon as they are available
|
|
138
|
+
* view.on("click", async (event) => {
|
|
139
|
+
* const generator = view.fetchPopupFeatures(event.screenPoint, {
|
|
140
|
+
* pointerType: event.pointerType
|
|
141
|
+
* });
|
|
142
|
+
*
|
|
143
|
+
* for await (const feature of generator) {
|
|
144
|
+
* console.log(feature);
|
|
145
|
+
* }
|
|
146
|
+
* });
|
|
147
|
+
* @example
|
|
148
|
+
* // Wait for all the features to be available
|
|
149
|
+
* view.on("click", async (event) => {
|
|
150
|
+
* const generator = view.fetchPopupFeatures(event.screenPoint, {
|
|
151
|
+
* pointerType: event.pointerType
|
|
152
|
+
* });
|
|
153
|
+
*
|
|
154
|
+
* const features = await Array.fromAsync(generator);
|
|
155
|
+
*
|
|
156
|
+
* console.log(`${features.length} available for popup`);
|
|
157
|
+
* });
|
|
158
|
+
* @example
|
|
159
|
+
* // Get the top most feature
|
|
160
|
+
* view.on("click", async (event) => {
|
|
161
|
+
* const controller = new AbortController();
|
|
162
|
+
* const generator = view.fetchPopupFeatures(event.screenPoint, {
|
|
163
|
+
* pointerType: event.pointerType,
|
|
164
|
+
* signal: controller.signal
|
|
165
|
+
* });
|
|
166
|
+
*
|
|
167
|
+
* const result = await generator.next();
|
|
168
|
+
* const feature = result.done ? null : result.value;
|
|
169
|
+
*
|
|
170
|
+
* // abort the pending iterations
|
|
171
|
+
* controller.abort();
|
|
172
|
+
*
|
|
173
|
+
* console.log(`top most feature`, feature);
|
|
174
|
+
* });
|
|
175
|
+
*/
|
|
176
|
+
fetchPopupFeatures(screenPoint: ScreenPoint, options?: FetchPopupFeaturesOptions): AsyncGenerator<Graphic>;
|
|
117
177
|
/**
|
|
118
178
|
* Opens the popup at the given location with content defined either explicitly with `content`
|
|
119
179
|
* or driven from the [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/) of input features. This method sets
|
|
@@ -181,4 +241,20 @@ export abstract class PopupView {
|
|
|
181
241
|
openPopup(options?: ViewPopupOpenOptions): Promise<void>;
|
|
182
242
|
}
|
|
183
243
|
|
|
184
|
-
export type ViewPopupOpenOptions = Pick<PopupOpenOptions, "actions" | "content" | "features" | "fetchFeatures" | "location" | "promises" | "title" | "updateLocationEnabled">;
|
|
244
|
+
export type ViewPopupOpenOptions = Pick<PopupOpenOptions, "actions" | "content" | "features" | "fetchFeatures" | "location" | "promises" | "title" | "updateLocationEnabled">;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Options for the [fetchPopupFeatures()](https://developers.arcgis.com/javascript/latest/references/core/views/PopupView/#fetchPopupFeatures) method. See properties below for object specifications.
|
|
248
|
+
*
|
|
249
|
+
* @since 5.1
|
|
250
|
+
*/
|
|
251
|
+
export interface FetchPopupFeaturesOptions extends AbortOptions {
|
|
252
|
+
/**
|
|
253
|
+
* The type of pointer coming from the input event.
|
|
254
|
+
* It influences the tolerence when querying for features on services.
|
|
255
|
+
* A `touch` pointer uses a larger tolerence than `mouse` or `pen`.
|
|
256
|
+
*/
|
|
257
|
+
pointerType?: PointerType;
|
|
258
|
+
/** A default popup template is automatically used if no `popupTemplate` is defined for a feature's origin */
|
|
259
|
+
defaultPopupTemplateEnabled?: boolean;
|
|
260
|
+
}
|
package/views/PopupView.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as p}from"tslib";import{createTask as e}from"../core/asyncUtils.js";import t from"../core/Error.js";import has from"../core/has.js";import
|
|
2
|
+
import{__decorate as p}from"tslib";import{createTask as e}from"../core/asyncUtils.js";import t from"../core/Error.js";import{generatorFlat as o,generatorFromPromises as i}from"../core/generatorUtils.js";import has from"../core/has.js";import s from"../core/Logger.js";import{throwIfAborted as r,wrapAbortWithTimeout as u,allSettledValues as n}from"../core/promiseUtils.js";import{watch as a,syncAndInitial as h,whenOnce as c}from"../core/reactiveUtils.js";import{property as l,subclass as m}from"../core/accessorSupport/decorators.js";import{addPopup as d,openPopupWithViewClick as f,isPopup as w,isPopupElement as g,openPopupWithOptions as y,closePopup as P}from"./popupAdapter.js";import{ViewEventPriorities as V}from"./input/InputManager.js";const _=_=>{const j=_;let F=class extends j{constructor(...p){super(...p),this._popupSetupTask=null,this.popupEnabled=!0,this.popup={}}initialize(){this.addHandles([a(()=>[this.ui,this.popup,this.popupElement],([p,e,t],o)=>{const[i,s,r]=o??[];d(this,[p,e,t],[i,s,r])},h),this.on("click",p=>{this.popup&&this.popupEnabled&&("mouse"!==p.pointerType||0===p.button)&&f(this,p)},V.WIDGET)]),c(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>import("../widgets/Popup.js"))}destroy(){this.destroyed||this.closePopup()}get popup(){return this._get("popup")}set popup(p){this._set("popup",p)}async openPopup(p){if(w(this.popup))return this.popup.open(p);if(this.popupElement&&g(this.popupElement))this.popupElement.open(p).catch(()=>{});else try{if(await this.setupPopup(),!this.popup)return void s.getLogger(this).error(new t("view:null-popup","Popup is null and can't be opened"));y(this,p)}catch{}}closePopup(){this._popupSetupTask?.abort(),P(this.popup,this.popupElement)}async*fetchPopupFeatures(p,e){await this.when();const{pendingFeatures:t}=this._popupHitsToFeatures(await this._getPopupHits(p,e),e);yield*o(i(t,e),e)}async fetchPopupFeaturesLegacy(p,e){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(p,e),e)}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!w(this.popup))return this._popupSetupTask=e(async p=>{if(!this.popupEnabled||!g(this.popupElement))if(this.dependencies.popup&&"function"==typeof this.dependencies.popup)await this.dependencies.popup(),r(p),customElements.get("arcgis-popup")||s.getLogger(this).error(new t("view:undefined-popup-element","`arcgis-popup` custom element is undefined and can't be opened")),this.popupElement=document.createElement("arcgis-popup");else{const{default:e}=await import("../widgets/Popup.js");if(r(p),!this.popup||w(this.popup))return;const t=this.popup;if("open"in t||"close"in t){const{open:p,close:o,...i}=t;this.popup=new e({...i})}else this.popup=new e(t)}}),this._popupSetupTask.promise}_popupHitsToFeatures({location:p,hits:e},t){const o=[],i=[];let s=!1;const r=u(t,has("popup-view-fetch-timeout")??v),a=p=>{const e=new E(p);return i.push(e),o.push(e.promise),e},h=p=>{const e=i.at(-1);return e&&e.layerView===p&&!s?e:a(p)};for(const u of e)if("graphic"in u){h(u.layerView).graphics.push(u.graphic),s=!1}else o.push(u.layerView.fetchPopupFeaturesAtLocation(u.mapPoint,r)),s=!0;i.forEach(p=>p.resolve(r));const c=n(o).then(p=>p.filter(p=>!!p).flat());return{pendingFeatures:o,allGraphicsPromise:c,location:p}}async _getPopupHits(p,e){const{hits:t,location:o}=await this.popupHitTest(p);r(e);const i=[];for(const s of t)if("graphic"in s){if(this._isValidPopupGraphic(s.graphic,e)){const p=this._isValidPopupGraphicsLayerView(s.layerView)?s.layerView:void 0;i.push({graphic:s.graphic,layerView:p})}}else this._isValidPopupLocationLayerView(s.layerView)&&i.push({mapPoint:s.mapPoint,layerView:s.layerView});return{hits:i,location:o}}_isValidPopupGraphic(p,e){return p&&!!p.getEffectivePopupTemplate(e?.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(p){return!p||(!("layer"in p)||!p.suspended)&&"fetchPopupFeaturesFromGraphics"in p}_isValidPopupLocationLayerView(p){return(!("layer"in p)||!p.suspended)&&"fetchPopupFeaturesAtLocation"in p}};return p([l()],F.prototype,"popup",null),p([l()],F.prototype,"popupElement",void 0),p([l()],F.prototype,"popupEnabled",void 0),F=p([m("esri.views.PopupView")],F),F};class E{constructor(p){this.layerView=p,this._resolver=Promise.withResolvers(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(p){const{layerView:e,graphics:t,_resolver:o}=this;if(!e)return o.resolve(t),o.promise;let i;return e.fetchPopupFeaturesFromGraphics(t,p).catch(p=>(i=p,null)).then(p=>{p?o.resolve(p):o.reject(i)}),o.promise}}const v=5e3;export{_ as PopupView};
|
|
@@ -28,7 +28,7 @@ export interface DimensionLayerViewProperties extends LayerViewProperties, Parti
|
|
|
28
28
|
* view.map.add(dimensionLayer);
|
|
29
29
|
*
|
|
30
30
|
* // retrieve layer view for the layer
|
|
31
|
-
* const
|
|
31
|
+
* const layerView = await view.whenLayerView(dimensionLayer);
|
|
32
32
|
* ```
|
|
33
33
|
*
|
|
34
34
|
* > [!WARNING]
|
|
@@ -46,6 +46,7 @@ export interface DimensionLayerViewProperties extends LayerViewProperties, Parti
|
|
|
46
46
|
* @see [DimensionSimpleStyle](https://developers.arcgis.com/javascript/latest/references/core/analysis/DimensionSimpleStyle/)
|
|
47
47
|
* @see [DimensionAnalysisView3D](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/DimensionAnalysisView3D/)
|
|
48
48
|
* @see [Sample - Length dimensioning](https://developers.arcgis.com/javascript/latest/sample-code/layers-dimension/)
|
|
49
|
+
* @see [Async cancellation with AbortController](https://developers.arcgis.com/javascript/latest/async-cancellation-with-abortcontroller/)
|
|
49
50
|
*/
|
|
50
51
|
export default abstract class DimensionLayerView extends LayerView {
|
|
51
52
|
/**
|
|
@@ -26,7 +26,7 @@ export interface LineOfSightLayerViewProperties extends LayerViewProperties, Par
|
|
|
26
26
|
* view.map.add(lineOfSightLayer);
|
|
27
27
|
*
|
|
28
28
|
* // retrieve layer view for the layer
|
|
29
|
-
* const
|
|
29
|
+
* const layerView = await view.whenLayerView(lineOfSightLayer);
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
32
|
* @see [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/)
|
|
@@ -35,6 +35,7 @@ export interface LineOfSightLayerViewProperties extends LayerViewProperties, Par
|
|
|
35
35
|
* @see [LineOfSightAnalysisObserver](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisObserver/)
|
|
36
36
|
* @see [LineOfSightAnalysisView3D](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/)
|
|
37
37
|
* @see [Line Of Sight component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-line-of-sight/)
|
|
38
|
+
* @see [Async cancellation with AbortController](https://developers.arcgis.com/javascript/latest/async-cancellation-with-abortcontroller/)
|
|
38
39
|
*/
|
|
39
40
|
export default abstract class LineOfSightLayerView extends LayerView {
|
|
40
41
|
/**
|
|
@@ -26,7 +26,7 @@ export interface ViewshedLayerViewProperties extends LayerViewProperties, Partia
|
|
|
26
26
|
* view.map.add(viewshedLayer);
|
|
27
27
|
*
|
|
28
28
|
* // retrieve layer view for the layer
|
|
29
|
-
* const
|
|
29
|
+
* const layerView = await view.whenLayerView(viewshedLayer);
|
|
30
30
|
* ```
|
|
31
31
|
*
|
|
32
32
|
* @since 4.31
|
|
@@ -35,6 +35,7 @@ export interface ViewshedLayerViewProperties extends LayerViewProperties, Partia
|
|
|
35
35
|
* @see [ViewshedAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ViewshedAnalysis/)
|
|
36
36
|
* @see [ViewshedAnalysisView3D](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/ViewshedAnalysisView3D/)
|
|
37
37
|
* @see [Sample - ViewshedLayer in slides](https://developers.arcgis.com/javascript/latest/sample-code/layers-viewshed/)
|
|
38
|
+
* @see [Async cancellation with AbortController](https://developers.arcgis.com/javascript/latest/async-cancellation-with-abortcontroller/)
|
|
38
39
|
*/
|
|
39
40
|
export default abstract class ViewshedLayerView extends LayerView {
|
|
40
41
|
/**
|
package/webscene/Slide.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{EventedMixin as a}from"../core/Evented.js";import{JSONSupport as l}from"../core/JSONSupport.js";import p from"../core/Logger.js";import{moduloPositive as m}from"../core/mathUtils.js";import{destroyMaybe as h,removeMaybe as c}from"../core/maybe.js";import{onAbortOrThrow as d,createAbortError as u,isAbortError as y}from"../core/promiseUtils.js";import{whenOnce as g,when as b}from"../core/reactiveUtils.js";import{Milliseconds as v,Seconds as w}from"../core/time.js";import{property as f,cast as T,subclass as _}from"../core/accessorSupport/decorators.js";import{ensureType as j}from"../core/accessorSupport/ensureType.js";import{squaredDistance as L}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as C}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import E from"../layers/Layer.js";import{basemapEnsureType as S,clonePreservingTiledLayers as A}from"../support/basemapEnsureType.js";import{TaskPriority as V}from"../views/support/Scheduler.js";import k from"../webdoc/support/SlideThumbnail.js";import{timeExtent as U}from"../webdoc/support/timeProperties.js";import x from"./SunLighting.js";import F from"./VirtualLighting.js";import I from"./support/Description.js";import R from"./support/SlideElements.js";import D from"./support/SlideEnvironment.js";import O from"./support/SlideGround.js";import P from"./support/SlideVisibleLayer.js";import q from"./support/Title.js";let M=0;const N=s.ofType(P),B=["caption","cover","none"];let G=class extends(r(a(l))){constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+M++,this.hidden=!1,this.viewpoint=null,this.ground=null,this.layout="caption",this.enabledFocusAreas=null,this.environment=new D,this.timeExtent=null,this.elements=new R,this.title=new q,this.description=new I,this.thumbnail=new k,this.visibleLayers=new N}destroy(){this.visibleLayers.removeAll(),this.enabledFocusAreas=null,this.basemap=null,this.thumbnail=h(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.elements.destroy()}get title(){return this._get("title")}set title(e){e="string"==typeof e?new q({text:e}):j(q,e),this._set("title",e)}get description(){return this._get("description")}set description(e){e="string"==typeof e?new I({text:e}):j(I,e),this._set("description",e)}get thumbnail(){return this._get("thumbnail")}set thumbnail(e){e="string"==typeof e?new k({url:e}):j(k,e),this._set("thumbnail",e)}get basemap(){return this._get("basemap")}set basemap(e){this._set("basemap",S(e))}set visibleLayers(e){this._set("visibleLayers",o(e,this._get("visibleLayers"),N))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map(e=>{if("string"==typeof e)return{id:e};if(e instanceof E){const t=J(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:"sublayerIds"in e?e.sublayerIds:void 0}:(p.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)}):null}async _updateVisibleLayers(e){const t=[];await Promise.allSettled(this._getLayers(e.map).map(i=>e.whenLayerView(i).then(e=>{if(e.visible){const n=J(i);t.push(new P({id:e.layer.id,sublayerIds:n}))}})).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}async updateFrom(e,t){const i={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};await e.when(),this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?F.prototype.clone.apply(e.environment.lighting):x.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.enabledFocusAreas=new s(e.focusAreasView?.enabledAreas.map(({id:e})=>e)??[]),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?O.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this.elements.analyses.updateFrom(e),await this._updateVisibleLayers(e);const n=await e.takeScreenshot(i);return this.thumbnail=new k({url:n.dataUrl}),this}async applyTo(e,t){this.emit("apply-slide-start"),null!=this._applyToController&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=d(t,()=>i?.abort()),s=()=>{this._applyToController===i&&(this._applyToController=null),i=null,r?.remove()};try{await g(()=>e.ready,i.signal)}catch(h){throw s(),h}if(i.signal.aborted)throw s(),this.emit("apply-slide-cancel"),u();const o=e.resourceController.scheduler.registerTask(V.SLIDE);let a=!1;const l={animate:!0,...t,signal:this._applyToController.signal},p=async()=>{await Promise.all([o.schedule(async()=>a=await this._setViewpointOfInterest(e,l)),o.schedule(()=>this._applyBasemap(e,l),l.signal),o.schedule(()=>this._loadLayersWithSublayerVisibility(e))]),await Promise.all([o.schedule(()=>this._applyLayerVisibility(e),l.signal),o.schedule(()=>this._applyFocusAreaEnabled(e.map?.focusAreas.areas)),o.schedule(()=>this._applyGround(e),l.signal),o.schedule(()=>this.elements.analyses.applyTo(e),l.signal),o.schedule(()=>this._applyViewpoint(e,l),l.signal),o.schedule(()=>e.timeExtent=this.timeExtent?.clone()??null,l.signal),o.schedule(()=>e.environment.weather=this.environment.weather.clone())])},m=await n(e.addUpdatingPromise(p()));if(a&&(e.contentCamera=null),o.remove(),s(),!1===m.ok)throw this.emit("apply-slide-cancel"),m.error;return this.emit("apply-slide-complete"),this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(y(i))throw i}e.map.basemap=A(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_applyFocusAreaEnabled(e){if(e&&this.enabledFocusAreas)for(const t of e)t.enabled=this.enabledFocusAreas.includes(t.id)}_getLayers(e){const t=new s;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach(e=>{e.persistenceEnabled&&(t.add(e),"layers"in e&&this._collectLayers(e,t))})}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map(e=>{const t=this.visibleLayers.find(t=>t.id===e.id)?.sublayerIds;return t?e.load():null}))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach(e=>{const t=this.visibleLayers.find(t=>t.id===e.id);e.visible=null!=t;const i=t?.sublayerIds,n=H(e);i&&n&&n.forEach(e=>e.visible=i.includes(e.id))})}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;const{toCameraAsync:i}=await import("../views/3d/support/viewpointUtils.js"),n=await i(e,this.viewpoint);return e.contentCamera=n,null!=n}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){const i=this.environment.lighting;if(t.animate&&"sun"===i.type&&i.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(i.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.glow=this.environment.lighting.glow,e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then(()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())}).catch(t=>{throw null==e.animation&&this._applyCachedCameraTrackingEnabled(e),t}).finally(()=>{c(i)})}_applyCachedCameraTrackingEnabled(e){null!=e.environment.cachedCameraTrackingEnabled&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[v(e.getTime()),w(3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds())]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e,t,i){const n=new Date(t.date.toString()),[r,s]=this._getTime(n),[o,a]=this._getTime(i.date),l=Q(s,a),p=e.renderCoordsHelper,m=C();p.toRenderCoords(e.camera.position,m);const h=C(),c=C();null!=this.viewpoint.camera&&p.toRenderCoords(this.viewpoint.camera.position,h);const d=new Date;return b(()=>e.camera,e=>{p.toRenderCoords(e.position,c);const i=L(m,c),n=L(h,c);let a=0;i+n!==0&&(a=i/(i+n));const u=r+(o-r)*a,y=X(s,w(l*a));t.date=this._setTime(d,u,y)})}write(e,t){const i=super.write(e,t);return i?.elements&&0===Object.keys(i.elements).length&&delete i.elements,i}static createFrom(e,t){return(new this).updateFrom(e,t)}};e([f({type:String,json:{write:{isRequired:!0}}})],G.prototype,"id",void 0),e([f({type:q,useTypeForAutocast:!1,json:{default:()=>new q({text:""}),write:{isRequired:!0}}})],G.prototype,"title",null),e([f({type:I,useTypeForAutocast:!1,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],G.prototype,"description",null),e([f({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],G.prototype,"hidden",void 0),e([f({type:k,useTypeForAutocast:!1,json:{default:()=>new k({url:""}),write:{isRequired:!0}}})],G.prototype,"thumbnail",null),e([f({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],G.prototype,"viewpoint",void 0),e([f({type:t,useTypeForAutocast:!1,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],G.prototype,"basemap",null),e([f({type:O,json:{write:!0}})],G.prototype,"ground",void 0),e([f({type:B,json:{write:!0,default:"caption"},nonNullable:!0})],G.prototype,"layout",void 0),e([f({type:N,json:{write:{isRequired:!0}}})],G.prototype,"visibleLayers",null),e([T("visibleLayers")],G.prototype,"castVisibleLayers",null),e([f({type:s.ofType(String),json:{write:!0},clonable:e=>e?new s(e.items):null})],G.prototype,"enabledFocusAreas",void 0),e([f({type:D,json:{write:!0}})],G.prototype,"environment",void 0),e([f(U)],G.prototype,"timeExtent",void 0),e([f({type:R,nonNullable:!0,json:{write:!0}})],G.prototype,"elements",void 0),G=e([_("esri.webscene.Slide")],G);const W=G;function H(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function J(e){const t=H(e);if(t)return t.filter(e=>e.visible).map(e=>e.id)}const z=w(86400),K=w(43200);function Q(e,t){let i=t-e;return i>K&&(i-=z),i<-K&&(i+=z),w(i)}function X(e,t){return w(m(e+t,z))}export{W as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import{ClonableMixin as r}from"../core/Clonable.js";import s from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import{EventedMixin as a}from"../core/Evented.js";import{JSONSupport as l}from"../core/JSONSupport.js";import p from"../core/Logger.js";import{moduloPositive as m}from"../core/mathUtils.js";import{destroyMaybe as h,removeMaybe as c}from"../core/maybe.js";import{onAbortOrThrow as d,createAbortError as u,isAbortError as y}from"../core/promiseUtils.js";import{whenOnce as g,when as b}from"../core/reactiveUtils.js";import{Milliseconds as v,Seconds as w}from"../core/time.js";import{property as f,cast as T,subclass as _}from"../core/accessorSupport/decorators.js";import{ensureType as j}from"../core/accessorSupport/ensureType.js";import{squaredDistance as L}from"../core/libs/gl-matrix-2/math/vec3.js";import{create as C}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import E from"../layers/Layer.js";import{basemapEnsureType as S,clonePreservingTiledLayers as A}from"../support/basemapEnsureType.js";import{TaskPriority as V}from"../views/support/Scheduler.js";import k from"../webdoc/support/SlideThumbnail.js";import{timeExtent as U}from"../webdoc/support/timeProperties.js";import x from"./SunLighting.js";import F from"./VirtualLighting.js";import I from"./support/Description.js";import R from"./support/SlideElements.js";import D from"./support/SlideEnvironment.js";import O from"./support/SlideGround.js";import P from"./support/SlideVisibleLayer.js";import q from"./support/Title.js";let M=0;const N=s.ofType(P),B=["caption","cover","none"];let G=class extends(r(a(l))){constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+M++,this.hidden=!1,this.viewpoint=null,this.ground=null,this.layout="caption",this.enabledFocusAreas=null,this.environment=new D,this.timeExtent=null,this.elements=new R,this.title=new q,this.description=new I,this.thumbnail=new k,this.visibleLayers=new N}destroy(){this.visibleLayers.removeAll(),this.enabledFocusAreas=null,this.basemap=null,this.thumbnail=h(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.elements.destroy()}get title(){return this._get("title")}set title(e){e="string"==typeof e?new q({text:e}):j(q,e),this._set("title",e)}get description(){return this._get("description")}set description(e){e="string"==typeof e?new I({text:e}):j(I,e),this._set("description",e)}get thumbnail(){return this._get("thumbnail")}set thumbnail(e){e="string"==typeof e?new k({url:e}):j(k,e),this._set("thumbnail",e)}get basemap(){return this._get("basemap")}set basemap(e){this._set("basemap",S(e))}set visibleLayers(e){this._set("visibleLayers",o(e,this._get("visibleLayers"),N))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map(e=>{if("string"==typeof e)return{id:e};if(e instanceof E){const t=J(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:"sublayerIds"in e?e.sublayerIds:void 0}:(p.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)}):null}async _updateVisibleLayers(e){const t=[];await Promise.allSettled(this._getLayers(e.map).map(i=>e.whenLayerView(i).then(e=>{if(e.visible){const n=J(i);t.push(new P({id:e.layer.id,sublayerIds:n}))}})).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}async updateFrom(e,t){const i={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};await e.when(),this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?F.prototype.clone.apply(e.environment.lighting):x.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.enabledFocusAreas=new s(e.focusAreasView?.enabledAreas.map(({id:e})=>e)??[]),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?O.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this.elements.analyses.updateFrom(e),await this._updateVisibleLayers(e);const n=await e.takeScreenshot(i);return this.thumbnail=new k({url:n.dataUrl}),this}async applyTo(e,t){this.emit("apply-slide-start"),null!=this._applyToController&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=d(t,()=>i?.abort()),s=()=>{this._applyToController===i&&(this._applyToController=null),i=null,r?.remove()};try{await g(()=>e.ready,i.signal)}catch(h){throw s(),h}if(i.signal.aborted)throw s(),this.emit("apply-slide-cancel"),u();const o=e.resourceController.scheduler.registerTask(V.SLIDE);let a=!1;const l={animate:!0,...t,signal:this._applyToController.signal},p=async()=>{await Promise.all([o.schedule(async()=>a=await this._setViewpointOfInterest(e,l)),o.schedule(()=>this._applyBasemap(e,l),l.signal),o.schedule(()=>this._loadLayersWithSublayerVisibility(e))]),await Promise.all([o.schedule(()=>this._applyLayerVisibility(e),l.signal),o.schedule(()=>this._applyFocusAreaEnabled(e.map?.focusAreas.areas)),o.schedule(()=>this._applyGround(e),l.signal),o.schedule(()=>this.elements.analyses.applyTo(e),l.signal),o.schedule(()=>this._applyViewpoint(e,l),l.signal),o.schedule(()=>e.timeExtent=this.timeExtent?.clone()??null,l.signal),o.schedule(()=>e.environment.weather=this.environment.weather.clone())])},m=await n(e.addUpdatingPromise(p()));if(a&&(e.contentCamera=null),o.remove(),s(),!1===m.ok)throw this.emit("apply-slide-cancel"),m.error;return this.emit("apply-slide-complete"),this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(y(i))throw i}e.map.basemap=A(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_applyFocusAreaEnabled(e){if(e&&this.enabledFocusAreas)for(const t of e)t.enabled=this.enabledFocusAreas.includes(t.id)}_getLayers(e){const t=new s;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach(e=>{e.persistenceEnabled&&(t.add(e),"layers"in e&&this._collectLayers(e,t))})}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map(e=>{const t=this.visibleLayers.find(t=>t.id===e.id)?.sublayerIds;return t?e.load():null}))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach(e=>{const t=this.visibleLayers.find(t=>t.id===e.id);e.visible=null!=t;const i=t?.sublayerIds,n=H(e);i&&n&&n.forEach(e=>e.visible=i.includes(e.id))})}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;const{toCameraAsync:i}=await import("../views/3d/support/viewpointUtils.js"),n=await i(e,this.viewpoint);return e.contentCamera=n,null!=n}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){const i=this.environment.lighting;if(t.animate&&"sun"===i.type&&i.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(i.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.glow=this.environment.lighting.glow,e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then(()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())}).catch(t=>{throw null==e.animation&&this._applyCachedCameraTrackingEnabled(e),t}).finally(()=>{c(i)})}_applyCachedCameraTrackingEnabled(e){null!=e.environment.cachedCameraTrackingEnabled&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[v(e.getTime()),w(3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds())]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e,t,i){const n=new Date(t.date.toString()),[r,s]=this._getTime(n),[o,a]=this._getTime(i.date),l=Q(s,a),p=e.renderCoordsHelper,m=C();p.toRenderCoords(e.camera.position,m);const h=C(),c=C();null!=this.viewpoint.camera&&p.toRenderCoords(this.viewpoint.camera.position,h);const d=new Date;return b(()=>e.camera,e=>{p.toRenderCoords(e.position,c);const i=L(m,c),n=L(h,c);let a=0;i+n!==0&&(a=i/(i+n));const u=r+(o-r)*a,y=X(s,w(l*a));t.date=this._setTime(d,u,y)})}write(e,t){t?.origin||(t={origin:"web-scene",...t});const i=super.write(e,t);return i?.elements&&0===Object.keys(i.elements).length&&delete i.elements,i}read(e,t){t?.origin||(t={origin:"web-scene",...t}),super.read(e,t)}static createFrom(e,t){return(new this).updateFrom(e,t)}};e([f({type:String,json:{write:{isRequired:!0}}})],G.prototype,"id",void 0),e([f({type:q,useTypeForAutocast:!1,json:{default:()=>new q({text:""}),write:{isRequired:!0}}})],G.prototype,"title",null),e([f({type:I,useTypeForAutocast:!1,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],G.prototype,"description",null),e([f({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],G.prototype,"hidden",void 0),e([f({type:k,useTypeForAutocast:!1,json:{default:()=>new k({url:""}),write:{isRequired:!0}}})],G.prototype,"thumbnail",null),e([f({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],G.prototype,"viewpoint",void 0),e([f({type:t,useTypeForAutocast:!1,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],G.prototype,"basemap",null),e([f({type:O,json:{write:!0}})],G.prototype,"ground",void 0),e([f({type:B,json:{write:!0,default:"caption"},nonNullable:!0})],G.prototype,"layout",void 0),e([f({type:N,json:{write:{isRequired:!0}}})],G.prototype,"visibleLayers",null),e([T("visibleLayers")],G.prototype,"castVisibleLayers",null),e([f({type:s.ofType(String),json:{write:!0},clonable:e=>e?new s(e.items):null})],G.prototype,"enabledFocusAreas",void 0),e([f({type:D,json:{write:!0}})],G.prototype,"environment",void 0),e([f(U)],G.prototype,"timeExtent",void 0),e([f({type:R,nonNullable:!0,json:{write:!0}})],G.prototype,"elements",void 0),G=e([_("esri.webscene.Slide")],G);const W=G;function H(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function J(e){const t=H(e);if(t)return t.filter(e=>e.visible).map(e=>e.id)}const z=w(86400),K=w(43200);function Q(e,t){let i=t-e;return i>K&&(i-=z),i<-K&&(i+=z),w(i)}function X(e,t){return w(m(e+t,z))}export{W as default};
|
|
@@ -29,7 +29,7 @@ export interface Operations {
|
|
|
29
29
|
/**
|
|
30
30
|
* An object that specifies the available attachments capabilities.
|
|
31
31
|
*
|
|
32
|
-
* @deprecated since 5.0, use the [Popup](https://developers.arcgis.com/javascript/latest/map-components/arcgis-popup) and [Editor](https://developers.arcgis.com/javascript/latest/map-components/arcgis-editor) component to view and edit attachments instead.
|
|
32
|
+
* @deprecated since 5.0, use the [Popup](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-popup) and [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor) component to view and edit attachments instead.
|
|
33
33
|
* @since 5.0
|
|
34
34
|
*/
|
|
35
35
|
export interface AttachmentsCapabilities {
|
|
@@ -2,16 +2,17 @@ import type Graphic from "../../Graphic.js";
|
|
|
2
2
|
import type EsriMap from "../../Map.js";
|
|
3
3
|
import type Collection from "../../core/Collection.js";
|
|
4
4
|
import type AttachmentInfo from "../../rest/query/support/AttachmentInfo.js";
|
|
5
|
+
import type AttachmentElementInput from "./inputs/AttachmentElementInput.js";
|
|
5
6
|
import type BatchFormInputs from "./inputs/BatchFormInputs.js";
|
|
6
7
|
import type FieldInput from "./inputs/FieldInput.js";
|
|
7
8
|
import type { EventedAccessor } from "../../core/Evented.js";
|
|
8
9
|
import type { FieldValue } from "../../layers/support/fieldUtils.js";
|
|
9
10
|
import type { TimeZone } from "../../time/types.js";
|
|
10
|
-
import type { AttachmentsChangeEvent, AttributeFormSupportedLayerInfo, AttributeFormSupportedLayerUnion, BatchAttributeFormMode, BatchAttributeFormState,
|
|
11
|
+
import type { AttachmentsChangeEvent, AttributeFormSupportedLayerInfo, AttributeFormSupportedLayerUnion, BatchAttributeFormMode, BatchAttributeFormState, SelectedAttachmentIdentifier, SelectedAttachmentDetails, SubmitEvent, ValueChangeEvent } from "./types.js";
|
|
11
12
|
import type { FormInput } from "./inputs/types.js";
|
|
12
13
|
import type { EditType } from "../support/forms/types.js";
|
|
13
14
|
|
|
14
|
-
export interface BatchAttributeFormViewModelProperties extends Partial<Pick<BatchAttributeFormViewModel, "activeFeatureIndex" | "disabled" | "editType" | "features" | "layerInfos" | "map" | "readOnly" | "submitHasBeenAttempted" | "timeZone" | "userHasChangedValues">> {}
|
|
15
|
+
export interface BatchAttributeFormViewModelProperties extends Partial<Pick<BatchAttributeFormViewModel, "activeFeatureIndex" | "disabled" | "editType" | "features" | "layerInfos" | "map" | "readOnly" | "selectedAttachment" | "selectedAttachmentAddElementId" | "submitHasBeenAttempted" | "timeZone" | "userHasChangedValues">> {}
|
|
15
16
|
|
|
16
17
|
export interface BatchAttributeFormViewModelEvents {
|
|
17
18
|
/**
|
|
@@ -195,8 +196,22 @@ export default class BatchAttributeFormViewModel extends EventedAccessor {
|
|
|
195
196
|
* @default false
|
|
196
197
|
*/
|
|
197
198
|
accessor readOnly: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* A reference to the current selected attachment. This is used to determine what attachment details to show in the "viewing-attachment-details" page.
|
|
201
|
+
*
|
|
202
|
+
* @internal
|
|
203
|
+
*/
|
|
204
|
+
accessor selectedAttachment: SelectedAttachmentIdentifier | null;
|
|
205
|
+
/** @internal */
|
|
206
|
+
accessor selectedAttachmentAddElementId: string | null;
|
|
198
207
|
/** @internal */
|
|
199
|
-
get
|
|
208
|
+
get selectedAttachmentAddInput(): AttachmentElementInput | null;
|
|
209
|
+
/**
|
|
210
|
+
* Details about the selected attachment. These details are used to drive the "viewing-attachment-details" page.
|
|
211
|
+
*
|
|
212
|
+
* @internal
|
|
213
|
+
*/
|
|
214
|
+
get selectedAttachmentDetails(): SelectedAttachmentDetails | null;
|
|
200
215
|
/** The set of form inputs used in `batch` editing [mode](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/BatchAttributeFormViewModel/#mode). */
|
|
201
216
|
get sharedForm(): BatchFormInputs;
|
|
202
217
|
/**
|
|
@@ -275,10 +290,28 @@ export default class BatchAttributeFormViewModel extends EventedAccessor {
|
|
|
275
290
|
*/
|
|
276
291
|
getValues(feature: Graphic): Graphic["attributes"];
|
|
277
292
|
/**
|
|
278
|
-
*
|
|
293
|
+
* Method for navigating back from nested pages. If there are no nested pages, this method does nothing.
|
|
294
|
+
* NOTE: Method is async for future proofing.
|
|
295
|
+
*
|
|
296
|
+
* @internal
|
|
297
|
+
*/
|
|
298
|
+
goBack(): Promise<void>;
|
|
299
|
+
/**
|
|
300
|
+
* Reset all nested views. This is similar to calling 'back()' until there are no more nested views.
|
|
301
|
+
*
|
|
302
|
+
* @internal
|
|
303
|
+
*/
|
|
304
|
+
goHome(): Promise<void>;
|
|
305
|
+
/**
|
|
306
|
+
* @param value - Selected attachment identifier, or `null`/`undefined` to clear the selection.
|
|
307
|
+
* @internal
|
|
308
|
+
*/
|
|
309
|
+
setSelectedAttachment(value: SelectedAttachmentIdentifier | null | undefined): void;
|
|
310
|
+
/**
|
|
311
|
+
* @param elementId - Attachment element identifier, or `null`/`undefined` to clear the selection.
|
|
279
312
|
* @internal
|
|
280
313
|
*/
|
|
281
|
-
|
|
314
|
+
setSelectedAttachmentAddElementId(elementId: string | null | undefined): void;
|
|
282
315
|
/**
|
|
283
316
|
* @param elementId - Attachment element identifier.
|
|
284
317
|
* @param files - Files to stage for addition.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{pushIfSome as t}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import i from"../../core/Error.js";import{EventedAccessor as a}from"../../core/Evented.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{abortMaybe as h,destroyMaybe as l}from"../../core/maybe.js";import{throwIfAborted as p,isAbortError as u}from"../../core/promiseUtils.js";import m from"../../core/ReactiveMap.js";import{on as c,sync as d,watch as f,whenOnce as y}from"../../core/reactiveUtils.js";import{property as g,subclass as v}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as _}from"../../core/support/UpdatingHandles.js";import F from"../../geometry/SpatialReference.js";import{getGraphicLayer as A}from"../../graphic/graphicOriginUtils.js";import{system as x}from"../../time/constants.js";import{createReactiveGraphic as w,isAttributeFormSupportedLayerWithAttachments as I,layerSupportsQueryAttachments as C,queryAttachmentsForElements as M}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as E}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as b}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as k}from"./expressions/ExpressionsModel.js";import T from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as V}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as j,isFieldInput as H}from"./inputs/support/inputUtils.js";import L from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as B}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as R}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as S,isGroupElementTemplate as G}from"./templates/support/templateUtils.js";import{isEmptyValue as U}from"../support/forms/formUtils.js";function W(e,t){return e?.find(e=>e.layer===t)}let N=class extends a{constructor(e){super(e),this._attachmentCache=new m,this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new r,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new E,this._selectedAttachment=null,this._activeFormInputsByElementId=new Map,this._emptyForm=new T({inputs:[]}),this._emptyFormTemplate=new L({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new m,this._updatingHandles=new _,this._layerTemplateMap=new m,this._layerContingentValuesMap=new m,this._workingFeatures=new r,this._expressionsManager=new b({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:x}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([c(()=>this.features,"after-changes",()=>{this.setSelectedAttachment(null),this.notifyChange("layers"),this._prepare()},d),f(()=>[this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),d),f(()=>this.activeForm,()=>{this._activeFormInputsByElementId.clear(),this._syncAttachments()},d),f(()=>this.activeFeature,()=>{this.setSelectedAttachment(null),this._syncAttachments()},d)]),this._prepare()}destroy(){this._prepareTask=h(this._prepareTask),this._workingFeatures.destroyAll(),l(this._expressionsManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new m,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get activeLayer(){const{activeFeature:e}=this;if(!e)return null;return A(e)??null}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":e.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":e.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return e.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid&&Array.from(this._featureFormMap.values()).every(e=>e.valid)}get layers(){const e=new Set;return this.features.forEach(t=>{const s=A(t);s&&e.add(s)}),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}get selectedAttachment(){return this._selectedAttachment}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(j(e)){const t=e.inputs.find(e=>H(e)&&!e.valid);if(t)return{input:t,groupInput:e}}if(H(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new i("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}async setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);await e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:t})}async setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new i("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}async stageAddAttachments(e,t){if(0===t.length)return[];const s=this._findAttachmentInput(e);if(!s)return[];const r=await s.stageAddAttachments(t,this._expressionsManager.arcadeContext);return this.userHasChangedValues=!0,this._emitAttachmentsChange(s),r}stageDeleteAttachment(e,t){const s=this._findAttachmentInput(e);if(!s)return;const r=this._findAttachment(s,t);r&&(s.stageDeleteAttachment(r),this.userHasChangedValues=!0,this._emitAttachmentsChange(s))}stageRenameAttachment(e,t,s){const r=this._findAttachmentInput(e);if(!r)return;const i=this._findAttachment(r,t);i&&0!==s.trim().length&&(r.stageRenameAttachment(i,s.trim()),this.userHasChangedValues=!0,this._emitAttachmentsChange(r))}async stageReplaceAttachment(e,t,s){const r=this._findAttachmentInput(e);if(!r)return;const i=this._findAttachment(r,t);i&&(await r.stageReplaceAttachment(i,s,this._expressionsManager.arcadeContext),this.userHasChangedValues=!0,this._emitAttachmentsChange(r))}clearAttachmentChanges(e){const t=this._findAttachmentInput(e);t&&(t.clearAttachmentChanges(),this._emitAttachmentsChange(t))}setSelectedAttachment(e){this._selectedAttachment=e??null}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await y(()=>!1===this.calculating);const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?V(t,{allFeatures:new r([e]),expressionsManager:this._expressionsManager,map:this.map}):this._emptyForm}_makeSubmitResults(){const e=new Map;for(const[s,r]of this._reactiveGraphicLookup){const i=[],a=[],n=this._featureFormMap.get(r)?.allAttachmentElementInputs??[];for(const e of n)t(i,e.toSubmitEdits()),e.valid||a.push(e.template.elementId);e.set(s,{feature:s,values:{...r.attributes},invalidFields:[],attachmentEdits:i,invalidAttachmentElementIds:a})}for(const t of this.sharedForm.allFieldInputs)for(const s of t.invalidFeatures)e.get(s)?.invalidFields.push(t.fieldName);return Array.from(e.values())}_findAttachmentInput(e){const t=this.activeForm.allAttachmentElementInputs.find(t=>t.template.elementId===e);return t||n.getLogger(this).error(`Attachment input not found for elementId '${e}'`),t}_findAttachment(e,t){const s=e.findAttachment(t);return s||n.getLogger(this).error(`Attachment '${t}' not found for attachment element '${e.template.elementId}'`),s}_makeAttachmentEdits(e){const s=[];for(const r of e.allAttachmentElementInputs)t(s,r.toSubmitEdits());return s}_emitAttachmentsChange(e){const t=e.single.feature;if(!t)return;const s=this._featureFormMap.get(t);this.emit("attachments-change",{name:"attachments-change",feature:t.source,attachmentEdits:this._makeAttachmentEdits(s??this.activeForm),valid:this.valid})}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=h(this._prepareTask),this._updateWorkingFeatures(),l(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new b({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??F.WebMercator,map:this.map,timeZone:this.timeZone||"system"}});const{layers:e}=this;if(0===e.length)return;const t=s(async t=>{try{p(t);const s=new Map;for(const i of e){const e=await B(i);if(p(t),e){const t=e.fieldGroups.flatMap(e=>e.fields);this._layerContingentValuesMap.set(i,new Set(t))}else this._layerContingentValuesMap.set(i,new Set);const r=W(this.layerInfos,i),a=await R(i,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this.timeZone},r?.formTemplate);p(t),this._layerTemplateMap.set(i,a);const n=a.getExpressionExecutorsForLayer(i);if(this._expressionsManager.layerExpressionsModelMap.set(i,new k({preserveFieldValuesWhenHidden:a.preserveFieldValuesWhenHidden,executorMap:n})),!this._hasAsyncArcadeExpressions)for(const t of n.keys()){const e=n.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of a.elements){if(S(t))continue;const e=t.clone();G(e)&&(e.elements=e.elements.filter(e=>!S(e)));const{elementId:r}=e;s.has(r)?s.get(r).foldIn(e):s.set(r,e)}}if(this.hasTooManyComplexFeatures)throw new i("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new i("too-many-features","There are too many features to load into the form.");const r=new L({elements:Array.from(s.values())});this.sharedFormTemplate=r,this.sharedForm=V(r,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,map:this.map}),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw u(s)||n.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.consumePromise(t.promise),this._prepareTask=t}_updateWorkingFeatures(){this._workingFeatures.destroyAll();for(const t of this._featureFormMap.values())t.destroy();this._featureFormMap.clear(),this._attachmentCache.clear();const{features:e}=this;if(this._reactiveGraphicLookup=new m,0!==e.length){this._workingFeatures.addMany(e.map(w));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}async _syncAttachments(){const{activeFeature:e,activeLayer:t,activeForm:s}=this;if(!(e&&s&&I(t)&&C(t)))return;const r=e.getObjectId();if(null==r)return;const i=this._attachmentCache.get(t),a=s.allAttachmentElementInputs;if(!a.length)return;let n;if(i){const e=i.get(r);e&&(n=e)}if(!n){n=await M(t,r,a);o(this._attachmentCache,t,()=>new m).set(r,n)}for(const o of a)o.applyFetchedAttachments(D(o,n))}};e([g()],N.prototype,"_attachmentCache",void 0),e([g({readOnly:!0})],N.prototype,"activeFeature",null),e([g()],N.prototype,"activeFeatureIndex",void 0),e([g({readOnly:!0})],N.prototype,"activeForm",null),e([g({readOnly:!0})],N.prototype,"activeLayer",null),e([g()],N.prototype,"disabled",void 0),e([g()],N.prototype,"calculating",null),e([g()],N.prototype,"editType",void 0),e([g()],N.prototype,"features",void 0),e([g()],N.prototype,"expressionEvaluationFailed",null),e([g()],N.prototype,"hasNonActiveInvalidFeatures",null),e([g()],N.prototype,"hasAsyncArcadeExpressions",null),e([g()],N.prototype,"_hasAsyncArcadeExpressions",void 0),e([g()],N.prototype,"invalidFeatures",null),e([g()],N.prototype,"hasVisibleInputs",null),e([g()],N.prototype,"hasLayersWithContingentValues",null),e([g()],N.prototype,"maximumFeatureCount",void 0),e([g()],N.prototype,"maximumFeatureCountWithComplexForms",void 0),e([g()],N.prototype,"visibleInputs",null),e([g()],N.prototype,"map",void 0),e([g()],N.prototype,"noVisibleElementsReason",null),e([g()],N.prototype,"readOnly",void 0),e([g()],N.prototype,"spatialReference",void 0),e([g()],N.prototype,"submitHasBeenAttempted",void 0),e([g()],N.prototype,"timeZone",void 0),e([g()],N.prototype,"updating",null),e([g()],N.prototype,"valid",null),e([g()],N.prototype,"layers",null),e([g()],N.prototype,"mode",null),e([g()],N.prototype,"sharedForm",void 0),e([g()],N.prototype,"sharedFormTemplate",void 0),e([g()],N.prototype,"selectedAttachment",null),e([g()],N.prototype,"userHasChangedValues",void 0),e([g()],N.prototype,"layerInfos",void 0),e([g()],N.prototype,"_arcadeExecutorProvider",void 0),e([g()],N.prototype,"_selectedAttachment",void 0),e([g()],N.prototype,"_prepareTask",void 0),e([g()],N.prototype,"_reactiveGraphicLookup",void 0),e([g()],N.prototype,"_layerTemplateMap",void 0),e([g()],N.prototype,"_layerContingentValuesMap",void 0),e([g()],N.prototype,"_workingFeatures",void 0),e([g()],N.prototype,"_expressionsManager",void 0),N=e([v("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],N);const O=N;function Z(e){return null!=e&&e.trim().length>0}function P(e,t){const s=e.keywords;return Z(s)&&s.toLowerCase()===t}function D(e,t){const s="attachment"===e.input?.type?e.input.attachmentAssociationType:"exact",r=e.attachmentKeyword;if("any"===s)return t;if("exactOrNone"===s){if(U(r))return t.filter(e=>!Z(e.keywords));const e=r.toLowerCase();return t.filter(t=>!Z(t.keywords)||P(t,e))}if(U(r))return t;const i=r.toLowerCase();return t.filter(e=>P(e,i))}export{O as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{pushIfSome as t}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import n from"../../core/Error.js";import{EventedAccessor as i}from"../../core/Evented.js";import r from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{abortMaybe as l,destroyMaybe as h}from"../../core/maybe.js";import{throwIfAborted as p,isAbortError as c}from"../../core/promiseUtils.js";import m from"../../core/ReactiveMap.js";import{on as u,sync as d,watch as f,syncAndInitial as g,whenOnce as y}from"../../core/reactiveUtils.js";import{property as v,subclass as A}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as _}from"../../core/support/UpdatingHandles.js";import F from"../../geometry/SpatialReference.js";import{getGraphicLayer as I}from"../../graphic/graphicOriginUtils.js";import{system as x}from"../../time/constants.js";import{getAttachmentKey as w}from"./attachmentUtils.js";import{createReactiveGraphic as E,isAttributeFormSupportedLayerWithAttachments as C,layerSupportsQueryAttachments as M,queryAttachmentsForElements as k}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as b}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as T}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as V}from"./expressions/ExpressionsModel.js";import j from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as H}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as L,isFieldInput as S}from"./inputs/support/inputUtils.js";import B from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as R}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as G}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as U,isGroupElementTemplate as W}from"./templates/support/templateUtils.js";import{isEmptyValue as N}from"../support/forms/formUtils.js";function O(e,t){return e?.find(e=>e.layer===t)}let Z=class extends i{constructor(e){super(e),this._attachmentCache=new m,this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new a,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.pageStack=[],this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new b,this._activeFormInputsByElementId=new Map,this._emptyForm=new j({inputs:[]}),this._emptyFormTemplate=new B({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new m,this._updatingHandles=new _,this._layerTemplateMap=new m,this._layerContingentValuesMap=new m,this._workingFeatures=new a,this._expressionsManager=new T({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:x}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([u(()=>this.features,"after-changes",()=>{this.goHome(),this.notifyChange("layers"),this._prepare()},d),f(()=>[this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),d),f(()=>this.activeForm,()=>{this.goHome(),this._activeFormInputsByElementId.clear(),this._syncAttachments()},d),f(()=>this.activeFeature,()=>{this.goHome(),this._syncAttachments()},d),f(()=>this.page,e=>{const t=[...this.pageStack];if(t.includes(e))for(;t.length&&t.at(-1)!==e;)t.pop();else t.push(e);this.pageStack=t},g)]),this._prepare()}destroy(){this._prepareTask=l(this._prepareTask),this._workingFeatures.destroyAll(),h(this._expressionsManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new m,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get activeLayer(){const{activeFeature:e}=this;if(!e)return null;return I(e)??null}get calculating(){return this._expressionsManager.calculating}get expressionsManager(){return this._expressionsManager}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":e.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":e.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return e.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get page(){return this.selectedAttachmentAddElementId?"adding-attachments":this.selectedAttachment?"viewing-attachment-details":"default"}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid&&Array.from(this._featureFormMap.values()).every(e=>e.valid)}get layers(){const e=new Set;return this.features.forEach(t=>{const s=I(t);s&&e.add(s)}),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}get selectedAttachment(){return this._get("selectedAttachment")??null}set selectedAttachment(e){this._set("selectedAttachment",e),null!=e&&(this.selectedAttachmentAddElementId=null)}get selectedAttachmentAddElementId(){return this._get("selectedAttachmentAddElementId")??null}set selectedAttachmentAddElementId(e){this._set("selectedAttachmentAddElementId",e)}get selectedAttachmentAddInput(){const e=this.selectedAttachmentAddElementId,t=this.activeForm;return e&&t&&t.allAttachmentElementInputs.find(t=>t.template.elementId===e)||null}get selectedAttachmentDetails(){const e=this.selectedAttachment,t=this.activeForm;if(!e||!t)return null;const s=t.allAttachmentElementInputs.find(t=>t.template.elementId===e.elementId);if(!s)return null;const a=s.attachments.findIndex(t=>w(t)===e.attachmentKey);if(-1===a)return null;return{attachment:s.attachments[a],input:s}}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(L(e)){const t=e.inputs.find(e=>S(e)&&!e.valid);if(t)return{input:t,groupInput:e}}if(S(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new n("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}async goBack(){const{page:e}=this;"viewing-attachment-details"!==e?"adding-attachments"!==e||this.setSelectedAttachmentAddElementId(null):this.setSelectedAttachment(null)}async goHome(){this.setSelectedAttachment(null),this.setSelectedAttachmentAddElementId(null)}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}async setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);await e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:t})}async setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new n("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}async stageAddAttachments(e,t){if(0===t.length)return[];const s=this._findAttachmentInput(e);if(!s)return[];const a=await s.stageAddAttachments(t,this._expressionsManager.arcadeContext);return 0===a.length||(this.userHasChangedValues=!0,this._emitAttachmentsChange(s)),a}stageDeleteAttachment(e,t){const s=this._findAttachmentInput(e);if(!s)return;const a=this._findAttachment(s,t);a&&(s.stageDeleteAttachment(a),this.userHasChangedValues=!0,this._emitAttachmentsChange(s))}stageRenameAttachment(e,t,s){const a=this._findAttachmentInput(e);if(!a)return;const n=this._findAttachment(a,t);n&&0!==s.trim().length&&(a.stageRenameAttachment(n,s.trim()),this.userHasChangedValues=!0,this._emitAttachmentsChange(a))}async stageReplaceAttachment(e,t,s){const a=this._findAttachmentInput(e);if(!a)return;const n=this._findAttachment(a,t);n&&(await a.stageReplaceAttachment(n,s,this._expressionsManager.arcadeContext),this.userHasChangedValues=!0,this._emitAttachmentsChange(a))}clearAttachmentChanges(e){const t=this._findAttachmentInput(e);t&&(t.clearAttachmentChanges(),this._emitAttachmentsChange(t))}setSelectedAttachment(e){this.selectedAttachment=e??null}setSelectedAttachmentAddElementId(e){this.selectedAttachmentAddElementId=e??null}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await y(()=>!1===this.calculating);const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?H(t,{allFeatures:new a([e]),expressionsManager:this._expressionsManager,map:this.map}):this._emptyForm}_makeSubmitResults(){const e=new Map;for(const[s,a]of this._reactiveGraphicLookup){const n=[],i=[],r=this._featureFormMap.get(a)?.allAttachmentElementInputs??[];for(const e of r)t(n,e.toSubmitEdits()),e.valid||i.push(e.template.elementId);e.set(s,{feature:s,values:{...a.attributes},invalidFields:[],attachmentEdits:n,invalidAttachmentElementIds:i})}for(const t of this.sharedForm.allFieldInputs)for(const s of t.invalidFeatures)e.get(s)?.invalidFields.push(t.fieldName);return Array.from(e.values())}_findAttachmentInput(e){const t=this.activeForm.allAttachmentElementInputs.find(t=>t.template.elementId===e);return t||r.getLogger(this).error(`Attachment input not found for elementId '${e}'`),t}_findAttachment(e,t){const s=e.findAttachment(t);return s||r.getLogger(this).error(`Attachment '${t}' not found for attachment element '${e.template.elementId}'`),s}_makeAttachmentEdits(e){const s=[];for(const a of e.allAttachmentElementInputs)t(s,a.toSubmitEdits());return s}_emitAttachmentsChange(e){const t=e.single.feature;if(!t)return;const s=this._featureFormMap.get(t);this.emit("attachments-change",{name:"attachments-change",feature:t.source,attachmentEdits:this._makeAttachmentEdits(s??this.activeForm),valid:this.valid})}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=l(this._prepareTask),this._updateWorkingFeatures(),h(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new T({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??F.WebMercator,map:this.map,timeZone:this.timeZone||"system"}});const{layers:e}=this;if(0===e.length)return;const t=s(async t=>{try{p(t);const s=new Map;for(const n of e){const e=await R(n);if(p(t),e){const t=e.fieldGroups.flatMap(e=>e.fields);this._layerContingentValuesMap.set(n,new Set(t))}else this._layerContingentValuesMap.set(n,new Set);const a=O(this.layerInfos,n),i=await G(n,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this.timeZone},a?.formTemplate);p(t),this._layerTemplateMap.set(n,i);const r=i.getExpressionExecutorsForLayer(n);if(this._expressionsManager.layerExpressionsModelMap.set(n,new V({preserveFieldValuesWhenHidden:i.preserveFieldValuesWhenHidden,executorMap:r})),!this._hasAsyncArcadeExpressions)for(const t of r.keys()){const e=r.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of i.elements){if(U(t))continue;const e=t.clone();W(e)&&(e.elements=e.elements.filter(e=>!U(e)));const{elementId:a}=e;s.has(a)?s.get(a).foldIn(e):s.set(a,e)}}if(this.hasTooManyComplexFeatures)throw new n("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new n("too-many-features","There are too many features to load into the form.");const a=new B({elements:Array.from(s.values())});this.sharedFormTemplate=a,this.sharedForm=H(a,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,map:this.map}),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw c(s)||r.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.consumePromise(t.promise),this._prepareTask=t}_updateWorkingFeatures(){this._workingFeatures.destroyAll();for(const t of this._featureFormMap.values())t.destroy();this._featureFormMap.clear(),this._attachmentCache.clear();const{features:e}=this;if(this._reactiveGraphicLookup=new m,0!==e.length){this._workingFeatures.addMany(e.map(E));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}async _syncAttachments(){const{activeFeature:e,activeLayer:t,activeForm:s}=this;if(!(e&&s&&C(t)&&M(t)))return;const a=e.getObjectId();if(null==a)return;const n=this._attachmentCache.get(t),i=s.allAttachmentElementInputs;if(!i.length)return;let r;if(n){const e=n.get(a);e&&(r=e)}if(!r){r=await k(t,a,i);o(this._attachmentCache,t,()=>new m).set(a,r)}for(const o of i)o.applyFetchedAttachments(z(o,r))}};e([v()],Z.prototype,"_attachmentCache",void 0),e([v({readOnly:!0})],Z.prototype,"activeFeature",null),e([v()],Z.prototype,"activeFeatureIndex",void 0),e([v({readOnly:!0})],Z.prototype,"activeForm",null),e([v({readOnly:!0})],Z.prototype,"activeLayer",null),e([v()],Z.prototype,"disabled",void 0),e([v()],Z.prototype,"calculating",null),e([v()],Z.prototype,"editType",void 0),e([v()],Z.prototype,"features",void 0),e([v()],Z.prototype,"expressionEvaluationFailed",null),e([v()],Z.prototype,"hasNonActiveInvalidFeatures",null),e([v()],Z.prototype,"hasAsyncArcadeExpressions",null),e([v()],Z.prototype,"_hasAsyncArcadeExpressions",void 0),e([v()],Z.prototype,"invalidFeatures",null),e([v()],Z.prototype,"hasVisibleInputs",null),e([v()],Z.prototype,"hasLayersWithContingentValues",null),e([v()],Z.prototype,"maximumFeatureCount",void 0),e([v()],Z.prototype,"maximumFeatureCountWithComplexForms",void 0),e([v()],Z.prototype,"visibleInputs",null),e([v()],Z.prototype,"map",void 0),e([v()],Z.prototype,"noVisibleElementsReason",null),e([v()],Z.prototype,"page",null),e([v()],Z.prototype,"pageStack",void 0),e([v()],Z.prototype,"readOnly",void 0),e([v()],Z.prototype,"spatialReference",void 0),e([v()],Z.prototype,"submitHasBeenAttempted",void 0),e([v()],Z.prototype,"timeZone",void 0),e([v()],Z.prototype,"updating",null),e([v()],Z.prototype,"valid",null),e([v()],Z.prototype,"layers",null),e([v()],Z.prototype,"mode",null),e([v()],Z.prototype,"sharedForm",void 0),e([v()],Z.prototype,"sharedFormTemplate",void 0),e([v()],Z.prototype,"selectedAttachment",null),e([v()],Z.prototype,"selectedAttachmentAddElementId",null),e([v()],Z.prototype,"selectedAttachmentAddInput",null),e([v()],Z.prototype,"selectedAttachmentDetails",null),e([v()],Z.prototype,"userHasChangedValues",void 0),e([v()],Z.prototype,"layerInfos",void 0),e([v()],Z.prototype,"_arcadeExecutorProvider",void 0),e([v()],Z.prototype,"_prepareTask",void 0),e([v()],Z.prototype,"_reactiveGraphicLookup",void 0),e([v()],Z.prototype,"_layerTemplateMap",void 0),e([v()],Z.prototype,"_layerContingentValuesMap",void 0),e([v()],Z.prototype,"_workingFeatures",void 0),e([v()],Z.prototype,"_expressionsManager",void 0),Z=e([A("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],Z);const D=Z;function P(e){return null!=e&&e.trim().length>0}function $(e,t){const s=e.keywords;return P(s)&&s.toLowerCase()===t}function z(e,t){const s="attachment"===e.input?.type?e.input.attachmentAssociationType:"exact",a=e.attachmentKeyword;if("any"===s)return t;if("exactOrNone"===s){if(N(a))return t.filter(e=>!P(e.keywords));const e=a.toLowerCase();return t.filter(t=>!P(t.keywords)||$(t,e))}if(N(a))return t;const n=a.toLowerCase();return t.filter(e=>$(e,n))}export{D as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{watch as r,sync as s}from"../../core/reactiveUtils.js";import{generateUID as o}from"../../core/uid.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{isLayerWithContingentValues as n}from"../support/ContingentValuesManager.js";let c=class extends t{constructor(e){super(e),this._uid=`${o()}`}getAndWatchFieldValueOptions(e){const{feature:t,...o}=e,a=this.manager.getFieldValueOptions({...o,feature:t.plainGraphic}),{layer:i,fieldName:c}=e,d=this._makeHandleId(c);if(t.hasHandles(d)||!n(i))return a;const u=this.manager.getRelatedFields(i,c);if(0===u.size)return a;const l=r(()=>p(t,u),()=>this.manager.resetOptionsForField(i,t.plainGraphic,c),s);return this.addHandles(l),t.addHandles(l,d),a}_makeHandleId(e){return`${this._uid}-${e}`}};function p(e,t){const r=[];for(const s of t)r.push(e.getAttribute(s));return r}e([a()],c.prototype,"manager",void 0),c=e([i("esri.widgets.BatchAttributeForm.ReactiveContingentValuesManager")],c);export{c as ReactiveContingentValuesManager};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{createObservableProxy as r}from"../../core/proxy.js";import s from"../../core/ReactiveMap.js";import{property as i,subclass as o}from"../../core/accessorSupport/decorators.js";import{valuesAreEquivalent as a}from"../support/forms/formUtils.js";let u=class extends e{constructor(t){super(t),this._stashedAttributes=new s,this.userChangesHaveMadeInvalid=!1,this.original=t.source.clone();const e=t.source.attributes??{},i=r({...e});this.attributes=i;const o=t.source.cloneShallow();o.attributes=i,this.plainGraphic=o}get geometry(){return this.plainGraphic.geometry}set geometry(t){this.plainGraphic.geometry=t}get layer(){return this.source.sourceLayer??this.source.layer}attributeHasChanged(t){return!a(this.attributes[t],this.original.attributes?.[t])}getAttribute(t){return this.attributes[t]??null}getObjectId(){return this.plainGraphic.getObjectId()}getGlobalId(){return this.plainGraphic.getGlobalId()}getStashedAttribute(t){return this._stashedAttributes.get(t)}setAttribute(t,e){this.attributes[t]=e}stashAttribute(t,e){this._stashedAttributes.set(t,e)}clearStashedAttributes(){this._stashedAttributes.clear()}};t([i()],u.prototype,"attributes",void 0),t([i()],u.prototype,"geometry",null),t([i()],u.prototype,"plainGraphic",void 0),t([i()],u.prototype,"layer",null),t([i({constructOnly:!0})],u.prototype,"original",void 0),t([i({constructOnly:!0})],u.prototype,"source",void 0),t([i()],u.prototype,"userChangesHaveMadeInvalid",void 0),u=t([o("esri.widgets.BatchAttributeForm.ReactiveGraphic")],u);export{u as ReactiveGraphic};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{isBlobProtocol as t}from"../../core/urlUtils.js";import{isString as n}from"../../support/guards.js";import{isSupportedImage as r}from"../Attachments/support/attachmentUtils.js";function u(t){return String(t.globalId||t.id||t.name)}function o(r,u,o){const{size:e,url:s}=r;if(!n(s)||!s.length)return null;if(t(s))return s;const i=[];return u&&null!=o&&i.push(`w=${o}`),null==e||Number.isNaN(e)||i.push(`s=${e}`),i.length?`${s}${s.includes("?")?"&":"?"}${i.join("&")}`:s}function e(t){return r(t.contentType)}export{u as getAttachmentKey,o as getAttachmentUrl,e as isImageAttachment};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{substitute as e}from"../../intl.js";import t from"../../rest/support/AttachmentQuery.js";import{ReactiveGraphic as i}from"./ReactiveGraphic.js";import{
|
|
2
|
+
import{substitute as e}from"../../intl.js";import t from"../../rest/support/AttachmentQuery.js";import{ReactiveGraphic as i}from"./ReactiveGraphic.js";import{isMultipleChoiceFieldInput as n}from"./inputs/support/inputUtils.js";import{getIntlOptionsForField as o}from"../support/dateUtils.js";import{isEmptyValue as r,getRangeErrorMessage as a,shouldUseScientificNotation as s,scientificNumberFormatOptions as l,numberFormatOptions as c}from"../support/forms/formUtils.js";const u=(e,t)=>null!=e&&e.input?.type===t;function d(e){return new i({source:e})}function p(t,i,r,u){const{dataType:d,minLength:p}=t,f=r?.validationErrors;if(!f||!i)return null;if("batch-attribute-form-validation::features-have-different-errors"===i)return f.invalidBatchFormType;if("input-validation-error::cannot-be-empty"===i)return f.cannotBeNull;if("domain-validation-error::value-out-of-range"===i||"numeric-range-validation-error::out-of-range"===i){const{field:i,range:n}=t,r={type:"date",intlOptions:{timeZone:"date"===i.type&&u?u:void 0,...o(i)}},p=a(n,f);return e(p,n,{format:{max:"date"===d?r:null!=n.max&&s(n.max)?l:c,min:"date"===d?r:null!=n.min&&s(n.min)?l:c}})}return"domain-validation-error::invalid-coded-value"===i?f.invalidCodedValue:"type-validation-error::invalid-type"===i?f.invalidType:"length-validation-error::too-short"===i?e(f.tooShort,{min:p}):"multiple-choice-validation-error::too-few-selected-choices"===i&&n(t)?e(f.tooFewSelectedChoices,{min:t.input.minimumChoices}):"multiple-choice-validation-error::too-many-selected-choices"===i&&n(t)?e(f.tooManySelectedChoices,{max:t.input.maximumChoices}):null}function f(e,t,i){const n=i?.validationErrors;if(!n)return null;let o=null;for(const r of e.invalidHiddenInputs)switch(r.effectiveVisibilityCode){case"hidden:visibility-expression:all-features":case"hidden:group-visibility-expression:all-features":case"hidden:field-definition":return"single"===t?n.nonVisibleError_changeValues:n.nonVisibleError_checkIndividualFeatures;case"hidden:no-domain-in-common":case"hidden:visibility-expression:some-features":case"hidden:group-visibility-expression:some-features":case"hidden:not-in-all-layers":o=n.nonVisibleError_checkIndividualFeatures;break;case"visible":continue;default:r.effectiveVisibilityCode}return o}function m(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"geojson"===e.type||"knowledge-graph-sublayer"===e.type||"oriented-imagery"===e.type||"scene"===e.type||"subtype-sublayer"===e.type)}function y(e){return!!m(e)||!!(null!=e&&"object"==typeof e&&"type"in e&&e.type&&"id"in e&&e.id&&"fields"in e&&e.fields&&"fieldsIndex"in e&&e.fieldsIndex&&"objectIdField"in e&&e.objectIdField&&"capabilities"in e&&"getField"in e&&e.getField)}function h(e){return y(e)&&"queryAttachments"in e}function v(e){if(!h(e))return!1;const t=e?.effectiveCapabilities??e?.capabilities;return!(!t?.data?.supportsAttachment||!t.operations.supportsQueryAttachments)}async function b(e,i,n){const o=new Set;let a=!1;for(const t of n){if("attachment"===t.input?.type&&("any"===t.input.attachmentAssociationType||"exactOrNone"===t.input.attachmentAssociationType)){a=!0;break}if(r(t.attachmentKeyword)){a=!0;break}o.add(t.attachmentKeyword)}const s=o.size&&!a?Array.from(o):void 0,l=new t({objectIds:[i],where:"1=1",returnMetadata:!0,keywords:s});e.capabilities?.query?.supportsCacheHint&&(l.cacheHint=!0);return(await e.queryAttachments(l))[i]??[]}function g(e,t,i,n){const o=e.get(t)?.get(i)??[];if(!n?.length)return o;const r=new Set(n.map(e=>e.toLowerCase()));return o.filter(e=>r.has(e.keywords.toLowerCase()))}export{d as createReactiveGraphic,g as getAttachmentsForKeywords,f as getHiddenFieldsValidationErrorMessage,p as getVisibleFieldInputValidationErrorMessage,y as isAttributeFormSupportedLayer,m as isAttributeFormSupportedLayerUnion,h as isAttributeFormSupportedLayerWithAttachments,u as isElementTemplateWithInputType,v as layerSupportsQueryAttachments,b as queryAttachmentsForElements};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const t="esri-batch-attribute-form",e=`${t}__group`,a=`${t}__input`,i=`${t}__attachment-element`,n={base:t,form:`${t}__form`,formHeader:`${t}__form-header`,noticeError:`${t}__notice-error`,label:`${t}__label`,labelTextContent:`${t}__label-text-content`,fieldInput:`${a}`,textElementInput:`${t}__text-element-input`,attachmentElementInput:`${i}-input`,attachmentElementLabel:`${i}-label`,attachmentElementList:`${i}-list`,attachmentElementListItem:`${i}-list-item`,attachmentElementListItemStart:`${i}-list-item-start`,attachmentElementListItemThumb:`${i}-list-item-thumb`,attachmentElementListItemIcon:`${i}-list-item-icon`,attachmentElementEmptyState:`${i}-empty-state`,attachmentElementEmptyAction:`${i}-empty-action`,attachmentElementDetail:`${i}-detail`,attachmentElementDetailPreview:`${i}-detail-preview`,attachmentElementDetailPreviewImage:`${i}-detail-preview-image`,attachmentElementDetailPreviewIcon:`${i}-detail-preview-icon`,attachmentElementDetailActions:`${i}-detail-actions`,attachmentElementDetailMetadata:`${i}-detail-metadata`,attachmentElementDetailMetadataLabel:`${i}-detail-metadata-label`,attachmentElementDetailMetadataValue:`${i}-detail-metadata-value`,relationshipElementInput:`${t}__relationship-element-input`,utilityNetworkAssociationsElementInput:`${t}__utility-network-associations-element-input`,
|
|
2
|
+
const t="esri-batch-attribute-form",e=`${t}__group`,a=`${t}__input`,i=`${t}__attachment-element`,n=`${t}__multiple-choice-input`,l={base:t,form:`${t}__form`,formHeader:`${t}__form-header`,noticeError:`${t}__notice-error`,label:`${t}__label`,labelTextContent:`${t}__label-text-content`,fieldInput:`${a}`,inputRadio:`${a}--radio`,placeholderRadio:`${a}--radio-placeholder`,inputRadioGroup:`${a}--radio-group`,inputRadioLabel:`${a}--radio-label`,inputDisabled:`${a}--disabled`,inputSwitch:`${a}--switch`,dateInputContainer:`${`${t}__date`}-input-container`,textElementInput:`${t}__text-element-input`,attachmentElementInput:`${i}-input`,attachmentElementLabel:`${i}-label`,attachmentElementList:`${i}-list`,attachmentElementListItem:`${i}-list-item`,attachmentElementListItemStart:`${i}-list-item-start`,attachmentElementListItemActions:`${i}-list-item-actions`,attachmentElementListItemStagedIndicator:`${i}-list-item-staged-indicator`,attachmentElementListItemThumb:`${i}-list-item-thumb`,attachmentElementListItemIcon:`${i}-list-item-icon`,attachmentElementEmptyState:`${i}-empty-state`,attachmentElementEmptyAction:`${i}-empty-action`,attachmentElementAddPanel:`${i}-add-panel`,attachmentElementFileInput:`${i}-file-input`,attachmentElementAddDropzone:`${i}-add-dropzone`,attachmentElementAddDropzoneIcon:`${i}-add-dropzone-icon`,attachmentElementAddDropzoneHeading:`${i}-add-dropzone-heading`,attachmentElementAddDropzoneDetail:`${i}-add-dropzone-detail`,attachmentElementDetail:`${i}-detail`,attachmentElementDetailPreview:`${i}-detail-preview`,attachmentElementDetailPreviewImage:`${i}-detail-preview-image`,attachmentElementDetailPreviewIcon:`${i}-detail-preview-icon`,attachmentElementDetailActions:`${i}-detail-actions`,attachmentElementDetailMetadata:`${i}-detail-metadata`,attachmentElementDetailMetadataLabel:`${i}-detail-metadata-label`,attachmentElementDetailMetadataValue:`${i}-detail-metadata-value`,relationshipElementInput:`${t}__relationship-element-input`,utilityNetworkAssociationsElementInput:`${t}__utility-network-associations-element-input`,centeredButton:`${t}__centered-button`,description:`${t}__description-text`,block:`${t}__block`,group:e,groupSequential:`${e}--sequential`,individualElement:`${e}__individual-element`,multipleChoiceInput:`${n}`,multipleChoiceSelectAll:`${n}__select-all`,multipleChoiceOtherChoice:`${n}__other-choice`,multipleChoiceOtherChoiceWithSelectAll:`${n}__other-choice--with-select-all`};export{l as css};
|
|
@@ -74,6 +74,17 @@ export default class AttachmentElementInput extends EditableInput<any> {
|
|
|
74
74
|
* @internal
|
|
75
75
|
*/
|
|
76
76
|
findAttachment(attachmentGlobalId: string): AttachmentInfo | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* @param attachment - Attachment whose preview URL should be resolved.
|
|
79
|
+
* @param thumbnailSize - Optional thumbnail width to request for committed service-backed attachments.
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
getAttachmentPreviewUrl(attachment: AttachmentInfo, thumbnailSize?: number): string | null;
|
|
83
|
+
/**
|
|
84
|
+
* @param file - File to validate against the configured attachment input types.
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
isFileAllowed(file: Blob | File): boolean;
|
|
77
88
|
/**
|
|
78
89
|
* @param params - Attachment information and content to stage as a new attachment.
|
|
79
90
|
* @returns The staged attachment metadata.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Collection.js";import a from"../../../core/Logger.js";import{isAbortError as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Collection.js";import a from"../../../core/Logger.js";import{isAbortError as s}from"../../../core/promiseUtils.js";import n from"../../../core/ReactiveMap.js";import r from"../../../core/ReactiveSet.js";import{generateBracedUUID as i}from"../../../core/uuid.js";import{property as o,subclass as l}from"../../../core/accessorSupport/decorators.js";import{getEffectiveLayerCapabilities as c}from"../../../layers/support/layerUtils.js";import m from"../../../rest/query/support/AttachmentInfo.js";import{getAttachmentTypeCategory as h}from"../../Attachments/support/attachmentUtils.js";import{getAttachmentUrl as d}from"../attachmentUtils.js";import{isAttributeFormSupportedLayer as p}from"../batchAttributeFormUtils.js";import u from"./EditableInput.js";import g from"./SingleFeatureInputAdapter.js";let y=-1,f=class extends u{constructor(t){super(t),this.attachments=[],this.group=null,this.single=new g({input:this}),this.type="attachment",this._initialAttachments=[],this._stagedAdds=new e,this._stagedDeletes=new r,this._stagedUpdates=new n,this._temporaryAttachmentUrls=new n}get allowUserRename(){return this.template.allowUserRename}get addDisabled(){const t=this.maxAttachmentCount;return null!=t&&this.attachments.length>=t}get accept(){const{categories:t}=this;if(!t.size)return;const e=[];return t.has("image")&&e.push("image/*"),t.has("audio")&&e.push("audio/*"),t.has("video")&&e.push("video/*"),t.has("document")&&e.push("text/*","application/*","model/*"),e.length>0?e.join(","):void 0}get categories(){const{input:t}=this,e=new Set;if(!t)return e;if("attachment"===t.type){const{inputTypes:a}=t;if(!a||0===a.length)return e;for(const t of a)_(e,t.type);return e}return _(e,t.type),e}get attachmentKeyword(){return this.template.attachmentKeyword?.trim()}get displayFilename(){return this.template.displayFilename}get feature(){return this.single.feature}get hasAttachmentChanges(){return this._stagedAdds.length>0||this._stagedUpdates.size>0||this._stagedDeletes.size>0}get input(){return this.template.input}get layer(){return this.single.layer}get maxAttachmentCount(){return this.template.maxAttachmentCount}get minAttachmentCount(){return this.template.minAttachmentCount}get supportsResize(){const{layer:t}=this;if(!t)return!1;const e=c(t);return!!e&&("attachment"in e&&!!e.attachment?.supportsResize)}get useOriginalFilename(){return this.template.useOriginalFilename}get valid(){const t=this.attachments.length,e=this.minAttachmentCount??-1/0,a=this.maxAttachmentCount??1/0,s=this.hasAttachmentChanges;return!(t<e||t>a)||!s}get _expressionLayer(){const t=this.layer;if(t)return"scene"===t.type&&"associatedLayer"in t&&null!=t.associatedLayer?t.associatedLayer:"feature"===t.type?t:void 0}destroy(){this._clearTemporaryAttachmentUrls()}applyFetchedAttachments(t){for(const e of t)this._normalizeAttachmentName(e);this._initialAttachments=t,this._recomputeAttachments()}clearAttachmentChanges(){this._clearTemporaryAttachmentUrls(),this._stagedAdds.removeAll(),this._stagedUpdates.clear(),this._stagedDeletes.clear(),this._recomputeAttachments()}stageAddAttachment(t){const{contentType:e,data:a,name:s}=t,n=t.globalId??i(),r=a instanceof Blob?a.size:void 0,o=s.trim(),l=new m({contentType:e??void 0,globalId:n,id:y--,keywords:this.attachmentKeyword??void 0,name:o,size:r});return this._setTemporaryAttachmentUrl(n,a),this._stagedAdds.add({globalId:n,info:l,data:a}),this._recomputeAttachments(),l}async stageAddAttachments(t,e){const a=t.filter(t=>this.isFileAllowed(t));if(0===a.length)return[];const s=[],n=new Map,r=Date.now();for(let i=0;i<a.length;i++){const t=a[i],o=t instanceof File?t.name:`attachment-${r}_${i+1}`,l=await this._computeAttachmentFilename(o,e),c=this._makeUniqueFilenameForOperation(n,l);s.push(this.stageAddAttachment({contentType:t.type,data:t,name:c}))}return s}findAttachment(t){if(t)return this.attachments.find(e=>e.globalId===t)}getAttachmentPreviewUrl(t,e){return(t.globalId?this._temporaryAttachmentUrls.get(t.globalId):void 0)??d(t,this.supportsResize,e)}isFileAllowed(t){if(!t.type)return!0;const{categories:e}=this;return!e.size||e.has(h(t.type))}stageDeleteAttachment(t){const e=t.globalId;if(!e)return;const a=this._stagedAdds.findIndex(t=>t.globalId===e);if(a>-1)return this._clearTemporaryAttachmentUrl(e),this._stagedAdds.removeAt(a),void this._recomputeAttachments();this._clearTemporaryAttachmentUrl(e),this._stagedUpdates.delete(e),this._stagedDeletes.add(e),this._recomputeAttachments()}stageRenameAttachment(t,e){const a=t.globalId;if(!a)return;const s=this._stagedAdds.find(t=>t.globalId===a);if(s)return s.info.name=e,void this._recomputeAttachments();const n=this._stagedUpdates.get(a);this._stagedUpdates.set(a,{...n,info:t,name:e}),this._recomputeAttachments()}async stageReplaceAttachment(t,e,a){const s=e instanceof File?e.name:t.name,n=await this._computeAttachmentFilename(s,a);this._stageReplaceAttachment(t,e,n)}toSubmitEdits(){const t=[],e=[],s=Array.from(this._stagedDeletes);if(0===this._stagedAdds.length&&0===this._stagedUpdates.size&&0===s.length)return null;const n=this._featureIdentifier;if(!n)return a.getLogger(this).error("Unable to build attachment edits without a valid feature and layer."),null;for(const a of this._stagedAdds)t.push({feature:n,attachment:{globalId:a.globalId,contentType:a.info.contentType,data:a.data,name:a.info.name}});for(const[a,r]of this._stagedUpdates)e.push({feature:n,attachment:{globalId:a,contentType:r.contentType,data:r.data,name:r.name}});return{label:this.template.label,attachmentKeyword:this.attachmentKeyword,add:t,delete:s,update:e}}_recomputeAttachments(){const t=this._stagedDeletes,e=[];for(const a of this._stagedAdds)e.push(a.info);for(const a of this._initialAttachments){const s=a.globalId;if(!s||!t.has(s)){if(s&&this._stagedUpdates.has(s)){const t=this._stagedUpdates.get(s),n=a.clone();null!=t.name&&(n.name=t.name),e.push(n);continue}e.push(a)}}this.attachments=e}get _featureIdentifier(){const t=this.single.feature,e=this.layer;if(!t||!p(e))return null;const a=e.objectIdField,s="globalIdField"in e?e.globalIdField:null,n=t.getGlobalId()??(s?t.getAttribute(s):void 0);if(n)return{globalId:n};const r=t.getObjectId()??t.getAttribute(a),i=Number(r);return null==r||isNaN(i)?null:{objectId:i}}async _computeAttachmentFilename(t,e){const n=this.template.filenameExpressionExecutor;if(!n)return t;const r=this.single.feature,i=r?.plainGraphic,o=this._expressionLayer,l={$originalfeature:r?.original,$editcontext:{editType:e.editType},$layer:o,$featureset:o,$datastore:o?.url,$feature:i,$map:e.map},c={rawOutput:!0,spatialReference:e.spatialReference,timeZone:e.timeZone};try{const t=n.isAsync?await n.executeAsync(l,c):n.execute(l,c);if("string"==typeof t&&t.trim().length>0)return t.trim()}catch(m){s(m)||a.getLogger(this).error("Failed evaluating attachment filename expression",m)}return t}_makeUniqueFilenameForOperation(t,e){const a=e.toLowerCase(),s=t.get(a)??0;if(t.set(a,s+1),0===s)return e;const n=e.lastIndexOf(".");return`${n>0?e.slice(0,n):e}_${s}${n>0?e.slice(n):""}`}_stageReplaceAttachment(t,e,a){const s=t.globalId;if(!s)return;const n=this._stagedAdds.find(t=>t.globalId===s);if(n)return n.data=e,n.info.name=a,n.info.contentType=e.type,n.info.size=e.size,this._setTemporaryAttachmentUrl(s,e),void this._recomputeAttachments();const r=this._stagedUpdates.get(s);this._setTemporaryAttachmentUrl(s,e),this._stagedUpdates.set(s,{...r,info:t,contentType:e.type||r?.contentType,data:e,name:a}),this._recomputeAttachments()}_normalizeAttachmentName(t){const{name:e}=t;"string"==typeof e&&(t.name=e.trim())}_setTemporaryAttachmentUrl(t,e){if(this._clearTemporaryAttachmentUrl(t),!(e instanceof Blob))return;const a=URL.createObjectURL(e);return this._temporaryAttachmentUrls.set(t,a),a}_clearTemporaryAttachmentUrl(t){const e=this._temporaryAttachmentUrls.get(t);e&&(URL.revokeObjectURL(e),this._temporaryAttachmentUrls.delete(t))}_clearTemporaryAttachmentUrls(){for(const t of this._temporaryAttachmentUrls.values())URL.revokeObjectURL(t);this._temporaryAttachmentUrls.clear()}};t([o()],f.prototype,"allowUserRename",null),t([o({readOnly:!0})],f.prototype,"addDisabled",null),t([o({readOnly:!0})],f.prototype,"accept",null),t([o({readOnly:!0})],f.prototype,"categories",null),t([o()],f.prototype,"attachmentKeyword",null),t([o()],f.prototype,"attachments",void 0),t([o()],f.prototype,"displayFilename",null),t([o()],f.prototype,"feature",null),t([o()],f.prototype,"group",void 0),t([o({readOnly:!0})],f.prototype,"hasAttachmentChanges",null),t([o()],f.prototype,"input",null),t([o()],f.prototype,"layer",null),t([o()],f.prototype,"maxAttachmentCount",null),t([o()],f.prototype,"minAttachmentCount",null),t([o({readOnly:!0})],f.prototype,"single",void 0),t([o({readOnly:!0})],f.prototype,"type",void 0),t([o({readOnly:!0})],f.prototype,"supportsResize",null),t([o()],f.prototype,"useOriginalFilename",null),t([o({readOnly:!0})],f.prototype,"valid",null),t([o()],f.prototype,"_initialAttachments",void 0),t([o()],f.prototype,"_expressionLayer",null),t([o()],f.prototype,"_stagedAdds",void 0),t([o()],f.prototype,"_stagedDeletes",void 0),t([o()],f.prototype,"_stagedUpdates",void 0),t([o()],f.prototype,"_temporaryAttachmentUrls",void 0),t([o()],f.prototype,"_featureIdentifier",null),f=t([l("esri.widgets.BatchAttributeForm.inputs.AttachmentElementInput")],f);const A=f;function _(t,e){switch(e){case"audio":t.add("audio");break;case"document":t.add("document");break;case"image":case"signature":t.add("image");break;case"video":t.add("video")}}export{A as default};
|