@arcgis/core 5.1.0-next.104 → 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 +90 -66
- 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.json +1 -1
- 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_en.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/01c70c27aa3a955e2928.js +262 -0
- package/assets/esri/core/workers/chunks/{7d571845292b1b7769c2.js → 065dd2fdc834146423c7.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5bd0a4f82df5e942b70.js → 093f27e4e4781870b431.js} +1 -1
- package/assets/esri/core/workers/chunks/{2a5f6a8d282f2c391591.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/466c250537415f12eb59.js +1 -0
- package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +2 -0
- package/assets/esri/core/workers/chunks/{0cb8bc6dbbbe3b212712.js → 558606a1af22e4a0d536.js} +1 -1
- 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/{bff0c4094c14cb97b18f.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/{b63cbf6c2c9ec1b02b9a.js → 6e21675bbd7a44070771.js} +1 -1
- 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/{c476f4979048e558baa7.js → 7ce60331f94ee0a5d674.js} +57 -75
- 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/{bf2c202dec5ab7bc770b.js → 829a0583b8a228c65379.js} +1 -1
- 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/8a1751187a20b6578875.js +1 -0
- package/assets/esri/core/workers/chunks/{d610f517fb3c6cb24365.js → 8ade869fa9bae446266a.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/{95798e3de3419fdda6ac.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/b7a81fd4994eabba1869.js +640 -0
- package/assets/esri/core/workers/chunks/{9542ef3f6c2bc7c14d85.js → b9850fe7dcdaed0c327c.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7e386ece75afb6e4be5.js → bc249bb667f0564ad093.js} +1 -1
- package/assets/esri/core/workers/chunks/bd59cb5abc67e46f1b2c.js +2 -0
- package/assets/esri/core/workers/chunks/{f3a9100518b044e79501.js → be817be7c81fb630122f.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c9482764c9e4f8bcbb0.js → c187bc997bad61b6c6e9.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/{ce0c7070eeb723a718e7.js → d859c046a3ea42530bff.js} +1 -1
- package/assets/esri/core/workers/chunks/da29cf0e64065631a470.js +1 -0
- package/assets/esri/core/workers/chunks/{bb04aff0b4947408592c.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/{5cffc7b49966201eccdb.js → f75295cdd5e84eb97d5a.js} +1 -1
- 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/{64e268ebac0b62076f81.js → fbb23db01f3cf629d32e.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.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_en.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/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
- package/chunks/ChapmanAtmosphere.glsl.js +14 -19
- package/chunks/ComponentShader.glsl.js +11 -15
- package/chunks/Compositing.glsl.js +4 -4
- package/chunks/GaussianSplatShadow.glsl.js +7 -7
- package/chunks/GlobalIllumination.glsl.js +27 -50
- package/chunks/GlobalIlluminationBlur.glsl.js +16 -11
- package/chunks/Terrain.glsl.js +1 -1
- package/config.js +1 -1
- package/core/ReactiveSet.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/VideoLayer.js +1 -1
- 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/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +2 -2
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/orientedImagery/core/utils.js +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 +3 -3
- 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/KnowledgeGraphSublayerAdapter.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 +14 -6
- 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/FlowSubView3D.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/objectResourceUtils.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/flow/FlowSubViewTiles3D.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/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.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/core/shaderTechnique/ShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphereTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
- package/views/3d/webgl-engine/lib/Compositor.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/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.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/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +2 -3
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +1 -1
- package/views/PopupView.d.ts +77 -1
- package/views/PopupView.js +1 -1
- package/views/layers/DimensionLayerView.d.ts +2 -1
- package/views/layers/FeatureLikeLayerView.js +1 -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/UtilityNetworkAssociationsElementInput.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/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/TableList/TableListViewModel.js +1 -1
- package/widgets/TimeSlider.d.ts +3 -3
- package/widgets/Track/TrackViewModel.d.ts +1 -0
- package/widgets/Track/TrackViewModel.js +1 -1
- package/widgets/Track.js +1 -1
- 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/GeolocationPositioning.d.ts +1 -0
- package/widgets/support/GeolocationPositioning.js +1 -1
- package/widgets/support/forms/formUtils.js +1 -1
- package/assets/esri/core/workers/chunks/037b36d415ae27e987f9.js +0 -1
- package/assets/esri/core/workers/chunks/11b0d3a825fe50dd1e84.js +0 -1
- package/assets/esri/core/workers/chunks/1a3426276dc82a8a80f2.js +0 -1
- package/assets/esri/core/workers/chunks/1c83e61fd9a4f8fc8372.js +0 -1
- package/assets/esri/core/workers/chunks/1cb0c4fc315bbc2bd00b.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/29b00d07d3e1d095c590.js +0 -2
- 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/35fdd62277fd06468a29.js +0 -2
- 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/40caf5e09e4382d81104.js +0 -640
- package/assets/esri/core/workers/chunks/4213aa844900fcf95287.js +0 -1
- package/assets/esri/core/workers/chunks/594e1f633527749d92d7.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/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/8e986167d4a393ee41ea.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/b1a21a4d7d73ad7d0e47.js +0 -1
- 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/cc8d55d1830d7542c3f5.js +0 -262
- package/assets/esri/core/workers/chunks/cf3c0bee919bb509cd4f.js +0 -1
- package/assets/esri/core/workers/chunks/cfaa6e205bfc0c94a1b1.js +0 -1
- package/assets/esri/core/workers/chunks/dcb7a3ff59677b1cf0f1.js +0 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphereTechniqueConfiguration.js +0 -2
- /package/assets/esri/core/workers/chunks/{7e57029ec958f6423d5d.js.LICENSE.txt → 549d348ca181d06aefb7.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{29b00d07d3e1d095c590.js.LICENSE.txt → 69c9eb93553b006b640d.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{35fdd62277fd06468a29.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
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{getAssetUrl as e}from"../../assets.js";import o from"../../Graphic.js";import{onLocaleChange as i,getLocale as s,fetchMessageBundle as r}from"../../intl.js";import n from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as h}from"../../core/Evented.js";import c from"../../core/Logger.js";import{watch as d,initial as l,when as m,whenOnce as v}from"../../core/reactiveUtils.js";import{property as p,subclass as u}from"../../core/accessorSupport/decorators.js";import{ensureType as g}from"../../core/accessorSupport/ensureType.js";import f from"../../geometry/Point.js";import{load as w}from"../../geometry/projectionUtils.js";import _ from"../../symbols/PictureMarkerSymbol.js";import{pointSymbolTypes as y}from"../../symbols/support/typeUtils.js";import C from"./support/Conversion.js";import{isValidPoint as b,isSupportedNotation as L}from"./support/coordinateConversionUtils.js";import P from"./support/Format.js";import{generateDefaultFormats as M,setDefaultPatterns as F}from"./support/formatUtils.js";import{GoTo as S}from"../support/GoTo.js";const j=new f([0,0,500]),H="xy",x=["mgrs","utm","usng","dd","dms","ddm"],G="esri__coordinateConversionWidgetState",E={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change",cursor:"cursor"},W="esri/images/search/search-symbol-32.png";let U=class extends(S(h)){constructor(t){super(t),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.calculateCoordinatePrecision=!0,this.formats=new n,this.formatterAvailable=!1,this.formatterLoading=!0,this.messages=null,this.filteredFormats=new n,this.locationSymbol=new _({url:e(W),width:24,height:24}),this.removeLeadingZeros=!1,this.storageEnabled=!0,this.storageType="session",this.view=null,this._saveWidgetState=this._saveWidgetState.bind(this),this._handleFormatChange=this._handleFormatChange.bind(this),this._handleConversionChange=this._handleConversionChange.bind(this),this._handleViewChange=this._handleViewChange.bind(this),this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this.conversions=new n}initialize(){const t=async()=>this.messages=await r("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(M()),t().then(()=>{this.destroyed||(F(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach(t=>{t.viewModel=this,this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format")}),this.addHandles(this.conversions.on("change",this._handleConversionChange),E.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),E.formats),this.addHandles(i(()=>{t().then(()=>{F(this.messages,this.formats)})})),w().then(()=>{this.formatterAvailable=!0}).catch(t=>{c.getLogger(this).error(new a("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:t})),this.formatterAvailable=!1,this._filterFormatsAndConversions()}).then(()=>this.addHandles(d(()=>this.view,this._handleViewChange,l),E.viewChange)).finally(()=>this.formatterLoading=!1),0===this.conversions.length&&this._addDefaultConversion())})}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}get conversions(){return this._get("conversions")}set conversions(t){const e=new n;t.forEach(t=>{let o=null;if("string"==typeof t){const e=this.formats.find(e=>e.name===t);e&&(o=new C({format:e}))}else o=g(C,t);o&&e.add(o)}),this._set("conversions",e)}set currentLocation(t){this._set("currentLocation",t),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(t){switch(t){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",t);break;case"live":this._startLiveMode(),this._set("mode",t);break;case"idle":this.removeHandles(E.view),this.removeHandles(E.cursor),this._set("mode",t)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:t,view:e}=this,o=e?.ready;return t?o?"ready":e?"loading":"disabled":"disabled"}get storage(){return"session"===this.storageType?sessionStorage:localStorage}get waitingForConversions(){return null!=this._conversionPromise}setLocation(t){this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),t&&(this._locationGraphic=new o({geometry:t.clone(),symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic))}async convert(t,e){if(!b(e))throw new a("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:e});return await this._waitForFormatter(),Promise.resolve().then(()=>t.convert(e))}async goToLocation(t){const{view:e}=this;if(!e)throw new a("coordinate-conversion:go-to-failed","no view");const o="3d"===e.type?e.clippingArea:null,i=e.map?.basemap?.baseLayers;if(o||(i?.length??0)>0){const e=o??i?.at(0)?.fullExtent;if(null!=e&&!e.contains(t))throw new a("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:t})}return this.callGoTo({target:t})}pause(){this.currentLocation=null,this.removeHandles(E.view),this.view&&(this.removeHandles(E.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(t,e=this.currentLocation||j){return(await A(t,e)).displayCoordinate}resume(){const{mode:t}=this;"capture"===t?this._startCaptureMode():this._startLiveMode()}async reverseConvert(t,e){return await this._waitForFormatter(),e.reverseConvert(t)}async updateConversions(t,e){if(await this._waitForFormatter(),"point"!==e?.type)throw this._clearConversions(this.conversions),new a("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:e});return this._convertMany(t,e)}_addDefaultConversion(){const t=this.formats.find(t=>t.name===H)||this.formats.at(0);t&&this.conversions.add(new C({format:t}))}_cleanUpView(t){t&&(this._locationGraphic&&t.graphics.remove(this._locationGraphic),this.removeHandles(E.view),this.removeHandles(E.cursor))}_clearConversions(t){t.forEach(t=>{t.position={location:null,coordinate:null}})}async _convertMany(t,e){return Promise.all(t.map(t=>A(t,e)))}_handleConversionChange(t){for(const e of t.added){const{format:t}=e;t&&(t.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(t,this.currentLocation).then(t=>{e.position=t,this._set("waitingForConversions",!1)})))}this._saveWidgetState()}_handleFormatChange(t){t.added.forEach(t=>{this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format"),t.viewModel=this}),t.removed.forEach(t=>{t.viewModel=null;const e=this.conversions.filter(e=>e.format===t);this.conversions.removeMany(e),t.name&&this.removeHandles(t.name)}),0===this.conversions.length&&this._addDefaultConversion()}_loadWidgetState(){try{const t=JSON.parse(this.storage.getItem(G));t&&this._setWidgetState(t)}catch(t){c.getLogger(this).error(new a("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:t}))}}_startCaptureMode(){this.removeHandles(E.view),this.view&&(this.currentLocation&&this.setLocation(this.currentLocation),this.removeHandles(E.cursor),this.addHandles(this.view.acquireCursor("crosshair","high"),E.cursor),this.addHandles(this.view.on("click",this._onClick),E.view))}_startLiveMode(){this._pointerCount=0,this.removeHandles(E.view),this.view&&(this.removeHandles(E.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic),this.addHandles([this.view.on("pointer-down",this._onPointerDown),this.view.on("pointer-up",this._onPointerUp),this.view.on("pointer-move",this._onPointerMove)],E.view))}_handleViewChange(t,e){e&&e!==t&&this._cleanUpView(e),t&&("capture"===this.mode?this._startCaptureMode():"live"===this.mode&&this._startLiveMode(),e&&this._filterFormatsAndConversions())}_onClick(t){if(0===t.button){const e=this.view?.toMap(t,{exclude:[]}),o=e?.normalize();this.setLocation(o),this.currentLocation=o}}_onPointerDown(t){const{pointerType:e}=t;if(this._pointerCount++,("touch"===e||"pen"===e)&&1===this._pointerCount){const e=this.view?.toMap(t,{exclude:[]});this.currentLocation=e?.normalize()}}_onPointerMove(t){const{pointerType:e}=t;if("mouse"===e||1===this._pointerCount){const e=this.view?.toMap(t,{exclude:[]});this.currentLocation=e?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(t){try{t.formats.forEach(e=>{const o=this.formats.find(t=>t.name===e.name);o&&t.locale===s()&&e.currentPattern&&(o.currentPattern=e.currentPattern),o&&e.index>=0&&this.conversions.add(new C({format:o}))})}catch(e){c.getLogger(this).warn(new a("coordinate-conversion:session-storage-read-error","Could not get state from stored JSON.",{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;const t=this._toJSON();try{this.storage.setItem(G,JSON.stringify({formats:t,locale:s()}))}catch(e){c.getLogger(this).error(new a("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_toJSON(){return this.formats.filter(t=>{const e=t.name;return"xy"===e||"basemap"===e||L(e)}).map(t=>({name:t.name,currentPattern:t.currentPattern,defaultPattern:t.defaultPattern,index:this.conversions.findIndex(e=>e.format===t)})).sort((t,e)=>t.index-e.index).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:t,conversions:e,formats:o}=this;t||this.addHandles(m(()=>this.view?.spatialReference,t=>{const i=t.isWebMercator||t.isWGS84,s=o.filter(t=>{const{name:e}=t;return!!T(e)||"xy"===e&&!i}),r=this.filteredFormats.filter(t=>"xy"===t.name&&i&&!this.formats.includes(t)),n=e.filter(t=>s.includes(t.format));o.removeMany(s),e.removeMany(n),this.filteredFormats.addMany(s.filter(t=>!this.filteredFormats.includes(t))),o.addMany(r)},{once:!0,initial:!0}),E.view)}async _waitForFormatter(){this.formatterLoading&&await v(()=>!1===this.formatterLoading)}};async function A(t,e){try{t.position=await(t.format?.convert(e))}catch(o){t.position=null}return t}function T(t){return x.includes(t)}t([p()],U.prototype,"calculateCoordinatePrecision",void 0),t([p()],U.prototype,"conversions",null),t([p({type:f})],U.prototype,"currentLocation",null),t([p({type:n.ofType(P)})],U.prototype,"formats",void 0),t([p()],U.prototype,"formatterLoading",void 0),t([p()],U.prototype,"messages",void 0),t([p()],U.prototype,"mode",null),t([p()],U.prototype,"filteredFormats",void 0),t([p({readOnly:!0})],U.prototype,"state",null),t([p({types:y})],U.prototype,"locationSymbol",void 0),t([p()],U.prototype,"removeLeadingZeros",void 0),t([p({readOnly:!0})],U.prototype,"storage",null),t([p()],U.prototype,"storageEnabled",void 0),t([p()],U.prototype,"storageType",void 0),t([p({readOnly:!0})],U.prototype,"waitingForConversions",null),t([p()],U.prototype,"view",void 0),U=t([u("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],U);const k=U;export{k as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import{getAssetUrl as e}from"../../assets.js";import o from"../../Graphic.js";import{onLocaleChange as i,getLocale as s,fetchMessageBundle as r}from"../../intl.js";import n from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as h}from"../../core/Evented.js";import c from"../../core/Logger.js";import{watch as d,initial as l,when as m,whenOnce as v}from"../../core/reactiveUtils.js";import{property as p,subclass as u}from"../../core/accessorSupport/decorators.js";import{ensureType as g}from"../../core/accessorSupport/ensureType.js";import f from"../../geometry/Point.js";import{load as w}from"../../geometry/projectionUtils.js";import _ from"../../symbols/PictureMarkerSymbol.js";import{pointSymbolTypes as y}from"../../symbols/support/typeUtils.js";import C from"./support/Conversion.js";import{isValidPoint as L,isSupportedNotation as b}from"./support/coordinateConversionUtils.js";import M from"./support/Format.js";import{generateDefaultFormats as P,setDefaultPatterns as F}from"./support/formatUtils.js";import{GoTo as H}from"../support/GoTo.js";const S=new f([0,0,500]),j="xy",U=["mgrs","utm","usng","dd","dms","ddm"],x="esri__coordinateConversionWidgetState",G={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change",cursor:"cursor"},W="esri/images/search/search-symbol-32.png";let E=class extends(H(h)){constructor(t){super(t),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.calculateCoordinatePrecision=!0,this.formats=new n,this.formatterAvailable=!1,this.formatterLoading=!0,this.messages=null,this.filteredFormats=new n,this.locationSymbol=new _({url:e(W),width:24,height:24}),this.removeLeadingZeros=!1,this.storageEnabled=!0,this.storageType="session",this.view=null,this._saveWidgetState=this._saveWidgetState.bind(this),this._handleFormatChange=this._handleFormatChange.bind(this),this._handleConversionChange=this._handleConversionChange.bind(this),this._handleViewChange=this._handleViewChange.bind(this),this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this.conversions=new n}initialize(){const t=async()=>this.messages=await r("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(P()),t().then(()=>{this.destroyed||(F(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach(t=>{t.viewModel=this,this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format")}),this.addHandles(this.conversions.on("change",this._handleConversionChange),G.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),G.formats),this.addHandles(d(()=>this.verticalUnit,this._saveWidgetState)),this.addHandles(i(()=>{t().then(()=>{F(this.messages,this.formats)})})),w().then(()=>{this.formatterAvailable=!0}).catch(t=>{c.getLogger(this).error(new a("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:t})),this.formatterAvailable=!1,this._filterFormatsAndConversions()}).then(()=>this.addHandles(d(()=>this.view,this._handleViewChange,l),G.viewChange)).finally(()=>this.formatterLoading=!1),0===this.conversions.length&&this._addDefaultConversion())})}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}get conversions(){return this._get("conversions")}set conversions(t){const e=new n;t.forEach(t=>{let o=null;if("string"==typeof t){const e=this.formats.find(e=>e.name===t);e&&(o=new C({format:e}))}else o=g(C,t);o&&e.add(o)}),this._set("conversions",e)}set currentLocation(t){this._set("currentLocation",t),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(t){switch(t){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",t);break;case"live":this._startLiveMode(),this._set("mode",t);break;case"idle":this.removeHandles(G.view),this.removeHandles(G.cursor),this._set("mode",t)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:t,view:e}=this,o=e?.ready;return t?o?"ready":e?"loading":"disabled":"disabled"}get storage(){return"session"===this.storageType?sessionStorage:localStorage}get waitingForConversions(){return null!=this._conversionPromise}setLocation(t){this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),t&&(this._locationGraphic=new o({geometry:t.clone(),symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic))}async convert(t,e){if(!L(e))throw new a("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:e});return await this._waitForFormatter(),Promise.resolve().then(()=>t.convert(e))}async goToLocation(t){const{view:e}=this;if(!e)throw new a("coordinate-conversion:go-to-failed","no view");const o="3d"===e.type?e.clippingArea:null,i=e.map?.basemap?.baseLayers;if(o||(i?.length??0)>0){const e=o??i?.at(0)?.fullExtent;if(null!=e&&!e.contains(t))throw new a("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:t})}return this.callGoTo({target:t})}pause(){this.currentLocation=null,this.removeHandles(G.view),this.view&&(this.removeHandles(G.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(t,e=this.currentLocation||S){return(await A(t,e)).displayCoordinate}resume(){const{mode:t}=this;"capture"===t?this._startCaptureMode():this._startLiveMode()}async reverseConvert(t,e){return await this._waitForFormatter(),e.reverseConvert(t)}async updateConversions(t,e){if(await this._waitForFormatter(),"point"!==e?.type)throw this._clearConversions(this.conversions),new a("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:e});return this._convertMany(t,e)}_addDefaultConversion(){const t=this.formats.find(t=>t.name===j)||this.formats.at(0);t&&this.conversions.add(new C({format:t}))}_cleanUpView(t){t&&(this._locationGraphic&&t.graphics.remove(this._locationGraphic),this.removeHandles(G.view),this.removeHandles(G.cursor))}_clearConversions(t){t.forEach(t=>{t.position={location:null,coordinate:null}})}async _convertMany(t,e){return Promise.all(t.map(t=>A(t,e)))}_handleConversionChange(t){for(const e of t.added){const{format:t}=e;t&&(t.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(t,this.currentLocation).then(t=>{e.position=t,this._set("waitingForConversions",!1)})))}this._saveWidgetState()}_handleFormatChange(t){t.added.forEach(t=>{this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format"),t.viewModel=this}),t.removed.forEach(t=>{t.viewModel=null;const e=this.conversions.filter(e=>e.format===t);this.conversions.removeMany(e),t.name&&this.removeHandles(t.name)}),0===this.conversions.length&&this._addDefaultConversion()}_loadWidgetState(){try{const t=JSON.parse(this.storage.getItem(x));t&&this._setWidgetState(t)}catch(t){c.getLogger(this).error(new a("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:t}))}}_startCaptureMode(){this.removeHandles(G.view),this.view&&(this.currentLocation&&this.setLocation(this.currentLocation),this.removeHandles(G.cursor),this.addHandles(this.view.acquireCursor("crosshair","high"),G.cursor),this.addHandles(this.view.on("click",this._onClick),G.view))}_startIdleMode(){this.removeHandles(G.view),this.removeHandles(G.cursor),this.view&&this.currentLocation&&this.setLocation(this.currentLocation)}_startLiveMode(){this._pointerCount=0,this.removeHandles(G.view),this.view&&(this.removeHandles(G.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic),this.addHandles([this.view.on("pointer-down",this._onPointerDown),this.view.on("pointer-up",this._onPointerUp),this.view.on("pointer-move",this._onPointerMove)],G.view))}_handleViewChange(t,e){if(e&&e!==t&&this._cleanUpView(e),t){const{mode:t}=this;"capture"===t?this._startCaptureMode():"live"===t?this._startLiveMode():"idle"===t&&this._startIdleMode(),e&&this._filterFormatsAndConversions()}}_onClick(t){if(0===t.button){const e=this.view?.toMap(t,{exclude:[]}),o=e?.normalize();this.setLocation(o),this.currentLocation=o}}_onPointerDown(t){const{pointerType:e}=t;if(this._pointerCount++,("touch"===e||"pen"===e)&&1===this._pointerCount){const e=this.view?.toMap(t,{exclude:[]});this.currentLocation=e?.normalize()}}_onPointerMove(t){const{pointerType:e}=t;if("mouse"===e||1===this._pointerCount){const e=this.view?.toMap(t,{exclude:[]});this.currentLocation=e?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(t){try{this.verticalUnit=t.verticalUnit,t.formats.forEach(e=>{const o=this.formats.find(t=>t.name===e.name);o&&t.locale===s()&&e.currentPattern&&(o.currentPattern=e.currentPattern),o&&e.index>=0&&this.conversions.add(new C({format:o}))})}catch(e){c.getLogger(this).warn(new a("coordinate-conversion:session-storage-read-error","Could not get state from stored JSON.",{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;const t=this._getFormatsJson();try{this.storage.setItem(x,JSON.stringify({formats:t,locale:s(),verticalUnit:this.verticalUnit}))}catch(e){c.getLogger(this).error(new a("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_getFormatsJson(){return this.formats.filter(t=>{const e=t.name;return"xy"===e||"basemap"===e||b(e)}).map(t=>({name:t.name,currentPattern:t.currentPattern,defaultPattern:t.defaultPattern,index:this.conversions.findIndex(e=>e.format===t)})).sort((t,e)=>t.index-e.index).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:t,conversions:e,formats:o}=this;t||this.addHandles(m(()=>this.view?.spatialReference,t=>{const i=t.isWebMercator||t.isWGS84,s=o.filter(t=>{const{name:e}=t;return!!T(e)||"xy"===e&&!i}),r=this.filteredFormats.filter(t=>"xy"===t.name&&i&&!this.formats.includes(t)),n=e.filter(t=>s.includes(t.format));o.removeMany(s),e.removeMany(n),this.filteredFormats.addMany(s.filter(t=>!this.filteredFormats.includes(t))),o.addMany(r)},{once:!0,initial:!0}),G.view)}async _waitForFormatter(){this.formatterLoading&&await v(()=>!1===this.formatterLoading)}};async function A(t,e){try{t.position=await(t.format?.convert(e))}catch(o){t.position=null}return t}function T(t){return U.includes(t)}t([p()],E.prototype,"calculateCoordinatePrecision",void 0),t([p()],E.prototype,"conversions",null),t([p({type:f})],E.prototype,"currentLocation",null),t([p({type:n.ofType(M)})],E.prototype,"formats",void 0),t([p()],E.prototype,"formatterLoading",void 0),t([p()],E.prototype,"messages",void 0),t([p()],E.prototype,"mode",null),t([p()],E.prototype,"filteredFormats",void 0),t([p({readOnly:!0})],E.prototype,"state",null),t([p({types:y})],E.prototype,"locationSymbol",void 0),t([p()],E.prototype,"removeLeadingZeros",void 0),t([p({readOnly:!0})],E.prototype,"storage",null),t([p()],E.prototype,"storageEnabled",void 0),t([p()],E.prototype,"storageType",void 0),t([p()],E.prototype,"verticalUnit",void 0),t([p({readOnly:!0})],E.prototype,"waitingForConversions",null),t([p()],E.prototype,"view",void 0),E=t([u("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],E);const k=E;export{k as default};
|
package/widgets/Editor.d.ts
CHANGED
|
@@ -237,7 +237,7 @@ export interface EditorEvents extends EditorViewModelEvents {}
|
|
|
237
237
|
* Select the layer containing the feature to form an association with, then select a feature within that layer.
|
|
238
238
|
*
|
|
239
239
|
* The layers and features shown in the list are those that are compatible with the selected feature and
|
|
240
|
-
* association type based on [utility network rules](https://
|
|
240
|
+
* association type based on [utility network rules](https://doc.esri.com/en/arcgis-pro/latest/help/data/utility-network/network-rules.html).
|
|
241
241
|
*
|
|
242
242
|
* After choosing a feature to form the association with, settings specific to the association type can be
|
|
243
243
|
* configured, e.g., midspan location for [connectivity associations](https://pro.arcgis.com/en/pro-app/latest/help/data/utility-network/connectivity.htm).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{on as i,sync as n}from"../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as a}from"../../editing/fieldUtils.js";import{convertDateFormatToIntlOptions as r,defaultFormatterOptionsNoTime as s,convertDateTimeFieldFormatToIntlOptions as u,defaultFormatterOptions as d}from"../../intl/date.js";import{formatNumber as p,convertNumberFormatToIntlOptions as m,convertNumberFieldFormatToIntlOptions as c}from"../../intl/number.js";import{isEditableLayer as h}from"../../layers/support/editableLayers.js";import{computeDomainFromTypes as f}from"../../layers/support/featureLayerUtils.js";import g from"../../layers/support/Field.js";import{defaultFieldFormat as y}from"../../layers/support/fieldFormatUtils.js";import{validateFieldValue as v,isDateField as F,isTimeOnlyField as b,isIntegerField as _,isNumericField as C,isStringField as D,isDateOnlyField as I,isTimestampOffsetField as x}from"../../layers/support/fieldUtils.js";import{isAnyDateField as V}from"../../smartMapping/support/utils.js";import{system as O}from"../../time/constants.js";import{getTimeZoneFormattingOptions as T}from"../../time/timeZoneUtils.js";import w from"../FeatureForm/FieldInput.js";import E from"./Grid/EditorColumn.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as Z,isEmptyStringOrWhitespace as L}from"./support/tableUtils.js";import{valueIsInRange as j,dateTimeIsInRange as R,getUnixFieldValueFromDateComponents as N,getISOFieldValueFromDateComponents as S,normalizeTimeOnlyString as U,getLabelForDateFieldValue as A,prepareISOFieldValueForDateComponents as q,prepareUnixFieldValueForDateComponents as B}from"../support/dateUtils.js";import{setFocus as H,selectText as k}from"../support/widgetUtils.js";const P={cancelEdit:"Escape"},z=Symbol(),G="esri-column",W={input:`${G}__cell-input`,inputContainer:`${G}__cell__input-container`};let M=class extends E{constructor(e){super(e),this._activeFieldInput=null,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this;if(n&&t){const{index:o,item:{attachments:l,feature:a,relatedRecords:r}}=t;return n({attachments:l,column:this,feature:a,field:this.field,index:o,relatedRecords:r,value:this.sanitizeContent(i),virtualIndex:this.getVirtualRowIndex(e)})}if(null===i)return" ";const o=this._getDomainForFeature(t?.item?.feature),l=this._getComputedDomain(i,o)||i;return this._isAnyDateOrTimeField&&"coded-value"!==o?.type?this._formatDateValueForDisplay(this.field,l):this._isNumericField&&"coded-value"!==o?.type?p(parseFloat(l),this._numberFormatOptions):this.sanitizeContent(l)},this.cellValueValidatorFunction=({oldValue:e,value:i})=>{const{_effectiveRange:n,field:o}=this,{max:l,min:a}=n;if(this.effectiveRequired&&(null==i||""===i))return!1;if(this._isNumericField&&(v(o,i)||!j({max:l,min:a,value:i})))return t.getLogger(this).warn("value-exceeds-valid-range","Field value exceeds valid range. Attempted edit was rejected."),!1;if(this._isAnyDateOrTimeField){const e=o.type;if(!R({type:e,range:n,value:i}))return!1}return e!==i},this.field=null,this.formatFunction=null,this.inputRenderFunction=async({root:e,column:i,rowData:n})=>{if(this.editInfo||!this.effectiveEditable||!n)return;const o=n.item.feature,l=o.getObjectId();if(!o||null==l)return;if(this.tableHasInvalidPendingEdits&&!this.itemHasInvalidPendingEdits(l))return void t.getLogger(this).warn("editing-disabled:fix-invalid-pending-edits","Editing is disabled for this row. Table has existing invalid pending edits that must be addressed.");const a=this.getCellValue(n),{field:r}=this;if("big-integer"===r.type&&v(r,a))return void t.getLogger(this).warn("value-exceeds-valid-range","Field value is beyond supported limit. Editing is disabled for this field value.");this._activeFieldInput=this._setUpFieldInput(o,a);const s=document.createElement("div");s.classList.add(W.inputContainer);const u=[],d="coded-value"===this._effectiveDomain?.type;if(this._isAnyDateOrTimeField&&!d){const e=document.createElement("div"),t=this._setUpDateComponents(a),i=this._setUpDateActionBar();t.forEach(t=>e.appendChild(t)),s.appendChild(e),s.appendChild(i),u.push(...t)}else{const e=this.createInputElement({rowData:n,value:a});s.appendChild(e),u.push(e)}this._set("editInfo",{column:i,inputs:u,root:e,rowData:n,oldValue:a}),this.removeCellContent(e),e.appendChild(s),this._syncRowEditingState(e,!0),this.grid?.generateCellPartNames();const p=u[0];await H(p),await k(p)},this.layer=null,this.parseInputValueFunction=({inputs:e})=>{const{editInfo:t,field:i,includeTime:n}=this;if(!t||!e.length)return null;const o=e[0];if(this._isAnyDateOrTimeField){if("coded-value"===this._effectiveDomain?.type){if(null==o.value||""===o.value)return null;const e=String(o.value);return F(i)?parseFloat(e):e}const{timeZone:l}=this.effectiveTimeZoneOptions,a=t.oldValue??void 0;switch(i.type){case"date-only":{const e=o.value;return""!==e?e:null}case"time-only":{const e=U(o.value);return""!==e?e:null}case"timestamp-offset":{const t=n?e[1]:void 0,i=e.at(-1);return S({oldValue:a,dateComponent:o,timeComponent:t,timeZoneComponent:i,defaultTimeZone:l})}case"date":{const{max:t,min:i}=this._effectiveRange;return N({oldValue:a,dateComponent:o,timeComponent:e[1],timeZone:l,max:t,min:i})}}return null}const l=o.value,{effectiveRequired:a}=this;return a||null!=l&&""!==l?this._isNumericField?parseFloat(l):this._isStringField?l.trim():l:null},this.sortable=!0,this.store=null,this.template=null,this.view=null}get _effectiveDomain(){const e=this._activeFieldInput?.feature;return e?this._getDomainForFeature(e):null}get _effectiveRange(){return this._activeFieldInput?.range??{max:null,min:null}}get _isAnyDateOrTimeField(){const{field:e}=this;return V(e)||b(e)}get _isIntegerField(){return _(this.field)}get _isNumericField(){return C(this.field)}get _isStringField(){return D(this.field)}get _isSubtypeField(){const{layer:e}=this;if(e?.subtypeField){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1}get _layerWithFieldConfigurations(){const{layer:e}=this;return Z(e)?e:null}get _dateTimeFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?.dateFormat?r(t.format.dateFormat):t?.input&&"includeTime"in t.input&&!1===t.input.includeTime?s:"date-time"===e?.type?u(e):this._isAnyDateOrTimeField?d:void 0}get _numberFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?m(t.format):"number"===e?.type?c(e):this._isNumericField?{useGrouping:!0,maximumFractionDigits:20}:void 0}get alias(){return a(this.field,this._layerWithFieldConfigurations)}get defaultValue(){return this.field?.defaultValue}get effectiveDescription(){const{description:e,field:t}=this,i=t.description,n=L(e)?L(i)?null:i:e;return null==n?null:this.sanitizeLabel(n)}get effectiveEditable(){const{editable:e,field:t,layer:i,tableEditingEnabled:n}=this;if(!t||!i)return!1;const o=h(i),l=i.effectiveCapabilities??i.capabilities,a=l?.operations?.supportsUpdate;return!!(t.editable&&o&&a&&"oid"!==t.type&&n)&&e}get effectiveLabel(){return this.sanitizeLabel(this.label||this.alias||this.fieldName)}get effectiveRequired(){return!this.nullable||this._isSubtypeField||this._activeFieldInput?.required||this.required}get effectiveSortable(){return!(!this.layer?.capabilities?.query?.supportsOrderBy||!this.sortable)}get effectiveTimeZoneOptions(){const{layer:e,field:t}=this;if(!e||"date"!==t?.type&&"timestamp-offset"!==t?.type)return{timeZone:void 0,timeZoneName:void 0};const{tableTimeZone:i,timeZone:n,view:o}=this;return T(e.preferredTimeZone||null,!!e.datesInUnknownTimezone,n??i??o?.timeZone??O,this._dateTimeFormatOptions??d,t.type)}get includeTime(){const{field:e,template:t}=this;return"time-only"===e.type||"date-only"!==e.type&&(!t?.input||"includeTime"in t.input&&!1!==t.input.includeTime)}get hasContingentValues(){return!!this.store.fieldsWithContingentValues?.has(this.fieldName)}get layerFieldConfigurationFormat(){const{_layerWithFieldConfigurations:e}=this;if(e)return e.getFieldConfiguration(this.fieldName)?.fieldFormat??y(this.field)}get maxLength(){const{field:e,template:t}=this,i=e?.length??-1,n=t?.input&&"maxLength"in t.input?t.input.maxLength:null;return null!=n&&!isNaN(n)&&n>=-1&&(-1===i||n<=i)?n:i}get minLength(){const{template:e,maxLength:t}=this,i=e?.input&&"minLength"in e.input?e.input.minLength:null;return t&&i<=t?i:null}get name(){return this.field?.name}get nullable(){return!1!==this.field.nullable}get shouldShowPrompt(){return this._isSubtypeField}createInputElement({rowData:e,value:t}){const{_effectiveDomain:o,maxLength:l,minLength:a,effectiveRequired:r}=this;let s;if("coded-value"===o?.type){const o=e.item.feature,l=this.getFieldValueOptions(o,this.fieldName);this.hasContingentValues?(s=this._setUpComboboxComponent(l,t),this.addHandles([i(()=>s,"calciteComboboxChange",()=>this.onInputBlur(),n),i(()=>s,"pointerdown",e=>e.preventDefault(),n)],z)):(s=this.createCalciteSelect(t,l.recommended),this.addHandles(i(()=>s,"calciteSelectChange",()=>this.onInputBlur(),n),z))}else{if(this._isNumericField){const{_effectiveRange:{max:e,min:i}}=this;s=document.createElement("calcite-input"),s.type="number",this._isIntegerField&&(s.step=1),null!=e&&(s.max=e),null!=i&&(s.min=i),s.status=j({max:e,min:i,value:t})?"idle":"invalid"}else s=document.createElement("calcite-input"),this.addHandles(i(()=>s,"calciteInputChange",()=>this.onInputBlur(),n),z),l>-1&&(s.maxLength=l),a>0&&(s.minLength=a);s.value=null!=t?t.toString():""}return s.classList.add(W.input),s.required=r,this.addHandles([i(()=>s,"keydown",e=>{e.key===P.cancelEdit&&this.onInputBlur(!0)},n),i(()=>s,"blur",()=>this.onInputBlur(),n)],z),s}onInputBlur(e=!1){this.removeHandles(z),super.onInputBlur(e)}onEditComplete(){const e=this.editInfo?.root;e&&this._syncRowEditingState(e,!1),this._activeFieldInput=null,super.onEditComplete()}get test(){}_clearActiveEditValues(){this.editInfo?.inputs?.forEach(e=>e.value="")}_setUpDateActionBar(){const{messagesCommon:e}=this,t=e?.cancel??"",i=e?.clear??"",n=e?.save??"",o=document.createElement("calcite-action-bar");return o.expandDisabled=!0,o.layout="horizontal",o.appendChild(this.createCalciteAction({text:n,icon:"save",onclick:()=>this.submit()})),this.effectiveRequired||o.appendChild(this.createCalciteAction({text:i,icon:"trash",onclick:()=>{this._clearActiveEditValues(),this.submit()}})),o.appendChild(this.createCalciteAction({text:t,icon:"x",onclick:()=>this.cancel()})),o}_formatDateValueForDisplay(e,t){const{timeZone:i,timeZoneName:n}=this.effectiveTimeZoneOptions;return null!=t?A(e,t,{...this._dateTimeFormatOptions,timeZone:i,timeZoneName:n}):null}_fieldValueOptionToComboboxItem({disabled:e,name:t,value:i},n){const o=n===i||null==n&&""===i;return this.createCalciteComboboxItem({disabled:e,heading:t,selected:o,value:i})}_setUpComboboxComponent(e,t){const{recommended:i,other:n,unsupported:o}=e,l=this.effectiveRequired,a=this.messages,r=this.createCalciteCombobox({label:this.effectiveLabel,required:l}),s=i.map(e=>this._fieldValueOptionToComboboxItem(e,t));if(!l||null==t||""===t){const e=this._fieldValueOptionToComboboxItem({disabled:l,name:a?.noValue,value:""},t);r.appendChild(e)}if(0===n.length&&0===o.length)return s.forEach(e=>r.appendChild(e)),r;const u=this.createCalciteComboboxItemGroup({label:a.contingentValues.recommended});if(s.forEach(e=>u.appendChild(e)),r.appendChild(u),n.length){const e=this.createCalciteComboboxItemGroup({label:a.contingentValues.other});n.forEach(i=>e.appendChild(this._fieldValueOptionToComboboxItem(i,t))),r.appendChild(e)}if(o.length){const e=this.createCalciteComboboxItemGroup({label:a.subtypes.unsupportedDomainGroupTitle});o.forEach(i=>e.appendChild(this._fieldValueOptionToComboboxItem(i,t))),r.appendChild(e)}return r}_setUpDateComponents(e){const{_effectiveRange:{max:t,min:n,rawMax:o,rawMin:l},field:a,effectiveRequired:r}=this,s=this._getDateFieldValuesForComponents(a,e),u=[];if(V(a)){const e=this.createDateComponent(),d=I(a)||x(a)?o:t,p=I(a)||x(a)?l:n,m=this._getDateFieldValuesForComponents(a,d??null),c=this._getDateFieldValuesForComponents(a,p??null);e.value=s.date??"",e.max=m.date??"",e.min=c.date??"",e.required=r,this.addHandles([i(()=>e,"calciteInputDatePickerOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}if(this.includeTime){const e=this.createTimeComponent();e.value=s.time??"",e.required=r,this.addHandles([i(()=>e,"calciteInputTimePickerOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}if("timestamp-offset"===a.type){const e=this.createTimeZoneComponent();e.value=s.timeZoneOffset??"0",this.addHandles([i(()=>e,"calciteInputTimeZoneOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}return u}_onDateComponentOpen(e){this.editInfo?.inputs.forEach(t=>{t!==e&&"open"in t&&(t.open=!1)})}_syncRowEditingState(e,t=!1){const i=this.grid?.getRowContainingNode(e);i&&(t?i.setAttribute("editing","true"):i.removeAttribute("editing"))}_getDateFieldValuesForComponents(e,t){switch(e.type){case"date":return B(t,this.effectiveTimeZoneOptions.timeZone);case"date-only":return{date:t};case"time-only":return{time:t};case"timestamp-offset":return q(t);default:return{}}}_setUpFieldInput(e,t){const{field:i,layer:n,effectiveTimeZoneOptions:{timeZone:o}}=this,l=new w({feature:e,field:i,initialFeature:e.clone(),layer:n,timeZone:o});return l.set("value",t),l}_isDomainCompatible(e){if(!e)return!1;const{_isNumericField:t,_isStringField:i}=this,{type:n}=e;if("coded-value"===n){const n=typeof e.codedValues[0].code;if("string"===n&&i||"number"===n&&t)return!0}return!("range"!==n||!t)}_getDomainForFeature(e){const{fieldName:t,layer:i,template:n}=this;if(!e||!i?.getFieldDomain)return null;if("wfs"===i.type||"geojson"===i.type||"csv"===i.type)return null;if(n?.domain&&this._isDomainCompatible(n.domain))return n.domain;if("feature"!==i.type&&"subtype-group"!==i.type&&null==i.getField(t)?.domain){const e=f(i,t);if(e)return e}return i.getFieldDomain(t,{feature:e})}_getComputedDomain(e,t){if(!t)return null;if("range"===t.type)return e;if("coded-value"===t.type){const i=t.codedValues.filter(t=>t.hasOwnProperty("code")&&t.code===e);return i&&i.length?i[0].name:e}return null}getFieldValueOptions(e,t){return this.store.getFieldValueOptions({feature:e,fieldName:t,layer:this.layer,emptyString:this.messages?.noValue})}};e([o()],M.prototype,"_effectiveDomain",null),e([o()],M.prototype,"_activeFieldInput",void 0),e([o()],M.prototype,"_effectiveRange",null),e([o()],M.prototype,"_isAnyDateOrTimeField",null),e([o()],M.prototype,"_isIntegerField",null),e([o()],M.prototype,"_isNumericField",null),e([o()],M.prototype,"_isStringField",null),e([o()],M.prototype,"_isSubtypeField",null),e([o()],M.prototype,"_layerWithFieldConfigurations",null),e([o()],M.prototype,"_dateTimeFormatOptions",null),e([o()],M.prototype,"_numberFormatOptions",null),e([o({readOnly:!0})],M.prototype,"alias",null),e([o()],M.prototype,"cellValueFormatFunction",void 0),e([o()],M.prototype,"cellValueValidatorFunction",void 0),e([o({readOnly:!0})],M.prototype,"defaultValue",null),e([o()],M.prototype,"effectiveDescription",null),e([o()],M.prototype,"effectiveEditable",null),e([o()],M.prototype,"effectiveLabel",null),e([o()],M.prototype,"effectiveRequired",null),e([o()],M.prototype,"effectiveSortable",null),e([o()],M.prototype,"effectiveTimeZoneOptions",null),e([o({type:g})],M.prototype,"field",void 0),e([o()],M.prototype,"formatFunction",void 0),e([o()],M.prototype,"includeTime",null),e([o()],M.prototype,"inputRenderFunction",void 0),e([o()],M.prototype,"hasContingentValues",null),e([o()],M.prototype,"layer",void 0),e([o()],M.prototype,"layerFieldConfigurationFormat",null),e([o()],M.prototype,"maxLength",null),e([o()],M.prototype,"minLength",null),e([o({readOnly:!0})],M.prototype,"name",null),e([o({readOnly:!0})],M.prototype,"nullable",null),e([o()],M.prototype,"parseInputValueFunction",void 0),e([o()],M.prototype,"shouldShowPrompt",null),e([o()],M.prototype,"sortable",void 0),e([o()],M.prototype,"store",void 0),e([o()],M.prototype,"template",void 0),e([o()],M.prototype,"view",void 0),M=e([l("esri.widgets.FeatureTable.FieldColumn")],M);const $=M;export{$ as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{on as i,sync as n}from"../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as a}from"../../editing/fieldUtils.js";import{convertDateFormatToIntlOptions as r,defaultFormatterOptionsNoTime as s,convertDateTimeFieldFormatToIntlOptions as u,defaultFormatterOptions as d}from"../../intl/date.js";import{formatNumber as p,convertNumberFormatToIntlOptions as m,convertNumberFieldFormatToIntlOptions as c}from"../../intl/number.js";import{isEditableLayer as h}from"../../layers/support/editableLayers.js";import{computeDomainFromTypes as f}from"../../layers/support/featureLayerUtils.js";import g from"../../layers/support/Field.js";import{defaultFieldFormat as y}from"../../layers/support/fieldFormatUtils.js";import{validateFieldValue as v,isDateField as F,isTimeOnlyField as b,isIntegerField as _,isNumericField as C,isStringField as D,isDateOnlyField as I,isTimestampOffsetField as x}from"../../layers/support/fieldUtils.js";import{isAnyDateField as V}from"../../smartMapping/support/utils.js";import{system as O}from"../../time/constants.js";import{getTimeZoneFormattingOptions as T}from"../../time/timeZoneUtils.js";import w from"../FeatureForm/FieldInput.js";import E from"./Grid/EditorColumn.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as Z,isEmptyStringOrWhitespace as L}from"./support/tableUtils.js";import{valueIsInRange as j,dateTimeIsInRange as R,getUnixFieldValueFromDateComponents as N,getISOFieldValueFromDateComponents as S,normalizeTimeOnlyString as U,getLabelForDateFieldValue as A,prepareISOFieldValueForDateComponents as q,prepareUnixFieldValueForDateComponents as B}from"../support/dateUtils.js";import{setFocus as H,selectText as k}from"../support/widgetUtils.js";const P={cancelEdit:"Escape"},z=Symbol(),G="esri-column",W={input:`${G}__cell-input`,inputContainer:`${G}__cell__input-container`};let M=class extends E{constructor(e){super(e),this._activeFieldInput=null,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this;if(n&&t){const{index:o,item:{attachments:l,feature:a,relatedRecords:r}}=t;return n({attachments:l,column:this,feature:a,field:this.field,index:o,relatedRecords:r,value:this.sanitizeContent(i),virtualIndex:this.getVirtualRowIndex(e)})}if(null===i)return" ";const o=this._getDomainForFeature(t?.item?.feature),l=this._getComputedDomain(i,o)||i;return this._isAnyDateOrTimeField&&"coded-value"!==o?.type?this._formatDateValueForDisplay(this.field,l):this._isNumericField&&"coded-value"!==o?.type?p(parseFloat(l),this._numberFormatOptions):this.sanitizeContent(l)},this.cellValueValidatorFunction=({oldValue:e,value:i})=>{const{_effectiveRange:n,field:o}=this,{max:l,min:a}=n;if(this.effectiveRequired&&(null==i||""===i))return!1;if(this._isNumericField&&(v(o,i)||!j({max:l,min:a,value:i})))return t.getLogger(this).warn("value-exceeds-valid-range","Field value exceeds valid range. Attempted edit was rejected."),!1;if(this._isAnyDateOrTimeField){const e=o.type;if(!R({type:e,range:n,value:i}))return!1}return e!==i},this.field=null,this.formatFunction=null,this.inputRenderFunction=async({root:e,column:i,rowData:n})=>{if(this.editInfo||!this.effectiveEditable||!n)return;const o=n.item.feature,l=o.getObjectId();if(!o||null==l)return;if(this.tableHasInvalidPendingEdits&&!this.itemHasInvalidPendingEdits(l))return void t.getLogger(this).warn("editing-disabled:fix-invalid-pending-edits","Editing is disabled for this row. Table has existing invalid pending edits that must be addressed.");const a=this.getCellValue(n),{field:r}=this;if("big-integer"===r.type&&v(r,a))return void t.getLogger(this).warn("value-exceeds-valid-range","Field value is beyond supported limit. Editing is disabled for this field value.");this._activeFieldInput=this._setUpFieldInput(o,a);const s=document.createElement("div");s.classList.add(W.inputContainer);const u=[],d="coded-value"===this._effectiveDomain?.type;if(this._isAnyDateOrTimeField&&!d){const e=document.createElement("div"),t=this._setUpDateComponents(a),i=this._setUpDateActionBar();t.forEach(t=>e.appendChild(t)),s.appendChild(e),s.appendChild(i),u.push(...t)}else{const e=this.createInputElement({rowData:n,value:a});s.appendChild(e),u.push(e)}this._set("editInfo",{column:i,inputs:u,root:e,rowData:n,oldValue:a}),this.removeCellContent(e),e.appendChild(s),this._syncRowEditingState(e,!0),this.grid?.generateCellPartNames();const p=u[0];await H(p),await k(p)},this.layer=null,this.parseInputValueFunction=({inputs:e})=>{const{editInfo:t,field:i,includeTime:n}=this;if(!t||!e.length)return null;const o=e[0];if(this._isAnyDateOrTimeField){if("coded-value"===this._effectiveDomain?.type){if(null==o.value||""===o.value)return null;const e=String(o.value);return F(i)?parseFloat(e):e}const{timeZone:l}=this.effectiveTimeZoneOptions,a=t.oldValue??void 0;switch(i.type){case"date-only":{const e=o.value;return""!==e?e:null}case"time-only":{const e=U(o.value);return""!==e?e:null}case"timestamp-offset":{const t=n?e[1]:void 0,i=e.at(-1);return S({oldValue:a,dateComponent:o,timeComponent:t,timeZoneComponent:i,defaultTimeZone:l})}case"date":{const{max:t,min:i}=this._effectiveRange;return N({oldValue:a,dateComponent:o,timeComponent:e[1],timeZone:l,max:t,min:i})}}return null}const l=o.value,{effectiveRequired:a}=this;return a||null!=l&&""!==l?this._isNumericField?parseFloat(l):this._isStringField?l.trim():l:null},this.sortable=!0,this.store=null,this.template=null,this.view=null}get _effectiveDomain(){const e=this._activeFieldInput?.feature;return e?this._getDomainForFeature(e):null}get _effectiveRange(){return this._activeFieldInput?.range??{max:null,min:null}}get _isAnyDateOrTimeField(){const{field:e}=this;return V(e)||b(e)}get _isIntegerField(){return _(this.field)}get _isNumericField(){return C(this.field)}get _isStringField(){return D(this.field)}get _isSubtypeField(){const{layer:e}=this;if(e?.subtypeField){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1}get _layerWithFieldConfigurations(){const{layer:e}=this;return Z(e)?e:null}get _dateTimeFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?.dateFormat?r(t.format.dateFormat):t?.input&&"includeTime"in t.input&&!1===t.input.includeTime?s:"date-time"===e?.type?u(e):this._isAnyDateOrTimeField?d:void 0}get _numberFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?m(t.format):"number"===e?.type?c(e):this._isNumericField?{useGrouping:!0,maximumFractionDigits:20}:void 0}get alias(){return a(this.field,this._layerWithFieldConfigurations)}get defaultValue(){return this.field?.defaultValue}get effectiveDescription(){const{description:e,field:t}=this,i=t.description,n=L(e)?L(i)?null:i:e;return null==n?null:this.sanitizeLabel(n)}get effectiveEditable(){const{editable:e,field:t,layer:i,tableEditingEnabled:n}=this;if(!t||!i)return!1;const o=h(i),l=i.effectiveCapabilities??i.capabilities,a=l?.operations?.supportsUpdate;return!!(t.editable&&o&&a&&"oid"!==t.type&&n)&&e}get effectiveLabel(){return this.sanitizeLabel(this.label||this.alias||this.fieldName)}get effectiveRequired(){return!this.nullable||this._isSubtypeField||this._activeFieldInput?.required||this.required}get effectiveSortable(){return!(!this.layer?.capabilities?.query?.supportsOrderBy||!this.sortable)}get effectiveTimeZoneOptions(){const{layer:e,field:t}=this;if(!e||"date"!==t?.type&&"timestamp-offset"!==t?.type)return{timeZone:void 0,timeZoneName:void 0};const{tableTimeZone:i,timeZone:n,view:o}=this;return T(e.preferredTimeZone||null,!!e.datesInUnknownTimezone,n??i??o?.timeZone??O,this._dateTimeFormatOptions??d,t.type)}get includeTime(){const{field:e,template:t}=this;return"time-only"===e.type||"date-only"!==e.type&&(!t?.input||"includeTime"in t.input&&!1!==t.input.includeTime)}get hasContingentValues(){return!!this.store.fieldsWithContingentValues.has(this.fieldName)}get layerFieldConfigurationFormat(){const{_layerWithFieldConfigurations:e}=this;if(e)return e.getFieldConfiguration(this.fieldName)?.fieldFormat??y(this.field)}get maxLength(){const{field:e,template:t}=this,i=e?.length??-1,n=t?.input&&"maxLength"in t.input?t.input.maxLength:null;return null!=n&&!isNaN(n)&&n>=-1&&(-1===i||n<=i)?n:i}get minLength(){const{template:e,maxLength:t}=this,i=e?.input&&"minLength"in e.input?e.input.minLength:null;return t&&i<=t?i:null}get name(){return this.field?.name}get nullable(){return!1!==this.field.nullable}get shouldShowPrompt(){return this._isSubtypeField}createInputElement({rowData:e,value:t}){const{_effectiveDomain:o,maxLength:l,minLength:a,effectiveRequired:r}=this;let s;if("coded-value"===o?.type){const o=e.item.feature,l=this.getFieldValueOptions(o,this.fieldName);this.hasContingentValues?(s=this._setUpComboboxComponent(l,t),this.addHandles([i(()=>s,"calciteComboboxChange",()=>this.onInputBlur(),n),i(()=>s,"pointerdown",e=>e.preventDefault(),n)],z)):(s=this.createCalciteSelect(t,l.recommended),this.addHandles(i(()=>s,"calciteSelectChange",()=>this.onInputBlur(),n),z))}else{if(this._isNumericField){const{_effectiveRange:{max:e,min:i}}=this;s=document.createElement("calcite-input"),s.type="number",this._isIntegerField&&(s.step=1),null!=e&&(s.max=e),null!=i&&(s.min=i),s.status=j({max:e,min:i,value:t})?"idle":"invalid"}else s=document.createElement("calcite-input"),this.addHandles(i(()=>s,"calciteInputChange",()=>this.onInputBlur(),n),z),l>-1&&(s.maxLength=l),a>0&&(s.minLength=a);s.value=null!=t?t.toString():""}return s.classList.add(W.input),s.required=r,this.addHandles([i(()=>s,"keydown",e=>{e.key===P.cancelEdit&&this.onInputBlur(!0)},n),i(()=>s,"blur",()=>this.onInputBlur(),n)],z),s}onInputBlur(e=!1){this.removeHandles(z),super.onInputBlur(e)}onEditComplete(){const e=this.editInfo?.root;e&&this._syncRowEditingState(e,!1),this._activeFieldInput=null,super.onEditComplete()}get test(){}_clearActiveEditValues(){this.editInfo?.inputs?.forEach(e=>e.value="")}_setUpDateActionBar(){const{messagesCommon:e}=this,t=e?.cancel??"",i=e?.clear??"",n=e?.save??"",o=document.createElement("calcite-action-bar");return o.expandDisabled=!0,o.layout="horizontal",o.appendChild(this.createCalciteAction({text:n,icon:"save",onclick:()=>this.submit()})),this.effectiveRequired||o.appendChild(this.createCalciteAction({text:i,icon:"trash",onclick:()=>{this._clearActiveEditValues(),this.submit()}})),o.appendChild(this.createCalciteAction({text:t,icon:"x",onclick:()=>this.cancel()})),o}_formatDateValueForDisplay(e,t){const{timeZone:i,timeZoneName:n}=this.effectiveTimeZoneOptions;return null!=t?A(e,t,{...this._dateTimeFormatOptions,timeZone:i,timeZoneName:n}):null}_fieldValueOptionToComboboxItem({disabled:e,name:t,value:i},n){const o=n===i||null==n&&""===i;return this.createCalciteComboboxItem({disabled:e,heading:t,selected:o,value:i})}_setUpComboboxComponent(e,t){const{recommended:i,other:n,unsupported:o}=e,l=this.effectiveRequired,a=this.messages,r=this.createCalciteCombobox({label:this.effectiveLabel,required:l}),s=i.map(e=>this._fieldValueOptionToComboboxItem(e,t));if(!l||null==t||""===t){const e=this._fieldValueOptionToComboboxItem({disabled:l,name:a?.noValue,value:""},t);r.appendChild(e)}if(0===n.length&&0===o.length)return s.forEach(e=>r.appendChild(e)),r;const u=this.createCalciteComboboxItemGroup({label:a.contingentValues.recommended});if(s.forEach(e=>u.appendChild(e)),r.appendChild(u),n.length){const e=this.createCalciteComboboxItemGroup({label:a.contingentValues.other});n.forEach(i=>e.appendChild(this._fieldValueOptionToComboboxItem(i,t))),r.appendChild(e)}if(o.length){const e=this.createCalciteComboboxItemGroup({label:a.subtypes.unsupportedDomainGroupTitle});o.forEach(i=>e.appendChild(this._fieldValueOptionToComboboxItem(i,t))),r.appendChild(e)}return r}_setUpDateComponents(e){const{_effectiveRange:{max:t,min:n,rawMax:o,rawMin:l},field:a,effectiveRequired:r}=this,s=this._getDateFieldValuesForComponents(a,e),u=[];if(V(a)){const e=this.createDateComponent(),d=I(a)||x(a)?o:t,p=I(a)||x(a)?l:n,m=this._getDateFieldValuesForComponents(a,d??null),c=this._getDateFieldValuesForComponents(a,p??null);e.value=s.date??"",e.max=m.date??"",e.min=c.date??"",e.required=r,this.addHandles([i(()=>e,"calciteInputDatePickerOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}if(this.includeTime){const e=this.createTimeComponent();e.value=s.time??"",e.required=r,this.addHandles([i(()=>e,"calciteInputTimePickerOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}if("timestamp-offset"===a.type){const e=this.createTimeZoneComponent();e.value=s.timeZoneOffset??"0",this.addHandles([i(()=>e,"calciteInputTimeZoneOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}return u}_onDateComponentOpen(e){this.editInfo?.inputs.forEach(t=>{t!==e&&"open"in t&&(t.open=!1)})}_syncRowEditingState(e,t=!1){const i=this.grid?.getRowContainingNode(e);i&&(t?i.setAttribute("editing","true"):i.removeAttribute("editing"))}_getDateFieldValuesForComponents(e,t){switch(e.type){case"date":return B(t,this.effectiveTimeZoneOptions.timeZone);case"date-only":return{date:t};case"time-only":return{time:t};case"timestamp-offset":return q(t);default:return{}}}_setUpFieldInput(e,t){const{field:i,layer:n,effectiveTimeZoneOptions:{timeZone:o}}=this,l=new w({feature:e,field:i,initialFeature:e.clone(),layer:n,timeZone:o});return l.set("value",t),l}_isDomainCompatible(e){if(!e)return!1;const{_isNumericField:t,_isStringField:i}=this,{type:n}=e;if("coded-value"===n){const n=typeof e.codedValues[0].code;if("string"===n&&i||"number"===n&&t)return!0}return!("range"!==n||!t)}_getDomainForFeature(e){const{fieldName:t,layer:i,template:n}=this;if(!e||!i?.getFieldDomain)return null;if("wfs"===i.type||"geojson"===i.type||"csv"===i.type)return null;if(n?.domain&&this._isDomainCompatible(n.domain))return n.domain;if("feature"!==i.type&&"subtype-group"!==i.type&&null==i.getField(t)?.domain){const e=f(i,t);if(e)return e}return i.getFieldDomain(t,{feature:e})}_getComputedDomain(e,t){if(!t)return null;if("range"===t.type)return e;if("coded-value"===t.type){const i=t.codedValues.filter(t=>t.hasOwnProperty("code")&&t.code===e);return i&&i.length?i[0].name:e}return null}getFieldValueOptions(e,t){return this.store.getFieldValueOptions({feature:e,fieldName:t,layer:this.layer,emptyString:this.messages?.noValue})}};e([o()],M.prototype,"_effectiveDomain",null),e([o()],M.prototype,"_activeFieldInput",void 0),e([o()],M.prototype,"_effectiveRange",null),e([o()],M.prototype,"_isAnyDateOrTimeField",null),e([o()],M.prototype,"_isIntegerField",null),e([o()],M.prototype,"_isNumericField",null),e([o()],M.prototype,"_isStringField",null),e([o()],M.prototype,"_isSubtypeField",null),e([o()],M.prototype,"_layerWithFieldConfigurations",null),e([o()],M.prototype,"_dateTimeFormatOptions",null),e([o()],M.prototype,"_numberFormatOptions",null),e([o({readOnly:!0})],M.prototype,"alias",null),e([o()],M.prototype,"cellValueFormatFunction",void 0),e([o()],M.prototype,"cellValueValidatorFunction",void 0),e([o({readOnly:!0})],M.prototype,"defaultValue",null),e([o()],M.prototype,"effectiveDescription",null),e([o()],M.prototype,"effectiveEditable",null),e([o()],M.prototype,"effectiveLabel",null),e([o()],M.prototype,"effectiveRequired",null),e([o()],M.prototype,"effectiveSortable",null),e([o()],M.prototype,"effectiveTimeZoneOptions",null),e([o({type:g})],M.prototype,"field",void 0),e([o()],M.prototype,"formatFunction",void 0),e([o()],M.prototype,"includeTime",null),e([o()],M.prototype,"inputRenderFunction",void 0),e([o()],M.prototype,"hasContingentValues",null),e([o()],M.prototype,"layer",void 0),e([o()],M.prototype,"layerFieldConfigurationFormat",null),e([o()],M.prototype,"maxLength",null),e([o()],M.prototype,"minLength",null),e([o({readOnly:!0})],M.prototype,"name",null),e([o({readOnly:!0})],M.prototype,"nullable",null),e([o()],M.prototype,"parseInputValueFunction",void 0),e([o()],M.prototype,"shouldShowPrompt",null),e([o()],M.prototype,"sortable",void 0),e([o()],M.prototype,"store",void 0),e([o()],M.prototype,"template",void 0),e([o()],M.prototype,"view",void 0),M=e([l("esri.widgets.FeatureTable.FieldColumn")],M);const $=M;export{$ as default};
|
|
@@ -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"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as i,isSome as s}from"../../../core/arrayUtils.js";import n from"../../../core/Collection.js";import a from"../../../core/Error.js";import{clone as o}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{getOrCreateMapValue as h}from"../../../core/MapUtils.js";import{removeMaybe as u,abortMaybe as d}from"../../../core/maybe.js";import{ignoreAbortErrors as p,throwIfAborted as c}from"../../../core/promiseUtils.js";import y from"../../../core/ReactiveMap.js";import{watch as g,when as _,syncAndInitial as m,sync as f}from"../../../core/reactiveUtils.js";import{property as b,subclass as E}from"../../../core/accessorSupport/decorators.js";import{geometryTypes as v}from"../../../geometry/support/typeUtils.js";import{isFeatureLayer as C,isSubtypeGroupLayer as I,isSubtypeSublayer as w}from"../../../layers/support/layerUtils.js";import O from"../../../rest/support/AttachmentQuery.js";import F from"../../../rest/support/RelationshipQuery.js";import A from"../../../time/TimeExtent.js";import j from"../../../views/SelectionManager.js";import{temporaryHighlightName as S}from"../../../views/support/HighlightDefaults.js";import{highlightsSupported as q}from"../../../views/support/layerViewUtils.js";import{isSelectableLayerWithObjectIds as M,isSelectableLayer as R}from"../../../views/support/selectionUtils.js";import{isIFeatureTableSupportedLayerWithAttachments as Q,isIFeatureTableSupportedLayerWithAttachmentsEditing as V,isIFeatureTableSupportedLayerWithEditing as H,isIFeatureTableSupportedLayerWithRelationships as W,isPageIndexValid as P,findRelatedLayer as z}from"./tableUtils.js";import L from"../../support/ContingentValuesManager.js";let B=class extends r{constructor(e){super(e),this._attachmentsOperationQueue=new n,this._contingentValuesManager=new L,this._defaultOutFields=["*"],this._editOperationQueue=new n,this.featureTitleMap=new y,this._loaded=!1,this._loadError=!1,this._loading=!1,this._objectIdCache=new n,this._pendingEditsCache=new y,this._queryOperationQueue=new n,this._size=0,this._temporaryHighlight=null,this._temporaryHighlightAbortController=null,this.attachmentsEnabled=!1,this.autoSaveEnabled=!0,this.defaultSelectionManager=new j,this.editingEnabled=!1,this.failures=new n,this.filterByViewExtent=!1,this.filterGeometry=null,this.highlightEnabled=!0,this.initialSize=null,this.layer=null,this.maxSize=null,this.objectIds=null,this.outFields=null,this.pageCache=new y,this.pageSize=50,this.paginationEnabled=!1,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.selectionManager=null,this.sortOrders=[],this.syncViewSelection=!1,this.temporaryHighlightId=void 0,this.timeExtent=null,this.timeZone=null,this.view=null,this.where=null}initialize(){this.addHandles([g(()=>[this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.timeExtent,this.where],()=>this._reset()),g(()=>this.orderByFields,()=>this._clearCaches(),{equals:i}),_(()=>this.attachmentsEnabled,()=>this._reset()),_(()=>this.relatedRecordsEnabled,()=>this._reset()),g(()=>this._layerWithContingentValues,e=>{const t=this._contingentValuesManager;e&&!t.layers.includes(e)&&t.layers.add(e)}),g(()=>[this.view?.extent,this.view?.stationary,this.filterByViewExtent],([e,t,r])=>{r&&(e?t&&(this.filterGeometry=e):this.filterGeometry=null)},m),g(()=>this.maxSize,(e,t)=>{0===t&&this._reset()}),g(()=>[this.layer,this.view],()=>this.syncSelectionSources(),m),g(()=>this.highlightEnabled,e=>this.defaultSelectionManager.highlightEnabled=e,m),g(()=>this.temporaryHighlightId,e=>{this._temporaryHighlight=u(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController;const t=this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal);p(this.view?.addUpdatingPromise(t)??t)},f)])}destroy(){this.layer=null,this.itemCache.destroy(),this.failures.destroy(),this.defaultSelectionManager.destroy(),this._temporaryHighlight=u(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=d(this._temporaryHighlightAbortController)}get _capabilities(){const{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _canSavePendingEdits(){return this.supportsEditing&&this.hasPendingEdits&&!this.hasInvalidPendingEdits}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){const{layer:e}=this;return e&&this._capabilities&&this.attachmentsEnabled&&this.supportsAttachments&&Q(e)?e:null}get _layerWithAttachmentsEditing(){const{_layerWithAttachments:e}=this;return e&&V(e)&&this.supportsEditing?e:null}get _layerWithContingentValues(){const{layer:e}=this;return C(e)||I(e)?e:null}get _layerWithEditing(){const e=this.layer;return H(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){const e=this.layer;return W(e)&&this.supportsQueryRelated?e:null}get _pendingEditsAreInvalid(){const e=this._pendingEditsCache,t=this._layerWithContingentValues;if(!t)return!1;for(const r of e.keys()){const i=e.get(r),s=this._getFeatureWithPendingEdits(r,i);for(const e of i.changes.keys()){if(this._contingentValuesManager.getViolationForField(t,s,e))return!0}}return!1}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){const{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){const{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){const{layer:e}=this;return I(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!(!this._relatedLayerSupportsQuery||!this._relatedLayerSupportsQueryRelated)}get canAddRelatedFeature(){const{state:e,relationship:t,supportsAdd:r,supportsEditing:i}=this;if("loaded"!==e||!t||!r||!i)return!1;const{cardinality:s,role:n}=t,a=this.size>0;return("one-to-one"!==s||!a)&&("one-to-many"!==s||"origin"!==n||!a)}get effectiveOutFields(){const{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;const r=[];t.forEach(t=>{const i=e.fieldsIndex.normalizeFieldName(t);i&&r.push(i)});const{objectIdField:i}=e,s=e.fieldsIndex.normalizeFieldName(i)??i;return s&&!r.includes(s)&&r.unshift(s),r}get effectiveSelectionManager(){const{layer:e,view:t}=this;return e&&this.syncViewSelection&&M(e)&&t?.selectionManager?.sources.includes(e)?t.selectionManager:this.selectionManager??this.defaultSelectionManager}get effectiveSize(){const{_size:e,maxSize:t}=this;return null!=t?Math.min(t,e):e}get effectiveTimeExtent(){const{layer:e,timeExtent:t}=this;return t||e&&"timeExtent"in e&&e.timeExtent||null}get effectiveWhere(){const{layer:e,where:t}=this;return null!=t&&""!==t?t:w(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||"1=1"}get fieldsWithContingentValues(){const e=this._layerWithContingentValues;return e?this._contingentValuesManager.fieldsWithContingentValues.get(e):void 0}get hasContingentValues(){const e=this.fieldsWithContingentValues;return!!(e&&e.size>0)}get hasInvalidPendingEdits(){return this.hasPendingEdits&&this._pendingEditsAreInvalid}get hasPendingEdits(){return this.pendingEditsCount>0}get highlightableLayerView(){const e=this.layerView;return q(e)?e:null}get isQuerying(){return this._queryOperationQueue.length>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new n({items:[...this.pageCache.values()].flat()})}get layerView(){const{layer:e,view:t}=this;if(!e||!t)return null;const r="sublayer"===e.type||w(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===r)}get orderByFields(){const{_sortedFieldNames:e,layer:t,sortOrders:r}=this,i=r.filter(({fieldName:t,direction:r},i)=>e.indexOf(t)===i&&null!=r).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!i.length&&!t.objectIdField&&t.fields?.length){const e=t.fields.find(e=>e.name);if(e){const r=t.fieldsIndex.normalizeFieldName(e.name);r&&i.push(`${r} ASC`)}}return i}get pageCount(){const{effectiveSize:e,pageSize:t}=this;return 0===e||0===t?1:Math.ceil(e/t)}get pageIndex(){return this._get("pageIndex")||0}set pageIndex(e){const{pageCount:t}=this;P(e,t)&&this._set("pageIndex",e)}get pendingEditsCount(){let e=0;return this._pendingEditsCache.forEach(t=>e+=t.changes.size),e}get relationship(){const{relationshipConfig:e}=this;return null==e?.relationshipId?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){const{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:r,view:i}=this,s=[];return t&&e?.loaded&&i?.map&&r?.length?(r.forEach(t=>{const r=z(e,i,t);r&&(r.load(),s.push({layer:e,relatedLayer:r,relationshipId:t.id}))}),s):s}get relationships(){return this._layerWithRelationships?.relationships}get size(){return this._size}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:i}=this;return!e||e.destroyed?"disabled":r||e.loadError?"error":"loaded"===e.loadStatus&&t?"loaded":i?"loading":"ready"}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd&&!this.supportsUpdate)}get supportsAttachments(){const{_capabilities:e}=this;return!(!e?.data?.supportsAttachment||!e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){const{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){const{_capabilities:e}=this;return!(!this.supportsAttachments||!e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd&&!this.supportsUpdate)}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsAddAttachments)return{};const i=await this._queueAttachmentsOperation(e,()=>r.addAttachment(this._createBaseGraphic(r,e),t));return this._ensureArrayContent(i)}addPendingEdits(e){const t=this._ensureLayerAndUpdateSupport();this.editingEnabled?(this.autoSaveEnabled&&this._logWarning("store:pending-edit","Edit will be cached, but 'autoSaveEnabled' is true.",!0),this._stashPendingEdits(t,e)):this._logWarning("store:editing-disabled","Editing is disabled.")}async deleteAttachments(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsUpdateAttachments||!t.length)return[];const i=await this._queueAttachmentsOperation(e,()=>r.deleteAttachments(this._createBaseGraphic(r,e),t));return this._ensureArray(i)}async deleteRowsByObjectId(e){const{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new a("store:delete-error","Delete is not supported.");const r=e.map(e=>this.getItemByObjectId(e)?.feature).filter(s),i=this._queueEditOperation(()=>t.applyEdits({deleteFeatures:r}));return e.forEach(e=>this.featureTitleMap.delete(e)),i}discardPendingEdits(e){if(e?.length)e.forEach(e=>this._discardPendingEdit(e));else{for(const[e,t]of this._pendingEditsCache){const r=this.getItemByObjectId(e);r&&(r.feature=t.originalFeature)}this._pendingEditsCache.clear(),this._clearOptionsAndViolations()}}itemHasInvalidPendingEdits(e,t){if(!this.hasInvalidPendingEdits)return!1;const r=this._layerWithContingentValues,i=this._pendingEditsCache.get(e);if(!r||!i)return!1;const s=this._getFeatureWithPendingEdits(e,i),n=this._contingentValuesManager;return t?!!n.getViolationForField(r,s,t):!!n.getAllViolations(r,s)}itemHasPendingEdits(e,t){const r=this._pendingEditsCache.get(e);return!!r&&(!t||r.changes.has(t))}async fetchItems(e){const{page:t}=e,{pageSize:r}=this,i=t*r,s=i+r,{layer:n,state:a}=this;return n&&"loaded"===a&&0!==this.maxSize?this._query({layer:n,start:i,num:s,page:t,pageSize:r}):[]}async getAttachmentsByObjectId(e,t){const r=this.getItemByObjectId(e)?.attachments??[];if(!r.length&&t){return(await this._queryAttachments([e]))[e]??[]}return r}getFieldValueOptions(e){return this._contingentValuesManager.getFieldValueOptions(e)}async getFeatureTitle(e,r=!1){const{layer:i}=this,s=this.featureTitleMap.get(e),n=`${e}`;if(!i)return s||n;if(s&&!r)return s;if(!("getFeatureTitle"in i)||!i.getFeatureTitle)return n;const a=this.getItemByObjectId(e);let o=a?.feature;o||(o=new t({attributes:{[i.objectIdField]:e},origin:i.graphicOrigin}));const l=await i.getFeatureTitle(o,{fetchMissingFields:!0,removeHTML:!0});return l?(this.featureTitleMap.set(e,l),l):n}getItemByObjectId(e){for(const t of this.pageCache.values())for(const r of t)if(r.objectId===e)return r}getItemIndexByObjectId(e){const{pageCache:t,pageSize:r}=this,i=t.entries();let s=-1;for(const[n,a]of i)if(a.some((t,i)=>{const a=t.objectId===e;return a&&(s=n*r+i),a}),s>-1)break;return s}async load(){const{layer:e}=this;if(!this._loading&&!this._loaded&&e){this._reset(),this._loading=!0;try{await e.load(),e.parent&&I(e.parent)&&await e.parent.loadAll(),await e.when();const t=this.initialSize;this.initialSize=null,await this.refresh(t),this._loaded=!0,this._loading=!1}catch(t){throw this._reset(),this._loadError=!0,this._logError("store:load-error","An error occurred."),t}}}async query(e){const{state:t}=this;return this.supportsQuery&&"loaded"===t?this._query(e):[]}async refresh(e){this._clearCaches(),await this._syncSize(e),await this._syncObjectIdCache(),this._syncPendingEdits()}reset(){this._reset()}async savePendingEdits(){if(!this.hasPendingEdits)return;if(!this._canSavePendingEdits)return void this._logError("store:update-error","An error occurred. Unable to save pending edits.");const e=[];for(const[t]of this._pendingEditsCache){const r=this.getItemByObjectId(t);r?.feature&&e.push(r.feature)}await this._savePendingEdits(e),this._clearOptionsAndViolations()}syncSelectionSources(){const{defaultSelectionManager:e,layer:t,view:r}=this;e.view=r,e.sources.removeAll(),R(t)&&(e.sources.items=[t])}async updateAttachment(e,t,r){const{_layerWithAttachmentsEditing:i}=this;if(!i||!this.supportsUpdateAttachments)return{};const s=await this._queueAttachmentsOperation(e,()=>i.updateAttachment(this._createBaseGraphic(i,e),t,r));return this._ensureArrayContent(s)}async updateItem(e){const t=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled)return void this._logWarning("store:editing-disabled","Editing is disabled.");if(this.hasContingentValues){const t=e.updates.some(e=>this.fieldsWithContingentValues?.has(e.fieldName)),r=this.itemHasPendingEdits(e.objectId);if(r||t){const t=this._layerWithContingentValues,i=this.getItemByObjectId(e.objectId)?.feature?.clone();if(i){const s=this._contingentValuesManager.getAllViolations(t,i);e.updates.forEach(({fieldName:e,value:r})=>{const s=t.getField(e);s&&(i.attributes[s.name]=r)});if(this._contingentValuesManager.validateContingencyConstraints(t,i).length||s.length||r)return this._stashPendingEdits(t,[e]),void this._contingentValuesManager.resetOptionsForLayer(t)}}}if(!this.autoSaveEnabled)return void this._stashPendingEdits(t,[e]);const{_sortedFieldNames:r}=this,i=e.updates.map(({fieldName:e})=>e);!(await this._update(t,e)).updateFeatureResults.find(e=>e.error)&&i.some(e=>r.includes(e))&&this._clearCaches()}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{objectIdField:i}=t,s=await this._queryFeaturesByObjectId(e);return e.map(e=>s.some(t=>{const r=t.getObjectId()??t.attributes[i];return e===r}))}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,r){const i=new t({attributes:{[e.objectIdField]:r}});return this._subtypeField&&null!=this._subtypeCode&&(i.attributes[this._subtypeField]=this._subtypeCode),i}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_logError(e,t){l.getLogger(this).error(e,t)}_logWarning(e,t,r=!1){r?l.getLogger(this).warnOnce(e,t):l.getLogger(this).warn(e,t)}_reset(){this._clearCaches(),this._pendingEditsCache.clear(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this._queryOperationQueue.removeAll(),this.featureTitleMap.clear(),this._temporaryHighlight=u(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=d(this._temporaryHighlightAbortController),this._loading=!1,this._loaded=!1,this._loadError=!1,this._size=0}async _syncSize(e){0!==this.maxSize?this._size=e??await this._queryCount():this._size=0}async _syncObjectIdCache(){if(this.supportsPagination)return;const e=await this._queryObjectIds();this._objectIdCache.removeAll(),this._objectIdCache.addMany(e)}async _queryFeaturesByObjectId(e){const{layer:t}=this;if(!t||!this.supportsQuery)throw new a("store:query-error","Layer does not support query operation.");const{effectiveTimeExtent:r,effectiveWhere:i,orderByFields:s,supportsCacheHint:n,supportsOrderBy:o}=this,l=t.createQuery();l.where=i,l.timeExtent=r,l.returnGeometry=!1,l.objectIds=e.length?e:void 0,l.outFields=[t.objectIdField],o&&(l.orderByFields=s),n&&(l.cacheHint=!0);return(await t.queryFeatures(l)).features}async _syncTemporaryHighlight(e,t){const{highlightEnabled:r,highlightableLayerView:i}=this;i&&r&&null!=e&&(c(t),this._temporaryHighlight={id:e,handle:i.highlight(e,{name:S})})}_ensureLayerAndUpdateSupport(){const e=this._layerWithEditing;if(!this.supportsUpdate||!e)throw new a("store:update-error","Update is not supported.");return e}_stashPendingEdits(e,t){t.forEach(({objectId:t,updates:r})=>{const i=this.getItemByObjectId(t)?.feature;if(!i)throw new a("store:update-error","Feature with provided 'objectId' not found.");const s=i.clone(),n=h(this._pendingEditsCache,t,()=>({originalFeature:s,changes:new y}));r.forEach(({fieldName:t,value:r})=>{const s=e.getField(t);s?(n.changes.set(s.name,r),i.attributes[s.name]=r):this._logWarning("store:pending-edit-unknown-field","The provided field does not belong to this layer.")}),n.changes.size>0&&this._pendingEditsCache.set(t,n)})}_syncPendingEdits(){for(const[e,t]of this._pendingEditsCache){const r=this.getItemByObjectId(e)?.feature;if(r){const e=r.clone();for(const[i,s]of t.changes)r.attributes[i]=s;t.originalFeature=e}}}_getFeatureWithPendingEdits(e,t){let r=this.getItemByObjectId(e)?.feature;if(!r){r=t.originalFeature.clone();for(const[e,i]of t.changes)r.attributes[e]=i}return r}_discardPendingEdit({objectId:e,fieldName:t}){const r=this._pendingEditsCache.get(e);if(!r)return void this._logWarning("store:pending-edit-not-found","Could not find a pending edit with the given information");const i=this.getItemByObjectId(e);t?(i&&(i.feature.attributes[t]=r.originalFeature.attributes[t]),r.changes.delete(t),0===r.changes.size&&this._pendingEditsCache.delete(e)):(i&&(i.feature=r.originalFeature),this._pendingEditsCache.delete(e))}_clearOptionsAndViolations(){const{_layerWithContingentValues:e,_contingentValuesManager:t}=this;e&&(t.resetOptionsForLayer(e),t.resetViolationsForLayer(e))}async _update(e,r){const{objectId:i,updates:s}=r,n=this.getItemByObjectId(i)?.feature;if(!n)throw new a("store:update-error","Feature with provided 'objectId' not found.");const l=o(n.attributes);s.forEach(({fieldName:e,value:t})=>l[e]=t);const h=new t({attributes:l,sourceLayer:n.sourceLayer}),u=e.applyEdits({updateFeatures:[h]}).then(e=>{const{updateFeatureResults:t}=e,r=t.find(e=>!!e.error);if(r)throw r.error;return t.length&&(n.attributes=l,this.featureTitleMap.has(i)&&this.getFeatureTitle(i,!0)),e});return this._queueEditOperation(()=>u)}async _savePendingEdits(e){const{_layerWithEditing:t}=this;if(!this.supportsUpdate||!t)throw new a("store:update-error","Update is not supported.");const r=t.applyEdits({updateFeatures:e}).then(e=>{const{updateFeatureResults:t}=e,r=t.filter(e=>!!e.error);if(r.length)throw this.discardPendingEdits(),r[0].error;return e});return this._queueEditOperation(()=>r,!0)}_createFeatureStoreItems(e){const{attachments:t,features:r,layer:i,relatedRecords:s}=e,n=i.objectIdField;return r.map(e=>{const r=e.getObjectId()??e.attributes[n],a=[];e.layer||e.sourceLayer||(e.layer=i,e.sourceLayer=i);const o=this._pendingEditsCache.get(r);if(o){const t=e.clone(),r=o.changes;for(const[i,s]of r)e.attributes[i]=s;o.originalFeature=t}return s.forEach((e,t)=>{a.push({relationshipId:t,count:e[r]??0})}),{objectId:r,feature:e,attachments:t[r]??null,relatedRecords:a}})}async _query(e){const{page:t,refresh:r}=e;!0===r&&await this.refresh();const i=this.pageCache.get(t);if(i)return i;const s=await this._queryPage(e);return this.pageCache.set(t,s),s}_queryAttachments(e){const{_layerWithAttachments:t,effectiveWhere:r}=this;return t?e.some(e=>"number"!=typeof e)?Promise.reject(new a("invalid-object-id","Only numeric object ids are valid to query attachments")):t.queryAttachments(new O({objectIds:e,where:r,returnMetadata:!0})):Promise.resolve({})}async _queryCount(){const{_relatedLayerSupportsCacheHint:e,layer:t,relationshipConfig:r,supportsCacheHint:i}=this;if(!t)return 0;if(r&&this._canUseRelatedLayer){const{objectId:t,relatedLayer:i,relationshipId:s}=r;return(await i.queryRelatedFeaturesCount(new F({cacheHint:e,relationshipId:s,objectIds:[t]})))[t]??0}const{effectiveTimeExtent:s,effectiveWhere:n,filterGeometry:a,objectIds:o}=this,l=t.createQuery();return l.geometry=a,l.returnGeometry=!1,l.where=n,l.timeExtent=s,l.objectIds=o?.length?o:void 0,i&&(l.cacheHint=!0),t.queryFeatureCount(l)}async _queryFeatures(e){const{relationshipConfig:t}=this;if(t&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,t);const{_effectiveReturnM:r,_effectiveReturnZ:i,effectiveOutFields:s,effectiveTimeExtent:n,effectiveWhere:a,filterGeometry:o,objectIds:l,orderByFields:h,pageSize:u,returnGeometry:d,supportsCacheHint:p,supportsOrderBy:c,supportsPagination:y}=this,{layer:g,start:_}=e,m=l?.length,f=g.createQuery();f.returnGeometry=d,f.outFields=s,f.returnM=r,f.returnZ=i,y?(f.start=_,f.num=u,f.where=a,f.timeExtent=n,f.objectIds=m?l:void 0):f.objectIds=m?l:this._getObjectIdsForPage(_,u??0),c&&(f.orderByFields=h),o&&(f.geometry=o),p&&(f.cacheHint=!0);return(await g.queryFeatures(f)).features}_queryObjectIds(){const{effectiveTimeExtent:e,effectiveWhere:t,filterGeometry:r,layer:i,objectIds:s,orderByFields:n,supportsCacheHint:a,supportsOrderBy:o}=this;if(!i)return Promise.resolve([]);const l=i.createQuery();return l.geometry=r,l.outFields=[i.objectIdField],l.returnGeometry=!1,l.where=t,l.timeExtent=e,l.objectIds=s?.length?s:void 0,o&&(l.orderByFields=n),a&&(l.cacheHint=!0),i.queryObjectIds(l)}async _queryPage(e){const{layer:t}=e;return this._queueQueryOperation(async()=>{const r=await this._queryFeatures(e),i=r.map(e=>e.getObjectId()??e.attributes[t.objectIdField]),s=await this._queryAttachments(i),n=await this._queryRelatedCounts(i);return this._createFeatureStoreItems({layer:t,features:r,attachments:s,relatedRecords:n})||[]})}async _queryRelatedCounts(e){const{_layerWithRelationships:t,relationshipIds:r,supportsCacheHintQueryRelated:i}=this,s=new Map;return t&&e?.length&&r.length?(await Promise.allSettled(r.map(async r=>{const n=await t.queryRelatedFeaturesCount(new F({cacheHint:i,relationshipId:r,objectIds:e}));s.set(r,n)})),s):s}async _queryRelatedFeatures(e,t){const{_defaultOutFields:r,_effectiveReturnM:i,_effectiveReturnZ:s,orderByFields:n,pageSize:a,returnGeometry:o,supportsCacheHint:l}=this,{layer:h,start:u}=e,{objectId:d,relatedLayer:p,relationshipId:c}=t,y=h.createQuery(),g=new F({cacheHint:l,num:a,objectIds:[d],orderByFields:n,outFields:r,relationshipId:c,returnGeometry:o,returnM:i,returnZ:s,start:u,where:y.where??void 0}),_=await p.queryRelatedFeatures(g);return _[d]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async r=>{this._attachmentsOperationQueue.remove(t);const i=this._ensureArray(r),s=i.some(e=>e.error),n=this.getItemByObjectId(e);if(n&&(!s||i.length>1)){const t=await this._queryAttachments([e]);n.attachments=t[e]}return r}).catch(async r=>{this._logError("store:attachment-error","An error occurred.");const i={error:r,retry:()=>{this.failures.remove(i),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(i)};throw this.failures.add(i),this._attachmentsOperationQueue.remove(t),r})}_queueEditOperation(e,t=!1){return this._editOperationQueue.push(e),e().then(r=>(this._editOperationQueue.remove(e),t&&this._pendingEditsCache.clear(),r)).catch(t=>{this._logError("store:edit-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._editOperationQueue.remove(e),t})}_queueQueryOperation(e){return this._queryOperationQueue.push(e),e().then(t=>this._queryOperationQueue.includes(e)?t:[]).catch(t=>{this._logError("store:query-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]}).then(t=>(this._queryOperationQueue.remove(e),t))}};e([b()],B.prototype,"_attachmentsOperationQueue",void 0),e([b({readOnly:!0})],B.prototype,"_capabilities",null),e([b()],B.prototype,"_canSavePendingEdits",null),e([b()],B.prototype,"_contingentValuesManager",void 0),e([b()],B.prototype,"_defaultOutFields",void 0),e([b()],B.prototype,"_editOperationQueue",void 0),e([b()],B.prototype,"_effectiveReturnZ",null),e([b()],B.prototype,"_effectiveReturnM",null),e([b()],B.prototype,"featureTitleMap",void 0),e([b({readOnly:!0})],B.prototype,"_layerWithAttachments",null),e([b({readOnly:!0})],B.prototype,"_layerWithAttachmentsEditing",null),e([b()],B.prototype,"_layerWithContingentValues",null),e([b({readOnly:!0})],B.prototype,"_layerWithEditing",null),e([b({readOnly:!0})],B.prototype,"_layerWithRelationships",null),e([b()],B.prototype,"_loaded",void 0),e([b()],B.prototype,"_loadError",void 0),e([b()],B.prototype,"_loading",void 0),e([b()],B.prototype,"_objectIdCache",void 0),e([b()],B.prototype,"_pendingEditsCache",void 0),e([b()],B.prototype,"_pendingEditsAreInvalid",null),e([b()],B.prototype,"_queryOperationQueue",void 0),e([b({readOnly:!0})],B.prototype,"_relatedLayer",null),e([b({readOnly:!0})],B.prototype,"_relatedLayerCapabilities",null),e([b({readOnly:!0})],B.prototype,"_relatedLayerSupportsCacheHint",null),e([b()],B.prototype,"_relatedLayerSupportsQuery",null),e([b()],B.prototype,"_relatedLayerSupportsQueryRelated",null),e([b()],B.prototype,"_size",void 0),e([b()],B.prototype,"_sortedFieldNames",null),e([b()],B.prototype,"_subtypeCode",null),e([b()],B.prototype,"_subtypeField",null),e([b()],B.prototype,"_canUseRelatedLayer",null),e([b()],B.prototype,"attachmentsEnabled",void 0),e([b()],B.prototype,"autoSaveEnabled",void 0),e([b()],B.prototype,"canAddRelatedFeature",null),e([b()],B.prototype,"defaultSelectionManager",void 0),e([b()],B.prototype,"editingEnabled",void 0),e([b()],B.prototype,"effectiveOutFields",null),e([b()],B.prototype,"effectiveSelectionManager",null),e([b()],B.prototype,"effectiveSize",null),e([b()],B.prototype,"effectiveTimeExtent",null),e([b()],B.prototype,"effectiveWhere",null),e([b({readOnly:!0})],B.prototype,"failures",void 0),e([b()],B.prototype,"fieldsWithContingentValues",null),e([b()],B.prototype,"filterByViewExtent",void 0),e([b({types:v})],B.prototype,"filterGeometry",void 0),e([b()],B.prototype,"hasContingentValues",null),e([b()],B.prototype,"hasInvalidPendingEdits",null),e([b()],B.prototype,"hasPendingEdits",null),e([b()],B.prototype,"highlightEnabled",void 0),e([b()],B.prototype,"highlightableLayerView",null),e([b()],B.prototype,"initialSize",void 0),e([b({readOnly:!0})],B.prototype,"isQuerying",null),e([b({readOnly:!0})],B.prototype,"isSyncing",null),e([b({readOnly:!0})],B.prototype,"isSyncingAttachmentEdits",null),e([b({readOnly:!0})],B.prototype,"isSyncingFeatureEdits",null),e([b({readOnly:!0})],B.prototype,"itemCache",null),e([b()],B.prototype,"layer",void 0),e([b()],B.prototype,"layerView",null),e([b()],B.prototype,"maxSize",void 0),e([b()],B.prototype,"objectIds",void 0),e([b()],B.prototype,"orderByFields",null),e([b()],B.prototype,"outFields",void 0),e([b({readOnly:!0})],B.prototype,"pageCache",void 0),e([b()],B.prototype,"pageCount",null),e([b()],B.prototype,"pageIndex",null),e([b()],B.prototype,"pageSize",void 0),e([b()],B.prototype,"paginationEnabled",void 0),e([b()],B.prototype,"pendingEditsCount",null),e([b()],B.prototype,"relationship",null),e([b()],B.prototype,"relationshipConfig",void 0),e([b()],B.prototype,"relationshipIds",null),e([b()],B.prototype,"relationshipInfos",null),e([b()],B.prototype,"relationships",null),e([b()],B.prototype,"relatedRecordsEnabled",void 0),e([b()],B.prototype,"returnGeometry",void 0),e([b()],B.prototype,"returnZ",void 0),e([b()],B.prototype,"returnM",void 0),e([b()],B.prototype,"selectionManager",void 0),e([b({readOnly:!0})],B.prototype,"size",null),e([b()],B.prototype,"sortOrders",void 0),e([b({readOnly:!0})],B.prototype,"state",null),e([b()],B.prototype,"supportsAdd",null),e([b()],B.prototype,"supportsAddAttachments",null),e([b()],B.prototype,"supportsAttachments",null),e([b()],B.prototype,"supportsCacheHint",null),e([b()],B.prototype,"supportsCacheHintQueryRelated",null),e([b()],B.prototype,"supportsDelete",null),e([b()],B.prototype,"supportsEditing",null),e([b()],B.prototype,"supportsM",null),e([b()],B.prototype,"supportsOrderBy",null),e([b()],B.prototype,"supportsPagination",null),e([b()],B.prototype,"supportsQuery",null),e([b()],B.prototype,"supportsQueryRelated",null),e([b()],B.prototype,"supportsResizeAttachments",null),e([b()],B.prototype,"supportsUpdate",null),e([b()],B.prototype,"supportsUpdateAttachments",null),e([b()],B.prototype,"supportsZ",null),e([b()],B.prototype,"syncViewSelection",void 0),e([b()],B.prototype,"temporaryHighlightId",void 0),e([b({type:A})],B.prototype,"timeExtent",void 0),e([b()],B.prototype,"timeZone",void 0),e([b()],B.prototype,"view",void 0),e([b()],B.prototype,"where",void 0),B=e([E("esri.widgets.FeatureTable.support.FeatureStore")],B);const x=B;export{x as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{equals as i,isSome as s}from"../../../core/arrayUtils.js";import n from"../../../core/Collection.js";import a from"../../../core/Error.js";import{clone as o}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{getOrCreateMapValue as h}from"../../../core/MapUtils.js";import{removeMaybe as u,abortMaybe as d}from"../../../core/maybe.js";import{ignoreAbortErrors as p,throwIfAborted as c}from"../../../core/promiseUtils.js";import y from"../../../core/ReactiveMap.js";import{watch as g,when as _,syncAndInitial as m,sync as f}from"../../../core/reactiveUtils.js";import{property as b,subclass as E}from"../../../core/accessorSupport/decorators.js";import{geometryTypes as v}from"../../../geometry/support/typeUtils.js";import{isFeatureLayer as C,isSubtypeGroupLayer as I,isSubtypeSublayer as w}from"../../../layers/support/layerUtils.js";import O from"../../../rest/support/AttachmentQuery.js";import F from"../../../rest/support/RelationshipQuery.js";import A from"../../../time/TimeExtent.js";import j from"../../../views/SelectionManager.js";import{temporaryHighlightName as S}from"../../../views/support/HighlightDefaults.js";import{highlightsSupported as q}from"../../../views/support/layerViewUtils.js";import{isSelectableLayerWithObjectIds as M,isSelectableLayer as R}from"../../../views/support/selectionUtils.js";import{isIFeatureTableSupportedLayerWithAttachments as Q,isIFeatureTableSupportedLayerWithAttachmentsEditing as V,isIFeatureTableSupportedLayerWithEditing as H,isIFeatureTableSupportedLayerWithRelationships as W,isPageIndexValid as P,findRelatedLayer as z}from"./tableUtils.js";import{ContingentValuesManager as L}from"../../support/ContingentValuesManager.js";let B=class extends r{constructor(e){super(e),this._attachmentsOperationQueue=new n,this._contingentValuesManager=new L,this._defaultOutFields=["*"],this._editOperationQueue=new n,this.featureTitleMap=new y,this._loaded=!1,this._loadError=!1,this._loading=!1,this._objectIdCache=new n,this._pendingEditsCache=new y,this._queryOperationQueue=new n,this._size=0,this._temporaryHighlight=null,this._temporaryHighlightAbortController=null,this.attachmentsEnabled=!1,this.autoSaveEnabled=!0,this.defaultSelectionManager=new j,this.editingEnabled=!1,this.failures=new n,this.filterByViewExtent=!1,this.filterGeometry=null,this.highlightEnabled=!0,this.initialSize=null,this.layer=null,this.maxSize=null,this.objectIds=null,this.outFields=null,this.pageCache=new y,this.pageSize=50,this.paginationEnabled=!1,this.relationshipConfig=null,this.relatedRecordsEnabled=!1,this.returnGeometry=!1,this.returnZ=!1,this.returnM=!1,this.selectionManager=null,this.sortOrders=[],this.syncViewSelection=!1,this.temporaryHighlightId=void 0,this.timeExtent=null,this.timeZone=null,this.view=null,this.where=null}initialize(){this.addHandles([g(()=>[this.filterGeometry,this.layer,this.objectIds,this.outFields,this.pageSize,this.relationshipConfig,this.returnGeometry,this.returnM,this.returnZ,this.timeExtent,this.where],()=>this._reset()),g(()=>this.orderByFields,()=>this._clearCaches(),{equals:i}),_(()=>this.attachmentsEnabled,()=>this._reset()),_(()=>this.relatedRecordsEnabled,()=>this._reset()),g(()=>this._layerWithContingentValues,e=>{const t=this._contingentValuesManager;e&&!t.layers.includes(e)&&t.layers.add(e)}),g(()=>[this.view?.extent,this.view?.stationary,this.filterByViewExtent],([e,t,r])=>{r&&(e?t&&(this.filterGeometry=e):this.filterGeometry=null)},m),g(()=>this.maxSize,(e,t)=>{0===t&&this._reset()}),g(()=>[this.layer,this.view],()=>this.syncSelectionSources(),m),g(()=>this.highlightEnabled,e=>this.defaultSelectionManager.highlightEnabled=e,m),g(()=>this.temporaryHighlightId,e=>{this._temporaryHighlight=u(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController;const t=this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal);p(this.view?.addUpdatingPromise(t)??t)},f)])}destroy(){this.layer=null,this.itemCache.destroy(),this.failures.destroy(),this.defaultSelectionManager.destroy(),this._temporaryHighlight=u(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=d(this._temporaryHighlightAbortController)}get _capabilities(){const{layer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _canSavePendingEdits(){return this.supportsEditing&&this.hasPendingEdits&&!this.hasInvalidPendingEdits}get _effectiveReturnZ(){return this.returnZ&&this.supportsZ}get _effectiveReturnM(){return this.returnM&&this.supportsM}get _layerWithAttachments(){const{layer:e}=this;return e&&this._capabilities&&this.attachmentsEnabled&&this.supportsAttachments&&Q(e)?e:null}get _layerWithAttachmentsEditing(){const{_layerWithAttachments:e}=this;return e&&V(e)&&this.supportsEditing?e:null}get _layerWithContingentValues(){const{layer:e}=this;return C(e)||I(e)?e:null}get _layerWithEditing(){const e=this.layer;return H(e)&&this.supportsEditing?e:null}get _layerWithRelationships(){const e=this.layer;return W(e)&&this.supportsQueryRelated?e:null}get _pendingEditsAreInvalid(){const e=this._pendingEditsCache,t=this._layerWithContingentValues;if(!t)return!1;for(const r of e.keys()){const i=e.get(r),s=this._getFeatureWithPendingEdits(r,i);for(const e of i.changes.keys()){if(this._contingentValuesManager.getViolationForField(t,s,e))return!0}}return!1}get _relatedLayer(){return this.relationshipConfig?.relatedLayer}get _relatedLayerCapabilities(){const{_relatedLayer:e}=this;return e?.effectiveCapabilities??e?.capabilities}get _relatedLayerSupportsCacheHint(){return!!this._relatedLayerCapabilities?.queryRelated?.supportsCacheHint}get _relatedLayerSupportsQuery(){return!!this._relatedLayerCapabilities?.operations.supportsQuery}get _relatedLayerSupportsQueryRelated(){const{_relatedLayerCapabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get _sortedFieldNames(){return this.sortOrders.map(({fieldName:e})=>e)}get _subtypeCode(){return this.layer?.subtypeCode??null}get _subtypeField(){const{layer:e}=this;return I(e?.parent)?e.subtypeField:null}get _canUseRelatedLayer(){return!(!this._relatedLayerSupportsQuery||!this._relatedLayerSupportsQueryRelated)}get canAddRelatedFeature(){const{state:e,relationship:t,supportsAdd:r,supportsEditing:i}=this;if("loaded"!==e||!t||!r||!i)return!1;const{cardinality:s,role:n}=t,a=this.size>0;return("one-to-one"!==s||!a)&&("one-to-many"!==s||"origin"!==n||!a)}get effectiveOutFields(){const{layer:e,outFields:t}=this;if(!e||!t?.length)return this._defaultOutFields;const r=[];t.forEach(t=>{const i=e.fieldsIndex.normalizeFieldName(t);i&&r.push(i)});const{objectIdField:i}=e,s=e.fieldsIndex.normalizeFieldName(i)??i;return s&&!r.includes(s)&&r.unshift(s),r}get effectiveSelectionManager(){const{layer:e,view:t}=this;return e&&this.syncViewSelection&&M(e)&&t?.selectionManager?.sources.includes(e)?t.selectionManager:this.selectionManager??this.defaultSelectionManager}get effectiveSize(){const{_size:e,maxSize:t}=this;return null!=t?Math.min(t,e):e}get effectiveTimeExtent(){const{layer:e,timeExtent:t}=this;return t||e&&"timeExtent"in e&&e.timeExtent||null}get effectiveWhere(){const{layer:e,where:t}=this;return null!=t&&""!==t?t:w(e)&&e.parent?.definitionExpression?e.parent.definitionExpression:e?.definitionExpression||"1=1"}get fieldsWithContingentValues(){return this._contingentValuesManager.getFieldsWithContingentValues(this.layer)}get hasContingentValues(){return this.fieldsWithContingentValues.size>0}get hasInvalidPendingEdits(){return this.hasPendingEdits&&this._pendingEditsAreInvalid}get hasPendingEdits(){return this.pendingEditsCount>0}get highlightableLayerView(){const e=this.layerView;return q(e)?e:null}get isQuerying(){return this._queryOperationQueue.length>0}get isSyncing(){return this.isSyncingFeatureEdits||this.isSyncingAttachmentEdits}get isSyncingAttachmentEdits(){return this._attachmentsOperationQueue.length>0}get isSyncingFeatureEdits(){return this._editOperationQueue.length>0}get itemCache(){return new n({items:[...this.pageCache.values()].flat()})}get layerView(){const{layer:e,view:t}=this;if(!e||!t)return null;const r="sublayer"===e.type||w(e)?e.parent:e;return t.allLayerViews.find(e=>e.layer===r)}get orderByFields(){const{_sortedFieldNames:e,layer:t,sortOrders:r}=this,i=r.filter(({fieldName:t,direction:r},i)=>e.indexOf(t)===i&&null!=r).map(({fieldName:e,direction:t})=>`${e} ${t?.toUpperCase()}`);if(t&&!i.length&&!t.objectIdField&&t.fields?.length){const e=t.fields.find(e=>e.name);if(e){const r=t.fieldsIndex.normalizeFieldName(e.name);r&&i.push(`${r} ASC`)}}return i}get pageCount(){const{effectiveSize:e,pageSize:t}=this;return 0===e||0===t?1:Math.ceil(e/t)}get pageIndex(){return this._get("pageIndex")||0}set pageIndex(e){const{pageCount:t}=this;P(e,t)&&this._set("pageIndex",e)}get pendingEditsCount(){let e=0;return this._pendingEditsCache.forEach(t=>e+=t.changes.size),e}get relationship(){const{relationshipConfig:e}=this;return null==e?.relationshipId?null:this.relationships?.find(t=>t.id===e.relationshipId)}get relationshipIds(){return this.relationships?.map(e=>e.id)??[]}get relationshipInfos(){const{_layerWithRelationships:e,relatedRecordsEnabled:t,relationships:r,view:i}=this,s=[];return t&&e?.loaded&&i?.map&&r?.length?(r.forEach(t=>{const r=z(e,i,t);r&&(r.load(),s.push({layer:e,relatedLayer:r,relationshipId:t.id}))}),s):s}get relationships(){return this._layerWithRelationships?.relationships}get size(){return this._size}get state(){const{layer:e,_loaded:t,_loadError:r,_loading:i}=this;return!e||e.destroyed?"disabled":r||e.loadError?"error":"loaded"===e.loadStatus&&t?"loaded":i?"loading":"ready"}get supportsAdd(){return!!this._capabilities?.operations.supportsAdd}get supportsAddAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd&&!this.supportsUpdate)}get supportsAttachments(){const{_capabilities:e}=this;return!(!e?.data?.supportsAttachment||!e?.operations.supportsQueryAttachments)}get supportsCacheHint(){return!!this._capabilities?.query?.supportsCacheHint}get supportsCacheHintQueryRelated(){return!!this._capabilities?.queryRelated?.supportsCacheHint}get supportsDelete(){return!!this._capabilities?.operations.supportsDelete}get supportsEditing(){return!!this._capabilities?.operations.supportsEditing}get supportsM(){return!!this.layer?.hasM&&!!this._capabilities?.data?.supportsM}get supportsOrderBy(){return!!this._capabilities?.query?.supportsOrderBy}get supportsPagination(){return!!this._capabilities?.query?.supportsPagination}get supportsQuery(){return!!this._capabilities?.operations.supportsQuery}get supportsQueryRelated(){const{_capabilities:e}=this;return!!e?.queryRelated?.supportsCount&&!!e?.queryRelated?.supportsPagination}get supportsResizeAttachments(){const{_capabilities:e}=this;return!(!this.supportsAttachments||!e?.attachment?.supportsResize)}get supportsUpdate(){return!!this._capabilities?.operations.supportsUpdate}get supportsUpdateAttachments(){return!(!this._layerWithAttachmentsEditing||!this.supportsAdd&&!this.supportsUpdate)}get supportsZ(){return!!this.layer?.hasZ&&!!this._capabilities?.data?.supportsZ}async addAttachment(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsAddAttachments)return{};const i=await this._queueAttachmentsOperation(e,()=>r.addAttachment(this._createBaseGraphic(r,e),t));return this._ensureArrayContent(i)}addPendingEdits(e){const t=this._ensureLayerAndUpdateSupport();this.editingEnabled?(this.autoSaveEnabled&&this._logWarning("store:pending-edit","Edit will be cached, but 'autoSaveEnabled' is true.",!0),this._stashPendingEdits(t,e)):this._logWarning("store:editing-disabled","Editing is disabled.")}async deleteAttachments(e,t){const{_layerWithAttachmentsEditing:r}=this;if(!r||!this.supportsUpdateAttachments||!t.length)return[];const i=await this._queueAttachmentsOperation(e,()=>r.deleteAttachments(this._createBaseGraphic(r,e),t));return this._ensureArray(i)}async deleteRowsByObjectId(e){const{_layerWithEditing:t}=this;if(!this.supportsDelete||!t)throw new a("store:delete-error","Delete is not supported.");const r=e.map(e=>this.getItemByObjectId(e)?.feature).filter(s),i=this._queueEditOperation(()=>t.applyEdits({deleteFeatures:r}));return e.forEach(e=>this.featureTitleMap.delete(e)),i}discardPendingEdits(e){if(e?.length)e.forEach(e=>this._discardPendingEdit(e));else{for(const[e,t]of this._pendingEditsCache){const r=this.getItemByObjectId(e);r&&(r.feature=t.originalFeature)}this._pendingEditsCache.clear(),this._clearOptionsAndViolations()}}itemHasInvalidPendingEdits(e,t){if(!this.hasInvalidPendingEdits)return!1;const r=this._layerWithContingentValues,i=this._pendingEditsCache.get(e);if(!r||!i)return!1;const s=this._getFeatureWithPendingEdits(e,i),n=this._contingentValuesManager;return t?!!n.getViolationForField(r,s,t):!!n.getAllViolations(r,s)}itemHasPendingEdits(e,t){const r=this._pendingEditsCache.get(e);return!!r&&(!t||r.changes.has(t))}async fetchItems(e){const{page:t}=e,{pageSize:r}=this,i=t*r,s=i+r,{layer:n,state:a}=this;return n&&"loaded"===a&&0!==this.maxSize?this._query({layer:n,start:i,num:s,page:t,pageSize:r}):[]}async getAttachmentsByObjectId(e,t){const r=this.getItemByObjectId(e)?.attachments??[];if(!r.length&&t){return(await this._queryAttachments([e]))[e]??[]}return r}getFieldValueOptions(e){return this._contingentValuesManager.getFieldValueOptions(e)}async getFeatureTitle(e,r=!1){const{layer:i}=this,s=this.featureTitleMap.get(e),n=`${e}`;if(!i)return s||n;if(s&&!r)return s;if(!("getFeatureTitle"in i)||!i.getFeatureTitle)return n;const a=this.getItemByObjectId(e);let o=a?.feature;o||(o=new t({attributes:{[i.objectIdField]:e},origin:i.graphicOrigin}));const l=await i.getFeatureTitle(o,{fetchMissingFields:!0,removeHTML:!0});return l?(this.featureTitleMap.set(e,l),l):n}getItemByObjectId(e){for(const t of this.pageCache.values())for(const r of t)if(r.objectId===e)return r}getItemIndexByObjectId(e){const{pageCache:t,pageSize:r}=this,i=t.entries();let s=-1;for(const[n,a]of i)if(a.some((t,i)=>{const a=t.objectId===e;return a&&(s=n*r+i),a}),s>-1)break;return s}async load(){const{layer:e}=this;if(!this._loading&&!this._loaded&&e){this._reset(),this._loading=!0;try{await e.load(),e.parent&&I(e.parent)&&await e.parent.loadAll(),await e.when();const t=this.initialSize;this.initialSize=null,await this.refresh(t),this._loaded=!0,this._loading=!1}catch(t){throw this._reset(),this._loadError=!0,this._logError("store:load-error","An error occurred."),t}}}async query(e){const{state:t}=this;return this.supportsQuery&&"loaded"===t?this._query(e):[]}async refresh(e){this._clearCaches(),await this._syncSize(e),await this._syncObjectIdCache(),this._syncPendingEdits()}reset(){this._reset()}async savePendingEdits(){if(!this.hasPendingEdits)return;if(!this._canSavePendingEdits)return void this._logError("store:update-error","An error occurred. Unable to save pending edits.");const e=[];for(const[t]of this._pendingEditsCache){const r=this.getItemByObjectId(t);r?.feature&&e.push(r.feature)}await this._savePendingEdits(e),this._clearOptionsAndViolations()}syncSelectionSources(){const{defaultSelectionManager:e,layer:t,view:r}=this;e.view=r,e.sources.removeAll(),R(t)&&(e.sources.items=[t])}async updateAttachment(e,t,r){const{_layerWithAttachmentsEditing:i}=this;if(!i||!this.supportsUpdateAttachments)return{};const s=await this._queueAttachmentsOperation(e,()=>i.updateAttachment(this._createBaseGraphic(i,e),t,r));return this._ensureArrayContent(s)}async updateItem(e){const t=this._ensureLayerAndUpdateSupport();if(!this.editingEnabled)return void this._logWarning("store:editing-disabled","Editing is disabled.");if(this.hasContingentValues){const t=e.updates.some(e=>this.fieldsWithContingentValues.has(e.fieldName)),r=this.itemHasPendingEdits(e.objectId);if(r||t){const t=this._layerWithContingentValues,i=this.getItemByObjectId(e.objectId)?.feature?.clone();if(i){const s=this._contingentValuesManager.getAllViolations(t,i);e.updates.forEach(({fieldName:e,value:r})=>{const s=t.getField(e);s&&(i.attributes[s.name]=r)});if(this._contingentValuesManager.validateContingencyConstraints(t,i).length||s.length||r)return this._stashPendingEdits(t,[e]),void this._contingentValuesManager.resetOptionsForLayer(t)}}}if(!this.autoSaveEnabled)return void this._stashPendingEdits(t,[e]);const{_sortedFieldNames:r}=this,i=e.updates.map(({fieldName:e})=>e);!(await this._update(t,e)).updateFeatureResults.find(e=>e.error)&&i.some(e=>r.includes(e))&&this._clearCaches()}async verifyFeaturesByObjectId(e){const{layer:t,state:r}=this;if(!t||"loaded"!==r)return[];const{objectIdField:i}=t,s=await this._queryFeaturesByObjectId(e);return e.map(e=>s.some(t=>{const r=t.getObjectId()??t.attributes[i];return e===r}))}_clearCaches(){this.pageCache.clear(),this._objectIdCache.removeAll()}_createBaseGraphic(e,r){const i=new t({attributes:{[e.objectIdField]:r}});return this._subtypeField&&null!=this._subtypeCode&&(i.attributes[this._subtypeField]=this._subtypeCode),i}_ensureArray(e){return Array.isArray(e)?e:[e]}_ensureArrayContent(e){return Array.isArray(e)?e[0]:e}_getObjectIdsForPage(e,t){const r=this._objectIdCache.toArray();return r.length>=e+t?r.slice(e,e+t):r.slice(e)}_logError(e,t){l.getLogger(this).error(e,t)}_logWarning(e,t,r=!1){r?l.getLogger(this).warnOnce(e,t):l.getLogger(this).warn(e,t)}_reset(){this._clearCaches(),this._pendingEditsCache.clear(),this.failures.removeAll(),this._attachmentsOperationQueue.removeAll(),this._editOperationQueue.removeAll(),this._queryOperationQueue.removeAll(),this.featureTitleMap.clear(),this._temporaryHighlight=u(this._temporaryHighlight?.handle),this._temporaryHighlightAbortController=d(this._temporaryHighlightAbortController),this._loading=!1,this._loaded=!1,this._loadError=!1,this._size=0}async _syncSize(e){0!==this.maxSize?this._size=e??await this._queryCount():this._size=0}async _syncObjectIdCache(){if(this.supportsPagination)return;const e=await this._queryObjectIds();this._objectIdCache.removeAll(),this._objectIdCache.addMany(e)}async _queryFeaturesByObjectId(e){const{layer:t}=this;if(!t||!this.supportsQuery)throw new a("store:query-error","Layer does not support query operation.");const{effectiveTimeExtent:r,effectiveWhere:i,orderByFields:s,supportsCacheHint:n,supportsOrderBy:o}=this,l=t.createQuery();l.where=i,l.timeExtent=r,l.returnGeometry=!1,l.objectIds=e.length?e:void 0,l.outFields=[t.objectIdField],o&&(l.orderByFields=s),n&&(l.cacheHint=!0);return(await t.queryFeatures(l)).features}async _syncTemporaryHighlight(e,t){const{highlightEnabled:r,highlightableLayerView:i}=this;i&&r&&null!=e&&(c(t),this._temporaryHighlight={id:e,handle:i.highlight(e,{name:S})})}_ensureLayerAndUpdateSupport(){const e=this._layerWithEditing;if(!this.supportsUpdate||!e)throw new a("store:update-error","Update is not supported.");return e}_stashPendingEdits(e,t){t.forEach(({objectId:t,updates:r})=>{const i=this.getItemByObjectId(t)?.feature;if(!i)throw new a("store:update-error","Feature with provided 'objectId' not found.");const s=i.clone(),n=h(this._pendingEditsCache,t,()=>({originalFeature:s,changes:new y}));r.forEach(({fieldName:t,value:r})=>{const s=e.getField(t);s?(n.changes.set(s.name,r),i.attributes[s.name]=r):this._logWarning("store:pending-edit-unknown-field","The provided field does not belong to this layer.")}),n.changes.size>0&&this._pendingEditsCache.set(t,n)})}_syncPendingEdits(){for(const[e,t]of this._pendingEditsCache){const r=this.getItemByObjectId(e)?.feature;if(r){const e=r.clone();for(const[i,s]of t.changes)r.attributes[i]=s;t.originalFeature=e}}}_getFeatureWithPendingEdits(e,t){let r=this.getItemByObjectId(e)?.feature;if(!r){r=t.originalFeature.clone();for(const[e,i]of t.changes)r.attributes[e]=i}return r}_discardPendingEdit({objectId:e,fieldName:t}){const r=this._pendingEditsCache.get(e);if(!r)return void this._logWarning("store:pending-edit-not-found","Could not find a pending edit with the given information");const i=this.getItemByObjectId(e);t?(i&&(i.feature.attributes[t]=r.originalFeature.attributes[t]),r.changes.delete(t),0===r.changes.size&&this._pendingEditsCache.delete(e)):(i&&(i.feature=r.originalFeature),this._pendingEditsCache.delete(e))}_clearOptionsAndViolations(){const{_layerWithContingentValues:e,_contingentValuesManager:t}=this;e&&(t.resetOptionsForLayer(e),t.resetViolationsForLayer(e))}async _update(e,r){const{objectId:i,updates:s}=r,n=this.getItemByObjectId(i)?.feature;if(!n)throw new a("store:update-error","Feature with provided 'objectId' not found.");const l=o(n.attributes);s.forEach(({fieldName:e,value:t})=>l[e]=t);const h=new t({attributes:l,sourceLayer:n.sourceLayer}),u=e.applyEdits({updateFeatures:[h]}).then(e=>{const{updateFeatureResults:t}=e,r=t.find(e=>!!e.error);if(r)throw r.error;return t.length&&(n.attributes=l,this.featureTitleMap.has(i)&&this.getFeatureTitle(i,!0)),e});return this._queueEditOperation(()=>u)}async _savePendingEdits(e){const{_layerWithEditing:t}=this;if(!this.supportsUpdate||!t)throw new a("store:update-error","Update is not supported.");const r=t.applyEdits({updateFeatures:e}).then(e=>{const{updateFeatureResults:t}=e,r=t.filter(e=>!!e.error);if(r.length)throw this.discardPendingEdits(),r[0].error;return e});return this._queueEditOperation(()=>r,!0)}_createFeatureStoreItems(e){const{attachments:t,features:r,layer:i,relatedRecords:s}=e,n=i.objectIdField;return r.map(e=>{const r=e.getObjectId()??e.attributes[n],a=[];e.layer||e.sourceLayer||(e.layer=i,e.sourceLayer=i);const o=this._pendingEditsCache.get(r);if(o){const t=e.clone(),r=o.changes;for(const[i,s]of r)e.attributes[i]=s;o.originalFeature=t}return s.forEach((e,t)=>{a.push({relationshipId:t,count:e[r]??0})}),{objectId:r,feature:e,attachments:t[r]??null,relatedRecords:a}})}async _query(e){const{page:t,refresh:r}=e;!0===r&&await this.refresh();const i=this.pageCache.get(t);if(i)return i;const s=await this._queryPage(e);return this.pageCache.set(t,s),s}_queryAttachments(e){const{_layerWithAttachments:t,effectiveWhere:r}=this;return t?e.some(e=>"number"!=typeof e)?Promise.reject(new a("invalid-object-id","Only numeric object ids are valid to query attachments")):t.queryAttachments(new O({objectIds:e,where:r,returnMetadata:!0})):Promise.resolve({})}async _queryCount(){const{_relatedLayerSupportsCacheHint:e,layer:t,relationshipConfig:r,supportsCacheHint:i}=this;if(!t)return 0;if(r&&this._canUseRelatedLayer){const{objectId:t,relatedLayer:i,relationshipId:s}=r;return(await i.queryRelatedFeaturesCount(new F({cacheHint:e,relationshipId:s,objectIds:[t]})))[t]??0}const{effectiveTimeExtent:s,effectiveWhere:n,filterGeometry:a,objectIds:o}=this,l=t.createQuery();return l.geometry=a,l.returnGeometry=!1,l.where=n,l.timeExtent=s,l.objectIds=o?.length?o:void 0,i&&(l.cacheHint=!0),t.queryFeatureCount(l)}async _queryFeatures(e){const{relationshipConfig:t}=this;if(t&&this._canUseRelatedLayer)return this._queryRelatedFeatures(e,t);const{_effectiveReturnM:r,_effectiveReturnZ:i,effectiveOutFields:s,effectiveTimeExtent:n,effectiveWhere:a,filterGeometry:o,objectIds:l,orderByFields:h,pageSize:u,returnGeometry:d,supportsCacheHint:p,supportsOrderBy:c,supportsPagination:y}=this,{layer:g,start:_}=e,m=l?.length,f=g.createQuery();f.returnGeometry=d,f.outFields=s,f.returnM=r,f.returnZ=i,y?(f.start=_,f.num=u,f.where=a,f.timeExtent=n,f.objectIds=m?l:void 0):f.objectIds=m?l:this._getObjectIdsForPage(_,u??0),c&&(f.orderByFields=h),o&&(f.geometry=o),p&&(f.cacheHint=!0);return(await g.queryFeatures(f)).features}_queryObjectIds(){const{effectiveTimeExtent:e,effectiveWhere:t,filterGeometry:r,layer:i,objectIds:s,orderByFields:n,supportsCacheHint:a,supportsOrderBy:o}=this;if(!i)return Promise.resolve([]);const l=i.createQuery();return l.geometry=r,l.outFields=[i.objectIdField],l.returnGeometry=!1,l.where=t,l.timeExtent=e,l.objectIds=s?.length?s:void 0,o&&(l.orderByFields=n),a&&(l.cacheHint=!0),i.queryObjectIds(l)}async _queryPage(e){const{layer:t}=e;return this._queueQueryOperation(async()=>{const r=await this._queryFeatures(e),i=r.map(e=>e.getObjectId()??e.attributes[t.objectIdField]),s=await this._queryAttachments(i),n=await this._queryRelatedCounts(i);return this._createFeatureStoreItems({layer:t,features:r,attachments:s,relatedRecords:n})||[]})}async _queryRelatedCounts(e){const{_layerWithRelationships:t,relationshipIds:r,supportsCacheHintQueryRelated:i}=this,s=new Map;return t&&e?.length&&r.length?(await Promise.allSettled(r.map(async r=>{const n=await t.queryRelatedFeaturesCount(new F({cacheHint:i,relationshipId:r,objectIds:e}));s.set(r,n)})),s):s}async _queryRelatedFeatures(e,t){const{_defaultOutFields:r,_effectiveReturnM:i,_effectiveReturnZ:s,orderByFields:n,pageSize:a,returnGeometry:o,supportsCacheHint:l}=this,{layer:h,start:u}=e,{objectId:d,relatedLayer:p,relationshipId:c}=t,y=h.createQuery(),g=new F({cacheHint:l,num:a,objectIds:[d],orderByFields:n,outFields:r,relationshipId:c,returnGeometry:o,returnM:i,returnZ:s,start:u,where:y.where??void 0}),_=await p.queryRelatedFeatures(g);return _[d]?.features||[]}_queueAttachmentsOperation(e,t){return this._attachmentsOperationQueue.push(t),t().then(async r=>{this._attachmentsOperationQueue.remove(t);const i=this._ensureArray(r),s=i.some(e=>e.error),n=this.getItemByObjectId(e);if(n&&(!s||i.length>1)){const t=await this._queryAttachments([e]);n.attachments=t[e]}return r}).catch(async r=>{this._logError("store:attachment-error","An error occurred.");const i={error:r,retry:()=>{this.failures.remove(i),this._queueAttachmentsOperation(e,t)},cancel:()=>this.failures.remove(i)};throw this.failures.add(i),this._attachmentsOperationQueue.remove(t),r})}_queueEditOperation(e,t=!1){return this._editOperationQueue.push(e),e().then(r=>(this._editOperationQueue.remove(e),t&&this._pendingEditsCache.clear(),r)).catch(t=>{this._logError("store:edit-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueEditOperation(e)},cancel:()=>this.failures.remove(r)};throw this.failures.add(r),this._editOperationQueue.remove(e),t})}_queueQueryOperation(e){return this._queryOperationQueue.push(e),e().then(t=>this._queryOperationQueue.includes(e)?t:[]).catch(t=>{this._logError("store:query-error","An error occurred.");const r={error:t,retry:()=>{this.failures.remove(r),this._queueQueryOperation(e)},cancel:()=>this.failures.remove(r)};return this.failures.add(r),[]}).then(t=>(this._queryOperationQueue.remove(e),t))}};e([b()],B.prototype,"_attachmentsOperationQueue",void 0),e([b({readOnly:!0})],B.prototype,"_capabilities",null),e([b()],B.prototype,"_canSavePendingEdits",null),e([b()],B.prototype,"_contingentValuesManager",void 0),e([b()],B.prototype,"_defaultOutFields",void 0),e([b()],B.prototype,"_editOperationQueue",void 0),e([b()],B.prototype,"_effectiveReturnZ",null),e([b()],B.prototype,"_effectiveReturnM",null),e([b()],B.prototype,"featureTitleMap",void 0),e([b({readOnly:!0})],B.prototype,"_layerWithAttachments",null),e([b({readOnly:!0})],B.prototype,"_layerWithAttachmentsEditing",null),e([b()],B.prototype,"_layerWithContingentValues",null),e([b({readOnly:!0})],B.prototype,"_layerWithEditing",null),e([b({readOnly:!0})],B.prototype,"_layerWithRelationships",null),e([b()],B.prototype,"_loaded",void 0),e([b()],B.prototype,"_loadError",void 0),e([b()],B.prototype,"_loading",void 0),e([b()],B.prototype,"_objectIdCache",void 0),e([b()],B.prototype,"_pendingEditsCache",void 0),e([b()],B.prototype,"_pendingEditsAreInvalid",null),e([b()],B.prototype,"_queryOperationQueue",void 0),e([b({readOnly:!0})],B.prototype,"_relatedLayer",null),e([b({readOnly:!0})],B.prototype,"_relatedLayerCapabilities",null),e([b({readOnly:!0})],B.prototype,"_relatedLayerSupportsCacheHint",null),e([b()],B.prototype,"_relatedLayerSupportsQuery",null),e([b()],B.prototype,"_relatedLayerSupportsQueryRelated",null),e([b()],B.prototype,"_size",void 0),e([b()],B.prototype,"_sortedFieldNames",null),e([b()],B.prototype,"_subtypeCode",null),e([b()],B.prototype,"_subtypeField",null),e([b()],B.prototype,"_canUseRelatedLayer",null),e([b()],B.prototype,"attachmentsEnabled",void 0),e([b()],B.prototype,"autoSaveEnabled",void 0),e([b()],B.prototype,"canAddRelatedFeature",null),e([b()],B.prototype,"defaultSelectionManager",void 0),e([b()],B.prototype,"editingEnabled",void 0),e([b()],B.prototype,"effectiveOutFields",null),e([b()],B.prototype,"effectiveSelectionManager",null),e([b()],B.prototype,"effectiveSize",null),e([b()],B.prototype,"effectiveTimeExtent",null),e([b()],B.prototype,"effectiveWhere",null),e([b({readOnly:!0})],B.prototype,"failures",void 0),e([b()],B.prototype,"fieldsWithContingentValues",null),e([b()],B.prototype,"filterByViewExtent",void 0),e([b({types:v})],B.prototype,"filterGeometry",void 0),e([b()],B.prototype,"hasContingentValues",null),e([b()],B.prototype,"hasInvalidPendingEdits",null),e([b()],B.prototype,"hasPendingEdits",null),e([b()],B.prototype,"highlightEnabled",void 0),e([b()],B.prototype,"highlightableLayerView",null),e([b()],B.prototype,"initialSize",void 0),e([b({readOnly:!0})],B.prototype,"isQuerying",null),e([b({readOnly:!0})],B.prototype,"isSyncing",null),e([b({readOnly:!0})],B.prototype,"isSyncingAttachmentEdits",null),e([b({readOnly:!0})],B.prototype,"isSyncingFeatureEdits",null),e([b({readOnly:!0})],B.prototype,"itemCache",null),e([b()],B.prototype,"layer",void 0),e([b()],B.prototype,"layerView",null),e([b()],B.prototype,"maxSize",void 0),e([b()],B.prototype,"objectIds",void 0),e([b()],B.prototype,"orderByFields",null),e([b()],B.prototype,"outFields",void 0),e([b({readOnly:!0})],B.prototype,"pageCache",void 0),e([b()],B.prototype,"pageCount",null),e([b()],B.prototype,"pageIndex",null),e([b()],B.prototype,"pageSize",void 0),e([b()],B.prototype,"paginationEnabled",void 0),e([b()],B.prototype,"pendingEditsCount",null),e([b()],B.prototype,"relationship",null),e([b()],B.prototype,"relationshipConfig",void 0),e([b()],B.prototype,"relationshipIds",null),e([b()],B.prototype,"relationshipInfos",null),e([b()],B.prototype,"relationships",null),e([b()],B.prototype,"relatedRecordsEnabled",void 0),e([b()],B.prototype,"returnGeometry",void 0),e([b()],B.prototype,"returnZ",void 0),e([b()],B.prototype,"returnM",void 0),e([b()],B.prototype,"selectionManager",void 0),e([b({readOnly:!0})],B.prototype,"size",null),e([b()],B.prototype,"sortOrders",void 0),e([b({readOnly:!0})],B.prototype,"state",null),e([b()],B.prototype,"supportsAdd",null),e([b()],B.prototype,"supportsAddAttachments",null),e([b()],B.prototype,"supportsAttachments",null),e([b()],B.prototype,"supportsCacheHint",null),e([b()],B.prototype,"supportsCacheHintQueryRelated",null),e([b()],B.prototype,"supportsDelete",null),e([b()],B.prototype,"supportsEditing",null),e([b()],B.prototype,"supportsM",null),e([b()],B.prototype,"supportsOrderBy",null),e([b()],B.prototype,"supportsPagination",null),e([b()],B.prototype,"supportsQuery",null),e([b()],B.prototype,"supportsQueryRelated",null),e([b()],B.prototype,"supportsResizeAttachments",null),e([b()],B.prototype,"supportsUpdate",null),e([b()],B.prototype,"supportsUpdateAttachments",null),e([b()],B.prototype,"supportsZ",null),e([b()],B.prototype,"syncViewSelection",void 0),e([b()],B.prototype,"temporaryHighlightId",void 0),e([b({type:A})],B.prototype,"timeExtent",void 0),e([b()],B.prototype,"timeZone",void 0),e([b()],B.prototype,"view",void 0),e([b()],B.prototype,"where",void 0),B=e([E("esri.widgets.FeatureTable.support.FeatureStore")],B);const x=B;export{x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{property as i,subclass as n}from"../../core/accessorSupport/decorators.js";import{isLayerFromCatalog as o,isCatalogSublayer as s}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as l,getActionStyles as a}from"../../support/actions/actionUtils.js";import r from"../Widget.js";import{getStatusIcon as c,listItemHasChildren as d,areChildrenHidden as p,canSortSublayers as m,getSingleAction as u,getItem as g,getVisibilityIcon as y}from"./support/layerListUtils.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{tsx as b}from"../support/widget.js";import{setFocus as v}from"../support/widgetUtils.js";var _;let I=class extends r{static{_=this}constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return h({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}static{this.vnodeSelector="calcite-list-item"}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:l,parent:a,css:r,dragDisabled:c}=this,d="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in l&&!i.visibleAtCurrentTimeExtent?`${t} (${l.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in l&&!i.visibleAtCurrentScale?`${t} (${l.layerInvisibleAtScale})`:t,p="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:m}=i,u="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return b("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":m?.id,dragDisabled:!i.sortable||p||c,expanded:"open"in i&&i.open,id:m?.uid,key:`list-item-${m?.uid}`,label:t,metadata:{parentTitles:e,_title:t},selected:"none"!==o&&s.includes(i),title:d,unavailable:u,value:m?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,a),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,l="connectionStatus"in e?e.connectionStatus:void 0,a=!!l;return o||s||a?b("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:a},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:a&&"connected"===l}),icon:c({connectionStatus:l,publishing:o}),key:"layer-item-status",scale:"s",slot:"content-end"}):null}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:n}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,l="temporaryTableIndicators"in t&&t.temporaryTableIndicators,a=n&&"persistenceEnabled"in n&&(o(n)||!n.persistenceEnabled);return(s||l)&&a?b("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{_title:e,item:i,parent:n,messages:o,visibilityAppearance:s,css:l}=this;if(!("visible"in i&&"layerVisibility"in o&&"showLayer"in o&&"hideLayer"in o&&"visibleToggle"in l&&s))return null;const{visible:a}=i,r=this._getParentVisibilityMode(n);if("inherited"===r)return null;const c=y({visible:a,exclusive:"exclusive"===r,visibilityAppearance:s}),d="checkbox"===s,p=o.layerVisibility,m=t(a?o.hideLayer:o.showLayer,{layerName:e});return b("calcite-action",{class:l.visibleToggle,icon:d?c:void 0,key:"visibility-toggle",label:m,onclick:()=>this._toggleVisibility(i,n),slot:d?"actions-start":"actions-end",text:p,title:m},d?null:b("calcite-icon",{class:this.classes({[l.visibleIcon]:"exclusive"!==r&&a}),icon:c,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:b("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return b("calcite-action",{active:t,disabled:n,icon:l(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return b("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},b("calcite-action",{icon:"ellipsis",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map(e=>b("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map(e=>this._renderAction({action:e,textEnabled:!0}))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&s(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?b("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&s(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?b("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?b("calcite-action",{disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("children"in t))return;const l=[...this.parentTitles??[],t.title],{children:a,layer:r}=t,c="catalog-dynamic-group"!==r?.type&&d(t),u=!n&&p(r),g="group"===r?.type,y=!u&&!c&&e&&g,h=!!e&&("childrenSortable"in t&&t.childrenSortable&&m(t));return c||y?b("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:h,group:g?i:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},a?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error)).toArray().map(e=>this._renderItem(e,t,l)),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?b("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,label:t.tables,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},b("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),b("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?b("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},b("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},b("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?b("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},b("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},b("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:u(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map(e=>e.filter(e=>e.visible))}get _actionsCount(){return this.item.actionsSections.reduce((e,t)=>e+t.length,0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:s,title:a,type:r,indicator:c}=i;return b("calcite-action",{active:"toggle"===r&&i.value,"data-action-id":i.id,disabled:s,icon:l(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),slot:n?void 0:"actions-end",text:a??"",textEnabled:n,title:a??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{icon:i}=e,n="className"in e?e.className:void 0;if(i)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!n,[t.itemActionImage]:!!o};return n&&(s[n]=!0),o||n?b("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderItem(e,t,i=[]){return b(_,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(v(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.expanded}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(g(e.target)!==t)return;const n=this._getParentVisibilityMode(i);"none"===this.selectionMode&&"inherited"!==n&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e||!("visible"in e))return;"exclusive"===this._getParentVisibilityMode(t)&&e.visible||(e.visible=!e.visible)}};e([i()],I.prototype,"activeItem",void 0),e([i()],I.prototype,"canMove",void 0),e([i()],I.prototype,"css",void 0),e([i()],I.prototype,"displayMode",void 0),e([i()],I.prototype,"dragEnabled",void 0),e([i()],I.prototype,"dragDisabled",void 0),e([i()],I.prototype,"item",void 0),e([i()],I.prototype,"layerTablesEnabled",void 0),e([i()],I.prototype,"listModeDisabled",void 0),e([i()],I.prototype,"messages",void 0),e([i()],I.prototype,"messagesCommon",void 0),e([i()],I.prototype,"onAction",void 0),e([i()],I.prototype,"onPanelOpen",void 0),e([i()],I.prototype,"onCatalogOpen",void 0),e([i()],I.prototype,"onTablesOpen",void 0),e([i()],I.prototype,"onSelectedDragItemLayerUidChange",void 0),e([i()],I.prototype,"onTooltipReferenceChange",void 0),e([i()],I.prototype,"parent",void 0),e([i()],I.prototype,"parentTitles",void 0),e([i()],I.prototype,"rootGroupUid",void 0),e([i()],I.prototype,"selectionMode",void 0),e([i()],I.prototype,"selectedItems",void 0),e([i()],I.prototype,"selectedDragItemLayerUid",void 0),e([i()],I.prototype,"visibleElements",void 0),e([i()],I.prototype,"visibilityAppearance",void 0),e([i()],I.prototype,"_title",null),e([i()],I.prototype,"_renderedItemStatus",null),e([i()],I.prototype,"_renderedItemTemporaryIcon",null),e([i()],I.prototype,"_renderedItemToggle",null),e([i()],I.prototype,"_renderedPanel",null),e([i()],I.prototype,"_renderedPanelAction",null),e([i()],I.prototype,"_renderedActions",null),e([i()],I.prototype,"_renderedActionMenu",null),e([i()],I.prototype,"_renderedActionMenuContent",null),e([i()],I.prototype,"_renderedCatalogFootprintIcon",null),e([i()],I.prototype,"_renderedCatalogDynamicIcon",null),e([i()],I.prototype,"_renderedCatalogSelectNode",null),e([i()],I.prototype,"_renderedChildList",null),e([i()],I.prototype,"_hasTables",null),e([i()],I.prototype,"_renderedTablesItem",null),e([i()],I.prototype,"_renderedItemMessage",null),e([i()],I.prototype,"_singleAction",null),e([i()],I.prototype,"_filteredSections",null),e([i()],I.prototype,"_actionsCount",null),I=_=e([n("esri.widgets.LayerList.LayerListItem")],I);const C=I;export{C as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../../intl.js";import{property as i,subclass as n}from"../../core/accessorSupport/decorators.js";import{isLayerFromCatalog as o,isCatalogSublayer as s}from"../../layers/catalog/catalogUtils.js";import{getActionIcon as l,getActionStyles as a}from"../../support/actions/actionUtils.js";import r from"../Widget.js";import{listItemHasChildren as c,areChildrenHidden as d,canSortSublayers as p,getSingleAction as m,getItem as u,getStatusIcon as g,getVisibilityIcon as y}from"./support/layerListUtils.js";import{loadCalciteComponents as h}from"../support/componentsUtils.js";import{tsx as b}from"../support/widget.js";import{setFocus as v}from"../support/widgetUtils.js";var _;let I=class extends r{static{_=this}constructor(e){super(e),this.dragEnabled=!1,this.listModeDisabled=!1,this.parent=null,this.parentTitles=null,this.viewModel=null,this._onActionMenuOpen=e=>{this.item.actionsOpen=e.currentTarget.open},this._setTooltipReference=e=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,e)},this._removeTooltipReference=()=>{this.onTooltipReferenceChange?.(this.item.layer?.uid,null)}}loadDependencies(){return h({"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice")})}static{this.vnodeSelector="calcite-list-item"}render(){const e=this.parentTitles??[],{_title:t,item:i,activeItem:n,selectionMode:o,selectedItems:s,messages:l,parent:a,css:r,dragDisabled:c}=this,d="visibleAtCurrentTimeExtent"in i&&"layerInvisibleAtTime"in l&&!i.visibleAtCurrentTimeExtent?`${t} (${l.layerInvisibleAtTime})`:"visibleAtCurrentScale"in i&&"layerInvisibleAtScale"in l&&!i.visibleAtCurrentScale?`${t} (${l.layerInvisibleAtScale})`:t,p="parent"in i&&"catalog"===i.parent?.layer?.type,{layer:m}=i,u="visibleAtCurrentScale"in i&&!i.visibleAtCurrentScale||"visibleAtCurrentTimeExtent"in i&&!i.visibleAtCurrentTimeExtent;return b("calcite-list-item",{afterCreate:e=>this._focusSelectedDragEl(e,i),afterUpdate:e=>this._focusSelectedDragEl(e,i),class:this.classes(r.item,"itemActive"in r&&{[r.itemActive]:n===i}),"data-item":i,"data-layer-id":m?.id,dragDisabled:!i.sortable||p||c,expanded:"open"in i&&i.open,id:m?.uid,key:`list-item-${m?.uid}`,label:t,metadata:{parentTitles:e,_title:t},selected:"none"!==o&&s.includes(i),title:d,unavailable:u,value:m?.uid,onCalciteListItemSelect:e=>"visible"in i&&this._handleCalciteListItemSelect(e,i,a),onCalciteListItemToggle:e=>"open"in i&&this._handleCalciteListItemToggle(e,i)},this._renderedCatalogFootprintIcon,this._renderedCatalogDynamicIcon,this._renderedItemStatus,this._renderedItemToggle,this._renderedCatalogSelectNode,this._renderedItemTemporaryIcon,this._renderedChildList,this._renderedItemMessage,this._renderedPanel,this._renderedPanelAction,this._renderedActions)}get _title(){const{messages:e}=this;return this.item.title||("untitledTable"in e?e.untitledTable:e.untitledLayer)}get _renderedItemStatus(){const{item:e,parent:t,visibleElements:i,css:n}=this;if(!i.statusIndicators)return null;const{publishing:o}=e,s="updating"in e&&e.updating&&!t,l="connectionStatus"in e?e.connectionStatus:void 0,a=!!l,r=o||s||a?g({connectionStatus:l,publishing:o}):"blank";return b("calcite-icon",{class:this.classes(n.statusIndicator,{[n.publishing]:o},"updating"in n&&{[n.updating]:s},"connectionStatus"in n&&{[n.connectionStatus]:a},"connectionStatusConnected"in n&&{[n.connectionStatusConnected]:a&&"connected"===l}),icon:r,key:"layer-item-status",scale:"s",slot:"content-end"})}get _renderedItemTemporaryIcon(){const{item:e,visibleElements:t,css:i}=this,{layer:n}=e,s="temporaryLayerIndicators"in t&&t.temporaryLayerIndicators,l="temporaryTableIndicators"in t&&t.temporaryTableIndicators,a=n&&"persistenceEnabled"in n&&(o(n)||!n.persistenceEnabled);return(s||l)&&a?b("calcite-icon",{class:i.itemTemporaryIcon,icon:"temporary",key:"temporary-icon",scale:"s",slot:"content-start",title:this.messages.temporary}):null}get _renderedItemToggle(){const{_title:e,item:i,parent:n,messages:o,visibilityAppearance:s,css:l}=this;if(!("visible"in i&&"layerVisibility"in o&&"showLayer"in o&&"hideLayer"in o&&"visibleToggle"in l&&s))return null;const{visible:a}=i,r=this._getParentVisibilityMode(n);if("inherited"===r)return null;const c=y({visible:a,exclusive:"exclusive"===r,visibilityAppearance:s}),d="checkbox"===s,p=o.layerVisibility,m=t(a?o.hideLayer:o.showLayer,{layerName:e});return b("calcite-action",{class:l.visibleToggle,icon:d?c:void 0,key:"visibility-toggle",label:m,onclick:()=>this._toggleVisibility(i,n),slot:d?"actions-start":"actions-end",text:p,title:m},d?null:b("calcite-icon",{class:this.classes({[l.visibleIcon]:"exclusive"!==r&&a}),icon:c,scale:"s"}))}get _renderedPanel(){const{panel:e}=this.item;return!e?.open||e.disabled||e.flowEnabled?null:b("div",{class:this.css.itemContentBottom,key:`content-panel-${e.uid}`,slot:"content-bottom"},e.render())}get _renderedPanelAction(){const{panel:e}=this.item;if(!e?.visible)return null;const{open:t,title:i,disabled:n}=e;return b("calcite-action",{active:t,disabled:n,icon:l(e),key:`action-${e.uid}`,onclick:()=>this._togglePanel(e),slot:"actions-end",text:i??"",title:i??void 0},this._renderFallbackIcon(e))}get _renderedActions(){switch(this._actionsCount){case 0:return null;case 1:return this._singleAction;default:return this._renderedActionMenu}}get _renderedActionMenu(){const{item:e,messagesCommon:t}=this,i=t.options;return b("calcite-action-menu",{appearance:"transparent",key:"item-action-menu",label:t.menu,open:e.actionsOpen,overlayPositioning:"fixed",placement:"bottom-end",slot:"actions-end",onCalciteActionMenuOpen:this._onActionMenuOpen},b("calcite-action",{icon:"ellipsis",slot:"trigger",text:i,title:i}),this._renderedActionMenuContent)}get _renderedActionMenuContent(){return this._filteredSections.toArray().map(e=>b("calcite-action-group",{key:`action-section-${e.uid}`},e.toArray().map(e=>this._renderAction({action:e,textEnabled:!0}))))}get _renderedCatalogFootprintIcon(){const{css:e}=this,t=this.item.layer,i="catalog-footprint"===t?.type,n="sublayer"===t?.type&&s(t,"footprints");return"itemCatalogIcon"in e&&(i||n)?b("calcite-icon",{class:e.itemCatalogIcon,icon:"footprint",key:"footprint",scale:"s",slot:"content-start"}):null}get _renderedCatalogDynamicIcon(){const{css:e}=this,t=this.item.layer,i="catalog-dynamic-group"===t?.type,n="sublayer"===t?.type&&s(t,"layers-in-view");return"itemCatalogIcon"in e&&(i||n)?b("calcite-icon",{class:e.itemCatalogIcon,icon:"catalog-dataset",key:"catalog-dataset",scale:"s",slot:"content-start"}):null}get _renderedCatalogSelectNode(){const{_title:e,item:t,visibleElements:i}=this;if(!("visible"in t))return;const{layer:n}=t,o="catalog-dynamic-group"===n?.type;return"catalogLayerList"in i&&i.catalogLayerList&&o?b("calcite-action",{disabled:!n.visible,icon:"chevron-right",iconFlipRtl:!0,onclick:()=>this._triggerOnCatalogOpen(t),slot:"actions-end",text:e}):null}get _renderedChildList(){const{dragEnabled:e,item:t,rootGroupUid:i,listModeDisabled:n,selectionMode:o,displayMode:s}=this;if(!("children"in t))return;const l=[...this.parentTitles??[],t.title],{children:a,layer:r}=t,m="catalog-dynamic-group"!==r?.type&&c(t),u=!n&&d(r),g="group"===r?.type,y=!u&&!m&&e&&g,h=!!e&&("childrenSortable"in t&&t.childrenSortable&&p(t));return m||y?b("calcite-list",{canPull:e=>!!this.canMove&&this.canMove(e,"pull"),canPut:e=>!!this.canMove&&this.canMove(e,"put"),"data-item":t,"data-layer-type":i,displayMode:s,dragEnabled:h,group:g?i:`${i}-${r?.uid}`,key:`child-list-${r?.uid}`,label:t.title,selectionAppearance:"border",selectionMode:o},a?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error)).toArray().map(e=>this._renderItem(e,t,l)),this._renderedTablesItem):null}get _hasTables(){const{layerTablesEnabled:e}=this,t=this.item.layer;if(!e||!t)return!1;switch(t.type){case"knowledge-graph":return e.includes(t.type)&&"tables"in t&&!!t.tables?.length;case"map-image":case"tile":return e.includes(t.type)&&"subtables"in t&&!!t.subtables?.length;default:return!1}}get _renderedTablesItem(){const{item:e,messages:t,css:i}=this,{layer:n}=e;return"itemTableIcon"in i&&"visible"in e&&"tables"in t&&this._hasTables?b("calcite-list-item",{class:i.item,"data-layer-id":n?.id,dragDisabled:!0,key:`list-item-table-list-tables-${n?.uid}`,label:t.tables,title:t.tables,onCalciteListItemSelect:()=>this._triggerOnTablesOpen(e)},b("calcite-icon",{class:i.itemTableIcon,icon:"table",scale:"s",slot:"content-start"}),b("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"})):null}get _renderedItemMessage(){const{item:e,messages:t,css:i}=this;return e.error?b("div",{class:i.itemMessage,key:"esri-layer-list__error",slot:"content-bottom"},b("calcite-notice",{icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",width:"full"},b("div",{slot:"message"},"tableError"in t?t.tableError:t.layerError))):"incompatible"in e&&e.incompatible&&"layerIncompatible"in t?b("div",{class:i.itemMessage,key:"esri-layer-list__incompatible",slot:"content-bottom"},b("calcite-notice",{afterCreate:this._setTooltipReference,afterRemoved:this._removeTooltipReference,bind:this,icon:"exclamation-mark-triangle",kind:"warning",open:!0,scale:"s",tabIndex:0,width:"full"},b("div",{slot:"message"},t.layerIncompatible))):null}get _singleAction(){return this._renderAction({action:m(this._filteredSections),textEnabled:!1})}get _filteredSections(){return this.item.actionsSections.map(e=>e.filter(e=>e.visible))}get _actionsCount(){return this.item.actionsSections.reduce((e,t)=>e+t.length,0)}_renderAction(e){const{item:t}=this,{action:i,textEnabled:n}=e;if(!i)return null;const{active:o,disabled:s,title:a,type:r,indicator:c}=i;return b("calcite-action",{active:"toggle"===r&&i.value,"data-action-id":i.id,disabled:s,icon:l(i),indicator:c,key:`action-${i.uid}`,loading:o,onclick:()=>this._triggerAction(t,i),slot:n?void 0:"actions-end",text:a??"",textEnabled:n,title:a??void 0},this._renderFallbackIcon(i))}_renderFallbackIcon(e){const{css:t}=this,{icon:i}=e,n="className"in e?e.className:void 0;if(i)return null;const o="image"in e?e.image:void 0,s={[t.itemActionIcon]:!!n,[t.itemActionImage]:!!o};return n&&(s[n]=!0),o||n?b("span",{"aria-hidden":"true",class:this.classes(t.itemActionIcon,s),key:"icon",styles:a(o)}):null}_renderItem(e,t,i=[]){return b(_,{activeItem:this.activeItem,canMove:this.canMove,css:this.css,displayMode:this.displayMode,dragEnabled:this.dragEnabled,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:i,rootGroupUid:this.rootGroupUid,selectedDragItemLayerUid:this.selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this.onAction,onCatalogOpen:this.onCatalogOpen,onPanelOpen:this.onPanelOpen,onSelectedDragItemLayerUidChange:this.onSelectedDragItemLayerUidChange,onTablesOpen:this.onTablesOpen,onTooltipReferenceChange:this.onTooltipReferenceChange})}_triggerAction(e,t){t&&e&&("toggle"===t.type&&(t.value=!t.value),this.onAction(t,e))}_triggerOnTablesOpen(e){e&&this.onTablesOpen&&this.onTablesOpen(e)}_triggerOnCatalogOpen(e){e&&this.onCatalogOpen?.(e)}_focusSelectedDragEl(e,t){this.selectedDragItemLayerUid===t.layer?.uid&&(v(e),this.onSelectedDragItemLayerUidChange?.(null))}_handleCalciteListItemToggle(e,t){e.stopPropagation(),t.open=e.target.expanded}_getParentVisibilityMode(e){return e&&"visibilityMode"in e?e.visibilityMode:null}_handleCalciteListItemSelect(e,t,i){if(u(e.target)!==t)return;const n=this._getParentVisibilityMode(i);"none"===this.selectionMode&&"inherited"!==n&&this._toggleVisibility(t,i)}_togglePanel(e){e.open=!e.open,e.open&&this.onPanelOpen()}_toggleVisibility(e,t){if(!e||!("visible"in e))return;"exclusive"===this._getParentVisibilityMode(t)&&e.visible||(e.visible=!e.visible)}};e([i()],I.prototype,"activeItem",void 0),e([i()],I.prototype,"canMove",void 0),e([i()],I.prototype,"css",void 0),e([i()],I.prototype,"displayMode",void 0),e([i()],I.prototype,"dragEnabled",void 0),e([i()],I.prototype,"dragDisabled",void 0),e([i()],I.prototype,"item",void 0),e([i()],I.prototype,"layerTablesEnabled",void 0),e([i()],I.prototype,"listModeDisabled",void 0),e([i()],I.prototype,"messages",void 0),e([i()],I.prototype,"messagesCommon",void 0),e([i()],I.prototype,"onAction",void 0),e([i()],I.prototype,"onPanelOpen",void 0),e([i()],I.prototype,"onCatalogOpen",void 0),e([i()],I.prototype,"onTablesOpen",void 0),e([i()],I.prototype,"onSelectedDragItemLayerUidChange",void 0),e([i()],I.prototype,"onTooltipReferenceChange",void 0),e([i()],I.prototype,"parent",void 0),e([i()],I.prototype,"parentTitles",void 0),e([i()],I.prototype,"rootGroupUid",void 0),e([i()],I.prototype,"selectionMode",void 0),e([i()],I.prototype,"selectedItems",void 0),e([i()],I.prototype,"selectedDragItemLayerUid",void 0),e([i()],I.prototype,"visibleElements",void 0),e([i()],I.prototype,"visibilityAppearance",void 0),e([i()],I.prototype,"_title",null),e([i()],I.prototype,"_renderedItemStatus",null),e([i()],I.prototype,"_renderedItemTemporaryIcon",null),e([i()],I.prototype,"_renderedItemToggle",null),e([i()],I.prototype,"_renderedPanel",null),e([i()],I.prototype,"_renderedPanelAction",null),e([i()],I.prototype,"_renderedActions",null),e([i()],I.prototype,"_renderedActionMenu",null),e([i()],I.prototype,"_renderedActionMenuContent",null),e([i()],I.prototype,"_renderedCatalogFootprintIcon",null),e([i()],I.prototype,"_renderedCatalogDynamicIcon",null),e([i()],I.prototype,"_renderedCatalogSelectNode",null),e([i()],I.prototype,"_renderedChildList",null),e([i()],I.prototype,"_hasTables",null),e([i()],I.prototype,"_renderedTablesItem",null),e([i()],I.prototype,"_renderedItemMessage",null),e([i()],I.prototype,"_singleAction",null),e([i()],I.prototype,"_filteredSections",null),e([i()],I.prototype,"_actionsCount",null),I=_=e([n("esri.widgets.LayerList.LayerListItem")],I);const C=I;export{C as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{css as e}from"../css.js";import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import{tsx as n}from"../../support/widget.js";function i(){return t({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")})}function
|
|
2
|
+
import{css as e}from"../css.js";import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import{tsx as n}from"../../support/widget.js";function i(){return t({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")})}function o(t){const{uiStrings:i,videoEnhancementToolActive:o,resetTools:s,onClose:a,brightness:l,constrast:r,handleBrightnessChange:m,handleContrastChange:p}=t,{reset:d,videoEnhancement:h}=i;return n("calcite-panel",{class:e.imageEnhancementWrapper,closable:!0,closed:!o,heading:h,key:h,onCalcitePanelClose:a},n("div",{class:e.imageEnhancementTools},c({title:i.brightness,value:l,handleChange:m}),c({title:i.contrast,value:r,handleChange:p})),n("calcite-action",{icon:"reset",onclick:s,slot:"header-actions-end",text:d}))}function c({title:t,tooltip:i,value:o,handleChange:c,max:s=10,min:a=0,ticks:l=2,step:r=1}){return n("div",{class:e.imageEnhancementToolContainer},n("calcite-label",{title:i},t,n("calcite-slider",{labelTicks:!0,max:s,min:a,step:r,ticks:l,title:i,value:o,onCalciteSliderInput:c})))}export{o as VideoEnhancementTools,i as loadVideoEnhancementComponents,c as renderEnhancementSlider};
|