@arcgis/core 4.25.0-next.20220721 → 4.25.0-next.20220722
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{791220164501a791b2cd.js → 0896986aa60516f716f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{59e18862b803fdc41786.js → 0c145b87c24bf6c7d572.js} +1 -1
- package/assets/esri/core/workers/chunks/2504c43fac77ecd9ec2a.js +1 -0
- package/assets/esri/core/workers/chunks/{39de883f236e2a8d9024.js → 30d7796ee6f7e4a6a3e1.js} +2 -2
- package/assets/esri/core/workers/chunks/{39de883f236e2a8d9024.js.LICENSE.txt → 30d7796ee6f7e4a6a3e1.js.LICENSE.txt} +0 -0
- package/assets/esri/core/workers/chunks/3281656a9bd3627e41ff.js +1 -0
- package/assets/esri/core/workers/chunks/374ee2b2cad26f7ad572.js +1 -0
- package/assets/esri/core/workers/chunks/4d14be8c7e8adaa91876.js +1011 -0
- package/assets/esri/core/workers/chunks/{c22d7622294fe4aefe0b.js → 4f2d2cc71f5ff5ac2a60.js} +1 -1
- package/assets/esri/core/workers/chunks/8b1d5b7e9de73bc9da3a.js +1 -0
- package/assets/esri/core/workers/chunks/9dc4db35c387e11e9beb.js +1 -0
- package/assets/esri/core/workers/chunks/{42987dcfda665c860151.js → a23376df9696ebe5b5cd.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4ad2cf5d6bded02e392.js → ed763fc352d0b55e5867.js} +1 -1
- package/assets/esri/core/workers/chunks/{a05f6afcf56245824853.js → f1fdb335c5f9ec8b27cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{9493a8e5d6001b6bf275.js → f59f82a43437a51c934c.js} +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker.json +1 -1
- package/assets/esri/widgets/support/t9n/DatePicker_en.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker.json +1 -1
- package/assets/esri/widgets/support/t9n/TimePicker_en.json +1 -1
- package/chunks/DefaultMaterial.glsl.js +42 -37
- package/chunks/RealisticTree.glsl.js +25 -25
- package/geometry/support/MeshMaterial.js +1 -1
- package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/package.json +2 -2
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/util/Matcher.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/resources/MarsAtmosphereTexture.js +1 -1
- package/views/3d/environment/resources/SimpleAtmosphereTexture.js +1 -1
- package/views/3d/glTF/LoaderResult.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/glTF/internal/TextureTransformUtils.js +5 -0
- package/views/3d/glTF/loader.js +1 -1
- package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/ElevationLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/TileLayerView3D.js +1 -1
- package/views/3d/layers/VoxelLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
- package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
- package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/support/CombinedElevationProvider.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +22 -22
- package/views/3d/webgl-engine/core/shaderLibrary/shading/PhysicallyBasedRenderingParameters.glsl.js +19 -10
- package/views/3d/webgl-engine/core/shaderLibrary/shading/TextureTransformUV.glsl.js +15 -0
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/input/recognizers/DoubleTapDrag.js +1 -1
- package/views/input/recognizers/Drag.js +1 -1
- package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
- package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
- package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
- package/views/input/recognizers/VerticalTwoFingerDrag.js +1 -1
- package/views/input/recognizers/support.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/overlay/ViewOverlay.js +1 -1
- package/widgets/AreaMeasurement3D.js +1 -1
- package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/Daylight.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Slice.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/TimeSlider.js +1 -1
- package/widgets/Weather.js +1 -1
- package/widgets/Zoom.js +1 -1
- package/widgets/support/DatePicker.js +1 -1
- package/widgets/support/TimePicker.js +1 -1
- package/assets/esri/core/workers/chunks/0b269862733afe740a63.js +0 -1
- package/assets/esri/core/workers/chunks/290cd411d0d18b1d0efd.js +0 -1
- package/assets/esri/core/workers/chunks/85a2cf095f002b2c486f.js +0 -1
- package/assets/esri/core/workers/chunks/b312dd3027492007d75e.js +0 -1
- package/assets/esri/core/workers/chunks/bf348f6f52701fa6016e.js +0 -987
- package/assets/esri/core/workers/chunks/c79d4cb3332550fb0df5.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{deg2rad as t}from"../../../../core/mathUtils.js";import{isSome as i,isNone as e}from"../../../../core/maybe.js";import{a as s,f as n,h as r}from"../../../../chunks/vec2.js";import{a as h}from"../../../../chunks/vec2f64.js";import{r as
|
|
5
|
+
import{deg2rad as t}from"../../../../core/mathUtils.js";import{isSome as i,isNone as e}from"../../../../core/maybe.js";import{a as s,f as n,h as r}from"../../../../chunks/vec2.js";import{a as h}from"../../../../chunks/vec2f64.js";import{r as o,e as a,o as _,f as c,n as l,a as p,g as d,z as g,c as f}from"../../../../chunks/vec3.js";import{c as m,f as u}from"../../../../chunks/vec3f64.js";import{create as D,fromPositionAndNormal as E,signedDistance as x,copy as b,isPointInside as I,normal as V,intersectLine as M}from"../../../../geometry/support/plane.js";import{angle as X,projectPointSignedLength as Y}from"../../../../geometry/support/vector.js";import{intersectLineAndRay as N,LineType as y}from"../../../support/geometry2dUtils.js";class P{constructor(t,i,e,s=0,n=j.IMMEDIATE){this._helper=t,this._planeType=i,this._edge=e,this.distance=s,this._plane=D(),this._offsetPlane=D(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,n===j.IMMEDIATE&&this._initialize()}get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),e=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=o(m(),t,e),this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(e,s,this._edgeDirection)}_toXYZ(t){return i(t)?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,s){if(e(i))return{start:t,end:i,direction:u(-s[1],s[0],0),isOriginalDirection:!0};const n=o(m(),t,i),r=!this._passesBisectingAngleThreshold(n,s);return{start:t,end:i,direction:r?this._bisectVectorsPerpendicular(s,n):n,isOriginalDirection:!r}}_passesBisectingAngleThreshold(t,i){const e=Math.abs(X(i,t));return e>=T&&e<=Math.PI-T}_bisectVectorsPerpendicular(t,i){const e=a(t,i)<0?t:_(m(),t),s=Math.abs(a(e,i));if(!(s<Z||s>1-Z))return this._bisectDirection(e,i);const n=c(m(),e,[0,0,1]);return l(n,n)}_bisectDirection(t,i){const e=p(m(),t,i);return l(e,e)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);a(t,i)<0&&_(i,i),E(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=c(m(),t.direction,this._edgeDirection);l(i,i);const e=c(m(),this._edgeDirection,i);return this._planeType===A.XY&&(e[2]=0),l(e,e)}_initializeDistanceConstraints(){i(this._left.end)&&!this.requiresSplitEdgeLeft&&this._updateDistanceConstraint(x(this._plane,this._left.end)),i(this._right.end)&&!this.requiresSplitEdgeRight&&this._updateDistanceConstraint(x(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=V(t),e=this._edgeDirection,o=p(m(),this._left.start,this._left.direction),a=p(m(),this._right.start,this._right.direction),_=this._pointInBasis2D(h(),i,e,this._left.start),c=this._pointInBasis2D(h(),i,e,o),l=this._pointInBasis2D(h(),i,e,this._right.start),g=this._pointInBasis2D(h(),i,e,a),[f]=N({start:c,end:_,type:y.LINE},{start:g,end:l,type:y.LINE});if(!f)return;const u=s(h(),_,c);n(u,u);const D=s(h(),f,c),E=r(u,D),b=p(m(),o,d(m(),this._left.direction,-E)),I=x(t,b);this._updateDistanceConstraint(I)}_pointInBasis2D(t,i,e,s){return t[0]=Y(i,s),t[1]=Y(e,s),t}_offset(t,e){Number.isFinite(this._minDistance)&&(e=Math.max(this._minDistance,e)),Number.isFinite(this._maxDistance)&&(e=Math.min(this._maxDistance,e)),b(this._offsetPlane,this._plane),this._offsetPlane[3]-=e;const s=(t,e,s)=>i(e)&&M(this._offsetPlane,t,p(m(),t,e),s),n=m();(t===this._edge.leftVertex?s(this._left.start,this._left.direction,n):s(this._right.start,this._right.direction,n))&&this._helper.copy(this._helper.fromXYZ(n,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=I(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return x(this.plane,this._pointToXYZ(t))}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof P&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&g(V(this._plane),V(t._plane))}accumulate(t,i){const e=this._plane[3]-i._plane[3]+i.distance;this._offset(t,e)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new P(this._helper,this._planeType,this._edge,this.distance,j.DEFERRED);return b(t._plane,this._plane),b(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=f(m(),this._edgeDirection),t}_maybeEqualsVec3(t,s){return e(t)&&e(s)||i(t)&&i(s)&&g(t,s)}_cloneNeighbor({start:t,end:e,direction:s,isOriginalDirection:n}){return{start:f(m(),t),end:i(e)?f(m(),e):null,direction:f(m(),s),isOriginalDirection:n}}}const T=t(15),Z=.001;var A,j;!function(t){t[t.XYZ=0]="XYZ",t[t.XY=1]="XY"}(A||(A={})),function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DEFERRED=1]="DEFERRED"}(j||(j={}));export{P as OffsetEdgeVertex,A as PlaneType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import r from"../../core/Collection.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{WatchUpdatingTracking as i}from"../../core/support/WatchUpdatingTracking.js";import"../../libs/maquette/projection.js";import{createProjector as a}from"../../libs/maquette/projector.js";let c=class extends e{constructor(){super(...arguments),this.items=new r,this._watchUpdatingTracking=new i,this._callbacks=new Map,this._projector=a(),this._hiddenProjector=a()}get needsRender(){return this.items.length>0}initialize(){const t=document.createElement("div");t.className="esri-overlay-surface",this._set("surface",t),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),t.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange((()=>this.items),(t=>{for(const e of t.added){const t=()=>e.render();this._callbacks.set(e,t),this._projector.append(this.surface,t)}for(const e of t.removed){const t=this._projector.detach(this._callbacks.get(e));this.surface.removeChild(t.domNode),this._callbacks.delete(e)}}))}addItem(t){this.items.add(t)}removeItem(t){this.items.remove(t)}destroy(){this.items.removeAll(),this._callbacks.forEach((t=>this._projector.detach(t))),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(t){const e=this._hiddenSurface,r=this._hiddenProjector;let o=null;const s=()=>(o=t.render(),o);r.append(e,s),r.renderNow();const i={left:0,top:0,right:0,bottom:0};if(o&&o.domNode){const t=o.domNode.getBoundingClientRect();i.left=t.left,i.top=t.top,i.right=t.right,i.bottom=t.bottom}for(r.detach(s);e.firstChild;)e.removeChild(e.firstChild);return i}overlaps(t,e){const r=this.computeBoundingRect(t),o=this.computeBoundingRect(e);return Math.max(r.left,o.left)<=Math.min(r.right,o.right)&&Math.max(r.top,o.top)<=Math.min(r.bottom,o.bottom)}get hasVisibleItems(){return this.items.some((t=>t.visible))}renderCanvas(t){if(!this.items.some((t=>t.visible)))return;const e=t.getContext("2d");e.save(),e.font=`10px ${getComputedStyle(this.surface).fontFamily}`,this.items.forEach((t=>{e.save(),t.renderCanvas(e),e.restore()})),e.restore()}};t([o({readOnly:!0})],c.prototype,"surface",void 0),t([o({readOnly:!0})],c.prototype,"items",void 0),t([o({readOnly:!0})],c.prototype,"needsRender",null),t([o({readOnly:!0})],c.prototype,"_watchUpdatingTracking",void 0),t([o({readOnly:!0
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import r from"../../core/Collection.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{WatchUpdatingTracking as i}from"../../core/support/WatchUpdatingTracking.js";import"../../libs/maquette/projection.js";import{createProjector as a}from"../../libs/maquette/projector.js";let c=class extends e{constructor(){super(...arguments),this.items=new r,this._watchUpdatingTracking=new i,this._callbacks=new Map,this._projector=a(),this._hiddenProjector=a()}get needsRender(){return this.items.length>0}get updating(){return this._watchUpdatingTracking?.updating??!1}initialize(){const t=document.createElement("div");t.className="esri-overlay-surface",this._set("surface",t),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),t.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange((()=>this.items),(t=>{for(const e of t.added){const t=()=>e.render();this._callbacks.set(e,t),this._projector.append(this.surface,t)}for(const e of t.removed){const t=this._projector.detach(this._callbacks.get(e));this.surface.removeChild(t.domNode),this._callbacks.delete(e)}}))}addItem(t){this.items.add(t)}removeItem(t){this.items.remove(t)}destroy(){this.items.removeAll(),this._callbacks.forEach((t=>this._projector.detach(t))),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(t){const e=this._hiddenSurface,r=this._hiddenProjector;let o=null;const s=()=>(o=t.render(),o);r.append(e,s),r.renderNow();const i={left:0,top:0,right:0,bottom:0};if(o&&o.domNode){const t=o.domNode.getBoundingClientRect();i.left=t.left,i.top=t.top,i.right=t.right,i.bottom=t.bottom}for(r.detach(s);e.firstChild;)e.removeChild(e.firstChild);return i}overlaps(t,e){const r=this.computeBoundingRect(t),o=this.computeBoundingRect(e);return Math.max(r.left,o.left)<=Math.min(r.right,o.right)&&Math.max(r.top,o.top)<=Math.min(r.bottom,o.bottom)}get hasVisibleItems(){return this.items.some((t=>t.visible))}renderCanvas(t){if(!this.items.some((t=>t.visible)))return;const e=t.getContext("2d");e.save(),e.font=`10px ${getComputedStyle(this.surface).fontFamily}`,this.items.forEach((t=>{e.save(),t.renderCanvas(e),e.restore()})),e.restore()}};t([o({readOnly:!0})],c.prototype,"surface",void 0),t([o({readOnly:!0})],c.prototype,"items",void 0),t([o({readOnly:!0})],c.prototype,"needsRender",null),t([o({readOnly:!0})],c.prototype,"_watchUpdatingTracking",void 0),t([o({readOnly:!0})],c.prototype,"updating",null),c=t([s("esri.views.overlay.ViewOverlay")],c);const n=c;export{n as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{isMeasurementSystem as s}from"../core/unitUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import a from"./AreaMeasurement3D/AreaMeasurement3DViewModel.js";import{accessibleHandler as l}from"./support/decorators/accessibleHandler.js";import{messageBundle as o}from"./support/decorators/messageBundle.js";import{tsx as u}from"./support/jsxFactory.js";import"./support/widgetUtils.js";const m="esri-area-measurement-3d",p={buttonDisabled:"esri-button--disabled",base:`${m} esri-widget esri-widget--panel`,container:`${m}__container`,hint:`${m}__hint`,hintText:`${m}__hint-text`,panelError:`${m}__panel--error`,measurement:`${m}__measurement`,measurementItem:`${m}__measurement-item`,measurementItemDisabled:`${m}__measurement-item--disabled`,measurementItemTitle:`${m}__measurement-item-title`,measurementItemValue:`${m}__measurement-item-value`,settings:`${m}__settings`,units:`${m}__units`,unitsLabel:`${m}__units-label`,unitsSelect:`${m}__units-select esri-select`,unitsSelectWrapper:`${m}__units-select-wrapper`,actionSection:`${m}__actions`,newMeasurementButton:`${m}__clear-button esri-button esri-button--primary`,widgetIcon:"esri-icon-measure-area"};let c=class extends r{constructor(e,t){super(e,t),this.iconClass=p.widgetIcon,this.viewModel=new a}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get label(){return this._get("label")??this.messages?.widgetLabel}set label(e){this._set("label",e)}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}render(){const{messages:e,messagesUnits:t}=this,{supported:i,active:n,measurement:r,state:a,unit:l}=this.viewModel,o="disabled"===a,m="measuring"===a||"measured"===a,c=n&&"ready"===a?u("section",{key:"esri-area-measurement-3d__hint",class:p.hint},u("p",{class:p.hintText},e.hint)):null,d=i?null:u("section",{key:"esri-area-measurement-3d__unsupported",class:p.panelError},u("p",null,e.unsupported)),v=(t,s,i)=>{switch(s.state){case"available":return u("div",{key:`${i}-enabled`,class:p.measurementItem},u("span",{class:p.measurementItemTitle},t),u("span",{class:p.measurementItemValue},s.text));case"unavailable":return u("div",{key:`${i}-disabled`,class:this.classes(p.measurementItem,p.measurementItemDisabled)},u("span",{class:p.measurementItemTitle},t));case"invalid":return u("div",{key:`${i}-enabled`,class:p.measurementItem},u("span",{class:p.measurementItemTitle},t),u("span",{class:p.measurementItemValue},e.notApplicable))}},_=m?u("section",{key:"esri-area-measurement-3d__measurement",class:p.measurement},v(e.area,r.area,"area"),v(e.perimeterLength,r.perimeterLength,"perimeter-length")):null,h=`${this.id}__units`,b=u("label",{class:p.unitsLabel,for:h},e.unit),w=u("div",{class:p.unitsSelectWrapper},u("select",{class:p.unitsSelect,id:h,onchange:this._changeUnit,bind:this,value:l},this.viewModel.unitOptions.map((e=>u("option",{key:e,value:e},s(e)?t.systems[e]:t.units[e]?.pluralCapitalized))))),y=m?u("section",{key:"esri-area-measurement-3d__units",class:p.units},b,w):null,g=m?u("div",{key:"settings",class:p.settings},y):null,M=!i||n&&!m?null:u("div",{class:p.actionSection},u("button",{disabled:o,class:this.classes(p.newMeasurementButton,o&&p.buttonDisabled),bind:this,onclick:this._newMeasurement,type:"button"},e.newMeasurement)),$=this.visible?u("div",{class:p.container},d,c,g,_,M):null;return u("div",{key:this,class:p.base,role:"presentation"},$)}_newMeasurement(){t(this.viewModel.start())}_changeUnit(e){const t=e.target,s=t.options[t.selectedIndex];s&&(this.unit=s.value)}};e([i()],c.prototype,"view",null),e([i()],c.prototype,"visible",null),e([i()],c.prototype,"active",null),e([i({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",null),e([i()],c.prototype,"iconClass",void 0),e([i()],c.prototype,"label",null),e([i(),o("esri/widgets/AreaMeasurement3D/t9n/AreaMeasurement3D")],c.prototype,"messages",void 0),e([i(),o("esri/core/t9n/Units")],c.prototype,"messagesUnits",void 0),e([i()],c.prototype,"uiStrings",void 0),e([i({type:a})],c.prototype,"viewModel",void 0),e([i()],c.prototype,"unitOptions",null),e([i()],c.prototype,"unit",null),e([l()],c.prototype,"_newMeasurement",null),e([l()],c.prototype,"_changeUnit",null),c=e([n("esri.widgets.AreaMeasurement3D")],c);const d=c;export{d as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{isMeasurementSystem as s}from"../core/unitUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import a from"./AreaMeasurement3D/AreaMeasurement3DViewModel.js";import{accessibleHandler as l}from"./support/decorators/accessibleHandler.js";import{messageBundle as o}from"./support/decorators/messageBundle.js";import{tsx as u}from"./support/jsxFactory.js";import"./support/widgetUtils.js";const m="esri-area-measurement-3d",p={buttonDisabled:"esri-button--disabled",base:`${m} esri-widget esri-widget--panel`,container:`${m}__container`,hint:`${m}__hint`,hintText:`${m}__hint-text`,panelError:`${m}__panel--error`,measurement:`${m}__measurement`,measurementItem:`${m}__measurement-item`,measurementItemDisabled:`${m}__measurement-item--disabled`,measurementItemTitle:`${m}__measurement-item-title`,measurementItemValue:`${m}__measurement-item-value`,settings:`${m}__settings`,units:`${m}__units`,unitsLabel:`${m}__units-label`,unitsSelect:`${m}__units-select esri-select`,unitsSelectWrapper:`${m}__units-select-wrapper`,actionSection:`${m}__actions`,newMeasurementButton:`${m}__clear-button esri-button esri-button--primary`,widgetIcon:"esri-icon-measure-area"};let c=class extends r{constructor(e,t){super(e,t),this.iconClass=p.widgetIcon,this.viewModel=new a}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get label(){return this._get("label")??this.messages?.widgetLabel??""}set label(e){this._set("label",e)}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}render(){const{messages:e,messagesUnits:t}=this,{supported:i,active:n,measurement:r,state:a,unit:l}=this.viewModel,o="disabled"===a,m="measuring"===a||"measured"===a,c=n&&"ready"===a?u("section",{key:"esri-area-measurement-3d__hint",class:p.hint},u("p",{class:p.hintText},e.hint)):null,d=i?null:u("section",{key:"esri-area-measurement-3d__unsupported",class:p.panelError},u("p",null,e.unsupported)),v=(t,s,i)=>{switch(s.state){case"available":return u("div",{key:`${i}-enabled`,class:p.measurementItem},u("span",{class:p.measurementItemTitle},t),u("span",{class:p.measurementItemValue},s.text));case"unavailable":return u("div",{key:`${i}-disabled`,class:this.classes(p.measurementItem,p.measurementItemDisabled)},u("span",{class:p.measurementItemTitle},t));case"invalid":return u("div",{key:`${i}-enabled`,class:p.measurementItem},u("span",{class:p.measurementItemTitle},t),u("span",{class:p.measurementItemValue},e.notApplicable))}},_=m?u("section",{key:"esri-area-measurement-3d__measurement",class:p.measurement},v(e.area,r.area,"area"),v(e.perimeterLength,r.perimeterLength,"perimeter-length")):null,h=`${this.id}__units`,b=u("label",{class:p.unitsLabel,for:h},e.unit),w=u("div",{class:p.unitsSelectWrapper},u("select",{class:p.unitsSelect,id:h,onchange:this._changeUnit,bind:this,value:l},this.viewModel.unitOptions.map((e=>u("option",{key:e,value:e},s(e)?t.systems[e]:t.units[e]?.pluralCapitalized))))),y=m?u("section",{key:"esri-area-measurement-3d__units",class:p.units},b,w):null,g=m?u("div",{key:"settings",class:p.settings},y):null,M=!i||n&&!m?null:u("div",{class:p.actionSection},u("button",{disabled:o,class:this.classes(p.newMeasurementButton,o&&p.buttonDisabled),bind:this,onclick:this._newMeasurement,type:"button"},e.newMeasurement)),$=this.visible?u("div",{class:p.container},d,c,g,_,M):null;return u("div",{key:this,class:p.base,role:"presentation"},$)}_newMeasurement(){t(this.viewModel.start())}_changeUnit(e){const t=e.target,s=t.options[t.selectedIndex];s&&(this.unit=s.value)}};e([i()],c.prototype,"view",null),e([i()],c.prototype,"visible",null),e([i()],c.prototype,"active",null),e([i({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",null),e([i()],c.prototype,"iconClass",void 0),e([i()],c.prototype,"label",null),e([i(),o("esri/widgets/AreaMeasurement3D/t9n/AreaMeasurement3D")],c.prototype,"messages",void 0),e([i(),o("esri/core/t9n/Units")],c.prototype,"messagesUnits",void 0),e([i()],c.prototype,"uiStrings",void 0),e([i({type:a})],c.prototype,"viewModel",void 0),e([i()],c.prototype,"unitOptions",null),e([i()],c.prototype,"unit",null),e([l()],c.prototype,"_newMeasurement",null),e([l()],c.prototype,"_changeUnit",null),c=e([n("esri.widgets.AreaMeasurement3D")],c);const d=c;export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../core/Accessor.js";import t from"../../core/Collection.js";import{referenceSetter as r}from"../../core/collectionUtils.js";import i from"../../core/Handles.js";import o from"../../core/Logger.js";import{isSome as l}from"../../core/maybe.js";import{isAbortError as a}from"../../core/promiseUtils.js";import{watch as p,whenOnce as n}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import y from"../../layers/BuildingSceneLayer.js";import c from"../../layers/support/BuildingFilter.js";import m from"./BuildingDisciplinesViewModel.js";import u from"./BuildingLevel.js";import f from"./BuildingPhase.js";import{showFullModel as g}from"./support/buildingLayerUtils.js";import{setFilterOnLayers as j,getFilterBlockSolid as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../core/Accessor.js";import t from"../../core/Collection.js";import{referenceSetter as r}from"../../core/collectionUtils.js";import i from"../../core/Handles.js";import o from"../../core/Logger.js";import{isSome as l}from"../../core/maybe.js";import{isAbortError as a}from"../../core/promiseUtils.js";import{watch as p,whenOnce as n}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import y from"../../layers/BuildingSceneLayer.js";import c from"../../layers/support/BuildingFilter.js";import m from"./BuildingDisciplinesViewModel.js";import u from"./BuildingLevel.js";import f from"./BuildingPhase.js";import{showFullModel as g}from"./support/buildingLayerUtils.js";import{setFilterOnLayers as j,getFilterBlockSolid as _,getFilterBlockXRay as v,generateFilterId as w}from"./support/filterUtils.js";import{createLoadLayersFunction as L}from"./support/layerUtils.js";let B=class extends s{constructor(e){super(e),this.view=null,this.state="disabled",this.level=new u,this.phase=new f,this.disciplines=new m,this._handles=new i,this._loadLayers=L(),this.layers=new t}initialize(){this._handles.add([this.layers.on("change",(()=>this._onLayersChange())),p((()=>({state:this.state,layers:this.layers,filter:this._filter})),(({state:e,layers:s,filter:t})=>{"ready"===e&&j(s,t)}),{initial:!0})]),this._onLayersChange()}destroy(){this._handles.destroy(),this.level.destroyed||this.level.destroy(),this.phase.destroyed||this.phase.destroy(),this.disciplines.destroyed||this.disciplines.destroy()}get isSupported(){return"3d"===this.view?.type}get layers(){return this._get("layers")}set layers(e){const s=e.filter((e=>e instanceof y));s.length!==e.length&&o.getLogger(this.declaredClass).error("Some layers are not BuildingSceneLayers but only BuildingSceneLayers can be passed to the widget."),this._set("layers",r(s,this._get("layers")))}get _filter(){const e=this.level.filterExpressions,s=this.phase.filterExpressions,t=[],r=_([e.solid,s.solid]);l(r)&&t.push(r);const i=v([e.xRay,s.xRay]);return l(i)&&t.push(i),0===t.length?null:new c({id:w(),name:"Building Explorer Filter",filterBlocks:t})}async _onLayersChange(){const e=this.layers;if(this.level.layers=e,this.phase.layers=e,this.disciplines.layers=e,0!==e.length){this._set("state","loading");try{await this._loadLayers(e),await Promise.all([n((()=>"ready"===this.level.state)),n((()=>"ready"===this.phase.state)),n((()=>"ready"===this.disciplines.state))]),e.forEach(g),this._set("state","ready")}catch(s){a(s)||this._set("state","failed")}}else this._set("state","disabled")}};e([d({value:null})],B.prototype,"view",void 0),e([d()],B.prototype,"isSupported",null),e([d({type:t,nonNullable:!0})],B.prototype,"layers",null),e([d({readOnly:!0})],B.prototype,"state",void 0),e([d({readOnly:!0,type:u})],B.prototype,"level",void 0),e([d({readOnly:!0,type:f})],B.prototype,"phase",void 0),e([d({readOnly:!0,type:m})],B.prototype,"disciplines",void 0),e([d()],B.prototype,"_filter",null),B=e([h("esri.widgets.BuildingExplorer.BuildingExplorerViewModel")],B);const b=B;export{b as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as s}from"../core/accessorSupport/decorators/cast.js";import{subclass as t}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import l from"./BuildingExplorer/BuildingExplorerViewModel.js";import o from"./BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js";import n from"./BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js";import a from"./BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js";import{Heading as d}from"./support/Heading.js";import{classes as p}from"./support/widgetUtils.js";import{messageBundle as c}from"./support/decorators/messageBundle.js";import{tsx as g}from"./support/jsxFactory.js";const h={levels:!0,phases:!0,disciplines:!0},u="esri-building-explorer",m={esriWidget:"esri-widget",esriWidgetDisabled:"esri-widget--disabled",esriIconLoadingIndicator:"esri-icon-loading-indicator",esriRotating:"esri-rotating",widgetIcon:"esri-icon-organization",base:`${u} esri-widget--panel`,panelError:`${u}__panel--error`,loadingContainer:`${u}__loading-container`,content:`${u}__content`,section:`${u}__section`,levels:`${u}__levels`,phases:`${u}__phases`,disciplines:`${u}__disciplines`};let v=class extends r{constructor(e,i){super(e,i),this._defaultViewModel=new l,this.viewModel=this._defaultViewModel,this.visibleElements={...h},this.headingLevel=3,this.iconClass=m.widgetIcon,this.messages=null,this.messagesCommon=null,this.toggleSiblingsVisibility=!1}destroy(){this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy()}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get layers(){return this.viewModel.layers}set layers(e){this.viewModel.layers=e}_castVisibleElements(e){return{...h,...e}}get label(){return this._get("label")??this.messages?.widgetLabel??""}set label(e){this._set("label",e)}render(){const e=this.viewModel,i="disabled"===e.state||!e.isSupported;return g("div",{key:this,class:p(m.esriWidget,m.base,{[m.esriWidgetDisabled]:i}),"aria-label":this.messages.widgetLabel},this._renderContent())}_renderContent(){const e=this.viewModel,i=this.messages;if(!e.isSupported)return g("p",{class:m.panelError},i.unsupported);if(!e.layers.length)return g("p",{class:m.panelError},i.noData);switch(e.state){case"loading":return this._renderLoadingIndicator();case"ready":return g("div",{key:"content",class:m.content},this._renderLevelPickerSection(),this._renderPhasePickerSection(),this._renderDisciplinesSection());case"failed":return g("p",{class:m.panelError},i.failed);default:return null}}_renderLoadingIndicator(){const e=this.messagesCommon.loading;return g("div",{key:"loading-container",role:"presentation",class:m.loadingContainer,"aria-label":e,title:e},g("span",{"aria-hidden":"true",class:p(m.esriIconLoadingIndicator,m.esriRotating)}))}_renderLevelPickerSection(){const e=this.viewModel.level,i="ready"===e.state,s=e.allowedValues.length>1;if(!this.visibleElements.levels||!i||!s)return null;const t=this.messages?.level;return g("div",{key:"levels",class:p(m.section,m.levels)},g(d,{level:this.headingLevel},t?.title),g(n,{vm:e,messages:t}))}_renderPhasePickerSection(){const e=this.viewModel.phase,i="ready"===e.state,s=e.allowedValues.length>1;if(!this.visibleElements.phases||!i||!s)return null;const t=this.messages.phase;return g("div",{key:"phases",class:p(m.section,m.phases)},g(d,{level:this.headingLevel},t.title),g(a,{vm:e,messages:t}))}_renderDisciplinesSection(){const e=this.viewModel.disciplines,i="ready"===e.state,s=e.root.hasChildren;if(!this.visibleElements.disciplines||!i||!s)return null;const t=this.messages?.disciplines;return g("div",{key:"disciplines",class:p(m.section,m.disciplines)},g(d,{level:this.headingLevel},t.title),g(o,{vm:e,messages:t,toggleSiblingsVisibility:this.toggleSiblingsVisibility}))}};e([i({type:l})],v.prototype,"viewModel",void 0),e([i()],v.prototype,"view",null),e([i()],v.prototype,"layers",null),e([i()],v.prototype,"visibleElements",void 0),e([s("visibleElements")],v.prototype,"_castVisibleElements",null),e([i()],v.prototype,"headingLevel",void 0),e([i()],v.prototype,"iconClass",void 0),e([i(),c("esri/widgets/BuildingExplorer/t9n/BuildingExplorer")],v.prototype,"messages",void 0),e([i(),c("esri/t9n/common")],v.prototype,"messagesCommon",void 0),e([i({nonNullable:!0})],v.prototype,"toggleSiblingsVisibility",void 0),e([i()],v.prototype,"uiStrings",void 0),v=e([t("esri.widgets.BuildingExplorer")],v);const y=v;export{y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import{isSome as s}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{fromUsng as n,fromUtm as a,fromMgrs as l,fromLatitudeLongitude as c,toUtm as p,toUsng as m,toMgrs as u,toLatitudeLongitude as h}from"../../../geometry/coordinateFormatter.js";import{isLoaded as d,project as f}from"../../../geometry/projection.js";import{equals as v}from"../../../geometry/support/spatialReferenceUtils.js";import{project as g}from"../../../geometry/support/webMercatorUtils.js";import{isValidPoint as P,fromXY as y,pointToCoordinate as b,getDegreePrecision as S}from"./coordinateConversionUtils.js";import w from"../../../geometry/SpatialReference.js";let _=class extends t{constructor(e){super(e),this.conversionInfo=null,this.coordinateSegments=null,this.defaultPattern=null,this.name=null,this.viewModel=null}get currentPattern(){return this._get("currentPattern")||this._get("defaultPattern")}set currentPattern(e){this._set("currentPattern",e)}get label(){return this._get("label")
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import{isSome as s}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{fromUsng as n,fromUtm as a,fromMgrs as l,fromLatitudeLongitude as c,toUtm as p,toUsng as m,toMgrs as u,toLatitudeLongitude as h}from"../../../geometry/coordinateFormatter.js";import{isLoaded as d,project as f}from"../../../geometry/projection.js";import{equals as v}from"../../../geometry/support/spatialReferenceUtils.js";import{project as g}from"../../../geometry/support/webMercatorUtils.js";import{isValidPoint as P,fromXY as y,pointToCoordinate as b,getDegreePrecision as S}from"./coordinateConversionUtils.js";import w from"../../../geometry/SpatialReference.js";let _=class extends t{constructor(e){super(e),this.conversionInfo=null,this.coordinateSegments=null,this.defaultPattern=null,this.name=null,this.viewModel=null}get currentPattern(){return this._get("currentPattern")||this._get("defaultPattern")}set currentPattern(e){this._set("currentPattern",e)}get label(){return this._get("label")??this.name??""}set label(e){this._set("label",e),this.notifyChange("label")}get hasDisplayProperties(){return!(!this.defaultPattern||!this.coordinateSegments)}get spatialReference(){const e=this.get("conversionInfo.spatialReference")||w.WGS84;return"basemap"===this.name?this._viewSpatialReference:e}set spatialReference(e){void 0===e&&this._clearOverride("spatialReference"),this._override("spatialReference",e)}get _viewSpatialReference(){return this.get("viewModel.view.spatialReference")||w.WGS84}get _additionalCharactersPattern(){const e=this.get("coordinateSegments");if(!e)return null;const t=e.map((e=>e.alias)),r=this.currentPattern.replace(new RegExp(`["nsew${t.join()}]`,"gi"),"").replace(/\ /g,"");return new RegExp(`[${r}]`,"g")}get test(){return{additionalCharactersPattern:this._additionalCharactersPattern}}convert(e){if(!P(e))return Promise.reject(new r("format:invalid-point","Could not convert invalid point.",{point:e}));const t=this.get("conversionInfo.convert");return t?Promise.resolve().then((()=>t(e))):this._project(e,this.spatialReference).then((e=>this._getCoordinate(e).then((t=>({location:e,coordinate:t})))))}getConversionStrategy(){const e=this._viewSpatialReference;return this.get("conversionInfo.convert")||this.get("viewModel.formatterAvailable")||"xy"===this.name&&(e.isWebMercator||e.isWGS84)||"basemap"===this.name?"client":"server"}getDisplayCoordinate(e){if(!e)return null;if(!this.coordinateSegments||!this.currentPattern)return e;let t=this.currentPattern;const r=this._getSegmentMatches(e,!1);for(let s=this.coordinateSegments.length-1;s>=0;s--){const e=this.coordinateSegments[s];t=t.replace(e.alias,r[s])}return t}parseUserInput(e){let t=this.defaultPattern.replace(this._additionalCharactersPattern,"");e=e.replace(this._additionalCharactersPattern,"");const r=this._getSegmentMatches(e,!0);for(let s=this.coordinateSegments.length-1;s>=0;s--){const e=this.coordinateSegments[s];t=t.replace(e.alias,r[s])}return t}_getSegmentMatches(e,t){const r=[];for(let s=0;s<this.coordinateSegments.length;s++){const o=this.coordinateSegments[s],i=e.match(o.searchPattern);if(!i){r.push("");continue}let n=i[0];if(e=e.replace(n,"").trim(),o.substitution){const e=t?o.substitution.input(n):o.substitution.output(n);e&&(n=e)}r.push(n)}return r}reverseConvert(e){const t=this.parseUserInput(e),s=this.get("conversionInfo.reverseConvert");let o;if(s)o=s(t);else if("xy"===this.name||"basemap"===this.name)o=y(t,this.spatialReference);else if(this.viewModel.formatterAvailable)switch(this.name){case"dd":case"ddm":case"dms":o=c(t,this.spatialReference);break;case"mgrs":{const e="automatic";o=l(t,this.spatialReference,e);break}case"utm":{const e="latitude-band-indicators";o=a(t,this.spatialReference,e);break}case"usng":o=n(t,this.spatialReference);break;default:o=null}return o?this._project(o,this._viewSpatialReference):Promise.reject(new r("format:invalid-input","Could not parse input into point.",{userInput:e}))}_getCoordinate(e){const t=this.get("viewModel.view.scale");if(!P(e))return Promise.reject(new r("format:invalid-point","Could not transform invalid point into coordinate.",{point:e}));if(this.get("viewModel.formatterAvailable")||"basemap"===this.name||"xy"===this.name)switch(this.name){case"dd":case"ddm":case"dms":{const r=S(t);return Promise.resolve(h(e,this.name,r))}case"mgrs":{const t=!1,r=5,s="automatic";return Promise.resolve(u(e,s,r,t))}case"usng":{const t=!1,r=5;return Promise.resolve(m(e,r,t))}case"utm":{const t=!0,r="latitude-band-indicators";return Promise.resolve(p(e,r,t))}default:return Promise.resolve(b(e,t))}return Promise.resolve(b(e,t))}_project(e,t){if(v(e.spatialReference,t)||!t)return Promise.resolve(e);if(this.viewModel?.formatterAvailable&&d())return Promise.resolve(f(e,t));if(!this.viewModel?.formatterAvailable){const r=g(e,t);if(s(r))return Promise.resolve(r)}return null}};e([o()],_.prototype,"conversionInfo",void 0),e([o()],_.prototype,"coordinateSegments",void 0),e([o()],_.prototype,"currentPattern",null),e([o()],_.prototype,"label",null),e([o()],_.prototype,"defaultPattern",void 0),e([o({readOnly:!0})],_.prototype,"hasDisplayProperties",null),e([o()],_.prototype,"name",void 0),e([o({type:w})],_.prototype,"spatialReference",null),e([o()],_.prototype,"viewModel",void 0),e([o({readOnly:!0})],_.prototype,"_viewSpatialReference",null),e([o({readOnly:!0})],_.prototype,"_additionalCharactersPattern",null),_=e([i("esri.widgets.CoordinateConversion.support.Format")],_);const j=_;export{j as default};
|
package/widgets/Daylight.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Logger.js";import{applySome as i,isNone as s}from"../core/maybe.js";import{watch as o,syncAndInitial as l,when as r}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{CSS as c}from"./Daylight/css.js";import h from"./Daylight/DaylightViewModel.js";import p from"./Daylight/VisibleElements.js";import{ORDERED_SEASONS as m}from"./Daylight/support/daylightUtils.js";import g from"./Daylight/support/SliderWithDropdown.js";import u from"./support/DatePicker.js";import{Heading as y}from"./support/Heading.js";import{getTimezoneInfos as b}from"./support/timeWidgetUtils.js";import"./support/widgetUtils.js";import{messageBundle as v}from"./support/decorators/messageBundle.js";import{tsx as w,tsxFragment as _}from"./support/jsxFactory.js";const S=/(.*)\s(.*)/,k="date",f="esri.widgets.Daylight";let M=class extends d{constructor(e,t){super(e,t),this.headingLevel=3,this.iconClass=c.widgetIcon,this.viewModel=new h,this.visibleElements=new p,this.dateOrSeason=k,this._timeSlider=new g({viewModel:this.viewModel.timeSliderViewModel,steps:this.timeSliderSteps,labelInputsEnabled:!1,visibleElements:{labels:!0},tickConfigs:[{mode:"position",values:[0,360,720,1080,1439],labelsVisible:!0,tickCreatedFunction:this._onPrimaryTickCreated.bind(this)},{mode:"position",values:[120,240,480,600,840,960,1200,1320],tickCreatedFunction:this._onSecondaryTickCreated.bind(this)}],items:[]}),this._datePicker=new u({viewModel:this.viewModel.datePickerViewModel,commitOnMonthChange:!0}),this._onPlayDayClick=()=>{this.viewModel.toggleDayPlaying()},this._onYearPlayClick=()=>{this.viewModel.toggleYearPlaying()},this._onSeasonChange=e=>{const t=e.target;this.viewModel.currentSeason=t.value},this._onSunLightingCheckboxChange=()=>{this.viewModel.toggleSunLightingEnabled()},this._onShadowCheckboxChange=()=>{this.viewModel.toggleDirectShadowsEnabled()}}get gmtOffsets(){return i(this.timezoneMessages,b)}get label(){return this._get("label")??this.messages?.title}set label(e){this._set("label",e)}get playSpeedMultiplier(){return this.viewModel.playSpeedMultiplier}set playSpeedMultiplier(e){this.viewModel.playSpeedMultiplier=e}get timeSliderSteps(){return this._timeSlider?.steps??5}set timeSliderSteps(e){this._timeSlider.steps=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get _useAmPm(){const e=this._timeSlider.viewModel.getLabelForValue(0,"tick");return S.test(e)}get _labelAlignmentClass(){const e=this.viewModel.timeSliderViewModel.values?.[0]??0,t=60*(this._useAmPm?4:3),i=60*(this._useAmPm?21:21.5);return e<t?c.sliderAlignLeft:e>i?c.sliderAlignRight:null}postInitialize(){this.viewModel.isSupported&&this.addHandles([o((()=>this.viewModel.datePickerViewModel),(e=>this._datePicker.viewModel=e),l),o((()=>this.viewModel.timeSliderViewModel),(e=>this._timeSlider.viewModel=e),l),o((()=>this.timezoneMessages.chooseTimezone),(e=>this._timeSlider.buttonTooltip=e),l),o((()=>this.visibleElements?.timezone),(e=>this._timeSlider.showDropDown=e),l),o((()=>!this.viewModel.sunLightingEnabled),(e=>{this._datePicker.disabled=e,this._timeSlider.disabled=e}),l),r((()=>this.gmtOffsets),(e=>{this._timeSlider.items=e.map((e=>({utcOffset:e.utcOffset,name:e.short,label:[e.shortWithUTC,e.long]})))}),l),o((()=>[this.viewModel.utcOffset,this.gmtOffsets]),(()=>this._onUTCOffsetChange()),l)])}destroy(){this._datePicker.destroy(),this._timeSlider.destroy()}render(){const{messages:e,viewModel:t,visibleElements:i}=this,s=t.isSupported;return w("div",{class:this.classes(c.base,c.widget)},s?w(_,null,i.header&&w(y,{level:this.headingLevel},e.title),this._renderTimeOptions(),i.datePicker&&this._renderDateOrSeason(),i.sunLightingToggle&&this._renderSunLightingToggle(),i.shadowsToggle&&this._renderShadowsToggle()):w("div",{key:"unsupported",class:c.panelError},w("p",null,e.unsupported)))}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-button.js"),import("@esri/calcite-components/dist/components/calcite-checkbox.js"),import("@esri/calcite-components/dist/components/calcite-label.js")])}_renderTimeOptions(){const{viewModel:e,visibleElements:t,messages:i}=this,{directShadowsEnabled:s,dayPlaying:o}=e,l=!e.sunLightingEnabled;return w("div",{class:this.classes(c.dayContainer,this._labelAlignmentClass,{[c.shadowOn]:s,[c.shadowOff]:!s,[c.sliderDateOn]:t.datePicker,[c.sliderDateOff]:!t.datePicker,[c.sliderAmPmOn]:this._useAmPm,[c.containerDisabled]:l}),key:"daylight-time-options"},this._timeSlider.render(),t.playButtons&&this._renderPlayPauseButton({playing:o,disabled:l,label:i.playDay,onClick:this._onPlayDayClick}))}_renderDateOptions(){const{viewModel:e,visibleElements:t,messages:i}=this,{yearPlaying:s}=e,o=!e.sunLightingEnabled;return w("div",{key:"daylight-date-options",class:this.classes(c.dateContainer,o&&c.containerDisabled)},this._datePicker.render(),t.playButtons&&this._renderPlayPauseButton({playing:s,disabled:o,label:i.playYear,onClick:this._onYearPlayClick}))}_renderPlayPauseButton({playing:e,disabled:t,label:i,onClick:s}){return w("calcite-button",{appearance:"solid",class:c.playPauseButton,disabled:t,"icon-start":e?"pause-f":"play-f",label:i,round:!0,title:i,type:"button",onclick:s})}_renderSeasonOptions(){const{messages:e,viewModel:t}=this,i=!t.sunLightingEnabled;return w("select",{class:this.classes(c.select,c.seasonPicker,i&&c.seasonPickerDisabled),disabled:i,value:t.currentSeason,"aria-label":e.season,onchange:this._onSeasonChange},m.map((t=>w("option",{value:t},e[t]))))}_renderDateOrSeason(){return"date"===this.dateOrSeason?this._renderDateOptions():this._renderSeasonOptions()}_renderSunLightingToggle(){const e=this.messages?.sunLightingToggle;return w("calcite-label",{key:"date-time-toggle",layout:"inline",title:e?.tooltip,scale:"s"},w("calcite-checkbox",{class:c.sunLightingCheckbox,checked:this.viewModel.sunLightingEnabled,onCalciteCheckboxChange:this._onSunLightingCheckboxChange}),e?.label)}_renderShadowsToggle(){const e=this.messages.shadowsToggle;return w("calcite-label",{key:"shadow-toggle",layout:"inline",title:e?.tooltip,scale:"s"},w("calcite-checkbox",{class:c.shadowsCheckbox,checked:this.viewModel.directShadowsEnabled,onCalciteCheckboxChange:this._onShadowCheckboxChange}),e.label)}_onUTCOffsetChange(){const e=this.viewModel.utcOffset,t=this._timeSlider.currentItem?.utcOffset,i=this.gmtOffsets;if(s(i)||t===e)return;const o=i.findIndex((({utcOffset:t})=>t===e));o>-1&&(this._timeSlider.currentIndex=o)}_onPrimaryTickCreated(e,t,i){t.classList.add(...C,c.primaryTick),i.classList.add(...C,c.primaryTickLabel),i.onclick=t.onclick=this._makeGoToTime(e);const s=S.exec(i.textContent);s&&(i.innerHTML=`${s[1]}<br><div class=${c.primaryTickAmPm}>${s[2]}</div>`)}_onSecondaryTickCreated(e,t){t.classList.add(...C,c.secondaryTick),t.onclick=this._makeGoToTime(e)}_makeGoToTime(e){return()=>{this.viewModel.timeSliderPosition=e}}};e([a({readOnly:!0})],M.prototype,"gmtOffsets",null),e([a(),v("esri/widgets/Daylight/t9n/Daylight")],M.prototype,"messages",void 0),e([a(),v("esri/widgets/support/t9n/timezone")],M.prototype,"timezoneMessages",void 0),e([a()],M.prototype,"headingLevel",void 0),e([a()],M.prototype,"iconClass",void 0),e([a()],M.prototype,"label",null),e([a()],M.prototype,"playSpeedMultiplier",null),e([a()],M.prototype,"timeSliderSteps",null),e([a()],M.prototype,"view",null),e([a({type:h})],M.prototype,"viewModel",void 0),e([a({type:p,nonNullable:!0})],M.prototype,"visibleElements",void 0),e([a({cast:e=>"season"===e||"date"===e?e:(t.getLogger(f).warn(`"${e}" is not a valid option. Acceptable values are only "date" or "season". Defaulting to "${k}".`),k)})],M.prototype,"dateOrSeason",void 0),e([a()],M.prototype,"_timeSlider",void 0),e([a()],M.prototype,"_useAmPm",null),e([a()],M.prototype,"_labelAlignmentClass",null),e([a()],M.prototype,"_datePicker",void 0),M=e([n(f)],M);const C=["esri-interactive","esri-widget__anchor"],P=M;export{P as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Logger.js";import{applySome as i,isNone as s}from"../core/maybe.js";import{watch as o,syncAndInitial as l,when as r}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import{CSS as c}from"./Daylight/css.js";import h from"./Daylight/DaylightViewModel.js";import p from"./Daylight/VisibleElements.js";import{ORDERED_SEASONS as m}from"./Daylight/support/daylightUtils.js";import g from"./Daylight/support/SliderWithDropdown.js";import u from"./support/DatePicker.js";import{Heading as y}from"./support/Heading.js";import{getTimezoneInfos as b}from"./support/timeWidgetUtils.js";import"./support/widgetUtils.js";import{messageBundle as v}from"./support/decorators/messageBundle.js";import{tsx as w,tsxFragment as _}from"./support/jsxFactory.js";const S=/(.*)\s(.*)/,k="date",f="esri.widgets.Daylight";let M=class extends d{constructor(e,t){super(e,t),this.headingLevel=3,this.iconClass=c.widgetIcon,this.viewModel=new h,this.visibleElements=new p,this.dateOrSeason=k,this._timeSlider=new g({viewModel:this.viewModel.timeSliderViewModel,steps:this.timeSliderSteps,labelInputsEnabled:!1,visibleElements:{labels:!0},tickConfigs:[{mode:"position",values:[0,360,720,1080,1439],labelsVisible:!0,tickCreatedFunction:this._onPrimaryTickCreated.bind(this)},{mode:"position",values:[120,240,480,600,840,960,1200,1320],tickCreatedFunction:this._onSecondaryTickCreated.bind(this)}],items:[]}),this._datePicker=new u({viewModel:this.viewModel.datePickerViewModel,commitOnMonthChange:!0}),this._onPlayDayClick=()=>{this.viewModel.toggleDayPlaying()},this._onYearPlayClick=()=>{this.viewModel.toggleYearPlaying()},this._onSeasonChange=e=>{const t=e.target;this.viewModel.currentSeason=t.value},this._onSunLightingCheckboxChange=()=>{this.viewModel.toggleSunLightingEnabled()},this._onShadowCheckboxChange=()=>{this.viewModel.toggleDirectShadowsEnabled()}}get gmtOffsets(){return i(this.timezoneMessages,b)}get label(){return this._get("label")??this.messages?.title??""}set label(e){this._set("label",e)}get playSpeedMultiplier(){return this.viewModel.playSpeedMultiplier}set playSpeedMultiplier(e){this.viewModel.playSpeedMultiplier=e}get timeSliderSteps(){return this._timeSlider?.steps??5}set timeSliderSteps(e){this._timeSlider.steps=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get _useAmPm(){const e=this._timeSlider.viewModel.getLabelForValue(0,"tick");return S.test(e)}get _labelAlignmentClass(){const e=this.viewModel.timeSliderViewModel.values?.[0]??0,t=60*(this._useAmPm?4:3),i=60*(this._useAmPm?21:21.5);return e<t?c.sliderAlignLeft:e>i?c.sliderAlignRight:null}postInitialize(){this.viewModel.isSupported&&this.addHandles([o((()=>this.viewModel.datePickerViewModel),(e=>this._datePicker.viewModel=e),l),o((()=>this.viewModel.timeSliderViewModel),(e=>this._timeSlider.viewModel=e),l),o((()=>this.timezoneMessages.chooseTimezone),(e=>this._timeSlider.buttonTooltip=e),l),o((()=>this.visibleElements?.timezone),(e=>this._timeSlider.showDropDown=e),l),o((()=>!this.viewModel.sunLightingEnabled),(e=>{this._datePicker.disabled=e,this._timeSlider.disabled=e}),l),r((()=>this.gmtOffsets),(e=>{this._timeSlider.items=e.map((e=>({utcOffset:e.utcOffset,name:e.short,label:[e.shortWithUTC,e.long]})))}),l),o((()=>[this.viewModel.utcOffset,this.gmtOffsets]),(()=>this._onUTCOffsetChange()),l)])}destroy(){this._datePicker.destroy(),this._timeSlider.destroy()}render(){const{messages:e,viewModel:t,visibleElements:i}=this,s=t.isSupported;return w("div",{class:this.classes(c.base,c.widget)},s?w(_,null,i.header&&w(y,{level:this.headingLevel},e.title),this._renderTimeOptions(),i.datePicker&&this._renderDateOrSeason(),i.sunLightingToggle&&this._renderSunLightingToggle(),i.shadowsToggle&&this._renderShadowsToggle()):w("div",{key:"unsupported",class:c.panelError},w("p",null,e.unsupported)))}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-button.js"),import("@esri/calcite-components/dist/components/calcite-checkbox.js"),import("@esri/calcite-components/dist/components/calcite-label.js")])}_renderTimeOptions(){const{viewModel:e,visibleElements:t,messages:i}=this,{directShadowsEnabled:s,dayPlaying:o}=e,l=!e.sunLightingEnabled;return w("div",{class:this.classes(c.dayContainer,this._labelAlignmentClass,{[c.shadowOn]:s,[c.shadowOff]:!s,[c.sliderDateOn]:t.datePicker,[c.sliderDateOff]:!t.datePicker,[c.sliderAmPmOn]:this._useAmPm,[c.containerDisabled]:l}),key:"daylight-time-options"},this._timeSlider.render(),t.playButtons&&this._renderPlayPauseButton({playing:o,disabled:l,label:i.playDay,onClick:this._onPlayDayClick}))}_renderDateOptions(){const{viewModel:e,visibleElements:t,messages:i}=this,{yearPlaying:s}=e,o=!e.sunLightingEnabled;return w("div",{key:"daylight-date-options",class:this.classes(c.dateContainer,o&&c.containerDisabled)},this._datePicker.render(),t.playButtons&&this._renderPlayPauseButton({playing:s,disabled:o,label:i.playYear,onClick:this._onYearPlayClick}))}_renderPlayPauseButton({playing:e,disabled:t,label:i,onClick:s}){return w("calcite-button",{appearance:"solid",class:c.playPauseButton,disabled:t,"icon-start":e?"pause-f":"play-f",label:i,round:!0,title:i,type:"button",onclick:s})}_renderSeasonOptions(){const{messages:e,viewModel:t}=this,i=!t.sunLightingEnabled;return w("select",{class:this.classes(c.select,c.seasonPicker,i&&c.seasonPickerDisabled),disabled:i,value:t.currentSeason,"aria-label":e.season,onchange:this._onSeasonChange},m.map((t=>w("option",{value:t},e[t]))))}_renderDateOrSeason(){return"date"===this.dateOrSeason?this._renderDateOptions():this._renderSeasonOptions()}_renderSunLightingToggle(){const e=this.messages?.sunLightingToggle;return w("calcite-label",{key:"date-time-toggle",layout:"inline",title:e?.tooltip,scale:"s"},w("calcite-checkbox",{class:c.sunLightingCheckbox,checked:this.viewModel.sunLightingEnabled,onCalciteCheckboxChange:this._onSunLightingCheckboxChange}),e?.label)}_renderShadowsToggle(){const e=this.messages.shadowsToggle;return w("calcite-label",{key:"shadow-toggle",layout:"inline",title:e?.tooltip,scale:"s"},w("calcite-checkbox",{class:c.shadowsCheckbox,checked:this.viewModel.directShadowsEnabled,onCalciteCheckboxChange:this._onShadowCheckboxChange}),e.label)}_onUTCOffsetChange(){const e=this.viewModel.utcOffset,t=this._timeSlider.currentItem?.utcOffset,i=this.gmtOffsets;if(s(i)||t===e)return;const o=i.findIndex((({utcOffset:t})=>t===e));o>-1&&(this._timeSlider.currentIndex=o)}_onPrimaryTickCreated(e,t,i){t.classList.add(...C,c.primaryTick),i.classList.add(...C,c.primaryTickLabel),i.onclick=t.onclick=this._makeGoToTime(e);const s=S.exec(i.textContent);s&&(i.innerHTML=`${s[1]}<br><div class=${c.primaryTickAmPm}>${s[2]}</div>`)}_onSecondaryTickCreated(e,t){t.classList.add(...C,c.secondaryTick),t.onclick=this._makeGoToTime(e)}_makeGoToTime(e){return()=>{this.viewModel.timeSliderPosition=e}}};e([a({readOnly:!0})],M.prototype,"gmtOffsets",null),e([a(),v("esri/widgets/Daylight/t9n/Daylight")],M.prototype,"messages",void 0),e([a(),v("esri/widgets/support/t9n/timezone")],M.prototype,"timezoneMessages",void 0),e([a()],M.prototype,"headingLevel",void 0),e([a()],M.prototype,"iconClass",void 0),e([a()],M.prototype,"label",null),e([a()],M.prototype,"playSpeedMultiplier",null),e([a()],M.prototype,"timeSliderSteps",null),e([a()],M.prototype,"view",null),e([a({type:h})],M.prototype,"viewModel",void 0),e([a({type:p,nonNullable:!0})],M.prototype,"visibleElements",void 0),e([a({cast:e=>"season"===e||"date"===e?e:(t.getLogger(f).warn(`"${e}" is not a valid option. Acceptable values are only "date" or "season". Defaulting to "${k}".`),k)})],M.prototype,"dateOrSeason",void 0),e([a()],M.prototype,"_timeSlider",void 0),e([a()],M.prototype,"_useAmPm",null),e([a()],M.prototype,"_labelAlignmentClass",null),e([a()],M.prototype,"_datePicker",void 0),M=e([n(f)],M);const C=["esri-interactive","esri-widget__anchor"],P=M;export{P as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{isMeasurementSystem as s}from"../core/unitUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import a from"./DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js";import{accessibleHandler as l}from"./support/decorators/accessibleHandler.js";import{messageBundle as o}from"./support/decorators/messageBundle.js";import{tsx as u}from"./support/jsxFactory.js";import"./support/widgetUtils.js";const c="esri-direct-line-measurement-3d",m={buttonDisabled:"esri-button--disabled",base:`${c} esri-widget esri-widget--panel`,container:`${c}__container`,hint:`${c}__hint`,hintText:`${c}__hint-text`,panelError:`${c}__panel--error`,measurement:`${c}__measurement`,measurementItem:`${c}__measurement-item`,measurementItemDisabled:`${c}__measurement-item--disabled`,measurementItemTitle:`${c}__measurement-item-title`,measurementItemValue:`${c}__measurement-item-value`,settings:`${c}__settings`,units:`${c}__units`,unitsLabel:`${c}__units-label`,unitsSelect:`${c}__units-select esri-select`,unitsSelectWrapper:`${c}__units-select-wrapper`,actionSection:`${c}__actions`,newMeasurementButton:`${c}__clear-button esri-button esri-button--primary`,widgetIcon:"esri-icon-measure-line"};let p=class extends r{constructor(e,t){super(e,t),this.iconClass=m.widgetIcon,this.viewModel=new a}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get label(){return this._get("label")??this.messages?.widgetLabel}set label(e){this._set("label",e)}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}render(){const{supported:e,active:t,state:i,measurement:n,unit:r}=this.viewModel,a="disabled"===i,l="ready"===i,o="measuring"===i||"measured"===i,{messages:c,messagesUnits:p}=this,d=t&&l?u("section",{key:"esri-direct-line-measurement-3d__hint",class:m.hint},u("p",{class:m.hintText},c.hint)):null,v=e?null:u("section",{key:"esri-direct-line-measurement-3d__unsupported",class:m.panelError},u("p",null,c.unsupported)),_=(e,t,s)=>{switch(t.state){case"available":return u("div",{key:`${s}-enabled`,class:m.measurementItem},u("span",{class:m.measurementItemTitle},e),u("span",{class:m.measurementItemValue},t.text));case"unavailable":return u("div",{key:`${s}-disabled`,class:this.classes(m.measurementItem,m.measurementItemDisabled)},u("span",{class:m.measurementItemTitle},e))}},h=o?u("section",{key:"esri-direct-line-measurement-3d__measurement",class:m.measurement},_(c.direct,n.directDistance,"direct"),_(c.horizontal,n.horizontalDistance,"horizontal"),_(c.vertical,n.verticalDistance,"vertical")):null,b=`${this.id}__units`,w=u("label",{class:m.unitsLabel,for:b},c.unit),y=u("div",{class:m.unitsSelectWrapper},u("select",{class:m.unitsSelect,id:b,onchange:this._changeUnit,bind:this,value:r},this.viewModel.unitOptions.map((e=>u("option",{key:e,value:e},s(e)?p.systems[e]:p.units[e]?.pluralCapitalized))))),g=u("section",{key:"esri-direct-line-measurement-3d__units",class:m.units},w,y),M=o?u("div",{key:"settings",class:m.settings},g):null,$=!e||t&&!o?null:u("div",{class:m.actionSection},u("button",{disabled:a,class:this.classes(m.newMeasurementButton,a&&m.buttonDisabled),bind:this,onclick:this._newMeasurement,type:"button"},c.newMeasurement)),D=this.visible?u("div",{class:m.container},v,d,M,h,$):null;return u("div",{key:this,class:m.base,role:"presentation"},D)}_newMeasurement(){t(this.viewModel.start())}_changeUnit(e){const t=e.target,s=t.options[t.selectedIndex];s&&(this.unit=s.value)}};e([i()],p.prototype,"view",null),e([i()],p.prototype,"visible",null),e([i()],p.prototype,"active",null),e([i({constructOnly:!0,nonNullable:!0})],p.prototype,"analysis",null),e([i()],p.prototype,"iconClass",void 0),e([i()],p.prototype,"label",null),e([i(),o("esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D")],p.prototype,"messages",void 0),e([i(),o("esri/core/t9n/Units")],p.prototype,"messagesUnits",void 0),e([i()],p.prototype,"uiStrings",void 0),e([i({type:a})],p.prototype,"viewModel",void 0),e([i()],p.prototype,"unitOptions",null),e([i()],p.prototype,"unit",null),e([l()],p.prototype,"_newMeasurement",null),e([l()],p.prototype,"_changeUnit",null),p=e([n("esri.widgets.DirectLineMeasurement3D")],p);const d=p;export{d as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{isMeasurementSystem as s}from"../core/unitUtils.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import a from"./DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js";import{accessibleHandler as l}from"./support/decorators/accessibleHandler.js";import{messageBundle as o}from"./support/decorators/messageBundle.js";import{tsx as u}from"./support/jsxFactory.js";import"./support/widgetUtils.js";const c="esri-direct-line-measurement-3d",m={buttonDisabled:"esri-button--disabled",base:`${c} esri-widget esri-widget--panel`,container:`${c}__container`,hint:`${c}__hint`,hintText:`${c}__hint-text`,panelError:`${c}__panel--error`,measurement:`${c}__measurement`,measurementItem:`${c}__measurement-item`,measurementItemDisabled:`${c}__measurement-item--disabled`,measurementItemTitle:`${c}__measurement-item-title`,measurementItemValue:`${c}__measurement-item-value`,settings:`${c}__settings`,units:`${c}__units`,unitsLabel:`${c}__units-label`,unitsSelect:`${c}__units-select esri-select`,unitsSelectWrapper:`${c}__units-select-wrapper`,actionSection:`${c}__actions`,newMeasurementButton:`${c}__clear-button esri-button esri-button--primary`,widgetIcon:"esri-icon-measure-line"};let p=class extends r{constructor(e,t){super(e,t),this.iconClass=m.widgetIcon,this.viewModel=new a}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get label(){return this._get("label")??this.messages?.widgetLabel??""}set label(e){this._set("label",e)}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}render(){const{supported:e,active:t,state:i,measurement:n,unit:r}=this.viewModel,a="disabled"===i,l="ready"===i,o="measuring"===i||"measured"===i,{messages:c,messagesUnits:p}=this,d=t&&l?u("section",{key:"esri-direct-line-measurement-3d__hint",class:m.hint},u("p",{class:m.hintText},c.hint)):null,v=e?null:u("section",{key:"esri-direct-line-measurement-3d__unsupported",class:m.panelError},u("p",null,c.unsupported)),_=(e,t,s)=>{switch(t.state){case"available":return u("div",{key:`${s}-enabled`,class:m.measurementItem},u("span",{class:m.measurementItemTitle},e),u("span",{class:m.measurementItemValue},t.text));case"unavailable":return u("div",{key:`${s}-disabled`,class:this.classes(m.measurementItem,m.measurementItemDisabled)},u("span",{class:m.measurementItemTitle},e))}},h=o?u("section",{key:"esri-direct-line-measurement-3d__measurement",class:m.measurement},_(c.direct,n.directDistance,"direct"),_(c.horizontal,n.horizontalDistance,"horizontal"),_(c.vertical,n.verticalDistance,"vertical")):null,b=`${this.id}__units`,w=u("label",{class:m.unitsLabel,for:b},c.unit),y=u("div",{class:m.unitsSelectWrapper},u("select",{class:m.unitsSelect,id:b,onchange:this._changeUnit,bind:this,value:r},this.viewModel.unitOptions.map((e=>u("option",{key:e,value:e},s(e)?p.systems[e]:p.units[e]?.pluralCapitalized))))),g=u("section",{key:"esri-direct-line-measurement-3d__units",class:m.units},w,y),M=o?u("div",{key:"settings",class:m.settings},g):null,$=!e||t&&!o?null:u("div",{class:m.actionSection},u("button",{disabled:a,class:this.classes(m.newMeasurementButton,a&&m.buttonDisabled),bind:this,onclick:this._newMeasurement,type:"button"},c.newMeasurement)),D=this.visible?u("div",{class:m.container},v,d,M,h,$):null;return u("div",{key:this,class:m.base,role:"presentation"},D)}_newMeasurement(){t(this.viewModel.start())}_changeUnit(e){const t=e.target,s=t.options[t.selectedIndex];s&&(this.unit=s.value)}};e([i()],p.prototype,"view",null),e([i()],p.prototype,"visible",null),e([i()],p.prototype,"active",null),e([i({constructOnly:!0,nonNullable:!0})],p.prototype,"analysis",null),e([i()],p.prototype,"iconClass",void 0),e([i()],p.prototype,"label",null),e([i(),o("esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D")],p.prototype,"messages",void 0),e([i(),o("esri/core/t9n/Units")],p.prototype,"messagesUnits",void 0),e([i()],p.prototype,"uiStrings",void 0),e([i({type:a})],p.prototype,"viewModel",void 0),e([i()],p.prototype,"unitOptions",null),e([i()],p.prototype,"unit",null),e([l()],p.prototype,"_newMeasurement",null),e([l()],p.prototype,"_changeUnit",null),p=e([n("esri.widgets.DirectLineMeasurement3D")],p);const d=p;export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import{createTask as e}from"../core/asyncUtils.js";import{isSome as s,destroyMaybe as i,isNone as r,applySome as o,abortMaybe as n}from"../core/maybe.js";import{memoize as a}from"../core/memoize.js";import{createAbortError as l}from"../core/promiseUtils.js";import{watch as h,initial as c}from"../core/reactiveUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import u from"./Widget.js";import{CSS as m}from"./ElevationProfile/css.js";import _ from"./ElevationProfile/ElevationProfileViewModel.js";import C from"./ElevationProfile/ElevationProfileVisibleElements.js";import{Legend as v}from"./ElevationProfile/components/Legend.js";import{SettingsButton as g}from"./ElevationProfile/components/SettingsButton.js";import{createChart as f}from"./ElevationProfile/support/chartUtils.js";import{ElevationProfileErrorState as y,getConfig as w,ElevationProfileState as b}from"./ElevationProfile/support/constants.js";import{onResize as k}from"./support/widgetUtils.js";import{messageBundle as S}from"./support/decorators/messageBundle.js";import{tsx as B}from"./support/jsxFactory.js";var M;!function(t){t.Sketch="sketch",t.SketchCancel="sketch-cancel",t.SketchDone="sketch-done",t.Select="select",t.SelectCancel="select-cancel"}(M||(M={}));const P=[{type:M.Select},{type:M.Sketch}],E={[y.None]:null,[y.NoValidInput]:"noProfile",[y.NoVisibleProfiles]:"noProfile",[y.RefinedButNoChartData]:"noProfile",[y.TooComplex]:"tooComplex",[y.UnknownError]:"unknown",[y.InvalidGeometry]:"invalidGeometry",[y.InvalidElevationInfo]:"invalidElevationInfo"};let j=class extends u{constructor(t,e){super(t,e),this.viewModel=null,this.visibleElements=new C,this.iconClass=m.widgetIcon,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this._chartContainer=null,this._chart=null,this._chartInitTask=null,this._chartIsRefined=!1,this._width=0,this._zoomOutButtonVisible=!1,this._getChartUpdateParamsMemoized=a(((t,e,s,i)=>({chart:t,data:e,stationary:s,messages:i}))),this._getDetailsPropsMemoized=a(((t,e)=>({effectiveUnits:t,profiles:e}))),t?.viewModel||(this._defaultViewModel=new _({view:t?.view}),this.viewModel=this._defaultViewModel)}initialize(){this._legend=new v(this._legendProps),this._settingsButton=new g(this._settingsButtonProps),this.addHandles([h((()=>this._legendProps),(t=>this._legend.set(t))),h((()=>this._settingsButtonProps),(t=>this._settingsButton.set(t)))])}postInitialize(){this.addHandles([h((()=>({container:this._chartContainer,width:this._width})),(({container:t,width:e})=>{this._destroyChart(),s(t)&&e>0&&this._initializeChart(t)}),c),h((()=>this._chartUpdateParams),(()=>this._updateChart(this._chartUpdateParams)),c)])}destroy(){this._destroyChart(),s(this._defaultViewModel)&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy(),this._legend=i(this._legend),this._settingsButton=i(this._settingsButton)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get input(){return this.viewModel.input}set input(t){this.viewModel.input=t}get profiles(){return this.viewModel.profiles}set profiles(t){this.viewModel.profiles=t}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(t){this.viewModel.unitOptions=t}get unit(){return this.viewModel.unit}set unit(t){this.viewModel.unit=t}get geodesicDistanceThreshold(){return this.viewModel.geodesicDistanceThreshold}set geodesicDistanceThreshold(t){this.viewModel.geodesicDistanceThreshold=t}get label(){return this._get("label")??this.messages?.widgetLabel}set label(t){this._set("label",t)}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}get _portrait(){return this._width<w().portraitModePixelBreakpoint}get _chartUpdateParams(){const t=this.view;return this._getChartUpdateParamsMemoized(this._chart,this.viewModel.chartData,!s(t)||t.stationary,this._chartMessages)}get _chartMessages(){return{...this.messagesUnits,...this.messages}}get _legendProps(){return this._getDetailsPropsMemoized(this.viewModel.effectiveUnits,this._profilesArray)}get _profilesArray(){return this.profiles.toArray()}get _settingsButtonProps(){return{viewModel:this.viewModel,visibleElements:this.visibleElements}}render(){const{viewModel:t,visible:e}=this;return B("div",{key:this,class:this.classes({[m.base]:e,[m.esriWidget]:e,[m.esriWidgetDisabled]:e&&"disabled"===t.state,[m.portrait]:this._portrait,[m.refined]:1===t.progress}),"aria-label":this.messages.widgetLabel,afterCreate:t=>{this.addHandles(k(t,(t=>{this._width=t.contentRect.width})))}},e&&this._renderContentForState())}_renderContentForState(){switch(this.viewModel.state){case b.Ready:return this._renderContentForReadyState();case b.Selecting:return this._renderContentForSelectingState();case b.Creating:return this._renderContentForCreatingState();case b.Selected:return this._renderContentForSelectedState();case b.Created:return this._renderContentForCreatedState();case b.Disabled:return this._renderContentForReadyState()}}_renderContentForReadyState(){const{sketchButton:t,selectButton:e}=this.visibleElements,s=this.messages;let i;return i=t&&e?s.readyPrompt:t?s.readyPromptCreateOnly:e?s.readyPromptSelectOnly:s.errors?.noProfile,this._renderContent({prompt:i,chart:!1,actions:P})}_renderContentForSelectingState(){const t=this.view;if(r(t))return null;const e=this.messages[`selectingPrompt-${t.type}`];return this._renderContent({prompt:e,chart:!1,actions:[{type:M.SelectCancel}]})}_renderContentForCreatingState(){const{view:t,viewModel:e}=this;if(r(t))return null;const s=e.hasVertices?[{type:M.SketchCancel},{type:M.SketchDone,disabled:!e.tool.interaction.canStopCreating}]:[{type:M.Select},{type:M.Sketch,disabled:!0}];if(e.errorState===y.NoValidInput){const e=this.messages[`creatingPrompt-${t.type}`];return this._renderContent({chart:!1,actions:s,prompt:e})}const i=this._getErrorMessage();return i?this._renderContent({chart:!1,actions:s,prompt:i}):this._renderContent({chart:!0,actions:s})}_renderContentForSelectedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:P,prompt:t}):this._renderContent({chart:!0,actions:P})}_renderContentForCreatedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:P,prompt:t}):this._renderContent({chart:!0,actions:P})}_getErrorMessage(){const t=E[this.viewModel.errorState];return this.messages?.errors?.[t]}_renderContent(t){const e=s(t.prompt)?this._renderPrompt(t.prompt):t.chart&&this._renderChart(),i=s(this.viewModel.input);return[B("header",{key:"header",class:m.header},this._zoomOutButtonVisible&&this._renderZoomOutButton(),this.visibleElements.clearButton&&i&&this._renderClearButton(),this.visibleElements.settingsButton&&this._settingsButton.render()),B("div",{class:m.mainContainer},e),this.visibleElements.legend&&this._legend.render(),this._renderActions(t)]}_renderZoomOutButton(){return B("button",{key:"zoom-out",class:m.zoomOutButton,bind:this,onclick:this._onZoomOutButtonClick,title:this.messages.zoomOut,type:"button"})}_onZoomOutButtonClick(){o(this._chart,(t=>t.zoomOut()))}_renderClearButton(){return B("button",{key:"clear-profile",class:m.clearButton,bind:this,onclick:this._onClearButtonClick,title:this.messages.clearProfile,type:"button"})}_onClearButtonClick(){this.viewModel.clear()}_renderPrompt(t){return[B("div",{key:"prompt-container",bind:this,class:m.promptContainer},B("p",null,t))]}_renderChart(){if(!this.visibleElements.chart)return[B("div",{key:"empty-chart-container",class:m.chartContainer})];const t=this._chartIsRefined||this._canRenderChart();if(!t)return[this._renderSpinner({size:"large"}),B("div",{key:"chart-container-empty",class:m.chartContainer})];const{chartData:e,progress:i}=this.viewModel;return[s(e)&&i>0&&i<1&&this._renderSpinner({size:t?"small":"large"}),B("div",{key:"chart-container",bind:this,class:m.chartContainer,afterCreate:this._onChartContainerAfterCreate,afterRemoved:this._onChartContainerRemoved})]}_renderSpinner(t){return B("div",{key:"spinner",class:this.classes(m.chartSpinner,{[m.chartSpinnerSmall]:"small"===t.size}),afterCreate:this._onSpinnerAfterCreate,exitAnimation:this._onSpinnerExit})}_onSpinnerAfterCreate(t){requestAnimationFrame((()=>t.classList.add(m.chartSpinnerVisible)))}_onSpinnerExit(t,e){t.classList.remove(m.chartSpinnerVisible),setTimeout(e,200)}_canRenderChart(){const t=this.viewModel.chartData;if(r(t))return!1;if(!this.viewModel.inputIsSketched)return t.refined;let e=0;for(const{samples:i}of t.lines)e+=s(i)?i.length:0;return t.refined||e<=w().largeChartSamples}_renderActions({actions:t}){const e=t.map((t=>{switch(t.type){case M.Sketch:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onSketchButtonClick,className:m.sketchButton,label:this.messages.sketchButtonLabel});case M.SketchCancel:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:m.sketchCancelButton,label:this.messagesCommon.cancel});case M.SketchDone:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onDoneButtonClick,className:m.sketchDoneButton,label:this.messagesCommon.done});case M.Select:return this.visibleElements.selectButton&&this._renderAction({action:t,onClick:this._onSelectButtonClick,className:m.selectButton,label:this.messages.selectButtonLabel});case M.SelectCancel:return this.visibleElements.selectButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:m.selectCancelButton,label:this.messagesCommon.cancel})}})).filter(Boolean);return e.length?B("footer",{key:"footer",class:m.footer},e):null}_renderAction({action:t,onClick:e,className:s,label:i}){return B("button",{key:`action-${t.type}`,class:this.classes(m.actionButton,s,{[m.buttonDisabled]:t.disabled}),bind:this,disabled:t.disabled,onclick:e,type:"button"},i)}_onSketchButtonClick(){this.viewModel.start({mode:"sketch"})}_onSelectButtonClick(){this.viewModel.start({mode:"select"})}_onCancelButtonClick(){this.viewModel.cancel()}_onDoneButtonClick(){this.viewModel.stop()}_updateChart(t){const{data:e,chart:i,messages:o,stationary:n}=t;!r(i)&&!r(o)&&n&&this._canRenderChart()&&(i.update(t),this._chartIsRefined=s(e)&&e.refined)}_onChartContainerAfterCreate(t){this._chartContainer=t}_onChartContainerRemoved(){this._chartContainer=null}_initializeChart(t){n(this._chartInitTask),this._chartInitTask=e((async e=>{const s=await f({container:t,abortOptions:{signal:e},onRangeChange:(t,e)=>{this._zoomOutButtonVisible=1!==t||1!==e},onCursorPositionChange:t=>{this.viewModel.hoveredChartPosition=t}});if(e.aborted)throw i(s),l();this._chart=s,this._updateChart(this._chartUpdateParams)}))}_destroyChart(){this._chartInitTask=n(this._chartInitTask),this._chart=i(this._chart),this._chartIsRefined=!1}get test(){return{projector:this._projector,chart:this._chart}}};t([d({type:_})],j.prototype,"viewModel",void 0),t([d()],j.prototype,"view",null),t([d()],j.prototype,"input",null),t([d()],j.prototype,"profiles",null),t([d()],j.prototype,"unitOptions",null),t([d()],j.prototype,"unit",null),t([d()],j.prototype,"geodesicDistanceThreshold",null),t([d({type:C,nonNullable:!0})],j.prototype,"visibleElements",void 0),t([d()],j.prototype,"iconClass",void 0),t([d()],j.prototype,"label",null),t([d()],j.prototype,"visible",null),t([d(),S("esri/widgets/ElevationProfile/t9n/ElevationProfile")],j.prototype,"messages",void 0),t([d(),S("esri/t9n/common")],j.prototype,"messagesCommon",void 0),t([d(),S("esri/core/t9n/Units")],j.prototype,"messagesUnits",void 0),t([d()],j.prototype,"_chartContainer",void 0),t([d()],j.prototype,"_chart",void 0),t([d()],j.prototype,"_chartInitTask",void 0),t([d()],j.prototype,"_chartIsRefined",void 0),t([d()],j.prototype,"_settingsButton",void 0),t([d()],j.prototype,"_legend",void 0),t([d()],j.prototype,"_width",void 0),t([d()],j.prototype,"_portrait",null),t([d()],j.prototype,"_zoomOutButtonVisible",void 0),t([d()],j.prototype,"_chartUpdateParams",null),t([d()],j.prototype,"_chartMessages",null),t([d()],j.prototype,"_legendProps",null),t([d()],j.prototype,"_profilesArray",null),t([d()],j.prototype,"_settingsButtonProps",null),j=t([p("esri.widgets.ElevationProfile")],j);const z=j;export{z as default};
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import{createTask as e}from"../core/asyncUtils.js";import{isSome as s,destroyMaybe as i,isNone as r,applySome as o,abortMaybe as n}from"../core/maybe.js";import{memoize as a}from"../core/memoize.js";import{createAbortError as l}from"../core/promiseUtils.js";import{watch as h,initial as c}from"../core/reactiveUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import u from"./Widget.js";import{CSS as m}from"./ElevationProfile/css.js";import _ from"./ElevationProfile/ElevationProfileViewModel.js";import C from"./ElevationProfile/ElevationProfileVisibleElements.js";import{Legend as v}from"./ElevationProfile/components/Legend.js";import{SettingsButton as g}from"./ElevationProfile/components/SettingsButton.js";import{createChart as f}from"./ElevationProfile/support/chartUtils.js";import{ElevationProfileErrorState as y,getConfig as w,ElevationProfileState as b}from"./ElevationProfile/support/constants.js";import{onResize as k}from"./support/widgetUtils.js";import{messageBundle as S}from"./support/decorators/messageBundle.js";import{tsx as B}from"./support/jsxFactory.js";var M;!function(t){t.Sketch="sketch",t.SketchCancel="sketch-cancel",t.SketchDone="sketch-done",t.Select="select",t.SelectCancel="select-cancel"}(M||(M={}));const P=[{type:M.Select},{type:M.Sketch}],E={[y.None]:null,[y.NoValidInput]:"noProfile",[y.NoVisibleProfiles]:"noProfile",[y.RefinedButNoChartData]:"noProfile",[y.TooComplex]:"tooComplex",[y.UnknownError]:"unknown",[y.InvalidGeometry]:"invalidGeometry",[y.InvalidElevationInfo]:"invalidElevationInfo"};let j=class extends u{constructor(t,e){super(t,e),this.viewModel=null,this.visibleElements=new C,this.iconClass=m.widgetIcon,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this._chartContainer=null,this._chart=null,this._chartInitTask=null,this._chartIsRefined=!1,this._width=0,this._zoomOutButtonVisible=!1,this._getChartUpdateParamsMemoized=a(((t,e,s,i)=>({chart:t,data:e,stationary:s,messages:i}))),this._getDetailsPropsMemoized=a(((t,e)=>({effectiveUnits:t,profiles:e}))),t?.viewModel||(this._defaultViewModel=new _({view:t?.view}),this.viewModel=this._defaultViewModel)}initialize(){this._legend=new v(this._legendProps),this._settingsButton=new g(this._settingsButtonProps),this.addHandles([h((()=>this._legendProps),(t=>this._legend.set(t))),h((()=>this._settingsButtonProps),(t=>this._settingsButton.set(t)))])}postInitialize(){this.addHandles([h((()=>({container:this._chartContainer,width:this._width})),(({container:t,width:e})=>{this._destroyChart(),s(t)&&e>0&&this._initializeChart(t)}),c),h((()=>this._chartUpdateParams),(()=>this._updateChart(this._chartUpdateParams)),c)])}destroy(){this._destroyChart(),s(this._defaultViewModel)&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy(),this._legend=i(this._legend),this._settingsButton=i(this._settingsButton)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get input(){return this.viewModel.input}set input(t){this.viewModel.input=t}get profiles(){return this.viewModel.profiles}set profiles(t){this.viewModel.profiles=t}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(t){this.viewModel.unitOptions=t}get unit(){return this.viewModel.unit}set unit(t){this.viewModel.unit=t}get geodesicDistanceThreshold(){return this.viewModel.geodesicDistanceThreshold}set geodesicDistanceThreshold(t){this.viewModel.geodesicDistanceThreshold=t}get label(){return this._get("label")??this.messages?.widgetLabel??""}set label(t){this._set("label",t)}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}get _portrait(){return this._width<w().portraitModePixelBreakpoint}get _chartUpdateParams(){const t=this.view;return this._getChartUpdateParamsMemoized(this._chart,this.viewModel.chartData,!s(t)||t.stationary,this._chartMessages)}get _chartMessages(){return{...this.messagesUnits,...this.messages}}get _legendProps(){return this._getDetailsPropsMemoized(this.viewModel.effectiveUnits,this._profilesArray)}get _profilesArray(){return this.profiles.toArray()}get _settingsButtonProps(){return{viewModel:this.viewModel,visibleElements:this.visibleElements}}render(){const{viewModel:t,visible:e}=this;return B("div",{key:this,class:this.classes({[m.base]:e,[m.esriWidget]:e,[m.esriWidgetDisabled]:e&&"disabled"===t.state,[m.portrait]:this._portrait,[m.refined]:1===t.progress}),"aria-label":this.messages.widgetLabel,afterCreate:t=>{this.addHandles(k(t,(t=>{this._width=t.contentRect.width})))}},e&&this._renderContentForState())}_renderContentForState(){switch(this.viewModel.state){case b.Ready:return this._renderContentForReadyState();case b.Selecting:return this._renderContentForSelectingState();case b.Creating:return this._renderContentForCreatingState();case b.Selected:return this._renderContentForSelectedState();case b.Created:return this._renderContentForCreatedState();case b.Disabled:return this._renderContentForReadyState()}}_renderContentForReadyState(){const{sketchButton:t,selectButton:e}=this.visibleElements,s=this.messages;let i;return i=t&&e?s.readyPrompt:t?s.readyPromptCreateOnly:e?s.readyPromptSelectOnly:s.errors?.noProfile,this._renderContent({prompt:i,chart:!1,actions:P})}_renderContentForSelectingState(){const t=this.view;if(r(t))return null;const e=this.messages[`selectingPrompt-${t.type}`];return this._renderContent({prompt:e,chart:!1,actions:[{type:M.SelectCancel}]})}_renderContentForCreatingState(){const{view:t,viewModel:e}=this;if(r(t))return null;const s=e.hasVertices?[{type:M.SketchCancel},{type:M.SketchDone,disabled:!e.tool.interaction.canStopCreating}]:[{type:M.Select},{type:M.Sketch,disabled:!0}];if(e.errorState===y.NoValidInput){const e=this.messages[`creatingPrompt-${t.type}`];return this._renderContent({chart:!1,actions:s,prompt:e})}const i=this._getErrorMessage();return i?this._renderContent({chart:!1,actions:s,prompt:i}):this._renderContent({chart:!0,actions:s})}_renderContentForSelectedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:P,prompt:t}):this._renderContent({chart:!0,actions:P})}_renderContentForCreatedState(){const t=this._getErrorMessage();return t?this._renderContent({chart:!1,actions:P,prompt:t}):this._renderContent({chart:!0,actions:P})}_getErrorMessage(){const t=E[this.viewModel.errorState];return this.messages?.errors?.[t]}_renderContent(t){const e=s(t.prompt)?this._renderPrompt(t.prompt):t.chart&&this._renderChart(),i=s(this.viewModel.input);return[B("header",{key:"header",class:m.header},this._zoomOutButtonVisible&&this._renderZoomOutButton(),this.visibleElements.clearButton&&i&&this._renderClearButton(),this.visibleElements.settingsButton&&this._settingsButton.render()),B("div",{class:m.mainContainer},e),this.visibleElements.legend&&this._legend.render(),this._renderActions(t)]}_renderZoomOutButton(){return B("button",{key:"zoom-out",class:m.zoomOutButton,bind:this,onclick:this._onZoomOutButtonClick,title:this.messages.zoomOut,type:"button"})}_onZoomOutButtonClick(){o(this._chart,(t=>t.zoomOut()))}_renderClearButton(){return B("button",{key:"clear-profile",class:m.clearButton,bind:this,onclick:this._onClearButtonClick,title:this.messages.clearProfile,type:"button"})}_onClearButtonClick(){this.viewModel.clear()}_renderPrompt(t){return[B("div",{key:"prompt-container",bind:this,class:m.promptContainer},B("p",null,t))]}_renderChart(){if(!this.visibleElements.chart)return[B("div",{key:"empty-chart-container",class:m.chartContainer})];const t=this._chartIsRefined||this._canRenderChart();if(!t)return[this._renderSpinner({size:"large"}),B("div",{key:"chart-container-empty",class:m.chartContainer})];const{chartData:e,progress:i}=this.viewModel;return[s(e)&&i>0&&i<1&&this._renderSpinner({size:t?"small":"large"}),B("div",{key:"chart-container",bind:this,class:m.chartContainer,afterCreate:this._onChartContainerAfterCreate,afterRemoved:this._onChartContainerRemoved})]}_renderSpinner(t){return B("div",{key:"spinner",class:this.classes(m.chartSpinner,{[m.chartSpinnerSmall]:"small"===t.size}),afterCreate:this._onSpinnerAfterCreate,exitAnimation:this._onSpinnerExit})}_onSpinnerAfterCreate(t){requestAnimationFrame((()=>t.classList.add(m.chartSpinnerVisible)))}_onSpinnerExit(t,e){t.classList.remove(m.chartSpinnerVisible),setTimeout(e,200)}_canRenderChart(){const t=this.viewModel.chartData;if(r(t))return!1;if(!this.viewModel.inputIsSketched)return t.refined;let e=0;for(const{samples:i}of t.lines)e+=s(i)?i.length:0;return t.refined||e<=w().largeChartSamples}_renderActions({actions:t}){const e=t.map((t=>{switch(t.type){case M.Sketch:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onSketchButtonClick,className:m.sketchButton,label:this.messages.sketchButtonLabel});case M.SketchCancel:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:m.sketchCancelButton,label:this.messagesCommon.cancel});case M.SketchDone:return this.visibleElements.sketchButton&&this._renderAction({action:t,onClick:this._onDoneButtonClick,className:m.sketchDoneButton,label:this.messagesCommon.done});case M.Select:return this.visibleElements.selectButton&&this._renderAction({action:t,onClick:this._onSelectButtonClick,className:m.selectButton,label:this.messages.selectButtonLabel});case M.SelectCancel:return this.visibleElements.selectButton&&this._renderAction({action:t,onClick:this._onCancelButtonClick,className:m.selectCancelButton,label:this.messagesCommon.cancel})}})).filter(Boolean);return e.length?B("footer",{key:"footer",class:m.footer},e):null}_renderAction({action:t,onClick:e,className:s,label:i}){return B("button",{key:`action-${t.type}`,class:this.classes(m.actionButton,s,{[m.buttonDisabled]:t.disabled}),bind:this,disabled:t.disabled,onclick:e,type:"button"},i)}_onSketchButtonClick(){this.viewModel.start({mode:"sketch"})}_onSelectButtonClick(){this.viewModel.start({mode:"select"})}_onCancelButtonClick(){this.viewModel.cancel()}_onDoneButtonClick(){this.viewModel.stop()}_updateChart(t){const{data:e,chart:i,messages:o,stationary:n}=t;!r(i)&&!r(o)&&n&&this._canRenderChart()&&(i.update(t),this._chartIsRefined=s(e)&&e.refined)}_onChartContainerAfterCreate(t){this._chartContainer=t}_onChartContainerRemoved(){this._chartContainer=null}_initializeChart(t){n(this._chartInitTask),this._chartInitTask=e((async e=>{const s=await f({container:t,abortOptions:{signal:e},onRangeChange:(t,e)=>{this._zoomOutButtonVisible=1!==t||1!==e},onCursorPositionChange:t=>{this.viewModel.hoveredChartPosition=t}});if(e.aborted)throw i(s),l();this._chart=s,this._updateChart(this._chartUpdateParams)}))}_destroyChart(){this._chartInitTask=n(this._chartInitTask),this._chart=i(this._chart),this._chartIsRefined=!1}get test(){return{projector:this._projector,chart:this._chart}}};t([d({type:_})],j.prototype,"viewModel",void 0),t([d()],j.prototype,"view",null),t([d()],j.prototype,"input",null),t([d()],j.prototype,"profiles",null),t([d()],j.prototype,"unitOptions",null),t([d()],j.prototype,"unit",null),t([d()],j.prototype,"geodesicDistanceThreshold",null),t([d({type:C,nonNullable:!0})],j.prototype,"visibleElements",void 0),t([d()],j.prototype,"iconClass",void 0),t([d()],j.prototype,"label",null),t([d()],j.prototype,"visible",null),t([d(),S("esri/widgets/ElevationProfile/t9n/ElevationProfile")],j.prototype,"messages",void 0),t([d(),S("esri/t9n/common")],j.prototype,"messagesCommon",void 0),t([d(),S("esri/core/t9n/Units")],j.prototype,"messagesUnits",void 0),t([d()],j.prototype,"_chartContainer",void 0),t([d()],j.prototype,"_chart",void 0),t([d()],j.prototype,"_chartInitTask",void 0),t([d()],j.prototype,"_chartIsRefined",void 0),t([d()],j.prototype,"_settingsButton",void 0),t([d()],j.prototype,"_legend",void 0),t([d()],j.prototype,"_width",void 0),t([d()],j.prototype,"_portrait",null),t([d()],j.prototype,"_zoomOutButtonVisible",void 0),t([d()],j.prototype,"_chartUpdateParams",null),t([d()],j.prototype,"_chartMessages",null),t([d()],j.prototype,"_legendProps",null),t([d()],j.prototype,"_profilesArray",null),t([d()],j.prototype,"_settingsButtonProps",null),j=t([p("esri.widgets.ElevationProfile")],j);const z=j;export{z as default};
|
package/widgets/LineOfSight.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import n from"./Widget.js";import o from"./LineOfSight/LineOfSightViewModel.js";import{accessibleHandler as r}from"./support/decorators/accessibleHandler.js";import{messageBundle as l}from"./support/decorators/messageBundle.js";import{tsx as a}from"./support/jsxFactory.js";import"./support/widgetUtils.js";const u={button:"esri-button",buttonDisabled:"esri-button--disabled",widgetIcon:"esri-icon-line-of-sight",base:"esri-line-of-sight esri-widget esri-widget--panel",container:"esri-line-of-sight__container",actionSection:"esri-line-of-sight__actions",hint:"esri-line-of-sight__hint",hintText:"esri-line-of-sight__hint-text",panelError:"esri-line-of-sight__panel--error",newAnalysisButton:"esri-line-of-sight__new-analysis-button esri-button--primary",secondaryButton:"esri-line-of-sight__secondary-button esri-button--secondary"},d={newAnalysisButton:"esri-line-of-sight__new-button",continueButton:"esri-line-of-sight__continue-button",doneButton:"esri-line-of-sight__done-button"};let p=class extends n{constructor(e,t){super(e,t),this.iconClass=u.widgetIcon,this.messages=null,this.viewModel=new o}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get label(){return this._get("label")??this.messages?.widgetLabel}set label(e){this._set("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){return a("div",{class:u.base,role:"presentation"},this.renderContainerNode())}renderContainerNode(){if(!this.visible)return null;if(!this.viewModel.supported)return this._renderUnsupportedMessage();let e=null;const t=[this._renderNewAnalysisButton()];return"creating"===this.viewModel.state?(e=this._renderHint(),t.unshift(this._renderDoneButton())):"created"===this.viewModel.state&&this.viewModel.targets.length>0&&t.unshift(this._renderContinueButton()),a("div",{class:u.container},e,a("div",{class:u.actionSection},t))}_renderUnsupportedMessage(){return a("div",{class:u.panelError,key:"esri-line-of-sight__unsupported"},a("p",null,this.messages.unsupported))}_renderHint(){return a("div",{class:u.hint,key:"esri-line-of-sight__hint"},a("p",{class:u.hintText},this.messages.hint))}_renderNewAnalysisButton(){return this._renderButton(this._onNewAnalysis,this.messages.newAnalysis,u.newAnalysisButton,d.newAnalysisButton)}_renderDoneButton(){return this._renderButton(this._onDone,this.messages.done,u.secondaryButton,d.doneButton)}_renderContinueButton(){return this._renderButton(this._onContinue,this.messages.continueAnalysis,u.secondaryButton,d.newAnalysisButton)}_renderButton(e,t,s,i){const n="disabled"===this.viewModel.state;return a("button",{disabled:n,class:this.classes(s,u.button,n&&u.buttonDisabled),bind:this,onclick:e,key:i,type:"button","data-id":i},t)}_onNewAnalysis(){t(this.viewModel.start())}_onDone(){this.viewModel.stop()}_onContinue(){this.viewModel.continue()}get test(){return{IDS:d,projector:this._projector}}};e([s()],p.prototype,"active",null),e([s({constructOnly:!0,nonNullable:!0})],p.prototype,"analysis",null),e([s()],p.prototype,"iconClass",void 0),e([s()],p.prototype,"label",null),e([s(),l("esri/widgets/LineOfSight/t9n/LineOfSight")],p.prototype,"messages",void 0),e([s()],p.prototype,"view",null),e([s({type:o})],p.prototype,"viewModel",void 0),e([s()],p.prototype,"visible",null),e([r()],p.prototype,"_onNewAnalysis",null),e([r()],p.prototype,"_onDone",null),e([r()],p.prototype,"_onContinue",null),p=e([i("esri.widgets.LineOfSight")],p);const h=p;export{h as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import n from"./Widget.js";import o from"./LineOfSight/LineOfSightViewModel.js";import{accessibleHandler as r}from"./support/decorators/accessibleHandler.js";import{messageBundle as l}from"./support/decorators/messageBundle.js";import{tsx as a}from"./support/jsxFactory.js";import"./support/widgetUtils.js";const u={button:"esri-button",buttonDisabled:"esri-button--disabled",widgetIcon:"esri-icon-line-of-sight",base:"esri-line-of-sight esri-widget esri-widget--panel",container:"esri-line-of-sight__container",actionSection:"esri-line-of-sight__actions",hint:"esri-line-of-sight__hint",hintText:"esri-line-of-sight__hint-text",panelError:"esri-line-of-sight__panel--error",newAnalysisButton:"esri-line-of-sight__new-analysis-button esri-button--primary",secondaryButton:"esri-line-of-sight__secondary-button esri-button--secondary"},d={newAnalysisButton:"esri-line-of-sight__new-button",continueButton:"esri-line-of-sight__continue-button",doneButton:"esri-line-of-sight__done-button"};let p=class extends n{constructor(e,t){super(e,t),this.iconClass=u.widgetIcon,this.messages=null,this.viewModel=new o}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get label(){return this._get("label")??this.messages?.widgetLabel??""}set label(e){this._set("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){return a("div",{class:u.base,role:"presentation"},this.renderContainerNode())}renderContainerNode(){if(!this.visible)return null;if(!this.viewModel.supported)return this._renderUnsupportedMessage();let e=null;const t=[this._renderNewAnalysisButton()];return"creating"===this.viewModel.state?(e=this._renderHint(),t.unshift(this._renderDoneButton())):"created"===this.viewModel.state&&this.viewModel.targets.length>0&&t.unshift(this._renderContinueButton()),a("div",{class:u.container},e,a("div",{class:u.actionSection},t))}_renderUnsupportedMessage(){return a("div",{class:u.panelError,key:"esri-line-of-sight__unsupported"},a("p",null,this.messages.unsupported))}_renderHint(){return a("div",{class:u.hint,key:"esri-line-of-sight__hint"},a("p",{class:u.hintText},this.messages.hint))}_renderNewAnalysisButton(){return this._renderButton(this._onNewAnalysis,this.messages.newAnalysis,u.newAnalysisButton,d.newAnalysisButton)}_renderDoneButton(){return this._renderButton(this._onDone,this.messages.done,u.secondaryButton,d.doneButton)}_renderContinueButton(){return this._renderButton(this._onContinue,this.messages.continueAnalysis,u.secondaryButton,d.newAnalysisButton)}_renderButton(e,t,s,i){const n="disabled"===this.viewModel.state;return a("button",{disabled:n,class:this.classes(s,u.button,n&&u.buttonDisabled),bind:this,onclick:e,key:i,type:"button","data-id":i},t)}_onNewAnalysis(){t(this.viewModel.start())}_onDone(){this.viewModel.stop()}_onContinue(){this.viewModel.continue()}get test(){return{IDS:d,projector:this._projector}}};e([s()],p.prototype,"active",null),e([s({constructOnly:!0,nonNullable:!0})],p.prototype,"analysis",null),e([s()],p.prototype,"iconClass",void 0),e([s()],p.prototype,"label",null),e([s(),l("esri/widgets/LineOfSight/t9n/LineOfSight")],p.prototype,"messages",void 0),e([s()],p.prototype,"view",null),e([s({type:o})],p.prototype,"viewModel",void 0),e([s()],p.prototype,"visible",null),e([r()],p.prototype,"_onNewAnalysis",null),e([r()],p.prototype,"_onDone",null),e([r()],p.prototype,"_onContinue",null),p=e([i("esri.widgets.LineOfSight")],p);const h=p;export{h as default};
|
package/widgets/ShadowCast.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import i from"../core/Handles.js";import{destroyMaybe as t,isNone as s,applySome as o,isSome as a}from"../core/maybe.js";import{watch as r,syncAndInitial as l}from"../core/reactiveUtils.js";import{convertTime as n}from"../core/timeUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{substitute as c}from"../intl/substitute.js";import h from"./Slider.js";import p from"./Widget.js";import{CSS as u}from"./ShadowCast/css.js";import{ShadowCastState as v}from"./ShadowCast/ShadowCastState.js";import w from"./ShadowCast/ShadowCastViewModel.js";import g from"./ShadowCast/ShadowCastVisibleElements.js";import{ShadowVisualizationType as f}from"./ShadowCast/ShadowVisualizationType.js";import{DiscreteConfigurator as b}from"./ShadowCast/components/DiscreteConfigurator.js";import{DurationConfigurator as _}from"./ShadowCast/components/DurationConfigurator.js";import{ShadowTooltip as S}from"./ShadowCast/components/ShadowTooltip.js";import{ThresholdConfigurator as y}from"./ShadowCast/components/ThresholdConfigurator.js";import{TimezonePicker as C}from"./ShadowCast/components/TimezonePicker.js";import M from"./support/DatePicker.js";import{Heading as T}from"./support/Heading.js";import{formatSliderLabel as j}from"./support/timeWidgetUtils.js";import"./support/widgetUtils.js";import{messageBundle as k}from"./support/decorators/messageBundle.js";import{tsx as D}from"./support/jsxFactory.js";import{formatDate as z}from"../intl/date.js";var V;!function(e){e.Slider="slider"}(V||(V={}));const O={hour:"2-digit",minute:"2-digit",timeZone:"UTC"},R=/(.*)\s(.*)/,L={labelFormatFunction:j,min:0,max:1439,steps:15,rangeLabelInputsEnabled:!1,visibleElements:{labels:!1,rangeLabels:!1},tickConfigs:[{mode:"position",values:[0,360,720,1080,1439],labelsVisible:!0,tickCreatedFunction:(e,i,t)=>{i.classList.add(u.timeRangePrimaryTick),t.classList.add(u.timeRangePrimaryTickLabel);const s=t.innerText.match(R);s&&(t.innerHTML=`${s[1]}<br><div class="${u.timeRangeAMPMLabel}">${s[2]}</div>`)}},{mode:"position",values:[120,240,480,600,840,960,1200,1320],tickCreatedFunction:(e,i)=>{i.classList.add(u.timeRangeSecondaryTick)}}]};let P=class extends p{constructor(e,t){super(e,t),this.viewModel=null,this.headingLevel=4,this.iconClass=u.widgetIcon,this.visibleElements=new g,this._handles=new i,this._defaultViewModel=null,this._timeSlider=new h({...L,container:document.createElement("div")}),this._tooltip=null,this._onTimezoneChange=e=>{this.viewModel.utcOffset=e},this._onDateChange=e=>{this.viewModel.date=e},e?.viewModel||(this._defaultViewModel=new w({view:e?.view}),this.viewModel=this._defaultViewModel)}initialize(){this._handles.add([r((()=>({viewModel:this.viewModel,slider:this._timeSlider})),(e=>this._connectTimeSlider(e)),l),r((()=>({container:o(this.view,(e=>e.surface)),viewModel:this.viewModel,tooltipVisible:this.visibleElements.tooltip})),(({container:e,viewModel:i,tooltipVisible:o})=>{this._tooltip=t(this._tooltip),!s(e)&&o&&(this._tooltip=new S({viewModel:i,container:e}))}),l),r((()=>({viewModel:this.viewModel,visible:this.visible})),(({viewModel:e,visible:i})=>e.setRunning(i)),l)])}destroy(){this._handles=t(this._handles),this._timeSlider=t(this._timeSlider),a(this._defaultViewModel)&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy()}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-select.js"),import("@esri/calcite-components/dist/components/calcite-option.js")])}render(){const{visibleElements:e,viewModel:i}=this,t=i.state===v.Disabled;return D("div",{key:this,class:this.classes(u.base,u.esriWidget,{[u.esriWidgetDisabled]:t})},this._renderTimeRangeSection(),e.visualizationOptions&&this._renderVisualizationOptionsSection())}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get label(){return this._get("label")??this.messages?.widgetLabel}set label(e){this._set("label",e)}get testData(){return{tooltip:this._tooltip}}_connectTimeSlider({viewModel:e,slider:i}){if(this._handles.remove(V.Slider),s(i))return;const t=e=>n(e,"milliseconds","minutes"),o=e=>n(e,"minutes","milliseconds"),a=({index:i,value:t})=>{0===i?e.startTimeOfDay=o(t):e.endTimeOfDay=o(t)};this._handles.add([r((()=>[e.startTimeOfDay,e.endTimeOfDay]),(e=>{i.values=e.map(t)}),l),i.on("thumb-change",a),i.on("thumb-drag",a),i.on("segment-drag",(()=>{[e.startTimeOfDay,e.endTimeOfDay]=i.values.map(o)}))],V.Slider)}_renderTimeRangeSection(){const{visibleElements:e}=this;return e.timeRangeSlider||e.datePicker?D("section",{key:"time-range",class:u.timeRange},D(T,{level:this.headingLevel},this.messages.timeLabel),e.timeRangeSlider&&this._renderTimeRange(),e.datePicker&&this._renderDatePicker()):null}_renderTimeRange(){const{messages:e,viewModel:i,visibleElements:t}=this,{startTimeOfDay:s,endTimeOfDay:o}=i,[a,r]=[s,o].map((e=>z(new Date(e),O)));return[D("div",{key:"time-range-indicator",class:u.timeRangeIndicator},c(e.timeRange,{start:a,end:r}),t.timezone&&D(C,{value:i.utcOffset,onChange:this._onTimezoneChange})),D("div",{key:"time-slider-container",bind:this,afterCreate:this._timeSliderContainerAfterCreate,afterRemoved:this._timeSliderContainerAfterRemoved})]}_timeSliderContainerAfterCreate(e){o(this._timeSlider,(i=>{e.appendChild(i.container)}))}_timeSliderContainerAfterRemoved(e){o(this._timeSlider,(i=>{e.removeChild(i.container)}))}_renderDatePicker(){return D("div",{key:"date-picker",class:u.datePickerContainer},D(M,{value:this.viewModel.date,onChange:this._onDateChange}))}_renderVisualizationOptionsSection(){const{headingLevel:e,messages:i,viewModel:t,visibleElements:s}=this,o=s.colorPicker,a=e=>this.classes(t.visualizationType===e?null:u.visualizationConfigHidden);return D("section",{key:"visualization",class:u.visualization},D(T,{level:e},i.visualizationLabel),this._renderVisualizationSelect(),D("div",{key:"threshold-configurator",class:a(f.Threshold)},D(y,{options:t.thresholdOptions,colorPickerVisible:o})),D("div",{key:"duration-configurator",class:a(f.Duration)},D(_,{options:t.durationOptions,colorPickerVisible:o})),D("div",{key:"discrete-configurator",class:a(f.Discrete)},D(b,{options:t.discreteOptions,colorPickerVisible:o})))}_renderVisualizationSelect(){const e=this.messages,i=this.viewModel.visualizationType;return D("calcite-select",{class:u.visualizationSelect,key:"visualization-select",label:e.visualizationLabel,bind:this,onCalciteSelectChange:this._onVisualizationTypeChange},[{type:f.Threshold,label:e.threshold.label},{type:f.Duration,label:e.duration.label},{type:f.Discrete,label:e.discrete.label}].map((({type:e,label:t})=>D("calcite-option",{value:e,selected:e===i},t))))}_onVisualizationTypeChange(e){const i=e.target.selectedOption?.value;this.viewModel.visualizationType=i??f.Threshold}};e([d()],P.prototype,"viewModel",void 0),e([d()],P.prototype,"view",null),e([d()],P.prototype,"headingLevel",void 0),e([d()],P.prototype,"iconClass",void 0),e([d({type:g,nonNullable:!0})],P.prototype,"visibleElements",void 0),e([d(),k("esri/widgets/ShadowCast/t9n/ShadowCast")],P.prototype,"messages",void 0),e([d()],P.prototype,"_defaultViewModel",void 0),e([d()],P.prototype,"_timeSlider",void 0),e([d()],P.prototype,"_tooltip",void 0),P=e([m("esri.widgets.ShadowCast")],P);const E=P;export{E as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import i from"../core/Handles.js";import{destroyMaybe as t,isNone as s,applySome as o,isSome as a}from"../core/maybe.js";import{watch as r,syncAndInitial as l}from"../core/reactiveUtils.js";import{convertTime as n}from"../core/timeUtils.js";import{property as d}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{substitute as c}from"../intl/substitute.js";import h from"./Slider.js";import p from"./Widget.js";import{CSS as u}from"./ShadowCast/css.js";import{ShadowCastState as v}from"./ShadowCast/ShadowCastState.js";import w from"./ShadowCast/ShadowCastViewModel.js";import g from"./ShadowCast/ShadowCastVisibleElements.js";import{ShadowVisualizationType as f}from"./ShadowCast/ShadowVisualizationType.js";import{DiscreteConfigurator as b}from"./ShadowCast/components/DiscreteConfigurator.js";import{DurationConfigurator as _}from"./ShadowCast/components/DurationConfigurator.js";import{ShadowTooltip as S}from"./ShadowCast/components/ShadowTooltip.js";import{ThresholdConfigurator as y}from"./ShadowCast/components/ThresholdConfigurator.js";import{TimezonePicker as C}from"./ShadowCast/components/TimezonePicker.js";import M from"./support/DatePicker.js";import{Heading as T}from"./support/Heading.js";import{formatSliderLabel as j}from"./support/timeWidgetUtils.js";import"./support/widgetUtils.js";import{messageBundle as k}from"./support/decorators/messageBundle.js";import{tsx as D}from"./support/jsxFactory.js";import{formatDate as z}from"../intl/date.js";var V;!function(e){e.Slider="slider"}(V||(V={}));const O={hour:"2-digit",minute:"2-digit",timeZone:"UTC"},R=/(.*)\s(.*)/,L={labelFormatFunction:j,min:0,max:1439,steps:15,rangeLabelInputsEnabled:!1,visibleElements:{labels:!1,rangeLabels:!1},tickConfigs:[{mode:"position",values:[0,360,720,1080,1439],labelsVisible:!0,tickCreatedFunction:(e,i,t)=>{i.classList.add(u.timeRangePrimaryTick),t.classList.add(u.timeRangePrimaryTickLabel);const s=t.innerText.match(R);s&&(t.innerHTML=`${s[1]}<br><div class="${u.timeRangeAMPMLabel}">${s[2]}</div>`)}},{mode:"position",values:[120,240,480,600,840,960,1200,1320],tickCreatedFunction:(e,i)=>{i.classList.add(u.timeRangeSecondaryTick)}}]};let P=class extends p{constructor(e,t){super(e,t),this.viewModel=null,this.headingLevel=4,this.iconClass=u.widgetIcon,this.visibleElements=new g,this._handles=new i,this._defaultViewModel=null,this._timeSlider=new h({...L,container:document.createElement("div")}),this._tooltip=null,this._onTimezoneChange=e=>{this.viewModel.utcOffset=e},this._onDateChange=e=>{this.viewModel.date=e},e?.viewModel||(this._defaultViewModel=new w({view:e?.view}),this.viewModel=this._defaultViewModel)}initialize(){this._handles.add([r((()=>({viewModel:this.viewModel,slider:this._timeSlider})),(e=>this._connectTimeSlider(e)),l),r((()=>({container:o(this.view,(e=>e.surface)),viewModel:this.viewModel,tooltipVisible:this.visibleElements.tooltip})),(({container:e,viewModel:i,tooltipVisible:o})=>{this._tooltip=t(this._tooltip),!s(e)&&o&&(this._tooltip=new S({viewModel:i,container:e}))}),l),r((()=>({viewModel:this.viewModel,visible:this.visible})),(({viewModel:e,visible:i})=>e.setRunning(i)),l)])}destroy(){this._handles=t(this._handles),this._timeSlider=t(this._timeSlider),a(this._defaultViewModel)&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy()}loadDependencies(){return Promise.all([import("@esri/calcite-components/dist/components/calcite-select.js"),import("@esri/calcite-components/dist/components/calcite-option.js")])}render(){const{visibleElements:e,viewModel:i}=this,t=i.state===v.Disabled;return D("div",{key:this,class:this.classes(u.base,u.esriWidget,{[u.esriWidgetDisabled]:t})},this._renderTimeRangeSection(),e.visualizationOptions&&this._renderVisualizationOptionsSection())}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get label(){return this._get("label")??this.messages?.widgetLabel??""}set label(e){this._set("label",e)}get testData(){return{tooltip:this._tooltip}}_connectTimeSlider({viewModel:e,slider:i}){if(this._handles.remove(V.Slider),s(i))return;const t=e=>n(e,"milliseconds","minutes"),o=e=>n(e,"minutes","milliseconds"),a=({index:i,value:t})=>{0===i?e.startTimeOfDay=o(t):e.endTimeOfDay=o(t)};this._handles.add([r((()=>[e.startTimeOfDay,e.endTimeOfDay]),(e=>{i.values=e.map(t)}),l),i.on("thumb-change",a),i.on("thumb-drag",a),i.on("segment-drag",(()=>{[e.startTimeOfDay,e.endTimeOfDay]=i.values.map(o)}))],V.Slider)}_renderTimeRangeSection(){const{visibleElements:e}=this;return e.timeRangeSlider||e.datePicker?D("section",{key:"time-range",class:u.timeRange},D(T,{level:this.headingLevel},this.messages.timeLabel),e.timeRangeSlider&&this._renderTimeRange(),e.datePicker&&this._renderDatePicker()):null}_renderTimeRange(){const{messages:e,viewModel:i,visibleElements:t}=this,{startTimeOfDay:s,endTimeOfDay:o}=i,[a,r]=[s,o].map((e=>z(new Date(e),O)));return[D("div",{key:"time-range-indicator",class:u.timeRangeIndicator},c(e.timeRange,{start:a,end:r}),t.timezone&&D(C,{value:i.utcOffset,onChange:this._onTimezoneChange})),D("div",{key:"time-slider-container",bind:this,afterCreate:this._timeSliderContainerAfterCreate,afterRemoved:this._timeSliderContainerAfterRemoved})]}_timeSliderContainerAfterCreate(e){o(this._timeSlider,(i=>{e.appendChild(i.container)}))}_timeSliderContainerAfterRemoved(e){o(this._timeSlider,(i=>{e.removeChild(i.container)}))}_renderDatePicker(){return D("div",{key:"date-picker",class:u.datePickerContainer},D(M,{value:this.viewModel.date,onChange:this._onDateChange}))}_renderVisualizationOptionsSection(){const{headingLevel:e,messages:i,viewModel:t,visibleElements:s}=this,o=s.colorPicker,a=e=>this.classes(t.visualizationType===e?null:u.visualizationConfigHidden);return D("section",{key:"visualization",class:u.visualization},D(T,{level:e},i.visualizationLabel),this._renderVisualizationSelect(),D("div",{key:"threshold-configurator",class:a(f.Threshold)},D(y,{options:t.thresholdOptions,colorPickerVisible:o})),D("div",{key:"duration-configurator",class:a(f.Duration)},D(_,{options:t.durationOptions,colorPickerVisible:o})),D("div",{key:"discrete-configurator",class:a(f.Discrete)},D(b,{options:t.discreteOptions,colorPickerVisible:o})))}_renderVisualizationSelect(){const e=this.messages,i=this.viewModel.visualizationType;return D("calcite-select",{class:u.visualizationSelect,key:"visualization-select",label:e.visualizationLabel,bind:this,onCalciteSelectChange:this._onVisualizationTypeChange},[{type:f.Threshold,label:e.threshold.label},{type:f.Duration,label:e.duration.label},{type:f.Discrete,label:e.discrete.label}].map((({type:e,label:t})=>D("calcite-option",{value:e,selected:e===i},t))))}_onVisualizationTypeChange(e){const i=e.target.selectedOption?.value;this.viewModel.visualizationType=i??f.Threshold}};e([d()],P.prototype,"viewModel",void 0),e([d()],P.prototype,"view",null),e([d()],P.prototype,"headingLevel",void 0),e([d()],P.prototype,"iconClass",void 0),e([d({type:g,nonNullable:!0})],P.prototype,"visibleElements",void 0),e([d(),k("esri/widgets/ShadowCast/t9n/ShadowCast")],P.prototype,"messages",void 0),e([d()],P.prototype,"_defaultViewModel",void 0),e([d()],P.prototype,"_timeSlider",void 0),e([d()],P.prototype,"_tooltip",void 0),P=e([m("esri.widgets.ShadowCast")],P);const E=P;export{E as default};
|
package/widgets/Slice.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import r from"./Slice/SliceViewModel.js";import{Heading as o}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as n}from"./support/decorators/messageBundle.js";import{tsx as c}from"./support/jsxFactory.js";const a="esri-slice",d={buttonDisabled:"esri-button--disabled",layerIncludeButton:"esri-slice__cross",widgetIcon:"esri-icon-slice",base:`${a} esri-widget esri-widget--panel`,layerList:`${a}__settings`,layerListHeading:"esri-slice__settings-title",layerItem:`${a}__layer-item`,layerItemTitle:`${a}__layer-item__title`,container:`${a}__container`,actionSection:"esri-slice__actions",hint:`${a}__hint`,hintText:`${a}__hint-text`,panelError:`${a}__panel--error`,newSliceButton:`${a}__clear-button esri-button esri-button--primary`,excludeButton:`${a}__exclude-button esri-button esri-button--secondary`,cancelButton:`${a}__cancel-button esri-button esri-button--secondary`};let u=class extends l{constructor(e,t){super(e,t),this.headingLevel=3,this.iconClass=d.widgetIcon,this.messages=null,this.viewModel=new r}loadDependencies(){return import("@esri/calcite-components/dist/components/calcite-button.js")}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get excludedLayers(){return this.viewModel.excludedLayers}set excludedLayers(e){this.viewModel.excludedLayers=e}get excludeGroundSurface(){return this.viewModel.excludeGroundSurface}set excludeGroundSurface(e){this.viewModel.excludeGroundSurface=e}get label(){return this._get("label")??this.messages?.widgetLabel}set label(e){this._set("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){const e=this.viewModel.supported,t=this.viewModel.active,s="disabled"===this.viewModel.state,i="ready"===this.viewModel.state,l="slicing"===this.viewModel.state||"sliced"===this.viewModel.state,r="exclude"===this.viewModel.layersMode,{messages:n}=this,a=s&&d.buttonDisabled,u=t&&!l||r?null:c("button",{disabled:s,class:this.classes(d.newSliceButton,a),bind:this,onclick:this._onNewSliceClick,key:"esri-slice__clear",type:"button"},n.newSlice),p=l&&!r?c("button",{class:this.classes(d.excludeButton,a),bind:this,onclick:()=>{this.viewModel.enterExcludeLayerMode()},key:"esri-slice__exclude",type:"button"},n.excludeLayer):null,y=t&&r?c("button",{class:this.classes(d.cancelButton,a),bind:this,onclick:()=>{this.viewModel.exitExcludeLayerMode()},key:"esri-slice__cancel-exclude",type:"button"},n.cancel):null;let h=null;t&&(r?h=n.excludeHint:i&&(h=n.hint));const v=h?c("div",{class:d.hint,key:"esri-slice__hint"},c("p",{class:d.hintText},h)):null,_=this.excludedLayers?this.excludedLayers.toArray().map((e=>this._renderLayerItem({uid:e.uid,title:e.title,onClick:()=>(this.excludedLayers.remove(e),!1)}))):[];this.excludeGroundSurface&&_.push(this._renderLayerItem({uid:"ground",title:n.ground,onClick:()=>(this.excludeGroundSurface=!1,!1)}));const b=!r&&l&&_.length>0?c("div",{class:d.layerList,key:"esri-slice__settings"},c(o,{class:d.layerListHeading,level:this.headingLevel},n.excludedLayers),c("ul",null,_)):null,m=c("div",{class:d.panelError,key:"esri-slice__unsupported"},c("p",null,n.unsupported)),w=c("div",{class:d.actionSection},p,y,u),g=this.visible?c("div",{class:d.container},e?[v,b,w]:m):null;return c("div",{class:d.base,role:"presentation"},g)}_renderLayerItem(e){return c("li",{class:d.layerItem,key:e.uid},c("calcite-button",{appearance:"transparent",class:d.layerIncludeButton,"icon-start":"x",scale:"s",title:this.messages.includeLayer,bind:this,onclick:e.onClick}),c("div",{class:d.layerItemTitle},e.title))}_onNewSliceClick(){t(this.viewModel.start())}};e([s()],u.prototype,"active",null),e([s({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",null),e([s()],u.prototype,"excludedLayers",null),e([s()],u.prototype,"excludeGroundSurface",null),e([s()],u.prototype,"headingLevel",void 0),e([s()],u.prototype,"iconClass",void 0),e([s()],u.prototype,"label",null),e([s(),n("esri/widgets/Slice/t9n/Slice")],u.prototype,"messages",void 0),e([s()],u.prototype,"view",null),e([s({type:r})],u.prototype,"viewModel",void 0),e([s()],u.prototype,"visible",null),u=e([i("esri.widgets.Slice")],u);const p=u;export{p as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import l from"./Widget.js";import r from"./Slice/SliceViewModel.js";import{Heading as o}from"./support/Heading.js";import"./support/widgetUtils.js";import{messageBundle as n}from"./support/decorators/messageBundle.js";import{tsx as c}from"./support/jsxFactory.js";const a="esri-slice",d={buttonDisabled:"esri-button--disabled",layerIncludeButton:"esri-slice__cross",widgetIcon:"esri-icon-slice",base:`${a} esri-widget esri-widget--panel`,layerList:`${a}__settings`,layerListHeading:"esri-slice__settings-title",layerItem:`${a}__layer-item`,layerItemTitle:`${a}__layer-item__title`,container:`${a}__container`,actionSection:"esri-slice__actions",hint:`${a}__hint`,hintText:`${a}__hint-text`,panelError:`${a}__panel--error`,newSliceButton:`${a}__clear-button esri-button esri-button--primary`,excludeButton:`${a}__exclude-button esri-button esri-button--secondary`,cancelButton:`${a}__cancel-button esri-button esri-button--secondary`};let u=class extends l{constructor(e,t){super(e,t),this.headingLevel=3,this.iconClass=d.widgetIcon,this.messages=null,this.viewModel=new r}loadDependencies(){return import("@esri/calcite-components/dist/components/calcite-button.js")}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get excludedLayers(){return this.viewModel.excludedLayers}set excludedLayers(e){this.viewModel.excludedLayers=e}get excludeGroundSurface(){return this.viewModel.excludeGroundSurface}set excludeGroundSurface(e){this.viewModel.excludeGroundSurface=e}get label(){return this._get("label")??this.messages?.widgetLabel??""}set label(e){this._set("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){const e=this.viewModel.supported,t=this.viewModel.active,s="disabled"===this.viewModel.state,i="ready"===this.viewModel.state,l="slicing"===this.viewModel.state||"sliced"===this.viewModel.state,r="exclude"===this.viewModel.layersMode,{messages:n}=this,a=s&&d.buttonDisabled,u=t&&!l||r?null:c("button",{disabled:s,class:this.classes(d.newSliceButton,a),bind:this,onclick:this._onNewSliceClick,key:"esri-slice__clear",type:"button"},n.newSlice),p=l&&!r?c("button",{class:this.classes(d.excludeButton,a),bind:this,onclick:()=>{this.viewModel.enterExcludeLayerMode()},key:"esri-slice__exclude",type:"button"},n.excludeLayer):null,y=t&&r?c("button",{class:this.classes(d.cancelButton,a),bind:this,onclick:()=>{this.viewModel.exitExcludeLayerMode()},key:"esri-slice__cancel-exclude",type:"button"},n.cancel):null;let h=null;t&&(r?h=n.excludeHint:i&&(h=n.hint));const v=h?c("div",{class:d.hint,key:"esri-slice__hint"},c("p",{class:d.hintText},h)):null,_=this.excludedLayers?this.excludedLayers.toArray().map((e=>this._renderLayerItem({uid:e.uid,title:e.title,onClick:()=>(this.excludedLayers.remove(e),!1)}))):[];this.excludeGroundSurface&&_.push(this._renderLayerItem({uid:"ground",title:n.ground,onClick:()=>(this.excludeGroundSurface=!1,!1)}));const b=!r&&l&&_.length>0?c("div",{class:d.layerList,key:"esri-slice__settings"},c(o,{class:d.layerListHeading,level:this.headingLevel},n.excludedLayers),c("ul",null,_)):null,m=c("div",{class:d.panelError,key:"esri-slice__unsupported"},c("p",null,n.unsupported)),w=c("div",{class:d.actionSection},p,y,u),g=this.visible?c("div",{class:d.container},e?[v,b,w]:m):null;return c("div",{class:d.base,role:"presentation"},g)}_renderLayerItem(e){return c("li",{class:d.layerItem,key:e.uid},c("calcite-button",{appearance:"transparent",class:d.layerIncludeButton,"icon-start":"x",scale:"s",title:this.messages.includeLayer,bind:this,onclick:e.onClick}),c("div",{class:d.layerItemTitle},e.title))}_onNewSliceClick(){t(this.viewModel.start())}};e([s()],u.prototype,"active",null),e([s({constructOnly:!0,nonNullable:!0})],u.prototype,"analysis",null),e([s()],u.prototype,"excludedLayers",null),e([s()],u.prototype,"excludeGroundSurface",null),e([s()],u.prototype,"headingLevel",void 0),e([s()],u.prototype,"iconClass",void 0),e([s()],u.prototype,"label",null),e([s(),n("esri/widgets/Slice/t9n/Slice")],u.prototype,"messages",void 0),e([s()],u.prototype,"view",null),e([s({type:r})],u.prototype,"viewModel",void 0),e([s()],u.prototype,"visible",null),u=e([i("esri.widgets.Slice")],u);const p=u;export{p as default};
|