@arcgis/core 4.32.0-next.20241230 → 4.32.0-next.20250101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{3582a26a7309ac9f6945.js → 6a4305eb1e52b80ecb5c.js} +1 -1
- package/assets/esri/core/workers/chunks/756c2f7c8659deab6c96.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/a100fb789d72410f8d4f.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/b1e4813f0c73fc2a483c.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/bf0a0ca7fdac98f06a89.js.LICENSE.txt +1 -1
- package/assets/esri/core/workers/chunks/{e16d2521f006724697c2.js → d82b3e2905cab511ff3a.js} +2 -2
- package/assets/esri/core/workers/chunks/{e16d2521f006724697c2.js.LICENSE.txt → d82b3e2905cab511ff3a.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/e371f4f0eb3c22f222df.js +2 -0
- package/assets/esri/core/workers/chunks/{e1913990f30d285b3b15.js.LICENSE.txt → e371f4f0eb3c22f222df.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/ebf9caf2dc8af89afec2.js.LICENSE.txt +1 -1
- package/chunks/HighlightDownsample.glsl.js +22 -15
- package/chunks/HighlightToSingle.glsl.js +1 -1
- package/interfaces.d.ts +14 -3
- package/package.json +2 -2
- package/rest/networks/support/ValidateNetworkTopologyResult.js +1 -1
- package/support/revision.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js +8 -4
- package/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/widgets/Popup.js +1 -1
- package/assets/esri/core/workers/chunks/e1913990f30d285b3b15.js +0 -2
|
@@ -2,23 +2,30 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{NoParameters as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
for(int y = -
|
|
5
|
+
import{ScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{NoParameters as t,glsl as i}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as r}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DDrawUniform as l}from"../views/3d/webgl-engine/core/shaderModules/Texture2DDrawUniform.js";class u extends t{}function o(){const t=new r,{outputs:u,fragment:o}=t;return t.include(e),o.uniforms.add(new l("textureInput",(e=>e.input))),o.constants.add("outlineWidth","int",Math.ceil(n)),o.constants.add("cellSize","int",c),u.add("fragGrid","vec2"),o.main.add(i`ivec2 inputTextureSize = textureSize(textureInput, 0);
|
|
6
|
+
ivec2 cellBottomLeftCornerInput = ivec2(floor(gl_FragCoord.xy) * vec2(cellSize));
|
|
7
|
+
ivec2 coordMid = cellBottomLeftCornerInput + ivec2(cellSize >> 1);
|
|
8
|
+
uvec2 centreTexel = uvec2( texelFetch(textureInput, coordMid, 0).rg * 255.0) & uvec2(0x55u);
|
|
9
|
+
float marginSquare = float(outlineWidth*outlineWidth);
|
|
10
|
+
uvec2 outputValue = centreTexel & uvec2(0x55u);
|
|
11
|
+
for(int y = -outlineWidth; y <= cellSize + outlineWidth; y+=2) {
|
|
12
12
|
int dy = y < 0 ? -y : y > cellSize ? y-cellSize : 0;
|
|
13
|
-
int xMargin = dy > 0 ? int(ceil(sqrt(marginSquare - float(dy*dy)))) :
|
|
13
|
+
int xMargin = dy > 0 ? int(ceil(sqrt(marginSquare - float(dy*dy)))) : outlineWidth;
|
|
14
14
|
for(int x = -xMargin; x <= cellSize + xMargin; x+=2) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
ivec2 coord = cellBottomLeftCornerInput + ivec2(x, y);
|
|
16
|
+
uvec2[4] texels = uvec2[4] (
|
|
17
|
+
uvec2(texelFetch(textureInput,coord+ivec2(0,0),0).rg * 255.0) & uvec2(0x55u),
|
|
18
|
+
uvec2(texelFetch(textureInput,coord+ivec2(1,0),0).rg * 255.0) & uvec2(0x55u),
|
|
19
|
+
uvec2(texelFetch(textureInput,coord+ivec2(0,1),0).rg * 255.0) & uvec2(0x55u),
|
|
20
|
+
uvec2(texelFetch(textureInput,coord+ivec2(1,1),0).rg * 255.0) & uvec2(0x55u)
|
|
21
|
+
);
|
|
22
|
+
if (texels[0] == texels[1] && texels[1] == texels[2] && texels[2] == texels[3] && texels[3] == centreTexel) {
|
|
23
|
+
continue;
|
|
20
24
|
}
|
|
25
|
+
for (int i=0; i<4; ++i){
|
|
26
|
+
outputValue |= ((texels[i] ^ centreTexel) << 1);
|
|
27
|
+
outputValue |= texels[i];
|
|
21
28
|
}
|
|
22
29
|
}
|
|
23
|
-
|
|
24
|
-
fragGrid = vec2(
|
|
30
|
+
}
|
|
31
|
+
fragGrid = vec2(outputValue) / 255.0;`),t}const c=32,n=9,a=.4,d=Object.freeze(Object.defineProperty({__proto__:null,HighlightDownsampleDrawParameters:u,blurSize:a,build:o,gridCellPixelSize:c,outlineSize:n},Symbol.toStringTag,{value:"Module"}));export{u as H,d as a,a as b,o as c,c as g,n as o};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{HighlightCellGridScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js";import{HighlightReadBitmap as i}from"../views/3d/webgl-engine/core/shaderLibrary/HighlightReadBitmap.glsl.js";import{IntegerPassUniform as r}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{glsl as l}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as g}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";function s(){const s=new g;s.include(e),s.include(i);const{fragment:o}=s;return s.outputs.add("fragSingleHighlight","vec2",0),o.uniforms.add(new t("highlightTexture",(e=>e.highlightTexture)),new r("highlightLevel",(e=>e.highlightLevel))).main.add(l`ivec2 iuv = ivec2(gl_FragCoord.xy);
|
|
5
|
+
import{HighlightCellGridScreenSpacePass as e}from"../views/3d/webgl-engine/core/shaderLibrary/HighlightCellGridScreenSpacePass.glsl.js";import{HighlightReadBitmap as i}from"../views/3d/webgl-engine/core/shaderLibrary/HighlightReadBitmap.glsl.js";import{IntegerPassUniform as r}from"../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{glsl as l}from"../views/3d/webgl-engine/core/shaderModules/interfaces.js";import{ShaderBuilder as g}from"../views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js";import{Texture2DPassUniform as t}from"../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";function s(){const s=new g;s.include(e),s.include(i);const{fragment:o}=s;return s.outputs.add("fragSingleHighlight","vec2",0),o.uniforms.add(new t("highlightTexture",(e=>e.highlightTexture)),new r("highlightLevel",(e=>e.highlightLevel))),o.main.add(l`ivec2 iuv = ivec2(gl_FragCoord.xy);
|
|
6
6
|
vec2 inputTexel = texelFetch(highlightTexture, iuv, 0).rg;
|
|
7
7
|
uint bits = readLevelBits(inputTexel, highlightLevel);
|
|
8
8
|
bool hasHighlight = (bits & 1u) == 1u;
|
package/interfaces.d.ts
CHANGED
|
@@ -60959,7 +60959,6 @@ declare namespace __esri {
|
|
|
60959
60959
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-networks-support-ValidateNetworkTopologyResult.html Read more...}
|
|
60960
60960
|
*/
|
|
60961
60961
|
interface ValidateNetworkTopologyResult {
|
|
60962
|
-
dirtyAreaCount: number;
|
|
60963
60962
|
discoveredSubnetworks: Subnetwork[];
|
|
60964
60963
|
exceededTransferLimit: boolean;
|
|
60965
60964
|
fullUpdate: boolean;
|
|
@@ -86095,7 +86094,7 @@ declare namespace __esri {
|
|
|
86095
86094
|
*/
|
|
86096
86095
|
getVersionInfoExtended(): Promise<VersionInfoExtendedJSON>;
|
|
86097
86096
|
/**
|
|
86098
|
-
*
|
|
86097
|
+
* Returns all versions accessible to the currently logged-in user.
|
|
86099
86098
|
*
|
|
86100
86099
|
* @param refresh If refresh is true, a new REST call will be made to the server to get the available versions.
|
|
86101
86100
|
*
|
|
@@ -106220,6 +106219,12 @@ declare namespace __esri {
|
|
|
106220
106219
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Features.html#promises Read more...}
|
|
106221
106220
|
*/
|
|
106222
106221
|
promises: Promise<any>[];
|
|
106222
|
+
/**
|
|
106223
|
+
* The feature that the widget has drilled into.
|
|
106224
|
+
*
|
|
106225
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Features.html#selectedDrillInFeature Read more...}
|
|
106226
|
+
*/
|
|
106227
|
+
readonly selectedDrillInFeature: Graphic;
|
|
106223
106228
|
/**
|
|
106224
106229
|
* The selected feature accessed by the Features widget.
|
|
106225
106230
|
*
|
|
@@ -114925,6 +114930,12 @@ declare namespace __esri {
|
|
|
114925
114930
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#promises Read more...}
|
|
114926
114931
|
*/
|
|
114927
114932
|
promises: Promise<any>[];
|
|
114933
|
+
/**
|
|
114934
|
+
* The feature that the widget has drilled into.
|
|
114935
|
+
*
|
|
114936
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#selectedDrillInFeature Read more...}
|
|
114937
|
+
*/
|
|
114938
|
+
readonly selectedDrillInFeature: Graphic;
|
|
114928
114939
|
/**
|
|
114929
114940
|
* The selected feature accessed by the popup.
|
|
114930
114941
|
*
|
|
@@ -126353,7 +126364,7 @@ declare namespace __esri {
|
|
|
126353
126364
|
*/
|
|
126354
126365
|
deleteVersion(featureServerUrl: string, versionName: string, versionGuid: string): Promise<boolean>;
|
|
126355
126366
|
/**
|
|
126356
|
-
* Returns
|
|
126367
|
+
* Returns all versions accessible to the currently logged-in user.
|
|
126357
126368
|
*
|
|
126358
126369
|
* @param featureServerUrl The url of a feature service.
|
|
126359
126370
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "4.32.0-next.
|
|
3
|
+
"version": "4.32.0-next.20250101",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
29
|
-
"@esri/calcite-components": "~3.0.0-next.
|
|
29
|
+
"@esri/calcite-components": "~3.0.0-next.82",
|
|
30
30
|
"@vaadin/grid": "~24.6.0",
|
|
31
31
|
"@zip.js/zip.js": "~2.7.54",
|
|
32
32
|
"luxon": "~3.5.0",
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import o from"../../../core/JSONSupport.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";let s=class extends o{constructor(e){super(e),this.moment=null,this.fullUpdate=!1,this.validateErrorsCreated=!1,this.exceededTransferLimit=null,this.serviceEdits=null,this.discoveredSubnetworks=null}};e([t({type:Date,json:{type:Number,write:{writer:(e,o)=>{o.moment=e?e.getTime():null}}}})],s.prototype,"moment",void 0),e([t({type:Boolean,json:{write:!0}})],s.prototype,"fullUpdate",void 0),e([t({type:Boolean,json:{write:!0}})],s.prototype,"validateErrorsCreated",void 0),e([t({type:Boolean,json:{write:!0}})],s.prototype,"exceededTransferLimit",void 0),e([t({type:[Object],json:{write:!0}})],s.prototype,"serviceEdits",void 0),e([t({type:[Object],json:{write:!0}})],s.prototype,"discoveredSubnetworks",void 0),s=e([r("esri.rest.networks.support.ValidateNetworkTopologyResult")],s);const i=s;export{i as default};
|
package/support/revision.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const a="20250101",b="b6ca44001df4b6a844af4b1710eac365a5b450e7";export{a as buildDate,b as commitHash};
|
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{Integer2PassUniform as e}from"../shaderModules/Integer2PassUniform.js";import{
|
|
5
|
+
import{Integer2PassUniform as e}from"../shaderModules/Integer2PassUniform.js";import{IntegerPassUniform as l}from"../shaderModules/IntegerPassUniform.js";import{glsl as i}from"../shaderModules/interfaces.js";import{Texture2DPassUniform as t}from"../shaderModules/Texture2DPassUniform.js";import{g as n}from"../../../../../chunks/HighlightDownsample.glsl.js";function o(o){const{vertex:c}=o;c.uniforms.add(new t("coverageTexture",(e=>e.coverageTexture)),new e("highlightRenderCellCount",(e=>[e.horizontalCellCount,e.verticalCellCount])),new e("highlightTextureResolution",(e=>[e.highlightTexture.descriptor.width,e.highlightTexture.descriptor.height])),new l("highlightLevel",(e=>e.highlightLevel))),c.constants.add("cellSize","int",n),o.varyings.add("sUV","vec2"),o.varyings.add("vOutlinePossible","float"),c.code.add(i`const ivec2 cellVertices[4] = ivec2[4](ivec2(0,0), ivec2(1,0), ivec2(0,1), ivec2(1,1));`),c.main.add(i`int cellIndex = gl_InstanceID;
|
|
6
6
|
int cellX = cellIndex % highlightRenderCellCount[0];
|
|
7
7
|
int cellY = (cellIndex - cellX) / highlightRenderCellCount[0];
|
|
8
8
|
ivec2 cellPos = ivec2(cellX, cellY);
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
uvec2 covTexel = uvec2(texelFetch(coverageTexture, cellPos, 0).rg * 255.0);
|
|
10
|
+
int channelIndex = (highlightLevel >> 2) & 3;
|
|
11
|
+
uint channelValue = covTexel[channelIndex];
|
|
12
|
+
int highlightIndex = (highlightLevel & 3) << 1;
|
|
13
|
+
bool covered = ((channelValue >> highlightIndex) & 1u) == 1u;
|
|
14
|
+
if (!covered) {
|
|
11
15
|
gl_Position = vec4(0.0);
|
|
12
16
|
return;
|
|
13
17
|
}
|
|
14
|
-
vOutlinePossible =
|
|
18
|
+
vOutlinePossible = (((channelValue >> highlightIndex) & 2u) == 2u) ? 1.0 : 0.0;
|
|
15
19
|
ivec2 iPosInCell = cellVertices[gl_VertexID];
|
|
16
20
|
vec2 sPos = vec2(cellPos * cellSize + iPosInCell * (cellSize));
|
|
17
21
|
vec2 vPos = sPos / vec2(highlightTextureResolution);
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{BindType as r}from"../shaderTechnique/BindType.js";import{assert as n}from"../../lib/Util.js";const s=()=>t.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class i{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class o extends i{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new _,this.extensions=new d,this.outputs=new l}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),n=this.varyings.generateSource(e),s="vertex"===e?this.vertex:this.fragment,i=s.uniforms.generateSource(),o=s.code.generateSource(),a=s.main.generateSource(),u="vertex"===e?
|
|
5
|
+
import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{BindType as r}from"../shaderTechnique/BindType.js";import{assert as n}from"../../lib/Util.js";const s=()=>t.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class i{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class o extends i{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new m,this.varyings=new _,this.extensions=new d,this.outputs=new l}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const t=this.extensions.generateSource(e),r=this.attributes.generateSource(e),n=this.varyings.generateSource(e),s="vertex"===e?this.vertex:this.fragment,i=s.uniforms.generateSource(),o=s.code.generateSource(),a=s.main.generateSource(),u="vertex"===e?p:f,c=s.constants.generateSource(),h=this.outputs.generateSource(e);return`#version 300 es\n${t.join("\n")}\n\n${u}\n\n${c.join("\n")}\n\n${i.join("\n")}\n\n${r.join("\n")}\n\n${n.join("\n")}\n\n${h.join("\n")}\n\n${o.join("\n")}\n\n${a.join("\n")}`}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const n=e.bind[r.Pass];n&&t.set(e.name,n)})),this.fragment.uniforms.entries.forEach((e=>{const n=e.bind[r.Pass];n&&t.set(e.name,n)}));const n=Array.from(t.values()),s=n.length;return(t,r)=>{for(let i=0;i<s;++i)n[i](e,t,r)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach((e=>{const n=e.bind[r.Draw];n&&t.set(e.name,n)})),this.fragment.uniforms.entries.forEach((e=>{const n=e.bind[r.Draw];n&&t.set(e.name,n)}));const n=Array.from(t.values()),s=n.length;return(t,r,i)=>{for(let o=0;o<s;++o)n[o](e,i,t,r)}}}class a{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new e(`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else s().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map((e=>null!=e.arraySize?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`))}get entries(){return Array.from(this._entries.values())}}class u{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];throw new e("Shader does not contain main function body.")}}class c{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class h extends i{constructor(){super(...arguments),this.uniforms=new a(this),this.main=new u(this),this.code=new c(this),this.constants=new g(this)}get builder(){return this}}class m{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map((e=>`in ${e[1]} ${e[0]};`))}}class _{constructor(){this._entries=new Map}add(e,t){this._entries.has(e)&&n(this._entries.get(e)===t),this._entries.set(e,t)}generateSource(e){const t=new Array;return this._entries.forEach(((r,n)=>t.push("vertex"===e?`out ${r} ${n};`:`in ${r} ${n};`))),t}}class d{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const t="vertex"===e?d.ALLOWLIST_VERTEX:d.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter((e=>t.includes(e))).map((e=>`#extension ${e} : enable`))}}d.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],d.ALLOWLIST_VERTEX=[];class l{constructor(){this._entries=new Map}add(e,t,r=0){const s=this._entries.get(r);s?n(s.name===e&&s.type===t,`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:l.DEFAULT_NAME,type:l.DEFAULT_TYPE});const t=new Array;return this._entries.forEach(((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`))),t}}l.DEFAULT_TYPE="vec4",l.DEFAULT_NAME="fragColor";class g{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let n="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":n=g._numberToFloatStr(r);break;case"int":n=g._numberToIntStr(r);break;case"bool":n=r.toString();break;case"vec2":n=`vec2(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])})`;break;case"vec3":n=`vec3(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])})`;break;case"vec4":n=`vec4(${g._numberToFloatStr(r[0])}, ${g._numberToFloatStr(r[1])}, ${g._numberToFloatStr(r[2])}, ${g._numberToFloatStr(r[3])})`;break;case"ivec2":n=`ivec2(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])})`;break;case"ivec3":n=`ivec3(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])})`;break;case"ivec4":n=`ivec4(${g._numberToIntStr(r[0])}, ${g._numberToIntStr(r[1])}, ${g._numberToIntStr(r[2])}, ${g._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${t}(${Array.prototype.map.call(r,(e=>g._numberToFloatStr(e))).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${n};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const f="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n#endif",p="precision highp float;\nprecision highp sampler2D;";export{c as Code,i as Includes,u as Main,o as ShaderBuilder,h as Stage,a as Uniforms};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as t}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderCategory as n}from"../../../webgl.js";import{ColorFormat as i}from"../../../webgl/formats.js";import s from"../../../webgl/RenderNode.js";import{alphaCutoff as
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import{property as r}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ZEROS as t}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderCategory as n}from"../../../webgl.js";import{ColorFormat as i}from"../../../webgl/formats.js";import s from"../../../webgl/RenderNode.js";import{alphaCutoff as c}from"../../core/shaderLibrary/util/AlphaCutoff.js";import{If as a,glsl as l}from"../../core/shaderModules/interfaces.js";import{Default3D as u}from"../../lib/DefaultVertexAttributeLocations.js";import{FramebufferBit as h,ColorAttachment as p,BlendFactor as d,SizedPixelFormat as f,PixelFormat as m,DataType as v}from"../../../../webgl/enums.js";let x=class extends s{constructor(e){super(e),this.destroyedCB=null,this.produces=n.FINAL,this.consumes={required:[n.FINAL]},this.clearColor=t,this._focusedFBOType=0,this._program=new Map}destroy(){this._program.forEach((e=>e.dispose())),this._program.clear(),this.destroyedCB()}render(e){const r=e.find((({name:e})=>e===n.FINAL));if(!this._focusedFBO)return r;const o=this.renderingContext;o.bindFramebuffer(r.fbo),o.setClearColor(0,0,0,0),o.clear(h.COLOR);const t=this._ensureShader(o,!1,0);return o.useProgram(t),o.bindTexture(this._focusedFBO.getTexture(),0),t.setUniform1i("colorTex",0),t.setUniform1i("inputType",this._focusedFBOType),3===this._focusedFBOType&&t.setUniform2fv("nearFar",this.camera.nearFar),o.screen.draw(),r}getDownscaledFBO(e,r,o,t,n,s){o===g.ON&&(n=e.width,s=e.height);const c=this.renderingContext,{colorTexture:a,depthStencilTexture:l}=e,u=a?.descriptor,m=this._ensureShader(c,null!=l,r),v=this.fboCache.acquire(n,s,"fbo visualizer"),x=!u?.hasMipmap&&!u?.isImmutable;x&&a?.generateMipmap(),c.useProgram(m),c.bindFramebuffer(v.fbo);let T=0;const F=[p.COLOR_ATTACHMENT0],C=null!=l;if(c.bindTexture(a,T),m.setUniform1i("colorTex",T),l){T++,c.bindTexture(l,T),m.setUniform1i("depthTex",T);const e=p.COLOR_ATTACHMENT0+T;v.acquireColor(e,i.RGBA,"depth to color"),F.push(e)}for(let h=0;h<r;h++){T++;const r=p.COLOR_ATTACHMENT0+T,o=C?1:0;c.bindTexture(e.getColorTexture(r-o),T),m.setUniform1i("colorTex"+(T-o-1),T),v.acquireColor(r,i.RGBA),F.push(r)}c.gl.drawBuffers(F);const b=c.getViewport();c.setViewport(0,0,n,s),c.setClearColor(0,0,0,0),c.clear(h.COLOR),c.setBlendingEnabled(!0),c.setBlendFunction(d.ONE,d.ONE_MINUS_SRC_ALPHA);const O="linear-depth"===t||t.includes("shadow"),_="overlay highlight"===t||"highlights"===t||"highlight mix"===t,y="highlight coverage"===t,A=u?.internalFormat,B=O?3:_?5:y?6:A===f.R16F||A===f.R32F||A===f.R8?1:A===f.RG8?2:A===f.RGBA16F?4:0;return m.setUniform1i("inputType",B),O&&m.setUniform2fv("nearFar",this.camera.nearFar),c.screen.draw(),c.bindFramebuffer(null),c.setViewport(b.x,b.y,b.width,b.height),o===g.ON&&(this._focusedFBO=v,this._focusedFBOType=B),x&&e.colorTexture?.clearMipmap(),v}clearFocusedFBO(){this._focusedFBO=null}getPreviewContent(e,r,o,t){if(!o)return null;const n=this.renderingContext,i=this.fboCache.acquire(e,r,"fbo visualizer");n.bindFramebuffer(i?.fbo),n.setClearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),n.clear(h.COLOR),n.setBlendingEnabled(!0),n.setBlendFunction(d.ONE,d.ONE_MINUS_SRC_ALPHA),n.setViewport(0,0,e,r);const s=this._ensureShader(n,!1,0);n.useProgram(s),n.bindTexture(o.getColorTexture(t),0),s.setUniform1i("colorTex",0),s.setUniform1i("inputType",0),n.screen.draw();const c=new ImageData(new Uint8ClampedArray(e*r*4),e,r);return n.gl.readPixels(0,0,e,r,m.RGBA,v.UNSIGNED_BYTE,new Uint8Array(c.data.buffer)),n.bindFramebuffer(null),i?.release(),c}_ensureShader(e,r,o){const t={hasDepth:r,attachments:o},n=this._program.get(t);if(n)return n;const i="#version 300 es\n in vec2 position;\n out vec2 uv;\n\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n uv = position * 0.5 + vec2(0.5);\n }",s=(e,r)=>{let o="";const t=e?2:1;for(let n=0;n<r;n++)o+=`layout(location = ${l.int(t+n)}) out vec4 fragColor${l.int(n)};\n uniform sampler2D colorTex${l.int(n)};`;return o},h=e=>{let r="";for(let o=0;o<e;o++)r+=`fragColor${l.int(o)} = texture(colorTex${l.int(o)}, uv);`;return r},p=`#version 300 es\n precision highp float;\n\n in vec2 uv;\n uniform sampler2D colorTex;\n layout(location = 0) out vec4 fragColor;\n ${a(r,"layout(location = 1) out vec4 fragDepth;\n uniform sampler2D depthTex;")}\n ${s(r,o)}\n uniform int inputType;\n uniform vec2 nearFar;\n\n // Factors to convert rgba back to float\n const vec4 RGBA_2_FLOAT_FACTORS = vec4(\n 255.0 / (256.0),\n 255.0 / (256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0),\n 255.0 / (256.0 * 256.0 * 256.0 * 256.0)\n );\n\n\n float rgbaTofloat(vec4 rgba) {\n // Convert components from 0->1 back to 0->255 and then add the components together with their corresponding\n // fixed point factors, i.e. (256^1, 256^2, 256^3, 256^4)\n return dot(rgba, RGBA_2_FLOAT_FACTORS);\n }\n\n float linearDepthFromFloat(float depth) {\n depth = pow(depth, 0.2);\n return -(depth * (nearFar[1] - nearFar[0]) + nearFar[0]);\n }\n\n float linearDepthFromRGBA(vec4 depth) {\n return linearDepthFromFloat(rgbaTofloat(depth));\n }\n\n float linearDepthFromTexture(sampler2D depthTex, vec2 uv) {\n ivec2 iuv = ivec2(uv * vec2(textureSize(depthTex, 0)));\n return linearDepthFromRGBA(texelFetch(depthTex, iuv, 0));\n }\n\n void main() {\n vec4 color;\n if(inputType == 1) {\n color = vec4(vec3(texture(colorTex, uv).r), 1.0);\n } else if(inputType == 2) {\n color = vec4(texture(colorTex, uv).rg, 0.0, 1.0);\n } else if(inputType == 3) {\n float depth = 1.0 - (-linearDepthFromTexture(colorTex, uv) / (nearFar[1] - nearFar[0]));\n color = vec4(vec3(depth), depth >= 0.999 ? 0.0 : 1.0);\n } else if(inputType == 4) {\n color = texture(colorTex, uv);\n color = vec4(color.rgb / color.a, color.a);\n } else if(inputType == 5) {\n vec2 texDim = vec2(textureSize(colorTex, 0));\n ivec2 iuv = ivec2(uv*texDim);\n vec2 hh = texelFetch(colorTex,iuv,0).rg;\n uvec2 uhh = uvec2(vec2(hh) * 255.0);\n color = vec4(\n ((uhh.x & 0x3u) != 0u) ? 1.0 : 0.0, \n ((uhh.x & 0xcu) != 0u) ? 1.0 : 0.0,\n ((uhh.y & 0xfu) != 0u) ? 1.0 : 0.0, \n 1.0);\n } else if(inputType == 6) {\n vec2 texDim = vec2(textureSize(colorTex, 0));\n ivec2 iuv = ivec2(uv*texDim);\n uvec2 hh = uvec2(texelFetch(colorTex,iuv,0).rg * 255.0);\n color = vec4(\n ((hh & uvec2(0x55u)) != uvec2(0u)) ? 1.0 : 0.0, \n ((hh & uvec2(0xaau)) != uvec2(0u)) ? 1.0 : 0.0, \n 0.0,\n 1.0);\n } else {\n color = texture(colorTex, uv);\n }\n\n\n if(color.a < ${l.float(c)})\n discard;\n else {\n fragColor = color;\n ${a(r,"float depth = 1.0 - pow(texture(depthTex, uv).r, 10.0);\n fragDepth = vec4(vec3(depth), depth < 0.000001 ? 0.0 : 1.0);")}\n ${a(o>0,h(o))}\n }\n }`;return this._program.set(t,e.programCache.acquire(i,p,u)),this._program.get(t)}};var g;e([r()],x.prototype,"destroyedCB",void 0),e([r()],x.prototype,"produces",void 0),e([r()],x.prototype,"consumes",void 0),e([r()],x.prototype,"clearColor",void 0),x=e([o("esri.views.3d.webgl-engine.effects.debug.RenderNodeVisualizerNode")],x),function(e){e[e.ON=0]="ON",e[e.OFF=1]="OFF"}(g||(g={}));export{g as FocusState,x as RenderNodeVisualizerNode};
|
package/widgets/Popup.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.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import e from"../core/Logger.js";import{ignoreAbortErrors as i,after as o}from"../core/promiseUtils.js";import{watch as s,initial as n,on as r,whenOnce as l}from"../core/reactiveUtils.js";import{waitAnimationFrame as a}from"../core/scheduling.js";import{stripHTML as d}from"../core/string.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import u from"../support/actions/ActionButton.js";import p from"./Features.js";import g from"./Widget.js";import v from"./Features/FeaturesViewModel.js";import{css as m}from"./Popup/css.js";import f from"./Popup/PopupViewModel.js";import w from"./Popup/PopupVisibleElements.js";import{globalCss as b}from"./support/globalCss.js";import{isRTL as _}from"./support/widgetUtils.js";import{messageBundle as k}from"./support/decorators/messageBundle.js";import{vmEvent as M}from"./support/decorators/vmEvent.js";import{tsx as y}from"./support/jsxFactory.js";const E=200,C={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let P=class extends g{constructor(t,e){super(t,e),this._dockAction=new u({id:"popup-dock-action"}),this._featuresWidget=new p({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this._focusAbortController=null,this.alignment="auto",this.dockEnabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new f,this.visibleElements=new w}initialize(){this.addHandles([s((()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled]),(()=>this._handleDockIcon()),n),s((()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock]),(()=>this._handleDockEnabled()),n),s((()=>this.dockOptions),(t=>{const{_dockAction:e}=this,i=this._featuresWidget.headerActions;i.remove(e),t.buttonEnabled&&i.add(e)}),n),s((()=>this.viewModel?.screenLocation),(()=>this._positionContainer())),s((()=>[this.viewModel?.active,this.dockEnabled]),(()=>this._toggleScreenLocationEnabled())),s((()=>[this.viewModel?.screenLocation,this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment]),(()=>this.reposition())),s((()=>this.viewModel?.view?.size),((t,e)=>this._updateDockEnabledForViewSize(t,e))),s((()=>this.viewModel?.view),((t,e)=>this._viewChange(t,e))),s((()=>this.viewModel?.view?.ready),((t,e)=>this._viewReadyChange(t??!1,e??!1))),s((()=>this.viewModel),(()=>this._featuresWidget.viewModel=this.viewModel),n),s((()=>this._featureNavigationTop),(t=>this._featuresWidget.featureNavigationTop=t),n),s((()=>this.headingLevel),(t=>this._featuresWidget.headingLevel=t),n),s((()=>this.visibleElements.actionBar),(t=>this._featuresWidget.visibleElements.actionBar=!!t),n),s((()=>this.visibleElements.closeButton),(t=>this._featuresWidget.visibleElements.closeButton=!!t),n),s((()=>this.visibleElements.collapseButton),(t=>this._featuresWidget.visibleElements.collapseButton=!!t),n),s((()=>this.visibleElements.heading),(t=>this._featuresWidget.visibleElements.heading=!!t),n),s((()=>this.visibleElements.spinner),(t=>this._featuresWidget.visibleElements.spinner=!!t),n),s((()=>this.visibleElements.featureNavigation),(t=>this._featuresWidget.visibleElements.featureNavigation=!!t),n),s((()=>this.visibleElements.featureListLayerTitle),(t=>this._featuresWidget.visibleElements.featureListLayerTitle=!!t),n),r((()=>this._featuresWidget),"trigger-header-action",(t=>{t.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)}))])}destroy(){this._dockAction.destroy(),this._featuresWidget&&(this._featuresWidget.viewModel=new v,this._featuresWidget.destroy()),this._focusAbortController?.abort()}get _featureNavigationTop(){const{currentAlignment:t,currentDockPosition:e}=this;return"bottom-left"===t||"bottom-center"===t||"bottom-right"===t||"top-left"===e||"top-center"===e||"top-right"===e}get actions(){return this.viewModel.actions}set actions(t){this.viewModel.actions=t}get active(){return this.viewModel.active}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(t){this.viewModel.autoCloseEnabled=t}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(t){this.viewModel.defaultPopupTemplateEnabled=t}get content(){return this.viewModel.content}set content(t){this.viewModel.content=t}get collapsed(){return this._featuresWidget.collapsed}set collapsed(t){this._featuresWidget.collapsed=t}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||C}set dockOptions(t){const e={...C},i=this.viewModel?.view?.breakpoints,o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const s={...e,...t},n={...e.breakpoint,...o},{breakpoint:r}=s;"object"==typeof r?s.breakpoint={...n,...r}:r&&(s.breakpoint=n),this._set("dockOptions",s),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(t){this.viewModel.featureMenuOpen=t}get features(){return this.viewModel.features}set features(t){this.viewModel.features=t}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(t){this.viewModel.highlightEnabled=t}get icon(){return"popup"}set icon(t){this._overrideIfSome("icon",t)}get location(){return this.viewModel.location}set location(t){this.viewModel.location=t}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get promises(){return this.viewModel.promises}set promises(t){this.viewModel.promises=t}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(t){this.viewModel.selectedFeatureIndex=t}get selectedFeatureWidget(){return this._featuresWidget.selectedFeatureWidget}get title(){return this.viewModel.title}set title(t){this.viewModel.title=t}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(t){this.viewModel.updateLocationEnabled=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}blur(){const{active:t}=this.viewModel;t||e.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(t,e){return this.viewModel.fetchFeatures(t,e)}focus(){const{active:t}=this.viewModel;t||e.getLogger(this).warn("Popup can only be focused when currently active."),this._handleFocus()}next(){return this.viewModel.next()}open(t){const e=!!t&&!!t.featureMenuOpen,i={collapsed:!!t&&!!t.collapsed,featureMenuOpen:e};this.set(i),this.viewModel.open(t),t?.shouldFocus&&this._handleFocus(!0)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(t){return this.viewModel.triggerAction(t)}render(){const{dockEnabled:t,currentAlignment:e,currentDockPosition:i}=this,{active:o,screenLocation:s}=this.viewModel,n=o&&t,r=o&&!t,l=this.selectedFeature?.layer?.title,a=this.selectedFeature?.layer?.id,c={[m.alignTopCenter]:"top-center"===e,[m.alignBottomCenter]:"bottom-center"===e,[m.alignTopLeft]:"top-left"===e,[m.alignBottomLeft]:"bottom-left"===e,[m.alignTopRight]:"top-right"===e,[m.alignBottomRight]:"bottom-right"===e,[m.isDocked]:n,[m.shadow]:r,[m.isDockedTopLeft]:"top-left"===i,[m.isDockedTopCenter]:"top-center"===i,[m.isDockedTopRight]:"top-right"===i,[m.isDockedBottomLeft]:"bottom-left"===i,[m.isDockedBottomCenter]:"bottom-center"===i,[m.isDockedBottomRight]:"bottom-right"===i};return y("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,"aria-hidden":(!o).toString(),"aria-label":d(this.title??""),"aria-modal":"false",bind:this,class:this.classes(m.base,c,{[m.baseHidden]:!s&&!t}),"data-layer-id":a,"data-layer-title":l,role:"dialog"},o?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:y("div",{class:m.pointer,key:"popup-pointer",role:"presentation"},y("div",{class:this.classes(m.pointerDirection,m.shadow)}))}_renderMainContainer(){const{dockEnabled:t}=this,e={[m.shadow]:t};return y("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(m.main,b.widget,e)},this._featuresWidget.render())}_getAnimationDurationMS(){const{_containerNode:t}=this;return t?1e3*parseFloat(window.getComputedStyle(t).animationDuration):E}async _handleFocus(t=!1){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;t&&await l((()=>!0===this.viewModel?.active),{signal:e}),await i(a(e)),await i(o(this._getAnimationDurationMS(),e)),this._featuresWidget.focus()}_isOutsideView(t){const{popupHeight:e,popupWidth:i,screenLocation:o,side:s,view:n}=t;if(isNaN(i)||isNaN(e)||!n||!o)return!1;const r=n.padding;return"right"===s&&o.x+i/2>n.width-r.right||("left"===s&&o.x-i/2<r.left||("top"===s&&o.y-e<r.top||"bottom"===s&&o.y+e>n.height-r.bottom))}_calculateAutoAlignment(t){if("auto"!==t)return t;const{_pointerOffsetInPx:e,_containerNode:i,_mainContainerNode:o,viewModel:s}=this,{screenLocation:n,view:r}=s;if(null==n||!r||!i)return"top-center";function l(t){return parseInt(t.replaceAll(/[^-\d.]/g,""),10)}const a=o?window.getComputedStyle(o,null):null,d=a?l(a.getPropertyValue("max-height")):0,c=a?l(a.getPropertyValue("height")):0,{height:h,width:u}=i.getBoundingClientRect(),p=u+e,g=Math.max(h,d,c)+e,v=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:n,side:"right",view:r}),m=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:n,side:"left",view:r}),f=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:n,side:"top",view:r}),w=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:n,side:"bottom",view:r});return m?f?"bottom-right":"top-right":v?f?"bottom-left":"top-left":f?w?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(t){return"function"==typeof t?t.call(this):t}_getCurrentAlignment(){const{alignment:t,dockEnabled:e}=this;return e||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(t)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(t){const e=["left","right"];return _(this.container)&&e.reverse(),t?.replace(/leading/gi,e[0]).replaceAll(/trailing/gi,e[1])}_callDockPosition(t){return"function"==typeof t?t.call(this):t}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(t){if("auto"!==t)return t;const e=this.viewModel?.view,i=_(this.container)?"top-left":"top-right";if(!e)return i;const o=e.padding||{left:0,right:0,top:0,bottom:0},s=e.width-o.left-o.right,{breakpoints:n}=e;return n&&s<=n.xsmall?"bottom-center":i}_getDockIcon(){const t=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(t){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_setMainContainerNode(t){this._mainContainerNode=t}_positionContainer(t=this._containerNode){if(t&&(this._containerNode=t),!this._containerNode)return;const{screenLocation:e}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),o=this._calculatePositionStyle(e,i);o&&Object.assign(this._containerNode.style,o)}_calculateFullWidth(t){const{currentAlignment:e,_pointerOffsetInPx:i}=this;return"top-left"===e||"bottom-left"===e||"top-right"===e||"bottom-right"===e?t+i:t}_calculateAlignmentPosition(t,e,i,o){const{currentAlignment:s,_pointerOffsetInPx:n}=this;if(!i)return;const{padding:r}=i,l=o/2,a=i.height-e,d=i.width-t;return"bottom-center"===s?{top:e+n-r.top,left:t-l-r.left}:"top-left"===s?{bottom:a+n-r.bottom,right:d+n-r.right}:"bottom-left"===s?{top:e+n-r.top,right:d+n-r.right}:"top-right"===s?{bottom:a+n-r.bottom,left:t+n-r.left}:"bottom-right"===s?{top:e+n-r.top,left:t+n-r.left}:"top-center"===s?{bottom:a+n-r.bottom,left:t-l-r.left}:void 0}_calculatePositionStyle(t,e){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(null==t||!e)return;const s=this._calculateFullWidth(e),n=this._calculateAlignmentPosition(t.x,t.y,o,s);return n?{top:void 0!==n.top?`${n.top}px`:"auto",left:void 0!==n.left?`${n.left}px`:"auto",bottom:void 0!==n.bottom?`${n.bottom}px`:"auto",right:void 0!==n.right?`${n.right}px`:"auto"}:void 0}_viewChange(t,e){t&&e&&(this.close(),this.clear())}_viewReadyChange(t,e){t?this._wireUpView():e&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(t,e,i){const[o,s]=t,[n,r]=e,{width:l=0,height:a=0}=i??{};return o<=l&&n>l||o>l&&n<=l||s<=a&&r>a||s>a&&r<=a}_updateDockEnabledForViewSize(t,e){if(!t||!e)return;const i=this.viewModel?.view?.padding||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,s=i.top+i.bottom,n=[],r=[];n[0]=t[0]-o,n[1]=t[1]-s,r[0]=e[0]-o,r[1]=e[1]-s;const{dockOptions:l}=this,a=l.breakpoint;this._dockingThresholdCrossed(n,r,a)&&this._setDockEnabledForViewSize(l),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:t,viewModel:e}=this;if(!e)return;const i=e.active&&!t;e.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(t){const e=t.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:s}=i;if(isNaN(o)||isNaN(s))return!1;if(!e)return!1;const n=e.hasOwnProperty("width")&&o<=(e.width??0),r=e.hasOwnProperty("height")&&s<=(e.height??0);return n||r}_setDockEnabledForViewSize(t){t.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(t))}};t([c({readOnly:!0})],P.prototype,"_featureNavigationTop",null),t([c()],P.prototype,"actions",null),t([c({readOnly:!0})],P.prototype,"active",null),t([c()],P.prototype,"alignment",void 0),t([c()],P.prototype,"autoCloseEnabled",null),t([c()],P.prototype,"defaultPopupTemplateEnabled",null),t([c()],P.prototype,"content",null),t([c()],P.prototype,"collapsed",null),t([c({readOnly:!0})],P.prototype,"currentAlignment",null),t([c({readOnly:!0})],P.prototype,"currentDockPosition",null),t([c()],P.prototype,"dockOptions",null),t([c()],P.prototype,"dockEnabled",void 0),t([c({readOnly:!0})],P.prototype,"featureCount",null),t([c()],P.prototype,"featureMenuOpen",null),t([c()],P.prototype,"features",null),t([c()],P.prototype,"goToOverride",null),t([c()],P.prototype,"headingLevel",void 0),t([c()],P.prototype,"highlightEnabled",null),t([c()],P.prototype,"icon",null),t([c()],P.prototype,"location",null),t([c()],P.prototype,"label",null),t([c(),k("esri/widgets/Popup/t9n/Popup")],P.prototype,"messages",void 0),t([c()],P.prototype,"promises",null),t([c({readOnly:!0})],P.prototype,"selectedFeature",null),t([c()],P.prototype,"selectedFeatureIndex",null),t([c({readOnly:!0})],P.prototype,"selectedFeatureWidget",null),t([c()],P.prototype,"title",null),t([c()],P.prototype,"updateLocationEnabled",null),t([c()],P.prototype,"view",null),t([c({type:f}),M(["triggerAction","trigger-action"])],P.prototype,"viewModel",void 0),t([c()],P.prototype,"visible",null),t([c({type:w,nonNullable:!0})],P.prototype,"visibleElements",void 0),P=t([h("esri.widgets.Popup")],P);const A=P;export{A as default};
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import e from"../core/Logger.js";import{ignoreAbortErrors as i,after as o}from"../core/promiseUtils.js";import{watch as s,initial as n,on as r,whenOnce as l}from"../core/reactiveUtils.js";import{waitAnimationFrame as a}from"../core/scheduling.js";import{stripHTML as d}from"../core/string.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import u from"../support/actions/ActionButton.js";import p from"./Features.js";import g from"./Widget.js";import v from"./Features/FeaturesViewModel.js";import{css as m}from"./Popup/css.js";import f from"./Popup/PopupViewModel.js";import w from"./Popup/PopupVisibleElements.js";import{globalCss as b}from"./support/globalCss.js";import{isRTL as _}from"./support/widgetUtils.js";import{messageBundle as k}from"./support/decorators/messageBundle.js";import{vmEvent as M}from"./support/decorators/vmEvent.js";import{tsx as y}from"./support/jsxFactory.js";const E=200,C={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let P=class extends g{constructor(t,e){super(t,e),this._dockAction=new u({id:"popup-dock-action"}),this._featuresWidget=new p({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this._focusAbortController=null,this.alignment="auto",this.dockEnabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new f,this.visibleElements=new w}initialize(){this.addHandles([s((()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled]),(()=>this._handleDockIcon()),n),s((()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock]),(()=>this._handleDockEnabled()),n),s((()=>this.dockOptions),(t=>{const{_dockAction:e}=this,i=this._featuresWidget.headerActions;i.remove(e),t.buttonEnabled&&i.add(e)}),n),s((()=>this.viewModel?.screenLocation),(()=>this._positionContainer())),s((()=>[this.viewModel?.active,this.dockEnabled]),(()=>this._toggleScreenLocationEnabled())),s((()=>[this.viewModel?.screenLocation,this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment]),(()=>this.reposition())),s((()=>this.viewModel?.view?.size),((t,e)=>this._updateDockEnabledForViewSize(t,e))),s((()=>this.viewModel?.view),((t,e)=>this._viewChange(t,e))),s((()=>this.viewModel?.view?.ready),((t,e)=>this._viewReadyChange(t??!1,e??!1))),s((()=>this.viewModel),(()=>this._featuresWidget.viewModel=this.viewModel),n),s((()=>this._featureNavigationTop),(t=>this._featuresWidget.featureNavigationTop=t),n),s((()=>this.headingLevel),(t=>this._featuresWidget.headingLevel=t),n),s((()=>this.visibleElements.actionBar),(t=>this._featuresWidget.visibleElements.actionBar=!!t),n),s((()=>this.visibleElements.closeButton),(t=>this._featuresWidget.visibleElements.closeButton=!!t),n),s((()=>this.visibleElements.collapseButton),(t=>this._featuresWidget.visibleElements.collapseButton=!!t),n),s((()=>this.visibleElements.heading),(t=>this._featuresWidget.visibleElements.heading=!!t),n),s((()=>this.visibleElements.spinner),(t=>this._featuresWidget.visibleElements.spinner=!!t),n),s((()=>this.visibleElements.featureNavigation),(t=>this._featuresWidget.visibleElements.featureNavigation=!!t),n),s((()=>this.visibleElements.featureListLayerTitle),(t=>this._featuresWidget.visibleElements.featureListLayerTitle=!!t),n),r((()=>this._featuresWidget),"trigger-header-action",(t=>{t.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)}))])}destroy(){this._dockAction.destroy(),this._featuresWidget&&(this._featuresWidget.viewModel=new v,this._featuresWidget.destroy()),this._focusAbortController?.abort()}get _featureNavigationTop(){const{currentAlignment:t,currentDockPosition:e}=this;return"bottom-left"===t||"bottom-center"===t||"bottom-right"===t||"top-left"===e||"top-center"===e||"top-right"===e}get actions(){return this.viewModel.actions}set actions(t){this.viewModel.actions=t}get active(){return this.viewModel.active}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(t){this.viewModel.autoCloseEnabled=t}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(t){this.viewModel.defaultPopupTemplateEnabled=t}get content(){return this.viewModel.content}set content(t){this.viewModel.content=t}get collapsed(){return this._featuresWidget.collapsed}set collapsed(t){this._featuresWidget.collapsed=t}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||C}set dockOptions(t){const e={...C},i=this.viewModel?.view?.breakpoints,o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const s={...e,...t},n={...e.breakpoint,...o},{breakpoint:r}=s;"object"==typeof r?s.breakpoint={...n,...r}:r&&(s.breakpoint=n),this._set("dockOptions",s),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(t){this.viewModel.featureMenuOpen=t}get features(){return this.viewModel.features}set features(t){this.viewModel.features=t}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(t){this.viewModel.highlightEnabled=t}get icon(){return"popup"}set icon(t){this._overrideIfSome("icon",t)}get location(){return this.viewModel.location}set location(t){this.viewModel.location=t}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get promises(){return this.viewModel.promises}set promises(t){this.viewModel.promises=t}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){return this._featuresWidget.selectedDrillInFeature??null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(t){this.viewModel.selectedFeatureIndex=t}get selectedFeatureWidget(){return this._featuresWidget.selectedFeatureWidget}get title(){return this.viewModel.title}set title(t){this.viewModel.title=t}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(t){this.viewModel.updateLocationEnabled=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}blur(){const{active:t}=this.viewModel;t||e.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(t,e){return this.viewModel.fetchFeatures(t,e)}focus(){const{active:t}=this.viewModel;t||e.getLogger(this).warn("Popup can only be focused when currently active."),this._handleFocus()}next(){return this.viewModel.next()}open(t){const e=!!t&&!!t.featureMenuOpen,i={collapsed:!!t&&!!t.collapsed,featureMenuOpen:e};this.set(i),this.viewModel.open(t),t?.shouldFocus&&this._handleFocus(!0)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(t){return this.viewModel.triggerAction(t)}render(){const{dockEnabled:t,currentAlignment:e,currentDockPosition:i}=this,{active:o,screenLocation:s}=this.viewModel,n=o&&t,r=o&&!t,l=this.selectedFeature?.layer?.title,a=this.selectedFeature?.layer?.id,c={[m.alignTopCenter]:"top-center"===e,[m.alignBottomCenter]:"bottom-center"===e,[m.alignTopLeft]:"top-left"===e,[m.alignBottomLeft]:"bottom-left"===e,[m.alignTopRight]:"top-right"===e,[m.alignBottomRight]:"bottom-right"===e,[m.isDocked]:n,[m.shadow]:r,[m.isDockedTopLeft]:"top-left"===i,[m.isDockedTopCenter]:"top-center"===i,[m.isDockedTopRight]:"top-right"===i,[m.isDockedBottomLeft]:"bottom-left"===i,[m.isDockedBottomCenter]:"bottom-center"===i,[m.isDockedBottomRight]:"bottom-right"===i};return y("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,"aria-hidden":(!o).toString(),"aria-label":d(this.title??""),"aria-modal":"false",bind:this,class:this.classes(m.base,c,{[m.baseHidden]:!s&&!t}),"data-layer-id":a,"data-layer-title":l,role:"dialog"},o?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:y("div",{class:m.pointer,key:"popup-pointer",role:"presentation"},y("div",{class:this.classes(m.pointerDirection,m.shadow)}))}_renderMainContainer(){const{dockEnabled:t}=this,e={[m.shadow]:t};return y("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(m.main,b.widget,e)},this._featuresWidget.render())}_getAnimationDurationMS(){const{_containerNode:t}=this;return t?1e3*parseFloat(window.getComputedStyle(t).animationDuration):E}async _handleFocus(t=!1){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const e=this._focusAbortController.signal;t&&await l((()=>!0===this.viewModel?.active),{signal:e}),await i(a(e)),await i(o(this._getAnimationDurationMS(),e)),this._featuresWidget.focus()}_isOutsideView(t){const{popupHeight:e,popupWidth:i,screenLocation:o,side:s,view:n}=t;if(isNaN(i)||isNaN(e)||!n||!o)return!1;const r=n.padding;return"right"===s&&o.x+i/2>n.width-r.right||("left"===s&&o.x-i/2<r.left||("top"===s&&o.y-e<r.top||"bottom"===s&&o.y+e>n.height-r.bottom))}_calculateAutoAlignment(t){if("auto"!==t)return t;const{_pointerOffsetInPx:e,_containerNode:i,_mainContainerNode:o,viewModel:s}=this,{screenLocation:n,view:r}=s;if(null==n||!r||!i)return"top-center";function l(t){return parseInt(t.replaceAll(/[^-\d.]/g,""),10)}const a=o?window.getComputedStyle(o,null):null,d=a?l(a.getPropertyValue("max-height")):0,c=a?l(a.getPropertyValue("height")):0,{height:h,width:u}=i.getBoundingClientRect(),p=u+e,g=Math.max(h,d,c)+e,v=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:n,side:"right",view:r}),m=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:n,side:"left",view:r}),f=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:n,side:"top",view:r}),w=this._isOutsideView({popupHeight:g,popupWidth:p,screenLocation:n,side:"bottom",view:r});return m?f?"bottom-right":"top-right":v?f?"bottom-left":"top-left":f?w?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(t){return"function"==typeof t?t.call(this):t}_getCurrentAlignment(){const{alignment:t,dockEnabled:e}=this;return e||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(t)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(t){const e=["left","right"];return _(this.container)&&e.reverse(),t?.replace(/leading/gi,e[0]).replaceAll(/trailing/gi,e[1])}_callDockPosition(t){return"function"==typeof t?t.call(this):t}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(t){if("auto"!==t)return t;const e=this.viewModel?.view,i=_(this.container)?"top-left":"top-right";if(!e)return i;const o=e.padding||{left:0,right:0,top:0,bottom:0},s=e.width-o.left-o.right,{breakpoints:n}=e;return n&&s<=n.xsmall?"bottom-center":i}_getDockIcon(){const t=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(t){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_setMainContainerNode(t){this._mainContainerNode=t}_positionContainer(t=this._containerNode){if(t&&(this._containerNode=t),!this._containerNode)return;const{screenLocation:e}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),o=this._calculatePositionStyle(e,i);o&&Object.assign(this._containerNode.style,o)}_calculateFullWidth(t){const{currentAlignment:e,_pointerOffsetInPx:i}=this;return"top-left"===e||"bottom-left"===e||"top-right"===e||"bottom-right"===e?t+i:t}_calculateAlignmentPosition(t,e,i,o){const{currentAlignment:s,_pointerOffsetInPx:n}=this;if(!i)return;const{padding:r}=i,l=o/2,a=i.height-e,d=i.width-t;return"bottom-center"===s?{top:e+n-r.top,left:t-l-r.left}:"top-left"===s?{bottom:a+n-r.bottom,right:d+n-r.right}:"bottom-left"===s?{top:e+n-r.top,right:d+n-r.right}:"top-right"===s?{bottom:a+n-r.bottom,left:t+n-r.left}:"bottom-right"===s?{top:e+n-r.top,left:t+n-r.left}:"top-center"===s?{bottom:a+n-r.bottom,left:t-l-r.left}:void 0}_calculatePositionStyle(t,e){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(null==t||!e)return;const s=this._calculateFullWidth(e),n=this._calculateAlignmentPosition(t.x,t.y,o,s);return n?{top:void 0!==n.top?`${n.top}px`:"auto",left:void 0!==n.left?`${n.left}px`:"auto",bottom:void 0!==n.bottom?`${n.bottom}px`:"auto",right:void 0!==n.right?`${n.right}px`:"auto"}:void 0}_viewChange(t,e){t&&e&&(this.close(),this.clear())}_viewReadyChange(t,e){t?this._wireUpView():e&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(t,e,i){const[o,s]=t,[n,r]=e,{width:l=0,height:a=0}=i??{};return o<=l&&n>l||o>l&&n<=l||s<=a&&r>a||s>a&&r<=a}_updateDockEnabledForViewSize(t,e){if(!t||!e)return;const i=this.viewModel?.view?.padding||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,s=i.top+i.bottom,n=[],r=[];n[0]=t[0]-o,n[1]=t[1]-s,r[0]=e[0]-o,r[1]=e[1]-s;const{dockOptions:l}=this,a=l.breakpoint;this._dockingThresholdCrossed(n,r,a)&&this._setDockEnabledForViewSize(l),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:t,viewModel:e}=this;if(!e)return;const i=e.active&&!t;e.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(t){const e=t.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:s}=i;if(isNaN(o)||isNaN(s))return!1;if(!e)return!1;const n=e.hasOwnProperty("width")&&o<=(e.width??0),r=e.hasOwnProperty("height")&&s<=(e.height??0);return n||r}_setDockEnabledForViewSize(t){t.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(t))}};t([c({readOnly:!0})],P.prototype,"_featureNavigationTop",null),t([c()],P.prototype,"actions",null),t([c({readOnly:!0})],P.prototype,"active",null),t([c()],P.prototype,"alignment",void 0),t([c()],P.prototype,"autoCloseEnabled",null),t([c()],P.prototype,"defaultPopupTemplateEnabled",null),t([c()],P.prototype,"content",null),t([c()],P.prototype,"collapsed",null),t([c({readOnly:!0})],P.prototype,"currentAlignment",null),t([c({readOnly:!0})],P.prototype,"currentDockPosition",null),t([c()],P.prototype,"dockOptions",null),t([c()],P.prototype,"dockEnabled",void 0),t([c({readOnly:!0})],P.prototype,"featureCount",null),t([c()],P.prototype,"featureMenuOpen",null),t([c()],P.prototype,"features",null),t([c()],P.prototype,"goToOverride",null),t([c()],P.prototype,"headingLevel",void 0),t([c()],P.prototype,"highlightEnabled",null),t([c()],P.prototype,"icon",null),t([c()],P.prototype,"location",null),t([c()],P.prototype,"label",null),t([c(),k("esri/widgets/Popup/t9n/Popup")],P.prototype,"messages",void 0),t([c()],P.prototype,"promises",null),t([c({readOnly:!0})],P.prototype,"selectedFeature",null),t([c({readOnly:!0})],P.prototype,"selectedDrillInFeature",null),t([c()],P.prototype,"selectedFeatureIndex",null),t([c({readOnly:!0})],P.prototype,"selectedFeatureWidget",null),t([c()],P.prototype,"title",null),t([c()],P.prototype,"updateLocationEnabled",null),t([c()],P.prototype,"view",null),t([c({type:f}),M(["triggerAction","trigger-action"])],P.prototype,"viewModel",void 0),t([c()],P.prototype,"visible",null),t([c({type:w,nonNullable:!0})],P.prototype,"visibleElements",void 0),P=t([h("esri.widgets.Popup")],P);const A=P;export{A as default};
|