@arcgis/core 5.1.0-next.60 → 5.1.0-next.62
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/{ab223c508f3dd562e7d3.js → 32e9e92bbbd000fbbaf7.js} +2 -2
- package/assets/esri/core/workers/chunks/{68475eba323b4aa892a3.js → 354351ab3fc79dedf9a8.js} +1 -1
- package/assets/esri/core/workers/chunks/45f1e682668cffc00b44.js +1 -0
- package/assets/esri/core/workers/chunks/4dbbf59c79d9e72f20ee.js +1 -0
- package/assets/esri/core/workers/chunks/{6172715b2b2853819d8a.js → 5eeb6d3a7b815d41621e.js} +1 -1
- package/assets/esri/core/workers/chunks/{2f74147597805828cb38.js → 5ff41f43e57be0557541.js} +22 -29
- package/assets/esri/core/workers/chunks/{6355de3ee89916b74dae.js → 6b32b3f98872771ff81e.js} +1 -1
- package/assets/esri/core/workers/chunks/71326d16b5cc35c3ff7f.js +1 -0
- package/assets/esri/core/workers/chunks/{c69fefe9d51ac7c2b0a6.js → 75f7c1f600c4051bc905.js} +1 -1
- package/assets/esri/core/workers/chunks/{8083dface1ca2dbd12b2.js → 811b378fa5bf8a4d3d66.js} +1 -1
- package/assets/esri/core/workers/chunks/{8432ffc33843e898bab7.js → 8166ad6bbd7d7a8f91cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{58614f12796dbba013f4.js → 9d289cee96e7c7fe1029.js} +1 -1
- package/assets/esri/core/workers/chunks/{c4da2ca1dee0c44051d0.js → 9d7ffd83f69d6e639f09.js} +1 -1
- package/assets/esri/core/workers/chunks/{0622e238693c257abacb.js → 9eef3cd5f519c8ae88c0.js} +1 -1
- package/assets/esri/core/workers/chunks/{2541ac6e0ed1184edc9b.js → af3bd661b355eed3da21.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4144ccc85ad4c76a9b7.js → af40e2e6eaf3d2226812.js} +1 -1
- package/assets/esri/core/workers/chunks/{0fd191f9c10b3b7c83f4.js → c319c3b85cdec73a9f45.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e1ef2a55f8d123f31e2.js → cbb50415f7de8746ee1a.js} +1 -1
- package/assets/esri/core/workers/chunks/{48d289db3145ce6c02bb.js → d4368e281c12fa7c17c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{266933f1139ed0e8919f.js → e645f992ec6f935ee3a5.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf4bad2c9a541cd425f5.js → e9dd60d0220036545ebb.js} +1 -1
- package/assets/esri/core/workers/chunks/ed60b5eaa5765bfcb99c.js +1 -0
- package/assets/esri/core/workers/chunks/{a226ba96d9a3ecc14e3e.js → f550fc8c078ebd47d7a3.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
- package/chunks/GlowComposition.glsl.js +4 -5
- package/chunks/ShadowHighlight.glsl.js +5 -5
- package/config.js +1 -1
- package/geometry/libtess.js +1 -1
- package/geometry/support/curves/bezierCurveUtils.js +1 -1
- package/geometry/support/curves/circularArcUtils.js +1 -1
- package/geometry/support/curves/ellipticArc4Utils.js +1 -1
- package/geometry/support/curves/ellipticArc7Utils.js +1 -1
- package/interfaces.d.ts +14 -0
- package/kernel.js +1 -1
- package/layers/CSVLayer.d.ts +38 -6
- package/layers/CatalogLayer.d.ts +39 -8
- package/layers/FeatureLayer.d.ts +25 -23
- package/layers/GeoJSONLayer.d.ts +36 -6
- package/layers/ParquetLayer.d.ts +58 -0
- package/layers/SubtypeGroupLayer.d.ts +27 -25
- package/layers/WFSLayer.d.ts +51 -8
- package/layers/catalog/CatalogFootprintLayer.d.ts +37 -7
- package/layers/graphics/sources/csv/csv.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +41 -17
- package/layers/mixins/ArcGISImageService.d.ts +58 -0
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +1 -1
- package/layers/raster/datasets/ImageAuxRaster.js +1 -1
- package/layers/raster/datasets/ImageServerRaster.js +1 -1
- package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
- package/layers/raster/formats/JpgPlus.js +1 -1
- package/layers/raster/formats/RasterCodec.js +1 -1
- package/layers/support/csvUtils.js +1 -1
- package/package.json +3 -3
- package/popup/Feature.d.ts +33 -35
- package/popup/Feature.js +1 -1
- package/popup/Features.d.ts +663 -0
- package/popup/Features.js +2 -0
- package/popup/support/FeatureAbilities.d.ts +30 -0
- package/popup/support/FeatureAbilities.js +2 -0
- package/support/revision.js +1 -1
- package/views/2d/analysis/analysisViewModuleImportUtils.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/analysis/analysisViewModuleImportUtils.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +6 -11
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/{ScreenSpaceShadowHighlight.glsl.js → ShadowHighlightBuffer.glsl.js} +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +2 -0
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBufferTechnique.js +2 -0
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +11 -11
- package/views/3d/webgl-engine/shaders/ReceiveShadowsConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ditherNoise.glsl.js +2 -0
- package/views/3d/webgl.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/draw/plugins/TangentArcSegmentPlugin.js +1 -1
- package/views/support/AnalysisViewManager.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView3D.js +1 -1
- package/widgets/Feature/FeatureViewModel.d.ts +2 -1
- package/widgets/Feature/FeatureViewModel.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureTable/ColumnVisibilityMenuVisibleElements.d.ts +27 -0
- package/widgets/FeatureTable/ColumnVisibilityMenuVisibleElements.js +2 -0
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +10 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/TableMenuVisibleElements.d.ts +0 -1
- package/widgets/FeatureTable/TableMenuVisibleElements.js +1 -1
- package/widgets/FeatureTable/VisibleElements.d.ts +23 -1
- package/widgets/FeatureTable/VisibleElements.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.d.ts +10 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Popup/actionUtils.js +1 -1
- package/widgets/Widget.js +1 -1
- package/assets/esri/core/workers/chunks/16806f5044a9da553b66.js +0 -1
- package/assets/esri/core/workers/chunks/5f3f50fec18d1642fdf9.js +0 -1
- package/assets/esri/core/workers/chunks/b42487c6a989e11a2559.js +0 -1
- package/assets/esri/core/workers/chunks/dba479176db0a23c8034.js +0 -1
- package/views/3d/webgl-engine/effects/highlight/ScreenSpaceShadowHighlightRenderNode.js +0 -2
- package/views/3d/webgl-engine/effects/highlight/ScreenSpaceShadowHighlightTechnique.js +0 -2
- package/views/3d/webgl-engine/shaders/Dithering.glsl.js +0 -4
- /package/assets/esri/core/workers/chunks/{ab223c508f3dd562e7d3.js.LICENSE.txt → 32e9e92bbbd000fbbaf7.js.LICENSE.txt} +0 -0
- /package/chunks/{ScreenSpaceShadowHighlight.glsl.js → ShadowHighlightBuffer.glsl.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.1.0-next.
|
|
3
|
+
"version": "5.1.0-next.62",
|
|
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": [
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@amcharts/amcharts5": "~5.16.2",
|
|
22
|
-
"@arcgis/toolkit": "^5.1.0-next.
|
|
22
|
+
"@arcgis/toolkit": "^5.1.0-next.62",
|
|
23
23
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
24
24
|
"@esri/calcite-components": "^5.0.2",
|
|
25
25
|
"@vaadin/grid": "~25.1.0",
|
|
26
|
-
"@zip.js/zip.js": "~2.8.
|
|
26
|
+
"@zip.js/zip.js": "~2.8.26",
|
|
27
27
|
"luxon": "~3.7.2",
|
|
28
28
|
"marked": "~17.0.5",
|
|
29
29
|
"tslib": "^2.8.1"
|
package/popup/Feature.d.ts
CHANGED
|
@@ -3,15 +3,19 @@ import type EsriMap from "../Map.js";
|
|
|
3
3
|
import type Accessor from "../core/Accessor.js";
|
|
4
4
|
import type Point from "../geometry/Point.js";
|
|
5
5
|
import type SpatialReference from "../geometry/SpatialReference.js";
|
|
6
|
+
import type FeatureAbilities from "./support/FeatureAbilities.js";
|
|
6
7
|
import type { IdentifiableMixin, IdentifiableMixinProperties } from "../core/Identifiable.js";
|
|
7
8
|
import type { SpatialReferenceProperties } from "../geometry/SpatialReference.js";
|
|
8
|
-
import type {
|
|
9
|
+
import type { FeatureFormattedAttributes, LastEditInfo, PopupTemplateContentResolved, RelatedInfo, State } from "./types.js";
|
|
9
10
|
import type { TimeZone } from "../time/types.js";
|
|
10
11
|
import type { MapViewOrSceneView } from "../views/MapViewOrSceneView.js";
|
|
12
|
+
import type { FeatureAbilitiesProperties } from "./support/FeatureAbilities.js";
|
|
11
13
|
import type { GraphicProperties } from "../Graphic.js";
|
|
12
14
|
import type { PointProperties } from "../geometry/Point.js";
|
|
13
15
|
|
|
14
|
-
export interface FeatureProperties extends IdentifiableMixinProperties, Partial<Pick<Feature, "
|
|
16
|
+
export interface FeatureProperties extends IdentifiableMixinProperties, Partial<Pick<Feature, "defaultPopupTemplateEnabled" | "map" | "view">> {
|
|
17
|
+
/** Defines the specific [Abilities](https://developers.arcgis.com/javascript/latest/references/core/widgets/Feature/types/#Abilities) that the [Feature](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature/) component should use when querying and displaying its content. */
|
|
18
|
+
abilities?: FeatureAbilitiesProperties;
|
|
15
19
|
/**
|
|
16
20
|
* The [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) used to represent the feature.
|
|
17
21
|
*
|
|
@@ -41,18 +45,13 @@ export interface FeatureProperties extends IdentifiableMixinProperties, Partial<
|
|
|
41
45
|
graphic?: GraphicProperties | null;
|
|
42
46
|
/**
|
|
43
47
|
* The [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/) representing the location of the
|
|
44
|
-
* [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) interaction used to trigger the opening of the
|
|
48
|
+
* [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) interaction used to trigger the opening of the component.
|
|
45
49
|
*
|
|
46
|
-
* This value should be set when executing Arcade expressions in the Feature
|
|
50
|
+
* This value should be set when executing Arcade expressions in the Feature component that
|
|
47
51
|
* expect the `$userInput` profile variable to have a value.
|
|
48
52
|
*
|
|
49
53
|
* @see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/#content)
|
|
50
54
|
* @see [Arcade Profiles: Popup](https://developers.arcgis.com/arcade/profiles/popup/)
|
|
51
|
-
* @example
|
|
52
|
-
* view.on("click", (event) => {
|
|
53
|
-
* const { mapPoint } = event;
|
|
54
|
-
* feature.viewModel.location = mapPoint;
|
|
55
|
-
* });
|
|
56
55
|
*/
|
|
57
56
|
location?: PointProperties | null;
|
|
58
57
|
/**
|
|
@@ -64,9 +63,8 @@ export interface FeatureProperties extends IdentifiableMixinProperties, Partial<
|
|
|
64
63
|
*/
|
|
65
64
|
spatialReference?: SpatialReferenceProperties | null;
|
|
66
65
|
/**
|
|
67
|
-
* Dates and times
|
|
68
|
-
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone). When a MapView is not associated with the
|
|
69
|
-
* then the property will fallback to the `system` time zone.
|
|
66
|
+
* Dates and times will be displayed in this time zone. By default this time zone is
|
|
67
|
+
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone). When a MapView is not associated with this property then the property will fallback to the `system` time zone.
|
|
70
68
|
*
|
|
71
69
|
* **Possible Values**
|
|
72
70
|
*
|
|
@@ -82,15 +80,21 @@ export interface FeatureProperties extends IdentifiableMixinProperties, Partial<
|
|
|
82
80
|
export type PopupViewModelContent = PopupTemplateContentResolved;
|
|
83
81
|
|
|
84
82
|
/**
|
|
83
|
+
* Provides reactive state and logic for populating the [Feature](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature/) component.
|
|
84
|
+
*
|
|
85
|
+
* The class resolves popup template content for the current [Graphic](https://developers.arcgis.com/javascript/latest/references/core/Graphic/), including evaluating Arcade expressions, formatting attribute values, and fetching related feature information.
|
|
86
|
+
*
|
|
85
87
|
* @see [Feature component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature/)
|
|
86
88
|
* @see [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/)
|
|
87
89
|
* @see [Arcade Profiles: Popup](https://developers.arcgis.com/arcade/profiles/popup/)
|
|
88
90
|
* @see [Arcade - expression language](https://developers.arcgis.com/javascript/latest/arcade/)
|
|
91
|
+
* @since 5.1
|
|
89
92
|
*/
|
|
90
93
|
export default class Feature extends FeatureSuperclass {
|
|
91
94
|
constructor(properties?: FeatureProperties);
|
|
92
|
-
/** Defines the specific [Abilities](https://developers.arcgis.com/javascript/latest/references/core/widgets/Feature/types/#Abilities) that the [Feature](https://developers.arcgis.com/javascript/latest/references/
|
|
93
|
-
|
|
95
|
+
/** Defines the specific [Abilities](https://developers.arcgis.com/javascript/latest/references/core/widgets/Feature/types/#Abilities) that the [Feature](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-feature/) component should use when querying and displaying its content. */
|
|
96
|
+
get abilities(): FeatureAbilities;
|
|
97
|
+
set abilities(value: FeatureAbilitiesProperties);
|
|
94
98
|
/** The [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/#content) of the feature. */
|
|
95
99
|
get content(): PopupViewModelContent | null | undefined;
|
|
96
100
|
/**
|
|
@@ -111,7 +115,7 @@ export default class Feature extends FeatureSuperclass {
|
|
|
111
115
|
accessor defaultPopupTemplateEnabled: boolean;
|
|
112
116
|
/**
|
|
113
117
|
* The formatted attributes calculated from `fieldInfo` [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/)
|
|
114
|
-
* content. They are obtained from the feature's [
|
|
118
|
+
* content. They are obtained from the feature's [graphic](#graphic) attribute values
|
|
115
119
|
* and can be read:
|
|
116
120
|
* * globally using the [PopupTemplate.fieldInfos](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/#fieldInfos) property
|
|
117
121
|
* directly at the root level of the [PopupTemplate](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/), or
|
|
@@ -147,7 +151,7 @@ export default class Feature extends FeatureSuperclass {
|
|
|
147
151
|
*/
|
|
148
152
|
get graphic(): Graphic | null | undefined;
|
|
149
153
|
set graphic(value: GraphicProperties | null | undefined);
|
|
150
|
-
/** Indicates whether the current
|
|
154
|
+
/** Indicates whether the current [graphic](#graphic) resides in a non-spatial table. */
|
|
151
155
|
get isFeatureFromTable(): boolean;
|
|
152
156
|
/**
|
|
153
157
|
* A read-only property containing metadata regarding the last edit performed on a feature.
|
|
@@ -156,25 +160,20 @@ export default class Feature extends FeatureSuperclass {
|
|
|
156
160
|
get lastEditInfo(): LastEditInfo | null | undefined;
|
|
157
161
|
/**
|
|
158
162
|
* The [Point](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/) representing the location of the
|
|
159
|
-
* [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) interaction used to trigger the opening of the
|
|
163
|
+
* [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) interaction used to trigger the opening of the component.
|
|
160
164
|
*
|
|
161
|
-
* This value should be set when executing Arcade expressions in the Feature
|
|
165
|
+
* This value should be set when executing Arcade expressions in the Feature component that
|
|
162
166
|
* expect the `$userInput` profile variable to have a value.
|
|
163
167
|
*
|
|
164
168
|
* @see [PopupTemplate.content](https://developers.arcgis.com/javascript/latest/references/core/PopupTemplate/#content)
|
|
165
169
|
* @see [Arcade Profiles: Popup](https://developers.arcgis.com/arcade/profiles/popup/)
|
|
166
|
-
* @example
|
|
167
|
-
* view.on("click", (event) => {
|
|
168
|
-
* const { mapPoint } = event;
|
|
169
|
-
* feature.viewModel.location = mapPoint;
|
|
170
|
-
* });
|
|
171
170
|
*/
|
|
172
171
|
get location(): Point | null | undefined;
|
|
173
172
|
set location(value: PointProperties | null | undefined);
|
|
174
173
|
/**
|
|
175
|
-
* A map is required when the input [
|
|
174
|
+
* A map is required when the input [graphic](#graphic) has a popupTemplate that contains [Arcade](https://developers.arcgis.com/arcade) expressions in [ExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/popup/ExpressionInfo/) or [ExpressionContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/ExpressionContent/) that may use the `$map` profile variable to access data from layers within a map. Without a map, expressions that use `$map` will throw an error.
|
|
176
175
|
*
|
|
177
|
-
* Alternatively, the [
|
|
176
|
+
* Alternatively, the [view](#view) property can be used to provide the map instance for this property.
|
|
178
177
|
*
|
|
179
178
|
* @see [Type system](https://developers.arcgis.com/arcade/guide/types/#featuresetcollection)
|
|
180
179
|
* @see [Arcade Profiles: Popup](https://developers.arcgis.com/arcade/profiles/popup/)
|
|
@@ -186,7 +185,7 @@ export default class Feature extends FeatureSuperclass {
|
|
|
186
185
|
/**
|
|
187
186
|
* A read-only map containing information about related features for the current feature.
|
|
188
187
|
* The keys are related layer IDs as strings, and the values are [RelatedInfo](https://developers.arcgis.com/javascript/latest/references/core/widgets/Feature/types/#RelatedInfo) objects.
|
|
189
|
-
* This property is populated when the feature has related fields and is used to manage and display related feature information
|
|
188
|
+
* This property is populated when the feature has related fields and is used to manage and display related feature information.
|
|
190
189
|
*/
|
|
191
190
|
get relatedInfos(): Map<string, RelatedInfo>;
|
|
192
191
|
/**
|
|
@@ -199,15 +198,14 @@ export default class Feature extends FeatureSuperclass {
|
|
|
199
198
|
get spatialReference(): SpatialReference | null | undefined;
|
|
200
199
|
set spatialReference(value: SpatialReferenceProperties | null | undefined);
|
|
201
200
|
/**
|
|
202
|
-
* The
|
|
201
|
+
* The current state of the Feature component.
|
|
203
202
|
*
|
|
204
203
|
* @default "disabled"
|
|
205
204
|
*/
|
|
206
205
|
get state(): State;
|
|
207
206
|
/**
|
|
208
|
-
* Dates and times
|
|
209
|
-
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone). When a MapView is not associated with the
|
|
210
|
-
* then the property will fallback to the `system` time zone.
|
|
207
|
+
* Dates and times will be displayed in this time zone. By default this time zone is
|
|
208
|
+
* inherited from [MapView.timeZone](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone). When a MapView is not associated with this property then the property will fallback to the `system` time zone.
|
|
211
209
|
*
|
|
212
210
|
* **Possible Values**
|
|
213
211
|
*
|
|
@@ -226,12 +224,12 @@ export default class Feature extends FeatureSuperclass {
|
|
|
226
224
|
*/
|
|
227
225
|
get title(): string;
|
|
228
226
|
/**
|
|
229
|
-
* A reference to the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
|
|
227
|
+
* A reference to the [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) or [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
|
|
230
228
|
*
|
|
231
229
|
* > [!WARNING]
|
|
232
230
|
* >
|
|
233
|
-
* >
|
|
234
|
-
* > - The [
|
|
231
|
+
* > A view is required if the user expects to display content in any of the following situations:
|
|
232
|
+
* > - The [graphic](#graphic) has a popupTemplate containing Arcade expressions in [ExpressionInfo](https://developers.arcgis.com/javascript/latest/references/core/popup/ExpressionInfo/) or [ExpressionContent](https://developers.arcgis.com/javascript/latest/references/core/popup/content/ExpressionContent/) that may use [geometry functions](https://developers.arcgis.com/arcade/function-reference/geometry_functions/) or reference the `$map` profile variable (i.e. access data from layers within a map).
|
|
235
233
|
* > - Content is displayed from the popup template of an [aggregate feature](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#isAggregate) (i.e. a [cluster](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionCluster/) or [bin](https://developers.arcgis.com/javascript/latest/references/core/layers/support/FeatureReductionBinning/)).
|
|
236
234
|
* > - Values from `date` and `timestamp-offset` [fields](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Field/#type) should respect the view's [time zone](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#timeZone).
|
|
237
235
|
*/
|
|
@@ -239,8 +237,8 @@ export default class Feature extends FeatureSuperclass {
|
|
|
239
237
|
/** Indicates whether the feature is currently waiting for all of its content to finish loading. */
|
|
240
238
|
get waitingForContent(): boolean;
|
|
241
239
|
/**
|
|
242
|
-
* Fetches the geometry of the [
|
|
243
|
-
* This method can be called to ensure the [graphic
|
|
240
|
+
* Fetches the geometry of the [graphic](#graphic) if the geometry does not exist.
|
|
241
|
+
* This method can be called to ensure the [graphic](#graphic)'s geometry is available when the geometry is necessary
|
|
244
242
|
* to take action such as calling [View2D.goTo()](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#goTo) with the graphic as the `target`.
|
|
245
243
|
*
|
|
246
244
|
* @returns A promise that resolves when the geometry has been updated.
|
package/popup/Feature.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import r from"../core/Accessor.js";import{isSome as s}from"../core/arrayUtils.js";import{createTask as o}from"../core/asyncUtils.js";import{IdentifiableMixin as a}from"../core/Identifiable.js";import n from"../core/Logger.js";import{abortMaybe as l}from"../core/maybe.js";import{eachAlways as p,isAbortError as h,throwIfAborted as c}from"../core/promiseUtils.js";import{watch as u,initial as d,when as f}from"../core/reactiveUtils.js";import{throttle as m}from"../core/throttle.js";import{property as g,cast as y,subclass as _}from"../core/accessorSupport/decorators.js";import v from"../geometry/Point.js";import b from"../geometry/SpatialReference.js";import{getGraphicLayer as T}from"../graphic/graphicOriginUtils.js";import I from"./content/TextContent.js";import{compileExpressionInfos as A,formatArcadeValue as x}from"./support/arcadeFeatureUtils.js";import{preLayerQueryCallback as C,preRequestCallback as E,createFieldInfoMap as w,getAllFieldInfos as k,querySourceLayer as F,queryUpdatedFeature as j,isRelatableFeatureSupportedLayer as P,isAssociatedFeatureSupportedLayer as R,formatEditInfo as O,substituteFieldsInLinksAndAttributes as M,graphicCallback as Z,formatAttributes as U,isRelatedField as L}from"./support/featureUtils.js";import{queryLayerInfos as N,queryRelatedFeatures as S,setRelatedFeatures as G,getRelatedFieldInfo as q,createRelatedInfo as H,updateRelatedInfo as z}from"./support/relatedFeatureUtils.js";import{system as B}from"../time/constants.js";var Q;const D=1,J={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let K=class extends(a(r)){static{Q=this}constructor(t){super(t),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...J},this.content=null,this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._graphicChangedThrottled=m(this._graphicChanged,()=>this.notifyChange("waitingForContent"),D,this),this._isAllowedContentType=t=>{const{abilities:e}=this;return"attachments"===t.type&&!!e.attachmentsContent||"custom"===t.type&&!!e.customContent||"fields"===t.type&&!!e.fieldsContent||"media"===t.type&&!!e.mediaContent||"text"===t.type&&!!e.textContent||"expression"===t.type&&!!e.expressionContent||"relationship"===t.type&&!!e.relationshipContent||"utility-network-associations"===t.type&&!!e.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=m(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),D,this),this.addHandles([u(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),d),f(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const t=this._graphicChangedTask.value,e=t?.expressionInfos?.dependencies;return[t,e?.has("view-scale")?this.view?.scale:null,e?.has("view-time-extent")?this.view?.timeExtent?.start:null,e?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([t])=>this._evaluateExpressionAttributesThrottled(t))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=l(this._graphicChangedTask),this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new i(C,E)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return w(k(this._effectivePopupTemplate),this._layer)}get _layer(){const{graphic:t}=this;return t?T(t):void 0}castAbilities(t){return{...J,...t}}get isFeatureFromTable(){return this._layer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(t){this._override("spatialReference",t)}get timeZone(){return this.view?.timeZone??B}set timeZone(t){this._overrideIfSome("timeZone",t)}get map(){return this.view?.map||null}set map(t){this._override("map",t)}get waitingForContent(){const{_graphicChangedThrottled:t,_evaluateExpressionAttributesThrottled:e,_graphicChangedTask:i,_evaluateExpressionAttributesTask:r}=this;return t.hasPendingUpdates()||e.hasPendingUpdates()||null!=i&&!i.finished||null!=r&&!r.finished}async updateGeometry(){const{graphic:t,spatialReference:e,_layer:i}=this;await(i?.load());const r=i?.objectIdField;if(!r||!t||!i)return;const s=t?.attributes?.[r];if(null==s)return;const o=[s];if(!t.geometry){const r=await F({layer:i,graphic:t,outFields:[],objectIds:o,returnGeometry:!0,spatialReference:e}),s=r?.geometry;s&&(t.geometry=s)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._graphicChangedTask=l(this._graphicChangedTask),this._graphicChangedTask=o(async t=>{this._error=null,this._clear();const{graphic:e}=this;try{if(!e)return null;const{_layer:i,_effectivePopupTemplate:r}=this,s=this.spatialReference;await j({graphic:e,popupTemplate:r,layer:i,spatialReference:s},{signal:t});const[{value:o},{value:a}]=await p([this._getContent(),this._getTitle()]),[,{value:n}]=await p([this._checkForRelatedFeatures({signal:t}),A(r?.expressionInfos,e)]);return{expressionInfos:n,content:o,title:a}}catch(i){throw h(i)||(this._error=i,n.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(t){return"relationship"===t.type?P(this._layer)?t:void 0:"utility-network-associations"===t.type?R(this._layer)?t:void 0:t}_compileContent(t){if(this.graphic)return Array.isArray(t)?t.filter(this._isAllowedContentType).map(t=>this._compileContentElement(t)).filter(s):"string"==typeof t?new I({text:t}).text:t}_compileLastEditInfo(){const{_effectivePopupTemplate:t,_layer:e,graphic:i,timeZone:r}=this;if(!t)return;const{lastEditInfoEnabled:s}=t,o=e?.editFieldsInfo;return s&&o?O(o,i?.attributes,r,e):void 0}_compileTitle(t){const{_fieldInfoMap:e,_layer:i,graphic:r,_expressionAttributes:s}=this,o=r?.attributes??{},a=this.formattedAttributes?.global??{};return M({attributes:o,fieldInfoMap:e,globalAttributes:a,expressionAttributes:s,layer:i,text:t})}async _getTitle(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"title",value:t?.title,event:{graphic:e}}):null}async _getContent(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"content",value:t?.content,event:{graphic:e}}):null}_evaluateExpressionAttributes({title:t,content:e,expressionInfos:i}){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=o(async r=>{const{graphic:s,map:o,view:a,spatialReference:l,location:p}=this;try{if(!s)return;let n;if(null!=i){const t=[];for(const[e,n]of i.expressions.entries())null!=n?t.push(n.evaluate({graphic:s,interceptor:Q.interceptor,location:p,map:o,options:{signal:r},spatialReference:l,view:a}).then(t=>[e,"string"==typeof t?x(t):t]).catch(()=>[e,void 0])):t.push(Promise.resolve([e,void 0]));n=Object.fromEntries(await Promise.all(t)),c(r)}this._expressionAttributes=n,this._graphicExpressionAttributes={...s.attributes,...n},this._set("formattedAttributes",this._createFormattedAttributes(e)),this._set("title",this._compileTitle(t)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(e)||null)}catch(u){h(u)||(this._error=u,n.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:u,graphic:s,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){const{_effectivePopupTemplate:r,graphic:s,relatedInfos:o,_layer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[e]=U({attributes:{...l,...t.attributes},fieldInfoMap:n,fieldInfos:r?.fieldInfos,graphic:s,layer:a,relatedInfos:o,timeZone:p})}_createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){if(t.fieldInfos){const{graphic:r,relatedInfos:s,_layer:o,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[e]=U({attributes:{...n,...t.attributes},fieldInfoMap:a,fieldInfos:t.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:o,relatedInfos:s,timeZone:l})}}_createFormattedAttributes(t){const{_effectivePopupTemplate:e,graphic:i,relatedInfos:r,_layer:s,_fieldInfoMap:o,_graphicExpressionAttributes:a,timeZone:n}=this,l=e?.fieldInfos,p={global:U({attributes:a,fieldInfoMap:o,fieldInfos:l,graphic:i,layer:s,relatedInfos:r,timeZone:n}),content:[]};return Array.isArray(t)&&t.forEach((t,e)=>{"fields"===t.type&&this._createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p}),"media"===t.type&&this._createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p})}),p}_checkForRelatedFeatures(t){const{graphic:e,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(e,k(i),t)}async _queryRelatedInfos(t,e,i){const{relatedInfos:r,_layer:s}=this;r.clear();const o=null!=s?.associatedLayer?await(s?.associatedLayer.load(i)):s;if(!o||!t)return;const a=e.filter(t=>!!t.fieldName&&L(t.fieldName));if(!a?.length)return;e.forEach(t=>this._configureRelatedInfo(t,o));const n=await N({relatedInfos:r,layer:o},i);Object.keys(n).forEach(t=>{const e=r.get(t.toString()),i=n[t]?.value;e&&i&&(e.layerInfo=i.data)});const l=await S({graphic:t,relatedInfos:r,layer:o},i);Object.keys(l).forEach(t=>{G(l[t]?.value,r.get(t.toString()))})}_configureRelatedInfo(t,e){const{relatedInfos:i}=this,r=q(t.fieldName||"");if(!r)return;const{layerId:s,fieldName:o}=r;if(!s)return;const a=i.get(s.toString())||H(s,e);a&&(z({relatedInfo:a,fieldName:o,fieldInfo:t}),this.relatedInfos.set(s,a))}};t([g()],K.prototype,"_error",void 0),t([g()],K.prototype,"_graphicChangedTask",void 0),t([g()],K.prototype,"_evaluateExpressionAttributesTask",void 0),t([g({readOnly:!0})],K.prototype,"_effectivePopupTemplate",null),t([g({readOnly:!0})],K.prototype,"_fieldInfoMap",null),t([g({readOnly:!0})],K.prototype,"_layer",null),t([g()],K.prototype,"abilities",void 0),t([y("abilities")],K.prototype,"castAbilities",null),t([g({readOnly:!0})],K.prototype,"content",void 0),t([g()],K.prototype,"description",void 0),t([g({type:Boolean})],K.prototype,"defaultPopupTemplateEnabled",void 0),t([g({readOnly:!0})],K.prototype,"isFeatureFromTable",null),t([g({readOnly:!0})],K.prototype,"state",null),t([g({readOnly:!0})],K.prototype,"formattedAttributes",void 0),t([g({type:e})],K.prototype,"graphic",void 0),t([g({readOnly:!0})],K.prototype,"lastEditInfo",void 0),t([g({type:v})],K.prototype,"location",void 0),t([g({readOnly:!0})],K.prototype,"relatedInfos",void 0),t([g({type:b})],K.prototype,"spatialReference",null),t([g()],K.prototype,"timeZone",null),t([g({readOnly:!0})],K.prototype,"title",void 0),t([g()],K.prototype,"map",null),t([g({readOnly:!0})],K.prototype,"waitingForContent",null),t([g()],K.prototype,"view",void 0),K=Q=t([_("esri.popup.Feature")],K);const V=K;export{V as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../Graphic.js";import{FeatureSetQueryInterceptor as i}from"../arcade/featureset/support/FeatureSetQueryInterceptor.js";import r from"../core/Accessor.js";import{isSome as s}from"../core/arrayUtils.js";import{createTask as o}from"../core/asyncUtils.js";import{IdentifiableMixin as a}from"../core/Identifiable.js";import n from"../core/Logger.js";import{abortMaybe as l}from"../core/maybe.js";import{eachAlways as p,isAbortError as h,throwIfAborted as c}from"../core/promiseUtils.js";import{watch as u,initial as d,when as f}from"../core/reactiveUtils.js";import{throttle as m}from"../core/throttle.js";import{property as g,subclass as y}from"../core/accessorSupport/decorators.js";import _ from"../geometry/Point.js";import b from"../geometry/SpatialReference.js";import{getGraphicLayer as v}from"../graphic/graphicOriginUtils.js";import T from"./content/TextContent.js";import{compileExpressionInfos as I,formatArcadeValue as A}from"./support/arcadeFeatureUtils.js";import x from"./support/FeatureAbilities.js";import{preLayerQueryCallback as C,preRequestCallback as E,createFieldInfoMap as w,getAllFieldInfos as F,querySourceLayer as k,queryUpdatedFeature as j,isRelatableFeatureSupportedLayer as P,isAssociatedFeatureSupportedLayer as R,formatEditInfo as O,substituteFieldsInLinksAndAttributes as M,graphicCallback as Z,formatAttributes as U,isRelatedField as L}from"./support/featureUtils.js";import{queryLayerInfos as N,queryRelatedFeatures as S,setRelatedFeatures as G,getRelatedFieldInfo as q,createRelatedInfo as H,updateRelatedInfo as z}from"./support/relatedFeatureUtils.js";import{system as B}from"../time/constants.js";var Q;const D=1;let J=class extends(a(r)){static{Q=this}constructor(t){super(t),this._error=null,this._graphicChangedTask=null,this._evaluateExpressionAttributesTask=null,this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities=new x,this.content=null,this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.graphic=null,this.lastEditInfo=null,this.location=null,this.relatedInfos=new Map,this.title="",this.view=null,this._graphicChangedThrottled=m(this._graphicChanged,()=>this.notifyChange("waitingForContent"),D,this),this._isAllowedContentType=t=>{const{abilities:e}=this;return"attachments"===t.type&&!!e.attachmentsContent||"custom"===t.type&&!!e.customContent||"fields"===t.type&&!!e.fieldsContent||"media"===t.type&&!!e.mediaContent||"text"===t.type&&!!e.textContent||"expression"===t.type&&!!e.expressionContent||"relationship"===t.type&&!!e.relationshipContent||"utility-network-associations"===t.type&&!!e.utilityNetworkAssociationsContent},this._evaluateExpressionAttributesThrottled=m(this._evaluateExpressionAttributes,()=>this.notifyChange("waitingForContent"),D,this),this.addHandles([u(()=>[this._effectivePopupTemplate,this.abilities.attachmentsContent,this.abilities.chartAnimation,this.abilities.customContent,this.abilities.expressionContent,this.abilities.fieldsContent,this.abilities.mediaContent,this.abilities.relationshipContent,this.abilities.textContent,this.abilities.utilityNetworkAssociationsContent,this.graphic,this.timeZone],()=>this._graphicChangedThrottled(),d),f(()=>{if(!this._graphicChangedTask?.finished||null==this._graphicChangedTask.value)return null;const t=this._graphicChangedTask.value,e=t?.expressionInfos?.dependencies;return[t,e?.has("view-scale")?this.view?.scale:null,e?.has("view-time-extent")?this.view?.timeExtent?.start:null,e?.has("view-time-extent")?this.view?.timeExtent?.end:null]},([t])=>this._evaluateExpressionAttributesThrottled(t))])}initialize(){this.addHandles([this._graphicChangedThrottled,this._evaluateExpressionAttributesThrottled])}destroy(){this._clear(),this._graphicChangedTask=l(this._graphicChangedTask),this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._error=null,this.graphic=null,this.relatedInfos.clear()}static{this.interceptor=new i(C,E)}get _effectivePopupTemplate(){return null!=this.graphic?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return w(F(this._effectivePopupTemplate),this._layer)}get _layer(){const{graphic:t}=this;return t?v(t):void 0}get isFeatureFromTable(){return this._layer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(t){this._override("spatialReference",t)}get timeZone(){return this.view?.timeZone??B}set timeZone(t){this._overrideIfSome("timeZone",t)}get map(){return this.view?.map||null}set map(t){this._override("map",t)}get waitingForContent(){const{_graphicChangedThrottled:t,_evaluateExpressionAttributesThrottled:e,_graphicChangedTask:i,_evaluateExpressionAttributesTask:r}=this;return t.hasPendingUpdates()||e.hasPendingUpdates()||null!=i&&!i.finished||null!=r&&!r.finished}async updateGeometry(){const{graphic:t,spatialReference:e,_layer:i}=this;await(i?.load());const r=i?.objectIdField;if(!r||!t||!i)return;const s=t?.attributes?.[r];if(null==s)return;const o=[s];if(!t.geometry){const r=await k({layer:i,graphic:t,outFields:[],objectIds:o,returnGeometry:!0,spatialReference:e}),s=r?.geometry;s&&(t.geometry=s)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}_graphicChanged(){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._graphicChangedTask=l(this._graphicChangedTask),this._graphicChangedTask=o(async t=>{this._error=null,this._clear();const{graphic:e}=this;try{if(!e)return null;const{_layer:i,_effectivePopupTemplate:r}=this,s=this.spatialReference;await j({graphic:e,popupTemplate:r,layer:i,spatialReference:s},{signal:t});const[{value:o},{value:a}]=await p([this._getContent(),this._getTitle()]),[,{value:n}]=await p([this._checkForRelatedFeatures({signal:t}),I(r?.expressionInfos,e)]);return{expressionInfos:n,content:o,title:a}}catch(i){throw h(i)||(this._error=i,n.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate})),i}})}_compileContentElement(t){return"relationship"===t.type?P(this._layer)?t:void 0:"utility-network-associations"===t.type?R(this._layer)?t:void 0:t}_compileContent(t){if(this.graphic)return Array.isArray(t)?t.filter(this._isAllowedContentType).map(t=>this._compileContentElement(t)).filter(s):"string"==typeof t?new T({text:t}).text:t}_compileLastEditInfo(){const{_effectivePopupTemplate:t,_layer:e,graphic:i,timeZone:r}=this;if(!t)return;const{lastEditInfoEnabled:s}=t,o=e?.editFieldsInfo;return s&&o?O(o,i?.attributes,r,e):void 0}_compileTitle(t){const{_fieldInfoMap:e,_layer:i,graphic:r,_expressionAttributes:s}=this,o=r?.attributes??{},a=this.formattedAttributes?.global??{};return M({attributes:o,fieldInfoMap:e,globalAttributes:a,expressionAttributes:s,layer:i,text:t})}async _getTitle(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"title",value:t?.title,event:{graphic:e}}):null}async _getContent(){const{_effectivePopupTemplate:t,graphic:e}=this;return e?Z({type:"content",value:t?.content,event:{graphic:e}}):null}_evaluateExpressionAttributes({title:t,content:e,expressionInfos:i}){this._evaluateExpressionAttributesTask=l(this._evaluateExpressionAttributesTask),this._evaluateExpressionAttributesTask=o(async r=>{const{graphic:s,map:o,view:a,spatialReference:l,location:p}=this;try{if(!s)return;let n;if(null!=i){const t=[];for(const[e,n]of i.expressions.entries())null!=n?t.push(n.evaluate({graphic:s,interceptor:Q.interceptor,location:p,map:o,options:{signal:r},spatialReference:l,view:a}).then(t=>[e,"string"==typeof t?A(t):t]).catch(()=>[e,void 0])):t.push(Promise.resolve([e,void 0]));n=Object.fromEntries(await Promise.all(t)),c(r)}this._expressionAttributes=n,this._graphicExpressionAttributes={...s.attributes,...n},this._set("formattedAttributes",this._createFormattedAttributes(e)),this._set("title",this._compileTitle(t)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(e)||null)}catch(u){h(u)||(this._error=u,n.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:u,graphic:s,popupTemplate:this._effectivePopupTemplate}))}})}_createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){const{_effectivePopupTemplate:r,graphic:s,relatedInfos:o,_layer:a,_fieldInfoMap:n,_graphicExpressionAttributes:l,timeZone:p}=this;i.content[e]=U({attributes:{...l,...t.attributes},fieldInfoMap:n,fieldInfos:r?.fieldInfos,graphic:s,layer:a,relatedInfos:o,timeZone:p})}_createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:i}){if(t.fieldInfos){const{graphic:r,relatedInfos:s,_layer:o,_fieldInfoMap:a,_graphicExpressionAttributes:n,timeZone:l}=this;i.content[e]=U({attributes:{...n,...t.attributes},fieldInfoMap:a,fieldInfos:t.fieldInfos,graphic:r,isContentFieldInfos:!0,layer:o,relatedInfos:s,timeZone:l})}}_createFormattedAttributes(t){const{_effectivePopupTemplate:e,graphic:i,relatedInfos:r,_layer:s,_fieldInfoMap:o,_graphicExpressionAttributes:a,timeZone:n}=this,l=e?.fieldInfos,p={global:U({attributes:a,fieldInfoMap:o,fieldInfos:l,graphic:i,layer:s,relatedInfos:r,timeZone:n}),content:[]};return Array.isArray(t)&&t.forEach((t,e)=>{"fields"===t.type&&this._createFieldsFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p}),"media"===t.type&&this._createMediaFormattedAttributes({contentElement:t,contentElementIndex:e,formattedAttributes:p})}),p}_checkForRelatedFeatures(t){const{graphic:e,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(e,F(i),t)}async _queryRelatedInfos(t,e,i){const{relatedInfos:r,_layer:s}=this;r.clear();const o=null!=s?.associatedLayer?await(s?.associatedLayer.load(i)):s;if(!o||!t)return;const a=e.filter(t=>!!t.fieldName&&L(t.fieldName));if(!a?.length)return;e.forEach(t=>this._configureRelatedInfo(t,o));const n=await N({relatedInfos:r,layer:o},i);Object.keys(n).forEach(t=>{const e=r.get(t.toString()),i=n[t]?.value;e&&i&&(e.layerInfo=i.data)});const l=await S({graphic:t,relatedInfos:r,layer:o},i);Object.keys(l).forEach(t=>{G(l[t]?.value,r.get(t.toString()))})}_configureRelatedInfo(t,e){const{relatedInfos:i}=this,r=q(t.fieldName||"");if(!r)return;const{layerId:s,fieldName:o}=r;if(!s)return;const a=i.get(s.toString())||H(s,e);a&&(z({relatedInfo:a,fieldName:o,fieldInfo:t}),this.relatedInfos.set(s,a))}};t([g()],J.prototype,"_error",void 0),t([g()],J.prototype,"_graphicChangedTask",void 0),t([g()],J.prototype,"_evaluateExpressionAttributesTask",void 0),t([g({readOnly:!0})],J.prototype,"_effectivePopupTemplate",null),t([g({readOnly:!0})],J.prototype,"_fieldInfoMap",null),t([g({readOnly:!0})],J.prototype,"_layer",null),t([g({type:x})],J.prototype,"abilities",void 0),t([g({readOnly:!0})],J.prototype,"content",void 0),t([g()],J.prototype,"description",void 0),t([g({type:Boolean})],J.prototype,"defaultPopupTemplateEnabled",void 0),t([g({readOnly:!0})],J.prototype,"isFeatureFromTable",null),t([g({readOnly:!0})],J.prototype,"state",null),t([g({readOnly:!0})],J.prototype,"formattedAttributes",void 0),t([g({type:e})],J.prototype,"graphic",void 0),t([g({readOnly:!0})],J.prototype,"lastEditInfo",void 0),t([g({type:_})],J.prototype,"location",void 0),t([g({readOnly:!0})],J.prototype,"relatedInfos",void 0),t([g({type:b})],J.prototype,"spatialReference",null),t([g()],J.prototype,"timeZone",null),t([g({readOnly:!0})],J.prototype,"title",void 0),t([g()],J.prototype,"map",null),t([g({readOnly:!0})],J.prototype,"waitingForContent",null),t([g()],J.prototype,"view",void 0),J=Q=t([y("esri.popup.Feature")],J);const K=J;export{K as default};
|