@vertigis/arcgis-extensions 48.8.0 → 48.9.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.
Files changed (60) hide show
  1. package/data/Feature.d.ts +1 -0
  2. package/data/Feature.js +1 -1
  3. package/data/FeatureSettings.d.ts +1 -1
  4. package/data/FeatureSettings.js +1 -1
  5. package/data/FeatureSourceBase.d.ts +4 -2
  6. package/data/FeatureSourceBase.js +1 -1
  7. package/data/FieldExtension.d.ts +3 -0
  8. package/data/FieldExtension.js +1 -1
  9. package/data/Schema.js +1 -1
  10. package/docs/html/assets/navigation.js +1 -1
  11. package/docs/html/assets/search.js +1 -1
  12. package/docs/html/classes/data_FeatureList.FeatureList.html +3 -2
  13. package/docs/html/classes/data_FeatureSourceBase.FeatureSourceBase.html +3 -2
  14. package/docs/html/classes/data_FeatureSourceBase.RelationshipCollection.html +3 -2
  15. package/docs/html/classes/data_FieldExtension.FieldExtension.html +4 -4
  16. package/docs/html/classes/mapping_ArcGISSublayerExtension.ArcGISSublayerRelationshipCollection.html +3 -2
  17. package/docs/html/classes/mapping_GraphicsLayerExtension.GraphicsLayerExtension.html +3 -2
  18. package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtension.html +3 -2
  19. package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtensionCollection.html +3 -2
  20. package/docs/html/classes/mapping_MapNotesLayerExtension.MapNotesLayerExtension.html +3 -2
  21. package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerRelationshipCollection.html +3 -2
  22. package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerRelationshipCollection.html +3 -2
  23. package/docs/html/classes/mapping_UnsupportedLayerExtension.UnsupportedLayerExtension.html +3 -2
  24. package/docs/html/classes/mapping_WMSLayerExtension.WMSLayerExtension.html +3 -2
  25. package/docs/html/classes/mapping_WMTSLayerExtension.WMTSLayerExtension.html +3 -2
  26. package/docs/html/classes/mapping__LayerExtension.LayerExtension.html +3 -2
  27. package/docs/html/classes/mapping__LayerExtensionCollectionImpl.LayerExtensionCollectionImpl.html +3 -2
  28. package/docs/html/classes/mapping__SublayerExtension.SubSublayerExtensionCollection.html +3 -2
  29. package/docs/html/classes/mapping_support_ArrayWrappedCollection.ArrayWrappedCollection.html +3 -2
  30. package/docs/html/classes/mapping_support__LayerExtensionCollection.LayerExtensionCollectionBase.html +3 -2
  31. package/docs/html/classes/mapping_support__SublayerExtensionCollection.SublayerExtensionCollectionBase.html +3 -2
  32. package/docs/html/classes/support_InitializableCollectionProxy.InitializableCollectionProxy.html +3 -2
  33. package/docs/html/classes/support_ReadOnlyInitializableCollection.ReadOnlyInitializableCollection.html +3 -2
  34. package/docs/html/classes/support__ArcGISRelationshipCollection.ArcGISRelationshipCollection.html +3 -2
  35. package/docs/html/classes/tasks_geocoding_Geocoder.Geocoder.html +3 -2
  36. package/docs/html/classes/utilities_CollectionProxy.CollectionProxy.html +4 -3
  37. package/docs/html/classes/utilities_CopyOnWriteCollection.CopyOnWriteCollection.html +3 -2
  38. package/docs/html/classes/utilities_MapTransformCollection.MapTransformCollection.html +3 -2
  39. package/docs/html/classes/utilities_ReadOnlyCollection.ReadOnlyCollection.html +3 -2
  40. package/docs/html/classes/utilities_ReadOnlyMap.ReadOnlyMap.html +21 -15
  41. package/docs/html/classes/utilities__ReferenceCountedHandle.default.html +6 -0
  42. package/docs/html/interfaces/data_Feature.PresentableAttributes.html +9 -6
  43. package/docs/html/modules/utilities__ReferenceCountedHandle.html +2 -0
  44. package/docs/html/modules.html +1 -0
  45. package/docs/html/types/support_esri.WatchCallback.html +1 -1
  46. package/docs/html/variables/version.version.html +1 -1
  47. package/package.json +1 -1
  48. package/support/Observable.js +1 -1
  49. package/support/Settings.d.ts +0 -1
  50. package/support/Settings.js +1 -1
  51. package/support/esri.d.ts +1 -1
  52. package/utilities/CollectionProxy.d.ts +13 -5
  53. package/utilities/CollectionProxy.js +1 -1
  54. package/utilities/ReadOnlyMap.d.ts +16 -2
  55. package/utilities/ReadOnlyMap.js +1 -1
  56. package/utilities/_ReferenceCountedHandle.d.ts +21 -0
  57. package/utilities/_ReferenceCountedHandle.js +1 -0
  58. package/utilities/watch.js +1 -1
  59. package/version.d.ts +1 -1
  60. package/version.js +1 -1
