@arcgis/core 5.1.0-next.110 → 5.1.0-next.112
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/ElevationProfile/ElevationProfileGroup.d.ts +3 -0
- package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -0
- package/analysis/ElevationProfileAnalysis.d.ts +5 -0
- package/analysis/ShadowCast/DiscreteOptions.d.ts +2 -2
- package/analysis/ShadowCast/TotalDurationOptions.d.ts +13 -4
- package/analysis/ShadowCastAnalysis.d.ts +8 -5
- package/arcade/Dictionary.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/Pixel.js +1 -1
- package/arcade/Voxel.js +1 -1
- package/arcade/arcade.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeEnvironment.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/compilerUtils.js +1 -1
- package/arcade/containerUtils.js +1 -1
- package/arcade/debug.js +1 -1
- package/arcade/enum.js +1 -1
- package/arcade/executionError.js +1 -1
- package/arcade/functions/convertdirection.js +1 -1
- package/arcade/functions/date.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/featuresetgeom.js +1 -1
- package/arcade/functions/featuresetstats.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geometry.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/functions/knowledgegraph.js +1 -1
- package/arcade/functions/maths.js +1 -1
- package/arcade/functions/stats.js +1 -1
- package/arcade/functions/string.js +1 -1
- package/arcade/functions/track.js +1 -1
- package/arcade/geometry/constructors.js +1 -1
- package/arcade/geometry/functions.js +1 -1
- package/arcade/geometry/unitConversion.js +1 -1
- package/arcade.js +1 -1
- package/assets/components/assets/icon/returnToDefault16.json +1 -0
- package/assets/components/assets/icon/returnToDefault24.json +1 -0
- package/assets/components/assets/icon/returnToDefault32.json +1 -0
- package/assets/components/assets/icon/reviewMap16.json +1 -0
- package/assets/components/assets/icon/reviewMap24.json +1 -0
- package/assets/components/assets/icon/reviewMap32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/03babc21d1781142a974.js +1 -0
- package/assets/esri/core/workers/chunks/08efd64acdfe46985293.js +1 -0
- package/assets/esri/core/workers/chunks/0b76534b60014d74ecb9.js +1 -0
- package/assets/esri/core/workers/chunks/{622bdd1b9d5d292ec12b.js → 0e6a388d51d9dbae46ba.js} +1 -1
- package/assets/esri/core/workers/chunks/{34e026549ba2822b8ebd.js → 13d43a0683c42b94feb6.js} +1 -1
- package/assets/esri/core/workers/chunks/{4f9ea7544b2d0e88a05c.js → 13f0e08de2dfab07d212.js} +1 -1
- package/assets/esri/core/workers/chunks/{35bbd63319d8aa9f31cc.js → 169c9eb6cd000e067c4b.js} +1 -1
- package/assets/esri/core/workers/chunks/{d4014213c476bf8099af.js → 18c4207b1cb0777560ba.js} +1 -1
- package/assets/esri/core/workers/chunks/{58c15c42e6a618386a2f.js → 1c8c8050d60205cf2156.js} +1 -1
- package/assets/esri/core/workers/chunks/1f537c05c2f643acb5e7.js +1 -0
- package/assets/esri/core/workers/chunks/241aeff6afd074ce105b.js +1 -0
- package/assets/esri/core/workers/chunks/{ddebc1dc10a2d207389f.js → 282f3d364411efac7b80.js} +1 -1
- package/assets/esri/core/workers/chunks/{d6d5ee9d0d998d730f81.js → 2bd334f9ab89334df713.js} +1 -1
- package/assets/esri/core/workers/chunks/340c68d09d2e8bef6727.js +2 -0
- package/assets/esri/core/workers/chunks/{17604cbd4d24158e2c16.js → 3835097520296b0517af.js} +1 -1
- package/assets/esri/core/workers/chunks/481dc7503587972a6bd2.js +2 -0
- package/assets/esri/core/workers/chunks/{9f4a9b193485f88d4461.js → 4afe76de6e82e86fe697.js} +1 -1
- package/assets/esri/core/workers/chunks/{ac408c62565e2c8b5975.js → 4c5cdd2712c938fafc5d.js} +1 -1
- package/assets/esri/core/workers/chunks/{ece30bfd5c49b8d99752.js → 5e5c7cc74ff1c9603aff.js} +1 -1
- package/assets/esri/core/workers/chunks/{502c3da8c49bf885f51d.js → 63ea9035dcf9ce45560c.js} +1 -1
- package/assets/esri/core/workers/chunks/{33ec193e6d7a0cb9d8dd.js → 6b66a6f69aa03338c346.js} +1 -1
- package/assets/esri/core/workers/chunks/{56b6b68d9459b1edea43.js → 6c97b5bc408f051606d2.js} +1 -1
- package/assets/esri/core/workers/chunks/{94eab215bab3e4e0e5b5.js → 711d1873c760313e287f.js} +1 -1
- package/assets/esri/core/workers/chunks/{4e13d639419ac64f7563.js → 7c077e1a63ab97bf3e87.js} +1 -1
- package/assets/esri/core/workers/chunks/86f2de7dda7992ae706c.js +1 -0
- package/assets/esri/core/workers/chunks/{a29cd1f5c7bb4f6a5a4f.js → 8d4881c879c86b353e08.js} +1 -1
- package/assets/esri/core/workers/chunks/{6e21675bbd7a44070771.js → 8ff83c59462dea6e3427.js} +1 -1
- package/assets/esri/core/workers/chunks/979bab62cad788180770.js +1 -0
- package/assets/esri/core/workers/chunks/9890c85a238879490926.js +1 -0
- package/assets/esri/core/workers/chunks/9ebc461529d5286fa2c2.js +2 -0
- package/assets/esri/core/workers/chunks/a95398214e530f896a2d.js +1 -0
- package/assets/esri/core/workers/chunks/{fc1fe1f58a65a1694c09.js → b02a68bbab07557cf02d.js} +1 -1
- package/assets/esri/core/workers/chunks/ba31616de9d73d83d867.js +1 -0
- package/assets/esri/core/workers/chunks/c7662455252b48531da1.js +1 -0
- package/assets/esri/core/workers/chunks/ca92176d5348e2c533d7.js +1 -0
- package/assets/esri/core/workers/chunks/cd5206e19d86c60e3cf0.js +1 -0
- package/assets/esri/core/workers/chunks/{bfb417d72d0c90e116fe.js → cedf3e316d6f89cf7005.js} +1 -1
- package/assets/esri/core/workers/chunks/d02aa7438f46c1c2167a.js +2 -0
- package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +1 -0
- package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +1 -0
- package/assets/esri/core/workers/chunks/e0036fa0324a96a88248.js +1 -0
- package/assets/esri/core/workers/chunks/{55334ad3618899cdbf78.js → e5854a3f69dffaf9464d.js} +2 -2
- package/assets/esri/core/workers/chunks/ed939fd5d3827a3f70e0.js +1 -0
- package/assets/esri/core/workers/chunks/fe8334352d256d691a95.js +1 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +7 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
- package/chunks/aiServices.js +1 -1
- package/chunks/arcade.js +1 -1
- package/chunks/array.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/identity/IdentityModal.js +1 -1
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/layers/support/SceneModifications.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/package.json +2 -2
- package/renderers/ClassBreaksRenderer.js +1 -1
- package/renderers/UniqueValueRenderer.js +1 -1
- package/rest/print.js +1 -1
- package/rest/support/TranslateContent.js +1 -1
- package/rest/support/TranslateParameters.js +1 -1
- package/rest/support/TranslateResult.js +1 -1
- package/rest/translate.js +1 -1
- package/rest/utils.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
- package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/QualityProfile.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +2 -0
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathFrame2D.js +2 -0
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertexInfo.js +2 -0
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/DOMContainer.d.ts +2 -0
- package/views/LinkChartView.d.ts +47 -0
- package/views/MapView.d.ts +1 -85
- package/views/VideoView.d.ts +8 -1
- package/views/View2D.d.ts +78 -2
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/views/types.d.ts +2 -3
- package/views/ui/DefaultUI.d.ts +1 -0
- package/widgets/Attachments.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BasemapToggle.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +10 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +25 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Compass.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectionalPad.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/FooterActions.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/Prompt.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/FovOverlay.js +1 -1
- package/widgets/Fullscreen.js +1 -1
- package/widgets/Home.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/NavigationToggle.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
- package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
- package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/PanoramicVideoViewer.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Swipe.js +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/TimeZoneLabel.js +1 -1
- package/widgets/Track.js +1 -1
- package/widgets/UtilityNetworkAssociations.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
- package/widgets/UtilityNetworkTrace.js +1 -1
- package/widgets/UtilityNetworkValidateTopology.js +1 -1
- package/widgets/ValuePicker.js +1 -1
- package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
- package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
- package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/widgets/support/ContingentValuesManager.js +1 -1
- package/widgets/support/FilterBuilder.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/widgets/support/ItemList.js +1 -1
- package/widgets/support/LabeledSwitch.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +0 -2
- package/assets/esri/core/workers/chunks/286bf3be9f524bde9529.js +0 -1
- package/assets/esri/core/workers/chunks/36ecb0082b8804b10fbf.js +0 -1
- package/assets/esri/core/workers/chunks/41a95ad470ec42ecd5a2.js +0 -1
- package/assets/esri/core/workers/chunks/547dc6ccb989bd962661.js +0 -1
- package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +0 -2
- package/assets/esri/core/workers/chunks/56d9d3f108ff6e719dd4.js +0 -1
- package/assets/esri/core/workers/chunks/5c44638670e40e092ce3.js +0 -1
- package/assets/esri/core/workers/chunks/63934843c9f4ef779a07.js +0 -1
- package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +0 -2
- package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +0 -1
- package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +0 -1
- package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +0 -1
- package/assets/esri/core/workers/chunks/9da2f2b67837b491cfa3.js +0 -1
- package/assets/esri/core/workers/chunks/a913a1c83a667ed0e711.js +0 -1
- package/assets/esri/core/workers/chunks/b69d1d528e271568cbd8.js +0 -2
- package/assets/esri/core/workers/chunks/bc249bb667f0564ad093.js +0 -1
- package/assets/esri/core/workers/chunks/c8b96104641cb4afd4df.js +0 -1
- package/assets/esri/core/workers/chunks/cdb48d198145493f76f3.js +0 -1
- package/assets/esri/core/workers/chunks/e2bb95d601789bbda73b.js +0 -1
- package/assets/esri/core/workers/chunks/f1bb426400dac02880f1.js +0 -1
- package/assets/esri/core/workers/chunks/f3f984c62311c20a9db8.js +0 -1
- /package/assets/esri/core/workers/chunks/{69c9eb93553b006b640d.js.LICENSE.txt → 340c68d09d2e8bef6727.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{549d348ca181d06aefb7.js.LICENSE.txt → 481dc7503587972a6bd2.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{1d1929f98d941179be29.js.LICENSE.txt → 9ebc461529d5286fa2c2.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{b69d1d528e271568cbd8.js.LICENSE.txt → d02aa7438f46c1c2167a.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{55334ad3618899cdbf78.js.LICENSE.txt → e5854a3f69dffaf9464d.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as a}from"../core/deprecate.js";import i from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{watch as o,on as l}from"../core/reactiveUtils.js";import{formatFileSize as s}from"../core/unitFormatUtils.js";import{property as r,subclass as c}from"../core/accessorSupport/decorators.js";import{isIntegerField as d}from"../layers/support/fieldUtils.js";import{isString as u}from"../support/guards.js";import m from"./Widget.js";import{getAttachmentTypeCategory as p,getCalciteIconForAttachment as h}from"./Attachments/support/attachmentUtils.js";import{getAttachmentKey as f,isImageAttachment as v}from"./BatchAttributeForm/attachmentUtils.js";import{getHiddenFieldsValidationErrorMessage as g,getVisibleFieldInputValidationErrorMessage as b,isElementTemplateWithInputType as C}from"./BatchAttributeForm/batchAttributeFormUtils.js";import _ from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as y}from"./BatchAttributeForm/css.js";import{makeAddAttachmentFooterButtons as I,makeViewingAttachmentFooterButtons as F,makeDefaultFooterButtons as k}from"./BatchAttributeForm/interfaceUtils.js";import w from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as A,isFieldInput as x,isTextElementInput as M,isRelationshipElementInput as D,isAttachmentElementInput as V,isUtilityNetworkAssociationsElementInput as O,differentValuesString as S}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{clearMultipleChoiceOtherChoiceStateForViewModel as E,getMultipleChoiceCheckboxState as T,otherChoiceCheckedPlaceholderValue as L,getUpdatedMultipleChoiceValueForFeature as U,getMultipleChoiceSelectAllState as N,splitMultipleChoiceValue as P,canRestoreMultipleChoiceOtherChoiceDraftValue as $}from"./BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js";import{downloadAttachmentInfo as B}from"./FeatureTable/support/exportUtils.js";import{loadCalciteComponents as R}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as j,getIntlOptionsForField as z,prepareISOFieldValueForDateComponents as Z,prepareUnixFieldValueForDateComponents as H,normalizeTimeOnlyString as q,getISOFieldValueFromDateComponents as G,getUnixFieldValueFromDateComponents as W}from"./support/dateUtils.js";import{globalCss as K}from"./support/globalCss.js";import{messageBundle as J,vmEvent as Q,tsx as X}from"./support/widget.js";import{setFocus as Y}from"./support/widgetUtils.js";import{isEmptyValue as ee}from"./support/forms/formUtils.js";const te="data-element-id",ae="esri_BatchAttributeForm_select_all",ie="esri_BatchAttributeForm_other_choice";let ne=class extends m{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.messagesUnits=null,this.viewModel=new _,this.visibleElements=new w,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._attachmentDialogInfo=null,this._attachmentFileInputMap=new Map,this._maximizeSelectedAttachment=()=>{this._attachmentDialogInfo=this.selectedAttachmentDetails},this._closeAttachmentDialog=()=>{this.hideAttachmentDialog()},this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{a(i.getLogger(this),"Editor","arcgis-editor",{version:"5.0"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...a}=e;return a}initialize(){this.addHandles([o(()=>this.features,()=>{this._dateComponentMap.clear(),this._resetTransientFormState(),E(this.viewModel,{includeDraftValues:!0})}),o(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear(),this._resetTransientFormState(),E(this.viewModel)}),o(()=>this.viewModel.selectedAttachmentAddElementId,()=>{this.hideAttachmentDialog()}),l(()=>this.viewModel,"submit",()=>{this.valid||this.goToFirstError()})])}loadDependencies(){return R({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get effectiveTitle(){const{features:e,messages:t,page:a}=this;return"viewing-attachment-details"===a?t.titles.editAttachment:"adding-attachments"===a?t.titles.addAttachments:1===e.length||this.activeFeatureIndex>-1?t.titles.editFeature:e.length>1?t.titles.editFeatures:""}get effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get footerButtonInfos(){if(!this.features.length)return[];const{page:e,messages:t}=this,a=this.viewModel.selectedAttachmentAddElementId;return"adding-attachments"===e&&a?I({messages:t,onclick:()=>this._attachmentFileInputMap.get(a)?.click()}):"viewing-attachment-details"===e?F({messages:t}):k({formId:this._formId,callback:this.submit,messages:t})}get footerNoticeInfos(){if(!this.features.length)return[];const{messages:{footerNotices:e}}=this;return[]}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get page(){return this.viewModel.page}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get selectedAttachment(){return this.viewModel.selectedAttachment}get selectedAttachmentDetails(){return this.viewModel.selectedAttachmentDetails}get valid(){return this.viewModel.valid}get _formId(){return`${this.id}-form`}async goBack(){return this.viewModel.goBack()}async goHome(){return this.viewModel.goHome()}goToFirstError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._focusedFieldInput=e.input,this._attemptFocusOnNextRender=!0,this.scheduleRender()}render(){return X("div",{class:this.classes(y.base,K.widget,K.panel)},this._renderContent(),this._renderAttachmentDialog())}submit(){this.viewModel.submit()}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:a}=e.dataset,i=n(this._dateComponentMap,`${a}`,()=>({}));switch(t){case"date":i.date=e;break;case"time":i.time=e;break;case"timeZone":i.timeZone=e}}_renderContent(){const{messages:e,viewModel:a}=this,{status:i}=a;return"failed"===i?a.hasTooManyComplexFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyComplexFeatures,{num:a.maximumFeatureCountWithComplexForms})):a.hasTooManyFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyFeatures,{num:a.maximumFeatureCount})):e.formFailedToLoad:a.expressionEvaluationFailed?this._renderErrorNotice(e.expressionEvaluationFailed):a.hasLayersWithContingentValues?this._renderErrorNotice(e.unsupportedContingentValues):"loading"===i&&this.visibleElements.loadingIndicator?X("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):0!==this.features.length?this._renderForm():void 0}_renderErrorNotice(e){return X("calcite-notice",{class:y.noticeError,icon:!0,kind:"warning",open:!0},X("div",{slot:"message"},e))}_renderForm(){return X("form",{class:y.form,id:this._formId,onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderPage())}_renderPage(){switch(this.page){case"adding-attachments":return this._renderAttachmentAddPage();case"viewing-attachment-details":return this._renderAttachmentDetailPage();default:return this._renderFormContent()}}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:a}=e;let i;if(!e.submitHasBeenAttempted)return null;if(a.invalidHiddenInputs.length>0)if(i=g(a,e.mode,this.messages),"batch"===this.viewModel.mode){const e=a.invalidHiddenInputs.filter(e=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);e.length>0?i+=` (${e.map(e=>e.label).join(", ")})`:i=null}else i+=` (${a.invalidHiddenInputs.map(e=>e.label).join(", ")})`;else if(t)return null;return i?X("calcite-notice",{class:y.noticeError,icon:!0,kind:"danger",open:!0},X("div",{slot:"message"},i)):null}_renderFormContent(){if(!this.viewModel.hasVisibleInputs)return[X("calcite-notice",{class:y.noticeError,icon:!0,kind:"warning",open:!0},X("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return A(e)?this._renderGroupInput(e):x(e)?this._renderLabeledField(e):M(e)?this._renderTextComponent(e):D(e)?this._renderRelationshipElementInput(e):V(e)?this._renderAttachmentElementInput(e):O(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderGroupInput(e){const{inputs:t,template:a,open:i}=e,n=t.filter(e=>e.visible),o=a.label??"";return X("calcite-block",{class:this.classes(y.group,"sequential"===this.groupDisplay?y.groupSequential:null,this.disabled?y.inputDisabled:null),collapsible:!0,description:a.description??void 0,disabled:this.effectiveDisabled,expanded:i,heading:o,headingLevel:this.headingLevel,key:`{${a.elementId}-key}`,label:o,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},n.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:a}=e.template,{label:i,required:n,dataType:o}=e,l=n?t(this.messages.requiredFieldLabel,{name:i}):i;return X("calcite-label",{"aria-label":l,class:y.label,key:`field--${a}`},X("div",{class:y.labelTextContent,key:"labelTextContainer"},i,n?X("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==o?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:a}=e;return"date"===a?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):null!==e.multipleChoiceChoices?this._renderMultipleChoiceComponent({input:e,props:t}):"number"===a?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:a,submittable:i}=e,n=!i&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?b(e,t,this.messages):null;return n?X("calcite-input-message",{icon:!0,status:"invalid"},n):a?X("calcite-input-message",{class:y.description,icon:!1,status:"idle"},a):null}_renderCodedInputs({input:e,props:t}){const a=e.input?.type??null,i=e.codedValueOptions;switch(a){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:i.flat(),props:t});default:return this._renderComboBoxComponent({options:i,props:t,input:e})}}_renderMultipleChoiceComponent({input:e,props:t}){const{messages:a}=this,{multipleChoiceChoices:i,multipleChoiceInput:n,multipleChoiceValues:o}=e;if(!n||!i||!o)return null;const l=!0===n.includeSelectAllChoices,s=new Map;let r=o.length>0,c=!1;for(const g of o){const t=T({input:e,choiceValue:g});s.set(g,t),(t.checked||t.indeterminate)&&(c=!0),t.checked||(r=!1)}const d={checked:r,indeterminate:!r&&c},u=d.checked?a.deselectAllLabel:a.selectAllLabel,m=e.getMultipleChoiceOtherChoiceRenderState(this.messages.otherOptionLabel),p=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:!0})},h=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t})},f=t=>{const{fieldName:a}=m;a&&this._saveOtherChoiceCheckboxValue({input:e,isChecked:t.checked,otherChoiceFieldName:a})},v=t=>{this._saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:m.fieldName})};return X("div",{class:y.multipleChoiceInput,key:`${t.key}-multiple-choice-group`},l?this._renderMultipleChoiceSelectAllCheckbox({props:t,selectAllState:d,selectAllLabel:u,handleSelectAllCheckboxChange:p}):null,this._renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:s,handleChoiceCheckboxChange:h}),m.shouldShow?this._renderMultipleChoiceOtherChoice({props:t,includeSelectAllChoices:l,otherChoiceRenderState:m,handleOtherChoiceCheckboxChange:f,handleOtherChoiceInputChange:v,differentValuesPlaceholder:a.differentValuesPlaceholder}):null)}_renderMultipleChoiceSelectAllCheckbox({props:e,selectAllState:t,selectAllLabel:a,handleSelectAllCheckboxChange:i}){return X("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:t.checked,class:y.multipleChoiceSelectAll,"data-element-id":e[te],disabled:e.readOnly,indeterminate:t.indeterminate,key:`${e.key}-select-all`,label:a,labelText:a,onblur:e.onblur,onfocus:e.onfocus,value:ae,onCalciteCheckboxChange:({currentTarget:e})=>i(e)})}_renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:a,handleChoiceCheckboxChange:i}){const{multipleChoiceChoices:n}=e;return n?n.map(e=>{const n=a.get(e.value)??{checked:!1,indeterminate:!1};return X("calcite-checkbox",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,"aria-invalid":t["aria-invalid"],checked:n.checked,class:t.class,"data-element-id":t[te],disabled:t.readOnly,indeterminate:n.indeterminate,key:`${t.key}-${e.value}`,label:e.label,labelText:e.label,onblur:t.onblur,onfocus:t.onfocus,required:t.required,value:e.value,onCalciteCheckboxChange:({currentTarget:e})=>i(e)})}):[]}_renderMultipleChoiceOtherChoice({props:e,includeSelectAllChoices:t,otherChoiceRenderState:a,handleOtherChoiceCheckboxChange:i,handleOtherChoiceInputChange:n,differentValuesPlaceholder:o}){return X("div",{class:this.classes(y.multipleChoiceOtherChoice,t?y.multipleChoiceOtherChoiceWithSelectAll:null),key:`${e.key}-other-choice`},X("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:a.checkboxState.checked,class:e.class,"data-element-id":e[te],disabled:e.readOnly,indeterminate:a.checkboxState.indeterminate,key:`${e.key}-other-choice-checkbox`,label:a.label,labelText:a.label,onblur:e.onblur,onfocus:e.onfocus,value:ie,onCalciteCheckboxChange:({currentTarget:e})=>i(e)}),a.checkboxState.checked?X("calcite-input",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],"aria-label":a.label,class:y.textElementInput,"data-element-id":e[te],disabled:e.readOnly,key:`${e.key}-other-choice-input`,maxLength:a.maxLength,onblur:e.onblur,onfocus:e.onfocus,placeholder:a.value===S?o:a.hint,required:e.required,type:"text",value:a.normalizedValue===S?"":a.normalizedValue?String(a.normalizedValue):"",onCalciteInputInput:({currentTarget:e})=>n(e)}):null)}async _saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:a=!1}){if(e.multipleChoiceInput&&!a&&"batch"===this.viewModel.mode)return void await this._saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t});const i=e.value,n=this._parseValue(t,e,a);n!==i&&await this.viewModel.setValue(e.template.elementId,n)}async _saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:a}){if(!a)return;const i=t.value,n=null==i||""===i?null:i;e.initializeExplicitMultipleChoiceOtherChoiceCheckedState(),e.stashMultipleChoiceOtherChoiceDraftValueForFeatures(e.features,n);const o=e.features.toArray().filter(e=>e.getAttribute(a)!==n);if(0!==o.length){for(const e of o)e.setAttribute(a,n);this.viewModel.userHasChangedValues=!0,await e.expressionsManager.valueChanged(a,o),this.viewModel.emit("value-change",{features:o.map(e=>e.source),fieldName:a,name:"value-change",value:n})}}async _saveOtherChoiceCheckboxValue({input:e,isChecked:t,otherChoiceFieldName:a}){e.setExplicitMultipleChoiceOtherChoiceCheckedState(t),t||e.setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e.features.toArray());const i=e.features.toArray().filter(i=>{const n=i.getAttribute(a);if(t){if(!ee(n))return!1;const t=e.getMultipleChoiceOtherChoiceDraftValue(i),o=$(t)?t:L;return i.setAttribute(a,o),!0}return null!=n&&(i.setAttribute(a,null),!0)});0!==i.length&&(this.viewModel.userHasChangedValues=!0,await e.expressionsManager.valueChanged(a,i),this.viewModel.emit("value-change",{features:i.map(e=>e.source),fieldName:a,name:"value-change",value:this._getFieldValueByFieldNameForInput(e,a)}))}async _saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t}){if(!e.multipleChoiceInput||!e.multipleChoiceValues)return;const a=e.features.toArray().filter(a=>{const i=a.getAttribute(e.fieldName),n=U({input:e,choiceValue:t.value,currentValue:i,isChecked:t.checked});return i!==n&&(a.setAttribute(e.fieldName,n),!0)});0!==a.length&&(this.viewModel.userHasChangedValues=!0,await e.expressionsManager.valueChanged(e.fieldName,a),this.viewModel.emit("value-change",{features:a.map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:this._getFieldValueByFieldNameForInput(e,e.fieldName)}))}_getFieldValueByFieldNameForInput(e,t){const a=e.features.toArray().map(e=>e.getAttribute(t));if(0===a.length)return null;const[i]=a;return a.every(e=>e===i)?i:S}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===S||e.value===S)&&"batch"===this.viewModel.mode){const a={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[te]:t[te]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:a,options:[{name:this.messages.differentValuesPlaceholder,value:S,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return X("calcite-switch",{...t,checked:!!C(e.template,"switch")&&e.value===e.template.input.onValue,class:y.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:a}){const{trigger:i,dropdown:n,group:o}=a;return X("calcite-dropdown",{...n,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,topLayerDisabled:this.topLayerDisabled,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},X("calcite-button",{...i},e===S?this.messages.differentValuesPlaceholder:e),X("calcite-dropdown-group",{selectionMode:o.mode},t.map(t=>X("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:a}){const i="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),o=i&&e.showNoValueOptionEnabled&&!n?()=>{}:a.onblur,l={...a,onblur:o};return X("calcite-combobox",{...l,selectionMode:"single",topLayerDisabled:this.topLayerDisabled,value:a.placeholder===this.messages.differentValuesPlaceholder?S:String(a.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==S&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:a}))}renderComboboxOptionsList({input:e,options:t,props:a}){const[i,n]=t.map(e=>e.map(({name:e,value:t})=>X("calcite-combobox-item",{heading:e,key:`#${t}`,selected:a.value===t,value:`${t}`}))),o=[...i];n.length>0&&o.push(X("calcite-combobox-item-group",{key:"unsupported",label:this.messages.unsupportedDomainGroupTitle},n));const l=a.placeholder===this.messages.differentValuesPlaceholder,s=!l&&ee(a.value);return e.showNoValueOptionEnabled&&o.unshift(X("calcite-combobox-item",{heading:e.showNoValueLabel||this.messages.empty,key:"empty-option",selected:s,value:""})),l&&o.unshift(X("calcite-combobox-item",{heading:this.messages.differentValuesPlaceholder,key:S,selected:!0,value:S})),o}_renderRadioButtonGroupComponent({input:e,options:t,props:a}){const i=t.map(({name:t,value:i})=>this._renderRadioButtons({label:t,value:i,selected:i===e.value,props:a}));if(e.showNoValueOptionEnabled){const t="",n=e.showNoValueLabel||this.messages.empty,o=ee(e.value);i.unshift(this._renderRadioButtons({label:n,value:t,selected:o,props:a}))}return X("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:y.inputRadioGroup,disabled:a.readOnly,key:`${a.key}-radio-group`,layout:"vertical",name:a.name,required:a.required},i,a.placeholder===this.messages.differentValuesPlaceholder?X("calcite-label",{class:y.placeholderRadio,key:a.label,layout:"inline"},X("calcite-radio-button",{checked:!0,class:y.inputRadio,disabled:!0,name:a.placeholder,value:a.placeholder}),a.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:a,props:i}){return X("calcite-label",{class:y.inputRadioLabel,key:i.label,layout:"inline"},X("calcite-radio-button",{...i,afterCreate:void 0,afterUpdate:void 0,checked:t,class:y.inputRadio,disabled:i.readOnly,name:i.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),a)}_renderStringComponent(e,t){const{template:a}=e;return!a.field.editable||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===a.input?.type?X("calcite-text-area",{...t,class:this.classes(y.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):X("calcite-input",{...t,class:this.classes(y.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const a=d(e.field);return X("calcite-input-number",{...t,integer:a,type:"number",value:a&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const a=this.getCommonInputProps(e);return X("calcite-input",{...a,class:this.classes(y.fieldInput,y.inputDisabled,y.individualElement),readOnly:!0,type:"text",value:String(t??a.value??"")})}_renderDateComponents(e,t){const{field:a}=e;let i;switch(a.type){case"date":i=this._renderDateFieldComponents(e,t);break;case"date-only":i=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":i=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":i=this._renderTimestampOffsetFieldComponents(e,t);break;default:i=this._renderReadOnlyComponent(e,j(a,t.value,{timeZone:e.effectiveTimeZone,...z(e.template.field)}))}return e.value===S?[i,X("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:i}_renderDateOnlyFieldComponent(e,t){const{class:a,key:i,readOnly:n}=t,{rawMax:o,rawMin:l}=e.range;return X("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:a,"data-date-part":"date","data-element-id":t[te],key:`${i}-date-input`,max:u(o)?o:void 0,min:u(l)?l:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,topLayerDisabled:this.topLayerDisabled,value:e.value===S?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:a,key:i,readOnly:n}=t;return X("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:a,"data-date-part":"time","data-element-id":t[te],key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:n,value:e.value===S?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:a,key:i,readOnly:n}=t,{rawMax:o,rawMin:l}=e.range,s=Z(o),r=Z(l),c=Z(e.value===S?"":e.value),d=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[te]:t[te],onfocus:this._onComponentFocus};return X("div",{class:y.dateInputContainer,key:`${i}-date-time-container`},X("calcite-input-date-picker",{...u,class:a,"data-date-part":"date",key:`${i}-date-input`,max:s?.date??void 0,min:r?.date??void 0,onblur:()=>{this._focusedFieldInput=null},topLayerDisabled:this.topLayerDisabled,value:c.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),X("calcite-input-time-picker",{...u,class:a,"data-date-part":"time",key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:c.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),d?X("calcite-input-time-zone",{...u,class:a,clearable:e.value===S||null==e.value,"data-date-part":"timeZone",key:`${i}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:c.timeZoneOffset||"",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:a,key:i,readOnly:n,min:o,max:l}=t,s=e.effectiveTimeZone,r=H(e.value===S?"":e.value,s),c=H(l,s),d=H(o,s),u=e.includeTime,m={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[te]:t[te],onfocus:this._onComponentFocus};return X("div",{class:y.dateInputContainer,key:`${i}-date-time-container`},X("calcite-input-date-picker",{...m,class:a,"data-date-part":"date",key:`${i}-date-input`,max:c?.date??void 0,min:d?.date??void 0,onblur:()=>{this._focusedFieldInput=null},topLayerDisabled:this.topLayerDisabled,value:r.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),u?X("calcite-input-time-picker",{...m,"data-date-part":"time",key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:r.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}_renderRelationshipElementInput(e){const{elementId:t}=e.template;return X("div",{class:y.relationshipElementInput,"data-testid":`relationship-element-${t}`,key:`relationship-element-${t}`})}_renderAttachmentElementInput(e){const{attachments:t,template:{description:a,elementId:i,label:n}}=e;return X("div",{class:y.attachmentElementInput,"data-testid":`attachment-element-${i}`,key:`attachment-element-${i}`},n?X("div",{class:y.attachmentElementLabel,key:`attachment-element-label-${i}`},n):null,a?X("div",{class:y.description,key:`attachment-element-description-${i}`},a):null,t.length?X("calcite-list",{class:y.attachmentElementList,key:`attachment-element-list-${i}`,label:n||this.messagesCommon.details,selectionAppearance:"border",selectionMode:"none"},t.map((t,a)=>{const n=this._formatAttachmentSize(t.size),o=this._getAttachmentLabel(t,a,n,e.displayFilename),l=o===n?void 0:n,s=f(t),r=this._isStagedAttachmentAddition(t);return X("calcite-list-item",{class:y.attachmentElementListItem,description:l,key:`attachment-item-${s}`,label:o,onCalciteListItemSelect:r?void 0:()=>this._setSelectedAttachment({attachmentKey:s,elementId:i})},X("div",{class:y.attachmentElementListItemStart,slot:"content-start"},this._renderAttachmentPreviewThumbnail(t,o,e)),r?X("div",{class:y.attachmentElementListItemActions,slot:"actions-end"},X("span",{class:y.attachmentElementListItemStagedIndicator}),X("calcite-button",{appearance:"transparent","aria-label":this.messagesCommon.delete,disabled:this.effectiveDisabled,iconStart:"x",kind:"neutral",onclick:()=>{this.viewModel.stageDeleteAttachment(i,t.globalId)},scale:"s"})):X("calcite-icon",{icon:"chevron-right",scale:"s",slot:"actions-end"}))})):X("div",{class:y.attachmentElementEmptyState,key:`attachment-element-empty-state-${i}`},this.messages.attachments.noAttachments),this._renderAttachmentAddAction(e))}_renderAttachmentAddAction(e){const{elementId:t}=e.template,a=this.effectiveDisabled||e.addDisabled;return X("div",{class:y.attachmentElementEmptyAction,key:`attachment-element-empty-action-${t}`},X("calcite-button",{appearance:"outline",disabled:a,iconStart:"attachment",kind:"neutral",onclick:()=>this._setAttachmentAddElementId(t),round:!0,scale:"s"},this.messages.attachments.attach))}_renderAttachmentAddPage(){const e=this.viewModel.selectedAttachmentAddInput;return e?this._renderAttachmentAddPanel(e):null}_renderAttachmentAddPanel(e){const{maxAttachmentCount:t}=e,{elementId:a}=e.template,i=null==t||t-e.attachments.length>1,n=this.effectiveDisabled||e.addDisabled,o=this.messages.attachments,l=o.dragAndDropFile,s="upload",r=e=>{this._attachmentFileInputMap.set(a,e)};return X("div",{class:y.attachmentElementAddPanel,key:`attachment-element-add-panel-${a}`},X("input",{accept:e.accept,afterCreate:r,afterRemoved:()=>{this._attachmentFileInputMap.delete(a)},afterUpdate:r,class:y.attachmentElementFileInput,"data-element-id":a,disabled:n,multiple:i,onchange:e=>{const t=e.currentTarget,i=t.files?Array.from(t.files):[];this._stageAttachmentFiles(a,i),t.value=""},type:"file"}),X("div",{class:y.attachmentElementAddDropzone,"data-disabled":n?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),n)return;const t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this._stageAttachmentFiles(a,t)}},X("calcite-icon",{class:y.attachmentElementAddDropzoneIcon,icon:s,scale:"l"}),X("div",{class:y.attachmentElementAddDropzoneHeading},o.addFile),X("div",{class:y.attachmentElementAddDropzoneDetail,title:l},l),X("calcite-button",{appearance:"outline-fill",disabled:n,iconStart:"folder-open",onclick:e=>{e.stopPropagation(),this._openAttachmentFilePicker(a,n)},scale:"s",type:"button"},o.selectFile)))}async _stageAttachmentFiles(e,t){if(0!==t.length)try{await this.viewModel.stageAddAttachments(e,t)}finally{this.viewModel.setSelectedAttachmentAddElementId(null)}}_openAttachmentFilePicker(e,t){t||this._attachmentFileInputMap.get(e)?.click()}_renderAttachmentDetailPage(){const e=this.selectedAttachmentDetails;if(!e)return;const{attachment:t,input:a}=e,i=f(t),n=!!a.getAttachmentPreviewUrl(t);return X("div",{class:y.attachmentElementDetail,key:`attachment-detail-panel-${a.template.elementId}-${i}`},X("div",{class:y.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,a)),X("div",{class:y.attachmentElementDetailActions},X("calcite-button",{appearance:"outline",disabled:!n,iconStart:"download-to",kind:"neutral",onclick:()=>{this._downloadAttachment(t)},scale:"s"},this.messages.attachments.download),v(t)?X("calcite-button",{appearance:"outline",disabled:!n,iconStart:"expand",kind:"neutral",onclick:this._maximizeSelectedAttachment,scale:"s"},this.messages.attachments.maximize):null,X("calcite-button",{appearance:"outline",disabled:!0,iconStart:"refresh",kind:"neutral",scale:"s"},this.messages.attachments.replace)),X("div",{class:y.attachmentElementDetailMetadata},X("span",{class:y.attachmentElementDetailMetadataLabel},this.messages.attachments.fileName),X("span",{class:y.attachmentElementDetailMetadataValue},t.name),X("span",{class:y.attachmentElementDetailMetadataLabel},this.messages.attachments.size),X("span",{class:y.attachmentElementDetailMetadataValue},this._formatAttachmentSize(t.size)),X("span",{class:y.attachmentElementDetailMetadataLabel},this.messages.attachments.type),X("span",{class:y.attachmentElementDetailMetadataValue},this._getLabelForAttachmentType(t))))}_renderAttachmentDialog(){const e=this._attachmentDialogInfo;if(!e)return null;const{attachment:t,input:a}=e;return X("calcite-dialog",{heading:t.name||this.messagesCommon.details,key:"attachment-preview-dialog",modal:!0,open:!0,placement:"cover",width:"l",onCalciteDialogClose:this._closeAttachmentDialog},X("div",{class:y.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,a)))}_setSelectedAttachment(e){this.viewModel.setSelectedAttachment(e),e||this.hideAttachmentDialog()}_setAttachmentAddElementId(e){this.viewModel.setSelectedAttachmentAddElementId(e),this.hideAttachmentDialog()}_getAttachmentLabel(e,a,i,n){return!1!==n&&u(e.name)&&e.name.length>0?e.name:i!==this.messagesCommon.notApplicable?i:t(this.messages.attachments.attachmentNumberedLabel,{index:a+1})}_formatAttachmentSize(e){return null==e||Number.isNaN(e)?this.messagesCommon.notApplicable:s(this.messagesUnits,e)}_getLabelForAttachmentType({contentType:e}){if(!e)return this.messagesCommon.notApplicable;const t=this.messages.attachments.attachmentTypes,a=p(e);return t?.[a]||e}_renderAttachmentPreviewThumbnail(e,t,a){const i=a.getAttachmentPreviewUrl(e,64);return i&&v(e)?X("img",{alt:t,class:y.attachmentElementListItemThumb,src:i}):X("calcite-icon",{class:y.attachmentElementListItemIcon,icon:h(e.contentType),scale:"s"})}_isStagedAttachmentAddition(e){return"number"==typeof e.id&&e.id<0}_renderAttachmentPreviewImageForInput(e,t){const a=t.getAttachmentPreviewUrl(e),i=e.name||this.messagesCommon.details;return a&&v(e)?X("img",{alt:i,class:y.attachmentElementDetailPreviewImage,src:a,title:i}):[X("calcite-icon",{class:y.attachmentElementDetailPreviewIcon,icon:h(e.contentType),scale:"l",textLabel:i,title:i}),this.messages.attachments.noPreviewAvailable]}async _downloadAttachment(e){await B(e)}hideAttachmentDialog(){this._attachmentDialogInfo=null}_renderTextComponent(e){const{elementId:t}=e.template;return X("div",{class:y.textElementInput,"data-testid":`text-element-${t}`,innerHTML:e.text,key:`text-element-${t}`})}_renderUtilityNetworkAssociationsElementInput(e){const{elementId:t}=e.template;return X("div",{class:y.utilityNetworkAssociationsElementInput,"data-testid":t,key:t})}getCommonInputProps(e){const{template:t,valid:a,value:i,minLength:n,maxLength:o,required:l,fieldName:s,editable:r,userHasChangedValue:c,range:{max:d,min:u}}=e,m=!r||this.readOnly,p=!m&&this.effectiveDisabled;let h=t.hint??void 0,f=!1;return i===S&&(h=this.messages.differentValuesPlaceholder,f=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":a?"false":"true",class:this.classes(y.fieldInput,m?y.inputDisabled:null),status:!c&&!this.viewModel.submitHasBeenAttempted||a?"idle":"invalid",maxLength:o&&o>-1?o:void 0,minLength:n&&n>-1?n:void 0,key:t.elementId,label:s,name:s,max:null!=d?d:void 0,min:null!=u?u:void 0,disabled:p,readOnly:m,onblur:this._onComponentBlur,required:l,placeholder:h,value:f?"":i??"",[te]:t.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(te))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,a=e.querySelector("calcite-radio-button"),i=t||a;i&&this._afterComponentCreateOrUpdate(i)}_onComponentFocus(e){const t=e.target,a=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(a.template.elementId),this._focusedFieldInput=a}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),a=this._focusedFieldInput;this._attemptFocusOnNextRender&&a===t&&(this._attemptFocusOnNextRender=!1,Y(e))}_onComponentBlur(){this._focusedFieldInput=null}_resetTransientFormState(){this._attemptFocusOnNextRender=!1,this._focusedFieldInput=null,this._attachmentDialogInfo=null,this._attachmentFileInputMap.clear()}_parseValue(e,t,a=!1){const i=t.multipleChoiceInput,n=t.multipleChoiceValues;if(i&&n){const o=i.choiceDelimiter,l=e;if(a){return N({input:t}).checked?null:n.length>0?n.join(o):null}const s=P(t.value,o).filter(e=>e!==S),r=new Set(s);l.checked?r.add(l.value):r.delete(l.value);const c=n.filter(e=>r.has(e));return c.length?c.join(o):null}if(C(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const a of t.domain.codedValues)if(a.name===e.selectedItems[0].textContent)return a.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const o=e.value;return null==o||""===o?null:"number"===t.dataType?"-0"===o||"-0."===o||"-0,"===o?o:parseFloat(o):"date"===t.field.type?parseFloat(o):o}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:a}=t.template;if(!t)return;const i=t?.value;if(C(t.template,"switch")&&"single"!==this.viewModel.mode){const e=n(this._batchSwitchInputInitialValues,t,()=>t.value);this._batchSwitchInputInitialValues.set(t,null===e?i:e)}const o=this._parseValue(e,t);o!==i&&this.viewModel.setValue(a,o)}_afterDateComponentCreate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:a}=e.template,i=e.field.type,n=this._dateComponentMap.get(`${a}`);if(!n)return;const o=e.effectiveTimeZone;let l=e.value===S?void 0:e.value,s=null;"date-only"===i?s=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===i?(l=q(l),s=q(t.value)):s="timestamp-offset"===i?null!=t.value?G({dateComponent:n.date,timeComponent:n.time,oldValue:l,timeZoneComponent:n.timeZone,defaultTimeZone:o}):null:null!=t.value?W({oldValue:l,dateComponent:n.date,timeZone:o,timeComponent:n.time?.value===S?void 0:n.time}):null,l!==s&&(null!==s&&t.value?this.viewModel.setValue(`${a}`,s):this.viewModel.setValue(`${a}`,null))}};e([r()],ne.prototype,"activeFeatureIndex",null),e([r()],ne.prototype,"disabled",null),e([r()],ne.prototype,"effectiveTitle",null),e([r()],ne.prototype,"effectiveDisabled",null),e([r()],ne.prototype,"features",null),e([r()],ne.prototype,"footerButtonInfos",null),e([r()],ne.prototype,"footerNoticeInfos",null),e([r()],ne.prototype,"map",null),e([r()],ne.prototype,"maximumFeatureCount",null),e([r()],ne.prototype,"maximumFeatureCountWithComplexForms",null),e([r()],ne.prototype,"spatialReference",null),e([r()],ne.prototype,"layerInfos",null),e([r()],ne.prototype,"timeZone",null),e([r()],ne.prototype,"headingLevel",void 0),e([r()],ne.prototype,"icon",null),e([r(),J("esri/t9n/common")],ne.prototype,"messagesCommon",void 0),e([r(),J("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],ne.prototype,"messages",void 0),e([r(),J("esri/core/t9n/Units")],ne.prototype,"messagesUnits",void 0),e([r()],ne.prototype,"page",null),e([r()],ne.prototype,"readOnly",null),e([r()],ne.prototype,"selectedAttachment",null),e([r()],ne.prototype,"selectedAttachmentDetails",null),e([r()],ne.prototype,"valid",null),e([r({type:_}),Q(["value-change","submit"])],ne.prototype,"viewModel",void 0),e([r({type:w,nonNullable:!0})],ne.prototype,"visibleElements",void 0),e([r()],ne.prototype,"groupDisplay",void 0),e([r()],ne.prototype,"_attemptFocusOnNextRender",void 0),e([r()],ne.prototype,"_formId",null),e([r()],ne.prototype,"_focusedFieldInput",void 0),e([r()],ne.prototype,"_attachmentDialogInfo",void 0),ne=e([c("esri.widgets.BatchAttributeForm")],ne);const oe=ne;export{oe as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{deprecateWidget as a}from"../core/deprecate.js";import i from"../core/Logger.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{watch as l,when as s,on as o}from"../core/reactiveUtils.js";import{formatFileSize as r}from"../core/unitFormatUtils.js";import{property as c,subclass as d}from"../core/accessorSupport/decorators.js";import{isIntegerField as m}from"../layers/support/fieldUtils.js";import{isString as u}from"../support/guards.js";import p from"./Widget.js";import{getAttachmentTypeCategory as h,getCalciteIconForAttachment as v}from"./Attachments/support/attachmentUtils.js";import{getAttachmentKey as g,isImageAttachment as f}from"./BatchAttributeForm/attachmentUtils.js";import{getHiddenFieldsValidationErrorMessage as b,getVisibleFieldInputValidationErrorMessage as C,isElementTemplateWithInputType as _}from"./BatchAttributeForm/batchAttributeFormUtils.js";import y from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as I}from"./BatchAttributeForm/css.js";import{makeAddAttachmentFooterButtons as F,makeViewingAttachmentFooterButtons as A,makeDefaultFooterButtons as w}from"./BatchAttributeForm/interfaceUtils.js";import k from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as x,isFieldInput as M,isTextElementInput as D,isRelationshipElementInput as E,isAttachmentElementInput as V,isUtilityNetworkAssociationsElementInput as O,differentValuesString as T}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{clearMultipleChoiceOtherChoiceStateForViewModel as S,getMultipleChoiceCheckboxState as L,otherChoiceCheckedPlaceholderValue as U,getUpdatedMultipleChoiceValueForFeature as P,getMultipleChoiceSelectAllState as N,splitMultipleChoiceValue as $,canRestoreMultipleChoiceOtherChoiceDraftValue as B}from"./BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js";import{downloadAttachmentInfo as R}from"./FeatureTable/support/exportUtils.js";import{loadCalciteComponents as j}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as z,getIntlOptionsForField as Z,prepareISOFieldValueForDateComponents as H,prepareUnixFieldValueForDateComponents as q,normalizeTimeOnlyString as W,getISOFieldValueFromDateComponents as G,getUnixFieldValueFromDateComponents as K}from"./support/dateUtils.js";import{globalCss as J}from"./support/globalCss.js";import{calciteListFilterProps as Q}from"./support/listUtils.js";import{messageBundle as X,vmEvent as Y,tsx as ee}from"./support/widget.js";import{setFocus as te}from"./support/widgetUtils.js";import{isEmptyValue as ae}from"./support/forms/formUtils.js";const ie="data-element-id",ne="esri_BatchAttributeForm_select_all",le="esri_BatchAttributeForm_other_choice";let se=class extends p{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.messagesUnits=null,this.viewModel=new y,this.visibleElements=new k,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._attachmentDialogInfo=null,this._attachmentListFilterText="",this._attachmentFileInputMap=new Map,this._maximizeSelectedAttachment=()=>{this._attachmentDialogInfo=this.selectedAttachmentDetails},this._closeAttachmentDialog=()=>{this.hideAttachmentDialog()},this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),e?.suppressDeprecationWarning||(this.announceDeprecation=()=>{a(i.getLogger(this),"Editor","arcgis-editor",{version:"5.0"})})}normalizeCtorArgs(e={}){const{suppressDeprecationWarning:t,...a}=e;return a}initialize(){this.addHandles([l(()=>this.features,()=>{this._dateComponentMap.clear(),this._resetTransientFormState(),S(this.viewModel,{includeDraftValues:!0})}),l(()=>this.viewModel.activeForm,()=>{this._batchSwitchInputInitialValues.clear(),this._resetTransientFormState(),S(this.viewModel)}),l(()=>this.viewModel.selectedAttachmentAddElementId,()=>{this.hideAttachmentDialog()}),s(()=>!this.selectedAttachmentDetails,()=>this.hideAttachmentDialog()),l(()=>this.viewModel.selectedAttachmentListElementId,()=>{this._attachmentListFilterText=""}),o(()=>this.viewModel,"submit",()=>{this.valid||this.goToFirstError()})])}loadDependencies(){return j({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),"combobox-item-group":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item-group"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get effectiveTitle(){const{features:e,messages:t,page:a}=this;return"viewing-attachment-details"===a?t.titles.editAttachment:"adding-attachments"===a?t.titles.addAttachments:"viewing-attachments"===a?t.titles.attachments:1===e.length||this.activeFeatureIndex>-1?t.titles.editFeature:e.length>1?t.titles.editFeatures:""}get effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get footerButtonInfos(){if(!this.features.length)return[];const{page:e,messages:t}=this,a=this.viewModel.selectedAttachmentAddElementId;return"adding-attachments"===e&&a?F({messages:t,onclick:()=>this._attachmentFileInputMap.get(a)?.click()}):"viewing-attachment-details"===e?A({messages:t}):"viewing-attachments"===e?[]:w({formId:this._formId,callback:this.submit,messages:t})}get footerNoticeInfos(){if(!this.features.length)return[];const{messages:{footerNotices:e}}=this;return[]}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get maximumFeatureCount(){return this.viewModel.maximumFeatureCount}set maximumFeatureCount(e){this.viewModel.maximumFeatureCount=e}get maximumFeatureCountWithComplexForms(){return this.viewModel.maximumFeatureCountWithComplexForms}set maximumFeatureCountWithComplexForms(e){this.viewModel.maximumFeatureCountWithComplexForms=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}get page(){return this.viewModel.page}get readOnly(){return this.viewModel.readOnly}set readOnly(e){this.viewModel.readOnly=e}get selectedAttachment(){return this.viewModel.selectedAttachment}get selectedAttachmentDetails(){return this.viewModel.selectedAttachmentDetails}get valid(){return this.viewModel.valid}get _formId(){return`${this.id}-form`}async goBack(){return this.viewModel.goBack()}async goHome(){return this.viewModel.goHome()}goToFirstError(){const e=this.viewModel.getFirstVisibleInvalidFieldInput();if(!e)return;const{groupInput:t}=e;t&&(t.open||(t.open=!0)),this._focusedFieldInput=e.input,this._attemptFocusOnNextRender=!0,this.scheduleRender()}render(){return ee("div",{class:this.classes(I.base,J.widget,J.panel)},this._renderContent(),this._renderAttachmentDialog())}submit(){this.viewModel.submit()}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:a}=e.dataset,i=n(this._dateComponentMap,`${a}`,()=>({}));switch(t){case"date":i.date=e;break;case"time":i.time=e;break;case"timeZone":i.timeZone=e}}_renderContent(){const{messages:e,viewModel:a}=this,{status:i}=a;return"failed"===i?a.hasTooManyComplexFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyComplexFeatures,{num:a.maximumFeatureCountWithComplexForms})):a.hasTooManyFeatures?this._renderErrorNotice(t(e.formFailedToLoadTooManyFeatures,{num:a.maximumFeatureCount})):e.formFailedToLoad:a.expressionEvaluationFailed?this._renderErrorNotice(e.expressionEvaluationFailed):a.hasLayersWithContingentValues&&this.viewModel.features.length>1?this._renderErrorNotice(e.unsupportedContingentValues):"loading"===i&&this.visibleElements.loadingIndicator?ee("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):0!==this.features.length?this._renderForm():void 0}_renderErrorNotice(e,t="warning"){return ee("calcite-notice",{class:I.noticeError,icon:!0,kind:t,open:!0},ee("div",{slot:"message"},e))}_renderForm(){return ee("form",{class:I.form,id:this._formId,onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderPage())}_renderPage(){switch(this.page){case"adding-attachments":return this._renderAttachmentAddPage();case"viewing-attachments":return this._renderAttachmentListPage();case"viewing-attachment-details":return this._renderAttachmentDetailPage();default:return this._renderFormContent()}}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:a}=e;let i;if(!e.submitHasBeenAttempted)return null;if(a.invalidHiddenInputs.length>0)if(i=b(a,e.mode,this.messages),"batch"===this.viewModel.mode){const e=a.invalidHiddenInputs.filter(e=>"hidden:group-visibility-expression:all-features"===e.effectiveVisibilityCode||"hidden:visibility-expression:all-features"===e.visibilityCode);e.length>0?i+=` (${e.map(e=>e.label).join(", ")})`:i=null}else i+=` (${a.invalidHiddenInputs.map(e=>e.label).join(", ")})`;else if(t)return null;return i?this._renderErrorNotice(i,"danger"):null}_renderFormContent(){return this.viewModel.hasVisibleInputs?this.viewModel.activeForm.inputs.filter(e=>e.visible).map(e=>this._renderInput(e)):this._renderErrorNotice(this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason])}_renderInput(e){return x(e)?this._renderGroupInput(e):M(e)?this._renderLabeledField(e):D(e)?this._renderTextComponent(e):E(e)?this._renderRelationshipElementInput(e):V(e)?this._renderAttachmentElementInput(e):O(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderGroupInput(e){const{inputs:t,template:a,open:i}=e,n=t.filter(e=>e.visible),l=a.label??"";return ee("calcite-block",{class:this.classes(I.group,"sequential"===this.groupDisplay?I.groupSequential:null,this.disabled?I.inputDisabled:null),collapsible:!0,description:a.description??void 0,disabled:this.effectiveDisabled,expanded:i,heading:l,headingLevel:this.headingLevel,key:`{${a.elementId}-key}`,label:l,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},n.map(e=>this._renderInput(e)))}_renderLabeledField(e){const{elementId:a}=e.template,{label:i,required:n,dataType:l}=e,s=n?t(this.messages.requiredFieldLabel,{name:i}):i;return ee("calcite-label",{"aria-label":s,class:I.label,key:`field--${a}`},ee("div",{class:I.labelTextContent,key:"labelTextContainer"},i,n?ee("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==l?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:a}=e;return"date"===a?this._renderDateComponents(e,t):"coded-value"===e.domain?.type?this._renderCodedInputs({input:e,props:t}):null!==e.multipleChoiceChoices?this._renderMultipleChoiceComponent({input:e,props:t}):"number"===a?this._renderNumberComponent(e,t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:a,submittable:i}=e,n=!i&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?C(e,t,this.messages):null;return n?ee("calcite-input-message",{icon:!0,status:"invalid"},n):a?ee("calcite-input-message",{class:I.description,icon:!1,status:"idle"},a):null}_renderCodedInputs({input:e,props:t}){const a=e.input?.type??null,i=e.codedValueOptions;switch(a){case"switch":return this._renderSwitchField({input:e,props:t});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:i,props:t});default:return this._renderComboBoxComponent({options:i,props:t,input:e})}}_renderMultipleChoiceComponent({input:e,props:t}){const{messages:a}=this,{multipleChoiceChoices:i,multipleChoiceInput:n,multipleChoiceValues:l}=e;if(!n||!i||!l)return null;const s=!0===n.includeSelectAllChoices,o=new Map;let r=l.length>0,c=!1;for(const f of l){const t=L({input:e,choiceValue:f});o.set(f,t),(t.checked||t.indeterminate)&&(c=!0),t.checked||(r=!1)}const d={checked:r,indeterminate:!r&&c},m=d.checked?a.deselectAllLabel:a.selectAllLabel,u=e.getMultipleChoiceOtherChoiceRenderState(this.messages.otherOptionLabel),p=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:!0})},h=t=>{this._saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t})},v=t=>{const{fieldName:a}=u;a&&this._saveOtherChoiceCheckboxValue({input:e,isChecked:t.checked,otherChoiceFieldName:a})},g=t=>{this._saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:u.fieldName})};return ee("div",{class:I.multipleChoiceInput,key:`${t.key}-multiple-choice-group`},s?this._renderMultipleChoiceSelectAllCheckbox({props:t,selectAllState:d,selectAllLabel:m,handleSelectAllCheckboxChange:p}):null,this._renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:o,handleChoiceCheckboxChange:h}),u.shouldShow?this._renderMultipleChoiceOtherChoice({props:t,includeSelectAllChoices:s,otherChoiceRenderState:u,handleOtherChoiceCheckboxChange:v,handleOtherChoiceInputChange:g,differentValuesPlaceholder:a.differentValuesPlaceholder}):null)}_renderMultipleChoiceSelectAllCheckbox({props:e,selectAllState:t,selectAllLabel:a,handleSelectAllCheckboxChange:i}){return ee("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:t.checked,class:I.multipleChoiceSelectAll,"data-element-id":e[ie],disabled:e.readOnly,indeterminate:t.indeterminate,key:`${e.key}-select-all`,label:a,labelText:a,value:ne,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>i(e),onfocus:e.onfocus})}_renderMultipleChoiceChoiceCheckboxes({input:e,props:t,checkboxStatesByValue:a,handleChoiceCheckboxChange:i}){const{multipleChoiceChoices:n}=e;return n?n.map(e=>{const n=a.get(e.value)??{checked:!1,indeterminate:!1};return ee("calcite-checkbox",{afterCreate:t.afterCreate,afterUpdate:t.afterUpdate,"aria-invalid":t["aria-invalid"],checked:n.checked,class:t.class,"data-element-id":t[ie],disabled:t.readOnly,indeterminate:n.indeterminate,key:`${t.key}-${e.value}`,label:e.label,labelText:e.label,required:t.required,value:e.value,onblur:t.onblur,onCalciteCheckboxChange:({currentTarget:e})=>i(e),onfocus:t.onfocus})}):[]}_renderMultipleChoiceOtherChoice({props:e,includeSelectAllChoices:t,otherChoiceRenderState:a,handleOtherChoiceCheckboxChange:i,handleOtherChoiceInputChange:n,differentValuesPlaceholder:l}){return ee("div",{class:this.classes(I.multipleChoiceOtherChoice,t?I.multipleChoiceOtherChoiceWithSelectAll:null),key:`${e.key}-other-choice`},ee("calcite-checkbox",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],checked:a.checkboxState.checked,class:e.class,"data-element-id":e[ie],disabled:e.readOnly,indeterminate:a.checkboxState.indeterminate,key:`${e.key}-other-choice-checkbox`,label:a.label,labelText:a.label,value:le,onblur:e.onblur,onCalciteCheckboxChange:({currentTarget:e})=>i(e),onfocus:e.onfocus}),a.checkboxState.checked?ee("calcite-input",{afterCreate:e.afterCreate,afterUpdate:e.afterUpdate,"aria-invalid":e["aria-invalid"],"aria-label":a.label,class:I.textElementInput,"data-element-id":e[ie],disabled:e.readOnly,key:`${e.key}-other-choice-input`,maxLength:a.maxLength,placeholder:a.value===T?l:a.hint,required:e.required,type:"text",value:a.normalizedValue===T?"":a.normalizedValue?String(a.normalizedValue):"",onblur:e.onblur,onCalciteInputInput:({currentTarget:e})=>n(e),onfocus:e.onfocus}):null)}async _saveValueFromMultipleChoiceCheckbox({input:e,checkbox:t,isSelectAllCheckbox:a=!1}){if(e.multipleChoiceInput&&!a&&"batch"===this.viewModel.mode)return void await this._saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t});const i=e.value,n=this._parseValue(t,e,a);n!==i&&await this.viewModel.setValue(e.template.elementId,n)}async _saveValueFromMultipleChoiceTextInput({input:e,textInput:t,otherChoiceFieldName:a}){if(!a)return;const i=t.value,n=null==i||""===i?null:i;e.initializeExplicitMultipleChoiceOtherChoiceCheckedState(),e.stashMultipleChoiceOtherChoiceDraftValueForFeatures(e.features,n);const l=e.features.toArray().filter(e=>e.getAttribute(a)!==n);if(0!==l.length){for(const e of l)e.setAttribute(a,n);this.viewModel.userHasChangedValues=!0,await e.expressionsManager.valueChanged(a,l),this.viewModel.emit("value-change",{features:l.map(e=>e.source),fieldName:a,name:"value-change",value:n})}}async _saveOtherChoiceCheckboxValue({input:e,isChecked:t,otherChoiceFieldName:a}){e.setExplicitMultipleChoiceOtherChoiceCheckedState(t),t||e.setMultipleChoiceOtherChoiceDraftValuesFromFeatures(e.features.toArray());const i=e.features.toArray().filter(i=>{const n=i.getAttribute(a);if(t){if(!ae(n))return!1;const t=e.getMultipleChoiceOtherChoiceDraftValue(i),l=B(t)?t:U;return i.setAttribute(a,l),!0}return null!=n&&(i.setAttribute(a,null),!0)});0!==i.length&&(this.viewModel.userHasChangedValues=!0,await e.expressionsManager.valueChanged(a,i),this.viewModel.emit("value-change",{features:i.map(e=>e.source),fieldName:a,name:"value-change",value:this._getFieldValueByFieldNameForInput(e,a)}))}async _saveMultipleChoiceCheckboxValueByFeature({input:e,checkbox:t}){if(!e.multipleChoiceInput||!e.multipleChoiceValues)return;const a=e.features.toArray().filter(a=>{const i=a.getAttribute(e.fieldName),n=P({input:e,choiceValue:t.value,currentValue:i,isChecked:t.checked});return i!==n&&(a.setAttribute(e.fieldName,n),!0)});0!==a.length&&(this.viewModel.userHasChangedValues=!0,await e.expressionsManager.valueChanged(e.fieldName,a),this.viewModel.emit("value-change",{features:a.map(e=>e.source),fieldName:e.fieldName,name:"value-change",value:this._getFieldValueByFieldNameForInput(e,e.fieldName)}))}_getFieldValueByFieldNameForInput(e,t){const a=e.features.toArray().map(e=>e.getAttribute(t));if(0===a.length)return null;const[i]=a;return a.every(e=>e===i)?i:T}_renderSwitchField({input:e,props:t}){if((this._batchSwitchInputInitialValues.get(e)===T||e.value===T)&&"batch"===this.viewModel.mode){const a={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[ie]:t[ie]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:a,options:[{name:this.messages.differentValuesPlaceholder,value:T,disabled:!0},...e.codedValueDomainOptions]})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return ee("calcite-switch",{...t,checked:!!_(e.template,"switch")&&e.value===e.template.input.onValue,class:I.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:a}){const{trigger:i,dropdown:n,group:l}=a;return ee("calcite-dropdown",{...n,topLayerDisabled:this.topLayerDisabled,onblur:()=>{this._focusedFieldInput=null},onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e),onfocus:this._onComponentFocus},ee("calcite-button",{...i},e===T?this.messages.differentValuesPlaceholder:e),ee("calcite-dropdown-group",{selectionMode:l.mode},t.map(t=>ee("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name))))}_renderComboBoxComponent({input:e,options:t,props:a}){const i="INSERT"===this.viewModel.editType,n=this._touchedInputs.has(e?.template?.elementId),l=i&&e.showNoValueOptionEnabled&&!n?()=>{}:a.onblur,s={...a,onblur:l};return ee("calcite-combobox",{...s,selectionMode:"single",topLayerDisabled:this.topLayerDisabled,value:a.placeholder===this.messages.differentValuesPlaceholder?T:String(a.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==T&&this._saveInput(e)}},this.renderComboboxOptionsList({input:e,options:t,props:a}))}renderComboboxOptionsList({input:e,options:t,props:a}){const i=e=>e.map(e=>{const{value:t}=e,i=ae(e.value)?this.messages.empty:e.name;return ee("calcite-combobox-item",{heading:i,key:`#${t}`,selected:a.value===t,value:`${t}`})});let n=[];const{messages:l}=this;t.other.length>0&&n.push(ee("calcite-combobox-item-group",{key:"other",label:l.other},i(t.other))),t.unsupported.length>0&&n.push(ee("calcite-combobox-item-group",{key:"unsupported",label:l.unsupported},i(t.unsupported)));const s=i(t.recommended);n.length>0?n.unshift(ee("calcite-combobox-item-group",{key:"recommended",label:l.recommended},s)):n=s;const o=a.placeholder===this.messages.differentValuesPlaceholder,r=!o&&ae(a.value);return e.showNoValueOptionEnabled&&!t.containsEmptyOption&&n.unshift(ee("calcite-combobox-item",{heading:e.showNoValueLabel||this.messages.empty,key:"empty-option",selected:r,value:""})),o&&n.unshift(ee("calcite-combobox-item",{heading:this.messages.differentValuesPlaceholder,key:T,selected:!0,value:T})),n}_renderRadioButtonGroupComponent({input:e,options:t,props:a}){const i=[...t.recommended,...t.other,...t.unsupported].map(({name:t,value:i})=>this._renderRadioButtons({label:t,value:i,selected:i===e.value,props:a}));if(e.showNoValueOptionEnabled&&!t.containsEmptyOption){const t="",n=e.showNoValueLabel||this.messages.empty,l=ae(e.value);i.unshift(this._renderRadioButtons({label:n,value:t,selected:l,props:a}))}return ee("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:I.inputRadioGroup,disabled:a.readOnly,key:`${a.key}-radio-group`,layout:"vertical",name:a.name,required:a.required},i,a.placeholder===this.messages.differentValuesPlaceholder?ee("calcite-label",{class:I.placeholderRadio,key:a.label,layout:"inline"},ee("calcite-radio-button",{checked:!0,class:I.inputRadio,disabled:!0,name:a.placeholder,value:a.placeholder}),a.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:a,props:i}){return ee("calcite-label",{class:I.inputRadioLabel,key:i.label,layout:"inline"},ee("calcite-radio-button",{...i,afterCreate:void 0,afterUpdate:void 0,checked:t,class:I.inputRadio,disabled:i.readOnly,name:i.label,value:e,onblur:()=>{this._focusedFieldInput=null},onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),a)}_renderStringComponent(e,t){const{template:a}=e;return!a.field.editable||this.readOnly?this._renderReadOnlyComponent(e):"text-area"===a.input?.type?ee("calcite-text-area",{...t,class:this.classes(I.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):ee("calcite-input",{...t,class:this.classes(I.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)})}_renderNumberComponent(e,t){const a=m(e.field);return ee("calcite-input-number",{...t,integer:a,type:"number",value:a&&""!==t.value?Math.round(parseFloat(String(t.value))).toString():String(t.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const a=this.getCommonInputProps(e);return ee("calcite-input",{...a,class:this.classes(I.fieldInput,I.inputDisabled,I.individualElement),readOnly:!0,type:"text",value:String(t??a.value??"")})}_renderDateComponents(e,t){const{field:a}=e;let i;switch(a.type){case"date":i=this._renderDateFieldComponents(e,t);break;case"date-only":i=this._renderDateOnlyFieldComponent(e,t);break;case"time-only":i=this._renderTimeOnlyFieldComponent(e,t);break;case"timestamp-offset":i=this._renderTimestampOffsetFieldComponents(e,t);break;default:i=this._renderReadOnlyComponent(e,z(a,t.value,{timeZone:e.effectiveTimeZone,...Z(e.template.field)}))}return e.value===T?[i,ee("calcite-input-message",{icon:"information",key:"diff-values-message",status:"idle"},this.messages.differentValues)]:i}_renderDateOnlyFieldComponent(e,t){const{class:a,key:i,readOnly:n}=t,{rawMax:l,rawMin:s}=e.range;return ee("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:a,"data-date-part":"date","data-element-id":t[ie],key:`${i}-date-input`,max:u(l)?l:void 0,min:u(s)?s:void 0,overlayPositioning:"fixed",readOnly:n,topLayerDisabled:this.topLayerDisabled,value:e.value===T?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimeOnlyFieldComponent(e,t){const{class:a,key:i,readOnly:n}=t;return ee("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,class:a,"data-date-part":"time","data-element-id":t[ie],key:`${i}-time-input`,overlayPositioning:"fixed",readOnly:n,value:e.value===T?"":e.value?String(e.value):"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget),onfocus:this._onComponentFocus})}_renderTimestampOffsetFieldComponents(e,t){const{class:a,key:i,readOnly:n}=t,{rawMax:l,rawMin:s}=e.range,o=H(l),r=H(s),c=H(e.value===T?"":e.value),d=e.includeTimeOffset,m={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[ie]:t[ie],onfocus:this._onComponentFocus};return ee("div",{class:I.dateInputContainer,key:`${i}-date-time-container`},ee("calcite-input-date-picker",{...m,class:a,"data-date-part":"date",key:`${i}-date-input`,max:o?.date??void 0,min:r?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:c.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),ee("calcite-input-time-picker",{...m,class:a,"data-date-part":"time",key:`${i}-time-input`,value:c.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),d?ee("calcite-input-time-zone",{...m,class:a,clearable:e.value===T||null==e.value,"data-date-part":"timeZone",key:`${i}-timezone-input`,value:c.timeZoneOffset||"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:a,key:i,readOnly:n,min:l,max:s}=t,o=e.effectiveTimeZone,r=q(e.value===T?"":e.value,o),c=q(s,o),d=q(l,o),m=e.includeTime,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,overlayPositioning:"fixed",readOnly:n,[ie]:t[ie],onfocus:this._onComponentFocus};return ee("div",{class:I.dateInputContainer,key:`${i}-date-time-container`},ee("calcite-input-date-picker",{...u,class:a,"data-date-part":"date",key:`${i}-date-input`,max:c?.date??void 0,min:d?.date??void 0,topLayerDisabled:this.topLayerDisabled,value:r.date??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),m?ee("calcite-input-time-picker",{...u,"data-date-part":"time",key:`${i}-time-input`,step:1,value:r.time??"",onblur:()=>{this._focusedFieldInput=null},onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}_renderRelationshipElementInput(e){const{elementId:t}=e.template;return ee("div",{class:I.relationshipElementInput,"data-testid":`relationship-element-${t}`,key:`relationship-element-${t}`})}_renderAttachmentElementInput(e){const{allAttachmentsVisibleOnDefaultPage:t,attachments:a,defaultPageAttachments:i,template:{description:n,elementId:l,label:s}}=e,o=t?a:i;return ee("div",{class:I.attachmentElementInput,"data-testid":`attachment-element-${l}`,key:`attachment-element-${l}`},s?ee("div",{class:I.attachmentElementLabel,key:`attachment-element-label-${l}`},s):null,n?ee("div",{class:I.description,key:`attachment-element-description-${l}`},n):null,a.length?this._renderAttachmentList(e,o,{label:s||this.messagesCommon.details,viewAllCount:t?null:a.length}):ee("div",{class:I.attachmentElementEmptyState,key:`attachment-element-empty-state-${l}`},this.messages.attachments.noAttachments),this._renderAttachmentAddAction(e))}_renderAttachmentListPage(){const e=this.viewModel.selectedAttachmentListInput;if(e)return ee("div",{class:I.attachmentElementAllPanel,key:`attachment-element-all-panel-${e.template.elementId}`},this._renderAttachmentList(e,e.attachments,{filterEnabled:!0,label:this.messages.titles.attachments}))}_renderAttachmentList(e,t,a){const{filterEnabled:i,label:n,viewAllCount:l}=a;return ee("calcite-list",{class:I.attachmentElementList,filterEnabled:i,filterPlaceholder:i?this.messages.attachments.searchAttachments:void 0,filterProps:i?Q:void 0,filterText:i?this._attachmentListFilterText:void 0,label:n,selectionAppearance:"border",selectionMode:"none",onCalciteListFilter:i?e=>{this._attachmentListFilterText=e.currentTarget.filterText??""}:void 0},this._renderAttachmentListItems(e,t),null!=l?this._renderViewAllAttachmentsItem(e,l):null)}_renderAttachmentListItems(e,t){const{elementId:a}=e.template;return t.map((t,i)=>{const n=this._formatAttachmentSize(t.size),l=this._getAttachmentLabel(t,i,n,e.displayFilename),s=l===n?void 0:n,o=g(t),r=e.isStagedAttachmentAddition(t);return ee("calcite-list-item",{class:I.attachmentElementListItem,description:s,key:`attachment-item-${o}`,label:l,onCalciteListItemSelect:r?void 0:()=>this._setSelectedAttachment({attachmentKey:o,elementId:a})},ee("div",{class:I.attachmentElementListItemStart,slot:"content-start"},this._renderAttachmentPreviewThumbnail(t,l,e)),r?[ee("span",{class:I.attachmentElementListItemStagedIndicator,slot:"content-end"}),ee("calcite-action",{disabled:this.effectiveDisabled,icon:"x",scale:"s",slot:"actions-end",text:this.messagesCommon.delete,title:this.messagesCommon.delete,onclick:()=>this.viewModel.stageDeleteAttachment(a,t.globalId)})]:ee("calcite-action",{icon:"chevron-right",scale:"s",slot:"actions-end",text:l,title:l}))})}_renderViewAllAttachmentsItem(e,a){const{elementId:i}=e.template,{viewAll:n}=this.messages.attachments;return ee("calcite-list-item",{class:I.attachmentElementListItem,description:t(this.messages.attachments.count,{count:a}),key:`attachment-item-view-all-${i}`,label:n,onCalciteListItemSelect:()=>this._setAttachmentListElementId(i)},ee("calcite-action",{icon:"chevron-right",scale:"s",slot:"actions-end",text:n,title:n}))}_renderAttachmentAddAction(e){const{elementId:t}=e.template,a=this.effectiveDisabled||e.addDisabled;return ee("div",{class:I.attachmentElementEmptyAction,key:`attachment-element-empty-action-${t}`},ee("calcite-button",{appearance:"outline",disabled:a,iconStart:"attachment",kind:"neutral",round:!0,scale:"s",onclick:()=>this._setAttachmentAddElementId(t)},this.messages.attachments.attach))}_renderAttachmentAddPage(){const e=this.viewModel.selectedAttachmentAddInput;return e?this._renderAttachmentAddPanel(e):null}_renderAttachmentAddPanel(e){const{maxAttachmentCount:t}=e,{elementId:a}=e.template,i=null==t||t-e.attachments.length>1,n=this.effectiveDisabled||e.addDisabled,l=this.messages.attachments,s=l.dragAndDropFile,o="upload",r=e=>{this._attachmentFileInputMap.set(a,e)};return ee("div",{class:I.attachmentElementAddPanel,key:`attachment-element-add-panel-${a}`},ee("input",{accept:e.accept,afterCreate:r,afterRemoved:()=>{this._attachmentFileInputMap.delete(a)},afterUpdate:r,class:I.attachmentElementFileInput,"data-element-id":a,disabled:n,multiple:i,type:"file",onchange:e=>{const t=e.currentTarget,i=t.files?Array.from(t.files):[];this._stageAttachmentFiles(a,i),t.value=""}}),ee("div",{class:I.attachmentElementAddDropzone,"data-disabled":n?"true":"false",ondragover:e=>{e.preventDefault()},ondrop:e=>{if(e.preventDefault(),n)return;const t=e.dataTransfer?.files?Array.from(e.dataTransfer.files):[];this._stageAttachmentFiles(a,t)}},ee("calcite-icon",{class:I.attachmentElementAddDropzoneIcon,icon:o,scale:"l"}),ee("div",{class:I.attachmentElementAddDropzoneHeading},l.addFile),ee("div",{class:I.attachmentElementAddDropzoneDetail,title:s},s),ee("calcite-button",{appearance:"outline-fill",disabled:n,iconStart:"folder-open",scale:"s",type:"button",onclick:e=>{e.stopPropagation(),this._openAttachmentFilePicker(a,n)}},l.selectFile)))}async _stageAttachmentFiles(e,t){if(0!==t.length)try{await this.viewModel.stageAddAttachments(e,t)}finally{this.viewModel.setSelectedAttachmentAddElementId(null)}}_openAttachmentFilePicker(e,t){t||this._attachmentFileInputMap.get(e)?.click()}_renderAttachmentDetailPage(){const e=this.selectedAttachmentDetails;if(!e)return;const{attachment:t,input:a}=e,i=g(t),n=!!a.getAttachmentPreviewUrl(t);return ee("div",{class:I.attachmentElementDetail,key:`attachment-detail-panel-${a.template.elementId}-${i}`},ee("div",{class:I.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,a)),ee("div",{class:I.attachmentElementDetailActions},ee("calcite-button",{appearance:"outline",disabled:!n,iconStart:"download-to",kind:"neutral",scale:"s",onclick:()=>{this._downloadAttachment(t)}},this.messages.attachments.download),f(t)?ee("calcite-button",{appearance:"outline",disabled:!n,iconStart:"expand",kind:"neutral",scale:"s",onclick:this._maximizeSelectedAttachment},this.messages.attachments.maximize):null,ee("calcite-button",{appearance:"outline",disabled:!0,iconStart:"refresh",kind:"neutral",scale:"s"},this.messages.attachments.replace)),ee("div",{class:I.attachmentElementDetailMetadata},ee("span",{class:I.attachmentElementDetailMetadataLabel},this.messages.attachments.fileName),ee("span",{class:I.attachmentElementDetailMetadataValue},t.name),ee("span",{class:I.attachmentElementDetailMetadataLabel},this.messages.attachments.size),ee("span",{class:I.attachmentElementDetailMetadataValue},this._formatAttachmentSize(t.size)),ee("span",{class:I.attachmentElementDetailMetadataLabel},this.messages.attachments.type),ee("span",{class:I.attachmentElementDetailMetadataValue},this._getLabelForAttachmentType(t))))}_renderAttachmentDialog(){const e=this._attachmentDialogInfo;if(!e)return null;const{attachment:t,input:a}=e;return ee("calcite-dialog",{heading:t.name||this.messagesCommon.details,key:"attachment-preview-dialog",modal:!0,open:!0,placement:"cover",width:"l",onCalciteDialogClose:this._closeAttachmentDialog},ee("div",{class:I.attachmentElementDetailPreview},this._renderAttachmentPreviewImageForInput(t,a)))}_setSelectedAttachment(e){this.viewModel.setSelectedAttachment(e),e||this.hideAttachmentDialog()}_setAttachmentAddElementId(e){this.viewModel.setSelectedAttachmentAddElementId(e),this.hideAttachmentDialog()}_setAttachmentListElementId(e){this.viewModel.setSelectedAttachmentListElementId(e),this.hideAttachmentDialog()}_getAttachmentLabel(e,a,i,n){return!1!==n&&u(e.name)&&e.name.length>0?e.name:i!==this.messagesCommon.notApplicable?i:t(this.messages.attachments.attachmentNumberedLabel,{index:a+1})}_formatAttachmentSize(e){return null==e||Number.isNaN(e)?this.messagesCommon.notApplicable:r(this.messagesUnits,e)}_getLabelForAttachmentType({contentType:e}){if(!e)return this.messagesCommon.notApplicable;const t=this.messages.attachments.attachmentTypes,a=h(e);return t?.[a]||e}_renderAttachmentPreviewThumbnail(e,t,a){const i=a.getAttachmentPreviewUrl(e,64);return i&&f(e)?ee("img",{alt:t,class:I.attachmentElementListItemThumb,src:i}):ee("calcite-icon",{class:I.attachmentElementListItemIcon,icon:v(e.contentType),scale:"s"})}_renderAttachmentPreviewImageForInput(e,t){const a=t.getAttachmentPreviewUrl(e),i=e.name||this.messagesCommon.details;return a&&f(e)?ee("img",{alt:i,class:I.attachmentElementDetailPreviewImage,src:a,title:i}):[ee("calcite-icon",{class:I.attachmentElementDetailPreviewIcon,icon:v(e.contentType),scale:"l",textLabel:i,title:i}),this.messages.attachments.noPreviewAvailable]}async _downloadAttachment(e){await R(e)}hideAttachmentDialog(){this._attachmentDialogInfo=null}_renderTextComponent(e){const{elementId:t}=e.template;return ee("div",{class:I.textElementInput,"data-testid":`text-element-${t}`,innerHTML:e.text,key:`text-element-${t}`})}_renderUtilityNetworkAssociationsElementInput(e){const{elementId:t}=e.template;return ee("div",{class:I.utilityNetworkAssociationsElementInput,"data-testid":t,key:t})}getCommonInputProps(e){const{template:t,valid:a,value:i,minLength:n,maxLength:l,required:s,fieldName:o,editable:r,userHasChangedValue:c,range:{max:d,min:m}}=e,u=!r||this.readOnly,p=!u&&this.effectiveDisabled;let h=t.hint??void 0,v=!1;return i===T&&(h=this.messages.differentValuesPlaceholder,v=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":a?"false":"true",class:this.classes(I.fieldInput,u?I.inputDisabled:null),status:!c&&!this.viewModel.submitHasBeenAttempted||a?"idle":"invalid",maxLength:l&&l>-1?l:void 0,minLength:n&&n>-1?n:void 0,key:t.elementId,label:o,name:o,max:null!=d?d:void 0,min:null!=m?m:void 0,disabled:p,readOnly:u,onblur:this._onComponentBlur,required:s,placeholder:h,value:v?"":i??"",[ie]:t.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(ie))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,a=e.querySelector("calcite-radio-button"),i=t||a;i&&this._afterComponentCreateOrUpdate(i)}_onComponentFocus(e){const t=e.target,a=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(a.template.elementId),this._focusedFieldInput=a}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),a=this._focusedFieldInput;this._attemptFocusOnNextRender&&a===t&&(this._attemptFocusOnNextRender=!1,te(e))}_onComponentBlur(){this._focusedFieldInput=null}_resetTransientFormState(){this._attemptFocusOnNextRender=!1,this._focusedFieldInput=null,this._attachmentDialogInfo=null,this._attachmentListFilterText="",this._attachmentFileInputMap.clear()}_parseValue(e,t,a=!1){const i=t.multipleChoiceInput,n=t.multipleChoiceValues;if(i&&n){const l=i.choiceDelimiter,s=e;if(a){return N({input:t}).checked?null:n.length>0?n.join(l):null}const o=$(t.value,l).filter(e=>e!==T),r=new Set(o);s.checked?r.add(s.value):r.delete(s.value);const c=n.filter(e=>r.has(e));return c.length?c.join(l):null}if(_(t.template,"switch")){if("calcite-dropdown"===e.localName&&t.domain)for(const a of t.domain.codedValues)if(a.name===e.selectedItems[0].textContent)return a.code;return e.checked?t.template.input.onValue:t.template.input.offValue}const l=e.value;return null==l||""===l?null:"number"===t.dataType?"-0"===l||"-0."===l||"-0,"===l?l:parseFloat(l):"date"===t.field.type?parseFloat(l):l}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:a}=t.template;if(!t)return;const i=t?.value;if(_(t.template,"switch")&&"single"!==this.viewModel.mode){const e=n(this._batchSwitchInputInitialValues,t,()=>t.value);this._batchSwitchInputInitialValues.set(t,null===e?i:e)}const l=this._parseValue(e,t);l!==i&&this.viewModel.setValue(a,l)}_afterDateComponentCreate(e){this._setDateTimeTimeZoneMap(e),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:a}=e.template,i=e.field.type,n=this._dateComponentMap.get(`${a}`);if(!n)return;const l=e.effectiveTimeZone;let s=e.value===T?void 0:e.value,o=null;"date-only"===i?o=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===i?(s=W(s),o=W(t.value)):o="timestamp-offset"===i?null!=t.value?G({dateComponent:n.date,timeComponent:n.time,oldValue:s,timeZoneComponent:n.timeZone,defaultTimeZone:l}):null:null!=t.value?K({oldValue:s,dateComponent:n.date,timeZone:l,timeComponent:n.time?.value===T?void 0:n.time}):null,s!==o&&(null!==o&&t.value?this.viewModel.setValue(`${a}`,o):this.viewModel.setValue(`${a}`,null))}};e([c()],se.prototype,"activeFeatureIndex",null),e([c()],se.prototype,"disabled",null),e([c()],se.prototype,"effectiveTitle",null),e([c()],se.prototype,"effectiveDisabled",null),e([c()],se.prototype,"features",null),e([c()],se.prototype,"footerButtonInfos",null),e([c()],se.prototype,"footerNoticeInfos",null),e([c()],se.prototype,"map",null),e([c()],se.prototype,"maximumFeatureCount",null),e([c()],se.prototype,"maximumFeatureCountWithComplexForms",null),e([c()],se.prototype,"spatialReference",null),e([c()],se.prototype,"layerInfos",null),e([c()],se.prototype,"timeZone",null),e([c()],se.prototype,"headingLevel",void 0),e([c()],se.prototype,"icon",null),e([c(),X("esri/t9n/common")],se.prototype,"messagesCommon",void 0),e([c(),X("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],se.prototype,"messages",void 0),e([c(),X("esri/core/t9n/Units")],se.prototype,"messagesUnits",void 0),e([c()],se.prototype,"page",null),e([c()],se.prototype,"readOnly",null),e([c()],se.prototype,"selectedAttachment",null),e([c()],se.prototype,"selectedAttachmentDetails",null),e([c()],se.prototype,"valid",null),e([c({type:y}),Y(["value-change","submit"])],se.prototype,"viewModel",void 0),e([c({type:k,nonNullable:!0})],se.prototype,"visibleElements",void 0),e([c()],se.prototype,"groupDisplay",void 0),e([c()],se.prototype,"_attemptFocusOnNextRender",void 0),e([c()],se.prototype,"_formId",null),e([c()],se.prototype,"_focusedFieldInput",void 0),e([c()],se.prototype,"_attachmentDialogInfo",void 0),e([c()],se.prototype,"_attachmentListFilterText",void 0),se=e([d("esri.widgets.BatchAttributeForm")],se);const oe=se;export{oe as default};
|
package/widgets/Bookmarks.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import{deprecateWidget as o}from"../core/deprecate.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import r from"../core/Logger.js";import{property as a,subclass as s}from"../core/accessorSupport/decorators.js";import{formatDate as n,convertDateFormatToIntlOptions as l}from"../intl/date.js";import{system as d}from"../time/constants.js";import m from"../webdoc/support/SlideThumbnail.js";import c from"./Widget.js";import u from"./Bookmarks/BookmarksUserState.js";import k from"./Bookmarks/BookmarksViewModel.js";import h from"./Bookmarks/BookmarksVisibleElements.js";import{css as p}from"./Bookmarks/css.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as _}from"./support/globalCss.js";import{Heading as g}from"./support/Heading.js";import{calciteListFilterProps as f}from"./support/listUtils.js";import{tsx as v,messageBundle as B,vmEvent as w}from"./support/widget.js";import{setFocus as E}from"./support/widgetUtils.js";let I=class extends(i(c)){constructor(e,t){super(e,t),this._addInputNode=null,this._editInputNode=null,this._urlEditInputNode=null,this._lastDragDetail=null,this._selectedDragBookmarkUid=null,this._editIncludeTimeExtent=void 0,this._userState=null,this._focusRootFlowItem=!1,this._focusAddFlowItem=!1,this._focusEditFlowItem=!1,this.disabled=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.viewModel=new k({suppressDeprecationWarning:!0}),this.visibleElements=new h,this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t,bookmarks:o}=this,{toEl:i,fromEl:r,dragEl:a,newIndex:s}=e;if(!o.length)return;if(!r||!i||t?.newIndex===s&&t?.dragEl===a&&t?.toEl===i&&t?.fromEl===r)return;this._lastDragDetail=e;const n=Array.from(r.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);o.sort((e,t)=>{const o=n.indexOf(e.uid),i=n.indexOf(t.uid);return o>i?1:o<i?-1:0}),this._selectedDragBookmarkUid=a.value},o(r.getLogger(this),"Bookmarks","arcgis-bookmarks",{version:"4.34"})}loadDependencies(){return b({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),"chip-group":()=>import("@esri/calcite-components/dist/components/calcite-chip-group"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),table:()=>import("@esri/calcite-components/dist/components/calcite-table"),"table-cell":()=>import("@esri/calcite-components/dist/components/calcite-table-cell"),"table-header":()=>import("@esri/calcite-components/dist/components/calcite-table-header"),"table-row":()=>import("@esri/calcite-components/dist/components/calcite-table-row")})}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(e){this.viewModel.defaultCreateOptions=e}get defaultEditOptions(){return this.viewModel.defaultEditOptions}set defaultEditOptions(e){this.viewModel.defaultEditOptions=e}get bookmarks(){return this.viewModel.bookmarks}set bookmarks(e){this.viewModel.bookmarks=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"bookmark"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}endAddBookmark(){this._userState=null}goTo(e){return this.viewModel.goTo(e)}render(){return v("div",{class:this.classes(p.base,_.widget,_.panel)},this._renderBookmarksContainer())}startAddBookmark(){this._userState=new u({state:"add"}),this._focusAddFlowItem=!0}_renderNoBookmarksContainer(e){const{messages:t,viewModel:{state:o}}=this;return e.length||"loading"===o?null:v("div",{class:_.empty,key:"no-bookmarks"},v("calcite-icon",{icon:"bookmark",scale:"l"}),v(g,{class:this.classes(_.heading,p.noBookmarksHeader),level:this.headingLevel},t?.noBookmarksHeading),v("p",{class:p.noBookmarksDescription},t.noBookmarksDescription))}_renderEditBookmarkFlowItems(){const{_userState:e}=this,t=e?.editedBookmark;return t&&"edit"===e?.state?this._renderEditingBookmark(t):[]}_renderBookmarkItems(e){return e?e.toArray().map(e=>this._renderBookmark(e)):[]}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:o,oldIndex:i}=e;t.insertBefore(o,t.children[i])}_renderBookmarksContainer(){const{viewModel:{state:e,bookmarks:o},dragEnabled:i,messages:r,disabled:a,filterPlaceholder:s,filterText:n,visible:l,headingLevel:d,visibleElements:{closeButton:m,collapseButton:c,filter:u,heading:k,flow:h},uid:b}=this,_=o.filter(t),g=_.length?v("calcite-list",{class:p.list,displayMode:"flat",dragEnabled:i,filterEnabled:u,filterPlaceholder:s,filterProps:f,filterText:n,group:`bookmarks-${b}`,key:"bookmark-list",label:r.widgetLabel,selectionAppearance:"border",selectionMode:"none",onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},this._renderBookmarkItems(_),u?v("div",{class:p.filterNoResults,slot:"filter-no-results"},v("calcite-notice",{kind:"info",open:!0,width:"full"},v("div",{slot:"message"},r.noBookmarksHeading),";")):null):null,B=[v("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:m,closed:!l,collapsible:c,disabled:a,heading:k?r.widgetLabel:void 0,headingLevel:d,loading:"loading"===e,selected:!this._userState?.state,onCalciteFlowItemClose:()=>this.visible=!1},this._renderNoBookmarksContainer(_),g,this._renderAddBookmarkButton()),this._renderAddingBookmark(),this._renderEditBookmarkFlowItems()];return l?h?v("calcite-flow",{key:"root-flow"},B):B:null}_renderAddBookmarkButton(){const{messages:e,_userState:t,disabled:o,viewModel:{view:i,state:r},visibleElements:{addBookmarkButton:a}}=this,s=t?.loading??!1;return i&&"loading"!==r&&a?v("calcite-fab",{appearance:"outline-fill",bind:this,class:p.addBookmarkButton,disabled:o||s,icon:"plus",key:"add-bookmark-item",kind:"neutral",loading:s,onclick:this.startAddBookmark,slot:"fab",text:e.addBookmark,textEnabled:!0,title:e.addBookmark,type:"button"}):null}_renderEditContainer(e){const{messagesCommon:t,visibleElements:{editBookmarkButton:o}}=this,i=`${t.edit} ${this._getBookmarkTitle(e)}`;return o?v("calcite-action",{icon:"pencil",key:"edit-action",onclick:()=>this._showEditBookmarkForm(e),slot:"actions-end",text:i,title:i}):null}_renderBookmarkImage(e,t){return t?v("img",{alt:"",class:p.bookmarkImage,key:"bookmark-image",src:e.thumbnail?.url}):null}_renderBookmarkTimeSwitch(e){const{messages:t,viewModel:{view:o}}=this,{timeExtent:i}=e;return o?.timeExtent??i?v("calcite-label",{layout:"inline-space-between"},t.includeTimeExtent,v("calcite-switch",{checked:!!i,onCalciteSwitchChange:e=>{this._editIncludeTimeExtent=!!e.currentTarget.checked}})):null}_renderEditBookmarkTimeExtent(e){return this._editIncludeTimeExtent?this._renderBookmarkTimeExtent(e):null}_getTimeExtentStrings(e){const{visibleElements:t}=this,{timeExtent:o}=e;if(!o)return{};const{start:i,end:r}=o,a=null!=r&&(null==i||i.getTime()!==r.getTime()),s=i?this._formatDate(i):"",n=i&&t.time?this._formatTime(i):"";if(!a)return{startDate:s,startTime:n};return{startDate:s,startTime:n,endDate:this._formatDate(r),endTime:t.time?this._formatTime(r):""}}_renderTimeExtentDescription(e){const{startDate:t,startTime:o,endDate:i,endTime:r}=this._getTimeExtentStrings(e);if(!t)return"";const a=`${t} ${o}`;return i?`${a} - ${`${i} ${r}`}`:a}_renderBookmarkTimeExtent(e,t=!1){const{messages:o}=this,{startDate:i,startTime:r,endDate:a,endTime:s}=this._getTimeExtentStrings(e),n=t?null:v("calcite-table-row",{slot:"table-header"},v("calcite-table-header",{heading:o.startDate}),a?v("calcite-table-header",{heading:o.endDate}):null);return i?v("calcite-table",{caption:o.timeExtent,scale:"s"},n,v("calcite-table-row",null,v("calcite-table-cell",null,i," ",r?[v("br",null),r]:null),a?v("calcite-table-cell",null,a,s?[v("br",null),s]:null):null)):null}_renderBookmarkActiveScrim(e,t){return this.viewModel.activeBookmark===e&&t?v("calcite-scrim",{key:"bookmark-active-scrim",loading:!0}):null}_renderBookmarkActiveLoader(e,t){return this.viewModel.activeBookmark!==e||t?null:v("calcite-loader",{class:p.loader,inline:!0,key:"bookmark-active-loader",label:this.messagesCommon.loading})}_renderBookmarkImageIcon(e,t){return this.viewModel.activeBookmark===e||t?null:v("calcite-icon",{icon:"bookmark",key:"bookmark-icon",scale:"s"})}_renderBookmarkThumbnail(e){const t=this.visibleElements.thumbnail&&!!e.thumbnail?.url;return v("div",{class:p.bookmarkImageContainer,slot:"content-start"},this._renderBookmarkActiveScrim(e,t),this._renderBookmarkImage(e,t),this._renderBookmarkActiveLoader(e,t),this._renderBookmarkImageIcon(e,t))}_focusSelectedDragEl(e,t){this._selectedDragBookmarkUid===t.uid&&(E(e),this._selectedDragBookmarkUid=null)}_renderBookmark(e){return v("calcite-list-item",{afterCreate:t=>this._focusSelectedDragEl(t,e),afterUpdate:t=>this._focusSelectedDragEl(t,e),class:this.classes({[p.dragEnabled]:this.dragEnabled}),description:this._renderTimeExtentDescription(e),key:e.uid,label:this._getBookmarkTitle(e),value:e.uid,onCalciteListItemSelect:()=>this._goToBookmark(e)},this._renderBookmarkThumbnail(e),this._renderBookmarkContent(e),this._renderEditContainer(e))}_renderBookmarkContent(e){return v("div",{class:p.bookmarkContent,slot:"content"},v("span",{class:p.bookmarkContentLabel},this._getBookmarkTitle(e)),this._renderBookmarkTimeExtent(e,!0))}_renderEditingBookmarkName(e){const{messages:t,_userState:o}=this,i="name-required"===o?.validationState;return v("calcite-label",null,t.title,v("calcite-input",{afterCreate:this._storeEditInput,bind:this,class:p.editBookmarkInput,name:"bookmark-name",placeholder:t.titlePlaceholder,required:!0,type:"text",value:e.name}),i?v("calcite-input-message",{icon:"exclamation-mark-triangle",status:"invalid"},t.invalidTitle):null)}_renderEditingBookmarkActions(){const{messagesCommon:e,_userState:t}=this,o=t?.bookmark;return[v("calcite-button",{appearance:"transparent",kind:"danger",onclick:()=>this._deleteBookmark(o),slot:"footer",type:"button",width:"full"},e.delete),v("calcite-button",{appearance:"outline",bind:this,onclick:this._closeEditBookmarkForm,slot:"footer",type:"button",width:"full"},e.cancel),v("calcite-button",{slot:"footer",type:"submit",width:"full"},e.save)]}_handleUrlEditInputChange(){const{_userState:e,_urlEditInputNode:t}=this,o=t?.value;if(!e?.editedBookmark||!o)return;e.validationState=void 0,e.editedBookmark.thumbnail?.isDataURI&&(e.screenshotUrl=e.editedBookmark.thumbnail?.url);const i=new m({url:o});i.isSecureUrl&&(e.customUrl=o,e.editedBookmark.thumbnail=i)}_renderEditingTimeExtent(e){const{capabilities:t,view:o}=this.viewModel,{timeExtent:i}=e;return t.time&&(o?.timeExtent??i)?v("div",{key:"edit-bookmark-time-container"},this._renderBookmarkTimeSwitch(e),this._renderEditBookmarkTimeExtent(e)):null}_renderEditingBookmarkImage(e){const{_userState:t}=this,o=t?.thumbnailState,i=e.thumbnail?.isSecureUrl?"url"===o:e.thumbnail?.isDataURI?"screenshot"===o:null;if(i)return this._renderBookmarkImage(e,i)}_renderEditingThumbnail(e){const{_userState:t,visibleElements:o}=this,i=t?.thumbnailState;return o.thumbnail&&"none"!==i?v("div",{class:p.authoringImageContainer},this._renderEditingBookmarkImage(e)):null}_renderUpdateThumbnailButton(){const{visibleElements:e,messages:t,_userState:o}=this,i=o?.thumbnailState;return e.thumbnail&&"screenshot"===i?v("calcite-button",{appearance:"outline",class:p.authoringRefreshThumbnailButton,iconStart:"refresh",key:"update-thumbnail",kind:"neutral",onclick:()=>{this._updateThumbnail()},width:"full"},t.updateThumbnail):null}_renderEditingBookmarkUrlInput(e){const{messages:t,_userState:o}=this,i=e.thumbnail?.url,r=e.thumbnail?.isSecureUrl?i:void 0,a=i&&"absolute-url-required"===o?.validationState,s=o?.thumbnailState;return"url"===s?v("calcite-label",{key:"thumbnail-url-input"},v("calcite-input",{afterCreate:this._storeUrlEditInput,bind:this,name:"bookmark-thumbnail-url",pattern:"https://.*",placeholder:t?`https://<${t.imageUrlPlaceholder}>`:void 0,required:!0,title:t.imageUrlTooltip,type:"text",value:r,onCalciteInputChange:this._handleUrlEditInputChange,onCalciteInputInput:this._handleUrlEditInputChange}),a?v("calcite-input-message",{icon:"exclamation-mark-triangle",status:"invalid"},t.invalidImageUrl):null):null}_renderThumbnailSelector(){const{visibleElements:e,messages:t,_userState:o}=this,i=o?.thumbnailState;return e.thumbnail?v("calcite-label",{key:"thumbnail-chip-group"},t.thumbnail,v("calcite-chip-group",{label:t.thumbnail,selectionMode:"single-persist",onCalciteChipGroupSelect:e=>this._handleThumbnailTypeSelect(e.currentTarget.selectedItems[0].value)},v("calcite-chip",{label:t.screenshot,selected:"screenshot"===i,value:"screenshot"},t.screenshot),v("calcite-chip",{label:t.url,selected:"url"===i,value:"url"},t.url),v("calcite-chip",{label:t.none,selected:"none"===i,value:"none"},t.none))):null}_renderEditingBookmark(e){const{disabled:t,messagesCommon:o,headingLevel:i}=this;return e?v("form",{bind:this,class:p.form,disabled:this.disabled,onsubmit:this._editBookmarkSubmit},v("calcite-flow-item",{afterCreate:this._focusEditFlowItemNode,afterUpdate:this._focusEditFlowItemNode,bind:this,disabled:t,heading:o.edit,headingLevel:i,key:"edit-bookmark-form",selected:"edit"===this._userState?.state,onCalciteFlowItemBack:e=>{e.preventDefault(),this._closeEditBookmarkForm()}},v("div",{class:p.formContent},v("div",{class:p.authoring},this._renderEditingBookmarkName(e),this._renderThumbnailSelector(),this._renderEditingThumbnail(e),this._renderEditingBookmarkUrlInput(e),this._renderUpdateThumbnailButton(),this._renderEditingTimeExtent(e))),this._renderEditingBookmarkActions())):null}_renderAddingBookmarkName(){const{_userState:e,messages:t}=this,o="name-required"===e?.validationState;return v("calcite-label",null,t.title,v("calcite-input",{afterCreate:this._storeAddInput,bind:this,class:p.addBookmarkInput,name:"bookmark-name",placeholder:t.titlePlaceholder,required:!0,type:"text",value:""}),o?v("calcite-input-message",{icon:"exclamation-mark-triangle",status:"invalid"},t.invalidTitle):null)}_renderAddingBookmarkActions(){const{messagesCommon:e}=this;return[v("calcite-button",{appearance:"outline",bind:this,onclick:this._endAddBookmark,slot:"footer",type:"button",width:"full"},e.cancel),v("calcite-button",{slot:"footer",type:"submit",width:"full"},e.add)]}_renderAddingBookmark(){const{disabled:e,messages:t,headingLevel:o,_userState:i}=this;return"add"===i?.state?v("form",{bind:this,class:p.form,disabled:e,onsubmit:this._addBookmarkSubmitClick},v("calcite-flow-item",{afterCreate:this._focusAddFlowItemNode,afterUpdate:this._focusAddFlowItemNode,bind:this,disabled:e,heading:t.addBookmark,headingLevel:o,key:"add-bookmark-form",selected:"add"===this._userState?.state,onCalciteFlowItemBack:e=>{e.preventDefault(),this._endAddBookmark()}},v("div",{class:p.formContent},this._renderAddingBookmarkName()),this._renderAddingBookmarkActions())):null}_getBookmarkTitle(e){return e?.name||this.messagesCommon.untitled}_formatDate(e){return e?n(e,{...l("short-date"),timeZone:this.viewModel.view?.timeZone??d}):""}_formatTime(e){return e?n(e,{...l("long-time"),timeZone:this.viewModel.view?.timeZone??d}):""}_endAddBookmark(){this.endAddBookmark(),this._focusRootFlowItem=!0}_showEditBookmarkForm(e){e&&(this._editIncludeTimeExtent=!!e.timeExtent,this._userState=new u({bookmark:e,state:"edit"}),this._focusEditFlowItem=!0,this.viewModel.goTo(e))}async _createNewScreenshotUrl(){const e=await this.viewModel.createBookmark();return e.thumbnail?.url??null}_storeCurrentUrl(){const{_userState:e}=this,t=e?.editedBookmark?.thumbnail?.url;t&&(e?.editedBookmark?.thumbnail?.isSecureUrl?e.customUrl=t:e?.editedBookmark?.thumbnail?.isDataURI&&(e.screenshotUrl=t))}async _handleThumbnailTypeSelect(e){const{_userState:t}=this;if(!t)return;const{screenshotUrl:o,customUrl:i,editedBookmark:r}=t,a="screenshot"===e?o??await this._createNewScreenshotUrl():"url"===e&&i?i:null;this._storeCurrentUrl(),r&&a&&(r.thumbnail=new m({url:a})),t.validationState=void 0,t.thumbnailState=e}_closeEditBookmarkForm(){this._userState=null,this._focusRootFlowItem=!0}_addBookmarkSubmitClick(e){e.preventDefault(),this._addBookmarkSubmit()}async _addBookmarkSubmit(){const{_addInputNode:e,_userState:t,viewModel:o,viewModel:{bookmarks:i}}=this;if(!t)return;const r=e?e.value.trim():null;if(!r)return void(t.validationState="name-required");t.loading=!0;const a=await o.createBookmark();a.name=r,i.add(a),this._endAddBookmark()}async _editBookmarkAndClose(e,t){const{viewModel:o,viewModel:{defaultEditOptions:i}}=this;await o.editBookmark(e,{...i,...t}),this._closeEditBookmarkForm()}_editBookmarkSubmit(e){e.preventDefault();const{_editInputNode:t,_userState:o,_editIncludeTimeExtent:i,_urlEditInputNode:r}=this;if(!o?.bookmark||!o.editedBookmark)return;o.validationState=void 0,o.customUrl=void 0,o.screenshotUrl=void 0;const a=t?.value.trim();if(!a)return void(o.validationState="name-required");o.bookmark.name=a,o.bookmark.thumbnail=o.editedBookmark.thumbnail,i||(o.bookmark.timeExtent=null);const s=o.thumbnailState;if("url"===s&&r){const e=r.value,t=new m({url:e});if(!t.isSecureUrl)return void(o.validationState="absolute-url-required");o.bookmark.thumbnail=t}else"none"===s&&(o.bookmark.thumbnail=null);this._editBookmarkAndClose(o.bookmark,{takeScreenshot:!1,captureTimeExtent:i})}_storeEditInput(e){this._editInputNode=e}_storeAddInput(e){this._addInputNode=e}_storeUrlEditInput(e){this._urlEditInputNode=e}_deleteBookmark(e){this._closeEditBookmarkForm(),e&&(this.viewModel.bookmarks.remove(e),e.destroy())}_goToBookmark(e){this.endAddBookmark(),this.viewModel.goTo(e)}async _updateThumbnail(){const{_userState:e,viewModel:t}=this;e&&(e.validationState=void 0,await t.editBookmark(e.editedBookmark,{takeScreenshot:!0,captureViewpoint:!1,captureRotation:!1,captureScale:!1,captureTimeExtent:!1}))}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,E(e))}_focusEditFlowItemNode(e){this._focusEditFlowItem&&(this._focusEditFlowItem=!1,E(e))}_focusAddFlowItemNode(e){this._focusAddFlowItem&&(this._focusAddFlowItem=!1,E(e))}};e([a()],I.prototype,"_editIncludeTimeExtent",void 0),e([a({type:u})],I.prototype,"_userState",void 0),e([a()],I.prototype,"_focusRootFlowItem",void 0),e([a()],I.prototype,"_focusAddFlowItem",void 0),e([a()],I.prototype,"_focusEditFlowItem",void 0),e([a()],I.prototype,"defaultCreateOptions",null),e([a()],I.prototype,"defaultEditOptions",null),e([a()],I.prototype,"bookmarks",null),e([a()],I.prototype,"disabled",void 0),e([a()],I.prototype,"dragEnabled",void 0),e([a()],I.prototype,"filterPlaceholder",void 0),e([a()],I.prototype,"filterText",void 0),e([a()],I.prototype,"headingLevel",void 0),e([a()],I.prototype,"goToOverride",null),e([a()],I.prototype,"icon",null),e([a()],I.prototype,"label",null),e([a(),B("esri/widgets/Bookmarks/t9n/Bookmarks")],I.prototype,"messages",void 0),e([a(),B("esri/t9n/common")],I.prototype,"messagesCommon",void 0),e([a()],I.prototype,"uiStrings",void 0),e([a()],I.prototype,"view",null),e([a({type:k}),w(["select-bookmark","bookmark-edit","bookmark-select"])],I.prototype,"viewModel",void 0),e([a({type:h,nonNullable:!0})],I.prototype,"visibleElements",void 0),e([a()],I.prototype,"endAddBookmark",null),e([a()],I.prototype,"startAddBookmark",null),I=e([s("esri.widgets.Bookmarks")],I);const S=I;export{S as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import{deprecateWidget as o}from"../core/deprecate.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import r from"../core/Logger.js";import{property as a,subclass as s}from"../core/accessorSupport/decorators.js";import{formatDate as n,convertDateFormatToIntlOptions as l}from"../intl/date.js";import{system as d}from"../time/constants.js";import m from"../webdoc/support/SlideThumbnail.js";import c from"./Widget.js";import u from"./Bookmarks/BookmarksUserState.js";import k from"./Bookmarks/BookmarksViewModel.js";import h from"./Bookmarks/BookmarksVisibleElements.js";import{css as p}from"./Bookmarks/css.js";import{loadCalciteComponents as b}from"./support/componentsUtils.js";import{globalCss as _}from"./support/globalCss.js";import{Heading as g}from"./support/Heading.js";import{calciteListFilterProps as f}from"./support/listUtils.js";import{tsx as v,messageBundle as B,vmEvent as w}from"./support/widget.js";import{setFocus as E}from"./support/widgetUtils.js";let I=class extends(i(c)){constructor(e,t){super(e,t),this._addInputNode=null,this._editInputNode=null,this._urlEditInputNode=null,this._lastDragDetail=null,this._selectedDragBookmarkUid=null,this._editIncludeTimeExtent=void 0,this._userState=null,this._focusRootFlowItem=!1,this._focusAddFlowItem=!1,this._focusEditFlowItem=!1,this.disabled=!1,this.dragEnabled=!1,this.filterPlaceholder="",this.filterText="",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.viewModel=new k({suppressDeprecationWarning:!0}),this.visibleElements=new h,this._onCalciteListOrderChange=e=>{const{_lastDragDetail:t,bookmarks:o}=this,{toEl:i,fromEl:r,dragEl:a,newIndex:s}=e;if(!o.length)return;if(!r||!i||t?.newIndex===s&&t?.dragEl===a&&t?.toEl===i&&t?.fromEl===r)return;this._lastDragDetail=e;const n=Array.from(r.children).filter(e=>e?.matches("calcite-list-item")).map(e=>e.value);o.sort((e,t)=>{const o=n.indexOf(e.uid),i=n.indexOf(t.uid);return o>i?1:o<i?-1:0}),this._selectedDragBookmarkUid=a.value},o(r.getLogger(this),"Bookmarks","arcgis-bookmarks",{version:"4.34"})}loadDependencies(){return b({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),"chip-group":()=>import("@esri/calcite-components/dist/components/calcite-chip-group"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),fab:()=>import("@esri/calcite-components/dist/components/calcite-fab"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),scrim:()=>import("@esri/calcite-components/dist/components/calcite-scrim"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),table:()=>import("@esri/calcite-components/dist/components/calcite-table"),"table-cell":()=>import("@esri/calcite-components/dist/components/calcite-table-cell"),"table-header":()=>import("@esri/calcite-components/dist/components/calcite-table-header"),"table-row":()=>import("@esri/calcite-components/dist/components/calcite-table-row")})}get defaultCreateOptions(){return this.viewModel.defaultCreateOptions}set defaultCreateOptions(e){this.viewModel.defaultCreateOptions=e}get defaultEditOptions(){return this.viewModel.defaultEditOptions}set defaultEditOptions(e){this.viewModel.defaultEditOptions=e}get bookmarks(){return this.viewModel.bookmarks}set bookmarks(e){this.viewModel.bookmarks=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"bookmark"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}endAddBookmark(){this._userState=null}goTo(e){return this.viewModel.goTo(e)}render(){return v("div",{class:this.classes(p.base,_.widget,_.panel)},this._renderBookmarksContainer())}startAddBookmark(){this._userState=new u({state:"add"}),this._focusAddFlowItem=!0}_renderNoBookmarksContainer(e){const{messages:t,viewModel:{state:o}}=this;return e.length||"loading"===o?null:v("div",{class:_.empty,key:"no-bookmarks"},v("calcite-icon",{icon:"bookmark",scale:"l"}),v(g,{class:this.classes(_.heading,p.noBookmarksHeader),level:this.headingLevel},t?.noBookmarksHeading),v("p",{class:p.noBookmarksDescription},t.noBookmarksDescription))}_renderEditBookmarkFlowItems(){const{_userState:e}=this,t=e?.editedBookmark;return t&&"edit"===e?.state?this._renderEditingBookmark(t):[]}_renderBookmarkItems(e){return e?e.toArray().map(e=>this._renderBookmark(e)):[]}_handleCalciteListDragEnd(e){const{fromEl:t,dragEl:o,oldIndex:i}=e;t.insertBefore(o,t.children[i])}_renderBookmarksContainer(){const{viewModel:{state:e,bookmarks:o},dragEnabled:i,messages:r,disabled:a,filterPlaceholder:s,filterText:n,visible:l,headingLevel:d,visibleElements:{closeButton:m,collapseButton:c,filter:u,heading:k,flow:h},uid:b}=this,_=o.filter(t),g=_.length?v("calcite-list",{class:p.list,displayMode:"flat",dragEnabled:i,filterEnabled:u,filterPlaceholder:s,filterProps:f,filterText:n,group:`bookmarks-${b}`,key:"bookmark-list",label:r.widgetLabel,selectionAppearance:"border",selectionMode:"none",onCalciteListDragEnd:e=>this._handleCalciteListDragEnd(e.detail),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onCalciteListOrderChange:e=>this._onCalciteListOrderChange(e.detail)},this._renderBookmarkItems(_),u?v("div",{class:p.filterNoResults,slot:"filter-no-results"},v("calcite-notice",{kind:"info",open:!0,width:"full"},v("div",{slot:"message"},r.noBookmarksHeading),";")):null):null,B=[v("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:m,closed:!l,collapsible:c,disabled:a,heading:k?r.widgetLabel:void 0,headingLevel:d,loading:"loading"===e,selected:!this._userState?.state,onCalciteFlowItemClose:()=>this.visible=!1},this._renderNoBookmarksContainer(_),g,this._renderAddBookmarkButton()),this._renderAddingBookmark(),this._renderEditBookmarkFlowItems()];return l?h?v("calcite-flow",{key:"root-flow"},B):B:null}_renderAddBookmarkButton(){const{messages:e,_userState:t,disabled:o,viewModel:{view:i,state:r},visibleElements:{addBookmarkButton:a}}=this,s=t?.loading??!1;return i&&"loading"!==r&&a?v("calcite-fab",{appearance:"outline-fill",bind:this,class:p.addBookmarkButton,disabled:o||s,icon:"plus",key:"add-bookmark-item",kind:"neutral",loading:s,slot:"fab",text:e.addBookmark,textEnabled:!0,title:e.addBookmark,type:"button",onclick:this.startAddBookmark}):null}_renderEditContainer(e){const{messagesCommon:t,visibleElements:{editBookmarkButton:o}}=this,i=`${t.edit} ${this._getBookmarkTitle(e)}`;return o?v("calcite-action",{icon:"pencil",key:"edit-action",slot:"actions-end",text:i,title:i,onclick:()=>this._showEditBookmarkForm(e)}):null}_renderBookmarkImage(e,t){return t?v("img",{alt:"",class:p.bookmarkImage,key:"bookmark-image",src:e.thumbnail?.url}):null}_renderBookmarkTimeSwitch(e){const{messages:t,viewModel:{view:o}}=this,{timeExtent:i}=e;return o?.timeExtent??i?v("calcite-label",{layout:"inline-space-between"},t.includeTimeExtent,v("calcite-switch",{checked:!!i,onCalciteSwitchChange:e=>{this._editIncludeTimeExtent=!!e.currentTarget.checked}})):null}_renderEditBookmarkTimeExtent(e){return this._editIncludeTimeExtent?this._renderBookmarkTimeExtent(e):null}_getTimeExtentStrings(e){const{visibleElements:t}=this,{timeExtent:o}=e;if(!o)return{};const{start:i,end:r}=o,a=null!=r&&(null==i||i.getTime()!==r.getTime()),s=i?this._formatDate(i):"",n=i&&t.time?this._formatTime(i):"";if(!a)return{startDate:s,startTime:n};return{startDate:s,startTime:n,endDate:this._formatDate(r),endTime:t.time?this._formatTime(r):""}}_renderTimeExtentDescription(e){const{startDate:t,startTime:o,endDate:i,endTime:r}=this._getTimeExtentStrings(e);if(!t)return"";const a=`${t} ${o}`;return i?`${a} - ${`${i} ${r}`}`:a}_renderBookmarkTimeExtent(e,t=!1){const{messages:o}=this,{startDate:i,startTime:r,endDate:a,endTime:s}=this._getTimeExtentStrings(e),n=t?null:v("calcite-table-row",{slot:"table-header"},v("calcite-table-header",{heading:o.startDate}),a?v("calcite-table-header",{heading:o.endDate}):null);return i?v("calcite-table",{caption:o.timeExtent,scale:"s"},n,v("calcite-table-row",null,v("calcite-table-cell",null,i," ",r?[v("br",null),r]:null),a?v("calcite-table-cell",null,a,s?[v("br",null),s]:null):null)):null}_renderBookmarkActiveScrim(e,t){return this.viewModel.activeBookmark===e&&t?v("calcite-scrim",{key:"bookmark-active-scrim",loading:!0}):null}_renderBookmarkActiveLoader(e,t){return this.viewModel.activeBookmark!==e||t?null:v("calcite-loader",{class:p.loader,inline:!0,key:"bookmark-active-loader",label:this.messagesCommon.loading})}_renderBookmarkImageIcon(e,t){return this.viewModel.activeBookmark===e||t?null:v("calcite-icon",{icon:"bookmark",key:"bookmark-icon",scale:"s"})}_renderBookmarkThumbnail(e){const t=this.visibleElements.thumbnail&&!!e.thumbnail?.url;return v("div",{class:p.bookmarkImageContainer,slot:"content-start"},this._renderBookmarkActiveScrim(e,t),this._renderBookmarkImage(e,t),this._renderBookmarkActiveLoader(e,t),this._renderBookmarkImageIcon(e,t))}_focusSelectedDragEl(e,t){this._selectedDragBookmarkUid===t.uid&&(E(e),this._selectedDragBookmarkUid=null)}_renderBookmark(e){return v("calcite-list-item",{afterCreate:t=>this._focusSelectedDragEl(t,e),afterUpdate:t=>this._focusSelectedDragEl(t,e),class:this.classes({[p.dragEnabled]:this.dragEnabled}),description:this._renderTimeExtentDescription(e),key:e.uid,label:this._getBookmarkTitle(e),value:e.uid,onCalciteListItemSelect:()=>this._goToBookmark(e)},this._renderBookmarkThumbnail(e),this._renderBookmarkContent(e),this._renderEditContainer(e))}_renderBookmarkContent(e){return v("div",{class:p.bookmarkContent,slot:"content"},v("span",{class:p.bookmarkContentLabel},this._getBookmarkTitle(e)),this._renderBookmarkTimeExtent(e,!0))}_renderEditingBookmarkName(e){const{messages:t,_userState:o}=this,i="name-required"===o?.validationState;return v("calcite-label",null,t.title,v("calcite-input",{afterCreate:this._storeEditInput,bind:this,class:p.editBookmarkInput,name:"bookmark-name",placeholder:t.titlePlaceholder,required:!0,type:"text",value:e.name}),i?v("calcite-input-message",{icon:"exclamation-mark-triangle",status:"invalid"},t.invalidTitle):null)}_renderEditingBookmarkActions(){const{messagesCommon:e,_userState:t}=this,o=t?.bookmark;return[v("calcite-button",{appearance:"transparent",kind:"danger",slot:"footer",type:"button",width:"full",onclick:()=>this._deleteBookmark(o)},e.delete),v("calcite-button",{appearance:"outline",bind:this,slot:"footer",type:"button",width:"full",onclick:this._closeEditBookmarkForm},e.cancel),v("calcite-button",{slot:"footer",type:"submit",width:"full"},e.save)]}_handleUrlEditInputChange(){const{_userState:e,_urlEditInputNode:t}=this,o=t?.value;if(!e?.editedBookmark||!o)return;e.validationState=void 0,e.editedBookmark.thumbnail?.isDataURI&&(e.screenshotUrl=e.editedBookmark.thumbnail?.url);const i=new m({url:o});i.isSecureUrl&&(e.customUrl=o,e.editedBookmark.thumbnail=i)}_renderEditingTimeExtent(e){const{capabilities:t,view:o}=this.viewModel,{timeExtent:i}=e;return t.time&&(o?.timeExtent??i)?v("div",{key:"edit-bookmark-time-container"},this._renderBookmarkTimeSwitch(e),this._renderEditBookmarkTimeExtent(e)):null}_renderEditingBookmarkImage(e){const{_userState:t}=this,o=t?.thumbnailState,i=e.thumbnail?.isSecureUrl?"url"===o:e.thumbnail?.isDataURI?"screenshot"===o:null;if(i)return this._renderBookmarkImage(e,i)}_renderEditingThumbnail(e){const{_userState:t,visibleElements:o}=this,i=t?.thumbnailState;return o.thumbnail&&"none"!==i?v("div",{class:p.authoringImageContainer},this._renderEditingBookmarkImage(e)):null}_renderUpdateThumbnailButton(){const{visibleElements:e,messages:t,_userState:o}=this,i=o?.thumbnailState;return e.thumbnail&&"screenshot"===i?v("calcite-button",{appearance:"outline",class:p.authoringRefreshThumbnailButton,iconStart:"refresh",key:"update-thumbnail",kind:"neutral",width:"full",onclick:()=>{this._updateThumbnail()}},t.updateThumbnail):null}_renderEditingBookmarkUrlInput(e){const{messages:t,_userState:o}=this,i=e.thumbnail?.url,r=e.thumbnail?.isSecureUrl?i:void 0,a=i&&"absolute-url-required"===o?.validationState,s=o?.thumbnailState;return"url"===s?v("calcite-label",{key:"thumbnail-url-input"},v("calcite-input",{afterCreate:this._storeUrlEditInput,bind:this,name:"bookmark-thumbnail-url",pattern:"https://.*",placeholder:t?`https://<${t.imageUrlPlaceholder}>`:void 0,required:!0,title:t.imageUrlTooltip,type:"text",value:r,onCalciteInputChange:this._handleUrlEditInputChange,onCalciteInputInput:this._handleUrlEditInputChange}),a?v("calcite-input-message",{icon:"exclamation-mark-triangle",status:"invalid"},t.invalidImageUrl):null):null}_renderThumbnailSelector(){const{visibleElements:e,messages:t,_userState:o}=this,i=o?.thumbnailState;return e.thumbnail?v("calcite-label",{key:"thumbnail-chip-group"},t.thumbnail,v("calcite-chip-group",{label:t.thumbnail,selectionMode:"single-persist",onCalciteChipGroupSelect:e=>this._handleThumbnailTypeSelect(e.currentTarget.selectedItems[0].value)},v("calcite-chip",{label:t.screenshot,selected:"screenshot"===i,value:"screenshot"},t.screenshot),v("calcite-chip",{label:t.url,selected:"url"===i,value:"url"},t.url),v("calcite-chip",{label:t.none,selected:"none"===i,value:"none"},t.none))):null}_renderEditingBookmark(e){const{disabled:t,messagesCommon:o,headingLevel:i}=this;return e?v("form",{bind:this,class:p.form,disabled:this.disabled,onsubmit:this._editBookmarkSubmit},v("calcite-flow-item",{afterCreate:this._focusEditFlowItemNode,afterUpdate:this._focusEditFlowItemNode,bind:this,disabled:t,heading:o.edit,headingLevel:i,key:"edit-bookmark-form",selected:"edit"===this._userState?.state,onCalciteFlowItemBack:e=>{e.preventDefault(),this._closeEditBookmarkForm()}},v("div",{class:p.formContent},v("div",{class:p.authoring},this._renderEditingBookmarkName(e),this._renderThumbnailSelector(),this._renderEditingThumbnail(e),this._renderEditingBookmarkUrlInput(e),this._renderUpdateThumbnailButton(),this._renderEditingTimeExtent(e))),this._renderEditingBookmarkActions())):null}_renderAddingBookmarkName(){const{_userState:e,messages:t}=this,o="name-required"===e?.validationState;return v("calcite-label",null,t.title,v("calcite-input",{afterCreate:this._storeAddInput,bind:this,class:p.addBookmarkInput,name:"bookmark-name",placeholder:t.titlePlaceholder,required:!0,type:"text",value:""}),o?v("calcite-input-message",{icon:"exclamation-mark-triangle",status:"invalid"},t.invalidTitle):null)}_renderAddingBookmarkActions(){const{messagesCommon:e}=this;return[v("calcite-button",{appearance:"outline",bind:this,slot:"footer",type:"button",width:"full",onclick:this._endAddBookmark},e.cancel),v("calcite-button",{slot:"footer",type:"submit",width:"full"},e.add)]}_renderAddingBookmark(){const{disabled:e,messages:t,headingLevel:o,_userState:i}=this;return"add"===i?.state?v("form",{bind:this,class:p.form,disabled:e,onsubmit:this._addBookmarkSubmitClick},v("calcite-flow-item",{afterCreate:this._focusAddFlowItemNode,afterUpdate:this._focusAddFlowItemNode,bind:this,disabled:e,heading:t.addBookmark,headingLevel:o,key:"add-bookmark-form",selected:"add"===this._userState?.state,onCalciteFlowItemBack:e=>{e.preventDefault(),this._endAddBookmark()}},v("div",{class:p.formContent},this._renderAddingBookmarkName()),this._renderAddingBookmarkActions())):null}_getBookmarkTitle(e){return e?.name||this.messagesCommon.untitled}_formatDate(e){return e?n(e,{...l("short-date"),timeZone:this.viewModel.view?.timeZone??d}):""}_formatTime(e){return e?n(e,{...l("long-time"),timeZone:this.viewModel.view?.timeZone??d}):""}_endAddBookmark(){this.endAddBookmark(),this._focusRootFlowItem=!0}_showEditBookmarkForm(e){e&&(this._editIncludeTimeExtent=!!e.timeExtent,this._userState=new u({bookmark:e,state:"edit"}),this._focusEditFlowItem=!0,this.viewModel.goTo(e))}async _createNewScreenshotUrl(){const e=await this.viewModel.createBookmark();return e.thumbnail?.url??null}_storeCurrentUrl(){const{_userState:e}=this,t=e?.editedBookmark?.thumbnail?.url;t&&(e?.editedBookmark?.thumbnail?.isSecureUrl?e.customUrl=t:e?.editedBookmark?.thumbnail?.isDataURI&&(e.screenshotUrl=t))}async _handleThumbnailTypeSelect(e){const{_userState:t}=this;if(!t)return;const{screenshotUrl:o,customUrl:i,editedBookmark:r}=t,a="screenshot"===e?o??await this._createNewScreenshotUrl():"url"===e&&i?i:null;this._storeCurrentUrl(),r&&a&&(r.thumbnail=new m({url:a})),t.validationState=void 0,t.thumbnailState=e}_closeEditBookmarkForm(){this._userState=null,this._focusRootFlowItem=!0}_addBookmarkSubmitClick(e){e.preventDefault(),this._addBookmarkSubmit()}async _addBookmarkSubmit(){const{_addInputNode:e,_userState:t,viewModel:o,viewModel:{bookmarks:i}}=this;if(!t)return;const r=e?e.value.trim():null;if(!r)return void(t.validationState="name-required");t.loading=!0;const a=await o.createBookmark();a.name=r,i.add(a),this._endAddBookmark()}async _editBookmarkAndClose(e,t){const{viewModel:o,viewModel:{defaultEditOptions:i}}=this;await o.editBookmark(e,{...i,...t}),this._closeEditBookmarkForm()}_editBookmarkSubmit(e){e.preventDefault();const{_editInputNode:t,_userState:o,_editIncludeTimeExtent:i,_urlEditInputNode:r}=this;if(!o?.bookmark||!o.editedBookmark)return;o.validationState=void 0,o.customUrl=void 0,o.screenshotUrl=void 0;const a=t?.value.trim();if(!a)return void(o.validationState="name-required");o.bookmark.name=a,o.bookmark.thumbnail=o.editedBookmark.thumbnail,i||(o.bookmark.timeExtent=null);const s=o.thumbnailState;if("url"===s&&r){const e=r.value,t=new m({url:e});if(!t.isSecureUrl)return void(o.validationState="absolute-url-required");o.bookmark.thumbnail=t}else"none"===s&&(o.bookmark.thumbnail=null);this._editBookmarkAndClose(o.bookmark,{takeScreenshot:!1,captureTimeExtent:i})}_storeEditInput(e){this._editInputNode=e}_storeAddInput(e){this._addInputNode=e}_storeUrlEditInput(e){this._urlEditInputNode=e}_deleteBookmark(e){this._closeEditBookmarkForm(),e&&(this.viewModel.bookmarks.remove(e),e.destroy())}_goToBookmark(e){this.endAddBookmark(),this.viewModel.goTo(e)}async _updateThumbnail(){const{_userState:e,viewModel:t}=this;e&&(e.validationState=void 0,await t.editBookmark(e.editedBookmark,{takeScreenshot:!0,captureViewpoint:!1,captureRotation:!1,captureScale:!1,captureTimeExtent:!1}))}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,E(e))}_focusEditFlowItemNode(e){this._focusEditFlowItem&&(this._focusEditFlowItem=!1,E(e))}_focusAddFlowItemNode(e){this._focusAddFlowItem&&(this._focusAddFlowItem=!1,E(e))}};e([a()],I.prototype,"_editIncludeTimeExtent",void 0),e([a({type:u})],I.prototype,"_userState",void 0),e([a()],I.prototype,"_focusRootFlowItem",void 0),e([a()],I.prototype,"_focusAddFlowItem",void 0),e([a()],I.prototype,"_focusEditFlowItem",void 0),e([a()],I.prototype,"defaultCreateOptions",null),e([a()],I.prototype,"defaultEditOptions",null),e([a()],I.prototype,"bookmarks",null),e([a()],I.prototype,"disabled",void 0),e([a()],I.prototype,"dragEnabled",void 0),e([a()],I.prototype,"filterPlaceholder",void 0),e([a()],I.prototype,"filterText",void 0),e([a()],I.prototype,"headingLevel",void 0),e([a()],I.prototype,"goToOverride",null),e([a()],I.prototype,"icon",null),e([a()],I.prototype,"label",null),e([a(),B("esri/widgets/Bookmarks/t9n/Bookmarks")],I.prototype,"messages",void 0),e([a(),B("esri/t9n/common")],I.prototype,"messagesCommon",void 0),e([a()],I.prototype,"uiStrings",void 0),e([a()],I.prototype,"view",null),e([a({type:k}),w(["select-bookmark","bookmark-edit","bookmark-select"])],I.prototype,"viewModel",void 0),e([a({type:h,nonNullable:!0})],I.prototype,"visibleElements",void 0),e([a()],I.prototype,"endAddBookmark",null),e([a()],I.prototype,"startAddBookmark",null),I=e([s("esri.widgets.Bookmarks")],I);const S=I;export{S as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as i,subclass as t}from"../../../core/accessorSupport/decorators.js";import s from"../../Widget.js";import{LayerTreeNode as o}from"../support/LayerTreeNode.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import{tsx as n}from"../../support/widget.js";var r;const c={expand:"expand",collapse:"collapse",hideSublayer:"hideSublayer",showSublayer:"showSublayer"},a="esri-building-disciplines-tree-node",d={base:a,label:`${a}__label`};let p=class extends s{static{r=this}constructor(e){super(e),this.messages=c,this.toggleSiblingsVisibility=!1,this._onCheckboxClick=e=>{e.stopPropagation();(e.metaKey||e.ctrlKey)&&this.toggleSiblingsVisibility&&(this.node.toggleVisibility(),this.node.toggleAllSiblingsVisibility())},this._onCheckboxToggle=e=>{this.node.toggleVisibility(e.currentTarget.checked)}}static loadDependencies(){return l({checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),tree:()=>import("@esri/calcite-components/dist/components/calcite-tree"),"tree-item":()=>import("@esri/calcite-components/dist/components/calcite-tree-item")})}loadDependencies(){return r.loadDependencies()}static{this.vnodeSelector="calcite-tree-item"}render(){const{node:e,messages:i}=this;if(e.isDiscipline&&!e.hasChildren)return n("div",{key:`${e.id}-empty`});const t=e.visible,s=!0===t,o=null===t,l=s?i?.hideSublayer:i?.showSublayer;return n("calcite-tree-item",{class:d.base,key:e.id},n("calcite-label",{class:d.label,layout:"inline"},n("calcite-checkbox",{checked:s,indeterminate:o,label:l,
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as i,subclass as t}from"../../../core/accessorSupport/decorators.js";import s from"../../Widget.js";import{LayerTreeNode as o}from"../support/LayerTreeNode.js";import{loadCalciteComponents as l}from"../../support/componentsUtils.js";import{tsx as n}from"../../support/widget.js";var r;const c={expand:"expand",collapse:"collapse",hideSublayer:"hideSublayer",showSublayer:"showSublayer"},a="esri-building-disciplines-tree-node",d={base:a,label:`${a}__label`};let p=class extends s{static{r=this}constructor(e){super(e),this.messages=c,this.toggleSiblingsVisibility=!1,this._onCheckboxClick=e=>{e.stopPropagation();(e.metaKey||e.ctrlKey)&&this.toggleSiblingsVisibility&&(this.node.toggleVisibility(),this.node.toggleAllSiblingsVisibility())},this._onCheckboxToggle=e=>{this.node.toggleVisibility(e.currentTarget.checked)}}static loadDependencies(){return l({checkbox:()=>import("@esri/calcite-components/dist/components/calcite-checkbox"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),tree:()=>import("@esri/calcite-components/dist/components/calcite-tree"),"tree-item":()=>import("@esri/calcite-components/dist/components/calcite-tree-item")})}loadDependencies(){return r.loadDependencies()}static{this.vnodeSelector="calcite-tree-item"}render(){const{node:e,messages:i}=this;if(e.isDiscipline&&!e.hasChildren)return n("div",{key:`${e.id}-empty`});const t=e.visible,s=!0===t,o=null===t,l=s?i?.hideSublayer:i?.showSublayer;return n("calcite-tree-item",{class:d.base,key:e.id},n("calcite-label",{class:d.label,layout:"inline"},n("calcite-checkbox",{checked:s,indeterminate:o,label:l,title:l,onCalciteCheckboxChange:this._onCheckboxToggle,onclick:this._onCheckboxClick}),e.title),this._renderedChildren)}get _renderedChildren(){const{node:e}=this;if(!e.hasChildren)return null;const{messages:i}=this,{toggleSiblingsVisibility:t}=this;return n("calcite-tree",{lines:!0,selectionMode:"none",slot:"children"},this.node.children.toArray().reverse().map(e=>n(r,{messages:i,node:e,toggleSiblingsVisibility:t})))}};e([i({type:o})],p.prototype,"node",void 0),e([i()],p.prototype,"messages",void 0),e([i({nonNullable:!0})],p.prototype,"toggleSiblingsVisibility",void 0),e([i()],p.prototype,"_renderedChildren",null),p=r=e([t("esri.widgets.BuildingExplorer.BuildingDisciplinesTree.BuildingDisciplinesNode")],p);const h=p;export{h as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{on as t}from"../../../core/events.js";import{clamp as i}from"../../../core/mathUtils.js";import{watch as s,initial as l}from"../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"../../Widget.js";import{g as h,h as a,l as v,a as d,b as _,k as c,e as g,d as p,m as u,c as m,j as L}from"../../../chunks/constants.js";import{css as y}from"./css.js";import{Label as P}from"./Label.js";import{LevelItem as C}from"./LevelItem.js";import{loadCalciteComponents as f}from"../../support/componentsUtils.js";import{globalCss as w}from"../../support/globalCss.js";import{tsx as x}from"../../support/widget.js";const b={selectLevel:"selectLevel",clearLevel:"clearLevel",nextLevel:"nextLevel",previousLevel:"previousLevel",currentLevel:"{{value}}"};let W=class extends r{constructor(e,t){super(e,t),this._levelHandlesKey="levelHandles",this._levelEventHandlesKey="levelEventHandles",this._levelWidgets=[],this._labelWidget=new P({onClear:()=>this.vm.clear()}),this._hoveredLevel=null,this._expandedLevelsHeight=void 0,this._normalizedPointerPosition=0,this._hovering=!1,this._containerPosTop=null,this._levelsContainer=null,this._onKeyDown=e=>{switch(e.key){case"ArrowDown":case"ArrowLeft":e.preventDefault(),e.stopPropagation(),this.vm.previous(),this._focusCurrentLevel();break;case"ArrowUp":case"ArrowRight":e.preventDefault(),e.stopPropagation(),this.vm.next(),this._focusCurrentLevel()}},this._onFocus=()=>{this._hoveredLevel=this._levels.length>0?this._levels[0]:null},this._onArrowUpClick=()=>{this.vm.next()},this._onArrowDownClick=()=>{this.vm.previous()},this._onPointerUp=()=>{if(window.getSelection()?.removeAllRanges(),null==this._hoveredLevel)return;const{vm:e}=this;e.enabled&&this._hoveredLevel===e.value?e.clear():e.select(this._hoveredLevel)},this._onPointerEnter=()=>{this._hovering||null==this._levelsContainer||(this._hovering=!0,this._containerPosTop=this._levelsContainer.getBoundingClientRect().top??0)},this._onPointerLeave=()=>{this._hovering&&(this._normalizedPointerPosition=0,this._hoveredLevel=null,this._hovering=!1)},this._onPointerMove=e=>{if(!this._hovering)return!1;if(window.getSelection()?.removeAllRanges(),null!=this._containerPosTop){const t=this._containerPosTop,i=c*L,s=this._expandedLevelsMargin;let l=this._levelsHeight,o=t+i+s;const n=this._levelHeight/2;o+=n,l-=n;let r=(e.clientY-o)/l;r+=u,this._normalizedPointerPosition=r}return!1}}loadDependencies(){return f({action:()=>import("@esri/calcite-components/dist/components/calcite-action")})}postInitialize(){this.addHandles([s(()=>this._levelsContainer,()=>this._onContainerChange(),l),s(()=>this._levels,()=>this._createLevelWidgets(),l),s(()=>this.messages,()=>{this._labelWidget.messages=this.messages??b},l)])}destroy(){this._levelWidgets.forEach(e=>e.destroy()),this._labelWidget.destroy()}get _levels(){return this.vm.allowedValues}get _numLevels(){return this._levels.length}get _levelsHeight(){return Math.round(this._levelHeight*this._numLevels)}get _expandedLevelsMargin(){return Math.round(((this._expandedLevelsHeight??0)-this._levelsHeight)/2)}get _levelWidth(){const{levelWidthNominator:e,levelWidthConstant:t}=m,s=e/Math.sqrt(this._numLevels)+t;return Math.round(i(s,a,h))}get _levelHeight(){const e=v,t=2*e/Math.sqrt(this._numLevels);return Math.round(i(t,2,e))}get _gaussianFactor(){const e=this._numLevels;return e/Math.log(d*e)*_}get _levelClosestToPointer(){if(!this._hovering)return null;const e=this._numLevels-1,t=this._normalizedPointerPosition;return e>=0&&null!=t?this._levels[Math.round((1-t)*e)]:null}render(){const e=this._levelWidgets.length,t=e>1?this._levelWidgets.map(e=>e.render()):null,i=c*L,s=-i/L,l=this._levelsHeight,o=l+2*i;return x("div",{class:this.classes(w.widget,y.container,{[y.animateLevel]:!this._hovering,[y.noLevel]:e<2}),key:this,onkeydown:this._onKeyDown},this._renderLabelContainer(),x("div",{afterCreate:e=>this._levelsContainer=e,class:y.levelsContainer,"data-node-ref":"",
|
|
2
|
+
import{__decorate as e}from"tslib";import{on as t}from"../../../core/events.js";import{clamp as i}from"../../../core/mathUtils.js";import{watch as s,initial as l}from"../../../core/reactiveUtils.js";import{property as o,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"../../Widget.js";import{g as h,h as a,l as v,a as d,b as _,k as c,e as g,d as p,m as u,c as m,j as L}from"../../../chunks/constants.js";import{css as y}from"./css.js";import{Label as P}from"./Label.js";import{LevelItem as C}from"./LevelItem.js";import{loadCalciteComponents as f}from"../../support/componentsUtils.js";import{globalCss as w}from"../../support/globalCss.js";import{tsx as x}from"../../support/widget.js";const b={selectLevel:"selectLevel",clearLevel:"clearLevel",nextLevel:"nextLevel",previousLevel:"previousLevel",currentLevel:"{{value}}"};let W=class extends r{constructor(e,t){super(e,t),this._levelHandlesKey="levelHandles",this._levelEventHandlesKey="levelEventHandles",this._levelWidgets=[],this._labelWidget=new P({onClear:()=>this.vm.clear()}),this._hoveredLevel=null,this._expandedLevelsHeight=void 0,this._normalizedPointerPosition=0,this._hovering=!1,this._containerPosTop=null,this._levelsContainer=null,this._onKeyDown=e=>{switch(e.key){case"ArrowDown":case"ArrowLeft":e.preventDefault(),e.stopPropagation(),this.vm.previous(),this._focusCurrentLevel();break;case"ArrowUp":case"ArrowRight":e.preventDefault(),e.stopPropagation(),this.vm.next(),this._focusCurrentLevel()}},this._onFocus=()=>{this._hoveredLevel=this._levels.length>0?this._levels[0]:null},this._onArrowUpClick=()=>{this.vm.next()},this._onArrowDownClick=()=>{this.vm.previous()},this._onPointerUp=()=>{if(window.getSelection()?.removeAllRanges(),null==this._hoveredLevel)return;const{vm:e}=this;e.enabled&&this._hoveredLevel===e.value?e.clear():e.select(this._hoveredLevel)},this._onPointerEnter=()=>{this._hovering||null==this._levelsContainer||(this._hovering=!0,this._containerPosTop=this._levelsContainer.getBoundingClientRect().top??0)},this._onPointerLeave=()=>{this._hovering&&(this._normalizedPointerPosition=0,this._hoveredLevel=null,this._hovering=!1)},this._onPointerMove=e=>{if(!this._hovering)return!1;if(window.getSelection()?.removeAllRanges(),null!=this._containerPosTop){const t=this._containerPosTop,i=c*L,s=this._expandedLevelsMargin;let l=this._levelsHeight,o=t+i+s;const n=this._levelHeight/2;o+=n,l-=n;let r=(e.clientY-o)/l;r+=u,this._normalizedPointerPosition=r}return!1}}loadDependencies(){return f({action:()=>import("@esri/calcite-components/dist/components/calcite-action")})}postInitialize(){this.addHandles([s(()=>this._levelsContainer,()=>this._onContainerChange(),l),s(()=>this._levels,()=>this._createLevelWidgets(),l),s(()=>this.messages,()=>{this._labelWidget.messages=this.messages??b},l)])}destroy(){this._levelWidgets.forEach(e=>e.destroy()),this._labelWidget.destroy()}get _levels(){return this.vm.allowedValues}get _numLevels(){return this._levels.length}get _levelsHeight(){return Math.round(this._levelHeight*this._numLevels)}get _expandedLevelsMargin(){return Math.round(((this._expandedLevelsHeight??0)-this._levelsHeight)/2)}get _levelWidth(){const{levelWidthNominator:e,levelWidthConstant:t}=m,s=e/Math.sqrt(this._numLevels)+t;return Math.round(i(s,a,h))}get _levelHeight(){const e=v,t=2*e/Math.sqrt(this._numLevels);return Math.round(i(t,2,e))}get _gaussianFactor(){const e=this._numLevels;return e/Math.log(d*e)*_}get _levelClosestToPointer(){if(!this._hovering)return null;const e=this._numLevels-1,t=this._normalizedPointerPosition;return e>=0&&null!=t?this._levels[Math.round((1-t)*e)]:null}render(){const e=this._levelWidgets.length,t=e>1?this._levelWidgets.map(e=>e.render()):null,i=c*L,s=-i/L,l=this._levelsHeight,o=l+2*i;return x("div",{class:this.classes(w.widget,y.container,{[y.animateLevel]:!this._hovering,[y.noLevel]:e<2}),key:this,onkeydown:this._onKeyDown},this._renderLabelContainer(),x("div",{afterCreate:e=>this._levelsContainer=e,class:y.levelsContainer,"data-node-ref":"",styles:{height:`${o}px`,marginBlockStart:`${s}px`,marginBlockEnd:`${s}px`},onfocus:this._onFocus},x("div",{class:y.innerLevelsContainer,styles:{height:`${l}px`,margin:"0",marginBlockStart:c-this._expandedLevelsMargin+"px"}},t)))}_renderLabelContainer(){const{hasPrevious:e,hasNext:t}=this.vm,i=this.messages??b,s=i.previousLevel,l=i.nextLevel;return x("div",{class:y.labelContainer,tabIndex:0},H({className:y.arrowUp,disabled:!t,icon:"chevron-up",onClick:this._onArrowUpClick,text:l}),this._labelWidget.render(),H({className:y.arrowDown,disabled:!e,icon:"chevron-down",onClick:this._onArrowDownClick,text:s}))}_updateComponents(){const e=this.messages??b,t=this.vm.enabled?this.vm.value:null,i=null!=this._hoveredLevel?this._hoveredLevel:t;this._levelWidgets.forEach(i=>{const s=this.vm.getValueLabel(i.level);i.label=null!=s?s:e.currentLevel?.replace("{{level}}",String(i.level)),i.active=i.level===t,i.hovering=i.level===this._hoveredLevel}),this._labelWidget.level=i,this._labelWidget.active=i===t,this._labelWidget.hovering=null!=this._hoveredLevel}_createLevelWidgets(){this._levelWidgets.forEach(e=>e.destroy()),this._levelWidgets=this._levels.map(e=>new C({level:e,onSelect:()=>this._onLevelToggle(e)})),this.removeHandles(this._levelHandlesKey),this.addHandles([s(()=>{const{vm:e}=this;return[this.messages,e?.value,e?.enabled,this._hoveredLevel,this._hovering]},()=>this._updateComponents(),l),s(()=>[this._normalizedPointerPosition,this._hovering],()=>this._onPointerPositionChange(),l),s(()=>this._levelWidth,e=>this._levelWidgets.forEach(t=>t.width=e),l)],this._levelHandlesKey)}_onContainerChange(){const e=this._levelsContainer;null!=e&&(this.removeHandles(this._levelEventHandlesKey),this.addHandles([t(e,"pointerenter",this._onPointerEnter),t(e,"pointerover",this._onPointerEnter),t(e,"pointerleave",this._onPointerLeave),t(e,"pointerup",this._onPointerUp),t(e,"pointermove",this._onPointerMove)],this._levelEventHandlesKey))}_focusCurrentLevel(){const e=this._levelWidgets.find(e=>e.level===this.vm.value);e?.focus()}_onLevelToggle(e){const{vm:t}=this;t.enabled&&t.value===e?t.clear():t.select(e)}_onPointerPositionChange(){let e=0;this._levelWidgets.forEach((t,i)=>{const{width:s,height:l}=this._getLevelWidgetSize(i);t.height=l,t.width=s,e+=l}),this._hoveredLevel=this._levelClosestToPointer;const t=this._expandedLevelsHeight;(null==t||Math.abs(t-e)>30)&&(this._expandedLevelsHeight=e)}_getLevelWidgetSize(e){const t={width:this._levelWidth,height:this._levelHeight};if(this._hovering){const i=this._getGaussianFactor(e,this._normalizedPointerPosition);t.width+=g*i,t.height+=p*i}return t}_getGaussianFactor(e,t){const i=this._numLevels-1,s=(i-e)/i,l=this._gaussianFactor*(s-t);return Math.exp(-(l**2))}};function H(e){return x("calcite-action",{class:e.className,disabled:e.disabled,icon:e.icon,key:e.className,text:e.text,textEnabled:!1,title:e.text,onclick:e.onClick})}e([o()],W.prototype,"vm",void 0),e([o()],W.prototype,"messages",void 0),e([o()],W.prototype,"_levelWidgets",void 0),e([o()],W.prototype,"_labelWidget",void 0),e([o()],W.prototype,"_hoveredLevel",void 0),e([o()],W.prototype,"_levels",null),e([o()],W.prototype,"_numLevels",null),e([o({readOnly:!0})],W.prototype,"_levelsHeight",null),e([o()],W.prototype,"_expandedLevelsHeight",void 0),e([o({readOnly:!0})],W.prototype,"_expandedLevelsMargin",null),e([o({readOnly:!0})],W.prototype,"_levelWidth",null),e([o({readOnly:!0})],W.prototype,"_levelHeight",null),e([o({readOnly:!0})],W.prototype,"_gaussianFactor",null),e([o({readOnly:!0})],W.prototype,"_levelClosestToPointer",null),e([o({type:Number,range:{min:0,max:1}})],W.prototype,"_normalizedPointerPosition",void 0),e([o()],W.prototype,"_hovering",void 0),e([o()],W.prototype,"_containerPosTop",void 0),e([o()],W.prototype,"_levelsContainer",void 0),W=e([n("esri.widgets.BuildingExplorer.BuildingLevelPicker.BuildingLevelPicker")],W);const k=W;export{k as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as l}from"../../../core/accessorSupport/decorators.js";import s from"../../Widget.js";import{labelCss as o}from"./css.js";import{loadCalciteComponents as i}from"../../support/componentsUtils.js";import{tsx as r}from"../../support/widget.js";const n={clearLevel:"",selectLevel:""};let c=class extends s{constructor(e,t){super(e,t),this.level=null,this.active=!1,this.hovering=!1,this.onClear=()=>{}}loadDependencies(){return i({fab:()=>import("@esri/calcite-components/dist/components/calcite-fab")})}render(){const e=this.messages??n;if(null==this.level)return r("div",{class:o.empty,title:e.selectLevel},e.selectLevel);const t=e.clearLevel;return r("div",{"aria-label":t,bind:this,class:this.classes(o.base,{[o.active]:this.active,[o.hover]:this.hovering}),onclick:this.onClear
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as l}from"../../../core/accessorSupport/decorators.js";import s from"../../Widget.js";import{labelCss as o}from"./css.js";import{loadCalciteComponents as i}from"../../support/componentsUtils.js";import{tsx as r}from"../../support/widget.js";const n={clearLevel:"",selectLevel:""};let c=class extends s{constructor(e,t){super(e,t),this.level=null,this.active=!1,this.hovering=!1,this.onClear=()=>{}}loadDependencies(){return i({fab:()=>import("@esri/calcite-components/dist/components/calcite-fab")})}render(){const e=this.messages??n;if(null==this.level)return r("div",{class:o.empty,title:e.selectLevel},e.selectLevel);const t=e.clearLevel;return r("div",{"aria-label":t,bind:this,class:this.classes(o.base,{[o.active]:this.active,[o.hover]:this.hovering}),title:t,onclick:this.onClear},r("span",null,this.level),r("calcite-fab",{appearance:"outline-fill",class:o.clearButton,disabled:!this.active,icon:"x",key:"clear-button",kind:"neutral",scale:"s",onclick:this.onClear}))}};e([t()],c.prototype,"level",void 0),e([t({nonNullable:!0})],c.prototype,"active",void 0),e([t({nonNullable:!0})],c.prototype,"hovering",void 0),e([t()],c.prototype,"messages",void 0),e([t({nonNullable:!0})],c.prototype,"onClear",void 0),c=e([l("esri.widgets.BuildingExplorer.BuildingLevelPicker.Label")],c);export{c as Label};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import i from"../../Widget.js";import{tsx as s,isRTL as r}from"../../support/widget.js";import{storeNode as l}from"../../support/widgetUtils.js";const n="esri-building-level-picker-item",h={container:n,base:`${n}__base`,hover:`${n}--hover`,active:`${n}--active`};let a=class extends i{constructor(t,e){super(t,e),this.active=!1,this.hovering=!1,this.width=0,this.height=0,this.onSelect=()=>{},this.onFocus=()=>{},this.onBlur=()=>{},this._baseElement=null}render(){return s("div",{bind:this,class:this.classes(h.container,{[h.active]:this.active,[h.hover]:this.hovering}),key:this,styles:{height:`${this.height}px`}},this._renderBase())}focus(){null!=this._baseElement&&this._baseElement.focus()}_renderBase(){const t=this.width,e=.8*this.width;return s("div",{class:h.base,styles:{width:`${Math.round(t)}px`,height:`${Math.round(t)}px`}},s("button",{afterCreate:l,"aria-label":this.label,bind:this,class:"rect","data-node-ref":"_baseElement",
|
|
2
|
+
import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import i from"../../Widget.js";import{tsx as s,isRTL as r}from"../../support/widget.js";import{storeNode as l}from"../../support/widgetUtils.js";const n="esri-building-level-picker-item",h={container:n,base:`${n}__base`,hover:`${n}--hover`,active:`${n}--active`};let a=class extends i{constructor(t,e){super(t,e),this.active=!1,this.hovering=!1,this.width=0,this.height=0,this.onSelect=()=>{},this.onFocus=()=>{},this.onBlur=()=>{},this._baseElement=null}render(){return s("div",{bind:this,class:this.classes(h.container,{[h.active]:this.active,[h.hover]:this.hovering}),key:this,styles:{height:`${this.height}px`}},this._renderBase())}focus(){null!=this._baseElement&&this._baseElement.focus()}_renderBase(){const t=this.width,e=.8*this.width;return s("div",{class:h.base,styles:{width:`${Math.round(t)}px`,height:`${Math.round(t)}px`}},s("button",{afterCreate:l,"aria-label":this.label,bind:this,class:"rect","data-node-ref":"_baseElement",styles:{width:`${Math.round(e)}px`,height:`${Math.round(e)}px`,transform:`translate(${r(this.container),-50}%, -50%) rotateX(66deg) rotateZ(45deg)`},tabIndex:-1,title:this.label??"",type:"button",onblur:this.onBlur,onclick:this.onSelect,onfocus:this.onFocus}))}};t([e({nonNullable:!0})],a.prototype,"level",void 0),t([e({nonNullable:!0})],a.prototype,"active",void 0),t([e({nonNullable:!0})],a.prototype,"hovering",void 0),t([e({nonNullable:!0})],a.prototype,"width",void 0),t([e({nonNullable:!0})],a.prototype,"height",void 0),t([e({nonNullable:!0})],a.prototype,"onSelect",void 0),t([e({nonNullable:!0})],a.prototype,"onFocus",void 0),t([e({nonNullable:!0})],a.prototype,"onBlur",void 0),a=t([o("esri.widgets.BuildingExplorer.BuildingLevelPicker.LevelItem")],a);export{a as LevelItem};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as s,initial as t}from"../../../core/reactiveUtils.js";import{property as r,subclass as o}from"../../../core/accessorSupport/decorators.js";import i from"../../Widget.js";import{css as n}from"./css.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import{globalCss as h}from"../../support/globalCss.js";import{tsx as l}from"../../support/widget.js";const c={nextPhase:"nextPhase",previousPhase:"previousPhase"};let u=class extends i{constructor(e,s){super(e,s),this._phasesContainer=null,this._shouldScrollCurrentPhaseIntoView=!0,this._shouldFocusCurrentPhase=!1,this._onKeyDown=e=>{const{vm:s}=this;switch(e.key){case"ArrowDown":case"ArrowLeft":e.stopPropagation(),e.preventDefault(),s.previous(),this._shouldFocusCurrentPhase=!0;break;case"ArrowUp":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s.next(),this._shouldFocusCurrentPhase=!0}},this._onArrowLeftClick=()=>{this.vm.previous()},this._onArrowRightClick=()=>{this.vm.next()},this._onPhasesContainerAfterCreate=e=>{this._phasesContainer=e,requestAnimationFrame(this._scrollOrFocusPhase)},this._scrollOrFocusPhase=()=>{const e=this._phasesContainer;if(this.destroyed||null==e)return;const s=e.querySelector(`.${n.phaseCurrent}`);if(s){if(this._shouldScrollCurrentPhaseIntoView){const t=e.offsetWidth,r=s.offsetLeft,o=s.offsetWidth;e.scrollLeft=-t/2+r+o/2,this._shouldScrollCurrentPhaseIntoView=!1}this._shouldFocusCurrentPhase&&(s.focus(),this._shouldFocusCurrentPhase=!1)}}}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action")})}initialize(){this.addHandles([s(()=>[this._currentPhase,this._phasesContainer,this.container],()=>{this._shouldScrollCurrentPhaseIntoView=!0,requestAnimationFrame(this._scrollOrFocusPhase)},t),s(()=>({container:this.container,numPhases:this._phases.length}),({container:e,numPhases:s})=>{e&&e.style.setProperty("--num-phases",String(s))},t)])}get _phases(){return this.vm.allowedValues}get _currentPhase(){const{vm:e}=this;return e.enabled?e.value:null}render(){if(this._phases.length<2)return l("div",{key:"no-phases"});const{vm:e,messages:s}=this,{previousPhase:t,nextPhase:r}=s??c;return l("div",{class:this.classes(h.widget,n.base),key:this,onkeydown:this._onKeyDown},p({className:n.arrowLeft,disabled:!e.hasPrevious,icon:"chevron-left",onClick:this._onArrowLeftClick,text:t}),l("div",{afterCreate:this._onPhasesContainerAfterCreate,class:n.phasesContainer},this._renderPhaseButtons()),p({className:n.arrowRight,disabled:!e.hasNext,icon:"chevron-right",onClick:this._onArrowRightClick,text:r}))}_renderPhaseButtons(){const e=this._phases,s=this._currentPhase,t=[];for(let r=0;r<e.length;++r){const o=e[r],i={phase:o,active:null!=s&&o<=s,current:null!=s&&o===s};r>0&&t.push(this._renderDivider(i)),t.push(this._renderPhaseButton(i))}return t}_renderPhaseButton({phase:e,active:s,current:t}){const{vm:r}=this,o=r.getValueLabel(e);return l("button",{"aria-label":o,class:this.classes(n.phase,{[n.phaseActive]:s,[n.phaseCurrent]:t}),key:`phase-${e}`,onclick:()=>r.select(e)
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as s,initial as t}from"../../../core/reactiveUtils.js";import{property as r,subclass as o}from"../../../core/accessorSupport/decorators.js";import i from"../../Widget.js";import{css as n}from"./css.js";import{loadCalciteComponents as a}from"../../support/componentsUtils.js";import{globalCss as h}from"../../support/globalCss.js";import{tsx as l}from"../../support/widget.js";const c={nextPhase:"nextPhase",previousPhase:"previousPhase"};let u=class extends i{constructor(e,s){super(e,s),this._phasesContainer=null,this._shouldScrollCurrentPhaseIntoView=!0,this._shouldFocusCurrentPhase=!1,this._onKeyDown=e=>{const{vm:s}=this;switch(e.key){case"ArrowDown":case"ArrowLeft":e.stopPropagation(),e.preventDefault(),s.previous(),this._shouldFocusCurrentPhase=!0;break;case"ArrowUp":case"ArrowRight":e.stopPropagation(),e.preventDefault(),s.next(),this._shouldFocusCurrentPhase=!0}},this._onArrowLeftClick=()=>{this.vm.previous()},this._onArrowRightClick=()=>{this.vm.next()},this._onPhasesContainerAfterCreate=e=>{this._phasesContainer=e,requestAnimationFrame(this._scrollOrFocusPhase)},this._scrollOrFocusPhase=()=>{const e=this._phasesContainer;if(this.destroyed||null==e)return;const s=e.querySelector(`.${n.phaseCurrent}`);if(s){if(this._shouldScrollCurrentPhaseIntoView){const t=e.offsetWidth,r=s.offsetLeft,o=s.offsetWidth;e.scrollLeft=-t/2+r+o/2,this._shouldScrollCurrentPhaseIntoView=!1}this._shouldFocusCurrentPhase&&(s.focus(),this._shouldFocusCurrentPhase=!1)}}}loadDependencies(){return a({action:()=>import("@esri/calcite-components/dist/components/calcite-action")})}initialize(){this.addHandles([s(()=>[this._currentPhase,this._phasesContainer,this.container],()=>{this._shouldScrollCurrentPhaseIntoView=!0,requestAnimationFrame(this._scrollOrFocusPhase)},t),s(()=>({container:this.container,numPhases:this._phases.length}),({container:e,numPhases:s})=>{e&&e.style.setProperty("--num-phases",String(s))},t)])}get _phases(){return this.vm.allowedValues}get _currentPhase(){const{vm:e}=this;return e.enabled?e.value:null}render(){if(this._phases.length<2)return l("div",{key:"no-phases"});const{vm:e,messages:s}=this,{previousPhase:t,nextPhase:r}=s??c;return l("div",{class:this.classes(h.widget,n.base),key:this,onkeydown:this._onKeyDown},p({className:n.arrowLeft,disabled:!e.hasPrevious,icon:"chevron-left",onClick:this._onArrowLeftClick,text:t}),l("div",{afterCreate:this._onPhasesContainerAfterCreate,class:n.phasesContainer},this._renderPhaseButtons()),p({className:n.arrowRight,disabled:!e.hasNext,icon:"chevron-right",onClick:this._onArrowRightClick,text:r}))}_renderPhaseButtons(){const e=this._phases,s=this._currentPhase,t=[];for(let r=0;r<e.length;++r){const o=e[r],i={phase:o,active:null!=s&&o<=s,current:null!=s&&o===s};r>0&&t.push(this._renderDivider(i)),t.push(this._renderPhaseButton(i))}return t}_renderPhaseButton({phase:e,active:s,current:t}){const{vm:r}=this,o=r.getValueLabel(e);return l("button",{"aria-label":o,class:this.classes(n.phase,{[n.phaseActive]:s,[n.phaseCurrent]:t}),key:`phase-${e}`,title:o,type:"button",onclick:()=>r.select(e)},e)}_renderDivider({phase:e,active:s}){return l("div",{class:this.classes(n.divider,{[n.dividerActive]:s}),key:`phase-divider-${e}`})}};function p(e){return l("calcite-action",{class:e.className,disabled:e.disabled,icon:e.icon,iconFlipRtl:!0,key:e.className,scale:"s",text:e.text,textEnabled:!1,title:e.text,onclick:e.onClick})}e([r({nonNullable:!0})],u.prototype,"vm",void 0),e([r()],u.prototype,"messages",void 0),e([r()],u.prototype,"_phases",null),e([r()],u.prototype,"_currentPhase",null),e([r()],u.prototype,"_phasesContainer",void 0),u=e([o("esri.widgets.BuildingExplorer.BuildingPhasePicker.BuildingPhasePicker")],u);const d=u;export{d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as o}from"../core/deprecate.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import s from"../core/Logger.js";import l from"../core/ReactiveMap.js";import{on as a,initial as r,watch as n}from"../core/reactiveUtils.js";import{property as p,subclass as d}from"../core/accessorSupport/decorators.js";import c from"./Widget.js";import m from"./CatalogLayerList/CatalogLayerListViewModel.js";import h from"./CatalogLayerList/CatalogLayerListVisibleElements.js";import{css as y}from"./CatalogLayerList/css.js";import u from"./LayerList/LayerListItem.js";import g from"./LayerList/ListItem.js";import{minFilterItems as L,getItem as f,removeDestroyedListItems as _,setFilterPredicate as v}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{globalCss as w}from"./support/globalCss.js";import{calciteListFilterProps as b}from"./support/listUtils.js";import{tsx as C,messageBundle as F,vmEvent as M}from"./support/widget.js";import{setFocus as O}from"./support/widgetUtils.js";var T;const P=t.ofType(g),A="nested";let E=T=class extends(i(c)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new l,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new l,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minFilterItems=L,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._onTablesOpen=e=>{this.onTablesOpen?this.onTablesOpen(e):(this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid)},this._onCatalogOpen=e=>{this.onCatalogOpen?this.onCatalogOpen(e):(this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(y.item));this._activeItem=f(t)},this.announceDeprecation=()=>{o(s.getLogger(this),"Catalog Layer List","arcgis-catalog-layer-list",{version:"5.0"})}}initialize(){this.addHandles([a(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),r),a(()=>this.viewModel.catalogItems,"change",()=>_(this.selectedItems),r),n(()=>[this.filterPredicate,this._rootListEl],()=>v(this._rootListEl,this.filterPredicate))])}loadDependencies(){return I({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.catalogItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,o)=>this._renderLayerFlowItem(t,o===e.length-1))}get catalogItems(){return this.viewModel.catalogItems}set catalogItems(e){this.viewModel.catalogItems=e}get catalogLayer(){return this.viewModel.catalogLayer}set catalogLayer(e){this.viewModel.catalogLayer=e}get icon(){return"catalog-dataset"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[w.hidden]:"loading"===e,[w.disabled]:"disabled"===e};return C("div",{class:this.classes(y.base,w.widget,w.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:o}=this,i=o.get(e);if(i)return i;const s="catalog"===e.type?this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||o.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:o}=this;this._openedLayersController?.abort();const i=new AbortController,{signal:s}=i;this._openedLayersController=i,e.forEach((o,i)=>{t.includes(i)||(o.destroy(),e.delete(i))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;o.removeAll(),o.addMany(l);const a=o.at(-1);a?"catalogLayer"in a?(this._set("catalogLayerList",a),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",a)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.forEach(e=>e.destroy()),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:o}=this;return e?.layer?C("calcite-tooltip",{key:`tooltip-${e.layer.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer.uid),topLayerDisabled:this.topLayerDisabled},o.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return C("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return C("div",{class:y.itemMessage,key:"esri-layer-list__no-items"},C("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:o,panel:i},s)=>{const l=()=>this._handlePanelFlowItemBack(i);return C("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:o,heading:i.title,headingLevel:this.headingLevel,key:`flow-panel-${i.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},i.render(),C("calcite-button",{appearance:"transparent",onclick:l,slot:"footer-start",width:"full"},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,O(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,O(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:o,_filterEnabled:i,_rootGroupUid:s,visibleElements:{closeButton:l,collapseButton:a,heading:r,flow:n},selectionMode:p,filterText:d,filterPlaceholder:c,messages:m,openedLayers:h,_openedPanelItems:u}=this,g=[C("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:l,closed:!e,collapsed:t,collapsible:a,heading:r?m.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!h.length&&!u.length,onCalciteFlowItemClose:()=>this.visible=!1},o?.length?null:this._renderNoItems(),C("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},"data-layer-type":s,displayMode:A,filterEnabled:i,filterPlaceholder:c,filterProps:b,filterText:i?d:"",group:s,key:"root-list",label:m.widgetLabel,onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem,selectionAppearance:"border",selectionMode:p,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??""},o.toArray().map(e=>this._renderItem(e)),i?C("div",{class:y.filterNoResults,slot:"filter-no-results"},C("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?n?C("calcite-flow",{key:"root-flow"},g):g:null}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,O(e))}_renderLayerFlowItem(e,t){const{messages:o,openedLayers:i}=this,s=e.title||this.messages.untitledLayer;return C("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:o["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),i.pop();const t=i.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_createCatalogLayerList(e){const{headingLevel:t,catalogOptions:o,view:i,filterPlaceholder:s,listItemCreatedFunction:l,minFilterItems:a,selectionMode:r,visibilityAppearance:n,onCatalogOpen:p,onTablesOpen:d}=this;return new T({headingLevel:t,view:i,filterPlaceholder:s,listItemCreatedFunction:l,minFilterItems:a,selectionMode:r,visibilityAppearance:n,...o,catalogLayer:e,onCatalogOpen:p,onTablesOpen:d})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:o,selectionMode:i}=this;return new t({headingLevel:o,selectionMode:i,...this._getTableListParams(e)})}_renderItem(e,t,o){return C(u,{activeItem:this._activeItem,css:y,displayMode:A,dragEnabled:!1,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:o,rootGroupUid:this._rootGroupUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:o}=this;if("none"===t)return;const i=e.target.selectedItems.map(e=>f(e)).filter(Boolean);o.removeAll(),o.addMany(i)}};e([p()],E.prototype,"_rootListEl",void 0),e([p()],E.prototype,"_activeItem",void 0),e([p()],E.prototype,"_tooltipReferenceMap",void 0),e([p()],E.prototype,"_focusRootFlowItem",void 0),e([p()],E.prototype,"_focusPanelFlowItem",void 0),e([p()],E.prototype,"_focusLayerFlowItem",void 0),e([p()],E.prototype,"_layerListMap",void 0),e([p()],E.prototype,"_filterEnabled",null),e([p()],E.prototype,"_visibleItems",null),e([p()],E.prototype,"_openedPanelItems",null),e([p()],E.prototype,"_renderedOpenLayerFlowItems",null),e([p()],E.prototype,"catalogItems",null),e([p()],E.prototype,"catalogLayer",null),e([p({readOnly:!0})],E.prototype,"catalogLayerList",void 0),e([p()],E.prototype,"catalogOptions",void 0),e([p()],E.prototype,"collapsed",void 0),e([p()],E.prototype,"filterPlaceholder",void 0),e([p()],E.prototype,"filterPredicate",void 0),e([p()],E.prototype,"filterText",void 0),e([p()],E.prototype,"headingLevel",void 0),e([p()],E.prototype,"icon",null),e([p()],E.prototype,"knowledgeGraphOptions",void 0),e([p()],E.prototype,"label",null),e([p()],E.prototype,"layerTablesEnabled",void 0),e([p()],E.prototype,"listItemCreatedFunction",null),e([p()],E.prototype,"mapImageOptions",void 0),e([p(),F("esri/widgets/CatalogLayerList/t9n/CatalogLayerList")],E.prototype,"messages",void 0),e([p(),F("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([p()],E.prototype,"minFilterItems",void 0),e([p({readOnly:!0})],E.prototype,"openedLayers",void 0),e([p({readOnly:!0})],E.prototype,"openedLayerLists",void 0),e([p()],E.prototype,"onCatalogOpen",void 0),e([p()],E.prototype,"onTablesOpen",void 0),e([p({type:P})],E.prototype,"selectedItems",void 0),e([p()],E.prototype,"selectionMode",void 0),e([p({readOnly:!0})],E.prototype,"tableList",void 0),e([p()],E.prototype,"tileOptions",void 0),e([p()],E.prototype,"view",null),e([M("trigger-action"),p({type:m})],E.prototype,"viewModel",void 0),e([p()],E.prototype,"visibilityAppearance",void 0),e([p({type:h,nonNullable:!0})],E.prototype,"visibleElements",void 0),E=T=e([d("esri.widgets.CatalogLayerList")],E);const k=E;export{k as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../core/Collection.js";import{deprecateWidget as o}from"../core/deprecate.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import s from"../core/Logger.js";import l from"../core/ReactiveMap.js";import{on as a,initial as r,watch as n}from"../core/reactiveUtils.js";import{property as p,subclass as d}from"../core/accessorSupport/decorators.js";import c from"./Widget.js";import m from"./CatalogLayerList/CatalogLayerListViewModel.js";import h from"./CatalogLayerList/CatalogLayerListVisibleElements.js";import{css as y}from"./CatalogLayerList/css.js";import u from"./LayerList/LayerListItem.js";import g from"./LayerList/ListItem.js";import{minFilterItems as L,getItem as f,removeDestroyedListItems as _,setFilterPredicate as v}from"./LayerList/support/layerListUtils.js";import{loadCalciteComponents as I}from"./support/componentsUtils.js";import{globalCss as w}from"./support/globalCss.js";import{calciteListFilterProps as b}from"./support/listUtils.js";import{tsx as C,messageBundle as F,vmEvent as M}from"./support/widget.js";import{setFocus as O}from"./support/widgetUtils.js";var T;const P=t.ofType(g),A="nested";let E=T=class extends(i(c)){constructor(e,i){super(e,i),this._rootListEl=null,this._activeItem=null,this._tooltipReferenceMap=new l,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._layerListMap=new l,this._rootGroupUid=`operational-${this.uid}`,this._openedLayersController=null,this.catalogLayerList=null,this.catalogOptions=null,this.collapsed=!1,this.filterPlaceholder="",this.filterPredicate=null,this.filterText="",this.headingLevel=2,this.knowledgeGraphOptions=null,this.layerTablesEnabled=new t(["knowledge-graph"]),this.mapImageOptions=null,this.messages=null,this.messagesCommon=null,this.minFilterItems=L,this.openedLayers=new t,this.openedLayerLists=new t,this.selectedItems=new P,this.selectionMode="none",this.tableList=null,this.tileOptions=null,this.viewModel=new m,this.visibilityAppearance="default",this.visibleElements=new h,this._onTablesOpen=e=>{this.onTablesOpen?this.onTablesOpen(e):(this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid)},this._onCatalogOpen=e=>{this.onCatalogOpen?this.onCatalogOpen(e):(this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid)},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._clearActiveItem=()=>{this._activeItem=null},this._setActiveItem=e=>{if("default"!==this.visibilityAppearance)return;const t=Array.from(e.composedPath()).find(e=>e.classList?.contains(y.item));this._activeItem=f(t)},this.announceDeprecation=()=>{o(s.getLogger(this),"Catalog Layer List","arcgis-catalog-layer-list",{version:"5.0"})}}initialize(){this.addHandles([a(()=>this.openedLayers,"change",()=>this._handleOpenedLayersChange(),r),a(()=>this.viewModel.catalogItems,"change",()=>_(this.selectedItems),r),n(()=>[this.filterPredicate,this._rootListEl],()=>v(this._rootListEl,this.filterPredicate))])}loadDependencies(){return I({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")})}destroy(){this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}get _filterEnabled(){return this.viewModel.totalItems>=this.minFilterItems&&this.visibleElements.filter}get _visibleItems(){return this.catalogItems?.filter(e=>!e.hidden&&(this.visibleElements.errors||!e.error))}get _openedPanelItems(){return this._visibleItems.flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _renderedOpenLayerFlowItems(){const{openedLayers:e}=this;return e.toArray().map((t,o)=>this._renderLayerFlowItem(t,o===e.length-1))}get catalogItems(){return this.viewModel.catalogItems}set catalogItems(e){this.viewModel.catalogItems=e}get catalogLayer(){return this.viewModel.catalogLayer}set catalogLayer(e){this.viewModel.catalogLayer=e}get icon(){return"catalog-dataset"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}triggerAction(e,t){return this.viewModel.triggerAction(e,t)}render(){const e=this.viewModel?.state,t={[w.hidden]:"loading"===e,[w.disabled]:"disabled"===e};return C("div",{class:this.classes(y.base,w.widget,w.panel,t)},this._renderItemTooltips(),this._renderItems())}async _createFlowList(e,t){const{_layerListMap:o}=this,i=o.get(e);if(i)return i;const s="catalog"===e.type?this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||o.set(e,s),s}async _handleOpenedLayersChange(){const{_layerListMap:e,openedLayers:t,openedLayerLists:o}=this;this._openedLayersController?.abort();const i=new AbortController,{signal:s}=i;this._openedLayersController=i,e.forEach((o,i)=>{t.includes(i)||(o.destroy(),e.delete(i))});const l=await Promise.all(t.map(e=>this._createFlowList(e,s)));if(s.aborted)return;o.removeAll(),o.addMany(l);const a=o.at(-1);a?"catalogLayer"in a?(this._set("catalogLayerList",a),this._set("tableList",null)):(this._set("catalogLayerList",null),this._set("tableList",a)):(this._set("catalogLayerList",null),this._set("tableList",null))}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.forEach(e=>e.destroy()),this._layerListMap.clear()}_renderItemTooltip(e){const{_tooltipReferenceMap:t,messages:o}=this;return e?.layer?C("calcite-tooltip",{key:`tooltip-${e.layer.uid}`,overlayPositioning:"fixed",referenceElement:t.get(e.layer.uid),topLayerDisabled:this.topLayerDisabled},o.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){return e.incompatible?this._renderItemTooltip(e):e.children?.filter(e=>!e.hidden).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderItemTooltips(){return this._visibleItems?.toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoItemsMessage(){return C("div",{slot:"message"},this.messages.noItemsToDisplay)}_renderNoItems(){return C("div",{class:y.itemMessage,key:"esri-layer-list__no-items"},C("calcite-notice",{icon:"information",kind:"info",open:!0,width:"full"},this._renderNoItemsMessage()))}_renderPanelFlowItems(){const{_openedPanelItems:e,openedLayers:t}=this;return e.toArray().map(({title:o,panel:i},s)=>{const l=()=>this._handlePanelFlowItemBack(i);return C("calcite-flow-item",{afterCreate:this._focusPanelFlowItemNode,afterUpdate:this._focusPanelFlowItemNode,bind:this,description:o,heading:i.title,headingLevel:this.headingLevel,key:`flow-panel-${i.uid}`,selected:!t.length&&s===e.length-1,onCalciteFlowItemBack:e=>{e.preventDefault(),l()}},i.render(),C("calcite-button",{appearance:"transparent",slot:"footer-start",width:"full",onclick:l},this.messagesCommon.back))})}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_focusRootFlowItemNode(e){this._focusRootFlowItem&&(this._focusRootFlowItem=!1,O(e))}_focusPanelFlowItemNode(e){this._focusPanelFlowItem&&(this._focusPanelFlowItem=!1,O(e))}_renderItems(){const{visible:e,collapsed:t,_visibleItems:o,_filterEnabled:i,_rootGroupUid:s,visibleElements:{closeButton:l,collapseButton:a,heading:r,flow:n},selectionMode:p,filterText:d,filterPlaceholder:c,messages:m,openedLayers:h,_openedPanelItems:u}=this,g=[C("calcite-flow-item",{afterCreate:this._focusRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,closable:l,closed:!e,collapsed:t,collapsible:a,heading:r?m.widgetLabel:void 0,headingLevel:this.headingLevel,key:"root-flow-item",selected:!h.length&&!u.length,onCalciteFlowItemClose:()=>this.visible=!1},o?.length?null:this._renderNoItems(),C("calcite-list",{afterCreate:e=>{this._rootListEl=e,e.addEventListener("focusin",this._setActiveItem),e.addEventListener("focusout",this._clearActiveItem)},afterRemoved:e=>{this._rootListEl=null,e.removeEventListener("focusin",this._setActiveItem),e.removeEventListener("focusout",this._clearActiveItem)},"data-layer-type":s,displayMode:A,filterEnabled:i,filterPlaceholder:c,filterProps:b,filterText:i?d:"",group:s,key:"root-list",label:m.widgetLabel,selectionAppearance:"border",selectionMode:p,onCalciteListChange:e=>this._handleCalciteListChange(e),onCalciteListFilter:e=>this.filterText=e.currentTarget?.filterText??"",onmouseleave:this._clearActiveItem,onmouseover:this._setActiveItem},o.toArray().map(e=>this._renderItem(e)),i?C("div",{class:y.filterNoResults,slot:"filter-no-results"},C("calcite-notice",{kind:"info",open:!0,width:"full"},this._renderNoItemsMessage())):null)),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return e?n?C("calcite-flow",{key:"root-flow"},g):g:null}_focusLayerFlowItemNode(e){this._focusLayerFlowItem===e.dataset.layerUid&&(this._focusLayerFlowItem=null,O(e))}_renderLayerFlowItem(e,t){const{messages:o,openedLayers:i}=this,s=e.title||this.messages.untitledLayer;return C("calcite-flow-item",{afterCreate:this._focusLayerFlowItemNode,afterUpdate:this._focusLayerFlowItemNode,bind:this,"data-layer-uid":e.uid,description:s,heading:o["catalog"===e.type?"catalogLayers":"tables"],headingLevel:this.headingLevel,key:`flow-layer-list-${e.uid}`,selected:t,onCalciteFlowItemBack:e=>{e.preventDefault(),i.pop();const t=i.at(-1);t?this._focusLayerFlowItem=t.uid:this._focusRootFlowItem=!0}},this._layerListMap.get(e)?.render())}_createCatalogLayerList(e){const{headingLevel:t,catalogOptions:o,view:i,filterPlaceholder:s,listItemCreatedFunction:l,minFilterItems:a,selectionMode:r,visibilityAppearance:n,onCatalogOpen:p,onTablesOpen:d}=this;return new T({headingLevel:t,view:i,filterPlaceholder:s,listItemCreatedFunction:l,minFilterItems:a,selectionMode:r,visibilityAppearance:n,...o,catalogLayer:e,onCatalogOpen:p,onTablesOpen:d})}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){const{default:t}=await import("./TableList.js"),{headingLevel:o,selectionMode:i}=this;return new t({headingLevel:o,selectionMode:i,...this._getTableListParams(e)})}_renderItem(e,t,o){return C(u,{activeItem:this._activeItem,css:y,displayMode:A,dragEnabled:!1,item:e,key:`layerListItem-${e.layer?.uid}`,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,messagesCommon:this.messagesCommon,parent:t,parentTitles:o,rootGroupUid:this._rootGroupUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,visibilityAppearance:this.visibilityAppearance,visibleElements:this.visibleElements,onAction:this._onTriggerAction,onCatalogOpen:this._onCatalogOpen,onPanelOpen:this._onPanelOpen,onTablesOpen:this._onTablesOpen,onTooltipReferenceChange:this._onTooltipReferenceChange})}_handleCalciteListChange(e){const{selectionMode:t,selectedItems:o}=this;if("none"===t)return;const i=e.target.selectedItems.map(e=>f(e)).filter(Boolean);o.removeAll(),o.addMany(i)}};e([p()],E.prototype,"_rootListEl",void 0),e([p()],E.prototype,"_activeItem",void 0),e([p()],E.prototype,"_tooltipReferenceMap",void 0),e([p()],E.prototype,"_focusRootFlowItem",void 0),e([p()],E.prototype,"_focusPanelFlowItem",void 0),e([p()],E.prototype,"_focusLayerFlowItem",void 0),e([p()],E.prototype,"_layerListMap",void 0),e([p()],E.prototype,"_filterEnabled",null),e([p()],E.prototype,"_visibleItems",null),e([p()],E.prototype,"_openedPanelItems",null),e([p()],E.prototype,"_renderedOpenLayerFlowItems",null),e([p()],E.prototype,"catalogItems",null),e([p()],E.prototype,"catalogLayer",null),e([p({readOnly:!0})],E.prototype,"catalogLayerList",void 0),e([p()],E.prototype,"catalogOptions",void 0),e([p()],E.prototype,"collapsed",void 0),e([p()],E.prototype,"filterPlaceholder",void 0),e([p()],E.prototype,"filterPredicate",void 0),e([p()],E.prototype,"filterText",void 0),e([p()],E.prototype,"headingLevel",void 0),e([p()],E.prototype,"icon",null),e([p()],E.prototype,"knowledgeGraphOptions",void 0),e([p()],E.prototype,"label",null),e([p()],E.prototype,"layerTablesEnabled",void 0),e([p()],E.prototype,"listItemCreatedFunction",null),e([p()],E.prototype,"mapImageOptions",void 0),e([p(),F("esri/widgets/CatalogLayerList/t9n/CatalogLayerList")],E.prototype,"messages",void 0),e([p(),F("esri/t9n/common")],E.prototype,"messagesCommon",void 0),e([p()],E.prototype,"minFilterItems",void 0),e([p({readOnly:!0})],E.prototype,"openedLayers",void 0),e([p({readOnly:!0})],E.prototype,"openedLayerLists",void 0),e([p()],E.prototype,"onCatalogOpen",void 0),e([p()],E.prototype,"onTablesOpen",void 0),e([p({type:P})],E.prototype,"selectedItems",void 0),e([p()],E.prototype,"selectionMode",void 0),e([p({readOnly:!0})],E.prototype,"tableList",void 0),e([p()],E.prototype,"tileOptions",void 0),e([p()],E.prototype,"view",null),e([M("trigger-action"),p({type:m})],E.prototype,"viewModel",void 0),e([p()],E.prototype,"visibilityAppearance",void 0),e([p({type:h,nonNullable:!0})],E.prototype,"visibleElements",void 0),E=T=e([d("esri.widgets.CatalogLayerList")],E);const k=E;export{k as default};
|
package/widgets/Compass.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as s}from"../core/accessorSupport/decorators.js";import o from"./Widget.js";import i from"./Compass/CompassViewModel.js";import{css as r}from"./Compass/css.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as l}from"./support/globalCss.js";import{messageBundle as a,tsx as p}from"./support/widget.js";let c=class extends o{constructor(e,t){super(e,t),this.messages=null,this.viewModel=new i({suppressDeprecationWarning:!0}),this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=e=>({transform:`rotateZ(${e.z}deg)`})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"rotation"===this.viewModel.state?"arrow-up":"compass-needle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}reset(){return this.viewModel.reset()}render(){const{orientation:e,state:t}=this.viewModel,{messages:s}=this;return p("div",{class:this.classes(r.base,l.widget)},p("calcite-button",{class:l.widgetButton,disabled:"disabled"===t,kind:"neutral",label:s.reset,
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as s}from"../core/accessorSupport/decorators.js";import o from"./Widget.js";import i from"./Compass/CompassViewModel.js";import{css as r}from"./Compass/css.js";import{loadCalciteComponents as n}from"./support/componentsUtils.js";import{globalCss as l}from"./support/globalCss.js";import{messageBundle as a,tsx as p}from"./support/widget.js";let c=class extends o{constructor(e,t){super(e,t),this.messages=null,this.viewModel=new i({suppressDeprecationWarning:!0}),this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=e=>({transform:`rotateZ(${e.z}deg)`})}loadDependencies(){return n({button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon")})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"rotation"===this.viewModel.state?"arrow-up":"compass-needle"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}reset(){return this.viewModel.reset()}render(){const{orientation:e,state:t}=this.viewModel,{messages:s}=this;return p("div",{class:this.classes(r.base,l.widget)},p("calcite-button",{class:l.widgetButton,disabled:"disabled"===t,kind:"neutral",label:s.reset,round:!0,scale:"s",title:s.reset,onclick:this._reset},p("div",{"aria-hidden":"true",class:r.iconContainer,title:s.reset},p("calcite-icon",{icon:this.icon,styles:this._toRotationTransform(e)}))))}};e([t()],c.prototype,"goToOverride",null),e([t()],c.prototype,"icon",null),e([t()],c.prototype,"label",null),e([t(),a("esri/widgets/Compass/t9n/Compass")],c.prototype,"messages",void 0),e([t()],c.prototype,"view",null),e([t({type:i})],c.prototype,"viewModel",void 0),c=e([s("esri.widgets.Compass")],c);const d=c;export{d as default};
|