@vertigis/arcgis-extensions 54.5.0 → 54.7.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/data/FeatureSourceBase.js +1 -1
- package/data/Schema.js +1 -1
- package/data/TaskSettings.js +1 -1
- 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
|
@@ -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 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 y}from"./FeatureSettings.js";import{Schema as S}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())))}async _onDestroy(){this._featureActions&&await this._featureActions.destroy(),this._featureSourceActions&&await this._featureSourceActions.destroy(),this._taskSettings&&(this._taskSettings.parent=void 0),this._featureSettings?.destroy(),this._schema?.destroy(),this._hyperlinks?.destroy(),this._relationships?.removeAll(),this._relationships?.destroy(),await super._onDestroy()}_createSchema(t){return new S(t)}_createFeatureSettings(){return new y}_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}}
|
|
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 y}from"./FeatureSettings.js";import{Schema as S}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","project"],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())))}async _onDestroy(){this._featureActions&&await this._featureActions.destroy(),this._featureSourceActions&&await this._featureSourceActions.destroy(),this._taskSettings&&(this._taskSettings.parent=void 0),this._featureSettings?.destroy(),this._schema?.destroy(),this._hyperlinks?.destroy(),this._relationships?.removeAll(),this._relationships?.destroy(),await super._onDestroy()}_createSchema(t){return new S(t)}_createFeatureSettings(){return new y}_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/Schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e;import{__decorate as i}from"tslib";import t from"@arcgis/core/PopupTemplate";import s from"@arcgis/core/core/Collection";import l from"@arcgis/core/layers/support/FeatureType";import o from"@arcgis/core/layers/support/Field";import n from"@arcgis/core/popup/FieldInfo";import{InvalidOperationError as d}from"../InvalidOperationError.js";import{isFieldExtension as r}from"../ItemType.js";import{jsonToGeometryType as a}from"../json/GeometryJson.js";import{InitializableCollectionProxy as h}from"../support/InitializableCollectionProxy.js";import{filterJSONProperties as m,isDefault as f,serializable as p,shouldExcludeDefaults as c}from"../support/Serializable.js";import{Settings as _}from"../support/Settings.js";import{createIHandle as u,notifyChange as g,onWatch as F,watch as y}from"../support/observableUtils.js";import{CaseInsensitiveObservableMap as x}from"../utilities/CaseInsensitiveObservableMap.js";import{CollectionProxy as v}from"../utilities/CollectionProxy.js";import{ReadOnlyCollection as b}from"../utilities/ReadOnlyCollection.js";import S from"../utilities/_ReferenceCountedHandle.js";import{checkArg as T}from"../utilities/checkArg.js";import{compare as w}from"../utilities/collection.js";import{isFeatureType as z,isField as I}from"../utilities/esri.js";import{fieldWithArcadeXRegex as N,fieldWithRelationshipRegex as E,getArcadeExpressionFromField as A}from"../utilities/field.js";import{ERR_TIME_ZONE_INVALID as j,isValidTimeZone as H}from"../utilities/format/date.js";import{objectKeys as C}from"../utilities/object.js";import{caseInsensitiveEquals as R}from"../utilities/string.js";import{_fieldExtensionMap as M,FieldExtension as K}from"./FieldExtension.js";const O=new Map;O.set("objectid","oid"),O.set("oid","oid"),O.set("fid","oid"),O.set("shape","geometry"),O.set("shape__length","double"),O.set("shape_length","double"),O.set("shape__area","double"),O.set("shape_area","double"),O.set("area","double"),O.set("perimeter","double"),O.set("length","double"),O.set("fnode_","double"),O.set("tnode_","double"),O.set("lpoly_","double"),O.set("rpoly_","double"),O.set("cover_","integer"),O.set("cover_id","integer"),O.set("idtic","integer"),O.set("xtic","double"),O.set("ytic","double"),O.set("xmin","double"),O.set("ymin","double"),O.set("xmax","double"),O.set("ymax","double"),O.set("arc_","double"),O.set("subclass_","integer"),O.set("subclass_id","integer"),O.set("routelink","integer"),O.set("arclink","integer"),O.set("f_meas","double"),O.set("t_meas","double"),O.set("f_pos","double"),O.set("t_pos","double"),O.set("f_meas","double"),O.set("globalid","global-id"),O.set("guid","guid");export{N as fieldWithArcadeXRegex,E as fieldWithRelationshipRegex};const B=new WeakMap;let P=e=class extends _{fieldExtensions;fields;_featureSettings;_alwaysSerializeFieldExtensions;_watchHandles=[];_primaryKeyField;get spatialReference(){return this._getSetting("spatialReference")}set spatialReference(e){this._setSetting("spatialReference",e)}get primaryKeyField(){if(!this._primaryKeyField){const e=this._getSetting("primaryKeyField");if(e)this._primaryKeyField=e;else{const e=this.fields.filter((e=>"oid"===e.type));1===e.length&&(this._primaryKeyField=e.getItemAt(0).name)}}return this._primaryKeyField}set primaryKeyField(e){this._primaryKeyField=e,this._setSetting("primaryKeyField",e)}get displayField(){return this._getSetting("displayField",this.primaryKeyField)}set displayField(e){!this._featureSettings?.popupTemplate||this._featureSettings.popupTemplate.title&&this._featureSettings.popupTemplate.title!==`{${this.displayField}}`||(this._featureSettings.popupTemplate.title=`{${e}}`),this._setSetting("displayField",e)}get geometryType(){return this._getSetting("geometryType")}set geometryType(e){this._setSetting("geometryType",e)}get hasGeometry(){return void 0!==this.geometryType&&null!==this.geometryType}get timeZone(){return this._getSetting("timeZone","UTC")}set timeZone(e){T("timeZone",e).satisfies((e=>H(e)),j(e)),this._setSetting("timeZone",e)}get typeIdField(){return this._getSetting("typeIdField")}set typeIdField(e){this._setSetting("typeIdField",e)}get subtypes(){return this._getCollectionSetting("subtypes")}get subtypeField(){return this._getSetting("subtypeField")}set subtypeField(e){this._setSetting("subtypeField",e)}get types(){return this._getCollectionSetting("types")}get _fields(){return this._getCollectionSetting("_fields")}constructor(e){super(e),this.fieldExtensions=new J(this),this.fields=new Z(this),this._primaryKeyField=void 0,this._handles.add(this.fields.on("before-changes",(()=>{this._primaryKeyField=void 0})))}static createFieldInfoFromField(e){let i=!0;const t=e.name.toLowerCase();return("oid"===e.type||"geometry"===e.type||O.has(t)&&O.get(t)===e.type)&&(i=!1),new n({visible:i,fieldName:e.name,format:void 0,label:e.alias,stringFieldOption:void 0,tooltip:void 0,isEditable:e.editable})}destroy(){this.parent=void 0,this.fieldExtensions?.destroy(),this.fields?.destroy(),super.destroy()}findFieldByName(e){return this.fields.findFieldByName(e)}toJSON(e="all"){const i=m(this._getSerializableProperties(),this,e)||{};let t=i.fieldExtensions;this.parent&&(t=t?.filter((e=>{const i=this.parent;return!i?.fieldExtensions?.some((i=>i.id===e.id))})));const{fields:s}=i;if(i)for(const e of C(i))this.isModified(e)||delete i[e];if(s&&(i.fields=s),t?.length&&(i.fieldExtensions=t),!c(e)||!f(i))return i}createPopupTemplate(){const e=this.createAllFieldInfos();return new t({fieldInfos:e,content:[{type:"fields"},{type:"attachments"}]})}createAllFieldInfos(){return this.fields.toArray().filter((e=>!!e.name)).map((i=>e.createFieldInfoFromField(i)))}_getSerializableProperties(){return{geometryType:{serialize:!1,deserialize:e=>{this.geometryType=e?a(e):void 0}},spatialReference:{serialize:!1},primaryKeyField:{serialize:!1},displayField:{serialize:!1},typeIdField:{serialize:!1},fields:{serializeModes:["initial","project"],serialize:()=>this.isModified("_fields")?this.fields.toArray().map((e=>e.toJSON())):void 0,deserialize:e=>{if(!e)return;const i=e.map((e=>I(e)?e:o.fromJSON(e)));w(this.fields,i,{onNew:(e,i)=>{this.fields.add(e,i)},onMatch:(e,i,t,s)=>{e!==i&&(e.alias=i.alias,e.editable=i.editable,e.length=i.length,e.nullable=i.nullable,e.type=i.type),t!==s&&this.fields.reorder(e,s)},onMissing:e=>{this.fields.remove(e)},equals:(e,i)=>R(e.name,i.name)})}},fieldExtensions:{serializeModes:["initial"],serialize:e=>this.fieldExtensions.toArray().map((i=>i.toJSON(e))).filter((e=>this._alwaysSerializeFieldExtensions||!(e&&2===Object.keys(e).length&&e.id&&e.field))),deserialize:e=>{e&&w(this.fieldExtensions,e,{onNew:(e,i)=>{this.fieldExtensions.add(r(e)?e:new K(e),i)},onMatch:(e,i,t,s)=>{r(i)||e.assignProperties(i),t!==s&&this.fieldExtensions.reorder(e,s)},onMissing:e=>{this._alwaysSerializeFieldExtensions&&this.fieldExtensions.remove(e)},equals:(e,i)=>r(i)?i===e:!(!i?.field||!K.matchesRef(e,i.field))||e.id===i.id})}},types:{serialize:!1,deserialize:e=>{if(!e)return;const i=e.map((e=>z(e)||!e?e:l.fromJSON(e)));w(this.types,i,{onNew:(e,i)=>{this.types.add(e,i)},onMatch:(e,i,t,s)=>{e!==i&&(e.name=i.name,e.templates=i.templates?[...i.templates]:[],e.domains=i.domains),t!==s&&this.types.reorder(e,s)},onMissing:e=>{this.types.remove(e)},equals:(e,i)=>e.id===i.id})}},timeZone:{serialize:!1,deserialize:e=>{e&&(this.timeZone=e)}}}}};P=e=i([p],P);export{P as Schema};export function schemaHasSubtypes(e){return!(!e.subtypeField||!e.subtypes?.length)}class Z extends v{_schema;_fieldNameToField=new x;_expressionFields=new s;_expressionFieldsReadOnly=new b(this._expressionFields);get _expressionFieldsLength(){return this.expressionFields.length}get expressionFields(){return this._expressionFieldsReadOnly}get _popupTemplate(){return this._schema._featureSettings?this._schema._featureSettings.popupTemplate:void 0}constructor(e){super(new s),this._schema=e,this._handles.add(F(this,"length",(()=>y(this._schema,"_fields.length",(()=>g(this,"length")),{sync:!0})))),this._handles.add(y(this._schema,"_fields",(e=>{if(this._handles.remove("schema-field-collection-schema-fields"),null!=e){this._handles.add([e.on("after-add",(i=>{this._collection.add(i.item,e.indexOf(i.item)),null!=i.item.name&&this._fieldNameToField.set(i.item.name,i.item)})),e.on("after-remove",(e=>{this._collection.remove(e.item),null!=e.item.name&&this._fieldNameToField.delete(e.item.name)}))],"schema-field-collection-schema-fields");for(const i of this._collection)e.includes(i)||(this._collection.remove(i),null!=i.name&&this._fieldNameToField.delete(i.name));for(const i of e)this._collection.includes(i)||(this._collection.add(i),null!=i.name&&this._fieldNameToField.set(i.name,i))}else for(const e of this._collection.filter((e=>!this._expressionFields.includes(e))))this._collection.remove(e),null!=e.name&&this._fieldNameToField.delete(e.name)}),{sync:!0,initial:!0})),this._generateExpressionFields(),this._handles.add([y(this._schema,"_featureSettings.popupTemplate.fieldInfos",(()=>{this._generateExpressionFields()}),{sync:!0}),y(this._schema,"_featureSettings.popupTemplate.expressionInfos",(()=>{this._generateExpressionFields()}),{sync:!0})])}clone(){return new Z(this._schema)}add(e,i){T("field",e).isNotMissing();const t=A(e.name);if(t){if(!this._popupTemplate)throw new d("Cannot create a field that references an arcade expression without a feature source and popup template.");const i=this._popupTemplate.expressionInfos.find((e=>R(e.name,t)));if(!i)throw new d("Cannot create a field that references a non-existent arcade expression.");this._popupTemplate.fieldInfos||(this._popupTemplate.fieldInfos=[]);let s=this._popupTemplate.fieldInfos.find((i=>R(i.fieldName,e.name)));s||(s=new n({fieldName:e.name,label:i.title}),this._popupTemplate.fieldInfos.push(s));const l=B.get(s);B.set(s,e),null!=this._expressionFields&&(this._expressionFields.remove(l),this._expressionFields.includes(e)||(this._expressionFields.add(e),this._collection.add(e),null!=e.name&&this._fieldNameToField.set(e.name,e))),g(this,"_expressionFieldsLength")}else this._schema._fields.add(e,i);return this}destroy(){this._fieldNameToField.clear(),this._expressionFields.removeAll(),this._collection.removeAll(),super.destroy()}removeAt(e){T("index",e).isNotMissing();const i=this.getItemAt(e);if(!i)return;if(A(i.name)){const e=this._popupTemplate.fieldInfos.findIndex((e=>R(e.fieldName,i.name)));this._popupTemplate.fieldInfos.splice(e,1),this._expressionFields.remove(i),this._collection.remove(i),null!=i.name&&this._fieldNameToField.delete(i.name),g(this,"_expressionFieldsLength")}else this._schema._fields.remove(i);return i}reorder(e,i){if(e&&this._schema._fields.includes(e))return this._schema._fields.reorder(e,i),this._collection.reorder(e,i),e}sort(e){return this._schema._fields.sort(e),this._collection.sort(((i,t)=>this._expressionFields.includes(i)&&this._expressionFields.includes(t)?0:this._expressionFields.includes(i)?1:this._expressionFields.includes(t)?-1:e(i,t))),this}findFieldByName(e){return this._fieldNameToField.get(e)}_generateExpressionFields(){if(!this._popupTemplate?.fieldInfos||!this._popupTemplate?.expressionInfos){for(const e of this._expressionFields)this._collection.remove(e),null!=e.name&&this._fieldNameToField.delete(e.name);return void this._expressionFields.removeAll()}const e=this._expressionFields.slice();for(const i of this._popupTemplate.fieldInfos){const t=A(i.fieldName);if(null==t)continue;const s=this._popupTemplate.expressionInfos.find((e=>R(e.name,t)));if(null==s)continue;let l=B.get(i);null==l&&(l=new o({name:i.fieldName,alias:i.label||s.title||i.fieldName,type:"number"===s.returnType?"double":"string",editable:!1})),this._expressionFields.includes(l)?e.remove(l):(B.set(i,l),this._expressionFields.add(l),this._collection.add(l),null!=l.name&&this._fieldNameToField.set(l.name,l),e.remove(l))}for(const i of e)this._expressionFields.remove(i),this._collection.remove(i),null!=i.name&&this._fieldNameToField.delete(i.name)}}class J extends h{get _collection(){return this._schema.fields.map((e=>this._forField(e))).concat(Array.from(this._uninitializedFieldExtensions))}_schema;_uninitializedFieldExtensions=new Set;_onChangeSchemaFieldsHandle=new S((()=>this._schema.fields.on("change",(e=>{const i={added:(e.added||[]).map((e=>this._forField(e))),moved:(e.moved||[]).map((e=>this._forField(e))),removed:(e.removed||[]).map((e=>this._forField(e))),target:this};this.emit("change",i)}))));_onBeforeAddSchemaFieldsHandle=new S((()=>this._schema.fields.on("before-add",(e=>{this.emit("before-add",{...e,item:this._forField(e.item)})}))));_onBeforeRemoveSchemaFieldsHandle=new S((()=>this._schema.fields.on("before-remove",(e=>{this.emit("before-remove",{...e,item:this._forField(e.item)})}))));_onBeforeChangesSchemaFieldsHandle=new S((()=>this._schema.fields.on("before-changes",(e=>{this.emit("before-changes",{...e,item:this._forField(e.item)})}))));_onAfterAddSchemaFieldsHandle=new S((()=>this._schema.fields.on("after-add",(e=>{this.emit("after-add",{...e,item:this._forField(e.item)})}))));_onAfterRemoveSchemaFieldsHandle=new S((()=>this._schema.fields.on("after-remove",(e=>{this.emit("after-remove",{...e,item:this._forField(e.item)})}))));_onAfterChangesSchemaFieldsHandle=new S((()=>this._schema.fields.on("after-changes",(e=>{this.emit("after-changes",{...e,target:this})}))));constructor(e){super(),this._schema=e,this._handles.add(F(this,"length",(()=>y(this._schema.fields,"length",(()=>g(this,"length")),{sync:!0}))))}async destroy(){this._onChangeSchemaFieldsHandle.destroy(),this._onBeforeAddSchemaFieldsHandle.destroy(),this._onBeforeRemoveSchemaFieldsHandle.destroy(),this._onBeforeChangesSchemaFieldsHandle.destroy(),this._onAfterAddSchemaFieldsHandle.destroy(),this._onAfterRemoveSchemaFieldsHandle.destroy(),this._onAfterChangesSchemaFieldsHandle.destroy();const e=[];for(const i of this._schema.fields){const t=M.get(i);t?.schema===this._schema&&(M.delete(i),this._onRemoved(t),e.push(t.destroy()))}this._uninitializedFieldExtensions.forEach((i=>{this._onRemoved(i),e.push(i.destroy())})),this._uninitializedFieldExtensions.clear(),await Promise.all(e),super.destroy()}forField(e){if(T("field",e).isNotMissing(),this._schema.fields.includes(e))return this._forField(e)}add(e,i){if(T("fieldX",e).isNotMissing(),e.schema&&e.schema.fieldExtensions.remove(e),e._setSchema(this._schema),e.field){const t=M.get(e.field);if(M.set(e.field,e),t&&t!==e&&this._onRemoved(t),this._schema.fields.includes(e.field))if(void 0===i){const i={added:[e],moved:[],removed:t?[t]:[],target:this};this.emit("change",i),this.emit("after-add",{item:e}),this.emit("after-changes",{})}else this._schema.fields.reorder(e.field,i);else this._schema.fields.add(e.field,i)}else{this._uninitializedFieldExtensions.add(e);const i={added:[e],moved:[],removed:[],target:this};this.emit("change",i),this.emit("after-add",{item:e}),this.emit("after-changes",{})}return this._onAdded(e),this}removeAt(e){const i=this.getItemAt(e);if(void 0!==i){if(this._uninitializedFieldExtensions.has(i)){this._uninitializedFieldExtensions.delete(i);const e={added:[],moved:[],removed:[i],target:this};this.emit("change",e),this.emit("after-remove",{item:i}),this.emit("after-changes",{})}else this._schema.fields.remove(i.field);return this._onRemoved(i),i}}reorder(e,i){if(e&&this._schema.fields.includes(e.field))return this._schema.fields.reorder(e.field,i),e}sort(e){return this._schema.fields.sort(((i,t)=>e(this._forField(i),this._forField(t)))),this}on(e,i){const t=[];return"change"===e?t.push(this._onChangeSchemaFieldsHandle.add()):"before-add"===e?t.push(this._onBeforeAddSchemaFieldsHandle.add()):"before-remove"===e?t.push(this._onBeforeRemoveSchemaFieldsHandle.add()):"before-changes"===e?t.push(this._onBeforeChangesSchemaFieldsHandle.add()):"after-add"===e?t.push(this._onAfterAddSchemaFieldsHandle.add()):"after-remove"===e?t.push(this._onAfterRemoveSchemaFieldsHandle.add()):"after-changes"===e&&t.push(this._onAfterChangesSchemaFieldsHandle.add()),t.push(super.on(e,i)),u(t)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.field}_onAdded(e){}_onRemoved(e){e.schema===this._schema&&e._setSchema(void 0)}_forField(e){if(this._uninitializedFieldExtensions.size)for(const e of this._uninitializedFieldExtensions)e._resolveField(),e.field&&(M.set(e.field,e),this._uninitializedFieldExtensions.delete(e));if(!M.has(e)){const i=new K({field:e});M.set(e,i),i._setSchema(this._schema),this._onAdded(i),i.initialize()}return M.get(e)}}
|
|
1
|
+
var e;import{__decorate as i}from"tslib";import t from"@arcgis/core/PopupTemplate";import s from"@arcgis/core/core/Collection";import l from"@arcgis/core/layers/support/FeatureType";import o from"@arcgis/core/layers/support/Field";import n from"@arcgis/core/popup/FieldInfo";import{InvalidOperationError as d}from"../InvalidOperationError.js";import{isFieldExtension as r}from"../ItemType.js";import{jsonToGeometryType as a}from"../json/GeometryJson.js";import{InitializableCollectionProxy as h}from"../support/InitializableCollectionProxy.js";import{filterJSONProperties as m,isDefault as f,serializable as p,shouldExcludeDefaults as c}from"../support/Serializable.js";import{Settings as _}from"../support/Settings.js";import{createIHandle as u,notifyChange as g,onWatch as F,watch as y}from"../support/observableUtils.js";import{CaseInsensitiveObservableMap as x}from"../utilities/CaseInsensitiveObservableMap.js";import{CollectionProxy as v}from"../utilities/CollectionProxy.js";import{ReadOnlyCollection as b}from"../utilities/ReadOnlyCollection.js";import S from"../utilities/_ReferenceCountedHandle.js";import{checkArg as T}from"../utilities/checkArg.js";import{compare as w}from"../utilities/collection.js";import{isFeatureType as z,isField as I}from"../utilities/esri.js";import{fieldWithArcadeXRegex as E,fieldWithRelationshipRegex as N,getArcadeExpressionFromField as A}from"../utilities/field.js";import{ERR_TIME_ZONE_INVALID as j,isValidTimeZone as H}from"../utilities/format/date.js";import{objectKeys as C}from"../utilities/object.js";import{caseInsensitiveEquals as R}from"../utilities/string.js";import{_fieldExtensionMap as M,FieldExtension as K}from"./FieldExtension.js";const O=new Map;O.set("objectid","oid"),O.set("oid","oid"),O.set("fid","oid"),O.set("shape","geometry"),O.set("shape__length","double"),O.set("shape_length","double"),O.set("shape__area","double"),O.set("shape_area","double"),O.set("area","double"),O.set("perimeter","double"),O.set("length","double"),O.set("fnode_","double"),O.set("tnode_","double"),O.set("lpoly_","double"),O.set("rpoly_","double"),O.set("cover_","integer"),O.set("cover_id","integer"),O.set("idtic","integer"),O.set("xtic","double"),O.set("ytic","double"),O.set("xmin","double"),O.set("ymin","double"),O.set("xmax","double"),O.set("ymax","double"),O.set("arc_","double"),O.set("subclass_","integer"),O.set("subclass_id","integer"),O.set("routelink","integer"),O.set("arclink","integer"),O.set("f_meas","double"),O.set("t_meas","double"),O.set("f_pos","double"),O.set("t_pos","double"),O.set("f_meas","double"),O.set("globalid","global-id"),O.set("guid","guid");export{E as fieldWithArcadeXRegex,N as fieldWithRelationshipRegex};const B=new WeakMap;let P=e=class extends _{fieldExtensions;fields;_featureSettings;_alwaysSerializeFieldExtensions;_watchHandles=[];_primaryKeyField;get spatialReference(){return this._getSetting("spatialReference")}set spatialReference(e){this._setSetting("spatialReference",e)}get primaryKeyField(){if(!this._primaryKeyField){const e=this._getSetting("primaryKeyField");if(e)this._primaryKeyField=e;else{const e=this.fields.filter((e=>"oid"===e.type));1===e.length&&(this._primaryKeyField=e.getItemAt(0).name)}}return this._primaryKeyField}set primaryKeyField(e){this._primaryKeyField=e,this._setSetting("primaryKeyField",e)}get displayField(){return this._getSetting("displayField",this.primaryKeyField)}set displayField(e){!this._featureSettings?.popupTemplate||this._featureSettings.popupTemplate.title&&this._featureSettings.popupTemplate.title!==`{${this.displayField}}`||(this._featureSettings.popupTemplate.title=`{${e}}`),this._setSetting("displayField",e)}get geometryType(){return this._getSetting("geometryType")}set geometryType(e){this._setSetting("geometryType",e)}get hasGeometry(){return void 0!==this.geometryType&&null!==this.geometryType}get timeZone(){return this._getSetting("timeZone","UTC")}set timeZone(e){T("timeZone",e).satisfies((e=>H(e)),j(e)),this._setSetting("timeZone",e)}get typeIdField(){return this._getSetting("typeIdField")}set typeIdField(e){this._setSetting("typeIdField",e)}get subtypes(){return this._getCollectionSetting("subtypes")}get subtypeField(){return this._getSetting("subtypeField")}set subtypeField(e){this._setSetting("subtypeField",e)}get types(){return this._getCollectionSetting("types")}get _fields(){return this._getCollectionSetting("_fields")}constructor(e){super(e),this.fieldExtensions=new J(this),this.fields=new Z(this),this._primaryKeyField=void 0,this._handles.add(this.fields.on("before-changes",(()=>{this._primaryKeyField=void 0})))}static createFieldInfoFromField(e){let i=!0;const t=e.name.toLowerCase();return("oid"===e.type||"geometry"===e.type||O.has(t)&&O.get(t)===e.type)&&(i=!1),new n({visible:i,fieldName:e.name,format:void 0,label:e.alias,stringFieldOption:void 0,tooltip:void 0,isEditable:e.editable})}destroy(){this.parent=void 0,this.fieldExtensions?.destroy(),this.fields?.destroy(),super.destroy()}findFieldByName(e){return this.fields.findFieldByName(e)}toJSON(e="all"){const i=m(this._getSerializableProperties(),this,e)||{};let t=i.fieldExtensions;this.parent&&(t=t?.filter((e=>{const i=this.parent;return!i?.fieldExtensions?.some((i=>i.id===e.id))})));const{fields:s}=i;if(i)for(const e of C(i))this.isModified(e)||delete i[e];if(s&&(i.fields=s),t?.length&&(i.fieldExtensions=t),!c(e)||!f(i))return i}createPopupTemplate(){const e=this.createAllFieldInfos();return new t({fieldInfos:e,content:[{type:"fields"},{type:"attachments"}]})}createAllFieldInfos(){return this.fields.toArray().filter((e=>!!e.name)).map((i=>e.createFieldInfoFromField(i)))}_getSerializableProperties(){return{geometryType:{serialize:!1,deserialize:e=>{this.geometryType=e?a(e):void 0}},spatialReference:{serialize:!1},primaryKeyField:{serialize:!1},displayField:{serialize:!1},typeIdField:{serialize:!1},fields:{serializeModes:["initial","project"],serialize:()=>this.isModified("_fields")?this.fields.toArray().map((e=>e.toJSON())):void 0,deserialize:e=>{if(!e)return;const i=e.map((e=>I(e)?e:o.fromJSON(e)));w(this.fields,i,{onNew:(e,i)=>{this.fields.add(e,i)},onMatch:(e,i,t,s)=>{e!==i&&(e.alias=i.alias,e.editable=i.editable,e.length=i.length,e.nullable=i.nullable,e.type=i.type),t!==s&&this.fields.reorder(e,s)},onMissing:e=>{this.fields.remove(e)},equals:(e,i)=>R(e.name,i.name)})}},fieldExtensions:{serializeModes:["initial"],serialize:e=>this.fieldExtensions.toArray().map((i=>i.toJSON(e))).filter((e=>this._alwaysSerializeFieldExtensions||!(e&&2===Object.keys(e).length&&e.id&&e.field))),deserialize:e=>{e&&w(this.fieldExtensions,e,{onNew:(e,i)=>{this.fieldExtensions.add(r(e)?e:new K(e),i)},onMatch:(e,i,t,s)=>{if(!r(i)){if(i.id&&e.id!==i.id)return void this.fieldExtensions.add(new K(i),s);e.assignProperties(i)}t!==s&&this.fieldExtensions.reorder(e,s)},onMissing:e=>{this._alwaysSerializeFieldExtensions&&this.fieldExtensions.remove(e)},equals:(e,i)=>r(i)?i===e:!(!i?.field||!K.matchesRef(e,i.field))||e.id===i.id})}},types:{serialize:!1,deserialize:e=>{if(!e)return;const i=e.map((e=>z(e)||!e?e:l.fromJSON(e)));w(this.types,i,{onNew:(e,i)=>{this.types.add(e,i)},onMatch:(e,i,t,s)=>{e!==i&&(e.name=i.name,e.templates=i.templates?[...i.templates]:[],e.domains=i.domains),t!==s&&this.types.reorder(e,s)},onMissing:e=>{this.types.remove(e)},equals:(e,i)=>e.id===i.id})}},timeZone:{serialize:!1,deserialize:e=>{e&&(this.timeZone=e)}}}}};P=e=i([p],P);export{P as Schema};export function schemaHasSubtypes(e){return!(!e.subtypeField||!e.subtypes?.length)}class Z extends v{_schema;_fieldNameToField=new x;_expressionFields=new s;_expressionFieldsReadOnly=new b(this._expressionFields);get _expressionFieldsLength(){return this.expressionFields.length}get expressionFields(){return this._expressionFieldsReadOnly}get _popupTemplate(){return this._schema._featureSettings?this._schema._featureSettings.popupTemplate:void 0}constructor(e){super(new s),this._schema=e,this._handles.add(F(this,"length",(()=>y(this._schema,"_fields.length",(()=>g(this,"length")),{sync:!0})))),this._handles.add(y(this._schema,"_fields",(e=>{if(this._handles.remove("schema-field-collection-schema-fields"),null!=e){this._handles.add([e.on("after-add",(i=>{this._collection.add(i.item,e.indexOf(i.item)),null!=i.item.name&&this._fieldNameToField.set(i.item.name,i.item)})),e.on("after-remove",(e=>{this._collection.remove(e.item),null!=e.item.name&&this._fieldNameToField.delete(e.item.name)}))],"schema-field-collection-schema-fields");for(const i of this._collection)e.includes(i)||(this._collection.remove(i),null!=i.name&&this._fieldNameToField.delete(i.name));for(const i of e)this._collection.includes(i)||(this._collection.add(i),null!=i.name&&this._fieldNameToField.set(i.name,i))}else for(const e of this._collection.filter((e=>!this._expressionFields.includes(e))))this._collection.remove(e),null!=e.name&&this._fieldNameToField.delete(e.name)}),{sync:!0,initial:!0})),this._generateExpressionFields(),this._handles.add([y(this._schema,"_featureSettings.popupTemplate.fieldInfos",(()=>{this._generateExpressionFields()}),{sync:!0}),y(this._schema,"_featureSettings.popupTemplate.expressionInfos",(()=>{this._generateExpressionFields()}),{sync:!0})])}clone(){return new Z(this._schema)}add(e,i){T("field",e).isNotMissing();const t=A(e.name);if(t){if(!this._popupTemplate)throw new d("Cannot create a field that references an arcade expression without a feature source and popup template.");const i=this._popupTemplate.expressionInfos.find((e=>R(e.name,t)));if(!i)throw new d("Cannot create a field that references a non-existent arcade expression.");this._popupTemplate.fieldInfos||(this._popupTemplate.fieldInfos=[]);let s=this._popupTemplate.fieldInfos.find((i=>R(i.fieldName,e.name)));s||(s=new n({fieldName:e.name,label:i.title}),this._popupTemplate.fieldInfos.push(s));const l=B.get(s);B.set(s,e),null!=this._expressionFields&&(this._expressionFields.remove(l),this._expressionFields.includes(e)||(this._expressionFields.add(e),this._collection.add(e),null!=e.name&&this._fieldNameToField.set(e.name,e))),g(this,"_expressionFieldsLength")}else this._schema._fields.add(e,i);return this}destroy(){this._fieldNameToField.clear(),this._expressionFields.removeAll(),this._collection.removeAll(),super.destroy()}removeAt(e){T("index",e).isNotMissing();const i=this.getItemAt(e);if(!i)return;if(A(i.name)){const e=this._popupTemplate.fieldInfos.findIndex((e=>R(e.fieldName,i.name)));this._popupTemplate.fieldInfos.splice(e,1),this._expressionFields.remove(i),this._collection.remove(i),null!=i.name&&this._fieldNameToField.delete(i.name),g(this,"_expressionFieldsLength")}else this._schema._fields.remove(i);return i}reorder(e,i){if(e&&this._schema._fields.includes(e))return this._schema._fields.reorder(e,i),this._collection.reorder(e,i),e}sort(e){return this._schema._fields.sort(e),this._collection.sort(((i,t)=>this._expressionFields.includes(i)&&this._expressionFields.includes(t)?0:this._expressionFields.includes(i)?1:this._expressionFields.includes(t)?-1:e(i,t))),this}findFieldByName(e){return this._fieldNameToField.get(e)}_generateExpressionFields(){if(!this._popupTemplate?.fieldInfos||!this._popupTemplate?.expressionInfos){for(const e of this._expressionFields)this._collection.remove(e),null!=e.name&&this._fieldNameToField.delete(e.name);return void this._expressionFields.removeAll()}const e=this._expressionFields.slice();for(const i of this._popupTemplate.fieldInfos){const t=A(i.fieldName);if(null==t)continue;const s=this._popupTemplate.expressionInfos.find((e=>R(e.name,t)));if(null==s)continue;let l=B.get(i);null==l&&(l=new o({name:i.fieldName,alias:i.label||s.title||i.fieldName,type:"number"===s.returnType?"double":"string",editable:!1})),this._expressionFields.includes(l)?e.remove(l):(B.set(i,l),this._expressionFields.add(l),this._collection.add(l),null!=l.name&&this._fieldNameToField.set(l.name,l),e.remove(l))}for(const i of e)this._expressionFields.remove(i),this._collection.remove(i),null!=i.name&&this._fieldNameToField.delete(i.name)}}class J extends h{get _collection(){return this._schema.fields.map((e=>this._forField(e))).concat(Array.from(this._uninitializedFieldExtensions))}_schema;_uninitializedFieldExtensions=new Set;_onChangeSchemaFieldsHandle=new S((()=>this._schema.fields.on("change",(e=>{const i={added:(e.added||[]).map((e=>this._forField(e))),moved:(e.moved||[]).map((e=>this._forField(e))),removed:(e.removed||[]).map((e=>this._forField(e))),target:this};this.emit("change",i)}))));_onBeforeAddSchemaFieldsHandle=new S((()=>this._schema.fields.on("before-add",(e=>{this.emit("before-add",{...e,item:this._forField(e.item)})}))));_onBeforeRemoveSchemaFieldsHandle=new S((()=>this._schema.fields.on("before-remove",(e=>{this.emit("before-remove",{...e,item:this._forField(e.item)})}))));_onBeforeChangesSchemaFieldsHandle=new S((()=>this._schema.fields.on("before-changes",(e=>{this.emit("before-changes",{...e,item:this._forField(e.item)})}))));_onAfterAddSchemaFieldsHandle=new S((()=>this._schema.fields.on("after-add",(e=>{this.emit("after-add",{...e,item:this._forField(e.item)})}))));_onAfterRemoveSchemaFieldsHandle=new S((()=>this._schema.fields.on("after-remove",(e=>{this.emit("after-remove",{...e,item:this._forField(e.item)})}))));_onAfterChangesSchemaFieldsHandle=new S((()=>this._schema.fields.on("after-changes",(e=>{this.emit("after-changes",{...e,target:this})}))));constructor(e){super(),this._schema=e,this._handles.add(F(this,"length",(()=>y(this._schema.fields,"length",(()=>g(this,"length")),{sync:!0}))))}async destroy(){this._onChangeSchemaFieldsHandle.destroy(),this._onBeforeAddSchemaFieldsHandle.destroy(),this._onBeforeRemoveSchemaFieldsHandle.destroy(),this._onBeforeChangesSchemaFieldsHandle.destroy(),this._onAfterAddSchemaFieldsHandle.destroy(),this._onAfterRemoveSchemaFieldsHandle.destroy(),this._onAfterChangesSchemaFieldsHandle.destroy();const e=[];for(const i of this._schema.fields){const t=M.get(i);t?.schema===this._schema&&(M.delete(i),this._onRemoved(t),e.push(t.destroy()))}this._uninitializedFieldExtensions.forEach((i=>{this._onRemoved(i),e.push(i.destroy())})),this._uninitializedFieldExtensions.clear(),await Promise.all(e),super.destroy()}forField(e){if(T("field",e).isNotMissing(),this._schema.fields.includes(e))return this._forField(e)}add(e,i){if(T("fieldX",e).isNotMissing(),e.schema&&e.schema.fieldExtensions.remove(e),e._setSchema(this._schema),e.field){const t=M.get(e.field);if(M.set(e.field,e),t&&t!==e&&this._onRemoved(t),this._schema.fields.includes(e.field))if(void 0===i){const i={added:[e],moved:[],removed:t?[t]:[],target:this};this.emit("change",i),this.emit("after-add",{item:e}),this.emit("after-changes",{})}else this._schema.fields.reorder(e.field,i);else this._schema.fields.add(e.field,i)}else{this._uninitializedFieldExtensions.add(e);const i={added:[e],moved:[],removed:[],target:this};this.emit("change",i),this.emit("after-add",{item:e}),this.emit("after-changes",{})}return this._onAdded(e),this}removeAt(e){const i=this.getItemAt(e);if(void 0!==i){if(this._uninitializedFieldExtensions.has(i)){this._uninitializedFieldExtensions.delete(i);const e={added:[],moved:[],removed:[i],target:this};this.emit("change",e),this.emit("after-remove",{item:i}),this.emit("after-changes",{})}else this._schema.fields.remove(i.field);return this._onRemoved(i),i}}reorder(e,i){if(e&&this._schema.fields.includes(e.field))return this._schema.fields.reorder(e.field,i),e}sort(e){return this._schema.fields.sort(((i,t)=>e(this._forField(i),this._forField(t)))),this}on(e,i){const t=[];return"change"===e?t.push(this._onChangeSchemaFieldsHandle.add()):"before-add"===e?t.push(this._onBeforeAddSchemaFieldsHandle.add()):"before-remove"===e?t.push(this._onBeforeRemoveSchemaFieldsHandle.add()):"before-changes"===e?t.push(this._onBeforeChangesSchemaFieldsHandle.add()):"after-add"===e?t.push(this._onAfterAddSchemaFieldsHandle.add()):"after-remove"===e?t.push(this._onAfterRemoveSchemaFieldsHandle.add()):"after-changes"===e&&t.push(this._onAfterChangesSchemaFieldsHandle.add()),t.push(super.on(e,i)),u(t)}_itemIsInitialized(e){return super._itemIsInitialized(e)&&!!e.field}_onAdded(e){}_onRemoved(e){e.schema===this._schema&&e._setSchema(void 0)}_forField(e){if(this._uninitializedFieldExtensions.size)for(const e of this._uninitializedFieldExtensions)e._resolveField(),e.field&&(M.set(e.field,e),this._uninitializedFieldExtensions.delete(e));if(!M.has(e)){const i=new K({field:e});M.set(e,i),i._setSchema(this._schema),this._onAdded(i),i.initialize()}return M.get(e)}}
|
package/data/TaskSettings.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as e}from"tslib";import{serializable as t}from"../support/Serializable.js";import{Settings as i}from"../support/Settings.js";let n=class extends i{get enableExport(){return this._getSetting("enableExport",!0)}set enableExport(e){this._setSetting("enableExport",e)}get enableIdentify(){return this._getSetting("enableIdentify",!0)}set enableIdentify(e){this._setSetting("enableIdentify",e)}get enableQuery(){return this._getSetting("enableQuery",!0)}set enableQuery(e){this._setSetting("enableQuery",e)}get enableSearch(){return this._getSetting("enableSearch",!0)}set enableSearch(e){this._setSetting("enableSearch",e)}get enableAdd(){return this._getSetting("enableAdd",!0)}set enableAdd(e){this._setSetting("enableAdd",e)}get enableUpdate(){return this._getSetting("enableUpdate",!0)}set enableUpdate(e){this._setSetting("enableUpdate",e)}get enableDelete(){return this._getSetting("enableDelete",!0)}set enableDelete(e){this._setSetting("enableDelete",e)}get enableEditing(){return this._getSetting("enableEditing",!0)}set enableEditing(e){this._setSetting("enableEditing",e)}get studioSearchSubindexId(){return this._getSetting("studioSearchSubindexId","")}set studioSearchSubindexId(e){this._setSetting("studioSearchSubindexId",e)}_getSerializableProperties(){return{enableAdd:"initial",enableDelete:"initial",enableEditing:"initial",enableExport:"initial",enableIdentify:"initial",enableQuery:"initial",enableSearch:"initial",enableUpdate:"initial",studioSearchSubindexId:"initial"}}};n=e([t],n);export{n as TaskSettings};
|
|
1
|
+
import{__decorate as e}from"tslib";import{serializable as t}from"../support/Serializable.js";import{Settings as i}from"../support/Settings.js";let n=class extends i{get enableExport(){return this._getSetting("enableExport",!0)}set enableExport(e){this._setSetting("enableExport",e)}get enableIdentify(){return this._getSetting("enableIdentify",!0)}set enableIdentify(e){this._setSetting("enableIdentify",e)}get enableQuery(){return this._getSetting("enableQuery",!0)}set enableQuery(e){this._setSetting("enableQuery",e)}get enableSearch(){return this._getSetting("enableSearch",!0)}set enableSearch(e){this._setSetting("enableSearch",e)}get enableAdd(){return this._getSetting("enableAdd",!0)}set enableAdd(e){this._setSetting("enableAdd",e)}get enableUpdate(){return this._getSetting("enableUpdate",!0)}set enableUpdate(e){this._setSetting("enableUpdate",e)}get enableDelete(){return this._getSetting("enableDelete",!0)}set enableDelete(e){this._setSetting("enableDelete",e)}get enableEditing(){return this._getSetting("enableEditing",!0)}set enableEditing(e){this._setSetting("enableEditing",e)}get studioSearchSubindexId(){return this._getSetting("studioSearchSubindexId","")}set studioSearchSubindexId(e){this._setSetting("studioSearchSubindexId",e)}_getSerializableProperties(){return{enableAdd:"initial",enableDelete:"initial",enableEditing:"initial",enableExport:"initial",enableIdentify:["initial","project"],enableQuery:["initial","project"],enableSearch:["initial","project"],enableUpdate:["initial","project"],studioSearchSubindexId:"initial"}}};n=e([t],n);export{n as TaskSettings};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>version | @vertigis/arcgis-extensions</title><meta name="description" content="Documentation for @vertigis/arcgis-extensions"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@vertigis/arcgis-extensions</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/version.html">version</a></li><li><a href="" aria-current="page">version</a></li></ul><h1>Variable version<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">version</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"54.
|
|
1
|
+
<!DOCTYPE html><html class="default" lang="en" data-base="../"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>version | @vertigis/arcgis-extensions</title><meta name="description" content="Documentation for @vertigis/arcgis-extensions"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><script async src="../assets/hierarchy.js" id="tsd-hierarchy-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => window.app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><a href="../index.html" class="title">@vertigis/arcgis-extensions</a><div id="tsd-toolbar-links"></div><button id="tsd-search-trigger" class="tsd-widget" aria-label="Search"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-search"></use></svg></button><dialog id="tsd-search" aria-label="Search"><input role="combobox" id="tsd-search-input" aria-controls="tsd-search-results" aria-autocomplete="list" aria-expanded="true" autocapitalize="off" autocomplete="off" placeholder="Search the docs" maxLength="100"/><ul role="listbox" id="tsd-search-results"></ul><div id="tsd-search-status" aria-live="polite" aria-atomic="true"><div>Preparing search index...</div></div></dialog><a href="#" class="tsd-widget menu" id="tsd-toolbar-menu-trigger" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb" aria-label="Breadcrumb"><li><a href="../modules/version.html">version</a></li><li><a href="" aria-current="page">version</a></li></ul><h1>Variable version<code class="tsd-tag">Const</code></h1></div><div class="tsd-signature"><span class="tsd-kind-variable">version</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"54.7.0"</span></div><div class="tsd-comment tsd-typography"><p>The current version of the Geocortex ArcGIS Extensions API.</p>
|
|
2
2
|
</div></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">@vertigis/arcgis-extensions</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer></footer><div class="overlay"></div></body></html>
|
package/package.json
CHANGED
package/version.d.ts
CHANGED
package/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version="54.
|
|
1
|
+
export const version="54.7.0";
|