@arcgis/core 6.0.0-next.29 → 6.0.0-next.30
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/WebDocument2D.js +1 -1
- package/WebMap.d.ts +3 -19
- package/WebMap.js +1 -1
- package/WebScene.js +1 -1
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/039d9bc5b5015012f811.js +1 -0
- package/assets/esri/core/workers/chunks/{b01688ccc29d33bfc82d.js → 28a821de9dbf10324033.js} +1 -1
- package/assets/esri/core/workers/chunks/{d3c3fb079ad97970f834.js → 4fb2fcc95f852bf8f86c.js} +1 -1
- package/assets/esri/core/workers/chunks/{84940d8e14caf5a27e04.js → 64b360625c68cb863a08.js} +1 -1
- package/assets/esri/core/workers/chunks/71f792a20077aa739f87.js +1 -0
- package/assets/esri/core/workers/chunks/{e480e7d5f40049a2053b.js → 7af4edc6e87d27b9d467.js} +1 -1
- package/assets/esri/core/workers/chunks/90c1d10eae7ae71889b0.js +1 -0
- package/assets/esri/core/workers/chunks/{8a485130781b49dbf608.js → 9d40786c5ceface786ba.js} +1 -1
- package/assets/esri/core/workers/chunks/aba259a70bee68d2edb7.js +1 -0
- package/assets/esri/core/workers/chunks/c33a9635c294c8774977.js +1 -0
- package/assets/esri/views/3d/environment/resources/milkyway-band.avif +0 -0
- package/chunks/GlobalIllumination.glsl.js +16 -10
- package/chunks/GlobalIlluminationBlur.glsl.js +14 -14
- package/chunks/GlobalIlluminationUpscale.glsl.js +4 -4
- package/chunks/RibbonLine.glsl.js +78 -75
- package/config.js +1 -1
- package/core/workers/WorkerHandle.js +1 -1
- package/kernel.js +1 -1
- package/layers/WMTSLayer.d.ts +1 -1
- package/layers/WMTSLayer.js +1 -1
- package/layers/mixins/TiledImagery.d.ts +7 -0
- package/layers/support/WMTSSublayer.d.ts +5 -5
- package/networks/Network.js +1 -1
- package/networks/support/TopologyValidationJobInfo.js +1 -1
- package/package.json +2 -2
- package/rest/networks/support/ValidateNetworkTopologyResult.js +1 -1
- package/support/timeUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
- package/views/2d/layers/SketchLayerView2D.js +1 -1
- package/views/2d/layers/WMTSLayerView2D.js +1 -1
- package/views/2d/types.d.ts +2 -1
- package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
- package/views/3d/interactive/visualElements/Object3DVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/StageObjectVisualElement.js +2 -0
- package/views/3d/layers/WMTSLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DBufferGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayerConstants.js +1 -1
- package/views/3d/layers/graphics/Graphics3DStageObjectGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/elevationAlignmentUtils.js +1 -1
- package/views/3d/layers/graphics/pointUtils.js +1 -1
- package/views/3d/terrain/ExtentHelper.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/types.d.ts +2 -1
- package/views/3d/webgl-engine/Stage.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/util/PackedUint32.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationBlur.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationUpscale.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/globalIlluminationUniforms.js +2 -0
- package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/PackedUint32.js +2 -0
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/PathVertexInfo.js +1 -1
- package/views/3d/webgl-engine/lib/RibbonLineVertexInfo.js +2 -0
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterialBaseInstance.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterialBaseInstance.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js +1 -1
- package/views/SelectionManager.d.ts +5 -5
- package/views/SelectionManager.js +1 -1
- package/views/input/InputManager.js +1 -1
- package/views/layers/WMTSLayerView.d.ts +16 -0
- package/views/layers/WMTSLayerView.js +2 -0
- package/views/layers/support/highlightUtils.js +1 -1
- package/views/selection/SelectionOperation.js +1 -1
- package/views/selection/types.d.ts +3 -3
- package/views/support/GeometryWorker.js +1 -1
- package/views/support/GeometryWorkerHandle.js +1 -1
- package/views/support/selectionUtils.js +1 -1
- package/webdoc/support/webdocLoadUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/FeatureTable/AttachmentsColumn.js +1 -1
- package/widgets/FeatureTable/RelationshipColumn.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementWorkerUtils.js +1 -1
- package/widgets/support/SelectionList/GroupLayerItem.d.ts +5 -5
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/ItemBase.d.ts +3 -3
- package/widgets/support/SelectionList/LayerItem.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.d.ts +5 -6
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/widgets/support/SelectionList/types.d.ts +3 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/widgets/support/symbolPreviewUtils.js +1 -1
- package/assets/esri/core/workers/chunks/2de4296590bf9f9e9add.js +0 -1
- package/assets/esri/core/workers/chunks/4976f5567fc7f1b63d10.js +0 -1
- package/assets/esri/core/workers/chunks/53c7510df09b71ab5646.js +0 -1
- package/assets/esri/core/workers/chunks/66c2a28a851130b87c04.js +0 -1
- package/assets/esri/core/workers/chunks/e7aaf7579592b79d6dd7.js +0 -1
- package/layers/geospatialPDF/CIM2DLayerview.js +0 -2
|
@@ -38,18 +38,18 @@ import type { CreateTool } from "../../widgets/Sketch/types.js";
|
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Types of parent layers that include potential sources from which selections may be determined.
|
|
41
|
-
*
|
|
41
|
+
* Child layers are typically included in SelectableLayer or SelectionSource.
|
|
42
42
|
*
|
|
43
43
|
* @since 5.1
|
|
44
44
|
*/
|
|
45
|
-
export type SelectableParentLayerUnion =
|
|
45
|
+
export type SelectableParentLayerUnion = KnowledgeGraphLayer | LinkChartLayer | MapImageLayer | MapNotesLayer | SketchLayer | Sublayer | SubtypeGroupLayer;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Sublayer source types from which selections can be determined.
|
|
49
49
|
*
|
|
50
50
|
* @since 5.2
|
|
51
51
|
*/
|
|
52
|
-
export type SelectableSublayerUnion = Sublayer | SubtypeSublayer;
|
|
52
|
+
export type SelectableSublayerUnion = GraphicsLayer | Sublayer | SubtypeSublayer;
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Layer source types from which selections can be determined.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{constructFromFlatGeometry as e}from"../../chunks/FlatGeometry.js";import{P as t}from"../../chunks/Envelope.js";import{max as n,createArea as r,createLength as i}from"../../core/quantity.js";import{deriveLengthUnitFromAreaUnit as a,convertUnit as o}from"../../core/units.js";import{set as s,scale as c,normalize as l,cross as u,subtract as d,dot as f,add as p}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isEarth as h,isSphericalECEF as g}from"../../geometry/ellipsoidUtils.js";import{FlatGeometry as _,getFlatGeometryTransferList as ee,convertFlatToGeometryJSON as te,convertGeometryToFlat as ne,convertGeometryxToFlat as v}from"../../geometry/FlatGeometry.js";import re from"../../geometry/Polygon.js";import{projectWithoutEngine as y}from"../../geometry/projectionUtils.js";import b from"../../geometry/SpatialReference.js";import{WGS84ECEFSpatialReference as x,getSphericalPCPF as ie,SphericalECEFSpatialReference as S}from"../../geometry/spatialReferenceEllipsoidUtils.js";import{geodeticAreaLoad as ae}from"../../geometry/operators/geodeticAreaOperator.js";import{geodeticDistanceLoad as oe}from"../../geometry/operators/geodeticDistanceOperator.js";import{geodeticLengthLoad as se}from"../../geometry/operators/geodeticLengthOperator.js";import{execute as ce}from"../../geometry/operators/gx/operatorArea.js";import{execute as C}from"../../geometry/operators/gx/operatorCentroid.js";import{execute as le}from"../../geometry/operators/gx/operatorDistance.js";import{load as ue,execute as de}from"../../geometry/operators/gx/operatorGeodeticArea.js";import{load as w,execute as T}from"../../geometry/operators/gx/operatorGeodeticDistance.js";import{load as E,execute as fe}from"../../geometry/operators/gx/operatorGeodeticLength.js";import{execute as pe}from"../../geometry/operators/gx/operatorLength.js";import{execute as D}from"../../geometry/operators/gx/operatorSimplify.js";import{geodeticCurveType as O}from"../../geometry/operators/support/geodeticCurveType.js";import{fromSpatialReference as k}from"../../geometry/operators/support/jsonConverter.js";import{projectDirection as A}from"../../geometry/projection/projectDirection.js";import{isWGS84 as me,isWebMercator as he,isCGCS2000 as ge,equals as j}from"../../geometry/support/spatialReferenceUtils.js";import{makeOrthonormal as _e}from"../3d/support/mathUtils.js";import{autoMeasurementMode as M}from"./measurementWorkerUtils.js";async function N(
|
|
2
|
+
import{constructFromFlatGeometry as e}from"../../chunks/FlatGeometry.js";import{P as t}from"../../chunks/Envelope.js";import{max as n,createArea as r,createLength as i}from"../../core/quantity.js";import{deriveLengthUnitFromAreaUnit as a,convertUnit as o}from"../../core/units.js";import{set as s,scale as c,normalize as l,cross as u,subtract as d,dot as f,add as p}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isEarth as h,isSphericalECEF as g}from"../../geometry/ellipsoidUtils.js";import{FlatGeometry as _,getFlatGeometryTransferList as ee,convertFlatToGeometryJSON as te,convertGeometryToFlat as ne,convertGeometryxToFlat as v}from"../../geometry/FlatGeometry.js";import re from"../../geometry/Polygon.js";import{projectWithoutEngine as y}from"../../geometry/projectionUtils.js";import b from"../../geometry/SpatialReference.js";import{WGS84ECEFSpatialReference as x,getSphericalPCPF as ie,SphericalECEFSpatialReference as S}from"../../geometry/spatialReferenceEllipsoidUtils.js";import{geodeticAreaLoad as ae}from"../../geometry/operators/geodeticAreaOperator.js";import{geodeticDistanceLoad as oe}from"../../geometry/operators/geodeticDistanceOperator.js";import{geodeticLengthLoad as se}from"../../geometry/operators/geodeticLengthOperator.js";import{execute as ce}from"../../geometry/operators/gx/operatorArea.js";import{execute as C}from"../../geometry/operators/gx/operatorCentroid.js";import{execute as le}from"../../geometry/operators/gx/operatorDistance.js";import{load as ue,execute as de}from"../../geometry/operators/gx/operatorGeodeticArea.js";import{load as w,execute as T}from"../../geometry/operators/gx/operatorGeodeticDistance.js";import{load as E,execute as fe}from"../../geometry/operators/gx/operatorGeodeticLength.js";import{execute as pe}from"../../geometry/operators/gx/operatorLength.js";import{execute as D}from"../../geometry/operators/gx/operatorSimplify.js";import{geodeticCurveType as O}from"../../geometry/operators/support/geodeticCurveType.js";import{fromSpatialReference as k}from"../../geometry/operators/support/jsonConverter.js";import{projectDirection as A}from"../../geometry/projection/projectDirection.js";import{isWGS84 as me,isWebMercator as he,isCGCS2000 as ge,equals as j}from"../../geometry/support/spatialReferenceUtils.js";import{makeOrthonormal as _e}from"../3d/support/mathUtils.js";import{autoMeasurementMode as M}from"./measurementWorkerUtils.js";async function N(e,t){return e=new _({...e}),Q(await R(e,t))}function P(){ae(),se(),oe()}async function F(e,t){return e=new _({...e}),Q(await z(e,t))}async function I(e,t,n){return Q(await V(e,t,n))}async function ve(e,t,n){return e=new _({...e}),t=new _({...t}),Q(await Oe(e,t,n))}async function ye(e,t){return e=new _({...e}),Q(H(e,t))}async function be(e,t){return e=new _({...e}),Q(U(e,t))}async function xe(e,t,n){return Q(W(e,t,n))}async function Se(e,t){return e=new _({...e}),Q(await L(e.spatialReference,R,H)(e,t))}async function Ce(e,t){return e=new _({...e}),Q(await L(e.spatialReference,z,U)(e,t))}async function we(e,t,n){return Q(await L(e.spatialReference,V,W)(e,t,n))}async function Te(e,t,r,i,a){let o=L(e.spatialReference,V,W),[s,c,l,u]=await Promise.all([o(i,r,a),o(e,t,a),o(r,t,a),o(i,e,a)]);return Q({width:n(s,c),height:n(u,l)})}function L(e,t,n){switch(M(e)){case 0:return t;case 1:return n}}async function Ee(e,t){return e=new _({...e}),Q(ke(e,t))}async function De(e){return Q(G(new _({...e})))}async function R(e,t){await Promise.allSettled([ue(),t?.returnLength?E():void 0]);let n=t?.unit??`square-meters`,i=t?.lengthUnit??a(n),s=O[t?.curveType??`geodesic`],{geometry:c,spatialReference:l}=Me(e),u=de(c,l,s);return{area:r(o(u,`square-meters`,n),n),centroid:t?.returnCentroid?Ae(c,e.spatialReference):void 0,length:t?.returnLength?B(c,l,{...t,unit:i}):void 0}}async function z(t,n){return await E(),B(e(t),J(t),n)}function B(e,t,n){let r=n?.unit??`meters`,a=O[n?.curveType??`geodesic`],o=fe(e,t,a);return i(Y(o,r),r)}async function V(e,t,n){await w();let r=n?.unit??`meters`,a=T(Z(e),Z(t),J(e),O[n?.curveType??`geodesic`]);return i(Y(a,r),r)}async function Oe(n,r,a){await w();let o=e(n),s=e(r);if(o.getPointCount()!==s.getPointCount())throw Error(`Input multipoints must have the same number of points.`);let c=a?.unit??`meters`,l=J(n),u=O[a?.curveType??`geodesic`],d=new t,f=new t,p=[];for(let e=0;e<o.getPointCount();e++){o.getPointByVal(e,d),s.getPointByVal(e,f);let t=T(d,f,l,u);p.push(i(Y(t,c),c))}return p}function H(t,n){let i=n?.unit??`square-meters`,o=n?.lengthUnit??a(i),s=G(t)??t,c=e(s);return{area:r(ce(c,s.spatialReference,i),i),centroid:n?.returnCentroid?X(C(c),s.spatialReference):void 0,length:n?.returnLength?U(s,{unit:o}):void 0}}function U(t,n){let r=n?.unit??`meters`;return i(pe(e(t),t.spatialReference,r),r)}function W(e,t,n){let r=n?.unit??`meters`;return i(le(Z(e),Z(t),e.spatialReference,r),r)}function ke(e,t){let n=Fe(e.spatialReference);if(!n)throw Error(`Cannot compute horizontal area without a valid spatial reference.`);switch(n.mode){case 0:return H(e,t);case 1:return Ne(n,e,t)}}function Ae(e,t){return X(C(e),t)}function G(t){let n=K(D(e(t),k(t.spatialReference),!1));return n?je(n,t.spatialReference,t.type):null}function je(e,t,n){switch(n){case`point`:return v(e,t);case`multipoint`:return v(e,t);case`polyline`:return v(e,t);case`polygon`:return v(e,t)}}function Me(t){let n=J(t),r=e(t);return{geometry:K(D(r,n,!1))??r,spatialReference:n}}function K(e){return e==null||e.isEmpty()?null:e}function Ne(e,t,n){let r;if(j(t.spatialReference,e.spatialReference))r=t.clone();else{let n=re.fromJSON(te(t)),i=y(n,n.spatialReference,e.spatialReference);if(!i)throw Error(`Cannot project geometry from ${n.spatialReference?.wkid??`unknown`} to ${e.spatialReference.wkid}.`);r=ne(i)}let i=Re,a=Ie,o=Le;Pe(r,i,a,o);let{area:s,centroid:c,length:l}=H(r,n);return{area:s,centroid:q(c,i,a,o,e.spatialReference,t.spatialReference??b.WGS84),length:l}}function q(e,t,n,r,i,a){if(!e)return e;c(n,n,e.x),c(r,r,e.y);let o=$;return p(o,n,r),p(o,o,t),e.x=o[0],e.y=o[1],e.z=o[2],e.spatialReference=i,y(e,e.spatialReference,a)?.toJSON()??void 0}function Pe(e,t,n,r){let{vertexCount:i,vertexXY:a,vertexZ:o,spatialReference:p}=e;s(t,0,0,0);for(let e=0,n=0;e<i;++e)t[0]+=a[n++],t[1]+=a[n++],t[2]+=o[e];c(t,t,1/i);let m=ze;l(m,t);let h=Be,g=Math.atan2(m[1],m[0]);s(h,-Math.sin(g),Math.cos(g),0),j(p,x)&&(A(t,m,S,m,p),A(t,h,S,h,p)),_e(h,m,n),u(r,n,m);let _=$;for(let e=0,c=0;e<i;++e)s(_,a[c],a[c+1],o[e]),d(_,_,t),a[c++]=f(n,_),a[c++]=f(r,_);e.vertexZ=void 0,e.spatialReference=b.WebMercator}function Fe(e){return e?h(e)?me(e)||he(e)||ge(e)||g(e)||j(e,x)?{mode:1,spatialReference:x}:{mode:0,spatialReference:e}:{mode:1,spatialReference:ie(e)}:null}function J(e){let t=k(e.spatialReference);if(!t)throw Error(`Cannot compute measurements without a valid spatial reference.`);return t}function Y(e,t){return t===`meters`?e:o(e,`meters`,t)}function X(e,t){return{x:e.x,y:e.y,spatialReference:t}}function Z(e){let n=new t;return n.setXYCoords(e.x,e.y),e.z!=null&&n.setZ(e.z),e.m!=null&&n.setM(e.m),n}function Q(e,...t){let n=ee(...t);return n.length?{result:e,transferList:n}:{result:e}}const Ie=m(),Le=m(),Re=m(),$=m(),ze=m(),Be=m();export{ye as area2D,Ee as areaHorizontal,Se as autoArea2D,we as autoDistance2DBetweenPoints,Ce as autoLength2D,Te as autoSize2D,xe as distance2DBetweenPoints,N as geodeticArea,I as geodeticDistanceBetweenPoints,ve as geodeticDistanceBetweenPointsMany,F as geodeticLength,be as length2D,P as preloadGeodetic,De as simplify};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{ignoreAbortErrors as e}from"../../core/promiseUtils.js";import{WorkerHandle as t}from"../../core/workers/WorkerHandle.js";import{getFlatGeometryTransferList as n,convertGeometryToFlat as r,convertFlatToGeometryJSON as i,FlatGeometry as a}from"../../geometry/FlatGeometry.js";import o from"../../geometry/Multipoint.js";import s from"../../geometry/Point.js";import c from"../../geometry/Polygon.js";import l from"../../geometry/Polyline.js";class u extends t{constructor(e){super(`GeometryWorker`,`geodeticArea`,{geodeticArea:
|
|
2
|
+
import{ignoreAbortErrors as e}from"../../core/promiseUtils.js";import{WorkerHandle as t}from"../../core/workers/WorkerHandle.js";import{getFlatGeometryTransferList as n,convertGeometryToFlat as r,convertFlatToGeometryJSON as i,FlatGeometry as a}from"../../geometry/FlatGeometry.js";import o from"../../geometry/Multipoint.js";import s from"../../geometry/Point.js";import c from"../../geometry/Polygon.js";import l from"../../geometry/Polyline.js";class u extends t{constructor(e){super(`GeometryWorker`,`geodeticArea`,{geodeticArea:e=>n(e),geodeticLength:e=>n(e),geodeticDistanceBetweenPointsMany:(e,t)=>n(e,t),area2D:e=>n(e),length2D:e=>n(e),areaHorizontal:e=>n(e),autoArea2D:e=>n(e),autoLength2D:e=>n(e),simplify:e=>n(e)},void 0,{strategy:`distributed`}),e?.preloadGeodetic&&this._preloadGeodetic()}async geodeticArea(e,t,n,r){let i=m(e,n),{area:a,centroid:o,length:c}=await this.invokeMethodWithArgs(`geodeticArea`,[i,t],r);return{area:a,centroid:o?s.fromJSON(o):void 0,length:c}}geodeticLength(e,t,n,r){let i=e.type===`polygon`?m(e,n):p(e,n);return this.invokeMethodWithArgs(`geodeticLength`,[i,t],r)}geodeticDistanceBetweenPoints(e,t,n,r){let i=e.toJSON(),a=t.toJSON();return this.invokeMethodWithArgs(`geodeticDistanceBetweenPoints`,[i,a,n],r)}geodeticDistanceBetweenPointsMany(e,t,n,i){let a=r(e.toJSON()),o=r(t.toJSON());return this.invokeMethodWithArgs(`geodeticDistanceBetweenPointsMany`,[a,o,n],i)}_preloadGeodetic(){e(this.broadcast(void 0,`preloadGeodetic`))}async area2D(e,t,n,r){let i=m(e,n),{area:a,centroid:o,length:c}=await this.invokeMethodWithArgs(`area2D`,[i,t],r);return{area:a,centroid:o?s.fromJSON(o):void 0,length:c}}length2D(e,t,n,r){let i=e.type===`polygon`?m(e,n):p(e,n);return this.invokeMethodWithArgs(`length2D`,[i,t],r)}distance2DBetweenPoints(e,t,n,r){let i=e.toJSON(),a=t.toJSON();return this.invokeMethodWithArgs(`distance2DBetweenPoints`,[i,a,n],r)}async areaHorizontal(e,t,n,r){let i=m(e,n),{area:a,centroid:o,length:c}=await this.invokeMethodWithArgs(`areaHorizontal`,[i,t],r);return{area:a,centroid:o?s.fromJSON(o):void 0,length:c}}async autoArea2D(e,t,n,r){let i=m(e,n),{area:a,centroid:o,length:c}=await this.invokeMethodWithArgs(`autoArea2D`,[i,t],r);return{area:a,centroid:o?s.fromJSON(o):void 0,length:c}}autoLength2D(e,t,n,r){let i=e.type===`polygon`?m(e,n):p(e,n);return this.invokeMethodWithArgs(`autoLength2D`,[i,t],r)}autoDistance2DBetweenPoints(e,t,n,r){let i=e.toJSON(),a=t.toJSON();return this.invokeMethodWithArgs(`autoDistance2DBetweenPoints`,[i,a,n],r)}autoSize2D(e,t,n,r,i,a){let o=e.toJSON(),s=t.toJSON(),c=n.toJSON(),l=r.toJSON();return this.invokeMethodWithArgs(`autoSize2D`,[o,s,c,l,i],a)}async simplify(e,t){let n=await this.invokeMethodWithArgs(`simplify`,[d(e)],t);return n?f(n):null}}function d(e){switch(e.type){case`point`:case`multipoint`:return r(e.toJSON());case`polyline`:return p(e);case`polygon`:return m(e)}}function f(e){let t=i(new a({...e}));switch(e.type){case`point`:return s.fromJSON(t);case`multipoint`:return o.fromJSON(t);case`polyline`:return l.fromJSON(t);case`polygon`:return c.fromJSON(t)}}function p(e,t){let{curvePaths:n,hasM:i,hasZ:a,paths:o,spatialReference:s}=e,c=_(s);if(!t)return r({curvePaths:n,hasM:i,hasZ:a,paths:o,spatialReference:c});let l=g(t,a,i),u=n?h(n,l):void 0,d=n?o:h(o,l);return r({curvePaths:u,hasM:i,hasZ:a,paths:d,spatialReference:c})}function m(e,t){let{curveRings:n,hasM:i,hasZ:a,rings:o,spatialReference:s}=e,c=_(s);if(!t)return r({curveRings:n,hasM:i,hasZ:a,rings:o,spatialReference:c});let l=g(t,a,i),u=n?h(n,l):void 0,d=n?o:h(o,l);return r({curveRings:u,hasM:i,hasZ:a,rings:d,spatialReference:c})}function h(e,t){return e.map((n,r)=>r===e.length-1?[...n,t]:n.slice())}function g(e,t,n){let{x:r,y:i,z:a,m:o}=e;return t&&n?[r,i,a??0,o??0]:t?[r,i,a??0]:n?[r,i,o??0]:[r,i]}function _(e){let t=e.toJSON();return t.wkt2??=e.wkt2,t}export{u as GeometryWorkerHandle};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{isInEffectiveScaleRange as e}from"../../geometry/support/scaleUtils.js";function
|
|
2
|
+
import{isInEffectiveScaleRange as e}from"../../geometry/support/scaleUtils.js";import{isHighlightableLayerView as t}from"../layers/support/highlightUtils.js";function n(e){return!!(typeof e==`object`&&e&&`id`in e&&`type`in e)}function r(e){return!!(n(e)&&`on`in e&&e.on)}function i(e){return!!(n(e)&&`graphics`in e&&e.graphics)}function a(e){return!!(n(e)&&`fields`in e&&`fieldsIndex`in e&&`objectIdField`in e&&`createQuery`in e&&e.createQuery&&`queryFeatures`in e&&e.queryFeatures)}function o(e){return a(e)||i(e)}function s(e){return!!(typeof e==`object`&&e&&`layer`in e&&e.layer&&n(e.layer)&&`view`in e)}function c(e){return s(e)&&i(e.layer)}function l(e){return s(e)&&t(e)}function u(e){return!!(s(e)&&`createQuery`in e&&e.createQuery&&`queryFeatures`in e&&e.queryFeatures)}function d(e){return u(e)||c(e)}function f(e,t){return!!(typeof e==`object`&&e&&`isTable`in e&&e.isTable||t?.map?.allTables.includes(e))}function p(e,t){return d(e)?h(e)&&m(e.layer,t):!o(e)||m(e,t)}function m(t,n){return t.effectiveVisible!==!1&&e(t.effectiveScaleRange,n?.scale)}function h(e){return e.visible!==!1&&e.visibleAtCurrentScale!==!1}export{o as isSelectableLayer,n as isSelectableLayerBase,r as isSelectableLayerBaseWithEditing,d as isSelectableLayerView,s as isSelectableLayerViewBase,h as isSelectableLayerViewVisible,c as isSelectableLayerViewWithGraphics,l as isSelectableLayerViewWithHighlights,u as isSelectableLayerViewWithObjectIds,m as isSelectableLayerVisible,i as isSelectableLayerWithGraphics,a as isSelectableLayerWithObjectIds,p as isSelectionSourceVisible,f as isTableLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../Viewpoint.js";import t from"../../core/
|
|
2
|
+
import e from"../../Viewpoint.js";import t from"../../core/Collection.js";import n from"../../core/Error.js";import r from"../../core/Logger.js";import{geographicToWebMercator as i}from"../../geometry/support/webMercatorUtils.js";import a from"../../portal/Portal.js";import{createForItemRead as o}from"../../portal/support/jsonContext.js";import{project as s}from"../../rest/geometryService/project.js";import c from"../../rest/support/ProjectParameters.js";import{hasWebDocumentAsPrimaryContent as l}from"./utils.js";function u(e,t){return t.resourceInfo?d(t,t.resourceInfo,{origin:e.origin}):t.portalItem?.id?f(e,t,t.portalItem):Promise.resolve()}async function d(e,n,r){let i=[],o={context:{...r,layerContainerType:`operational-layers`}};if(e.portalItem&&(o.context.portal=e.portalItem.portal||a.getDefault()),i.push(import(`../../layers/support/layersCreator.js`).then(({populateOperationalLayers:t})=>{let r=[],i=n.operationalLayers;i?.length&&r.push(t(e.layers,i,o));let a={...o,context:{...o.context,layerContainerType:`tables`},defaultLayerType:`ArcGISFeatureLayer`},s=n.tables;return s?.length&&r.push(t(e.tables,s,a)),Promise.allSettled(r)})),n.utilityNetworks&&`utilityNetworks`in e){let a=n.utilityNetworks;i.push(import(`../../networks/UtilityNetwork.js`).then(({default:n})=>{let i=new(t.ofType(n))(a.map(e=>{let t=new n;return t.read(e,r),t}));e.setAtOrigin(`utilityNetworks`,i,r.origin)}))}if(n.geotriggersInfo&&`geotriggersInfo`in e){let t=n.geotriggersInfo;i.push(import(`../GeotriggersInfo.js`).then(({default:n})=>{let i=new n;i.read(t,r),e.setAtOrigin(`geotriggersInfo`,i,r.origin)}))}if(n.mapIPSInfo&&`ipsInfo`in e){let t=n.mapIPSInfo;i.push(import(`../IPSInfo.js`).then(({default:n})=>{let i=new n;i.read(t,r),e.setAtOrigin(`ipsInfo`,i,r.origin)}))}await Promise.all(i)}async function f(e,t,i){await i.load().catch(t=>{throw new n(`${e.name}:load-portal-item`,`Failed to load portal item`,{error:t})});let a=i.type,s=e.supportedItemTypes;if(!a||!s.has(a))throw new n(`${e.name}:invalid-portal-item`,`Invalid portal item type '${a}', expected one of: '${Array.from(s).join(`', '`)}'`,{type:a});let c,{portalItemResourcePath:u}=t;if(l(i)){if(u)throw new n(`${e.name}:portal-item-resource-path-not-supported`,`'portalItemResourcePath' is not supported when loading a map from '${a}' item`);c=await i.fetchData()}else{if(!u)throw new n(`${e.name}:missing-portal-item-resource-path`,`'portalItemResourcePath' is required to load a map from '${a}' item`);c=await i.resourceFromPath(u).fetch()}t.resourceInfo=c;let d=o(i,e.origin);await p(e,t,c,d),t.resourceReferences={portalItem:i,portalItemResourcePath:u,paths:d.readResourcePaths};let f=await h(t.initialViewProperties,i,r.getLogger(t));if(f){let n=t.initialViewProperties?.clone()??e.createInitialViewProperties();n.viewpoint=f,t.initialViewProperties=n}}function p(e,t,n,r){let i=m(e,n);return t.read(i,r),d(t,i,r)}function m(e,t){let n=e.parseVersion(t.version||``,e.name);return e.currentVersion.validate(n),t.version=`${n.major}.${n.minor}`,t}async function h(t,n,r){if(t?.viewpoint?.targetGeometry)return null;let i=await g(t,n,r);return i?new e({targetGeometry:i}):null}async function g(e,t,n){let r=e?.spatialReference,a=t?.extent;if(!r||!a)return null;if(r.isWGS84)return a.clone();if(r.isWebMercator)return i(a);let{getGeometryServiceURL:o}=await import(`../../portal/support/geometryServiceUtils.js`);try{let e=await o(t),n=new c({geometries:[a],outSpatialReference:r});return(await s(e,n))[0]}catch(e){n.error(`Error projecting item's extent:`,e)}return null}export{u as loadFromSource};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{destroyMaybe as t}from"../../../core/maybe.js";import{on as n}from"../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{isSubtypeGroupLayer as a,getEffectiveLayerCapabilities as o}from"../../../layers/support/layerUtils.js";import{isRelatableFeatureSupportedLayer as s}from"../../../popup/support/featureUtils.js";import{getComputedAttributes as c,parseFormTemplateString as l}from"../stringUtils.js";import u from"./EditableInput.js";import d from"./SingleFeatureInputAdapter.js";import f from"../../Feature/FeatureRelationship/FeatureRelationshipViewModel.js";let p=class extends u{constructor(e){super(e),this._relationshipVM=new f,this._showAllCategories=!1,this._showAllRelatedRecords=!1,this.group=null,this.map=null,this.single=new d({input:this}),this.type=`relationship`}initialize(){this._setRelationshipVMProps(),this.addHandles([n(()=>this.relatedLayer,`edits`,()=>this._relationshipVM?.refresh())])}destroy(){t(this._relationshipVM)}get activeCategory(){return this._relationshipVM.activeCategory}get allCategories(){let{relatedLayer:e,_relationshipVM:t}=this;if(!a(e))return;let n=t?.categories,r=(e.subtypes??[]).map(({code:e,name:t})=>{let r=n?.find(e=>e.name===t);return{name:t,count:r?.count??0,value:r?.value??e}});return r.length?r:null}get categories(){return this.showAllEnabled?this.allCategories:this.allCategories?.slice(0,this.displayCount)}get canAddRelatedFeature(){let{editable:e,relatedFeatureCount:t,relationship:n}=this;if(!n||!this.loaded||!this._relatedLayerAllowsAdds||this.allCategories?.length&&!this.activeCategory)return!1;let{cardinality:r,role:i}=n;return r===`one-to-one`&&t>0||r===`many-to-many`||r===`one-to-many`&&i===`destination`&&t>0?!1:e}get displayCount(){return this.template.displayCount}get displayType(){return this.template.displayType}get editable(){return this._relatedLayerAllowsEdits?this._evaluatedEditableExpression??!0:!1}get feature(){return this.single.feature}get relatedFeatureCount(){return this._relationshipVM?.featureCount??0}get label(){return this.activeCategory?.name?this.activeCategory.name:this._computeStringLiteralText(this.template.label)}get layer(){return this.single.layer}get loaded(){return this._relationshipVM?.state!==`loading`}get orderByFields(){return this.template.orderByFields}get originHasValidKey(){
|
|
2
|
+
import{__decorate as e}from"tslib";import{destroyMaybe as t}from"../../../core/maybe.js";import{on as n}from"../../../core/reactiveUtils.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import{isSubtypeGroupLayer as a,getEffectiveLayerCapabilities as o}from"../../../layers/support/layerUtils.js";import{isRelatableFeatureSupportedLayer as s}from"../../../popup/support/featureUtils.js";import{getComputedAttributes as c,parseFormTemplateString as l}from"../stringUtils.js";import u from"./EditableInput.js";import d from"./SingleFeatureInputAdapter.js";import f from"../../Feature/FeatureRelationship/FeatureRelationshipViewModel.js";let p=class extends u{constructor(e){super(e),this._relationshipVM=new f,this._showAllCategories=!1,this._showAllRelatedRecords=!1,this.group=null,this.map=null,this.single=new d({input:this}),this.type=`relationship`}initialize(){this._setRelationshipVMProps(),this.addHandles([n(()=>this.relatedLayer,`edits`,()=>this._relationshipVM?.refresh())])}destroy(){t(this._relationshipVM)}get activeCategory(){return this._relationshipVM.activeCategory}get allCategories(){let{relatedLayer:e,_relationshipVM:t}=this;if(!a(e))return;let n=t?.categories,r=(e.subtypes??[]).map(({code:e,name:t})=>{let r=n?.find(e=>e.name===t);return{name:t,count:r?.count??0,value:r?.value??e}});return r.length?r:null}get categories(){return this.showAllEnabled?this.allCategories:this.allCategories?.slice(0,this.displayCount)}get canAddRelatedFeature(){let{editable:e,relatedFeatureCount:t,relationship:n}=this;if(!n||!this.loaded||!this._relatedLayerAllowsAdds||this.allCategories?.length&&!this.activeCategory)return!1;let{cardinality:r,role:i}=n;return r===`one-to-one`&&t>0||r===`many-to-many`||r===`one-to-many`&&i===`destination`&&t>0?!1:e}get displayCount(){return this.template.displayCount}get displayType(){return this.template.displayType}get editable(){return this._relatedLayerAllowsEdits?this._evaluatedEditableExpression??!0:!1}get feature(){return this.single.feature}get relatedFeatureCount(){return this._relationshipVM?.featureCount??0}get label(){return this.activeCategory?.name?this.activeCategory.name:this._computeStringLiteralText(this.template.label)}get layer(){return this.single.layer}get loaded(){return this._relationshipVM?.state!==`loading`}get orderByFields(){return this.template.orderByFields}get originHasValidKey(){let e=this.feature?.layer.fieldsIndex.get(this.relationship?.keyField)?.name;return!!e&&this.feature?.getAttribute(e)!=null}get relationship(){return this._relationshipVM?.relationship}get relationshipId(){return this.template.relationshipId}get relatedFeatureInfos(){let{_relationshipVM:e,effectiveTimeZone:t}=this;if(!e?.relatedFeatures?.length||!e?.relatedLayer)return[];let{itemDescriptionFieldName:n,relatedFeatures:r,relatedLayer:i}=e,a=i?.formTemplate?.title||void 0;return r.map(e=>{let r;if(n){let a=e.getAttribute(n),o=i.fieldsIndex.get(n);if(o){let e=c({fields:[o],layer:i,values:[a],timeZone:t})[n];e!=null&&(r=e.toString())}}let o=a?l({attributes:e.attributes,label:a,layer:i,timeZone:t}):void 0;return{feature:e,description:r,title:o}}).toArray()}get relatedLayer(){return this._relationshipVM?.relatedLayer}get relatedLayerIsTable(){return!!this.relatedLayer?.isTable}get showAllEnabled(){return this._relationshipVM.showAllEnabled}get showAllActionVisible(){return!this.showAllEnabled&&this.relatedFeatureCount>0&&this.relatedFeatureCount>this.displayCount}get showAllCategories(){return this._showAllCategories}get showAllCategoriesVisible(){let e=this.allCategories?.length??0;return!this.showAllEnabled&&e>0&&e>this.displayCount}get showAllRelatedRecords(){return this._showAllRelatedRecords}get updating(){return this._relationshipVM?.state===`loading`||this._relationshipVM?.state===`querying`}incrementPage(){this._relationshipVM&&this._relationshipVM.featurePage++}setActiveCategory(e){this._relationshipVM.activeCategory=e,this.setShowAllRelatedRecords(!!e)}setShowAllCategories(e){this._showAllCategories=e,this._showAllRelatedRecords||this._setShowAllEnabled(e)}setShowAllRelatedRecords(e){this._showAllRelatedRecords=e,this._showAllCategories||this._setShowAllEnabled(e)}get _relatedLayerAllowsAdds(){let{relatedLayer:e}=this;return!e||!this._relatedLayerAllowsEdits?!1:!!o(e)?.operations?.supportsAdd}get _relatedLayerAllowsEdits(){let{relatedLayer:e}=this;return e?!!o(e)?.operations?.supportsEditing:!1}_setRelationshipVMProps(){let{displayCount:e,feature:t,layer:n,orderByFields:r,map:i,relationshipId:a,showAllEnabled:o}=this;t&&n&&s(n)&&this._relationshipVM.set({displayCount:e,graphic:t.plainGraphic,layer:n,map:i,orderByFields:r,relationshipId:a,showAllEnabled:o})}_setShowAllEnabled(e){this._relationshipVM.showAllEnabled=e}};e([r()],p.prototype,`_relationshipVM`,void 0),e([r()],p.prototype,`_showAllCategories`,void 0),e([r()],p.prototype,`_showAllRelatedRecords`,void 0),e([r()],p.prototype,`activeCategory`,null),e([r()],p.prototype,`allCategories`,null),e([r()],p.prototype,`categories`,null),e([r()],p.prototype,`canAddRelatedFeature`,null),e([r()],p.prototype,`displayCount`,null),e([r()],p.prototype,`displayType`,null),e([r()],p.prototype,`editable`,null),e([r()],p.prototype,`feature`,null),e([r()],p.prototype,`group`,void 0),e([r()],p.prototype,`label`,null),e([r()],p.prototype,`layer`,null),e([r()],p.prototype,`loaded`,null),e([r()],p.prototype,`map`,void 0),e([r()],p.prototype,`orderByFields`,null),e([r()],p.prototype,`originHasValidKey`,null),e([r()],p.prototype,`relationship`,null),e([r()],p.prototype,`relationshipId`,null),e([r()],p.prototype,`relatedFeatureInfos`,null),e([r()],p.prototype,`relatedLayer`,null),e([r()],p.prototype,`relatedLayerIsTable`,null),e([r({readOnly:!0})],p.prototype,`single`,void 0),e([r()],p.prototype,`showAllEnabled`,null),e([r()],p.prototype,`showAllActionVisible`,null),e([r()],p.prototype,`showAllCategories`,null),e([r()],p.prototype,`showAllCategoriesVisible`,null),e([r()],p.prototype,`showAllRelatedRecords`,null),e([r({readOnly:!0})],p.prototype,`type`,void 0),e([r()],p.prototype,`updating`,null),e([r()],p.prototype,`_relatedLayerAllowsAdds`,null),e([r()],p.prototype,`_relatedLayerAllowsEdits`,null),p=e([i(`esri.widgets.BatchAttributeForm.inputs.RelationshipElementInput`)],p);const m=p;export{m as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/ReactiveMap.js";import{renderingSanitizer as
|
|
2
|
+
import{__decorate as e}from"tslib";import{getOrCreateMapValue as t}from"../../core/MapUtils.js";import n from"../../core/ReactiveMap.js";import{renderingSanitizer as r}from"../../core/sanitizerUtils.js";import{property as i,subclass as a}from"../../core/accessorSupport/decorators.js";import{isSupportedImage as o,getCalciteIconForAttachment as s}from"../Attachments/support/attachmentUtils.js";import c from"./Grid/Column.js";import{css as l}from"./Grid/ColumnCSS.js";const u=`esri-attachments-column`,d={contentContainer:`${u}__content`,showAttachmentsButton:`${u}__button`};let f=class extends c{constructor(e){super(e),this._buttonElements=new n,this._thumbnailElements=new n,this.attachmentsViewEnabled=!0,this.cellValueFormatFunction=({root:e,rowData:t})=>{let{_showAttachmentsViewEnabled:n,formatFunction:r}=this,i=this.getCellValue(t);if(r&&t){let{index:n,item:{attachments:a,feature:o,relatedRecords:s}}=t;return r({attachments:a,column:this,feature:o,index:n,relatedRecords:s,value:i,virtualIndex:this.getVirtualRowIndex(e),field:void 0})}if(!t)return i;let{index:a,item:{attachments:o,objectId:s}}=t,c=`(${i})`;if(!this.thumbnailsEnabled&&!n)return i;let l=document.createElement(`span`);l.textContent=l.title=c;let u=null;if(this.thumbnailsEnabled&&(u=this._createOrSyncThumbnails(s,o??[])),this._showAttachmentsViewEnabled){let e=document.createElement(`div`);u&&e.appendChild(u),e.appendChild(l);let t=this._createOrSyncShowAttachmentsButton(s,a);return t.appendChild(e),t}let f=document.createElement(`div`);return f.classList.add(d.contentContainer),u&&f.appendChild(u),f.appendChild(l),f},this.icon=`attachment`,this.layer=null,this.onShowAttachments=null,this.sortable=!1,this.store=null,this.textAlign=`center`,this.thumbnailAppearance=`image`,this.thumbnailCount=8,this.thumbnailIconScale=`m`,this.thumbnailsEnabled=!0}get _showAttachmentsViewEnabled(){return!!(this.attachmentsViewEnabled&&this.onShowAttachments)}get _supportsResize(){return this.store.supportsResizeAttachments}get effectiveLabel(){return r.sanitize(this.label??(this.messages?.attachments||this.fieldName))}getCellValue(e){return e?.item?.attachments?.length??0}_createOrSyncThumbnails(e,n){let r=document.createElement(`div`),i=t(this._thumbnailElements,e,()=>new WeakMap),a=Math.min(this.thumbnailCount,n.length);return n.slice(0,a).forEach(e=>{let t=i.get(e);t?r.appendChild(t):this._createThumbnailElement(e,i,r)}),r}_createOrSyncShowAttachmentsButton(e,t){let n=this._buttonElements.get(e);if(n)return n.textContent=``,n.onclick=n=>this._onShowAttachmentsClick({index:t,objectId:e,event:n}),n;let r=this.createCalciteButton({alignment:`icon-end-space-between`,className:`${d.showAttachmentsButton} ${l.contentFull}`,iconEnd:`chevron-right`,iconFlipRtl:`both`,scale:this.thumbnailIconScale,textContent:``,title:this.messages?.viewAttachments,width:`full`,onclick:n=>this._onShowAttachmentsClick({index:t,objectId:e,event:n})});return this._buttonElements.set(e,r),r}_createThumbnailAnchor({name:e,url:t},n){let r=document.createElement(`a`);return r.href=`${t}`,r.download=e,r.rel=`noreferrer`,r.target=`_blank`,r.appendChild(n),r}_createThumbnailElement(e,t,n){let{thumbnailAppearance:r,thumbnailIconScale:i}=this,a=!this.onShowAttachments,c=r===`image`&&this.store.supportsResizeAttachments,{name:l,contentType:u}=e,d=o(u)&&c?this._createThumbnailImage(e):this.createCalciteIcon({icon:s(u),scale:i,textLabel:l}),f=a?this._createThumbnailAnchor(e,d):d;n&&n.appendChild(f),t.set(e,f)}_createThumbnailImage(e){let{name:t,size:n,url:r}=e,i=document.createElement(`img`),a=`${r}${r?.includes(`?`)?`&`:`?`}${this._supportsResize?`w=24`:``}&fs=${n}`;return i.alt=this.messages?.attachmentThumbnail??t,i.src=a,i.title=t,i}_onShowAttachmentsClick({index:e,objectId:t,event:n}){n.preventDefault(),n.stopPropagation(),this.onShowAttachments?.({index:e,objectId:t})}};e([i()],f.prototype,`_showAttachmentsViewEnabled`,null),e([i()],f.prototype,`_buttonElements`,void 0),e([i()],f.prototype,`_supportsResize`,null),e([i()],f.prototype,`_thumbnailElements`,void 0),e([i()],f.prototype,`attachmentsViewEnabled`,void 0),e([i()],f.prototype,`cellValueFormatFunction`,void 0),e([i()],f.prototype,`effectiveLabel`,null),e([i()],f.prototype,`icon`,void 0),e([i()],f.prototype,`layer`,void 0),e([i()],f.prototype,`onShowAttachments`,void 0),e([i({readOnly:!0})],f.prototype,`sortable`,void 0),e([i()],f.prototype,`store`,void 0),e([i()],f.prototype,`textAlign`,void 0),e([i()],f.prototype,`thumbnailAppearance`,void 0),e([i()],f.prototype,`thumbnailCount`,void 0),e([i()],f.prototype,`thumbnailIconScale`,void 0),e([i()],f.prototype,`thumbnailsEnabled`,void 0),f=e([a(`esri.widgets.FeatureTable.AttachmentsColumn`)],f);const p=f;export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{substitute as r}from"../../intl/substitute.js";import i from"./Grid/Column.js";import{css as a}from"./Grid/ColumnCSS.js";import{isIFeatureTableSupportedLayerWithRelationships as o,findRelationship as s}from"./support/tableUtils.js";const c={showRecordsButton:`esri-column__show-related-records-button`};let l=class extends i{constructor(e){super(e),this.flexGrow=1,this.icon=`relationship-class`,this.layer=null,this.relatedLayer=null,this.relationshipId=null,this.renderFunction=({root:e,rowData:t})=>{if(!t)return;let n=t.item,{layer:i,relatedLayer:s}=this;if(!n?.feature||!o(i)||!o(s))return;let{messages:l}=this,{index:u}=t,{feature:d,objectId:f}=n,{collapsed:p,showRelatedTableCallback:m,relationshipId:h}=this,g=n.relatedRecords?.find(e=>e.relationshipId===h)?.count??0,_=!p&&m&&l?.recordsCount?r(l.recordsCount,{count:g}):`${g}`,v=e=>{e.preventDefault(),p||this.showRelatedTableCallback?.({feature:d,index:u,layer:i,objectId:f,relatedLayer:s,relationshipId:h})},y=p?void 0:`chevron-right`;if(e.firstChild){let t=e.firstChild;t.textContent=_,t.onclick=v,y&&(t.iconEnd=y);return}let b=this.createCalciteButton({className:`${c.showRecordsButton} ${a.contentFull}`,iconEnd:y,iconFlipRtl:`both`,scale:`m`,textContent:_,title:_,onclick:v});this.removeCellContent(e),e.appendChild(b)},this.resizable=!0,this.showRelatedTableCallback=null,this.textAlign=`center`,this.width=`200px`}get _relationshipLabel(){return this.label||this.originRelationship?.name||this.layer.title||``}get collapsed(){return this._get(`collapsed`)||!1}set collapsed(e){e?this.set({flexGrow:0,resizable:!1,width:`80px`}):this.set({flexGrow:1,resizable:!0,width:`200px`}),this._set(`collapsed`,e)}get effectiveLabel(){return this.collapsed?``:this._relationshipLabel}get iconNode(){let{icon:e}=this;return e?this.createCalciteIcon({icon:e,textLabel:this._relationshipLabel}):null}get originRelationship(){let e=this.relationshipId;return this.relatedLayer.relationships?.find(({id:t})=>t===e)}get relationship(){return s(this.layer,this.relationshipId)}};e([t()],l.prototype,`_relationshipLabel`,null),e([t()],l.prototype,`collapsed`,null),e([t()],l.prototype,`effectiveLabel`,null),e([t()],l.prototype,`flexGrow`,void 0),e([t()],l.prototype,`icon`,void 0),e([t()],l.prototype,`iconNode`,null),e([t()],l.prototype,`layer`,void 0),e([t()],l.prototype,`originRelationship`,null),e([t()],l.prototype,`relatedLayer`,void 0),e([t()],l.prototype,`relationship`,null),e([t()],l.prototype,`relationshipId`,void 0),e([t()],l.prototype,`renderFunction`,void 0),e([t()],l.prototype,`resizable`,void 0),e([t()],l.prototype,`showRelatedTableCallback`,void 0),e([t()],l.prototype,`textAlign`,void 0),e([t()],l.prototype,`width`,void 0),l=e([n(`esri.widgets.FeatureTable.RelationshipColumn`)],l);const u=l;export{u as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../core/accessorSupport/decorators.js";import{substitute as r}from"../../intl/substitute.js";import i from"./Grid/Column.js";import{css as a}from"./Grid/ColumnCSS.js";import{isIFeatureTableSupportedLayerWithRelationships as o,findRelationship as s}from"./support/tableUtils.js";const c={showRecordsButton:`esri-column__show-related-records-button`};let l=class extends i{constructor(e){super(e),this.flexGrow=1,this.icon=`relationship-class`,this.layer=null,this.relatedLayer=null,this.relationshipId=null,this.renderFunction=({root:e,rowData:t})=>{if(!t)return;let n=t.item,{layer:i,relatedLayer:s}=this;if(!n?.feature||!o(i)||!o(s))return;let{messages:l}=this,{index:u}=t,{feature:d,objectId:f}=n,{collapsed:p,showRelatedTableCallback:m,relationshipId:h}=this,g=n.relatedRecords?.find(e=>e.relationshipId===h)?.count??0,_=!p&&m&&l?.recordsCount?r(l.recordsCount,{count:g}):`${g}`,v=e=>{e.preventDefault(),p||this.showRelatedTableCallback?.({feature:d,index:u,layer:i,objectId:f,relatedLayer:s,relationshipId:h})},y=p?void 0:`chevron-right`;if(e.firstChild){let t=e.firstChild;t.textContent=_,t.title=_,t.onclick=v,y&&(t.iconEnd=y);return}let b=this.createCalciteButton({className:`${c.showRecordsButton} ${a.contentFull}`,iconEnd:y,iconFlipRtl:`both`,scale:`m`,textContent:_,title:_,onclick:v});this.removeCellContent(e),e.appendChild(b)},this.resizable=!0,this.showRelatedTableCallback=null,this.textAlign=`center`,this.width=`200px`}get _relationshipLabel(){return this.label||this.originRelationship?.name||this.layer.title||``}get collapsed(){return this._get(`collapsed`)||!1}set collapsed(e){e?this.set({flexGrow:0,resizable:!1,width:`80px`}):this.set({flexGrow:1,resizable:!0,width:`200px`}),this._set(`collapsed`,e)}get effectiveLabel(){return this.collapsed?``:this._relationshipLabel}get iconNode(){let{icon:e}=this;return e?this.createCalciteIcon({icon:e,textLabel:this._relationshipLabel}):null}get originRelationship(){let e=this.relationshipId;return this.relatedLayer.relationships?.find(({id:t})=>t===e)}get relationship(){return s(this.layer,this.relationshipId)}};e([t()],l.prototype,`_relationshipLabel`,null),e([t()],l.prototype,`collapsed`,null),e([t()],l.prototype,`effectiveLabel`,null),e([t()],l.prototype,`flexGrow`,void 0),e([t()],l.prototype,`icon`,void 0),e([t()],l.prototype,`iconNode`,null),e([t()],l.prototype,`layer`,void 0),e([t()],l.prototype,`originRelationship`,null),e([t()],l.prototype,`relatedLayer`,void 0),e([t()],l.prototype,`relationship`,null),e([t()],l.prototype,`relationshipId`,void 0),e([t()],l.prototype,`renderFunction`,void 0),e([t()],l.prototype,`resizable`,void 0),e([t()],l.prototype,`showRelatedTableCallback`,void 0),e([t()],l.prototype,`textAlign`,void 0),e([t()],l.prototype,`width`,void 0),l=e([n(`esri.widgets.FeatureTable.RelationshipColumn`)],l);const u=l;export{u as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{createRotationMatrixFromHPR as e}from"../../layers/orientedImagery/transformations/rotationUtils.js";function t(e){return e>0?[-e,0,e]:[0]}function n(n,r,i){let{cameraPitch:a,cameraRoll:o,cameraLocation:s}=n,{x:c,y:l,z:u,spatialReference:d}=s;if(r.every(e=>e===0)||!r||!r.length||!d)throw Error(`Invalid parameters`);let[f,p,m,h,g]=r,_=t(m),v=t(h),y=t(g),b=t(f),x=t(p),S=[];for(let t of v)for(let r of y)for(let s of b)for(let f of
|
|
2
|
+
import{createRotationMatrixFromHPR as e}from"../../layers/orientedImagery/transformations/rotationUtils.js";function t(e){return e>0?[-e,0,e]:[0]}function n(n,r,i){let{cameraPitch:a,cameraRoll:o,cameraLocation:s}=n,{x:c,y:l,z:u,spatialReference:d}=s;if(r.every(e=>e===0)||!r||!r.length||!d)throw Error(`Invalid parameters`);let[f,p,m,h,g]=r,_=t(m),v=t(h),y=t(g),b=t(f),x=t(p),S=[];for(let t of v)for(let r of y)for(let s of b)for(let f of x)for(let p of _){let m={...n};m.cameraPitch=a+t,m.cameraRoll=o+r,m.rotationMatrix=e([i+p,m.cameraPitch,m.cameraRoll]),m.cameraLocation={x:c+s,y:l+s,z:u?u+f:0,spatialReference:{wkid:d.wkid}},S.push(m)}return S}function r(e,n){let{cameraHeading:r,cameraLocation:i}=e,{x:a,y:o,z:s,spatialReference:c}=i;if(!n||n.every(e=>e===0)||!n.length||!c)throw Error(`Invalid parameters`);let[l,u,d]=n,f=t(d),p=t(l),m=t(u),h=[];for(let t of f)for(let n of p)for(let i of m){let l={...e};l.cameraHeading=r+t,l.cameraLocation={x:a+n,y:o+n,z:s?s+i:0,spatialReference:{wkid:c.wkid}},h.push(l)}return h}export{n as generateCombinations,r as generateCombinationsPanoramic};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type Layer from "../../../layers/Layer.js";
|
|
2
|
-
import type SubtypeSublayer from "../../../layers/support/SubtypeSublayer.js";
|
|
3
2
|
import type ItemBase from "./ItemBase.js";
|
|
3
|
+
import type { SelectableSublayerUnion } from "../../../views/selection/types.js";
|
|
4
4
|
import type { ItemBaseProperties } from "./ItemBase.js";
|
|
5
|
-
import type { ParentItem,
|
|
5
|
+
import type { ParentItem, SelectionListParentLayerUnion, SyncOptions } from "./types.js";
|
|
6
6
|
|
|
7
7
|
/** Properties used to construct a GroupLayerItem instance. */
|
|
8
8
|
export interface GroupLayerItemProperties extends ItemBaseProperties, Partial<Pick<GroupLayerItem, "expanded">> {
|
|
9
9
|
/** Layer containing the sublayer that contains the selected features. */
|
|
10
|
-
layer?:
|
|
10
|
+
layer?: SelectionListParentLayerUnion;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/** Required properties used to construct a GroupLayerItem instance. */
|
|
@@ -31,7 +31,7 @@ export default class GroupLayerItem extends ItemBase {
|
|
|
31
31
|
/** Set of child layer items. Can also be another GroupLayerItem in the case of [SubtypeGroupLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SubtypeGroupLayer/) or [KnowledgeGraphLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/KnowledgeGraphLayer/). */
|
|
32
32
|
get items(): ParentItem[];
|
|
33
33
|
/** Layer containing the sublayer that contains the selected features. */
|
|
34
|
-
get layer():
|
|
34
|
+
get layer(): SelectionListParentLayerUnion;
|
|
35
35
|
/**
|
|
36
36
|
* Indicates the layer and at least one of its child layers are visible on the map.
|
|
37
37
|
*
|
|
@@ -39,7 +39,7 @@ export default class GroupLayerItem extends ItemBase {
|
|
|
39
39
|
*/
|
|
40
40
|
get layerIsVisible(): boolean;
|
|
41
41
|
/** Convenience property for all child layers and tables on the parent group layer. */
|
|
42
|
-
get layers(): Layer[] |
|
|
42
|
+
get layers(): Layer[] | SelectableSublayerUnion[] | SelectionListParentLayerUnion[];
|
|
43
43
|
/**
|
|
44
44
|
* Indicates this group item contains at least one [layer item](https://developers.arcgis.com/javascript/latest/references/core/widgets/support/SelectionList/LayerItem/) that is displaying a
|
|
45
45
|
* subset of selected features due to an upper maximum limit.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"./ItemBase.js";let i=class extends r{constructor(e){super(e),this._items=[],this.expanded=!0,this.layer=null}get isTable(){return this.items.some(e=>e.isTable)}get items(){return this._items}get layerIsVisible(){return this.items.some(e=>e.layerIsVisible)}get layers(){let{layer:e}=this;
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"./ItemBase.js";let i=class extends r{constructor(e){super(e),this._items=[],this.expanded=!0,this.layer=null}get isTable(){return this.items.some(e=>e.isTable)}get items(){return this._items}get layerIsVisible(){return this.items.some(e=>e.layerIsVisible)}get layers(){let{layer:e}=this;if(e.type===`group`||e.type===`knowledge-graph`)return e.layers.toArray().reverse();if(e.type===`subtype-group`)return e.sublayers.toArray().reverse();if(e.type===`map-image`){let t=e.sublayers?.toArray().reverse()??[],n=e.subtables?.toArray().reverse()??[];return[...t,...n]}return e.type===`map-notes`?e.sublayers?.toArray().reverse()??[]:[]}get maxVisibleFeatureCountExceeded(){return this.items.some(e=>e.maxVisibleFeatureCountExceeded)}get total(){return this.items.reduce((e,t)=>e+t.total,0)}get visible(){return this.items.some(e=>e.visible)}get visibleTotal(){return this.items.reduce((e,t)=>e+t.visibleTotal,0)}reset(){this.items.forEach(e=>e.reset())}async sync({controller:e,promises:t}){let{layers:n,viewModel:r}=this;this._items=await r.layersToItems({controller:e,groupLayerItem:this,layers:n,promises:t})}};e([t()],i.prototype,`_items`,void 0),e([t()],i.prototype,`expanded`,void 0),e([t()],i.prototype,`isTable`,null),e([t()],i.prototype,`items`,null),e([t({constructOnly:!0})],i.prototype,`layer`,void 0),e([t()],i.prototype,`layerIsVisible`,null),e([t()],i.prototype,`layers`,null),e([t()],i.prototype,`maxVisibleFeatureCountExceeded`,null),e([t()],i.prototype,`total`,null),e([t()],i.prototype,`visible`,null),e([t()],i.prototype,`visibleTotal`,null),i=e([n(`esri.widgets.support.SelectionList.GroupLayerItem`)],i);const a=i;export{a as default};
|
|
@@ -2,12 +2,12 @@ import type Accessor from "../../../core/Accessor.js";
|
|
|
2
2
|
import type SelectionListViewModel from "./SelectionListViewModel.js";
|
|
3
3
|
import type { Icon } from "@esri/calcite-components/components/calcite-icon";
|
|
4
4
|
import type { SelectableLayer, SelectableLayerView, SelectableViewUnion } from "../../../views/selection/types.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { SelectionListParentLayerUnion } from "./types.js";
|
|
6
6
|
|
|
7
7
|
/** Properties used to construct an ItemBase instance. */
|
|
8
8
|
export interface ItemBaseProperties extends Partial<Pick<ItemBase, "viewModel">> {
|
|
9
9
|
/** Layer associated with the item. */
|
|
10
|
-
layer?: SelectableLayer |
|
|
10
|
+
layer?: SelectableLayer | SelectionListParentLayerUnion;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -24,7 +24,7 @@ export default class ItemBase extends Accessor {
|
|
|
24
24
|
/** Unique identifier used for the item. */
|
|
25
25
|
get key(): string;
|
|
26
26
|
/** Layer associated with the item. */
|
|
27
|
-
get layer(): SelectableLayer |
|
|
27
|
+
get layer(): SelectableLayer | SelectionListParentLayerUnion;
|
|
28
28
|
/** Indicates the layer and its selected features are visible on the map. */
|
|
29
29
|
get layerIsVisible(): boolean;
|
|
30
30
|
/** Companion layer view of the associated layer. */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{countIf as t,addMany as n,isSome as r}from"../../../core/arrayUtils.js";import i from"../../../core/ReactiveMap.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{getDisplayFieldNameFromFields as s}from"../../../layers/support/fieldUtils.js";import{isSelectableLayerWithObjectIds as c,isSelectableLayerViewWithObjectIds as l}from"../../../views/support/selectionUtils.js";import u from"./FeatureItem.js";import d from"./ItemBase.js";import{getSuggestedQueryOutFields as f}from"../Selector2D/selectorUtils.js";let p=class extends d{constructor(e){super(e),this._onChangeController=null,this.expanded=!0,this.featureItems=[],this.featureTitleMap=new i,this.groupLayerItem=null,this.layer=null}get effectiveObjectIds(){return this.objectIds.slice(0,this.maxVisibleFeatureCountPerLayer)}get effectiveSelection(){return this.selection.slice(0,this.maxVisibleFeatureCountPerLayer)}get maxVisibleFeatureCountExceeded(){let{viewModel:e}=this;return this.selection.length>e.maxVisibleFeatureCountPerLayer&&this.visibleTotal===e.maxVisibleFeatureCountPerLayer}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}get objectIds(){let e=this.layer;return c(e)?this.selection:[]}get selection(){return this.viewModel.effectiveSelectionManager?.getSelection(this.layer)??[]}get total(){return this.selection.length}get visible(){return this.featureItems.some(e=>e.visible)}get visibleTotal(){return t(this.featureItems,e=>e.visible)}cancel(){this._onChangeController?.abort()}reset(){this.featureItems.forEach(e=>e.destroy()),this.featureItems=[]}async sync({controller:e,promises:t}){let{effectiveSelection:i,layer:a}=this;this.cancel();let o=new Map(this.featureItems.map(e=>[e.identifier,e])),s=new Map,l=[],u=[];for(let e of i){let t=o.get(e);t?s.set(e,t):(l.push(e),s.set(e,null))}if(this._onChangeController=e,l.length>0){c(a)?n(u,await this._createFeatureItemsFromIds(a,l,e)):n(u,this._createFeatureItemsFromGraphics(l));for(let e of u)e.identifier!=null&&s.set(e.identifier,e)}e.signal.aborted||(this.featureItems=Array.from(s.values()).filter(r),t.push(this.syncTitles(u)))}async syncTitles(e){let{layer:t}=this,n=(e??this.featureItems).map(e=>e.graphic);if(`getFeatureTitles`in t&&t.getFeatureTitles)(await t.getFeatureTitles(n,{fetchMissingFields:!0,removeHTML:!0})).forEach((e,t)=>this.featureTitleMap.set(t,e));else if(c(t)){let e=t.displayField||s(t.fields);e&&n.forEach(t=>{let n=t.getObjectId(),r=t.attributes[e];n!=null&&r&&this.featureTitleMap.set(n,r)})}}_createFeatureItemsFromGraphics(e){let{layer:t,viewModel:n}=this;return e.map(e=>new u({graphic:e,layer:t,layerItem:this,viewModel:n}))}async _createFeatureItemsFromIds(e,t,n){let{layerView:r,viewModel:i}=this,a=new Map;if(l(r)){let e=r.createQuery();e.objectIds=t,e.outFields=[`*`],e.returnGeometry=!0;let i=await r.queryFeatures(e,n);for(let e of i.features){let t=e.getObjectId();t!=null&&a.set(t,e)}}if(n.signal.aborted)return[];let o=t.filter(e=>!a.has(e));if(o.length){let{view:t}=this,r=e.createQuery();r.objectIds=o,r.outSpatialReference=t?.spatialReference,r.outFields=t?f(e,t,!0):[`*`],r.returnGeometry=!0;let i=await e.queryFeatures(r,n);for(let e of i.features){let t=e.getObjectId();t!=null&&a.set(t,e)}}return Array.from(a.values()).map(t=>new u({graphic:t,layer:e,layerItem:this,viewModel:i}))}};e([a()],p.prototype,`_onChangeController`,void 0),e([a()],p.prototype,`effectiveObjectIds`,null),e([a()],p.prototype,`effectiveSelection`,null),e([a()],p.prototype,`expanded`,void 0),e([a()],p.prototype,`featureItems`,void 0),e([a()],p.prototype,`featureTitleMap`,void 0),e([a()],p.prototype,`groupLayerItem`,void 0),e([a({constructOnly:!0})],p.prototype,`layer`,void 0),e([a()],p.prototype,`maxVisibleFeatureCountExceeded`,null),e([a()],p.prototype,`maxVisibleFeatureCountPerLayer`,null),e([a()],p.prototype,`objectIds`,null),e([a()],p.prototype,`selection`,null),e([a()],p.prototype,`total`,null),e([a()],p.prototype,`visible`,null),e([a()],p.prototype,`visibleTotal`,null),p=e([o(`esri.widgets.support.SelectionList.LayerItem`)],p);const m=p;export{m as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{countIf as t,addMany as n,isSome as r}from"../../../core/arrayUtils.js";import i from"../../../core/ReactiveMap.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{getDisplayFieldNameFromFields as s}from"../../../layers/support/fieldUtils.js";import{isSelectableLayerWithObjectIds as c,isSelectableLayerViewWithObjectIds as l}from"../../../views/support/selectionUtils.js";import u from"./FeatureItem.js";import d from"./ItemBase.js";import{getSuggestedQueryOutFields as f}from"../Selector2D/selectorUtils.js";let p=class extends d{constructor(e){super(e),this._onChangeController=null,this.expanded=!0,this.featureItems=[],this.featureTitleMap=new i,this.groupLayerItem=null,this.layer=null}get effectiveObjectIds(){return this.objectIds.slice(0,this.maxVisibleFeatureCountPerLayer)}get effectiveSelection(){return this.selection.slice(0,this.maxVisibleFeatureCountPerLayer)}get maxVisibleFeatureCountExceeded(){let{viewModel:e}=this;return this.selection.length>e.maxVisibleFeatureCountPerLayer&&this.visibleTotal===e.maxVisibleFeatureCountPerLayer}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}get objectIds(){let e=this.layer;return c(e)?this.selection:[]}get selection(){return this.viewModel.effectiveSelectionManager?.getSelection(this.layer)??[]}get total(){return this.selection.length}get visible(){return this.featureItems.some(e=>e.visible)}get visibleTotal(){return t(this.featureItems,e=>e.visible)}cancel(){this._onChangeController?.abort()}reset(){this.featureItems.forEach(e=>e.destroy()),this.featureItems=[]}async sync({controller:e,promises:t}){let{effectiveSelection:i,layer:a}=this;this.cancel();let o=new Map(this.featureItems.map(e=>[e.identifier,e])),s=new Map,l=[],u=[];for(let e of i){let t=o.get(e);t?s.set(e,t):(l.push(e),s.set(e,null))}if(this._onChangeController=e,l.length>0){c(a)?n(u,await this._createFeatureItemsFromIds(a,l,e)):n(u,this._createFeatureItemsFromGraphics(l));for(let e of u)e.identifier!=null&&s.set(e.identifier,e)}e.signal.aborted||(this.featureItems=Array.from(s.values()).filter(r),t.push(this.syncTitles(u)))}async syncTitles(e){let{layer:t}=this,n=(e??this.featureItems).map(e=>e.graphic);if(`getFeatureTitles`in t&&t.getFeatureTitles)(await t.getFeatureTitles(n,{fetchMissingFields:!0,removeHTML:!0})).forEach((e,t)=>this.featureTitleMap.set(t,e));else if(c(t)){let e=t.displayField||s(t.fields);e&&n.forEach(t=>{let n=t.getObjectId(),r=t.attributes[e];n!=null&&r&&this.featureTitleMap.set(n,r)})}}_createFeatureItemsFromGraphics(e){let{layer:t,viewModel:n}=this;return e.map(e=>new u({graphic:e,layer:t,layerItem:this,viewModel:n}))}async _createFeatureItemsFromIds(e,t,n){let{layerView:r,viewModel:i}=this,a=new Map;if(await e.load(),l(r)){let e=r.createQuery();e.objectIds=t,e.outFields=[`*`],e.returnGeometry=!0;let i=await r.queryFeatures(e,n);for(let e of i.features){let t=e.getObjectId();t!=null&&a.set(t,e)}}if(n.signal.aborted)return[];let o=t.filter(e=>!a.has(e));if(o.length){let{view:t}=this,r=e.createQuery();r.objectIds=o,r.outSpatialReference=t?.spatialReference,r.outFields=t?f(e,t,!0):[`*`],r.returnGeometry=!0;let i=await e.queryFeatures(r,n);for(let e of i.features){let t=e.getObjectId();t!=null&&a.set(t,e)}}return Array.from(a.values()).map(t=>new u({graphic:t,layer:e,layerItem:this,viewModel:i}))}};e([a()],p.prototype,`_onChangeController`,void 0),e([a()],p.prototype,`effectiveObjectIds`,null),e([a()],p.prototype,`effectiveSelection`,null),e([a()],p.prototype,`expanded`,void 0),e([a()],p.prototype,`featureItems`,void 0),e([a()],p.prototype,`featureTitleMap`,void 0),e([a()],p.prototype,`groupLayerItem`,void 0),e([a({constructOnly:!0})],p.prototype,`layer`,void 0),e([a()],p.prototype,`maxVisibleFeatureCountExceeded`,null),e([a()],p.prototype,`maxVisibleFeatureCountPerLayer`,null),e([a()],p.prototype,`objectIds`,null),e([a()],p.prototype,`selection`,null),e([a()],p.prototype,`total`,null),e([a()],p.prototype,`visible`,null),e([a()],p.prototype,`visibleTotal`,null),p=e([o(`esri.widgets.support.SelectionList.LayerItem`)],p);const m=p;export{m as default};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type Layer from "../../../layers/Layer.js";
|
|
2
2
|
import type Accessor from "../../../core/Accessor.js";
|
|
3
|
-
import type SubtypeSublayer from "../../../layers/support/SubtypeSublayer.js";
|
|
4
3
|
import type SelectionManager from "../../../views/SelectionManager.js";
|
|
5
4
|
import type FeatureItem from "./FeatureItem.js";
|
|
6
5
|
import type GroupLayerItem from "./GroupLayerItem.js";
|
|
7
6
|
import type LayerItem from "./LayerItem.js";
|
|
8
|
-
import type { SelectableLayer, SelectableLayerView, SelectableViewUnion, SelectionIdentifier } from "../../../views/selection/types.js";
|
|
9
|
-
import type { ListItem, ParentItem,
|
|
7
|
+
import type { SelectableLayer, SelectableLayerView, SelectableSublayerUnion, SelectableViewUnion, SelectionIdentifier } from "../../../views/selection/types.js";
|
|
8
|
+
import type { ListItem, ParentItem, SelectionListParentLayerUnion, State } from "./types.js";
|
|
10
9
|
|
|
11
10
|
/** @internal */
|
|
12
11
|
export interface SelectionListViewModelProperties extends Partial<Pick<SelectionListViewModel, "filterText" | "layer" | "maxVisibleFeatureCountPerLayer" | "selectionManager" | "view">> {}
|
|
@@ -210,7 +209,7 @@ export default class SelectionListViewModel extends Accessor {
|
|
|
210
209
|
* @returns The parent item associated with the provided layer, or null if not found.
|
|
211
210
|
* @internal
|
|
212
211
|
*/
|
|
213
|
-
findParentItem(layer: SelectableLayer |
|
|
212
|
+
findParentItem(layer: SelectableLayer | SelectionListParentLayerUnion): ParentItem | null | undefined;
|
|
214
213
|
/**
|
|
215
214
|
* Repositions the view to center based on the chosen item.
|
|
216
215
|
*
|
|
@@ -232,8 +231,8 @@ export default class SelectionListViewModel extends Accessor {
|
|
|
232
231
|
controller: AbortController;
|
|
233
232
|
promises: Promise<void>[];
|
|
234
233
|
groupLayerItem?: GroupLayerItem | null | undefined;
|
|
235
|
-
layers?: Layer[] |
|
|
236
|
-
}): ParentItem[]
|
|
234
|
+
layers?: Layer[] | SelectableSublayerUnion[] | SelectionListParentLayerUnion[];
|
|
235
|
+
}): Promise<ParentItem[]>;
|
|
237
236
|
/**
|
|
238
237
|
* Removes specific features from the selection, based on the provided
|
|
239
238
|
* layer and object IDs.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import n from"../../../core/Collection.js";import r from"../../../core/Logger.js";import{removeMaybe as i,abortMaybe as a}from"../../../core/maybe.js";import{ignoreAbortErrors as o,debounce as s,whenOrTimeout as c}from"../../../core/promiseUtils.js";import{watch as l,on as u,sync as d,whenOnce as f}from"../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as h}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as g,isGroupLayer as _,isSubtypeSublayer as v}from"../../../layers/support/layerUtils.js";import{isSelectableLayerViewWithHighlights as y,isSelectableLayerWithObjectIds as b,isSelectableLayerWithGraphics as x,isSelectableLayer as S,isSelectableLayerBaseWithEditing as C}from"../../../views/support/selectionUtils.js";import{goTo as w}from"../goToUtils.js";import T from"./GroupLayerItem.js";import E from"./LayerItem.js";import{computeEffectiveCount as D,getNestedLayerItems as O,isLayerItem as k,isGroupLayerItem as A,getNestedFeatureItems as j}from"./selectionListUtils.js";let M=class extends t{constructor(e){super(e),this._allLayerItems=null,this._groupItemCache=new Map,this._hoverHighlightHandle=null,this._layerEditAbortControllers=new Map,this._layerEditHandles=new n,this._layerItemCache=new Map,this._onChangeAbortController=null,this._updatingHandles=new h,this.filterText=void 0,this.layer=null,this.maxVisibleFeatureCountPerLayer=500,this.selectionManager=null,this._onSelectionChangeController=async()=>{this._cancelOnSelectionChange();let e=new AbortController;this._onChangeAbortController=e,await this._updatingHandles.addPromise(o(this._generateListItems(e))),this._onChangeAbortController===e&&(this._onChangeAbortController=null),(this.layer&&this.effectiveSelectionManager?.getSelection(this.layer))?.length||(this.layer=null)},this._cancelOnSelectionChange=()=>this._onChangeAbortController?.abort(),this._onSelectionChangeDebounced=s(this._onSelectionChangeController,100),this._cancelOnLayerEdit=e=>this._layerEditAbortControllers.get(e)?.abort()}initialize(){this.addHandles([l(()=>[this.view,this.effectiveSelectionManager,...this._sources],()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),u(()=>this.effectiveSelectionManager?.sources,`change`,()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),u(()=>this.effectiveSelectionManager,`selection-change`,e=>{this._onSelectionManagerSelectionChange(e),this._onSelectionChange()},d)])}destroy(){this._cancelOnSelectionChange(),this.removeTemporaryHighlight(),this._updatingHandles.destroy(),this._layerEditHandles.drain(i),this._layerEditAbortControllers.forEach(a)}get _sources(){return this.effectiveSelectionManager?.sources.toArray()??[]}get activeLayerItem(){let{layer:e}=this;return e&&this.findLayerItem(e)}get allLayerItems(){return this._allLayerItems??[]}get effectiveCount(){return D(this.allLayerItems)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get isUpdating(){return!!(this._onChangeAbortController||this._updatingHandles.updating)}get layerItems(){return O(this.allLayerItems)}get layerViewMap(){let e=new Map,{view:t}=this;if(!t)return e;for(let n of t.allLayerViews)if(e.set(n.layer.id,n),g(n.layer))for(let t of n.layer.sublayers)e.set(t.id,n);return e}get maxVisibleFeatureCountExceeded(){return this.allLayerItems.some(e=>e.maxVisibleFeatureCountExceeded)}get state(){let{view:e}=this;return e?e.ready?this.effectiveSelectionManager?`ready`:`error`:`loading`:`disabled`}get viewLayersAndTables(){let{view:e}=this;return e?.map?[...e.map.layers.toArray().reverse(),...e.map.tables.toArray().reverse()]:[]}get visibleFeatureCount(){return this.activeLayerItem?.visibleTotal??this.visibleFeatureItems.length}get visibleFeatureItems(){return this.layerItems.flatMap(e=>e.featureItems.filter(e=>e.visible))}get visibleLayerCount(){let{effectiveSelectionManager:e}=this;return!e||e.count===0?0:e.count===1||this.activeLayerItem?1:this.layerItems.filter(e=>e.visible).length}addTemporaryHighlight(e){let{graphic:t,layerView:n}=e;this.removeTemporaryHighlight(),n&&t&&y(n)&&(this._hoverHighlightHandle=n.highlight(t,{name:`temporary`}))}collapseAll(){this._allLayerItems?.forEach(e=>e.expanded=!1)}clear(){this.effectiveSelectionManager?.clear()}deselectFeatureItem(e){let{layer:t,graphic:n,objectId:r}=e;b(t)&&r!=null?this.effectiveSelectionManager?.remove(t,[r]):x(t)&&this.effectiveSelectionManager?.remove(t,[n])}deselectGroupItem(e){e.items.forEach(e=>{k(e)?this.deselectLayerItem(e):this.deselectGroupItem(e)})}deselectLayerItem(e){let{layer:t}=e;this.replace({layer:t,selection:[]})}deselectItem(e){A(e)?this.deselectGroupItem(e):k(e)?this.deselectLayerItem(e):this.deselectFeatureItem(e)}expandAll(){this._allLayerItems?.forEach(e=>e.expanded=!0)}findLayerItem(e){return this.layerItems.find(t=>t.layer===e)}findParentItem(e){return this.allLayerItems.find(t=>t.layer===e)}goToItem(e){e.isTable||(k(e)||A(e)?this._goTo(j([e]).map(e=>e.graphic)):this._goTo(e.graphic))}layersToItems(e){let{controller:t,groupLayerItem:n,layers:r,promises:i}=e,{_groupItemCache:a,_layerItemCache:o,effectiveSelectionManager:s,viewLayersAndTables:c}=this,l=r??c;if(!s||s.count===0)return[];let u=[];for(let e of l)switch(e.type){case`subtype-group`:case`knowledge-graph`:case`group`:{let n=a.get(e),r=n??new T({layer:e,viewModel:this});n||a.set(e,r),i.push(r.sync({controller:t,promises:i})),u.push(r)}break;default:if(S(e)){if(!s.getSelection(e)?.length)continue;let r=o.get(e),a=r??new E({groupLayerItem:n,layer:e,viewModel:this});r||o.set(e,a),i.push(a.sync({controller:t,promises:i})),u.push(a)}}return u}removeFromSelection(e){let{layer:t,selection:n}=e;(b(t)||x(t))&&this.effectiveSelectionManager?.remove(t,n)}removeTemporaryHighlight(){this._hoverHighlightHandle=i(this._hoverHighlightHandle)}selectSingleFeatureItem(e){let t=e.identifier;if(this.effectiveSelectionManager)for(let{layer:n}of this.effectiveSelectionManager.selections)this.replace({layer:n,selection:n===e.layer?[t]:[]})}selectSingleGroupItem(e){if(this.effectiveSelectionManager)for(let{layer:t,selection:n}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t.parent===e.layer?n:[]})}selectSingleItem(e){A(e)?this.selectSingleGroupItem(e):k(e)?this.selectSingleLayerItem(e):this.selectSingleFeatureItem(e)}selectSingleLayerItem(e){if(this.effectiveSelectionManager)for(let{layer:t,selection:n}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t===e.layer?n:[]})}replace(e){let{layer:t,selection:n}=e;(b(t)||x(t))&&this.effectiveSelectionManager?.replace(t,n)}async _goTo(e){let{view:t}=this;if(t)try{await w(t,e)}catch(e){e.name!==`AbortError`&&r.getLogger(this).warn(`Failed to go to feature(s)`,e)}}_onSelectionManagerSelectionChange(e){let{changes:t}=e,n=this.effectiveSelectionManager;n&&t.forEach(({layer:e})=>{let t=n.getSelection(e);t&&t.length!==0||this._expandParentItems(e)})}_expandParentItems(e){let t=this._layerItemCache.get(e);if(t&&(t.expanded=!0),_(e.parent)){let t=this._groupItemCache.get(e.parent);t&&(t.expanded=!0)}}async _generateListItems(e){try{this.removeTemporaryHighlight();let t=[],n=this.layersToItems({controller:e,promises:t});t.length>0&&await Promise.all(t),this._onChangeAbortController===e&&(this._allLayerItems=n)}catch(e){r.getLogger(this).warn(`Failed updating selection`,e)}}_onSelectionChange(){o(this._onSelectionChangeDebounced())}_refreshLayerEditHandles(){let{effectiveSelectionManager:e}=this;if(this._layerEditHandles.drain(i),!e?.sources.length)return;let t=new Set(e.sources.map(e=>v(e)?e.parent:e));for(let e of t)S(e)&&(x(e)?this._layerEditHandles.push(e.graphics.on(`change`,()=>void this._onLayerEdit(e))):C(e)&&this._layerEditHandles.push(e.on(`edits`,t=>void this._onLayerEdit(e,t))))}async _onLayerEdit(e,t){try{if(this.removeTemporaryHighlight(),this._cancelOnLayerEdit(e),t&&!t.updatedFeatures.some(e=>e.objectId!=null&&!e.error))return;let n=new AbortController;this._layerEditAbortControllers.set(e,n);let r=e.type===`subtype-group`||e.type===`knowledge-graph`?this.findParentItem(e):this.findLayerItem(e);if(r?.layerView){let e=r.layerView;if(await this._onLayerViewUpdate(e),n.signal.aborted)return;r.reset(),this._onSelectionChange()}this._layerEditAbortControllers.get(e)===n&&this._layerEditAbortControllers.delete(e)}catch(e){r.getLogger(this).warn(`Failed updating selected features`,e)}}async _onLayerViewUpdate(e){await c(f(()=>e.updating),2e3),await f(()=>!e.updating)}};e([p()],M.prototype,`_allLayerItems`,void 0),e([p()],M.prototype,`_groupItemCache`,void 0),e([p()],M.prototype,`_hoverHighlightHandle`,void 0),e([p()],M.prototype,`_layerEditAbortControllers`,void 0),e([p()],M.prototype,`_layerEditHandles`,void 0),e([p()],M.prototype,`_layerItemCache`,void 0),e([p()],M.prototype,`_onChangeAbortController`,void 0),e([p()],M.prototype,`_sources`,null),e([p()],M.prototype,`_updatingHandles`,void 0),e([p()],M.prototype,`activeLayerItem`,null),e([p()],M.prototype,`allLayerItems`,null),e([p()],M.prototype,`effectiveCount`,null),e([p()],M.prototype,`effectiveSelectionManager`,null),e([p()],M.prototype,`filterText`,void 0),e([p()],M.prototype,`isUpdating`,null),e([p()],M.prototype,`layer`,void 0),e([p()],M.prototype,`layerItems`,null),e([p()],M.prototype,`layerViewMap`,null),e([p()],M.prototype,`maxVisibleFeatureCountExceeded`,null),e([p()],M.prototype,`maxVisibleFeatureCountPerLayer`,void 0),e([p()],M.prototype,`selectionManager`,void 0),e([p()],M.prototype,`state`,null),e([p()],M.prototype,`view`,void 0),e([p()],M.prototype,`viewLayersAndTables`,null),e([p()],M.prototype,`visibleFeatureCount`,null),e([p()],M.prototype,`visibleFeatureItems`,null),e([p()],M.prototype,`visibleLayerCount`,null),M=e([m(`esri.widgets.support.SelectionList.SelectionListViewModel`)],M);const N=M;export{N as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import n from"../../../core/Collection.js";import r from"../../../core/Logger.js";import{removeMaybe as i,abortMaybe as a}from"../../../core/maybe.js";import{ignoreAbortErrors as o,debounce as s,whenOrTimeout as c}from"../../../core/promiseUtils.js";import{watch as l,on as u,sync as d,whenOnce as f}from"../../../core/reactiveUtils.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as h}from"../../../core/support/UpdatingHandles.js";import{isSubtypeGroupLayer as g,isGroupLayer as _,isSubtypeSublayer as v}from"../../../layers/support/layerUtils.js";import{isSelectableLayerViewWithHighlights as y,isSelectableLayerWithObjectIds as b,isSelectableLayerWithGraphics as x,isSelectableLayer as S,isSelectableLayerBaseWithEditing as C}from"../../../views/support/selectionUtils.js";import{goTo as w}from"../goToUtils.js";import T from"./GroupLayerItem.js";import E from"./LayerItem.js";import{computeEffectiveCount as D,getNestedLayerItems as O,isLayerItem as k,isGroupLayerItem as A,getNestedFeatureItems as j}from"./selectionListUtils.js";let M=class extends t{constructor(e){super(e),this._allLayerItems=null,this._groupItemCache=new Map,this._hoverHighlightHandle=null,this._layerEditAbortControllers=new Map,this._layerEditHandles=new n,this._layerItemCache=new Map,this._onChangeAbortController=null,this._updatingHandles=new h,this.filterText=void 0,this.layer=null,this.maxVisibleFeatureCountPerLayer=500,this.selectionManager=null,this._onSelectionChangeController=async()=>{this._cancelOnSelectionChange();let e=new AbortController;this._onChangeAbortController=e,await this._updatingHandles.addPromise(o(this._generateListItems(e))),this._onChangeAbortController===e&&(this._onChangeAbortController=null),(this.layer&&this.effectiveSelectionManager?.getSelection(this.layer))?.length||(this.layer=null)},this._cancelOnSelectionChange=()=>this._onChangeAbortController?.abort(),this._onSelectionChangeDebounced=s(this._onSelectionChangeController,100),this._cancelOnLayerEdit=e=>this._layerEditAbortControllers.get(e)?.abort()}initialize(){this.addHandles([l(()=>[this.view,this.effectiveSelectionManager,...this._sources],()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),u(()=>this.effectiveSelectionManager?.sources,`change`,()=>{this._onSelectionChange(),this._refreshLayerEditHandles()}),u(()=>this.effectiveSelectionManager,`selection-change`,e=>{this._onSelectionManagerSelectionChange(e),this._onSelectionChange()},d)])}destroy(){this._cancelOnSelectionChange(),this.removeTemporaryHighlight(),this._updatingHandles.destroy(),this._layerEditHandles.drain(i),this._layerEditAbortControllers.forEach(a)}get _sources(){return this.effectiveSelectionManager?.sources.toArray()??[]}get activeLayerItem(){let{layer:e}=this;return e&&this.findLayerItem(e)}get allLayerItems(){return this._allLayerItems??[]}get effectiveCount(){return D(this.allLayerItems)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get isUpdating(){return!!(this._onChangeAbortController||this._updatingHandles.updating)}get layerItems(){return O(this.allLayerItems)}get layerViewMap(){let e=new Map,{view:t}=this;if(!t)return e;for(let n of t.allLayerViews)if(e.set(n.layer.id,n),g(n.layer))for(let t of n.layer.sublayers)e.set(t.id,n);return e}get maxVisibleFeatureCountExceeded(){return this.allLayerItems.some(e=>e.maxVisibleFeatureCountExceeded)}get state(){let{view:e}=this;return e?e.ready?this.effectiveSelectionManager?`ready`:`error`:`loading`:`disabled`}get viewLayersAndTables(){let{view:e}=this;return e?.map?[...e.map.layers.toArray().reverse(),...e.map.tables.toArray().reverse()]:[]}get visibleFeatureCount(){return this.activeLayerItem?.visibleTotal??this.visibleFeatureItems.length}get visibleFeatureItems(){return this.layerItems.flatMap(e=>e.featureItems.filter(e=>e.visible))}get visibleLayerCount(){let{effectiveSelectionManager:e}=this;return!e||e.count===0?0:e.count===1||this.activeLayerItem?1:this.layerItems.filter(e=>e.visible).length}addTemporaryHighlight(e){let{graphic:t,layerView:n}=e;this.removeTemporaryHighlight(),n&&t&&y(n)&&(this._hoverHighlightHandle=n.highlight(t,{name:`temporary`}))}collapseAll(){this._allLayerItems?.forEach(e=>e.expanded=!1)}clear(){this.effectiveSelectionManager?.clear()}deselectFeatureItem(e){let{layer:t,graphic:n,objectId:r}=e;b(t)&&r!=null?this.effectiveSelectionManager?.remove(t,[r]):x(t)&&this.effectiveSelectionManager?.remove(t,[n])}deselectGroupItem(e){e.items.forEach(e=>{k(e)?this.deselectLayerItem(e):this.deselectGroupItem(e)})}deselectLayerItem(e){let{layer:t}=e;this.replace({layer:t,selection:[]})}deselectItem(e){A(e)?this.deselectGroupItem(e):k(e)?this.deselectLayerItem(e):this.deselectFeatureItem(e)}expandAll(){this._allLayerItems?.forEach(e=>e.expanded=!0)}findLayerItem(e){return this.layerItems.find(t=>t.layer===e)}findParentItem(e){return this.allLayerItems.find(t=>t.layer===e)}goToItem(e){e.isTable||(k(e)||A(e)?this._goTo(j([e]).map(e=>e.graphic)):this._goTo(e.graphic))}async layersToItems(e){let{controller:t,groupLayerItem:n,layers:r,promises:i}=e,{_groupItemCache:a,_layerItemCache:o,effectiveSelectionManager:s,viewLayersAndTables:c}=this,l=r??c;if(!s||s.count===0)return[];let u=[];for(let e of l)switch(e.type){case`subtype-group`:case`knowledge-graph`:case`map-image`:case`map-notes`:case`group`:{let n=a.get(e),r=n??new T({layer:e,viewModel:this});n||a.set(e,r),i.push(r.sync({controller:t,promises:i})),u.push(r)}break;default:if(S(e)){if(!s.getSelection(e)?.length)continue;let r=o.get(e),a=r??new E({groupLayerItem:n,layer:e,viewModel:this});r||o.set(e,a),i.push(a.sync({controller:t,promises:i})),u.push(a)}}return u}removeFromSelection(e){let{layer:t,selection:n}=e;(b(t)||x(t))&&this.effectiveSelectionManager?.remove(t,n)}removeTemporaryHighlight(){this._hoverHighlightHandle=i(this._hoverHighlightHandle)}selectSingleFeatureItem(e){let t=e.identifier;if(this.effectiveSelectionManager)for(let{layer:n}of this.effectiveSelectionManager.selections)this.replace({layer:n,selection:n===e.layer?[t]:[]})}selectSingleGroupItem(e){if(this.effectiveSelectionManager)for(let{layer:t,selection:n}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t.parent===e.layer?n:[]})}selectSingleItem(e){A(e)?this.selectSingleGroupItem(e):k(e)?this.selectSingleLayerItem(e):this.selectSingleFeatureItem(e)}selectSingleLayerItem(e){if(this.effectiveSelectionManager)for(let{layer:t,selection:n}of this.effectiveSelectionManager.selections)this.replace({layer:t,selection:t===e.layer?n:[]})}replace(e){let{layer:t,selection:n}=e;(b(t)||x(t))&&this.effectiveSelectionManager?.replace(t,n)}async _goTo(e){let{view:t}=this;if(t)try{await w(t,e)}catch(e){e.name!==`AbortError`&&r.getLogger(this).warn(`Failed to go to feature(s)`,e)}}_onSelectionManagerSelectionChange(e){let{changes:t}=e,n=this.effectiveSelectionManager;n&&t.forEach(({layer:e})=>{let t=n.getSelection(e);t&&t.length!==0||this._expandParentItems(e)})}_expandParentItems(e){let t=this._layerItemCache.get(e);if(t&&(t.expanded=!0),_(e.parent)){let t=this._groupItemCache.get(e.parent);t&&(t.expanded=!0)}}async _generateListItems(e){try{this.removeTemporaryHighlight();let t=[],n=await this.layersToItems({controller:e,promises:t});t.length>0&&await Promise.all(t),this._onChangeAbortController===e&&(this._allLayerItems=n)}catch(e){r.getLogger(this).warn(`Failed updating selection`,e)}}_onSelectionChange(){o(this._onSelectionChangeDebounced())}_refreshLayerEditHandles(){let{effectiveSelectionManager:e}=this;if(this._layerEditHandles.drain(i),!e?.sources.length)return;let t=new Set(e.sources.map(e=>v(e)?e.parent:e));for(let e of t)S(e)&&(x(e)?this._layerEditHandles.push(e.graphics.on(`change`,()=>void this._onLayerEdit(e))):C(e)&&this._layerEditHandles.push(e.on(`edits`,t=>void this._onLayerEdit(e,t))))}async _onLayerEdit(e,t){try{if(this.removeTemporaryHighlight(),this._cancelOnLayerEdit(e),t&&!t.updatedFeatures.some(e=>e.objectId!=null&&!e.error))return;let n=new AbortController;this._layerEditAbortControllers.set(e,n);let r=e.type===`subtype-group`||e.type===`knowledge-graph`?this.findParentItem(e):this.findLayerItem(e);if(r?.layerView){let e=r.layerView;if(await this._onLayerViewUpdate(e),n.signal.aborted)return;r.reset(),this._onSelectionChange()}this._layerEditAbortControllers.get(e)===n&&this._layerEditAbortControllers.delete(e)}catch(e){r.getLogger(this).warn(`Failed updating selected features`,e)}}async _onLayerViewUpdate(e){await c(f(()=>e.updating),2e3),await f(()=>!e.updating)}};e([p()],M.prototype,`_allLayerItems`,void 0),e([p()],M.prototype,`_groupItemCache`,void 0),e([p()],M.prototype,`_hoverHighlightHandle`,void 0),e([p()],M.prototype,`_layerEditAbortControllers`,void 0),e([p()],M.prototype,`_layerEditHandles`,void 0),e([p()],M.prototype,`_layerItemCache`,void 0),e([p()],M.prototype,`_onChangeAbortController`,void 0),e([p()],M.prototype,`_sources`,null),e([p()],M.prototype,`_updatingHandles`,void 0),e([p()],M.prototype,`activeLayerItem`,null),e([p()],M.prototype,`allLayerItems`,null),e([p()],M.prototype,`effectiveCount`,null),e([p()],M.prototype,`effectiveSelectionManager`,null),e([p()],M.prototype,`filterText`,void 0),e([p()],M.prototype,`isUpdating`,null),e([p()],M.prototype,`layer`,void 0),e([p()],M.prototype,`layerItems`,null),e([p()],M.prototype,`layerViewMap`,null),e([p()],M.prototype,`maxVisibleFeatureCountExceeded`,null),e([p()],M.prototype,`maxVisibleFeatureCountPerLayer`,void 0),e([p()],M.prototype,`selectionManager`,void 0),e([p()],M.prototype,`state`,null),e([p()],M.prototype,`view`,void 0),e([p()],M.prototype,`viewLayersAndTables`,null),e([p()],M.prototype,`visibleFeatureCount`,null),e([p()],M.prototype,`visibleFeatureItems`,null),e([p()],M.prototype,`visibleLayerCount`,null),M=e([m(`esri.widgets.support.SelectionList.SelectionListViewModel`)],M);const N=M;export{N as default};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type GroupLayer from "../../../layers/GroupLayer.js";
|
|
2
2
|
import type KnowledgeGraphLayer from "../../../layers/KnowledgeGraphLayer.js";
|
|
3
|
+
import type MapImageLayer from "../../../layers/MapImageLayer.js";
|
|
4
|
+
import type MapNotesLayer from "../../../layers/MapNotesLayer.js";
|
|
3
5
|
import type SubtypeGroupLayer from "../../../layers/SubtypeGroupLayer.js";
|
|
4
6
|
import type FeatureItem from "./FeatureItem.js";
|
|
5
7
|
import type GroupLayerItem from "./GroupLayerItem.js";
|
|
@@ -11,7 +13,7 @@ import type LayerItem from "./LayerItem.js";
|
|
|
11
13
|
*
|
|
12
14
|
* @since 5.2
|
|
13
15
|
*/
|
|
14
|
-
export type
|
|
16
|
+
export type SelectionListParentLayerUnion = GroupLayer | KnowledgeGraphLayer | MapImageLayer | MapNotesLayer | SubtypeGroupLayer;
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
19
|
* Represents the state of a selection list item.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{deprecatedProperty as t}from"../../../core/deprecate.js";import{EventedAccessor as n}from"../../../core/Evented.js";import{handlesGroup as r}from"../../../core/handleUtils.js";import i from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{removeMaybe as o}from"../../../core/maybe.js";import s from"../../../core/ReactiveMap.js";import{watch as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{isKnowledgeGraphLayer as d,isLinkChartLayer as f}from"../../../layers/support/layerUtils.js";import{findLayerView as
|
|
2
|
+
import{__decorate as e}from"tslib";import{deprecatedProperty as t}from"../../../core/deprecate.js";import{EventedAccessor as n}from"../../../core/Evented.js";import{handlesGroup as r}from"../../../core/handleUtils.js";import i from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{removeMaybe as o}from"../../../core/maybe.js";import s from"../../../core/ReactiveMap.js";import{watch as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{isKnowledgeGraphLayer as d,isLinkChartLayer as f,isMapImageLayer as p,isMapNotesLayer as m}from"../../../layers/support/layerUtils.js";import{findLayerView as h}from"../../../views/draw/support/layerUtils.js";import g from"../../../views/selection/SelectionOperation.js";import{isSelectableLayer as _,isSelectableLayerView as v,isSelectionSourceVisible as y,isTableLayer as b,isSelectableLayerViewVisible as x}from"../../../views/support/selectionUtils.js";let S=class extends n{constructor(e){super(e),this._operationHandlesGroup=null,this.activeOperation=null,this.continuousSelectionEnabled=!1,this.defaultLassoToolOptions={createTool:`polygon`,mode:`hybrid`,toolName:`lasso`},this.defaultOperationType=`add`,this.defaultPolygonToolOptions={createTool:`polygon`,mode:`hybrid`,toolName:`polygon`},this.defaultPointToolOptions={createTool:`point`,toolName:`point`},this.defaultRectangleToolOptions={createTool:`rectangle`,toolName:`rectangle`},this.ignoreLayerVisibility=!1,this.layerViewPreferenceEnabled=!0,this.persistSelection=!0,this.selectionManager=null,this.returnFeatureTitleFields=!1,this.returnGeometry=!0,this.selectOnComplete=!0,this.sources=null,this.toolConfigs=[]}initialize(){this.addHandles([c(()=>this.effectiveSourceMap,()=>{let{activeOperation:e,effectiveSources:t,effectiveSourceMap:n}=this;e&&(e.effectiveSourceMap=n,e.sources=t)}),c(()=>this.defaultOperationType,e=>{this.activeOperation&&(this.activeOperation.type=e)})])}destroy(){this.activeOperation?.cancel(),this.activeOperation?.destroy(),this._operationHandlesGroup=o(this._operationHandlesGroup)}get effectiveSelectionManager(){return this.selectionManager??this.view?.selectionManager}get effectiveSourceMap(){let e=new s;return(this.sources??this.effectiveSelectionManager?.sources.toArray())?.forEach(t=>this._collectEffectiveSource(t,e)),e}get effectiveSources(){return Array.from(this.effectiveSourceMap.keys())}get layers(){return t(i.getLogger(this),`layers`,{replacement:`Use SelectionToolbar.sources instead.`}),this.sources}set layers(e){t(i.getLogger(this),`layers`,{replacement:`Use SelectionToolbar.sources instead.`}),this.sources=e}get state(){return this.activeOperation?`active`:this.view?.ready&&this.effectiveSources.length?`ready`:`disabled`}activate(e){let{state:t}=this,n=e?.view||this.view,a=e?.sources||this.effectiveSources;if(t===`disabled`||!n){i.getLogger(this).warn(`Unable to start selection operation.`);return}t===`active`&&this.cancel();let o=new CustomEvent(`before-activate`,{cancelable:!0,detail:{toolName:e?.toolName??null}});if(this.emit(`before-activate`,o),o.defaultPrevented)return;let s={effectiveSourceMap:this.effectiveSourceMap,persistSelection:this.persistSelection,returnFeatureTitleFields:this.returnFeatureTitleFields,returnGeometry:this.returnGeometry,selectOnComplete:this.selectOnComplete,selectionManager:this.effectiveSelectionManager,type:this.defaultOperationType,...e,sources:a,view:n},c=new g({...s});return this._operationHandlesGroup=r([c.on(`selection-change`,e=>this.emit(`selection-change`,e)),c.once(`complete`,e=>this._onOperationComplete(e,s))]),this._set(`activeOperation`,c),c}activateTool(e){this.cancel();let t=this._getToolOptions(e);if(!t)i.getLogger(this).warn(`Unable to activate tool: unable to determine options.`);else return this.activate(t)}cancel(){this.activeOperation?.cancel(),this._set(`activeOperation`,null)}toggleTool(e){let{activeOperation:t}=this;if(t){let n=t.toolName;if(this.cancel(),n===e)return}return this.activateTool(e)}_onOperationComplete(e,t){let n=this.activeOperation?.type??e.operationType;this._operationHandlesGroup=o(this._operationHandlesGroup),this.activeOperation?.destroy(),this._set(`activeOperation`,null),this.emit(`complete`,e),this.continuousSelectionEnabled&&!e.aborted&&this.activate({...t,type:n})}_getToolOptions(e){let t=this.toolConfigs.find(t=>t.toolName===e);if(t)return t;if(e===`lasso`)return this.defaultLassoToolOptions;if(e===`point`)return this.defaultPointToolOptions;if(e===`polygon`)return this.defaultPolygonToolOptions;if(e===`rectangle`)return this.defaultRectangleToolOptions}_collectEffectiveSource(e,t){let{view:n}=this;if(d(e)||f(e)){e.layers.forEach(e=>this._collectEffectiveSource(e,t));return}if(p(e)){e.sublayers?.forEach(e=>this._collectEffectiveSource(e,t)),e.subtables?.forEach(e=>this._collectEffectiveSource(e,t));return}if(m(e)){e.sublayers?.forEach(e=>this._collectEffectiveSource(e,t));return}if(!_(e)&&!v(e)||!this.ignoreLayerVisibility&&!y(e,n)||b(e,n))return;if(!this.layerViewPreferenceEnabled||v(e)){t.set(e,[]);return}let r=n?h(n,e):void 0;v(r)?(this.ignoreLayerVisibility||x(r))&&a(t,r,()=>[]).push(e):t.set(e,[])}};e([l({readOnly:!0})],S.prototype,`activeOperation`,void 0),e([l()],S.prototype,`continuousSelectionEnabled`,void 0),e([l()],S.prototype,`defaultLassoToolOptions`,void 0),e([l()],S.prototype,`defaultOperationType`,void 0),e([l()],S.prototype,`defaultPolygonToolOptions`,void 0),e([l()],S.prototype,`defaultPointToolOptions`,void 0),e([l()],S.prototype,`defaultRectangleToolOptions`,void 0),e([l()],S.prototype,`effectiveSelectionManager`,null),e([l()],S.prototype,`effectiveSourceMap`,null),e([l()],S.prototype,`effectiveSources`,null),e([l()],S.prototype,`layers`,null),e([l()],S.prototype,`ignoreLayerVisibility`,void 0),e([l()],S.prototype,`layerViewPreferenceEnabled`,void 0),e([l()],S.prototype,`persistSelection`,void 0),e([l()],S.prototype,`selectionManager`,void 0),e([l()],S.prototype,`returnFeatureTitleFields`,void 0),e([l()],S.prototype,`returnGeometry`,void 0),e([l()],S.prototype,`selectOnComplete`,void 0),e([l()],S.prototype,`sources`,void 0),e([l({readOnly:!0})],S.prototype,`state`,null),e([l()],S.prototype,`toolConfigs`,void 0),e([l()],S.prototype,`view`,void 0),S=e([u(`esri.widgets.support.SelectionToolbar.SelectionToolbarViewModel`)],S);const C=S;export{C as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{addMany as e}from"../../../core/arrayUtils.js";import{ignoreAbortErrors as t,whenOrAbort as n}from"../../../core/promiseUtils.js";import{sqlIn as r,sqlAnd as i}from"../../../core/sql.js";import{getDisplayFieldName as a}from"../../../layers/support/fieldUtils.js";import{isKnowledgeGraphLayer as o,isLinkChartLayer as s,isMapNotesLayer as c,isSubtypeGroupLayer as l,isSublayer as u}from"../../../layers/support/layerUtils.js";import{calculateTolerance as d}from"../../../renderers/support/clickToleranceUtils.js";import{createQueryGeometry as f}from"../../../views/support/drapedUtils.js";import{isSelectableLayerWithObjectIds as p,isSelectableLayerView as m,isSelectableLayerWithGraphics as h,isTableLayer as g,isSelectableLayerViewWithObjectIds as _,isSelectableLayer as v}from"../../../views/support/selectionUtils.js";async function y(e){let{effectiveSourceMap:r,returnFeatureTitleFields:i,returnGeometry:a,selector:o,signal:s,sources:c,view:l}=e;if(!c?.length)return[];let{layers:u,layerViews:d,graphicsLayers:f}=b(c),p=[];return await t(n(Promise.all([C({candidates:p,layers:u,returnFeatureTitleFields:i,returnGeometry:a,selector:o,signal:s,view:l}),x({candidates:p,effectiveSourceMap:r,layerViews:d,returnGeometry:a,selector:o,signal:s,view:l}),k({candidates:p,graphicsLayers:f,selector:o})]),s)),p}function b(e){let t=[],n=[],r=[];return e.forEach(e=>{(o(e)||s(e))&&e.layers?.length?t.push(...e.layers.toArray()):c(e)&&e.sublayers?.length?r.push(...e.sublayers.toArray()):p(e)?t.push(e):m(e)?n.push(e):h(e)&&r.push(e)}),{layers:t,layerViews:n,graphicsLayers:r}}async function x(t){let{candidates:r,effectiveSourceMap:i,layerViews:a,returnGeometry:o,selector:s,signal:c,view:l}=t;s.type===`point`?await S({candidates:r,effectiveSourceMap:i,
|
|
2
|
+
import{addMany as e}from"../../../core/arrayUtils.js";import{ignoreAbortErrors as t,whenOrAbort as n}from"../../../core/promiseUtils.js";import{sqlIn as r,sqlAnd as i}from"../../../core/sql.js";import{getDisplayFieldName as a}from"../../../layers/support/fieldUtils.js";import{isKnowledgeGraphLayer as o,isLinkChartLayer as s,isMapNotesLayer as c,isSubtypeGroupLayer as l,isSublayer as u}from"../../../layers/support/layerUtils.js";import{calculateTolerance as d}from"../../../renderers/support/clickToleranceUtils.js";import{createQueryGeometry as f}from"../../../views/support/drapedUtils.js";import{isSelectableLayerWithObjectIds as p,isSelectableLayerView as m,isSelectableLayerWithGraphics as h,isTableLayer as g,isSelectableLayerViewWithObjectIds as _,isSelectableLayer as v}from"../../../views/support/selectionUtils.js";async function y(e){let{effectiveSourceMap:r,returnFeatureTitleFields:i,returnGeometry:a,selector:o,signal:s,sources:c,view:l}=e;if(!c?.length)return[];let{layers:u,layerViews:d,graphicsLayers:f}=b(c),p=[];return await t(n(Promise.all([C({candidates:p,layers:u,returnFeatureTitleFields:i,returnGeometry:a,selector:o,signal:s,view:l}),x({candidates:p,effectiveSourceMap:r,layerViews:d,returnGeometry:a,selector:o,signal:s,view:l}),k({candidates:p,effectiveSourceMap:r,graphicsLayers:f,selector:o,view:l})]),s)),p}function b(e){let t=[],n=[],r=[];return e.forEach(e=>{(o(e)||s(e))&&e.layers?.length?t.push(...e.layers.toArray()):c(e)&&e.sublayers?.length?r.push(...e.sublayers.toArray()):p(e)?t.push(e):m(e)?n.push(e):h(e)&&r.push(e)}),{layers:t,layerViews:n,graphicsLayers:r}}async function x(t){let{candidates:r,effectiveSourceMap:i,layerViews:a,returnGeometry:o,selector:s,signal:c,view:l}=t;s.type===`point`?await S({candidates:r,effectiveSourceMap:i,sources:a,selector:s,view:l}):await n(Promise.allSettled(a.map(async t=>{if(_(t)){let n=E({effectiveSourceMap:i,layerView:t,selector:s,view:l,returnGeometry:o}),a=await t.queryFeatures(n,{signal:c});e(r,a.features)}else h(t.layer)&&await k({candidates:r,effectiveSourceMap:i,graphicsLayers:[t.layer],selector:s,view:l})})),c)}async function S({candidates:e,sources:t,selector:n,view:r,effectiveSourceMap:i}){let a=r.toScreen(n);if(!a)return;let o=new Set;t.forEach(e=>{if(m(e)){let t=e.layer;(l(t)||c(t))&&i?.has(e)?i.get(e)?.forEach(e=>v(e)&&o.add(e)):o.add(t)}else v(e)&&c(e.layer)?o.add(e.layer):o.add(e)});let{results:s}=await r.hitTest(a,{include:Array.from(o)});s.forEach(t=>{`graphic`in t&&t.graphic&&e.push(t.graphic)})}async function C(t){let{candidates:r,layers:i,returnFeatureTitleFields:a,returnGeometry:o,selector:s,signal:c,view:l}=t;await n(Promise.allSettled(i.map(async t=>{if(g(t,l))return;let n=O(t,s,l,a,o),i=await t.queryFeatures(n,{signal:c});e(r,i.features)})),c)}function w(e,t,n){return e.type===`point`?f(e,`renderer`in t?d({renderer:t.renderer}):0,n):e}function T(e,t,n){let{fields:r,fieldsIndex:i}=e,o=new Set([e.objectIdField]);`globalIdField`in e&&e.globalIdField!=null&&i.has(e.globalIdField)&&o.add(i.get(e.globalIdField).name);let s=`displayField`in e?e.displayField:null,c=a({displayField:s,fields:r});if(c!=null&&i.has(c)&&o.add(c),`subtypeField`in e&&e.subtypeField!=null){let n=i.get(e.subtypeField)?.name;if(n!=null&&o.add(n),`utilityNetworks`in t.map&&t.map.utilityNetworks?.length){let e=i.get(`assetgroup`);e?.name&&o.add(e.name);let t=i.get(`assettype`);t?.name&&o.add(t.name)}}return(n||t.requiredFieldsOptions.featureTitleFields)&&`featureTitleFields`in e&&e.featureTitleFields&&e.featureTitleFields.forEach(e=>o.add(e)),Array.from(o.values())}function E(e){let{layerView:t,selector:n,view:r,returnGeometry:i,effectiveSourceMap:a}=e,o=t.createQuery();o.outFields=[`*`],o.geometry=w(n,t.layer,r),o.returnGeometry=i??!0,o.outSpatialReference=r.spatialReference;let s=a?.get(t);if(s?.length){let e=D(t,s);e&&(o.where=e)}return o}function D(e,t){let n=e.definitionExpression||void 0,a=[],o=e.layer;if(l(o)){let e=o.fieldsIndex.get(o.subtypeField)?.name||o.subtypeField,n=t.map(e=>e.subtypeCode),i=r(e,n);i&&a.push(i)}else t.forEach(e=>{u(e)&&e.definitionExpression!=null&&a.push(e.definitionExpression)});return a.length?i(n,a.join(` OR `)):n}function O(e,t,n,r=!1,i=!0){let a=e.createQuery();return a.outFields=T(e,n,r),a.geometry=w(t,e,n),a.returnGeometry=i,a.outSpatialReference=n.spatialReference,a}async function k(e){let{candidates:t,effectiveSourceMap:n,graphicsLayers:r,selector:i,view:a}=e,o=r.flatMap(e=>e.graphics.toArray())??[];if(!o?.length||!i)return;if(i.type===`point`){await S({candidates:t,effectiveSourceMap:n,sources:r,selector:i,view:a});return}let{intersectsAccelerateGeometry:s,intersectsExecute:c}=await import(`../../../geometry/operators/intersectsOperator.js`);s(i),o.forEach(e=>{e.geometry&&e.geometry.type!==`mesh`&&c(i,e.geometry)&&t.push(e)})}export{x as collectSelectionFromFeatureLayerViews,C as collectSelectionFromFeatureLayers,k as collectSelectionFromGraphicsLayers,y as getSelectionFromGeometry,w as getSuggestedQueryGeometry,T as getSuggestedQueryOutFields};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../Graphic.js";import{px2pt as t}from"../../core/screenUtils.js";import{isSharedTemplateMetadata as n,isStandardFeatureTemplate as r}from"../../editing/templateUtils.js";import{isGraphic as i}from"../../support/graphicInstanceUtils.js";import{renderPreviewHTML as a}from"../../symbols/support/symbolUtils.js";async function o(e,o,c){if(!i(e)&&n(e)&&e.thumbnail){let t=`data:image/png;base64,${e.thumbnail.imageData}`,n=document.createElement(`div`);return n.classList.add(`esri-thumbnail-preview`),`geometryType`in o&&o.geometryType&&n.classList.add(`esri-thumbnail-preview--${o.geometryType}`),n.style.backgroundImage=`url(${t})`,n}let l=await s(o,e);if(l==null)return null;let u={maxSize:t(c?.maxSize??32),ariaLabel:c?.ariaLabel};if((i(e)||r(e))&&`renderer`in o&&o.renderer?.type===`dictionary`&&(u.fieldMap=o.renderer.fieldMap??void 0,u.feature=i(e)?e:{attributes:e.prototype.attributes??{}}),i(e)&&e.geometry&&c?.useGeometry!==!1&&!e.geometry.type.includes(`point`)){u.geometry=e.geometry,u.useMarkerSymbolSize=!1;let n=t(c?.maxSize??22);u.size={width:n,height:n}}return await a(l,u)}async function s(t,r){if(!i(r)&&n(r))return l(t);if(`renderer`in t&&t.renderer){let{renderer:n}=t,a=i(r)?r:new e({attributes:r.prototype.attributes});if(`getSymbolAsync`in n){let e=await n.getSymbolAsync(a);if(e)return e}}return
|
|
2
|
+
import e from"../../Graphic.js";import{px2pt as t}from"../../core/screenUtils.js";import{isSharedTemplateMetadata as n,isStandardFeatureTemplate as r}from"../../editing/templateUtils.js";import{isGraphic as i}from"../../support/graphicInstanceUtils.js";import{renderPreviewHTML as a}from"../../symbols/support/symbolUtils.js";async function o(e,o,c){if(!i(e)&&n(e)&&e.thumbnail){let t=`data:image/png;base64,${e.thumbnail.imageData}`,n=document.createElement(`div`);return n.classList.add(`esri-thumbnail-preview`),`geometryType`in o&&o.geometryType&&n.classList.add(`esri-thumbnail-preview--${o.geometryType}`),n.style.backgroundImage=`url(${t})`,n}let l=await s(o,e);if(l==null)return null;let u={maxSize:t(c?.maxSize??32),ariaLabel:c?.ariaLabel};if((i(e)||r(e))&&`renderer`in o&&o.renderer?.type===`dictionary`&&(u.fieldMap=o.renderer.fieldMap??void 0,u.feature=i(e)?e:{attributes:e.prototype.attributes??{}}),i(e)&&e.geometry&&c?.useGeometry!==!1&&!e.geometry.type.includes(`point`)){u.geometry=e.geometry,u.useMarkerSymbolSize=!1;let n=t(c?.maxSize??22);u.size={width:n,height:n}}return await a(l,u)}async function s(t,r){if(!i(r)&&n(r))return l(t);if(`renderer`in t&&t.renderer){let{renderer:n}=t,a=i(r)?r:new e({attributes:r.prototype.attributes});if(`getSymbolAsync`in n){let e=await n.getSymbolAsync(a);if(e)return e}}return(t.type===`graphics`||t.type===`sketch`)&&i(r)&&r.geometry?c(r.geometry.type):l(t)}async function c(e){let t=e===`point`||e===`multipoint`?await import(`../../symbols/SimpleMarkerSymbol.js`):e===`polyline`?await import(`../../symbols/SimpleLineSymbol.js`):e===`polygon`||e===`mesh`||e===`multipatch`?await import(`../../symbols/SimpleFillSymbol.js`):null;return t?new t.default:null}async function l(e){return`geometryType`in e&&e.geometryType?c(e.geometryType):null}export{o as fetchThumbnail};
|