@arcgis/core 5.0.0-next.61 → 5.0.0-next.63
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/Graphic.d.ts +1 -1
- package/applications/Components/previewSymbol2D.d.ts +1 -1
- package/applications/Components/webStyleSymbolUtils.d.ts +1 -1
- package/assets/components/assets/combobox/t9n/messages.ar.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.bg.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.bs.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.ca.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.cs.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.da.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.de.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.el.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.en.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.es.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.et.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.fi.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.fr.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.he.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.hr.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.hu.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.id.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.it.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.ja.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.ko.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.lt.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.lv.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.nl.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.no.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.pl.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.pt-BR.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.pt-PT.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.ro.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.ru.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.sk.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.sl.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.sr.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.sv.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.th.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.tr.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.uk.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.vi.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.zh-CN.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.zh-HK.json +1 -1
- package/assets/components/assets/combobox/t9n/messages.zh-TW.json +1 -1
- package/assets/components/assets/date-picker/nls/fr-CA.json +1 -0
- package/assets/components/assets/icon/arcgisLivingAtlas16.json +1 -0
- package/assets/components/assets/icon/arcgisLivingAtlas24.json +1 -0
- package/assets/components/assets/icon/arcgisLivingAtlas32.json +1 -0
- package/assets/components/assets/icon/arcgisSolutions16.json +1 -0
- package/assets/components/assets/icon/arcgisSolutions24.json +1 -0
- package/assets/components/assets/icon/arcgisSolutions32.json +1 -0
- package/assets/components/assets/icon/cameraSensorMap24.json +1 -1
- package/assets/components/assets/icon/contingentValuesRetire16.json +1 -0
- package/assets/components/assets/icon/contingentValuesRetire24.json +1 -0
- package/assets/components/assets/icon/contingentValuesRetire32.json +1 -0
- package/assets/components/assets/icon/domain16.json +1 -1
- package/assets/components/assets/icon/domain24.json +1 -1
- package/assets/components/assets/icon/domain32.json +1 -1
- package/assets/components/assets/icon/duplicateValues16.json +1 -0
- package/assets/components/assets/icon/duplicateValues24.json +1 -0
- package/assets/components/assets/icon/duplicateValues32.json +1 -0
- package/assets/components/assets/icon/envelope32F.json +1 -1
- package/assets/components/assets/icon/fieldGroups16.json +1 -0
- package/assets/components/assets/icon/fieldGroups24.json +1 -0
- package/assets/components/assets/icon/fieldGroups32.json +1 -0
- package/assets/components/assets/icon/groupContent16.json +1 -0
- package/assets/components/assets/icon/groupContent24.json +1 -0
- package/assets/components/assets/icon/groupContent32.json +1 -0
- package/assets/components/assets/icon/groupTemplate16.json +1 -0
- package/assets/components/assets/icon/groupTemplate24.json +1 -0
- package/assets/components/assets/icon/groupTemplate32.json +1 -0
- package/assets/components/assets/icon/integerSet16.json +1 -0
- package/assets/components/assets/icon/integerSet24.json +1 -0
- package/assets/components/assets/icon/integerSet32.json +1 -0
- package/assets/components/assets/icon/intersection16.json +1 -1
- package/assets/components/assets/icon/lineIntersection16.json +1 -1
- package/assets/components/assets/icon/linkChartCentrality16.json +1 -1
- package/assets/components/assets/icon/locationReferencingDataset16.json +1 -1
- package/assets/components/assets/icon/locationReferencingDataset24.json +1 -1
- package/assets/components/assets/icon/locationReferencingDataset32.json +1 -1
- package/assets/components/assets/icon/metadata16.json +1 -0
- package/assets/components/assets/icon/metadata24.json +1 -0
- package/assets/components/assets/icon/metadata32.json +1 -0
- package/assets/components/assets/icon/missionSystemMessage16.json +1 -0
- package/assets/components/assets/icon/missionSystemMessage24.json +1 -0
- package/assets/components/assets/icon/missionSystemMessage32.json +1 -0
- package/assets/components/assets/icon/newCompletePart16.json +1 -1
- package/assets/components/assets/icon/newCompletePart24.json +1 -1
- package/assets/components/assets/icon/newCompletePart32.json +1 -1
- package/assets/components/assets/icon/numberSet16.json +1 -0
- package/assets/components/assets/icon/numberSet24.json +1 -0
- package/assets/components/assets/icon/numberSet32.json +1 -0
- package/assets/components/assets/icon/openData16.json +1 -0
- package/assets/components/assets/icon/openData24.json +1 -0
- package/assets/components/assets/icon/openData32.json +1 -0
- package/assets/components/assets/icon/organizeTemplate16.json +1 -0
- package/assets/components/assets/icon/organizeTemplate24.json +1 -0
- package/assets/components/assets/icon/organizeTemplate32.json +1 -0
- package/assets/components/assets/icon/partneredCollaboration16.json +1 -0
- package/assets/components/assets/icon/partneredCollaboration24.json +1 -0
- package/assets/components/assets/icon/partneredCollaboration32.json +1 -0
- package/assets/components/assets/icon/personMagnifyingGlass16.json +1 -1
- package/assets/components/assets/icon/personMagnifyingGlass24.json +1 -1
- package/assets/components/assets/icon/pieChartSectionHashFilled16.json +1 -1
- package/assets/components/assets/icon/relativeDirectionArrows16.json +1 -0
- package/assets/components/assets/icon/relativeDirectionArrows24.json +1 -0
- package/assets/components/assets/icon/relativeDirectionArrows32.json +1 -0
- package/assets/components/assets/icon/signalHealth16.json +1 -0
- package/assets/components/assets/icon/signalHealth24.json +1 -0
- package/assets/components/assets/icon/signalHealth32.json +1 -0
- package/assets/components/assets/icon/sortAscendingView16.json +1 -0
- package/assets/components/assets/icon/sortAscendingView24.json +1 -0
- package/assets/components/assets/icon/sortAscendingView32.json +1 -0
- package/assets/components/assets/icon/sortDescendingView16.json +1 -0
- package/assets/components/assets/icon/sortDescendingView24.json +1 -0
- package/assets/components/assets/icon/sortDescendingView32.json +1 -0
- package/assets/components/assets/icon/starValues16.json +1 -0
- package/assets/components/assets/icon/starValues24.json +1 -0
- package/assets/components/assets/icon/starValues32.json +1 -0
- package/assets/components/assets/icon/updateTable16.json +1 -0
- package/assets/components/assets/icon/updateTable24.json +1 -0
- package/assets/components/assets/icon/updateTable32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{94929cf2b9fc66a93882.js → 02cf735176f286a48dd2.js} +1 -1
- package/assets/esri/core/workers/chunks/{f3437ae6bba846b524d3.js → 095c1b88cdcb91ab837e.js} +1 -1
- package/assets/esri/core/workers/chunks/{b7f2fb6684cf684b0bce.js → 0dc3a04ce717b7ddd957.js} +1 -1
- package/assets/esri/core/workers/chunks/{297344c2c1119159d143.js → 10373885604655f673df.js} +1 -1
- package/assets/esri/core/workers/chunks/{8208c073e606973ea1ad.js → 12f700b932a241e59071.js} +1 -1
- package/assets/esri/core/workers/chunks/{ca761dc5f45cafef313e.js → 17dea03fc4eb414f0022.js} +1 -1
- package/assets/esri/core/workers/chunks/1800994523d7cdfb73af.js +1 -0
- package/assets/esri/core/workers/chunks/{ec5f83aa752c39a96609.js → 19db60a3b4b09d445bd1.js} +1 -1
- package/assets/esri/core/workers/chunks/37002a46f03a9fc5f644.js +2 -0
- package/assets/esri/core/workers/chunks/{78fc9a55e620602db1ff.js.LICENSE.txt → 37002a46f03a9fc5f644.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{b4a59dd11d75df7bd510.js → 3cce8e894bf37c3e598e.js} +1 -1
- package/assets/esri/core/workers/chunks/43e2c1d72cd9c8beed2f.js +2 -0
- package/assets/esri/core/workers/chunks/{3266c3392c24ce6cdd83.js.LICENSE.txt → 43e2c1d72cd9c8beed2f.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{24c35a46cf8ed11b774d.js → 5180b15f1a865756a02e.js} +1 -1
- package/assets/esri/core/workers/chunks/57302b92e9899cce4ba3.js +1 -0
- package/assets/esri/core/workers/chunks/5909a0e763fddc3542e7.js +2 -0
- package/assets/esri/core/workers/chunks/{6f3ffc04086bca30e55d.js.LICENSE.txt → 5909a0e763fddc3542e7.js.LICENSE.txt} +2 -2
- package/assets/esri/core/workers/chunks/{d9736c783513e9c9b22f.js → 5a2933ae19345b7d5aa7.js} +1 -1
- package/assets/esri/core/workers/chunks/6be530ab81291745485b.js +2 -0
- package/assets/esri/core/workers/chunks/{70e2804d3710c6af468e.js.LICENSE.txt → 6be530ab81291745485b.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{ef9a23d41acb5ad36426.js → 6cb44cd319cb6c2539c8.js} +1 -1
- package/assets/esri/core/workers/chunks/73c416ae0ec5a1815591.js +2 -0
- package/assets/esri/core/workers/chunks/{be631029691d9a320cb5.js.LICENSE.txt → 73c416ae0ec5a1815591.js.LICENSE.txt} +1 -7
- package/assets/esri/core/workers/chunks/{9ff8ee6ed6b98c03ae7e.js → 9ccabf8142fb5de4d3e2.js} +2 -2
- package/assets/esri/core/workers/chunks/{9ff8ee6ed6b98c03ae7e.js.LICENSE.txt → 9ccabf8142fb5de4d3e2.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/ab71865b94022e78035c.js +1 -0
- package/assets/esri/core/workers/chunks/c2aeecd27e004c6cd7e1.js +2 -0
- package/assets/esri/core/workers/chunks/c2aeecd27e004c6cd7e1.js.LICENSE.txt +9 -0
- package/assets/esri/core/workers/chunks/{4cf2bec636dd8ceecf0c.js → c2bab829d6f6e05bbd81.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa0bbf0d7eadb924c473.js → cc50f96321a7c12f300b.js} +1 -1
- package/assets/esri/core/workers/chunks/{62752cd6821959cf6751.js → cfbe9993263fa6f69363.js} +1 -1
- package/assets/esri/core/workers/chunks/cfe1506a443fc84a0b91.js +1 -0
- package/assets/esri/core/workers/chunks/da99fd0d3106dd357743.js +1 -0
- package/assets/esri/core/workers/chunks/{2d8dca9a4a58469ddd05.js → e705d041f6c1632bfbcc.js} +1 -1
- package/assets/esri/core/workers/chunks/e95821a199e10b389e29.js +2 -0
- package/assets/esri/core/workers/chunks/{69278d08a7d64917f826.js.LICENSE.txt → e95821a199e10b389e29.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/f25bebd2b6eb0d0f6626.js +2 -0
- package/assets/esri/core/workers/chunks/{d9251c3c85c3ddd242c8.js.LICENSE.txt → f25bebd2b6eb0d0f6626.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/f32d4813b450a3eb4262.js +1 -0
- package/assets/esri/core/workers/chunks/{4b088260252787734c00.js → f5f584d325f8f2ea825f.js} +1 -1
- package/assets/esri/core/workers/chunks/{3405a23973f9e701a4d6.js → f7d93aae350796b88562.js} +1 -1
- package/assets/esri/core/workers/chunks/f9bddbf5dbc91897cb04.js +1 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/themes/base/_core.scss +1 -1
- package/assets/esri/themes/base/widgets/_BuildingPhasePicker.scss +1 -3
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +4 -4
- package/assets/esri/themes/base/widgets/_Grid.scss +6 -5
- package/assets/esri/themes/base/widgets/_Sketch.scss +0 -3
- package/assets/esri/themes/base/widgets/_Tooltip.scss +6 -6
- 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/config.js +1 -1
- package/core/Loadable.d.ts +8 -2
- package/core/reactiveUtils.d.ts +1 -1
- package/form/FormTemplate.d.ts +2 -2
- package/form/elements/AttachmentElement.d.ts +2 -2
- package/form/elements/GroupElement.d.ts +2 -2
- package/form/elements/inputs/attachments/AttachmentInput.d.ts +9 -2
- package/form/elements/inputs/attachments/AudioInput.d.ts +10 -1
- package/form/elements/inputs/attachments/DocumentInput.d.ts +9 -1
- package/form/elements/inputs/attachments/ImageInput.d.ts +10 -1
- package/form/elements/inputs/attachments/Input.d.ts +19 -1
- package/form/elements/inputs/attachments/SignatureInput.d.ts +5 -0
- package/form/elements/inputs/attachments/VideoInput.d.ts +10 -1
- package/form/elements/inputs/attachments/types.d.ts +15 -0
- package/form/elements.d.ts +0 -9
- package/form/types.d.ts +17 -0
- package/interfaces.d.ts +74 -212
- package/intl/substitute.d.ts +1 -1
- package/intl.d.ts +5 -5
- package/kernel.js +1 -1
- package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/ogc/types.d.ts +1 -1
- package/layers/support/RouteStopSymbols.d.ts +1 -1
- package/layers/support/RouteSymbols.d.ts +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/Circuit.d.ts +2 -2
- package/networks/support/CircuitLocation.d.ts +3 -3
- package/networks/support/CircuitLocation.js +1 -1
- package/networks/support/CircuitPathConnectivityElement.js +1 -1
- package/networks/support/CircuitSection.d.ts +2 -2
- package/networks/support/jsonTypes.d.ts +2 -2
- package/networks/support/networkFieldUtils.js +1 -1
- package/package.json +3 -3
- package/portal/PortalUser.d.ts +2 -2
- package/renderers/ClassBreaksRenderer.d.ts +2 -2
- package/renderers/SimpleRenderer.d.ts +1 -1
- package/renderers/UniqueValueRenderer.d.ts +1 -1
- package/renderers/support/ClassBreakInfo.d.ts +1 -1
- package/renderers/support/RendererLegendOptions.d.ts +2 -1
- package/renderers/support/UniqueValueClass.d.ts +1 -1
- package/renderers/support/UniqueValueInfo.d.ts +1 -1
- package/renderers/types.d.ts +1 -1
- package/rest/networks/circuits/alterCircuit.js +1 -1
- package/rest/networks/circuits/createCircuit.js +1 -1
- package/rest/networks/circuits/deleteCircuits.js +1 -1
- package/rest/networks/circuits/exportCircuits.js +1 -1
- package/rest/networks/circuits/queryCircuits.js +1 -1
- package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
- package/rest/networks/circuits/verifyCircuits.js +1 -1
- package/rest/networks/support/Association.js +1 -1
- package/rest/networks/support/TelecomNetworkElement.d.ts +6 -5
- package/rest/networks/support/TelecomNetworkElement.js +1 -1
- package/rest/networks/support/TraceLocation.d.ts +10 -8
- package/rest/networks/support/TraceLocation.js +1 -1
- package/rest/networks/support/TraceResult.js +1 -1
- package/rest/networks/unitIdentifiers/insertGap.js +1 -1
- package/rest/networks/unitIdentifiers/queryUnitIdentifiers.js +1 -1
- package/rest/networks/unitIdentifiers/reset.js +1 -1
- package/rest/networks/unitIdentifiers/resize.js +1 -1
- package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +1 -1
- package/rest/places.d.ts +0 -4
- package/rest/support/AttributeBinsQuery.d.ts +1 -14
- package/rest/symbolService.d.ts +2 -2
- package/smartMapping/raster/renderers/vectorField.d.ts +0 -1
- package/smartMapping/renderers/opacity.d.ts +1 -1
- package/smartMapping/renderers/support/spikeUtils.d.ts +2 -2
- package/smartMapping/renderers/type.d.ts +1 -1
- package/smartMapping/renderers/univariateColorSize.d.ts +4 -4
- package/smartMapping/statistics/types.d.ts +2 -2
- package/support/actions/actionUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/CIMSymbol.d.ts +29 -29
- package/symbols/Font.d.ts +1 -1
- package/symbols/IconSymbol3DLayer.d.ts +3 -4
- package/symbols/ObjectSymbol3DLayer.d.ts +3 -4
- package/symbols/Symbol.d.ts +2 -5
- package/symbols/Symbol3DLayer.d.ts +2 -3
- package/symbols/TextSymbol.d.ts +3 -3
- package/symbols/TextSymbol3DLayer.d.ts +3 -3
- package/symbols/WaterSymbol3DLayer.d.ts +4 -7
- package/symbols/WebStyleSymbol.d.ts +5 -5
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/defaultCIMValues.js +1 -1
- package/symbols/cim/{CIMTypes.d.ts → types.d.ts} +216 -167
- package/symbols/cim/types.js +5 -0
- package/symbols/support/IconSymbol3DLayerResource.d.ts +2 -3
- package/symbols/support/ObjectSymbol3DLayerResource.d.ts +2 -3
- package/symbols/support/Symbol3DFillMaterial.d.ts +2 -2
- package/symbols/support/cimConversionUtils.d.ts +1 -1
- package/symbols/support/cimSymbolUtils.d.ts +4 -4
- package/symbols/support/jsonUtils.d.ts +1 -1
- package/symbols/support/symbolUtils.d.ts +66 -4
- package/symbols/support/types.d.ts +3 -62
- package/symbols/types.d.ts +113 -1
- package/unionTypes.d.ts +61 -14
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientSizeHelper.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/BaseLayerViewGL2D.d.ts +6 -6
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/support/RouteLayerInteraction.js +1 -1
- package/views/2d/layers/support/RouteLayerInteractiveOptions.js +5 -0
- package/views/2d/layers/support/RouteLayerWaypointVisualization.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/components/FeatureList.js +1 -1
- package/widgets/Editor/components/PendingFeatureList.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/ElevationProfile/components/LegendItem.js +1 -1
- package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Expand.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/RelationshipColumn.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesDrillIn.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/LayerList/LayerListItem.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/Legend/LegendViewModel.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Search/SearchSource.d.ts +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
- package/widgets/Sketch/support/ResponsiveToolbar/responsiveToolbarUtils.js +1 -1
- package/widgets/Sketch/types.d.ts +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/TableList/types.d.ts +2 -3
- package/widgets/TableList.d.ts +1 -1
- package/widgets/TableList.js +1 -1
- package/widgets/TimeZoneLabel.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/ValuePickerCombobox.js +1 -1
- package/widgets/support/GeolocationPositioning.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/widgets/types.d.ts +2 -2
- package/assets/components/assets/modal/t9n/messages.ar.json +0 -1
- package/assets/components/assets/modal/t9n/messages.bg.json +0 -1
- package/assets/components/assets/modal/t9n/messages.bs.json +0 -1
- package/assets/components/assets/modal/t9n/messages.ca.json +0 -1
- package/assets/components/assets/modal/t9n/messages.cs.json +0 -1
- package/assets/components/assets/modal/t9n/messages.da.json +0 -1
- package/assets/components/assets/modal/t9n/messages.de.json +0 -1
- package/assets/components/assets/modal/t9n/messages.el.json +0 -1
- package/assets/components/assets/modal/t9n/messages.en.json +0 -1
- package/assets/components/assets/modal/t9n/messages.es.json +0 -1
- package/assets/components/assets/modal/t9n/messages.et.json +0 -1
- package/assets/components/assets/modal/t9n/messages.fi.json +0 -1
- package/assets/components/assets/modal/t9n/messages.fr.json +0 -1
- package/assets/components/assets/modal/t9n/messages.he.json +0 -1
- package/assets/components/assets/modal/t9n/messages.hr.json +0 -1
- package/assets/components/assets/modal/t9n/messages.hu.json +0 -1
- package/assets/components/assets/modal/t9n/messages.id.json +0 -1
- package/assets/components/assets/modal/t9n/messages.it.json +0 -1
- package/assets/components/assets/modal/t9n/messages.ja.json +0 -1
- package/assets/components/assets/modal/t9n/messages.json +0 -1
- package/assets/components/assets/modal/t9n/messages.ko.json +0 -1
- package/assets/components/assets/modal/t9n/messages.lt.json +0 -1
- package/assets/components/assets/modal/t9n/messages.lv.json +0 -1
- package/assets/components/assets/modal/t9n/messages.nl.json +0 -1
- package/assets/components/assets/modal/t9n/messages.no.json +0 -1
- package/assets/components/assets/modal/t9n/messages.pl.json +0 -1
- package/assets/components/assets/modal/t9n/messages.pt-BR.json +0 -1
- package/assets/components/assets/modal/t9n/messages.pt-PT.json +0 -1
- package/assets/components/assets/modal/t9n/messages.ro.json +0 -1
- package/assets/components/assets/modal/t9n/messages.ru.json +0 -1
- package/assets/components/assets/modal/t9n/messages.sk.json +0 -1
- package/assets/components/assets/modal/t9n/messages.sl.json +0 -1
- package/assets/components/assets/modal/t9n/messages.sr.json +0 -1
- package/assets/components/assets/modal/t9n/messages.sv.json +0 -1
- package/assets/components/assets/modal/t9n/messages.th.json +0 -1
- package/assets/components/assets/modal/t9n/messages.tr.json +0 -1
- package/assets/components/assets/modal/t9n/messages.uk.json +0 -1
- package/assets/components/assets/modal/t9n/messages.vi.json +0 -1
- package/assets/components/assets/modal/t9n/messages.zh-CN.json +0 -1
- package/assets/components/assets/modal/t9n/messages.zh-HK.json +0 -1
- package/assets/components/assets/modal/t9n/messages.zh-TW.json +0 -1
- package/assets/components/assets/tip/t9n/messages.ar.json +0 -1
- package/assets/components/assets/tip/t9n/messages.bg.json +0 -1
- package/assets/components/assets/tip/t9n/messages.bs.json +0 -1
- package/assets/components/assets/tip/t9n/messages.ca.json +0 -1
- package/assets/components/assets/tip/t9n/messages.cs.json +0 -1
- package/assets/components/assets/tip/t9n/messages.da.json +0 -1
- package/assets/components/assets/tip/t9n/messages.de.json +0 -1
- package/assets/components/assets/tip/t9n/messages.el.json +0 -1
- package/assets/components/assets/tip/t9n/messages.en.json +0 -1
- package/assets/components/assets/tip/t9n/messages.es.json +0 -1
- package/assets/components/assets/tip/t9n/messages.et.json +0 -1
- package/assets/components/assets/tip/t9n/messages.fi.json +0 -1
- package/assets/components/assets/tip/t9n/messages.fr.json +0 -1
- package/assets/components/assets/tip/t9n/messages.he.json +0 -1
- package/assets/components/assets/tip/t9n/messages.hr.json +0 -1
- package/assets/components/assets/tip/t9n/messages.hu.json +0 -1
- package/assets/components/assets/tip/t9n/messages.id.json +0 -1
- package/assets/components/assets/tip/t9n/messages.it.json +0 -1
- package/assets/components/assets/tip/t9n/messages.ja.json +0 -1
- package/assets/components/assets/tip/t9n/messages.json +0 -1
- package/assets/components/assets/tip/t9n/messages.ko.json +0 -1
- package/assets/components/assets/tip/t9n/messages.lt.json +0 -1
- package/assets/components/assets/tip/t9n/messages.lv.json +0 -1
- package/assets/components/assets/tip/t9n/messages.nl.json +0 -1
- package/assets/components/assets/tip/t9n/messages.no.json +0 -1
- package/assets/components/assets/tip/t9n/messages.pl.json +0 -1
- package/assets/components/assets/tip/t9n/messages.pt-BR.json +0 -1
- package/assets/components/assets/tip/t9n/messages.pt-PT.json +0 -1
- package/assets/components/assets/tip/t9n/messages.ro.json +0 -1
- package/assets/components/assets/tip/t9n/messages.ru.json +0 -1
- package/assets/components/assets/tip/t9n/messages.sk.json +0 -1
- package/assets/components/assets/tip/t9n/messages.sl.json +0 -1
- package/assets/components/assets/tip/t9n/messages.sr.json +0 -1
- package/assets/components/assets/tip/t9n/messages.sv.json +0 -1
- package/assets/components/assets/tip/t9n/messages.th.json +0 -1
- package/assets/components/assets/tip/t9n/messages.tr.json +0 -1
- package/assets/components/assets/tip/t9n/messages.uk.json +0 -1
- package/assets/components/assets/tip/t9n/messages.vi.json +0 -1
- package/assets/components/assets/tip/t9n/messages.zh-CN.json +0 -1
- package/assets/components/assets/tip/t9n/messages.zh-HK.json +0 -1
- package/assets/components/assets/tip/t9n/messages.zh-TW.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.ar.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.bg.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.bs.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.ca.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.cs.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.da.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.de.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.el.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.en.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.es.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.et.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.fi.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.fr.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.he.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.hr.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.hu.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.id.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.it.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.ja.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.ko.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.lt.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.lv.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.nl.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.no.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.pl.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.pt-BR.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.pt-PT.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.ro.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.ru.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.sk.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.sl.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.sr.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.sv.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.th.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.tr.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.uk.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.vi.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.zh-CN.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.zh-HK.json +0 -1
- package/assets/components/assets/tip-manager/t9n/messages.zh-TW.json +0 -1
- package/assets/esri/core/workers/chunks/211837df0edada4414c5.js +0 -1
- package/assets/esri/core/workers/chunks/3266c3392c24ce6cdd83.js +0 -2
- package/assets/esri/core/workers/chunks/509065a27bd07bd32475.js +0 -1
- package/assets/esri/core/workers/chunks/69278d08a7d64917f826.js +0 -2
- package/assets/esri/core/workers/chunks/6f3ffc04086bca30e55d.js +0 -2
- package/assets/esri/core/workers/chunks/70e2804d3710c6af468e.js +0 -2
- package/assets/esri/core/workers/chunks/78fc9a55e620602db1ff.js +0 -2
- package/assets/esri/core/workers/chunks/a67c3958d76d10c04fa6.js +0 -2
- package/assets/esri/core/workers/chunks/a67c3958d76d10c04fa6.js.LICENSE.txt +0 -3
- package/assets/esri/core/workers/chunks/a94dd0f5839b6e2bb2d2.js +0 -1
- package/assets/esri/core/workers/chunks/b7bcff9a64f41a0a0b6a.js +0 -1
- package/assets/esri/core/workers/chunks/be631029691d9a320cb5.js +0 -2
- package/assets/esri/core/workers/chunks/c7802c144959d60e774a.js +0 -1
- package/assets/esri/core/workers/chunks/d9251c3c85c3ddd242c8.js +0 -2
- package/assets/esri/core/workers/chunks/edd3cf415955309b4ca4.js +0 -1
- package/assets/esri/core/workers/chunks/fbd577f56529063ce491.js +0 -1
- package/form/elements/inputs/attachments/support/inputs.d.ts +0 -10
- package/form/support/formUtils.d.ts +0 -4
- package/symbols/cim/enums.d.ts +0 -50
- package/symbols/cim/enums.js +0 -5
- package/symbols/support/OccludedVisibility.d.ts +0 -2
- package/symbols/support/materialUtils.d.ts +0 -2
- package/symbols/support/textUtils.d.ts +0 -10
- package/symbols/support/typeUtils.d.ts +0 -86
- package/symbols/support/webStyleAcceptedFormats.d.ts +0 -2
- package/symbols.d.ts +0 -439
- package/symbols.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../../../intl.js";import{watch as i,on as r,initial as s}from"../../../core/reactiveUtils.js";import{stripHTML as l}from"../../../core/string.js";import{property as o,subclass as a}from"../../../core/accessorSupport/decorators.js";import{isSubtypeGroupLayer as n,isGroupLayer as d}from"../../../layers/support/layerUtils.js";import{defaultHighlightName as c,temporaryHighlightName as u}from"../../../views/support/HighlightDefaults.js";import p from"../../Widget.js";import h from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as m}from"../../support/componentsUtils.js";import _ from"../../support/FilterBuilder.js";import{globalCss as v}from"../../support/globalCss.js";import{Heading as f}from"../../support/Heading.js";import g from"../../support/SelectionToolbar.js";import{tsx as y,messageBundle as b}from"../../support/widget.js";import F from"../../support/SelectionToolbar/VisibleElements.js";const w="esri-feature-form-utility-network-association-layers",C={base:w,header:`${w}__header`,headingContent:`${w}__heading-content`,featureObserver:`${w}__feature-observer`,filterContainer:`${w}__filter-container`,filterOptionsContainer:`${w}__filter-options-container`,filterOptionsHeader:`${w}__filter-options-header`,listContainer:`${w}__list-container`,spatialSelectContainer:`${w}__spatial-select-container`,spatialSelectToolbar:`${w}__spatial-select-toolbar`,stickySpinnerContainer:`${w}__sticky-loading-container`,loadingContainer:`${w}__loading-container`};let L=class extends p{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesEditor=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new h,this.view=null,this._filterBuilder=new _,this._featureFilterText="",this._layerFilterText="",this._observer=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._observerNode=null,this._selectionToolbar=new g({returnFeatureTitleFields:!0,layerViewPreferenceEnabled:!1,persistSelection:!1,visibleElements:new F({chip:!1,operationTypeControls:!1,pan:!1})}),this._onSelectionComplete=async e=>{const{highlightHelper:t}=this.viewModel;await this.viewModel.onSelectionComplete(e),t?.removeAll(),this._featureSpatialGraphics.length>0&&t?.add(this._featureSpatialGraphics)}}initialize(){this._setupSelectionToolbar(),this.addHandles([i(()=>this.viewModel,()=>this.reset()),i(()=>[this.viewModel.state,this._observerNode],()=>this._onObserverChange()),i(()=>this.selectedLayer,e=>{this._filterBuilder.layer=e,e||(this.filterOptionsVisible=!1,this._featureFilterText="")})])}loadDependencies(){return m({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),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")})}destroy(){this._filterBuilder.destroy(),this._selectionToolbar.destroy()}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get isSelecting(){return"active"===this._selectionToolbar.state}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _featureSpatialGraphics(){return this.viewModel.featureSpatialItems.toArray().map(e=>e.feature)}get _filteredFeatureItems(){const{_featureFilterText:e}=this,{featureItems:t,featureSpatialItems:i}=this.viewModel;return(i.length?i:t).map(e=>({label:e.label,graphic:e.feature,layer:e.feature.sourceLayer})).filter(t=>t.label?.toLowerCase().includes(e)??!1)}get _filteredFeatureItemsPage(){const{featurePage:e,featuresPerPage:t}=this.viewModel,i=e*t;return this._filteredFeatureItems.toArray().slice(0,i)}render(){return y("div",{class:this.classes(C.base,v.widget)},this._renderContent())}applyFilterOptions(){const{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}cancelSelection(){this._selectionToolbar.cancel()}reset(){this.filterWhereClause=null,this._featureFilterText="",this._layerFilterText="",this.filterOptionsVisible=!1,this._filterBuilder.reset()}startSelection(e){this._selectionToolbar.activateTool(e)}_setupSelectionToolbar(){this.addHandles([i(()=>this.view,e=>{this.viewModel.reset(),this._selectionToolbar.view="2d"===e?.type?e:null},s),i(()=>[this.viewModel,this.viewModel.layerItems.length,this.viewModel.map?.allLayers.map(e=>e.visible),this.viewModel.map?.allLayers?.filter(e=>n(e)).toArray().flatMap(e=>e.sublayers.toArray()).map(e=>e.visible)],()=>this._updateToolbarSources()),r(()=>this._selectionToolbar,"before-activate",e=>this.emit("before-selection",e)),r(()=>this._selectionToolbar,"complete",this._onSelectionComplete)])}_updateToolbarSources(){const e=this.viewModel.layerItems.toArray().filter(e=>{const{parent:t}=e;return!(t&&(d(t)||n(t))&&!t.visible)&&e.visible});this._selectionToolbar.sources=e}_onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e}=this.viewModel;this._observerNode&&"ready"===e&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){const{featureCount:e,featurePage:t,featureSpatialItems:i,state:r}=this.viewModel;e||i.length||1===t?"ready"===r&&this.viewModel.featurePage++:this.viewModel.featurePage=1}_renderContent(){const{state:e,filterOptionsVisible:t}=this.viewModel;return"loading"===e?this._renderLoading():t?this._renderFilterOptions():[this._renderSelectionToolbar(),this._renderListContent()]}_renderListContent(){return this._selectionToolbar.activeOperation?.processingFinalSelection?this._renderLoading():this.selectedLayer||this.viewModel.featureSpatialItems.length?this._renderFeatures():this._renderLayers()}_renderSelectionToolbar(){const{messagesCommon:e,_selectionToolbar:t}=this,{featureSpatialItems:i,selectedLayer:r}=this.viewModel;if(r||!t.sources?.length)return null;const s=y("div",{class:C.spatialSelectToolbar},t.render()),l=y("calcite-button",{appearance:"transparent",disabled:!i.length,label:e.clear,onclick:()=>this.viewModel.reset()},e.clear);return y("div",{class:C.spatialSelectContainer,key:"spatial-select-toolbar"},s,l)}_renderStickyLoading(){return"querying"===this.viewModel.state?y("div",{class:C.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoading(){return y("div",{class:C.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return y("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return y("div",{class:C.filterOptionsContainer},y("div",{class:C.filterOptionsHeader},y("span",null,this.messagesFilterBuilder.widgetLabel),y("calcite-button",{appearance:"transparent",onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){const e=this.messagesFeatureForm.associations,t=e.availableLayers,i=e.filterLayers;return y("div",null,this._renderHeader({heading:t,placeholder:i,renderFilterOptions:!1,renderTotal:!1}),y("div",{class:C.listContainer},y("calcite-list",{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){const{_layerFilterText:e,viewModel:t,messagesCommon:i}=this,{layerItems:r,tableItems:s}=t;return r.concat(s).map(e=>({label:e.title??i.untitled,layer:e})).filter(t=>t.label?.toLowerCase().includes(e)??!1).toArray().map(e=>this._renderLayerItem(e))}_renderLayerItem(e){const{label:t,layer:i}=e;return y("calcite-list-item",{key:`layer-item-${i.id}`,label:l(t),onCalciteListItemSelect:()=>{this.selectedLayer=i,this._filterBuilder.reset()}},y("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderFeatures(){const{selectedLayer:e,viewModel:t}=this,i=t.featureSpatialItems.length>0,r=this.messagesFeatureForm.associations,s=i?void 0:e?.title||this.messagesCommon.untitled,l=r.filterFeatures;return y("div",null,this._renderHeader({heading:s,placeholder:l,renderFilterOptions:!i,renderTotal:!0}),y("div",{class:C.listContainer},y("calcite-list",{label:r.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItemsPage.map(e=>this._renderFeatureItem(e))}_renderFeatureItem(e){const{viewModel:t}=this,{highlightHelper:i}=t,{label:r,graphic:s}=e,o=t.featureSpatialItems.length>0?()=>i?.update(s,c):void 0,a=t.featureSpatialItems.length>0?()=>i?.update(s,u):void 0;return y("calcite-list-item",{key:`feature-item-${s.uid}`,label:l(r),onmouseenter:o,onmouseleave:a,onCalciteListItemSelect:()=>{this.selectedFeature={feature:s,label:r}}},y("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return y("div",{afterCreate:this._onObserverCreate,bind:this,class:C.featureObserver,key:"feature-observer"})}_renderHeader(e){return y("div",{class:C.header,key:"filter"},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?y(f,{key:"title",level:this.headingLevel},y("div",{class:C.headingContent},y("calcite-icon",{icon:"layer"}),e)):null}_renderFilter(e,t){const i=!this.selectedLayer&&!this.viewModel.featureSpatialItems.length,r=i?this._layerFilterText:this._featureFilterText;return y("div",{class:C.filterContainer,key:"filter"},y("calcite-input",{icon:"search",placeholder:e,type:"search",value:r,onCalciteInputInput:e=>{i?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){const e=this.messagesFeatureForm.associations.filterOptions;return y("calcite-action",{appearance:"transparent",icon:"sliders",indicator:!!this._filterBuilder.whereClause,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible},scale:"s",slot:"action",text:e,title:e})}_renderTotal(){const{messagesFeature:e,viewModel:i}=this,{featureCount:r,featureSpatialItems:s}=i,l=t(e.numberRecords,{number:s.length?s.length:r});return y("div",{key:"total"},l)}};e([o()],L.prototype,"filterOptionsVisible",null),e([o()],L.prototype,"headingLevel",void 0),e([o()],L.prototype,"isSelecting",null),e([o(),b("esri/t9n/common")],L.prototype,"messagesCommon",void 0),e([o(),b("esri/widgets/Editor/t9n/Editor")],L.prototype,"messagesEditor",void 0),e([o(),b("esri/widgets/Feature/t9n/Feature")],L.prototype,"messagesFeature",void 0),e([o(),b("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messagesFeatureForm",void 0),e([o(),b("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],L.prototype,"messagesFilterBuilder",void 0),e([o()],L.prototype,"selectedLayer",null),e([o({type:h})],L.prototype,"viewModel",void 0),e([o()],L.prototype,"selectedFeature",null),e([o()],L.prototype,"filterWhereClause",null),e([o()],L.prototype,"view",void 0),e([o()],L.prototype,"_filterBuilder",void 0),e([o()],L.prototype,"_featureFilterText",void 0),e([o()],L.prototype,"_layerFilterText",void 0),e([o()],L.prototype,"_observer",void 0),e([o()],L.prototype,"_featureSpatialGraphics",null),e([o()],L.prototype,"_filteredFeatureItems",null),e([o()],L.prototype,"_filteredFeatureItemsPage",null),e([o()],L.prototype,"_observerNode",void 0),L=e([a("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList")],L);const T=L;export{T as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../../../intl.js";import{watch as i,on as r,initial as s}from"../../../core/reactiveUtils.js";import{stripHTML as l}from"../../../core/string.js";import{property as o,subclass as a}from"../../../core/accessorSupport/decorators.js";import{isSubtypeGroupLayer as n,isGroupLayer as d}from"../../../layers/support/layerUtils.js";import{defaultHighlightName as c,temporaryHighlightName as u}from"../../../views/support/HighlightDefaults.js";import p from"../../Widget.js";import h from"../UtilityNetworkAssociationAddAssociationViewModel.js";import{loadCalciteComponents as m}from"../../support/componentsUtils.js";import _ from"../../support/FilterBuilder.js";import{globalCss as v}from"../../support/globalCss.js";import{Heading as f}from"../../support/Heading.js";import g from"../../support/SelectionToolbar.js";import{tsx as y,messageBundle as b}from"../../support/widget.js";import F from"../../support/SelectionToolbar/VisibleElements.js";const w="esri-feature-form-utility-network-association-layers",C={base:w,header:`${w}__header`,headingContent:`${w}__heading-content`,featureObserver:`${w}__feature-observer`,filterContainer:`${w}__filter-container`,filterOptionsContainer:`${w}__filter-options-container`,filterOptionsHeader:`${w}__filter-options-header`,listContainer:`${w}__list-container`,spatialSelectContainer:`${w}__spatial-select-container`,spatialSelectToolbar:`${w}__spatial-select-toolbar`,stickySpinnerContainer:`${w}__sticky-loading-container`,loadingContainer:`${w}__loading-container`};let L=class extends p{constructor(e,t){super(e,t),this.headingLevel=5,this.messagesCommon=null,this.messagesEditor=null,this.messagesFeature=null,this.messagesFeatureForm=null,this.messagesFilterBuilder=null,this.viewModel=new h,this.view=null,this._filterBuilder=new _,this._featureFilterText="",this._layerFilterText="",this._observer=new IntersectionObserver(([e])=>{e?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._observerNode=null,this._selectionToolbar=new g({returnFeatureTitleFields:!0,layerViewPreferenceEnabled:!1,persistSelection:!1,visibleElements:new F({chip:!1,operationTypeControls:!1,pan:!1})}),this._onSelectionComplete=async e=>{const{highlightHelper:t}=this.viewModel;await this.viewModel.onSelectionComplete(e),t?.removeAll(),this._featureSpatialGraphics.length>0&&t?.add(this._featureSpatialGraphics)}}initialize(){this._setupSelectionToolbar(),this.addHandles([i(()=>this.viewModel,()=>this.reset()),i(()=>[this.viewModel.state,this._observerNode],()=>this._onObserverChange()),i(()=>this.selectedLayer,e=>{this._filterBuilder.layer=e,e||(this.filterOptionsVisible=!1,this._featureFilterText="")})])}loadDependencies(){return m({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),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")})}destroy(){this._filterBuilder.destroy(),this._selectionToolbar.destroy()}get filterOptionsVisible(){return this.viewModel.filterOptionsVisible}set filterOptionsVisible(e){this.viewModel.filterOptionsVisible=e}get isSelecting(){return"active"===this._selectionToolbar.state}get selectedLayer(){return this.viewModel.selectedLayer}set selectedLayer(e){this.viewModel.selectedLayer=e}get selectedFeature(){return this.viewModel.selectedFeature}set selectedFeature(e){this.viewModel.selectedFeature=e}get filterWhereClause(){return this.viewModel.filterWhereClause}set filterWhereClause(e){this.viewModel.filterWhereClause=e,e||this._filterBuilder.reset()}get _featureSpatialGraphics(){return this.viewModel.featureSpatialItems.toArray().map(e=>e.feature)}get _filteredFeatureItems(){const{_featureFilterText:e}=this,{featureItems:t,featureSpatialItems:i}=this.viewModel;return(i.length?i:t).map(e=>({label:e.label,graphic:e.feature,layer:e.feature.sourceLayer})).filter(t=>t.label?.toLowerCase().includes(e)??!1)}get _filteredFeatureItemsPage(){const{featurePage:e,featuresPerPage:t}=this.viewModel,i=e*t;return this._filteredFeatureItems.toArray().slice(0,i)}render(){return y("div",{class:this.classes(C.base,v.widget)},this._renderContent())}applyFilterOptions(){const{selectedLayer:e}=this;this.filterOptionsVisible=!1,e&&(this.filterWhereClause=this._filterBuilder.whereClause)}cancelSelection(){this._selectionToolbar.cancel()}reset(){this.filterWhereClause=null,this._featureFilterText="",this._layerFilterText="",this.filterOptionsVisible=!1,this._filterBuilder.reset()}startSelection(e){this._selectionToolbar.activateTool(e)}_setupSelectionToolbar(){this.addHandles([i(()=>this.view,e=>{this.viewModel.reset(),this._selectionToolbar.view="2d"===e?.type?e:null},s),i(()=>[this.viewModel,this.viewModel.layerItems.length,this.viewModel.map?.allLayers.map(e=>e.visible),this.viewModel.map?.allLayers?.filter(e=>n(e)).toArray().flatMap(e=>e.sublayers.toArray()).map(e=>e.visible)],()=>this._updateToolbarSources()),r(()=>this._selectionToolbar,"before-activate",e=>this.emit("before-selection",e)),r(()=>this._selectionToolbar,"complete",this._onSelectionComplete)])}_updateToolbarSources(){const e=this.viewModel.layerItems.toArray().filter(e=>{const{parent:t}=e;return!(t&&(d(t)||n(t))&&!t.visible)&&e.visible});this._selectionToolbar.sources=e}_onObserverChange(){this._observerNode&&this._observer.unobserve(this._observerNode);const{state:e}=this.viewModel;this._observerNode&&"ready"===e&&this._observer.observe(this._observerNode)}_increaseFeaturePage(){const{featureCount:e,featurePage:t,featureSpatialItems:i,state:r}=this.viewModel;e||i.length||1===t?"ready"===r&&this.viewModel.featurePage++:this.viewModel.featurePage=1}_renderContent(){const{state:e,filterOptionsVisible:t}=this.viewModel;return"loading"===e?this._renderLoading():t?this._renderFilterOptions():[this._renderSelectionToolbar(),this._renderListContent()]}_renderListContent(){return this._selectionToolbar.activeOperation?.processingFinalSelection?this._renderLoading():this.selectedLayer||this.viewModel.featureSpatialItems.length?this._renderFeatures():this._renderLayers()}_renderSelectionToolbar(){const{messagesCommon:e,_selectionToolbar:t}=this,{featureSpatialItems:i,selectedLayer:r}=this.viewModel;if(r||!t.sources?.length)return null;const s=y("div",{class:C.spatialSelectToolbar},t.render()),l=y("calcite-button",{appearance:"transparent",disabled:!i.length,label:e.clear,onclick:()=>this.viewModel.reset()},e.clear);return y("div",{class:C.spatialSelectContainer,key:"spatial-select-toolbar"},s,l)}_renderStickyLoading(){return"querying"===this.viewModel.state?y("div",{class:C.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoading(){return y("div",{class:C.loadingContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return y("calcite-loader",{inline:!0,label:this.messagesCommon.loading})}_renderFilterOptions(){return y("div",{class:C.filterOptionsContainer},y("div",{class:C.filterOptionsHeader},y("span",null,this.messagesFilterBuilder.widgetLabel),y("calcite-button",{appearance:"transparent",onclick:()=>this._filterBuilder.reset()},this.messagesCommon.clear)),this._filterBuilder.render())}_renderLayers(){const e=this.messagesFeatureForm.associations,t=e.availableLayers,i=e.filterLayers;return y("div",null,this._renderHeader({heading:t,placeholder:i,renderFilterOptions:!1,renderTotal:!1}),y("div",{class:C.listContainer},y("calcite-list",{label:e.associatedFeatures},this._renderLayerItems(),this._renderStickyLoading())))}_renderLayerItems(){const{_layerFilterText:e,viewModel:t,messagesCommon:i}=this,{layerItems:r,tableItems:s}=t;return r.concat(s).map(e=>({label:e.title??i.untitled,layer:e})).filter(t=>t.label?.toLowerCase().includes(e)??!1).toArray().map(e=>this._renderLayerItem(e))}_renderLayerItem(e){const{label:t,layer:i}=e;return y("calcite-list-item",{key:`layer-item-${i.id}`,label:l(t),onCalciteListItemSelect:()=>{this.selectedLayer=i,this._filterBuilder.reset()}},y("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderFeatures(){const{selectedLayer:e,viewModel:t}=this,i=t.featureSpatialItems.length>0,r=this.messagesFeatureForm.associations,s=i?void 0:e?.title||this.messagesCommon.untitled,l=r.filterFeatures;return y("div",null,this._renderHeader({heading:s,placeholder:l,renderFilterOptions:!i,renderTotal:!0}),y("div",{class:C.listContainer},y("calcite-list",{label:r.associatedFeatures},this._renderFeatureItems(),this._renderStickyLoading(),this._renderFeatureObserver())))}_renderFeatureItems(){return this._filteredFeatureItemsPage.map(e=>this._renderFeatureItem(e))}_renderFeatureItem(e){const{viewModel:t}=this,{highlightHelper:i}=t,{label:r,graphic:s}=e,o=t.featureSpatialItems.length>0?()=>i?.update(s,c):void 0,a=t.featureSpatialItems.length>0?()=>i?.update(s,u):void 0;return y("calcite-list-item",{key:`feature-item-${s.uid}`,label:l(r),onmouseenter:o,onmouseleave:a,onCalciteListItemSelect:()=>{this.selectedFeature={feature:s,label:r}}},y("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_onObserverCreate(e){this._observerNode=e}_renderFeatureObserver(){return y("div",{afterCreate:this._onObserverCreate,bind:this,class:C.featureObserver,key:"feature-observer"})}_renderHeader(e){return y("div",{class:C.header,key:"filter"},this._renderHeading(e.heading),this._renderFilter(e.placeholder,e.renderFilterOptions),e.renderTotal?this._renderTotal():null)}_renderHeading(e){return e?y(f,{key:"title",level:this.headingLevel},y("div",{class:C.headingContent},y("calcite-icon",{icon:"layer"}),e)):null}_renderFilter(e,t){const i=!this.selectedLayer&&!this.viewModel.featureSpatialItems.length,r=i?this._layerFilterText:this._featureFilterText;return y("div",{class:C.filterContainer,key:"filter"},y("calcite-input",{icon:"search",placeholder:e,type:"search",value:r,onCalciteInputInput:e=>{i?this._layerFilterText=e.currentTarget.value.trim().toLowerCase():this._featureFilterText=e.currentTarget.value.trim().toLowerCase()}},t?this._renderFilterOptionsAction():null))}_renderFilterOptionsAction(){const e=this.messagesFeatureForm.associations.filterOptions;return y("calcite-action",{icon:"sliders",indicator:!!this._filterBuilder.whereClause,onclick:()=>{this.viewModel.filterOptionsVisible=!this.viewModel.filterOptionsVisible},slot:"action",text:e,title:e})}_renderTotal(){const{messagesFeature:e,viewModel:i}=this,{featureCount:r,featureSpatialItems:s}=i,l=t(e.numberRecords,{number:s.length?s.length:r});return y("div",{key:"total"},l)}};e([o()],L.prototype,"filterOptionsVisible",null),e([o()],L.prototype,"headingLevel",void 0),e([o()],L.prototype,"isSelecting",null),e([o(),b("esri/t9n/common")],L.prototype,"messagesCommon",void 0),e([o(),b("esri/widgets/Editor/t9n/Editor")],L.prototype,"messagesEditor",void 0),e([o(),b("esri/widgets/Feature/t9n/Feature")],L.prototype,"messagesFeature",void 0),e([o(),b("esri/widgets/FeatureForm/t9n/FeatureForm")],L.prototype,"messagesFeatureForm",void 0),e([o(),b("esri/widgets/support/FilterBuilder/t9n/FilterBuilder")],L.prototype,"messagesFilterBuilder",void 0),e([o()],L.prototype,"selectedLayer",null),e([o({type:h})],L.prototype,"viewModel",void 0),e([o()],L.prototype,"selectedFeature",null),e([o()],L.prototype,"filterWhereClause",null),e([o()],L.prototype,"view",void 0),e([o()],L.prototype,"_filterBuilder",void 0),e([o()],L.prototype,"_featureFilterText",void 0),e([o()],L.prototype,"_layerFilterText",void 0),e([o()],L.prototype,"_observer",void 0),e([o()],L.prototype,"_featureSpatialGraphics",null),e([o()],L.prototype,"_filteredFeatureItems",null),e([o()],L.prototype,"_filteredFeatureItemsPage",null),e([o()],L.prototype,"_observerNode",void 0),L=e([a("esri.widgets.FeatureForm.FeatureFormUtilityNetworkAssociations.UtilityNetworkAssociationItemList")],L);const T=L;export{T as default};
|
package/widgets/FeatureForm.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../intl.js";import{isSome as o}from"../core/arrayUtils.js";import"../core/has.js";import s from"../core/Logger.js";import{createResolver as n}from"../core/promiseUtils.js";import a from"../core/ReactiveMap.js";import{watch as r,whenOnce as l,initial as d}from"../core/reactiveUtils.js";import{property as c,subclass as u}from"../core/accessorSupport/decorators.js";import{isIntegerField as p}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as m,getSubtypesFromLayer as h}from"../layers/support/layerUtils.js";import{isString as v}from"../support/guards.js";import _ from"./Widget.js";import{Prompt as g}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as b}from"./Feature/support/featureUtils.js";import{css as f}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as y,isGroupInput as C,isFieldInput as F,isRelationshipInput as w,isTextElementInput as R,flattenInputs as k,isInputInGroupInput as I,isFieldElementWithInputType as O,getErrorMessageForFieldInput as N,getIconForFeature as M,isNumberFieldInput as L,isInputInThisGroupInput as T,subtypeChangeShouldPrompt as A}from"./FeatureForm/featureFormUtils.js";import x from"./FeatureForm/FeatureFormViewModel.js";import D from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as V}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as S,getIntlOptionsForField as U,numberingSystem as E,prepareISOFieldValueForDateComponents as $,prepareUnixFieldValueForDateComponents as j,normalizeTimeOnlyString as P,getISOFieldValueFromDateComponents as G,getUnixFieldValueFromDateComponents as H}from"./support/dateUtils.js";import{globalCss as W}from"./support/globalCss.js";import{Heading as Z,incrementHeadingLevel as B}from"./support/Heading.js";import{messageBundle as K,vmEvent as q,tsx as z}from"./support/widget.js";import{setFocus as J}from"./support/widgetUtils.js";const Q="data-field-name";let X=class extends _{constructor(e,t){super(e,t),this._associationsWidgetsMap=new a,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()},{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new x,this.visibleElements=new D,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(m(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&b(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),this._afterGroupCreate=this._afterGroupCreate.bind(this)}initialize(){this.addHandles([r(()=>this.feature,()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),l(()=>!this.viewModel.updating).then(()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0})}),r(()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails],([e,t])=>{e&&(e.visibleElements.associationDetails=t)},d),r(()=>this.groupDisplay,()=>this._syncGroupInputStates()),this.on("submit",e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach(e=>this._inputsWithChanges.add(e)),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}}),r(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),r(()=>this.viewModel.activeAssociationInput,e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}),r(()=>this.viewModel.inputs.filter(y),async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))})])}loadDependencies(){return V({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),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"),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-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"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"),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"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return h(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return"form-field"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return z("div",{class:this.classes(f.base,W.widget,W.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return z("div",null,z("form",{class:f.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderReadOnlyNotice(),this._renderHeader(),this._renderContent()),this._prompt?z(g,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderReadOnlyNotice(){const{disabled:e,messages:t}=this;if(e&&this.visibleElements.readOnlyNotice)return z("calcite-notice",{class:f.disabledNotice,icon:"read-only-non-editable",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},t.disabledForm))}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&z(Z,{key:"title",level:this.headingLevel},t),s=null!=i&&z("p",{class:f.description,key:"description"},i);return z("div",{class:f.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(o).filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return C(e)?this._renderGroup(e):F(e)?this._renderLabeledField(e):w(e)?this._renderRelationshipInput(e):R(e)?this._renderTextElementInput(e):y(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:z("div",{class:this.classes(f.description),id:t},e)}_renderGroup(e){const{formTemplate:t,headingLevel:i}=this,{description:o,id:s,inputs:n,label:a,open:r}=e,l=n.filter(e=>e.visible),d=this.viewModel.findField(this._focusedFieldName),c=d?.group===e,u="sequential"===this.groupDisplay;return z("calcite-block",{afterCreate:this._afterGroupCreate,class:this.classes(f.group,u?f.groupSequential:null,c?f.groupActive:null),collapsible:!0,"data-group":e,description:o||void 0,expanded:r,heading:a??"",headingLevel:t?.title?B(i):i,id:s,key:s,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},l.map(e=>this._renderInput(e)))}_getFocusableInput(e,t){const i=k(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(C(t)){const e=t.inputs.find(e=>e.visible);o=e?i.indexOf(e):0}else{let s;if(I(t)&&!t.group.open){const i=t.group.inputs.filter(F);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&F(e)){if(this.disabled&&e.inputType&&("switch"===e.inputType||"radio-buttons"===e.inputType))continue;return e}}return null}_renderLabeledField(e){const{dataType:i,feature:o,label:s,layer:n,required:a}=e,r={"aria-label":a?t(this.messages.requiredFieldLabel,{name:s}):s,class:f.label,key:`${n.id}-${o.uid}-${e.name}`},l=[z("div",{class:f.labelTextContent,key:"labelTextContainer"},s,a?z("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==i?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===i&&"coded-value"!==e.domain?.type?z("label",{...r},l):z("calcite-label",{...r},l)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?z("calcite-input",{...t,loading:e.updating,type:"textarea",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=p(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return z("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.type){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,S(i,t.value,{timeZone:this.timeZone,...U(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return z("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[Q],key:`${a}-date-input`,max:v(l)?l:void 0,min:v(d)?d:void 0,numberingSystem:E,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return z("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[Q],key:`${n}-time-input`,numberingSystem:E,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:E,overlayPositioning:"fixed",readOnly:d,[Q]:i,onfocus:this._onComponentFocus},m=$(c,s),h=$(u,s),v=$(a,s);return z("div",{class:f.dateInputContainer,key:`${l}-date-time-container`},z("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),z("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?z("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:E,overlayPositioning:"fixed",readOnly:c,[Q]:o,onfocus:this._onComponentFocus},m=j(n,u),h=j(l,u),v=j(d,u);return z("div",{class:f.dateInputContainer,key:`${r}-date-time-container`},z("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?z("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return z("calcite-input",{...i,class:this.classes(f.fieldInput,f.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.editType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return z("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map(e=>e.map(({name:e,value:t})=>z("calcite-combobox-item",{key:`#${t}`,selected:i===t,textLabel:e,value:`${t}`}))),u=[];d.length>0&&u.push(z("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(z("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(z("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.editType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(z("calcite-combobox-item",{key:"empty-option",selected:h,textLabel:e.showNoValueLabel||s.empty,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map(({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i}));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return z("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:f.inputRadioGroup,"data-field-name":i[Q],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!O(e.element,"switch")&&i===e.element.input.onValue;return z("calcite-switch",{...t,checked:o,class:f.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return z("calcite-label",{class:f.inputRadioLabel,key:e,layout:"inline"},z("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:f.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?N(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?z("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?z("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const i=this.messages;return z("calcite-list-item",{description:t(i.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:i.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o,editable:s}=e,{messages:n,callbacks:a,disabled:r}=this,l=!s||r;if(t&&a?.addRelatedRecord&&o&&!l)return z("calcite-button",{alignment:"center",appearance:"outline-fill",class:f.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?n.addRecord:n.addFeature)}_renderRelatedRecordListItem(e,t,i){const{feature:o,description:s,title:n}=e,{feature:a,callbacks:r}=this,{highlightHelper:l}=this.viewModel,d=()=>{l?.removeAll(),r?.editRelatedRecord&&a&&r.editRelatedRecord({parentFeature:a,relationshipId:t,relatedFeature:o,readOnly:i})},c=l?()=>l.add(o):void 0,u=l?()=>l.remove(o):void 0;return z("calcite-list-item",{bind:this,description:s,key:`${t}-${o.uid}`,label:n,onmouseenter:c,onmouseleave:u,value:n,onCalciteListItemSelect:d},z("calcite-icon",{icon:M(o),slot:"content-start"}),z("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return z("calcite-label",{class:this.classes(f.label,f.relatedRecordsLabel),key:`relationship-${t}-container`},z("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return z("calcite-list",{displayMode:"flat",label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map(t=>this._renderCategory(e,t)),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){const{count:o,name:s,value:n}=t,a=i(o);return z("calcite-list-item",{key:`${s}-${n}`,label:s,onCalciteListItemSelect:()=>this._selectCategory(e,t)},z("calcite-chip",{label:a,scale:"s",slot:"content-end"},a),z("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const i=this.messages;return z("calcite-list-item",{description:t(i.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:i.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return z("div",{class:f.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},z("span",null,e.label),t?z("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t,editable:i}=e,{disabled:o}=this,s=!i||o;return z("calcite-list",{class:f.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map(e=>this._renderRelatedRecordListItem(e,t,s)),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:i}=this,o=e.relatedLayerIsTable?i.noOriginKeyRecord:i.noOriginKeyFeature,s=e.relationship?.keyField,n=this.viewModel.findField(s),a=e.layer?.fieldsIndex.get(s),r=n?.label||a?.alias||s,l=t(o,{relatedLayerName:e.relatedLayer?.title,originKeyField:r});return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},l))}_renderNoRelatedRecordsNotice(){return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return z("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:f.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return z("div",{class:f.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(f.fieldInput,h?f.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[Q]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(Q))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver(()=>{switch(e.value=void 0,t.field.type){case"date":e.value=j(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=$(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)});i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);L(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,I(i)&&(i.group.open=!0),J(e))}async _afterGroupCreate(e){const t=this.viewModel.findGroup(e.id),i=this.viewModel.findField(this._focusedFieldName);i&&t&&T(i,t)&&(!i.editable||this.disabled)&&(await e.componentOnReady(),this._attemptFocusOnNextRender=!0,this.scheduleRender())}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=P(r),l=P(e.value)):l="timestamp-offset"===o?null!=e.value?G({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?H({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&A(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,i){const{value:o,name:s}=e,{messages:a,viewModel:r,messagesCommon:l,_subtypes:d}=this;if(this._updateFieldValue(s,i),!d?.length)return;const c=d.find(e=>e.code===i),u=d.find(e=>e.code===o)?.name??`${o}`;if(!c)return;const p=n();r.pendingSubtypeChoice=p;let m="update-fields";const h=[{label:a.subtypes.useDefaultValuesOption,value:"update-fields"},{label:a.subtypes.keepCurrentValuesOption,value:"keep-existing"}],v={context:"info",title:a.subtypes.changeWarningTitle,message:t(a.subtypes.changeWarning,{originalType:u,newType:c.name}),radios:h,defaultRadioSelection:"update-fields",onRadioSelection:e=>m=e,actions:{primary:{label:l.apply,action:()=>p.resolve(m),type:"positive"},secondary:{label:l.cancel,type:"neutral",action:()=>p.resolve("undo")}},cancel:()=>p.reject()};try{this.showPrompt(v);switch(await p.promise){case"update-fields":r.applySubtypeDefaults(c),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,o)}}finally{r.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&I(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter(([e,t])=>null!=t));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return O(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:i}=e;0===i.length&&t&&"selected"in t?t.selected=!0:s.getLogger(this).warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._focusedFieldName=this._getFocusableInput("forward",t)?.name||null,this._attemptFocusOnNextRender=!0,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter(e=>e.open);0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([c()],X.prototype,"_listObserverNode",void 0),e([c()],X.prototype,"_relatedRecordsEnabled",null),e([c()],X.prototype,"_utilityNetworkAssociationsEnabled",null),e([c()],X.prototype,"_prompt",void 0),e([c()],X.prototype,"_subtypes",null),e([c()],X.prototype,"associationId",null),e([c()],X.prototype,"associatedLayer",null),e([c()],X.prototype,"disabled",null),e([c()],X.prototype,"feature",null),e([c()],X.prototype,"_featureFormUNAssociationList",void 0),e([c()],X.prototype,"formTemplate",null),e([c()],X.prototype,"groupDisplay",void 0),e([c()],X.prototype,"headingLevel",void 0),e([c()],X.prototype,"icon",null),e([c()],X.prototype,"label",null),e([c()],X.prototype,"layer",null),e([c()],X.prototype,"map",null),e([c(),K("esri/widgets/FeatureForm/t9n/FeatureForm")],X.prototype,"messages",void 0),e([c(),K("esri/t9n/common")],X.prototype,"messagesCommon",void 0),e([c(),K("esri/widgets/Feature/t9n/Feature")],X.prototype,"messagesFeature",void 0),e([c(),K("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],X.prototype,"messagesTemplates",void 0),e([c()],X.prototype,"callbacks",null),e([c()],X.prototype,"relationshipId",null),e([c()],X.prototype,"spatialReference",null),e([c()],X.prototype,"strict",null),e([c()],X.prototype,"timeZone",null),e([c()],X.prototype,"showPrompt",null),e([c()],X.prototype,"clearPrompt",null),e([c({type:x}),q(["value-change","submit"])],X.prototype,"viewModel",void 0),e([c({type:D,nonNullable:!0})],X.prototype,"visibleElements",void 0),e([c()],X.prototype,"test",null),X=e([u("esri.widgets.FeatureForm")],X);const Y=X;export{Y as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../intl.js";import{isSome as o}from"../core/arrayUtils.js";import"../core/has.js";import s from"../core/Logger.js";import{createResolver as n}from"../core/promiseUtils.js";import a from"../core/ReactiveMap.js";import{watch as r,whenOnce as l,initial as d}from"../core/reactiveUtils.js";import{property as c,subclass as u}from"../core/accessorSupport/decorators.js";import{isIntegerField as p}from"../layers/support/fieldUtils.js";import{isSubtypeGroupLayer as m,getSubtypesFromLayer as h}from"../layers/support/layerUtils.js";import{isString as v}from"../support/guards.js";import _ from"./Widget.js";import{Prompt as g}from"./Editor/components/Prompt.js";import{isRelatableFeatureSupportedLayer as b}from"./Feature/support/featureUtils.js";import{css as f}from"./FeatureForm/css.js";import{isUtilityNetworkAssociationInput as y,isGroupInput as C,isFieldInput as F,isRelationshipInput as w,isTextElementInput as R,flattenInputs as k,isInputInGroupInput as O,isFieldElementWithInputType as I,getErrorMessageForFieldInput as N,getIconForFeature as M,isNumberFieldInput as L,isInputInThisGroupInput as T,subtypeChangeShouldPrompt as A}from"./FeatureForm/featureFormUtils.js";import x from"./FeatureForm/FeatureFormViewModel.js";import D from"./FeatureForm/VisibleElements.js";import{loadCalciteComponents as V}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as S,getIntlOptionsForField as U,numberingSystem as E,prepareISOFieldValueForDateComponents as $,prepareUnixFieldValueForDateComponents as j,normalizeTimeOnlyString as P,getISOFieldValueFromDateComponents as G,getUnixFieldValueFromDateComponents as H}from"./support/dateUtils.js";import{globalCss as W}from"./support/globalCss.js";import{Heading as Z,incrementHeadingLevel as B}from"./support/Heading.js";import{messageBundle as K,vmEvent as q,tsx as z}from"./support/widget.js";import{setFocus as J}from"./support/widgetUtils.js";const Q="data-field-name";let X=class extends _{constructor(e,t){super(e,t),this._associationsWidgetsMap=new a,this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._inputsWithChanges=new Set,this._focusedFieldName=null,this._pendingSubtypeChoice=null,this._listObserverNode=null,this._listObserver=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this._incrementRelatedRecordPage()},{root:window.document}),this._prompt=null,this._featureFormUNAssociationList=null,this.groupDisplay="all",this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesFeature=null,this.messagesTemplates=null,this.viewModel=new x,this.visibleElements=new D,this._onShowAllRelatedRecordsClick=e=>{const{feature:t,callbacks:i}=this;t&&i?.showAllRelatedRecords&&i.showAllRelatedRecords({parentFeature:t,relationshipId:e})},this._onAddRelatedRecordsClick=(e,t,i)=>{const{feature:o,callbacks:s}=this;let n=i;if(o&&s?.addRelatedRecord){if(m(i)&&e.activeCategory){const t=e.activeCategory.value,o=i.findSublayerForSubtypeCode(t);o&&b(o)&&(n=o)}s.addRelatedRecord({parentFeature:o,relatedLayer:n,relationshipId:t})}},this._onFormKeyDown=this._onFormKeyDown.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onGroupToggle=this._onGroupToggle.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentKeyDown=this._onComponentKeyDown.bind(this),this._afterComponentCreate=this._afterComponentCreate.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentCreateOrUpdate=this._afterDateComponentCreateOrUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this),this._afterGroupCreate=this._afterGroupCreate.bind(this)}initialize(){this.addHandles([r(()=>this.feature,()=>{this._inputsWithChanges.clear(),this._dateComponentMap.clear(),l(()=>!this.viewModel.updating).then(()=>{const e=this._getFocusableInput("forward");this._syncGroupInputStates(),this._focusedFieldName=e?.name||null,this._attemptFocusOnNextRender=!0})}),r(()=>[this._featureFormUNAssociationList,this.visibleElements.associationDetails],([e,t])=>{e&&(e.visibleElements.associationDetails=t)},d),r(()=>this.groupDisplay,()=>this._syncGroupInputStates()),this.on("submit",e=>{if(e.invalid.length>0){const[t]=e.invalid;e.invalid.forEach(e=>this._inputsWithChanges.add(e)),this._focusedFieldName=t,this._attemptFocusOnNextRender=!0,this.scheduleRender()}}),r(()=>[this.viewModel.activeRelationshipInput,this._listObserverNode],()=>this._onObserverChange()),r(()=>this.viewModel.activeAssociationInput,e=>{e&&this._featureFormUNAssociationList&&(this._featureFormUNAssociationList.associationInput=e,this._featureFormUNAssociationList.viewModel=e.viewModel)}),r(()=>this.viewModel.inputs.filter(y),async e=>{this._featureFormUNAssociationList||await this._setUpUtilityNetworkAssociationList();for(const t of e)this._associationsWidgetsMap.has(t)||this._associationsWidgetsMap.set(t,await this._makeAssociationsWidget(t))})])}loadDependencies(){return V({block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),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"),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-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),"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"),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"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area")})}destroy(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode)}get _relatedRecordsEnabled(){const{callbacks:e}=this;return!(!e||!(e.addRelatedRecord||e.editRelatedRecord||e.showAllRelatedRecords))}get _utilityNetworkAssociationsEnabled(){const{callbacks:e}=this;return!(!e?.viewAssociatedLayers||!e.viewAssociatedFeatures)}get _subtypes(){return h(this.layer)}get associationId(){return this.viewModel.associationId}set associationId(e){this.viewModel.associationId=e}get associatedLayer(){return this.viewModel.associatedLayer}set associatedLayer(e){this.viewModel.associatedLayer=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get feature(){return this.viewModel.feature}set feature(e){this.viewModel.feature=e}get formTemplate(){return this.viewModel.formTemplate}set formTemplate(e){this.viewModel.formTemplate=e}get icon(){return"form-field"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get callbacks(){return this.viewModel.callbacks}set callbacks(e){this.viewModel.callbacks=e}get relationshipId(){return this.viewModel.relationshipId}set relationshipId(e){this.viewModel.relationshipId=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get strict(){return this.viewModel.strict}set strict(e){this.viewModel.strict=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get showPrompt(){return e=>{this._prompt?.cancel?.(),this._prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get clearPrompt(){return()=>this._prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}getValues(){return this.viewModel.getValues()}submit(){return this.viewModel.submit()}render(){const{state:e}=this.viewModel;return z("div",{class:this.classes(f.base,W.widget,W.panel)},"ready"===e?this._renderForm():null)}_renderForm(){return z("div",null,z("form",{class:f.form,inert:!!this._prompt,novalidate:!0,onkeydown:this._onFormKeyDown,onsubmit:this._onFormSubmit},this._renderReadOnlyNotice(),this._renderHeader(),this._renderContent()),this._prompt?z(g,{...this._prompt,headingLevel:this.headingLevel}):void 0)}_renderReadOnlyNotice(){const{disabled:e,messages:t}=this;if(e&&this.visibleElements.readOnlyNotice)return z("calcite-notice",{class:f.disabledNotice,icon:"read-only-non-editable",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},t.disabledForm))}_renderHeader(){const e=this.viewModel,{formTitle:t,formDescription:i}=e;if(!e.formHeaderVisible)return;const o=null!=t&&z(Z,{key:"title",level:this.headingLevel},t),s=null!=i&&z("p",{class:f.description,key:"description"},i);return z("div",{class:f.formHeader},o,s)}_renderContent(){const{viewModel:e}=this;return e.activeRelationshipInput?this._renderRelationshipInput(e.activeRelationshipInput):e.activeAssociationInput?this._renderFeatureFormUtilityNetworkAssociationList():e.inputs.filter(o).filter(e=>e.visible).map(e=>this._renderInput(e))}_renderInput(e){return C(e)?this._renderGroup(e):F(e)?this._renderLabeledField(e):w(e)?this._renderRelationshipInput(e):R(e)?this._renderTextElementInput(e):y(e)?this._renderUtilityNetworkAssociationsElementInput(e):void 0}_renderFeatureFormUtilityNetworkAssociationList(){return this._featureFormUNAssociationList?.render()}_selectAssociatedLayer(e){const{feature:t,callbacks:i}=this;t&&i?.viewAssociatedFeatures&&i.viewAssociatedFeatures({associatedLayer:e.layer})}async _selectAssociatedFeature(e){const{feature:t,callbacks:i}=this;t&&i?.selectAssociatedFeature&&await i.selectAssociatedFeature({parentFeature:t,...e})}_onAddAssociation(e){const{feature:t,callbacks:i}=this;t&&i?.addAssociation&&i.addAssociation(e)}async _setUpUtilityNetworkAssociationList(){if(!this._featureFormUNAssociationList){const e=(await import("./FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js")).default;this._featureFormUNAssociationList=new e({onSelectLayer:this._selectAssociatedLayer.bind(this),onSelectFeature:this._selectAssociatedFeature.bind(this),onAddAssociation:this._onAddAssociation.bind(this)})}}async _makeAssociationsWidget(e){return new(0,(await import("./Feature/FeatureUtilityNetworkAssociations.js")).default)({onSelectAssociationType:({viewModel:t,listType:i})=>{t.activeAssociationType=i;const{feature:o,callbacks:s}=this;o&&s?.viewAssociatedLayers&&s.viewAssociatedLayers({associationId:e.uid})},viewModel:e.associationsViewModel})}_renderUtilityNetworkAssociationsElementInput(e){if(this._utilityNetworkAssociationsEnabled)return this._associationsWidgetsMap.get(e)?.render()}_renderDescriptionOrEmpty(e,t){return null==e?null:z("div",{class:this.classes(f.description),id:t},e)}_renderGroup(e){const{formTemplate:t,headingLevel:i}=this,{description:o,id:s,inputs:n,label:a,open:r}=e,l=n.filter(e=>e.visible),d=this.viewModel.findField(this._focusedFieldName),c=d?.group===e,u="sequential"===this.groupDisplay;return z("calcite-block",{afterCreate:this._afterGroupCreate,class:this.classes(f.group,u?f.groupSequential:null,c?f.groupActive:null),collapsible:!0,"data-group":e,description:o||void 0,expanded:r,heading:a??"",headingLevel:t?.title?B(i):i,id:s,key:s,onCalciteBlockToggle:({currentTarget:t})=>this._onGroupToggle(t,e)},l.map(e=>this._renderInput(e)))}_getFocusableInput(e,t){const i=k(this.viewModel.inputs);let o;if("backward"===e&&i.reverse(),t)if(C(t)){const e=t.inputs.find(e=>e.visible);o=e?i.indexOf(e):0}else{let s;if(O(t)&&!t.group.open){const i=t.group.inputs.filter(F);s="forward"===e?i[i.length-1]:i[0]}else s=t;o=i.indexOf(s)+1}else o=0;for(let s=o;s<i.length;s++){const e=i[s];if(e.visible&&F(e)){if(this.disabled&&e.inputType&&("switch"===e.inputType||"radio-buttons"===e.inputType))continue;return e}}return null}_renderLabeledField(e){const{dataType:i,feature:o,label:s,layer:n,required:a}=e,r={"aria-label":a?t(this.messages.requiredFieldLabel,{name:s}):s,class:f.label,key:`${n.id}-${o.uid}-${e.name}`},l=[z("div",{class:f.labelTextContent,key:"labelTextContainer"},s,a?z("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==i?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e)];return"date"===i&&"coded-value"!==e.domain?.type?z("label",{...r},l):z("calcite-label",{...r},l)}_renderFieldInput(e){const{dataType:t,domain:i,inputType:o,name:s}=e,n=this.getCommonInputProps(e);if("coded-value"===i?.type){const t=this.viewModel.getFieldValueOptionsForField(s,this.messages.empty);return"switch"!==o||e.hasInvalidSwitchValue?"radio-buttons"===o?this._renderRadioButtonComponents(e,t.flat(),n):this._renderComboBoxComponent(e,t,n):this._renderSwitchComponent(e,n)}return"datetime-picker"===o||"date"===t?this._renderDateComponents(e,n):"number"===t?this._renderNumberComponent(e,n):this._renderStringComponent(e,n)}_renderStringComponent(e,t){return"text-area"===e.inputType?t.readOnly?z("calcite-text-area",{...t,onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-text-area",{...t,resize:"vertical",onCalciteTextAreaInput:e=>this._saveValueFromComponent(e.currentTarget)}):z("calcite-input",{...t,loading:e.updating,type:"text",onCalciteInputInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderNumberComponent(e,t){const i=p(e.field),o=i&&""!==t.value?Math.round(parseFloat(t.value)).toString():t.value;return z("calcite-input-number",{...t,integer:i,loading:e.updating,type:"number",value:o,onCalciteInputNumberInput:e=>this._saveValueFromComponent(e.currentTarget)})}_renderDateComponents(e,t){const{field:i}=e;switch(i.type){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,S(i,t.value,{timeZone:this.timeZone,...U(i)}))}}_renderDateOnlyFieldComponent(e,t){const{range:i,valid:o,value:s}=e,{class:n,key:a,readOnly:r}=t,{rawMax:l,rawMin:d}=i;return z("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!o,class:n,"data-date-part":"date","data-field-name":t[Q],key:`${a}-date-input`,max:v(l)?l:void 0,min:v(d)?d:void 0,numberingSystem:E,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:r,value:null!=s?`${s}`:void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{valid:i,value:o}=e,{class:s,key:n,readOnly:a}=t;return z("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!i,class:s,"data-date-part":"time","data-field-name":t[Q],key:`${n}-time-input`,numberingSystem:E,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:a,step:e.timeStep,value:null!=o?`${o}`:void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{name:i,range:o,timeZone:s,valid:n,value:a}=e,{class:r,key:l,readOnly:d}=t,{rawMax:c,rawMin:u}=o,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!n,numberingSystem:E,overlayPositioning:"fixed",readOnly:d,[Q]:i,onfocus:this._onComponentFocus},m=$(c,s),h=$(u,s),v=$(a,s);return z("div",{class:f.dateInputContainer,key:`${l}-date-time-container`},z("calcite-input-date-picker",{...p,class:r,"data-date-part":"date",key:`${l}-date-input`,max:m?.date??void 0,min:h?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),z("calcite-input-time-picker",{...p,class:r,"data-date-part":"time",key:`${l}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:e.timeStep,value:v.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),e.includeTimeOffset?z("calcite-input-time-zone",{...p,class:r,"data-date-part":"timeZone",disabled:d,key:`${l}-timezone-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:v.timeZoneOffset??"0",onCalciteInputTimeZoneChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderDateFieldComponents(e,t){const{includeTime:i,name:o,valid:s,value:n}=e,{class:a,key:r,max:l,min:d,readOnly:c}=t,{timeZone:u}=this,p={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentCreateOrUpdate,"aria-invalid":!s,numberingSystem:E,overlayPositioning:"fixed",readOnly:c,[Q]:o,onfocus:this._onComponentFocus},m=j(n,u),h=j(l,u),v=j(d,u);return z("div",{class:f.dateInputContainer,key:`${r}-date-time-container`},z("calcite-input-date-picker",{...p,class:a,"data-date-part":"date",key:`${r}-date-input`,max:h?.date??void 0,min:v?.date??void 0,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},value:m.date??void 0,onCalciteInputDatePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}),i?z("calcite-input-time-picker",{...p,class:a,"data-date-part":"time",key:`${r}-time-input`,onblur:e=>{this._focusedFieldName=null,this._saveValueFromDateComponent(e.target)},step:1,value:m.time??void 0,onCalciteInputTimePickerChange:e=>this._saveValueFromDateComponent(e.currentTarget)}):null)}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return z("calcite-input",{...i,class:this.classes(f.fieldInput,f.inputDisabled),readOnly:!0,type:"text",value:null!=t?`${t}`:i.value})}_renderComboBoxComponent(e,t,i){const{value:o,name:s}=e,{viewModel:n,_inputsWithChanges:a}=this,r="INSERT"===n.editType,l=a.has(s),d=null==o&&(!r||l),c=r&&e.showNoValueOptionEnabled&&!l?()=>{}:i.onblur;return z("calcite-combobox",{...i,allowCustomValues:!1,clearDisabled:!0,onblur:c,overlayPositioning:"fixed",selectionMode:"single",onCalciteComboboxChange:({currentTarget:t})=>{d&&0===t.selectedItems.length?this._ignoreDeselectionOfNoValueOption(t):e.isSubtypeField&&0===t.selectedItems.length?t.value=`${e.value}`:this._saveValueFromComponent(t)}},this.renderComboboxOptionsList(e,t))}renderComboboxOptionsList(e,t){const{value:i,name:o}=e,{messages:s,messagesTemplates:n,viewModel:a,_inputsWithChanges:r}=this,[l,d,c]=t.map(e=>e.map(({name:e,value:t})=>z("calcite-combobox-item",{heading:e,key:`#${t}`,selected:i===t,value:`${t}`}))),u=[];d.length>0&&u.push(z("calcite-combobox-item-group",{key:"other",label:n.other},d)),c.length>0&&u.push(z("calcite-combobox-item-group",{key:"unsupported",label:s.subtypes.unsupportedDomainGroupTitle},c)),u.length>0?u.unshift(z("calcite-combobox-item-group",{key:"recommended",label:s.recommended},l)):u.push(...l);const p="INSERT"===a.editType,m=r.has(o),h=null==i&&(!p||m);return e.showNoValueOptionEnabled&&u.unshift(z("calcite-combobox-item",{heading:e.showNoValueLabel||s.empty,key:"empty-option",selected:h,value:""})),u}_renderRadioButtonComponents(e,t,i){const{name:o,value:s}=e,n=t.map(({name:e,value:t})=>this._renderRadioButtonComponent({key:e,label:e,name:o,value:t,selected:t===s,props:i}));if(e.showNoValueOptionEnabled){const t="",a=e.showNoValueLabel||this.messages.empty,r=s===t||null===s;n.unshift(this._renderRadioButtonComponent({key:"empty-option",label:a,name:o,value:t,selected:r,props:i}))}return z("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:f.inputRadioGroup,"data-field-name":i[Q],key:`${i.key}-radio-group`,layout:"vertical",name:i.key,required:i.required},n)}_renderSwitchComponent(e,t){const{value:i}=e,o=!!I(e.element,"switch")&&i===e.element.input.onValue;return z("calcite-switch",{...t,checked:o,class:f.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldName=null},onCalciteSwitchChange:e=>this._saveValueFromComponent(e.currentTarget)})}_renderRadioButtonComponent({key:e,name:t,value:i,selected:o,label:s,props:n}){return z("calcite-label",{class:f.inputRadioLabel,key:e,layout:"inline"},z("calcite-radio-button",{...n,afterCreate:void 0,afterUpdate:void 0,checked:o,class:f.inputRadio,disabled:n.readOnly,name:t,onblur:()=>{this._focusedFieldName=null},value:i,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveValueFromComponent(e)}}),s)}_renderAuxiliaryText(e){const t=e.name,i=this._inputsWithChanges.has(t)&&!e.submittable?N(e,this.messages,this.timeZone):null!=this.viewModel.contingencyConstraintViolations.get(t)?this.messages.validationErrors.valuesIncompatible:null!=e.valueExpressionExecutor&&e.valueExpressionExecutor.stale?this.messages.valueExpressionError:null;return null!=i?z("calcite-input-message",{icon:!0,status:"invalid"},i):this._inputsWithChanges.has(t)&&e.valueIsOutOfDomain?z("calcite-input-message",{icon:!0,status:"idle"},this.messages.subtypes.fieldOutOfSubtypeDomainWarning):this._renderDescriptionOrEmpty(e.description)}_renderShowAllRelatedRecordsListItem(e){if(!e.showAllActionVisible||!this.callbacks?.showAllRelatedRecords)return;const i=this.messages;return z("calcite-list-item",{description:t(i.totalCount,{count:e.featureCount}),key:"show-all-related-features",label:i.showAll,value:!0,onCalciteListItemSelect:()=>this._onShowAllRelatedRecordsClick(e.relationshipId)},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderAddRelatedRecordButton(e){const{canAddRelatedFeature:t,relationshipId:i,relatedLayer:o,editable:s}=e,{messages:n,callbacks:a,disabled:r}=this,l=!s||r;if(t&&a?.addRelatedRecord&&o&&!l)return z("calcite-button",{alignment:"center",appearance:"outline-fill",class:f.centeredButton,disabled:e.updating||!e.originHasValidKey,iconStart:"plus",key:`${i}-add-button`,onclick:()=>{!e.updating&&e.originHasValidKey&&this._onAddRelatedRecordsClick(e,i,o)},round:!0,scale:"s",width:"full"},e.relatedLayerIsTable?n.addRecord:n.addFeature)}_renderRelatedRecordListItem(e,t,i){const{feature:o,description:s,title:n}=e,{feature:a,callbacks:r}=this,{highlightHelper:l}=this.viewModel,d=()=>{l?.removeAll(),r?.editRelatedRecord&&a&&r.editRelatedRecord({parentFeature:a,relationshipId:t,relatedFeature:o,readOnly:i})},c=l?()=>l.add(o):void 0,u=l?()=>l.remove(o):void 0;return z("calcite-list-item",{bind:this,description:s,key:`${t}-${o.uid}`,label:n,onmouseenter:c,onmouseleave:u,value:n,onCalciteListItemSelect:d},z("calcite-icon",{icon:M(o),slot:"content-start"}),z("calcite-icon",{icon:"chevron-right",scale:"s",slot:"content-end"}))}_renderRelationshipInput(e){if(!this._relatedRecordsEnabled)return;const{relationshipId:t,activeCategory:i}=e,o=i?null:this._renderDescriptionOrEmpty(e.description);return z("calcite-label",{class:this.classes(f.label,f.relatedRecordsLabel),key:`relationship-${t}-container`},z("div",null,this._renderRelatedRecordsHeaderContainer(e),o,this._renderRelationshipInputContent(e)),this._renderAddRelatedRecordButton(e))}_renderRelationshipInputContent(e){return e.featureCount>0?this._renderRelatedRecordsList(e):e.activeCategory&&0===e.featureCount?this._renderNoRelatedRecordsNotice():e.allCategories?.length?this._renderCategoryList(e):e.loaded?e.originHasValidKey?this._renderNoRelatedRecordsNotice():this._renderNoValidOriginKeyNotice(e):void 0}_renderCategoryList(e){return z("calcite-list",{displayMode:"flat",label:this.messages.relatedRecordsList,loading:e.updating},e.categories?.map(t=>this._renderCategory(e,t)),this._renderShowAllCategoriesListItem(e))}_renderCategory(e,t){const{count:o,name:s,value:n}=t,a=i(o);return z("calcite-list-item",{key:`${s}-${n}`,label:s,onCalciteListItemSelect:()=>this._selectCategory(e,t)},z("calcite-chip",{label:a,scale:"s",slot:"content-end"},a),z("calcite-icon",{flipRtl:!0,icon:"chevron-left",scale:"s",slot:"content-end"}))}_selectCategory(e,t){this.relationshipId=e.relationshipId,e.activeCategory=t}_renderShowAllCategoriesListItem(e){if(!e.showAllCategoriesVisible)return;const i=this.messages;return z("calcite-list-item",{description:t(i.totalCount,{count:e.allCategories?.length??0}),key:"show-all-categories",label:i.showAll,value:!0,onCalciteListItemSelect:()=>e.showAllEnabled=!0},z("calcite-icon",{icon:"list",scale:"s",slot:"content-end"}))}_renderRelatedRecordsHeaderContainer(e){const t=e.updating||!e.loaded;return z("div",{class:f.relatedRecordsHeader,key:`relationship-${e.relationshipId}-header`},z("span",null,e.label),t?z("calcite-loader",{inline:!0,key:"loader",label:this.messagesCommon?.loading,scale:"s",type:"indeterminate"}):void 0)}_renderRelatedRecordsList(e){const{relationshipId:t,editable:i}=e,{disabled:o}=this,s=!i||o;return z("calcite-list",{class:f.relatedRecordsList,label:this.messages?.relatedRecordsList},e.relatedFeatureInfos.map(e=>this._renderRelatedRecordListItem(e,t,s)),this._renderShowAllRelatedRecordsListItem(e),this._renderObserverNode())}_renderNoValidOriginKeyNotice(e){const{messages:i}=this,o=e.relatedLayerIsTable?i.noOriginKeyRecord:i.noOriginKeyFeature,s=e.relationship?.keyField,n=this.viewModel.findField(s),a=e.layer?.fieldsIndex.get(s),r=n?.label||a?.alias||s,l=t(o,{relatedLayerName:e.relatedLayer?.title,originKeyField:r});return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},l))}_renderNoRelatedRecordsNotice(){return z("calcite-notice",{icon:"information",kind:"brand",open:!0,scale:"s",width:"full"},z("div",{slot:"message"},this.messagesFeature.noRelatedFeatures))}_renderObserverNode(){if(this.viewModel.activeRelationshipInput?.showAllEnabled)return z("div",{afterCreate:this._afterListObserverCreated,afterRemoved:this._afterListObserverRemoved,bind:this,class:f.listObserver,key:"feature-observer"})}_renderTextElementInput(e){return z("div",{class:f.textElement,"data-testid":`text-element-${e.label}`,innerHTML:e.text,key:e.id})}getCommonInputProps(e){const{disabled:t}=this,{editable:i,hint:o,label:s,maxLength:n,minLength:a,name:r,range:{max:l,min:d},required:c,valid:u,value:p}=e,m=this._inputsWithChanges.has(r),h=!i||t;return{afterCreate:this._afterComponentCreate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":u?"false":"true",class:this.classes(f.fieldInput,h?f.inputDisabled:null),status:m&&!u?"invalid":"idle",key:r,label:s,max:null!=l?l:void 0,min:null!=d?d:void 0,maxLength:n>-1?n:void 0,minLength:a>-1?a:void 0,placeholder:o??void 0,readOnly:h,required:c,value:null==p?"":`${p}`,onblur:this._onComponentBlur,onfocus:this._onComponentFocus,onkeydown:this._onComponentKeyDown,[Q]:r}}_getFieldInputFromHTMLElement(e){return this.viewModel.findField(e.getAttribute(Q))}_afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e),i=e.dataset.datePart,o=this._dateComponentMap.get(t.name);if("valueAsDate"in e&&null!=e.value&&null!=t.value){const i=new ResizeObserver(()=>{switch(e.value=void 0,t.field.type){case"date":e.value=j(t.value,this.timeZone).date??"";break;case"timestamp-offset":e.value=$(t.value,this.timeZone).date??"";break;default:e.value=`${t.value}`}i.unobserve(e)});i.observe(e)}if(null!=o)switch(i){case"date":o.date=e;break;case"time":o.time=e;break;case"timeZone":o.timeZone=e}else this._dateComponentMap.set(t.name,{[i]:e});this._afterDateComponentCreateOrUpdate(e)}_afterDateComponentCreateOrUpdate(e){this._afterComponentCreateOrUpdate(e)}_afterComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);L(t)&&null!=e.value&&"setNumberValue"in e&&e.setNumberValue({committing:!1,value:e.value,origin:"direct"}),this._afterComponentCreateOrUpdate(e)}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),o=t||i;o&&this._afterComponentCreateOrUpdate(o)}_afterComponentCreateOrUpdate(e){const{viewModel:t}=this,i=this._getFieldInputFromHTMLElement(e),o=t.findField(this._focusedFieldName);this._attemptFocusOnNextRender&&o===i&&(this._attemptFocusOnNextRender=!1,O(i)&&(i.group.open=!0),J(e))}async _afterGroupCreate(e){const t=this.viewModel.findGroup(e.id),i=this.viewModel.findField(this._focusedFieldName);i&&t&&T(i,t)&&(!i.editable||this.disabled)&&(await e.componentOnReady(),this._attemptFocusOnNextRender=!0,this.scheduleRender())}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._focusedFieldName=i.name}_onComponentBlur(e){const t=e.target;this._focusedFieldName=null;"readOnly"in t&&t.readOnly||this._saveValueFromComponent(t)}_saveValueFromDateComponent(e){const{timeZone:t}=this,i=this._getFieldInputFromHTMLElement(e),o=i.field.type,{name:s,range:n}=i,a=this._dateComponentMap.get(s);if(!a)return;let r=this.viewModel.getValue(s),l=null;"date-only"===o?l=Array.isArray(e.value)?e.value[0]:e.value:"time-only"===o?(r=P(r),l=P(e.value)):l="timestamp-offset"===o?null!=e.value?G({dateComponent:a.date,timeComponent:a.time,timeZoneComponent:a.timeZone,oldValue:r,defaultTimeZone:t}):null:null!=e.value?H({oldValue:r,dateComponent:a.date,timeComponent:a.time,timeZone:t,max:n.max,min:n.min}):null,null!==l&&e.value?r!==l&&this._updateFieldValue(s,l):this._updateFieldValue(s,null)}_saveValueFromComponent(e){const t=this._getFieldInputFromHTMLElement(e),i=this._parseValue(e),o=t.value;t.isSubtypeField&&A(this.layer,o,i)?this._pendingSubtypeChoice||i===o||(this._pendingSubtypeChoice=this._handleSubtypeChoice(t,i)):this._updateFieldValue(t.name,i)}async _handleSubtypeChoice(e,i){const{value:o,name:s}=e,{messages:a,viewModel:r,messagesCommon:l,_subtypes:d}=this;if(this._updateFieldValue(s,i),!d?.length)return;const c=d.find(e=>e.code===i),u=d.find(e=>e.code===o)?.name??`${o}`;if(!c)return;const p=n();r.pendingSubtypeChoice=p;let m="update-fields";const h=[{label:a.subtypes.useDefaultValuesOption,value:"update-fields"},{label:a.subtypes.keepCurrentValuesOption,value:"keep-existing"}],v={context:"info",title:a.subtypes.changeWarningTitle,message:t(a.subtypes.changeWarning,{originalType:u,newType:c.name}),radios:h,defaultRadioSelection:"update-fields",onRadioSelection:e=>m=e,actions:{primary:{label:l.apply,action:()=>p.resolve(m),type:"positive"},secondary:{label:l.cancel,type:"neutral",action:()=>p.resolve("undo")}},cancel:()=>p.reject()};try{this.showPrompt(v);switch(await p.promise){case"update-fields":r.applySubtypeDefaults(c),this._validateContingenciesForNonNullFields();break;case"keep-existing":this._validateContingenciesForNonNullFields();break;case"undo":this._updateFieldValue(e.name,o)}}finally{r.pendingSubtypeChoice=null,this.clearPrompt(),this._pendingSubtypeChoice=null}}_onComponentKeyDown({key:e,target:t}){const i=this._getFieldInputFromHTMLElement(t);"Enter"===e&&O(i)&&!i.group.open&&(i.group.open=!0)}_updateFieldValue(e,t){const i=this.viewModel.getValue(e);this.viewModel.setValue(e,t),this._inputsWithChanges.add(e);i!==t&&this.viewModel.fieldsWithContingentValues.has(e)&&this._validateContingenciesForNonNullFields()}_validateContingenciesForNonNullFields(){const e=Object.fromEntries(Object.entries(this.getValues()).filter(([e,t])=>null!=t));this.viewModel.validateContingencyConstraints(e)}_parseValue(e){const t=this._getFieldInputFromHTMLElement(e),i=e.value;return I(t.element,"switch")?e.checked?t.element.input.onValue:t.element.input.offValue:null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_ignoreDeselectionOfNoValueOption(e){const{firstChild:t,selectedItems:i}=e;0===i.length&&t&&"selected"in t?t.selected=!0:s.getLogger(this).warnOnce("Failed to override user attempt to deselect 'No value' option.")}_onGroupToggle(e,t){e.expanded?(t.open=!0,this._focusedFieldName=this._getFocusableInput("forward",t)?.name||null,this._attemptFocusOnNextRender=!0,"sequential"===this.groupDisplay&&this.viewModel.allGroupInputs.forEach(e=>{e!==t&&(e.open=!1)})):t.open=!1,this.scheduleRender()}_onFormSubmit(e){e.preventDefault()}_onFormKeyDown(e){"Enter"===e.key&&this.viewModel.submit()}_afterListObserverCreated(e){this.viewModel.activeRelationshipInput&&(this._listObserverNode=e)}_afterListObserverRemoved(){this._listObserverNode=null}_onObserverChange(){this._listObserverNode&&this._listObserver.unobserve(this._listObserverNode);const e=this.viewModel.activeRelationshipInput;e&&this._listObserverNode&&e.showAllEnabled&&this._listObserver.observe(this._listObserverNode)}_incrementRelatedRecordPage(){const e=this.viewModel.activeRelationshipInput;e?.incrementPage()}_syncGroupInputStates(){if("sequential"!==this.groupDisplay)return;const e=this.viewModel.allGroupInputs;if(!e.length)return;const t=e.filter(e=>e.open);0===t.length?e[0].open=!0:t.length>1&&t.slice(1).forEach(e=>e.open=!1)}get test(){return{inputsWithChanges:this._inputsWithChanges,updateValue:this._saveValueFromComponent.bind(this)}}};e([c()],X.prototype,"_listObserverNode",void 0),e([c()],X.prototype,"_relatedRecordsEnabled",null),e([c()],X.prototype,"_utilityNetworkAssociationsEnabled",null),e([c()],X.prototype,"_prompt",void 0),e([c()],X.prototype,"_subtypes",null),e([c()],X.prototype,"associationId",null),e([c()],X.prototype,"associatedLayer",null),e([c()],X.prototype,"disabled",null),e([c()],X.prototype,"feature",null),e([c()],X.prototype,"_featureFormUNAssociationList",void 0),e([c()],X.prototype,"formTemplate",null),e([c()],X.prototype,"groupDisplay",void 0),e([c()],X.prototype,"headingLevel",void 0),e([c()],X.prototype,"icon",null),e([c()],X.prototype,"label",null),e([c()],X.prototype,"layer",null),e([c()],X.prototype,"map",null),e([c(),K("esri/widgets/FeatureForm/t9n/FeatureForm")],X.prototype,"messages",void 0),e([c(),K("esri/t9n/common")],X.prototype,"messagesCommon",void 0),e([c(),K("esri/widgets/Feature/t9n/Feature")],X.prototype,"messagesFeature",void 0),e([c(),K("esri/widgets/FeatureTemplates/t9n/FeatureTemplates")],X.prototype,"messagesTemplates",void 0),e([c()],X.prototype,"callbacks",null),e([c()],X.prototype,"relationshipId",null),e([c()],X.prototype,"spatialReference",null),e([c()],X.prototype,"strict",null),e([c()],X.prototype,"timeZone",null),e([c()],X.prototype,"showPrompt",null),e([c()],X.prototype,"clearPrompt",null),e([c({type:x}),q(["value-change","submit"])],X.prototype,"viewModel",void 0),e([c({type:D,nonNullable:!0})],X.prototype,"visibleElements",void 0),e([c()],X.prototype,"test",null),X=e([u("esri.widgets.FeatureForm")],X);const Y=X;export{Y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{watch as i,when as n,initial as o}from"../../../core/reactiveUtils.js";import{renderingSanitizer as s,stripHTMLSanitizer as l}from"../../../core/sanitizerUtils.js";import{property as r,subclass as a}from"../../../core/accessorSupport/decorators.js";import{css as c}from"./ColumnCSS.js";import{isEmptyStringOrWhitespace as d}from"../support/tableUtils.js";import{autoLink as p}from"../../support/uriUtils.js";import{setFocus as u}from"../../support/widgetUtils.js";const m=/<br\s*\/*>/gi;let h=class extends t{constructor(e){super(e),this._menuIsOpen=!1,this.autoWidth=!1,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this,o=this.sanitizeContent(i);if(n&&t){const{index:i,item:{attachments:s,feature:l,relatedRecords:r}}=t;return n({attachments:s,column:this,feature:l,index:i,relatedRecords:r,value:o,virtualIndex:this.getVirtualRowIndex(e),field:void 0})}return o},this.description=null,this.direction=null,this.fieldName=null,this.flexGrow=1,this.footerRenderFunction=null,this.formatFunction=null,this.frozen=!1,this.frozenToEnd=!1,this.grid=null,this.headerRenderFunction=e=>{const{root:t}=e,i=this.createHeaderContent();this.removeCellContent(t),t.appendChild(i)},this.hidden=!1,this.icon=null,this.iconText=null,this.initialSortPriority=null,this.label=null,this.labelTooltipText=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.messagesURIUtils=null,this.renderFunction=({root:e,rowData:t})=>{const i=this.getCellValue(t),n=this.cellValueFormatFunction({root:e,rowData:t,value:i});let o=null;if(o=n instanceof HTMLElement?n:p(this.messagesURIUtils,n),this.removeCellContent(e),o instanceof HTMLElement)e.removeAttribute("title"),e.appendChild(o);else if(null!=o){const t=o.toString();e.innerHTML=t,e.title=t}},this.resizable=!0,this.sortable=!1,this.store=null,this.textAlign="start",this.textWrap=!1,this.timeZone=null,this.visibleElements=null,this.width=200}initialize(){const{fieldName:e}=this;this._set("sortElement",this.createSortElement()),this.sortElement.setAttribute("path",e),this.addHandles([i(()=>this.direction,e=>{const{sortElement:t}=this;this.effectiveSortable&&t&&(e?this.sortElement.direction!==e&&t.setAttribute("direction",e):t.removeAttribute("direction"))}),n(()=>this.grid?.isReady&&this.sortElement,()=>{const{direction:e,grid:t,hidden:i,sortElement:n}=this;i&&e&&n&&t&&!t.hasSorter(n)&&t.addSorter(n)},o),i(()=>[this.timeZone,this.icon,this.iconText,this.labelTooltipText],()=>this.grid?.requestContentUpdate()),i(()=>this.hidden,()=>this.closeMenu()),i(()=>this.fieldName,e=>{const{sortElement:t}=this;t&&t.path!==e&&t.setAttribute("path",e)}),i(()=>[this.effectiveLabel,this.labelTooltipText],([e,t])=>{const{sortElement:i}=this;i&&(i.setAttribute("title",t||e),i.textContent=e)})])}get _headerRequiresTextContainer(){return!(!this.effectiveSortable&&""===this.effectiveLabel&&null==this.effectiveDescription)}get customMenuItems(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:i,iconClass:n,label:o,selected:s,clickFunction:l})=>this.createCalciteDropdownItem({disabled:e,hidden:t,iconClass:n,iconStart:i,selected:s,textContent:o,onclick:e=>l(e)}))??[]}get defaultMenuItems(){if(!this.effectiveSortable)return[];const e=this.messages,t=[],i=this.visibleElements?.columnMenuItems;if(!1!==i?.sortAscending){const i=this.createCalciteDropdownItem({iconStart:"sort-ascending-arrow",textContent:e?.sortAsc,onclick:()=>this.direction="asc"});t.push(i)}if(!1!==i?.sortDescending){const i=this.createCalciteDropdownItem({iconStart:"sort-descending-arrow",textContent:e?.sortDesc,onclick:()=>this.direction="desc"});t.push(i)}return t}get effectiveDescription(){const{description:e}=this;return d(e)?null:this.sanitizeLabel(e)}get effectiveLabel(){return this.sanitizeLabel(this.label||this.fieldName)}get effectiveSortable(){return this.sortable}get iconNode(){const{icon:e,iconText:t}=this,i=t?this.sanitizeLabel(t):void 0;return e?this.createCalciteIcon({icon:e,textLabel:i}):null}set invalid(e){this._set("invalid",e),this.grid?.generateCellPartNames()}get invalid(){return this._get("invalid")??!1}get menu(){const{customMenuItems:e,defaultMenuItems:t,menuConfig:i}=this,n=!!i?.open,o=this.createCalciteAction({icon:i?.icon??"ellipsis",text:this.messages?.menu??"",slot:"trigger"}),s=document.createElement("calcite-dropdown");if(s.maxItems=i?.maxItems??4,s.placement="top-end",s.scale=i?.scale??"m",n&&(s.open=n,this._menuIsOpen=!0),s.appendChild(o),s.addEventListener("calciteDropdownOpen",()=>this._menuIsOpen=!0),s.addEventListener("calciteDropdownClose",()=>this._menuIsOpen=!1),s.onkeydown=this._stopPropagationOnSelect,s.addEventListener("mousewheel",e=>{e.stopPropagation()}),t.length){const e=s.appendChild(document.createElement("calcite-dropdown-group"));e.selectionMode="none",e.append(...t)}if(e.length){const t=s.appendChild(document.createElement("calcite-dropdown-group"));t.selectionMode=i?.selectionMode??"none",t.append(...e)}return s}get menuItems(){return[...this.defaultMenuItems,...this.customMenuItems]}get menuIsOpen(){return this._menuIsOpen}get menuIsVisible(){return!(!1===this.visibleElements?.columnMenus||!this.menuItems.length)}get tableTimeZone(){return this.store.timeZone}closeMenu(){this.menu.open=!1}createSortElement(){const{effectiveLabel:e,direction:t,fieldName:i,initialSortPriority:n}=this,o=document.createElement("vaadin-grid-sorter");return o.classList.add(c.sorter),o.setAttribute("path",i),o.setAttribute("title",this.labelTooltipText||e),o.textContent=e,t&&o.setAttribute("direction",t),null!=n&&(o._initialOrder=n),o.addEventListener("direction-changed",()=>{this.direction!==o.direction&&this._set("direction",o.direction)}),o}createCalciteAction(e){const t=document.createElement("calcite-action"),{alignment:i,appearance:n,className:o,disabled:s,icon:l,label:r,scale:a,slot:c,text:d,textEnabled:p,onclick:u}=e;return t.alignment=i??"center",t.appearance=n??"transparent",t.className=o??"",t.disabled=!!s,t.icon=l??"",t.label=r??"",t.scale=a??"s",t.slot=c??"",t.text=t.title=d??"",t.textEnabled=!!p,t.onclick=u??null,t}createCalciteButton(e){const t=document.createElement("calcite-button"),{alignment:i,appearance:n,className:o,disabled:s,iconEnd:l,iconFlipRtl:r,kind:a,loading:c,onclick:d,scale:p,textContent:u,title:m,width:h}=e;return t.alignment=i??"center",t.className=o??"",t.scale=p??"s",t.appearance=n??"transparent",t.disabled=!!s,t.iconEnd=l??"",r&&(t.iconFlipRtl=r),t.kind=a??"brand",t.loading=!!c,t.textContent=u??"",m&&(t.title=m),t.width=h??"auto",t.onclick=d??null,t}createCalciteDropdownItem(e){const t=document.createElement("calcite-dropdown-item"),{disabled:i,hidden:n,iconClass:o,iconStart:s,textContent:l,onclick:r,selected:a}=e,d=l??"";if(o&&!s){const e=document.createElement("span"),i=document.createElement("span");i.classList.add(c.headerMenuIcon,o),e.textContent=e.title=d,e.insertBefore(i,e.firstChild),t.appendChild(e)}else t.iconStart=s??"",t.textContent=t.title=d;return t.disabled=!!i,t.hidden="function"==typeof n?n():!!n,t.selected=!!a,r&&(t.addEventListener("calciteDropdownItemSelect",r),t.onkeydown=this._stopPropagationOnSelect),t}createCalciteIcon(e){const{effectiveLabel:t}=this,{icon:i,scale:n,textLabel:o}=e,s=document.createElement("calcite-icon"),l=o??t;return s.icon=i,s.scale=n??"s",s.textLabel=l,s.title=l,s}createHeaderContent(){const{effectiveDescription:e,effectiveLabel:t,iconNode:i}=this,n=document.createElement("div");if(n.classList.add(c.headerContent),i&&n.appendChild(i),!this._headerRequiresTextContainer)return n;const o=n.appendChild(document.createElement("div"));return this.effectiveSortable?o.appendChild(this.sortElement):""!==t&&o.appendChild(this._createHeaderTextElement({label:t,cssClass:c.headerLabel,title:this.labelTooltipText})),null!=e&&!1!==this.visibleElements?.columnDescriptions&&o.appendChild(this._createHeaderTextElement({label:e,cssClass:c.headerDescription})),this.menuIsVisible&&n.appendChild(this.menu),n}getCellValue(e){return e?.item.feature.attributes?.[this.fieldName]}getVirtualRowIndex(e){const t=this.grid?.getRowContainingNode(e);return t?.parentElement?[...t.parentElement.children].indexOf(t):-1}removeCellContent(e){if(e&&e.firstChild)try{for(;e?.firstChild;)e?.removeChild(e.firstChild)}catch(t){}}openMenu(){this.menuIsVisible&&(this.menu.open=!0,u(this.menuItems[0]))}sanitizeContent(e){return s.sanitize(e)}sanitizeLabel(e){return null==e||""===e?"":l.sanitize(e.toString()).replaceAll(m," ")}sort(){this.effectiveSortable&&this.sortElement?.click()}_stopPropagationOnSelect(e){"Enter"!==e.key&&" "!==e.key||e.stopPropagation()}_createHeaderTextElement({cssClass:e,label:t,title:i}){const n=document.createElement("span");n.classList.add(e);const o=n.appendChild(document.createElement("span"));return o.textContent=t,o.setAttribute("title",i||t),n}};e([r()],h.prototype,"_headerRequiresTextContainer",null),e([r()],h.prototype,"_menuIsOpen",void 0),e([r()],h.prototype,"autoWidth",void 0),e([r()],h.prototype,"cellValueFormatFunction",void 0),e([r()],h.prototype,"customMenuItems",null),e([r()],h.prototype,"defaultMenuItems",null),e([r()],h.prototype,"description",void 0),e([r()],h.prototype,"direction",void 0),e([r()],h.prototype,"effectiveDescription",null),e([r()],h.prototype,"effectiveLabel",null),e([r()],h.prototype,"effectiveSortable",null),e([r({constructOnly:!0})],h.prototype,"fieldName",void 0),e([r()],h.prototype,"flexGrow",void 0),e([r()],h.prototype,"footerRenderFunction",void 0),e([r()],h.prototype,"formatFunction",void 0),e([r()],h.prototype,"frozen",void 0),e([r()],h.prototype,"frozenToEnd",void 0),e([r()],h.prototype,"grid",void 0),e([r()],h.prototype,"iconNode",null),e([r()],h.prototype,"invalid",null),e([r()],h.prototype,"headerRenderFunction",void 0),e([r()],h.prototype,"hidden",void 0),e([r()],h.prototype,"icon",void 0),e([r()],h.prototype,"iconText",void 0),e([r({constructOnly:!0})],h.prototype,"initialSortPriority",void 0),e([r()],h.prototype,"label",void 0),e([r()],h.prototype,"labelTooltipText",void 0),e([r()],h.prototype,"menu",null),e([r()],h.prototype,"menuItems",null),e([r()],h.prototype,"menuConfig",void 0),e([r()],h.prototype,"menuIsOpen",null),e([r()],h.prototype,"menuIsVisible",null),e([r()],h.prototype,"messages",void 0),e([r()],h.prototype,"messagesCommon",void 0),e([r()],h.prototype,"messagesURIUtils",void 0),e([r()],h.prototype,"renderFunction",void 0),e([r()],h.prototype,"resizable",void 0),e([r()],h.prototype,"sortable",void 0),e([r({readOnly:!0})],h.prototype,"sortElement",void 0),e([r()],h.prototype,"store",void 0),e([r()],h.prototype,"tableTimeZone",null),e([r()],h.prototype,"textAlign",void 0),e([r()],h.prototype,"textWrap",void 0),e([r()],h.prototype,"timeZone",void 0),e([r()],h.prototype,"visibleElements",void 0),e([r()],h.prototype,"width",void 0),h=e([a("esri.widgets.FeatureTable.Grid.Column")],h);const f=h;export{f as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{watch as i,when as n,initial as o}from"../../../core/reactiveUtils.js";import{renderingSanitizer as s,stripHTMLSanitizer as l}from"../../../core/sanitizerUtils.js";import{property as r,subclass as a}from"../../../core/accessorSupport/decorators.js";import{css as c}from"./ColumnCSS.js";import{isEmptyStringOrWhitespace as d}from"../support/tableUtils.js";import{autoLink as p}from"../../support/uriUtils.js";import{setFocus as u}from"../../support/widgetUtils.js";const m=/<br\s*\/*>/gi;let h=class extends t{constructor(e){super(e),this._menuIsOpen=!1,this.autoWidth=!1,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this,o=this.sanitizeContent(i);if(n&&t){const{index:i,item:{attachments:s,feature:l,relatedRecords:r}}=t;return n({attachments:s,column:this,feature:l,index:i,relatedRecords:r,value:o,virtualIndex:this.getVirtualRowIndex(e),field:void 0})}return o},this.description=null,this.direction=null,this.fieldName=null,this.flexGrow=1,this.footerRenderFunction=null,this.formatFunction=null,this.frozen=!1,this.frozenToEnd=!1,this.grid=null,this.headerRenderFunction=e=>{const{root:t}=e,i=this.createHeaderContent();this.removeCellContent(t),t.appendChild(i)},this.hidden=!1,this.icon=null,this.iconText=null,this.initialSortPriority=null,this.label=null,this.labelTooltipText=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.messagesURIUtils=null,this.renderFunction=({root:e,rowData:t})=>{const i=this.getCellValue(t),n=this.cellValueFormatFunction({root:e,rowData:t,value:i});let o=null;if(o=n instanceof HTMLElement?n:p(this.messagesURIUtils,n),this.removeCellContent(e),o instanceof HTMLElement)e.removeAttribute("title"),e.appendChild(o);else if(null!=o){const t=o.toString();e.innerHTML=t,e.title=t}},this.resizable=!0,this.sortable=!1,this.store=null,this.textAlign="start",this.textWrap=!1,this.timeZone=null,this.visibleElements=null,this.width=200}initialize(){const{fieldName:e}=this;this._set("sortElement",this.createSortElement()),this.sortElement.setAttribute("path",e),this.addHandles([i(()=>this.direction,e=>{const{sortElement:t}=this;this.effectiveSortable&&t&&(e?this.sortElement.direction!==e&&t.setAttribute("direction",e):t.removeAttribute("direction"))}),n(()=>this.grid?.isReady&&this.sortElement,()=>{const{direction:e,grid:t,hidden:i,sortElement:n}=this;i&&e&&n&&t&&!t.hasSorter(n)&&t.addSorter(n)},o),i(()=>[this.timeZone,this.icon,this.iconText,this.labelTooltipText],()=>this.grid?.requestContentUpdate()),i(()=>this.hidden,()=>this.closeMenu()),i(()=>this.fieldName,e=>{const{sortElement:t}=this;t&&t.path!==e&&t.setAttribute("path",e)}),i(()=>[this.effectiveLabel,this.labelTooltipText],([e,t])=>{const{sortElement:i}=this;i&&(i.setAttribute("title",t||e),i.textContent=e)})])}get _headerRequiresTextContainer(){return!(!this.effectiveSortable&&""===this.effectiveLabel&&null==this.effectiveDescription)}get customMenuItems(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:i,iconClass:n,label:o,selected:s,clickFunction:l})=>this.createCalciteDropdownItem({disabled:e,hidden:t,iconClass:n,iconStart:i,selected:s,textContent:o,onclick:e=>l(e)}))??[]}get defaultMenuItems(){if(!this.effectiveSortable)return[];const e=this.messages,t=[],i=this.visibleElements?.columnMenuItems;if(!1!==i?.sortAscending){const i=this.createCalciteDropdownItem({iconStart:"sort-ascending-arrow",textContent:e?.sortAsc,onclick:()=>this.direction="asc"});t.push(i)}if(!1!==i?.sortDescending){const i=this.createCalciteDropdownItem({iconStart:"sort-descending-arrow",textContent:e?.sortDesc,onclick:()=>this.direction="desc"});t.push(i)}return t}get effectiveDescription(){const{description:e}=this;return d(e)?null:this.sanitizeLabel(e)}get effectiveLabel(){return this.sanitizeLabel(this.label||this.fieldName)}get effectiveSortable(){return this.sortable}get iconNode(){const{icon:e,iconText:t}=this,i=t?this.sanitizeLabel(t):void 0;return e?this.createCalciteIcon({icon:e,textLabel:i}):null}set invalid(e){this._set("invalid",e),this.grid?.generateCellPartNames()}get invalid(){return this._get("invalid")??!1}get menu(){const{customMenuItems:e,defaultMenuItems:t,menuConfig:i}=this,n=!!i?.open,o=this.createCalciteAction({icon:i?.icon??"ellipsis",text:this.messages?.menu??"",scale:"m",slot:"trigger"}),s=document.createElement("calcite-dropdown");if(s.maxItems=i?.maxItems??4,s.placement="top-end",s.scale=i?.scale??"m",n&&(s.open=n,this._menuIsOpen=!0),s.appendChild(o),s.addEventListener("calciteDropdownOpen",()=>this._menuIsOpen=!0),s.addEventListener("calciteDropdownClose",()=>this._menuIsOpen=!1),s.onkeydown=this._stopPropagationOnSelect,s.addEventListener("mousewheel",e=>{e.stopPropagation()}),t.length){const e=s.appendChild(document.createElement("calcite-dropdown-group"));e.selectionMode="none",e.append(...t)}if(e.length){const t=s.appendChild(document.createElement("calcite-dropdown-group"));t.selectionMode=i?.selectionMode??"none",t.append(...e)}return s}get menuItems(){return[...this.defaultMenuItems,...this.customMenuItems]}get menuIsOpen(){return this._menuIsOpen}get menuIsVisible(){return!(!1===this.visibleElements?.columnMenus||!this.menuItems.length)}get tableTimeZone(){return this.store.timeZone}closeMenu(){this.menu.open=!1}createSortElement(){const{effectiveLabel:e,direction:t,fieldName:i,initialSortPriority:n}=this,o=document.createElement("vaadin-grid-sorter");return o.classList.add(c.sorter),o.setAttribute("path",i),o.setAttribute("title",this.labelTooltipText||e),o.textContent=e,t&&o.setAttribute("direction",t),null!=n&&(o._initialOrder=n),o.addEventListener("direction-changed",()=>{this.direction!==o.direction&&this._set("direction",o.direction)}),o}createCalciteAction(e){const t=document.createElement("calcite-action"),{alignment:i,className:n,disabled:o,icon:s,label:l,scale:r,slot:a,text:c,textEnabled:d,onclick:p}=e;return t.alignment=i??"center",t.className=n??"",t.disabled=!!o,s&&(t.icon=s),t.label=l??"",t.scale=r??"s",t.slot=a??"",t.text=t.title=c??"",t.textEnabled=!!d,t.onclick=p??null,t}createCalciteButton(e){const t=document.createElement("calcite-button"),{alignment:i,appearance:n,className:o,disabled:s,iconEnd:l,iconFlipRtl:r,kind:a,loading:c,onclick:d,scale:p,textContent:u,title:m,width:h}=e;return t.alignment=i??"center",t.className=o??"",t.scale=p??"s",t.appearance=n??"transparent",t.disabled=!!s,l&&(t.iconEnd=l),r&&(t.iconFlipRtl=r),t.kind=a??"brand",t.loading=!!c,t.textContent=u??"",m&&(t.title=m),t.width=h??"auto",t.onclick=d??null,t}createCalciteDropdownItem(e){const t=document.createElement("calcite-dropdown-item"),{disabled:i,hidden:n,iconClass:o,iconStart:s,textContent:l,onclick:r,selected:a}=e,d=l??"";if(o&&!s){const e=document.createElement("span"),i=document.createElement("span");i.classList.add(c.headerMenuIcon,o),e.textContent=e.title=d,e.insertBefore(i,e.firstChild),t.appendChild(e)}else s&&(t.iconStart=s),t.textContent=t.title=d;return t.disabled=!!i,t.hidden="function"==typeof n?n():!!n,t.selected=!!a,r&&(t.addEventListener("calciteDropdownItemSelect",r),t.onkeydown=this._stopPropagationOnSelect),t}createCalciteIcon(e){const{effectiveLabel:t}=this,{icon:i,scale:n,textLabel:o}=e,s=document.createElement("calcite-icon"),l=o??t;return s.icon=i,s.scale=n??"s",s.textLabel=l,s.title=l,s}createHeaderContent(){const{effectiveDescription:e,effectiveLabel:t,iconNode:i}=this,n=document.createElement("div");if(n.classList.add(c.headerContent),i&&n.appendChild(i),!this._headerRequiresTextContainer)return n;const o=n.appendChild(document.createElement("div"));return this.effectiveSortable?o.appendChild(this.sortElement):""!==t&&o.appendChild(this._createHeaderTextElement({label:t,cssClass:c.headerLabel,title:this.labelTooltipText})),null!=e&&!1!==this.visibleElements?.columnDescriptions&&o.appendChild(this._createHeaderTextElement({label:e,cssClass:c.headerDescription})),this.menuIsVisible&&n.appendChild(this.menu),n}getCellValue(e){return e?.item.feature.attributes?.[this.fieldName]}getVirtualRowIndex(e){const t=this.grid?.getRowContainingNode(e);return t?.parentElement?[...t.parentElement.children].indexOf(t):-1}removeCellContent(e){if(e&&e.firstChild)try{for(;e?.firstChild;)e?.removeChild(e.firstChild)}catch(t){}}openMenu(){this.menuIsVisible&&(this.menu.open=!0,u(this.menuItems[0]))}sanitizeContent(e){return s.sanitize(e)}sanitizeLabel(e){return null==e||""===e?"":l.sanitize(e.toString()).replaceAll(m," ")}sort(){this.effectiveSortable&&this.sortElement?.click()}_stopPropagationOnSelect(e){"Enter"!==e.key&&" "!==e.key||e.stopPropagation()}_createHeaderTextElement({cssClass:e,label:t,title:i}){const n=document.createElement("span");n.classList.add(e);const o=n.appendChild(document.createElement("span"));return o.textContent=t,o.setAttribute("title",i||t),n}};e([r()],h.prototype,"_headerRequiresTextContainer",null),e([r()],h.prototype,"_menuIsOpen",void 0),e([r()],h.prototype,"autoWidth",void 0),e([r()],h.prototype,"cellValueFormatFunction",void 0),e([r()],h.prototype,"customMenuItems",null),e([r()],h.prototype,"defaultMenuItems",null),e([r()],h.prototype,"description",void 0),e([r()],h.prototype,"direction",void 0),e([r()],h.prototype,"effectiveDescription",null),e([r()],h.prototype,"effectiveLabel",null),e([r()],h.prototype,"effectiveSortable",null),e([r({constructOnly:!0})],h.prototype,"fieldName",void 0),e([r()],h.prototype,"flexGrow",void 0),e([r()],h.prototype,"footerRenderFunction",void 0),e([r()],h.prototype,"formatFunction",void 0),e([r()],h.prototype,"frozen",void 0),e([r()],h.prototype,"frozenToEnd",void 0),e([r()],h.prototype,"grid",void 0),e([r()],h.prototype,"iconNode",null),e([r()],h.prototype,"invalid",null),e([r()],h.prototype,"headerRenderFunction",void 0),e([r()],h.prototype,"hidden",void 0),e([r()],h.prototype,"icon",void 0),e([r()],h.prototype,"iconText",void 0),e([r({constructOnly:!0})],h.prototype,"initialSortPriority",void 0),e([r()],h.prototype,"label",void 0),e([r()],h.prototype,"labelTooltipText",void 0),e([r()],h.prototype,"menu",null),e([r()],h.prototype,"menuItems",null),e([r()],h.prototype,"menuConfig",void 0),e([r()],h.prototype,"menuIsOpen",null),e([r()],h.prototype,"menuIsVisible",null),e([r()],h.prototype,"messages",void 0),e([r()],h.prototype,"messagesCommon",void 0),e([r()],h.prototype,"messagesURIUtils",void 0),e([r()],h.prototype,"renderFunction",void 0),e([r()],h.prototype,"resizable",void 0),e([r()],h.prototype,"sortable",void 0),e([r({readOnly:!0})],h.prototype,"sortElement",void 0),e([r()],h.prototype,"store",void 0),e([r()],h.prototype,"tableTimeZone",null),e([r()],h.prototype,"textAlign",void 0),e([r()],h.prototype,"textWrap",void 0),e([r()],h.prototype,"timeZone",void 0),e([r()],h.prototype,"visibleElements",void 0),e([r()],h.prototype,"width",void 0),h=e([a("esri.widgets.FeatureTable.Grid.Column")],h);const f=h;export{f as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../core/accessorSupport/decorators.js";import{substitute as i}from"../../intl/substitute.js";import l from"./Grid/Column.js";import{css as r}from"./Grid/ColumnCSS.js";import{isIFeatureTableSupportedLayerWithRelationships as s,findRelationship as n}from"./support/tableUtils.js";const a={showRecordsButton:"esri-column__show-related-records-button"};let p=class extends l{constructor(t){super(t),this.flexGrow=1,this.icon="link",this.layer=null,this.relatedLayer=null,this.relationshipId=null,this.renderFunction=({root:t,rowData:e})=>{if(!e)return;const o=e.item,{layer:l,relatedLayer:n}=this;if(!o?.feature||!s(l)||!s(n))return;const{messages:p}=this,{index:d}=e,{feature:h,objectId:c}=o,{collapsed:u,showRelatedTableCallback:b,relationshipId:y}=this,f=o.relatedRecords,m=f?.find(t=>t.relationshipId===y)?.count??0,C=!u&&b&&p?.recordsCount?i(p.recordsCount,{count:m}):`${m}`,
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../core/accessorSupport/decorators.js";import{substitute as i}from"../../intl/substitute.js";import l from"./Grid/Column.js";import{css as r}from"./Grid/ColumnCSS.js";import{isIFeatureTableSupportedLayerWithRelationships as s,findRelationship as n}from"./support/tableUtils.js";const a={showRecordsButton:"esri-column__show-related-records-button"};let p=class extends l{constructor(t){super(t),this.flexGrow=1,this.icon="link",this.layer=null,this.relatedLayer=null,this.relationshipId=null,this.renderFunction=({root:t,rowData:e})=>{if(!e)return;const o=e.item,{layer:l,relatedLayer:n}=this;if(!o?.feature||!s(l)||!s(n))return;const{messages:p}=this,{index:d}=e,{feature:h,objectId:c}=o,{collapsed:u,showRelatedTableCallback:b,relationshipId:y}=this,f=o.relatedRecords,m=f?.find(t=>t.relationshipId===y)?.count??0,C=!u&&b&&p?.recordsCount?i(p.recordsCount,{count:m}):`${m}`,v=t=>{t.preventDefault(),u||this.showRelatedTableCallback?.({feature:h,index:d,layer:l,objectId:c,relatedLayer:n,relationshipId:y})},w=u?void 0:"chevron-right";if(t.firstChild){const e=t.firstChild;return e.textContent=C,e.onclick=v,void(w&&(e.iconEnd=w))}const x=this.createCalciteButton({className:`${a.showRecordsButton} ${r.contentFull}`,iconEnd:w,iconFlipRtl:"both",scale:"m",textContent:C,title:C,onclick:v});this.removeCellContent(t),t.appendChild(x)},this.resizable=!0,this.showRelatedTableCallback=null,this.textAlign="center",this.width="200px"}get _relationshipLabel(){return this.label||this.originRelationship?.name||this.layer.title||""}get collapsed(){return this._get("collapsed")||!1}set collapsed(t){t?this.set({flexGrow:0,resizable:!1,width:"80px"}):this.set({flexGrow:1,resizable:!0,width:"200px"}),this._set("collapsed",t)}get effectiveLabel(){return this.collapsed?"":this._relationshipLabel}get iconNode(){const{icon:t}=this;return t?this.createCalciteIcon({icon:t,textLabel:this._relationshipLabel}):null}get originRelationship(){const t=this.relationshipId;return this.relatedLayer.relationships?.find(({id:e})=>e===t)}get relationship(){return n(this.layer,this.relationshipId)}};t([e()],p.prototype,"_relationshipLabel",null),t([e()],p.prototype,"collapsed",null),t([e()],p.prototype,"effectiveLabel",null),t([e()],p.prototype,"flexGrow",void 0),t([e()],p.prototype,"icon",void 0),t([e()],p.prototype,"iconNode",null),t([e()],p.prototype,"layer",void 0),t([e()],p.prototype,"originRelationship",null),t([e()],p.prototype,"relatedLayer",void 0),t([e()],p.prototype,"relationship",null),t([e()],p.prototype,"relationshipId",void 0),t([e()],p.prototype,"renderFunction",void 0),t([e()],p.prototype,"resizable",void 0),t([e()],p.prototype,"showRelatedTableCallback",void 0),t([e()],p.prototype,"textAlign",void 0),t([e()],p.prototype,"width",void 0),p=t([o("esri.widgets.FeatureTable.RelationshipColumn")],p);const d=p;export{d as default};
|
package/widgets/FeatureTable.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as i}from"../core/arrayUtils.js";import{watch as l,on as o,sync as n,initial as s}from"../core/reactiveUtils.js";import{renderingSanitizer as a}from"../core/sanitizerUtils.js";import{formatFileSize as r}from"../core/unitFormatUtils.js";import{property as c,subclass as d}from"../core/accessorSupport/decorators.js";import{geometryTypes as h}from"../geometry/support/typeUtils.js";import{isLayerFromCatalog as p}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as m,isMapImageLayer as u,isSubtypeGroupLayer as g}from"../layers/support/layerUtils.js";import b from"../tables/AttributeTableTemplate.js";import w from"../time/TimeExtent.js";import v from"./Widget.js";import{isSupportedImage as y,getCalciteIconForAttachment as f}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as _,Prompt as M}from"./Editor/components/Prompt.js";import C from"./FeatureTable/ColumnMenuVisibleElements.js";import S from"./FeatureTable/FeatureTableViewModel.js";import A from"./FeatureTable/VisibleElements.js";import{isGroupColumn as E}from"./FeatureTable/support/columnUtils.js";import T from"./FeatureTable/support/TableTemplate.js";import{loadFieldColumnComponents as V,isIFeatureTableSupportedLayer as I,isIFeatureTableSupportedLayerWithAttachments as R,getRelationshipIdsToShow as k}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as x}from"./support/componentsUtils.js";import{globalCss as D}from"./support/globalCss.js";import{getIconForLayer as P}from"./support/iconUtils.js";import{messageBundle as F,vmEvent as O,tsx as z}from"./support/widget.js";import{storeNode as L,discardNode as j}from"./support/widgetUtils.js";var $;const U="esri-feature-table",B=`${U}__attachments-view`,N={base:U,content:`${U}__content`,menuPopover:`${U}__menu-popover`,layerDropdownMenu:`${U}__layer-switcher-menu`,tableContainer:`${U}__table-container`,tableContainerWithAttachments:`${U}__table-container--attachments`,tableNavigation:`${U}__table-navigation`,attachmentsView:B,attachmentsViewContent:`${B}__content`,attachmentsViewDropArea:`${B}__drop-area`,attachmentsViewIcon:`${B}__icon`,attachmentsViewInformation:`${B}__information`,attachmentsViewList:`${B}__list`,attachmentsViewListFileSize:`${B}__list__filesize`,attachmentsViewListItemDelete:`${B}__list-item--delete`,attachmentsViewListThumbnail:`${B}__list__thumbnail`,expanded:`${U}__expanded`,collapsed:`${U}__collapsed`,footerMessage:`${U}__footer__message`,footerIconDanger:`${U}__footer__icon--danger`},H={chevronRight:"chevron-right",clearSelection:"clear-selection",downloadTo:"download-to",exclamationMarkTriangle:"exclamation-mark-triangle",exportToCSV:"file-csv",folderOpen:"folder-open",delete:"trash",launch:"launch",layers:"layers",moveUp:"move-up",plus:"plus",refresh:"refresh",replaceImage:"replace-image",reset:"reset",save:"save",showAll:"selection-x",showColumn:"show-column",showSelected:"selection-filter",upload:"upload",zoomToSelection:"zoom-to-object"};let Z=$=class extends v{constructor(e,t){super(e,t),this._attachmentsInput=null,this._columnVisibilityActions=new Map,this.attachmentsList=null,this.description=null,this.disabled=!1,this.navigationScale="m",this.title=null,this.viewModel=new S,this.visibleElements=new A,this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.addHandles([l(()=>[this.isQueryingOrSyncing,this.editingEnabled],()=>this.scheduleRender()),l(()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length],()=>{this.columns.forEach(e=>e.visibleElements=this._effectiveVisibleElements),this.refreshCellContent()},n),l(()=>this._effectiveVisibleElements.selectionColumn,e=>{this.grid&&(this.grid.selectionColumnEnabled=e)},s),o(()=>this.viewModel,"show-related-table",e=>this._onShowRelatedTable(e)),l(()=>this.editingEnabled,()=>{const{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)})])}loadDependencies(){return Promise.all([x({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),alert:()=>import("@esri/calcite-components/dist/components/calcite-alert"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),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"),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"),pagination:()=>import("@esri/calcite-components/dist/components/calcite-pagination"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),_(),V()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _effectiveDescription(){const{description:e}=this;return null!=e?a.sanitize("function"==typeof e?e():e):void 0}get _effectiveLayers(){const{layer:e,layers:t}=this,i=t?.length?t.filter(I):[],l=i.length?i:[...this._viewLayers];return e&&!l.includes(e)&&l.push(e),l}get _effectiveTitle(){const{layer:e,messages:i,state:l,highlightIds:o,title:n,size:s}=this;if(n)return a.sanitize("function"==typeof n?n():n);if(!e)return i.noLayer;switch(l){case"disabled":return i.errorLayer;case"ready":case"loading":return i.loading;case"error":return i.errorData}return t(i.header,{title:a.sanitize(e.title),count:s,selected:o.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){const e=this.relatedTables.toArray(),t=1===e.length;return this.allRelatedTablesVisible?e:t?[e[0]]:this._shouldShowAttachmentsView?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return null!=this.attachmentsViewOptions.error}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnsVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||1===this.relatedTables.length&&!this._shouldShowAttachmentsView}get _shouldShowMenu(){const{header:e,menu:t}=this._effectiveVisibleElements;return!(!e||!t||!this._hasDefaultMenuItems&&!this._hasCustomMenuItems)}get _shouldShowAttachmentsView(){return!(null==this.attachmentsViewOptions.objectId&&!this.relatedTables.some(e=>null!=e.attachmentsViewOptions.objectId))}get _showClearSelectionAction(){return!(!this.highlightIds.length||!this._effectiveVisibleElements.menuItems?.clearSelection||this.relatedTables.length||this._shouldShowAttachmentsView)}get _showColumnsVisibilityAction(){const{header:e,menu:t,menuItems:i}=this._effectiveVisibleElements;return!(!(e&&t&&i?.toggleColumns)||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._shouldShowAttachmentsView)}get _showDeleteSelectionAction(){return!(!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete)||this.relatedTables.length||this._shouldShowAttachmentsView)}get _showExportSelectionToCSVAction(){return!(!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length)||this.relatedTables.length)}get _showLayerDropdown(){return!(!this._effectiveLayers.length||!this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){const e=!!this.relatedTable||this._shouldShowAttachmentsView;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){const e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length||this._shouldShowAttachmentsView)}get _showSelectedRecordsShowAllAction(){return!(!this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle||!this.objectIds.length||this.relatedTables.length)}get _showZoomToSelectionAction(){return!(!this.view||!this.highlightIds.length||this.effectiveTable.layer?.isTable||!this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){const e=this.view?.map;if(!e)return[];const t=new Set,i=e=>{!I(e)||g(e)||t.has(e)||"sublayer"===e.type&&!e.capabilities?.operations?.supportsQuery||(e.load(),t.add(e))},l=e=>{p(e)||"catalog-footprint"===e.type||(m(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):u(e)?(e.loadAll(),e.allSublayers?.forEach(i),e.subtables?.forEach(i)):g(e)?(e.loadAll(),e.sublayers?.forEach(i)):i(e))};return e.allLayers.forEach(l),e.allTables.forEach(l),[...t.values()]}get grid(){return this.viewModel.grid}get actionColumn(){return this.viewModel.actionColumn}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get allVisibleColumns(){return this.viewModel.allVisibleColumns}get attachmentsColumns(){return this.viewModel.attachmentsColumns}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get autoSaveEnabled(){return this.viewModel.autoSaveEnabled}set autoSaveEnabled(e){this.viewModel.autoSaveEnabled=e}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get container(){return super.container}set container(e){super.container=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get fieldColumns(){return this.viewModel.fieldColumns}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get groupColumns(){return this.viewModel.groupColumns}get hasContingentValues(){return this.viewModel.hasContingentValues}get hasInvalidPendingEdits(){return this.viewModel.hasInvalidPendingEdits}get hasPendingEdits(){return this.viewModel.hasPendingEdits}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return"table"}set icon(e){this._overrideIfSome("icon",e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncing(){return this.viewModel.isSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get menuConfig(){return this.viewModel.menuConfig}set menuConfig(e){this.viewModel.menuConfig=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTables(){return this.viewModel.relatedTables}set relatedTables(e){this.viewModel.relatedTables=e}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipColumns(){return this.viewModel.relationshipColumns}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get syncTemplateOnChangesEnabled(){return this.viewModel.syncTemplateOnChangesEnabled}set syncTemplateOnChangesEnabled(e){this.viewModel.syncTemplateOnChangesEnabled=e}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleColumns(){return this.viewModel.visibleColumns}get visibleElementsOverride(){const{attachmentsViewOptions:e,relatedTable:t,tableController:i,visibleElements:l}=this,{columnDescriptions:o,columnMenus:n,tooltips:s}=l,a=null!=e.objectId;if(t)return new A({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new C({sortAscending:!1,sortDescending:!1})});if(i){const e=i.relatedTable===this,t=i.allRelatedTablesVisible,r=e&&l.selectionColumn&&!t&&!a,c=e&&!t&&!a;return new A({columnDescriptions:o,columnMenus:n,tooltips:s,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,progress:!1,columnMenuItems:new C({sortAscending:c,sortDescending:c})})}return a?new A({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new C({sortAscending:!1,sortDescending:!1})}):null}cancelPendingEdits(){this.viewModel.cancelPendingEdits()}clearSelectionFilter(){this.viewModel.clearSelectionFilter()}async deleteAttachments(e,t,i){null!=e&&t?.length&&(i?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}deleteSelection(e){return this.highlightIds.length?e?(this._showDeletePrompt(),this.scheduleRender(),Promise.resolve()):this.viewModel.deleteSelection():Promise.resolve()}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}filterBySelection(){this.viewModel.filterBySelection()}findColumn(e){return this.viewModel.findColumn(e)}goToPage(e){this.viewModel.goToPage(e)}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}async savePendingEdits(){await this.viewModel.savePendingEdits()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}zoomToSelection(){this.effectiveTable.viewModel.zoomToSelection()}render(){const{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:i,state:l}=this;return z("div",{bind:this,class:this.classes(N.base,D.widget)},z("calcite-panel",{bind:this,class:N.content,closable:e.close,description:this._effectiveDescription,disabled:this.disabled||"disabled"===l&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,key:"table-content",loading:"loading"===l,menuOpen:!!i?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.currentTarget.closed=!1,this.emit("close")}},e.progress?z("calcite-progress",{type:t?"indeterminate":"determinate"}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError(),this._renderFooterContent()),this._renderColumnVisibilityPopover(),this._renderPrompt())}_renderTables(){const{grid:e,relatedTables:t}=this,i=this.classes(N.tableContainer);if(t.length){const l=this.classes(N.base,this.allRelatedTablesVisible?N.expanded:N.collapsed,this._shouldShowAttachmentsView?N.tableContainerWithAttachments:void 0);return z("div",{class:i},z("calcite-panel",{overlayPositioning:"fixed"},z("div",null,[this._shouldShowGrid?z("div",{class:l},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{const i=t.indexOf(e);return z("div",{class:l,key:`related-${i}`},e.render())}),,])))}return null!=this.attachmentsViewOptions.objectId?z("div",{class:i},z("calcite-panel",{overlayPositioning:"fixed"},z("div",null,[z("div",{class:this.classes(N.base,N.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[z("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return z("calcite-pagination",{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>this.goToPage(e.currentTarget.startItem-1)})}_renderError(){const{messages:e}=this;return z("calcite-alert",{autoClose:!0,autoCloseDuration:"fast",icon:H.exclamationMarkTriangle,kind:"danger",label:e.errorOccured,open:this._hasAttachmentsViewError,slot:"alerts",onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},z("span",{slot:"message"},e.errorOccured))}_renderFooterContent(){if(!this.hasPendingEdits||!this.visibleElements.pendingEditsFooter)return;const{hasInvalidPendingEdits:e,isQueryingOrSyncing:t,messages:i,messagesCommon:l}=this,o=e||t,n=this.hasContingentValues,s=[z("calcite-button",{appearance:"outline",disabled:t,iconStart:H.reset,key:"footer-reset-button",onclick:()=>this.cancelPendingEdits(),slot:"footer-end",width:"auto"},l.reset),z("calcite-button",{disabled:o,iconStart:H.save,key:"footer-save-button",loading:this.isSyncing,onclick:()=>{this.savePendingEdits()},slot:"footer-end",width:"auto"},l.save)];if(n){const t=e?i.contingentValues.hasInvalidValues:i.contingentValues.hasValidValues,l=e?z("calcite-icon",{class:N.footerIconDanger,icon:H.exclamationMarkTriangle,scale:"s",slot:"footer-start"}):void 0;s.push(z("div",{class:N.footerMessage,key:"footer-message",slot:"footer-start"},l,t))}return s}_renderPrompt(){return this.prompt?z(M,{...this.prompt,headingLevel:2}):void 0}_showDeletePrompt(){const{messages:e,messagesCommon:i}=this,l=t(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:l,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:i.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,i){const{messages:l,messagesCommon:o}=this,n=t(l.deleteAttachmentCount,{count:i.length});this.showPrompt({title:n,message:l.deleteAttachmentConfirmation,context:"danger",actions:{primary:{label:o.delete,action:async()=>{try{await this.deleteAttachments(e,i,!1)}finally{this.clearPrompt()}}},secondary:{label:o.cancel,action:()=>this.clearPrompt()}}})}async _onDeleteSelectionClick(){try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:l,text:o,clickFunction:n}=e;if(!i)return z("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:l??void 0,key:o,onclick:()=>n(),slot:"header-menu-actions",text:o,textEnabled:!0,title:o})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{messages:e}=this;return[this._showRefreshDataAction&&{icon:H.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:H.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:H.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:H.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:H.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:H.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:H.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(i).map(e=>e&&this._renderHeaderMenuAction(e))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:i,label:l,clickFunction:o})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:l,disabled:e,clickFunction:e=>o(e)}))??[]}_renderColumnVisibilityAction(){if(!this._showColumnsVisibilityAction)return[];const{_columnVisibilityActions:e,effectiveTable:t,id:i}=this,l=this.messages.toggleColumns;return z("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),appearance:"transparent",bind:this,disabled:t.menuConfig?.disabled,icon:H.showColumn,id:`${i}__toggle-columns-action`,slot:"header-actions-end",text:l},this._effectiveVisibleElements.tooltips?z("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",slot:"tooltip"},l):null)}_renderColumnVisibilityPopover(){if(!this._showColumnsVisibilityAction||this.effectiveTable.menuConfig?.disabled)return;const{effectiveTable:e}=this,t=this.messages.toggleColumns;return z("calcite-popover",{autoClose:!0,class:N.menuPopover,label:t,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:this._columnVisibilityActions.get(this.id)},z("calcite-list",{displayMode:"nested",filterEnabled:!0,filterPlaceholder:t,label:t,selectionMode:"multiple"},e.columns.toArray().map(t=>{const i=E(t)?t.columns?.map(t=>this._renderColumnListItem({column:t,table:e,ignoreSelect:!0})):void 0;return this._renderColumnListItem({column:t,table:e,items:i})})))}_renderColumnListItem(e){const{column:t,table:i,items:l,ignoreSelect:o}=e,{effectiveLabel:n,fieldName:s,hidden:a}=t;return z("calcite-list-item",{expanded:!(!l?.length||a)||void 0,key:`toggle-columns__item-${s}`,label:n,selected:!a,value:s,onCalciteListItemSelect:e=>{o&&e.stopPropagation(),i.toggleColumnVisibility(e.currentTarget.value)}},l)}_renderLayerDropdown(){const e=this.messages.selectALayer;return z("div",{class:N.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},z("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start"},z("calcite-action",{icon:H.layers,slot:"trigger",text:e,title:e}),z("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return z("calcite-dropdown-item",{iconStart:i?P(e):void 0,key:`dropdown-item-${t}`,label:e.title??"",selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>{this.layer=e}},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){const{autoRefreshEnabled:t,autoSaveEnabled:i,editingEnabled:l,effectiveTable:o,paginationEnabled:n,pageSize:s,view:a,viewModel:r}=this,{layer:c,objectId:d,relatedLayer:h,relationshipId:p}=e;await c.load();const m=this.attachmentsEnabled&&R(c),u=new $({layer:c,autoRefreshEnabled:t,autoSaveEnabled:i,attachmentsEnabled:m,editingEnabled:l,paginationEnabled:n,pageSize:s,relatedRecordsEnabled:!0,relationshipConfig:{objectId:d,relatedLayer:h,relationshipId:p},relationshipColumnConfigs:k(c,p),tableController:this,tableParent:o,view:a,showRelatedTableCallback:e=>r.emit("show-related-table",e)});this.relatedTables.add(u),this.scheduleRender()}_renderAttachmentsView(){const{attachmentInfos:e,mode:t,objectId:i}=this.attachmentsViewOptions;return"file"!==t&&e.length&&null!=i?this._renderAttachmentsViewList():this._renderAttachmentsViewFilePane()}_renderAttachmentsViewFilePane(){const{attachmentsViewOptions:e,isSyncingAttachments:t,supportsAddAttachments:i,messages:l,messagesUnits:o}=this,{attachmentId:n,attachmentInfos:s,candidates:a,objectId:c}=e,d=s.find(e=>e.id===n),h=s.length,p=a?.length,m=d?z("calcite-label",{alignment:"center",key:"replace-file-node",scale:"l"},l.replaceFile):void 0,u=p?void 0:z("calcite-label",{alignment:"center",key:"message-node",scale:"m"},i?null==c?l.noFeature:l.dragAndDropToUpload:l.editingRestricted),g=Array.from(a??[]).pop(),b=g?z("calcite-label",{key:"filename-node"},g.name):void 0,w=i&&null!=c,v=w&&p,y=z("input",{afterCreate:L,afterRemoved:j,afterUpdate:L,bind:this,"data-node-ref":"_attachmentsInput",files:a,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),f=w?z("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:H.folderOpen,key:"select-node",loading:!1,onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value="",this._attachmentsInput.click())},width:"full"},l.selectFile):void 0,_=v?z("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:H.save,key:"save-node",loading:t,onclick:()=>{this.saveAttachmentsViewForm()},width:"full"},d?l.updateAttachment:l.addAttachment):void 0,M=h||p?z("calcite-button",{appearance:"transparent",bind:this,disabled:t,key:"cancel-node",onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value=""),e.reset(),e.attachmentInfos?.length&&(e.mode="list")},width:"full"},this.messagesCommon.cancel):void 0;return[z("div",{class:N.attachmentsView,key:"attachments-view"},z("div",{class:N.attachmentsViewContent,key:"attachments-view-content"},z("div",{bind:this,class:N.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},z("calcite-icon",{class:N.attachmentsViewIcon,icon:H.upload,scale:"l"}),m,u,z("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},z("fieldset",null,b,y,f,_,M)))),null!=c&&null!=d?z("div",{class:N.attachmentsViewInformation,key:"information"},this._renderAttachmentsViewThumbnail(d,200),z("label",{key:"file-label"},l.fileName),z("span",{key:"file-span"},d.name),z("label",{key:"size-label"},l.size),z("span",{key:"size-span"},r(o,d.size??0))):void 0)]}_renderAttachmentsViewList(){const{attachmentsViewOptions:e,isSyncingAttachments:t,messages:i,messagesUnits:l,supportsDeleteAttachments:o,supportsUpdateAttachments:n}=this,{attachmentInfos:s,objectId:a}=e;return z("calcite-list",{afterCreate:L,afterRemoved:j,afterUpdate:L,bind:this,class:N.attachmentsViewList,"data-node-ref":"attachmentsList",key:`attachments-list-${a}`,label:i?.attachments,loading:t,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop,selectionMode:"multiple",onCalciteListChange:()=>this.scheduleRender()},...s?.map(t=>{const{id:s,name:c,size:d,url:h}=t,p=r(l,d??0);return z("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${s}`,label:c,value:s},this._renderAttachmentsViewListThumbnail(t),z("span",{class:N.attachmentsViewListFileSize,slot:"actions-end",title:p},p),z("calcite-action",{appearance:"transparent",icon:H.downloadTo,key:`download-attachment-${s}`,label:`${c}`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(a??-1,s)},slot:"actions-end",text:i.downloadAttachment,title:i.downloadAttachment}),n&&null!=a?z("calcite-action",{appearance:"transparent",disabled:!n,icon:H.replaceImage,key:`replace-attachment-${s}`,label:`${c}`,onclick:()=>{e.mode="file",e.attachmentId=s},slot:"actions-end",text:i.updateAttachment,title:i.updateAttachment}):void 0,z("calcite-action",{appearance:"transparent",icon:H.launch,key:`launch-attachment-${s}`,label:`${c}`,onclick:()=>{h&&window.open(h,"_blank")},slot:"actions-end",text:i.viewAttachment,title:i.viewAttachment}),o&&null!=a?z("calcite-action",{appearance:"transparent",class:N.attachmentsViewListItemDelete,disabled:!o,icon:H.delete,key:`delete-attachment-${s}`,label:`${c}`,onclick:()=>{this.deleteAttachments(a,[s],!0)},slot:"actions-end",text:i.deleteAttachment,title:i.deleteAttachment}):void 0)}))}_renderAttachmentsViewListThumbnail(e){return z("div",{class:N.attachmentsViewListThumbnail,slot:"content-start"},z("a",{href:e.url??"",rel:"noreferrer",target:"_blank"},this._renderAttachmentsViewThumbnail(e)))}_renderAttachmentsViewThumbnail(e,t=64){const{contentType:i,name:l,size:o,url:n}=e,s=`${n}${n?.includes("?")?"&":"?"}w=${t}&s=${o}`;return this.supportsResizeAttachments&&y(i)?z("img",{alt:l,key:`thumbnail-image-${l}`,src:s,title:l}):z("calcite-icon",{icon:f(i),key:`thumbnail-icon-${l}`,scale:"l",textLabel:l,title:l})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&this.attachmentsViewOptions.set({mode:"file",candidates:e.dataTransfer?.files})}_renderNavigationBar(){const{effectiveTable:e,messages:i,messagesCommon:l,navigationScale:o,relatedTable:n,relatedTables:s}=this;if(!this._shouldShowNavigationBar)return;const{attachmentsList:a,attachmentsViewOptions:r,layer:c,supportsAddAttachments:d,supportsDeleteAttachments:h}=e;if(!c)return;const{attachmentInfos:p,objectId:m}=r,u=null!=m,g=p.length,b=a?.selectedItems?.length??0,w=`${c.objectIdField}: ${m}`,v=t(i.selectedCount,{count:b}),y=t(i.attachmentsCount,{count:g}),f=u?z("calcite-action",{bind:this,icon:H.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(m),scale:o,text:w,textEnabled:!0,title:w}):void 0,_=u?z("calcite-action",{icon:H.chevronRight,iconFlipRtl:!0,key:"navigation-attachments-label",label:y,onclick:()=>{g>0&&(r.mode="list")},scale:o,text:y,textEnabled:!0,title:y}):void 0,M=u?z("calcite-chip",{closable:!0,closed:0===b,key:"navigation-chip",kind:"inverse",label:v,scale:o,selected:!0,title:v,value:"selected",onCalciteChipClose:()=>a?.selectedItems?.forEach(e=>e.selected=!1)},v):void 0,C=n?z("calcite-label",{layout:"inline",scale:o},i.showAllTables,z("calcite-switch",{checked:this.allRelatedTablesVisible,scale:o,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,S=u&&"list"===r.mode&&null!=m&&b&&h?z("calcite-action",{icon:H.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(m,a?.selectedItems?.map(e=>e.value)??[],!0)},scale:o,text:l.delete,textEnabled:!0,title:t(i.deleteAttachmentCount,{count:b})}):void 0,A=u&&"list"===r.mode&&d?z("calcite-action",{bind:this,icon:H.plus,iconFlipRtl:!0,key:"attachments-add",onclick:()=>{r.attachmentId=null,r.mode="file"},scale:o,text:i.addAttachment,textEnabled:!0,title:i.addAttachment}):void 0;return z("div",{class:N.tableNavigation,key:"table-nav"},z("calcite-action",{icon:H.moveUp,iconFlipRtl:!0,key:"go-back",onclick:()=>{n&&this.drainRelatedTables(),e.attachmentsViewOptions.objectId=null},scale:o,text:this.layer?.title??"",textEnabled:!1,title:n?i.exitRelatedRecords:i.exitAttachments}),s.toArray().map((e,t)=>this._renderRelatedTableNavigationAction(e,t)),f,_,z("div",null,M,C,S,A))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return z("calcite-action",{icon:H.chevronRight,iconFlipRtl:!0,key:t,onclick:()=>this._onRelatedNavigationItemClick(t),scale:this.navigationScale,text:i,textEnabled:!0,title:e.layer?.title||""})}_getLabelForRelatedTableNavigationAction(e){const t=e.layer?.title;if(!t)return"";const{relatedTables:i}=this;if(i.length<=1)return t;return i.indexOf(e)!==i.length-1&&t.length>20?`${t.slice(0,20)}...`:t}};e([c()],Z.prototype,"_attachmentsInput",void 0),e([c()],Z.prototype,"_columnVisibilityActions",void 0),e([c()],Z.prototype,"_effectiveDescription",null),e([c()],Z.prototype,"_effectiveLayers",null),e([c()],Z.prototype,"_effectiveTitle",null),e([c()],Z.prototype,"_effectiveVisibleElements",null),e([c()],Z.prototype,"_filteredTables",null),e([c()],Z.prototype,"_hasAttachmentsViewError",null),e([c()],Z.prototype,"_hasCustomMenuItems",null),e([c()],Z.prototype,"_hasDefaultMenuItems",null),e([c()],Z.prototype,"_shouldShowGrid",null),e([c()],Z.prototype,"_shouldShowMenu",null),e([c()],Z.prototype,"_shouldShowAttachmentsView",null),e([c()],Z.prototype,"_showClearSelectionAction",null),e([c()],Z.prototype,"_showColumnsVisibilityAction",null),e([c()],Z.prototype,"_showDeleteSelectionAction",null),e([c()],Z.prototype,"_showExportSelectionToCSVAction",null),e([c()],Z.prototype,"_showLayerDropdown",null),e([c()],Z.prototype,"_shouldShowNavigationBar",null),e([c()],Z.prototype,"_showRefreshDataAction",null),e([c()],Z.prototype,"_showSelectedRecordsShowSelectedAction",null),e([c()],Z.prototype,"_showSelectedRecordsShowAllAction",null),e([c()],Z.prototype,"_showZoomToSelectionAction",null),e([c()],Z.prototype,"_viewLayers",null),e([c()],Z.prototype,"attachmentsList",void 0),e([c({readOnly:!0})],Z.prototype,"grid",null),e([c()],Z.prototype,"actionColumn",null),e([c()],Z.prototype,"actionColumnConfig",null),e([c({readOnly:!0})],Z.prototype,"activeFilters",null),e([c({readOnly:!0})],Z.prototype,"activeSortOrders",null),e([c()],Z.prototype,"allColumns",null),e([c({readOnly:!0})],Z.prototype,"allRelatedTablesVisible",null),e([c()],Z.prototype,"allVisibleColumns",null),e([c()],Z.prototype,"attachmentsColumns",null),e([c()],Z.prototype,"attachmentsEnabled",null),e([c()],Z.prototype,"attachmentsViewOptions",null),e([c({type:b})],Z.prototype,"attributeTableTemplate",null),e([c()],Z.prototype,"autoRefreshEnabled",null),e([c()],Z.prototype,"autoSaveEnabled",null),e([c()],Z.prototype,"clearPrompt",null),e([c()],Z.prototype,"columnPerformanceModeEnabled",null),e([c()],Z.prototype,"columnReorderingEnabled",null),e([c({readOnly:!0})],Z.prototype,"columns",null),e([c()],Z.prototype,"definitionExpression",null),e([c()],Z.prototype,"description",void 0),e([c()],Z.prototype,"disabled",void 0),e([c()],Z.prototype,"editingEnabled",null),e([c()],Z.prototype,"effectiveSize",null),e([c()],Z.prototype,"effectiveTable",null),e([c()],Z.prototype,"fieldColumns",null),e([c({types:h})],Z.prototype,"filterGeometry",null),e([c()],Z.prototype,"filterBySelectionEnabled",null),e([c()],Z.prototype,"groupColumns",null),e([c()],Z.prototype,"hasContingentValues",null),e([c()],Z.prototype,"hasInvalidPendingEdits",null),e([c()],Z.prototype,"hasPendingEdits",null),e([c()],Z.prototype,"hiddenFields",null),e([c()],Z.prototype,"highlightEnabled",null),e([c()],Z.prototype,"highlightIds",null),e([c()],Z.prototype,"icon",null),e([c()],Z.prototype,"initialSize",null),e([c()],Z.prototype,"isQueryingOrSyncing",null),e([c()],Z.prototype,"isSyncing",null),e([c()],Z.prototype,"isSyncingAttachments",null),e([c()],Z.prototype,"label",null),e([c()],Z.prototype,"layer",null),e([c()],Z.prototype,"layers",null),e([c()],Z.prototype,"layerView",null),e([c()],Z.prototype,"maxSize",null),e([c(),F("esri/widgets/FeatureTable/t9n/FeatureTable")],Z.prototype,"messages",null),e([c(),F("esri/t9n/common")],Z.prototype,"messagesCommon",null),e([c(),F("esri/core/t9n/Units")],Z.prototype,"messagesUnits",null),e([c(),F("esri/widgets/support/t9n/uriUtils")],Z.prototype,"messagesURIUtils",null),e([c()],Z.prototype,"menuConfig",null),e([c()],Z.prototype,"multipleSelectionEnabled",null),e([c()],Z.prototype,"multiSortEnabled",null),e([c()],Z.prototype,"multipleSortPriority",null),e([c()],Z.prototype,"navigationScale",void 0),e([c()],Z.prototype,"noDataMessage",null),e([c()],Z.prototype,"objectIds",null),e([c()],Z.prototype,"outFields",null),e([c()],Z.prototype,"pageCount",null),e([c()],Z.prototype,"pageIndex",null),e([c()],Z.prototype,"pageSize",null),e([c()],Z.prototype,"paginationEnabled",null),e([c()],Z.prototype,"prompt",null),e([c()],Z.prototype,"relatedRecordsEnabled",null),e([c()],Z.prototype,"relatedTable",null),e([c()],Z.prototype,"relatedTables",null),e([c()],Z.prototype,"relationship",null),e([c()],Z.prototype,"relationshipColumnConfigs",null),e([c()],Z.prototype,"relationshipColumns",null),e([c()],Z.prototype,"relationshipConfig",null),e([c()],Z.prototype,"relationshipInfos",null),e([c()],Z.prototype,"returnGeometryEnabled",null),e([c()],Z.prototype,"returnMEnabled",null),e([c()],Z.prototype,"returnZEnabled",null),e([c()],Z.prototype,"rowHighlightIds",null),e([c()],Z.prototype,"selectionSource",null),e([c()],Z.prototype,"showAllRelatedTables",null),e([c()],Z.prototype,"showPrompt",null),e([c()],Z.prototype,"showRelatedTableCallback",null),e([c()],Z.prototype,"size",null),e([c({readOnly:!0})],Z.prototype,"state",null),e([c()],Z.prototype,"supportsAddAttachments",null),e([c()],Z.prototype,"supportsAttachments",null),e([c()],Z.prototype,"supportsDeleteAttachments",null),e([c()],Z.prototype,"supportsResizeAttachments",null),e([c()],Z.prototype,"supportsUpdateAttachments",null),e([c()],Z.prototype,"syncTemplateOnChangesEnabled",null),e([c({constructOnly:!0})],Z.prototype,"tableController",null),e([c({constructOnly:!0})],Z.prototype,"tableParent",null),e([c({type:T})],Z.prototype,"tableTemplate",null),e([c()],Z.prototype,"tableTemplateOverride",null),e([c()],Z.prototype,"title",void 0),e([c({type:w})],Z.prototype,"timeExtent",null),e([c()],Z.prototype,"timeZone",null),e([c()],Z.prototype,"view",null),e([c({type:S}),O(["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder","show-related-table"])],Z.prototype,"viewModel",void 0),e([c()],Z.prototype,"visibleColumns",null),e([c({type:A,nonNullable:!0})],Z.prototype,"visibleElements",void 0),e([c({type:A})],Z.prototype,"visibleElementsOverride",null),Z=$=e([d("esri.widgets.FeatureTable")],Z);const G=Z;export{G as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{substitute as t}from"../intl.js";import{isSome as i}from"../core/arrayUtils.js";import{watch as l,on as o,sync as n,initial as s}from"../core/reactiveUtils.js";import{renderingSanitizer as a}from"../core/sanitizerUtils.js";import{formatFileSize as r}from"../core/unitFormatUtils.js";import{property as c,subclass as d}from"../core/accessorSupport/decorators.js";import{geometryTypes as h}from"../geometry/support/typeUtils.js";import{isLayerFromCatalog as m}from"../layers/catalog/catalogUtils.js";import{isKnowledgeGraphLayer as p,isMapImageLayer as u,isSubtypeGroupLayer as g}from"../layers/support/layerUtils.js";import b from"../tables/AttributeTableTemplate.js";import w from"../time/TimeExtent.js";import v from"./Widget.js";import{isSupportedImage as y,getCalciteIconForAttachment as f}from"./Attachments/support/attachmentUtils.js";import{loadPromptComponents as _,Prompt as M}from"./Editor/components/Prompt.js";import C from"./FeatureTable/ColumnMenuVisibleElements.js";import S from"./FeatureTable/FeatureTableViewModel.js";import A from"./FeatureTable/VisibleElements.js";import{isGroupColumn as E}from"./FeatureTable/support/columnUtils.js";import T from"./FeatureTable/support/TableTemplate.js";import{loadFieldColumnComponents as V,isIFeatureTableSupportedLayer as I,isIFeatureTableSupportedLayerWithAttachments as R,getRelationshipIdsToShow as k}from"./FeatureTable/support/tableUtils.js";import{loadCalciteComponents as x}from"./support/componentsUtils.js";import{globalCss as D}from"./support/globalCss.js";import{getIconForLayer as P}from"./support/iconUtils.js";import{messageBundle as F,vmEvent as O,tsx as z}from"./support/widget.js";import{storeNode as L,discardNode as j}from"./support/widgetUtils.js";var $;const U="esri-feature-table",B=`${U}__attachments-view`,N={base:U,content:`${U}__content`,menuPopover:`${U}__menu-popover`,layerDropdownMenu:`${U}__layer-switcher-menu`,tableContainer:`${U}__table-container`,tableContainerWithAttachments:`${U}__table-container--attachments`,tableNavigation:`${U}__table-navigation`,attachmentsView:B,attachmentsViewContent:`${B}__content`,attachmentsViewDropArea:`${B}__drop-area`,attachmentsViewIcon:`${B}__icon`,attachmentsViewInformation:`${B}__information`,attachmentsViewList:`${B}__list`,attachmentsViewListFileSize:`${B}__list__filesize`,attachmentsViewListItemDelete:`${B}__list-item--delete`,attachmentsViewListThumbnail:`${B}__list__thumbnail`,expanded:`${U}__expanded`,collapsed:`${U}__collapsed`,footerMessage:`${U}__footer__message`,footerIconDanger:`${U}__footer__icon--danger`},H={chevronRight:"chevron-right",clearSelection:"clear-selection",downloadTo:"download-to",exclamationMarkTriangle:"exclamation-mark-triangle",exportToCSV:"file-csv",folderOpen:"folder-open",delete:"trash",launch:"launch",layers:"layers",moveUp:"move-up",plus:"plus",refresh:"refresh",replaceImage:"replace-image",reset:"reset",save:"save",showAll:"selection-x",showColumn:"show-column",showSelected:"selection-filter",upload:"upload",zoomToSelection:"zoom-to-object"};let Z=$=class extends v{constructor(e,t){super(e,t),this._attachmentsInput=null,this._columnVisibilityActions=new Map,this.attachmentsList=null,this.description=null,this.disabled=!1,this.navigationScale="m",this.title=null,this.viewModel=new S,this.visibleElements=new A,this._showDeletePrompt=this._showDeletePrompt.bind(this),this._onDeleteSelectionClick=this._onDeleteSelectionClick.bind(this)}initialize(){this.addHandles([l(()=>[this.isQueryingOrSyncing,this.editingEnabled],()=>this.scheduleRender()),l(()=>[this._effectiveVisibleElements,this._effectiveVisibleElements.columnDescriptions,this._effectiveVisibleElements.columnMenus,this._effectiveVisibleElements.columnMenuItems,this.columns.length],()=>{this.columns.forEach(e=>e.visibleElements=this._effectiveVisibleElements),this.refreshCellContent()},n),l(()=>this._effectiveVisibleElements.selectionColumn,e=>{this.grid&&(this.grid.selectionColumnEnabled=e)},s),o(()=>this.viewModel,"show-related-table",e=>this._onShowRelatedTable(e)),l(()=>this.editingEnabled,()=>{const{attachmentsViewOptions:e}=this;this.clearPrompt(),e&&(e.form?.reset(),e.candidates=null)})])}loadDependencies(){return Promise.all([x({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),alert:()=>import("@esri/calcite-components/dist/components/calcite-alert"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),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"),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"),pagination:()=>import("@esri/calcite-components/dist/components/calcite-pagination"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover"),progress:()=>import("@esri/calcite-components/dist/components/calcite-progress"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),tooltip:()=>import("@esri/calcite-components/dist/components/calcite-tooltip")}),_(),V()])}destroy(){this.drainRelatedTables(),this.clearPrompt()}get _effectiveDescription(){const{description:e}=this;return null!=e?a.sanitize("function"==typeof e?e():e):void 0}get _effectiveLayers(){const{layer:e,layers:t}=this,i=t?.length?t.filter(I):[],l=i.length?i:[...this._viewLayers];return e&&!l.includes(e)&&l.push(e),l}get _effectiveTitle(){const{layer:e,messages:i,state:l,highlightIds:o,title:n,size:s}=this;if(n)return a.sanitize("function"==typeof n?n():n);if(!e)return i.noLayer;switch(l){case"disabled":return i.errorLayer;case"ready":case"loading":return i.loading;case"error":return i.errorData}return t(i.header,{title:a.sanitize(e.title),count:s,selected:o.length})}get _effectiveVisibleElements(){return this.visibleElementsOverride??this.visibleElements}get _filteredTables(){const e=this.relatedTables.toArray(),t=1===e.length;return this.allRelatedTablesVisible?e:t?[e[0]]:this._shouldShowAttachmentsView?e.slice(-1):e.slice(-2)}get _hasAttachmentsViewError(){return null!=this.attachmentsViewOptions.error}get _hasCustomMenuItems(){return!!this.menuConfig?.items?.length}get _hasDefaultMenuItems(){return!!(this._showClearSelectionAction||this._showDeleteSelectionAction||this._showExportSelectionToCSVAction||this._showRefreshDataAction||this._showZoomToSelectionAction||this._showSelectedRecordsShowSelectedAction||this._showSelectedRecordsShowAllAction||this._showColumnsVisibilityAction)}get _shouldShowGrid(){return this.allRelatedTablesVisible||1===this.relatedTables.length&&!this._shouldShowAttachmentsView}get _shouldShowMenu(){const{header:e,menu:t}=this._effectiveVisibleElements;return!(!e||!t||!this._hasDefaultMenuItems&&!this._hasCustomMenuItems)}get _shouldShowAttachmentsView(){return!(null==this.attachmentsViewOptions.objectId&&!this.relatedTables.some(e=>null!=e.attachmentsViewOptions.objectId))}get _showClearSelectionAction(){return!(!this.highlightIds.length||!this._effectiveVisibleElements.menuItems?.clearSelection||this.relatedTables.length||this._shouldShowAttachmentsView)}get _showColumnsVisibilityAction(){const{header:e,menu:t,menuItems:i}=this._effectiveVisibleElements;return!(!(e&&t&&i?.toggleColumns)||this.showRelatedTableCallback||this.allRelatedTablesVisible||this._shouldShowAttachmentsView)}get _showDeleteSelectionAction(){return!(!(this.editingEnabled&&this.highlightIds.length&&this._effectiveVisibleElements.menuItems?.deleteSelection&&this.layer?.capabilities?.operations?.supportsDelete)||this.relatedTables.length||this._shouldShowAttachmentsView)}get _showExportSelectionToCSVAction(){return!(!(this._effectiveVisibleElements.menuItems.exportSelectionToCSV&&this.layer&&this.highlightIds.length)||this.relatedTables.length)}get _showLayerDropdown(){return!(!this._effectiveLayers.length||!this._effectiveVisibleElements.layerDropdown)}get _shouldShowNavigationBar(){const e=!!this.relatedTable||this._shouldShowAttachmentsView;return!this.tableParent&&e}get _showRefreshDataAction(){return!!this._effectiveVisibleElements.menuItems?.refreshData}get _showSelectedRecordsShowSelectedAction(){const e=this.objectIds.length,t=this.highlightIds.length;return!(!t||!this._effectiveVisibleElements.menuItems?.selectedRecordsShowSelectedToggle||e&&t===e||this.relatedTables.length||this._shouldShowAttachmentsView)}get _showSelectedRecordsShowAllAction(){return!(!this._effectiveVisibleElements.menuItems?.selectedRecordsShowAllToggle||!this.objectIds.length||this.relatedTables.length)}get _showZoomToSelectionAction(){return!(!this.view||!this.highlightIds.length||this.effectiveTable.layer?.isTable||!this._effectiveVisibleElements.menuItems?.zoomToSelection)}get _viewLayers(){const e=this.view?.map;if(!e)return[];const t=new Set,i=e=>{!I(e)||g(e)||t.has(e)||"sublayer"===e.type&&!e.capabilities?.operations?.supportsQuery||(e.load(),t.add(e))},l=e=>{m(e)||"catalog-footprint"===e.type||(p(e)?(e.load(),e.layers?.forEach(i),e.tables?.forEach(i)):u(e)?(e.loadAll(),e.allSublayers?.forEach(i),e.subtables?.forEach(i)):g(e)?(e.loadAll(),e.sublayers?.forEach(i)):i(e))};return e.allLayers.forEach(l),e.allTables.forEach(l),[...t.values()]}get grid(){return this.viewModel.grid}get actionColumn(){return this.viewModel.actionColumn}get actionColumnConfig(){return this.viewModel.actionColumnConfig}set actionColumnConfig(e){this.viewModel.actionColumnConfig=e}get activeFilters(){return this.viewModel.activeFilters}get activeSortOrders(){return this.viewModel.activeSortOrders}get allColumns(){return this.viewModel.allColumns}get allRelatedTablesVisible(){return this.viewModel.allRelatedTablesVisible}get allVisibleColumns(){return this.viewModel.allVisibleColumns}get attachmentsColumns(){return this.viewModel.attachmentsColumns}get attachmentsEnabled(){return this.viewModel.attachmentsEnabled}set attachmentsEnabled(e){this.viewModel.attachmentsEnabled=e}get attachmentsViewOptions(){return this.viewModel.attachmentsViewOptions}set attachmentsViewOptions(e){this.viewModel.attachmentsViewOptions=e}get attributeTableTemplate(){return this.viewModel.attributeTableTemplate}set attributeTableTemplate(e){this.viewModel.attributeTableTemplate=e}get autoRefreshEnabled(){return this.viewModel.autoRefreshEnabled}set autoRefreshEnabled(e){this.viewModel.autoRefreshEnabled=e}get autoSaveEnabled(){return this.viewModel.autoSaveEnabled}set autoSaveEnabled(e){this.viewModel.autoSaveEnabled=e}get clearPrompt(){return this.viewModel.clearPrompt}set clearPrompt(e){this.viewModel.clearPrompt=e}get columnPerformanceModeEnabled(){return this.viewModel.columnPerformanceModeEnabled}set columnPerformanceModeEnabled(e){this.viewModel.columnPerformanceModeEnabled=e}get columnReorderingEnabled(){return this.viewModel.columnReorderingEnabled}set columnReorderingEnabled(e){this.viewModel.columnReorderingEnabled=e}get columns(){return this.viewModel.columns}get definitionExpression(){return this.viewModel.definitionExpression}set definitionExpression(e){this.viewModel.definitionExpression=e}get container(){return super.container}set container(e){super.container=e}get editingEnabled(){return this.viewModel.editingEnabled}set editingEnabled(e){this.viewModel.editingEnabled=e}get effectiveSize(){return this.viewModel.effectiveSize}get effectiveTable(){return this.relatedTable||this}get fieldColumns(){return this.viewModel.fieldColumns}get filterGeometry(){return this.viewModel.filterGeometry}set filterGeometry(e){this.viewModel.filterGeometry=e}get filterBySelectionEnabled(){return this.viewModel.filterBySelectionEnabled}set filterBySelectionEnabled(e){this.viewModel.filterBySelectionEnabled=e}get groupColumns(){return this.viewModel.groupColumns}get hasContingentValues(){return this.viewModel.hasContingentValues}get hasInvalidPendingEdits(){return this.viewModel.hasInvalidPendingEdits}get hasPendingEdits(){return this.viewModel.hasPendingEdits}get hiddenFields(){return this.viewModel.hiddenFields}set hiddenFields(e){this.viewModel.hiddenFields=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get highlightIds(){return this.viewModel.highlightIds}set highlightIds(e){this.viewModel.highlightIds=e}get icon(){return"table"}set icon(e){this._overrideIfSome("icon",e)}get initialSize(){return this.viewModel.initialSize}set initialSize(e){this.viewModel.initialSize=e}get isQueryingOrSyncing(){return this.viewModel.isQueryingOrSyncing}get isSyncing(){return this.viewModel.isSyncing}get isSyncingAttachments(){return this.viewModel.isSyncingAttachments}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}get layerView(){return this.viewModel.layerView}get maxSize(){return this.viewModel.maxSize}set maxSize(e){this.viewModel.maxSize=e}get messages(){return this.viewModel.messages}set messages(e){this.viewModel.messages=e}get messagesCommon(){return this.viewModel.messagesCommon}set messagesCommon(e){this.viewModel.messagesCommon=e}get messagesUnits(){return this.viewModel.messagesUnits}set messagesUnits(e){this.viewModel.messagesUnits=e}get messagesURIUtils(){return this.viewModel.messagesURIUtils}set messagesURIUtils(e){this.viewModel.messagesURIUtils=e}get menuConfig(){return this.viewModel.menuConfig}set menuConfig(e){this.viewModel.menuConfig=e}get multipleSelectionEnabled(){return this.viewModel.multipleSelectionEnabled}set multipleSelectionEnabled(e){this.viewModel.multipleSelectionEnabled=e}get multiSortEnabled(){return this.viewModel.multiSortEnabled}set multiSortEnabled(e){this.viewModel.multiSortEnabled=e}get multipleSortPriority(){return this.viewModel.multipleSortPriority}set multipleSortPriority(e){this.viewModel.multipleSortPriority=e}get noDataMessage(){return this.viewModel.noDataMessage}set noDataMessage(e){this.viewModel.noDataMessage=e}get objectIds(){return this.viewModel.objectIds}set objectIds(e){this.viewModel.objectIds=e}get outFields(){return this.viewModel.outFields}set outFields(e){this.viewModel.outFields=e}get pageCount(){return this.viewModel.pageCount}get pageIndex(){return this.viewModel.pageIndex}set pageIndex(e){this.viewModel.pageIndex=e}get pageSize(){return this.viewModel.pageSize}set pageSize(e){this.viewModel.pageSize=e}get paginationEnabled(){return this.viewModel.paginationEnabled}set paginationEnabled(e){this.viewModel.paginationEnabled=e}get prompt(){return this.viewModel.prompt}set prompt(e){this.viewModel.prompt=e}get relatedRecordsEnabled(){return this.viewModel.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.viewModel.relatedRecordsEnabled=e}get relatedTable(){return this.viewModel.relatedTable}get relatedTables(){return this.viewModel.relatedTables}set relatedTables(e){this.viewModel.relatedTables=e}get relationship(){return this.viewModel.relationship}get relationshipColumnConfigs(){return this.viewModel.relationshipColumnConfigs}set relationshipColumnConfigs(e){this.viewModel.relationshipColumnConfigs=e}get relationshipColumns(){return this.viewModel.relationshipColumns}get relationshipConfig(){return this.viewModel.relationshipConfig}set relationshipConfig(e){this.viewModel.relationshipConfig=e}get relationshipInfos(){return this.viewModel.relationshipInfos}get returnGeometryEnabled(){return this.viewModel.returnGeometryEnabled}set returnGeometryEnabled(e){this.viewModel.returnGeometryEnabled=e}get returnMEnabled(){return this.viewModel.returnMEnabled}set returnMEnabled(e){this.viewModel.returnMEnabled=e}get returnZEnabled(){return this.viewModel.returnZEnabled}set returnZEnabled(e){this.viewModel.returnZEnabled=e}get rowHighlightIds(){return this.viewModel.rowHighlightIds}set rowHighlightIds(e){this.viewModel.rowHighlightIds=e}get selectionSource(){return this.viewModel.selectionSource}set selectionSource(e){this.viewModel.selectionSource=e}get showAllRelatedTables(){return this.viewModel.showAllRelatedTables}set showAllRelatedTables(e){this.viewModel.showAllRelatedTables=e}get showPrompt(){return this.viewModel.showPrompt}set showPrompt(e){this.viewModel.showPrompt=e}get showRelatedTableCallback(){return this.viewModel.showRelatedTableCallback}set showRelatedTableCallback(e){this.viewModel.showRelatedTableCallback=e}get size(){return this.viewModel.size}get state(){return this.viewModel.state}get supportsAddAttachments(){return this.viewModel.supportsAddAttachments}get supportsAttachments(){return this.viewModel.supportsAttachments}get supportsDeleteAttachments(){return this.viewModel.supportsDeleteAttachments}get supportsResizeAttachments(){return this.viewModel.supportsResizeAttachments}get supportsUpdateAttachments(){return this.viewModel.supportsUpdateAttachments}get syncTemplateOnChangesEnabled(){return this.viewModel.syncTemplateOnChangesEnabled}set syncTemplateOnChangesEnabled(e){this.viewModel.syncTemplateOnChangesEnabled=e}get tableController(){return this.viewModel.tableController}set tableController(e){this.viewModel.tableController=e}get tableParent(){return this.viewModel.tableParent}set tableParent(e){this.viewModel.tableParent=e}get tableTemplate(){return this.viewModel.tableTemplate}set tableTemplate(e){this.viewModel.tableTemplate=e}get tableTemplateOverride(){return this.viewModel.tableTemplateOverride}set tableTemplateOverride(e){this.viewModel.tableTemplateOverride=e}get timeExtent(){return this.viewModel.timeExtent}set timeExtent(e){this.viewModel.timeExtent=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visibleColumns(){return this.viewModel.visibleColumns}get visibleElementsOverride(){const{attachmentsViewOptions:e,relatedTable:t,tableController:i,visibleElements:l}=this,{columnDescriptions:o,columnMenus:n,tooltips:s}=l,a=null!=e.objectId;if(t)return new A({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new C({sortAscending:!1,sortDescending:!1})});if(i){const e=i.relatedTable===this,t=i.allRelatedTablesVisible,r=e&&l.selectionColumn&&!t&&!a,c=e&&!t&&!a;return new A({columnDescriptions:o,columnMenus:n,tooltips:s,selectionColumn:r,close:!1,header:!1,layerDropdown:!1,menu:!1,progress:!1,columnMenuItems:new C({sortAscending:c,sortDescending:c})})}return a?new A({columnDescriptions:o,columnMenus:n,tooltips:s,close:l.close,header:l.header,layerDropdown:l.layerDropdown,layerDropdownIcons:l.layerDropdownIcons,menu:l.menu,menuItems:l.menuItems,progress:l.progress,selectionColumn:!1,columnMenuItems:new C({sortAscending:!1,sortDescending:!1})}):null}cancelPendingEdits(){this.viewModel.cancelPendingEdits()}clearSelectionFilter(){this.viewModel.clearSelectionFilter()}async deleteAttachments(e,t,i){null!=e&&t?.length&&(i?this._showDeleteAttachmentPrompt(e,t):await this.viewModel.deleteAttachments(e,t))}deleteSelection(e){return this.highlightIds.length?e?(this._showDeletePrompt(),this.scheduleRender(),Promise.resolve()):this.viewModel.deleteSelection():Promise.resolve()}async downloadAttachmentById(e,t){return this.viewModel.downloadAttachmentById(e,t)}drainRelatedTables(){this.viewModel.drainRelatedTables()}exportSelectionToCSV(e){return this.viewModel.exportSelectionToCSV(e)}filterBySelection(){this.viewModel.filterBySelection()}findColumn(e){return this.viewModel.findColumn(e)}goToPage(e){this.viewModel.goToPage(e)}hideColumn(e){this.grid?.hideColumn(e)}nextPage(){this.viewModel.nextPage()}previousPage(){this.viewModel.previousPage()}async refresh(){await this.viewModel.refresh()}refreshCellContent(){this.viewModel.refreshCellContent()}async saveAttachmentsViewForm(){await this.viewModel.saveAttachmentsViewForm()}async savePendingEdits(){await this.viewModel.savePendingEdits()}showAllColumns(){this.viewModel.showAllColumns()}showColumn(e){this.grid?.showColumn(e)}sortColumn(e,t){this.viewModel.sortColumn(e,t)}scrollLeft(){this.viewModel.scrollLeft()}scrollToBottom(){this.viewModel.scrollToBottom()}scrollToIndex(e){this.viewModel.scrollToIndex(e)}scrollToRow(e){this.viewModel.scrollToRow(e)}scrollToTop(){this.viewModel.scrollToTop()}toggleColumnVisibility(e){this.viewModel.toggleColumnVisibility(e)}zoomToSelection(){this.effectiveTable.viewModel.zoomToSelection()}render(){const{_effectiveVisibleElements:e,isQueryingOrSyncing:t,menuConfig:i,state:l}=this;return z("div",{bind:this,class:this.classes(N.base,D.widget)},z("calcite-panel",{bind:this,class:N.content,closable:e.close,description:this._effectiveDescription,disabled:this.disabled||"disabled"===l&&!this._effectiveLayers?.length,heading:e.header?this._effectiveTitle:void 0,key:"table-content",loading:"loading"===l,menuOpen:!!i?.open,overlayPositioning:"fixed",onCalcitePanelClose:e=>{e.currentTarget.closed=!1,this.emit("close")}},e.progress?z("calcite-progress",{type:t?"indeterminate":"determinate"}):null,this._showLayerDropdown?this._renderLayerDropdown():null,this._renderColumnVisibilityAction(),this._renderHeaderMenuActions(),this._renderNavigationBar(),this._renderTables(),this._renderError(),this._renderFooterContent()),this._renderColumnVisibilityPopover(),this._renderPrompt())}_renderTables(){const{grid:e,relatedTables:t}=this,i=this.classes(N.tableContainer);if(t.length){const l=this.classes(N.base,this.allRelatedTablesVisible?N.expanded:N.collapsed,this._shouldShowAttachmentsView?N.tableContainerWithAttachments:void 0);return z("div",{class:i},z("calcite-panel",{overlayPositioning:"fixed"},z("div",null,[this._shouldShowGrid?z("div",{class:l},e?.render(),this._renderPagination()):void 0,...this._filteredTables.map(e=>{const i=t.indexOf(e);return z("div",{class:l,key:`related-${i}`},e.render())}),,])))}return null!=this.attachmentsViewOptions.objectId?z("div",{class:i},z("calcite-panel",{overlayPositioning:"fixed"},z("div",null,[z("div",{class:this.classes(N.base,N.collapsed)},e?.render(),this._renderPagination()),this._renderAttachmentsView()]))):[z("div",{class:i},e?.render()),this._renderPagination()]}_renderPagination(){if(this.paginationEnabled)return z("calcite-pagination",{pageSize:1,startItem:this.pageIndex+1,totalItems:this.pageCount,onCalcitePaginationChange:e=>this.goToPage(e.currentTarget.startItem-1)})}_renderError(){const{messages:e}=this;return z("calcite-alert",{autoClose:!0,autoCloseDuration:"fast",icon:H.exclamationMarkTriangle,kind:"danger",label:e.errorOccured,open:this._hasAttachmentsViewError,slot:"alerts",onCalciteAlertClose:()=>{this.attachmentsViewOptions.error=null}},z("span",{slot:"message"},e.errorOccured))}_renderFooterContent(){if(!this.hasPendingEdits||!this.visibleElements.pendingEditsFooter)return;const{hasInvalidPendingEdits:e,isQueryingOrSyncing:t,messages:i,messagesCommon:l}=this,o=e||t,n=this.hasContingentValues,s=[z("calcite-button",{appearance:"outline",disabled:t,iconStart:H.reset,key:"footer-reset-button",onclick:()=>this.cancelPendingEdits(),slot:"footer-end",width:"auto"},l.reset),z("calcite-button",{disabled:o,iconStart:H.save,key:"footer-save-button",loading:this.isSyncing,onclick:()=>{this.savePendingEdits()},slot:"footer-end",width:"auto"},l.save)];if(n){const t=e?i.contingentValues.hasInvalidValues:i.contingentValues.hasValidValues,l=e?z("calcite-icon",{class:N.footerIconDanger,icon:H.exclamationMarkTriangle,scale:"s",slot:"footer-start"}):void 0;s.push(z("div",{class:N.footerMessage,key:"footer-message",slot:"footer-start"},l,t))}return s}_renderPrompt(){return this.prompt?z(M,{...this.prompt,headingLevel:2}):void 0}_showDeletePrompt(){const{messages:e,messagesCommon:i}=this,l=t(e.deleteSelectionCount,{count:this.highlightIds.length});this.showPrompt({title:l,message:e.deleteRecordsRemoved,context:"danger",actions:{primary:{label:i.delete,action:this._onDeleteSelectionClick},secondary:{label:e.keepRecords,action:()=>this.clearPrompt()}}})}_showDeleteAttachmentPrompt(e,i){const{messages:l,messagesCommon:o}=this,n=t(l.deleteAttachmentCount,{count:i.length});this.showPrompt({title:n,message:l.deleteAttachmentConfirmation,context:"danger",actions:{primary:{label:o.delete,action:async()=>{try{await this.deleteAttachments(e,i,!1)}finally{this.clearPrompt()}}},secondary:{label:o.cancel,action:()=>this.clearPrompt()}}})}async _onDeleteSelectionClick(){try{await this.viewModel.deleteSelection()}finally{this.clearPrompt()}}_renderHeaderMenuAction(e){const{disabled:t,hidden:i,icon:l,text:o,clickFunction:n}=e;if(!i)return z("calcite-action",{disabled:t??this.menuConfig?.disabled,icon:l??void 0,key:o,onclick:()=>n(),slot:"header-menu-actions",text:o,textEnabled:!0,title:o})}_renderHeaderMenuActions(){return this._shouldShowMenu?[this._renderDefaultHeaderMenuActions(),this._renderCustomHeaderMenuActions()]:[]}_renderDefaultHeaderMenuActions(){if(!this._hasDefaultMenuItems)return[];const{messages:e}=this;return[this._showRefreshDataAction&&{icon:H.refresh,text:e.refreshData,clickFunction:()=>this.refresh()},this._showDeleteSelectionAction&&{icon:H.delete,text:e.deleteSelection,clickFunction:()=>this.deleteSelection(!0)},this._showClearSelectionAction&&{icon:H.clearSelection,text:e.clearSelection,clickFunction:()=>this.highlightIds?.removeAll()},this._showZoomToSelectionAction&&{icon:H.zoomToSelection,text:e.zoomToSelection,clickFunction:()=>this.zoomToSelection()},this._showSelectedRecordsShowSelectedAction&&{icon:H.showSelected,text:e.showSelected,clickFunction:()=>{const{objectIds:e}=this;e.removeAll(),e.addMany(this.highlightIds.toArray())}},this._showSelectedRecordsShowAllAction&&{icon:H.showAll,text:e.showAllRecords,clickFunction:()=>this.objectIds.removeAll()},this._showExportSelectionToCSVAction&&{icon:H.exportToCSV,text:e.exportSelectionCSV,clickFunction:()=>this.exportSelectionToCSV()}].filter(i).map(e=>e&&this._renderHeaderMenuAction(e))}_renderCustomHeaderMenuActions(){return this.menuConfig?.items?.map(({disabled:e,hidden:t,icon:i,label:l,clickFunction:o})=>this._renderHeaderMenuAction({hidden:"function"==typeof t?t():t,icon:i,text:l,disabled:e,clickFunction:e=>o(e)}))??[]}_renderColumnVisibilityAction(){if(!this._showColumnsVisibilityAction)return[];const{_columnVisibilityActions:e,effectiveTable:t,id:i}=this,l=this.messages.toggleColumns;return z("calcite-action",{afterCreate:t=>e.set(i,t),afterRemoved:()=>e.delete(i),bind:this,disabled:t.menuConfig?.disabled,icon:H.showColumn,id:`${i}__toggle-columns-action`,slot:"header-actions-end",text:l},this._effectiveVisibleElements.tooltips?z("calcite-tooltip",{closeOnClick:!0,overlayPositioning:"fixed",placement:"bottom-end",slot:"tooltip"},l):null)}_renderColumnVisibilityPopover(){if(!this._showColumnsVisibilityAction||this.effectiveTable.menuConfig?.disabled)return;const{effectiveTable:e}=this,t=this.messages.toggleColumns;return z("calcite-popover",{autoClose:!0,class:N.menuPopover,label:t,overlayPositioning:"fixed",placement:"top-end",pointerDisabled:!0,referenceElement:this._columnVisibilityActions.get(this.id)},z("calcite-list",{displayMode:"nested",filterEnabled:!0,filterPlaceholder:t,label:t,selectionMode:"multiple"},e.columns.toArray().map(t=>{const i=E(t)?t.columns?.map(t=>this._renderColumnListItem({column:t,table:e,ignoreSelect:!0})):void 0;return this._renderColumnListItem({column:t,table:e,items:i})})))}_renderColumnListItem(e){const{column:t,table:i,items:l,ignoreSelect:o}=e,{effectiveLabel:n,fieldName:s,hidden:a}=t;return z("calcite-list-item",{expanded:!(!l?.length||a)||void 0,key:`toggle-columns__item-${s}`,label:n,selected:!a,value:s,onCalciteListItemSelect:e=>{o&&e.stopPropagation(),i.toggleColumnVisibility(e.currentTarget.value)}},l)}_renderLayerDropdown(){const e=this.messages.selectALayer;return z("div",{class:N.layerDropdownMenu,key:`${this.id}-layerDropdown`,slot:"header-actions-start"},z("calcite-dropdown",{bind:this,maxItems:5,overlayPositioning:"fixed",placement:"bottom-start"},z("calcite-action",{icon:H.layers,slot:"trigger",text:e,title:e}),z("calcite-dropdown-group",{selectionMode:"single"},this._effectiveLayers.map((e,t)=>this._renderLayerDropdownItem(e,t))??null)))}_renderLayerDropdownItem(e,t){const i=this.visibleElements.layerDropdownIcons;return z("calcite-dropdown-item",{iconStart:i?P(e):void 0,key:`dropdown-item-${t}`,label:e.title??"",selected:e===this.layer,value:e.id,onCalciteDropdownItemSelect:()=>{this.layer=e}},e.title)}_onRelatedNavigationItemClick(e){this.viewModel.drainRelatedTablesAboveIndex(e)}_collapseRelatedTable(e){this.viewModel.collapseRelatedTable(this.effectiveTable,e)}_onShowRelatedTable(e){this.showRelatedTableCallback||(this._collapseRelatedTable(e),this._createRelatedTable(e))}async _createRelatedTable(e){const{autoRefreshEnabled:t,autoSaveEnabled:i,editingEnabled:l,effectiveTable:o,paginationEnabled:n,pageSize:s,view:a,viewModel:r}=this,{layer:c,objectId:d,relatedLayer:h,relationshipId:m}=e;await c.load();const p=this.attachmentsEnabled&&R(c),u=new $({layer:c,autoRefreshEnabled:t,autoSaveEnabled:i,attachmentsEnabled:p,editingEnabled:l,paginationEnabled:n,pageSize:s,relatedRecordsEnabled:!0,relationshipConfig:{objectId:d,relatedLayer:h,relationshipId:m},relationshipColumnConfigs:k(c,m),tableController:this,tableParent:o,view:a,showRelatedTableCallback:e=>r.emit("show-related-table",e)});this.relatedTables.add(u),this.scheduleRender()}_renderAttachmentsView(){const{attachmentInfos:e,mode:t,objectId:i}=this.attachmentsViewOptions;return"file"!==t&&e.length&&null!=i?this._renderAttachmentsViewList():this._renderAttachmentsViewFilePane()}_renderAttachmentsViewFilePane(){const{attachmentsViewOptions:e,isSyncingAttachments:t,supportsAddAttachments:i,messages:l,messagesUnits:o}=this,{attachmentId:n,attachmentInfos:s,candidates:a,objectId:c}=e,d=s.find(e=>e.id===n),h=s.length,m=a?.length,p=d?z("calcite-label",{alignment:"center",key:"replace-file-node",scale:"l"},l.replaceFile):void 0,u=m?void 0:z("calcite-label",{alignment:"center",key:"message-node",scale:"m"},i?null==c?l.noFeature:l.dragAndDropToUpload:l.editingRestricted),g=Array.from(a??[]).pop(),b=g?z("calcite-label",{key:"filename-node"},g.name):void 0,w=i&&null!=c,v=w&&m,y=z("input",{afterCreate:L,afterRemoved:j,afterUpdate:L,bind:this,"data-node-ref":"_attachmentsInput",files:a,hidden:!0,name:"attachment",onchange:e=>this._onAttachmentsViewCandidateChange(e),type:"file"}),f=w?z("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:H.folderOpen,key:"select-node",loading:!1,onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value="",this._attachmentsInput.click())},width:"full"},l.selectFile):void 0,_=v?z("calcite-button",{appearance:"outline-fill",bind:this,disabled:t,iconStart:H.save,key:"save-node",loading:t,onclick:()=>{this.saveAttachmentsViewForm()},width:"full"},d?l.updateAttachment:l.addAttachment):void 0,M=h||m?z("calcite-button",{appearance:"transparent",bind:this,disabled:t,key:"cancel-node",onclick:()=>{this._attachmentsInput&&(this._attachmentsInput.value=""),e.reset(),e.attachmentInfos?.length&&(e.mode="list")},width:"full"},this.messagesCommon.cancel):void 0;return[z("div",{class:N.attachmentsView,key:"attachments-view"},z("div",{class:N.attachmentsViewContent,key:"attachments-view-content"},z("div",{bind:this,class:N.attachmentsViewDropArea,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop},z("calcite-icon",{class:N.attachmentsViewIcon,icon:H.upload,scale:"l"}),p,u,z("form",{afterCreate:t=>e.form=t,afterRemoved:()=>e.form=null,bind:this,key:"attachments-form"},z("fieldset",null,b,y,f,_,M)))),null!=c&&null!=d?z("div",{class:N.attachmentsViewInformation,key:"information"},this._renderAttachmentsViewThumbnail(d,200),z("label",{key:"file-label"},l.fileName),z("span",{key:"file-span"},d.name),z("label",{key:"size-label"},l.size),z("span",{key:"size-span"},r(o,d.size??0))):void 0)]}_renderAttachmentsViewList(){const{attachmentsViewOptions:e,isSyncingAttachments:t,messages:i,messagesUnits:l,supportsDeleteAttachments:o,supportsUpdateAttachments:n}=this,{attachmentInfos:s,objectId:a}=e;return z("calcite-list",{afterCreate:L,afterRemoved:j,afterUpdate:L,bind:this,class:N.attachmentsViewList,"data-node-ref":"attachmentsList",key:`attachments-list-${a}`,label:i?.attachments,loading:t,ondragover:e=>e.preventDefault(),ondrop:this._onAttachmentsViewDrop,selectionMode:"multiple",onCalciteListChange:()=>this.scheduleRender()},...s?.map(t=>{const{id:s,name:c,size:d,url:h}=t,m=r(l,d??0);return z("calcite-list-item",{afterRemoved:()=>this.scheduleRender(),key:`attachment-${s}`,label:c,value:s},this._renderAttachmentsViewListThumbnail(t),z("span",{class:N.attachmentsViewListFileSize,slot:"actions-end",title:m},m),z("calcite-action",{icon:H.downloadTo,key:`download-attachment-${s}`,label:`${c}`,onclick:e=>{e.preventDefault(),this.downloadAttachmentById(a??-1,s)},slot:"actions-end",text:i.downloadAttachment,title:i.downloadAttachment}),n&&null!=a?z("calcite-action",{disabled:!n,icon:H.replaceImage,key:`replace-attachment-${s}`,label:`${c}`,onclick:()=>{e.mode="file",e.attachmentId=s},slot:"actions-end",text:i.updateAttachment,title:i.updateAttachment}):void 0,z("calcite-action",{icon:H.launch,key:`launch-attachment-${s}`,label:`${c}`,onclick:()=>{h&&window.open(h,"_blank")},slot:"actions-end",text:i.viewAttachment,title:i.viewAttachment}),o&&null!=a?z("calcite-action",{class:N.attachmentsViewListItemDelete,disabled:!o,icon:H.delete,key:`delete-attachment-${s}`,label:`${c}`,onclick:()=>{this.deleteAttachments(a,[s],!0)},slot:"actions-end",text:i.deleteAttachment,title:i.deleteAttachment}):void 0)}))}_renderAttachmentsViewListThumbnail(e){return z("div",{class:N.attachmentsViewListThumbnail,slot:"content-start"},z("a",{href:e.url??"",rel:"noreferrer",target:"_blank"},this._renderAttachmentsViewThumbnail(e)))}_renderAttachmentsViewThumbnail(e,t=64){const{contentType:i,name:l,size:o,url:n}=e,s=`${n}${n?.includes("?")?"&":"?"}w=${t}&s=${o}`;return this.supportsResizeAttachments&&y(i)?z("img",{alt:l,key:`thumbnail-image-${l}`,src:s,title:l}):z("calcite-icon",{icon:f(i),key:`thumbnail-icon-${l}`,scale:"l",textLabel:l,title:l})}_onAttachmentsViewCandidateChange({target:e}){this.attachmentsViewOptions.candidates=e?.files}_onAttachmentsViewDrop(e){e.preventDefault(),(this.supportsAddAttachments||this.supportsUpdateAttachments)&&this.attachmentsViewOptions.set({mode:"file",candidates:e.dataTransfer?.files})}_renderNavigationBar(){const{effectiveTable:e,messages:i,messagesCommon:l,navigationScale:o,relatedTable:n,relatedTables:s}=this;if(!this._shouldShowNavigationBar)return;const{attachmentsList:a,attachmentsViewOptions:r,layer:c,supportsAddAttachments:d,supportsDeleteAttachments:h}=e;if(!c)return;const{attachmentInfos:m,objectId:p}=r,u=null!=p,g=m.length,b=a?.selectedItems?.length??0,w=`${c.objectIdField}: ${p}`,v=t(i.selectedCount,{count:b}),y=t(i.attachmentsCount,{count:g}),f=u?z("calcite-action",{bind:this,icon:H.chevronRight,iconFlipRtl:!0,key:"navigation-feature",onclick:()=>e.scrollToRow(p),scale:o,text:w,textEnabled:!0,title:w}):void 0,_=u?z("calcite-action",{icon:H.chevronRight,iconFlipRtl:!0,key:"navigation-attachments-label",label:y,onclick:()=>{g>0&&(r.mode="list")},scale:o,text:y,textEnabled:!0,title:y}):void 0,M=u?z("calcite-chip",{closable:!0,closed:0===b,key:"navigation-chip",kind:"inverse",label:v,scale:o,selected:!0,title:v,value:"selected",onCalciteChipClose:()=>a?.selectedItems?.forEach(e=>e.selected=!1)},v):void 0,C=n?z("calcite-label",{layout:"inline",scale:o},i.showAllTables,z("calcite-switch",{checked:this.allRelatedTablesVisible,scale:o,onCalciteSwitchChange:e=>this.showAllRelatedTables=!!e.currentTarget.checked})):void 0,S=u&&"list"===r.mode&&null!=p&&b&&h?z("calcite-action",{icon:H.delete,iconFlipRtl:!0,key:"attachments-trash-all",onclick:()=>{e.deleteAttachments(p,a?.selectedItems?.map(e=>e.value)??[],!0)},scale:o,text:l.delete,textEnabled:!0,title:t(i.deleteAttachmentCount,{count:b})}):void 0,A=u&&"list"===r.mode&&d?z("calcite-action",{bind:this,icon:H.plus,iconFlipRtl:!0,key:"attachments-add",onclick:()=>{r.attachmentId=null,r.mode="file"},scale:o,text:i.addAttachment,textEnabled:!0,title:i.addAttachment}):void 0;return z("div",{class:N.tableNavigation,key:"table-nav"},z("calcite-action",{icon:H.moveUp,iconFlipRtl:!0,key:"go-back",onclick:()=>{n&&this.drainRelatedTables(),e.attachmentsViewOptions.objectId=null},scale:o,text:this.layer?.title??"",textEnabled:!1,title:n?i.exitRelatedRecords:i.exitAttachments}),s.toArray().map((e,t)=>this._renderRelatedTableNavigationAction(e,t)),f,_,z("div",null,M,C,S,A))}_renderRelatedTableNavigationAction(e,t){const i=this._getLabelForRelatedTableNavigationAction(e);return z("calcite-action",{icon:H.chevronRight,iconFlipRtl:!0,key:t,onclick:()=>this._onRelatedNavigationItemClick(t),scale:this.navigationScale,text:i,textEnabled:!0,title:e.layer?.title||""})}_getLabelForRelatedTableNavigationAction(e){const t=e.layer?.title;if(!t)return"";const{relatedTables:i}=this;if(i.length<=1)return t;return i.indexOf(e)!==i.length-1&&t.length>20?`${t.slice(0,20)}...`:t}};e([c()],Z.prototype,"_attachmentsInput",void 0),e([c()],Z.prototype,"_columnVisibilityActions",void 0),e([c()],Z.prototype,"_effectiveDescription",null),e([c()],Z.prototype,"_effectiveLayers",null),e([c()],Z.prototype,"_effectiveTitle",null),e([c()],Z.prototype,"_effectiveVisibleElements",null),e([c()],Z.prototype,"_filteredTables",null),e([c()],Z.prototype,"_hasAttachmentsViewError",null),e([c()],Z.prototype,"_hasCustomMenuItems",null),e([c()],Z.prototype,"_hasDefaultMenuItems",null),e([c()],Z.prototype,"_shouldShowGrid",null),e([c()],Z.prototype,"_shouldShowMenu",null),e([c()],Z.prototype,"_shouldShowAttachmentsView",null),e([c()],Z.prototype,"_showClearSelectionAction",null),e([c()],Z.prototype,"_showColumnsVisibilityAction",null),e([c()],Z.prototype,"_showDeleteSelectionAction",null),e([c()],Z.prototype,"_showExportSelectionToCSVAction",null),e([c()],Z.prototype,"_showLayerDropdown",null),e([c()],Z.prototype,"_shouldShowNavigationBar",null),e([c()],Z.prototype,"_showRefreshDataAction",null),e([c()],Z.prototype,"_showSelectedRecordsShowSelectedAction",null),e([c()],Z.prototype,"_showSelectedRecordsShowAllAction",null),e([c()],Z.prototype,"_showZoomToSelectionAction",null),e([c()],Z.prototype,"_viewLayers",null),e([c()],Z.prototype,"attachmentsList",void 0),e([c({readOnly:!0})],Z.prototype,"grid",null),e([c()],Z.prototype,"actionColumn",null),e([c()],Z.prototype,"actionColumnConfig",null),e([c({readOnly:!0})],Z.prototype,"activeFilters",null),e([c({readOnly:!0})],Z.prototype,"activeSortOrders",null),e([c()],Z.prototype,"allColumns",null),e([c({readOnly:!0})],Z.prototype,"allRelatedTablesVisible",null),e([c()],Z.prototype,"allVisibleColumns",null),e([c()],Z.prototype,"attachmentsColumns",null),e([c()],Z.prototype,"attachmentsEnabled",null),e([c()],Z.prototype,"attachmentsViewOptions",null),e([c({type:b})],Z.prototype,"attributeTableTemplate",null),e([c()],Z.prototype,"autoRefreshEnabled",null),e([c()],Z.prototype,"autoSaveEnabled",null),e([c()],Z.prototype,"clearPrompt",null),e([c()],Z.prototype,"columnPerformanceModeEnabled",null),e([c()],Z.prototype,"columnReorderingEnabled",null),e([c({readOnly:!0})],Z.prototype,"columns",null),e([c()],Z.prototype,"definitionExpression",null),e([c()],Z.prototype,"description",void 0),e([c()],Z.prototype,"disabled",void 0),e([c()],Z.prototype,"editingEnabled",null),e([c()],Z.prototype,"effectiveSize",null),e([c()],Z.prototype,"effectiveTable",null),e([c()],Z.prototype,"fieldColumns",null),e([c({types:h})],Z.prototype,"filterGeometry",null),e([c()],Z.prototype,"filterBySelectionEnabled",null),e([c()],Z.prototype,"groupColumns",null),e([c()],Z.prototype,"hasContingentValues",null),e([c()],Z.prototype,"hasInvalidPendingEdits",null),e([c()],Z.prototype,"hasPendingEdits",null),e([c()],Z.prototype,"hiddenFields",null),e([c()],Z.prototype,"highlightEnabled",null),e([c()],Z.prototype,"highlightIds",null),e([c()],Z.prototype,"icon",null),e([c()],Z.prototype,"initialSize",null),e([c()],Z.prototype,"isQueryingOrSyncing",null),e([c()],Z.prototype,"isSyncing",null),e([c()],Z.prototype,"isSyncingAttachments",null),e([c()],Z.prototype,"label",null),e([c()],Z.prototype,"layer",null),e([c()],Z.prototype,"layers",null),e([c()],Z.prototype,"layerView",null),e([c()],Z.prototype,"maxSize",null),e([c(),F("esri/widgets/FeatureTable/t9n/FeatureTable")],Z.prototype,"messages",null),e([c(),F("esri/t9n/common")],Z.prototype,"messagesCommon",null),e([c(),F("esri/core/t9n/Units")],Z.prototype,"messagesUnits",null),e([c(),F("esri/widgets/support/t9n/uriUtils")],Z.prototype,"messagesURIUtils",null),e([c()],Z.prototype,"menuConfig",null),e([c()],Z.prototype,"multipleSelectionEnabled",null),e([c()],Z.prototype,"multiSortEnabled",null),e([c()],Z.prototype,"multipleSortPriority",null),e([c()],Z.prototype,"navigationScale",void 0),e([c()],Z.prototype,"noDataMessage",null),e([c()],Z.prototype,"objectIds",null),e([c()],Z.prototype,"outFields",null),e([c()],Z.prototype,"pageCount",null),e([c()],Z.prototype,"pageIndex",null),e([c()],Z.prototype,"pageSize",null),e([c()],Z.prototype,"paginationEnabled",null),e([c()],Z.prototype,"prompt",null),e([c()],Z.prototype,"relatedRecordsEnabled",null),e([c()],Z.prototype,"relatedTable",null),e([c()],Z.prototype,"relatedTables",null),e([c()],Z.prototype,"relationship",null),e([c()],Z.prototype,"relationshipColumnConfigs",null),e([c()],Z.prototype,"relationshipColumns",null),e([c()],Z.prototype,"relationshipConfig",null),e([c()],Z.prototype,"relationshipInfos",null),e([c()],Z.prototype,"returnGeometryEnabled",null),e([c()],Z.prototype,"returnMEnabled",null),e([c()],Z.prototype,"returnZEnabled",null),e([c()],Z.prototype,"rowHighlightIds",null),e([c()],Z.prototype,"selectionSource",null),e([c()],Z.prototype,"showAllRelatedTables",null),e([c()],Z.prototype,"showPrompt",null),e([c()],Z.prototype,"showRelatedTableCallback",null),e([c()],Z.prototype,"size",null),e([c({readOnly:!0})],Z.prototype,"state",null),e([c()],Z.prototype,"supportsAddAttachments",null),e([c()],Z.prototype,"supportsAttachments",null),e([c()],Z.prototype,"supportsDeleteAttachments",null),e([c()],Z.prototype,"supportsResizeAttachments",null),e([c()],Z.prototype,"supportsUpdateAttachments",null),e([c()],Z.prototype,"syncTemplateOnChangesEnabled",null),e([c({constructOnly:!0})],Z.prototype,"tableController",null),e([c({constructOnly:!0})],Z.prototype,"tableParent",null),e([c({type:T})],Z.prototype,"tableTemplate",null),e([c()],Z.prototype,"tableTemplateOverride",null),e([c()],Z.prototype,"title",void 0),e([c({type:w})],Z.prototype,"timeExtent",null),e([c()],Z.prototype,"timeZone",null),e([c()],Z.prototype,"view",null),e([c({type:S}),O(["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder","show-related-table"])],Z.prototype,"viewModel",void 0),e([c()],Z.prototype,"visibleColumns",null),e([c({type:A,nonNullable:!0})],Z.prototype,"visibleElements",void 0),e([c({type:A})],Z.prototype,"visibleElementsOverride",null),Z=$=e([d("esri.widgets.FeatureTable")],Z);const G=Z;export{G as default};
|