@vertigis/arcgis-extensions 48.0.2 → 48.2.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 +55 -0
- package/data/FeatureSource.d.ts +4 -0
- package/data/FeatureSourceBase.d.ts +10 -0
- package/data/FeatureSourceBase.js +1 -1
- package/data/PopupContentExtension.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/data_ArcGISServiceTableExtension.ArcGISServiceTableExtension.html +5 -2
- package/docs/html/classes/data_FeatureSourceBase.FeatureSourceBase.html +5 -2
- package/docs/html/classes/data__TableExtension.TableExtension.html +5 -2
- package/docs/html/classes/mapping_ArcGISSublayerExtension.ArcGISSublayerExtension.html +5 -2
- package/docs/html/classes/mapping_BuildingComponentSublayerExtension.BuildingComponentSublayerExtension.html +5 -2
- package/docs/html/classes/mapping_BuildingGroupSublayerExtension.BuildingGroupSublayerExtension.html +5 -2
- package/docs/html/classes/mapping_BuildingSceneLayerExtension.BuildingSceneLayerExtension.html +5 -2
- package/docs/html/classes/mapping_BuildingSublayerExtension.BuildingSublayerExtension.html +5 -2
- package/docs/html/classes/mapping_CSVLayerExtension.CSVLayerExtension.html +5 -2
- package/docs/html/classes/mapping_ElevationLayerExtension.ElevationLayerExtension.html +5 -2
- package/docs/html/classes/mapping_FeatureCollectionLayerExtension.FeatureCollectionLayerExtension.html +5 -2
- package/docs/html/classes/mapping_FeatureLayerExtension.FeatureLayerExtension.html +5 -2
- package/docs/html/classes/mapping_FeatureLayerExtensionBase.FeatureLayerExtensionBase.html +5 -2
- package/docs/html/classes/mapping_GeoJSONLayerExtension.GeoJSONLayerExtension.html +5 -2
- package/docs/html/classes/mapping_GeoRSSLayerExtension.GeoRSSLayerExtension.html +5 -2
- package/docs/html/classes/mapping_GraphicsLayerExtension.GraphicsLayerExtension.html +5 -2
- package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtension.html +5 -2
- package/docs/html/classes/mapping_ImageryLayerExtension.ImageryLayerExtension.html +5 -2
- package/docs/html/classes/mapping_ImageryTileLayerExtension.ImageryTileLayerExtension.html +5 -2
- package/docs/html/classes/mapping_IntegratedMeshLayerExtension.IntegratedMeshLayerExtension.html +5 -2
- package/docs/html/classes/mapping_KMLLayerExtension.KMLLayerExtension.html +5 -2
- package/docs/html/classes/mapping_KMLSublayerExtension.KMLSublayerExtension.html +5 -2
- package/docs/html/classes/mapping_MapImageLayerExtension.MapImageLayerExtension.html +5 -2
- package/docs/html/classes/mapping_MapImageSublayerExtension.MapImageSublayerExtension.html +5 -2
- package/docs/html/classes/mapping_MapNotesLayerExtension.MapNotesLayerExtension.html +5 -2
- package/docs/html/classes/mapping_MapNotesSublayerExtension.MapNotesSublayerExtension.html +5 -2
- package/docs/html/classes/mapping_OpenStreetMapLayerExtension.OpenStreetMapLayerExtension.html +5 -2
- package/docs/html/classes/mapping_PointCloudLayerExtension.PointCloudLayerExtension.html +5 -2
- package/docs/html/classes/mapping_RouteLayerExtension.RouteLayerExtension.html +5 -2
- package/docs/html/classes/mapping_SceneLayerExtension.SceneLayerExtension.html +5 -2
- package/docs/html/classes/mapping_StreamLayerExtension.StreamLayerExtension.html +5 -2
- package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerExtension.html +5 -2
- package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerExtension.html +5 -2
- package/docs/html/classes/mapping_TileLayerExtension.TileLayerExtension.html +5 -2
- package/docs/html/classes/mapping_TileSublayerExtension.TileSublayerExtension.html +5 -2
- package/docs/html/classes/mapping_UnsupportedLayerExtension.UnsupportedLayerExtension.html +5 -2
- package/docs/html/classes/mapping_VectorTileLayerExtension.VectorTileLayerExtension.html +5 -2
- package/docs/html/classes/mapping_WFSLayerExtension.WFSLayerExtension.html +5 -2
- package/docs/html/classes/mapping_WMSLayerExtension.WMSLayerExtension.html +5 -2
- package/docs/html/classes/mapping_WMSSublayerExtension.WMSSublayerExtension.html +5 -2
- package/docs/html/classes/mapping_WMTSLayerExtension.WMTSLayerExtension.html +5 -2
- package/docs/html/classes/mapping_WebTileLayerExtension.WebTileLayerExtension.html +5 -2
- package/docs/html/classes/mapping__LayerExtension.LayerExtension.html +5 -2
- package/docs/html/classes/mapping__SublayerExtension.SublayerExtension.html +5 -2
- package/docs/html/classes/tasks_geocoding_ArcGISGeocoder.ArcGISGeocoder.html +5 -2
- package/docs/html/classes/tasks_geocoding_Geocoder.Geocoder.html +5 -2
- package/docs/html/interfaces/data_ArcGISServiceTableExtension.ArcGISServiceTableExtensionProperties.html +5 -3
- package/docs/html/interfaces/data_FeatureSource.FeatureSource.html +4 -2
- package/docs/html/interfaces/data_FeatureSourceBase.FeatureSourceBaseProperties.html +5 -3
- package/docs/html/interfaces/data__TableExtension.TableExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_ArcGISSublayerExtension.ArcGISSublayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_BuildingComponentSublayerExtension.BuildingComponentSublayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_BuildingGroupSublayerExtension.BuildingGroupSublayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_BuildingSceneLayerExtension.BuildingSceneLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_BuildingSublayerExtension.BuildingSublayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_CSVLayerExtension.CSVLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_ElevationLayerExtension.ElevationLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_FeatureLayerExtension.FeatureLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_FeatureLayerExtensionBase.FeatureLayerExtensionBaseProperties.html +5 -3
- package/docs/html/interfaces/mapping_GeoJSONLayerExtension.GeoJSONLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_GeoRSSLayerExtension.GeoRSSLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_GraphicsLayerExtension.GraphicsLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_GroupLayerExtension.GroupLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_ImageryLayerExtension.ImageryLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_ImageryTileLayerExtension.ImageryTileLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_IntegratedMeshLayerExtension.IntegratedMeshLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_KMLLayerExtension.KMLLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_KMLSublayerExtension.KMLSublayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_MapImageLayerExtension.MapImageLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_MapImageSublayerExtension.MapImageSublayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_MapNotesLayerExtension.MapNotesLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_MapNotesSublayerExtension.MapNotesSublayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_OpenStreetMapLayerExtension.OpenStreetMapLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_PointCloudLayerExtension.PointCloudLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_RouteLayerExtension.RouteLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_SceneLayerExtension.SceneLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_StreamLayerExtension.StreamLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_SubtypeSublayerExtension.SubtypeSublayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_TileLayerExtension.TileLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_TileSublayerExtension.TileSublayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_VectorTileLayerExtension.VectorTileLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_WFSLayerExtension.WFSLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_WMSLayerExtension.WMSLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_WMSSublayerExtension.WMSSublayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_WMTSLayerExtension.WMTSLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping_WebTileLayerExtension.WebTileLayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping__LayerExtension.LayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/mapping__SublayerExtension.SublayerExtensionProperties.html +5 -3
- package/docs/html/interfaces/tasks_geocoding_ArcGISGeocoder.ArcGISGeocoderProperties.html +5 -3
- package/docs/html/interfaces/tasks_geocoding_Geocoder.GeocoderProperties.html +5 -3
- package/docs/html/variables/version.version.html +1 -1
- package/mapping/_LayerExtension.js +1 -1
- package/package.json +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/AppConfig.schema.json
CHANGED
|
@@ -40,6 +40,17 @@
|
|
|
40
40
|
"$ref": "#/definitions/FeatureSettingsProperties",
|
|
41
41
|
"description": "See {@link data /FeatureSource!FeatureSource.featureSettings}."
|
|
42
42
|
},
|
|
43
|
+
"featureSourceActions": {
|
|
44
|
+
"anyOf": [
|
|
45
|
+
{
|
|
46
|
+
"$ref": "#/definitions/MenuProperties"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"$ref": "#/definitions/Menu"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"description": "A menu for actions specifically related to this source."
|
|
53
|
+
},
|
|
43
54
|
"hyperlinks": {
|
|
44
55
|
"description": "See {@link data /FeatureSource!FeatureSource.hyperlinks}.",
|
|
45
56
|
"items": {
|
|
@@ -908,6 +919,17 @@
|
|
|
908
919
|
"$ref": "#/definitions/FeatureSettingsProperties",
|
|
909
920
|
"description": "See {@link data /FeatureSource!FeatureSource.featureSettings}."
|
|
910
921
|
},
|
|
922
|
+
"featureSourceActions": {
|
|
923
|
+
"anyOf": [
|
|
924
|
+
{
|
|
925
|
+
"$ref": "#/definitions/MenuProperties"
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
"$ref": "#/definitions/Menu"
|
|
929
|
+
}
|
|
930
|
+
],
|
|
931
|
+
"description": "A menu for actions specifically related to this source."
|
|
932
|
+
},
|
|
911
933
|
"hyperlinks": {
|
|
912
934
|
"description": "See {@link data /FeatureSource!FeatureSource.hyperlinks}.",
|
|
913
935
|
"items": {
|
|
@@ -1408,6 +1430,17 @@
|
|
|
1408
1430
|
"$ref": "#/definitions/FeatureSettingsProperties",
|
|
1409
1431
|
"description": "See {@link data /FeatureSource!FeatureSource.featureSettings}."
|
|
1410
1432
|
},
|
|
1433
|
+
"featureSourceActions": {
|
|
1434
|
+
"anyOf": [
|
|
1435
|
+
{
|
|
1436
|
+
"$ref": "#/definitions/MenuProperties"
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
"$ref": "#/definitions/Menu"
|
|
1440
|
+
}
|
|
1441
|
+
],
|
|
1442
|
+
"description": "A menu for actions specifically related to this source."
|
|
1443
|
+
},
|
|
1411
1444
|
"hyperlinks": {
|
|
1412
1445
|
"description": "See {@link data /FeatureSource!FeatureSource.hyperlinks}.",
|
|
1413
1446
|
"items": {
|
|
@@ -2644,6 +2677,17 @@
|
|
|
2644
2677
|
"$ref": "#/definitions/FeatureSettingsProperties",
|
|
2645
2678
|
"description": "See {@link data /FeatureSource!FeatureSource.featureSettings}."
|
|
2646
2679
|
},
|
|
2680
|
+
"featureSourceActions": {
|
|
2681
|
+
"anyOf": [
|
|
2682
|
+
{
|
|
2683
|
+
"$ref": "#/definitions/MenuProperties"
|
|
2684
|
+
},
|
|
2685
|
+
{
|
|
2686
|
+
"$ref": "#/definitions/Menu"
|
|
2687
|
+
}
|
|
2688
|
+
],
|
|
2689
|
+
"description": "A menu for actions specifically related to this source."
|
|
2690
|
+
},
|
|
2647
2691
|
"hyperlinks": {
|
|
2648
2692
|
"description": "See {@link data /FeatureSource!FeatureSource.hyperlinks}.",
|
|
2649
2693
|
"items": {
|
|
@@ -2895,6 +2939,17 @@
|
|
|
2895
2939
|
"$ref": "#/definitions/FeatureSettingsProperties",
|
|
2896
2940
|
"description": "See {@link data /FeatureSource!FeatureSource.featureSettings}."
|
|
2897
2941
|
},
|
|
2942
|
+
"featureSourceActions": {
|
|
2943
|
+
"anyOf": [
|
|
2944
|
+
{
|
|
2945
|
+
"$ref": "#/definitions/MenuProperties"
|
|
2946
|
+
},
|
|
2947
|
+
{
|
|
2948
|
+
"$ref": "#/definitions/Menu"
|
|
2949
|
+
}
|
|
2950
|
+
],
|
|
2951
|
+
"description": "A menu for actions specifically related to this source."
|
|
2952
|
+
},
|
|
2898
2953
|
"hyperlinks": {
|
|
2899
2954
|
"description": "See {@link data /FeatureSource!FeatureSource.hyperlinks}.",
|
|
2900
2955
|
"items": {
|
package/data/FeatureSource.d.ts
CHANGED
|
@@ -106,6 +106,10 @@ export interface FeatureSource extends Entity, Initializable {
|
|
|
106
106
|
* A menu for actions specifically related to features from this source.
|
|
107
107
|
*/
|
|
108
108
|
featureActions?: Menu;
|
|
109
|
+
/**
|
|
110
|
+
* A menu for actions specifically related to this source.
|
|
111
|
+
*/
|
|
112
|
+
featureSourceActions?: Menu;
|
|
109
113
|
/**
|
|
110
114
|
* URL to an icon that represents this feature source.
|
|
111
115
|
*/
|
|
@@ -29,6 +29,10 @@ export interface FeatureSourceBaseProperties extends FeatureSourceProperties, En
|
|
|
29
29
|
* A menu for actions specifically related to features from this source.
|
|
30
30
|
*/
|
|
31
31
|
featureActions?: Menu | MenuProperties;
|
|
32
|
+
/**
|
|
33
|
+
* A menu for actions specifically related to this source.
|
|
34
|
+
*/
|
|
35
|
+
featureSourceActions?: Menu | MenuProperties;
|
|
32
36
|
}
|
|
33
37
|
/**
|
|
34
38
|
* A base implementation for {@link data/FeatureSource!FeatureSource}.
|
|
@@ -71,6 +75,11 @@ export declare abstract class FeatureSourceBase<TProperties extends FeatureSourc
|
|
|
71
75
|
*/
|
|
72
76
|
get featureActions(): Menu | undefined;
|
|
73
77
|
set featureActions(value: Menu | undefined);
|
|
78
|
+
/**
|
|
79
|
+
* A menu for actions specifically related to this source.
|
|
80
|
+
*/
|
|
81
|
+
get featureSourceActions(): Menu | undefined;
|
|
82
|
+
set featureSourceActions(value: Menu | undefined);
|
|
74
83
|
/**
|
|
75
84
|
* An optional query service that the feature source can use to get
|
|
76
85
|
* features.
|
|
@@ -85,6 +94,7 @@ export declare abstract class FeatureSourceBase<TProperties extends FeatureSourc
|
|
|
85
94
|
*/
|
|
86
95
|
abstract get title(): string;
|
|
87
96
|
private _featureActions;
|
|
97
|
+
private _featureSourceActions;
|
|
88
98
|
/**
|
|
89
99
|
* Creates a new instance of
|
|
90
100
|
* {@link data/FeatureSourceBase!FeatureSourceBase}.
|
|
@@ -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 l}from"../menus/Menu.js";import{initializeCollection as h}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 w}from"../utilities/log.js";import{FeatureSettings as y}from"./FeatureSettings.js";import{Schema 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 l}from"../menus/Menu.js";import{initializeCollection as h}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 w}from"../utilities/log.js";import{FeatureSettings as y}from"./FeatureSettings.js";import{Schema as S}from"./Schema.js";import{TaskSettings as A}from"./TaskSettings.js";import{Relationship as _}from"./_Relationship.js";const F="Adding features is not supported.",z="Updating features is not supported.",j="Deleting features is not supported.",M=Object.freeze({supportsAdd:!1,supportsUpdate:!1,supportsDelete:!1,supportsEditing:!1,supportsAttachmentEditing:!1}),b=w("FeatureSourceBase");export class FeatureSourceBase extends s{featureSettings;taskSettings;schema;relationships;hyperlinks;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&&b.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&&b.error({message:"An error occurred while initializing feature source action menu.",error:t})}})()}queryService;get capabilities(){return this._capabilities()}_featureActions;_featureSourceActions;constructor(t){super(t),this.featureSettings=this._createAndSetupFeatureSettings(),this.taskSettings=this._createTaskSettings(),this.schema=this._createAndSetupSchema(),this.relationships=this._createRelationships(),this.hyperlinks=this._createHyperlinks()}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"],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",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(_.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=l.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=l.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 h(this.featureSettings.popupContentExtensions,{target:this,onInitializeWarning:t=>this.emit("initializeWarning",t)}),await Promise.all(this.relationships.toArray().map((t=>t.relatedSource?.initialize())))}_createSchema(){return new S}_createFeatureSettings(){return new y}_createTaskSettings(){return new A}_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 M}_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}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var t;import{__decorate as e}from"tslib";import i from"@arcgis/core/core/Collection";import n from"@arcgis/core/popup/content/Content.js";import{EntityBase as r}from"../Entity.js";import{InvalidOperationError as s}from"../InvalidOperationError.js";import{ItemType as o}from"../ItemType.js";import{jsonToContent as p}from"../json/PopupInfoJson.js";import{serializable as a}from"../support/Serializable.js";import{compare as f}from"../utilities/array.js";import{isCustomContent as d,isExpressionContent as h,isPopupContent as u,isTextContent as l}from"../utilities/esri.js";import{deepClone as _}from"../utilities/object.js";export const _popupContentExtensionMap=new WeakMap;let m=t=class extends r{get content(){return this._content}get featureSettings(){return this._featureSettings}_deferredContentProperties;visibleInSummary;summaryHiddenFields=new i;_itemType=o.POPUP_CONTENT_EXTENSION;_content;_featureSettings;_originalRef;get _index(){return Array.isArray(this.featureSettings?.popupTemplate?.content)?this.featureSettings.popupTemplate.content.indexOf(this.content):-1}constructor(t){super(t);const{content:e,visibleInSummary:i}=t??{};u(e)?this._setContent(e):"string"==typeof e?this._deferredContentProperties={$ref:e}:e?e.$ref?this._deferredContentProperties=e:this._setContent(p(e)):this._setContent(new n),this.visibleInSummary=i??this._getDefaultSummaryVisibility()}static matchesRef(e,i,n){const r=e.map(((e,i)=>c(e,e instanceof t&&e._index>=0?e._index:i))),s=r[i],{type:o,index:p,title:a,text:f}=n.$ref;if(o!==s.type)return!1;if("text"===o&&f===s.text)return!0;if(a&&a===s.title)return!0;if("number"==typeof p&&p===s.index)return!0;return 1===r.map(((t,e)=>t.type===o?t.index:void 0)).filter((t=>"number"==typeof t)).length}_switchContent(t){t&&this._content!==t&&(this._content=t,this._originalRef=c(t,this._index),_popupContentExtensionMap.set(t,this),this.notifyChange("content"))}_setFeatureSettings(t){this._featureSettings=t,this._resolveContent(),this.notifyChange("featureSettings")}_resolveContent(){if(this._content||!this._deferredContentProperties||!this._featureSettings)return;const e=this._featureSettings._popupContent.find(((e,i)=>t.matchesRef(this.featureSettings._popupContent.toArray(),i,this._deferredContentProperties)));e&&(this._setContent(e),this.assignProperties({content:this._deferredContentProperties}),this._originalRef={...this._deferredContentProperties.$ref},delete this._deferredContentProperties,_popupContentExtensionMap.set(e,this))}_getSerializableProperties(){return{...super._getSerializableProperties(),content:{serializeModes:["initial"],serialize:()=>this.content?this._originalRef?{$ref:this._originalRef}:this._featureSettings?._popupContent.includes(this._content)?{$ref:c(this.content,this._index)}:this.content?.toJSON():this._deferredContentProperties?_(this._deferredContentProperties):void 0,deserialize:t=>{if(u(t)&&t!==this.content)throw new Error("Property 'popupContent' is read-only.")}},visibleInSummary:{serializeModes:["initial"],isDefault:(t,e)=>t===this._getDefaultSummaryVisibility()},summaryHiddenFields:{serializeModes:["initial"],serialize:()=>this.summaryHiddenFields.toArray(),deserialize:t=>{f(this.summaryHiddenFields,t,{onMatch:(t,e,i,n)=>{this.summaryHiddenFields.reorder(t,n)},onMissing:t=>{this.summaryHiddenFields.remove(t)},onNew:t=>{this.summaryHiddenFields.add(t)}})}}}}async _onInitialize(){if(this._resolveContent(),!this._content){const t=this._deferredContentProperties.$ref;throw this._featureSettings?new s(`PopupContent not found with reference: ${JSON.stringify(t)}. PopupContent does not exist.`):new s(`PopupContent not found with reference: ${JSON.stringify(t)}. PopupContent does not have a parent featureSettings.`)}}_setContent(t){this._content=t,this.notifyChange("content")}_getDefaultSummaryVisibility(){return"text"===(this.content?.type??this._deferredContentProperties?.type??this._deferredContentProperties?.$ref?.type)}};m=t=e([a],m);export{m as PopupContentExtension};function c(t,e){const i=t instanceof m?t.content:t;if(!i)return t._deferredContentProperties?.$ref;const n={type:i.type};return e>=0&&(n.index=e),h(i)?n.title=i.expressionInfo.title:l(i)?n.text=i.text:d(i)||(n.title=i.title),n}
|