@arcgis/core 4.33.0-next.20250511 → 4.33.0-next.20250513
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/0766ecb677d667e5fb83.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/0f57b6a3a85a47ebd9d0.js +346 -0
- package/assets/esri/core/workers/chunks/218a66d53f7cf4f285aa.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{a5e746e10239a3bfe237.js → 30f3014c0ac6e2bc14bf.js} +1 -1
- package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/90ae15ce22a49bd84876.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{fbcd94f60f92257a7303.js → aa82925ffb00babb0543.js} +2 -2
- package/assets/esri/core/workers/chunks/{fbcd94f60f92257a7303.js.LICENSE.txt → aa82925ffb00babb0543.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/b4f38fe9cc948a39ad87.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{0aca29f7156b2b412f2e.js → d1f7bfb8daf11ecada9f.js} +1 -1
- package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/e9b1349a2b3a3f300808.js +1 -0
- package/assets/esri/core/workers/chunks/{a8b42d8c0b76c234c09f.js → fef1a5f8a6fd3502b33b.js} +56 -57
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +4 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/ShadowCastAccumulate.glsl.js +1 -1
- package/chunks/ShadowHighlight.glsl.js +5 -5
- package/chunks/Theme.js +1 -1
- package/chunks/Tick.js +1 -1
- package/interfaces.d.ts +114 -11
- package/layers/VideoLayer.js +1 -1
- package/layers/knowledgeGraph/supportUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/package.json +3 -4
- package/support/revision.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
- package/views/3d/layers/graphics/pipeline/FeatureProcessingContext.js +1 -1
- package/views/3d/layers/graphics/pipeline/Tile3DManager.js +1 -1
- package/views/3d/layers/graphics/pipeline/TileLocks.js +5 -0
- package/views/3d/layers/graphics/pipeline/featureData/FeatureData.js +1 -1
- package/views/3d/layers/graphics/pipeline/featureData/FeatureDataSubset.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +2 -27
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +29 -0
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/analysis/analysisViewUtils.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/webscene/Slide.js +1 -1
- package/widgets/Editor/Edits.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Column.js +1 -1
- package/widgets/FeatureTable/support/ColumnTemplateBase.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/support/iconUtils.js +1 -1
- package/assets/esri/core/workers/chunks/83d6a1b3db7d364d156b.js +0 -1
- package/assets/esri/core/workers/chunks/92cbe9af8a6c061bfb57.js +0 -346
- package/views/3d/layers/graphics/pipeline/TileActionSynchronizer.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Accessor.js";import i from"../../core/Error.js";import t from"../../core/Logger.js";import{someMap as s}from"../../core/MapUtils.js";import{createResolver as o,createAbortError as a,isAbortError as n}from"../../core/promiseUtils.js";import{on as l,watch as h,syncAndInitial as y}from"../../core/reactiveUtils.js";import{schedule as p}from"../../core/scheduling.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{get as w}from"../../core/accessorSupport/get.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{destroyMap as m}from"../../support/collectionUtils.js";import{LayerLayerViewInfo as u}from"./LayerLayerViewInfo.js";function g(e){return null!=e&&"object"==typeof e&&"layerViews"in e}let _=class extends r{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new f,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const r of e)this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(null==this._workPromise&&(this._workPromise=o(),this._workPromise.promise.catch((()=>{}))),this.removeHandles("reschedule"),this.addHandles(p(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{const e=this.view.map;if(this.destroyed||!e)return void this.clear();if(this._map!==e&&(this.clear(),this._map=e),null==this._workPromise)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,i=[],t=this.view.ready,s=e=>{if(null!=e)for(const o of e)if(o){r.add(o);const e=this._layerLayerViewInfoMap.get(o);e&&t?e.start():e||this._recyclingInfoMap.has(o)||i.push(o),"layers"in o&&o.layers&&s(o.layers)}};for(const
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../core/Accessor.js";import i from"../../core/Error.js";import t from"../../core/Logger.js";import{someMap as s}from"../../core/MapUtils.js";import{createResolver as o,createAbortError as a,isAbortError as n}from"../../core/promiseUtils.js";import{on as l,watch as h,syncAndInitial as y}from"../../core/reactiveUtils.js";import{schedule as p}from"../../core/scheduling.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{get as w}from"../../core/accessorSupport/get.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import{destroyMap as m}from"../../support/collectionUtils.js";import{LayerLayerViewInfo as u}from"./LayerLayerViewInfo.js";function g(e){return null!=e&&"object"==typeof e&&"layerViews"in e}let _=class extends r{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new f,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const r of e)this.layerViewImporter.hasLayerViewModule(r)&&this.layerViewImporter.importLayerView(r)},this._reschedule=()=>this.destroyed?Promise.reject():(null==this._workPromise&&(this._workPromise=o(),this._workPromise.promise.catch((()=>{}))),this.removeHandles("reschedule"),this.addHandles(p(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{const e=this.view.map;if(this.destroyed||!e)return void this.clear();if(this._map!==e&&(this.clear(),this._map=e),null==this._workPromise)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,i=[],t=this.view.ready,s=e=>{if(null!=e)for(const o of e)if(o){r.add(o);const e=this._layerLayerViewInfoMap.get(o);e&&t?e.start():e||this._recyclingInfoMap.has(o)||i.push(o),"layers"in o&&o.layers&&s(o.layers)}};for(const n of this._rootCollectionNames)s(w(this,n));const o=[];for(const[n,l]of this._layerLayerViewInfoMap)if(!r.has(n)){this._layerLayerViewInfoMap.delete(l.layer);const e=l.tryRecycle(i);e?(this._recyclingInfoMap.set(l.layer,l),this.notifyChange("updating"),e.then((()=>{this._recyclingInfoMap.delete(l.layer),this._layerLayerViewInfoMap.set(l.layer,l),this._reschedule(),this.notifyChange("updating")})).catch((()=>{this._recyclingInfoMap.delete(l.layer),l.destroy(),this._reschedule(),this.notifyChange("updating")}))):o.push(l)}for(const[n,l]of this._recyclingInfoMap)r.has(n)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(l.layer),o.push(l));for(const n of i)this._createLayerView(n);this._refreshCollections(),o.forEach((e=>e.destroy()));const a=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.referenceLayers,e?.layers].filter((e=>!!e));r.forEach((e=>"layers"in e&&a.push(e.layers))),this.addHandles(a.map((e=>this._watchUpdatingTracking.addOnCollectionChange((()=>e),this._reschedule))),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([l((()=>this.view?.map?.allLayers),"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),h((()=>{const e=this.view,r=e?.map;return[r?.basemap,r?.ground,r?.layers,e?.ready]}),(()=>this._reschedule()),y)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),m(this._recyclingInfoMap),m(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,null!=this._workPromise&&(this._workPromise.reject(a()),this._workPromise=null)}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return null!=this._workPromise||this._watchUpdatingTracking.updating||s(this._layerLayerViewInfoMap,(e=>!e.done))||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const r of this._layerLayerViewInfoMap.values())r.done||++e;return e}clear(){this.destroyed||(this._clearCollections(),m(this._layerLayerViewInfoMap))}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e)){if(this._recyclingInfoMap.has(e))return this._recyclingInfoMap.get(e).promise;throw new i("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e})}return this._layerLayerViewInfoMap.get(e).promise}isCreatingLayerViewsForLayer(e,r){this.commitProperty("updatingRemaining");const i=this._layerLayerViewInfoMap.get(e);if(!i?.done)return!0;const t=i.layerView;return!(!t||!r||t.parent===r)||!!(i.done&&t&&"layers"in e&&e.layers?.length)&&e.layers.some((e=>this.isCreatingLayerViewsForLayer(e,t)))}_refreshCollections(){for(const[e,r]of this._layersToLayerViews)this._populateLayerViewsOwners(w(this,e),w(this,r),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_clearCollections(){for(const e of this._layersToLayerViews.values())w(this,e)?.removeAll()}_populateLayerViewsOwners(e,r,i){if(!e||!r)return void r?.removeAll();let t=0;for(const s of e){const e=this._layerLayerViewInfoMap.get(s);if(!e?.layerView)continue;const o=e.layerView;o.layer=s,o.parent=i,r.at(t)!==o&&r.splice(t,0,o),"layers"in s&&g(o)&&this._populateLayerViewsOwners(s.layers,o.layerViews,o),t+=1}t<r.length&&r.splice(t)}_createLayerView(e){e.load().catch((()=>{})),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const r=new u(e,this.view,this.layerViewImporter);r.promise.then((()=>this._refreshCollections()),(r=>{r&&(n(r)||"cancelled:layerview-create"===r.name)||t.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this._refreshCollections()})),this._layerLayerViewInfoMap.set(e,r),this.view.ready&&r.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};e([c()],_.prototype,"_workPromise",void 0),e([c({readOnly:!0})],_.prototype,"_watchUpdatingTracking",void 0),e([c({readOnly:!0})],_.prototype,"_layersToLayerViews",null),e([c({readOnly:!0})],_.prototype,"_rootCollectionNames",null),e([c()],_.prototype,"layerViewImporter",void 0),e([c()],_.prototype,"supportsGround",void 0),e([c({readOnly:!0})],_.prototype,"updating",null),e([c({readOnly:!0})],_.prototype,"updatingRemaining",null),e([c({constructOnly:!0})],_.prototype,"view",void 0),_=e([d("esri.views.support.LayerViewManager")],_);const V=_;export{V as default};
|
package/webscene/Slide.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import r from"../core/Clonable.js";import s from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import a from"../core/JSONSupport.js";import l from"../core/Logger.js";import{moduloPositive as p}from"../core/mathUtils.js";import{destroyMaybe as m,removeMaybe as c}from"../core/maybe.js";import{onAbortOrThrow as h,createAbortError as d,isAbortError as u}from"../core/promiseUtils.js";import{whenOnce as y,when as g}from"../core/reactiveUtils.js";import{property as b}from"../core/accessorSupport/decorators/property.js";import{cast as v}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as w}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as f}from"../core/accessorSupport/ensureType.js";import{s as T}from"../chunks/vec32.js";import{create as j}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import _ from"../layers/Layer.js";import{basemapEnsureType as L,clonePreservingTiledLayers as C}from"../support/basemapEnsureType.js";import{TaskPriority as E}from"../views/support/Scheduler.js";import{SlideThumbnail as S}from"../webdoc/support/SlideThumbnail.js";import{timeExtent as k}from"../webdoc/support/timeProperties.js";import A from"./SunLighting.js";import V from"./VirtualLighting.js";import U from"./support/Description.js";import x from"./support/SlideElements.js";import{SlideEnvironment as I}from"./support/SlideEnvironment.js";import F from"./support/SlideGround.js";import{SlideVisibleLayer as D}from"./support/SlideVisibleLayer.js";import R from"./support/Title.js";let M=0;const O=s.ofType(D),P=["caption","cover","none"];let q=class extends(r.ClonableMixin(a)){constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+M++,this.title=new R,this.description=new U,this.hidden=!1,this.thumbnail=new S,this.viewpoint=null,this.basemap=null,this.ground=null,this.layout="caption",this.environment=new I,this.timeExtent=null,this.elements=new x,this.visibleLayers=new O}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail=m(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.elements=null}castTitle(e){return"string"==typeof e?new R({text:e}):f(R,e)}castDescription(e){return"string"==typeof e?new U({text:e}):f(U,e)}castThumbnail(e){return"string"==typeof e?new S({url:e}):f(S,e)}castBasemap(e){return L(e)}set visibleLayers(e){this._set("visibleLayers",o(e,this._get("visibleLayers"),O))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if(e instanceof _){const t=N(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:"sublayerIds"in e?e.sublayerIds:void 0}:(l.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}async _updateVisibleLayersFrom(e){const t=[];await Promise.allSettled(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=N(i);t.push(new D({id:e.layer.id,sublayerIds:n}))}})))).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}_updateFocusAreaIDs(e){if(e){this.enabledFocusAreas=[];for(const t of e)t.enabled&&this.enabledFocusAreas.push(t.id)}}async updateFrom(e,t){const i={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};await e.when(),this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?V.prototype.clone.apply(e.environment.lighting):A.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this._updateFocusAreaIDs(e.focusAreas?.areas),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?F.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this.elements.analyses.updateFrom(e),await this._updateVisibleLayersFrom(e);const n=await e.takeScreenshot(i);return this.thumbnail=new S({url:n.dataUrl}),this}async applyTo(e,t){null!=this._applyToController&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=h(t,(()=>i?.abort())),s=()=>{this._applyToController===i&&(this._applyToController=null),i=null,r?.remove()};try{await y((()=>e.ready),i.signal)}catch(c){throw s(),c}if(i.signal.aborted)throw s(),d();const o=e.resourceController.scheduler.registerTask(E.SLIDE);let a=!1;const l={animate:!0,...t,signal:this._applyToController.signal},p=async()=>{await Promise.all([o.schedule((async()=>a=await this._setViewpointOfInterest(e,l))),o.schedule((()=>this._applyBasemap(e,l)),l.signal),o.schedule((()=>this._loadLayersWithSublayerVisibility(e)))]),await Promise.all([o.schedule((()=>this._applyLayerVisibility(e)),l.signal),o.schedule((()=>this._applyGround(e)),l.signal),o.schedule((()=>this.elements.analyses.applyTo(e)),l.signal),o.schedule((()=>this._applyViewpoint(e,l)),l.signal),o.schedule((()=>e.timeExtent=this.timeExtent?.clone()??null),l.signal),o.schedule((()=>e.environment.weather=this.environment.weather.clone())),o.schedule((()=>this._applyFocusAreaIDs(e.focusAreas?.areas)))])},m=await n(e.addUpdatingPromise(p()));if(a&&(e.contentCamera=null),o.remove(),s(),!1===m.ok)throw m.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(u(i))throw i}e.map.basemap=C(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_applyFocusAreaIDs(e){if(e)for(const t of e)t.enabled=this.enabledFocusAreas?.includes(t.id)??!1}_getLayers(e){const t=new s;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach((e=>{e.persistenceEnabled&&(t.add(e),"layers"in e&&this._collectLayers(e,t))}))}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map((e=>{const t=this.visibleLayers.find((t=>t.id===e.id))?.sublayerIds;return t?e.load():null})))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t?.sublayerIds,n=G(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;const{toCameraAsync:i}=await import("../views/3d/support/viewpointUtils.js"),n=await i(e,this.viewpoint);return e.contentCamera=n,null!=n}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){const i=this.environment.lighting;if(t.animate&&"sun"===i.type&&i.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(i.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then((()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())})).catch((t=>{throw null==e.animation&&this._applyCachedCameraTrackingEnabled(e),t})).finally((()=>{c(i)}))}_applyCachedCameraTrackingEnabled(e){null!=e.environment.cachedCameraTrackingEnabled&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e,t,i){const n=new Date(t.date.toString()),[r,s]=this._getTime(n),[o,a]=this._getTime(i.date),l=J(s,a),p=e.renderCoordsHelper,m=j();p.toRenderCoords(e.camera.position,m);const c=j(),h=j();null!=this.viewpoint.camera&&p.toRenderCoords(this.viewpoint.camera.position,c);const d=new Date;return g((()=>e.camera),(e=>{p.toRenderCoords(e.position,h);const i=T(m,h),n=T(c,h);let a=0;i+n!==0&&(a=i/(i+n));const u=r+(o-r)*a,y=z(s,l*a);t.date=this._setTime(d,u,y)}))}write(e,t){const i=super.write(e,t);return i?.elements&&0===Object.keys(i.elements).length&&delete i.elements,i}static createFrom(e,t){return(new this).updateFrom(e,t)}};e([b({type:String,json:{write:{isRequired:!0}}})],q.prototype,"id",void 0),e([b({type:R,json:{default:()=>new R({text:""}),write:{isRequired:!0}}})],q.prototype,"title",void 0),e([v("title")],q.prototype,"castTitle",null),e([b({type:U,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],q.prototype,"description",void 0),e([v("description")],q.prototype,"castDescription",null),e([b({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],q.prototype,"hidden",void 0),e([b({type:S,json:{default:()=>new S({url:""}),write:{isRequired:!0}}})],q.prototype,"thumbnail",void 0),e([v("thumbnail")],q.prototype,"castThumbnail",null),e([b({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],q.prototype,"viewpoint",void 0),e([b({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],q.prototype,"basemap",void 0),e([v("basemap")],q.prototype,"castBasemap",null),e([b({type:F,json:{write:!0}})],q.prototype,"ground",void 0),e([b({type:P,json:{write:!0,default:"caption"},nonNullable:!0})],q.prototype,"layout",void 0),e([b({type:O,json:{write:{isRequired:!0}}})],q.prototype,"visibleLayers",null),e([v("visibleLayers")],q.prototype,"castVisibleLayers",null),e([b({type:I,json:{write:!0}})],q.prototype,"environment",void 0),e([b({type:[String],json:{write:!1}})],q.prototype,"enabledFocusAreas",void 0),e([b(k)],q.prototype,"timeExtent",void 0),e([b({type:x,nonNullable:!0,json:{write:!0}})],q.prototype,"elements",void 0),q=e([w("esri.webscene.Slide")],q);const B=q;function G(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function N(e){const t=G(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}const W=86400,H=43200;function J(e,t){let i=t-e;return i>H&&(i-=W),i<-43200&&(i+=W),i}function z(e,t){return p(e+t,W)}export{B as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Basemap.js";import i from"../Viewpoint.js";import{result as n}from"../core/asyncUtils.js";import r from"../core/Clonable.js";import s from"../core/Collection.js";import{referenceSetter as o}from"../core/collectionUtils.js";import a from"../core/JSONSupport.js";import l from"../core/Logger.js";import{moduloPositive as p}from"../core/mathUtils.js";import{destroyMaybe as m,removeMaybe as c}from"../core/maybe.js";import{onAbortOrThrow as h,createAbortError as d,isAbortError as u}from"../core/promiseUtils.js";import{whenOnce as y,when as g}from"../core/reactiveUtils.js";import{property as b}from"../core/accessorSupport/decorators/property.js";import{cast as v}from"../core/accessorSupport/decorators/cast.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as w}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as f}from"../core/accessorSupport/ensureType.js";import{s as T}from"../chunks/vec32.js";import{create as j}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import _ from"../layers/Layer.js";import{basemapEnsureType as L,clonePreservingTiledLayers as C}from"../support/basemapEnsureType.js";import{TaskPriority as E}from"../views/support/Scheduler.js";import{SlideThumbnail as S}from"../webdoc/support/SlideThumbnail.js";import{timeExtent as A}from"../webdoc/support/timeProperties.js";import k from"./SunLighting.js";import V from"./VirtualLighting.js";import U from"./support/Description.js";import x from"./support/SlideElements.js";import{SlideEnvironment as F}from"./support/SlideEnvironment.js";import I from"./support/SlideGround.js";import{SlideVisibleLayer as D}from"./support/SlideVisibleLayer.js";import R from"./support/Title.js";let M=0;const O=s.ofType(D),P=["caption","cover","none"];let q=class extends(r.ClonableMixin(a)){constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+M++,this.title=new R,this.description=new U,this.hidden=!1,this.thumbnail=new S,this.viewpoint=null,this.basemap=null,this.ground=null,this.layout="caption",this.environment=new F,this.timeExtent=null,this.elements=new x,this.visibleLayers=new O,this.enabledFocusAreas=new s}destroy(){this.visibleLayers.removeAll(),this.enabledFocusAreas?.removeAll(),this.basemap=null,this.thumbnail=m(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null,this.elements=null}castTitle(e){return"string"==typeof e?new R({text:e}):f(R,e)}castDescription(e){return"string"==typeof e?new U({text:e}):f(U,e)}castThumbnail(e){return"string"==typeof e?new S({url:e}):f(S,e)}castBasemap(e){return L(e)}set visibleLayers(e){this._set("visibleLayers",o(e,this._get("visibleLayers"),O))}castVisibleLayers(e){return e&&"function"==typeof e.map?e.map((e=>{if("string"==typeof e)return{id:e};if(e instanceof _){const t=N(e);return{id:e.id,sublayerIds:t}}return e.id?{id:e.id,sublayerIds:"sublayerIds"in e?e.sublayerIds:void 0}:(l.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),e)})):null}async _updateVisibleLayersFrom(e){const t=[];await Promise.allSettled(this._getLayers(e.map).map((i=>e.whenLayerView(i).then((e=>{if(e.visible){const n=N(i);t.push(new D({id:e.layer.id,sublayerIds:n}))}})))).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(t)}_updateFocusAreaIDs(e){if(e){this.enabledFocusAreas?.removeAll();for(const t of e)t.enabled&&this.enabledFocusAreas?.add(t.id)}}async updateFrom(e,t){const i={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...t?.screenshot};await e.when(),this.viewpoint=e.viewpoint.clone(),this.environment.lighting="virtual"===e.environment.lighting.type?V.prototype.clone.apply(e.environment.lighting):k.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this._updateFocusAreaIDs(e.focusAreas?.areas),this.basemap=e.map.basemap?.clone()||null,this.ground=e.map.ground?I.fromGround(e.map.ground):null,this.timeExtent=e.timeExtent?.clone()??null,this.elements.analyses.updateFrom(e),await this._updateVisibleLayersFrom(e);const n=await e.takeScreenshot(i);return this.thumbnail=new S({url:n.dataUrl}),this}async applyTo(e,t){null!=this._applyToController&&this._applyToController.abort();let i=new AbortController;this._applyToController=i;const r=h(t,(()=>i?.abort())),s=()=>{this._applyToController===i&&(this._applyToController=null),i=null,r?.remove()};try{await y((()=>e.ready),i.signal)}catch(c){throw s(),c}if(i.signal.aborted)throw s(),d();const o=e.resourceController.scheduler.registerTask(E.SLIDE);let a=!1;const l={animate:!0,...t,signal:this._applyToController.signal},p=async()=>{await Promise.all([o.schedule((async()=>a=await this._setViewpointOfInterest(e,l))),o.schedule((()=>this._applyBasemap(e,l)),l.signal),o.schedule((()=>this._loadLayersWithSublayerVisibility(e)))]),await Promise.all([o.schedule((()=>this._applyLayerVisibility(e)),l.signal),o.schedule((()=>this._applyGround(e)),l.signal),o.schedule((()=>this.elements.analyses.applyTo(e)),l.signal),o.schedule((()=>this._applyViewpoint(e,l)),l.signal),o.schedule((()=>e.timeExtent=this.timeExtent?.clone()??null),l.signal),o.schedule((()=>e.environment.weather=this.environment.weather.clone())),o.schedule((()=>this._applyFocusAreaIDs(e.focusAreas?.areas)))])},m=await n(e.addUpdatingPromise(p()));if(a&&(e.contentCamera=null),o.remove(),s(),!1===m.ok)throw m.error;return this}async _applyBasemap(e,t){if(this.basemap){try{await this.basemap.load(t)}catch(i){if(u(i))throw i}e.map.basemap=C(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_applyFocusAreaIDs(e){if(e)for(const t of e)t.enabled=this.enabledFocusAreas?.includes(t.id)??!1}_getLayers(e){const t=new s;return this._collectLayers(e,t),this._collectLayers(e.ground,t),t}_collectLayers(e,t){e.layers.forEach((e=>{e.persistenceEnabled&&(t.add(e),"layers"in e&&this._collectLayers(e,t))}))}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map((e=>{const t=this.visibleLayers.find((t=>t.id===e.id))?.sublayerIds;return t?e.load():null})))}_applyLayerVisibility(e){if(!this.visibleLayers)return;this._getLayers(e.map).forEach((e=>{const t=this.visibleLayers.find((t=>t.id===e.id));e.visible=null!=t;const i=t?.sublayerIds,n=G(e);i&&n&&n.forEach((e=>e.visible=i.includes(e.id)))}))}async _setViewpointOfInterest(e,t){if(e.state.fixedContentCamera||!this.viewpoint||t?.ignoreViewpoint||!t?.useDestinationCamera)return!1;const{toCameraAsync:i}=await import("../views/3d/support/viewpointUtils.js"),n=await i(e,this.viewpoint);return e.contentCamera=n,null!=n}async _applyViewpoint(e,t){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!t.ignoreViewpoint){const i=this.environment.lighting;if(t.animate&&"sun"===i.type&&i.date)return this._animateToLighting(e,t);t.animate&&(e.environment.applyLighting(i.clone()),await e.goTo(this.viewpoint,t)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,t){let i=null;"virtual"!==e.environment.lighting.type&&"virtual"!==this.environment.lighting.type&&("global"===e.viewingMode&&(i=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,"virtual"===this.environment.lighting.type||"virtual"===e.environment.lighting.type?(e.environment.applyLighting(this.environment.lighting.clone()),"virtual"!==e.environment.lighting.type&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):null!=this.environment.lighting.displayUTCOffset&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset);return e.goTo(this.viewpoint,t).then((()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())})).catch((t=>{throw null==e.animation&&this._applyCachedCameraTrackingEnabled(e),t})).finally((()=>{c(i)}))}_applyCachedCameraTrackingEnabled(e){null!=e.environment.cachedCameraTrackingEnabled&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,t,i){return e.setTime(t),e.setUTCHours(i/3600),e.setUTCMinutes(i%3600/60),e.setUTCSeconds(i%3600%60),e}_animateLightingWithCamera(e,t,i){const n=new Date(t.date.toString()),[r,s]=this._getTime(n),[o,a]=this._getTime(i.date),l=J(s,a),p=e.renderCoordsHelper,m=j();p.toRenderCoords(e.camera.position,m);const c=j(),h=j();null!=this.viewpoint.camera&&p.toRenderCoords(this.viewpoint.camera.position,c);const d=new Date;return g((()=>e.camera),(e=>{p.toRenderCoords(e.position,h);const i=T(m,h),n=T(c,h);let a=0;i+n!==0&&(a=i/(i+n));const u=r+(o-r)*a,y=z(s,l*a);t.date=this._setTime(d,u,y)}))}write(e,t){const i=super.write(e,t);return i?.elements&&0===Object.keys(i.elements).length&&delete i.elements,i}static createFrom(e,t){return(new this).updateFrom(e,t)}};e([b({type:String,json:{write:{isRequired:!0}}})],q.prototype,"id",void 0),e([b({type:R,json:{default:()=>new R({text:""}),write:{isRequired:!0}}})],q.prototype,"title",void 0),e([v("title")],q.prototype,"castTitle",null),e([b({type:U,json:{write:{overridePolicy:e=>({enabled:!(!e||!e.text)})}}})],q.prototype,"description",void 0),e([v("description")],q.prototype,"castDescription",null),e([b({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],q.prototype,"hidden",void 0),e([b({type:S,json:{default:()=>new S({url:""}),write:{isRequired:!0}}})],q.prototype,"thumbnail",void 0),e([v("thumbnail")],q.prototype,"castThumbnail",null),e([b({type:i,nonNullable:!0,json:{write:{isRequired:!0}}})],q.prototype,"viewpoint",void 0),e([b({type:t,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],q.prototype,"basemap",void 0),e([v("basemap")],q.prototype,"castBasemap",null),e([b({type:I,json:{write:!0}})],q.prototype,"ground",void 0),e([b({type:P,json:{write:!0,default:"caption"},nonNullable:!0})],q.prototype,"layout",void 0),e([b({type:O,json:{write:{isRequired:!0}}})],q.prototype,"visibleLayers",null),e([v("visibleLayers")],q.prototype,"castVisibleLayers",null),e([b({type:F,json:{write:!0}})],q.prototype,"environment",void 0),e([b({type:s,json:{write:!1}})],q.prototype,"enabledFocusAreas",void 0),e([b(A)],q.prototype,"timeExtent",void 0),e([b({type:x,nonNullable:!0,json:{write:!0}})],q.prototype,"elements",void 0),q=e([w("esri.webscene.Slide")],q);const B=q;function G(e){if("building-scene"===e.type||"map-image"===e.type)return e.allSublayers.toArray()}function N(e){const t=G(e);if(t)return t.filter((e=>e.visible)).map((e=>e.id))}const W=86400,H=43200;function J(e,t){let i=t-e;return i>H&&(i-=W),i<-43200&&(i+=W),i}function z(e,t){return p(e+t,W)}export{B as default};
|
package/widgets/Editor/Edits.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import{debounce as i,ignoreAbortErrors as s}from"../../core/promiseUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{attributesAreEquivalent as a}from"./support/editsUtils.js";function l(t){return null==t?null:JSON.stringify(t)}let n=class extends e{constructor(t){super(t),this._stagedForDelete=!1,this.feature=null,this.initialFeature=null,this.submittable=!1,this.displayTitle=null,this.isAssociation=!1,this._debouncedRefreshDisplayTitle=i(this._refreshDisplayTitle.bind(this),100)}get attributesModified(){return!a(this.initialFeature?.attributes,this.feature?.attributes)}get geometryModified(){return this._stringifyGeometry(this.feature)!==this._stringifyGeometry(this.initialFeature)}get stagedForDelete(){return this._stagedForDelete}get modified(){return this.attributesModified||this.geometryModified||this._stagedForDelete}set timeZone(t){this._set("timeZone",t),s(this._debouncedRefreshDisplayTitle())}setAttribute(t,e){const{feature:i}=this;i&&(i.setAttribute(t,e),this.notifyChange("attributesModified")),s(this._debouncedRefreshDisplayTitle())}stageDelete(){this._stagedForDelete=!0}unstageDelete(){this._stagedForDelete=!1}trackChanges(t=this.feature){this.initialFeature=t?.clone(),s(this._debouncedRefreshDisplayTitle())}updateAttributes(t){const{feature:e}=this;e&&(e.attributes=t,this.notifyChange("attributesModified")),s(this._debouncedRefreshDisplayTitle())}updateGeometry(t){const{feature:e}=this;e&&(e.geometry=t,this.notifyChange("geometryModified"))}_stringifyGeometry(t){const e=t?.geometry;return l("mesh"===e?.type?{transform:e.transform,vertexSpace:e.vertexSpace}:e)}async _refreshDisplayTitle(t){const e=this.feature,i=e?.sourceLayer;if(!i||!("getFeatureTitle"in i))return;const s=await i.getFeatureTitle(e,{fetchMissingFields:!1,timeZone:this.timeZone});t.aborted||(this.displayTitle=""===s?null:s)}};t([r()],n.prototype,"_stagedForDelete",void 0),t([r()],n.prototype,"attributesModified",null),t([r()],n.prototype,"feature",void 0),t([r()],n.prototype,"geometryModified",null),t([r()],n.prototype,"initialFeature",void 0),t([r()],n.prototype,"modified",null),t([r()],n.prototype,"submittable",void 0),t([r()],n.prototype,"displayTitle",void 0),t([r()],n.prototype,"isAssociation",void 0),t([r()],n.prototype,"timeZone",null),n=t([o("esri.widgets.Editor.Edits")],n);const u=n;export{u as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{unique as t,isSome as r}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import i from"../../core/Error.js";import a from"../../core/Logger.js";import{
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{unique as t,isSome as r}from"../../core/arrayUtils.js";import o from"../../core/Collection.js";import i from"../../core/Error.js";import a from"../../core/Logger.js";import{destroyMaybe as s}from"../../core/maybe.js";import{whenOnce as n}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{isTable as u}from"../../layers/support/layerUtils.js";import{hasEffectiveFeatureExpressionInfo as p}from"../../support/elevationInfoUtils.js";import c from"../BatchAttributeForm/BatchAttributeFormViewModel.js";import{UpdateFeaturesWorkflowData as f}from"./UpdateFeaturesWorkflowData.js";import m from"./Workflow.js";import{whenEditorLayerView as h}from"./workflowUtils.js";import{SketchController as w}from"./support/SketchController.js";var y;const g=()=>a.getLogger("esri.widgets.Editor.UpdateFeaturesWorkflow");let F=y=class extends m{constructor(e){super(e),this.type="update-features",this._formViewModel=null,this._sketchController=null}async initialize(){this._initializeFormViewModel();try{await this._updatingHandles.addPromise((async()=>{const{fullFeatures:e}=await this.data.when();this._formViewModel.features=new o(e),await this._initializeVisuals(e)})())}catch(e){this.cancel({force:!0,error:new i("update-features-workflow:initialize","Failed to initialize the workflow data.",e)})}}destroy(){this._sketchController=s(this._sketchController),this._formViewModel.destroy()}get features(){return this.data.features}get formViewModel(){return this._formViewModel}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get selectedFeature(){return this.data.selectedFeature}get updating(){return this._updatingHandles.updating||this._formViewModel.updating||!!this._sketchController?.updating}static create(e){const{applyEdits:o,applyEditsFeatureService:i,...a}=e,s=t(e.features.map((e=>e.sourceLayer??e.layer))).map((t=>e.viewModel.editorItems.find((e=>e.layer===t)))).filter(r),n=new y({data:new f({...a,editorItems:s}),onCommit:k(e.applyEdits)});return n._set("steps",_()),n}enter(){throw new Error("Method not implemented.")}exit(e){throw new Error("Method not implemented.")}_initializeFormViewModel(){const{data:e}=this,t=e.viewModel.view,r=new c({editType:"UPDATE",map:t?.map,spatialReference:t?.spatialReference,timeZone:e.timeZone});this._formViewModel=r,this.addHandles(r.on("value-change",(t=>{for(const r of t.features)e.getPendingEditsForFeature(r)?.setAttribute(t.fieldName,t.value);this._sketchController?.notifyAttributesChanged(t)})))}async _initializeHighlights(e,t,r){const o=await h(r,t);this.addHandles(o.highlight(e))}async _initializeSketchController(e,t,r){const o=new w({sourceLayer:t,view:r,features:e});this._sketchController=o,await n((()=>!o.updating));const{data:i}=this;await o.startUpdatingFeatures(e,(e=>{const t=[];for(const{feature:r,geometry:o}of e)i.getPendingEditsForFeature(r)?.updateGeometry(o),t.push(r);this._formViewModel.notifyGeometriesChanged(t)}),(()=>{g().warnOnce("editor:batch-update-visual-variables","UpdateFeaturesWorkflow does not currently support modifying visual variables through the scale and rotate tools.")}))}async _initializeVisuals(e){const{data:t}=this,{view:r}=t.viewModel;if(!r)return;const o=v(t);if(u(o))return;const i=t.getEditorItemForLayer(o);return!i?.capabilities.update.geometry||"3d"===r?.type&&p(o.elevationInfo)?this._initializeHighlights(e,o,r):this._initializeSketchController(e,o,r)}};function _(){return[{id:"editing-features",async setUp(){},async tearDown(){}}]}function k(e){return async t=>{v(t);const{stagedForDelete:r}=t,o=[];for(const e of t.fullFeatures){const i=t.getPendingEditsForFeature(e);if(!i?.modified&&!r)continue;const a=e.clone();if(!i?.attributesModified||r){const t=e.sourceLayer;if(!t){g().warn("Feature has no sourceLayer. It will not be included in any applyEdits payload.");continue}const r=t.objectIdField;if(a.attributes={[r]:e.getAttribute(r)},"scene"===t.type&&null!=t.infoFor3D){const r=t.associatedLayer?.globalIdField;null!=r&&a.setAttribute(r,e.getAttribute(r))}}i?.geometryModified&&!r||(a.geometry=null),o.push(a)}if(0===o.length)return void g().warn("No features to update. Workflow will finish without applying any edits");const i=r?"deleteFeatures":"updateFeatures",a=t.layers[0];await e(a,{[i]:o})}}function v(e){if(e.layers.length>1)throw new i("update-features-workflow:multiple-layers-not-supported","The UpdateFeaturesWorkflow does not support updating features from multiple layers.");return e.layers[0]}e([l()],F.prototype,"features",null),e([l()],F.prototype,"formViewModel",null),e([l()],F.prototype,"parent",null),e([l()],F.prototype,"parentLayer",null),e([l()],F.prototype,"selectedFeature",null),e([l()],F.prototype,"type",void 0),e([l()],F.prototype,"updating",null),e([l()],F.prototype,"_formViewModel",void 0),e([l()],F.prototype,"_sketchController",void 0),F=y=e([d("esri.widgets.Editor.UpdateFeaturesWorkflow")],F);export{F as UpdateFeaturesWorkflow};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import{unique as e,isSome as r}from"../../core/arrayUtils.js";import s from"../../core/Error.js";import{abortHandle as o}from"../../core/handleUtils.js";import i from"../../core/Promise.js";import{throwIfAborted as a,isAbortError as l}from"../../core/promiseUtils.js";import n from"../../core/ReactiveMap.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import{unique as e,isSome as r}from"../../core/arrayUtils.js";import s from"../../core/Error.js";import{abortHandle as o}from"../../core/handleUtils.js";import i from"../../core/Promise.js";import{throwIfAborted as a,isAbortError as l}from"../../core/promiseUtils.js";import n from"../../core/ReactiveMap.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"./Edits.js";import{groupFeaturesByLayer as c,fetchFullFeatures as f}from"./workflowUtils.js";let h=class extends i{constructor(t){super(t),this.editorItems=[],this.features=[],this.parent=null,this.selectedFeature=null,this.sketchOptions=null,this.snappingManager=null,this.stagedForDelete=!1,this.viewModel=null,this._editorItemsByLayer=new n,this._fullFeatures=new Map,this._pendingEdits=new n}initialize(){const t=new AbortController;this.addResolvingPromise(this._initializeFullFeatures(t.signal).then((e=>{a(t.signal),this._initializeEdits(e)})).catch((t=>{if(l(t))throw new s("update-features-workflow:full-features-aborted","Fetching of full features was aborted.");throw t}))),this.addHandles(o(t)),this._initializeEditorItemsByLayer()}get fullFeatures(){return Array.from(this._fullFeatures.values())}get layers(){return e(this.features.map((t=>t.sourceLayer)).filter(r))}set timeZone(t){this._set("timeZone",t),this._pendingEdits.forEach((e=>{e.timeZone=t}))}getEditorItemForLayer(t){return this._editorItemsByLayer.get(t)}getFeatureTitle(t){return this._pendingEdits.get(t)?.displayTitle}getPendingEditsForFeature(t){return this._pendingEdits.get(this._fullFeatures.get(t)??t)}isSubmittable(t){const e=this._pendingEdits.get(t);return!!e&&(e.submittable||e.isAssociation)}_initializeEditorItemsByLayer(){const{editorItems:t}=this;for(const e of t)this._editorItemsByLayer.set(e.layer,e)}_initializeEdits(t){const{timeZone:e}=this;for(const r of t){const t=new d({feature:r,timeZone:e});t.trackChanges(),this._pendingEdits.set(r,t)}}async _initializeFullFeatures(t){const{spatialReference:e}=this.viewModel.view,r=this._fullFeatures,o=c(this.features),i=Array.from(o.entries()).map((async([o,i])=>{const a=await f(i,o,e,t);if(a.length!==i.length)throw new s("editor:update-features-workflow:fetch-full-features-incomplete","Failed to fetch full features for one or more of the provided features.");const l=o.objectIdField,n=(t,e)=>t.attributes[l]>e.attributes[l]?1:-1,u=i.sort(n),p=a.sort(n);for(let t=0;t<u.length;t++)r.set(u[t],p[t]);return a}));return(await Promise.all(i)).flat()}};t([u({constructOnly:!0})],h.prototype,"editorItems",void 0),t([u({constructOnly:!0})],h.prototype,"features",void 0),t([u()],h.prototype,"fullFeatures",null),t([u()],h.prototype,"layers",null),t([u()],h.prototype,"parent",void 0),t([u()],h.prototype,"selectedFeature",void 0),t([u({constructOnly:!0})],h.prototype,"sketchOptions",void 0),t([u()],h.prototype,"snappingManager",void 0),t([u()],h.prototype,"stagedForDelete",void 0),t([u()],h.prototype,"timeZone",null),t([u()],h.prototype,"viewModel",void 0),t([u()],h.prototype,"_fullFeatures",void 0),h=t([p("esri.widgets.Editor.UpdateFeaturesWorkflowData")],h);export{h as UpdateFeaturesWorkflowData};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Error.js";import{abortHandle as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{isSome as i}from"../../../core/arrayUtils.js";import s from"../../../core/Error.js";import{abortHandle as r}from"../../../core/handleUtils.js";import{debounce as a}from"../../../core/promiseUtils.js";import{whenOnce as o,watch as n}from"../../../core/reactiveUtils.js";import{first as l}from"../../../core/SetUtils.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../core/support/UpdatingHandles.js";import d from"../../../layers/GraphicsLayer.js";import u from"../../../views/interactive/sketch/SketchOptions.js";import{getVisualVariablesForLayer as y,updateGraphicSymbolWhenRequired as m,setVisualVariablesAndElevationInfoForUpdate as w,swapForEditingSession as g,visualVariableInteractiveUpdate as f,getSizeVariableAttribute as v,getRotationVariableAttribute as _}from"../workflowUtils.js";import b from"../../Sketch/SketchViewModel.js";const k=Symbol();let L=class extends t{constructor(e){super(e),this.features=[],this.sketchOptions=new u,this.snappingManager=null,this.sourceLayer=null,this.view=null,this.viewModel=null,this._sketchGraphics=new Map,this._sketchLayer=null,this._updatingHandles=new h,this._visualVariableAttributes=new Map,this._visualVariablesForLayer=null,this._webStyleCache=new Map}async initialize(){this._visualVariablesForLayer=y(this.sourceLayer),this._initializeSketchGraphics(),this._initializeSketchLayer(),await this._updatingHandles.addPromise(this._initializeSketchViewModel())}destroy(){const{_sketchLayer:e,view:t}=this;t?.destroyed||t?.map.remove(e),e.destroy(),this.viewModel.destroy()}get updating(){return this._updatingHandles.updating}async enter(){throw new Error("enter() not implemented")}async exit(){throw new Error("exit() not implemented")}notifyAttributesChanged({features:e,fieldName:t}){const i=this._webStyleCache,s=this.view.scale,r=this._updatingHandles;for(const a of e){const e=this._sketchGraphics.get(a),o=a.getAttribute(t);if(!e||e.getAttribute(t)===o)continue;e.setAttribute(t,o);const n=this._visualVariableAttributes.get(a);null==n?.size||n.size.isUpdatingInteractively||n.size.field!==t||n.size.setInitialValue(o),null==n?.rotation||n.rotation.isUpdatingInteractively||n.rotation.field!==t||n.rotation.setInitialValue(o),r.addPromise(m(e,i,s))}}async startUpdatingFeatures(e,t,s){const{_sketchGraphics:a,sourceLayer:n,view:l,viewModel:c,_webStyleCache:p}=this,h=e.map((e=>a.get(e))).filter(i),d={multipleSelectionEnabled:!1};this.removeHandles(k),c.complete();let u=null;if(1===e.length){const t=e[0],i=this._visualVariableAttributes.get(t);!(!i?.rotation&&!i?.size)&&(w({sketchViewModel:c,graphic:h[0],sourceLayer:n,visualVariables:i,webStyleCache:p}),"point"===n.geometryType&&(d.enableRotation=null!=i.rotation,d.enableScaling=null!=i.size,u=async e=>{const r=e.graphics[0];f(l,r,e,i)&&(s?.([{feature:t,attributes:r.attributes}],e),await m(r,p,"2d"===l.type?l.scale:null))}))}const y=()=>c.update(h,d);await y();const g=c.on("update",(s=>{if("complete"===s.state){if(null===l.activeTool)return void y();const e=new AbortController,t=r(e);return this.addHandles(t,k),void this._updatingHandles.addPromise(o((()=>null===l.activeTool),e.signal).then((async()=>{e.signal.aborted||(e.abort(),await y())})))}const n=e.map((e=>{const t=a.get(e);return t?{feature:e,geometry:t.geometry}:null})).filter(i);t(n,s),u?.(s)}));this.addHandles(g,k),c.addHandles(g)}_initializeSketchGraphics(){const{features:e,_sketchGraphics:t,sourceLayer:i,_visualVariableAttributes:s}=this,r=this._visualVariablesForLayer,a=r.rotation?.field,o=r.size?.field,n={rotation:a?i.getField(a):null,size:o?i.getField(o):null},l=!(!n.rotation&&!n.size);for(const c of e)t.set(c,c.clone()),l&&s.set(c,z(r,n))}_initializeSketchLayer(){const{view:e}=this,t=new d({elevationInfo:this.sourceLayer.elevationInfo,internal:!0,listMode:"hide"});this._sketchLayer=t,e.map.add(t),this._updatingHandles.addPromise(e.whenLayerView(t))}async _initializeSketchViewModel(){const{_sketchGraphics:e,view:t,_webStyleCache:i}=this,s=Array.from(e.entries()),r=new b({allowDeleteKey:!1,layer:this._sketchLayer,sketchOptions:this.sketchOptions,snappingManager:this.snappingManager,updateOnGraphicClick:!1,view:this.view});this.viewModel=r;const o=a((e=>Promise.all(s.map((([,t])=>m(t,i,e))))));await o("2d"===t.type?t.scale:null),"2d"===t.type&&this.addHandles(n((()=>t.scale),(e=>o(e)))),this.addHandles(await Promise.all(s.map((([e,t])=>g(r,e,t)))))}};function S({features:e,sketchOptions:t,snappingManager:i,view:r}){const a=new Set(e.map((e=>e.sourceLayer)));if(1!==a.size)throw new s("editor:features-must-belong-to-same-layer","All features must belong to the same layer.");const o=l(a);return new L({view:r,features:e,sketchOptions:t,snappingManager:i,sourceLayer:o})}function z({rotation:e,size:t},i){return{rotation:e?_(e,i.rotation):null,size:t?v(t,i.size):null}}e([c()],L.prototype,"features",void 0),e([c()],L.prototype,"sketchOptions",void 0),e([c()],L.prototype,"snappingManager",void 0),e([c()],L.prototype,"sourceLayer",void 0),e([c()],L.prototype,"updating",null),e([c()],L.prototype,"view",void 0),e([c()],L.prototype,"viewModel",void 0),e([c()],L.prototype,"_sketchGraphics",void 0),e([c()],L.prototype,"_sketchLayer",void 0),e([c()],L.prototype,"_visualVariablesForLayer",void 0),L=e([p("esri.widgets.Editor.support.SketchController")],L);export{L as SketchController,S as createSketchController};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{isSome as t}from"../../core/arrayUtils.js";import i from"../../core/Collection.js";import{referenceSetter as s}from"../../core/collectionUtils.js";import{deprecatedFunction as l}from"../../core/deprecate.js";import o from"../../core/Error.js";import n from"../../core/Handles.js";import r from"../../core/Logger.js";import{abortMaybe as a}from"../../core/maybe.js";import{debounce as h,ignoreAbortErrors as d,after as m,throwIfAborted as c,createResolver as p}from"../../core/promiseUtils.js";import{watch as g,on as u,initial as b}from"../../core/reactiveUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import{getLowerCaseDefaultHiddenFields as T}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as w,getSubtypesFromLayer as _,isSubtypeGroupLayer as C}from"../../layers/support/layerUtils.js";import{createFieldInfos as I}from"../../support/popupUtils.js";import v from"../../tables/AttributeTableTemplate.js";import E from"../../tables/support/FieldOrder.js";import{defaultHighlightName as A,temporaryHighlightName as F}from"../../views/support/HighlightDefaults.js";import{highlightsSupported as j}from"../../views/support/layerViewUtils.js";import{isSelectableLayer as S}from"../../views/support/selectionUtils.js";import R from"./ActionColumn.js";import x from"./AttachmentsColumn.js";import U from"./FieldColumn.js";import O from"./RelationshipColumn.js";import V from"./Grid/Column.js";import W from"./Grid/Grid.js";import z from"./Grid/GridViewModel.js";import P from"./Grid/GroupColumn.js";import L from"./support/AttachmentsColumnTemplate.js";import H from"./support/AttachmentsViewOptions.js";import{isAttachmentsColumn as B,isRelationshipColumn as Z}from"./support/columnUtils.js";import{downloadAttachmentInfo as G,exportToCSV as k}from"./support/exportUtils.js";import N from"./support/FeatureStore.js";import D from"./support/FieldColumnTemplate.js";import M from"./support/RelationshipColumnTemplate.js";import $ from"./support/TableTemplate.js";import{isIFeatureTableSupportedLayerWithRelationships as q,findRelatedLayerInSources as Q,findRelationship as K,uniqueColumnNames as J,hasColumnForField as X,findField as Y,isIFeatureTableSupportedLayerWithAttachments as ee,getTableHighlightKey as te,getRelationshipIdsToShow as ie}from"./support/tableUtils.js";import{createAttributeTableElements as se}from"./support/templateUtils.js";import{goTo as le}from"../support/goToUtils.js";import"../support/widgetUtils.js";import{messageBundle as oe}from"../support/decorators/messageBundle.js";import{onLocaleChange as ne}from"../../intl/locale.js";import{substitute as re}from"../../intl/substitute.js";import{fetchMessageBundle as ae}from"../../intl/messages.js";const he="80px";let de=class extends z{constructor(e){super(e),this._debounceRefresh=h((()=>this._refresh())),this._temporaryHighlightAbortController=null,this._currentTemporaryHighlight=null,this._highlights=new n,this.attachmentsViewOptions=new H,this.attributeTableTemplate=null,this.autoRefreshEnabled=!0,this.columns=new i,this.dataProvider=async(e,t)=>{const{layer:i,store:s}=this;if(!t)return;if(!i||!s)return void(t&&t([]));await i.load();const{objectIds:l}=this;if(this.filterBySelectionEnabled&&!this.highlightIds.length||1===l.length&&-1===l.items[0])return void t([]);"loaded"!==s.state&&"loading"!==s.state&&await s.load();const o=this.paginationEnabled?this.pageIndex:e.page,n=await s.fetchItems({...e,page:o});t&&t(n)},this.grid=null,this.highlightEnabled=!0,this.layers=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.messagesURIUtils=null,this.prompt=null,this.relatedTables=new i,this.relationshipColumnConfigs=null,this.selectionSource="table",this.showRelatedTableCallback=null,this.store=null,this.syncTemplateOnChangesEnabled=!0,this.tableController=null,this.tableParent=null,this.tableTemplate=null,this.tableTemplateOverride=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._onShowPromptCallback=this._onShowPromptCallback.bind(this),this._set("store",new N),this._set("grid",new W({viewModel:this}))}initialize(){const e=async()=>{this.messages=await ae("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await ae("esri/t9n/common"),this.messagesUnits=await ae("esri/core/t9n/Units"),this.messagesURIUtils=await ae("esri/widgets/support/t9n/uriUtils")};e(),this.addHandles([ne((()=>{e(),this._generateColumns()})),g((()=>[this.messages,this.messagesCommon,this.messagesURIUtils]),(()=>{const e=this.messages;this.grid&&(this.grid.messages=e),this.allColumns.forEach((t=>{t.messages=e,t.messagesCommon=this.messagesCommon,t.messagesURIUtils=this.messagesURIUtils})),this.refreshCellContent()}),b),u((()=>this.highlightIds),"change",(e=>this._onHighlightIdsChange(e)),{onListenerAdd:()=>this._syncSelection(),onListenerRemove:()=>this._highlights.removeAll()}),g((()=>this.grid?.temporaryHighlightId),(e=>{this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController,d(this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal))})),g((()=>this.attachmentsEnabled),(()=>this.layer?.loaded&&this._generateColumns())),g((()=>this._viewSelection),(()=>{this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)})),g((()=>[this._tableHighlightsReady,this._viewSelectionReady]),(()=>this._syncSelection())),g((()=>this.layer),(async(e,t)=>{const i=this.grid;i&&(i.clearSort(),e&&t&&await this.reset()),this.goToPage(0),this._drainColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load().catch((()=>{}))),t&&null!=this.attachmentsViewOptions.objectId&&(this.attachmentsViewOptions.objectId=null)})),g((()=>this.layer?.loaded),(e=>e&&this._onLayerLoad())),g((()=>this.store.state),(e=>{"loaded"===e&&(this.scrollToTop(),this.refreshCellContent())})),g((()=>this._effectiveTableTemplate),(()=>{this.scrollLeft(),this.layer?.loaded&&this._generateColumns()})),g((()=>this.editingEnabled),(e=>{this.editableColumns.forEach((t=>t.tableEditingEnabled=e)),this.refreshCellContent()})),g((()=>this.timeZone??this.view?.timeZone),(()=>this.refreshCellContent())),g((()=>this.layer?.definitionExpression),((e,t)=>(e||t)&&"loaded"===this.store.state&&this.reset())),g((()=>this.layer?.timeExtent),((e,t)=>(e||t)&&!this.timeExtent&&"loaded"===this.store.state&&this.reset())),u((()=>this.layer),"refresh",(e=>this._onLayerRefresh(e))),u((()=>this.grid),["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder"],(({index:e,item:t,native:i,path:s,type:l})=>{const o=t?.feature,n=o?.getObjectId(),r="cell-keydown"===l&&i&&i instanceof KeyboardEvent&&"Enter"===i.key;this.emit(l,{feature:o,index:e,native:i,type:l,fieldName:s??void 0,objectId:n}),(r||"cell-click"===l)&&this._onCellInteraction(n)})),g((()=>this.actionColumnConfig),(e=>{const{actionColumn:t,columns:i}=this;t?e?t.set(e):i.remove(t):e&&i.length&&i.add(this._generateActionColumn(),!1!==e.frozenToEnd?void 0:this._getIndexOfFirstFrozenToEndColumn())})),g((()=>this.relatedRecordsEnabled),(()=>this.layer?.loaded&&this._generateColumns())),u((()=>this.objectIds),"change",(()=>this._onObjectIdsChange()),{onListenerAdd:()=>this._onObjectIdsChange()}),g((()=>[this.paginationEnabled,this.pageIndex]),(()=>this.refreshPageCache())),g((()=>this.activeSortOrders),(e=>{this.store.sortOrders=e,this._syncAttributeTableTemplate()})),g((()=>this.allVisibleColumns),(()=>this._syncAttributeTableTemplate())),g((()=>this.pageCount),(()=>{this.pageIndex>=this.pageCount&&this.goToPage(0)})),g((()=>this.state),(e=>{"disabled"===e&&this.relatedTables.length&&this.drainRelatedTables()})),u((()=>this.tableParent?.highlightIds),"change",(({added:e})=>{const{relationshipConfig:t}=this,i=e[0];if(null==i||!t)return;const{relatedLayer:s,relationshipId:l}=t;this.relationshipConfig={objectId:i,relatedLayer:s,relationshipId:l}})),u((()=>this.tableParent),"cell-click",(e=>{const{tableParent:t}=this,{objectId:i}=e;t&&null!=i&&t.highlightIds.add(i)})),g((()=>this.attachmentsViewOptions.objectId),((e,t)=>{null!=e?null==t&&this.showAttachmentsView({objectId:e}):this.hideAttachmentsView()}))])}destroy(){this._drainColumns(),this._highlights.removeAll(),this._highlights.destroy(),this._currentTemporaryHighlight?.handle.remove(),this._temporaryHighlightAbortController=a(this._temporaryHighlightAbortController),this.grid?.destroy(),this.columns.destroyed||this.columns.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return T(this.layer)}get _effectiveTableTemplate(){return this.tableTemplateOverride||this.tableTemplate}get _effectiveAttributeTableTemplate(){return this.attributeTableTemplate||this.layer?.attributeTableTemplate}get _highlightableLayerView(){const e=this.layerView;return j(e)?e:null}get _selectionManager(){const{view:e}=this;return!e||e.destroyed?null:e.selectionManager?.sources?.length?e.selectionManager:null}get _selectableLayer(){const{layer:e}=this;if(S(e)||w(e)){const t=e;return this._selectionManager?.sources?.includes(t)?t:null}return null}get _subtypes(){return _(this.layer)}get _tableHighlightsReady(){return!("table"!==this.selectionSource||!this.highlightEnabled||!this._highlightableLayerView)}get _viewSelection(){const{_selectableLayer:e}=this;return e?this._selectionManager?.getSelection(e)??[]:[]}get _viewSelectionReady(){return!(!this.layer||"view"!==this.selectionSource||!this._selectionManager)}get activeFilters(){const{filterGeometry:e,objectIds:t,filterBySelectionEnabled:s,highlightIds:l}=this,o=new i;return e&&o.push({type:"geometry",geometry:e}),s?o.push({type:"selection",objectIds:l.toArray()}):t.length&&o.push({type:"objectId",objectIds:t.toArray()}),o}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map((({path:e,direction:t})=>({fieldName:e,direction:t}))).filter((e=>e.fieldName&&e.direction)):[]}get allRelatedTablesVisible(){return!!(this.relatedRecordsEnabled&&this.relatedTables.length&&this.showAllRelatedTables)}get attachmentsEnabled(){return this.store.attachmentsEnabled}set attachmentsEnabled(e){this.store.attachmentsEnabled=e}get clearPrompt(){return()=>this.prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}get definitionExpression(){return this.store.where}set definitionExpression(e){this.store.where=e}get filterGeometry(){return this.store.filterGeometry}set filterGeometry(e){this.store.filterGeometry=e}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(e){const{objectIds:t}=this,i=t.length;e?(i&&(t.removeAll(),this._logWarning("Selection filter has been applied with an objectID filter. Object ID filter has been removed.")),this.filterGeometry&&this._logWarning("Selection filter has been applied with a geometry filter. Results may appear inconsistent"),this._syncObjectIdsWithStore(this.highlightIds.toArray())):i||this._syncObjectIdsWithStore(null),this._set("filterBySelectionEnabled",e)}get hiddenFields(){return this._get("hiddenFields")??new i}set hiddenFields(e){this._set("hiddenFields",s(e,this._get("hiddenFields"),i))}get initialSize(){return this.store.initialSize}set initialSize(e){this.store.initialSize=e}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing||this.relatedTables.some((e=>!!e.isQueryingOrSyncing))}get isSyncingAttachments(){return this.store.isSyncingAttachmentEdits||this.relatedTables.some((e=>!!e.isSyncingAttachments))}get layer(){return this._get("layer")}set layer(e){this._highlights.removeAll(),this.drainRelatedTables(),this._set("layer",e)}get layerView(){return this.store.layerView}get outFields(){return this.store.outFields}set outFields(e){this.store.outFields=e}get relatedRecordsEnabled(){return this.store.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.store.relatedRecordsEnabled=e}get relatedTable(){return this.relatedTables.at(-1)}get relationship(){const e=this.relationshipConfig?.relationshipId;return null==e?null:this.relationships?.find((({id:t})=>t===e))}get relationshipConfig(){return this.store.relationshipConfig}set relationshipConfig(e){this.highlightIds.removeAll(),this.objectIds.removeAll(),this.filterBySelectionEnabled=!1,this.store.relationshipConfig=e}get relationshipInfos(){const{layer:e,layers:t,relationships:i,tableController:s}=this,l=this.store.relationshipInfos;if(l.length||!q(e)||!i?.length)return l;const o=[],n=s?.layers||t||[];return i.forEach((t=>{const i=Q(e,n,t);i&&(i.load(),o.push({layer:e,relatedLayer:i,relationshipId:t.id}))})),o}get relationships(){return this.store.relationships}get returnGeometryEnabled(){return this.store.returnGeometry}set returnGeometryEnabled(e){this.store.returnGeometry=e}get returnMEnabled(){return this.store.returnM}set returnMEnabled(e){this.store.returnM=e}get returnZEnabled(){return this.store.returnZ}set returnZEnabled(e){this.store.returnZ=e}get showAllRelatedTables(){return this._get("showAllRelatedTables")}set showAllRelatedTables(e){const{relatedTable:t}=this;this._set("showAllRelatedTables",e),t&&(e?this._showAllRelatedTables(t):this._hideAllRelatedTables(t))}get showPrompt(){return e=>{this.prompt?.cancel?.(),this.prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get supportsAttachments(){return this.store.supportsAttachments}get supportsAddAttachments(){const{store:{supportsAddingAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get supportsDeleteAttachments(){const{store:{supportsDeletingAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get supportsResizeAttachments(){return this.store.supportsResizeAttachments}get supportsUpdateAttachments(){const{store:{supportsUpdateAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get timeExtent(){return this.store.timeExtent}set timeExtent(e){this.store.timeExtent=e}get timeZone(){return this._get("timeZone")}set timeZone(e){this.allColumns.forEach((t=>t.tableTimeZone=e)),this._set("timeZone",e)}get view(){return this.store.view}set view(e){this.store.view=e,this.fieldColumns.forEach((t=>t.view=e)),this.refreshCellContent()}async addAttachment(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.addAttachment(e,t).catch((e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof o&&(this._logWarning(`Unable to add attachment. ${e.error.name} ${e.error.message}`),i.error=e.error)})),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async deleteAttachments(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.deleteAttachments(e,t).catch((e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof o&&(this._logWarning(`Unable to delete attachment(s). ${e.error.name} ${e.error.message}`),i.error=e.error)})),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}collapseRelatedTable(e,t){const{relatedLayer:s,objectId:l,relationshipId:o}=t,{objectIdField:n}=s,r=K(s,o),a=s.displayField||r?.keyField||n;e.set({highlightIds:new i([l]),multipleSelectionEnabled:!1,tableTemplateOverride:this._getTableTemplateForRelatedTableView(e,a,o)});const h=e.hiddenFields;h.includes(J.action)||h.add(J.action),h.includes(J.attachments)||h.add(J.attachments),e.scrollLeft()}async deleteSelection(){const e=this.highlightIds.toArray();if(!e?.length)return;const{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),i=t.filter((e=>!e.error)).map((e=>e.objectId));i.length&&(this.highlightIds.removeMany(i),await this.refresh())}async downloadAttachmentById(e,t){const i=(await this.store.getAttachmentsByObjectId(e,!0)).find((e=>e.id===t));G(i)}drainRelatedTables(){this.relatedTables.drain((e=>e.destroy())),this.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:null,showAllRelatedTables:!1,tableTemplateOverride:null}),this.hiddenFields.removeMany([J.action,J.attachments])}drainRelatedTablesAboveIndex(e){const{relatedTables:t}=this,i=t.slice(e+1);t.removeMany(i).forEach((e=>e.destroy()));const s=t.at(-1);s&&(s.attachmentsViewOptions.objectId=null,this.allRelatedTablesVisible?this._showAllRelatedTables(s):this._hideAllRelatedTables(s))}async exportSelectionToCSV(e){const{highlightIds:t,layer:i,outFields:s}=this;i&&t.length?await k({layer:i,objectIds:t.toArray(),outFields:s,includeGeometry:e}):this._logWarning("Export failed.")}filterBySelection(){this.filterBySelectionEnabled?this._logWarning("Property 'filterBySelectionEnabled' is already 'true'. This method has no effect."):(l(r.getLogger(this),"`FeatureTable.filterBySelection` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.addMany(this.highlightIds.toArray()))}getObjectIdIndex(e){return this.store.getItemIndexByObjectId(e)}getValue(e,t){const i=this.store.getItemByObjectId(e);return i?.feature?.attributes[t]}getVirtualPageIndex(){return this.grid?.getVirtualPageIndex()??0}goToPage(e){if(null==e||!Number.isInteger(e))return void this._logWarning("Invalid 'page' parameter provided to 'goToPage()'. Current page will remain the same.");const{pageCount:t}=this;(e>=t||-1===e)&&(e=t-1),e<-1&&(e=0),e!==this.pageIndex&&(this.pageIndex=e),this.paginationEnabled||this.scrollToIndex(e*this.pageSize)}hideAttachmentsView(){this.attachmentsViewOptions.objectId=null,this.set({relationshipColumnConfigs:null,multipleSelectionEnabled:!0,tableTemplateOverride:null}),this.hiddenFields.remove(J.action)}nextPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e+1)}previousPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e-1)}async refresh(){return this.relatedTables.forEach((async e=>await e.refresh())),d(this._debounceRefresh())}refreshCellContent(){this.grid?.requestContentUpdate()}refreshPageCache(){this.grid?.refreshPageCache()}async reset(){this.goToPage(0),await(this.grid?.reset())}scrollLeft(){this.grid?.scrollLeft(0)}scrollToBottom(){this.grid?.scrollToBottom()}scrollToIndex(e){this.grid?.scrollToIndex(e)}scrollToRow(e){const t=this.store.getItemIndexByObjectId(e);t>-1?this.grid?.scrollToIndex(t):this._logWarning("Row not found. Associated data may not be loaded yet.")}scrollToTop(){this.grid?.scrollToTop()}async saveAttachmentsViewForm(){const{attachmentId:e,form:t,objectId:i}=this.attachmentsViewOptions;null!=i&&t&&(null!=e?await this.updateAttachment(i,e,t):await this.addAttachment(i,t))}async showAttachmentsView({objectId:e}){const{attachmentsViewOptions:t,hiddenFields:s,layer:l}=this;if(!this.attachmentsEnabled||!l)return void this._logWarning("The 'attachmentsEnabled' property is currently false.");await l.load();const o=this._getDefaultLayerDisplayField(l),n=await this.store.getAttachmentsByObjectId(e,!0),r=this.store.getItemIndexByObjectId(e);t.set({attachmentInfos:n,mode:n.length?"list":"file",objectId:e}),this.set({highlightIds:new i([e]),multipleSelectionEnabled:!1,relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForAttachmentsView(o)}),s.includes(J.action)||s.add(J.action),null!=r&&this.scrollToIndex(r)}syncAttributeTableTemplate(){this._syncAttributeTableTemplate(!0)}clearSelectionFilter(){l(r.getLogger(this),"`FeatureTable.clearSelectionFilter` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.removeAll()}async updateAttachment(e,t,i){const{attachmentsViewOptions:s,store:l}=this,n=s.objectId===e;await l.updateAttachment(e,t,i).catch((e=>{n&&e&&"object"==typeof e&&"error"in e&&e.error instanceof o&&(this._logWarning(`Unable to update attachment. ${e.error.name} ${e.error.message}`),s.error=e.error)})),n&&!s.error&&(s.onEditComplete(),s.attachmentInfos=await l.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async zoomToSelection(){const{layer:e,view:t}=this,i=this.highlightIds.toArray();if(!e||!t||!i.length)return;const s=e.createQuery();s.objectIds=i,s.returnGeometry=!0;const l=await e.queryFeatures(s);try{await le(t,l.features)}catch(o){"AbortError"!==o.name&&console.error(o)}}_syncAttributeTableTemplate(e=!1){const{_effectiveAttributeTableTemplate:t,layer:i,tableTemplateOverride:s,syncTemplateOnChangesEnabled:l}=this;if(!i||!t||!l&&!e||s||this.tableParent||this.relatedTable||null!==this.attachmentsViewOptions.objectId)return;const{activeSortOrders:o,allColumns:n,columns:r}=this,a=[],h=se(r.toArray());o.forEach((({fieldName:e,direction:t})=>{e&&t&&a.push(new E({field:e,order:t}))})),n.forEach((({fieldName:e,direction:t})=>{t&&!a.some((t=>t.field===e))&&a.push(new E({field:e,order:t}))})),t.elements=h,t.orderByFields=a}async _refresh(){await this.store.refresh();const e=this.highlightIds.toArray();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach(((t,i)=>{t||this.highlightIds.remove(e[i])}))}this.refreshPageCache();const t=this.attachmentsViewOptions;null!=t?.objectId&&(t.attachmentInfos=await this.store.getAttachmentsByObjectId(t.objectId,!0))}async _onLayerLoad(){const{layer:e,pageSize:t}=this;if(!e)return;e.parent&&C(e.parent)&&await e.parent.loadAll();const i=e.capabilities.query?.maxRecordCount,s=i&&i<t,l=s?i:t;s&&(this._logWarning("The value for 'pageSize' has been adjusted due to the provided layer's max record count."),this.pageSize=l),this.grid?.set("pageSize",l),this.store.load(),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._drainColumns();const{_effectiveTableTemplate:e,_effectiveAttributeTableTemplate:t}=this,i=e?.columnTemplates,s=this._generateColumnsFromColumnTemplates(i)??this._generateColumnsFromAttributeTableTemplate(t)??this._generateDefaultFieldColumns();s.length&&(this.attachmentsEnabled&&!s.some((e=>B(e)))&&s.push(this._generateDefaultAttachmentsColumn()),this.relatedRecordsEnabled&&this.relationshipInfos.length&&!s.some((e=>Z(e)))&&s.push(...this._generateDefaultRelationshipColumns()),this.actionColumnConfig&&s.push(this._generateActionColumn()),s.sort(((e,t)=>e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd?0:e.frozen||t.frozenToEnd?-1:0)),this.columns.addMany(s))}_generateColumnsFromAttributeTableTemplate(e){const{layer:i}=this;if(!e||!i)return null;const{elements:s,orderByFields:l}=e,o=I(i),n=[];n.push(...this._generateColumnsFromAttributeTableElements(s,l));const r=o.map((e=>{if(!e.fieldName||X(e.fieldName,n))return null;const{fieldName:t}=e,s=Y(i,t);return s?this._generateDefaultFieldColumn(s,{hidden:!0,orderByFields:l}):(this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null)})).filter(t);return n.push(...r),this.attachmentsEnabled&&ee(i)&&!n.some((e=>B(e)))&&n.push(this._generateDefaultAttachmentsColumn({hidden:!0})),this.relatedRecordsEnabled&&q(i)&&i.relationships?.forEach((({id:e},t)=>{const i=this.relationshipInfos.find((t=>t.relationshipId===e));i&&!n.some((t=>Z(t)&&t.relationshipId===e))&&n.push(this._generateDefaultRelationshipColumn({hidden:!0,info:i,index:t}))})),n.length?n:null}_generateColumnsFromAttributeTableElements(e,t){const{layer:i}=this;return i?e?.map(((e,i)=>{switch(e.type){case"field":return this._createFieldColumnFromElement({element:e,orderByFields:t});case"group":return this._createGroupColumnFromElement({element:e,orderByFields:t});case"attachment":return this._createAttachmentColumnFromElement({element:e,index:i});case"relationship":return this._createRelationshipColumnFromElement({element:e,index:i})}})).filter((e=>!!e))??[]:[]}_createFieldColumnFromElement(e){const{layer:t}=this;if(!t)return null;const{element:i,orderByFields:s}=e,{fieldName:l}=i;if(null==l)return this._logTemplateWarning("A valid 'fieldName' must be provided."),null;const o=Y(t,l);if(!o)return this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null;const{description:n,label:r}=i,a=s?.findIndex((({field:e})=>e&&e===l))??-1,h=a>-1?s?.at(a)?.order:void 0,d=a>-1?a:void 0,{editingEnabled:m,grid:c,messages:p,messagesCommon:g,messagesURIUtils:u,store:b,timeZone:f,view:y}=this;return new U({description:n,direction:h,field:o,fieldName:l,grid:c,initialSortPriority:d,label:r,layer:t,messages:p,messagesCommon:g,messagesURIUtils:u,store:b,tableEditingEnabled:m,tableTimeZone:f,view:y,onShowPromptCallback:this._onShowPromptCallback})}_createGroupColumnFromElement(e){const{element:t,orderByFields:i}=e,{description:s,label:l}=t;if(!l)return this._logTemplateWarning("Group columns require a label."),null;if(!t.elements.length)return this._logTemplateWarning("Group columns require child columns."),null;const{grid:o,messages:n,messagesCommon:r,messagesURIUtils:a,store:h,timeZone:d}=this;return new P({columns:this._generateColumnsFromAttributeTableElements(t.elements,i),description:s,grid:o,label:l,messages:n,messagesCommon:r,messagesURIUtils:a,store:h,tableTimeZone:d})}_createAttachmentColumnFromElement(e){if(!this.attachmentsEnabled)return void this._logTemplateWarning("The 'attachmentsEnabled' property is currently false.");const{element:t,index:i}=e,{description:s,label:l}=t,{grid:o,layer:n,messages:r,messagesCommon:a,messagesURIUtils:h,store:d,timeZone:m}=this;return new x({description:s,fieldName:`${J.attachments}-${i}`,grid:o,label:l,layer:n,messages:r,messagesCommon:a,messagesURIUtils:h,store:d,tableTimeZone:m,onShowAttachments:e=>this._onShowAttachments(e)})}_createRelationshipColumnFromElement(e){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{element:t,index:i}=e,{description:s,label:l,relationshipId:o}=t,n=this.relationshipInfos.find((e=>e.relationshipId===o));if(!n)return this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id."),null;const{grid:r,messages:a,messagesCommon:h,messagesURIUtils:d,store:m,timeZone:c}=this;return new O({description:s,fieldName:`${J.relationship}-${o}-${i}`,grid:r,label:l,messages:a,messagesCommon:h,messagesURIUtils:d,relationshipId:o,store:m,tableTimeZone:c,layer:n.relatedLayer,relatedLayer:n.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateColumnsFromColumnTemplates(e){const{editingEnabled:t,grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:n,store:r,timeZone:a,view:h}=this;if(!e?.length||!s)return null;const d=[];return e.forEach(((e,m)=>{const{autoWidth:c,description:p,direction:g,flexGrow:u,fieldName:b,formatFunction:f,frozen:y,frozenToEnd:T,icon:w,iconText:_,initialSortPriority:C,invalid:I,label:v,menuConfig:E,resizable:A,sortable:F,textAlign:j,textWrap:S,timeZone:R,type:x,width:O}=e;if(!x)return void this._logTemplateWarning("Property 'type' is missing from the provided template.");if(y&&T)return void this._logTemplateWarning("Properties 'frozen' and 'frozenToEnd' cannot both be true for the same column.");const W=!1===e.visible;if("group"===x){if(!e.columnTemplates?.length)return void this._logTemplateWarning("Group columns must contain column templates.");if(!e.label)return void this._logTemplateWarning("Group columns require a label.");const t=this._generateColumnsFromColumnTemplates(e.columnTemplates),s=W||this._isFieldHidden(e.label);d.push(new P({autoWidth:c,columns:t,description:p,flexGrow:u,frozen:y,frozenToEnd:T,grid:i,hidden:s,icon:w,iconText:_,invalid:I,label:v,menuConfig:E,messages:l,messagesCommon:o,messagesURIUtils:n,resizable:A,tableTimeZone:a,textAlign:j,textWrap:S,timeZone:R,width:O}))}else if("attachment"===x){if(!this.attachmentsEnabled)return void this._logTemplateWarning("Attachment columns require attachments to be enabled on the table.");d.push(this._generateAttachmentsColumnFromTemplate(e,m))}else if("relationship"===x){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{relationshipId:t}=e;if(null==t)return void this._logTemplateWarning("Property 'relationshipId' is missing from the provided template.");const i=this.relationshipInfos.find((e=>e.relationshipId===t));if(!i)return void this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id.");d.push(this._generateRelationshipColumnFromTemplate(i,e,m))}else if(!b)return void this._logTemplateWarning("Value for 'fieldName' property was missing from the provided template.");const z=W||this._isFieldHidden(b);if("column"===x)d.push(new V({autoWidth:c,description:p,direction:g,fieldName:b,flexGrow:u,formatFunction:f,frozen:y,frozenToEnd:T,grid:i,hidden:z,icon:w,iconText:_,initialSortPriority:C,invalid:I,label:v,menuConfig:E,messages:l,messagesCommon:o,messagesURIUtils:n,resizable:A,sortable:F,tableTimeZone:a,textAlign:j,textWrap:S,timeZone:R,width:O}));else if("field"===x){const m=Y(s,e.fieldName);if(!m)return void this._logTemplateWarning("A valid 'field' could not be found for the provided template.");const{editable:b,required:x}=e;d.push(new U({autoWidth:c,description:p,direction:g,editable:b,field:m,fieldName:m.name,flexGrow:u,formatFunction:f,frozen:y,frozenToEnd:T,grid:i,hidden:z,icon:w,iconText:_,initialSortPriority:C,invalid:I,label:v,layer:s,messages:l,messagesCommon:o,messagesURIUtils:n,menuConfig:E,required:x,resizable:A,sortable:F,store:r,tableEditingEnabled:t,tableTimeZone:a,template:e,textAlign:j,textWrap:S,timeZone:R,width:O,view:h,onShowPromptCallback:this._onShowPromptCallback}))}})),d.length?d:null}_generateDefaultFieldColumns(){return this.layer?.fields?.map((e=>this._generateDefaultFieldColumn(e))).filter(t)??[]}_generateDefaultFieldColumn(e,t){const{editingEnabled:i,grid:s,layer:l,messages:o,messagesCommon:n,messagesURIUtils:r,store:a,timeZone:h,view:d}=this,m=t?.orderByFields;if(!e.visible||"geometry"===e.type)return null;const c=e.name,p=m?.findIndex((({field:e})=>e&&e===c))??-1,g=p>-1?m?.at(p)?.order:void 0,u=p>-1?p:void 0;return new U({direction:g,field:e,fieldName:c,grid:s,hidden:t?.hidden||this._isFieldHidden(c),initialSortPriority:u,layer:l,messages:o,messagesCommon:n,messagesURIUtils:r,store:a,tableEditingEnabled:i,tableTimeZone:h,view:d,onShowPromptCallback:this._onShowPromptCallback})}_generateAttachmentsColumnFromTemplate(e,t){const{grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:n,store:r,timeZone:a}=this,{attachmentsViewEnabled:h,autoWidth:d,description:m,flexGrow:c,fieldName:p,formatFunction:g,frozen:u,frozenToEnd:b,icon:f,iconText:y,invalid:T,label:w,menuConfig:_,resizable:C,textAlign:I,textWrap:v,thumbnailAppearance:E,thumbnailCount:A,thumbnailIconScale:F,thumbnailsEnabled:j,timeZone:S,width:R}=e;return new x({attachmentsViewEnabled:h,autoWidth:d,description:m,fieldName:`${J.attachments}-${t}`,flexGrow:c,formatFunction:g,frozen:u,frozenToEnd:b,grid:i,hidden:!1===e.visible||this._isFieldHidden(w)||this._isFieldHidden(p),icon:f,iconText:y,invalid:T,label:w,layer:s,menuConfig:_,messages:l,messagesCommon:o,messagesURIUtils:n,resizable:C,store:r,tableTimeZone:a,textAlign:I,textWrap:v,thumbnailAppearance:E,thumbnailCount:A,thumbnailIconScale:F,thumbnailsEnabled:j,timeZone:S,width:R,onShowAttachments:e=>this._onShowAttachments(e)})}_generateDefaultAttachmentsColumn(e){const{grid:t,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:n,timeZone:r}=this,a=J.attachments;return new x({fieldName:a,grid:t,hidden:e?.hidden||this._isFieldHidden(a),layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:n,tableTimeZone:r,onShowAttachments:e=>this._onShowAttachments(e)})}_generateRelationshipColumnFromTemplate(e,t,i){const{grid:s,messages:l,messagesCommon:o,messagesURIUtils:n,store:r,timeZone:a}=this,{autoWidth:h,collapsed:d,description:m,flexGrow:c,fieldName:p,formatFunction:g,frozen:u,frozenToEnd:b,icon:f,iconText:y,invalid:T,label:w,menuConfig:_,relationshipId:C,resizable:I,textAlign:v,textWrap:E,timeZone:A,width:F}=t;return new O({autoWidth:h,collapsed:d,description:m,fieldName:`${J.relationship}-${C}-${i}`,flexGrow:c,formatFunction:g,frozen:u,frozenToEnd:b,grid:s,hidden:!1===t.visible||this._isFieldHidden(w)||this._isFieldHidden(p),icon:f,iconText:y,invalid:T,label:w,menuConfig:_,messages:l,messagesCommon:o,messagesURIUtils:n,relationshipId:C,resizable:I,store:r,tableTimeZone:a,textAlign:v,textWrap:E,timeZone:A,width:F,layer:e.relatedLayer,relatedLayer:e.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateDefaultRelationshipColumns(){const{relationshipInfos:e,relationshipColumnConfigs:t}=this,i=[];return e?.length?(t?t.forEach(((t,s)=>{const{relationshipId:l}=t,o=e.find((e=>e.relationshipId===l));o&&i.push(this._generateDefaultRelationshipColumn({config:t,index:s,info:o}))})):e.forEach(((e,t)=>i.push(this._generateDefaultRelationshipColumn({index:t,info:e})))),i):i}_generateDefaultRelationshipColumn(e){const{config:t,hidden:i,index:s,info:l}=e,{grid:o,messages:n,messagesCommon:r,messagesURIUtils:a}=this,{relationshipId:h}=l;return new O({...t,fieldName:`${J.relationship}-${h}-${s}`,grid:o,hidden:i,messages:n,messagesCommon:r,messagesURIUtils:a,layer:l.relatedLayer,relatedLayer:l.layer,relationshipId:h,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateActionColumn(){return new R({hidden:this._isFieldHidden(J.action),...this.actionColumnConfig})}_isFieldHidden(e){const t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some((e=>e.toLowerCase()===t))}_addTableHighlight(e){if(!this.highlightEnabled)return;const{_highlightableLayerView:t,layer:i}=this;if(t&&i){const s=this.store.getItemByObjectId(e),l=s?.feature??e;this._highlights.add(t.highlight(l,{name:A}),te(i,e))}}_removeTableHighlight(e){const{layer:t}=this;t&&this._highlights.remove(te(t,e))}async _syncTemporaryHighlight(e,t){if(!this.highlightEnabled)return this._currentTemporaryHighlight?.handle.remove(),void(this._currentTemporaryHighlight=null);if(await m(25),c(t),!this._currentTemporaryHighlight&&!e)return;const{id:i}=this._currentTemporaryHighlight??{};if(i===e)return;this._currentTemporaryHighlight?.handle?.remove(),this._currentTemporaryHighlight=null;const{_highlightableLayerView:s,layer:l,highlightEnabled:o}=this;e&&s&&l&&o&&(this._currentTemporaryHighlight={id:e,handle:s.highlight(e,{name:F})})}_syncSelection(){this._highlights.removeAll(),this._tableHighlightsReady?this.highlightIds.forEach((e=>this._addTableHighlight(e))):this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}_appendToViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.appendToSelection(t,e)}_removeFromViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.removeFromSelection(t,e)}async _onHighlightIdsChange(e){const{added:t,removed:i}=e,{attachmentsViewOptions:s}=this;if(this._tableHighlightsReady?(i.forEach((e=>this._removeTableHighlight(e))),t.forEach((e=>this._addTableHighlight(e)))):this._viewSelectionReady&&(this._removeFromViewSelection(i),this._appendToViewSelection(t)),this.filterBySelectionEnabled&&this._syncObjectIdsWithStore(this.highlightIds.toArray()),null!=s.objectId){const e=this.highlightIds.at(0);if(null!=e){const t=await this.store.getAttachmentsByObjectId(e,!0);s.set({attachmentInfos:t,objectId:e,mode:t.length?"list":"file"})}}}_onShowRelatedTable(e){const{highlightIds:t}=this,{objectId:i}=e;t.removeAll(),t.add(i),this.showRelatedTableCallback?this.showRelatedTableCallback(e):this.emit("show-related-table",e)}_onObjectIdsChange(){const e=this.objectIds.toArray();e.length&&this.filterBySelectionEnabled&&(this.filterBySelectionEnabled=!1,this._logWarning("Object ID filter was applied while a selection filter was applied. Selection filter has been removed.")),this._syncObjectIdsWithStore(e)}_syncObjectIdsWithStore(e){this.store.objectIds=e,this.refreshPageCache()}_drainColumns(){this.columns.drain((e=>!e.destroyed&&e.destroy()))}_showAllRelatedTables(e){const t=e.layer;if(!t)return;const i=this._getDefaultLayerDisplayField(t);e.set({relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForShowAllTablesView(e,i)});const s=e.hiddenFields;s.includes(J.action)||s.add(J.action),s.includes(J.attachments)||s.add(J.attachments)}_hideAllRelatedTables(e){const{layer:t,relationship:i}=e;if(t&&null!=i?.id)if(null!=e.attachmentsViewOptions.objectId){const i=this._getDefaultLayerDisplayField(t);e.set({multipleSelectionEnabled:!1,relationshipColumnConfigs:[],showAllRelatedTables:!1,tableTemplateOverride:this._getTableTemplateForAttachmentsView(i)})}else e.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:ie(t,i.id),showAllRelatedTables:!1,tableTemplateOverride:null}),e.hiddenFields.removeMany([J.action,J.attachments])}_getTableTemplateForRelatedTableView(e,t,i){return new $({columnTemplates:[new D({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map((([s,l])=>({selected:s===t,label:l||s,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForRelatedTableView(e,s,i)}})))},resizable:!1}),new M({autoWidth:!1,collapsed:!0,flexGrow:0,label:"",resizable:!1,relationshipId:i,width:he})]})}_getTableTemplateForShowAllTablesView(e,t){const i=[new D({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map((([i,s])=>({selected:i===t,label:s||i,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForShowAllTablesView(e,i)}})))},resizable:!1})];return null!=e.attachmentsViewOptions.objectId&&i.push(new L({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:he})),new $({columnTemplates:i})}async _onShowPromptCallback(e){const{column:t,objectId:i,oldValue:s,value:l}=e,{_subtypes:o,layer:n}=this;if(!n||!o.length)return void t.cancel();const r=o.find((e=>e.code===l));if(!r)return void t.cancel();const a=p(),h=this._createSubtypeEditPrompt(s,r,a),d=!!n.parent;try{this.showPrompt(h);const e=await a.promise,s=[{fieldName:t.fieldName,value:l}];switch(e){case"update-fields":for(const[e,t]of Object.entries(r.defaultValues))null!=t&&s.push({fieldName:e,value:t});await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"keep-existing":await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"undo":t.cancel()}}finally{this.clearPrompt()}}_createSubtypeEditPrompt(e,t,i){const{_subtypes:s,messages:l,messagesCommon:o}=this,n=s.find((t=>t.code===e))?.name??`${e}`;let r="update-fields";const a=[{label:l.subtypes.useDefaultValuesOption,value:"update-fields"},{label:l.subtypes.keepCurrentValuesOption,value:"keep-existing"}];return{context:"info",title:l.subtypes.changeWarningTitle,message:re(l.subtypes.changeWarning,{originalType:n,newType:t.name}),radios:a,defaultRadioSelection:"update-fields",onRadioSelection:e=>{r=e},actions:{primary:{label:o.apply,action:()=>i.resolve(r),type:"positive"},secondary:{label:o.cancel,type:"neutral",action:()=>i.resolve("undo")}},cancel:()=>i.reject()}}_onShowAttachments({objectId:e}){this.attachmentsViewOptions.objectId=e}_getTableTemplateForAttachmentsView(e){return new $({columnTemplates:[new D({fieldName:e,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(this).map((([t,i])=>({selected:t===e,label:i||t,clickFunction:()=>{this.tableTemplateOverride=this._getTableTemplateForAttachmentsView(t)}})))},resizable:!1}),new L({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:he})]})}_extractFieldColumnInfosFromTableTemplate(e){const t=e??this,{layer:i,tableTemplate:s}=t;return s?s.columnTemplates.filter((({type:e})=>"field"===e||"column"===e)).map((({fieldName:e,label:t})=>[e,t])):i?.fields.map((e=>[e.name,e.alias]))??[]}_getDefaultLayerDisplayField(e){const{displayField:t,objectIdField:i}=e;return t&&""!==t.trim()?t:i||(e.fields.length?e.fields[0].name:"")}_getIndexOfFirstFrozenToEndColumn(){const e=this.columns.findIndex((e=>e.frozenToEnd));return e>-1?e:void 0}_logWarning(e,t){t?r.getLogger(this).warnOnce(e):r.getLogger(this).warn(e)}_logTemplateWarning(e){this._logWarning(`${e} Skipped generating a column using the provided template.`,!0)}_onCellInteraction(e){null!=e&&null!=this.attachmentsViewOptions.objectId&&this.highlightIds.add(e)}};e([f()],de.prototype,"_defaultHiddenFields",null),e([f()],de.prototype,"_effectiveTableTemplate",null),e([f()],de.prototype,"_effectiveAttributeTableTemplate",null),e([f()],de.prototype,"_highlights",void 0),e([f()],de.prototype,"_highlightableLayerView",null),e([f()],de.prototype,"_selectionManager",null),e([f()],de.prototype,"_selectableLayer",null),e([f()],de.prototype,"_subtypes",null),e([f()],de.prototype,"_tableHighlightsReady",null),e([f()],de.prototype,"_viewSelection",null),e([f()],de.prototype,"_viewSelectionReady",null),e([f()],de.prototype,"activeFilters",null),e([f({readOnly:!0})],de.prototype,"activeSortOrders",null),e([f()],de.prototype,"allRelatedTablesVisible",null),e([f()],de.prototype,"attachmentsEnabled",null),e([f()],de.prototype,"attachmentsViewOptions",void 0),e([f({type:v})],de.prototype,"attributeTableTemplate",void 0),e([f()],de.prototype,"autoRefreshEnabled",void 0),e([f()],de.prototype,"clearPrompt",null),e([f({readOnly:!0})],de.prototype,"columns",void 0),e([f()],de.prototype,"dataProvider",void 0),e([f()],de.prototype,"definitionExpression",null),e([f()],de.prototype,"filterGeometry",null),e([f()],de.prototype,"filterBySelectionEnabled",null),e([f({readOnly:!0})],de.prototype,"grid",void 0),e([f()],de.prototype,"hiddenFields",null),e([f()],de.prototype,"highlightEnabled",void 0),e([f()],de.prototype,"initialSize",null),e([f()],de.prototype,"isQueryingOrSyncing",null),e([f()],de.prototype,"isSyncingAttachments",null),e([f()],de.prototype,"layer",null),e([f()],de.prototype,"layers",void 0),e([f()],de.prototype,"layerView",null),e([f()],de.prototype,"messages",void 0),e([f(),oe("esri/t9n/common")],de.prototype,"messagesCommon",void 0),e([f(),oe("esri/core/t9n/Units")],de.prototype,"messagesUnits",void 0),e([f(),oe("esri/widgets/support/t9n/uriUtils")],de.prototype,"messagesURIUtils",void 0),e([f()],de.prototype,"outFields",null),e([f()],de.prototype,"prompt",void 0),e([f()],de.prototype,"relatedRecordsEnabled",null),e([f()],de.prototype,"relatedTable",null),e([f()],de.prototype,"relatedTables",void 0),e([f()],de.prototype,"relationship",null),e([f()],de.prototype,"relationshipColumnConfigs",void 0),e([f()],de.prototype,"relationshipConfig",null),e([f()],de.prototype,"relationshipInfos",null),e([f()],de.prototype,"relationships",null),e([f()],de.prototype,"returnGeometryEnabled",null),e([f()],de.prototype,"returnMEnabled",null),e([f()],de.prototype,"returnZEnabled",null),e([f()],de.prototype,"selectionSource",void 0),e([f()],de.prototype,"showAllRelatedTables",null),e([f()],de.prototype,"showPrompt",null),e([f()],de.prototype,"showRelatedTableCallback",void 0),e([f({readOnly:!0,type:N})],de.prototype,"store",void 0),e([f()],de.prototype,"supportsAttachments",null),e([f()],de.prototype,"supportsAddAttachments",null),e([f()],de.prototype,"supportsDeleteAttachments",null),e([f()],de.prototype,"supportsResizeAttachments",null),e([f()],de.prototype,"supportsUpdateAttachments",null),e([f()],de.prototype,"syncTemplateOnChangesEnabled",void 0),e([f()],de.prototype,"tableController",void 0),e([f()],de.prototype,"tableParent",void 0),e([f({type:$})],de.prototype,"tableTemplate",void 0),e([f()],de.prototype,"tableTemplateOverride",void 0),e([f()],de.prototype,"timeExtent",null),e([f()],de.prototype,"timeZone",null),e([f()],de.prototype,"view",null),de=e([y("esri.widgets.FeatureTable.FeatureTableViewModel")],de);const me=de;export{me as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../intl.js";import{isSome as t}from"../../core/arrayUtils.js";import i from"../../core/Collection.js";import{referenceSetter as s}from"../../core/collectionUtils.js";import{deprecatedFunction as l}from"../../core/deprecate.js";import o from"../../core/Error.js";import n from"../../core/Handles.js";import r from"../../core/Logger.js";import{abortMaybe as a}from"../../core/maybe.js";import{debounce as h,ignoreAbortErrors as d,after as m,throwIfAborted as c,createResolver as p}from"../../core/promiseUtils.js";import{watch as g,on as u,initial as b}from"../../core/reactiveUtils.js";import{property as f}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import{getLowerCaseDefaultHiddenFields as T}from"../../layers/support/fieldUtils.js";import{isSubtypeSublayer as w,getSubtypesFromLayer as _,isSubtypeGroupLayer as C}from"../../layers/support/layerUtils.js";import{createFieldInfos as I}from"../../support/popupUtils.js";import v from"../../tables/AttributeTableTemplate.js";import E from"../../tables/support/FieldOrder.js";import{defaultHighlightName as A,temporaryHighlightName as F}from"../../views/support/HighlightDefaults.js";import{highlightsSupported as j}from"../../views/support/layerViewUtils.js";import{isSelectableLayer as S}from"../../views/support/selectionUtils.js";import R from"./ActionColumn.js";import x from"./AttachmentsColumn.js";import U from"./FieldColumn.js";import O from"./RelationshipColumn.js";import V from"./Grid/Column.js";import W from"./Grid/Grid.js";import z from"./Grid/GridViewModel.js";import P from"./Grid/GroupColumn.js";import L from"./support/AttachmentsColumnTemplate.js";import H from"./support/AttachmentsViewOptions.js";import{isAttachmentsColumn as B,isRelationshipColumn as Z}from"./support/columnUtils.js";import{downloadAttachmentInfo as G,exportToCSV as k}from"./support/exportUtils.js";import N from"./support/FeatureStore.js";import D from"./support/FieldColumnTemplate.js";import M from"./support/RelationshipColumnTemplate.js";import $ from"./support/TableTemplate.js";import{isIFeatureTableSupportedLayerWithRelationships as q,findRelatedLayerInSources as Q,findRelationship as K,uniqueColumnNames as J,hasColumnForField as X,findField as Y,isIFeatureTableSupportedLayerWithAttachments as ee,getTableHighlightKey as te,getRelationshipIdsToShow as ie}from"./support/tableUtils.js";import{createAttributeTableElements as se}from"./support/templateUtils.js";import{goTo as le}from"../support/goToUtils.js";import"../support/widgetUtils.js";import{messageBundle as oe}from"../support/decorators/messageBundle.js";import{onLocaleChange as ne}from"../../intl/locale.js";import{substitute as re}from"../../intl/substitute.js";import{fetchMessageBundle as ae}from"../../intl/messages.js";const he="80px";let de=class extends z{constructor(e){super(e),this._debounceRefresh=h((()=>this._refresh())),this._temporaryHighlightAbortController=null,this._currentTemporaryHighlight=null,this._highlights=new n,this.attachmentsViewOptions=new H,this.attributeTableTemplate=null,this.autoRefreshEnabled=!0,this.columns=new i,this.dataProvider=async(e,t)=>{const{layer:i,store:s}=this;if(!t)return;if(!i||!s)return void(t&&t([]));await i.load();const{objectIds:l}=this;if(this.filterBySelectionEnabled&&!this.highlightIds.length||1===l.length&&-1===l.items[0])return void t([]);"loaded"!==s.state&&"loading"!==s.state&&await s.load();const o=this.paginationEnabled?this.pageIndex:e.page,n=await s.fetchItems({...e,page:o});t&&t(n)},this.grid=null,this.highlightEnabled=!0,this.layers=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.messagesURIUtils=null,this.prompt=null,this.relatedTables=new i,this.relationshipColumnConfigs=null,this.selectionSource="table",this.showRelatedTableCallback=null,this.store=null,this.syncTemplateOnChangesEnabled=!0,this.tableController=null,this.tableParent=null,this.tableTemplate=null,this.tableTemplateOverride=null,this._onLayerRefresh=this._onLayerRefresh.bind(this),this._onShowPromptCallback=this._onShowPromptCallback.bind(this),this._set("store",new N),this._set("grid",new W({viewModel:this}))}initialize(){const e=async()=>{this.messages=await ae("esri/widgets/FeatureTable/t9n/FeatureTable"),this.messagesCommon=await ae("esri/t9n/common"),this.messagesUnits=await ae("esri/core/t9n/Units"),this.messagesURIUtils=await ae("esri/widgets/support/t9n/uriUtils")};e(),this.addHandles([ne((()=>{e(),this._generateColumns()})),g((()=>[this.messages,this.messagesCommon,this.messagesURIUtils]),(()=>{const e=this.messages;this.grid&&(this.grid.messages=e),this.allColumns.forEach((t=>{t.messages=e,t.messagesCommon=this.messagesCommon,t.messagesURIUtils=this.messagesURIUtils})),this.refreshCellContent()}),b),u((()=>this.highlightIds),"change",(e=>this._onHighlightIdsChange(e)),{onListenerAdd:()=>this._syncSelection(),onListenerRemove:()=>this._highlights.removeAll()}),g((()=>this.grid?.temporaryHighlightId),(e=>{this._temporaryHighlightAbortController?.abort(),this._temporaryHighlightAbortController=new AbortController,d(this._syncTemporaryHighlight(e,this._temporaryHighlightAbortController.signal))})),g((()=>this.attachmentsEnabled),(()=>this.layer?.loaded&&this._generateColumns())),g((()=>this._viewSelection),(()=>{this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)})),g((()=>[this._tableHighlightsReady,this._viewSelectionReady]),(()=>this._syncSelection())),g((()=>this.layer),(async(e,t)=>{const i=this.grid;i&&(i.clearSort(),e&&t&&await this.reset()),this.goToPage(0),this._drainColumns(),this.store.layer=e,e&&(e.loaded?this._onLayerLoad():e.load().catch((()=>{}))),t&&null!=this.attachmentsViewOptions.objectId&&(this.attachmentsViewOptions.objectId=null)})),g((()=>this.layer?.loaded),(e=>e&&this._onLayerLoad())),g((()=>this.store.state),(e=>{"loaded"===e&&(this.scrollToTop(),this.refreshCellContent())})),g((()=>this._effectiveTableTemplate),(()=>{this.scrollLeft(),this.layer?.loaded&&this._generateColumns()})),g((()=>this.editingEnabled),(e=>{this.editableColumns.forEach((t=>t.tableEditingEnabled=e)),this.refreshCellContent()})),g((()=>this.timeZone??this.view?.timeZone),(()=>this.refreshCellContent())),g((()=>this.layer?.definitionExpression),((e,t)=>(e||t)&&"loaded"===this.store.state&&this.reset())),g((()=>this.layer?.timeExtent),((e,t)=>(e||t)&&!this.timeExtent&&"loaded"===this.store.state&&this.reset())),u((()=>this.layer),"refresh",(e=>this._onLayerRefresh(e))),u((()=>this.grid),["cell-click","cell-dblclick","cell-pointerover","cell-pointerout","cell-keydown","column-reorder"],(({index:e,item:t,native:i,path:s,type:l})=>{const o=t?.feature,n=o?.getObjectId(),r="cell-keydown"===l&&i&&i instanceof KeyboardEvent&&"Enter"===i.key;this.emit(l,{feature:o,index:e,native:i,type:l,fieldName:s??void 0,objectId:n}),(r||"cell-click"===l)&&this._onCellInteraction(n)})),g((()=>this.actionColumnConfig),(e=>{const{actionColumn:t,columns:i}=this;t?e?t.set(e):i.remove(t):e&&i.length&&i.add(this._generateActionColumn(),!1!==e.frozenToEnd?void 0:this._getIndexOfFirstFrozenToEndColumn())})),g((()=>this.relatedRecordsEnabled),(()=>this.layer?.loaded&&this._generateColumns())),u((()=>this.objectIds),"change",(()=>this._onObjectIdsChange()),{onListenerAdd:()=>this._onObjectIdsChange()}),g((()=>[this.paginationEnabled,this.pageIndex]),(()=>this.refreshPageCache())),g((()=>this.activeSortOrders),(e=>{this.store.sortOrders=e,this._syncAttributeTableTemplate()})),g((()=>this.allVisibleColumns),(()=>this._syncAttributeTableTemplate())),g((()=>this.pageCount),(()=>{this.pageIndex>=this.pageCount&&this.goToPage(0)})),g((()=>this.state),(e=>{"disabled"===e&&this.relatedTables.length&&this.drainRelatedTables()})),u((()=>this.tableParent?.highlightIds),"change",(({added:e})=>{const{relationshipConfig:t}=this,i=e[0];if(null==i||!t)return;const{relatedLayer:s,relationshipId:l}=t;this.relationshipConfig={objectId:i,relatedLayer:s,relationshipId:l}})),u((()=>this.tableParent),"cell-click",(e=>{const{tableParent:t}=this,{objectId:i}=e;t&&null!=i&&t.highlightIds.add(i)})),g((()=>this.attachmentsViewOptions.objectId),((e,t)=>{null!=e?null==t&&this.showAttachmentsView({objectId:e}):this.hideAttachmentsView()}))])}destroy(){this._drainColumns(),this._highlights.removeAll(),this._highlights.destroy(),this._currentTemporaryHighlight?.handle.remove(),this._temporaryHighlightAbortController=a(this._temporaryHighlightAbortController),this.grid?.destroy(),this.columns.destroyed||this.columns.destroy(),this.layer=null,this.view=null}get _defaultHiddenFields(){return T(this.layer)}get _effectiveTableTemplate(){return this.tableTemplateOverride||this.tableTemplate}get _effectiveAttributeTableTemplate(){return this.attributeTableTemplate||this.layer?.attributeTableTemplate}get _highlightableLayerView(){const e=this.layerView;return j(e)?e:null}get _selectionManager(){const{view:e}=this;return!e||e.destroyed?null:e.selectionManager?.sources?.length?e.selectionManager:null}get _selectableLayer(){const{layer:e}=this;if(S(e)||w(e)){const t=e;return this._selectionManager?.sources?.includes(t)?t:null}return null}get _subtypes(){return _(this.layer)}get _tableHighlightsReady(){return!("table"!==this.selectionSource||!this.highlightEnabled||!this._highlightableLayerView)}get _viewSelection(){const{_selectableLayer:e}=this;return e?this._selectionManager?.getSelection(e)??[]:[]}get _viewSelectionReady(){return!(!this.layer||"view"!==this.selectionSource||!this._selectionManager)}get activeFilters(){const{filterGeometry:e,objectIds:t,filterBySelectionEnabled:s,highlightIds:l}=this,o=new i;return e&&o.push({type:"geometry",geometry:e}),s?o.push({type:"selection",objectIds:l.toArray()}):t.length&&o.push({type:"objectId",objectIds:t.toArray()}),o}get activeSortOrders(){return this.grid?.sortOrders?this.grid.sortOrders.map((({path:e,direction:t})=>({fieldName:e,direction:t}))).filter((e=>e.fieldName&&e.direction)):[]}get allRelatedTablesVisible(){return!!(this.relatedRecordsEnabled&&this.relatedTables.length&&this.showAllRelatedTables)}get attachmentsEnabled(){return this.store.attachmentsEnabled}set attachmentsEnabled(e){this.store.attachmentsEnabled=e}get clearPrompt(){return()=>this.prompt=null}set clearPrompt(e){this._overrideIfSome("clearPrompt",e)}get definitionExpression(){return this.store.where}set definitionExpression(e){this.store.where=e}get filterGeometry(){return this.store.filterGeometry}set filterGeometry(e){this.store.filterGeometry=e}get filterBySelectionEnabled(){return!!this._get("filterBySelectionEnabled")}set filterBySelectionEnabled(e){const{objectIds:t}=this,i=t.length;e?(i&&(t.removeAll(),this._logWarning("Selection filter has been applied with an objectID filter. Object ID filter has been removed.")),this.filterGeometry&&this._logWarning("Selection filter has been applied with a geometry filter. Results may appear inconsistent"),this._syncObjectIdsWithStore(this.highlightIds.toArray())):i||this._syncObjectIdsWithStore(null),this._set("filterBySelectionEnabled",e)}get hiddenFields(){return this._get("hiddenFields")??new i}set hiddenFields(e){this._set("hiddenFields",s(e,this._get("hiddenFields"),i))}get initialSize(){return this.store.initialSize}set initialSize(e){this.store.initialSize=e}get isQueryingOrSyncing(){return this.isQuerying||this.isSyncing||this.relatedTables.some((e=>!!e.isQueryingOrSyncing))}get isSyncingAttachments(){return this.store.isSyncingAttachmentEdits||this.relatedTables.some((e=>!!e.isSyncingAttachments))}get layer(){return this._get("layer")}set layer(e){this._highlights.removeAll(),this.drainRelatedTables(),this._set("layer",e)}get layerView(){return this.store.layerView}get outFields(){return this.store.outFields}set outFields(e){this.store.outFields=e}get relatedRecordsEnabled(){return this.store.relatedRecordsEnabled}set relatedRecordsEnabled(e){this.store.relatedRecordsEnabled=e}get relatedTable(){return this.relatedTables.at(-1)}get relationship(){const e=this.relationshipConfig?.relationshipId;return null==e?null:this.relationships?.find((({id:t})=>t===e))}get relationshipConfig(){return this.store.relationshipConfig}set relationshipConfig(e){this.highlightIds.removeAll(),this.objectIds.removeAll(),this.filterBySelectionEnabled=!1,this.store.relationshipConfig=e}get relationshipInfos(){const{layer:e,layers:t,relationships:i,tableController:s}=this,l=this.store.relationshipInfos;if(l.length||!q(e)||!i?.length)return l;const o=[],n=s?.layers||t||[];return i.forEach((t=>{const i=Q(e,n,t);i&&(i.load(),o.push({layer:e,relatedLayer:i,relationshipId:t.id}))})),o}get relationships(){return this.store.relationships}get returnGeometryEnabled(){return this.store.returnGeometry}set returnGeometryEnabled(e){this.store.returnGeometry=e}get returnMEnabled(){return this.store.returnM}set returnMEnabled(e){this.store.returnM=e}get returnZEnabled(){return this.store.returnZ}set returnZEnabled(e){this.store.returnZ=e}get showAllRelatedTables(){return this._get("showAllRelatedTables")}set showAllRelatedTables(e){const{relatedTable:t}=this;this._set("showAllRelatedTables",e),t&&(e?this._showAllRelatedTables(t):this._hideAllRelatedTables(t))}get showPrompt(){return e=>{this.prompt?.cancel?.(),this.prompt=e}}set showPrompt(e){this._overrideIfSome("showPrompt",e)}get supportsAttachments(){return this.store.supportsAttachments}get supportsAddAttachments(){const{store:{supportsAddingAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get supportsDeleteAttachments(){const{store:{supportsDeletingAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get supportsResizeAttachments(){return this.store.supportsResizeAttachments}get supportsUpdateAttachments(){const{store:{supportsUpdateAttachments:e,supportsEditing:t}}=this;return this.editingEnabled&&t&&e}get timeExtent(){return this.store.timeExtent}set timeExtent(e){this.store.timeExtent=e}get timeZone(){return this._get("timeZone")}set timeZone(e){this.allColumns.forEach((t=>t.tableTimeZone=e)),this._set("timeZone",e)}get view(){return this.store.view}set view(e){this.store.view=e,this.fieldColumns.forEach((t=>t.view=e)),this.refreshCellContent()}async addAttachment(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.addAttachment(e,t).catch((e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof o&&(this._logWarning(`Unable to add attachment. ${e.error.name} ${e.error.message}`),i.error=e.error)})),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async deleteAttachments(e,t){const{attachmentsViewOptions:i,store:s}=this,l=i.objectId===e;await s.deleteAttachments(e,t).catch((e=>{l&&e&&"object"==typeof e&&"error"in e&&e.error instanceof o&&(this._logWarning(`Unable to delete attachment(s). ${e.error.name} ${e.error.message}`),i.error=e.error)})),l&&!i.error&&(i.onEditComplete(),i.attachmentInfos=await s.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}collapseRelatedTable(e,t){const{relatedLayer:s,objectId:l,relationshipId:o}=t,{objectIdField:n}=s,r=K(s,o),a=s.displayField||r?.keyField||n;e.set({highlightIds:new i([l]),multipleSelectionEnabled:!1,tableTemplateOverride:this._getTableTemplateForRelatedTableView(e,a,o)});const h=e.hiddenFields;h.includes(J.action)||h.add(J.action),h.includes(J.attachments)||h.add(J.attachments),e.scrollLeft()}async deleteSelection(){const e=this.highlightIds.toArray();if(!e?.length)return;const{deleteFeatureResults:t}=await this.store.deleteRowsByObjectId(e),i=t.filter((e=>!e.error)).map((e=>e.objectId));i.length&&(this.highlightIds.removeMany(i),await this.refresh())}async downloadAttachmentById(e,t){const i=(await this.store.getAttachmentsByObjectId(e,!0)).find((e=>e.id===t));G(i)}drainRelatedTables(){this.relatedTables.drain((e=>e.destroy())),this.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:null,showAllRelatedTables:!1,tableTemplateOverride:null}),this.hiddenFields.removeMany([J.action,J.attachments])}drainRelatedTablesAboveIndex(e){const{relatedTables:t}=this,i=t.slice(e+1);t.removeMany(i).forEach((e=>e.destroy()));const s=t.at(-1);s&&(s.attachmentsViewOptions.objectId=null,this.allRelatedTablesVisible?this._showAllRelatedTables(s):this._hideAllRelatedTables(s))}async exportSelectionToCSV(e){const{highlightIds:t,layer:i,outFields:s}=this;i&&t.length?await k({layer:i,objectIds:t.toArray(),outFields:s,includeGeometry:e}):this._logWarning("Export failed.")}filterBySelection(){this.filterBySelectionEnabled?this._logWarning("Property 'filterBySelectionEnabled' is already 'true'. This method has no effect."):(l(r.getLogger(this),"`FeatureTable.filterBySelection` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.addMany(this.highlightIds.toArray()))}getObjectIdIndex(e){return this.store.getItemIndexByObjectId(e)}getValue(e,t){const i=this.store.getItemByObjectId(e);return i?.feature?.attributes[t]}getVirtualPageIndex(){return this.grid?.getVirtualPageIndex()??0}goToPage(e){if(null==e||!Number.isInteger(e))return void this._logWarning("Invalid 'page' parameter provided to 'goToPage()'. Current page will remain the same.");const{pageCount:t}=this;(e>=t||-1===e)&&(e=t-1),e<-1&&(e=0),e!==this.pageIndex&&(this.pageIndex=e),this.paginationEnabled||this.scrollToIndex(e*this.pageSize)}hideAttachmentsView(){this.attachmentsViewOptions.objectId=null,this.set({relationshipColumnConfigs:null,multipleSelectionEnabled:!0,tableTemplateOverride:null}),this.hiddenFields.remove(J.action)}nextPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e+1)}previousPage(){const e=this.paginationEnabled?this.pageIndex:this.getVirtualPageIndex();this.goToPage(e-1)}async refresh(){return this.relatedTables.forEach((async e=>await e.refresh())),d(this._debounceRefresh())}refreshCellContent(){this.grid?.requestContentUpdate()}refreshPageCache(){this.grid?.refreshPageCache()}async reset(){this.goToPage(0),await(this.grid?.reset())}scrollLeft(){this.grid?.scrollLeft(0)}scrollToBottom(){this.grid?.scrollToBottom()}scrollToIndex(e){this.grid?.scrollToIndex(e)}scrollToRow(e){const t=this.store.getItemIndexByObjectId(e);t>-1?this.grid?.scrollToIndex(t):this._logWarning("Row not found. Associated data may not be loaded yet.")}scrollToTop(){this.grid?.scrollToTop()}async saveAttachmentsViewForm(){const{attachmentId:e,form:t,objectId:i}=this.attachmentsViewOptions;null!=i&&t&&(null!=e?await this.updateAttachment(i,e,t):await this.addAttachment(i,t))}async showAttachmentsView({objectId:e}){const{attachmentsViewOptions:t,hiddenFields:s,layer:l}=this;if(!this.attachmentsEnabled||!l)return void this._logWarning("The 'attachmentsEnabled' property is currently false.");await l.load();const o=this._getDefaultLayerDisplayField(l),n=await this.store.getAttachmentsByObjectId(e,!0),r=this.store.getItemIndexByObjectId(e);t.set({attachmentInfos:n,mode:n.length?"list":"file",objectId:e}),this.set({highlightIds:new i([e]),multipleSelectionEnabled:!1,relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForAttachmentsView(o)}),s.includes(J.action)||s.add(J.action),null!=r&&this.scrollToIndex(r)}syncAttributeTableTemplate(){this._syncAttributeTableTemplate(!0)}clearSelectionFilter(){l(r.getLogger(this),"`FeatureTable.clearSelectionFilter` is deprecated in favor of 'filterBySelectionEnabled' and 'objectIds'",{replacement:"FeatureTable.filterBySelectionEnabled or FeatureTable.objectIds",version:"4.30",warnOnce:!0}),this.objectIds.removeAll()}async updateAttachment(e,t,i){const{attachmentsViewOptions:s,store:l}=this,n=s.objectId===e;await l.updateAttachment(e,t,i).catch((e=>{n&&e&&"object"==typeof e&&"error"in e&&e.error instanceof o&&(this._logWarning(`Unable to update attachment. ${e.error.name} ${e.error.message}`),s.error=e.error)})),n&&!s.error&&(s.onEditComplete(),s.attachmentInfos=await l.getAttachmentsByObjectId(e,!0)),this.refreshCellContent()}async zoomToSelection(){const{layer:e,view:t}=this,i=this.highlightIds.toArray();if(!e||!t||!i.length)return;const s=e.createQuery();s.objectIds=i,s.returnGeometry=!0;const l=await e.queryFeatures(s);try{await le(t,l.features)}catch(o){"AbortError"!==o.name&&console.error(o)}}_syncAttributeTableTemplate(e=!1){const{_effectiveAttributeTableTemplate:t,layer:i,tableTemplateOverride:s,syncTemplateOnChangesEnabled:l}=this;if(!i||!t||!l&&!e||s||this.tableParent||this.relatedTable||null!==this.attachmentsViewOptions.objectId)return;const{activeSortOrders:o,allColumns:n,columns:r}=this,a=[],h=se(r.toArray());o.forEach((({fieldName:e,direction:t})=>{e&&t&&a.push(new E({field:e,order:t}))})),n.forEach((({fieldName:e,direction:t})=>{t&&!a.some((t=>t.field===e))&&a.push(new E({field:e,order:t}))})),t.elements=h,t.orderByFields=a}async _refresh(){await this.store.refresh();const e=this.highlightIds.toArray();if(e.length){(await this.store.verifyFeaturesByObjectId(e)).forEach(((t,i)=>{t||this.highlightIds.remove(e[i])}))}this.refreshPageCache();const t=this.attachmentsViewOptions;null!=t?.objectId&&(t.attachmentInfos=await this.store.getAttachmentsByObjectId(t.objectId,!0))}async _onLayerLoad(){const{layer:e,pageSize:t}=this;if(!e)return;e.parent&&C(e.parent)&&await e.parent.loadAll();const i=e.capabilities.query?.maxRecordCount,s=i&&i<t,l=s?i:t;s&&(this._logWarning("The value for 'pageSize' has been adjusted due to the provided layer's max record count."),this.pageSize=l),this.grid?.set("pageSize",l),this.store.load(),this._generateColumns()}_onLayerRefresh(e){this.autoRefreshEnabled&&e.dataChanged&&this.refresh()}_generateColumns(){this._drainColumns();const{_effectiveTableTemplate:e,_effectiveAttributeTableTemplate:t}=this,i=e?.columnTemplates,s=this._generateColumnsFromColumnTemplates(i)??this._generateColumnsFromAttributeTableTemplate(t)??this._generateDefaultFieldColumns();s.length&&(this.attachmentsEnabled&&!s.some((e=>B(e)))&&s.push(this._generateDefaultAttachmentsColumn()),this.relatedRecordsEnabled&&this.relationshipInfos.length&&!s.some((e=>Z(e)))&&s.push(...this._generateDefaultRelationshipColumns()),this.actionColumnConfig&&s.push(this._generateActionColumn()),s.sort(((e,t)=>e.frozen&&t.frozen||e.frozenToEnd&&t.frozenToEnd?0:e.frozen||t.frozenToEnd?-1:0)),this.columns.addMany(s))}_generateColumnsFromAttributeTableTemplate(e){const{layer:i}=this;if(!e||!i)return null;const{elements:s,orderByFields:l}=e,o=I(i),n=[];n.push(...this._generateColumnsFromAttributeTableElements(s,l));const r=o.map((e=>{if(!e.fieldName||X(e.fieldName,n))return null;const{fieldName:t}=e,s=Y(i,t);return s?this._generateDefaultFieldColumn(s,{hidden:!0,orderByFields:l}):(this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null)})).filter(t);return n.push(...r),this.attachmentsEnabled&&ee(i)&&!n.some((e=>B(e)))&&n.push(this._generateDefaultAttachmentsColumn({hidden:!0})),this.relatedRecordsEnabled&&q(i)&&i.relationships?.forEach((({id:e},t)=>{const i=this.relationshipInfos.find((t=>t.relationshipId===e));i&&!n.some((t=>Z(t)&&t.relationshipId===e))&&n.push(this._generateDefaultRelationshipColumn({hidden:!0,info:i,index:t}))})),n.length?n:null}_generateColumnsFromAttributeTableElements(e,t){const{layer:i}=this;return i?e?.map(((e,i)=>{switch(e.type){case"field":return this._createFieldColumnFromElement({element:e,orderByFields:t});case"group":return this._createGroupColumnFromElement({element:e,orderByFields:t});case"attachment":return this._createAttachmentColumnFromElement({element:e,index:i});case"relationship":return this._createRelationshipColumnFromElement({element:e,index:i})}})).filter((e=>!!e))??[]:[]}_createFieldColumnFromElement(e){const{layer:t}=this;if(!t)return null;const{element:i,orderByFields:s}=e,{fieldName:l}=i;if(null==l)return this._logTemplateWarning("A valid 'fieldName' must be provided."),null;const o=Y(t,l);if(!o)return this._logTemplateWarning("A valid 'field' could not be found for the provided template."),null;const{description:n,label:r}=i,a=s?.findIndex((({field:e})=>e&&e===l))??-1,h=a>-1?s?.at(a)?.order:void 0,d=a>-1?a:void 0,{editingEnabled:m,grid:c,messages:p,messagesCommon:g,messagesURIUtils:u,store:b,timeZone:f,view:y}=this;return new U({description:n,direction:h,field:o,fieldName:l,grid:c,initialSortPriority:d,label:r,layer:t,messages:p,messagesCommon:g,messagesURIUtils:u,store:b,tableEditingEnabled:m,tableTimeZone:f,view:y,onShowPromptCallback:this._onShowPromptCallback})}_createGroupColumnFromElement(e){const{element:t,orderByFields:i}=e,{description:s,label:l}=t;if(!l)return this._logTemplateWarning("Group columns require a label."),null;if(!t.elements.length)return this._logTemplateWarning("Group columns require child columns."),null;const{grid:o,messages:n,messagesCommon:r,messagesURIUtils:a,store:h,timeZone:d}=this;return new P({columns:this._generateColumnsFromAttributeTableElements(t.elements,i),description:s,grid:o,label:l,messages:n,messagesCommon:r,messagesURIUtils:a,store:h,tableTimeZone:d})}_createAttachmentColumnFromElement(e){if(!this.attachmentsEnabled)return void this._logTemplateWarning("The 'attachmentsEnabled' property is currently false.");const{element:t,index:i}=e,{description:s,label:l}=t,{grid:o,layer:n,messages:r,messagesCommon:a,messagesURIUtils:h,store:d,timeZone:m}=this;return new x({description:s,fieldName:`${J.attachments}-${i}`,grid:o,label:l,layer:n,messages:r,messagesCommon:a,messagesURIUtils:h,store:d,tableTimeZone:m,onShowAttachments:e=>this._onShowAttachments(e)})}_createRelationshipColumnFromElement(e){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{element:t,index:i}=e,{description:s,label:l,relationshipId:o}=t,n=this.relationshipInfos.find((e=>e.relationshipId===o));if(!n)return this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id."),null;const{grid:r,messages:a,messagesCommon:h,messagesURIUtils:d,store:m,timeZone:c}=this;return new O({description:s,fieldName:`${J.relationship}-${o}-${i}`,grid:r,label:l,messages:a,messagesCommon:h,messagesURIUtils:d,relationshipId:o,store:m,tableTimeZone:c,layer:n.relatedLayer,relatedLayer:n.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateColumnsFromColumnTemplates(e){const{editingEnabled:t,grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:n,store:r,timeZone:a,view:h}=this;if(!e?.length||!s)return null;const d=[];return e.forEach(((e,m)=>{const{autoWidth:c,description:p,direction:g,flexGrow:u,fieldName:b,formatFunction:f,frozen:y,frozenToEnd:T,icon:w,iconText:_,initialSortPriority:C,invalid:I,label:v,labelTooltipText:E,menuConfig:A,resizable:F,sortable:j,textAlign:S,textWrap:R,timeZone:x,type:O,width:W}=e;if(!O)return void this._logTemplateWarning("Property 'type' is missing from the provided template.");if(y&&T)return void this._logTemplateWarning("Properties 'frozen' and 'frozenToEnd' cannot both be true for the same column.");const z=!1===e.visible;if("group"===O){if(!e.columnTemplates?.length)return void this._logTemplateWarning("Group columns must contain column templates.");if(!e.label)return void this._logTemplateWarning("Group columns require a label.");const t=this._generateColumnsFromColumnTemplates(e.columnTemplates),s=z||this._isFieldHidden(e.label);d.push(new P({autoWidth:c,columns:t,description:p,flexGrow:u,frozen:y,frozenToEnd:T,grid:i,hidden:s,icon:w,iconText:_,invalid:I,label:v,labelTooltipText:E,menuConfig:A,messages:l,messagesCommon:o,messagesURIUtils:n,resizable:F,tableTimeZone:a,textAlign:S,textWrap:R,timeZone:x,width:W}))}else if("attachment"===O){if(!this.attachmentsEnabled)return void this._logTemplateWarning("Attachment columns require attachments to be enabled on the table.");d.push(this._generateAttachmentsColumnFromTemplate(e,m))}else if("relationship"===O){if(!this.relatedRecordsEnabled)return void this._logTemplateWarning("Relationship columns require related records to be enabled on the table.");const{relationshipId:t}=e;if(null==t)return void this._logTemplateWarning("Property 'relationshipId' is missing from the provided template.");const i=this.relationshipInfos.find((e=>e.relationshipId===t));if(!i)return void this._logTemplateWarning("Unable to find valid related layer target based on the provided relationship id.");d.push(this._generateRelationshipColumnFromTemplate(i,e,m))}else if(!b)return void this._logTemplateWarning("Value for 'fieldName' property was missing from the provided template.");const L=z||this._isFieldHidden(b);if("column"===O)d.push(new V({autoWidth:c,description:p,direction:g,fieldName:b,flexGrow:u,formatFunction:f,frozen:y,frozenToEnd:T,grid:i,hidden:L,icon:w,iconText:_,initialSortPriority:C,invalid:I,label:v,labelTooltipText:E,menuConfig:A,messages:l,messagesCommon:o,messagesURIUtils:n,resizable:F,sortable:j,tableTimeZone:a,textAlign:S,textWrap:R,timeZone:x,width:W}));else if("field"===O){const m=Y(s,e.fieldName);if(!m)return void this._logTemplateWarning("A valid 'field' could not be found for the provided template.");const{editable:b,required:O}=e;d.push(new U({autoWidth:c,description:p,direction:g,editable:b,field:m,fieldName:m.name,flexGrow:u,formatFunction:f,frozen:y,frozenToEnd:T,grid:i,hidden:L,icon:w,iconText:_,initialSortPriority:C,invalid:I,label:v,labelTooltipText:E,layer:s,messages:l,messagesCommon:o,messagesURIUtils:n,menuConfig:A,required:O,resizable:F,sortable:j,store:r,tableEditingEnabled:t,tableTimeZone:a,template:e,textAlign:S,textWrap:R,timeZone:x,width:W,view:h,onShowPromptCallback:this._onShowPromptCallback}))}})),d.length?d:null}_generateDefaultFieldColumns(){return this.layer?.fields?.map((e=>this._generateDefaultFieldColumn(e))).filter(t)??[]}_generateDefaultFieldColumn(e,t){const{editingEnabled:i,grid:s,layer:l,messages:o,messagesCommon:n,messagesURIUtils:r,store:a,timeZone:h,view:d}=this,m=t?.orderByFields;if(!e.visible||"geometry"===e.type)return null;const c=e.name,p=m?.findIndex((({field:e})=>e&&e===c))??-1,g=p>-1?m?.at(p)?.order:void 0,u=p>-1?p:void 0;return new U({direction:g,field:e,fieldName:c,grid:s,hidden:t?.hidden||this._isFieldHidden(c),initialSortPriority:u,layer:l,messages:o,messagesCommon:n,messagesURIUtils:r,store:a,tableEditingEnabled:i,tableTimeZone:h,view:d,onShowPromptCallback:this._onShowPromptCallback})}_generateAttachmentsColumnFromTemplate(e,t){const{grid:i,layer:s,messages:l,messagesCommon:o,messagesURIUtils:n,store:r,timeZone:a}=this,{attachmentsViewEnabled:h,autoWidth:d,description:m,flexGrow:c,fieldName:p,formatFunction:g,frozen:u,frozenToEnd:b,icon:f,iconText:y,invalid:T,label:w,labelTooltipText:_,menuConfig:C,resizable:I,textAlign:v,textWrap:E,thumbnailAppearance:A,thumbnailCount:F,thumbnailIconScale:j,thumbnailsEnabled:S,timeZone:R,width:U}=e;return new x({attachmentsViewEnabled:h,autoWidth:d,description:m,fieldName:`${J.attachments}-${t}`,flexGrow:c,formatFunction:g,frozen:u,frozenToEnd:b,grid:i,hidden:!1===e.visible||this._isFieldHidden(w)||this._isFieldHidden(p),icon:f,iconText:y,invalid:T,label:w,labelTooltipText:_,layer:s,menuConfig:C,messages:l,messagesCommon:o,messagesURIUtils:n,resizable:I,store:r,tableTimeZone:a,textAlign:v,textWrap:E,thumbnailAppearance:A,thumbnailCount:F,thumbnailIconScale:j,thumbnailsEnabled:S,timeZone:R,width:U,onShowAttachments:e=>this._onShowAttachments(e)})}_generateDefaultAttachmentsColumn(e){const{grid:t,layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:n,timeZone:r}=this,a=J.attachments;return new x({fieldName:a,grid:t,hidden:e?.hidden||this._isFieldHidden(a),layer:i,messages:s,messagesCommon:l,messagesURIUtils:o,store:n,tableTimeZone:r,onShowAttachments:e=>this._onShowAttachments(e)})}_generateRelationshipColumnFromTemplate(e,t,i){const{grid:s,messages:l,messagesCommon:o,messagesURIUtils:n,store:r,timeZone:a}=this,{autoWidth:h,collapsed:d,description:m,flexGrow:c,fieldName:p,formatFunction:g,frozen:u,frozenToEnd:b,icon:f,iconText:y,invalid:T,label:w,labelTooltipText:_,menuConfig:C,relationshipId:I,resizable:v,textAlign:E,textWrap:A,timeZone:F,width:j}=t;return new O({autoWidth:h,collapsed:d,description:m,fieldName:`${J.relationship}-${I}-${i}`,flexGrow:c,formatFunction:g,frozen:u,frozenToEnd:b,grid:s,hidden:!1===t.visible||this._isFieldHidden(w)||this._isFieldHidden(p),icon:f,iconText:y,invalid:T,label:w,labelTooltipText:_,menuConfig:C,messages:l,messagesCommon:o,messagesURIUtils:n,relationshipId:I,resizable:v,store:r,tableTimeZone:a,textAlign:E,textWrap:A,timeZone:F,width:j,layer:e.relatedLayer,relatedLayer:e.layer,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateDefaultRelationshipColumns(){const{relationshipInfos:e,relationshipColumnConfigs:t}=this,i=[];return e?.length?(t?t.forEach(((t,s)=>{const{relationshipId:l}=t,o=e.find((e=>e.relationshipId===l));o&&i.push(this._generateDefaultRelationshipColumn({config:t,index:s,info:o}))})):e.forEach(((e,t)=>i.push(this._generateDefaultRelationshipColumn({index:t,info:e})))),i):i}_generateDefaultRelationshipColumn(e){const{config:t,hidden:i,index:s,info:l}=e,{grid:o,messages:n,messagesCommon:r,messagesURIUtils:a}=this,{relationshipId:h}=l;return new O({...t,fieldName:`${J.relationship}-${h}-${s}`,grid:o,hidden:i,messages:n,messagesCommon:r,messagesURIUtils:a,layer:l.relatedLayer,relatedLayer:l.layer,relationshipId:h,showRelatedTableCallback:e=>this._onShowRelatedTable(e)})}_generateActionColumn(){return new R({hidden:this._isFieldHidden(J.action),...this.actionColumnConfig})}_isFieldHidden(e){const t=e?.toLowerCase();return(this.hiddenFields??this._defaultHiddenFields).some((e=>e.toLowerCase()===t))}_addTableHighlight(e){if(!this.highlightEnabled)return;const{_highlightableLayerView:t,layer:i}=this;if(t&&i){const s=this.store.getItemByObjectId(e),l=s?.feature??e;this._highlights.add(t.highlight(l,{name:A}),te(i,e))}}_removeTableHighlight(e){const{layer:t}=this;t&&this._highlights.remove(te(t,e))}async _syncTemporaryHighlight(e,t){if(!this.highlightEnabled)return this._currentTemporaryHighlight?.handle.remove(),void(this._currentTemporaryHighlight=null);if(await m(25),c(t),!this._currentTemporaryHighlight&&!e)return;const{id:i}=this._currentTemporaryHighlight??{};if(i===e)return;this._currentTemporaryHighlight?.handle?.remove(),this._currentTemporaryHighlight=null;const{_highlightableLayerView:s,layer:l,highlightEnabled:o}=this;e&&s&&l&&o&&(this._currentTemporaryHighlight={id:e,handle:s.highlight(e,{name:F})})}_syncSelection(){this._highlights.removeAll(),this._tableHighlightsReady?this.highlightIds.forEach((e=>this._addTableHighlight(e))):this._viewSelectionReady&&(this.highlightIds.items=this._viewSelection)}_appendToViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.appendToSelection(t,e)}_removeFromViewSelection(e){const{_selectableLayer:t}=this;t&&this._selectionManager?.removeFromSelection(t,e)}async _onHighlightIdsChange(e){const{added:t,removed:i}=e,{attachmentsViewOptions:s}=this;if(this._tableHighlightsReady?(i.forEach((e=>this._removeTableHighlight(e))),t.forEach((e=>this._addTableHighlight(e)))):this._viewSelectionReady&&(this._removeFromViewSelection(i),this._appendToViewSelection(t)),this.filterBySelectionEnabled&&this._syncObjectIdsWithStore(this.highlightIds.toArray()),null!=s.objectId){const e=this.highlightIds.at(0);if(null!=e){const t=await this.store.getAttachmentsByObjectId(e,!0);s.set({attachmentInfos:t,objectId:e,mode:t.length?"list":"file"})}}}_onShowRelatedTable(e){const{highlightIds:t}=this,{objectId:i}=e;t.removeAll(),t.add(i),this.showRelatedTableCallback?this.showRelatedTableCallback(e):this.emit("show-related-table",e)}_onObjectIdsChange(){const e=this.objectIds.toArray();e.length&&this.filterBySelectionEnabled&&(this.filterBySelectionEnabled=!1,this._logWarning("Object ID filter was applied while a selection filter was applied. Selection filter has been removed.")),this._syncObjectIdsWithStore(e)}_syncObjectIdsWithStore(e){this.store.objectIds=e,this.refreshPageCache()}_drainColumns(){this.columns.drain((e=>!e.destroyed&&e.destroy()))}_showAllRelatedTables(e){const t=e.layer;if(!t)return;const i=this._getDefaultLayerDisplayField(t);e.set({relationshipColumnConfigs:[],tableTemplateOverride:this._getTableTemplateForShowAllTablesView(e,i)});const s=e.hiddenFields;s.includes(J.action)||s.add(J.action),s.includes(J.attachments)||s.add(J.attachments)}_hideAllRelatedTables(e){const{layer:t,relationship:i}=e;if(t&&null!=i?.id)if(null!=e.attachmentsViewOptions.objectId){const i=this._getDefaultLayerDisplayField(t);e.set({multipleSelectionEnabled:!1,relationshipColumnConfigs:[],showAllRelatedTables:!1,tableTemplateOverride:this._getTableTemplateForAttachmentsView(i)})}else e.set({multipleSelectionEnabled:!0,relationshipColumnConfigs:ie(t,i.id),showAllRelatedTables:!1,tableTemplateOverride:null}),e.hiddenFields.removeMany([J.action,J.attachments])}_getTableTemplateForRelatedTableView(e,t,i){return new $({columnTemplates:[new D({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map((([s,l])=>({selected:s===t,label:l||s,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForRelatedTableView(e,s,i)}})))},resizable:!1}),new M({autoWidth:!1,collapsed:!0,flexGrow:0,label:"",resizable:!1,relationshipId:i,width:he})]})}_getTableTemplateForShowAllTablesView(e,t){const i=[new D({fieldName:t,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(e.viewModel).map((([i,s])=>({selected:i===t,label:s||i,clickFunction:()=>{e.tableTemplateOverride=this._getTableTemplateForShowAllTablesView(e,i)}})))},resizable:!1})];return null!=e.attachmentsViewOptions.objectId&&i.push(new L({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:he})),new $({columnTemplates:i})}async _onShowPromptCallback(e){const{column:t,objectId:i,oldValue:s,value:l}=e,{_subtypes:o,layer:n}=this;if(!n||!o.length)return void t.cancel();const r=o.find((e=>e.code===l));if(!r)return void t.cancel();const a=p(),h=this._createSubtypeEditPrompt(s,r,a),d=!!n.parent;try{this.showPrompt(h);const e=await a.promise,s=[{fieldName:t.fieldName,value:l}];switch(e){case"update-fields":for(const[e,t]of Object.entries(r.defaultValues))null!=t&&s.push({fieldName:e,value:t});await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"keep-existing":await t.updateItems({objectId:i,updates:s}),d&&this.refresh();break;case"undo":t.cancel()}}finally{this.clearPrompt()}}_createSubtypeEditPrompt(e,t,i){const{_subtypes:s,messages:l,messagesCommon:o}=this,n=s.find((t=>t.code===e))?.name??`${e}`;let r="update-fields";const a=[{label:l.subtypes.useDefaultValuesOption,value:"update-fields"},{label:l.subtypes.keepCurrentValuesOption,value:"keep-existing"}];return{context:"info",title:l.subtypes.changeWarningTitle,message:re(l.subtypes.changeWarning,{originalType:n,newType:t.name}),radios:a,defaultRadioSelection:"update-fields",onRadioSelection:e=>{r=e},actions:{primary:{label:o.apply,action:()=>i.resolve(r),type:"positive"},secondary:{label:o.cancel,type:"neutral",action:()=>i.resolve("undo")}},cancel:()=>i.reject()}}_onShowAttachments({objectId:e}){this.attachmentsViewOptions.objectId=e}_getTableTemplateForAttachmentsView(e){return new $({columnTemplates:[new D({fieldName:e,editable:!1,menuConfig:{selectionMode:"single",icon:"chevron-down",items:this._extractFieldColumnInfosFromTableTemplate(this).map((([t,i])=>({selected:t===e,label:i||t,clickFunction:()=>{this.tableTemplateOverride=this._getTableTemplateForAttachmentsView(t)}})))},resizable:!1}),new L({attachmentsViewEnabled:!1,autoWidth:!1,flexGrow:0,label:"",resizable:!1,thumbnailsEnabled:!1,width:he})]})}_extractFieldColumnInfosFromTableTemplate(e){const t=e??this,{layer:i,tableTemplate:s}=t;return s?s.columnTemplates.filter((({type:e})=>"field"===e||"column"===e)).map((({fieldName:e,label:t})=>[e,t])):i?.fields.map((e=>[e.name,e.alias]))??[]}_getDefaultLayerDisplayField(e){const{displayField:t,objectIdField:i}=e;return t&&""!==t.trim()?t:i||(e.fields.length?e.fields[0].name:"")}_getIndexOfFirstFrozenToEndColumn(){const e=this.columns.findIndex((e=>e.frozenToEnd));return e>-1?e:void 0}_logWarning(e,t){t?r.getLogger(this).warnOnce(e):r.getLogger(this).warn(e)}_logTemplateWarning(e){this._logWarning(`${e} Skipped generating a column using the provided template.`,!0)}_onCellInteraction(e){null!=e&&null!=this.attachmentsViewOptions.objectId&&this.highlightIds.add(e)}};e([f()],de.prototype,"_defaultHiddenFields",null),e([f()],de.prototype,"_effectiveTableTemplate",null),e([f()],de.prototype,"_effectiveAttributeTableTemplate",null),e([f()],de.prototype,"_highlights",void 0),e([f()],de.prototype,"_highlightableLayerView",null),e([f()],de.prototype,"_selectionManager",null),e([f()],de.prototype,"_selectableLayer",null),e([f()],de.prototype,"_subtypes",null),e([f()],de.prototype,"_tableHighlightsReady",null),e([f()],de.prototype,"_viewSelection",null),e([f()],de.prototype,"_viewSelectionReady",null),e([f()],de.prototype,"activeFilters",null),e([f({readOnly:!0})],de.prototype,"activeSortOrders",null),e([f()],de.prototype,"allRelatedTablesVisible",null),e([f()],de.prototype,"attachmentsEnabled",null),e([f()],de.prototype,"attachmentsViewOptions",void 0),e([f({type:v})],de.prototype,"attributeTableTemplate",void 0),e([f()],de.prototype,"autoRefreshEnabled",void 0),e([f()],de.prototype,"clearPrompt",null),e([f({readOnly:!0})],de.prototype,"columns",void 0),e([f()],de.prototype,"dataProvider",void 0),e([f()],de.prototype,"definitionExpression",null),e([f()],de.prototype,"filterGeometry",null),e([f()],de.prototype,"filterBySelectionEnabled",null),e([f({readOnly:!0})],de.prototype,"grid",void 0),e([f()],de.prototype,"hiddenFields",null),e([f()],de.prototype,"highlightEnabled",void 0),e([f()],de.prototype,"initialSize",null),e([f()],de.prototype,"isQueryingOrSyncing",null),e([f()],de.prototype,"isSyncingAttachments",null),e([f()],de.prototype,"layer",null),e([f()],de.prototype,"layers",void 0),e([f()],de.prototype,"layerView",null),e([f()],de.prototype,"messages",void 0),e([f(),oe("esri/t9n/common")],de.prototype,"messagesCommon",void 0),e([f(),oe("esri/core/t9n/Units")],de.prototype,"messagesUnits",void 0),e([f(),oe("esri/widgets/support/t9n/uriUtils")],de.prototype,"messagesURIUtils",void 0),e([f()],de.prototype,"outFields",null),e([f()],de.prototype,"prompt",void 0),e([f()],de.prototype,"relatedRecordsEnabled",null),e([f()],de.prototype,"relatedTable",null),e([f()],de.prototype,"relatedTables",void 0),e([f()],de.prototype,"relationship",null),e([f()],de.prototype,"relationshipColumnConfigs",void 0),e([f()],de.prototype,"relationshipConfig",null),e([f()],de.prototype,"relationshipInfos",null),e([f()],de.prototype,"relationships",null),e([f()],de.prototype,"returnGeometryEnabled",null),e([f()],de.prototype,"returnMEnabled",null),e([f()],de.prototype,"returnZEnabled",null),e([f()],de.prototype,"selectionSource",void 0),e([f()],de.prototype,"showAllRelatedTables",null),e([f()],de.prototype,"showPrompt",null),e([f()],de.prototype,"showRelatedTableCallback",void 0),e([f({readOnly:!0,type:N})],de.prototype,"store",void 0),e([f()],de.prototype,"supportsAttachments",null),e([f()],de.prototype,"supportsAddAttachments",null),e([f()],de.prototype,"supportsDeleteAttachments",null),e([f()],de.prototype,"supportsResizeAttachments",null),e([f()],de.prototype,"supportsUpdateAttachments",null),e([f()],de.prototype,"syncTemplateOnChangesEnabled",void 0),e([f()],de.prototype,"tableController",void 0),e([f()],de.prototype,"tableParent",void 0),e([f({type:$})],de.prototype,"tableTemplate",void 0),e([f()],de.prototype,"tableTemplateOverride",void 0),e([f()],de.prototype,"timeExtent",null),e([f()],de.prototype,"timeZone",null),e([f()],de.prototype,"view",null),de=e([y("esri.widgets.FeatureTable.FeatureTableViewModel")],de);const me=de;export{me as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{watch as i,when as n,initial as o}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{css as l}from"./ColumnCSS.js";import{isEmptyStringOrWhitespace as a}from"../support/tableUtils.js";import{autoLink as c}from"../../support/uriUtils.js";import{renderingSanitizer as d,setFocus as p}from"../../support/widgetUtils.js";let u=class extends t{constructor(e){super(e),this._menuIsOpen=!1,this.autoWidth=!1,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this,o=d.sanitize(i);if(n&&t){const{index:i,item:{attachments:s,feature:r,relatedRecords:l}}=t;return n({attachments:s,column:this,feature:r,index:i,relatedRecords:l,value:o,virtualIndex:this.getVirtualRowIndex(e)})}return o},this.description=null,this.direction=null,this.fieldName=null,this.flexGrow=1,this.footerRenderFunction=null,this.formatFunction=null,this.frozen=!1,this.frozenToEnd=!1,this.grid=null,this.headerRenderFunction=e=>{const{root:t}=e,i=this.createHeaderContent();this.removeCellContent(t),t.appendChild(i)},this.hidden=!1,this.icon=null,this.iconText=null,this.initialSortPriority=null,this.label=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.messagesURIUtils=null,this.renderFunction=({root:e,rowData:t})=>{const i=this.getCellValue(t),n=this.cellValueFormatFunction({root:e,rowData:t,value:i});let o=null;if(o=n instanceof HTMLElement?n:c(this.messagesURIUtils,n),this.removeCellContent(e),o instanceof HTMLElement)e.removeAttribute("title"),e.appendChild(o);else if(null!=o){const t=o.toString();e.innerHTML=t,e.title=t}},this.resizable=!0,this.sortable=!1,this.store=null,this.tableTimeZone=null,this.textAlign="start",this.textWrap=!1,this.timeZone=null,this.visibleElements=null,this.width=200}initialize(){const{fieldName:e}=this;this._set("sortElement",this.createSortElement()),this.sortElement.setAttribute("path",e),this.addHandles([i((()=>this.direction),(e=>{const{sortElement:t}=this;this.sortable&&t&&(e?this.sortElement.direction!==e&&t.setAttribute("direction",e):t.removeAttribute("direction"))})),n((()=>this.grid?.isReady&&this.sortElement),(()=>{const{direction:e,grid:t,hidden:i,sortElement:n}=this;i&&e&&n&&t&&!t.hasSorter(n)&&t.addSorter(n)}),o),i((()=>[this.timeZone,this.icon,this.iconText]),(()=>this.grid?.requestContentUpdate())),i((()=>this.hidden),(()=>this.closeMenu())),i((()=>this.fieldName),(e=>{const{sortElement:t}=this;t&&t.path!==e&&t.setAttribute("path",e)})),i((()=>this.effectiveLabel),(e=>{const{sortElement:t}=this;t&&t.textContent!==e&&(t.setAttribute("title",e),t.textContent=e)}))])}get _headerRequiresTextContainer(){return!(!this.sortable&&""===this.effectiveLabel&&null==this.effectiveDescription)}get customMenuItems(){return this.menuConfig?.items?.map((({disabled:e,hidden:t,icon:i,iconClass:n,label:o,selected:s,clickFunction:r})=>this.createCalciteDropdownItem({disabled:e,hidden:t,iconClass:n,iconStart:i,selected:s,textContent:o,onclick:e=>r(e)})))??[]}get defaultMenuItems(){if(!this.sortable)return[];const e=this.messages,t=[],i=this.visibleElements?.columnMenuItems;if(!1!==i?.sortAscending){const i=this.createCalciteDropdownItem({iconStart:"sort-ascending-arrow",textContent:e?.sortAsc,onclick:()=>this.direction="asc"});t.push(i)}if(!1!==i?.sortDescending){const i=this.createCalciteDropdownItem({iconStart:"sort-descending-arrow",textContent:e?.sortDesc,onclick:()=>this.direction="desc"});t.push(i)}return t}get effectiveDescription(){const{description:e}=this;return a(e)?null:d.sanitize(e)}get effectiveLabel(){return d.sanitize(this.label||this.fieldName)}get iconNode(){const{icon:e,iconText:t}=this,i=t?d.sanitize(t):void 0;return e?this.createCalciteIcon({icon:e,textLabel:i}):null}set invalid(e){this._set("invalid",e),this.grid?.generateCellPartNames()}get invalid(){return this._get("invalid")??!1}get menu(){const{customMenuItems:e,defaultMenuItems:t,menuConfig:i}=this,n=!!i?.open,o=this.createCalciteAction({icon:i?.icon??"ellipsis",text:this.messages?.menu??"",slot:"trigger"}),s=document.createElement("calcite-dropdown");if(s.maxItems=i?.maxItems??4,s.placement="top-end",s.overlayPositioning="fixed",s.scale=i?.scale??"m",n&&(s.open=n,this._menuIsOpen=!0),s.appendChild(o),s.addEventListener("calciteDropdownOpen",(()=>this._menuIsOpen=!0)),s.addEventListener("calciteDropdownClose",(()=>this._menuIsOpen=!1)),s.onkeydown=this._stopPropagationOnSelect,s.addEventListener("mousewheel",(e=>{e.stopPropagation()})),t.length){const e=s.appendChild(document.createElement("calcite-dropdown-group"));e.selectionMode="none",e.append(...t)}if(e.length){const t=s.appendChild(document.createElement("calcite-dropdown-group"));t.selectionMode=i?.selectionMode??"none",t.append(...e)}return s}get menuItems(){return[...this.defaultMenuItems,...this.customMenuItems]}get menuIsOpen(){return this._menuIsOpen}get menuIsVisible(){return!(!1===this.visibleElements?.columnMenus||!this.menuItems.length)}closeMenu(){this.menu.open=!1}createSortElement(){const{effectiveLabel:e,direction:t,fieldName:i,initialSortPriority:n}=this,o=document.createElement("vaadin-grid-sorter");return o.classList.add(l.sorter),o.setAttribute("path",i),o.setAttribute("title",e),o.textContent=e,t&&o.setAttribute("direction",t),null!=n&&(o._initialOrder=n),o.addEventListener("direction-changed",(()=>{this.direction!==o.direction&&this._set("direction",o.direction)})),o}createCalciteAction(e){const t=document.createElement("calcite-action"),{alignment:i,appearance:n,className:o,disabled:s,icon:r,label:l,scale:a,slot:c,text:d,textEnabled:p,onclick:u}=e;return t.alignment=i??"center",t.appearance=n??"transparent",t.className=o??"",t.disabled=!!s,t.icon=r??"",t.label=l??"",t.scale=a??"s",t.slot=c??"",t.text=t.title=d??"",t.textEnabled=!!p,t.onclick=u??null,t}createCalciteButton(e){const t=document.createElement("calcite-button"),{alignment:i,appearance:n,className:o,disabled:s,iconEnd:r,iconFlipRtl:l,kind:a,loading:c,onclick:d,scale:p,textContent:u,title:m,width:h}=e;return t.alignment=i??"center",t.className=o??"",t.scale=p??"s",t.appearance=n??"transparent",t.disabled=!!s,t.iconEnd=r??"",l&&(t.iconFlipRtl=l),t.kind=a??"brand",t.loading=!!c,t.textContent=u??"",m&&(t.title=m),t.width=h??"auto",t.onclick=d??null,t}createCalciteDropdownItem(e){const t=document.createElement("calcite-dropdown-item"),{disabled:i,hidden:n,iconClass:o,iconStart:s,textContent:r,onclick:a,selected:c}=e,d=r??"";if(o&&!s){const e=document.createElement("span"),i=document.createElement("span");i.classList.add(l.headerMenuIcon,o),e.textContent=e.title=d,e.insertBefore(i,e.firstChild),t.appendChild(e)}else t.iconStart=s??"",t.textContent=t.title=d;return t.disabled=!!i,t.hidden="function"==typeof n?n():!!n,t.selected=!!c,a&&(t.addEventListener("calciteDropdownItemSelect",a),t.onkeydown=this._stopPropagationOnSelect),t}createCalciteIcon(e){const{effectiveLabel:t}=this,{icon:i,scale:n,textLabel:o}=e,s=document.createElement("calcite-icon"),r=o??t;return s.icon=i,s.scale=n??"s",s.textLabel=r,s.title=r,s}createHeaderContent(){const{effectiveDescription:e,effectiveLabel:t,iconNode:i}=this,n=document.createElement("div");if(n.classList.add(l.headerContent),i&&n.appendChild(i),!this._headerRequiresTextContainer)return n;const o=n.appendChild(document.createElement("div"));return this.sortable?o.appendChild(this.sortElement):""!==t&&o.appendChild(this._createHeaderTextElement(t,l.headerLabel)),null!=e&&!1!==this.visibleElements?.columnDescriptions&&o.appendChild(this._createHeaderTextElement(e,l.headerDescription)),this.menuIsVisible&&n.appendChild(this.menu),n}getCellValue(e){return e?.item.feature.attributes?.[this.fieldName]}getVirtualRowIndex(e){const t=this.grid?.getRowContainingNode(e);return t?.parentElement?[...t.parentElement.children].indexOf(t):-1}removeCellContent(e){if(e&&e.firstChild)try{for(;e?.firstChild;)e?.removeChild(e.firstChild)}catch(t){}}openMenu(){this.menuIsVisible&&(this.menu.open=!0,p(this.menuItems[0]))}sort(){this.sortable&&this.sortElement?.click()}_stopPropagationOnSelect(e){"Enter"!==e.key&&" "!==e.key||e.stopPropagation()}_createHeaderTextElement(e,t){const i=document.createElement("span"),n=e??"";i.classList.add(t);const o=i.appendChild(document.createElement("span"));return o.textContent=n,o.setAttribute("title",n),i}};e([s()],u.prototype,"_headerRequiresTextContainer",null),e([s()],u.prototype,"_menuIsOpen",void 0),e([s()],u.prototype,"autoWidth",void 0),e([s()],u.prototype,"cellValueFormatFunction",void 0),e([s()],u.prototype,"customMenuItems",null),e([s()],u.prototype,"defaultMenuItems",null),e([s()],u.prototype,"description",void 0),e([s()],u.prototype,"direction",void 0),e([s()],u.prototype,"effectiveDescription",null),e([s()],u.prototype,"effectiveLabel",null),e([s({constructOnly:!0})],u.prototype,"fieldName",void 0),e([s()],u.prototype,"flexGrow",void 0),e([s()],u.prototype,"footerRenderFunction",void 0),e([s()],u.prototype,"formatFunction",void 0),e([s()],u.prototype,"frozen",void 0),e([s()],u.prototype,"frozenToEnd",void 0),e([s()],u.prototype,"grid",void 0),e([s()],u.prototype,"iconNode",null),e([s()],u.prototype,"invalid",null),e([s()],u.prototype,"headerRenderFunction",void 0),e([s()],u.prototype,"hidden",void 0),e([s()],u.prototype,"icon",void 0),e([s()],u.prototype,"iconText",void 0),e([s({constructOnly:!0})],u.prototype,"initialSortPriority",void 0),e([s()],u.prototype,"label",void 0),e([s()],u.prototype,"menu",null),e([s()],u.prototype,"menuItems",null),e([s()],u.prototype,"menuConfig",void 0),e([s()],u.prototype,"menuIsOpen",null),e([s()],u.prototype,"menuIsVisible",null),e([s()],u.prototype,"messages",void 0),e([s()],u.prototype,"messagesCommon",void 0),e([s()],u.prototype,"messagesURIUtils",void 0),e([s()],u.prototype,"renderFunction",void 0),e([s()],u.prototype,"resizable",void 0),e([s()],u.prototype,"sortable",void 0),e([s({readOnly:!0})],u.prototype,"sortElement",void 0),e([s()],u.prototype,"store",void 0),e([s()],u.prototype,"tableTimeZone",void 0),e([s()],u.prototype,"textAlign",void 0),e([s()],u.prototype,"textWrap",void 0),e([s()],u.prototype,"timeZone",void 0),e([s()],u.prototype,"visibleElements",void 0),e([s()],u.prototype,"width",void 0),u=e([r("esri.widgets.FeatureTable.Grid.Column")],u);const m=u;export{m as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{watch as i,when as n,initial as o}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{css as l}from"./ColumnCSS.js";import{isEmptyStringOrWhitespace as a}from"../support/tableUtils.js";import{autoLink as c}from"../../support/uriUtils.js";import{renderingSanitizer as d,setFocus as p}from"../../support/widgetUtils.js";let u=class extends t{constructor(e){super(e),this._menuIsOpen=!1,this.autoWidth=!1,this.cellValueFormatFunction=({root:e,rowData:t,value:i})=>{const{formatFunction:n}=this,o=d.sanitize(i);if(n&&t){const{index:i,item:{attachments:s,feature:r,relatedRecords:l}}=t;return n({attachments:s,column:this,feature:r,index:i,relatedRecords:l,value:o,virtualIndex:this.getVirtualRowIndex(e)})}return o},this.description=null,this.direction=null,this.fieldName=null,this.flexGrow=1,this.footerRenderFunction=null,this.formatFunction=null,this.frozen=!1,this.frozenToEnd=!1,this.grid=null,this.headerRenderFunction=e=>{const{root:t}=e,i=this.createHeaderContent();this.removeCellContent(t),t.appendChild(i)},this.hidden=!1,this.icon=null,this.iconText=null,this.initialSortPriority=null,this.label=null,this.labelTooltipText=null,this.menuConfig=null,this.messages=null,this.messagesCommon=null,this.messagesURIUtils=null,this.renderFunction=({root:e,rowData:t})=>{const i=this.getCellValue(t),n=this.cellValueFormatFunction({root:e,rowData:t,value:i});let o=null;if(o=n instanceof HTMLElement?n:c(this.messagesURIUtils,n),this.removeCellContent(e),o instanceof HTMLElement)e.removeAttribute("title"),e.appendChild(o);else if(null!=o){const t=o.toString();e.innerHTML=t,e.title=t}},this.resizable=!0,this.sortable=!1,this.store=null,this.tableTimeZone=null,this.textAlign="start",this.textWrap=!1,this.timeZone=null,this.visibleElements=null,this.width=200}initialize(){const{fieldName:e}=this;this._set("sortElement",this.createSortElement()),this.sortElement.setAttribute("path",e),this.addHandles([i((()=>this.direction),(e=>{const{sortElement:t}=this;this.sortable&&t&&(e?this.sortElement.direction!==e&&t.setAttribute("direction",e):t.removeAttribute("direction"))})),n((()=>this.grid?.isReady&&this.sortElement),(()=>{const{direction:e,grid:t,hidden:i,sortElement:n}=this;i&&e&&n&&t&&!t.hasSorter(n)&&t.addSorter(n)}),o),i((()=>[this.timeZone,this.icon,this.iconText,this.labelTooltipText]),(()=>this.grid?.requestContentUpdate())),i((()=>this.hidden),(()=>this.closeMenu())),i((()=>this.fieldName),(e=>{const{sortElement:t}=this;t&&t.path!==e&&t.setAttribute("path",e)})),i((()=>[this.effectiveLabel,this.labelTooltipText]),(([e,t])=>{const{sortElement:i}=this;i&&(i.setAttribute("title",t||e),i.textContent=e)}))])}get _headerRequiresTextContainer(){return!(!this.sortable&&""===this.effectiveLabel&&null==this.effectiveDescription)}get customMenuItems(){return this.menuConfig?.items?.map((({disabled:e,hidden:t,icon:i,iconClass:n,label:o,selected:s,clickFunction:r})=>this.createCalciteDropdownItem({disabled:e,hidden:t,iconClass:n,iconStart:i,selected:s,textContent:o,onclick:e=>r(e)})))??[]}get defaultMenuItems(){if(!this.sortable)return[];const e=this.messages,t=[],i=this.visibleElements?.columnMenuItems;if(!1!==i?.sortAscending){const i=this.createCalciteDropdownItem({iconStart:"sort-ascending-arrow",textContent:e?.sortAsc,onclick:()=>this.direction="asc"});t.push(i)}if(!1!==i?.sortDescending){const i=this.createCalciteDropdownItem({iconStart:"sort-descending-arrow",textContent:e?.sortDesc,onclick:()=>this.direction="desc"});t.push(i)}return t}get effectiveDescription(){const{description:e}=this;return a(e)?null:d.sanitize(e)}get effectiveLabel(){return d.sanitize(this.label||this.fieldName)}get iconNode(){const{icon:e,iconText:t}=this,i=t?d.sanitize(t):void 0;return e?this.createCalciteIcon({icon:e,textLabel:i}):null}set invalid(e){this._set("invalid",e),this.grid?.generateCellPartNames()}get invalid(){return this._get("invalid")??!1}get menu(){const{customMenuItems:e,defaultMenuItems:t,menuConfig:i}=this,n=!!i?.open,o=this.createCalciteAction({icon:i?.icon??"ellipsis",text:this.messages?.menu??"",slot:"trigger"}),s=document.createElement("calcite-dropdown");if(s.maxItems=i?.maxItems??4,s.placement="top-end",s.overlayPositioning="fixed",s.scale=i?.scale??"m",n&&(s.open=n,this._menuIsOpen=!0),s.appendChild(o),s.addEventListener("calciteDropdownOpen",(()=>this._menuIsOpen=!0)),s.addEventListener("calciteDropdownClose",(()=>this._menuIsOpen=!1)),s.onkeydown=this._stopPropagationOnSelect,s.addEventListener("mousewheel",(e=>{e.stopPropagation()})),t.length){const e=s.appendChild(document.createElement("calcite-dropdown-group"));e.selectionMode="none",e.append(...t)}if(e.length){const t=s.appendChild(document.createElement("calcite-dropdown-group"));t.selectionMode=i?.selectionMode??"none",t.append(...e)}return s}get menuItems(){return[...this.defaultMenuItems,...this.customMenuItems]}get menuIsOpen(){return this._menuIsOpen}get menuIsVisible(){return!(!1===this.visibleElements?.columnMenus||!this.menuItems.length)}closeMenu(){this.menu.open=!1}createSortElement(){const{effectiveLabel:e,direction:t,fieldName:i,initialSortPriority:n}=this,o=document.createElement("vaadin-grid-sorter");return o.classList.add(l.sorter),o.setAttribute("path",i),o.setAttribute("title",this.labelTooltipText||e),o.textContent=e,t&&o.setAttribute("direction",t),null!=n&&(o._initialOrder=n),o.addEventListener("direction-changed",(()=>{this.direction!==o.direction&&this._set("direction",o.direction)})),o}createCalciteAction(e){const t=document.createElement("calcite-action"),{alignment:i,appearance:n,className:o,disabled:s,icon:r,label:l,scale:a,slot:c,text:d,textEnabled:p,onclick:u}=e;return t.alignment=i??"center",t.appearance=n??"transparent",t.className=o??"",t.disabled=!!s,t.icon=r??"",t.label=l??"",t.scale=a??"s",t.slot=c??"",t.text=t.title=d??"",t.textEnabled=!!p,t.onclick=u??null,t}createCalciteButton(e){const t=document.createElement("calcite-button"),{alignment:i,appearance:n,className:o,disabled:s,iconEnd:r,iconFlipRtl:l,kind:a,loading:c,onclick:d,scale:p,textContent:u,title:m,width:h}=e;return t.alignment=i??"center",t.className=o??"",t.scale=p??"s",t.appearance=n??"transparent",t.disabled=!!s,t.iconEnd=r??"",l&&(t.iconFlipRtl=l),t.kind=a??"brand",t.loading=!!c,t.textContent=u??"",m&&(t.title=m),t.width=h??"auto",t.onclick=d??null,t}createCalciteDropdownItem(e){const t=document.createElement("calcite-dropdown-item"),{disabled:i,hidden:n,iconClass:o,iconStart:s,textContent:r,onclick:a,selected:c}=e,d=r??"";if(o&&!s){const e=document.createElement("span"),i=document.createElement("span");i.classList.add(l.headerMenuIcon,o),e.textContent=e.title=d,e.insertBefore(i,e.firstChild),t.appendChild(e)}else t.iconStart=s??"",t.textContent=t.title=d;return t.disabled=!!i,t.hidden="function"==typeof n?n():!!n,t.selected=!!c,a&&(t.addEventListener("calciteDropdownItemSelect",a),t.onkeydown=this._stopPropagationOnSelect),t}createCalciteIcon(e){const{effectiveLabel:t}=this,{icon:i,scale:n,textLabel:o}=e,s=document.createElement("calcite-icon"),r=o??t;return s.icon=i,s.scale=n??"s",s.textLabel=r,s.title=r,s}createHeaderContent(){const{effectiveDescription:e,effectiveLabel:t,iconNode:i}=this,n=document.createElement("div");if(n.classList.add(l.headerContent),i&&n.appendChild(i),!this._headerRequiresTextContainer)return n;const o=n.appendChild(document.createElement("div"));return this.sortable?o.appendChild(this.sortElement):""!==t&&o.appendChild(this._createHeaderTextElement({label:t,cssClass:l.headerLabel,title:this.labelTooltipText})),null!=e&&!1!==this.visibleElements?.columnDescriptions&&o.appendChild(this._createHeaderTextElement({label:e,cssClass:l.headerDescription})),this.menuIsVisible&&n.appendChild(this.menu),n}getCellValue(e){return e?.item.feature.attributes?.[this.fieldName]}getVirtualRowIndex(e){const t=this.grid?.getRowContainingNode(e);return t?.parentElement?[...t.parentElement.children].indexOf(t):-1}removeCellContent(e){if(e&&e.firstChild)try{for(;e?.firstChild;)e?.removeChild(e.firstChild)}catch(t){}}openMenu(){this.menuIsVisible&&(this.menu.open=!0,p(this.menuItems[0]))}sort(){this.sortable&&this.sortElement?.click()}_stopPropagationOnSelect(e){"Enter"!==e.key&&" "!==e.key||e.stopPropagation()}_createHeaderTextElement({cssClass:e,label:t,title:i}){const n=document.createElement("span");n.classList.add(e);const o=n.appendChild(document.createElement("span"));return o.textContent=t,o.setAttribute("title",i||t),n}};e([s()],u.prototype,"_headerRequiresTextContainer",null),e([s()],u.prototype,"_menuIsOpen",void 0),e([s()],u.prototype,"autoWidth",void 0),e([s()],u.prototype,"cellValueFormatFunction",void 0),e([s()],u.prototype,"customMenuItems",null),e([s()],u.prototype,"defaultMenuItems",null),e([s()],u.prototype,"description",void 0),e([s()],u.prototype,"direction",void 0),e([s()],u.prototype,"effectiveDescription",null),e([s()],u.prototype,"effectiveLabel",null),e([s({constructOnly:!0})],u.prototype,"fieldName",void 0),e([s()],u.prototype,"flexGrow",void 0),e([s()],u.prototype,"footerRenderFunction",void 0),e([s()],u.prototype,"formatFunction",void 0),e([s()],u.prototype,"frozen",void 0),e([s()],u.prototype,"frozenToEnd",void 0),e([s()],u.prototype,"grid",void 0),e([s()],u.prototype,"iconNode",null),e([s()],u.prototype,"invalid",null),e([s()],u.prototype,"headerRenderFunction",void 0),e([s()],u.prototype,"hidden",void 0),e([s()],u.prototype,"icon",void 0),e([s()],u.prototype,"iconText",void 0),e([s({constructOnly:!0})],u.prototype,"initialSortPriority",void 0),e([s()],u.prototype,"label",void 0),e([s()],u.prototype,"labelTooltipText",void 0),e([s()],u.prototype,"menu",null),e([s()],u.prototype,"menuItems",null),e([s()],u.prototype,"menuConfig",void 0),e([s()],u.prototype,"menuIsOpen",null),e([s()],u.prototype,"menuIsVisible",null),e([s()],u.prototype,"messages",void 0),e([s()],u.prototype,"messagesCommon",void 0),e([s()],u.prototype,"messagesURIUtils",void 0),e([s()],u.prototype,"renderFunction",void 0),e([s()],u.prototype,"resizable",void 0),e([s()],u.prototype,"sortable",void 0),e([s({readOnly:!0})],u.prototype,"sortElement",void 0),e([s()],u.prototype,"store",void 0),e([s()],u.prototype,"tableTimeZone",void 0),e([s()],u.prototype,"textAlign",void 0),e([s()],u.prototype,"textWrap",void 0),e([s()],u.prototype,"timeZone",void 0),e([s()],u.prototype,"visibleElements",void 0),e([s()],u.prototype,"width",void 0),u=e([r("esri.widgets.FeatureTable.Grid.Column")],u);const m=u;export{m as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../chunks/tslib.es6.js";import t from"../../../core/JSONSupport.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";let r=class extends t{constructor(o){super(o),this.autoWidth=!1,this.description=null,this.direction=null,this.flexGrow=1,this.fieldName=null,this.formatFunction=null,this.frozen=!1,this.frozenToEnd=!1,this.icon=null,this.iconText=null,this.initialSortPriority=null,this.invalid=!1,this.label=null,this.menuConfig=null,this.resizable=!0,this.sortable=!1,this.textAlign="start",this.textWrap=!1,this.timeZone=null,this.type=null,this.visible=!0,this.width=200}};o([i()],r.prototype,"autoWidth",void 0),o([i()],r.prototype,"description",void 0),o([i()],r.prototype,"direction",void 0),o([i()],r.prototype,"flexGrow",void 0),o([i({type:String})],r.prototype,"fieldName",void 0),o([i()],r.prototype,"formatFunction",void 0),o([i()],r.prototype,"frozen",void 0),o([i()],r.prototype,"frozenToEnd",void 0),o([i()],r.prototype,"icon",void 0),o([i()],r.prototype,"iconText",void 0),o([i()],r.prototype,"initialSortPriority",void 0),o([i()],r.prototype,"invalid",void 0),o([i()],r.prototype,"label",void 0),o([i()],r.prototype,"menuConfig",void 0),o([i()],r.prototype,"resizable",void 0),o([i()],r.prototype,"sortable",void 0),o([i()],r.prototype,"textAlign",void 0),o([i()],r.prototype,"textWrap",void 0),o([i()],r.prototype,"timeZone",void 0),o([i({type:String,json:{read:!1,write:!0}})],r.prototype,"type",void 0),o([i()],r.prototype,"visible",void 0),o([i()],r.prototype,"width",void 0),r=o([e("esri.widgets.FeatureTable.support.ColumnTemplateBase")],r);const p=r;export{p as default};
|
|
5
|
+
import{_ as o}from"../../../chunks/tslib.es6.js";import t from"../../../core/JSONSupport.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";let r=class extends t{constructor(o){super(o),this.autoWidth=!1,this.description=null,this.direction=null,this.flexGrow=1,this.fieldName=null,this.formatFunction=null,this.frozen=!1,this.frozenToEnd=!1,this.icon=null,this.iconText=null,this.initialSortPriority=null,this.invalid=!1,this.label=null,this.labelTooltipText=null,this.menuConfig=null,this.resizable=!0,this.sortable=!1,this.textAlign="start",this.textWrap=!1,this.timeZone=null,this.type=null,this.visible=!0,this.width=200}};o([i()],r.prototype,"autoWidth",void 0),o([i()],r.prototype,"description",void 0),o([i()],r.prototype,"direction",void 0),o([i()],r.prototype,"flexGrow",void 0),o([i({type:String})],r.prototype,"fieldName",void 0),o([i()],r.prototype,"formatFunction",void 0),o([i()],r.prototype,"frozen",void 0),o([i()],r.prototype,"frozenToEnd",void 0),o([i()],r.prototype,"icon",void 0),o([i()],r.prototype,"iconText",void 0),o([i()],r.prototype,"initialSortPriority",void 0),o([i()],r.prototype,"invalid",void 0),o([i()],r.prototype,"label",void 0),o([i()],r.prototype,"labelTooltipText",void 0),o([i()],r.prototype,"menuConfig",void 0),o([i()],r.prototype,"resizable",void 0),o([i()],r.prototype,"sortable",void 0),o([i()],r.prototype,"textAlign",void 0),o([i()],r.prototype,"textWrap",void 0),o([i()],r.prototype,"timeZone",void 0),o([i({type:String,json:{read:!1,write:!0}})],r.prototype,"type",void 0),o([i()],r.prototype,"visible",void 0),o([i()],r.prototype,"width",void 0),r=o([e("esri.widgets.FeatureTable.support.ColumnTemplateBase")],r);const p=r;export{p as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../analysis/SliceAnalysis.js";import t from"../../core/Collection.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{AnalysisViewModel as l}from"../support/AnalysisViewModel.js";const a=new Set;let i=class extends l{constructor(e){super(e),this.analysis=null,this.supportedViewType="3d",this.unsupportedErrorMessage="SliceViewModel is only supported in 3D views.",a.add(this)}destroy(){a.delete(this)}get state(){return this.disabled||!this.ready?"disabled":null==this.tool?"ready":this.tool.state}get shape(){return this.analysis.shape}set shape(e){this.analysis.shape=e}get tiltEnabled(){return this.analysis.tiltEnabled}set tiltEnabled(e){this.analysis.tiltEnabled=e}get
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../analysis/SliceAnalysis.js";import t from"../../core/Collection.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{AnalysisViewModel as l}from"../support/AnalysisViewModel.js";const a=new Set;let i=class extends l{constructor(e){super(e),this.analysis=null,this.supportedViewType="3d",this.unsupportedErrorMessage="SliceViewModel is only supported in 3D views.",a.add(this)}destroy(){a.delete(this)}get state(){return this.disabled||!this.ready?"disabled":null==this.tool?"ready":this.tool.state}get shape(){return this.analysis.shape}set shape(e){this.analysis.shape=e}get tiltEnabled(){return this.analysis.tiltEnabled}set tiltEnabled(e){this.analysis.tiltEnabled=e}get mode(){return this.tool?.mode??"none"}get excludedLayers(){return this.analysis.excludedLayers}set excludedLayers(e){this.analysis.excludedLayers=t.isCollection(e)?e:new t(e)}get excludeGroundSurface(){return this.analysis.excludeGroundSurface}set excludeGroundSurface(e){this.analysis.excludeGroundSurface=e}async start(){await super.start(),a.forEach((e=>{e.view===this.view&&e!==this&&e.clear()})),null!=this.analysisView&&(this.analysisView.active=!0)}enterExcludeLayerMode(){this.tool?.start("exclude")}exitExcludeLayerMode(){this.tool?.stop()}onConnectToAnalysisView(e){e.active=!0}constructAnalysis(){return new s}};e([o({type:s})],i.prototype,"analysis",void 0),e([o({readOnly:!0})],i.prototype,"state",null),e([o()],i.prototype,"shape",null),e([o()],i.prototype,"tiltEnabled",null),e([o()],i.prototype,"mode",null),e([o()],i.prototype,"excludedLayers",null),e([o({nonNullable:!0})],i.prototype,"excludeGroundSurface",null),i=e([r("esri.widgets.Slice.SliceViewModel")],i);const n=i;export{n as default};
|