@@ -1 +1 @@
1
- import{Observable as t}from"../support/Observable.js";import{onCollectionPropertyChange as e}from"./watch.js";export class CollectionProxy extends t{get length(){return this._collection.length}get declaredClass(){return"esri.core.Collection"}get destroyed(){return this._destroyed}set destroyed(t){this._destroyed=t}get initialized(){return this._initialized}set initialized(t){this._initialized=t}get _collection(){if(void 0===this._collectionField)throw new Error("CollectionProxy requires a backing collection.");return this._collectionField}set _collection(t){this._collectionField=t}_destroyed=!1;_initialized=!0;_afterChangesHandle;_collectionField;constructor(t){super(),this._collectionField=t,e(this,"_collectionField",(t=>{this.emit("change",t)})),this.watch("_collectionField.length",(()=>this.notifyChange("length"))),this.watch("_collectionField",(t=>{this._afterChangesHandle?.remove(),this._afterChangesHandle=t?.on("after-changes",(t=>this.emit("after-changes",t))),this.emit("after-changes")}),!0),null!=this._collectionField&&(this._afterChangesHandle=this._collectionField.on("after-changes",(t=>this.emit("after-changes",t))))}*[Symbol.iterator](){for(const t of this._collection)yield t}add(t,e){return this._collection.add(t,e),this}addMany(t,e){if(!t)return this;if(arguments.length>1){let i=e;for(let e=0;e<t.length;e++)"function"==typeof t.getItemAt?this.add(t.getItemAt(e),i++):this.add(t[e],i++)}else for(let e=0;e<t.length;e++)"function"==typeof t.getItemAt?this.add(t.getItemAt(e)):this.add(t[e]);return this}clone(){const t=Object.create(Object.getPrototypeOf(this));return t._collection=this._collection,t}concat(t){return this._collection.concat(t)}destroy(){}every(t){return this._collection.every(t)}filter(t){return this._collection.filter(t)}find(t){return this._collection.find(t)}findIndex(t){return this._collection.findIndex(t)}flatten(t){return this._collection.flatten(t)}forEach(t){return this._collection.forEach(t)}getItemAt(t){return this._collection.getItemAt(t)}includes(t){return this._collection.includes(t)}indexOf(t,e){return this._collection.indexOf(t,e)}join(t){return this._collection.join(t)}lastIndexOf(t,e){return this._collection.lastIndexOf(t,e)}map(t){return this._collection.map(t)}on(t,e){return super.on(t,e)}pop(){return this.removeAt(this.length-1)}push(t){return this.add(t,this.length),this.length}reduce(t,e){return this._collection.reduce(t,e)}reduceRight(t,e){return this._collection.reduceRight(t,e)}remove(t){return this.removeAt(this.indexOf(t))}removeAll(){const t=[];for(;this.length;)t.push(this.pop());return t}removeAt(t){return this._collection.removeAt(t)}removeMany(t){const e=[];for(let i=0;i<t.length;i++){const r="function"==typeof t.getItemAt?t.getItemAt(i):t[i],o=this.indexOf(r);o>=0&&e.push(this.removeAt(o))}return e}reorder(t,e){return this._collection.reorder(t,e)}reverse(){return this._collection.reverse(),this}shift(){return this.removeAt(0)}slice(t,e){return this._collection.slice(t,e)}some(t){return this._collection.some(t)}sort(t){return this._collection.sort(t),this}splice(t,e,...i){const r=[];for(let i=e;i>0;i--)r.push(this.removeAt(t));let o=t;return i.forEach((t=>{this.add(t,o),o++})),r}toArray(){return this._collection.toArray()}unshift(t){return this.add(t,0),this.length}_get(t){throw Error()}_set(t,e){throw Error()}}
1
+ import{Observable as e}from"../support/Observable.js";import{_generateChangeEvent as t}from"./watch.js";export class CollectionProxy extends e{get length(){return this._collection.length}get declaredClass(){return"esri.core.Collection"}get destroyed(){return this._destroyed}set destroyed(e){this._destroyed=e}get initialized(){return this._initialized}set initialized(e){this._initialized=e}get _collection(){if(void 0===this._collectionField)throw new Error("CollectionProxy requires a backing collection.");return this._collectionField}set _collection(e){const t=this._collectionField;this._collectionField=e,this.emit("collection-changed",{newValue:e,oldValue:t}),this.emit("after-add"),this.emit("after-changes"),this.emit("after-remove"),this.emit("before-add"),this.emit("before-changes"),this.emit("before-remove"),this.notifyChange("length")}_destroyed=!1;_initialized=!0;_collectionField;_collectionChangeHandle;constructor(e){super(),this._collectionField=e}*[Symbol.iterator](){for(const e of this._collection)yield e}add(e,t){return this._collection.add(e,t),this}addMany(e,t){if(!e)return this;if(arguments.length>1){let o=t;for(let t=0;t<e.length;t++)"function"==typeof e.getItemAt?this.add(e.getItemAt(t),o++):this.add(e[t],o++)}else for(let t=0;t<e.length;t++)"function"==typeof e.getItemAt?this.add(e.getItemAt(t)):this.add(e[t]);return this}clone(){const e=Object.create(Object.getPrototypeOf(this));return e._collection=this._collection,e}concat(e){return this._collection.concat(e)}destroy(){}every(e){return this._collection.every(e)}filter(e){return this._collection.filter(e)}find(e){return this._collection.find(e)}findIndex(e){return this._collection.findIndex(e)}flatten(e){return this._collection.flatten(e)}forEach(e){return this._collection.forEach(e)}getItemAt(e){return this._collection.getItemAt(e)}includes(e){return this._collection.includes(e)}indexOf(e,t){return this._collection.indexOf(e,t)}join(e){return this._collection.join(e)}lastIndexOf(e,t){return this._collection.lastIndexOf(e,t)}map(e){return this._collection.map(e)}on(e,o){if("collection-changed"===e)return super.on(e,o);{let r=this._collection.on(e,o);const i=[super.on(e,o),super.on("collection-changed",(({newValue:i,oldValue:n})=>{if(r.remove(),r=i.on(e,o),"change"===e){const e=t(n,i);(e?.added.length||e?.removed.length||e?.moved.length)&&o(e)}}))];return{remove:()=>{r.remove();for(const e of i)e.remove()}}}}watch(e,t,o){if((Array.isArray(e)?e:[e]).includes("length")){let r=this._collection.watch(e,t,o);const i=[super.watch(e,t,o),super.on("collection-changed",(({newValue:i})=>{r.remove(),r=i.watch(e,t,o)}))];return{remove:()=>{r.remove();for(const e of i)e.remove()}}}return super.watch(e,t,o)}pop(){return this.removeAt(this.length-1)}push(e){return this.add(e,this.length),this.length}reduce(e,t){return this._collection.reduce(e,t)}reduceRight(e,t){return this._collection.reduceRight(e,t)}remove(e){return this.removeAt(this.indexOf(e))}removeAll(){const e=[];for(;this.length;)e.push(this.pop());return e}removeAt(e){return this._collection.removeAt(e)}removeMany(e){const t=[];for(let o=0;o<e.length;o++){const r="function"==typeof e.getItemAt?e.getItemAt(o):e[o],i=this.indexOf(r);i>=0&&t.push(this.removeAt(i))}return t}reorder(e,t){return this._collection.reorder(e,t)}reverse(){return this._collection.reverse(),this}shift(){return this.removeAt(0)}slice(e,t){return this._collection.slice(e,t)}some(e){return this._collection.some(e)}sort(e){return this._collection.sort(e),this}splice(e,t,...o){const r=[];for(let o=t;o>0;o--)r.push(this.removeAt(e));let i=e;return o.forEach((e=>{this.add(e,i),i++})),r}toArray(){return this._collection.toArray()}unshift(e){return this.add(e,0),this.length}_get(e){throw Error()}_set(e,t){throw Error()}}
@@ -1,12 +1,26 @@
1
- import { ObservableMap } from "./ObservableMap.js";
1
+ import { ObservableMap, type MapChangeEvent } from "./ObservableMap.js";
2
+ import type { WatchCallback } from "./watch.js";
2
3
  /**
3
- * A Map that supports observability.
4
+ * A map that is read-only and delegates operations to an underlying
5
+ * {@link ObservableMap}.
6
+ *
7
+ * @augments {ObservableMap<K, V>}
8
+ * @template K - The type of the keys in the map.
9
+ * @template V - The type of the values in the map.
4
10
  */
