@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,7 +1,9 @@
|
|
|
1
1
|
import type Graphic from "../../../Graphic.js";
|
|
2
2
|
import type Field from "../../../layers/support/Field.js";
|
|
3
|
+
import type BatchAttributeFormViewModel from "../BatchAttributeFormViewModel.js";
|
|
3
4
|
import type EditableInput from "./EditableInput.js";
|
|
4
5
|
import type GroupInput from "./GroupInput.js";
|
|
6
|
+
import type { Input } from "../../../form/elements/inputs.js";
|
|
5
7
|
import type { FieldValue } from "../../../layers/support/fieldUtils.js";
|
|
6
8
|
import type { DomainUnion as Domain } from "../../../layers/support/types.js";
|
|
7
9
|
import type { EditableInputProperties } from "./EditableInput.js";
|
|
@@ -9,6 +11,9 @@ import type { FieldInputDataTypes } from "../../support/forms/types.js";
|
|
|
9
11
|
|
|
10
12
|
export interface FieldInputProperties extends EditableInputProperties {}
|
|
11
13
|
|
|
14
|
+
/** Represents the current render state for inline multiple-choice "Other" controls. */
|
|
15
|
+
export interface MultipleChoiceOtherChoiceRenderState {}
|
|
16
|
+
|
|
12
17
|
/**
|
|
13
18
|
* This is a read-only support class that represents a [field element](https://developers.arcgis.com/javascript/latest/references/core/form/elements/FieldElement/) in a [BatchAttributeForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/).
|
|
14
19
|
*
|
|
@@ -18,6 +23,13 @@ export interface FieldInputProperties extends EditableInputProperties {}
|
|
|
18
23
|
* @see [BatchFormInputs](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/inputs/BatchFormInputs/)
|
|
19
24
|
*/
|
|
20
25
|
export default class FieldInput extends EditableInput<any> {
|
|
26
|
+
/**
|
|
27
|
+
* Clears stored inline other-choice state associated with a batch attribute form view model.
|
|
28
|
+
*
|
|
29
|
+
* @param viewModel - The view model whose inline other-choice state should be cleared.
|
|
30
|
+
* @param options - Additional options for clearing stored state. When `includeDraftValues` is `true`, clears stored draft values in addition to explicit checked state.
|
|
31
|
+
*/
|
|
32
|
+
static clearMultipleChoiceOtherChoiceStateForViewModel(viewModel: BatchAttributeFormViewModel | null, options?: { includeDraftValues?: boolean; }): void;
|
|
21
33
|
constructor(properties: FieldInputProperties);
|
|
22
34
|
/**
|
|
23
35
|
* The type of data displayed by the field input. Possible values are listed below.
|
|
@@ -56,6 +68,8 @@ export default class FieldInput extends EditableInput<any> {
|
|
|
56
68
|
* @default false
|
|
57
69
|
*/
|
|
58
70
|
get includeTimeOffset(): boolean;
|
|
71
|
+
/** The configured input for this field. */
|
|
72
|
+
get input(): Input | null | undefined;
|
|
59
73
|
/** An array of features that do not have a valid value for this field. */
|
|
60
74
|
get invalidFeatures(): Graphic[];
|
|
61
75
|
/** The input's label. */
|
|
@@ -76,9 +90,72 @@ export default class FieldInput extends EditableInput<any> {
|
|
|
76
90
|
get userHasChangedValue(): boolean;
|
|
77
91
|
/** Indicates whether the field has any validation errors. Evaluates to `true` only if the value of this field is valid for all features. */
|
|
78
92
|
get valid(): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Indicates whether a stored inline other-choice draft value can be restored.
|
|
95
|
+
*
|
|
96
|
+
* @param value - The draft value to evaluate.
|
|
97
|
+
* @returns `true` if the value can be restored; otherwise, `false`.
|
|
98
|
+
*/
|
|
99
|
+
canRestoreMultipleChoiceOtherChoiceDraftValue(value: FieldValue | undefined): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Returns the explicit inline other-choice checked state, if one has been stored.
|
|
102
|
+
*
|
|
103
|
+
* @returns The explicit checked state, or `undefined` if the state has not been set.
|
|
104
|
+
*/
|
|
105
|
+
getExplicitMultipleChoiceOtherChoiceCheckedState(): boolean | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Returns the checked state derived from the current other-choice values across all features.
|
|
108
|
+
*
|
|
109
|
+
* @returns The checked and indeterminate state for the inline other-choice checkbox.
|
|
110
|
+
*/
|
|
111
|
+
getMultipleChoiceOtherChoiceCheckboxState(): {
|
|
112
|
+
checked: boolean;
|
|
113
|
+
indeterminate: boolean;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Returns the stored inline other-choice draft value for a feature, if present.
|
|
117
|
+
*
|
|
118
|
+
* @param feature - The feature whose draft other-choice value should be returned.
|
|
119
|
+
* @returns The stored draft value, or `undefined` if no draft value exists for the feature.
|
|
120
|
+
*/
|
|
121
|
+
getMultipleChoiceOtherChoiceDraftValue(feature: object): FieldValue | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Returns the current render state for inline multiple-choice "Other" controls.
|
|
124
|
+
*
|
|
125
|
+
* @param otherOptionLabel - The fallback label to use when the input does not define a custom other-choice label.
|
|
126
|
+
* @returns The current render state for the inline other-choice controls.
|
|
127
|
+
*/
|
|
128
|
+
getMultipleChoiceOtherChoiceRenderState(otherOptionLabel: string): MultipleChoiceOtherChoiceRenderState;
|
|
129
|
+
/**
|
|
130
|
+
* Indicates whether an explicit inline other-choice checked state has been stored.
|
|
131
|
+
*
|
|
132
|
+
* @returns `true` if an explicit checked state has been stored; otherwise, `false`.
|
|
133
|
+
*/
|
|
134
|
+
hasExplicitMultipleChoiceOtherChoiceCheckedState(): boolean;
|
|
135
|
+
/** Initializes the explicit inline other-choice checked state from the current feature values when it has not been set yet. */
|
|
136
|
+
initializeExplicitMultipleChoiceOtherChoiceCheckedState(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Stores the explicit inline other-choice checked state.
|
|
139
|
+
*
|
|
140
|
+
* @param isChecked - Indicates whether the inline other-choice checkbox is checked.
|
|
141
|
+
*/
|
|
142
|
+
setExplicitMultipleChoiceOtherChoiceCheckedState(isChecked: boolean): void;
|
|
143
|
+
/**
|
|
144
|
+
* Stores inline other-choice draft values from the current other-choice field values on the provided features.
|
|
145
|
+
*
|
|
146
|
+
* @param features - The features from which to read current other-choice field values.
|
|
147
|
+
*/
|
|
148
|
+
setMultipleChoiceOtherChoiceDraftValuesFromFeatures(features: Pick<Graphic, "getAttribute">[]): void;
|
|
79
149
|
/**
|
|
80
150
|
* @param value
|
|
81
151
|
* @internal
|
|
82
152
|
*/
|
|
83
153
|
setValueFromUser(value: FieldValue): Promise<void>;
|
|
154
|
+
/**
|
|
155
|
+
* Stores the same inline other-choice draft value for the provided features.
|
|
156
|
+
*
|
|
157
|
+
* @param features - The features whose draft other-choice values should be updated.
|
|
158
|
+
* @param value - The draft value to store for each feature.
|
|
159
|
+
*/
|
|
160
|
+
stashMultipleChoiceOtherChoiceDraftValueForFeatures(features: object[], value: FieldValue): void;
|
|
84
161
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{property as i,subclass as r}from"../../../core/accessorSupport/decorators.js";import n from"../../../layers/support/CodedValue.js";import a from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as l,dateTimeFieldValuesToNumericRange as s,isDomainValidForField as o}from"../../../layers/support/domainUtils.js";import{isNumericField as u,isStringField as m,isTimeOnlyField as p,getFieldRange as d,isDateOnlyField as f,isTimestampOffsetField as h}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as c}from"../../../layers/support/layerUtils.js";import y from"../../../layers/support/RangeDomain.js";import{isAnyDateField as g}from"../../../smartMapping/support/utils.js";import{isNumber as b}from"../../../support/guards.js";import x from"./EditableInput.js";import{visibilityCodeToBoolean as v,isFieldInputWithShowNoValueOptionInput as V,differentValuesString as _}from"./support/inputUtils.js";import{getMaxLength as F,getMinLength as w,isEmptyValue as E,dateIsValid as M,validateFormValue as D}from"../../support/forms/formUtils.js";let T=class extends x{constructor(e){super(e),this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){const{field:e}=this;return u(e)?"number":m(e)?"text":g(e)||p(e)?"date":"unsupported"}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const e=this.template;if(null!=e.label&&""!==e.label)return e.label;const{field:t,layers:i}=this;if(1===i.length){const e=i[0];if(c(e)){const i=e.getFieldAlias(t.name);if(null!=i&&""!==i)return i}}return t.alias||t.name}get effectiveVisible(){return v(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>i.getAttribute(e)===t)}get field(){return this.template.field}get fieldName(){return this.field.name}get invalidFeatures(){return this.errors.map(e=>e.feature)}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this.template;return!this.required&&(!V(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this.template;return V(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.template.input;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return F({dataType:this.dataType,field:this.field,input:this.template.input})}get minLength(){return w({dataType:this.dataType,field:this.field,input:this.template.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=l(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?d(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){return(!this.required||!this.distinctValues.some(e=>E(e)))&&!!this.valid}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:_}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const e=this.codedValueDomainOptions,{value:t}=this,i=null==t||t===_||e.some(e=>e.value===t)?[]:[{name:`${t}`,value:t}];return[e,i]}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const r of this.features){if(null==i.getExpressionExecutorsForLayer(r.layer)?.requiredExpression)continue;t=!1;const n=this._lookupEvaluatedExpression(r,"required");"success"===n?.status?e=e||!0===n.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const e=this.template.input;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=s(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:r}=e;i={max:null!=t&&M(t)?t.getTime():null,min:null!=r&&M(r)?r.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:r}=this;if("date"!==this.dataType)return{};if(!r)return this._fieldShouldHaveDomain?{}:e;const n=l(i,r);if(!n)return e;const{max:a,min:s,rawMax:o,rawMin:u}=e,{type:m}=t.field;if("date"===m){const{max:e,min:t}=n;return{max:b(a)&&(null===e||null!=e&&a<=e)?a:e??null,min:b(s)&&(null===t||null!=t&&s>=t)?s:t??null}}if("date-only"===m||"time-only"===m||"timestamp-offset"===m){const{max:e,min:t,rawMax:i,rawMin:r}=n,l=b(a)&&o&&(null==e||a<e),m=b(s)&&u&&(null==t||s>t);return{max:l?a:e,min:m?s:t,rawMax:l?o:i,rawMin:m?u:r}}return{}}async setValueFromUser(e){this.userHasChangedValue=!0;const t=[],i=this.fieldName;for(const r of this.features)r.getAttribute(i)!==e&&t.push(r);this._setValue(e),await this.expressionsManager.valueChanged(i,t)}_setValue(e){const{fieldName:t}=this;for(const i of this.features)i.setAttribute(t,e)}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:r,range:n}=this,a=[],l="multiple-choice"===this.template.input?.type?this.template.input:null;for(const s of this.features){const{layer:o}=s,u=o.getField(t)??this.field,m=o.getFieldDomain(t,{feature:s.plainGraphic}),p=this.calculateDomain([m]),d=this._requiredForFeature(s),f=s.getAttribute(t),h=D(f,{dataType:e,domain:p,field:u,maxLength:i,minLength:r,multipleChoice:l,range:n,required:d});h&&a.push({error:h,feature:s.source})}return a}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&o(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let r=null;switch(t?.type){case"range":r=this._intersectRangeDomains(e);break;case"coded-value":r=this._intersectCodedValueDomains(e)}return r}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const n of e)for(const[e,i]of t){n.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let r=t;if(i){r=new Map;for(const[e,n]of i)t.has(e)&&r.set(e,n)}const l=Array.from(r.entries()).map(([e,t])=>new n({code:e,name:t}));return l.length?new a({codedValues:l}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let r=1;r<e.length;r++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[r])}if(t&&!o(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof y){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:r}=this;return f(r)||p(r)||h(r)?s(r,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new y,r=this._getMinMaxFromRangeDomain(e),n=this._getMinMaxFromRangeDomain(t),{field:a}=this,l=this._getValidRangeValue(r.min,-1/0),s=this._getValidRangeValue(r.max,1/0),o=this._getValidRangeValue(n.min,-1/0),u=this._getValidRangeValue(n.max,1/0);return i.minValue=Math.max(l,o),i.maxValue=Math.min(s,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((f(a)||p(a)||h(a))&&(i.minValue=Number(r.min)>Number(n.min)?r.rawMin:n.rawMin,i.maxValue=Number(r.max)<Number(n.max)?r.rawMax:n.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return b(e)?e:t}};e([i()],T.prototype,"dataType",null),e([i()],T.prototype,"domain",null),e([i()],T.prototype,"distinctValues",null),e([i()],T.prototype,"editable",null),e([i()],T.prototype,"label",null),e([i()],T.prototype,"effectiveVisible",null),e([i()],T.prototype,"effectiveVisibilityCode",null),e([i()],T.prototype,"errors",null),e([i()],T.prototype,"featuresHaveSameValue",null),e([i()],T.prototype,"field",null),e([i()],T.prototype,"fieldName",null),e([i()],T.prototype,"group",void 0),e([i()],T.prototype,"invalidFeatures",null),e([i()],T.prototype,"isSubtypeField",null),e([i()],T.prototype,"showNoValueOptionEnabled",null),e([i()],T.prototype,"showNoValueLabel",null),e([i()],T.prototype,"includeTime",null),e([i()],T.prototype,"includeTimeOffset",null),e([i()],T.prototype,"maxLength",null),e([i()],T.prototype,"minLength",null),e([i()],T.prototype,"range",null),e([i()],T.prototype,"required",null),e([i()],T.prototype,"submittable",null),e([i({readOnly:!0})],T.prototype,"type",void 0),e([i()],T.prototype,"userHasChangedValue",void 0),e([i()],T.prototype,"valid",null),e([i()],T.prototype,"value",null),e([i()],T.prototype,"visibilityCode",null),e([i()],T.prototype,"_evaluatedRequiredExpression",null),e([i()],T.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([i()],T.prototype,"_allDomains",null),e([i()],T.prototype,"_fieldShouldHaveDomain",null),e([i()],T.prototype,"_dateFormRange",null),e([i()],T.prototype,"_dateRange",null),T=e([r("esri.widgets.BatchAttributeForm.inputs.FieldInput")],T);const N=T;export{N as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{property as i,subclass as l}from"../../../core/accessorSupport/decorators.js";import{isMultipleChoiceInput as r}from"../../../form/elements/inputs/inputUtils.js";import o from"../../../layers/support/CodedValue.js";import n from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as s,dateTimeFieldValuesToNumericRange as a,isDomainValidForField as u}from"../../../layers/support/domainUtils.js";import{isNumericField as h,isStringField as p,isTimeOnlyField as c,getFieldRange as m,isDateOnlyField as d,isTimestampOffsetField as f}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as C}from"../../../layers/support/layerUtils.js";import g from"../../../layers/support/RangeDomain.js";import{isAnyDateField as y}from"../../../smartMapping/support/utils.js";import{isNumber as b}from"../../../support/guards.js";import x from"./EditableInput.js";import{visibilityCodeToBoolean as v,differentValuesString as V,isFieldInputWithShowNoValueOptionInput as M}from"./support/inputUtils.js";import{isEmptyValue as _,getMaxLength as O,getMinLength as F,dateIsValid as S,validateFormValue as w}from"../../support/forms/formUtils.js";const E="esri_BatchAttributeForm_other_choice_checked",D=new WeakMap;let k=class extends x{constructor(e){super(e),this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){const{field:e}=this;return h(e)?"number":p(e)?"text":y(e)||c(e)?"date":"unsupported"}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const e=this.template;if(null!=e.label&&""!==e.label)return e.label;const{field:t,layers:i}=this;if(1===i.length){const e=i[0];if(C(e)){const i=e.getFieldAlias(t.name);if(null!=i&&""!==i)return i}}return t.alias||t.name}get effectiveVisible(){return v(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>i.getAttribute(e)===t)}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get multipleChoiceInput(){const{input:e}=this;return e&&r(e)?e:null}get multipleChoiceChoices(){const{multipleChoiceInput:e}=this;if(!e)return null;const t=[],i=new Set;for(const l of e.choices){const{value:e}=l;i.has(e)||(i.add(e),t.push(l))}return t}get multipleChoiceValues(){return this.multipleChoiceChoices?.map(e=>e.value)??null}get multipleChoiceOtherChoiceFieldName(){return this.multipleChoiceInput?.otherChoice?.fieldName??null}get multipleChoiceOtherChoiceHint(){return this.multipleChoiceInput?.otherChoice?.hint??""}get multipleChoiceOtherChoiceLabel(){return this.multipleChoiceInput?.otherChoice?.label??null}get hasMultipleChoiceOtherChoiceField(){const{multipleChoiceOtherChoiceFieldName:e}=this;return!!e&&this.layers.every(t=>null!=t.getField(e))}get shouldShowMultipleChoiceOtherChoice(){return null!=this.multipleChoiceInput?.otherChoice&&this.hasMultipleChoiceOtherChoiceField}set shouldShowMultipleChoiceOtherChoice(e){this._overrideIfSome("shouldShowMultipleChoiceOtherChoice",e)}get multipleChoiceOtherChoiceValue(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return null;const t=this.features.map(t=>t.getAttribute(e));if(0===t.length)return null;const[i]=t;return t.every(e=>e===i)?i:V}get multipleChoiceOtherChoiceMaxLength(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return;let t;for(const i of this.layers){const l=i.getField(e)?.length;null==l||l<0||(t=null==t?l:Math.min(t,l))}return t}getMultipleChoiceOtherChoiceRenderState(e){const t=this.multipleChoiceOtherChoiceFieldName??void 0,i=this.shouldShowMultipleChoiceOtherChoice,l=this.multipleChoiceOtherChoiceValue,r=i?this.getMultipleChoiceOtherChoiceCheckboxState():{checked:!1,indeterminate:!1},o=i?this.getExplicitMultipleChoiceOtherChoiceCheckedState():void 0,n=void 0===o?r:{checked:o,indeterminate:!1};return{fieldName:t,hint:this.multipleChoiceOtherChoiceHint,label:this.multipleChoiceOtherChoiceLabel??e,shouldShow:i,checkboxState:n,value:l,normalizedValue:l===E?"":l,maxLength:this.multipleChoiceOtherChoiceMaxLength}}getMultipleChoiceOtherChoiceCheckboxState(){const e=this.multipleChoiceOtherChoiceFieldName;if(!e)return{checked:!1,indeterminate:!1};const t=this.features.map(t=>t.getAttribute(e));return{checked:t.length>0&&t.every(e=>!_(e)),indeterminate:t.some(e=>!_(e))&&t.some(e=>_(e))}}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){this.hasExplicitMultipleChoiceOtherChoiceCheckedState()||this.setExplicitMultipleChoiceOtherChoiceCheckedState(this.getMultipleChoiceOtherChoiceCheckboxState().checked)}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return void 0!==this.getExplicitMultipleChoiceOtherChoiceCheckedState()}getExplicitMultipleChoiceOtherChoiceCheckedState(){const e=this._multipleChoiceOtherChoiceStateKey;if(e)return this._multipleChoiceOtherChoiceCheckedStateStore.get(e)}setExplicitMultipleChoiceOtherChoiceCheckedState(e){const t=this._multipleChoiceOtherChoiceStateKey;t&&this._multipleChoiceOtherChoiceCheckedStateStore.set(t,e)}stashMultipleChoiceOtherChoiceDraftValueForFeatures(e,t){const i=this._multipleChoiceOtherChoiceStateKey;if(i)for(const l of e)l.stashAttribute(i,t)}setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e){const t=this._multipleChoiceOtherChoiceStateKey,i=this.multipleChoiceOtherChoiceFieldName;if(t&&i)for(const l of e)l.stashAttribute(t,l.getAttribute(i))}getMultipleChoiceOtherChoiceDraftValue(e){const t=this._multipleChoiceOtherChoiceStateKey;if(t)return e.getStashedAttribute(t)}canRestoreMultipleChoiceOtherChoiceDraftValue(e){return!(null==e||""===e||e===E||e===V)}static clearMultipleChoiceOtherChoiceStateForViewModel(e,t={}){const{includeDraftValues:i=!1}=t;if(!e)return;const l=new Set;for(const r of e.sharedForm.allFieldInputs)l.add(r.expressionsManager);for(const r of e.activeForm.allFieldInputs)l.add(r.expressionsManager);for(const r of l)D.get(r)?.clear();if(i){const t=new Set;for(const i of e.sharedForm.allFieldInputs)for(const e of i.features)t.add(e);for(const e of t)e.clearStashedAttributes()}}get invalidFeatures(){return this.errors.map(e=>e.feature)}get _multipleChoiceOtherChoiceStateKey(){const e=this.multipleChoiceOtherChoiceFieldName;return e?`${this.template.elementId}:${e}`:null}get _multipleChoiceOtherChoiceCheckedStateStore(){const e=this.expressionsManager;if(!e)return new Map;let t=D.get(e);return t||(t=new Map,D.set(e,t)),t}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this;return!this.required&&(!M(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return M(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const{input:e}=this;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return O({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return F({dataType:this.dataType,field:this.field,input:this.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=s(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?m(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){return(!this.required||!this.distinctValues.some(e=>_(e)))&&!!this.valid}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:V}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const e=this.codedValueDomainOptions,{value:t}=this,i=null==t||t===V||e.some(e=>e.value===t)?[]:[{name:`${t}`,value:t}];return[e,i]}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const l of this.features){if(null==i.getExpressionExecutorsForLayer(l.layer)?.requiredExpression)continue;t=!1;const r=this._lookupEvaluatedExpression(l,"required");"success"===r?.status?e=e||!0===r.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const{input:e}=this;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=a(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:l}=e;i={max:null!=t&&S(t)?t.getTime():null,min:null!=l&&S(l)?l.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:l}=this;if("date"!==this.dataType)return{};if(!l)return this._fieldShouldHaveDomain?{}:e;const r=s(i,l);if(!r)return e;const{max:o,min:n,rawMax:a,rawMin:u}=e,{type:h}=t.field;if("date"===h){const{max:e,min:t}=r;return{max:b(o)&&(null===e||null!=e&&o<=e)?o:e??null,min:b(n)&&(null===t||null!=t&&n>=t)?n:t??null}}if("date-only"===h||"time-only"===h||"timestamp-offset"===h){const{max:e,min:t,rawMax:i,rawMin:l}=r,s=b(o)&&a&&(null==e||o<e),h=b(n)&&u&&(null==t||n>t);return{max:s?o:e,min:h?n:t,rawMax:s?a:i,rawMin:h?u:l}}return{}}async setValueFromUser(e){this.userHasChangedValue=!0;const t=[],i=this.fieldName;for(const l of this.features)l.getAttribute(i)!==e&&t.push(l);this._setValue(e),await this.expressionsManager.valueChanged(i,t)}_setValue(e){const{fieldName:t}=this;for(const i of this.features)i.setAttribute(t,e)}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:l,range:r}=this,o=[],{multipleChoiceInput:n}=this;for(const s of this.features){const{layer:a}=s,u=a.getField(t)??this.field,h=a.getFieldDomain(t,{feature:s.plainGraphic}),p=this.calculateDomain([h]),c=this._requiredForFeature(s),m=s.getAttribute(t),d=w(m,{dataType:e,domain:p,field:u,maxLength:i,minLength:l,multipleChoice:n,range:r,required:c});d&&o.push({error:d,feature:s.source})}return o}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&u(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let l=null;switch(t?.type){case"range":l=this._intersectRangeDomains(e);break;case"coded-value":l=this._intersectCodedValueDomains(e)}return l}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const o of e)for(const[e,i]of t){o.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let l=t;if(i){l=new Map;for(const[e,r]of i)t.has(e)&&l.set(e,r)}const r=Array.from(l.entries()).map(([e,t])=>new o({code:e,name:t}));return r.length?new n({codedValues:r}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let l=1;l<e.length;l++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[l])}if(t&&!u(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof g){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:l}=this;return d(l)||c(l)||f(l)?a(l,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new g,l=this._getMinMaxFromRangeDomain(e),r=this._getMinMaxFromRangeDomain(t),{field:o}=this,n=this._getValidRangeValue(l.min,-1/0),s=this._getValidRangeValue(l.max,1/0),a=this._getValidRangeValue(r.min,-1/0),u=this._getValidRangeValue(r.max,1/0);return i.minValue=Math.max(n,a),i.maxValue=Math.min(s,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((d(o)||c(o)||f(o))&&(i.minValue=Number(l.min)>Number(r.min)?l.rawMin:r.rawMin,i.maxValue=Number(l.max)<Number(r.max)?l.rawMax:r.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return b(e)?e:t}};e([i()],k.prototype,"dataType",null),e([i()],k.prototype,"domain",null),e([i()],k.prototype,"distinctValues",null),e([i()],k.prototype,"editable",null),e([i()],k.prototype,"label",null),e([i()],k.prototype,"effectiveVisible",null),e([i()],k.prototype,"effectiveVisibilityCode",null),e([i()],k.prototype,"errors",null),e([i()],k.prototype,"featuresHaveSameValue",null),e([i()],k.prototype,"field",null),e([i()],k.prototype,"fieldName",null),e([i()],k.prototype,"group",void 0),e([i()],k.prototype,"input",null),e([i()],k.prototype,"multipleChoiceInput",null),e([i()],k.prototype,"multipleChoiceChoices",null),e([i()],k.prototype,"multipleChoiceValues",null),e([i()],k.prototype,"multipleChoiceOtherChoiceFieldName",null),e([i()],k.prototype,"multipleChoiceOtherChoiceHint",null),e([i()],k.prototype,"multipleChoiceOtherChoiceLabel",null),e([i()],k.prototype,"hasMultipleChoiceOtherChoiceField",null),e([i()],k.prototype,"shouldShowMultipleChoiceOtherChoice",null),e([i()],k.prototype,"multipleChoiceOtherChoiceValue",null),e([i()],k.prototype,"multipleChoiceOtherChoiceMaxLength",null),e([i()],k.prototype,"invalidFeatures",null),e([i()],k.prototype,"_multipleChoiceOtherChoiceCheckedStateStore",null),e([i()],k.prototype,"isSubtypeField",null),e([i()],k.prototype,"showNoValueOptionEnabled",null),e([i()],k.prototype,"showNoValueLabel",null),e([i()],k.prototype,"includeTime",null),e([i()],k.prototype,"includeTimeOffset",null),e([i()],k.prototype,"maxLength",null),e([i()],k.prototype,"minLength",null),e([i()],k.prototype,"range",null),e([i()],k.prototype,"required",null),e([i()],k.prototype,"submittable",null),e([i({readOnly:!0})],k.prototype,"type",void 0),e([i()],k.prototype,"userHasChangedValue",void 0),e([i()],k.prototype,"valid",null),e([i()],k.prototype,"value",null),e([i()],k.prototype,"visibilityCode",null),e([i()],k.prototype,"_evaluatedRequiredExpression",null),e([i()],k.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([i()],k.prototype,"_allDomains",null),e([i()],k.prototype,"_fieldShouldHaveDomain",null),e([i()],k.prototype,"_dateFormRange",null),e([i()],k.prototype,"_dateRange",null),k=e([l("esri.widgets.BatchAttributeForm.inputs.FieldInput")],k);const N=k;export{N as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import r from"./EditableInput.js";import s from"./SingleFeatureInputAdapter.js";let i=class extends r{constructor(t){super(t),this.group=null,this.single=new s({input:this}),this.type="utilityNetworkAssociations"}get associationTypes(){return this.template.associationTypes}get feature(){return this.single.feature}get layer(){return this.single.layer}};t([e()],i.prototype,"associationTypes",null),t([e()],i.prototype,"feature",null),t([e()],i.prototype,"group",void 0),t([e()],i.prototype,"layer",null),t([e({readOnly:!0})],i.prototype,"single",void 0),t([e({readOnly:!0})],i.prototype,"type",void 0),i=t([o("esri.widgets.BatchAttributeForm.inputs.UtilityNetworkAssociationsElementInput")],i);const p=i;export{p as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import r from"./EditableInput.js";import s from"./SingleFeatureInputAdapter.js";let i=class extends r{constructor(t){super(t),this.group=null,this.map=null,this.single=new s({input:this}),this.type="utilityNetworkAssociations"}get associationTypes(){return this.template.associationTypes}get feature(){return this.single.feature}get layer(){return this.single.layer}};t([e()],i.prototype,"associationTypes",null),t([e()],i.prototype,"feature",null),t([e()],i.prototype,"group",void 0),t([e()],i.prototype,"layer",null),t([e()],i.prototype,"map",void 0),t([e({readOnly:!0})],i.prototype,"single",void 0),t([e({readOnly:!0})],i.prototype,"type",void 0),i=t([o("esri.widgets.BatchAttributeForm.inputs.UtilityNetworkAssociationsElementInput")],i);const p=i;export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import t from"../AttachmentElementInput.js";import
|
|
2
|
+
import e from"../../../../core/Error.js";import t from"../AttachmentElementInput.js";import s from"../BatchFormInputs.js";import r from"../FieldInput.js";import n from"../GroupInput.js";import o from"../RelationshipElementInput.js";import a from"../TextElementInput.js";import i from"../UtilityNetworkAssociationsElementInput.js";import{isFieldElementTemplate as p,isGroupElementTemplate as l,isRelationshipElementTemplate as m,isTextElementTemplate as u,isAttachmentElementTemplate as f,isUtilityNetworkAssociationsElementTemplate as c}from"../../templates/support/templateUtils.js";function h(e,t){const r=new s({inputs:e.elements.map(e=>I(e,t)),template:e});return x(r),r}function x(e){const t=e.allFieldInputs,s=new Set(t.map(e=>e.fieldName));for(const r of t){const e=r.multipleChoiceOtherChoiceFieldName;if(!e)continue;const t=r.layers[0]?.getField(e)?.name??e;s.has(t)&&(r.shouldShowMultipleChoiceOtherChoice=!1)}}function I(s,h){const{allFeatures:x,expressionsManager:w,map:y}=h,d=new Set(s.layers),g=x.filter(e=>d.has(e.layer)),j=g.length===x.length;if(p(s))return new r({existsInAllLayers:j,features:g,template:s,expressionsManager:w});if(l(s)){const e=s.elements.map(e=>I(e,h));return new n({existsInAllLayers:j,features:g,inputs:e,template:s,expressionsManager:w})}if(m(s))return new o({existsInAllLayers:j,features:g,template:s,expressionsManager:w});if(u(s))return new a({existsInAllLayers:j,features:g,template:s,expressionsManager:w});if(f(s))return new t({existsInAllLayers:j,features:g,template:s,expressionsManager:w});if(c(s))return new i({existsInAllLayers:j,features:g,template:s,expressionsManager:w,map:y});throw new e("batch-attribute-form:unsupported-element-template","The type of form element template provided is not supported")}export{h as createBatchFormInputsFromBatchFormTemplate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const t="esri_BatchAttributeForm_different_values";function n(
|
|
2
|
+
import{isEmptyValue as e}from"../../../support/forms/formUtils.js";const t="esri_BatchAttributeForm_different_values";function n(e){return"visible"===e}function i(e){return"field"===e.type}function r(e){return i(e)&&"multiple-choice"===e.input?.type}function c(e){return"group"===e.type}function u(e){return"relationship"===e.type}function o(e){return"text"===e.type}function l(e){return"attachment"===e.type}function s(e){return i(e)||l(e)||u(e)||f(e)}function f(e){return"utilityNetworkAssociations"===e.type}function h(e){const t=`${e.elementId}:${e.executorPurpose}`;return null!=e.textExpressionIndex?`${t}:${e.textExpressionIndex}`:t}function a(e,t){if(null==e||""===e)return[];const n=String(e);if(!t){const e=n.trim();return""===e?[]:[e]}return n.split(t).map(e=>e.trim()).filter(e=>""!==e)}function d({input:e,choiceValue:n,currentValue:i,isChecked:r}){const{multipleChoiceInput:c,multipleChoiceValues:u}=e;if(!c||!u)return i;const{choiceDelimiter:o}=c,l=new Set(u),s=a(i,o).filter(e=>e!==t&&l.has(e)),f=s.includes(n);if(!r){const e=f?s.filter(e=>e!==n):s;return e.length>0?e.join(o):null}return f||!l.has(n)?s.length>0?s.join(o):null:[...s,n].join(o)}function m({input:e,choiceValue:t}){const n=e.multipleChoiceInput?.choiceDelimiter,i=e.multipleChoiceValues;if(null==n||!i)return{checked:!1,indeterminate:!1};const r=e.features.length;if(!r)return{checked:!1,indeterminate:!1};let c=0;const u=new Set(i);for(const o of e.features){a(o.getAttribute(e.fieldName),n).filter(e=>u.has(e)).includes(t)&&(c+=1)}return c===r?{checked:!0,indeterminate:!1}:0===c?{checked:!1,indeterminate:!1}:{checked:!1,indeterminate:!0}}function p({input:e}){const t=e.multipleChoiceInput?.choiceDelimiter,n=e.multipleChoiceValues;if(null==t||!n)return{checked:!1,indeterminate:!1};if(0===n.length)return{checked:!1,indeterminate:!1};let i=!0,r=!1;for(const c of n){const t=m({input:e,choiceValue:c});(t.checked||t.indeterminate)&&(r=!0),t.checked||(i=!1)}return{checked:i,indeterminate:!i&&r}}function k({input:t,otherChoiceFieldName:n}){const i=t.features.length;if(!i)return{checked:!1,indeterminate:!1};const r=t.features.toArray().filter(t=>!e(t.getAttribute(n))).length;return 0===r?{checked:!1,indeterminate:!1}:r===i?{checked:!0,indeterminate:!1}:{checked:!1,indeterminate:!0}}const g=e=>null!=e&&(x(e,"combo-box")||x(e,"radio-buttons"));function x(e,t){return e?.type===t}export{t as differentValuesString,m as getMultipleChoiceCheckboxState,k as getMultipleChoiceOtherChoiceState,p as getMultipleChoiceSelectAllState,d as getUpdatedMultipleChoiceValueForFeature,l as isAttachmentElementInput,s as isEditableInput,i as isFieldInput,g as isFieldInputWithShowNoValueOptionInput,c as isGroupInput,x as isInputWithInputType,r as isMultipleChoiceFieldInput,u as isRelationshipElementInput,o as isTextElementInput,f as isUtilityNetworkAssociationsElementInput,h as makeUseId,a as splitMultipleChoiceValue,n as visibilityCodeToBoolean};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
function e(e){const{messages:n,onclick:o}=e;return[{appearance:"solid",kind:"brand",message:n.footerButtons.add,onclick:o??(()=>{})}]}function n(e){const{callback:n,formId:o,messages:s}=e;return[{appearance:"solid",form:o,kind:"brand",message:s.footerButtons.update,onclick:()=>n()}]}function o(e){const{messages:n}=e;return[{appearance:"outline",icon:"trash",kind:"danger",message:n.footerButtons.discard,onclick:()=>{}}]}function s(e){const{messages:n}=e;return[{appearance:"solid",kind:"brand",message:n.footerButtons.replace,onclick:()=>{}}]}function t(e){const{messages:n}=e;return[{appearance:"outline",icon:"reset",kind:"brand",message:n.footerButtons.reset,onclick:()=>{}}]}function a(e){const{messages:n}=e;return[{appearance:"outline",kind:"brand",message:n.footerButtons.done,onclick:()=>{}},{appearance:"outline",icon:"attachment",kind:"danger",message:n.footerButtons.delete,onclick:()=>{}}]}export{e as makeAddAttachmentFooterButtons,n as makeDefaultFooterButtons,o as makeDiscardAttachmentFooterButtons,s as makeReplaceAttachmentFooterButtons,t as makeResetAttachmentFooterButtons,a as makeViewingAttachmentFooterButtons};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import r from"../../../../core/Error.js";import n from"../../../../core/Logger.js";import{getEffectiveFieldAlias as o}from"../../../../editing/fieldUtils.js";import i from"../../../../form/ExpressionInfo.js";import{isAttachmentElement as
|
|
2
|
+
import{createArcadeProfile as e,createArcadeExecutor as t}from"../../../../arcade.js";import r from"../../../../core/Error.js";import n from"../../../../core/Logger.js";import{getEffectiveFieldAlias as o}from"../../../../editing/fieldUtils.js";import i from"../../../../form/ExpressionInfo.js";import{isMultipleChoiceInput as s}from"../../../../form/elements/inputs/inputUtils.js";import{isAttachmentElement as a,isFieldElement as l,isGroupElement as m,isRelationshipElement as d,isTextElement as p,isUtilityNetworkAssociationsElement as c}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as f,isFieldVisibleByDefault as u}from"../../../../layers/support/fieldUtils.js";import{isSubtypeSublayer as x,isSubtypeGroupLayer as y}from"../../../../layers/support/layerUtils.js";import{isNumber as w}from"../../../../support/guards.js";import{unknown as h}from"../../../../time/constants.js";import{makeExpressionInfosMap as E,makeExecutorSetForFormElement as b}from"../../expressions/expressionUtils.js";import{AttachmentElementTemplate as T}from"../AttachmentElementTemplate.js";import I from"../BatchFormTemplate.js";import{FieldElementTemplate as v}from"../FieldElementTemplate.js";import{GroupElementTemplate as g}from"../GroupElementTemplate.js";import{RelationshipElementTemplate as j}from"../RelationshipElementTemplate.js";import{TextElementTemplate as F}from"../TextElementTemplate.js";import{UtilityNetworkAssociationsElementTemplate as C}from"../UtilityNetworkAssociationsElementTemplate.js";import{compileTextElementMarkdownToHTML as P}from"./textElementTemplateUtils.js";const L="expression/dea57012-47ca4b55a000-8df62742ed0c",A=e("form-attachment-filename-calculation"),U=()=>n.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function Z(e,t,r=e.formTemplate){return r?.elements&&r.elements.length>0?B(r,e,t):N(e,t)}async function N(e,{arcadeExecutorProvider:t,formTimeZone:r}){const n=new Set(f(e)),o={arcadeExecutorProvider:t,formTimeZone:r,layer:e},i=[];for(const a of e.fields)G(a,e,n)&&i.push(O(a,o));const s=await Promise.all(i);return new I({elements:s,preserveFieldValuesWhenHidden:!0})}function k(e,t){for(const r of e??[])if("group"!==r.type){if("field"===r.type){if(!1===r.editable&&!r.editableExpression)return!0;if(t.subtypeField&&(x(t)||y(t))&&r.fieldName?.toLowerCase()===t.subtypeField.toLowerCase())return!0}}else if(k(r.elements??[],t))return!0;return!1}async function B(e,t,r){let n=null;k(e.elements??[],t)&&(n=new i({title:"",name:L,expression:"false"}));const o=E(n?[...e.expressionInfos??[],n]:e.expressionInfos),s={description:e.description,elements:new Array,title:e.title,preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,supportsAttachmentElements:e.supportsAttachmentElements},{elements:a}=e;if(!a)return new I(s);const{arcadeExecutorProvider:l,formTimeZone:m}=r;for(const i of a){const e=await R(i,{arcadeExecutorProvider:l,expressionInfos:o,layer:t,formTimeZone:m});e&&s.elements.push(e)}return e.supportsAttachmentElements,new I(s)}async function H(e,{arcadeExecutorProvider:r,expressionInfos:n,layer:o}){const i=n.get(e.filenameExpression),s=i?await t(i.expression,A):null,a=new T({allowUserRename:e.allowUserRename,attachmentKeyword:e.attachmentKeyword,description:e.description,displayFilename:e.displayFilename,filenameExpressionExecutor:s,input:e.input,label:e.label,maxAttachmentCount:e.maxAttachmentCount,minAttachmentCount:e.minAttachmentCount,useOriginalFilename:e.useOriginalFilename}),l=await b({element:e,expressionInfos:n,provider:r});return a.addLayer(o,l),a}async function R(e,t){return a(e)?H(e,{arcadeExecutorProvider:t.arcadeExecutorProvider,expressionInfos:t.expressionInfos,layer:t.layer}):l(e)?S(e,t):m(e)?V(e,t):d(e)?W(e,t):p(e)?z(e,t):c(e)?K(e,t):null}async function S(e,{arcadeExecutorProvider:t,expressionInfos:n,layer:o,formTimeZone:i}){const{fieldsIndex:a}=o,{description:l,domain:m,fieldName:d,hint:p,input:c,label:f}=e;if(null==d||!a.has(d))return U().warn(new r("batch-attribute-form:invalid-form-element-field",`Field element with label '${f}' does not refer to a valid field`)),null;if(!1!==e.editable||e.editableExpression||((e=e.clone()).editableExpression=L),o.subtypeField&&(x(o)||y(o))&&e.fieldName?.toLowerCase()===o.subtypeField.toLowerCase()&&((e=e.clone()).editableExpression=L),c&&s(c)&&c.otherChoice){const e=c.otherChoice.fieldName,t=a.get(e);t&&t.name!==e&&(c.otherChoice=c.otherChoice.clone(),c.otherChoice.fieldName=t.name)}const u=new v({description:l,domain:m,field:a.get(d),hint:p,input:c,formTimeZone:i,layerTimeZone:$(o),label:f}),w=await b({element:e,expressionInfos:n,provider:t});return u.addLayer(o,w),u}async function V(e,t){const{arcadeExecutorProvider:r,expressionInfos:n,layer:o}=t,{description:i,label:s,initialState:a}=e,l=[];for(const p of e.elements){const e=await R(p,t);e&&l.push(e)}const m=new g({description:i,elements:l,label:s,initialState:a??"expanded"}),d=await b({element:e,expressionInfos:n,provider:r});return m.addLayer(o,d),m}async function W(e,t){const{description:r,label:n,displayCount:o,displayType:i,orderByFields:s,relationshipId:a}=e,{arcadeExecutorProvider:l,expressionInfos:m,layer:d}=t,p=new j({description:r,...w(o)&&{displayCount:o},displayType:i,label:n,orderByFields:s,relationshipId:a}),c=await b({element:e,expressionInfos:m,provider:l});return p.addLayer(d,c),p}async function z(e,{arcadeExecutorProvider:t,expressionInfos:r,layer:n}){const{description:o,label:i,text:s,textFormat:a}=e,{fieldsIndex:l}=n,m=s&&"markdown"===a?await P(s):s,d=new F({compiledText:m,description:o,fieldsIndex:l,label:i}),p=await b({element:e,expressionInfos:r,provider:t}),{expressionParts:c}=d;if(c.length){const e=await Promise.all(c.map(e=>{const n=r.get(e)?.expression??e;return t.getArcadeExecutor(n)}));p.textExpressions=e}return d.addLayer(n,p),d}async function K(e,t){const{associationTypes:r,description:n,label:o}=e,{arcadeExecutorProvider:i,expressionInfos:s,layer:a}=t,l=new C({associationTypes:r,description:n,label:o}),m=await b({element:e,expressionInfos:s,provider:i});return l.addLayer(a,m),l}async function O(e,{arcadeExecutorProvider:t,layer:r,formTimeZone:n}){const i=o(e,r)||e.name,s=new v({field:e,label:i,formTimeZone:n,layerTimeZone:$(r)}),a={},l=(y(r)||x(r))&&r.subtypeField&&r.subtypeField.toLowerCase()===e.name.toLowerCase();return!l&&e.editable&&r.userHasUpdateItemPrivileges&&(a.editableExpression=await t.getArcadeExecutor("true")),l&&(a.editableExpression=await t.getArcadeExecutor("false")),s.addLayer(r,a),s}function G(e,t,r){return!r.has(e.name.toLowerCase())&&u(e,t)}function $(e){return x(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?h:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}export{Z as createBatchFormTemplate,N as createBatchFormTemplateFromFields};
|
|
@@ -161,7 +161,7 @@ export interface AttachmentsChangeEvent {
|
|
|
161
161
|
*
|
|
162
162
|
* @since 5.1
|
|
163
163
|
*/
|
|
164
|
-
export interface
|
|
164
|
+
export interface SelectedAttachmentIdentifier {}
|
|
165
165
|
|
|
166
166
|
/** @since 5.0 */
|
|
167
167
|
export interface ValueChangeEvent {
|
|
@@ -209,4 +209,32 @@ export interface AttributeFormSupportedLayerInfo {
|
|
|
209
209
|
* @since 5.0
|
|
210
210
|
*/
|
|
211
211
|
formTemplate?: FormTemplate;
|
|
212
|
-
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Configuration information needed to render buttons in the BatchAttributeForm footer.
|
|
216
|
+
*
|
|
217
|
+
* @internal
|
|
218
|
+
*/
|
|
219
|
+
export interface FooterButtonInfo {}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Configuration information needed to render a notice in the BatchAttributeForm footer.
|
|
223
|
+
*
|
|
224
|
+
* @internal
|
|
225
|
+
*/
|
|
226
|
+
export interface FooterNoticeInfo {}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Valid types of pages that can be displayed by the Batch Attribute Form.
|
|
230
|
+
*
|
|
231
|
+
* @internal
|
|
232
|
+
*/
|
|
233
|
+
export type Page = "default" | "viewing-attachments" | "viewing-attachment-details" | "adding-attachments" | "viewing-associated-layers" | "viewing-associated-features";
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Configuration information about a selected attachment. Used to display details about the attachment.
|
|
237
|
+
*
|
|
238
|
+
* @internal
|
|
239
|
+
*/
|
|
240
|
+
export interface SelectedAttachmentDetails {}
|
|
@@ -7,7 +7,7 @@ import type VisibleElements from "./BatchAttributeForm/VisibleElements.js";
|
|
|
7
7
|
import type { Icon } from "@esri/calcite-components/components/calcite-icon";
|
|
8
8
|
import type { WidgetProperties } from "./Widget.js";
|
|
9
9
|
import type { BatchAttributeFormViewModelEvents, BatchAttributeFormViewModelProperties } from "./BatchAttributeForm/BatchAttributeFormViewModel.js";
|
|
10
|
-
import type { AttributeFormSupportedLayerInfo } from "./BatchAttributeForm/types.js";
|
|
10
|
+
import type { AttributeFormSupportedLayerInfo, FooterButtonInfo, FooterNoticeInfo, Page, SelectedAttachmentDetails, SelectedAttachmentIdentifier } from "./BatchAttributeForm/types.js";
|
|
11
11
|
import type { HeadingLevel } from "./support/types.js";
|
|
12
12
|
import type { VisibleElementsProperties } from "./BatchAttributeForm/VisibleElements.js";
|
|
13
13
|
|
|
@@ -95,6 +95,19 @@ export default class BatchAttributeForm extends Widget<BatchAttributeFormPropert
|
|
|
95
95
|
* @default false
|
|
96
96
|
*/
|
|
97
97
|
accessor disabled: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Indicates the component is currently in a disabled state, accounting for when the
|
|
100
|
+
* viewModel is in the process of updating.
|
|
101
|
+
*
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
get effectiveDisabled(): boolean;
|
|
105
|
+
/**
|
|
106
|
+
* The title that should be displayed for the current page.
|
|
107
|
+
*
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
get effectiveTitle(): string;
|
|
98
111
|
/**
|
|
99
112
|
* The collection of features whose attributes are being edited.
|
|
100
113
|
*
|
|
@@ -110,6 +123,21 @@ export default class BatchAttributeForm extends Widget<BatchAttributeFormPropert
|
|
|
110
123
|
* });
|
|
111
124
|
*/
|
|
112
125
|
accessor features: Collection<Graphic>;
|
|
126
|
+
/**
|
|
127
|
+
* Configuration information about buttons displayed in the footer.
|
|
128
|
+
* This can be used to replicate button behavior in an external panel (e.g. Editor).
|
|
129
|
+
*
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
get footerButtonInfos(): FooterButtonInfo[];
|
|
133
|
+
/**
|
|
134
|
+
* Configuration information about notices displayed in the footer. Only a single notice can be displayed at a time.
|
|
135
|
+
* If more than one notice is generated, only the latest notice in this array will be displayed.
|
|
136
|
+
* This can be used to replicate notice behavior in an external panel (e.g. Editor).
|
|
137
|
+
*
|
|
138
|
+
* @internal
|
|
139
|
+
*/
|
|
140
|
+
get footerNoticeInfos(): FooterNoticeInfo[];
|
|
113
141
|
/**
|
|
114
142
|
* Defines how groups will be displayed to the user.
|
|
115
143
|
*
|
|
@@ -183,12 +211,22 @@ export default class BatchAttributeForm extends Widget<BatchAttributeFormPropert
|
|
|
183
211
|
* > This property is required if working with [Arcade expressions](https://developers.arcgis.com/javascript/latest/arcade/) in the `BatchAttributeForm` that make use of the `$map` global variable.
|
|
184
212
|
*/
|
|
185
213
|
accessor map: EsriMap | null | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* The 'page' the form is currently rendering. This is only relevant when nested views are required.
|
|
216
|
+
*
|
|
217
|
+
* @internal
|
|
218
|
+
*/
|
|
219
|
+
get page(): Page;
|
|
186
220
|
/**
|
|
187
221
|
* Indicates whether the form is in a read-only state. If `true`, values cannot be modified.
|
|
188
222
|
*
|
|
189
223
|
* @default false
|
|
190
224
|
*/
|
|
191
225
|
accessor readOnly: boolean;
|
|
226
|
+
/** @internal */
|
|
227
|
+
get selectedAttachment(): SelectedAttachmentIdentifier | null;
|
|
228
|
+
/** @internal */
|
|
229
|
+
get selectedAttachmentDetails(): SelectedAttachmentDetails | null;
|
|
192
230
|
/**
|
|
193
231
|
* The time zone used to interpret date values in the form. If this property is `null` or set to `"unknown"`, date values are displayed in the time zone specified by the layer's [FeatureLayer.preferredTimeZone](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#preferredTimeZone). If none is provided there, date values are interpreted in UTC.
|
|
194
232
|
*
|
|
@@ -209,6 +247,19 @@ export default class BatchAttributeForm extends Widget<BatchAttributeFormPropert
|
|
|
209
247
|
/** Defines which elements are visible in the widget. */
|
|
210
248
|
get visibleElements(): VisibleElements;
|
|
211
249
|
set visibleElements(value: VisibleElementsProperties);
|
|
250
|
+
/**
|
|
251
|
+
* Method for navigating back from nested pages. If there are no nested pages, this method does nothing.
|
|
252
|
+
* NOTE: Method is async for future proofing.
|
|
253
|
+
*
|
|
254
|
+
* @internal
|
|
255
|
+
*/
|
|
256
|
+
goBack(): Promise<void>;
|
|
257
|
+
/**
|
|
258
|
+
* Reset all nested views. This is similar to calling 'back()' until there are no more nested views.
|
|
259
|
+
*
|
|
260
|
+
* @internal
|
|
261
|
+
*/
|
|
262
|
+
goHome(): Promise<void>;
|
|
212
263
|
/** Focus the form on the first input element with an error. */
|
|
213
264
|
goToFirstError(): void;
|
|
214
265
|
/**
|
|
@@ -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{deprecateWidget as i}from"../core/deprecate.js";import n from"../core/Logger.js";import{getOrCreateMapValue as a}from"../core/MapUtils.js";import{watch as s,on as o}from"../core/reactiveUtils.js";import{formatFileSize as l}from"../core/unitFormatUtils.js";import{property as r,subclass as c}from"../core/accessorSupport/decorators.js";import{isIntegerField as m}from"../layers/support/fieldUtils.js";import{isString as d}from"../support/guards.js";import p from"./Widget.js";import{getAttachmentTypeCategory as u,getCalciteIconForAttachment as h}from"./Attachments/support/attachmentUtils.js";import{getAttachmentKey as v,getAttachmentUrl as b,isImageAttachment as f}from"./BatchAttributeForm/attachmentUtils.js";import{getHiddenFieldsValidationErrorMessage as g,getVisibleFieldInputValidationErrorMessage as _,isElementTemplateWithInputType as C}from"./BatchAttributeForm/batchAttributeFormUtils.js";import y from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as I}from"./BatchAttributeForm/css.js";import F from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as w,isFieldInput as x,isTextElementInput as k,isRelationshipElementInput as M,isAttachmentElementInput as D,isUtilityNetworkAssociationsElementInput as E,differentValuesString as T}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{downloadAttachmentInfo as A}from"./FeatureTable/support/exportUtils.js";import{loadCalciteComponents as O}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as V,getIntlOptionsForField as L,prepareISOFieldValueForDateComponents as S,prepareUnixFieldValueForDateComponents as U,normalizeTimeOnlyString as R,getISOFieldValueFromDateComponents as P,getUnixFieldValueFromDateComponents as $}from"./support/dateUtils.js";import{globalCss as N}from"./support/globalCss.js";import{messageBundle as B,vmEvent as j,tsx as z}from"./support/widget.js";import{setFocus as Z}from"./support/widgetUtils.js";import{isEmptyValue as H}from"./support/forms/formUtils.js";const G="data-element-id";let q=class extends p{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.messagesUnits=null,this.viewModel=new y,this.visibleElements=new F,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._attachmentDialogInfo=null,this._maximizeSelectedAttachment=()=>{this._attachmentDialogInfo=this._selectedAttachmentDetails},this._closeAttachmentDialog=()=>{this._attachmentDialogInfo=null},this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{i(n.getLogger(this),"Editor","arcgis-editor",{version:"5.0"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...i}=e;return i}initialize(){this.addHandles([s(()=>this.features,()=>{this._dateComponentMap.clear(),this._resetTransientFormState()}),s(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear(),this._resetTransientFormState()}),o(()=>this.viewModel,"submit",()=>{this.valid||this.goToFirstError()})])}loadDependencies(){return O({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get valid(){return this.viewModel.valid}goToFirstError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._focusedFieldInput=e.input,this._attemptFocusOnNextRender=!0,this.scheduleRender()}render(){const{status:e}=this.viewModel;return"failed"===e?this.viewModel.hasTooManyComplexFeatures?this._renderErrorNotice(t(this.messages.formFailedToLoadTooManyComplexFeatures,{num:this.viewModel.maximumFeatureCountWithComplexForms})):this.viewModel.hasTooManyFeatures?this._renderErrorNotice(t(this.messages.formFailedToLoadTooManyFeatures,{num:this.viewModel.maximumFeatureCount})):this._renderErrorNotice(this.messages.formFailedToLoad):this.viewModel.expressionEvaluationFailed?this._renderErrorNotice(this.messages.expressionEvaluationFailed):this.viewModel.hasLayersWithContingentValues?this._renderErrorNotice(this.messages.unsupportedContingentValues):z("div",{class:this.classes(I.base,N.widget,N.panel)},"loaded"===e?this._renderForm():"loading"===e&&this.visibleElements.loadingIndicator?z("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null,this._renderAttachmentDialog())}submit(){this.viewModel.submit()}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:i}=e.dataset,n=a(this._dateComponentMap,`${i}`,()=>({}));switch(t){case"date":n.date=e;break;case"time":n.time=e;break;case"timeZone":n.timeZone=e}}_renderErrorNotice(e){return z("div",{class:this.classes(I.base,N.widget,N.panel)},z("calcite-notice",{class:I.noticeError,icon:!0,kind:"warning",open:!0},z("div",{slot:"message"},e)))}_renderForm(){const e=this._selectedAttachmentDetails;return z("form",{class:I.form,onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),e?this._renderAttachmentDetailPanelContent(e):this._renderContent())}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let n;if(!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(n=g(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter(e=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);e.length>0?n+=` (${e.map(e=>e.label).join(", ")})`:n=null}else n+=` (${i.invalidHiddenInputs.map(e=>e.label).join(", ")})`;else if(t)return null;return n?z("calcite-notice",{class:I.noticeError,icon:!0,kind:"danger",open:!0},z("div",{slot:"message"},n)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[z("calcite-notice",{class:I.noticeError,icon:!0,kind:"warning",open:!0},z("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return w(e)?this._renderGroupInput(e):x(e)?this._renderLabeledField(e):k(e)?this._renderTextComponent(e):M(e)?this._renderRelationshipElementInput(e):D(e)?this._renderAttachmentElementInput(e):E(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:n}=e,a=t.filter(e=>e.visible),s=i.label??"";return z("calcite-block",{class:this.classes(I.group,"sequential"===this.groupDisplay?I.groupSequential:null,this.disabled?I.inputDisabled:null),collapsible:!0,description:i.description??void 0,disabled:this._effectiveDisabled,expanded:n,heading:s,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:s,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},a.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:i}=e.template,{label:n,required:a,dataType:s}=e,o=a?t(this.messages.requiredFieldLabel,{name:n}):n;return z("calcite-label",{"aria-label":o,class:I.label,key:`field--${i}`},z("div",{class:I.labelTextContent,key:"labelTextContainer"},n,a?z("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==s?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e;return"date"===i?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):"number"===i?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:i,submittable:n}=e,a=!n&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?_(e,t,this.messages):null;return a?z("calcite-input-message",{icon:!0,status:"invalid"},a):i?z("calcite-input-message",{class:I.description,icon:!1,status:"idle"},i):null}_renderCodedInputs({input:e,props:t}){const i=e.template.input?.type??null,n=e.codedValueOptions;switch(i){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:n.flat(),props:t});default:return this._renderComboBoxComponent({options:n,props:t,input:e})}}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===T||e.value===T)&&"batch"===this.viewModel.mode){const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[G]:t[G]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:i,options:[{name:this.messages.differentValuesPlaceholder,value:T,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return z("calcite-switch",{...t,checked:!!C(e.template,"switch")&&e.value===e.template.input.onValue,class:I.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:n,dropdown:a,group:s}=i;return z("calcite-dropdown",{...a,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,topLayerDisabled:this.topLayerDisabled,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},z("calcite-button",{...n},e===T?this.messages.differentValuesPlaceholder:e),z("calcite-dropdown-group",{selectionMode:s.mode},t.map(t=>z("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:i}){const n="INSERT"===this.viewModel.editType,a=this._touchedInputs.has(e?.template?.elementId),s=n&&e.showNoValueOptionEnabled&&!a?()=>{}:i.onblur,o={...i,onblur:s};return z("calcite-combobox",{...o,selectionMode:"single",topLayerDisabled:this.topLayerDisabled,value:i.placeholder===this.messages.differentValuesPlaceholder?T:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==T&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:i}))}renderComboboxOptionsList({input:e,options:t,props:i}){const[n,a]=t.map(e=>e.map(({name:e,value:t})=>z("calcite-combobox-item",{heading:e,key:`#${t}`,selected:i.value===t,value:`${t}`}))),s=[...n];a.length>0&&s.push(z("calcite-combobox-item-group",{key:"unsupported",label:this.messages.unsupportedDomainGroupTitle},a));const o=i.placeholder===this.messages.differentValuesPlaceholder,l=!o&&H(i.value);return e.showNoValueOptionEnabled&&s.unshift(z("calcite-combobox-item",{heading:e.showNoValueLabel||this.messages.empty,key:"empty-option",selected:l,value:""})),o&&s.unshift(z("calcite-combobox-item",{heading:this.messages.differentValuesPlaceholder,key:T,selected:!0,value:T})),s}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const n=t.map(({name:t,value:n})=>this._renderRadioButtons({label:t,value:n,selected:n===e.value,props:i}));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,s=H(e.value);n.unshift(this._renderRadioButtons({label:a,value:t,selected:s,props:i}))}return z("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:I.inputRadioGroup,disabled:i.readOnly,key:`${i.key}-radio-group`,layout:"vertical",name:i.name,required:i.required},n,i.placeholder===this.messages.differentValuesPlaceholder?z("calcite-label",{class:I.placeholderRadio,key:i.label,layout:"inline"},z("calcite-radio-button",{checked:!0,class:I.inputRadio,disabled:!0,name:i.placeholder,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:n}){return z("calcite-label",{class:I.inputRadioLabel,key:n.label,layout:"inline"},z("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:t,class:I.inputRadio,disabled:n.readOnly,name:n.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return!i.field.editable||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===i.input?.type?z("calcite-text-area",{...t,class:this.classes(I.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):z("calcite-input",{...t,class:this.classes(I.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const i=m(e.field);return z("calcite-input-number",{...t,integer:i,type:"number",value:i&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return z("calcite-input",{...i,class:this.classes(I.fieldInput,I.inputDisabled,I.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{field:i}=e;let n;switch(i.type){case"date":n=this._renderDateFieldComponents(e,t);break;case"date-only":n=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":n=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":n=this._renderTimestampOffsetFieldComponents(e,t);break;default:n=this._renderReadOnlyComponent(e,V(i,t.value,{timeZone:e.effectiveTimeZone,...L(e.template.field)}))}return e.value===T?[n,z("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:n}_renderDateOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:a}=t,{rawMax:s,rawMin:o}=e.range;return z("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"date","data-element-id":t[G],key:`${n}-date-input`,max:d(s)?s:void 0,min:d(o)?o:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,topLayerDisabled:this.topLayerDisabled,value:e.value===T?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:a}=t;return z("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:i,"data-date-part":"time","data-element-id":t[G],key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,value:e.value===T?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,key:n,readOnly:a}=t,{rawMax:s,rawMin:o}=e.range,l=S(s),r=S(o),c=S(e.value===T?"":e.value),m=e.includeTimeOffset,d={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:a,[G]:t[G],onfocus:this._onComponentFocus};return z("div",{class:I.dateInputContainer,key:`${n}-date-time-container`},z("calcite-input-date-picker",{...d,class:i,"data-date-part":"date",key:`${n}-date-input`,max:l?.date??void 0,min:r?.date??void 0,onblur:()=>{this._focusedFieldInput=null},topLayerDisabled:this.topLayerDisabled,value:c.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),z("calcite-input-time-picker",{...d,class:i,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:c.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),m?z("calcite-input-time-zone",{...d,class:i,clearable:e.value===T||null==e.value,"data-date-part":"timeZone",key:`${n}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:c.timeZoneOffset||"",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,key:n,readOnly:a,min:s,max:o}=t,l=e.effectiveTimeZone,r=U(e.value===T?"":e.value,l),c=U(o,l),m=U(s,l),d=e.includeTime,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:a,[G]:t[G],onfocus:this._onComponentFocus};return z("div",{class:I.dateInputContainer,key:`${n}-date-time-container`},z("calcite-input-date-picker",{...p,class:i,"data-date-part":"date",key:`${n}-date-input`,max:c?.date??void 0,min:m?.date??void 0,onblur:()=>{this._focusedFieldInput=null},topLayerDisabled:this.topLayerDisabled,value:r.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),d?z("calcite-input-time-picker",{...p,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:r.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}_renderRelationshipElementInput(e){const{elementId:t}=e.template;return z("div",{class:I.relationshipElementInput,"data-testid":`relationship-element-${t}`,key:`relationship-element-${t}`})}_renderAttachmentElementInput(e){const{attachments:t,template:{description:i,elementId:n,label:a}}=e;return z("div",{class:I.attachmentElementInput,"data-testid":`attachment-element-${n}`,key:`attachment-element-${n}`},a?z("div",{class:I.attachmentElementLabel,key:`attachment-element-label-${n}`},a):null,i?z("div",{class:I.description,key:`attachment-element-description-${n}`},i):null,t.length?z("calcite-list",{class:I.attachmentElementList,key:`attachment-element-list-${n}`,label:a||this.messagesCommon.details,selectionAppearance:"border",selectionMode:"none"},t.map((t,i)=>{const a=this._formatAttachmentSize(t.size),s=this._getAttachmentLabel(t,i,a,e.displayFilename),o=s===a?void 0:a,l=v(t);return z("calcite-list-item",{class:I.attachmentElementListItem,description:o,key:`attachment-item-${l}`,label:s,onCalciteListItemSelect:()=>this._setSelectedAttachment({attachmentKey:l,elementId:n})},z("div",{class:I.attachmentElementListItemStart,slot:"content-start"},this._renderAttachmentPreviewThumbnail(t,s,e.supportsResize)),z("calcite-icon",{icon:"chevron-right",scale:"s",slot:"actions-end"}))})):z("div",{class:I.attachmentElementEmptyState,key:`attachment-element-empty-state-${n}`},this.messages.attachments.noAttachments),z("div",{class:I.attachmentElementEmptyAction,key:`attachment-element-empty-action-${n}`},z("calcite-button",{appearance:"outline",iconStart:"attachment",kind:"neutral",onclick:()=>{},round:!0},this.messages.attachments.attach)))}_renderAttachmentDetailPanelContent(e){const{attachment:t,input:i}=e,n=v(t),a=!!b(t,i.supportsResize);return z("div",{class:I.attachmentElementDetail,key:`attachment-detail-panel-${i.template.elementId}-${n}`},z("div",{class:I.attachmentElementDetailPreview},this._renderAttachmentPreviewImage(t,i.supportsResize)),z("div",{class:I.attachmentElementDetailActions},z("calcite-button",{appearance:"outline",disabled:!a,iconStart:"download-to",kind:"neutral",onclick:()=>{this._downloadAttachment(t)},scale:"s"},this.messages.attachments.download),f(t)?z("calcite-button",{appearance:"outline",disabled:!a,iconStart:"expand",kind:"neutral",onclick:this._maximizeSelectedAttachment,scale:"s"},this.messages.attachments.maximize):null,z("calcite-button",{appearance:"outline",disabled:!0,iconStart:"refresh",kind:"neutral",scale:"s"},this.messages.attachments.replace)),z("div",{class:I.attachmentElementDetailMetadata},z("span",{class:I.attachmentElementDetailMetadataLabel},this.messages.attachments.fileName),z("span",{class:I.attachmentElementDetailMetadataValue},t.name),z("span",{class:I.attachmentElementDetailMetadataLabel},this.messages.attachments.size),z("span",{class:I.attachmentElementDetailMetadataValue},this._formatAttachmentSize(t.size)),z("span",{class:I.attachmentElementDetailMetadataLabel},this.messages.attachments.type),z("span",{class:I.attachmentElementDetailMetadataValue},this._getLabelForAttachmentType(t))))}_renderAttachmentDialog(){const e=this._attachmentDialogInfo;if(!e)return null;const{attachment:t,input:i}=e;return z("calcite-dialog",{heading:t.name||this.messagesCommon.details,key:"attachment-preview-dialog",modal:!0,open:!0,placement:"cover",width:"l",onCalciteDialogClose:this._closeAttachmentDialog},z("div",{class:I.attachmentElementDetailPreview},this._renderAttachmentPreviewImage(t,i.supportsResize)))}_setSelectedAttachment(e){this.viewModel.setSelectedAttachment(e)}get _selectedAttachmentDetails(){const e=this.viewModel.selectedAttachment,t=this.viewModel.activeForm;if(!e||!t)return null;const i=t.allAttachmentElementInputs.find(t=>t.template.elementId===e.elementId);if(!i)return null;const n=i.attachments.findIndex(t=>v(t)===e.attachmentKey);if(-1===n)return null;return{attachment:i.attachments[n],input:i}}_getAttachmentLabel(e,i,n,a){return!1!==a&&d(e.name)&&e.name.length>0?e.name:n!==this.messagesCommon.notApplicable?n:t(this.messages.attachments.attachmentNumberedLabel,{index:i+1})}_formatAttachmentSize(e){return null==e||Number.isNaN(e)?this.messagesCommon.notApplicable:l(this.messagesUnits,e)}_getLabelForAttachmentType({contentType:e}){if(!e)return this.messagesCommon.notApplicable;const t=this.messages.attachments.attachmentTypes,i=u(e);return t?.[i]||e}_renderAttachmentPreviewThumbnail(e,t,i){const n=b(e,i,64);return n&&f(e)?z("img",{alt:t,class:I.attachmentElementListItemThumb,src:n}):z("calcite-icon",{class:I.attachmentElementListItemIcon,icon:h(e.contentType),scale:"s"})}_renderAttachmentPreviewImage(e,t){const i=b(e,t),n=e.name||this.messagesCommon.details;return i&&f(e)?z("img",{alt:n,class:I.attachmentElementDetailPreviewImage,src:i,title:n}):[z("calcite-icon",{class:I.attachmentElementDetailPreviewIcon,icon:h(e.contentType),scale:"l",textLabel:n,title:n}),this.messages.attachments.noPreviewAvailable]}async _downloadAttachment(e){await A(e)}_renderTextComponent(e){const{elementId:t}=e.template;return z("div",{class:I.textElementInput,"data-testid":`text-element-${t}`,innerHTML:e.text,key:`text-element-${t}`})}_renderUtilityNetworkAssociationsElementInput(e){const{elementId:t}=e.template;return z("div",{class:I.utilityNetworkAssociationsElementInput,"data-testid":t,key:t})}getCommonInputProps(e){const{template:t,valid:i,value:n,minLength:a,maxLength:s,required:o,fieldName:l,editable:r,userHasChangedValue:c,range:{max:m,min:d}}=e,p=!r||this.readOnly,u=!p&&this._effectiveDisabled;let h=t.hint??void 0,v=!1;return n===T&&(h=this.messages.differentValuesPlaceholder,v=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(I.fieldInput,p?I.inputDisabled:null),status:!c&&!this.viewModel.submitHasBeenAttempted||i?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:a&&a>-1?a:void 0,key:t.elementId,label:l,name:l,max:null!=m?m:void 0,min:null!=d?d:void 0,disabled:u,readOnly:p,onblur:this._onComponentBlur,required:o,placeholder:h,value:v?"":n??"",[G]:t.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(G))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),n=t||i;n&&this._afterComponentCreateOrUpdate(n)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(i.template.elementId),this._focusedFieldInput=i}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,Z(e))}_onComponentBlur(){this._focusedFieldInput=null}_resetTransientFormState(){this._attemptFocusOnNextRender=!1,this._focusedFieldInput=null,this._attachmentDialogInfo=null}_parseValue(e,t){if(C(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const i of t.domain.codedValues)if(i.name===e.selectedItems[0].textContent)return i.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const i=e.value;return null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:i}=t.template;if(!t)return;const n=t?.value;if(C(t.template,"switch")&&"single"!==this.viewModel.mode){const e=a(this._batchSwitchInputInitialValues,t,()=>t.value);this._batchSwitchInputInitialValues.set(t,null===e?n:e)}const s=this._parseValue(e,t);s!==n&&this.viewModel.setValue(i,s)}_afterDateComponentCreate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,n=e.field.type,a=this._dateComponentMap.get(`${i}`);if(!a)return;const s=e.effectiveTimeZone;let o=e.value===T?void 0:e.value,l=null;"date-only"===n?l=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===n?(o=R(o),l=R(t.value)):l="timestamp-offset"===n?null!=t.value?P({dateComponent:a.date,timeComponent:a.time,oldValue:o,timeZoneComponent:a.timeZone,defaultTimeZone:s}):null:null!=t.value?$({oldValue:o,dateComponent:a.date,timeZone:s,timeComponent:a.time?.value===T?void 0:a.time}):null,o!==l&&(null!==l&&t.value?this.viewModel.setValue(`${i}`,l):this.viewModel.setValue(`${i}`,null))}};e([r()],q.prototype,"activeFeatureIndex",null),e([r()],q.prototype,"disabled",null),e([r()],q.prototype,"_effectiveDisabled",null),e([r()],q.prototype,"features",null),e([r()],q.prototype,"map",null),e([r()],q.prototype,"maximumFeatureCount",null),e([r()],q.prototype,"maximumFeatureCountWithComplexForms",null),e([r()],q.prototype,"spatialReference",null),e([r()],q.prototype,"layerInfos",null),e([r()],q.prototype,"timeZone",null),e([r()],q.prototype,"headingLevel",void 0),e([r()],q.prototype,"icon",null),e([r(),B("esri/t9n/common")],q.prototype,"messagesCommon",void 0),e([r(),B("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],q.prototype,"messages",void 0),e([r(),B("esri/core/t9n/Units")],q.prototype,"messagesUnits",void 0),e([r()],q.prototype,"readOnly",null),e([r()],q.prototype,"valid",null),e([r({type:y}),j(["value-change","submit"])],q.prototype,"viewModel",void 0),e([r({type:F,nonNullable:!0})],q.prototype,"visibleElements",void 0),e([r()],q.prototype,"groupDisplay",void 0),e([r()],q.prototype,"_attemptFocusOnNextRender",void 0),e([r()],q.prototype,"_focusedFieldInput",void 0),e([r()],q.prototype,"_attachmentDialogInfo",void 0),q=e([c("esri.widgets.BatchAttributeForm")],q);const W=q;export{W as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as a}from"../core/deprecate.js";import i from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{watch as o,on as l}from"../core/reactiveUtils.js";import{formatFileSize as s}from"../core/unitFormatUtils.js";import{property as r,subclass as c}from"../core/accessorSupport/decorators.js";import{isIntegerField as d}from"../layers/support/fieldUtils.js";import{isString as u}from"../support/guards.js";import m from"./Widget.js";import{getAttachmentTypeCategory as p,getCalciteIconForAttachment as h}from"./Attachments/support/attachmentUtils.js";import{getAttachmentKey as f,isImageAttachment as v}from"./BatchAttributeForm/attachmentUtils.js";import{getHiddenFieldsValidationErrorMessage as g,getVisibleFieldInputValidationErrorMessage as b,isElementTemplateWithInputType as C}from"./BatchAttributeForm/batchAttributeFormUtils.js";import _ from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as y}from"./BatchAttributeForm/css.js";import{makeAddAttachmentFooterButtons as F,makeViewingAttachmentFooterButtons as I,makeDefaultFooterButtons as w}from"./BatchAttributeForm/interfaceUtils.js";import k from"./BatchAttributeForm/VisibleElements.js";import A from"./BatchAttributeForm/inputs/FieldInput.js";import{isGroupInput as M,isFieldInput as x,isTextElementInput as D,isRelationshipElementInput as V,isAttachmentElementInput as O,isUtilityNetworkAssociationsElementInput as T,getMultipleChoiceCheckboxState as E,differentValuesString as S,getUpdatedMultipleChoiceValueForFeature as N,getMultipleChoiceSelectAllState as L,splitMultipleChoiceValue as U}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{downloadAttachmentInfo as P}from"./FeatureTable/support/exportUtils.js";import{loadCalciteComponents as B}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as $,getIntlOptionsForField as R,prepareISOFieldValueForDateComponents as j,prepareUnixFieldValueForDateComponents as z,normalizeTimeOnlyString as Z,getISOFieldValueFromDateComponents as H,getUnixFieldValueFromDateComponents as q}from"./support/dateUtils.js";import{globalCss as G}from"./support/globalCss.js";import{messageBundle as W,vmEvent as K,tsx as J}from"./support/widget.js";import{setFocus as Q}from"./support/widgetUtils.js";import{isEmptyValue as X}from"./support/forms/formUtils.js";const Y="data-element-id",ee="esri_BatchAttributeForm_select_all",te="esri_BatchAttributeForm_other_choice",ae="esri_BatchAttributeForm_other_choice_checked";let ie=class extends m{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.messagesUnits=null,this.viewModel=new _,this.visibleElements=new k,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._attachmentDialogInfo=null,this._attachmentFileInputMap=new Map,this._maximizeSelectedAttachment=()=>{this._attachmentDialogInfo=this.selectedAttachmentDetails},this._closeAttachmentDialog=()=>{this.hideAttachmentDialog()},this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{a(i.getLogger(this),"Editor","arcgis-editor",{version:"5.0"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...a}=e;return a}initialize(){this.addHandles([o(()=>this.features,()=>{this._dateComponentMap.clear(),this._resetTransientFormState(),A.clearMultipleChoiceOtherChoiceStateForViewModel(this.viewModel,{includeDraftValues:!0})}),o(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear(),this._resetTransientFormState(),A.clearMultipleChoiceOtherChoiceStateForViewModel(this.viewModel)}),o(()=>this.viewModel.selectedAttachmentAddElementId,()=>{this.hideAttachmentDialog()}),l(()=>this.viewModel,"submit",()=>{this.valid||this.goToFirstError()})])}loadDependencies(){return B({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get effectiveTitle(){const{features:e,messages:t,page:a}=this;return"viewing-attachment-details"===a?t.titles.editAttachment:"adding-attachments"===a?t.titles.addAttachments:1===e.length||this.activeFeatureIndex>-1?t.titles.editFeature:e.length>1?t.titles.editFeatures:""}get effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get footerButtonInfos(){if(!this.features.length)return[];const{page:e,messages:t}=this,a=this.viewModel.selectedAttachmentAddElementId;return"adding-attachments"===e&&a?F({messages:t,onclick:()=>this._attachmentFileInputMap.get(a)?.click()}):"viewing-attachment-details"===e?I({messages:t}):w({formId:this._formId,callback:this.submit,messages:t})}get footerNoticeInfos(){if(!this.features.length)return[];const{messages:{footerNotices:e}}=this;return[]}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get page(){return this.viewModel.page}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get selectedAttachment(){return this.viewModel.selectedAttachment}get selectedAttachmentDetails(){return this.viewModel.selectedAttachmentDetails}get valid(){return this.viewModel.valid}get _formId(){return`${this.id}-form`}async goBack(){return this.viewModel.goBack()}async goHome(){return this.viewModel.goHome()}goToFirstError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._focusedFieldInput=e.input,this._attemptFocusOnNextRender=!0,this.scheduleRender()}render(){return J("div",{class:this.classes(y.base,G.widget,G.panel)},this._renderContent(),this._renderAttachmentDialog())}submit(){this.viewModel.submit()}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:a}=e.dataset,i=n(this._dateComponentMap,`${a}`,()=>({}));switch(t){case"date":i.date=e;break;case"time":i.time=e;break;case"timeZone":i.timeZone=e}}_renderContent(){const{messages:e,viewModel:a}=this,{status:i}=a;return"failed"===i?a.hasTooManyComplexFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyComplexFeatures,{num:a.maximumFeatureCountWithComplexForms})):a.hasTooManyFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyFeatures,{num:a.maximumFeatureCount})):e.formFailedToLoad:a.expressionEvaluationFailed?this._renderErrorNotice(e.expressionEvaluationFailed):a.hasLayersWithContingentValues?this._renderErrorNotice(e.unsupportedContingentValues):"loading"===i&&this.visibleElements.loadingIndicator?J("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):0!==this.features.length?this._renderForm():void 0}_renderErrorNotice(e){return J("calcite-notice",{class:y.noticeError,icon:!0,kind:"warning",open:!0},J("div",{slot:"message"},e))}_renderForm(){return J("form",{class:y.form,id:this._formId,onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderPage())}_renderPage(){switch(this.page){case"adding-attachments":return this._renderAttachmentAddPage();case"viewing-attachment-details":return this._renderAttachmentDetailPage();default:return this._renderFormContent()}}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:a}=e;let i;if(!e.submitHasBeenAttempted)return null;if(a.invalidHiddenInputs.length>0)if(i=g(a,e.mode,this.messages),"batch"===this.viewModel.mode){const e=a.invalidHiddenInputs.filter(e=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);e.length>0?i+=` (${e.map(e=>e.label).join(", ")})`:i=null}else i+=` (${a.invalidHiddenInputs.map(e=>e.label).join(", ")})`;else if(t)return null;return i?J("calcite-notice",{class:y.noticeError,icon:!0,kind:"danger",open:!0},J("div",{slot:"message"},i)):null}_renderFormContent(){if(!this.viewModel.hasVisibleInputs)return[J("calcite-notice",{class:y.noticeError,icon:!0,kind:"warning",open:!0},J("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return M(e)?this._renderGroupInput(e):x(e)?this._renderLabeledField(e):D(e)?this._renderTextComponent(e):V(e)?this._renderRelationshipElementInput(e):O(e)?this._renderAttachmentElementInput(e):T(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderGroupInput(e){const{inputs:t,template:a,open:i}=e,n=t.filter(e=>e.visible),o=a.label??"";return J("calcite-block",{class:this.classes(y.group,"sequential"===this.groupDisplay?y.groupSequential:null,this.disabled?y.inputDisabled:null),collapsible:!0,description:a.description??void 0,disabled:this.effectiveDisabled,expanded:i,heading:o,headingLevel:this.headingLevel,key:`{${a.elementId}-key}`,label:o,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},n.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:a}=e.template,{label:i,required:n,dataType:o}=e,l=n?t(this.messages.requiredFieldLabel,{name:i}):i;return J("calcite-label",{"aria-label":l,class:y.label,key:`field--${a}`},J("div",{class:y.labelTextContent,key:"labelTextContainer"},i,n?J("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==o?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:a}=e;return"date"===a?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):null!==e.multipleChoiceChoices?this._renderMultipleChoiceComponent({input:e,props:t}):"number"===a?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:a,submittable:i}=e,n=!i&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?b(e,t,this.messages):null;return n?J("calcite-input-message",{icon:!0,status:"invalid"},n):a?J("calcite-input-message",{class:y.description,icon:!1,status:"idle"},a):null}_renderCodedInputs({input:e,props:t}){const a=e.input?.type??null,i=e.codedValueOptions;switch(a){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:i.flat(),props:t});default:return this._renderComboBoxComponent({options:i,props:t,input:e})}}_renderMultipleChoiceComponent({input:e,props:t}){const{messages:a}=this,{multipleChoiceChoices:i,multipleChoiceInput:n,multipleChoiceValues:o}=e;if(!n||!i||!o)return null;const l=!0===n.includeSelectAllChoices,s=new Map;let r=o.length>0,c=!1;for(const h of o){const t=E({input:e,choiceValue:h});s.set(h,t),(t.checked||t.indeterminate)&&(c=!0),t.checked||(r=!1)}const d={checked:r,indeterminate:!r&&c},u=d.checked?a.deselectAllLabel:a.selectAllLabel,m=e.getMultipleChoiceOtherChoiceRenderState(this.messages.otherOptionLabel),p=(t,a)=>{this._saveValueFromMultipleChoiceComponent({input:e,node:t,nodeType:a,otherChoiceFieldName:m.fieldName})};return J("div",{class:y.multipleChoiceInput,key:`${t.key}-multiple-choice-group`},l?this._renderMultipleChoiceSelectAllCheckbox({props:t,selectAllState:d,selectAllLabel:u,handleMultipleChoiceNodeChange:p}):null,this._renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:s,handleMultipleChoiceNodeChange:p}),m.shouldShow?this._renderMultipleChoiceOtherChoice({props:t,includeSelectAllChoices:l,otherChoiceRenderState:m,handleMultipleChoiceNodeChange:p,differentValuesPlaceholder:a.differentValuesPlaceholder}):null)}_renderMultipleChoiceSelectAllCheckbox({props:e,selectAllState:t,selectAllLabel:a,handleMultipleChoiceNodeChange:i}){return J("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:t.checked,class:y.multipleChoiceSelectAll,"data-element-id":e[Y],disabled:e.readOnly,indeterminate:t.indeterminate,key:`${e.key}-select-all`,label:a,labelText:a,onblur:e.onblur,onfocus:e.onfocus,value:ee,onCalciteCheckboxChange:({currentTarget:e})=>i(e,"select-all")})}_renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:a,handleMultipleChoiceNodeChange:i}){const{multipleChoiceChoices:n}=e;return n?n.map(e=>{const n=a.get(e.value)??{checked:!1,indeterminate:!1};return J("calcite-checkbox",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,"aria-invalid":t["aria-invalid"],checked:n.checked,class:t.class,"data-element-id":t[Y],disabled:t.readOnly,indeterminate:n.indeterminate,key:`${t.key}-${e.value}`,label:e.label,labelText:e.label,onblur:t.onblur,onfocus:t.onfocus,required:t.required,value:e.value,onCalciteCheckboxChange:({currentTarget:e})=>i(e)})}):[]}_renderMultipleChoiceOtherChoice({props:e,includeSelectAllChoices:t,otherChoiceRenderState:a,handleMultipleChoiceNodeChange:i,differentValuesPlaceholder:n}){return J("div",{class:this.classes(y.multipleChoiceOtherChoice,t?y.multipleChoiceOtherChoiceWithSelectAll:null),key:`${e.key}-other-choice`},J("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:a.checkboxState.checked,class:e.class,"data-element-id":e[Y],disabled:e.readOnly,indeterminate:a.checkboxState.indeterminate,key:`${e.key}-other-choice-checkbox`,label:a.label,labelText:a.label,onblur:e.onblur,onfocus:e.onfocus,value:te,onCalciteCheckboxChange:({currentTarget:e})=>i(e,"other-choice")}),a.checkboxState.checked?J("calcite-input",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],"aria-label":a.label,class:y.textElementInput,"data-element-id":e[Y],disabled:e.readOnly,key:`${e.key}-other-choice-input`,maxLength:a.maxLength,onblur:e.onblur,onfocus:e.onfocus,placeholder:a.value===S?n:a.hint,required:e.required,type:"text",value:a.normalizedValue===S?"":a.normalizedValue?String(a.normalizedValue):"",onCalciteInputInput:({currentTarget:e})=>i(e,"other-choice-input")}):null)}async _saveValueFromMultipleChoiceComponent({input:e,node:t,nodeType:a,otherChoiceFieldName:i}){"calcite-checkbox"!==t.localName?await this._saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:i}):await this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,nodeType:a,otherChoiceFieldName:i})}async _saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,nodeType:a,otherChoiceFieldName:i}){if("other-choice"===a){if(!i)return;return void await this._saveOtherChoiceCheckboxValue({input:e,isChecked:t.checked,otherChoiceFieldName:i})}if(e.multipleChoiceInput&&"select-all"!==a&&"batch"===this.viewModel.mode)return void await this._saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t});const n=e.value,o=this._parseValue(t,e,a);o!==n&&(await this.viewModel.setValue(e.template.elementId,o),this.renderNow())}async _saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:a}){if(!a)return;const i=t.value,n=null==i||""===i?null:i;e.initializeExplicitMultipleChoiceOtherChoiceCheckedState(),e.stashMultipleChoiceOtherChoiceDraftValueForFeatures(e.features.toArray(),n);const o=e.features.toArray().filter(e=>e.getAttribute(a)!==n);if(0!==o.length){for(const e of o)e.setAttribute(a,n);this.viewModel.userHasChangedValues=!0,await e.expressionsManager.valueChanged(a,o),this.viewModel.emit("value-change",{features:o.map(e=>e.source),fieldName:a,name:"value-change",value:n}),this.renderNow()}}async _saveOtherChoiceCheckboxValue({input:e,isChecked:t,otherChoiceFieldName:a}){e.setExplicitMultipleChoiceOtherChoiceCheckedState(t),t||e.setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e.features.toArray());const i=e.features.toArray().filter(i=>{const n=i.getAttribute(a);if(t){if(!X(n))return!1;const t=e.getMultipleChoiceOtherChoiceDraftValue(i),o=e.canRestoreMultipleChoiceOtherChoiceDraftValue(t)?t:ae;return i.setAttribute(a,o),!0}return null!=n&&(i.setAttribute(a,null),!0)});0!==i.length&&(this.viewModel.userHasChangedValues=!0,await e.expressionsManager.valueChanged(a,i),this.viewModel.emit("value-change",{features:i.map(e=>e.source),fieldName:a,name:"value-change",value:this._getFieldValueByFieldNameForInput(e,a)}),this.renderNow())}async _saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t}){if(!e.multipleChoiceInput||!e.multipleChoiceValues)return;const a=e.features.toArray().filter(a=>{const i=a.getAttribute(e.fieldName),n=N({input:e,choiceValue:t.value,currentValue:i,isChecked:t.checked});return i!==n&&(a.setAttribute(e.fieldName,n),!0)});0!==a.length&&(this.viewModel.userHasChangedValues=!0,await e.expressionsManager.valueChanged(e.fieldName,a),this.viewModel.emit("value-change",{features:a.map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:this._getFieldValueByFieldNameForInput(e,e.fieldName)}),this.renderNow())}_getFieldValueByFieldNameForInput(e,t){const a=e.features.toArray().map(e=>e.getAttribute(t));if(0===a.length)return null;const[i]=a;return a.every(e=>e===i)?i:S}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===S||e.value===S)&&"batch"===this.viewModel.mode){const a={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[Y]:t[Y]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:a,options:[{name:this.messages.differentValuesPlaceholder,value:S,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return J("calcite-switch",{...t,checked:!!C(e.template,"switch")&&e.value===e.template.input.onValue,class:y.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:a}){const{trigger:i,dropdown:n,group:o}=a;return J("calcite-dropdown",{...n,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,topLayerDisabled:this.topLayerDisabled,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},J("calcite-button",{...i},e===S?this.messages.differentValuesPlaceholder:e),J("calcite-dropdown-group",{selectionMode:o.mode},t.map(t=>J("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:a}){const i="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),o=i&&e.showNoValueOptionEnabled&&!n?()=>{}:a.onblur,l={...a,onblur:o};return J("calcite-combobox",{...l,selectionMode:"single",topLayerDisabled:this.topLayerDisabled,value:a.placeholder===this.messages.differentValuesPlaceholder?S:String(a.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==S&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:a}))}renderComboboxOptionsList({input:e,options:t,props:a}){const[i,n]=t.map(e=>e.map(({name:e,value:t})=>J("calcite-combobox-item",{heading:e,key:`#${t}`,selected:a.value===t,value:`${t}`}))),o=[...i];n.length>0&&o.push(J("calcite-combobox-item-group",{key:"unsupported",label:this.messages.unsupportedDomainGroupTitle},n));const l=a.placeholder===this.messages.differentValuesPlaceholder,s=!l&&X(a.value);return e.showNoValueOptionEnabled&&o.unshift(J("calcite-combobox-item",{heading:e.showNoValueLabel||this.messages.empty,key:"empty-option",selected:s,value:""})),l&&o.unshift(J("calcite-combobox-item",{heading:this.messages.differentValuesPlaceholder,key:S,selected:!0,value:S})),o}_renderRadioButtonGroupComponent({input:e,options:t,props:a}){const i=t.map(({name:t,value:i})=>this._renderRadioButtons({label:t,value:i,selected:i===e.value,props:a}));if(e.showNoValueOptionEnabled){const t="",n=e.showNoValueLabel||this.messages.empty,o=X(e.value);i.unshift(this._renderRadioButtons({label:n,value:t,selected:o,props:a}))}return J("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:y.inputRadioGroup,disabled:a.readOnly,key:`${a.key}-radio-group`,layout:"vertical",name:a.name,required:a.required},i,a.placeholder===this.messages.differentValuesPlaceholder?J("calcite-label",{class:y.placeholderRadio,key:a.label,layout:"inline"},J("calcite-radio-button",{checked:!0,class:y.inputRadio,disabled:!0,name:a.placeholder,value:a.placeholder}),a.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:a,props:i}){return J("calcite-label",{class:y.inputRadioLabel,key:i.label,layout:"inline"},J("calcite-radio-button",{...i,afterCreate:void 0,afterUpdate:void 0,checked:t,class:y.inputRadio,disabled:i.readOnly,name:i.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),a)}_renderStringComponent(e,t){const{template:a}=e;return!a.field.editable||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===a.input?.type?J("calcite-text-area",{...t,class:this.classes(y.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):J("calcite-input",{...t,class:this.classes(y.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const a=d(e.field);return J("calcite-input-number",{...t,integer:a,type:"number",value:a&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const a=this.getCommonInputProps(e);return J("calcite-input",{...a,class:this.classes(y.fieldInput,y.inputDisabled,y.individualElement),readOnly:!0,type:"text",value:String(t??a.value??"")})}_renderDateComponents(e,t){const{field:a}=e;let i;switch(a.type){case"date":i=this._renderDateFieldComponents(e,t);break;case"date-only":i=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":i=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":i=this._renderTimestampOffsetFieldComponents(e,t);break;default:i=this._renderReadOnlyComponent(e,$(a,t.value,{timeZone:e.effectiveTimeZone,...R(e.template.field)}))}return e.value===S?[i,J("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:i}_renderDateOnlyFieldComponent(e,t){const{class:a,key:i,readOnly:n}=t,{rawMax:o,rawMin:l}=e.range;return J("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:a,"data-date-part":"date","data-element-id":t[Y],key:`${i}-date-input`,max:u(o)?o:void 0,min:u(l)?l:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,topLayerDisabled:this.topLayerDisabled,value:e.value===S?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:a,key:i,readOnly:n}=t;return J("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:a,"data-date-part":"time","data-element-id":t[Y],key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===S?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:a,key:i,readOnly:n}=t,{rawMax:o,rawMin:l}=e.range,s=j(o),r=j(l),c=j(e.value===S?"":e.value),d=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[Y]:t[Y],onfocus:this._onComponentFocus};return J("div",{class:y.dateInputContainer,key:`${i}-date-time-container`},J("calcite-input-date-picker",{...u,class:a,"data-date-part":"date",key:`${i}-date-input`,max:s?.date??void 0,min:r?.date??void 0,onblur:()=>{this._focusedFieldInput=null},topLayerDisabled:this.topLayerDisabled,value:c.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),J("calcite-input-time-picker",{...u,class:a,"data-date-part":"time",key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:c.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),d?J("calcite-input-time-zone",{...u,class:a,clearable:e.value===S||null==e.value,"data-date-part":"timeZone",key:`${i}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:c.timeZoneOffset||"",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:a,key:i,readOnly:n,min:o,max:l}=t,s=e.effectiveTimeZone,r=z(e.value===S?"":e.value,s),c=z(l,s),d=z(o,s),u=e.includeTime,m={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[Y]:t[Y],onfocus:this._onComponentFocus};return J("div",{class:y.dateInputContainer,key:`${i}-date-time-container`},J("calcite-input-date-picker",{...m,class:a,"data-date-part":"date",key:`${i}-date-input`,max:c?.date??void 0,min:d?.date??void 0,onblur:()=>{this._focusedFieldInput=null},topLayerDisabled:this.topLayerDisabled,value:r.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),u?J("calcite-input-time-picker",{...m,"data-date-part":"time",key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:r.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}_renderRelationshipElementInput(e){const{elementId:t}=e.template;return J("div",{class:y.relationshipElementInput,"data-testid":`relationship-element-${t}`,key:`relationship-element-${t}`})}_renderAttachmentElementInput(e){const{attachments:t,template:{description:a,elementId:i,label:n}}=e;return J("div",{class:y.attachmentElementInput,"data-testid":`attachment-element-${i}`,key:`attachment-element-${i}`},n?J("div",{class:y.attachmentElementLabel,key:`attachment-element-label-${i}`},n):null,a?J("div",{class:y.description,key:`attachment-element-description-${i}`},a):null,t.length?J("calcite-list",{class:y.attachmentElementList,key:`attachment-element-list-${i}`,label:n||this.messagesCommon.details,selectionAppearance:"border",selectionMode:"none"},t.map((t,a)=>{const n=this._formatAttachmentSize(t.size),o=this._getAttachmentLabel(t,a,n,e.displayFilename),l=o===n?void 0:n,s=f(t),r=this._isStagedAttachmentAddition(t);return J("calcite-list-item",{class:y.attachmentElementListItem,description:l,key:`attachment-item-${s}`,label:o,onCalciteListItemSelect:r?void 0:()=>this._setSelectedAttachment({attachmentKey:s,elementId:i})},J("div",{class:y.attachmentElementListItemStart,slot:"content-start"},this._renderAttachmentPreviewThumbnail(t,o,e)),r?J("div",{class:y.attachmentElementListItemActions,slot:"actions-end"},J("span",{class:y.attachmentElementListItemStagedIndicator}),J("calcite-button",{appearance:"transparent","aria-label":this.messagesCommon.delete,disabled:this.effectiveDisabled,iconStart:"x",kind:"neutral",onclick:()=>{this.viewModel.stageDeleteAttachment(i,t.globalId)},scale:"s"})):J("calcite-icon",{icon:"chevron-right",scale:"s",slot:"actions-end"}))})):J("div",{class:y.attachmentElementEmptyState,key:`attachment-element-empty-state-${i}`},this.messages.attachments.noAttachments),this._renderAttachmentAddAction(e))}_renderAttachmentAddAction(e){const{elementId:t}=e.template,a=this.effectiveDisabled||e.addDisabled;return J("div",{class:y.attachmentElementEmptyAction,key:`attachment-element-empty-action-${t}`},J("calcite-button",{appearance:"outline",disabled:a,iconStart:"attachment",kind:"neutral",onclick:()=>this._setAttachmentAddElementId(t),round:!0,scale:"s"},this.messages.attachments.attach))}_renderAttachmentAddPage(){const e=this.viewModel.selectedAttachmentAddInput;return e?this._renderAttachmentAddPanel(e):null}_renderAttachmentAddPanel(e){const{maxAttachmentCount:t}=e,{elementId:a}=e.template,i=null==t||t-e.attachments.length>1,n=this.effectiveDisabled||e.addDisabled,o=this.messages.attachments,l=o.dragAndDropFile,s="upload",r=e=>{this._attachmentFileInputMap.set(a,e)};return J("div",{class:y.attachmentElementAddPanel,key:`attachment-element-add-panel-${a}`},J("input",{accept:e.accept,afterCreate:r,afterRemoved:()=>{this._attachmentFileInputMap.delete(a)},afterUpdate:r,class:y.attachmentElementFileInput,"data-element-id":a,disabled:n,multiple:i,onchange:e=>{const t=e.currentTarget,i=t.files?Array.from(t.files):[];this._stageAttachmentFiles(a,i),t.value=""},type:"file"}),J("div",{class:y.attachmentElementAddDropzone,"data-disabled":n?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),n)return;const t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this._stageAttachmentFiles(a,t)}},J("calcite-icon",{class:y.attachmentElementAddDropzoneIcon,icon:s,scale:"l"}),J("div",{class:y.attachmentElementAddDropzoneHeading},o.addFile),J("div",{class:y.attachmentElementAddDropzoneDetail,title:l},l),J("calcite-button",{appearance:"outline-fill",disabled:n,iconStart:"folder-open",onclick:e=>{e.stopPropagation(),this._openAttachmentFilePicker(a,n)},scale:"s",type:"button"},o.selectFile)))}async _stageAttachmentFiles(e,t){if(0!==t.length)try{await this.viewModel.stageAddAttachments(e,t)}finally{this.viewModel.setSelectedAttachmentAddElementId(null)}}_openAttachmentFilePicker(e,t){t||this._attachmentFileInputMap.get(e)?.click()}_renderAttachmentDetailPage(){const e=this.selectedAttachmentDetails;if(!e)return;const{attachment:t,input:a}=e,i=f(t),n=!!a.getAttachmentPreviewUrl(t);return J("div",{class:y.attachmentElementDetail,key:`attachment-detail-panel-${a.template.elementId}-${i}`},J("div",{class:y.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,a)),J("div",{class:y.attachmentElementDetailActions},J("calcite-button",{appearance:"outline",disabled:!n,iconStart:"download-to",kind:"neutral",onclick:()=>{this._downloadAttachment(t)},scale:"s"},this.messages.attachments.download),v(t)?J("calcite-button",{appearance:"outline",disabled:!n,iconStart:"expand",kind:"neutral",onclick:this._maximizeSelectedAttachment,scale:"s"},this.messages.attachments.maximize):null,J("calcite-button",{appearance:"outline",disabled:!0,iconStart:"refresh",kind:"neutral",scale:"s"},this.messages.attachments.replace)),J("div",{class:y.attachmentElementDetailMetadata},J("span",{class:y.attachmentElementDetailMetadataLabel},this.messages.attachments.fileName),J("span",{class:y.attachmentElementDetailMetadataValue},t.name),J("span",{class:y.attachmentElementDetailMetadataLabel},this.messages.attachments.size),J("span",{class:y.attachmentElementDetailMetadataValue},this._formatAttachmentSize(t.size)),J("span",{class:y.attachmentElementDetailMetadataLabel},this.messages.attachments.type),J("span",{class:y.attachmentElementDetailMetadataValue},this._getLabelForAttachmentType(t))))}_renderAttachmentDialog(){const e=this._attachmentDialogInfo;if(!e)return null;const{attachment:t,input:a}=e;return J("calcite-dialog",{heading:t.name||this.messagesCommon.details,key:"attachment-preview-dialog",modal:!0,open:!0,placement:"cover",width:"l",onCalciteDialogClose:this._closeAttachmentDialog},J("div",{class:y.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,a)))}_setSelectedAttachment(e){this.viewModel.setSelectedAttachment(e),e||this.hideAttachmentDialog()}_setAttachmentAddElementId(e){this.viewModel.setSelectedAttachmentAddElementId(e),this.hideAttachmentDialog()}_getAttachmentLabel(e,a,i,n){return!1!==n&&u(e.name)&&e.name.length>0?e.name:i!==this.messagesCommon.notApplicable?i:t(this.messages.attachments.attachmentNumberedLabel,{index:a+1})}_formatAttachmentSize(e){return null==e||Number.isNaN(e)?this.messagesCommon.notApplicable:s(this.messagesUnits,e)}_getLabelForAttachmentType({contentType:e}){if(!e)return this.messagesCommon.notApplicable;const t=this.messages.attachments.attachmentTypes,a=p(e);return t?.[a]||e}_renderAttachmentPreviewThumbnail(e,t,a){const i=a.getAttachmentPreviewUrl(e,64);return i&&v(e)?J("img",{alt:t,class:y.attachmentElementListItemThumb,src:i}):J("calcite-icon",{class:y.attachmentElementListItemIcon,icon:h(e.contentType),scale:"s"})}_isStagedAttachmentAddition(e){return"number"==typeof e.id&&e.id<0}_renderAttachmentPreviewImageForInput(e,t){const a=t.getAttachmentPreviewUrl(e),i=e.name||this.messagesCommon.details;return a&&v(e)?J("img",{alt:i,class:y.attachmentElementDetailPreviewImage,src:a,title:i}):[J("calcite-icon",{class:y.attachmentElementDetailPreviewIcon,icon:h(e.contentType),scale:"l",textLabel:i,title:i}),this.messages.attachments.noPreviewAvailable]}async _downloadAttachment(e){await P(e)}hideAttachmentDialog(){this._attachmentDialogInfo=null}_renderTextComponent(e){const{elementId:t}=e.template;return J("div",{class:y.textElementInput,"data-testid":`text-element-${t}`,innerHTML:e.text,key:`text-element-${t}`})}_renderUtilityNetworkAssociationsElementInput(e){const{elementId:t}=e.template;return J("div",{class:y.utilityNetworkAssociationsElementInput,"data-testid":t,key:t})}getCommonInputProps(e){const{template:t,valid:a,value:i,minLength:n,maxLength:o,required:l,fieldName:s,editable:r,userHasChangedValue:c,range:{max:d,min:u}}=e,m=!r||this.readOnly,p=!m&&this.effectiveDisabled;let h=t.hint??void 0,f=!1;return i===S&&(h=this.messages.differentValuesPlaceholder,f=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":a?"false":"true",class:this.classes(y.fieldInput,m?y.inputDisabled:null),status:!c&&!this.viewModel.submitHasBeenAttempted||a?"idle":"invalid",maxLength:o&&o>-1?o:void 0,minLength:n&&n>-1?n:void 0,key:t.elementId,label:s,name:s,max:null!=d?d:void 0,min:null!=u?u:void 0,disabled:p,readOnly:m,onblur:this._onComponentBlur,required:l,placeholder:h,value:f?"":i??"",[Y]:t.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(Y))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,a=e.querySelector("calcite-radio-button"),i=t||a;i&&this._afterComponentCreateOrUpdate(i)}_onComponentFocus(e){const t=e.target,a=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(a.template.elementId),this._focusedFieldInput=a}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),a=this._focusedFieldInput;this._attemptFocusOnNextRender&&a===t&&(this._attemptFocusOnNextRender=!1,Q(e))}_onComponentBlur(){this._focusedFieldInput=null}_resetTransientFormState(){this._attemptFocusOnNextRender=!1,this._focusedFieldInput=null,this._attachmentDialogInfo=null,this._attachmentFileInputMap.clear()}_parseValue(e,t,a){const i=t.multipleChoiceInput,n=t.multipleChoiceValues;if(i&&n){const o=i.choiceDelimiter,l=e;if("select-all"===a){return L({input:t}).checked?null:n.length>0?n.join(o):null}const s=U(t.value,o).filter(e=>e!==S),r=new Set(s);l.checked?r.add(l.value):r.delete(l.value);const c=n.filter(e=>r.has(e));return c.length?c.join(o):null}if(C(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const a of t.domain.codedValues)if(a.name===e.selectedItems[0].textContent)return a.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const o=e.value;return null==o||""===o?null:"number"===t.dataType?"-0"===o||"-0."===o||"-0,"===o?o:parseFloat(o):"date"===t.field.type?parseFloat(o):o}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:a}=t.template;if(!t)return;const i=t?.value;if(C(t.template,"switch")&&"single"!==this.viewModel.mode){const e=n(this._batchSwitchInputInitialValues,t,()=>t.value);this._batchSwitchInputInitialValues.set(t,null===e?i:e)}const o=this._parseValue(e,t);o!==i&&this.viewModel.setValue(a,o)}_afterDateComponentCreate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:a}=e.template,i=e.field.type,n=this._dateComponentMap.get(`${a}`);if(!n)return;const o=e.effectiveTimeZone;let l=e.value===S?void 0:e.value,s=null;"date-only"===i?s=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===i?(l=Z(l),s=Z(t.value)):s="timestamp-offset"===i?null!=t.value?H({dateComponent:n.date,timeComponent:n.time,oldValue:l,timeZoneComponent:n.timeZone,defaultTimeZone:o}):null:null!=t.value?q({oldValue:l,dateComponent:n.date,timeZone:o,timeComponent:n.time?.value===S?void 0:n.time}):null,l!==s&&(null!==s&&t.value?this.viewModel.setValue(`${a}`,s):this.viewModel.setValue(`${a}`,null))}};e([r()],ie.prototype,"activeFeatureIndex",null),e([r()],ie.prototype,"disabled",null),e([r()],ie.prototype,"effectiveTitle",null),e([r()],ie.prototype,"effectiveDisabled",null),e([r()],ie.prototype,"features",null),e([r()],ie.prototype,"footerButtonInfos",null),e([r()],ie.prototype,"footerNoticeInfos",null),e([r()],ie.prototype,"map",null),e([r()],ie.prototype,"maximumFeatureCount",null),e([r()],ie.prototype,"maximumFeatureCountWithComplexForms",null),e([r()],ie.prototype,"spatialReference",null),e([r()],ie.prototype,"layerInfos",null),e([r()],ie.prototype,"timeZone",null),e([r()],ie.prototype,"headingLevel",void 0),e([r()],ie.prototype,"icon",null),e([r(),W("esri/t9n/common")],ie.prototype,"messagesCommon",void 0),e([r(),W("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],ie.prototype,"messages",void 0),e([r(),W("esri/core/t9n/Units")],ie.prototype,"messagesUnits",void 0),e([r()],ie.prototype,"page",null),e([r()],ie.prototype,"readOnly",null),e([r()],ie.prototype,"selectedAttachment",null),e([r()],ie.prototype,"selectedAttachmentDetails",null),e([r()],ie.prototype,"valid",null),e([r({type:_}),K(["value-change","submit"])],ie.prototype,"viewModel",void 0),e([r({type:k,nonNullable:!0})],ie.prototype,"visibleElements",void 0),e([r()],ie.prototype,"groupDisplay",void 0),e([r()],ie.prototype,"_attemptFocusOnNextRender",void 0),e([r()],ie.prototype,"_formId",null),e([r()],ie.prototype,"_focusedFieldInput",void 0),e([r()],ie.prototype,"_attachmentDialogInfo",void 0),ie=e([c("esri.widgets.BatchAttributeForm")],ie);const ne=ie;export{ne as default};
|