@arcgis/core 5.2.0-next.169 → 5.2.0-next.170
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/18e7fa4d3e0b1a084cc6.js +1 -0
- package/assets/esri/core/workers/chunks/6de64abd9e2b51fa2872.js +1 -0
- package/assets/esri/core/workers/chunks/7697bbbaf3724f8c4445.js +1 -0
- package/assets/esri/core/workers/chunks/86524ae8926228898d95.js +1 -0
- package/assets/esri/core/workers/chunks/{1b24a40c0fa197014873.js → 9c33e67bb6f93f6529bb.js} +1 -1
- package/assets/esri/core/workers/chunks/b71029a2ab7dbb3706f9.js +1 -0
- package/assets/esri/core/workers/chunks/b7c4bb0f3f9662bac726.js +1 -0
- package/assets/esri/core/workers/chunks/bc6fdd9faf8ed54be0cb.js +1 -0
- package/assets/esri/core/workers/chunks/bec375ff37c25a49e080.js +1 -0
- package/assets/esri/views/3d/environment/resources/milkyway-band.avif +0 -0
- package/chunks/EmissionComposite.glsl.js +1 -1
- package/chunks/Fog.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +176 -95
- package/config.d.ts +12 -9
- package/config.js +1 -1
- package/core/Collection.js +1 -1
- package/form/FormTemplate.d.ts +1 -1
- package/form/elements/AttachmentElement.d.ts +2 -0
- package/form/elements/FieldElement.d.ts +2 -2
- package/form/elements/FieldElement.js +1 -1
- package/form/elements/RelationshipElement.d.ts +1 -1
- package/form/elements/TextElement.d.ts +2 -2
- package/form/elements/UtilityNetworkAssociationsElement.d.ts +1 -1
- package/form/elements/inputs/inputUtils.js +1 -1
- package/form/elements/inputs/types.d.ts +19 -0
- package/form/elements/inputs.d.ts +3 -2
- package/form/elements/inputs.js +1 -1
- package/kernel.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/save/parquetLayerUtils.js +1 -1
- package/package.json +2 -2
- package/rest/route.d.ts +1 -1
- package/rest/support/AreasAndLengthsParameters.d.ts +1 -1
- package/rest/support/LengthsParameters.d.ts +1 -1
- package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
- package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
- package/views/3d/terrain/ExtentHelper.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +3 -3
- package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/EmissiveTechniqueConfiguration.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/layers/LayerView.d.ts +10 -2
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +2 -2
- package/widgets/Editor/EditorViewModel.d.ts +10 -12
- package/widgets/FeatureTable/support/EditableColumnTemplateMixin.js +1 -1
- package/widgets/HistogramRangeSlider.d.ts +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/assets/esri/core/workers/chunks/6f897b4e7ddd1dd1672b.js +0 -1
- package/assets/esri/core/workers/chunks/9e04703ee5f5ec47db43.js +0 -1
- package/assets/esri/core/workers/chunks/9f358c7b052cdc0ac06f.js +0 -1
- package/assets/esri/core/workers/chunks/a43b33955aa78a2a8deb.js +0 -1
- package/assets/esri/core/workers/chunks/b5b9d42e1f84ee82429c.js +0 -1
- package/assets/esri/core/workers/chunks/c9feffb9884cfed52c4b.js +0 -1
- package/assets/esri/core/workers/chunks/cdacc3e42f01c3b852d6.js +0 -1
- package/assets/esri/core/workers/chunks/feb6e041dd0aa1c59c31.js +0 -1
- package/layers/geospatialPDF/CIM2DLayerview.js +0 -2
package/core/Collection.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"./ArrayPool.js";import{isArrayWithReadonly as n}from"./arrayUtils.js";import{EventedAccessor as r}from"./Evented.js";import{makeHandle as i}from"./handleUtils.js";import{clone as a}from"./lang.js";import o from"./Logger.js";import s from"./ObjectPool.js";import{schedule as c}from"./scheduling.js";import{ensureType as l,ensureOneOfType as u}from"./accessorSupport/ensureType.js";import{trackAccess as d}from"./accessorSupport/tracking.js";import{property as f}from"./accessorSupport/decorators/property.js";import{shared as p}from"./accessorSupport/decorators/shared.js";import{subclass as m}from"./accessorSupport/decorators/subclass.js";import{SimpleObservable as h}from"./accessorSupport/tracking/SimpleObservable.js";import{isSerializable as g}from"./support/jsonUtils.js";var _;class v{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}}class y{constructor(e,t,n,r,i){this.target=e,this.added=t,this.removed=n,this.start=r,this.deleteCount=i}}const b=new s(()=>new v,void 0,e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1});function x(e){e&&typeof e==`object`&&`destroy`in e&&typeof e.destroy==`function`&&e.destroy()}function S(e){return e?e instanceof j?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function C(e){if(e?.length)return e[0]}function w(e,t,n,r){let i=Math.min(e.length-n,t.length-r),a=0;for(;a<i&&e[n+a]===t[r+a];)a++;return a}function T(e,t,n,r){t&&t.forEach((t,i,a)=>{e.push(t),T(e,n.call(r,t,i,a),n,r)})}const E=new Set,D=new Set,O=new Set,k=new Map;let A=0,j=_=class extends r{static ofType(t){if(!t)return _;if(k.has(t))return k.get(t);let n=null;if(typeof t==`function`)n=t.prototype.declaredClass;else if(t.base)n=t.base.prototype.declaredClass;else for(let e in t.typeMap){let r=t.typeMap[e].prototype.declaredClass;n?n+=` | ${r}`:n=r}let r=class extends _{};return e([p({Type:t,ensureType:typeof t==`function`?l(t):u(t)})],r.prototype,`itemType`,void 0),r=e([m(`esri.core.Collection<${n}>`)],r),k.set(t,r),r}static isCollection(e){return e!=null&&e instanceof _}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new h,this._length=0,this._items=[],Object.defineProperty(this,"uid",{value:A++})}normalizeCtorArgs(e){return e?n(e)||e instanceof _?{items:e}:e:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),super.destroy(),this._notifications=null}*[Symbol.iterator](){yield*this.items}get length(){return this._length}set length(e){if(e>this._length){o.getLogger(this).error(`#length=`,`Cannot increase the length of the collection by assigning to the length property.`);return}this.splice(e,Math.max(0,this._length-e))}get items(){return d(this._observable),this._items}set items(e){this._emitBeforeChanges(1)||(this._splice(0,this.length,S(e)),this._emitAfterChanges(1))}hasEventListener(e){return this.destroyed?!1:e===`change`?this._chgListeners.length>0:super.hasEventListener(e)}on(e,t){if(this.destroyed)return i();if(e===`change`){let e=this._chgListeners,n={removed:!1,callback:t};return e.push(n),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),i(()=>{n.removed=!0,e.splice(e.indexOf(n),1)})}return super.on(e,t)}once(e,t){let n=`deref`in t?()=>t.deref():()=>t,r=this.on(e,e=>{n()?.call(null,e),r.remove()});return r}add(e,t){if(d(this._observable),this._emitBeforeChanges(1))return this;let n=this.getNextIndex(t??null);return this._splice(n,0,[e]),this._emitAfterChanges(1),this}addMany(e,t=this._items.length){if(d(this._observable),!e?.length||this._emitBeforeChanges(1))return this;let n=this.getNextIndex(t);return this._splice(n,0,S(e)),this._emitAfterChanges(1),this}at(e){if(d(this._observable),e=Math.trunc(e)||0,e<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if(d(this._observable),!this.length||this._emitBeforeChanges(2))return[];let e=this._removeAllRaw();return this._emitAfterChanges(2),e}_removeAllRaw(){return this.length===0?[]:this._splice(0,this.length)||[]}clone(){return d(this._observable),this._createNewInstance({items:this._items.map(a)})}concat(...e){d(this._observable);let t=e.map(S);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if(d(this._observable),!this.length||this._emitBeforeChanges(2))return;let n=this._splice(0,this.length),r=n.length;for(let i=0;i<r;i++)e.call(t,n[i],i,n);this._emitAfterChanges(2)}destroyAll(){this.drain(x)}destroyMany(e){let t=this.removeMany(e);return t.forEach(x),t}every(e,t){return d(this._observable),this._items.every(e,t)}filter(e,t){d(this._observable);let n=arguments.length===2?this._items.filter(e,t):this._items.filter(e);return this._createNewInstance({items:n})}find(e,t){return d(this._observable),this._items.find(e,t)}findIndex(e,t){return d(this._observable),this._items.findIndex(e,t)}findLast(e,t){return d(this._observable),this._items.findLast(e,t)}findLastIndex(e,t){return d(this._observable),this._items.findLastIndex(e,t)}flatten(e,t){d(this._observable);let n=[];return T(n,this,e,t),new _(n)}forEach(e,t){return d(this._observable),this._items.forEach(e,t)}getItemAt(e){return d(this._observable),this._items[e]}getNextIndex(e){d(this._observable);let t=this.length;return e??=t,e<0?e=0:e>t&&(e=t),e}includes(e,t=0){return d(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return d(this._observable),this._items.indexOf(e,t)}join(e=`,`){return d(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return d(this._observable),this._items.lastIndexOf(e,t)}map(e,t){d(this._observable);let n=this._items.map(e,t);return new _({items:n})}reorder(e,t=this.length-1){d(this._observable);let n=this.indexOf(e);if(n!==-1){if(t<0?t=0:t>=this.length&&(t=this.length-1),n!==t){if(this._emitBeforeChanges(4))return e;this._splice(n,1),this._splice(t,0,[e]),this._emitAfterChanges(4)}return e}}pop(){if(d(this._observable),!this.length||this._emitBeforeChanges(2))return;let e=C(this._splice(this.length-1,1));return this._emitAfterChanges(2),e}push(...e){return d(this._observable),this._emitBeforeChanges(1)?this.length:(this._splice(this.length,0,e),this._emitAfterChanges(1),this.length)}reduce(e,t){d(this._observable);let n=this._items;return arguments.length===2?n.reduce(e,t):n.reduce(e)}reduceRight(e,t){d(this._observable);let n=this._items;return arguments.length===2?n.reduceRight(e,t):n.reduceRight(e)}remove(e){return d(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if(d(this._observable),e<0||e>=this.length||this._emitBeforeChanges(2))return;let t=C(this._splice(e,1));return this._emitAfterChanges(2),t}removeMany(e){if(d(this._observable),!e?.length||this._emitBeforeChanges(2))return[];let t=e instanceof _?e.toArray():e,n=this._items,r=[],i=t.length;for(let e=0;e<i;e++){let i=t[e],a=n.indexOf(i);if(a>-1){let i=1+w(t,n,e+1,a+1),o=this._splice(a,i);o&&o.length>0&&r.push.apply(r,o),e+=i-1}}return this._emitAfterChanges(2),r}reverse(){if(d(this._observable),this._emitBeforeChanges(4))return this;let e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(4),this}shift(){if(d(this._observable),!this.length||this._emitBeforeChanges(2))return;let e=C(this._splice(0,1));return this._emitAfterChanges(2),e}slice(e=0,t=this.length){return d(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return d(this._observable),this._items.some(e,t)}sort(e){if(d(this._observable),!this.length||this._emitBeforeChanges(4)||!this._requiresSort(e))return this;let t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(4),this}_requiresSort(e=(e,t)=>e===t?0:e<t?-1:1){let t=this.length-1;for(let n=0;n<t;n++){let t=this.items[n],r=this.items[n+1];if(e(t,r)>0)return!0}return!1}splice(e,t,...n){d(this._observable),arguments.length===1&&(t=this.length),t??=0;let r=(t?2:0)|!!n.length;if(this._emitBeforeChanges(r))return[];let i=this._splice(e,t,n)||[];return this._emitAfterChanges(r),i}toArray(){return d(this._observable),this._items.slice()}toJSON(e){return d(this._observable),this.toArray().map(t=>g(t)?t.toJSON(e):t)}toLocaleString(){return d(this._observable),this._items.toLocaleString()}toString(){return d(this._observable),this._items.toString()}unshift(...e){return d(this._observable),!e.length||this._emitBeforeChanges(1)?this.length:(this._splice(0,0,e),this._emitAfterChanges(1),this.length)}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,n){let r=this._items,i=this.itemType,a,o;if(!this._notifications&&this.hasEventListener(`change`)&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=c(()=>this._dispatchChange())),e<0&&(e+=this.length),t){if(o=r.splice(e,t),this.hasEventListener(`before-remove`)){let t=b.acquire();t.target=this,t.cancellable=!0;for(let n=0,i=o.length;n<i;n++)a=o[n],t.reset(a),this.emit(`before-remove`,t),t.defaultPrevented&&(o.splice(n,1),r.splice(e,0,a),e+=1,--n,--i);b.release(t)}if(this._length=this._items.length,this.hasEventListener(`after-remove`)){let e=b.acquire();e.target=this,e.cancellable=!1;let t=o.length;for(let n=0;n<t;n++)e.reset(o[n]),this.emit(`after-remove`,e);b.release(e)}}if(n?.length){if(i){let e=[];for(let t of n){let n=i.ensureType(t);(n!=null||t==null)&&e.push(n)}n=e}let t=this.hasEventListener(`before-add`),a=this.hasEventListener(`after-add`),o=e===this.length;if(t||a){let i=b.acquire();i.target=this,i.cancellable=!0;let s=b.acquire();s.target=this,s.cancellable=!1;for(let c of n)t?(i.reset(c),this.emit(`before-add`,i),i.defaultPrevented||(o?r.push(c):r.splice(e++,0,c),this._length=r.length,a&&(s.reset(c),this.emit(`after-add`,s)))):(o?r.push(c):r.splice(e++,0,c),this._length=r.length,s.reset(c),this.emit(`after-add`,s));b.release(s),b.release(i)}else{if(o)for(let e of n)r.push(e);else r.splice(e,0,...n);this._length=r.length}}if((n?.length||o?.length)&&this._notifyChangeEvent(n,o),this.hasEventListener(`after-splice`)){let r=new y(this,n,o,e,t);this.emit(`after-splice`,r)}return o}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener(`before-changes`)){let n=b.acquire();n.target=this,n.cancellable=!0,n.type=e,this.emit(`before-changes`,n),t=n.defaultPrevented,b.release(n)}return t}_emitAfterChanges(e){if(this.hasEventListener(`after-changes`)){let t=b.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit(`after-changes`,t),b.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener(`change`)&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&=(this._timer.remove(),null),this._updating=!1,!this._notifications)return;let e=this._notifications;this._notifications=null;for(let n of e){let e=n.changes;E.clear(),D.clear(),O.clear();for(let{added:t,removed:n}of e){if(t){if(O.size===0&&D.size===0)for(let e of t)E.add(e);else for(let e of t)D.has(e)?(O.add(e),D.delete(e)):O.has(e)||E.add(e)}if(n){if(O.size===0&&E.size===0)for(let e of n)D.add(e);else for(let e of n)E.has(e)?E.delete(e):(O.delete(e),D.add(e))}}let r=t.acquire();E.forEach(e=>{r.push(e)});let i=t.acquire();D.forEach(e=>{i.push(e)});let a=this._items,o=n.items,s=t.acquire();if(O.forEach(e=>{o.indexOf(e)!==a.indexOf(e)&&s.push(e)}),n.listeners&&(r.length||i.length||s.length)){let e={target:this,added:r,removed:i,moved:s},t=n.listeners.length;for(let r=0;r<t;r++){let t=n.listeners[r];t.removed||t.callback.call(this,e)}}t.release(r),t.release(i),t.release(s)}E.clear(),D.clear(),O.clear()}};e([f()],j.prototype,`_updating`,void 0),e([f()],j.prototype,`_length`,void 0),e([f()],j.prototype,`length`,null),e([f()],j.prototype,`items`,null),e([f({readOnly:!0})],j.prototype,`updating`,null),j=_=e([m(`esri.core.Collection`)],j);const M=j;export{M as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"./ArrayPool.js";import{isArrayWithReadonly as n}from"./arrayUtils.js";import{EventedAccessor as r}from"./Evented.js";import{makeHandle as i}from"./handleUtils.js";import{clone as a}from"./lang.js";import o from"./Logger.js";import s from"./ObjectPool.js";import{schedule as c}from"./scheduling.js";import{ensureType as l,ensureOneOfType as u}from"./accessorSupport/ensureType.js";import{trackAccess as d}from"./accessorSupport/tracking.js";import{property as f}from"./accessorSupport/decorators/property.js";import{shared as p}from"./accessorSupport/decorators/shared.js";import{subclass as m}from"./accessorSupport/decorators/subclass.js";import{SimpleObservable as h}from"./accessorSupport/tracking/SimpleObservable.js";import{isSerializable as g}from"./support/jsonUtils.js";var _;class v{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}}class y{constructor(e,t,n,r,i){this.target=e,this.added=t,this.removed=n,this.start=r,this.deleteCount=i}}const b=new s(()=>new v,void 0,e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1});function x(e){e&&typeof e==`object`&&`destroy`in e&&typeof e.destroy==`function`&&e.destroy()}function S(e){return e?e instanceof j?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function C(e){if(e?.length)return e[0]}function w(e,t,n,r){let i=Math.min(e.length-n,t.length-r),a=0;for(;a<i&&e[n+a]===t[r+a];)a++;return a}function T(e,t,n,r){t&&t.forEach((t,i,a)=>{e.push(t),T(e,n.call(r,t,i,a),n,r)})}const E=new Set,D=new Set,O=new Set,k=new Map;let A=0,j=_=class extends r{static ofType(t){if(!t)return _;if(k.has(t))return k.get(t);let n=null;if(typeof t==`function`)n=t.prototype.declaredClass;else if(t.base)n=t.base.prototype.declaredClass;else for(let e in t.typeMap){let r=t.typeMap[e].prototype.declaredClass;n?n+=` | ${r}`:n=r}let r=class extends _{};return e([p({Type:t,ensureType:typeof t==`function`?l(t):u(t)})],r.prototype,`itemType`,void 0),r=e([m(`esri.core.Collection<${n}>`)],r),k.set(t,r),r}static isCollection(e){return e!=null&&e instanceof _}constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._updating=!1,this._timer=null,this._observable=new h,this._length=0,this._items=[],Object.defineProperty(this,"uid",{value:A++})}normalizeCtorArgs(e){return e?n(e)||e instanceof _?{items:e}:e:{}}destroy(){this._removeAllRaw(),this._timer&&this._timer.remove(),super.destroy(),this._notifications=null}[Symbol.iterator](){return this.items.values()}get length(){return this._length}set length(e){if(e>this._length){o.getLogger(this).error(`#length=`,`Cannot increase the length of the collection by assigning to the length property.`);return}this.splice(e,Math.max(0,this._length-e))}get items(){return d(this._observable),this._items}set items(e){this._emitBeforeChanges(1)||(this._splice(0,this.length,S(e)),this._emitAfterChanges(1))}hasEventListener(e){return this.destroyed?!1:e===`change`?this._chgListeners.length>0:super.hasEventListener(e)}on(e,t){if(this.destroyed)return i();if(e===`change`){let e=this._chgListeners,n={removed:!1,callback:t};return e.push(n),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),i(()=>{n.removed=!0,e.splice(e.indexOf(n),1)})}return super.on(e,t)}once(e,t){let n=`deref`in t?()=>t.deref():()=>t,r=this.on(e,e=>{n()?.call(null,e),r.remove()});return r}add(e,t){if(d(this._observable),this._emitBeforeChanges(1))return this;let n=this.getNextIndex(t??null);return this._splice(n,0,[e]),this._emitAfterChanges(1),this}addMany(e,t=this._items.length){if(d(this._observable),!e?.length||this._emitBeforeChanges(1))return this;let n=this.getNextIndex(t);return this._splice(n,0,S(e)),this._emitAfterChanges(1),this}at(e){if(d(this._observable),e=Math.trunc(e)||0,e<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if(d(this._observable),!this.length||this._emitBeforeChanges(2))return[];let e=this._removeAllRaw();return this._emitAfterChanges(2),e}_removeAllRaw(){return this.length===0?[]:this._splice(0,this.length)||[]}clone(){return d(this._observable),this._createNewInstance({items:this._items.map(a)})}concat(...e){d(this._observable);let t=e.map(S);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if(d(this._observable),!this.length||this._emitBeforeChanges(2))return;let n=this._splice(0,this.length),r=n.length;for(let i=0;i<r;i++)e.call(t,n[i],i,n);this._emitAfterChanges(2)}destroyAll(){this.drain(x)}destroyMany(e){let t=this.removeMany(e);return t.forEach(x),t}every(e,t){return d(this._observable),this._items.every(e,t)}filter(e,t){d(this._observable);let n=arguments.length===2?this._items.filter(e,t):this._items.filter(e);return this._createNewInstance({items:n})}find(e,t){return d(this._observable),this._items.find(e,t)}findIndex(e,t){return d(this._observable),this._items.findIndex(e,t)}findLast(e,t){return d(this._observable),this._items.findLast(e,t)}findLastIndex(e,t){return d(this._observable),this._items.findLastIndex(e,t)}flatten(e,t){d(this._observable);let n=[];return T(n,this,e,t),new _(n)}forEach(e,t){return d(this._observable),this._items.forEach(e,t)}getItemAt(e){return d(this._observable),this._items[e]}getNextIndex(e){d(this._observable);let t=this.length;return e??=t,e<0?e=0:e>t&&(e=t),e}includes(e,t=0){return d(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return d(this._observable),this._items.indexOf(e,t)}join(e=`,`){return d(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return d(this._observable),this._items.lastIndexOf(e,t)}map(e,t){d(this._observable);let n=this._items.map(e,t);return new _({items:n})}reorder(e,t=this.length-1){d(this._observable);let n=this.indexOf(e);if(n!==-1){if(t<0?t=0:t>=this.length&&(t=this.length-1),n!==t){if(this._emitBeforeChanges(4))return e;this._splice(n,1),this._splice(t,0,[e]),this._emitAfterChanges(4)}return e}}pop(){if(d(this._observable),!this.length||this._emitBeforeChanges(2))return;let e=C(this._splice(this.length-1,1));return this._emitAfterChanges(2),e}push(...e){return d(this._observable),this._emitBeforeChanges(1)?this.length:(this._splice(this.length,0,e),this._emitAfterChanges(1),this.length)}reduce(e,t){d(this._observable);let n=this._items;return arguments.length===2?n.reduce(e,t):n.reduce(e)}reduceRight(e,t){d(this._observable);let n=this._items;return arguments.length===2?n.reduceRight(e,t):n.reduceRight(e)}remove(e){return d(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if(d(this._observable),e<0||e>=this.length||this._emitBeforeChanges(2))return;let t=C(this._splice(e,1));return this._emitAfterChanges(2),t}removeMany(e){if(d(this._observable),!e?.length||this._emitBeforeChanges(2))return[];let t=e instanceof _?e.toArray():e,n=this._items,r=[],i=t.length;for(let e=0;e<i;e++){let i=t[e],a=n.indexOf(i);if(a>-1){let i=1+w(t,n,e+1,a+1),o=this._splice(a,i);o&&o.length>0&&r.push.apply(r,o),e+=i-1}}return this._emitAfterChanges(2),r}reverse(){if(d(this._observable),this._emitBeforeChanges(4))return this;let e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(4),this}shift(){if(d(this._observable),!this.length||this._emitBeforeChanges(2))return;let e=C(this._splice(0,1));return this._emitAfterChanges(2),e}slice(e=0,t=this.length){return d(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return d(this._observable),this._items.some(e,t)}sort(e){if(d(this._observable),!this.length||this._emitBeforeChanges(4)||!this._requiresSort(e))return this;let t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(4),this}_requiresSort(e=(e,t)=>e===t?0:e<t?-1:1){let t=this.length-1;for(let n=0;n<t;n++){let t=this.items[n],r=this.items[n+1];if(e(t,r)>0)return!0}return!1}splice(e,t,...n){d(this._observable),arguments.length===1&&(t=this.length),t??=0;let r=(t?2:0)|!!n.length;if(this._emitBeforeChanges(r))return[];let i=this._splice(e,t,n)||[];return this._emitAfterChanges(r),i}toArray(){return d(this._observable),this._items.slice()}toJSON(e){return d(this._observable),this.toArray().map(t=>g(t)?t.toJSON(e):t)}toLocaleString(){return d(this._observable),this._items.toLocaleString()}toString(){return d(this._observable),this._items.toString()}unshift(...e){return d(this._observable),!e.length||this._emitBeforeChanges(1)?this.length:(this._splice(0,0,e),this._emitAfterChanges(1),this.length)}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,n){let r=this._items,i=this.itemType,a,o;if(!this._notifications&&this.hasEventListener(`change`)&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._updating=!0,this._timer=c(()=>this._dispatchChange())),e<0&&(e+=this.length),t){if(o=r.splice(e,t),this.hasEventListener(`before-remove`)){let t=b.acquire();t.target=this,t.cancellable=!0;for(let n=0,i=o.length;n<i;n++)a=o[n],t.reset(a),this.emit(`before-remove`,t),t.defaultPrevented&&(o.splice(n,1),r.splice(e,0,a),e+=1,--n,--i);b.release(t)}if(this._length=this._items.length,this.hasEventListener(`after-remove`)){let e=b.acquire();e.target=this,e.cancellable=!1;let t=o.length;for(let n=0;n<t;n++)e.reset(o[n]),this.emit(`after-remove`,e);b.release(e)}}if(n?.length){if(i){let e=[];for(let t of n){let n=i.ensureType(t);(n!=null||t==null)&&e.push(n)}n=e}let t=this.hasEventListener(`before-add`),a=this.hasEventListener(`after-add`),o=e===this.length;if(t||a){let i=b.acquire();i.target=this,i.cancellable=!0;let s=b.acquire();s.target=this,s.cancellable=!1;for(let c of n)t?(i.reset(c),this.emit(`before-add`,i),i.defaultPrevented||(o?r.push(c):r.splice(e++,0,c),this._length=r.length,a&&(s.reset(c),this.emit(`after-add`,s)))):(o?r.push(c):r.splice(e++,0,c),this._length=r.length,s.reset(c),this.emit(`after-add`,s));b.release(s),b.release(i)}else{if(o)for(let e of n)r.push(e);else r.splice(e,0,...n);this._length=r.length}}if((n?.length||o?.length)&&this._notifyChangeEvent(n,o),this.hasEventListener(`after-splice`)){let r=new y(this,n,o,e,t);this.emit(`after-splice`,r)}return o}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener(`before-changes`)){let n=b.acquire();n.target=this,n.cancellable=!0,n.type=e,this.emit(`before-changes`,n),t=n.defaultPrevented,b.release(n)}return t}_emitAfterChanges(e){if(this.hasEventListener(`after-changes`)){let t=b.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit(`after-changes`,t),b.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener(`change`)&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}get updating(){return this._updating}_dispatchChange(){if(this._timer&&=(this._timer.remove(),null),this._updating=!1,!this._notifications)return;let e=this._notifications;this._notifications=null;for(let n of e){let e=n.changes;E.clear(),D.clear(),O.clear();for(let{added:t,removed:n}of e){if(t){if(O.size===0&&D.size===0)for(let e of t)E.add(e);else for(let e of t)D.has(e)?(O.add(e),D.delete(e)):O.has(e)||E.add(e)}if(n){if(O.size===0&&E.size===0)for(let e of n)D.add(e);else for(let e of n)E.has(e)?E.delete(e):(O.delete(e),D.add(e))}}let r=t.acquire();E.forEach(e=>{r.push(e)});let i=t.acquire();D.forEach(e=>{i.push(e)});let a=this._items,o=n.items,s=t.acquire();if(O.forEach(e=>{o.indexOf(e)!==a.indexOf(e)&&s.push(e)}),n.listeners&&(r.length||i.length||s.length)){let e={target:this,added:r,removed:i,moved:s},t=n.listeners.length;for(let r=0;r<t;r++){let t=n.listeners[r];t.removed||t.callback.call(this,e)}}t.release(r),t.release(i),t.release(s)}E.clear(),D.clear(),O.clear()}};e([f()],j.prototype,`_updating`,void 0),e([f()],j.prototype,`_length`,void 0),e([f()],j.prototype,`length`,null),e([f()],j.prototype,`items`,null),e([f({readOnly:!0})],j.prototype,`updating`,null),j=_=e([m(`esri.core.Collection`)],j);const M=j;export{M as default};
|
package/form/FormTemplate.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ export interface FormTemplateProperties extends Partial<Pick<FormTemplate, "desc
|
|
|
95
95
|
*
|
|
96
96
|
* @since 4.16
|
|
97
97
|
* @see [Sample - Editing with calculated field expressions](https://developers.arcgis.com/javascript/latest/sample-code/widgets-featureform-async/)
|
|
98
|
-
* @see [Sample - Edit FeatureLayers with form elements ](https://developers.arcgis.com/javascript/latest/sample-code/
|
|
98
|
+
* @see [Sample - Edit FeatureLayers with form elements ](https://developers.arcgis.com/javascript/latest/sample-code/editor-form-elements/)
|
|
99
99
|
* @see [Sample - Editing related data with calculated expressions](https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-relates-calculations/)
|
|
100
100
|
* @see [FeatureLayer.formTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/#formTemplate)
|
|
101
101
|
* @see [SubtypeSublayer.formTemplate](https://developers.arcgis.com/javascript/latest/references/core/layers/support/SubtypeSublayer/#formTemplate)
|
|
@@ -35,6 +35,8 @@ export interface AttachmentElementProperties extends ElementProperties, Partial<
|
|
|
35
35
|
*
|
|
36
36
|
* @since 5.1
|
|
37
37
|
* @see [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/)
|
|
38
|
+
* @see [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/)
|
|
39
|
+
* @see [Sample - Edit FeatureLayers with form elements ](https://developers.arcgis.com/javascript/latest/sample-code/editor-form-elements/)
|
|
38
40
|
* @example
|
|
39
41
|
* // Create the attachment element
|
|
40
42
|
* const attachmentElement = new AttachmentElement({
|
|
@@ -2,7 +2,7 @@ import type Element from "./Element.js";
|
|
|
2
2
|
import type CodedValueDomain from "../../layers/support/CodedValueDomain.js";
|
|
3
3
|
import type RangeDomain from "../../layers/support/RangeDomain.js";
|
|
4
4
|
import type { ElementProperties } from "./Element.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { InputUnion } from "./inputs/types.js";
|
|
6
6
|
import type { RangeDomainProperties } from "../../layers/support/RangeDomain.js";
|
|
7
7
|
import type { CodedValueDomainProperties } from "../../layers/support/CodedValueDomain.js";
|
|
8
8
|
import type { TimePickerInputProperties } from "./inputs/TimePickerInput.js";
|
|
@@ -130,7 +130,7 @@ export default class FieldElement extends Element {
|
|
|
130
130
|
*/
|
|
131
131
|
accessor hint: string | null | undefined;
|
|
132
132
|
/** The input to use for the element. The client application is responsible for defining the default user interface. */
|
|
133
|
-
get input():
|
|
133
|
+
get input(): InputUnion | null | undefined;
|
|
134
134
|
set input(value: ((BarcodeScannerInputProperties & { type: "barcode-scanner" }) | (ComboBoxInputProperties & { type: "combo-box" }) | (DatePickerInputProperties & { type: "date-picker" }) | (DateTimeOffsetPickerInputProperties & { type: "timestampoffset-picker" }) | (DateTimePickerInputProperties & { type: "datetime-picker" }) | (DynamicChoiceInputProperties & { type: "dynamic-choice" }) | (MultipleChoiceInputProperties & { type: "multiple-choice" }) | (RadioButtonsInputProperties & { type: "radio-buttons" }) | (SwitchInputProperties & { type: "switch" }) | (TextAreaInputProperties & { type: "text-area" }) | (TextBoxInputProperties & { type: "text-box" }) | (TimePickerInputProperties & { type: "time-picker" })) | null | undefined);
|
|
135
135
|
/**
|
|
136
136
|
* A reference to the [ExpressionInfo.name](https://developers.arcgis.com/javascript/latest/references/core/form/ExpressionInfo/#name) of an
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import r from"./Element.js";import{types as i}from"./inputs.js";import{fromJSON as a,types as o}from"../../layers/support/domains.js";var s;let c=s=class extends r{constructor(e){super(e),this.domain=null,this.editable=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type=`field`,this.valueExpression=null}clone(){return new s({description:this.description,domain:this.domain?.clone()??null,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input?.clone(),label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};e([t({types:o,json:{read:{reader:a},write:!0}})],c.prototype,`domain`,void 0),e([t({type:Boolean,json:{write:!0}})],c.prototype,`editable`,void 0),e([t({type:String,json:{write:!0}})],c.prototype,`editableExpression`,void 0),e([t({type:String,json:{write:!0}})],c.prototype,`fieldName`,void 0),e([t({type:String,json:{write:!0}})],c.prototype,`hint`,void 0),e([t({types:i,json:{read:{source:`inputType`},write:{target:`inputType`}}})],c.prototype,`input`,void 0),e([t({type:String,json:{write:!0}})],c.prototype,`requiredExpression`,void 0),e([t({type:String,json:{read:!1,write:!0}})],c.prototype,`type`,void 0),e([t({type:String,json:{write:!0}})],c.prototype,`valueExpression`,void 0),c=s=e([n(`esri.form.elements.FieldElement`)],c);export{c as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import r from"./Element.js";import{types as i}from"./inputs/inputUtils.js";import{fromJSON as a,types as o}from"../../layers/support/domains.js";var s;let c=s=class extends r{constructor(e){super(e),this.domain=null,this.editable=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type=`field`,this.valueExpression=null}clone(){return new s({description:this.description,domain:this.domain?.clone()??null,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input?.clone(),label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};e([t({types:o,json:{read:{reader:a},write:!0}})],c.prototype,`domain`,void 0),e([t({type:Boolean,json:{write:!0}})],c.prototype,`editable`,void 0),e([t({type:String,json:{write:!0}})],c.prototype,`editableExpression`,void 0),e([t({type:String,json:{write:!0}})],c.prototype,`fieldName`,void 0),e([t({type:String,json:{write:!0}})],c.prototype,`hint`,void 0),e([t({types:i,json:{read:{source:`inputType`},write:{target:`inputType`}}})],c.prototype,`input`,void 0),e([t({type:String,json:{write:!0}})],c.prototype,`requiredExpression`,void 0),e([t({type:String,json:{read:!1,write:!0}})],c.prototype,`type`,void 0),e([t({type:String,json:{write:!0}})],c.prototype,`valueExpression`,void 0),c=s=e([n(`esri.form.elements.FieldElement`)],c);export{c as default};
|
|
@@ -30,7 +30,7 @@ export interface RelationshipElementProperties extends ElementProperties, Partia
|
|
|
30
30
|
* @since 4.27
|
|
31
31
|
* @see [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/)
|
|
32
32
|
* @see [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/)
|
|
33
|
-
* @see [Sample - Edit FeatureLayers with form elements ](https://developers.arcgis.com/javascript/latest/sample-code/
|
|
33
|
+
* @see [Sample - Edit FeatureLayers with form elements ](https://developers.arcgis.com/javascript/latest/sample-code/editor-form-elements/)
|
|
34
34
|
* @see [Sample - Editing related data with calculated expressions](https://developers.arcgis.com/javascript/latest/sample-code/widgets-editor-relates-calculations/)
|
|
35
35
|
* @example
|
|
36
36
|
* // Create the relationship element
|
|
@@ -9,12 +9,12 @@ export interface TextElementProperties extends ElementProperties, Partial<Pick<T
|
|
|
9
9
|
* The text may reference values returned from a field attribute or an
|
|
10
10
|
* [Arcade](https://developers.arcgis.com/javascript/latest/arcade/) expression defined in a FormTemplate's [FormTemplate.expressionInfos](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/#expressionInfos) property.
|
|
11
11
|
*
|
|
12
|
-
* [](https://developers.arcgis.com/javascript/latest/sample-code/
|
|
12
|
+
* [](https://developers.arcgis.com/javascript/latest/sample-code/editor-form-elements/)
|
|
13
13
|
*
|
|
14
14
|
* @see [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/)
|
|
15
15
|
* @see [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/)
|
|
16
16
|
* @see [ExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/form/ExpressionInfo/)
|
|
17
|
-
* @see [Sample - Edit FeatureLayers with form elements](https://developers.arcgis.com/javascript/latest/sample-code/
|
|
17
|
+
* @see [Sample - Edit FeatureLayers with form elements](https://developers.arcgis.com/javascript/latest/sample-code/editor-form-elements/)
|
|
18
18
|
* @example
|
|
19
19
|
* // Create a plain-text element.
|
|
20
20
|
* const textElement = new TextElement({
|
|
@@ -16,7 +16,7 @@ export interface UtilityNetworkAssociationsElementProperties extends ElementProp
|
|
|
16
16
|
* @see [FormTemplate](https://developers.arcgis.com/javascript/latest/references/core/form/FormTemplate/)
|
|
17
17
|
* @see [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/)
|
|
18
18
|
* @see [FeatureForm](https://developers.arcgis.com/javascript/latest/references/core/widgets/FeatureForm/)
|
|
19
|
-
* @see [Sample - Edit FeatureLayers with form elements ](https://developers.arcgis.com/javascript/latest/sample-code/
|
|
19
|
+
* @see [Sample - Edit FeatureLayers with form elements ](https://developers.arcgis.com/javascript/latest/sample-code/editor-form-elements/)
|
|
20
20
|
* @example
|
|
21
21
|
* // Configure associations in forms
|
|
22
22
|
* const formTemplate = new FormTemplate({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function
|
|
2
|
+
import e from"./BarcodeScannerInput.js";import t from"./ComboBoxInput.js";import n from"./DatePickerInput.js";import r from"./DateTimeOffsetPickerInput.js";import i from"./DateTimePickerInput.js";import a from"./DynamicChoiceInput.js";import o from"./Input.js";import s from"./MultipleChoiceInput.js";import c from"./RadioButtonsInput.js";import l from"./SwitchInput.js";import u from"./TextAreaInput.js";import d from"./TextBoxInput.js";import f from"./TimePickerInput.js";const p={base:o,key:`type`,typeMap:{"barcode-scanner":e,"combo-box":t,"date-picker":n,"datetime-picker":i,"dynamic-choice":a,"multiple-choice":s,"timestampoffset-picker":r,"datetimeoffset-picker":r,"radio-buttons":c,switch:l,"text-area":u,"text-box":d,"time-picker":f}};function m(e){return e.type===`barcode-scanner`}function h(e){return e.type===`combo-box`}function g(e){return e.type===`date-picker`}function _(e){return e.type===`datetime-picker`}function v(e){return e.type===`dynamic-choice`}function y(e){return e.type===`multiple-choice`}function b(e){return e.type===`timestampoffset-picker`}function x(e){return e.type===`radio-buttons`}function S(e){return e.type===`switch`}function C(e){return e.type===`text-area`}function w(e){return e.type===`text-box`}function T(e){return e.type===`time-picker`}export{m as isBarcodeScannerInput,h as isComboBoxInput,g as isDatePickerInput,b as isDateTimeOffsetPickerInput,_ as isDateTimePickerInput,v as isDynamicChoiceInput,y as isMultipleChoiceInput,x as isRadioButtonsInput,S as isSwitchInput,C as isTextAreaInput,w as isTextBoxInput,T as isTimePickerInput,p as types};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type BarcodeScannerInput from "./BarcodeScannerInput.js";
|
|
2
|
+
import type ComboBoxInput from "./ComboBoxInput.js";
|
|
3
|
+
import type DatePickerInput from "./DatePickerInput.js";
|
|
4
|
+
import type DateTimeOffsetPickerInput from "./DateTimeOffsetPickerInput.js";
|
|
5
|
+
import type DateTimePickerInput from "./DateTimePickerInput.js";
|
|
6
|
+
import type DynamicChoiceInput from "./DynamicChoiceInput.js";
|
|
7
|
+
import type MultipleChoiceInput from "./MultipleChoiceInput.js";
|
|
8
|
+
import type RadioButtonsInput from "./RadioButtonsInput.js";
|
|
9
|
+
import type SwitchInput from "./SwitchInput.js";
|
|
10
|
+
import type TextAreaInput from "./TextAreaInput.js";
|
|
11
|
+
import type TextBoxInput from "./TextBoxInput.js";
|
|
12
|
+
import type TimePickerInput from "./TimePickerInput.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A union of all [form inputs](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/Input/).
|
|
16
|
+
*
|
|
17
|
+
* @since 5.2
|
|
18
|
+
*/
|
|
19
|
+
export type InputUnion = BarcodeScannerInput | ComboBoxInput | DatePickerInput | DateTimeOffsetPickerInput | DateTimePickerInput | DynamicChoiceInput | MultipleChoiceInput | RadioButtonsInput | SwitchInput | TextAreaInput | TextBoxInput | TimePickerInput;
|
|
@@ -70,13 +70,14 @@ import type SwitchInputClass from "./inputs/SwitchInput.js";
|
|
|
70
70
|
import type TextAreaInputClass from "./inputs/TextAreaInput.js";
|
|
71
71
|
import type TextBoxInputClass from "./inputs/TextBoxInput.js";
|
|
72
72
|
import type TimePickerInputClass from "./inputs/TimePickerInput.js";
|
|
73
|
+
import type { InputUnion } from "./inputs/types.js";
|
|
73
74
|
|
|
74
75
|
/**
|
|
75
76
|
* Form element input types.
|
|
76
77
|
*
|
|
77
|
-
* @deprecated since 5.2.
|
|
78
|
+
* @deprecated since 5.2. Use [InputUnion](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/types/#InputUnion) instead.
|
|
78
79
|
*/
|
|
79
|
-
export type Input =
|
|
80
|
+
export type Input = InputUnion;
|
|
80
81
|
|
|
81
82
|
/**
|
|
82
83
|
* The `BarcodeScannerInput` class defines the desired user interface for a barcode or QR code scanner. If this type is used in an ArcGIS Maps SDK for JavaScript web application, it will default to the [TextBoxInput](https://developers.arcgis.com/javascript/latest/references/core/form/elements/inputs/TextBoxInput/) type as the API does not support bar code scanning as an input type.
|
package/form/elements/inputs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{deprecatedModule as e}from"../../core/deprecate.js";import t from"../../core/Logger.js";import n from"./inputs/BarcodeScannerInput.js";import r from"./inputs/ComboBoxInput.js";import i from"./inputs/DatePickerInput.js";import a from"./inputs/DateTimeOffsetPickerInput.js";import o from"./inputs/DateTimePickerInput.js";import s from"./inputs/DynamicChoiceInput.js";import c from"./inputs/
|
|
2
|
+
import{deprecatedModule as e}from"../../core/deprecate.js";import t from"../../core/Logger.js";import n from"./inputs/BarcodeScannerInput.js";import r from"./inputs/ComboBoxInput.js";import i from"./inputs/DatePickerInput.js";import a from"./inputs/DateTimeOffsetPickerInput.js";import o from"./inputs/DateTimePickerInput.js";import s from"./inputs/DynamicChoiceInput.js";import c from"./inputs/MultipleChoiceInput.js";import l from"./inputs/RadioButtonsInput.js";import u from"./inputs/SwitchInput.js";import d from"./inputs/TextAreaInput.js";import f from"./inputs/TextBoxInput.js";import p from"./inputs/TimePickerInput.js";export{types}from"./inputs/inputUtils.js";e(t.getLogger(`esri.form.elements.inputs`),`esri.form.elements.inputs`,{replacement:`Individual input module imports`,version:`5.2`,warnOnce:!0});const m=n,h=r,g=i,_=a,v=o,y=s,b=c,x=l,S=u,C=d,w=f,T=p;export{m as BarcodeScannerInput,h as ComboBoxInput,g as DatePickerInput,_ as DateTimeOffsetPickerInput,v as DateTimePickerInput,y as DynamicChoiceInput,b as MultipleChoiceInput,x as RadioButtonsInput,S as SwitchInput,C as TextAreaInput,w as TextBoxInput,T as TimePickerInput};
|
package/kernel.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`5.2.0-next.
|
|
2
|
+
import"./core/has.js";import{addQueryParameter as e}from"./core/urlUtils.js";Symbol.dispose??=Symbol(`Symbol.dispose`),Symbol.asyncDispose??=Symbol(`Symbol.asyncDispose`);const t=`5.2`;let n=`5.2`;n=`5.2.0-next.170`;let r;function i(e){r=e}function a(t){let n=r?.findCredential(t);return n?.token?e(t,`token`,n.token):t}globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}});export{a as addTokenParameter,n as fullVersion,r as id,i as setId,t as version};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import n from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{MultiOriginJSONSupportMixin as a}from"../../core/MultiOriginJSONSupport.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import"../../core/workers/workers.js";import ee from"../../form/FormTemplate.js";import c from"../../geometry/Extent.js";import te from"../../geometry/Point.js";import ne from"../../geometry/Polygon.js";import re from"../../geometry/Polyline.js";import{initializeProjection as ie,project as l}from"../../geometry/projectionUtils.js";import ae from"../../geometry/SpatialReference.js";import{wgs84 as u}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as d}from"../../geometry/support/typeUtils.js";import f from"../../graphic/KnowledgeGraphGraphicOrigin.js";import oe from"../../graphic/LinkChartGraphicOrigin.js";import se from"../Layer.js";import ce from"../graphics/data/FeatureStore.js";import{QueryEngine as le}from"../graphics/data/QueryEngine.js";import{createDrawingInfo as p}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as m,systemAggregationCountFieldName as h,systemIsSpatialFieldName as g,systemLayoutGeometryFieldName as _,systemOriginIdFieldName as ue,systemDestinationIdFieldName as v}from"./constants.js";import{KnowledgeGraphSublayerBase as y}from"./KnowledgeGraphSublayerBase.js";import{createCapabilitiesFromKnowledgeGraph as b,createDefaultKGSLFormTemplate as x,getDisplayLabelProperty as S,getLinkChartDefaultLabelingInfo as C,getMapDefaultLabelingInfo as w,getKGSublayerSymbolColor as T,getDefaultLCRelationshipSublayerSymbol as E,createDefaultKGSLFeatureTemplates as D,convertLayerEditsToGraphEdits as O,convertGraphEditsResultToFeatureEdits as k}from"./layerUtils.js";import{BlendLayer as A,blendModeProperty as j,effectProperty as M}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as N,displayFilterEnabledProperty as P,displayFilterInfoProperty as F}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as I,featureEffectProperty as L}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as R}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as z,orderByProperty as B}from"../mixins/OrderedLayer.js";import{RefreshableLayer as V}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as H}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as U,useViewTimeProperty as de}from"../mixins/TemporalLayer.js";import{legendEnabled as fe,maxScale as pe,minScale as me,opacity as he,popupEnabled as ge}from"../support/commonProperties.js";import{featureReductionProperty as _e}from"../support/featureReductionUtils.js";import ve from"../support/FeatureTemplate.js";import W from"../support/Field.js";import{fixRendererFields as ye,fixTimeInfoFields as be}from"../support/fieldUtils.js";import xe from"../support/LabelClass.js";import{reader as Se}from"../support/labelingInfo.js";import Ce from"../support/TimeInfo.js";import we from"../../renderers/SimpleRenderer.js";import{fromJSON as G}from"../../renderers/support/jsonUtils.js";import{rendererTypes as Te}from"../../renderers/support/typeUtils.js";import{executeApplyEdits as Ee}from"../../rest/knowledgeGraphService.js";import De from"../../rest/support/FeatureSet.js";import K from"../../rest/support/Query.js";import{createPopupTemplate as Oe}from"../../support/popupUtils.js";import ke from"../../symbols/support/ElevationInfo.js";import{applyColorToSymbol as q}from"../../symbols/support/utils.js";import Ae from"../../core/workers/RemoteClient.js";import{writer as je}from"../../core/accessorSupport/decorators/writer.js";function J(e){if(!e.json)return e;e.json.write=Y(e.json.write);let t=e.json.origins;if(!t)return e;let n;for(n in t){let e=t[n];e&&(e.write=Y(e.write))}return e}function Y(e){return typeof e==`object`&&e?(e.enabled!==!1&&(e.overridePolicy=Me(e)),e):e===!0?X():e}function Me(e){let{target:t,writer:n,overridePolicy:r,...i}=e;return function(e,t){let n=Z.call(this,e,t);return n.enabled?{...i,...n}:n}}function X(){return{overridePolicy:Z}}function Z(e,t){let n=!!this.geometryType,r={enabled:n};return n&&(r={...r,...Q.call(this,e,t)}),r}function Q(e,t){return{allowNull:this.originIdOf(t)>=3,ignoreOrigin:this.originIdOf(t)>0}}let $=class extends y(N(R(I(A(z(U(H(V(a(se)))))))))){constructor(e){super(e),this.blendMode=`normal`,this.charts=null,this.definitionExpression=null,this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=m,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{let e=new MessageChannel;return new Ae(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{let n=K.fromJSON(e);return this.queryFeaturesJSON(n,t)}}}),[e.port2]})},this.type=`knowledge-graph-sublayer`,this.useViewTime=!0,this.visible=!0}get capabilities(){return this.parent?this.parent.sublayerCapabilities:b(null)}get isTable(){return this.parentCompositeLayer?.type!==`link-chart`&&this.geometryFieldName==null}get defaultPopupTemplate(){return this.createPopupTemplate()}get editingEnabled(){return this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}get effectiveCapabilities(){let e=r(this.capabilities),{operations:t,editing:n}=e;return this.userHasUpdateItemPrivileges&&(t.supportsAdd=t.supportsDelete=t.supportsEditing=t.supportsQuery=t.supportsUpdate=n.supportsDeleteByOthers=n.supportsGeometryUpdate=n.supportsUpdateByOthers=!0),this.userHasFullEditingPrivileges&&t.supportsEditing&&(t.supportsAdd=t.supportsDelete=t.supportsUpdate=n.supportsGeometryUpdate=!0),e}get effectiveEditingEnabled(){return this.userHasUpdateItemPrivileges||this.editingEnabled}set featureReduction(e){let t=this._normalizeFeatureReduction(e);this._set(`featureReduction`,t)}get fields(){let e=[],t=new Map;for(let e of this.parent?.knowledgeGraph.dataModel.domains??[])t.set(e.name,e);return this.objectType?.properties?.forEach(n=>{let r=n.fieldType===`esriFieldTypeOID`?`esriFieldTypeInteger`:n.fieldType,i=W.fromJSON({name:n.name,type:r,alias:n.alias,defaultValue:n.defaultValue,editable:n.editable,nullable:n.nullable,domain:n.domain&&t.has(n.domain)?t.get(n.domain).toJSON():void 0});e.push(i)}),e.push(W.fromJSON({name:this.objectIdField,type:`esriFieldTypeString`,alias:this.objectIdField,editable:!1}),W.fromJSON({name:h,type:`esriFieldTypeInteger`,alias:h,editable:!1}),W.fromJSON({name:g,type:`esriFieldTypeInteger`,alias:g,editable:!1})),e}get formTemplate(){return this._isOverridden(`formTemplate`)?this._get(`formTemplate`):x(this)}set formTemplate(e){this._overrideIfSome(`formTemplate`,e)}get geometryType(){if(this.parentCompositeLayer?.type===`link-chart`)return this.graphType===`relationship`?`polyline`:`point`;let e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.geometryType;return!e||e===`esriGeometryNull`?null:d.fromJSON(e)}get geometryFieldName(){return this.parentCompositeLayer?.type===`link-chart`?_:this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name??null}get graphicOrigin(){if(!this.parent)return null;switch(this.parent.type){case`knowledge-graph`:return new f(this.parent,this);case`link-chart`:return new oe(this.parent,this)}}get graphTypeName(){return this.objectType?.name}set graphTypeName(e){this._set(`graphTypeName`,e)}get hasM(){let e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name;return(e?this.objectType?.properties?.[e]:null)?.hasM??!1}get hasZ(){let e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name;return(e?this.objectType?.properties?.[e]:null)?.hasZ??!1}set labelingInfo(e){this._set(`labelingInfo`,e)}get labelingInfo(){if(this._isOverridden(`labelingInfo`))return this._get(`labelingInfo`);if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;let e=this.objectType.properties?S(this.objectType.properties):`ESRI__ID`;return this.parentCompositeLayer.type===`link-chart`?C(this.graphType,this.graphTypeName,e):w(this.graphTypeName,this.geometryType,e)}set renderer(e){ye(e,this.fieldsIndex),this._set(`renderer`,e)}get renderer(){if(this._isOverridden(`renderer`))return this._get(`renderer`);let e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map(e=>e.name).indexOf(this.graphTypeName),n=T(t);if(this.parentCompositeLayer?.type===`link-chart`){if(this.graphType===`relationship`)return new we({type:`simple`,symbol:E(n)});let e=G(p(d.toJSON(`point`)).renderer);return q(e.symbol,n),e}let r=G(p(d.toJSON(this.geometryType)).renderer);return q(r.symbol,n),r}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??ae.WGS84}get templates(){return this._isOverridden(`templates`)?this._get(`templates`):D(this)}set templates(e){this._overrideIfSome(`templates`,e)}set timeInfo(e){this._set(`timeInfo`,e)}get dateFieldsTimeZone(){return this.parentCompositeLayer?.dateFieldsTimeZone}get title(){return this._isOverridden(`title`)?this._get(`title`):this.graphTypeName}set title(e){this._set(`title`,e)}writeTitle(e,t){t.title=e??`Layer`}get userHasEditingPrivileges(){return!this.parent||this.parent.userHasEditingPrivileges}get userHasFullEditingPrivileges(){return this.parent?this.parent.userHasFullEditingPrivileges:!1}get userHasUpdateItemPrivileges(){return this.parent?this.parent.userHasUpdateItemPrivileges:!1}createPopupTemplate(e){return Oe(this,e)}createQuery(){return new K({where:`1=1`,outFields:[`*`]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return this.fields.find(t=>t.name===e)?.domain||null}async queryFeatures(e,t){await this.load();let{resolvedQuery:n,queryEngine:r,cypherTranslationApplied:i}=await this._setupQueryObjects(e),a=this.graphicOrigin,o=De.fromJSON(await r.executeQuery(this._createQueryEngineQueryJSON(n,i),t?.signal));return o.features.forEach(e=>{e.sourceLayer=this,e.origin=a}),o}async queryFeaturesJSON(e,t){await this.load();let{resolvedQuery:n,queryEngine:r,cypherTranslationApplied:i}=await this._setupQueryObjects(e);return await r.executeQuery(this._createQueryEngineQueryJSON(n,i),t?.signal)}async queryFeatureCount(e,t){await this.load();let{resolvedQuery:n,queryEngine:r,cypherTranslationApplied:i}=await this._setupQueryObjects(e);return r.executeQueryForCount(this._createQueryEngineQueryJSON(n,i),t?.signal)}async queryExtent(e={},t){await this.load();let n={...e,returnGeometry:!0},{resolvedQuery:r,queryEngine:i,cypherTranslationApplied:a}=await this._setupQueryObjects(n),o=await i.executeQueryForExtent(this._createQueryEngineQueryJSON(r,a),t?.signal),s;return s=o.extent?.xmin!=null&&o.extent?.xmax!=null&&o.extent?.ymin!=null&&o.extent?.ymax!=null?new c(o.extent):new c,{count:o.count,extent:s}}async queryObjectIds(e,t){await this.load();let n=K.from(e),r;if(!this.parentCompositeLayer)i.getLogger(this).warn(`Attempting to query for object IDs with no features failed because the parent composite layer is missing or not yet loaded.`),r=this.loadQueryEngine([]);else if(this.parentCompositeLayer.type===`link-chart`&&this._cachedQueryEngine)r=this._cachedQueryEngine;else{let{features:e,cypherTranslationApplied:i}=await this.parentCompositeLayer.dataManager.getData(n,this,this.parentCompositeLayer,t);return r=this.loadQueryEngine(e),await r.executeQueryForIds(this._createQueryEngineQueryJSON(n,i),t?.signal)}return await r.executeQueryForIds(this._createQueryEngineQueryJSON(n,!1),t?.signal)}async applyEdits(e){if(!this.parentCompositeLayer?.dataManager.knowledgeGraph)throw new n(`knowledge-graph-sublayer:no-knowledge-graph`,`ApplyEdits cannot be executed because the parent does not have a Knowledge Graph model. This is usually caused by the layer not yet being loaded`);let t=await O(e,this,this.parentCompositeLayer);t.options={cascadeDelete:!0,cascadeProvenanceDelete:this.parent?.knowledgeGraph.serviceDefinition.supportsProvenance?!0:void 0};let r=await Ee(this.parentCompositeLayer.dataManager.knowledgeGraph,t),i=k(r,this.graphTypeName),a={addedFeatures:i.addFeatureResults,updatedFeatures:i.updateFeatureResults,deletedFeatures:i.deleteFeatureResults,addedAttachments:i.addAttachmentResults,deletedAttachments:i.deleteAttachmentResults,updatedAttachments:i.updateAttachmentResults,exceededTransferLimit:!1,historicMoment:new Date,edits:void 0};return this.emit(`edits`,a),this.emit(`apply-edits`,{result:Promise.resolve(a)}),this.parentCompositeLayer.type===`link-chart`&&await this.parentCompositeLayer.refreshLinkChartCache([...a.addedFeatures.map(e=>e.globalId),...a.updatedFeatures.map(e=>e.globalId),...a.deletedFeatures.map(e=>e.globalId)]),i}loadQueryEngine(e){let t=new ce({geometryType:d.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),n=new le({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:d.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:`object-id`,fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return n.featureStore.addMany(e),n}async refreshCachedQueryEngine(){if(!this.parentCompositeLayer){i.getLogger(this).warn(`Attempting to refresh the cached query engine with no features failed because the parent composite layer is missing or not yet loaded.`),this._cachedQueryEngine=this.loadQueryEngine([]);return}let{features:e}=await this.parentCompositeLayer.dataManager.getData(new K({where:`1=1`,outFields:[m]}),this,this.parentCompositeLayer);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>be(this.timeInfo,this.fieldsIndex))),Promise.resolve(this)}_createQueryEngineQueryJSON(e,t){let n=e.toJSON();return t&&delete n.resultOffset,n}async _setupQueryObjects(e,t){let n=K.from(e),r=n.geometry;if(r&&!r.spatialReference?.isWGS84&&(await ie(r.spatialReference,u),n.geometry=r instanceof ne||r instanceof re||r instanceof te?l(r,u):l(r.extent,u)),!this.parentCompositeLayer)return i.getLogger(this).warn(`Attempting to execute a query with no features failed because the parent composite layer is missing or not yet loaded.`),{resolvedQuery:n,queryEngine:this.loadQueryEngine([]),cypherTranslationApplied:!1};if(this.parentCompositeLayer.type===`link-chart`&&this._cachedQueryEngine)return{resolvedQuery:n,queryEngine:this._cachedQueryEngine,cypherTranslationApplied:!1};let{features:a,cypherTranslationApplied:o}=await this.parentCompositeLayer.dataManager.getData(n,this,this.parentCompositeLayer,t);return{resolvedQuery:n,queryEngine:this.loadQueryEngine(a),cypherTranslationApplied:o}}};e([o(J(r(j)))],$.prototype,`blendMode`,void 0),e([o({readOnly:!0})],$.prototype,`capabilities`,null),e([o()],$.prototype,`isTable`,null),e([o({json:{origins:{"web-scene":{write:!1}},write:X()}})],$.prototype,`charts`,void 0),e([o({readOnly:!0})],$.prototype,`defaultPopupTemplate`,null),e([o({type:String,json:{origins:{service:{read:!1}},name:`layerDefinition.definitionExpression`,write:{ignoreOrigin:!0}}})],$.prototype,`definitionExpression`,void 0),e([o(J(r(P)))],$.prototype,`displayFilterEnabled`,void 0),e([o(J(r(F)))],$.prototype,`displayFilterInfo`,void 0),e([o()],$.prototype,`editingEnabled`,null),e([o(J(r(M)))],$.prototype,`effect`,void 0),e([o({readOnly:!0})],$.prototype,`effectiveCapabilities`,null),e([o({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),e([o({type:ke})],$.prototype,`elevationInfo`,void 0),e([o(J(r(L)))],$.prototype,`featureEffect`,void 0),e([o(J(r(_e)))],$.prototype,`featureReduction`,null),e([o()],$.prototype,`fields`,null),e([o({type:ee})],$.prototype,`formTemplate`,null),e([o()],$.prototype,`geometryType`,null),e([o()],$.prototype,`geometryFieldName`,null),e([o({readOnly:!0})],$.prototype,`graphicOrigin`,null),e([o({type:[`entity`,`relationship`],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],$.prototype,`graphType`,void 0),e([o({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],$.prototype,`graphTypeName`,null),e([o()],$.prototype,`hasM`,null),e([o()],$.prototype,`hasZ`,null),e([o({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],$.prototype,`id`,void 0),e([o({type:Boolean,value:!0,nonNullable:!0,json:{name:`showLabels`,default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],$.prototype,`labelsVisible`,void 0),e([o({type:[xe],json:{name:`layerDefinition.drawingInfo.labelingInfo`,read:Ne,write:X()}})],$.prototype,`labelingInfo`,null),e([o({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case`link-chart`:t.layerType=`LinkChartSubLayer`;break;case`knowledge-graph`:t.layerType=this.geometryType?`KnowledgeGraphSubLayer`:`KnowledgeGraphSubTable`}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],$.prototype,`layerType`,void 0),e([o(J(r(fe)))],$.prototype,`legendEnabled`,void 0),e([o(J(r(pe)))],$.prototype,`maxScale`,void 0),e([o(J(r(me)))],$.prototype,`minScale`,void 0),e([o()],$.prototype,`objectIdField`,void 0),e([o()],$.prototype,`objectType`,void 0),e([o(J(r(he)))],$.prototype,`opacity`,void 0),e([o(J(r(B)))],$.prototype,`orderBy`,void 0),e([o({clonable:!1})],$.prototype,`parent`,void 0),e([o()],$.prototype,`parentCompositeLayer`,void 0),e([o(J(r(ge)))],$.prototype,`popupEnabled`,void 0),e([o({type:t,json:{name:`popupInfo`,write:{ignoreOrigin:!0}}})],$.prototype,`popupTemplate`,void 0),e([o({type:Number,json:{write:{overridePolicy:Q}}})],$.prototype,`refreshInterval`,void 0),e([o({types:Te,json:{name:`layerDefinition.drawingInfo.renderer`,write:X()}})],$.prototype,`renderer`,null),e([o()],$.prototype,`source`,void 0),e([o()],$.prototype,`spatialReference`,null),e([o({type:ve})],$.prototype,`templates`,null),e([o({type:Ce,json:{name:`layerDefinition.timeInfo`,write:{overridePolicy:Q},origins:{"web-document":{name:`layerDefinition.timeInfo`,read:!0,write:{overridePolicy:Q}},"portal-item":{name:`layerDefinition.timeInfo`,read:!0,write:{overridePolicy:Q}}}}})],$.prototype,`timeInfo`,null),e([o({readOnly:!0})],$.prototype,`dateFieldsTimeZone`,null),e([o({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],$.prototype,`title`,null),e([je(`title`)],$.prototype,`writeTitle`,null),e([o({json:{read:!1}})],$.prototype,`type`,void 0),e([o(J(r(de)))],$.prototype,`useViewTime`,void 0),e([o({readOnly:!0})],$.prototype,`userHasEditingPrivileges`,null),e([o({readOnly:!0})],$.prototype,`userHasFullEditingPrivileges`,null),e([o({readOnly:!0})],$.prototype,`userHasUpdateItemPrivileges`,null),e([o({type:Boolean,json:{name:`visibility`,write:X()}})],$.prototype,`visible`,void 0),$=e([s(`esri.layers.knowledgeGraph.KnowledgeGraphSublayer`)],$);function Ne(e,t,n){let r=[[`ESRI__AGGREGATION_COUNT`,h],[`ESRI__ORIGIN_ID`,ue],[`ESRI__DESTINATION_ID`,v],[`ESRI__LAYOUT_GEOMETRY`,_]];try{for(let t of e)for(let[e,n]of r)t.labelExpression=t.labelExpression?.replaceAll(e,n),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,n))}catch(e){i.getLogger(this).warn(`Error updating labelingInfo`,e)}return Se.call(this,e,t,n)}export{$ as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../PopupTemplate.js";import n from"../../core/Error.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{MultiOriginJSONSupportMixin as a}from"../../core/MultiOriginJSONSupport.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import"../../core/workers/workers.js";import ee from"../../form/FormTemplate.js";import c from"../../geometry/Extent.js";import te from"../../geometry/Point.js";import ne from"../../geometry/Polygon.js";import re from"../../geometry/Polyline.js";import{initializeProjection as ie,project as l}from"../../geometry/projectionUtils.js";import ae from"../../geometry/SpatialReference.js";import{wgs84 as u}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as d}from"../../geometry/support/typeUtils.js";import oe from"../../graphic/KnowledgeGraphGraphicOrigin.js";import se from"../../graphic/LinkChartGraphicOrigin.js";import ce from"../Layer.js";import le from"../graphics/data/FeatureStore.js";import{QueryEngine as ue}from"../graphics/data/QueryEngine.js";import{createDrawingInfo as f}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as p,systemAggregationCountFieldName as m,systemIsSpatialFieldName as h,systemLayoutGeometryFieldName as g,systemOriginIdFieldName as de,systemDestinationIdFieldName as fe}from"./constants.js";import{KnowledgeGraphSublayerBase as _}from"./KnowledgeGraphSublayerBase.js";import{createCapabilitiesFromKnowledgeGraph as v,createDefaultKGSLFormTemplate as y,getDisplayLabelProperty as b,getLinkChartDefaultLabelingInfo as x,getMapDefaultLabelingInfo as S,getKGSublayerSymbolColor as C,getDefaultLCRelationshipSublayerSymbol as w,createDefaultKGSLFeatureTemplates as T,convertLayerEditsToGraphEdits as E,convertGraphEditsResultToFeatureEdits as D}from"./layerUtils.js";import{BlendLayer as O,blendModeProperty as k,effectProperty as A}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as j,displayFilterEnabledProperty as M,displayFilterInfoProperty as N}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as P,featureEffectProperty as F}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as I}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as L,orderByProperty as R}from"../mixins/OrderedLayer.js";import{RefreshableLayer as z}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as B}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as V,useViewTimeProperty as pe}from"../mixins/TemporalLayer.js";import{legendEnabled as me,maxScale as he,minScale as ge,opacity as _e,popupEnabled as ve}from"../support/commonProperties.js";import{featureReductionProperty as ye}from"../support/featureReductionUtils.js";import be from"../support/FeatureTemplate.js";import H from"../support/Field.js";import{fixRendererFields as xe,fixTimeInfoFields as Se}from"../support/fieldUtils.js";import Ce from"../support/LabelClass.js";import{reader as we}from"../support/labelingInfo.js";import Te from"../support/TimeInfo.js";import Ee from"../../renderers/SimpleRenderer.js";import{fromJSON as U}from"../../renderers/support/jsonUtils.js";import{rendererTypes as De}from"../../renderers/support/typeUtils.js";import{executeApplyEdits as Oe}from"../../rest/knowledgeGraphService.js";import ke from"../../rest/support/FeatureSet.js";import W from"../../rest/support/Query.js";import{createPopupTemplate as Ae}from"../../support/popupUtils.js";import je from"../../symbols/support/ElevationInfo.js";import{applyColorToSymbol as G}from"../../symbols/support/utils.js";import Me from"../../core/workers/RemoteClient.js";import{writer as K}from"../../core/accessorSupport/decorators/writer.js";function q(e){if(!e.json)return e;e.json.write=J(e.json.write);let t=e.json.origins;if(!t)return e;let n;for(n in t){let e=t[n];e&&(e.write=J(e.write))}return e}function J(e){return typeof e==`object`&&e?(e.enabled!==!1&&(e.overridePolicy=Ne(e)),e):e===!0?Y():e}function Ne(e){let{target:t,writer:n,overridePolicy:r,...i}=e;return function(e,t){let n=X.call(this,e,t);return n.enabled?{...i,...n}:n}}function Y(){return{overridePolicy:X}}function X(e,t){let n=!!this.geometryType,r={enabled:n};return n&&(r={...r,...Z.call(this,e,t)}),r}function Z(e,t){return{ignoreOrigin:this.originIdOf(t)>0}}function Q(e,t){return{...Z.call(this,e,t),allowNull:this.originIdOf(t)>=3}}let $=class extends _(j(I(P(O(L(V(B(z(a(ce)))))))))){constructor(e){super(e),this.blendMode=`normal`,this.charts=null,this.definitionExpression=null,this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=p,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{let e=new MessageChannel;return new Me(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{let n=W.fromJSON(e);return this.queryFeaturesJSON(n,t)}}}),[e.port2]})},this.type=`knowledge-graph-sublayer`,this.useViewTime=!0,this.visible=!0}get capabilities(){return this.parent?this.parent.sublayerCapabilities:v(null)}get isTable(){return this.parentCompositeLayer?.type!==`link-chart`&&this.geometryFieldName==null}get defaultPopupTemplate(){return this.createPopupTemplate()}get editingEnabled(){return this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}get effectiveCapabilities(){let e=r(this.capabilities),{operations:t,editing:n}=e;return this.userHasUpdateItemPrivileges&&(t.supportsAdd=t.supportsDelete=t.supportsEditing=t.supportsQuery=t.supportsUpdate=n.supportsDeleteByOthers=n.supportsGeometryUpdate=n.supportsUpdateByOthers=!0),this.userHasFullEditingPrivileges&&t.supportsEditing&&(t.supportsAdd=t.supportsDelete=t.supportsUpdate=n.supportsGeometryUpdate=!0),e}get effectiveEditingEnabled(){return this.userHasUpdateItemPrivileges||this.editingEnabled}set featureReduction(e){let t=this._normalizeFeatureReduction(e);this._set(`featureReduction`,t)}get fields(){let e=[],t=new Map;for(let e of this.parent?.knowledgeGraph.dataModel.domains??[])t.set(e.name,e);return this.objectType?.properties?.forEach(n=>{let r=n.fieldType===`esriFieldTypeOID`?`esriFieldTypeInteger`:n.fieldType,i=H.fromJSON({name:n.name,type:r,alias:n.alias,defaultValue:n.defaultValue,editable:n.editable,nullable:n.nullable,domain:n.domain&&t.has(n.domain)?t.get(n.domain).toJSON():void 0});e.push(i)}),e.push(H.fromJSON({name:this.objectIdField,type:`esriFieldTypeString`,alias:this.objectIdField,editable:!1}),H.fromJSON({name:m,type:`esriFieldTypeInteger`,alias:m,editable:!1}),H.fromJSON({name:h,type:`esriFieldTypeInteger`,alias:h,editable:!1})),e}get formTemplate(){return this._isOverridden(`formTemplate`)?this._get(`formTemplate`):y(this)}set formTemplate(e){this._overrideIfSome(`formTemplate`,e)}get geometryType(){if(this.parentCompositeLayer?.type===`link-chart`)return this.graphType===`relationship`?`polyline`:`point`;let e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.geometryType;return!e||e===`esriGeometryNull`?null:d.fromJSON(e)}get geometryFieldName(){return this.parentCompositeLayer?.type===`link-chart`?g:this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name??null}get graphicOrigin(){if(!this.parent)return null;switch(this.parent.type){case`knowledge-graph`:return new oe(this.parent,this);case`link-chart`:return new se(this.parent,this)}}get graphTypeName(){return this.objectType?.name}set graphTypeName(e){this._set(`graphTypeName`,e)}get hasM(){let e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name;return(e?this.objectType?.properties?.[e]:null)?.hasM??!1}get hasZ(){let e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name;return(e?this.objectType?.properties?.[e]:null)?.hasZ??!1}set labelingInfo(e){this._set(`labelingInfo`,e)}get labelingInfo(){if(this._isOverridden(`labelingInfo`))return this._get(`labelingInfo`);if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;let e=this.objectType.properties?b(this.objectType.properties):`ESRI__ID`;return this.parentCompositeLayer.type===`link-chart`?x(this.graphType,this.graphTypeName,e):S(this.graphTypeName,this.geometryType,e)}set renderer(e){xe(e,this.fieldsIndex),this._set(`renderer`,e)}get renderer(){if(this._isOverridden(`renderer`))return this._get(`renderer`);let e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map(e=>e.name).indexOf(this.graphTypeName),n=C(t);if(this.parentCompositeLayer?.type===`link-chart`){if(this.graphType===`relationship`)return new Ee({type:`simple`,symbol:w(n)});let e=U(f(d.toJSON(`point`)).renderer);return G(e.symbol,n),e}let r=U(f(d.toJSON(this.geometryType)).renderer);return G(r.symbol,n),r}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??ae.WGS84}get templates(){return this._isOverridden(`templates`)?this._get(`templates`):T(this)}set templates(e){this._overrideIfSome(`templates`,e)}set timeInfo(e){this._set(`timeInfo`,e)}get dateFieldsTimeZone(){return this.parentCompositeLayer?.dateFieldsTimeZone}get title(){return this._isOverridden(`title`)?this._get(`title`):this.graphTypeName}set title(e){this._set(`title`,e)}writeTitle(e,t){t.title=e??`Layer`}get userHasEditingPrivileges(){return!this.parent||this.parent.userHasEditingPrivileges}get userHasFullEditingPrivileges(){return this.parent?this.parent.userHasFullEditingPrivileges:!1}get userHasUpdateItemPrivileges(){return this.parent?this.parent.userHasUpdateItemPrivileges:!1}createPopupTemplate(e){return Ae(this,e)}createQuery(){return new W({where:`1=1`,outFields:[`*`]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return this.fields.find(t=>t.name===e)?.domain||null}async queryFeatures(e,t){await this.load();let{resolvedQuery:n,queryEngine:r,cypherTranslationApplied:i}=await this._setupQueryObjects(e),a=this.graphicOrigin,o=ke.fromJSON(await r.executeQuery(this._createQueryEngineQueryJSON(n,i),t?.signal));return o.features.forEach(e=>{e.sourceLayer=this,e.origin=a}),o}async queryFeaturesJSON(e,t){await this.load();let{resolvedQuery:n,queryEngine:r,cypherTranslationApplied:i}=await this._setupQueryObjects(e);return await r.executeQuery(this._createQueryEngineQueryJSON(n,i),t?.signal)}async queryFeatureCount(e,t){await this.load();let{resolvedQuery:n,queryEngine:r,cypherTranslationApplied:i}=await this._setupQueryObjects(e);return r.executeQueryForCount(this._createQueryEngineQueryJSON(n,i),t?.signal)}async queryExtent(e={},t){await this.load();let n={...e,returnGeometry:!0},{resolvedQuery:r,queryEngine:i,cypherTranslationApplied:a}=await this._setupQueryObjects(n),o=await i.executeQueryForExtent(this._createQueryEngineQueryJSON(r,a),t?.signal),s;return s=o.extent?.xmin!=null&&o.extent?.xmax!=null&&o.extent?.ymin!=null&&o.extent?.ymax!=null?new c(o.extent):new c,{count:o.count,extent:s}}async queryObjectIds(e,t){await this.load();let n=W.from(e),r;if(!this.parentCompositeLayer)i.getLogger(this).warn(`Attempting to query for object IDs with no features failed because the parent composite layer is missing or not yet loaded.`),r=this.loadQueryEngine([]);else if(this.parentCompositeLayer.type===`link-chart`&&this._cachedQueryEngine)r=this._cachedQueryEngine;else{let{features:e,cypherTranslationApplied:i}=await this.parentCompositeLayer.dataManager.getData(n,this,this.parentCompositeLayer,t);return r=this.loadQueryEngine(e),await r.executeQueryForIds(this._createQueryEngineQueryJSON(n,i),t?.signal)}return await r.executeQueryForIds(this._createQueryEngineQueryJSON(n,!1),t?.signal)}async applyEdits(e){if(!this.parentCompositeLayer?.dataManager.knowledgeGraph)throw new n(`knowledge-graph-sublayer:no-knowledge-graph`,`ApplyEdits cannot be executed because the parent does not have a Knowledge Graph model. This is usually caused by the layer not yet being loaded`);let t=await E(e,this,this.parentCompositeLayer);t.options={cascadeDelete:!0,cascadeProvenanceDelete:this.parent?.knowledgeGraph.serviceDefinition.supportsProvenance?!0:void 0};let r=await Oe(this.parentCompositeLayer.dataManager.knowledgeGraph,t),i=D(r,this.graphTypeName),a={addedFeatures:i.addFeatureResults,updatedFeatures:i.updateFeatureResults,deletedFeatures:i.deleteFeatureResults,addedAttachments:i.addAttachmentResults,deletedAttachments:i.deleteAttachmentResults,updatedAttachments:i.updateAttachmentResults,exceededTransferLimit:!1,historicMoment:new Date,edits:void 0};return this.emit(`edits`,a),this.emit(`apply-edits`,{result:Promise.resolve(a)}),this.parentCompositeLayer.type===`link-chart`&&await this.parentCompositeLayer.refreshLinkChartCache([...a.addedFeatures.map(e=>e.globalId),...a.updatedFeatures.map(e=>e.globalId),...a.deletedFeatures.map(e=>e.globalId)]),i}loadQueryEngine(e){let t=new le({geometryType:d.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),n=new ue({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:d.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:`object-id`,fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return n.featureStore.addMany(e),n}async refreshCachedQueryEngine(){if(!this.parentCompositeLayer){i.getLogger(this).warn(`Attempting to refresh the cached query engine with no features failed because the parent composite layer is missing or not yet loaded.`),this._cachedQueryEngine=this.loadQueryEngine([]);return}let{features:e}=await this.parentCompositeLayer.dataManager.getData(new W({where:`1=1`,outFields:[p]}),this,this.parentCompositeLayer);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>Se(this.timeInfo,this.fieldsIndex))),Promise.resolve(this)}_createQueryEngineQueryJSON(e,t){let n=e.toJSON();return t&&delete n.resultOffset,n}async _setupQueryObjects(e,t){let n=W.from(e),r=n.geometry;if(r&&!r.spatialReference?.isWGS84&&(await ie(r.spatialReference,u),n.geometry=r instanceof ne||r instanceof re||r instanceof te?l(r,u):l(r.extent,u)),!this.parentCompositeLayer)return i.getLogger(this).warn(`Attempting to execute a query with no features failed because the parent composite layer is missing or not yet loaded.`),{resolvedQuery:n,queryEngine:this.loadQueryEngine([]),cypherTranslationApplied:!1};if(this.parentCompositeLayer.type===`link-chart`&&this._cachedQueryEngine)return{resolvedQuery:n,queryEngine:this._cachedQueryEngine,cypherTranslationApplied:!1};let{features:a,cypherTranslationApplied:o}=await this.parentCompositeLayer.dataManager.getData(n,this,this.parentCompositeLayer,t);return{resolvedQuery:n,queryEngine:this.loadQueryEngine(a),cypherTranslationApplied:o}}};e([o(q(r(k)))],$.prototype,`blendMode`,void 0),e([o({readOnly:!0})],$.prototype,`capabilities`,null),e([o()],$.prototype,`isTable`,null),e([o({json:{origins:{"web-scene":{write:!1}},write:Y()}})],$.prototype,`charts`,void 0),e([o({readOnly:!0})],$.prototype,`defaultPopupTemplate`,null),e([o({type:String,json:{origins:{service:{read:!1}},name:`layerDefinition.definitionExpression`,write:{ignoreOrigin:!0}}})],$.prototype,`definitionExpression`,void 0),e([o(q(r(M)))],$.prototype,`displayFilterEnabled`,void 0),e([o(q(r(N)))],$.prototype,`displayFilterInfo`,void 0),e([o()],$.prototype,`editingEnabled`,null),e([o(q(r(A)))],$.prototype,`effect`,void 0),e([o({readOnly:!0})],$.prototype,`effectiveCapabilities`,null),e([o({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),e([o({type:je})],$.prototype,`elevationInfo`,void 0),e([o(q(r(F)))],$.prototype,`featureEffect`,void 0),e([o(q(r(ye)))],$.prototype,`featureReduction`,null),e([o()],$.prototype,`fields`,null),e([o({type:ee})],$.prototype,`formTemplate`,null),e([o()],$.prototype,`geometryType`,null),e([o()],$.prototype,`geometryFieldName`,null),e([o({readOnly:!0})],$.prototype,`graphicOrigin`,null),e([o({type:[`entity`,`relationship`],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],$.prototype,`graphType`,void 0),e([o({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],$.prototype,`graphTypeName`,null),e([o()],$.prototype,`hasM`,null),e([o()],$.prototype,`hasZ`,null),e([o({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],$.prototype,`id`,void 0),e([o({type:Boolean,value:!0,nonNullable:!0,json:{name:`showLabels`,default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],$.prototype,`labelsVisible`,void 0),e([o({type:[Ce],json:{name:`layerDefinition.drawingInfo.labelingInfo`,read:Pe,write:Y()}})],$.prototype,`labelingInfo`,null),e([o({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case`link-chart`:t.layerType=`LinkChartSubLayer`;break;case`knowledge-graph`:t.layerType=this.geometryType?`KnowledgeGraphSubLayer`:`KnowledgeGraphSubTable`}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],$.prototype,`layerType`,void 0),e([o(q(r(me)))],$.prototype,`legendEnabled`,void 0),e([o(q(r(he)))],$.prototype,`maxScale`,void 0),e([o(q(r(ge)))],$.prototype,`minScale`,void 0),e([o()],$.prototype,`objectIdField`,void 0),e([o()],$.prototype,`objectType`,void 0),e([o(q(r(_e)))],$.prototype,`opacity`,void 0),e([o(q(r(R)))],$.prototype,`orderBy`,void 0),e([o({clonable:!1})],$.prototype,`parent`,void 0),e([o()],$.prototype,`parentCompositeLayer`,void 0),e([o(q(r(ve)))],$.prototype,`popupEnabled`,void 0),e([o({type:t,json:{name:`popupInfo`,write:{ignoreOrigin:!0}}})],$.prototype,`popupTemplate`,void 0),e([o({type:Number,json:{write:{overridePolicy:Z}}})],$.prototype,`refreshInterval`,void 0),e([o({types:De,json:{name:`layerDefinition.drawingInfo.renderer`,write:Y()}})],$.prototype,`renderer`,null),e([o()],$.prototype,`source`,void 0),e([o()],$.prototype,`spatialReference`,null),e([o({type:be})],$.prototype,`templates`,null),e([o({type:Te,json:{name:`layerDefinition.timeInfo`,write:{overridePolicy:Q},origins:{"web-document":{name:`layerDefinition.timeInfo`,read:!0,write:{overridePolicy:Q}},"portal-item":{name:`layerDefinition.timeInfo`,read:!0,write:{overridePolicy:Q}}}}})],$.prototype,`timeInfo`,null),e([o({readOnly:!0})],$.prototype,`dateFieldsTimeZone`,null),e([o({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],$.prototype,`title`,null),e([K(`title`)],$.prototype,`writeTitle`,null),e([o({json:{read:!1}})],$.prototype,`type`,void 0),e([o(q(r(pe)))],$.prototype,`useViewTime`,void 0),e([o({readOnly:!0})],$.prototype,`userHasEditingPrivileges`,null),e([o({readOnly:!0})],$.prototype,`userHasFullEditingPrivileges`,null),e([o({readOnly:!0})],$.prototype,`userHasUpdateItemPrivileges`,null),e([o({type:Boolean,json:{name:`visibility`,write:Y()}})],$.prototype,`visible`,void 0),$=e([s(`esri.layers.knowledgeGraph.KnowledgeGraphSublayer`)],$);function Pe(e,t,n){let r=[[`ESRI__AGGREGATION_COUNT`,m],[`ESRI__ORIGIN_ID`,de],[`ESRI__DESTINATION_ID`,fe],[`ESRI__LAYOUT_GEOMETRY`,g]];try{for(let t of e)for(let[e,n]of r)t.labelExpression=t.labelExpression?.replaceAll(e,n),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,n))}catch(e){i.getLogger(this).warn(`Error updating labelingInfo`,e)}return we.call(this,e,t,n)}export{$ as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{saveAs as e,save as t}from"./utils.js";import{
|
|
2
|
+
import{saveAs as e,save as t}from"./utils.js";import{removeTypeKeyword as n,typeKeyword as r,getWGS84ExtentForItem as i,toggleTypeKeyword as a}from"../../portal/support/portalItemUtils.js";const o=`Parquet Feature Layer`;function s(e){return{isValid:e.type===`parquet`,errorMessage:`Layer.type should be 'parquet'`}}function c(e){let t=e.layerJSON;return Promise.resolve(t&&Object.keys(t).length?t:null)}async function l(e,t){t.extent||await d(e,t),f(e,t)}async function u(e,t){t.title||=e.title,await d(e,t),n(t,r.METADATA),f(e,t)}async function d(e,t){t.extent=e.fullExtent?await i(e.fullExtent):null}function f(e,t){a(t,r.CHARTS,!!e.charts?.length)}async function p(e,n){return t({layer:e,itemType:o,validateLayer:s,createItemData:c,errorNamePrefix:`parquet-layer-save`,setItemProperties:l},n)}async function m(t,n,r){return e({layer:t,itemType:o,validateLayer:s,createItemData:c,errorNamePrefix:`parquet-layer-save-as`,newItem:n,setItemProperties:u},r)}export{p as save,m as saveAs};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.170",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.20.8",
|
|
23
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
23
|
+
"@arcgis/toolkit": "5.2.0-next.170",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.2.0-next.2",
|
|
25
25
|
"@esri/calcite-components": "^5.2.0",
|
|
26
26
|
"@vaadin/grid": "~25.3.2",
|
package/rest/route.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @see [RouteResult](https://developers.arcgis.com/javascript/latest/references/core/rest/support/RouteResult/)
|
|
14
14
|
* @see [RouteSolveResult](https://developers.arcgis.com/javascript/latest/references/core/rest/support/RouteSolveResult/)
|
|
15
15
|
* @see [RouteParameters](https://developers.arcgis.com/javascript/latest/references/core/rest/support/RouteParameters/)
|
|
16
|
-
* @see [
|
|
16
|
+
* @see [Routing and Directions](https://developers.arcgis.com/documentation/mapping-and-location-services/routing-and-directions/)
|
|
17
17
|
* @see [Sample - Route](https://developers.arcgis.com/javascript/latest/sample-code/route/)
|
|
18
18
|
*/
|
|
19
19
|
import type RouteParameters from "./support/RouteParameters.js";
|
|
@@ -41,7 +41,7 @@ export default class AreasAndLengthsParameters extends JSONSupport {
|
|
|
41
41
|
/**
|
|
42
42
|
* The length unit in which perimeters of polygons will be calculated.
|
|
43
43
|
* Use one of the possible values listed below or any of the
|
|
44
|
-
* [numeric codes for linear units](https://developers.arcgis.com/
|
|
44
|
+
* [numeric codes for linear units](https://developers.arcgis.com/java/v200/api-reference/reference/com.esri.arcgisruntime/com/esri/arcgisruntime/geometry/LinearUnitId.html).
|
|
45
45
|
*/
|
|
46
46
|
accessor lengthUnit: LengthUnit | null | undefined;
|
|
47
47
|
/** Polygon geometries for which to compute areas and lengths. */
|
|
@@ -36,7 +36,7 @@ export default class LengthsParameters extends JSONSupport {
|
|
|
36
36
|
accessor geodesic: boolean | null | undefined;
|
|
37
37
|
/**
|
|
38
38
|
* The length unit in which perimeters of polygons will be calculated.
|
|
39
|
-
* For a list of valid units, see [linear unit codes](https://developers.arcgis.com/
|
|
39
|
+
* For a list of valid units, see [linear unit codes](https://developers.arcgis.com/java/v200/api-reference/reference/com.esri.arcgisruntime/com/esri/arcgisruntime/geometry/LinearUnitId.html).
|
|
40
40
|
*/
|
|
41
41
|
accessor lengthUnit: number | string;
|
|
42
42
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../../core/Error.js";import{resolveTimeZone as t}from"../../../../intl/date.js";import{isTimeOnlyField as n,isDateField as r,isTimestampOffsetField as i,isDateOnlyField as a}from"../../../../layers/support/fieldUtils.js";import o from"../../../../rest/support/AttributeBinsQuery.js";import s from"../../../../rest/support/AutoIntervalBinParameters.js";import c from"../../../../rest/support/DateBinParameters.js";import l from"../../../../rest/support/FixedBoundariesBinParameters.js";import u from"../../../../rest/support/FixedIntervalBinParameters.js";import d from"../../../../rest/support/GenerateRendererParameters.js";import f from"../../../../rest/support/StatisticDefinition.js";import{getSQLFilterForNormalization as p,mergeWhereClauses as m,getRangeExpr as h}from"../../../statistics/support/utils.js";import{isAnyDateField as g}from"../../utils.js";import{getSQLExpressionForDateOrTimeField as _,getFieldExpr as v,updateQueryWithFeatureFilter as y,defaultNumBins as b,generateBinParams as x,getViewInfoParams as S}from"./utils.js";import{createClassBreaksDefinition as C}from"../../../../statistics/utils.js";const w=`countOFExpr`;function T(e,t,r){let i=e.valueExpression||e.sqlExpression,a=e.signal;if(!i){let{field:i,normalizationType:o,normalizationField:s}=e,c=i?t.getField(i):null,l=g(c)||n(c);return{sqlExpression:l?_(t,c):v({field:i,normalizationType:o,normalizationField:s,normalizationTotal:r,layer:t}),sqlWhere:l?null:e.sqlWhere||p({field:i,normalizationType:o,normalizationField:s}),filter:e.filter,signal:a}}return{valueExpression:e.valueExpression,sqlExpression:e.sqlExpression,sqlWhere:e.sqlWhere,filter:e.filter,signal:a}}async function E(e,t,n){let{field:r,normalizationType:i,normalizationField:a,signal:o}=e,s=p({field:r,normalizationType:i,normalizationField:a}),c=new d({classificationDefinition:C({field:r,normalizationType:i,normalizationField:a,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,definedInterval:e.definedInterval,breakCount:e.numBins||b}),where:m(s,n)});return t.generateRenderer(c,o).then(e=>{let{normalizationTotal:n,classBreaks:o}=e;return x({field:r,normalizationType:i,normalizationField:a,normalizationTotal:n,classBreaks:o,where:s,layer:t})})}async function D(t,r,i,o,d){let{field:f,sqlExpression:p,normalizationField:m,classificationMethod:g,normalizationType:_}=t,y=f?r.getField(f):null,x=n(y),S=a(y)||x,C=t.numBins||b;if(S){if(_||g)throw new e(`${r.adapterName}:not-supported`,`NormalizationType and classificationMethod are not supported for date-only and time-only fields`);let t=(o-i)/C/1e3,n=t/86400;return new c({field:f,expression:p,expressionValueType:p?`double`:void 0,interval:{unit:x?`seconds`:`days`,value:Math.ceil(x?t:n)},start:i,end:o})}if(g===`defined-interval`)return new u({field:f,expression:p,expressionValueType:p?`double`:void 0,normalizationField:m,normalizationTotal:d,normalizationType:_,interval:t.definedInterval??Math.ceil((o-i)/C),start:_?null:i,end:_?null:o,normalizationMinValue:_?i:null,normalizationMaxValue:_?o:null});if(g===`manual`)throw new e(`${r.adapterName}:not-supported`,`Layer does not support manual classificationMethod`);if(g===`natural-breaks`||g===`quantile`||g===`standard-deviation`){let n=v({field:f,normalizationField:m,normalizationTotal:d,normalizationType:_,layer:r}),a=await E(t,r,t.minValue!==null&&t.maxValue!==null?h(n,t.minValue,t.maxValue):void 0);if(!a.intervals)throw new e(`${r.adapterName}:invalid`,`Invalid intervals returned from generate renderer`);let o=[i,...a.intervals.map(e=>e[1])];return new l({field:_?null:f,expression:_?n:p,expressionValueType:p?`double`:void 0,boundaries:o})}return new s({field:f,normalizationField:m,normalizationTotal:d,normalizationType:_,expression:p,expressionValueType:p?`double`:void 0,numBins:C,start:_?null:i,end:_?null:o,normalizationMinValue:_?i:null,normalizationMaxValue:_?o:null})}function O(e,t,n,r){return n!=null&&r!=null?Promise.resolve({min:n,max:r}):t.summaryStatistics({...e,outStatisticTypes:{include:[`min`,`max`]}}).then(e=>({min:e.min,max:e.max}))}async function k(e,n,a,s){let{field:c,minValue:l,maxValue:u,filter:d,view:p}=e,h=c?n.getField(c):null,g=r(h)||i(h),_=T(e,n,a),{min:v,max:b}=await O(_,n,l,u);if(v==null||b==null)return{query:null,min:v,max:b};let x=new f({statisticType:`count`,outStatisticFieldName:w,onStatisticField:`1`}),{where:
|
|
2
|
+
import e from"../../../../core/Error.js";import{resolveTimeZone as t}from"../../../../intl/date.js";import{isTimeOnlyField as n,isDateField as r,isTimestampOffsetField as i,isDateOnlyField as a}from"../../../../layers/support/fieldUtils.js";import o from"../../../../rest/support/AttributeBinsQuery.js";import s from"../../../../rest/support/AutoIntervalBinParameters.js";import c from"../../../../rest/support/DateBinParameters.js";import l from"../../../../rest/support/FixedBoundariesBinParameters.js";import u from"../../../../rest/support/FixedIntervalBinParameters.js";import d from"../../../../rest/support/GenerateRendererParameters.js";import f from"../../../../rest/support/StatisticDefinition.js";import{getSQLFilterForNormalization as p,mergeWhereClauses as m,getRangeExpr as h}from"../../../statistics/support/utils.js";import{isAnyDateField as g}from"../../utils.js";import{getSQLExpressionForDateOrTimeField as _,getFieldExpr as v,updateQueryWithFeatureFilter as y,defaultNumBins as b,generateBinParams as x,getViewInfoParams as S}from"./utils.js";import{createClassBreaksDefinition as C}from"../../../../statistics/utils.js";const w=`countOFExpr`;function T(e,t,r){let i=e.valueExpression||e.sqlExpression,a=e.signal;if(!i){let{field:i,normalizationType:o,normalizationField:s}=e,c=i?t.getField(i):null,l=g(c)||n(c);return{sqlExpression:l?_(t,c):v({field:i,normalizationType:o,normalizationField:s,normalizationTotal:r,layer:t}),sqlWhere:l?null:e.sqlWhere||p({field:i,normalizationType:o,normalizationField:s}),filter:e.filter,signal:a}}return{valueExpression:e.valueExpression,sqlExpression:e.sqlExpression,sqlWhere:e.sqlWhere,filter:e.filter,signal:a}}async function E(e,t,n){let{field:r,normalizationType:i,normalizationField:a,signal:o}=e,s=p({field:r,normalizationType:i,normalizationField:a}),c=new d({classificationDefinition:C({field:r,normalizationType:i,normalizationField:a,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,definedInterval:e.definedInterval,breakCount:e.numBins||b}),where:m(s,n)});return t.generateRenderer(c,o).then(e=>{let{normalizationTotal:n,classBreaks:o}=e;return x({field:r,normalizationType:i,normalizationField:a,normalizationTotal:n,classBreaks:o,where:s,layer:t})})}async function D(t,r,i,o,d){let{field:f,sqlExpression:p,normalizationField:m,classificationMethod:g,normalizationType:_}=t,y=f?r.getField(f):null,x=n(y),S=a(y)||x,C=t.numBins||b;if(S){if(_||g)throw new e(`${r.adapterName}:not-supported`,`NormalizationType and classificationMethod are not supported for date-only and time-only fields`);let t=(o-i)/C/1e3,n=t/86400;return new c({field:f,expression:p,expressionValueType:p?`double`:void 0,interval:{unit:x?`seconds`:`days`,value:Math.ceil(x?t:n)},start:i,end:o})}if(g===`defined-interval`)return new u({field:f,expression:p,expressionValueType:p?`double`:void 0,normalizationField:m,normalizationTotal:d,normalizationType:_,interval:t.definedInterval??Math.ceil((o-i)/C),start:_?null:i,end:_?null:o,normalizationMinValue:_?i:null,normalizationMaxValue:_?o:null});if(g===`manual`)throw new e(`${r.adapterName}:not-supported`,`Layer does not support manual classificationMethod`);if(g===`natural-breaks`||g===`quantile`||g===`standard-deviation`){let n=v({field:f,normalizationField:m,normalizationTotal:d,normalizationType:_,layer:r}),a=await E(t,r,t.minValue!==null&&t.maxValue!==null?h(n,t.minValue,t.maxValue):void 0);if(!a.intervals)throw new e(`${r.adapterName}:invalid`,`Invalid intervals returned from generate renderer`);let o=[i,...a.intervals.map(e=>e[1])];return new l({field:_?null:f,expression:_?n:p,expressionValueType:p?`double`:void 0,boundaries:o})}return new s({field:f,normalizationField:m,normalizationTotal:d,normalizationType:_,expression:p,expressionValueType:p?`double`:void 0,numBins:C,start:_?null:i,end:_?null:o,normalizationMinValue:_?i:null,normalizationMaxValue:_?o:null})}function O(e,t,n,r){return n!=null&&r!=null?Promise.resolve({min:n,max:r}):t.summaryStatistics({...e,outStatisticTypes:{include:[`min`,`max`]}}).then(e=>({min:e.min,max:e.max}))}async function k(e,n,a,s){let{field:c,minValue:l,maxValue:u,filter:d,view:p}=e,h=c?n.getField(c):null,g=r(h)||i(h),_=T(e,n,a),{min:v,max:b}=await O(_,n,l,u);if(v==null||b==null)return{query:null,min:v,max:b};let x=n.objectIdField,S=new f({statisticType:`count`,outStatisticFieldName:w,onStatisticField:x&&n.getField(x)?x:`1`}),{where:C,timeExtent:E}=s||{},k=m(C,_.sqlWhere),A=new o({binParameters:await D(e,n,v,b,a),outStatistics:[S],binOrder:e.sortOrder,where:k,timeExtent:E,lowerBoundaryAlias:`lowerBoundary`,upperBoundaryAlias:`upperBoundary`,outTimeZone:p?.timeZone&&g?t(p.timeZone):null,returnAggregateIds:e.returnAggregateIds??void 0});return y(A,d),{query:A,min:v,max:b}}function A(e,t=!1){return typeof e==`string`?(t?new Date(`1970-01-01T${e}Z`):new Date(e)).getTime():e}function j(e,t,r){let i=n(t),a=e.features.map(e=>{let t={minValue:A(e.attributes.lowerBoundary,i),maxValue:A(e.attributes.upperBoundary,i),count:e.attributes[w]};return e.statisticsAggregatedIds&&(t.aggregateIds=e.statisticsAggregatedIds),t});return{...r,bins:a}}function M(e,t,n){let{valueExpression:r,view:i}=e,{featuresJSON:a,graphics:o,fieldInfos:s}=t,c={field:e.field,valueExpression:r,sqlExpression:e.sqlExpression,normalizationType:e.normalizationType,normalizationField:e.normalizationField,normalizationTotal:n,minValue:e.minValue,maxValue:e.maxValue,standardDeviationInterval:e.standardDeviationInterval,classificationMethod:e.classificationMethod,numBins:e.numBins};return r&&i&&(a||o)&&(c.viewInfoParams=S(i),c.timeZone=i.timeZone,c.fieldInfos=s),c}export{E as binParamsFromGenRend,A as formatHistogramBinValue,k as getAttributeBinsQuery,O as getDataRange,M as getHistogramAttributeDefinition,T as getQueryParamsForExpr,j as processQueryAttributeBinsResult};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import i from"../../../core/Logger.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as s,whenOnce as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import i from"../../../core/Logger.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as s,whenOnce as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import d from"../../../symbols/CIMSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/has.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import f from"./graphics/GraphicsView2D.js";import p from"./graphics/GraphicContainer.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/mathUtils.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../../../geometry/support/normalizeUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{LayerView2D as m}from"./LayerView2D.js";import h from"./imagery/ImageryTileView2D.js";import g from"../../layers/ImageryTileLayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";let v=class extends _(m(g)){constructor(){super(...arguments),this._graphicsView=null,this.subview=null}get displayParameters(){let{layer:e}=this,t=this._get(`displayParameters`);return e.visible?{clipToNeatline:e.clippedToNeatline}:t}update(e){this.subview?.update(e),this._graphicsView?.processUpdate(e),this.notifyChange(`updating`)}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage();let e=this.subview=new h({layer:this.layer,layerView:this,scheduler:this.scheduler});e.useWebGLForProcessing=!0,e.useProgressiveUpdate=!0;let t=this._graphicsView=new f({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:new n,container:new p(this.view.featuresTilingScheme)}),l=new AbortController;y(this.layer,this._graphicsView.graphics,this.view.spatialReference);let u=r(()=>{l.abort(),this.container.removeChild(t.container),this._graphicsView=a(this._graphicsView)}),d=r(()=>{e.attached&&=(this.container.removeChild(e.container),e.detach(),!1),this.subview=a(this.subview),this.layer.decreaseRasterJobHandlerUsage()});this.addAttachHandles([u,d,s(()=>this.layer.clippedToNeatline,()=>{let t=e.redrawOrRefetch({refetch:!0,reprocess:!1}).catch(e=>{o(e)||i.getLogger(this).error(e)});this._updatingHandles.addPromise(t)})]),this.container.addChild(t.container),e.attach(),e.attached=!0,this.container.addChild(e.container),c(()=>!e.updating&&e.container.children.some(e=>e.bitmap?.rawPixelData?.pixelBlock!=null),l.signal).then(()=>u.remove()).catch(e=>{o(e)||i.getLogger(this).error(e)}),this.requestUpdate()}detach(){}viewChange(){this._graphicsView?.viewChange(),this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}};e([l()],v.prototype,`subview`,void 0),e([l({readOnly:!0})],v.prototype,`displayParameters`,null),v=e([u(`esri.views.2d.layers.GeospatialPDFLayerView2D`)],v);function y(e,n,r){let i=e.createNeatline(r),a=new t({geometry:i,symbol:b()});n.add(a)}function b(){return new d({data:{type:`CIMSymbolReference`,symbol:{type:`CIMPolygonSymbol`,symbolLayers:[{type:`CIMSolidStroke`,color:[80,170,205,255],enable:!0,joinStyle:`Miter`,width:4,effects:[{type:`CIMGeometricEffectOffset`,method:`Square`,offset:-4}]},{type:`CIMSolidFill`,effects:[{type:`CIMGeometricEffectBuffer`,size:-4}],animations:[{type:`CIMSymbolAnimationColor`,animatedSymbolProperties:{type:`CIMAnimatedSymbolProperties`,duration:3,easing:`EaseInOut`,playAnimation:!0,randomizeStartTime:!1,repeatType:`Oscillate`},toColor:[145,215,235,50]}],color:[145,215,235,100],enable:!0}]}}})}const x=v;export{x as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{property as n,subclass as r}from"../../../core/accessorSupport/decorators.js";import{projectWithoutEngine as i}from"../../../geometry/projectionUtils.js";import{empty as a,expand as o,allFinite as s,equals as c}from"../../../geometry/support/aaBoundingRect.js";import{isTiledLayer as l}from"../../../layers/support/layerUtils.js";import{webMercatorWorldExtent as u,geographicWorldExtent as d}from"./TerrainConst.js";import{getTiledLayerInfo as f,isProjectableRasterLayer as p}from"./terrainUtils.js";let m=class extends t{constructor(e){super(e)}destroy(){}get layerViewsExtent(){return this._computeLayerViewsExtent()}get tiledLayersExtent(){return this._computeTiledLayersExtent()}};e([n({readOnly:!0})],m.prototype,`layerViewsExtent`,null),e([n({readOnly:!0})],m.prototype,`tiledLayersExtent`,null),e([n()],m.prototype,`viewSpatialReference`,void 0),e([n()],m.prototype,`tilingScheme`,void 0),e([n()],m.prototype,`defaultTiledLayersExtent`,void 0),e([n({constructOnly:!0})],m.prototype,`layers`,void 0),e([n({constructOnly:!0})],m.prototype,`layerViews`,void 0),m=e([r(`esri.views.3d.terrain.ExtentHelper`)],m);function h(e,t){return e===1?new g(t):new _(t)}let g=class extends m{_computeLayerViewsExtent(){return this._globalExtent}_computeTiledLayersExtent(){return this._globalExtent}get _globalExtent(){return this.viewSpatialReference.isWebMercator?u:d}};g=e([r(`esri.views.3d.terrain.ExtentHelper.ExtentHelperGlobal`)],g);let _=class extends m{_computeLayerViewsExtent(){let e=a(),t=this.viewSpatialReference;this.layerViews.forEach(n=>{let r=n.layer;if(n.isResolved()&&(r.type!==`graphics`||!r.internal)){let r=v(`fullExtentInLocalViewSpatialReference`in n&&n.fullExtentInLocalViewSpatialReference||n.layer.fullExtent,t);o(e,r,e)}});let n=s(e)?e:null,r=this._get(`layerViewsExtent`);return c(n,r)?r:n}_computeTiledLayersExtent(){let e=this.tilingScheme;if(!e)return null;let t=this.viewSpatialReference,n=a();this.layers.forEach(r=>{if(r.loaded&&l(r)){let i=f(r,t,2);if(i==null)return;let{tileInfo:a,fullExtent:s}=i,c=`tilemapCache`in r?r.tilemapCache?.effectiveMaxLOD:void 0;a!=null&&s!=null&&(p(r)||e.compatibleWith(a,c)&&s.spatialReference.equals(e.spatialReference))&&o(n,s,n)}}),o(n,this.defaultTiledLayersExtent,n);let r=s(n)?n:null,i=this._get(`tiledLayersExtent`);return c(r,i)?i:r}};_=e([r(`esri.views.3d.terrain.ExtentHelper.ExtentHelperLocal`)],_);function v(e,t){return e!=null&&!e.spatialReference.equals(t)?i(e,e.spatialReference,t):e}export{m as ExtentHelper,h as create};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{MemCachePool as n}from"../../../core/MemCachePool.js";import r from"../../../core/ObjectPool.js";import{watch as i,sync as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{subtract as c,set as l,dot as u}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as d,fromValues as f,create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as m,ZEROS as h}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as g,set as _}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as v}from"../../../geometry/support/buffer/BufferView.js";import{overlayRenderOccludedFlag as y}from"./OverlayRenderer.js";import{PatchRenderData as b}from"./PatchRenderData.js";import{TerrainAttributesCache as x}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as S}from"./terrainUtils.js";import{TileRenderer as C}from"./TileRenderer.js";import{IteratorPreorder as w,fallsWithinLayerView as T,sortTiles as E,compareTiles as D}from"./tileUtils.js";import{getOverlayContentForOutputTerrain as O}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as k}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as A}from"../webgl-engine/lib/Attribute.js";import{IntersectorResultRay as j}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as M,MeshIntersectionOptions as N,intersectTriangles as P}from"../webgl-engine/lib/RayIntersections.js";import{TriangleIntersectionData as F}from"../webgl-engine/lib/TriangleIntersectionData.js";import{terrainId as I,getVerticalOffsetTerrain as L}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as R}from"../webgl-engine/materials/DrawParameters.js";import{hasShadowHighlights as z}from"../webgl-engine/shaders/ReceiveShadowsConfiguration.js";import{T as B}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as V}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as H}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as U}from"../../webgl/enums.js";const W=g();let G=class extends k{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return this._stage.viewingMode===1}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,i,a,o){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=i,this._compressionTracker=a,this.type=7,this.isGround=!0,this._passParameters=new B,this._drawParameters=new R,this._renderDataPool=new r(()=>new b),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new w,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._stencilEnabledLayerExtents=[],this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>this._desiredSlot===1],[7,()=>this._desiredSlot===7],[9,()=>this._produces()&&this.renderOccludedFlags===y]]),this._tileSize=256,this._configuration=new H(t.viewingMode===1),this._tileTextureCache=new n((e,t)=>o.newCache(e,t),`TileTexture`),this.tileGeometryCache=new x(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(i(()=>this._overlayRenderer.renderOccludedFlags,()=>this.setNeedsRender(),a))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set(`renderingDisabled`,!!e),this.setDirty()}set visible(e){this._set(`visible`,!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange(`renderPatchBorders`))}get layerViewUid(){return I}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,this._tileRenderer!=null&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),!this.reuseTextureFromParent(e)&&this.updateTileTexture(e,32)}reuseTextureFromParent(e){let{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;let n=m(e.lij[2]&1?.5:0,e.lij[1]&1?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,n)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;let{layerInfo:n,surface:r}=t;for(let i=0;i<n[1].length;i++){let n=r.layerViewByIndex(i,1);if(T(e,n)!==T(t,n))return!1}return!0}updateTileTexture(e,t){this._tileRenderer!=null&&(this._tileRenderer.updateTileTexture(e,t===32?0:2),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(let t of e.layerInfo[0])t.pendingUpdates&=-9;e.resetPendingUpdate(8);let t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){let t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){let t=Math.max(0,Math.floor((e.level-3)/7)*7);if(this._isGlobal&&t===0)return d;for(;e.parent&&e.level>t;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get(`wireframe`)!==e&&(this._set(`wireframe`,e),this.setNeedsRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new C(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=t(this._tileRenderer)}intersectRay(e,t,n,r){let i=this._rootTiles;if(!i||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==0)return;let a=K,o=q;c(a,r,n),l(o,1/a[0],1/a[1],1/a[2]);let s=e.results.min,d=e.results.max,f=e.results.ground,p=e.options.store===0,m=!!e.results.ground.target,h=L(e.verticalOffset),g=e.tolerance,y,b=p&&s.distance!=null?s.distance:1/0,x=e.options,S=x.normalRequired||!x.backfacesTerrain,C=new N(g,!1,S),w=i=>{let l=i.renderData;if(!l?.vao)return;let m=l.geometry;_(W,m.boundingBox);let w=l.localOrigin;if(h!=null&&(h.localOrigin=w,h.applyToAabb(W)),J[0]=n[0]-w[0],J[1]=n[1]-w[1],J[2]=n[2]-w[2],!M(W,J,o,g,b))return;let T=(e,t,n,r)=>{e.set(this.type,i,t,n,r),b=p&&s.renderDistance!=null?s.renderDistance:1/0},E=(i,o,c)=>{(!S||c!=null)&&o>=0&&(x.backfacesTerrain||u(c,a)<0)&&(x.invisibleTerrain||!x.selectionMode||t==null||t(n,r,o))&&((f.renderDistance==null||o<f.renderDistance)&&T(f,i,o,c),!x.isFiltered&&(x.store===2&&(y==null?(y=new j(e.ray),T(y,i,o,c),e.results.all.push(y)):o<y.renderDistance&&T(y,i,o,c)),(s.renderDistance==null||o<s.renderDistance)&&T(s,i,o,c),x.store!==0&&(d.renderDistance==null||o>d.renderDistance)&&T(d,i,o,c)))},D=Y;c(D,r,w);let{indices:O,indexCount:k}=m,N=m.vertexAttributes,I=N.getField(`position`,v),L=new A(I.typedBuffer,3,N.stride/4),R=k/3;!h&&R>200?(l.intersectionData??=new F(O,R,L),l.intersectionData.intersectRay(J,D,C,E)):P(J,D,0,R,(e,t)=>I.getVec(O[t],e),h,C,E)},T=this._tileIterator;T.reset(i);let E=e.options.invisibleTerrain;for(let e=T.next();e;e=T.next())(e.visible||E&&e.intersectsClippingArea)&&(h!=null||e.intersectsRay(n,a,g,b))&&(!m||!this._useStencilForTile(e))?w(e):T.skipSubtree()}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(let t of this._visiblePatchesByOrigin.values())for(let n of t)n.renderData?.textureReference!=null&&e.queriesForTile(n);e.process(),t.madeProgress()}}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return 7;case 3:case 4:return null}}acquireTechniques(e){let{shadowMap:t,viewshedEnabled:n,cutFillComputationEnabled:r,slot:i,hasEmission:a,useFloatBlend:o}=e.bind,s=!!has(`enable-feature:terrain-shadows`)&&t.enabled;if(s!==this._castShadows&&(this._castShadows=s,this._patchesByOriginDirty=!0),this._inViewshed!==n&&(this._inViewshed=n,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),this.transparency===3)return null;if(i===9){if((e.renderOccludedMask&y)===0)return null}else if(i!==this._desiredSlot)return null;let c=this._configuration;switch(c.screenSpaceReflections=c.cloudReflections=c.receiveShadows=c.hasShadowHighlights=c.receiveAmbientOcclusion=c.renderOccluded=c.hasHighlightMixTexture=!1,c.hasEmission=a,c.overlayMode=this._overlayRenderer.mode,c.useFloatBlend=o.value,e.output){case 0:case 1:case 2:{let n=e.bind;c.screenSpaceReflections=n.hasScreenSpaceReflections,c.cloudReflections=n.clouds.data!=null;let r=i===9;return c.receiveShadows=t.ready&&!r,c.hasShadowHighlights=z(c,e.bind),c.renderOccluded=r,c.receiveAmbientOcclusion=!r&&n.ssao!=null,c.receiveGlobalIllumination=!r&&n.globalIlluminationEnabled,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:case 11:return this._acquireTechnique(e.output);case 10:return c.hasHighlightMixTexture=e.bind.highlightMixTexture!=null,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),this._passParameters.useStencil=!1,this._passParameters.overlayContent=O(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{let n=e.bind.highlight?.name;n&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(n)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(this._tileRenderer==null)return;let t=this._tileRenderer,n;if(e!=null){let t=e.toUnitRGBA();n=f(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(n),this._allTiles.forAll(e=>t.updateTileTexture(e,0)),this._configuration.tileBlendInput=t.backgroundIsGrid?2:t.backgroundColor==null?0:1,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){let e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(let n of e)E(n,t);e.sort((e,t)=>D(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange(`visibleTiles`),this._patchSortingDirty=!1}}_rebuildPatchGroups(){let e=this._rootTiles;if(e!=null){e[0]?.surface.checkAllTilesWaterproofness(`render-patch-groups`),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(let t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){let t=this._tileIterator;for(t.resetOne(e);!t.done;){let e=t.next(),n=e.renderData;if(!n){this._numTilesCulled++;continue}let r=n.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let i=this._visiblePatchesByOrigin.get(r);i||(i=[],this._visiblePatchesByOrigin.set(r,i)),i.push(e),t.skipSubtree()}}_useStencilForTile(e){for(let t of this._stencilEnabledLayerExtents)if(e.intersectsExtent(t))return!0;return!1}_renderAuxiliaryPass(e,t,n){let{rctx:r,bind:i}=e;r.bindTechnique(t,i,this._passParameters);let a=this._stencilEnabledLayerExtents.length>0;n.forEach(n=>{this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(i,this._passParameters,this._drawParameters);for(let r=0;r<n.length;r++)this._renderPatch(e,t,n[r],U.TRIANGLES,a,this._passParameters.overlayContent===null)}),r.bindVAO(null)}_renderMaterialPass(e,t){let{rctx:n,bind:r}=e,i=n.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;let a=r.slot===9;a&&(i.bindTexture(`tex`,n.emptyTexture),i.setUniform3fv(`textureOpacities`,d),i.setUniform4fv(`texOffsetAndScale`,h));let o=this._tileRenderer?.backgroundColor==null?d:this._tileRenderer.backgroundColor;this._configuration.tileBlendInput===1&&i.setUniform3fv(`backgroundColor`,o);let s=this._stencilEnabledLayerExtents.length>0,c=this.wireframe?U.LINES:U.TRIANGLES;this._configuration.textureFadingEnabled&&i.bindTexture(`texNext`,n.emptyTexture);for(let n of this._visiblePatchesByOrigin.values()){this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(let r of n){let n=r.renderData,o=n.textureReference;if(o!=null){if(!a){i.setUniform4fv(`texOffsetAndScale`,o.offsetAndScale),i.bindTexture(`tex`,o.texture.texture);let e=n.textureFadeFactor,t=e<1?n.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(i.setUniform1f(`fadeFactor`,e),i.setUniform4fv(`nextTexOffsetAndScale`,t.offsetAndScale),i.setUniform3fv(`nextTexOpacities`,t.opacities),i.bindTexture(`texNext`,t.texture.texture)):i.setUniform1f(`fadeFactor`,1),n.textureIsFading&&this.setNeedsRender(2),i.setUniform3fv(`textureOpacities`,o.opacities)}this._renderPatch(e,t,r,c,s),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}n.bindVAO(null)}_renderPatch(e,t,n,r,i,a=!1){let o=n.renderData,s=o.vao,c=s?.indexBuffer;if(!s||c==null){S&&console.error(`Rendered tile with no indices: `,n.lij,` : `,o);return}let l=t.program;!a&&!this._overlayRenderer.isEmpty&&this._bindOverlayPatchData(l,o.overlay);let{rctx:u,bind:d}=e;i&&(this._passParameters.useStencil=this._useStencilForTile(n),u.setPipelineState(t.getPipeline(d,this._passParameters)));let f=o.geometry.indexCount;u.bindVAO(s),l.assertCompatibleVertexAttributeLocations(s),u.drawElements(r,f,c.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv(`overlayTexOffset`,t.offsets),e.setUniform4fv(`overlayTexScale`,t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(V,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],G.prototype,`visibleTiles`,null),e([o({readOnly:!0})],G.prototype,`_isGlobal`,null),e([o()],G.prototype,`renderOccludedFlags`,null),e([o({value:!1})],G.prototype,`renderingDisabled`,null),e([o({value:!0})],G.prototype,`visible`,null),e([o()],G.prototype,`renderPatchBorders`,null),e([o()],G.prototype,`wireframe`,null),G=e([s(`esri.views.3d.terrain.TerrainRenderer`)],G);const K=p(),q=p(),J=p(),Y=p();export{G as TerrainRenderer};
|
|
2
|
+
import{__decorate as e}from"tslib";import has from"../../../core/has.js";import{disposeMaybe as t}from"../../../core/maybe.js";import{MemCachePool as n}from"../../../core/MemCachePool.js";import r from"../../../core/ObjectPool.js";import{watch as i,sync as a}from"../../../core/reactiveUtils.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import{subtract as c,set as l,dot as u}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as d,fromValues as f,create as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as m,ZEROS as h}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{create as g,set as _}from"../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as v}from"../../../geometry/support/buffer/BufferView.js";import{overlayRenderOccludedFlag as y}from"./OverlayRenderer.js";import{PatchRenderData as b}from"./PatchRenderData.js";import{TerrainAttributesCache as x}from"./TerrainAttributesCache.js";import{enableTerrainInternalChecks as S}from"./terrainUtils.js";import{TileRenderer as C}from"./TileRenderer.js";import{IteratorPreorder as w,fallsWithinLayerView as T,usesStencil as E,sortTiles as D,compareTiles as O}from"./tileUtils.js";import{getOverlayContentForOutputTerrain as k}from"../webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js";import{SyncRenderPlugin as A}from"../webgl-engine/effects/RenderPlugin.js";import{Vertices as j}from"../webgl-engine/lib/Attribute.js";import{IntersectorResultRay as M}from"../webgl-engine/lib/IntersectorResult.js";import{intersectAabbInvDirBefore as N,MeshIntersectionOptions as P,intersectTriangles as F}from"../webgl-engine/lib/RayIntersections.js";import{TriangleIntersectionData as I}from"../webgl-engine/lib/TriangleIntersectionData.js";import{terrainId as L,getVerticalOffsetTerrain as R}from"../webgl-engine/lib/verticalOffsetUtils.js";import{DrawParameters as z}from"../webgl-engine/materials/DrawParameters.js";import{hasShadowHighlights as B}from"../webgl-engine/shaders/ReceiveShadowsConfiguration.js";import{T as V}from"../../../chunks/Terrain.glsl.js";import{TerrainTechnique as H}from"../webgl-engine/shaders/TerrainTechnique.js";import{TerrainTechniqueConfiguration as U}from"../webgl-engine/shaders/TerrainTechniqueConfiguration.js";import{PrimitiveType as W}from"../../webgl/enums.js";const G=g();let K=class extends A{get visibleTiles(){return Array.from(this._visiblePatchesByOrigin.values()).flat()}get _isGlobal(){return this._stage.viewingMode===1}get _techniques(){return this._context.techniques}get _rctx(){return this._context.renderContext.rctx}get renderOccludedFlags(){return this._overlayRenderer.renderOccludedFlags}constructor(e,t,i,a,o){super({}),this._overlayRenderer=e,this._stage=t,this._allTiles=i,this._compressionTracker=a,this.type=7,this.isGround=!0,this._passParameters=new V,this._drawParameters=new z,this._renderDataPool=new r(()=>new b),this._visiblePatchesByOrigin=new Map,this._allPatchesByOrigin=new Map,this._patchesByOriginDirty=!0,this._patchSortingDirty=!0,this._tileIterator=new w,this._castShadows=!1,this._inViewshed=!1,this._cutFillEnabled=!1,this._tileRenderer=null,this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0,this.produces=new Map([[1,()=>this._desiredSlot===1],[7,()=>this._desiredSlot===7],[9,()=>this._produces()&&this.renderOccludedFlags===y]]),this._tileSize=256,this._configuration=new U(t.viewingMode===1),this._tileTextureCache=new n((e,t)=>o.newCache(e,t),`TileTexture`),this.tileGeometryCache=new x(o)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this),this.addHandles(i(()=>this._overlayRenderer.renderOccludedFlags,()=>this.setNeedsRender(),a))}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy(),this._allTiles.prune(),this._tileRenderer=null}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}set renderingDisabled(e){this._set(`renderingDisabled`,!!e),this.setDirty()}set visible(e){this._set(`visible`,!!e),this.setDirty()}updateHeading(e){this._tileRenderer?.updateHeading(e)}set transparency(e){this._configuration.transparencyMode!==e&&(this._configuration.transparencyMode=e,this.setNeedsRender())}get transparency(){return this._configuration.transparencyMode}get renderPatchBorders(){return this._configuration.tileBorders}set renderPatchBorders(e){this._configuration.tileBorders!==e&&(this._configuration.tileBorders=e,this.setNeedsRender(),this.notifyChange(`renderPatchBorders`))}get layerViewUid(){return L}get slicePlaneEnabled(){return this._configuration.hasSlicePlane}set slicePlaneEnabled(e){this._configuration.hasSlicePlane!==e&&(this._configuration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._configuration.textureFadingEnabled!==e&&(this._configuration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._configuration.pbrMode!==e&&(this._configuration.pbrMode=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}set tileSize(e){this._tileSize=e,this._tileRenderer!=null&&(this._tileRenderer.tileSize=e),this.setDirty()}get tileSize(){return this._tileSize}_ensureRenderData(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e,this._getLocalOriginOfTile(e)))}loadTile(e){this._ensureRenderData(e),this.updateTileGeometryState(e),!this.reuseTextureFromParent(e)&&this.updateTileTexture(e,32)}reuseTextureFromParent(e){let{parent:t}=e;if(!this._canReuseTextureFromParent(t,e))return!1;let n=m(e.lij[2]&1?.5:0,e.lij[1]&1?0:.5,.5,.5);return t.renderData?.reuseTexture(e.renderData,n)??!1}_canReuseTextureFromParent(e,t){if(!e)return!1;let{layerInfo:n,surface:r}=t;for(let i=0;i<n[1].length;i++){let n=r.layerViewByIndex(i,1);if(T(e,n)!==T(t,n))return!1}return!0}updateTileTexture(e,t){this._tileRenderer!=null&&(this._tileRenderer.updateTileTexture(e,t===32?0:2),this.setNeedsRender(),e.resetPendingUpdate(t))}updateTileGeometryState(e){for(let t of e.layerInfo[0])t.pendingUpdates&=-9;e.resetPendingUpdate(8);let t=e.renderData.updateGeometryState();return t&&this.setDirty(),t}updateGeometryIfNeeded(e){e.loaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){let t=e.renderData;t&&(t.releaseGeometry(),this._renderDataPool.release(t),t.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){let t=Math.max(0,Math.floor((e.level-3)/7)*7);if(this._isGlobal&&t===0)return d;for(;e.parent&&e.level>t;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get(`wireframe`)!==e&&(this._set(`wireframe`,e),this.setNeedsRender())}setDirty(e=1){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=1){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=1){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new C(this._rctx,this._tileSize,this._techniques,this._tileTextureCache,this._compressionTracker),this.updateTileBackground()}uninitializeRenderContext(){this._tileRenderer=t(this._tileRenderer)}intersectRay(e,t,n,r){let i=this._rootTiles;if(!i||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==0)return;let a=q,o=J;c(a,r,n),l(o,1/a[0],1/a[1],1/a[2]);let s=e.results.min,d=e.results.max,f=e.results.ground,p=e.options.store===0,m=!!e.results.ground.target,h=R(e.verticalOffset),g=e.tolerance,y,b=p&&s.distance!=null?s.distance:1/0,x=e.options,S=x.normalRequired||!x.backfacesTerrain,C=new P(g,!1,S),w=i=>{let l=i.renderData;if(!l?.vao)return;let m=l.geometry;_(G,m.boundingBox);let w=l.localOrigin;if(h!=null&&(h.localOrigin=w,h.applyToAabb(G)),Y[0]=n[0]-w[0],Y[1]=n[1]-w[1],Y[2]=n[2]-w[2],!N(G,Y,o,g,b))return;let T=(e,t,n,r)=>{e.set(this.type,i,t,n,r),b=p&&s.renderDistance!=null?s.renderDistance:1/0},E=(i,o,c)=>{(!S||c!=null)&&o>=0&&(x.backfacesTerrain||u(c,a)<0)&&(x.invisibleTerrain||!x.selectionMode||t==null||t(n,r,o))&&((f.renderDistance==null||o<f.renderDistance)&&T(f,i,o,c),!x.isFiltered&&(x.store===2&&(y==null?(y=new M(e.ray),T(y,i,o,c),e.results.all.push(y)):o<y.renderDistance&&T(y,i,o,c)),(s.renderDistance==null||o<s.renderDistance)&&T(s,i,o,c),x.store!==0&&(d.renderDistance==null||o>d.renderDistance)&&T(d,i,o,c)))},D=X;c(D,r,w);let{indices:O,indexCount:k}=m,A=m.vertexAttributes,P=A.getField(`position`,v),L=new j(P.typedBuffer,3,A.stride/4),R=k/3;!h&&R>200?(l.intersectionData??=new I(O,R,L),l.intersectionData.intersectRay(Y,D,C,E)):F(Y,D,0,R,(e,t)=>P.getVec(O[t],e),h,C,E)},T=this._tileIterator;T.reset(i);let D=e.options.invisibleTerrain;for(let e=T.next();e;e=T.next())(e.visible||D&&e.intersectsClippingArea)&&(h!=null||e.intersectsRay(n,a,g,b))&&(!m||!E(e,this._stencilEnabledLayerExtents))?w(e):T.skipSubtree()}processScaleRangeQueries(e,t){if(!t.done&&e)for(this._updatePatchGroups();e.updating&&!t.done;){e.prepare();for(let t of this._visiblePatchesByOrigin.values())for(let n of t)n.renderData?.textureReference!=null&&e.queriesForTile(n);e.process(),t.madeProgress()}}get _desiredSlot(){if(!this._produces())return null;switch(this.transparency){case 0:return 1;case 1:case 2:return 7;case 3:case 4:return null}}acquireTechniques(e){let{shadowMap:t,viewshedEnabled:n,cutFillComputationEnabled:r,slot:i,hasEmission:a,useFloatBlend:o}=e.bind,s=!!has(`enable-feature:terrain-shadows`)&&t.enabled;if(s!==this._castShadows&&(this._castShadows=s,this._patchesByOriginDirty=!0),this._inViewshed!==n&&(this._inViewshed=n,this._patchesByOriginDirty=!0),this._cutFillEnabled!==r&&(this._cutFillEnabled=r,this._patchesByOriginDirty=!0),this.transparency===3)return null;if(i===9){if((e.renderOccludedMask&y)===0)return null}else if(i!==this._desiredSlot)return null;let c=this._configuration;switch(c.screenSpaceReflections=c.cloudReflections=c.receiveShadows=c.hasShadowHighlights=c.receiveAmbientOcclusion=c.renderOccluded=c.hasHighlightMixTexture=!1,c.hasEmission=a,c.overlayMode=this._overlayRenderer.mode,c.useFloatBlend=o.value,e.output){case 0:case 1:case 2:{let n=e.bind;c.screenSpaceReflections=n.hasScreenSpaceReflections,c.cloudReflections=n.clouds.data!=null;let r=i===9;return c.receiveShadows=t.ready&&!r,c.hasShadowHighlights=B(c,e.bind),c.renderOccluded=r,c.receiveAmbientOcclusion=!r&&n.ssao!=null,c.receiveGlobalIllumination=!r&&n.globalIlluminationEnabled,this._acquireTechnique(e.output)}case 5:case 7:return this._castShadows?this._acquireTechnique(5):null;case 8:return this._inViewshed?this._acquireTechnique(8):null;case 9:return this._cutFillEnabled?this._acquireTechnique(9):null;case 3:case 4:case 11:return this._acquireTechnique(e.output);case 10:return c.hasHighlightMixTexture=e.bind.highlightMixTexture!=null,this._overlayRenderer.hasHighlights?this._acquireTechnique(10):null}return null}render(e,t){switch(this._updatePatchGroups(),this._passParameters.useStencil=!1,this._passParameters.overlayContent=k(e.output,e.bind),e.output){case 0:case 1:case 2:return this._renderMaterialPass(e,t);case 3:case 4:case 11:return this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);case 10:{let n=e.bind.highlight?.name;n&&this._overlayRenderer.hasHighlights&&this._overlayRenderer.renders(2)&&this._overlayRenderer.hasHighlight(n)&&this._renderAuxiliaryPass(e,t,this._visiblePatchesByOrigin);break}case 5:case 7:case 8:case 9:return this._renderAuxiliaryPass(e,t,this._allPatchesByOrigin)}}updateTileBackground(e){if(this._tileRenderer==null)return;let t=this._tileRenderer,n;if(e!=null){let t=e.toUnitRGBA();n=f(t[0]||0,t[1]||0,t[2]||0)}t.setBackground(n),this._allTiles.forAll(e=>t.updateTileTexture(e,0)),this._configuration.tileBlendInput=t.backgroundIsGrid?2:t.backgroundColor==null?0:1,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty){let e=Array.from(this._visiblePatchesByOrigin.values()),t=this._stencilEnabledLayerExtents;for(let n of e)D(n,t);e.sort((e,t)=>O(e[0],t[0])),this._visiblePatchesByOrigin=new Map(e.map(e=>[e[0].renderData.localOrigin,e])),this.notifyChange(`visibleTiles`),this._patchSortingDirty=!1}}_rebuildPatchGroups(){let e=this._rootTiles;if(e!=null){e[0]?.surface.checkAllTilesWaterproofness(`render-patch-groups`),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(let t of e)this._rebuildPatchGroupsForRootTile(t)}}_rebuildPatchGroupsForRootTile(e){let t=this._tileIterator;for(t.resetOne(e);!t.done;){let e=t.next(),n=e.renderData;if(!n){this._numTilesCulled++;continue}let r=n.localOrigin;if(this._castShadows||this._inViewshed||this._cutFillEnabled){let t=this._allPatchesByOrigin.get(r);t||(t=[],this._allPatchesByOrigin.set(r,t)),t.push(e)}if(!e.visible){this._numTilesCulled++,t.skipSubtree();continue}let i=this._visiblePatchesByOrigin.get(r);i||(i=[],this._visiblePatchesByOrigin.set(r,i)),i.push(e),t.skipSubtree()}}_renderAuxiliaryPass(e,t,n){let{rctx:r,bind:i}=e;r.bindTechnique(t,i,this._passParameters);let a=!!this._stencilEnabledLayerExtents?.length;n.forEach(n=>{this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(i,this._passParameters,this._drawParameters);for(let r=0;r<n.length;r++)this._renderPatch(e,t,n[r],W.TRIANGLES,a,this._passParameters.overlayContent===null)}),r.bindVAO(null)}_renderMaterialPass(e,t){let{rctx:n,bind:r}=e,i=n.bindTechnique(t,r,this._passParameters);this._numTilesRendered=0,this._numTilesCulled=0,this._numOriginsRendered=0;let a=r.slot===9;a&&(i.bindTexture(`tex`,n.emptyTexture),i.setUniform3fv(`textureOpacities`,d),i.setUniform4fv(`texOffsetAndScale`,h));let o=this._tileRenderer?.backgroundColor==null?d:this._tileRenderer.backgroundColor;this._configuration.tileBlendInput===1&&i.setUniform3fv(`backgroundColor`,o);let s=!!this._stencilEnabledLayerExtents?.length,c=this.wireframe?W.LINES:W.TRIANGLES;this._configuration.textureFadingEnabled&&i.bindTexture(`texNext`,n.emptyTexture);for(let n of this._visiblePatchesByOrigin.values()){this._drawParameters.origin=n[0].renderData.localOrigin,t.program.bindDraw(r,this._passParameters,this._drawParameters),this._numOriginsRendered++;for(let r of n){let n=r.renderData,o=n.textureReference;if(o!=null){if(!a){i.setUniform4fv(`texOffsetAndScale`,o.offsetAndScale),i.bindTexture(`tex`,o.texture.texture);let e=n.textureFadeFactor,t=e<1?n.nextTextureReference:null;this._configuration.textureFadingEnabled&&t&&e<1?(i.setUniform1f(`fadeFactor`,e),i.setUniform4fv(`nextTexOffsetAndScale`,t.offsetAndScale),i.setUniform3fv(`nextTexOpacities`,t.opacities),i.bindTexture(`texNext`,t.texture.texture)):i.setUniform1f(`fadeFactor`,1),n.textureIsFading&&this.setNeedsRender(2),i.setUniform3fv(`textureOpacities`,o.opacities)}this._renderPatch(e,t,r,c,s),r.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}n.bindVAO(null)}_renderPatch(e,t,n,r,i,a=!1){let o=n.renderData,s=o.vao,c=s?.indexBuffer;if(!s||c==null){S&&console.error(`Rendered tile with no indices: `,n.lij,` : `,o);return}let l=t.program;!a&&!this._overlayRenderer.isEmpty&&this._bindOverlayPatchData(l,o.overlay);let{rctx:u,bind:d}=e;i&&(this._passParameters.useStencil=E(n,this._stencilEnabledLayerExtents),u.setPipelineState(t.getPipeline(d,this._passParameters)));let f=o.geometry.indexCount;u.bindVAO(s),l.assertCompatibleVertexAttributeLocations(s),u.drawElements(r,f,c.indexType,0)}_bindOverlayPatchData(e,t){e.setUniform4fv(`overlayTexOffset`,t.offsets),e.setUniform4fv(`overlayTexScale`,t.scales)}_acquireTechnique(e){return this._configuration.output=e,this._techniques.get(H,this._configuration)}get test(){}hasHighlight(e){return this._overlayRenderer.hasHighlight(e)}};e([o({readOnly:!0})],K.prototype,`visibleTiles`,null),e([o({readOnly:!0})],K.prototype,`_isGlobal`,null),e([o()],K.prototype,`renderOccludedFlags`,null),e([o({value:!1})],K.prototype,`renderingDisabled`,null),e([o({value:!0})],K.prototype,`visible`,null),e([o()],K.prototype,`renderPatchBorders`,null),e([o()],K.prototype,`wireframe`,null),K=e([s(`esri.views.3d.terrain.TerrainRenderer`)],K);const q=p(),J=p(),Y=p(),X=p();export{K as TerrainRenderer};
|