@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.
- package/data/Feature.d.ts +1 -0
- package/data/Feature.js +1 -1
- package/data/FeatureSettings.d.ts +1 -1
- package/data/FeatureSettings.js +1 -1
- package/data/FeatureSourceBase.d.ts +4 -2
- package/data/FeatureSourceBase.js +1 -1
- package/data/FieldExtension.d.ts +3 -0
- package/data/FieldExtension.js +1 -1
- package/data/Schema.js +1 -1
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/data_FeatureList.FeatureList.html +3 -2
- package/docs/html/classes/data_FeatureSourceBase.FeatureSourceBase.html +3 -2
- package/docs/html/classes/data_FeatureSourceBase.RelationshipCollection.html +3 -2
- package/docs/html/classes/data_FieldExtension.FieldExtension.html +4 -4
- package/docs/html/classes/mapping_ArcGISSublayerExtension.ArcGISSublayerRelationshipCollection.html +3 -2
- package/docs/html/classes/mapping_GraphicsLayerExtension.GraphicsLayerExtension.html +3 -2
- package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtension.html +3 -2
- package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtensionCollection.html +3 -2
- package/docs/html/classes/mapping_MapNotesLayerExtension.MapNotesLayerExtension.html +3 -2
- package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerRelationshipCollection.html +3 -2
- package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerRelationshipCollection.html +3 -2
- package/docs/html/classes/mapping_UnsupportedLayerExtension.UnsupportedLayerExtension.html +3 -2
- package/docs/html/classes/mapping_WMSLayerExtension.WMSLayerExtension.html +3 -2
- package/docs/html/classes/mapping_WMTSLayerExtension.WMTSLayerExtension.html +3 -2
- package/docs/html/classes/mapping__LayerExtension.LayerExtension.html +3 -2
- package/docs/html/classes/mapping__LayerExtensionCollectionImpl.LayerExtensionCollectionImpl.html +3 -2
- package/docs/html/classes/mapping__SublayerExtension.SubSublayerExtensionCollection.html +3 -2
- package/docs/html/classes/mapping_support_ArrayWrappedCollection.ArrayWrappedCollection.html +3 -2
- package/docs/html/classes/mapping_support__LayerExtensionCollection.LayerExtensionCollectionBase.html +3 -2
- package/docs/html/classes/mapping_support__SublayerExtensionCollection.SublayerExtensionCollectionBase.html +3 -2
- package/docs/html/classes/support_InitializableCollectionProxy.InitializableCollectionProxy.html +3 -2
- package/docs/html/classes/support_ReadOnlyInitializableCollection.ReadOnlyInitializableCollection.html +3 -2
- package/docs/html/classes/support__ArcGISRelationshipCollection.ArcGISRelationshipCollection.html +3 -2
- package/docs/html/classes/tasks_geocoding_Geocoder.Geocoder.html +3 -2
- package/docs/html/classes/utilities_CollectionProxy.CollectionProxy.html +4 -3
- package/docs/html/classes/utilities_CopyOnWriteCollection.CopyOnWriteCollection.html +3 -2
- package/docs/html/classes/utilities_MapTransformCollection.MapTransformCollection.html +3 -2
- package/docs/html/classes/utilities_ReadOnlyCollection.ReadOnlyCollection.html +3 -2
- package/docs/html/classes/utilities_ReadOnlyMap.ReadOnlyMap.html +21 -15
- package/docs/html/classes/utilities__ReferenceCountedHandle.default.html +6 -0
- package/docs/html/interfaces/data_Feature.PresentableAttributes.html +9 -6
- package/docs/html/modules/utilities__ReferenceCountedHandle.html +2 -0
- package/docs/html/modules.html +1 -0
- package/docs/html/types/support_esri.WatchCallback.html +1 -1
- package/docs/html/variables/version.version.html +1 -1
- package/package.json +1 -1
- package/support/Observable.js +1 -1
- package/support/Settings.d.ts +0 -1
- package/support/Settings.js +1 -1
- package/support/esri.d.ts +1 -1
- package/utilities/CollectionProxy.d.ts +13 -5
- package/utilities/CollectionProxy.js +1 -1
- package/utilities/ReadOnlyMap.d.ts +16 -2
- package/utilities/ReadOnlyMap.js +1 -1
- package/utilities/_ReferenceCountedHandle.d.ts +21 -0
- package/utilities/_ReferenceCountedHandle.js +1 -0
- package/utilities/watch.js +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Observable as
|
|
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
|
|
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
|
}
|
package/utilities/ReadOnlyMap.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{InvalidOperationError as
|
|
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)}}
|
package/utilities/watch.js
CHANGED
|
@@ -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
|
|
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
package/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version="48.
|
|
1
|
+
export const version="48.9.0";
|