@vertigis/arcgis-extensions 49.9.0 → 50.0.0
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/AppConfig.schema.json +23 -6
- package/Hyperlink.d.ts +3 -1
- package/Hyperlink.js +1 -1
- package/data/ArcGISServiceTableExtension.js +1 -1
- package/data/Feature.d.ts +1 -3
- package/data/Feature.js +1 -1
- package/data/FeatureSet.d.ts +40 -2
- package/data/FeatureSet.js +1 -1
- package/data/FeatureSettings.js +1 -1
- package/data/FeatureSourceBase.d.ts +22 -27
- package/data/FeatureSourceBase.js +1 -1
- package/data/FieldExtension.d.ts +0 -3
- package/data/FieldExtension.js +1 -1
- package/data/PopupContentExtension.js +1 -1
- package/data/Schema.js +1 -1
- package/data/_Relationship.d.ts +1 -2
- package/data/_TableExtension.d.ts +1 -1
- package/data/_TableExtension.js +1 -1
- package/docs/html/assets/highlight.css +38 -10
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/Entity.EntityBase.html +12 -74
- package/docs/html/classes/Hyperlink.Hyperlink.html +10 -72
- package/docs/html/classes/LanguageResources.LanguageResources.html +36 -30
- package/docs/html/classes/data_ArcGISServiceTableExtension.ArcGISServiceTableExtension.html +35 -97
- package/docs/html/classes/data_Attachment.Attachment.html +12 -74
- package/docs/html/classes/data_Feature.Feature.html +16 -76
- package/docs/html/classes/data_FeatureList.FeatureList.html +73 -17
- package/docs/html/classes/data_FeatureSet.FeatureSet.html +39 -33
- package/docs/html/classes/data_FeatureSettings.FeatureSettings.html +11 -71
- package/docs/html/classes/data_FeatureSourceBase.FeatureSourceBase.html +35 -98
- package/docs/html/classes/data_FeatureSourceBase.RelationshipCollection.html +72 -16
- package/docs/html/classes/data_FeatureStream.FeatureStream.html +13 -75
- package/docs/html/classes/data_FieldExtension.FieldExtension.html +13 -75
- package/docs/html/classes/data_PopupContentExtension.PopupContentExtension.html +13 -75
- package/docs/html/classes/data_RelationshipBase.RelationshipBase.html +37 -31
- package/docs/html/classes/data_Schema.Schema.html +13 -73
- package/docs/html/classes/data_TaskSettings.TaskSettings.html +12 -72
- package/docs/html/classes/data__TableExtension.TableExtension.html +34 -96
- package/docs/html/classes/data__TableExtension.TableFeatureSettings.html +11 -71
- package/docs/html/classes/data__TableExtension.TableSchema.html +15 -75
- package/docs/html/classes/layer_preset_LayerPreset.LayerPreset.html +14 -76
- package/docs/html/classes/layer_preset_LayerPresetSettings.LayerPresetSetting.html +36 -30
- package/docs/html/classes/mapping_ArcGISSublayerExtension.ArcGISSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_ArcGISSublayerExtension.ArcGISSublayerRelationshipCollection.html +72 -16
- package/docs/html/classes/mapping_BasemapExtension.BasemapExtension.html +14 -76
- package/docs/html/classes/mapping_Bookmark.Bookmark.html +12 -74
- package/docs/html/classes/mapping_BuildingComponentSublayerExtension.BuildingComponentSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_BuildingComponentSublayerExtension.BuildingComponentSublayerSchema.html +13 -73
- package/docs/html/classes/mapping_BuildingGroupSublayerExtension.BuildingGroupSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_BuildingGroupSublayerExtension.BuildingGroupSublayerSchema.html +13 -73
- package/docs/html/classes/mapping_BuildingSceneLayerExtension.BuildingSceneLayerExtension.html +35 -97
- package/docs/html/classes/mapping_BuildingSceneLayerExtension.BuildingSceneLayerReadOnlySchema.html +13 -73
- package/docs/html/classes/mapping_BuildingSublayerExtension.BuildingSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_BuildingSublayerExtension.BuildingSublayerFeatureSettings.html +11 -53
- package/docs/html/classes/mapping_BuildingSublayerExtension.BuildingSublayerSchema.html +13 -73
- package/docs/html/classes/mapping_CSVLayerExtension.CSVLayerExtension.html +35 -97
- package/docs/html/classes/mapping_ElevationLayerExtension.ElevationLayerExtension.html +35 -97
- package/docs/html/classes/mapping_FeatureCollectionLayerExtension.FeatureCollectionLayerExtension.html +35 -97
- package/docs/html/classes/mapping_FeatureLayerExtension.FeatureLayerExtension.html +35 -97
- package/docs/html/classes/mapping_FeatureLayerExtensionBase.FeatureLayerExtensionBase.html +35 -97
- package/docs/html/classes/mapping_FeatureLayerExtensionBase.FeatureLayerReadOnlySchema.html +13 -73
- package/docs/html/classes/mapping_FeatureLayerExtensionBase.FeatureLayerSchema.html +13 -73
- package/docs/html/classes/mapping_GeoJSONLayerExtension.GeoJSONLayerExtension.html +35 -97
- package/docs/html/classes/mapping_GeoRSSLayerExtension.GeoRSSLayerExtension.html +35 -97
- package/docs/html/classes/mapping_GraphicsLayerExtension.GraphicsLayerExtension.html +35 -97
- package/docs/html/classes/mapping_GroundExtension.GroundExtension.html +13 -75
- package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtension.html +35 -97
- package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtensionCollection.html +74 -23
- package/docs/html/classes/mapping_ImageryLayerExtension.ImageryLayerExtension.html +35 -97
- package/docs/html/classes/mapping_ImageryTileLayerExtension.ImageryTileLayerExtension.html +35 -97
- package/docs/html/classes/mapping_IntegratedMeshLayerExtension.IntegratedMeshLayerExtension.html +35 -97
- package/docs/html/classes/mapping_KMLLayerExtension.KMLLayerExtension.html +35 -97
- package/docs/html/classes/mapping_KMLSublayerExtension.KMLSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_MapConstraints.MapConstraints.html +12 -72
- package/docs/html/classes/mapping_MapExtension.MapExtension.html +13 -75
- package/docs/html/classes/mapping_MapImageLayerExtension.MapImageLayerExtension.html +35 -97
- package/docs/html/classes/mapping_MapImageSublayerExtension.MapImageSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_MapNotesLayerExtension.MapNotesLayerExtension.html +35 -97
- package/docs/html/classes/mapping_MapNotesSublayerExtension.MapNotesSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_MapNotesSublayerExtension.MapNotesSublayerExtensionSchema.html +13 -73
- package/docs/html/classes/mapping_MediaLayerExtension.MediaLayerExtension.html +35 -97
- package/docs/html/classes/mapping_OpenStreetMapLayerExtension.OpenStreetMapLayerExtension.html +35 -97
- package/docs/html/classes/mapping_PointCloudLayerExtension.PointCloudLayerExtension.html +35 -97
- package/docs/html/classes/mapping_RouteLayerExtension.RouteLayerExtension.html +35 -97
- package/docs/html/classes/mapping_RouteLayerExtension.RouteLayerExtensionSchema.html +13 -73
- package/docs/html/classes/mapping_SceneLayerExtension.SceneLayerExtension.html +35 -97
- package/docs/html/classes/mapping_StreamLayerExtension.StreamLayerExtension.html +35 -97
- package/docs/html/classes/mapping_StreamLayerExtension.StreamLayerSchema.html +13 -73
- package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerExtension.html +35 -97
- package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerRelationshipCollection.html +72 -16
- package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerSchema.html +13 -73
- package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerRelationshipCollection.html +72 -16
- package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerSchema.html +13 -73
- package/docs/html/classes/mapping_TileLayerExtension.TileLayerExtension.html +35 -97
- package/docs/html/classes/mapping_TileSublayerExtension.TileSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_UnsupportedLayerExtension.UnsupportedLayerExtension.html +35 -97
- package/docs/html/classes/mapping_VectorTileLayerExtension.VectorTileLayerExtension.html +35 -97
- package/docs/html/classes/mapping_WFSLayerExtension.WFSLayerExtension.html +35 -97
- package/docs/html/classes/mapping_WMSLayerExtension.WMSLayerExtension.html +35 -97
- package/docs/html/classes/mapping_WMSSublayerExtension.WMSSublayerExtension.html +35 -97
- package/docs/html/classes/mapping_WMTSLayerExtension.WMTSLayerExtension.html +35 -97
- package/docs/html/classes/mapping_WebTileLayerExtension.WebTileLayerExtension.html +35 -97
- package/docs/html/classes/mapping__LayerExtension.LayerExtension.html +35 -97
- package/docs/html/classes/mapping__LayerExtension.LayerExtensionReadOnlySchema.html +13 -73
- package/docs/html/classes/mapping__LayerExtension.LayerExtensionSchema.html +13 -73
- package/docs/html/classes/mapping__LayerExtensionCollectionImpl.LayerExtensionCollectionImpl.html +74 -23
- package/docs/html/classes/mapping__SublayerExtension.SubSublayerExtensionCollection.html +74 -23
- package/docs/html/classes/mapping__SublayerExtension.SublayerExtension.html +35 -97
- package/docs/html/classes/mapping__SublayerExtension.SublayerSchema.html +13 -73
- package/docs/html/classes/mapping_support_ArrayWrappedCollection.ArrayWrappedCollection.html +72 -16
- package/docs/html/classes/mapping_support_LayerListSettings.ExtensionBaseLayerListSettings.html +9 -71
- package/docs/html/classes/mapping_support_LayerListSettings.LayerListSettings.html +10 -72
- package/docs/html/classes/mapping_support__LayerExtensionCollection.LayerExtensionCollectionBase.html +77 -26
- package/docs/html/classes/mapping_support__SublayerExtensionCollection.SublayerExtensionCollectionBase.html +77 -26
- package/docs/html/classes/menus_Menu.Menu.html +13 -75
- package/docs/html/classes/menus_MenuItem.MenuItem.html +13 -75
- package/docs/html/classes/support_FormatSettings.FormatSettings.html +12 -72
- package/docs/html/classes/support_InitializableBase.InitializableBase.html +21 -83
- package/docs/html/classes/support_InitializableCollectionProxy.InitializableCollectionProxy.html +73 -17
- package/docs/html/classes/support_Observable.Observable.html +27 -26
- package/docs/html/classes/support_ReadOnlyInitializableCollection.ReadOnlyInitializableCollection.html +73 -17
- package/docs/html/classes/support_Serializable.SerializableBase.html +38 -32
- package/docs/html/classes/support_Settings.Settings.html +15 -75
- package/docs/html/classes/support__ArcGISRelationshipCollection.ArcGISRelationshipCollection.html +72 -16
- package/docs/html/classes/support_observableUtils.ObservableMixin.html +3 -0
- package/docs/html/classes/tasks_geocoding_ArcGISGeocoder.ArcGISGeocoder.html +35 -97
- package/docs/html/classes/tasks_geocoding_Geocoder.Geocoder.html +33 -95
- package/docs/html/classes/tasks_identify_IdentifyService.IdentifyService.html +11 -73
- package/docs/html/classes/tasks_query_ArcGISRelationship.ArcGISRelationship.html +36 -30
- package/docs/html/classes/tasks_query_QueryBasedRelationship.QueryBasedRelationship.html +36 -30
- package/docs/html/classes/tasks_query_QueryService.QueryService.html +11 -73
- package/docs/html/classes/tasks_search_SearchService.SearchService.html +12 -74
- package/docs/html/classes/utilities_CaseInsensitiveObservableMap.CaseInsensitiveObservableMap.html +24 -27
- package/docs/html/classes/utilities_CollectionProxy.CollectionProxy.html +73 -17
- package/docs/html/classes/utilities_CopyOnWriteCollection.CopyOnWriteCollection.html +72 -16
- package/docs/html/classes/utilities_MapTransformCollection.MapTransformCollection.html +72 -16
- package/docs/html/classes/utilities_ObservableMap.ObservableMap.html +26 -32
- package/docs/html/classes/utilities_ObservableSet.ObservableSet.html +38 -32
- package/docs/html/classes/utilities_ObservableWeakSet.ObservableWeakSet.html +44 -42
- package/docs/html/classes/utilities_ReadOnlyCollection.ReadOnlyCollection.html +72 -16
- package/docs/html/classes/utilities_ReadOnlyMap.ReadOnlyMap.html +23 -29
- package/docs/html/classes/utilities_format_date.DateFormatter.html +37 -31
- package/docs/html/classes/utilities_format_number.NumberFormatter.html +37 -31
- package/docs/html/classes/utilities_format_time.TimeFormatter.html +37 -31
- package/docs/html/functions/support_Observable.deprecatedGetPropertyPath.html +7 -0
- package/docs/html/functions/support_Observable.deprecatedNotifyChange.html +5 -0
- package/docs/html/functions/support_Observable.deprecatedSet.html +9 -0
- package/docs/html/functions/support_Observable.deprecatedWatch.html +9 -0
- package/docs/html/functions/support_Observable.deprecatedWatchProperty.html +14 -0
- package/docs/html/functions/support_Observable.getPropertyByPath.html +3 -2
- package/docs/html/functions/support_observableUtils.createIHandle.html +8 -0
- package/docs/html/functions/support_observableUtils.notifyChange.html +8 -0
- package/docs/html/functions/support_observableUtils.observable-1.html +31 -0
- package/docs/html/functions/support_observableUtils.onWatch.html +14 -0
- package/docs/html/functions/support_observableUtils.once.html +11 -0
- package/docs/html/functions/support_observableUtils.watch.html +24 -0
- package/docs/html/functions/support_observableUtils.watchEach.html +33 -0
- package/docs/html/functions/support_observableUtils.watchEvent.html +12 -0
- package/docs/html/functions/support_observableUtils.when.html +9 -0
- package/docs/html/functions/support_observableUtils.whenOnce.html +9 -0
- package/docs/html/functions/utilities_checkArg.checkArg.html +1 -1
- package/docs/html/functions/utilities_watch.onCollectionPropertyChange.html +6 -1
- package/docs/html/functions/utilities_watch.watchCollectionPropertyEach.html +5 -4
- package/docs/html/functions/utilities_watch.watchEach.html +8 -6
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/interfaces/data_ArcGISServiceTableExtension.ArcGISServiceTableExtensionProperties.html +1 -1
- package/docs/html/interfaces/data_Feature.PresentableAttributes.html +24 -30
- package/docs/html/interfaces/data_Schema.SchemaProperties.html +2 -2
- package/docs/html/interfaces/data__Relationship.Relationship-1.html +35 -29
- package/docs/html/interfaces/data__TableExtension.TableExtensionProperties.html +1 -1
- package/docs/html/interfaces/json_AnnotationLayerJson.AnnotationLayerJson.html +2 -2
- package/docs/html/interfaces/json_BasemapLayerJson.BasemapLayerJsonBase.html +2 -2
- package/docs/html/interfaces/json_BingLayerJson.BingLayerJson.html +2 -2
- package/docs/html/interfaces/json_BuildingSceneLayerJson.BuildingSceneLayerJson.html +2 -2
- package/docs/html/interfaces/json_CSVLayerJson.CSVLayerJson.html +2 -2
- package/docs/html/interfaces/json_FeatureLayerJson.FeatureLayerJson.html +2 -2
- package/docs/html/interfaces/json_GeoJSONLayerJson.GeoJSONLayerJson.html +2 -2
- package/docs/html/interfaces/json_GeoRSSLayerJson.GeoRSSLayerJson.html +2 -2
- package/docs/html/interfaces/json_GroupLayerJson.GroupLayerJson.html +2 -2
- package/docs/html/interfaces/json_ImageServiceLayerJson.ImageServiceLayerJson.html +2 -2
- package/docs/html/interfaces/json_ImageServiceVectorLayerJson.ImageServiceVectorLayerJson.html +2 -2
- package/docs/html/interfaces/json_IntegratedMeshLayerJson.IntegratedMeshLayerJson.html +2 -2
- package/docs/html/interfaces/json_ItemJson.ItemJson.html +2 -2
- package/docs/html/interfaces/json_KMLLayerJson.KMLLayerJson.html +2 -2
- package/docs/html/interfaces/json_LayerJson.LayerJsonBase.html +2 -2
- package/docs/html/interfaces/json_MapServiceLayerJson.MapServiceLayerJson.html +2 -2
- package/docs/html/interfaces/json_MediaLayerJson.MediaLayerJson.html +2 -2
- package/docs/html/interfaces/json_OpenStreetMapLayerJson.OpenStreetMapLayerJson.html +2 -2
- package/docs/html/interfaces/json_OperationalLayerJson.OperationalLayerJsonBase.html +2 -2
- package/docs/html/interfaces/json_PointCloudLayerJson.PointCloudLayerJson.html +2 -2
- package/docs/html/interfaces/json_RasterDataElevationLayerJson.RasterDataElevationLayerJson.html +2 -2
- package/docs/html/interfaces/json_SceneLayerJson.SceneLayerJson.html +2 -2
- package/docs/html/interfaces/json_StreamLayerJson.StreamLayerJson.html +2 -2
- package/docs/html/interfaces/json_SubtypeGroupLayerJson.SubtypeGroupLayerJson.html +2 -2
- package/docs/html/interfaces/json_SubtypeGroupLayerJson.SubtypeSubtypeGroupLayerJson.html +2 -2
- package/docs/html/interfaces/json_SubtypeSublayerJson.SubtypeSublayerJson.html +2 -2
- package/docs/html/interfaces/json_TiledElevationServiceLayerJson.TiledElevationServiceLayerJson.html +2 -2
- package/docs/html/interfaces/json_TiledImageServiceLayerJson.TiledImageServiceLayerJson.html +2 -2
- package/docs/html/interfaces/json_TiledMapServiceLayerJson.TiledMapServiceLayerJson.html +2 -2
- package/docs/html/interfaces/json_VectorTileLayerJson.VectorTileLayerJson.html +2 -2
- package/docs/html/interfaces/json_WFSLayerJson.WFSLayerJson.html +2 -2
- package/docs/html/interfaces/json_WMSLayerJson.WMSLayerJson.html +2 -2
- package/docs/html/interfaces/json_WebTileLayerJson.WebTileLayerJson.html +2 -2
- package/docs/html/interfaces/mapping_ArcGISSublayerExtension.ArcGISSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_BuildingComponentSublayerExtension.BuildingComponentSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_BuildingGroupSublayerExtension.BuildingGroupSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_BuildingSceneLayerExtension.BuildingSceneLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_BuildingSceneLayerExtension.BuildingSceneLayerProperties.html +2 -2
- package/docs/html/interfaces/mapping_BuildingSublayerExtension.BuildingSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_CSVLayerExtension.CSVLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_ElevationLayerExtension.ElevationLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_FeatureLayerExtension.FeatureLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_FeatureLayerExtension.FeatureLayerProperties.html +2 -2
- package/docs/html/interfaces/mapping_FeatureLayerExtensionBase.FeatureLayerBaseProperties.html +2 -2
- package/docs/html/interfaces/mapping_FeatureLayerExtensionBase.FeatureLayerExtensionBaseProperties.html +1 -1
- package/docs/html/interfaces/mapping_GeoJSONLayerExtension.GeoJSONLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_GeoRSSLayerExtension.GeoRSSLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_GraphicsLayerExtension.GraphicsLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_GroupLayerExtension.GroupLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_ImageryLayerExtension.ImageryLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_ImageryTileLayerExtension.ImageryTileLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_IntegratedMeshLayerExtension.IntegratedMeshLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_KMLLayerExtension.KMLLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_KMLSublayerExtension.KMLSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_MapExtension.MapExtensionProperties.html +3 -3
- package/docs/html/interfaces/mapping_MapImageLayerExtension.MapImageLayerExtensionProperties.html +4 -4
- package/docs/html/interfaces/mapping_MapImageSublayerExtension.MapImageSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_MapNotesLayerExtension.MapNotesLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_MapNotesSublayerExtension.MapNotesSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_MediaLayerExtension.MediaLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_OpenStreetMapLayerExtension.OpenStreetMapLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_PointCloudLayerExtension.PointCloudLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_PointCloudLayerExtension.PointCloudLayerProperties.html +2 -2
- package/docs/html/interfaces/mapping_RouteLayerExtension.RouteLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_SceneLayerExtension.SceneLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_StreamLayerExtension.StreamLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_SubtypeSublayerExtension.SubtypeSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_TileLayerExtension.TileLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_TileSublayerExtension.TileSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_VectorTileLayerExtension.VectorTileLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_WFSLayerExtension.WFSLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_WMSLayerExtension.WMSLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_WMSSublayerExtension.WMSSublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_WMTSLayerExtension.WMTSLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_WebTileLayerExtension.WebTileLayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping__LayerExtension.LayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping__SublayerExtension.SublayerExtensionProperties.html +1 -1
- package/docs/html/interfaces/mapping_support_ArrayWrappedCollection.ArrayWrappedCollectionProperties.html +3 -3
- package/docs/html/interfaces/support_InitializableBase.Initializable.html +1 -1
- package/docs/html/interfaces/support_Observable.IDeprecatedObservable.html +57 -0
- package/docs/html/interfaces/support_Serializable.Serializable.html +60 -5
- package/docs/html/interfaces/support_esri.SublayerLike.html +2 -29
- package/docs/html/interfaces/support_observableUtils.IHandle.html +9 -0
- package/docs/html/interfaces/support_observableUtils.WatchEachOptions.html +29 -0
- package/docs/html/interfaces/support_observableUtils.WatchOptions.html +26 -0
- package/docs/html/interfaces/utilities_collection.AfterItemChangeEvent.html +4 -0
- package/docs/html/modules/support_Observable.html +8 -2
- package/docs/html/modules/support_esri.html +4 -3
- package/docs/html/modules/support_observableUtils.html +20 -0
- package/docs/html/modules/utilities_ObservableWeakSet.html +1 -1
- package/docs/html/modules/utilities_collection.html +1 -0
- package/docs/html/modules/utilities_watch.html +4 -4
- package/docs/html/modules.html +1 -0
- package/docs/html/types/support_esri.CollectionAfterEvent.html +1 -0
- package/docs/html/types/support_esri.CollectionAfterItemEvent.html +1 -1
- package/docs/html/types/support_esri.CollectionEvent.html +1 -0
- package/docs/html/types/support_esri.CollectionItemEvent.html +1 -0
- package/docs/html/types/support_observableUtils.Observable.html +5 -0
- package/docs/html/types/support_observableUtils.ObservablePropertyPath.html +9 -0
- package/docs/html/types/support_observableUtils.TargetTypeFromPath.html +14 -0
- package/docs/html/types/support_observableUtils.ValueTypeFromPath.html +14 -0
- package/docs/html/types/support_observableUtils.WhenOptions.html +7 -0
- package/docs/html/types/utilities_watch.WatchCallback.html +3 -0
- package/docs/html/variables/version.version.html +1 -1
- package/layer-preset/LayerPreset.js +1 -1
- package/mapping/ArcGISSublayerExtension.js +1 -1
- package/mapping/BasemapExtension.d.ts +1 -1
- package/mapping/BasemapExtension.js +1 -1
- package/mapping/BuildingComponentSublayerExtension.js +1 -1
- package/mapping/CSVLayerExtension.js +1 -1
- package/mapping/FeatureLayerExtension.js +1 -1
- package/mapping/FeatureLayerExtensionBase.js +1 -1
- package/mapping/GeoJSONLayerExtension.js +1 -1
- package/mapping/GeoRSSLayerExtension.js +1 -1
- package/mapping/GraphicsLayerExtension.js +1 -1
- package/mapping/GroundExtension.js +1 -1
- package/mapping/GroupLayerExtension.js +1 -1
- package/mapping/ImageryLayerExtension.js +1 -1
- package/mapping/KMLLayerExtension.js +1 -1
- package/mapping/MapExtension.d.ts +1 -1
- package/mapping/MapExtension.js +1 -1
- package/mapping/MapNotesSublayerExtension.js +1 -1
- package/mapping/PointCloudLayerExtension.js +1 -1
- package/mapping/RouteLayerExtension.js +1 -1
- package/mapping/SceneLayerExtension.js +1 -1
- package/mapping/StreamLayerExtension.js +1 -1
- package/mapping/SubtypeGroupLayerExtension.js +1 -1
- package/mapping/SubtypeSublayerExtension.js +1 -1
- package/mapping/WFSLayerExtension.js +1 -1
- package/mapping/WMTSLayerExtension.js +1 -1
- package/mapping/_LayerExtension.js +1 -1
- package/mapping/_SublayerExtension.d.ts +1 -1
- package/mapping/_SublayerExtension.js +1 -1
- package/mapping/support/ArrayWrappedCollection.d.ts +3 -3
- package/mapping/support/ArrayWrappedCollection.js +1 -1
- package/mapping/support/LayerListSettings.d.ts +3 -1
- package/mapping/support/LayerListSettings.js +1 -1
- package/mapping/support/PopupTemplateFeatureSettings.js +1 -1
- package/mapping/support/_LayerExtensionCollection.d.ts +19 -4
- package/mapping/support/_LayerExtensionCollection.js +1 -1
- package/mapping/support/_SublayerExtensionCollection.d.ts +19 -4
- package/mapping/support/_SublayerExtensionCollection.js +1 -1
- package/package.json +1 -1
- package/portal/BuildingSceneLayer.js +1 -1
- package/portal/SubtypeGroupLayer.js +1 -1
- package/portal/WMSLayer.js +1 -1
- package/support/InitializableBase.d.ts +12 -3
- package/support/InitializableBase.js +1 -1
- package/support/InitializeError.js +1 -1
- package/support/Observable.d.ts +164 -14
- package/support/Observable.js +1 -1
- package/support/Serializable.d.ts +40 -3
- package/support/Serializable.js +1 -1
- package/support/Settings.d.ts +6 -7
- package/support/Settings.js +1 -1
- package/support/esri.d.ts +6 -52
- package/support/observableUtils.d.ts +560 -0
- package/support/observableUtils.js +1 -0
- package/tasks/geocoding/ArcGISGeocoder.js +1 -1
- package/tasks/query/ClientSideQueryProvider.js +1 -1
- package/utilities/CollectionProxy.d.ts +54 -23
- package/utilities/CollectionProxy.js +1 -1
- package/utilities/MapTransformCollection.js +1 -1
- package/utilities/ObservableMap.d.ts +35 -4
- package/utilities/ObservableMap.js +1 -1
- package/utilities/ObservableSet.d.ts +44 -3
- package/utilities/ObservableSet.js +1 -1
- package/utilities/ObservableWeakSet.d.ts +3 -0
- package/utilities/ReadOnlyMap.d.ts +15 -2
- package/utilities/ReadOnlyMap.js +1 -1
- package/utilities/collection.d.ts +9 -0
- package/utilities/collection.js +1 -1
- package/utilities/watch.d.ts +25 -7
- package/utilities/watch.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/docs/html/interfaces/support_esri.AccessorLike.html +0 -29
- package/docs/html/types/support_esri.WatchCallback.html +0 -3
package/AppConfig.schema.json
CHANGED
|
@@ -1938,10 +1938,10 @@
|
|
|
1938
1938
|
"items": {
|
|
1939
1939
|
"anyOf": [
|
|
1940
1940
|
{
|
|
1941
|
-
"$ref": "#/definitions/
|
|
1941
|
+
"$ref": "#/definitions/Bookmark"
|
|
1942
1942
|
},
|
|
1943
1943
|
{
|
|
1944
|
-
"$ref": "#/definitions/
|
|
1944
|
+
"$ref": "#/definitions/BookmarkProperties"
|
|
1945
1945
|
}
|
|
1946
1946
|
]
|
|
1947
1947
|
},
|
|
@@ -1988,10 +1988,10 @@
|
|
|
1988
1988
|
"initialLayerPreset": {
|
|
1989
1989
|
"anyOf": [
|
|
1990
1990
|
{
|
|
1991
|
-
"$ref": "#/definitions/layer-preset.LayerPreset.
|
|
1991
|
+
"$ref": "#/definitions/layer-preset.LayerPreset.LayerPreset"
|
|
1992
1992
|
},
|
|
1993
1993
|
{
|
|
1994
|
-
"$ref": "#/definitions/layer-preset.LayerPreset.
|
|
1994
|
+
"$ref": "#/definitions/layer-preset.LayerPreset.LayerPresetProperties"
|
|
1995
1995
|
}
|
|
1996
1996
|
],
|
|
1997
1997
|
"description": "See {@link mapping /MapExtension!MapExtension.initialLayerPreset}."
|
|
@@ -2151,6 +2151,10 @@
|
|
|
2151
2151
|
"MenuItem": {
|
|
2152
2152
|
"description": "An item within a {@link menus /Menu!Menu}.",
|
|
2153
2153
|
"properties": {
|
|
2154
|
+
"__isObservable": {
|
|
2155
|
+
"const": true,
|
|
2156
|
+
"type": "boolean"
|
|
2157
|
+
},
|
|
2154
2158
|
"_action": {
|
|
2155
2159
|
"$ref": "#/definitions/Action"
|
|
2156
2160
|
},
|
|
@@ -2170,6 +2174,9 @@
|
|
|
2170
2174
|
"_destroyPromise": {
|
|
2171
2175
|
"$ref": "#/definitions/Promise"
|
|
2172
2176
|
},
|
|
2177
|
+
"_esriProps": {
|
|
2178
|
+
"$ref": "#/definitions/Map"
|
|
2179
|
+
},
|
|
2173
2180
|
"_failureMode": {
|
|
2174
2181
|
"$ref": "#/definitions/FailureMode",
|
|
2175
2182
|
"default": "warn"
|
|
@@ -2211,9 +2218,15 @@
|
|
|
2211
2218
|
"_menu": {
|
|
2212
2219
|
"$ref": "#/definitions/Menu"
|
|
2213
2220
|
},
|
|
2221
|
+
"_onWatchPaths": {
|
|
2222
|
+
"$ref": "#/definitions/Map"
|
|
2223
|
+
},
|
|
2214
2224
|
"_submenu": {
|
|
2215
2225
|
"$ref": "#/definitions/Menu"
|
|
2216
2226
|
},
|
|
2227
|
+
"_subscribedPaths": {
|
|
2228
|
+
"$ref": "#/definitions/Map"
|
|
2229
|
+
},
|
|
2217
2230
|
"_title": {
|
|
2218
2231
|
"type": "string"
|
|
2219
2232
|
},
|
|
@@ -2287,11 +2300,13 @@
|
|
|
2287
2300
|
}
|
|
2288
2301
|
},
|
|
2289
2302
|
"required": [
|
|
2303
|
+
"__isObservable",
|
|
2290
2304
|
"_action",
|
|
2291
2305
|
"_alternate",
|
|
2292
2306
|
"_assignPropertiesPromises",
|
|
2293
2307
|
"_description",
|
|
2294
2308
|
"_destroyPromise",
|
|
2309
|
+
"_esriProps",
|
|
2295
2310
|
"_failureMode",
|
|
2296
2311
|
"_hideOnDisable",
|
|
2297
2312
|
"_iconId",
|
|
@@ -2303,7 +2318,9 @@
|
|
|
2303
2318
|
"_isToggled",
|
|
2304
2319
|
"_itemType",
|
|
2305
2320
|
"_menu",
|
|
2321
|
+
"_onWatchPaths",
|
|
2306
2322
|
"_submenu",
|
|
2323
|
+
"_subscribedPaths",
|
|
2307
2324
|
"_title",
|
|
2308
2325
|
"action",
|
|
2309
2326
|
"alternate",
|
|
@@ -2615,10 +2632,10 @@
|
|
|
2615
2632
|
"items": {
|
|
2616
2633
|
"anyOf": [
|
|
2617
2634
|
{
|
|
2618
|
-
"$ref": "#/definitions/
|
|
2635
|
+
"$ref": "#/definitions/FieldExtensionProperties"
|
|
2619
2636
|
},
|
|
2620
2637
|
{
|
|
2621
|
-
"$ref": "#/definitions/
|
|
2638
|
+
"$ref": "#/definitions/FieldExtension"
|
|
2622
2639
|
}
|
|
2623
2640
|
]
|
|
2624
2641
|
},
|
package/Hyperlink.d.ts
CHANGED
|
@@ -25,10 +25,11 @@ export interface HyperlinkProperties {
|
|
|
25
25
|
*/
|
|
26
26
|
tooltip?: string;
|
|
27
27
|
}
|
|
28
|
+
declare const Hyperlink_base: (abstract new (_properties?: HyperlinkProperties) => SerializableBase<HyperlinkProperties>) & (abstract new (...args: any[]) => import("./support/observableUtils.js").ObservableMixin);
|
|
28
29
|
/**
|
|
29
30
|
* A hyperlink associated with a feature or layer.
|
|
30
31
|
*/
|
|
31
|
-
export declare class Hyperlink extends
|
|
32
|
+
export declare class Hyperlink extends Hyperlink_base {
|
|
32
33
|
/**
|
|
33
34
|
* The URL to link to.
|
|
34
35
|
*/
|
|
@@ -72,3 +73,4 @@ export declare class Hyperlink extends SerializableBase<HyperlinkProperties> {
|
|
|
72
73
|
getReferencedFields(): string[];
|
|
73
74
|
protected _getSerializableProperties(): PropertyDefs<HyperlinkProperties>;
|
|
74
75
|
}
|
|
76
|
+
export {};
|
package/Hyperlink.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as t}from"tslib";import{serializable as i,SerializableBase as
|
|
1
|
+
import{__decorate as t}from"tslib";import{serializable as i,SerializableBase as r}from"./support/Serializable.js";import{observable as e}from"./support/observableUtils.js";import{checkArg as s}from"./utilities/checkArg.js";import{getAllReferencedFieldNames as o}from"./utilities/esri.js";let l=class extends(e(r)){get url(){return this._url}set url(t){this._url=t}get text(){return this._text}set text(t){this._text=t}get iconUrl(){return this._iconUrl}set iconUrl(t){this._iconUrl=t}get target(){return this._target}set target(t){this._target=t}get tooltip(){return this._tooltip}set tooltip(t){this._tooltip=t}_url;_text;_iconUrl;_target;_tooltip;constructor(t){s("properties",t).isNotMissing(),s("properties.url",t.url).isNotMissing(),s("properties.text",t.text).isNotMissing(),super(t)}getReferencedFields(){return o({content:[].concat(this.text,this.url,this.iconUrl,this.tooltip).join()})}_getSerializableProperties(){return{...super._getSerializableProperties(),url:"initial",text:"initial",iconUrl:"initial",target:"initial",tooltip:"initial"}}};l=t([i],l);export{l as Hyperlink};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as e}from"tslib";import t from"@arcgis/core/core/Collection";import r from"@arcgis/core/rest/support/AttachmentQuery.js";import{InvalidOperationError as s}from"../InvalidOperationError.js";import{toAttachment as i}from"../data/Attachment.js";import{PopupTemplateFeatureSettings as a}from"../mapping/support/PopupTemplateFeatureSettings.js";import{DefaultArcGISRequestHelper as l}from"../support/ArcGISRequestHelper.js";import{serializable as o}from"../support/Serializable.js";import{ArcGISRelationshipCollection as n}from"../support/_ArcGISRelationshipCollection.js";import{applyEdits as u}from"../support/_featureEdit.js";import{
|
|
1
|
+
import{__decorate as e}from"tslib";import t from"@arcgis/core/core/Collection";import r from"@arcgis/core/rest/support/AttachmentQuery.js";import{InvalidOperationError as s}from"../InvalidOperationError.js";import{toAttachment as i}from"../data/Attachment.js";import{PopupTemplateFeatureSettings as a}from"../mapping/support/PopupTemplateFeatureSettings.js";import{DefaultArcGISRequestHelper as l}from"../support/ArcGISRequestHelper.js";import{serializable as o}from"../support/Serializable.js";import{ArcGISRelationshipCollection as n}from"../support/_ArcGISRelationshipCollection.js";import{applyEdits as u}from"../support/_featureEdit.js";import{watch as p}from"../support/observableUtils.js";import{ReadOnlyCollection as c}from"../utilities/ReadOnlyCollection.js";import{getGdbVersion as h}from"../utilities/_version.js";import{isArcGISServiceTableExtension as m}from"../utilities/extensions.js";import{parse as d}from"../utilities/format/number.js";import{isFeatureLayer as b,isMapImageSublayer as y,isSubtypeGroupLayer as _}from"../utilities/layers.js";import{isNumeric as f}from"../utilities/number.js";import{TableExtension as g,TableSchema as j}from"./_TableExtension.js";import{addAttachment as I,deleteAttachments as w,supportsAttachmentEditing as x}from"./support/attachments.js";let S=class extends g{attachmentTypes;get requestHelper(){return this._requestHelper||(this._requestHelper=new l),this._requestHelper}set requestHelper(e){this._requestHelper=e}get capabilities(){const e=x(this.table);return this.table?.capabilities?.operations?{...this.table.capabilities.operations,supportsAttachmentEditing:e,supportsStandardizedQueries:this.table.capabilities?.query?.supportsStandardizedQueriesOnly}:{...super.capabilities,supportsAttachmentEditing:e}}get canChangeDefinitionExpression(){return!0}_requestHelper;async _getAttachments(e){if(!this.table?.capabilities?.data?.supportsAttachment)return[];const t=+e.primaryKey,s=this.table?.gdbVersion??h(this.table?.customParameters),a=new r({objectIds:[t]}),l=await this.table.queryAttachments(a);return l?.[t]?.length?l[t].map((e=>i(e,{gdbVersion:s}))):[]}async _addAttachment(e,t){return I(e,this.table,t,{attachmentTypes:this.attachmentTypes})}async _deleteAttachments(e,t){return w(e,this.table,t)}get _layerUrl(){return f(this.table.layerId)?`${this.table.url}/${this.table.layerId}`:this.table.url}async*_getFeatures(e,t){const r=this.table.createQuery();r.objectIds=e.map((e=>d(e))),r.where=void 0,r.outFields=t.outFields,r.returnGeometry=t.returnGeometry,yield*(await import("../support/_query.js")).executeQuery(r,this,this.table,t.cancelToken)}async _addFeatures(e,t){await u({adds:e},this.table,t)}async _updateFeatures(e,t){await u({updates:e},this.table,t)}async _deleteFeatures(e,t){await u({deletes:e},this.table,t)}async _onInitialize(){await super._onInitialize(),await this.relationships.initialize()}_isSupportedTable(e){return!e.loaded||e.isTable}_createFeatureSettings(){return new z(this)}_createRelationships(){return new A(this)}_createSchema(){return new E(this)}_getSerializableProperties(){const e=super._getSerializableProperties();return{...e,attachmentTypes:["initial"],table:{...this._toPropertyDef(e.table),default:{}},requestHelper:{serialize:!1}}}};S=e([o],S);export{S as ArcGISServiceTableExtension};class T extends c{constructor(e){super(),e.table?this._onTableResolved(e.table):(this._collection=new t,p(e,"table",(()=>{this._onTableResolved(e.table)}),{sync:!0,once:!0}))}_onTableResolved(e){this._collection=new t(e.types)}}let E=class extends j{_typeCollection;constructor(e){super(e),this._typeCollection=new T(e),this._bindSettingToTableProperty("displayField"),this._bindSettingToTableProperty("typeIdField")}get types(){return this._typeCollection}_setSetting(e,t){if(this._tableBindings.has(e))throw new s("This schema property is read-only.");super._setSetting(e,t)}_createFieldCollection(){return new c(super._createFieldCollection())}};E=e([o],E);let z=class extends a{};z=e([o],z);class A extends n{get _sourceUrl(){if(this._source.table?.url)return f(this._source.table.layerId)?`${this._source.table.url}/${this._source.table.layerId}`:this._source.table.url}get _sourceLayerId(){return this._source.table?.layerId}_findRelatedSource(e){if(!this._source.mapExtension||!this._source.table?.url)return;const t=this._source.mapExtension.tableExtensions.initializedItems.find((t=>m(t)&&t.table.url===this._source.table.url&&t.table.layerId===e));if(t)return t;for(const t of this._source.mapExtension.allLayerExtensions.initializedItems.toArray()){const r=t.allSublayerExtensions.initializedItems.find((t=>y(t.sublayer)&&t.sublayer.layer.url===this._source.table.url&&t.sublayer.id===e));if(r)return r}return this._source.mapExtension.allLayerExtensions.initializedItems.find((t=>(b(t.layer)||_(t.layer))&&t.layer.url===this._source.table.url&&t.layer.layerId===e))}}
|
package/data/Feature.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { Hyperlink } from "../Hyperlink.js";
|
|
|
8
8
|
import type { GeometryJson } from "../json/GeometryJson.js";
|
|
9
9
|
import type { CancelToken } from "../support/Cancellable.js";
|
|
10
10
|
import type { PropertyDefs } from "../support/Serializable.js";
|
|
11
|
-
import type
|
|
11
|
+
import { type IHandle } from "../support/observableUtils.js";
|
|
12
12
|
import { CaseInsensitiveObservableMap } from "../utilities/CaseInsensitiveObservableMap.js";
|
|
13
13
|
import { ObservableMap } from "../utilities/ObservableMap.js";
|
|
14
14
|
import { ReadOnlyMap } from "../utilities/ReadOnlyMap.js";
|
|
@@ -194,7 +194,6 @@ export declare class Feature extends EntityBase<FeatureProperties> {
|
|
|
194
194
|
private _attachmentsInitialized;
|
|
195
195
|
private _expressionsInitialized;
|
|
196
196
|
private readonly _initializedRelationships;
|
|
197
|
-
private readonly _sourceRelationshipsHandle;
|
|
198
197
|
constructor(properties?: FeatureProperties);
|
|
199
198
|
/**
|
|
200
199
|
* Same as {@link utilities/format/string!StringFormatter.format}, except
|
|
@@ -261,7 +260,6 @@ export declare class Feature extends EntityBase<FeatureProperties> {
|
|
|
261
260
|
*/
|
|
262
261
|
deleteAttachments(attachments: (Attachment | string)[]): Promise<void>;
|
|
263
262
|
protected _getSerializableProperties(): PropertyDefs<FeatureProperties>;
|
|
264
|
-
protected _watchProperty(property: keyof this, subpath: string, callback: WatchCallback, sync: boolean): IHandle;
|
|
265
263
|
protected _onInitialize(): Promise<void>;
|
|
266
264
|
private _findRelationshipIds;
|
|
267
265
|
}
|
package/data/Feature.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as e}from"tslib";import t from"@arcgis/core/Graphic";import s from"@arcgis/core/core/Collection";import{fromJSON as i}from"@arcgis/core/geometry/support/jsonUtils";import{EntityBase as r}from"../Entity.js";import{Hyperlink as a}from"../Hyperlink.js";import{InvalidOperationError as o}from"../InvalidOperationError.js";import{isLayerExtension as n,isTableExtension as l,ItemType as h}from"../ItemType.js";import{serializable as u}from"../support/Serializable.js";import{CaseInsensitiveObservableMap as p}from"../utilities/CaseInsensitiveObservableMap.js";import{MapTransformCollection as c}from"../utilities/MapTransformCollection.js";import{ObservableMap as m}from"../utilities/ObservableMap.js";import{ReadOnlyMap as f}from"../utilities/ReadOnlyMap.js";import{Time as d}from"../utilities/Time.js";import g from"../utilities/_ReferenceCountedHandle.js";import{flatten as y,groupBy as _}from"../utilities/array.js";import{checkArg as b}from"../utilities/checkArg.js";import{compare as F}from"../utilities/collection.js";import{isCodedValueDomain as x,isGeometry as w}from"../utilities/esri.js";import{getArcadeExpressionFromField as v,getRelationshipFromField as I,isArcadeExpressionField as S}from"../utilities/field.js";import{parse as z,esriFormatToGeocortexFormat as A}from"../utilities/format/date.js";import{NumberFormat as E}from"../utilities/format/formats.js";import{parse as j}from"../utilities/format/number.js";import{format as T}from"../utilities/format/string.js";import{parse as k,esriFormatToGeocortexFormat as R}from"../utilities/format/time.js";import{map as C,find as O}from"../utilities/iterable.js";import{getLogger as M}from"../utilities/log.js";import{map as N}from"../utilities/promise.js";import{caseInsensitiveEquals as D}from"../utilities/string.js";import{onCollectionPropertyChange as P}from"../utilities/watch.js";import{FeatureSettings as V}from"./FeatureSettings.js";import{Schema as U}from"./Schema.js";const G=M("geocortex.api.data.Feature");export const SCORE_FIELD="_score";export const SCORE_FIELD_ORIGINAL="_score_original";let H=class extends r{attributes;get geometry(){return this._geometry}set geometry(e){this.notifyChange("geometryType"),this._geometry=w(e)||!e?e:i(e),this.schema.spatialReference=this._geometry?.spatialReference}settings;schema;attachments;expressionFieldValues;_itemType=h.FEATURE;get geometryType(){return this.geometry?this.geometry.type:void 0}get source(){return this._source}set source(e){this._source&&this.settings.parent===this._source.featureSettings&&(this.settings.parent=void 0),this._source&&this.schema.parent===this._source.schema&&(this.schema.parent=void 0),this._source=e,this.settings.parent||(this.settings.parent=e?e.featureSettings:void 0),this.schema.parent||(this.schema.parent=e?e.schema:void 0),this.notifyChange("attachmentsInitialized"),this.notifyChange("relatedFeaturesInitialized")}get primaryKey(){const e=this.attributes.get(this.schema.primaryKeyField);return null!=e?`${e}`:void 0}get hasGlobalId(){return!!this.schema.fields.find((e=>"global-id"===e.type))}get globalId(){const e=this.schema.fields.find((e=>"global-id"===e.type));return e?this.attributes.get(e.name):void 0}set globalId(e){const t=this.schema.fields.find((e=>"global-id"===e.type));if(!t)throw new o("Cannot set global ID on feature -- no global ID field.");this.attributes.set(t.name,e)}get presentableAttributes(){return null==this._presentableAttributes&&(this._presentableAttributes=new K(this)),this._presentableAttributes}get title(){return this.format(this._title||"")}get description(){return this.format(this._description)}get hyperlinks(){return this._hyperlinks||(this._hyperlinks=new Y(this))}get relatedFeatures(){return this._relatedFeatures}get type(){if(this.schema.typeIdField&&this.attributes.has(this.schema.typeIdField)){const e=this.attributes.get(this.schema.typeIdField);return this.schema.types.find((t=>t.id===e))}}get attachmentsInitialized(){return!this.source||this._attachmentsInitialized}get relatedFeaturesInitialized(){return!this.source||this.source.relationships.every((e=>this._initializedRelationships.has(e)))}get expressionsInitialized(){return!this.settings.popupTemplate?.expressionInfos?.length||this._expressionsInitialized}get _hydrationStatus(){return this._featureHydrationStatus?this._featureHydrationStatus:this.source?.capabilities?.supportsQuery&&1===this.attributes.size&&void 0!==this.primaryKey?"dehydrated":"hydrated"}set _hydrationStatus(e){this._featureHydrationStatus=e}get _key(){return`${this.source?.id}//${this.primaryKey??this.globalId??this.id}`}get _title(){let e;return this.settings.popupTemplate&&(e="function"==typeof this.settings.popupTemplate.title?this.settings.popupTemplate.title():this.settings.popupTemplate.title),e||this.schema.displayField&&this.presentableAttributes.get(this.schema.displayField)||""}get _description(){if(this.settings.popupTemplate?.content){if("string"==typeof this.settings.popupTemplate.content)return this.settings.popupTemplate.content;if(Array.isArray(this.settings.popupTemplate.content)){const e=this.settings.popupTemplate.content.find((e=>"text"===e.type));if(e)return e.text}}return""}_geometry;_source;_presentableAttributes;_hyperlinks;_featureHydrationStatus;_relatedFeatures;_expressionFieldValues=new m;_expressionValuesUpdatePending=!1;_attachmentsInitialized=!1;_expressionsInitialized=!1;_initializedRelationships=new WeakSet;_sourceRelationshipsHandle=new g((()=>P(this,"source.relationships",(()=>{this.notifyChange("relatedFeaturesInitialized")}),!0)));constructor(e){super(e),this.settings=new V,this.settings._setFeature(this),this.schema=new U,this.schema._featureSettings=this.settings,this.attachments=new s,this.attributes=new p,this._relatedFeatures=new m,this.expressionFieldValues=new $(this._expressionFieldValues,this),this.settings.watch("popupTemplate",((e,t)=>{e!==t&&(this._expressionsInitialized=!1,this.notifyChange("expressionsInitialized"))}),!0)}format(e,...t){let s="string"==typeof e?{format:e}:e;b("options",s).isNotMissing();const{format:i}=s;b("format",i).isNotMissing();let r=s.format.replace(B,W);return r=r.replace(J,((e,t,i,r,a)=>te(this,t||i,r,{...s,format:a?`{0:${a}}`:"{0}"}))),r=r.replace(q,"{{"),s={...s},s.format=r,T(s,...t)}clearExpressionInfos(){this._expressionFieldValues.clear()}toGraphic(){return toGraphic(this)}async fetchExpressionInfos(e=!1){const{expressionInfos:t}=this.settings.popupTemplate??{};if(!t)return;const{runAsyncArcadeExpression:s}=await import("../utilities/arcade.js");if(await Promise.all(t.map((async e=>{try{const t=this.source?.layer??this.source?.sublayer;let i=this.source?.mapExtension;if(!i){const e=this.source?.layerExtension;i=e?.mapExtension}this._expressionFieldValues.set(e.name,await s(e.expression,{layer:t,map:i?.map,feature:this,spatialReference:this.schema.spatialReference}))}catch(t){t instanceof Error&&G.error({message:"Error evaluating expression '{0}': {1}.",error:t},e.name,t.message),this._expressionFieldValues.set(e.name,X)}}))),e)return this.attributes.on("change",(async e=>{this._expressionValuesUpdatePending||(this._expressionValuesUpdatePending=!0,setTimeout((async()=>{this._expressionValuesUpdatePending=!1,await this.fetchExpressionInfos()}),0))}));this._expressionsInitialized=!0,this.notifyChange("expressionsInitialized")}async fetchRelatedFeatures(e,t){if(!this.source)return;let s=[];if(e){const t=new Set(Array.isArray(e)?e:[e]);for(const e of t){const t="string"==typeof e?this.source.relationships.find((t=>t.id===e)):e;if(!t||!this.source.relationships.includes(t))throw new o("Relationship not found in feature source.");s.push(t)}}else s=this.source.relationships.toArray();const i=await N(s,(async e=>[e,await(async()=>{const s=await e.getRelatedFeatures(this,t);return this._initializedRelationships.add(e),s})()]));for(const e of i)this._relatedFeatures.set(e[0],e[1]);this.notifyChange("relatedFeaturesInitialized")}async fetchAttachments(){if(this.source){const e=await this.source.getAttachments(this);F(this.attachments,e,{equals:(e,t)=>e.id===t.id,onMissing:(e,t)=>{this.attachments.remove(e)},onNew:(e,t)=>{this.attachments.add(e)},onMatch:(e,t,s,i)=>{this.attachments.splice(s,1,t)}}),this._attachmentsInitialized=!0,this.notifyChange("attachmentsInitialized")}}async addAttachment(e){return this.source?.addAttachment(this,e)}async deleteAttachments(e){return this.source?.deleteAttachments(this,e)}_getSerializableProperties(){return{...super._getSerializableProperties(),attributes:{serializeModes:["project"],serialize:e=>{const t={};if("project"===e&&this.primaryKey&&(this.source?.capabilities).supportsQuery)t[this.schema.primaryKeyField]=this.primaryKey;else for(const[e,s]of this.attributes.entries())t[e]=s;return t},deserialize:e=>{if(this.attributes.clear(),e instanceof Map||e instanceof m)e.forEach(((e,t)=>{this.attributes.set(t,e)}));else for(const[t,s]of Object.entries(e))this.attributes.set(t,s)}},geometry:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("geometry"):this.geometry?.toJSON(),deserialize:e=>{w(e)?this.geometry=e:this.geometry=e?i(e):void 0}},settings:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("settings"):this.settings.toJSON(e)},schema:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("schema"):this.schema.toJSON(e)},source:["project"]}}_watchProperty(e,t,s,i){if("title"===e||"description"===e){const r=super._watchProperty(e,t,s,i),a="title"===e?"settings.popupTemplate.title":"settings.popupTemplate.content",o=this.watch(a,(()=>{this.notifyChange(e)})),n=this.presentableAttributes.on("change",(()=>{this.notifyChange(e)}));return{remove(){r.remove(),o.remove(),n.remove()}}}if("relatedFeaturesInitialized"===e){const r=[this._sourceRelationshipsHandle.add(),super._watchProperty(e,t,s,i)];return{remove:()=>{for(const e of r)e.remove()}}}return super._watchProperty(e,t,s,i)}async _onInitialize(){const e=this._findRelationshipIds(this._title,this._description),t=this.source?this.source.relationships.map((e=>e.id)).toArray():[],s=[];for(const i of e)t.includes(i)?s.push(this.fetchRelatedFeatures(i)):G.error("Could not find relationship '{0}' referenced in feature title or description.",i);await Promise.all(s)}_findRelationshipIds(...e){const t=[];for(const s of e){let e;const i=s.replace(B,W);for(;e=Q.exec(i),null!==e;){const s=e[0];t.includes(s)||t.push(e[1])}}return t}};H=e([u],H);export{H as Feature};export function toFeature(e,t){const s=new H(t);if(e.attributes){const t=e.attributes;for(const[e,i]of Object.entries(t))s.attributes.set(e,i)}return s.geometry=e.geometry,e.popupTemplate&&(s.settings.popupTemplate=e.popupTemplate),s}export function toGraphic(e){const s=new t;s.attributes={};for(const t of e.attributes.keys())s.attributes[t]=e.attributes.get(t);return n(e.source)&&e.source.layer&&(s.layer=e.source.layer),l(e.source)&&e.source.table&&(s.layer=e.source.table),s.geometry=e.geometry,e.settings.popupTemplate&&(s.popupTemplate=e.settings.popupTemplate),s}const L="Presentable attributes are read-only.",Z="Feature hyperlinks are read-only. Modify the feature's hyperlink templates instead.";class $ extends f{_feature;_pending=new Set;constructor(e,t){super(e),this._feature=t}get(e){return super.has(e)||this._calcExpressionValue(e),super.get(e)}async _calcExpressionValue(e){if(!this._pending.has(e)){this._pending.add(e);try{const{spatialReference:t}=this._feature.schema,s=this._feature.settings.popupTemplate?.expressionInfos?.find((t=>t.name===e));if(!s)return;const{isArcadeScriptAsync:i,runAsyncArcadeExpression:r,arcadeScriptUsesGeometry:a,runArcadeExpression:o}=await import("../utilities/arcade.js");try{if(i(s.expression,t)){const i=this._feature.source?.layer??this._feature.source?.sublayer;let a=this._feature.source?.mapExtension;if(!a){const e=this._feature.source?.layerExtension;a=e?.mapExtension}this._originalMap.set(e,await r(s.expression,{feature:this._feature,layer:i,map:a?.map,spatialReference:t}))}else{if(a(s.expression,t)){const{enableGeometrySupport:e}=await import("@arcgis/core/arcade/arcade");await e()}this._originalMap.set(e,o(s.expression,{feature:this._feature,spatialReference:t}))}}catch(t){t instanceof Error&&G.error({message:"Error evaluating expression '{0}': {1}.",error:t},e,t.message),this._originalMap.set(e,X)}}finally{this._pending.delete(e)}}}}class K extends f{[Symbol.toStringTag];get size(){return this._feature.attributes.size+this._feature.schema.fields._expressionFieldsLength}_feature;_numObservers;_onAllObserversRemoved;constructor(e){super(new p),this._feature=e}clear(){throw new o(L)}delete(e){throw new o(L)}forEach(e,t){b("callback",e).isNotMissing();for(const s of this.keys())e.call(t,this.get(s),s,this)}get(e){const t=this._getFieldExtensionFormat(e);return this._formatAttribute(e,t)}has(e){for(const t of this.keys())if(D(t,e))return!0;return!1}set(...e){throw new o(L)}*entries(){yield*C(this.keys(),(e=>[e,this.get(e)]))}*keys(){yield*this._feature.attributes.keys();for(const e of this._feature.schema.fields.expressionFields)yield e.name;if(null!=this._feature.source?.relationships)for(const e of this._feature.source.relationships)if("one-to-one"===e.cardinality||"many-to-one"===e.cardinality)for(const t of e.relatedSource.schema.fields)yield`relationships/${e.id}/${t.name}`}*values(){yield*C(this.keys(),(e=>this.get(e)))}[Symbol.iterator](){return this.entries()}toJSON(){return Array.from(this.entries())}on(e,t){if(b("callback",t).isNotMissing(),!this._numObservers){const e=new Map,t=new Set,s=()=>{for(const e of t)e.remove();t.clear()};let i;const r=()=>{const t=()=>{i&&(window.clearTimeout(i),i=void 0)};t(),i=window.setTimeout((()=>{const s=[],i=[];for(const[t,i]of this.entries())i!==e.get(t)&&s.push([t,i]);for(const[t,s]of e.entries())this.has(t)&&s===this.get(t)||i.push([t,s]);if(s.length||i.length){const e={added:s,removed:i,target:this};this.emit("change",e),a()}t()}))},a=()=>{e.clear(),s();for(const s of this.keys()){const i=this._getFieldExtension(s);let a="{0}";if(i){const e=i.watch("format",r);t.add(e),i.format&&(a=i.format)}e.set(s,this._formatAttribute(s,a))}};a();const o=this._feature.attributes.on("change",r),n=this._feature.schema.fieldExtensions.on("change",r),l=this._feature.settings.formatSettings.watch(["numberFormat","dateFormat","timeFormat","locale"],r),h=this._feature.expressionFieldValues.on("change",r),u=this._feature.schema.fields.on("change",(e=>{(e.added?.some((e=>S(e.name)))||e.removed?.some((e=>S(e.name))))&&r()})),p=this._feature.settings.watch("popupTemplate",r);this._onAllObserversRemoved=()=>{h.remove(),o.remove(),n.remove(),u.remove(),l.remove(),p.remove(),e.clear(),s()}}const s=super.on("change",t);return this._numObservers++,{remove:()=>{s.remove(),this._numObservers--,this._numObservers||this._onAllObserversRemoved()}}}watch(e,t){if("size"===e){const e=this._feature.attributes.watch("size",((e,s)=>{t(e+this._feature.schema.fields._expressionFieldsLength,s+this._feature.schema.fields._expressionFieldsLength,"size",this)})),s=this._feature.schema.fields.watch("_expressionFieldsLength",((e,s)=>{t(e+this._feature.attributes.size,s+this._feature.attributes.size,"size",this)}));return{remove:()=>{e.remove(),s.remove()}}}return super.watch(e,t)}_getFieldExtension(e){const t=this._feature.schema.findFieldByName(e);if(t)return this._feature.schema.fieldExtensions.forField(t)}_getFieldExtensionFormat(e){const t=this._getFieldExtension(e);return t?t.format:"{0}"}_formatAttribute(e,t){const s=v(e);if(null!=s)return te(this._feature,"expression",s,{format:t});const[i,r]=I(e);return null!=i?te(this._feature,i,r,{format:t}):te(this._feature,void 0,e,{format:t})}}const J=/\{(?:relationships[\\/]([\w-]*)[\\/])?(?:(expression)[\\/])?([_a-zA-ZÀ-ÖØ-öø-ÿ][._a-zA-ZÀ-ÖØ-öø-ÿ0-9]*)(?::([^}]*))?\}/gi,Q=/\{relationships\/([\w-]*)[\\/]([^}]*)\}/gi,B=/{{/g,W="\0MAGIC\0",q=new RegExp(W,"g"),X="#INVALID";class Y extends c{_feature;_hyperlinks;constructor(e){super(e.settings.hyperlinkTemplates,(e=>this._getHyperlink(e))),this._feature=e}_getHyperlink(e){return null==this._hyperlinks&&(this._hyperlinks=new WeakMap),this._hyperlinks.has(e)||this._hyperlinks.set(e,new ee(this._feature,e)),this._hyperlinks.get(e)}}let ee=class extends a{get url(){return this._template.url?this._feature.format(this._template.url):this._template.url}set url(e){throw new o(Z)}get text(){return this._template.text?this._feature.format(this._template.text):this._template.text}set text(e){throw new o(Z)}get iconUrl(){return this._template.iconUrl?this._feature.format(this._template.iconUrl):this._template.iconUrl}set iconUrl(e){throw new o(Z)}get target(){return this._template.target?this._feature.format(this._template.target):this._template.target}set target(e){throw new o(Z)}get tooltip(){return this._template.tooltip?this._feature.format(this._template.tooltip):this._template.tooltip}set tooltip(e){throw new o(Z)}_feature;_template;constructor(e,t){super(t.toJSON()),this._feature=e,this._template=t}_watchProperty(e,t,s,i){const r=super._watchProperty(e,t,s,i),a=this._template.watch(e,(()=>{this.notifyChange(e)})),o=this._feature.presentableAttributes.on("change",(()=>{this.notifyChange(e)})),n=this._feature.relatedFeatures.on("change",(()=>{this.notifyChange(e)}));return{remove:()=>{r.remove(),a.remove(),o.remove(),n.remove()}}}_getSerializableProperties(){return{}}};function te(e,t,s,i={format:"{0}"}){if(!D(t,"expression")){if(t){const r=O(e.relatedFeatures.keys(),(e=>D(e.id,t)));if(!r)return G.debug("Could not resolve related field '{0}/{1}",t,s),X;const a=Array.from(e.relatedFeatures.get(r));return"many-to-one"===r.cardinality||"one-to-one"===r.cardinality?a.length<1?(G.debug("Could not resolve related field '{0}/{1}",t,s),X):se(a[0],s,i):a.map((e=>se(e,s,i))).filter((e=>""!==e)).join(",")}return se(e,s,i)}if(!e.settings.popupTemplate?.expressionInfos?.find((e=>D(e.name,s))))return G.debug("Could not find expression '{0}'.",s),X;try{const t=e.expressionFieldValues.get(s)??i.defaultExpressionValue??"",r=e.schema.findFieldByName(`expression/${s}`),a=null==r?void 0:e.schema.fieldExtensions.forField(r);return ie(e,t,s,a?.formatSettings,i)}catch(e){if(e instanceof Error)return G.error({message:"Error evaluating expression '{0}': {1}.",error:e},s,e.message),X;throw e}}function se(e,t,s){let i;if(i=e.attributes.get(t),null==i)return"";const r=e.schema.findFieldByName(t),a=e.type?.domains?.[r?.name??t],o=e=>e.codedValues?.find((e=>e.code.toString()===i.toString()))?.name??i;let n;if(D(t,e.schema.typeIdField)){const t=a&&"inherited"!==a.type?a:r?.domain;i="coded-value"===t?.type?o(t):e.type?.name??i}else if(a&&x(a))i=o(a);else if(r?.domain&&x(r.domain))i=o(r.domain);else if(r){switch(r.type){case"integer":case"small-integer":case"big-integer":case"single":case"double":i=j(i);break;case"date":i=z({timeZone:e.schema.timeZone},i);break;case"timestamp-offset":case"date-only":i=z({},i),"date-only"===r.type&&(s.isDateOnly=!0);break;case"time-only":i=k(i);break;default:i=`${i.toString()}`}const t=e.schema.fieldExtensions.forField(r);t&&(n=t.formatSettings)}return ie(e,i,t,n,s)}function ie(e,t,s,i,r){if("string"==typeof t&&(null==r.format||"{0}"===r.format))return t;const a={...r};if("number"==typeof t||t instanceof Date||t instanceof d){null==a.locale&&(a.locale=i?.locale??e.settings.formatSettings.locale);const r=e.settings.popupTemplate?.fieldInfos?.find((e=>D(e.fieldName,s)))?.format;"number"==typeof t?function(e,t,s,i){null==e.currency&&(e.currency=t?.currency??i.settings.formatSettings.currency);null==e.numberFormat&&(e.numberFormat=t?.numberFormat,null==e.numberFormat&&(e.numberFormat=null==s?i.settings.formatSettings.numberFormat:s.digitSeparator?E.NUMBER:E.FIXED_POINT));null==e.fractionalDigits&&(e.fractionalDigits=t?.fractionalDigits,null==e.fractionalDigits&&(e.fractionalDigits=null==s?i.settings.formatSettings.fractionalDigits:s.places))}(a,i,r,e):t instanceof Date?function(e,t,s,i){null==e.dateFormat&&(e.dateFormat=t?.dateFormat,null==e.dateFormat&&(e.dateFormat=null==s?i.settings.formatSettings.dateFormat:A(s.dateFormat)));null==e.timeZone&&(e.timeZone=t?.timeZone??i.settings.formatSettings.timeZone)}(a,i,r,e):function(e,t,s,i){null==e.timeFormat&&(e.timeFormat=t?.timeFormat,null==e.timeFormat&&(e.timeFormat=null==s?i.settings.formatSettings.timeFormat:R(s.dateFormat)))}(a,i,r,e)}return T(a,t)}ee=e([u],ee);export async function resolveRelatedFeatures(e){const t=_(e,(e=>e.source));await Promise.all(y([...t.keys()].map((e=>e.relationships.toArray()))).map((e=>(async e=>{[...(await e.getAllRelatedFeatures(t.get(e.source))).entries()].forEach((([t,s])=>{t.relatedFeatures.set(e,s)}))})(e))))}
|
|
1
|
+
import{__decorate as e}from"tslib";import t from"@arcgis/core/Graphic";import s from"@arcgis/core/core/Collection";import{fromJSON as i}from"@arcgis/core/geometry/support/jsonUtils";import{EntityBase as r}from"../Entity.js";import{Hyperlink as a}from"../Hyperlink.js";import{InvalidOperationError as o}from"../InvalidOperationError.js";import{isLayerExtension as n,isTableExtension as l,ItemType as h}from"../ItemType.js";import{serializable as u}from"../support/Serializable.js";import{createIHandle as p,notifyChange as c,onWatch as m,watch as f,watchEvent as d}from"../support/observableUtils.js";import{CaseInsensitiveObservableMap as g}from"../utilities/CaseInsensitiveObservableMap.js";import{MapTransformCollection as y}from"../utilities/MapTransformCollection.js";import{ObservableMap as _}from"../utilities/ObservableMap.js";import{ReadOnlyMap as b}from"../utilities/ReadOnlyMap.js";import{Time as F}from"../utilities/Time.js";import{flatten as x,groupBy as w}from"../utilities/array.js";import{checkArg as v}from"../utilities/checkArg.js";import{compare as I}from"../utilities/collection.js";import{isCodedValueDomain as S,isGeometry as z}from"../utilities/esri.js";import{getArcadeExpressionFromField as E,getRelationshipFromField as A,isArcadeExpressionField as j}from"../utilities/field.js";import{parse as T,esriFormatToGeocortexFormat as k}from"../utilities/format/date.js";import{NumberFormat as R}from"../utilities/format/formats.js";import{parse as O}from"../utilities/format/number.js";import{format as M}from"../utilities/format/string.js";import{parse as N,esriFormatToGeocortexFormat as D}from"../utilities/format/time.js";import{map as V,find as U}from"../utilities/iterable.js";import{getLogger as P}from"../utilities/log.js";import{map as C}from"../utilities/promise.js";import{caseInsensitiveEquals as G}from"../utilities/string.js";import{FeatureSettings as L}from"./FeatureSettings.js";import{Schema as Z}from"./Schema.js";const $=P("geocortex.api.data.Feature");export const SCORE_FIELD="_score";export const SCORE_FIELD_ORIGINAL="_score_original";let H=class extends r{attributes;get geometry(){return this._geometry}set geometry(e){this._geometry=z(e)||!e?e:i(e),this.schema.spatialReference=this._geometry?.spatialReference,c(this,"geometryType")}settings;schema;attachments;expressionFieldValues;_itemType=h.FEATURE;get geometryType(){return this.geometry?this.geometry.type:void 0}get source(){return this._source}set source(e){this._source===e||null==this._source&&null==e||(this._source&&this.settings.parent===this._source.featureSettings&&(this.settings.parent=void 0),this._source&&this.schema.parent===this._source.schema&&(this.schema.parent=void 0),this._source=e,this.settings.parent||(this.settings.parent=e?e.featureSettings:void 0),this.schema.parent||(this.schema.parent=e?e.schema:void 0),c(this,"attachmentsInitialized"),c(this,"relatedFeaturesInitialized"))}get primaryKey(){const e=this.attributes.get(this.schema.primaryKeyField);return null!=e?`${e}`:void 0}get hasGlobalId(){return!!this.schema.fields.find((e=>"global-id"===e.type))}get globalId(){const e=this.schema.fields.find((e=>"global-id"===e.type));return e?this.attributes.get(e.name):void 0}set globalId(e){const t=this.schema.fields.find((e=>"global-id"===e.type));if(!t)throw new o("Cannot set global ID on feature -- no global ID field.");this.attributes.set(t.name,e)}get presentableAttributes(){return null==this._presentableAttributes&&(this._presentableAttributes=new B(this)),this._presentableAttributes}get title(){return this.format(this._title||"")}get description(){return this.format(this._description)}get hyperlinks(){return this._hyperlinks||(this._hyperlinks=new se(this))}get relatedFeatures(){return this._relatedFeatures}get type(){if(this.schema.typeIdField&&this.attributes.has(this.schema.typeIdField)){const e=this.attributes.get(this.schema.typeIdField);return this.schema.types.find((t=>t.id===e))}}get attachmentsInitialized(){return!this.source||this._attachmentsInitialized}get relatedFeaturesInitialized(){return!this.source||this.source.relationships.every((e=>this._initializedRelationships.has(e)))}get expressionsInitialized(){return!this.settings.popupTemplate?.expressionInfos?.length||this._expressionsInitialized}get _hydrationStatus(){return this._featureHydrationStatus?this._featureHydrationStatus:this.source?.capabilities?.supportsQuery&&1===this.attributes.size&&void 0!==this.primaryKey?"dehydrated":"hydrated"}set _hydrationStatus(e){this._featureHydrationStatus=e}get _key(){return`${this.source?.id}//${this.primaryKey??this.globalId??this.id}`}get _title(){let e;return this.settings.popupTemplate&&(e="function"==typeof this.settings.popupTemplate.title?this.settings.popupTemplate.title():this.settings.popupTemplate.title),e||this.schema.displayField&&this.presentableAttributes.get(this.schema.displayField)||""}get _description(){if(this.settings.popupTemplate?.content){if("string"==typeof this.settings.popupTemplate.content)return this.settings.popupTemplate.content;if(Array.isArray(this.settings.popupTemplate.content)){const e=this.settings.popupTemplate.content.find((e=>"text"===e.type));if(e)return e.text}}return""}_geometry;_source;_presentableAttributes;_hyperlinks;_featureHydrationStatus;_relatedFeatures;_expressionFieldValues=new _;_expressionValuesUpdatePending=!1;_attachmentsInitialized=!1;_expressionsInitialized=!1;_initializedRelationships=new WeakSet;constructor(e){super(e),this.settings=new L,this.settings._setFeature(this),this.schema=new Z,this.schema._featureSettings=this.settings,this.attachments=new s,this.attributes=new g,this._relatedFeatures=new _,this.expressionFieldValues=new Q(this._expressionFieldValues,this),f(this.settings,"popupTemplate",(()=>{this._expressionsInitialized=!1,c(this,"expressionsInitialized")}),{sync:!0}),m(this,"title",(()=>{const e=f(this.settings,"popupTemplate.title",(()=>c(this,"title")),{sync:!0}),t=this.presentableAttributes.on("change",(()=>c(this,"title")));return p([e,t])})),m(this,"description",(()=>{const e=f(this.settings,"popupTemplate.content",(()=>c(this,"description")),{sync:!0}),t=this.presentableAttributes.on("change",(()=>c(this,"description")));return p([e,t])})),m(this,"relatedFeaturesInitialized",(()=>d(this,"source.relationships",["after-changes",()=>{c(this,"relatedFeaturesInitialized")}])))}format(e,...t){let s="string"==typeof e?{format:e}:e;v("options",s).isNotMissing();const{format:i}=s;v("format",i).isNotMissing();let r=s.format.replace(X,Y);return r=r.replace(W,((e,t,i,r,a)=>re(this,t||i,r,{...s,format:a?`{0:${a}}`:"{0}"}))),r=r.replace(ee,"{{"),s={...s},s.format=r,M(s,...t)}clearExpressionInfos(){this._expressionFieldValues.clear()}toGraphic(){return toGraphic(this)}async fetchExpressionInfos(e=!1){const{expressionInfos:t}=this.settings.popupTemplate??{};if(!t)return;const{runAsyncArcadeExpression:s}=await import("../utilities/arcade.js");if(await Promise.all(t.map((async e=>{try{const t=this.source?.layer??this.source?.sublayer;let i=this.source?.mapExtension;if(!i){const e=this.source?.layerExtension;i=e?.mapExtension}this._expressionFieldValues.set(e.name,await s(e.expression,{layer:t,map:i?.map,feature:this,spatialReference:this.schema.spatialReference}))}catch(t){t instanceof Error&&$.error({message:"Error evaluating expression '{0}': {1}.",error:t},e.name,t.message),this._expressionFieldValues.set(e.name,te)}}))),e)return this.attributes.on("change",(async e=>{this._expressionValuesUpdatePending||(this._expressionValuesUpdatePending=!0,setTimeout((async()=>{this._expressionValuesUpdatePending=!1,await this.fetchExpressionInfos()}),0))}));this._expressionsInitialized=!0,c(this,"expressionsInitialized")}async fetchRelatedFeatures(e,t){if(!this.source)return;let s=[];if(e){const t=new Set(Array.isArray(e)?e:[e]);for(const e of t){const t="string"==typeof e?this.source.relationships.find((t=>t.id===e)):e;if(!t||!this.source.relationships.includes(t))throw new o("Relationship not found in feature source.");s.push(t)}}else s=this.source.relationships.toArray();const i=await C(s,(async e=>[e,await(async()=>{const s=await e.getRelatedFeatures(this,t);return this._initializedRelationships.add(e),s})()]));for(const e of i)this._relatedFeatures.set(e[0],e[1]);c(this,"relatedFeaturesInitialized")}async fetchAttachments(){if(this.source){const e=await this.source.getAttachments(this);I(this.attachments,e,{equals:(e,t)=>e.id===t.id,onMissing:(e,t)=>{this.attachments.remove(e)},onNew:(e,t)=>{this.attachments.add(e)},onMatch:(e,t,s,i)=>{this.attachments.splice(s,1,t)}}),this._attachmentsInitialized=!0,c(this,"attachmentsInitialized")}}async addAttachment(e){return this.source?.addAttachment(this,e)}async deleteAttachments(e){return this.source?.deleteAttachments(this,e)}_getSerializableProperties(){return{...super._getSerializableProperties(),attributes:{serializeModes:["project"],serialize:e=>{const t={};if("project"===e&&this.primaryKey&&(this.source?.capabilities).supportsQuery)t[this.schema.primaryKeyField]=this.primaryKey;else for(const[e,s]of this.attributes.entries())t[e]=s;return t},deserialize:e=>{if(this.attributes.clear(),e instanceof Map||e instanceof _)e.forEach(((e,t)=>{this.attributes.set(t,e)}));else for(const[t,s]of Object.entries(e))this.attributes.set(t,s)}},geometry:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("geometry"):this.geometry?.toJSON(),deserialize:e=>{z(e)?this.geometry=e:this.geometry=e?i(e):void 0}},settings:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("settings"):this.settings.toJSON(e)},schema:{serializeModes:["project"],serialize:e=>"project"===e&&(this.source?.capabilities).supportsQuery?this.getDefault("schema"):this.schema.toJSON(e)},source:["project"]}}async _onInitialize(){const e=this._findRelationshipIds(this._title,this._description),t=this.source?this.source.relationships.map((e=>e.id)).toArray():[],s=[];for(const i of e)t.includes(i)?s.push(this.fetchRelatedFeatures(i)):$.error("Could not find relationship '{0}' referenced in feature title or description.",i);await Promise.all(s)}_findRelationshipIds(...e){const t=[];for(const s of e){let e;const i=s.replace(X,Y);for(;e=q.exec(i),null!==e;){const s=e[0];t.includes(s)||t.push(e[1])}}return t}};H=e([u],H);export{H as Feature};export function toFeature(e,t){const s=new H(t);if(e.attributes){const t=e.attributes;for(const[e,i]of Object.entries(t))s.attributes.set(e,i)}return s.geometry=e.geometry,e.popupTemplate&&(s.settings.popupTemplate=e.popupTemplate),s}export function toGraphic(e){const s=new t;s.attributes={};for(const t of e.attributes.keys())s.attributes[t]=e.attributes.get(t);return n(e.source)&&e.source.layer&&(s.layer=e.source.layer),l(e.source)&&e.source.table&&(s.layer=e.source.table),s.geometry=e.geometry,e.settings.popupTemplate&&(s.popupTemplate=e.settings.popupTemplate),s}const K="Presentable attributes are read-only.",J="Feature hyperlinks are read-only. Modify the feature's hyperlink templates instead.";class Q extends b{_feature;_pending=new Set;constructor(e,t){super(e),this._feature=t}get(e){return super.has(e)||this._calcExpressionValue(e),super.get(e)}async _calcExpressionValue(e){if(!this._pending.has(e)){this._pending.add(e);try{const{spatialReference:t}=this._feature.schema,s=this._feature.settings.popupTemplate?.expressionInfos?.find((t=>t.name===e));if(!s)return;const{isArcadeScriptAsync:i,runAsyncArcadeExpression:r,arcadeScriptUsesGeometry:a,runArcadeExpression:o}=await import("../utilities/arcade.js");try{if(i(s.expression,t)){const i=this._feature.source?.layer??this._feature.source?.sublayer;let a=this._feature.source?.mapExtension;if(!a){const e=this._feature.source?.layerExtension;a=e?.mapExtension}this._originalMap.set(e,await r(s.expression,{feature:this._feature,layer:i,map:a?.map,spatialReference:t}))}else{if(a(s.expression,t)){const{enableGeometrySupport:e}=await import("@arcgis/core/arcade/arcade");await e()}this._originalMap.set(e,o(s.expression,{feature:this._feature,spatialReference:t}))}}catch(t){t instanceof Error&&$.error({message:"Error evaluating expression '{0}': {1}.",error:t},e,t.message),this._originalMap.set(e,te)}}finally{this._pending.delete(e)}}}}class B extends b{get size(){return this._feature.attributes.size+this._feature.schema.fields._expressionFieldsLength}_feature;_numObservers;_onAllObserversRemoved;constructor(e){super(new g),this._feature=e,m(this,"size",(()=>f(this._feature.attributes,"size",(()=>c(this,"size")),{sync:!0}))),m(this,"size",(()=>f(this._feature.schema.fields,"_expressionFieldsLength",(()=>c(this,"size")),{sync:!0})))}clear(){throw new o(K)}delete(e){throw new o(K)}forEach(e,t){v("callback",e).isNotMissing();for(const s of this.keys())e.call(t,this.get(s),s,this)}get(e){const t=this._getFieldExtensionFormat(e);return this._formatAttribute(e,t)}has(e){for(const t of this.keys())if(G(t,e))return!0;return!1}set(...e){throw new o(K)}*entries(){yield*V(this.keys(),(e=>[e,this.get(e)]))}*keys(){yield*this._feature.attributes.keys();for(const e of this._feature.schema.fields.expressionFields)yield e.name;if(null!=this._feature.source?.relationships)for(const e of this._feature.source.relationships)if("one-to-one"===e.cardinality||"many-to-one"===e.cardinality)for(const t of e.relatedSource.schema.fields)yield`relationships/${e.id}/${t.name}`}*values(){yield*V(this.keys(),(e=>this.get(e)))}[Symbol.iterator](){return this.entries()}toJSON(){return Array.from(this.entries())}on(e,t){if(v("callback",t).isNotMissing(),!this._numObservers){const e=new Map,t=new Set,s=()=>{for(const e of t)e.remove();t.clear()};let i;const r=()=>{const t=()=>{i&&(window.clearTimeout(i),i=void 0)};t(),i=window.setTimeout((()=>{const s=[],i=[];for(const[t,i]of this.entries())i!==e.get(t)&&s.push([t,i]);for(const[t,s]of e.entries())this.has(t)&&s===this.get(t)||i.push([t,s]);if(s.length||i.length){const e={added:s,removed:i,target:this};if(this.hasEventListener("after-add"))for(const e of s)this.emit("after-add",{target:this,item:e});if(this.hasEventListener("after-remove"))for(const e of i)this.emit("after-remove",{target:this,item:e});this.emit("change",e),a()}t()}))},a=()=>{e.clear(),s();for(const s of this.keys()){const i=this._getFieldExtension(s);let a="{0}";if(i){const e=f(i,"format",r);t.add(e),i.format&&(a=i.format)}e.set(s,this._formatAttribute(s,a))}};a();const o=this._feature.attributes.on("change",r),n=this._feature.schema.fieldExtensions.on("change",r),l=[f(this._feature.settings.formatSettings,"numberFormat",r),f(this._feature.settings.formatSettings,"dateFormat",r),f(this._feature.settings.formatSettings,"timeFormat",r),f(this._feature.settings.formatSettings,"locale",r)],h=this._feature.expressionFieldValues.on("change",r),u=this._feature.schema.fields.on("change",(e=>{(e.added?.some((e=>j(e.name)))||e.removed?.some((e=>j(e.name))))&&r()})),p=f(this._feature.settings,"popupTemplate",r);this._onAllObserversRemoved=()=>{h.remove(),o.remove(),n.remove(),u.remove();for(const e of l)e.remove();p.remove(),e.clear(),s()}}const s=super.on(e,t);return this._numObservers++,{remove:()=>{s.remove(),this._numObservers--,this._numObservers||this._onAllObserversRemoved()}}}_getFieldExtension(e){const t=this._feature.schema.findFieldByName(e);if(t)return this._feature.schema.fieldExtensions.forField(t)}_getFieldExtensionFormat(e){const t=this._getFieldExtension(e);return t?t.format:"{0}"}_formatAttribute(e,t){const s=E(e);if(null!=s)return re(this._feature,"expression",s,{format:t});const[i,r]=A(e);return null!=i?re(this._feature,i,r,{format:t}):re(this._feature,void 0,e,{format:t})}}const W=/\{(?:relationships[\\/]([\w-]*)[\\/])?(?:(expression)[\\/])?([_a-zA-ZÀ-ÖØ-öø-ÿ][._a-zA-ZÀ-ÖØ-öø-ÿ0-9]*)(?::([^}]*))?\}/gi,q=/\{relationships\/([\w-]*)[\\/]([^}]*)\}/gi,X=/{{/g,Y="\0MAGIC\0",ee=new RegExp(Y,"g"),te="#INVALID";class se extends y{_feature;_hyperlinks;constructor(e){super(e.settings.hyperlinkTemplates,(e=>this._getHyperlink(e))),this._feature=e}_getHyperlink(e){return null==this._hyperlinks&&(this._hyperlinks=new WeakMap),this._hyperlinks.has(e)||this._hyperlinks.set(e,new ie(this._feature,e)),this._hyperlinks.get(e)}}let ie=class extends a{get url(){return this._template.url?this._feature.format(this._template.url):this._template.url}set url(e){throw new o(J)}get text(){return this._template.text?this._feature.format(this._template.text):this._template.text}set text(e){throw new o(J)}get iconUrl(){return this._template.iconUrl?this._feature.format(this._template.iconUrl):this._template.iconUrl}set iconUrl(e){throw new o(J)}get target(){return this._template.target?this._feature.format(this._template.target):this._template.target}set target(e){throw new o(J)}get tooltip(){return this._template.tooltip?this._feature.format(this._template.tooltip):this._template.tooltip}set tooltip(e){throw new o(J)}_feature;_template;constructor(e,t){super(t.toJSON()),this._feature=e,this._template=t,m(this,(e=>{const t=f(this._template,e,(()=>c(this,e)),{sync:!0}),s=this._feature.presentableAttributes.on("change",(()=>{c(this,e)})),i=this._feature.relatedFeatures.on("change",(()=>{c(this,e)}));return p([t,s,i])}))}_getSerializableProperties(){return{}}};function re(e,t,s,i={format:"{0}"}){if(!G(t,"expression")){if(t){const r=U(e.relatedFeatures.keys(),(e=>G(e.id,t)));if(!r)return $.debug("Could not resolve related field '{0}/{1}",t,s),te;const a=Array.from(e.relatedFeatures.get(r));return"many-to-one"===r.cardinality||"one-to-one"===r.cardinality?a.length<1?($.debug("Could not resolve related field '{0}/{1}",t,s),te):ae(a[0],s,i):a.map((e=>ae(e,s,i))).filter((e=>""!==e)).join(",")}return ae(e,s,i)}if(!e.settings.popupTemplate?.expressionInfos?.find((e=>G(e.name,s))))return $.debug("Could not find expression '{0}'.",s),te;try{const t=e.expressionFieldValues.get(s)??i.defaultExpressionValue??"",r=e.schema.findFieldByName(`expression/${s}`),a=null==r?void 0:e.schema.fieldExtensions.forField(r);return oe(e,t,s,a?.formatSettings,i)}catch(e){if(e instanceof Error)return $.error({message:"Error evaluating expression '{0}': {1}.",error:e},s,e.message),te;throw e}}function ae(e,t,s){let i;if(i=e.attributes.get(t),null==i)return"";const r=e.schema.findFieldByName(t),a=e.type?.domains?.[r?.name??t],o=e=>e.codedValues?.find((e=>e.code.toString()===i.toString()))?.name??i;let n;if(G(t,e.schema.typeIdField)){const t=a&&"inherited"!==a.type?a:r?.domain;i="coded-value"===t?.type?o(t):e.type?.name??i}else if(a&&S(a))i=o(a);else if(r?.domain&&S(r.domain))i=o(r.domain);else if(r){switch(r.type){case"integer":case"small-integer":case"big-integer":case"single":case"double":i=O(i);break;case"date":i=T({timeZone:e.schema.timeZone},i);break;case"timestamp-offset":case"date-only":i=T({},i),"date-only"===r.type&&(s.isDateOnly=!0);break;case"time-only":i=N(i);break;default:i=`${i.toString()}`}const t=e.schema.fieldExtensions.forField(r);t&&(n=t.formatSettings)}return oe(e,i,t,n,s)}function oe(e,t,s,i,r){if("string"==typeof t&&(null==r.format||"{0}"===r.format))return t;const a={...r};if("number"==typeof t||t instanceof Date||t instanceof F){null==a.locale&&(a.locale=i?.locale??e.settings.formatSettings.locale);const r=e.settings.popupTemplate?.fieldInfos?.find((e=>G(e.fieldName,s)))?.format;"number"==typeof t?function(e,t,s,i){null==e.currency&&(e.currency=t?.currency??i.settings.formatSettings.currency);null==e.numberFormat&&(e.numberFormat=t?.numberFormat,null==e.numberFormat&&(e.numberFormat=null==s?i.settings.formatSettings.numberFormat:s.digitSeparator?R.NUMBER:R.FIXED_POINT));null==e.fractionalDigits&&(e.fractionalDigits=t?.fractionalDigits,null==e.fractionalDigits&&(e.fractionalDigits=null==s?i.settings.formatSettings.fractionalDigits:s.places))}(a,i,r,e):t instanceof Date?function(e,t,s,i){null==e.dateFormat&&(e.dateFormat=t?.dateFormat,null==e.dateFormat&&(e.dateFormat=null==s?i.settings.formatSettings.dateFormat:k(s.dateFormat)));null==e.timeZone&&(e.timeZone=t?.timeZone??i.settings.formatSettings.timeZone)}(a,i,r,e):function(e,t,s,i){null==e.timeFormat&&(e.timeFormat=t?.timeFormat,null==e.timeFormat&&(e.timeFormat=null==s?i.settings.formatSettings.timeFormat:D(s.dateFormat)))}(a,i,r,e)}return M(a,t)}ie=e([u],ie);export async function resolveRelatedFeatures(e){const t=w(e,(e=>e.source));await Promise.all(x([...t.keys()].map((e=>e.relationships.toArray()))).map((e=>(async e=>{[...(await e.getAllRelatedFeatures(t.get(e.source))).entries()].forEach((([t,s])=>{t.relatedFeatures.set(e,s)}))})(e))))}
|
package/data/FeatureSet.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import Evented from "@arcgis/core/core/Evented.js";
|
|
1
2
|
import type { Entity, EntityProperties } from "../Entity.js";
|
|
2
|
-
import { Observable } from "../support/Observable.js";
|
|
3
3
|
import type { PropertyDefs, Serializable, SerializeMode } from "../support/Serializable.js";
|
|
4
4
|
import type { ChangeEvent } from "../support/esri.js";
|
|
5
|
+
import type { WatchCallback } from "../utilities/watch.js";
|
|
5
6
|
import type { FeatureProperties } from "./Feature.js";
|
|
6
7
|
import { Feature } from "./Feature.js";
|
|
7
8
|
import type { FeatureSettingsProperties } from "./FeatureSettings.js";
|
|
@@ -35,10 +36,11 @@ export interface FeatureSetProperties extends EntityProperties {
|
|
|
35
36
|
*/
|
|
36
37
|
settings?: FeatureSettingsProperties;
|
|
37
38
|
}
|
|
39
|
+
declare const FeatureSet_base: typeof Evented & (abstract new (...args: any[]) => import("../support/observableUtils.js").ObservableMixin);
|
|
38
40
|
/**
|
|
39
41
|
* A set of features that share a common schema.
|
|
40
42
|
*/
|
|
41
|
-
export declare class FeatureSet extends
|
|
43
|
+
export declare class FeatureSet extends FeatureSet_base implements Entity, Serializable<FeatureSetProperties>, Set<Feature> {
|
|
42
44
|
/**
|
|
43
45
|
* Used by Object.toString().
|
|
44
46
|
*/
|
|
@@ -192,6 +194,41 @@ export declare class FeatureSet extends Observable implements Entity, Serializab
|
|
|
192
194
|
* Returns each element in the set in insertion order.
|
|
193
195
|
*/
|
|
194
196
|
[Symbol.iterator](): IterableIterator<Feature>;
|
|
197
|
+
/**
|
|
198
|
+
* @deprecated
|
|
199
|
+
* @inheritdoc
|
|
200
|
+
*/
|
|
201
|
+
set<T>(propertyPath: string, value: T): this;
|
|
202
|
+
/**
|
|
203
|
+
* @deprecated
|
|
204
|
+
* @inheritdoc
|
|
205
|
+
*/
|
|
206
|
+
set(properties: HashMap<unknown>): this;
|
|
207
|
+
/**
|
|
208
|
+
* @deprecated
|
|
209
|
+
* @inheritdoc
|
|
210
|
+
*/
|
|
211
|
+
get<T>(propertyPath: string): T;
|
|
212
|
+
/**
|
|
213
|
+
* @deprecated
|
|
214
|
+
* @inheritdoc
|
|
215
|
+
*/
|
|
216
|
+
get(propertyPath: string): unknown;
|
|
217
|
+
/**
|
|
218
|
+
* @deprecated
|
|
219
|
+
* @inheritdoc
|
|
220
|
+
*/
|
|
221
|
+
watch(path: string | string[], callback: WatchCallback, sync?: boolean): IHandle;
|
|
222
|
+
/**
|
|
223
|
+
* @deprecated
|
|
224
|
+
* @inheritdoc
|
|
225
|
+
*/
|
|
226
|
+
notifyChange(propertyKey: keyof this): void;
|
|
227
|
+
/**
|
|
228
|
+
* @deprecated
|
|
229
|
+
* @inheritdoc
|
|
230
|
+
*/
|
|
231
|
+
_watchProperty(propertyKey: keyof this, subpath: string, callback: WatchCallback, sync: boolean): IHandle;
|
|
195
232
|
protected _add(feature: Feature, notify?: boolean): this;
|
|
196
233
|
/**
|
|
197
234
|
* @inheritDoc
|
|
@@ -202,3 +239,4 @@ export declare class FeatureSet extends Observable implements Entity, Serializab
|
|
|
202
239
|
*/
|
|
203
240
|
protected _getSerializableProperties(): PropertyDefs<FeatureSetProperties>;
|
|
204
241
|
}
|
|
242
|
+
export {};
|
package/data/FeatureSet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e;import{__decorate as t}from"tslib";import r from"@arcgis/core/core/Collection";import{generateId as
|
|
1
|
+
var e;import{__decorate as t}from"tslib";import r from"@arcgis/core/core/Collection";import s from"@arcgis/core/core/Evented.js";import{generateId as i}from"../Entity.js";import{isFeature as a,ItemType as h}from"../ItemType.js";import{deprecatedGetPropertyPath as o,deprecatedNotifyChange as n,deprecatedSet as u,deprecatedWatch as d,deprecatedWatchProperty as c}from"../support/Observable.js";import{assignProperties as m,assignPropertiesAsync as g,filterJSONProperties as l,getDefaults as p,getSerializableProperties as y,serializable as _}from"../support/Serializable.js";import{notifyChange as f,observable as S,watchEach as v}from"../support/observableUtils.js";import{ObservableMap as b}from"../utilities/ObservableMap.js";import{groupBy as F}from"../utilities/array.js";import{toArray as z,from as j,empty as P}from"../utilities/asyncIterable.js";import{compare as E,find as w}from"../utilities/iterable.js";import{getLogger as C}from"../utilities/log.js";import{Feature as k}from"./Feature.js";import{FeatureSettings as M}from"./FeatureSettings.js";import{Schema as T}from"./Schema.js";const A=C("feature-set");let I=e=class extends(S(s)){[Symbol.toStringTag];id;title;get size(){return this._features.size}get source(){return this._source}set source(e){this._source===e||null==this._source&&null==e||(this._source&&this.settings.parent===this._source.featureSettings&&(this.settings.parent=void 0),this._source&&this.schema.parent===this._source.schema&&(this.schema.parent=void 0),this._source=e,this.settings.parent||(this.settings.parent=e?e.featureSettings:void 0),this.schema.parent||(this.schema.parent=e?e.schema:void 0))}settings=new M;schema=new T;get itemType(){return h.FEATURE_SET}_source;_rehydratingFeatureCount=0;_rehydratingFeatures=new r;_features=new b;constructor(e){super(),this.schema._featureSettings=this.settings,this.id=e?.id??i(),v(this._rehydratingFeatures,"[]._hydrationStatus",(()=>{if(this._rehydratingFeatureCount--,!this._rehydratingFeatureCount){const e=this._rehydratingFeatures.toArray();this.addMany(e),this.emit("feature-hydration-complete",e)}})),this.on("dehydrated-features-added",(async e=>{this._rehydratingFeatures.addMany(e);const t=F(e,(e=>e.source)),r=F(await z(j([...t.entries()].map((([e,t])=>{let r;try{r=e?.getFeatures(t.map((e=>e.primaryKey)).filter((e=>!!e)))??P()}catch(t){r=P(),A.error({error:t,message:`Failed to hydrate features from source '${e?.title??e?.id}`})}return r})))),(e=>e.source));[...t.entries()].forEach((([e,t])=>{const s=r.get(e);t.forEach((e=>{const t=s?.find((t=>t.primaryKey===e.primaryKey));t&&(e.geometry=t.geometry,[...t.attributes.entries()].forEach((([t,r])=>{e.attributes.set(t,r)}))),e._hydrationStatus=void 0}))}))})),this.assignProperties(e)}static async fromFeatureStream(t,r){const s=new e(r);for await(const e of t)s.add(e);return s}on(e,t){return super.on(e,t)}assignProperties(e){m(this._getSerializableProperties(),this,e)}async assignPropertiesAsync(e){return g(this._getSerializableProperties(),this,e)}async finishAssignProperties(){}has(e){return this._features.has(e._key)}entries(){return[...this._features].map((([e,t])=>[t,t]))[Symbol.iterator]()}keys(){return this._features.values()}values(){return this._features.values()}toJSON(e="all"){return l(this._getSerializableProperties(),this,e)}toItemUri(){return`item://${encodeURIComponent(h.FEATURE_SET)}/${encodeURIComponent(this.id)}`}add(e){return this._add(e)}addMany(e){const t=[],r=[];for(const s of e){const e=this._features.get(s._key);s!==e&&(this._add(s,!1),t.push(s),e&&r.push(e))}return t.length&&(f(this,"size"),this.emit("change",{added:t,removed:r,moved:[],target:this})),this}clear(){const e=Array.from(this.values());this._features.clear(),f(this,"size"),this.emit("change",{added:[],removed:e,moved:[],target:this})}delete(e){return this._delete(e)}deleteMany(e){const t=[];for(const r of e){const e=this._features.get(r._key);this._delete(r,!1)&&t.push(e)}return t.length&&(f(this,"size"),this.emit("change",{added:[],removed:t,moved:[],target:this})),!!t.length}forEach(e,t){this._features.forEach((t=>e(t,t,this)),t)}findById(e){return w(this,(t=>t.id===e))}findByPrimaryKey(e){return w(this,(t=>t.primaryKey===e))}getSerializableProperties(e="all"){return y(this._getSerializableProperties(),e)}getDefaults(){return p(this._getSerializableProperties())}getDefault(e){return this.getDefaults()[e]}[Symbol.iterator](){return this._features.values()[Symbol.iterator]()}set(e,t){return u(this,e,t)}get(e){return o(this,e)}watch(e,t,r){return d(this,e,t,r)}notifyChange(e){n(this,e)}_watchProperty(e,t,r,s){return c(this,e,t,r,s)}_add(e,t=!0){const r=this._features.get(e._key);return r&&r!==e&&this._delete(r,!1),this._features.set(e._key,e),t&&r!==e&&(f(this,"size"),this.emit("change",{added:[e],removed:r?[r]:[],moved:[],target:this})),this.source&&!e.source&&(e.source=this.source),e.schema.parent||(e.schema.parent=this.schema),e.settings.parent||(e.settings.parent=this.settings),this}_delete(e,t=!0){if(!this.has(e))return!1;const r=this._features.get(e._key);return this._features.delete(e._key),t&&(f(this,"size"),this.emit("change",{added:[],removed:[r],moved:[],target:this})),e.schema.parent===this.schema&&(e.schema.parent=void 0),e.settings.parent===this.settings&&(e.settings.parent=void 0),!0}_getSerializableProperties(){return{id:["project"],features:{serializeModes:["project"],serialize:()=>[...this],deserialize:e=>{const t=[],r=[];E(this._rehydratingFeatures.concat([...this]),e,{onNew:e=>{if(a(e))"dehydrated"===e._hydrationStatus?(e._hydrationStatus="rehydrating",this._rehydratingFeatureCount++,t.push(e)):"rehydrating"===e._hydrationStatus?(this._rehydratingFeatureCount++,this._rehydratingFeatures.push(e)):(r.push(e),this.add(e));else{const t=new k(e);r.push(t),this.add(t)}},onMatch:(e,r)=>{a(r)?"dehydrated"===e._hydrationStatus?(e._hydrationStatus="rehydrating",this._rehydratingFeatureCount++,t.push(e)):e!==r&&this.add(r):e.assignProperties(r)},onMissing:e=>{this.delete(e)},equals:(e,t)=>a(t)?e._key===t._key:e.id===t.id}),t.length?this.emit("dehydrated-features-added",t):this._rehydratingFeatureCount||this.emit("feature-hydration-complete",r)}},title:["project"],source:[],schema:[],settings:[]}}};I=e=t([_],I);export{I as FeatureSet};
|
package/data/FeatureSettings.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as t}from"tslib";import e from"@arcgis/core/PopupTemplate";import{Hyperlink as i}from"../Hyperlink.js";import{isPopupContentExtension as n}from"../ItemType.js";import{ArrayWrappedCollection as o}from"../mapping/support/ArrayWrappedCollection.js";import{FormatSettings as s}from"../support/FormatSettings.js";import{InitializableCollectionProxy as r}from"../support/InitializableCollectionProxy.js";import{filterJSONProperties as p,isDefault as a,serializable as u,shouldExcludeDefaults as l}from"../support/Serializable.js";import{Settings as h}from"../support/Settings.js";import f from"../utilities/_ReferenceCountedHandle.js";import{compare as d}from"../utilities/array.js";import{checkArg as c}from"../utilities/checkArg.js";import{getAllFieldInfos as m,getAllReferencedFieldNames as _,isPopupTemplate as g}from"../utilities/esri.js";import{isArcadeExpressionField as S,isRelationshipField as C}from"../utilities/field.js";import{objectKeys as y}from"../utilities/object.js";import{isQueryBasedRelationship as T}from"../utilities/relationships.js";import{caseInsensitiveEquals as x}from"../utilities/string.js";import{onCollectionPropertyChange as z}from"../utilities/watch.js";import{PopupContentExtension as v,_popupContentExtensionMap as E}from"./PopupContentExtension.js";let w=class extends h{popupContentExtensions;_isDefaultPopupTemplate=!1;_popupContentCollection;get _popupContent(){return null==this._popupContentCollection&&(this._popupContentCollection=this._createPopupContentCollection()),this._popupContentCollection}get hyperlinkTemplates(){return this._getCollectionSetting("hyperlinkTemplates")}get popupTemplate(){return this._getSetting("popupTemplate")}set popupTemplate(t){let i;i=t instanceof Object&&!g(t)?e.fromJSON(t):t;const n=this?._feature?.schema?.createPopupTemplate()??this?._featureSource?.schema?.createPopupTemplate();i&&n&&(i.content=i.content??n.content,i.fieldInfos=i.fieldInfos??n.fieldInfos),this._setSetting("popupTemplate",i),this._isDefaultPopupTemplate=!1}get showRelatedRecordsWhenUnconfigured(){return this._getSetting("showRelatedRecordsWhenUnconfigured",!0)}set showRelatedRecordsWhenUnconfigured(t){this._setSetting("showRelatedRecordsWhenUnconfigured",t)}get formatSettings(){return this._getNestedSettings("formatSettings",(()=>new s))}get returnGeometry(){return this._getSetting("returnGeometry",!0)}set returnGeometry(t){this._setSetting("returnGeometry",t)}get outFields(){return this._getSetting("outFields",this._defaultOutFields)}set outFields(t){this._setSetting("outFields",t)}get outSpatialReference(){return this._getSetting("outSpatialReference")}set outSpatialReference(t){this._setSetting("outSpatialReference",t)}get maxAllowableOffset(){return this._getSetting("maxAllowableOffset")}set maxAllowableOffset(t){this._setSetting("maxAllowableOffset",t)}get zoomScale(){return this._getSetting("zoomScale")}set zoomScale(t){this._setSetting("zoomScale",t)}get zoomFactor(){const t=this._feature?this._feature.schema:this._featureSource?.schema,e=t&&"point"===t.geometryType?void 0:1.5;return this._getSetting("zoomFactor",e)}set zoomFactor(t){this._setSetting("zoomFactor",t)}get featureSource(){return this._featureSource}get feature(){return this._feature}_featureSource;_feature;constructor(t){super(t),this.popupContentExtensions=new A(this)}get _defaultOutFields(){if(null==this.popupTemplate)return["*"];const t=m(this.popupTemplate),e=this.featureSource?.schema?.primaryKeyField;if(t&&e){const i=new Set;i.add(e);const n=this.featureSource.schema.fields.toArray().map((t=>t.name)),o=new Set([..._(this.popupTemplate),...this.hyperlinkTemplates.toArray().flatMap((t=>t.getReferencedFields()))]),s=t.filter((t=>t.visible||t.isEditable&&this.featureSource.capabilities.supportsEditing)).map((t=>t.fieldName)).concat(...o).filter((t=>n.some((e=>x(e,t)))));return this._featureSource.relationships.forEach((t=>{T(t)&&s.push(t.keyField)})),s.filter((t=>!(S(t)||C(t)))).forEach((t=>i.add(t))),Array.from(i.values())}return["*"]}_setFeatureSource(t){this._featureSource=t,this.notifyChange("featureSource")}_setFeature(t){this._feature=t,this.notifyChange("feature")}toJSON(t="all"){const e=p(this._getSerializableProperties(),this,t)||{},i=e.popupContentExtensions?.filter((t=>{const e=this.parent;return!e?.popupContentExtensions?.some((e=>e.id===t.id))}));if(e)for(const t of y(e))this.isModified(t)||delete e[t];if(i?.length&&(e.popupContentExtensions=i),!l(t)||!a(e))return e}_createPopupContentCollection(){return new o({parent:this,targetProperty:"popupTemplate",arrayProperty:"content"})}_getSerializableProperties(){return{hyperlinkTemplates:{serializeModes:["initial"],deserialize:t=>{t.forEach((t=>{this.hyperlinkTemplates.find((e=>this._hyperlinksAreEquivalent(e,t)))||this.hyperlinkTemplates.add(t instanceof i?t:new i(t))})),this.hyperlinkTemplates.toArray().forEach((e=>{const i=this.hyperlinkTemplates.indexOf(e),n=t.findIndex((t=>this._hyperlinksAreEquivalent(t,e)));n<0?this.hyperlinkTemplates.removeAt(i):n!==i&&this.hyperlinkTemplates.reorder(e,n)}))}},popupTemplate:{serializeModes:["project"],isDefault:()=>!this._isDefaultPopupTemplate},showRelatedRecordsWhenUnconfigured:{serializeModes:["initial"],default:!0},formatSettings:"initial",outFields:{serializeModes:["initial"],serialize:()=>this.isModified("outFields")?this.outFields:void 0},returnGeometry:{serializeModes:["initial"],default:!0},outSpatialReference:"initial",maxAllowableOffset:"initial",zoomScale:"initial",zoomFactor:{serializeModes:["initial"],isDefault:t=>{const e=this._feature?this._feature.schema:this._featureSource?.schema;return t===(e&&"point"===e.geometryType?void 0:1.5)}},popupContentExtensions:{serializeModes:["initial"],serialize:t=>this.popupContentExtensions.map((e=>e.toJSON(t))).filter((t=>!(t&&2===Object.keys(t).length&&t.id&&t.content))).toArray(),deserialize:t=>{t&&d(this.popupContentExtensions,t,{onNew:(t,e)=>{this.popupContentExtensions.add(n(t)?t:new v(t),e)},onMatch:(t,e,i,o)=>{n(e)||t.assignProperties(e),i!==o&&this.popupContentExtensions.reorder(t,o)},onMissing:t=>{this.popupContentExtensions.remove(t)},equals:(t,e)=>{if(!e)return!1;if(n(e))return e===t||e.id===t.id;const i=this.popupContentExtensions.indexOf(t);if(e.content&&i>-1){const t=this.popupContentExtensions.toArray();return v.matchesRef(t,i,e.content)}return t.id===e.id}})}}}}_hyperlinksAreEquivalent(t,e){if(t===e)return!0;const i=t=>t||"";return i(t.text)===i(e.text)&&i(t.url)===i(e.url)&&i(t.iconUrl)===i(e.iconUrl)&&i(t.target)===i(e.target)&&i(t.tooltip)===i(e.tooltip)}};w=t([u],w);export{w as FeatureSettings};class A extends r{get _collection(){return this._featureSettings._popupContent.map((t=>this._forContent(t))).concat(Array.from(this._uninitializedPopupContentExtensions))}get _popupTemplateIsInherited(){return this._featureSettings.parent&&this._featureSettings.popupTemplate===this._featureSettings.parent.popupTemplate}_featureSettings;_uninitializedPopupContentExtensions=new Set;_popupContentHandle=new f((()=>z(this._featureSettings,"_popupContent",(t=>{const e={added:(t.added||[]).map((t=>this._forContent(t))),moved:(t.moved||[]).map((t=>this._forContent(t))),removed:(t.removed||[]).map((t=>this._forContent(t))),target:this};this.emit("change",e)}))));_popupContentLengthHandle=new f((()=>this._featureSettings.watch("_popupContent.length",(()=>this.notifyChange("length")))));constructor(t){super(),this._featureSettings=t}forContent(t){if(c("content",t).isNotMissing(),this._featureSettings._popupContent.includes(t))return this._forContent(t)}add(t,i){if(c("contentX",t).isNotMissing(),this._popupTemplateIsInherited&&(this._featureSettings.popupTemplate=new e({content:this._featureSettings._popupContent.toArray()})),t.featureSettings&&t.featureSettings.popupContentExtensions.remove(t),t._setFeatureSettings(this._featureSettings),t.content){const e=E.get(t.content);if(E.set(t.content,t),e&&e!==t&&this._onRemoved(e),this._featureSettings._popupContent.includes(t.content))if(void 0===i){const i={added:[t],moved:[],removed:e?[e]:[],target:this};this.emit("change",i)}else this._featureSettings._popupContent.reorder(t.content,i);else this._featureSettings._popupContent.add(t.content,i)}else{this._uninitializedPopupContentExtensions.add(t);const e={added:[t],moved:[],removed:[],target:this};this.emit("change",e)}return this._onAdded(t),this}removeAt(t){const i=this.getItemAt(t);if(void 0!==i){if(this._popupTemplateIsInherited&&(this._featureSettings.popupTemplate=new e({content:this._featureSettings._popupContent.toArray()})),this._uninitializedPopupContentExtensions.has(i)){this._uninitializedPopupContentExtensions.delete(i);const t={added:[],moved:[],removed:[i],target:this};this.emit("change",t)}else this._featureSettings._popupContent.remove(i.content);return this._onRemoved(i),i}}reorder(t,i){if(t&&this._featureSettings._popupContent.includes(t.content))return this._popupTemplateIsInherited&&(this._featureSettings.popupTemplate=new e({content:this._featureSettings._popupContent.toArray()})),this._featureSettings._popupContent.reorder(t.content,i),t}sort(t){return this._popupTemplateIsInherited&&(this._featureSettings.popupTemplate=new e({content:this._featureSettings._popupContent.toArray()})),this._featureSettings._popupContent.sort(((e,i)=>t(this._forContent(e),this._forContent(i)))),this}on(t,e){if("change"===t){const i=[this._popupContentHandle.add(),super.on(t,e)];return{remove:()=>{for(const t of i)t.remove()}}}return super.on(t,e)}watch(t,e,i){if((Array.isArray(t)?t:[t]).includes("length")){const n=[this._popupContentLengthHandle.add(),super.watch(t,e,i)];return{remove:()=>{for(const t of n)t.remove()}}}return super.watch(t,e,i)}_itemIsInitialized(t){return super._itemIsInitialized(t)&&!!t.content}_onAdded(t){}_onRemoved(t){t.featureSettings===this._featureSettings&&t._setFeatureSettings(void 0)}_forContent(t){if(this._uninitializedPopupContentExtensions.size)for(const t of this._uninitializedPopupContentExtensions)t._resolveContent(),t.content&&(E.set(t.content,t),this._uninitializedPopupContentExtensions.delete(t));if(!E.has(t)){const e=new v({content:t});E.set(t,e),e._setFeatureSettings(this._featureSettings),this._onAdded(e)}return E.get(t)}}
|
|
1
|
+
import{__decorate as t}from"tslib";import e from"@arcgis/core/PopupTemplate";import{Hyperlink as n}from"../Hyperlink.js";import{isPopupContentExtension as i}from"../ItemType.js";import{ArrayWrappedCollection as o}from"../mapping/support/ArrayWrappedCollection.js";import{FormatSettings as s}from"../support/FormatSettings.js";import{InitializableCollectionProxy as r}from"../support/InitializableCollectionProxy.js";import{filterJSONProperties as p,isDefault as a,serializable as u,shouldExcludeDefaults as h}from"../support/Serializable.js";import{Settings as l}from"../support/Settings.js";import{createIHandle as f,notifyChange as d,onWatch as m,watch as c}from"../support/observableUtils.js";import _ from"../utilities/_ReferenceCountedHandle.js";import{compare as g}from"../utilities/array.js";import{checkArg as C}from"../utilities/checkArg.js";import{getAllFieldInfos as S,getAllReferencedFieldNames as y,isPopupTemplate as v}from"../utilities/esri.js";import{isArcadeExpressionField as T,isRelationshipField as x}from"../utilities/field.js";import{objectKeys as A}from"../utilities/object.js";import{isQueryBasedRelationship as P}from"../utilities/relationships.js";import{caseInsensitiveEquals as z}from"../utilities/string.js";import{PopupContentExtension as E,_popupContentExtensionMap as w}from"./PopupContentExtension.js";let b=class extends l{popupContentExtensions;_isDefaultPopupTemplate=!1;_popupContentCollection;get _popupContent(){return null==this._popupContentCollection&&(this._popupContentCollection=this._createPopupContentCollection()),this._popupContentCollection}get hyperlinkTemplates(){return this._getCollectionSetting("hyperlinkTemplates")}get popupTemplate(){return this._getSetting("popupTemplate")}set popupTemplate(t){let n;n=t instanceof Object&&!v(t)?e.fromJSON(t):t;const i=this?._feature?.schema?.createPopupTemplate()??this?._featureSource?.schema?.createPopupTemplate();n&&i&&(n.content=n.content??i.content,n.fieldInfos=n.fieldInfos??i.fieldInfos),this._setSetting("popupTemplate",n),this._isDefaultPopupTemplate=!1}get showRelatedRecordsWhenUnconfigured(){return this._getSetting("showRelatedRecordsWhenUnconfigured",!0)}set showRelatedRecordsWhenUnconfigured(t){this._setSetting("showRelatedRecordsWhenUnconfigured",t)}get formatSettings(){return this._getNestedSettings("formatSettings",(()=>new s))}get returnGeometry(){return this._getSetting("returnGeometry",!0)}set returnGeometry(t){this._setSetting("returnGeometry",t)}get outFields(){return this._getSetting("outFields",this._defaultOutFields)}set outFields(t){this._setSetting("outFields",t)}get outSpatialReference(){return this._getSetting("outSpatialReference")}set outSpatialReference(t){this._setSetting("outSpatialReference",t)}get maxAllowableOffset(){return this._getSetting("maxAllowableOffset")}set maxAllowableOffset(t){this._setSetting("maxAllowableOffset",t)}get zoomScale(){return this._getSetting("zoomScale")}set zoomScale(t){this._setSetting("zoomScale",t)}get zoomFactor(){const t=this._feature?this._feature.schema:this._featureSource?.schema,e=t&&"point"===t.geometryType?void 0:1.5;return this._getSetting("zoomFactor",e)}set zoomFactor(t){this._setSetting("zoomFactor",t)}get featureSource(){return this._featureSource}get feature(){return this._feature}_featureSource;_feature;constructor(t){super(t),this.popupContentExtensions=new R(this)}get _defaultOutFields(){if(null==this.popupTemplate)return["*"];const t=S(this.popupTemplate),e=this.featureSource?.schema?.primaryKeyField;if(t&&e){const n=new Set;n.add(e);const i=this.featureSource.schema.fields.toArray().map((t=>t.name)),o=new Set([...y(this.popupTemplate),...this.hyperlinkTemplates.toArray().flatMap((t=>t.getReferencedFields()))]),s=t.filter((t=>t.visible||t.isEditable&&this.featureSource.capabilities.supportsEditing)).map((t=>t.fieldName)).concat(...o).filter((t=>i.some((e=>z(e,t)))));return this._featureSource.relationships.forEach((t=>{P(t)&&s.push(t.keyField)})),s.filter((t=>!(T(t)||x(t)))).forEach((t=>n.add(t))),Array.from(n.values())}return["*"]}_setFeatureSource(t){this._featureSource=t,d(this,"featureSource")}_setFeature(t){this._feature=t,d(this,"feature")}toJSON(t="all"){const e=p(this._getSerializableProperties(),this,t)||{},n=e.popupContentExtensions?.filter((t=>{const e=this.parent;return!e?.popupContentExtensions?.some((e=>e.id===t.id))}));if(e)for(const t of A(e))this.isModified(t)||delete e[t];if(n?.length&&(e.popupContentExtensions=n),!h(t)||!a(e))return e}_createPopupContentCollection(){return new o({parent:this,targetProperty:"popupTemplate",arrayProperty:"content"})}_getSerializableProperties(){return{hyperlinkTemplates:{serializeModes:["initial"],deserialize:t=>{t.forEach((t=>{this.hyperlinkTemplates.find((e=>this._hyperlinksAreEquivalent(e,t)))||this.hyperlinkTemplates.add(t instanceof n?t:new n(t))})),this.hyperlinkTemplates.toArray().forEach((e=>{const n=this.hyperlinkTemplates.indexOf(e),i=t.findIndex((t=>this._hyperlinksAreEquivalent(t,e)));i<0?this.hyperlinkTemplates.removeAt(n):i!==n&&this.hyperlinkTemplates.reorder(e,i)}))}},popupTemplate:{serializeModes:["project"],isDefault:()=>!this._isDefaultPopupTemplate},showRelatedRecordsWhenUnconfigured:{serializeModes:["initial"],default:!0},formatSettings:"initial",outFields:{serializeModes:["initial"],serialize:()=>this.isModified("outFields")?this.outFields:void 0},returnGeometry:{serializeModes:["initial"],default:!0},outSpatialReference:"initial",maxAllowableOffset:"initial",zoomScale:"initial",zoomFactor:{serializeModes:["initial"],isDefault:t=>{const e=this._feature?this._feature.schema:this._featureSource?.schema;return t===(e&&"point"===e.geometryType?void 0:1.5)}},popupContentExtensions:{serializeModes:["initial"],serialize:t=>this.popupContentExtensions.map((e=>e.toJSON(t))).filter((t=>!(t&&2===Object.keys(t).length&&t.id&&t.content))).toArray(),deserialize:t=>{t&&g(this.popupContentExtensions,t,{onNew:(t,e)=>{this.popupContentExtensions.add(i(t)?t:new E(t),e)},onMatch:(t,e,n,o)=>{i(e)||t.assignProperties(e),n!==o&&this.popupContentExtensions.reorder(t,o)},onMissing:t=>{this.popupContentExtensions.remove(t)},equals:(t,e)=>{if(!e)return!1;if(i(e))return e===t||e.id===t.id;const n=this.popupContentExtensions.indexOf(t);if(e.content&&n>-1){const t=this.popupContentExtensions.toArray();return E.matchesRef(t,n,e.content)}return t.id===e.id}})}}}}_hyperlinksAreEquivalent(t,e){if(t===e)return!0;const n=t=>t||"";return n(t.text)===n(e.text)&&n(t.url)===n(e.url)&&n(t.iconUrl)===n(e.iconUrl)&&n(t.target)===n(e.target)&&n(t.tooltip)===n(e.tooltip)}};b=t([u],b);export{b as FeatureSettings};class R extends r{get _collection(){return this._featureSettings._popupContent.map((t=>this._forContent(t))).concat(Array.from(this._uninitializedPopupContentExtensions))}get _popupTemplateIsInherited(){return this._featureSettings.parent&&this._featureSettings.popupTemplate===this._featureSettings.parent.popupTemplate}_featureSettings;_uninitializedPopupContentExtensions=new Set;_onChangePopupContentHandle=new _((()=>this._featureSettings._popupContent.on("change",(t=>{const e={added:(t.added||[]).map((t=>this._forContent(t))),moved:(t.moved||[]).map((t=>this._forContent(t))),removed:(t.removed||[]).map((t=>this._forContent(t))),target:this};this.emit("change",e)}))));_onBeforeAddPopupContentHandle=new _((()=>this._featureSettings._popupContent.on("before-add",(t=>{this.emit("before-add",{...t,item:this._forContent(t.item),target:this})}))));_onBeforeRemovePopupContentHandle=new _((()=>this._featureSettings._popupContent.on("before-remove",(t=>{this.emit("before-remove",{...t,item:this._forContent(t.item),target:this})}))));_onBeforeChangesPopupContentHandle=new _((()=>this._featureSettings._popupContent.on("before-changes",(t=>{this.emit("before-changes",{...t,target:this})}))));_onAfterAddPopupContentHandle=new _((()=>this._featureSettings._popupContent.on("after-add",(t=>{this.emit("after-add",{...t,item:this._forContent(t.item),target:this})}))));_onAfterRemovePopupContentHandle=new _((()=>this._featureSettings._popupContent.on("after-remove",(t=>{this.emit("after-remove",{...t,item:this._forContent(t.item),target:this})}))));_onAfterChangesPopupContentHandle=new _((()=>this._featureSettings._popupContent.on("after-changes",(t=>{this.emit("after-changes",{...t,target:this})}))));constructor(t){super(),this._featureSettings=t,m(this,"length",(()=>c(this._featureSettings,"_popupContent.length",(()=>d(this,"length")),{sync:!0})))}forContent(t){if(C("content",t).isNotMissing(),this._featureSettings._popupContent.includes(t))return this._forContent(t)}add(t,n){if(C("contentX",t).isNotMissing(),this._popupTemplateIsInherited&&(this._featureSettings.popupTemplate=new e({content:this._featureSettings._popupContent.toArray()})),t.featureSettings&&t.featureSettings.popupContentExtensions.remove(t),t._setFeatureSettings(this._featureSettings),t.content){const e=w.get(t.content);if(w.set(t.content,t),e&&e!==t&&this._onRemoved(e),this._featureSettings._popupContent.includes(t.content))if(void 0===n){const n={added:[t],moved:[],removed:e?[e]:[],target:this};this.emit("change",n),this.emit("after-add",{item:t,target:this}),this.emit("after-changes",{target:this}),d(this,"length")}else this._featureSettings._popupContent.reorder(t.content,n);else this._featureSettings._popupContent.add(t.content,n)}else{this._uninitializedPopupContentExtensions.add(t);const e={added:[t],moved:[],removed:[],target:this};this.emit("change",e),this.emit("after-add",{item:t,target:this}),this.emit("after-changes",{target:this}),d(this,"length")}return this._onAdded(t),this}removeAt(t){const n=this.getItemAt(t);if(void 0!==n){if(this._popupTemplateIsInherited&&(this._featureSettings.popupTemplate=new e({content:this._featureSettings._popupContent.toArray()})),this._uninitializedPopupContentExtensions.has(n)){this._uninitializedPopupContentExtensions.delete(n);const t={added:[],moved:[],removed:[n],target:this};this.emit("change",t),this.emit("after-remove",{item:n,target:this}),this.emit("after-changes",{target:this}),d(this,"length")}else this._featureSettings._popupContent.remove(n.content);return this._onRemoved(n),n}}reorder(t,n){if(t&&this._featureSettings._popupContent.includes(t.content))return this._popupTemplateIsInherited&&(this._featureSettings.popupTemplate=new e({content:this._featureSettings._popupContent.toArray()})),this._featureSettings._popupContent.reorder(t.content,n),t}sort(t){return this._popupTemplateIsInherited&&(this._featureSettings.popupTemplate=new e({content:this._featureSettings._popupContent.toArray()})),this._featureSettings._popupContent.sort(((e,n)=>t(this._forContent(e),this._forContent(n)))),this}on(t,e){const n=[];return"change"===t?n.push(this._onChangePopupContentHandle.add()):"before-add"===t?n.push(this._onBeforeAddPopupContentHandle.add()):"before-remove"===t?n.push(this._onBeforeRemovePopupContentHandle.add()):"before-changes"===t?n.push(this._onBeforeChangesPopupContentHandle.add()):"after-add"===t?n.push(this._onAfterAddPopupContentHandle.add()):"after-remove"===t?n.push(this._onAfterRemovePopupContentHandle.add()):"after-changes"===t&&n.push(this._onAfterChangesPopupContentHandle.add()),n.push(super.on(t,e)),f(n)}_itemIsInitialized(t){return super._itemIsInitialized(t)&&!!t.content}_onAdded(t){}_onRemoved(t){t.featureSettings===this._featureSettings&&t._setFeatureSettings(void 0)}_forContent(t){if(this._uninitializedPopupContentExtensions.size)for(const t of this._uninitializedPopupContentExtensions)t._resolveContent(),t.content&&(w.set(t.content,t),this._uninitializedPopupContentExtensions.delete(t));if(!w.has(t)){const e=new E({content:t});w.set(t,e),e._setFeatureSettings(this._featureSettings),this._onAdded(e)}return w.get(t)}}
|
|
@@ -38,26 +38,6 @@ export interface FeatureSourceBaseProperties extends FeatureSourceProperties, En
|
|
|
38
38
|
* A base implementation for {@link data/FeatureSource!FeatureSource}.
|
|
39
39
|
*/
|
|
40
40
|
export declare abstract class FeatureSourceBase<TProperties extends FeatureSourceBaseProperties = FeatureSourceBaseProperties> extends EntityBase<TProperties> implements FeatureSource {
|
|
41
|
-
/**
|
|
42
|
-
* @inheritDoc
|
|
43
|
-
*/
|
|
44
|
-
readonly featureSettings: FeatureSettings;
|
|
45
|
-
/**
|
|
46
|
-
* @inheritDoc
|
|
47
|
-
*/
|
|
48
|
-
readonly taskSettings: TaskSettings;
|
|
49
|
-
/**
|
|
50
|
-
* @inheritDoc
|
|
51
|
-
*/
|
|
52
|
-
readonly schema: Schema;
|
|
53
|
-
/**
|
|
54
|
-
* @inheritDoc
|
|
55
|
-
*/
|
|
56
|
-
readonly relationships: Collection<Relationship>;
|
|
57
|
-
/**
|
|
58
|
-
* @inheritDoc
|
|
59
|
-
*/
|
|
60
|
-
readonly hyperlinks: Collection<Hyperlink>;
|
|
61
41
|
/**
|
|
62
42
|
* @inheritDoc
|
|
63
43
|
*/
|
|
@@ -89,19 +69,34 @@ export declare abstract class FeatureSourceBase<TProperties extends FeatureSourc
|
|
|
89
69
|
* @inheritDoc
|
|
90
70
|
*/
|
|
91
71
|
get capabilities(): Capabilities;
|
|
72
|
+
get featureSettings(): FeatureSettings;
|
|
73
|
+
/**
|
|
74
|
+
* @inheritDoc
|
|
75
|
+
*/
|
|
76
|
+
get taskSettings(): TaskSettings;
|
|
77
|
+
/**
|
|
78
|
+
* @inheritDoc
|
|
79
|
+
*/
|
|
80
|
+
get schema(): Schema;
|
|
81
|
+
/**
|
|
82
|
+
* @inheritDoc
|
|
83
|
+
*/
|
|
84
|
+
get hyperlinks(): Collection<Hyperlink>;
|
|
85
|
+
/**
|
|
86
|
+
* @inheritDoc
|
|
87
|
+
*/
|
|
88
|
+
get relationships(): Collection<Relationship>;
|
|
92
89
|
/**
|
|
93
90
|
* @inheritDoc
|
|
94
91
|
*/
|
|
95
92
|
abstract get title(): string;
|
|
96
93
|
private _featureActions;
|
|
97
94
|
private _featureSourceActions;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
*/
|
|
104
|
-
constructor(properties?: TProperties);
|
|
95
|
+
private _featureSettings;
|
|
96
|
+
private _taskSettings;
|
|
97
|
+
private _schema;
|
|
98
|
+
private _hyperlinks;
|
|
99
|
+
private _relationships;
|
|
105
100
|
/**
|
|
106
101
|
* @inheritDoc
|
|
107
102
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"@arcgis/core/core/Collection";import e from"@arcgis/core/popup/content/TextContent.js";import{ArgumentError as i}from"../ArgumentError.js";import{EntityBase as s}from"../Entity.js";import{Hyperlink as r}from"../Hyperlink.js";import{InvalidOperationError as a}from"../InvalidOperationError.js";import{isMenu as n,isRelationship as o}from"../ItemType.js";import{NotFoundError as u}from"../NotFoundError.js";import{FeatureReadOptions as c}from"../data/FeatureSource.js";import{Menu as
|
|
1
|
+
import t from"@arcgis/core/core/Collection";import e from"@arcgis/core/popup/content/TextContent.js";import{ArgumentError as i}from"../ArgumentError.js";import{EntityBase as s}from"../Entity.js";import{Hyperlink as r}from"../Hyperlink.js";import{InvalidOperationError as a}from"../InvalidOperationError.js";import{isMenu as n,isRelationship as o}from"../ItemType.js";import{NotFoundError as u}from"../NotFoundError.js";import{FeatureReadOptions as c}from"../data/FeatureSource.js";import{Menu as h}from"../menus/Menu.js";import{initializeCollection as l}from"../support/InitializableBase.js";import{CollectionProxy as p}from"../utilities/CollectionProxy.js";import{first as d}from"../utilities/asyncIterable.js";import{checkArg as f}from"../utilities/checkArg.js";import{compare as m}from"../utilities/collection.js";import{every as g}from"../utilities/iterable.js";import{getLogger as _}from"../utilities/log.js";import{FeatureSettings as S}from"./FeatureSettings.js";import{Schema as y}from"./Schema.js";import{TaskSettings as w}from"./TaskSettings.js";import{Relationship as A}from"./_Relationship.js";const F="Adding features is not supported.",z="Updating features is not supported.",j="Deleting features is not supported.",k=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsAttachmentEditing:!1}),M=_("FeatureSourceBase");export class FeatureSourceBase extends s{iconUrl;onAddFeature;onEditFeature;get featureActions(){return this._featureActions}set featureActions(t){this._featureActions=t,t&&this.isInitialized&&!t.isInitialized&&(async()=>{try{await t.initialize()}catch(t){t instanceof Error&&M.error({message:"An error occurred while initializing feature action menu.",error:t})}})()}get featureSourceActions(){return this._featureSourceActions}set featureSourceActions(t){this._featureSourceActions=t,t&&this.isInitialized&&!t.isInitialized&&(async()=>{try{await t.initialize()}catch(t){t instanceof Error&&M.error({message:"An error occurred while initializing feature source action menu.",error:t})}})()}queryService;get capabilities(){return this._capabilities()}get featureSettings(){return null==this._featureSettings&&(this._featureSettings=this._createAndSetupFeatureSettings()),this._featureSettings}get taskSettings(){return null==this._taskSettings&&(this._taskSettings=this._createTaskSettings()),this._taskSettings}get schema(){return null==this._schema&&(this._schema=this._createAndSetupSchema()),this._schema}get hyperlinks(){return null==this._hyperlinks&&(this._hyperlinks=this._createHyperlinks()),this._hyperlinks}get relationships(){return null==this._relationships&&(this._relationships=this._createRelationships()),this._relationships}_featureActions;_featureSourceActions;_featureSettings;_taskSettings;_schema;_hyperlinks;_relationships;getFullExtent(){}async getAttachments(t){return f("feature",t).isNotMissing(),await this.initialize(),this._getAttachments(t)}async addAttachment(t,e){if(f("feature",t).isNotMissing(),f("attachment",e).isNotMissing(),t.source&&t.source!==this)throw new i("feature",`Cannot add an attachment to a feature not of this source (${this.title??this.id})`);return await this.initialize(),this._addAttachment(t,e)}async deleteAttachments(t,e){if(f("feature",t).isNotMissing(),f("attachmentIds",e).isNotMissing(),t.source&&t.source!==this)throw new i("feature",`Cannot delete attachments from a feature not of this source (${this.title??this.id})`);await this.initialize(),await this._deleteAttachments(t,e)}async getFeature(t,e){f("id",t).isNotMissing();const i=this.getFeatures([t],e),s=await d(i);if(!s)throw new u("No feature exists with ID '{0}'.",t);return s}getFeatures(t,e){f("ids",t).isNotMissing();const i=this;return async function*(){await i.initialize(),yield*i._getFeatures(t,{...c.DEFAULTS,...c.fromFeatureSource(i),...e})}()}async addFeature(t,e){f("feature",t).isNotMissing(),await this.addFeatures([t])}async addFeatures(t,e){if(f("features",t).isNotMissing(),await this.initialize(),!this.capabilities.supportsAdd)throw new a(F);await this._addFeatures(t,e)}async updateFeature(t,e){f("feature",t).isNotMissing(),await this.updateFeatures([t])}async updateFeatures(t,e){if(f("features",t).isNotMissing(),await this.initialize(),!this.capabilities.supportsUpdate)throw new a(z);await this._updateFeatures(t,e)}async deleteFeature(t,e){f("feature",t).isNotMissing(),await this.deleteFeatures([t])}async deleteFeatures(t,e){if(f("features",t).isNotMissing(),f("features",t).satisfies((t=>g(t,(t=>"string"==typeof t?null!=t:null!=t.primaryKey))),"Features must have an object id to be deleted."),await this.initialize(),!this.capabilities.supportsDelete)throw new a(j);const i=[];for(const e of t)i.push("string"==typeof e?e:e.primaryKey);await this._deleteFeatures(i,e)}_getSerializableProperties(){return{...super._getSerializableProperties(),featureSettings:{serializeModes:["initial","project"],isDefault:t=>{if(!t)return!0;if(t.constructor===Object){if(!Object.keys(t).length)return!0}return!1}},taskSettings:"initial",onAddFeature:"initial",onEditFeature:"initial",schema:["initial","project"],relationships:{serializeModes:["initial"],serialize:t=>this.relationships?this.relationships.filter((t=>"ArcGISRelationship"!==t.relationshipType)).toArray():[],deserialize:t=>{m(this.relationships,t,{onNew:t=>{o(t)?this.relationships.add(t):this.relationships.add(A.create(t))},onMatch:(t,e)=>{o(t)&&t.assignProperties({title:e.title})},onMissing:t=>{"ArcGISRelationship"!==t.relationshipType&&this.relationships.remove(t)},equals:(t,e)=>t.id===e.id})},default:[]},hyperlinks:{serialize:!1,deserialize:t=>{this.hyperlinks.removeAll(),this.hyperlinks.addMany(t.map((t=>t instanceof r?t:new r(t))))}},iconUrl:"initial",featureActions:{serializeModes:["initial"],deserialize:t=>{t?n(t)?this.featureActions=t:this.featureActions?this.featureActions.assignProperties(t):this.featureActions=h.create(t):this.featureActions=void 0}},featureSourceActions:{serializeModes:["initial"],deserialize:t=>{t?n(t)?this.featureSourceActions=t:this.featureSourceActions?this.featureSourceActions.assignProperties(t):this.featureSourceActions=h.create(t):this.featureSourceActions=void 0}}}}*_initializableChildCollections(){yield*super._initializableChildCollections(),yield this.schema.fieldExtensions}async _onInitialize(){await super._onInitialize(),this.featureActions&&await this.featureActions.initialize(),this.featureSourceActions&&await this.featureSourceActions.initialize()}async _postInitialize(){await super._postInitialize(),this.featureSettings.popupTemplate||(this.featureSettings.popupTemplate=this.schema.createPopupTemplate(),this.featureSettings._isDefaultPopupTemplate=!0);const{popupTemplate:t}=this.featureSettings;"function"==typeof t.content&&(t.content=t.content()),t.content=await t.content,"string"==typeof t.content&&(t.content=[new e({text:t.content})]),!t.title&&this.schema.displayField&&(t.title=`{${this.schema.displayField}}`),await l(this.featureSettings.popupContentExtensions,{target:this,onInitializeWarning:t=>this.emit("initializeWarning",t)}),await Promise.all(this.relationships.toArray().map((t=>t.relatedSource?.initialize())))}_createSchema(t){return new y(t)}_createFeatureSettings(){return new S}_createTaskSettings(){return new w}_createRelationships(){return new RelationshipCollection(this)}_createHyperlinks(){return new t}async _getAttachments(t){return[]}async _addAttachment(t,e){throw new a("Adding attachments is not supported.")}async _deleteAttachments(t,e){throw new a("Deleting attachments is not supported.")}_getFeatures(t,e){const{primaryKeyField:i}=this.schema;if(this.queryService&&i){const s=t.map((t=>`${i} = ${t}`)).join(" OR ");return this.queryService.query(this,s,e)}throw new a("Querying features is not supported.")}_addFeatures(t,e){throw new a(F)}_updateFeatures(t,e){throw new a(z)}_deleteFeatures(t,e){throw new a(j)}_capabilities(){return k}_isRelationship(t){return"function"==typeof t.getRelatedFeatures}_createAndSetupSchema(){const t=this._createSchema();return t._featureSettings=this.featureSettings,t}_createAndSetupFeatureSettings(){const t=this._createFeatureSettings();return t._setFeatureSource(this),t}}export class RelationshipCollection extends p{_source;constructor(e){super(new t),this._source=e}add(t,e){return f("relationship",t).isNotMissing(),t.source&&t.source.relationships.remove(t),o(t)&&t._setSource(this._source),super.add(t,e)}removeAt(t){const e=super.removeAt(t);return o(e)&&e._setSource(void 0),e}}
|
package/data/FieldExtension.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import type { FieldJson } from "../json/FieldJson.js";
|
|
|
6
6
|
import type { FormatSettingsProperties } from "../support/FormatSettings.js";
|
|
7
7
|
import { FormatSettings } from "../support/FormatSettings.js";
|
|
8
8
|
import type { PropertyDefs } from "../support/Serializable.js";
|
|
9
|
-
import type { WatchCallback } from "../support/esri.js";
|
|
10
9
|
import type { Schema } from "./Schema.js";
|
|
11
10
|
/**
|
|
12
11
|
* Properties that extend the ArcGis portal representation of a Field.
|
|
@@ -86,7 +85,6 @@ export declare class FieldExtension extends EntityBase<FieldExtensionProperties>
|
|
|
86
85
|
private _schema;
|
|
87
86
|
private _deferredFieldProperties;
|
|
88
87
|
private _originalRef;
|
|
89
|
-
private readonly _schemaFeatureSourceHandle;
|
|
90
88
|
/**
|
|
91
89
|
* Creates a new instance of {@link data/FieldExtension!FieldExtension}.
|
|
92
90
|
*
|
|
@@ -100,7 +98,6 @@ export declare class FieldExtension extends EntityBase<FieldExtensionProperties>
|
|
|
100
98
|
* @param fieldRef The field reference to match with a field.
|
|
101
99
|
*/
|
|
102
100
|
static matchesRef(fieldX: FieldExtension | Field, fieldRef: FieldProperties): boolean;
|
|
103
|
-
protected _watchProperty(propertyKey: keyof this, subpath: string, callback: WatchCallback, sync: boolean): IHandle;
|
|
104
101
|
protected _getSerializableProperties(): PropertyDefs<FieldExtensionProperties>;
|
|
105
102
|
protected _onInitialize(): Promise<void>;
|
|
106
103
|
private _setField;
|