@arcgis/core 5.1.0-next.107 → 5.1.0-next.108
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/ShadowCastAnalysis.d.ts +2 -1
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/4e13d639419ac64f7563.js +1 -0
- package/assets/esri/core/workers/chunks/4f9ea7544b2d0e88a05c.js +1 -0
- package/assets/esri/core/workers/chunks/{770611659b38066a6228.js → 5a85cbc04c64091d7f46.js} +1 -1
- package/assets/esri/core/workers/chunks/91c0de3950991d81b7f2.js +1 -0
- package/assets/esri/core/workers/chunks/{7ce60331f94ee0a5d674.js → beff5b4e15edee12bd4c.js} +33 -41
- package/assets/esri/core/workers/chunks/{740588250eaffb7301fd.js → e1340232962cf576d37e.js} +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bg.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bs.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ca.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_cs.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_da.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_de.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_el.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_es.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_et.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fi.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_he.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hu.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_id.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_it.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ja.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ko.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lt.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lv.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_nl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_no.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-BR.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-PT.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ro.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ru.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sk.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sv.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_th.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_tr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_uk.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_vi.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-CN.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-HK.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-TW.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ar.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bg.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bs.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ca.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_cs.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_da.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_de.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_el.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_es.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_et.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fi.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_he.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hu.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_id.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_it.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ja.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ko.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lt.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lv.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_no.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-BR.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-PT.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ro.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ru.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sk.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sl.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sv.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_th.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_tr.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_uk.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_vi.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-CN.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-HK.json +1 -1
- package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-TW.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.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_ar.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
- package/chunks/GlobalIllumination.glsl.js +12 -12
- package/chunks/GlowComposition.glsl.js +1 -1
- package/chunks/OITBlend.glsl.js +7 -7
- package/chunks/OITBlendEmission.glsl.js +4 -4
- package/chunks/OITDimOpaque.glsl.js +3 -3
- package/config.js +1 -1
- package/core/workers/workers.js +1 -1
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/MapImageLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +3 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +2 -0
- package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/MapImageLayerView3D.js +1 -1
- package/views/3d/layers/TileLayerView3D.js +1 -1
- package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
- package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +1 -1
- package/views/3d/support/popupHitTest.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentDrawParameters.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +4 -12
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlendEmission.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITDimOpaque.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/PopupView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/WMSLayerView.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +26 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +5 -44
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js +2 -0
- package/widgets/BatchAttributeForm/types.d.ts +7 -0
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/Grid/types.d.ts +21 -1
- package/widgets/FeatureTable.js +1 -1
- package/assets/esri/core/workers/chunks/2a2e97918524e0f436d7.js +0 -1
- package/assets/esri/core/workers/chunks/37c63570c0b4981cd519.js +0 -1
- package/assets/esri/core/workers/chunks/8557dd9ef336b23f768f.js +0 -1
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type Graphic from "../../Graphic.js";
|
|
2
2
|
import type EsriMap from "../../Map.js";
|
|
3
3
|
import type Collection from "../../core/Collection.js";
|
|
4
|
+
import type UtilityNetworkAssociationType from "../../popup/support/UtilityNetworkAssociationType.js";
|
|
4
5
|
import type AttachmentInfo from "../../rest/query/support/AttachmentInfo.js";
|
|
5
6
|
import type AttachmentElementInput from "./inputs/AttachmentElementInput.js";
|
|
6
7
|
import type BatchFormInputs from "./inputs/BatchFormInputs.js";
|
|
7
8
|
import type FieldInput from "./inputs/FieldInput.js";
|
|
9
|
+
import type UtilityNetworkAssociationsElementInput from "./inputs/UtilityNetworkAssociationsElementInput.js";
|
|
8
10
|
import type { EventedAccessor } from "../../core/Evented.js";
|
|
9
11
|
import type { FieldValue } from "../../layers/support/fieldUtils.js";
|
|
10
12
|
import type { TimeZone } from "../../time/types.js";
|
|
11
|
-
import type { AttachmentsChangeEvent, AttributeFormSupportedLayerInfo, AttributeFormSupportedLayerUnion, BatchAttributeFormMode, BatchAttributeFormState, SelectedAttachmentIdentifier, SelectedAttachmentDetails, SubmitEvent, ValueChangeEvent } from "./types.js";
|
|
13
|
+
import type { AssociationsLayerUnion, AttachmentsChangeEvent, AttributeFormSupportedLayerInfo, AttributeFormSupportedLayerUnion, BatchAttributeFormMode, BatchAttributeFormState, SelectedAttachmentIdentifier, SelectedAttachmentDetails, SubmitEvent, ValueChangeEvent } from "./types.js";
|
|
12
14
|
import type { FormInput } from "./inputs/types.js";
|
|
13
15
|
import type { EditType } from "../support/forms/types.js";
|
|
14
16
|
|
|
@@ -302,6 +304,29 @@ export default class BatchAttributeFormViewModel extends EventedAccessor {
|
|
|
302
304
|
* @internal
|
|
303
305
|
*/
|
|
304
306
|
goHome(): Promise<void>;
|
|
307
|
+
/**
|
|
308
|
+
* Used to specify a specific input to view associated layers for.
|
|
309
|
+
* Related to the 'viewing-associated-layers' page.
|
|
310
|
+
*
|
|
311
|
+
* @param input - A reference to the input to display associated layers for.
|
|
312
|
+
* @internal
|
|
313
|
+
*/
|
|
314
|
+
setActiveAssociationsInput(input: UtilityNetworkAssociationsElementInput | null | undefined): void;
|
|
315
|
+
/**
|
|
316
|
+
* Used to specify a layer to view associated features for.
|
|
317
|
+
* Related to the 'viewing-associated-features' page.
|
|
318
|
+
*
|
|
319
|
+
* @param layer - A reference to a specific layer.
|
|
320
|
+
* @internal
|
|
321
|
+
*/
|
|
322
|
+
setActiveAssociationsLayer(layer: AssociationsLayerUnion | null | undefined): void;
|
|
323
|
+
/**
|
|
324
|
+
* Used to filter the types of associations displayed in the 'viewing-associated-layers' page.
|
|
325
|
+
*
|
|
326
|
+
* @param type - A reference to a specific type of association.
|
|
327
|
+
* @internal
|
|
328
|
+
*/
|
|
329
|
+
setActiveAssociationType(type: UtilityNetworkAssociationType | null | undefined): void;
|
|
305
330
|
/**
|
|
306
331
|
* @param value - Selected attachment identifier, or `null`/`undefined` to clear the selection.
|
|
307
332
|
* @internal
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{pushIfSome as t}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import n from"../../core/Error.js";import{EventedAccessor as i}from"../../core/Evented.js";import r from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{abortMaybe as l,destroyMaybe as h}from"../../core/maybe.js";import{throwIfAborted as p,isAbortError as c}from"../../core/promiseUtils.js";import m from"../../core/ReactiveMap.js";import{on as u,sync as d,watch as f,syncAndInitial as g,whenOnce as y}from"../../core/reactiveUtils.js";import{property as v,subclass as A}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as _}from"../../core/support/UpdatingHandles.js";import F from"../../geometry/SpatialReference.js";import{getGraphicLayer as I}from"../../graphic/graphicOriginUtils.js";import{system as x}from"../../time/constants.js";import{getAttachmentKey as w}from"./attachmentUtils.js";import{createReactiveGraphic as E,isAttributeFormSupportedLayerWithAttachments as C,layerSupportsQueryAttachments as M,queryAttachmentsForElements as k}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as b}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as T}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as V}from"./expressions/ExpressionsModel.js";import j from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as H}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as L,isFieldInput as S}from"./inputs/support/inputUtils.js";import B from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as R}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as G}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as U,isGroupElementTemplate as W}from"./templates/support/templateUtils.js";import{isEmptyValue as N}from"../support/forms/formUtils.js";function O(e,t){return e?.find(e=>e.layer===t)}let Z=class extends i{constructor(e){super(e),this._attachmentCache=new m,this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new a,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.pageStack=[],this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new b,this._activeFormInputsByElementId=new Map,this._emptyForm=new j({inputs:[]}),this._emptyFormTemplate=new B({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new m,this._updatingHandles=new _,this._layerTemplateMap=new m,this._layerContingentValuesMap=new m,this._workingFeatures=new a,this._expressionsManager=new T({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:x}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([u(()=>this.features,"after-changes",()=>{this.goHome(),this.notifyChange("layers"),this._prepare()},d),f(()=>[this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),d),f(()=>this.activeForm,()=>{this.goHome(),this._activeFormInputsByElementId.clear(),this._syncAttachments()},d),f(()=>this.activeFeature,()=>{this.goHome(),this._syncAttachments()},d),f(()=>this.page,e=>{const t=[...this.pageStack];if(t.includes(e))for(;t.length&&t.at(-1)!==e;)t.pop();else t.push(e);this.pageStack=t},g)]),this._prepare()}destroy(){this._prepareTask=l(this._prepareTask),this._workingFeatures.destroyAll(),h(this._expressionsManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new m,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const s=this._makeBatchFormInputsForFeature(e);return s!==this._emptyForm&&this._featureFormMap.set(e,s),s}get activeLayer(){const{activeFeature:e}=this;if(!e)return null;return I(e)??null}get calculating(){return this._expressionsManager.calculating}get expressionsManager(){return this._expressionsManager}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some(t=>t!==e)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const e of this.layers){const t=this._layerContingentValuesMap.get(e);if(t&&t.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter(e=>e.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":e.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":e.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return e.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get page(){return this.selectedAttachmentAddElementId?"adding-attachments":this.selectedAttachment?"viewing-attachment-details":"default"}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid&&Array.from(this._featureFormMap.values()).every(e=>e.valid)}get layers(){const e=new Set;return this.features.forEach(t=>{const s=I(t);s&&e.add(s)}),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}get selectedAttachment(){return this._get("selectedAttachment")??null}set selectedAttachment(e){this._set("selectedAttachment",e),null!=e&&(this.selectedAttachmentAddElementId=null)}get selectedAttachmentAddElementId(){return this._get("selectedAttachmentAddElementId")??null}set selectedAttachmentAddElementId(e){this._set("selectedAttachmentAddElementId",e)}get selectedAttachmentAddInput(){const e=this.selectedAttachmentAddElementId,t=this.activeForm;return e&&t&&t.allAttachmentElementInputs.find(t=>t.template.elementId===e)||null}get selectedAttachmentDetails(){const e=this.selectedAttachment,t=this.activeForm;if(!e||!t)return null;const s=t.allAttachmentElementInputs.find(t=>t.template.elementId===e.elementId);if(!s)return null;const a=s.attachments.findIndex(t=>w(t)===e.attachmentKey);if(-1===a)return null;return{attachment:s.attachments[a],input:s}}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const s=this.activeForm.allFieldInputs.find(t=>t.template.elementId===e);return void 0!==s?(t.set(e,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const e of this.visibleInputs){if(L(e)){const t=e.inputs.find(e=>S(e)&&!e.valid);if(t)return{input:t,groupInput:e}}if(S(e)&&!e.valid)return{input:e}}}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._reactiveGraphicLookup.get(e);if(!t)throw new n("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}async goBack(){const{page:e}=this;"viewing-attachment-details"!==e?"adding-attachments"!==e||this.setSelectedAttachmentAddElementId(null):this.setSelectedAttachment(null)}async goHome(){this.setSelectedAttachment(null),this.setSelectedAttachmentAddElementId(null)}notifyGeometriesChanged(e){const t=[];for(const s of e){const e=this._reactiveGraphicLookup.get(s);e&&(t.push(e),e.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(t)}async setFieldInputValue(e,t){const s=new Set(this.invalidFeatures);await e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:e.features.toArray().map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:t})}async setValue(e,t){const s=this.findFieldInput(e);if(null==s)throw new n("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);await this.setFieldInputValue(s,t)}async stageAddAttachments(e,t){if(0===t.length)return[];const s=this._findAttachmentInput(e);if(!s)return[];const a=await s.stageAddAttachments(t,this._expressionsManager.arcadeContext);return 0===a.length||(this.userHasChangedValues=!0,this._emitAttachmentsChange(s)),a}stageDeleteAttachment(e,t){const s=this._findAttachmentInput(e);if(!s)return;const a=this._findAttachment(s,t);a&&(s.stageDeleteAttachment(a),this.userHasChangedValues=!0,this._emitAttachmentsChange(s))}stageRenameAttachment(e,t,s){const a=this._findAttachmentInput(e);if(!a)return;const n=this._findAttachment(a,t);n&&0!==s.trim().length&&(a.stageRenameAttachment(n,s.trim()),this.userHasChangedValues=!0,this._emitAttachmentsChange(a))}async stageReplaceAttachment(e,t,s){const a=this._findAttachmentInput(e);if(!a)return;const n=this._findAttachment(a,t);n&&(await a.stageReplaceAttachment(n,s,this._expressionsManager.arcadeContext),this.userHasChangedValues=!0,this._emitAttachmentsChange(a))}clearAttachmentChanges(e){const t=this._findAttachmentInput(e);t&&(t.clearAttachmentChanges(),this._emitAttachmentsChange(t))}setSelectedAttachment(e){this.selectedAttachment=e??null}setSelectedAttachmentAddElementId(e){this.selectedAttachmentAddElementId=e??null}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await y(()=>!1===this.calculating);const t=this.invalidFeatures;for(const s of t)!1===e.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?H(t,{allFeatures:new a([e]),expressionsManager:this._expressionsManager,map:this.map}):this._emptyForm}_makeSubmitResults(){const e=new Map;for(const[s,a]of this._reactiveGraphicLookup){const n=[],i=[],r=this._featureFormMap.get(a)?.allAttachmentElementInputs??[];for(const e of r)t(n,e.toSubmitEdits()),e.valid||i.push(e.template.elementId);e.set(s,{feature:s,values:{...a.attributes},invalidFields:[],attachmentEdits:n,invalidAttachmentElementIds:i})}for(const t of this.sharedForm.allFieldInputs)for(const s of t.invalidFeatures)e.get(s)?.invalidFields.push(t.fieldName);return Array.from(e.values())}_findAttachmentInput(e){const t=this.activeForm.allAttachmentElementInputs.find(t=>t.template.elementId===e);return t||r.getLogger(this).error(`Attachment input not found for elementId '${e}'`),t}_findAttachment(e,t){const s=e.findAttachment(t);return s||r.getLogger(this).error(`Attachment '${t}' not found for attachment element '${e.template.elementId}'`),s}_makeAttachmentEdits(e){const s=[];for(const a of e.allAttachmentElementInputs)t(s,a.toSubmitEdits());return s}_emitAttachmentsChange(e){const t=e.single.feature;if(!t)return;const s=this._featureFormMap.get(t);this.emit("attachments-change",{name:"attachments-change",feature:t.source,attachmentEdits:this._makeAttachmentEdits(s??this.activeForm),valid:this.valid})}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=l(this._prepareTask),this._updateWorkingFeatures(),h(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new T({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??F.WebMercator,map:this.map,timeZone:this.timeZone||"system"}});const{layers:e}=this;if(0===e.length)return;const t=s(async t=>{try{p(t);const s=new Map;for(const n of e){const e=await R(n);if(p(t),e){const t=e.fieldGroups.flatMap(e=>e.fields);this._layerContingentValuesMap.set(n,new Set(t))}else this._layerContingentValuesMap.set(n,new Set);const a=O(this.layerInfos,n),i=await G(n,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this.timeZone},a?.formTemplate);p(t),this._layerTemplateMap.set(n,i);const r=i.getExpressionExecutorsForLayer(n);if(this._expressionsManager.layerExpressionsModelMap.set(n,new V({preserveFieldValuesWhenHidden:i.preserveFieldValuesWhenHidden,executorMap:r})),!this._hasAsyncArcadeExpressions)for(const t of r.keys()){const e=r.get(t);if(this._hasAsyncArcadeExpressions=!0===(e.editableExpression?.isAsync||e.requiredExpression?.isAsync||e.valueExpression?.isAsync||e.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const t of i.elements){if(U(t))continue;const e=t.clone();W(e)&&(e.elements=e.elements.filter(e=>!U(e)));const{elementId:a}=e;s.has(a)?s.get(a).foldIn(e):s.set(a,e)}}if(this.hasTooManyComplexFeatures)throw new n("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new n("too-many-features","There are too many features to load into the form.");const a=new B({elements:Array.from(s.values())});this.sharedFormTemplate=a,this.sharedForm=H(a,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,map:this.map}),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw c(s)||r.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.consumePromise(t.promise),this._prepareTask=t}_updateWorkingFeatures(){this._workingFeatures.destroyAll();for(const t of this._featureFormMap.values())t.destroy();this._featureFormMap.clear(),this._attachmentCache.clear();const{features:e}=this;if(this._reactiveGraphicLookup=new m,0!==e.length){this._workingFeatures.addMany(e.map(E));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.source,e)}}async _syncAttachments(){const{activeFeature:e,activeLayer:t,activeForm:s}=this;if(!(e&&s&&C(t)&&M(t)))return;const a=e.getObjectId();if(null==a)return;const n=this._attachmentCache.get(t),i=s.allAttachmentElementInputs;if(!i.length)return;let r;if(n){const e=n.get(a);e&&(r=e)}if(!r){r=await k(t,a,i);o(this._attachmentCache,t,()=>new m).set(a,r)}for(const o of i)o.applyFetchedAttachments(z(o,r))}};e([v()],Z.prototype,"_attachmentCache",void 0),e([v({readOnly:!0})],Z.prototype,"activeFeature",null),e([v()],Z.prototype,"activeFeatureIndex",void 0),e([v({readOnly:!0})],Z.prototype,"activeForm",null),e([v({readOnly:!0})],Z.prototype,"activeLayer",null),e([v()],Z.prototype,"disabled",void 0),e([v()],Z.prototype,"calculating",null),e([v()],Z.prototype,"editType",void 0),e([v()],Z.prototype,"features",void 0),e([v()],Z.prototype,"expressionEvaluationFailed",null),e([v()],Z.prototype,"hasNonActiveInvalidFeatures",null),e([v()],Z.prototype,"hasAsyncArcadeExpressions",null),e([v()],Z.prototype,"_hasAsyncArcadeExpressions",void 0),e([v()],Z.prototype,"invalidFeatures",null),e([v()],Z.prototype,"hasVisibleInputs",null),e([v()],Z.prototype,"hasLayersWithContingentValues",null),e([v()],Z.prototype,"maximumFeatureCount",void 0),e([v()],Z.prototype,"maximumFeatureCountWithComplexForms",void 0),e([v()],Z.prototype,"visibleInputs",null),e([v()],Z.prototype,"map",void 0),e([v()],Z.prototype,"noVisibleElementsReason",null),e([v()],Z.prototype,"page",null),e([v()],Z.prototype,"pageStack",void 0),e([v()],Z.prototype,"readOnly",void 0),e([v()],Z.prototype,"spatialReference",void 0),e([v()],Z.prototype,"submitHasBeenAttempted",void 0),e([v()],Z.prototype,"timeZone",void 0),e([v()],Z.prototype,"updating",null),e([v()],Z.prototype,"valid",null),e([v()],Z.prototype,"layers",null),e([v()],Z.prototype,"mode",null),e([v()],Z.prototype,"sharedForm",void 0),e([v()],Z.prototype,"sharedFormTemplate",void 0),e([v()],Z.prototype,"selectedAttachment",null),e([v()],Z.prototype,"selectedAttachmentAddElementId",null),e([v()],Z.prototype,"selectedAttachmentAddInput",null),e([v()],Z.prototype,"selectedAttachmentDetails",null),e([v()],Z.prototype,"userHasChangedValues",void 0),e([v()],Z.prototype,"layerInfos",void 0),e([v()],Z.prototype,"_arcadeExecutorProvider",void 0),e([v()],Z.prototype,"_prepareTask",void 0),e([v()],Z.prototype,"_reactiveGraphicLookup",void 0),e([v()],Z.prototype,"_layerTemplateMap",void 0),e([v()],Z.prototype,"_layerContingentValuesMap",void 0),e([v()],Z.prototype,"_workingFeatures",void 0),e([v()],Z.prototype,"_expressionsManager",void 0),Z=e([A("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],Z);const D=Z;function P(e){return null!=e&&e.trim().length>0}function $(e,t){const s=e.keywords;return P(s)&&s.toLowerCase()===t}function z(e,t){const s="attachment"===e.input?.type?e.input.attachmentAssociationType:"exact",a=e.attachmentKeyword;if("any"===s)return t;if("exactOrNone"===s){if(N(a))return t.filter(e=>!P(e.keywords));const e=a.toLowerCase();return t.filter(t=>!P(t.keywords)||$(t,e))}if(N(a))return t;const n=a.toLowerCase();return t.filter(e=>$(e,n))}export{D as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import{pushIfSome as e}from"../../core/arrayUtils.js";import{createTask as s}from"../../core/asyncUtils.js";import i from"../../core/Collection.js";import a from"../../core/Error.js";import{EventedAccessor as n}from"../../core/Evented.js";import r from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{abortMaybe as l,destroyMaybe as h}from"../../core/maybe.js";import{throwIfAborted as c,isAbortError as p}from"../../core/promiseUtils.js";import u from"../../core/ReactiveMap.js";import{on as m,sync as d,watch as f,syncAndInitial as g,whenOnce as y}from"../../core/reactiveUtils.js";import{property as v,subclass as A}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as _}from"../../core/support/UpdatingHandles.js";import F from"../../geometry/SpatialReference.js";import{getGraphicLayer as I}from"../../graphic/graphicOriginUtils.js";import{system as x}from"../../time/constants.js";import{getAttachmentKey as w}from"./attachmentUtils.js";import{createReactiveGraphic as E,isAttributeFormSupportedLayerWithAttachments as C,layerSupportsQueryAttachments as M,queryAttachmentsForElements as k}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as b}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as T}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as V}from"./expressions/ExpressionsModel.js";import j from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as H}from"./inputs/support/createBatchFormInputs.js";import{isGroupInput as L,isFieldInput as S}from"./inputs/support/inputUtils.js";import B from"./templates/BatchFormTemplate.js";import{getLayerContingentValuesMetaData as R}from"./templates/support/contingentValuesUtils.js";import{createBatchFormTemplate as G}from"./templates/support/createBatchFormTemplate.js";import{isExcludedFromSharedForm as U,isGroupElementTemplate as W}from"./templates/support/templateUtils.js";import{isEmptyValue as N}from"../support/forms/formUtils.js";function O(t,e){return t?.find(t=>t.layer===e)}let Z=class extends n{constructor(t){super(t),this._attachmentCache=new u,this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new i,this._hasAsyncArcadeExpressions=!1,this.maximumFeatureCount=2e3,this.maximumFeatureCountWithComplexForms=50,this.map=null,this.pageStack=[],this.readOnly=!1,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this.layerInfos=null,this._arcadeExecutorProvider=new b,this._activeAssociationsInput=null,this._activeFormInputsByElementId=new Map,this._emptyForm=new j({inputs:[]}),this._emptyFormTemplate=new B({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new u,this._updatingHandles=new _,this._layerTemplateMap=new u,this._layerContingentValuesMap=new u,this._workingFeatures=new i,this._expressionsManager=new T({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:x}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([m(()=>this.features,"after-changes",()=>{this.goHome(),this.notifyChange("layers"),this._prepare()},d),f(()=>[this.features,this.map,this.timeZone,this.editType],()=>this._prepare(),d),f(()=>this.activeForm,()=>{this.goHome(),this._activeFormInputsByElementId.clear(),this._syncAttachments()},d),f(()=>this.activeFeature,()=>{this.goHome(),this._syncAttachments()},d),f(()=>this.page,t=>{const e=[...this.pageStack];if(e.includes(t))for(;e.length&&e.at(-1)!==t;)e.pop();else e.push(t);this.pageStack=e},g)]),this._prepare()}destroy(){this._prepareTask=l(this._prepareTask),this._workingFeatures.destroyAll(),h(this._expressionsManager),this._updatingHandles.destroy(),this._reactiveGraphicLookup=new u,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get activeFeature(){const t=this.activeFeatureIndex;return t<0?null:this.features.at(t)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const t=this._workingFeatures.at(this.activeFeatureIndex);if(!t)return this._emptyForm;const e=this._featureFormMap.get(t);if(e)return e;const s=this._makeBatchFormInputsForFeature(t);return s!==this._emptyForm&&this._featureFormMap.set(t,s),s}get activeLayer(){const{activeFeature:t}=this;if(!t)return null;return I(t)??null}get activeAssociationsInput(){return this._activeAssociationsInput}get calculating(){return this._expressionsManager.calculating}get expressionsManager(){return this._expressionsManager}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:t}=this;return this.invalidFeatures.some(e=>e!==t)}get hasAsyncArcadeExpressions(){return this._hasAsyncArcadeExpressions}get hasTooManyFeatures(){return this._workingFeatures.length>this.maximumFeatureCount}get hasTooManyComplexFeatures(){return this._workingFeatures.length>this.maximumFeatureCountWithComplexForms&&this.hasAsyncArcadeExpressions}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.visibleInputs.length>0}get hasLayersWithContingentValues(){for(const t of this.layers){const e=this._layerContingentValuesMap.get(t);if(e&&e.size>0)return!0}return!1}get visibleInputs(){return this.activeForm.inputs.filter(t=>t.visible)}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return"noElements";const t=new Set;for(const e of this.activeForm.inputs)switch(e.visibilityCode){case"hidden:not-in-all-layers":case"hidden:no-domain-in-common":t.add("noElementsInCommon");break;case"hidden:field-definition":case"hidden:group-visibility-expression:all-features":case"hidden:visibility-expression:all-features":t.add("allElementsHidden");break;case"hidden:group-visibility-expression:some-features":case"hidden:visibility-expression:some-features":return"elementsHiddenInSome"}return t.has("allElementsHidden")?"allElementsHidden":"noElementsInCommon"}get page(){return this.selectedAttachmentAddElementId?"adding-attachments":this.selectedAttachment?"viewing-attachment-details":this.activeAssociationsInput?.associatedLayer?"viewing-associated-features":this.activeAssociationsInput?"viewing-associated-layers":"default"}get status(){const t=this._prepareTask;return null==t?"not-loaded":t.finished?null!=t.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid&&Array.from(this._featureFormMap.values()).every(t=>t.valid)}get layers(){const t=new Set;return this.features.forEach(e=>{const s=I(e);s&&t.add(s)}),Array.from(t)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{name:"submit",results:this._makeSubmitResults(),valid:this.valid})}get selectedAttachment(){return this._get("selectedAttachment")??null}set selectedAttachment(t){this._set("selectedAttachment",t),null!=t&&(this.selectedAttachmentAddElementId=null)}get selectedAttachmentAddElementId(){return this._get("selectedAttachmentAddElementId")??null}set selectedAttachmentAddElementId(t){this._set("selectedAttachmentAddElementId",t)}get selectedAttachmentAddInput(){const t=this.selectedAttachmentAddElementId,e=this.activeForm;return t&&e&&e.allAttachmentElementInputs.find(e=>e.template.elementId===t)||null}get selectedAttachmentDetails(){const t=this.selectedAttachment,e=this.activeForm;if(!t||!e)return null;const s=e.allAttachmentElementInputs.find(e=>e.template.elementId===t.elementId);if(!s)return null;const i=s.attachments.findIndex(e=>w(e)===t.attachmentKey);if(-1===i)return null;return{attachment:s.attachments[i],input:s}}findFieldInput(t){if(null==t)return;const e=this._activeFormInputsByElementId;if(e.has(t))return e.get(t);const s=this.activeForm.allFieldInputs.find(e=>e.template.elementId===t);return void 0!==s?(e.set(t,s),s):void 0}getFirstVisibleInvalidFieldInput(){if(this.hasVisibleInputs&&!this.activeForm.valid)for(const t of this.visibleInputs){if(L(t)){const e=t.inputs.find(t=>S(t)&&!t.valid);if(e)return{input:e,groupInput:t}}if(S(t)&&!t.valid)return{input:t}}}getFieldInputValue(t){return this.findFieldInput(t)?.value}getValues(t){const e=this._reactiveGraphicLookup.get(t);if(!e)throw new a("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...e.attributes}}async goBack(){const{page:t}=this;"viewing-attachment-details"!==t?"adding-attachments"!==t?"viewing-associated-features"!==t?"viewing-associated-layers"!==t||this.setActiveAssociationsInput(null):this.setActiveAssociationsLayer(null):this.setSelectedAttachmentAddElementId(null):this.setSelectedAttachment(null)}async goHome(){this.setSelectedAttachment(null),this.setActiveAssociationsLayer(null),this.setActiveAssociationsInput(null),this.setSelectedAttachmentAddElementId(null)}notifyGeometriesChanged(t){const e=[];for(const s of t){const t=this._reactiveGraphicLookup.get(s);t&&(e.push(t),t.geometry=s.geometry)}this._expressionsManager.runGeometryDependentExpressions(e)}async setFieldInputValue(t,e){const s=new Set(this.invalidFeatures);await t.setValueFromUser(e),this.userHasChangedValues=!0,this._trackValidityChange(s),this.emit("value-change",{features:t.features.toArray().map(t=>t.source),fieldName:t.fieldName,name:"value-change",value:e})}async setValue(t,e){const s=this.findFieldInput(t);if(null==s)throw new a("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${t} because none was found in the active form`);await this.setFieldInputValue(s,e)}async stageAddAttachments(t,e){if(0===e.length)return[];const s=this._findAttachmentInput(t);if(!s)return[];const i=await s.stageAddAttachments(e,this._expressionsManager.arcadeContext);return 0===i.length||(this.userHasChangedValues=!0,this._emitAttachmentsChange(s)),i}stageDeleteAttachment(t,e){const s=this._findAttachmentInput(t);if(!s)return;const i=this._findAttachment(s,e);i&&(s.stageDeleteAttachment(i),this.userHasChangedValues=!0,this._emitAttachmentsChange(s))}stageRenameAttachment(t,e,s){const i=this._findAttachmentInput(t);if(!i)return;const a=this._findAttachment(i,e);a&&0!==s.trim().length&&(i.stageRenameAttachment(a,s.trim()),this.userHasChangedValues=!0,this._emitAttachmentsChange(i))}async stageReplaceAttachment(t,e,s){const i=this._findAttachmentInput(t);if(!i)return;const a=this._findAttachment(i,e);a&&(await i.stageReplaceAttachment(a,s,this._expressionsManager.arcadeContext),this.userHasChangedValues=!0,this._emitAttachmentsChange(i))}clearAttachmentChanges(t){const e=this._findAttachmentInput(t);e&&(e.clearAttachmentChanges(),this._emitAttachmentsChange(e))}setActiveAssociationsInput(t){this._activeAssociationsInput=t}setActiveAssociationsLayer(t){this._activeAssociationsInput?.setAssociatedLayer(t)}setActiveAssociationType(t){this._activeAssociationsInput?.setActiveAssociationType(t)}setSelectedAttachment(t){this.selectedAttachment=t??null}setSelectedAttachmentAddElementId(t){this.selectedAttachmentAddElementId=t??null}userChangesHaveMadeFeatureInvalid(t){return!!this._reactiveGraphicLookup.get(t)?.userChangesHaveMadeInvalid}async _trackValidityChange(t){await y(()=>!1===this.calculating);const e=this.invalidFeatures;for(const s of e)!1===t.has(s)&&this._reactiveGraphicLookup.has(s)&&(this._reactiveGraphicLookup.get(s).userChangesHaveMadeInvalid=!0)}validate(){return!1}_makeBatchFormInputsForFeature(t){const e=this._layerTemplateMap.get(t.layer);return e?H(e,{allFeatures:new i([t]),expressionsManager:this._expressionsManager,map:this.map}):this._emptyForm}_makeSubmitResults(){const t=new Map;for(const[s,i]of this._reactiveGraphicLookup){const a=[],n=[],r=this._featureFormMap.get(i)?.allAttachmentElementInputs??[];for(const t of r)e(a,t.toSubmitEdits()),t.valid||n.push(t.template.elementId);t.set(s,{feature:s,values:{...i.attributes},invalidFields:[],attachmentEdits:a,invalidAttachmentElementIds:n})}for(const e of this.sharedForm.allFieldInputs)for(const s of e.invalidFeatures)t.get(s)?.invalidFields.push(e.fieldName);return Array.from(t.values())}_findAttachmentInput(t){const e=this.activeForm.allAttachmentElementInputs.find(e=>e.template.elementId===t);return e||r.getLogger(this).error(`Attachment input not found for elementId '${t}'`),e}_findAttachment(t,e){const s=t.findAttachment(e);return s||r.getLogger(this).error(`Attachment '${e}' not found for attachment element '${t.template.elementId}'`),s}_makeAttachmentEdits(t){const s=[];for(const i of t.allAttachmentElementInputs)e(s,i.toSubmitEdits());return s}_emitAttachmentsChange(t){const e=t.single.feature;if(!e)return;const s=this._featureFormMap.get(e);this.emit("attachments-change",{name:"attachments-change",feature:e.source,attachmentEdits:this._makeAttachmentEdits(s??this.activeForm),valid:this.valid})}_prepare(){this._hasAsyncArcadeExpressions=!1,this._prepareTask=l(this._prepareTask),this._updateWorkingFeatures(),h(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new T({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??F.WebMercator,map:this.map,timeZone:this.timeZone||"system"}});const{layers:t}=this;if(0===t.length)return;const e=s(async e=>{try{c(e);const s=new Map;for(const a of t){const t=await R(a);if(c(e),t){const e=t.fieldGroups.flatMap(t=>t.fields);this._layerContingentValuesMap.set(a,new Set(e))}else this._layerContingentValuesMap.set(a,new Set);const i=O(this.layerInfos,a),n=await G(a,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this.timeZone},i?.formTemplate);c(e),this._layerTemplateMap.set(a,n);const r=n.getExpressionExecutorsForLayer(a);if(this._expressionsManager.layerExpressionsModelMap.set(a,new V({preserveFieldValuesWhenHidden:n.preserveFieldValuesWhenHidden,executorMap:r})),!this._hasAsyncArcadeExpressions)for(const e of r.keys()){const t=r.get(e);if(this._hasAsyncArcadeExpressions=!0===(t.editableExpression?.isAsync||t.requiredExpression?.isAsync||t.valueExpression?.isAsync||t.visibilityExpression?.isAsync),this._hasAsyncArcadeExpressions)break}for(const e of n.elements){if(U(e))continue;const t=e.clone();W(t)&&(t.elements=t.elements.filter(t=>!U(t)));const{elementId:i}=t;s.has(i)?s.get(i).foldIn(t):s.set(i,t)}}if(this.hasTooManyComplexFeatures)throw new a("too-many-features-with-complex-forms","There are too many features to load into the form with the configured complexity");if(this.hasTooManyFeatures)throw new a("too-many-features","There are too many features to load into the form.");const i=new B({elements:Array.from(s.values())});this.sharedFormTemplate=i,this.sharedForm=H(i,{allFeatures:this._workingFeatures,expressionsManager:this._expressionsManager,map:this.map}),await this._expressionsManager.runAllExpressions(this._workingFeatures.toArray())}catch(s){throw p(s)||r.getLogger(this).error("Failed preparing form",s),s}});this._updatingHandles.consumePromise(e.promise),this._prepareTask=e}_updateWorkingFeatures(){this._workingFeatures.destroyAll();for(const e of this._featureFormMap.values())e.destroy();this._featureFormMap.clear(),this._attachmentCache.clear();const{features:t}=this;if(this._reactiveGraphicLookup=new u,0!==t.length){this._workingFeatures.addMany(t.map(E));for(const t of this._workingFeatures)this._reactiveGraphicLookup.set(t.source,t)}}async _syncAttachments(){const{activeFeature:t,activeLayer:e,activeForm:s}=this;if(!(t&&s&&C(e)&&M(e)))return;const i=t.getObjectId();if(null==i)return;const a=this._attachmentCache.get(e),n=s.allAttachmentElementInputs;if(!n.length)return;let r;if(a){const t=a.get(i);t&&(r=t)}if(!r){r=await k(e,i,n);o(this._attachmentCache,e,()=>new u).set(i,r)}for(const o of n)o.applyFetchedAttachments(z(o,r))}};t([v()],Z.prototype,"_attachmentCache",void 0),t([v({readOnly:!0})],Z.prototype,"activeFeature",null),t([v()],Z.prototype,"activeFeatureIndex",void 0),t([v({readOnly:!0})],Z.prototype,"activeForm",null),t([v({readOnly:!0})],Z.prototype,"activeLayer",null),t([v()],Z.prototype,"activeAssociationsInput",null),t([v()],Z.prototype,"disabled",void 0),t([v()],Z.prototype,"calculating",null),t([v()],Z.prototype,"editType",void 0),t([v()],Z.prototype,"features",void 0),t([v()],Z.prototype,"expressionEvaluationFailed",null),t([v()],Z.prototype,"hasNonActiveInvalidFeatures",null),t([v()],Z.prototype,"hasAsyncArcadeExpressions",null),t([v()],Z.prototype,"_hasAsyncArcadeExpressions",void 0),t([v()],Z.prototype,"invalidFeatures",null),t([v()],Z.prototype,"hasVisibleInputs",null),t([v()],Z.prototype,"hasLayersWithContingentValues",null),t([v()],Z.prototype,"maximumFeatureCount",void 0),t([v()],Z.prototype,"maximumFeatureCountWithComplexForms",void 0),t([v()],Z.prototype,"visibleInputs",null),t([v()],Z.prototype,"map",void 0),t([v()],Z.prototype,"noVisibleElementsReason",null),t([v()],Z.prototype,"page",null),t([v()],Z.prototype,"pageStack",void 0),t([v()],Z.prototype,"readOnly",void 0),t([v()],Z.prototype,"spatialReference",void 0),t([v()],Z.prototype,"submitHasBeenAttempted",void 0),t([v()],Z.prototype,"timeZone",void 0),t([v()],Z.prototype,"updating",null),t([v()],Z.prototype,"valid",null),t([v()],Z.prototype,"layers",null),t([v()],Z.prototype,"mode",null),t([v()],Z.prototype,"sharedForm",void 0),t([v()],Z.prototype,"sharedFormTemplate",void 0),t([v()],Z.prototype,"selectedAttachment",null),t([v()],Z.prototype,"selectedAttachmentAddElementId",null),t([v()],Z.prototype,"selectedAttachmentAddInput",null),t([v()],Z.prototype,"selectedAttachmentDetails",null),t([v()],Z.prototype,"userHasChangedValues",void 0),t([v()],Z.prototype,"layerInfos",void 0),t([v()],Z.prototype,"_arcadeExecutorProvider",void 0),t([v()],Z.prototype,"_activeAssociationsInput",void 0),t([v()],Z.prototype,"_prepareTask",void 0),t([v()],Z.prototype,"_reactiveGraphicLookup",void 0),t([v()],Z.prototype,"_layerTemplateMap",void 0),t([v()],Z.prototype,"_layerContingentValuesMap",void 0),t([v()],Z.prototype,"_workingFeatures",void 0),t([v()],Z.prototype,"_expressionsManager",void 0),Z=t([A("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],Z);const D=Z;function P(t){return null!=t&&t.trim().length>0}function $(t,e){const s=t.keywords;return P(s)&&s.toLowerCase()===e}function z(t,e){const s="attachment"===t.input?.type?t.input.attachmentAssociationType:"exact",i=t.attachmentKeyword;if("any"===s)return e;if("exactOrNone"===s){if(N(i))return e.filter(t=>!P(t.keywords));const t=i.toLowerCase();return e.filter(e=>!P(e.keywords)||$(e,t))}if(N(i))return e;const a=i.toLowerCase();return e.filter(t=>$(t,a))}export{D as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{substitute as e}from"../../intl.js";import t from"../../rest/support/AttachmentQuery.js";import{ReactiveGraphic as i}from"./ReactiveGraphic.js";import{isMultipleChoiceFieldInput as n}from"./inputs/support/inputUtils.js";import{getIntlOptionsForField as
|
|
2
|
+
import{substitute as e}from"../../intl.js";import t from"../../rest/support/AttachmentQuery.js";import{ReactiveGraphic as i}from"./ReactiveGraphic.js";import{isMultipleChoiceFieldInput as n}from"./inputs/support/inputUtils.js";import{getIntlOptionsForField as r}from"../support/dateUtils.js";import{isEmptyValue as o,getRangeErrorMessage as a,shouldUseScientificNotation as s,scientificNumberFormatOptions as l,numberFormatOptions as u}from"../support/forms/formUtils.js";const c=(e,t)=>null!=e&&e.input?.type===t;function d(e){return new i({source:e})}function p(t,i,o,c){const{dataType:d,minLength:p}=t,f=o?.validationErrors;if(!f||!i)return null;if("batch-attribute-form-validation::features-have-different-errors"===i)return f.invalidBatchFormType;if("input-validation-error::cannot-be-empty"===i)return f.cannotBeNull;if("domain-validation-error::value-out-of-range"===i||"numeric-range-validation-error::out-of-range"===i){const{field:i,range:n}=t,o={type:"date",intlOptions:{timeZone:"date"===i.type&&c?c:void 0,...r(i)}},p=a(n,f);return e(p,n,{format:{max:"date"===d?o:null!=n.max&&s(n.max)?l:u,min:"date"===d?o:null!=n.min&&s(n.min)?l:u}})}return"domain-validation-error::invalid-coded-value"===i?f.invalidCodedValue:"type-validation-error::invalid-type"===i?f.invalidType:"length-validation-error::too-short"===i?e(f.tooShort,{min:p}):"multiple-choice-validation-error::too-few-selected-choices"===i&&n(t)?e(f.tooFewSelectedChoices,{min:t.input.minimumChoices}):"multiple-choice-validation-error::too-many-selected-choices"===i&&n(t)?e(f.tooManySelectedChoices,{max:t.input.maximumChoices}):null}function f(e,t,i){const n=i?.validationErrors;if(!n)return null;let r=null;for(const o of e.invalidHiddenInputs)switch(o.effectiveVisibilityCode){case"hidden:visibility-expression:all-features":case"hidden:group-visibility-expression:all-features":case"hidden:field-definition":return"single"===t?n.nonVisibleError_changeValues:n.nonVisibleError_checkIndividualFeatures;case"hidden:no-domain-in-common":case"hidden:visibility-expression:some-features":case"hidden:group-visibility-expression:some-features":case"hidden:not-in-all-layers":r=n.nonVisibleError_checkIndividualFeatures;break;case"visible":continue;default:o.effectiveVisibilityCode}return r}function m(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"geojson"===e.type||"knowledge-graph-sublayer"===e.type||"oriented-imagery"===e.type||"scene"===e.type||"subtype-sublayer"===e.type)}function y(e){return!!m(e)||!!(null!=e&&"object"==typeof e&&"type"in e&&e.type&&"id"in e&&e.id&&"fields"in e&&e.fields&&"fieldsIndex"in e&&e.fieldsIndex&&"objectIdField"in e&&e.objectIdField&&"capabilities"in e&&"getField"in e&&e.getField)}function h(e){return y(e)&&"queryAttachments"in e}function v(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"subtype-sublayer"===e.type)}function b(e){if(!h(e))return!1;const t=e?.effectiveCapabilities??e?.capabilities;return!(!t?.data?.supportsAttachment||!t.operations.supportsQueryAttachments)}async function g(e,i,n){const r=new Set;let a=!1;for(const t of n){if("attachment"===t.input?.type&&("any"===t.input.attachmentAssociationType||"exactOrNone"===t.input.attachmentAssociationType)){a=!0;break}if(o(t.attachmentKeyword)){a=!0;break}r.add(t.attachmentKeyword)}const s=r.size&&!a?Array.from(r):void 0,l=new t({objectIds:[i],where:"1=1",returnMetadata:!0,keywords:s});e.capabilities?.query?.supportsCacheHint&&(l.cacheHint=!0);return(await e.queryAttachments(l))[i]??[]}function w(e,t,i,n){const r=e.get(t)?.get(i)??[];if(!n?.length)return r;const o=new Set(n.map(e=>e.toLowerCase()));return r.filter(e=>o.has(e.keywords.toLowerCase()))}export{d as createReactiveGraphic,w as getAttachmentsForKeywords,f as getHiddenFieldsValidationErrorMessage,p as getVisibleFieldInputValidationErrorMessage,v as isAssociationsLayerUnion,y as isAttributeFormSupportedLayer,m as isAttributeFormSupportedLayerUnion,h as isAttributeFormSupportedLayerWithAttachments,c as isElementTemplateWithInputType,b as layerSupportsQueryAttachments,g as queryAttachmentsForElements};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{property as l,subclass as i}from"../../../core/accessorSupport/decorators.js";import{
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{property as l,subclass as i}from"../../../core/accessorSupport/decorators.js";import{deepFilterInputs as n,isFieldInput as s,isAttachmentElementInput as r,isEditableInput as p,isUtilityNetworkAssociationsElementInput as o}from"./support/inputUtils.js";let u=class extends e{constructor(t){super(t),this.inputs=[],this.template=null}get allFieldInputs(){return n(this.inputs,s)}get allAttachmentElementInputs(){return n(this.inputs,r)}get allEditableInputs(){return n(this.inputs,p)}get allUtilityNetworkAssociationsElementInputs(){return n(this.inputs,o)}get description(){return this.template?.description??null}get hasInvalidHiddenInputs(){return this.invalidHiddenInputs.length>0}get invalidFeatures(){return Array.from(new Set(this.allFieldInputs.flatMap(t=>t.invalidFeatures)))}get invalidHiddenInputs(){return this.allFieldInputs.filter(t=>!t.valid&&!t.effectiveVisible)}get title(){return this.template?.title??null}get valid(){return this.allEditableInputs.every(t=>t.valid)}};t([l()],u.prototype,"allFieldInputs",null),t([l()],u.prototype,"allAttachmentElementInputs",null),t([l()],u.prototype,"allEditableInputs",null),t([l()],u.prototype,"allUtilityNetworkAssociationsElementInputs",null),t([l()],u.prototype,"description",null),t([l()],u.prototype,"inputs",void 0),t([l()],u.prototype,"hasInvalidHiddenInputs",null),t([l()],u.prototype,"invalidFeatures",null),t([l()],u.prototype,"invalidHiddenInputs",null),t([l()],u.prototype,"template",void 0),t([l()],u.prototype,"title",null),t([l()],u.prototype,"valid",null),u=t([i("esri.widgets.BatchAttributeForm.inputs.BatchFormInputs")],u);const a=u;export{a as default};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type Graphic from "../../../Graphic.js";
|
|
2
2
|
import type Field from "../../../layers/support/Field.js";
|
|
3
|
-
import type BatchAttributeFormViewModel from "../BatchAttributeFormViewModel.js";
|
|
4
3
|
import type EditableInput from "./EditableInput.js";
|
|
5
4
|
import type GroupInput from "./GroupInput.js";
|
|
6
5
|
import type { Input } from "../../../form/elements/inputs.js";
|
|
@@ -23,13 +22,6 @@ export interface MultipleChoiceOtherChoiceRenderState {}
|
|
|
23
22
|
* @see [BatchFormInputs](https://developers.arcgis.com/javascript/latest/references/core/widgets/BatchAttributeForm/inputs/BatchFormInputs/)
|
|
24
23
|
*/
|
|
25
24
|
export default class FieldInput extends EditableInput<any> {
|
|
26
|
-
/**
|
|
27
|
-
* Clears stored inline other-choice state associated with a batch attribute form view model.
|
|
28
|
-
*
|
|
29
|
-
* @param viewModel - The view model whose inline other-choice state should be cleared.
|
|
30
|
-
* @param options - Additional options for clearing stored state. When `includeDraftValues` is `true`, clears stored draft values in addition to explicit checked state.
|
|
31
|
-
*/
|
|
32
|
-
static clearMultipleChoiceOtherChoiceStateForViewModel(viewModel: BatchAttributeFormViewModel | null, options?: { includeDraftValues?: boolean; }): void;
|
|
33
25
|
constructor(properties: FieldInputProperties);
|
|
34
26
|
/**
|
|
35
27
|
* The type of data displayed by the field input. Possible values are listed below.
|
|
@@ -78,6 +70,11 @@ export default class FieldInput extends EditableInput<any> {
|
|
|
78
70
|
get maxLength(): number;
|
|
79
71
|
/** The minimum length of the input. If no length is specified, the value is `-1`. */
|
|
80
72
|
get minLength(): number;
|
|
73
|
+
/** The checked state derived from the current other-choice values across all features. */
|
|
74
|
+
get multipleChoiceOtherChoiceCheckboxState(): {
|
|
75
|
+
checked: boolean;
|
|
76
|
+
indeterminate: boolean;
|
|
77
|
+
};
|
|
81
78
|
/** Indicates whether the field is required. This property will be true if it is required for any associated layers of the input. */
|
|
82
79
|
get required(): boolean;
|
|
83
80
|
/** The type of input. */
|
|
@@ -90,35 +87,12 @@ export default class FieldInput extends EditableInput<any> {
|
|
|
90
87
|
get userHasChangedValue(): boolean;
|
|
91
88
|
/** Indicates whether the field has any validation errors. Evaluates to `true` only if the value of this field is valid for all features. */
|
|
92
89
|
get valid(): boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Indicates whether a stored inline other-choice draft value can be restored.
|
|
95
|
-
*
|
|
96
|
-
* @param value - The draft value to evaluate.
|
|
97
|
-
* @returns `true` if the value can be restored; otherwise, `false`.
|
|
98
|
-
*/
|
|
99
|
-
canRestoreMultipleChoiceOtherChoiceDraftValue(value: FieldValue | undefined): boolean;
|
|
100
90
|
/**
|
|
101
91
|
* Returns the explicit inline other-choice checked state, if one has been stored.
|
|
102
92
|
*
|
|
103
93
|
* @returns The explicit checked state, or `undefined` if the state has not been set.
|
|
104
94
|
*/
|
|
105
95
|
getExplicitMultipleChoiceOtherChoiceCheckedState(): boolean | undefined;
|
|
106
|
-
/**
|
|
107
|
-
* Returns the checked state derived from the current other-choice values across all features.
|
|
108
|
-
*
|
|
109
|
-
* @returns The checked and indeterminate state for the inline other-choice checkbox.
|
|
110
|
-
*/
|
|
111
|
-
getMultipleChoiceOtherChoiceCheckboxState(): {
|
|
112
|
-
checked: boolean;
|
|
113
|
-
indeterminate: boolean;
|
|
114
|
-
};
|
|
115
|
-
/**
|
|
116
|
-
* Returns the stored inline other-choice draft value for a feature, if present.
|
|
117
|
-
*
|
|
118
|
-
* @param feature - The feature whose draft other-choice value should be returned.
|
|
119
|
-
* @returns The stored draft value, or `undefined` if no draft value exists for the feature.
|
|
120
|
-
*/
|
|
121
|
-
getMultipleChoiceOtherChoiceDraftValue(feature: object): FieldValue | undefined;
|
|
122
96
|
/**
|
|
123
97
|
* Returns the current render state for inline multiple-choice "Other" controls.
|
|
124
98
|
*
|
|
@@ -140,22 +114,9 @@ export default class FieldInput extends EditableInput<any> {
|
|
|
140
114
|
* @param isChecked - Indicates whether the inline other-choice checkbox is checked.
|
|
141
115
|
*/
|
|
142
116
|
setExplicitMultipleChoiceOtherChoiceCheckedState(isChecked: boolean): void;
|
|
143
|
-
/**
|
|
144
|
-
* Stores inline other-choice draft values from the current other-choice field values on the provided features.
|
|
145
|
-
*
|
|
146
|
-
* @param features - The features from which to read current other-choice field values.
|
|
147
|
-
*/
|
|
148
|
-
setMultipleChoiceOtherChoiceDraftValuesFromFeatures(features: Pick<Graphic, "getAttribute">[]): void;
|
|
149
117
|
/**
|
|
150
118
|
* @param value
|
|
151
119
|
* @internal
|
|
152
120
|
*/
|
|
153
121
|
setValueFromUser(value: FieldValue): Promise<void>;
|
|
154
|
-
/**
|
|
155
|
-
* Stores the same inline other-choice draft value for the provided features.
|
|
156
|
-
*
|
|
157
|
-
* @param features - The features whose draft other-choice values should be updated.
|
|
158
|
-
* @param value - The draft value to store for each feature.
|
|
159
|
-
*/
|
|
160
|
-
stashMultipleChoiceOtherChoiceDraftValueForFeatures(features: object[], value: FieldValue): void;
|
|
161
122
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{property as i,subclass as l}from"../../../core/accessorSupport/decorators.js";import{isMultipleChoiceInput as r}from"../../../form/elements/inputs/inputUtils.js";import o from"../../../layers/support/CodedValue.js";import n from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as s,dateTimeFieldValuesToNumericRange as a,isDomainValidForField as u}from"../../../layers/support/domainUtils.js";import{isNumericField as h,isStringField as p,isTimeOnlyField as c,getFieldRange as m,isDateOnlyField as d,isTimestampOffsetField as f}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as C}from"../../../layers/support/layerUtils.js";import g from"../../../layers/support/RangeDomain.js";import{isAnyDateField as y}from"../../../smartMapping/support/utils.js";import{isNumber as b}from"../../../support/guards.js";import x from"./EditableInput.js";import{visibilityCodeToBoolean as v,differentValuesString as V,isFieldInputWithShowNoValueOptionInput as M}from"./support/inputUtils.js";import{isEmptyValue as _,getMaxLength as O,getMinLength as F,dateIsValid as S,validateFormValue as w}from"../../support/forms/formUtils.js";const E="esri_BatchAttributeForm_other_choice_checked",D=new WeakMap;let k=class extends x{constructor(e){super(e),this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){const{field:e}=this;return h(e)?"number":p(e)?"text":y(e)||c(e)?"date":"unsupported"}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const e=this.template;if(null!=e.label&&""!==e.label)return e.label;const{field:t,layers:i}=this;if(1===i.length){const e=i[0];if(C(e)){const i=e.getFieldAlias(t.name);if(null!=i&&""!==i)return i}}return t.alias||t.name}get effectiveVisible(){return v(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>i.getAttribute(e)===t)}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get multipleChoiceInput(){const{input:e}=this;return e&&r(e)?e:null}get multipleChoiceChoices(){const{multipleChoiceInput:e}=this;if(!e)return null;const t=[],i=new Set;for(const l of e.choices){const{value:e}=l;i.has(e)||(i.add(e),t.push(l))}return t}get multipleChoiceValues(){return this.multipleChoiceChoices?.map(e=>e.value)??null}get multipleChoiceOtherChoiceFieldName(){return this.multipleChoiceInput?.otherChoice?.fieldName??null}get multipleChoiceOtherChoiceHint(){return this.multipleChoiceInput?.otherChoice?.hint??""}get multipleChoiceOtherChoiceLabel(){return this.multipleChoiceInput?.otherChoice?.label??null}get hasMultipleChoiceOtherChoiceField(){const{multipleChoiceOtherChoiceFieldName:e}=this;return!!e&&this.layers.every(t=>null!=t.getField(e))}get shouldShowMultipleChoiceOtherChoice(){return null!=this.multipleChoiceInput?.otherChoice&&this.hasMultipleChoiceOtherChoiceField}set shouldShowMultipleChoiceOtherChoice(e){this._overrideIfSome("shouldShowMultipleChoiceOtherChoice",e)}get multipleChoiceOtherChoiceValue(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return null;const t=this.features.map(t=>t.getAttribute(e));if(0===t.length)return null;const[i]=t;return t.every(e=>e===i)?i:V}get multipleChoiceOtherChoiceMaxLength(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return;let t;for(const i of this.layers){const l=i.getField(e)?.length;null==l||l<0||(t=null==t?l:Math.min(t,l))}return t}getMultipleChoiceOtherChoiceRenderState(e){const t=this.multipleChoiceOtherChoiceFieldName??void 0,i=this.shouldShowMultipleChoiceOtherChoice,l=this.multipleChoiceOtherChoiceValue,r=i?this.getMultipleChoiceOtherChoiceCheckboxState():{checked:!1,indeterminate:!1},o=i?this.getExplicitMultipleChoiceOtherChoiceCheckedState():void 0,n=void 0===o?r:{checked:o,indeterminate:!1};return{fieldName:t,hint:this.multipleChoiceOtherChoiceHint,label:this.multipleChoiceOtherChoiceLabel??e,shouldShow:i,checkboxState:n,value:l,normalizedValue:l===E?"":l,maxLength:this.multipleChoiceOtherChoiceMaxLength}}getMultipleChoiceOtherChoiceCheckboxState(){const e=this.multipleChoiceOtherChoiceFieldName;if(!e)return{checked:!1,indeterminate:!1};const t=this.features.map(t=>t.getAttribute(e));return{checked:t.length>0&&t.every(e=>!_(e)),indeterminate:t.some(e=>!_(e))&&t.some(e=>_(e))}}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){this.hasExplicitMultipleChoiceOtherChoiceCheckedState()||this.setExplicitMultipleChoiceOtherChoiceCheckedState(this.getMultipleChoiceOtherChoiceCheckboxState().checked)}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return void 0!==this.getExplicitMultipleChoiceOtherChoiceCheckedState()}getExplicitMultipleChoiceOtherChoiceCheckedState(){const e=this._multipleChoiceOtherChoiceStateKey;if(e)return this._multipleChoiceOtherChoiceCheckedStateStore.get(e)}setExplicitMultipleChoiceOtherChoiceCheckedState(e){const t=this._multipleChoiceOtherChoiceStateKey;t&&this._multipleChoiceOtherChoiceCheckedStateStore.set(t,e)}stashMultipleChoiceOtherChoiceDraftValueForFeatures(e,t){const i=this._multipleChoiceOtherChoiceStateKey;if(i)for(const l of e)l.stashAttribute(i,t)}setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e){const t=this._multipleChoiceOtherChoiceStateKey,i=this.multipleChoiceOtherChoiceFieldName;if(t&&i)for(const l of e)l.stashAttribute(t,l.getAttribute(i))}getMultipleChoiceOtherChoiceDraftValue(e){const t=this._multipleChoiceOtherChoiceStateKey;if(t)return e.getStashedAttribute(t)}canRestoreMultipleChoiceOtherChoiceDraftValue(e){return!(null==e||""===e||e===E||e===V)}static clearMultipleChoiceOtherChoiceStateForViewModel(e,t={}){const{includeDraftValues:i=!1}=t;if(!e)return;const l=new Set;for(const r of e.sharedForm.allFieldInputs)l.add(r.expressionsManager);for(const r of e.activeForm.allFieldInputs)l.add(r.expressionsManager);for(const r of l)D.get(r)?.clear();if(i){const t=new Set;for(const i of e.sharedForm.allFieldInputs)for(const e of i.features)t.add(e);for(const e of t)e.clearStashedAttributes()}}get invalidFeatures(){return this.errors.map(e=>e.feature)}get _multipleChoiceOtherChoiceStateKey(){const e=this.multipleChoiceOtherChoiceFieldName;return e?`${this.template.elementId}:${e}`:null}get _multipleChoiceOtherChoiceCheckedStateStore(){const e=this.expressionsManager;if(!e)return new Map;let t=D.get(e);return t||(t=new Map,D.set(e,t)),t}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this;return!this.required&&(!M(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return M(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const{input:e}=this;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return O({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return F({dataType:this.dataType,field:this.field,input:this.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=s(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?m(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){return(!this.required||!this.distinctValues.some(e=>_(e)))&&!!this.valid}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:V}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const e=this.codedValueDomainOptions,{value:t}=this,i=null==t||t===V||e.some(e=>e.value===t)?[]:[{name:`${t}`,value:t}];return[e,i]}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const l of this.features){if(null==i.getExpressionExecutorsForLayer(l.layer)?.requiredExpression)continue;t=!1;const r=this._lookupEvaluatedExpression(l,"required");"success"===r?.status?e=e||!0===r.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const{input:e}=this;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=a(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:l}=e;i={max:null!=t&&S(t)?t.getTime():null,min:null!=l&&S(l)?l.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:l}=this;if("date"!==this.dataType)return{};if(!l)return this._fieldShouldHaveDomain?{}:e;const r=s(i,l);if(!r)return e;const{max:o,min:n,rawMax:a,rawMin:u}=e,{type:h}=t.field;if("date"===h){const{max:e,min:t}=r;return{max:b(o)&&(null===e||null!=e&&o<=e)?o:e??null,min:b(n)&&(null===t||null!=t&&n>=t)?n:t??null}}if("date-only"===h||"time-only"===h||"timestamp-offset"===h){const{max:e,min:t,rawMax:i,rawMin:l}=r,s=b(o)&&a&&(null==e||o<e),h=b(n)&&u&&(null==t||n>t);return{max:s?o:e,min:h?n:t,rawMax:s?a:i,rawMin:h?u:l}}return{}}async setValueFromUser(e){this.userHasChangedValue=!0;const t=[],i=this.fieldName;for(const l of this.features)l.getAttribute(i)!==e&&t.push(l);this._setValue(e),await this.expressionsManager.valueChanged(i,t)}_setValue(e){const{fieldName:t}=this;for(const i of this.features)i.setAttribute(t,e)}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:l,range:r}=this,o=[],{multipleChoiceInput:n}=this;for(const s of this.features){const{layer:a}=s,u=a.getField(t)??this.field,h=a.getFieldDomain(t,{feature:s.plainGraphic}),p=this.calculateDomain([h]),c=this._requiredForFeature(s),m=s.getAttribute(t),d=w(m,{dataType:e,domain:p,field:u,maxLength:i,minLength:l,multipleChoice:n,range:r,required:c});d&&o.push({error:d,feature:s.source})}return o}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&u(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let l=null;switch(t?.type){case"range":l=this._intersectRangeDomains(e);break;case"coded-value":l=this._intersectCodedValueDomains(e)}return l}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const o of e)for(const[e,i]of t){o.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let l=t;if(i){l=new Map;for(const[e,r]of i)t.has(e)&&l.set(e,r)}const r=Array.from(l.entries()).map(([e,t])=>new o({code:e,name:t}));return r.length?new n({codedValues:r}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let l=1;l<e.length;l++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[l])}if(t&&!u(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof g){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:l}=this;return d(l)||c(l)||f(l)?a(l,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new g,l=this._getMinMaxFromRangeDomain(e),r=this._getMinMaxFromRangeDomain(t),{field:o}=this,n=this._getValidRangeValue(l.min,-1/0),s=this._getValidRangeValue(l.max,1/0),a=this._getValidRangeValue(r.min,-1/0),u=this._getValidRangeValue(r.max,1/0);return i.minValue=Math.max(n,a),i.maxValue=Math.min(s,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((d(o)||c(o)||f(o))&&(i.minValue=Number(l.min)>Number(r.min)?l.rawMin:r.rawMin,i.maxValue=Number(l.max)<Number(r.max)?l.rawMax:r.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return b(e)?e:t}};e([i()],k.prototype,"dataType",null),e([i()],k.prototype,"domain",null),e([i()],k.prototype,"distinctValues",null),e([i()],k.prototype,"editable",null),e([i()],k.prototype,"label",null),e([i()],k.prototype,"effectiveVisible",null),e([i()],k.prototype,"effectiveVisibilityCode",null),e([i()],k.prototype,"errors",null),e([i()],k.prototype,"featuresHaveSameValue",null),e([i()],k.prototype,"field",null),e([i()],k.prototype,"fieldName",null),e([i()],k.prototype,"group",void 0),e([i()],k.prototype,"input",null),e([i()],k.prototype,"multipleChoiceInput",null),e([i()],k.prototype,"multipleChoiceChoices",null),e([i()],k.prototype,"multipleChoiceValues",null),e([i()],k.prototype,"multipleChoiceOtherChoiceFieldName",null),e([i()],k.prototype,"multipleChoiceOtherChoiceHint",null),e([i()],k.prototype,"multipleChoiceOtherChoiceLabel",null),e([i()],k.prototype,"hasMultipleChoiceOtherChoiceField",null),e([i()],k.prototype,"shouldShowMultipleChoiceOtherChoice",null),e([i()],k.prototype,"multipleChoiceOtherChoiceValue",null),e([i()],k.prototype,"multipleChoiceOtherChoiceMaxLength",null),e([i()],k.prototype,"invalidFeatures",null),e([i()],k.prototype,"_multipleChoiceOtherChoiceCheckedStateStore",null),e([i()],k.prototype,"isSubtypeField",null),e([i()],k.prototype,"showNoValueOptionEnabled",null),e([i()],k.prototype,"showNoValueLabel",null),e([i()],k.prototype,"includeTime",null),e([i()],k.prototype,"includeTimeOffset",null),e([i()],k.prototype,"maxLength",null),e([i()],k.prototype,"minLength",null),e([i()],k.prototype,"range",null),e([i()],k.prototype,"required",null),e([i()],k.prototype,"submittable",null),e([i({readOnly:!0})],k.prototype,"type",void 0),e([i()],k.prototype,"userHasChangedValue",void 0),e([i()],k.prototype,"valid",null),e([i()],k.prototype,"value",null),e([i()],k.prototype,"visibilityCode",null),e([i()],k.prototype,"_evaluatedRequiredExpression",null),e([i()],k.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([i()],k.prototype,"_allDomains",null),e([i()],k.prototype,"_fieldShouldHaveDomain",null),e([i()],k.prototype,"_dateFormRange",null),e([i()],k.prototype,"_dateRange",null),k=e([l("esri.widgets.BatchAttributeForm.inputs.FieldInput")],k);const N=k;export{N as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{getOrCreateMapValue as i}from"../../../core/MapUtils.js";import{property as l,subclass as r}from"../../../core/accessorSupport/decorators.js";import{isMultipleChoiceInput as o}from"../../../form/elements/inputs/inputUtils.js";import n from"../../../layers/support/CodedValue.js";import s from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as a,dateTimeFieldValuesToNumericRange as u,isDomainValidForField as h}from"../../../layers/support/domainUtils.js";import{isNumericField as p,isStringField as c,isTimeOnlyField as m,getFieldRange as d,isDateOnlyField as f,isTimestampOffsetField as C}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as g}from"../../../layers/support/layerUtils.js";import y from"../../../layers/support/RangeDomain.js";import{isAnyDateField as b}from"../../../smartMapping/support/utils.js";import{isNumber as x}from"../../../support/guards.js";import v from"./EditableInput.js";import{visibilityCodeToBoolean as V,differentValuesString as O,isFieldInputWithShowNoValueOptionInput as M}from"./support/inputUtils.js";import{otherChoiceCheckedPlaceholderValue as _,multipleChoiceOtherChoiceCheckedStateByExpressionsManager as F}from"./support/multipleChoiceInputUtils.js";import{isEmptyValue as S,getMaxLength as w,getMinLength as E,dateIsValid as k,validateFormValue as D}from"../../support/forms/formUtils.js";let N=class extends v{constructor(e){super(e),this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){const{field:e}=this;return p(e)?"number":c(e)?"text":b(e)||m(e)?"date":"unsupported"}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const e=this.template;if(null!=e.label&&""!==e.label)return e.label;const{field:t,layers:i}=this;if(1===i.length){const e=i[0];if(g(e)){const i=e.getFieldAlias(t.name);if(null!=i&&""!==i)return i}}return t.alias||t.name}get effectiveVisible(){return V(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>i.getAttribute(e)===t)}get field(){return this.template.field}get fieldName(){return this.field.name}get input(){return this.template.input}get multipleChoiceInput(){const{input:e}=this;return e&&o(e)?e:null}get multipleChoiceChoices(){const{multipleChoiceInput:e}=this;if(!e)return null;const t=new Map;for(const i of e.choices)t.has(i.value)||t.set(i.value,i);return Array.from(t.values())}get multipleChoiceValues(){return this.multipleChoiceChoices?.map(e=>e.value)??null}get multipleChoiceOtherChoiceFieldName(){return this.multipleChoiceInput?.otherChoice?.fieldName??null}get multipleChoiceOtherChoiceHint(){return this.multipleChoiceInput?.otherChoice?.hint??""}get multipleChoiceOtherChoiceLabel(){return this.multipleChoiceInput?.otherChoice?.label??null}get hasMultipleChoiceOtherChoiceField(){const{multipleChoiceOtherChoiceFieldName:e}=this;return!!e&&this.layers.every(t=>null!=t.getField(e))}get shouldShowMultipleChoiceOtherChoice(){return null!=this.multipleChoiceInput?.otherChoice&&this.hasMultipleChoiceOtherChoiceField}set shouldShowMultipleChoiceOtherChoice(e){this._overrideIfSome("shouldShowMultipleChoiceOtherChoice",e)}get multipleChoiceOtherChoiceValue(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return null;const t=this.features.map(t=>t.getAttribute(e));if(0===t.length)return null;const[i]=t;return t.every(e=>e===i)?i:O}get multipleChoiceOtherChoiceMaxLength(){const{multipleChoiceOtherChoiceFieldName:e}=this;if(!e||!this.shouldShowMultipleChoiceOtherChoice)return;let t;for(const i of this.layers){const l=i.getField(e)?.length;null==l||l<0||(t=null==t?l:Math.min(t,l))}return t}getMultipleChoiceOtherChoiceRenderState(e){const t=this.multipleChoiceOtherChoiceFieldName??void 0,i=this.shouldShowMultipleChoiceOtherChoice,l=this.multipleChoiceOtherChoiceValue,r=i?this.multipleChoiceOtherChoiceCheckboxState:{checked:!1,indeterminate:!1},o=i?this.getExplicitMultipleChoiceOtherChoiceCheckedState():void 0,n=void 0===o?r:{checked:o,indeterminate:!1};return{fieldName:t,hint:this.multipleChoiceOtherChoiceHint,label:this.multipleChoiceOtherChoiceLabel??e,shouldShow:i,checkboxState:n,value:l,normalizedValue:l===_?"":l,maxLength:this.multipleChoiceOtherChoiceMaxLength}}get multipleChoiceOtherChoiceCheckboxState(){const e=this.multipleChoiceOtherChoiceFieldName;if(!e)return{checked:!1,indeterminate:!1};const t=this.features.map(t=>t.getAttribute(e));return{checked:t.length>0&&t.every(e=>!S(e)),indeterminate:t.some(e=>!S(e))&&t.some(e=>S(e))}}initializeExplicitMultipleChoiceOtherChoiceCheckedState(){this.hasExplicitMultipleChoiceOtherChoiceCheckedState()||this.setExplicitMultipleChoiceOtherChoiceCheckedState(this.multipleChoiceOtherChoiceCheckboxState.checked)}hasExplicitMultipleChoiceOtherChoiceCheckedState(){return void 0!==this.getExplicitMultipleChoiceOtherChoiceCheckedState()}getExplicitMultipleChoiceOtherChoiceCheckedState(){const e=this._multipleChoiceOtherChoiceCheckedStateKey;if(e)return this._multipleChoiceOtherChoiceCheckedStateStore.get(e)}setExplicitMultipleChoiceOtherChoiceCheckedState(e){const t=this._multipleChoiceOtherChoiceCheckedStateKey;t&&this._multipleChoiceOtherChoiceCheckedStateStore.set(t,e)}stashMultipleChoiceOtherChoiceDraftValueForFeatures(e,t){const i=this.multipleChoiceOtherChoiceFieldName;if(i)for(const l of e)l.stashAttribute(i,t)}setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e){const t=this.multipleChoiceOtherChoiceFieldName;if(t)for(const i of e)i.stashAttribute(t,i.getAttribute(t))}getMultipleChoiceOtherChoiceDraftValue(e){const t=this.multipleChoiceOtherChoiceFieldName;if(t)return e.getStashedAttribute(t)}get invalidFeatures(){return this.errors.map(e=>e.feature)}get _multipleChoiceOtherChoiceCheckedStateKey(){return null!=this.multipleChoiceOtherChoiceFieldName?this.template.elementId:null}get _multipleChoiceOtherChoiceCheckedStateStore(){const e=this.expressionsManager;return e?i(F,e,()=>new Map):new Map}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this;return!this.required&&(!M(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this;return M(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const{input:e}=this;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return w({dataType:this.dataType,field:this.field,input:this.input})}get minLength(){return E({dataType:this.dataType,field:this.field,input:this.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=a(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?d(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){return(!this.required||!this.distinctValues.some(e=>S(e)))&&!!this.valid}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:O}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const e=this.codedValueDomainOptions,{value:t}=this,i=null==t||t===O||e.some(e=>e.value===t)?[]:[{name:`${t}`,value:t}];return[e,i]}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const l of this.features){if(null==i.getExpressionExecutorsForLayer(l.layer)?.requiredExpression)continue;t=!1;const r=this._lookupEvaluatedExpression(l,"required");"success"===r?.status?e=e||!0===r.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const{input:e}=this;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=u(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:l}=e;i={max:null!=t&&k(t)?t.getTime():null,min:null!=l&&k(l)?l.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:l}=this;if("date"!==this.dataType)return{};if(!l)return this._fieldShouldHaveDomain?{}:e;const r=a(i,l);if(!r)return e;const{max:o,min:n,rawMax:s,rawMin:u}=e,{type:h}=t.field;if("date"===h){const{max:e,min:t}=r;return{max:x(o)&&(null===e||null!=e&&o<=e)?o:e??null,min:x(n)&&(null===t||null!=t&&n>=t)?n:t??null}}if("date-only"===h||"time-only"===h||"timestamp-offset"===h){const{max:e,min:t,rawMax:i,rawMin:l}=r,a=x(o)&&s&&(null==e||o<e),h=x(n)&&u&&(null==t||n>t);return{max:a?o:e,min:h?n:t,rawMax:a?s:i,rawMin:h?u:l}}return{}}async setValueFromUser(e){this.userHasChangedValue=!0;const t=[],i=this.fieldName;for(const l of this.features)l.getAttribute(i)!==e&&t.push(l);this._setValue(e),await this.expressionsManager.valueChanged(i,t)}_setValue(e){const{fieldName:t}=this;for(const i of this.features)i.setAttribute(t,e)}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:l,range:r}=this,o=[],{multipleChoiceInput:n}=this;for(const s of this.features){const{layer:a}=s,u=a.getField(t)??this.field,h=a.getFieldDomain(t,{feature:s.plainGraphic}),p=this.calculateDomain([h]),c=this._requiredForFeature(s),m=s.getAttribute(t),d=D(m,{dataType:e,domain:p,field:u,maxLength:i,minLength:l,multipleChoice:n,range:r,required:c});d&&o.push({error:d,feature:s.source})}return o}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&h(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let l=null;switch(t?.type){case"range":l=this._intersectRangeDomains(e);break;case"coded-value":l=this._intersectCodedValueDomains(e)}return l}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const o of e)for(const[e,i]of t){o.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let l=t;if(i){l=new Map;for(const[e,r]of i)t.has(e)&&l.set(e,r)}const r=Array.from(l.entries()).map(([e,t])=>new n({code:e,name:t}));return r.length?new s({codedValues:r}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let l=1;l<e.length;l++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[l])}if(t&&!h(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof y){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:l}=this;return f(l)||m(l)||C(l)?u(l,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new y,l=this._getMinMaxFromRangeDomain(e),r=this._getMinMaxFromRangeDomain(t),{field:o}=this,n=this._getValidRangeValue(l.min,-1/0),s=this._getValidRangeValue(l.max,1/0),a=this._getValidRangeValue(r.min,-1/0),u=this._getValidRangeValue(r.max,1/0);return i.minValue=Math.max(n,a),i.maxValue=Math.min(s,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((f(o)||m(o)||C(o))&&(i.minValue=Number(l.min)>Number(r.min)?l.rawMin:r.rawMin,i.maxValue=Number(l.max)<Number(r.max)?l.rawMax:r.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return x(e)?e:t}};e([l()],N.prototype,"dataType",null),e([l()],N.prototype,"domain",null),e([l()],N.prototype,"distinctValues",null),e([l()],N.prototype,"editable",null),e([l()],N.prototype,"label",null),e([l()],N.prototype,"effectiveVisible",null),e([l()],N.prototype,"effectiveVisibilityCode",null),e([l()],N.prototype,"errors",null),e([l()],N.prototype,"featuresHaveSameValue",null),e([l()],N.prototype,"field",null),e([l()],N.prototype,"fieldName",null),e([l()],N.prototype,"group",void 0),e([l()],N.prototype,"input",null),e([l()],N.prototype,"multipleChoiceInput",null),e([l()],N.prototype,"multipleChoiceChoices",null),e([l()],N.prototype,"multipleChoiceValues",null),e([l()],N.prototype,"multipleChoiceOtherChoiceFieldName",null),e([l()],N.prototype,"multipleChoiceOtherChoiceHint",null),e([l()],N.prototype,"multipleChoiceOtherChoiceLabel",null),e([l()],N.prototype,"hasMultipleChoiceOtherChoiceField",null),e([l()],N.prototype,"shouldShowMultipleChoiceOtherChoice",null),e([l()],N.prototype,"multipleChoiceOtherChoiceValue",null),e([l()],N.prototype,"multipleChoiceOtherChoiceMaxLength",null),e([l()],N.prototype,"multipleChoiceOtherChoiceCheckboxState",null),e([l()],N.prototype,"invalidFeatures",null),e([l()],N.prototype,"_multipleChoiceOtherChoiceCheckedStateStore",null),e([l()],N.prototype,"isSubtypeField",null),e([l()],N.prototype,"showNoValueOptionEnabled",null),e([l()],N.prototype,"showNoValueLabel",null),e([l()],N.prototype,"includeTime",null),e([l()],N.prototype,"includeTimeOffset",null),e([l()],N.prototype,"maxLength",null),e([l()],N.prototype,"minLength",null),e([l()],N.prototype,"range",null),e([l()],N.prototype,"required",null),e([l()],N.prototype,"submittable",null),e([l({readOnly:!0})],N.prototype,"type",void 0),e([l()],N.prototype,"userHasChangedValue",void 0),e([l()],N.prototype,"valid",null),e([l()],N.prototype,"value",null),e([l()],N.prototype,"visibilityCode",null),e([l()],N.prototype,"_evaluatedRequiredExpression",null),e([l()],N.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([l()],N.prototype,"_allDomains",null),e([l()],N.prototype,"_fieldShouldHaveDomain",null),e([l()],N.prototype,"_dateFormRange",null),e([l()],N.prototype,"_dateRange",null),N=e([r("esri.widgets.BatchAttributeForm.inputs.FieldInput")],N);const A=N;export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{
|
|
2
|
+
import{__decorate as t}from"tslib";import{ignoreAbortErrors as e}from"../../../core/promiseUtils.js";import{watch as i,sync as o,on as s}from"../../../core/reactiveUtils.js";import{generateUID as r}from"../../../core/uid.js";import{property as a,subclass as l}from"../../../core/accessorSupport/decorators.js";import{isAssociationsLayerUnion as n}from"../batchAttributeFormUtils.js";import p from"./EditableInput.js";import u from"./SingleFeatureInputAdapter.js";import d from"../../support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js";let y=class extends p{constructor(t){super(t),this._associatedLayer=null,this.featureItem=null,this.group=null,this.map=null,this.single=new u({input:this}),this.type="utilityNetworkAssociations",this.viewModel=new d({source:"featureForm"})}initialize(){this.viewModel.set({associationTypes:this.associationTypes,description:this.description,graphic:this.feature?.plainGraphic,layer:this.associationLayer,map:this.map,title:this.label}),this.addHandles([i(()=>this.associatedLayer,t=>this.showAllAssociatedFeatures(null!=t),o),s(()=>this._editableLayer,"edits",()=>this.refresh())])}get _editableLayer(){const{associatedLayer:t}=this;return"subtype-sublayer"===t?.type?t.parent:t}get activeAssociationType(){return this.viewModel.activeAssociationType}get associatedFeatures(){const{associatedLayer:t}=this;return t?this.associatedFeatureInfos.get(t):void 0}get associatedFeatureInfos(){const{utilityNetwork:t,viewModel:{associationFeatures:e}}=this,i=new Map;return e.size&&t?(e.forEach((t,e)=>{n(e)&&i.set(e,t)}),i):i}get associatedLayer(){return this._associatedLayer}get associationLayer(){const{layer:t}=this;return n(t)?t:null}get associationTypes(){return this.template.associationTypes}get canAddAssociation(){return!(!this.utilityNetwork||!this.loaded)&&this.editable}get feature(){return this.single.feature}get featureCount(){return this.viewModel.featureCount}get layer(){return this.single.layer}get loaded(){const t=this.viewModel.state;return"loading"!==t&&"disabled"!==t}get showAllEnabled(){return this.viewModel.showAllEnabled}get uid(){return r()}get updating(){const{state:t}=this.viewModel;return"loading"===t||"querying"===t}get utilityNetwork(){return this.viewModel.utilityNetwork}async refresh(){await e(this.viewModel.refresh())}setAssociatedLayer(t){this._associatedLayer=t}setActiveAssociationType(t){this.viewModel.activeAssociationType=t}showAllAssociatedFeatures(t){this.viewModel.showAllEnabled=t}};t([a()],y.prototype,"_associatedLayer",void 0),t([a()],y.prototype,"_editableLayer",null),t([a()],y.prototype,"activeAssociationType",null),t([a()],y.prototype,"associatedFeatures",null),t([a()],y.prototype,"associatedFeatureInfos",null),t([a()],y.prototype,"associatedLayer",null),t([a()],y.prototype,"associationLayer",null),t([a()],y.prototype,"associationTypes",null),t([a()],y.prototype,"canAddAssociation",null),t([a()],y.prototype,"feature",null),t([a()],y.prototype,"featureItem",void 0),t([a()],y.prototype,"featureCount",null),t([a()],y.prototype,"group",void 0),t([a()],y.prototype,"layer",null),t([a()],y.prototype,"loaded",null),t([a()],y.prototype,"map",void 0),t([a()],y.prototype,"showAllEnabled",null),t([a({readOnly:!0})],y.prototype,"single",void 0),t([a({readOnly:!0})],y.prototype,"type",void 0),t([a()],y.prototype,"uid",null),t([a()],y.prototype,"updating",null),t([a()],y.prototype,"utilityNetwork",null),t([a()],y.prototype,"viewModel",void 0),y=t([l("esri.widgets.BatchAttributeForm.inputs.UtilityNetworkAssociationsElementInput")],y);const c=y;export{c as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
|
|
2
|
+
const t="esri_BatchAttributeForm_different_values";function n(t){return"visible"===t}function e(t){return"field"===t.type}function r(t){return e(t)&&"multiple-choice"===t.input?.type}function u(t){return"group"===t.type}function o(t){return"relationship"===t.type}function i(t){return"text"===t.type}function c(t){return"attachment"===t.type}function s(t){return e(t)||c(t)||o(t)||p(t)}function p(t){return"utilityNetworkAssociations"===t.type}function f(t){const n=`${t.elementId}:${t.executorPurpose}`;return null!=t.textExpressionIndex?`${n}:${t.textExpressionIndex}`:n}const l=t=>null!=t&&(x(t,"combo-box")||x(t,"radio-buttons"));function x(t,n){return t?.type===n}function y(t,n,e=[]){for(const r of t)n(r)?e.push(r):u(r)&&y(r.inputs,n,e);return e}export{y as deepFilterInputs,t as differentValuesString,c as isAttachmentElementInput,s as isEditableInput,e as isFieldInput,l as isFieldInputWithShowNoValueOptionInput,u as isGroupInput,x as isInputWithInputType,r as isMultipleChoiceFieldInput,o as isRelationshipElementInput,i as isTextElementInput,p as isUtilityNetworkAssociationsElementInput,f as makeUseId,n as visibilityCodeToBoolean};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import{differentValuesString as e}from"./inputUtils.js";import{isEmptyValue as t}from"../../../support/forms/formUtils.js";const n="esri_BatchAttributeForm_other_choice_checked",i=new WeakMap;function r(e,t){if(null==e||""===e)return[];const n=String(e);if(!t){const e=n.trim();return""===e?[]:[e]}return n.split(t).map(e=>e.trim()).filter(e=>""!==e)}function c({input:t,choiceValue:n,currentValue:i,isChecked:c}){const{multipleChoiceInput:o,multipleChoiceValues:u}=t;if(!o||!u)return i;const{choiceDelimiter:l}=o,s=new Set(u),a=r(i,l).filter(t=>t!==e&&s.has(t)),f=a.includes(n);if(!c){const e=f?a.filter(e=>e!==n):a;return e.length>0?e.join(l):null}return f||!s.has(n)?a.length>0?a.join(l):null:[...a,n].join(l)}function o({input:e,choiceValue:t}){const n=e.multipleChoiceInput?.choiceDelimiter,i=e.multipleChoiceValues;if(null==n||!i)return{checked:!1,indeterminate:!1};const c=e.features.length;if(!c)return{checked:!1,indeterminate:!1};let o=0;for(const u of e.features){r(u.getAttribute(e.fieldName),n).includes(t)&&(o+=1)}return o===c?{checked:!0,indeterminate:!1}:0===o?{checked:!1,indeterminate:!1}:{checked:!1,indeterminate:!0}}function u({input:e}){const t=e.multipleChoiceInput?.choiceDelimiter,n=e.multipleChoiceValues;if(null==t||!n)return{checked:!1,indeterminate:!1};if(0===n.length)return{checked:!1,indeterminate:!1};let i=!0,r=!1;for(const c of n){const t=o({input:e,choiceValue:c});(t.checked||t.indeterminate)&&(r=!0),t.checked||(i=!1)}return{checked:i,indeterminate:!i&&r}}function l({input:e,otherChoiceFieldName:n}){const i=e.features.length;if(!i)return{checked:!1,indeterminate:!1};const r=e.features.toArray().filter(e=>!t(e.getAttribute(n))).length;return 0===r?{checked:!1,indeterminate:!1}:r===i?{checked:!0,indeterminate:!1}:{checked:!1,indeterminate:!0}}function s(t){return!(null==t||""===t||t===n||t===e)}function a(e,t={}){const{includeDraftValues:n=!1}=t;if(!e)return;const r=new Set;for(const i of e.sharedForm.allFieldInputs)r.add(i.expressionsManager);for(const i of e.activeForm.allFieldInputs)r.add(i.expressionsManager);for(const c of r)i.get(c)?.clear();if(n){const t=new Set;for(const n of e.sharedForm.allFieldInputs)for(const e of n.features)t.add(e);for(const e of t)e.clearStashedAttributes()}}export{s as canRestoreMultipleChoiceOtherChoiceDraftValue,a as clearMultipleChoiceOtherChoiceStateForViewModel,o as getMultipleChoiceCheckboxState,l as getMultipleChoiceOtherChoiceState,u as getMultipleChoiceSelectAllState,c as getUpdatedMultipleChoiceValueForFeature,i as multipleChoiceOtherChoiceCheckedStateByExpressionsManager,n as otherChoiceCheckedPlaceholderValue,r as splitMultipleChoiceValue};
|
|
@@ -211,6 +211,13 @@ export interface AttributeFormSupportedLayerInfo {
|
|
|
211
211
|
formTemplate?: FormTemplate;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
/**
|
|
215
|
+
* Types of layers that support Utility Network associations.
|
|
216
|
+
*
|
|
217
|
+
* @internal
|
|
218
|
+
*/
|
|
219
|
+
export type AssociationsLayerUnion = FeatureLayer | SubtypeSublayer;
|
|
220
|
+
|
|
214
221
|
/**
|
|
215
222
|
* Configuration information needed to render buttons in the BatchAttributeForm footer.
|
|
216
223
|
*
|