@arcgis/core 5.1.0-next.77 → 5.1.0-next.78
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/analysis/ElevationProfile/ElevationProfileGroup.d.ts +74 -0
- package/analysis/ElevationProfile/ElevationProfileGroup.js +2 -0
- package/analysis/ElevationProfileAnalysis.d.ts +29 -14
- package/analysis/ElevationProfileAnalysis.js +1 -1
- package/applications/Components/OrientedImageryViewer/ImageViewer/utils.d.ts +34 -0
- package/applications/Components/OrientedImageryViewer/ImageViewer/utils.js +2 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{537fe2522dff1e6ce03b.js → 11ea4be441a26134ce1f.js} +1 -1
- package/assets/esri/core/workers/chunks/17acbf40e7c1cb42d9bd.js +1 -0
- package/assets/esri/core/workers/chunks/1c7fd0a229a8112b0539.js +596 -0
- package/assets/esri/core/workers/chunks/{baeb96aef03d4c566af7.js → 1f53620f82cc7c3daabe.js} +1 -1
- package/assets/esri/core/workers/chunks/2387613b855771a3e537.js +1 -0
- package/assets/esri/core/workers/chunks/283d39dfb1625b5a74db.js +1 -0
- package/assets/esri/core/workers/chunks/{5e1b847b116d21908a54.js → 322c54081b25f1c53661.js} +1 -1
- package/assets/esri/core/workers/chunks/{330b47ac0759c3c35cc5.js → 34fe97bcacc0dfc5bce6.js} +1 -1
- package/assets/esri/core/workers/chunks/{14eb2cc8e2ad6d8d03fd.js → 3d9fcbe95dd22dbe730e.js} +1 -1
- package/assets/esri/core/workers/chunks/{e262c4864dc06c43b380.js → 3df8493b91aa3bce824d.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf8f603848bad4a7deb4.js → 4ccb56333de0247dcb6f.js} +1 -1
- package/assets/esri/core/workers/chunks/5b6f2bfdcdd207d8ae42.js +1 -0
- package/assets/esri/core/workers/chunks/{88b480a1d1fb01778798.js → 5ee4b630ad39c21d11db.js} +21 -26
- package/assets/esri/core/workers/chunks/{6b66fc32451433129a88.js → 8508f238d99021e87f71.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc75ab48f4c7609ef09d.js → 85d3475667c503ec4fc6.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d6491f996eeb0c646ed.js → 85d8c7cc7f8decbe975d.js} +1 -1
- package/assets/esri/core/workers/chunks/9b9916864b6575c42c8a.js +1 -0
- package/assets/esri/core/workers/chunks/{75d5ea0da181f9e7425f.js → a8ca5d8740cc7e39197b.js} +6 -6
- package/assets/esri/core/workers/chunks/{8d75f6f27c1c17c33992.js → b7bb7072dbee978f3ca3.js} +1 -1
- package/assets/esri/core/workers/chunks/bf7e019437a3b6036300.js +2 -0
- package/assets/esri/core/workers/chunks/{99c161fecae710b53b40.js → d304343a781acfa3ff96.js} +1 -1
- package/assets/esri/core/workers/chunks/dbb9bb28696ff9536678.js +2 -0
- package/assets/esri/core/workers/chunks/{34ea3ed78041437a8fc8.js → f81c6f6ccc201f584970.js} +1 -1
- package/assets/esri/themes/base/_core.scss +2 -0
- package/assets/esri/themes/base/widgets/_PluginSettingsControls.scss +29 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
- package/config.js +1 -1
- package/core/types.d.ts +28 -0
- package/form/elements/inputs/MultipleChoiceInput.d.ts +2 -2
- package/form/elements/inputs/MultipleChoiceInput.js +1 -1
- package/geometry/operators/types.d.ts +2 -2
- package/interfaces.d.ts +4 -7
- package/kernel.js +1 -1
- package/layers/ImageryLayer.d.ts +7 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.d.ts +7 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/WCSLayer.d.ts +7 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/save/imageryUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/networks/UnitIdentifierManager.d.ts +15 -15
- package/networks/UnitIdentifierManager.js +1 -1
- package/networks/support/jsonTypes.d.ts +125 -13
- package/package.json +3 -3
- package/popup/Features.d.ts +0 -1
- package/popup/Features.js +1 -1
- package/rest/networks/unitIdentifiers/reserve.js +2 -0
- package/rest/networks/unitIdentifiers/support/ReserveParameters.js +2 -0
- package/rest/networks/unitIdentifiers/support/ResizeParameters.js +1 -1
- package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +1 -1
- package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +5 -1
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/engine/webgl/AFeatureTile.js +1 -1
- package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ShaderHittest.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/BaseLayerView2D.d.ts +3 -3
- package/views/2d/layers/BaseLayerViewGL2D.d.ts +3 -3
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/support/clippingUtils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +5 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshNormals.js +1 -1
- package/views/3d/terrain/ElevationData.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Renderable.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +1 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js +1 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js +16 -21
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/BlackLevelLightSoftCompression.glsl.js +5 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +2 -2
- package/views/VideoView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileIndicatorPointVisualization.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileResult.d.ts +6 -4
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/plugins/BezierSegmentPlugin.js +1 -1
- package/views/draw/plugins/FreehandSegmentPlugin.js +1 -1
- package/views/draw/support/PluginContext.js +1 -1
- package/views/draw/support/types.d.ts +21 -0
- package/views/draw/support/types.js +1 -1
- package/views/types.d.ts +2 -2
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView2D.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView3D.js +1 -1
- package/widgets/ElevationProfile/support/InputRepresentation2D.js +1 -1
- package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
- package/widgets/ElevationProfile/support/ProfileLine2D.js +1 -1
- package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.d.ts +5 -5
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +2 -0
- package/widgets/OrientedImageryViewer/support/superimposeUtils.js +2 -0
- package/widgets/OrientedImageryViewer/types.d.ts +10 -0
- package/widgets/OrientedImageryViewer.d.ts +17 -2
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/Sketch/support/SettingsManager.js +2 -0
- package/widgets/Sketch.js +1 -1
- package/widgets/Slider/SliderViewModel.d.ts +2 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.js +1 -1
- package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.js +1 -1
- package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
- package/widgets/support/PluginSettingsControls.js +2 -0
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/forms/formUtils.js +1 -1
- package/analysis/ElevationProfile/elevationProfileLineTypes.js +0 -2
- package/assets/esri/core/workers/chunks/003476e950bd27a2f884.js +0 -596
- package/assets/esri/core/workers/chunks/07aca5ecad659d55e795.js +0 -2
- package/assets/esri/core/workers/chunks/7540f7df86620f067b5a.js +0 -1
- package/assets/esri/core/workers/chunks/76e34f81bb4a7b0e694c.js +0 -1
- package/assets/esri/core/workers/chunks/bfe575da727ce7c8d331.js +0 -2
- package/assets/esri/core/workers/chunks/cb45e5d4a4ef82cda583.js +0 -1
- package/assets/esri/core/workers/chunks/ea59b81299acaf0d85ee.js +0 -1
- package/assets/esri/core/workers/chunks/ef0eae13408cbf83a64f.js +0 -1
- package/rest/networks/unitIdentifiers/insertGap.js +0 -2
- package/rest/networks/unitIdentifiers/support/InsertGapParameters.js +0 -2
- /package/assets/esri/core/workers/chunks/{07aca5ecad659d55e795.js.LICENSE.txt → bf7e019437a3b6036300.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{bfe575da727ce7c8d331.js.LICENSE.txt → dbb9bb28696ff9536678.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import{makeHandle as o}from"../../../core/handleUtils.js";import{createScalar as a,createLength as i,toUnit as s}from"../../../core/quantity.js";import{generateUUID as n}from"../../../core/uuid.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{isWebMercator as p,isGeographic as u}from"../../../geometry/support/spatialReferenceUtils.js";import{createViewAlignedCoordinateSystem as c}from"./surfaceCoordinateSystems.js";import{knownFieldDisplayOrders as m}from"./types.js";import{createGeographicCoordinate as g}from"../../interactive/tooltip/fields/parsingAndFormattingUtils.js";import{elevationFromPoint as h}from"../../support/euclideanLengthMeasurementUtils.js";const f={x:m.Coordinates+10,y:m.Coordinates+11,elevation:m.Coordinates+12};let w=class extends t{constructor(e){super(e)}normalizeCtorArgs(e){const{drawTool:t,plugin:r,...o}=e;return{_drawTool:t,_plugin:r,...o}}get positionOfLastUserInput(){return this._drawTool.positionOfLastUserInput}getSession(e){return this._drawTool.editSessionManager.getSession(e)}createInteractiveHandle(e,t){const o=this._drawTool.interactiveHandleManager,i=this._drawTool.tooltipManager,s=this._plugin,l=this.session,d=this._drawTool.coordinateHelper;if(!o||!i)throw new r("draw-tool:interactive-handle-missing-dependencies","Attempted to set up an interactive handle without required dependencies.");const c=e.name??n(),m=e.defaultCaptureMode??"capture-always",h=o.registerHandle(s,{...e,name:c,editSession:l,defaultCaptureMode:m,captureMode:m});if(this._drawTool.addPromise(o.setupManipulatorForHandle(h,this._drawTool.lastScreenPosition,this._drawTool.movementCommandContext)),!t?.disableDefaultXYFields){const e=d.spatialReference;p(e)||u(e)?(i.createMeasuredField(s,{id:Symbol(`tooltip-long-${c}`),preset:"longitude",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>g(e?.longitude),fieldProperties:{displayOrder:f.x},fieldFilters:{appliesToHandlesWithName:c}}),i.createMeasuredField(s,{id:Symbol(`tooltip-lat-${c}`),preset:"latitude",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>g(e?.latitude),fieldProperties:{displayOrder:f.y},fieldFilters:{appliesToHandlesWithName:c}})):(i.createMeasuredField(s,{id:Symbol(`tooltip-x-${c}`),preset:"x",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>e?a(e.x):null,fieldProperties:{displayOrder:f.x},fieldFilters:{appliesToHandlesWithName:c}}),i.createMeasuredField(s,{id:Symbol(`tooltip-y-${c}`),preset:"y",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>e?a(e.y):null,fieldProperties:{displayOrder:f.y},fieldFilters:{appliesToHandlesWithName:c}})),this._drawTool.hasZ&&"primary"===h.role&&i.createMeasuredField(s,{id:Symbol(`tooltip-z-${c}`),preset:"elevation",getMeasurementInput:()=>h.outputMapPosition,measure:async(e,t)=>this.measureElevation(e,t.inputUnitInfos.verticalLength.unit),fieldProperties:{displayOrder:f.elevation},fieldFilters:{appliesToHandlesWithName:c}})}return h}removeInteractiveHandle(e){const t=e;this._drawTool.interactiveHandleManager?.unregisterHandle(this._plugin,t)}createConstraint(e,t){this._drawTool.interactiveHandleManager?.registerCustomConstraint(this._plugin,e,t)}removeConstraint(e){this._drawTool.interactiveHandleManager?.unregisterCustomConstraint(this._plugin,e)}createCustomField(e){if(!this._drawTool.tooltipManager)throw new r("draw-tool:tooltip-manager-missing","Attempted to create a field without access to a tooltip manager.");return this._drawTool.tooltipManager.createCustomField(this._plugin,e)}createMeasuredField(e){if(!this._drawTool.tooltipManager)throw new r("draw-tool:tooltip-manager-missing","Attempted to create a field without access to a tooltip manager.");return this._drawTool.tooltipManager.createMeasuredField(this._plugin,e)}requestComplete(){this._drawTool.complete(this._plugin)}requestCancel(e){this._drawTool.lifecycleManager.cancel(this._plugin)}requestBeginDownstreamPlugin(e,t){this._drawTool.lifecycleManager.begin([e],this._plugin,t?.cancelExisting)}async measureLength(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureLength(i,t,e,o)}async measureArea(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureArea(i,t,e,o)}async measureDistance(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureDistance(i,t,e,o)}measureElevation(e,t){const r=this._drawTool;let o=h(e);if(!o){const e=r.surfaceManager?.metersPerVerticalUnit;e&&(o=i(r.defaultZ*e,"meters"))}return t&&o&&o.unit!==t?s(o,t):o}getGlobalState(){return this._drawTool.globalStateManager.getGlobalState()}setGlobalState(e,t){this._drawTool.globalStateManager.setGlobalState(this._plugin,e,t)}addOrUpdateGraphic(e,t){const{_plugin:r,_drawTool:a}=this,i=a.renderer;i?.addOrUpdateGraphic(e,t),r.hasHandles(e)||r.addHandles(o(()=>i?.removeGraphic(e)),e)}addOrUpdateVisual(e,t){const r=this._plugin,a=this._drawTool.renderer;a?.addOrUpdateVisual(e,t),r.hasHandles(e)||r.addHandles(o(()=>a?.removeVisual(e)),e)}removeGraphic(e){this._plugin.removeHandles(e)}removeVisual(e){this._plugin.removeHandles(e)}getViewInformation(){return this._drawTool.view}getViewAlignedSurfaceCoordinateSystem(e){const{view:t,coordinateHelper:r}=this._drawTool;return t&&r?c(t,r.pointToVector(e)):null}};e([l()],w.prototype,"_plugin",void 0),e([l()],w.prototype,"_drawTool",void 0),e([l({nonNullable:!0})],w.prototype,"session",void 0),e([l()],w.prototype,"positionOfLastUserInput",null),w=e([d("esri.views.draw.support.PluginContext")],w);export{w as PluginContext};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import{makeHandle as o}from"../../../core/handleUtils.js";import{createScalar as a,createLength as i,toUnit as s}from"../../../core/quantity.js";import{generateUUID as n}from"../../../core/uuid.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{isWebMercator as p,isGeographic as u}from"../../../geometry/support/spatialReferenceUtils.js";import{createViewAlignedCoordinateSystem as c}from"./surfaceCoordinateSystems.js";import{knownFieldDisplayOrders as m}from"./types.js";import{createGeographicCoordinate as g}from"../../interactive/tooltip/fields/parsingAndFormattingUtils.js";import{elevationFromPoint as h}from"../../support/euclideanLengthMeasurementUtils.js";const f={x:m.Coordinates+10,y:m.Coordinates+11,elevation:m.Coordinates+12};let w=class extends t{constructor(e){super(e)}normalizeCtorArgs(e){const{drawTool:t,plugin:r,...o}=e;return{_drawTool:t,_plugin:r,...o}}get positionOfLastUserInput(){return this._drawTool.positionOfLastUserInput}getSession(e){return this._drawTool.editSessionManager.getSession(e)}readBooleanSetting(e){const t=this._plugin.configuration?.uniqueId;if(t)return this._drawTool.readPluginSettingValue(t,e)}createInteractiveHandle(e,t){const o=this._drawTool.interactiveHandleManager,i=this._drawTool.tooltipManager,s=this._plugin,l=this.session,d=this._drawTool.coordinateHelper;if(!o||!i)throw new r("draw-tool:interactive-handle-missing-dependencies","Attempted to set up an interactive handle without required dependencies.");const c=e.name??n(),m=e.defaultCaptureMode??"capture-always",h=o.registerHandle(s,{...e,name:c,editSession:l,defaultCaptureMode:m,captureMode:m});if(this._drawTool.addPromise(o.setupManipulatorForHandle(h,this._drawTool.lastScreenPosition,this._drawTool.movementCommandContext)),!t?.disableDefaultXYFields){const e=d.spatialReference;p(e)||u(e)?(i.createMeasuredField(s,{id:Symbol(`tooltip-long-${c}`),preset:"longitude",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>g(e?.longitude),fieldProperties:{displayOrder:f.x},fieldFilters:{appliesToHandlesWithName:c}}),i.createMeasuredField(s,{id:Symbol(`tooltip-lat-${c}`),preset:"latitude",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>g(e?.latitude),fieldProperties:{displayOrder:f.y},fieldFilters:{appliesToHandlesWithName:c}})):(i.createMeasuredField(s,{id:Symbol(`tooltip-x-${c}`),preset:"x",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>e?a(e.x):null,fieldProperties:{displayOrder:f.x},fieldFilters:{appliesToHandlesWithName:c}}),i.createMeasuredField(s,{id:Symbol(`tooltip-y-${c}`),preset:"y",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>e?a(e.y):null,fieldProperties:{displayOrder:f.y},fieldFilters:{appliesToHandlesWithName:c}})),this._drawTool.hasZ&&"primary"===h.role&&i.createMeasuredField(s,{id:Symbol(`tooltip-z-${c}`),preset:"elevation",getMeasurementInput:()=>h.outputMapPosition,measure:async(e,t)=>this.measureElevation(e,t.inputUnitInfos.verticalLength.unit),fieldProperties:{displayOrder:f.elevation},fieldFilters:{appliesToHandlesWithName:c}})}return h}removeInteractiveHandle(e){const t=e;this._drawTool.interactiveHandleManager?.unregisterHandle(this._plugin,t)}createConstraint(e,t){this._drawTool.interactiveHandleManager?.registerCustomConstraint(this._plugin,e,t)}removeConstraint(e){this._drawTool.interactiveHandleManager?.unregisterCustomConstraint(this._plugin,e)}createCustomField(e){if(!this._drawTool.tooltipManager)throw new r("draw-tool:tooltip-manager-missing","Attempted to create a field without access to a tooltip manager.");return this._drawTool.tooltipManager.createCustomField(this._plugin,e)}createMeasuredField(e){if(!this._drawTool.tooltipManager)throw new r("draw-tool:tooltip-manager-missing","Attempted to create a field without access to a tooltip manager.");return this._drawTool.tooltipManager.createMeasuredField(this._plugin,e)}requestComplete(){this._drawTool.complete(this._plugin)}requestCancel(e){this._drawTool.lifecycleManager.cancel(this._plugin)}requestBeginDownstreamPlugin(e,t){this._drawTool.lifecycleManager.begin([e],this._plugin,t?.cancelExisting)}async measureLength(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureLength(i,t,e,o)}async measureArea(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureArea(i,t,e,o)}async measureDistance(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureDistance(i,t,e,o)}measureElevation(e,t){const r=this._drawTool;let o=h(e);if(!o){const e=r.surfaceManager?.metersPerVerticalUnit;e&&(o=i(r.defaultZ*e,"meters"))}return t&&o&&o.unit!==t?s(o,t):o}getGlobalState(){return this._drawTool.globalStateManager.getGlobalState()}setGlobalState(e,t){this._drawTool.globalStateManager.setGlobalState(this._plugin,e,t)}addOrUpdateGraphic(e,t){const{_plugin:r,_drawTool:a}=this,i=a.renderer;i?.addOrUpdateGraphic(e,t),r.hasHandles(e)||r.addHandles(o(()=>i?.removeGraphic(e)),e)}addOrUpdateVisual(e,t){const r=this._plugin,a=this._drawTool.renderer;a?.addOrUpdateVisual(e,t),r.hasHandles(e)||r.addHandles(o(()=>a?.removeVisual(e)),e)}removeGraphic(e){this._plugin.removeHandles(e)}removeVisual(e){this._plugin.removeHandles(e)}getViewInformation(){return this._drawTool.view}getViewAlignedSurfaceCoordinateSystem(e){const{view:t,coordinateHelper:r}=this._drawTool;return t&&r?c(t,r.pointToVector(e)):null}};e([l()],w.prototype,"_plugin",void 0),e([l()],w.prototype,"_drawTool",void 0),e([l({nonNullable:!0})],w.prototype,"session",void 0),e([l()],w.prototype,"positionOfLastUserInput",null),w=e([d("esri.views.draw.support.PluginContext")],w);export{w as PluginContext};
|
|
@@ -21,6 +21,12 @@ import type { CreateTool } from "../../../widgets/Sketch/types.js";
|
|
|
21
21
|
/** @internal */
|
|
22
22
|
export type DrawToolGeometryType = "point" | "multipoint" | "polyline" | "polygon" | "circle" | "rectangle" | "mesh";
|
|
23
23
|
|
|
24
|
+
/** @internal */
|
|
25
|
+
export interface PluginSettingBase<T extends boolean = boolean> {}
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export interface PluginSettings {}
|
|
29
|
+
|
|
24
30
|
/**
|
|
25
31
|
* A plugin configuration includes the minimal information needed to integrate
|
|
26
32
|
* a plugin implementation into the DrawTool and associated UI components.
|
|
@@ -122,6 +128,13 @@ export interface PluginConfiguration {
|
|
|
122
128
|
* @internal
|
|
123
129
|
*/
|
|
124
130
|
excludedViews?: ("2d" | "3d" | "linkchart" | "video" | "map")[];
|
|
131
|
+
/**
|
|
132
|
+
* Optional plugin-specific settings metadata used by in-box settings UI
|
|
133
|
+
* and runtime plugin settings reads.
|
|
134
|
+
*
|
|
135
|
+
* @internal
|
|
136
|
+
*/
|
|
137
|
+
settings?: PluginSettings;
|
|
125
138
|
}
|
|
126
139
|
|
|
127
140
|
/** @internal */
|
|
@@ -760,6 +773,14 @@ export interface PluginContext {
|
|
|
760
773
|
* @internal
|
|
761
774
|
*/
|
|
762
775
|
getSession(plugin: Plugin): ReadonlyEditSession | null | undefined;
|
|
776
|
+
/**
|
|
777
|
+
* Reads a plugin-specific setting value.
|
|
778
|
+
*
|
|
779
|
+
* @param settingKey - Setting key
|
|
780
|
+
* @returns Current value, or undefined if no value is configured
|
|
781
|
+
* @internal
|
|
782
|
+
*/
|
|
783
|
+
readBooleanSetting(settingKey: symbol): boolean | undefined;
|
|
763
784
|
/**
|
|
764
785
|
* Gets the last-seen on-map user input position at time of plugin startup.
|
|
765
786
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
const e={AboveCoordinates:-1e3,Coordinates:-100,Middle:0,BelowMiddle:100,ShapeMeasurements:1e3};export{e as knownFieldDisplayOrders};
|
|
2
|
+
const e=Symbol.for("esri-plugin-setting-freehand-snapping-enabled"),i=Symbol.for("esri-plugin-setting-bezier-enable-spline-behavior"),n={AboveCoordinates:-1e3,Coordinates:-100,Middle:0,BelowMiddle:100,ShapeMeasurements:1e3};export{i as bezierEnableSplineBehaviorSettingKey,e as freehandSnappingEnabledSettingKey,n as knownFieldDisplayOrders};
|
package/views/types.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ import type BuildingSublayer from "../layers/buildingSublayers/BuildingSublayer.
|
|
|
24
24
|
import type SubtypeSublayer from "../layers/support/SubtypeSublayer.js";
|
|
25
25
|
import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
|
|
26
26
|
import type { AbortOptions } from "../core/promiseUtils.js";
|
|
27
|
-
import type { ScreenPoint } from "../core/types.js";
|
|
27
|
+
import type { ScreenPoint, ScreenRect } from "../core/types.js";
|
|
28
28
|
import type { GeometryUnion } from "../geometry/types.js";
|
|
29
29
|
import type { MediaElement } from "../layers/media/types.js";
|
|
30
30
|
import type { NetworkFeature } from "../rest/support/types.js";
|
|
@@ -519,7 +519,7 @@ export interface ViewHitTestResult {
|
|
|
519
519
|
*
|
|
520
520
|
* @since 5.0
|
|
521
521
|
*/
|
|
522
|
-
screenPoint: ScreenPoint;
|
|
522
|
+
screenPoint: ScreenPoint | ScreenRect;
|
|
523
523
|
/**
|
|
524
524
|
* An array of result objects returned from the [MapView.hitTest()](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#hitTest).
|
|
525
525
|
* Results are returned when the location of the input screen coordinates intersects a [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{property as i,subclass as r}from"../../../core/accessorSupport/decorators.js";import n from"../../../layers/support/CodedValue.js";import a from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as l,dateTimeFieldValuesToNumericRange as s,isDomainValidForField as o}from"../../../layers/support/domainUtils.js";import{isNumericField as u,isStringField as m,isTimeOnlyField as p,getFieldRange as d,isDateOnlyField as f,isTimestampOffsetField as h}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as c}from"../../../layers/support/layerUtils.js";import y from"../../../layers/support/RangeDomain.js";import{isAnyDateField as g}from"../../../smartMapping/support/utils.js";import{isNumber as b}from"../../../support/guards.js";import{unknown as x,utc as v}from"../../../time/constants.js";import V from"./EditableInput.js";import{visibilityCodeToBoolean as _,isFieldInputWithShowNoValueOptionInput as F,differentValuesString as w}from"./support/inputUtils.js";import{getMaxLength as E,getMinLength as M,isEmptyValue as D,dateIsValid as T,validateFormValue as N}from"../../support/forms/formUtils.js";let R=class extends V{constructor(e){super(e),this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){const{field:e}=this;return u(e)?"number":m(e)?"text":g(e)||p(e)?"date":"unsupported"}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const e=this.template;if(null!=e.label&&""!==e.label)return e.label;const{field:t,layers:i}=this;if(1===i.length){const e=i[0];if(c(e)){const i=e.getFieldAlias(t.name);if(null!=i&&""!==i)return i}}return t.alias||t.name}get effectiveVisible(){return _(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>i.getAttribute(e)===t)}get field(){return this.template.field}get fieldName(){return this.field.name}get invalidFeatures(){return this.errors.map(e=>e.feature)}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this.template;return!this.required&&(!F(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this.template;return F(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.template.input;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return E({dataType:this.dataType,field:this.field,input:this.template.input})}get minLength(){return M({dataType:this.dataType,field:this.field,input:this.template.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=l(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?d(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){return(!this.required||!this.distinctValues.some(e=>D(e)))&&!!this.valid}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:w}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get effectiveTimeZone(){const e=this.template;let t=e.formTimeZone??"system";return e.layerTimeZone?e.layerTimeZone===x?t=v:e.formTimeZone===x&&(t=e.layerTimeZone):e.formTimeZone===x&&(t=v),t}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const e=this.codedValueDomainOptions,{value:t}=this,i=null==t||t===w||e.some(e=>e.value===t)?[]:[{name:`${t}`,value:t}];return[e,i]}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const r of this.features){if(null==i.getExpressionExecutorsForLayer(r.layer)?.requiredExpression)continue;t=!1;const n=this._lookupEvaluatedExpression(r,"required");"success"===n?.status?e=e||!0===n.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const e=this.template.input;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=s(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:r}=e;i={max:null!=t&&T(t)?t.getTime():null,min:null!=r&&T(r)?r.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:r}=this;if("date"!==this.dataType)return{};if(!r)return this._fieldShouldHaveDomain?{}:e;const n=l(i,r);if(!n)return e;const{max:a,min:s,rawMax:o,rawMin:u}=e,{type:m}=t.field;if("date"===m){const{max:e,min:t}=n;return{max:b(a)&&(null===e||null!=e&&a<=e)?a:e??null,min:b(s)&&(null===t||null!=t&&s>=t)?s:t??null}}if("date-only"===m||"time-only"===m||"timestamp-offset"===m){const{max:e,min:t,rawMax:i,rawMin:r}=n,l=b(a)&&o&&(null==e||a<e),m=b(s)&&u&&(null==t||s>t);return{max:l?a:e,min:m?s:t,rawMax:l?o:i,rawMin:m?u:r}}return{}}async setValueFromUser(e){this.userHasChangedValue=!0;const t=[],i=this.fieldName;for(const r of this.features)r.getAttribute(i)!==e&&t.push(r);this._setValue(e),await this.expressionsManager.valueChanged(i,t)}_setValue(e){const{fieldName:t}=this;for(const i of this.features)i.setAttribute(t,e)}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:r,range:n}=this,a=[];for(const l of this.features){const{layer:s}=l,o=s.getField(t)??this.field,u=s.getFieldDomain(t,{feature:l.plainGraphic}),m=this.calculateDomain([u]),p=this._requiredForFeature(l),d=l.getAttribute(t),f=N(d,{dataType:e,domain:m,field:o,maxLength:i,minLength:r,range:n,required:p});f&&a.push({error:f,feature:l.source})}return a}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&o(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let r=null;switch(t?.type){case"range":r=this._intersectRangeDomains(e);break;case"coded-value":r=this._intersectCodedValueDomains(e)}return r}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const n of e)for(const[e,i]of t){n.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let r=t;if(i){r=new Map;for(const[e,n]of i)t.has(e)&&r.set(e,n)}const l=Array.from(r.entries()).map(([e,t])=>new n({code:e,name:t}));return l.length?new a({codedValues:l}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let r=1;r<e.length;r++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[r])}if(t&&!o(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof y){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:r}=this;return f(r)||p(r)||h(r)?s(r,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new y,r=this._getMinMaxFromRangeDomain(e),n=this._getMinMaxFromRangeDomain(t),{field:a}=this,l=this._getValidRangeValue(r.min,-1/0),s=this._getValidRangeValue(r.max,1/0),o=this._getValidRangeValue(n.min,-1/0),u=this._getValidRangeValue(n.max,1/0);return i.minValue=Math.max(l,o),i.maxValue=Math.min(s,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((f(a)||p(a)||h(a))&&(i.minValue=Number(r.min)>Number(n.min)?r.rawMin:n.rawMin,i.maxValue=Number(r.max)<Number(n.max)?r.rawMax:n.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return b(e)?e:t}};e([i()],R.prototype,"dataType",null),e([i()],R.prototype,"domain",null),e([i()],R.prototype,"distinctValues",null),e([i()],R.prototype,"editable",null),e([i()],R.prototype,"label",null),e([i()],R.prototype,"effectiveVisible",null),e([i()],R.prototype,"effectiveVisibilityCode",null),e([i()],R.prototype,"errors",null),e([i()],R.prototype,"featuresHaveSameValue",null),e([i()],R.prototype,"field",null),e([i()],R.prototype,"fieldName",null),e([i()],R.prototype,"group",void 0),e([i()],R.prototype,"invalidFeatures",null),e([i()],R.prototype,"isSubtypeField",null),e([i()],R.prototype,"showNoValueOptionEnabled",null),e([i()],R.prototype,"showNoValueLabel",null),e([i()],R.prototype,"includeTime",null),e([i()],R.prototype,"includeTimeOffset",null),e([i()],R.prototype,"maxLength",null),e([i()],R.prototype,"minLength",null),e([i()],R.prototype,"range",null),e([i()],R.prototype,"required",null),e([i()],R.prototype,"submittable",null),e([i({readOnly:!0})],R.prototype,"type",void 0),e([i()],R.prototype,"userHasChangedValue",void 0),e([i()],R.prototype,"valid",null),e([i()],R.prototype,"value",null),e([i()],R.prototype,"visibilityCode",null),e([i()],R.prototype,"effectiveTimeZone",null),e([i()],R.prototype,"_evaluatedRequiredExpression",null),e([i()],R.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([i()],R.prototype,"_allDomains",null),e([i()],R.prototype,"_fieldShouldHaveDomain",null),e([i()],R.prototype,"_dateFormRange",null),e([i()],R.prototype,"_dateRange",null),R=e([r("esri.widgets.BatchAttributeForm.inputs.FieldInput")],R);const A=R;export{A as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{isSome as t}from"../../../core/arrayUtils.js";import{property as i,subclass as r}from"../../../core/accessorSupport/decorators.js";import n from"../../../layers/support/CodedValue.js";import a from"../../../layers/support/CodedValueDomain.js";import{getDomainRange as l,dateTimeFieldValuesToNumericRange as s,isDomainValidForField as o}from"../../../layers/support/domainUtils.js";import{isNumericField as u,isStringField as m,isTimeOnlyField as p,getFieldRange as d,isDateOnlyField as f,isTimestampOffsetField as h}from"../../../layers/support/fieldUtils.js";import{supportsFieldConfiguration as c}from"../../../layers/support/layerUtils.js";import y from"../../../layers/support/RangeDomain.js";import{isAnyDateField as g}from"../../../smartMapping/support/utils.js";import{isNumber as b}from"../../../support/guards.js";import{unknown as x,utc as v}from"../../../time/constants.js";import V from"./EditableInput.js";import{visibilityCodeToBoolean as _,isFieldInputWithShowNoValueOptionInput as F,differentValuesString as w}from"./support/inputUtils.js";import{getMaxLength as E,getMinLength as M,isEmptyValue as D,dateIsValid as T,validateFormValue as N}from"../../support/forms/formUtils.js";let R=class extends V{constructor(e){super(e),this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return"batch-attribute-form-validation::features-have-different-errors";const t=e[0];for(const i of e)if(i.error!==t.error)return"batch-attribute-form-validation::features-have-different-errors";return t.error}get dataType(){const{field:e}=this;return u(e)?"number":m(e)?"text":g(e)||p(e)?"date":"unsupported"}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get label(){const e=this.template;if(null!=e.label&&""!==e.label)return e.label;const{field:t,layers:i}=this;if(1===i.length){const e=i[0];if(c(e)){const i=e.getFieldAlias(t.name);if(null!=i&&""!==i)return i}}return t.alias||t.name}get effectiveVisible(){return _(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if("visible"!==e)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return"hidden:visibility-expression:all-features"===i?"hidden:group-visibility-expression:all-features":"hidden:visibility-expression:some-features"===i?"hidden:group-visibility-expression:some-features":e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every(i=>i.getAttribute(e)===t)}get field(){return this.template.field}get fieldName(){return this.field.name}get invalidFeatures(){return this.errors.map(e=>e.feature)}get isSubtypeField(){return this.layers.some(e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1})}get showNoValueOptionEnabled(){const{input:e}=this.template;return!this.required&&(!F(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this.template;return F(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return"date"===this.dataType&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.template.input;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return E({dataType:this.dataType,field:this.field,input:this.template.input})}get minLength(){return M({dataType:this.dataType,field:this.field,input:this.template.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=l(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every(e=>!e)?d(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){return(!this.required||!this.distinctValues.some(e=>D(e)))&&!!this.valid}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:w}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?"hidden:no-domain-in-common":this._baseVisibilityCode:"hidden:field-definition"}get effectiveTimeZone(){const e=this.template;let t=e.formTimeZone??"system";return e.layerTimeZone?e.layerTimeZone===x?t=v:e.formTimeZone===x&&(t=e.layerTimeZone):e.formTimeZone===x&&(t=v),t}get codedValueDomainOptions(){return"coded-value"===this.domain?.type?this.domain.codedValues.map(({name:e,code:t})=>({name:e,value:t})):[]}get codedValueOptions(){const e=this.codedValueDomainOptions,{value:t}=this,i=null==t||t===w||e.some(e=>e.value===t)?[]:[{name:`${t}`,value:t}];return[e,i]}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const r of this.features){if(null==i.getExpressionExecutorsForLayer(r.layer)?.requiredExpression)continue;t=!1;const n=this._lookupEvaluatedExpression(r,"required");"success"===n?.status?e=e||!0===n.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map(t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i})}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const e=this.template.input;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"timestampoffset-picker"!==t||(i=s(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:r}=e;i={max:null!=t&&T(t)?t.getTime():null,min:null!=r&&T(r)?r.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:r}=this;if("date"!==this.dataType)return{};if(!r)return this._fieldShouldHaveDomain?{}:e;const n=l(i,r);if(!n)return e;const{max:a,min:s,rawMax:o,rawMin:u}=e,{type:m}=t.field;if("date"===m){const{max:e,min:t}=n;return{max:b(a)&&(null===e||null!=e&&a<=e)?a:e??null,min:b(s)&&(null===t||null!=t&&s>=t)?s:t??null}}if("date-only"===m||"time-only"===m||"timestamp-offset"===m){const{max:e,min:t,rawMax:i,rawMin:r}=n,l=b(a)&&o&&(null==e||a<e),m=b(s)&&u&&(null==t||s>t);return{max:l?a:e,min:m?s:t,rawMax:l?o:i,rawMin:m?u:r}}return{}}async setValueFromUser(e){this.userHasChangedValue=!0;const t=[],i=this.fieldName;for(const r of this.features)r.getAttribute(i)!==e&&t.push(r);this._setValue(e),await this.expressionsManager.valueChanged(i,t)}_setValue(e){const{fieldName:t}=this;for(const i of this.features)i.setAttribute(t,e)}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:r,range:n}=this,a=[],l="multiple-choice"===this.template.input?.type?this.template.input:null;for(const s of this.features){const{layer:o}=s,u=o.getField(t)??this.field,m=o.getFieldDomain(t,{feature:s.plainGraphic}),p=this.calculateDomain([m]),d=this._requiredForFeature(s),f=s.getAttribute(t),h=N(f,{dataType:e,domain:p,field:u,maxLength:i,minLength:r,multipleChoice:l,range:n,required:d});h&&a.push({error:h,feature:s.source})}return a}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find(e=>null!=e),i=this.template.domain;if(!t)return i&&o(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some(e=>!e)){if(!i)return null;e=e.filter(e=>null!==e)}break;case"range":e=e.filter(e=>null!==e)}if(!e.every(e=>e?.type===t?.type))return null;let r=null;switch(t?.type){case"range":r=this._intersectRangeDomains(e);break;case"coded-value":r=this._intersectCodedValueDomains(e)}return r}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map(({code:e,name:t})=>[e,t])),i=this.template.domain?new Map(this.template.domain.codedValues.map(({code:e,name:t})=>[e,t])):null;for(const n of e)for(const[e,i]of t){n.codedValues.some(t=>t.code===e&&t.name===i)||t.delete(e)}let r=t;if(i){r=new Map;for(const[e,n]of i)t.has(e)&&r.set(e,n)}const l=Array.from(r.entries()).map(([e,t])=>new n({code:e,name:t}));return l.length?new a({codedValues:l}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];for(let r=1;r<e.length;r++){if(!t)return null;t=this._findMinMaxValuesBetweenTwoDomains(t,e[r])}if(t&&!o(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof y){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:r}=this;return f(r)||p(r)||h(r)?s(r,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new y,r=this._getMinMaxFromRangeDomain(e),n=this._getMinMaxFromRangeDomain(t),{field:a}=this,l=this._getValidRangeValue(r.min,-1/0),s=this._getValidRangeValue(r.max,1/0),o=this._getValidRangeValue(n.min,-1/0),u=this._getValidRangeValue(n.max,1/0);return i.minValue=Math.max(l,o),i.maxValue=Math.min(s,u),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((f(a)||p(a)||h(a))&&(i.minValue=Number(r.min)>Number(n.min)?r.rawMin:n.rawMin,i.maxValue=Number(r.max)<Number(n.max)?r.rawMax:n.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return b(e)?e:t}};e([i()],R.prototype,"dataType",null),e([i()],R.prototype,"domain",null),e([i()],R.prototype,"distinctValues",null),e([i()],R.prototype,"editable",null),e([i()],R.prototype,"label",null),e([i()],R.prototype,"effectiveVisible",null),e([i()],R.prototype,"effectiveVisibilityCode",null),e([i()],R.prototype,"errors",null),e([i()],R.prototype,"featuresHaveSameValue",null),e([i()],R.prototype,"field",null),e([i()],R.prototype,"fieldName",null),e([i()],R.prototype,"group",void 0),e([i()],R.prototype,"invalidFeatures",null),e([i()],R.prototype,"isSubtypeField",null),e([i()],R.prototype,"showNoValueOptionEnabled",null),e([i()],R.prototype,"showNoValueLabel",null),e([i()],R.prototype,"includeTime",null),e([i()],R.prototype,"includeTimeOffset",null),e([i()],R.prototype,"maxLength",null),e([i()],R.prototype,"minLength",null),e([i()],R.prototype,"range",null),e([i()],R.prototype,"required",null),e([i()],R.prototype,"submittable",null),e([i({readOnly:!0})],R.prototype,"type",void 0),e([i()],R.prototype,"userHasChangedValue",void 0),e([i()],R.prototype,"valid",null),e([i()],R.prototype,"value",null),e([i()],R.prototype,"visibilityCode",null),e([i()],R.prototype,"effectiveTimeZone",null),e([i()],R.prototype,"_evaluatedRequiredExpression",null),e([i()],R.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([i()],R.prototype,"_allDomains",null),e([i()],R.prototype,"_fieldShouldHaveDomain",null),e([i()],R.prototype,"_dateFormRange",null),e([i()],R.prototype,"_dateRange",null),R=e([r("esri.widgets.BatchAttributeForm.inputs.FieldInput")],R);const A=R;export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{numericHash as t}from"../../../../core/string.js";import{isBarcodeScannerInput as n,isComboBoxInput as e,isRadioButtonsInput as i,isDatePickerInput as r,isDateTimePickerInput as o,isDateTimeOffsetPickerInput as $,isSwitchInput as u,isTextAreaInput as
|
|
2
|
+
import{numericHash as t}from"../../../../core/string.js";import{isBarcodeScannerInput as n,isComboBoxInput as e,isRadioButtonsInput as i,isDatePickerInput as r,isDateTimePickerInput as o,isDateTimeOffsetPickerInput as $,isSwitchInput as u,isTextAreaInput as c,isTextBoxInput as l,isTimePickerInput as a,isMultipleChoiceInput as m}from"../../../../form/elements/inputs/inputUtils.js";import{isFieldElementTemplate as f,isGroupElementTemplate as s,isTextElementTemplate as p,isAttachmentElementTemplate as g,isExcludedFromSharedForm as h}from"./templateUtils.js";const d="",S="num:";function y(n){return f(n)?t(O(n)).toString():s(n)?t(x(n)).toString():p(n)?t(b(n)).toString():g(n)?t(C(n)).toString():t(JSON.stringify(n)).toString()}function O(t){return`${V(t)}.${v(t.field)}.${w(t.domain)}.${t.hint??d}.${N(t.input)}.${t.layerTimeZone??""}`}function x(t){const n=V(t)+`.${t.initialState}`;let e=d;for(const i of t.elements)h(i)||(e+="."+y(i).toString());return`${n}${e}`}function b(t){const n=V(t),{compiledText:e}=t;return`${n}.${e??d}`}function C(t){return`${V(t)}.${t.allowUserRename}.${t.attachmentKeyword??d}.${t.displayFilename}.${T(t.input)}.${t.maxAttachmentCount??d}.${t.minAttachmentCount??d}.${t.useOriginalFilename}`}function V(t){return`${t.label??d}.${t.description??d}`}function N(t){if(!t)return d;const{type:f}=t;if(n(t))return f??d;if(e(t)||i(t)){const{showNoValueOption:n}=t;return`${f}.${n}.${t.noValueOptionLabel??d}`}if(r(t))return`${f}.${j(t)}`;if(o(t)){const n=t.min?.getTime(),e=t.max?.getTime(),{includeTime:i}=t;return`${f}.${n}.${e}.${i}`}if($(t)){const n=j(t),{includeTimeOffset:e,timeResolution:i}=t;return`${f}.${n}.${e}.${i}`}if(u(t)){const{offValue:n,onValue:e}=t;return`${f}.${R(n)}.${R(e)}`}if(c(t)||l(t)){return`${f}.${t.minLength?.toString()??d}.${t.maxLength?.toString()??d}`}if(a(t)){const n=j(t),{timeResolution:e}=t;return`${f}.${n}.${e}`}if(m(t)){return`${f}.${j({min:t.minSelectedChoices?.toString(),max:t.maxSelectedChoices?.toString()})}.${t.choiceDelimiter??d}.${t.includeOtherChoice}.${t.otherChoice?.fieldName??d}.${t.otherChoice?.label??d}.${t.otherChoice?.hint??d}.${J(t)}`}return JSON.stringify(t)}function T(t){return t?JSON.stringify(t.toJSON()):d}function j(t){return`${t.min??d}.${t.max??d}`}function J(t){return(t.choices??[]).map(({label:t,value:n})=>`${t}.${n}`).sort().join(".")}function v(t){const n=t.name,e=t.alias??d;return`${n}.${e===n?d:e}.${t.nullable}.${t.type}.${t.length??d}.${t.defaultValue??d}.${t.description??d}.${t.editable}.${t.visible}`}function w(t){return t?"coded-value"===t.type?L(t):"range"===t.type?U(t):JSON.stringify(t):d}function L(t){const{type:n}=t;return`${n}.${t.codedValues.map(({code:t,name:n})=>`${R(t)}.${n}`).sort().join(".")}`}function R(t){return"number"==typeof t?`${S}${t}`:t}function U(t){const{maxValue:n,minValue:e,type:i}=t;return`${i}.${e}.${n}`}export{y as hashElementTemplate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{deprecateUnnecessaryViewModel as e}from"../../core/deprecate.js";import{EventedAccessor as i}from"../../core/Evented.js";import{makeHandle as n}from"../../core/handleUtils.js";import s from"../../core/Logger.js";import{removeMaybe as a}from"../../core/maybe.js";import{when as l,initial as r,watch as h,on as o,syncAndInitial as g}from"../../core/reactiveUtils.js";import{schedule as d}from"../../core/scheduling.js";import{truncateLocalTime as p,isValidDate as u,resetUTCDate as y,offsetDate as c}from"../../core/timeUtils.js";import{property as m,subclass as _}from"../../core/accessorSupport/decorators.js";import f from"../../views/3d/environment/SunLighting.js";import D from"../../views/3d/environment/VirtualLighting.js";import{positionToTimezoneInfo as w}from"../../views/3d/support/earthUtils.js";import{dateTimeToSliderPos as U,sliderPosToDateTime as S,getSeasonFromDate as T,getNorthernHemisphereSeason as v,getSeasonDate as L,calculatePlaySpeed as P}from"./support/daylightUtils.js";import{SliderWithDropdownViewModel as b}from"./support/SliderWithDropdownViewModel.js";import{formatSliderLabel as C,getSunriseAndSunsetTimes as O}from"../support/timeWidgetUtils.js";let E=class extends i{constructor(t){super(t),this.view=null,this.timeSliderViewModel=new b({min:0,max:1439,values:[0],labelFormatFunction:C,inputFormatFunction:C}),this.lightingUpdateInterval=200,this._oldLighting=null,this.playSpeedMultiplier=1,this._lastTime=null,this._sunrise=null,this._sunset=null,this._cachedLightingDateUTC=new Date(0),this._cachedDisplayUTCOffset=0,this._lastLightingUpdate=0,this._lightingUpdateHandle=null,t?.suppressDeprecationWarning||e(s.getLogger(this),"Daylight","arcgis-daylight",{version:"4.34"})}normalizeCtorArgs(t={}){const{suppressDeprecationWarning:e,...i}=t;return i}initialize(){this.addHandles([l(()=>this.view,t=>t.when(()=>this._updateLighting()),r),h(()=>{const t=this._lighting;return"sun"===t?.type?t.date:null},t=>this._scheduleLightingUpdate(t)),o(()=>this._lighting,"timezone-will-change",t=>this._timezoneWillChange(t),{onListenerAdd:()=>this._timezoneWillChange(null)}),h(()=>!0===this.view?.stationary,()=>{(this.dayPlaying||this.yearPlaying)&&this._updateSunriseAndSunset()},r),h(()=>{const t=this.timeSliderViewModel;return{vm:t,state:t.state,sliderPosition:this.timeSliderPosition}},({vm:t,state:e,sliderPosition:i})=>{"ready"===e&&t.setValue(0,i)}),h(()=>this.timeSliderViewModel?.utcOffset,t=>{null!=t&&(this.utcOffset=t)}),h(()=>({utcOffset:this.utcOffset,sliderViewModel:this.timeSliderViewModel}),({utcOffset:t,sliderViewModel:e})=>{e&&(e.utcOffset=t)},g),h(()=>this.timeSliderViewModel.timezonePickerOpen,()=>this.stopPlaying()),h(()=>this.timeSliderViewModel.values,t=>this._setTimeSliderPosition(t?.[0]??0,{forceLightingUpdate:!1}))])}destroy(){this._cancelLightingUpdate(),this.view=null}get isSupported(){return null==this.view||"3d"===this.view.type}get utcOffset(){return this._cachedDisplayUTCOffset}set utcOffset(t){t!==this.utcOffset&&null!=this._lighting&&"virtual"!==this._lighting.type&&(this._lighting.displayUTCOffset=t,this._updateLighting())}get localDate(){return p(this._lightingDateDisplay)}set localDate(t){this.view?.ready?u(t)&&t.getTime()!==this.localDate.getTime()&&(this._lightingDateDisplay=y(this._lightingDateDisplay,t)):s.getLogger(this).error("The localDate property cannot be set before the view and the widget are ready.")}get timeSliderPosition(){return U(this._lightingDateDisplay)}set timeSliderPosition(t){this.view?.ready&&"ready"===this.timeSliderViewModel?.state?this._setTimeSliderPosition(t,{forceLightingUpdate:!0}):s.getLogger(this).error("The timeSliderPosition property cannot be set before the view and the widget are ready.")}_setTimeSliderPosition(t,e){Math.abs(t-this.timeSliderPosition)<=1/60||(this.stopPlaying(),this._onUserDateTimeChange(),e.forceLightingUpdate&&(this._cancelLightingUpdate(),this._updateLighting()),this._lightingDateDisplay=S(this._lightingDateDisplay,t))}_timezoneFromCamera(t,e){if(null==e||!t.cameraTrackingEnabled)return 0;const i=w([e.longitude,e.latitude]);return null==i?0:Math.round(i.hours+i.minutes/60+i.seconds/3600)}get directShadowsEnabled(){return this._lighting?.directShadowsEnabled??!1}set directShadowsEnabled(t){const e=this._lighting;e&&(e.directShadowsEnabled=t)}get sunLightingEnabled(){return"sun"===this._lightingType}set sunLightingEnabled(t){const e=this._environment;if(t===this._get("sunLightingEnabled")||null==e)return;const i=e.lighting,n=this._oldLighting;this._oldLighting=i;const s={directShadowsEnabled:i.directShadowsEnabled,cameraTrackingEnabled:i.cameraTrackingEnabled},a=t?"sun":"virtual";let l;l=null!=n&&n.type===a?n:t?new f:new D,l.set(s),e.lighting=l,t||(this.stopPlaying(),this.timeSliderViewModel.timezonePickerOpen=!1)}set playingState(t){this.playingState!==t&&(this._set("playingState",t),"none"!==t&&this.sunLightingEnabled&&(this._updateSunriseAndSunset(),this._lastTime=Date.now(),this._play(),this._onUserDateTimeChange()))}get dayPlaying(){return"day"===this.playingState}set dayPlaying(t){t?this.playingState="day":this.dayPlaying&&(this.playingState="none")}get yearPlaying(){return"year"===this.playingState}set yearPlaying(t){t?this.playingState="year":this.yearPlaying&&(this.playingState="none")}get currentSeason(){return T(this.localDate,this._currentHemisphere)}set currentSeason(t){this.stopPlaying(),this._onUserDateTimeChange();const e=v(t,this._currentHemisphere);this.localDate=L(this.localDate,e,0)}get _currentHemisphere(){const t=this.view?.camera?.position?.latitude;return null==t||t>=0?0:1}get _environment(){return this.view?.environment}get _lighting(){return this._environment?.lighting}get _lightingType(){return this._lighting?.type}get _lightingDateDisplay(){return c(this._cachedLightingDateUTC,this._cachedDisplayUTCOffset,"hours")}set _lightingDateDisplay(t){const e=this._lighting;if(null==e||!this.sunLightingEnabled||"virtual"===e.type||!u(t))return;const i=e.date,n=c(t,-this._cachedDisplayUTCOffset,"hours");n.getTime()!==i.getTime()&&(e.date=n,this._updateLighting())}stopPlaying(){this.playingState="none"}toggleDayPlaying(){this.dayPlaying=!this.dayPlaying}toggleYearPlaying(){this.yearPlaying=!this.yearPlaying}toggleSunLightingEnabled(){this.stopPlaying(),this.sunLightingEnabled=!this.sunLightingEnabled}toggleDirectShadowsEnabled(){this.stopPlaying(),this.directShadowsEnabled=!this.directShadowsEnabled}onDateChange(t){this.dayPlaying=!1,this.localDate=t,this._onUserDateTimeChange()}_updateLighting(t){const e=Date.now();this._lastLightingUpdate=e;const{view:i}=this,n=this._lighting;if(null==i||null==n||"virtual"===n.type)return;t??=n.date;const s=n.displayUTCOffset,a=null!=s?s:this._timezoneFromCamera(n,i.camera?.position);this._cachedLightingDateUTC.getTime()!==t.getTime()&&(this._cachedLightingDateUTC=new Date(t)),this._cachedDisplayUTCOffset!==a&&(this._cachedDisplayUTCOffset=a)}_timezoneWillChange(t){const e=this._lighting;if(null==e||"virtual"===e.type||!e.cameraTrackingEnabled)return;let i;if(t)i=t.timezoneOffset;else{if(null!=e.displayUTCOffset)return;i=f.calculateTimezoneOffset(e.positionTimezoneInfo)}e.displayUTCOffset=i,this._scheduleLightingUpdate()}_scheduleLightingUpdate(t){if(t&&(this._lightingUpdateHandle=a(this._lightingUpdateHandle),!u(t)))return;if(this._lightingUpdateHandle)return;const e=Date.now()-this._lastLightingUpdate,i=this.lightingUpdateInterval-e;let s=null;const l=()=>{this._updateLighting(t),this._lightingUpdateHandle===s&&(this._lightingUpdateHandle=null)};if(i<=0)this._lightingUpdateHandle=s=d(l);else{const t=setTimeout(l,i);this._lightingUpdateHandle=s=n(()=>clearTimeout(t))}}_cancelLightingUpdate(){this._lightingUpdateHandle=a(this._lightingUpdateHandle)}_play(){const t=this._lighting;if(null==t||!this.sunLightingEnabled||"virtual"===t.type)return;const e=t.date;if(this.dayPlaying||this.yearPlaying){const i=Date.now()-(this._lastTime??0);if(this.dayPlaying){this._lastTime=Date.now();const n=P(this._sunrise,this._sunset,e)*this.playSpeedMultiplier/100*i;if(n>0){let i=new Date(e.getTime()+n);const s=t.displayUTCOffset??0;if(((i.getUTCHours()+s)%24+24)%24<((e.getUTCHours()+s)%24+24)%24){const t=864e5;i=new Date(e.getTime()+n-t)}t.date=i}}else{if(i>1e3){this._lastTime=Date.now();const i=(e.getUTCMonth()+1)%12,n=new Date(e);n.setUTCMonth(i),t.date=n}}requestAnimationFrame(()=>this._play())}}_updateSunriseAndSunset(){const t=this._lighting;if(null==t||"virtual"===t.type||!this.sunLightingEnabled)return;const e=this.view?.camera?.position;if(null==e)return;const{latitude:i,longitude:n}=e,{date:s,displayUTCOffset:a}=t,l=O(s,i,n,a??0);l&&(this._sunrise=new Date(l.sunrise),this._sunset=new Date(l.sunset))}_onUserDateTimeChange(){this.emit("user-date-time-change",{})}};t([m()],E.prototype,"view",void 0),t([m({type:b,nonNullable:!0})],E.prototype,"timeSliderViewModel",void 0),t([m()],E.prototype,"isSupported",null),t([m()],E.prototype,"lightingUpdateInterval",void 0),t([m()],E.prototype,"utcOffset",null),t([m({type:Date})],E.prototype,"localDate",null),t([m()],E.prototype,"timeSliderPosition",null),t([m()],E.prototype,"directShadowsEnabled",null),t([m()],E.prototype,"sunLightingEnabled",null),t([m({type:["none","day","year"],value:"none"})],E.prototype,"playingState",null),t([m()],E.prototype,"dayPlaying",null),t([m()],E.prototype,"yearPlaying",null),t([m()],E.prototype,"playSpeedMultiplier",void 0),t([m()],E.prototype,"currentSeason",null),t([m()],E.prototype,"_lastTime",void 0),t([m()],E.prototype,"_sunrise",void 0),t([m()],E.prototype,"_sunset",void 0),t([m()],E.prototype,"_cachedLightingDateUTC",void 0),t([m()],E.prototype,"_cachedDisplayUTCOffset",void 0),t([m()],E.prototype,"_currentHemisphere",null),t([m()],E.prototype,"_environment",null),t([m()],E.prototype,"_lighting",null),t([m()],E.prototype,"_lightingType",null),t([m()],E.prototype,"_lightingDateDisplay",null),E=t([_("esri.widgets.Daylight.DaylightViewModel")],E);const M=E;export{M as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import{deprecateUnnecessaryViewModel as e}from"../../core/deprecate.js";import{EventedAccessor as i}from"../../core/Evented.js";import{makeHandle as n}from"../../core/handleUtils.js";import s from"../../core/Logger.js";import{removeMaybe as a}from"../../core/maybe.js";import{when as l,initial as r,watch as o,on as h,syncAndInitial as g}from"../../core/reactiveUtils.js";import{schedule as d}from"../../core/scheduling.js";import{truncateLocalTime as p,isValidDate as u,resetUTCDate as c,offsetDate as y}from"../../core/timeUtils.js";import{property as m,subclass as _}from"../../core/accessorSupport/decorators.js";import f from"../../views/3d/environment/SunLighting.js";import D from"../../views/3d/environment/VirtualLighting.js";import{positionToTimezoneInfo as w}from"../../views/3d/support/earthUtils.js";import{dateTimeToSliderPos as U,sliderPosToDateTime as S,getSeasonFromDate as T,getNorthernHemisphereSeason as v,getSeasonDate as L,calculatePlaySpeed as P}from"./support/daylightUtils.js";import{SliderWithDropdownViewModel as b}from"./support/SliderWithDropdownViewModel.js";import{formatSliderLabel as C,getSunriseAndSunsetTimes as O}from"../support/timeWidgetUtils.js";let E=class extends i{constructor(t){super(t),this.view=null,this.timeSliderViewModel=new b({suppressDeprecationWarning:!0,min:0,max:1439,values:[0],labelFormatFunction:C,inputFormatFunction:C}),this.lightingUpdateInterval=200,this._oldLighting=null,this.playSpeedMultiplier=1,this._lastTime=null,this._sunrise=null,this._sunset=null,this._cachedLightingDateUTC=new Date(0),this._cachedDisplayUTCOffset=0,this._lastLightingUpdate=0,this._lightingUpdateHandle=null,t?.suppressDeprecationWarning||e(s.getLogger(this),"Daylight","arcgis-daylight",{version:"4.34"})}normalizeCtorArgs(t={}){const{suppressDeprecationWarning:e,...i}=t;return i}initialize(){this.addHandles([l(()=>this.view,t=>t.when(()=>this._updateLighting()),r),o(()=>{const t=this._lighting;return"sun"===t?.type?t.date:null},t=>this._scheduleLightingUpdate(t)),h(()=>this._lighting,"timezone-will-change",t=>this._timezoneWillChange(t),{onListenerAdd:()=>this._timezoneWillChange(null)}),o(()=>!0===this.view?.stationary,()=>{(this.dayPlaying||this.yearPlaying)&&this._updateSunriseAndSunset()},r),o(()=>{const t=this.timeSliderViewModel;return{vm:t,state:t.state,sliderPosition:this.timeSliderPosition}},({vm:t,state:e,sliderPosition:i})=>{"ready"===e&&t.setValue(0,i)}),o(()=>this.timeSliderViewModel?.utcOffset,t=>{null!=t&&(this.utcOffset=t)}),o(()=>({utcOffset:this.utcOffset,sliderViewModel:this.timeSliderViewModel}),({utcOffset:t,sliderViewModel:e})=>{e&&(e.utcOffset=t)},g),o(()=>this.timeSliderViewModel.timezonePickerOpen,()=>this.stopPlaying()),o(()=>this.timeSliderViewModel.values,t=>this._setTimeSliderPosition(t?.[0]??0,{forceLightingUpdate:!1}))])}destroy(){this._cancelLightingUpdate(),this.view=null}get isSupported(){return null==this.view||"3d"===this.view.type}get utcOffset(){return this._cachedDisplayUTCOffset}set utcOffset(t){t!==this.utcOffset&&null!=this._lighting&&"virtual"!==this._lighting.type&&(this._lighting.displayUTCOffset=t,this._updateLighting())}get localDate(){return p(this._lightingDateDisplay)}set localDate(t){this.view?.ready?u(t)&&t.getTime()!==this.localDate.getTime()&&(this._lightingDateDisplay=c(this._lightingDateDisplay,t)):s.getLogger(this).error("The localDate property cannot be set before the view and the widget are ready.")}get timeSliderPosition(){return U(this._lightingDateDisplay)}set timeSliderPosition(t){this.view?.ready&&"ready"===this.timeSliderViewModel?.state?this._setTimeSliderPosition(t,{forceLightingUpdate:!0}):s.getLogger(this).error("The timeSliderPosition property cannot be set before the view and the widget are ready.")}_setTimeSliderPosition(t,e){Math.abs(t-this.timeSliderPosition)<=1/60||(this.stopPlaying(),this._onUserDateTimeChange(),e.forceLightingUpdate&&(this._cancelLightingUpdate(),this._updateLighting()),this._lightingDateDisplay=S(this._lightingDateDisplay,t))}_timezoneFromCamera(t,e){if(null==e||!t.cameraTrackingEnabled)return 0;const i=w([e.longitude,e.latitude]);return null==i?0:Math.round(i.hours+i.minutes/60+i.seconds/3600)}get directShadowsEnabled(){return this._lighting?.directShadowsEnabled??!1}set directShadowsEnabled(t){const e=this._lighting;e&&(e.directShadowsEnabled=t)}get sunLightingEnabled(){return"sun"===this._lightingType}set sunLightingEnabled(t){const e=this._environment;if(t===this._get("sunLightingEnabled")||null==e)return;const i=e.lighting,n=this._oldLighting;this._oldLighting=i;const s={directShadowsEnabled:i.directShadowsEnabled,cameraTrackingEnabled:i.cameraTrackingEnabled},a=t?"sun":"virtual";let l;l=null!=n&&n.type===a?n:t?new f:new D,l.set(s),e.lighting=l,t||(this.stopPlaying(),this.timeSliderViewModel.timezonePickerOpen=!1)}set playingState(t){this.playingState!==t&&(this._set("playingState",t),"none"!==t&&this.sunLightingEnabled&&(this._updateSunriseAndSunset(),this._lastTime=Date.now(),this._play(),this._onUserDateTimeChange()))}get dayPlaying(){return"day"===this.playingState}set dayPlaying(t){t?this.playingState="day":this.dayPlaying&&(this.playingState="none")}get yearPlaying(){return"year"===this.playingState}set yearPlaying(t){t?this.playingState="year":this.yearPlaying&&(this.playingState="none")}get currentSeason(){return T(this.localDate,this._currentHemisphere)}set currentSeason(t){this.stopPlaying(),this._onUserDateTimeChange();const e=v(t,this._currentHemisphere);this.localDate=L(this.localDate,e,0)}get _currentHemisphere(){const t=this.view?.camera?.position?.latitude;return null==t||t>=0?0:1}get _environment(){return this.view?.environment}get _lighting(){return this._environment?.lighting}get _lightingType(){return this._lighting?.type}get _lightingDateDisplay(){return y(this._cachedLightingDateUTC,this._cachedDisplayUTCOffset,"hours")}set _lightingDateDisplay(t){const e=this._lighting;if(null==e||!this.sunLightingEnabled||"virtual"===e.type||!u(t))return;const i=e.date,n=y(t,-this._cachedDisplayUTCOffset,"hours");n.getTime()!==i.getTime()&&(e.date=n,this._updateLighting())}stopPlaying(){this.playingState="none"}toggleDayPlaying(){this.dayPlaying=!this.dayPlaying}toggleYearPlaying(){this.yearPlaying=!this.yearPlaying}toggleSunLightingEnabled(){this.stopPlaying(),this.sunLightingEnabled=!this.sunLightingEnabled}toggleDirectShadowsEnabled(){this.stopPlaying(),this.directShadowsEnabled=!this.directShadowsEnabled}onDateChange(t){this.dayPlaying=!1,this.localDate=t,this._onUserDateTimeChange()}_updateLighting(t){const e=Date.now();this._lastLightingUpdate=e;const{view:i}=this,n=this._lighting;if(null==i||null==n||"virtual"===n.type)return;t??=n.date;const s=n.displayUTCOffset,a=null!=s?s:this._timezoneFromCamera(n,i.camera?.position);this._cachedLightingDateUTC.getTime()!==t.getTime()&&(this._cachedLightingDateUTC=new Date(t)),this._cachedDisplayUTCOffset!==a&&(this._cachedDisplayUTCOffset=a)}_timezoneWillChange(t){const e=this._lighting;if(null==e||"virtual"===e.type||!e.cameraTrackingEnabled)return;let i;if(t)i=t.timezoneOffset;else{if(null!=e.displayUTCOffset)return;i=f.calculateTimezoneOffset(e.positionTimezoneInfo)}e.displayUTCOffset=i,this._scheduleLightingUpdate()}_scheduleLightingUpdate(t){if(t&&(this._lightingUpdateHandle=a(this._lightingUpdateHandle),!u(t)))return;if(this._lightingUpdateHandle)return;const e=Date.now()-this._lastLightingUpdate,i=this.lightingUpdateInterval-e;let s=null;const l=()=>{this._updateLighting(t),this._lightingUpdateHandle===s&&(this._lightingUpdateHandle=null)};if(i<=0)this._lightingUpdateHandle=s=d(l);else{const t=setTimeout(l,i);this._lightingUpdateHandle=s=n(()=>clearTimeout(t))}}_cancelLightingUpdate(){this._lightingUpdateHandle=a(this._lightingUpdateHandle)}_play(){const t=this._lighting;if(null==t||!this.sunLightingEnabled||"virtual"===t.type)return;const e=t.date;if(this.dayPlaying||this.yearPlaying){const i=Date.now()-(this._lastTime??0);if(this.dayPlaying){this._lastTime=Date.now();const n=P(this._sunrise,this._sunset,e)*this.playSpeedMultiplier/100*i;if(n>0){let i=new Date(e.getTime()+n);const s=t.displayUTCOffset??0;if(((i.getUTCHours()+s)%24+24)%24<((e.getUTCHours()+s)%24+24)%24){const t=864e5;i=new Date(e.getTime()+n-t)}t.date=i}}else{if(i>1e3){this._lastTime=Date.now();const i=(e.getUTCMonth()+1)%12,n=new Date(e);n.setUTCMonth(i),t.date=n}}requestAnimationFrame(()=>this._play())}}_updateSunriseAndSunset(){const t=this._lighting;if(null==t||"virtual"===t.type||!this.sunLightingEnabled)return;const e=this.view?.camera?.position;if(null==e)return;const{latitude:i,longitude:n}=e,{date:s,displayUTCOffset:a}=t,l=O(s,i,n,a??0);l&&(this._sunrise=new Date(l.sunrise),this._sunset=new Date(l.sunset))}_onUserDateTimeChange(){this.emit("user-date-time-change",{})}};t([m()],E.prototype,"view",void 0),t([m({type:b,nonNullable:!0})],E.prototype,"timeSliderViewModel",void 0),t([m()],E.prototype,"isSupported",null),t([m()],E.prototype,"lightingUpdateInterval",void 0),t([m()],E.prototype,"utcOffset",null),t([m({type:Date})],E.prototype,"localDate",null),t([m()],E.prototype,"timeSliderPosition",null),t([m()],E.prototype,"directShadowsEnabled",null),t([m()],E.prototype,"sunLightingEnabled",null),t([m({type:["none","day","year"],value:"none"})],E.prototype,"playingState",null),t([m()],E.prototype,"dayPlaying",null),t([m()],E.prototype,"yearPlaying",null),t([m()],E.prototype,"playSpeedMultiplier",void 0),t([m()],E.prototype,"currentSeason",null),t([m()],E.prototype,"_lastTime",void 0),t([m()],E.prototype,"_sunrise",void 0),t([m()],E.prototype,"_sunset",void 0),t([m()],E.prototype,"_cachedLightingDateUTC",void 0),t([m()],E.prototype,"_cachedDisplayUTCOffset",void 0),t([m()],E.prototype,"_currentHemisphere",null),t([m()],E.prototype,"_environment",null),t([m()],E.prototype,"_lighting",null),t([m()],E.prototype,"_lightingType",null),t([m()],E.prototype,"_lightingDateDisplay",null),E=t([_("esri.widgets.Daylight.DaylightViewModel")],E);const M=E;export{M as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as o,subclass as t}from"../../../core/accessorSupport/decorators.js";import i from"../../Slider.js";import{SliderWithDropdownViewModel as s}from"./SliderWithDropdownViewModel.js";import{TimezonePicker as r}from"../../support/TimezonePicker.js";import{tsx as n}from"../../support/widget.js";import{onResize as l}from"../../support/widgetUtils.js";const p="esri-slider-with-dropdown",d={label:"esri-slider__label",box:`${p}__box`,boxDropDownOn:`${p}__box--drop-down-on`,boxDropDownOff:`${p}__box--drop-down-off`};let h=class extends i{constructor(e,o){super({...e,suppressDeprecationWarning:!0},o),this.viewModel=new s,this.showDropDown=!0,this._labelWidth=0,this._onLabelAfterCreate=e=>{const o="label-size-observer";this.removeHandles(o),this.addHandles(l(e,({contentRect:e})=>{this._labelWidth=e.width}),o)},this._getLabelStyles=()=>{if(!this.trackElement)return;const e=this._trackWidth,o=this._labelWidth/2,t=this.getCurrentPosition(),i=t-o,s=t+o;let r=-o;return i<0?r+=-i:s>e&&(r+=e-s),{left:`${r}px`}},this._onTimezoneChange=e=>{this.viewModel.utcOffset=e},this._onTimezonePickerOpen=()=>{this.viewModel.timezonePickerOpen=!0},this._onTimezonePickerClose=()=>{this.viewModel.timezonePickerOpen=!1}}renderThumbLabel(e){const{showDropDown:o,viewModel:t}=this;return n("div",{afterCreate:this._onLabelAfterCreate,class:this.classes({[d.box]:!0,[d.label]:!0,[d.boxDropDownOn]:o,[d.boxDropDownOff]:!o}),key:"thumb-label",styles:this._getLabelStyles()},super.renderThumbLabel(e),o?n(r,{disabled:this.disabled,open:t.timezonePickerOpen,value:t.utcOffset,onChange:this._onTimezoneChange,onClose:this._onTimezonePickerClose,onOpen:this._onTimezonePickerOpen}):null)}};e([o()],h.prototype,"viewModel",void 0),e([o()],h.prototype,"showDropDown",void 0),e([o()],h.prototype,"_labelWidth",void 0),h=e([t("esri.widgets.Daylight.support.SliderWithDropdown")],h);const a=h;export{a as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as o,subclass as t}from"../../../core/accessorSupport/decorators.js";import i from"../../Slider.js";import{SliderWithDropdownViewModel as s}from"./SliderWithDropdownViewModel.js";import{TimezonePicker as r}from"../../support/TimezonePicker.js";import{tsx as n}from"../../support/widget.js";import{onResize as l}from"../../support/widgetUtils.js";const p="esri-slider-with-dropdown",d={label:"esri-slider__label",box:`${p}__box`,boxDropDownOn:`${p}__box--drop-down-on`,boxDropDownOff:`${p}__box--drop-down-off`};let h=class extends i{constructor(e,o){super({...e,suppressDeprecationWarning:!0},o),this.viewModel=new s({suppressDeprecationWarning:!0}),this.showDropDown=!0,this._labelWidth=0,this._onLabelAfterCreate=e=>{const o="label-size-observer";this.removeHandles(o),this.addHandles(l(e,({contentRect:e})=>{this._labelWidth=e.width}),o)},this._getLabelStyles=()=>{if(!this.trackElement)return;const e=this._trackWidth,o=this._labelWidth/2,t=this.getCurrentPosition(),i=t-o,s=t+o;let r=-o;return i<0?r+=-i:s>e&&(r+=e-s),{left:`${r}px`}},this._onTimezoneChange=e=>{this.viewModel.utcOffset=e},this._onTimezonePickerOpen=()=>{this.viewModel.timezonePickerOpen=!0},this._onTimezonePickerClose=()=>{this.viewModel.timezonePickerOpen=!1}}renderThumbLabel(e){const{showDropDown:o,viewModel:t}=this;return n("div",{afterCreate:this._onLabelAfterCreate,class:this.classes({[d.box]:!0,[d.label]:!0,[d.boxDropDownOn]:o,[d.boxDropDownOff]:!o}),key:"thumb-label",styles:this._getLabelStyles()},super.renderThumbLabel(e),o?n(r,{disabled:this.disabled,open:t.timezonePickerOpen,value:t.utcOffset,onChange:this._onTimezoneChange,onClose:this._onTimezonePickerClose,onOpen:this._onTimezonePickerOpen}):null)}};e([o()],h.prototype,"viewModel",void 0),e([o()],h.prototype,"showDropDown",void 0),e([o()],h.prototype,"_labelWidth",void 0),h=e([t("esri.widgets.Daylight.support.SliderWithDropdown")],h);const a=h;export{a as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import e from"../../support/SketchTooltipControls.js";import o from"../../support/SnappingControls.js";import{tsx as i}from"../../support/widget.js";import
|
|
2
|
+
import{loadCalciteComponents as t}from"../../support/componentsUtils.js";import e from"../../support/PluginSettingsControls.js";import s from"../../support/SketchTooltipControls.js";import o from"../../support/SnappingControls.js";import{tsx as i}from"../../support/widget.js";import n from"../../support/SketchTooltipControls/VisibleElements.js";import r from"../../support/SnappingControls/VisibleElements.js";const p={settingsContainer:"esri-editor__settings"},a=()=>t({accordion:()=>import("@esri/calcite-components/dist/components/calcite-accordion"),"accordion-item":()=>import("@esri/calcite-components/dist/components/calcite-accordion-item")});function c({editorViewModel:t,messagesCommon:a,visibleElements:c}){const{snappingOptions:l,sketchOptions:g,view:m,snappingManager:d,sketchViewModel:u}=t,h=[],C={directionModePicker:c.directionModePicker,labelsToggle:c.labelsToggle,tooltipsToggle:c.tooltipsToggle};Object.values(C).includes(!0)&&h.push(i(s,{sketchOptions:g,view:m,visibleElements:new n(C)})),c.snappingControls&&h.push(i(o,{afterCreate:t=>t.layerListOpen=!1,snappingManager:d,snappingOptions:l,view:m,visibleElements:c.snappingControlsElements??new r}));const f=u?.settingsManager;return f?.hasSettings&&h.push(i(e,{settingsManager:f})),0===h.length?null:i("calcite-accordion",{appearance:"transparent",class:p.settingsContainer,key:"settings"},i("calcite-accordion-item",{"data-testid":"settings",heading:a.settings,iconStart:"gear"},h))}export{c as Settings,p as css,a as loadSettingsComponents};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{createTask as i}from"../../core/asyncUtils.js";import{handlesGroup as o}from"../../core/handleUtils.js";import{abortMaybe as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{createTask as i}from"../../core/asyncUtils.js";import{handlesGroup as o}from"../../core/handleUtils.js";import{abortMaybe as r}from"../../core/maybe.js";import{memoize as s}from"../../core/memoize.js";import{throwIfAborted as l,throwIfAbortError as a,ignoreAbortErrors as n}from"../../core/promiseUtils.js";import{watch as p,syncAndInitial as m}from"../../core/reactiveUtils.js";import{throttle as d}from"../../core/throttle.js";import{property as h,subclass as u}from"../../core/accessorSupport/decorators.js";import{hasGraphicFeatureExpressionInfo as f,getGraphicEffectiveElevationInfo as c}from"../../support/elevationInfoUtils.js";import{getConfig as _}from"./support/constants.js";import{isPolyline as P,isValidInputPath as v}from"./support/geometryUtils.js";import{generateProfiles as g}from"./support/profileUtils.js";const M=Symbol("line-change");let w=class extends t{constructor(e){super(e),this._updateTask=null,this._paramsPerProfile=new Map,this._getUpdateParametersMemoized=s((e,t,i)=>({stationary:e,visibleProfiles:t,generationParameters:i})),this._getGenerationParametersMemoized=s((e,t,i,o,r,s,l)=>P(t)&&v(t)&&null!=o?{view:e,geometry:t,elevationInfo:i,options:s,queue:o,cache:r,slicePlane:l}:null),this._getElevationInfoMemoized=s((e,t)=>({mode:e,offset:t})),this._getOptionsMemoized=s((e,t)=>{const{densificationMaxSamples:i,maxTotalSamples:o}=_();return{samplingDistance:e,densificationMaxSamples:Math.round(i/t),maxTotalSamples:o}}),this._updateThrottled=d(e=>this._update(e),_().updateThrottleMillis)}initialize(){const e=this.viewModel;this.addHandles([p(()=>({visible:e.visible,profiles:e.profiles.toArray()}),({visible:e,profiles:t})=>{this._abortUpdate(),this._paramsPerProfile.clear(),this.removeHandles(M),e&&0!==t.length&&this.addHandles([...t.map(e=>o([e.attach(this.viewModel),e.on("change",()=>{this._invalidateProfile(e)})])),p(()=>this._updateParameters,this._updateThrottled,m),this._updateThrottled],M)},m)])}destroy(){this._paramsPerProfile.clear()}get _updateParameters(){const{viewModel:e}=this,t=e.view;return this._getUpdateParametersMemoized(null==t||t.stationary,this.viewModel.visibleProfiles,this._generationParameters)}get _generationParameters(){const{view:e,input:t,queue:i,tileCache:o}=this.viewModel;return null!=e&&e.ready?this._getGenerationParametersMemoized(e,t?.geometry,this._elevationInfo,i,o,this._options,"3d"===e.type?e.slice.plane:null):null}get _elevationInfo(){const e=this.viewModel.input,t=e?f(e)?null:c(e):null;return null!=t?this._getElevationInfoMemoized(t.mode,t.offset):null}get _options(){const e=this.viewModel,t=e.visibleProfiles.length;let i=e.minDemResolution??_().defaultDemResolution;return i=parseFloat(i.toFixed(2)),this._getOptionsMemoized(i,t)}_update({stationary:e,visibleProfiles:t,generationParameters:o}){if(this._abortUpdate(),!e)return;if(null==o)return void this._clearResults();const r=this._updateTask=i(async e=>{this.viewModel.error=null;const i=t.filter(e=>!this._isProfileValid(e,o)),r=g({...o,providers:i},{signal:e});try{for await(const t of r){l(e),this._clearInvalidResults(o);for(let e=0;e<i.length;e++)i[e].result=t[e]}for(const e of i)this._paramsPerProfile.set(e,o)}catch(s){a(s),this._abortUpdate(),this.viewModel.error=s,i.forEach(e=>{e.result=null})}}),s=this.viewModel.view;s?.addUpdatingPromise(n(r.promise))}_abortUpdate(){this._updateTask=r(this._updateTask)}_isProfileValid(e,t){return this._paramsPerProfile.has(e)&&this._paramsPerProfile.get(e)===t}_invalidateProfile(e){this._paramsPerProfile.delete(e),this._updateThrottled(this._updateParameters)}_clearInvalidResults(e){for(const t of this.viewModel.profiles.items)this._isProfileValid(t,e)||(t.result=null,this._paramsPerProfile.delete(t))}_clearResults(){for(const e of this.viewModel.profiles.items)e.result=null,this._paramsPerProfile.delete(e)}};e([h({nonNullable:!0})],w.prototype,"viewModel",void 0),e([h()],w.prototype,"_updateParameters",null),e([h()],w.prototype,"_generationParameters",null),e([h()],w.prototype,"_elevationInfo",null),e([h()],w.prototype,"_options",null),w=e([u("esri.widgets.ElevationProfile.ElevationProfileController")],w);export{w as ElevationProfileController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../Graphic.js";import i from"../../core/Accessor.js";import{isSome as r,min as o}from"../../core/arrayUtils.js";import s from"../../core/Collection.js";import{referenceSetter as l}from"../../core/collectionUtils.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import a from"../../core/Logger.js";import{LRUCache as u}from"../../core/LRUCache.js";import{destroyMaybe as p}from"../../core/maybe.js";import{memoize as h}from"../../core/memoize.js";import{watch as c,syncAndInitial as d}from"../../core/reactiveUtils.js";import{adaptiveLengthUnit as f,adaptiveVerticalLengthUnit as m,measurementLengthUnits as v}from"../../core/units.js";import{property as g,subclass as y}from"../../core/accessorSupport/decorators.js";import{ElevationQueryTileCache as b}from"../../layers/support/ElevationQueryTileCache.js";import{defaultUnitPropertyMetadata as _}from"../../properties/defaultUnit.js";import{ElevationProfileController as U}from"./ElevationProfileController.js";import P from"./ElevationProfileLineGround.js";import{ElevationProfileLineCollection as w}from"./elevationProfileLineTypes.js";import{ElevationProfileTool as j}from"./ElevationProfileTool.js";import{isPolyline as O,isValidInputPath as C}from"./support/geometryUtils.js";import{isProfileGenerationError as E}from"./support/ProfileGenerationError.js";import{createProfileQueue as S}from"./support/profileUtils.js";import{getBoundsInMeters as T,mergeStatistics as D}from"./support/statisticsUtils.js";let L=class extends i{constructor(t){super(t),this.view=null,this.input=null,this._getEffectiveUnitsMemoized=h((t,e)=>({distance:t,elevation:e})),this.hoveredChartPosition=null,this.uniformChartScaling=!1,this.defaultUnit=null,this.queue=null,this._currentTileCache=null,this.error=null,this._defaultProfileLineGround=new P({isDefaultLine:!0}),this._userUnitOptions=null,this._userUnit=null,t?.suppressDeprecationWarning||n(a.getLogger(this),"Elevation Profile","arcgis-elevation-profile",{version:"5.0"}),t?.profiles||(this.profiles=new s([this._defaultProfileLineGround]))}normalizeCtorArgs(t){const{suppressDeprecationWarning:e,...i}=t??{};return i}initialize(){this.addHandles(c(()=>this.view,t=>{if(null==t)return void a.getLogger(this).warnOnce("no view. Widget will be disabled until a view is provided.");this.removeHandles(G);const e="3d"===t.type?t.resourceController:void 0;this.queue?.destroy(),this.queue=S(e?.scheduler);const i=e?.addUpdatingObject(this);i&&this.addHandles(i,G)},d)),this.tool=new j({viewModel:this}),this._controller=new U({viewModel:this})}destroy(){this._defaultProfileLineGround=p(this._defaultProfileLineGround),this._controller=p(this._controller),this._currentTileCache=p(this._currentTileCache),this.tool=p(this.tool),this.queue=p(this.queue)}get profiles(){return this._get("profiles")}set profiles(t){const e=this._get("profiles"),i=t??new s;this._set("profiles",l(i,e))}get state(){const t=this.view;return null!=t&&t.ready?this.tool.state:"disabled"}get progress(){let t=0,e=0;for(const i of this.visibleProfiles)t++,e+=i.progress;return t>0?e/t:0}set unitOptions(t){this._userUnitOptions=t,this._set("unitOptions",this._filteredOrAllUnits(this._userUnitOptions))}get unitOptions(){return this._filteredOrAllUnits(this._userUnitOptions)}set unit(t){this._userUnit=t?this._findSelectableUnit(t,this._userUnit):null,this.notifyChange("unit")}get unit(){return this._userUnit?(this._userUnit=this._findSelectableUnit(this._userUnit,this.defaultUnit),this._userUnit):this._findSelectableUnit(this.defaultUnit)}get effectiveUnits(){const t=T(this.visibleProfiles.map(t=>t.result)),e=f(t.maxDistance,"meters",this.unit),i=m(t.maxElevation,"meters",this.unit);return this._getEffectiveUnitsMemoized(e,i)}get highlightEnabled(){return this.tool.highlightEnabled}set highlightEnabled(t){this.tool.highlightEnabled=t}get hasVertices(){const t=this.input?.geometry;return O(t)&&t.paths.reduce((t,e)=>t+e.length,0)>0}get hoveredPoints(){return null!=this.input&&this.visible&&this.tool.editable?this.visibleProfiles.map(t=>{const e=t.hoveredPoint;return null!=e?{hoveredPoint:e,color:t.color}:null}).filter(r):[]}get statistics(){return D(this.visibleProfiles.map(t=>t.statistics))}get chartData(){if(null==this.input)return null;const{effectiveUnits:t,progress:e,statistics:i,visibleProfiles:r,uniformChartScaling:o}=this,s=r.filter(t=>t.hasZ).map(t=>({id:t.id,type:t.type,title:t.title,color:t.color,samples:t.samples,progress:t.progress,chartFillEnabled:t.chartFillEnabled,chartStrokeWidth:t.chartStrokeWidth,chartStrokeOffsetY:t.chartStrokeOffsetY,viewVisualizationEnabled:t.viewVisualizationEnabled}));return 0===s.length?null:{lines:s,effectiveUnits:t,statistics:i,refined:1===e,dynamicElevationRange:r.some(t=>"view"===t.type),uniformScaling:o}}get visibleProfiles(){return this.profiles.toArray().filter(t=>t.available&&t.visible)}get minDemResolutions(){const t=[];for(const{minDemResolution:e}of this.visibleProfiles)null!=e&&t.push(e);return t}get minDemResolution(){return o(this.minDemResolutions)}get errorState(){const t=this.input?.geometry;if(!C(t))return"no-valid-input";if(null!=this.error){if(E(this.error))switch(this.error.cause){case"too-complex":return"too-complex";case"invalid-geometry":return"invalid-geometry";case"invalid-elevation-info":return"invalid-elevation-info";case"elevation-query-error":return"no-valid-input"}return"unknown-error"}return 0===this.visibleProfiles.length?"no-visible-profiles":null==this.chartData&&1===this.progress?"refined-but-no-chart-data":"none"}get tileCache(){this._currentTileCache=p(this._currentTileCache);const t=this.view;if(null!=t&&"3d"===t?.type){const e=t.basemapTerrain?.elevationQueryCache;if(null!=e)return e}return null==this._currentTileCache&&(this._currentTileCache=new b(new u(20971520))),this._currentTileCache}get visible(){return this.tool.visible}set visible(t){this.tool.visible=t}get selectAvailable(){for(const t of this.view?.map?.allLayers??[]){if("graphics"===t.type&&!t.internal&&t.graphics.some(t=>"polyline"===t.geometry?.type))return!0;if("geometryType"in t&&"polyline"===t.geometryType)return!0}return!!this.view?.graphics?.some(t=>"polyline"===t.geometry?.type)}get inputIsSketched(){return this.tool.interaction.isSketchedGraphic(this.input)}get elevationProvider(){const t=this.view;return null!=t&&"3d"===t.type?t.elevationProvider:null}get updating(){const{progress:t}=this,e=!!this.queue?.updating;return t>0&&t<1||e||this.tool.interaction.updating}start(t){this.tool.interaction.start(t)}stop(){this.tool.interaction.stop()}cancel(){this.tool.interaction.cancel()}clear(){this.tool.interaction.clear()}_findSelectableUnit(t,e){const i=this.unitOptions;return null!=t&&i.includes(t)?t:e?this._findSelectableUnit(e):i[0]}_filteredOrAllUnits(t){const e=(null!=t?t:[]).filter(t=>v.includes(t));return 0===e.length?v.slice():e}};t([g()],L.prototype,"view",void 0),t([g({type:e})],L.prototype,"input",void 0),t([g({type:w,nonNullable:!0})],L.prototype,"profiles",null),t([g({readOnly:!0})],L.prototype,"state",null),t([g({readOnly:!0})],L.prototype,"progress",null),t([g()],L.prototype,"unitOptions",null),t([g()],L.prototype,"unit",null),t([g({readOnly:!0})],L.prototype,"effectiveUnits",null),t([g()],L.prototype,"hoveredChartPosition",void 0),t([g()],L.prototype,"uniformChartScaling",void 0),t([g()],L.prototype,"highlightEnabled",null),t([g({readOnly:!0})],L.prototype,"hoveredPoints",null),t([g({readOnly:!0})],L.prototype,"statistics",null),t([g()],L.prototype,"chartData",null),t([g()],L.prototype,"visibleProfiles",null),t([g()],L.prototype,"minDemResolutions",null),t([g({readOnly:!0})],L.prototype,"minDemResolution",null),t([g({readOnly:!0})],L.prototype,"errorState",null),t([g(_)],L.prototype,"defaultUnit",void 0),t([g()],L.prototype,"queue",void 0),t([g()],L.prototype,"tileCache",null),t([g()],L.prototype,"tool",void 0),t([g()],L.prototype,"visible",null),t([g()],L.prototype,"error",void 0),t([g()],L.prototype,"selectAvailable",null),t([g()],L.prototype,"inputIsSketched",null),t([g()],L.prototype,"elevationProvider",null),t([g()],L.prototype,"updating",null),t([g()],L.prototype,"_defaultProfileLineGround",void 0),t([g()],L.prototype,"_userUnitOptions",void 0),t([g()],L.prototype,"_controller",void 0),t([g()],L.prototype,"_userUnit",void 0),L=t([y("esri.widgets.ElevationProfile.ElevationProfileViewModel")],L);const G=Symbol("updating-object"),k=L;export{k as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../Graphic.js";import i from"../../core/Accessor.js";import{isSome as r,min as o}from"../../core/arrayUtils.js";import s from"../../core/Collection.js";import{referenceSetter as l}from"../../core/collectionUtils.js";import{deprecateUnnecessaryViewModel as n}from"../../core/deprecate.js";import a from"../../core/Logger.js";import{LRUCache as u}from"../../core/LRUCache.js";import{destroyMaybe as p}from"../../core/maybe.js";import{memoize as h}from"../../core/memoize.js";import{watch as c,syncAndInitial as d}from"../../core/reactiveUtils.js";import{adaptiveLengthUnit as f,adaptiveVerticalLengthUnit as m,measurementLengthUnits as v}from"../../core/units.js";import{property as g,subclass as y}from"../../core/accessorSupport/decorators.js";import{ElevationQueryTileCache as b}from"../../layers/support/ElevationQueryTileCache.js";import{defaultUnitPropertyMetadata as _}from"../../properties/defaultUnit.js";import{ElevationProfileController as U}from"./ElevationProfileController.js";import P from"./ElevationProfileLineGround.js";import{ElevationProfileLineCollection as w}from"./elevationProfileLineTypes.js";import{ElevationProfileTool as j}from"./ElevationProfileTool.js";import{isPolyline as O,isValidInputPath as C}from"./support/geometryUtils.js";import{isProfileGenerationError as E}from"./support/ProfileGenerationError.js";import{createProfileQueue as S}from"./support/profileUtils.js";import{getBoundsInMeters as T,mergeStatistics as D}from"./support/statisticsUtils.js";let L=class extends i{constructor(t){super(t),this.view=null,this.input=null,this._getEffectiveUnitsMemoized=h((t,e)=>({distance:t,elevation:e})),this.hoveredChartPosition=null,this.uniformChartScaling=!1,this.defaultUnit=null,this.queue=null,this._currentTileCache=null,this.error=null,this._defaultProfileLineGround=new P({isDefaultLine:!0}),this._userUnitOptions=null,this._userUnit=null,t?.suppressDeprecationWarning||n(a.getLogger(this),"Elevation Profile","arcgis-elevation-profile",{version:"5.0"}),t?.profiles||(this.profiles=new s([this._defaultProfileLineGround]))}normalizeCtorArgs(t){const{suppressDeprecationWarning:e,...i}=t??{};return i}initialize(){this.addHandles(c(()=>this.view,t=>{if(null==t)return void a.getLogger(this).warnOnce("no view. Widget will be disabled until a view is provided.");this.removeHandles(G);const e="3d"===t.type?t.resourceController:void 0;this.queue?.destroy(),this.queue=S(e?.scheduler);const i=e?.addUpdatingObject(this);i&&this.addHandles(i,G)},d)),this.tool=new j({viewModel:this}),this._controller=new U({viewModel:this})}destroy(){this._defaultProfileLineGround=p(this._defaultProfileLineGround),this._controller=p(this._controller),this._currentTileCache=p(this._currentTileCache),this.tool=p(this.tool),this.queue=p(this.queue)}get profiles(){return this._get("profiles")}set profiles(t){const e=this._get("profiles"),i=t??new s;this._set("profiles",l(i,e))}get state(){const t=this.view;return null!=t&&t.ready?this.tool.state:"disabled"}get progress(){let t=0,e=0;for(const i of this.visibleProfiles)t++,e+=i.progress;return t>0?e/t:0}set unitOptions(t){this._userUnitOptions=t,this._set("unitOptions",this._filteredOrAllUnits(this._userUnitOptions))}get unitOptions(){return this._filteredOrAllUnits(this._userUnitOptions)}set unit(t){this._userUnit=t?this._findSelectableUnit(t,this._userUnit):null,this.notifyChange("unit")}get unit(){return this._userUnit?(this._userUnit=this._findSelectableUnit(this._userUnit,this.defaultUnit),this._userUnit):this._findSelectableUnit(this.defaultUnit)}get effectiveUnits(){const t=T(this.visibleProfiles.map(t=>t.result)),e=f(t.maxDistance,"meters",this.unit),i=m(t.maxElevation,"meters",this.unit);return this._getEffectiveUnitsMemoized(e,i)}get highlightEnabled(){return this.tool.highlightEnabled}set highlightEnabled(t){this.tool.highlightEnabled=t}get hasVertices(){const t=this.input?.geometry;return O(t)&&t.paths.reduce((t,e)=>t+e.length,0)>0}get hoveredPoints(){return null!=this.input&&this.visible&&this.tool.editable?this.visibleProfiles.map(t=>{const e=t.hoveredPoint;return null!=e?{hoveredPoint:e,color:t.color}:null}).filter(r):[]}get statistics(){return D(this.visibleProfiles.map(t=>t.statistics))}get chartData(){if(null==this.input)return null;const{effectiveUnits:t,progress:e,statistics:i,visibleProfiles:r,uniformChartScaling:o}=this,s=r.filter(t=>t.hasZ).map(t=>({id:t.id,type:t.type,title:t.title,color:t.color,samples:t.samples,progress:t.progress,chartFillEnabled:t.chartFillEnabled,chartStrokeWidth:t.chartStrokeWidth,chartStrokeOffsetY:t.chartStrokeOffsetY,viewVisualizationEnabled:t.viewVisualizationEnabled}));return 0===s.length?null:{lines:s,effectiveUnits:t,statistics:i,refined:1===e,dynamicElevationRange:r.some(t=>"view"===t.type),uniformScaling:o}}get visibleProfiles(){return this.profiles.toArray().filter(t=>t.available&&t.visible)}get minDemResolutions(){const t=[];for(const{minDemResolution:e}of this.visibleProfiles)null!=e&&t.push(e);return t}get minDemResolution(){return o(this.minDemResolutions)}get errorState(){const t=this.input?.geometry;if(!C(t))return"no-valid-input";if(null!=this.error){if(E(this.error))switch(this.error.cause){case"too-complex":return"too-complex";case"invalid-geometry":return"invalid-geometry";case"invalid-elevation-info":return"invalid-elevation-info";case"elevation-query-error":return"no-valid-input"}return"unknown-error"}return 0===this.visibleProfiles.length?"no-visible-profiles":null==this.chartData&&1===this.progress?"refined-but-no-chart-data":"none"}get tileCache(){this._currentTileCache=p(this._currentTileCache);const t=this.view;if(null!=t&&"3d"===t?.type){const e=t.basemapTerrain?.elevationQueryCache;if(null!=e)return e}return null==this._currentTileCache&&(this._currentTileCache=new b(new u(20971520))),this._currentTileCache}get visible(){return this.tool.visible}set visible(t){this.tool.visible=t}get selectAvailable(){for(const t of this.view?.map?.allLayers??[]){if("graphics"===t.type&&!t.internal&&t.graphics.some(t=>"polyline"===t.geometry?.type))return!0;if("geometryType"in t&&"polyline"===t.geometryType)return!0}return!!this.view?.graphics?.some(t=>"polyline"===t.geometry?.type)}get inputIsSketched(){return this.tool.interaction.isSketchedGraphic(this.input)}get elevationProvider(){const t=this.view;return null!=t&&"3d"===t.type?t.elevationProvider:null}get updating(){const{progress:t}=this,e=!!this.queue?.updating;return t>0&&t<1||e||this.tool.interaction.updating||this.tool.view.updating}start(t){this.tool.interaction.start(t)}stop(){this.tool.interaction.stop()}cancel(){this.tool.interaction.cancel()}clear(){this.tool.interaction.clear()}_findSelectableUnit(t,e){const i=this.unitOptions;return null!=t&&i.includes(t)?t:e?this._findSelectableUnit(e):i[0]}_filteredOrAllUnits(t){const e=(null!=t?t:[]).filter(t=>v.includes(t));return 0===e.length?v.slice():e}};t([g()],L.prototype,"view",void 0),t([g({type:e})],L.prototype,"input",void 0),t([g({type:w,nonNullable:!0})],L.prototype,"profiles",null),t([g({readOnly:!0})],L.prototype,"state",null),t([g({readOnly:!0})],L.prototype,"progress",null),t([g()],L.prototype,"unitOptions",null),t([g()],L.prototype,"unit",null),t([g({readOnly:!0})],L.prototype,"effectiveUnits",null),t([g()],L.prototype,"hoveredChartPosition",void 0),t([g()],L.prototype,"uniformChartScaling",void 0),t([g()],L.prototype,"highlightEnabled",null),t([g({readOnly:!0})],L.prototype,"hoveredPoints",null),t([g({readOnly:!0})],L.prototype,"statistics",null),t([g()],L.prototype,"chartData",null),t([g()],L.prototype,"visibleProfiles",null),t([g()],L.prototype,"minDemResolutions",null),t([g({readOnly:!0})],L.prototype,"minDemResolution",null),t([g({readOnly:!0})],L.prototype,"errorState",null),t([g(_)],L.prototype,"defaultUnit",void 0),t([g()],L.prototype,"queue",void 0),t([g()],L.prototype,"tileCache",null),t([g()],L.prototype,"tool",void 0),t([g()],L.prototype,"visible",null),t([g()],L.prototype,"error",void 0),t([g()],L.prototype,"selectAvailable",null),t([g()],L.prototype,"inputIsSketched",null),t([g()],L.prototype,"elevationProvider",null),t([g()],L.prototype,"updating",null),t([g()],L.prototype,"_defaultProfileLineGround",void 0),t([g()],L.prototype,"_userUnitOptions",void 0),t([g()],L.prototype,"_controller",void 0),t([g()],L.prototype,"_userUnit",void 0),L=t([y("esri.widgets.ElevationProfile.ElevationProfileViewModel")],L);const G=Symbol("updating-object"),k=L;export{k as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as i}from"tslib";import
|
|
2
|
+
import{__decorate as i}from"tslib";import t from"../../../core/Accessor.js";import{createTask as o}from"../../../core/asyncUtils.js";import{abortMaybe as e,destroyMaybe as s}from"../../../core/maybe.js";import{whenOrAbort as l}from"../../../core/promiseUtils.js";import{watch as r,syncAndInitial as a}from"../../../core/reactiveUtils.js";import{property as n,subclass as p}from"../../../core/accessorSupport/decorators.js";let m=class extends t{constructor(i){super(i),this._implementation=null,this._loadingTask=null}initialize(){this.addHandles(r(()=>({tool:this.tool,view:this.tool.viewModel.view,visible:this.tool.visible&&!!this.tool.viewModel.view?.ready}),({tool:i,view:t,visible:o})=>{null!=t&&o?this._show(t,i):this._hide()},a))}destroy(){this._hide()}get updating(){return!(this._loadingTask?.finished??1)||(this._implementation?.updating??!1)}_show(i,t){this._loadingTask=e(this._loadingTask),this._loadingTask=o(async o=>{if("2d"===i.type){const e=import("./ElevationProfileView2D.js"),s=(await l(e,o)).ElevationProfileView2D;this._implementation=new s(i,t)}else if("3d"===i.type){const e=import("./ElevationProfileView3D.js"),s=(await l(e,o)).ElevationProfileView3D;this._implementation=new s(i,t)}})}_hide(){this._loadingTask=e(this._loadingTask),this._implementation=s(this._implementation)}};i([n()],m.prototype,"tool",void 0),i([n()],m.prototype,"updating",null),i([n()],m.prototype,"_implementation",void 0),i([n()],m.prototype,"_loadingTask",void 0),m=i([p("esri.widgets.ElevationProfile.support.ElevationProfileView")],m);export{m as ElevationProfileView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/Handles.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{HoveredPoints as
|
|
2
|
+
import e from"../../../core/Handles.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{HoveredPoints as o}from"./HoveredPoints.js";import{InputRepresentation2D as s}from"./InputRepresentation2D.js";import{ProfileLine2D as r}from"./ProfileLine2D.js";class p{constructor(t,p){this._handles=new e,this._inputRepresentation=new s({view:t}),this._hoveredPoints=new o({view:t}),this._profileLine=new r({view:t}),this._handles.add([i(()=>p.viewModel.hoveredPoints,e=>this._hoveredPoints.update(e),n),i(()=>{const{state:e,highlightEnabled:t,viewModel:i}=p;return{input:i.input,state:e,highlightEnabled:t}},e=>this._updateInputRepresentation(e),n),i(()=>p.viewModel.chartData,e=>this._profileLine.update(e),n),i(()=>p.viewModel.input?.geometry,()=>{this._profileLine.remove()},n)])}get updating(){return this._inputRepresentation.updating||this._profileLine.updating}destroy(){t(this._handles),t(this._inputRepresentation),t(this._hoveredPoints),t(this._profileLine)}_updateInputRepresentation({input:e,state:t,highlightEnabled:i}){"selected"===t&&i?this._inputRepresentation.update(e):this._inputRepresentation.remove()}}export{p as ElevationProfileView2D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import e from"../../../core/Handles.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{HoveredPoints as
|
|
2
|
+
import e from"../../../core/Handles.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{HoveredPoints as n}from"./HoveredPoints.js";import{InputRepresentation3D as o}from"./InputRepresentation3D.js";import{ProfileLines3D as r}from"./ProfileLines3D.js";class h{constructor(t,h){this._handles=new e,this._inputRepresentation=new o({view:t}),this._hoveredPoints=new n({view:t}),this._profileLines=new r({view:t}),this._handles.add([i(()=>h.viewModel.hoveredPoints,e=>this._hoveredPoints.update(e),s),i(()=>h.viewModel.input?.geometry,()=>{this._profileLines.remove()},s),i(()=>{const{state:e,editable:t,highlightEnabled:i,viewModel:s}=h,n=s.input;return n&&(n.commitProperty("geometry"),n.commitProperty("layer")),{input:n,state:e,editable:t,highlightEnabled:i}},e=>this._updateInputRepresentation(e),s),i(()=>h.viewModel.chartData,e=>this._profileLines.update(e),s)])}get updating(){return this._inputRepresentation.updating||this._profileLines.updating}destroy(){this._handles=t(this._handles),this._inputRepresentation=t(this._inputRepresentation),this._hoveredPoints=t(this._hoveredPoints),this._profileLines=t(this._profileLines)}_updateInputRepresentation({input:e,state:t,editable:i,highlightEnabled:s}){const n=this._inputRepresentation;if(!s)return n.remove();"selected"===t?n.showHighlight(e):"created"!==t||i?n.remove():n.showReshaping(e)}}export{h as ElevationProfileView3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{createTask as i}from"../../../core/asyncUtils.js";import{abortMaybe as t,removeMaybe as h}from"../../../core/maybe.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{highlightsSupported as e}from"../../../views/support/layerViewUtils.js";class
|
|
2
|
+
import{createTask as i}from"../../../core/asyncUtils.js";import{abortMaybe as t,removeMaybe as h}from"../../../core/maybe.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{highlightsSupported as e}from"../../../views/support/layerViewUtils.js";class r{get updating(){return!(this._highlightTask?.finished??1)}constructor(i){this._params=i,this._highlightTask=null,this._highlightHandle=null}destroy(){this.remove()}remove(){this._highlightTask=t(this._highlightTask),this._highlightHandle=h(this._highlightHandle)}update(t){if(this.remove(),null==t||!l(t))return;const h=t.layer;this._highlightTask=i(async i=>{const r=await this._params.view.whenLayerView(h);s(i);const l=e(r)?r:null;l&&(this._highlightHandle=l.highlight(t))})}}function l(i){return null!=i.geometry&&"polyline"===i.geometry.type}export{r as InputRepresentation2D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{createTask as e}from"../../../core/asyncUtils.js";import{destroyHandle as i,handlesGroup as t}from"../../../core/handleUtils.js";import{abortMaybe as s,removeMaybe as l}from"../../../core/maybe.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{watch as h}from"../../../core/reactiveUtils.js";import{getGraphicEffectiveElevationInfo as a}from"../../../support/elevationInfoUtils.js";import{Settings as
|
|
2
|
+
import{createTask as e}from"../../../core/asyncUtils.js";import{destroyHandle as i,handlesGroup as t}from"../../../core/handleUtils.js";import{abortMaybe as s,removeMaybe as l}from"../../../core/maybe.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{watch as h}from"../../../core/reactiveUtils.js";import{getGraphicEffectiveElevationInfo as a}from"../../../support/elevationInfoUtils.js";import{Settings as n}from"../../../views/3d/interactive/editingTools/settings.js";import{OutlineVisualElement as o}from"../../../views/3d/interactive/visualElements/OutlineVisualElement.js";import{GraphicState as m}from"../../../views/3d/layers/graphics/GraphicState.js";import{highlightsSupported as g}from"../../../views/support/layerViewUtils.js";class c{get updating(){return!(this._highlightTask?.finished??1)}constructor(e){this._params=e,this._highlightTask=null,this._highlightHandle=null,this._visualElementHandle=null,this._settings=new n({getTheme:()=>this._params.view.effectiveTheme})}destroy(){this.remove()}remove(){this._highlightTask=s(this._highlightTask),this._highlightHandle=l(this._highlightHandle),this._visualElementHandle=l(this._visualElementHandle)}showHighlight(i){if(this.remove(),null==i||!p(i))return;const t=i.layer;this._highlightTask=e(async e=>{const s=await this._params.view.whenLayerView(t);r(e),g(s)&&(this._highlightHandle=s.highlight(i))})}showReshaping(e){if(this.remove(),null==e)return;const s=this._params.view,l=new o({view:s,geometry:p(e)?e.geometry:null,attached:!1,elevationInfo:a(e),renderOccluded:8,isDecoration:!0}),r=new m({graphic:e}),n=[h(()=>r.isDraped,e=>{l.isDraped=e}),r.on("changed",()=>{l.geometry=p(e)?e.geometry:null}),s.trackGraphicState(r),s.maskOccludee(e),i(l)];this._settings.visualElements.lineObjects.outline.apply(l),l.attached=!0,this._visualElementHandle=t(n)}}function p(e){return null!=e.geometry&&"polyline"===e.geometry.type}export{c as InputRepresentation3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{getContrast as i}from"../../../core/colorUtils.js";import{watch as o,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{throttle as a}from"../../../core/throttle.js";import{property as l,subclass as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import r from"../../../core/Accessor.js";import{getContrast as i}from"../../../core/colorUtils.js";import{watch as o,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{throttle as a}from"../../../core/throttle.js";import{property as l,subclass as n}from"../../../core/accessorSupport/decorators.js";import p from"../../../layers/GraphicsLayer.js";import h from"../../../symbols/CIMSymbol.js";import{getConfig as c}from"./constants.js";import{createLineGeometry as d}from"./visualizationUtils.js";let m=class extends r{constructor(t){super(t),this._chartData=null,this._graphic=new e,this._layer=new p({listMode:"hide",internal:!0,title:"Profile line"}),this._throttledUpdate=null,this._update=t=>{const{chartData:e}=t;if(null==e)return this.remove();if(!e.refined)return;const r=e.lines.find(t=>t.viewVisualizationEnabled);if(!r)return;this._graphic.geometry=d(r,t.spatialReference),this._graphic.symbol=new h({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,10],lineDashEnding:"HalfPattern",controlPointEnding:"HalfPattern"}],capStyle:"Butt",width:1.5,color:r.color.toArray()},{type:"CIMSolidStroke",capStyle:"Butt",width:2,color:i(r.color).toArray()}]}}});const o=this.view?.map?.layers;o&&!o.includes(this._layer)&&o.add(this._layer)}}initialize(){this._layer.add(this._graphic);const t=c().profileLinesUpdateThrottleMillis;let e=this._update;if(t>0){const r=a(this._update,t);this.addHandles(r),this._throttledUpdate=r,e=r}this.addHandles(o(()=>({spatialReference:this.view.spatialReference,chartData:this._chartData}),e,s))}destroy(){this.remove()}get updating(){return!0===this._throttledUpdate?.hasPendingUpdates()}remove(){this.view?.map?.remove(this._layer)}update(t){this._chartData=t}};t([l()],m.prototype,"view",void 0),t([l()],m.prototype,"_chartData",void 0),t([l()],m.prototype,"updating",null),m=t([n("esri.widgets.ElevationProfile.support.ProfileLine2D")],m);export{m as ProfileLine2D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{throttle as o}from"../../../core/throttle.js";import{property as r,subclass as l}from"../../../core/accessorSupport/decorators.js";import{fromArray as a}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{OutlineVisualElement as n}from"../../../views/3d/interactive/visualElements/OutlineVisualElement.js";import{getConfig as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{watch as i,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{throttle as o}from"../../../core/throttle.js";import{property as r,subclass as l}from"../../../core/accessorSupport/decorators.js";import{fromArray as a}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{OutlineVisualElement as n}from"../../../views/3d/interactive/visualElements/OutlineVisualElement.js";import{getConfig as d}from"./constants.js";import{createLineGeometry as h}from"./visualizationUtils.js";let c=class extends e{constructor(t){super(t),this._chartData=null,this._visualElements=[],this._throttledUpdate=null,this._update=t=>{const{chartData:e}=t;if(null==e)return this.remove();if(!e.refined)return;const i=this._visualElements,s=e.lines.filter(t=>t.viewVisualizationEnabled),o=s.length;for(;i.length>o;)i.pop().destroy();const r=d().profileLinesStyle3D;for(;i.length<o;){const t=new n({view:this.view,elevationInfo:{mode:"absolute-height",offset:0},innerWidth:r.innerWidth,innerColor:r.innerColor,width:r.width,falloff:r.falloff,renderOccluded:r.renderOccluded,isDecoration:!0});i.push(t)}const l=t.spatialReference;for(let n=0;n<o;++n){const t=i[n],e=s[o-1-n];t.geometry=h(e,l),t.color=a(e.color.toUnitRGBA())}}}initialize(){const t=d().profileLinesUpdateThrottleMillis;let e=this._update;if(t>0){const i=o(this._update,t);this.addHandles(i),this._throttledUpdate=i,e=i}this.addHandles([i(()=>({spatialReference:this.view.spatialReference,chartData:this._chartData}),e,s)])}destroy(){this._destroyVisualElements()}get updating(){return!0===this._throttledUpdate?.hasPendingUpdates()}remove(){this._destroyVisualElements()}update(t){this._chartData=t}_destroyVisualElements(){this._visualElements.forEach(t=>t.destroy()),this._visualElements.length=0}};t([r()],c.prototype,"view",void 0),t([r()],c.prototype,"_chartData",void 0),t([r()],c.prototype,"updating",null),c=t([l("esri.widgets.ElevationProfile.support.ProfileLines3D")],c);export{c as ProfileLines3D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{watch as i,sync as l}from"../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as s}from"../../editing/fieldUtils.js";import{getDomainRange as u,dateTimeFieldValuesToNumericRange as a,validateDomainValue as o}from"../../layers/support/domainUtils.js";import{isFieldVisibleByDefault as p,getLowerCaseEditTrackingFields as d,isNumericField as m,isStringField as h,isTimeOnlyField as f,getFieldRange as y}from"../../layers/support/fieldUtils.js";import{isRelatableFeatureSupportedLayer as c}from"../../popup/support/featureUtils.js";import{isAnyDateField as g}from"../../smartMapping/support/utils.js";import{isNumber as x}from"../../support/guards.js";import v from"./EditableInput.js";import{isFieldElementWithInputType as E,valueIsInvalidSwitchValue as b,isFieldElementWithShowNoValueOptionInput as _}from"./featureFormUtils.js";import{timeResolutionToStepMap as V,isArcadeDate as T,arcadeDateToFieldValue as w}from"../support/dateUtils.js";import{dateIsValid as F,getMaxLength as D,getMinLength as L,validateFormValue as M}from"../support/forms/formUtils.js";let O=class extends v{constructor(e){super(e),this._storedValue=null,this.error=null,this.preservesValueWhenHidden=!0,this.field=null,this.group=null,this.requiredExpressionExecutor=null,this.type="field",this._fieldInputWasVisibleDuringLifetime=!1,this.valueExpressionExecutor=null}initialize(){this.addHandles(i(()=>this.feature,()=>this._fieldInputWasVisibleDuringLifetime=!1,l))}get _dateFormRange(){const{element:e,field:t}=this;if("date"!==this.dataType)return{};const i=e?.domain?u(t,e.domain):null;if(!e?.input)return i??{};const l=e.input,{type:n}=l;let r={};if("date-picker"!==n&&"time-picker"!==n&&"timestampoffset-picker"!==n||(r=a(t,l.max,l.min)),"datetime-picker"===n){const{max:e,min:t}=l;r={max:null!=e&&F(e)?e.getTime():null,min:null!=t&&F(t)?t.getTime():null}}const{max:s,min:o}=r;if(i){const{max:e,min:t}=i,l=x(e)&&(null==s||null!=s&&e<s),n=x(t)&&(null==o||null!=o&&t>o);return{max:l?e:s??null,min:n?t:o??null,rawMax:l?i.rawMax:r?.rawMax??null,rawMin:n?i.rawMin:r?.rawMin??null}}return{min:o,max:s,rawMax:r?.rawMax??null,rawMin:r?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,field:t}=this;if("date"!==this.dataType)return{};const i=u(t);if(!i)return e;const{max:l,min:n,rawMax:r,rawMin:s}=e;if("date"===t.type){const{max:e,min:t}=i;return{max:x(l)&&(null===e||null!=e&&l<e)?l:e??null,min:x(n)&&(null===t||null!=t&&n>t)?n:t??null}}if("date-only"===t.type||"time-only"===t.type||"timestamp-offset"===t.type){const{max:e,min:t,rawMax:u,rawMin:a}=i,o=x(l)&&r&&(null==e||l<e),p=x(n)&&s&&(null==t||n>t);return{max:o?l:e,min:p?n:t,rawMax:o?r:u,rawMin:p?s:a}}return{max:null,min:null}}get _configAllowsEdits(){const{element:e,layer:t,name:i}=this;if(null!=e)return e.editableExpression?!!this.evaluatedEditableExpression:!1!==e.editable;if(t?.userHasUpdateItemPrivileges)return!0;const l=t&&"popupTemplate"in t?t?.popupTemplate?.fieldInfos?.find(({fieldName:e})=>e===i):null;return l?.isEditable??!0}get _layerAndFieldAllowEdits(){return this.layerAllowsEdits&&this.field?.editable}get _isVisibleByDefault(){const{field:e,layer:t}=this;return!!e?.visible&&p(e,t)}get _isEditTrackingField(){return d(this.layer).includes(this.name?.toLowerCase())}get _shouldUseValueExpression(){return this._layerAndFieldAllowEdits&&!this._configAllowsEdits&&null!=this.valueExpressionExecutor&&this.valueExpressionExecutor.initialExecutionComplete}get isSubtypeField(){const{layer:e}=this;if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.name}return!1}get valueIsOutOfDomain(){const{domain:e,value:t,field:i}=this;return!(!e||null==t)&&null!==o(i,t,e)}get alias(){return s(this.field,this.layer)}get dataType(){const{field:e}=this;return m(e)?"number":h(e)?"text":g(e)||f(e)?"date":"unsupported"}get dateDataType(){if("date"===this.dataType)return"date"!==this.field.type?"string":"number"}get domain(){const{layer:e,feature:t,name:i,element:l}=this,n=l?.domain;return null!=n&&this._isDomainCompatible(n)?n:e.getFieldDomain(i,{feature:t})}get editable(){return!!this._layerAndFieldAllowEdits&&(this.evaluatedEditableExpression??this._configAllowsEdits)}get evaluatedRequiredExpression(){const{requiredExpressionExecutor:e}=this;return null!=e?!!e.lastEvaluatedValue:null}get evaluatedValueExpression(){const{valueExpressionExecutor:e}=this;return null!=e?e.lastEvaluatedValue:null}get hint(){return this.element?.hint}get includeDate(){return!("date"!==this.dataType||"time-only"===this.field.type)}get includeTime(){const{element:e,field:t}=this;if("date"!==this.dataType)return!1;if("time-only"===t.type)return!0;if("date-only"===t.type)return!1;const i="datetime-picker"===e?.input?.type?e.input.includeTime:void 0;return void 0===i||i}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.element?.input;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get inputType(){return this.element?.input?.type}get hasInvalidSwitchValue(){const{element:e}=this,t=E(e,"switch")?e.input:null;return!t||b(this.value,t)}get isRelationshipKeyField(){const{field:e,layer:t}=this;return c(t)&&!!t.relationships?.some(t=>t.keyField===e.name)}get label(){return this.getFormattedLabel(this.element?.label)||this.alias||this.field.name}get maxLength(){return D({dataType:this.dataType,field:this.field,input:this.element?.input})}get minLength(){return L({dataType:this.dataType,field:this.field,input:this.element?.input})}get name(){return this.field?.name}get range(){const{domain:e,element:t,field:i}=this;if("date"===this.dataType)return this._dateRange;const l=u(i,e)||y(i,e),n=l?.max===Number.MAX_VALUE?null:l?.max??null,r=l?.min===-Number.MAX_VALUE?null:l?.min??null;if(!t?.domain||"range"!==t.domain.type)return{max:n,min:r};const{max:s,min:a}=u(i)||{};return{max:null!=s&&(null===n||null!=n&&s<n)?s:n,min:null!=a&&(null===r||null!=r&&a>r)?a:r}}get required(){const{editable:e,evaluatedRequiredExpression:t,field:i,visible:l,isSubtypeField:n}=this;if(!e)return!1;if(!1===i?.nullable)return!0;if(n)return!0;return!(!l||!1===this.group?.visible||null==t)&&t}set required(e){this._overrideIfSome("required",e)}get showNoValueOptionEnabled(){const{element:e}=this;return!this.required&&(!_(e)||e.input.showNoValueOption)}get showNoValueLabel(){const{element:e}=this;return _(e)?e.input.noValueOptionLabel:null}get submittable(){const{field:e,required:t,valid:i,value:l}=this;return(!t||null!=l)&&(!!i||this.initialFeature.getAttribute(e.name)===l)}get timeResolution(){const e=this.element?.input;if(e&&("timestampoffset-picker"===e.type||"time-picker"===e.type))return e.timeResolution??"minutes"}get timeStep(){return null!=this.timeResolution?V.get(this.timeResolution):void 0}get updating(){const{editableExpressionExecutor:e,valueExpressionExecutor:t,visibilityExpressionExecutor:i,preservesValueWhenHidden:l}=this;return null!=t&&t.updating||null!=e&&e.updating||!1===l&&null!=i&&i.updating}get valid(){const e=this.editable?this._validate():null;return this._set("error",e),null===e}get value(){if(this._fieldInputWasVisibleDuringLifetime=this._fieldInputWasVisibleDuringLifetime||this.visible&&!1!==this.group?.visible,!1===this.preservesValueWhenHidden&&this._fieldInputWasVisibleDuringLifetime&&(!1===this.visibilityExpressionExecutor?.lastEvaluatedValue||!1===this.group?.visibilityExpressionExecutor?.lastEvaluatedValue))return null!==this._storedValue&&this.set("_storedValue",null),null;if(this._shouldUseValueExpression){const e=this.evaluatedValueExpression;return"date"===this.dataType?this._arcadeOutputToDateFieldValue(e):null!=e&&"object"==typeof e?`${e}`:e}return this._storedValue}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e),this.notifyChange("value"),this.notifyChange("valid")}get visible(){return!this._isEditTrackingField&&(null!=this.evaluatedVisibilityExpression?this.evaluatedVisibilityExpression:null!=this.element&&!1!==this.field?.visible||this._isVisibleByDefault)}_arcadeOutputToDateFieldValue(e){const i=this.field.type;try{if("object"==typeof e){if(null===e)return null;if(T(e))return w(e,i);if("getTime"in e&&"function"==typeof e.getTime&&"date"===i)return parseInt(e.getTime(),10);if("date-only"===i||"time-only"===i||"timestamp-offset"===i)return e.toString()}else{if("string"==typeof e)return"date"===i?parseInt(e,10):e;if("number"==typeof e&&"date"===i)return e}throw new t("feature-form:invalid-date-value","Date value is invalid")}catch{return"date"===i?NaN:""}}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===e?.type){const i=typeof e.codedValues[0].code;if("string"===i&&h(t)||"number"===i&&m(t))return!0}return!!("range"===e?.type&&m(t)||g(t)||f(t))}_validate(){const{dataType:e,domain:t,field:i,minLength:l,range:n,required:r,value:s,maxLength:u}=this;return M(s,{dataType:e,domain:t,field:i,maxLength:u,minLength:l,range:n,required:r})}};e([n()],O.prototype,"_dateFormRange",null),e([n()],O.prototype,"_dateRange",null),e([n()],O.prototype,"_storedValue",void 0),e([n()],O.prototype,"_configAllowsEdits",null),e([n()],O.prototype,"_layerAndFieldAllowEdits",null),e([n()],O.prototype,"_isVisibleByDefault",null),e([n()],O.prototype,"_isEditTrackingField",null),e([n()],O.prototype,"_shouldUseValueExpression",null),e([n()],O.prototype,"isSubtypeField",null),e([n()],O.prototype,"valueIsOutOfDomain",null),e([n()],O.prototype,"alias",null),e([n()],O.prototype,"dataType",null),e([n()],O.prototype,"dateDataType",null),e([n()],O.prototype,"domain",null),e([n()],O.prototype,"editable",null),e([n({readOnly:!0})],O.prototype,"error",void 0),e([n({constructOnly:!0})],O.prototype,"preservesValueWhenHidden",void 0),e([n()],O.prototype,"evaluatedRequiredExpression",null),e([n()],O.prototype,"evaluatedValueExpression",null),e([n()],O.prototype,"field",void 0),e([n()],O.prototype,"group",void 0),e([n({readOnly:!0})],O.prototype,"hint",null),e([n()],O.prototype,"includeDate",null),e([n()],O.prototype,"includeTime",null),e([n()],O.prototype,"includeTimeOffset",null),e([n()],O.prototype,"initialFeature",null),e([n({readOnly:!0})],O.prototype,"inputType",null),e([n()],O.prototype,"hasInvalidSwitchValue",null),e([n()],O.prototype,"isRelationshipKeyField",null),e([n()],O.prototype,"label",null),e([n()],O.prototype,"maxLength",null),e([n()],O.prototype,"minLength",null),e([n({readOnly:!0})],O.prototype,"name",null),e([n()],O.prototype,"range",null),e([n()],O.prototype,"required",null),e([n()],O.prototype,"requiredExpressionExecutor",void 0),e([n()],O.prototype,"showNoValueOptionEnabled",null),e([n()],O.prototype,"submittable",null),e([n()],O.prototype,"timeResolution",null),e([n()],O.prototype,"timeStep",null),e([n({readOnly:!0})],O.prototype,"type",void 0),e([n()],O.prototype,"updating",null),e([n()],O.prototype,"valid",null),e([n({value:null})],O.prototype,"value",null),e([n()],O.prototype,"valueExpressionExecutor",void 0),e([n()],O.prototype,"visible",null),O=e([r("esri.widgets.FeatureForm.FieldInput")],O);const A=O;export{A as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Error.js";import{watch as i,sync as l}from"../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import{getEffectiveFieldAlias as s}from"../../editing/fieldUtils.js";import{getDomainRange as u,dateTimeFieldValuesToNumericRange as a,validateDomainValue as o}from"../../layers/support/domainUtils.js";import{isFieldVisibleByDefault as p,getLowerCaseEditTrackingFields as d,isNumericField as m,isStringField as h,isTimeOnlyField as f,getFieldRange as y}from"../../layers/support/fieldUtils.js";import{isRelatableFeatureSupportedLayer as c}from"../../popup/support/featureUtils.js";import{isAnyDateField as g}from"../../smartMapping/support/utils.js";import{isNumber as v}from"../../support/guards.js";import x from"./EditableInput.js";import{isFieldElementWithInputType as E,valueIsInvalidSwitchValue as b,isFieldElementWithShowNoValueOptionInput as _}from"./featureFormUtils.js";import{timeResolutionToStepMap as V,isArcadeDate as T,arcadeDateToFieldValue as w}from"../support/dateUtils.js";import{dateIsValid as F,getMaxLength as D,getMinLength as L,validateFormValue as M}from"../support/forms/formUtils.js";let O=class extends x{constructor(e){super(e),this._storedValue=null,this.error=null,this.preservesValueWhenHidden=!0,this.field=null,this.group=null,this.requiredExpressionExecutor=null,this.type="field",this._fieldInputWasVisibleDuringLifetime=!1,this.valueExpressionExecutor=null}initialize(){this.addHandles(i(()=>this.feature,()=>this._fieldInputWasVisibleDuringLifetime=!1,l))}get _dateFormRange(){const{element:e,field:t}=this;if("date"!==this.dataType)return{};const i=e?.domain?u(t,e.domain):null;if(!e?.input)return i??{};const l=e.input,{type:n}=l;let r={};if("date-picker"!==n&&"time-picker"!==n&&"timestampoffset-picker"!==n||(r=a(t,l.max,l.min)),"datetime-picker"===n){const{max:e,min:t}=l;r={max:null!=e&&F(e)?e.getTime():null,min:null!=t&&F(t)?t.getTime():null}}const{max:s,min:o}=r;if(i){const{max:e,min:t}=i,l=v(e)&&(null==s||null!=s&&e<s),n=v(t)&&(null==o||null!=o&&t>o);return{max:l?e:s??null,min:n?t:o??null,rawMax:l?i.rawMax:r?.rawMax??null,rawMin:n?i.rawMin:r?.rawMin??null}}return{min:o,max:s,rawMax:r?.rawMax??null,rawMin:r?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,field:t}=this;if("date"!==this.dataType)return{};const i=u(t);if(!i)return e;const{max:l,min:n,rawMax:r,rawMin:s}=e;if("date"===t.type){const{max:e,min:t}=i;return{max:v(l)&&(null===e||null!=e&&l<e)?l:e??null,min:v(n)&&(null===t||null!=t&&n>t)?n:t??null}}if("date-only"===t.type||"time-only"===t.type||"timestamp-offset"===t.type){const{max:e,min:t,rawMax:u,rawMin:a}=i,o=v(l)&&r&&(null==e||l<e),p=v(n)&&s&&(null==t||n>t);return{max:o?l:e,min:p?n:t,rawMax:o?r:u,rawMin:p?s:a}}return{max:null,min:null}}get _configAllowsEdits(){const{element:e,layer:t,name:i}=this;if(null!=e)return e.editableExpression?!!this.evaluatedEditableExpression:!1!==e.editable;if(t?.userHasUpdateItemPrivileges)return!0;const l=t&&"popupTemplate"in t?t?.popupTemplate?.fieldInfos?.find(({fieldName:e})=>e===i):null;return l?.isEditable??!0}get _layerAndFieldAllowEdits(){return this.layerAllowsEdits&&this.field?.editable}get _isVisibleByDefault(){const{field:e,layer:t}=this;return!!e?.visible&&p(e,t)}get _isEditTrackingField(){return d(this.layer).includes(this.name?.toLowerCase())}get _shouldUseValueExpression(){return this._layerAndFieldAllowEdits&&!this._configAllowsEdits&&null!=this.valueExpressionExecutor&&this.valueExpressionExecutor.initialExecutionComplete}get isSubtypeField(){const{layer:e}=this;if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.name}return!1}get valueIsOutOfDomain(){const{domain:e,value:t,field:i}=this;return!(!e||null==t)&&null!==o(i,t,e)}get alias(){return s(this.field,this.layer)}get dataType(){const{field:e}=this;return m(e)?"number":h(e)?"text":g(e)||f(e)?"date":"unsupported"}get dateDataType(){if("date"===this.dataType)return"date"!==this.field.type?"string":"number"}get domain(){const{layer:e,feature:t,name:i,element:l}=this,n=l?.domain;return null!=n&&this._isDomainCompatible(n)?n:e.getFieldDomain(i,{feature:t})}get editable(){return!!this._layerAndFieldAllowEdits&&(this.evaluatedEditableExpression??this._configAllowsEdits)}get evaluatedRequiredExpression(){const{requiredExpressionExecutor:e}=this;return null!=e?!!e.lastEvaluatedValue:null}get evaluatedValueExpression(){const{valueExpressionExecutor:e}=this;return null!=e?e.lastEvaluatedValue:null}get hint(){return this.element?.hint}get includeDate(){return!("date"!==this.dataType||"time-only"===this.field.type)}get includeTime(){const{element:e,field:t}=this;if("date"!==this.dataType)return!1;if("time-only"===t.type)return!0;if("date-only"===t.type)return!1;const i="datetime-picker"===e?.input?.type?e.input.includeTime:void 0;return void 0===i||i}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.element?.input;return!e||"timestampoffset-picker"===e.type&&e.includeTimeOffset}set initialFeature(e){this._set("initialFeature",e),this.notifyChange("valid")}get inputType(){return this.element?.input?.type}get hasInvalidSwitchValue(){const{element:e}=this,t=E(e,"switch")?e.input:null;return!t||b(this.value,t)}get isRelationshipKeyField(){const{field:e,layer:t}=this;return c(t)&&!!t.relationships?.some(t=>t.keyField===e.name)}get label(){return this.getFormattedLabel(this.element?.label)||this.alias||this.field.name}get maxLength(){return D({dataType:this.dataType,field:this.field,input:this.element?.input})}get minLength(){return L({dataType:this.dataType,field:this.field,input:this.element?.input})}get name(){return this.field?.name}get range(){const{domain:e,element:t,field:i}=this;if("date"===this.dataType)return this._dateRange;const l=u(i,e)||y(i,e),n=l?.max===Number.MAX_VALUE?null:l?.max??null,r=l?.min===-Number.MAX_VALUE?null:l?.min??null;if(!t?.domain||"range"!==t.domain.type)return{max:n,min:r};const{max:s,min:a}=u(i)||{};return{max:null!=s&&(null===n||null!=n&&s<n)?s:n,min:null!=a&&(null===r||null!=r&&a>r)?a:r}}get required(){const{editable:e,evaluatedRequiredExpression:t,field:i,visible:l,isSubtypeField:n}=this;if(!e)return!1;if(!1===i?.nullable)return!0;if(n)return!0;return!(!l||!1===this.group?.visible||null==t)&&t}set required(e){this._overrideIfSome("required",e)}get showNoValueOptionEnabled(){const{element:e}=this;return!this.required&&(!_(e)||e.input.showNoValueOption)}get showNoValueLabel(){const{element:e}=this;return _(e)?e.input.noValueOptionLabel:null}get submittable(){const{field:e,required:t,valid:i,value:l}=this;return(!t||null!=l)&&(!!i||this.initialFeature.getAttribute(e.name)===l)}get timeResolution(){const e=this.element?.input;if(e&&("timestampoffset-picker"===e.type||"time-picker"===e.type))return e.timeResolution??"minutes"}get timeStep(){return null!=this.timeResolution?V.get(this.timeResolution):void 0}get updating(){const{editableExpressionExecutor:e,valueExpressionExecutor:t,visibilityExpressionExecutor:i,preservesValueWhenHidden:l}=this;return null!=t&&t.updating||null!=e&&e.updating||!1===l&&null!=i&&i.updating}get valid(){const e=this.editable?this._validate():null;return this._set("error",e),null===e}get value(){if(this._fieldInputWasVisibleDuringLifetime=this._fieldInputWasVisibleDuringLifetime||this.visible&&!1!==this.group?.visible,!1===this.preservesValueWhenHidden&&this._fieldInputWasVisibleDuringLifetime&&(!1===this.visibilityExpressionExecutor?.lastEvaluatedValue||!1===this.group?.visibilityExpressionExecutor?.lastEvaluatedValue))return null!==this._storedValue&&this.set("_storedValue",null),null;if(this._shouldUseValueExpression){const e=this.evaluatedValueExpression;return"date"===this.dataType?this._arcadeOutputToDateFieldValue(e):null!=e&&"object"==typeof e?`${e}`:e}return this._storedValue}set value(e){this.notifyChange("evaluatedVisibilityExpression"),this.set("_storedValue",e),this.notifyChange("value"),this.notifyChange("valid")}get visible(){return!this._isEditTrackingField&&(null!=this.evaluatedVisibilityExpression?this.evaluatedVisibilityExpression:null!=this.element&&!1!==this.field?.visible||this._isVisibleByDefault)}_arcadeOutputToDateFieldValue(e){const i=this.field.type;try{if("object"==typeof e){if(null===e)return null;if(T(e))return w(e,i);if("getTime"in e&&"function"==typeof e.getTime&&"date"===i)return parseInt(e.getTime(),10);if("date-only"===i||"time-only"===i||"timestamp-offset"===i)return e.toString()}else{if("string"==typeof e)return"date"===i?parseInt(e,10):e;if("number"==typeof e&&"date"===i)return e}throw new t("feature-form:invalid-date-value","Date value is invalid")}catch{return"date"===i?NaN:""}}_isDomainCompatible(e){const{field:t}=this;if("coded-value"===e?.type){const i=typeof e.codedValues[0].code;if("string"===i&&h(t)||"number"===i&&m(t))return!0}return!!("range"===e?.type&&m(t)||g(t)||f(t))}_validate(){const{dataType:e,domain:t,field:i,minLength:l,range:n,required:r,value:s,maxLength:u}=this;return M(s,{dataType:e,domain:t,field:i,multipleChoice:void 0,maxLength:u,minLength:l,range:n,required:r})}};e([n()],O.prototype,"_dateFormRange",null),e([n()],O.prototype,"_dateRange",null),e([n()],O.prototype,"_storedValue",void 0),e([n()],O.prototype,"_configAllowsEdits",null),e([n()],O.prototype,"_layerAndFieldAllowEdits",null),e([n()],O.prototype,"_isVisibleByDefault",null),e([n()],O.prototype,"_isEditTrackingField",null),e([n()],O.prototype,"_shouldUseValueExpression",null),e([n()],O.prototype,"isSubtypeField",null),e([n()],O.prototype,"valueIsOutOfDomain",null),e([n()],O.prototype,"alias",null),e([n()],O.prototype,"dataType",null),e([n()],O.prototype,"dateDataType",null),e([n()],O.prototype,"domain",null),e([n()],O.prototype,"editable",null),e([n({readOnly:!0})],O.prototype,"error",void 0),e([n({constructOnly:!0})],O.prototype,"preservesValueWhenHidden",void 0),e([n()],O.prototype,"evaluatedRequiredExpression",null),e([n()],O.prototype,"evaluatedValueExpression",null),e([n()],O.prototype,"field",void 0),e([n()],O.prototype,"group",void 0),e([n({readOnly:!0})],O.prototype,"hint",null),e([n()],O.prototype,"includeDate",null),e([n()],O.prototype,"includeTime",null),e([n()],O.prototype,"includeTimeOffset",null),e([n()],O.prototype,"initialFeature",null),e([n({readOnly:!0})],O.prototype,"inputType",null),e([n()],O.prototype,"hasInvalidSwitchValue",null),e([n()],O.prototype,"isRelationshipKeyField",null),e([n()],O.prototype,"label",null),e([n()],O.prototype,"maxLength",null),e([n()],O.prototype,"minLength",null),e([n({readOnly:!0})],O.prototype,"name",null),e([n()],O.prototype,"range",null),e([n()],O.prototype,"required",null),e([n()],O.prototype,"requiredExpressionExecutor",void 0),e([n()],O.prototype,"showNoValueOptionEnabled",null),e([n()],O.prototype,"submittable",null),e([n()],O.prototype,"timeResolution",null),e([n()],O.prototype,"timeStep",null),e([n({readOnly:!0})],O.prototype,"type",void 0),e([n()],O.prototype,"updating",null),e([n()],O.prototype,"valid",null),e([n({value:null})],O.prototype,"value",null),e([n()],O.prototype,"valueExpressionExecutor",void 0),e([n()],O.prototype,"visible",null),O=e([r("esri.widgets.FeatureForm.FieldInput")],O);const A=O;export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as r}from"../../core/accessorSupport/decorators.js";import a from"../Slider/SliderViewModel.js";import{formatDateLabel as s,formatNumberLabel as
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as r}from"../../core/accessorSupport/decorators.js";import a from"../Slider/SliderViewModel.js";import{formatDateLabel as s,formatNumberLabel as n}from"../smartMapping/support/utils.js";let o=class extends a{constructor(e){super({...e,suppressDeprecationWarning:!0}),this.average=null,this.bins=null,this.hasTimeData=!1,this.labelFormatFunction=e=>{if(this.hasTimeData)return s(e);const{max:t,min:r,precision:a}=this,o=t-r>10?2:a;return n(parseFloat(e.toFixed(o)))},this.rangeType="equal",this.standardDeviation=null}generateWhereClause(e){const{rangeType:t,state:r,values:a}=this;if("ready"!==r||!a?.length||null==e)return null;const s=a[0],n=a.length>1?a[a.length-1]:null;switch(t){case"equal":return`${e} = ${s}`;case"not-equal":return`${e} <> ${s}`;case"less-than":return`${e} < ${s}`;case"greater-than":return`${e} > ${s}`;case"at-least":return`${e} >= ${s}`;case"at-most":return`${e} <= ${s}`;case"between":return`${e} BETWEEN ${s} AND ${n}`;case"not-between":return`${e} NOT BETWEEN ${s} AND ${n}`;default:return null}}};e([t()],o.prototype,"average",void 0),e([t()],o.prototype,"bins",void 0),e([t()],o.prototype,"hasTimeData",void 0),e([t()],o.prototype,"labelFormatFunction",void 0),e([t()],o.prototype,"rangeType",void 0),e([t()],o.prototype,"standardDeviation",void 0),o=e([r("esri.widgets.HistogramRangeSlider.HistogramRangeSliderViewModel")],o);const i=o;export{i as default};
|