@arcgis/core 4.23.0-next.20220123 → 4.23.0-next.20220128
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/Graphic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02fbc76dfdc20e628c61.js +1 -0
- package/assets/esri/core/workers/chunks/0453fad5cb819797b4f6.js +1 -0
- package/assets/esri/core/workers/chunks/0463ba46df855a92b9c0.js +1 -0
- package/assets/esri/core/workers/chunks/0cd0a6eef51fc5b9ea61.js +1 -0
- package/assets/esri/core/workers/chunks/{d1454155ee1b8a421cbb.js → 0d02c6ad1f4688bfa374.js} +1 -1
- package/assets/esri/core/workers/chunks/0d684f16f37d5dc385dd.js +1 -0
- package/assets/esri/core/workers/chunks/0e17691520d890d34efb.js +1 -0
- package/assets/esri/core/workers/chunks/16b6d0f8378582c051c3.js +1 -0
- package/assets/esri/core/workers/chunks/{0ce1dc14280d6f188468.js → 17de7a324dfa7f57ad5d.js} +1 -1
- package/assets/esri/core/workers/chunks/{b313ab14a643273e7d09.js → 1877ab1b6a115dbba1c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{c36f84daa7736878418d.js → 197ec52641aed20029c6.js} +1 -1
- package/assets/esri/core/workers/chunks/1b2a961f776a0b57e57a.js +1 -0
- package/assets/esri/core/workers/chunks/1b3fd66577b19aa5f2b6.js +1 -0
- package/assets/esri/core/workers/chunks/1c733b7db092a2a88ef3.js +1 -0
- package/assets/esri/core/workers/chunks/1f8c6a179e39fd4c5e6f.js +1 -0
- package/assets/esri/core/workers/chunks/2076fcbae63f1bfb7143.js +1 -0
- package/assets/esri/core/workers/chunks/{9387db408f496e7dd003.js → 214910032945dd2d86b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2ae5fc4f787ea568b88.js → 2460f3b6ada6ae900dec.js} +1 -1
- package/assets/esri/core/workers/chunks/27474b007988855bea9d.js +1 -0
- package/assets/esri/core/workers/chunks/281b89dbf5574fc642ae.js +1 -0
- package/assets/esri/core/workers/chunks/{4d539878bfbd7c549e60.js → 2c8fe9bc988c3c5760a5.js} +1 -1
- package/assets/esri/core/workers/chunks/2e899ef5881b4ec6fa55.js +1 -0
- package/assets/esri/core/workers/chunks/34b59d7099904dcb28b5.js +1 -0
- package/assets/esri/core/workers/chunks/357033117dfe61eb81ea.js +1 -0
- package/assets/esri/core/workers/chunks/37c03cfc19086ce631c6.js +1 -0
- package/assets/esri/core/workers/chunks/391e96192d1ec4e55ce2.js +1 -0
- package/assets/esri/core/workers/chunks/3c673495e5f507c4a9e5.js +1 -0
- package/assets/esri/core/workers/chunks/422537fc3df707bb62c9.js +1 -0
- package/assets/esri/core/workers/chunks/44f0c3663b293afbd172.js +1 -0
- package/assets/esri/core/workers/chunks/483d5d8593d96d0f0b15.js +1 -0
- package/assets/esri/core/workers/chunks/{c959e0d1cf7dce0421b9.js → 48fa8aed6c24877b44c4.js} +1 -1
- package/assets/esri/core/workers/chunks/{44b01d42d4ec72913229.js → 4954fd86b48cc68b737c.js} +1 -1
- package/assets/esri/core/workers/chunks/49a1a633bb0d93764aae.js +1 -0
- package/assets/esri/core/workers/chunks/4ba6de8aa7e2960bad49.js +1 -0
- package/assets/esri/core/workers/chunks/4be35af7d6babbfe9d84.js +1 -0
- package/assets/esri/core/workers/chunks/5457962a70bd3c557a75.js +1 -0
- package/assets/esri/core/workers/chunks/57856b4a9b8784a69844.js +1 -0
- package/assets/esri/core/workers/chunks/{b9c177524b3e7de1ffd1.js → 5790d171072b3c7d108f.js} +1 -1
- package/assets/esri/core/workers/chunks/57b349d1dbc0bed75b79.js +1 -0
- package/assets/esri/core/workers/chunks/5bcb3240b3c005e5fe72.js +1 -0
- package/assets/esri/core/workers/chunks/5d11b97b667921d67ae7.js +1 -0
- package/assets/esri/core/workers/chunks/5dbe555a5a662ff3d9ce.js +1 -0
- package/assets/esri/core/workers/chunks/5ec98f4ddac707d0fbd1.js +1 -0
- package/assets/esri/core/workers/chunks/64b7e8d812ea8fcf269e.js +1 -0
- package/assets/esri/core/workers/chunks/{4c9084a04948b6924749.js → 655b55ac0cd533d7e9d7.js} +1 -1
- package/assets/esri/core/workers/chunks/{b0b036ad3ad3cd956747.js → 69fd99b7c76e9992ccf3.js} +1 -1
- package/assets/esri/core/workers/chunks/{9cdaba126ac7fa5f33f0.js → 6cd5e4380d29b9a3c344.js} +1 -1
- package/assets/esri/core/workers/chunks/75d812955a473d0e8960.js +1 -0
- package/assets/esri/core/workers/chunks/7903a3e2e0faff0f86c0.js +1 -0
- package/assets/esri/core/workers/chunks/{cc146c57bbdac8029fd8.js → 7a5f5acfbd4ca1a5c1f3.js} +1 -1
- package/assets/esri/core/workers/chunks/{64276aacaafa4c8a15bd.js → 7dcf52d3db3903c8eb9f.js} +1 -1
- package/assets/esri/core/workers/chunks/83d00afae4406ec78bc9.js +1 -0
- package/assets/esri/core/workers/chunks/{625d2663daa8e0cf64b0.js → 85b1f36790df95b17659.js} +1 -1
- package/assets/esri/core/workers/chunks/89820b200ee44e678af5.js +1 -0
- package/assets/esri/core/workers/chunks/918bb7a7d901544a7367.js +1 -0
- package/assets/esri/core/workers/chunks/{94b8dbf859df71858d1c.js → 929c9b7cdab7c4ca3d87.js} +1 -1
- package/assets/esri/core/workers/chunks/94515fb3ef38067eeadd.js +1 -0
- package/assets/esri/core/workers/chunks/949b2269457302ffc64b.js +1 -0
- package/assets/esri/core/workers/chunks/952980635afc7ec81804.js +1 -0
- package/assets/esri/core/workers/chunks/9876a1bae350795fab36.js +1 -0
- package/assets/esri/core/workers/chunks/99619fcb772807c74f3b.js +1 -0
- package/assets/esri/core/workers/chunks/{010a71c2aa1b7681e191.js → 9d11f84e6c893b9d0019.js} +1 -1
- package/assets/esri/core/workers/chunks/a1930e4f035bc9aa1ae5.js +1 -0
- package/assets/esri/core/workers/chunks/a8692bffb76444c34760.js +1 -0
- package/assets/esri/core/workers/chunks/aa04b90b82bf70caaae4.js +1 -0
- package/assets/esri/core/workers/chunks/aeaa1667c2d9f1b3366b.js +1 -0
- package/assets/esri/core/workers/chunks/b2d2de935487257c568b.js +1 -0
- package/assets/esri/core/workers/chunks/b3f5e91116112b0b612a.js +1 -0
- package/assets/esri/core/workers/chunks/b97953694f42bfec1b3c.js +1 -0
- package/assets/esri/core/workers/chunks/b9e9cb354822c6d995a4.js +1 -0
- package/assets/esri/core/workers/chunks/ba762bcfd74af0bb8218.js +1 -0
- package/assets/esri/core/workers/chunks/bac9fc90e6756e211160.js +1 -0
- package/assets/esri/core/workers/chunks/be588873c16770ceb9ef.js +1 -0
- package/assets/esri/core/workers/chunks/bf97a933ea3b220115e1.js +1 -0
- package/assets/esri/core/workers/chunks/bfedd6ebff817c9b31c0.js +1 -0
- package/assets/esri/core/workers/chunks/c093dff4592832ac0973.js +1 -0
- package/assets/esri/core/workers/chunks/c1135cb02ec46c491459.js +1 -0
- package/assets/esri/core/workers/chunks/c2253a9f29c1aabb2b75.js +1 -0
- package/assets/esri/core/workers/chunks/{d39b7983b68d6e5b404d.js → cdbc005eebec1503b99d.js} +1 -1
- package/assets/esri/core/workers/chunks/d04fca5d46cca02500b7.js +1 -0
- package/assets/esri/core/workers/chunks/d08efbc349dd9f999497.js +1 -0
- package/assets/esri/core/workers/chunks/d1fe53b597351dc58305.js +1 -0
- package/assets/esri/core/workers/chunks/{a8b13fb804bb775e4967.js → db3c729ce0c0b2690dc9.js} +1 -1
- package/assets/esri/core/workers/chunks/dd13772a5e2eccc6a2bc.js +1 -0
- package/assets/esri/core/workers/chunks/dedc333a61081772ca7b.js +1 -0
- package/assets/esri/core/workers/chunks/{a7b1b75643ed31489495.js → e0c8d61c7a85ce15499a.js} +1 -1
- package/assets/esri/core/workers/chunks/{199670a3a564ebe3bd79.js → e218bde41ffbcc5194f5.js} +1 -1
- package/assets/esri/core/workers/chunks/e21b211913aefde47e30.js +1 -0
- package/assets/esri/core/workers/chunks/e287f49184d076af17e2.js +1 -0
- package/assets/esri/core/workers/chunks/{bde1d5b0a7717350986e.js → e4019b63a1fe74e2c842.js} +1 -1
- package/assets/esri/core/workers/chunks/e8e775758b79c5a084c8.js +1 -0
- package/assets/esri/core/workers/chunks/e93dfdede0532a89ffa5.js +1 -0
- package/assets/esri/core/workers/chunks/e9e5196b44b6923be1a3.js +1 -0
- package/assets/esri/core/workers/chunks/ea595b0df5050eda2a13.js +1 -0
- package/assets/esri/core/workers/chunks/eb82ff10cef2bde6e57f.js +1 -0
- package/assets/esri/core/workers/chunks/ebc6f4764b82d4104c65.js +1 -0
- package/assets/esri/core/workers/chunks/{1305ef8717da6e902a55.js → ec10151a2a95e95a0bb5.js} +1 -1
- package/assets/esri/core/workers/chunks/eccba071ced2d922bb85.js +1 -0
- package/assets/esri/core/workers/chunks/ee6e0db58dc64410e687.js +1 -0
- package/assets/esri/core/workers/chunks/f0a9f161805fc7a30fc5.js +1 -0
- package/assets/esri/core/workers/chunks/f2124f4d0f2b8a91f0ea.js +1 -0
- package/assets/esri/core/workers/chunks/ff6abdc72076f3994659.js +981 -0
- package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
- package/assets/esri/themes/base/_mixins.scss +4 -1
- package/assets/esri/themes/base/icons/style.scss +11 -2
- package/assets/esri/themes/base/widgets/_BasemapLayerList.scss +13 -10
- package/assets/esri/themes/base/widgets/_CoordinateConversion.scss +4 -2
- package/assets/esri/themes/base/widgets/_Directions.scss +5 -3
- package/assets/esri/themes/base/widgets/_Editor.scss +5 -2
- package/assets/esri/themes/base/widgets/_ElevationProfile.scss +6 -4
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +6 -0
- package/assets/esri/themes/base/widgets/_ItemList.scss +1 -1
- package/assets/esri/themes/base/widgets/_LayerList.scss +13 -9
- package/assets/esri/themes/base/widgets/_Popup.scss +4 -2
- package/assets/esri/themes/base/widgets/_Print.scss +24 -11
- package/assets/esri/themes/base/widgets/_Search.scss +4 -2
- package/assets/esri/themes/base/widgets/_TableList.scss +9 -7
- package/assets/esri/themes/base/widgets/_Weather.scss +12 -0
- package/assets/esri/themes/base/widgets/_Widget.scss +18 -9
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/dark-blue/main.css +1 -1
- package/assets/esri/themes/dark-green/main.css +1 -1
- package/assets/esri/themes/dark-purple/main.css +1 -1
- package/assets/esri/themes/dark-red/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/themes/light-blue/main.css +1 -1
- package/assets/esri/themes/light-green/main.css +1 -1
- package/assets/esri/themes/light-purple/main.css +1 -1
- package/assets/esri/themes/light-red/main.css +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_en.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
- package/chunks/BlendLayers.glsl.js +2 -2
- package/chunks/ChapmanAtmosphere.glsl.js +17 -17
- package/chunks/CheckerBoard.glsl.js +3 -3
- package/chunks/Clouds.glsl.js +2 -2
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ColorMaterial.glsl.js +12 -12
- package/chunks/ComponentShader.glsl.js +21 -21
- package/chunks/Compositing.glsl.js +1 -1
- package/chunks/DefaultMaterial.glsl.js +33 -33
- package/chunks/EdgeShaderProgram.glsl.js +7 -7
- package/chunks/Fog.glsl.js +10 -12
- package/chunks/HUDMaterial.glsl.js +2 -2
- package/chunks/HighlightComposition.glsl.js +5 -5
- package/chunks/ImageMaterial.glsl.js +6 -6
- package/chunks/LaserlinePath.glsl.js +8 -8
- package/chunks/LineCallout.glsl.js +6 -6
- package/chunks/MeasurementArrow.glsl.js +1 -1
- package/chunks/NativeLine.glsl.js +1 -1
- package/chunks/Path.glsl.js +5 -5
- package/chunks/Pattern.glsl.js +9 -9
- package/chunks/PointRenderer.glsl.js +14 -14
- package/chunks/Precipitation.glsl.js +91 -0
- package/chunks/RealisticTree.glsl.js +21 -21
- package/chunks/RibbonLine.glsl.js +11 -11
- package/chunks/SMAA.glsl.js +40 -40
- package/chunks/ShadedColorMaterial.glsl.js +12 -12
- package/chunks/ShadowCast.glsl.js +6 -6
- package/chunks/ShadowHighlight.glsl.js +4 -4
- package/chunks/SimpleAtmosphere.glsl.js +3 -3
- package/chunks/SlicePlaneMaterial.glsl.js +3 -3
- package/chunks/Stars.glsl.js +3 -3
- package/chunks/Terrain.glsl.js +3 -3
- package/chunks/TextureOnly.glsl.js +2 -2
- package/chunks/WaterSurface.glsl.js +22 -22
- package/chunks/boundedPlane.js +1 -1
- package/chunks/pe.js +1 -1
- package/chunks/vec3.js +1 -1
- package/chunks/vxlLayer.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/accessorSupport/read.js +1 -1
- package/core/accessorSupport/set.js +1 -1
- package/core/accessorSupport/watch.js +1 -1
- package/core/accessorSupport/write.js +1 -1
- package/core/clock.js +1 -1
- package/core/jsonMap.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/loadAll.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/reactiveUtils.js +1 -1
- package/form/ExpressionInfo.js +1 -1
- package/geometry/pe.js +1 -1
- package/geometry/support/axisAngleDegrees.js +1 -1
- package/geometry/support/frustum.js +1 -1
- package/geometry/support/plane.js +1 -1
- package/interfaces.d.ts +263 -35
- package/layers/VectorTileLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/featureConversionUtils.js +1 -1
- package/layers/support/LayerContingentValuesCache.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/rasterDatasets/BaseRaster.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/package.json +2 -2
- package/popup/content/AttachmentsContent.js +1 -1
- package/popup/content/support/mediaInfoTypes.js +1 -1
- package/rest/print.js +1 -1
- package/smartMapping/statistics/support/predominanceUtils.d.ts +4 -0
- package/support/arcadeOnDemand.js +1 -1
- package/support/featureFlags.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/FillSymbol3DLayer.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/LabelSymbol3D.js +1 -1
- package/symbols/ObjectSymbol3DLayer.js +1 -1
- package/symbols/PointSymbol3D.js +1 -1
- package/symbols/Symbol3D.js +1 -1
- package/symbols/WebStyleSymbol.js +1 -1
- package/symbols/cim/CIMSymbolHelper.js +1 -1
- package/symbols/cim/CIMSymbolRasterizer.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/support/IconSymbol3DLayerResource.js +1 -1
- package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
- package/symbols/support/Symbol3DAnchorPosition2D.js +1 -1
- package/symbols/support/Symbol3DAnchorPosition3D.js +1 -1
- package/symbols/support/Symbol3DFillMaterial.js +1 -1
- package/symbols/support/Symbol3DIconOutline.js +1 -1
- package/symbols/support/Symbol3DOutline.js +1 -1
- package/symbols/support/Symbol3DVerticalOffset.js +1 -1
- package/symbols/support/Thumbnail.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/symbols/support/previewWebStyleSymbol.js +1 -1
- package/symbols/support/svgUtils.js +1 -1
- package/symbols/support/webStyleSymbolUtils.js +1 -1
- package/symbols.js +1 -1
- package/views/2d/MapViewConstraints.js +1 -1
- package/views/2d/engine/vectorTiles/SchemaHelper.js +1 -1
- package/views/2d/engine/webgl/brushes/raster/BrushRasterBitmap.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLFillTemplate.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/viewpointUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsComposition.glsl.js +1 -1
- package/views/3d/environment/CloudsComposition.js +1 -1
- package/views/3d/environment/CloudsGenerator.js +1 -1
- package/views/3d/environment/CloudsPresets.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/Fog.glsl.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/PanoramicAtmosphere.js +1 -1
- package/views/3d/environment/Precipitation.glsl.js +5 -0
- package/views/3d/environment/Precipitation.js +5 -0
- package/views/3d/environment/PrecipitationTechnique.js +5 -0
- package/views/3d/environment/RainyWeather.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.glsl.js +1 -1
- package/views/3d/environment/SimpleAtmosphere.js +1 -1
- package/views/3d/environment/SnowyWeather.js +5 -0
- package/views/3d/environment/Stars.glsl.js +1 -1
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/environment/weather.js +1 -1
- package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
- package/views/3d/interactive/analysisTools/slice/sliceToolUtils.js +1 -1
- package/views/3d/interactive/editingTools/transformGraphic/ScaleRotateMeshAdapter.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationAligners.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/lineUtils.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/polygonUtils.js +1 -1
- package/views/3d/layers/graphics/symbolComplexity.js +1 -1
- package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +5 -0
- package/views/3d/layers/support/overlayImageUtils.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/support/LaserlinePathData.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +10 -10
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/InstancedDoublePrecision.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/NormalAttribute.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PositionAttribute.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexColor.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +12 -12
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexTextureCoordinates.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +16 -16
- package/views/3d/webgl-engine/core/shaderLibrary/default/RealisticTree.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUDOcclusionPass.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeNormalTexture.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeShadingNormal.glsl.js +10 -11
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassGeometryTest.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MultipassTerrainTest.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Normals.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Reprojection.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/Water.glsl.js +22 -14
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Camera.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexAttributeLocations.js +1 -1
- package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/MagnifierHelper.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/{layers/graphics/IGraphics3DFeatureProcessor.js → webgl-engine/lib/TextureUniformName.js} +0 -0
- package/views/3d/webgl-engine/lib/UniformName.js +4 -0
- package/views/3d/webgl-engine/lib/VertexAttribute.js +5 -0
- package/views/3d/webgl-engine/lib/basicInterfaces.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/RenderInstanceData.js +1 -1
- package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/VisualVariableMaterialParameters.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/internal/DefaultBufferWriter.js +1 -1
- package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/materials/internal/waterMaterialUtils.js +1 -1
- package/views/3d/webgl-engine/parts/Model.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePath.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PointRenderer.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RealisticTreeTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SMAA.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowHighlightTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +10 -10
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/DiscardShortEdges.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShaderProgram.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +21 -21
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineAmplitude.glsl.js +6 -6
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/LineOffset.glsl.js +13 -13
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/UnpackAttributes.glsl.js +6 -6
- package/views/MapView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/View.js +1 -1
- package/views/input/recognizers/DoubleTapDrag.js +1 -1
- package/views/input/recognizers/ImmediateDoubleClick.js +1 -1
- package/views/input/recognizers/PointerClickHoldAndDrag.js +1 -1
- package/views/input/recognizers/SingleAndDoubleClick.js +1 -1
- package/views/interactive/dragEventPipeline.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/views/support/WatchUpdatingTracking.js +1 -1
- package/views/support/projectionUtils.js +5 -0
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/InstanceCounter.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/views/webgl/rasterUtils.js +1 -1
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
- package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
- package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
- package/widgets/BasemapGallery.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/FeatureForm/InputField.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/Search/support/locatorUtils.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather/enums.js +5 -0
- package/widgets/Weather.js +1 -1
- package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
- package/widgets/support/InteractiveToolViewModel.js +1 -1
- package/assets/components/assets/calcite-icon/checkSquareF16.json +0 -1
- package/assets/components/assets/calcite-icon/checkSquareF24.json +0 -1
- package/assets/components/assets/calcite-icon/checkSquareF32.json +0 -1
- package/assets/components/assets/calcite-icon/lineSolid4.json +0 -1
- package/assets/components/assets/calcite-icon/squareF16.json +0 -1
- package/assets/components/assets/calcite-icon/squareF24.json +0 -1
- package/assets/components/assets/calcite-icon/squareF32.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon16.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon24.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagon32.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF16.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF24.json +0 -1
- package/assets/components/assets/calcite-icon/xHexagonF32.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF16.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF24.json +0 -1
- package/assets/components/assets/calcite-icon/xOctagonF32.json +0 -1
- package/assets/esri/core/workers/chunks/09da224052976e290828.js +0 -1
- package/assets/esri/core/workers/chunks/0bf079e752ab79468478.js +0 -1
- package/assets/esri/core/workers/chunks/0c3e3a5baf54bd5e210c.js +0 -1
- package/assets/esri/core/workers/chunks/14bef72154b3a19561a7.js +0 -1
- package/assets/esri/core/workers/chunks/18668dc45eb9e35530df.js +0 -1
- package/assets/esri/core/workers/chunks/1e4d37c2b9dc83d20a11.js +0 -1
- package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +0 -1
- package/assets/esri/core/workers/chunks/208a7e24e19fc5633dd7.js +0 -1
- package/assets/esri/core/workers/chunks/22b09e276c9b9f22f0f8.js +0 -1
- package/assets/esri/core/workers/chunks/23745a5ab47c840dc452.js +0 -1
- package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +0 -1
- package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +0 -1
- package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +0 -1
- package/assets/esri/core/workers/chunks/32f8c4af7e70ebdcb19e.js +0 -1
- package/assets/esri/core/workers/chunks/36a3f6fb4d1d18fcb642.js +0 -1
- package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +0 -1
- package/assets/esri/core/workers/chunks/3a9740dccda6a733313c.js +0 -1
- package/assets/esri/core/workers/chunks/3aa4194dc5497c57647f.js +0 -1
- package/assets/esri/core/workers/chunks/40a1e713f63ec77110c0.js +0 -1
- package/assets/esri/core/workers/chunks/43cdff2418325e163420.js +0 -1
- package/assets/esri/core/workers/chunks/4bfbf5a34c9207fdcf44.js +0 -1
- package/assets/esri/core/workers/chunks/5383a8f3e4ec1a8a4fcd.js +0 -1
- package/assets/esri/core/workers/chunks/5538639a49c7cc2eca63.js +0 -1
- package/assets/esri/core/workers/chunks/5a4a5585ec8027079f32.js +0 -1
- package/assets/esri/core/workers/chunks/5d4863a92b03bebc1b54.js +0 -1
- package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +0 -1
- package/assets/esri/core/workers/chunks/634b5ccd7a3ac67f855d.js +0 -1
- package/assets/esri/core/workers/chunks/662d13f68cf3ec92439b.js +0 -1
- package/assets/esri/core/workers/chunks/663ad15b86936eb06b69.js +0 -1
- package/assets/esri/core/workers/chunks/67162b3e2cc1b5dc6818.js +0 -1
- package/assets/esri/core/workers/chunks/739e579150bf466d43ae.js +0 -1
- package/assets/esri/core/workers/chunks/74df1f3e1e2e524a89d2.js +0 -1
- package/assets/esri/core/workers/chunks/76eef4799f6c5fff7e2d.js +0 -1
- package/assets/esri/core/workers/chunks/7baf6b1f3f050aa67ae4.js +0 -1
- package/assets/esri/core/workers/chunks/7bc5cc5dbf1b7b70ddac.js +0 -1
- package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +0 -1
- package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +0 -1
- package/assets/esri/core/workers/chunks/8b6ab6202a40fe622833.js +0 -1
- package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +0 -1
- package/assets/esri/core/workers/chunks/9796d54ff12b6429164a.js +0 -1
- package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +0 -1
- package/assets/esri/core/workers/chunks/9cb2ae42a8e328b1d98d.js +0 -1
- package/assets/esri/core/workers/chunks/9d3c58a0ef634d95b7bd.js +0 -1
- package/assets/esri/core/workers/chunks/a6ff3db3493543df81bc.js +0 -1
- package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +0 -1
- package/assets/esri/core/workers/chunks/a96afc176041f698c7a1.js +0 -1
- package/assets/esri/core/workers/chunks/aa861b8eae6c85f3dad4.js +0 -1
- package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +0 -1
- package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +0 -1
- package/assets/esri/core/workers/chunks/afa6912454f2a5ffadce.js +0 -1
- package/assets/esri/core/workers/chunks/b2beb6e1fd2ee6503830.js +0 -1
- package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +0 -1
- package/assets/esri/core/workers/chunks/ba6654a885be4b7a43f0.js +0 -1
- package/assets/esri/core/workers/chunks/bab1cfd0a901181622af.js +0 -1
- package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +0 -1
- package/assets/esri/core/workers/chunks/c080114a69fa95b88d22.js +0 -1
- package/assets/esri/core/workers/chunks/c11474b702dfb94e8e87.js +0 -1
- package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +0 -1
- package/assets/esri/core/workers/chunks/c6bd943fe8fd13bb4806.js +0 -1
- package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +0 -1
- package/assets/esri/core/workers/chunks/ca2f5faa01d99c21ec14.js +0 -1
- package/assets/esri/core/workers/chunks/cd7d83d127e085d52584.js +0 -1
- package/assets/esri/core/workers/chunks/cef4af64860ebbfc1c47.js +0 -1
- package/assets/esri/core/workers/chunks/cfbffa429d88e7709c3f.js +0 -1
- package/assets/esri/core/workers/chunks/d24c4fbc567486b1188f.js +0 -1
- package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +0 -1
- package/assets/esri/core/workers/chunks/da1c2873bdbc0956dca0.js +0 -1
- package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +0 -1
- package/assets/esri/core/workers/chunks/de6cff7b6cbbf99b20d1.js +0 -981
- package/assets/esri/core/workers/chunks/e079cb1d53aca15b7df2.js +0 -1
- package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +0 -1
- package/assets/esri/core/workers/chunks/e6df9839b551569fbc62.js +0 -1
- package/assets/esri/core/workers/chunks/e97e986120aaadad7d4c.js +0 -1
- package/assets/esri/core/workers/chunks/f467c8f1fce22f6f599c.js +0 -1
- package/assets/esri/core/workers/chunks/f678293de9a6d8f5b5db.js +0 -1
- package/assets/esri/core/workers/chunks/f8e7755240a94b499e1f.js +0 -1
- package/assets/esri/core/workers/chunks/fd3e5d823dc7917f4b8f.js +0 -1
- package/assets/esri/core/workers/chunks/ffaf091c6023225cf5aa.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../Graphic.js";import"../../symbols.js";import s from"../../core/Collection.js";import i from"../../core/Error.js";import o from"../../core/Handles.js";import r from"../../core/Logger.js";import{unwrap as n,isNone as a}from"../../core/maybe.js";import{init as l,watch as u,whenFalse as h}from"../../core/watchUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{geographicToWebMercator as d}from"../../geometry/support/webMercatorUtils.js";import g from"../../layers/Layer.js";import f from"../../support/actions/ActionBase.js";import m from"../../support/actions/ActionButton.js";import y from"../../support/actions/ActionToggle.js";import{getDisplayedSymbol as w}from"../../symbols/support/symbolUtils.js";import{ViewEventPriorities as v}from"../../views/input/InputManager.js";import{highlightsSupported as F}from"../../views/support/layerViewUtils.js";import _ from"../Feature/FeatureViewModel.js";import{zoomToClusteredFeatures as b,browseClusteredFeatures as C,zoomToFeature as P}from"./actions.js";import{triggerAction as E,getSelectedTarget as A,removeClusteredFeaturesForBrowsing as M,displayClusterExtent as j,browseAggregateFeatures as V}from"./actionUtils.js";import O from"../support/AnchorElementViewModel.js";import{GoToMixin as x}from"../support/GoTo.js";import I from"../../symbols/SimpleFillSymbol.js";import L from"../../geometry/Point.js";const T=s.ofType({key:"type",defaultKeyValue:"button",base:f,typeMap:{button:m,toggle:y}}),S=()=>[P.clone()],B=()=>[b.clone(),C.clone()],R="esri.widgets.Popup.PopupViewModel",G=r.getLogger(R);let z=class extends(x(O)){constructor(e){super(e),this._handles=new o,this._pendingPromises=new Set,this._fetchFeaturesController=null,this._selectedClusterFeature=null,this.featurePage=null,this.actions=new T,this.defaultPopupTemplateEnabled=!1,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.featuresPerPage=20,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new t({symbol:new I({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null}get isLoadingFeature(){return this.featureViewModels.some((e=>e.waitingForContent))}initialize(){this._handles.add([l(this,["autoOpenEnabled","view"],(()=>this._autoOpenEnabledChange())),this.on("view-change",(()=>this._autoClose())),u(this,["highlightEnabled","selectedFeature","visible","view"],(()=>this._highlightFeature())),u(this,"view.animation.state",(e=>this._animationStateChange(e))),u(this,"location",(e=>this._locationChange(e))),u(this,"selectedFeature",(e=>this._selectedFeatureChange(e))),u(this,["selectedFeatureIndex","featureCount","featuresPerPage"],(()=>this._selectedFeatureIndexChange())),u(this,["featurePage","selectedFeatureIndex","featureCount","featuresPerPage, featureViewModels"],(()=>this._setGraphicOnFeatureViewModels())),u(this,"featureViewModels",(()=>this._featureViewModelsChange())),this.on("trigger-action",(e=>E({event:e,view:this.view}))),h(this,"waitingForResult",(()=>this._waitingForResultChange()),!0),u(this,["features","view","view.map","view.spatialReference"],(()=>this._updateFeatureVMs())),u(this,["view.scale"],this._viewScaleChange),h(this,"visible",(()=>this.browseClusterEnabled=!1)),u(this,"browseClusterEnabled",(e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing()))])}destroy(){this._cancelFetchingFeatures(),this._handles.destroy(),this._handles=null,this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new T;e.removeAll();const{actions:t,defaultActions:s,defaultPopupTemplateEnabled:i,includeDefaultActions:o,selectedFeature:r}=this,n=o?s.concat(t):t,a=r&&("function"==typeof r.getEffectivePopupTemplate&&r.getEffectivePopupTemplate(i)||r.popupTemplate),l=a&&a.actions,u=a&&a.overwriteActions?l:l?l.concat(n):n;return u&&u.filter(Boolean).forEach((t=>e.add(t))),e}get defaultActions(){var e;const t=this._get("defaultActions")||new T;return t.removeAll(),t.addMany(null!=(e=this.selectedFeature)&&e.isAggregate?B():S()),t}get featureCount(){return this.features.length}get features(){return this._get("features")||[]}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:s,promiseCount:i,selectedFeatureIndex:o}=this,r=i&&t.length;r&&s&&-1===o?this.selectedFeatureIndex=0:r&&-1!==o||(this.selectedFeatureIndex=t.length?0:-1)}get location(){return this._get("location")||null}set location(e){const t=this.get("view.spatialReference.isWebMercator");e&&e.get("spatialReference.isWGS84")&&t&&(e=d(e)),this._set("location",e)}get pendingPromisesCount(){return this._pendingPromises.size}get waitingForResult(){return!(!(!!this._fetchFeaturesController||this.pendingPromisesCount>0)||0!==this.featureCount)}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){if(this._pendingPromises.clear(),this.features=[],!Array.isArray(e)||!e.length)return this._set("promises",[]),void this.notifyChange("pendingPromisesCount");this._set("promises",e),(e=e.slice(0)).forEach((e=>{this._pendingPromises.add(e);const t=t=>{this._pendingPromises.has(e)&&this._updateFeatures(t),this._updatePendingPromises(e)},s=()=>this._updatePendingPromises(e);e.then(t,s)})),this.notifyChange("pendingPromisesCount")}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){return this.get("view.ready")?"ready":"disabled"}centerAtLocation(){const{view:e}=this,t=A(this);if(!t){const s=new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e});return G.error(s),Promise.reject(s)}return this.callGoTo({target:{target:t,scale:e.scale}})}clear(){this.set({promises:[],features:[],content:null,title:null,location:null})}fetchFeatures(e,t){const{view:s}=this;if(!s||!e){const t=new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:s});return G.error(t),Promise.reject(t)}return s.fetchPopupFeatures(e,{event:t&&t.event,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t&&t.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:s}=t;delete t.fetchFeatures,s&&this._setFetchFeaturesPromises(t.location);const i=["actionsMenuOpen","collapsed","featureMenuOpen"];for(const o of i)delete t[o];this.set(t)}triggerAction(e){const t=this.allActions.getItemAt(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex=this.selectedFeatureIndex+1,this}previous(){return this.selectedFeatureIndex=this.selectedFeatureIndex-1,this}disableClusterBrowsing(){M(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){await j(this),await V(this)}_animationStateChange(e){this.zoomToLocation||(P.disabled="waiting-for-target"===e)}_clearBrowsedClusterGraphics(){var e;const t=null==(e=this.view)?void 0:e.graphics;t&&(t.remove(this.selectedClusterBoundaryFeature),t.remove(this._selectedClusterFeature)),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){var e;(null!=(e=this.selectedFeature)&&e.isAggregate||this.browseClusterEnabled)&&(this.browseClusterEnabled=!1,this.visible=!1)}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:s}=this;s&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:s,featuresPerPage:i,featureViewModels:o}=this;if(null===s)return;const r=((s-1)*i+t)%t,n=r+i;o.slice(r,n).forEach(((t,s)=>{t&&!t.graphic&&(t.graphic=e[r+s])}))}async _selectedFeatureChange(e){if(!e)return;const{location:t,updateLocationEnabled:s,view:i}=this;if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(i.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),e.isAggregate)return;return e.symbol=await w(e),this._selectedClusterFeature=e,void i.graphics.add(this._selectedClusterFeature)}!s&&t||!e.geometry?s&&!e.geometry&&this.centerAtLocation().then((()=>{this.location=i.center.clone()})):this.location=n(this._getPointFromGeometry(e.geometry))}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}_setFetchFeaturesPromises(e){return this._fetchFeaturesWithController(this._getScreenPoint(e||this.location)).then((e=>{const{clientOnlyGraphics:t,promisesPerLayerView:s}=e,i=Promise.resolve(t),o=s.map((e=>e.promise));this.promises=[i,...o]}))}_destroyFeatureVMs(){this.featureViewModels.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:s}=this;if(null!=e&&e.isAggregate||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t||!t.length)return;const i=s.slice(0),o=[];t.forEach(((t,s)=>{if(!t)return;let r=null;if(i.some(((e,s)=>(e&&e.graphic===t&&(r=e,i.splice(s,1)),!!r))),r)o[s]=r;else{var n,a;const i=new _({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:null==(n=this.view)?void 0:n.spatialReference,graphic:t===e?t:null,map:null==(a=this.view)?void 0:a.map,view:this.view});o[s]=i}})),i.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",o)}_getScreenPoint(e){const{view:t}=this;return t&&e&&"function"==typeof t.toScreen?t.toScreen(e):null}_autoOpenEnabledChange(){const e="auto-fetch-features",{_handles:t,autoOpenEnabled:s}=this;if(t.remove(e),s&&this.view){const s=this.view.on("click",(e=>{"mouse"===e.pointerType&&0!==e.button||this._fetchFeaturesAndOpen(e)}),v.WIDGET);t.add(s,e)}}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}_fetchFeaturesWithController(e,t){this._cancelFetchingFeatures();const s=new AbortController,{signal:i}=s;this._fetchFeaturesController=s,this.notifyChange("waitingForResult");const o=this.fetchFeatures(e,{signal:i,event:t});return o.catch((()=>{})).then((()=>{this._fetchFeaturesController=null,this.notifyChange("waitingForResult")})),o}_fetchFeaturesAndOpen(e){const{screenPoint:t,mapPoint:s}=e,{view:i}=this;this._fetchFeaturesWithController(t,e).then((e=>{const{clientOnlyGraphics:t,promisesPerLayerView:o,location:r}=e,n=[Promise.resolve(t),...o.map((e=>e.promise))];return i.popup.open({location:r||s,promises:n}),e}))}_updatePendingPromises(e){e&&this._pendingPromises.has(e)&&(this._pendingPromises.delete(e),this.notifyChange("pendingPromisesCount"))}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}_getPointFromGeometry(e){return a(e)?null:"point"===e.type?e:"extent"===e.type?e.center:"polygon"===e.type?e.centroid:"multipoint"===e.type||"polyline"===e.type?e.extent.center:null}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}async _highlightFeature(){const e="highlight";this._handles.remove(e);const{selectedFeature:t,highlightEnabled:s,view:i,visible:o}=this;if(!(t&&i&&s&&o))return;let{layer:r,sourceLayer:n}=t;if("map-notes"!==(null==n?void 0:n.type)&&"subtype-group"!==(null==n?void 0:n.type)||(r=n),!(r&&r instanceof g))return;const a=this._getLayerView(i,r);this._highlightPromise=a;const l=await a;if(!(l&&F(l)&&this._highlightPromise===a&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const u="imagery"===r.type?void 0:"objectIdField"in r&&r.objectIdField,h=t.attributes,c=h&&u&&h[u],p=l.highlight(c||t);this._handles.add(p,e)}_updateFeatures(e){const{features:t}=this;if(!e||!e.length)return;if(!t.length)return void(this.features=e);const s=e.filter((e=>-1===t.indexOf(e)));this.features=t.concat(s)}};e([c()],z.prototype,"featurePage",void 0),e([c()],z.prototype,"isLoadingFeature",null),e([c({type:T})],z.prototype,"actions",void 0),e([c({readOnly:!0})],z.prototype,"active",null),e([c({readOnly:!0})],z.prototype,"allActions",null),e([c({type:Boolean})],z.prototype,"defaultPopupTemplateEnabled",void 0),e([c()],z.prototype,"autoCloseEnabled",void 0),e([c()],z.prototype,"autoOpenEnabled",void 0),e([c()],z.prototype,"browseClusterEnabled",void 0),e([c()],z.prototype,"content",void 0),e([c({type:T,readOnly:!0})],z.prototype,"defaultActions",null),e([c({readOnly:!0})],z.prototype,"featureCount",null),e([c()],z.prototype,"features",null),e([c()],z.prototype,"featuresPerPage",void 0),e([c()],z.prototype,"featureViewModelAbilities",void 0),e([c({readOnly:!0})],z.prototype,"featureViewModels",void 0),e([c()],z.prototype,"highlightEnabled",void 0),e([c()],z.prototype,"includeDefaultActions",void 0),e([c({type:L})],z.prototype,"location",null),e([c({readOnly:!0})],z.prototype,"pendingPromisesCount",null),e([c({readOnly:!0})],z.prototype,"selectedClusterBoundaryFeature",void 0),e([c({readOnly:!0})],z.prototype,"waitingForResult",null),e([c({readOnly:!0})],z.prototype,"promiseCount",null),e([c()],z.prototype,"promises",null),e([c({value:null,readOnly:!0})],z.prototype,"selectedFeature",null),e([c({value:-1})],z.prototype,"selectedFeatureIndex",null),e([c({readOnly:!0})],z.prototype,"selectedFeatureViewModel",null),e([c({readOnly:!0})],z.prototype,"state",null),e([c()],z.prototype,"title",void 0),e([c()],z.prototype,"updateLocationEnabled",void 0),e([c()],z.prototype,"view",void 0),e([c()],z.prototype,"visible",void 0),e([c()],z.prototype,"zoomFactor",void 0),e([c()],z.prototype,"zoomToLocation",void 0),e([c()],z.prototype,"centerAtLocation",null),z=e([p(R)],z);const U=z;export{U as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import"../../geometry.js";import t from"../../Graphic.js";import"../../symbols.js";import s from"../../core/Collection.js";import i from"../../core/Error.js";import o from"../../core/Handles.js";import r from"../../core/Logger.js";import{unwrap as n,isNone as a}from"../../core/maybe.js";import{init as l,watch as u,whenFalse as h}from"../../core/watchUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{geographicToWebMercator as d}from"../../geometry/support/webMercatorUtils.js";import g from"../../layers/Layer.js";import f from"../../support/actions/ActionBase.js";import m from"../../support/actions/ActionButton.js";import y from"../../support/actions/ActionToggle.js";import{getDisplayedSymbol as w}from"../../symbols/support/symbolUtils.js";import{ViewEventPriorities as v}from"../../views/input/InputManager.js";import{highlightsSupported as F}from"../../views/support/layerViewUtils.js";import _ from"../Feature/FeatureViewModel.js";import{zoomToClusteredFeatures as b,browseClusteredFeatures as C,zoomToFeature as P}from"./actions.js";import{triggerAction as E,getSelectedTarget as A,removeClusteredFeaturesForBrowsing as M,displayClusterExtent as j,browseAggregateFeatures as V}from"./actionUtils.js";import O from"../support/AnchorElementViewModel.js";import{GoToMixin as x}from"../support/GoTo.js";import I from"../../symbols/SimpleFillSymbol.js";import L from"../../geometry/Point.js";const T=s.ofType({key:"type",defaultKeyValue:"button",base:f,typeMap:{button:m,toggle:y}}),S=()=>[P.clone()],B=()=>[b.clone(),C.clone()],R="esri.widgets.Popup.PopupViewModel",G=r.getLogger(R);let z=class extends(x(O)){constructor(e){super(e),this._handles=new o,this._pendingPromises=new Set,this._fetchFeaturesController=null,this._selectedClusterFeature=null,this.featurePage=null,this.actions=new T,this.defaultPopupTemplateEnabled=!1,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.featuresPerPage=20,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new t({symbol:new I({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null}get isLoadingFeature(){return this.featureViewModels.some((e=>e.waitingForContent))}initialize(){this._handles.add([l(this,["autoOpenEnabled","view"],(()=>this._autoOpenEnabledChange())),this.on("view-change",(()=>this._autoClose())),u(this,["highlightEnabled","selectedFeature","visible","view"],(()=>this._highlightFeature())),u(this,"view.animation.state",(e=>this._animationStateChange(e))),u(this,"location",(e=>this._locationChange(e))),u(this,"selectedFeature",(e=>this._selectedFeatureChange(e))),u(this,["selectedFeatureIndex","featureCount","featuresPerPage"],(()=>this._selectedFeatureIndexChange())),u(this,["featurePage","selectedFeatureIndex","featureCount","featuresPerPage, featureViewModels"],(()=>this._setGraphicOnFeatureViewModels())),u(this,"featureViewModels",(()=>this._featureViewModelsChange())),this.on("trigger-action",(e=>E({event:e,view:this.view}))),h(this,"waitingForResult",(()=>this._waitingForResultChange()),!0),u(this,["features","view","view.map","view.spatialReference"],(()=>this._updateFeatureVMs())),u(this,["view.scale"],this._viewScaleChange),h(this,"visible",(()=>this.browseClusterEnabled=!1)),u(this,"browseClusterEnabled",(e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing()))])}destroy(){this._cancelFetchingFeatures(),this._handles.destroy(),this._handles=null,this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new T;e.removeAll();const{actions:t,defaultActions:s,defaultPopupTemplateEnabled:i,includeDefaultActions:o,selectedFeature:r}=this,n=o?s.concat(t):t,a=r&&("function"==typeof r.getEffectivePopupTemplate&&r.getEffectivePopupTemplate(i)||r.popupTemplate),l=a&&a.actions,u=a&&a.overwriteActions?l:l?l.concat(n):n;return u&&u.filter(Boolean).forEach((t=>e.add(t))),e}get defaultActions(){var e;const t=this._get("defaultActions")||new T;return t.removeAll(),t.addMany(null!=(e=this.selectedFeature)&&e.isAggregate?B():S()),t}get featureCount(){return this.features.length}get features(){return this._get("features")||[]}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:s,promiseCount:i,selectedFeatureIndex:o}=this,r=i&&t.length;r&&s&&-1===o?this.selectedFeatureIndex=0:r&&-1!==o||(this.selectedFeatureIndex=t.length?0:-1)}get location(){return this._get("location")||null}set location(e){const t=this.get("view.spatialReference.isWebMercator");e&&e.get("spatialReference.isWGS84")&&t&&(e=d(e)),this._set("location",e)}get pendingPromisesCount(){return this._pendingPromises.size}get waitingForResult(){return!(!(!!this._fetchFeaturesController||this.pendingPromisesCount>0)||0!==this.featureCount)}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){if(this._pendingPromises.clear(),this.features=[],!Array.isArray(e)||!e.length)return this._set("promises",[]),void this.notifyChange("pendingPromisesCount");this._set("promises",e),(e=e.slice(0)).forEach((e=>{this._pendingPromises.add(e);const t=t=>{this._pendingPromises.has(e)&&this._updateFeatures(t),this._updatePendingPromises(e)},s=()=>this._updatePendingPromises(e);e.then(t,s)})),this.notifyChange("pendingPromisesCount")}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;if(-1===t)return null;return e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return"number"==typeof e?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){return this.get("view.ready")?"ready":"disabled"}centerAtLocation(){const{view:e}=this,t=A(this);if(!t){const s=new i("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e});return G.error(s),Promise.reject(s)}return this.callGoTo({target:{target:t,scale:e.scale}})}clear(){this.set({promises:[],features:[],content:null,title:null,location:null})}fetchFeatures(e,t){const{view:s}=this;if(!s||!e){const t=new i("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:s});return G.error(t),Promise.reject(t)}return s.fetchPopupFeatures(e,{event:t&&t.event,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t&&t.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:s}=t;delete t.fetchFeatures,s&&this._setFetchFeaturesPromises(t.location);const i=["actionsMenuOpen","collapsed","featureMenuOpen"];for(const o of i)delete t[o];this.set(t)}triggerAction(e){const t=this.allActions.getItemAt(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex=this.selectedFeatureIndex+1,this}previous(){return this.selectedFeatureIndex=this.selectedFeatureIndex-1,this}disableClusterBrowsing(){M(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){await j(this),await V(this)}_animationStateChange(e){this.zoomToLocation||(P.disabled="waiting-for-target"===e)}_clearBrowsedClusterGraphics(){var e;const t=null==(e=this.view)?void 0:e.graphics;t&&(t.remove(this.selectedClusterBoundaryFeature),t.remove(this._selectedClusterFeature)),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){var e;if(null!=(e=this.selectedFeature)&&e.isAggregate)return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.browseClusterEnabled=!1,this.features=[this.selectedFeature])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:s}=this;s&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:s,featuresPerPage:i,featureViewModels:o}=this;if(null===s)return;const r=((s-1)*i+t)%t,n=r+i;o.slice(r,n).forEach(((t,s)=>{t&&!t.graphic&&(t.graphic=e[r+s])}))}async _selectedFeatureChange(e){if(!e)return;const{location:t,updateLocationEnabled:s,view:i}=this;if(this.browseClusterEnabled){if(this._selectedClusterFeature&&(i.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),e.isAggregate)return;return e.symbol=await w(e),this._selectedClusterFeature=e,void i.graphics.add(this._selectedClusterFeature)}!s&&t||!e.geometry?s&&!e.geometry&&this.centerAtLocation().then((()=>{this.location=i.center.clone()})):this.location=n(this._getPointFromGeometry(e.geometry))}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}_setFetchFeaturesPromises(e){return this._fetchFeaturesWithController(this._getScreenPoint(e||this.location)).then((e=>{const{clientOnlyGraphics:t,promisesPerLayerView:s}=e,i=Promise.resolve(t),o=s.map((e=>e.promise));this.promises=[i,...o]}))}_destroyFeatureVMs(){this.featureViewModels.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:s}=this;if(null!=e&&e.isAggregate||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t||!t.length)return;const i=s.slice(0),o=[];t.forEach(((t,s)=>{if(!t)return;let r=null;if(i.some(((e,s)=>(e&&e.graphic===t&&(r=e,i.splice(s,1)),!!r))),r)o[s]=r;else{var n,a;const i=new _({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:null==(n=this.view)?void 0:n.spatialReference,graphic:t===e?t:null,map:null==(a=this.view)?void 0:a.map,view:this.view});o[s]=i}})),i.forEach((e=>e&&!e.destroyed&&e.destroy())),this._set("featureViewModels",o)}_getScreenPoint(e){const{view:t}=this;return t&&e&&"function"==typeof t.toScreen?t.toScreen(e):null}_autoOpenEnabledChange(){const e="auto-fetch-features",{_handles:t,autoOpenEnabled:s}=this;if(t.remove(e),s&&this.view){const s=this.view.on("click",(e=>{"mouse"===e.pointerType&&0!==e.button||this._fetchFeaturesAndOpen(e)}),v.WIDGET);t.add(s,e)}}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}_fetchFeaturesWithController(e,t){this._cancelFetchingFeatures();const s=new AbortController,{signal:i}=s;this._fetchFeaturesController=s,this.notifyChange("waitingForResult");const o=this.fetchFeatures(e,{signal:i,event:t});return o.catch((()=>{})).then((()=>{this._fetchFeaturesController=null,this.notifyChange("waitingForResult")})),o}_fetchFeaturesAndOpen(e){const{screenPoint:t,mapPoint:s}=e,{view:i}=this;this._fetchFeaturesWithController(t,e).then((e=>{const{clientOnlyGraphics:t,promisesPerLayerView:o,location:r}=e,n=[Promise.resolve(t),...o.map((e=>e.promise))];return i.popup.open({location:r||s,promises:n}),e}))}_updatePendingPromises(e){e&&this._pendingPromises.has(e)&&(this._pendingPromises.delete(e),this.notifyChange("pendingPromisesCount"))}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}_getPointFromGeometry(e){return a(e)?null:"point"===e.type?e:"extent"===e.type?e.center:"polygon"===e.type?e.centroid:"multipoint"===e.type||"polyline"===e.type?e.extent.center:null}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}async _highlightFeature(){const e="highlight";this._handles.remove(e);const{selectedFeature:t,highlightEnabled:s,view:i,visible:o}=this;if(!(t&&i&&s&&o))return;let{layer:r,sourceLayer:n}=t;if("map-notes"!==(null==n?void 0:n.type)&&"subtype-group"!==(null==n?void 0:n.type)||(r=n),!(r&&r instanceof g))return;const a=this._getLayerView(i,r);this._highlightPromise=a;const l=await a;if(!(l&&F(l)&&this._highlightPromise===a&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const u="imagery"===r.type?void 0:"objectIdField"in r&&r.objectIdField,h=t.attributes,c=h&&u&&h[u],p=l.highlight(c||t);this._handles.add(p,e)}_updateFeatures(e){const{features:t}=this;if(!e||!e.length)return;if(!t.length)return void(this.features=e);const s=e.filter((e=>-1===t.indexOf(e)));this.features=t.concat(s)}};e([c()],z.prototype,"featurePage",void 0),e([c()],z.prototype,"isLoadingFeature",null),e([c({type:T})],z.prototype,"actions",void 0),e([c({readOnly:!0})],z.prototype,"active",null),e([c({readOnly:!0})],z.prototype,"allActions",null),e([c({type:Boolean})],z.prototype,"defaultPopupTemplateEnabled",void 0),e([c()],z.prototype,"autoCloseEnabled",void 0),e([c()],z.prototype,"autoOpenEnabled",void 0),e([c()],z.prototype,"browseClusterEnabled",void 0),e([c()],z.prototype,"content",void 0),e([c({type:T,readOnly:!0})],z.prototype,"defaultActions",null),e([c({readOnly:!0})],z.prototype,"featureCount",null),e([c()],z.prototype,"features",null),e([c()],z.prototype,"featuresPerPage",void 0),e([c()],z.prototype,"featureViewModelAbilities",void 0),e([c({readOnly:!0})],z.prototype,"featureViewModels",void 0),e([c()],z.prototype,"highlightEnabled",void 0),e([c()],z.prototype,"includeDefaultActions",void 0),e([c({type:L})],z.prototype,"location",null),e([c({readOnly:!0})],z.prototype,"pendingPromisesCount",null),e([c({readOnly:!0})],z.prototype,"selectedClusterBoundaryFeature",void 0),e([c({readOnly:!0})],z.prototype,"waitingForResult",null),e([c({readOnly:!0})],z.prototype,"promiseCount",null),e([c()],z.prototype,"promises",null),e([c({value:null,readOnly:!0})],z.prototype,"selectedFeature",null),e([c({value:-1})],z.prototype,"selectedFeatureIndex",null),e([c({readOnly:!0})],z.prototype,"selectedFeatureViewModel",null),e([c({readOnly:!0})],z.prototype,"state",null),e([c()],z.prototype,"title",void 0),e([c()],z.prototype,"updateLocationEnabled",void 0),e([c()],z.prototype,"view",void 0),e([c()],z.prototype,"visible",void 0),e([c()],z.prototype,"zoomFactor",void 0),e([c()],z.prototype,"zoomToLocation",void 0),e([c()],z.prototype,"centerAtLocation",null),z=e([p(R)],z);const U=z;export{U as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import t from"../../core/Logger.js";import{throwIfNotAbortError as r}from"../../core/promiseUtils.js";import{zoomToFeature as i,zoomToClusteredFeatures as o,browseClusteredFeatures as n,removeSelectedFeature as a}from"./actions.js";const s="esri.widgets.Popup.PopupViewModel",c=t.getLogger(s),u=function(t){const{event:s,view:c}=t,{action:u}=s,d=c&&c.popup;if(!u)return Promise.reject(new e("trigger-action:missing-arguments","Event has no action"));if(!d)return Promise.reject(new e("trigger-action:missing-arguments","view.popup is missing"));const{disabled:l,id:v}=u;if(!v)return Promise.reject(new e("trigger-action:invalid-action","action.id is missing"));if(l)return Promise.reject(new e("trigger-action:invalid-action","Action is disabled"));if(v===i.id)return g(d.viewModel).catch(r);if(v===o.id)return w(d.viewModel);if(v===n.id)return d.featureMenuOpen=!d.featureMenuOpen,d.viewModel.browseClusterEnabled=!d.viewModel.browseClusterEnabled,Promise.resolve();if(d.viewModel.browseClusterEnabled=!1,v===a.id){d.close();const{selectedFeature:t}=d;if(!t)return Promise.reject(new e(`trigger-action:${a.id}`,"selectedFeature is required",{selectedFeature:t}));const{sourceLayer:r}=t;return r?r.remove(t):c.graphics.remove(t),Promise.resolve()}return Promise.resolve()};function d(e){const{selectedFeature:t,location:r,view:i}=e;if(!i)return null;if("3d"===i.type)return t||r;return e.get("selectedFeature.geometry")||r}function l(t,r){if("3d"!==(null==r?void 0:r.type)||!t||"esri.Graphic"!==t.declaredClass)return!0;const i=r.getViewForGraphic(t);if(i&&"whenGraphicBounds"in i){let r=!1;return i.whenGraphicBounds(t,{useViewElevation:!0}).then((e=>{r=!e||!e.boundingBox||e.boundingBox[0]===e.boundingBox[3]&&e.boundingBox[1]===e.boundingBox[4]&&e.boundingBox[2]===e.boundingBox[5]})).catch((()=>{const r=new e("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:t});c.error(r)})),r}return!0}async function g(t){const{location:r,selectedFeature:o,view:n,zoomFactor:a}=t,s=d(t);if(!s){const t=new e("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:s,view:n});return c.error(t),Promise.reject(t)}const u=n.scale/a,g=t.get("selectedFeature.geometry")||r,w=g&&"point"===g.type&&l(o,n);i.active=!0,i.disabled=!0;try{await t.view.goTo({target:s,scale:w?u:void 0})}finally{i.active=!1,i.disabled=!1,t.zoomToLocation=null,w&&(t.location=g)}}async function w(t){const{selectedFeature:r,view:i}=t;if("2d"!==(null==i?void 0:i.type)){const t=new e("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw c.error(t),t}if(!r.isAggregate){const t=new e("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:r});throw c.error(t),t}const n=r.sourceLayer,a=await i.whenLayerView(n),s=a.createQuery();s.aggregateIds=[r.getObjectId()],o.active=!0,o.disabled=!0;const{extent:u}=await a.queryExtent(s);await i.goTo({target:u}),o.active=!1,o.disabled=!1}async function v(t){const{selectedFeature:r,view:i}=t;if("2d"!==(null==i?void 0:i.type)){const t=new e("displayClusterExtent:invalid-view","View must be 2d MapView.",{view:i});throw c.error(t),t}if(!r.isAggregate){const t=new e("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:r});throw c.error(t),t}const o=r.sourceLayer,n=await i.whenLayerView(o),a=n.createQuery();a.aggregateIds=[r.getObjectId()];const{extent:s}=await n.queryExtent(a);t.selectedClusterBoundaryFeature.geometry=s,i.graphics.add(t.selectedClusterBoundaryFeature)}async function p(t){const{selectedFeature:r,view:i}=t;if("2d"!==(null==i?void 0:i.type)){const t=new e("browseAggregateFeatures:invalid-view","View must be 2d MapView.",{view:i});throw c.error(t),t}if(!r.isAggregate){const t=new e("browseAggregateFeatures:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:r});throw c.error(t),t}const o=r.sourceLayer,a=await i.whenLayerView(o),s=a.createQuery();s.aggregateIds=[r.getObjectId()],n.active=!0,n.disabled=!0;const{features:u}=await a.queryFeatures(s);n.active=!1,n.disabled=!1,i.popup.open({features:[r].concat(u),featureMenuOpen:!0})}function f(e){e.features=e.features.filter((e=>e.isAggregate))}export{p as browseAggregateFeatures,v as displayClusterExtent,d as getSelectedTarget,l as isZoomScreenSize,f as removeClusteredFeaturesForBrowsing,u as triggerAction,w as zoomToClusterExtent,g as zoomToLocation};
|
|
5
|
+
import e from"../../core/Error.js";import t from"../../core/Logger.js";import{throwIfNotAbortError as r}from"../../core/promiseUtils.js";import{zoomToFeature as i,zoomToClusteredFeatures as o,browseClusteredFeatures as n,removeSelectedFeature as a}from"./actions.js";const s="esri.widgets.Popup.PopupViewModel",c=t.getLogger(s),u=function(t){const{event:s,view:c}=t,{action:u}=s,d=c&&c.popup;if(!u)return Promise.reject(new e("trigger-action:missing-arguments","Event has no action"));if(!d)return Promise.reject(new e("trigger-action:missing-arguments","view.popup is missing"));const{disabled:l,id:v}=u;if(!v)return Promise.reject(new e("trigger-action:invalid-action","action.id is missing"));if(l)return Promise.reject(new e("trigger-action:invalid-action","Action is disabled"));if(v===i.id)return g(d.viewModel).catch(r);if(v===o.id)return w(d.viewModel);if(v===n.id)return d.featureMenuOpen=!d.featureMenuOpen,d.viewModel.browseClusterEnabled=!d.viewModel.browseClusterEnabled,Promise.resolve();if(d.viewModel.browseClusterEnabled=!1,v===a.id){d.close();const{selectedFeature:t}=d;if(!t)return Promise.reject(new e(`trigger-action:${a.id}`,"selectedFeature is required",{selectedFeature:t}));const{sourceLayer:r}=t;return r?r.remove(t):c.graphics.remove(t),Promise.resolve()}return Promise.resolve()};function d(e){const{selectedFeature:t,location:r,view:i}=e;if(!i)return null;if("3d"===i.type)return t||r;return e.get("selectedFeature.geometry")||r}function l(t,r){if("3d"!==(null==r?void 0:r.type)||!t||"esri.Graphic"!==t.declaredClass)return!0;const i=r.getViewForGraphic(t);if(i&&"whenGraphicBounds"in i){let r=!1;return i.whenGraphicBounds(t,{useViewElevation:!0}).then((e=>{r=!e||!e.boundingBox||e.boundingBox[0]===e.boundingBox[3]&&e.boundingBox[1]===e.boundingBox[4]&&e.boundingBox[2]===e.boundingBox[5]})).catch((()=>{const r=new e("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:t});c.error(r)})),r}return!0}async function g(t){const{location:r,selectedFeature:o,view:n,zoomFactor:a}=t,s=d(t);if(!s){const t=new e("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:s,view:n});return c.error(t),Promise.reject(t)}const u=n.scale/a,g=t.get("selectedFeature.geometry")||r,w=g&&"point"===g.type&&l(o,n);i.active=!0,i.disabled=!0;try{await t.view.goTo({target:s,scale:w?u:void 0})}finally{i.active=!1,i.disabled=!1,t.zoomToLocation=null,w&&(t.location=g)}}async function w(t){const{selectedFeature:r,view:i}=t;if("2d"!==(null==i?void 0:i.type)){const t=new e("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw c.error(t),t}if(!r.isAggregate){const t=new e("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:r});throw c.error(t),t}const n=r.sourceLayer,a=await i.whenLayerView(n),s=a.createQuery();s.aggregateIds=[r.getObjectId()],o.active=!0,o.disabled=!0;const{extent:u}=await a.queryExtent(s);await i.goTo({target:u}),o.active=!1,o.disabled=!1}async function v(t){const{selectedFeature:r,view:i}=t;if("2d"!==(null==i?void 0:i.type)){const t=new e("displayClusterExtent:invalid-view","View must be 2d MapView.",{view:i});throw c.error(t),t}if(!r.isAggregate){const t=new e("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:r});throw c.error(t),t}const o=r.sourceLayer,n=await i.whenLayerView(o),a=n.createQuery();a.aggregateIds=[r.getObjectId()];const{extent:s}=await n.queryExtent(a);t.selectedClusterBoundaryFeature.geometry=s,i.graphics.add(t.selectedClusterBoundaryFeature)}async function p(t){const{selectedFeature:r,view:i}=t;if("2d"!==(null==i?void 0:i.type)){const t=new e("browseAggregateFeatures:invalid-view","View must be 2d MapView.",{view:i});throw c.error(t),t}if(!r.isAggregate){const t=new e("browseAggregateFeatures:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:r});throw c.error(t),t}const o=r.sourceLayer,a=await i.whenLayerView(o),s=a.createQuery();s.aggregateIds=[r.getObjectId()],n.active=!0,n.disabled=!0;const{features:u}=await a.queryFeatures(s);n.active=!1,n.disabled=!1,i.popup.open({features:[r].concat(u),featureMenuOpen:!0})}function f(e){var t;null!=(t=e.selectedFeature)&&t.isAggregate&&(e.features=e.features.filter((e=>e.isAggregate)))}export{p as browseAggregateFeatures,v as displayClusterExtent,d as getSelectedTarget,l as isZoomScreenSize,f as removeClusteredFeaturesForBrowsing,u as triggerAction,w as zoomToClusterExtent,g as zoomToLocation};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../Graphic.js";import{unwrap as o,isSome as t}from"../../../core/maybe.js";import r from"../../../geometry/Polygon.js";import{addressToLocations as s}from"../../../rest/locator/addressToLocations.js";import{locationToAddress as n}from"../../../rest/locator/locationToAddress.js";import{suggestLocations as i}from"../../../rest/locator/suggestLocations.js";import c from"../../../rest/support/AddressToLocationsParameters.js";import a from"../../../rest/support/LocationToAddressParameters.js";import l from"../../../rest/support/SuggestLocationsParameters.js";import{createExtentFromGeometry as u,scaleExtent as m}from"./geometryUtils.js";const f="Single Line Input",d=3e5;function g(e,o){return e.location?
|
|
5
|
+
import e from"../../../Graphic.js";import{unwrap as o,isSome as t}from"../../../core/maybe.js";import r from"../../../geometry/Polygon.js";import{addressToLocations as s}from"../../../rest/locator/addressToLocations.js";import{locationToAddress as n}from"../../../rest/locator/locationToAddress.js";import{suggestLocations as i}from"../../../rest/locator/suggestLocations.js";import c from"../../../rest/support/AddressToLocationsParameters.js";import a from"../../../rest/support/LocationToAddressParameters.js";import l from"../../../rest/support/SuggestLocationsParameters.js";import{createExtentFromGeometry as u,scaleExtent as m}from"./geometryUtils.js";const f="Single Line Input",d=3e5;function g(e,o){return e.location?h(e,o):I(e,o)}function p(e,o){if(o.localSearchDisabled)return null;const t=null==e?void 0:e.scale;return"number"==typeof t&&t<=d?e.get("extent.center"):null}function y(e,t){const{source:r,spatialReference:s,view:n,suggestTerm:c,maxSuggestions:a,sourceIndex:u}=e,m=new l,{apiKey:f,url:d}=r,g=j(r,n),y=t&&t.signal;if(!d)return Promise.resolve(null);f&&(m.apiKey=f),r.categories&&(m.categories=r.categories),s&&(m.outSpatialReference=s);const x=p(n,r);x&&(m.location=x);if(!c.trim())return Promise.resolve(null);const{prefix:v="",suffix:S=""}=r,w=`${v}${c}${S}`;return m.text=w,g&&(m.searchExtent=o(g)),m.maxSuggestions=a,r.countryCode&&(m.countryCode=r.countryCode),i(d,m,{signal:y}).then((e=>b(e,u)))}function x(e){return!!e&&/(?:geocode\-api\.arcgis\.com\/arcgis\/rest\/services\/world\/geocodeserver).*/gi.test(e)}function v(e){return!!e&&/(?:\/servers\/[\da-z\.-]+\/rest\/services\/world\/geocodeserver).*/gi.test(e)}function S(e){return!!e&&/(?:arcgis\.com\/arcgis\/rest\/services\/world\/geocodeserver).*/gi.test(e)}const w="https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer";function h(e,o){const{source:t,spatialReference:r,location:s,sourceIndex:i,view:c}=e,{apiKey:l,url:u,zoomScale:m,defaultZoomScale:f}=t,d=c&&c.scale,g=o&&o.signal,p=new a;return p.location=s,l&&(p.apiKey=l),r&&(p.outSpatialReference=r),n(u,p,{signal:g}).then((e=>L([e],{sourceIndex:i,scale:d,view:c,zoomScale:m,defaultZoomScale:f}))).catch((()=>[]))}function j(e,o){const{filter:t,withinViewEnabled:r}=e,s=o&&o.scale,n=o&&o.extent,i=t&&t.geometry;return u(i,o,s)||(r&&n?n:void 0)}function I(e,t){const{source:r,suggestResult:n,spatialReference:i,view:a,maxResults:l,sourceIndex:u}=e,m=r&&r.zoomScale,d=r&&r.defaultZoomScale;if(!n.text.trim())return Promise.resolve(null);const g=!n.key&&r.prefix?r.prefix:"",y=!n.key&&r.suffix?r.suffix:"",x=`${g}${n.text}${y}`,v=new c,{apiKey:S,url:w}=r,h=a&&a.scale,I=j(r,a),$=t&&t.signal;if(S&&(v.apiKey=S),!w)return Promise.resolve(null);r.categories&&(v.categories=r.categories),r.locationType&&(v.locationType=r.locationType),i&&(v.outSpatialReference=i);const b=p(a,r);b&&(v.location=b),v.maxLocations=l,I&&(v.searchExtent=o(I)),r.countryCode&&(v.countryCode=r.countryCode);const{key:K}=n,P=`${K}`;return K&&(v.magicKey=P),v.address={},v.address[r.singleLineFieldName||f]=x,r.outFields&&(v.outFields=r.outFields),s(w,v,{signal:$}).then((e=>L(e,{key:P,scale:h,sourceIndex:u,view:a,zoomScale:m,defaultZoomScale:d})))}function $(e,o){return{text:e.text,key:e.magicKey,sourceIndex:o}}function b(e,o){return e.map((e=>$(e,o)))}function K(o,s){const{key:n,scale:i,sourceIndex:c,view:a,zoomScale:l,defaultZoomScale:f}=s,{attributes:d,extent:g,location:p,address:y}=o,x=new e({geometry:p,attributes:d}),v=g||p,S=u(v,a,i),w="number"==typeof l?m(S,a,l):"number"==typeof f&&"point"===v.type?m(S,a,f):S,h=p?`${p.x},${p.y}`:"",j=y||h,I=x.clone();return t(w)&&(I.geometry=r.fromExtent(w)),{extent:w,feature:x,target:I,key:n,name:j,sourceIndex:c}}function L(e,o){return e.filter(Boolean).map((e=>K(e,o)))}export{p as getLocation,g as getResults,y as getSuggestions,S as isArcGISWorldGeocoder,x as isMeteredArcGISWorldGeocoder,v as isProxiedArcGISWorldGeocoder,w as meteredArcGISLocatorUrl};
|
package/widgets/Search.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{eventKey as t}from"../core/events.js";import s from"../core/Handles.js";import{escapeRegExpString as i}from"../core/string.js";import{watch as r,on as n,init as o}from"../core/watchUtils.js";import{aliasOf as a}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import c from"./Widget.js";import d from"./Search/SearchResultRenderer.js";import h from"./Search/SearchViewModel.js";import{storeNode as g,keepMenuItemWithinView as p,isActivationKey as _}from"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import"../core/Logger.js";import{vmEvent as v}from"./support/decorators/vmEvent.js";import{tsx as M}from"./support/jsxFactory.js";import{substitute as I}from"../intl/substitute.js";const w={base:"esri-search esri-widget",loader:"esri-widget__loader",loaderText:"esri-widget__loader-text",loaderAnimation:"esri-widget__loader-animation",esriInput:"esri-input",hasMultipleSources:"esri-search--multiple-sources",isLoading:"esri-search--loading",isSearching:"esri-search--searching",showSuggestions:"esri-search--show-suggestions",showSources:"esri-search--sources",showWarning:"esri-search--warning",container:"esri-search__container",input:"esri-search__input",inputContainer:"esri-search__input-container",form:"esri-search__form",submitButton:"esri-search__submit-button",sourcesButton:"esri-search__sources-button",clearButton:"esri-search__clear-button",sourceName:"esri-search__source-name",suggestionsMenu:"esri-search__suggestions-menu",suggestionList:"esri-search__suggestions-list",suggestionListCurrentLocation:"esri-search__suggestions-list--current-location",sourcesMenu:"esri-search__sources-menu",source:"esri-search__source",warningMenu:"esri-search__warning-menu",warningMenuBody:"esri-search__warning-body",warningMenuHeader:"esri-search__warning-header",warningMenuText:"esri-search__warning-text",noValueText:"esri-search__no-value-text",esriWidgetDisabled:"esri-widget--disabled",button:"esri-widget--button",fallbackText:"esri-icon-font-fallback-text",header:"esri-widget__heading",locate:"esri-icon-locate-circled",menu:"esri-menu",menuList:"esri-menu__list",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuHeader:"esri-menu__header",loadingIcon:"esri-icon-loading-indicator esri-rotating",searchIcon:"esri-icon-search",dropdownIcon:"esri-icon-down-arrow esri-search__sources-button--down",dropupIcon:"esri-icon-up-arrow esri-search__sources-button--up",clearIcon:"esri-icon-close",noticeIcon:"esri-icon-notice-triangle",widgetIcon:"esri-icon-search",disabled:"esri-disabled"},S=/<[a-z/][\s\S]*>/i;let b=class extends c{constructor(e,t){super(e,t),this._activeMenuItemIndex=-1,this._handles=new s,this._inputNode=null,this._menuItemCount=0,this._sourceMenuButtonNode=null,this._sourceListNode=null,this._suggestionListNode=null,this._searchResultRenderer=new d,this._locateFailed=null,this._container=null,this.activeMenu="none",this.activeSource=null,this.activeSourceIndex=null,this.allPlaceholder=null,this.allSources=null,this.autoNavigate=null,this.autoSelect=null,this.defaultSources=null,this.disabled=!1,this.goToOverride=null,this.iconClass=w.widgetIcon,this.includeDefaultSources=null,this.label=void 0,this.locationEnabled=null,this.maxResults=null,this.maxSuggestions=null,this.messages=null,this.messagesCommon=null,this.minSuggestCharacters=null,this.popupEnabled=null,this.popupTemplate=null,this.portal=null,this.resultGraphic=null,this.resultGraphicEnabled=null,this.results=null,this.searchAllEnabled=null,this.searchTerm=null,this.selectedResult=null,this.sources=null,this.suggestions=null,this.suggestionsEnabled=null,this.view=null,this.viewModel=new h,this._clearActiveMenu=()=>{this.activeMenu="none"},this._removeActiveMenu=e=>{var t;const s=e.relatedTarget;s&&null!=(t=this._container)&&t.contains(s)||this._clearActiveMenu()},this.own(r(this,"searchTerm",(e=>{(e&&"warning"===this.activeMenu||!e&&!this.get("viewModel.selectedSuggestion.location"))&&this._clearActiveMenu()})),n(this,"viewModel.allSources","change",(()=>this._watchSourceChanges())),o(this,"activeMenu",(()=>this._resetActiveMenuItemIndex())),o(this,"viewModel.defaultPopupTemplate",(e=>{e&&(e.content=this._renderSearchResultsContent.bind(this))})))}destroy(){this._handles.destroy(),this._handles=null,this._cancelSuggest(),this._cancelSearch(),this._searchResultRenderer&&(this._searchResultRenderer.viewModel=null,this._searchResultRenderer.destroy(),this._searchResultRenderer=null)}get displayedSearchTerm(){return`${this.viewModel.searchTerm}`.trim()}get inputId(){return this._buildId("input")}get suggestionsMenuId(){return this._buildId("suggest-menu")}get sourceMenuId(){return this._buildId("source-menu")}get sourceMenuButtonId(){return this._buildId("source-menu-button")}clear(){}focus(){var e;null==(e=this._inputNode)||e.focus(),this.emit("search-focus")}blur(){var e;null==(e=this._inputNode)||e.blur(),this.emit("search-blur")}search(e){this._clearActiveMenu(),this._cancelSuggest(),this._cancelSearch();const t=new AbortController,{signal:s}=t;return this._searchController=t,this.viewModel.search(e,{signal:s}).catch((e=>{if(this._searchController===t)return this._clearActiveMenu(),this._searchController=null,e})).then((e=>{if(this._searchController===t)return this.activeMenu=e.numResults?"none":"warning",this._searchController=null,e}))}suggest(e){this._cancelSuggest();const t=new AbortController,{signal:s}=t;return this._suggestController=t,this.viewModel.suggest(e,null,{signal:s}).then((e=>{if(this._suggestController===t)return this._suggestController=null,e.numResults&&this._openSuggestionMenu(),this._scrollToTopSuggestion(),e})).catch((()=>{if(this._suggestController===t)return this._suggestController=null,null}))}render(){const{state:e}=this.viewModel,t={[w.disabled]:"disabled"===e,[w.esriWidgetDisabled]:this.disabled};return M("div",{class:this.classes(w.base,t)},"loading"===e?this.renderLoader():this.renderContainer())}renderSubmitButton(){const{messages:e}=this;return M("button",{"aria-label":e.searchButtonTitle,bind:this,class:this.classes(w.submitButton,w.button),key:"esri-search__submit-button",onclick:this._handleSearchButtonClick,title:e.searchButtonTitle,type:"button"},M("span",{"aria-hidden":"true",class:w.searchIcon}))}renderWarningMenu(){return M("div",{key:"esri-search__error-menu",class:this.classes(w.menu,w.warningMenu)},M("div",{class:w.warningMenuBody},this.renderWarning()))}renderSourceMenuButton(){const{messages:e,activeMenu:t,sourceMenuId:s,sourceMenuButtonId:i}=this,{activeSourceIndex:r,allSources:n}=this.viewModel;return n.length>1?M("button",{id:i,key:"esri-search__source-menu-button",bind:this,"aria-label":e.searchIn,title:e.searchIn,"aria-haspopup":"true","aria-expanded":("source"===t).toString(),"aria-controls":s,class:this.classes(w.sourcesButton,w.button),onclick:this._handleSourcesMenuToggleClick,onfocus:this._clearActiveMenu,afterCreate:g,"data-node-ref":"_sourceMenuButtonNode",type:"button"},M("span",{"aria-hidden":"true",class:w.dropdownIcon}),M("span",{"aria-hidden":"true",class:w.dropupIcon}),M("span",{class:w.sourceName},this._getSourceName(r))):null}renderSourcesList(){const{allSources:e,searchAllEnabled:t}=this.viewModel,{_activeMenuItemIndex:s,activeMenu:i,sourceMenuId:r,sourceMenuButtonId:n}=this,o="source"===i&&s>-1?this._buildId("source-item",s):null;return e.length>1?M("ul",{"aria-activedescendant":o,"aria-labelledby":n,id:r,role:"menu",bind:this,afterCreate:g,onkeydown:this._handleSourceMenuKeydown,onkeyup:this._handleSourceMenuKeyup,"data-node-ref":"_sourceListNode",class:w.menuList,tabIndex:-1},t?this.renderSource(h.ALL_INDEX):null,e.map(((e,t)=>this.renderSource(t))).toArray()):null}renderSourcesMenu(){const{allSources:e}=this.viewModel;return e.length>1?M("div",{key:"esri-search__source-menu",class:this.classes(w.menu,w.sourcesMenu)},this.renderSourcesList()):null}renderLoader(){const{messages:e,messagesCommon:t}=this;return M("div",{class:w.loader,key:"base-loader"},M("span",{"aria-hidden":"true",class:w.loaderAnimation}),M("span",{class:w.fallbackText},e.searchButtonTitle),M("span",{class:w.loaderText},t.loading))}renderContainer(){const{allSources:e,state:t}=this.viewModel,{activeMenu:s}=this,i={[w.hasMultipleSources]:e.length>1,[w.isLoading]:"loading"===t,[w.isSearching]:"searching"===t,[w.showWarning]:"warning"===s,[w.showSources]:"source"===s,[w.showSuggestions]:"suggestion"===s};return M("div",{tabIndex:-1,afterCreate:e=>{this._container=e,e.addEventListener("focusout",this._removeActiveMenu)},afterRemoved:e=>{e.removeEventListener("focusout",this._removeActiveMenu)},class:this.classes(i,w.container),key:"base-container"},this.renderSourceMenuButton(),this.renderSourcesMenu(),this.renderInputContainer(),this.renderSubmitButton(),this.renderWarningMenu())}renderClearButton(){return this.searchTerm?M("button",{bind:this,class:this.classes(w.clearButton,w.button),key:"esri-search__clear-button",onclick:this._handleClearButtonClick,onfocus:this._clearActiveMenu,title:this.messages.clearButtonTitle,type:"button"},M("span",{"aria-hidden":"true",class:w.clearIcon})):null}renderLocationGroup(){const{messages:e,locationEnabled:t,displayedSearchTerm:s}=this,i=t&&!s,r="suggestion"===this.activeMenu&&0===this._activeMenuItemIndex;return i?M("ul",{role:"group",key:"esri-search__suggestion-list-current-location",class:this.classes(w.menuList,w.suggestionList,w.suggestionListCurrentLocation)},M("li",{bind:this,"data-current-location-item":!0,onclick:this._handleUseCurrentLocationClick,id:this._buildId("suggestion-item",0),"aria-selected":("suggestion"===this.activeMenu&&0===this._activeMenuItemIndex).toString(),role:"option",class:this.classes(w.menuItem,r?w.menuItemFocus:null)},M("span",{"aria-hidden":"true",class:w.locate})," ",e.useCurrentLocation)):null}renderInput(){const{activeMenu:e,locationEnabled:t,displayedSearchTerm:s,messages:i,suggestionsMenuId:r,inputId:n,_activeMenuItemIndex:o}=this,{maxInputLength:a,placeholder:u,searchTerm:l,suggestionCount:c}=this.viewModel,d=!(!(t&&!s)&&!c),h="suggestion"===e&&o>-1?this._buildId("suggestion-item",o):null;return M("input",{"aria-activedescendant":h,"aria-autocomplete":"list","aria-expanded":(d&&"suggestion"===e).toString(),"aria-controls":d?r:null,"aria-haspopup":"listbox","aria-label":i.searchButtonTitle,bind:this,placeholder:u,maxlength:a,autocomplete:"off",type:"text",class:this.classes(w.esriInput,w.input),value:l,id:n,role:"combobox",onkeyup:this._handleInputKeyup,onclick:this._openSuggestionMenu,oninput:this._handleInputPaste,onpaste:this._handleInputPaste,afterCreate:g,"data-node-ref":"_inputNode",onfocus:this.focus,onblur:this.blur,title:l?"":u})}renderForm(){return M("form",{key:"esri-search__form",bind:this,class:w.form,onsubmit:this._formSubmit,role:"search"},this.renderInput())}renderSuggestList(e){const{sourceIndex:t}=e,s=e.results.length,i=e.results;return s?M("ul",{role:"group",key:`esri-search__suggestion-list-${t}`,class:this.classes(w.menuList,w.suggestionList)},i.map((e=>this.renderSuggestion(e,this._menuItemCount++)))):null}renderSuggestionsGroup(){const{suggestions:e}=this.viewModel;return e?e.map((e=>[this.renderSuggestionHeader(e),this.renderSuggestList(e)])):null}renderSuggestionsMenu(){const{displayedSearchTerm:e,locationEnabled:t,suggestionsMenuId:s,inputId:i}=this,{suggestionCount:r}=this.viewModel,n=t&&!e||r;return this._menuItemCount=0,n?M("div",{id:s,key:"esri-search__suggestions-menu",class:this.classes(w.menu,w.suggestionsMenu),role:"listbox","aria-labelledby":i,bind:this,afterCreate:g,"data-node-ref":"_suggestionListNode"},this.renderLocationGroup(),this.renderSuggestionsGroup()):null}renderInputContainer(){return M("div",{key:"esri-search__input-container",class:w.inputContainer},this.renderForm(),this.renderSuggestionsMenu(),this.renderClearButton())}renderSuggestionHeader(e){const{allSources:t,activeSourceIndex:s}=this.viewModel,{sourceIndex:i}=e,r=e.results.length,n=t.length>1&&s===h.ALL_INDEX;return r&&n?M("div",{key:`esri-search__suggestion-header-${i}`,class:w.menuHeader},this._getSourceName(i)):null}renderSuggestion(e,t){const{_activeMenuItemIndex:s,messages:i}=this,{searchTerm:r}=this.viewModel;if(r){const{text:n}=e,o=n||i.untitledResult,a=S.test(o),u=[];if(a)u.push(M("div",{innerHTML:o}));else{const e=this._splitResult(o,r),t=r.toLowerCase();e.forEach(((e,s)=>{e&&e.length&&(e.toLowerCase()===t?u.push(M("strong",{key:s},e)):u.push(e))}))}const l="suggestion"===this.activeMenu&&s===t;return M("li",{bind:this,id:this._buildId("suggestion-item",t),"aria-selected":("suggestion"===this.activeMenu&&this._activeMenuItemIndex===t).toString(),onclick:this._handleSuggestionClick,key:`esri-search__suggestion_${t}`,"data-suggestion":e,role:"option",class:this.classes(w.menuItem,l?w.menuItemFocus:null)},u)}}renderSource(e){const{activeSourceIndex:t,searchAllEnabled:s}=this.viewModel,i={[w.menuItemActive]:e===t,[w.menuItemFocus]:"source"===this.activeMenu&&e===(s?this._activeMenuItemIndex-1:this._activeMenuItemIndex)},r=s?e+1:e;return M("li",{bind:this,key:`esri-search__source-${e}`,id:this._buildId("source-item",r),"aria-checked":(e===t).toString(),onclick:this._handleSourceClick,"data-source-index":e,role:"menuitemradio",class:this.classes(w.source,w.menuItem,i)},this._getSourceName(e))}renderNoResultsWarning(e){const{messages:t}=this,s=e?I(t.noResultsFoundForValue,{value:`"${e}"`}):t.noResultsFound;return M("div",{key:"esri-search__no_results"},M("div",{class:w.warningMenuHeader},t.noResults),M("div",{class:w.warningMenuText},s))}renderEmptySearchWarning(){const{messages:e}=this;return M("div",{key:"esri-search__empty-search"},M("span",{"aria-hidden":"true",class:w.noticeIcon}),M("span",{class:w.noValueText},e.emptyValue))}renderLocateWarning(){const{messages:e}=this;return M("div",{key:"esri-search__locate-error"},M("span",{"aria-hidden":"true",class:w.noticeIcon}),M("span",{class:w.noValueText},e.locateError))}renderWarning(){var e;const{displayedSearchTerm:t,_locateFailed:s}=this,{viewModel:i}=this;return s?this.renderLocateWarning():null!=(e=i.selectedSuggestion)&&e.location||t?this.renderNoResultsWarning(t):this.renderEmptySearchWarning()}_resetActiveMenuItemIndex(){this._activeMenuItemIndex=-1}_buildId(e,t){return`${this.id}-${e}${void 0===t?"":`-${t}`}`}_watchSourceChanges(){const{_handles:e,viewModel:{allSources:t}}=this,s="sources";e.remove(s),t.forEach((t=>e.add(r(t,"name",(()=>this.scheduleRender())),s)))}_handleSourcesMenuToggleClick(){const e="source"===this.activeMenu;var t;(this.activeMenu=e?"none":"source",this.renderNow(),"source"===this.activeMenu)&&(null==(t=this._sourceListNode)||t.focus())}_handleClearButtonClick(){this.viewModel.clear(),this._focus()}_handleSearchButtonClick(){this.search()}_handleSuggestionClick(e){const t=e.currentTarget["data-suggestion"];t&&(this._focus(),this.search(t))}_handleUseCurrentLocationClick(){this._useCurrentLocation()}_useCurrentLocation(){this._focus("none"),this._cancelSuggest(),this._cancelSearch();const e=new AbortController,{signal:t}=e;this._searchController=e,this.viewModel.searchNearby({signal:t}).catch((()=>{this._locateFailed=!0,this.activeMenu="warning"})).then((()=>{this._searchController=null}))}_handleSourceClick(e){this._setSourceFromMenuItem(e.currentTarget)}_setSourceFromMenuItem(e){var t;if(!e)return;const s=e["data-source-index"];this.viewModel.activeSourceIndex=s,this._clearActiveMenu(),null==(t=this._sourceMenuButtonNode)||t.focus()}_cancelSuggest(){this._suggestController&&(this._suggestController.abort(),this._suggestController=null)}_cancelSearch(){this._searchController&&(this._searchController.abort(),this._searchController=null),this._locateFailed=!1}_handleInputKeyup(e){var s;const i=t(e);if(e.ctrlKey||e.metaKey||"Copy"===i||"ArrowLeft"===i||"ArrowRight"===i||"Shift"===i)return;if("Tab"===i||"Escape"===i||e.shiftKey&&"Tab"===i)return this._cancelSuggest(),void("Escape"===i&&this._clearActiveMenu());const r="Home"===i||"End"===i||"ArrowUp"===i||"ArrowDown"===i;if("Enter"===i&&this._activeMenuItemIndex<0)return void this._cancelSuggest();const n=null==(s=this._suggestionListNode)?void 0:s.getElementsByTagName("li");if(null!=n&&n.length){if("suggestion"!==this.activeMenu&&this._openSuggestionMenu(),r)return e.preventDefault(),this._cancelSuggest(),void this._handleItemNavigation(i,n,this._suggestionListNode);const t=n[this._activeMenuItemIndex];if("Enter"===i&&t){const e=t["data-suggestion"];return void(e?(this._focus(),this.search(e)):t["data-current-location-item"]&&this._useCurrentLocation())}}this.viewModel.searchTerm&&this.suggest()}_handleItemNavigation(e,t,s){const i=this._activeMenuItemIndex;"Home"===e&&(this._activeMenuItemIndex=0),"End"===e&&(this._activeMenuItemIndex=t.length-1),"ArrowUp"===e&&(this._activeMenuItemIndex=this._activeMenuItemIndex<=0?t.length-1:this._activeMenuItemIndex-1),"ArrowDown"===e&&(this._activeMenuItemIndex=this._activeMenuItemIndex===t.length-1?0:this._activeMenuItemIndex+1),i!==this._activeMenuItemIndex&&p(t[this._activeMenuItemIndex],s)}_scrollToTopSuggestion(){this._suggestionListNode&&(this._suggestionListNode.scrollTop=0)}_openSuggestionMenu(){this.activeMenu="suggestion"}_handleInputPaste(e){const t=e.target;this.viewModel.searchTerm!==t.value&&(this.viewModel.searchTerm=t.value),this.viewModel.searchTerm&&this.suggest()}_handleSourceMenuKeydown(e){const s=t(e);if(_(s)){e.preventDefault();const t=this._sourceListNode.getElementsByTagName("li")[this._activeMenuItemIndex];this._setSourceFromMenuItem(t)}else"ArrowUp"!==s&&"ArrowDown"!==s&&"End"!==s&&"Home"!==s||e.preventDefault()}_handleSourceMenuKeyup(e){var s;const i=t(e),r="ArrowUp"===i||"ArrowDown"===i||"End"===i||"Home"===i;var n;if(r&&e.preventDefault(),"Escape"===i)return this._clearActiveMenu(),void(null==(n=this._sourceMenuButtonNode)||n.focus());const o=null==(s=this._sourceListNode)?void 0:s.getElementsByTagName("li");return o&&0!==o.length&&r?("source"!==this.activeMenu&&(this.activeMenu="source"),void this._handleItemNavigation(i,o,this._sourceListNode.parentElement)):void 0}_focus(e){this.focus(),e&&(this.activeMenu=e)}_formSubmit(e){e.preventDefault(),-1===this._activeMenuItemIndex&&this.search()}_getSourceName(e){const{messages:t}=this,s=this.viewModel,{allSources:i}=s,r=i.getItemAt(e);return e===h.ALL_INDEX?t.all:r&&r.name||t.untitledSource}_splitResult(e,t){const s=i(t);return e.replace(new RegExp(`(^|)(${s})(|$)`,"ig"),"$1|$2|$3").split("|")}_renderSearchResultsContent(){return this._searchResultRenderer.showMoreResultsOpen=!1,this._searchResultRenderer.viewModel=this.viewModel,this._searchResultRenderer}};e([u()],b.prototype,"_activeMenuItemIndex",void 0),e([u()],b.prototype,"displayedSearchTerm",null),e([u({readOnly:!0})],b.prototype,"inputId",null),e([u({readOnly:!0})],b.prototype,"suggestionsMenuId",null),e([u({readOnly:!0})],b.prototype,"sourceMenuId",null),e([u({readOnly:!0})],b.prototype,"sourceMenuButtonId",null),e([u()],b.prototype,"activeMenu",void 0),e([a("viewModel.activeSource")],b.prototype,"activeSource",void 0),e([a("viewModel.activeSourceIndex")],b.prototype,"activeSourceIndex",void 0),e([a("viewModel.allPlaceholder")],b.prototype,"allPlaceholder",void 0),e([a("viewModel.allSources")],b.prototype,"allSources",void 0),e([a("viewModel.autoNavigate")],b.prototype,"autoNavigate",void 0),e([a("viewModel.autoSelect")],b.prototype,"autoSelect",void 0),e([a("viewModel.defaultSources")],b.prototype,"defaultSources",void 0),e([u()],b.prototype,"disabled",void 0),e([a("viewModel.goToOverride")],b.prototype,"goToOverride",void 0),e([u()],b.prototype,"iconClass",void 0),e([a("viewModel.includeDefaultSources")],b.prototype,"includeDefaultSources",void 0),e([u({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],b.prototype,"label",void 0),e([a("viewModel.locationEnabled")],b.prototype,"locationEnabled",void 0),e([a("viewModel.maxResults")],b.prototype,"maxResults",void 0),e([a("viewModel.maxSuggestions")],b.prototype,"maxSuggestions",void 0),e([u(),m("esri/widgets/Search/t9n/Search")],b.prototype,"messages",void 0),e([u(),m("esri/t9n/common")],b.prototype,"messagesCommon",void 0),e([a("viewModel.minSuggestCharacters")],b.prototype,"minSuggestCharacters",void 0),e([a("viewModel.popupEnabled")],b.prototype,"popupEnabled",void 0),e([a("viewModel.popupTemplate")],b.prototype,"popupTemplate",void 0),e([a("viewModel.portal")],b.prototype,"portal",void 0),e([a("viewModel.resultGraphic")],b.prototype,"resultGraphic",void 0),e([a("viewModel.resultGraphicEnabled")],b.prototype,"resultGraphicEnabled",void 0),e([a("viewModel.results")],b.prototype,"results",void 0),e([a("viewModel.searchAllEnabled")],b.prototype,"searchAllEnabled",void 0),e([a("viewModel.searchTerm")],b.prototype,"searchTerm",void 0),e([a("viewModel.selectedResult")],b.prototype,"selectedResult",void 0),e([a("viewModel.sources")],b.prototype,"sources",void 0),e([a("viewModel.suggestions")],b.prototype,"suggestions",void 0),e([a("viewModel.suggestionsEnabled")],b.prototype,"suggestionsEnabled",void 0),e([a("viewModel.view")],b.prototype,"view",void 0),e([v(["search-complete","search-clear","search-start","select-result","suggest-start","suggest-complete"]),u({type:h})],b.prototype,"viewModel",void 0),e([a("viewModel.clear")],b.prototype,"clear",null),b=e([l("esri.widgets.Search")],b);const y=b;export{y as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{eventKey as t}from"../core/events.js";import s from"../core/Handles.js";import{escapeRegExpString as i}from"../core/string.js";import{watch as r,on as n,init as o}from"../core/watchUtils.js";import{aliasOf as a}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import c from"./Widget.js";import h from"./Search/SearchResultRenderer.js";import d from"./Search/SearchViewModel.js";import{storeNode as g,keepMenuItemWithinView as p,isActivationKey as _}from"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import"../core/Logger.js";import{vmEvent as v}from"./support/decorators/vmEvent.js";import{tsx as M}from"./support/jsxFactory.js";import{substitute as I}from"../intl/substitute.js";const w={base:"esri-search esri-widget",loader:"esri-widget__loader",loaderText:"esri-widget__loader-text",loaderAnimation:"esri-widget__loader-animation",esriInput:"esri-input",hasMultipleSources:"esri-search--multiple-sources",isLoading:"esri-search--loading",isSearching:"esri-search--searching",showSuggestions:"esri-search--show-suggestions",showSources:"esri-search--sources",showWarning:"esri-search--warning",container:"esri-search__container",input:"esri-search__input",inputContainer:"esri-search__input-container",form:"esri-search__form",submitButton:"esri-search__submit-button",sourcesButton:"esri-search__sources-button",clearButton:"esri-search__clear-button",sourceName:"esri-search__source-name",suggestionsMenu:"esri-search__suggestions-menu",suggestionList:"esri-search__suggestions-list",suggestionListCurrentLocation:"esri-search__suggestions-list--current-location",sourcesMenu:"esri-search__sources-menu",source:"esri-search__source",warningMenu:"esri-search__warning-menu",warningMenuBody:"esri-search__warning-body",warningMenuHeader:"esri-search__warning-header",warningMenuText:"esri-search__warning-text",noValueText:"esri-search__no-value-text",esriWidgetDisabled:"esri-widget--disabled",button:"esri-widget--button",fallbackText:"esri-icon-font-fallback-text",header:"esri-widget__heading",locate:"esri-icon-locate-circled",menu:"esri-menu",menuList:"esri-menu__list",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuHeader:"esri-menu__header",loadingIcon:"esri-icon-loading-indicator esri-rotating",searchIcon:"esri-icon-search",dropdownIcon:"esri-icon-down-arrow esri-search__sources-button--down",dropupIcon:"esri-icon-up-arrow esri-search__sources-button--up",clearIcon:"esri-icon-close",noticeIcon:"esri-icon-notice-triangle",widgetIcon:"esri-icon-search",disabled:"esri-disabled"},S=/<[a-z/][\s\S]*>/i;let b=class extends c{constructor(e,t){super(e,t),this._activeMenuItemIndex=-1,this._handles=new s,this._inputNode=null,this._menuItemCount=0,this._sourceMenuButtonNode=null,this._sourceListNode=null,this._suggestionListNode=null,this._searchResultRenderer=new h,this._locateFailed=null,this._container=null,this.activeMenu="none",this.activeSource=null,this.activeSourceIndex=null,this.allPlaceholder=null,this.allSources=null,this.autoNavigate=null,this.autoSelect=null,this.defaultSources=null,this.disabled=!1,this.goToOverride=null,this.iconClass=w.widgetIcon,this.includeDefaultSources=null,this.label=void 0,this.locationEnabled=null,this.maxResults=null,this.maxSuggestions=null,this.messages=null,this.messagesCommon=null,this.minSuggestCharacters=null,this.popupEnabled=null,this.popupTemplate=null,this.portal=null,this.resultGraphic=null,this.resultGraphicEnabled=null,this.results=null,this.searchAllEnabled=null,this.searchTerm=null,this.selectedResult=null,this.sources=null,this.suggestions=null,this.suggestionsEnabled=null,this.view=null,this.viewModel=new d,this._clearActiveMenu=()=>{this.activeMenu="none"},this._removeActiveMenu=e=>{var t;const s=e.relatedTarget;s&&null!=(t=this._container)&&t.contains(s)||this._clearActiveMenu()},this.own(r(this,"searchTerm",(e=>{(e&&"warning"===this.activeMenu||!e&&!this.get("viewModel.selectedSuggestion.location"))&&this._clearActiveMenu()})),n(this,"viewModel.allSources","change",(()=>this._watchSourceChanges())),o(this,"activeMenu",(()=>this._resetActiveMenuItemIndex())),o(this,"viewModel.defaultPopupTemplate",(e=>{e&&(e.content=this._renderSearchResultsContent.bind(this))})))}destroy(){this._handles.destroy(),this._handles=null,this._cancelSuggest(),this._cancelSearch(),this._searchResultRenderer&&(this._searchResultRenderer.viewModel=null,this._searchResultRenderer.destroy(),this._searchResultRenderer=null)}get displayedSearchTerm(){return`${this.viewModel.searchTerm}`.trim()}get inputId(){return this._buildId("input")}get suggestionsMenuId(){return this._buildId("suggest-menu")}get sourceMenuId(){return this._buildId("source-menu")}get sourceMenuButtonId(){return this._buildId("source-menu-button")}clear(){}focus(){var e;null==(e=this._inputNode)||e.focus(),this.emit("search-focus")}blur(){var e;null==(e=this._inputNode)||e.blur(),this.emit("search-blur")}search(e){this._clearActiveMenu(),this._cancelSuggest(),this._cancelSearch();const t=new AbortController,{signal:s}=t;return this._searchController=t,this.viewModel.search(e,{signal:s}).catch((e=>{if(this._searchController===t)return this._clearActiveMenu(),this._searchController=null,e})).then((e=>{if(this._searchController===t)return this.activeMenu=e.numResults?"none":"warning",this._searchController=null,e}))}suggest(e){this._cancelSuggest();const t=new AbortController,{signal:s}=t;return this._suggestController=t,this.viewModel.suggest(e,null,{signal:s}).then((e=>{if(this._suggestController===t)return this._suggestController=null,e.numResults&&this._openSuggestionMenu(),this._scrollToTopSuggestion(),e})).catch((()=>{if(this._suggestController===t)return this._suggestController=null,null}))}render(){const{state:e}=this.viewModel,t={[w.disabled]:"disabled"===e,[w.esriWidgetDisabled]:this.disabled};return M("div",{class:this.classes(w.base,t)},"loading"===e?this.renderLoader():this.renderContainer())}renderSubmitButton(){const{messages:e}=this;return M("button",{"aria-label":e.searchButtonTitle,bind:this,class:this.classes(w.submitButton,w.button),key:"esri-search__submit-button",onclick:this._handleSearchButtonClick,title:e.searchButtonTitle,type:"button"},M("span",{"aria-hidden":"true",class:w.searchIcon}))}renderWarningMenu(){return M("div",{key:"esri-search__error-menu",class:this.classes(w.menu,w.warningMenu)},M("div",{class:w.warningMenuBody},this.renderWarning()))}renderSourceMenuButton(){const{messages:e,activeMenu:t,sourceMenuId:s,sourceMenuButtonId:i}=this,{activeSourceIndex:r,allSources:n}=this.viewModel;return n.length>1?M("button",{id:i,key:"esri-search__source-menu-button",bind:this,"aria-label":e.searchIn,title:e.searchIn,"aria-haspopup":"true","aria-expanded":("source"===t).toString(),"aria-controls":s,class:this.classes(w.sourcesButton,w.button),onclick:this._handleSourcesMenuToggleClick,onfocus:this._handleSourcesMenuToggleFocus,afterCreate:g,"data-node-ref":"_sourceMenuButtonNode",type:"button"},M("span",{"aria-hidden":"true",class:w.dropdownIcon}),M("span",{"aria-hidden":"true",class:w.dropupIcon}),M("span",{class:w.sourceName},this._getSourceName(r))):null}renderSourcesList(){const{allSources:e,searchAllEnabled:t}=this.viewModel,{_activeMenuItemIndex:s,activeMenu:i,sourceMenuId:r,sourceMenuButtonId:n}=this,o="source"===i&&s>-1?this._buildId("source-item",s):null;return e.length>1?M("ul",{"aria-activedescendant":o,"aria-labelledby":n,id:r,role:"menu",bind:this,afterCreate:g,onkeydown:this._handleSourceMenuKeydown,onkeyup:this._handleSourceMenuKeyup,"data-node-ref":"_sourceListNode",class:w.menuList,tabIndex:-1},t?this.renderSource(d.ALL_INDEX):null,e.map(((e,t)=>this.renderSource(t))).toArray()):null}renderSourcesMenu(){const{allSources:e}=this.viewModel;return e.length>1?M("div",{key:"esri-search__source-menu",class:this.classes(w.menu,w.sourcesMenu)},this.renderSourcesList()):null}renderLoader(){const{messages:e,messagesCommon:t}=this;return M("div",{class:w.loader,key:"base-loader"},M("span",{"aria-hidden":"true",class:w.loaderAnimation}),M("span",{class:w.fallbackText},e.searchButtonTitle),M("span",{class:w.loaderText},t.loading))}renderContainer(){const{allSources:e,state:t}=this.viewModel,{activeMenu:s}=this,i={[w.hasMultipleSources]:e.length>1,[w.isLoading]:"loading"===t,[w.isSearching]:"searching"===t,[w.showWarning]:"warning"===s,[w.showSources]:"source"===s,[w.showSuggestions]:"suggestion"===s};return M("div",{tabIndex:-1,afterCreate:e=>{this._container=e,e.addEventListener("focusout",this._removeActiveMenu)},afterRemoved:e=>{e.removeEventListener("focusout",this._removeActiveMenu)},class:this.classes(i,w.container),key:"base-container"},this.renderSourceMenuButton(),this.renderSourcesMenu(),this.renderInputContainer(),this.renderSubmitButton(),this.renderWarningMenu())}renderClearButton(){return this.searchTerm?M("button",{bind:this,class:this.classes(w.clearButton,w.button),key:"esri-search__clear-button",onclick:this._handleClearButtonClick,onfocus:this._clearActiveMenu,title:this.messages.clearButtonTitle,type:"button"},M("span",{"aria-hidden":"true",class:w.clearIcon})):null}renderLocationGroup(){const{messages:e,locationEnabled:t,displayedSearchTerm:s}=this,i=t&&!s,r="suggestion"===this.activeMenu&&0===this._activeMenuItemIndex;return i?M("ul",{role:"group",key:"esri-search__suggestion-list-current-location",class:this.classes(w.menuList,w.suggestionList,w.suggestionListCurrentLocation)},M("li",{bind:this,"data-current-location-item":!0,onclick:this._handleUseCurrentLocationClick,id:this._buildId("suggestion-item",0),"aria-selected":("suggestion"===this.activeMenu&&0===this._activeMenuItemIndex).toString(),role:"option",class:this.classes(w.menuItem,r?w.menuItemFocus:null)},M("span",{"aria-hidden":"true",class:w.locate})," ",e.useCurrentLocation)):null}renderInput(){const{activeMenu:e,locationEnabled:t,displayedSearchTerm:s,messages:i,suggestionsMenuId:r,inputId:n,_activeMenuItemIndex:o}=this,{maxInputLength:a,placeholder:u,searchTerm:l,suggestionCount:c}=this.viewModel,h=!(!(t&&!s)&&!c),d="suggestion"===e&&o>-1?this._buildId("suggestion-item",o):null;return M("input",{"aria-activedescendant":d,"aria-autocomplete":"list","aria-expanded":(h&&"suggestion"===e).toString(),"aria-controls":h?r:null,"aria-haspopup":"listbox","aria-label":i.searchButtonTitle,bind:this,placeholder:u,maxlength:a,autocomplete:"off",type:"text",class:this.classes(w.esriInput,w.input),value:l,id:n,role:"combobox",onkeyup:this._handleInputKeyup,onclick:this._openSuggestionMenu,oninput:this._handleInputPaste,onpaste:this._handleInputPaste,afterCreate:g,"data-node-ref":"_inputNode",onfocus:this.focus,onblur:this.blur,title:l?"":u})}renderForm(){return M("form",{key:"esri-search__form",bind:this,class:w.form,onsubmit:this._formSubmit,role:"search"},this.renderInput())}renderSuggestList(e){const{sourceIndex:t}=e,s=e.results.length,i=e.results;return s?M("ul",{role:"group",key:`esri-search__suggestion-list-${t}`,class:this.classes(w.menuList,w.suggestionList)},i.map((e=>this.renderSuggestion(e,this._menuItemCount++)))):null}renderSuggestionsGroup(){const{suggestions:e}=this.viewModel;return e?e.map((e=>[this.renderSuggestionHeader(e),this.renderSuggestList(e)])):null}renderSuggestionsMenu(){const{displayedSearchTerm:e,locationEnabled:t,suggestionsMenuId:s,inputId:i}=this,{suggestionCount:r}=this.viewModel,n=t&&!e||r;return this._menuItemCount=0,n?M("div",{id:s,key:"esri-search__suggestions-menu",class:this.classes(w.menu,w.suggestionsMenu),role:"listbox","aria-labelledby":i,bind:this,afterCreate:g,"data-node-ref":"_suggestionListNode"},this.renderLocationGroup(),this.renderSuggestionsGroup()):null}renderInputContainer(){return M("div",{key:"esri-search__input-container",class:w.inputContainer},this.renderForm(),this.renderSuggestionsMenu(),this.renderClearButton())}renderSuggestionHeader(e){const{allSources:t,activeSourceIndex:s}=this.viewModel,{sourceIndex:i}=e,r=e.results.length,n=t.length>1&&s===d.ALL_INDEX;return r&&n?M("div",{key:`esri-search__suggestion-header-${i}`,class:w.menuHeader},this._getSourceName(i)):null}renderSuggestion(e,t){const{_activeMenuItemIndex:s,messages:i}=this,{searchTerm:r}=this.viewModel;if(r){const{text:n}=e,o=n||i.untitledResult,a=S.test(o),u=[];if(a)u.push(M("div",{innerHTML:o}));else{const e=this._splitResult(o,r),t=r.toLowerCase();e.forEach(((e,s)=>{e&&e.length&&(e.toLowerCase()===t?u.push(M("strong",{key:s},e)):u.push(e))}))}const l="suggestion"===this.activeMenu&&s===t;return M("li",{bind:this,id:this._buildId("suggestion-item",t),"aria-selected":("suggestion"===this.activeMenu&&this._activeMenuItemIndex===t).toString(),onclick:this._handleSuggestionClick,key:`esri-search__suggestion_${t}`,"data-suggestion":e,role:"option",class:this.classes(w.menuItem,l?w.menuItemFocus:null)},u)}}renderSource(e){const{activeSourceIndex:t,searchAllEnabled:s}=this.viewModel,i={[w.menuItemActive]:e===t,[w.menuItemFocus]:"source"===this.activeMenu&&e===(s?this._activeMenuItemIndex-1:this._activeMenuItemIndex)},r=s?e+1:e;return M("li",{bind:this,key:`esri-search__source-${e}`,id:this._buildId("source-item",r),"aria-checked":(e===t).toString(),onclick:this._handleSourceClick,"data-source-index":e,role:"menuitemradio",class:this.classes(w.source,w.menuItem,i)},this._getSourceName(e))}renderNoResultsWarning(e){const{messages:t}=this,s=e?I(t.noResultsFoundForValue,{value:`"${e}"`}):t.noResultsFound;return M("div",{key:"esri-search__no_results"},M("div",{class:w.warningMenuHeader},t.noResults),M("div",{class:w.warningMenuText},s))}renderEmptySearchWarning(){const{messages:e}=this;return M("div",{key:"esri-search__empty-search"},M("span",{"aria-hidden":"true",class:w.noticeIcon}),M("span",{class:w.noValueText},e.emptyValue))}renderLocateWarning(){const{messages:e}=this;return M("div",{key:"esri-search__locate-error"},M("span",{"aria-hidden":"true",class:w.noticeIcon}),M("span",{class:w.noValueText},e.locateError))}renderWarning(){var e;const{displayedSearchTerm:t,_locateFailed:s}=this,{viewModel:i}=this;return s?this.renderLocateWarning():null!=(e=i.selectedSuggestion)&&e.location||t?this.renderNoResultsWarning(t):this.renderEmptySearchWarning()}_resetActiveMenuItemIndex(){this._activeMenuItemIndex=-1}_buildId(e,t){return`${this.id}-${e}${void 0===t?"":`-${t}`}`}_watchSourceChanges(){const{_handles:e,viewModel:{allSources:t}}=this,s="sources";e.remove(s),t.forEach((t=>e.add(r(t,"name",(()=>this.scheduleRender())),s)))}_handleSourcesMenuToggleFocus(){"source"!==this.activeMenu&&this._clearActiveMenu()}_handleSourcesMenuToggleClick(){const e="source"===this.activeMenu;var t;(this.activeMenu=e?"none":"source",this.renderNow(),"source"===this.activeMenu)&&(null==(t=this._sourceListNode)||t.focus())}_handleClearButtonClick(){this.viewModel.clear(),this._focus()}_handleSearchButtonClick(){this.search()}_handleSuggestionClick(e){const t=e.currentTarget["data-suggestion"];t&&(this._focus(),this.search(t))}_handleUseCurrentLocationClick(){this._useCurrentLocation()}_useCurrentLocation(){this._focus("none"),this._cancelSuggest(),this._cancelSearch();const e=new AbortController,{signal:t}=e;this._searchController=e,this.viewModel.searchNearby({signal:t}).then((e=>{this.activeMenu=e.numResults?"none":"warning"})).catch((()=>{this._locateFailed=!0,this.activeMenu="warning"})).then((()=>{this._searchController=null}))}_handleSourceClick(e){this._setSourceFromMenuItem(e.currentTarget)}_setSourceFromMenuItem(e){var t;if(!e)return;const s=e["data-source-index"];this.viewModel.activeSourceIndex=s,this._clearActiveMenu(),null==(t=this._sourceMenuButtonNode)||t.focus()}_cancelSuggest(){this._suggestController&&(this._suggestController.abort(),this._suggestController=null)}_cancelSearch(){this._searchController&&(this._searchController.abort(),this._searchController=null),this._locateFailed=!1}_handleInputKeyup(e){var s;const i=t(e);if(e.ctrlKey||e.metaKey||"Copy"===i||"ArrowLeft"===i||"ArrowRight"===i||"Shift"===i)return;if("Tab"===i||"Escape"===i||e.shiftKey&&"Tab"===i)return this._cancelSuggest(),void("Escape"===i&&this._clearActiveMenu());const r="Home"===i||"End"===i||"ArrowUp"===i||"ArrowDown"===i;if("Enter"===i&&this._activeMenuItemIndex<0)return void this._cancelSuggest();const n=null==(s=this._suggestionListNode)?void 0:s.getElementsByTagName("li");if(null!=n&&n.length){if("suggestion"!==this.activeMenu&&this._openSuggestionMenu(),r)return e.preventDefault(),this._cancelSuggest(),void this._handleItemNavigation(i,n,this._suggestionListNode);const t=n[this._activeMenuItemIndex];if("Enter"===i&&t){const e=t["data-suggestion"];return void(e?(this._focus(),this.search(e)):t["data-current-location-item"]&&this._useCurrentLocation())}}this.viewModel.searchTerm&&this.suggest()}_handleItemNavigation(e,t,s){const i=this._activeMenuItemIndex;"Home"===e&&(this._activeMenuItemIndex=0),"End"===e&&(this._activeMenuItemIndex=t.length-1),"ArrowUp"===e&&(this._activeMenuItemIndex=this._activeMenuItemIndex<=0?t.length-1:this._activeMenuItemIndex-1),"ArrowDown"===e&&(this._activeMenuItemIndex=this._activeMenuItemIndex===t.length-1?0:this._activeMenuItemIndex+1),i!==this._activeMenuItemIndex&&p(t[this._activeMenuItemIndex],s)}_scrollToTopSuggestion(){this._suggestionListNode&&(this._suggestionListNode.scrollTop=0)}_openSuggestionMenu(){this.activeMenu="suggestion"}_handleInputPaste(e){const t=e.target;this.viewModel.searchTerm!==t.value&&(this.viewModel.searchTerm=t.value),this.viewModel.searchTerm&&this.suggest()}_handleSourceMenuKeydown(e){const s=t(e);if(_(s)){e.preventDefault();const t=this._sourceListNode.getElementsByTagName("li")[this._activeMenuItemIndex];this._setSourceFromMenuItem(t)}else"ArrowUp"!==s&&"ArrowDown"!==s&&"End"!==s&&"Home"!==s||e.preventDefault()}_handleSourceMenuKeyup(e){var s;const i=t(e),r="ArrowUp"===i||"ArrowDown"===i||"End"===i||"Home"===i;var n;if(r&&e.preventDefault(),"Escape"===i)return this._clearActiveMenu(),void(null==(n=this._sourceMenuButtonNode)||n.focus());const o=null==(s=this._sourceListNode)?void 0:s.getElementsByTagName("li");return o&&0!==o.length&&r?("source"!==this.activeMenu&&(this.activeMenu="source"),void this._handleItemNavigation(i,o,this._sourceListNode.parentElement)):void 0}_focus(e){this.focus(),e&&(this.activeMenu=e)}_formSubmit(e){e.preventDefault(),-1===this._activeMenuItemIndex&&this.search()}_getSourceName(e){const{messages:t}=this,s=this.viewModel,{allSources:i}=s,r=i.getItemAt(e);return e===d.ALL_INDEX?t.all:r&&r.name||t.untitledSource}_splitResult(e,t){const s=i(t);return e.replace(new RegExp(`(^|)(${s})(|$)`,"ig"),"$1|$2|$3").split("|")}_renderSearchResultsContent(){return this._searchResultRenderer.showMoreResultsOpen=!1,this._searchResultRenderer.viewModel=this.viewModel,this._searchResultRenderer}};e([u()],b.prototype,"_activeMenuItemIndex",void 0),e([u()],b.prototype,"displayedSearchTerm",null),e([u({readOnly:!0})],b.prototype,"inputId",null),e([u({readOnly:!0})],b.prototype,"suggestionsMenuId",null),e([u({readOnly:!0})],b.prototype,"sourceMenuId",null),e([u({readOnly:!0})],b.prototype,"sourceMenuButtonId",null),e([u()],b.prototype,"activeMenu",void 0),e([a("viewModel.activeSource")],b.prototype,"activeSource",void 0),e([a("viewModel.activeSourceIndex")],b.prototype,"activeSourceIndex",void 0),e([a("viewModel.allPlaceholder")],b.prototype,"allPlaceholder",void 0),e([a("viewModel.allSources")],b.prototype,"allSources",void 0),e([a("viewModel.autoNavigate")],b.prototype,"autoNavigate",void 0),e([a("viewModel.autoSelect")],b.prototype,"autoSelect",void 0),e([a("viewModel.defaultSources")],b.prototype,"defaultSources",void 0),e([u()],b.prototype,"disabled",void 0),e([a("viewModel.goToOverride")],b.prototype,"goToOverride",void 0),e([u()],b.prototype,"iconClass",void 0),e([a("viewModel.includeDefaultSources")],b.prototype,"includeDefaultSources",void 0),e([u({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],b.prototype,"label",void 0),e([a("viewModel.locationEnabled")],b.prototype,"locationEnabled",void 0),e([a("viewModel.maxResults")],b.prototype,"maxResults",void 0),e([a("viewModel.maxSuggestions")],b.prototype,"maxSuggestions",void 0),e([u(),m("esri/widgets/Search/t9n/Search")],b.prototype,"messages",void 0),e([u(),m("esri/t9n/common")],b.prototype,"messagesCommon",void 0),e([a("viewModel.minSuggestCharacters")],b.prototype,"minSuggestCharacters",void 0),e([a("viewModel.popupEnabled")],b.prototype,"popupEnabled",void 0),e([a("viewModel.popupTemplate")],b.prototype,"popupTemplate",void 0),e([a("viewModel.portal")],b.prototype,"portal",void 0),e([a("viewModel.resultGraphic")],b.prototype,"resultGraphic",void 0),e([a("viewModel.resultGraphicEnabled")],b.prototype,"resultGraphicEnabled",void 0),e([a("viewModel.results")],b.prototype,"results",void 0),e([a("viewModel.searchAllEnabled")],b.prototype,"searchAllEnabled",void 0),e([a("viewModel.searchTerm")],b.prototype,"searchTerm",void 0),e([a("viewModel.selectedResult")],b.prototype,"selectedResult",void 0),e([a("viewModel.sources")],b.prototype,"sources",void 0),e([a("viewModel.suggestions")],b.prototype,"suggestions",void 0),e([a("viewModel.suggestionsEnabled")],b.prototype,"suggestionsEnabled",void 0),e([a("viewModel.view")],b.prototype,"view",void 0),e([v(["search-complete","search-clear","search-start","select-result","suggest-start","suggest-complete"]),u({type:d})],b.prototype,"viewModel",void 0),e([a("viewModel.clear")],b.prototype,"clear",null),b=e([l("esri.widgets.Search")],b);const y=b;export{y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../analysis/Slice.js";import t from"../../core/Handles.js";import o from"../../core/Logger.js";import{isNone as i,isSome as r,destroyMaybe as l,unwrap as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import s from"../../analysis/Slice.js";import t from"../../core/Handles.js";import o from"../../core/Logger.js";import{isNone as i,isSome as r,destroyMaybe as l,applySome as a,unwrapOr as n,unwrap as d}from"../../core/maybe.js";import{ignoreAbortErrors as c}from"../../core/promiseUtils.js";import{watch as h,sync as u,whenOnce as p}from"../../core/reactiveUtils.js";import{property as y}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import w from"../../views/3d/interactive/analysisTools/slice/SliceTool.js";import{InteractiveAnalysisViewModel as g}from"../support/InteractiveAnalysisViewModel.js";const f=o.getLogger("esri.widgets.Slice.SliceViewModel"),x=new Set;let S=class extends g{constructor(e){super(e),this.analysisView=null,this._handles=new t,this.logger=f,this.supportedViewType="3d",this.unsupportedErrorMessage="SliceViewModel is only supported in 3D views.",x.add(this)}initialize(){this._handles.add(h((()=>this.shape),((e,s)=>{i(s)&&r(e)?i(this.tool)&&!this.creatingTool&&this.createTool():r(s)&&i(e)&&this.removeTool()}),u)),r(this.shape)&&this.createTool()}destroy(){this._handles=l(this._handles),x.delete(this)}get state(){return this.disabled||!this.ready?"disabled":i(this.tool)||"pending"===this.tool.toolState?"ready":this.tool.state}get shape(){return this.analysis.shape}set shape(e){this.analysis.shape=e}get tiltEnabled(){return this.analysis.tiltEnabled}set tiltEnabled(e){this.analysis.tiltEnabled=e}get layersMode(){const e=a(this.tool,(e=>e.layersMode));return n(e,"none")}get excludedLayers(){return this.analysis.excludedLayers}set excludedLayers(e){this.analysis.excludedLayers=e}get excludeGroundSurface(){return this.analysis.excludeGroundSurface}set excludeGroundSurface(e){this.analysis.excludeGroundSurface=e}get ready(){return r(this.analysisView)}async start(){return this.clear(),this.ready||await p((()=>this.ready)),x.forEach((e=>{e.view===this.view&&e!==this&&e.clear()})),this.createTool()}clear(){this.removeTool(),this.shape=null}enterExcludeLayerMode(){r(this.tool)&&this.tool.enterExcludeLayerMode()}exitExcludeLayerMode(){r(this.tool)&&this.tool.exitExcludeLayerMode()}_updateToolOrRecreate(e){r(this.tool)?e(this.tool):this.creatingTool&&c(this.createTool())}onConnectToAnalysisView(e){this.analysisView=e}onDisconnectFromAnalysisView(){this.analysisView=null}constructAnalysis(){return new s}constructTool(){return new w({view:d(this.view),analysis:this.analysis,visible:this.visible})}};e([y({readOnly:!0})],S.prototype,"state",null),e([y()],S.prototype,"shape",null),e([y()],S.prototype,"tiltEnabled",null),e([y()],S.prototype,"layersMode",null),e([y()],S.prototype,"excludedLayers",null),e([y({nonNullable:!0})],S.prototype,"excludeGroundSurface",null),e([y()],S.prototype,"analysisView",void 0),e([y()],S.prototype,"ready",null),S=e([m("esri.widgets.slice.SliceViewModel")],S);const T=S;export{T as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import
|
|
5
|
+
import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Accessor.js";import i from"../../core/Error.js";import s from"../../core/Logger.js";import{isSome as r}from"../../core/maybe.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import"../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";const a="esri.widgets.Slider.SliderViewModel",l=s.getLogger(a);let u=class extends e{constructor(t){super(t),this.precision=4,this.thumbsConstrained=!0}set effectiveMax(t){this.setEffectiveMax(t)}set effectiveMin(t){this.setEffectiveMin(t)}set labelFormatFunction(t){this._set("labelFormatFunction",t)}set inputFormatFunction(t){this._set("inputFormatFunction",t)}set inputParseFunction(t){this._set("inputParseFunction",t)}get labels(){const{max:t,min:e,values:i}=this,s=i&&i.length?i.map(((t,e)=>this.getLabelForValue(t,"value",e))):[];return{max:this.getLabelForValue(t,"max"),min:this.getLabelForValue(e,"min"),values:s}}set max(t){this.setMax(t)}set min(t){this.setMin(t)}get state(){const{max:t,min:e}=this;return r(t)&&r(e)&&t>e?"ready":"disabled"}set values(t){const{max:e,min:i}=this,s=this.values;s&&t&&s.length===t.length&&s.every(((e,i)=>e===t[i]))||(this._set("values",null),t&&t.length&&(r(i)&&t.some((t=>t<i))&&(this.min=Math.min(...t)),r(e)&&t.some((t=>t>e))&&(this.max=Math.max(...t))),this._set("values",t))}toPrecision(t){return parseFloat(t.toFixed(this.precision))}defaultLabelFormatFunction(t){const{max:e,min:i,precision:s}=this,r=e-i>10?2:s;return parseFloat(t.toFixed(r)).toString()}defaultInputFormatFunction(t){return t.toString()}defaultInputParseFunction(t){return parseFloat(t)}getBounds(){const{effectiveMax:t,effectiveMin:e,max:i,min:s}=this;return{min:r(e)?Math.max(s,e):s,max:r(t)?Math.min(i,t):i}}getBoundsForValueAtIndex(t){const{thumbsConstrained:e,values:i}=this,{min:s,max:o}=this.getBounds();if(e){const e=t-1,n=t+1;return{min:r(i[e])?i[e]:s,max:r(i[n])?i[n]:o}}return{min:s,max:o}}getLabelForValue(t,e,i){return r(t)?this.labelFormatFunction?this.labelFormatFunction(t,e,i):this.defaultLabelFormatFunction(t):null}setMax(t){const{max:e,values:i}=this;if(isNaN(t))return void this._logError("slider:invalid-value","Supplied value for property 'max' is NaN.");if(null===t)return void this._set("max",null);const s=this.toPrecision(t);if(e!==s&&(this._set("max",s),i&&i.length))for(let r=0;r<i.length;r++)s<i[r]&&this.setValue(r,s)}setMin(t){const{min:e,values:i}=this;if(isNaN(t))return void this._logError("slider:invalid-value","Supplied value for property 'min' is NaN.");if(null===t)return void this._set("min",null);const s=this.toPrecision(t);if(e!==s&&(this._set("min",s),i&&i.length))for(let r=0;r<i.length;r++)s>i[r]&&this.setValue(r,s)}setEffectiveMax(t){if(isNaN(t))return void this._logError("slider:invalid-value","Supplied value for property 'effectiveMax' is NaN.");if(null===t)return void this._set("effectiveMax",null);const e=this.toPrecision(t);this.effectiveMax!==e&&this._set("effectiveMax",this._applyBoundsToValue(e))}setEffectiveMin(t){if(isNaN(t))return void this._logError("slider:invalid-value","Supplied value for property 'effectiveMin' is NaN.");if(null===t)return void this._set("effectiveMin",null);const e=this.toPrecision(t);this.effectiveMin!==e&&this._set("effectiveMin",this._applyBoundsToValue(e))}setValue(t,e){if(isNaN(e))return void this._logError("slider:invalid-value","Supplied value for member of property 'values' is NaN.");const{values:i}=this,s=i[t],r=this.toPrecision(e);if(s===r)return;const o=[...i];o[t]=r,this._set("values",o),this.notifyChange("labels")}_applyBoundsToValue(t){const{max:e,min:i}=this;return r(i)&&t<i?i:r(e)&&t>e?e:t}_logError(t,e,s){l.error(new i(t,e,s))}};t([o()],u.prototype,"effectiveMax",null),t([o()],u.prototype,"effectiveMin",null),t([o()],u.prototype,"labelFormatFunction",null),t([o()],u.prototype,"inputFormatFunction",null),t([o()],u.prototype,"inputParseFunction",null),t([o({readOnly:!0})],u.prototype,"labels",null),t([o()],u.prototype,"max",null),t([o()],u.prototype,"min",null),t([o()],u.prototype,"precision",void 0),t([o({readOnly:!0})],u.prototype,"state",null),t([o()],u.prototype,"thumbsConstrained",void 0),t([o()],u.prototype,"values",null),u=t([n(a)],u);const p=u;export{p as default};
|
package/widgets/Slider.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{deprecatedProperty as i}from"../core/deprecate.js";import{eventKey as n}from"../core/events.js";import s from"../core/Logger.js";import{isSome as o}from"../core/maybe.js";import{aliasOf as r}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as a}from"../core/accessorSupport/decorators/cast.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import c from"./Slider/SliderViewModel.js";import{onResize as u}from"./support/widgetUtils.js";import{messageBundle as m}from"./support/decorators/messageBundle.js";import{tsx as _}from"./support/jsxFactory.js";import{substitute as p}from"../intl/substitute.js";const v={base:"esri-slider",reversed:"esri-slider--reversed",horizontalLayout:"esri-slider--horizontal",verticalLayout:"esri-slider--vertical",contentElement:"esri-slider__content",extraContentElement:"esri-slider__extra-content",trackElement:"esri-slider__track",ticksContainerElement:"esri-slider__ticks",tickElement:"esri-slider__tick",tickLabelElement:"esri-slider__tick-label",maxElement:"esri-slider__max",minElement:"esri-slider__min",maxElementInteractive:"esri-slider__max--interactive",minElementInteractive:"esri-slider__min--interactive",rangeInput:"esri-slider__range-input",anchorElement:"esri-slider__anchor",movingAnchorElement:"esri-slider__anchor--moving",lastMovedAnchorElement:"esri-slider__anchor--moved",anchorElementActive:"esri-slider__anchor--active",anchorElementIndexPrefix:"esri-slider__anchor-",segmentElement:"esri-slider__segment",segmentElementIndexPrefix:"esri-slider__segment-",segmentElementInteractive:"esri-slider__segment--interactive",segmentElementActive:"esri-slider__segment--active",thumbElement:"esri-slider__thumb",labelElement:"esri-slider__label",labelElementInteractive:"esri-slider__label--interactive",labelInput:"esri-slider__label-input",esriWidget:"esri-widget",widgetIcon:"esri-icon-edit",disabled:"esri-disabled",hidden:"esri-hidden"},g={showInput:"Enter",hideInput1:"Enter",hideInput2:"Escape",hideInput3:"Tab",moveAnchorUp:"ArrowUp",moveAnchorDown:"ArrowDown",moveAnchorLeft:"ArrowLeft",moveAnchorRight:"ArrowRight",moveAnchorToMax:"End",moveAnchorToMin:"Home"},b="esri.widgets.Slider",f=s.getLogger("esri.widgets.Slider"),E={labels:!1,rangeLabels:!1};let x=class extends d{constructor(e,i){super(e,i),this._activeLabelInputIndex=null,this._anchorElements=[],this._dragged=!1,this._dragStartInfo=null,this._focusedAnchorIndex=null,this._isMinInputActive=!1,this._isMaxInputActive=!1,this._lastMovedHandleIndex=null,this._positionPrecision=5,this._segmentDragStartInfo=null,this._trackHeight=null,this._trackWidth=null,this._zIndices=null,this._zIndexOffset=3,this.disabled=!1,this.extraNodes=[],this.draggableSegmentsEnabled=!0,this.inputCreatedFunction=null,this.inputFormatFunction=null,this.inputParseFunction=null,this.label=void 0,this.labelElements=new t,this.labelInputsEnabled=!1,this.labelFormatFunction=null,this.labels=null,this.max=null,this.maxLabelElement=null,this.messages=null,this.min=null,this.minLabelElement=null,this.precision=4,this.rangeLabelInputsEnabled=!1,this.segmentElements=new t,this.snapOnClickEnabled=!0,this.steps=null,this.syncedSegmentsEnabled=!1,this.thumbsConstrained=!0,this.thumbCreatedFunction=null,this.thumbElements=new t,this.tickElements=new t,this.trackElement=null,this.values=null,this.viewModel=new c,this.visibleElements={...E},this._onAnchorPointerDown=this._onAnchorPointerDown.bind(this),this._onAnchorPointerMove=this._onAnchorPointerMove.bind(this),this._onAnchorPointerUp=this._onAnchorPointerUp.bind(this),this._onLabelPointerDown=this._onLabelPointerDown.bind(this),this._onLabelPointerUp=this._onLabelPointerUp.bind(this),this._onSegmentPointerDown=this._onSegmentPointerDown.bind(this),this._onSegmentPointerMove=this._onSegmentPointerMove.bind(this),this._onSegmentPointerUp=this._onSegmentPointerUp.bind(this),this._onTrackPointerDown=this._onTrackPointerDown.bind(this),this._onTrackPointerMove=this._onTrackPointerMove.bind(this),this._onTrackPointerUp=this._onTrackPointerUp.bind(this)}destroy(){document.removeEventListener("pointerup",this._onLabelPointerUp),document.removeEventListener("pointermove",this._onLabelPointerMove),document.removeEventListener("pointerup",this._onAnchorPointerUp),document.removeEventListener("pointermove",this._onAnchorPointerMove),this.labelElements.removeAll(),this.labelElements.destroy(),this.segmentElements.removeAll(),this.segmentElements.destroy(),this.thumbElements.removeAll(),this.thumbElements.destroy(),this.tickElements.removeAll(),this.tickElements.destroy()}set labelsVisible(e){i(f,"labelsVisible",{replacement:"visibleElements.labels",version:"4.15"}),this.visibleElements={...this.visibleElements,labels:e}}set layout(e){-1===["vertical","vertical-reversed","horizontal","horizontal-reversed"].indexOf(e)&&(e="horizontal"),this._set("layout",e)}set rangeLabelsVisible(e){i(f,"rangeLabelsVisible",{replacement:"visibleElements.rangeLabels",version:"4.15"}),this.visibleElements={...this.visibleElements,rangeLabels:e}}get state(){const{_activeLabelInputIndex:e,_isMaxInputActive:t,_isMinInputActive:i,_dragStartInfo:n,_segmentDragStartInfo:s,disabled:r,viewModel:a}=this,l=o(n)||o(s);return r?"disabled":!(null===e&&!t&&!i)?"editing":l?"dragging":a.state}set tickConfigs(e){this._set("tickConfigs",e),this.scheduleRender()}castVisibleElements(e){return{...E,...e}}render(){const{label:e}=this,t=this.classes(v.base,v.esriWidget,this._isHorizontalLayout()?v.horizontalLayout:v.verticalLayout,this._isReversedLayout()?v.reversed:null,this._isDisabled()?v.disabled:null);return this._storeTrackDimensions(),_("div",{"aria-label":e,class:t,"touch-action":"none",bind:this,afterCreate:this._afterContainerCreate},this.renderContent())}toNextStep(e){this._toStep(e,1)}toPreviousStep(e){this._toStep(e,-1)}renderContent(){const{max:e,min:t}=this;if(o(t)&&o(e)&&!(t>=e))return[this.renderMin(),this.renderSliderContainer(),this.renderMax()]}renderSliderContainer(){return _("div",{key:"slider-container",bind:this,class:v.contentElement},this.renderTrackElement(),this.renderTicksContainer(),this.renderExtraContentElements())}renderTrackElement(){return _("div",{afterCreate:this._afterTrackCreate,afterRemoved:this._afterTrackRemoved,bind:this,class:v.trackElement,"data-node-ref":"trackElement","touch-action":"none"},this.renderSegmentElements(),this.renderAnchorElements())}renderSegmentElements(){if(!this.trackElement||!this.values||!this.values.length)return;const e=this.values.length+1,t=[];for(let i=0;i<e;i++)t.push(this.renderSegmentElement(i));return t}renderSegmentElement(e){const{_trackHeight:t,_trackWidth:i,draggableSegmentsEnabled:n,id:s,state:r,values:a}=this,l=this._isHorizontalLayout(),h=l?i:t,d=e===a.length?null:e,c=0===e?null:e-1,u=o(d),m=o(c);let p,g;const b=[...a].sort(((e,t)=>e-t));this._isReversedLayout()?(p=m?this._positionFromValue(b[c]):l?h:0,g=u?this._positionFromValue(b[d]):l?0:h):(p=u?this._positionFromValue(b[d]):l?h:0,g=m?this._positionFromValue(b[c]):l?0:h);const f=this._applyPrecisionToPosition(100*g/h),E=(p-g)/h,x=l?`transform: translate(${f}%, 0px) scale(${E}, 1);`:`transform: translate(0px, ${f}%) scale(1, ${E});`,k=this.classes(v.segmentElement,v.segmentElementIndexPrefix+e,n&&u&&m&&"disabled"!==r?v.segmentElementInteractive:null);return _("div",{afterCreate:this._afterSegmentCreate,afterRemoved:this._afterSegmentRemoved,bind:this,class:k,"data-max-thumb-index":d,"data-min-thumb-index":c,"data-segment-index":e,key:`${s}-segment-${e}`,style:x,"touch-action":"none"})}renderAnchorElements(){const{trackElement:e,values:t}=this;if(t&&t.length)return this._zIndices=t.map(((e,i)=>{const n=this._positionFromValue(e),s=this._positionToPercent(n),o=(this._isHorizontalLayout()?s>50:s<50)?-1:1;return this._zIndexOffset+(t.length+o*i)})),e&&t&&t.length?t.map(((e,t)=>this.renderAnchorElement(e,t))):null}renderAnchorElement(e,t){const i=this._positionFromValue(e),n=this._valueFromPosition(i);if(!o(n)||isNaN(n))return;const{_dragStartInfo:s,_lastMovedHandleIndex:r,id:a,layout:l,values:h,visibleElements:{labels:d}}=this,c=s&&s.index===t,u=r===t,m=this.classes(v.anchorElement,v.anchorElementIndexPrefix+t,c?v.movingAnchorElement:null,u?v.lastMovedAnchorElement:null),g=this.labels.values[t],b=this._getStyleForAnchor(e,t,c||u),{min:f,max:E}=this.viewModel.getBoundsForValueAtIndex(t),{messages:x}=this,k=2===h.length?p(0===t?x.rangeMinimum:x.rangeMaximum,{value:e}):g,y=1===h.length?null:0===t?`${a}-handle-${t+1}`:t===h.length-1?`${a}-handle-${t-1}`:`${a}-handle-${t-1} ${a}-handle-${t+1}`;return _("div",{afterCreate:this._afterAnchorCreate,afterUpdate:this._afterAnchorUpdate,afterRemoved:this._afterAnchorRemoved,"aria-controls":y,"aria-label":x.sliderValue,"aria-labelledby":d?`${a}-label-${t}`:null,"aria-orientation":l,"aria-valuemax":E.toString(),"aria-valuemin":f.toString(),"aria-valuenow":e.toString(),"aria-valuetext":k,bind:this,class:m,"data-thumb-index":t,"data-value":e,id:`${a}-handle-${t}`,key:`${a}-handle-${t}`,onkeydown:this._onAnchorKeyDown,"touch-action":"none",role:"slider",style:b,tabIndex:0},_("span",{afterCreate:this._afterThumbCreate,afterRemoved:this._afterThumbRemoved,bind:this,class:v.thumbElement,"data-thumb-index":t,"touch-action":"none"}),this.renderThumbLabel(t))}renderThumbLabel(e){const{id:t,labels:i,labelInputsEnabled:n,state:s}=this,o=this.visibleElements.labels,r=i.values[e],a=this.classes(v.labelElement,o?null:v.hidden,n&&"disabled"!==s?v.labelElementInteractive:null);return _("span",{afterCreate:this._afterLabelCreate,afterRemoved:this._afterLabelRemoved,"aria-hidden":(!o).toString(),bind:this,class:a,"data-thumb-index":e,key:`${t}-label-${e}`,id:`${t}-label-${e}`,role:n?"button":null,"touch-action":"none"},this._activeLabelInputIndex===e?this.renderValueInput(e):r)}renderValueInput(e){const t=this.values[e];return _("input",{afterCreate:this._afterInputCreate,"aria-label":this.messages.sliderValue,bind:this,class:v.labelInput,"data-input-type":"thumb","data-input-index":e,required:!0,tabIndex:0,type:"text",value:this._formatInputValue(t,"value",e),onblur:this._onLabelInputBlur,onkeydown:this._onInputKeyDown})}renderMax(){const{_isMaxInputActive:e,labels:t,rangeLabelInputsEnabled:i,state:n}=this,s=this.visibleElements.rangeLabels,o=this.classes(v.maxElement,s?null:v.hidden,i&&"disabled"!==n?v.maxElementInteractive:null);return _("div",{"aria-hidden":(!s).toString(),afterCreate:this._afterMaxLabelCreate,bind:this,class:o,onclick:this._onMaxLabelClick,onkeydown:this._onMaxLabelKeyDown,role:i?"button":null,tabIndex:i?0:null},e?this.renderMaxInput():t.max)}renderMin(){const{_isMinInputActive:e,labels:t,rangeLabelInputsEnabled:i,state:n}=this,s=this.visibleElements.rangeLabels,o=this.classes(v.minElement,s?null:v.hidden,i&&"disabled"!==n?v.minElementInteractive:null);return _("div",{"aria-hidden":(!s).toString(),afterCreate:this._afterMinLabelCreate,bind:this,class:o,onclick:this._onMinLabelClick,onkeydown:this._onMinLabelKeyDown,role:i?"button":null,tabIndex:i?0:null},e?this.renderMinInput():t.min)}renderMaxInput(){return _("input",{afterCreate:this._afterInputCreate,"aria-label":this.messages.maximumValue,bind:this,class:v.rangeInput,"data-input-type":"max",required:!0,tabIndex:0,type:"text",value:this._formatInputValue(this.max,"max"),onblur:this._onMaxInputBlur,onkeydown:this._onInputKeyDown})}renderMinInput(){return _("input",{afterCreate:this._afterInputCreate,"aria-label":this.messages.minimumValue,bind:this,class:v.rangeInput,"data-input-type":"min",required:!0,tabIndex:0,type:"text",value:this._formatInputValue(this.min,"min"),onblur:this._onMinInputBlur,onkeydown:this._onInputKeyDown})}renderExtraContentElements(){return _("div",{bind:this,class:v.extraContentElement},this.extraNodes)}renderTicksContainer(){if(this.tickConfigs&&this.trackElement&&(0!==this._trackHeight||0!==this._trackWidth))return this.tickConfigs.map(((e,t)=>_("div",{key:"ticks-container",class:this.classes(v.ticksContainerElement)},this.renderTicks(e,t))))}renderTicks(e,i){const{mode:n,values:s}=e;if(this.tickElements.getItemAt(i)||this.tickElements.add(new t,i),"position"===n){const t=Array.isArray(s)?s:[s];return this._calculateTickPositions(t).map(((t,n)=>this.renderTickGroup(e,n,i,t)))}if("percent"===n&&Array.isArray(s)){const{max:t,min:n}=this,o=t-n,r=s.map((e=>this._applyPrecisionToPosition(e/100*o+n)));return this._calculateTickPositions(r).map(((t,n)=>this.renderTickGroup(e,n,i,t)))}const o=Array.isArray(s)&&s.length?s[0]:isNaN(s)?null:s,r=this._getTickCounts(o,e);return this._calculateEquidistantTickPositions(r).map(((t,n)=>this.renderTickGroup(e,n,i,t)))}renderTickGroup(e,t,i,n){const s="position"===e.mode?Array.isArray(e.values)?e.values[t]:e.values:this._valueFromPosition(n);if(o(s)&&!isNaN(s))return _("div",{afterCreate:this._afterTickGroupCreate,afterRemoved:this._afterTickGroupRemoved,bind:this,"data-config":e,"data-position":n,"data-tick-config-index":i,"data-tick-group-index":t,"data-value":s,onclick:this._onTickGroupClick,key:`tick-group-${t}`},this.renderTickLine(e,t,i,s),e.labelsVisible?this.renderTickLabel(e,t,i,s):null)}renderTickLine(e,t,i,n){return _("div",{afterCreate:this._afterTickLineCreate,"aria-valuenow":n.toString(),bind:this,class:v.tickElement,"data-config":e,"data-tick-config-index":i,"data-tick-group-index":t,"data-value":n,key:`tick-label-${t}`,style:this._getPositionStyleForElement(n)})}renderTickLabel(e,t,i,n){const s=e.labelFormatFunction?e.labelFormatFunction(n,"tick",t):this.viewModel.getLabelForValue(n,"tick",t);return _("div",{afterCreate:this._afterTickLabelCreate,"aria-label":s,"aria-valuenow":n.toString(),"aria-valuetext":s,bind:this,class:v.tickLabelElement,"data-config":e,"data-tick-config-index":i,"data-tick-group-index":t,"data-value":n,key:`tick-label-${t}`,style:`transform: translate(-50%); ${this._getPositionStyleForElement(n)}`},s)}_afterContainerCreate(e){this.own(u(e,(()=>this.scheduleRender())))}_afterTrackCreate(e){this._set("trackElement",e),e.addEventListener("pointerdown",this._onTrackPointerDown),this.scheduleRender()}_afterTrackRemoved(e){e.removeEventListener("pointerdown",this._onTrackPointerDown),document.removeEventListener("pointermove",this._onTrackPointerMove),document.removeEventListener("pointerup",this._onTrackPointerUp)}_afterSegmentCreate(e){this.segmentElements.add(e),e.addEventListener("pointerdown",this._onSegmentPointerDown)}_afterSegmentRemoved(e){this.segmentElements.remove(e),e.removeEventListener("pointerdown",this._onSegmentPointerDown)}_afterAnchorCreate(e){if(this._anchorElements.push(e),e.addEventListener("pointerdown",this._onAnchorPointerDown),this.thumbCreatedFunction){const t=e["data-thumb-index"],i=e["data-value"],n=this.thumbElements.getItemAt(t)||null,s=this.labelElements.getItemAt(t)||null;this.thumbCreatedFunction(t,i,n,s)}}_afterAnchorUpdate(e){if(o(this._focusedAnchorIndex)){e["data-thumb-index"]===this._focusedAnchorIndex&&(e.focus(),this._focusedAnchorIndex=null)}}_afterAnchorRemoved(e){const t=this._anchorElements.indexOf(e,0);t>-1&&this._anchorElements.splice(t,1),e.removeEventListener("pointerdown",this._onAnchorPointerDown)}_afterThumbCreate(e){this.thumbElements.add(e)}_afterThumbRemoved(e){this.thumbElements.remove(e)}_afterLabelCreate(e){this.labelElements.add(e),e.addEventListener("pointerdown",this._onLabelPointerDown),e.addEventListener("pointerup",this._onLabelPointerUp)}_afterLabelRemoved(e){this.labelElements.remove(e),e.removeEventListener("pointerdown",this._onLabelPointerDown),e.removeEventListener("pointerup",this._onLabelPointerUp)}_afterInputCreate(e){if(e.focus(),e.select(),this.inputCreatedFunction){const t=e.getAttribute("data-input-type"),i="thumb"===t?e["data-input-index"]:null;this.inputCreatedFunction(e,t,i)}}_afterTickLineCreate(e){const t=e["data-tick-config-index"],i=e["data-tick-group-index"],n=this.tickElements.getItemAt(t);n.getItemAt(i)?n.getItemAt(i).tickElement=e:n.add({groupElement:null,tickElement:e,labelElement:null},i)}_afterTickLabelCreate(e){const t=e["data-tick-config-index"],i=e["data-tick-group-index"],n=this.tickElements.getItemAt(t);n.getItemAt(i)?n.getItemAt(i).labelElement=e:n.add({groupElement:null,labelElement:e,tickElement:null},i)}_afterTickGroupRemoved(e){const t=e["data-tick-config-index"],i=this.tickElements.items[t],n=null==i?void 0:i.find((t=>t.groupElement===e));n&&i.remove(n)}_afterTickGroupCreate(e){const t=e["data-config"];if(t&&t.tickCreatedFunction){var i,n;const s=e["data-tick-config-index"],o=e["data-tick-group-index"],r=e["data-value"],a=null==(i=this.tickElements)||null==(n=i.getItemAt(s))?void 0:n.getItemAt(o);if(a){a.groupElement=e;const i=a.tickElement||null,n=a.labelElement||null;t.tickCreatedFunction(r,i,n)}}}_afterMaxLabelCreate(e){this._set("maxLabelElement",e)}_afterMinLabelCreate(e){this._set("minLabelElement",e)}_onAnchorKeyDown(e){if(this._isDisabled()||"editing"===this.state)return;const{target:t}=e,i=n(e),{_anchorElements:s,values:r}=this,a=t["data-thumb-index"],l=s[a],h=r[a],d=this._isHorizontalLayout(),c=[g.moveAnchorUp,g.moveAnchorDown,g.moveAnchorLeft,g.moveAnchorRight];if(i===g.showInput&&this.labelInputsEnabled)this._activeLabelInputIndex=a,this.notifyChange("state");else if(c.indexOf(i)>-1){e.preventDefault();const{steps:t}=this,n=i===g.moveAnchorUp||i===g.moveAnchorRight?1:-1;if(o(t))this._toStep(a,this._isReversedLayout()?-1*n:n);else{const{precision:e}=this,t=this._getPositionOfElement(l),i=this._valueFromPosition(t),s=this._isHorizontalLayout()?n:-1*n;let o;o=0===e?this._positionFromValue(i+s):1===e?this._positionFromValue(i+.1*s):t+s,this._toPosition(a,o)}const s=this.values[a];h!==s&&this._emitThumbChangeEvent({index:a,oldValue:h,value:s})}else if(i===g.moveAnchorToMax||i===g.moveAnchorToMin){e.preventDefault();const{min:t,max:n}=this._getAnchorBoundsInPixels(a),s=d?i===g.moveAnchorToMax?n:t:i===g.moveAnchorToMin?n:t;this._toPosition(a,s);const o=this.values[a];h!==o&&this._emitThumbChangeEvent({index:a,oldValue:h,value:o})}}_onAnchorPointerDown(e){if(this._isDisabled())return;const{target:t,clientX:i,clientY:n}=e,s=t["data-thumb-index"];void 0!==s&&(e.preventDefault(),this._anchorElements[s]&&this._anchorElements[s].focus(),this._storeTrackDimensions(),this._dragStartInfo={clientX:i,clientY:n,index:s,position:this._getPositionOfElement(this._anchorElements[s])},this.notifyChange("state"),document.addEventListener("pointerup",this._onAnchorPointerUp),document.addEventListener("pointermove",this._onAnchorPointerMove))}_onAnchorPointerMove(e){if("editing"===this.state||!this._dragStartInfo)return;e.preventDefault();const{values:t,_anchorElements:i,_dragged:n,_dragStartInfo:s,_dragStartInfo:{index:o,position:r}}=this,{clientX:a,clientY:l}=e,h=n?"drag":"start",d=i[o],c=this._getPositionOfElement(d),u=this._applyPrecisionToPosition(this._isHorizontalLayout()?r+a-s.clientX:r+l-s.clientY);if(c===u)return;const m=t[o];this._dragged=!0,this._toPosition(o,u);const _=this.values[o];n?m!==_&&this._emitThumbDragEvent({index:o,state:h,value:_}):this._emitThumbDragEvent({index:o,state:h,value:m})}_onAnchorPointerUp(e){if(document.removeEventListener("pointerup",this._onAnchorPointerUp),document.removeEventListener("pointermove",this._onAnchorPointerMove),!this._dragStartInfo)return;e.preventDefault();const{index:t}=this._dragStartInfo,i=this._dragged,n=this.values[t];this._dragged=!1,this._dragStartInfo=null,this._lastMovedHandleIndex=t,this.notifyChange("state"),i?this._emitThumbDragEvent({index:t,state:"stop",value:n}):(this.scheduleRender(),"editing"!==this.state&&this._emitThumbClickEvent({index:t,value:n}))}_onTrackPointerDown(e){const{_dragStartInfo:t,snapOnClickEnabled:i,state:n,values:s}=this;if(this._isDisabled()||"editing"===n||t)return;if(document.addEventListener("pointermove",this._onTrackPointerMove),document.addEventListener("pointerup",this._onTrackPointerUp),!i||!s.length)return;const{steps:r}=this,{clientX:a,clientY:l}=e,h=this._getCursorPositionFromEvent(e),d=this._valueFromPosition(h),c=this._getIndexOfNearestValue(d),u=s[c],m=s.some(((e,t)=>e===u&&t!==c))&&d>u?this.values.lastIndexOf(u):c;if(!o(m))return;const _=s[m],p=o(r)?this._calculateNearestStepPosition(h):h;this._toPosition(m,p),this._dragged=!0,this._dragStartInfo={clientX:a,clientY:l,index:m,position:p},this._focusedAnchorIndex=m,this.notifyChange("state"),this._emitThumbDragEvent({index:m,state:"start",value:_});const v=this.values[m];_!==v&&this._emitThumbDragEvent({index:m,state:"drag",value:v}),document.addEventListener("pointerup",this._onAnchorPointerUp),document.addEventListener("pointermove",this._onAnchorPointerMove)}_onTrackPointerMove(e){e.preventDefault(),this._dragged=!0}_onTrackPointerUp(e){if(e.preventDefault(),document.removeEventListener("pointermove",this._onTrackPointerMove),document.removeEventListener("pointerup",this._onTrackPointerUp),this.snapOnClickEnabled||(this._dragged=!1),!this._dragged){const t=this._getCursorPositionFromEvent(e),i=this._valueFromPosition(t);this._emitTrackClickEvent({value:i})}}_onSegmentPointerDown(e){e.preventDefault();const t=e.target,i=t["data-segment-index"],n=t["data-min-thumb-index"],s=t["data-max-thumb-index"];if(this._isDisabled()||!o(n)||!o(s))return;e.stopPropagation(),this._storeTrackDimensions(),document.addEventListener("pointerup",this._onSegmentPointerUp);const r=this._getAnchorDetails(n),a=this._getAnchorDetails(s);var l,h;this.syncedSegmentsEnabled?(this.segmentElements.forEach((e=>e.classList.add(v.segmentElementActive))),this._anchorElements.forEach((e=>e.classList.add(v.anchorElementActive)))):(this.segmentElements.getItemAt(i).classList.add(v.segmentElementActive),null==(l=this._anchorElements[r.index])||l.classList.add(v.anchorElementActive),null==(h=this._anchorElements[a.index])||h.classList.add(v.anchorElementActive));this._segmentDragStartInfo={cursorPosition:this._getCursorPositionFromEvent(e),index:i,details:this._normalizeSegmentDetails({min:r,max:a})},this.draggableSegmentsEnabled&&(document.addEventListener("pointermove",this._onSegmentPointerMove),this.notifyChange("state"),this._emitSegmentDragEvent({index:i,state:"start",thumbIndices:[n,s]}))}_onSegmentPointerMove(e){if(!this._segmentDragStartInfo)return;e.preventDefault();const{_trackHeight:t,_trackWidth:i,_segmentDragStartInfo:{index:n,cursorPosition:s,details:{min:o,max:r}}}=this,{index:a,position:l,value:h}=o,{index:d,position:c,value:u}=r;this._dragged=!0;const m=this._getCursorPositionFromEvent(e);if(m===s)return;const _=this._positionToPercent(s),p=this._positionToPercent(m)-_,v=this._positionToPercent(l)+p,g=this._positionToPercent(c)+p,{min:b}=this._getAnchorBoundsAsPercents(a),{max:f}=this._getAnchorBoundsAsPercents(d);let E=!1,x=!1;if(v<b?E=!0:g>f&&(x=!0),E){const{min:e,max:t}=this.viewModel.getBoundsForValueAtIndex(a),i=this._isPositionInverted()?t:e,n=i,s=u+(i-h),o=s-this.values[d];return void(this.syncedSegmentsEnabled?this._updateAnchorValuesByDifference(o):this._updateAnchorValues([a,d],[n,s]))}if(x){const{min:e,max:t}=this.viewModel.getBoundsForValueAtIndex(d),i=this._isPositionInverted()?e:t,n=i,s=h+(i-u),o=s-this.values[a];return void(this.syncedSegmentsEnabled?this._updateAnchorValuesByDifference(o):this._updateAnchorValues([a,d],[s,n]))}const k=this._isHorizontalLayout()?i:t,y=g/100*k,I=v/100*k,P=this.values,A=[P[a],P[d]],L=this._getValueForAnchorAtPosition(a,I),C=this._getValueForAnchorAtPosition(d,y);this.syncedSegmentsEnabled?this._updateAnchorValuesByDifference(L-A[0]):this._updateAnchorValues([a,d],[L,C]);[this.values[a],this.values[d]].every(((e,t)=>e===A[t]))||this._emitSegmentDragEvent({index:n,state:"drag",thumbIndices:[a,d]})}_onSegmentPointerUp(e){if(e.preventDefault(),document.removeEventListener("pointerup",this._onSegmentPointerUp),document.removeEventListener("pointermove",this._onSegmentPointerMove),!this._segmentDragStartInfo)return;const{_dragged:t,max:i,min:n,values:s}=this,{index:o,details:{min:{index:r},max:{index:a}}}=this._segmentDragStartInfo;if(this.segmentElements.forEach((e=>e.classList.remove(v.segmentElementActive))),this._anchorElements.forEach((e=>e.classList.remove(v.anchorElementActive))),this.draggableSegmentsEnabled){const e=i-n,t=s[r],l=s[a];this._lastMovedHandleIndex=t===l?t>e/2?r:a:null,this._dragged=!1,this._segmentDragStartInfo=null,this.notifyChange("state"),this._emitSegmentDragEvent({index:o,state:"stop",thumbIndices:[r,a]})}if(!t){const t=this._getCursorPositionFromEvent(e),i=this._valueFromPosition(t);this._emitSegmentClickEvent({index:o,value:i,thumbIndices:[r,a]})}}_onTickGroupClick(e){const t=e.target;if(t["data-config"]){const e=t["data-tick-config-index"],i=t["data-tick-group-index"],n=t["data-value"];this._emitTickClickEvent({configIndex:e,groupIndex:i,value:n})}}_storeTrackDimensions(){if(this.trackElement){const e=this._getDimensions(this.trackElement);this._trackHeight=e.height,this._trackWidth=e.width}}_onLabelPointerDown(){this._isDisabled()||(this._dragged=!1,document.addEventListener("pointerup",this._onAnchorPointerUp),document.addEventListener("pointermove",this._onAnchorPointerMove))}_onLabelPointerMove(){this._isDisabled()||(this._dragged=!0)}_onLabelPointerUp(e){if(this._isDisabled())return;const t=e.target["data-thumb-index"];this.labelInputsEnabled&&!this._dragged&&o(t)&&(this._activeLabelInputIndex=t),this._dragged=!1,this.notifyChange("state"),document.removeEventListener("pointerup",this._onLabelPointerUp),document.removeEventListener("pointermove",this._onLabelPointerMove)}_onLabelInputBlur(e){const{_activeLabelInputIndex:t,values:i,viewModel:n}=this,s=e.target.value;if(this._activeLabelInputIndex=null,this.notifyChange("state"),!s)return;const o=this._parseInputValue(s,"value",t),r=i[t],{min:a,max:l}=this.viewModel.getBoundsForValueAtIndex(t);if(o<a||o>l)return;n.setValue(t,o);const h=this.values[t];r!==h&&this._emitThumbChangeEvent({index:t,oldValue:r,value:h})}_onInputKeyDown(e){if(this._isDisabled())return;const{target:t}=e,i=n(e),{hideInput1:s,hideInput2:r,hideInput3:a}=g,{_activeLabelInputIndex:l,_anchorElements:h}=this,d=t;if(i===s||i===r||i===a){e.stopPropagation();const t=l;d.blur(),o(t)?h[t].focus():d.parentElement.focus()}}_onMaxLabelClick(){this._isDisabled()||(this._emitRangeLabelClickEvent({type:"max-click",value:this.max}),this.rangeLabelInputsEnabled&&(this._isMaxInputActive=!0,this.notifyChange("state")))}_onMaxLabelKeyDown(e){this._isDisabled()||n(e)!==g.showInput||(this._isMaxInputActive=!0,this.notifyChange("state"))}_onMaxInputBlur(e){const t=e.target.value;if(this._isMaxInputActive=!1,this.notifyChange("state"),!t)return;const i=this.max,n=this._parseInputValue(t,"max");n<=this.min||(this.viewModel.set("max",n),this.max!==i&&this._emitMaxChangeEvent({oldValue:i,value:this.max}))}_onMinLabelClick(){this._isDisabled()||(this._emitRangeLabelClickEvent({type:"min-click",value:this.min}),this.rangeLabelInputsEnabled&&(this._isMinInputActive=!0,this.notifyChange("state")))}_onMinLabelKeyDown(e){this._isDisabled()||n(e)!==g.showInput||(this._isMinInputActive=!0,this.notifyChange("state"))}_onMinInputBlur(e){const t=e.target.value;if(this._isMinInputActive=!1,this.notifyChange("state"),!t)return;const i=this.min,n=this._parseInputValue(t,"min");n>=this.max||(this.viewModel.set("min",n),this.min!==i&&this._emitMinChangeEvent({oldValue:i,value:this.min}))}_isDisabled(){return this.disabled||"disabled"===this.state}_positionFromValue(e){const{max:t,min:i}=this,n=t-i;if(0===n)return 0;const{_trackHeight:s,_trackWidth:o}=this,r=this._isHorizontalLayout();let a=r?parseFloat((o*(e-i)/n).toFixed(2)):parseFloat((s*(t-e)/n).toFixed(2));return this._isReversedLayout()&&(a=r?o-a:s-a),a}_valueFromPosition(e){const{_trackHeight:t,_trackWidth:i,max:n,min:s,precision:o}=this,r=n-s;let a=this._isHorizontalLayout()?e*r/i+s:r*(1e3-e/t*1e3)/1e3+s;return this._isReversedLayout()&&(a=n+s-a),parseFloat(a.toFixed(o))}_positionToPercent(e){const{_trackHeight:t,_trackWidth:i}=this,n=100*e/(this._isHorizontalLayout()?i:t);return this._applyPrecisionToPosition(n)}_applyPrecisionToPosition(e){return parseFloat(e.toFixed(this._positionPrecision))}_isPositionInverted(){const{layout:e}=this;return"horizontal-reversed"===e||"vertical"===e}_isHorizontalLayout(){return this.layout.indexOf("horizontal")>-1}_isReversedLayout(){return this.layout.indexOf("reversed")>-1}_normalizeSegmentDetails(e){if(this._isPositionInverted()){const{min:t,max:i}=e;return{min:i,max:t}}return e}_parseInputValue(e,t,i){return this.inputParseFunction?this.inputParseFunction(e,t,i):this.viewModel.defaultInputParseFunction(e)}_formatInputValue(e,t,i){return this.inputFormatFunction?this.inputFormatFunction(e,t,i):this.viewModel.defaultInputFormatFunction(e)}_getAnchorDetails(e){const t=[...this.values].sort(((e,t)=>e-t))[e],i=this.values.indexOf(t);return{index:i,position:this._getPositionOfElement(this._anchorElements[i]),value:t}}_updateAnchorStyle(e,t){const i=this._anchorElements[e];i&&(this._isHorizontalLayout()?i.style.left=`${t}`:i.style.top=`${t}`)}_getStyleForAnchor(e,t,i){const n=this._getPositionStyleForElement(e);if(1===this.values.length)return`${n}`;const s=this._zIndices[t];return`${n}; z-index: ${i?this._zIndexOffset+s:s}`}_getPositionStyleForElement(e){const t=this._positionFromValue(e),i=this._positionToPercent(t);return`${this._isHorizontalLayout()?"left":"top"}: ${i+"%"}`}_getPositionOfElement(e){const t=this._getDimensions(e.offsetParent),i=this._getDimensions(e);return this._isHorizontalLayout()?this._applyPrecisionToPosition(i.left-t.left):this._applyPrecisionToPosition(i.top-t.top)}_updateAnchorValues(e,t){e.forEach(((e,i)=>this._toValue(e,t[i])))}_updateAnchorValuesByDifference(e){const{min:t,max:i,values:n}=this;n.forEach(((n,s)=>this._toValue(s,Math.max(Math.min(n+e,i),t))))}_toValue(e,t){if(o(this.steps)){t=this._getStepValues()[this._getIndexOfNearestStepValue(t)]}this._updateAnchorStyle(e,this._getPositionStyleForElement(t)),this.viewModel.setValue(e,t)}_toPosition(e,t){const i=o(this.steps)?this._getStepValueForAnchorAtPosition(e,t):this._getValueForAnchorAtPosition(e,t);this._updateAnchorStyle(e,this._getPositionStyleForElement(i)),this.viewModel.setValue(e,i)}_getValueForAnchorAtPosition(e,t){const{min:i,max:n}=this._getAnchorBoundsInPixels(e),{min:s,max:o}=this.viewModel.getBoundsForValueAtIndex(e);let r,a,l=null;return this._isPositionInverted()?(r=s,a=o):(r=o,a=s),l=t>n?r:t<i?a:this._valueFromPosition(t),l>o?l=o:l<s&&(l=s),l}_getStepValueForAnchorAtPosition(e,t){const i=this._getStepValues(),n=this._calculateNearestStepPosition(t),s=this._getValueForAnchorAtPosition(e,n);return i[this._getIndexOfNearestStepValue(s)]}_getAnchorBoundsAsPercents(e){const{min:t,max:i}=this._getAnchorBoundsInPixels(e);return{min:this._positionToPercent(t),max:this._positionToPercent(i)}}_getAnchorBoundsInPixels(e){const{_anchorElements:t,_trackHeight:i,_trackWidth:n,thumbsConstrained:s}=this,o=t[e-1],r=t[e+1],a=this._isHorizontalLayout()?n:i;return s?this._isPositionInverted()?{max:o?this._getPositionOfElement(o):a,min:r?this._getPositionOfElement(r):0}:{max:r?this._getPositionOfElement(r):a,min:o?this._getPositionOfElement(o):0}:{max:a,min:0}}_getIndexOfNearestValue(e){return this.values.indexOf(this.values.reduce(((t,i)=>Math.abs(i-e)<Math.abs(t-e)?i:t)))}_getCursorPositionFromEvent(e){const t=this._getDimensions(this.trackElement);return this._isHorizontalLayout()?e.clientX-t.left:e.clientY-t.top}_getStepValues(){const{steps:e}=this;if(Array.isArray(e))return e;const{max:t,min:i}=this,n=Math.ceil((t-i)/e),s=[];for(let o=0;o<=n;o++){const n=i+e*o;s.push(n>t?t:n)}return s}_toStep(e,t){const{values:i,viewModel:n}=this,s=i[e],o=this._getStepValues(),r=o.indexOf(s);let a=null;if(r>-1){const i=o[r+t],n=this._positionFromValue(i);a=this._getStepValueForAnchorAtPosition(e,n)}else{a=o[this._getIndexOfNearestStepValue(s)+t]}n.setValue(e,a)}_getIndexOfNearestStepValue(e){const{steps:t}=this;if(!o(t))return null;const i=this._getStepValues(),n=i.reduce(((t,i)=>Math.abs(i-e)<Math.abs(t-e)?i:t));return i.indexOf(n)}_calculateNearestStepPosition(e){const t=this._valueFromPosition(e),i=this._getIndexOfNearestStepValue(t),n=this._getStepValues();return this._positionFromValue(n[i])}_getTickCounts(e,t){const{mode:i}=t;return"count"===i||"position"===i?e||0:"percent"===i&&100/e||0}_calculateTickPositions(e){return e.map((e=>this._positionFromValue(e)))}_calculateEquidistantTickPositions(e){const{_trackWidth:t,_trackHeight:i}=this,n=this._isHorizontalLayout()?t:i,s=n/(e-1),o=[];if(1===e)return[n/2];for(let r=0;r<e;r++){const e=r*s;e<=n&&o.push(e)}return o}_getDimensions(e){try{return e.getBoundingClientRect()}catch(t){if("object"==typeof t&&null!==t)return new DOMRect(0,0,0,0);throw t}}_emitTrackClickEvent(e){this.emit("track-click",{...e,type:"track-click"})}_emitTickClickEvent(e){this.emit("tick-click",{...e,type:"tick-click"})}_emitMaxChangeEvent(e){this.emit("max-change",{...e,type:"max-change"})}_emitMinChangeEvent(e){this.emit("min-change",{...e,type:"min-change"})}_emitThumbChangeEvent(e){this.emit("thumb-change",{...e,type:"thumb-change"})}_emitThumbClickEvent(e){this.emit("thumb-click",{...e,type:"thumb-click"})}_emitThumbDragEvent(e){this.emit("thumb-drag",{...e,type:"thumb-drag"})}_emitSegmentClickEvent(e){this.emit("segment-click",{...e,type:"segment-click"})}_emitSegmentDragEvent(e){this.emit("segment-drag",{...e,type:"segment-drag"})}_emitRangeLabelClickEvent(e){this.emit(e.type,{...e})}};e([l()],x.prototype,"disabled",void 0),e([l()],x.prototype,"extraNodes",void 0),e([l()],x.prototype,"draggableSegmentsEnabled",void 0),e([l()],x.prototype,"inputCreatedFunction",void 0),e([r("viewModel.inputFormatFunction")],x.prototype,"inputFormatFunction",void 0),e([r("viewModel.inputParseFunction")],x.prototype,"inputParseFunction",void 0),e([l({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],x.prototype,"label",void 0),e([l({readOnly:!0})],x.prototype,"labelElements",void 0),e([l()],x.prototype,"labelInputsEnabled",void 0),e([r("viewModel.labelFormatFunction")],x.prototype,"labelFormatFunction",void 0),e([r("viewModel.labels")],x.prototype,"labels",void 0),e([l()],x.prototype,"labelsVisible",null),e([l({value:"horizontal"})],x.prototype,"layout",null),e([r("viewModel.max")],x.prototype,"max",void 0),e([l({readOnly:!0})],x.prototype,"maxLabelElement",void 0),e([l(),m("esri/widgets/Slider/t9n/Slider")],x.prototype,"messages",void 0),e([r("viewModel.min")],x.prototype,"min",void 0),e([l({readOnly:!0})],x.prototype,"minLabelElement",void 0),e([r("viewModel.precision")],x.prototype,"precision",void 0),e([l()],x.prototype,"rangeLabelInputsEnabled",void 0),e([l()],x.prototype,"rangeLabelsVisible",null),e([l({readOnly:!0})],x.prototype,"segmentElements",void 0),e([l()],x.prototype,"snapOnClickEnabled",void 0),e([l({readOnly:!0})],x.prototype,"state",null),e([l()],x.prototype,"steps",void 0),e([l()],x.prototype,"syncedSegmentsEnabled",void 0),e([r("viewModel.thumbsConstrained")],x.prototype,"thumbsConstrained",void 0),e([l()],x.prototype,"thumbCreatedFunction",void 0),e([l({readOnly:!0})],x.prototype,"thumbElements",void 0),e([l()],x.prototype,"tickConfigs",null),e([l({readOnly:!0})],x.prototype,"tickElements",void 0),e([l({readOnly:!0})],x.prototype,"trackElement",void 0),e([r("viewModel.values")],x.prototype,"values",void 0),e([l()],x.prototype,"viewModel",void 0),e([l()],x.prototype,"visibleElements",void 0),e([a("visibleElements")],x.prototype,"castVisibleElements",null),x=e([h(b)],x);const k=x;export{k as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import t from"../core/Collection.js";import{deprecatedProperty as i}from"../core/deprecate.js";import{eventKey as n}from"../core/events.js";import s from"../core/Logger.js";import{isSome as o}from"../core/maybe.js";import{aliasOf as r}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as a}from"../core/accessorSupport/decorators/cast.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import d from"./Widget.js";import c from"./Slider/SliderViewModel.js";import{onResize as m}from"./support/widgetUtils.js";import{messageBundle as u}from"./support/decorators/messageBundle.js";import{tsx as _}from"./support/jsxFactory.js";import{substitute as p}from"../intl/substitute.js";const v={base:"esri-slider",reversed:"esri-slider--reversed",horizontalLayout:"esri-slider--horizontal",verticalLayout:"esri-slider--vertical",contentElement:"esri-slider__content",extraContentElement:"esri-slider__extra-content",trackElement:"esri-slider__track",ticksContainerElement:"esri-slider__ticks",tickElement:"esri-slider__tick",tickLabelElement:"esri-slider__tick-label",maxElement:"esri-slider__max",minElement:"esri-slider__min",maxElementInteractive:"esri-slider__max--interactive",minElementInteractive:"esri-slider__min--interactive",rangeInput:"esri-slider__range-input",anchorElement:"esri-slider__anchor",movingAnchorElement:"esri-slider__anchor--moving",lastMovedAnchorElement:"esri-slider__anchor--moved",anchorElementActive:"esri-slider__anchor--active",anchorElementIndexPrefix:"esri-slider__anchor-",segmentElement:"esri-slider__segment",segmentElementIndexPrefix:"esri-slider__segment-",segmentElementInteractive:"esri-slider__segment--interactive",segmentElementActive:"esri-slider__segment--active",effectiveSegmentElement:"esri-slider__effective-segment",effectiveMaxSegmentElement:"esri-slider__effective-max-segment",effectiveMinSegmentElement:"esri-slider__effective-min-segment",thumbElement:"esri-slider__thumb",labelElement:"esri-slider__label",labelElementInteractive:"esri-slider__label--interactive",labelInput:"esri-slider__label-input",esriWidget:"esri-widget",widgetIcon:"esri-icon-edit",disabled:"esri-disabled",hidden:"esri-hidden"},g={showInput:"Enter",hideInput1:"Enter",hideInput2:"Escape",hideInput3:"Tab",moveAnchorUp:"ArrowUp",moveAnchorDown:"ArrowDown",moveAnchorLeft:"ArrowLeft",moveAnchorRight:"ArrowRight",moveAnchorToMax:"End",moveAnchorToMin:"Home"},f="esri.widgets.Slider",b=s.getLogger("esri.widgets.Slider"),E={labels:!1,rangeLabels:!1};let x=class extends d{constructor(e,i){super(e,i),this._activeLabelInputIndex=null,this._anchorElements=[],this._dragged=!1,this._dragStartInfo=null,this._focusedAnchorIndex=null,this._isMinInputActive=!1,this._isMaxInputActive=!1,this._lastMovedHandleIndex=null,this._positionPrecision=5,this._segmentDragStartInfo=null,this._trackHeight=null,this._trackWidth=null,this._zIndices=null,this._zIndexOffset=3,this.disabled=!1,this.draggableSegmentsEnabled=!0,this.effectiveMax=null,this.effectiveMin=null,this.effectiveSegmentElements=new t,this.extraNodes=[],this.inputCreatedFunction=null,this.inputFormatFunction=null,this.inputParseFunction=null,this.label=void 0,this.labelElements=new t,this.labelInputsEnabled=!1,this.labelFormatFunction=null,this.labels=null,this.max=null,this.maxLabelElement=null,this.messages=null,this.min=null,this.minLabelElement=null,this.precision=4,this.rangeLabelInputsEnabled=!1,this.segmentElements=new t,this.snapOnClickEnabled=!0,this.steps=null,this.syncedSegmentsEnabled=!1,this.thumbsConstrained=!0,this.thumbCreatedFunction=null,this.thumbElements=new t,this.tickElements=new t,this.trackElement=null,this.values=null,this.viewModel=new c,this.visibleElements={...E},this._onAnchorPointerDown=this._onAnchorPointerDown.bind(this),this._onAnchorPointerMove=this._onAnchorPointerMove.bind(this),this._onAnchorPointerUp=this._onAnchorPointerUp.bind(this),this._onLabelPointerDown=this._onLabelPointerDown.bind(this),this._onLabelPointerUp=this._onLabelPointerUp.bind(this),this._onSegmentPointerDown=this._onSegmentPointerDown.bind(this),this._onSegmentPointerMove=this._onSegmentPointerMove.bind(this),this._onSegmentPointerUp=this._onSegmentPointerUp.bind(this),this._onTrackPointerDown=this._onTrackPointerDown.bind(this),this._onTrackPointerMove=this._onTrackPointerMove.bind(this),this._onTrackPointerUp=this._onTrackPointerUp.bind(this)}destroy(){document.removeEventListener("pointerup",this._onLabelPointerUp),document.removeEventListener("pointermove",this._onLabelPointerMove),document.removeEventListener("pointerup",this._onAnchorPointerUp),document.removeEventListener("pointermove",this._onAnchorPointerMove),this.labelElements.removeAll(),this.labelElements.destroy(),this.segmentElements.removeAll(),this.segmentElements.destroy(),this.effectiveSegmentElements.removeAll(),this.effectiveSegmentElements.destroy(),this.thumbElements.removeAll(),this.thumbElements.destroy(),this.tickElements.removeAll(),this.tickElements.destroy()}set labelsVisible(e){i(b,"labelsVisible",{replacement:"visibleElements.labels",version:"4.15"}),this.visibleElements={...this.visibleElements,labels:e}}set layout(e){-1===["vertical","vertical-reversed","horizontal","horizontal-reversed"].indexOf(e)&&(e="horizontal"),this._set("layout",e)}set rangeLabelsVisible(e){i(b,"rangeLabelsVisible",{replacement:"visibleElements.rangeLabels",version:"4.15"}),this.visibleElements={...this.visibleElements,rangeLabels:e}}get state(){const{_activeLabelInputIndex:e,_isMaxInputActive:t,_isMinInputActive:i,_dragStartInfo:n,_segmentDragStartInfo:s,disabled:r,viewModel:a}=this,l=o(n)||o(s);return r?"disabled":!(null===e&&!t&&!i)?"editing":l?"dragging":a.state}set tickConfigs(e){this._set("tickConfigs",e),this.scheduleRender()}castVisibleElements(e){return{...E,...e}}render(){const{label:e}=this,t=this.classes(v.base,v.esriWidget,this._isHorizontalLayout()?v.horizontalLayout:v.verticalLayout,this._isReversedLayout()?v.reversed:null,this._isDisabled()?v.disabled:null);return this._storeTrackDimensions(),_("div",{"aria-label":e,class:t,"touch-action":"none",bind:this,afterCreate:this._afterContainerCreate},this.renderContent())}toNextStep(e){this._toStep(e,1)}toPreviousStep(e){this._toStep(e,-1)}renderContent(){const{max:e,min:t}=this;if(o(t)&&o(e)&&!(t>=e))return[this.renderMin(),this.renderSliderContainer(),this.renderMax()]}renderSliderContainer(){return _("div",{key:"slider-container",bind:this,class:v.contentElement},this.renderTrackElement(),this.renderTicksContainer(),this.renderExtraContentElements())}renderTrackElement(){return _("div",{afterCreate:this._afterTrackCreate,afterRemoved:this._afterTrackRemoved,bind:this,class:v.trackElement,"data-node-ref":"trackElement","touch-action":"none"},this.renderEffectiveSegmentElements(),this.renderSegmentElements(),this.renderAnchorElements())}renderEffectiveSegmentElements(){if(!this.trackElement||!this.values||!this.values.length)return;const e=o(this.effectiveMax),t=o(this.effectiveMin);if(!e&&!t)return;const{max:i,min:n,viewModel:s}=this,r=s.getBounds(),a=[];return t&&a.push(this.renderEffectiveSegmentElement(n,r.min,v.effectiveMinSegmentElement)),e&&a.push(this.renderEffectiveSegmentElement(r.max,i,v.effectiveMaxSegmentElement)),a}renderSegmentElements(){if(!this.trackElement||!this.values||!this.values.length)return;const e=this.values.length,t=[];for(let i=0;i<=e;i++)t.push(this.renderSegmentElement(i));return t}renderSegmentElement(e){const{_trackHeight:t,_trackWidth:i,draggableSegmentsEnabled:n,id:s,state:r,values:a}=this,l=this._isHorizontalLayout(),h=l?i:t,d=this.viewModel.getBounds(),c=this._positionFromValue(d.max),m=this._positionFromValue(d.min),u=e===a.length?null:e,p=0===e?null:e-1,g=o(u),f=o(p);let b,E;const x=[...a].sort(((e,t)=>e-t));this._isReversedLayout()?(b=f?this._positionFromValue(x[p]):l?c:m,E=g?this._positionFromValue(x[u]):l?m:c):(b=g?this._positionFromValue(x[u]):l?c:m,E=f?this._positionFromValue(x[p]):l?m:c);const k=this._applyPrecisionToPosition(100*E/h),y=(b-E)/h,I=l?`transform: translate(${k}%, 0px) scale(${y}, 1);`:`transform: translate(0px, ${k}%) scale(1, ${y});`,P=this.classes(v.segmentElement,v.segmentElementIndexPrefix+e,n&&g&&f&&"disabled"!==r?v.segmentElementInteractive:null);return _("div",{afterCreate:this._afterSegmentCreate,afterRemoved:this._afterSegmentRemoved,bind:this,class:P,"data-max-thumb-index":u,"data-min-thumb-index":p,"data-segment-index":e,key:`${s}-segment-${e}`,style:I,"touch-action":"none"})}renderEffectiveSegmentElement(e,t,i){const{_trackHeight:n,_trackWidth:s}=this,o=this._positionFromValue(e),r=this._positionFromValue(t),a=this._isHorizontalLayout(),l=a?s:n,h=this._applyPrecisionToPosition(100*o/l),d=(r-o)/l,c=a?`transform: translate(${h}%, 0px) scale(${d}, 1);`:`transform: translate(0px, ${h}%) scale(1, ${d});`,m=this.classes(v.segmentElement,v.effectiveSegmentElement,i);return _("div",{afterCreate:this._afterEffectiveSegmentCreate,afterRemoved:this._afterEffectiveSegmentRemoved,bind:this,class:m,style:c,"touch-action":"none"})}renderAnchorElements(){const{trackElement:e,values:t}=this;if(t&&t.length)return this._zIndices=t.map(((e,i)=>{const n=this._positionFromValue(e),s=this._positionToPercent(n),o=(this._isHorizontalLayout()?s>50:s<50)?-1:1;return this._zIndexOffset+(t.length+o*i)})),e&&t&&t.length?t.map(((e,t)=>this.renderAnchorElement(e,t))):null}renderAnchorElement(e,t){const i=this._positionFromValue(e),n=this._valueFromPosition(i);if(!o(n)||isNaN(n))return;const{_dragStartInfo:s,_lastMovedHandleIndex:r,id:a,layout:l,values:h,visibleElements:{labels:d}}=this,c=s&&s.index===t,m=r===t,u=this.classes(v.anchorElement,v.anchorElementIndexPrefix+t,c?v.movingAnchorElement:null,m?v.lastMovedAnchorElement:null),g=this.labels.values[t],f=this._getStyleForAnchor(e,t,c||m),{min:b,max:E}=this.viewModel.getBoundsForValueAtIndex(t),{messages:x}=this,k=2===h.length?p(0===t?x.rangeMinimum:x.rangeMaximum,{value:e}):g,y=1===h.length?null:0===t?`${a}-handle-${t+1}`:t===h.length-1?`${a}-handle-${t-1}`:`${a}-handle-${t-1} ${a}-handle-${t+1}`;return _("div",{afterCreate:this._afterAnchorCreate,afterUpdate:this._afterAnchorUpdate,afterRemoved:this._afterAnchorRemoved,"aria-controls":y,"aria-label":x.sliderValue,"aria-labelledby":d?`${a}-label-${t}`:null,"aria-orientation":l,"aria-valuemax":E.toString(),"aria-valuemin":b.toString(),"aria-valuenow":e.toString(),"aria-valuetext":k,bind:this,class:u,"data-thumb-index":t,"data-value":e,id:`${a}-handle-${t}`,key:`${a}-handle-${t}`,onkeydown:this._onAnchorKeyDown,"touch-action":"none",role:"slider",style:f,tabIndex:0},_("span",{afterCreate:this._afterThumbCreate,afterRemoved:this._afterThumbRemoved,bind:this,class:v.thumbElement,"data-thumb-index":t,"touch-action":"none"}),this.renderThumbLabel(t))}renderThumbLabel(e){const{id:t,labels:i,labelInputsEnabled:n,state:s}=this,o=this.visibleElements.labels,r=i.values[e],a=this.classes(v.labelElement,o?null:v.hidden,n&&"disabled"!==s?v.labelElementInteractive:null);return _("span",{afterCreate:this._afterLabelCreate,afterRemoved:this._afterLabelRemoved,"aria-hidden":(!o).toString(),bind:this,class:a,"data-thumb-index":e,key:`${t}-label-${e}`,id:`${t}-label-${e}`,role:n?"button":null,"touch-action":"none"},this._activeLabelInputIndex===e?this.renderValueInput(e):r)}renderValueInput(e){const t=this.values[e];return _("input",{afterCreate:this._afterInputCreate,"aria-label":this.messages.sliderValue,bind:this,class:v.labelInput,"data-input-type":"thumb","data-input-index":e,required:!0,tabIndex:0,type:"text",value:this._formatInputValue(t,"value",e),onblur:this._onLabelInputBlur,onkeydown:this._onInputKeyDown})}renderMax(){const{_isMaxInputActive:e,labels:t,rangeLabelInputsEnabled:i,state:n}=this,s=this.visibleElements.rangeLabels,o=this.classes(v.maxElement,s?null:v.hidden,i&&"disabled"!==n?v.maxElementInteractive:null);return _("div",{"aria-hidden":(!s).toString(),afterCreate:this._afterMaxLabelCreate,bind:this,class:o,onclick:this._onMaxLabelClick,onkeydown:this._onMaxLabelKeyDown,role:i?"button":null,tabIndex:i?0:null},e?this.renderMaxInput():t.max)}renderMin(){const{_isMinInputActive:e,labels:t,rangeLabelInputsEnabled:i,state:n}=this,s=this.visibleElements.rangeLabels,o=this.classes(v.minElement,s?null:v.hidden,i&&"disabled"!==n?v.minElementInteractive:null);return _("div",{"aria-hidden":(!s).toString(),afterCreate:this._afterMinLabelCreate,bind:this,class:o,onclick:this._onMinLabelClick,onkeydown:this._onMinLabelKeyDown,role:i?"button":null,tabIndex:i?0:null},e?this.renderMinInput():t.min)}renderMaxInput(){return _("input",{afterCreate:this._afterInputCreate,"aria-label":this.messages.maximumValue,bind:this,class:v.rangeInput,"data-input-type":"max",required:!0,tabIndex:0,type:"text",value:this._formatInputValue(this.max,"max"),onblur:this._onMaxInputBlur,onkeydown:this._onInputKeyDown})}renderMinInput(){return _("input",{afterCreate:this._afterInputCreate,"aria-label":this.messages.minimumValue,bind:this,class:v.rangeInput,"data-input-type":"min",required:!0,tabIndex:0,type:"text",value:this._formatInputValue(this.min,"min"),onblur:this._onMinInputBlur,onkeydown:this._onInputKeyDown})}renderExtraContentElements(){return _("div",{bind:this,class:v.extraContentElement},this.extraNodes)}renderTicksContainer(){if(this.tickConfigs&&this.trackElement&&(0!==this._trackHeight||0!==this._trackWidth))return this.tickConfigs.map(((e,t)=>_("div",{key:"ticks-container",class:this.classes(v.ticksContainerElement)},this.renderTicks(e,t))))}renderTicks(e,i){const{mode:n,values:s}=e;if(this.tickElements.getItemAt(i)||this.tickElements.add(new t,i),"position"===n){const t=Array.isArray(s)?s:[s];return this._calculateTickPositions(t).map(((t,n)=>this.renderTickGroup(e,n,i,t)))}if("percent"===n&&Array.isArray(s)){const{max:t,min:n}=this,o=t-n,r=s.map((e=>this._applyPrecisionToPosition(e/100*o+n)));return this._calculateTickPositions(r).map(((t,n)=>this.renderTickGroup(e,n,i,t)))}const o=Array.isArray(s)&&s.length?s[0]:isNaN(s)?null:s,r=this._getTickCounts(o,e);return this._calculateEquidistantTickPositions(r).map(((t,n)=>this.renderTickGroup(e,n,i,t)))}renderTickGroup(e,t,i,n){const s="position"===e.mode?Array.isArray(e.values)?e.values[t]:e.values:this._valueFromPosition(n);if(o(s)&&!isNaN(s))return _("div",{afterCreate:this._afterTickGroupCreate,afterRemoved:this._afterTickGroupRemoved,bind:this,"data-config":e,"data-position":n,"data-tick-config-index":i,"data-tick-group-index":t,"data-value":s,onclick:this._onTickGroupClick,key:`tick-group-${t}`},this.renderTickLine(e,t,i,s),e.labelsVisible?this.renderTickLabel(e,t,i,s):null)}renderTickLine(e,t,i,n){return _("div",{afterCreate:this._afterTickLineCreate,"aria-valuenow":n.toString(),bind:this,class:v.tickElement,"data-config":e,"data-tick-config-index":i,"data-tick-group-index":t,"data-value":n,key:`tick-label-${t}`,style:this._getPositionStyleForElement(n)})}renderTickLabel(e,t,i,n){const s=e.labelFormatFunction?e.labelFormatFunction(n,"tick",t):this.viewModel.getLabelForValue(n,"tick",t);return _("div",{afterCreate:this._afterTickLabelCreate,"aria-label":s,"aria-valuenow":n.toString(),"aria-valuetext":s,bind:this,class:v.tickLabelElement,"data-config":e,"data-tick-config-index":i,"data-tick-group-index":t,"data-value":n,key:`tick-label-${t}`,style:`transform: translate(-50%); ${this._getPositionStyleForElement(n)}`},s)}_afterContainerCreate(e){this.own(m(e,(()=>this.scheduleRender())))}_afterTrackCreate(e){this._set("trackElement",e),e.addEventListener("pointerdown",this._onTrackPointerDown),this.scheduleRender()}_afterTrackRemoved(e){e.removeEventListener("pointerdown",this._onTrackPointerDown),document.removeEventListener("pointermove",this._onTrackPointerMove),document.removeEventListener("pointerup",this._onTrackPointerUp)}_afterSegmentCreate(e){this.segmentElements.add(e),e.addEventListener("pointerdown",this._onSegmentPointerDown)}_afterSegmentRemoved(e){this.segmentElements.remove(e),e.removeEventListener("pointerdown",this._onSegmentPointerDown)}_afterEffectiveSegmentCreate(e){this.effectiveSegmentElements.add(e)}_afterEffectiveSegmentRemoved(e){this.effectiveSegmentElements.remove(e)}_afterAnchorCreate(e){if(this._anchorElements.push(e),e.addEventListener("pointerdown",this._onAnchorPointerDown),this.thumbCreatedFunction){const t=e["data-thumb-index"],i=e["data-value"],n=this.thumbElements.getItemAt(t)||null,s=this.labelElements.getItemAt(t)||null;this.thumbCreatedFunction(t,i,n,s)}}_afterAnchorUpdate(e){if(o(this._focusedAnchorIndex)){e["data-thumb-index"]===this._focusedAnchorIndex&&(e.focus(),this._focusedAnchorIndex=null)}}_afterAnchorRemoved(e){const t=this._anchorElements.indexOf(e,0);t>-1&&this._anchorElements.splice(t,1),e.removeEventListener("pointerdown",this._onAnchorPointerDown)}_afterThumbCreate(e){this.thumbElements.add(e)}_afterThumbRemoved(e){this.thumbElements.remove(e)}_afterLabelCreate(e){this.labelElements.add(e),e.addEventListener("pointerdown",this._onLabelPointerDown),e.addEventListener("pointerup",this._onLabelPointerUp)}_afterLabelRemoved(e){this.labelElements.remove(e),e.removeEventListener("pointerdown",this._onLabelPointerDown),e.removeEventListener("pointerup",this._onLabelPointerUp)}_afterInputCreate(e){if(e.focus(),e.select(),this.inputCreatedFunction){const t=e.getAttribute("data-input-type"),i="thumb"===t?e["data-input-index"]:null;this.inputCreatedFunction(e,t,i)}}_afterTickLineCreate(e){const t=e["data-tick-config-index"],i=e["data-tick-group-index"],n=this.tickElements.getItemAt(t);n.getItemAt(i)?n.getItemAt(i).tickElement=e:n.add({groupElement:null,tickElement:e,labelElement:null},i)}_afterTickLabelCreate(e){const t=e["data-tick-config-index"],i=e["data-tick-group-index"],n=this.tickElements.getItemAt(t);n.getItemAt(i)?n.getItemAt(i).labelElement=e:n.add({groupElement:null,labelElement:e,tickElement:null},i)}_afterTickGroupRemoved(e){const t=e["data-tick-config-index"],i=this.tickElements.items[t],n=null==i?void 0:i.find((t=>t.groupElement===e));n&&i.remove(n)}_afterTickGroupCreate(e){const t=e["data-config"];if(t&&t.tickCreatedFunction){var i,n;const s=e["data-tick-config-index"],o=e["data-tick-group-index"],r=e["data-value"],a=null==(i=this.tickElements)||null==(n=i.getItemAt(s))?void 0:n.getItemAt(o);if(a){a.groupElement=e;const i=a.tickElement||null,n=a.labelElement||null;t.tickCreatedFunction(r,i,n)}}}_afterMaxLabelCreate(e){this._set("maxLabelElement",e)}_afterMinLabelCreate(e){this._set("minLabelElement",e)}_onAnchorKeyDown(e){if(this._isDisabled()||"editing"===this.state)return;const{target:t}=e,i=n(e),{_anchorElements:s,values:r}=this,a=t["data-thumb-index"],l=s[a],h=r[a],d=[g.moveAnchorUp,g.moveAnchorDown,g.moveAnchorLeft,g.moveAnchorRight];if(i===g.showInput&&this.labelInputsEnabled)this._activeLabelInputIndex=a,this.notifyChange("state");else if(d.indexOf(i)>-1){e.preventDefault();const{steps:t}=this,n=i===g.moveAnchorUp||i===g.moveAnchorRight?1:-1;if(o(t))this._toStep(a,this._isReversedLayout()?-1*n:n);else{const{precision:e}=this,t=this._getPositionOfElement(l),i=this._valueFromPosition(t),s=this._isHorizontalLayout()?n:-1*n;let o;o=0===e?this._positionFromValue(i+s):1===e?this._positionFromValue(i+.1*s):t+s,this._toPosition(a,o)}const s=this.values[a];h!==s&&this._emitThumbChangeEvent({index:a,oldValue:h,value:s})}else if(i===g.moveAnchorToMax||i===g.moveAnchorToMin){e.preventDefault();const{min:t,max:n}=this._getAnchorBoundsInPixels(a),s=this._isPositionInverted()?i===g.moveAnchorToMax?t:n:i===g.moveAnchorToMin?t:n;this._toPosition(a,s);const o=this.values[a];h!==o&&this._emitThumbChangeEvent({index:a,oldValue:h,value:o})}}_onAnchorPointerDown(e){if(this._isDisabled())return;const{target:t,clientX:i,clientY:n}=e,s=t["data-thumb-index"];void 0!==s&&(e.preventDefault(),this._anchorElements[s]&&this._anchorElements[s].focus(),this._storeTrackDimensions(),this._dragStartInfo={clientX:i,clientY:n,index:s,position:this._getPositionOfElement(this._anchorElements[s])},this.notifyChange("state"),document.addEventListener("pointerup",this._onAnchorPointerUp),document.addEventListener("pointermove",this._onAnchorPointerMove))}_onAnchorPointerMove(e){if("editing"===this.state||!this._dragStartInfo)return;e.preventDefault();const{values:t,_anchorElements:i,_dragged:n,_dragStartInfo:s,_dragStartInfo:{index:o,position:r}}=this,{clientX:a,clientY:l}=e,h=n?"drag":"start",d=i[o],c=this._getPositionOfElement(d),m=this._applyPrecisionToPosition(this._isHorizontalLayout()?r+a-s.clientX:r+l-s.clientY);if(c===m)return;const u=t[o];this._dragged=!0,this._toPosition(o,m);const _=this.values[o];n?u!==_&&this._emitThumbDragEvent({index:o,state:h,value:_}):this._emitThumbDragEvent({index:o,state:h,value:u})}_onAnchorPointerUp(e){if(document.removeEventListener("pointerup",this._onAnchorPointerUp),document.removeEventListener("pointermove",this._onAnchorPointerMove),!this._dragStartInfo)return;e.preventDefault();const{index:t}=this._dragStartInfo,i=this._dragged,n=this.values[t];this._dragged=!1,this._dragStartInfo=null,this._lastMovedHandleIndex=t,this.notifyChange("state"),i?this._emitThumbDragEvent({index:t,state:"stop",value:n}):(this.scheduleRender(),"editing"!==this.state&&this._emitThumbClickEvent({index:t,value:n}))}_onTrackPointerDown(e){const{_dragStartInfo:t,snapOnClickEnabled:i,state:n,values:s}=this;if(this._isDisabled()||"editing"===n||t)return;if(document.addEventListener("pointermove",this._onTrackPointerMove),document.addEventListener("pointerup",this._onTrackPointerUp),!i||!s.length)return;const{steps:r}=this,{clientX:a,clientY:l}=e,h=this._getCursorPositionFromEvent(e),d=this._valueFromPosition(h),c=this._getIndexOfNearestValue(d),m=s[c],u=s.some(((e,t)=>e===m&&t!==c))&&d>m?this.values.lastIndexOf(m):c;if(!o(u))return;const _=s[u],p=o(r)?this._calculateNearestStepPosition(h):h;this._toPosition(u,p),this._dragged=!0,this._dragStartInfo={clientX:a,clientY:l,index:u,position:p},this._focusedAnchorIndex=u,this.notifyChange("state"),this._emitThumbDragEvent({index:u,state:"start",value:_});const v=this.values[u];_!==v&&this._emitThumbDragEvent({index:u,state:"drag",value:v}),document.addEventListener("pointerup",this._onAnchorPointerUp),document.addEventListener("pointermove",this._onAnchorPointerMove)}_onTrackPointerMove(e){e.preventDefault(),this._dragged=!0}_onTrackPointerUp(e){if(e.preventDefault(),document.removeEventListener("pointermove",this._onTrackPointerMove),document.removeEventListener("pointerup",this._onTrackPointerUp),this.snapOnClickEnabled||(this._dragged=!1),!this._dragged){const t=this._getCursorPositionFromEvent(e),i=this._valueFromPosition(t);this._emitTrackClickEvent({value:i})}}_onSegmentPointerDown(e){e.preventDefault();const t=e.target,i=t["data-segment-index"],n=t["data-min-thumb-index"],s=t["data-max-thumb-index"];if(this._isDisabled()||!o(n)||!o(s))return;e.stopPropagation(),this._storeTrackDimensions(),document.addEventListener("pointerup",this._onSegmentPointerUp);const r=this._getAnchorDetails(n),a=this._getAnchorDetails(s);var l,h;this.syncedSegmentsEnabled?(this.segmentElements.forEach((e=>e.classList.add(v.segmentElementActive))),this._anchorElements.forEach((e=>e.classList.add(v.anchorElementActive)))):(this.segmentElements.getItemAt(i).classList.add(v.segmentElementActive),null==(l=this._anchorElements[r.index])||l.classList.add(v.anchorElementActive),null==(h=this._anchorElements[a.index])||h.classList.add(v.anchorElementActive));this._segmentDragStartInfo={cursorPosition:this._getCursorPositionFromEvent(e),index:i,details:this._normalizeSegmentDetails({min:r,max:a})},this.draggableSegmentsEnabled&&(document.addEventListener("pointermove",this._onSegmentPointerMove),this.notifyChange("state"),this._emitSegmentDragEvent({index:i,state:"start",thumbIndices:[n,s]}))}_onSegmentPointerMove(e){if(!this._segmentDragStartInfo)return;e.preventDefault();const{_trackHeight:t,_trackWidth:i,_segmentDragStartInfo:{index:n,cursorPosition:s,details:{min:o,max:r}}}=this,{index:a,position:l,value:h}=o,{index:d,position:c,value:m}=r;this._dragged=!0;const u=this._getCursorPositionFromEvent(e);if(u===s)return;const _=this._positionToPercent(s),p=this._positionToPercent(u)-_,v=this._positionToPercent(l)+p,g=this._positionToPercent(c)+p,{min:f}=this._getAnchorBoundsAsPercents(a),{max:b}=this._getAnchorBoundsAsPercents(d);let E=!1,x=!1;if(v<f?E=!0:g>b&&(x=!0),E){const{min:e,max:t}=this.viewModel.getBoundsForValueAtIndex(a),i=this._isPositionInverted()?t:e,n=i,s=m+(i-h),o=s-this.values[d];return void(this.syncedSegmentsEnabled?this._updateAnchorValuesByDifference(o):this._updateAnchorValues([a,d],[n,s]))}if(x){const{min:e,max:t}=this.viewModel.getBoundsForValueAtIndex(d),i=this._isPositionInverted()?e:t,n=i,s=h+(i-m),o=s-this.values[a];return void(this.syncedSegmentsEnabled?this._updateAnchorValuesByDifference(o):this._updateAnchorValues([a,d],[s,n]))}const k=this._isHorizontalLayout()?i:t,y=g/100*k,I=v/100*k,P=this.values,A=[P[a],P[d]],L=this._getValueForAnchorAtPosition(a,I),S=this._getValueForAnchorAtPosition(d,y);this.syncedSegmentsEnabled?this._updateAnchorValuesByDifference(L-A[0]):this._updateAnchorValues([a,d],[L,S]);[this.values[a],this.values[d]].every(((e,t)=>e===A[t]))||this._emitSegmentDragEvent({index:n,state:"drag",thumbIndices:[a,d]})}_onSegmentPointerUp(e){if(e.preventDefault(),document.removeEventListener("pointerup",this._onSegmentPointerUp),document.removeEventListener("pointermove",this._onSegmentPointerMove),!this._segmentDragStartInfo)return;const{_dragged:t,max:i,min:n,values:s}=this,{index:o,details:{min:{index:r},max:{index:a}}}=this._segmentDragStartInfo;if(this.segmentElements.forEach((e=>e.classList.remove(v.segmentElementActive))),this._anchorElements.forEach((e=>e.classList.remove(v.anchorElementActive))),this.draggableSegmentsEnabled){const e=i-n,t=s[r],l=s[a];this._lastMovedHandleIndex=t===l?t>e/2?r:a:null,this._dragged=!1,this._segmentDragStartInfo=null,this.notifyChange("state"),this._emitSegmentDragEvent({index:o,state:"stop",thumbIndices:[r,a]})}if(!t){const t=this._getCursorPositionFromEvent(e),i=this._valueFromPosition(t);this._emitSegmentClickEvent({index:o,value:i,thumbIndices:[r,a]})}}_onTickGroupClick(e){const t=e.target;if(t["data-config"]){const e=t["data-tick-config-index"],i=t["data-tick-group-index"],n=t["data-value"];this._emitTickClickEvent({configIndex:e,groupIndex:i,value:n})}}_storeTrackDimensions(){if(this.trackElement){const e=this._getDimensions(this.trackElement);this._trackHeight=e.height,this._trackWidth=e.width}}_onLabelPointerDown(){this._isDisabled()||(this._dragged=!1,document.addEventListener("pointerup",this._onAnchorPointerUp),document.addEventListener("pointermove",this._onAnchorPointerMove))}_onLabelPointerMove(){this._isDisabled()||(this._dragged=!0)}_onLabelPointerUp(e){if(this._isDisabled())return;const t=e.target["data-thumb-index"];this.labelInputsEnabled&&!this._dragged&&o(t)&&(this._activeLabelInputIndex=t),this._dragged=!1,this.notifyChange("state"),document.removeEventListener("pointerup",this._onLabelPointerUp),document.removeEventListener("pointermove",this._onLabelPointerMove)}_onLabelInputBlur(e){const{_activeLabelInputIndex:t,values:i,viewModel:n}=this,s=e.target.value;if(this._activeLabelInputIndex=null,this.notifyChange("state"),!s)return;const o=this._parseInputValue(s,"value",t),r=i[t],{min:a,max:l}=this.viewModel.getBoundsForValueAtIndex(t);if(o<a||o>l)return;n.setValue(t,o);const h=this.values[t];r!==h&&this._emitThumbChangeEvent({index:t,oldValue:r,value:h})}_onInputKeyDown(e){if(this._isDisabled())return;const{target:t}=e,i=n(e),{hideInput1:s,hideInput2:r,hideInput3:a}=g,{_activeLabelInputIndex:l,_anchorElements:h}=this,d=t;if(i===s||i===r||i===a){e.stopPropagation();const t=l;d.blur(),o(t)?h[t].focus():d.parentElement.focus()}}_onMaxLabelClick(){this._isDisabled()||(this._emitRangeLabelClickEvent({type:"max-click",value:this.max}),this.rangeLabelInputsEnabled&&(this._isMaxInputActive=!0,this.notifyChange("state")))}_onMaxLabelKeyDown(e){this._isDisabled()||n(e)!==g.showInput||(this._isMaxInputActive=!0,this.notifyChange("state"))}_onMaxInputBlur(e){const t=e.target.value;if(this._isMaxInputActive=!1,this.notifyChange("state"),!t)return;const i=this.max,n=this._parseInputValue(t,"max");n<=this.min||(this.viewModel.set("max",n),this.max!==i&&this._emitMaxChangeEvent({oldValue:i,value:this.max}))}_onMinLabelClick(){this._isDisabled()||(this._emitRangeLabelClickEvent({type:"min-click",value:this.min}),this.rangeLabelInputsEnabled&&(this._isMinInputActive=!0,this.notifyChange("state")))}_onMinLabelKeyDown(e){this._isDisabled()||n(e)!==g.showInput||(this._isMinInputActive=!0,this.notifyChange("state"))}_onMinInputBlur(e){const t=e.target.value;if(this._isMinInputActive=!1,this.notifyChange("state"),!t)return;const i=this.min,n=this._parseInputValue(t,"min");n>=this.max||(this.viewModel.set("min",n),this.min!==i&&this._emitMinChangeEvent({oldValue:i,value:this.min}))}_isDisabled(){return this.disabled||"disabled"===this.state}_positionFromValue(e){const{max:t,min:i}=this,n=t-i;if(0===n)return 0;const{_trackHeight:s,_trackWidth:o}=this,r=this._isHorizontalLayout();let a=r?parseFloat((o*(e-i)/n).toFixed(2)):parseFloat((s*(t-e)/n).toFixed(2));return this._isReversedLayout()&&(a=r?o-a:s-a),a}_valueFromPosition(e){const{_trackHeight:t,_trackWidth:i,max:n,min:s,precision:o}=this,r=n-s;let a=this._isHorizontalLayout()?e*r/i+s:r*(1e3-e/t*1e3)/1e3+s;return this._isReversedLayout()&&(a=n+s-a),parseFloat(a.toFixed(o))}_positionToPercent(e){const{_trackHeight:t,_trackWidth:i}=this,n=100*e/(this._isHorizontalLayout()?i:t);return this._applyPrecisionToPosition(n)}_applyPrecisionToPosition(e){return parseFloat(e.toFixed(this._positionPrecision))}_isPositionInverted(){const{layout:e}=this;return"horizontal-reversed"===e||"vertical"===e}_isHorizontalLayout(){return this.layout.indexOf("horizontal")>-1}_isReversedLayout(){return this.layout.indexOf("reversed")>-1}_normalizeSegmentDetails(e){if(this._isPositionInverted()){const{min:t,max:i}=e;return{min:i,max:t}}return e}_parseInputValue(e,t,i){return this.inputParseFunction?this.inputParseFunction(e,t,i):this.viewModel.defaultInputParseFunction(e)}_formatInputValue(e,t,i){return this.inputFormatFunction?this.inputFormatFunction(e,t,i):this.viewModel.defaultInputFormatFunction(e)}_getAnchorDetails(e){const t=[...this.values].sort(((e,t)=>e-t))[e],i=this.values.indexOf(t);return{index:i,position:this._getPositionOfElement(this._anchorElements[i]),value:t}}_updateAnchorStyle(e,t){const i=this._anchorElements[e];i&&(this._isHorizontalLayout()?i.style.left=`${t}`:i.style.top=`${t}`)}_getStyleForAnchor(e,t,i){const n=this._getPositionStyleForElement(e);if(1===this.values.length)return`${n}`;const s=this._zIndices[t];return`${n}; z-index: ${i?this._zIndexOffset+s:s}`}_getPositionStyleForElement(e){const t=this._positionFromValue(e),i=this._positionToPercent(t);return`${this._isHorizontalLayout()?"left":"top"}: ${i+"%"}`}_getPositionOfElement(e){const t=this._getDimensions(e.offsetParent),i=this._getDimensions(e);return this._isHorizontalLayout()?this._applyPrecisionToPosition(i.left-t.left):this._applyPrecisionToPosition(i.top-t.top)}_updateAnchorValues(e,t){e.forEach(((e,i)=>this._toValue(e,t[i])))}_updateAnchorValuesByDifference(e){const{min:t,max:i,values:n}=this;n.forEach(((n,s)=>this._toValue(s,Math.max(Math.min(n+e,i),t))))}_toValue(e,t){if(o(this.steps)){t=this._getStepValues()[this._getIndexOfNearestStepValue(t)]}this._updateAnchorStyle(e,this._getPositionStyleForElement(t)),this.viewModel.setValue(e,t)}_toPosition(e,t){const i=o(this.steps)?this._getStepValueForAnchorAtPosition(e,t):this._getValueForAnchorAtPosition(e,t);this._updateAnchorStyle(e,this._getPositionStyleForElement(i)),this.viewModel.setValue(e,i)}_getValueForAnchorAtPosition(e,t){const{min:i,max:n}=this._getAnchorBoundsInPixels(e),{min:s,max:o}=this.viewModel.getBoundsForValueAtIndex(e);let r,a,l=null;return this._isPositionInverted()?(r=s,a=o):(r=o,a=s),l=t>n?r:t<i?a:this._valueFromPosition(t),l>o?l=o:l<s&&(l=s),l}_getStepValueForAnchorAtPosition(e,t){const i=this._getStepValues(),n=this._calculateNearestStepPosition(t),s=this._getValueForAnchorAtPosition(e,n);return i[this._getIndexOfNearestStepValue(s)]}_getAnchorBoundsAsPercents(e){const{min:t,max:i}=this._getAnchorBoundsInPixels(e);return{min:this._positionToPercent(t),max:this._positionToPercent(i)}}_getAnchorBoundsInPixels(e){const{_anchorElements:t,_trackHeight:i,_trackWidth:n,effectiveMax:s,effectiveMin:r,thumbsConstrained:a}=this,l=t[e-1],h=t[e+1],d=this._isHorizontalLayout()?n:i,c=o(s)?this._isPositionInverted()?d-this._positionFromValue(s):this._positionFromValue(s):d,m=o(r)?this._isPositionInverted()?d-this._positionFromValue(r):this._positionFromValue(r):0;return a?this._isPositionInverted()?{max:l?this._getPositionOfElement(l):c,min:h?this._getPositionOfElement(h):m}:{max:h?this._getPositionOfElement(h):c,min:l?this._getPositionOfElement(l):m}:{max:c,min:m}}_getIndexOfNearestValue(e){return this.values.indexOf(this.values.reduce(((t,i)=>Math.abs(i-e)<Math.abs(t-e)?i:t)))}_getCursorPositionFromEvent(e){const t=this._getDimensions(this.trackElement);return this._isHorizontalLayout()?e.clientX-t.left:e.clientY-t.top}_getStepValues(){const{steps:e}=this;if(Array.isArray(e))return e;const{max:t,min:i}=this,n=Math.ceil((t-i)/e),s=[];for(let o=0;o<=n;o++){const n=i+e*o;s.push(n>t?t:n)}return s}_toStep(e,t){const{values:i,viewModel:n}=this,s=i[e],o=this._getStepValues(),r=o.indexOf(s);let a=null;if(r>-1){let i=o[r+t];isNaN(i)&&(i=o[r]);const n=this._positionFromValue(i);a=this._getStepValueForAnchorAtPosition(e,n)}else{a=o[this._getIndexOfNearestStepValue(s)+t]}n.setValue(e,a)}_getIndexOfNearestStepValue(e){const{steps:t}=this;if(!o(t))return null;const i=this._getStepValues(),n=i.reduce(((t,i)=>Math.abs(i-e)<Math.abs(t-e)?i:t));return i.indexOf(n)}_calculateNearestStepPosition(e){const t=this._valueFromPosition(e),i=this._getIndexOfNearestStepValue(t),n=this._getStepValues();return this._positionFromValue(n[i])}_getTickCounts(e,t){const{mode:i}=t;return"count"===i||"position"===i?e||0:"percent"===i&&100/e||0}_calculateTickPositions(e){return e.map((e=>this._positionFromValue(e)))}_calculateEquidistantTickPositions(e){const{_trackWidth:t,_trackHeight:i}=this,n=this._isHorizontalLayout()?t:i,s=n/(e-1),o=[];if(1===e)return[n/2];for(let r=0;r<e;r++){const e=r*s;e<=n&&o.push(e)}return o}_getDimensions(e){try{return e.getBoundingClientRect()}catch(t){if("object"==typeof t&&null!==t)return new DOMRect(0,0,0,0);throw t}}_emitTrackClickEvent(e){this.emit("track-click",{...e,type:"track-click"})}_emitTickClickEvent(e){this.emit("tick-click",{...e,type:"tick-click"})}_emitMaxChangeEvent(e){this.emit("max-change",{...e,type:"max-change"})}_emitMinChangeEvent(e){this.emit("min-change",{...e,type:"min-change"})}_emitThumbChangeEvent(e){this.emit("thumb-change",{...e,type:"thumb-change"})}_emitThumbClickEvent(e){this.emit("thumb-click",{...e,type:"thumb-click"})}_emitThumbDragEvent(e){this.emit("thumb-drag",{...e,type:"thumb-drag"})}_emitSegmentClickEvent(e){this.emit("segment-click",{...e,type:"segment-click"})}_emitSegmentDragEvent(e){this.emit("segment-drag",{...e,type:"segment-drag"})}_emitRangeLabelClickEvent(e){this.emit(e.type,{...e})}};e([l()],x.prototype,"disabled",void 0),e([l()],x.prototype,"draggableSegmentsEnabled",void 0),e([r("viewModel.effectiveMax")],x.prototype,"effectiveMax",void 0),e([r("viewModel.effectiveMin")],x.prototype,"effectiveMin",void 0),e([l({readOnly:!0})],x.prototype,"effectiveSegmentElements",void 0),e([l()],x.prototype,"extraNodes",void 0),e([l()],x.prototype,"inputCreatedFunction",void 0),e([r("viewModel.inputFormatFunction")],x.prototype,"inputFormatFunction",void 0),e([r("viewModel.inputParseFunction")],x.prototype,"inputParseFunction",void 0),e([l({aliasOf:{source:"messages.widgetLabel",overridable:!0}})],x.prototype,"label",void 0),e([l({readOnly:!0})],x.prototype,"labelElements",void 0),e([l()],x.prototype,"labelInputsEnabled",void 0),e([r("viewModel.labelFormatFunction")],x.prototype,"labelFormatFunction",void 0),e([r("viewModel.labels")],x.prototype,"labels",void 0),e([l()],x.prototype,"labelsVisible",null),e([l({value:"horizontal"})],x.prototype,"layout",null),e([r("viewModel.max")],x.prototype,"max",void 0),e([l({readOnly:!0})],x.prototype,"maxLabelElement",void 0),e([l(),u("esri/widgets/Slider/t9n/Slider")],x.prototype,"messages",void 0),e([r("viewModel.min")],x.prototype,"min",void 0),e([l({readOnly:!0})],x.prototype,"minLabelElement",void 0),e([r("viewModel.precision")],x.prototype,"precision",void 0),e([l()],x.prototype,"rangeLabelInputsEnabled",void 0),e([l()],x.prototype,"rangeLabelsVisible",null),e([l({readOnly:!0})],x.prototype,"segmentElements",void 0),e([l()],x.prototype,"snapOnClickEnabled",void 0),e([l({readOnly:!0})],x.prototype,"state",null),e([l()],x.prototype,"steps",void 0),e([l()],x.prototype,"syncedSegmentsEnabled",void 0),e([r("viewModel.thumbsConstrained")],x.prototype,"thumbsConstrained",void 0),e([l()],x.prototype,"thumbCreatedFunction",void 0),e([l({readOnly:!0})],x.prototype,"thumbElements",void 0),e([l()],x.prototype,"tickConfigs",null),e([l({readOnly:!0})],x.prototype,"tickElements",void 0),e([l({readOnly:!0})],x.prototype,"trackElement",void 0),e([r("viewModel.values")],x.prototype,"values",void 0),e([l()],x.prototype,"viewModel",void 0),e([l()],x.prototype,"visibleElements",void 0),e([a("visibleElements")],x.prototype,"castVisibleElements",null),x=e([h(f)],x);const k=x;export{k as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import r from"../../core/Handles.js";import{isNone as s,
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import r from"../../core/Handles.js";import{isNone as s,destroyMaybe as n,applySome as o,unwrapOr as i,isSome as a}from"../../core/maybe.js";import{watch as h,syncAndInitial as p}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import c from"../../views/3d/environment/CloudyWeather.js";import y from"../../views/3d/environment/FoggyWeather.js";import u from"../../views/3d/environment/RainyWeather.js";import w from"../../views/3d/environment/SnowyWeather.js";import d from"../../views/3d/environment/SunnyWeather.js";import{WeatherState as v,WeatherError as _}from"./enums.js";let f=class extends t{constructor(e){super(e),this.view=null,this._handles=new r,this._settingWeather=!1,this._weatherByType={sunny:new d,cloudy:new c,rainy:new u,snowy:new w,foggy:new y}}initialize(){this._handles.add([h((()=>this.current),(e=>{this._settingWeather||s(e)||(this._weatherByType={...this._weatherByType,[e.type]:e})}),p)])}destroy(){this._handles=n(this._handles)}get state(){const e=this.view;if(s(e)||!e.ready)return v.Disabled;switch(this.error){case"unsupported-view":case"local-scene":return v.Error;default:return v.Ready}}get error(){const e=this.view;return s(e)||!e.ready?null:"3d"!==e.type?_.UnsupportedView:"local"===e.viewingMode?_.LocalScene:e.environmentManager.weatherVisible?null:_.NotVisible}get current(){const e=o(this._environment,(e=>e.weather));return i(e,this._weatherByType.sunny)}set current(e){o(this._environment,(t=>t.weather=e))}get test(){return{...this._weatherByType}}get _environment(){const e=this.view;return a(e)&&"3d"===e.type?e.environment:null}setWeatherByType(e){const t=this._environment;a(t)&&(this._settingWeather=!0,t.weather=this._weatherByType[e],this._settingWeather=!1)}};e([l()],f.prototype,"view",void 0),e([l()],f.prototype,"state",null),e([l()],f.prototype,"error",null),e([l()],f.prototype,"current",null),e([l()],f.prototype,"_environment",null),f=e([m("esri.widgets.Weather.WeatherViewModel")],f);const g=f;export{g as default};
|
package/widgets/Weather/css.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const e="esri-weather",
|
|
5
|
+
const e="esri-weather",r={base:`${e}`,esriWidget:"esri-widget",esriWidgetDisabled:"esri-widget--disabled",widgetIcon:"esri-icon-partly-cloudy",content:`${e}__content`,selector:`${e}__selector`,error:`${e}__error`,warning:`${e}__warning`},i={base:`${`${e}__coverage-slider`}`};export{i as COVERAGE_SLIDER_CSS,r as CSS};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.23/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
var e,o;!function(e){e.Disabled="disabled",e.Ready="ready",e.Error="error"}(e||(e={})),function(e){e.NotVisible="not-visible",e.LocalScene="local-scene",e.UnsupportedView="unsupported-view"}(o||(o={}));export{o as WeatherError,e as WeatherState};
|