@vertigis/arcgis-extensions 42.1.2 → 42.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 +4 -0
- package/data/FeatureSettings.d.ts +11 -0
- package/data/FeatureSettings.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/data_FeatureSettings.FeatureSettings.html +31 -2
- package/docs/html/classes/data__TableExtension.TableFeatureSettings.html +33 -2
- package/docs/html/classes/mapping_BuildingSublayerExtension.BuildingSublayerFeatureSettings.html +33 -2
- package/docs/html/interfaces/data_FeatureSettings.FeatureSettingsProperties.html +8 -0
- package/docs/html/variables/version.version.html +1 -1
- package/package.json +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/AppConfig.schema.json
CHANGED
|
@@ -794,6 +794,10 @@
|
|
|
794
794
|
"description": "See{@linkdata /FeatureSettings!FeatureSettings.returnGeometry}.",
|
|
795
795
|
"type": "boolean"
|
|
796
796
|
},
|
|
797
|
+
"showRelatedRecordsWhenUnconfigured": {
|
|
798
|
+
"description": "See{@linkdata /FeatureSettings!FeatureSettings.showRelatedRecordsWhenUnconfigured}.",
|
|
799
|
+
"type": "boolean"
|
|
800
|
+
},
|
|
797
801
|
"zoomFactor": {
|
|
798
802
|
"description": "See{@linkdata /FeatureSettings!FeatureSettings.zoomFactor}.",
|
|
799
803
|
"type": "number"
|
|
@@ -64,6 +64,11 @@ export interface FeatureSettingsProperties {
|
|
|
64
64
|
* See {@link data/FeatureSettings!FeatureSettings.popupContentExtensions}.
|
|
65
65
|
*/
|
|
66
66
|
popupContentExtensions?: (PopupContentExtension | PopupContentExtensionProperties)[];
|
|
67
|
+
/**
|
|
68
|
+
* See
|
|
69
|
+
* {@link data/FeatureSettings!FeatureSettings.showRelatedRecordsWhenUnconfigured}.
|
|
70
|
+
*/
|
|
71
|
+
showRelatedRecordsWhenUnconfigured?: boolean;
|
|
67
72
|
}
|
|
68
73
|
/**
|
|
69
74
|
* Settings that pertain to features.
|
|
@@ -87,6 +92,12 @@ export declare class FeatureSettings extends Settings<FeatureSettingsProperties>
|
|
|
87
92
|
*/
|
|
88
93
|
get popupTemplate(): PopupTemplate;
|
|
89
94
|
set popupTemplate(value: PopupTemplate);
|
|
95
|
+
/**
|
|
96
|
+
* Whether all related records should be shown, even if not found configured
|
|
97
|
+
* in the web map popup.
|
|
98
|
+
*/
|
|
99
|
+
get showRelatedRecordsWhenUnconfigured(): boolean;
|
|
100
|
+
set showRelatedRecordsWhenUnconfigured(value: boolean);
|
|
90
101
|
/**
|
|
91
102
|
* Settings affecting how feature attributes are formatted.
|
|
92
103
|
*/
|
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{compare as f}from"../utilities/array.js";import{checkArg as
|
|
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{compare as f}from"../utilities/array.js";import{checkArg as d}from"../utilities/checkArg.js";import{getAllFieldInfos as m,getAllReferencedFieldNames as c,isPopupTemplate as _}from"../utilities/esri.js";import{fieldWithArcadeXRegex as g,fieldWithRelationshipRegex as S}from"../utilities/field.js";import{isQueryBasedRelationship as C}from"../utilities/relationships.js";import{caseInsensitiveEquals as y}from"../utilities/string.js";import{onCollectionPropertyChange as T}from"../utilities/watch.js";import{PopupContentExtension as x,_popupContentExtensionMap as z}from"./PopupContentExtension.js";let E=class extends h{get _popupContent(){return this._popupContentCollection}get hyperlinkTemplates(){return this._getCollectionSetting("hyperlinkTemplates")}get popupTemplate(){return this._getSetting("popupTemplate")}set popupTemplate(t){let i;i=t instanceof Object&&!_(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}constructor(t){super(t),this._isDefaultPopupTemplate=!1,this._popupContentCollection=this._createPopupContentCollection(),this.popupContentExtensions=new v(this)}get _defaultOutFields(){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([...c(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=>y(e,t)))));return this._featureSource.relationships.forEach((t=>{C(t)&&s.push(t.keyField)})),s.filter((t=>!(t.match(g)||t.match(S)))).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 Object.keys(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:{serialize:!1},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&&f(this.popupContentExtensions,t,{onNew:(t,e)=>{this.popupContentExtensions.add(n(t)?t:new x(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)=>n(e)?e===t||e.id===t.id:!(!e?.content||!x.matchesRef(this.popupContentExtensions.toArray(),this.popupContentExtensions.indexOf(t),e.content))||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)}};E=t([u],E);export{E as FeatureSettings};class v 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}constructor(t){super(),this._uninitializedPopupContentExtensions=new Set,this._featureSettings=t,T(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)})),t.watch("_popupContent.length",(()=>this.notifyChange("length")))}forContent(t){if(d("content",t).isNotMissing(),this._featureSettings._popupContent.includes(t))return this._forContent(t)}add(t,i){if(d("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=z.get(t.content);if(z.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}_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&&(z.set(t.content,t),this._uninitializedPopupContentExtensions.delete(t));if(!z.has(t)){const e=new x({content:t});z.set(t,e),e._setFeatureSettings(this._featureSettings),this._onAdded(e)}return z.get(t)}}
|