5
11
  export declare class ReadOnlyMap<K, V> extends ObservableMap<K, V> {
12
+ /**
13
+ * The underlying map that this object is delegating to.
14
+ */
15
+ protected readonly _originalMap: ObservableMap<K, V>;
6
16
  constructor(originalMap: ObservableMap<K, V>);
7
17
  clear(): void;
8
18
  delete(key: K): boolean;
19
+ emit(type: string, event?: unknown): boolean;
9
20
  set(property: unknown, value: unknown): this;
10
21
  set(properties: unknown): this;
11
22
  set(key: K, value?: V): this;
23
+ notifyChange(propertyKey: keyof this): void;
24
+ on(name: string, callback: (event: MapChangeEvent<K, V>) => void): IHandle;
25
+ watch(path: string | string[], callback: WatchCallback, sync?: boolean): IHandle;
12
26
  }
@@ -1 +1 @@
1
- import{InvalidOperationError as e}from"../InvalidOperationError.js";import{ObservableMap as r}from"./ObservableMap.js";const t="This map is read-only.";export class ReadOnlyMap extends r{constructor(e){super(),this._originalMap=e,e.on("change",(e=>this.emit("change",e))),this.watch("_originalMap.size",(()=>this.notifyChange("size")))}clear(){throw new e(t)}delete(r){throw new e(t)}set(){throw new e(t)}}
1
+ import{InvalidOperationError as r}from"../InvalidOperationError.js";import{ObservableMap as t}from"./ObservableMap.js";const i="This map is read-only.";export class ReadOnlyMap extends t{constructor(r){super(),this._originalMap=r}clear(){throw new r(i)}delete(t){throw new r(i)}emit(r,t){return this._originalMap.emit(r,t)}set(){throw new r(i)}notifyChange(r){this._originalMap.notifyChange(r)}on(r,t){return this._originalMap.on(r,t)}watch(r,t,i){return this._originalMap.watch(r,t,i)}}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * A reference counted handle that can be added and removed multiple times.
3
+ */
4
+ export default class ReferenceCountedHandle {
5
+ private _count;
6
+ private _handle;
7
+ private readonly _getHandle;
8
+ constructor(getHandle: () => IHandle);
9
+ /**
10
+ * Adds a reference to the handle.
11
+ *
12
+ * @returns A handle that can be removed.
13
+ */
14
+ add(): IHandle;
15
+ /**
16
+ * Removes a reference to the handle.
17
+ *
18
+ * @private
19
+ */
20
+ private _remove;
21
+ }
@@ -0,0 +1 @@
1
+ export default class e{_count=0;_handle;_getHandle;constructor(e){this._getHandle=e}add(){null==this._handle&&(this._handle=this._getHandle()),this._count++;let e=!1;return{remove:()=>{e||(this._remove(),e=!0)}}}_remove(){this._count--,0===this._count&&(this._handle?.remove(),this._handle=void 0)}}
@@ -1 +1 @@
1
- import o from"@arcgis/core/core/Collection";import*as e from"@arcgis/core/core/reactiveUtils";import{getPropertyByPath as t}from"../support/Observable.js";import{checkArg as r}from"./checkArg.js";export function onEach(o,e,t){r("collection",o).isNotMissing(),r("eventType",e).isNotMissing().isNotEmpty(),r("callback",t).isNotMissing();const n=new Map;for(const r of o.toArray())n.set(r,r.on(e,t));const s=o.on("change",(o=>{for(const r of o.added)n.set(r,r.on(e,t));for(const e of o.removed){const o=n.get(e);o&&o.remove(),n.delete(e)}}));return{remove:()=>{s.remove(),n.forEach((o=>o.remove()))}}}export function watchEach(o,...t){let n;if(r("collection",o).isNotMissing(),"function"==typeof t[0]){const[o,s,i=!1]=t;r("getValue",o).isNotMissing(),r("callback",s).isNotMissing(),n=t=>e.watch((()=>o(t)),((o,e)=>s(o,e,t)),{sync:i})}else{const[o,e,s=!1]=t;r("path",o).isNotMissing().isNotEmpty(),r("callback",e).isNotMissing(),n=t=>t.watch(o,e,s)}const s=new Map;for(const e of"function"==typeof o.toArray?o.toArray():[...o.values()])s.set(e,n(e));const i=o.on("change",(o=>{for(const e of o.added){const o=Array.isArray(e)?e[1]:e;s.set(o,n(o))}for(const e of o.removed){const o=Array.isArray(e)?e[1]:e,t=s.get(o);t&&t.remove(),s.delete(o)}}));return{remove:()=>{i.remove(),s.forEach((o=>o.remove()))}}}export function watchCollectionPropertyEach(o,e,n,s,i=!1){r("obj",o).isNotMissing(),r("collectionProperty",e).isNotMissing().isNotEmpty(),r("path",n).isNotMissing().isNotEmpty(),r("callback",s).isNotMissing();const c=new Map,a=t(o,e);if(a)for(const o of a.toArray())c.set(o,o.watch(n,s,i));const l=onCollectionPropertyChange(o,e,(o=>{for(const e of o.added)c.set(e,e.watch(n,s,i));for(const e of o.removed){const o=c.get(e);o&&o.remove(),c.delete(e)}}),i);return{remove:()=>{l.remove(),c.forEach((o=>o.remove()))}}}export function onCollectionPropertyChange(e,n,s,i=!1){let c;r("obj",e).isNotMissing(),r("property",n).isNotMissing().isNotEmpty(),r("callback",s).isNotMissing();const a=t(e,n);a&&(c=a.on("change",s));const l=e.watch(n,((e,t)=>{c&&(c.remove(),c=void 0),e&&(c=e.on("change",s));const r=e??new o,n=t??new o,i=r,a=r.filter((o=>n.includes(o))),l=n.filter((o=>r.includes(o))),f={added:r.filter((o=>!n.includes(o))).toArray(),removed:n.filter((o=>!r.includes(o))).toArray(),moved:a.filter(((o,e)=>l.indexOf(o)!==e)).toArray(),target:i};(f.added.length||f.removed.length||f.moved.length)&&s(f)}),i);return{remove:()=>{c&&c.remove(),l.remove()}}}export function onOnce(o,e,t){const r=o.on(e,(o=>{t(o),r.remove()}));return r}
1
+ import o from"@arcgis/core/core/Collection";import*as e from"@arcgis/core/core/reactiveUtils";import{getPropertyByPath as t}from"../support/Observable.js";import{checkArg as n}from"./checkArg.js";export function onEach(o,e,t){n("collection",o).isNotMissing(),n("eventType",e).isNotMissing().isNotEmpty(),n("callback",t).isNotMissing();const r=new Map;for(const n of o.toArray())r.set(n,n.on(e,t));const s=o.on("change",(o=>{for(const n of o.added)r.set(n,n.on(e,t));for(const e of o.removed){const o=r.get(e);o&&o.remove(),r.delete(e)}}));return{remove:()=>{s.remove(),r.forEach((o=>o.remove()))}}}export function watchEach(o,...t){let r;if(n("collection",o).isNotMissing(),"function"==typeof t[0]){const[o,s,i=!1]=t;n("getValue",o).isNotMissing(),n("callback",s).isNotMissing(),r=t=>e.watch((()=>o(t)),((o,e)=>s(o,e,t)),{sync:i})}else{const[o,e,s=!1]=t;n("path",o).isNotMissing().isNotEmpty(),n("callback",e).isNotMissing(),r=t=>t.watch(o,e,s)}const s=new Map;for(const e of"function"==typeof o.toArray?o.toArray():[...o.values()])s.set(e,r(e));const i=o.on("change",(o=>{for(const e of o.added){const o=Array.isArray(e)?e[1]:e;s.set(o,r(o))}for(const e of o.removed){const o=Array.isArray(e)?e[1]:e,t=s.get(o);t&&t.remove(),s.delete(o)}}));return{remove:()=>{i.remove(),s.forEach((o=>o.remove()))}}}export function watchCollectionPropertyEach(o,e,r,s,i=!1){n("obj",o).isNotMissing(),n("collectionProperty",e).isNotMissing().isNotEmpty(),n("path",r).isNotMissing().isNotEmpty(),n("callback",s).isNotMissing();const c=new Map,a=t(o,e);if(a)for(const o of a.toArray())c.set(o,o.watch(r,s,i));const l=onCollectionPropertyChange(o,e,(o=>{for(const e of o.added)c.set(e,e.watch(r,s,i));for(const e of o.removed){const o=c.get(e);o&&o.remove(),c.delete(e)}}),i);return{remove:()=>{l.remove(),c.forEach((o=>o.remove()))}}}export function onCollectionPropertyChange(o,e,r,s=!1){let i;n("obj",o).isNotMissing(),n("property",e).isNotMissing().isNotEmpty(),n("callback",r).isNotMissing();const c=t(o,e);c&&(i=c.on("change",r));const a=o.watch(e,((o,e)=>{i&&(i.remove(),i=void 0),o&&(i=o.on("change",r));const t=_generateChangeEvent(e,o);(t?.added.length||t?.removed.length||t?.moved.length)&&r(t)}),s);return{remove:()=>{i&&i.remove(),a.remove()}}}export function _generateChangeEvent(e,t){const n=t??new o,r=e??new o,s=n,i=n.filter((o=>r.includes(o))),c=r.filter((o=>n.includes(o))),a={added:n.filter((o=>!r.includes(o))).toArray(),removed:r.filter((o=>!n.includes(o))).toArray(),moved:i.filter(((o,e)=>c.indexOf(o)!==e)).toArray(),target:s};if(a.added.length||a.removed.length||a.moved.length)return a}export function onOnce(o,e,t){const n=o.on(e,(o=>{t(o),n.remove()}));return n}
package/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * The current version of the Geocortex ArcGIS Extensions API.
3
3
  */
4
- export declare const version = "48.8.0";
4
+ export declare const version = "48.9.0";
package/version.js CHANGED
@@ -1 +1 @@
1
- export const version="48.8.0";
1
+ export const version="48.9.0";