@arcgis/core 5.1.0-next.105 → 5.1.0-next.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/AreaMeasurementAnalysis.d.ts +5 -5
- package/analysis/DimensionAnalysis.d.ts +3 -3
- package/analysis/DimensionSimpleStyle.d.ts +2 -2
- package/analysis/DirectLineMeasurementAnalysis.d.ts +4 -4
- package/analysis/DistanceMeasurementAnalysis.d.ts +4 -4
- package/analysis/ElevationProfileAnalysis.d.ts +3 -3
- package/analysis/LengthDimension.d.ts +2 -2
- package/analysis/LineOfSightAnalysis.d.ts +4 -4
- package/analysis/ShadowCast/DiscreteOptions.d.ts +7 -3
- package/analysis/ShadowCast/MinDurationOptions.d.ts +5 -1
- package/analysis/ShadowCast/TotalDurationOptions.d.ts +7 -3
- package/analysis/ShadowCast/types.d.ts +1 -1
- package/analysis/ShadowCastAnalysis.d.ts +11 -6
- package/analysis/SliceAnalysis.d.ts +4 -4
- package/analysis/SlicePlane.d.ts +3 -3
- package/analysis/Viewshed.d.ts +2 -2
- package/analysis/ViewshedAnalysis.d.ts +3 -3
- package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +1 -1
- package/analysis/VolumeMeasurementAnalysis.d.ts +3 -3
- package/applications/Components/imageryUtils.d.ts +24 -0
- package/applications/Components/layerUtils.d.ts +21 -0
- package/applications/Components/layerUtils.js +2 -0
- package/applications/Components/templateUtils.d.ts +11 -1
- package/applications/Components/templateUtils.js +1 -1
- package/arcgisGlobal.d.ts +6 -0
- package/assets/components/assets/icon/buttons16.json +1 -0
- package/assets/components/assets/icon/buttons24.json +1 -0
- package/assets/components/assets/icon/buttons32.json +1 -0
- package/assets/components/assets/icon/entityTypes16.json +1 -0
- package/assets/components/assets/icon/entityTypes24.json +1 -0
- package/assets/components/assets/icon/entityTypes32.json +1 -0
- package/assets/esri/core/t9n/Units_ar.json +1 -1
- package/assets/esri/core/t9n/Units_bg.json +1 -1
- package/assets/esri/core/t9n/Units_bs.json +1 -1
- package/assets/esri/core/t9n/Units_ca.json +1 -1
- package/assets/esri/core/t9n/Units_cs.json +1 -1
- package/assets/esri/core/t9n/Units_da.json +1 -1
- package/assets/esri/core/t9n/Units_de.json +1 -1
- package/assets/esri/core/t9n/Units_el.json +1 -1
- package/assets/esri/core/t9n/Units_es.json +1 -1
- package/assets/esri/core/t9n/Units_et.json +1 -1
- package/assets/esri/core/t9n/Units_fi.json +1 -1
- package/assets/esri/core/t9n/Units_fr.json +1 -1
- package/assets/esri/core/t9n/Units_he.json +1 -1
- package/assets/esri/core/t9n/Units_hr.json +1 -1
- package/assets/esri/core/t9n/Units_hu.json +1 -1
- package/assets/esri/core/t9n/Units_id.json +1 -1
- package/assets/esri/core/t9n/Units_it.json +1 -1
- package/assets/esri/core/t9n/Units_ja.json +1 -1
- package/assets/esri/core/t9n/Units_ko.json +1 -1
- package/assets/esri/core/t9n/Units_lt.json +1 -1
- package/assets/esri/core/t9n/Units_lv.json +1 -1
- package/assets/esri/core/t9n/Units_nl.json +1 -1
- package/assets/esri/core/t9n/Units_no.json +1 -1
- package/assets/esri/core/t9n/Units_pl.json +1 -1
- package/assets/esri/core/t9n/Units_pt-BR.json +1 -1
- package/assets/esri/core/t9n/Units_pt-PT.json +1 -1
- package/assets/esri/core/t9n/Units_ro.json +1 -1
- package/assets/esri/core/t9n/Units_ru.json +1 -1
- package/assets/esri/core/t9n/Units_sk.json +1 -1
- package/assets/esri/core/t9n/Units_sl.json +1 -1
- package/assets/esri/core/t9n/Units_sr.json +1 -1
- package/assets/esri/core/t9n/Units_sv.json +1 -1
- package/assets/esri/core/t9n/Units_th.json +1 -1
- package/assets/esri/core/t9n/Units_tr.json +1 -1
- package/assets/esri/core/t9n/Units_uk.json +1 -1
- package/assets/esri/core/t9n/Units_vi.json +1 -1
- package/assets/esri/core/t9n/Units_zh-CN.json +1 -1
- package/assets/esri/core/t9n/Units_zh-HK.json +1 -1
- package/assets/esri/core/t9n/Units_zh-TW.json +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{6854b28853f5dd195110.js → 01c70c27aa3a955e2928.js} +1 -1
- package/assets/esri/core/workers/chunks/{b7a81fd4994eabba1869.js → 0c8e6ccb5a8174718d62.js} +1 -1
- package/assets/esri/core/workers/chunks/{a943bd2e6fb7443c2b66.js → 17604cbd4d24158e2c16.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/{2dced41ff2aa1bd86665.js → 33ec193e6d7a0cb9d8dd.js} +1 -1
- package/assets/esri/core/workers/chunks/340f2c996f62f7f5ceae.js +1 -0
- package/assets/esri/core/workers/chunks/37c63570c0b4981cd519.js +1 -0
- package/assets/esri/core/workers/chunks/{a0e72b107991ba38a9f0.js → 502c3da8c49bf885f51d.js} +1 -1
- package/assets/esri/core/workers/chunks/518046d2b95a7590a092.js +1 -0
- package/assets/esri/core/workers/chunks/547dc6ccb989bd962661.js +1 -0
- package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +2 -0
- package/assets/esri/core/workers/chunks/{9b89cc85c1b5d561df7c.js → 55334ad3618899cdbf78.js} +2 -2
- package/assets/esri/core/workers/chunks/{7485d59d60d61737d662.js → 55b765c72d13b3b911f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{1e8d5bfc5f8c2664190c.js → 56d9d3f108ff6e719dd4.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/69c9eb93553b006b640d.js +2 -0
- package/assets/esri/core/workers/chunks/6d20d741b8ae1a45b422.js +1 -0
- package/assets/esri/core/workers/chunks/702a3ef9e1b3442cbee7.js +1 -0
- package/assets/esri/core/workers/chunks/75a7de23c05435ec7649.js +1 -0
- package/assets/esri/core/workers/chunks/762e23466308f22d7076.js +1 -0
- package/assets/esri/core/workers/chunks/{52219561c144e5cb4442.js → 770611659b38066a6228.js} +1 -1
- package/assets/esri/core/workers/chunks/{e90afd914f2ccd4f5374.js → 7ce60331f94ee0a5d674.js} +6 -6
- package/assets/esri/core/workers/chunks/825db2ea15308ee6e5dc.js +1 -0
- package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +1 -0
- package/assets/esri/core/workers/chunks/{7617bd0f3a70dfe61637.js → 8557dd9ef336b23f768f.js} +1 -1
- 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/9234a293d61e134f121f.js +1 -0
- package/assets/esri/core/workers/chunks/{44636ef119c6a576470b.js → 94eab215bab3e4e0e5b5.js} +1 -1
- package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +1 -0
- package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +1 -0
- package/assets/esri/core/workers/chunks/{fb415b01f0f1d644832d.js → ac408c62565e2c8b5975.js} +1 -1
- package/assets/esri/core/workers/chunks/b3e8ab68fc38306f13c6.js +1 -0
- package/assets/esri/core/workers/chunks/b69d1d528e271568cbd8.js +2 -0
- package/assets/esri/core/workers/chunks/{0cc74bc3772be51cabc1.js → bbaf8baa3ca6195467e4.js} +1 -1
- package/assets/esri/core/workers/chunks/{f7e386ece75afb6e4be5.js → bc249bb667f0564ad093.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/{39a8e6c9d710d3faea3c.js → cdb48d198145493f76f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{359dbfbfb9acfb18bc6e.js → d4014213c476bf8099af.js} +1 -1
- package/assets/esri/core/workers/chunks/da29cf0e64065631a470.js +1 -0
- 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/fc1fe1f58a65a1694c09.js +1 -0
- package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +84 -1
- package/assets/esri/themes/base/widgets/_Sketch.scss +1 -24
- 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_ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
- package/chunks/ComponentShader.glsl.js +11 -15
- package/chunks/Fog.glsl.js +3 -3
- package/chunks/GlowComposition.glsl.js +38 -56
- package/chunks/OITDimOpaque.glsl.js +8 -3
- package/chunks/SimpleAtmosphere.glsl.js +3 -3
- package/chunks/lyr3DWorker.js +1 -1
- package/chunks/pe-wasm.js +1 -1
- package/config.js +1 -1
- package/core/generatorUtils.js +2 -0
- package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
- package/core/libs/gl-matrix-2/math/vec2.js +1 -1
- package/core/mathUtils.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/geometry/HeightModelInfo.js +1 -1
- package/geometry/geometryEngine.d.ts +2 -2
- package/geometry/support/WKIDUnitConversion.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/vcsData.js +1 -1
- package/geometry/support/vcsLookup.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/kernel.js +1 -1
- package/layers/DimensionLayer.d.ts +5 -5
- package/layers/FeatureLayer.d.ts +2 -2
- package/layers/GaussianSplatLayer.d.ts +3 -3
- package/layers/LineOfSightLayer.d.ts +5 -5
- package/layers/ParquetLayer.d.ts +6 -4
- package/layers/SubtypeGroupLayer.d.ts +2 -2
- package/layers/ViewshedLayer.d.ts +3 -3
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/graphics/sources/parquet/FileProvider.js +2 -0
- package/layers/graphics/sources/parquet/PortalParquetFileProvider.js +2 -0
- package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +2 -0
- package/layers/graphics/sources/parquet/UrlsFileProvider.js +2 -0
- package/layers/graphics/sources/parquet/createFileProvider.js +2 -0
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +1 -1
- package/layers/raster/datasets/MRFRaster.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/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 +4 -4
- 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/CircuitVerifyResult.js +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/circuits/support/VerifyCircuitsResult.js +1 -1
- package/rest/networks/support/TraceParameters.js +1 -1
- package/rest/networks/support/TraceResult.js +1 -1
- package/rest/networks/trace.js +1 -1
- package/rest/networks/unitIdentifiers/support/QueryUnitIdentifiersParameters.js +1 -1
- package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
- package/rest/support/GeneralizeParameters.d.ts +1 -1
- package/rest/support/Query.d.ts +1 -1
- package/rest/support/RelationParameters.d.ts +1 -1
- package/rest/support/types.d.ts +1 -1
- package/support/revision.js +1 -1
- package/symbols/CIMSymbol.d.ts +1 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +1 -0
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ParquetSnapshotSourceChunk.js +1 -1
- package/views/2d/layers/features/sources/strategies/chunks/ParquetSourceChunk.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.d.ts +1 -0
- package/views/3d/analysis/DimensionAnalysisView3D.d.ts +7 -6
- package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.d.ts +2 -0
- package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +2 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +5 -1
- package/views/3d/analysis/SliceAnalysisView3D.d.ts +4 -3
- package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
- 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/environment/FoggyWeather.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/i3s/Intersector.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/ResourceController.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
- package/views/3d/support/meshProcessing.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +8 -8
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +13 -9
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +63 -49
- package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/AttributeArray.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/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/shaders/SphereDepthInterpolate.glsl.js +2 -3
- package/views/PopupView.d.ts +77 -1
- package/views/PopupView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/DrawTool.d.ts +77 -0
- package/views/draw/support/editingSessionUtils.js +1 -1
- package/views/draw/support/managers/PluginLifecycleManager.d.ts +10 -0
- package/views/interactive/InteractiveToolBase.d.ts +11 -0
- package/views/interactive/editGeometry/interfaces.d.ts +8 -0
- package/views/interactive/interfaces.d.ts +20 -0
- package/views/layers/DimensionLayerView.d.ts +2 -1
- package/views/layers/LineOfSightLayerView.d.ts +2 -1
- package/views/layers/ViewshedLayerView.d.ts +2 -1
- package/views/webgl/capabilities/load.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/Attachments/types.d.ts +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +38 -5
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveContingentValuesManager.js +2 -0
- package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
- package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +11 -0
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +77 -0
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/interfaceUtils.js +2 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/types.d.ts +30 -2
- package/widgets/BatchAttributeForm.d.ts +52 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +9 -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/Sketch/SketchViewModel.d.ts +67 -2
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/VisibleElements.d.ts +19 -1
- package/widgets/Sketch/VisibleElements.js +1 -1
- package/widgets/Sketch/support/OperationHandle.js +1 -1
- package/widgets/Sketch/support/PluginManager.d.ts +12 -0
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/TimeSlider.d.ts +3 -3
- package/widgets/VideoPlayer/VideoPlayerViewModel.d.ts +10 -0
- package/widgets/VideoPlayer/VideoPlayerViewModel.js +1 -1
- package/widgets/support/ContingentValuesManager.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +81 -0
- package/widgets/support/SelectionToolbar/types.d.ts +4 -0
- package/widgets/support/forms/formUtils.js +1 -1
- package/assets/esri/core/workers/chunks/11b0d3a825fe50dd1e84.js +0 -1
- package/assets/esri/core/workers/chunks/130851b81f04e6a008cd.js +0 -1
- package/assets/esri/core/workers/chunks/1a3426276dc82a8a80f2.js +0 -1
- package/assets/esri/core/workers/chunks/1c8a21b7b60c0709e6b2.js +0 -1
- package/assets/esri/core/workers/chunks/24247ee93f43fff5e596.js +0 -2
- package/assets/esri/core/workers/chunks/276cb6a1cdd26d0e1444.js +0 -1
- package/assets/esri/core/workers/chunks/2b3a8a53cd68f666676b.js +0 -1
- package/assets/esri/core/workers/chunks/2ecb21c402cdd8c82533.js +0 -1
- package/assets/esri/core/workers/chunks/2f903bd3a2611e7f0946.js +0 -30
- package/assets/esri/core/workers/chunks/2fda38219d778f0447b5.js +0 -1
- package/assets/esri/core/workers/chunks/38d7430d2370b69334d7.js +0 -1
- package/assets/esri/core/workers/chunks/39d6032d79720935910d.js +0 -1
- package/assets/esri/core/workers/chunks/5dafd35801dca4229aed.js +0 -1
- package/assets/esri/core/workers/chunks/642be1619c0e76355cb6.js +0 -1
- package/assets/esri/core/workers/chunks/6d66dc77af8d112c33c6.js +0 -1
- package/assets/esri/core/workers/chunks/7b3642195d6d3ea9b830.js +0 -1
- package/assets/esri/core/workers/chunks/7e57029ec958f6423d5d.js +0 -2
- package/assets/esri/core/workers/chunks/8042e001545e2782499c.js +0 -1
- package/assets/esri/core/workers/chunks/855bf811cd79b97c169a.js +0 -1
- package/assets/esri/core/workers/chunks/881234f25c7814de8753.js +0 -1
- package/assets/esri/core/workers/chunks/8a7682071941c35f05c1.js +0 -1
- package/assets/esri/core/workers/chunks/8fdd57e2a0af647f1e3e.js +0 -1
- package/assets/esri/core/workers/chunks/90ea570f6b6ce8ca693b.js +0 -1
- package/assets/esri/core/workers/chunks/9373daa677dc767d7cf0.js +0 -1
- package/assets/esri/core/workers/chunks/95df6d2ebacc43ac5fa3.js +0 -1
- package/assets/esri/core/workers/chunks/a02ebdcb802d128c8eee.js +0 -1
- package/assets/esri/core/workers/chunks/adf72d87f0114aeade0e.js +0 -1
- package/assets/esri/core/workers/chunks/aec4a4cd7044fdbbbe34.js +0 -1
- package/assets/esri/core/workers/chunks/b1a21a4d7d73ad7d0e47.js +0 -1
- package/assets/esri/core/workers/chunks/b262478da29470abb72b.js +0 -2
- package/assets/esri/core/workers/chunks/b75e090a7e935ff870a3.js +0 -1
- package/assets/esri/core/workers/chunks/bacf0c9d5d3e084dea61.js +0 -1
- package/assets/esri/core/workers/chunks/c0e4fd6fa1d765275248.js +0 -2
- package/assets/esri/core/workers/chunks/cfaa6e205bfc0c94a1b1.js +0 -1
- package/assets/esri/core/workers/chunks/d3f08f1a9a250cd8a2c8.js +0 -1
- package/assets/esri/core/workers/chunks/dcb7a3ff59677b1cf0f1.js +0 -1
- /package/assets/esri/core/workers/chunks/{7e57029ec958f6423d5d.js.LICENSE.txt → 549d348ca181d06aefb7.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{9b89cc85c1b5d561df7c.js.LICENSE.txt → 55334ad3618899cdbf78.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{b262478da29470abb72b.js.LICENSE.txt → 69c9eb93553b006b640d.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{c0e4fd6fa1d765275248.js.LICENSE.txt → b69d1d528e271568cbd8.js.LICENSE.txt} +0 -0
|
@@ -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};
|
|
@@ -8,6 +8,7 @@ import type Conversion from "./support/Conversion.js";
|
|
|
8
8
|
import type Format from "./support/Format.js";
|
|
9
9
|
import type { ReadonlyArrayOrCollection } from "../../core/Collection.js";
|
|
10
10
|
import type { EventedAccessor } from "../../core/Evented.js";
|
|
11
|
+
import type { LengthUnit } from "../../core/units.js";
|
|
11
12
|
import type { MapViewOrSceneView } from "../../views/MapViewOrSceneView.js";
|
|
12
13
|
import type { Mode, Position } from "../types.js";
|
|
13
14
|
import type { ConversionProperties } from "./support/Conversion.js";
|
|
@@ -19,7 +20,7 @@ import type { PointSymbol3DProperties } from "../../symbols/PointSymbol3D.js";
|
|
|
19
20
|
import type { PictureMarkerSymbolProperties } from "../../symbols/PictureMarkerSymbol.js";
|
|
20
21
|
import type { SimpleMarkerSymbolProperties } from "../../symbols/SimpleMarkerSymbol.js";
|
|
21
22
|
|
|
22
|
-
export interface CoordinateConversionViewModelProperties extends GoToProperties, Partial<Pick<CoordinateConversionViewModel, "calculateCoordinatePrecision" | "mode" | "removeLeadingZeros" | "storageEnabled" | "storageType" | "view">> {
|
|
23
|
+
export interface CoordinateConversionViewModelProperties extends GoToProperties, Partial<Pick<CoordinateConversionViewModel, "calculateCoordinatePrecision" | "mode" | "removeLeadingZeros" | "storageEnabled" | "storageType" | "verticalUnit" | "view">> {
|
|
23
24
|
/**
|
|
24
25
|
* A [Collection](https://developers.arcgis.com/javascript/latest/references/core/core/Collection/) containing every [Conversion](https://developers.arcgis.com/javascript/latest/references/core/widgets/CoordinateConversion/support/Conversion/)
|
|
25
26
|
* that is currently displaying.
|
|
@@ -150,6 +151,13 @@ export default class CoordinateConversionViewModel extends CoordinateConversionV
|
|
|
150
151
|
* @see [Window.localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage)
|
|
151
152
|
*/
|
|
152
153
|
accessor storageType: "session" | "local";
|
|
154
|
+
/**
|
|
155
|
+
* The user-selected vertical unit used to display the elevation of the current location when available
|
|
156
|
+
*
|
|
157
|
+
* @internal
|
|
158
|
+
* @since 5.1
|
|
159
|
+
*/
|
|
160
|
+
accessor verticalUnit: LengthUnit | undefined;
|
|
153
161
|
/** A reference to the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/). Set this to link to a specific view. */
|
|
154
162
|
accessor view: MapViewOrSceneView | null | undefined;
|
|
155
163
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{getAssetUrl as e}from"../../assets.js";import o from"../../Graphic.js";import{onLocaleChange as i,getLocale as s,fetchMessageBundle as r}from"../../intl.js";import n from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as h}from"../../core/Evented.js";import c from"../../core/Logger.js";import{watch as d,initial as l,when as m,whenOnce as v}from"../../core/reactiveUtils.js";import{property as p,subclass as u}from"../../core/accessorSupport/decorators.js";import{ensureType as g}from"../../core/accessorSupport/ensureType.js";import f from"../../geometry/Point.js";import{load as w}from"../../geometry/projectionUtils.js";import _ from"../../symbols/PictureMarkerSymbol.js";import{pointSymbolTypes as y}from"../../symbols/support/typeUtils.js";import C from"./support/Conversion.js";import{isValidPoint as b,isSupportedNotation as L}from"./support/coordinateConversionUtils.js";import P from"./support/Format.js";import{generateDefaultFormats as M,setDefaultPatterns as F}from"./support/formatUtils.js";import{GoTo as S}from"../support/GoTo.js";const j=new f([0,0,500]),H="xy",x=["mgrs","utm","usng","dd","dms","ddm"],G="esri__coordinateConversionWidgetState",E={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change",cursor:"cursor"},W="esri/images/search/search-symbol-32.png";let U=class extends(S(h)){constructor(t){super(t),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.calculateCoordinatePrecision=!0,this.formats=new n,this.formatterAvailable=!1,this.formatterLoading=!0,this.messages=null,this.filteredFormats=new n,this.locationSymbol=new _({url:e(W),width:24,height:24}),this.removeLeadingZeros=!1,this.storageEnabled=!0,this.storageType="session",this.view=null,this._saveWidgetState=this._saveWidgetState.bind(this),this._handleFormatChange=this._handleFormatChange.bind(this),this._handleConversionChange=this._handleConversionChange.bind(this),this._handleViewChange=this._handleViewChange.bind(this),this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this.conversions=new n}initialize(){const t=async()=>this.messages=await r("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(M()),t().then(()=>{this.destroyed||(F(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach(t=>{t.viewModel=this,this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format")}),this.addHandles(this.conversions.on("change",this._handleConversionChange),E.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),E.formats),this.addHandles(i(()=>{t().then(()=>{F(this.messages,this.formats)})})),w().then(()=>{this.formatterAvailable=!0}).catch(t=>{c.getLogger(this).error(new a("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:t})),this.formatterAvailable=!1,this._filterFormatsAndConversions()}).then(()=>this.addHandles(d(()=>this.view,this._handleViewChange,l),E.viewChange)).finally(()=>this.formatterLoading=!1),0===this.conversions.length&&this._addDefaultConversion())})}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}get conversions(){return this._get("conversions")}set conversions(t){const e=new n;t.forEach(t=>{let o=null;if("string"==typeof t){const e=this.formats.find(e=>e.name===t);e&&(o=new C({format:e}))}else o=g(C,t);o&&e.add(o)}),this._set("conversions",e)}set currentLocation(t){this._set("currentLocation",t),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(t){switch(t){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",t);break;case"live":this._startLiveMode(),this._set("mode",t);break;case"idle":this.removeHandles(E.view),this.removeHandles(E.cursor),this._set("mode",t)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:t,view:e}=this,o=e?.ready;return t?o?"ready":e?"loading":"disabled":"disabled"}get storage(){return"session"===this.storageType?sessionStorage:localStorage}get waitingForConversions(){return null!=this._conversionPromise}setLocation(t){this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),t&&(this._locationGraphic=new o({geometry:t.clone(),symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic))}async convert(t,e){if(!b(e))throw new a("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:e});return await this._waitForFormatter(),Promise.resolve().then(()=>t.convert(e))}async goToLocation(t){const{view:e}=this;if(!e)throw new a("coordinate-conversion:go-to-failed","no view");const o="3d"===e.type?e.clippingArea:null,i=e.map?.basemap?.baseLayers;if(o||(i?.length??0)>0){const e=o??i?.at(0)?.fullExtent;if(null!=e&&!e.contains(t))throw new a("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:t})}return this.callGoTo({target:t})}pause(){this.currentLocation=null,this.removeHandles(E.view),this.view&&(this.removeHandles(E.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(t,e=this.currentLocation||j){return(await A(t,e)).displayCoordinate}resume(){const{mode:t}=this;"capture"===t?this._startCaptureMode():this._startLiveMode()}async reverseConvert(t,e){return await this._waitForFormatter(),e.reverseConvert(t)}async updateConversions(t,e){if(await this._waitForFormatter(),"point"!==e?.type)throw this._clearConversions(this.conversions),new a("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:e});return this._convertMany(t,e)}_addDefaultConversion(){const t=this.formats.find(t=>t.name===H)||this.formats.at(0);t&&this.conversions.add(new C({format:t}))}_cleanUpView(t){t&&(this._locationGraphic&&t.graphics.remove(this._locationGraphic),this.removeHandles(E.view),this.removeHandles(E.cursor))}_clearConversions(t){t.forEach(t=>{t.position={location:null,coordinate:null}})}async _convertMany(t,e){return Promise.all(t.map(t=>A(t,e)))}_handleConversionChange(t){for(const e of t.added){const{format:t}=e;t&&(t.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(t,this.currentLocation).then(t=>{e.position=t,this._set("waitingForConversions",!1)})))}this._saveWidgetState()}_handleFormatChange(t){t.added.forEach(t=>{this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format"),t.viewModel=this}),t.removed.forEach(t=>{t.viewModel=null;const e=this.conversions.filter(e=>e.format===t);this.conversions.removeMany(e),t.name&&this.removeHandles(t.name)}),0===this.conversions.length&&this._addDefaultConversion()}_loadWidgetState(){try{const t=JSON.parse(this.storage.getItem(G));t&&this._setWidgetState(t)}catch(t){c.getLogger(this).error(new a("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:t}))}}_startCaptureMode(){this.removeHandles(E.view),this.view&&(this.currentLocation&&this.setLocation(this.currentLocation),this.removeHandles(E.cursor),this.addHandles(this.view.acquireCursor("crosshair","high"),E.cursor),this.addHandles(this.view.on("click",this._onClick),E.view))}_startLiveMode(){this._pointerCount=0,this.removeHandles(E.view),this.view&&(this.removeHandles(E.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic),this.addHandles([this.view.on("pointer-down",this._onPointerDown),this.view.on("pointer-up",this._onPointerUp),this.view.on("pointer-move",this._onPointerMove)],E.view))}_handleViewChange(t,e){e&&e!==t&&this._cleanUpView(e),t&&("capture"===this.mode?this._startCaptureMode():"live"===this.mode&&this._startLiveMode(),e&&this._filterFormatsAndConversions())}_onClick(t){if(0===t.button){const e=this.view?.toMap(t,{exclude:[]}),o=e?.normalize();this.setLocation(o),this.currentLocation=o}}_onPointerDown(t){const{pointerType:e}=t;if(this._pointerCount++,("touch"===e||"pen"===e)&&1===this._pointerCount){const e=this.view?.toMap(t,{exclude:[]});this.currentLocation=e?.normalize()}}_onPointerMove(t){const{pointerType:e}=t;if("mouse"===e||1===this._pointerCount){const e=this.view?.toMap(t,{exclude:[]});this.currentLocation=e?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(t){try{t.formats.forEach(e=>{const o=this.formats.find(t=>t.name===e.name);o&&t.locale===s()&&e.currentPattern&&(o.currentPattern=e.currentPattern),o&&e.index>=0&&this.conversions.add(new C({format:o}))})}catch(e){c.getLogger(this).warn(new a("coordinate-conversion:session-storage-read-error","Could not get state from stored JSON.",{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;const t=this._toJSON();try{this.storage.setItem(G,JSON.stringify({formats:t,locale:s()}))}catch(e){c.getLogger(this).error(new a("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_toJSON(){return this.formats.filter(t=>{const e=t.name;return"xy"===e||"basemap"===e||L(e)}).map(t=>({name:t.name,currentPattern:t.currentPattern,defaultPattern:t.defaultPattern,index:this.conversions.findIndex(e=>e.format===t)})).sort((t,e)=>t.index-e.index).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:t,conversions:e,formats:o}=this;t||this.addHandles(m(()=>this.view?.spatialReference,t=>{const i=t.isWebMercator||t.isWGS84,s=o.filter(t=>{const{name:e}=t;return!!T(e)||"xy"===e&&!i}),r=this.filteredFormats.filter(t=>"xy"===t.name&&i&&!this.formats.includes(t)),n=e.filter(t=>s.includes(t.format));o.removeMany(s),e.removeMany(n),this.filteredFormats.addMany(s.filter(t=>!this.filteredFormats.includes(t))),o.addMany(r)},{once:!0,initial:!0}),E.view)}async _waitForFormatter(){this.formatterLoading&&await v(()=>!1===this.formatterLoading)}};async function A(t,e){try{t.position=await(t.format?.convert(e))}catch(o){t.position=null}return t}function T(t){return x.includes(t)}t([p()],U.prototype,"calculateCoordinatePrecision",void 0),t([p()],U.prototype,"conversions",null),t([p({type:f})],U.prototype,"currentLocation",null),t([p({type:n.ofType(P)})],U.prototype,"formats",void 0),t([p()],U.prototype,"formatterLoading",void 0),t([p()],U.prototype,"messages",void 0),t([p()],U.prototype,"mode",null),t([p()],U.prototype,"filteredFormats",void 0),t([p({readOnly:!0})],U.prototype,"state",null),t([p({types:y})],U.prototype,"locationSymbol",void 0),t([p()],U.prototype,"removeLeadingZeros",void 0),t([p({readOnly:!0})],U.prototype,"storage",null),t([p()],U.prototype,"storageEnabled",void 0),t([p()],U.prototype,"storageType",void 0),t([p({readOnly:!0})],U.prototype,"waitingForConversions",null),t([p()],U.prototype,"view",void 0),U=t([u("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],U);const k=U;export{k as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import{getAssetUrl as e}from"../../assets.js";import o from"../../Graphic.js";import{onLocaleChange as i,getLocale as s,fetchMessageBundle as r}from"../../intl.js";import n from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as h}from"../../core/Evented.js";import c from"../../core/Logger.js";import{watch as d,initial as l,when as m,whenOnce as v}from"../../core/reactiveUtils.js";import{property as p,subclass as u}from"../../core/accessorSupport/decorators.js";import{ensureType as f}from"../../core/accessorSupport/ensureType.js";import g from"../../geometry/Point.js";import{load as w}from"../../geometry/projectionUtils.js";import _ from"../../symbols/IconSymbol3DLayer.js";import y from"../../symbols/PictureMarkerSymbol.js";import C from"../../symbols/PointSymbol3D.js";import{pointSymbolTypes as b}from"../../symbols/support/typeUtils.js";import L from"./support/Conversion.js";import{isValidPoint as M,isSupportedNotation as P}from"./support/coordinateConversionUtils.js";import S from"./support/Format.js";import{generateDefaultFormats as F,setDefaultPatterns as j}from"./support/formatUtils.js";import{GoTo as H}from"../support/GoTo.js";const U=new g([0,0,500]),x="xy",G=["mgrs","utm","usng","dd","dms","ddm"],W="esri__coordinateConversionWidgetState",E={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change",cursor:"cursor"},A="esri/images/search/search-symbol-32.png";let T=class extends(H(h)){constructor(t){super(t),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.calculateCoordinatePrecision=!0,this.formats=new n,this.formatterAvailable=!1,this.formatterLoading=!0,this.messages=null,this.filteredFormats=new n,this.removeLeadingZeros=!1,this.storageEnabled=!0,this.storageType="session",this.view=null,this._saveWidgetState=this._saveWidgetState.bind(this),this._handleFormatChange=this._handleFormatChange.bind(this),this._handleConversionChange=this._handleConversionChange.bind(this),this._handleViewChange=this._handleViewChange.bind(this),this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this.conversions=new n}initialize(){const t=async()=>this.messages=await r("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(F()),t().then(()=>{this.destroyed||(j(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach(t=>{t.viewModel=this,this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format")}),this.addHandles(this.conversions.on("change",this._handleConversionChange),E.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),E.formats),this.addHandles(d(()=>this.verticalUnit,this._saveWidgetState)),this.addHandles(i(()=>{t().then(()=>{j(this.messages,this.formats)})})),w().then(()=>{this.formatterAvailable=!0}).catch(t=>{c.getLogger(this).error(new a("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:t})),this.formatterAvailable=!1,this._filterFormatsAndConversions()}).then(()=>this.addHandles(d(()=>this.view,this._handleViewChange,l),E.viewChange)).finally(()=>this.formatterLoading=!1),0===this.conversions.length&&this._addDefaultConversion())})}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}get conversions(){return this._get("conversions")}set conversions(t){const e=new n;t.forEach(t=>{let o=null;if("string"==typeof t){const e=this.formats.find(e=>e.name===t);e&&(o=new L({format:e}))}else o=f(L,t);o&&e.add(o)}),this._set("conversions",e)}set currentLocation(t){this._set("currentLocation",t),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(t){switch(t){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",t);break;case"live":this._startLiveMode(),this._set("mode",t);break;case"idle":this.removeHandles(E.view),this.removeHandles(E.cursor),this._set("mode",t)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:t,view:e}=this,o=e?.ready;return t?o?"ready":e?"loading":"disabled":"disabled"}get locationSymbol(){const t=this._userLocationSymbol;if(t)return t;const o=e(A);return"3d"===this.view?.type?new C({symbolLayers:new n([new _({occludedVisibility:{mode:"visible"},resource:{href:o},size:24})])}):new y({url:o,width:24,height:24})}set locationSymbol(t){this._userLocationSymbol=t}get storage(){return"session"===this.storageType?sessionStorage:localStorage}get waitingForConversions(){return null!=this._conversionPromise}setLocation(t){this._locationGraphic&&this.view?.graphics.remove(this._locationGraphic),t&&(this._locationGraphic=new o({geometry:t.clone(),symbol:this.locationSymbol}),this.view?.graphics.add(this._locationGraphic))}async convert(t,e){if(!M(e))throw new a("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:e});return await this._waitForFormatter(),Promise.resolve().then(()=>t.convert(e))}async goToLocation(t){const{view:e}=this;if(!e)throw new a("coordinate-conversion:go-to-failed","no view");const o="3d"===e.type?e.clippingArea:null,i=e.map?.basemap?.baseLayers;if(o||(i?.length??0)>0){const e=o??i?.at(0)?.fullExtent;if(null!=e&&!e.contains(t))throw new a("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:t})}return this.callGoTo({target:t})}pause(){this.currentLocation=null,this.removeHandles(E.view),this.view&&(this.removeHandles(E.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(t,e=this.currentLocation||U){return(await D(t,e)).displayCoordinate}resume(){const{mode:t}=this;"capture"===t?this._startCaptureMode():this._startLiveMode()}async reverseConvert(t,e){return await this._waitForFormatter(),e.reverseConvert(t)}async updateConversions(t,e){if(await this._waitForFormatter(),"point"!==e?.type)throw this._clearConversions(this.conversions),new a("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:e});return this._convertMany(t,e)}_addDefaultConversion(){const t=this.formats.find(t=>t.name===x)||this.formats.at(0);t&&this.conversions.add(new L({format:t}))}_cleanUpView(t){t&&(this._locationGraphic&&t.graphics.remove(this._locationGraphic),this.removeHandles(E.view),this.removeHandles(E.cursor))}_clearConversions(t){t.forEach(t=>{t.position={location:null,coordinate:null}})}async _convertMany(t,e){return Promise.all(t.map(t=>D(t,e)))}_handleConversionChange(t){for(const e of t.added){const{format:t}=e;t&&(t.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(t,this.currentLocation).then(t=>{e.position=t,this._set("waitingForConversions",!1)})))}this._saveWidgetState()}_handleFormatChange(t){t.added.forEach(t=>{this.addHandles(d(()=>t.currentPattern,this._saveWidgetState),t.name??"unnamed-format"),t.viewModel=this}),t.removed.forEach(t=>{t.viewModel=null;const e=this.conversions.filter(e=>e.format===t);this.conversions.removeMany(e),t.name&&this.removeHandles(t.name)}),0===this.conversions.length&&this._addDefaultConversion()}_loadWidgetState(){try{const t=JSON.parse(this.storage.getItem(W));t&&this._setWidgetState(t)}catch(t){c.getLogger(this).error(new a("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:t}))}}_startCaptureMode(){this.removeHandles(E.view),this.view&&(this.currentLocation&&this.setLocation(this.currentLocation),this.removeHandles(E.cursor),this.addHandles(this.view.acquireCursor("crosshair","high"),E.cursor),this.addHandles(this.view.on("click",this._onClick),E.view))}_startIdleMode(){this.removeHandles(E.view),this.removeHandles(E.cursor),this.view&&this.currentLocation&&this.setLocation(this.currentLocation)}_startLiveMode(){this._pointerCount=0,this.removeHandles(E.view),this.view&&(this.removeHandles(E.cursor),this._locationGraphic&&this.view.graphics.remove(this._locationGraphic),this.addHandles([this.view.on("pointer-down",this._onPointerDown),this.view.on("pointer-up",this._onPointerUp),this.view.on("pointer-move",this._onPointerMove)],E.view))}_handleViewChange(t,e){if(e&&e!==t&&this._cleanUpView(e),t){const{mode:t}=this;"capture"===t?this._startCaptureMode():"live"===t?this._startLiveMode():"idle"===t&&this._startIdleMode(),e&&this._filterFormatsAndConversions()}}_onClick(t){if(0===t.button){const e=this.view?.toMap(t,{exclude:[]}),o=e?.normalize();this.setLocation(o),this.currentLocation=o}}_onPointerDown(t){const{pointerType:e}=t;if(this._pointerCount++,("touch"===e||"pen"===e)&&1===this._pointerCount){const e=this.view?.toMap(t,{exclude:[]});this.currentLocation=e?.normalize()}}_onPointerMove(t){const{pointerType:e}=t;if("mouse"===e||1===this._pointerCount){const e=this.view?.toMap(t,{exclude:[]});this.currentLocation=e?.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(t){try{this.verticalUnit=t.verticalUnit,t.formats.forEach(e=>{const o=this.formats.find(t=>t.name===e.name);o&&t.locale===s()&&e.currentPattern&&(o.currentPattern=e.currentPattern),o&&e.index>=0&&this.conversions.add(new L({format:o}))})}catch(e){c.getLogger(this).warn(new a("coordinate-conversion:session-storage-read-error","Could not get state from stored JSON.",{error:e}))}}_saveWidgetState(){if(!this.storageEnabled)return;const t=this._getFormatsJson();try{this.storage.setItem(W,JSON.stringify({formats:t,locale:s(),verticalUnit:this.verticalUnit}))}catch(e){c.getLogger(this).error(new a("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:e}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_getFormatsJson(){return this.formats.filter(t=>{const e=t.name;return"xy"===e||"basemap"===e||P(e)}).map(t=>({name:t.name,currentPattern:t.currentPattern,defaultPattern:t.defaultPattern,index:this.conversions.findIndex(e=>e.format===t)})).sort((t,e)=>t.index-e.index).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:t,conversions:e,formats:o}=this;t||this.addHandles(m(()=>this.view?.spatialReference,t=>{const i=t.isWebMercator||t.isWGS84,s=o.filter(t=>{const{name:e}=t;return!!V(e)||"xy"===e&&!i}),r=this.filteredFormats.filter(t=>"xy"===t.name&&i&&!this.formats.includes(t)),n=e.filter(t=>s.includes(t.format));o.removeMany(s),e.removeMany(n),this.filteredFormats.addMany(s.filter(t=>!this.filteredFormats.includes(t))),o.addMany(r)},{once:!0,initial:!0}),E.view)}async _waitForFormatter(){this.formatterLoading&&await v(()=>!1===this.formatterLoading)}};async function D(t,e){try{t.position=await(t.format?.convert(e))}catch(o){t.position=null}return t}function V(t){return G.includes(t)}t([p({types:b})],T.prototype,"_userLocationSymbol",void 0),t([p()],T.prototype,"calculateCoordinatePrecision",void 0),t([p()],T.prototype,"conversions",null),t([p({type:g})],T.prototype,"currentLocation",null),t([p({type:n.ofType(S)})],T.prototype,"formats",void 0),t([p()],T.prototype,"formatterLoading",void 0),t([p()],T.prototype,"messages",void 0),t([p()],T.prototype,"mode",null),t([p()],T.prototype,"filteredFormats",void 0),t([p({readOnly:!0})],T.prototype,"state",null),t([p({types:b})],T.prototype,"locationSymbol",null),t([p()],T.prototype,"removeLeadingZeros",void 0),t([p({readOnly:!0})],T.prototype,"storage",null),t([p()],T.prototype,"storageEnabled",void 0),t([p()],T.prototype,"storageType",void 0),t([p()],T.prototype,"verticalUnit",void 0),t([p({readOnly:!0})],T.prototype,"waitingForConversions",null),t([p()],T.prototype,"view",void 0),T=t([u("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],T);const k=T;export{k as default};
|
package/widgets/Editor.d.ts
CHANGED
|
@@ -237,7 +237,7 @@ export interface EditorEvents extends EditorViewModelEvents {}
|
|
|
237
237
|
* Select the layer containing the feature to form an association with, then select a feature within that layer.
|
|
238
238
|
*
|
|
239
239
|
* The layers and features shown in the list are those that are compatible with the selected feature and
|
|
240
|
-
* association type based on [utility network rules](https://
|
|
240
|
+
* association type based on [utility network rules](https://doc.esri.com/en/arcgis-pro/latest/help/data/utility-network/network-rules.html).
|
|
241
241
|
*
|
|
242
242
|
* After choosing a feature to form the association with, settings specific to the association type can be
|
|
243
243
|
* configured, e.g., midspan location for [connectivity associations](https://pro.arcgis.com/en/pro-app/latest/help/data/utility-network/connectivity.htm).
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{on as i,sync as n}from"../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as a}from"../../editing/fieldUtils.js";import{convertDateFormatToIntlOptions as r,defaultFormatterOptionsNoTime as s,convertDateTimeFieldFormatToIntlOptions as u,defaultFormatterOptions as d}from"../../intl/date.js";import{formatNumber as p,convertNumberFormatToIntlOptions as m,convertNumberFieldFormatToIntlOptions as c}from"../../intl/number.js";import{isEditableLayer as h}from"../../layers/support/editableLayers.js";import{computeDomainFromTypes as f}from"../../layers/support/featureLayerUtils.js";import g from"../../layers/support/Field.js";import{defaultFieldFormat as y}from"../../layers/support/fieldFormatUtils.js";import{validateFieldValue as v,isDateField as F,isTimeOnlyField as b,isIntegerField as _,isNumericField as C,isStringField as D,isDateOnlyField as I,isTimestampOffsetField as x}from"../../layers/support/fieldUtils.js";import{isAnyDateField as V}from"../../smartMapping/support/utils.js";import{system as O}from"../../time/constants.js";import{getTimeZoneFormattingOptions as T}from"../../time/timeZoneUtils.js";import w from"../FeatureForm/FieldInput.js";import E from"./Grid/EditorColumn.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as Z,isEmptyStringOrWhitespace as L}from"./support/tableUtils.js";import{valueIsInRange as j,dateTimeIsInRange as R,getUnixFieldValueFromDateComponents as N,getISOFieldValueFromDateComponents as S,normalizeTimeOnlyString as U,getLabelForDateFieldValue as A,prepareISOFieldValueForDateComponents as q,prepareUnixFieldValueForDateComponents as B}from"../support/dateUtils.js";import{setFocus as H,selectText as k}from"../support/widgetUtils.js";const P={cancelEdit:"Escape"},z=Symbol(),G="esri-column",W={input:`${G}__cell-input`,inputContainer:`${G}__cell__input-container`};let M=class extends E{constructor(e){super(e),this._activeFieldInput=null,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this;if(n&&t){const{index:o,item:{attachments:l,feature:a,relatedRecords:r}}=t;return n({attachments:l,column:this,feature:a,field:this.field,index:o,relatedRecords:r,value:this.sanitizeContent(i),virtualIndex:this.getVirtualRowIndex(e)})}if(null===i)return" ";const o=this._getDomainForFeature(t?.item?.feature),l=this._getComputedDomain(i,o)||i;return this._isAnyDateOrTimeField&&"coded-value"!==o?.type?this._formatDateValueForDisplay(this.field,l):this._isNumericField&&"coded-value"!==o?.type?p(parseFloat(l),this._numberFormatOptions):this.sanitizeContent(l)},this.cellValueValidatorFunction=({oldValue:e,value:i})=>{const{_effectiveRange:n,field:o}=this,{max:l,min:a}=n;if(this.effectiveRequired&&(null==i||""===i))return!1;if(this._isNumericField&&(v(o,i)||!j({max:l,min:a,value:i})))return t.getLogger(this).warn("value-exceeds-valid-range","Field value exceeds valid range. Attempted edit was rejected."),!1;if(this._isAnyDateOrTimeField){const e=o.type;if(!R({type:e,range:n,value:i}))return!1}return e!==i},this.field=null,this.formatFunction=null,this.inputRenderFunction=async({root:e,column:i,rowData:n})=>{if(this.editInfo||!this.effectiveEditable||!n)return;const o=n.item.feature,l=o.getObjectId();if(!o||null==l)return;if(this.tableHasInvalidPendingEdits&&!this.itemHasInvalidPendingEdits(l))return void t.getLogger(this).warn("editing-disabled:fix-invalid-pending-edits","Editing is disabled for this row. Table has existing invalid pending edits that must be addressed.");const a=this.getCellValue(n),{field:r}=this;if("big-integer"===r.type&&v(r,a))return void t.getLogger(this).warn("value-exceeds-valid-range","Field value is beyond supported limit. Editing is disabled for this field value.");this._activeFieldInput=this._setUpFieldInput(o,a);const s=document.createElement("div");s.classList.add(W.inputContainer);const u=[],d="coded-value"===this._effectiveDomain?.type;if(this._isAnyDateOrTimeField&&!d){const e=document.createElement("div"),t=this._setUpDateComponents(a),i=this._setUpDateActionBar();t.forEach(t=>e.appendChild(t)),s.appendChild(e),s.appendChild(i),u.push(...t)}else{const e=this.createInputElement({rowData:n,value:a});s.appendChild(e),u.push(e)}this._set("editInfo",{column:i,inputs:u,root:e,rowData:n,oldValue:a}),this.removeCellContent(e),e.appendChild(s),this._syncRowEditingState(e,!0),this.grid?.generateCellPartNames();const p=u[0];await H(p),await k(p)},this.layer=null,this.parseInputValueFunction=({inputs:e})=>{const{editInfo:t,field:i,includeTime:n}=this;if(!t||!e.length)return null;const o=e[0];if(this._isAnyDateOrTimeField){if("coded-value"===this._effectiveDomain?.type){if(null==o.value||""===o.value)return null;const e=String(o.value);return F(i)?parseFloat(e):e}const{timeZone:l}=this.effectiveTimeZoneOptions,a=t.oldValue??void 0;switch(i.type){case"date-only":{const e=o.value;return""!==e?e:null}case"time-only":{const e=U(o.value);return""!==e?e:null}case"timestamp-offset":{const t=n?e[1]:void 0,i=e.at(-1);return S({oldValue:a,dateComponent:o,timeComponent:t,timeZoneComponent:i,defaultTimeZone:l})}case"date":{const{max:t,min:i}=this._effectiveRange;return N({oldValue:a,dateComponent:o,timeComponent:e[1],timeZone:l,max:t,min:i})}}return null}const l=o.value,{effectiveRequired:a}=this;return a||null!=l&&""!==l?this._isNumericField?parseFloat(l):this._isStringField?l.trim():l:null},this.sortable=!0,this.store=null,this.template=null,this.view=null}get _effectiveDomain(){const e=this._activeFieldInput?.feature;return e?this._getDomainForFeature(e):null}get _effectiveRange(){return this._activeFieldInput?.range??{max:null,min:null}}get _isAnyDateOrTimeField(){const{field:e}=this;return V(e)||b(e)}get _isIntegerField(){return _(this.field)}get _isNumericField(){return C(this.field)}get _isStringField(){return D(this.field)}get _isSubtypeField(){const{layer:e}=this;if(e?.subtypeField){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1}get _layerWithFieldConfigurations(){const{layer:e}=this;return Z(e)?e:null}get _dateTimeFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?.dateFormat?r(t.format.dateFormat):t?.input&&"includeTime"in t.input&&!1===t.input.includeTime?s:"date-time"===e?.type?u(e):this._isAnyDateOrTimeField?d:void 0}get _numberFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?m(t.format):"number"===e?.type?c(e):this._isNumericField?{useGrouping:!0,maximumFractionDigits:20}:void 0}get alias(){return a(this.field,this._layerWithFieldConfigurations)}get defaultValue(){return this.field?.defaultValue}get effectiveDescription(){const{description:e,field:t}=this,i=t.description,n=L(e)?L(i)?null:i:e;return null==n?null:this.sanitizeLabel(n)}get effectiveEditable(){const{editable:e,field:t,layer:i,tableEditingEnabled:n}=this;if(!t||!i)return!1;const o=h(i),l=i.effectiveCapabilities??i.capabilities,a=l?.operations?.supportsUpdate;return!!(t.editable&&o&&a&&"oid"!==t.type&&n)&&e}get effectiveLabel(){return this.sanitizeLabel(this.label||this.alias||this.fieldName)}get effectiveRequired(){return!this.nullable||this._isSubtypeField||this._activeFieldInput?.required||this.required}get effectiveSortable(){return!(!this.layer?.capabilities?.query?.supportsOrderBy||!this.sortable)}get effectiveTimeZoneOptions(){const{layer:e,field:t}=this;if(!e||"date"!==t?.type&&"timestamp-offset"!==t?.type)return{timeZone:void 0,timeZoneName:void 0};const{tableTimeZone:i,timeZone:n,view:o}=this;return T(e.preferredTimeZone||null,!!e.datesInUnknownTimezone,n??i??o?.timeZone??O,this._dateTimeFormatOptions??d,t.type)}get includeTime(){const{field:e,template:t}=this;return"time-only"===e.type||"date-only"!==e.type&&(!t?.input||"includeTime"in t.input&&!1!==t.input.includeTime)}get hasContingentValues(){return!!this.store.fieldsWithContingentValues?.has(this.fieldName)}get layerFieldConfigurationFormat(){const{_layerWithFieldConfigurations:e}=this;if(e)return e.getFieldConfiguration(this.fieldName)?.fieldFormat??y(this.field)}get maxLength(){const{field:e,template:t}=this,i=e?.length??-1,n=t?.input&&"maxLength"in t.input?t.input.maxLength:null;return null!=n&&!isNaN(n)&&n>=-1&&(-1===i||n<=i)?n:i}get minLength(){const{template:e,maxLength:t}=this,i=e?.input&&"minLength"in e.input?e.input.minLength:null;return t&&i<=t?i:null}get name(){return this.field?.name}get nullable(){return!1!==this.field.nullable}get shouldShowPrompt(){return this._isSubtypeField}createInputElement({rowData:e,value:t}){const{_effectiveDomain:o,maxLength:l,minLength:a,effectiveRequired:r}=this;let s;if("coded-value"===o?.type){const o=e.item.feature,l=this.getFieldValueOptions(o,this.fieldName);this.hasContingentValues?(s=this._setUpComboboxComponent(l,t),this.addHandles([i(()=>s,"calciteComboboxChange",()=>this.onInputBlur(),n),i(()=>s,"pointerdown",e=>e.preventDefault(),n)],z)):(s=this.createCalciteSelect(t,l.recommended),this.addHandles(i(()=>s,"calciteSelectChange",()=>this.onInputBlur(),n),z))}else{if(this._isNumericField){const{_effectiveRange:{max:e,min:i}}=this;s=document.createElement("calcite-input"),s.type="number",this._isIntegerField&&(s.step=1),null!=e&&(s.max=e),null!=i&&(s.min=i),s.status=j({max:e,min:i,value:t})?"idle":"invalid"}else s=document.createElement("calcite-input"),this.addHandles(i(()=>s,"calciteInputChange",()=>this.onInputBlur(),n),z),l>-1&&(s.maxLength=l),a>0&&(s.minLength=a);s.value=null!=t?t.toString():""}return s.classList.add(W.input),s.required=r,this.addHandles([i(()=>s,"keydown",e=>{e.key===P.cancelEdit&&this.onInputBlur(!0)},n),i(()=>s,"blur",()=>this.onInputBlur(),n)],z),s}onInputBlur(e=!1){this.removeHandles(z),super.onInputBlur(e)}onEditComplete(){const e=this.editInfo?.root;e&&this._syncRowEditingState(e,!1),this._activeFieldInput=null,super.onEditComplete()}get test(){}_clearActiveEditValues(){this.editInfo?.inputs?.forEach(e=>e.value="")}_setUpDateActionBar(){const{messagesCommon:e}=this,t=e?.cancel??"",i=e?.clear??"",n=e?.save??"",o=document.createElement("calcite-action-bar");return o.expandDisabled=!0,o.layout="horizontal",o.appendChild(this.createCalciteAction({text:n,icon:"save",onclick:()=>this.submit()})),this.effectiveRequired||o.appendChild(this.createCalciteAction({text:i,icon:"trash",onclick:()=>{this._clearActiveEditValues(),this.submit()}})),o.appendChild(this.createCalciteAction({text:t,icon:"x",onclick:()=>this.cancel()})),o}_formatDateValueForDisplay(e,t){const{timeZone:i,timeZoneName:n}=this.effectiveTimeZoneOptions;return null!=t?A(e,t,{...this._dateTimeFormatOptions,timeZone:i,timeZoneName:n}):null}_fieldValueOptionToComboboxItem({disabled:e,name:t,value:i},n){const o=n===i||null==n&&""===i;return this.createCalciteComboboxItem({disabled:e,heading:t,selected:o,value:i})}_setUpComboboxComponent(e,t){const{recommended:i,other:n,unsupported:o}=e,l=this.effectiveRequired,a=this.messages,r=this.createCalciteCombobox({label:this.effectiveLabel,required:l}),s=i.map(e=>this._fieldValueOptionToComboboxItem(e,t));if(!l||null==t||""===t){const e=this._fieldValueOptionToComboboxItem({disabled:l,name:a?.noValue,value:""},t);r.appendChild(e)}if(0===n.length&&0===o.length)return s.forEach(e=>r.appendChild(e)),r;const u=this.createCalciteComboboxItemGroup({label:a.contingentValues.recommended});if(s.forEach(e=>u.appendChild(e)),r.appendChild(u),n.length){const e=this.createCalciteComboboxItemGroup({label:a.contingentValues.other});n.forEach(i=>e.appendChild(this._fieldValueOptionToComboboxItem(i,t))),r.appendChild(e)}if(o.length){const e=this.createCalciteComboboxItemGroup({label:a.subtypes.unsupportedDomainGroupTitle});o.forEach(i=>e.appendChild(this._fieldValueOptionToComboboxItem(i,t))),r.appendChild(e)}return r}_setUpDateComponents(e){const{_effectiveRange:{max:t,min:n,rawMax:o,rawMin:l},field:a,effectiveRequired:r}=this,s=this._getDateFieldValuesForComponents(a,e),u=[];if(V(a)){const e=this.createDateComponent(),d=I(a)||x(a)?o:t,p=I(a)||x(a)?l:n,m=this._getDateFieldValuesForComponents(a,d??null),c=this._getDateFieldValuesForComponents(a,p??null);e.value=s.date??"",e.max=m.date??"",e.min=c.date??"",e.required=r,this.addHandles([i(()=>e,"calciteInputDatePickerOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}if(this.includeTime){const e=this.createTimeComponent();e.value=s.time??"",e.required=r,this.addHandles([i(()=>e,"calciteInputTimePickerOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}if("timestamp-offset"===a.type){const e=this.createTimeZoneComponent();e.value=s.timeZoneOffset??"0",this.addHandles([i(()=>e,"calciteInputTimeZoneOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}return u}_onDateComponentOpen(e){this.editInfo?.inputs.forEach(t=>{t!==e&&"open"in t&&(t.open=!1)})}_syncRowEditingState(e,t=!1){const i=this.grid?.getRowContainingNode(e);i&&(t?i.setAttribute("editing","true"):i.removeAttribute("editing"))}_getDateFieldValuesForComponents(e,t){switch(e.type){case"date":return B(t,this.effectiveTimeZoneOptions.timeZone);case"date-only":return{date:t};case"time-only":return{time:t};case"timestamp-offset":return q(t);default:return{}}}_setUpFieldInput(e,t){const{field:i,layer:n,effectiveTimeZoneOptions:{timeZone:o}}=this,l=new w({feature:e,field:i,initialFeature:e.clone(),layer:n,timeZone:o});return l.set("value",t),l}_isDomainCompatible(e){if(!e)return!1;const{_isNumericField:t,_isStringField:i}=this,{type:n}=e;if("coded-value"===n){const n=typeof e.codedValues[0].code;if("string"===n&&i||"number"===n&&t)return!0}return!("range"!==n||!t)}_getDomainForFeature(e){const{fieldName:t,layer:i,template:n}=this;if(!e||!i?.getFieldDomain)return null;if("wfs"===i.type||"geojson"===i.type||"csv"===i.type)return null;if(n?.domain&&this._isDomainCompatible(n.domain))return n.domain;if("feature"!==i.type&&"subtype-group"!==i.type&&null==i.getField(t)?.domain){const e=f(i,t);if(e)return e}return i.getFieldDomain(t,{feature:e})}_getComputedDomain(e,t){if(!t)return null;if("range"===t.type)return e;if("coded-value"===t.type){const i=t.codedValues.filter(t=>t.hasOwnProperty("code")&&t.code===e);return i&&i.length?i[0].name:e}return null}getFieldValueOptions(e,t){return this.store.getFieldValueOptions({feature:e,fieldName:t,layer:this.layer,emptyString:this.messages?.noValue})}};e([o()],M.prototype,"_effectiveDomain",null),e([o()],M.prototype,"_activeFieldInput",void 0),e([o()],M.prototype,"_effectiveRange",null),e([o()],M.prototype,"_isAnyDateOrTimeField",null),e([o()],M.prototype,"_isIntegerField",null),e([o()],M.prototype,"_isNumericField",null),e([o()],M.prototype,"_isStringField",null),e([o()],M.prototype,"_isSubtypeField",null),e([o()],M.prototype,"_layerWithFieldConfigurations",null),e([o()],M.prototype,"_dateTimeFormatOptions",null),e([o()],M.prototype,"_numberFormatOptions",null),e([o({readOnly:!0})],M.prototype,"alias",null),e([o()],M.prototype,"cellValueFormatFunction",void 0),e([o()],M.prototype,"cellValueValidatorFunction",void 0),e([o({readOnly:!0})],M.prototype,"defaultValue",null),e([o()],M.prototype,"effectiveDescription",null),e([o()],M.prototype,"effectiveEditable",null),e([o()],M.prototype,"effectiveLabel",null),e([o()],M.prototype,"effectiveRequired",null),e([o()],M.prototype,"effectiveSortable",null),e([o()],M.prototype,"effectiveTimeZoneOptions",null),e([o({type:g})],M.prototype,"field",void 0),e([o()],M.prototype,"formatFunction",void 0),e([o()],M.prototype,"includeTime",null),e([o()],M.prototype,"inputRenderFunction",void 0),e([o()],M.prototype,"hasContingentValues",null),e([o()],M.prototype,"layer",void 0),e([o()],M.prototype,"layerFieldConfigurationFormat",null),e([o()],M.prototype,"maxLength",null),e([o()],M.prototype,"minLength",null),e([o({readOnly:!0})],M.prototype,"name",null),e([o({readOnly:!0})],M.prototype,"nullable",null),e([o()],M.prototype,"parseInputValueFunction",void 0),e([o()],M.prototype,"shouldShowPrompt",null),e([o()],M.prototype,"sortable",void 0),e([o()],M.prototype,"store",void 0),e([o()],M.prototype,"template",void 0),e([o()],M.prototype,"view",void 0),M=e([l("esri.widgets.FeatureTable.FieldColumn")],M);const $=M;export{$ as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../core/has.js";import t from"../../core/Logger.js";import{on as i,sync as n}from"../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as a}from"../../editing/fieldUtils.js";import{convertDateFormatToIntlOptions as r,defaultFormatterOptionsNoTime as s,convertDateTimeFieldFormatToIntlOptions as u,defaultFormatterOptions as d}from"../../intl/date.js";import{formatNumber as p,convertNumberFormatToIntlOptions as m,convertNumberFieldFormatToIntlOptions as c}from"../../intl/number.js";import{isEditableLayer as h}from"../../layers/support/editableLayers.js";import{computeDomainFromTypes as f}from"../../layers/support/featureLayerUtils.js";import g from"../../layers/support/Field.js";import{defaultFieldFormat as y}from"../../layers/support/fieldFormatUtils.js";import{validateFieldValue as v,isDateField as F,isTimeOnlyField as b,isIntegerField as _,isNumericField as C,isStringField as D,isDateOnlyField as I,isTimestampOffsetField as x}from"../../layers/support/fieldUtils.js";import{isAnyDateField as V}from"../../smartMapping/support/utils.js";import{system as O}from"../../time/constants.js";import{getTimeZoneFormattingOptions as T}from"../../time/timeZoneUtils.js";import w from"../FeatureForm/FieldInput.js";import E from"./Grid/EditorColumn.js";import{isIFeatureTableSupportedLayerWithFieldConfigurations as Z,isEmptyStringOrWhitespace as L}from"./support/tableUtils.js";import{valueIsInRange as j,dateTimeIsInRange as R,getUnixFieldValueFromDateComponents as N,getISOFieldValueFromDateComponents as S,normalizeTimeOnlyString as U,getLabelForDateFieldValue as A,prepareISOFieldValueForDateComponents as q,prepareUnixFieldValueForDateComponents as B}from"../support/dateUtils.js";import{setFocus as H,selectText as k}from"../support/widgetUtils.js";const P={cancelEdit:"Escape"},z=Symbol(),G="esri-column",W={input:`${G}__cell-input`,inputContainer:`${G}__cell__input-container`};let M=class extends E{constructor(e){super(e),this._activeFieldInput=null,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this;if(n&&t){const{index:o,item:{attachments:l,feature:a,relatedRecords:r}}=t;return n({attachments:l,column:this,feature:a,field:this.field,index:o,relatedRecords:r,value:this.sanitizeContent(i),virtualIndex:this.getVirtualRowIndex(e)})}if(null===i)return" ";const o=this._getDomainForFeature(t?.item?.feature),l=this._getComputedDomain(i,o)||i;return this._isAnyDateOrTimeField&&"coded-value"!==o?.type?this._formatDateValueForDisplay(this.field,l):this._isNumericField&&"coded-value"!==o?.type?p(parseFloat(l),this._numberFormatOptions):this.sanitizeContent(l)},this.cellValueValidatorFunction=({oldValue:e,value:i})=>{const{_effectiveRange:n,field:o}=this,{max:l,min:a}=n;if(this.effectiveRequired&&(null==i||""===i))return!1;if(this._isNumericField&&(v(o,i)||!j({max:l,min:a,value:i})))return t.getLogger(this).warn("value-exceeds-valid-range","Field value exceeds valid range. Attempted edit was rejected."),!1;if(this._isAnyDateOrTimeField){const e=o.type;if(!R({type:e,range:n,value:i}))return!1}return e!==i},this.field=null,this.formatFunction=null,this.inputRenderFunction=async({root:e,column:i,rowData:n})=>{if(this.editInfo||!this.effectiveEditable||!n)return;const o=n.item.feature,l=o.getObjectId();if(!o||null==l)return;if(this.tableHasInvalidPendingEdits&&!this.itemHasInvalidPendingEdits(l))return void t.getLogger(this).warn("editing-disabled:fix-invalid-pending-edits","Editing is disabled for this row. Table has existing invalid pending edits that must be addressed.");const a=this.getCellValue(n),{field:r}=this;if("big-integer"===r.type&&v(r,a))return void t.getLogger(this).warn("value-exceeds-valid-range","Field value is beyond supported limit. Editing is disabled for this field value.");this._activeFieldInput=this._setUpFieldInput(o,a);const s=document.createElement("div");s.classList.add(W.inputContainer);const u=[],d="coded-value"===this._effectiveDomain?.type;if(this._isAnyDateOrTimeField&&!d){const e=document.createElement("div"),t=this._setUpDateComponents(a),i=this._setUpDateActionBar();t.forEach(t=>e.appendChild(t)),s.appendChild(e),s.appendChild(i),u.push(...t)}else{const e=this.createInputElement({rowData:n,value:a});s.appendChild(e),u.push(e)}this._set("editInfo",{column:i,inputs:u,root:e,rowData:n,oldValue:a}),this.removeCellContent(e),e.appendChild(s),this._syncRowEditingState(e,!0),this.grid?.generateCellPartNames();const p=u[0];await H(p),await k(p)},this.layer=null,this.parseInputValueFunction=({inputs:e})=>{const{editInfo:t,field:i,includeTime:n}=this;if(!t||!e.length)return null;const o=e[0];if(this._isAnyDateOrTimeField){if("coded-value"===this._effectiveDomain?.type){if(null==o.value||""===o.value)return null;const e=String(o.value);return F(i)?parseFloat(e):e}const{timeZone:l}=this.effectiveTimeZoneOptions,a=t.oldValue??void 0;switch(i.type){case"date-only":{const e=o.value;return""!==e?e:null}case"time-only":{const e=U(o.value);return""!==e?e:null}case"timestamp-offset":{const t=n?e[1]:void 0,i=e.at(-1);return S({oldValue:a,dateComponent:o,timeComponent:t,timeZoneComponent:i,defaultTimeZone:l})}case"date":{const{max:t,min:i}=this._effectiveRange;return N({oldValue:a,dateComponent:o,timeComponent:e[1],timeZone:l,max:t,min:i})}}return null}const l=o.value,{effectiveRequired:a}=this;return a||null!=l&&""!==l?this._isNumericField?parseFloat(l):this._isStringField?l.trim():l:null},this.sortable=!0,this.store=null,this.template=null,this.view=null}get _effectiveDomain(){const e=this._activeFieldInput?.feature;return e?this._getDomainForFeature(e):null}get _effectiveRange(){return this._activeFieldInput?.range??{max:null,min:null}}get _isAnyDateOrTimeField(){const{field:e}=this;return V(e)||b(e)}get _isIntegerField(){return _(this.field)}get _isNumericField(){return C(this.field)}get _isStringField(){return D(this.field)}get _isSubtypeField(){const{layer:e}=this;if(e?.subtypeField){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1}get _layerWithFieldConfigurations(){const{layer:e}=this;return Z(e)?e:null}get _dateTimeFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?.dateFormat?r(t.format.dateFormat):t?.input&&"includeTime"in t.input&&!1===t.input.includeTime?s:"date-time"===e?.type?u(e):this._isAnyDateOrTimeField?d:void 0}get _numberFormatOptions(){const{layerFieldConfigurationFormat:e,template:t}=this;return t?.format?m(t.format):"number"===e?.type?c(e):this._isNumericField?{useGrouping:!0,maximumFractionDigits:20}:void 0}get alias(){return a(this.field,this._layerWithFieldConfigurations)}get defaultValue(){return this.field?.defaultValue}get effectiveDescription(){const{description:e,field:t}=this,i=t.description,n=L(e)?L(i)?null:i:e;return null==n?null:this.sanitizeLabel(n)}get effectiveEditable(){const{editable:e,field:t,layer:i,tableEditingEnabled:n}=this;if(!t||!i)return!1;const o=h(i),l=i.effectiveCapabilities??i.capabilities,a=l?.operations?.supportsUpdate;return!!(t.editable&&o&&a&&"oid"!==t.type&&n)&&e}get effectiveLabel(){return this.sanitizeLabel(this.label||this.alias||this.fieldName)}get effectiveRequired(){return!this.nullable||this._isSubtypeField||this._activeFieldInput?.required||this.required}get effectiveSortable(){return!(!this.layer?.capabilities?.query?.supportsOrderBy||!this.sortable)}get effectiveTimeZoneOptions(){const{layer:e,field:t}=this;if(!e||"date"!==t?.type&&"timestamp-offset"!==t?.type)return{timeZone:void 0,timeZoneName:void 0};const{tableTimeZone:i,timeZone:n,view:o}=this;return T(e.preferredTimeZone||null,!!e.datesInUnknownTimezone,n??i??o?.timeZone??O,this._dateTimeFormatOptions??d,t.type)}get includeTime(){const{field:e,template:t}=this;return"time-only"===e.type||"date-only"!==e.type&&(!t?.input||"includeTime"in t.input&&!1!==t.input.includeTime)}get hasContingentValues(){return!!this.store.fieldsWithContingentValues.has(this.fieldName)}get layerFieldConfigurationFormat(){const{_layerWithFieldConfigurations:e}=this;if(e)return e.getFieldConfiguration(this.fieldName)?.fieldFormat??y(this.field)}get maxLength(){const{field:e,template:t}=this,i=e?.length??-1,n=t?.input&&"maxLength"in t.input?t.input.maxLength:null;return null!=n&&!isNaN(n)&&n>=-1&&(-1===i||n<=i)?n:i}get minLength(){const{template:e,maxLength:t}=this,i=e?.input&&"minLength"in e.input?e.input.minLength:null;return t&&i<=t?i:null}get name(){return this.field?.name}get nullable(){return!1!==this.field.nullable}get shouldShowPrompt(){return this._isSubtypeField}createInputElement({rowData:e,value:t}){const{_effectiveDomain:o,maxLength:l,minLength:a,effectiveRequired:r}=this;let s;if("coded-value"===o?.type){const o=e.item.feature,l=this.getFieldValueOptions(o,this.fieldName);this.hasContingentValues?(s=this._setUpComboboxComponent(l,t),this.addHandles([i(()=>s,"calciteComboboxChange",()=>this.onInputBlur(),n),i(()=>s,"pointerdown",e=>e.preventDefault(),n)],z)):(s=this.createCalciteSelect(t,l.recommended),this.addHandles(i(()=>s,"calciteSelectChange",()=>this.onInputBlur(),n),z))}else{if(this._isNumericField){const{_effectiveRange:{max:e,min:i}}=this;s=document.createElement("calcite-input"),s.type="number",this._isIntegerField&&(s.step=1),null!=e&&(s.max=e),null!=i&&(s.min=i),s.status=j({max:e,min:i,value:t})?"idle":"invalid"}else s=document.createElement("calcite-input"),this.addHandles(i(()=>s,"calciteInputChange",()=>this.onInputBlur(),n),z),l>-1&&(s.maxLength=l),a>0&&(s.minLength=a);s.value=null!=t?t.toString():""}return s.classList.add(W.input),s.required=r,this.addHandles([i(()=>s,"keydown",e=>{e.key===P.cancelEdit&&this.onInputBlur(!0)},n),i(()=>s,"blur",()=>this.onInputBlur(),n)],z),s}onInputBlur(e=!1){this.removeHandles(z),super.onInputBlur(e)}onEditComplete(){const e=this.editInfo?.root;e&&this._syncRowEditingState(e,!1),this._activeFieldInput=null,super.onEditComplete()}get test(){}_clearActiveEditValues(){this.editInfo?.inputs?.forEach(e=>e.value="")}_setUpDateActionBar(){const{messagesCommon:e}=this,t=e?.cancel??"",i=e?.clear??"",n=e?.save??"",o=document.createElement("calcite-action-bar");return o.expandDisabled=!0,o.layout="horizontal",o.appendChild(this.createCalciteAction({text:n,icon:"save",onclick:()=>this.submit()})),this.effectiveRequired||o.appendChild(this.createCalciteAction({text:i,icon:"trash",onclick:()=>{this._clearActiveEditValues(),this.submit()}})),o.appendChild(this.createCalciteAction({text:t,icon:"x",onclick:()=>this.cancel()})),o}_formatDateValueForDisplay(e,t){const{timeZone:i,timeZoneName:n}=this.effectiveTimeZoneOptions;return null!=t?A(e,t,{...this._dateTimeFormatOptions,timeZone:i,timeZoneName:n}):null}_fieldValueOptionToComboboxItem({disabled:e,name:t,value:i},n){const o=n===i||null==n&&""===i;return this.createCalciteComboboxItem({disabled:e,heading:t,selected:o,value:i})}_setUpComboboxComponent(e,t){const{recommended:i,other:n,unsupported:o}=e,l=this.effectiveRequired,a=this.messages,r=this.createCalciteCombobox({label:this.effectiveLabel,required:l}),s=i.map(e=>this._fieldValueOptionToComboboxItem(e,t));if(!l||null==t||""===t){const e=this._fieldValueOptionToComboboxItem({disabled:l,name:a?.noValue,value:""},t);r.appendChild(e)}if(0===n.length&&0===o.length)return s.forEach(e=>r.appendChild(e)),r;const u=this.createCalciteComboboxItemGroup({label:a.contingentValues.recommended});if(s.forEach(e=>u.appendChild(e)),r.appendChild(u),n.length){const e=this.createCalciteComboboxItemGroup({label:a.contingentValues.other});n.forEach(i=>e.appendChild(this._fieldValueOptionToComboboxItem(i,t))),r.appendChild(e)}if(o.length){const e=this.createCalciteComboboxItemGroup({label:a.subtypes.unsupportedDomainGroupTitle});o.forEach(i=>e.appendChild(this._fieldValueOptionToComboboxItem(i,t))),r.appendChild(e)}return r}_setUpDateComponents(e){const{_effectiveRange:{max:t,min:n,rawMax:o,rawMin:l},field:a,effectiveRequired:r}=this,s=this._getDateFieldValuesForComponents(a,e),u=[];if(V(a)){const e=this.createDateComponent(),d=I(a)||x(a)?o:t,p=I(a)||x(a)?l:n,m=this._getDateFieldValuesForComponents(a,d??null),c=this._getDateFieldValuesForComponents(a,p??null);e.value=s.date??"",e.max=m.date??"",e.min=c.date??"",e.required=r,this.addHandles([i(()=>e,"calciteInputDatePickerOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}if(this.includeTime){const e=this.createTimeComponent();e.value=s.time??"",e.required=r,this.addHandles([i(()=>e,"calciteInputTimePickerOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}if("timestamp-offset"===a.type){const e=this.createTimeZoneComponent();e.value=s.timeZoneOffset??"0",this.addHandles([i(()=>e,"calciteInputTimeZoneOpen",()=>this._onDateComponentOpen(e))],z),u.push(e)}return u}_onDateComponentOpen(e){this.editInfo?.inputs.forEach(t=>{t!==e&&"open"in t&&(t.open=!1)})}_syncRowEditingState(e,t=!1){const i=this.grid?.getRowContainingNode(e);i&&(t?i.setAttribute("editing","true"):i.removeAttribute("editing"))}_getDateFieldValuesForComponents(e,t){switch(e.type){case"date":return B(t,this.effectiveTimeZoneOptions.timeZone);case"date-only":return{date:t};case"time-only":return{time:t};case"timestamp-offset":return q(t);default:return{}}}_setUpFieldInput(e,t){const{field:i,layer:n,effectiveTimeZoneOptions:{timeZone:o}}=this,l=new w({feature:e,field:i,initialFeature:e.clone(),layer:n,timeZone:o});return l.set("value",t),l}_isDomainCompatible(e){if(!e)return!1;const{_isNumericField:t,_isStringField:i}=this,{type:n}=e;if("coded-value"===n){const n=typeof e.codedValues[0].code;if("string"===n&&i||"number"===n&&t)return!0}return!("range"!==n||!t)}_getDomainForFeature(e){const{fieldName:t,layer:i,template:n}=this;if(!e||!i?.getFieldDomain)return null;if("wfs"===i.type||"geojson"===i.type||"csv"===i.type)return null;if(n?.domain&&this._isDomainCompatible(n.domain))return n.domain;if("feature"!==i.type&&"subtype-group"!==i.type&&null==i.getField(t)?.domain){const e=f(i,t);if(e)return e}return i.getFieldDomain(t,{feature:e})}_getComputedDomain(e,t){if(!t)return null;if("range"===t.type)return e;if("coded-value"===t.type){const i=t.codedValues.filter(t=>t.hasOwnProperty("code")&&t.code===e);return i&&i.length?i[0].name:e}return null}getFieldValueOptions(e,t){return this.store.getFieldValueOptions({feature:e,fieldName:t,layer:this.layer,emptyString:this.messages?.noValue})}};e([o()],M.prototype,"_effectiveDomain",null),e([o()],M.prototype,"_activeFieldInput",void 0),e([o()],M.prototype,"_effectiveRange",null),e([o()],M.prototype,"_isAnyDateOrTimeField",null),e([o()],M.prototype,"_isIntegerField",null),e([o()],M.prototype,"_isNumericField",null),e([o()],M.prototype,"_isStringField",null),e([o()],M.prototype,"_isSubtypeField",null),e([o()],M.prototype,"_layerWithFieldConfigurations",null),e([o()],M.prototype,"_dateTimeFormatOptions",null),e([o()],M.prototype,"_numberFormatOptions",null),e([o({readOnly:!0})],M.prototype,"alias",null),e([o()],M.prototype,"cellValueFormatFunction",void 0),e([o()],M.prototype,"cellValueValidatorFunction",void 0),e([o({readOnly:!0})],M.prototype,"defaultValue",null),e([o()],M.prototype,"effectiveDescription",null),e([o()],M.prototype,"effectiveEditable",null),e([o()],M.prototype,"effectiveLabel",null),e([o()],M.prototype,"effectiveRequired",null),e([o()],M.prototype,"effectiveSortable",null),e([o()],M.prototype,"effectiveTimeZoneOptions",null),e([o({type:g})],M.prototype,"field",void 0),e([o()],M.prototype,"formatFunction",void 0),e([o()],M.prototype,"includeTime",null),e([o()],M.prototype,"inputRenderFunction",void 0),e([o()],M.prototype,"hasContingentValues",null),e([o()],M.prototype,"layer",void 0),e([o()],M.prototype,"layerFieldConfigurationFormat",null),e([o()],M.prototype,"maxLength",null),e([o()],M.prototype,"minLength",null),e([o({readOnly:!0})],M.prototype,"name",null),e([o({readOnly:!0})],M.prototype,"nullable",null),e([o()],M.prototype,"parseInputValueFunction",void 0),e([o()],M.prototype,"shouldShowPrompt",null),e([o()],M.prototype,"sortable",void 0),e([o()],M.prototype,"store",void 0),e([o()],M.prototype,"template",void 0),e([o()],M.prototype,"view",void 0),M=e([l("esri.widgets.FeatureTable.FieldColumn")],M);const $=M;export{$ as default};
|